commit 05a58f53e6f448aa57d7fce875cc329aedce6789 Author: aFolletete Date: Tue Apr 12 18:24:40 2011 +0000 // 1.5 branche creation diff --git a/404.php b/404.php new file mode 100644 index 000000000..2048d73a0 --- /dev/null +++ b/404.php @@ -0,0 +1,42 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Send the proper status code in HTTP headers */ +header('HTTP/1.1 404 Not Found'); +header('Status: 404 Not Found'); + +if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif'))) +{ + require_once(dirname(__FILE__).'/config/settings.inc.php'); + header('Location: '.__PS_BASE_URI__.'img/404.gif'); + exit; +} +elseif (in_array(substr($_SERVER['REQUEST_URI'], -3), array('.js', 'css'))) + die(''); + +require_once(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('PageNotFoundController')->run(); diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 000000000..f17cc860f --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,2406 @@ +2007-2011 PrestaShop + +NOTICE OF LICENSE + +This source file is subject to the Open Software License (OSL 3.0) +that is bundled with this package in the file LICENSE.txt. +It is also available through the world-wide-web at this URL: +http://opensource.org/licenses/osl-3.0.php +If you did not receive a copy of the license and are unable to +obtain it through the world-wide-web, please send an email +to license@prestashop.com so we can send you a copy immediately. + +DISCLAIMER + +Do not edit or add to this file if you wish to upgrade PrestaShop to newer +versions in the future. If you wish to customize PrestaShop for your +needs please refer to http://www.prestashop.com for more information. + +@author PrestaShop SA +@copyright 2007-2011 PrestaShop SA +@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +International Registred Trademark & Property of PrestaShop SA + +Release Notes for PrestaShop 1.4 +-------------------------------- +#################################### +# v1.4.0.17 - 5552 (2011-03-16) # +#################################### + + Improved/changed features: + + [*] BO : #8322 Updating natives modules author to PrestaShop + [*] BO : Resolves spaces split in meta keywords + [*] BO : Truncating displayed author name + [*] BO : adding one more empty check cond + + [*] MO : Warnings for preactivations in module section + + Fixed bugs: + + [-] FO : fixed bug #8317 - Carrier selection javascript bug + [-] FO : fixed bug #8318 - view credit slips error + [-] FO : fixed bug #8326 - Errors in mail templates + [-] FO : fixed bug with CSS missing calls + + [-] BO : fixed bug #8321 - Incorrect translations in mails/fr/lang.php + [-] BO : fixed bug #8330 - Always have warning for “URL rewriting + [-] BO : fixed bug #8330 - Always have warning for “URL rewriting + [-] BO : fixed bug #8336 - Missing image + [-] BO : fixed bug #8338 - Product chooser for packs is buggy when product name ends with whitespace + [-] BO : fixed bug #8342 - missing opening table row tag + [-] BO : fixed bug #8344 - span not closed in AdminProducts + + [-] MO : Fix on Twenga translations + [-] MO : Fix on css AdminHome Tab + [-] MO : fixed bug #8323 - Customer Mail Alerts + [-] MO : fixed little bug on Authorize.net module + + [-] WS : Minor bug fixed + [-] WS : Small fix + + [-] TR : english translation error message + + +#################################### +# v1.4.0.16 - 5477 (2011-03-14) # +#################################### + + Added Features: + + [+] BO : Adding module author display and filter + [+] BO : Adding module author searching + [+] BO : Optimization tips integration + [+] BO : Setting natives modules author to Prestashop + + [+] Core : Hooks for category add/upd/del are now including the object information in $params + + Improved/changed features: + + [*] INSTALLER : Preactivation can now be done in two parts + [*] INSTALLER : Preactivation can now manage several partners + [*] INSTALLER : Preactivation help context is now available + [*] INSTALLER : Update preinstallation module system + + [*] FO : SpecificPrices score is now influenced by the date (Thanks Nik Chankov) + [*] FO : improvement of liveEdit - now you can navigate on your font-office staying on LiveEdit mode + + [*] BO : Admin home page is now in tabs/AdminHome + [*] BO : AdminTaxRules help text + [*] BO : Help Access message + [*] BO : Home display improved + [*] BO : Paypal Advise Block + [*] BO : adding help on Theme fieldset + [*] BO : module search autocomplete improvement Now when you select the desired module search form is valid automaticaly + [*] BO : optimization tips can now be activated again + + [*] Core : class AdminGeolocalization is now AdminGeolocation + + [*] MO : Layered navigation module + [*] MO : Layered navigation module + [*] MO : Layered navigation module - missing French translations + [*] MO : Layered navigation module improvements (Cache table is updated automatically if possible, + [*] MO : Layered navigation module was re-done entirely, few features missing but already working well + + [*] WS : 2 new entities managed: StockMvt and StockMvtReason + [*] WS : Add description for a key + [*] WS : Enhance WS Behavior + [*] WS : Move Webservice in classes + [*] WS : Refactoring for release + + [*] TR : add translation + [*] TR : english traduction + [*] TR : english traduction + [*] TR : improved english translations + [*] TR : improved english translations + [*] TR : improved english translations + + Fixed bugs: + + [-] Project : many fixes for 1.3 to 1.4 upgrade + + [-] INSTALLER : ISO Code UK was changed to GB + [-] Installer : Bug Fixed #8198 Upgrade from 1.1.0.5 + [-] Installer : Fixed #8143 - url_rewrite corrected in ps_meta_lang + [-] Installer : fixed bug #8128 - guest-tracking.php doesn’t have friendly URL + [-] Installer : jqminmax removed - incompatibility between jquery + jqminmax + chrome + + [-] FO : Bug Fixed #8154 - EU VAT module & Shipping taxes + [-] FO : Bug Fixed #8200 - Down button on the order page is not disabled for customized product with minimum quantity + [-] FO : Fixed #7859 - pre-order product displayed correctly when stock < 0 + [-] FO : Fixed bug - live edit js added when live edit mode is off + [-] FO : No taxes when using states & county + [-] FO : Price Comparison HTML entities + [-] FO : fixed a quantity bug in blockwishlist when a user add a gift to his cart + [-] FO : fixed bug #7816 - Error reporting on “one page checkout” + [-] FO : fixed bug #8020 - Folder /session permission problem + [-] FO : fixed bug #8052 - unexpected HOME link on the CGV window popup + [-] FO : fixed bug #8053 - Cart errors cause parsererror + [-] FO : fixed bug #8072 - Gift-wrapping Price is not added in cart_summary + [-] FO : fixed bug #8075 - no carriers available on opc page + [-] FO : fixed bug #8082 - Change status of default language + [-] FO : fixed bug #8119 - Another grammar issue: “Please to sign in in order to see payment methods” + [-] FO : fixed bug #8119 - Another grammar issue: “Please to sign in in order to see payment methods” part 2 + [-] FO : fixed bug #8164 - Extra ‘-’ characters in the subcategory names when using Chrome + [-] FO : fixed bug #8169 - Wronng order assignment in header + [-] FO : fixed bug #8194 - Undefined variable tax_cost line 291 + [-] FO : fixed bug #8237 - Undefined variable tax_cost line Filezilla breaks HTTPS + [-] FO : fixed bug #8244 - display not correct if supplier or manufacturer not exist + [-] FO : fixed bug #8245 - redirect inexistant category & product + [-] FO : fixed bug #8250 - User addresses not displayed with “Compress inline JavaScript” + [-] FO : fixed bug #8263 - Invoice footer align + [-] FO : fixed bug #8280 - “Your shopping cart contains # products: message not updated + [-] FO : fixed bug #8290 - setMedia called twice, JS files doubled + [-] FO : fixed bug compared to the map stores.php with CCC activated + [-] FO : fixed bug upload.gif not show when save customized products + [-] FO : fixed bug when you close the mode live edit + [-] FO : fixed bug with “Compress inline JavaScript” + [-] FO : fixed but which display the number of product in stock whatever the number of last quantities chosen in BO + [-] FO : fixed but which display the number of product in stock whatever the number of last quantities chosen in BO, fixed bug in the last commit + [-] FO : fixed notice in Tools::addJs and addCss + [-] FO : getLanguages will now call loadLanguages if self:: is not set + [-] FO : improvement liveEdit + [-] FO :fixed bug #7875 - 1.4 legend icon in optionlist of admintab + [-] FO :fixed bug #7962 - same category and EAN13: bad link + [-] FO :fixed bug #8050 - Don´t order attribute groups by name + [-] FO :fixed bug #8055 - Stats shop search not work + [-] FO :fixed bug #8091 - Typo in french message in fianetfraud module + + [-] BO : Bug Fixed #8158 - Htaccess generation => category block cache cleaned + [-] BO : Bug fixed #7987 : Labels size and weight were changed to be less ambiguous + [-] BO : HelpAccess popup size + [-] BO : Helpaccess cluetip + [-] BO : Little fix for by pass gd library bug + [-] BO : Try to upload a file too large as a product picture = no error message + [-] BO : added a update of the date when a customer is enabled or disabled + [-] BO : fixed a translation bug in customer groups. Changed "fehler" to "Default" + [-] BO : fixed bug #7800 - Delete all combinations + [-] BO : fixed bug #7961 - Chrome and password pages + [-] BO : fixed bug #8010 - svn5232 states not showing in admin-customers-addresses + [-] BO : fixed bug #8087 - BO let you set disabled language as default + [-] BO : fixed bug #8127 - bug on guest tracking + [-] BO : fixed bug #8177 - Not translatable + [-] BO : fixed bug #8258 - Broken link in BO + [-] BO : fixed bug #8288 - Counties tab is missing icon + [-] BO : fixed bug - if vatnumber module don't exist => don't make ajax in AdminAddresses + [-] BO : fixed bug save and preview bad redirect + [-] BO : no more strip_tags on htaccess specific tags + + [-] Classes : fixed bug - bad duplicate check when Tools::addJs() is call with array params + [-] Classes : fixed bug on config xml generation for modules + + [-] MO : Editorial - Text is cutoff + [-] MO : Module UPS, fix on xml file + [-] MO : Moneybookers, plaform variable has been changed + [-] MO : fianetfraud statuses ids fixed + [-] MO : fixed bug #8090 - soCollisimo under Firefox + [-] MO : fixed bug #8107 - Alignment issues productscategory and cross selling + [-] MO : fixed bug #8115 -Grammar error in PayPal payment description + [-] MO : fixed bug #8146 - Block bestsellers + [-] MO : fixed bug #8166 - Admin tab of module EnvoiMoinsCher not translated + [-] MO : fixed css path - crosselling + + [-] PDF : Bug Fixed #7295 - Ecotax + [-] PDF : Undefined index PS_SHOP_DETAILS + + [-] TR : BO Home english + [-] TR : Bug Fixed #8140 - Bad grammar in guest_to_customer mail template + [-] TR : fix minor english translation + [-] TR : fix minor english translation + [-] TR : fix minor english translation + [-] TR : presta-fraud english traduction + + [-] LO : Bug Fixed #7972 - Australian price format + [-] LO : Missing english language + +#################################### +# v1.4.0.15 - 5285 (2011-03-02) # +#################################### + + Added Features: + + [+] Project : added live edit module position + [+] Project : added live edit module position part 2 + + [+] MO : Module Ekomi + + Improved/changed features: + + [*] INSTALLER : Preactivation Module is now generic + [*] INSTALLER : Preactivation Paypal (new theme and field check) + [*] installer : timezone bugfix + + [*] FO : Log.php renamed to Logger.php, modified addLog() prototype to add allowDuplicate arguments + [*] FO : better integration of vat + [*] FO : many improvements on One Page Checkout + + [*] BO : Counties + [*] BO : Ecotax options is now in the tax tab + ecotax without tax + [*] BO : eco-tax + [*] BO : now you can't translate with AdminTranslation if php suhosin configuration does not allow it + [*] BO : you can now define your own default page instead of "index.php" + + [*] Core : Manufacturer and supplier controllers are Object now + + [*] MO : Added an "Enabled filters" zone in the layered navigation + [*] MO : Added real time criterions refresh for the layered navigation block (still in progress) + [*] MO : Added some modifications for the layered navigation block (still in progress) + [*] MO : Fixed small bugs in the layered navigation + [*] MO : Instead of not showing them, empty values for layered navigation are now displayed and disabled (like on Target.com) + [*] MO : Layered navigation module updated + [*] MO : Layered navigation module updated + [*] MO : Layered navigation module updated + [*] MO : You can now filter by attribute and color (+ color picker!) in the layered navigation + [*] MO : You can now filter by feature in the layered navigation + [*] Mo : Hipay - Little fixes + + [*] WS : Added associated product of a category + [*] WS : Category entity now contain children's ids + + Fixed bugs: + + [-] INSTALLER : Bug fixed #7643 - Missing default picture + [-] INSTALLER : Fix on Preactivation + [-] Installer : Fixed sql query malformed + [-] Installer : auto-timezone for installer with special rules for Usa and Russia + [-] Installer : fixed bug #7950 - typo error + [-] Installer : fixed url-rewrite for cms default data + [-] Installer : removed auto select currency + + [-] FO : Bug Fixed #7939 - Discount percentage displayed is incorrect + [-] FO : Bug Fixed #7939 - Group discount and product reduction + [-] FO : Bug Fixed #7958 - Cart Error with more 2 than decimal (eg. 0.001) + [-] FO : Bug Fixed Combination + % discount + tax excluded + [-] FO : Ecotax is not impacted by the discount + [-] FO : Fixed #7712 - now free shipping is displayed on the cart summary and can be deleted + [-] FO : Fixed #7897 is now self::$smarty + [-] FO : Fixed #7901 BestSalesController uses now process instead of preProcess() + [-] FO : Fixed #7989 - when ssl is not activated, getlink will not return ssl domain name + [-] FO : Taxes by country fixed! + [-] FO : fixed bug #7933 - Disable shop for maintenance not work + [-] FO : fixed bug #7935 - same category “-” which drags + [-] FO : fixed bug #7944 //Error on Checkout orders step 2 + [-] FO : fixed bug #7946 //VAT include file + [-] FO : fixed bug #7947 //States not showing BO edit address + [-] FO : fixed bug #7984 - Product compare + + [-] BO : AdminTaxRulesGroup Apply Country Tax Only (not product tax) + [-] BO : Fixed #7722 - when you edit a product image, it's now displayed edit and not add + [-] BO : Fixed #7919 - htaccess generation will ignore meta_rewrite from db if they are not valid + [-] BO : Fixed #7969 - className + [-] BO : Fixed #7970 - now pdf footer allow registration information multiline (set in Preferences contact) + [-] BO : Fixed #7985 added warning message when change default currency + [-] BO : Fixed bug #7655 + [-] BO : Fixed email translation + [-] BO : Fixed warning about missing or unvalid module file translation + [-] BO : Tax label become Tax Rule on the product page + [-] BO : Thanks to aFolletete the AdminTaxRules form is beautifull! + [-] BO : bug fixed #7771 + [-] BO : clear error message for AdminTranslations when suhosin + [-] BO : ecotax id not found if ecotax is desactivated + [-] BO : fixed bug #6448 //No manufacturers in drop down list with creating new product + [-] BO : fixed bug #7949 //BO edit product JS errors + [-] BO : fixed bug #7981 - Edit Product page always displays ‘condition’ as ‘New’ + [-] BO : fixed bug #8023 - Backoffice store locator, state selection issue + [-] BO : some sentences are changed. + + [-] Classes : Incorrect test in dieObject + [-] Classes : fixed bug #7930 - Add a discount voucher : Fatal error / White page + [-] Classes : fixed bug #7994 - Unusefull object instanciation in AdminTab::postprocess() + [-] Classes : fixed bug #7999 - deleted language and cookie don’t go along very well + [-] Classes : fixed bug #7999 part 2 ;) + + [-] Core : bug fixed on FrontController with the geolocation + [-] Core : fixed bug on FrontController with Geoloaction + + [-] MO : allow displaying warning message. + [-] MO : check if a tsID value is set before display the seal of approval. + [-] MO : delete a "console" object in javascript. + [-] MO : fia-net must not be called when the order is free + [-] MO : fixed bug #7934 - tax disable but cart display tax included + [-] MO : fixed bug #7976 - Module USPS + [-] MO : fully compatible 1.3 + [-] MO : use Tools::jsonEncode() rather than json_encode (same for json_decode) + + [-] TR : Add translation according to #7655 + [-] TR : change the method Mail::l(), now don't use htmlentities for output translation (don't working for email subject) + [-] TR : change the subject parameter for each Mail::send() method. + [-] TR : little translations corrections. + [-] TR : use google translate button for Errors, PDF and fields translations. + + +#################################### +# v1.4.0.14 - 5144 (2011-02-23) # +#################################### + + Added Features: + + [+] BO : Add Tools::jsonDecode() method for php5.0.0 version. + [+] BO : A nex error class for inline error + [+] BO : fixed bug delete images on import + + [+] MO : fixed bug shopImport clean database fields before run import + [+] MO : fixed bug shopImport update categories only when all are import + [+] MO : new module Authorize AIM + + Improved/changed features: + + [*] FO : now smarty, cart, link and cookie are static and protected properties in FrontController. + + [*] BO : improve specific price system + [*] BO : you can now define the center of the map + + [*] Classes : adding constant on Cart class for getOrderTotal method + [*] Classes : all private attributes and methods are now protected + [*] Classes : getPriceCalculation return the price without any dependances to others objects + [*] Classes : improvement of findTranslations method on Module class + + [*] Core : code cleaning + + [*] MO : improve blockstore module + + Fixed bugs: + + [-] PROJECT : thickbox.tpl has been removed (not use anymore) + + [-] Installer : change the english title of Leather folio product in english ! + [-] Installer : Fixed #6914 - now _MYSQL_ENGINE is defined in doUpgrade if not exists + [-] Installer : fixed alter table address dni can be null + [-] Installer : fixed bug #7835 + [-] Installer : fixed bug #7848 + [-] Installer : fix update 1.4.0.10 (dni field can be null) + [-] INSTALLER : Preactivation Paypal + + [-] FO : Combination + EcoTax + [-] FO : Fixed #7759 - cleaning code + [-] FO : Fixed #7761 removed not used variable + [-] FO : Fixed #7819 - typo (SLL is now SSL) + [-] FO : fixed bug #7780 - “There is undefined error” in one page checkout + [-] FO : fixed bug #7801 - Merchandie return + [-] FO : fixed bug #7834 + [-] FO : fixed bug on compatibilty of theme with smarty v2 + [-] FO : fixed bug on error feedback on One page checkout + [-] FO : fixed class not exists + [-] FO : fixed log message when cart is not set + [-] FO : now id_currency is correctly used in PaymentModule->ValidateOrder() + [-] FO : when a tpl file is missing for a module, error message now display module name + + [-] BO : Bug fixed #7717 - Quantity field error won't display anymore when editing product (movement stock) + [-] BO : Bug fixed #7723 - Fixing clean function of product metakeywords + [-] BO : Bug fixed #7773 - Delete customer group relation when deleting customer + [-] BO : Bug fixed reduction amount is not updated in order details + [-] BO : Fixed #7846 - correct image for mail and invoice logo + [-] BO : Fixed AdminThemes checks feature in change appearance + [-] BO : Fixed all the typos in the installer tool and made the texts easier to understand + [-] BO : Fixed all the typos in the tab names + [-] BO : fixed bug #5908 - PS rewrite images if edit category! and delete previous + [-] BO : fixed bug #7238 - Automatic filter on list with select type now returns error + [-] BO : fixed bug #7750 - typo: cache_defaut_attribute AdminProducts.php + [-] BO : fixed bug #7804 //Admin Module bad display in IE7 + [-] BO : fixed bug #7809 - Currency symbol not shown in admin/products + [-] BO : Unit price on cart & orders + + [-] Classes : fixed bug #7790 - Small bug in config.xml + [-] Classes : fixed bug #7797 - Cannot update cms pages + [-] Classes : fixed bug #7831 #7830 - two method are in PDF class are on public visibility + [-] Classes : fixed bug #7864 - PaymentModule::getCurrency uses $cookie + + [-] Core : fixed bug #7791 - unnecessary is_writable() check + [-] Core : set_magic_quotes_runtime is deprecated + [-] Core : set_magic_quotes_runtime is deprecated + + [-] MO : Add limited countries for Twenga module (FR, DE, UK, GB) + [-] MO : Check if Json functions are enabled, otherwise a warning occured. + [-] MO : fixed #7815 translation bug when quotes + [-] MO : fixed bug #7849 - Paypal Module - IPN Notifications + [-] MO : fixed bug check language in import + [-] MO : fixed bug on Blockstore + [-] MO : import oscommerce product status + [-] MO : shopImport : now when import product only they are added to home category by default + [-] MO : USPS module is now using RateV4 API + + [-] WS : Added check for POST/PUT multiple + + [-] TR : Bug fixed #7691 - Little translation fix + [-] TR : Change the PS_TRANS_PATTERN for allow empty string (and don't get a wrong sentence) + [-] TR : Fixed french translation + + Deprecated methods: + + [~] Deprecated : added comment + [~] Deprecated : AddressCore::getManufacturerIdByAddress([...]) + [~] Deprecated : CartCore::getNonOrderedCarts([...]) + [~] Deprecated : CartCore::hasProductInCategory([...]) + [~] Deprecated : CMSCategory::CMSCategoryExists() + [~] Deprecated : CMSCategory::getRootCMSCategory() + [~] Deprecated : CMSCategory::searchByNameAndParentCMSCategoryId() + [~] Deprecated : CMSCore::isInBlock([...]) + [~] Deprecated : CMSCore::updateCmsToBlock([...]) + [~] Deprecated : ConfigurationCore::getMultipleInt([...]) + [~] Deprecated : CountryCore::getNeedIdentifcationNumber([...]) + [~] Deprecated : CustomerCore::cantChangeemail([...]) + [~] Deprecated : CustomerCore::getLastCart([...]) + [~] Deprecated : CustomerCore::getNeedDNI([...]) + [~] Deprecated : CustomerCore::getNewsletteremails([...]) + [~] Deprecated : CustomerCore::getTodaysRegistration([...]) + [~] Deprecated : CustomerCore::isMemberOfGroup([...]) + [~] Deprecated : DiscountCore::isParentCategoryProductDiscount([...]) + [~] Deprecated : EmployeeCore::getEmployees([...]) + [~] Deprecated : LinkCore::getCustomLink([...]) + [~] Deprecated : LinkCore::getLanguageLinkAdmin([...]) + [~] Deprecated : ManufacturerCore::getManufacturersWithoutAddress([...]) + [~] Deprecated : OrderCore::getLastMessage([...]) + [~] Deprecated : OrderCore::getMonthlySales([...]) + [~] Deprecated : OrderCore::getWeeklyOrders([...]) + [~] Deprecated : OrderCore::isLogable([...]) + [~] Deprecated : ProductCore::deleteCustomizedDatas([...]) + [~] Deprecated : ProductCore::deleteQuantityDiscounts([...]) + [~] Deprecated : ProductCore::getBasicPrice([...]) + [~] Deprecated : ProductCore::getByReference([...]) + [~] Deprecated : ProductCore::getDefaultCategoryProducts([...]) + [~] Deprecated : TabCore::getClassNameFromID([...]) + [~] Deprecated : TaxCore::getRateByState([...]) + [~] Deprecated : ValidateCore::isDniBool([...]) + [~] Deprecated : ValidateCore::isGenderIsoCode([...]) + [~] Deprecated : ValidateCore::isGenderName([...]) + [~] Deprecated : ValidateCore::isGranularityValue([...]) + [~] Deprecated : ValidateCore::isIcoFile([...]) + [~] Deprecated : ValidateCore::isIconFile([...]) + [~] Deprecated : ValidateCore::isOptId([...]) + [~] Deprecated : ValidateCore::isProtocol([...]) + [~] Deprecated : ValidateCore::isTplFileName([...]) + [~] Deprecated : ValidateCore::isZoneName([...]) + + +#################################### +# v1.4.0.13 - 5003 (2011-02-16) # +#################################### + + Added Features: + + [+] Core : Added useIncludePath and streamContext parameters to Tools::file_get_contents() + + [+] MO : import order from oscommerce + [+] MO : new module "LiveZilla" for live chat + + Improved/changed features: + + [*] FO : Bug fixed #7631 - Attribute List now sorted by group public name + + Fixed bugs: + + [-] PROJECT : Bug fixed #7644 - Function Customer::getConnections is now deprecated + + [-] FO : Bug fixed #7654 - Fix add to cart button when instant search is enabled + [-] FO : Bug fixed #7665 - Template html standard compliant + [-] FO : cookie call in a server-to-server validation script removed + [-] FO : fixed bug #7453 + [-] FO : fixed bug #7635 + [-] FO : fixed bug : taxes are now correctly display in block cart + [-] FO : useless group by clause removed + + [-] BO : Bug fixed #7629 - Fix on htaccess specific configuration + [-] BO : Bug fixed #7640 - Fix on attachment edit + [-] BO : Bug Fixed #7642 - Tax rules group name length + [-] BO : Bug fixed #7647 - Fix on flag "new" order + [-] BO : Bug fixed #7667 - Clicking “Back to product” on the product combinations generator now returns to "4. Combinations" tab + [-] BO : Bug fixed #7695 - Search index flag fixed + [-] BO : cache on product attributes fixed + [-] BO : Can't modify already defined specific prices + [-] BO : EcoTax calculation on the product page form + [-] BO : Fixed #6806 - now order is properly set in Catalog when editing product/changing product position + [-] BO : Fixed #7547 + [-] BO : Fixed #7602, now email password for smtp can contains # + [-] BO : Fixed #7646 importing more than one image via csv now works properly even if space after comma + [-] BO : fixed bug #7661 //AdminImport Fatal error (SpecificPrice -> from is empty) + [-] BO : fixed bug #7721 //Downloadable products display problem + [-] BO : fixed bug : Notice Trying to get property of non-object + [-] BO : fixed bug : Notice Trying to get property of non-object + [-] BO : fixed bug with toggle + [-] BO : Removed additional / in filename + [-] BO : Undefined field id when you duplicate a product + [-] BO : when deleting a language, now delete all default pictures + + [-] Classes : fixed bug #7686 - unused private static property in ProductCore + + [-] CORE : fixed bug #7682 - sizeOf function call instead of sizeof? + + [-] MO : delete a debug output class + [-] MO : delete a notice error + [-] MO : Fixed #7612 id search_query in css theme file replaced by a class + [-] MO : fixed bug #7439 - Paypal module and warning after payment + [-] MO : fixed bug #7591 - Still getting timestamp error on PayPal module + [-] MO : fixed bug #7726 - Moneybookers detail filled with { + [-] MO : fixed bug shop import + [-] MO : fixed bug TECHNICAL ERROR add to cart + [-] MO : Little fix on USPS Module + [-] MO : replace "echo" by "return" function for displaying the admin content. + + [-] TR : Bug fixed #7666 - Little translation fixed + [-] TR : delete a console log + [-] TR : fix a displaying problem with quote. + [-] TR : Fixed #7611 added 'to' in english + [-] TR : Fixed #7611 added 'to' in english, moved es/fr/de translation + [-] TR : related to bug #7529 - change the way to use google translate, for one input at once. + + +#################################### +# v1.4.0.12 - 4900 (2011-02-09) # +#################################### + + Added Features: + + [+] Installer : Now shipping and Security payment pages are deleted in catalog mode. + [+] Installer : set default currency depends on localization + + [+] FO : Don't display some element if catalog mode is setted + + [+] BO : new feature check theme compatibility : now changing theme will check if guest_checkout, one_page_checkout, ccc and store_locator has been validated by the theme designer before changing it. If not, theses functions must be desactivated. + + [+] MO : DIBS module - the introduction text is added + [+] MO : Trusted Shops adding functionality : Buyer protection and seal of approval + [+] MO : Trusted Shops adding functionality : Buyer protection and seal of approval + [+] MO : adding new native module: Criteo + [+] MO : adding the automaticaly generation of config.xml files for modules + + [+] WS : Add entity Employee + + [+] PDF : method PDF::convertSign() is changed for more lisibility. + + Improved/changed features: + + [*] BO : $validateDni is a boolean, but was compared to integer for display error message + [*] BO : Check the IP of the cookie is now optional + [*] BO : Deprecated function add a log message + [*] BO : added warning after the update: you must regenerate your htaccess file + [*] BO : adding screencast at home of backoffice + [*] BO : you can now search for back office features with the "search everywhere" feature + + [*] Core : some variables are now protected instead of private + + [*] MO : Shop Import now support images import + [*] MO : You can now import images from oscommerce + [*] MO : blocksearch module is no longer hooked in header + [*] MO blockpaymentlogo : added empty option for select box + + [*] WS : Improve debug in Webservice + [*] WS : add support for i18n synopsis + + Fixed bugs: + + [-] Project : Fixed bug #7365 on Configuration + + [-] Installer : Fixed bug during install + [-] Installer : Bug Fixed #7526 - temporary table + [-] Installer : change localization values for english + + [-] FO : Bug Fixed #7477 - Total tax line disapear + [-] FO : Bug Fixed #7520 - Tax included text is not visible in blockcart.tpl + [-] FO : Bug Fixed #7545 - Accessories always displayed tax incl + [-] FO : Fixed #7429, #7496 - now getProducts() will call checkAccess, except if you call it with = false in your controller + [-] FO : Fixed #7495 removed extra html tag + [-] FO : Fixed bug #7476 + [-] FO : Fixed bug to get iso_code from country in preProcess() + [-] FO : Price display in cart is not refreshed on quantity discount + [-] FO : When you activate blocksearch on top and on left (or right), autocomplete AND instantsearch works properly (input id changed) + [-] FO : When you activate blocksearch on top and on left (or right), autocomplete AND instantsearch works properly (input id changed) + [-] FO : fixed bug #7418 - Blockcart breaks search results + [-] FO : fixed bug #7492 - Not valid DNI raises two errors instead of one + [-] FO : fixed bug #7550 - Only one ?\226?\128?\152position?\226?\128?\153 was changed to $orderbydefault in product-sort.tpl + [-] FO : fixed bug #7551 - Another code formatting issue + [-] FO : fixed javascript error on product page + [-] FO : if catalog mode is actived and no combination exists, the form #buy_block is hidden. + [-] FO : now Validate::isDni() return true for empty value + + [-] BO / FO : Ecotax - with or without tax + + [-] BO : Added fr translation errors for AdminThemes new function + [-] BO : AdminCarts shipping price displayed Tax Inc. when user is in Tax Exc. group + [-] BO : Bug Fixed #7549 - Preview and new product + [-] BO : Fixed #7508 error on preferences/appearance tab + [-] BO : Fixed #7552 error in config.xml default theme file + [-] BO : Fixed #7557 in admin module tab, items are now displayed in correct language + [-] BO : Fixed an error in AdminThemes + [-] BO : Fixed theme compatible functions when config file is missing or malformatted + [-] BO : controller friendly URL are not set with a default value when you add a new language + [-] BO : fixed bug #7452 - then i editing an existing product tags is missing + [-] BO : fixed bug #7453 + [-] BO : fixed bug #7464 + [-] BO : fixed bug #7472 + [-] BO : fixed bug #7490 //Fail importing image category from CSV + [-] BO : fixed bug #7541 - Bad Conf message when updating a form in the Back-Office + [-] BO : fixed bug #7576 //in sitemap template, store link even if you dont have any shops + [-] BO : fixed bug on back office with noLink parameters + [-] BO : fixed bug on import csv + + [-] MO : Bug fixed #7099 - Upgrade fedex module + [-] MO : Bug fixed #7467 - Shared Wishlist items is now working + [-] MO : Fixed bug #7563 + [-] MO : TrustedShops Spanish + [-] MO : fixed bug #7503 - Typo error in email templates + [-] MO : fixed bug #7525 - [Debug] This page has moved + [-] MO : fixed bug #7535 - paypal logos + [-] MO : set flags for language (needed to choose the link to subscribe) + + [-] TR : Bug fixed #5348 - Little translation fixed in the cart - 2011-02-07 10:37 + [-] TR : Fixed some english translations + [-] TR : New english translations fixed + [-] TR : fixed bug #7486 - Typo error + [-] TR : fixed bug #7518 - Typo error + +#################################### +# v1.4.0.11 - 4774 (2011-02-02) # +#################################### + + Added Features: + + [+] BO : added translation + [+] BO : column match in csv import (SQL) + [+] BO : now you can save column match in csv import ;-) + + [+] MO : Twenga module is now compatible with 1.3alpha version and some indentations has been replaced in well format. + + [+] TR : related to bug #6149 - change the way to copy country translations. Now it used EN language. + + Improved/changed features: + + [*] FO : 300 Ko of memory saved for each page + [*] FO : Bug fixed #7278 - It is now possible to specify the module for cart ajax in cart controller + [*] FO : Bug fixed #7278 - Set new method to enable the possibility to override cart ajax module include + [*] FO : Complicated cache on cart product attributes + [*] FO : Friendly URL behavio(u)r changed when you have a unique active language + [*] FO : One more cache (product specs) and some cleaning + [*] FO : cache added to the product feature, which avoid a few queries when there are products in the cart + [*] FO : one less query when the cart is empty + [*] FO : too much queries for the same things, again and again + [*] FO : translations files inclusion deported to the right place, up to 150 Ko / page saved + + [*] BO : Strict Standard - removed constructor which only calls its parents in classes/ImportModule + [*] BO : Token verification is now ugly, but REALLY secure + [*] BO : added tips on the back office homepage + [*] BO : adding log system + [*] BO : you are not stuck anymore with a bad token in the URL, you can choose to display the page if you trust it + [*] BO : you can now choose how do you want to delete your customers + [*] BO: Change property from private to protected + + [*] WS : Order management optimizations + [*] WS : Support for combinations + [*] WS : Support for overriding object active record method + [*] WS : adding some xlinks and a part of product images support + + Fixed bugs: + + [-] Project : Bug fixed #7111 (1.4) - Hook postUpdateOrderStatus is called only in postUpdateOrderStatus now + + [-] Installer : Bug Fixed #7319 - Tax rules group name 32 => 50 characters + + [-] FO : Bug Fixed #7143 - Tax line vanish + [-] FO : Bug fixed #7332 - Selected sort on product-sort.tpl is now displayed when selected + [-] FO : Bug fixed #7355 - Pagination fix + [-] FO : Cart - Price is not refreshed on quantity discount + shipping is not displayed without tax on summary update (Thank you so much Vincent for your help) + [-] FO : Fixed #7379 better message when try to register with an e-mail already registered + [-] FO : Fixed #7379 postal code / zip code incorrect text when created new account or new address + [-] FO : Fixed #7414 replaced usage of Db->numRow in if statement by is_array() and sizeof() of getAttributesGroups result + [-] FO : Total not updated on cart summary + [-] FO : abusive redirection fixed on product page + [-] FO : fixed bug #6863 - svn4286 gift wrap not listed correctly in the cart + [-] FO : fixed bug #7265 - scenes don?\226?\128?\153t use catalog mode + [-] FO : fixed bug #7277 - User info block doesn?\226?\128?\153t update after logging in on one-page checkout + [-] FO : fixed bug #7347 + [-] FO : fixed bug #7353 + [-] FO : fixed bug #7361 - Reset password customer + [-] FO : fixed bug #7388 - category links dont get translated in SEO links in category block + [-] FO : fixed bug #7410 - Default Orderby and wrong Uppercase in product-sort.tpl + [-] FO : fixed display bug of supplier and manufacturer link when module is not installed + [-] FO : postcode is now allowed empty. It has to be tested in controllers + [-] FO : postcode is now saved when adding/modifiyng an address + [-] FO : preload of links fixed + [-] FO : related to bug #6968 - HTTP_ACCEPT_LANGUAGE server var is a language iso code not a country iso code. + [-] FO : Fix smarty debug with smarty3 #7306 + + [-] BO : Bug Fixed #5755 - Cart displayed tax included in Admin > Customers > Cart + [-] BO : Bug Fixed #7065 - Disable Tax = Tax removed from all the associated tax rules + [-] BO : Bug Fixed #7323 - Unkwnow column priority in field list + [-] BO : Bug Fixed #7384 - Translation now works when need_instance=1 + [-] BO : Bug fixed #5970 - 2 invoices same number + [-] BO : Bug fixed #7263 - Postalcode required flag is now used for back office + [-] BO : Bug fixed #7275 - "unity" became "unit" on "3. Prices" tab + [-] BO : Bug fixed #7276 - Minor code formatting issue + [-] BO : Bug fixed #7282 - Spaces are removed when latitude store are posted + [-] BO : Bug fixed #7302 - Invoice date is now displayed + [-] BO : Bug fixed #7315 - Postalcode required flag is now used for back office (store tab) + [-] BO : Employee class cleaned and fixed (employee status wasn't checked enough, employee count was wrong...) + [-] BO : Fixed #7400 character "~" is now allowed in Urls + [-] BO : Magic Quotes shall... not.. PASS! Even in AdminTranslations! + [-] BO : error message "object cannot be loaded" is not an awful die anymore + [-] BO : fixed bug #7243 + [-] BO : fixed bug #7343 - Tag parsing not robust enough + [-] BO : fixed bug #7358 + [-] BO : fixed bug #7398 + [-] BO : fixed toggle in adminEmail + [-] BO : flying language flag replaced in AdminMeta + [-] BO : related to bug #7294 - Add message concerning the rule sizeLang for a field ("html chars including") + [-] BO : related to bug #7303 - add a suffix for each translation panel id to avoid confused id (as "footer"). + + [-] Classes : fixed bug #7336 - An item in your cart is no longer available, you cannot proceed with your order + + [-] MO : change method to get the post key, Tools::strtolower() function is used on template name and module name @see revision #4652 + [-] MO : change method to get the post key, Tools::strtolower() function is used on template name and module name @see revision #4652 + [-] MO : Bug fixed #7268 (1.4) - ProductToolTip module is now showing the good date + [-] MO : Bug fixed #7296 - Major fix on USPS module + [-] MO : Bug fixed #7373 - UPS Module : Improved shipping cost calcul, edit carrier fixed, compliant carrier configuration tab, alert system configuration + [-] MO : If just one theme is displayed, don't display list of theme. + [-] MO : fixed bug #7257 + [-] MO : fixed bug #7261 - VAT number not use + [-] MO : fixed bug #7285 - hardcoded warning in fianetfraud module + [-] MO : fixed bug #7317 + [-] MO : fixed bug #7329 + [-] MO : fixed bug #7352 - Search Engine Keywords Stats Module + [-] MO : fixed bug and improvement of shopImporter + [-] MO : fixed error translation message in TwengaException class + [-] MO blockwishlist : fixed error message : invalid 1st email display correct message + added 2nd parameter htmlentities=false + [-] MO referralprogram : Fixed translation to match referralprogram.php + [-] MO : Fixed bug #7283 + + [-] WS : Minor WS bugs fixed + + [-] PDF : Bug fixed #7312 - Ecotax * product quantity + + [-] TR : change method to get the translation key, no more class name is used but file name, as AdminTranslation do. + [-] TR : change method to get the translation key, strtolower() function is used on module name + [-] TR : change method to get the translation key, strtolower() function is used on module name + [-] TR : change method to get the translation key, strtolower() function is used on template name + [-] TR : correct a text + [-] TR : related to bug #7301 - change a translation + [-] TR : set "PREFIX_" instead of "ps_" in request translations for country_lang table + [-] TR : some errors where not appropriately formatted + +#################################### +# v1.4.0.10 - 4640 (2011-01-26) # +#################################### + + Improved/changed features: + + [*] Project : adding Catalog mode, for disable easly all shopping features + + [*] Installer : adding catalog mode option in Installer + + [*] FO : New hook Payment Top + [*] FO : a few things related to the cart are now cached (~= 46 less queries when there is a product in the cart) + [*] FO : Can't cumulate group reduction + category group reduction + Function Tools::displayParameterAsDeprecated() + [*] FO : performance improvement on packs + + [*] BO / FO : fixed bug #6707 - improved geolocalization feature with adding of whitelist of IP (e.g. for SEO purpose) + + [*] BO : added test for pagespeed module for apache in AdminInformation (this module can cause prestashop to be unstable) + + [*] BO : htaccess generation and friendly URL activation simplified + [*] BO : Specific price form improvement + [*] BO : you can now fill in your domain name for e-mails (sometimes required by tightly configured mail server) + [*] BO : you can now use Tools::file_get_contents which will switch to curl if allow_url_fopen is disabled + + [*] Core: If SSL is enabled, now you can not access to pages without HTTPS + + [*] MO : add link to Twenga tarifs grid. + [*] MO : shopImporter is now using object to add entity + [*] MO : UPS module upgrade - easier to configure and get it working + [*] MO : UPS Webservices connections method is stronger now + [*] MO : USPS module was updated (almost same options as UPS module) + + Fixed bugs: + + [-] Project : Now the dni check is compatible with more format + [-] Project : Fixed bug #7170 (completed) - Bad translations & typos + [-] Project : Fixed bug #7170 - Fixed a lot of typos everywhere + + [-] Installer : installer now drop every compile and cache files of smarty when installing or updating + [-] Installer : fix bug on checking of version in Installer + + [-] FO : abusive 301 redirect fixed + [-] FO : adding missing check for DNI field + [-] FO : BUG:7114 Modified css blockmanufacturer.css. + [-] FO : Bug fixed #7149 - unnecessary code in blockspecials.tpl + [-] FO : fixed bug #6989 - Advanced parameters… not appear in One page checkout and guest checkout + [-] FO : Fixed bug #7095 - Rewrote $_SERVER['REQUEST_URI'] on IIS 6.0 on homepage + [-] FO : fixed bug #7108 - Other payment method button raise an error when ssl is used + [-] FO : fixed bug #7109 - Carrier default not checked + [-] FO : fixed bug #7112 - Can’t login on OPC + [-] FO : fixed bug #7146 - fixed free order with guest checkout + [-] FO : fixed bug #7147 - fixed bug on order-confirmation with redirection and guest account + [-] FO : Fixed bug #7187 - Deleted layer.js + [-] FO : fixed bug #7193 - Guest checkout / Download link issue + [-] FO : fixed bug #7221 + [-] FO : fixed bug #7224 + [-] FO : fixed bug #7225 + [-] FO : fixed bug #7227 + [-] FO : fixed links in RMA + [-] FO : fixed parkinson click on add to cart + [-] FO : performance improvements + [-] FO : Tools::redirectLink fixed for https + + [-] BO / FO : adding Behviour for no reconnized country on Geolocalization feature + [-] BO / FO : fixed bug #4711 - VAT Problem + + [-] BO : Bug fixed #5699 - When employee had no adding right in catalog, add button is not displayed + [-] BO : Bug Fixed #6874 - Can't refund if there is a customization + [-] BO : Bug Fixed #7205 - During installation if a localization pack is installed, the "localized" data (currency, taxes etc ..) don't have a default name and other i18n field + [-] BO : bug fix on search indexation + [-] BO : currency fixed on back office homepage + [-] BO : Fixed bug #7125 + [-] BO : fixed bug #7131 + [-] BO : Fixed bug #7142 - Errors were not translated on the login page + [-] BO : fixed bug #7144 - Disallow: /prestashop/order-opc.php not in robots.txt + [-] BO : Fixed bug #7194 - The features tab was broken in the product edition page + [-] BO : Fixed bug #7198 - Fixed the link "Back to the category" on "Attachments" tab + [-] BO : fixed bug #7202 + [-] BO : Fixed bug #7204 - States were not showing up when default country was USA + [-] BO : fixed bug #7219 + [-] BO : fixed bug #7222 + [-] BO : priority field in import & adminproduct tab + [-] BO : some javascript script was called twice on adminproducts + [-] BO : you can't disable the default currency anymore + + [-] Core : Rename Memcached class to MCached to fix #7163 bug + + [-] MO : Bug Fixed #5298 - Mass email sending + [-] Mo : Bug fixed #7116 - Bug fixed on Usps and Fedex carrier + [-] MO : Bug fixed #7129 - Block newsletter is now working when url rewriting is enabled + [-] MO : Bug fixed #7139 - Editorial module translations is now working + [-] MO : Bug fixed #7159 - Send To Friend can have two hooks at the same time + [-] MO : Fixed blockcategories turns off force compile #7128 + [-] MO : fixed bug #7115 - Paypal 2.1 module - multiple ‘authorization accepted from Paypal’ order statuses + [-] MO : Fixed bug #7199 - Added 'allow_guests' var in .tpl for productscomments module + [-] MO : fixed bug #7208 - Customer Name Transposed in PayPal + [-] MO : Fixed bug #7214 - "Your name" couldn't be translated in productcomments module + [-] MO : fixed bug #7217 - typo in variable name in fianetfraud module + [-] MO : fixed bug download product redirect + [-] MO : fixed bug on wishlist + [-] MO : fixed bug on wishlist + [-] MO : fixed bugs on shopImporter + [-] MO : fixed bugs on shopImporter and oscommerImport + [-] MO : fixed bugs on shopImporter & import ocs + [-] MO : fixed install bug + [-] MO : TrustedShops Strict Standard (mktime) + + [-] Mails : Fixed bug #7157 - Fixed a typo in the contact mail template + + [-] TR : Bug fixed #7155 - Translation correction + [-] TR : fixed bug #7231 - Translation in Cart + + [-] LO : US - Missing taxes + + Deprecated methods: + + [~] Deprecated : Parameter divisor in getPriceStatic + + +#################################### +# v1.4.0.9 - 4517 (2011-01-19) # +#################################### + + Improved/changed features: + + [*] Project : Added default states for Italy in the localization pack (thanks Jacky75) + [*] Project : Update Smarty from 3.0.5 to 3.0.6 + [*] Project : Vouchers can now be shrunk in orders + + [*] FO : Now in SVN version, if you remove the _ to the FrontController overriden classe, each king of PHP errors die the script, better for developpement environnement + + [*] BO/FO : Quantity discount & discount can be cumulated + + [*] BO : adding phone number in footer for France + [*] BO : Searching translations for modules use now recursive method. This allow to create files in deeper folder (this change the translation file order). + [*] BO : you can now generate a single PDF with all the order slips for a given period + [*] BO : You can now view customer messages even if they didn't finalize an order + + [*] Core : Big performance improvements when products are added to the cart! + + [*] MO: Fixed bug #5647 on mailalert / Mailalert mail does now contain attributes name + [*] MO: Fixed bug #5972 on mailalert + + [*] TR : set a new Translation + + [*] WS : Support for associations + + Fixed bugs: + + [-] Installer : Bug Fixed #6685 - SQL problem if tax are disabled + [-] Installer : fixed a spannish translation on installer + [-] Installer : the updater now handle ajax parse errors + + [-] FO : a bug occured when translations file are empty. + [-] FO : bug #6887 fixed + [-] FO : bug #6909 fixed + [-] FO : Bug fixed #5250 (1.4) - Contact php mail is now working on BlueHost + [-] FO : Bug fixed #5302 (1.4) - Viewed products module is now working even when there is no picture product + [-] FO : Bug fixed #6961 - Invert pictures between products and employees on DashBoard + [-] FO : Bug fixed #6966 - URL Rewriting + [-] FO : Bug fixed #6977 - New Products Request + [-] FO : Bug fixed #6992 - Blockcategories url links have been fixed + [-] FO : Bug fixed #7016 - "Sort by" is now working on "best sales" + [-] FO : Bug Fixed #7031 - Reduction percent in blockspecials + [-] FO : Bug Fixed #7067 - Incorrect ecotax mngt for non-taxed customer + [-] FO : Bug Fixed #7075 - Incorrect taxes when discount amount is used + [-] FO : Bug fixed #7085 (1.4) - HTML Tag are not displayed anymore in href title of short description + [-] FO : Cart summary displays price Tax Inc. with a customer group Tax Exc. + [-] FO : fix bug #5490 + [-] FO : Fixed #7054 + [-] FO : fixed an javascript error on One page checkout + [-] FO : fixed a notice error on One page checkout + [-] FO : Fixed bug #5685 - Minimal amount wasn't using the customer currency + [-] FO : fixed bug #6523 #6657 - adding missing fields on One page checkout + [-] FO : fixed bug #6575 - No way to provide order comment when creating new account through opc + [-] FO : fixed bug #6652 - Possible to skip required field with opc after pussing button “ Modify my address” + [-] FO : fixed bug #6766 - Not all errors are mentioned at account creation or instant checkout + [-] FO : fixed bug #6954 - Firebug reports an error at checkout + [-] FO : fixed bug #6999 - One Page Checkout - Already Registered? Redirect to Authentication + [-] FO : small bugs and optimizations on One page checkout + + [-] BO / FO : Bug Fixed #5775 - Credit slip on a customization = a full order credit slip + [-] BO / FO : Bug Fixed #6898 - unit prices not impacted by specifc prices + [-] BO / FO : Quantity discount now use priorities + [-] BO / FO : unit_price initialisation + + [-] BO : a class is added for simulate a disable input + [-] BO : Bug fixed #5536 (1.4) - Warning is displayed when the limit of suhosin could cause problem on translations tab + [-] BO : Fixed #7029 Bad quantity reinjected on products + [-] BO : Fixed bug #4264 - It was possible to send email by SMTP without a SMTP server specified + [-] BO : Fixed bug #5266 + [-] BO : Fixed bug #5496 - Missing check on php_uname() in "Informations" tab + [-] BO : Fixed bug #5558 - Impossible to read customer messages without orders + [-] BO : Fixed bug #5953 - It was impossible to change an order state if there were no products in the order + [-] BO : fixed bug #6358 + [-] BO : fixed bug #6755 + [-] BO : Fixed bug #6857 - Missing htmlentitiesUTF8 in search results + [-] BO : Fixed bug #6875 - Error while regenerating Stores thumbs + [-] BO : Fixed bug #6940 - Updated PL tax + [-] BO : Fixed bug #6943 - Updated UK tax + [-] BO : fixed bug #6953 - Style problem (block overlaps) - (only IE7) + [-] BO : Fixed bug #7013 - Now using Tools::getValue to add tags + [-] BO : Fixed bug #7033 - Error while adding a new language (image format not recognized, allowed formats are: .gif, .jpg, .png) + [-] BO : fixed bug in import csv + [-] BO : Missing tax rules (US) + [-] BO : Tax on product page should not use state taxes + [-] BO : Modules translations works fine for a theme overriding module, + [-] BO : warning fixed (language tab, caused by a missing directory) + + [-] Classes : Missing taxes during Localization pack import + [-] Classes : Fixed bug #6942 - Notice: Undefined variable: lang during installation + + [-] Core : Fixed bug #4248 - Zones are now deleted properly + [-] Core : Fixed bug #5211 - SQL error related to cart + [-] Core : Fixed bug #5486 - Warning on $category in Link.php class and in the mailalerts module (id <=> id_product) + [-] Core : Fixed bug #6950 - Error with SSL when using CCC + [-] Core : Fixed bug #6964 - PT localization pack was updated + [-] Core : Fixed bug #6982 - Undefined $row in the Customer class + [-] Core: Fixed bug #7083 + + [-] MO : Bug fixed #6816 - Webservice test is now repaired + [-] MO : Erase css in "style" attribut, use a new css class. + [-] MO : fixed a bug on mailalert module + [-] MO : fixed bug #5347 - Google Checkout Currency corversion error + [-] MO : fixed bug #6028 - paypal express and paypal block logo + [-] MO : Fixed bug #6701 - Module products comments wasn't working properly for user who update from < 1.4.0.2 to a new version + [-] MO : Fixed bug #7003 - Deleted some useless vars + [-] MO : Fixed bug #7021 - Bad tag in mailalerts module + [-] MO : Fixed bug #7026 - We don't use anymore the Thickbox in the PayPal module + [-] MO : Fixed bug #7031 (partially) - Deleted unused var in module blockspecials + [-] MO : Fixed product comments bug #7077 + [-] MO : fixed warnings in fia-net modules + [-] MO : Mailalert does now not try to add product to cart when return key is pressed + [-] MO : set a tracker in DIBS + [-] MO : update Google Analytics module + [-] MO : related to bug #6786 - Correct ie7 integration and improved general integration and lisibility + + [-] WS : Clean WebService parameters in classes + + [-] TR : check if _PS_THEME_DIR.'/modules/' exists before scan it + [-] TR : Fixed bug #5266 + [-] TR : Fixed french translation for url rewriting + [-] TR : Order of translate sentence changed (because of last translation tools debug), delete old translation. + [-] TR : related to bug #4787 - Copy translations from a theme to an other work fine and (keys translation are changed according to the theme name), + + +#################################### +# v1.4.0.8 - 4410 (2011-01-12) # +#################################### + + Improved/changed features: + + [*] Installer: Localization packs is now available on release + + [*] FO : All the page URLs are now really multilingual when rewrited, and with a simple iso code instead of "lang-zz" + + [*] BO : Simplified the import upload process + [*] BO : Added a warning relative to ZipArchive + [*] BO : Files already imported are now sorted by upload date desc + [*] BO : Import is now really faster on categories, calling nested tree regeneration only once + [*] BO : improvement of search engine module in back-office + [*] BO : Localization Pack dont add new Currency/Language/State/Tax if already exist + [*] BO : Remote help improvements + [*] BO : remove useless calls of jquery hotkeys + [*] BO : Robots.txt file generation improved + [*] BO : search indexation optimized + [*] BO : you can now add a specific message when deleting an item + [*] BO : you can now specify the canonical url of your shop in the preferences, and it will be used to redirect users to the right domain + + [*] Classes : report to bug #6841 + + [*] Core : Added a flag to Category class to prevent from nested tree regeneration if needed ($category->doNotRegenerateNTree) + [*] Core : Deleted unused defines (_PS_TMP_DIR_, _PS_STEST_DIR_) and renamed _PS_PROD_PIC_DIR_ to _PS_UPLOAD_DIR_ + + [*] MO: Add alert to customer even if he is not logged on mailalert + [*] MO : Fixed bug #6870 - Shop logo is now displayed on PayPal redirection page + [*] MO : Fixed bug #6870 - Two small improvements on PayPal module (W3C validation) + [*] MO : gsitemap now handle homepages in multiple languages + [*] MO : new version of socolissimo for more compatibility with version 1.4 + [*] MO : optimize the image subheading style of the editorial module + [*] MO : pagination for gridhtml + [*] MO : statsbestcustomers improved + [*] MO : stats modules with grids improved + + [*] TR : translation added + [*] TR : translation added + + Fixed bugs: + + [-] Project : Bug Fixed #6864 + + [-] Installer : Allow to use language chosen in localization pack during install + [-] Installer : change the localization pack installer, don't install lang pack if lang is fr, en or es. + [-] Installer : Change some wrong country name related to bug #6149 + [-] Installer : Fixed bug #6235 - Subquery returns more than 1 row on AdminStores + [-] Installer : Fixed bug #6584 - Bad error message if no permissions on img/logo.jpg + [-] Installer : Fixed bug #6859 - Upgrade file for 1.4.0.7 was updating hook's names to the wrong table + [-] Installer : gridextjs is now renamed as deprecated in the updater + [-] Installer : no name hooks named + + [-] FO : Bug Fixed #5406 - Tax inc. displayed when taxes are disabled + [-] FO : Bug Fixed #5582 - Negative tax on free order + [-] FO : Bug Fixed #6665 - Suppliers pagination is ok now, unactive products are not count anymore and suppliers display on Front Office + [-] FO : Bug Fixed #6892 - Qty discount price in percent not correctly displayed + [-] FO : Fixed a fatal error on product page ($this->$smarty) (no $ needed) + [-] FO : Fixed bug #6312 - Small changes in CSS for better compatibility + [-] FO : fixed bug #6745 - Wrong text OPG + [-] FO : Fixed bug #6829 - CSS typo in product.tpl + [-] FO : Fixed bug #6866 - Missing margin-bottom on #buy_block + [-] FO : Fixed bug #6873 - CMS page wasn't using breadcrumb.tpl + [-] FO : Fixed bug #6897 - Deleted useless Back button on authentication page + [-] FO : Fixed bug #6910 - Bullet image size properties are missing + [-] FO : Fixed bug #6919 - Selected country was the wrong one in address edition + [-] FO : Fixed bug #6921 - Missing translation code in authentication.tpl + [-] FO : fixed bug on One Page checkout, when no payment method is available + [-] FO : fixed display quantity discount + [-] FO : removed double slash in the canonical URL of the authentication page + [-] FO : Tax calculation on PDF invoice incorrect + [-] FO : weird 404 page generated by the stat encrypted data fixed + + [-] BO/FO : Bug Fixed #6438 - BO, Invoices & history don't use specific prices + + [-] BO : Bug Fixed #6809 + [-] BO : back office themes appear again in employee tab + [-] BO : Bug #6826 fixed + [-] BO : Bug Fixed #5215 (1.4) - Import product list in different language + [-] BO : Bug Fixed #5523 (1.4) - Combinations generator does not cut off attribute names with quote anymore + [-] BO : Bug Fixed #5616 (1.4) - Supplier reference is displayed in Orders Tab + [-] BO : Bug Fixed #5859 - Move products image positions + [-] BO : Bug Fixed #6086 (1.4) - Back link repaired in Back Office + [-] BO : Bug Fixed #6134 - unit price with quantity discount + [-] BO : Bug Fixed #6602 - TaxRules tab next to the tax tab + [-] BO : Bug Fixed #6617 - Unable to assign tax rule to particular zones + [-] BO : Bug Fixed #6687 (1.4) - Incorrect group on customer creation is now fixed + [-] BO : Bug Fixed #6726 & #6721 - Quantity discount & Specific prices + [-] BO : Bug Fixed #6805 (1.4) - Color now can be saved in order state administration + [-] BO : bug fixed in CSV import tax group name => tax group id + [-] BO : empty translations files are now created when you add a language + [-] BO : Fixed #6811 + [-] BO : Fixed a bug related to ZipArchive, Fatal error while posting a zip file if ZipArchive was missing + [-] BO : Fixed bug #3900 - Delete [E] option in .htaccess + [-] BO : Fixed bug #5478 - After saving a combination, attributes order was modified + [-] BO : Fixed bug #6321 - Error on import + [-] BO : fixed bug #6364 + [-] BO : fixed bug #6774 + [-] BO : fixed bug #6791 //Now when no payment module is installed message appears in place of the tables restriction without a checkbox. + [-] BO : Fixed bug #6867 - Two dates were not formatted correctly (Orders list and Cart detail) + [-] BO : Fixed bug #6908 - Missing translation in editorial module + [-] BO : Fixed bug #6916 - Link to Wikipedia on state tab deleted + [-] BO : Fixed bug #6922 - Create .htaccess doesn't work + [-] BO : fixed bug minimal quantity + [-] BO : Fixed bugs #6762, 6760, 6764, 6765 - Bad relative paths in several admin tabs (not using defines.inc.php) + [-] BO : Fixed bugs #6778, #6780, #6779 - Hardcoded directories in Admin panel tabs + [-] BO : Fixed CH localization (tax rates have increased on 1st January 2011) + [-] BO : Specific prices - HT price is empty by default + [-] BO : Undefine during Cancel product + + [-] Classes : Bug Fixed #6320 - getPricestatic must not modify global cart + [-] Classes : Bug Fixed #6750 - The newer e-mails have been added + [-] Classes : Bug Fixed #6825 - Missing properties (ecotax_tax_rate & group_reduction) in OrderDetails class + + [-] Core : bug fixed #6856 + [-] Core : false is now considered as an empty value in ObjectModel, thus allowing an ID set to false if it is not required (before that, the id had to be set to either null or '') + [-] Core : Fixed bug #5706 - Now using round() instead of intval for image resizing + [-] Core : fixed bug #6113 - template cant find data products + [-] Core : Fixed bug #6269 - Major issue with $outOfStock flag during order processing + [-] Core : Fixed bug #6788 - Exceptions on page with query string specified were not working properly + [-] Core : Fixed bug #6818 - Deleted an unused in the PaymentModule class + [-] Core : Fixed bug #6836 - Added public to validateOrder method (PaymentModule class) + [-] Core : Fixed bug #6840 - Language::getLanguages() wasn't taking in account $active + [-] Core : Fixed bug #6846 - Cannot override Search::sanitize() + [-] Core : Fixed bug #6928 - Missing "custom" field in FeatureValue class + [-] Core : Fixed bug #6931 - Errors in Australian localization pack + [-] Core : fixed bug missing global $isVirtualCart + [-] Core : fixed notice //trying to get property of non-object + [-] Core : Small coding standards modifications + + [-] MO : Bug Fixed #6816 - UPS Module now use fsockopen instead of cURL + [-] MO : default sort column fixed for gridhtml + [-] MO : Fixed #6243 allow shipping to other countries + [-] MO : Fixed #6895 ssl broken on moneybookers module + [-] MO : Fixed bug #5101 - It was impossible to configure a local rss feed (blog for instance) on module blockrss + [-] MO : Fixed bug #5688 - PayPal return values were not uppercased + [-] MO : Fixed bug #6759 - Module crossselling design was broken + [-] MO : Fixed bug #6855 - Cross selling module CSS wasn't displayed properly + [-] MO : fixed bug #6865 - downloadable product gets stock out email when you have 98 in stock + [-] MO : statsbestcustomers is now faster and do not loose any customer when you browse the pages + [-] MO : "visitors online" module can now display the visitors even when the option "pages views for each customer" is disabled + + [-] TR : change a var name for better understanding. + [-] TR : related to bug #6852 - add method to copy all necessaries mails files when import lang pack. + [-] TR : related to bug #6852 - copying necessaries mails when a pack is a added by prestashop.com. + + [-] WS : fix minor image display bug + + +#################################### +# v1.4.0.7 - 4235 (2011-01-05) # +#################################### + + Improved/changed features: + + [*] Installer : Argentinian provinces included + [*] Installer : Add timeout on localization pack download + + [*] FO : fixed bug with "Other payment methods" and OPC feature + [*] FO : Suppliers and manufacturers are displayed only if you have enable it on preference + + [*] BO : Direct link to AdminTaxRulesGroup tab in the product's form + [*] BO : improvement of module search field + [*] BO : modified css backoffice. + [*] BO : Added a confirmation message while saving Features + [*] BO : Improve the lang pack proposed in AdminLanguages tabs. + + [*] MO : A visitor can now specify a referral email, even if he was not invited before + [*] MO : new toolbar in the configuration page of every modules + [*] MO : You can now define a percentage for vouchers of the referral program module + [*] MO : Added loyalty points on the customers page (in the block title) and added a second parameter to LoyaltyModule::getVoucherValue() + [*] MO : Fixed bug #6694 - Typo and HTML fix for the productscomments module + [*] MO : Fixed two bad translations (missing mod='') for the productscomments module + [*] MO : Several improvements on the productcomments module + [*] MO : shopImporter feedback is now more user friendly + + [*] WS : Clean classes and support for associations and i18n + + Fixed bugs: + + [-] Project : resolve Ecotax problem on Prestashop update (<1.3.3 to 1.4) + + [-] Installer : Bug fixed #6424 - SQL Meta Lang Correction (bug on htaccess) + [-] Installer : Bug fixed #6685 - Fixing SQL error upgrade 1.3.2.2 to 1.4.0.6 + [-] Installer : Bug fixed #6685 - Fixing SQL error upgrade 1.3.2.2 to 1.4.0.6 / Last issue solved + [-] Installer : Fixing SQL error : 1.3.3.0, 1.3.4.0, 1.3.5.0 were empty + [-] Installer : Tax Rules translation + [-] Installer : Fixed bug #6426 - "ajax error" during upgrade + + [-] FO - BUG:6668 Modified css classes in specials block. + [-] FO : fixed bug #6646 - Error message wrong/empty value but goes to next step + [-] FO : fixed bug #6646 - Error message wrong/empty value but goes to next step + [-] FO : fixed bug #6653 - Guest checkout problem + [-] FO : fixed bug #6658 + [-] FO : fixed bug #6659 - terms turned off shows wrong text + [-] FO : fixed css on cart summary + [-] FO : Remove unless js files + + [-] BO / FO : change the price value which is set in Database for order details, exclude ecotax for the HT price. + [-] BO / FO : fixed bug #6698 + + [-] BO : Bug fixed #6738 - No more hardcoded directory img/tmp/ in AdminProducts + [-] BO : Fixed bug #6661 - Broken links on dashboard + [-] BO : Fixed bug #6700 - Lot of modifications on the "Features" tab on the product edition + [-] BO : fixed bug #6725 - PHP error in BO + [-] BO : Fixed Bug #6730 - error deleting a tax + [-] BO : Fixed bug #6732 - Tax rate was restricted to 2 decimals + [-] BO : fixed bug #6739 + [-] BO : fixed bug #6754 + [-] BO : related to bug #6664 : + [-] BO : related to bug #6664 : + + [-] Classes : fixed bug #6729 - Paypal: Invalid token due a problem of Cookie class of Prestashop + [-] Classes : Fixed cache errors #6672 + + [-] Core : Fixed bug #6716 - Error "Image format not recognized, allowed formats are: .gif, .jpg, .png" + + [-] MO : added IF NOT EXISTS to the table creation of the newsletter module + [-] MO : DIBS module - logo image is replaced. Was saved in wrong encode. + [-] MO : Fixed a lot of other bugs, typos, and code standard errors in the referral program module + [-] MO : fixed bug #6472 - moneybookers errors + [-] MO : Fixed bug #6663 - Bad voucher value for referral program module + [-] MO : fixed bug #6667 - Error in modules/blockcms/blockcms.php + [-] MO : fixed bug #6675 - Moneybookers module error + [-] MO : Fixed bug #6731 - Class ‘LoyaltyStateModule’ not found in the admin panel + [-] MO : gridextjs has been properly removed and replaced + [-] MO : improve security In DIBS module + [-] MO : Numerous other bugs on the loyalty state module in the admin panel (customers page) + [-] MO : set a better conditionnal expression in DIBS constructor. + [-] MO : shopImporter fixed js bug + + [-] MAIL : Bug fixed #6674 (v1.4) - Mail template order_customer_comment now mention customer name and e-mail + [-] MAIL : fixed bug #6734 - Problem customers accounts and retrieve password + + [-] PDF : PDF won't die if no language is specified in the cookie + + [-] TR : Bug fixed #6660 - English template corrections and AdminTranslations fixed + [-] TR : Bug fixed #6690 - Small translation issue + [-] TR : Bug fixed #6695 - Small translation issue + + [-] WS : fixed authentication bug + + +#################################### +# v1.4.0.6 - 4114 (2010-12-29) # +#################################### + + Improved/changed features: + + [*] Project : refactoring of the dispatcher in order to create unit tests + [*] Project : Update of jQuery SerialScroll & ScrollTo plugins + + [*] FO : Homepage is now W3C valid (fixed several errors on blocksearch) + [*] FO : refactoring of order controllers, with new controller ParentOrderController + + [*] BO : added check if method_exists before call_user_func() 'displayInfoByCart' + [*] BO : change the method to get the language pack according to the prestashop version. + [*] BO : you can now upload ZIPs containing your product pictures instead of uploading them one by one + [*] BO : Timeout on Remote Help + hide error @ + [*] BO : you can now add the language code (e.g., pt-br, en-us) to a language in order to use Google Translate API and other feature with the right language code + + [*] Classes : Optimized version of isVirtualCart() (class Cart.php) + + [*] MO : Added a uninstall warning in the loyalty module + [*] MO : You can now choose to use Google Checkout shipping fees instead of the ones defined in your shop + [*] MO Treepodia : new features + [*] MO : Several improvements on Products Category module (design, code, performances) + [*] MO : Module UPS - The module is now fully configurable + [*] MO : Re-wrote a large part of the Loyalty module + [*] MO : Better management for negative points in the loyalty module + [*] MO : Moved includes from the constructor in the loyalty module (better memory management) + + [*] IN : bypass configuration check if everything's alright + [*] IN : improved error management in the database installation: no need to use firebug anymore! + + [*] TR : Set good link to access of lang pack on prestashop.com according to Prestashop version. + + Fixed bugs: + + [-] FO : accessories description fixed on product page + [-] FO : Add missing UTF-8 charset on escape + [-] FO : Bug : 5265 - stylesheet fixes + [-] FO : Bug fixed - Smarty error on carrier display in orders steps + [-] FO : Change h2 in h1 and h3 in h2 on editorial module for better SEO. + [-] FO : Cookie name is now a hash generated with a string and the shop URL instead of a string and the cookie key, so you shouldn't have any "400 Bad Request" due to oversized cookies anymore + [-] FO : deleted "This shop requires JavaScript to run correctly. Please activate JavaScript in your browser." which appeared in your google description + [-] FO : Fixed #6505 Images is now loaded in SSL + [-] FO : Fixed #6534 + [-] FO : Fixed a warning with $customizationQtyInput on order-follow.php + [-] FO : Fixed bug #5632 - W3C error with blocknewproducts + [-] FO : Fixed bug #6083 - The form buy_block could by empty on product page in some cases + [-] FO : Fixed bug #6164 - Warning with var $total_free_ship + [-] FO : fixed bug #6270 - Paypal v 2.0 - non-secure links in redirect.tpl + [-] FO : Fixed bug #6354 - Free shipping text wasn't working properly with OPC + [-] FO : Fixed bug #6503 - Missing password_query templates for ES language + [-] FO : fixed bug #6524 - States list not showing on opc invoice address + [-] FO : Fixed bug #6544 + [-] FO : fixed bug #6561 - “No carrier is selected” for virtual products in opc + [-] FO : Fixed bug #6572 - Spelling issue "subtract" instead of "substract" + [-] FO : Fixed bug #6573 - Clicking quantity +/- on virtual cart causing "remaining amount" to appear + [-] FO : fixed bug #6574 - Javascript error when creating account on opc with cart block uninstalled + [-] FO : fixed bug #6576 - Customer name is displayed with lastname first after creating new account in opc + [-] FO : fixed bug #6577 - opc has two #email inputs + [-] FO : fixed bug #6595 - no default shipping method on order-opc.php + [-] FO : Fixed bug #6597 - SerialScroll.js was missing on the product page + [-] FO : Fixed bug #6606 and #6626 in Category class and ajax.php + [-] FO : Fixed bug #6608 -

instead of

for guest-tracking.tpl + [-] FO : Fixed bug #6609 + [-] FO : Fixed bug #6634 - Typo error in authentication.tpl + [-] FO : Fixed bug #6640 - Added a button to modifiy its address on Guest checkout + [-] FO : jqzoom destination image link fixed + [-] FO : mail can be sent even if the customer name is not valid: it is removed instead of crashing prestashop + [-] FO : mime type detection improved for downloadable items + [-] FO : no more fatal error when you cannot be geolocated with your IP address + [-] FO : now you can't go to next step if you haven't choose a carrier or accept terms of service on One Page checkout (#6595) + [-] FO : _PS_CACHE_ENABLED_ is not defined during upgrade from 1.3 => 1.4 = maintenance page crash + [-] FO : Put subheading editorial image in P. + [-] FO : Replaced all "Substract" by "Subtract" + [-] FO : search query fixed (tax table alias had been changed) + [-] FO : Shop name is now protected in the mails templates + [-] FO : Small translations fixes + [-] FO : SSL for re-ordering + [-] FO : Tag system on front office is now working (bug in Search SQL Request) + [-] FO : virtual product links are now sent the first time the order is validated and no more hard coded on PS_OS_PAYMENT + + [-] BO : Bug Fixed #6596 + [-] BO : #6583 fixed + [-] BO : css bug fixed + [-] BO : delete the ext-all.css called in the hook hookBackOfficeHeader + [-] BO : Fixed bug #5129 - Categories were reseted if an error occur on the product edition page + [-] BO : Fixed bug #5497 - All default pictures were deleted if box "Delete all before import" was ticked + [-] BO : fixed bug #6535 + [-] BO : Fixed bug #6581 - Text/HTML error on CMS edition page + [-] BO : Fixed bug #6601 + [-] BO : JS error in IE6 & 7 + [-] BO : no more warning when "en" directory does not exists while parsing modules email translations + [-] BO : related to bug #6632, create a new javascript function to display the tinyMCE editor which concerns the button 'edit html' on each html mail template. + [-] BO : related to bug #6632, in the tinyMCE init method, the selector exclude each textareas for txt templates. + [-] BO : tinymce do not entities every utf8 chars anymore + [-] BO : Ugly display in IE + [-] BO : you can now clear the note associated to a customer + + [-] Classes : fixed bug #6466 - Fatal Error and Geolocalization + [-] Classes : fixed bug #6548 - Express checkout twice with the same email address + + [-] Core : Fixed bug #5545 - $orderBy parameter was ignored if uppercased + [-] Core : Fixed bug #5886 - Multibyte error in the blockcart module + [-] Core : Fixed bug #6515 - Warning on Memcached (empty key on deletion) + [-] Core : Fixed bug #6590 - Image format not recognized (JPEG/GIF/PNG...) + + [-] MO : add correct condition to allow 1.3 compatibility. + [-] MO : Deleted Javascript real time update (on FO) for the loyalty module (buggy and useless because we only display the maximum points the customer can win) + [-] MO : Fixed a Smarty v2 bug on loyalty module (missing {literal}) + [-] MO : Fixed bad default translations in the loyalty module + [-] MO : Fixed bad points amount in the loyalty module (floating issue) + [-] MO : Fixed bad total points amount in the loyalty module + [-] MO : Fixed bug #4785 - Google Checkout wasn't transmitting attribute details + [-] MO : Fixed bug #4847 - Product weights were not sent to Google Checkout + [-] MO : Fixed bug #4871 - Loyalty module vouchers start date weren't the right ones + [-] MO : fixed bug #5437 - PaypalAPI module Vs language + [-] MO : Fixed bug #5578 - Module productscategory + [-] MO : Fixed bug #5660 - Loyalty points differents on the product page and on the shopping cart page + [-] MO : Fixed bug #5825 - Better management of confirmation page for Moneybookers payment module + [-] MO : fixed bug #5851 - Paypal module v 2.0 - inconsistent mod= + [-] MO : fixed bug #5894 - Paypal2.0 install error + [-] MO : Fixed bug #5938 - Bad amount of negative loyalty points with loyalty module + [-] MO : fixed bug #6093 - paypal template error + [-] MO : fixed bug #6343 - wrong shipping address passed to Paypal + [-] MO : fixed bug #6361 - reducing length of log messages from Paypal + [-] MO : fixed bug #6558 + [-] MO : fixed bug order total on payment step + [-] MO : Module USPS - The errors messages are more accurate + [-] MO : subdomain no more removed from the url in pagesnotfound + + [-] TR : Bug fixed #6630 AND #6539 - Md5 Key has been changed, french and spanish translations were reuploaded + +#################################### +# v1.4.0.5 - 3979 (2010-12-22) # +#################################### + + Added Features: + + [+] Project : New feature Guest Checkout, on One Page checkout and standart order process + + [+] FO : Added an effect on FancyBox opening/closing + [+] FO : now js compression use JS min in place of JS packer (too much bugs and not the better performances...) + [+] FO : your customers can now renew their orders (in the order detail) + + [+] BO / FO : Rewrited the user's path calculation using nested tree + + [+] BO : added colorpicker for attributes and Order statuses + [+] BO : chart added on the homepage + [+] BO : new dashboard in Back Office + [+] BO : Remote help + [+] BO : simple access to the front office added in the back office header + + [+] Class : added new class Import module + + [+] Core : Added an N-Level Nested Tree for categories + [+] Core : Added a SQL index to improve nested tree walks performances + [+] Core : Added the nested tree implentation! Big performance gain for getting categories tree branches + + [+] Hook : added new hook beforeAuthentication + + [+] MO : Added a first basic version of the Layered navigation feature (you can only filter by sub-category, more to come!) + [+] MO : added new module oscomerce importer + [+] MO : added new module Shop Importer //beta + [+] MO : Dibs join the party !! + [+] MO : New Module (1.4) - Fedex - fedexcarrier/ + [+] MO : New Module (1.4) - USPS - uspscarrier/ + [+] MO : set a valid category module + [+] MO : Twenga module is added + [+] MO : You are now able to choose the minimal amount required to use the loyalty points vouchers + + [+] TR : added translation + [+] TR : added translation + [+] TR : Set the FR DIBS translations + [+] TR : send Translations + + [+] WS : Bug fixed on blank schema for several resources. + [+] WS : fixed bug #6352 + [+] WS : webservice always returns 401 when authentication fail + + Improved/changed features: + + [*] Project : Smarty3 is now available for PHP Version < 5.1.2 + + [*] FO : Added several with/height HTML values for delete.gif + [*] FO : a few changes in confirmation messages (css among others) + [*] FO : a few changes in error management (css, back button, authentication) + [*] FO : Cached customer groups in order to avoid groups SQL subqueries + [*] FO : Class Cart.php (getProducts method) - The cart is now getting dimension parameters (width, height, depth) for each product + [*] FO : Comparison button at the bottom of the product list + [*] FO : Improved memory management for digital files downloads + [*] FO : Improved the way manufacturers product were counted + [*] FO : removed backward compatibility with 1.1 themes + + [*] BO : accords form positions and relevancy for the administrator in the Performance tab + [*] BO : Added module filter on the module page + [*] BO : added new version of tinyMCE + [*] BO : added the number of images, combinations and attachments in the tab name of the product page + [*] BO : Catalog > Product - Dimension parameters are now available for products + [*] BO : (cf comment bug #6266) (1.4) - AdminPDF and AdminPreferences - Font PDF can now be changed in every language without changing the employee language + [*] BO / Core : Some code improvements and code design + [*] BO : homepage links updated + [*] BO : improve the memory usage on AdminPayment page + [*] BO : Initial Qty instead of stock movements for new products + [*] BO : Preferences > Contact - Country and state are now list field + [*] BO : Preferences > Localization - Dimension unit parameter (cm or in) is now available + [*] BO : Significantly optimized helpboxes management, faster display & less code! + [*] BO : Simplified path for cookie creation (init.php) + [*] BO : Small improvements for "old school" theme + [*] BO : Some corrections of code standards + [*] BO : "View my shop" link is now opening into a new window + + [*] Core : Cache & headers on tax rules + [*] Core : Tax Rules + + [*] MO Cashticket : Learn more link + [*] MO Dejala : Removed CarrierHacked + [*] MO Paysafecard : Learn more link + [*] MO : Loyalty module : loyalty points are now changing with attributes on product page + [*] MO : Module UPS - Cache system has been added - 2010-12-20 16:09 + [*] MO : Module UPS - Currency conversion and use of the product dimensions + [*] MO : New text added in the product page for loyalty module if it's a discount product and no points are given for that one + [*] MO : new version for module Dejala is now available + [*] MO : Now you can use singleton in your modules + [*] MO : Ogone module is now compatible Prestashop version 1.2.5 + [*] MO : Small improvements on PayPal module + [*] MO : Title field added on ProductComment module + [*] MO : You can now define a config.xml file in modules dir to improve memory dump on AdminModules page. + + [*] WS : class prepared for using unit tests. + [*] WS : Now supports new resources : deliveries, price_ranges, weight_ranges, stores, languages, order_details, configurations, order_discounts. + [*] WS : refactoring + [*] WS : refactoring + + Fixed bugs: + + [-] All : Bug Fixed #6453 added missing fields to Manufacturer : meta title,meta description.meta keywords,short description... + [-] All : Bug Fixed #6474 "carrier_tax_rate" in the "_orders" table is updated with a tax rate + + [-] Installer : Fix on ntrees + [-] Installer : Missing escape characters in database_structure + [-] Installer : Taxes removed from SQL / Languages & Configuration loaded during checkInfosStep + [-] Installer : Upgrade 1.4.0.5 TaxRulesGroup + [-] Installer : Fixed bug #6477 - Field 'ecotax_tax_rate' doesn’t had a default value + + [-] FO : A product with combinations still displays price TI when taxes are disabled + [-] FO : blockcms module don't display anymore unactive cms categories or cms + [-] FO : Bug fixed #6311 - Width and height tags has been added in product.tpl on the default product picture + [-] FO : Bug fixed #6409 (1.4) - Product customization works fine now + [-] FO : Bug on product page when group reduction : tax excluded fixed + [-] FO : cms are now order by position on sitemap + [-] FO : Corrected bug on product page for reduct price. (When using a price changing in Specific price no changes on reduct price) + [-] FO : Currency changes on product.js are no more bugued. + [-] FO : Currency recompatible with specific price. + [-] FO : Deleted CMS won't let anymore "|" in footer's links. + [-] FO : fixed bug #6098 + [-] FO : Fixed bug #6115 - Added +/- images sizes (width, height) in the cart tpl for better performances + [-] FO : Fixed bug #6146 - Manufacturer page was counting non-active products + [-] FO : Fixed bug #6232 (partially) - FancyBox is now working well with IE 6 + [-] FO : Fixed bug #6332 (error with chars è,é,à,ò,ù,ì in "Send to a friend" module + [-] FO : Fixed bug #6347 - Price was switch from tax incl. to tax excl. while updating qties in cart + [-] FO : fixed bug #6382 - Error on Checkout orders + [-] FO : Fixed bug #6388 - Categories were not sorted on sitemap page + [-] FO : Fixed bug #6396 - Several issues with FancyBox (persistant arrows and loading image error) + [-] FO : Fixed bug #6398 -

were too big on CMS page + [-] FO : fixed bug #6405 - Error when clicking on category block title + [-] FO : Fixed bug #6406 - Several errors with large digital files downloads + [-] FO : Fixed bug #6494 - Error with Minify HTML option (CCC) / Smarty + [-] FO : Fixed bug - Fatal error when you logout and click on a product (Tools::getFullPath) + [-] FO : Fixed bug, the downloadable file icon was displayed in history.tpl for every orders + [-] FO : Fixed design bug for the quantity field in shopping-cart.tpl + [-] FO : Fixed several Smarty warnings (identity.tpl, product-list.tpl) + [-] FO : Fixed several Smarty warnings on order-follow.tpl + [-] FO : Fixed small error on sitemap (Smarty isset added) + [-] FO : Fix Smarty2 issue + [-] FO : 'Price Lowered' is now displayed with attributes. + [-] FO : product comparison JS always loaded + [-] FO : set isset() to check vars existence in tpl. + [-] FO : sitemap.tpl updated for smarty 3 + [-] FO : Small design issue fix for product comparison feature + [-] FO : Specific prices applicated to all currencies are now affected by currency. + [-] FO : The bookmark icon is not display anymore on Chrome because browser does not allow this function + [-] FO : Unit price changing with currency fixed + [-] FO : When "Display unavailable product attributes on product page:" is disabled on Preferences->Products, colors on FO are hidden too. + [-] FO : When tax excl prices displayed, display "tax excl." instead of "tax incl." + + [-] BO : Bug Fixed #6499 Tax import problem + [-] BO : Adding default translations for cms categories when adding a language + [-] BO : AdminCountries unknow column id_tax + [-] BO : AdminTaxRulesGroup, Chrome Show/Hide on states + [-] BO : Bug fixed #6266 (1.4) - Class PDF - Font PDF can now be changed + [-] BO : Bug fixed #6377 - Import Tab (field available) - list is now updating + [-] BO : change the sort method for module to correct a bug occured in php <= 5.2 use a user sort (uasort) + [-] BO : Creating a discount from AdminOrder page won't change anything in table ps_order anymore. + [-] BO : CSS + Missing translations on AdminTaxRulesGroup + [-] BO : Errors not thrown anymore when impossible to connect to Prestashop Addons for example + [-] BO : Fixed #5784 on file binary which not return same result in different environments + [-] BO : Fixed bug #3876 - Added some Tools::strlen() instead of strlen in order to manage special chars + [-] BO : Fixed bug #5418 - Updated default EUR/USD currency rate (1.20 -> 1.32) + [-] BO : Fixed bug #5877 - All help boxes were displayed for downloadable products + [-] BO : Fixed bug #6184 - Thickbox was still in use on checkout page, replaced by FancyBox + [-] BO : Fixed bug #6191 - Design error on "Back to product button" (AdminAttributeGenerator.php) + [-] BO : Fixed bug #6224 - Date picker wasn't working properly for swedish language + [-] BO : Fixed bug #6293 - Cookie was created in password.php page while it was useless + [-] BO : Fixed bug #6365 - Unit price with commas was producing an error + [-] BO : fixed bug #6386 - Admin Dashboard + [-] BO : fixed bug #6410 - Product global information - View product sales + [-] BO : fixed bug #6421 + [-] BO : fixed bug #6434 + [-] BO : fixed bug #6439 + [-] BO : Fixed bug #6442 - Categories were not sorted on product page + [-] BO : fixed bug : don't display invoice icon when there are no invoice to display + [-] BO : fixed bug in Back office when you edit a category + [-] BO : Fixed error warnings with themeinstallator + [-] BO : Localization use only XML files + [-] BO : Notice / Missing permissions on AdminTaxRulesGroup + [-] BO : Now the webservice tab stay on the line... + [-] BO : One check is add : if the file is larger than the upload_max_filesize or post_max_size an error is display. + [-] BO : oops ! I forget to encode the value for the url (see previous log) + [-] BO : Order Slip bug when percentage voucher applicated on the order + [-] BO : overflow hidden on the shop name, for long, long, long, long, long shop name + [-] BO : Put an error when cannot remove temprary file when importing a language + [-] BO : related to #4804, comments added into the file + [-] BO : related to #4804, from pack field, bug occurred when product ref is return with the name. See comment for details + [-] BO : related to #5568 + [-] BO : related to #5568, (AdminCatalog tab using AdminProducts tab) for a product, change the SEO-title when name field is changed. + [-] BO : related to bug #6504 - The weight of an attachment was wrong converted. + [-] BO : Restored iframes + [-] BO : Restored the possibility to change cms and cms categories' positions by clicking on arrows + [-] BO : Restored update in getter for retro compatibility 1.2.5 to earlier version + [-] BO : Specific prices are now more comprehensible when affected to currencies + [-] BO : Static method getCarrierTax + [-] BO : Store Image Management. + [-] BO : Vouchers and Orderslips created from AdminOrders take now discounts on order in count + [-] BO : Vouchers creation bug when percentage reduction. + [-] BO : width back to 960px instead of 1050px and a few tabs moved in order to fit this width + + [-] Classes : fixed bug on cookie with logout method + + [-] Core : Deleted a deprecated method (getAllSubCats() in Category.php & CMSCategory.php) + [-] Core : fixed bug #5985 + [-] Core : Fixed bug #6495 - Error with Smarty PHP filemtime() function call + [-] Core : Fixed bugs #6278, #6300, #6360 - Smarty 3 related errors (function call ‘register_outputfilter’ is unknown or deprecated.) + [-] Core : warning removed in MySQL class which occurred when you call ExecuteS with something else than a SELECT + + [-] MO : cashondelivery not configurable in config.xml + [-] MO : Corrected a warning when there isn't any native module in themeinstallator's xml and improved logo.gif + [-] MO : Created a function to turn a price with a currency format to float in js. Corrected loyalty module bug with products > 1.000 + [-] MO : BlockLanguages - Smarty v2 & v3 + [-] MO : Fixed a bug with theme installer when modules are in the configuration file but not in the archive + [-] MO : Fixed a SQL error while trying to uncheck all category boxes for layered navigation + [-] MO : Fixed blockcms module bug in BO. + [-] MO : Fixed bug #5290 - "Exclude discounted products" feature wasn't working properly + [-] MO : Fixed bug #5374 - Points given in loyalty module weren't taking in account tax exemption + [-] MO : Fixed bug #5976 (partially) - CMS block errors + [-] MO : Fixed bug #6044 - Gsitemap error while using CONCAT() and hardcoded french title for images + [-] MO : Fixed bug #6413 - Loyalty module was producing an error while user clicks on "Log out" + [-] MO : Fixed bug #6459 - SQL syntax error during insertion + [-] MO : Fixed bug #6486 - PayPal module was displaying French links to everyone + [-] MO : Fixed bug #6496 - Deleted useless paypal.tpl file in PayPal module + [-] MO : fixed bug into paypal module, moreover, the delivery address is send to PayPalAPI + [-] MO : Fix issue on blockcategories with smarty2 + [-] MO : from unsigned to signed for the ip address stored by fianetfraud + [-] MO : Module Fedex - Currency conversion correction + [-] MO : Modules translations (and tax bug fix) for UPS, USPS and FEDEX + [-] MO : php errors undefined output fixed + [-] MO : removed a php error in mondial relay + changed id_tax to id_tax_rules_group + [-] MO : ShopImporter Warning: Call-time pass-by-reference has been deprecated + [-] MO : template updated for smarty 3 in module mailalert + [-] MO : Url bug fixed in fianetfraud module. + + [-] TR : Bug fixed #6341 (1.4) - Md5 Key has been changed, french and spanish translations were reuploaded + [-] TR : Bug fixed #6341 (Up from comment) - Md5 Key has been changed, french and spanish translations were reuploaded + [-] TR : In AdminThemes. + [-] TR : installer traduction about License agreement updated. + [-] TR : Translations fixed - Md5 Key has been changed, french and spanish translations were reuploaded + + [-] SQL : fixed bug #6404 - Sql Error on prestashop upgrading process + + [-] WS : Bug fixed on Supplier resource. + [-] WS : Bug fixed & optimization + [-] WS : fixed bug #5703 + [-] WS : fixed bug #6346 : Now webservice works on windows servers + + +#################################### +# v1.4.0.4 - 3747 (2010-12-08) # +#################################### + + Added Features: + + [+] Project : Adding Smarty v2.6.20 as an alternate template engine (see _PS_FORCE_SMARTY_2_ in defines.inc.php) + [+] Project : Adding Smarty v3.0.5 as the default template engine + + [+] FO : Cart and wishlist -> New effect with the product picture! (No more "transfer" effect) + [+] FO : Cross selling module has now its own CSS file + [+] FO : Deleted thickbox, now using FancyBox! + + [+] BO: Possibility to export your data statistics + + [+] MO : New Module - UPS - upscarrier/ + + [+] WS : now acceptable image types are listed is in image xml get view + [+] WS : now the entity image_type is managable via WS + [+] WS : Now the filter sort_list become sort and the filter limit_list become limit, easier to write... + [+] WS : now the webservice system use an nice object to improve evolutions, it is singletonized too; now the webservice is able to able manage images (get the general images for the moment) + [+] WS : now you can put general images via WS + [+] WS : Now you can request the webservice with the HEAD method to avoid useless large requests; Now you can retrieve the webservice version in the request headers, fortunately when auth was valided, for security reason... + [+] WS : Now you can sort by many fields as example : [id_DESC,weight_DESC] + [+] WS : now you can use a simulated method to use post in place of put (useful to post images) + [+] WS : Remove osoletes tests of webservice admin tab + + Improved/changed features: + + [*] Project : All floatval() functions are now replaced by a casting of (float) for optimization. + [*] Project : Upgrading from Smarty v2.6.20 to v3.0.5 + + [*] Installer : new default employee profiles added to the installation + + [*] FO : Added a link to 'Our stores' in sitemap.php + [*] FO : add method to get all informations for make a link in each active language. + [*] FO : add method to get all informations for make a link in each active language. + [*] FO : Categories and pages are aligned to make sitemap.php a shorter page + [*] FO : change the style for button specialsPrice block. + [*] FO : change the style for button specialsPrice block. + [*] FO : Deleted jQuery hotkeys + [*] FO : Fixed bug #6176 and an other bug on order confirmation when you buy a free virtual product + [*] FO : for get links for each language : search active language in sql request. + [*] FO : get the url_rewrite for each language + [*] FO : h2 tags changed to h1 tags for referencement + [*] FO : Improve SQL replication performance + [*] FO : Upgrading from jQuery v1.2.6 to v1.4.4 + + [*] BO : Attachment files maximum size is now setable in AdminPreferences + [*] BO : "Bug" #6180 corrected + [*] BO : Combinations impact prices are now stocked without tax into the database (You still can set it with tax) + [*] BO : Fixed bug #6233 + [*] BO : New module category : Payment security + [*] BO : Override .ico tabs on the themes + [*] BO : Traductions updated + [*] BO : Upgrading from jQuery v1.4.2 to v1.4.4 + [*] BO : When adding a downloadable product, you can now delete it without exiting the product page. + + [*] Classes : Smarty cache setting added to the Back Office + + [*] MO : Blockcms displays now cms ordered by position set in bo. + [*] MO : Module UPS - Template Xml for webservices + [*] MO : Mondial Relay have now an update for v1.3 to v1.4 + + [*] WS : changing filter system : before you wrote id=3 and now filter[id]=3 ; displayFields become display + [*] WS : improve ws + [*] WS : now you can get a blank xml tree an a synopsis for the resources to add + [*] WS : remove the useless "p" namespace, it was making me nervous... + + Fixed bugs: + + [-] Project : add condition for Tools::dateFormat() when using Tools::displayDate() method, otherwise a notice failure occured. + + [-] Installer : Bug fixed #6268 (1.4) - db.sql - id_currency in PREFIX_country was set to default '0' + [-] Installer : missing closure tag php + [-] Installer : Warning fixed (_PS_FORCE_SMARTY_2_ wasn't defined) + + [-] FO : Bug fixed #5940 - $this->$this->cookie + [-] FO : bug product.tpl due to update Smarty + [-] FO : Category title is now clickable to access category.php?id_category=1. Bug #6254 fixed + [-] FO : Contact-form don't return htmlentities in form now. Bug #5278 fixed + [-] FO : Corrected smarty problems when id_product or id_category is not set + [-] FO : correct link for friendly URL. Simplify some process + [-] FO : CSS bug on accessories. + [-] FO : delete back arrow button (called cancel) on color picker box. + [-] FO : display "see all pictures" link (js event) under thumbnail list. + [-] FO : ecotax display fixed + [-] FO : fixed bug #6206 + [-] FO : fixed bug #6211 + [-] FO : fixed bug #6226 + [-] FO : Fixed bug #6258 with the automatic redirection to 'install' directory + [-] FO : fixed bug : price display method on cart summary + [-] FO : fixed bug : the id of default image missing + [-] FO : Fixed idTabs js, deleted @ for jQuery compatibility purposes + [-] FO : Good link for CMSCategory friendly url in Link classes. + [-] FO : Improve code for delete smarty notice + [-] FO : Improve code for delete smarty notice + [-] FO : Javascript price displaying cleaned to work exactly like php method : getPriceStatic. + [-] FO : JS fixed on product page (when no ecotax was defined) + [-] FO : New js calc price on product page debuggued. Bug #6319 fixed + [-] FO : Product ecotax display fixed (was the price display method was set to tax excluded) + [-] FO : Product::id_default_category was used rather than Product::id_category_default + [-] FO : product-list.tpl updated + [-] FO : Product page js repaired. Definitely. + [-] FO : Product price fixed (when an ecotax applies and the product has combinations) + [-] FO : Product price fixed (when a reduction applied and a currency different from the default one was selected) + [-] FO : Product-sort repaired. Bug #6151 fixed + [-] FO : Quantity discount display fixed (when the customer group price display is set to tax excluded) + [-] FO : recurse for cms displaying in sitemap + [-] FO : Removed pagination variables errors. Bug #6156 + [-] FO : Removed Warning from sitemap (smarty update) + [-] FO : Reported addresses updates on AuthController. Bug #6222 fixed + [-] FO : Report optimization on category.php. Bug #6314. + [-] FO : Search minimum length was decreased by one on the FO. Bug #6309 fixed + [-] FO : sitemap.php is not dependant from blockcms module now (display all cms pages anytime) + [-] FO : Smarty cache enabling fixed + [-] FO : Specific prices + default attributes modifications + [-] FO : Removed an invisible image loaded from store.apple.com from default descriptions. + [-] FO : Switch language links + [-] FO : Templates update. + [-] FO : .tpl for order.php updated + [-] FO : updated history.tpl + [-] FO : Updated new sitemap.tpl for smarty update. + [-] FO : Updated product.tpl for smarty update + [-] FO : When Special product was loaded the bloc displayed a product even no product are avaiable. + [-] FO : wrong var was set to get the discount expiration date. + + [-] FO / MO : #6153 Conflict with same name of 2 var in 2 different module. + + [-] BO / FO : bug #6066 allow to set unlimited value for an virtual product. set with 0 value. + + [-] BO : Bug fixed #6126 - AdminProduct - Problem caused by Zoom Size in IE8 is fixed now + [-] BO : Corrected error when modifying an address in BO when everything is alright. Bug #6328 + [-] BO : Ecotax input fixed + [-] BO : Fixed a bug with themeinstallator import when there is only one theme in the archive + [-] BO : fixed bug #6139 + [-] BO : fixed bug #6148 + [-] BO : fixed bug #6169 + [-] BO : fixed bug #6175 + [-] BO : fixed bug #6187 + [-] BO : fixed bug #6192 + [-] BO : fixed bug #6195 + [-] BO : fixed bug #6203 + [-] BO : fixed bug #6211 + [-] BO : fixed bug #6212 + [-] BO : fixed bug #6214 + [-] BO : Fixed Parse error in AdminPorduct.php for downloadable module. Bug #6307 fixed + [-] BO : fixed the import module fieldset display + [-] BO : intval restored on a cast in base 8. + [-] BO : Optimization PDF creation. Bug #6315 fixed + [-] BO : Product cancellation fixed (when using ecotax) + [-] BO : Product reduction clarified + [-] BO : Product taxes by country displays an info message + [-] BO : Restored an intval for a cast in base 8. Bug #6324 fixed + [-] BO : Traduction updated + [-] BO : Translations AdminProduct updated. Bug #6190 fixed + [-] BO : Unit price option is not hidden anymore. + [-] BO : When ecotax, attribute Impacts are not affected anymore + [-] BO : When unexpected "," in tags field, no fatal error. + + [-] Classes : fixed bug in displayWarning() + [-] Classes : Group reduction (concerning categories) cache clearing fixed + [-] Classes : Prices (product & shipping) fixed when taxes were disabled but one of them assigned to the product/shipping + [-] Classes : setlocale() fixed + + [-] MO : Blockcms translations updated + [-] MO : Bug fixed #6185 (1.4) - Module MailAlerts - Module Mailalert has been repaired and now refers to order + [-] MO : crossselling.tpl updated + [-] MO : Integration problem on prepaidServices. Bug #6204 fixed + [-] MO : Mondial Relay cleaned + [-] MO : Mondialrelay try to update only if module is installed + [-] MO : Mondial Relay works again on Chrome. + + [-] WS : correct lang displays + [-] WS : Fixed check for activated keys + [-] WS : Fixed - We now display mysql error in debug mode + [-] WS : samples folder move + + [-] TR : Bug fixed #6216 - Modules BirthdayPresent, Bankwire and Secuvad - Md5 Key has been changed, french and spanish translations were reuploaded + [-] TR : Bug fixed #6246 #6230 - Md5 Key has been changed, french and spanish translations were reuploaded + [-] TR : New Translations fixed (1.4) - Md5 Key has been changed, french and spanish translations were reuploaded + [-] TR : Translations fixed (1.4) - Md5 Key has been changed, french and spanish translations were reuploaded + + [-] SQL : Missing `conversion_rate` in ps_order_slip in database on install + +#################################### +# v1.4.0.3 - 3508 (2010-11-25) # +#################################### + + Added Features: + + [+] Project: Add new feature: Geolocalization + [+] Project: now you can define specific country taxes for a product + + [+] Installer : Added timezone choice in the installer + + [+] FO : Display the current RAM usage in the debug informations :-) Very nice.... + + [+] BO : You can now install language's pack with two clicks on AdminTranslation Page + [+] BO : the currencu conversion rate is now stored in the tables orders and order_slip in order to provide a more accurate calculation of the sales statistics + + [+] MO : new module stats dashboard + + Improved/changed features: + + [*] Project : intval() replaced by (int), optimization. + [*] Project : improve url rewrite for static page + + [*] FO : Special breadcrump for CMS Pages. + [*] FO : Allow to choose if "our store" link is displayed at the end of the block, each block is distinguish. + [*] FO : Add a parameter in both Tools::getPath() and Tools::getFullPath() method to distinguish what type of category is used for getting the path. + [*] FO : removed useless query by changing timezone storage + [*] FO : a bunch of useless SQL queries removed + [*] FO : fixed bug in order confirmation + [*] FO : set the breadcrumb in cms page and in cms categories pages. + + [*] BO : add 'display_store' column in cms_block table + [*] BO : add 'display_store' column in cms_block table + [*] BO : add 'display_store' column in cms_block table + [*] BO : delete the displaying option for block cms in the AdminStore tab. The option is moved on the module block CMS. + [*] BO : For each admin list (products for example), set a max width for a the tmp thumbnail. + [*] BO : You can now add an attachment from the AdminProduct page without going to AdminAttachments. + [*] BO : new stats homepage + [*] BO : choose the tab according to prestashop version + [*] BO : fixed bug css + + [*] Classes : SQL optimization perfomances with adding cache object into ObjectModel + + [*] MO : When creating a carrier with Mondial Relay, Weight range are automatically set to the minimum and maximum authorized by Mondial Relay + [*] MO : Mondial Relay module don't need a google api key to work anymore. Updated to googlemaps JS v3. + [*] MO : new version of socolissimo fixed bug + [*] MO : fixed bug in socolissimo //new version 1.4 + [*] MO : search engine keywords improvements + + [*] WS : added full HTTP header in debug mode inside library of web service + [*] WS : simplify the classes ws parameters synthax + + Fixed bugs: + + [-] Project : Use of deprecated functions + [-] Project : Invoice PDF was never sent by mail + [-] Project : now this plugin works with the Dean Edwards JS Packer + + [-] Installer : alter table cms_block + [-] Installer : Fix buf on upgrade with _RIJNDAEL_KEY_ + [-] Installer : Countries' select is now filled with countries in database replacing hardcoded countries. + [-] Installer : fixed bug CMS upgrade + + [-] FO : fixed bug on authentification + [-] FO : bug #6143 - delete the button home in the bottom of cms pages. + [-] FO : fixed bug in cart summary + [-] FO : delete a condition according with bad getter in CMScontroller, now is more efficient. + [-] FO : fixed bug in adminModule + [-] FO : fixed bug #6130 //now modue don't use jquery plugin accordion but "presta made" accordion + [-] FO : bug #6143 - delete the button home in the bottom of cms pages. [*] FO : set the breadcrumb in cms page and in cms categories pages. + [-] FO : correct a bug in LinkCore::getCMSCategoryLink() method, to test if category is an object, we cast it to an int !! Not really a good way ! + [-] FO : related to bug #6143 - Set $cms_category as an attribut of the controller for get it in different method, it appears that it due to an oversight. + [-] FO : fixed bug in cart summary (voucher) + [-] FO : related to bugs #5871 and #6127 - on FrontControllerCore::pagination() method, $nbProducts is added as a parameter rather than a global var. Each controller which use this method has been upgrade. + [-] FO : fixed bug #5769 + [-] FO : Quantity discount display fixed on the product page (when using combinations) + [-] FO : fixed bug #6096 + [-] FO : fixed bug #5806 + [-] FO : adding time calculation on debug + [-] FO : Translate the store meta data + [-] FO : Bug fixed #6054 - displayCarrier() => assignCarrier() + [-] FO : Hardcoded french translation in order-opc.tpl changed. Bug #6082 fixed + [-] FO : fixed bug on order opc and refresh remaining amount to obtain free shipping + [-] FO : In product.tpl in the color picker block, the cancel button has been deleted. Indeed the button behavior was not according to his name. It displayed all pictures when a user already choosed a color declination. The icon is moved on the side of the button "display all pictures". + [-] FO : removed useless queries by caching manufacturers and suppliers names + [-] FO : removed useless queries by caching group reductions + [-] FO : removed useless queries by caching hook/module association + [-] FO : Optimized SQL requests in Category and CMSCategory + [-] FO : Postcode can be with or without ' ' or '-' when needed + error more explicit when postcode failure. Bug #6039 fixed + [-] FO : When a product is new, it is display everytime product-list is displayed. Bug #5654 fixed + [-] FO : javascript link typos + [-] FO : ASC => asc for google referencement compatibility. Bug #5850 fixed + [-] FO : https not used when SSL is enabled + + [-] BO / FO : Invoices works perfectly with a 100% voucher and a total paid price of 0.00. Bug #5984 fixed + + [-] BO: Fixed monetary local on import #5701 + [-] BO: Fix stock movement duplicate qty #6073 + [-] BO : fixed bug in adminCMS + [-] BO: Fixed vat number on pdf invoice #6108 + [-] BO : Change the value of the name field, if they are no value in a specific language, method set empty value, don't search in $block_cms array (Since value isn't set, a Notice error occured) + [-] BO : report #6129 - Set the end tag on the AdminLocalization::display() method. + [-] BO : AdminTranslations on import lang behaviour, the method ValidateCore::IsLanguageFileName($file_name) used wrong var for the preg_match function. Consequently import a language don't worked. + [-] BO : Js errors on adminProduct. Bug #5640 fixed + [-] BO : product link in customer thread wasn't always good + [-] BO : Php error fixed in AdminGroups. Bug #6087 fixed + [-] BO : You can now configure carriers' price for disabled zones. Bug #6074 fixed + [-] BO : Attribute tab redirections cleaned (with the add of specificprice tab). Bug #6078 fixed + [-] BO : If default attribute group is coloris attribute group, options colors weren't displayed. Now yes. + [-] BO : fixed bug #5793 + [-] BO : fixed bug #5677 + [-] BO : You can't install a module two times by "installing the selection" anymore + [-] BO : Removed js error form AdminProduct on Prices tab + [-] BO: You can now add stock movement on combination creation + [-] BO : Number of messages was always 0 in Customer messages + [-] BO: Improve display of stock movement / fix movements with attributes + [-] BO : fixed bug #5906 : the order was set as "On backorder" when there was one item available for the order + [-] BO : fixed bug quantity display on product page + [-] BO : fixed bug #5262 clean position when update categories + [-] BO : fixed bug no display token invalid in adminCatalog and adminContent + [-] BO : fixed bug #6006 - Track The Order link to new page + [-] BO : Removed js errors from search field in BO. Bug #6032 fixed + [-] BO : FriendlyURL filled automatically by filling meta-title field. Bug #6019 fixed + [-] BO : Permissions set for AdminPerformance. Bug #6022 fixed + [-] BO : fixed bug #6016 + [-] BO : fix mailalert fatal error after adding product image + [-] BO : upload tar module Bug #5919 fixed + [-] BO : customer service email fixed + [-] BO : Validation of dni was false (return negative value to ObjectModel), Bug #5932 fixed + [-] BO: isPicture function works now fine even if functions are disabled like exec + + [-] Classes : Ecotax tax application fixes (does apply the tax regarding the customer location) + [-] Classes : French ecotax fixed (was working only without reduction and with a product tax of 19.6%) + [-] Classes : Ordered product's quantity discount fixed (storage error since the specific price implementation) + [-] Classes : fixed bug when shipping cost are external + [-] Classes : Free shipping voucher display fixed + [-] Classes : Product price fixed (when using customer group reduction) + [-] Classes : fixed bug for external shipping cost + [-] Classes : fixed bug #5990 + [-] Classes : fixed bug #5735 - Deletion of group id=1 should not be allowed + [-] Classes : fixed bug #6079 - Fatal error on pdf invoice + [-] Classes : fixed bug in ObjectModel cache system + [-] Classes : Carrier getDeliveryPriceByPrice() & checkDeliveryPriceByPrice() now convert to default currency + [-] Classes : Bug fixed #5959 Incorrect shipping cost by price + [-] Classes : Cache key in getBy"Range" was incorrect + [-] Classes : fixed bug #6001 - W3C validation of search result page, error in Link.php + [-] Classes : date('Y-m-d H:m:i') became date('Y-m-d H:i:s'), bug #6033 fixed + [-] Classes : fixed bug for external shipping + + [-] MO : Mondial Relay more stable + [-] MO : Mondial relay Bug fixed. + [-] MO : blockcategories configuration does clear its display cache + [-] MO : fixed a little bug into blockcart module + [-] MO : Removed 3 useless DB search in Mondial Relay module. And updated for new modifications on carriers module. + [-] MO : bug #6124 if param $begining and ending are false, method used current date for method Product::getPricesDrop() and Product::getRandomSpecial() + [-] MO : bug #6124 In BlockSpecials::hookRightColumn() delete precedent update (see log) // the problem needed more change in other files + [-] MO : In BlockSpecials::hookRightColumn() method - name var $date_today to $date_now + [-] MO : #6124 In BlockSpecials::hookRightColumn() add dates params into Product::getRandomSpecial() method. + [-] MO : MondialRelay Module work now with adresses containing '"' + [-] MO : fixed bug #5571 - Customer Qty Email on mailalert module + [-] MO : fixed bug #6080 - User info block cart button hardcoded to order.php + [-] MO : fixed bug in socolissimo + [-] MO : fixed bug in blockcart + [-] MO : Mondial Relay Module don't create useless archive directory anymore + [-] MO : Sales & Orders Stats Module fixed + [-] MO : Cashondelivery Module work again on FO. Bug #6025 fixed + [-] MO : fixed bug #6008 - Moneybookers error when no local cards + [-] MO : Updating the updater for merchants who forget to copy their editorial.xml before updating... + [-] MO : Removing parse error from mondial relay + [-] MO : Deleted warning mondial relay + corrected minor bugs (#5465 and #5795) + [-] MO : search engine bots do not create hundreds of connections anymore (may not be stable) + + [-] CSS : fixed bug #6018 - CSS is repeated in themes/prestashop/css/modules/blockcms/blockcms.css + + [-] SQL : Updates bug resolved (PHP:ecotax_tax_application_fix()) + [-] SQL : No more errors while updating + [-] SQL : Only one carrier is installed when installing Prestashop lite. + [-] SQL : ps_meta_lang : PREFIX_meta_lang + [-] SQL : Taxes are now installed in database when complete installation (not lite) + [-] SQL : States' iso code can be numericals + + [-] PDF : Ecotax display fixed + + [-] WS : add ws tables when upgrading + [-] WS : namespace prestashop is now deleted + [-] WS : examples are corrected due to new namespace deletion + [-] WS : now we are able to filter get result with an array of only one value + + Deprecated methods: + + [~] Deprecated : Category:: hideCategoryPosition() + [~] Deprecated : Tools::getTimezones() + [~] Deprecated : Product::getReductionValue() + +#################################### +# v1.4.0.2 - 3261 (2010-11-10) # +#################################### + + Added Features: + + [+] Project : Add VAT support + [+] Project : Add InnoDB support + [+] Project : Added UPC barcodes (US/Canada) management (both on product and combinations) + [+] Project : You can now override classes and front office controllers without any core modification + [+] Project : DisplayAsDeprecated function + + [+] FO : Added file upload in contact form and customer service + [+] FO : Added Shop logo and editorial image dimensions + corrected shop name bug on installer + [+] FO : Added some demo stores for the Store locator + [+] FO : Added the "Store locator" feature! using the latest Google Maps API (V3) + [+] FO : Added verification for zip code depends on country selected. + [+] FO : adding cache system for the getPageLink method + [+] FO : Adding One Page Checkout feature + [+] FO : ajax cart summary + [+] FO : Display units price if enabled + [+] FO : you can now specify an alternative domain or subdomain for your static content + [+] FO : Products comparison + + [+] FO / BO : Adding CCC (Combine Compile and Cache) and other frontend performance features, these feature was started with Olivier Bonningues from Oleacorner, Guillaume David and Mickael Surren from Croissance-Net. This was a frontend development training day with Lucas CHERIFI + [+] FO / BO : new options availables on AdminProduct, you can now show or not the price of product and define if this product is available for order + + [+] BO : Added activation to CMS pages + [+] BO : Added an activation to manufacturers and suppliers + [+] BO : Added an "Online only" flag (for products not sold in store) + [+] BO : Added an option in Preferences -> Products to undisplay the button "add to cart" when the product got attributes so customers must go see the product detail. + [+] BO : Added an option in preferences to choose the "Condition of use" CMS page + [+] BO : Added a WorkFlow to CMS pages + [+] BO : Added cache-control directive to the htaccess generator and some apache module checks + [+] BO : Added category in cms tab, position for cms pages + [+] BO : Added enable row to taxes + [+] BO : Added fields 'Need zip code' and 'Zip code format' + [+] BO : Added possibility to delete a product from his detail page (for a search in catalog) + [+] BO : added shipping external for modules + [+] BO : Added the condition of a product (new, used, refurbished) + [+] BO : Added the theme installer module + [+] BO : Added translation for CMS Tab + [+] BO : Added units price (weight, volume, unity) to configure on products pages + [+] BO : Added utility to implant a different logo for shop, mail and PDF. + [+] BO : Additional shipping cost by product + [+] BO : Add Memcached and FileSystem cache + [+] BO : Add stock movement management + [+] BO : AdminModulesPositions : new checkboxes in order to unhook many modules in one click. + [+] BO : An easy way to define fees by carriers for each zone + [+] BO : Automatic translations possible with Google Translate + [+] BO : Carrier behavior (by price/by weight) is now defined by Carrier + [+] BO : Carrier behavior (by range or by price) is now specific to each Carrier + [+] BO : Change category position in catalog + [+] BO : class added (ModuleCarrier) for shipping external + [+] BO : Disabled product can be previewed in front office + [+] BO : external shipping and range + [+] BO : Fix update script to change category name without number position + [+] BO : international call prefixes are now included in prestashop's countries + [+] BO : It's now possible to edit and translate your mail templates from BackOffice + [+] BO : Localisation, you can now choose between miles and kilometers + [+] BO : Meta-tags => SEO + [+] BO : New back end themes (but you don't know about it) + [+] BO : new buttons 'next' and 'previous' on order detail + [+] BO : new Customer Service included in the back office (an alternative to e-mails) + [+] BO : New module pages ! + [+] BO : new tab in Tools, this page give you many informations about your server configuration + [+] BO : now you can define a minimal quantity on product for command + [+] BO : payment modules can now log payment data in a common table + [+] BO : Predefined message when responding in customer service in now configurable (and bug with special characters in mail subject is fixed) + [+] BO : Upload your own store icon (for Google Maps, store locator) + [+] BO : you can now add a private note on the customer page + [+] BO : You can now add a voucher for a customer's group + [+] BO : You can now add others required fields in objects + [+] BO : you can now choose the background color of your back office + [+] BO : you can now cipher/decipher with Rijndael using mcrypt instead of blowfish (amazingly faster) + [+] BO : you can now export your invoices filtered by statuses + + [+] Classes : Localization pack support added + [+] Classes: Smarty cache support added + [+] Classes : Specific price support added to the PrestaShop 1.4 serie + + [+] MO : add a new module, date of delivery + [+] MO : Added a category restriction on the loyalty voucher's use on loyalty module + [+] MO : Added a pagination to loyalty module + [+] MO : adding a new partner module iAdvize + [+] MO : adding a new partner module: MondialRelay + [+] MO : adding a new partner module: Secuvad + [+] MO : Added possibility to display tax on a distinct line in the cart block + [+] MO : productcomments : A new hook on the product comparison page + [+] MO : added module envoimoinscher + [+] MO : new module socolissimo + [+] MO : Paysafecard + Cashticket + [+] MO : TrustedShops + [+] MO : Treepodia + [+] MO : TrustedShops : Check permissions on the /cache directory + [+] MO : modules css stylesheets and javascripts scripts are now overridable and overriden in the theme + [+] MO : new module Fia-Net SAC (France only) + [+] MO : new module Fia-Net Sceau de confiance (France only) + [+] MO : new module "stock stats" + [+] MO : new payment module "Ogone" (some translations are still missing and it needs a few more tests) + [+] MO : you can now empty 404 pages + + [+] SQL : Added row active to ps_currencies and added many currencies when installation + [+] SQL : Added zip/post Code for each countries and all linked to it + + [+] IN : States of Mexico + + [+] WS : Adding a RESTFul webservice for PrestaShop + + Improved/changed features: + + [*] Project : cookie is no more encrypted every time but in the destructor, at the end. You can still force setcookie by using Cookie::write() + [*] Project : Added {$img_store_dir} and _THEME_STORE_DIR_ and _PS_STORE_IMG_DIR_ + [*] Project : Cleaned some debug code in FrontController.php + [*] Project : Front controllers are now classes + + [*] FO : add an instant search feature for the block search on top, realized with Arnaud Iliadis from Web67 while PrestaShop training + [*] FO : Added a cookie to remember the "number of item per page" for a client + [*] FO : added css for sitemap + [*] FO : Added one hook in order-detail.php and one hook processCarrier in order.php. + [*] FO : added product ID to the contact form + [*] FO : added SQL caches to attachments and packs in order to reduce the number of queries speed up the front office + [*] FO : add new Javascript method for One Page Checkout + [*] FO : Add the "completely rewritten url" feature + [*] FO : Ajax cart summary input update qty + [*] FO : changed filter in adminModules + [*] FO : Confirmation mail sent before password regeneration + [*] FO : Corrected some sentences and listing all orders on the contact form + [*] FO : Creation of a SQL cache for the default attribute of a product, avoiding 1 to 3 queries for each product displayed on the FO + [*] FO : Customization field is now a textarea and handle \n + [*] FO : encrypt cookie only if a change has been made + [*] FO : get the quantity of the default attribute only if the product has attributes... + [*] FO : Improve performances for url rewriting links load + [*] FO : I really like optimizations :] (no less than 60 queries avoided on the cart summary, among other things) + [*] FO : New version of socolissimo 1.4 + [*] FO : Optimizations, optimizations and optimizations (mainly SQL queries dropped) + [*] FO : query for random specials optimized (RAND() is awful) + [*] FO : The cart summary now display available vouchers + [*] FO : Undisplay the button when set in BO. + + [*] FO / BO : improved feature minimal quantity for buy a product + + [*] BO : Added a button to make an attribute combination the default one easier + [*] BO : Added "all" blocks in permission page. + [*] BO : Added enable state for currencies + [*] BO : added multiple translation + [*] BO : added timer to back office tabs + [*] BO : added total sales -tx in statsproduct module + [*] BO : adding new tinyMC 3.3.9 + [*] BO : changed filter module + [*] BO : check if cms folder img exists + [*] BO : Customer page improved + [*] BO : Delete of message as well as threads in customer service + [*] BO : Developers can now specify if a field is required or not in Option fields + [*] BO : Display hook technical name in module positions tab + [*] BO : Display hook technical name in module positions tab + [*] BO : Features fields are now textareas to write more details on products + [*] BO : Fixed a bug with the tab navigation when UI mode is on hover + [*] BO : fixed bug in tinyMCE + [*] BO : .htaccess generation on Lang & Meta CRUD + [*] BO : Icons in navigation path bar + [*] BO : img/admin/delete.gif now different from disabled.gif + [*] BO : Improved unity price system : Unity editable by product + [*] BO : Improve Flashyturtle back office theme and back office login page. + [*] BO : move media server parameters in AdminPerformance tabs + [*] BO : New design for top of the first tab in the product page + [*] BO : new footer + [*] BO : New reduction support added to the import + [*] BO : new skin for errors, warnings and confirmations + [*] BO : now you can edit smarty config into AdminPerformance tab + [*] BO : Numeric ISO code now available for currencies + [*] BO : Optimised the category recurse tab + no limitation to 5 subcategories anymore + ajax_call on AdminProduct page to optimize it at the loading. + [*] BO : optimization (30% less queries on every entity listing, then 50% less queries on the module page and again a few less on the order detail and customer pages) + [*] BO : order details display improvements + [*] BO : Print pdf by statuses (explaination + fixed width) + [*] BO : remove old tinyMCE + [*] BO : Sending a confirmation mail to the customer when he sends a message to the customer service + [*] BO : Thread message merge algorithm has been improved on customer service + [*] BO : Tracking displays out of stock attributes + [*] BO : Transformed the last element of the path_bar in BO to a link (blue) + [*] BO : weights equal to zero are not taken into account anymore in the search indexation + [*] BO : Width switched from 960px to 1050px (only 15% of PS users are still using 1024x768) + [*] BO : You can now add your specifical configuration for your hosting on AdminGenerator + [*] BO : You can now disable the "hover on tabs" feature + [*] BO : You can now edit or delete a product from AdminManufacturer page + [*] BO : you can now export invoices filtered by several status IDs + [*] BO : you can now translate everything in the languages which are disabled + + [*] Classes : added CarrierModule.php + [*] Classes : added hook Paymant CC added + [*] Classes : Distance unit support added to localization pack + [*] Classes : remove ModuleCarrier.php + [*] Classes : Configuration::get Optimization + + [*] MO : add category on many modules + [*] MO : Added possibility to delete the logo frontpage image in editorial module + [*] MO : blockcategories module cached + [*] MO : Blockinfos and Blockvariouslinks replaced by Blockcms module + [*] MO : Display of Promotions / New Products / Best Sellers can be disabled when there are nothing + [*] MO : change category + [*] MO : added socolissimo translations + [*] MO : Cleaned the wishlist module and added mail send when creating a wishlist + [*] MO : update Socolissimo for expeditor inet + [*] MO : Editorial module don't stock in an xml file anymore, in case of updating : the xml file will be imported in database and delete + [*] MO : mailalerts are now deleted from the DB when products linked to this mailalert are removed + [*] MO : New blockCms module. (new blockinfos) who work with new recents modifications of CMS pages. + [*] MO : new options for stats datamining + [*] MO : new PayPal and Moneybookers modules added + [*] MO : New reduction & quantity discount support added to the treepodia module + [*] MO: Some improvements on Product Comments (Allow guests to post, create criterion for all catalog/categories...) + [*] MO : You can now display the price on the crossselling and the productscategory module's block (Feature 26 mantis resolved) + + [*] IN : mcrypt is automatically chosen if available + + [*] SQL : Added two hooks in database. + [*] SQL : Added VAT (taxes) values for many countries + [*] SQL : Updated zones (Us becomes North america, central america and South america, etc...) + [*] SQL : When installing, only default country's tax is enable else disabled. + + [*] WS : add i18n support for webservice + + Fixed bugs : + + [-] Installer : Bug fixed #5325 - SQL error + [-] Installer : fixed sql create table + [-] Installer : Installation fixed (condition field was missing) + [-] Installer : ps_ changed to PREFIX_ + [-] Installer : Fixed a crash issue during install process (additional_shipping_cost had no default value) + + [-] FO : "add to cart" is now protected against bots + [-] FO : ajax "add to cart" now uses a POST request instead of GET + [-] FO : Best error gestion for suppliers (HTML broken before) + [-] FO : bug #5638 is fixed : Incorrect css file name + [-] FO : bug #5871 is fixed - this-> missing + [-] FO : Bug fixed #5208 - HTTPS CGV + [-] FO : Bug fixed #5468 - Phone number in new order email + [-] FO : bug fixed on One page checkout + [-] FO : bug is fixed on Vat number field + [-] FO : css typos (thank you Melinda) + [-] FO : Debug on the displaying "Add to cart" button on search page. + [-] FO : Discounted product retrieval fixed + [-] FO : fixed ajax cart summary when block cart not ajax + [-] FO : fixed ajax cart summary when block cart not ajax for order opc + [-] FO : Fixed and rewritten changecurrency.php (blank page previously), lighter and faster + [-] FO : fixed bug for category page. The images get now their size even if the image is missing. + [-] FO : Fixed bug for page addresses when one of the address goes right instead of clearing left + [-] FO : fixed bug on sitemap + [-] FO : fixed css position for cart summary + [-] FO : Fixed SQL error on sitemap.php + [-] FO : Global iso added for urlrewriting + [-] FO : Missing parameters, new products not displayed + [-] FO : onkeydown -> onkeyup in authentification.tpl Bug #5378 fixed + [-] FO : Phone number advertisement more visible + [-] FO : Product price display fixed (when changing the combination and specific price applied) + [-] FO : Product price fixed (retro-compatibility issue) + [-] FO : Product price fixed (rounding issue) when quantity discount applied + [-] FO : SQL query fixed on prices-drop.php + [-] FO : Updated an error message. + [-] FO : Url rewriting - Added flags [QSA, L] in controllers rules + [-] FO : fixed bug for ajax cart summary + [-] FO : Deleted useless css files (blockinfos and blockvariouslinks modules) Bug #5823 fixed + + [-] BO : active filter is now usable without SQL error. Bug #5666 fixed + [-] BO : Added a complementary security on ajax_category_list call + [-] BO : added RewriteRule for cms catégories + [-] BO : AdminDB now list only PrestaShop prefixed tables #5873 + [-] BO : AdminTab traductions restored + [-] BO : ajax call for categories on product page. + [-] BO : Better anchor management in module tab + [-] BO : Bug #4870 problem to reorder product Fixed + [-] BO : Bug #5965 fixed : When passing an argument id_cart to getPriceStatic , new cart replace global cart. + [-] BO : Bug fix #5199 - Country creation: Wrong parameter count + [-] BO : bug fixed #5346 - Not accounting for alternate theme + [-] BO : Bug fixed #5454 - Bad EN translations on product page + [-] BO : Bug fixed #5798 - Stock movement default + [-] BO : bug fixed #5819 - translation fix for AdminCustomerThreads.php + [-] BO : bug fixed #5840 - Minor issues in new login page + [-] BO : Bug fixed #5844 - page not found csshover.htc + [-] BO : bug fixed #5860 - delete attribute, confirm message say attribute number! + [-] BO : Bug fixed #5868 - Import tools - Default language not selected + [-] BO : bug is fixed on Carrier edition, no zones are selected on form on edition + [-] BO : Category debug. Add a category is possible now (before no) + [-] BO : Customized product price fixed on order detail + [-] BO : Debugued product and Cms staging caused by controllers. + [-] BO : default spanish image updated + [-] BO : default spanish pictures + [-] BO : Delete translations directories when deleting a language + [-] BO : Filters stay after an action like unactive or delete for tabs generated by AdminTab + [-] BO : fix bug on import / export for languages pack + [-] BO : fixed a JS error on adminProduct page + [-] BO : Fixed bug #4370 + [-] BO : fixed bug #5115 - getE("PS_CONDITIONS_on") is null + [-] BO : Fixed bug #5217 - Live feed non https + [-] BO : fixed bug #5255 - can’t enable/disable zone + [-] BO : fixed bug #5862 limited countries checkbox + [-] BO : fixed bug in adminModules + [-] BO : Fixed bug sql for CMS + [-] BO : fixed display warning + [-] BO : fixed sql install + [-] BO : fixed upload picture tinymce + [-] BO : Group reduction fixed (table creation was missing) + [-] BO : hover on tabs configuration fixed + [-] BO : i18n staging + [-] BO : improve specific price feature + [-] BO : Integration bugs #5411 and #5482 fixed + [-] BO : move ajaxfilemanager for tinymce + [-] BO : No more Js errors on AdminProduct page for combinations + [-] BO : No multipart encoding needed for AdminZones + [-] BO : Product final price display fixed on the product page, when using specific prices + [-] BO : Product page default action when the user hit enter is "Save" + [-] BO : Refresh position after deletion + [-] BO : remove ajaxfilemanager for tinymce + [-] BO : removed a useless CSS file (moved to ModuleGrid in fact) + [-] BO : Specific price addition fixed when setting a reduction without using the price overload field + [-] BO : Fixed SQL error when filtering by profiles on AdminEmployees page + [-] BO : The impact on unit price isn't show when no unity is set + trad updated + [-] BO : Thread navigation when clicking on "Answer to the next new message" fixed + [-] BO : unit_price's bugs fixed (attribute update, reduction of a negative number) + compatibility with Specific price class + [-] BO : Validating the CMS form with "enter button" work again + [-] BO : When deleting a customer, vouchers assigned to him are deleted + [-] BO : When no URL for a carrier but a tracking number, the tracking number appear but not the link. + [-] BO : you haven't to scroll down in the module list anymore when you install/uninstall a module + + [-] Classes : bug #58721 is fixed - Fatal error on PDF invoice + [-] Classes : fixed bug on method getNbProducts() method on Cart.php file + [-] Classes : New reduction support fixed concerning voucher application + [-] Classes : Fixed isEmail() method in Validate.php, there was an error when the field was empty (even if not required) + + [-] MO : Blockcategories installation repaired + [-] MO : Blocklink installation repaired + [-] MO : bug is fixed #5788 - “voir” on cross selling graphic + [-] MO : CSS for Blockcms module added. + [-] MO : Debugued the crossselling module to uninstall correctly + [-] MO : fixed bug in Socolissimo + [-] MO : productcomments: Query is empty + [-] MO : fixed bug hooknewOrder + [-] MO : fixed bug in validation.php + [-] MO : fixed bug while uninstall module + [-] MO : fixed bug while uninstall module + [-] MO : new version socolissimo and added translation for EMC + [-] MO : update configuration + [-] MO : trustedshops : If the form is submitted and the SOAP extension not activated, it display an error message + [-] MO : Trustedshops : Wrong email in rating link + [-] MO : EditorialClass include is absolute. + [-] MO : fixed a bug on Secuvad module + [-] MO : fixed Gsitemap module bug caused by CMS update Bug #5787 fixed + [-] MO : Fixed little CSS bug in blockwishlist module + [-] MO : Fixed SQL error when reloading the page after deleting a block + [-] MO : No blocks cms are set when installing the blockcms module normally + [-] MO : Ogone SHA-IN calculation updated + [-] MO : optimizing modules for ccc feature + [-] MO : Paypal installation debuggued (when reseting Paypal SQL error banning the access to AdminModules) + [-] MO : small bug is fixed on Dateofdelivery module + [-] MO : statsdata installation repaired + [-] MO : Updated Gsitemap Module for cms' updates + + [-] SQL : Added PS_CONDITIONS_CMS_ID in the installation utility for uptate + [-] SQL : Blockcms's and editorial's tables are not set anymore when installing Prestashop lite + [-] SQL : database modification for carrier modules + [-] SQL : fixed missing request for upgrade + [-] SQL : Removed useless table zone.`enabled` + [-] SQL : sql prefix are fixed + [-] SQL : Upgrade updated : `unity_price` : `unit_price` + [-] SQL : Fixed SQL on #5942 #5888 #5792 + +#################################### +# v1.4.0.1 - 2403 (2010-06-22) # +#################################### + + Added Features: + + [+] SQL : add the replication SQL + + +Release Notes for PrestaShop 1.3 diff --git a/address.php b/address.php new file mode 100644 index 000000000..16828e486 --- /dev/null +++ b/address.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('AddressController')->run(); \ No newline at end of file diff --git a/addresses.php b/addresses.php new file mode 100644 index 000000000..188b17c99 --- /dev/null +++ b/addresses.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('AddressesController')->run(); diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php new file mode 100644 index 000000000..8b1949ceb --- /dev/null +++ b/admin-dev/ajax.php @@ -0,0 +1,601 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +/* Getting cookie or logout */ +require_once(dirname(__FILE__).'/init.php'); + +require_once(PS_ADMIN_DIR.'/tabs/AdminCounty.php'); + +if (isset($_GET['changeParentUrl'])) + echo ''; +if (isset($_GET['installBoughtModule'])) +{ + if (!class_exists('ZipArchive', false)) + die(displayJavascriptAlert('Host does not handle Zip files')); + $zip = new ZipArchive(); + $file = false; + while ($file === false OR file_exists(_PS_MODULE_DIR_.$file)) + $file = uniqid(); + $file = _PS_MODULE_DIR_.$file.'.zip'; + if (!copy('http://addons.prestashop.com/iframe/getboughtfile.php?id_order_detail='.Tools::getValue('id_order_detail').'&token='.Tools::getValue('token'), $file)) + die(displayJavascriptAlert('Cannot copy file')); + $first6 = fread($fd = fopen($file, 'r'), 6); + if (!strncmp($first6, 'Error:', 6)) + { + fclose($fd); + unlink($file); + die(displayJavascriptAlert(fread($fd, 1024))); + } + fclose($fd); + if ($zip->open($file) !== true OR !$zip->extractTo(_PS_MODULE_DIR_) OR !$zip->close()) + { + unlink($file); + die(displayJavascriptAlert('Cannot unzip file')); + } + unlink($file); + die(displayJavascriptAlert('Module copied to disk')); +} + +function displayJavascriptAlert($s){echo '';} + +if (isset($_GET['ajaxProductManufacturers'])) +{ + $currentIndex = 'index.php?tab=AdminCatalog'; + $manufacturers = Manufacturer::getManufacturers(); + if ($manufacturers) + { + $jsonArray = array(); + foreach ($manufacturers AS $manufacturer) + $jsonArray[] = '{"optionValue": "'.$manufacturer['id_manufacturer'].'", "optionDisplay": "'.htmlspecialchars($manufacturer['name']).'"}'; + die('['.implode(',', $jsonArray).']'); + } +} + +if (isset($_GET['ajaxProductSuppliers'])) +{ + $currentIndex = 'index.php?tab=AdminCatalog'; + $suppliers = Supplier::getSuppliers(); + if ($suppliers) + { + $jsonArray = array(); + foreach ($suppliers AS $supplier) + $jsonArray[] = '{"optionValue": "'.$supplier['id_supplier'].'", "optionDisplay": "'.htmlspecialchars($supplier['name']).'"}'; + die('['.implode(',', $jsonArray).']'); + } +} + +if (isset($_GET['ajaxProductAccessories'])) +{ + $currentIndex = 'index.php?tab=AdminCatalog'; + $jsonArray = array(); + + $products = Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, pl.`name` + FROM `'._DB_PREFIX_.'product` p + NATURAL LEFT JOIN `'._DB_PREFIX_.'product_lang` pl + WHERE pl.`id_lang` = '.(int)(Tools::getValue('id_lang')).' + AND p.`id_product` != '.(int)(Tools::getValue('id_product')).' + AND p.`id_product` NOT IN ( + SELECT a.`id_product_2` + FROM `'._DB_PREFIX_.'accessory` a + WHERE a.`id_product_1` = '.(int)(Tools::getValue('id_product')).') + ORDER BY pl.`name`'); + + foreach ($products AS $accessory) + $jsonArray[] = '{"value: "'.(int)($accessory['id_product']).'-'.addslashes($accessory['name']).'", "text":"'.(int)($accessory['id_product']).' - '.addslashes($accessory['name']).'"}'; + die('['.implode(',', $jsonArray).']'); +} + +if (isset($_GET['ajaxDiscountCustomers'])) +{ + global $cookie; + + $currentIndex = 'index.php?tab=AdminDiscounts'; + $jsonArray = array(); + $filter = Tools::getValue('filter'); + + if (Validate::isBool_Id($filter)) + $filterArray = explode('_', $filter); + + $customers = Db::getInstance()->ExecuteS(' + SELECT `id_customer`, `email`, CONCAT(`lastname`, \' \', `firstname`) as name + FROM `'._DB_PREFIX_.'customer` + WHERE `deleted` = 0 AND is_guest = 0 + AND '.(Validate::isUnsignedInt($filter) ? '`id_customer` = '.(int)($filter) : '(`email` LIKE "%'.pSQL($filter).'%" + '.((Validate::isBool_Id($filter) AND $filterArray[0] == 0) ? 'OR `id_customer` = '.(int)($filterArray[1]) : '').' + '.(Validate::isUnsignedInt($filter) ? '`id_customer` = '.(int)($filter) : '').' + OR CONCAT(`firstname`, \' \', `lastname`) LIKE "%'.pSQL($filter).'%" + OR CONCAT(`lastname`, \' \', `firstname`) LIKE "%'.pSQL($filter).'%")').' + ORDER BY CONCAT(`lastname`, \' \', `firstname`) ASC + LIMIT 50'); + + $groups = Db::getInstance()->ExecuteS(' + SELECT g.`id_group`, gl.`name` + FROM `'._DB_PREFIX_.'group` g + LEFT JOIN `'._DB_PREFIX_.'group_lang` AS gl ON (g.`id_group` = gl.`id_group` AND gl.`id_lang` = '.(int)($cookie->id_lang).') + WHERE '.(Validate::isUnsignedInt($filter) ? 'g.`id_group` = '.(int)($filter) : 'gl.`name` LIKE "%'.pSQL($filter).'%" + '.((Validate::isBool_Id($filter) AND $filterArray[0] == 1) ? 'OR g.`id_group` = '.(int)($filterArray[1]) : '')).' + ORDER BY gl.`name` ASC + LIMIT 50'); + + $json = '{"customers" : '; + foreach ($customers AS $customer) + $jsonArray[] = '{"value":"0_'.(int)($customer['id_customer']).'", "text":"'.addslashes($customer['name']).' ('.addslashes($customer['email']).')"}'; + $json .= '['.implode(',', $jsonArray).'], + "groups" : '; + $jsonArray = array(); + foreach ($groups AS $group) + $jsonArray[] = '{"value":"1_'.(int)($group['id_group']).'", "text":"'.addslashes($group['name']).'"}'; + $json .= '['.implode(',', $jsonArray).']}'; + die($json); +} + +if (Tools::getValue('page') == 'prestastore' AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) + readfile('http://addons.prestashop.com/adminmodules.php?lang='.Language::getIsoById($cookie->id_lang)); +if (Tools::getValue('page') == 'themes' AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) + readfile('http://addons.prestashop.com/adminthemes.php?lang='.Language::getIsoById($cookie->id_lang)); + +if ($step = (int)(Tools::getValue('ajaxProductTab'))) +{ + require_once(dirname(__FILE__).'/tabs/AdminCatalog.php'); + $catalog = new AdminCatalog(); + $admin = new AdminProducts(); + + $languages = Language::getLanguages(false); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $product = new Product((int)(Tools::getValue('id_product'))); + if (!Validate::isLoadedObject($product)) + die (Tools::displayError('Product cannot be loaded')); + + $switchArray = array(3 => 'displayFormPrices', 4 => 'displayFormAttributes', 5 => 'displayFormFeatures', 6 => 'displayFormCustomization', 7 => 'displayFormAttachments'); + $currentIndex = 'index.php?tab=AdminCatalog'; + if (key_exists($step, $switchArray)) + $admin->{$switchArray[$step]}($product, $languages, $defaultLanguage); +} + +if (isset($_GET['getAvailableFields']) and isset($_GET['entity'])) +{ + $currentIndex = 'index.php?tab=AdminImport'; + $jsonArray = array(); + require_once(dirname(__FILE__).'/tabs/AdminImport.php'); + $import = new AdminImport(); + + $languages = Language::getLanguages(false); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $fields = $import->getAvailableFields(true); + foreach ($fields AS $field) + $jsonArray[] = '{"field":"'.addslashes($field).'"}'; + die('['.implode(',', $jsonArray).']'); +} + +if (array_key_exists('ajaxModulesPositions', $_POST)) +{ + $id_module = (int)(Tools::getValue('id_module')); + $id_hook = (int)(Tools::getValue('id_hook')); + $way = (int)(Tools::getValue('way')); + $positions = Tools::getValue(strval($id_hook)); + $position = (is_array($positions)) ? array_search($id_hook.'_'.$id_module, $positions) : null; + $module = Module::getInstanceById($id_module); + if (Validate::isLoadedObject($module)) + if ($module->updatePosition($id_hook, $way, $position)) + die(true); + else + die('{"hasError" : true, "errors" : "Can not update module position"}'); + else + die('{"hasError" : true, "errors" : "This module can not be loaded"}'); +} + +if (array_key_exists('ajaxCategoriesPositions', $_POST)) +{ + $id_category_to_move = (int)(Tools::getValue('id_category_to_move')); + $id_category_parent = (int)(Tools::getValue('id_category_parent')); + $way = (int)(Tools::getValue('way')); + $positions = Tools::getValue('category'); + if (is_array($positions)) + foreach ($positions AS $key => $value) + { + $pos = explode('_', $value); + if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category_parent AND $pos[2] == $id_category_to_move)) + { + $position = $key; + break; + } + } + $category = new Category($id_category_to_move); + if (Validate::isLoadedObject($category)) + { + if (isset($position) && $category->updatePosition($way, $position)) + { + Module::hookExec('categoryUpdate'); + die(true); + } + else + die('{"hasError" : true, errors : "Can not update categories position"}'); + } + else + die('{"hasError" : true, "errors" : "This category can not be loaded"}'); + +} + +if (array_key_exists('ajaxCMSCategoriesPositions', $_POST)) +{ + $id_cms_category_to_move = (int)(Tools::getValue('id_cms_category_to_move')); + $id_cms_category_parent = (int)(Tools::getValue('id_cms_category_parent')); + $way = (int)(Tools::getValue('way')); + $positions = Tools::getValue('cms_category'); + if (is_array($positions)) + foreach ($positions AS $key => $value) + { + $pos = explode('_', $value); + if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_cms_category_parent AND $pos[2] == $id_cms_category_to_move)) + { + $position = $key; + break; + } + } + $cms_category = new CMSCategory($id_cms_category_to_move); + if (Validate::isLoadedObject($cms_category)) + { + if (isset($position) && $cms_category->updatePosition($way, $position)) + die(true); + else + die('{"hasError" : true, "errors" : "Can not update cms categories position"}'); + } + else + die('{"hasError" : true, "errors" : "This cms category can not be loaded"}'); +} + +if (array_key_exists('ajaxCMSPositions', $_POST)) +{ + $id_cms = (int)(Tools::getValue('id_cms')); + $id_category = (int)(Tools::getValue('id_cms_category')); + $way = (int)(Tools::getValue('way')); + $positions = Tools::getValue('cms'); + if (is_array($positions)) + foreach ($positions AS $key => $value) + { + $pos = explode('_', $value); + if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category AND $pos[2] == $id_cms)) + { + $position = $key; + break; + } + } + $cms = new CMS($id_cms); + if (Validate::isLoadedObject($cms)) + { + if (isset($position) && $cms->updatePosition($way, $position)) + die(true); + else + die('{"hasError" : true, "errors" : "Can not update cms position"}'); + } + else + die('{"hasError" : true, "errors" : "This cms can not be loaded"}'); +} + +/* Modify product position in catalog */ +if (array_key_exists('ajaxProductsPositions', $_POST)) +{ + $way = (int)(Tools::getValue('way')); + $id_product = (int)(Tools::getValue('id_product')); + $id_category = (int)(Tools::getValue('id_category')); + $positions = Tools::getValue('product'); + + if (is_array($positions)) + foreach ($positions AS $position => $value) + { + // pos[1] = id_categ, pos[2] = id_product, pos[3]=old position + $pos = explode('_', $value); + + if ((isset($pos[1]) AND isset($pos[2])) AND ($pos[1] == $id_category AND (int)$pos[2] === $id_product)) + { + if ($product = new Product((int)$pos[2])) + if (isset($position) && $product->updatePosition($way, $position)) + echo "ok position $position for product $pos[2]\r\n"; + else + echo '{"hasError" : true, "errors" : "Can not update product '. $id_product . ' to position '.$position.' "}'; + else + echo '{"hasError" : true, "errors" : "This product ('.$id_product.') can t be loaded"}'; + + break; + } + } +} + +if (isset($_GET['ajaxProductPackItems'])) +{ + $jsonArray = array(); + $products = Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, pl.`name` + FROM `'._DB_PREFIX_.'product` p + NATURAL LEFT JOIN `'._DB_PREFIX_.'product_lang` pl + WHERE pl.`id_lang` = '.(int)(Tools::getValue('id_lang')).' + AND p.`id_product` NOT IN (SELECT DISTINCT id_product_pack FROM `'._DB_PREFIX_.'pack`) + AND p.`id_product` != '.(int)(Tools::getValue('id_product'))); + + foreach ($products AS $packItem) + $jsonArray[] = '{"value": "'.(int)($packItem['id_product']).'-'.addslashes($packItem['name']).'", "text":"'.(int)($packItem['id_product']).' - '.addslashes($packItem['name']).'"}'; + die('['.implode(',', $jsonArray).']'); +} + +if (isset($_GET['ajaxStates']) AND isset($_GET['id_country'])) +{ + $states = Db::getInstance()->ExecuteS(' + SELECT s.id_state, s.name + FROM '._DB_PREFIX_.'state s + LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`) + WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1 + ORDER BY s.`name` ASC'); + + if (is_array($states) AND !empty($states)) + { + $list = ''; + if (Tools::getValue('no_empty') != true) + $list = ''."\n"; + + foreach ($states AS $state) + $list .= ''."\n"; + } + else + $list = 'false'; + + die($list); +} + +if (Tools::isSubmit('submitCustomerNote') AND $id_customer = (int)Tools::getValue('id_customer')) +{ + $note = html_entity_decode(Tools::getValue('note')); + if (!empty($note) AND !Validate::isCleanHtml($note)) + die ('error:validation'); + if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `note` = "'.pSQL($note, true).'" WHERE id_customer = '.(int)$id_customer.' LIMIT 1')) + die ('error:update'); + die('ok'); +} + +if (Tools::getValue('form_language_id')) +{ + if (!($cookie->employee_form_lang = (int)(Tools::getValue('form_language_id')))) + die ('Error while updating cookie.'); + die ('Form language updated.'); +} + +if (Tools::getValue('submitPublishProduct')) +{ + global $cookie; + + if (Tools::getIsset('id_product')) + { + $id_product = (int)(Tools::getValue('id_product')); + $id_tab_catalog = (int)(Tab::getIdFromClassName('AdminCatalog')); + $token = Tools::getAdminToken('AdminCatalog'.(int)($id_tab_catalog).(int)($cookie->id_employee)); + $bo_product_url = dirname($_SERVER['PHP_SELF']).'/index.php?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.$token; + + if (Tools::getValue('redirect')) + die($bo_product_url); + + $profileAccess = Profile::getProfileAccess((int)($cookie->profile), $id_tab_catalog); + if($profileAccess['edit']) + { + $product = new Product((int)(Tools::getValue('id_product'))); + if (!Validate::isLoadedObject($product)) + die('error: invalid id'); + + $product->active = 1; + + if ($product->save()) + die($bo_product_url); + else + die('error: saving'); + + } else { + die('error: permissions'); + } + } + else + die ('error: parameters'); +} + +if (Tools::getValue('submitPublishCMS')) +{ + global $cookie; + + if (Tools::getIsset('id_cms')) + { + $id_cms = (int)(Tools::getValue('id_cms')); + $id_tab_cms = (int)(Tab::getIdFromClassName('AdminCMSContent')); + $token = Tools::getAdminToken('AdminCMSContent'.(int)($id_tab_cms).(int)($cookie->id_employee)); + $bo_cms_url = dirname($_SERVER['PHP_SELF']).'/index.php?tab=AdminCMSContent&id_cms='.(int)$id_cms.'&updatecms&token='.$token; + + if (Tools::getValue('redirect')) + die($bo_cms_url); + + $profileAccess = Profile::getProfileAccess((int)($cookie->profile), $id_tab_cms); + if($profileAccess['edit']) + { + $cms = new CMS((int)(Tools::getValue('id_cms'))); + if (!Validate::isLoadedObject($cms)) + die('error: invalid id'); + + $cms->active = 1; + + if ($cms->save()) + die($bo_cms_url); + else + die('error: saving'); + + } else { + die('error: permissions'); + } + } + else + die ('error: parameters'); +} + +if (Tools::isSubmit('submitTrackClickOnHelp')) +{ + $label = Tools::getValue('label'); + $version = Tools::getValue('version'); + + if (!empty($label) && !empty($version)) + HelpAccess::trackClick($label, $version); +} + +if (Tools::isSubmit('saveImportMatchs')) +{ + $match = implode('|', Tools::getValue('type_value')); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'import_match` ( + `id_import_match` , + `name` , + `match`, + `skip` + ) + VALUES ( + NULL , + \''.pSQL(Tools::getValue('newImportMatchs')).'\', + \''.pSQL($match).'\', + \''.pSQL(Tools::getValue('skip')).'\' + )'); + + die('{"id" : "'.Db::getInstance()->Insert_ID().'"}'); +} + +if (Tools::isSubmit('deleteImportMatchs')) +{ + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs'))); +} + +if (Tools::isSubmit('loadImportMatchs')) +{ + $return = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'import_match` WHERE id_import_match = '.pSQL(Tools::getValue('idImportMatchs'))); + die('{"id" : "'.$return[0]['id_import_match'].'", "matchs" : "'.$return[0]['match'].'", "skip" : "'.$return[0]['skip'].'"}'); +} + +if (Tools::isSubmit('toggleScreencast')) +{ + global $cookie; + $cookie->show_screencast = (int)(!(bool)$cookie->show_screencast); +} + +if (Tools::isSubmit('ajaxAddZipCode') OR Tools::isSubmit('ajaxRemoveZipCode')) +{ + $zipcodes = Tools::getValue('zipcodes'); + $id_county = (int)Tools::getValue('id_county'); + + $county = new County($id_county); + if (!Validate::isLoadedObject($county)) + die('error'); + + if (Tools::isSubmit('ajaxAddZipCode')) + { + if ($county->isZipCodeRangePresent($zipcodes)) + die('error:'.Tools::displayError('This Zip Code is already in use.')); + if ($county->addZipCodes($zipcodes)) + die(AdminCounty::renderZipCodeList($county->getZipCodes())); + } + else if (Tools::isSubmit('ajaxRemoveZipCode') AND $county->removeZipCodes($zipcodes)) + die(AdminCounty::renderZipCodeList($county->getZipCodes())); + + die('error'); +} + +if (Tools::isSubmit('helpAccess')) +{ + $item = Tools::getValue('item'); + $isoUser = Tools::getValue('isoUser'); + $country = Tools::getValue('country'); + $version = Tools::getValue('version'); + + if (isset($item) AND isset($isoUser) AND isset($country)) + die(HelpAccess::displayHelp($item, $isoUser, $country, $version)); + die(); +} + +if (Tools::isSubmit('getHookableList')) +{ + $modules_list = explode(',', Tools::getValue('modules_list')); + $hooks_list = explode(',', Tools::getValue('hooks_list')); + $hookableList = array(); + + foreach ($modules_list as $module) + { + $moduleInstance = Module::getInstanceByName($module); + foreach($hooks_list as $hook_name) + { + if (!array_key_exists($hook_name, $hookableList)) + $hookableList[$hook_name] = array(); + if ($moduleInstance->isHookableOn($hook_name)) + array_push($hookableList[$hook_name], $module); + } + + } + die(Tools::jsonEncode($hookableList)); +} + +if (Tools::isSubmit('getHookableModuleList')) +{ + + include('../init.php'); + $hook_name = Tools::getValue('hook'); + $hookableModulesList = array(); + $modules = Db::getInstance()->ExecuteS('SELECT id_module, name FROM `'._DB_PREFIX_.'module` '); + foreach ($modules as $module) + { + if (file_exists(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php')) + { + include_once(_PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php'); + $mod = new $module['name'](); + if ($mod->isHookableOn($hook_name)) + $hookableModulesList[] = array('id' => (int)$mod->id, 'name' => $mod->displayName, 'display' => Module::hookExec($hook_name, array(), (int)$mod->id)); + } + } + die(Tools::jsonEncode($hookableModulesList)); +} + +if (Tools::isSubmit('saveHook')) +{ + $hooks_list = explode(',', Tools::getValue('hooks_list')); + $hookableList = array(); + foreach ($hooks_list as $hook) + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = (SELECT id_hook FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook).'\' LIMIT 0, 1)'); + $hookedModules = explode(',', Tools::getValue($hook)); + $i = 1; + $value = ''; + foreach($hookedModules as $module) + { + $ids = explode('_', $module); + $value .= '('.$ids[1].', (SELECT id_hook FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook).'\' LIMIT 0, 1), '.$i.'),'; + $i ++; + } + $value = rtrim($value, ','); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) VALUES '.$value); + + } + die('{"hasError" : false, "errors" : ""}'); +} \ No newline at end of file diff --git a/admin-dev/ajax_category_list.php b/admin-dev/ajax_category_list.php new file mode 100755 index 000000000..50f0e91a5 --- /dev/null +++ b/admin-dev/ajax_category_list.php @@ -0,0 +1,85 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + define('PS_ADMIN_DIR', getcwd()); + include_once('../config/config.inc.php'); + include_once('tabs/AdminCatalog.php'); + include_once('tabs/AdminProducts.php'); + include_once('init.php'); + + if (Tools::getValue('token') != Tools::getAdminTokenLite('AdminCatalog')) + die(1); + + $catalog = new AdminCatalog(); + $adminProducts = new AdminProducts(); + + global $cookie; + + echo ' + + + + + + + '.$adminProducts->getL('Catalog:').' + +
+ + + + + + + '; + $done = array(); + $index = array(); + + $categoryBox = Tools::getValue('categoryBox'); + if ($categoryBox != '') + { + $categoryBox = @unserialize($categoryBox); + foreach ($categoryBox AS $k => $row) + $index[] = $row; + } + elseif ((int)Tools::getValue('id_product')) + $index = Product::getProductCategories((int)Tools::getValue('id_product')); + $adminProducts->recurseCategoryForInclude((int)(Tools::getValue('id_product')), $index, $categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default'))); + echo '
'.$adminProducts->getL('ID').''.$adminProducts->getL('Name').'
+

'.$adminProducts->getL('Mark all checkbox(es) of categories in which product is to appear').' *

+
+ '; diff --git a/admin-dev/ajax_lang_packs.php b/admin-dev/ajax_lang_packs.php new file mode 100644 index 000000000..dd3af91e7 --- /dev/null +++ b/admin-dev/ajax_lang_packs.php @@ -0,0 +1,50 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +/* Getting cookie or logout */ +require_once(dirname(__FILE__).'/init.php'); + +if(!isset($_GET['iso_lang']) OR empty($_GET['iso_lang'])) + die('fail:0'); +if(!isset($_GET['ps_version']) OR empty($_GET['ps_version'])) + die('fail:0'); +if(@fsockopen('www.prestashop.com', 80)) +{ + // Get all iso code available + $lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']); + + if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== NULL) + { + echo $lang_packs; + } + else + die('fail:2'); +} +else + die('offline'); diff --git a/admin-dev/ajax_products_list.php b/admin-dev/ajax_products_list.php new file mode 100644 index 000000000..ea2f320a3 --- /dev/null +++ b/admin-dev/ajax_products_list.php @@ -0,0 +1,61 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +/* Getting cookie or logout */ +require_once(dirname(__FILE__).'/init.php'); + +$query = Tools::getValue('q', false); +if (!$query OR $query == '' OR strlen($query) < 1) + die(); + +/* + * In the SQL request the "q" param is used entirely to match result in database. + * In this way if string:"(ref : #ref_pattern#)" is displayed on the return list, + * they are no return values just because string:"(ref : #ref_pattern#)" + * is not write in the name field of the product. + * So the ref pattern will be cut for the search request. + */ +if($pos = strpos($query, ' (ref:')) + $query = substr($query, 0, $pos); + +$excludeIds = Tools::getValue('excludeIds', false); +if ($excludeIds && $excludeIds != 'NaN') + $excludeIds = implode(',', array_map('intval', explode(',', $excludeIds))); +else + $excludeIds = ''; +$items = Db::getInstance()->ExecuteS(' +SELECT p.`id_product`, `reference`, pl.name +FROM `'._DB_PREFIX_.'product` p +LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product) +WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\') AND pl.id_lang = '.(int)($cookie->id_lang). +(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : '')); + +if ($items) + foreach ($items AS $item) + echo trim($item['name']).(!empty($item['reference']) ? ' (ref: '.$item['reference'].')' : '').'|'.(int)($item['id_product'])."\n"; diff --git a/admin-dev/ajax_send_mail_test.php b/admin-dev/ajax_send_mail_test.php new file mode 100644 index 000000000..cd3c33079 --- /dev/null +++ b/admin-dev/ajax_send_mail_test.php @@ -0,0 +1,47 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../config/config.inc.php'); + +/* Getting cookie or logout */ +require_once(dirname(__FILE__).'/init.php'); + +$smtpChecked = (trim($_GET['mailMethod']) == 'smtp'); +$smtpServer = $_GET['smtpSrv']; +$content = $_GET['testMsg']; +$subject = $_GET['testSubject']; +$type = 'text/html'; +$to = $_GET['testEmail']; +$from = Configuration::get('PS_SHOP_EMAIL'); +$smtpLogin = $_GET['smtpLogin']; +$smtpPassword = $_GET['smtpPassword']; +$smtpPort = $_GET['smtpPort']; +$smtpEncryption = $_GET['smtpEnc']; + +$result = Mail::sendMailTest(Tools::htmlentitiesUTF8($smtpChecked), Tools::htmlentitiesUTF8($smtpServer), Tools::htmlentitiesUTF8($content), Tools::htmlentitiesUTF8($subject), Tools::htmlentitiesUTF8($type), Tools::htmlentitiesUTF8($to), Tools::htmlentitiesUTF8($from), Tools::htmlentitiesUTF8($smtpLogin), Tools::htmlentitiesUTF8($smtpPassword), Tools::htmlentitiesUTF8($smtpPort), Tools::htmlentitiesUTF8($smtpEncryption)); +die($result ? 'ok' : 'fail'); + diff --git a/admin-dev/ajaxfilemanager/_ajax_get_details_listing.php b/admin-dev/ajaxfilemanager/_ajax_get_details_listing.php new file mode 100755 index 000000000..8e049eac7 --- /dev/null +++ b/admin-dev/ajaxfilemanager/_ajax_get_details_listing.php @@ -0,0 +1,54 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  
  /> +   
 /> +   >">  
+
\ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/_ajax_get_thumbnail_listing.php b/admin-dev/ajaxfilemanager/_ajax_get_thumbnail_listing.php new file mode 100755 index 000000000..221d10f33 --- /dev/null +++ b/admin-dev/ajaxfilemanager/_ajax_get_thumbnail_listing.php @@ -0,0 +1,37 @@ +
+ +
+
+ '; + echo '' . "\n"; + break; + case 'fileFlash': + case 'fileVideo': + case 'fileMusic': + break; + default: + echo ' '; + } + ?> + +
+
  class="radio" value="" /> + href="" title="" id="a">
+ +
+ +
\ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/_ajax_load_folders.php b/admin-dev/ajaxfilemanager/_ajax_load_folders.php new file mode 100755 index 000000000..6017ac47f --- /dev/null +++ b/admin-dev/ajaxfilemanager/_ajax_load_folders.php @@ -0,0 +1,17 @@ + + \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_create_folder.php b/admin-dev/ajaxfilemanager/ajax_create_folder.php new file mode 100755 index 000000000..ad3d5eea1 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_create_folder.php @@ -0,0 +1,75 @@ +mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775)) + { + include_once(CLASS_MANAGER); + $manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false); + $pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']); + foreach($pathInfo as $k=>$v) + { + switch ($k) + { + + + case "ctime"; + case "mtime": + case "atime": + $v = date(DATE_TIME_FORMAT, $v); + break; + case 'name': + $info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v)); + break; + case 'cssClass': + $v = 'folderEmpty'; + break; + } + $info .= sprintf(", %s:'%s'", $k, $v); + } + }else + { + $error = ERR_FOLDER_CREATION_FAILED; + } + //$error = "For security reason, folder creation function has been disabled."; + } + echo "error:'" . $error . "'"; + echo $info; + echo "}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_delete_file.php b/admin-dev/ajaxfilemanager/ajax_delete_file.php new file mode 100755 index 000000000..be52c2c99 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_delete_file.php @@ -0,0 +1,79 @@ +delete(addTrailingSlash(backslashToSlash($_GET['delete']))); + }elseif(is_file($_GET['delete']) + && isValidPattern(CONFIG_SYS_INC_FILE_PATTERN, getBaseName($_GET['delete'])) + && !isInvalidPattern(CONFIG_SYS_EXC_FILE_PATTERN, getBaseName($_GET['delete'])) + ) + { + $file->delete(($_GET['delete'])); + } + } + }else + { + if(!isset($_POST['selectedDoc']) || !is_array($_POST['selectedDoc']) || sizeof($_POST['selectedDoc']) < 1) + { + $error = ERR_NOT_FILE_SELECTED; + } + else + { + + include_once(CLASS_FILE); + $file = new file(); + + foreach($_POST['selectedDoc'] as $doc) + { + if(file_exists($doc) && isUnderRoot($doc)) + { + if(is_dir($doc) + && isValidPattern(CONFIG_SYS_INC_DIR_PATTERN, $doc) + && !isInvalidPattern(CONFIG_SYS_EXC_DIR_PATTERN, $doc)) + { + $file->delete(addTrailingSlash(backslashToSlash($doc))); + }elseif(is_file($doc) + && isValidPattern(CONFIG_SYS_INC_FILE_PATTERN, $doc) + && !isInvalidPattern(CONFIG_SYS_EXC_FILE_PATTERN, $doc) + ) + { + $file->delete($doc); + } + } + + + } + } + } + + echo "{error:'" . $error . "'}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_download.php b/admin-dev/ajaxfilemanager/ajax_download.php new file mode 100755 index 000000000..ec054a846 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_download.php @@ -0,0 +1,33 @@ + getMemoryLimit()) + {//larger then the php memory limit, redirect to the file + + header('Location: ' . $path); + exit; + }else + {//open it up and send out with php + downloadFile($path); + + } + }else + { + die(ERR_DOWNLOAD_FILE_NOT_FOUND); + } +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_editor_reset.php b/admin-dev/ajaxfilemanager/ajax_editor_reset.php new file mode 100755 index 000000000..ba210e6a9 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_editor_reset.php @@ -0,0 +1,118 @@ +loadImage($_POST['path']); + + switch($_POST['mode']) + { + case "resize": + if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) + { + $error = IMG_SAVE_RESIZE_FAILED; + } + break; + case "crop": + if(!$image->cropToDimensions($_POST['x'], $_POST['y'], (int)($_POST['x']) + (int)($_POST['width']), (int)($_POST['y']) + (int)($_POST['height']))) + { + $error = IMG_SAVE_CROP_FAILED; + } + + break; + case "flip": + if(!$image->flip($_POST['flip_angle'])) + { + $error = IMG_SAVE_FLIP_FAILED; + } + break; + case "rotate": + if(!$image->rotate((int)($_POST['angle']))) + { + $error = IMG_SAVE_ROTATE_FAILED; + } + break; + default: + $error = IMG_SAVE_UNKNOWN_MODE; + } + if(empty($error)) + { + + $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); + if(!@copy($_POST['path'], $sessionNewPath)) + { + $error = IMG_SAVE_BACKUP_FAILED; + }else + { + addSessionHistory($_POST['path'], $sessionNewPath); + if($image->saveImage($_POST['path'])) + { + $imageInfo = $image->getFinalImageInfo(); + $info .= ",width:" . $imageInfo['width'] . "\n"; + $info .= ",height:" . $imageInfo['height'] . "\n"; + $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; + }else + { + $error = IMG_SAVE_FAILED; + } + } + }else + { + //$image->DestroyImages(); + } + }else + { + $error = IMG_SAVE_UNKNOWN_MODE; + } + } + + echo "error:'" . $error . "'\n"; + if(isset($image) && is_object($image)) + { + $image->DestroyImages(); + } + echo $info; + echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; + echo "}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_file_copy.php b/admin-dev/ajaxfilemanager/ajax_file_copy.php new file mode 100755 index 000000000..99b19ab64 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_file_copy.php @@ -0,0 +1,35 @@ +setAction($_POST['action_value']); + $sessionAction->setFolder($_POST['currentFolderPath']); + $sessionAction->set($_POST['selectedDoc']); + $info = ',num:' . sizeof($_POST['selectedDoc']); + } + echo "{error:'" . $error . "'\n" . $info . "}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_file_cut.php b/admin-dev/ajaxfilemanager/ajax_file_cut.php new file mode 100755 index 000000000..07a7f5574 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_file_cut.php @@ -0,0 +1,36 @@ +setAction($_POST['action_value']); + $sessionAction->setFolder($_POST['currentFolderPath']); + $sessionAction->set($_POST['selectedDoc']); + $info = ',num:' . sizeof($_POST['selectedDoc']); + } + echo "{error:'" . $error . "'\n" . $info . "}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_file_paste.php b/admin-dev/ajaxfilemanager/ajax_file_paste.php new file mode 100755 index 000000000..787626267 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_file_paste.php @@ -0,0 +1,140 @@ +setSessionAction($sessionAction); + $selectedDocuments = $sessionAction->get(); + + $destFolderPath = addTrailingSlash(backslashToSlash($_GET['current_folder_path'])); + + + if(sizeof($selectedDocuments)) + { + //get all files within the destination folder + $allDocs = array(); + if(($fh = @opendir($_GET['current_folder_path']))) + { + while(($file = readdir($fh)) && $file != '.' && $file != '..') + { + $allDocs[] = getRealPath($destFolderPath . $file); + } + } + closedir($fh); + include_once(CLASS_FILE); + $file = new file(); + //check if all files are allowed to cut or copy + + foreach($selectedDocuments as $doc) + { + if(file_exists($doc) && isUnderRoot($doc) ) + { + + if( array_search(getRealPath($doc), $allDocs) === false || CONFIG_OVERWRITTEN) + { + if(CONFIG_OVERWRITTEN) + { + $file->delete($doc); + } + if($file->copyTo($doc, $_GET['current_folder_path'])) + { + + $finalPath = $destFolderPath . basename($doc); + $objFile = new file($finalPath); + $tem = $objFile->getFileInfo(); + $obj = new manager($finalPath, false); + + $fileType = $obj->getFileType($finalPath, (is_dir($finalPath)?true:false)); + + foreach($fileType as $k=>$v) + { + $tem[$k] = $v; + } + +/* foreach ($folderInfo as $k=>$v) + { + $tem['i_' . $k] = $v; + } + if($folderInfo['type'] == 'folder' && empty($folderInfo['subdir']) && empty($folderInfo['file'])) + { + $tem['cssClass'] = 'folderEmpty'; + }*/ + + $tem['final_path'] = $finalPath; + $tem['path'] = backslashToSlash($finalPath); + $tem['type'] = (is_dir($finalPath)?'folder':'file'); + $tem['size'] = @transformFileSize($tem['size']); + $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); + $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); + $tem['flag'] = 'noFlag'; + $tem['url'] = getFileUrl($doc); + + $manager = null; + if($sessionAction->getAction() == "cut") + { + $file->delete($doc); + } + $fileMoved[sizeof($fileMoved)] = $tem; + $tem = null; + } + }else + { + $unmovedDocDueToSamePath[] = $doc; + } + + } + } + + $sessionAction->set(array()); + } + if(sizeof($unmovedDocDueToSamePath) == sizeof($selectedDocuments)) + { + $error = ERR_DEST_FOLDER_NOT_ALLOWED; + }elseif(sizeof($unmovedDocDueToSamePath)) + { + foreach($unmovedDocDueToSamePath as $v) + { + $error .= sprintf(ERR_UNABLE_TO_MOVE_TO_SAME_DEST, $v) . "\r\n"; + } + } + } + + echo "{'error':'" . $error . "', 'unmoved_files':" . sizeof($unmovedDocDueToSamePath) . ", 'files':{"; + foreach($fileMoved as $i=>$file) + { + + echo ($i>0?', ':' ') . $i . ": { "; + $j = 0; + foreach($file as $k=>$v) + { + echo ($j++ > 0? ", ":'') . "'" . $k . "':'" . $v . "'"; + + } + echo "} "; + } + echo "} }"; + +?> diff --git a/admin-dev/ajaxfilemanager/ajax_file_upload.php b/admin-dev/ajaxfilemanager/ajax_file_upload.php new file mode 100755 index 000000000..ebe128482 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_file_upload.php @@ -0,0 +1,90 @@ +setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS)); + if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD) + { + $error = SYS_DISABLED; + } + elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder'])) + { + $error = ERR_FOLDER_PATH_NOT_ALLOWED; + }else if(!$upload->isFileUploaded('file')) + { + $error = ERR_FILE_NOT_UPLOADED; + }else if(!$upload->moveUploadedFile($_GET['folder'])) + { + $error = ERR_FILE_MOVE_FAILED; + } + elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS))) + { + $error = ERR_FILE_TYPE_NOT_ALLOWED; + }elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE)) + { + $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE)); + }else + { + include_once(CLASS_FILE); + $path = $upload->getFilePath(); + $obj = new file($path); + $tem = $obj->getFileInfo(); + if(sizeof($tem)) + { + include_once(CLASS_MANAGER); + + $manager = new manager($upload->getFilePath(), false); + + $fileType = $manager->getFileType($upload->getFileName()); + + foreach($fileType as $k=>$v) + { + $tem[$k] = $v; + } + + $tem['path'] = backslashToSlash($path); + $tem['type'] = "file"; + $tem['size'] = transformFileSize($tem['size']); + $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); + $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); + $tem['short_name'] = shortenFileName($tem['name']); + $tem['flag'] = 'noFlag'; + $obj->close(); + foreach($tem as $k=>$v) + { + $info .= sprintf(", %s:'%s'", $k, $v); + } + + $info .= sprintf(", url:'%s'", getFileUrl($path)); + $info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME); + + + }else + { + $error = ERR_FILE_NOT_AVAILABLE; + } + + + } + echo "error:'" . $error . "'"; + echo $info; + echo "}"; + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php new file mode 100755 index 000000000..05f46af93 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php @@ -0,0 +1,139 @@ +addSearchKeyword('recursive', @$_GET['search_recursively']); + $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']); + $search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']); + $search->addSearchKeyword('size_from', @$_GET['search_size_from']); + $search->addSearchKeyword('size_to', @$_GET['search_size_to']); + $search->addSearchKeyword('recursive', @$_GET['search_recursively']); + $search->addSearchKeyword('name', @$_GET['search_name']); + $search->doSearch(); + $fileList = $search->getFoundFiles(); + $folderInfo = $search->getRootFolderInfo(); + + }else + { + include_once(CLASS_MANAGER); + include_once(CLASS_SESSION_ACTION); + $sessionAction = new SessionAction(); + include_once(DIR_AJAX_INC . "class.manager.php"); + + $manager = new manager(); + $manager->setSessionAction($sessionAction); + + $fileList = $manager->getFileList(); + $folderInfo = $manager->getFolderInfo(); + + } + $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER); + + }else + { + include_once(CLASS_PAGINATION); + $pagination = new pagination(false); + } + + + $pagination->setTotal(sizeof($fileList)); + $pagination->setFirstText(PAGINATION_FIRST); + $pagination->setPreviousText(PAGINATION_PREVIOUS); + $pagination->setNextText(PAGINATION_NEXT); + $pagination->setLastText(PAGINATION_LAST); + $pagination->setLimit(!empty($_GET['limit'])?(int)($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT); + echo $pagination->getPaginationHTML(); + echo "\n"; + if(!empty($_GET['view'])) + { + switch($_GET['view']) + { + case 'detail': + case 'thumbnail': + case 'text': + $view = $_GET['view']; + break; + default: + $view = CONFIG_DEFAULT_VIEW; + } + }else + { + $view = CONFIG_DEFAULT_VIEW; + } + switch($view) + { + case 'text': + //list file name only + include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php'); + break; + case 'thumbnail': + //list file with thumbnail + include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php'); + break; + case 'detail': + default: + include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php'); + } + + + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_get_folder_listing.php b/admin-dev/ajaxfilemanager/ajax_get_folder_listing.php new file mode 100755 index 000000000..565703ad9 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_get_folder_listing.php @@ -0,0 +1,15 @@ +$v) + { + + + echo (($count > 1)?', ':''). "'" . $v . "':'" . $k . "'"; + $count++; + } + echo "}"; +?> diff --git a/admin-dev/ajaxfilemanager/ajax_image_editor.php b/admin-dev/ajaxfilemanager/ajax_image_editor.php new file mode 100755 index 000000000..b959bbdc2 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_image_editor.php @@ -0,0 +1,210 @@ +gc(); + $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; + if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) + { + $path = $_GET['path']; + }else + { + die(IMG_GEN_IMG_NOT_EXISTS); + } + require_once(CLASS_HISTORY); + $history = new History($path, $session); + if(CONFIG_SYS_DEMO_ENABLE) + { + $sessionImageInfo = $history->getLastestRestorable(); + $originalSessionImageInfo = $history->getOriginalImage(); + if(sizeof($originalSessionImageInfo)) + { + $path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']); + } + } + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php"); + $image = new Image(); + + $imageInfo = $image->getImageInfo($path); + + ?> + + + + + + + + + + + + + + + + + + +Ajax Image Editor + + + +
+
+ Modes +
+ + +

+ + + + + + + + + + + + + + +

+
+
+
+ +
+

+ + + + + + + + + + + + +

+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + + diff --git a/admin-dev/ajaxfilemanager/ajax_image_save.php b/admin-dev/ajaxfilemanager/ajax_image_save.php new file mode 100755 index 000000000..9c4de2fac --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_image_save.php @@ -0,0 +1,196 @@ +getSessionDir()) == '') + { + $error = SESSION_PERSONAL_DIR_NOT_FOUND; + } + else + { + require_once(CLASS_HISTORY); + $history = new History($_POST['path'], $session); + if(!empty($_POST['mode'])) + { + //get the original image which is the lastest session image if any when the system is in demo + $lastestSessionImageInfo = $history->getLastestRestorable(); + if(sizeof($lastestSessionImageInfo) && CONFIG_SYS_DEMO_ENABLE) + { + $originalSessionImageInfo = $history->getOriginalImage(); + if(sizeof($originalSessionImageInfo)) + { + $originalImage = $sessionDir . $originalSessionImageInfo['info']['name']; + } + } + if(empty($originalImage)) + { + $originalImage = $_POST['path']; + } + + include_once(CLASS_IMAGE); + $image = new Image(); + if($image->loadImage($originalImage)) + { + + switch($_POST['mode']) + { + case "resize": + if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) + { + $error = IMG_SAVE_RESIZE_FAILED; + } + break; + case "crop": + if(!$image->crop($_POST['x'], $_POST['y'], $_POST['width'], $_POST['height'])) + { + $error = IMG_SAVE_CROP_FAILED; + } + break; + case "flip": + if(!$image->flip($_POST['flip_angle'])) + { + $error = IMG_SAVE_FLIP_FAILED; + } + break; + case "rotate": + + if(!$image->rotate((int)($_POST['angle']))) + { + $error = IMG_SAVE_ROTATE_FAILED; + } + + break; + default: + $error = IMG_SAVE_UNKNOWN_MODE; + } + + + if(empty($error)) + { + $sessionNewPath = $sessionDir . uniqid(md5(time())) . "." . getFileExt($_POST['path']); + if(!@copy($originalImage, $sessionNewPath)) + {//keep a copy under the session folder + $error = IMG_SAVE_BACKUP_FAILED; + }else + { + + $isSaveAsRequest = (!empty($_POST['new_name']) && !empty($_POST['save_to'])?true:false); + //save the modified image + $sessionImageInfo = array('name'=>basename($sessionNewPath), 'restorable'=>1); + $history->add($sessionImageInfo); + if(CONFIG_SYS_DEMO_ENABLE) + {//demo only + if(isset($originalSessionImageInfo) && sizeof($originalSessionImageInfo)) + { + $imagePath = $sessionDir . $originalSessionImageInfo['info']['name']; + }else + { + $imagePath = $sessionDir . uniqid(md5(time())) . "." . getFileExt($_POST['path']); + } + }else + { + if($isSaveAsRequest) + {//save as request + //check save to folder if exists + $imagePath = addTrailingSlash(backslashToSlash($_POST['save_to'])) . $_POST['new_name'] . "." . getFileExt($_POST['path']); + if(!file_exists($_POST['save_to']) || !is_dir($_POST['save_to'])) + { + $error = IMG_SAVE_AS_FOLDER_NOT_FOUND; + }elseif(file_exists($imagePath)) + { + $error = IMG_SAVE_AS_NEW_IMAGE_EXISTS; + }elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_name'])) + { + $error = IMG_SAVE_AS_ERR_NAME_INVALID; + } + + }else + {//save request + $imagePath = $originalImage; + } + + } + + if($image->saveImage($imagePath)) + { + + if(CONFIG_SYS_DEMO_ENABLE) + { + if(!isset($originalSessionImageInfo) || !sizeof($originalSessionImageInfo)) + {//keep this original image information on session for future reference if demo only + $originalSessionImageInfo = array('name'=>basename($imagePath), 'restorable'=>0, 'is_original'=>1); + $history->add($originalSessionImageInfo); + } + } + $imageInfo = $image->getFinalImageInfo(); + }else + { + $error = IMG_SAVE_FAILED; + + } + if(isset($imageInfo)) + { + $info .= ",width:" . $imageInfo['width'] . ""; + $info .= ",height:" . $imageInfo['height'] . ""; + $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'"; + if($isSaveAsRequest) + { + $info .= ",save_as:'1'"; + }else + { + $info .= ",save_as:'0'"; + } + $info .= ",folder_path:'" . dirname($imagePath) . "'"; + $info .= ",path:'" . backslashToSlash($imagePath) . "'"; + + } + + } + + } + }else + { + $error = IMG_SAVE_IMG_OPEN_FAILED; + } + + }else + { + $error = IMG_SAVE_UNKNOWN_MODE; + } + } + echo "{"; + echo "error:'" . $error . "'"; + if(isset($image) && is_object($image)) + { + $image->DestroyImages(); + } + echo $info; + echo ",history:" . (isset($history) && is_object($history)?($history->getNumRestorable()):0) . ""; + echo "}"; + + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_image_thumbnail.php b/admin-dev/ajaxfilemanager/ajax_image_thumbnail.php new file mode 100755 index 000000000..ac32a2314 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_image_thumbnail.php @@ -0,0 +1,35 @@ +loadImage($_GET['path'])) + { + if($image->resize(CONFIG_IMG_THUMBNAIL_MAX_X, CONFIG_IMG_THUMBNAIL_MAX_Y, true, true)) + { + $image->showImage(); + }else + { + echo PREVIEW_NOT_PREVIEW . "."; + } + }else + { + echo PREVIEW_NOT_PREVIEW . ".."; + } + + + }else + { + echo PREVIEW_NOT_PREVIEW . "..."; + } + diff --git a/admin-dev/ajaxfilemanager/ajax_image_undo.php b/admin-dev/ajaxfilemanager/ajax_image_undo.php new file mode 100755 index 000000000..ae813a5f8 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_image_undo.php @@ -0,0 +1,96 @@ +getLastestRestorable(); + echo "{"; + $error = ""; + $info = ""; + if(CONFIG_SYS_VIEW_ONLY) + { + $error = SYS_DISABLED; + } + elseif(empty($_POST['file_path'])) + { + $error = IMG_SAVE_EMPTY_PATH; + }elseif(!file_exists($_POST['file_path'])) + { + $error = IMG_SAVE_NOT_EXISTS; + }elseif(!isUnderRoot($_POST['file_path'])) + { + $error = IMG_SAVE_PATH_DISALLOWED; + }else if(!sizeof($lastestSessionImageInfo)) + { + $error = IMG_UNDO_NO_HISTORY_AVAIALBE; + } + else + { + //get the original image which is the lastest session image if any when the system is in demo + $sessionImage = $session->getSessionDir() . $lastestSessionImageInfo['name']; + $originalSessionImageInfo = $history->getOriginalImage(); + if(CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo)) + { + $originalImage = $session->getSessionDir() . $originalSessionImageInfo['info']['name']; + }else + { + $originalImage = $_POST['file_path']; + } + + include_once(CLASS_IMAGE); + $image = new Image(); + if($image->loadImage($sessionImage)) + { + $imageInfo = $image->getOriginalImageInfo(); + if(!@copy($sessionImage, $originalImage)) + { + $error = IMG_UNDO_COPY_FAILED; + }else + { + + //remove the session image + if(@unlink($sessionImage)) + { + $history->restore(); + } + //only one left, remove the session original if demo + + if($history->getNumRestorable() == 0 && CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo)) + { + @unlink($session->getSessionDir() . $originalSessionImageInfo['info']['name']); + $originalImage = $_POST['file_path']; + } + } + $imagePath = $originalImage; + + }else + { + $error = IMG_SAVE_IMG_OPEN_FAILED; + } + if(isset($imageInfo)) + { + $info .= ",width:" . $imageInfo['width'] . "\n"; + $info .= ",height:" . $imageInfo['height'] . "\n"; + $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; + $info .= ",path:'" . backslashToSlash($imagePath) . "'\n"; + } + + } + + echo "error:'" . $error . "'\n"; + if(isset($image) && is_object($image)) + { + $image->DestroyImages(); + } + echo $info; + echo ",history:" . ($history->getNumRestorable()) . "\n"; + echo "}"; +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_login.php b/admin-dev/ajaxfilemanager/ajax_login.php new file mode 100755 index 000000000..74a09ee84 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_login.php @@ -0,0 +1,67 @@ +login()) + { + header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString())); + exit; + } + } +}else{ + $_SESSION['ajax_user'] = true; + header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString())); + exit; +} +?> + + + + + +<?php echo LOGIN_PAGE_TITLE; ?> + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
 
+
+
+
+ + diff --git a/admin-dev/ajaxfilemanager/ajax_preview.php b/admin-dev/ajaxfilemanager/ajax_preview.php new file mode 100755 index 000000000..e233a214f --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_preview.php @@ -0,0 +1,60 @@ +getFileType(basename($_GET['path'])); + if($fileTypes['preview']) + { + switch($fileTypes['fileType']) + { + case "image": + $imageInfo = @getimagesize($_GET['path']); + if(!empty($imageInfo[0]) && !empty($imageInfo[1])) + { + $thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135); + printf("", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']); + + }else + { + echo PREVIEW_IMAGE_LOAD_FAILED; + } + + break; + case "txt": + if(($fp = @fopen($_GET['path'], 'r'))) + { + echo @fread($fp, @filesize($_GET['path'])); + @fclose($fp); + }else + { + echo PREVIEW_OPEN_FAILED . "."; + } + break; + + case "video": + break; + } + }else + { + echo PREVIEW_NOT_PREVIEW . ".."; + } + + }else + { + echo PREVIEW_NOT_PREVIEW . "..."; + } + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_save_as_form.php b/admin-dev/ajaxfilemanager/ajax_save_as_form.php new file mode 100755 index 000000000..8ad17406b --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_save_as_form.php @@ -0,0 +1,59 @@ + + + + + +Untitled Document + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
  + + * + +
 
+ + diff --git a/admin-dev/ajaxfilemanager/ajax_save_name.php b/admin-dev/ajaxfilemanager/ajax_save_name.php new file mode 100755 index 000000000..c0435bad9 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_save_name.php @@ -0,0 +1,81 @@ +get(); + if(removeTrailingSlash($sessionAction->getFolder()) == getParentPath($_POST['original_path']) && sizeof($selectedDocuments)) + { + if(($key = array_search(basename($_POST['original_path']), $selectedDocuments)) !== false) + { + $selectedDocuments[$key] = $_POST['name']; + $sessionAction->set($selectedDocuments); + + } + + }elseif(removeTrailingSlash($sessionAction->getFolder()) == removeTrailingSlash($_POST['original_path'])) + { + $sessionAction->setFolder($_POST['original_path']); + } + $path = addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name']; + if(is_file($path)) + { + include_once(CLASS_FILE); + $file = new file($path); + $fileInfo = $file->getFileInfo(); + }else + { + include_once(CLASS_MANAGER); + $manager = new manager($path, false); + $fileInfo = $manager->getFolderInfo(); + } + } + + echo "{"; + echo "error:'" . $error . "' "; + foreach ($fileInfo as $k=>$v) + { + echo "," . $k . ":'" . $v . "' "; + } + echo "}"; + + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_save_text.php b/admin-dev/ajaxfilemanager/ajax_save_text.php new file mode 100755 index 000000000..1d7724c4e --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_save_text.php @@ -0,0 +1,90 @@ + \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_text_editor.php b/admin-dev/ajaxfilemanager/ajax_text_editor.php new file mode 100755 index 000000000..4624acdee --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajax_text_editor.php @@ -0,0 +1,168 @@ +gc(); + $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; + if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) + { + $path = $_GET['path']; + }else + { + die(TXT_FILE_NOT_FOUND); + } + if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) + { + $syntax = getFileExt($path); + }else + { + switch (getFileExt($path)) + { + case 'htm': + $syntax = 'html'; + break; + default: + $syntax = 'basic'; + } + } + if(array_search(getFileExt($path), getValidTextEditorExts())=== false) + { + die(TXT_DISALLOWED_EXT); + } + ?> + + + + + + + + + + + + + +Ajax Text Editor + + + +
+ +
+
+ + + + diff --git a/admin-dev/ajaxfilemanager/ajaxfilemanager.php b/admin-dev/ajaxfilemanager/ajaxfilemanager.php new file mode 100755 index 000000000..d36980452 --- /dev/null +++ b/admin-dev/ajaxfilemanager/ajaxfilemanager.php @@ -0,0 +1,689 @@ +gc(); + require_once(CLASS_SESSION_ACTION); + $sessionAction = new SessionAction(); + if(CONFIG_LOAD_DOC_LATTER) + { + $fileList = array(); + $folderInfo = array('path'=>getCurrentFolderPath()); + }else + { + require_once(CLASS_MANAGER); + + + $manager = new manager(); + $manager->setSessionAction($sessionAction); + $fileList = $manager->getFileList(); + $folderInfo = $manager->getFolderInfo(); + } + if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE) + { + $views = array( + 'detail'=>LBL_BTN_VIEW_DETAILS, + 'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL, + ); + }else + { + $views = array( + 'detail'=>LBL_BTN_VIEW_DETAILS, + ); + } + + if(!empty($_GET['view'])) + { + switch($_GET['view']) + { + case 'detail': + case 'thumbnail': + $view = $_GET['view']; + break; + default: + $view = CONFIG_DEFAULT_VIEW; + } + }else + { + $view = CONFIG_DEFAULT_VIEW; + } + +?> + + + + +Ajax File Manager + + + + + + + + + + + + +
+ + +
+ + +
+ + + +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + +
+
+ +   + +
+    + /> + /> +
+ + + + +

+ + + + + +

+
+ +
+ +
+
+ + +
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/debug.html b/admin-dev/ajaxfilemanager/debug.html new file mode 100755 index 000000000..e69de29bb diff --git a/admin-dev/ajaxfilemanager/inc/class.auth.php b/admin-dev/ajaxfilemanager/inc/class.auth.php new file mode 100755 index 000000000..1978c13fd --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.auth.php @@ -0,0 +1,48 @@ +__construct(); + } + /** + * check if the user has logged + * + * @return boolean + */ + function isLoggedIn() + { + return (!empty($_SESSION[$this->__loginIndexInSession])?true:false); + } + /** + * validate the username & password + * @return boolean + * + */ + function login() + { + if($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD) + { + $_SESSION[$this->__loginIndexInSession] = true; + return true; + }else + { + return false; + } + } + } +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.file.php b/admin-dev/ajaxfilemanager/inc/class.file.php new file mode 100755 index 000000000..85512eb02 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.file.php @@ -0,0 +1,436 @@ +filePath = $path; + if(is_file($this->filePath)) + { + $this->fileStat = @stat($path); + $this->fileInfo['size'] = $this->fileStat[7]; + $this->fileInfo['atime'] = $this->fileStat[8]; + $this->fileInfo['ctime'] = $this->fileStat[10]; + $this->fileInfo['mtime'] = $this->fileStat[9]; + $this->fileInfo['path'] = $path; + $this->fileInfo['name'] = basename($path); + $this->fileInfo['is_writable'] = $this->isWritable(); + $this->fileInfo['is_readable'] = $this->isReadable(); + }elseif(is_dir($this->filePath)) + { + $this->fileStat = @stat($path); + $this->fileInfo['name'] = basename($path); + $this->fileInfo['path'] = $path; + $this->fileInfo['atime'] = $this->fileStat[8]; + $this->fileInfo['ctime'] = $this->fileStat[10]; + $this->fileInfo['mtime'] = $this->fileStat[9]; + $this->fileInfo['is_writable'] = $this->isWritable(); + $this->fileInfo['is_readable'] = $this->isReadable(); + } + }else + { + trigger_error('No such file exists. ' . $path, E_USER_NOTICE); + } + } + + + + } + /** + * contructor + * + * @param string $path + */ + function file($path=null) + { + $this->__construct($path); + } + + + /** + * check if a file or folder writable + * + * @param file path $path + * @return boolean + */ + function isWritable($path=null) + { + $path = (is_null($path)?$this->filePath:$path); + if (DIRECTORY_SEPARATOR == "\\") + { + $path = slashToBackslash($path); + if(is_file($path)) + { + $fp = @fopen($path,'ab'); + if($fp) + { + @fclose($fp); + return true; + } + }elseif(is_dir($path)) + { + $path = addTrailingSlash($path); + $tmp = uniqid(time()); + if (@touch($path . $tmp)) + { + @unlink($path . $tmp); + return true; + } + } + return false; + }else + { + return @is_writable(slashToBackslash($path)); + } + + } + /** + * Returns true if the files is readable. + * + * @return boolean true if the files is readable. + */ + function isReadable($path =null) + { + $path = is_null($path)?$this->filePath:$path; + return @is_readable(slashToBackslash($path)); + } + /** + * change the modified time + * + * @param string $path + * @param string $time + * @return boolean + */ + function setLastModified($path=null, $time) + { + $path = is_null($path)?$this->filePath:$path; + $time = is_null($time)?time():$time; + return @touch(slashToBackslash($path), $time); + } + + /** + * create a new folder + * + * @path the path for the new folder + * @mask + * @dirOwner + * @return boolean + */ + function mkdir($path = null, $mask=null, $dirOwner='') + { + $path = is_null($path)?$this->filePath:$path; + if(!file_exists($path)) + { + $mask = is_null($mask)?$this->mask:$mask; + $status = @mkdir(slashToBackslash($path)); + if ($mask) + { + @chmod(slashToBackslash($path), intval($mask, 8)); + } + if($dirOwner) + { + $this->chown(slashToBackslash($path), $dirOwner); + } + return $status; + } + return true; + + } + /** + * change the own of a file or folder + * + * @param the file path $path + * @param $owner + */ + function chown($path, $owner) + { + if(!empty($owner)) + { + $owners = explode(":", $owner); + if(!empty($owners[0])) + @chown($path, $owners[0]); + if(!empty($owners[1])) + @chgrp($path, $owner[1]); + } + } + + /** + * Copy a file, or recursively copy a folder and its contents + * @author Aidan Lister + * @author Paul Scott + * @version 1.0.1 + * @param string $source Source path + * @param string $dest Destination path + * @return bool Returns TRUE on success, FALSE on failure + */ + function copyTo($source, $dest) + { + $source = removeTrailingSlash(backslashToSlash($source)); + $dest = removeTrailingSlash(backslashToSlash($dest)); + if(!file_exists($dest) || !is_dir($dest)) + { + if(!$this->mkdir($dest)) + { + $this->_debug('Unable to create folder (' . $dest . ")"); + return false; + } + } + // Copy in to your self? + if (getAbsPath($source) == getAbsPath($dest)) + { + $this->_debug('Unable to copy itself. source: ' . getAbsPath($source) . "; dest: " . getAbsPath($dest)); + return false; + } + // Simple copy for a file + if (is_file($source)) + { + $dest = addTrailingSlash($dest) . (basename($source)); + if(file_exists($dest)) + { + return false; + }else { + + return copy($source, $dest); + } + + + }elseif(is_dir($source)) + { + // Loop through the folder + if(file_exists(addTrailingSlash($dest) . basename($source))) + { + return false; + }else + { + if(!file_exists(addTrailingSlash($dest) . basename($source)) || !is_dir(addTrailingSlash($dest) . basename($source))) + { + if(!$this->mkdir(addTrailingSlash($dest) . basename($source))) + { + $this->_debug('Unable to create folder (' . addTrailingSlash($dest) . basename($source) . ")"); + return false; + } + } + $handle = opendir($source); + while(false !== ($readdir = readdir($handle))) + { + if($readdir != '.' && $readdir != '..') + { + $path = addTrailingSlash($source).'/'.$readdir; + $this->copyTo($path, addTrailingSlash($dest) . basename($source)); + } + } + closedir($handle); + return true; + } + + } + return false; + } + /** + * get next available file name + * + * @param string $fileToMove the path of the file will be moved to + * @param string $destFolder the path of destination folder + * @return string + */ + function getNextAvailableFileName($fileToMove, $destFolder) + { + + $folderPath = addslashes(backslashToSlash(getParentPath($fileToMove))); + $destFolder = addslashes(backslashToSlash(getParentPath($destFolder))); + $finalPath = $destFolder . basename($fileToMove); + if(file_exists($fileToMove)) + { + if(is_file()) + { + $fileExt = getFileExt($fileToMove); + $fileBaseName = basename($fileToMove, '.' . $fileExt); + $count = 1; + while(file_exists($destFolder . $fileBaseName . $count . "." . $fileExt)) + { + $count++; + } + $filePath = $destFolder . $fileBaseName . $count . "." . $fileExt; + }elseif(is_dir()) + { + $folderName = basename($fileToMove); + $count = 1; + while(file_exists($destFolder . $folderName . $count)) + { + $count++; + } + $filePath = $destFolder . $fileBaseName . $count; + } + + } + return $finalPath; + } + /** + * get file information + * + * @return array + */ + function getFileInfo() + { + return $this->fileInfo; + } + /** + * close + * + */ + function close() + { + $this->fileInfo = null; + $this->fileStat = null; + } + /** + * delete a file or a folder and all contents within that folder + * + * @param string $path + * @return boolean + */ + function delete($path = null) + { + $path = is_null($path)?$this->filePath:$path; + if(file_exists($path)) + { + if(is_file($path)) + { + return @unlink($path); + }elseif(is_dir($path)) + { + return $this->__recursive_remove_directory($path); + } + + } + return false; + } + /** + * empty a folder + * + * @param string $path + * @return boolean + */ + function emptyFolder($path) + { + $path = is_null($path)?$this->filePath:""; + if(file_exists($path) && is_dir($path)) + { + return $this->__recursive_remove_directory($path, true); + } + return false; + } + + function _debug($info) + { + if($this->debug) + { + echo $info . "
\n"; + }else + { + $this->errors[] = $info; + } + } +/** + * recursive_remove_directory( directory to delete, empty ) + * expects path to directory and optional TRUE / FALSE to empty + * of course PHP has to have the rights to delete the directory + * you specify and all files and folders inside the directory + * + * to use this function to totally remove a directory, write: + * recursive_remove_directory('path/to/directory/to/delete'); + * to use this function to empty a directory, write: + * recursive_remove_directory('path/to/full_directory',TRUE); + * @param string $directory + * @param boolean $empty + * @return boolean + */ + function __recursive_remove_directory($directory, $empty=FALSE) + { + // if the path has a slash at the end we remove it here + if(substr($directory,-1) == '/') + { + $directory = substr($directory,0,-1); + } + + // if the path is not valid or is not a directory ... + if(!file_exists($directory) || !is_dir($directory)) + { + // ... we return false and exit the function + return FALSE; + + // ... if the path is not readable + }elseif(!is_readable($directory)) + { + // ... we return false and exit the function + return FALSE; + + // ... else if the path is readable + }else{ + + // we open the directory + $handle = @opendir($directory); + + // and scan through the items inside + while (FALSE !== ($item = @readdir($handle))) + { + // if the filepointer is not the current directory + // or the parent directory + if($item != '.' && $item != '..') + { + // we build the new path to delete + $path = $directory.'/'.$item; + + // if the new path is a directory + if(is_dir($path)) { + // we call this function with the new path + $this->__recursive_remove_directory($path); + + // if the new path is a file + }else{ + // we remove the file + @unlink($path); + } + } + } + // close the directory + @closedir($handle); + + // if the option to empty is not set to true + if($empty == FALSE) + { + // try to delete the now empty directory + if(!@rmdir($directory)) + { + // return false if not possible + return FALSE; + } + } + // return success + return TRUE; + } + } + } + +?> diff --git a/admin-dev/ajaxfilemanager/inc/class.history.php b/admin-dev/ajaxfilemanager/inc/class.history.php new file mode 100755 index 000000000..f209c2195 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.history.php @@ -0,0 +1,155 @@ +path = $path; + $this->session = &$session; + if(!isset($_SESSION[$this->path])) + { + $_SESSION[$this->path] = array(); + } + + } + /** + * constructor + * + * @param string $path the path to the image + * @param object $session an instance of session class + */ + function History($path, &$session) + { + $this->__construct($path, $session); + } + + /** + * keep tracks of each changes made to an image + * + * @param string $key + * @param string $info array('name', 'restorable', 'is_original') + */ + function add($info) + { + $_SESSION[$this->path][] = $info; + } + /** + * get the lastest changes for restore + * + * @return array array('name', 'restorable', 'is_original') + */ + function getNumRestorable() + { + $output = 0; + if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path])) + { + foreach($_SESSION[$this->path] as $k=>$v) + { + if(!empty($v['restorable']) && empty($v['is_original'])) + { + if(file_exists($this->session->getSessionDir() . $v['name'])) + { + $output++; + }else + { + + } + + } + } + } + return $output; + } + + /** + * get the path of image which keep the lastest changes + * + * @return return empty array when failed + */ + function getLastestRestorable() + { + if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]) && sizeof($_SESSION[$this->path])) + { + $sessionImages = array_reverse($_SESSION[$this->path], true); + $lastestKey = ''; + foreach($sessionImages as $k=>$v) + { + if($v['restorable'] && empty($v['is_original']) && file_exists($this->session->getSessionDir() . $v['name'])) + { + return $sessionImages[$k]; + } + } + + } + return array(); + + } + /** + * get the original image which is kept in the session folder + * + * @return array + */ + function getOriginalImage() + { + $outputs = array(); + if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path])) + { + $sessionImages = array_reverse($_SESSION[$this->path], true); + foreach($sessionImages as $k=>$v) + { + if(!empty($v['is_original'])) + { + if(file_exists($this->session->getSessionDir() . $v['name'])) + { + return array('info'=>$_SESSION[$this->path][$k], 'key'=>$k); + } + + } + } + } + return $outputs; + + } + /** + * remove the lastest restorable state + * + * @return boolean + */ + function restore() + { + if(isset($_SESSION[$this->path]) && is_array($_SESSION[$this->path]) && sizeof($_SESSION[$this->path])) + { + $sessionImages = array_reverse($_SESSION[$this->path], true); + $lastestKey = ''; + foreach($sessionImages as $k=>$v) + { + if($v['restorable'] && empty($v['is_original'])) + { + unset($_SESSION[$k]); + return true; + } + } + } + return false; + } + + + + } +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.image.php b/admin-dev/ajaxfilemanager/inc/class.image.php new file mode 100755 index 000000000..dfbaf970c --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.image.php @@ -0,0 +1,789 @@ +'', + 'ext'=>'', + 'size'=>'', + 'width'=>'', + 'height'=>'', + 'type'=>'', + 'path'=>'', + ); + var $_imgInfoFinal = array( + 'name'=>'', + 'ext'=>'', + 'size'=>'', + 'width'=>'', + 'height'=>'', + 'type'=>'', + 'path'=>'', + ); + var $_imgQuality = 90; + /** + * constructor + * + * @param boolean $debug + * @return Image + */ + + function __construct($debug = false) + { + $this->enableDebug($debug); + $this->gdInfo = $this->getGDInfo(); + } + function Image($debug = false) + { + $this->__construct($debug); + } + /** + * enable to debug + * + * @param boolean $value + */ + function enableDebug($value) + { + $this->_debug = ($value?true:false); + } + /** + * check if debug enable + * @return boolean + */ + function _isDebugEnable() + { + return $this->_debug; + } + + /** + * append to errors array and shown the each error when the debug turned on + * + * @param string $string + * @return void + * @access private + * @copyright this function originally come from Andy's php + */ + function _debug($value) + { + $this->_errors[] = $value; + if ($this->_debug) + { + echo $value . "
\n"; + } + } + /** + * show erros + * + */ + function showErrors() + { + if(sizeof($this->_errors)) + { + foreach($this->_errors as $error) + { + echo $error . "
\n"; + } + } + } + /** + * Load an image from the file system. + * + * @param string $filename + * @return bool + * @access public + * @copyright this function originally come from Andy's php + */ + function loadImage($filename) + { + $ext = strtolower($this->_getExtension($filename)); + $func = 'imagecreatefrom' . ($ext == 'jpg' ? 'jpeg' : $ext); + if (!$this->_isSupported($filename, $ext, $func, false)) { + return false; + } + if($ext == "gif") + { + // the following part gets the transparency color for a gif file + // this code is from the PHP manual and is written by + // fred at webblake dot net and webmaster at webnetwizard dotco dotuk, thanks! + $fp = @fopen($filename, "rb"); + $result = @fread($fp, 13); + $colorFlag = ord(substr($result,10,1)) >> 7; + $background = ord(substr($result,11)); + if ($colorFlag) { + $tableSizeNeeded = ($background + 1) * 3; + $result = @fread($fp, $tableSizeNeeded); + $this->transparentColorRed = ord(substr($result, $background * 3, 1)); + $this->transparentColorGreen = ord(substr($result, $background * 3 + 1, 1)); + $this->transparentColorBlue = ord(substr($result, $background * 3 + 2, 1)); + } + fclose($fp); + // -- here ends the code related to transparency handling + } + $this->_imgOrig = @$func($filename); + if ($this->_imgOrig == null) { + $this->_debug("The image could not be created from the '$filename' file using the '$func' function."); + return false; + }else + { + $this->imageFile = $filename; + $this->_imgInfoOrig = array( + 'name'=>basename($filename), + 'ext'=>$ext, + 'size'=>filesize($filename), + 'path'=>$filename, + ); + $imgInfo = $this->_getImageInfo($filename); + if(sizeof($imgInfo)) + { + foreach($imgInfo as $k=>$v) + { + $this->_imgInfoOrig[$k] = $v; + $this->_imgInfoFinal[$k] = $v; + } + } + + } + return true; + } + + /** + * Load an image from a string (eg. from a database table) + * + * @param string $string + * @return bool + * @access public + * @copyright this function originally come from Andy's php + */ + function loadImageFromString($string) + { + $this->imageFile = $filename; + $this->_imgOrig = imagecreatefromstring($string); + if (!$this->_imgOrig) { + $this->_debug('The image (supplied as a string) could not be created.'); + return false; + } + return true; + } + + + /** + * Save the modified image + * + * @param string $filename + * @param int $quality + * @param string $forcetype + * @return bool + * @access public + * @copyright this function originally come from Andy's php + */ + function saveImage($filename, $quality = 90, $forcetype = '') + { + if ($this->_imgFinal == null) { + $this->_debug('No changes intend to be made.'); + return false; + } + + $ext = ($forcetype == '') ? $this->_getExtension($filename) : strtolower($forcetype); + $func = 'image' . ($ext == 'jpg' ? 'jpeg' : $ext); + if (!$this->_isSupported($filename, $ext, $func, true)) + { + return false; + } + $saved = false; + switch($ext) + { + case 'gif': + if ($this->gdInfo['Truecolor Support'] && imageistruecolor($this->_imgFinal)) + { + imagetruecolortopalette($this->_imgFinal, false, 255); + } + case 'png': + $saved = $func($this->_imgFinal, $filename); + break; + case 'jpg': + $saved = $func($this->_imgFinal, $filename, $quality); + break; + } + + if ($saved === false) + { + $this->_debug("The image could not be saved to the '$filename' file as the file type '$ext' using the '$func' function."); + return false; + }else + { + $this->_imgInfoFinal['size'] = @filesize($filename); + @chmod($filename, intval($this->chmod, 8)); + } + + return true; + } + /** + * Shows the masked image without any saving + * + * @param string $type + * @param int $quality + * @return bool + * @access public + * @copyright this function originally come from Andy's php + */ + function showImage($type = '', $quality = '') + { + if ($this->_imgFinal == null) { + $this->_debug('There is no cropped image to show.'); + return false; + } + $type = (!empty($type)?$type:$this->_imgInfoOrig['ext']); + $quality = (!empty($quality)?$quality:$this->_imgQuality); + + $type = strtolower($type); + $func = 'image' . ($type == 'jpg' ? 'jpeg' : $type); + $head = 'image/' . ($type == 'jpg' ? 'jpeg' : $type); + + if (!$this->_isSupported('[showing file]', $type, $func, false)) { + return false; + } + + header("Content-type: $head"); + switch($type) + { + case 'gif': + if ($this->gdInfo['Truecolor Support'] && imageistruecolor($this->_imgFinal)) + { + @imagetruecolortopalette($this->_imgFinal, false, 255); + } + case 'png': + $func($this->_imgFinal); + break; + case 'jpg': + $func($this->_imgFinal, '', $quality); + break; + } + return true; + } + + /** + * Used for cropping image + * + * @param int $dst_x + * @param int $dst_y + * @param int $dst_w + * @param int $dst_h + * @return bool + * @access public + * @copyright this function originally come from Andy's php + */ + function crop($dst_x, $dst_y, $dst_w, $dst_h) + { + if ($this->_imgOrig == null) { + $this->_debug('The original image has not been loaded.'); + return false; + } + if (($dst_w <= 0) || ($dst_h <= 0)) { + $this->_debug('The image could not be cropped because the size given is not valid.'); + return false; + } + if (($dst_w > imagesx($this->_imgOrig)) || ($dst_h > imagesy($this->_imgOrig))) { + $this->_debug('The image could not be cropped because the size given is larger than the original image.'); + return false; + } + $this->_createFinalImageHandler($dst_w, $dst_h); + if ($this->gdInfo['Truecolor Support']) + { + if(!@imagecopyresampled($this->_imgFinal, $this->_imgOrig, 0, 0, $dst_x, $dst_y, $dst_w, $dst_h, $dst_w, $dst_h)) + { + $this->_debug('Unable crop the image.'); + return false; + } + } else + { + if(!@imagecopyresized($this->_imgFinal, $this->_imgOrig, 0, 0, $dst_x, $dst_y, $dst_w, $dst_h, $dst_w, $dst_h)) + { + $this->_debug('Unable crop the image.'); + return false; + } + + } + $this->_imgInfoFinal['width'] = $dst_w; + $this->_imgInfoFinal['height'] = $dst_h; + return true; + } + + + /** + * Resize the Image in the X and/or Y direction + * If either is 0 it will be scaled proportionally + * + * @access public + * + * @param mixed $new_x + * @param mixed $new_y + * @param boolean $constraint keep to resize the image proportionally + * @param boolean $unchangeIfsmaller keep the orignial size if the orignial smaller than the new size + * + * + * @return mixed none or PEAR_error + */ + function resize( $new_x, $new_y, $constraint= false, $unchangeIfsmaller=false) + { + if(!$this->_imgOrig) + { + $this->_debug('No image fould.'); + return false; + } + + $new_x = (int)($new_x); + $new_y = (int)($new_y); + if($new_x <=0 || $new_y <= 0) + { + $this->_debug('either of new width or height can be zeor or less.'); + }else + { + + if($constraint) + { + if($new_x < 1 && $new_y < 1) + { + $new_x = $this->_imgInfoOrig['width']; + $new_y = $this->_imgInfoOrig['height']; + }elseif($new_x < 1) + { + $new_x = floor($new_y / $this->_imgInfoOrig['height'] * $this->_imgInfoOrig['width']); + + }elseif($new_y < 1) + { + $new_y = floor($new_x / $this->_imgInfoOrig['width'] * $this->_imgInfoOrig['height']); + }else + { + $scale = min($new_x/$this->_imgInfoOrig['width'], $new_y/$this->_imgInfoOrig['height']) ; + $new_x = floor($scale*$this->_imgInfoOrig['width']); + $new_y = floor($scale*$this->_imgInfoOrig['height']); + } + } + if($unchangeIfsmaller) + { + if($this->_imgInfoOrig['width'] < $new_x && $this->_imgInfoOrig['height'] < $new_y ) + { + $new_x = $this->_imgInfoOrig['width']; + $new_y = $this->_imgInfoOrig['height']; + } + } + + + + if(is_null($this->_imgOrig)) + { + $this->loadImage($filePath); + } + if(sizeof($this->_errors) == 0) + { + return $this->_resize($new_x, $new_y); + } + } + + return false; + + } // End resize + /** + * resize the image and return the thumbnail image details array("width"=>, "height"=>, "name") + * + * @param string $fileName + * @param int $new_x the thumbnail width + * @param int $new_y the thumbnail height + * @param string $mode can be save, view and both + * @return unknown + */ + function _resize( $new_x, $new_y) + { + $this->_createFinalImageHandler($new_x, $new_y); + // hacks fot transparency of png24 files + if ($this->_imgInfoOrig['type'] == 'png') + { + @imagealphablending($this->_imgFinal, false); + if(function_exists('ImageCopyResampled')) + { + @ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']); + } else { + @ImageCopyResized($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']); + } + @imagesavealpha($this->_imgFinal, true); + + }else + {//for the rest image + if(function_exists('ImageCopyResampled')) + { + @ImageCopyResampled($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']); + } else { + @ImageCopyResized($this->_imgFinal, $this->_imgOrig, 0, 0, 0, 0, $new_x, $new_y, $this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']); + } + } + + + $this->_imgInfoFinal['width'] = $new_x; + $this->_imgInfoFinal['height'] = $new_y; + $this->_imgInfoFinal['name'] = basename($this->_imgInfoOrig['name']); + $this->_imgInfoFinal['path'] = $this->_imgInfoOrig['path']; + if($this->_imgFinal) + { + return true; + }else + { + $this->_debug('Unable to resize the image on the fly.'); + return false; + + } + + } + /** + * Get the extension of a file name + * + * @param string $file + * @return string + * @copyright this function originally come from Andy's php + */ + function _getExtension($file) + { + $ext = ''; + if (strrpos($file, '.')) { + $ext = strtolower(substr($file, (strrpos($file, '.') ? strrpos($file, '.') + 1 : strlen($file)), strlen($file))); + } + return $ext; + } + + /** + * Validate whether image reading/writing routines are valid. + * + * @param string $filename + * @param string $extension + * @param string $function + * @param bool $write + * @return bool + * @access private + * @copyright this function originally come from Andy's php + */ + function _isSupported($filename, $extension, $function, $write = false) + { + + $giftype = ($write) ? ' Create Support' : ' Read Support'; + $support = strtoupper($extension) . ($extension == 'gif' ? $giftype : ' Support'); + + if (!isset($this->gdInfo[$support]) || $this->gdInfo[$support] == false) { + $request = ($write) ? 'saving' : 'reading'; + $this->_debug("Support for $request the file type '$extension' cannot be found."); + return false; + } + if (!function_exists($function)) { + $request = ($write) ? 'save' : 'read'; + $this->_debug("The '$function' function required to $request the '$filename' file cannot be found."); + return false; + } + + return true; + } + /** + * flip image horizotally or vertically + * + * @param string $direction + * @return boolean + */ + function flip($direction="horizontal") + { + $this->_createFinalImageHandler($this->_imgInfoOrig['width'], $this->_imgInfoOrig['height']); + if($direction != "vertical") + { + $dst_x = 0; + $dst_y = 0; + $src_x = $this->_imgInfoOrig['width'] -1; + $src_y = 0; + $dst_w = $this->_imgInfoOrig['width']; + $dst_h = $this->_imgInfoOrig['height']; + $src_w = 0 - $this->_imgInfoOrig['width']; + $src_h = $this->_imgInfoOrig['height']; + + }else + { + $dst_x = 0; + $dst_y = 0; + $src_x = 0; + $src_y = $this->_imgInfoOrig['height'] - 1; + $dst_w = $this->_imgInfoOrig['width']; + $dst_h = $this->_imgInfoOrig['height']; + $src_w = $this->_imgInfoOrig['width']; + $src_h = 0 - $this->_imgInfoOrig['height']; + } + if(function_exists('ImageCopyResampled')){ + ImageCopyResampled($this->_imgFinal, $this->_imgOrig, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } else { + ImageCopyResized($this->_imgFinal, $this->_imgOrig, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + $this->_imgInfoFinal['width'] = $dst_w; + $this->_imgInfoFinal['height'] = $dst_h; + $this->_imgInfoFinal['name'] = basename($this->imageFile); + $this->_imgInfoFinal['path'] = $this->imageFile; + if($this->_imgFinal) + { + return true; + }else + { + $this->_debug('Unable to resize the image on the fly.'); + return false; + + } + } + /** + * flip vertically + * + * @return boolean + */ + function flipVertical() + { + return $this->flip('vertical'); + } + /** + * flip horizontal + * + * @return string + */ + function flipHorizontal() + { + return $this->flip('horizontal'); + } + + + /** + * get the GD version information + * + * @param bool $versionOnly + * @return array + * @access private + * @copyright this function originally come from Andy's php + */ + function getGDInfo($versionOnly = false) + { + $outputs = array(); + if (function_exists('gd_info')) + { + $outputs = gd_info(); + } else + { + $gd = array( + 'GD Version' => '', + 'GIF Read Support' => false, + 'GIF Create Support' => false, + 'JPG Support' => false, + 'PNG Support' => false, + 'FreeType Support' => false, + 'FreeType Linkage' => '', + 'T1Lib Support' => false, + 'WBMP Support' => false, + 'XBM Support' => false + ); + ob_start(); + phpinfo(); + $buffer = ob_get_contents(); + ob_end_clean(); + foreach (explode("\n", $buffer) as $line) { + $line = array_map('trim', (explode('|', strip_tags(str_replace('', '|', $line))))); + if (isset($gd[$line[0]])) { + if (strtolower($line[1]) == 'enabled') { + $gd[$line[0]] = true; + } else { + $gd[$line[0]] = $line[1]; + } + } + } + $outputs = $gd; + } + + if (isset($outputs['JIS-mapped Japanese Font Support'])) { + unset($outputs['JIS-mapped Japanese Font Support']); + } + if (function_exists('imagecreatefromgd')) { + $outputs['GD Support'] = true; + } + if (function_exists('imagecreatefromgd2')) { + $outputs['GD2 Support'] = true; + } + if (preg_match('/^(bundled|2)/', $outputs['GD Version'])) { + $outputs['Truecolor Support'] = true; + } else { + $outputs['Truecolor Support'] = false; + } + if ($outputs['GD Version'] != '') { + $match = array(); + if (preg_match('/([0-9\.]+)/', $outputs['GD Version'], $match)) { + $foo = explode('.', $match[0]); + $outputs['Version'] = array('major' => isset($foo[0])?$foo[0]:'', 'minor' => isset($foo[1])?$foo[1]:'', 'patch' => isset($foo[2])?$foo:""); + } + } + + return ($versionOnly) ? $outputs['Version'] : $outputs; + } + + /** + * Destroy the resources used by the images. + * + * @param bool $original + * @return void + * @access public + * @copyright this function originally come from Andy's php + */ + function DestroyImages($original = true) + { + if(!is_null($this->_imgFinal)) + { + @imagedestroy($this->_imgFinal); + } + $this->_imgFinal = null; + if ($original && !is_null($this->_imgOrig)) { + @imagedestroy($this->_imgOrig); + $this->_imgOrig = null; + } + } + + function getImageInfo($imagePath) + { + return $this->_getImageInfo($imagePath); + } + /** + * get image information, e.g. width, height, type + * @access public + * @return array + */ + function _getImageInfo($imagePath) + { + $outputs = array(); + $imageInfo = @GetImageSize($imagePath); + if ($imageInfo && is_array($imageInfo)) + { + switch($imageInfo[2]){ + case 1: + $type = 'gif'; + break; + case 2: + $type = 'jpeg'; + break; + case 3: + $type = 'png'; + break; + case 4: + $type = 'swf'; + break; + case 5: + $type = 'psd'; + case 6: + $type = 'bmp'; + case 7: + case 8: + $type = 'tiff'; + default: + $type = ''; + } + $outputs['width'] = $imageInfo[0]; + $outputs['height'] = $imageInfo[1]; + $outputs['type'] = $type; + $outputs['ext'] = $this->_getExtension($imagePath); + } else { + $this->_debug('Unable locate the image or read images information.'); + } + return $outputs; + + } + function rotate($angle, $bgColor=0) + { + $angle = (int)($angle) -360; + while($angle <0) + { + $angle += 360; + } + + + if($this->_imgFinal = imagerotate($this->_imgOrig, $angle)) + { + return true; + }else + { + return false; + } + + + } + /** + * get the original image info + * + * @return array + */ + function getOriginalImageInfo() + { + return $this->_imgInfoOrig; + } + /** + * return the final image info + * + * @return array + */ + function getFinalImageInfo() + { + if($this->_imgInfoFinal['width'] == '') + { + if(is_null($this->_imgFinal)) + { + $this->_imgInfoFinal = $this->_imgInfoOrig; + }else + { + $this->_imgInfoFinal['width'] = @imagesx($this->_imgFinal); + $this->_imgInfoFinal['height'] = @imagesy($this->_imgFinal); + } + } + return $this->_imgInfoFinal; + } + + /** + * create final image handler + * + * @access private + * @param $dst_w width + * @param $dst_h height + * @return boolean + * @copyright original from noname at nivelzero dot ro + */ + function _createFinalImageHandler($dst_w, $dst_h) + { + if(function_exists('ImageCreateTrueColor')) + { + $this->_imgFinal = @ImageCreateTrueColor($dst_w,$dst_h); + } else { + $this->_imgFinal = @ImageCreate($dst_w,$dst_h); + } + if (!is_null($this->transparentColorRed) && !is_null($this->transparentColorGreen) && !is_null($this->transparentColorBlue)) { + + $transparent = @imagecolorallocate($targetImageIdentifier, $this->transparentColorRed, $this->transparentColorGreen, $this->transparentColorBlue); + @imagefilledrectangle($this->_imgFinal, 0, 0, $dst_w, $dst_h, $transparent); + @imagecolortransparent($this->_imgFinal, $transparent); + } + + } + } + +?> diff --git a/admin-dev/ajaxfilemanager/inc/class.manager.php b/admin-dev/ajaxfilemanager/inc/class.manager.php new file mode 100755 index 000000000..01e4d89a9 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.manager.php @@ -0,0 +1,373 @@ +'noFlag', 'cut'=>'cutFlag', 'copy'=>'copyFlag'); + var $forceFolderOnTop = false; //forced to have folder shown on the top of the list + var $currentFolderInfo = array( + 'name'=>'', + 'subdir'=>0, + 'file'=>0, + 'ctime'=>'', + 'mtime'=>'', + 'is_readable'=>'', + 'is_writable'=>'', + 'size'=>0, + 'path'=>'', + 'type'=>'folder', + 'flag'=>'noFlag', + 'friendly_path'=>'', + ); + + var $lastVisitedFolderPathIndex = 'ajax_last_visited_folder'; + var $folderPathIndex = "path"; + var $calculateSubdir = true; + var $fileTypes = array( + array(array("exe", "com"), "fileExe", SEARCH_TYPE_EXE, 0), + array(array("gif", "jpg", "png", "bmp", "tif"), "filePicture", SEARCH_TYPE_IMG, 1), + array(array("zip", "sit", "rar", "gz", "tar"), "fileZip", SEARCH_TYPE_ARCHIVE, 0), + array(array("htm", "html", "php", "jsp", "asp", 'js', 'css'), "fileCode", SEARCH_TYPE_HTML, 1), + array(array("mov", "ram", "rm", "asx", "dcr", "wmv"), "fileVideo", SEARCH_TYPE_VIDEO, 1), + array(array("mpg", "avi", "asf", "mpeg"), "fileVideo", SEARCH_TYPE_MOVIE, 1), + array(array("aif", "aiff", "wav", "mp3", "wma"), "fileMusic", SEARCH_TYPE_MUSIC, 1), + array(array("swf", 'flv'), "fileFlash", SEARCH_TYPE_FLASH, 1), + array(array("ppt"), "filePPT", SEARCH_TYPE_PPT, 0), + array(array("rtf"), "fileRTF", SEARCH_TYPE_DOC, 0), + array(array("doc"), "fileWord", SEARCH_TYPE_WORD, 0), + array(array("pdf"), "fileAcrobat", SEARCH_TYPE_PDF, 0), + array(array("xls", "csv"), "fileExcel", SEARCH_TYPE_EXCEL, 0), + array(array("txt"), "fileText", SEARCH_TYPE_TEXT, 1), + array(array("xml", "xsl", "dtd"), "fileXml", SEARCH_TYPE_XML, 1) + ); + + /** + * constructor + * @path the path to a folder + * @calculateSubdir force to get the subdirectories information + */ + function __construct($path = null, $calculateSubdir=true) + { + + $this->calculateSubdir = $calculateSubdir; + if(defined('CONFIG_SYS_FOLDER_SHOWN_ON_TOP')) + { + $this->forceFolderOnTop = CONFIG_SYS_FOLDER_SHOWN_ON_TOP; + } + if(!is_null($path)) + { + $this->currentFolderPath = $path; + + }elseif(isset($_GET[$this->folderPathIndex]) && file_exists($_GET[$this->folderPathIndex]) && !is_file($_GET[$this->folderPathIndex]) ) + { + $this->currentFolderPath = $_GET[$this->folderPathIndex]; + } + elseif(isset($_SESSION[$this->lastVisitedFolderPathIndex]) && file_exists($_SESSION[$this->lastVisitedFolderPathIndex]) && !is_file($_SESSION[$this->lastVisitedFolderPathIndex])) + { + $this->currentFolderPath = $_SESSION[$this->lastVisitedFolderPathIndex]; + }else + { + $this->currentFolderPath = CONFIG_SYS_DEFAULT_PATH; + } + + $this->currentFolderPath = (isUnderRoot($this->currentFolderPath)?backslashToSlash((addTrailingSlash($this->currentFolderPath))):CONFIG_SYS_DEFAULT_PATH); + + if($this->calculateSubdir) + {// keep track of this folder path in session + $_SESSION[$this->lastVisitedFolderPathIndex] = $this->currentFolderPath; + } + if(is_dir($this->currentFolderPath)) + { + $file = new file($this->currentFolderPath); + $folderInfo = $file->getFileInfo(); + if(sizeof($folderInfo)) + { + $this->currentFolderInfo['name']=basename($this->currentFolderPath); + $this->currentFolderInfo['subdir']=0; + $this->currentFolderInfo['file']=0; + $this->currentFolderInfo['ctime']=$folderInfo['ctime']; + $this->currentFolderInfo['mtime']=$folderInfo['mtime']; + $this->currentFolderInfo['is_readable']=$folderInfo['is_readable']; + $this->currentFolderInfo['is_writable']=$folderInfo['is_writable']; + $this->currentFolderInfo['path'] = $this->currentFolderPath; + $this->currentFolderInfo['friendly_path'] = transformFilePath($this->currentFolderPath); + $this->currentFolderInfo['type'] = "folder"; + $this->currentFolderInfo['cssClass']='folder'; + + //$this->currentFolderInfo['flag'] = $folderInfo['flag']; + } + } + if($calculateSubdir && !file_exists($this->currentFolderPath)) + { + die(ERR_FOLDER_NOT_FOUND . $this->currentFolderPath); + } + + + + } + + function setSessionAction(&$session) + { + $this->sessionAction = $session; + } + /** + * constructor + */ + function manager($path = null, $calculateSubdir=true) + { + $this->__construct($path, $calculateSubdir); + } + /** + * get current folder path + * @return string + */ + function getCurrentFolderPath() + { + return $this->currentFolderPath; + } + /** + * get the list of files and folders under this current fold + * @return array + */ + function getFileList() + { + $outputs = array(); + $files = array(); + $folders = array(); + $tem = array(); + $dirHandler = @opendir($this->currentFolderPath); + if($dirHandler) + { + while(false !== ($file = readdir($dirHandler))) + { + if($file != '.' && $file != '..') + { + $flag = $this->flags['no']; + + if($this->sessionAction->getFolder() == $this->currentFolderPath) + {//check if any flag associated with this folder or file + $folder = addTrailingSlash(backslashToSlash($this->currentFolderPath)); + if(in_array($folder . $file, $this->sessionAction->get())) + { + if($this->sessionAction->getAction() == "copy") + { + $flag = $this->flags['copy']; + }else + { + $flag = $this->flags['cut']; + } + } + } + $path=$this->currentFolderPath.$file; + if(is_dir($path) && isListingDocument($path) ) + { + $this->currentFolderInfo['subdir']++; + if(!$this->calculateSubdir) + { + }else + { + + $folder = $this->getFolderInfo($path); + $folder['flag'] = $flag; + $folders[$file] = $folder; + $outputs[$file] = $folders[$file]; + } + + + }elseif(is_file($path) && isListingDocument($path)) + { + + $obj = new file($path); + $tem = $obj->getFileInfo(); + if(sizeof($tem)) + { + $fileType = $this->getFileType($file); + foreach($fileType as $k=>$v) + { + $tem[$k] = $v; + } + $this->currentFolderInfo['size'] += $tem['size']; + $this->currentFolderInfo['file']++; + $tem['path'] = backslashToSlash($path); + $tem['type'] = "file"; + $tem['flag'] = $flag; + $files[$file] = $tem; + $outputs[$file] = $tem; + $tem = array(); + $obj->close(); + + } + + + } + + } + } + if($this->forceFolderOnTop) + { + uksort($folders, "strnatcasecmp"); + uksort($files, "strnatcasecmp"); + $outputs = array(); + foreach($folders as $v) + { + $outputs[] = $v; + } + foreach ($files as $v) + { + $outputs[] = $v; + } + }else + { + uksort($outputs, "strnatcasecmp"); + } + + @closedir($dirHandler); + }else + { + trigger_error('Unable to locate the folder ' . $this->currentFolderPath, E_NOTICE); + } + return $outputs; + } + + + /** + * get current or the specified dir information + * + * @param string $path + * @return array + */ + function getFolderInfo($path=null) + { + if(is_null($path)) + { + return $this->currentFolderInfo; + }else + { + $obj = new manager($path, false); + $obj->setSessionAction($this->sessionAction); + $obj->getFileList(); + return $obj->getFolderInfo(); + } + + } + + /** + * return the file type of a file. + * + * @param string file name + * @return array + */ + function getFileType($fileName, $checkIfDir = false) + { + + $ext = strtolower($this->_getExtension($fileName, $checkIfDir)); + + foreach ($this->fileTypes as $fileType) + { + if(in_array($ext, $fileType[0])) + { + return array("cssClass" => $fileType[1], "fileType" => $fileType[2], "preview" => $fileType[3], 'test'=>5); + } + } + if(!empty($fileName)) + {//this is folder + if(empty($ext)) + { + if(is_dir($fileName)) + { + + return array("cssClass" => ($checkIfDir && $this->isDirEmpty($fileName)?'folderEmpty':"folder") , "fileType" => "Folder", "preview" => 0, 'test'=>1); + }else + { + return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>2); + } + }else + { + return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>3, 'ext'=>$ext , 'filename'=>$fileName); + } + + }else + {//this is unknown file + return array("cssClass" => "fileUnknown", "fileType" => SEARCH_TYPE_UNKNOWN, "preview" => 0, 'test'=>4); + } + + + } + + /** + * return the predefined file types + * + * @return arrray + */ + function getFileTypes() + { + return $this->fileTypes; + } + /** + * print out the file types + * + */ + function printFileTypes() + { + foreach($fileTypes as $fileType) + { + if(isset($fileType[0]) && is_array($fileType[0])) + { + foreach($fileType[0] as $type) + { + echo $type. ","; + } + } + } + } + + /** + * Get the extension of a file name + * + * @param string $file + * @return string + * @copyright this function originally come from Andy's php + */ + function _getExtension($file, $checkIfDir = false) + { + if($checkIfDir && file_exists($file) && is_dir($file)) + { + return ''; + }else + { + return @substr(@strrchr($file, "."), 1); + } + + + } + + function isDirEmpty($path) + { + $dirHandler = @opendir($path); + if($dirHandler) + { + while(false !== ($file = readdir($dirHandler))) + { + if($file != '.' && $file != '..') + { + @closedir($dirHandler); + return false; + + } + } + + @closedir($dirHandler); + + } + return true; + } +} +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.pagination.php b/admin-dev/ajaxfilemanager/inc/class.pagination.php new file mode 100755 index 000000000..38752d3cd --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.pagination.php @@ -0,0 +1,584 @@ +friendlyUrl = $friendlyUrl; + $this->__resetCurrentPage(); + } + + /** + * set maximum number of items per page + * + * @param integer $value maximum number of items per page + */ + function setLimit($value) + { + $this->itemsPerPage = (int)($value); + } + /** + * get maximum number of items per page + * + * @return integer + */ + function getLimit() + { + return $this->itemsPerPage; + } + + /** + * set the total number of items + * + * @param integer $value the total number of items + */ + function setTotal($value) + { + $this->totalItems = (int)($value); + } + /** + * get the total number of items + * + * @return integer total number of items + */ + function getTotal() + { + return $this->totalItems; + } + /** + * get total pages will be used to display all records + * + */ + function getTotalPages() + { + + $output = floor(($this->totalItems / $this->itemsPerPage )); + if($this->totalItems % $this->itemsPerPage) + { + $output++; + } + return $output; + } + + /** + * Set the index of URL Query String + * + * @param string $value e.g. page + */ + function setPageIndex($value) + { + $this->pageIndex = $value; + $this->__resetCurrentPage(); + } + + + function getPageIndex() + { + return $this->pageIndex; + } + /** + * initiate or reset the current page number + * + */ + function __resetCurrentPage() + { + $this->currentPage = ((isset($_GET[$this->pageIndex]) && (int)($_GET[$this->pageIndex]) > 0)?(int)($_GET[$this->pageIndex]):1); + } + + /** + * set the base url used in the links, default is $PHP_SELF + * + * @param string $value the base url + */ + function setUrl($value="") + { + if(empty($value)) + { + if($this->friendlyUrl) + { + $this->url = "http://" . $_SERVER['HTTP_HOST'] . "/"; + }else + { + $this->url = $_SERVER['PHP_SELF']; + } + }else + { + $this->url = $value; + } + + } + + /** + * get the base url variable + * + * @return string the base url + */ + function getUrl() + { + + if(empty($this->url)) + { + $this->setUrl(); + + } + return $this->url; + } + + /** + * set base url for pagination links after exculed those keys + * identified on excluded query strings + */ + function __setBaseUrl() + { + + if(empty($this->url)) + { + $this->getUrl(); + } + + if($this->friendlyUrl) + { + $this->baseUrl = $this->getUrl(); + }else + { + + $appendingQueryStrings = array(); + $this->excludedQueryStrings[$this->pageIndex] =$this->pageIndex; + foreach($_GET as $k=>$v) + { + if((array_search($k, $this->excludedQueryStrings) === false )) + { + $appendingQueryStrings[$k] = $k . "=" . $v; + } + } + if(sizeof($appendingQueryStrings)) + { + $this->baseUrl = $this->__appendQueryString($this->url, implode("&", $appendingQueryStrings)); + }else + { + $this->baseUrl = $this->getUrl(); + } + + } + + + } + /** + * get base url for pagination links aftr excluded those key + * identified on excluded query strings + * + */ + function __getBaseUrl() + { + + if(empty($this->baseUrl)) + { + + $this->__setBaseUrl(); + } + return $this->baseUrl; + } + + + /** + * get the first item number + * + * @return interger the first item number displayed within current page + */ + function getFirstItem() + { + $output = 0; + $temStartItemNumber = (($this->currentPage - 1) * $this->itemsPerPage + 1); + if($this->totalItems && $temStartItemNumber <= $this->totalItems ) + { + + $output = $temStartItemNumber; + } + return $output; + } + /** + * get the last item number displayed within current page + * + * @return interger the last item number + */ + function getLastItem() + { + $output = 0; + $temEndItemNumber = (($this->currentPage) * $this->itemsPerPage); + if($this->totalItems) + { + if($temEndItemNumber <= $this->totalItems) + { + $output = $temEndItemNumber; + }else + { + $output = $this->totalItems; + } + + } + return $output; + } + /** + * set page groupings limit + * used for previous 1 2 3 4 5 next + * + * @param unknown_type $value + */ + function setGroupLimit($value) + { + $this->groupLimit = (int)($value); + } + /** + * get page grouping limit + * + * @return integer the page grouping limit + */ + function getGroupLimit() + { + return $this->groupLimit; + } + /** + * get the page offset number + * used for Query . e.g SELECT SQL_CALC_FOUND_ROWS * + * FROM mytable LIMIT getPageOffset(), getItemsPerPage() + * + * @return iner + */ + function getPageOffset() + { + return (($this->currentPage - 1) * $this->itemsPerPage); + } + /** + * get the last url if any + * @return string the last url + */ + function getLastUrl() + { + + $url = ""; + $totalPages = $this->getTotalPages(); + if($this->currentPage < $totalPages) + { + $url = $this->__getBaseUrl(); + + if($this->friendlyUrl) + { + $url .= $this->pageIndex . $totalPages . "/"; + }else + { + $url = $this->__appendQueryString($url, $this->pageIndex . "=" . $totalPages); + } + $url = sprintf('%s', + $url, + $this->lastText); + } + return $url; + } + + + + + /** + * get the first url if any + * @return string the first url + */ + + function getFirstUrl() + { + $url = ""; + if($this->currentPage > 1) + { + $url = $this->__getBaseUrl(); + if($this->friendlyUrl) + { + $url .= $this->pageIndex . "1/"; + }else + { + $url = $this->__appendQueryString($url, $this->pageIndex . "=1"); + } + $url = sprintf('%s', + $url, + $this->firstText); + + } + return $url; + } + + /** + * get the previous page url if anywhere + * + * @param array $excludedQueryStrings excluded the value from $_GET + * @return string the previous page url + */ + function getPreviousUrl() + { + $url = ""; + if($this->currentPage > 1 && $this->totalItems > 0 ) + { + $url = $this->__getBaseUrl(); + if($this->friendlyUrl) + { + $url .= $this->pageIndex . ($this->currentPage - 1) . "/"; + }else + { + $url = $this->__appendQueryString($url, $this->pageIndex . "=" . ($this->currentPage -1)); + } + $url = sprintf('%s', + $url, + $this->previousText); + + } + + return $url; + } + /** + * get the next page url if anywhere + * + * @param array $excludedQueryStrings excluded the value from $_GET + * @return string the next page url + */ + function getNextUrl() + { + $url = ""; + if($this->totalItems > ($this->currentPage * $this->itemsPerPage)) + { + $url = $this->__getBaseUrl(); + if($this->friendlyUrl) + { + $url .= $this->pageIndex . ($this->currentPage + 1) . "/"; + }else + { + $url = $this->__appendQueryString($url, $this->pageIndex . "=" . ($this->currentPage + 1)); + } + $url = sprintf('%s', + $url, + $this->nextText); + } + return $url; + + } + + /** + * get the group page links e.g. 1,2,3,4,5 + * return format + * 1 + * 2 + * 3 + */ + function getGroupUrls() + { + $output = ""; + if($this->totalItems > 0) + { + $displayedPages = 0; + $url = $this->__getBaseUrl(); + $totalPages = $this->getTotalPages(); + // find halfway point + $groupLimitHalf = floor($this->groupLimit / 2); + // determine what item/page we start with + $itemStart = $this->currentPage - $groupLimitHalf; + $itemStart = ($itemStart > 0 && $itemStart <= $totalPages)?$itemStart:1; + $itemEnd = $itemStart; + + while($itemEnd < ($itemStart + $this->groupLimit - 1) && $itemEnd < $totalPages) + { + $itemEnd++; + } + + + if($totalPages > ($itemEnd - $itemStart)) + { + for($i = $itemStart; $i > 1 && ($itemEnd - $itemStart + 1) < $this->groupLimit; $i--) + { + $itemStart--; + } + } + + for($item = $itemStart; $item <= $itemEnd; $item++) + { + if($item != $this->currentPage) + {//it is not the active link + if($this->friendlyUrl) + { + $temUrl = $url . $this->pageIndex . $item . "/"; + }else + { + $temUrl = $this->__appendQueryString($url, $this->pageIndex . "=" . $item); + } + $output .= sprintf(' %d ', $temUrl, $item); + }else + {//active link + $output .= sprintf(' %d ', $item); + } + } + } + return $output; + } + /** + * set the text of previous page link + * + * @param string $value + */ + function setPreviousText($value) + { + $this->previousText = $value; + } + /** + * set the text of first page link + * + * @param string $value + */ + function setFirstText($value) + { + $this->firstText = $value; + } + /** + * set the text of next page link + * + * @param string $value + */ + + function setNextText($value) + { + $this->nextText = $value; + } + /** + * set the text of last page link + * + * @param string $value + */ + function setLastText($value) + { + $this->lastText = $value; + } + + /** + * set the excluded query string from $_GET; + * + * @param array the lists of the query string keys + */ + + function setExcludedQueryString($values = array()) + { + $this->excludedQueryStrings = $values; + } + + function getExcludedQueryString() + { + return $this->excludedQueryStrings; + } + + + /** + * add extra query stiring to a url + * @param string $baseUrl + * @param string $extra the query string added to the base url + */ + function __appendQueryString($baseUrl, $extra) + { + $output = trim($baseUrl); + if(strpos($baseUrl, "?") !== false) + { + $output .= "&" . $extra; + }else + { + $output .= "?" . $extra; + } + return $output; + } + /** + * return the html + * + * @param integer $type + */ + function getPaginationHTML($type=1, $cssClass="pagination") + { + $output = ''; + $output .= "

\n"; + switch($type) + { + case "2": + $output .= "" . $this->getFirstItem() . " to " . $this->getLastItem() . " of " . $this->getTotal() . " results. "; + if($previousUrl = $this->getPreviousUrl()) + { + $output .= " " . $previousUrl; + } + + if($nextUrl = $this->getNextUrl()) + { + $output .= " " . $nextUrl; + } + break; + case 1: + //get full summary pagination + default: + $output .= "" . $this->getFirstItem() . "/" . $this->getLastItem() . " (" . $this->getTotal() . ") "; + if($firstUrl = $this->getFirstUrl()) + { + $output .= " " . $firstUrl; + } + if($previousUrl = $this->getPreviousUrl()) + { + $output .= " " . $previousUrl; + } + + if($groupUrls = $this->getGroupUrls()) + { + $output .= " " . $groupUrls; + } + if($nextUrl = $this->getNextUrl()) + { + $output .= " " . $nextUrl; + } + if($lastUrl = $this->getLastUrl()) + { + $output .= " " . $lastUrl; + } + $itemPerPage = ''; + $itemPerPage .= "\n"; + $output .= ""; + $output .= sprintf(PAGINATION_ITEMS_PER_PAGE, $itemPerPage); + $output .= ""; + $output .= " "; + } + + $output .= "

"; + return $output; + } + +} +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.search.php b/admin-dev/ajaxfilemanager/inc/class.search.php new file mode 100755 index 000000000..b26241a91 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.search.php @@ -0,0 +1,184 @@ +'', + 'mtime_to'=>'', + 'name'=>'', + 'size_from'=>'', + 'size_to'=>'', + 'recursive'=>'0', + + ); + var $sessionAction = null; + /** + * constructor + * + * @param string $rootFolder + */ + function __construct($rootFolder) + { + $this->rootFolder = $rootFolder; + $this->sessionAction = new SessionAction(); + $objRootFolder = new file($this->rootFolder); + $tem = $objRootFolder->getFileInfo(); + $obj = new manager($this->rootFolder, false); + $obj->setSessionAction($this->sessionAction); + $selectedDocuments = $this->sessionAction->get(); + $fileType = $obj->getFolderInfo($this->rootFolder); + + foreach($fileType as $k=>$v) + { + $tem[$k] = $v; + } + + $tem['path'] = backslashToSlash($this->rootFolder); + $tem['type'] = (is_dir($this->rootFolder)?'folder':'file'); + $tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder))); + //$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); + //$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); + $tem['url'] = getFileUrl($this->rootFolder); + $tem['friendly_path'] = transformFilePath($this->rootFolder); + $tem['file'] = 0; + $tem['subdir'] = 0; + $manager = null; + $this->rootFolderInfo = $tem; + $tem = null; + } + + + + /** + * constructor + * + * @param string $rootFolder + */ + function Search($rootFolder) + { + $this->__construct($rootFolder); + } + + /** + * change the search keyword individually + * + * @param string $key + * @param string $value + */ + function addSearchKeyword($key, $value) + { + $this->searchkeywords[$key] = $value; + } + /** + * change the search keywords + * + * @param array $keywords + */ + function addSearchKeywords($keywords) + { + foreach($this->searchkeywords as $k=>$v) + { + if(array_key_exists($k, $keywords) !== false) + { + $this->searchkeywords[$k] = $keywords[$k]; + } + } + } + /** + * get the file according to the search keywords + * + */ + function doSearch($baseFolderPath = null) + { + + $baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath))); + + $dirHandler = @opendir($baseFolderPath); + if($dirHandler) + { + while(false !== ($file = readdir($dirHandler))) + { + if($file != '.' && $file != '..') + { + $path = $baseFolderPath . $file; + if(is_file($path)) + { + $isValid = true; + + $fileTime = @filemtime($path); + $fileSize = @filesize($path); + if($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false) + { + $isValid = false; + } + if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from'])) + { + $isValid = false; + } + if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to'])) + { + $isValid = false; + } + if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from'])) + { + $isValid = false; + } + if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to'])) + { + $isValid = false; + } + if($isValid && isListingDocument($path)) + { + $finalPath = $path; + $objFile = new file($finalPath); + $tem = $objFile->getFileInfo(); + $obj = new manager($finalPath, false); + $obj->setSessionAction($this->sessionAction); + $selectedDocuments = $this->sessionAction->get(); + $fileType = $obj->getFileType($finalPath); + + foreach($fileType as $k=>$v) + { + $tem[$k] = $v; + } + + $tem['path'] = backslashToSlash($finalPath); + $tem['type'] = (is_dir($finalPath)?'folder':'file'); + $tem['size'] = transformFileSize($tem['size']); + $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); + $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); + $tem['url'] = getFileUrl($tem['path']); + $this->rootFolderInfo['file']++; + $manager = null; + $this->files[] = $tem; + $tem = null; + } + }elseif(is_dir($path) && $this->searchkeywords['recursive']) + { + $this->Search($baseFolderPath); + } + } + } + } + closedir($dirHandler); + } + + function getFoundFiles() + { + return $this->files; + } + + function getRootFolderInfo() + { + + return $this->rootFolderInfo; + } + } +?> diff --git a/admin-dev/ajaxfilemanager/inc/class.session.php b/admin-dev/ajaxfilemanager/inc/class.session.php new file mode 100755 index 000000000..8fcf53c28 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.session.php @@ -0,0 +1,228 @@ +mkdir(CONFIG_SYS_DIR_SESSION_PATH)) + { + die('Unable to create session folder.'); + } + } + if(!$dir->isReadable(CONFIG_SYS_DIR_SESSION_PATH)) + { + die('Permission denied: ' . CONFIG_SYS_DIR_SESSION_PATH . " is not readable."); + } + if(!$dir->isWritable(CONFIG_SYS_DIR_SESSION_PATH)) + { + die('Permission denied: ' . CONFIG_SYS_DIR_SESSION_PATH . " is not writable."); + } + $this->dir = backslashToSlash(addTrailingSlash(CONFIG_SYS_DIR_SESSION_PATH)); + $this->lifeTime = get_cfg_var("session.gc_maxlifetime"); + $this->gcCounterFile = $this->dir . $this->gcCounterFileName; + $this->gcLogFile = $this->dir . $this->gcLogFileName; + $this->sessionDir = backslashToSlash($this->dir.session_id().DIRECTORY_SEPARATOR); +*/ + $this->init(); + } + /** + * constructor + * + */ + function Session() + { + $this->__construct(); + } + /** + * session init + * @return boolean + */ + function init() + { + + + + } + + function gc() + { + //init the counter file + $fp = @fopen($this->gcCounterFile, 'a+'); + if($fp) + { + $count = (int)(fgets($fp, 999999)) + 1; + if($count > $this->gcCounter || rand(0, 23) == date('h')) + { + $this->_gc(); + $count = 0; + } + @ftruncate($fp, 0); + if(!@fputs($fp, $count)) + { + die(SESSION_COUNTER_FILE_WRITE_FAILED); + } + @fclose($fp); + }else + { + die(SESSION_COUNTER_FILE_CREATE_FAILED); + } + } + + + function _gc() + { + //remove expired file from session folder + $dirHandler = @opendir($this->dir); + $output = ''; + $output .= "gc start at " . date('d/M/Y H:i:s') . "\n"; + $fo = new file(); + if($dirHandler) + { + while(false !== ($file = readdir($dirHandler))) + { + if($file != '.' && $file != '..' && $file != $this->gcCounterFileName && $file != $this->gcLogFileName && $file != session_id() ) + { + $path=$this->dir.$file; + $output .= $path ; + //check if this is a expired session file + if(filemtime($path) + $this->lifeTime < time()) + { + if($fo->delete($path)) + { + $output .= ' Deleted at ' . date('d/M/Y H:i:s'); + }else + { + $output .= " Failed at " . date('d/M/Y H:i:s'); + } + } + $output .= "\n"; + + } + } + if($this->debug) + { + $this->_log($output); + } + + @closedir($dirHandler); + + } + if(CONFIG_SYS_DEMO_ENABLE) + { + //remove expired files from uploaded folder + $dirHandler = @opendir(CONFIG_SYS_ROOT_PATH); + $output = ''; + $output .= "gc start at " . date('d/M/Y H:i:s') . "\n"; + $fo = new file(); + if($dirHandler) + { + while(false !== ($file = readdir($dirHandler))) + { + if($file != '.' && $file != '..') + { + $path=CONFIG_SYS_ROOT_PATH.$file; + $output .= $path ; + //check if this is a expired session file + if(filemtime($path) + $this->lifeTime < time()) + { + if($fo->delete($path)) + { + $output .= ' Deleted at ' . date('d/M/Y H:i:s'); + }else + { + $output .= " Failed at " . date('d/M/Y H:i:s'); + } + } + $output .= "\n"; + + } + } + if($this->debug) + { + $this->_log($output); + } + + @closedir($dirHandler); + + } + } + + } + /** + * log action taken by the gc + * + * @param unknown_type $msg + */ + function _log($msg) + { + $msg = "\n" . $msg; + $fp = @fopen($this->gcLogFile, 'w+'); + if($fp) + { + @ftruncate($fp, 0); + !@fputs($fp, $msg); + @fclose($fp); + } + } + + /** + * get the current session directory + * + * @return string return empty if failed + */ + function getSessionDir() + { + if(!file_exists($this->sessionDir) && !is_dir($this->sessionDir)) + { + $dir = new file(); + if(!$dir->mkdir($this->sessionDir)) + { + return ''; + } + }else + { + if(!@is_dir($this->sessionDir)) + { + return ''; + } + } + return $this->sessionDir; + } + + + +} +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.sessionaction.php b/admin-dev/ajaxfilemanager/inc/class.sessionaction.php new file mode 100755 index 000000000..486d1df50 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.sessionaction.php @@ -0,0 +1,93 @@ +actionIndex])) + { + $_SESSION[$this->actionIndex] = ''; + } + if(!isset($_SESSION[$this->selectedDocIndex]) || !is_array($_SESSION[$this->selectedDocIndex])) + { + $_SESSION[$this->selectedDocIndex] = array(); + } + if(!isset($_SESSION[$this->fromFolderIndex])) + { + $_SESSION[$this->fromFolderIndex] = ''; + } + } + + function SessionAction() + { + $this->__construct(); + } + /** + * count the number of selected documents + * + */ + function count() + { + return (isset($_SESSION[$this->selectedDocIndex])?sizeof($_SESSION[$this->selectedDocIndex]):0); + } + /** + * assign the selected documents + * + * @param array $selectedDocuments + */ + function set($selectedDocuments) + { + $_SESSION[$this->selectedDocIndex] = $selectedDocuments; + + } + /** + * get the selected documents + * @return array + */ + function get() + { + return (isset($_SESSION[$this->selectedDocIndex])?$_SESSION[$this->selectedDocIndex]:array()); + } + + function setAction($action) + { + $_SESSION[$this->actionIndex] = $action; + } + /** + * get the action + * + * @return unknown + */ + function getAction() + { + return (isset($_SESSION[$this->actionIndex])?$_SESSION[$this->actionIndex]:''); + } + /** + * set the folder + * + * @param string $folder + */ + function setFolder($folder) + { + $_SESSION[$this->fromFolderIndex] = $folder; + } + /** + * get the folder + * + * @return string + */ + function getFolder() + { + return (isset($_SESSION[$this->fromFolderIndex])?$_SESSION[$this->fromFolderIndex]:''); + } + } +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/class.upload.php b/admin-dev/ajaxfilemanager/inc/class.upload.php new file mode 100755 index 000000000..58979c6ad --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/class.upload.php @@ -0,0 +1,589 @@ +'the file uploaded with success', + 1=>'The uploaded file exceeds the upload_max_filesize directive in php.ini', + 2=>'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', + 3=>'The uploaded file was only partially uploaded', + 4=>'No file was uploaded.', + 6=>'Missing a temporary folder', + 7=>'Failed to write file to disk', + 8=>'File upload stopped by extension', + 999=>'No error code avaiable', + ); + + + function Upload() + { + //doing nothing + } + + function isFileUploaded($indexInPost="file") + { + + $this->errCode = isset($_FILES[$indexInPost]['error'])?$_FILES[$indexInPost]['error']:999; + if((isset($_FILES[$indexInPost]['error']) && $_FILES[$indexInPost] == 0) || + (!empty($_FILES[$indexInPost]['tmp_name']) && $_FILES[$indexInPost]['tmp_name'] != 'none') + ) + { + $this->_value = $_FILES[$indexInPost]; + $this->fileSize = @filesize($this->_value['tmp_name']); + $this->originalFileName = $this->_value['name']; + $this->fileType = $this->_value['type']; + + return true; + }else + { + + array_push($this->errors, 'Unable to upload file'); + return false; + } + } + + function getErrorCodeMsg() + { + return (isset($this->errorCodes[$this->errCode])?$this->errorCodes[$this->errCode]:""); + } + /** + * check if the uploaded file extension is allowed against the validFile Extension + * or against the invalid extension list when the list of valid file extension is not set + * + * @param array $validFileExt + * @return boolean + */ + function isPermittedFileExt($validFileExt = array()) + { + $tem = array(); + + if(sizeof($validFileExt)) + { + foreach($validFileExt as $k=>$v) + { + $tem[$k] = strtolower(trim($v)); + } + } + $validFileExt = $tem; + + if(sizeof($validFileExt) && sizeof($this->invalidFileExt)) + { + foreach($validFileExt as $k=>$ext) + { + if(array_search(strtolower($ext), $this->invalidFileExt) !== false) + { + unset($validFileExt[$k]); + } + } + } + + + + + if(sizeof($validFileExt)) + { + if(array_search(strtolower($this->getFileExt()), $validFileExt) !== false) + { + return true; + } + }elseif(array_search(strtolower($this->getFileExt()), $this->invalidFileExt) === false) + { + return true; + } + + + $this->deleteUploadedFile(); + return false; + + } + /** + * check if the uploaded file size is too big + * + * @param integer $maxSize + */ + function isSizeTooBig($maxSize="") + { + if($this->fileSize > $maxSize) + { + $this->deleteUploadedFile(); + return true; + }else + { + return false; + } + } + /** + * set the invali file extensions + * + * @param array $invalidFileExt + */ + function setInvalidFileExt($invalidFileExt=array()) + { + $tem = array(); + if(sizeof($invalidFileExt)) + { + foreach($invalidFileExt as $k=>$v) + { + $tem[$k]= strtolower(trim($v)); + } + } + + $this->invalidFileExt = $tem; + } + /** + * get file type + * + * @return string + */ + function getFileType() + { + return $this->fileType; + } + /** + * get a file extension + * + * @param string $fileName the path to a file or just the file name + */ + function getFileExt() + { + //return strtolower(substr(strrchr($this->fileName, "."), 1)); + return substr(strrchr($this->originalFileName, "."), 1); + } + /** + * move the uploaded file to a specific location + * + * @param string $dest the path to the directory which the uploaded file will be moved to + * @param string $fileBaseName the base name which the uploaded file will be renamed to + * @param unknown_type $overwrite + * @return unknown + */ + function moveUploadedFile($dest, $fileBaseName = '', $overwrite=false) + { + + //ensure the directory path ending with / + if ($dest != '' && substr($dest, -1) != '/') { + $dest .= '/'; + } + $this->dirPath = $dest; + $fileName = basename($this->_value['name']); + + $dotIndex = strrpos($fileName, '.'); + $this->fileExtension = ''; + if(is_int($dotIndex)) + { + $this->fileExtension = substr($fileName, $dotIndex); + $this->fileBaseName = substr($fileName, 0, $dotIndex); + } + if(!empty($fileBaseName)) + { + $this->fileBaseName = $fileBaseName; + } + $fileName = $this->fileBaseName . $this->fileExtension; + $filePath = $dest . $fileName; + + if(!$overwrite && file_exists($filePath) && is_file($filePath)) + {//rename + + $counter = 0; + while(file_exists($dest.$fileName) && is_file($dest .$fileName)) + { + $counter++; + $fileName = $this->fileBaseName.'_'.$counter.$this->fileExtension; + } + $this->fileBaseName .= "_" . $counter; + + } + if (@move_uploaded_file($this->_value['tmp_name'], $dest . $fileName)) { + @chmod($dest . $fileName, $this->uploadFileMode); + $this->fileName = $fileName; + $this->filePath = $dest . $fileName; + return true; + } else { + return false; + } + } + + + /** + * check if the uploaded is permitted to upload + * + * @param mixed $invalidImageExts invalid image extension + * @param bool $delete force to delete the uploaded file + */ + function isImage($invalidImageExts = array(), $delete = true) + { + if(!is_array($invalidImageExts) && !empty($invalidImageExts)) + { + $invalidImageExts = explode(",", $invalidImageExts); + } + foreach ($invalidImageExts as $k=>$v) + { + $invalidImageExts[$k] = strtolower(trim($v)); + } + foreach ($this->validImageExts as $k=>$v) + { + $ValidImageExts[$k] = strtolower(trim($v)); + } + if(sizeof($invalidImageExts)) + { + foreach ($ValidImageExts as $k=>$v) + { + if(array_search(strtolower($v), $invalidImageExts) !== false) + { + unset($ValidImageExts[$k]); + } + } + } + if(array_search(strtolower($this->getFileExt()), $ValidImageExts)!==false) + { + $this->_get_image_details($this->filePath); + if(!empty($this->fileType)) + { + return true; + } + }else + { + if($delete) + { + $this->deleteUploadedFile(); + } + } + + array($this->errors, "This file is not a image type file."); + return false; + } + + /** + * Resize the Image in the X and/or Y direction + * If either is 0 it will be scaled proportionally + * + * @access public + * + * @param mixed $new_x + * @param mixed $new_y + * @param string $thumb_suffix + * + * @return mixed none or PEAR_error + */ + function resize($filePath, $thumb_suffix="", $new_x = 0, $new_y = 0) + { + + if(empty($filePath)) + { + $filePath = $this->dirPath . $this->fileBaseName . $thumb_suffix . $this->fileExtension; + } + // 0 means keep original size + if ($this->img_x > $this->img_y) + $new_y = (int)($new_y/$this->img_x*$this->img_y); + else if ($this->img_y > $this->img_x) + $new_x = (int)($new_x/$this->img_y*$this->img_x); + // Now do the library specific resizing. + return $this->_resize($filePath,$new_x, $new_y); + } // End resize + + /** + * resize the image and return the thumbnail image details array("width"=>, "height"=>, "name") + * + * @param string $fileName + * @param int $new_x the thumbnail width + * @param int $new_y the thumbnail height + * @return unknown + */ + function _resize($fileName, $new_x, $new_y) { + $functionName = 'ImageCreateFrom' . $this->fileType; + + + if(function_exists($functionName)) + { + $this->imgHandler = $functionName($this->filePath); + }else + { + array_push($this->errors, $functionName . " function is unavailable"); + return false; + } + + if(function_exists('ImageCreateTrueColor')){ + $new_img =ImageCreateTrueColor($new_x,$new_y); + } else { + $new_img =ImageCreate($new_x,$new_y); + } + if(function_exists('ImageCopyResampled')){ + ImageCopyResampled($new_img, $this->imgHandler, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y); + } else { + ImageCopyResized($new_img, $this->imgHandler, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y); + } + if($this->_imageSave($new_img, $fileName, 80)) + { + return array("width"=>$new_x, "height"=>$new_y, "name"=>basename($fileName)); + }else + { + + array_push($this->errors, "Unable to resize the image"); + return false; + } + + } + /** + * save the thumbnail file and destroy the opened image + * + * @param resource $newImageHandler + * @param string $fileName + * @param int $quality + * @return boolean + */ + function _imageSave($newImageHandler, $fileName, $quality = 90) + { + $functionName = 'image' . $this->fileType; + if($functionName($newImageHandler, $fileName, $quality)) + { + imagedestroy($newImageHandler); + return true; + }else + { + imagedestroy($newImageHandler); + array_push($this->errors, "Unable to save the thumbnail file."); + return false; + } + + } + /** + * + * @access public + * @return void + */ + function _get_image_details($image) + { + + //echo $image; + $data = @GetImageSize($image); + #1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order, + # 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC + if (is_array($data)){ + switch($data[2]){ + case 1: + $type = 'gif'; + break; + case 2: + $type = 'jpeg'; + break; + case 3: + $type = 'png'; + break; + case 4: + $type = 'swf'; + break; + case 5: + $type = 'psd'; + case 6: + $type = 'bmp'; + case 7: + case 8: + $type = 'tiff'; + default: + array_push($this->errors, "We do not recognize this image format"); + + } + $this->img_x = $data[0]; + $this->img_y = $data[1]; + $this->fileType = $type; + + return true; + } else { + array_push($this->errors, "Cannot fetch image or images details."); + return null; + } + } + /** + * caculate the thumbnail details from the original image file + * + * @param string $originalImageName + * @param int $originaleImageWidth + * @param int $originalImageHeight + * @param string $thumbnailSuffix + * @param int $thumbnailWidth + * @param int $thumbnailHeight + * @return array array("name"=>"image name", "width"=>"image width", "height"=>"image height") + */ + function getThumbInfo($originalImageName, $originaleImageWidth, $originalImageHeight, $thumbnailSuffix, $thumbnailWidth, $thumbnailHeight) + { + $outputs = array("name"=>"", "width"=>0, "height"=>0); + $thumbnailWidth = (int)($thumbnailWidth); + $thumbnailHeight = (int)($thumbnailHeight); + if(!empty($originalImageName) && !empty($originaleImageWidth) && !empty($originalImageHeight)) + { + $dotIndex = strrpos($originalImageName, '.'); + //begin to get the thumbnail image name + $fileExtension = ''; + $fileBaseName = ''; + if(is_int($dotIndex)) + { + $fileExtension = substr($originalImageName, $dotIndex); + $fileBaseName = substr($originalImageName, 0, $dotIndex); + } + $outputs['name'] = $fileBaseName . $thumbnailSuffix . $fileExtension; + //start to get the thumbnail width & height + if($thumbnailWidth < 1 && $thumbnailHeight < 1) + { + $thumbnailWidth =$originaleImageWidth; + $thumbnailHeight = $originalImageHeight; + }elseif($thumbnailWidth < 1) + { + $thumbnailWidth = floor($thumbnailHeight / $originalImageHeight * $originaleImageWidth); + + }elseif($thumbnailHeight < 1) + { + $thumbnailHeight = floor($thumbnailWidth / $originaleImageWidth * $originalImageHeight); + }else + { + $scale = min($thumbnailWidth/$originaleImageWidth, $thumbnailHeight/$originalImageHeight); + $thumbnailWidth = floor($scale*$originaleImageWidth); + $thumbnailHeight = floor($scale*$originalImageHeight); + } + $outputs['width'] = $thumbnailWidth; + $outputs['height'] = $thumbnailHeight; + } + return $outputs; + + } + + + /** + * get the uploaded file + */ + function deleteUploadedFile() + { + @unlink($this->filePath); + } + /** + * destroy the tmp file + * + */ + function finish() + { + @unlink($this->_value['tmp_name']); + } + + function displayError() + { + if(sizeof($this->errors)) + { + echo "
";
+			print_r($this->errors);
+			echo "
"; + } + } + /** + * get the path which the file uploaded to + * + */ + function getFilePath() + { + return $this->filePath; + } + /** + * return the directory path witch the file uploaded to + * + * @return unknown + */ + function getDirPath() + { + return $this->dirPath; + } + + function getFileBaseName() + { + return $this->fileBaseName; + } + + function getFileName() + { + return $this->fileName; + } + /** + * get image width + * + * @return integer + */ + function getImageWidth() + { + return $this->img_x; + } + /** + * get image height + * + * @return integer + */ + function getImageHeight() + { + return $this->img_y; + } + /** + * get uploaded file size + * + * @return string + */ + function getFileSize() + { + return $this->fileSize; + } + /** + * delete the uploaded image file & associated thumnails + * + * @param string $dirPath + * @param string $originalImageName + * @param string $arrayThumbnailSuffix + */ + function deleteFileAndThumbs($dirPath, $originalImageName, $arrayThumbnailSuffix) + { + //ensure the directory path ending with / + if ($dirPath != '' && substr($dirPath, -1) != '/') { + $dirPath .= '/'; + } + if(!empty($originalImageName) && file_exists($dirPath . $originalImageName) && is_file($dirPath . $originalImageName)) + { + @unlink($dirPath . $originalImageName); + foreach($arrayThumbnailSuffix as $v) + { + $dotIndex = strrpos($originalImageName, '.'); + //begin to get the thumbnail image name + $fileExtension = ''; + $fileBaseName = ''; + if(is_int($dotIndex)) + { + $fileExtension = substr($originalImageName, $dotIndex); + $fileBaseName = substr($originalImageName, 0, $dotIndex); + } + @unlink($dirPath . $fileBaseName . $v . $fileExtension); + } + } + + + } +} +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/config.base.php b/admin-dev/ajaxfilemanager/inc/config.base.php new file mode 100755 index 000000000..28155f21e --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/config.base.php @@ -0,0 +1,135 @@ + false + * by session => true + */ + define('CONFIG_ACCESS_CONTROL_MODE', false); + define("CONFIG_LOGIN_USERNAME", 'sdfgdfgdfgdgfdgsdfsdfg3454dsfb5e'); + define('CONFIG_LOGIN_PASSWORD', 'ASDF@#%JHGSDFGasdkjfh3812764ksdjfbhkjxcf'); + define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page + + + //SYSTEM MODE CONFIG + /** + * turn it on when you have this system for demo purpose + * that means changes made to each image is not physically applied to it + * and all uploaded files/created folders will be removed automatically + */ + define('CONFIG_SYS_DEMO_ENABLE', false); + define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false + + //User Permissions + define('CONFIG_OPTIONS_DELETE', true); + define('CONFIG_OPTIONS_CUT', true); + define('CONFIG_OPTIONS_COPY', true); + define('CONFIG_OPTIONS_NEWFOLDER', true); + define('CONFIG_OPTIONS_RENAME', true); + define('CONFIG_OPTIONS_UPLOAD', true); // + define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor + //FILESYSTEM CONFIG + /* + * CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to + and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder + these two paths accept relative path only, don't use absolute path + */ + //check if folder exist + if (!is_dir('../../img/cms')) + mkdir('../../img/cms'); + + define('CONFIG_SYS_DEFAULT_PATH', '../../img/cms'); //accept relative path only + define('CONFIG_SYS_ROOT_PATH', '../../img/cms'); //accept relative path only + define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name + define("CONFIG_SYS_DIR_SESSION_PATH", 'session/'); + define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns + /** + * reg => regulare expression + * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) + * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) + * + */ + //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php + define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple + define('CONFIG_SYS_EXC_DIR_PATTERN', 'CVS'); //will prevent listing of folders with such pattern(s). separated by , if multiple + define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple + define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple + define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 + + //UPLOAD OPTIONS CONFIG + define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes + //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes + //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// + + define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid + + define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png');// // + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png'); + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // + define('CONFIG_UPLOAD_INVALID_EXTS', ''); + + //Preview + define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); + define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); + define('CONFIG_THICKBOX_MAX_WIDTH', 700); + define('CONFIG_THICKBOX_MAX_HEIGHT', 430); + + + /** + * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 + * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT + * Howerver, some Web Hosts do not have standard php.ini setting + * which you will find the file manager can not locate your files correctly + * if you do have such issue, please change it to fit your system. + * so what should you to do get it + * 1. create a php script file (let's call it document_root.php) + * 2. add the following codes in in + * + * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer + * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that + * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be + * 6. enjoy it + + + * + */ + + + define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); + //theme related setting + /* + * options avaialbe for CONFIG_EDITOR_NAME are: + stand_alone + tinymce + fckeditor + */ + //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce')); + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail + define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); + define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client + + //General Option Declarations + //LANGAUGAE DECLARATIONNS + define('CONFIG_LANG_INDEX', 'language'); //the index in the session + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/config.php b/admin-dev/ajaxfilemanager/inc/config.php new file mode 100755 index 000000000..2f30ed245 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/config.php @@ -0,0 +1,107 @@ + + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php"); + define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration + if(!isset($_SESSION)) + { + session_start(); + } + if(!headers_sent()) + { + header('Content-Type: text/html; charset=utf-8'); + } + + /** + * secure file name which retrieve from query string + * + * @param string $input + * @return string + */ + function secureFileName($input) + { + return preg_replace('/[^a-zA-Z0-9\-_]/', '', $input); + } + //Directories Declarations + + define('DIR_AJAX_ROOT', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR) ; // the path to ajax file manager + define('DIR_AJAX_INC', DIR_AJAX_ROOT . "inc" . DIRECTORY_SEPARATOR); + define('DIR_AJAX_CLASSES', DIR_AJAX_ROOT . "classes" . DIRECTORY_SEPARATOR); + define("DIR_AJAX_LANGS", DIR_AJAX_ROOT . "langs" . DIRECTORY_SEPARATOR); + define('DIR_AJAX_JS', DIR_AJAX_ROOT . 'jscripts' . DIRECTORY_SEPARATOR); + define('DIR_AJAX_EDIT_AREA', DIR_AJAX_JS . 'edit_area' . DIRECTORY_SEPARATOR); + define('DIR_LANG', DIR_AJAX_ROOT . 'langs' . DIRECTORY_SEPARATOR); + + + //Class Declarations + define('CLASS_FILE', DIR_AJAX_INC .'class.file.php'); + define("CLASS_UPLOAD", DIR_AJAX_INC . 'class.upload.php'); + define('CLASS_MANAGER', DIR_AJAX_INC . 'class.manager.php'); + define('CLASS_IMAGE', DIR_AJAX_INC . "class.image.php"); + define('CLASS_HISTORY', DIR_AJAX_INC . "class.history.php"); + define('CLASS_SESSION_ACTION', DIR_AJAX_INC . "class.sessionaction.php"); + define('CLASS_PAGINATION', DIR_AJAX_INC . 'class.pagination.php'); + define('CLASS_SEARCH', DIR_AJAX_INC . "class.search.php"); + //SCRIPT FILES declarations + define('SPT_FUNCTION_BASE', DIR_AJAX_INC . 'function.base.php'); + //include different config base file according to query string "config" + $configBaseFileName = 'config.base.php'; + + if(CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") + { + $configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php"; + } + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName); + + + require_once(DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php"); + require_once(DIR_AJAX_INC . "function.base.php"); + + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php"); + $session = new Session(); + $auth = new Auth(); + + if(CONFIG_ACCESS_CONTROL_MODE == 1) + {//access control enabled + if(!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) + {// + header('Location: ' . appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString())); + exit; + } + } + addNoCacheHeaders(); + //URL Declartions + define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php'); + define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php'); + define('CONFIG_URL_DELETE', 'ajax_delete_file.php'); + define('CONFIG_URL_HOME', 'ajaxfilemanager.php'); + define("CONFIG_URL_UPLOAD", 'ajax_file_upload.php'); + define('CONFIG_URL_PREVIEW', 'ajax_preview.php'); + define('CONFIG_URL_SAVE_NAME', 'ajax_save_name.php'); + define('CONFIG_URL_IMAGE_EDITOR', 'ajax_image_editor.php'); + define('CONFIG_URL_IMAGE_SAVE', 'ajax_image_save.php'); + define('CONFIG_URL_IMAGE_RESET', 'ajax_editor_reset.php'); + define('CONFIG_URL_IMAGE_UNDO', 'ajax_image_undo.php'); + define('CONFIG_URL_CUT', 'ajax_file_cut.php'); + define('CONFIG_URL_COPY', 'ajax_file_copy.php'); + define('CONFIG_URL_LOAD_FOLDERS', '_ajax_load_folders.php'); + + define('CONFIG_URL_DOWNLOAD', 'ajax_download.php'); + define('CONFIG_URL_TEXT_EDITOR', 'ajax_text_editor.php'); + define('CONFIG_URL_GET_FOLDER_LIST', 'ajax_get_folder_listing.php'); + define('CONFIG_URL_SAVE_TEXT', 'ajax_save_text.php'); + define('CONFIG_URL_LIST_LISTING', 'ajax_get_file_listing.php'); + define('CONFIG_URL_IMG_THUMBNAIL', 'ajax_image_thumbnail.php'); + define('CONFIG_URL_FILEnIMAGE_MANAGER', 'ajaxfilemanager.php'); + define('CONFIG_URL_FILE_PASTE', 'ajax_file_paste.php'); + + +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/config.tinymce.php b/admin-dev/ajaxfilemanager/inc/config.tinymce.php new file mode 100755 index 000000000..53b1e611c --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/config.tinymce.php @@ -0,0 +1,131 @@ + false + * by session => true + */ + define('CONFIG_ACCESS_CONTROL_MODE', false); + define("CONFIG_LOGIN_USERNAME", 'ajax'); + define('CONFIG_LOGIN_PASSWORD', '123456'); + define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page + + //SYSTEM MODE CONFIG + /** + * turn it on when you have this system for demo purpose + * that means changes made to each image is not physically applied to it + * and all uploaded files/created folders will be removed automatically + */ + define('CONFIG_SYS_DEMO_ENABLE', false); + define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false + + //User Permissions + define('CONFIG_OPTIONS_DELETE', true); + define('CONFIG_OPTIONS_CUT', true); + define('CONFIG_OPTIONS_COPY', true); + define('CONFIG_OPTIONS_NEWFOLDER', true); + define('CONFIG_OPTIONS_RENAME', true); + define('CONFIG_OPTIONS_UPLOAD', true); // + define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor + //FILESYSTEM CONFIG + /* + * CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to + and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder + these two paths accept relative path only, don't use absolute path + */ + + define('CONFIG_SYS_DEFAULT_PATH', '../uploaded/'); //accept relative path only + define('CONFIG_SYS_ROOT_PATH', '../uploaded/'); //accept relative path only + define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name + define("CONFIG_SYS_DIR_SESSION_PATH", 'session/'); + define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns + /** + * reg => regulare expression + * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) + * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) + * + */ + //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php + define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple + define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple + define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple + define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple + define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 + + //UPLOAD OPTIONS CONFIG + define('CONFIG_UPLOAD_MAXSIZE', 5000 * 1024 ); //by bytes + //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes + //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// + + define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid + + define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // + define('CONFIG_UPLOAD_INVALID_EXTS', ''); + + //Preview + define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); + define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); + define('CONFIG_THICKBOX_MAX_WIDTH', 700); + define('CONFIG_THICKBOX_MAX_HEIGHT', 430); + + + /** + * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 + * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT + * Howerver, some Web Hosts do not have standard php.ini setting + * which you will find the file manager can not locate your files correctly + * if you do have such issue, please change it to fit your system. + * so what should you to do get it + * 1. create a php script file (let's call it document_root.php) + * 2. add the following codes in in + * + * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer + * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that + * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be + * 6. enjoy it + + + * + */ + + + define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); + //theme related setting + /* + * options avaialbe for CONFIG_EDITOR_NAME are: + stand_alone + tinymce + fckeditor + */ + //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail + define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); + define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client + + //General Option Declarations + //LANGAUGAE DECLARATIONNS + define('CONFIG_LANG_INDEX', 'language'); //the index in the session + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/data.php b/admin-dev/ajaxfilemanager/inc/data.php new file mode 100755 index 000000000..e0d9ddd53 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/data.php @@ -0,0 +1,8 @@ +
Array
+(
+    [currentFolderPath] => ../uploaded/
+    [new_folder] => Test
+)
+
+ +22/Sep/2008 13:17:12 \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/inc/function.base.php b/admin-dev/ajaxfilemanager/inc/function.base.php new file mode 100755 index 000000000..777237f38 --- /dev/null +++ b/admin-dev/ajaxfilemanager/inc/function.base.php @@ -0,0 +1,1225 @@ +$v) + { + if(array_search($k, $excls) ===false) + { + $strAppend = "&"; + if($count == 1) + { + $strAppend = "?"; + $count++; + } + $output .= $strAppend . $k . "=" . $v; + } + } + return $output; + } + +/** + * print out an array + * + * @param array $array + */ +function displayArray($array, $comments="") +{ + echo "
";
+	echo $comments;
+	print_r($array);
+	echo $comments;
+	echo "
"; +} + + + + /** + * check if a file extension is permitted + * + * @param string $filePath + * @param array $validExts + * @param array $invalidExts + * @return boolean + */ + function isValidExt($filePath, $validExts, $invalidExts=array()) + { + $tem = array(); + + if(sizeof($validExts)) + { + foreach($validExts as $k=>$v) + { + $tem[$k] = strtolower(trim($v)); + } + } + $validExts = $tem; + $tem = array(); + if(sizeof($invalidExts)) + { + foreach($invalidExts as $k=>$v) + { + $tem[$k] = strtolower(trim($v)); + } + } + $invalidExts = $tem; + if(sizeof($validExts) && sizeof($invalidExts)) + { + foreach($validExts as $k=>$ext) + { + if(array_search($ext, $invalidExts) !== false) + { + unset($validExts[$k]); + } + } + } + if(sizeof($validExts)) + { + if(array_search(strtolower(getFileExt($filePath)), $validExts) !== false) + { + return true; + }else + { + return false; + } + }elseif(array_search(strtolower(getFileExt($filePath)), $invalidExts) === false) + { + return true; + }else + { + return false; + } + } + + + + + +/** + * transform file relative path to absolute path + * @param string $value the path to the file + * @return string + */ +function relToAbs($value) +{ + return backslashToSlash(preg_replace("/(\\\\)/","\\", getRealPath($value))); + +} + + function getRelativeFileUrl($value, $relativeTo) + { + $output = ''; + $wwwroot = removeTrailingSlash(backslashToSlash(getRootPath())); + $urlprefix = ""; + $urlsuffix = ""; + $value = backslashToSlash(getRealPath($value)); + $pos = strpos($value, $wwwroot); + if ($pos !== false && $pos == 0) + { + $output = $urlprefix . substr($value, strlen($wwwroot)) . $urlsuffix; + } + } +/** + * replace slash with backslash + * + * @param string $value the path to the file + * @return string + */ +function slashToBackslash($value) { + return str_replace("/", DIRECTORY_SEPARATOR, $value); +} + +/** + * replace backslash with slash + * + * @param string $value the path to the file + * @return string + */ +function backslashToSlash($value) { + return str_replace(DIRECTORY_SEPARATOR, "/", $value); +} + +/** + * removes the trailing slash + * + * @param string $value + * @return string + */ +function removeTrailingSlash($value) { + if(preg_match('@^.+/$@i', $value)) + { + $value = substr($value, 0, strlen($value)-1); + } + return $value; +} + +/** + * append a trailing slash + * + * @param string $value + * @return string + */ +function addTrailingSlash($value) +{ + if(preg_match('@^.*[^/]{1}$@i', $value)) + { + $value .= '/'; + } + return $value; +} + +/** + * transform a file path to user friendly + * + * @param string $value + * @return string + */ +function transformFilePath($value) { + $rootPath = addTrailingSlash(backslashToSlash(getRealPath(CONFIG_SYS_ROOT_PATH))); + $value = addTrailingSlash(backslashToSlash(getRealPath($value))); + if(!empty($rootPath) && ($i = strpos($value, $rootPath)) !== false) + { + $value = ($i == 0?substr($value, strlen($rootPath)):"/"); + } + $value = prependSlash($value); + return $value; +} +/** + * prepend slash + * + * @param string $value + * @return string + */ +function prependSlash($value) +{ + if (($value && $value[0] != '/') || !$value ) + { + $value = "/" . $value; + } + return $value; +} + + + function writeInfo($data, $die = false) + { + $fp = @fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'data.php', 'w+'); + @fwrite($fp, $data); + @fwrite($fp, "\n\n" . date('d/M/Y H:i:s') ); + @fclose($fp); + if($die) + { + die(); + } + + } + +/** + * no cachable header + */ +function addNoCacheHeaders() { + 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-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); +} + /** + * add extra query stiring to a url + * @param string $baseUrl + * @param string $extra the query string added to the base url + */ + function appendQueryString($baseUrl, $extra) + { + $output = $baseUrl; + if(!empty($extra)) + { + if(strpos($baseUrl, "?") !== false) + { + $output .= "&" . $extra; + }else + { + $output .= "?" . $extra; + } + } + + return $output; + } + /** + * make the query strin from $_GET, but excluding those specified by $excluded + * + * @param array $excluded + * @return string + */ + function makeQueryString($excluded=array()) + { + $output = ''; + $count = 1; + foreach($_GET as $k=>$v) + { + if(array_search($k, $excluded) === false) + { + $output .= ($count>1?'&':'') . ($k . "=" . $v); + $count++; + } + } + return $output; + } + /** + * get parent path from specific path + * + * @param string $value + * @return string + */ + function getParentPath($value) + { + $value = removeTrailingSlash(backslashToSlash($value)); + if(false !== ($index = strrpos($value, "/")) ) + { + return substr($value, 0, $index); + } + + } + + + /** + * check if the file/folder is sit under the root + * + * @param string $value + * @return boolean + */ + function isUnderRoot($value) + { + $roorPath = strtolower(addTrailingSlash(backslashToSlash(getRealPath(CONFIG_SYS_ROOT_PATH)))); + if(file_exists($value) && @strpos(strtolower(addTrailingSlash(backslashToSlash(getRealPath($value)))), $roorPath) === 0 ) + { + return true; + } + return false; + } + /** + * check if a file under the session folder + * + * @param string $value + * @return boolean + */ + function isUnderSession($value) + { + global $session; + $sessionPath = strtolower(addTrailingSlash(backslashToSlash(getRealPath($session->getSessionDir())))); + if(file_exists($value) && @strpos(strtolower(addTrailingSlash(backslashToSlash(getRealPath($value)))), $sessionPath) === 0 ) + { + return true; + } + return false; + } + + + /** + * get thumbnail width and height + * + * @param integer $originaleImageWidth + * @param integer $originalImageHeight + * @param integer $thumbnailWidth + * @param integer $thumbnailHeight + * @return array() + */ + function getThumbWidthHeight( $originaleImageWidth, $originalImageHeight, $thumbnailWidth, $thumbnailHeight) + { + $outputs = array( "width"=>0, "height"=>0); + $thumbnailWidth = (int)($thumbnailWidth); + $thumbnailHeight = (int)($thumbnailHeight); + if(!empty($originaleImageWidth) && !empty($originalImageHeight)) + { + //start to get the thumbnail width & height + if(($thumbnailWidth < 1 && $thumbnailHeight < 1) || ($thumbnailWidth > $originaleImageWidth && $thumbnailHeight > $originalImageHeight )) + { + $thumbnailWidth =$originaleImageWidth; + $thumbnailHeight = $originalImageHeight; + }elseif($thumbnailWidth < 1) + { + $thumbnailWidth = floor($thumbnailHeight / $originalImageHeight * $originaleImageWidth); + + }elseif($thumbnailHeight < 1) + { + $thumbnailHeight = floor($thumbnailWidth / $originaleImageWidth * $originalImageHeight); + }else + { + $scale = min($thumbnailWidth/$originaleImageWidth, $thumbnailHeight/$originalImageHeight); + $thumbnailWidth = floor($scale*$originaleImageWidth); + $thumbnailHeight = floor($scale*$originalImageHeight); + } + $outputs['width'] = $thumbnailWidth; + $outputs['height'] = $thumbnailHeight; + } + return $outputs; + + } +/** + * turn to absolute path from relative path + * + * @param string $value + * @return string + */ +function getAbsPath($value) { + if (substr($value, 0, 1) == "/") + return slashToBackslash(DIR_AJAX_ROOT . $value); + + return slashToBackslash(dirname(__FILE__) . "/" . $value); +} + + /** + * get file/folder base name + * + * @param string $value + * @return string + */ + function getBaseName($value) + { + $value = removeTrailingSlash(backslashToSlash($value)); + + if(false !== ($index = strrpos($value, "/")) ) + { + return substr($value, $index + 1); + }else + { + return $value; + } + } + +function myRealPath($path) { + + if(strpos($path, ':/') !== false) + { + return $path; + } + // check if path begins with "/" ie. is absolute + // if it isnt concat with script path + + if (strpos($path,"/") !== 0 ) { + $base=dirname($_SERVER['SCRIPT_FILENAME']); + $path=$base."/".$path; + } + + // canonicalize + $path=explode('/', $path); + $newpath=array(); + for ($i=0; $i 1048576) + { + return round($size / 1048576, 1) . " MB"; + }elseif ($size > 1024) + { + return round($size / 1024, 1) . " KB"; + }elseif($size == '') + { + return $size; + }else + { + return $size . " b"; + } +} + + /** + * remove beginging slash + * + * @param string $value + * @return string + */ + function removeBeginingSlash($value) + { + $value = backslashToSlash($value); + if(strpos($value, "/") === 0) + { + $value = substr($value, 1); + } + return $value; + } + +/** + * get site root path + * + * @return String. + */ +function getRootPath() { + $output = ""; + if (defined('CONFIG_WEBSITE_DOCUMENT_ROOT') && CONFIG_WEBSITE_DOCUMENT_ROOT) + { + return slashToBackslash(CONFIG_WEBSITE_DOCUMENT_ROOT); + } + if(isset($_SERVER['DOCUMENT_ROOT']) && ($output = relToAbs($_SERVER['DOCUMENT_ROOT'])) != '' ) + { + return $output; + }elseif(isset($_SERVER["SCRIPT_NAME"]) && isset($_SERVER["SCRIPT_FILENAME"]) && ($output = str_replace(backslashToSlash($_SERVER["SCRIPT_NAME"]), "", backslashToSlash($_SERVER["SCRIPT_FILENAME"]))) && is_dir($output)) + { + return slashToBackslash($output); + }elseif(isset($_SERVER["SCRIPT_NAME"]) && isset($_SERVER["PATH_TRANSLATED"]) && ($output = str_replace(backslashToSlash($_SERVER["SCRIPT_NAME"]), "", str_replace("//", "/", backslashToSlash($_SERVER["PATH_TRANSLATED"])))) && is_dir($output)) + { + return $output; + }else + { + return ''; + } + + return null; +} + + + /** + * add beginging slash + * + * @param string $value + * @return string + */ + function addBeginingSlash($value) + { + if(strpos($value, "/") !== 0 && !empty($value)) + { + $value .= "/" . $value; + } + return $value; + } + + + + + + /** + * get a file extension + * + * @param string $fileName the path to a file or just the file name + */ + function getFileExt($filePath) + { + return @substr(@strrchr($filePath, "."), 1); + } + + /** + * reuturn the relative path between two url + * + * @param string $start_dir + * @param string $final_dir + * @return string + */ + function getRelativePath($start_dir, $final_dir){ + // + $firstPathParts = explode(DIRECTORY_SEPARATOR, $start_dir); + $secondPathParts = explode(DIRECTORY_SEPARATOR, $final_dir); + // + $sameCounter = 0; + for($i = 0; $i < min( count($firstPathParts), count($secondPathParts) ); $i++) { + if( strtolower($firstPathParts[$i]) !== strtolower($secondPathParts[$i]) ) { + break; + } + $sameCounter++; + } + if( $sameCounter == 0 ) { + return $final_dir; + } + // + $newPath = ''; + for($i = $sameCounter; $i < count($firstPathParts); $i++) { + if( $i > $sameCounter ) { + $newPath .= DIRECTORY_SEPARATOR; + } + $newPath .= ".."; + } + if( count($newPath) == 0 ) { + $newPath = "."; + } + for($i = $sameCounter; $i < count($secondPathParts); $i++) { + $newPath .= DIRECTORY_SEPARATOR; + $newPath .= $secondPathParts[$i]; + } + // + return $newPath; + } + /** + * get the php server memory limit + * @return integer + * + */ + function getMemoryLimit() + { + $output = @ini_get('memory_limit') or $output = -1 ; + if((int)($output) < 0) + {//unlimited + $output = 999999999999999999; + } + elseif(strpos('g', strtolower($output)) !== false) + { + $output = (int)($output) * 1024 * 1024 * 1024; + }elseif(strpos('k', strtolower($output)) !== false) + { + $output = (int)($output) * 1024 ; + }else + { + $output = (int)($output) * 1024 * 1024; + } + + return $output; + } + /** + * get file content + * + * @param string $path + */ + function getFileContent($path) + { + return @file_get_contents($path); + //return str_replace(array("\r", "\n", '"', "\t"), array("", "\\n", '\"', "\\t"), @file_get_contents($path)); + } + /** + * get the list of folder under a specified folder + * which will be used for drop-down menu + * @param string $path the path of the specified folder + * @param array $outputs + * @param string $indexNumber + * @param string $prefixNumber the prefix before the index number + * @param string $prefixName the prefix before the folder name + * @return array + */ + function getFolderListing($path,$indexNumber=null, $prefixNumber =' ', $prefixName =' - ', $outputs=array()) + { + $path = removeTrailingSlash(backslashToSlash($path)); + if(is_null($indexNumber)) + { + $outputs[IMG_LBL_ROOT_FOLDER] = removeTrailingSlash(backslashToSlash($path)); + } + $fh = @opendir($path); + if($fh) + { + $count = 1; + while($file = @readdir($fh)) + { + $newPath = removeTrailingSlash(backslashToSlash($path . "/" . $file)); + if(isListingDocument($newPath) && $file != '.' && $file != '..' && is_dir($newPath)) + { + if(!empty($indexNumber)) + {//this is not root folder + + $outputs[$prefixNumber . $indexNumber . "." . $count . $prefixName . $file] = $newPath; + getFolderListing($newPath, $prefixNumber . $indexNumber . "." . $count , $prefixNumber, $prefixName, $outputs); + }else + {//this is root folder + + $outputs[$count . $prefixName . $file] = $newPath; + getFolderListing($newPath, $count, $prefixNumber, $prefixName, $outputs); + } + $count++; + } + } + @closedir($fh); + } + return $outputs; + } + + + /** + * get the valid text editor extension + * which is calcualte from the CONFIG_EDITABALE_VALID_EXTS + * exclude those specified in CONFIG_UPLOAD_INVALID_EXTS + * and those are not specified in CONFIG_UPLOAD_VALID_EXTS + * + * @return array + */ + function getValidTextEditorExts() + { + $validEditorExts = explode(',', CONFIG_EDITABLE_VALID_EXTS); + if(CONFIG_UPLOAD_VALID_EXTS) + {//exclude those exts not shown on CONFIG_UPLOAD_VALID_EXTS + $validUploadExts = explode(',', CONFIG_UPLOAD_VALID_EXTS); + foreach($validEditorExts as $k=>$v) + { + if(array_search($v, $validUploadExts) === false) + { + unset($validEditorExts[$k]); + } + } + } + if(CONFIG_UPLOAD_INVALID_EXTS) + {//exlcude those exists in CONFIG_UPLOAD_INVALID_EXTS + $invalidUploadExts = explode(',', CONFIG_UPLOAD_INVALID_EXTS); + foreach($validEditorExts as $k=>$v) + { + if(array_search($v, $invalidUploadExts) !== false) + { + unset($validEditorExts[$k]); + } + } + } + return $validEditorExts; + + } + /** + * check if file name or folder name is valid against a regular expression + * + * @param string $pattern regular expression, separated by , if multiple + * @param string $string + * @return booolean + */ + function isValidPattern( $pattern, $string) + { + if(($pattern)=== '') + { + return true; + } + else if (strpos($pattern,",")!==false) + { + $regExps = explode(',', $pattern); + foreach ($regExps as $regExp => $value) + { + if(eregi($value, $string)) + { + return true; + } + } + } + else if(eregi($pattern, $string)) + { + return true; + } + return false; + + } + + + /** + * check if file name or folder name is invalid against a regular expression + * + * @param string $pattern regular expression, separated by , if multiple + * @param string $string + * @return booolean + */ + function isInvalidPattern( $pattern, $string) + { + if(($pattern)=== '') + { + return false; + } + else if (strpos($pattern,",")!==false) + { + $regExps = explode(',', $pattern); + foreach ($regExps as $regExp => $value) + { + if(eregi($value, $string)) + { + return true; + } + } + } + else if(eregi($pattern, $string)) + { + return true; + } + return false; + + } + + + /** + * cut the file down to fit the list page + * + * @param string $fileName + */ + function shortenFileName($fileName, $maxLeng=17, $indicate = '...') + { + if(strlen($fileName) > $maxLeng) + { + $fileName = substr($fileName, 0, $maxLeng - strlen($indicate)) . $indicate; + } + return $fileName; + + } + if (!function_exists('mime_content_type')) + { + function mime_content_type ( $f ) + { + return trim ( @exec ('file -bi ' . escapeshellarg ( $f ) ) ) ; + } + } + + /** + * check if such document is allowed to shown on the list + * + * @param string $path the path to the document + * @return boolean + */ + function isListingDocument($path) + { + $file = basename($path); + if(CONFIG_SYS_PATTERN_FORMAT == 'list') + {// comma delimited vague file/folder name + + + + + if(is_dir($path)) + { + $includeDir = trimlrm(CONFIG_SYS_INC_DIR_PATTERN); + $excludeDir = trimlrm(CONFIG_SYS_EXC_DIR_PATTERN); + $found_includeDir = strpos($includeDir, $file); + $found_excludeDir = strpos($excludeDir, $file); + if((!CONFIG_SYS_INC_DIR_PATTERN || (!($found_includeDir === FALSE))) && (!CONFIG_SYS_EXC_DIR_PATTERN || (($found_excludeDir === FALSE)))) + { + return true; + }else + { + return false; + } + }elseif(is_file($path)) + { + $includeFile = trimlrm(CONFIG_SYS_INC_FILE_PATTERN); + $excludeFile = trimlrm(CONFIG_SYS_EXC_FILE_PATTERN); + $found_includeFile = strpos($includeFile, $file); + $found_excludeFile = strpos($excludeFile, $file); + if((!CONFIG_SYS_INC_FILE_PATTERN || (!($found_includeFile === FALSE))) && (!CONFIG_SYS_EXC_FILE_PATTERN || (($found_excludeFile === FALSE)))) + { + return true; + }else + { + return false; + } + } + }elseif(CONFIG_SYS_PATTERN_FORMAT == 'csv') + {//comma delimited file/folder name + + if(is_dir($path)) + { + + $includeDir = trimlrm(CONFIG_SYS_INC_DIR_PATTERN); + $excludeDir = trimlrm(CONFIG_SYS_EXC_DIR_PATTERN); + + if(!empty($includeDir) && !empty($excludeDir)) + { + + $validDir = explode(',', $includeDir); + + $invalidDir = explode(",", $excludeDir); + + if(array_search(basename($path), $validDir) !== false && array_search(basename($path), $invalidDir) === false) + { + return true; + }else + { + return false; + } + }elseif(!empty($includeDir)) + { + $validDir = explode(',', $includeDir); + if(array_search(basename($path), $validDir) !== false) + { + return true; + }else + { + return false; + } + + }elseif(!empty($excludeFile)) + { + $invalidDir = explode(",", $excludeDir); + if(array_search(basename($path), $invalidDir) === false) + { + return true; + }else + { + return false; + } + } + return true; + + }elseif(is_file($path)) + { + $includeFile = trimlrm(CONFIG_SYS_INC_FILE_PATTERN); + $excludeFile = trimlrm(CONFIG_SYS_EXC_FILE_PATTERN); + if(!empty($includeFile) && !empty($excludeFile)) + { + $validFile = explode(',', $includeFile); + $invalidFile = explode(',', $excludeFile); + if(array_search(basename($path), $validFile) !== false && array_search(basename($path), $invalidFile) === false) + { + return true; + }else + { + return false; + } + }elseif(!empty($includeFile)) + { + $validFile = explode(',', $includeFile); + if(array_search(basename($path), $validFile) !== false) + { + return true; + }else + { + return false; + } + }elseif(!empty($excludeFile)) + { + $invalidFile = explode(',', $excludeFile); + if(array_search(basename($path), $invalidFile) === false) + { + return true; + }else + { + return false; + } + } + return true; + } + } + else + {//regular expression + if(is_dir($path) ) + { + if(isValidPattern(CONFIG_SYS_INC_DIR_PATTERN, $path) && !isInvalidPattern(CONFIG_SYS_EXC_DIR_PATTERN, $path)) + { + return true; + }else + { + return false; + } + + }elseif(is_file($path)) + { + if(isValidPattern(CONFIG_SYS_INC_FILE_PATTERN, $path) && !isInvalidPattern(CONFIG_SYS_EXC_FILE_PATTERN, $path) ) + { + return true; + }else + { + return false; + } + } + } + return false; + + } + + /** + * force to down the specified file + * + * @param string $path + * + */ + function downloadFile($path, $newFileName=null) + { + if(file_exists($path) && is_file($path)) + { + $mimeContentType = 'application/octet-stream'; + if(function_exists('finfo_open')) + { + if(($fp = @finfo_open($path))) + { + $mimeContentType = @finfo_file($fp, basename($path)); + @finfo_close($fp); + } + + }elseif(($temMimeContentType = @mime_content_type($path)) && !empty($temMimeContentType)) + { + $mimeContentType = $temMimeContentType; + } + + + + + + // START ANDR� SILVA DOWNLOAD CODE + // required for IE, otherwise Content-disposition is ignored + if(ini_get('zlib.output_compression')) + ini_set('zlib.output_compression', 'Off'); + header("Pragma: public"); // required + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: private",false); // required for certain browsers + header("Content-Type: " . $mimeContentType ); + // change, added quotes to allow spaces in filenames, by Rajkumar Singh + header("Content-Disposition: attachment; filename=\"".(is_null($newFileName)?basename($path):$newFileName)."\";" ); + header("Content-Transfer-Encoding: binary"); + header("Content-Length: ".filesize($path)); + + readfile($path); + exit(); + // END ANDR� SILVA DOWNLOAD CODE + } + + } + + /** + * remove all white spaces + * + * @param string $hayStack + * @param string $whiteSpaceChars + * @return string + */ + function trimlrm ($hayStack, $whiteSpaceChars="\t\n\r\0\x0B") + { + return str_replace($whiteSpaceChars, '', trim($hayStack)); + } + + /** + * get the parent path of the specified path + * + * @param string $path + * @return string + */ + function getParentFolderPath($path) + { + $realPath = addTrailingSlash(backslashToSlash(getRealPath($path))); + $parentRealPath = addTrailingSlash(backslashToSlash(dirname($realPath))); + $differentPath = addTrailingSlash(substr($realPath, strlen($parentRealPath))); + $parentPath = substr($path, 0, strlen(addTrailingSlash(backslashToSlash($path))) - strlen($differentPath)); + if(isUnderRoot($parentPath)) + { + return $parentPath; + }else + { + return CONFIG_SYS_DEFAULT_PATH; + } + } + + function getCurrentFolderPath() + { + $folderPathIndex = 'path'; + $lastVisitedFolderPathIndex = 'ajax_last_visited_folder'; + if(isset($_GET[$folderPathIndex]) && file_exists($_GET[$folderPathIndex]) && !is_file($_GET[$folderPathIndex]) ) + { + $currentFolderPath = $_GET[$folderPathIndex]; + } + elseif(isset($_SESSION[$lastVisitedFolderPathIndex]) && file_exists($_SESSION[$lastVisitedFolderPathIndex]) && !is_file($_SESSION[$lastVisitedFolderPathIndex])) + { + $currentFolderPath = $_SESSION[$lastVisitedFolderPathIndex]; + }else + { + $currentFolderPath = CONFIG_SYS_DEFAULT_PATH; + } + + $currentFolderPath = (isUnderRoot($currentFolderPath)?backslashToSlash((addTrailingSlash($currentFolderPath))):CONFIG_SYS_DEFAULT_PATH); + + //keep track of this folder path in session + $_SESSION[$lastVisitedFolderPathIndex] = $currentFolderPath; + + + if(!file_exists($currentFolderPath)) + { + die(ERR_FOLDER_NOT_FOUND . $currentFolderPath); + } + } + + if(!function_exists("imagerotate")) + { + function imagerotate($src_img, $angle, $bicubic=false) + { + // convert degrees to radians + + $angle = (360 - $angle) + 180; + $angle = deg2rad($angle); + + $src_x = imagesx($src_img); + $src_y = imagesy($src_img); + + $center_x = floor($src_x/2); + $center_y = floor($src_y/2); + + $rotate = imagecreatetruecolor($src_x, $src_y); + imagealphablending($rotate, false); + imagesavealpha($rotate, true); + + $cosangle = cos($angle); + $sinangle = sin($angle); + + for ($y = 0; $y < $src_y; $y++) { + for ($x = 0; $x < $src_x; $x++) { + // rotate... + $old_x = (($center_x-$x) * $cosangle + ($center_y-$y) * $sinangle) + + $center_x; + $old_y = (($center_y-$y) * $cosangle - ($center_x-$x) * $sinangle) + + $center_y; + + if ( $old_x >= 0 && $old_x < $src_x + && $old_y >= 0 && $old_y < $src_y ) { + if ($bicubic == true) { + $sY = $old_y + 1; + $siY = $old_y; + $siY2 = $old_y - 1; + $sX = $old_x + 1; + $siX = $old_x; + $siX2 = $old_x - 1; + + $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; + $a = ($c1['alpha'] + $c2['alpha'] + $c3['alpha'] + $c4['alpha'] ) >> 2; + $color = imagecolorallocatealpha($src_img, $r,$g,$b,$a); + } else { + $color = imagecolorat($src_img, $old_x, $old_y); + } + } else { + // this line sets the background colour + $color = imagecolorallocatealpha($src_img, 255, 255, 255, 127); + } + imagesetpixel($rotate, $x, $y, $color); + } + } + return $rotate; +/* $src_x = @imagesx($src_img); + $src_y = @imagesy($src_img); + if ($angle == 180) + { + $dest_x = $src_x; + $dest_y = $src_y; + } + elseif ($src_x <= $src_y) + { + $dest_x = $src_y; + $dest_y = $src_x; + } + elseif ($src_x >= $src_y) + { + $dest_x = $src_y; + $dest_y = $src_x; + } + if(function_exists('ImageCreateTrueColor')) + { + $rotate = @ImageCreateTrueColor($dst_w,$dst_h); + } else { + $rotate = @ImageCreate($dst_w,$dst_h); + } + @imagealphablending($rotate, false); + + switch ($angle) + { + case 270: + for ($y = 0; $y < ($src_y); $y++) + { + for ($x = 0; $x < ($src_x); $x++) + { + $color = imagecolorat($src_img, $x, $y); + imagesetpixel($rotate, $dest_x - $y - 1, $x, $color); + } + } + break; + case 90: + for ($y = 0; $y < ($src_y); $y++) + { + for ($x = 0; $x < ($src_x); $x++) + { + $color = imagecolorat($src_img, $x, $y); + imagesetpixel($rotate, $y, $dest_y - $x - 1, $color); + } + } + break; + case 180: + for ($y = 0; $y < ($src_y); $y++) + { + for ($x = 0; $x < ($src_x); $x++) + { + $color = imagecolorat($src_img, $x, $y); + imagesetpixel($rotate, $dest_x - $x - 1, $dest_y - $y - 1, $color); + } + } + break; + default: $rotate = $src_img; + }; + return $rotate;*/ + } + } +?> \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/ajaxfilemanager.js b/admin-dev/ajaxfilemanager/jscripts/ajaxfilemanager.js new file mode 100755 index 000000000..05bd03d28 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/ajaxfilemanager.js @@ -0,0 +1,1845 @@ +/* +/* + * author: Logan Cai + * Email: cailongqun [at] yahoo [dot] com [dot] cn + * Website: www.phpletter.com + * Created At: 21/April/2007 + * Modified At: 1/June/2007 +*/ +// Returns true if the passed value is found in the +// array. Returns false if it is not. +Array.prototype.inArray = function (value,caseSensitive) +{ + var i; + for (i=0; i < this.length; i++) + { + // use === to check for Matches. ie., identical (===), + if(caseSensitive){ //performs match even the string is case sensitive + if (this[i].toLowerCase() == value.toLowerCase()) + { + return true; + } + }else + { + if (this[i] == value) + { + return true; + } + } + } + return false; +}; + var dcTime=250; // doubleclick time + var dcDelay=100; // no clicks after doubleclick + var dcAt=0; // time of doubleclick + var savEvent=null; // save Event for handling doClick(). + var savEvtTime=0; // save time of click event. + var savTO=null; // handle of click setTimeOut + var linkElem = null; + + + function hadDoubleClick() + { + var d = new Date(); + var now = d.getTime(); + if ((now - dcAt) < dcDelay) + { + return true; + } + return false; + }; + + +/** +* enable left click to preview certain files +*/ +function enablePreview(elem, num) +{ + + $(elem).each( + function() + { + + $(this).click(function () + { + + //alert('single click'); + var num = getNum(this.id); + var path = files[num].path; + //alert('now: ' + now + '; dcat: ' + dcAt + '; dcDelay: ' + dcDelay); + if (hadDoubleClick()) + { + return false; + }else + { + linkElem = $('#a' + num).get(0); + } + + d = new Date(); + savEvtTime = d.getTime(); + savTO = setTimeout(function() + { + if (savEvtTime - dcAt > 0) + { + //check if this file is previewable + + + var ext = getFileExtension(path); + var supportedExts = supporedPreviewExts.split(","); + var isSupportedExt = false; + for (i in supportedExts) + { + var typeOf = typeof(supportedExts[i]); + //alert(supportedExts[i]); + if(typeOf.toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase()) + { + isSupportedExt = true; + break; + } + + } + + if(isSupportedExt) + { + switch(files[num].cssClass) + { + case 'fileVideo': + case 'fileMusic': + case 'fileFlash': + + $('#playGround').html('
 this is mine
'); + + + $('#playGround' + num).html(''); + $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); + //alert($('#playGround' + num).html()); + showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=256' + '&inlineId=winPlay&modal=true')); + + break; + default: + showThickBox(linkElem, appendQueryString(path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width)); + + } + + } + + } + + + return false; + + }, dcTime); + + return false; + + }); + $(this).dblclick(function() + { + var d = new Date(); + dcAt = d.getTime(); + if (savTO != null) { + clearTimeout( savTO ); // Clear pending Click + savTO = null; + + } + + if(typeof(selectFile) != 'undefined') + { + + selectFile(files[num].url); + }else + generateDownloadIframe(appendQueryString(getUrl('download'), 'path=' + files[num].path, ['path'])); { + + } + + } + ); + + } + ); +}; +/** +* add over class to the specific table +*/ +function tableRuler(element) +{ + + var rows = $(element); + + $(rows).each(function(){ + $(this).mouseover(function(){ + $(this).addClass('over'); + }); + $(this).mouseout(function(){ + $(this).removeClass('over'); + }); + }); +}; + + + + + + + +function previewMedia(rowNum) +{ + $('#preview' +rowNum).html(''); + $('#preview' +rowNum).media({ width: 255, height: 210, autoplay: true }); + return false; +}; + +function getFileExtension(filename) +{ + if( filename.length == 0 ) return ""; + var dot = filename.lastIndexOf("."); + if( dot == -1 ) return ""; + var extension = filename.substr(dot + 1,filename.length); + return extension; +}; + +function closeWindow() +{ + if(window.confirm(warningCloseWindow)) + { + window.close(); + } + return false; +}; + +/** +* return the url with query string +*/ +function getUrl(index,limitNeeded , viewNeeded, searchNeeded) +{ + + var queryStr = ''; + var excluded = new Array(); + + if(typeof(limitNeeded) == 'boolean' && limitNeeded) + { + var limit = document.getElementById('limit'); + var typeLimit = typeof(limit); + + if(typeLimit != 'undefined' && limit ) + { + excluded[excluded.length] = 'limit'; + queryStr += (queryStr == ''?'':'&') + 'limit=' + limit.options[limit.selectedIndex].value; + } + + } + if(typeof(viewNeeded) == 'boolean' && viewNeeded) + { + queryStr += (queryStr == ''?'':'&') + 'view=' + getView(); + excluded[excluded.length] = 'view'; + + } + + if(typeof(searchNeeded) == 'boolean' && searchNeeded && searchRequired) + { + var search_recursively = 0; + $('input[@name=search_recursively][@checked]').each( + function() + { + search_recursively = this.value; + } + ); + var searchFolder = document.getElementById('search_folder'); + queryStr += (queryStr == ''?'':'&') + 'search=1&search_name=' + $('#search_name').val() + '&search_recursively=' + search_recursively + '&search_mtime_from=' + $('#search_mtime_from').val() + '&search_mtime_to=' + $('#search_mtime_to').val() + '&search_folder=' + searchFolder.options[searchFolder.selectedIndex].value; + excluded[excluded.length] = 'search'; + excluded[excluded.length] = 'search_recursively'; + excluded[excluded.length] = 'search_mtime_from'; + excluded[excluded.length] = 'search_mtime_to'; + excluded[excluded.length] = 'search_folder'; + excluded[excluded.length] = 'search_name'; + excluded[excluded.length] = 'search'; + + } + + + + return appendQueryString(appendQueryString(urls[index], queryString), queryStr, excluded); +}; +/** +* change view +*/ +function changeView() +{ + + var url = getUrl('view', true, true); + $('#rightCol').empty(); + ajaxStart('#rightCol'); + + $('#rightCol').load(url, + {}, + function(){ + ajaxStop('#rightCol img.ajaxLoadingImg'); + urls.present = getUrl('home', true, true); + initAfterListingLoaded(); + }); +}; + +function goParentFolder() +{ + + searchRequired = false; + var url = appendQueryString(getUrl('view', true, true), 'path=' + parentFolder.path , ['path']); + $('#rightCol').empty(); + ajaxStart('#rightCol'); + + $('#rightCol').load(url, + {}, + function(){ + urls.present = appendQueryString(getUrl('home', true, true), 'path=' + parentFolder.path , ['path']); + ajaxStop('#rightCol img.ajaxLoadingImg'); + initAfterListingLoaded(); + }); + +}; + +/** +* append Query string to the base url +* @param string baseUrl the base url +* @param string the query string +* @param array remove thost url variable from base url if any matches +*/ +function appendQueryString(baseUrl, queryStr, excludedQueryStr) +{ + + if(typeof(excludedQueryStr) == 'object' && excludedQueryStr.length) + { + var isMatched = false; + var urlParts = baseUrl.split("?"); + baseUrl = urlParts[0]; + var count = 1; + if(typeof(urlParts[1]) != 'undefined' && urlParts[1] != '') + {//this is the query string parts + var queryStrParts = urlParts[1].split("&"); + for(var i=0; i < queryStrParts.length; i++) + { + //split into query string variable name & value + var queryStrVariables = queryStrParts[i].split('='); + for(var j=0; j < excludedQueryStr.length; j++) + { + if(queryStrVariables[0] == excludedQueryStr[j]) + { + isMatched = true; + } + } + if(!isMatched) + { + baseUrl += ((count==1?'?':'&') + queryStrVariables[0] + '=' + queryStrVariables[1]); + count++; + } + } + } + + } + if(queryStr != '') + { + return (baseUrl.indexOf('?')> -1?baseUrl + '&' + queryStr:baseUrl + '?' + queryStr); + }else + { + return baseUrl; + } + + + + +}; + + +/** +* initiate when the listing page is loaded +* add main features according to the view +*/ +function initAfterListingLoaded() +{ + + + parsePagination(); + + parseCurrentFolder(); + var view = getView(); + + setDocInfo('root'); + + if(view != '') + { + + switch(view) + { + + + case 'thumbnail': + //enableContextMenu('dl.thumbnailListing, dl.thumbnailListing dt, dl.thumbnailListing dd, dl.thumbnailListing a'); + enableContextMenu('dl.thumbnailListing'); + for(i in files) + { + if(files[i].type== 'folder') + {//this is foder item + + enableFolderBrowsable(i); + }else + {//this is file item + + switch(files[i].cssClass) + { + case 'filePicture': + //$('#a' + i).attr('rel', 'ajaxphotos'); + //retrieveThumbnail(i); + + break; + case 'fileFlash': + break; + case 'fileVideo': + break; + case 'fileMusic': + break; + default: + + + } + enablePreview('#dt' + i, i); + enablePreview('#thumbUrl' + i, i); + enablePreview('#a' + i, i); + + } + enableShowDocInfo( i); + + } + break; + case 'detail': + default: + + enableContextMenu('#fileList tr'); + for(i in files) + { + if(files[i].type== 'folder') + {//this is foder item + enableFolderBrowsable(i); + }else + {//this is file item + switch(files[i].cssClass) + { + case 'filePicture': + $('#row' + i + ' td a').attr('rel', 'ajaxphotos'); + break; + case 'fileFlash': + break; + case 'fileVideo': + break; + case 'fileMusic': + break; + default: + + }; + enablePreview('#row' + i + ' td a', i); + + } + enableShowDocInfo(i); + } + break; + + + } + } + + +}; + +function enableFolderBrowsable(num, debug) +{ + + switch(getView()) + { + case 'thumbnail': + $('#dt'+ num + ' , #dd' + num + ' a').each(function() + + { +/* if(typeof(debug) != 'undefined' && debug) + { + alert(this.tagName + ' ' + files[num].path); + }*/ + doEnableFolderBrowsable(this, num); + } + ); + break; + case 'detail': + default: + $('#row' + num + ' td[a]').each(function() + + { + doEnableFolderBrowsable(this, num ); + } + ); + + } + + + + +}; + +function doEnableFolderBrowsable(elem, num) +{ + $(elem).click(function() + { + { + searchRequired = false; + var typeNum = typeof(num); + if(typeNum.toUpperCase() == 'STRING') + { + var fpath = (num.indexOf(urls.view) >=0?num:files[num].path); + }else + { + var fpath = files[num].path; + } + + + var url = appendQueryString(getUrl('view', true, true), 'path=' + fpath, ['path']); + + + $('#rightCol').empty(); + ajaxStart('#rightCol'); + $('#rightCol').load(url, + {}, + function(){ + urls.present = appendQueryString(getUrl('home', true, true), 'path=' + fpath, ['path']); + ajaxStop('#rightCol img.ajaxLoadingImg'); + initAfterListingLoaded(); + }); + }; + return false; + + } + ); +}; + +/** +* @param mixed destinationSelector where the animation image will be append to +* @param mixed selectorOfAnimation the jquery selector of the animation +*/ +function ajaxStart(destinationSelector, id, selectorOfAnimation) +{ + if(typeof(selectorOfAnimation) == 'undefined') + {//set defaullt animation + selectorOfAnimation = '#ajaxLoading img'; + } + if(typeof(id) != 'undefined') + { + $(selectorOfAnimation).clone().attr('id', id).appendTo(destinationSelector); + + }else + { + $(selectorOfAnimation).clone(true).appendTo(destinationSelector); + + } + + +}; +/** +* remove the ajax animation +* @param mixed selectorOfAnimation the jquery selector of the animation +*/ +function ajaxStop(selectorOfAnimation) +{ + $(selectorOfAnimation).remove(); +}; +/** +* change pagination limit +*/ +function changePaginationLimit(elem) +{ + var url = getUrl('view', true, true, true); + $('#rightCol').empty(); + ajaxStart('#rightCol'); + $('#rightCol').load(url, + {}, + function(){ + urls.present = appendQueryString(getUrl('home', true, true), 'path=' + parentFolder.path , ['path']) + ajaxStop('#rightCol img.ajaxLoadingImg'); + initAfterListingLoaded(); + }); +}; +/** +* get a query string variable value from an url +* @param string index +* @param string url +*/ +function getUrlVarValue(url, index) +{ + + if(url != '' && index != '') + { + var urlParts = url.split("?"); + baseUrl = urlParts[0]; + var count = 1; + if(typeof(urlParts[1]) != 'undefined' && urlParts[1] != '') + {//this is the query string parts + var queryStrParts = urlParts[1].split("&"); + for(var i=0; i < queryStrParts.length; i++) + { + //split into query string variable name & value + var queryStrVariables = queryStrParts[i].split('='); + if(queryStrVariables[0] == index) + { + return queryStrVariables[1]; + } + } + } + } + return ''; + +}; +/** +* parse current folder +*/ +function parseCurrentFolder() +{ + var folders = currentFolder.friendly_path.split('/'); + var str = ''; + var url = getUrl('view', true, true); + + var parentPath = ''; + for(var i = 0; i < folders.length; i++) + { + if(i == 0) + { + parentPath += paths.root; + str += '/' + paths.root_title + '' + + }else + { + if(folders[i] != '') + { + + parentPath += folders[i] + '/'; + str += '/' + folders[i] + ''; + } + } + } + $('#currentFolderPath').empty().append(str); + $('#currentFolderPath a').each( + function() + { + doEnableFolderBrowsable(this, $(this).attr('href')); + } + ); +}; +/** +* enable pagination as ajax function call +*/ +function parsePagination() +{ + $('p.pagination a[@id!=pagination_parent_link]').each(function () + { + $(this).click( + function() + { + + + var page = getUrlVarValue($(this).attr('href'), 'page'); + var url = appendQueryString(getUrl('view', true, true, searchRequired),'page=' + page, ['page']); + $('#rightCol').empty(); + ajaxStart('#rightCol'); + $('#rightCol').load(url, + {}, + function(){ + urls.present = appendQueryString(getUrl('home', true, true, searchRequired),'page=' + page, ['page']); + ajaxStop('#rightCol img.ajaxLoadingImg'); + initAfterListingLoaded(); + }); + return false; + } + + ); + } + ); +}; +/** +* get current view +*/ +function getView() +{ + var view = $('input[@name=view][@checked]').get(0); + if(typeof(view) != 'undefined') + { + return view.value; + }else + { + return ''; + } +}; + +function getNum(elemId) +{ + + if(typeof(elemId) != 'undefined' && elemId != '') + { + var r = elemId.match(/[\d\.]+/g); + if(typeof(r) != 'undefined' && r && typeof(r[0]) != 'undefined') + { + return r[0]; + } + } + + return 0; +}; + +function enableContextMenu(jquerySelectors) +{ + + $(jquerySelectors).contextMenu('contextMenu', + { + bindings: + { + 'menuSelect':function(t) + { + var num = (getNum($(t).attr('id'))); + + selectFile(files[num].url); + }, + 'menuPlay':function(t) + { + var num = (getNum($(t).attr('id'))); + $('#playGround').html('
 this is mine
'); + + + $('#playGround' + num).html(''); + $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); + //alert($('#playGround' + num).html()); + showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=258' + '&inlineId=winPlay&modal=true')); + + + + }, + 'menuPreview':function(t) + { + var num = (getNum($(t).attr('id'))); + $('#a' + num).click(); + }, + 'menuDownload':function(t) + { + var num = (getNum($(t).attr('id'))); + generateDownloadIframe(appendQueryString(getUrl('download', false, false), 'path=' + files[num].path, ['path'])); + }, + 'menuRename':function(t) + { + var num = (getNum($(t).attr('id'))); + + showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=100' + '&width=350' + '&inlineId=winRename&modal=true')); + + $('div#TB_window #renameName').val(files[num].name); + $('div#TB_window #original_path').val(files[num].path); + $('div#TB_window #renameNum').val(num); + }, + 'menuEdit':function(t) + { + var num = (getNum($(t).attr('id'))); + var url = ''; + switch(files[num].cssClass) + { + case 'filePicture': + url = getUrl('image_editor'); + break; + default: + url = getUrl('text_editor'); + + } + var param = "status=yes,menubar=no,resizable=yes,scrollbars=yes,location=no,toolbar=no"; + param += ",height=" + screen.height + ",width=" + screen.width; + if(typeof(window.screenX) != 'undefined') + { + param += ",screenX = 0,screenY=0"; + }else if(typeof(window.screenTop) != 'undefined' ) + { + param += ",left = 0,top=0" ; + } + var newWindow = window.open(url + ((url.lastIndexOf("?") > - 1)?"&":"?") + "path=" + files[num].path,'', param); + newWindow.focus( ); + + + }, + + 'menuCut':function(t) + { + + }, + 'menuCopy':function(t) + { + + }, + 'menuPaste':function(t) + { + + }, + 'menuDelete':function(t) + { + var num = (getNum($(t).attr('id'))); + if(window.confirm(warningDelete)) + { + $.getJSON(appendQueryString(getUrl('delete', false,false), 'delete=' + files[num].path, ['delete']), + function(data) + { + if(typeof(data.error) == 'undefined') + { + alert('Unexpected Error.'); + } + else if(data.error != '') + { + alert(data.error); + }else + {//remove deleted files + switch(getView()) + { + case 'thumbnail': $('#dl' + num ).remove(); + break; + case 'detail': + default: + $('#row' + num).remove(); + + } + files[num] = null; + } + } + ); + + + } + } + }, + onContextMenu:function(events) + { + + return true; + }, + onShowMenu:function(events, menu) + { + + switch(getView()) + { + case 'thumbnail': + var num = getNum(events.target.id); + + break; + case 'detail': + default: + switch(events.target.tagName.toLowerCase()) + { + case 'span': + + if($(events.target).parent().get(0).tagName.toLowerCase() == 'a') + { + + var num = getNum($(events.target).parent().parent().parent().attr('id')); + }else + { + var num = getNum($(events.target).parent().parent().parent().parent().attr('id')); + } + + + + break; + case 'td': + var num = getNum($(events.target).parent().attr('id')); + break; + case 'a': + case 'input': + var num = getNum($(events.target).parent().parent().attr('id')); + break; + } + } + + var menusToRemove = new Array; + if(typeof(selectFile) == 'undefined') + { + menusToRemove[menusToRemove.length] = '#menuSelect'; + } + menusToRemove[menusToRemove.length] = '#menuCut'; + menusToRemove[menusToRemove.length] = '#menuCopy'; + menusToRemove[menusToRemove.length] = '#menuPaste'; + switch(files[num].type) + { + case 'folder': + if(numFiles < 1) + { + menusToRemove[menusToRemove.length] = '#menuPaste'; + } + menusToRemove[menusToRemove.length] = '#menuPreview'; + menusToRemove[menusToRemove.length] = '#menuDownload'; + menusToRemove[menusToRemove.length] = '#menuEdit'; + menusToRemove[menusToRemove.length] = '#menuPlay'; + menusToRemove[menusToRemove.length] = '#menuDownload'; + + break; + default: + var isSupportedExt = false; + if(permits.edit) + { + var ext = getFileExtension(files[num].path); + var supportedExts = supporedPreviewExts.split(","); + + for(var i = 0; i < supportedExts.length; i++) + { + if(typeof(supportedExts[i]) != 'undefined' && typeof(supportedExts[i]).toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase()) + { + isSupportedExt = true; + break; + } + } + + } + if(!isSupportedExt || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuEdit'; + } + + + switch(files[num].cssClass) + { + case 'filePicture': + menusToRemove[menusToRemove.length] = '#menuPlay'; + break; + case 'fileCode': + menusToRemove[menusToRemove.length] = '#menuPlay'; + break; + case 'fileVideo': + case 'fileFlash': + case 'fileMusic': + + menusToRemove[menusToRemove.length] = '#menuPreview'; menusToRemove[menusToRemove.length] = '#menuEdit'; + break; + default: + menusToRemove[menusToRemove.length] = '#menuPreview'; + menusToRemove[menusToRemove.length] = '#menuPlay'; + + + + } + menusToRemove[menusToRemove.length] = '#menuPaste'; + } + if(!permits.edit|| permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuEdit'; + } + if(!permits.del || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuDelete'; + } + if(!permits.cut || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuCut'; + } + if(!permits.copy || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuCopy'; + } + if((!permits.cut && !permits.copy) || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuPaste'; + } + if(!permits.rename || permits.view_only) + { + menusToRemove[menusToRemove.length] = '#menuRename'; + } + + //alert(menusToRemove.join(',')); + var txt = ''; + for(var t in menu) + { + //txt += t + ': ' + menu[t] + '\n'; + } + $(menu).children().children().children().each( + function() + { + if(menusToRemove.inArray('#' + this.id)) + { + $(this).parent().remove(); + } + //alert(this.id); + + + } + ) + //alert(menusToRemove.join(',')); + //$(menusToRemove.join(','), $(menu).children().children().children()).remove(); + + + return menu; + } + } + ); +}; + + +var fileUploadElemIds = new Array(); //keep track of the file element ids +/** +* add more file type of input file for multiple uploads +*/ +function addMoreFile() +{ + + var newFileUpload = $($('div#TB_window #fileUploadBody tr').get(0)).clone(); + + do + { + var elementId = 'upload' + generateUniqueId(10); + }while(fileUploadElemIds.inArray(elementId)); + + fileUploadElemIds[fileUploadElemIds.length] = elementId; + + $(newFileUpload).appendTo('div#TB_window #fileUploadBody'); + $('input[@type=file]', newFileUpload).attr('id', elementId); + $('span.uploadProcessing', newFileUpload).attr('id', 'ajax' + elementId); + $('input[@type=button]', newFileUpload).click( + function() + { + uploadFile(elementId); + } + ); + $('a', newFileUpload).show().click( + function() + { + cancelFileUpload(elementId); + } + ); + + + $(newFileUpload).show(); + + return false; +}; +/** +* cancel uploading file +* remove hidden upload frame +* remove hidden upload form +*/ +function cancelFileUpload(elementId) +{ + $('div#TB_window #' + elementId).parent().parent().remove(); + + //ensure there is at least one visible upload element + while($('div#TB_window #fileUploadBody tr').length < 2) + { + addMoreFile(); + } + return false; +}; +/** +* upload file +*/ +function uploadFile(elementId) +{ + + var ext = getFileExtension($('#' + elementId).val()); + if(ext == '') + { + alert(noFileSelected ); + return false; + } + var supportedExts = supportedUploadExts.split(","); + var isSupportedExt = false; + + for (i in supportedExts) + { + //alert(typeof(supportedExts[i])); + if(typeof(supportedExts[i]) == 'string') + { + isSupportedExt = true; + break; + } + } + + if(!isSupportedExt) + { + alert(msgInvalidExt); + return false; + } + + $('#ajax' + elementId).hide(); + $('#ajax' + elementId).show(); + $.ajaxFileUpload + ( + { + url:appendQueryString(getUrl('upload', false, false), 'folder=' + currentFolder.path, ['folder']), + secureuri:false, + fileElementId:elementId, + dataType: 'json', + success: function (data, status) + { + + if(typeof(data.error) != 'undefined') + { + if(data.error != '') + { + alert(data.error); + $('#ajax' + elementId).hide(); + }else + { + //remove the file type of input + cancelFileUpload(elementId); + numRows++; + files[numRows] = {}; + + for(var i in data) + { + if(i != 'error') + { + files[numRows][i] = data[i]; + } + } + addDocumentHtml(numRows); + } + } + + }, + error: function (data, status, e) + { + $('#ajax' + elementId).hide(); + alert(e); + } + } + ) + + return false; +}; +/** +* generate unique id +*/ +function generateUniqueId(leng) +{ + var idLength = leng || 32; + var chars = "0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ"; + var id = ''; + for(var i = 0; i <= idLength; i++) + { + id += chars.substr( Math.floor(Math.random() * 62), 1 ); + } + + return (id ); + +}; + +/** +* generate a hidden iframe and force to download the specified file +*/ +function generateDownloadIframe(url) +{ + var frameId = 'ajaxDownloadIframe'; + $('#' + frameId).remove(); + if(window.ActiveXObject) { + var io = document.createElement('').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('

').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){h.f=$(':input:visible:first',h.w)[0];if(h.f)h.f.focus()},F=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)});$(e).each(function(){if(this[y])$.extend(this[y],s);else{this[y]=s;$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false})}})}})(jQuery);*/ + + + +(function($){$.fn.jqm=function(o){var p={overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:F,ajaxText:'',target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F};return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};if(p.trigger)$(this).jqmAddTrigger(p.trigger)})};$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide')};$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow')};$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t)})};$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)})};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('

').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])L('bind');A.push(s)}else if(c.overlay>0)h.w.jqmAddClose(o);else o=F;h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'")}}if(c.ajax){var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h)})}else if(cc)h.w.jqmAddClose($(cc,h.w));if(c.toTop&&h.o)h.w.before('').insertAfter(h.o);(c.onShow)?c.onShow(h):h.w.show();e(h);return F},close:function(s){var h=H[s];if(!h.a)return F;h.a=F;if(A[0]){A.pop();if(!A[0])L('unbind')}if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove()}return F},params:{}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,i=$('').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('

').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){try{$(':input:visible',h.w)[0].focus()}catch(_){}},L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function(){if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F})}this[c].push(s)})})}})(jQuery); +//jqModal.js end + +//rotate.js start +jQuery.fn.rotate=function(a,b){var p=this.get(0);if(!b){p.angle=((p.angle==undefined?0:p.angle)+a)%360}else{p.angle=a}if(p.angle>=0){var c=Math.PI*p.angle/180}else{var c=Math.PI*(360+p.angle)/180}var d=Math.cos(c);var e=Math.sin(c);if(document.all&&!window.opera){var f=document.createElement('img');f.src=p.src;f.height=p.height;f.width=p.width;f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+d+",M12="+(-e)+",M21="+e+",M22="+d+",SizingMethod='auto expand')"}else{var f=document.createElement('canvas');if(!p.oImage){f.oImage=new Image();f.oImage.src=p.src;f.oImage.width=p.width;f.oImage.height=p.height}else{f.oImage=p.oImage}f.style.width=f.width=Math.abs(d*f.oImage.width)+Math.abs(e*f.oImage.height);f.style.height=f.height=Math.abs(d*f.oImage.height)+Math.abs(e*f.oImage.width);var g=f.getContext('2d');g.save();if(c<=Math.PI/2){g.translate(e*f.oImage.height,0)}else if(c<=Math.PI){g.translate(f.width,-d*f.oImage.height)}else if(c<=1.5*Math.PI){g.translate(-d*f.oImage.width,f.height)}else{g.translate(0,-e*f.oImage.width)}g.rotate(c);g.drawImage(f.oImage,0,0,f.oImage.width,f.oImage.height);g.restore()}f.id=p.id;f.angle=p.angle;p.parentNode.replaceChild(f,p)};jQuery.fn.rotateRight=function(a){this.rotate(a==undefined?90:a)};jQuery.fn.rotateLeft=function(a){this.rotate(a==undefined?-90:-a)}; +//rotate.js end +//interface.js start +jQuery.iUtil={getPosition:function(e){var x=0;var y=0;var a=e.style;var b=false;if(jQuery(e).css('display')=='none'){var c=a.visibility;var d=a.position;b=true;a.visibility='hidden';a.display='block';a.position='absolute'}var f=e;while(f){x+=f.offsetLeft+(f.currentStyle&&!jQuery.browser.opera?parseInt(f.currentStyle.borderLeftWidth)||0:0);y+=f.offsetTop+(f.currentStyle&&!jQuery.browser.opera?parseInt(f.currentStyle.borderTopWidth)||0:0);f=f.offsetParent}f=e;while(f&&f.tagName&&f.tagName.toLowerCase()!='body'){x-=f.scrollLeft||0;y-=f.scrollTop||0;f=f.parentNode}if(b==true){a.display='none';a.position=d;a.visibility=c}return{x:x,y:y}},getPositionLite:function(a){var x=0,y=0;while(a){x+=a.offsetLeft||0;y+=a.offsetTop||0;a=a.offsetParent}return{x:x,y:y}},getSize:function(e){var w=jQuery.css(e,'width');var h=jQuery.css(e,'height');var a=0;var b=0;var c=e.style;if(jQuery(e).css('display')!='none'){a=e.offsetWidth;b=e.offsetHeight}else{var d=c.visibility;var f=c.position;c.visibility='hidden';c.display='block';c.position='absolute';a=e.offsetWidth;b=e.offsetHeight;c.display='none';c.position=f;c.visibility=d}return{w:w,h:h,wb:a,hb:b}},getSizeLite:function(a){return{wb:a.offsetWidth||0,hb:a.offsetHeight||0}},getClient:function(e){var h,w,de;if(e){w=e.clientWidth;h=e.clientHeight}else{de=document.documentElement;w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight}return{w:w,h:h}},getScroll:function(e){var t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.nodeName.toLowerCase()!='body'){t=e.scrollTop;l=e.scrollLeft;w=e.scrollWidth;h=e.scrollHeight;iw=0;ih=0}else{if(document.documentElement){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight}iw=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;ih=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}return{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},getMargins:function(e,a){var c=jQuery(e);var t=c.css('marginTop')||'';var r=c.css('marginRight')||'';var b=c.css('marginBottom')||'';var l=c.css('marginLeft')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else return{t:t,r:r,b:b,l:l}},getPadding:function(e,a){var c=jQuery(e);var t=c.css('paddingTop')||'';var r=c.css('paddingRight')||'';var b=c.css('paddingBottom')||'';var l=c.css('paddingLeft')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else return{t:t,r:r,b:b,l:l}},getBorder:function(e,a){var c=jQuery(e);var t=c.css('borderTopWidth')||'';var r=c.css('borderRightWidth')||'';var b=c.css('borderBottomWidth')||'';var l=c.css('borderLeftWidth')||'';if(a)return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)||0};else return{t:t,r:r,b:b,l:l}},getPointer:function(a){var x=a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0;var y=a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;return{x:x,y:y}},traverseDOM:function(a,b){b(a);a=a.firstChild;while(a){jQuery.iUtil.traverseDOM(a,b);a=a.nextSibling}},purgeEvents:function(c){jQuery.iUtil.traverseDOM(c,function(a){for(var b in a){if(typeof a[b]==='function'){a[b]=null}}})},centerEl:function(a,b){var c=jQuery.iUtil.getScroll();var d=jQuery.iUtil.getSize(a);if(!b||b=='vertically')jQuery(a).css({top:c.t+((Math.max(c.h,c.ih)-c.t-d.hb)/2)+'px'});if(!b||b=='horizontally')jQuery(a).css({left:c.l+((Math.max(c.w,c.iw)-c.l-d.wb)/2)+'px'})},fixPNG:function(a,b){var c=jQuery('img[@src*="png"]',a||document),png;c.each(function(){png=this.src;this.src=b;this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"')"})}};[].indexOf||(Array.prototype.indexOf=function(v,n){n=(n==null)?0:n;var m=this.length;for(var i=n;i0&&c>0){e=(Math.round(c/b*10000)/10000)}else{e=null}}}});return e},ResizeConstraint:function(d){var e;this.each(function(){var a=this;if(typeof(d)!='boolean'||!d){a.resizeOptions.ratio=null}else{var b=parseInt(jQuery(a).css('width'))||0;var c=parseInt(jQuery(a).css('height'))||0;if(b>0&&c>0){a.resizeOptions.ratio=(Math.round(c/b*10000)/10000)}else{a.resizeOptions.ratio=null}}})},move:function(e){if(jQuery.iResize.resizeElement==null){return}pointer=jQuery.iUtil.getPointer(e);dx=pointer.x-jQuery.iResize.pointer.x;dy=pointer.y-jQuery.iResize.pointer.y;newSizes={width:jQuery.iResize.sizes.width,height:jQuery.iResize.sizes.height};newPosition={top:jQuery.iResize.position.top,left:jQuery.iResize.position.left};switch(jQuery.iResize.resizeDirection){case'e':newSizes.width=jQuery.iResize.getWidth(dx,1);break;case'se':newSizes.width=jQuery.iResize.getWidth(dx,1);newSizes.height=jQuery.iResize.getHeight(dy,1);break;case'w':newSizes.width=jQuery.iResize.getWidth(dx,-1);newPosition.left=jQuery.iResize.position.left-newSizes.width+jQuery.iResize.sizes.width;break;case'sw':newSizes.width=jQuery.iResize.getWidth(dx,-1);newPosition.left=jQuery.iResize.position.left-newSizes.width+jQuery.iResize.sizes.width;newSizes.height=jQuery.iResize.getHeight(dy,1);break;case'nw':newSizes.height=jQuery.iResize.getHeight(dy,-1);newPosition.top=jQuery.iResize.position.top-newSizes.height+jQuery.iResize.sizes.height;newSizes.width=jQuery.iResize.getWidth(dx,-1);newPosition.left=jQuery.iResize.position.left-newSizes.width+jQuery.iResize.sizes.width;break;case'n':newSizes.height=jQuery.iResize.getHeight(dy,-1);newPosition.top=jQuery.iResize.position.top-newSizes.height+jQuery.iResize.sizes.height;break;case'ne':newSizes.height=jQuery.iResize.getHeight(dy,-1);newPosition.top=jQuery.iResize.position.top-newSizes.height+jQuery.iResize.sizes.height;newSizes.width=jQuery.iResize.getWidth(dx,1);break;case's':newSizes.height=jQuery.iResize.getHeight(dy,1);break}if(jQuery.iResize.resizeElement.resizeOptions.ratio){if(jQuery.iResize.resizeDirection=='n'||jQuery.iResize.resizeDirection=='s')nWidth=newSizes.height*jQuery.iResize.resizeElement.resizeOptions.ratio;else nWidth=newSizes.width;nHeight=jQuery.iResize.getHeightMinMax(nWidth*jQuery.iResize.resizeElement.resizeOptions.ratio);nWidth=nHeight/jQuery.iResize.resizeElement.resizeOptions.ratio;switch(jQuery.iResize.resizeDirection){case'n':case'nw':case'ne':newPosition.top+=newSizes.height-nHeight;break}switch(jQuery.iResize.resizeDirection){case'nw':case'w':case'sw':newPosition.left+=newSizes.width-nWidth;break}newSizes.height=nHeight;newSizes.width=nWidth}if(newPosition.topjQuery.iResize.resizeElement.resizeOptions.maxBottom){newSizes.height=jQuery.iResize.resizeElement.resizeOptions.maxBottom-newPosition.top;if(jQuery.iResize.resizeElement.resizeOptions.ratio){newSizes.width=newSizes.height/jQuery.iResize.resizeElement.resizeOptions.ratio}}if(newPosition.left+newSizes.width>jQuery.iResize.resizeElement.resizeOptions.maxRight){newSizes.width=jQuery.iResize.resizeElement.resizeOptions.maxRight-newPosition.left;if(jQuery.iResize.resizeElement.resizeOptions.ratio){newSizes.height=newSizes.width*jQuery.iResize.resizeElement.resizeOptions.ratio}}var a=false;if(jQuery.iResize.resizeElement.resizeOptions.onResize){a=jQuery.iResize.resizeElement.resizeOptions.onResize.apply(jQuery.iResize.resizeElement,[newSizes,newPosition]);if(a){if(a.sizes){jQuery.extend(newSizes,a.sizes)}if(a.position){jQuery.extend(newPosition,a.position)}}}elS=jQuery.iResize.resizeElement.style;elS.left=newPosition.left+'px';elS.top=newPosition.top+'px';elS.width=newSizes.width+'px';elS.height=newSizes.height+'px';return false},build:function(b){if(!b||!b.handlers||b.handlers.constructor!=Object){return}return this.each(function(){var a=this;a.resizeOptions=b;a.resizeOptions.minWidth=b.minWidth||10;a.resizeOptions.minHeight=b.minHeight||10;a.resizeOptions.maxWidth=b.maxWidth||3000;a.resizeOptions.maxHeight=b.maxHeight||3000;a.resizeOptions.minTop=b.minTop||-1000;a.resizeOptions.minLeft=b.minLeft||-1000;a.resizeOptions.maxRight=b.maxRight||3000;a.resizeOptions.maxBottom=b.maxBottom||3000;elPosition=jQuery(a).css('position');if(!(elPosition=='relative'||elPosition=='absolute')){a.style.position='relative'}directions=/n|ne|e|se|s|sw|w|nw/g;for(i in a.resizeOptions.handlers){if(i.toLowerCase().match(directions)!=null){if(a.resizeOptions.handlers[i].constructor==String){handle=jQuery(a.resizeOptions.handlers[i]);if(handle.size()>0){a.resizeOptions.handlers[i]=handle.get(0)}}if(a.resizeOptions.handlers[i].tagName){a.resizeOptions.handlers[i].resizeElement=a;a.resizeOptions.handlers[i].resizeDirection=i;jQuery(a.resizeOptions.handlers[i]).bind('mousedown',jQuery.iResize.start)}}}if(a.resizeOptions.dragHandle){if(typeof a.resizeOptions.dragHandle==='string'){handleEl=jQuery(a.resizeOptions.dragHandle);if(handleEl.size()>0){handleEl.each(function(){this.dragEl=a});handleEl.bind('mousedown',jQuery.iResize.startDrag)}}else if(a.resizeOptions.dragHandle==true){jQuery(this).bind('mousedown',jQuery.iResize.startDrag)}}})},destroy:function(){return this.each(function(){var a=this;for(i in a.resizeOptions.handlers){a.resizeOptions.handlers[i].resizeElement=null;a.resizeOptions.handlers[i].resizeDirection=null;jQuery(a.resizeOptions.handlers[i]).unbind('mousedown',jQuery.iResize.start)}if(a.resizeOptions.dragHandle){if(typeof a.resizeOptions.dragHandle==='string'){handle=jQuery(a.resizeOptions.dragHandle);if(handle.size()>0){handle.unbind('mousedown',jQuery.iResize.startDrag)}}else if(a.resizeOptions.dragHandle==true){jQuery(this).unbind('mousedown',jQuery.iResize.startDrag)}}a.resizeOptions=null})}};jQuery.fn.extend({Resizable:jQuery.iResize.build,ResizableRatio:jQuery.iResize.ResizeRatio,ResizeConstraint:jQuery.iResize.ResizeConstraint,ResizableDestroy:jQuery.iResize.destroy}); +//interface.js end +//image_editor_general.js start +/*function getModeValue(){var CheckedElem=null;for(var i=0;i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>",""]||!s.J("<7g")&&[1,"<52>",""]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>",""]||!s.J("<2V")&&[2,"<1r><1z>",""]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>",""]||!s.J("<73")&&[2,"<1r><4W>",""]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1o(/^\\s+|\\s+$/g,"")},2L:q(a){u r=[];7(1g a!="6I")E(u i=0,26=a.C;i<26;i++)r.R(a[i]);B r=a.51(0);v r},2w:q(b,a){E(u i=0,26=a.C;i<26;i++)7(a[i]==b)v i;v-1},1T:q(a,b){E(u i=0;b[i];i++)a.R(b[i]);v a},5g:q(a){u r=[],3P=6.1k++;E(u i=0,4G=a.C;i<4G;i++)7(3P!=a[i].1k){a[i].1k=3P;r.R(a[i])}v r},1k:0,2s:q(c,b,d){7(1g b=="1s")b=14 45("a","i","v "+b);u a=[];E(u i=0,30=c.C;i<30;i++)7(!d&&b(c[i],i)||d&&!b(c[i],i))a.R(c[i]);v a},3k:q(c,b){7(1g b=="1s")b=14 45("a","v "+b);u d=[];E(u i=0,30=c.C;i<30;i++){u a=b(c[i],i);7(a!==H&&a!=I){7(a.15!=2b)a=[a];d=d.6v(a)}}v d}});14 q(){u b=6u.6t.2H();6.M={4D:(b.3t(/.+(?:6s|6q|6o|6m)[\\/: ]([\\d.]+)/)||[])[1],20:/5l/.17(b),2a:/2a/.17(b),1h:/1h/.17(b)&&!/2a/.17(b),3j:/3j/.17(b)&&!/(6h|5l)/.17(b)};6.6g=!6.M.1h||P.6f=="6c";6.1U=6.M.1h?"1U":"5x",6.3H={"E":"68","67":"12","3x":6.1U,5x:6.1U,1U:6.1U,27:"27",12:"12",2v:"2v",2r:"2r",2B:"2B",65:"63",2T:"2T",62:"5Z"}};6.F({4v:"a.L",4p:"6.4p(a)",8o:"6.22(a,2,\'1X\')",8n:"6.22(a,2,\'4t\')",8k:"6.4q(a.L.1d,a)",8h:"6.4q(a.1d)"},q(i,n){6.11[i]=q(a){u b=6.3k(9,n);7(a&&1g a=="1s")b=6.2x(a,b);v 9.1Z(b)}});6.F({5o:"3e",8g:"5w",2K:"5t",8f:"5s"},q(i,n){6.11[i]=q(){u a=19;v 9.F(q(){E(u j=0,26=a.C;j<26;j++)6(a[j])[n](9)})}});6.F({5v:q(a){6.1b(9,a,"");9.8d(a)},8c:q(c){6.12.1A(9,c)},88:q(c){6.12.1E(9,c)},87:q(c){6.12[6.12.3w(9,c)?"1E":"1A"](9,c)},1E:q(a){7(!a||6.1i(a,[9]).r.C)9.L.3q(9)},2Y:q(){1v(9.1d)9.3q(9.1d)}},q(i,n){6.11[i]=q(){v 9.F(n,19)}});6.F(["5Q","5P","5O","5N"],q(i,n){6.11[n]=q(a,b){v 9.1i(":"+n+"("+a+")",b)}});6.F(["1u","29"],q(i,n){6.11[n]=q(h){v h==I?(9.C?6.1f(9[0],n):H):9.1f(n,h.15==33?h:h+"4o")}});6.1c({4n:{"":"m[2]==\'*\'||6.Q(a,m[2])","#":"a.35(\'2m\')==m[2]",":":{5P:"im[3]-0",22:"m[3]-0==i",5Q:"m[3]-0==i",2Q:"i==0",2P:"i==r.C-1",5L:"i%2==0",5K:"i%2","2Q-3u":"a.L.3R(\'*\')[0]==a","2P-3u":"6.22(a.L.5J,1,\'4t\')==a","86-3u":"!6.22(a.L.5J,2,\'4t\')",4v:"a.1d",2Y:"!a.1d",5N:"(a.5H||a.85||\'\').J(m[3])>=0",4f:\'"1y"!=a.G&&6.1f(a,"U")!="1P"&&6.1f(a,"48")!="1y"\',1y:\'"1y"==a.G||6.1f(a,"U")=="1P"||6.1f(a,"48")=="1y"\',84:"!a.2r",2r:"a.2r",2B:"a.2B",2T:"a.2T||6.1b(a,\'2T\')",2A:"\'2A\'==a.G",4b:"\'4b\'==a.G",5F:"\'5F\'==a.G",4l:"\'4l\'==a.G",5E:"\'5E\'==a.G",4k:"\'4k\'==a.G",5D:"\'5D\'==a.G",5C:"\'5C\'==a.G",1J:\'"1J"==a.G||6.Q(a,"1J")\',5B:"/5B|2y|82|1J/i.17(a.Q)"},"[":"6.1L(m[2],a).C"},5A:[/^\\[ *(@)([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,14 3o("^([:.#]*)("+(6.2J=6.M.20&&6.M.4D<"3.0.0"?"\\\\w":"(?:[\\\\w\\7Z-\\7X*1I-]|\\\\\\\\.)")+"+)")],2x:q(a,c,b){u d,1K=[];1v(a&&a!=d){d=a;u f=6.1i(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1K=b?c=f.r:6.1T(1K,f.r)}v 1K},1L:q(t,l){7(1g t!="1s")v[t];7(l&&!l.1q)l=H;l=l||P;7(!t.J("//")){l=l.4h;t=t.2G(2,t.C)}B 7(!t.J("/")&&!l.2O){l=l.4h;t=t.2G(1,t.C);7(t.J("/")>=1)t=t.2G(t.J("/"),t.C)}u b=[l],2j=[],2P;1v(t&&2P!=t){u r=[];2P=t;t=6.2C(t).1o(/^\\/\\//,"");u k=N;u g=14 3o("^[/>]\\\\s*("+6.2J+"+)");u m=g.1V(t);7(m){u o=m[1].1D();E(u i=0;b[i];i++)E(u c=b[i].1d;c;c=c.1X)7(c.1q==1&&(o=="*"||c.Q.1D()==o.1D()))r.R(c);b=r;t=t.1o(g,"");7(t.J(" ")==0)7R;k=K}B{g=/^((\\/?\\.\\.)|([>\\/+~]))\\s*([a-z]*)/i;7((m=g.1V(t))!=H){r=[];u o=m[4],1k=6.1k++;m=m[1];E(u j=0,2e=b.C;j<2e;j++)7(m.J("..")<0){u n=m=="~"||m=="+"?b[j].1X:b[j].1d;E(;n;n=n.1X)7(n.1q==1){7(m=="~"&&n.1k==1k)1F;7(!o||n.Q.1D()==o.1D()){7(m=="~")n.1k=1k;r.R(n)}7(m=="+")1F}}B r.R(b[j].L);b=r;t=6.2C(t.1o(g,""));k=K}}7(t&&!k){7(!t.J(",")){7(l==b[0])b.4e();2j=6.1T(2j,b);r=b=[l];t=" "+t.2G(1,t.C)}B{u h=14 3o("^("+6.2J+"+)(#)("+6.2J+"+)");u m=h.1V(t);7(m){m=[0,m[2],m[3],m[1]]}B{h=14 3o("^([#.]?)("+6.2J+"*)");m=h.1V(t)}m[2]=m[2].1o(/\\\\/g,"");u f=b[b.C-1];7(m[1]=="#"&&f&&f.4d){u p=f.4d(m[2]);7((6.M.1h||6.M.2a)&&p&&1g p.2m=="1s"&&p.2m!=m[2])p=6(\'[@2m="\'+m[2]+\'"]\',f)[0];b=r=p&&(!m[3]||6.Q(p,m[3]))?[p]:[]}B{E(u i=0;b[i];i++){u a=m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&b[i].Q.2H()=="7P")a="2E";r=6.1T(r,b[i].3R(a))}7(m[1]==".")r=6.4c(r,m[2]);7(m[1]=="#"){u e=[];E(u i=0;r[i];i++)7(r[i].35("2m")==m[2]){e=[r[i]];1F}r=e}b=r}t=t.1o(h,"")}}7(t){u d=6.1i(t,r);b=r=d.r;t=6.2C(d.t)}}7(t)b=[];7(b&&l==b[0])b.4e();2j=6.1T(2j,b);v 2j},4c:q(r,m,a){m=" "+m+" ";u b=[];E(u i=0;r[i];i++){u c=(" "+r[i].12+" ").J(m)>=0;7(!a&&c||a&&!c)b.R(r[i])}v b},1i:q(t,r,h){u d;1v(t&&t!=d){d=t;u p=6.5A,m;E(u i=0;p[i];i++){m=p[i].1V(t);7(m){t=t.7N(m[0].C);m[2]=m[2].1o(/\\\\/g,"");1F}}7(!m)1F;7(m[1]==":"&&m[2]=="4Y")r=6.1i(m[3],r,K).r;B 7(m[1]==".")r=6.4c(r,m[2],h);B 7(m[1]=="@"){u g=[],G=m[3];E(u i=0,2e=r.C;i<2e;i++){u a=r[i],z=a[6.3H[m[2]]||m[2]];7(z==H||/4M|2u/.17(m[2]))z=6.1b(a,m[2])||\'\';7((G==""&&!!z||G=="="&&z==m[5]||G=="!="&&z!=m[5]||G=="^="&&z&&!z.J(m[5])||G=="$="&&z.2G(z.C-m[5].C)==m[5]||(G=="*="||G=="~=")&&z.J(m[5])>=0)^h)g.R(a)}r=g}B 7(m[1]==":"&&m[2]=="22-3u"){u e=6.1k++,g=[],17=/(\\d*)n\\+?(\\d*)/.1V(m[3]=="5L"&&"2n"||m[3]=="5K"&&"2n+1"||!/\\D/.17(m[3])&&"n+"+m[3]||m[3]),2Q=(17[1]||1)-0,d=17[2]-0;E(u i=0,2e=r.C;i<2e;i++){u j=r[i],L=j.L;7(e!=L.1k){u c=1;E(u n=L.1d;n;n=n.1X)7(n.1q==1)n.4a=c++;L.1k=e}u b=N;7(2Q==1){7(d==0||j.4a==d)b=K}B 7((j.4a+d)%2Q==0)b=K;7(b^h)g.R(j)}r=g}B{u f=6.4n[m[1]];7(1g f!="1s")f=6.4n[m[1]][m[2]];49("f = q(a,i){v "+f+"}");r=6.2s(r,f,h)}}v{r:r,t:t}},4p:q(c){u b=[];u a=c.L;1v(a&&a!=P){b.R(a);a=a.L}v b},22:q(a,e,c,b){e=e||1;u d=0;E(;a;a=a[c])7(a.1q==1&&++d==e)1F;v a},4q:q(n,a){u r=[];E(;n;n=n.1X){7(n.1q==1&&(!a||n!=a))r.R(n)}v r}});6.S={1A:q(d,e,c,b){7(6.M.1h&&d.3m!=I)d=18;7(!c.1Q)c.1Q=9.1Q++;7(b!=I){u f=c;c=q(){v f.O(9,19)};c.W=b;c.1Q=f.1Q}7(!d.$1a)d.$1a={};7(!d.$1p)d.$1p=q(){u a;7(1g 6=="I"||6.S.47)v a;a=6.S.1p.O(d,19);v a};u g=d.$1a[e];7(!g){g=d.$1a[e]={};7(d.46)d.46(e,d.$1p,N);B d.7M("5r"+e,d.$1p)}g[c.1Q]=c;7(!9.Y[e])9.Y[e]=[];7(6.2w(d,9.Y[e])==-1)9.Y[e].R(d)},1Q:1,Y:{},1E:q(b,c,a){u d=b.$1a,1Y,2p;7(d){7(c&&c.G){a=c.44;c=c.G}7(!c){E(c V d)9.1E(b,c)}B 7(d[c]){7(a)3l d[c][a.1Q];B E(a V b.$1a[c])3l d[c][a];E(1Y V d[c])1F;7(!1Y){7(b.43)b.43(c,b.$1p,N);B b.7J("5r"+c,b.$1p);1Y=H;3l d[c];1v(9.Y[c]&&((2p=6.2w(b,9.Y[c]))>=0))3l 9.Y[c][2p]}}E(1Y V d)1F;7(!1Y)b.$1p=b.$1a=H}},1t:q(c,b,d){b=6.2L(b||[]);7(!d)6.F(9.Y[c]||[],q(){6.S.1t(c,b,9)});B{u a,1Y,11=6.16(d[c]||H);b.5p(9.42({G:c,1O:d}));7(6.16(d.$1p)&&(a=d.$1p.O(d,b))!==N)9.47=K;7(11&&a!==N&&!6.Q(d,\'a\'))d[c]();9.47=N}},1p:q(b){u a;b=6.S.42(b||18.S||{});u c=9.$1a&&9.$1a[b.G],1S=[].51.3D(19,1);1S.5p(b);E(u j V c){1S[0].44=c[j];1S[0].W=c[j].W;7(c[j].O(9,1S)===N){b.2d();b.2D();a=N}}7(6.M.1h)b.1O=b.2d=b.2D=b.44=b.W=H;v a},42:q(c){u a=c;c=6.1c({},a);c.2d=q(){7(a.2d)v a.2d();a.7H=N};c.2D=q(){7(a.2D)v a.2D();a.7F=K};7(!c.1O&&c.5n)c.1O=c.5n;7(6.M.20&&c.1O.1q==3)c.1O=a.1O.L;7(!c.41&&c.4j)c.41=c.4j==c.1O?c.7C:c.4j;7(c.5k==H&&c.5j!=H){u e=P.4h,b=P.4y;c.5k=c.5j+(e&&e.5i||b.5i);c.7z=c.7y+(e&&e.5f||b.5f)}7(!c.3h&&(c.5e||c.5d))c.3h=c.5e||c.5d;7(!c.5c&&c.5b)c.5c=c.5b;7(!c.3h&&c.1J)c.3h=(c.1J&1?1:(c.1J&2?3:(c.1J&4?2:0)));v c}};6.11.1c({3g:q(c,a,b){v c=="3z"?9.3Z(c,a,b):9.F(q(){6.S.1A(9,c,b||a,b&&a)})},3Z:q(d,b,c){v 9.F(q(){6.S.1A(9,d,q(a){6(9).3U(a);v(c||b).O(9,19)},c&&b)})},3U:q(a,b){v 9.F(q(){6.S.1E(9,a,b)})},1t:q(a,b){v 9.F(q(){6.S.1t(a,b,9)})},1R:q(){u a=19;v 9.5a(q(e){9.4u=0==9.4u?1:0;e.2d();v a[9.4u].O(9,[e])||N})},7w:q(f,g){q 3W(e){u p=e.41;1v(p&&p!=9)2g{p=p.L}25(e){p=9};7(p==9)v N;v(e.G=="3V"?f:g).O(9,[e])}v 9.3V(3W).59(3W)},1G:q(f){7(6.3d)f.O(P,[6]);B 6.2q.R(q(){v f.O(9,[6])});v 9}});6.1c({3d:N,2q:[],1G:q(){7(!6.3d){6.3d=K;7(6.2q){6.F(6.2q,q(){9.O(P)});6.2q=H}7(6.M.3j||6.M.2a)P.43("58",6.1G,N);7(!18.7v.C)6(18).1W(q(){6("#3T").1E()})}}});14 q(){6.F(("7u,7t,1W,7s,7r,3z,5a,7q,"+"7p,7o,7n,3V,59,7m,2y,"+"4k,7l,7k,7j,2c").2R(","),q(i,o){6.11[o]=q(f){v f?9.3g(o,f):9.1t(o)}});7(6.M.3j||6.M.2a)P.46("58",6.1G,N);B 7(6.M.1h){P.7i("<7h"+"7f 2m=3T 7e=K "+"2u=//:><\\/3b>");u a=P.4d("3T");7(a)a.7d=q(){7(9.3a!="1n")v;6.1G()};a=H}B 7(6.M.20)6.3N=3m(q(){7(P.3a=="79"||P.3a=="1n"){3M(6.3N);6.3N=H;6.1G()}},10);6.S.1A(18,"1W",6.1G)};7(6.M.1h)6(18).3Z("3z",q(){u a=6.S.Y;E(u b V a){u c=a[b],i=c.C;7(i&&b!=\'3z\')77 c[i-1]&&6.S.1E(c[i-1],b);1v(--i)}});6.11.1c({76:q(c,b,a){9.1W(c,b,a,1)},1W:q(g,d,c,e){7(6.16(g))v 9.3g("1W",g);c=c||q(){};u f="3K";7(d)7(6.16(d)){c=d;d=H}B{d=6.2E(d);f="50"}u h=9;6.2Z({1C:g,G:f,W:d,2t:e,1n:q(a,b){7(b=="28"||!e&&b=="4V")h.1b("27",a.3c).3J().F(c,[a.3c,b,a]);B c.O(h,[a.3c,b,a])}});v 9},72:q(){v 6.2E(9)},3J:q(){v 9.1L("3b").F(q(){7(9.2u)6.4U(9.2u);B 6.3I(9.2A||9.5H||9.27||"")}).2U()}});6.F("4T,4I,4S,4R,4Q,4P".2R(","),q(i,o){6.11[o]=q(f){v 9.3g(o,f)}});6.1c({1M:q(e,c,a,d,b){7(6.16(c)){a=c;c=H}v 6.2Z({G:"3K",1C:e,W:c,28:a,3G:d,2t:b})},6X:q(d,b,a,c){v 6.1M(d,b,a,c,1)},4U:q(b,a){v 6.1M(b,H,a,"3b")},6V:q(c,b,a){v 6.1M(c,b,a,"4N")},6T:q(d,b,a,c){7(6.16(b)){a=b;b={}}v 6.2Z({G:"50",1C:d,W:b,28:a,3G:c})},6S:q(a){6.36.21=a},6Q:q(a){6.1c(6.36,a)},36:{Y:K,G:"3K",21:0,4O:"6P/x-6O-34-6N",4K:K,38:K,W:H},32:{},2Z:q(s){s=6.1c({},6.36,s);7(s.W){7(s.4K&&1g s.W!="1s")s.W=6.2E(s.W);7(s.G.2H()=="1M"){s.1C+=((s.1C.J("?")>-1)?"&":"?")+s.W;s.W=H}}7(s.Y&&!6.3L++)6.S.1t("4T");u f=N;u h=18.4Z?14 4Z("6L.6J"):14 4J();h.7b(s.G,s.1C,s.38);7(s.W)h.3Q("6H-6G",s.4O);7(s.2t)h.3Q("6F-3O-6D",6.32[s.1C]||"6C, 6B 6A 6z 4r:4r:4r 6y");h.3Q("X-6x-6w","4J");7(s.56)s.56(h);7(s.Y)6.S.1t("4P",[h,s]);u g=q(d){7(h&&(h.3a==4||d=="21")){f=K;7(i){3M(i);i=H}u c;2g{c=6.54(h)&&d!="21"?s.2t&&6.4F(h,s.1C)?"4V":"28":"2c";7(c!="2c"){u b;2g{b=h.3E("53-3O")}25(e){}7(s.2t&&b)6.32[s.1C]=b;u a=6.55(h,s.3G);7(s.28)s.28(a,c);7(s.Y)6.S.1t("4Q",[h,s])}B 6.2X(s,h,c)}25(e){c="2c";6.2X(s,h,c,e)}7(s.Y)6.S.1t("4S",[h,s]);7(s.Y&&!--6.3L)6.S.1t("4I");7(s.1n)s.1n(h,c);7(s.38)h=H}};u i=3m(g,13);7(s.21>0)4C(q(){7(h){h.6r();7(!f)g("21")}},s.21);2g{h.6p(s.W)}25(e){6.2X(s,h,H,e)}7(!s.38)g();v h},2X:q(s,a,b,e){7(s.2c)s.2c(a,b,e);7(s.Y)6.S.1t("4R",[a,s,e])},3L:0,54:q(r){2g{v!r.23&&7A.7B=="4l:"||(r.23>=5u&&r.23<6l)||r.23==5m||6.M.20&&r.23==I}25(e){}v N},4F:q(a,c){2g{u b=a.3E("53-3O");v a.23==5m||b==6.32[c]||6.M.20&&a.23==I}25(e){}v N},55:q(r,b){u c=r.3E("6k-G");u a=!b&&c&&c.J("4B")>=0;a=b=="4B"||a?r.6j:r.3c;7(b=="3b")6.3I(a);7(b=="4N")a=49("("+a+")");7(b=="3F")6("<1x>").3F(a).3J();v a},2E:q(a){u s=[];7(a.15==2b||a.3C)6.F(a,q(){s.R(2l(9.6i)+"="+2l(9.2v))});B E(u j V a)7(a[j]&&a[j].15==2b)6.F(a[j],q(){s.R(2l(j)+"="+2l(9))});B s.R(2l(j)+"="+2l(a[j]));v s.5M("&")},3I:q(a){7(18.4A)18.4A(a);B 7(6.M.20)18.4C(a,0);B 49.3D(18,a)}});6.11.1c({1m:q(b,a){v b?9.1w({1u:"1m",29:"1m",1e:"1m"},b,a):9.1i(":1y").F(q(){9.T.U=9.2i?9.2i:"";7(6.1f(9,"U")=="1P")9.T.U="2h"}).2U()},1j:q(b,a){v b?9.1w({1u:"1j",29:"1j",1e:"1j"},b,a):9.1i(":4f").F(q(){9.2i=9.2i||6.1f(9,"U");7(9.2i=="1P")9.2i="2h";9.T.U="1P"}).2U()},5G:6.11.1R,1R:q(a,b){v 6.16(a)&&6.16(b)?9.5G(a,b):a?9.1w({1u:"1R",29:"1R",1e:"1R"},a,b):9.F(q(){6(9)[6(9).37(":1y")?"1m":"1j"]()})},6e:q(b,a){v 9.1w({1u:"1m"},b,a)},6d:q(b,a){v 9.1w({1u:"1j"},b,a)},6b:q(b,a){v 9.1w({1u:"1R"},b,a)},6a:q(b,a){v 9.1w({1e:"1m"},b,a)},69:q(b,a){v 9.1w({1e:"1j"},b,a)},7U:q(c,a,b){v 9.1w({1e:a},c,b)},1w:q(d,h,f,g){v 9.1l(q(){u c=6(9).37(":1y"),1H=6.5z(h,f,g),5y=9;E(u p V d){7(d[p]=="1j"&&c||d[p]=="1m"&&!c)v 6.16(1H.1n)&&1H.1n.O(9);7(p=="1u"||p=="29"){1H.U=6.1f(9,"U");1H.2f=9.T.2f}}7(1H.2f!=H)9.T.2f="1y";9.2k=6.1c({},d);6.F(d,q(a,b){u e=14 6.2M(5y,1H,a);7(b.15==3y)e.2W(e.1K(),b);B e[b=="1R"?c?"1m":"1j":b](d)})})},1l:q(a,b){7(!b){b=a;a="2M"}v 9.F(q(){7(!9.1l)9.1l={};7(!9.1l[a])9.1l[a]=[];9.1l[a].R(b);7(9.1l[a].C==1)b.O(9)})}});6.1c({5z:q(b,a,c){u d=b&&b.15==64?b:{1n:c||!c&&a||6.16(b)&&b,1B:b,2I:c&&a||a&&a.15!=45&&a||(6.2I.4i?"4i":"4w")};d.1B=(d.1B&&d.1B.15==3y?d.1B:{61:60,89:5u}[d.1B])||8a;d.2N=d.1n;d.1n=q(){6.5I(9,"2M");7(6.16(d.2N))d.2N.O(9)};v d},2I:{4w:q(p,n,b,a){v b+a*p},4i:q(p,n,b,a){v((-5W.5X(p*5W.8e)/2)+0.5)*a+b}},1l:{},5I:q(b,a){a=a||"2M";7(b.1l&&b.1l[a]){b.1l[a].4e();u f=b.1l[a][0];7(f)f.O(b)}},3B:[],2M:q(f,e,g){u z=9;u y=f.T;z.a=q(){7(e.3A)e.3A.O(f,[z.2o]);7(g=="1e")6.1b(y,"1e",z.2o);B{y[g]=8m(z.2o)+"4o";y.U="2h"}};z.5V=q(){v 39(6.1f(f,g))};z.1K=q(){u r=39(6.2z(f,g));v r&&r>-8l?r:z.5V()};z.2W=q(c,b){z.4s=(14 5T()).5S();z.2o=c;z.a();6.3B.R(q(){v z.3A(c,b)});7(6.3B.C==1){u d=3m(q(){u a=6.3B;E(u i=0;ie.1B+z.4s){z.2o=c;z.a();7(f.2k)f.2k[g]=K;u b=K;E(u i V f.2k)7(f.2k[i]!==K)b=N;7(b){7(e.U!=H){y.2f=e.2f;y.U=e.U;7(6.1f(f,"U")=="1P")y.U="2h"}7(e.1j)y.U="1P";7(e.1j||e.1m)E(u p V f.2k)6.1b(y,p,f.24[p])}7(b&&6.16(e.1n))e.1n.O(f);v N}B{u n=t-9.4s;u p=n/e.1B;z.2o=6.2I[e.2I](p,n,a,(c-a),e.1B);z.a()}v K}}})}',62,524,'||||||jQuery|if||this|||||||||||||||||function||||var|return||||||else|length||for|each|type|null|undefined|indexOf|true|parentNode|browser|false|apply|document|nodeName|push|event|style|display|in|data||global|||fn|className||new|constructor|isFunction|test|window|arguments|events|attr|extend|firstChild|opacity|css|typeof|msie|filter|hide|mergeNum|queue|show|complete|replace|handle|nodeType|table|string|trigger|height|while|animate|div|hidden|tbody|add|duration|url|toUpperCase|remove|break|ready|opt|_|button|cur|find|get|tb|target|none|guid|toggle|args|merge|styleFloat|exec|load|nextSibling|ret|pushStack|safari|timeout|nth|status|orig|catch|al|innerHTML|success|width|opera|Array|error|preventDefault|rl|overflow|try|block|oldblock|done|curAnim|encodeURIComponent|id||now|index|readyList|disabled|grep|ifModified|src|value|inArray|multiFilter|select|curCSS|text|checked|trim|stopPropagation|param|domManip|substr|toLowerCase|easing|chars|insertBefore|makeArray|fx|old|ownerDocument|last|first|split|childNodes|selected|end|tr|custom|handleError|empty|ajax|el|clean|lastModified|String|form|getAttribute|ajaxSettings|is|async|parseFloat|readyState|script|responseText|isReady|append|defaultView|bind|which|position|mozilla|map|delete|setInterval|static|RegExp|oWidth|removeChild|oHeight|cloneNode|match|child|toString|has|float|Number|unload|step|timers|jquery|call|getResponseHeader|html|dataType|props|globalEval|evalScripts|GET|active|clearInterval|safariTimer|Modified|num|setRequestHeader|getElementsByTagName|currentStyle|__ie_init|unbind|mouseover|handleHover|init|getComputedStyle|one|isXMLDoc|relatedTarget|fix|removeEventListener|handler|Function|addEventListener|triggered|visibility|eval|nodeIndex|radio|classFilter|getElementById|shift|visible|appendChild|documentElement|swing|fromElement|submit|file|swap|expr|px|parents|sibling|00|startTime|previousSibling|lastToggle|parent|linear|ol|body|tagName|execScript|xml|setTimeout|version|setArray|httpNotModified|fl|prop|ajaxStop|XMLHttpRequest|processData|alpha|href|json|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxComplete|ajaxStart|getScript|notmodified|colgroup|100|not|ActiveXObject|POST|slice|fieldset|Last|httpSuccess|httpData|beforeSend|getPropertyValue|DOMContentLoaded|mouseout|click|ctrlKey|metaKey|keyCode|charCode|scrollTop|unique|createElement|scrollLeft|clientX|pageX|webkit|304|srcElement|appendTo|unshift|prevObject|on|after|before|200|removeAttr|prepend|cssFloat|self|speed|parse|input|reset|image|password|checkbox|_toggle|textContent|dequeue|lastChild|odd|even|join|contains|gt|lt|eq|nodeValue|getTime|Date|zoom|max|Math|cos|font|maxLength|600|slow|maxlength|readOnly|Object|readonly|createTextNode|class|htmlFor|fadeOut|fadeIn|slideToggle|CSS1Compat|slideUp|slideDown|compatMode|boxModel|compatible|name|responseXML|content|300|ie|noConflict|ra|send|it|abort|rv|userAgent|navigator|concat|With|Requested|GMT|1970|Jan|01|Thu|Since|reverse|If|Type|Content|array|XMLHTTP|ig|Microsoft|NaN|urlencoded|www|application|ajaxSetup|val|ajaxTimeout|post|setAttribute|getJSON|getAttributeNode|getIfModified|method|FORM|action|options|serialize|col|th|td|loadIfModified|do|colg|loaded|tfoot|open|thead|onreadystatechange|defer|ipt|leg|scr|write|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|dblclick|scroll|resize|focus|blur|frames|hover|clone|clientY|pageY|location|protocol|toElement|clientWidth|clientHeight|cancelBubble|relative|returnValue|left|detachEvent|right|absolute|attachEvent|substring|offsetWidth|object|offsetHeight|continue|Width|border|fadeTo|padding|size|uFFFF|Left|u0128|Right|Bottom|textarea|Top|enabled|innerText|only|toggleClass|removeClass|fast|400|wrap|addClass|removeAttribute|PI|insertAfter|prependTo|children|line|splice|siblings|10000|parseInt|prev|next|weight|1px|prototype'.split('|'),0,{})); //jquery.js end + //form.js start +(function($){$.fn.ajaxSubmit=function(o){if(typeof o=='function')o={success:o};o=$.extend({url:this.attr('action')||window.location,type:this.attr('method')||'GET'},o||{});var a=this.formToArray(o.semantic);if(o.beforeSubmit&&o.beforeSubmit(a,this,o)===false)return this;var p={};$.event.trigger('form.submit.validate',[a,this,o,p]);if(p.veto)return this;var q=$.param(a);if(o.type.toUpperCase()=='GET'){o.url+=(o.url.indexOf('?')>=0?'&':'?')+q;o.data=null}else o.data=q;var r=this,callbacks=[];if(o.resetForm)callbacks.push(function(){r.resetForm()});if(o.clearForm)callbacks.push(function(){r.clearForm()});if(!o.dataType&&o.target){var u=o.success;callbacks.push(function(a){$(o.target).attr("innerHTML",a).evalScripts().each(u,arguments)})}else if(o.success)callbacks.push(o.success);o.success=function(a,b){for(var i=0,max=callbacks.length;i');var j=i[0];var k=$.browser.opera&&window.opera.version()<9;if($.browser.msie||k)j.src='javascript:false;document.write("");';i.css({position:'absolute',top:'-1000px',left:'-1000px'});var l={responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=f.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[l,f]);var m=0;var n=0;setTimeout(function(){i.appendTo('body');j.attachEvent?j.attachEvent('onload',cb):j.addEventListener('load',cb,false);var a=d.encoding?'encoding':'enctype';var t=r.attr('target');r.attr({target:h,method:'POST',encAttr:'multipart/form-data',action:f.url});if(f.timeout)setTimeout(function(){n=true;cb()},f.timeout);d.submit();r.attr('target',t)},10);function cb(){if(m++)return;j.detachEvent?j.detachEvent('onload',cb):j.removeEventListener('load',cb,false);var a=true;try{if(n)throw'timeout';var b,doc;doc=j.contentWindow?j.contentWindow.document:j.contentDocument?j.contentDocument:j.document;l.responseText=doc.body?doc.body.innerHTML:null;l.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(f.dataType=='json'||f.dataType=='script'){var c=doc.getElementsByTagName('textarea')[0];b=c?c.value:l.responseText;if(f.dataType=='json')eval("data = "+b);else $.globalEval(b)}else if(f.dataType=='xml'){b=l.responseXML;if(!b&&l.responseText!=null)b=toXml(l.responseText)}else{b=l.responseText}}catch(e){a=false;$.handleError(f,l,'error',e)}if(a){f.success(b,'success');if(g)$.event.trigger("ajaxSuccess",[l,f])}if(g)$.event.trigger("ajaxComplete",[l,f]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(f.complete)f.complete(l,a?'success':'error');setTimeout(function(){i.remove();l.responseXML=null},100)};function toXml(s,a){if(window.ActiveXObject){a=new ActiveXObject('Microsoft.XMLDOM');a.async='false';a.loadXML(s)}else a=(new DOMParser()).parseFromString(s,'text/xml');return(a&&a.documentElement&&a.documentElement.tagName!='parsererror')?a:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(a){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=a;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var a=this.form;a.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){a.clk_x=e.offsetX;a.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var b=$(this).offset();a.clk_x=e.pageX-b.left;a.clk_y=e.pageY-b.top}else{a.clk_x=e.pageX-this.offsetLeft;a.clk_y=e.pageY-this.offsetTop}}setTimeout(function(){a.clk=a.clk_x=a.clk_y=null},10)};function submitHandler(){var a=this.formPluginId;var b=$.fn.ajaxForm.optionHash[a];$(this).ajaxSubmit(b);return false};$.fn.ajaxFormUnbind=function(){this.unbind('submit',submitHandler);return this.each(function(){$(":submit,input:image",this).unbind('click',clickHandler)})};$.fn.formToArray=function(b){var a=[];if(this.length==0)return a;var c=this[0];var d=b?c.getElementsByTagName('*'):c.elements;if(!d)return a;for(var i=0,max=d.length;i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.u.G=6(){4 e=6(a,v,t,b){4 c=P.Q("R");c.j=v,c.C=t;4 o=a.x;4 d=o.l;3(!a.n){a.n={};p(4 i=0;i=2){3(8(a[1])=="H")f=a[1];h 3(8(a[2])=="H")f=a[2];3(!m){v=a[0];t=a[1]}}5.y(6(){3(5.A.s()!="B")7;3(m){p(4 a S g){e(5,a,g[a],f)}}h{e(5,v,t,f)}});7 5};$.u.T=6(b,c,d,e,f){3(8(b)!="D")7 5;3(8(c)!="z")c={};3(8(d)!="H")d=9;5.y(6(){4 a=5;$.U(b,c,6(r){$(a).G(r,d);3(8 e=="6"){3(8 f=="z"){e.V(a,f)}h{e.I(a)}}})});7 5};$.u.W=6(){4 a=N;3(a.l==0)7 5;4 d=8(a[0]);4 v,i;3(d=="D"||d=="z"||d=="6")v=a[0];h 3(d=="X")i=a[0];h 7 5;5.y(6(){3(5.A.s()!="B")7;3(5.n)5.n=O;4 b=q;4 o=5.x;3(!!v){4 c=o.l;p(4 i=c-1;i>=0;i--){3(v.J==K){3(o[i].j.L(v)){b=9}}h 3(o[i].j==v){b=9}3(b&&a[1]===9)b=o[i].k;3(b){o[i]=O}b=q}}h{3(b&&a[1]===9)b=o[i].k;3(b){5.Y(i)}}});7 5};$.u.Z=6(f){4 a=8(f)=="M"?9:!!f;5.y(6(){3(5.A.s()!="B")7;4 o=5.x;4 d=o.l;4 e=[];p(4 i=0;iF?-1:1}});p(4 i=0;i').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])F('bind');A.push(s);o.css('cursor','wait')}else if(c.overlay>0)h.w.jqmAddClose(o);else o=false;h.o=(o)?o.addClass(c.overlayClass).appendTo('body'):false;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'")}}if(c.ajax){var r=c.target,u=c.ajax;r=(r)?(typeof r=='string')?$(r,h.w):$(r):h.w;u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h)})}else if(cc)h.w.jqmAddClose($(cc,h.w));(c.onShow)?c.onShow(h):h.w.show();e(h);return false},close:function(s){var h=H[s];h.a=false;if(A[0]){A.pop();if(!A[0])F('unbind')}if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove()}return false}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&typeof XMLHttpRequest=='function',i=$('').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('

').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h)},f=function(h){h.f=$(':input:visible:first',h.w)[0];if(h.f)h.f.focus()},F=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m)},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r},hs=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)});$(e).each(function(){if(this[y])$.extend(this[y],s);else{this[y]=s;$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false})}})}})(jQuery); +//jqModal.js end +//ajax_text_editor_general.js start +function save(id,text){jQuery('#text').val(text);jQuery('#save_as_request').val('0');jQuery('#name').val(currentName);jQuery('#folder').val(currentFolder);do_save(false)};function do_save(saveAsRequest){jQuery('#windowProcessing').jqmShow();var options={dataType:'json',error:function(data,status,e){alert(e)},success:function(data){if(typeof(data.error)=='undefined'){alert('Unexpected information ');if(typeof(saveAsRequest)=='boolean'&&saveAsRequest){jQuery('#windowSaveAs').jqmShow()}}else if(data.error!=''){alert(data.error);jQuery('#windowProcessing').jqmHide();if(typeof(saveAsRequest)=='boolean'&&saveAsRequest){jQuery('#windowSaveAs').jqmShow()}}else{jQuery('#windowProcessing').jqmHide();jQuery('#windowSaveAs').jqmHide();currentFolder=data.folder;currentName=data.name}}};jQuery('#frmProcessing').ajaxSubmit(options)};function save_as(id,text){jQuery('#text').val(text);jQuery('#windowSaveAs').jqmShow();var saveTo=jQuery('#save_to');jQuery(saveTo).removeOption(/./);jQuery(saveTo).ajaxAddOption(urlGetFolderList,{},false,function(){jQuery(saveTo).selectOptions(currentFolder)})};function do_save_as(){var pattern=/^[A-Za-z0-9_ \-]+$/i;var newName=jQuery('#new_name');var saveAs=jQuery('#save_to').get(0);var ext=jQuery('#ext').get(0);if(!pattern.test(jQuery(newName).val())){alert(warningInvalidName)}else if(saveAs.selectedIndex<0){alert(waringFolderNotSelected)}else if(ext.selectedIndex<0){alert(warningExtNotSelected)}else{jQuery('#name').val(jQuery(newName).val()+"."+ext.options[ext.selectedIndex].value);jQuery('#folder').val(saveAs.options[saveAs.selectedIndex].value);jQuery('#save_as_request').val('1');jQuery('#windowSaveAs').jqmHide();do_save(true)}return false}; +//ajax_text_editor_general.js end \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/calendar.js b/admin-dev/ajaxfilemanager/jscripts/calendar.js new file mode 100755 index 000000000..0be7bb9e2 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/calendar.js @@ -0,0 +1,6 @@ +/* MarcGrabanski.com v2.7 */ +/* Pop-Up Calendar Built from Scratch by Marc Grabanski */ +/* Enhanced by Keith Wood (kbwood@iprimus.com.au). */ +/* Under the Creative Commons Licence http://creativecommons.org/licenses/by/3.0/ + Share or Remix it but please Attribute the authors. */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('I 2m(){8.3t=0;8.2h=[];8.1L=O;8.1i=[];8.1t=X;8.1v=X;8.2g=[];8.2g[\'\']={2Q:\'5R\',3R:\'5p\',2u:\'&58;51\',2H:\'4D&4z;\',3d:\'4t\',2k:[\'4o\',\'4k\',\'4g\',\'4a\',\'5P\',\'5G\',\'5D\'],3O:[\'5o\',\'5l\',\'5j\',\'5d\',\'57\',\'56\',\'50\',\'4V\',\'4P\',\'4J\',\'4C\',\'4A\'],1R:\'4x/\'};8.1E={3f:\'1z\',3c:\'\',31:\'...\',30:\'\',2W:X,2U:1c,2R:X,2P:1c,2N:1c,2K:\'-10:+10\',2I:0,3Z:1c,3W:X,28:O,26:O,1J:\'5u\',3M:O,3K:O,2w:O};$.14(8.1E,8.2g[\'\']);8.S=$(\'\');$(1d.1r).1K(8.S);$(1d.1r).55(8.3F)}$.14(2m.3I,{3q:I(a){F b=8.3t++;8.2h[b]=a;N b},U:I(a){N 8.2h[a]||a},4F:I(a){$.14(8.1E,a||{})},2p:I(e){F a=G.U(8.1g);H(G.1t){4y(e.2l){1a 9:G.1q(a,\'\');11;1a 13:G.1P(a);11;1a 27:G.1q(a,a.J(\'1J\'));11;1a 33:G.T(a,-1,(e.1j?\'Y\':\'M\'));11;1a 34:G.T(a,+1,(e.1j?\'Y\':\'M\'));11;1a 35:H(e.1j)G.2y(a);11;1a 36:H(e.1j)G.2B(a);11;1a 37:H(e.1j)G.T(a,-1,\'D\');11;1a 38:H(e.1j)G.T(a,-7,\'D\');11;1a 39:H(e.1j)G.T(a,+1,\'D\');11;1a 40:H(e.1j)G.T(a,+7,\'D\');11}}19 H(e.2l==36&&e.1j){G.1A(8)}},2J:I(e){F a=G.U(8.1g);F b=45.5N(e.43==5K?e.2l:e.43);N(b<\' \'||b==a.J(\'1R\').1k(3)||(b>=\'0\'&&b<=\'9\'))},3U:I(a,b){F c=$(a);F d=b.J(\'3c\');H(d){c.3Q(\'<1F K="5v">\'+d+\'\')}F e=b.J(\'3f\');H(e==\'1z\'||e==\'2r\'){c.1z(8.1A)}H(e==\'1x\'||e==\'2r\'){F f=b.J(\'31\');F g=b.J(\'30\');F h=b.J(\'2W\');F i=$(h?\'<20 K="1s" 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':\'<1x 2a="1x" K="1s">\'+(g!=\'\'?\'<20 2v="\'+g+\'" 3E="\'+f+\'" 3C="\'+f+\'"/>\':f)+\'\');c.5i(\'<1F K="5h">\').3Q(i);i.5f(8.1A)}c.3z(8.2p).5c(8.2J);c[0].1g=b.R},3w:I(a,b){$(a).1K(b.S);a.1g=b.R;F c=P W();b.17=c.16();b.Q=c.1b();b.L=c.15();G.T(b)},53:I(a,b,c,d){F e=8.3r;H(!e){e=8.3r=P 1H({},X);8.1m=$(\'<1I 2a="4U" 4S="1" 3N="2C: 2q; 25: -3X;"/>\');8.1m.3z(8.2p);$(\'1r\').1K(8.1m);8.1m[0].1g=e.R}$.14(e.1l,c||{});8.1m.2G(a);H(2F.41){1W=2F.4B;1V=2F.41}19 H(1d.1U&&1d.1U.2o){1W=1d.1U.3m;1V=1d.1U.2o}19 H(1d.1r){1W=1d.1r.3m;1V=1d.1r.2o}8.1h=d||[(1W/2)-3l,(1V/2)-3l];8.1m.18(\'2n\',8.1h[0]+\'1S\').18(\'25\',8.1h[1]+\'1S\');e.1l.2w=b;8.1v=1c;8.S.3k(\'3j\');8.1A(8.1m[0]);H($.1C){$.1C(8.S)}},4w:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=X;$(\'../1x.1s\',8).1D(I(){8.1Q=X});$(\'../20.1s\',8).18({3h:\'1.0\',3g:\'\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)})})},4v:I(c){c=(c.3i?c:$(c));c.1D(I(){8.1Q=1c;$(\'../1x.1s\',8).1D(I(){8.1Q=1c});$(\'../20.1s\',8).18({3h:\'0.5\',3g:\'4u\'});F b=8;G.1i=$.3e(G.1i,I(a){N(a==b?O:a)});G.1i[G.1i.1B]=8})},4s:I(a,b){F c=8.U(a.1g);H(c){$.14(c.1l,b||{});8.1w(c)}},4r:I(a,b){F c=8.U(a.1g);H(c){c.3b(b)}},4q:I(a){F b=8.U(a.1g);N(b?b.3a():O)},1A:I(a){F b=(a.1O&&a.1O.2j()==\'1I\'?a:8);H(b.1O.2j()!=\'1I\'){b=$(\'1I\',b.4p)[0]}H(G.2i==b){N}1f(F i=0;i0&&b<6),\'\']},2Y:I(a){H(a.2a==\'2e\'){a=a.5E}F b=1N=0;H(a.3T){b=a.3S;1N=a.2X;5B(a=a.3T){F c=b;b+=a.3S;H(b<0){b=c}1N+=a.2X}}N[b,1N]}});I 1H(a,b){8.R=G.3q(8);8.17=0;8.Q=0;8.L=0;8.Z=O;8.1G=b;8.S=(!b?G.S:$(\'\'));H(b){F c=P W();8.1n=c.16();8.1o=c.1b();8.1p=c.15()}8.1l=$.14({},a||{})}$.14(1H.3I,{J:I(a){N(8.1l[a]!=O?8.1l[a]:G.1E[a])},2Z:I(a){8.Z=$(a);F b=8.J(\'1R\');F c=8.Z.2G().3P(b.1k(3));H(c.1B==3){8.1n=1u(c[b.2A(\'D\')],10);8.1o=1u(c[b.2A(\'M\')],10)-1;8.1p=1u(c[b.2A(\'Y\')],10)}19{F d=P W();8.1n=d.16();8.1o=d.1b();8.1p=d.15()}8.17=8.1n;8.Q=8.1o;8.L=8.1p;8.T()},3b:I(a){8.17=8.1n=a.16();8.Q=8.1o=a.1b();8.L=8.1p=a.15();8.T()},3a:I(){N P W(8.1p,8.1o,8.1n)},2T:I(){F a=P W();a=P W(a.15(),a.1b(),a.16());F b=\'\'+\'\'+8.J(\'2Q\')+\'\'+\'\'+8.J(\'3R\')+\'\';F c=8.J(\'2O\');F d=8.J(\'2U\');F e=8.J(\'2R\');F f=(c?\'\'+c+\'\':\'\')+(d&&!8.1G?b:\'\')+\'\'+(8.2t(-1)?\'\'+8.J(\'2u\')+\'\':(e?\'\':\'<1T K="3L">\'+8.J(\'2u\')+\'\'))+(8.2x(a)?\'\'+8.J(\'3d\')+\'\':\'\')+(8.2t(+1)?\'\'+8.J(\'2H\')+\'\':(e?\'\':\'<1T K="3J">\'+8.J(\'2H\')+\'\'))+\'\';F g=8.J(\'28\');F h=8.J(\'26\');F i=8.J(\'3O\');H(!8.J(\'2P\')){f+=i[8.Q]+\'&3G;\'}19{F j=(g&&g.15()==8.L);F k=(h&&h.15()==8.L);f+=\'<1X K="5k" \'+\'3D="G.2b(\'+8.R+\', 8, \\\'M\\\');" \'+\'1e="G.2c(\'+8.R+\');">\';1f(F l=0;l<12;l++){H((!j||l>=g.1b())&&(!k||l<=h.1b())){f+=\'<1Y 24="\'+l+\'"\'+(l==8.Q?\' 1Z="1Z"\':\'\')+\'>\'+i[l]+\'\'}}f+=\'\'}H(!8.J(\'2N\')){f+=8.L}19{F m=8.J(\'2K\').3P(\':\');F n=0;F o=0;H(m.1B!=2){n=8.L-10;o=8.L+10}19 H(m[0].1k(0)==\'+\'||m[0].1k(0)==\'-\'){n=8.L+1u(m[0],10);o=8.L+1u(m[1],10)}19{n=1u(m[0],10);o=1u(m[1],10)}n=(g?21.5g(n,g.15()):n);o=(h?21.3B(o,h.15()):o);f+=\'<1X K="5e" 3D="G.2b(\'+8.R+\', 8, \\\'Y\\\');" \'+\'1e="G.2c(\'+8.R+\');">\';1f(;n<=o;n++){f+=\'<1Y 24="\'+n+\'"\'+(n==8.L?\' 1Z="1Z"\':\'\')+\'>\'+n+\'\'}f+=\'\'}f+=\'<3p K="3s" 5b="0" 5a="0"><3x>\'+\'<23 K="59">\';F p=8.J(\'2I\');F q=8.J(\'3Z\');F r=8.J(\'2k\');1f(F s=0;s<7;s++){f+=\'<22>\'+(!q?\'\':\'\')+r[(s+p)%7]+(q?\'\':\'\')+\'\'}f+=\'<3v>\';F t=8.2s(8.L,8.Q);8.17=21.3B(8.17,t);F u=(8.3u(8.L,8.Q)-p+7)%7;F v=P W(8.1p,8.1o,8.1n);F w=P W(8.L,8.Q,8.17);F x=P W(8.L,8.Q,1-u);F y=21.54((u+t)/7);F z=8.J(\'3M\');F A=8.J(\'3W\');1f(F B=0;B\';1f(F s=0;s<7;s++){F C=(z?z(x):[1c,\'\']);F D=(x.1b()!=8.Q);F E=D||!C[0]||(g&&xh);f+=\'<22 K="4Z\'+((s+p+6)%7>=5?\' 4Y\':\'\')+(D?\' 4X\':\'\')+(x.1y()==w.1y()?\' 2z\':\'\')+(E?\' 4W\':\'\')+(!D||A?\' \'+C[1]:\'\')+(x.1y()==v.1y()?\' 4T\':(x.1y()==a.1y()?\' 5w\':\'\'))+\'"\'+(E?\'\':\' 5x="$(8).3k(\\\'2z\\\');"\'+\' 5y="$(8).2M(\\\'2z\\\');"\'+\' 1e="G.42(\'+8.R+\', 8);"\')+\'>\'+(D?(A?x.16():\'&3G;\'):(E?x.16():\'\'+x.16()+\'\'))+\'\';x.3o(x.16()+1)}f+=\'\'}f+=\'\'+(!d&&!8.1G?b:\'\')+\'\'+(!$.2d.2D?\'\':\'\');N f},T:I(a,b){F c=P W(8.L+(b==\'Y\'?a:0),8.Q+(b==\'M\'?a:0),8.17+(b==\'D\'?a:0));F d=8.J(\'28\');F e=8.J(\'26\');c=(d&&ce?e:c);8.17=c.16();8.Q=c.1b();8.L=c.15()},2s:I(a,b){N 32-P W(a,b,32).16()},3u:I(a,b){N P W(a,b,1).3V()},2t:I(a){F b=P W(8.L,8.Q+a,1);H(a<0){b.3o(8.2s(b.15(),b.1b()))}N 8.2x(b)},2x:I(a){F b=8.J(\'28\');F c=8.J(\'26\');N((!b||a>=b)&&(!c||a<=c))},3Y:I(){F a=8.1n=8.17;F b=8.1o=8.Q;F c=8.1p=8.L;b++;F d=8.J(\'1R\');F e=\'\';1f(F i=0;i<3;i++){e+=d.1k(3)+(d.1k(i)==\'D\'?(a<10?\'0\':\'\')+a:(d.1k(i)==\'M\'?(b<10?\'0\':\'\')+b:(d.1k(i)==\'Y\'?c:\'?\')))}N e.4M(d.1k(3)?1:0)}});$.4L.3s=I(f){N 8.1D(I(){F a=O;1f(29 4K G.1E){F b=8.4I(\'4H:\'+29);H(b){a=a||{};4G{a[29]=5O(b)}4E(5Q){a[29]=b}}}F c=8.1O.2j();H(c==\'1I\'){F d=(a?$.14($.14({},f||{}),a||{}):f);F e=(e&&!a?e:P 1H(d,X));G.3U(8,e)}19 H(c==\'V\'||c==\'1F\'){F d=$.14($.14({},f||{}),a||{});F e=P 1H(d,1c);G.3w(8,e)}})};$(1d).5S(I(){G=P 2m()});',62,365,'||||||||this|||||||||||||||||||||||||||||||||var|popUpCal|if|function|_get|class|_selectedYear||return|null|new|_selectedMonth|_id|_calendarDiv|_adjustDate|_getInst|div|Date|false||_input||break|||extend|getFullYear|getDate|_selectedDay|css|else|case|getMonth|true|document|onclick|for|_calId|_pos|_disabledInputs|ctrlKey|charAt|_settings|_dialogInput|_currentDay|_currentMonth|_currentYear|hideCalendar|body|calendar_trigger|_popUpShowing|parseInt|_inDialog|_updateCalendar|button|getTime|focus|showFor|length|blockUI|each|_defaults|span|_inline|PopUpCalInstance|input|speed|append|_curInst|_selectingMonthYear|curtop|nodeName|_selectDate|disabled|dateFormat|px|label|documentElement|windowHeight|windowWidth|select|option|selected|img|Math|td|tr|value|top|maxDate||minDate|attrName|type|_selectMonthYear|_clickMonthYear|browser|hidden|_afterShow|regional|_inst|_lastInput|toLowerCase|dayNames|keyCode|PopUpCal|left|clientHeight|_doKeyDown|absolute|both|_getDaysInMonth|_canAdjustMonth|prevText|src|onSelect|_isInRange|_clearDate|calendar_daysCellOver|indexOf|_gotoToday|position|msie|_tidyDialog|self|val|nextText|firstDay|_doKeyPress|yearRange|calendar_prompt|removeClass|changeYear|prompt|changeMonth|clearText|hideIfNoPrevNext|calendar_cover|_generateCalendar|closeAtTop|_showCalendar|buttonImageOnly|offsetTop|_findPos|_setDateFromField|buttonImage|buttonText|||||||||_getDate|_setDate|appendText|currentText|map|autoPopUp|cursor|opacity|jquery|calendar_dialog|addClass|100|clientWidth|iframe|setDate|table|_register|_dialogInst|calendar|_nextId|_getFirstDayOfMonth|tbody|_inlineCalendar|thead|calendar_div|keydown|id|min|title|onchange|alt|_checkExternalClick|nbsp|offsetHeight|prototype|calendar_next|fieldSettings|calendar_prev|customDate|style|monthNames|split|after|closeText|offsetLeft|offsetParent|_connectCalendar|getDay|showOtherMonths|100px|_formatDate|changeFirstDay||innerHeight|_selectDay|charCode|_changeFirstDay|String|options|attr|parents|target|We|remove|selectedIndex|unblockUI|0px|hide|Tu|height|offsetWidth|width|Mo|empty|show|static|Su|parentNode|getDateFor|setDateFor|reconfigureFor|Today|default|disableFor|enableFor|DMY|switch|gt|December|innerWidth|November|Next|catch|setDefaults|try|cal|getAttribute|October|in|fn|substring|endif|javascript|September|lte|clear|size|calendar_currentDay|text|August|calendar_unselectable|calendar_otherMonth|calendar_weekEndCell|calendar_daysCell|July|Prev|calendar_daysRow|dialogCalendar|ceil|mousedown|June|May|lt|calendar_titleRow|cellspacing|cellpadding|keypress|April|calendar_newYear|click|max|calendar_wrap|wrap|March|calendar_newMonth|February|calendar_header|calendar_current|January|Close|calendar_links|calendar_close|calendar_clear|calendar_control|medium|calendar_append|calendar_today|onmouseover|onmouseout|calendar_inline|calendar_div_|while|IE|Sa|nextSibling|noWeekends|Fr|change|trigger|html|undefined|nodeValue|firstChild|fromCharCode|eval|Th|err|Clear|ready'.split('|'),0,{})) \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/contextmenu.js b/admin-dev/ajaxfilemanager/jscripts/contextmenu.js new file mode 100755 index 000000000..114d2ea6d --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/contextmenu.js @@ -0,0 +1 @@ +(function($){var menu,shadow,trigger,content,hash,currentTarget;var defaults={menuStyle:{width:'100px'},itemStyle:{},itemHoverStyle:{},eventPosX:'pageX',eventPosY:'pageY',shadow:true,onContextMenu:null,onShowMenu:null};$.fn.contextMenu=function(id,options){if(!menu){menu=$('

').hide().css({position:'absolute',zIndex:'500'}).appendTo('body').bind('click',function(e){e.stopPropagation()})}if(!shadow){shadow=$('
').css({zIndex:499}).appendTo('body').hide()}hash=hash||[];hash.push({id:id,menuStyle:$.extend({},defaults.menuStyle,options.menuStyle||{}),itemStyle:$.extend({},defaults.itemStyle,options.itemStyle||{}),itemHoverStyle:$.extend({},defaults.itemHoverStyle,options.itemHoverStyle||{}),bindings:options.bindings||{},shadow:options.shadow||options.shadow===false?options.shadow:defaults.shadow,onContextMenu:options.onContextMenu||defaults.onContextMenu,onShowMenu:options.onShowMenu||defaults.onShowMenu,eventPosX:options.eventPosX||defaults.eventPosX,eventPosY:options.eventPosY||defaults.eventPosY});var index=hash.length-1;$(this).bind('contextmenu',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false});return this};function display(index,trigger,e,options){var cur=hash[index];content=$('#'+cur.id).find('ul:first').clone(true);content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(function(){$(this).css(cur.itemHoverStyle)},function(){$(this).css(cur.itemStyle)}).find('img').css({verticalAlign:'middle',paddingRight:'2px'});menu.html(content);if(!!cur.onShowMenu)menu=cur.onShowMenu(e,menu);$.each(cur.bindings,function(id,func){$('#'+id,menu).bind('click',function(e){hide();func(trigger,currentTarget)})});menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();if(cur.shadow)shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();$(document).one('click',hide)}function hide(){menu.hide();shadow.hide()}$.contextMenu={defaults:function(userDefaults){$.each(userDefaults,function(i,val){if(typeof val=='object'&&defaults[i]){$.extend(defaults[i],val)}else defaults[i]=val})}}})(jQuery);$(function(){$('div.contextMenu').hide()}); \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area.css b/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area.css new file mode 100755 index 000000000..027412ca3 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area.css @@ -0,0 +1,352 @@ +body, html{ + margin: 0; + padding: 0; + height: 100%; + border: none; + overflow: hidden; + background-color: #FFFFFF; +} + +body, html, table, form, textarea{ + font: 12px monospace, sans-serif; +} + +#editor{ + border: solid #888888 1px; + overflow: hidden; +} + +#result{ + z-index: 4; + overflow: scroll; + border-top: solid #888888 1px; + border-bottom: solid #888888 1px; + position: relative; +} + +#container{ + overflow: hidden; + /*height: 100px;*/ + border: solid blue 0px; + position: relative; + padding: 0 5px 0px 0; + z-index: 10; +} + +#textarea{ + position: relative; + top: 0px; + left: 0px; + padding: 0px 0px 0px 45px; + width: 100%; + height: 100%; + /*position: absolute;*/ + overflow: hidden; + z-index: 7; + border: solid green 0px; +/* background: none; + background-color: transparent;*/ +} + +#content_highlight{ + white-space: pre; + /*background-color: #FFFFFF;*/ + padding: 1px 0 0 45px; + position : absolute; + z-index: 4; + overflow: visible; + border: solid yellow 0px; +} + + +#selection_field{ + padding: 0px 0px 0 45px; + background-color: #FFFF99; + height: 1px; + position: absolute; + z-index: 5; + top: -100px; + margin: 1px 0 0 0px; + white-space: pre; + overflow: hidden; +} + +#line_number{ + position: absolute; + overflow: hidden; + border-right: solid black 1px; + z-index:8; + width: 38px; + padding-right: 5px; + text-align: right; + color: #AAAAAA; +} + +#test_font_size{ + padding: 0; + margin: 0; + visibility: hidden; + position: absolute; + white-space: pre; +} + +pre{ + margin: 0; + padding: 0; +} + +.hidden{ + opacity: 0.2; + -moz-opacity: 0.2; + filter:alpha(opacity=20); +} + +#result .edit_area_cursor{ + position: absolute; + z-index:6; + background-color: #FF6633; + top: -100px; + margin: 1px 0 0 0px; +} + +#result .edit_area_selection_field .overline{ + background-color: #996600; +} + + +/* area popup */ +.editarea_popup{ + border: solid 1px #888888; + background-color: #ECE9D8; + width: 250px; + padding: 4px; + position: absolute; + visibility: hidden; + /*display: none;*/ + z-index: 15; + top: -500px; + + /*font-family: Aria, Verdana, sans-serif; + font-size: 10pt;*/ +} + +.editarea_popup, .editarea_popup table{ + font-family: sans-serif; + font-size: 10pt; +} + +.editarea_popup img{ + border: 0; +} + +.editarea_popup .close_popup{ + float: right; + line-height: 16px; + border: 0px; + padding: 0px; +} + +.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{ + margin: 0px; + padding: 0px; +} + +.editarea_popup .copyright{ + text-align: right; +} + +/* Area_search */ +div#area_search_replace{ + /*width: 250px;*/ +} + +div#area_search_replace img{ + border: 0px; +} + +div#area_search_replace div.button{ + text-align: center; + line-height: 1.7em; +} + +div#area_search_replace .button a{ + cursor: pointer; + border: solid 1px #888888; + background-color: #DEDEDE; + text-decoration: none; + padding: 0 2px; + color: #000000; + white-space: nowrap; +} + +div#area_search_replace a:hover{ + /*border: solid 1px #888888;*/ + background-color: #EDEDED; +} + +div#area_search_replace #move_area_search_replace{ + cursor: move; + border: solid 1px #888888; +} + +div#area_search_replace #close_area_search_replace{ + text-align: right; + vertical-align: top; + white-space: nowrap; +} + +div#area_search_replace #area_search_msg{ + height: 18px; + overflow: hidden; + border-top: solid 1px #888888; + margin-top: 3px; +} + +/* area help */ +#edit_area_help{ + width: 350px; +} + +#edit_area_help div.close_popup{ + float: right; +} + +/* area_toolbar */ +.area_toolbar{ + /*font: 11px sans-serif;*/ + width: 100%; + /*height: 21px; */ + margin: 0px; + padding: 0px; + background-color: #ECE9D8; + text-align: center; +} + +.area_toolbar, .area_toolbar table{ + font: 11px sans-serif; +} + +.area_toolbar img{ + border: 0px; + vertical-align: middle; +} + +.area_toolbar input{ + margin: 0px; + padding: 0px; +} + +.area_toolbar select{ + font-family: 'MS Sans Serif',sans-serif,Verdana,Arial; + font-size: 7pt; + font-weight: normal; + margin: 2px 0 0 0 ; + padding: 0; + vertical-align: top; + background-color: #F0F0EE; +} + +table.statusbar{ + width: 100%; +} + +.area_toolbar td.infos{ + text-align: center; + width: 130px; + border-right: solid 1px #888888; + border-width: 0 1px 0 0; + padding: 0; +} + +.area_toolbar td.total{ + text-align: right; + width: 50px; + padding: 0; +} + +.area_toolbar td.resize{ + text-align: right; +} +/* +.area_toolbar span{ + line-height: 1px; + padding: 0; + margin: 0; +}*/ + +.area_toolbar span#resize_area{ + cursor: nw-resize; + visibility: hidden; +} + +/* toolbar buttons */ +.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected { + border: 0px; margin: 0px; padding: 0px; background: transparent; + margin-top: 0px; + margin-left: 1px; + padding: 0px; +} + +.editAreaButtonNormal { + border: 1px solid #ECE9D8 !important; + cursor: pointer; +} + +.editAreaButtonOver { + border: 1px solid #0A246A !important; + cursor: pointer; + background-color: #B6BDD2; +} + +.editAreaButtonDown { + cursor: pointer; + border: 1px solid #0A246A !important; + background-color: #8592B5; +} + +.editAreaButtonSelected { + border: 1px solid #C0C0BB !important; + cursor: pointer; + background-color: #F4F2E8; +} + +.editAreaButtonDisabled { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + -moz-opacity:0.3; + opacity: 0.3; + border: 1px solid #F0F0EE !important; + cursor: pointer; +} + +.editAreaSeparatorLine { + margin: 1px 2px; + background-color: #C0C0BB; + width: 2px; + height: 18px; +} + +/* waiting screen */ +#processing{ + display: none; + background-color:#ECE9D8; + border: solid #888888 1px; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100; + text-align: center; +} + +#processing_text{ + position:absolute; + left: 50%; + top: 50%; + width: 200px; + height: 20px; + margin-left: -100px; + margin-top: -10px; + text-align: center; +} +/* end */ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area_full.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area_full.js new file mode 100755 index 000000000..0276728b5 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/edit_area_full.js @@ -0,0 +1,35 @@ + function EAL(){this.version="0.6.7";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug: false ,smooth_selection: true ,font_size: "10" ,font_family: "monospace" ,start_highlight: false ,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, |, help" ,begin_toolbar: "" ,end_toolbar: "" ,allow_resize: "both" ,min_width: 400 ,min_height: 100 ,replace_tab_by_spaces: false ,allow_toggle: true ,language: "en" ,syntax: "" ,display: "onload" ,max_undo: 20 ,browsers: "known" ,plugins: "" ,gecko_spellcheck: false ,fullscreen: false ,load_callback: "" ,save_callback: "" , save_as_callback: "", change_callback: "" ,submit_callback: "" ,EA_init_callback: "" ,EA_delete_callback: "" ,EA_load_callback: "" ,EA_unload_callback: "" ,EA_toggle_on_callback: "" ,EA_toggle_off_callback: "" };this.advanced_buttons=[ ['new_document', 'newdocument.gif', 'new_document'], ['search', 'search.gif', 'show_search'], ['go_to_line', 'go_to_line.gif', 'go_to_line'], ['undo', 'undo.gif', 'undo'], ['redo', 'redo.gif', 'redo'], ['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode'], ['reset_highlight', 'reset_highlight.gif', 'resync_highlight'], ['highlight', 'highlight.gif','change_highlight'], ['help', 'help.gif', 'show_help'], ['save', 'save.gif', 'save'], ['save_as', 'save_as.gif', 'save_as'], ['load', 'load.gif', 'load'], ['fullscreen', 'fullscreen.gif', 'toggle_full_screen'] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/, "$1");if(this.nav['isIE']<6) this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/') !=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8 || !this.nav['isIE']) this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera') !=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");if(this.nav['isOpera']<9) this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko') !=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox') !=-1)) this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel') !=-1)) this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");if(this.nav['isCamino'] =(ua.indexOf('Camino') !=-1)) this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");this.nav['isSafari']=(ua.indexOf('Safari') !=-1);if(this.nav['isIE']>=6 || this.nav['isOpera']>=9 || this.nav['isFirefox'] || this.nav['isCamino']) this.nav['isValidBrowser']=true; +else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i0) settings["toolbar"]=settings["begin_toolbar"] +","+ settings["toolbar"];if(settings["end_toolbar"].length>0) settings["toolbar"]=settings["toolbar"] +","+ settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL + "reg_syntax/"+ settings["syntax"] + ".js");}eAs[settings["id"]]={"settings": settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);};EAL.prototype.delete_instance=function(id){eAL.execCommand(id, "EA_delete");if(window.frames["frame_"+id] && eAs[id]["displayed"]) window.frames["frame_"+id].editArea.execCommand("EA_unload");eAL.toggle(id, "off");var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.parentNode.removeChild(span);}var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];};EAL.prototype.start=function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');", 50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"){setTimeout("eAL.start('"+id+"');", 50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]] || (eAs[id]["settings"]["syntax"].length>0 && !eAL.load_syntax[eAs[id]["settings"]["syntax"]]) ){setTimeout("eAL.start('"+id+"');", 50);return;}if(eAs[id]["settings"]["syntax"].length>0) eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id) && (eAs[id]["settings"]["debug"] || eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="
";html+="";html+="
";}if(eAs[id]["settings"]["debug"]) html+="
";html=eAL.translate(html, eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null) father.appendChild(span); +else father.insertBefore(span, next);}if(!eAs[id]["initialized"]){this.execCommand(id, "EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(this.nav['isIE']){eAL.init_ie_textarea(id);}var html_toolbar_content="";area=eAs[id];for(var i=0;i';}for(var i=0;i';this.iframe_script+='';}if(!this.iframe_css){this.iframe_css="";}var template=this.template.replace(/\[__BASEURL__\]/g, this.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=this.translate(template, area["settings"]["language"], "template");template=template.replace("[__CSSRULES__]", this.iframe_css);template=template.replace("[__JSCODE__]", this.iframe_script);template=template.replace("[__EA_VERSION__]", this.version);area.textarea=document.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;var father=area.textarea.parentNode;var content=document.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content, "frameBorder", "0");content.style.overflow="hidden";content.style.display="none";var next=area.textarea.nextSibling;if(next==null) father.appendChild(content); +else father.insertBefore(content, next);var frame=window.frames["frame_"+area["settings"]["id"]];frame.document.open();frame.eAs=eAs;frame.area_id=area["settings"]["id"];frame.document.area_id=area["settings"]["id"];frame.document.write(template);frame.document.close();};EAL.prototype.toggle=function(id, toggle_to){if(!toggle_to) toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true && toggle_to=="off"){this.toggle_off(id);} +else if(eAs[id]["displayed"]==false && toggle_to=="on"){this.toggle_on(id);}return false;};EAL.prototype.toggle_off=function(id){if(window.frames["frame_"+id]){var frame=window.frames["frame_"+id];if(frame.editArea.fullscreen['isFull']) frame.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;eAs[id]["textarea"].wrap="off";setAttribute(eAs[id]["textarea"], "wrap", "off");var parNod=eAs[id]["textarea"].parentNode;var nxtSib=eAs[id]["textarea"].nextSibling;parNod.removeChild(eAs[id]["textarea"]);parNod.insertBefore(eAs[id]["textarea"], nxtSib);eAs[id]["textarea"].value=frame.editArea.textarea.value;var selStart=frame.editArea.last_selection["selectionStart"];var selEnd=frame.editArea.last_selection["selectionEnd"];var scrollTop=frame.document.getElementById("result").scrollTop;var scrollLeft=frame.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';eAs[id]["textarea"].style.display="inline";eAs[id]["textarea"].focus();if(this.nav['isIE']){eAs[id]["textarea"].selectionStart=selStart;eAs[id]["textarea"].selectionEnd=selEnd;eAs[id]["textarea"].focused=true;set_IE_selection(eAs[id]["textarea"]);} +else{if(this.nav['isOpera']){eAs[id]["textarea"].setSelectionRange(0, 0);}try{eAs[id]["textarea"].setSelectionRange(selStart, selEnd);}catch(e){};}eAs[id]["textarea"].scrollTop=scrollTop;eAs[id]["textarea"].scrollLeft=scrollLeft;frame.editArea.execCommand("toggle_off");}};EAL.prototype.toggle_on=function(id){if(window.frames["frame_"+id]){var frame=window.frames["frame_"+id];area=window.frames["frame_"+id].editArea;area.textarea.value=eAs[id]["textarea"].value;var selStart=0;var selEnd=0;var scrollTop=0;var scrollLeft=0;if(eAs[id]["textarea"].use_last==true){var selStart=eAs[id]["textarea"].last_selectionStart;var selEnd=eAs[id]["textarea"].last_selectionEnd;var scrollTop=eAs[id]["textarea"].last_scrollTop;var scrollLeft=eAs[id]["textarea"].last_scrollLeft;eAs[id]["textarea"].use_last=false;} +else{try{var selStart=eAs[id]["textarea"].selectionStart;var selEnd=eAs[id]["textarea"].selectionEnd;var scrollTop=eAs[id]["textarea"].scrollTop;var scrollLeft=eAs[id]["textarea"].scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));eAs[id]["textarea"].style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");window.frames["frame_"+id].document.getElementById("result").scrollTop=scrollTop;window.frames["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart, selEnd-selStart);area.execCommand("toggle_on");} +else{var elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}};EAL.prototype.set_editarea_size_from_textarea=function(id, frame){var elem=document.getElementById(id);var width=Math.max(eAs[id]["settings"]["min_width"], elem.offsetWidth)+"px";var height=Math.max(eAs[id]["settings"]["min_height"], elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1) width=elem.style.width;if(elem.style.height.indexOf("%")!=-1) height=elem.style.height;frame.style.width=width;frame.style.height=height;};EAL.prototype.set_base_url=function(){if (!this.baseURL){var elements=document.getElementsByTagName('script');for (var i=0;i';html+='';return html;};EAL.prototype.get_control_html=function(button_name, lang){for (var i=0;i";case "|": case "separator": return '';case "select_font": html="";return html;}return "["+button_name+"]";};EAL.prototype.get_template=function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest) xhr_object=new XMLHttpRequest(); +else if(window.ActiveXObject) xhr_object=new ActiveXObject("Microsoft.XMLHTTP"); +else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET", this.baseURL+"template.html", false);xhr_object.send(null);if(xhr_object.readyState==4) this.template=xhr_object.responseText; +else this.has_error();}};EAL.prototype.translate=function(text, lang, mode){if(mode=="word") text=eAL.get_word_translation(text, lang); +else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm, eAL.translate_template);}return text;};EAL.prototype.translate_template=function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1], eAL.current_language);};EAL.prototype.get_word_translation=function(val, lang){for(var i in eAL.lang[lang]){if(i==val) return eAL.lang[lang][i];}return "_"+val;};EAL.prototype.load_script=function(url){if (this.loadedFiles[url]) return;try{var script=document.createElement("script");script.type="text/javascript";script.src=url;var head=document.getElementsByTagName("head");head[0].appendChild(script);}catch(e){document.write('');}this.loadedFiles[url]=true;};EAL.prototype.add_event=function(obj, name, handler){if (obj.attachEvent){obj.attachEvent("on" + name, handler);} +else{obj.addEventListener(name, handler, false);}};EAL.prototype.remove_event=function(obj, name, handler){if (obj.detachEvent) obj.detachEvent("on" + name, handler); +else obj.removeEventListener(name, handler, false);};EAL.prototype.reset=function(e){var formObj=eAL.nav['isIE'] ? window.event.srcElement : e.target;for(var i in eAs){var is_child=false;for (var x=0;x old_sel["start"]) this.setSelectionRange(id, new_sel["end"], new_sel["end"]); +else this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);};EAL.prototype.hide=function(id){if(document.getElementById(id) && !this.hidden[id]){this.hidden[id]=new Object();this.hidden[id]["selectionRange"]=this.getSelectionRange(id);if(document.getElementById(id).style.display!="none"){this.hidden[id]["scrollTop"]=document.getElementById(id).scrollTop;this.hidden[id]["scrollLeft"]=document.getElementById(id).scrollLeft;}if(window.frames["frame_"+id]){this.hidden[id]["toggle"]=eAs[id]["displayed"];if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){var scrollTop=window.frames["frame_"+ id].document.getElementById("result").scrollTop;var scrollLeft=window.frames["frame_"+ id].document.getElementById("result").scrollLeft;} +else{var scrollTop=document.getElementById(id).scrollTop;var scrollLeft=document.getElementById(id).scrollLeft;}this.hidden[id]["scrollTop"]=scrollTop;this.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true) eAL.toggle_off(id);}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}document.getElementById(id).style.display="none";}};EAL.prototype.show=function(id){if((elem=document.getElementById(id)) && this.hidden[id]){elem.style.display="inline";elem.scrollTop=this.hidden[id]["scrollTop"];elem.scrollLeft=this.hidden[id]["scrollLeft"];var span=document.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(window.frames["frame_"+id]){elem.style.display="inline";if(this.hidden[id]["toggle"]==true) eAL.toggle_on(id);scrollTop=this.hidden[id]["scrollTop"];scrollLeft=this.hidden[id]["scrollLeft"];if(window.frames["frame_"+id] && eAs[id]["displayed"]==true){window.frames["frame_"+ id].document.getElementById("result").scrollTop=scrollTop;window.frames["frame_"+ id].document.getElementById("result").scrollLeft=scrollLeft;} +else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=this.hidden[id]["selectionRange"];this.setSelectionRange(id, sel["start"], sel["end"]);delete this.hidden[id];}};EAL.prototype.execCommand=function(id, cmd){switch(cmd){case "EA_init": if(eAs[id]['settings']["EA_init_callback"].length>0) eval(eAs[id]['settings']["EA_init_callback"]+"('"+ id +"');");break;case "EA_delete": if(eAs[id]['settings']["EA_delete_callback"].length>0) eval(eAs[id]['settings']["EA_delete_callback"]+"('"+ id +"');");break;case "EA_submit": if(eAs[id]['settings']["submit_callback"].length>0) eval(eAs[id]['settings']["submit_callback"]+"('"+ id +"');");break;}if(window.frames["frame_"+id]){return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');}return false;};var eAL=new EAL();var eAs=new Object();function getAttribute( elm, aname ){try{var avalue=elm.getAttribute( aname );}catch(exept){}if ( ! avalue ){for ( var i=0;i < elm.attributes.length;i ++ ){var taName=elm.attributes [i] .name.toLowerCase();if ( taName==aname ){avalue=elm.attributes [i] .value;return avalue;}}}return avalue;};function setAttribute( elm, attr, val ){if(attr=="class"){elm.setAttribute("className", val);elm.setAttribute("class", val);} +else{elm.setAttribute(attr, val);}};function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth){if(!option) var option="single";if(!depth) var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=new Array();for (var x=0;x0){results=results.concat(result);}} +else if(result!=null){return result;}}}}if(option=="all") return results;}return null;};function isChildOf(elem, parent){if(elem){if(elem==parent) return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode, parent);}}return false;};function getMouseX(e){if(e!=null && typeof(e.pageX)!="undefined"){return e.pageX;} +else{return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null && typeof(e.pageY)!="undefined"){return e.pageY;} +else{return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft") };function calculeOffsetTop(r){return calculeOffset(r,"offsetTop") };function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem, prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);} +else if(elem.currentStyle){var prop=prop.replace(/-\D/gi, function(sMatch){return sMatch.charAt(sMatch.length - 1).toUpperCase();});return elem.currentStyle[prop];} +else return null;}var move_current_element;function start_move_element(e, id, frame){var elem_id=(e.target || e.srcElement).id;if(id) elem_id=id;if(!frame) frame=window;if(frame.event) e=frame.event;move_current_element=frame.document.getElementById(elem_id);move_current_element.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);move_current_element.start_pos_x=mouse_x - (move_current_element.style.left.replace("px","") || calculeOffsetLeft(move_current_element));move_current_element.start_pos_y=mouse_y - (move_current_element.style.top.replace("px","") || calculeOffsetTop(move_current_element));return false;};function end_move_element(e){move_current_element.frame.document.onmousemove="";move_current_element.frame.document.onmouseup="";move_current_element=null;};function move_element(e){if(move_current_element.frame && move_current_element.frame.event) e=move_current_element.frame.event;var mouse_x=getMouseX(e);var mouse_y=getMouseY(e);var new_top=mouse_y - move_current_element.start_pos_y;var new_left=mouse_x - move_current_element.start_pos_x;var max_left=move_current_element.frame.document.body.offsetWidth- move_current_element.offsetWidth;max_top=move_current_element.frame.document.body.offsetHeight- move_current_element.offsetHeight;new_top=Math.min(Math.max(0, new_top), max_top);new_left=Math.min(Math.max(0, new_left), max_left);move_current_element.style.top=new_top+"px";move_current_element.style.left=new_left+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return {"start": textarea.selectionStart, "end": textarea.selectionEnd};};function setSelectionRange(textarea, start, end){textarea.focus();start=Math.max(0, Math.min(textarea.value.length, start));end=Math.max(start, Math.min(textarea.value.length, end));if(nav['isOpera']){textarea.selectionEnd=1;textarea.selectionStart=0;textarea.selectionEnd=1;textarea.selectionStart=0;}textarea.selectionStart=start;textarea.selectionEnd=end;if(nav['isIE']) set_IE_selection(textarea);};function get_IE_selection(textarea){if(textarea && textarea.focused){if(!textarea.ea_line_height){var div=document.createElement("div");div.style.fontFamily=get_css_property(textarea, "font-family");div.style.fontSize=get_css_property(textarea, "font-size");div.style.visibility="hidden";div.innerHTML="0";document.body.appendChild(div);textarea.ea_line_height=div.offsetHeight;document.body.removeChild(div);}var range=document.selection.createRange();var stored_range=range.duplicate();stored_range.moveToElementText( textarea );stored_range.setEndPoint( 'EndToEnd', range );if(stored_range.parentElement()==textarea){var elem=textarea;var scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}var relative_top=range.offsetTop - calculeOffsetTop(textarea)+ scrollTop;var line_start=Math.round((relative_top / textarea.ea_line_height) +1);var line_nb=Math.round(range.boundingHeight / textarea.ea_line_height);var range_start=stored_range.text.length - range.text.length;var tab=textarea.value.substr(0, range_start).split("\n");range_start+=(line_start - tab.length)*2;textarea.selectionStart=range_start;var range_end=textarea.selectionStart + range.text.length;tab=textarea.value.substr(0, range_start + range.text.length).split("\n");range_end+=(line_start + line_nb - 1 - tab.length)*2;textarea.selectionEnd=range_end;}}setTimeout("get_IE_selection(document.getElementById('"+ textarea.id +"'));", 50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(textarea){var nbLineStart=textarea.value.substr(0, textarea.selectionStart).split("\n").length - 1;var nbLineEnd=textarea.value.substr(0, textarea.selectionEnd).split("\n").length - 1;var range=document.selection.createRange();range.moveToElementText( textarea );range.setEndPoint( 'EndToStart', range );range.moveStart('character', textarea.selectionStart - nbLineStart);range.moveEnd('character', textarea.selectionEnd - nbLineEnd - (textarea.selectionStart - nbLineStart) );range.select();};eAL.waiting_loading["elements_functions.js"]="loaded";EAL.prototype.start_resize_area=function(){document.onmouseup=eAL.end_resize_area;document.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);var textarea=eAs[eAL.resize["id"]]["textarea"];var div=document.getElementById("edit_area_resize");if(!div){div=document.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}var width=textarea.offsetWidth -2;var height=textarea.offsetHeight -2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";var father=textarea.parentNode;father.insertBefore(div, textarea);textarea.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){document.onmouseup="";document.onmousemove="";var div=document.getElementById("edit_area_resize");var textarea=eAs[eAL.resize["id"]]["textarea"];var width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);var height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);if(eAL.nav['isIE']==6){width-=2;height-=2;}textarea.style.width=width+"px";textarea.style.height=height+"px";div.style.display="none";textarea.style.display="inline";textarea.selectionStart=eAL.resize["selectionStart"];textarea.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both" || allow=="y"){new_y=getMouseY(e);var new_height=Math.max(20, new_y- eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=new_height+"px";}if(allow=="both" || allow=="x"){new_x=getMouseX(e);var new_width=Math.max(20, new_x- eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=new_width+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded";EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0) res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style=new Object();for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]=new Object();this.syntax[lang]["keywords_reg_exp"]=new Object();this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false) param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;if(nb>0) str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0) this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;if(nb>0) str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0) this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=new Array();this.syntax[lang]["quotes"]=new Object();var quote_tab=new Array();if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]=new Object();if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0) this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0) this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]=new Object();for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]=new Object();if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']]) this.syntax[lang]["custom_regexp"][val['execute']]=new Object();this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers']) , 'class' : val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]=new Object();for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;if(typeof(this.load_syntax[lang]['STYLES'][i]) !="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}} +else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";style+="."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded"; +var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= ""; +editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__]
[__TOOLBAR__]
 
 
{$position}: {$line_abbr} 0, {$char_abbr} 0 {$total}: {$line_abbr} 0, {$char_abbr} 0 resize
{$processing}
{$search} {$close_popup}
{$replace} {$move_popup}

{$find_next} {$replace} {$replace_all}
{$close_popup}

Editarea [__EA_VERSION__]


{$shortcuts}:

{$tab}: {$add_tab}
{$shift}+{$tab}: {$remove_tab}
{$ctrl}+f: {$search_command}
{$ctrl}+r: {$replace_command}
{$ctrl}+h: {$highlight}
{$ctrl}+g: {$go_to_line}
{$ctrl}+z: {$undo}
{$ctrl}+y: {$redo}
{$ctrl}+e: {$help}
{$ctrl}+q, {$esc}: {$close_popup}
{$accesskey} E: {$toggle}

{$about_notice}
"; +editAreaLoader.iframe_css= ""; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/close.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/close.gif new file mode 100755 index 000000000..679ca2aa4 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/close.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/fullscreen.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/fullscreen.gif new file mode 100755 index 000000000..66fa6d921 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/fullscreen.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/go_to_line.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/go_to_line.gif new file mode 100755 index 000000000..06042ec9a Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/go_to_line.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/help.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/help.gif new file mode 100755 index 000000000..51a1ee420 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/help.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/highlight.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/highlight.gif new file mode 100755 index 000000000..16491f6cf Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/highlight.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/load.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/load.gif new file mode 100755 index 000000000..461698f56 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/load.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/move.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/move.gif new file mode 100755 index 000000000..d15f9f542 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/move.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/newdocument.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/newdocument.gif new file mode 100755 index 000000000..a9d293842 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/newdocument.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/opacity.png b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/opacity.png new file mode 100755 index 000000000..b4217cb21 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/opacity.png differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/processing.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/processing.gif new file mode 100755 index 000000000..cce32f20f Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/processing.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/redo.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/redo.gif new file mode 100755 index 000000000..3af90697f Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/redo.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/reset_highlight.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/reset_highlight.gif new file mode 100755 index 000000000..0fa3cb797 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/reset_highlight.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save.gif new file mode 100755 index 000000000..2777bebfe Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save_as.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save_as.gif new file mode 100755 index 000000000..d8251b4b9 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/save_as.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/search.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/search.gif new file mode 100755 index 000000000..cfe76b5d5 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/search.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/smooth_selection.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/smooth_selection.gif new file mode 100755 index 000000000..8a532e5e6 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/smooth_selection.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/spacer.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/spacer.gif new file mode 100755 index 000000000..388486517 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/spacer.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/statusbar_resize.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/statusbar_resize.gif new file mode 100755 index 000000000..af89d803f Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/statusbar_resize.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/undo.gif b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/undo.gif new file mode 100755 index 000000000..520796d69 Binary files /dev/null and b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/undo.gif differ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/de.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/de.js new file mode 100755 index 000000000..516fdd4cd --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/de.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["de"]={ +new_document: "neues leeres Dokument", +search_button: "suchen und ersetzen", +search_command: "suche nächsten / öffne Suchfeld", +search: "suche", +replace: "ersetze", +replace_command: "ersetze / öffne Suchfeld", +find_next: "finde nächsten", +replace_all: "ersetze alle Treffer", +reg_exp: "reguläre Ausdrücke", +match_case: "passt auf den Begriff
", +not_found: "Nicht gefunden.", +occurrence_replaced: "Die Vorkommen wurden ersetzt.", +search_field_empty: "leeres Suchfeld", +restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation +move_popup: "Suchfenster bewegen", +font_size: "--Schriftgröße--", +go_to_line: "gehe zu Zeile", +go_to_line_prompt: "gehe zu Zeilennummmer:", +undo: "rückgängig machen", +redo: "wiederherstellen", +change_smooth_selection: "aktiviere/deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)", +highlight: "Syntax Highlighting an- und ausschalten", +reset_highlight: "Highlighting zurücksetzen (falls mit Text nicht konform)", +help: "über", +save: "sichern", +load: "öffnen", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Position", +total: "Gesamt", +close_popup: "Popup schließen", +shortcuts: "Shortcuts", +add_tab: "Tab zum Text hinzufügen", +remove_tab: "Tab aus Text entfernen", +about_notice: "Bemerkung: Syntax Highlighting ist nur für kurze Texte", +toggle: "Editor an- und ausschalten", +accesskey: "Accesskey", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "In Bearbeitung...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/dk.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/dk.js new file mode 100755 index 000000000..e82e2c9e6 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/dk.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["dk"]={ +new_document: "nyt tomt dokument", +search_button: "søg og erstat", +search_command: "find næste / åben søgefelt", +search: "søg", +replace: "erstat", +replace_command: "erstat / åben søgefelt", +find_next: "find næste", +replace_all: "erstat alle", +reg_exp: "regular expressions", +match_case: "forskel på store/små bogstaver
", +not_found: "not found.", +occurrence_replaced: "occurences replaced.", +search_field_empty: "Search field empty", +restart_search_at_begin: "End of area reached. Restart at begin.", +move_popup: "flyt søgepopup", +font_size: "--Skriftstørrelse--", +go_to_line: "gå til linie", +go_to_line_prompt: "gå til linienummer:", +undo: "fortryd", +redo: "gentag", +change_smooth_selection: "slå display funktioner til/fra (smartere display men mere CPU krævende)", +highlight: "slå syntax highlight til/fra", +reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)", +help: "om", +save: "gem", +load: "hent", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Position", +total: "Total", +close_popup: "luk popup", +shortcuts: "Genveje", +add_tab: "tilføj tabulation til tekst", +remove_tab: "fjern tabulation fra tekst", +about_notice: "Husk: syntax highlight funktionen bør kun bruge til små tekster", +toggle: "Slå editor til / fra", +accesskey: "Accesskey", +tab: "Tab", +shift: "Skift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Processing...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/en.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/en.js new file mode 100755 index 000000000..3f84614e3 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/en.js @@ -0,0 +1,46 @@ +editAreaLoader.lang["en"]={ +new_document: "new empty document", +search_button: "search and replace", +search_command: "search next / open search area", +search: "search", +replace: "replace", +replace_command: "replace / open search area", +find_next: "find next", +replace_all: "replace all", +reg_exp: "regular expressions", +match_case: "match case", +not_found: "not found.", +occurrence_replaced: "occurences replaced.", +search_field_empty: "Search field empty", +restart_search_at_begin: "End of area reached. Restart at begin.", +move_popup: "move search popup", +font_size: "--Font size--", +go_to_line: "go to line", +go_to_line_prompt: "go to line number:", +undo: "undo", +redo: "redo", +change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)", +highlight: "toggle syntax highlight on/off", +reset_highlight: "reset highlight (if desyncronized from text)", +help: "about", +save: "save", +save_as: "save as", +load: "load", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Position", +total: "Total", +close_popup: "close popup", +shortcuts: "Shortcuts", +add_tab: "add tabulation to text", +remove_tab: "remove tabulation to text", +about_notice: "Notice: syntax highlight function is only for small text", +toggle: "Toggle editor", +accesskey: "Accesskey", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Processing...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/fr.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/fr.js new file mode 100755 index 000000000..aa1995a8f --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/fr.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["fr"]={ +new_document: "nouveau document (efface le contenu)", +search_button: "rechercher / remplacer", +search_command: "rechercher suivant / ouvrir la fenêtre de recherche", +search: "rechercher", +replace: "remplacer", +replace_command: "remplacer / ouvrir la fenêtre de recherche", +find_next: "rechercher", +replace_all: "tout remplacer", +reg_exp: "expr. régulière", +match_case: "respecter la casse", +not_found: "pas trouvé.", +occurrence_replaced: "remplacements éffectués.", +search_field_empty: "Le champ de recherche est vide.", +restart_search_at_begin: "Fin du texte atteint, poursuite au début.", +move_popup: "déplacer la fenêtre de recherche", +font_size: "--Taille police--", +go_to_line: "aller à la ligne", +go_to_line_prompt: "aller a la ligne numero:", +undo: "annuler", +redo: "refaire", +change_smooth_selection: "activer/désactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)", +highlight: "activer/désactiver la coloration syntaxique", +reset_highlight: "réinitialiser la coloration syntaxique (si désyncronisée du texte)", +help: "à propos", +save: "sauvegarder", +load: "charger", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Position", +total: "Total", +close_popup: "fermer le popup", +shortcuts: "Racourcis clavier", +add_tab: "ajouter une tabulation dans le texte", +remove_tab: "retirer une tabulation dans le texte", +about_notice: "Note: la coloration syntaxique n'est prévue que pour de courts textes.", +toggle: "basculer l'éditeur", +accesskey: "Accesskey", +tab: "Tab", +shift: "Maj", +ctrl: "Ctrl", +esc: "Esc", +processing: "chargement...", +fullscreen: "plein écran" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/hr.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/hr.js new file mode 100755 index 000000000..7ea4df876 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/hr.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["hr"]={ +new_document: "Novi dokument", +search_button: "Traži i izmijeni", +search_command: "Traži dalje / Otvori prozor za traženje", +search: "Traži", +replace: "Izmijeni", +replace_command: "Izmijeni / Otvori prozor za traženje", +find_next: "Traži dalje", +replace_all: "Izmjeni sve", +reg_exp: "Regularni izrazi", +match_case: "Bitna vel. slova", +not_found: "nije naðeno.", +occurrence_replaced: "izmjenjenih.", +search_field_empty: "Prazno polje za traženje!", +restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.", +move_popup: "Pomakni prozor", +font_size: "--Velièina teksta--", +go_to_line: "Odi na redak", +go_to_line_prompt: "Odi na redak:", +undo: "Vrati natrag", +redo: "Napravi ponovo", +change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)", +highlight: "Ukljuèi/iskljuèi bojanje sintakse", +reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)", +help: "O edit_area", +save: "Spremi", +load: "Uèitaj", +line_abbr: "Ln", +char_abbr: "Zn", +position: "Pozicija", +total: "Ukupno", +close_popup: "Zatvori prozor", +shortcuts: "Kratice", +add_tab: "Dodaj tabulaciju", +remove_tab: "Makni tabulaciju", +about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove", +toggle: "Prebaci naèin ureðivanja", +accesskey: "Accesskey", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Procesiram...", +fullscreen: "Cijeli prozor" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/it.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/it.js new file mode 100755 index 000000000..90f0b00e3 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/it.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["it"]={ +new_document: "nuovo documento vuoto", +search_button: "cerca e sostituisci", +search_command: "trova successivo / apri finestra di ricerca", +search: "cerca", +replace: "sostituisci", +replace_command: "sostituisci / apri finestra di ricerca", +find_next: "trova successivo", +replace_all: "sostituisci tutti", +reg_exp: "espressioni regolari", +match_case: "confronta maiuscole/minuscole
", +not_found: "non trovato.", +occurrence_replaced: "occorrenze sostituite.", +search_field_empty: "Campo ricerca vuoto", +restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.", +move_popup: "sposta popup di ricerca", +font_size: "-- Dimensione --", +go_to_line: "vai alla linea", +go_to_line_prompt: "vai alla linea numero:", +undo: "annulla", +redo: "ripeti", +change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione", +highlight: "abilita/disabilita colorazione della sintassi", +reset_highlight: "aggiorna colorazione (se non sincronizzata)", +help: "informazioni su...", +save: "salva", +load: "carica", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Posizione", +total: "Totale", +close_popup: "chiudi popup", +shortcuts: "Scorciatoie", +add_tab: "aggiungi tabulazione", +remove_tab: "rimuovi tabulazione", +about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo", +toggle: "Abilita/disabilita editor", +accesskey: "Accesskey", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "In corso...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/ja.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/ja.js new file mode 100755 index 000000000..2ae0caabb --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/ja.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["ja"]={ +new_document: "新規作成", +search_button: "検索・置換", +search_command: "次を検索 / 検索窓を表示", +search: "検索", +replace: "置換", +replace_command: "置換 / 置換窓を表示", +find_next: "次を検索", +replace_all: "全置換", +reg_exp: "正規表現", +match_case: "大文字小文字の区別", +not_found: "見つかりません。", +occurrence_replaced: "置換しました。", +search_field_empty: "検索対象文字列が空です。", +restart_search_at_begin: "終端に達しました、始めに戻ります", +move_popup: "検索窓を移動", +font_size: "--フォントサイズ--", +go_to_line: "指定行へ移動", +go_to_line_prompt: "指定行へ移動します:", +undo: "元に戻す", +redo: "やり直し", +change_smooth_selection: "スムース表示の切り替え(CPUを使います)", +highlight: "構文強調表示の切り替え", +reset_highlight: "構文強調表示のリセット", +help: "ヘルプを表示", +save: "保存", +load: "読み込み", +line_abbr: "行", +char_abbr: "文字", +position: "位置", +total: "合計", +close_popup: "ポップアップを閉じる", +shortcuts: "ショートカット", +add_tab: "タブを挿入する", +remove_tab: "タブを削除する", +about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。", +toggle: "テキストエリアとeditAreaの切り替え", +accesskey: "アクセスキー", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "処理中です...", +fullscreen: "fullscreen" +}; \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/nl.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/nl.js new file mode 100755 index 000000000..b768481d4 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/nl.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["nl"]={ +new_document: "nieuw leeg document", +search_button: "zoek en vervang", +search_command: "zoek volgende / zoekscherm openen", +search: "zoek", +replace: "vervang", +replace_command: "vervang / zoekscherm openen", +find_next: "volgende vinden", +replace_all: "alles vervangen", +reg_exp: "reguliere expressies", +match_case: "hoofdletter gevoelig", +not_found: "niet gevonden.", +occurrence_replaced: "object vervangen.", +search_field_empty: "Zoek veld leeg", +restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw", +move_popup: "versleep zoek scherm", +font_size: "--Letter grootte--", +go_to_line: "Ga naar regel", +go_to_line_prompt: "Ga naar regel nummer:", +undo: "Ongedaan maken", +redo: "Opnieuw doen", +change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)", +highlight: "zet syntax highlight aan/uit", +reset_highlight: "reset highlight (indien gedesynchronizeerd)", +help: "informatie", +save: "opslaan", +load: "laden", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Positie", +total: "Totaal", +close_popup: "Popup sluiten", +shortcuts: "Snelkoppelingen", +add_tab: "voeg tabs toe in tekst", +remove_tab: "verwijder tabs uit tekst", +about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst", +toggle: "geavanceerde bewerkingsopties", +accesskey: "Accessknop", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Verwerken...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pl.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pl.js new file mode 100755 index 000000000..a403dad2f --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pl.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["pl"]={ +new_document: "nowy dokument", +search_button: "znajdź i zamień", +search_command: "znajdź następny", +search: "znajdź", +replace: "zamień", +replace_command: "zamień", +find_next: "następny", +replace_all: "zamień wszystko", +reg_exp: "wyrażenie regularne", +match_case: "uwzględnij wielkość liter
", +not_found: "nie znaleziono.", +occurrence_replaced: "wystąpień zamieniono.", +search_field_empty: "Nie wprowadzono tekstu", +restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.", +move_popup: "przesuń okienko wyszukiwania", +font_size: "Rozmiar", +go_to_line: "idź do linii", +go_to_line_prompt: "numer linii:", +undo: "cofnij", +redo: "przywróć", +change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)", +highlight: "włącz/wyłącz podświetlanie składni", +reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)", +help: "o programie", +save: "zapisz", +load: "otwórz", +line_abbr: "Ln", +char_abbr: "Zn", +position: "Pozycja", +total: "W sumie", +close_popup: "zamknij okienko", +shortcuts: "Skróty klawiaturowe", +add_tab: "dodaj wcięcie do zaznaczonego tekstu", +remove_tab: "usuń wcięcie", +about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów", +toggle: "Włącz/wyłącz edytor", +accesskey: "Alt+", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Przetwarzanie...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pt.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pt.js new file mode 100755 index 000000000..3ffad3374 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/pt.js @@ -0,0 +1,45 @@ +editAreaLoader.lang["pt"]={ +new_document: "Novo documento", +search_button: "Localizar e substituir", +search_command: "Localizar próximo", +search: "Localizar", +replace: "Substituir", +replace_command: "Substituir", +find_next: "Localizar", +replace_all: "Subst. tudo", +reg_exp: "Expressões regulares", +match_case: "Diferenciar maiúsculas e minúsculas", +not_found: "Não encontrado.", +occurrence_replaced: "Ocorrências substituidas", +search_field_empty: "Campo localizar vazio.", +restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.", +move_popup: "Mover janela", +font_size: "--Tamanho da fonte--", +go_to_line: "Ir para linha", +go_to_line_prompt: "Ir para a linha:", +undo: "Desfazer", +redo: "Refazer", +change_smooth_selection: "Opções visuais", +highlight: "Cores de sintaxe", +reset_highlight: "Resetar cores (se não sincronizado)", +help: "Sobre", +save: "Salvar", +load: "Carregar", +line_abbr: "Ln", +char_abbr: "Ch", +position: "Posição", +total: "Total", +close_popup: "Fechar", +shortcuts: "Shortcuts", +add_tab: "Adicionar tabulação", +remove_tab: "Remover tabulação", +about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos", +toggle: "Exibir editor", +accesskey: "Accesskey", +tab: "Tab", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "Processando...", +fullscreen: "fullscreen" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/zh_cn.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/zh_cn.js new file mode 100755 index 000000000..055eabb47 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/zh_cn.js @@ -0,0 +1,46 @@ +editAreaLoader.lang["zh_cn"]={ +new_document: "½ļ", +search_button: "滻", +search_command: "²/򿪲ҿ", +search: "", +replace: "滻", +replace_command: "滻/򿪲ҿ", +find_next: "һ", +replace_all: "滻ȫ", +reg_exp: "ʽ", +match_case: "Сд", +not_found: "ƥ.", +occurrence_replaced: "滻.", +search_field_empty: "ҹؼΪ", +restart_search_at_begin: "Ѵֿף¿ʼ.", +move_popup: "ƶҴ", +font_size: "--ִС--", +go_to_line: "ָ", +go_to_line_prompt: "ƶָ:", +undo: "һ", +redo: "һ", +change_smooth_selection: "/ֹijЩʾЧ", +highlight: "", +reset_highlight: "", +help: "", +save: "", +save_as: "Ϊ", +load: "", +line_abbr: "", +char_abbr: "ֽ", +position: "λ", +total: "ܹ", +close_popup: "رմ", +shortcuts: "ݼ", +add_tab: "Ӽ", +remove_tab: "ɾ", +about_notice: "ʾ߶ȹֻСĵ", +toggle: "ת༭", +accesskey: "ɷʼ", +tab: "", +shift: "Shift", +ctrl: "Ctrl", +esc: "Esc", +processing: "...", +fullscreen: "ȫ" +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/basic.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/basic.js new file mode 100755 index 000000000..8a5849cd4 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/basic.js @@ -0,0 +1,69 @@ +editAreaLoader.load_syntax["basic"] = { + 'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'} + ,'COMMENT_MULTI' : { } + ,'QUOTEMARKS' : {1: '"'} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + 'statements' : [ + 'if','then','for','wend','while', + 'else','elseif','select','case','end select', + 'until','next','step','to','end if', 'call' + ] + ,'keywords' : [ + 'sub', 'end sub', 'function', 'end function', 'exit', + 'exit function', 'dim', 'redim', 'shared', 'const', + 'is', 'absolute', 'access', 'any', 'append', 'as', + 'base', 'beep', 'binary', 'bload', 'bsave', 'chain', + 'chdir', 'circle', 'clear', 'close', 'cls', 'color', + 'com', 'common', 'data', 'date', 'declare', 'def', + 'defdbl', 'defint', 'deflng', 'defsng', 'defstr', + 'double', 'draw', 'environ', 'erase', 'error', 'field', + 'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key', + 'kill', 'let', 'line', 'list', 'locate', 'lock', 'long', + 'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open', + 'option', 'out', 'output', 'paint', 'palette', 'pcopy', + 'poke', 'preset', 'print', 'pset', 'put', 'random', + 'randomize', 'read', 'reset', 'restore', 'resume', + 'return', 'rmdir', 'rset', 'run', 'screen', 'seg', + 'shell', 'single', 'sleep', 'sound', 'static', 'stop', + 'strig', 'string', 'swap', 'system', 'time', 'timer', + 'troff', 'tron', 'type', 'unlock', 'using', 'view', + 'wait', 'width', 'window', 'write' + ] + ,'functions' : [ + 'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng', + 'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl', + 'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp', + 'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey', + 'inp', 'input', 'instr', 'int', 'ioctl', 'lbound', + 'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos', + 'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks', + 'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point', + 'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin', + 'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan', + 'ubound', 'ucase', 'val', 'varptr', 'varseg' + ] + ,'operators' : [ + 'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '!', '&' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #99CC00;' + ,'QUOTESMARKS': 'color: #333399;' + ,'KEYWORDS' : { + 'keywords' : 'color: #3366FF;' + ,'functions' : 'color: #0000FF;' + ,'statements' : 'color: #3366FF;' + ,'operators' : 'color: #FF0000;' + } + ,'OPERATORS' : 'color: #FF0000;' + ,'DELIMITERS' : 'color: #0000FF;' + + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/brainfuck.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/brainfuck.js new file mode 100755 index 000000000..3625f701e --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/brainfuck.js @@ -0,0 +1,44 @@ +editAreaLoader.load_syntax["brainfuck"] = { + 'COMMENT_SINGLE' : {} + ,'COMMENT_MULTI' : {} + ,'QUOTEMARKS' : {} + ,'KEYWORD_CASE_SENSITIVE' : true + ,'OPERATORS' :[ + '+', '-' + ] + ,'DELIMITERS' :[ + '[', ']' + ] + ,'REGEXPS' : { + 'bfispis' : { + 'search' : '()(\\.)()' + ,'class' : 'bfispis' + ,'modifiers' : 'g' + ,'execute' : 'before' + } + ,'bfupis' : { + 'search' : '()(\\,)()' + ,'class' : 'bfupis' + ,'modifiers' : 'g' + ,'execute' : 'before' + } + ,'bfmemory' : { + 'search' : '()([<>])()' + ,'class' : 'bfmemory' + ,'modifiers' : 'g' + ,'execute' : 'before' + } + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'OPERATORS' : 'color: #88AA00;' + ,'DELIMITERS' : 'color: #00C138;' + ,'REGEXPS' : { + 'bfispis' : 'color: #EE0000;' + ,'bfupis' : 'color: #4455ee;' + ,'bfmemory' : 'color: #DD00DD;' + } + } +}; + diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/c.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/c.js new file mode 100755 index 000000000..d4e577122 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/c.js @@ -0,0 +1,62 @@ +editAreaLoader.load_syntax["c"] = { + 'COMMENT_SINGLE' : {1 : '//'} + ,'COMMENT_MULTI' : {'/*' : '*/'} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : true + ,'KEYWORDS' : { + 'constants' : [ + 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true' + ] + ,'types' : [ + 'FILE', 'auto', 'char', 'const', 'double', + 'extern', 'float', 'inline', 'int', 'long', 'register', + 'short', 'signed', 'size_t', 'static', 'struct', + 'time_t', 'typedef', 'union', 'unsigned', 'void', + 'volatile' + ] + ,'statements' : [ + 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof', + 'switch', 'while' + ] + ,'keywords' : [ + 'break', 'case', 'continue', 'default', 'delete', + 'return' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'REGEXPS' : { + 'precompiler' : { + 'search' : '()(#[^\r\n]*)()' + ,'class' : 'precompiler' + ,'modifiers' : 'g' + ,'execute' : 'before' + } +/* ,'precompilerstring' : { + 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])' + ,'class' : 'precompilerstring' + ,'modifiers' : 'g' + ,'execute' : 'before' + }*/ + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + 'constants' : 'color: #EE0000;' + ,'types' : 'color: #0000EE;' + ,'statements' : 'color: #60CA00;' + ,'keywords' : 'color: #48BDDF;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #0038E1;' + ,'REGEXPS' : { + 'precompiler' : 'color: #009900;' + ,'precompilerstring' : 'color: #994400;' + } + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/cpp.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/cpp.js new file mode 100755 index 000000000..e5e2be061 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/cpp.js @@ -0,0 +1,65 @@ +editAreaLoader.load_syntax["cpp"] = { + 'COMMENT_SINGLE' : {1 : '//'} + ,'COMMENT_MULTI' : {'/*' : '*/'} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : true + ,'KEYWORDS' : { + 'constants' : [ + 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr', + 'true' + ] + ,'types' : [ + 'FILE', 'auto', 'char', 'class', 'const', 'double', + 'extern', 'float', 'friend', 'inline', 'int', + 'iterator', 'long', 'map', 'operator', 'queue', + 'register', 'short', 'signed', 'size_t', 'stack', + 'static', 'string', 'struct', 'time_t', 'typedef', + 'union', 'unsigned', 'vector', 'void', 'volatile' + ] + ,'statements' : [ + 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if', + 'sizeof', 'switch', 'this', 'throw', 'try', 'while' + ] + ,'keywords' : [ + 'break', 'case', 'continue', 'default', 'delete', + 'namespace', 'new', 'private', 'protected', 'public', + 'return', 'using' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'REGEXPS' : { + 'precompiler' : { + 'search' : '()(#[^\r\n]*)()' + ,'class' : 'precompiler' + ,'modifiers' : 'g' + ,'execute' : 'before' + } +/* ,'precompilerstring' : { + 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])' + ,'class' : 'precompilerstring' + ,'modifiers' : 'g' + ,'execute' : 'before' + }*/ + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + 'constants' : 'color: #EE0000;' + ,'types' : 'color: #0000EE;' + ,'statements' : 'color: #60CA00;' + ,'keywords' : 'color: #48BDDF;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #0038E1;' + ,'REGEXPS' : { + 'precompiler' : 'color: #009900;' + ,'precompilerstring' : 'color: #994400;' + } + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/css.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/css.js new file mode 100755 index 000000000..b8131ccdd --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/css.js @@ -0,0 +1,84 @@ +editAreaLoader.load_syntax["css"] = { + 'COMMENT_SINGLE' : {1 : '@'} + ,'COMMENT_MULTI' : {'/*' : '*/'} + ,'QUOTEMARKS' : ['"', "'"] + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + 'attributes' : [ + 'aqua', 'azimuth', 'background-attachment', 'background-color', + 'background-image', 'background-position', 'background-repeat', + 'background', 'border-bottom-color', 'border-bottom-style', + 'border-bottom-width', 'border-left-color', 'border-left-style', + 'border-left-width', 'border-right', 'border-right-color', + 'border-right-style', 'border-right-width', 'border-top-color', + 'border-top-style', 'border-top-width','border-bottom', 'border-collapse', + 'border-left', 'border-width', 'border-color', 'border-spacing', + 'border-style', 'border-top', 'border', 'caption-side', + 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', + 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display', + 'elevation', 'empty-cells', 'float', 'font-family', 'font-size', + 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', + 'font-weight', 'font', 'height', 'letter-spacing', 'line-height', + 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', + 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin', + 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height', + 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style', + 'outline-width', 'overflow', 'padding-bottom', 'padding-left', + 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after', + 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before', + 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', + 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation', + 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration', + 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi', + 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', + 'width', 'word-spacing', 'z-index', 'bottom', 'left' + ] + ,'values' : [ + 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', + 'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both', + 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', + 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive', + 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', + 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded', + 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia', + 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher', + 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline', + 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana', + 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', + 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace', + 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', + 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline', + 'pointer', 'portrait', 'purple', 'px', + 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards', + 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square', + 'static', 'status-bar', 'super', 'sw-resize', + 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent', + 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url', + 'visible', + 'w-resize', 'wait', 'white', 'wider', + 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', + 'yellow', 'yes' + ] + ,'specials' : [ + 'important' + ] + } + ,'OPERATORS' :[ + ':', ';', '!', '.', '#' + ] + ,'DELIMITERS' :[ + '{', '}' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + 'attributes' : 'color: #48BDDF;' + ,'values' : 'color: #2B60FF;' + ,'specials' : 'color: #FF0000;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #60CA00;' + + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/html.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/html.js new file mode 100755 index 000000000..cc2a90e6e --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/html.js @@ -0,0 +1,50 @@ +/* +* last update: 2006-08-24 +*/ + +editAreaLoader.load_syntax["html"] = { + 'COMMENT_SINGLE' : {} + ,'COMMENT_MULTI' : {''} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + } + ,'OPERATORS' :[ + ] + ,'DELIMITERS' :[ + ] + ,'REGEXPS' : { + 'doctype' : { + 'search' : '()(]*>)()' + ,'class' : 'doctype' + ,'modifiers' : '' + ,'execute' : 'before' // before or after + } + ,'tags' : { + 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' + ,'class' : 'tags' + ,'modifiers' : 'gi' + ,'execute' : 'before' // before or after + } + ,'attributes' : { + 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' + ,'class' : 'attributes' + ,'modifiers' : 'g' + ,'execute' : 'before' // before or after + } + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + } + ,'OPERATORS' : 'color: #E775F0;' + ,'DELIMITERS' : '' + ,'REGEXPS' : { + 'attributes': 'color: #B1AC41;' + ,'tags': 'color: #E62253;' + ,'doctype': 'color: #8DCFB5;' + ,'test': 'color: #00FF00;' + } + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/js.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/js.js new file mode 100755 index 000000000..3b4ef5e53 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/js.js @@ -0,0 +1,60 @@ +editAreaLoader.load_syntax["js"] = { + 'COMMENT_SINGLE' : {1 : '//'} + ,'COMMENT_MULTI' : {'/*' : '*/'} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : true + ,'KEYWORDS' : { + 'statements' : [ + 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', + 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', + 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', + 'while', 'write', 'with' + ] + ,'keywords' : [ + 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', + 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', + 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document', + // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice + 'Link ', 'outerHeight ', 'Anchor', 'FileUpload', + 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self', + 'arguments', 'locationbar', 'pageXoffset', 'Form', + 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status', + 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy', + 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden', + 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents', + 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text', + 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity', + 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed', + 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents', + 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus', + 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document', + 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window', + 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy' + ] + ,'functions' : [ + // common functions for Window object + 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home', + 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', + 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status', + 'stop' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '%', '!' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + 'statements' : 'color: #60CA00;' + ,'keywords' : 'color: #48BDDF;' + ,'functions' : 'color: #2B60FF;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #0038E1;' + + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/pas.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/pas.js new file mode 100755 index 000000000..2038539f5 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/pas.js @@ -0,0 +1,82 @@ +editAreaLoader.load_syntax["pas"] = { + 'COMMENT_SINGLE' : {} + ,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'} + ,'QUOTEMARKS' : {1: '"', 2: "'"} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + 'constants' : [ + 'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red', + 'Magenta', 'Brown', 'LightGray', 'DarkGray', + 'LightBlue', 'LightGreen', 'LightCyan', 'LightRed', + 'LightMagenta', 'Yellow', 'White', 'MaxSIntValue', + 'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint', + 'erroraddr', 'errorcode', 'LineEnding' + ] + ,'keywords' : [ + 'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor', + 'pow', 'is', 'not','Absolute', 'And_then', 'Array', + 'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto', + 'Else', 'End', 'Export', 'File', 'For', 'Function', + 'Goto', 'If', 'Import', 'Implementation', 'Inherited', + 'Inline', 'Interface', 'Label', 'Module', 'Nil', + 'Object', 'Of', 'Only', 'Operator', 'Or_else', + 'Otherwise', 'Packed', 'Procedure', 'Program', + 'Protected', 'Qualified', 'Record', 'Repeat', + 'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit', + 'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While', + 'With' + ] + ,'functions' : [ + 'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign', + 'Assigned', 'BinStr', 'Blockread', 'Blockwrite', + 'Break', 'Chdir', 'Chr', 'Close', 'CompareByte', + 'CompareChar', 'CompareDWord', 'CompareWord', 'Concat', + 'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete', + 'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude', + 'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte', + 'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac', + 'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager', + 'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include', + 'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord', + 'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult', + 'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase', + 'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move', + 'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord', + 'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred', + 'Ptr', 'Random', 'Randomize', 'Read', 'Readln', + 'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite', + 'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof', + 'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp', + 'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf', + 'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar', + 'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val', + 'Write', 'WriteLn' + ] + ,'types' : [ + 'Integer', 'Shortint', 'SmallInt', 'Longint', + 'Longword', 'Int64', 'Byte', 'Word', 'Cardinal', + 'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char', + 'Real', 'Single', 'Double', 'Extended', 'Comp', + 'String', 'ShortString', 'AnsiString', 'PChar' + ] + } + ,'OPERATORS' :[ + '@', '*', '+', '-', '/', '^', ':=', '<', '=', '>' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + 'specials' : 'color: #EE0000;' + ,'constants' : 'color: #654321;' + ,'keywords' : 'color: #48BDDF;' + ,'functions' : 'color: #449922;' + ,'types' : 'color: #2B60FF;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #60CA00;' + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/php.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/php.js new file mode 100755 index 000000000..535a22bd3 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/php.js @@ -0,0 +1,75 @@ +editAreaLoader.load_syntax["php"] = { + 'COMMENT_SINGLE' : {1 : '//', 2 : '#'} + ,'COMMENT_MULTI' : {'/*' : '*/'} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + 'statements' : [ + 'include', 'require', 'include_once', 'require_once', + 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', + 'endif', 'switch', 'case', 'endswitch', + 'return', 'break', 'continue' + ] + ,'reserved' : [ + '_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST', + 'null', '__LINE__', '__FILE__', + 'false', '<?php', '?>', '<?', + '<script language', '</script>', + 'true', 'var', 'default', + 'function', 'class', 'new', '&new', 'this', + '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION', + 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', + 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR', + 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR', + 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL' + + ] + ,'functions' : [ + 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined', + 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions', + 'extension_loaded', 'get_extension_funcs', 'debug_backtrace', + 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv', + 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime', + 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar', + 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown', + 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate', + 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode', + 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat', + 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from', + 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport', + 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die' + + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'REGEXPS' : { + // highlight all variables ($...) + 'variables' : { + 'search' : '()(\\$\\w+)()' + ,'class' : 'variables' + ,'modifiers' : 'g' + ,'execute' : 'before' // before or after + } + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #879EFA;' + ,'KEYWORDS' : { + 'reserved' : 'color: #48BDDF;' + ,'functions' : 'color: #0040FD;' + ,'statements' : 'color: #60CA00;' + } + ,'OPERATORS' : 'color: #FF00FF;' + ,'DELIMITERS' : 'color: #2B60FF;' + ,'REGEXPS' : { + 'variables' : 'color: #E0BD54;' + } + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/python.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/python.js new file mode 100755 index 000000000..456b27e97 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/python.js @@ -0,0 +1,144 @@ +/** + * Python syntax v 1.1 + * + * v1.1 by Andre Roberge (2006/12/27) + * +**/ +editAreaLoader.load_syntax["python"] = { + 'COMMENT_SINGLE' : {1 : '#'} + ,'COMMENT_MULTI' : {} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : true + ,'KEYWORDS' : { + /* + ** Set 1: reserved words + ** http://python.org/doc/current/ref/keywords.html + ** Note: 'as' and 'with' have been added starting with Python 2.5 + */ + 'reserved' : [ + 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', + 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', + 'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise', + 'return', 'try', 'while', 'with', 'yield' + //the following are *almost* reserved; we'll treat them as such + , 'False', 'True', 'None' + ] + /* + ** Set 2: builtins + ** http://python.org/doc/current/lib/built-in-funcs.html + */ + ,'builtins' : [ + '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', + 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', + 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', + 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', + 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', + 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', + 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', + 'vars', 'xrange', 'zip', + // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html + //'False', 'True', 'None' have been included in 'reserved' + 'NotImplemented', 'Ellipsis', + // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html + 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError', + 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError', + 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError', + 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError', + 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError', + 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError', + 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning', + 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning', + 'RuntimeWarning', 'FutureWarning', + // we will include the string methods as well + // http://python.org/doc/current/lib/string-methods.html + 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', + 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle', + 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', + 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', + 'translate', 'upper', 'zfill' + ] + /* + ** Set 3: standard library + ** http://python.org/doc/current/lib/modindex.html + */ + ,'stdlib' : [ + '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm', + 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer', + 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi', + 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', + 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler', + 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt', + 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE', + 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm', + 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl', + 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl', + 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob', + 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib', + 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect', + 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap', + 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify', + 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator', + 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes', + 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile', + 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random', + 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter', + 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve', + 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd', + 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string', + 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev', + 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', + 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token', + 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2', + 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings', + 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml', + 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib' + + ] + /* + ** Set 4: special methods + ** http://python.org/doc/current/ref/specialnames.html + */ + ,'special' : [ + // Basic customization: http://python.org/doc/current/ref/customization.html + '__new__', '__init__', '__del__', '__repr__', '__str__', + '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__', + '__hash__', '__nonzero__', '__unicode__', '__dict__', + // Attribute access: http://python.org/doc/current/ref/attribute-access.html + '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__', + '__delete__', '__slots__', + // Class creation, callable objects + '__metaclass__', '__call__', + // Container types: http://python.org/doc/current/ref/sequence-types.html + '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__', + '__getslice__', '__setslice__', '__delslice__', + // Numeric types: http://python.org/doc/current/ref/numeric-types.html + '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__', + '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__', + '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__', + '__long__','__lshift__', + '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__', + '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__', + '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__', + '__sub__','__xor__' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ',' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #660066;' + ,'KEYWORDS' : { + 'reserved' : 'color: #0000FF;' + ,'builtins' : 'color: #009900;' + ,'stdlib' : 'color: #009900;' + ,'special': 'color: #006666;' + } + ,'OPERATORS' : 'color: #993300;' + ,'DELIMITERS' : 'color: #993300;' + + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/vb.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/vb.js new file mode 100755 index 000000000..18cc87cf7 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/vb.js @@ -0,0 +1,52 @@ +editAreaLoader.load_syntax["vb"] = { + 'COMMENT_SINGLE' : {1 : "'"} + ,'COMMENT_MULTI' : { } + ,'QUOTEMARKS' : {1: '"'} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + 'statements' : [ + 'if','then','for','each','while','do','loop', + 'else','elseif','select','case','end select', + 'until','next','step','to','in','end if' + ] + ,'keywords' : [ + 'empty','isempty','nothing','null','isnull','true','false', + 'set','call', + 'sub','end sub','function','end function','exit','exit function', + 'dim','Mod','In','private','public','shared','const' + ] + + ,'functions' : [ + 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime', + 'Hour','IsDate','Minute','Month', + 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year', + 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency', + 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct', + 'Rnd','Sgn','Sin','Sqr','Tan', + 'Array','Filter','IsArray','Join','LBound','Split','UBound', + 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp', + 'String','StrReverse','UCase', + 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric', + 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion', + 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType' + ] + } + ,'OPERATORS' :[ + '+', '-', '/', '*', '=', '<', '>', '!', '&' + ] + ,'DELIMITERS' :[ + '(', ')', '[', ']', '{', '}' + ] + ,'STYLES' : { + 'COMMENTS': 'color: #99CC00;' + ,'QUOTESMARKS': 'color: #333399;' + ,'KEYWORDS' : { + 'keywords' : 'color: #3366FF;' + ,'functions' : 'color: #0000FF;' + ,'statements' : 'color: #3366FF;' + } + ,'OPERATORS' : 'color: #FF0000;' + ,'DELIMITERS' : 'color: #0000FF;' + + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/xml.js b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/xml.js new file mode 100755 index 000000000..a043dd63a --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/xml.js @@ -0,0 +1,56 @@ +/* +* last update: 2006-08-24 +*/ + +editAreaLoader.load_syntax["xml"] = { + 'COMMENT_SINGLE' : {} + ,'COMMENT_MULTI' : {''} + ,'QUOTEMARKS' : {1: "'", 2: '"'} + ,'KEYWORD_CASE_SENSITIVE' : false + ,'KEYWORDS' : { + } + ,'OPERATORS' :[ + ] + ,'DELIMITERS' :[ + ] + ,'REGEXPS' : { + 'xml' : { + 'search' : '()(<\\?[^>]*?\\?>)()' + ,'class' : 'xml' + ,'modifiers' : 'g' + ,'execute' : 'before' // before or after + } + ,'cdatas' : { + 'search' : '()()()' + ,'class' : 'cdata' + ,'modifiers' : 'g' + ,'execute' : 'before' // before or after + } + ,'tags' : { + 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' + ,'class' : 'tags' + ,'modifiers' : 'gi' + ,'execute' : 'before' // before or after + } + ,'attributes' : { + 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' + ,'class' : 'attributes' + ,'modifiers' : 'g' + ,'execute' : 'before' // before or after + } + } + ,'STYLES' : { + 'COMMENTS': 'color: #AAAAAA;' + ,'QUOTESMARKS': 'color: #6381F8;' + ,'KEYWORDS' : { + } + ,'OPERATORS' : 'color: #E775F0;' + ,'DELIMITERS' : '' + ,'REGEXPS' : { + 'attributes': 'color: #B1AC41;' + ,'tags': 'color: #E62253;' + ,'xml': 'color: #8DCFB5;' + ,'cdata': 'color: #50B020;' + } + } +}; diff --git a/admin-dev/ajaxfilemanager/jscripts/for_fckeditor.js b/admin-dev/ajaxfilemanager/jscripts/for_fckeditor.js new file mode 100755 index 000000000..7cc7788f6 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/for_fckeditor.js @@ -0,0 +1,27 @@ +//function below added by logan (cailongqun [at] yahoo [dot] com [dot] cn) from www.phpletter.com +function selectFile() +{ + var selectedFileRowNum = $('#selectedFileRowNum').val(); + if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum)) + { + + // insert information now + var url = $('#fileUrl'+selectedFileRowNum).val(); + window.opener.SetUrl( url ) ; + window.close() ; + + }else + { + alert(noFileSelected); + } + + +} + + + +function cancelSelectFile() +{ + // close popup window + window.close() ; +} \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/for_form.js b/admin-dev/ajaxfilemanager/jscripts/for_form.js new file mode 100755 index 000000000..8ac37e108 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/for_form.js @@ -0,0 +1,16 @@ +function selectFile(url) +{ + window.opener.document.getElementById(elementId).value = url; + window.close() ; + + +} + + + +function cancelSelectFile() +{ + // close popup window + window.close() ; +} + diff --git a/admin-dev/ajaxfilemanager/jscripts/for_stand_alone.js b/admin-dev/ajaxfilemanager/jscripts/for_stand_alone.js new file mode 100755 index 000000000..16b2dc8af --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/for_stand_alone.js @@ -0,0 +1,5 @@ +function cancelSelectFile() +{ + // close popup window + window.close(); +} \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/jscripts/for_tinymce.js b/admin-dev/ajaxfilemanager/jscripts/for_tinymce.js new file mode 100755 index 000000000..bc8cfa6b9 --- /dev/null +++ b/admin-dev/ajaxfilemanager/jscripts/for_tinymce.js @@ -0,0 +1,248 @@ +// Some global instances +var tinymce = null, tinyMCEPopup, tinyMCE; + +tinyMCEPopup = { + init : function() { + var t = this, w = t.getWin(), ti; + + // Find API + tinymce = w.tinymce; + tinyMCE = w.tinyMCE; + t.editor = tinymce.EditorManager.activeEditor; + t.params = t.editor.windowManager.params; + + // Setup local DOM + t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); + t.dom.loadCSS(t.editor.settings.popup_css); + + // Setup on init listeners + t.listeners = []; + t.onInit = { + add : function(f, s) { + t.listeners.push({func : f, scope : s}); + } + }; + + t.isWindow = !t.getWindowArg('mce_inline'); + t.id = t.getWindowArg('mce_window_id'); + t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window); + }, + + getWin : function() { + return window.dialogArguments || opener || parent || top; + }, + + getWindowArg : function(n, dv) { + var v = this.params[n]; + + return tinymce.is(v) ? v : dv; + }, + + getParam : function(n, dv) { + return this.editor.getParam(n, dv); + }, + + getLang : function(n, dv) { + return this.editor.getLang(n, dv); + }, + + execCommand : function(cmd, ui, val) { + this.restoreSelection(); + return this.editor.execCommand(cmd, ui, val); + }, + + resizeToInnerSize : function() { + var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh; + + dw = t.getWindowArg('mce_width') - vp.w; + dh = t.getWindowArg('mce_height') - vp.h; + + if (t.isWindow) + window.resizeBy(dw, dh); + else + t.editor.windowManager.resizeBy(dw, dh, t.id); + }, + + executeOnLoad : function(s) { + this.onInit.add(function() { + eval(s); + }); + }, + + storeSelection : function() { + this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple'); + }, + + restoreSelection : function() { + var t = tinyMCEPopup; + + if (!t.isWindow && tinymce.isIE) + t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark); + }, + + requireLangPack : function() { + var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url'); + + if (u) + document.write(''); + }, + + pickColor : function(e, element_id) { + this.execCommand('mceColorPicker', true, { + color : document.getElementById(element_id).value, + func : function(c) { + document.getElementById(element_id).value = c; + + if (tinymce.is(document.getElementById(element_id).onchange, 'function')) + document.getElementById(element_id).onchange(); + } + }); + }, + + openBrowser : function(element_id, type, option) { + tinyMCEPopup.restoreSelection(); + this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); + }, + + close : function() { + var t = this; + + t.dom = t.dom.doc = null; // Cleanup + t.editor.windowManager.close(window, t.id); + }, + + // Internal functions + + _restoreSelection : function() { + var e = window.event.srcElement; + + if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) + tinyMCEPopup.restoreSelection(); + }, + +/* _restoreSelection : function() { + var e = window.event.srcElement; + + // If user focus a non text input or textarea + if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') + tinyMCEPopup.restoreSelection(); + },*/ + + _onDOMLoaded : function() { + var t = this, ti = document.title, bm, h; + + // Translate page + h = document.body.innerHTML; + + // Replace a=x with a="x" in IE + if (tinymce.isIE) + h = h.replace(/ (value|title|alt)=([^\s>]+)/gi, ' $1="$2"'); + + document.body.innerHTML = t.editor.translate(h); + document.title = ti = t.editor.translate(ti); + document.body.style.display = ''; + + // Restore selection in IE when focus is placed on a non textarea or input element of the type text + if (tinymce.isIE) + document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); + + t.restoreSelection(); + + // Call onInit + tinymce.each(t.listeners, function(o) { + o.func.call(o.scope, t.editor); + }); + + t.resizeToInnerSize(); + + if (t.isWindow) + window.focus(); + else + t.editor.windowManager.setTitle(ti, t.id); + + if (!tinymce.isIE && !t.isWindow) { + tinymce.dom.Event._add(document, 'focus', function() { + t.editor.windowManager.focus(t.id) + }); + } + + // Patch for accessibility + tinymce.each(t.dom.select('select'), function(e) { + e.onkeydown = tinyMCEPopup._accessHandler; + }); + + // Move focus to window + window.focus(); + }, + + _accessHandler : function(e) { + var e = e || window.event; + + if (e.keyCode == 13 || e.keyCode == 32) { + e = e.target || e.srcElement; + + if (e.onchange) + e.onchange(); + + return tinymce.dom.Event.cancel(e); + } + }, + + _wait : function() { + var t = this, ti; + + if (tinymce.isIE && document.location.protocol != 'https:') { + // Fake DOMContentLoaded on IE + document.write(''; + $iso = Db::getInstance()->getValue('SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE `id_lang` = '.(int)($cookie->id_lang)); + if ($iso != 'en') + echo ''; + echo ''; +} + +/** + * Generate a new settings file, only transmitted parameters are updated + * + * @param string $baseUri Base URI + * @param string $theme Theme name (eg. default) + * @param array $arrayDB Parameters in order to connect to database + */ +function rewriteSettingsFile($baseUrls = NULL, $theme = NULL, $arrayDB = NULL) +{ + $defines = array(); + $defines['__PS_BASE_URI__'] = ($baseUrls AND $baseUrls['__PS_BASE_URI__']) ? $baseUrls['__PS_BASE_URI__'] : __PS_BASE_URI__; + $defines['_MEDIA_SERVER_1_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_1_'])) ? $baseUrls['_MEDIA_SERVER_1_'] : _MEDIA_SERVER_1_; + $defines['_MEDIA_SERVER_2_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_2_'])) ? $baseUrls['_MEDIA_SERVER_2_'] : _MEDIA_SERVER_2_; + $defines['_MEDIA_SERVER_3_'] = ($baseUrls AND isset($baseUrls['_MEDIA_SERVER_3_'])) ? $baseUrls['_MEDIA_SERVER_3_'] : _MEDIA_SERVER_3_; + $defines['_PS_CACHING_SYSTEM_'] = _PS_CACHING_SYSTEM_; + $defines['_PS_CACHE_ENABLED_'] = _PS_CACHE_ENABLED_; + $defines['_THEME_NAME_'] = $theme ? $theme : _THEME_NAME_; + $defines['_DB_NAME_'] = (($arrayDB AND isset($arrayDB['_DB_NAME_'])) ? $arrayDB['_DB_NAME_'] : _DB_NAME_); + $defines['_MYSQL_ENGINE_'] = _MYSQL_ENGINE_; + $defines['_DB_SERVER_'] = (($arrayDB AND isset($arrayDB['_DB_SERVER_'])) ? $arrayDB['_DB_SERVER_'] : _DB_SERVER_); + $defines['_DB_USER_'] = (($arrayDB AND isset($arrayDB['_DB_USER_'])) ? $arrayDB['_DB_USER_'] : _DB_USER_); + $defines['_DB_PREFIX_'] = (($arrayDB AND isset($arrayDB['_DB_PREFIX_'])) ? $arrayDB['_DB_PREFIX_'] : _DB_PREFIX_); + $defines['_DB_PASSWD_'] = (($arrayDB AND isset($arrayDB['_DB_PASSWD_'])) ? $arrayDB['_DB_PASSWD_'] : _DB_PASSWD_); + $defines['_DB_TYPE_'] = (($arrayDB AND isset($arrayDB['_DB_TYPE_'])) ? $arrayDB['_DB_TYPE_'] : _DB_TYPE_); + $defines['_COOKIE_KEY_'] = addslashes(_COOKIE_KEY_); + $defines['_COOKIE_IV_'] = addslashes(_COOKIE_IV_); + if (defined('_RIJNDAEL_KEY_')) + $defines['_RIJNDAEL_KEY_'] = addslashes(_RIJNDAEL_KEY_); + if (defined('_RIJNDAEL_IV_')) + $defines['_RIJNDAEL_IV_'] = addslashes(_RIJNDAEL_IV_); + $defines['_PS_VERSION_'] = addslashes(_PS_VERSION_); + $content = " $value) + $content .= 'define(\''.$k.'\', \''.addslashes($value).'\');'."\n"; + $content .= "\n?>"; + if ($fd = @fopen(PS_ADMIN_DIR.'/../config/settings.inc.php', 'w')) + { + fwrite($fd, $content); + fclose($fd); + return true; + } + return false; +} + +/** + * Display SQL date in friendly format + * + * @param string $sqlDate Date in SQL format (YYYY-MM-DD HH:mm:ss) + * @param boolean $withTime Display both date and time + * @todo Several formats (french : DD-MM-YYYY) + */ +function displayDate($sqlDate, $withTime = false) +{ + return strftime('%Y-%m-%d'.($withTime ? ' %H:%M:%S' : ''), strtotime($sqlDate)); +} + +/** + * Return path to a product category + * + * @param string $urlBase Start URL + * @param integer $id_category Start category + * @param string $path Current path + * @param string $highlight String to highlight (in XHTML/CSS) + * @param string $type Category type (products/cms) + */ +function getPath($urlBase, $id_category, $path = '', $highlight = '', $categoryType = 'catalog') +{ + global $cookie; + + if ($categoryType == 'catalog') + { + $category = Db::getInstance()->getRow(' + SELECT id_category, level_depth, nleft, nright + FROM '._DB_PREFIX_.'category + WHERE id_category = '.(int)$id_category); + + if (isset($category['id_category'])) + { + $categories = Db::getInstance()->ExecuteS(' + SELECT c.id_category, cl.name, cl.link_rewrite + FROM '._DB_PREFIX_.'category c + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category) + WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).' + ORDER BY c.level_depth ASC + LIMIT '.(int)($category['level_depth'] + 1)); + + $fullPath = ''; + $n = 1; + $nCategories = (int)sizeof($categories); + foreach ($categories AS $category) + { + $edit = ' '; + $fullPath .= $edit. + ($n < $nCategories ? '' : ''). + (!empty($highlight) ? str_ireplace($highlight, ''.htmlentities($highlight, ENT_NOQUOTES, 'UTF-8').'', $category['name']) : $category['name']). + ($n < $nCategories ? '' : ''). + (($n++ != $nCategories OR !empty($path)) ? ' > ' : ''); + } + + return $fullPath.$path; + } + } + elseif ($categoryType == 'cms') + { + $category = new CMSCategory($id_category, (int)($cookie->id_lang)); + if (!$category->id) + return $path; + + $name = ($highlight != NULL) ? str_ireplace($highlight, ''.$highlight.'', CMSCategory::hideCMSCategoryPosition($category->name)) : CMSCategory::hideCMSCategoryPosition($category->name); + $edit = ' + Modify '; + if ($category->id == 1) + $edit = ' + Home '; + $path = $edit.' + '.$name.' > '.$path; + if ($category->id == 1) + return substr($path, 0, strlen($path) - 3); + return getPath($urlBase, $category->id_parent, $path, '', 'cms'); + } +} + +function getDirContent($path) +{ + $content = array(); + if (is_dir($path)) + { + $d = dir($path); + while (false !== ($entry = $d->read())) + if ($entry{0} != '.') + $content[] = $entry; + $d->close(); + } + return $content; +} + +function createDir($path, $rights) +{ + if (file_exists($path)) + return true; + return @mkdir($path, $rights); +} + +function checkPSVersion() +{ + libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3)))); + if ($feed = @simplexml_load_file('http://www.prestashop.com/xml/version.xml') AND _PS_VERSION_ < $feed->version->num) + return array('name' => $feed->version->name, 'link' => $feed->download->link); + return false; +} + +function translate($string) +{ + global $_LANGADM; + if (!is_array($_LANGADM)) + return str_replace('"', '"', $string); + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : ((key_exists('index'.$key, $_LANGADM)) ? $_LANGADM['index'.$key] : $string); + return str_replace('"', '"', stripslashes($str)); +} + +function recursiveTab($id_tab) +{ + global $cookie, $tabs; + + $adminTab = Tab::getTab((int)($cookie->id_lang), $id_tab); + $tabs[]= $adminTab; + if ($adminTab['id_parent'] > 0) + recursiveTab($adminTab['id_parent']); +} + +function checkingTab($tab) +{ + global $adminObj, $cookie; + + $tab = trim($tab); + if (!Validate::isTabName($tab)) + return false; + if (!($id_tab = Tab::getIdFromClassName($tab))) + { + if (isset(AdminTab::$tabParenting[$tab])) + Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab])); + echo Tools::displayError('Tab cannot be found.'); + return false; + } + if ($module = Db::getInstance()->getValue('SELECT module FROM '._DB_PREFIX_.'tab WHERE class_name = \''.pSQL($tab).'\'') AND file_exists(_PS_MODULE_DIR_.'/'.$module.'/'.$tab.'.php')) + include_once(_PS_MODULE_DIR_.'/'.$module.'/'.$tab.'.php'); + elseif (file_exists(PS_ADMIN_DIR.'/tabs/'.$tab.'.php')) + include_once(PS_ADMIN_DIR.'/tabs/'.$tab.'.php'); + + if (!class_exists($tab, false) OR !$id_tab) + { + echo Tools::displayError('Tab file cannot be found.'); + return false; + } + $adminObj = new $tab; + if (!$adminObj->viewAccess() AND ($adminObj->table != 'employee' OR $cookie->id_employee != Tools::getValue('id_employee') OR !Tools::isSubmit('updateemployee'))) + { + $adminObj->_errors = array(Tools::displayError('Access denied')); + echo $adminObj->displayErrors(); + return false; + } + return ($id_tab); +} + +function checkTabRights($id_tab) +{ + global $cookie; + static $tabAccesses = NULL; + + if ($tabAccesses === NULL) + $tabAccesses = Profile::getProfileAccesses($cookie->profile); + + if (isset($tabAccesses[(int)($id_tab)]['view'])) + return ($tabAccesses[(int)($id_tab)]['view'] === '1'); + return false; +} + + +/** + * Converts a simpleXML element into an array. Preserves attributes and everything. + * You can choose to get your elements either flattened, or stored in a custom index that + * you define. + * For example, for a given element + * + * if you choose to flatten attributes, you would get: + * $array['field']['name'] = 'someName'; + * $array['field']['type'] = 'someType'; + * If you choose not to flatten, you get: + * $array['field']['@attributes']['name'] = 'someName'; + * _____________________________________ + * Repeating fields are stored in indexed arrays. so for a markup such as: + * + * a + * b + * c + * + * you array would be: + * $array['parent']['child'][0] = 'a'; + * $array['parent']['child'][1] = 'b'; + * ...And so on. + * _____________________________________ + * @param simpleXMLElement $xml the XML to convert + * @param boolean $flattenValues Choose wether to flatten values + * or to set them under a particular index. + * defaults to true; + * @param boolean $flattenAttributes Choose wether to flatten attributes + * or to set them under a particular index. + * Defaults to true; + * @param boolean $flattenChildren Choose wether to flatten children + * or to set them under a particular index. + * Defaults to true; + * @param string $valueKey index for values, in case $flattenValues was set to + * false. Defaults to "@value" + * @param string $attributesKey index for attributes, in case $flattenAttributes was set to + * false. Defaults to "@attributes" + * @param string $childrenKey index for children, in case $flattenChildren was set to + * false. Defaults to "@children" + * @return array the resulting array. + */ +function simpleXMLToArray ($xml, $flattenValues = true, $flattenAttributes = true, $flattenChildren = true, $valueKey = '@value', $attributesKey = '@attributes', $childrenKey = '@children') +{ + $return = array(); + if (!($xml instanceof SimpleXMLElement)) + return $return; + + $name = $xml->getName(); + $_value = trim((string)$xml); + if (strlen($_value) == 0) + $_value = null; + + if ($_value !== null) + { + if (!$flattenValues) + $return[$valueKey] = $_value; + else + $return = $_value; + } + + $children = array(); + $first = true; + foreach($xml->children() as $elementName => $child) + { + $value = simpleXMLToArray($child, $flattenValues, $flattenAttributes, $flattenChildren, $valueKey, $attributesKey, $childrenKey); + if (isset($children[$elementName])) + { + if ($first) + { + $temp = $children[$elementName]; + unset($children[$elementName]); + $children[$elementName][] = $temp; + $first=false; + } + $children[$elementName][] = $value; + } + else + $children[$elementName] = $value; + } + + if (count($children) > 0 ) + { + if (!$flattenChildren) + $return[$childrenKey] = $children; + else + $return = array_merge($return, $children); + } + + $attributes = array(); + foreach($xml->attributes() as $name => $value) + $attributes[$name] = trim($value); + + if (count($attributes) > 0) + { + if (!$flattenAttributes) + $return[$attributesKey] = $attributes; + else + $return = array_merge($return, $attributes); + } + + return $return; +} diff --git a/admin-dev/get-file-admin.php b/admin-dev/get-file-admin.php new file mode 100644 index 000000000..3d179a1ee --- /dev/null +++ b/admin-dev/get-file-admin.php @@ -0,0 +1,31 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); + +include(PS_ADMIN_DIR.'/../get-file.php'); + diff --git a/admin-dev/grider.php b/admin-dev/grider.php new file mode 100644 index 000000000..7dffa2594 --- /dev/null +++ b/admin-dev/grider.php @@ -0,0 +1,64 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../config/config.inc.php'); +$cookie = new Cookie('psAdmin'); + +$module = Tools::getValue('module'); +$render = Tools::getValue('render'); +$type = Tools::getValue('type'); +$option = Tools::getValue('option'); +$width = (int)(Tools::getValue('width', 600)); +$height = (int)(Tools::getValue('height', 920)); +$start = (int)(Tools::getValue('start', 0)); +$limit = (int)(Tools::getValue('limit', 40)); +$sort = Tools::getValue('sort', 0); // Should be a String. Default value is an Integer because we don't know what can be the name of the column to sort. +$dir = Tools::getValue('dir', 0); // Should be a String : Either ASC or DESC +$id_employee = (int)(Tools::getValue('id_employee')); +$id_lang = (int)(Tools::getValue('id_lang')); + +if ($cookie->id_employee != $id_employee) + die; + +if (!Validate::isModuleName($module)) + die(Tools::displayError()); + +if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) + die(Tools::displayError()); + +require_once($module_path); + +$grid = new $module(); +$grid->setEmployee($id_employee); +$grid->setLang($id_lang); +if ($option) + $grid->setOption($option); + +$grid->create($render, $type, $width, $height, $start, $limit, $sort, $dir); +$grid->render(); + + diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php new file mode 100644 index 000000000..67c783879 --- /dev/null +++ b/admin-dev/header.inc.php @@ -0,0 +1,173 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +// P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) +header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); +header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); +header('Pragma: no-cache'); +header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); + +require_once(dirname(__FILE__).'/init.php'); + +echo ' + + + + + + + + + PrestaShop™ - '.translate('Administration panel').' + + + + + + + + + + '.Module::hookExec('backOfficeHeader').' + + + + bo_color)) ? 'style="background:'.Tools::htmlentitiesUTF8($employee->bo_color).'"' : '').'> +
+
+
+ '.Configuration::get('PS_SHOP_NAME').'
+ '.Tools::substr($employee->firstname, 0, 1).'. '.htmlentities($employee->lastname, ENT_COMPAT, 'UTF-8').' + [ '.translate('logout').' ] + - '.translate('View my shop').' + - '.translate('My preferences').' +
+ +
+ + +
+
 
+ '.Module::hookExec('backOfficeTop').' + '.$echoLis; +if ($employee->bo_uimode == 'hover') + echo ' '; +echo ' +
+
' + .(file_exists(PS_ADMIN_DIR.'/../install') ? '
' + .translate('For security reasons, you must also:').' '. + translate('deleted the /install folder'). + '
' : '').' + '; diff --git a/admin-dev/import/.htaccess b/admin-dev/import/.htaccess new file mode 100644 index 000000000..66d49b1bd --- /dev/null +++ b/admin-dev/import/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/admin-dev/import/index.php b/admin-dev/import/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/admin-dev/import/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/admin-dev/index.php b/admin-dev/index.php new file mode 100644 index 000000000..bcb23420e --- /dev/null +++ b/admin-dev/index.php @@ -0,0 +1,142 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('_PS_ADMIN_DIR_', getcwd()); +define('PS_ADMIN_DIR', _PS_ADMIN_DIR_); // Retro-compatibility + +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +include(PS_ADMIN_DIR.'/functions.php'); +include(PS_ADMIN_DIR.'/header.inc.php'); +if (empty($tab) and !sizeof($_POST)) +{ + $tab = 'AdminHome'; + $_POST['tab'] = 'AdminHome'; + $_POST['token'] = Tools::getAdminToken($tab.intval(checkingTab($tab)).intval($cookie->id_employee)); +} + + + if ($id_tab = checkingTab($tab)) + { + $isoUser = Language::getIsoById(intval($cookie->id_lang)); + $tabs = array(); + recursiveTab($id_tab); + $tabs = array_reverse($tabs); + $bread = ''; + $country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT')); + + foreach ($tabs AS $key => $item) + $bread .= ' + '.((sizeof($tabs) - 1 > $key) + ? '' + : '').' + '.$item['name'].((sizeof($tabs) - 1 > $key) ? '' : ''); + + echo''; + + + echo '
+ + '.translate('Back Office').' + '.$bread.' +
'; + + if (Validate::isLoadedObject($adminObj)) + { + if ($adminObj->checkToken()) + { + /* Filter memorization */ + if (isset($_POST) AND !empty($_POST) AND isset($adminObj->table)) + foreach ($_POST AS $key => $value) + if (is_array($adminObj->table)) + { + foreach ($adminObj->table AS $table) + if (strncmp($key, $table.'Filter_', 7) === 0 OR strncmp($key, 'submitFilter', 12) === 0) + $cookie->$key = !is_array($value) ? $value : serialize($value); + } + elseif (strncmp($key, $adminObj->table.'Filter_', 7) === 0 OR strncmp($key, 'submitFilter', 12) === 0) + $cookie->$key = !is_array($value) ? $value : serialize($value); + + if (isset($_GET) AND !empty($_GET) AND isset($adminObj->table)) + foreach ($_GET AS $key => $value) + if (is_array($adminObj->table)) + { + foreach ($adminObj->table AS $table) + if (strncmp($key, $table.'OrderBy', 7) === 0 OR strncmp($key, $table.'Orderway', 8) === 0) + $cookie->$key = $value; + } + elseif (strncmp($key, $adminObj->table.'OrderBy', 7) === 0 OR strncmp($key, $adminObj->table.'Orderway', 12) === 0) + $cookie->$key = $value; + + $adminObj->displayConf(); + $adminObj->postProcess(); + $adminObj->displayErrors(); + $adminObj->display(); + } + else + { + // If this is an XSS attempt, then we should only display a simple, secure page + ob_clean(); + + // ${1} in the replacement string of the regexp is required, because the token may begin with a number and mix up with it (e.g. $17) + $url = preg_replace('/([&?]token=)[^&]*(&.*)?$/', '${1}'.$adminObj->token.'$2', $_SERVER['REQUEST_URI']); + if (false === strpos($url, '?token=') AND false === strpos($url, '&token=')) + $url .= '&token='.$adminObj->token; + + $message = translate('Invalid security token'); + echo ''.$message.' +
+ + '.$message.' +
'; + echo ' + + + + + + '; + die; + } + } + } + +include(PS_ADMIN_DIR.'/footer.inc.php'); + diff --git a/admin-dev/init.php b/admin-dev/init.php new file mode 100644 index 000000000..0171adbb2 --- /dev/null +++ b/admin-dev/init.php @@ -0,0 +1,82 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +ob_start(); +$timerStart = microtime(true); + +$currentFileName = array_reverse(explode("/", $_SERVER['SCRIPT_NAME'])); +$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -strlen($currentFileName['0']))); +if (isset($_GET['logout'])) + $cookie->logout(); + +if (!$cookie->isLoggedBack()) +{ + + $destination = substr($_SERVER['REQUEST_URI'], strlen(dirname($_SERVER['SCRIPT_NAME'])) + 1); + Tools::redirectAdmin('login.php'.(empty($destination) || ($destination == 'index.php?logout') ? '' : '?redirect='.$destination)); +} +else +{ + $link = new Link(); + + $currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : ''); + if ($back = Tools::getValue('back')) + $currentIndex .= '&back='.urlencode($back); + + /* Server Params */ + $protocol_link = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $protocol_content = (isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + define('_PS_BASE_URL_', Tools::getShopDomain(true)); + define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); + + $employee = new Employee((int)$cookie->id_employee); + $cookie->id_lang = (int)$employee->id_lang; + $iso = strtolower(Language::getIsoById($cookie->id_lang ? $cookie->id_lang : Configuration::get('PS_LANG_DEFAULT'))); + include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php'); + include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php'); + include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); + + /* attribute id_lang is often needed, so we create a constant for performance reasons */ + define('_USER_ID_LANG_', (int)$cookie->id_lang); + + $path = dirname(__FILE__).'/themes/'; + if (empty($employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css')) + { + if (file_exists($path.'oldschool/admin.css')) + $employee->bo_theme = 'oldschool'; + elseif (file_exists($path.'origins/admin.css')) + $employee->bo_theme = 'origins'; + else + foreach (scandir($path) as $theme) + if ($theme[0] != '.' AND file_exists($path.$theme.'/admin.css')) + { + $employee->bo_theme = $theme; + break; + } + $employee->update(); + } +} diff --git a/admin-dev/login.php b/admin-dev/login.php new file mode 100644 index 000000000..251b05860 --- /dev/null +++ b/admin-dev/login.php @@ -0,0 +1,171 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +ob_start(); +define('PS_ADMIN_DIR', getcwd()); + +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +include(PS_ADMIN_DIR.'/functions.php'); + +if ((empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off') + AND Configuration::get('PS_SSL_ENABLED')) +{ + header('HTTP/1.1 301 Moved Permanently'); + header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); + exit(); +} + +$errors = array(); + +$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10)); +if (!isset($cookie->id_lang)) + $cookie->id_lang = Configuration::get('PS_LANG_DEFAULT'); +$iso = strtolower(Language::getIsoById((int)($cookie->id_lang))); +include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); +include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php'); + +/* Cookie creation and redirection */ +if (Tools::isSubmit('Submit')) +{ + /* Check fields validity */ + $passwd = trim(Tools::getValue('passwd')); + $email = trim(Tools::getValue('email')); + if (empty($email)) + $errors[] = Tools::displayError('E-mail is empty'); + elseif (!Validate::isEmail($email)) + $errors[] = Tools::displayError('Invalid e-mail address'); + elseif (empty($passwd)) + $errors[] = Tools::displayError('Password is blank'); + elseif (!Validate::isPasswd($passwd)) + $errors[] = Tools::displayError('Invalid password'); + else + { + /* Seeking for employee */ + $employee = new Employee(); + $employee = $employee->getByemail($email, $passwd); + if (!$employee) + { + $errors[] = Tools::displayError('Employee does not exist or password is incorrect.'); + $cookie->logout(); + } + else + { + /* Creating cookie */ + $cookie->id_employee = $employee->id; + $cookie->email = $employee->email; + $cookie->profile = $employee->id_profile; + $cookie->passwd = $employee->passwd; + $cookie->remote_addr = ip2long(Tools::getRemoteAddr()); + $cookie->write(); + /* Redirect to admin panel */ + if (isset($_GET['redirect'])) + $url = strval($_GET['redirect'].(isset($_GET['token']) ? ('&token='.$_GET['token']) : '')); + else + $url = 'index.php'; + if (!Validate::isCleanHtml($url)) + die(Tools::displayError()); + echo ' + + + + + + + '; + exit ; + } + } +} + +echo ' + + + + + PrestaShop™ - '.translate('Administration panel').''; +echo ' + + +
'; + +if ($nbErrors = sizeof($errors)) +{ + echo ' +
+

'.($nbErrors > 1 ? translate('There are') : translate('There is')).' '.$nbErrors.' '.($nbErrors > 1 ? translate('errors') : translate('error')).'

+
    '; + foreach ($errors AS $error) + echo '
  1. '.$error.'
  2. '; + echo ' +
+
+
'; +} + +echo ' +
+

'.Tools::htmlentitiesUTF8(Configuration::get('PS_SHOP_NAME')).'

+
'; + +$randomNb = rand(100, 999); +if(file_exists(PS_ADMIN_DIR.'/../install') OR file_exists(PS_ADMIN_DIR.'/../admin')) +{ + echo ' '.translate('For security reasons, you cannot connect to the Back Office until after you have:').'

+ - '.translate('deleted the /install folder').'
+ - '.translate('renamed the /admin folder (eg. ').'/admin'.$randomNb.')
+
'.translate('Please then access this page by the new url (eg. http://www.domain.tld/admin').$randomNb.')
'; +} +else +{ + echo '
+ +
+
+ +
+ + '; +} +?> + + +
+

© Copyright by PrestaShop. all rights reserved.

+
+ +'; diff --git a/admin-dev/password.php b/admin-dev/password.php new file mode 100644 index 000000000..234f1137a --- /dev/null +++ b/admin-dev/password.php @@ -0,0 +1,116 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); + +include(PS_ADMIN_DIR.'/../config/config.inc.php'); +include(PS_ADMIN_DIR.'/functions.php'); + +$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10)); + +$errors = array(); + +$id_lang = (int)Configuration::get('PS_LANG_DEFAULT'); +$iso = strtolower(Language::getIsoById((int)$id_lang)); +include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); + +if (isset($_POST['Submit'])) +{ + $errors = array(); + if (empty($_POST['email'])) + $errors[] = Tools::displayError('E-mail is empty'); + elseif (!Validate::isEmail($_POST['email'])) + $errors[] = Tools::displayError('Invalid e-mail address'); + else + { + $employee = new Employee(); + if (!$employee->getByemail($_POST['email']) OR !$employee) + $errors[] = Tools::displayError('This account does not exist'); + else + { + if ((strtotime($employee->last_passwd_gen.'+'.Configuration::get('PS_PASSWD_TIME_BACK').' minutes') - time()) > 0 ) + $errors[] = Tools::displayError('You can regenerate your password only each').' '.Configuration::get('PS_PASSWD_TIME_BACK').' '.Tools::displayError('minute(s)'); + else + { + $pwd = Tools::passwdGen(); + $employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd)); + $employee->last_passwd_gen = date('Y-m-d H:i:s', time()); + $result = $employee->update(); + if (!$result) + $errors[] = Tools::displayError('An error occurred during your password change.'); + else + { + Mail::Send((int)$id_lang, 'password', Mail::l('Your new admin password'), array('{email}' => $employee->email, '{lastname}' => $employee->lastname, '{firstname}' => $employee->firstname, '{passwd}' => $pwd), $employee->email, $employee->firstname.' '.$employee->lastname); + $confirmation = 'ok'; + } + } + } + } +} + +echo ' + + + + + + PrestaShop™ - '.translate('Administration panel').' + +
'; + +if (sizeof($errors)) +{ + echo '
+

'.translate('There is 1 error').'

+
    '; + foreach ($errors AS $error) + echo '
  1. '.$error.'
  2. '; + echo '
+
'; +} + +echo ' +
+

'.Configuration::get('PS_SHOP_NAME').'

+ +
'.translate('Forgot your password?').'

'; +if (isset($confirmation)) + echo '
+
'.translate('Your password has been e-mailed to you').'.
+ '; +else + echo ' '.translate('Please, enter your e-mail address').' + '.translate('(the one you wrote during your registration) in order to receive your access codes by e-mail').'.
+ +
+
+
 
+
+ +
+

© Copyright by PrestaShop. all rights reserved.

+
'; \ No newline at end of file diff --git a/admin-dev/pdf.php b/admin-dev/pdf.php new file mode 100644 index 000000000..e5bf99cb5 --- /dev/null +++ b/admin-dev/pdf.php @@ -0,0 +1,114 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); + +include(PS_ADMIN_DIR.'/../config/config.inc.php'); + +/* Header can't be included, so cookie must be created here */ +$cookie = new Cookie('psAdmin'); +if (!$cookie->id_employee) + Tools::redirectAdmin('login.php'); + +$functionArray = array( + 'pdf' => 'generateInvoicePDF', + 'id_order_slip' => 'generateOrderSlipPDF', + 'id_delivery' => 'generateDeliverySlipPDF', + 'invoices' => 'generateInvoicesPDF', + 'invoices2' => 'generateInvoicesPDF2', + 'slips' => 'generateOrderSlipsPDF', + 'deliveryslips' => 'generateDeliverySlipsPDF' +); + +foreach ($functionArray as $var => $function) + if (isset($_GET[$var])) + { + call_user_func($function); + die; + } + +function generateInvoicePDF() +{ + if (!isset($_GET['id_order'])) + die (Tools::displayError('Missing order ID')); + $order = new Order((int)($_GET['id_order'])); + if (!Validate::isLoadedObject($order)) + die(Tools::displayError('Cannot find order in database')); + PDF::invoice($order); +} + +function generateOrderSlipPDF() +{ + $orderSlip = new OrderSlip((int)($_GET['id_order_slip'])); + $order = new Order((int)($orderSlip->id_order)); + if (!Validate::isLoadedObject($order)) + die(Tools::displayError('Cannot find order in database')); + $order->products = OrderSlip::getOrdersSlipProducts($orderSlip->id, $order); + $tmp = NULL; + PDF::invoice($order, 'D', false, $tmp, $orderSlip); +} + +function generateDeliverySlipPDF() +{ + $order = Order::getByDelivery((int)($_GET['id_delivery'])); + if (!Validate::isLoadedObject($order)) + die(Tools::displayError('Cannot find order in database')); + $tmp = NULL; + PDF::invoice($order, 'D', false, $tmp, false, $order->delivery_number); +} + +function generateInvoicesPDF() +{ + $orders = Order::getOrdersIdInvoiceByDate($_GET['date_from'], $_GET['date_to'], NULL, 'invoice'); + if (!is_array($orders)) + die (Tools::displayError('No invoices found')); + PDF::multipleInvoices($orders); +} + +function generateInvoicesPDF2() +{ + $allOrders = array(); + foreach (explode('-', Tools::getValue('id_order_state')) as $id_order_state) + if (is_array($orders = Order::getOrderIdsByStatus((int)$id_order_state))) + $allOrders = array_merge($allOrders, $orders); + PDF::multipleInvoices($allOrders); +} + +function generateOrderSlipsPDF() +{ + $orderSlips = OrderSlip::getSlipsIdByDate($_GET['date_from'], $_GET['date_to']); + if (!count($orderSlips)) + die (Tools::displayError('No order slips found')); + PDF::multipleOrderSlips($orderSlips); +} + +function generateDeliverySlipsPDF() +{ + $slips = unserialize(urldecode($_GET['deliveryslips'])); + if (is_array($slips)) + PDF::multipleDelivery($slips); +} diff --git a/admin-dev/searchcron.php b/admin-dev/searchcron.php new file mode 100644 index 000000000..f7ec6d03f --- /dev/null +++ b/admin-dev/searchcron.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../config/config.inc.php'); + +if (substr(_COOKIE_KEY_, 34, 8) != Tools::getValue('token')) + die; + +ini_set('max_execution_time', 7200); +Search::indexation(Tools::getValue('full')); +Tools::redirectAdmin($_SERVER['HTTP_REFERER'].'&conf=4'); + diff --git a/admin-dev/tabs/.htaccess b/admin-dev/tabs/.htaccess new file mode 100755 index 000000000..93169e4eb --- /dev/null +++ b/admin-dev/tabs/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/admin-dev/tabs/AdminAccess.php b/admin-dev/tabs/AdminAccess.php new file mode 100644 index 000000000..2651613bb --- /dev/null +++ b/admin-dev/tabs/AdminAccess.php @@ -0,0 +1,138 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminAccess extends AdminTab +{ + public function postProcess() + { + if (Tools::isSubmit('submitAddaccess') AND $action = Tools::getValue('action') AND $id_tab = (int)(Tools::getValue('id_tab')) AND $id_profile = (int)(Tools::getValue('id_profile')) AND $this->tabAccess['edit'] == 1) + { + if ($id_tab == -1 AND $action == 'all' AND (int)(Tools::getValue('perm')) == 0) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'access` SET `view` = '.(int)(Tools::getValue('perm')).', `add` = '.(int)(Tools::getValue('perm')).', `edit` = '.(int)(Tools::getValue('perm')).', `delete` = '.(int)(Tools::getValue('perm')).' WHERE `id_profile` = '.(int)($id_profile).' AND `id_tab` != 31'); + elseif ($id_tab == -1 AND $action == 'all') + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'access` SET `view` = '.(int)(Tools::getValue('perm')).', `add` = '.(int)(Tools::getValue('perm')).', `edit` = '.(int)(Tools::getValue('perm')).', `delete` = '.(int)(Tools::getValue('perm')).' WHERE `id_profile` = '.(int)($id_profile)); + elseif ($id_tab == -1) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'access` SET `'.pSQL($action).'` = '.(int)(Tools::getValue('perm')).' WHERE `id_profile` = '.(int)($id_profile)); + elseif ($action == 'all') + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'access` SET `view` = '.(int)(Tools::getValue('perm')).', `add` = '.(int)(Tools::getValue('perm')).', `edit` = '.(int)(Tools::getValue('perm')).', `delete` = '.(int)(Tools::getValue('perm')).' WHERE `id_tab` = '.(int)($id_tab).' AND `id_profile` = '.(int)($id_profile)); + else + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'access` SET `'.pSQL($action).'` = '.(int)(Tools::getValue('perm')).' WHERE `id_tab` = '.(int)($id_tab).' AND `id_profile` = '.(int)($id_profile)); + } + } + + public function display() + { + $this->displayForm(); + } + + /** + * Get the current profile id + * + * @return the $_GET['profile'] if valid, else 1 (the first profile id) + */ + function getCurrentProfileId() + { + return (isset($_GET['profile']) AND !empty($_GET['profile']) AND is_numeric($_GET['profile'])) ? (int)($_GET['profile']) : 1; + } + + public function displayForm($isMainTab = true) + { + global $cookie, $currentIndex; + parent::displayForm(); + + $currentProfile = (int)($this->getCurrentProfileId()); + $tabs = Tab::getTabs($cookie->id_lang); + $profiles = Profile::getProfiles((int)($cookie->id_lang)); + $accesses = Profile::getProfileAccesses((int)($currentProfile)); + + echo ' + +
+ + + '; + + if ($currentProfile != (int)(_PS_ADMIN_PROFILE_)) + echo ' + + + + + + '; + + if (!sizeof($tabs)) + echo ''; + elseif ($currentProfile == (int)(_PS_ADMIN_PROFILE_)) + echo ''; + else + foreach ($tabs AS $tab) + if (!$tab['id_parent'] OR (int)($tab['id_parent']) == -1) + { + $this->printTabAccess((int)($currentProfile), $tab, $accesses[$tab['id_tab']], false, $tabsize, sizeof($tabs)); + foreach ($tabs AS $child) + if ($child['id_parent'] === $tab['id_tab']) + $this->printTabAccess($currentProfile, $child, $accesses[$child['id_tab']], true, $tabsize, sizeof($tabs)); + } + echo '
+ + '.$this->l('View').'
'.$this->l('Add').'
'.$this->l('Edit').'
'.$this->l('Delete').'
'.$this->l('All').'
'.$this->l('No tab').'
'.$this->l('Administrator permissions can\'t be modified.').'
'; + } + + private function printTabAccess($currentProfile, $tab, $access, $is_child, $tabsize, $tabnumber) + { + $result_accesses = 0; + $perms = array('view', 'add', 'edit', 'delete'); + echo ''.($is_child ? ' » ' : '').$tab['name'].''; + foreach ($perms as $perm) + { + if($this->tabAccess['edit'] == 1) + echo ''; + else + echo ''; + $result_accesses += $access[$perm]; + } + echo ''; + + } +} + + diff --git a/admin-dev/tabs/AdminAddonsCatalog.php b/admin-dev/tabs/AdminAddonsCatalog.php new file mode 100644 index 000000000..9defedc56 --- /dev/null +++ b/admin-dev/tabs/AdminAddonsCatalog.php @@ -0,0 +1,38 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminAddonsCatalog extends AdminTab +{ + public function display() + { + $parentDomain = Tools::getHttpHost(true).substr($_SERVER['REQUEST_URI'], 0, -1 * strlen(basename($_SERVER['REQUEST_URI']))); + echo ' +
 
'; + } +} + + diff --git a/admin-dev/tabs/AdminAddonsMyAccount.php b/admin-dev/tabs/AdminAddonsMyAccount.php new file mode 100644 index 000000000..dc9587e7f --- /dev/null +++ b/admin-dev/tabs/AdminAddonsMyAccount.php @@ -0,0 +1,38 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminAddonsMyAccount extends AdminTab +{ + public function display() + { + $parentDomain = Tools::getHttpHost(true).substr($_SERVER['REQUEST_URI'], 0, -1 * strlen(basename($_SERVER['REQUEST_URI']))); + echo ' +
 
'; + } +} + + diff --git a/admin-dev/tabs/AdminAddresses.php b/admin-dev/tabs/AdminAddresses.php new file mode 100644 index 000000000..c68093228 --- /dev/null +++ b/admin-dev/tabs/AdminAddresses.php @@ -0,0 +1,424 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +if(Configuration::get('VATNUMBER_MANAGEMENT') AND file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php')) + include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'); + +class AdminAddresses extends AdminTab +{ + /** @var array countries list */ + private $countriesArray = array(); + + public function __construct() + { + global $cookie; + + $this->table = 'address'; + $this->className = 'Address'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + $this->requiredDatabase = true; + $this->addressType = 'customer'; + + if (!Tools::getValue('realedit')) + $this->deleted = true; + $this->_select = 'cl.`name` as country'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON + (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)($cookie->id_lang).')'; + + $countries = Country::getCountries((int)($cookie->id_lang)); + foreach ($countries AS $country) + $this->countriesArray[$country['id_country']] = $country['name']; + + $this->fieldsDisplay = array( + 'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'firstname' => array('title' => $this->l('First name'), 'width' => 80, 'filter_key' => 'a!firstname'), + 'lastname' => array('title' => $this->l('Last name'), 'width' => 100, 'filter_key' => 'a!lastname'), + 'address1' => array('title' => $this->l('Address'), 'width' => 200), + 'postcode' => array('title' => $this->l('Postcode/ Zip Code'), 'align' => 'right', 'width' => 50), + 'city' => array('title' => $this->l('City'), 'width' => 150), + 'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'select' => $this->countriesArray, 'filter_key' => 'cl!id_country')); + + parent::__construct(); + } + + public function postProcess() + { + if (isset($_POST['submitAdd'.$this->table])) + { + // Transform e-mail in id_customer for parent processing + if ($this->addressType == 'customer') + { + if (Validate::isEmail(Tools::getValue('email'))) + { + $customer = new Customer; + $customer = $customer->getByemail(Tools::getValue('email')); + if (Validate::isLoadedObject($customer)) + $_POST['id_customer'] = $customer->id; + else + $this->_errors[] = Tools::displayError('This e-mail address is not registered.'); + } + elseif ($id_customer = Tools::getValue('id_customer')) + { + $customer = new Customer((int)($id_customer)); + if (Validate::isLoadedObject($customer)) + $_POST['id_customer'] = $customer->id; + else + $this->_errors[] = Tools::displayError('Unknown customer'); + } + else + $this->_errors[] = Tools::displayError('Unknown customer'); + if (Country::isNeedDniByCountryId(Tools::getValue('id_country')) AND !Tools::getValue('dni')) + $this->_errors[] = Tools::displayError('Identification number is incorrect or has already been used.'); + } + + // Check manufacturer selected + if ($this->addressType == 'manufacturer') + { + $manufacturer = new Manufacturer((int)(Tools::getValue('id_manufacturer'))); + if (!Validate::isLoadedObject($manufacturer)) + $this->_errors[] = Tools::displayError('Manufacturer selected is not valid.'); + } + + /* If the selected country does not contain states */ + $id_state = (int)(Tools::getValue('id_state')); + if ($id_country = Tools::getValue('id_country') AND $country = new Country((int)($id_country)) AND !(int)($country->contains_states) AND $id_state) + $this->_errors[] = Tools::displayError('You have selected a state for a country that does not contain states.'); + + /* If the selected country contains states, then a state have to be selected */ + if ((int)($country->contains_states) AND !$id_state) + $this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.'); + + /* Check zip code */ + if ($country->need_zip_code) + { + $zip_code_format = $country->zip_code_format; + if (($postcode = Tools::getValue('postcode')) AND $zip_code_format) + { + $zip_regexp = '/^'.$zip_code_format.'$/ui'; + $zip_regexp = str_replace(' ', '( |)', $zip_regexp); + $zip_regexp = str_replace('-', '(-|)', $zip_regexp); + $zip_regexp = str_replace('N', '[0-9]', $zip_regexp); + $zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp); + $zip_regexp = str_replace('C', $country->iso_code, $zip_regexp); + if (!preg_match($zip_regexp, $postcode)) + $this->_errors[] = Tools::displayError('Your zip/postal code is incorrect.').'
'.Tools::displayError('Must be typed as follows:').' '.str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $zip_code_format))); + } + elseif ($zip_code_format) + $this->_errors[] = Tools::displayError('Postcode required.'); + elseif ($postcode AND !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) + $this->_errors[] = Tools::displayError('Your zip/postal code is incorrect.'); + } + + + /* If this address come from order's edition and is the same as the other one (invoice or delivery one) + ** we delete its id_address to force the creation of a new one */ + if ((int)(Tools::getValue('id_order'))) + { + $this->_redirect = false; + if (isset($_POST['address_type'])) + $_POST['id_address'] = ''; + } + } + if (!sizeof($this->_errors)) + parent::postProcess(); + + /* Reassignation of the order's new (invoice or delivery) address */ + $address_type = ((int)(Tools::getValue('address_type')) == 2 ? 'invoice' : ((int)(Tools::getValue('address_type')) == 1 ? 'delivery' : '')); + if (isset($_POST['submitAdd'.$this->table]) AND ($id_order = (int)(Tools::getValue('id_order'))) AND !sizeof($this->_errors) AND !empty($address_type)) + { + if(!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET `id_address_'.$address_type.'` = '.Db::getInstance()->Insert_ID().' WHERE `id_order` = '.$id_order)) + $this->_errors[] = Tools::displayError('An error occurred while linking this address to its order.'); + else + Tools::redirectAdmin(Tools::getValue('back').'&conf=4'); + } + } + + public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL) + { + parent::getList($id_lang, $orderBy, $orderWay, $start, $limit); + + global $cookie; + + /* Manage default params values */ + if (empty($limit)) + $limit = ((!isset($cookie->{$this->table.'_pagination'})) ? $this->_pagination[0] : $limit = $cookie->{$this->table.'_pagination'}); + + if (!Validate::isTableOrIdentifier($this->table)) + die('filter is corrupted'); + if (empty($orderBy)) + $orderBy = Tools::getValue($this->table.'Orderby', 'id_'.$this->table); + if (empty($orderWay)) + $orderWay = Tools::getValue($this->table.'Orderway', 'ASC'); + $limit = (int)(Tools::getValue('pagination', $limit)); + $cookie->{$this->table.'_pagination'} = $limit; + + /* Check params validity */ + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay) + OR !is_numeric($start) OR !is_numeric($limit) + OR !Validate::isUnsignedId($id_lang)) + die(Tools::displayError('get list params is not valid')); + + /* Determine offset from current page */ + if ((isset($_POST['submitFilter'.$this->table]) OR + isset($_POST['submitFilter'.$this->table.'_x']) OR + isset($_POST['submitFilter'.$this->table.'_y'])) AND + !empty($_POST['submitFilter'.$this->table]) AND + is_numeric($_POST['submitFilter'.$this->table])) + $start = (int)($_POST['submitFilter'.$this->table] - 1) * $limit; + + /* Cache */ + $this->_lang = (int)($id_lang); + $this->_orderBy = $orderBy; + $this->_orderWay = Tools::strtoupper($orderWay); + + /* SQL table : orders, but class name is Order */ + $sqlTable = $this->table == 'order' ? 'orders' : $this->table; + + /* Query in order to get results number */ + $queryTotal = Db::getInstance()->getRow(' + SELECT COUNT(a.`id_'.$this->table.'`) AS total + FROM `'._DB_PREFIX_.$sqlTable.'` a + '.($this->lang ? 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`id_'.$this->table.'` = a.`id_'.$this->table.'` AND b.`id_lang` = '.(int)($id_lang).')' : '').' + '.(isset($this->_join) ? $this->_join.' ' : '').' + WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').(($this->deleted OR $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '').$this->_filter.' + '.(isset($this->_group) ? $this->_group.' ' : '').' + '.(isset($this->addressType) ? 'AND a.id_'.strval($this->addressType).' != 0' : '')); + $this->_listTotal = (int)($queryTotal['total']); + + /* Query in order to get results with all fields */ + $this->_list = Db::getInstance()->ExecuteS(' + SELECT a.*'.($this->lang ? ', b.*' : '').(isset($this->_select) ? ', '.$this->_select.' ' : '').' + FROM `'._DB_PREFIX_.$sqlTable.'` a + '.($this->lang ? 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`id_'.$this->table.'` = a.`id_'.$this->table.'` AND b.`id_lang` = '.(int)($id_lang).')' : '').' + '.(isset($this->_join) ? $this->_join.' ' : '').' + WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').(($this->deleted OR $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '').$this->_filter.' + '.(isset($this->_group) ? $this->_group.' ' : '').' + '.(isset($this->addressType) ? 'AND a.id_'.strval($this->addressType).' != 0' : '').' + ORDER BY '.(($orderBy == 'id_'.$this->table) ? 'a.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(int)($start).','.(int)($limit)); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.((int)($obj->id) ? '' : '').' + '.(($id_order = (int)(Tools::getValue('id_order'))) ? '' : '').' + '.(($address_type = (int)(Tools::getValue('address_type'))) ? '' : '').' + '.(Tools::getValue('realedit') ? '' : '').' +
+ '.$this->l('Addresses').''; + switch ($this->addressType) + { + case 'manufacturer': + echo ' +
'; + $manufacturers = Manufacturer::getManufacturers(); + echo ''; + echo '
'; + echo ''; + break; + case 'customer': + default: + if ($obj->id) + { + $customer = new Customer($obj->id_customer); + $tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)); + echo ' + + + + '; + } + else + { + echo + ' +
+ * +
'; + } + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + break; + } + if ($this->addressType != 'manufacturer') + { + echo ' +
+ + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + + if ((Configuration::get('VATNUMBER_MANAGEMENT') AND file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php')) && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT'))) + echo '
'; + else if(Configuration::get('VATNUMBER_MANAGEMENT')) + echo '
'; + else + echo'
'; + + echo ' +
+ +
+
'; + } + echo ' + +
+ * + '.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:  +
+ +
+ * + '.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:  +
+ +
+ +

'.$this->l('DNI / NIF / NIE').'

+
+ +
+ * +
+ +
+ +
+ +
+ +
+ +
+ * +
+ +
+ * +
'; + + $id_country_ajax = (int)$this->getFieldValue($obj, 'id_country'); + + echo ' + +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + + diff --git a/admin-dev/tabs/AdminAliases.php b/admin-dev/tabs/AdminAliases.php new file mode 100644 index 000000000..f54ab4516 --- /dev/null +++ b/admin-dev/tabs/AdminAliases.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminAliases extends AdminTab +{ + function __construct() + { + $this->table = 'alias'; + $this->className = 'Alias'; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'alias' => array('title' => $this->l('Aliases'), 'width' => 160), + 'search' => array('title' => $this->l('Search'), 'width' => 40), + 'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) + ); + parent::__construct(); + } + + public function postProcess() + { + if (isset($_POST['submitAdd'.$this->table])) + { + $search = strval(Tools::getValue('search')); + $string = strval(Tools::getValue('alias')); + $aliases = explode(',', $string); + if (empty($search) OR empty($string)) + $this->_errors[] = $this->l('aliases and result are both required'); + if (!Validate::isValidSearch($search)) + $this->_errors[] = $search.' '.$this->l('is not a valid result'); + foreach ($aliases AS $alias) + if (!Validate::isValidSearch($alias)) + $this->_errors[] = $alias.' '.$this->l('is not a valid alias'); + + if (!sizeof($this->_errors)) + { + Alias::deleteAliases($search); + foreach ($aliases AS $alias) + { + $obj = new Alias(NULL, trim($alias), trim($search)); + $obj->save(); + } + } + } + else + parent::postProcess(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Aliases').' + +
+ * +

'.$this->l('Enter each alias separated by a comma (\',\')').' '.$this->l('(e.g., \'prestshop,preztashop,prestasohp\')').'
+ '.$this->l('Forbidden characters:').' <>;=#{}

+
+ +
+ * +

'.$this->l('Search this word instead.').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + + diff --git a/admin-dev/tabs/AdminAppearance.php b/admin-dev/tabs/AdminAppearance.php new file mode 100644 index 000000000..1e5522887 --- /dev/null +++ b/admin-dev/tabs/AdminAppearance.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/AdminThemes.php'); + +class AdminAppearance extends AdminThemes // extends AdminThemes only for retro-compatibility +{ + public function display() + { + Tools::redirectAdmin('index.php?tab=AdminThemes&token='.Tools::getAdminTokenLite('AdminThemes')); + } +} \ No newline at end of file diff --git a/admin-dev/tabs/AdminAttachments.php b/admin-dev/tabs/AdminAttachments.php new file mode 100644 index 000000000..01b6008ef --- /dev/null +++ b/admin-dev/tabs/AdminAttachments.php @@ -0,0 +1,134 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminAttachments extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->table = 'attachment'; + $this->className = 'Attachment'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_attachment' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Name')), + 'file' => array('title' => $this->l('File'))); + + parent::__construct(); + } + + public function postProcess() + { + if (Tools::isSubmit('submitAdd'.$this->table)) + { + if ($id = (int)(Tools::getValue('id_attachment')) AND $a = new Attachment($id)) + { + $_POST['file'] = $a->file; + $_POST['mime'] = $a->mime; + } + if (!sizeof($this->_errors)) + { + if (isset($_FILES['file']) AND is_uploaded_file($_FILES['file']['tmp_name'])) + { + if ($_FILES['file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024)) + $this->_errors[] = $this->l('File too large, maximum size allowed:').' '.(Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024).' '.$this->l('kb').'. '.$this->l('File size you\'re trying to upload is:').number_format(($_FILES['attachment_file']['size']/1024), 2, '.', '').$this->l('kb'); + else + { + do $uniqid = sha1(microtime()); while (file_exists(_PS_DOWNLOAD_DIR_.$uniqid)); + if (!copy($_FILES['file']['tmp_name'], _PS_DOWNLOAD_DIR_.$uniqid)) + $this->_errors[] = $this->l('File copy failed'); + $_POST['file_name'] = $_FILES['file']['name']; + @unlink($_FILES['file']['tmp_name']); + $_POST['file'] = $uniqid; + $_POST['mime'] = $_FILES['file']['type']; + } + } + else if (array_key_exists('attachment_file', $_FILES) && (int)$_FILES['attachment_file']['error'] === 1) + { + $max_upload = (int)(ini_get('upload_max_filesize')); + $max_post = (int)(ini_get('post_max_size')); + $upload_mb = min($max_upload, $max_post); + $this->_errors[] = $this->l('the File').' '.$_FILES['attachment_file']['name'].' '.$this->l('exceeds the size allowed by the server. This limit is set to').' '.$upload_mb.$this->l('Mb').''; + } + else if (!empty($_FILES['file']['tmp_name'])) + $this->_errors[] = $this->l('No file or your file isn\'t uploadable, check your server configuration about the upload maximum size.'); + } + $this->validateRules(); + } + return parent::postProcess(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Attachment').' + +
'; + foreach ($this->_languages as $language) + echo '
+ * +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'cname¤cdescription', 'cname'); + echo '
+
 
+ +
'; + foreach ($this->_languages as $language) + echo '
+ +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'cname¤cdescription', 'cdescription'); + echo '
+
 
+ +
+

+

'.$this->l('Upload file from your computer').'

+
+
 
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} diff --git a/admin-dev/tabs/AdminAttributeGenerator.php b/admin-dev/tabs/AdminAttributeGenerator.php new file mode 100644 index 000000000..545be0e8b --- /dev/null +++ b/admin-dev/tabs/AdminAttributeGenerator.php @@ -0,0 +1,284 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +@ini_set('max_execution_time', 3600); +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminAttributeGenerator extends AdminTab +{ + private $combinations = array(); + private $product; + + private function addAttribute($arr, $price = 0, $weight = 0) + { + foreach ($arr AS $attr) + { + $price += (float)($_POST['price_impact'][(int)($attr)]); + $weight += (float)($_POST['weight_impact'][(int)($attr)]); + } + if ($this->product->id) + { + return (array( + 'id_product' => (int)($this->product->id), + 'price' => (float)($price), + 'weight' => (float)($weight), + 'ecotax' => 0, + 'quantity' => (int)($_POST['quantity']), + 'reference' => pSQL($_POST['reference']), + 'default_on' => 0)); + } + return array(); + } + + static private function createCombinations($list) + { + if (sizeof($list) <= 1) + return sizeof($list) ? array_map(create_function('$v', 'return (array($v));'), $list[0]) : $list; + $res = array(); + $first = array_pop($list); + foreach ($first AS $attribute) + { + $tab = self::createCombinations($list); + foreach ($tab AS $toAdd) + $res[] = is_array($toAdd) ? array_merge($toAdd, array($attribute)) : array($toAdd, $attribute); + } + return $res; + } + + public function postProcess() + { + global $currentIndex; + + $this->product = new Product((int)(Tools::getValue('id_product'))); + if (isset($_POST['generate'])) + { + if (!is_array(Tools::getValue('options'))) + $this->_errors[] = Tools::displayError('Please choose at least 1 attribute.'); + else + { + $tab = array_values($_POST['options']); + if (sizeof($tab) AND Validate::isLoadedObject($this->product)) + { + self::setAttributesImpacts($this->product->id, $tab); + $this->combinations = array_values(self::createCombinations($tab)); + $values = array_values(array_map(array($this, 'addAttribute'), $this->combinations)); + $this->product->deleteProductAttributes(); + $res = $this->product->addProductAttributeMultiple($values); + $this->product->addAttributeCombinationMultiple($res, $this->combinations); + $this->product->updateQuantityProductWithAttributeQuantity(); + } + else + $this->_errors[] = Tools::displayError('Unable to initialize parameters, combination is missing or object cannot be loaded.'); + } + } + elseif (isset($_POST['back'])) + Tools::redirectAdmin($currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct'.'&tabs=3&token='.Tools::getValue('token')); + parent::postProcess(); + } + + static private function displayAndReturnAttributeJs() + { + global $cookie; + + $attributes = Attribute::getAttributes((int)($cookie->id_lang), true); + $attributeJs = array(); + foreach ($attributes AS $k => $attribute) + $attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name']; + echo ' + '; + return $attributeJs; + } + + private function displayGroupSelect($attributeJs, $attributesGroups) + { + echo '
+ +
'; + } + + static private function setAttributesImpacts($id_product, $tab) + { + $attributes = array(); + foreach ($tab AS $group) + foreach ($group AS $attribute) + $attributes[] = '('.(int)($id_product).', '.(int)($attribute).', '.(float)($_POST['price_impact'][(int)($attribute)]).', '.(float)($_POST['weight_impact'][(int)($attribute)]).')'; + return Db::getInstance()->Execute( + 'INSERT INTO `'._DB_PREFIX_.'attribute_impact` (`id_product`, `id_attribute`, `price`, `weight`) + VALUES '.implode(',', $attributes).' + ON DUPLICATE KEY UPDATE `price`=VALUES(price), `weight`=VALUES(weight)' + ); + } + + static private function getAttributesImpacts($id_product) + { + $tab = array(); + $result = Db::getInstance()->ExecuteS( + 'SELECT ai.`id_attribute`, ai.`price`, ai.`weight` + FROM `'._DB_PREFIX_.'attribute_impact` ai + WHERE ai.`id_product` = '.(int)($id_product)); + if (!$result) + return array(); + foreach ($result AS $impact) + { + $tab[$impact['id_attribute']]['price'] = (float)($impact['price']); + $tab[$impact['id_attribute']]['weight'] = (float)($impact['weight']); + } + return $tab; + } + + private function displayGroupeTable($attributeJs, $attributesGroups) + { + global $cookie; + + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $combinationsGroups = $this->product->getAttributesGroups((int)($cookie->id_lang)); + $attributes = array(); + $impacts = self::getAttributesImpacts($this->product->id); + foreach ($combinationsGroups AS &$combination) + { + $target = &$attributes[$combination['id_attribute_group']][$combination['id_attribute']]; + $target = $combination; + if (isset($impacts[$combination['id_attribute']])) + { + $target['price'] = $impacts[$combination['id_attribute']]['price']; + $target['weight'] = $impacts[$combination['id_attribute']]['weight']; + } + } + + foreach ($attributesGroups AS $k => $attributeGroup) + { + $idGroup = $attributeGroup['id_attribute_group']; + if (isset($attributeJs[$idGroup])) + { + echo ' +
+ + + + + + + + + + + '; + if (isset($attributes[$idGroup])) + foreach ($attributes[$idGroup] AS $k => $attribute) + echo ''; + } + } + echo '

* '.$this->l('tax included').'

'; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + $jsAttributes = self::displayAndReturnAttributeJs(); + $attributesGroups = AttributeGroup::getAttributesGroups((int)($cookie->id_lang)); + $this->product = new Product((int)(Tools::getValue('id_product'))); + if (isset($_POST['generate']) AND !sizeof($this->_errors)) + echo ' +
+ + '.sizeof($this->combinations).' '.$this->l('product(s) successfully created.').' +
'; + echo ' + +
+
'.$this->l('Attributes generator').''. + $this->l('Add or modify attributes for product:').' '.$this->product->name[$cookie->id_lang].' +

+ '; + echo ' +
+
+ +
+ +
+ +
+ +
+
+
+
+ +
+
+
'; + self::displayGroupeTable($jsAttributes, $attributesGroups); + echo ' +
+
+
+ '; + self::displayGroupSelect($jsAttributes, $attributesGroups); + echo ' +
+

+ +
+ +

+
+
+
+
+
'; + } +} + + diff --git a/admin-dev/tabs/AdminAttributes.php b/admin-dev/tabs/AdminAttributes.php new file mode 100644 index 000000000..f3077eb42 --- /dev/null +++ b/admin-dev/tabs/AdminAttributes.php @@ -0,0 +1,152 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminAttributes extends AdminTab +{ + public function __construct() + { + $this->table = 'attribute'; + $this->className = 'Attribute'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + $this->fieldImageSettings = array('name' => 'texture', 'dir' => 'co'); + + parent::__construct(); + } + + /** + * Display form + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayForm($token = NULL) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $color = ($obj->color ? $obj->color : 0); + $attributes_groups = AttributeGroup::getAttributesGroups($this->_defaultFormLanguage); + $strAttributesGroups = ''; + echo ' + +
+ '.($obj->id ? '' : '').' +
'.$this->l('Attribute').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); + echo ' +
+
+ +
+ * +
+ +
+ +
+ * +

'.$this->l('HTML colors only (e.g.,').' "lightblue", "#CC6600")

+
+ +
+ +

'.$this->l('Upload color texture from your computer').'
'.$this->l('This will override the HTML color!').'

+
+ +
+

'.(file_exists(_PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg') + ? ' '.$this->l('delete').'' + : $this->l('None') + ).'

+
+
+
+ +
+
* '.$this->l('Required field').'
+
+
+ '; + } + + /** + * Manage page processing + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function postProcess($token = NULL) + { + global $currentIndex; + if (Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.$_POST['groupid'].'Box'])) + { + $object = new $this->className(); + if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box'])) + Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token)); + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + else + parent::postProcess(); + } +} + + diff --git a/admin-dev/tabs/AdminAttributesGroups.php b/admin-dev/tabs/AdminAttributesGroups.php new file mode 100644 index 000000000..33dd1fcf1 --- /dev/null +++ b/admin-dev/tabs/AdminAttributesGroups.php @@ -0,0 +1,226 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +include_once(PS_ADMIN_DIR.'/tabs/AdminAttributes.php'); + +class AdminAttributesGroups extends AdminTab +{ + /** @var object AdminAttributes() instance */ + private $adminAttributes; + + public function __construct() + { + $this->adminAttributes = new AdminAttributes(); + $this->table = 'attribute_group'; + $this->className = 'AttributeGroup'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'name' => array('title' => $this->l('Name'), 'width' => 140), + 'attribute' => array('title' => $this->l('Attributes'), 'width' => 240, 'orderby' => false, 'search' => false)); + + parent::__construct(); + } + + public function display() + { + global $currentIndex; + + if ((isset($_POST['submitAddattribute']) AND sizeof($this->adminAttributes->_errors)) + OR isset($_GET['updateattribute']) OR isset($_GET['addattribute'])) + { + $this->adminAttributes->displayForm($this->token); + echo '

'.$this->l('Back to list').'
'; + } + else + parent::display(); + } + + public function postProcess() + { + global $cookie, $currentIndex; + + $this->adminAttributes->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); + $this->adminAttributes->postProcess($this->token); + + if(Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $object = new $this->className(); + if ($object->deleteSelection($_POST[$this->table.'Box'])) + Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.$this->token); + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + else + parent::postProcess(); + } + + public function displayErrors() + { + $this->adminAttributes->displayErrors(); + parent::displayErrors(); + } + + /* Report to AdminTab::displayList() for more details */ + public function displayList() + { + global $currentIndex, $cookie; + + echo '
'.$this->l('Add attributes group').'
+ '.$this->l('Add attribute').'

+ '.$this->l('Click on the group name to view its attributes. Click again to hide them.').'

'; + if ($this->_list === false) + Tools::displayError('No elements found'); + + $this->displayListHeader(); + echo ''; + + if (!sizeof($this->_list)) + echo ''.$this->l('No elements found').''; + + $irow = 0; + foreach ($this->_list AS $tr) + { + $id = (int)($tr['id_'.$this->table]); + echo ' + + + '.$tr['name'].' + + + '; + + echo ' + + + '.$this->l('Edit').'  + + '.$this->l('Delete').' + + '; + } + + $this->displayListFooter(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Attributes group').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤public_name', 'name'); + echo ' +
+
+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +

'.$this->l('Term or phrase displayed to the customer').'

+
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤public_name', 'public_name'); + echo ' +
+
+ +
+ getFieldValue($obj, 'is_color_group') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'is_color_group') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This is a color group').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + + diff --git a/admin-dev/tabs/AdminBackup.php b/admin-dev/tabs/AdminBackup.php new file mode 100644 index 000000000..9702c71e7 --- /dev/null +++ b/admin-dev/tabs/AdminBackup.php @@ -0,0 +1,261 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminBackup extends AdminTab +{ + + /** @var string The field we are sorting on */ + protected $_sortBy = 'date'; + + public function __construct() + { + $this->table = 'backup'; + $this->className = 'Backup'; + parent::__construct(); + + $this->edit = false; + $this->delete = true; + $this->view = true; + + $this->deleted = false; + + $this->requiredDatabase = false; + + $this->fieldsDisplay = array ( + 'date' => array('title' => $this->l('Date'), 'type' => 'datetime', 'width' => 120, 'align' => 'right'), + 'age' => array('title' => $this->l('Age')), + 'filename' => array('title' => $this->l('File name'), 'width' => 200), + 'filesize' => array('title' => $this->l('File size'))); + $this->optionTitle = $this->l('Backup option'); + $this->_fieldsOptions = array('PS_BACKUP_ALL' => array('title' => $this->l('Backup all tables:'), 'desc' => $this->l('If you disable this option, only the necessary tables will be imported (connections and statistics will not be imported)'), 'cast' => 'intval', 'type' => 'bool')); + + $this->identifier = 'filename'; + } + + /** + * Load class object using identifier in $_GET (if possible) + * otherwise return an empty object + * This method overrides the one in AdminTab because AdminTab assumes the id is a UnsignedInt + * "Backups" Directory in admin directory must be writeable (CHMOD 777) + * @param boolean $opt Return an empty object if load fail + * @return object + */ + protected function loadObject($opt = false) + { + if ($id = Tools::getValue($this->identifier)) + return new $this->className($id); + return new $this->className(); + } + + /** + * Creates a new backup, and then displays the normal menu + */ + public function displayForm($isMainTab = true) + { + if(is_writable(PS_ADMIN_DIR.'/backups/')) + { + if (!($object = $this->loadObject())) + return; + if ($object->add()) + { + echo '
 '.$this->l('Back-up Creation successful').' !
'; + if ($this->tabAccess['view'] === '1') + echo '
'.$this->l('You can now').' '.$this->l('download the back-up file').'.'; + echo '
'; + } + elseif ($object->error) + $this->_errors[] = $object->error; + } + else + $this->_errors[] = $this->l('"Backups" Directory in admin directory must be writeable (CHMOD 755 / 777)'); + $this->displayErrors(); + } + + /** + * Displays the page which allows the backup to be downloaded + */ + public function viewbackup() + { + global $currentIndex; + + if (!($object = $this->loadObject())) + return; + if ($object->id) + { + $url = $object->getBackupURL(); + echo '
 '.$this->l('Beginning download ...').'
'; + echo '
'.$this->l('Back-up file should automatically download.'); + echo '

'.$this->l('If not,').' '.$this->l('please click here!').''; + echo ''; + echo '


'.$this->l('Back to list').'
'; + } + elseif ($object->error) + $this->_errors[] = $object->error; + $this->displayErrors(); + } + + public function displayList() + { + global $currentIndex; + + // Test if the backup dir is writable + if(!is_writable(PS_ADMIN_DIR.'/backups/')) + $this->displayWarning($this->l('"Backups" Directory in admin directory must be writeable (CHMOD 755 / 777)')); + + $this->displayErrors(); + echo '
'.$this->l('Create new back-up').'

'; + parent::displayList(); + } + + public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL) + { + global $cookie; + + if (!Validate::isTableOrIdentifier($this->table)) + die('filter is corrupted'); + if (empty($orderBy)) + $orderBy = Tools::getValue($this->table.'Orderby', $this->_defaultOrderBy); + if (empty($orderWay)) + $orderWay = Tools::getValue($this->table.'Orderway', 'ASC'); + + // Try and obtain getList arguments from $_GET + $orderBy = Tools::getValue($this->table.'Orderby'); + $orderWay = Tools::getValue($this->table.'Orderway'); + + // Validate the orderBy and orderWay fields + switch ($orderBy) + { + case 'filename': + case 'filesize': + case 'date': + case 'age': + break; + default: + $orderBy = 'date'; + } + switch ($orderWay) + { + case 'asc': + case 'desc': + break; + default: + $orderWay = 'desc'; + } + if (empty($limit)) + $limit = ((!isset($cookie->{$this->table.'_pagination'})) ? $this->_pagination[0] : $limit = $cookie->{$this->table.'_pagination'}); + $limit = (int)(Tools::getValue('pagination', $limit)); + $cookie->{$this->table.'_pagination'} = $limit; + + /* Determine offset from current page */ + if (!empty($_POST['submitFilter'.$this->table]) AND is_numeric($_POST['submitFilter'.$this->table])) + $start = (int)($_POST['submitFilter'.$this->table] - 1) * $limit; + $this->_lang = (int)($id_lang); + $this->_orderBy = $orderBy; + $this->_orderWay = strtoupper($orderWay); + $this->_list = array(); + + // Find all the backups + $dh = @opendir(PS_ADMIN_DIR.'/backups/'); + if ($dh === false) + { + $this->_errors[] = Tools::displayError('Unable to open backup directory .').addslashes(PS_ADMIN_DIR.'/backups/').'"'; + return; + } + while (($file = readdir($dh)) !== false) + { + if (preg_match('/^([\d]+-[a-z\d]+)\.sql(\.gz|\.bz2)?$/', $file, $matches) == 0) + continue; + $timestamp = (int)($matches[1]); + $date = date('Y-m-d h:i:s', $timestamp); + $age = time() - $timestamp; + if ($age < 3600) + $age = '< 1 '.$this->l('hour'); + else if ($age < 86400) + { + $age = floor($age / 3600); + $age = $age.' '.(($age == 1) ? $this->l('hour') : $this->l('hours')); + } + else + { + $age = floor($age / 86400); + $age = $age.' '.(($age == 1) ? $this->l('day') : $this->l('days')); + } + $size = filesize(PS_ADMIN_DIR.'/backups/'.$file); + $this->_list[] = array( + 'filename' => $file, + 'age' => $age, + 'date' => $date, + 'filesize' => number_format($size / 1000, 2).' Kb', + 'timestamp' => $timestamp, + 'filesize_sort' => $size, + ); + } + closedir($dh); + $this->_listTotal = count($this->_list); + + // Sort the _list based on the order requirements + switch ($this->_orderBy) + { + case 'filename': + $this->_sortBy = 'filename'; + $sorter = 'str_sort'; + break; + case 'filesize': + $this->_sortBy = 'filesize_sort'; + $sorter = 'int_sort'; + break; + case 'age': + case 'date': + $this->_sortBy = 'timestamp'; + $sorter = 'int_sort'; + break; + } + usort($this->_list, array($this, $sorter)); + $this->_list = array_slice($this->_list, $start, $limit); + } + + public function int_sort($a, $b) + { + if ($this->_orderWay == 'ASC') + return $a[$this->_sortBy] - $b[$this->_sortBy]; + else + return $b[$this->_sortBy] - $a[$this->_sortBy]; + } + + public function str_sort($a, $b) + { + if ($this->_orderWay == 'ASC') + return strcmp ($a[ $this->_sortBy], $b[$this->_sortBy]); + else + return strcmp ($b[ $this->_sortBy], $a[$this->_sortBy]); + } + +} + + diff --git a/admin-dev/tabs/AdminCMS.php b/admin-dev/tabs/AdminCMS.php new file mode 100644 index 000000000..f659f58ab --- /dev/null +++ b/admin-dev/tabs/AdminCMS.php @@ -0,0 +1,352 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCMS extends AdminTab +{ + private $_category; + + public function __construct() + { + $this->table = 'cms'; + $this->className = 'CMS'; + $this->lang = true; + $this->edit = true; + $this->view = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'link_rewrite' => array('title' => $this->l('URL'), 'width' => 200), + 'meta_title' => array('title' => $this->l('Title'), 'width' => 300), + 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), + 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) + ); + + $this->_category = AdminCMSContent::getCurrentCMSCategory(); + $this->_join = ' + LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)'; + $this->_select = 'a.position '; + $this->_filter = 'AND c.id_cms_category = '.(int)($this->_category->id); + + parent::__construct(); + } + + private function _displayDraftWarning($active) + { + return + '
+

+ + + '.$this->l('Your CMS page will be saved as a draft').' + + + +
+

+
'; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + $obj = $this->loadObject(true); + $iso = Language::getIsoById((int)($cookie->id_lang)); + $divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite'; + + echo ' +
+ '.($obj->id ? '' : '').' + '.$this->_displayDraftWarning($obj->active).' +
'.$this->l('CMS page').''; + + // META TITLE + echo ' +
+ +
+ +
'; + foreach ($this->_languages as $language) + echo '
+ * +
'; + + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_title'); + echo '
 
'; + + // META DESCRIPTION + echo ' +
'; + foreach ($this->_languages as $language) + echo '
+ +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_description'); + echo '
 
'; + + // META KEYWORDS + echo ' +
'; + foreach ($this->_languages as $language) + echo '
+ +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_keywords'); + echo '
 
'; + + // LINK REWRITE + echo ' +
'; + foreach ($this->_languages as $language) + echo ' '; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'link_rewrite'); + echo '
 
'; + + // CONTENT + echo ' +
'; + foreach ($this->_languages as $language) + echo '
+ +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'ccontent'); + echo '
 
+ +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +
'; + + // SUBMIT + echo '
+ +
+
* '.$this->l('Required field').'
+

+ '.$this->_displayDraftWarning($obj->active).' +
'; + // TinyMCE + global $cookie; + $iso = Language::getIsoById((int)($cookie->id_lang)); + $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); + $ad = dirname($_SERVER["PHP_SELF"]); + echo ' + + + '; + } + + public function display($token = NULL) + { + global $currentIndex, $cookie; + + if (($id_cms_category = (int)Tools::getValue('id_cms_category'))) + $currentIndex .= '&id_cms_category='.$id_cms_category; + $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL); + //$this->getList((int)($cookie->id_lang)); + if (!$id_cms_category) + $id_cms_category = 1; + echo '

'.(!$this->_listTotal ? ($this->l('No pages found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('pages') : $this->l('page')))).' '. + $this->l('in category').' "'.stripslashes(CMSCategory::hideCMSCategoryPosition($this->_category->getName())).'"

'; + echo ' '.$this->l('Add a new page').' +
'; + $this->displayList($token); + echo '
'; + } + + public function displayList($token = NULL) + { + global $currentIndex; + + /* Display list header (filtering, pagination and column names) */ + $this->displayListHeader($token); + if (!sizeof($this->_list)) + echo ''.$this->l('No items found').''; + + /* Show the content of the table */ + $this->displayListContent($token); + + /* Close list table and submit button */ + $this->displayListFooter($token); + } + + function postProcess() + { + global $cookie, $link, $currentIndex; + + if (Tools::isSubmit('viewcms') AND ($id_cms = (int)(Tools::getValue('id_cms'))) AND $cms = new CMS($id_cms, (int)($cookie->id_lang)) AND Validate::isLoadedObject($cms)) + { + $redir = $link->getCMSLink($cms); + if (!$cms->active) + { + $admin_dir = dirname($_SERVER['PHP_SELF']); + $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1); + $redir .= '?adtoken='.Tools::encrypt('PreviewCMS'.$cms->id).'&ad='.$admin_dir; + } + Tools::redirectAdmin($redir); + } + elseif (Tools::isSubmit('deletecms')) + { + if (Tools::getValue('id_cms') == Configuration::get('PS_CONDITIONS_CMS_ID')) + { + Configuration::updateValue('PS_CONDITIONS', 0); + Configuration::updateValue('PS_CONDITIONS_CMS_ID', 0); + } + $cms = new CMS((int)(Tools::getValue('id_cms'))); + $cms->cleanPositions($cms->id_cms_category); + if (!$cms->delete()) + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' ('.mysql_error().')'; + else + Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCMSContent')); + }/* Delete multiple objects */ + elseif (Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $cms = new CMS(); + $result = true; + $result = $cms->deleteSelection(Tools::getValue($this->table.'Box')); + if ($result) + { + $cms->cleanPositions((int)(Tools::getValue('id_cms_category'))); + Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category'))); + } + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + elseif (Tools::isSubmit('submitAddcms') OR Tools::isSubmit('submitAddcmsAndPreview')) + { + parent::validateRules(); + + if (!sizeof($this->_errors)) + { + if (!$id_cms = (int)(Tools::getValue('id_cms'))) + { + $cms = new CMS(); + $this->copyFromPost($cms, 'cms'); + if (!$cms->add()) + $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.' ('.mysql_error().')'; + elseif (Tools::isSubmit('submitAddcmsAndPreview')) + { + $preview_url = $link->getCMSLink($cms, $this->getFieldValue($object, 'link_rewrite', $this->_defaultFormLanguage), (int)($cookie->id_lang)); + if (!$cms->active) + { + $admin_dir = dirname($_SERVER['PHP_SELF']); + $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1); + $token = Tools::encrypt('PreviewCMS'.$cms->id); + + $preview_url .= $object->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir; + } + Tools::redirectAdmin($preview_url); + } + else + Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=3&token='.Tools::getAdminTokenLite('AdminCMSContent')); + } + else + { + $cms = new CMS($id_cms); + $this->copyFromPost($cms, 'cms'); + if (!$cms->update()) + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.mysql_error().')'; + elseif (Tools::isSubmit('submitAddcmsAndPreview')) + { + $preview_url = $link->getCMSLink($cms, $this->getFieldValue($object, 'link_rewrite', $this->_defaultFormLanguage), (int)($cookie->id_lang)); + if (!$cms->active) + { + $admin_dir = dirname($_SERVER['PHP_SELF']); + $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1); + $token = Tools::encrypt('PreviewCMS'.$cms->id); + + $preview_url .= $object->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir; + } + Tools::redirectAdmin($preview_url); + } + else + Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCMSContent')); + } + } + } + elseif (Tools::getValue('position')) + { + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + elseif (!Validate::isLoadedObject($object = $this->loadObject())) + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) + $this->_errors[] = Tools::displayError('Failed to update the position.'); + else + Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4'.(($id_category = (int)(Tools::getValue('id_cms_category'))) ? ('&id_cms_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent')); + } + /* Change object statuts (active, inactive) */ + elseif (Tools::isSubmit('status') AND Tools::isSubmit($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->toggleStatus()) + Tools::redirectAdmin($currentIndex.'&conf=5'.((int)Tools::getValue('id_cms_category') ? '&id_cms_category='.(int)Tools::getValue('id_cms_category') : '').'&token='.Tools::getValue('token')); + else + $this->_errors[] = Tools::displayError('An error occurred while updating status.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + else + parent::postProcess(true); + } +} + + diff --git a/admin-dev/tabs/AdminCMSCategories.php b/admin-dev/tabs/AdminCMSCategories.php new file mode 100644 index 000000000..627183c4f --- /dev/null +++ b/admin-dev/tabs/AdminCMSCategories.php @@ -0,0 +1,293 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCMSCategories extends AdminTab +{ + protected $maxImageSize = 300000; + + /** @var object CMSCategory() instance for navigation*/ + private $_CMSCategory; + + public function __construct() + { + global $cookie; + + $this->table = 'cms_category'; + $this->className = 'CMSCategory'; + $this->lang = true; + $this->edit = true; + $this->view = true; + $this->delete = true; + + + $this->fieldsDisplay = array( + 'id_cms_category' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 30), + 'name' => array('title' => $this->l('Name'), 'width' => 100, 'callback' => 'hideCMSCategoryPosition'), + 'description' => array('title' => $this->l('Description'), 'width' => 500, 'maxlength' => 90, 'orderby' => false), + 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), + 'active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false)); + + $this->_CMSCategory = AdminCMSContent::getCurrentCMSCategory(); + $this->_filter = 'AND `id_parent` = '.(int)($this->_CMSCategory->id); + $this->_select = 'position '; + + parent::__construct(); + } + + public function displayList($token = NULL) + { + global $currentIndex; + /* Display list header (filtering, pagination and column names) */ + $this->displayListHeader($token); + if (!sizeof($this->_list)) + echo ''.$this->l('No items found').''; + + /* Show the content of the table */ + $this->displayListContent($token); + + /* Close list table and submit button */ + $this->displayListFooter($token); + } + + public function display($token = NULL) + { + global $currentIndex, $cookie; + $id_cms_category = (int)(Tools::getValue('id_cms_category', 1)); + + $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL); + + echo '

'.(!$this->_listTotal ? ($this->l('There are no subcategories')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('subcategories') : $this->l('subCMS Category')))).' '.$this->l('in CMS Category').' "'.stripslashes(CMSCategory::hideCMSCategoryPosition($this->_CMSCategory->getName())).'"

'; + echo ' '.$this->l('Add a new sub CMS Category').' +
'; + $this->displayList($token); + echo '
'; + } + + public function postProcess($token = NULL) + { + global $cookie, $currentIndex; + + $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); + + + if (Tools::isSubmit('submitAdd'.$this->table)) + { + + if ($id_cms_category = (int)(Tools::getValue('id_cms_category'))) + { + if (!CMSCategory::checkBeforeMove($id_cms_category, (int)(Tools::getValue('id_parent')))) + { + $this->_errors[] = Tools::displayError('CMS Category cannot be moved here'); + return false; + } + } + } + /* Change object statuts (active, inactive) */ + elseif (isset($_GET['status']) AND Tools::getValue($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->toggleStatus()) + Tools::redirectAdmin($currentIndex.'&conf=5'.((int)$object->id_parent ? '&id_cms_category='.(int)$object->id_parent : '').'&token='.Tools::getValue('token')); + else + $this->_errors[] = Tools::displayError('An error occurred while updating status.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + /* Delete object */ + elseif (isset($_GET['delete'.$this->table])) + { + if ($this->tabAccess['delete'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) + { + // check if request at least one object with noZeroObject + if (isset($object->noZeroObject) AND sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1) + $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); + else + { + $this->deleteImage($object->id); + if ($this->deleted) + { + $object->deleted = 1; + if ($object->update()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token')); + } + elseif ($object->delete()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token')); + $this->_errors[] = Tools::displayError('An error occurred during deletion.'); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + elseif (isset($_GET['position'])) + { + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + elseif (!Validate::isLoadedObject($object = new CMSCategory((int)(Tools::getValue($this->identifier, Tools::getValue('id_cms_category_to_move', 1)))))) + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) + $this->_errors[] = Tools::displayError('Failed to update the position.'); + else + Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_cms_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent')); + } + /* Delete multiple objects */ + elseif (Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $cms_category = new CMSCategory(); + $result = true; + $result = $cms_category->deleteSelection(Tools::getValue($this->table.'Box')); + if ($result) + { + $cms_category->cleanPositions((int)(Tools::getValue('id_cms_category'))); + Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category'))); + } + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + parent::postProcess(true); + } + + public function displayForm($token=NULL) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $active = $this->getFieldValue($obj, 'active'); + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('CMS Category').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ id) ? ' onkeyup="copy2friendlyURL();"' : '').' /> * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + echo '

+
+ +
+ + + + +
+ +
+ +
+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ +
'; + echo '

+
+

+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages as $language) + echo '
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages as $language) + echo '
+ * + '.$this->l('Only letters and the minus (-) character are allowed').'  +
'; + echo '

+
+ +
+ +   +
+
* '.$this->l('Required field').'
+
+
+

'; + } +} diff --git a/admin-dev/tabs/AdminCMSContent.php b/admin-dev/tabs/AdminCMSContent.php new file mode 100644 index 000000000..6188d3d10 --- /dev/null +++ b/admin-dev/tabs/AdminCMSContent.php @@ -0,0 +1,129 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +include(PS_ADMIN_DIR.'/tabs/AdminCMSCategories.php'); +include(PS_ADMIN_DIR.'/tabs/AdminCMS.php'); + +class AdminCMSContent extends AdminTab +{ + /** @var object adminCMSCategories() instance */ + private $adminCMSCategories; + + /** @var object adminCMS() instance */ + private $adminCMS; + + /** @var object Category() instance for navigation*/ + private static $_category = NULL; + + public function __construct() + { + /* Get current category */ + $id_cms_category = (int)(Tools::getValue('id_cms_category', Tools::getValue('id_cms_category_parent', 1))); + self::$_category = new CMSCategory($id_cms_category); + if (!Validate::isLoadedObject(self::$_category)) + die('Category cannot be loaded'); + + $this->table = array('cms_category', 'cms'); + $this->adminCMSCategories = new adminCMSCategories(); + $this->adminCMS = new adminCMS(); + + parent::__construct(); + } + + /** + * Return current category + * + * @return object + */ + public static function getCurrentCMSCategory() + { + return self::$_category; + } + + public function viewAccess($disable = false) + { + $result = parent::viewAccess($disable); + $this->adminCMSCategories->tabAccess = $this->tabAccess; + $this->adminCMS->tabAccess = $this->tabAccess; + return $result; + } + + public function postProcess() + { + if (Tools::isSubmit('submitDelcms') OR Tools::isSubmit('previewSubmitAddcmsAndPreview') OR Tools::isSubmit('submitAddcms') OR isset($_GET['deletecms']) OR Tools::isSubmit('viewcms') OR (Tools::isSubmit('status') AND Tools::isSubmit('id_cms')) OR (Tools::isSubmit('position') AND !Tools::isSubmit('id_cms_category_to_move'))) + $this->adminCMS->postProcess(); + if(Tools::isSubmit('submitDelcms_category') OR Tools::isSubmit('submitAddcms_categoryAndBackToParent') OR Tools::isSubmit('submitAddcms_category') OR isset($_GET['deletecms_category']) OR (Tools::isSubmit('status') AND Tools::isSubmit('id_cms_category')) OR (Tools::isSubmit('position') AND Tools::isSubmit('id_cms_category_to_move'))) + $this->adminCMSCategories->postProcess(); + + } + + public function displayErrors() + { + parent::displayErrors(); + $this->adminCMS->displayErrors(); + $this->adminCMSCategories->displayErrors(); + } + + public function display() + { + global $currentIndex; + + if (((Tools::isSubmit('submitAddcms_category') OR Tools::isSubmit('submitAddcms_categoryAndStay')) AND sizeof($this->adminCMSCategories->_errors)) OR isset($_GET['updatecms_category']) OR isset($_GET['addcms_category'])) + { + $this->adminCMSCategories->displayForm($this->token); + echo '

'.$this->l('Back to list').'
'; + + } + elseif (((Tools::isSubmit('submitAddcms') OR Tools::isSubmit('submitAddcmsAndStay')) AND sizeof($this->adminCMS->_errors)) OR isset($_GET['updatecms']) OR isset($_GET['addcms'])) + { + $this->adminCMS->displayForm($this->token); + echo '

'.$this->l('Back to list').'
'; + + } + else + { + $id_cms_category = (int)(Tools::getValue('id_cms_category')); + if (!$id_cms_category) + $id_cms_category = 1; + $cms_tabs = array('cms_category', 'cms'); + // Cleaning links + $catBarIndex = $currentIndex; + foreach ($cms_tabs AS $tab) + if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway')) + $catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', $currentIndex); + echo '
'.$this->l('Current category').' :   '.getPath($catBarIndex, $id_cms_category,'','','cms').'
'; + echo '

'.$this->l('Categories').'

'; + $this->adminCMSCategories->display($this->token); + echo '
 
'; + echo '

'.$this->l('Pages in this category').'

'; + $this->adminCMS->display($this->token); + } + + } +} + diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php new file mode 100644 index 000000000..dc166856e --- /dev/null +++ b/admin-dev/tabs/AdminCarriers.php @@ -0,0 +1,332 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCarriers extends AdminTab +{ + protected $maxImageSize = 30000; + + public function __construct() + { + global $cookie; + + $this->table = 'carrier'; + $this->className = 'Carrier'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + $this->deleted = true; + $this->fieldImageSettings = array('name' => 'logo', 'dir' => 's'); + + $this->fieldsDisplay = array( + 'id_carrier' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Name'), 'width' => 100), + 'logo' => array('title' => $this->l('Logo'), 'align' => 'center', 'image' => 's', 'orderby' => false, 'search' => false), + 'delay' => array('title' => $this->l('Delay'), 'width' => 300, 'orderby' => false), + 'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)); + + $this->optionTitle = $this->l('Carrier options'); + $this->_fieldsOptions = array( + 'PS_CARRIER_DEFAULT' => array('title' => $this->l('Default carrier:'), 'desc' => $this->l('The default carrier used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_carrier', 'list' => Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, ALL_CARRIERS)), + ); + + parent::__construct(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $currentLanguage = (int)($cookie->id_lang); + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Carriers').' + +
+ * + '.$this->l('Allowed characters: letters, spaces and').' ().-  +

'.$this->l('Carrier name displayed during checkout').'
'.$this->l('With a value of 0, the carrier name will be replaced by the shop name').'

+
+ +
+ +

'.$this->l('Upload logo from your computer').' (.gif, .jpg, .jpeg '.$this->l('or').' .png)

+
+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ * +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'delay', 'delay'); + echo ' +

'.$this->l('Time taken for product delivery; displayed during checkout').'

+
+ +
+ +

'.$this->l('URL for the tracking number; type \'@\' where the tracking number will appear').'

+
+ +
+ +
+ +
'; + $carrier_zones = $obj->getZones(); + $zones = Zone::getZones(false); + foreach ($zones AS $zone) + echo ' $obj->id, 'id_zone' => $zone['id_zone'], 'name' => $zone['name'], 'active' => $zone['active']), $carrier_zones))) ? ' checked="checked"' : '').'>
'; + echo '

'.$this->l('The zone in which this carrier is to be used').'

+
+ +
'; + $groups = Group::getGroups((int)($cookie->id_lang)); + if (sizeof($groups)) + { + echo ' + + + + + + '; + $irow = 0; + foreach ($groups as $group) + echo ' + + + + + '; + echo ' +
id) ? 'checked="checked" ' : '').' />'.$this->l('ID').''.$this->l('Group name').'
getValue('SELECT id_group FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($obj->id).' AND id_group='.(int)($group['id_group'])) OR (!isset($obj->id))) ? 'checked="checked" ' : '').'/>'.$group['id_group'].'
+

'.$this->l('Mark all groups you want to give access to this carrier').'

+ '; + } + else + echo '

'.$this->l('No group created').'

'; + echo '
+ +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Include or exclude carrier from list of carriers on Front Office').'

+
+ +
+ getFieldValue($obj, 'shipping_handling') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'shipping_handling') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Include the shipping & handling costs in carrier price').'

+
+ +
+ getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_DEFAULT ? 'checked="checked" ' : '').'/> +
+ getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_PRICE ? 'checked="checked" ' : '').'/> +
+ getFieldValue($obj, 'shipping_method') == Carrier::SHIPPING_METHOD_WEIGHT ? 'checked="checked" ' : '').'/> +
+
+ +
+ +

'.$this->l('Out-of-range behavior when none is defined (e.g., when a customer\'s cart weight is greater than the highest range limit)').'

+
'; + if($this->getFieldValue($obj, 'is_module')) + { + echo ' +

- '. + $this->l('This carrier is bound to this module ').' => '.$this->getFieldValue($obj, 'external_module_name').'

+ + '; + + if($this->getFieldValue($obj, 'shipping_external')) + { + echo '

- '.$this->l('The shipping costs are calculated outside of your shop').'

+ '; + } + if($this->getFieldValue($obj, 'need_range')) + { + echo '

- '.$this->l('This carrier uses PrestaShop range to calculate shippping costs').'

+ '; + } + + echo '
'; + } + echo ' +
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + + public function beforeDelete($object) + { + return $object->isUsed(); + } + + public function afterDelete($object, $oldId) + { + $object->copyCarrierData((int)($oldId)); + } + + private function changeGroups($id_carrier, $delete = true) + { + if ($delete) + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id_carrier)); + $groups = Db::getInstance()->ExecuteS('SELECT id_group FROM `'._DB_PREFIX_.'group`'); + foreach ($groups as $group) + if (in_array($group['id_group'], $_POST['groupBox'])) + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group (id_group, id_carrier) VALUES('.(int)($group['id_group']).','.(int)($id_carrier).')'); + } + + public function postProcess() + { + global $currentIndex; + + if (Tools::getValue('submitAdd'.$this->table)) + { + /* Checking fields validity */ + $this->validateRules(); + if (!sizeof($this->_errors)) + { + $id = (int)(Tools::getValue('id_'.$this->table)); + + /* Object update */ + if (isset($id) AND !empty($id)) + { + if ($this->tabAccess['edit'] === '1') + { + $object = new $this->className($id); + if (Validate::isLoadedObject($object)) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id)); + $object->deleted = 1; + $object->update(); + $objectNew = new $this->className(); + $this->copyFromPost($objectNew, $this->table); + $result = $objectNew->add(); + if (Validate::isLoadedObject($objectNew)) + { + $this->afterDelete($objectNew, $object->id); + Hook::updateCarrier((int)($object->id), $objectNew); + } + $this->changeGroups($objectNew->id); + if (!$result) + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.''; + elseif ($this->postImage($objectNew->id)) + { + $this->changeZones($objectNew->id); + Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + + /* Object creation */ + else + { + if ($this->tabAccess['add'] === '1') + { + $object = new $this->className(); + $this->copyFromPost($object, $this->table); + if (!$object->add()) + $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + elseif (($_POST['id_'.$this->table] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect) + { + $this->changeZones($object->id); + $this->changeGroups($object->id); + Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + } + } + else + { + if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox'))) + OR (isset($_GET['delete'.$this->table]) AND Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT'))) + $this->_errors[] = $this->l('Please set another carrier as default before deleting'); + else + parent::postProcess(); + } + } + + + function changeZones($id) + { + $carrier = new $this->className($id); + if (!Validate::isLoadedObject($carrier)) + die (Tools::displayError('Object cannot be loaded')); + $zones = Zone::getZones(true); + foreach ($zones as $zone) + if (sizeof($carrier->getZone($zone['id_zone']))) + { + if (!isset($_POST['zone_'.$zone['id_zone']]) OR !$_POST['zone_'.$zone['id_zone']]) + $carrier->deleteZone($zone['id_zone']); + } + else + if (isset($_POST['zone_'.$zone['id_zone']]) AND $_POST['zone_'.$zone['id_zone']]) + $carrier->addZone($zone['id_zone']); + } + + public function displayListContent($token = NULL) + { + foreach ($this->_list as $key => $list) + if ($list['name'] == '0') + $this->_list[$key]['name'] = Configuration::get('PS_SHOP_NAME'); + parent::displayListContent($token); + } +} + diff --git a/admin-dev/tabs/AdminCarts.php b/admin-dev/tabs/AdminCarts.php new file mode 100644 index 000000000..3d36822ca --- /dev/null +++ b/admin-dev/tabs/AdminCarts.php @@ -0,0 +1,323 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCarts extends AdminTab +{ + public function __construct() + { + $this->table = 'cart'; + $this->className = 'Cart'; + $this->lang = false; + $this->edit = false; + $this->view = true; + $this->delete = false; + + + $this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, a.id_cart as total, ca.name as carrier'; + $this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c on (c.id_customer = a.id_customer) + LEFT JOIN '._DB_PREFIX_.'currency cu on (cu.id_currency = a.id_currency) + LEFT JOIN '._DB_PREFIX_.'carrier ca on (ca.id_carrier = a.id_carrier) + '; + + $this->fieldsDisplay = array( + 'id_cart' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'customer' => array('title' => $this->l('Customer'), 'width' => 80, 'filter_key' => 'c!lastname'), + 'total' => array('title' => $this->l('Total'), 'callback' => 'getOrderTotalUsingTaxCalculationMethod', 'orderby' => false, 'search' => false, 'width' => 50, 'align' => 'right', 'prefix' => '', 'suffix' => '', 'currency' => true), + 'carrier' => array('title' => $this->l('Carrier'), 'width' => 25, 'align' => 'center', 'callback' => 'replaceZeroByShopName'), + 'date_add' => array('title' => $this->l('Date'), 'width' => 90, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add')); + parent::__construct(); + } + + public function viewDetails() + { + global $currentIndex, $cookie; + + if (!($cart = $this->loadObject(true))) + return; + $customer = new Customer($cart->id_customer); + $customerStats = $customer->getStats(); + $products = $cart->getProducts(); + $customizedDatas = Product::getAllCustomizedDatas((int)($cart->id)); + Product::addCustomizationPrice($products, $customizedDatas); + $summary = $cart->getSummaryDetails(); + $discounts = $cart->getDiscounts(); + + $currency = new Currency($cart->id_currency); + $currentLanguage = new Language((int)($cookie->id_lang)); + + // display cart header + echo '

'.(($customer->id) ? $customer->firstname.' '.$customer->lastname : $this->l('Guest')).' - '.$this->l('Cart #').sprintf('%06d', $cart->id).' '.$this->l('from').' '.$cart->date_upd.'

'; + + /* Display customer information */ + echo ' +
+
+
+ '.$this->l('Customer information').' + '; + if ($customer->id) + echo ' + '.$customer->firstname.' '.$customer->lastname.' ('.$this->l('#').$customer->id.')
+ ('.$customer->email.')

+ '.$this->l('Account registered:').' '.Tools::displayDate($customer->date_add, (int)($cookie->id_lang), true).'
+ '.$this->l('Valid orders placed:').' '.$customerStats['nb_orders'].'
+ '.$this->l('Total paid since registration:').' '.Tools::displayPrice($customerStats['total_orders'], $currency, false, false).'
'; + else + echo $this->l('Guest not registered').''; + echo '
'; + echo ' +
+
'; + + /* Display order information */ + $id_order = (int)(Order::getOrderByCartId($cart->id)); + $order = new Order($id_order); + + if ($order->getTaxCalculationMethod() == PS_TAX_EXC) + { + $total_products = $summary['total_products']; + $total_discount = $summary['total_discounts_tax_exc']; + $total_wrapping = $summary['total_wrapping_tax_exc']; + $total_price = $summary['total_price_without_tax']; + $total_shipping = $summary['total_shipping_tax_exc']; + } else { + $total_products = $summary['total_products_wt']; + $total_discount = $summary['total_discounts']; + $total_wrapping = $summary['total_wrapping']; + $total_price = $summary['total_price']; + $total_shipping = $summary['total_shipping']; + } + + echo ' +
+ '.$this->l('Order information').' + '; + if ($order->id) + echo ' + '.$this->l('Order #').sprintf('%06d', $order->id).' +

+ '.$this->l('Made on:').' '.Tools::displayDate($order->date_add, (int)$cookie->id_lang, true).'



'; + else + echo $this->l('No order created from this cart').''; + echo '
'; + echo ' +
'; + + + // List of products + echo ' +
+
+ '.$this->l('Products').''.$this->l('Cart summary').' +
+ + + + + + + + + '; + $tokenCatalog = Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)); + foreach ($products as $k => $product) + { + if ($order->getTaxCalculationMethod() == PS_TAX_EXC) + { + $product_price = $product['price']; + $product_total = $product['total']; + } else { + $product_price = $product['price_wt']; + $product_total = $product['total_wt']; + } + + + $image = array(); + if (isset($product['id_product_attribute']) AND (int)($product['id_product_attribute'])) + $image = Db::getInstance()->getRow(' + SELECT id_image + FROM '._DB_PREFIX_.'product_attribute_image + WHERE id_product_attribute = '.(int)($product['id_product_attribute'])); + if (!isset($image['id_image'])) + $image = Db::getInstance()->getRow(' + SELECT id_image + FROM '._DB_PREFIX_.'image + WHERE id_product = '.(int)($product['id_product']).' AND cover = 1'); + $stock = Db::getInstance()->getRow(' + SELECT '.($product['id_product_attribute'] ? 'pa' : 'p').'.quantity + FROM '._DB_PREFIX_.'product p + '.($product['id_product_attribute'] ? 'LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON p.id_product = pa.id_product' : '').' + WHERE p.id_product = '.(int)($product['id_product']).' + '.($product['id_product_attribute'] ? 'AND pa.id_product_attribute = '.(int)($product['id_product_attribute']) : '')); + /* Customization display */ + $this->displayCustomizedDatas($customizedDatas, $product, $currency, $image, $tokenCatalog, $stock); + if ($product['cart_quantity'] > $product['customizationQuantityTotal']) + echo ' + + + + + + + + '; + } + echo ' + + + + '; + + if ($summary['total_discounts'] != 0) + echo ' + + + + '; + if ($summary['total_wrapping'] > 0) + echo ' + + + + '; + if ($cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0) + echo ' + + + + '; + echo ' + + + + +
 '.$this->l('Product').''.$this->l('UP').''.$this->l('Qty').''.$this->l('Stock').''.$this->l('Total').'
'.(isset($image['id_image']) ? cacheImage(_PS_IMG_DIR_.'p/'.(int)($product['id_product']).'-'.(int)($image['id_image']).'.jpg', + 'product_mini_'.(int)($product['id_product']).(isset($product['id_product_attribute']) ? '_'.(int)($product['id_product_attribute']) : '').'.jpg', 45, 'jpg') : '--').' + '.$product['name'].'
+ '.($product['reference'] ? $this->l('Ref:').' '.$product['reference'] : '') + .(($product['reference'] AND $product['supplier_reference']) ? ' / '.$product['supplier_reference'] : '') + .'
'.Tools::displayPrice($product_price, $currency, false, false).''.((int)($product['cart_quantity']) - $product['customizationQuantityTotal']).''.(int)($stock['quantity']).''.Tools::displayPrice($product_total, $currency, false, false).'
'.$this->l('Total products:').''.Tools::displayPrice($total_products, $currency, false).'
'.$this->l('Total vouchers:').''.Tools::displayPrice($total_discount, $currency, false).'
'.$this->l('Total gift-wrapping:').''.Tools::displayPrice($total_wrapping, $currency, false).'
'.$this->l('Total shipping:').''.Tools::displayPrice($total_shipping, $currency, false).'
'.$this->l('Total:').''.Tools::displayPrice($total_price, $currency, false).'
'; + + if (sizeof($discounts)) + { + echo ' + + + + + '; + + foreach ($discounts as $discount) + echo ' + + + + '; + echo ' +
'.$this->l('Discounts').''.$this->l('Discount name').''.$this->l('Value').'
'.$discount['name'].'- '.Tools::displayPrice($discount['value_real'], $currency, false).'
'; + } + echo '
'. + $this->l('According to the group of this customer, prices are printed:').' '.($order->getTaxCalculationMethod() == PS_TAX_EXC ? $this->l('tax excluded.') : $this->l('tax included.')).' +
'; + + // Cancel product + echo ' +
+
 
'; + } + + private function displayCustomizedDatas(&$customizedDatas, &$product, &$currency, &$image, $tokenCatalog, &$stock) + { + if (!($order = $this->loadObject(true))) + return; + + if (is_array($customizedDatas) AND isset($customizedDatas[(int)($product['id_product'])][(int)($product['id_product_attribute'])])) + { + echo ' + + '.(isset($image['id_image']) ? cacheImage(_PS_IMG_DIR_.'p/'.(int)($product['id_product']).'-'.(int)($image['id_image']).'.jpg', + 'product_mini_'.(int)($product['id_product']).(isset($product['id_product_attribute']) ? '_'.(int)($product['id_product_attribute']) : '').'.jpg', 45, 'jpg') : '--').' + + '.$product['name'].'
+ '.($product['reference'] ? $this->l('Ref:').' '.$product['reference'] : '') + .(($product['reference'] AND $product['supplier_reference']) ? ' / '.$product['supplier_reference'] : '') + .'
+ '.Tools::displayPrice($product['price_wt'], $currency, false, false).' + '.$product['customizationQuantityTotal'].' + '.(int)($stock['quantity']).' + '.Tools::displayPrice($product['total_customization_wt'], $currency, false, false).' + '; + foreach ($customizedDatas[(int)($product['id_product'])][(int)($product['id_product_attribute'])] AS $customization) + { + echo ' + + '; + foreach ($customization['datas'] AS $type => $datas) + if ($type == _CUSTOMIZE_FILE_) + { + $i = 0; + echo '
    '; + foreach ($datas AS $data) + echo '
  • + +
  • '; + echo '
'; + } + elseif ($type == _CUSTOMIZE_TEXTFIELD_) + { + $i = 0; + echo '
    '; + foreach ($datas AS $data) + echo '
  • '.($data['name'] ? $data['name'] : $this->l('Text #').++$i).$this->l(':').' '.$data['value'].'
  • '; + echo '
'; + } + echo ' + + '.$customization['quantity'].' + + + '; + } + } + } + + public function display() + { + global $cookie; + + if (isset($_GET['view'.$this->table])) + $this->viewDetails(); + else + { + $this->getList((int)($cookie->id_lang), !Tools::getValue($this->table.'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL); + $this->displayList(); + } + } +} + diff --git a/admin-dev/tabs/AdminCatalog.php b/admin-dev/tabs/AdminCatalog.php new file mode 100644 index 000000000..bd14a05d6 --- /dev/null +++ b/admin-dev/tabs/AdminCatalog.php @@ -0,0 +1,176 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +include(PS_ADMIN_DIR.'/tabs/AdminCategories.php'); +include(PS_ADMIN_DIR.'/tabs/AdminProducts.php'); + +class AdminCatalog extends AdminTab +{ + /** @var object AdminCategories() instance */ + private $adminCategories; + + /** @var object AdminProducts() instance */ + private $adminProducts; + + /** @var object AttributeGenerator() instance */ + private $attributeGenerator; + + /** @var object imageResize() instance */ + private $imageResize; + + /** @var object Category() instance for navigation*/ + private static $_category = NULL; + + public function __construct() + { + /* Get current category */ + $id_category = abs((int)(Tools::getValue('id_category'))); + if (!$id_category) $id_category = 1; + self::$_category = new Category($id_category); + if (!Validate::isLoadedObject(self::$_category)) + die('Category cannot be loaded'); + + $this->table = array('category', 'product'); + $this->adminCategories = new AdminCategories(); + $this->adminProducts = new AdminProducts(); + + parent::__construct(); + } + + /** + * Return current category + * + * @return object + */ + public static function getCurrentCategory() + { + return self::$_category; + } + + public function viewAccess($disable = false) + { + $result = parent::viewAccess($disable); + $this->adminCategories->tabAccess = $this->tabAccess; + $this->adminProducts->tabAccess = $this->tabAccess; + return $result; + } + + public function postProcess() + { + if (!Tools::getValue('id_product')) + $this->adminCategories->postProcess(); + elseif (isset($_GET['attributegenerator'])) + { + if (!isset($this->attributeGenerator)) + { + include_once(PS_ADMIN_DIR.'/tabs/AdminAttributeGenerator.php'); + $this->attributeGenerator = new AdminAttributeGenerator(); + } + $this->attributeGenerator->postProcess(); + } + elseif (isset($_GET['imageresize'])) + { + if (!isset($this->imageResize)) + { + include_once(PS_ADMIN_DIR.'/tabs/AdminImageResize.php'); + $this->imageResize = new AdminImageResize(); + } + $this->imageResize->postProcess(); + } + $this->adminProducts->postProcess($this->token); + } + + public function displayErrors() + { + parent::displayErrors(); + $this->adminProducts->displayErrors(); + $this->adminCategories->displayErrors(); + if (Validate::isLoadedObject($this->attributeGenerator)) + $this->attributeGenerator->displayErrors(); + if (Validate::isLoadedObject($this->imageResize)) + $this->imageResize->displayErrors(); + } + + public function display() + { + global $currentIndex; + + if (((Tools::isSubmit('submitAddcategory') OR Tools::isSubmit('submitAddcategoryAndStay')) AND sizeof($this->adminCategories->_errors)) OR isset($_GET['updatecategory']) OR isset($_GET['addcategory'])) + { + $this->adminCategories->displayForm($this->token); + echo '

'.$this->l('Back to list').'
'; + } + elseif (((Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndPreview') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitSpecificPricePriorities') OR Tools::isSubmit('submitPriceAddition') OR Tools::isSubmit('submitPricesModification')) AND sizeof($this->adminProducts->_errors)) OR Tools::isSubmit('updateproduct') OR Tools::isSubmit('addproduct')) + { + $this->adminProducts->displayForm($this->token); + if (Tools::getValue('id_category') > 1) + echo '

'.$this->l('Back to home').'
'; + else + echo '

'.$this->l('Back to catalog').'
'; + } + elseif (isset($_GET['attributegenerator'])) + { + if (!isset($this->attributeGenerator)) + { + include_once(PS_ADMIN_DIR.'/tabs/AdminAttributeGenerator.php'); + $this->attributeGenerator = new AdminAttributeGenerator(); + } + $this->attributeGenerator->displayForm(); + } + elseif (isset($_GET['imageresize'])) + { + if (!isset($this->imageResize)) + { + include_once(PS_ADMIN_DIR.'/tabs/AdminImageResize.php'); + $this->imageResize = new AdminImageResize(); + } + $this->imageResize->displayForm(); + } + elseif (!isset($_GET['editImage'])) + { + $id_category = (int)(Tools::getValue('id_category')); + if (!$id_category) + $id_category = 1; + $catalog_tabs = array('category', 'product'); + // Cleaning links + $catBarIndex = $currentIndex; + foreach ($catalog_tabs AS $tab) + if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway')) + $catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', $currentIndex); + + echo '
'.$this->l('Current category').' :   '.getPath($catBarIndex, $id_category).'
'; + echo '

'.$this->l('Categories').'

'; + $this->adminCategories->display($this->token); + echo '
 
'; + echo '

'.$this->l('Products in this category').'

'; + $this->adminProducts->display($this->token); + } + } +} + + diff --git a/admin-dev/tabs/AdminCategories.php b/admin-dev/tabs/AdminCategories.php new file mode 100644 index 000000000..55a2e2334 --- /dev/null +++ b/admin-dev/tabs/AdminCategories.php @@ -0,0 +1,365 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminCategories extends AdminTab +{ + protected $maxImageSize = 300000; + + /** @var object Category() instance for navigation*/ + private $_category; + + public function __construct() + { + global $cookie; + + $this->table = 'category'; + $this->className = 'Category'; + $this->lang = true; + $this->edit = true; + $this->view = true; + $this->delete = true; + + $this->fieldImageSettings = array('name' => 'image', 'dir' => 'c'); + + $this->fieldsDisplay = array( + 'id_category' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 30), + 'name' => array('title' => $this->l('Name'), 'width' => 100), + 'description' => array('title' => $this->l('Description'), 'width' => 500, 'maxlength' => 90, 'orderby' => false), + 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), + 'active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false)); + + $this->_category = AdminCatalog::getCurrentCategory(); + $this->_filter = 'AND `id_parent` = '.(int)($this->_category->id); + $this->_select = 'position '; + + parent::__construct(); + } + + public function displayList($token = NULL) + { + global $currentIndex; + + /* Display list header (filtering, pagination and column names) */ + $this->displayListHeader($token); + if (!sizeof($this->_list)) + echo ''.$this->l('No items found').''; + + /* Show the content of the table */ + $this->displayListContent($token); + + /* Close list table and submit button */ + $this->displayListFooter($token); + } + + public function display($token = NULL) + { + global $currentIndex, $cookie; + + $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL); + echo '

'.(!$this->_listTotal ? ($this->l('There are no subcategories')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('subcategories') : $this->l('subcategory')))).' '.$this->l('in category').' "'.stripslashes($this->_category->getName()).'"

'; + if ($this->tabAccess['add'] === '1') + echo ' '.$this->l('Add a new subcategory').''; + echo '
'; + $this->displayList($token); + echo '
'; + } + + public function postProcess($token = NULL) + { + global $cookie, $currentIndex; + + $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); + + if (Tools::isSubmit('submitAdd'.$this->table)) + { + if ($id_category = (int)(Tools::getValue('id_category'))) + { + if (!Category::checkBeforeMove($id_category, (int)(Tools::getValue('id_parent')))) + { + $this->_errors[] = Tools::displayError('Category cannot be moved here'); + return false; + } + + // Updating customer's group + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + else + { + $object = new $this->className($id_category); + if (Tools::getValue('groupBox') != NULL) + { + if (Validate::isLoadedObject($object)) + $object->updateGroup(Tools::getValue('groupBox')); + else + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You must select at least one group.'); + } + } + } + /* Change object statuts (active, inactive) */ + elseif (isset($_GET['status']) AND Tools::getValue($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->toggleStatus()) + { + $target = ''; + if (($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) + $target = '&id_category='.(int)($id_category); + else + { + $referrer = Tools::secureReferrer($_SERVER['HTTP_REFERER']); + if (preg_match('/id_category=(\d+)/', $referrer, $matches)) + $target = '&id_category='.(int)($matches[1]); + } + Module::hookExec('categoryUpdate'); + Tools::redirectAdmin($currentIndex.'&conf=5'.$target.'&token='.Tools::getValue('token')); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + /* Delete object */ + elseif (isset($_GET['delete'.$this->table])) + { + if ($this->tabAccess['delete'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) + { + // check if request at least one object with noZeroObject + if (isset($object->noZeroObject) AND sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1) + $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); + else + { + $this->deleteImage($object->id); + if ($this->deleted) + { + $object->deleted = 1; + if ($object->update()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent)); + } + elseif ($object->delete()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent)); + $this->_errors[] = Tools::displayError('An error occurred during deletion.'); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + elseif (isset($_GET['position'])) + { + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + elseif (!Validate::isLoadedObject($object = new Category((int)(Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1)))))) + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) + $this->_errors[] = Tools::displayError('Failed to update the position.'); + else + Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog')); + } + /* Delete multiple objects */ + elseif (Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $category = new Category(); + $result = true; + $result = $category->deleteSelection(Tools::getValue($this->table.'Box')); + if ($result) + { + $category->cleanPositions((int)(Tools::getValue('id_category'))); + Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCatalog').'&id_category='.(int)(Tools::getValue('id_category'))); + } + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + parent::postProcess(); + } + + protected function postImage($id) + { + $ret = parent::postImage($id); + if (($id_category = (int)(Tools::getValue('id_category'))) AND isset($_FILES) AND sizeof($_FILES) AND $_FILES['image']['name'] != NULL AND file_exists(_PS_CAT_IMG_DIR_.$id_category.'.jpg')) + { + $imagesTypes = ImageType::getImagesTypes('categories'); + foreach ($imagesTypes AS $k => $imageType) + imageResize(_PS_CAT_IMG_DIR_.$id_category.'.jpg', _PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height'])); + } + return $ret; + } + + public function displayForm($token = NULL) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $active = $this->getFieldValue($obj, 'active'); + $customer_groups = $obj->getGroups(); + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Category').' + +
'; + foreach ($this->_languages AS $language) + echo ' +
+ id) ? ' onkeyup="copy2friendlyURL();"' : '').' /> * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + echo '

+
+ +
+ + + + +
+ +
+ +
+ +
'; + foreach ($this->_languages AS $language) + echo ' +
+ +
'; + echo '

+
+ +
'; + echo $this->displayImage($obj->id, _PS_IMG_DIR_.'c/'.$obj->id.'.jpg', 350, NULL, Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); + echo '
+

'.$this->l('Upload category logo from your computer').'

+
+

+ +
'; + foreach ($this->_languages AS $language) + echo ' +
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages AS $language) + echo '
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages AS $language) + echo ' +
+ + '.$this->l('Forbidden characters:').' <>;=#{}  +
'; + echo '

+
+ +
'; + foreach ($this->_languages AS $language) + echo '
+ * + '.$this->l('Only letters and the minus (-) character are allowed').'  +
'; + echo '

+
+ +
'; + $groups = Group::getGroups((int)($cookie->id_lang)); + if (sizeof($groups)) + { + echo ' + + + + + + '; + $irow = 0; + foreach ($groups AS $group) + echo ' + + + + + '; + echo ' +
id) ? 'checked="checked" ' : '').' />'.$this->l('ID').''.$this->l('Group name').'
id))) ? 'checked="checked" ' : '').'/>'.$group['id_group'].'
+

'.$this->l('Mark all groups you want to give access to this category').'

+ '; + } else + echo '

'.$this->l('No group created').'

'; + echo ' +
+
+ +   +
+
* '.$this->l('Required field').'
+
+
+

'; + } +} diff --git a/admin-dev/tabs/AdminContact.php b/admin-dev/tabs/AdminContact.php new file mode 100644 index 000000000..c535ff9b3 --- /dev/null +++ b/admin-dev/tabs/AdminContact.php @@ -0,0 +1,97 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +include_once(PS_ADMIN_DIR.'/tabs/AdminPreferences.php'); + +class AdminContact extends AdminPreferences +{ + public function __construct() + { + $this->className = 'Configuration'; + $this->table = 'configuration'; + + global $cookie; + $countryList = array(); + $countryList[] = array('id' => '0', 'name' => $this->l('Choose your country')); + foreach (Country::getCountries(intval($cookie->id_lang)) AS $country) + $countryList[] = array('id' => $country['id_country'], 'name' => $country['name']); + $stateList = array(); + $stateList[] = array('id' => '0', 'name' => $this->l('Choose your state (if applicable)')); + foreach (State::getStates(intval($cookie->id_lang)) AS $state) + $stateList[] = array('id' => $state['id_state'], 'name' => $state['name']); + + $this->_fieldsShop = array( + 'PS_SHOP_NAME' => array('title' => $this->l('Shop name:'), 'desc' => $this->l('Displayed in e-mails and page titles'), 'validation' => 'isGenericName', 'required' => true, 'size' => 30, 'type' => 'text'), + 'PS_SHOP_EMAIL' => array('title' => $this->l('Shop e-mail:'), 'desc' => $this->l('Displayed in e-mails sent to customers'), 'validation' => 'isEmail', 'required' => true, 'size' => 30, 'type' => 'text'), + 'PS_SHOP_DETAILS' => array('title' => $this->l('Registration:'), 'desc' => $this->l('Shop registration information (e.g., SIRET or RCS)'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'textarea', 'cols' => 30, 'rows' => 5), + 'PS_SHOP_ADDR1' => array('title' => $this->l('Shop address:'), 'validation' => 'isAddress', 'size' => 30, 'type' => 'text'), + 'PS_SHOP_ADDR2' => array('title' => '', 'validation' => 'isAddress', 'size' => 30, 'type' => 'text'), + 'PS_SHOP_CODE' => array('title' => $this->l('Post/Zip code:'), 'validation' => 'isGenericName', 'size' => 6, 'type' => 'text'), + 'PS_SHOP_CITY' => array('title' => $this->l('City:'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text'), + 'PS_SHOP_COUNTRY_ID' => array('title' => $this->l('Country:'), 'validation' => 'isInt', 'size' => 30, 'type' => 'select', 'list' => $countryList, 'identifier' => 'id', 'cast' => 'intval'), + 'PS_SHOP_STATE_ID' => array('title' => $this->l('State:'), 'validation' => 'isInt', 'size' => 30, 'type' => 'select', 'list' => $stateList, 'identifier' => 'id', 'cast' => 'intval'), + 'PS_SHOP_PHONE' => array('title' => $this->l('Phone:'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text'), + 'PS_SHOP_FAX' => array('title' => $this->l('Fax:'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text'), + ); + parent::__construct(); + } + + public function postProcess() + { + if (isset($_POST['PS_SHOP_STATE_ID']) && $_POST['PS_SHOP_STATE_ID'] != '0') + { + $isStateOk = Db::getInstance()->getValue('SELECT `active` FROM `'._DB_PREFIX_.'state` WHERE `id_country` = '.(int)(Tools::getValue('PS_SHOP_COUNTRY_ID')).' AND `id_state` = '.(int)(Tools::getValue('PS_SHOP_STATE_ID'))); + if ($isStateOk != 1) + $this->_errors[] = Tools::displayError('This state is not in this country.'); + } + parent::postProcess(); + } + + protected function _postConfig($fields) + { + global $cookie; + if (!$this->_errors && isset($_POST['PS_SHOP_COUNTRY_ID'])) + { + $country = new Country((int)($_POST['PS_SHOP_COUNTRY_ID']), intval($cookie->id_lang)); + Configuration::updateValue('PS_SHOP_COUNTRY', pSQL($country->name)); + } + if (!$this->_errors && isset($_POST['PS_SHOP_STATE_ID'])) + { + $state = new State((int)($_POST['PS_SHOP_STATE_ID'])); + Configuration::updateValue('PS_SHOP_STATE', pSQL($state->name)); + } + parent::_postConfig($fields); + } + + public function display() + { + $this->_displayForm('shop', $this->_fieldsShop, $this->l('Contact details'), 'width3', 'tab-contact'); + } +} + + diff --git a/admin-dev/tabs/AdminContacts.php b/admin-dev/tabs/AdminContacts.php new file mode 100644 index 000000000..44d6247d4 --- /dev/null +++ b/admin-dev/tabs/AdminContacts.php @@ -0,0 +1,114 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminContacts extends AdminTab +{ + public function __construct() + { + $this->table = 'contact'; + $this->className = 'Contact'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Title'), 'width' => 130), + 'email' => array('title' => $this->l('E-mail address'), 'width' => 130), + 'description' => array('title' => $this->l('Description'), 'width' => 150)); + + $this->optionTitle = $this->l('Contact options'); + $this->_fieldsOptions = array( + 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file upload'), 'desc' => $this->l('Allow customers to upload file using contact page'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array( + '0' => array('value' => 0, 'name' => $this->l('No')), + '1' => array('value' => 1, 'name' => $this->l('Yes')) + )), + 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Pre-defined message'), 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), 'cast' => 'pSQL', 'type' => 'textareaLang', 'identifier' => 'value', + 'cols' => 40, 'rows' => 8 + )); + + parent::__construct(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Contacts').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ * +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'name'); + echo '

'.$this->l('Contact name, e.g., Technical Support').'

+
+ +
+ +

'.$this->l('E-mails will be sent to this address').'

+
+ +
+ getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/> + +

'.$this->l('The messages will be saved in the Customer Service tab').'

+
 
+ +
'; + foreach ($this->_languages as $language) + echo ' +
+ +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'description'); + echo ' +

'.$this->l('Additional information about this contact').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + + diff --git a/admin-dev/tabs/AdminCountries.php b/admin-dev/tabs/AdminCountries.php new file mode 100644 index 000000000..e611eed5b --- /dev/null +++ b/admin-dev/tabs/AdminCountries.php @@ -0,0 +1,162 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCountries extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->table = 'country'; + $this->className = 'Country'; + $this->lang = true; + $this->edit = true; + $this->deleted = false; + $this->_select = 'z.`name` AS zone'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; + + $this->fieldsDisplay = array( + 'id_country' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Country'), 'width' => 130, 'filter_key' => 'b!name'), + 'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'), + 'call_prefix' => array('title' => $this->l('Call prefix'), 'width' => 40, 'align' => 'center', 'callback' => 'displayCallPrefix'), + 'zone' => array('title' => $this->l('Zone'), 'width' => 100, 'filter_key' => 'z!name'), + 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active')); + + $this->optionTitle = $this->l('Countries options'); + $this->_fieldsOptions = array('PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries((int)($cookie->id_lang)))); + parent::__construct(); + } + + public function postProcess() + { + if (isset($_GET['delete'.$this->table]) OR Tools::getValue('submitDel'.$this->table)) + $this->_errors[] = Tools::displayError('You cannot delete a country. If you do not want it available for customers, please disable it.'); + else + return parent::postProcess(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Countries').' + +
'; + + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); + echo '

'.$this->l('Name of country').'

+
+ +
+ * +

'.$this->l('2- or 3-letter ISO code, e.g., FR for France').'. '.$this->l('Official list here').'.

+
+ +
+ * +

'.$this->l('International call prefix, e.g., 33 for France.').'.

+
+ +
+ +
+ +
+ +

'.$this->l('Geographical zone where country is located').'

+
+ +
+ id OR $this->getFieldValue($obj, 'need_zip_code')) ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'need_zip_code') AND $obj->id) ? 'checked="checked" ' : '').'/> + +
+ +
+ * +

'.$this->l('National zip code (L for a letter, N for a number and C for the Iso code), e.g., NNNNN for France. No verification if undefined').'.

+
+ +
+ id OR $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') AND $obj->id) ? 'checked="checked" ' : '').'/> + +

'.$this->l('Enabled or disabled').'

+
+ +
+ id OR $this->getFieldValue($obj, 'contains_states')) ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'contains_states') AND $obj->id) ? 'checked="checked" ' : '').'/> + +
+ +
+ id OR $this->getFieldValue($obj, 'need_identification_number')) ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'need_identification_number') AND $obj->id) ? 'checked="checked" ' : '').'/> + +
+
+ +
+
* '.$this->l('Required field').'
+
+
+ '; + } +} + diff --git a/admin-dev/tabs/AdminCounty.php b/admin-dev/tabs/AdminCounty.php new file mode 100644 index 000000000..e969c3b1d --- /dev/null +++ b/admin-dev/tabs/AdminCounty.php @@ -0,0 +1,219 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminCounty extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->table = 'county'; + $this->className = 'County'; + $this->edit = true; + $this->delete = true; + $this->_select = 's.`name` AS state'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)'; + + $this->fieldsDisplay = array( + 'id_county' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('County'), 'width' => 130, 'filter_key' => 'b!name'), + 'state' => array('title' => $this->l('State'), 'width' => 70, 'filter_key' => 's!name'), + 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active')); + + parent::__construct(); + } + + public function renderJS() + { + return + ''; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + $cur_id_country = 0; + $cur_id_state = 0; + if (isset($obj->id_state)) + { + $cur_state = new State($obj->id_state); + if (Validate::isLoadedObject($cur_state)) + { + $cur_id_country = $cur_state->id_country; + $cur_id_state = $cur_state->id; + } + } + + echo $this->renderJS(). + '
+ '.($obj->id ? '' : '').' +
'.$this->l('Counties').''; + + if (!isset($obj->id)) + echo '
'.$this->l('Save this county then you will be able to associate zipcodes').'

'; + + $countries = Country::getCountries($cookie->id_lang, true, true); + echo ' +
'; + + + echo ' +
+ +
+ '; + + echo + ' +
+ * +
+ +
+ id OR $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') AND $obj->id) ? 'checked="checked" ' : '').'/> + +

'.$this->l('Enabled or disabled').'

+
+
+   + +
'; + + echo '
* '.$this->l('Required field').'
'; + + if (isset($obj->id)) + { + echo ' +
+ '.$this->_renderZipCodeForm().'
+
+ '.AdminCounty::renderZipCodeList($obj->getZipCodes()).' +
'; + } + + echo ' +
+
'; + } + + + protected function _renderZipCodeForm() + { + return ' +
+ Add Zip Codes:
+ Add +
+
'; + } + + + public static function renderZipCodeList($zip_codes) + { + $html = ''; + foreach ($zip_codes AS $zip_code) + { + $full_zip_code = $zip_code['from_zip_code']; + if ($zip_code['to_zip_code'] != 0) + $full_zip_code .= '-'.$zip_code['to_zip_code']; + + $html .= '
'.Tools::htmlentitiesUTF8($full_zip_code).'
'; + } + + return $html; + } +} + diff --git a/admin-dev/tabs/AdminCurrencies.php b/admin-dev/tabs/AdminCurrencies.php new file mode 100644 index 000000000..d868f59fd --- /dev/null +++ b/admin-dev/tabs/AdminCurrencies.php @@ -0,0 +1,233 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); + +class AdminCurrencies extends AdminTab +{ + public function __construct() + { + $this->table = 'currency'; + $this->className = 'Currency'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_currency' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Currency'), 'width' => 100), + 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 35), + 'iso_code_num' => array('title' => $this->l('ISO code num'), 'align' => 'center', 'width' => 35), + 'sign' => array('title' => $this->l('Symbol'), 'width' => 20, 'align' => 'center', 'orderby' => false, 'search' => false), + 'conversion_rate' => array('title' => $this->l('Conversion rate'), 'float' => true, 'align' => 'center', 'width' => 50, 'search' => false), + 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)); + + $this->optionTitle = $this->l('Currencies options'); + $this->_fieldsOptions = array( + 'PS_CURRENCY_DEFAULT' => array( + 'title' => $this->l('Default currency:'), + 'desc' => $this->l('The default currency used in shop') + .'
'.$this->l('If you change default currency, you will have to manually edit every product price.').'
', + 'cast' => 'intval', + 'type' => 'select', + 'identifier' => 'id_currency', + 'list' => Currency::getCurrencies() + ), + ); + $this->_where = 'AND a.`deleted` = 0'; + + parent::__construct(); + } + + public function postProcess() + { + global $currentIndex; + + if (isset($_GET['delete'.$this->table])) + { + if ($this->tabAccess['delete'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT')) + $this->_errors[] = $this->l('You can\'t delete the default currency'); + elseif ($object->delete()) + Tools::redirectAdmin($currentIndex.'&conf=1'.'&token='.$this->token); + else + $this->_errors[] = Tools::displayError('An error occurred during deletion.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->active AND $object->id == Configuration::get('PS_CURRENCY_DEFAULT')) + $this->_errors[] = $this->l('You can\'t disable the default currency'); + elseif ($object->toggleStatus()) + Tools::redirectAdmin($currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$this->token); + else + $this->_errors[] = Tools::displayError('An error occurred while updating status.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + elseif (Tools::getValue('submitOptions'.$this->table)) + { + foreach ($this->_fieldsOptions as $key => $field) + { + Configuration::updateValue($key, $field['cast'](Tools::getValue($key))); + if ($key == 'PS_CURRENCY_DEFAULT') + Currency::refreshCurrencies(); + } + Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); + } + elseif (Tools::isSubmit('submitExchangesRates')) + { + if (!$this->_errors[] = Currency::refreshCurrencies()) + Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); + } + else + parent::postProcess(); + } + + public function displayOptionsList() + { + global $currentIndex; + + parent::displayOptionsList(); + echo '

+
+
+ '.$this->l('Currency rates').' + +
+

'.$this->l('Update your currencies exchanges rates with a real-time tool').'

+
+
+ +
+
+
'; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Currencies').' + +
+ * + '.$this->l('Only letters and the minus character are allowed').'  +

'.$this->l('Will appear on Front Office, e.g., euro, dollar').'...

+
+ +
+ * +   +

'.$this->l('ISO code, e.g., USD for dollar, EUR for euro').'...

+
+ +
+ * +   +

'.$this->l('Numeric ISO code, e.g., 840 for dollar, 978 for euro').'...

+
+ +
+ * +

'.$this->l('Will appear on Front Office, e.g., €, $').'...

+
+ +
+ * +

'.$this->l('Conversion rate from one unit of your shop\'s default currency (for example, 1€) to this currency. For example, if the default currency is euros and this currency is dollars, type \'1.20\'').' 1€ = $1.20

+
+ +
+ +

'.$this->l('Applies to all prices, e.g.,').' $1,240.15

+
+ +
+ getFieldValue($obj, 'decimals') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'decimals') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Display decimals on prices').'

+
+ +
+ getFieldValue($obj, 'blank') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'blank') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Include a blank between sign and price, e.g.,').'
$1,240.15 -> $ 1,240.15

+
+ +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + diff --git a/admin-dev/tabs/AdminCustomerThreads.php b/admin-dev/tabs/AdminCustomerThreads.php new file mode 100644 index 000000000..ed3a52228 --- /dev/null +++ b/admin-dev/tabs/AdminCustomerThreads.php @@ -0,0 +1,602 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminCustomerThreads extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->table = 'customer_thread'; + $this->lang = false; + $this->className = 'CustomerThread'; + $this->edit = false; + $this->view = true; + $this->delete = true; + + $this->_select = 'CONCAT(c.firstname," ",c.lastname) as customer, cl.name as contact, l.name as language, group_concat(message) as messages, ( + SELECT IFNULL(CONCAT(LEFT(e.firstname, 1),". ",e.lastname), "--") + FROM '._DB_PREFIX_.'customer_message cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm2.id_employee + WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread` + ORDER BY cm2.date_add DESC LIMIT 1) as employee'; + $this->_group = 'GROUP BY cm.id_customer_thread'; + $this->_join = ' + LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer` + LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread` + LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang` + LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$cookie->id_lang.')'; + + $contactArray = array(); + $contacts = Contact::getContacts($cookie->id_lang); + foreach ($contacts AS $contact) + $contactArray[$contact['id_contact']] = $contact['name']; + + $languageArray = array(); + $languages = Language::getLanguages(); + foreach ($languages AS $language) + $languageArray[$language['id_lang']] = $language['name']; + + $statusArray = array( + 'open' => $this->l('Open'), + 'closed' => $this->l('Closed'), + 'pending1' => $this->l('Pending 1'), + 'pending2' => $this->l('Pending 2') + ); + + $imagesArray = array( + 'open' => 'status_green.gif', + 'closed' => 'status_red.gif', + 'pending1' => 'status_orange.gif', + 'pending2' => 'status_orange.gif' + ); + + $this->fieldsDisplay = array( + 'id_customer_thread' => array('title' => $this->l('ID'), 'width' => 25), + 'customer' => array('title' => $this->l('Customer'), 'width' => 100, 'filter_key' => 'customer', 'tmpTableFilter' => true), + 'email' => array('title' => $this->l('E-mail'), 'width' => 100, 'filter_key' => 'a!email'), + 'contact' => array('title' => $this->l('Type'), 'width' => 75, 'type' => 'select', 'select' => $contactArray, 'filter_key' => 'cl!id_contact', 'filter_type' => 'int'), + 'language' => array('title' => $this->l('Language'), 'width' => 60, 'type' => 'select', 'select' => $languageArray, 'filter_key' => 'l!id_lang', 'filter_type' => 'int'), + 'status' => array('title' => $this->l('Status'), 'width' => 50, 'type' => 'select', 'select' => $statusArray, 'icon' => $imagesArray, 'align' => 'center', 'filter_key' => 'a!status', 'filter_type' => 'string'), + 'employee' => array('title' => $this->l('Employee'), 'width' => 100, 'filter_key' => 'employee', 'tmpTableFilter' => true), + 'messages' => array('title' => $this->l('Messages'), 'width' => 50, 'filter_key' => 'messages', 'tmpTableFilter' => true, 'maxlength' => 0), + 'date_upd' => array('title' => $this->l('Last message'), 'width' => 90) + ); + + parent::__construct(); + } + + public function postProcess() + { + global $currentIndex, $cookie; + + if ($id_customer_thread = (int)Tools::getValue('id_customer_thread')) + { + if (($id_contact = (int)Tools::getValue('id_contact'))) + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer_thread SET id_contact = '.(int)$id_contact.' WHERE id_customer_thread = '.(int)$id_customer_thread); + if ($id_status = (int)Tools::getValue('setstatus')) + { + $statusArray = array(1 => 'open', 2 => 'closed', 3 => 'pending1', 4 => 'pending2'); + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer_thread SET status = "'.$statusArray[$id_status].'" WHERE id_customer_thread = '.(int)$id_customer_thread.' LIMIT 1'); + } + if (isset($_POST['id_employee_forward'])) + { + // Todo: need to avoid doubles + $messages = Db::getInstance()->ExecuteS(' + SELECT ct.*, cm.*, cl.name subject, CONCAT(e.firstname, \' \', e.lastname) employee_name, CONCAT(c.firstname, \' \', c.lastname) customer_name, c.firstname + FROM '._DB_PREFIX_.'customer_thread ct + LEFT JOIN '._DB_PREFIX_.'customer_message cm ON (ct.id_customer_thread = cm.id_customer_thread) + LEFT JOIN '._DB_PREFIX_.'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = '.(int)$cookie->id_lang.') + LEFT OUTER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm.id_employee + LEFT OUTER JOIN '._DB_PREFIX_.'customer c ON (c.email = ct.email) + WHERE ct.id_customer_thread = '.(int)Tools::getValue('id_customer_thread').' + ORDER BY cm.date_add DESC'); + $output = ''; + foreach ($messages AS $message) + $output .= $this->displayMsg($message, true, (int)Tools::getValue('id_employee_forward')); + + $cm = new CustomerMessage(); + $cm->id_employee = (int)$cookie->id_employee; + $cm->id_customer_thread = (int)Tools::getValue('id_customer_thread'); + $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); + $currentEmployee = new Employee($cookie->id_employee); + if (($id_employee = (int)Tools::getValue('id_employee_forward')) AND ($employee = new Employee($id_employee)) AND Validate::isLoadedObject($employee)) + { + $params = array( + '{messages}' => $output, + '{employee}' => $currentEmployee->firstname.' '.$currentEmployee->lastname, + '{comment}' => stripslashes($_POST['message_forward'])); + Mail::Send((int)($cookie->id_lang), 'forward_msg', Mail::l('Fwd: Customer message'), $params, + $employee->email, $employee->firstname.' '.$employee->lastname, + $currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname); + $cm->message = $this->l('Message forwarded to').' '.$employee->firstname.' '.$employee->lastname."\n".$this->l('Comment:').' '.$_POST['message_forward']; + $cm->add(); + } + elseif (($email = Tools::getValue('email')) AND Validate::isEmail($email)) + { + $params = array( + '{messages}' => $output, + '{employee}' => $currentEmployee->firstname.' '.$currentEmployee->lastname, + '{comment}' => stripslashes($_POST['message_forward'])); + Mail::Send((int)($cookie->id_lang), 'forward_msg', Mail::l('Fwd: Customer message'), $params, + $email, NULL, + $currentEmployee->email, $currentEmployee->firstname.' '.$currentEmployee->lastname); + $cm->message = $this->l('Message forwarded to').' '.$email."\n".$this->l('Comment:').' '.$_POST['message_forward']; + $cm->add(); + } + else + echo '
'.Tools::displayError('Email invalid.').'
'; + } + if (Tools::isSubmit('submitReply')) + { + $ct = new CustomerThread($id_customer_thread); + $cm = new CustomerMessage(); + $cm->id_employee = (int)$cookie->id_employee; + $cm->id_customer_thread = $ct->id; + $cm->message = Tools::htmlentitiesutf8(nl2br2(Tools::getValue('reply_message'))); + $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); + if (isset($_FILES) AND !empty($_FILES['joinFile']['name']) AND $_FILES['joinFile']['error'] != 0) + $this->_errors[] = Tools::displayError('An error occurred with the file upload.'); + else if ($cm->add()) + { + $fileAttachment = NULL; + if (!empty($_FILES['joinFile']['name'])) + { + $fileAttachment['content'] = file_get_contents($_FILES['joinFile']['tmp_name']); + $fileAttachment['name'] = $_FILES['joinFile']['name']; + $fileAttachment['mime'] = $_FILES['joinFile']['type']; + } + $params = array( + '{reply}' => nl2br2(Tools::getValue('reply_message')), + '{link}' => Tools::getHttpHost(true).__PS_BASE_URI__.'contact-form.php?id_customer_thread='.(int)($ct->id).'&token='.$ct->token); + Mail::Send($ct->id_lang, 'reply_msg', Mail::l('An answer to your message is available'), $params, Tools::getValue('msg_email'), NULL, NULL, NULL, $fileAttachment); + $ct->status = 'closed'; + $ct->update(); + Tools::redirectAdmin($currentIndex.'&id_customer_thread='.(int)$id_customer_thread.'&viewcustomer_thread&token='.Tools::getValue('token')); + } + else + $this->_errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.'); + } + } + + return parent::postProcess(); + } + + public function display() + { + global $cookie; + + if (isset($_GET['filename']) AND file_exists(_PS_UPLOAD_DIR_.$_GET['filename'])) + self::openUploadedFile(); + else if (isset($_GET['view'.$this->table])) + $this->viewcustomer_thread(); + else + { + $this->getList((int)$cookie->id_lang, !Tools::getValue($this->table.'Orderby') ? 'date_upd' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL); + $this->displayList(); + } + } + + public function displayListHeader($token = NULL) + { + global $currentIndex, $cookie; + + $contacts = Db::getInstance()->ExecuteS(' + SELECT cl.*, COUNT(*) as total, ( + SELECT id_customer_thread + FROM '._DB_PREFIX_.'customer_thread ct2 + WHERE status = "open" AND ct.id_contact = ct2.id_contact + ORDER BY date_upd ASC + LIMIT 1 + ) as id_customer_thread + FROM '._DB_PREFIX_.'customer_thread ct + LEFT JOIN '._DB_PREFIX_.'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = '.$cookie->id_lang.') + WHERE ct.status = "open" + GROUP BY ct.id_contact HAVING COUNT(*) > 0'); + $categories = Db::getInstance()->ExecuteS(' + SELECT cl.* + FROM '._DB_PREFIX_.'contact ct + LEFT JOIN '._DB_PREFIX_.'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = '.$cookie->id_lang.') + WHERE ct.customer_service = 1'); + $dim = count($categories); + + echo '
'; + foreach ($categories as $key => $val) + { + $totalThread = 0; + $id_customer_thread = 0; + foreach ($contacts as $tmp => $tmp2) + if ($val['id_contact'] == $tmp2['id_contact']) + { + $totalThread = $tmp2['total']; + $id_customer_thread = $tmp2['id_customer_thread']; + break; + } + echo '
+

 '.$val['name'].'

'. + ($dim > 6 ? '' : '

'.$val['description'].'

'). + ($totalThread == 0 ? '

'.$this->l('No new message').'

' + : ''.$totalThread.' '.($totalThread > 1 ? $this->l('new messages'): $this->l('new message')).'').' +
'; + } + echo '
'; + + $params = array( + $this->l('Total threads') => $all = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_thread'), + $this->l('Threads pending') => $pending = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_thread WHERE status LIKE "%pending%"'), + $this->l('Total customer messages') => Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_message WHERE id_employee = 0'), + $this->l('Total employee messages') => Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_message WHERE id_employee != 0'), + $this->l('Threads unread') => $unread = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_thread WHERE status = "open"'), + $this->l('Threads closed') => $all - ($unread + $pending)); + + echo '
+

'.$this->l('Customer service').' : '.$this->l('Statistics').'

+ '; + $count = 0; + foreach ($params as $key => $val) + echo ''; + echo '
'.$key.''.$val.'
+

 

'; + parent::displayListHeader($token); + } + + private function openUploadedFile() + { + $filename = $_GET['filename']; + + $extensions = array('.txt' => 'text/plain', '.rtf' => 'application/rtf', '.doc' => 'application/msword', '.docx'=> 'application/msword', + '.pdf' => 'application/pdf', '.zip' => 'multipart/x-zip', '.png' => 'image/png', '.jpeg' => 'image/jpeg', '.gif' => 'image/gif', '.jpg' => 'image/jpeg'); + + $extension = ''; + foreach ($extensions AS $key => $val) + if (substr($filename, -4) == $key OR substr($filename, -5) == $key) + { + $extension = $val; + break; + } + + ob_end_clean(); + header('Content-Type: '.$extension); + header('Content-Disposition:attachment;filename="'.$filename.'"'); + readfile(_PS_UPLOAD_DIR_.$filename); + die; + } + private function displayMsg($message, $email = false, $id_employee = null) + { + global $cookie, $currentIndex; + + $customersToken = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)); + $contacts = Contact::getContacts($cookie->id_lang); + + if (!$email) + { + if (!empty($message['id_product']) AND empty($message['employee_name'])) + $id_order_product = Db::getInstance()->getValue(' + SELECT o.id_order + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_detail od ON o.id_order = od.id_order + WHERE o.id_customer = '.(int)$message['id_customer'].' + AND od.product_id = '.(int)$message['id_product'].' + ORDER BY o.date_add DESC'); + + $output = ' +
+ '.( + !empty($message['employee_name']) + ? ''.Configuration::get('PS_SHOP_NAME').' '.Configuration::get('PS_SHOP_NAME').' - '.$message['employee_name'] + : ''.Configuration::get('PS_SHOP_NAME').' '.( + !empty($message['id_customer']) + ? ''.$message['customer_name'].'' + : $message['email'] + ) + ).' +
'.( + (!empty($message['id_customer']) AND empty($message['employee_name'])) + ? ''.$this->l('Customer ID:').' '.(int)($message['id_customer']).' '.$this->l('view').'
' + : '' + ).' + '.$this->l('Sent on:').' '.Tools::displayDate($message['date_add'], (int)($cookie->id_lang), true).'
'.( + empty($message['employee_name']) + ? ''.$this->l('Browser:').' '.strip_tags($message['user_agent']).'
' + : '' + ).( + (!empty($message['file_name']) AND file_exists(_PS_UPLOAD_DIR_.$message['file_name'])) + ? ''.$this->l('File attachment').' '.$this->l('view').'
' + : '' + ).( + (!empty($message['id_order']) AND empty($message['employee_name'])) + ? ''.$this->l('Order #').' '.(int)($message['id_order']).' '.$this->l('view').'
' + : '' + ).( + (!empty($message['id_product']) AND empty($message['employee_name'])) + ? ''.$this->l('Product #').' '.(int)($message['id_product']).' '.$this->l('view').'
' + : '' + ).'
+
+ '.$this->l('Subject:').' + + +
'; + } + else + { + $output = '
+ '.($id_employee ? ''.$this->l('View this thread').'
' : '').' + '.$this->l('Sent by:').' '.(!empty($message['customer_name']) ? $message['customer_name'].' ('.$message['email'].')' : $message['email']) + .((!empty($message['id_customer']) AND empty($message['employee_name'])) ? '
'.$this->l('Customer ID:').' '.(int)($message['id_customer']).'
' : '') + .((!empty($message['id_order']) AND empty($message['employee_name'])) ? '
'.$this->l('Order #').': '.(int)($message['id_order']).'
' : '') + .((!empty($message['id_product']) AND empty($message['employee_name'])) ? '
'.$this->l('Product #').': '.(int)($message['id_product']).'
' : '') + .'
'.$this->l('Subject:').' '.$message['subject']; + } + + $message['message'] = preg_replace('/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui', '\1\2', html_entity_decode($message['message'], ENT_NOQUOTES, 'UTF-8')); + $output .= '

+ '.$this->l('Thread ID:').' '.(int)$message['id_customer_thread'].'
+ '.$this->l('Message ID:').' '.(int)$message['id_customer_message'].'
+ '.$this->l('Message:').'
+ '.$message['message'].' +
'; + + if (!$email) + { + if (empty($message['employee_name'])) + $output .= ' +

+ +

+
'; + } + + return $output; + } + + public function viewcustomer_thread() + { + global $cookie, $currentIndex; + + if (!($thread = $this->loadObject())) + return; + $cookie->{'customer_threadFilter_cl!id_contact'} = $thread->id_contact; + + $employees = Db::getInstance()->ExecuteS(' + SELECT e.id_employee, e.firstname, e.lastname FROM '._DB_PREFIX_.'employee e + WHERE e.active = 1 ORDER BY e.lastname ASC'); + + echo ' +

'.$this->l('Messages').'

+
+

+ '.$this->l('Forward this discussion to an employee:').' + +

+ +

+
+
 
'; + + $messages = Db::getInstance()->ExecuteS(' + SELECT ct.*, cm.*, cl.name subject, CONCAT(e.firstname, \' \', e.lastname) employee_name, CONCAT(c.firstname, \' \', c.lastname) customer_name, c.firstname + FROM '._DB_PREFIX_.'customer_thread ct + LEFT JOIN '._DB_PREFIX_.'customer_message cm ON (ct.id_customer_thread = cm.id_customer_thread) + LEFT JOIN '._DB_PREFIX_.'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = '.(int)$cookie->id_lang.') + LEFT JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm.id_employee + LEFT JOIN '._DB_PREFIX_.'customer c ON (IFNULL(ct.id_customer, ct.email) = IFNULL(c.id_customer, c.email)) + WHERE ct.id_customer_thread = '.(int)Tools::getValue('id_customer_thread').' + ORDER BY cm.date_add DESC'); + + echo '
'; + + $nextThread = Db::getInstance()->getValue(' + SELECT id_customer_thread FROM '._DB_PREFIX_.'customer_thread ct + WHERE ct.status = "open" AND ct.date_upd > ( + SELECT date_add FROM '._DB_PREFIX_.'customer_message + WHERE (id_employee IS NULL OR id_employee = 0) AND id_customer_thread = '.(int)$thread->id.' + ORDER BY date_add DESC LIMIT 1 + ) + '.($cookie->{'customer_threadFilter_cl!id_contact'} ? 'AND ct.id_contact = '.(int)$cookie->{'customer_threadFilter_cl!id_contact'} : '').' + '.($cookie->{'customer_threadFilter_l!id_lang'} ? 'AND ct.id_lang = '.(int)$cookie->{'customer_threadFilter_l!id_lang'} : ''). + ' ORDER BY ct.date_upd ASC'); + if ($nextThread) + echo $this->displayButton(' + + +
'.$this->l('Answer to the next unanswered message in this category').' > +
'); + else + echo $this->displayButton(' + +
'.$this->l('The other messages in this category have been answered')); + + if ($thread->status != "closed") + echo $this->displayButton(' + + +
'.$this->l('Set this message as handled').' +
'); + + if ($thread->status != "pending1") + echo $this->displayButton(' + + +
'.$this->l('Declare this message').'
'.$this->l('as "pending 1"').'
'.$this->l('(will be answered later)').' +
'); + else + echo $this->displayButton(' + + +
'.$this->l('Click here to disable pending status').' +
'); + + if ($thread->status != "pending2") + echo $this->displayButton(' + + +
'.$this->l('Declare this message').'
'.$this->l('as "pending 2"').'
'.$this->l('(will be answered later)').' +
'); + else + echo $this->displayButton(' + + +
'.$this->l('Click here to disable pending status').' +
'); + + echo '
'; + + if ($thread->id_customer) + { + $customer = new Customer($thread->id_customer); + $products = $customer->getBoughtProducts(); + $orders = Order::getCustomerOrders($customer->id); + + echo '
'; + if ($orders AND sizeof($orders)) + { + $totalOK = 0; + $ordersOK = array(); + $tokenOrders = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); + foreach ($orders as $order) + if ($order['valid']) + { + $ordersOK[] = $order; + $totalOK += $order['total_paid_real']; + } + if ($countOK = sizeof($ordersOK)) + { + echo '
+

'.$this->l('Orders').'

+ + + + + + + + + + '; + $irow = 0; + foreach ($ordersOK AS $order) + echo ' + + + + + + + + '; + echo '
'.$this->l('ID').''.$this->l('Date').''.$this->l('Products').''.$this->l('Total paid').''.$this->l('Payment').''.$this->l('State').''.$this->l('Actions').'
'.$order['id_order'].''.Tools::displayDate($order['date_add'], (int)($cookie->id_lang)).''.$order['nb_products'].''.Tools::displayPrice($order['total_paid_real'], new Currency((int)($order['id_currency']))).''.$order['payment'].''.$order['order_state'].'
+

'.$this->l('Validated Orders:').' '.$countOK.' '.$this->l('for').' '.Tools::displayPrice($totalOK, new Currency(1)).'

+
'; + } + } + if ($products AND sizeof($products)) + { + echo '
+

'.$this->l('Products').'

+ + + + + + + + '; + $irow = 0; + $tokenOrders = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); + foreach ($products AS $product) + echo ' + + + + + + + '; + echo '
'.$this->l('Date').''.$this->l('ID').''.$this->l('Name').''.$this->l('Quantity').''.$this->l('Actions').'
'.Tools::displayDate($product['date_add'], (int)($cookie->id_lang), true).''.$product['product_id'].''.$product['product_name'].''.$product['product_quantity'].'
'; + } + echo '
'; + } + + echo '
'; + foreach ($messages AS $message) + echo $this->displayMsg($message); + echo '
 
'; + } + + private function displayButton($content) + { + return ' +
+

+ '.$content.' +

+
'; + } +} + diff --git a/admin-dev/tabs/AdminCustomers.php b/admin-dev/tabs/AdminCustomers.php new file mode 100644 index 000000000..33b1ec5f7 --- /dev/null +++ b/admin-dev/tabs/AdminCustomers.php @@ -0,0 +1,802 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminCustomers extends AdminTab +{ + public function __construct() + { + $this->table = 'customer'; + $this->className = 'Customer'; + $this->lang = false; + $this->edit = true; + $this->view = true; + $this->delete = true; + $this->deleted = true; + $this->requiredDatabase = true; + + $this->_select = '(YEAR(CURRENT_DATE)-YEAR(`birthday`)) - (RIGHT(CURRENT_DATE, 5) $this->l('M'), 2 => $this->l('F'), 9 => $this->l('?')); + $this->fieldsDisplay = array( + 'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'id_gender' => array('title' => $this->l('Gender'), 'width' => 25, 'align' => 'center', 'icon' => array(1 => 'male.gif', 2 => 'female.gif', 'default' => 'unknown.gif'), 'orderby' => false, 'type' => 'select', 'select' => $genders, 'filter_key' => 'a!id_gender'), + 'lastname' => array('title' => $this->l('Last Name'), 'width' => 80), + 'firstname' => array('title' => $this->l('First name'), 'width' => 60), + 'email' => array('title' => $this->l('E-mail address'), 'width' => 120, 'maxlength' => 19), + 'age' => array('title' => $this->l('Age'), 'width' => 30, 'search' => false), + 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false), + 'newsletter' => array('title' => $this->l('News.'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'icon' => array(0 => 'disabled.gif', 1 => 'enabled.gif'), 'orderby' => false), + 'optin' => array('title' => $this->l('Opt.'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'icon' => array(0 => 'disabled.gif', 1 => 'enabled.gif'), 'orderby' => false), + 'date_add' => array('title' => $this->l('Registration'), 'width' => 30, 'type' => 'date', 'align' => 'right'), + 'connect' => array('title' => $this->l('Connection'), 'width' => 60, 'type' => 'datetime', 'search' => false)); + + $this->optionTitle = $this->l('Customers options'); + $this->_fieldsOptions = array( + 'PS_PASSWD_TIME_FRONT' => array('title' => $this->l('Regenerate password:'), 'desc' => $this->l('Security minimum time to wait to regenerate the password'), 'cast' => 'intval', 'size' => 5, 'type' => 'text', 'suffix' => ' '.$this->l('minutes')) + ); + + parent::__construct(); + } + + public function postProcess() + { + global $currentIndex; + + if (Tools::isSubmit('submitDel'.$this->table) OR Tools::isSubmit('delete'.$this->table)) + { + $deleteForm = ' +
+
'.$this->l('How do you want to delete your customer(s)?').' + '.$this->l('You have two ways to delete a customer, please choose what you want to do.').' +

+ + +

+

+ + +

'; + foreach ($_POST as $key => $value) + if (is_array($value)) + foreach ($value as $val) + $deleteForm .= ''; + else + $deleteForm .= ''; + $deleteForm .= '
+
+
+
 
'; + } + + if (Tools::getValue('submitAdd'.$this->table)) + { + $groupList = Tools::getValue('groupBox'); + + /* Checking fields validity */ + $this->validateRules(); + if (!sizeof($this->_errors)) + { + $id = (int)(Tools::getValue('id_'.$this->table)); + if (isset($id) AND !empty($id)) + { + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + else + { + $object = new $this->className($id); + if (Validate::isLoadedObject($object)) + { + $customer_email = strval(Tools::getValue('email')); + + // check if e-mail already used + if ($customer_email != $object->email) + { + $customer = new Customer(); + $customer->getByEmail($customer_email); + if ($customer->id) + $this->_errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; + } + + if (!is_array($groupList) OR sizeof($groupList) == 0) + $this->_errors[] = Tools::displayError('Customer must be in at least one group.'); + else + if (!in_array(Tools::getValue('id_default_group'), $groupList)) + $this->_errors[] = Tools::displayError('Default customer group must be selected in group box.'); + + // Updating customer's group + if (!sizeof($this->_errors)) + { + $object->cleanGroups(); + if (is_array($groupList) AND sizeof($groupList) > 0) + $object->addGroups($groupList); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while loading object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + } + else + { + if ($this->tabAccess['add'] === '1') + { + $object = new $this->className(); + $this->copyFromPost($object, $this->table); + if (!$object->add()) + $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.' ('.mysql_error().')'; + elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND !sizeof($this->_errors) AND $this->_redirect) + { + // Add Associated groups + $group_list = Tools::getValue('groupBox'); + if (is_array($group_list) && sizeof($group_list) > 0) + $object->addGroups($group_list, true); + $parent_id = (int)(Tools::getValue('id_parent', 1)); + // Save and stay on same form + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$this->token); + // Save and back to parent + if (Tools::isSubmit('submitAdd'.$this->table.'AndBackToParent')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=3&token='.$this->token); + // Default behavior (save and back) + Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$this->token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + } + } + elseif (Tools::isSubmit('delete'.$this->table) AND $this->tabAccess['delete'] === '1') + { + switch (Tools::getValue('deleteMode')) + { + case 'real': + $this->deleted = false; + Discount::deleteByIdCustomer((int)(Tools::getValue('id_customer'))); + break; + case 'deleted': + $this->deleted = true; + break; + default: + echo $deleteForm; + if (isset($_POST['delete'.$this->table])) + unset($_POST['delete'.$this->table]); + if (isset($_GET['delete'.$this->table])) + unset($_GET['delete'.$this->table]); + break; + } + } + elseif (Tools::isSubmit('submitDel'.$this->table) AND $this->tabAccess['delete'] === '1') + { + switch (Tools::getValue('deleteMode')) + { + case 'real': + $this->deleted = false; + foreach (Tools::getValue('customerBox') as $id_customer) + Discount::deleteByIdCustomer((int)($id_customer)); + break; + case 'deleted': + $this->deleted = true; + break; + default: + echo $deleteForm; + if (isset($_POST['submitDel'.$this->table])) + unset($_POST['submitDel'.$this->table]); + if (isset($_GET['submitDel'.$this->table])) + unset($_GET['submitDel'.$this->table]); + break; + } + } + elseif (Tools::isSubmit('submitGuestToCustomer') AND Tools::getValue('id_customer')) + { + if ($this->tabAccess['edit'] === '1') + { + $customer = new Customer((int)Tools::getValue('id_customer')); + if (!Validate::isLoadedObject($customer)) + $this->_errors[] = Tools::displayError('This customer does not exist.'); + if ($customer->transformToCustomer(Tools::getValue('id_lang', Configuration::get('PS_LANG_DEFAULT')))) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token); + else + $this->_errors[] = Tools::displayError('An error occurred while updating customer.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + return parent::postProcess(); + } + + public function viewcustomer() + { + global $currentIndex, $cookie, $link; + + $irow = 0; + $configurations = Configuration::getMultiple(array('PS_LANG_DEFAULT', 'PS_CURRENCY_DEFAULT')); + $defaultLanguage = (int)($configurations['PS_LANG_DEFAULT']); + $defaultCurrency = (int)($configurations['PS_CURRENCY_DEFAULT']); + if (!($customer = $this->loadObject())) + return; + $customerStats = $customer->getStats(); + $addresses = $customer->getAddresses($defaultLanguage); + $products = $customer->getBoughtProducts(); + $discounts = Discount::getCustomerDiscounts($defaultLanguage, $customer->id, false, false); + $orders = Order::getCustomerOrders($customer->id); + $carts = Cart::getCustomerCarts($customer->id); + $groups = $customer->getGroups(); + $messages = CustomerThread::getCustomerMessages($customer->id); + $referrers = Referrer::getReferrers($customer->id); + if ($totalCustomer = Db::getInstance()->getValue('SELECT SUM(total_paid_real) FROM '._DB_PREFIX_.'orders WHERE id_customer = '.$customer->id.' AND valid = 1')) + { + Db::getInstance()->getValue('SELECT SQL_CALC_FOUND_ROWS COUNT(*) FROM '._DB_PREFIX_.'orders WHERE valid = 1 GROUP BY id_customer HAVING SUM(total_paid_real) > '.$totalCustomer); + $countBetterCustomers = (int)Db::getInstance()->getValue('SELECT FOUND_ROWS()') + 1; + } + else + $countBetterCustomers = '-'; + + echo ' +
+ '.$customer->firstname.' '.$customer->lastname.' +
+ '.$customer->email.'

+ '.$this->l('ID:').' '.sprintf('%06d', $customer->id).'
+ '.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, (int)($cookie->id_lang), true).'
+ '.$this->l('Last visit:').' '.($customerStats['last_visit'] ? Tools::displayDate($customerStats['last_visit'], (int)($cookie->id_lang), true) : $this->l('never')).'
+ '.($countBetterCustomers != '-' ? $this->l('Rank: #').' '.(int)$countBetterCustomers.'
' : '').' +
+
+
+ +
+ '.$this->l('Newsletter:').' '.($customer->newsletter ? '' : '').'
+ '.$this->l('Opt-in:').' '.($customer->optin ? '' : '').'
+ '.$this->l('Age:').' '.$customerStats['age'].' '.((!empty($customer->birthday['age'])) ? '('.Tools::displayDate($customer->birthday, (int)($cookie->id_lang)).')' : $this->l('unknown')).'

+ '.$this->l('Last update:').' '.Tools::displayDate($customer->date_upd, (int)($cookie->id_lang), true).'
+ '.$this->l('Status:').' '.($customer->active ? '' : ''); + if ($customer->isGuest()) + echo ' +
+ '.$this->l('This customer is registered as').' '.$this->l('guest').' +
+ +

+ '.$this->l('This feature generates a random password and sends an e-mail to the customer').' +
+
+ '; + echo ' +
+
 
'; + + echo '
'.$this->l('Add a private note').' +

'.$this->l('This note will be displayed to all the employees but not to the customer.').'

+
+
+ + +
+
+
 
+ '; + + + echo '

'.$this->l('Messages').' ('.sizeof($messages).')

'; + if (sizeof($messages)) + { + echo ' + + + + + + '; + foreach ($messages AS $message) + echo ' + + + + '; + echo '
'.$this->l('Status').''.$this->l('Message').''.$this->l('Sent on').'
'.$message['status'].''.substr(strip_tags(html_entity_decode($message['message'], ENT_NOQUOTES, 'UTF-8')), 0, 75).'...'.Tools::displayDate($message['date_add'], (int)($cookie->id_lang), true).'
+
 
'; + } + else + echo $customer->firstname.' '.$customer->lastname.' '.$this->l('has never contacted you.'); + + // display hook specified to this page : AdminCustomers + if (($hook = Module::hookExec('adminCustomers', array('id_customer' => $customer->id))) !== false) + echo '
'.$hook.'
'; + echo '
 
'; + + echo '

'.$this->l('Groups').' ('.sizeof($groups).')

'; + if ($groups AND sizeof($groups)) + { + echo ' + + + + + + '; + $tokenGroups = Tools::getAdminToken('AdminGroups'.(int)(Tab::getIdFromClassName('AdminGroups')).(int)($cookie->id_employee)); + foreach ($groups AS $group) + { + $objGroup = new Group($group); + echo ' + + + + + '; + } + echo ' +
'.$this->l('ID').''.$this->l('Name').''.$this->l('Actions').'
'.$objGroup->id.''.$objGroup->name[$defaultLanguage].'
'; + } + echo '
 
'; + echo '

'.$this->l('Orders').' ('.sizeof($orders).')

'; + if ($orders AND sizeof($orders)) + { + $totalOK = 0; + $ordersOK = array(); + $ordersKO = array(); + $tokenOrders = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); + foreach ($orders as $order) + if ($order['valid']) + { + $ordersOK[] = $order; + $totalOK += $order['total_paid_real']; + } + else + $ordersKO[] = $order; + $orderHead = ' + + + + + + + + + + '; + $orderFoot = '
'.$this->l('ID').''.$this->l('Date').''.$this->l('Products').''.$this->l('Total paid').''.$this->l('Payment').''.$this->l('State').''.$this->l('Actions').'
'; + if ($countOK = sizeof($ordersOK)) + { + echo '

'.$this->l('Valid orders:').' '.$countOK.' '.$this->l('for').' '.Tools::displayPrice($totalOK, new Currency($defaultCurrency)).'

'.$orderHead; + foreach ($ordersOK AS $order) + echo ' + '.$order['id_order'].' + '.Tools::displayDate($order['date_add'], (int)($cookie->id_lang)).' + '.$order['nb_products'].' + '.Tools::displayPrice($order['total_paid_real'], new Currency((int)($order['id_currency']))).' + '.$order['payment'].' + '.$order['order_state'].' + + '; + echo $orderFoot.'
'; + } + if ($countKO = sizeof($ordersKO)) + { + echo '

'.$this->l('Invalid orders:').' '.$countKO.'

'.$orderHead; + foreach ($ordersKO AS $order) + echo ' + + '.$order['id_order'].' + '.Tools::displayDate($order['date_add'], (int)($cookie->id_lang)).' + '.$order['nb_products'].' + '.Tools::displayPrice($order['total_paid_real'], new Currency((int)($order['id_currency']))).' + '.$order['payment'].' + '.$order['order_state'].' + + '; + echo $orderFoot.'
 
'; + } + } + else + echo $customer->firstname.' '.$customer->lastname.' '.$this->l('has not placed any orders yet'); + + if ($products AND sizeof($products)) + { + echo '
 
+

'.$this->l('Products').' ('.sizeof($products).')

+ + + + + + + '; + $tokenOrders = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); + foreach ($products AS $product) + echo ' + + + + + + '; + echo ' +
'.$this->l('Date').''.$this->l('Name').''.$this->l('Quantity').''.$this->l('Actions').'
'.Tools::displayDate($product['date_add'], (int)($cookie->id_lang), true).''.$product['product_name'].''.$product['product_quantity'].'
'; + } + echo '
 
+

'.$this->l('Addresses').' ('.sizeof($addresses).')

'; + if (sizeof($addresses)) + { + echo ' + + + + + + + + + '; + $tokenAddresses = Tools::getAdminToken('AdminAddresses'.(int)(Tab::getIdFromClassName('AdminAddresses')).(int)($cookie->id_employee)); + foreach ($addresses AS $address) + echo ' + + + + + + + + '; + echo ' +
'.$this->l('Company').''.$this->l('Name').''.$this->l('Address').''.$this->l('Country').''.$this->l('Phone number(s)').''.$this->l('Actions').'
'.($address['company'] ? $address['company'] : '--').''.$address['firstname'].' '.$address['lastname'].''.$address['address1'].($address['address2'] ? ' '.$address['address2'] : '').' '.$address['postcode'].' '.$address['city'].''.$address['country'].''.($address['phone'] ? ($address['phone'].($address['phone_mobile'] ? '
'.$address['phone_mobile'] : '')) : ($address['phone_mobile'] ? '
'.$address['phone_mobile'] : '--')).'
+ + +
'; + } + else + echo $customer->firstname.' '.$customer->lastname.' '.$this->l('has not registered any addresses yet').'.'; + echo '
 
+

'.$this->l('Discounts').' ('.sizeof($discounts).')

'; + if (sizeof($discounts)) + { + echo ' + + + + + + + + + + '; + $tokenDiscounts = Tools::getAdminToken('AdminDiscounts'.(int)(Tab::getIdFromClassName('AdminDiscounts')).(int)($cookie->id_employee)); + foreach ($discounts AS $discount) + { + echo ' + + + + + + + + + '; + } + echo ' +
'.$this->l('ID').''.$this->l('Code').''.$this->l('Type').''.$this->l('Value').''.$this->l('Qty available').''.$this->l('Status').''.$this->l('Actions').'
'.$discount['id_discount'].''.$discount['name'].''.$discount['type'].''.$discount['value'].''.$discount['quantity_for_user'].''.$this->l('Status').' + + +
'; + + } + else + echo $customer->firstname.' '.$customer->lastname.' '.$this->l('has no discount vouchers').'.'; + echo '
 
'; + + echo '
+

'.$this->l('Carts').' ('.sizeof($carts).')

'; + if ($carts AND sizeof($carts)) + { + echo ' + + + + + + + + '; + $tokenCarts = Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)($cookie->id_employee)); + foreach ($carts AS $cart) + { + $cartI = new Cart((int)($cart['id_cart'])); + $summary = $cartI->getSummaryDetails(); + $currency = new Currency((int)($cart['id_currency'])); + $carrier = new Carrier((int)($cart['id_carrier'])); + echo ' + + + + + + + '; + } + echo ' +
'.$this->l('ID').''.$this->l('Date').''.$this->l('Total').''.$this->l('Carrier').''.$this->l('Actions').'
'.sprintf('%06d', $cart['id_cart']).''.Tools::displayDate($cart['date_add'], (int)($cookie->id_lang), true).''.Tools::displayPrice($summary['total_price'], $currency).''.$carrier->name.'
'; + } + else + echo $this->l('No cart available').'.'; + echo '
'; + + $interested = Db::getInstance()->ExecuteS('SELECT DISTINCT id_product FROM '._DB_PREFIX_.'cart_product cp INNER JOIN '._DB_PREFIX_.'cart c on c.id_cart = cp.id_cart WHERE c.id_customer = '.(int)$customer->id.' AND cp.id_product NOT IN ( + SELECT product_id FROM '._DB_PREFIX_.'orders o inner join '._DB_PREFIX_.'order_detail od ON o.id_order = od.id_order WHERE o.valid = 1 AND o.id_customer = '.(int)$customer->id.')'); + if (count($interested)) + { + echo '
+

'.$this->l('Products').' ('.count($interested).')

+ '; + foreach ($interested as $p) + { + $product = new Product((int)$p['id_product'], false, $cookie->id_lang); + echo ' + + + + + '; + } + echo '
'.(int)$product->id.''.Tools::htmlentitiesUTF8($product->name).'
'; + } + + echo '
 
'; + + /* Last connections */ + $connections = $customer->getLastConnections(); + if (sizeof($connections)) + { + echo '

'.$this->l('Last connections').'

+ + + + + + + + '; + foreach ($connections as $connection) + echo ' + + + + + + '; + echo '
'.$this->l('Date').''.$this->l('Pages viewed').''.$this->l('Total time').''.$this->l('Origin').''.$this->l('IP Address').'
'.Tools::displayDate($connection['date_add'], (int)($cookie->id_lang), true).''.(int)($connection['pages']).''.$connection['time'].''.($connection['http_referer'] ? preg_replace('/^www./', '', parse_url($connection['http_referer'], PHP_URL_HOST)) : $this->l('Direct link')).''.$connection['ipaddress'].'
 
'; + } + if (sizeof($referrers)) + { + echo '

'.$this->l('Referrers').'

+ + + + + '; + foreach ($referrers as $referrer) + echo ' + + + '; + echo '
'.$this->l('Date').''.$this->l('Name').'
'.Tools::displayDate($referrer['date_add'], (int)($cookie->id_lang), true).''.$referrer['name'].'
 
'; + } + echo ' '.$this->l('Back to customer list').'
'; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + $birthday = explode('-', $this->getFieldValue($obj, 'birthday')); + $customer_groups = Tools::getValue('groupBox', $obj->getGroups()); + $groups = Group::getGroups($this->_defaultFormLanguage, true); + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Customer').' + +
+ getFieldValue($obj, 'id_gender') == 1 ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'id_gender') == 2 ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'id_gender') == 9 OR !$this->getFieldValue($obj, 'id_gender')) ? 'checked="checked" ' : '').'/> + +
+ +
+ * + '.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:  +
+ +
+ * + '.$this->l('Forbidden characters:').' 0-9!<>,;?=+()@#"�{}_$%:  +
+ +
+ '.(!$obj->id ? '*' : '').' +

'.($obj->id ? $this->l('Leave blank if no change') : $this->l('5 characters min., only letters, numbers, or').' -_').'

+
+ +
+ * +
+ '; + $sl_year = ($this->getFieldValue($obj, 'birthday')) ? $birthday[0] : 0; + $years = Tools::dateYears(); + $sl_month = ($this->getFieldValue($obj, 'birthday')) ? $birthday[1] : 0; + $months = Tools::dateMonths(); + $sl_day = ($this->getFieldValue($obj, 'birthday')) ? $birthday[2] : 0; + $days = Tools::dateDays(); + $tab_months = array( + $this->l('January'), + $this->l('February'), + $this->l('March'), + $this->l('April'), + $this->l('May'), + $this->l('June'), + $this->l('July'), + $this->l('August'), + $this->l('September'), + $this->l('October'), + $this->l('November'), + $this->l('December')); + echo ' +
+ + + +
'; + echo ' +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Allow or disallow this customer to log in').'

+
+ +
+ getFieldValue($obj, 'newsletter') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'newsletter') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Customer will receive your newsletter via e-mail').'

+
+ +
+ getFieldValue($obj, 'optin') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'optin') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Customer will receive your ads via e-mail').'

+
+ +
+ +

'.$this->l('Apply non-cumulative rules (e.g., price, display method, reduction)').'

+
+ +
'; + if (sizeof($groups)) + { + echo ' + + + + + + '; + $irow = 0; + foreach ($groups as $group) + { + echo ' + + + + + '; + } + echo ' +
'.$this->l('ID').''.$this->l('Group name').'
'.''.$group['id_group'].'
+

'.$this->l('Check all the box(es) of groups of which the customer is to be a member').' *

+ '; + } else + echo '

'.$this->l('No group created').'

'; + echo ' +
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + + public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL) + { + global $cookie; + return parent::getList((int)($cookie->id_lang), !Tools::getValue($this->table.'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL); + } + + public function beforeDelete($object) + { + return $object->isUsed(); + } +} + + diff --git a/admin-dev/tabs/AdminDb.php b/admin-dev/tabs/AdminDb.php new file mode 100644 index 000000000..a2cf2ee7e --- /dev/null +++ b/admin-dev/tabs/AdminDb.php @@ -0,0 +1,150 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/tabs/AdminPreferences.php'); + +class AdminDb extends AdminPreferences +{ + public function __construct() + { + $this->className = 'Configuration'; + $this->table = 'configuration'; + + $this->_fieldsDatabase = array( + 'db_server' => array('title' => $this->l('Server:'), 'desc' => $this->l('IP or server name; \'localhost\' will work in most cases'), 'size' => 30, 'type' => 'text', 'required' => true), + 'db_name' => array('title' => $this->l('Database:'), 'desc' => $this->l('Database name (e.g., \'prestashop\')'), 'size' => 30, 'type' => 'text', 'required' => true), + 'db_prefix' => array('title' => $this->l('Prefix:'), 'size' => 30, 'type' => 'text'), + 'db_user' => array('title' => $this->l('User:'), 'size' => 30, 'type' => 'text', 'required' => true), + 'db_passwd' => array('title' => $this->l('Password:'), 'size' => 30, 'type' => 'password', 'desc' => $this->l('Leave blank if no change'))); + parent::__construct(); + } + + public function postProcess() + { + global $currentIndex; + + if (isset($_POST['submitDatabase'.$this->table])) + { + if ($this->tabAccess['edit'] === '1') + { + foreach ($this->_fieldsDatabase AS $field => $values) + if (isset($values['required']) AND $values['required']) + if (($value = Tools::getValue($field)) == false AND (string)$value != '0') + $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); + + if (!sizeof($this->_errors)) + { + /* Datas are not saved in database but in config/settings.inc.php */ + $settings = array(); + foreach ($_POST as $k => $value) + if ($value) + $settings['_'.Tools::strtoupper($k).'_'] = $value; + rewriteSettingsFile(NULL, NULL, $settings); + Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + if (Tools::isSubmit('submitEngine')) + { + if (!isset($_POST['tablesBox']) OR !sizeof($_POST['tablesBox'])) + $this->_errors[] = Tools::displayError('You do not have select tables'); + else + { + $available_engines = $this->_getEngines(); + $tables_status = $this->_getTablesStatus(); + $tables_engine = array(); + + foreach ($tables_status AS $table) + $tables_engine[$table['Name']] = $table['Engine']; + + $engineType = pSQL(Tools::getValue('engineType')); + foreach ($_POST['tablesBox'] AS $table) + { + if ($engineType == $tables_engine[$table]) + $this->_errors[] = $table.' '.$this->l('is already in').' '.$engineType; + else + if (!Db::getInstance()->Execute('ALTER TABLE '.pSQL($table).' ENGINE='.pSQL($engineType))) + $this->_errors[] = $this->l('Can\'t change engine for').' '.$table; + else + echo '
'.$this->l('Confirmation').''.$this->l('Engine change of').' '.$table.' '.$this->l('to').' '.$engineType.'
'; + } + } + } + + } + + public function display() + { + global $currentIndex; + echo $this->displayWarning($this->l('Be VERY CAREFUL with these settings, as changes may cause your PrestaShop online store to malfunction. For all issues, check the config/settings.inc.php file.')).'
'; + $this->_displayForm('database', $this->_fieldsDatabase, $this->l('Database'), 'width2', 'database_gear'); + $engines = $this->_getEngines(); + $irow = 0; + echo '
'.$this->l('MySQL Engine').'
+ '; + $tables_status = $this->_getTablesStatus(); + foreach ($tables_status AS $table) + { + if (!preg_match('/^'._DB_PREFIX_.'.*/Ui', $table['Name'])) + continue; + echo ' + + '; + } + echo '
'.$this->l('Table').''.$this->l('Table Engine').'
'.$table['Name'].''.$table['Engine'].'

+ +
+ + +
+
'; + } + + private function _getEngines() + { + $engines = Db::getInstance()->ExecuteS('SHOW ENGINES'); + $allowed_engines = array(); + foreach ($engines AS $engine) + { + if (in_array($engine['Engine'], array('InnoDB', 'MyISAM')) AND in_array($engine['Support'], array('DEFAULT', 'YES'))) + $allowed_engines[] = $engine['Engine']; + } + return $allowed_engines; + } + + private function _getTablesStatus() + { + return Db::getInstance()->ExecuteS('SHOW TABLE STATUS'); + } +} + + diff --git a/admin-dev/tabs/AdminDeliverySlip.php b/admin-dev/tabs/AdminDeliverySlip.php new file mode 100644 index 000000000..41d3d76c6 --- /dev/null +++ b/admin-dev/tabs/AdminDeliverySlip.php @@ -0,0 +1,104 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminDeliverySlip extends AdminTab +{ + public function __construct() + { + global $cookie; + + $this->table = 'delivery'; + + $this->optionTitle = $this->l('Delivery slips options'); + $this->_fieldsOptions = array( + 'PS_DELIVERY_PREFIX' => array('title' => $this->l('Delivery prefix:'), 'desc' => $this->l('Prefix used for delivery slips'), 'size' => 6, 'type' => 'textLang'), + 'PS_DELIVERY_NUMBER' => array('title' => $this->l('Delivery number:'), 'desc' => $this->l('The next delivery slip will begin with this number, and then increase with each additional slip'), 'size' => 6, 'type' => 'text'), + ); + + parent::__construct(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + $output = ' +

'.$this->l('Print PDF delivery slips').'

+
+ + +
+ * +

'.$this->l('Format: 2007-12-31 (inclusive)').'

+
+ +
+ * +

'.$this->l('Format: 2008-12-31 (inclusive)').'

+
+
+ +
+
* '.$this->l('Required fields').'
+ +
'; + + echo $output; + } + + public function display() + { + $this->displayForm(); + $this->displayOptionsList(); + } + + public function postProcess() + { + global $currentIndex; + + if (Tools::getValue('submitPrint')) + { + if (!Validate::isDate($_POST['date_from'])) + $this->_errors[] = $this->l('Invalid from date'); + if (!Validate::isDate($_POST['date_to'])) + $this->_errors[] = $this->l('Invalid end date'); + if (!sizeof($this->_errors)) + { + $orders = Order::getOrdersIdByDate($_POST['date_from'], $_POST['date_to'], NULL, 'delivery'); + if (sizeof($orders)) + Tools::redirectAdmin('pdf.php?deliveryslips='.urlencode(serialize($orders)).'&token='.$this->token); + else + $this->_errors[] = $this->l('No delivery slip found for this period'); + } + } + else + parent::postProcess(); + } +} + + diff --git a/admin-dev/tabs/AdminDiscounts.php b/admin-dev/tabs/AdminDiscounts.php new file mode 100644 index 000000000..aa7dd0d44 --- /dev/null +++ b/admin-dev/tabs/AdminDiscounts.php @@ -0,0 +1,486 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminDiscounts extends AdminTab +{ + + public function __construct() + { + global $cookie; + + $this->table = 'discount'; + $this->className = 'Discount'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + $this->_select = 'dtl.`name` AS discount_type, + IF(a.id_discount_type = 1, CONCAT(a.value, " %"), + IF(a.id_discount_type = 2, CONCAT(a.value, " ", c.sign), + "--")) as strvalue'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'currency` c ON (c.`id_currency` = a.`id_currency`) + LEFT JOIN `'._DB_PREFIX_.'discount_type` dt ON (dt.`id_discount_type` = a.`id_discount_type`) + LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)($cookie->id_lang).')'; + + $typesArray = array(); + $types = Discount::getDiscountTypes((int)($cookie->id_lang)); + foreach ($types AS $type) + $typesArray[$type['id_discount_type']] = $type['name']; + + $this->fieldsDisplay = array( + 'id_discount' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Code'), 'width' => 85, 'prefix' => '', 'suffix' => '', 'filter_key' => 'a!name'), + 'description' => array('title' => $this->l('Description'), 'width' => 100, 'filter_key' => 'b!description'), + 'discount_type' => array('title' => $this->l('Type'), 'type' => 'select', 'select' => $typesArray, 'filter_key' => 'dt!id_discount_type'), + 'strvalue' => array('title' => $this->l('Value'), 'width' => 50, 'align' => 'right', 'filter_key' => 'a!value'), + 'quantity' => array('title' => $this->l('Qty'), 'width' => 40, 'align' => 'right'), + 'date_to' => array('title' => $this->l('To'), 'width' => 60, 'type' => 'date', 'align' => 'right'), + 'active' => array('title' => $this->l('Status'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)); + + $this->optionTitle = $this->l('Discounts options'); + $this->_fieldsOptions = array( + 'PS_VOUCHERS' => array('title' => $this->l('Enable vouchers:'), 'desc' => $this->l('Allow the use of vouchers in shop'), 'cast' => 'intval', 'type' => 'bool'), + ); + parent::__construct(); + } + + protected function copyFromPost(&$object, $table) + { + parent::copyFromPost($object, $table); + + $object->cumulable = (!isset($_POST['cumulable']) ? false : true); + $object->cumulable_reduction = (!isset($_POST['cumulable_reduction']) ? false : true); + } + + public function postProcess() + { + global $currentIndex, $cookie; + $token = Tools::getValue('token') ? Tools::getValue('token') : $this->token; + + if ($discountName = Tools::getValue('name') AND Validate::isDiscountName($discountName) AND Discount::discountExists($discountName, Tools::getValue('id_discount'))) + $this->_errors[] = Tools::displayError('A voucher of this name already exists. Please choose another name.'); + + if (Tools::getValue('submitAdd'.$this->table)) + { + if (Tools::getValue('id_discount_type') == 2 AND Tools::getValue('id_currency') == 0) + $this->_errors[] = Tools::displayError('Please set a currency for this voucher.'); + if (!Validate::isBool_Id(Tools::getValue('id_target'))) + $this->_errors[] = Tools::displayError('Invalid customer or group ID field'); + else + { + $rules = explode('_', Tools::getValue('id_target')); + /* In form, there is one field for two differents fields in object*/ + $_POST[($rules[0] ? 'id_group' : 'id_customer')] = $rules[1]; + } + /* Checking fields validity */ + $this->validateRules(); + if (!sizeof($this->_errors)) + { + $id = (int)(Tools::getValue($this->identifier)); + + /* Object update */ + if (isset($id) AND !empty($id)) + { + if ($this->tabAccess['edit'] === '1') + { + $object = new $this->className($id); + if (Validate::isLoadedObject($object)) + { + /* Specific to objects which must not be deleted */ + if ($this->deleted AND $this->beforeDelete($object)) + { + $object->deleted = 1; + $object->update(); + $objectNew = new $this->className(); + $this->copyFromPost($objectNew, $this->table); + $result = $objectNew->add(); + if (Validate::isLoadedObject($objectNew)) + $this->afterDelete($objectNew, $object->id); + } + else + { + if (($categories = Tools::getValue('categoryBox')) === false OR (!empty($categories) AND !is_array($categories))) + die(Tools::displayError()); + $this->copyFromPost($object, $this->table); + $result = $object->update(true, false, $categories); + } + if (!$result) + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.''; + elseif ($this->postImage($object->id)) + { + if ($back = Tools::getValue('back')) + Tools::redirectAdmin(urldecode($back).'&conf=4'); + if (Tools::getValue('stay_here') == 'on' || Tools::getValue('stay_here') == 'true' || Tools::getValue('stay_here') == '1') + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&updatescene&token='.$token); + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&token='.$token); + + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + + /* Object creation */ + else + { + if ($this->tabAccess['add'] === '1') + { + $object = new $this->className(); + $this->copyFromPost($object, $this->table); + $categories = Tools::getValue('categoryBox', null); + if (!$object->add(true, false, $categories)) + $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + } + $this->_errors = array_unique($this->_errors); + } + else + return parent::postProcess(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' + +
+ '.($obj->id ? '' : '').' +
'.$this->l('Vouchers').' + +
+ + * + + '.$this->l('Invalid characters: numbers and').' !<>,;?=+()@#"�{}_$%:  +

'.$this->l('The voucher\'s code, at least 3 characters long, which the customer types in during check-out').'

+
+ +
+ * +
+ + +
'; + foreach ($this->_languages as $language) + echo '
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +

'.$this->l('Will appear in cart next to voucher code').'

+
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'description', 'description'); + echo '
+
+ +
+ + + + + + '; + $done = array(); + $index = array(); + $indexedCategories = isset($_POST['categoryBox']) ? $_POST['categoryBox'] : ($obj->id ? Discount::getCategories($obj->id) : array()); + $categories = Category::getCategories((int)($cookie->id_lang), false); + foreach ($indexedCategories AS $k => $row) + $index[] = $row['id_category']; + $this->recurseCategoryForInclude((int)(Tools::getValue($this->identifier)), $index, $categories, $categories[0][1], 1, $obj->id); + echo ' +
'.$this->l('ID').''.$this->l('Name').'
+

'.$this->l('Mark all checkbox(es) of categories to which the discount is to be applied').' *

+
+
+ +
+ * +

'.$this->l('Total quantity available (mainly for vouchers open to everyone)').'

+
+ +
+ * +

'.$this->l('Number of times a single customer can use this voucher').'

+
+ +
+ * +

'.$this->l('0 if not applicable').'

+
+
+

+ getFieldValue($obj, 'cumulable') == 1) ? ' checked="checked"' : '').' id="cumulable_on" value="1" /> + +

+
+
+

+ getFieldValue($obj, 'cumulable_reduction') == 1) ? ' checked="checked"' : '').' id="cumulable_reduction_on" value="1" /> + +

+
+ +
+ + +
'.$this->l('Filter:').' + +

'; + includeDatepicker(array('date_from', 'date_to'), true); + echo ' + +
+ * +

'.$this->l('Start date/time from which voucher can be used').'
'.$this->l('Format: YYYY-MM-DD HH:MM:SS').'

+
+ +
+ * +

'.$this->l('End date/time at which voucher is no longer valid').'
'.$this->l('Format: YYYY-MM-DD HH:MM:SS').'

+
+ +
+ getFieldValue($obj, 'cart_display') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'cart_display') ? 'checked="checked" ' : '').'/> + +
+
+ +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Enable or disable voucher').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + /** + * Build a categories tree + * + * @param array $indexedCategories Array with categories where product is indexed (in order to check checkbox) + * @param array $categories Categories to list + * @param array $current Current category + * @param integer $id_category Current category id + */ + public static function recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $has_suite = array()) + { + global $done; + static $irow; + + if (!isset($done[$current['infos']['id_parent']])) + $done[$current['infos']['id_parent']] = 0; + $done[$current['infos']['id_parent']] += 1; + + $todo = sizeof($categories[$current['infos']['id_parent']]); + $doneC = $done[$current['infos']['id_parent']]; + + $level = $current['infos']['level_depth'] + 1; + + echo ' + + + + + + '.$id_category.' + + '; + for ($i = 2; $i < $level; $i++) + echo ''; + echo '   + + '; + + if ($level > 1) + $has_suite[] = ($todo == $doneC ? 0 : 1); + if (isset($categories[$id_category])) + foreach ($categories[$id_category] AS $key => $row) + if ($key != 'infos') + self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite); + } +} + + diff --git a/admin-dev/tabs/AdminEmails.php b/admin-dev/tabs/AdminEmails.php new file mode 100644 index 000000000..29ab4307c --- /dev/null +++ b/admin-dev/tabs/AdminEmails.php @@ -0,0 +1,108 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/tabs/AdminPreferences.php'); + +class AdminEmails extends AdminPreferences +{ + public function __construct() + { + global $cookie; + + $this->className = 'Configuration'; + $this->table = 'configuration'; + + foreach (Contact::getContacts((int)$cookie->id_lang) AS $contact) + $arr[] = array('email_message' => $contact['id_contact'], 'name' => $contact['name']); + + $this->_fieldsEmail = array( + 'PS_MAIL_EMAIL_MESSAGE' => array('title' => $this->l('Send e-mail to:'), 'desc' => $this->l('When customers send message from order page'), 'validation' => 'isUnsignedId', 'type' => 'select', 'cast' => 'intval', 'identifier' => 'email_message', 'list' => $arr), + 'PS_MAIL_METHOD' => array('title' => '', 'validation' => 'isGenericName', 'required' => true, 'type' => 'radio', 'choices' => array(1 => $this->l('Use PHP mail() function. Recommended; works in most cases'), 2 => $this->l('Set my own SMTP parameters. For advanced users ONLY')), 'js' => array(1 => 'onclick="$(\'#SMTP_CONTAINER\').slideUp();"', 2 => 'onclick="$(\'#SMTP_CONTAINER\').slideDown();"')), + 'PS_MAIL_TYPE' => array('title' => '', 'validation' => 'isGenericName', 'required' => true, 'type' => 'radio', 'choices' => array(1 => $this->l('Send e-mail as HTML'), 2 => $this->l('Send e-mail as Text'), 3 => $this->l('Both'))), + 'SMTP_CONTAINER' => array('title' => '', 'type' => 'container'), + 'PS_MAIL_DOMAIN' => array('title' => $this->l('Mail domain:'), 'desc' => $this->l('Fully qualified domain name (keep it empty if you do not know)'), 'validation' => 'isUrl', 'size' => 30, 'type' => 'text'), + 'PS_MAIL_SERVER' => array('title' => $this->l('SMTP server:'), 'desc' => $this->l('IP or server name (e.g., smtp.mydomain.com)'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text'), + 'PS_MAIL_USER' => array('title' => $this->l('SMTP user:'), 'desc' => $this->l('Leave blank if not applicable'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text'), + 'PS_MAIL_PASSWD' => array('title' => $this->l('SMTP password:'), 'desc' => $this->l('Leave blank if not applicable'), 'validation' => 'isPasswd', 'size' => 30, 'type' => 'password'), + 'PS_MAIL_SMTP_ENCRYPTION' => array('title' => $this->l('Encryption:'), 'desc' => $this->l('Use an encrypt protocol'), 'type' => 'select', 'cast' => 'strval', 'identifier' => 'mode', 'list' => array(array('mode' => 'off', 'name' => $this->l('None')), array('mode' => 'tls', 'name' => $this->l('TLS')), array('mode' => 'ssl', 'name' => $this->l('SSL')))), + 'PS_MAIL_SMTP_PORT' => array('title' => $this->l('Port:'), 'desc' => $this->l('Number of port to use'), 'validation' => 'isInt', 'size' => 5, 'type' => 'text', 'cast' => 'intval'), + 'SMTP_CONTAINER_END' => array('title' => '', 'type' => 'container_end', 'content' => '')); + + parent::__construct(); + } + + public function postProcess() + { + if (isset($_POST['submitEmail'.$this->table])) + { + if ($this->tabAccess['edit'] === '1') + { + if ($_POST['PS_MAIL_METHOD'] == 2 AND (empty($_POST['PS_MAIL_SERVER']) OR empty($_POST['PS_MAIL_SMTP_PORT']))) + $this->_errors[] = Tools::displayError('You must define a SMTP server and a SMTP port. If you do not know, use the PHP mail() function instead.'); + else + $this->_postConfig($this->_fieldsEmail); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + } + + public function display() { + $this->_displayForm('email', $this->_fieldsEmail, $this->l('E-mail'), 'width2', 'email'); + $this->_displayMailTest(); + } + + private function _displayMailTest() + { + echo ' +
+ '.$this->l('Test your e-mail configuration').' + + +
+ +
+
+ + + + + + +
+ +
+
+
'; + } +} diff --git a/admin-dev/tabs/AdminEmployees.php b/admin-dev/tabs/AdminEmployees.php new file mode 100644 index 000000000..aaeb660e1 --- /dev/null +++ b/admin-dev/tabs/AdminEmployees.php @@ -0,0 +1,229 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminEmployees extends AdminTab +{ + /** @var array profiles list */ + private $profilesArray = array(); + + public function __construct() + { + global $cookie; + + $this->table = 'employee'; + $this->className = 'Employee'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + $this->_select = 'pl.`name` AS profile'; + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` + LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)($cookie->id_lang).')'; + + $profiles = Profile::getProfiles((int)($cookie->id_lang)); + if (!$profiles) + $this->_errors[] = Tools::displayError('No profile'); + else + foreach ($profiles AS $profile) + $this->profilesArray[$profile['name']] = $profile['name']; + + $this->fieldsDisplay = array( + 'id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'lastname' => array('title' => $this->l('Last name'), 'width' => 130), + 'firstname' => array('title' => $this->l('First name'), 'width' => 130), + 'email' => array('title' => $this->l('E-mail address'), 'width' => 180), + 'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'select' => $this->profilesArray, 'filter_key' => 'pl!name'), + 'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool')); + + $this->optionTitle = $this->l('Employees options'); + $this->_fieldsOptions = array( + 'PS_PASSWD_TIME_BACK' => array('title' => $this->l('Password regenerate:'), 'desc' => $this->l('Security minimum time to wait to regenerate a new password'), 'cast' => 'intval', 'size' => 5, 'type' => 'text', 'suffix' => ' '.$this->l('minutes')), + 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array('title' => $this->l('Memorize form language:'), 'desc' => $this->l('Allow employees to save their own default form language'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array( + '0' => array('value' => 0, 'name' => $this->l('No')), + '1' => array('value' => 1, 'name' => $this->l('Yes')) + )) + ); + + parent::__construct(); + } + + protected function _childValidation() + { + if (!($obj = $this->loadObject(true))) + return false; + $email = $this->getFieldValue($obj, 'email'); + if (!Validate::isEmail($email)) + $this->_errors[] = Tools::displayError('Invalid e-mail'); + else if (Employee::employeeExists($email) AND !Tools::getValue('id_employee')) + $this->_errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$email; + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $profiles = Profile::getProfiles((int)($cookie->id_lang)); + + echo ' + + + +
+ '.($obj->id ? '' : '').' + '.((int)$this->tabAccess['view'] ? '' : '').' +
'.$this->l('Employees').' + +
+ * +
+ +
+ * +
+ +
+ * +

'.($obj->id ? $this->l('Leave blank if you do not want to change your password') : $this->l('Min. 8 characters; use only letters, numbers or').' -_').'

+
+ +
+ * +
 
+ +
+ +

'.$this->l('Back office background will be displayed in this color. HTML colors only (e.g.,').' "lightblue", "#CC6600")

+
 
+ +
+ * +
 
+ +
+ * +
'; + if ((int)$this->tabAccess['edit']) + { + echo '
 
+ +
+ getFieldValue($obj, 'bo_uimode') == 'hover' ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'bo_uimode') == 'click' ? 'checked="checked" ' : '').'/> + +
 
+ +
+ getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/> + +

'.$this->l('Allow or disallow this employee to log into this Back Office').'

+
+ +
+ * +
'; + } + echo '
 
+
+ +
 
+
* '.$this->l('Required field').'
+
+
'; + } + + public function postProcess() + { + global $cookie; + + if (Tools::isSubmit('deleteemployee') OR Tools::isSubmit('status')) + { + if ($cookie->id_employee == Tools::getValue('id_employee')) + { + $this->_errors[] = Tools::displayError('You cannot disable or delete your own account.'); + return false; + } + + $employee = new Employee(Tools::getValue('id_employee')); + if ($employee->isLastAdmin()) + { + $this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); + return false; + } + + } + elseif (Tools::isSubmit('submitAddemployee')) + { + if ($cookie->id_employee == Tools::getValue('id_employee') && Tools::getvalue('active') == 0) + { + $this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); + return false; + } + + $employee = new Employee(Tools::getValue('id_employee')); + if (!(int)$this->tabAccess['edit']) + $_POST['id_profile'] = $_GET['id_profile'] = $employee->id_profile; + + if ($employee->isLastAdmin()) + { + if (Tools::getValue('id_profile') != (int)(_PS_ADMIN_PROFILE_)) + { + $this->_errors[] = Tools::displayError('You should have at least one employee in the administrator group.'); + return false; + } + + if (Tools::getvalue('active') == 0) + { + $this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); + return false; + } + } + } + + return parent::postProcess(); + } +} + + diff --git a/admin-dev/tabs/AdminFeatures.php b/admin-dev/tabs/AdminFeatures.php new file mode 100644 index 000000000..5c890efeb --- /dev/null +++ b/admin-dev/tabs/AdminFeatures.php @@ -0,0 +1,202 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/tabs/AdminFeaturesValues.php'); + +class AdminFeatures extends AdminTab +{ + public function __construct() + { + $this->adminFeaturesValues = new AdminFeaturesValues(); + $this->table = 'feature'; + $this->className = 'Feature'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'name' => array('title' => $this->l('Name'), 'width' => 128), + 'value' => array('title' => $this->l('Values'), 'width' => 255, 'orderby' => false, 'search' => false)); + + parent::__construct(); + } + + public function display() + { + global $currentIndex; + + if ((isset($_POST['submitAddfeature_value']) AND sizeof($this->adminFeaturesValues->_errors)) + OR isset($_GET['updatefeature_value']) OR isset($_GET['addfeature_value'])) + { + $this->adminFeaturesValues->displayForm($this->token); + echo '

'.$this->l('Back to the features list').'
'; + } + else + parent::display(); + } + + /* Report to AdminTab::displayList() for more details */ + public function displayList() + { + global $currentIndex; + + echo '
+ '.$this->l('Add a new feature').'
+ '.$this->l('Add a new feature value').'

+ '.$this->l('Click on a feature name to view its values and then click again if you want to hide them.').'

'; + + $this->displayListHeader(); + echo ''; + + if (!sizeof($this->_list)) + echo ''.$this->l('No features found.').''; + + $irow = 0; + foreach ($this->_list AS $tr) + { + $id = (int)($tr['id_'.$this->table]); + echo ' + + + '.$tr['name'].' + + + '; + + echo ' + + + '.$this->l('Edit').'  + + '.$this->l('Delete').' + + '; + } + + $this->displayListFooter(); + + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +

'.$this->l('Add a new feature').'

+
+ '.($obj->id ? '' : '').' +
+ '.$this->l('Add a new feature').' + +
'; + foreach ($this->_languages AS $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); + echo ' +
+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + + public function displayErrors() + { + $this->adminFeaturesValues->displayErrors(); + parent::displayErrors(); + } + + public function postProcess() + { + global $cookie, $currentIndex; + $this->adminFeaturesValues->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); + $this->adminFeaturesValues->postProcess($this->token); + + if(Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $object = new $this->className(); + if ($object->deleteSelection($_POST[$this->table.'Box'])) + Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.$this->token); + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + else + parent::postProcess(); + } +} + + diff --git a/admin-dev/tabs/AdminFeaturesValues.php b/admin-dev/tabs/AdminFeaturesValues.php new file mode 100644 index 000000000..a9135ec84 --- /dev/null +++ b/admin-dev/tabs/AdminFeaturesValues.php @@ -0,0 +1,118 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminFeaturesValues extends AdminTab +{ + public function __construct() + { + $this->table = 'feature_value'; + $this->className = 'FeatureValue'; + $this->lang = true; + $this->edit = true; + $this->delete = true; + + parent::__construct(); + } + + /** + * Display form + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo ' +

'.$this->l('Add a new feature value').'

+
+ '.($obj->id ? '' : '').' +
+ '.$this->l('Add a new feature value').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' <>;=#{}  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'value', 'value'); + echo ' +
+
+ +
+ * +
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + + /** + * Manage page processing + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function postProcess($token = NULL) + { + global $currentIndex; + + if(Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.$_POST['groupid'].'Box'])) + { + $object = new $this->className(); + if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box'])) + Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token)); + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + else + parent::postProcess(); + } +} \ No newline at end of file diff --git a/admin-dev/tabs/AdminGenerator.php b/admin-dev/tabs/AdminGenerator.php new file mode 100644 index 000000000..3a334c7fe --- /dev/null +++ b/admin-dev/tabs/AdminGenerator.php @@ -0,0 +1,196 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminGenerator extends AdminTab +{ + public function __construct() + { + $this->_htFile = dirname(__FILE__).'/../../.htaccess'; + $this->_rbFile = dirname(__FILE__).'/../../robots.txt'; + $this->_smFile = dirname(__FILE__).'/../../sitemap.xml'; + $this->_rbData = $this->_getRobotsContent(); + return parent::__construct(); + } + + public function display() + { + global $currentIndex; + + $languages = Language::getLanguages(false); + + // Htaccess + echo ' +
+
'.$this->l('Htaccess file generation').' +

'.$this->l('Warning:').' '.$this->l('this tool can ONLY be used if you are hosted by an Apache web server. Please ask your webhost.').'

+

'.$this->l('This tool will automatically generate a ".htaccess" file that will give you the ability to do URL rewriting and to catch 404 errors.').'

+

'.$this->l('If you do not have "Friendly URL" enabled when generating the ".htaccess" file, this feature won\'t be available.').'

'; + if ($this->_checkConfiguration($this->_htFile)) + echo ' +
 
+ +
+ +

'.$this->l('This will add directives to your .htaccess file which should improve caching and compression.').'

+
+
 
+ +
+ +

'.$this->l('Enable only if your server allows URL rewriting.').'

+
+
 
+ +
+ +

'.$this->l('Add here the specifical directives of your hosting (SetEnv PHP_VER 5, AddType x-mapp-php5 .php...).').'

+
+

'.$this->l('Generate your ".htaccess" file by clicking on the following button:').'

+

+

'.$this->l('This will erase your').' '.$this->l('old').' '.$this->l('.htaccess file!').'

'; + else + echo ' +

'.$this->l('Before being able to use this tool, you need to:').'

+

'.$this->l('- create a').' '. $this->l('.htaccess').' '.$this->l('blank file in directory').' '.__PS_BASE_URI__.' +
'.$this->l('- give it write permissions (CHMOD 666 on Unix system)').'

'; + echo '

'; + + // Robots + echo '

+
+
'.$this->l('Robots file generation').' +

'.$this->l('Warning:').' '.$this->l('Your file robots.txt MUST be in your website\'s root directory and nowhere else.').'

+

'.$this->l('eg: http://www.yoursite.com/robots.txt').'.

+

'.$this->l('This tool will automatically generate a "robots.txt" file that you can configure to deny access to search engines for some pages.').'

'; + if ($this->_checkConfiguration($this->_rbFile)) + echo ' +

'.$this->l('Generate your "robots.txt" file by clicking on the following button:').'

+

+

'.$this->l('This will erase your').' '.$this->l('old').' '.$this->l('robots.txt file!').'

'; + else + echo ' +

'.$this->l('Before being able to use this tool, you need to:').'

+

'.$this->l('- create a').' '. $this->l('robots.txt').' '.$this->l('blank file in dir:').' '.__PS_BASE_URI__.' +
'.$this->l('- give it write permissions (CHMOD 666 on Unix system)').'

'; + echo '

'; + } + + public function _checkConfiguration($file) + { + if (file_exists($file)) + return is_writable($file); + return is_writable(dirname($file)); + } + + function postProcess() + { + global $currentIndex; + + if (Tools::isSubmit('submitHtaccess')) + { + if ($this->tabAccess['edit'] === '1') + { + Configuration::updateValue('PS_HTACCESS_CACHE_CONTROL', (int)Tools::getValue('PS_HTACCESS_CACHE_CONTROL')); + Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS')); + Configuration::updateValue('PS_HTACCESS_SPECIFIC', Tools::getValue('ps_htaccess_specific'), true); + if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Tools::getValue('ps_htaccess_specific'))) + Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); + $this->_errors[] = $this->l('Cannot write into file:').' '.$this->_htFile.'
'.$this->l('Please check write permissions.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + + if (Tools::isSubmit('submitRobots')) + { + if ($this->tabAccess['edit'] === '1') + { + if (!$writeFd = @fopen($this->_rbFile, 'w')) + die ($this->l('Cannot write into file:').' '.$this->_rbFile.'
'.$this->l('Please check write permissions.')); + else + { + // PS Comments + fwrite($writeFd, "# robots.txt automaticaly generated by PrestaShop e-commerce open-source solution\n"); + fwrite($writeFd, "# http://www.prestashop.com - http://www.prestashop.com/forums\n\n"); + fwrite($writeFd, "# This file is to prevent the crawling and indexing of certain parts\n"); + fwrite($writeFd, "# of your site by web crawlers and spiders run by sites like Yahoo!\n"); + fwrite($writeFd, "# and Google. By telling these \"robots\" where not to go on your site,\n"); + fwrite($writeFd, "# you save bandwidth and server resources.\n\n"); + fwrite($writeFd, "# For more information about the robots.txt standard, see:\n"); + fwrite($writeFd, "# http://www.robotstxt.org/wc/robots.html\n\n"); + + // User-Agent + fwrite($writeFd, "User-agent: *\n\n"); + + // Directories + fwrite($writeFd, "# Directories\n"); + foreach ($this->_rbData['Directories'] as $dir) + fwrite($writeFd, 'Disallow: '.__PS_BASE_URI__.$dir."\n"); + fwrite($writeFd, "\n"); + + // Files + fwrite($writeFd, "# Files\n"); + foreach ($this->_rbData['Files'] as $file) + fwrite($writeFd, 'Disallow: '.__PS_BASE_URI__.$file."\n"); + fwrite($writeFd, "\n"); + + // Sitemap + fwrite($writeFd, "# Sitemap\n"); + if (file_exists($this->_smFile)) + if (filesize($this->_smFile)) + fwrite($writeFd, 'Sitemap: '.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].__PS_BASE_URI__.'sitemap.xml'."\n"); + fwrite($writeFd, "\n"); + + fclose($writeFd); + Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); + } + } else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + } + + public function _getRobotsContent() + { + $tab = array(); + + $lang_dir = 'lang-'.Language::getIsoById(Configuration::get('PS_LANG_DEFAULT')).'/'; + + // Directories + $tab['Directories'] = array('classes/', 'config/', 'download/', 'mails/', 'modules/', 'translations/', 'tools/', $lang_dir); + + // Files + $tab['Files'] = array('addresses.php', 'address.php', 'authentication.php', 'cart.php', 'discount.php', 'footer.php', + 'get-file.php', 'header.php', 'history.php', 'identity.php', 'images.inc.php', 'init.php', 'my-account.php', 'order.php', 'order-opc.php', + 'order-slip.php', 'order-detail.php', 'order-follow.php', 'order-return.php', 'order-confirmation.php', 'pagination.php', 'password.php', + 'pdf-invoice.php', 'pdf-order-return.php', 'pdf-order-slip.php', 'product-sort.php', 'search.php', 'statistics.php', + '*orderby=','*orderway=','*p=','*tag=','*id_currency=','*search_query=','*id_lang=','*back=','*utm_source=','*utm_medium=','*utm_campaign=','*n='); + + return $tab; + } +} + + diff --git a/admin-dev/tabs/AdminGeolocation.php b/admin-dev/tabs/AdminGeolocation.php new file mode 100755 index 000000000..1ed09e0f8 --- /dev/null +++ b/admin-dev/tabs/AdminGeolocation.php @@ -0,0 +1,189 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminGeolocation extends AdminTab +{ + public function display() + { + global $currentIndex, $cookie; + + echo ' +

'.$this->l('Geolocation').'

+ '; + + if (!$this->_isGeoLiteCityAvailable()) + $this->displayWarning($this->l('In order to use Geolocation, please download').' '.$this->l('this file').' '.$this->l('and decompress it into tools/geoip/ directory')); + + echo ' +
+
+ '.$this->l('Geolocation by IP').' + + +
+ + +

'.$this->l('This option allows you, among other things, to restrict access to your shop for many countries. See below.').'

+
+ +
+ +
+
+
+ '; + $allowedCountries = explode(';', Configuration::get('PS_ALLOWED_COUNTRIES')); + echo ' +
+
+ '.$this->l('Options').' + +
+ '.$this->l('The following features are only available if you enable the Geolocation by IP feature.').' +
+ + +
+ +
+ +
+ + +
+ +
+ +
+ + +
+ + + + + + + + + '; + foreach (Country::getCountries(intval($cookie->id_lang)) AS $country) + echo ' + + + + + '; + echo ' + +
'.$this->l('Name').'
'.Tools::htmlentitiesUTF8($country['name']).'
+
+ +
+ +
+
+
+ +
+
+ '.$this->l('Whitelist of IP addresses').' + +
+ '.$this->l('You can add many IP addresses, these addresses will always be allowed to access your shop (e.g. Google bots IP).').' +
+ + +
+ +
+ +
+ +
+
+
+ '; + } + + public function postProcess() + { + global $currentIndex; + + if (Tools::isSubmit('submitGeolocationConfiguration')) + { + if ($this->_isGeoLiteCityAvailable()) + { + Configuration::updateValue('PS_GEOLOCATION_ENABLED', intval(Tools::getValue('PS_GEOLOCATION_ENABLED'))); + Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + } + else + $this->_errors[] = Tools::displayError('Geolocation database is unavailable.'); + } + + if (Tools::isSubmit('submitGeolocationCountries')) + { + if (!is_array(Tools::getValue('countries')) OR !sizeof(Tools::getValue('countries'))) + $this->_errors[] = Tools::displayError('Country selection is invalid'); + else + { + Configuration::updateValue('PS_GEOLOCATION_BEHAVIOR', (!(int)(Tools::getValue('PS_GEOLOCATION_BEHAVIOR')) ? _PS_GEOLOCATION_NO_CATALOG_ : _PS_GEOLOCATION_NO_ORDER_)); + Configuration::updateValue('PS_GEOLOCATION_NA_BEHAVIOR', (int)Tools::getValue('PS_GEOLOCATION_NA_BEHAVIOR')); + Configuration::updateValue('PS_ALLOWED_COUNTRIES', implode(';', Tools::getValue('countries'))); + Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + } + } + + if (Tools::isSubmit('submitGeolocationWhitelist')) + { + if (!Validate::isCleanHtml(Tools::getValue('PS_GEOLOCATION_WHITELIST'))) + $this->_errors[] = Tools::displayError('Invalid whitelist'); + else + { + Configuration::updateValue('PS_GEOLOCATION_WHITELIST', str_replace("\n", ';', str_replace("\r", '', Tools::getValue('PS_GEOLOCATION_WHITELIST')))); + Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + } + } + + return parent::postProcess(); + } + + private function _isGeoLiteCityAvailable() + { + if (file_exists(_PS_GEOIP_DIR_.'GeoLiteCity.dat')) + return true; + return false; + } +} + diff --git a/admin-dev/tabs/AdminGroups.php b/admin-dev/tabs/AdminGroups.php new file mode 100644 index 000000000..7ec8e063f --- /dev/null +++ b/admin-dev/tabs/AdminGroups.php @@ -0,0 +1,335 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminGroups extends AdminTab +{ + public function __construct() + { + $this->table = 'group'; + $this->className = 'Group'; + $this->lang = true; + $this->edit = true; + $this->view = true; + $this->delete = true; + + $this->_select = ' + (SELECT COUNT(jcg.`id_customer`) + FROM `'._DB_PREFIX_.'customer_group` jcg + LEFT JOIN `'._DB_PREFIX_.'customer` jc ON (jc.`id_customer` = jcg.`id_customer`) + WHERE jc.`deleted` != 1 + AND jcg.`id_group` = a.`id_group`) AS nb + '; + $this->_group = 'GROUP BY a.id_group'; + $this->_listSkipDelete = array(1); + + $this->fieldsDisplay = array( + 'id_group' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Name'), 'width' => 80, 'filter_key' => 'b!name'), + 'reduction' => array('title' => $this->l('Discount'), 'width' => 50, 'align' => 'right'), + 'nb' => array('title' => $this->l('Members'), 'width' => 25, 'align' => 'center'), + 'date_add' => array('title' => $this->l('Creation date'), 'width' => 60, 'type' => 'date', 'align' => 'right')); + + parent::__construct(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + $groupReductions = $obj->id ? GroupReduction::getGroupReductions($obj->id, (int)($cookie->id_lang)) : array(); + $categories = Category::getSimpleCategories((int)($cookie->id_lang)); + + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Group').' + +
'; + foreach ($this->_languages as $language) + echo ' +
+ * + '.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:  +
'; + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name'); + $reduction = htmlentities($this->getFieldValue($obj, 'reduction'), ENT_COMPAT, 'UTF-8'); + echo ' +
+
 
+ +
+ '.$this->l('%').' +

'.$this->l('Will automatically apply this value as a discount on ALL shop\'s products for this group\'s members.').'

+
'; + if ($obj->id) + { + echo ' + +
'; + if ($groupReductions) + { + echo ' + + + + + '; + foreach ($groupReductions AS $groupReduction) + echo ' + + + + + '; + echo '
'.$this->l('Category').''.$this->l('Value').''.$this->l('Action').'
'.Tools::htmlentitiesUTF8($groupReduction['category_name']).''.$this->l('Delete').'
'; + } + else + echo $this->l('No discount'); + echo '
'; + } + echo ' + +
+ +

'.$this->l('How the prices are displayed on order summary for this customer group (tax included or excluded).').'

+
+
 
+
+ +
+
* '.$this->l('Required field').'
+
+

'; + + if ($obj->id) + { + echo ' +
+ +
'.$this->l('New group discount').' + +
+ * +
+ +
+ * +
+
 
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + } + + public function viewgroup() + { + global $cookie; + + $currentIndex = 'index.php?tab=AdminGroups'; + if (!($obj = $this->loadObject(true))) + return; + $group = new Group((int)($obj->id)); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + + echo ' +
+
+ '.strval($obj->name[(int)($cookie->id_lang)]).' +
 
+ '.$this->l('Discount:').' '.(float)($obj->reduction).$this->l('%').' +
+
 
'; + + $customers = $obj->getCustomers(); + $this->fieldsDisplay = (array( + 'ID' => array('title' => $this->l('ID')), + 'sex' => array('title' => $this->l('Sex')), + 'name' => array('title' => $this->l('Name')), + 'e-mail' => array('title' => $this->l('e-mail')), + 'birthdate' => array('title' => $this->l('Birth date')), + 'register_date' => array('title' => $this->l('Registration date')), + 'orders' => array('title' => $this->l('Orders')), + 'status' => array('title' => $this->l('Status')), + 'actions' => array('title' => $this->l('Actions')) + )); + + if (isset($customers) AND !empty($customers) AND $nbCustomers = sizeof($customers)) + { + echo '

'.$this->l('Customer members of this group').' ('.$nbCustomers.')

+ + '; + foreach ($this->fieldsDisplay AS $field) + echo ''.$field['title'].''; + echo ' + '; + $irow = 0; + foreach ($customers AS $k => $customer) + { + $imgGender = $customer['id_gender'] == 1 ? ''.$this->l('Male').'' : ($customer['id_gender'] == 2 ? ''.$this->l('Female').'' : ''); + echo ' + + + + + + + + + + + '; + } + echo '
'.$customer['id_customer'].''.$imgGender.''.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).''.stripslashes($customer['email']).' '.$this->l('Write to this customer').''.Tools::displayDate($customer['birthday'], (int)($cookie->id_lang)).''.Tools::displayDate($customer['date_add'], (int)($cookie->id_lang)).''.Order::getCustomerNbOrders($customer['id_customer']).' + + '.$this->l('View orders').' + + '.$this->l('Modify this customer').' + + '.$this->l('Delete this customer').' +
'; + } + else + echo '

'.$this->l('No user in this group.').'

'; + } + + public function postProcess() + { + global $currentIndex; + + $token = Tools::getValue('token') ? Tools::getValue('token') : $this->token; + + if (Tools::isSubmit('deleteGroupReduction')) + { + if ($this->tabAccess['delete'] === '1') + { + if (!$id_group_reduction = Tools::getValue('id_group_reduction')) + $this->_errors[] = Tools::displayError('Invalid group reduction ID'); + else + { + $groupReduction = new GroupReduction((int)($id_group_reduction)); + if (!$groupReduction->delete()) + $this->_errors[] = Tools::displayError('An error occurred while deleting the group reduction'); + else + Tools::redirectAdmin($currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=1&token='.$token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + if (Tools::isSubmit('submitAddGroupReduction')) + { + if ($this->tabAccess['add'] === '1') + { + if (!($obj = $this->loadObject())) + return; + $groupReduction = new GroupReduction(); + if (!$id_category = Tools::getValue('id_category') OR !Validate::isUnsignedId($id_category)) + $this->_errors[] = Tools::displayError('Wrong category ID'); + elseif (!$reduction = Tools::getValue('reduction') OR !Validate::isPrice($reduction)) + $this->_errors[] = Tools::displayError('Invalid reduction (must be a percentage)'); + elseif (GroupReduction::doesExist((int)($obj->id), $id_category)) + $this->_errors[] = Tools::displayError('A reduction already exists for this category.'); + else + { + $groupReduction->id_category = (int)($id_category); + $groupReduction->id_group = (int)($obj->id); + $groupReduction->reduction = (float)($reduction) / 100; + if (!$groupReduction->add()) + $this->_errors[] = Tools::displayError('An error occurred while adding a category group reduction.'); + else + Tools::redirectAdmin($currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=3&token='.$this->token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + if (Tools::isSubmit('submitAddgroup')) + { + if ($this->tabAccess['add'] === '1') + { + if (Tools::getValue('reduction') > 100 OR Tools::getValue('reduction') < 0) + $this->_errors[] = Tools::displayError('Reduction value is incorrect'); + else + { + $id_group_reductions = Tools::getValue('gr_id_group_reduction'); + $reductions = Tools::getValue('gr_reduction'); + if ($id_group_reductions) + foreach ($id_group_reductions AS $key => $id_group_reduction) + if (!Validate::isUnsignedId($id_group_reductions[$key]) OR !Validate::isPrice($reductions[$key])) + $this->_errors[] = Tools::displayError(); + else + { + $groupReduction = new GroupReduction((int)($id_group_reductions[$key])); + $groupReduction->reduction = $reductions[$key] / 100; + if (!$groupReduction->update()) + $this->errors[] = Tools::displayError('Cannot update group reductions'); + } + if (!sizeof($this->_errors)) + parent::postProcess(); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + elseif (isset($_GET['delete'.$this->table])) + { + if ($this->tabAccess['delete'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->id == 1) + $this->_errors[] = Tools::displayError('You cannot delete default group.'); + else + { + if ($object->delete()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); + $this->_errors[] = Tools::displayError('An error occurred during deletion.'); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + else + parent::postProcess(); + } +} diff --git a/admin-dev/tabs/AdminHome.php b/admin-dev/tabs/AdminHome.php new file mode 100644 index 000000000..9f11b09a8 --- /dev/null +++ b/admin-dev/tabs/AdminHome.php @@ -0,0 +1,446 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminHome extends AdminTab +{ + public function postProcess() + { + } + + private function _displayOptimizationTips() + { + $rewrite = 0; + if (Configuration::get('PS_REWRITING_SETTINGS')) + { + $rewrite = 2; + if (!file_exists(dirname(__FILE__).'/../../.htaccess')) + $rewrite = 1; + else + { + $stat = stat(dirname(__FILE__).'/../../.htaccess'); + if (strtotime(Db::getInstance()->getValue('SELECT date_upd FROM '._DB_PREFIX_.'configuration WHERE name = "PS_REWRITING_SETTINGS"')) > $stat['mtime']) + $rewrite = 0; + } + } + + $htaccessAfterUpdate = 2; + $htaccessOptimized = (Configuration::get('PS_HTACCESS_CACHE_CONTROL') ? 2 : 0); + if (!file_exists(dirname(__FILE__).'/../.htaccess')) + { + if (Configuration::get('PS_HTACCESS_CACHE_CONTROL')) + $htaccessOptimized = 1; + } + else + { + $stat = stat(dirname(__FILE__).'/../.htaccess'); + $dateUpdHtaccess = Db::getInstance()->getValue('SELECT date_upd FROM '._DB_PREFIX_.'configuration WHERE name = "PS_HTACCESS_CACHE_CONTROL"'); + if (Configuration::get('PS_HTACCESS_CACHE_CONTROL') AND strtotime($dateUpdHtaccess) > $stat['mtime']) + $htaccessOptimized = 1; + + $dateUpdate = Configuration::get('PS_LAST_SHOP_UPDATE'); + if ($dateUpdate AND strtotime($dateUpdate) > $stat['mtime']) + $htaccessAfterUpdate = 0; + } + + $smartyOptimized = 0; + if (!Configuration::get('PS_SMARTY_FORCE_COMPILE')) + ++$smartyOptimized; + if (Configuration::get('PS_SMARTY_CACHE')) + ++$smartyOptimized; + + $cccOptimized = Configuration::get('PS_CSS_THEME_CACHE') + + Configuration::get('PS_JS_THEME_CACHE') + + Configuration::get('PS_HTML_THEME_COMPRESSION') + + Configuration::get('PS_JS_HTML_THEME_COMPRESSION'); + if ($cccOptimized == 4) + $cccOptimized = 2; + else + $cccOptimized = 1; + + $shopEnabled = (Configuration::get('PS_SHOP_ENABLE') ? 2 : 1); + + $lights = array( + 0 => array('image'=>'error2.png','color'=>'#fbe8e8'), + 1 => array('image'=>'warn2.png','color'=>'#fffac6'), + 2 => array('image'=>'ok2.png','color'=>'#dffad3')); + + + if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate != 12) + echo ' +
+
'.$this->l('A good beginning...') + .' + + v':'href="?hideOptimizationTips" > + X + ').'
'; + echo ' + + '; + echo ' +
'; + } + public function display() + { + global $cookie; + + $tab = get_class(); + $protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')?'https':'http'; + $isoDefault = Language::getIsoById(intval(Configuration::get('PS_LANG_DEFAULT'))); + $isoUser = Language::getIsoById(intval($cookie->id_lang)); + $isoCountry = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')); + $currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + echo '
+

'.$this->l('Dashboard').'

+
+
'; + if (@ini_get('allow_url_fopen') AND $update = checkPSVersion()) + echo '

'.$this->l('New PrestaShop version available').' : '.$this->l('Download').' '.$update['name'].' !

'; + elseif (!@ini_get('allow_url_fopen')) + { + echo '

'.$this->l('Update notification unavailable').'

'; + echo '

 

'; + echo '

'.$this->l('To receive PrestaShop update warnings, you need to activate the allow_url_fopen command in your php.ini config file.').' ['.$this->l('more info').']

'; + echo '

'.$this->l('If you don\'t know how to do that, please contact your host administrator !').'


'; + } + echo '
'; + + if (!isset($cookie->show_screencast)) + $cookie->show_screencast = true; + if ($cookie->show_screencast) + echo' +
+ + +
+ +

'; + + + echo ' +
+ + '; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(o.`total_paid_real` / o.conversion_rate) as total_sales, COUNT(*) as total_orders + FROM `'._DB_PREFIX_.'orders` o + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN \''.date('Y-m').'-01 00:00:00\' AND \''.date('Y-m').'-31 23:59:59\' '); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_customer`) AS total_registrations + FROM `'._DB_PREFIX_.'customer` c + WHERE c.`date_add` BETWEEN \''.date('Y-m').'-01 00:00:00\' AND \''.date('Y-m').'-31 23:59:59\''); + $result3 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(pv.`counter`) AS total_viewed + FROM `'._DB_PREFIX_.'page_viewed` pv + LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `'._DB_PREFIX_.'page` p ON pv.`id_page` = p.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type` + WHERE pt.`name` = \'product.php\' + AND dr.`time_start` BETWEEN \''.date('Y-m').'-01 00:00:00\' AND \''.date('Y-m').'-31 23:59:59\' + AND dr.`time_end` BETWEEN \''.date('Y-m').'-01 00:00:00\' AND \''.date('Y-m').'-31 23:59:59\''); + $results = array_merge($result, array_merge($result2, $result3)); + echo ' +
+
'.$this->l('View more').' '.$this->l('Monthly Statistics').'
+ + + + + + + + + + + + + + + + + +
+ '.$this->l('Sales').' + + '.Tools::displayPrice($results['total_sales'], $currency).' +
+ '.$this->l('Total registrations').' + + '.(int)($results['total_registrations']).' +
+ '.$this->l('Total orders').' + + '.(int)($results['total_orders']).' +
+ '.$this->l('Product pages viewed').' + + '.(int)($results['total_viewed']).' +
+
+ '; + $all = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer_thread'); + $unread = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'customer_thread` WHERE `status` = "open"'); + $pending = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'customer_thread` WHERE `status` LIKE "%pending%"'); + $close = $all - ($unread + $pending); + echo ' +
+
'.$this->l('View more').' '.$this->l('Customers service').'
+ + + + + + + + + + + + + + + + + +
+ '.$this->l('Thread unread').' + + '.$unread.' +
+ '.$this->l('Thread pending').' + + '.$pending.' +
+ '.$this->l('Thread closed').' + + '.$close.' +
+ '.$this->l('Total thread').' + + '.$all.' +
+
+ +
+
'.$this->l('View more').' '.$this->l('Statistics').' / '.$this->l('Sales of the week').'
+
'; + + define('PS_BASE_URI', __PS_BASE_URI__); + $chart = new Chart(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT total_paid / conversion_rate as total_converted, invoice_date + FROM '._DB_PREFIX_.'orders o + WHERE valid = 1 + AND invoice_date BETWEEN \''.date('Y-m-d', strtotime('-7 DAYS', time())).' 00:00:00\' AND \''.date('Y-m-d H:i:s').'\''); + foreach ($result as $row) + $chart->getCurve(1)->setPoint(strtotime($row['invoice_date']), $row['total_converted']); + $chart->setSize(580, 170); + $chart->setTimeMode(strtotime('-7 DAYS', time()), time(), 'd'); + $chart->getCurve(1)->setLabel($this->l('Sales +Tx').' ('.strtoupper($currency->iso_code).')'); + $chart->display(); + echo '
+
+ + + + + + + + + + + '; + + $orders = Order::getOrdersWithInformations(10); + $i = 0; + foreach ($orders AS $order) + { + $currency = Currency::getCurrency((int)$order['id_currency']); + echo ' + + + + + + + + '; + $i++; + } + + echo ' + +
'.$this->l('ID').''.$this->l('Customer Name').''.$this->l('Status').''.$this->l('Total').''.$this->l('Action').'
'.(int)$order['id_order'].''.Tools::htmlentitiesUTF8($order['firstname']).' '.Tools::htmlentitiesUTF8($order['lastname']).''.Tools::htmlentitiesUTF8($order['state_name']).''.Tools::displayPrice((float)$order['total_paid'], $currency).' + '.$this->l('See').' +
+ +
'; + + echo ' +
'; + + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $context); + $content = explode('|', $content); + if ($content[0] == 'OK') + { + echo $content[2]; + $content[1] = explode('#%#', $content[1]); + foreach ($content[1] as $partnerPopUp) + if ($partnerPopUp) + { + $partnerPopUp = explode('%%', $partnerPopUp); + if (!Configuration::get('PS_PREACTIVATION_'.strtoupper($partnerPopUp[0]))) + { + echo $partnerPopUp[1]; + Configuration::updateValue('PS_PREACTIVATION_'.strtoupper($partnerPopUp[0]), 'TRUE'); + } + } + } + + if (Tools::isSubmit('hideOptimizationTips')) + Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 1); + + $this->_displayOptimizationTips(); + + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context); + $content = explode('|', $content); + if ($content[0] == 'OK') + echo $content[1]; + else + echo ' + '; + + if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3)) + echo ''; + + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context); + $content = explode('|', $content); + if ($content[0] == 'OK') + echo $content[1]; + + + echo '
+
'; + + echo Module::hookExec('backOfficeHome'); + } +} + + diff --git a/admin-dev/tabs/AdminImageResize.php b/admin-dev/tabs/AdminImageResize.php new file mode 100644 index 000000000..ef4c99230 --- /dev/null +++ b/admin-dev/tabs/AdminImageResize.php @@ -0,0 +1,100 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminImageResize extends AdminTab +{ + public function postProcess() + { + global $currentIndex, $cookie; + + if (isset($_POST['resize'])) + { + $imagesTypes = ImageType::getImagesTypes('products'); + $sourceFile['tmp_name'] = _PS_IMG_DIR_.'/p/'.Tools::getValue('id_product').'-'.Tools::getValue('id_image').'.jpg'; + foreach ($imagesTypes AS $k => $imageType) + if (!imageCut + ($sourceFile, + _PS_IMG_DIR_.'p/'.Tools::getValue('id_product').'-'.Tools::getValue('id_image').'-'.stripslashes($imageType['name']).'.jpg', + $imageType['width'], + $imageType['height'], + 'jpg', + $_POST[$imageType['id_image_type'].'_x1'], + $_POST[$imageType['id_image_type'].'_y1'])) + $this->_errors = Tools::displayError('An error occurred while copying image.').' '.stripslashes($imageType['name']); + // Save and stay on same form + if (Tools::getValue('saveandstay') == 'on') + Tools::redirectAdmin($currentIndex.'&id_product='.Tools::getValue('id_product').'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=1&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); + // Default behavior (save and back) + Tools::redirectAdmin($currentIndex.'&id_category='.(int)(Tools::getValue('id_category')).'&conf='.(int)(Tools::getValue('conf')).'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); + } else + parent::postProcess(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex, $cookie; + parent::displayForm(); + + $imagesTypes = ImageType::getImagesTypes(); + + echo ' + + + + + + +
+ + + + + + +
+ '.$this->l('Image resize').' + '.$this->l('Using your mouse, define which area of the image is to be used for generating each type of thumbnail.').' +

+ + +
+ + +
'; + foreach ($imagesTypes AS $type) + echo ' + + + + '; + echo '
+
'; + } +} \ No newline at end of file diff --git a/admin-dev/tabs/AdminImages.php b/admin-dev/tabs/AdminImages.php new file mode 100644 index 000000000..f52a0fddf --- /dev/null +++ b/admin-dev/tabs/AdminImages.php @@ -0,0 +1,379 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminImages extends AdminTab +{ + private $start_time = 0; + private $max_execution_time = 7200; + + public function __construct() + { + $this->table = 'image_type'; + $this->className = 'ImageType'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_image_type' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Name'), 'width' => 140, 'size' => 16), + 'width' => array('title' => $this->l('Width'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), + 'height' => array('title' => $this->l('Height'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5) + ); + + parent::__construct(); + } + + public function displayList() + { + parent::displayList(); + $this->displayRegenerate(); + } + + public function postProcess() + { + global $currentIndex; + if (Tools::getValue('submitRegenerate'.$this->table)) + { + if ($this->tabAccess['edit'] === '1') + { + if ($this->_regenerateThumbnails(Tools::getValue('type'), Tools::getValue('erase'))) + Tools::redirectAdmin($currentIndex.'&conf=9'.'&token='.$this->token); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + else + parent::postProcess(); + } + + protected function _childValidation() + { + if (!Tools::getValue('id_image_type') AND Validate::isImageTypeName($typeName = Tools::getValue('name')) AND ImageType::typeAlreadyExists($typeName)) + $this->_errors[] = Tools::displayError('This name already exists.'); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + + echo $obj->id ? $this->displayWarning($this->l('After modification, do not forget to regenerate thumbnails')) : ''; + + echo ' +
+ '.($obj->id ? '' : '').' +
+ '.$this->l('Images').'
+ +
+ * +

'.$this->l('Letters only (e.g., small, medium, large, extra-large)').'

+
+ +
+ * +

'.$this->l('Maximum image width in pixels').'

+
+ +
+ * +

'.$this->l('Maximum image height in pixels').'

+
+ +
+ getFieldValue($obj, 'products') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'products') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to product images').'

+
+ +
+ getFieldValue($obj, 'categories') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'categories') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to category images').'

+
+ +
+ getFieldValue($obj, 'manufacturers') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'manufacturers') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to manufacturer images').'

+
+ +
+ getFieldValue($obj, 'suppliers') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'suppliers') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to suppliers images').'

+
+ +
+ getFieldValue($obj, 'scenes') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'scenes') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to scenes images').'

+
+ +
+ getFieldValue($obj, 'stores') ? 'checked="checked" ' : '').'/> + + getFieldValue($obj, 'stores') ? 'checked="checked" ' : '').'/> + +

'.$this->l('This type will be applied to stores images').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + + /** + * Display form for thumbnails regeneration + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayRegenerate() + { + global $currentIndex; + + $types = array( + 'categories' => $this->l('Categories'), + 'manufacturers' => $this->l('Manufacturers'), + 'suppliers' => $this->l('Suppliers'), + 'scenes' => $this->l('Scenes'), + 'products' => $this->l('Products'), + 'stores' => $this->l('Stores') + ); + echo ' +

'.$this->l('Regenerate thumbnails').'

+ '.$this->l('Regenerates thumbnails for all existing product images').'.

'; + $this->displayWarning($this->l('Please be patient, as this can take several minutes').'
'.$this->l('Be careful! Manually generated thumbnails will be erased by automatically generated thumbnails.')); + echo ' +
+
+ '.$this->l('Regenerate thumbnails').'
+ +
+ +
'; + + foreach ($types AS $k => $type) + { + $formats = ImageType::getImagesTypes($k); + echo ' + + '; + } + echo ' + + +
+ +

'.$this->l('Uncheck this checkbox only if your server timed out and you need to resume the regeneration.').'

+
+
+
+
+
'; + } + + /** + * Delete resized image then regenerate new one with updated settings + */ + private function _deleteOldImages($dir, $type, $product = false) + { + $toDel = scandir($dir); + foreach ($toDel AS $d) + foreach ($type AS $imageType) + if (preg_match('/^[0-9]+\-'.($product ? '[0-9]+\-' : '').$imageType['name'].'\.jpg$/', $d) OR preg_match('/^([[:lower:]]{2})\-default\-(.*)\.jpg$/', $d)) + if (file_exists($dir.$d)) + unlink($dir.$d); + } + + // Regenerate images + private function _regenerateNewImages($dir, $type, $productsImages = false) + { + $errors = false; + $toRegen = scandir($dir); + if (!$productsImages) + { + foreach ($toRegen AS $image) + if (preg_match('/^[0-9]*\.jpg$/', $image)) + foreach ($type AS $k => $imageType) + { + // Customizable writing dir + $newDir = $dir; + if ($imageType['name'] == 'thumb_scene') + $newDir .= 'thumbs/'; + if (!file_exists($newDir)) + continue; + if (!file_exists($newDir.substr($image, 0, -4).'-'.stripslashes($imageType['name']).'.jpg')) + if (!imageResize($dir.$image, $newDir.substr($image, 0, -4).'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height']))) + $errors = true; + if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server + return 'timeout'; + } + } + else + { + $productsImages = Image::getAllImages(); + foreach ($productsImages AS $k => $image) + if (file_exists($dir.$image['id_product'].'-'.$image['id_image'].'.jpg')) + foreach ($type AS $k => $imageType) + { + if (!file_exists($dir.$image['id_product'].'-'.$image['id_image'].'-'.stripslashes($imageType['name']).'.jpg')) + if (!imageResize($dir.$image['id_product'].'-'.$image['id_image'].'.jpg', $dir.$image['id_product'].'-'.$image['id_image'].'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height']))) + $errors = true; + if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server + return 'timeout'; + } + } + return $errors; + } + + // Regenerate no-pictures images + private function _regenerateNoPictureImages($dir, $type, $languages) + { + $errors = false; + foreach ($type AS $k => $imageType) + foreach ($languages AS $language) + { + $file = $dir.$language['iso_code'].'.jpg'; + if (!file_exists($file)) + $file = _PS_PROD_IMG_DIR_.Language::getIsoById((int)(Configuration::get('PS_LANG_DEFAULT'))).'.jpg'; + if (!file_exists($dir.$language['iso_code'].'-default-'.stripslashes($imageType['name']).'.jpg')) + if (!imageResize($file, $dir.$language['iso_code'].'-default-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height']))) + $errors = true; + } + return $errors; + } + + // Hook watermark optimization + private function _regenerateWatermark($dir) + { + $result = Db::getInstance()->ExecuteS(' + SELECT m.`name` FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + WHERE h.`name` = \'watermark\' AND m.`active` = 1'); + + if ($result AND sizeof($result)) + { + $productsImages = Image::getAllImages(); + foreach ($productsImages AS $k => $image) + if (file_exists($dir.$image['id_product'].'-'.$image['id_image'].'.jpg')) + foreach ($result AS $k => $module) + { + if ($moduleInstance = Module::getInstanceByName($module['name']) AND is_callable(array($moduleInstance, 'hookwatermark'))) + call_user_func(array($moduleInstance, 'hookwatermark'), array('id_image' => $image['id_image'], 'id_product' => $image['id_product'])); + if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server + return 'timeout'; + } + } + } + + private function _regenerateThumbnails($type = 'all', $deleteOldImages = false) + { + $this->start_time = time(); + ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value + $this->max_execution_time = (int)ini_get('max_execution_time'); + $languages = Language::getLanguages(false); + + $process = + array( + array('type' => 'categories', 'dir' => _PS_CAT_IMG_DIR_), + array('type' => 'manufacturers', 'dir' => _PS_MANU_IMG_DIR_), + array('type' => 'suppliers', 'dir' => _PS_SUPP_IMG_DIR_), + array('type' => 'scenes', 'dir' => _PS_SCENE_IMG_DIR_), + array('type' => 'products', 'dir' => _PS_PROD_IMG_DIR_), + array('type' => 'stores', 'dir' => _PS_STORE_IMG_DIR_) + ); + + // Launching generation process + foreach ($process AS $k => $proc) + { + if ($type != 'all' && $type != $proc['type']) + continue ; + + // Getting format generation + $formats = ImageType::getImagesTypes($proc['type']); + if ($type != 'all') + { + $format = strval(Tools::getValue('format_'.$type)); + if ($format != 'all') + foreach ($formats AS $k => $form) + if ($form['id_image_type'] != $format) + unset($formats[$k]); + } + + if ($deleteOldImages) + $this->_deleteOldImages($proc['dir'], $formats, ($proc['type'] == 'products' ? true : false)); + if (($return = $this->_regenerateNewImages($proc['dir'], $formats, ($proc['type'] == 'products' ? true : false))) === true) + $this->_errors[] = Tools::displayError('Cannot write ').$proc['type'].Tools::displayError(' images. Please check the folder\'s writing permissions.'); + elseif ($return == 'timeout') + $this->_errors[] = Tools::displayError('Only part of the images have been regenerated, server timed out before finishing.'); + else + { + if ($proc['type'] == 'products') + if ($this->_regenerateWatermark($proc['dir']) == 'timeout') + $this->_errors[] = Tools::displayError('Server timed out, the watermark may not have been applied on all your images.'); + if (!count($this->_errors)) + if ($this->_regenerateNoPictureImages($proc['dir'], $formats, $languages)) + $this->_errors[] = Tools::displayError('Cannot write no-picture image to').' ('.$proc['type'].') '.Tools::displayError('images folder. Please check the folder\'s writing permissions.'); + } + } + return (sizeof($this->_errors) > 0 ? false : true); + } +} diff --git a/admin-dev/tabs/AdminImport.php b/admin-dev/tabs/AdminImport.php new file mode 100644 index 000000000..e6993a04f --- /dev/null +++ b/admin-dev/tabs/AdminImport.php @@ -0,0 +1,1579 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(PS_ADMIN_DIR.'/../images.inc.php'); +@ini_set('max_execution_time', 0); +define('MAX_LINE_SIZE', 4096); + +define('UNFRIENDLY_ERROR', false); // Used for validatefields diying without user friendly error or not + +// this value set the number of columns visible on each page +define('MAX_COLUMNS', 6); +// correct Mac error on eof +@ini_set('auto_detect_line_endings', '1'); + +class AdminImport extends AdminTab +{ + public static $column_mask; + + public $entities = array(); + + public $available_fields = array(); + + public static $required_fields = array('name'); + + public static $default_values = array(); + + public $_warnings = array(); + + public static $validators = array( + 'active' => array('AdminImport', 'getBoolean'), + 'tax_rate' => array('AdminImport', 'getPrice'), + 'price_tex' => array('AdminImport', 'getPrice'), // Tax excluded + 'price_tin' => array('AdminImport', 'getPrice'), // Tax included + 'reduction_price' => array('AdminImport', 'getPrice'), + 'reduction_percent' => array('AdminImport', 'getPrice'), + 'wholesale_price' => array('AdminImport', 'getPrice'), + 'ecotax' => array('AdminImport', 'getPrice'), + 'name' => array('AdminImport', 'createMultiLangField'), + 'description' => array('AdminImport', 'createMultiLangField'), + 'description_short' => array('AdminImport', 'createMultiLangField'), + 'meta_title' => array('AdminImport', 'createMultiLangField'), + 'meta_keywords' => array('AdminImport', 'createMultiLangField'), + 'meta_description' => array('AdminImport', 'createMultiLangField'), + 'link_rewrite' => array('AdminImport', 'createMultiLangField'), + 'available_now' => array('AdminImport', 'createMultiLangField'), + 'available_later' => array('AdminImport', 'createMultiLangField'), + 'category' => array('AdminImport', 'split'), + 'online_only' => array('AdminImport', 'getBoolean') + ); + + public function __construct() + { + $this->entities = array_flip(array($this->l('Categories'), $this->l('Products'), $this->l('Combinations'), $this->l('Customers'), $this->l('Addresses'), $this->l('Manufacturers'), $this->l('Suppliers'))); + + switch ((int)(Tools::getValue('entity'))) + { + case $this->entities[$this->l('Combinations')]: + + self::$required_fields = array('id_product', 'options'); + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id_product' => $this->l('Product ID').'*', + 'options' => $this->l('Options (Group:Value)').'*', + 'reference' => $this->l('Reference'), + 'supplier_reference' => $this->l('Supplier reference'), + 'ean13' => $this->l('EAN13'), + 'upc' => $this->l('UPC'), + 'wholesale_price' => $this->l('Wholesale price'), + 'price' => $this->l('Price'), + 'ecotax' => $this->l('Ecotax'), + 'quantity' => $this->l('Quantity'), + 'weight' => $this->l('Weight'), + 'default_on' => $this->l('Default') + ); + + self::$default_values = array( + 'reference' => '', + 'supplier_reference' => '', + 'ean13' => '', + 'upc' => '', + 'wholesale_price' => 0, + 'price' => 0, + 'ecotax' => 0, + 'quantity' => 0, + 'weight' => 0, + 'default_on' => 0 + ); + + break; + + case $this->entities[$this->l('Categories')]: + + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id' => $this->l('ID'), + 'active' => $this->l('Active (0/1)'), + 'name' => $this->l('Name *'), + 'parent' => $this->l('Parent category'), + 'description' => $this->l('Description'), + 'meta_title' => $this->l('Meta-title'), + 'meta_keywords' => $this->l('Meta-keywords'), + 'meta_description' => $this->l('Meta-description'), + 'link_rewrite' => $this->l('URL rewritten'), + 'image' => $this->l('Image URL')); + + self::$default_values = array('active' => '1', 'parent' => '1', 'link_rewrite' => ''); + + break; + + case $this->entities[$this->l('Products')]: + + self::$validators['image'] = array('AdminImport', 'split'); + + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id' => $this->l('ID'), + 'active' => $this->l('Active (0/1)'), + 'name' => $this->l('Name *'), + 'category' => $this->l('Categories (x,y,z...)'), + 'price_tex' => $this->l('Price tax excl.'), + 'price_tin' => $this->l('Price tax incl.'), + 'id_tax_rules_group' => $this->l('Tax rules id'), + 'wholesale_price' => $this->l('Wholesale price'), + 'on_sale' => $this->l('On sale (0/1)'), + 'reduction_price' => $this->l('Discount amount'), + 'reduction_percent' => $this->l('Discount percent'), + 'reduction_from' => $this->l('Discount from (yyyy-mm-dd)'), + 'reduction_to' => $this->l('Discount to (yyyy-mm-dd)'), + 'reference' => $this->l('Reference #'), + 'supplier_reference' => $this->l('Supplier reference #'), + 'supplier' => $this->l('Supplier'), + 'manufacturer' => $this->l('Manufacturer'), + 'ean13' => $this->l('EAN13'), + 'upc' => $this->l('UPC'), + 'ecotax' => $this->l('Ecotax'), + 'weight' => $this->l('Weight'), + 'quantity' => $this->l('Quantity'), + 'description_short' => $this->l('Short description'), + 'description' => $this->l('Description'), + 'tags' => $this->l('Tags (x,y,z...)'), + 'meta_title' => $this->l('Meta-title'), + 'meta_keywords' => $this->l('Meta-keywords'), + 'meta_description' => $this->l('Meta-description'), + 'link_rewrite' => $this->l('URL rewritten'), + 'available_now' => $this->l('Text when in-stock'), + 'available_later' => $this->l('Text if back-order allowed'), + 'image' => $this->l('Image URLs (x,y,z...)'), + 'feature' => $this->l('Feature'), + 'online_only' => $this->l('Only available online')); + + self::$default_values = array( + 'id_category' => array(1), + 'id_category_default' => 1, + 'active' => '1', + 'quantity' => 0, + 'price' => 0, + 'id_tax_rules_group' => 0, + 'description_short' => array((int)(Configuration::get('PS_LANG_DEFAULT')) => ''), + 'link_rewrite' => array((int)(Configuration::get('PS_LANG_DEFAULT')) => ''), + 'online_only' => 0); + + break; + + case $this->entities[$this->l('Customers')]: + + //Overwrite required_fields AS only email is required whereas other entities + self::$required_fields = array('email', 'passwd', 'lastname', 'firstname'); + + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id' => $this->l('ID'), + 'active' => $this->l('Active (0/1)'), + 'id_gender' => $this->l('Gender ID (Mr = 1, Ms = 2, else 9)'), + 'email' => $this->l('E-mail *'), + 'passwd' => $this->l('Password *'), + 'birthday' => $this->l('Birthday (yyyy-mm-dd)'), + 'lastname' => $this->l('Lastname *'), + 'firstname' => $this->l('Firstname *'), + 'newsletter' => $this->l('Newsletter (0/1)'), + 'optin' => $this->l('Opt in (0/1)')); + + self::$default_values = array('active' => '1'); + + break; + case $this->entities[$this->l('Addresses')]: + + //Overwrite required_fields + self::$required_fields = array('lastname', 'firstname', 'address1', 'postcode', 'country', 'city'); + + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id' => $this->l('ID'), + 'alias' => $this->l('Alias *'), + 'active' => $this->l('Active (0/1)'), + 'customer_email' => $this->l('Customer e-mail'), + 'manufacturer' => $this->l('Manufacturer'), + 'supplier' => $this->l('Supplier'), + 'company' => $this->l('Company'), + 'lastname' => $this->l('Lastname *'), + 'firstname' => $this->l('Firstname *'), + 'address1' => $this->l('Address 1 *'), + 'address2' => $this->l('Address 2'), + 'postcode' => $this->l('Postcode*/ Zipcode*'), + 'city' => $this->l('City *'), + 'country' => $this->l('Country *'), + 'state' => $this->l('State'), + 'other' => $this->l('Other'), + 'phone' => $this->l('Phone'), + 'phone_mobile' => $this->l('Mobile Phone'), + 'vat_number' => $this->l('VAT number')); + + self::$default_values = array('alias' => 'Alias', 'postcode' => 'X'); + + break; + case $this->entities[$this->l('Manufacturers')]: + case $this->entities[$this->l('Suppliers')]: + + //Overwrite validators AS name is not MultiLangField + self::$validators = array( + 'description' => array('AdminImport', 'createMultiLangField'), + 'description_short' => array('AdminImport', 'createMultiLangField'), + 'meta_title' => array('AdminImport', 'createMultiLangField'), + 'meta_keywords' => array('AdminImport', 'createMultiLangField'), + 'meta_description' => array('AdminImport', 'createMultiLangField')); + + $this->available_fields = array( + 'no' => $this->l('Ignore this column'), + 'id' => $this->l('ID'), + 'active' => $this->l('Active (0/1)'), + 'name' => $this->l('Name *'), + 'description' => $this->l('Description'), + 'short_description' => $this->l('Short description'), + 'meta_title' => $this->l('Meta-title'), + 'meta_keywords' => $this->l('Meta-keywords'), + 'meta_description' => $this->l('Meta-description')); + break; + } + parent::__construct(); + } + + private static function getBoolean($field) + { + return (boolean)$field; + } + + private static function getPrice($field) + { + $field = ((float)(str_replace(',', '.', $field))); + $field = ((float)(str_replace('%', '', $field))); + return $field; + } + + private static function split($field) + { + $separator = ((is_null(Tools::getValue('multiple_value_separator')) OR trim(Tools::getValue('multiple_value_separator')) == '' ) ? ',' : Tools::getValue('multiple_value_separator')); + $tab = explode($separator, $field); + $res = array_map('strval', $tab); + $res = array_map('trim', $tab); + return $tab; + } + + private static function createMultiLangField($field) + { + $languages = Language::getLanguages(false); + $res = array(); + foreach ($languages AS $lang) + $res[$lang['id_lang']] = $field; + return $res; + } + + private function getTypeValuesOptions($nb_c) + { + $i = 0; + $noPreSelect = array('price_tin', 'feature'); + + $options = ''; + foreach ($this->available_fields AS $k => $field) + { + $options .= '
+ +
'; + echo '
+
+ + '.$this->l('Import a language pack manually').' + + +
+
+

+
+
'.$this->l('Export a language').' +

'.$this->l('Export data from one language to a file (language pack).').'
'. + $this->l('Choose the theme from which you want to export translations.').'
+ +     +    + +

+
+

'; + $allLanguages = Language::getLanguages(false); + echo ' +
+
'.$this->l('Copy').' +

'.$this->l('Copies data from one language to another.').'
'. + $this->l('Be careful, as it will replace all existing data for the destination language!').'
'. + $this->l('If necessary').', '.$this->l('first create a new language').'.

+
+

+

'.$this->l('From:').'
+ +     + * +

+

+

'.$this->l('To:').'
+ +     + +

+
+
+ +
+

* '.$this->l('Language files (as indicated at Tools >> Languages >> Edition) must be complete to allow copying of translations').'

+
+
'; + } + } + + public function fileExists($dir, $file, $var) + { + ${$var} = array(); + if (!file_exists($dir)) + if (!mkdir($dir, 0700)) + die('Please create the directory '.$dir); + if (!file_exists($dir.'/'.$file)) + if (!file_put_contents($dir.'/'.$file, "")) + die('Please create a "'.$file.'" file in '.$dir); + if (!is_writable($dir.'/'.$file)) + $this->displayWarning(Tools::displayError('This file must be writable:').' '.$dir.'/'.$file); + include($dir.'/'.$file); + return ${$var}; + } + + public function displayToggleButton($closed = false) + { + $str_output = ' + + + '; + return $str_output; + } + + protected function displaySubmitButtons($name) + { + return ' + + '; + } + + public function displayAutoTranslate() + { + $languageCode = Tools::htmlentitiesUTF8(Language::getLanguageCodeByIso(Tools::getValue('lang'))); + return ' + + + + + '; + } + + public function displayLimitPostWarning($count) + { + $str_output = ''; + if ((ini_get('suhosin.post.max_vars') AND ini_get('suhosin.post.max_vars') < $count) + OR (ini_get('suhosin.request.max_vars') AND ini_get('suhosin.request.max_vars') < $count)) + { + if (ini_get('suhosin.post.max_vars') < $count OR ini_get('suhosin.request.max_vars') < $count) + { + $this->suhosin_limit_exceed = true; + $str_output .= '
'.$this->l('Warning, your hosting provider is using the suhosin patch for PHP, which limit the maximum number of fields to post in a form :').'
' + .''.ini_get('suhosin.post.max_vars').' '.$this->l('for suhosin.post.max_vars.').'
' + .''.ini_get('suhosin.request.max_vars').' '.$this->l('for suhosin.request.max_vars.').'
' + .$this->l('Please ask your hosting provider to increase the suhosin post and request limit to') + .' '.((int)$count + 100).' '.$this->l('at least.').' '.$this->l('or edit the translation file manually.').'
'; + } + } + return $str_output; + } + + public function displayFormFront($lang) + { + global $currentIndex; + $_LANG = $this->fileExists(_PS_THEME_DIR_.'lang', Tools::strtolower($lang).'.php', '_LANG'); + $str_output = ''; + + /* List templates to parse */ + $templates = array_merge(scandir(_PS_THEME_DIR_), scandir(_PS_ALL_THEMES_DIR_)); + $count = 0; + $files = array(); + foreach ($templates AS $template) + if (preg_match('/^(.*).tpl$/', $template) AND (file_exists($tpl = _PS_THEME_DIR_.$template) OR file_exists($tpl = _PS_ALL_THEMES_DIR_.$template))) + { + $template2 = substr(basename($template), 0, -4); + $newLang = array(); + $fd = fopen($tpl, 'r'); + $content = fread($fd, filesize($tpl)); + + /* Search language tags (eg {l s='to translate'}) */ + $regex = '/\{l s=\''._PS_TRANS_PATTERN_.'\'( js=1)?\}/U'; + preg_match_all($regex, $content, $matches); + + /* Get string translation */ + foreach($matches[1] AS $key) + { + if(empty($key)) + { + $this->_errors[] = $this->l('Empty string found, please edit:').'
'._PS_THEME_DIR_.''.$template; + $newLang[$key] = ''; + } + else + { + $key2 = $template2.'_'.md5($key); + $newLang[$key] = (key_exists($key2, $_LANG)) ? html_entity_decode($_LANG[$key2], ENT_COMPAT, 'UTF-8') : ''; + } + } + $files[$template2] = $newLang; + $count += sizeof($newLang); + } + + $str_output .= ' +

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('Front-Office translations').'

+ '.$this->l('Total expressions').' : '.$count.'. '.$this->l('Click the fieldset title to expand or close the fieldset.').'.

'; + $str_output .= $this->displayLimitPostWarning($count); + if (!$this->suhosin_limit_exceed) + { + $str_output .= ' +
'; + $str_output .= $this->displayToggleButton(sizeof($_LANG) >= $count); + $str_output .= $this->displayAutoTranslate(); + $str_output .= '

'; + foreach ($files AS $k => $newLang) + if (sizeof($newLang)) + { + $countValues = array_count_values($newLang); + $empty = isset($countValues['']) ? $countValues[''] : 0; + $str_output .= ' +
'.$k.' - '.sizeof($newLang).' '.$this->l('expressions').' ('.$empty.') +
+ '; + foreach ($newLang AS $key => $value) + { + $str_output .= ''; + } + $str_output .= ' +
'.stripslashes($key).''; + if (strlen($key) != 0 && strlen($key) < TEXTAREA_SIZED) + $str_output .= '= '; + elseif(strlen($key)) + $str_output .= '= '; + else + $str_output .= ''.implode(', ', $this->_errors).''; + $str_output .= '
+
+

'; + } + $str_output .= '
'; + } + if (!empty($this->_errors)) + $this->displayErrors(); + echo $str_output; + } + + public function displayFormBack($lang) + { + global $currentIndex; + $_LANGADM = $this->fileExists(_PS_TRANSLATIONS_DIR_.$lang, 'admin.php', '_LANGADM'); + $str_output = ''; + /* List templates to parse */ + $count = 0; + $tabs = scandir(PS_ADMIN_DIR.'/tabs'); + $tabs[] = '../../classes/AdminTab.php'; + $files = array(); + foreach ($tabs AS $tab) + if (preg_match('/^(.*)\.php$/', $tab) AND file_exists($tpl = PS_ADMIN_DIR.'/tabs/'.$tab)) + { + $tab = basename(substr($tab, 0, -4)); + $fd = fopen($tpl, 'r'); + $content = fread($fd, filesize($tpl)); + fclose($fd); + $regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U'; + preg_match_all($regex, $content, $matches); + foreach ($matches[1] AS $key) + $tabsArray[$tab][$key] = stripslashes(key_exists($tab.md5($key), $_LANGADM) ? html_entity_decode($_LANGADM[$tab.md5($key)], ENT_COMPAT, 'UTF-8') : ''); + $count += isset($tabsArray[$tab]) ? sizeof($tabsArray[$tab]) : 0; + } + foreach (array('header.inc', 'footer.inc', 'index', 'login', 'password', 'functions') AS $tab) + { + $tab = PS_ADMIN_DIR.'/'.$tab.'.php'; + $fd = fopen($tab, 'r'); + $content = fread($fd, filesize($tab)); + fclose($fd); + $regex = '/translate\(\''._PS_TRANS_PATTERN_.'\'\)/U'; + preg_match_all($regex, $content, $matches); + foreach ($matches[1] AS $key) + $tabsArray['index'][$key] = stripslashes(key_exists('index'.md5($key), $_LANGADM) ? html_entity_decode($_LANGADM['index'.md5($key)], ENT_COMPAT, 'UTF-8') : ''); + $count += isset($tabsArray['index']) ? sizeof($tabsArray['index']) : 0; + } + + $str_output .= ' +

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('Back-Office translations').'

+ '.$this->l('Expressions to translate').' : '.$count.'. '.$this->l('Click on the titles to open fieldsets').'.

'; + $str_output .= $this->displayLimitPostWarning($count); + if (!$this->suhosin_limit_exceed) + { + $str_output .= ' +
'; + $str_output .= $this->displayToggleButton(); + $str_output .= $this->displayAutoTranslate(); + $str_output .= '

'; + foreach ($tabsArray AS $k => $newLang) + if (sizeof($newLang)) + { + $countValues = array_count_values($newLang); + $empty = isset($countValues['']) ? $countValues[''] : 0; + $str_output .= ' +
'.$k.' - '.sizeof($newLang).' '.$this->l('expressions').' ('.$empty.') +
+ '; + foreach ($newLang AS $key => $value) + { + $str_output .= ''; + else + $str_output .= ''; + } + $str_output .= ' +
'.stripslashes($key).'= '; + if (strlen($key) < TEXTAREA_SIZED) + $str_output .= '
+
+

'; + } + $str_output .= '
'; + } + echo $str_output; + } + + public function displayFormErrors($lang) + { + global $currentIndex; + $_ERRORS = $this->fileExists(_PS_TRANSLATIONS_DIR_.$lang, 'errors.php', '_ERRORS'); + + $str_output = ''; + + /* List files to parse */ + $stringToTranslate = array(); + $dirToParse = array(PS_ADMIN_DIR.'/../', + PS_ADMIN_DIR.'/../classes/', + PS_ADMIN_DIR.'/../controllers/', + PS_ADMIN_DIR.'/../override/classes/', + PS_ADMIN_DIR.'/../override/controllers/', + PS_ADMIN_DIR.'/', + PS_ADMIN_DIR.'/tabs/'); + if (!file_exists(_PS_MODULE_DIR_)) + die($this->displayWarning(Tools::displayError('Fatal error: Module directory is not here anymore ').'('._PS_MODULE_DIR_.')')); + if (!is_writable(_PS_MODULE_DIR_)) + $this->displayWarning(Tools::displayError('The module directory must be writable')); + if (!$modules = scandir(_PS_MODULE_DIR_)) + $this->displayWarning(Tools::displayError('There are no modules in your copy of PrestaShop. Use the Modules tab to activate them or go to our Website to download additional Modules.')); + else + { + $count = 0; + + foreach ($modules AS $module) + if (is_dir(_PS_MODULE_DIR_.$module) && $module != '.' && $module != '..' && $module != '.svn' ) + $dirToParse[] = _PS_MODULE_DIR_.$module.'/'; + } + foreach ($dirToParse AS $dir) + foreach (scandir($dir) AS $file) + if (preg_match('/.php$/', $file) AND file_exists($fn = $dir.$file) AND $file != 'index.php') + { + if (!filesize($fn)) + continue; + preg_match_all('/Tools::displayError\(\''._PS_TRANS_PATTERN_.'\'(, (true|false))?\)/U', fread(fopen($fn, 'r'), filesize($fn)), $matches); + foreach($matches[1] AS $key) + $stringToTranslate[$key] = (key_exists(md5($key), $_ERRORS)) ? html_entity_decode($_ERRORS[md5($key)], ENT_COMPAT, 'UTF-8') : ''; + } + $irow = 0; + $str_output .= $this->displayAutoTranslate(); + $str_output .= '

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('Errors translations').'

' + .$this->l('Errors to translate').' : '.sizeof($stringToTranslate).'

'; + $str_output .= $this->displayLimitPostWarning(sizeof($stringToTranslate)); + if (!$this->suhosin_limit_exceed) + { + $str_output .= ' +
+

+ '; + ksort($stringToTranslate); + foreach ($stringToTranslate AS $key => $value) + $str_output .= ''; + $str_output .= '
'.stripslashes($key).'=

'; + } + echo $str_output; + } + + public function displayFormFields($lang) + { + global $currentIndex; + $_FIELDS = $this->fileExists(_PS_TRANSLATIONS_DIR_.$lang, 'fields.php', '_FIELDS'); + + $str_output = ''; + $classArray = array(); + $count = 0; + foreach (scandir(_PS_CLASS_DIR_) AS $classFile) + { + if (!preg_match('/\.php$/', $classFile) OR $classFile == 'index.php') + continue; + include_once(_PS_CLASS_DIR_.$classFile); + $className = substr($classFile, 0, -4); + if (!class_exists($className)) + continue; + if (!is_subclass_of($className, 'ObjectModel')) + continue; + $classArray[$className] = call_user_func(array($className, 'getValidationRules'), $className); + if (isset($classArray[$className]['validate'])) + $count += sizeof($classArray[$className]['validate']); + if (isset($classArray[$className]['validateLang'])) + $count += sizeof($classArray[$className]['validateLang']); + } + + $str_output .= $this->displayAutoTranslate(); + $str_output .= ' +

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('Fields translations').'

'; + $str_output .= $this->displayLimitPostWarning($count); + if (!$this->suhosin_limit_exceed) + { + $str_output .= $this->l('Fields to translate').' : '.$count.'. '.$this->l('Click on the titles to open fieldsets').'.

+
'; + $str_output .= $this->displayToggleButton(); + $str_output .= '

'; + foreach ($classArray AS $className => $rules) + { + $translated = 0; + $toTranslate = 0; + if (isset($rules['validate'])) + foreach ($rules['validate'] AS $key => $value) + (array_key_exists($className.'_'.md5($key), $_FIELDS)) ? ++$translated : ++$toTranslate; + if (isset($rules['validateLang'])) + foreach ($rules['validateLang'] AS $key => $value) + (array_key_exists($className.'_'.md5($key), $_FIELDS)) ? ++$translated : ++$toTranslate; + $str_output .= ' +
'.$className.' - '.($toTranslate + $translated).' '.$this->l('fields').' ('.$toTranslate.') +
+ '; + if (isset($rules['validate'])) + foreach ($rules['validate'] AS $key => $value) + $str_output .= ''; + if (isset($rules['validateLang'])) + foreach ($rules['validateLang'] AS $key => $value) + $str_output .= ''; + $str_output .= ' +
'.stripslashes($key).'=
'.stripslashes($key).'=
+
+

'; + } + $str_output .= '
'; + } + echo $str_output; + } + + /** + * Get each informations for each mails founded in the folder $dir. + * + * @since 1.4.0.14 + * @param string $dir + * @param string $lang + * @param $string $group_name + */ + public function getMailFiles($dir, $lang, $group_name = 'mail') + { + $arr_return = array(); + + // Very usefull to name input and textarea fields + $arr_return['group_name'] = $group_name; + $arr_return['empty_values'] = 0; + $arr_return['total_filled'] = 0; + $arr_return['directory'] = $dir; +// $arr_return['subject'] = $this->getSubjectMailContent($dir.$lang); + if(file_exists($dir.'en')) + { + // Get all english files to compare with the language to translate + foreach (scandir($dir.'en') AS $email_file) + { + if (strripos($email_file, '.html') > 0 || strripos($email_file, '.txt') > 0) + { + $email_name = substr($email_file, 0, strripos($email_file, '.')); + $type = substr($email_file, strripos($email_file, '.')+1); + if (!isset($arr_return['files'][$email_name])) { + $arr_return['files'][$email_name] = array(); + } + $arr_return['files'][$email_name][$type]['en'] = $this->getMailContent($dir, $email_file, 'en'); + + // check if the file exists in the language to translate + if (file_exists($dir.$lang.'/'.$email_file)) { + $arr_return['files'][$email_name][$type][$lang] = $this->getMailContent($dir, $email_file, $lang); + } else { + $arr_return['files'][$email_name][$type][$lang] = ''; + } + if ($arr_return['files'][$email_name][$type][$lang] == '') { + $arr_return['empty_values']++; + } else { + $arr_return['total_filled']++; + } + } + } + } + return $arr_return; + } + + /** + * Get content of the mail file. + * + * @since 1.4.0.14 + * @param string $dir + * @param string $file + * @param string $lang iso code of a language + */ + protected function getMailContent($dir, $file, $lang) + { + $arr_return = array(); + $content = file_get_contents($dir.$lang.'/'.$file); + + if (Tools::strlen($content) === 0) { + $content = ''; + } + return $content; + } + + /** + * Display mails in html format. + * This was create for factorize the html displaying + * + * @since 1.4.0.14 + * @param array $mails + * @param array $all_subject_mail + * @param Language $obj_lang + * @param string $id_html use for set html id attribute for the block + * @param string $title Set the title for the block + * @param string|boolean $name_for_module is not false define add a name for disntiguish mails module + */ + protected function displayMailContent($mails, $all_subject_mail, $obj_lang, $id_html, $title, $name_for_module = false) + { + $str_return = ''; + $group_name = 'mail'; + if (key_exists('group_name', $mails)) + { + $group_name = $mails['group_name']; + } + $str_return .= ' +
+

'.$title.' - '.$mails['empty_values'].' ' + .sprintf($this->l('missing translation(s) on %s template(s) for %s'), ''.((int)$mails['empty_values']+(int)$mails['total_filled']).'', $obj_lang->name) + .':

+
'; + if (!empty($mails['files'])) + { + foreach ($mails['files'] AS $mail_name => $mail_files) + { + if ((key_exists('html', $mail_files) OR key_exists('txt', $mail_files))) + { + if (key_exists($mail_name, $all_subject_mail)) + { + $subject_mail = $all_subject_mail[$mail_name]; + $str_return .= ' +
+ +
+ '.$subject_mail.'
+ +
+
'; + } else { + $str_return .= ' +
+ '.sprintf($this->l('No Subject was found for %s.'), ''.$mail_name.'').'' + .'
'; + } + if (key_exists('html', $mail_files)) + { + $base_uri = str_replace(_PS_ROOT_DIR_, __PS_BASE_URI__, $mails['directory']); + $base_uri = str_replace('//', '/', $base_uri); + $url_mail = $base_uri.$obj_lang->iso_code.'/'.$mail_name.'.html'; + $str_return .= $this->displayMailBlockHtml($mail_files['html'], $obj_lang->iso_code, $url_mail, $mail_name, $group_name, $name_for_module); + } + if (key_exists('txt', $mail_files)) { + $str_return .= $this->displayMailBlockTxt($mail_files['txt'], $obj_lang->iso_code, $mail_name, $group_name, $name_for_module); + } + } + } + } + else + { + $str_return .= ' +

'.$this->l('There is a problem to get the Mail files.').'
' + .sprintf($this->l('Please ensure that english files exists in %s folder'), ''.$mails['directory'].'en') + .'

'; + } + $str_return .= ' +
+
+
'; + return $str_return; + } + /** + * Just build the html structure for display txt mails + * + * @since 1.4.0.14 + * @param array $content with english and language needed contents + * @param string $lang iso code of the needed language + * @param string $mail_name name of the file to translate (same for txt and html files) + * @param string $group_name group name allow to distinguish each block of mail. + * @param string|boolean $name_for_module is not false define add a name for disntiguish mails module + */ + protected function displayMailBlockTxt($content, $lang, $mail_name, $group_name, $name_for_module = false) + { + return ' +
+ +
+
+
+
'; + } + /** + * Just build the html structure for display html mails. + * + * @since 1.4.0.14 + * @param array $content with english and language needed contents + * @param string $lang iso code of the needed language + * @param string $url for the html page and displaying an outline + * @param string $mail_name name of the file to translate (same for txt and html files) + * @param string $group_name group name allow to distinguish each block of mail. + * @param string|boolean $name_for_module is not false define add a name for disntiguish mails module + */ + protected function displayMailBlockHtml($content, $lang, $url, $mail_name, $group_name, $name_for_module = false) + { + $title = array(); + + // Because TinyMCE don't work correctly with , and tags + if (stripos($content[$lang], '([^<]+)#Ui', $title[$language], $matches); + $title[$language] = empty($matches[1])?'':$matches[1]; + + // The 2 lines below allow to exlude tag from the content. + // This allow to exclude body tag even if attributs are setted. + $content[$language] = substr($content[$language], stripos($content[$language], '')+1); + $content[$language] = substr($content[$language], 0, stripos($content[$language], '')); + } + } + + $str_return = ''; + $str_return .= ' +
+ +
+
'; + $str_return .= ' +
+ '.$this->l('"title" tag:').' '.(isset($title['en']) ? $title['en'] : '').'
+ +
'; + $str_return .= ' + + Edit this mail template +
+ +
+
'; + return $str_return; + } + + /** + * Check in each module if contains mails folder. + * + * @return array of module which has mails + */ + public function getModulesHasMails() + { + $arr_modules = array(); + foreach (scandir(_PS_MODULE_DIR_) AS $module_dir) + { + if ($module_dir[0] != '.' AND file_exists(_PS_MODULE_DIR_.$module_dir.'/mails')) + { + $arr_modules[$module_dir] = _PS_MODULE_DIR_.$module_dir; + } + + } + return $arr_modules; + } + protected function getTinyMCEForMails($iso_lang) + { + return ' + + + '; + } + public function displayFormMails($lang, $noDisplay = false) + { + global $cookie, $currentIndex; + + $core_mails = array(); + $module_mails = array(); + $theme_mails = array(); + $str_output = ''; + + // get all mail subjects, this method parse each files in Prestashop !! + $subject_mail = array(); + $modules_has_mails = $this->getModulesHasMails(); + $arr_files_to_parse = array( + _PS_ROOT_DIR_.'/controllers', + _PS_ROOT_DIR_.'/classes', + PS_ADMIN_DIR.'/tabs', + ); + $arr_files_to_parse = array_merge($arr_files_to_parse, $modules_has_mails); + foreach ($arr_files_to_parse as $path) { + $subject_mail = self::getSubjectMail($path, $subject_mail); + } + + $core_mails = $this->getMailFiles(_PS_MAIL_DIR_, $lang, 'core_mail'); + $core_mails['subject'] = $this->getSubjectMailContent(_PS_MAIL_DIR_.$lang); + foreach ($modules_has_mails AS $module_name=>$module_path) + { + $module_mails[$module_name] = $this->getMailFiles($module_path.'/mails/', $lang, 'module_mail'); + $module_mails[$module_name]['subject'] = $core_mails['subject']; + } + + // Before 1.4.0.14 each theme folder was parsed, + // This page was really to low to load. + // Now just use the current theme. + if(_THEME_NAME_ !== AdminTranslations::DEFAULT_THEME_NAME) + { + if(file_exists(_PS_THEME_DIR_.'mails')) + { + $theme_mails['theme_mail'] = $this->getMailFiles(_PS_THEME_DIR_.'mails/', $lang, 'theme_mail'); + $theme_mails['theme_mail']['subject'] = $this->getSubjectMailContent(_PS_THEME_DIR_.'mails/'.$lang); + } + if (file_exists(_PS_THEME_DIR_.'/modules')) + { + foreach (scandir(_PS_THEME_DIR_.'/modules') AS $module_dir) + { + if ($module_dir[0] != '.' AND file_exists(_PS_THEME_DIR_.'modules/'.$module_dir.'/mails')) + { + $theme_mails[$module_dir] = $this->getMailFiles(_PS_THEME_DIR_.'modules/'.$module_dir.'/mails/', $lang, 'theme_module_mail'); + $theme_mails[$module_dir]['subject'] = $theme_mails['theme_mail']['subject']; + } + } + } + } + + if ($noDisplay) + { + $empty = 0; + $total = 0; + $total += (int)$core_mails['total_filled']; + $empty += (int)$core_mails['empty_values']; + foreach ($module_mails as $mod_infos) + { + $total += (int)$mod_infos['total_filled']; + $empty += (int)$mod_infos['empty_values']; + } + foreach ($theme_mails as $themes_infos) + { + $total += (int)$themes_infos['total_filled']; + $empty += (int)$themes_infos['empty_values']; + } + return array('total' => $total, 'empty' => $empty); + } + + $obj_lang = new Language(Language::getIdByIso($lang)); + + // TinyMCE + $str_output .= $this->getTinyMCEForMails($obj_lang->iso_code); + + $str_output .= ''; + $str_output .= ' +

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('E-mail template translations').'

' + .$this->l('Click on the titles to open fieldsets').'.

'; + + // display form + $str_output .= ' +
'; + $str_output .= $this->displayToggleButton(); + $str_output .= $this->displaySubmitButtons(Tools::getValue('type')); + $str_output .= '

'; + + // core emails + $str_output .= $this->l('Core e-mails:'); + $str_output .= $this->displayMailContent($core_mails, $subject_mail, $obj_lang, 'core', $this->l('Core e-mails')); + // module mails + $str_output .= $this->l('Modules e-mails:'); + foreach ($module_mails as $module_name => $mails) + { + $str_output .= $this->displayMailContent($mails, $subject_mail, $obj_lang, Tools::strtolower($module_name), sprintf($this->l('E-mails for %s module'), ''.$module_name.''), $module_name); + } + // mail theme and module theme + if (!empty($theme_mails)) + { + $str_output .= $this->l('Themes e-mails:'); + $bool_title = false; + foreach ($theme_mails as $theme_or_module_name => $mails) + { + $title = $theme_or_module_name != 'theme_mail' ? ucfirst(_THEME_NAME_).' '.sprintf($this->l('E-mails for %s module'), ''.$theme_or_module_name.'') : ucfirst(_THEME_NAME_).' '.$this->l('e-mails'); + if ($theme_or_module_name != 'theme_mail' && !$bool_title) { + $bool_title = true; + $str_output .= $this->l('E-mails modules in theme:'); + } + $str_output .= $this->displayMailContent($mails, $subject_mail, $obj_lang, 'theme_'.Tools::strtolower($theme_or_module_name), $title, ($theme_or_module_name != 'theme_mail' ? $theme_or_module_name : false)); + } + } + $str_output .= ' + + '; + $str_output .= $this->displaySubmitButtons(Tools::getValue('type')); + $str_output .= '

'; + $str_output .= '
'; + echo $str_output; + } + + protected function getSubjectMail($directory, $subject_mail) + { + foreach (scandir($directory) AS $filename) + { + if (strripos($filename, '.php') > 0 AND $filename != 'AdminTranslations.php') + { + $content = file_get_contents($directory.'/'.$filename); + $content = str_replace("\n", " ", $content); + if (preg_match_all('/Mail::Send([^;]*);/si', $content, $tab)) + { + for ($i = 0 ; isset($tab[1][$i]) ; $i++) + { + $tab2 = explode(',', $tab[1][$i]); + if (is_array($tab2)) + { + if ($tab2 && isset($tab2[1])) + { + $tab2[1] = trim(str_replace('\'', '', $tab2[1])); + if (preg_match('/Mail::l\(\''._PS_TRANS_PATTERN_.'\'\)/s', $tab2[2], $tab3)) + $tab2[2] = $tab3[1]; + $subject_mail[$tab2[1]] = $tab2[2]; + } + } + } + } + } + if ($filename != '.svn' AND $filename != '.' AND $filename != '..' AND is_dir(($directory.'/'.$filename))) + $subject_mail = self::getSubjectMail($directory.'/'.$filename, $subject_mail); + } + return $subject_mail; + } + + protected function getSubjectMailContent($directory) + { + $subject_mail_content = array(); + + if (Tools::file_exists_cache($directory.'/lang.php')) + { + // we need to include this even if already included + include($directory.'/lang.php'); + foreach($_LANGMAIL as $key => $subject) + { + $subject = str_replace("\n", " ", $subject); + $subject = str_replace("\\'", "\'", $subject); + + $subject_mail_content[$key] = htmlentities($subject,ENT_QUOTES,'UTF-8'); + } + } + else + $this->_errors[] = $this->l('Subject mail translation file not found in').' '.$directory; + return $subject_mail_content; + } + + protected function writeSubjectTranslationFile($sub, $path, $mark = false, $fullmark = false) + { + global $currentIndex; + + if ($fd = @fopen($path, 'w')) + { + //$tab = ($fullmark ? Tools::strtoupper($fullmark) : 'LANG').($mark ? Tools::strtoupper($mark) : ''); + $tab = 'LANGMAIL'; + fwrite($fd, " $value) + { + // Magic Quotes shall... not.. PASS! + if (_PS_MAGIC_QUOTES_GPC_) + $value = stripslashes($value); + fwrite($fd, '$_'.$tab.'[\''.pSQL($key).'\'] = \''.pSQL($value).'\';'."\n"); + } + + fwrite($fd, "\n?>"); + fclose($fd); + + } + else + die($this->l('Cannot write language file for mails subjects, path is:').$path); + } + + /** + * This get files to translate in module directory. + * Recursive method allow to get each files for a module no matter his depth. + * + * @param string $path directory path to scan + * @param array $array_files by reference - array which saved files to parse. + * @param string $module_name module name + * @param string $lang_file full path of translation file + * @param boolean $is_default + */ + protected function recursiveGetModuleFiles($path, &$array_files, $module_name, $lang_file, $is_default = false) + { + $files_module = array(); + $files_module = scandir($path); + $files_for_module = $this->clearModuleFiles($files_module, 'file'); + if (!empty($files_for_module)) + $array_files[] = array( + 'file_name' => $lang_file, + 'dir' => $path, + 'files' => $files_for_module, + 'module' => $module_name, + 'is_default' => $is_default, + 'theme' => ($is_default ? self::DEFAULT_THEME_NAME : _THEME_NAME_ ), + ); + $dir_module = $this->clearModuleFiles($files_module, 'directory', $path); + if(!empty($dir_module)) + { + foreach ($dir_module AS $folder) + { + $this->recursiveGetModuleFiles($path.$folder.'/', $array_files, $module_name, $lang_file, $is_default); + } + } + } + + /** + * This method get translation in each translations file. + * The file depend on $lang param. + * + * @param array $modules list of modules + * @param string $root_dir path where it get each modules + * @param string $lang iso code of choosen language to translate + * @param boolean $is_default set it if modules are located in root/prestashop/modules folder + * This allow to distinguish overrided prestashop theme and original module + */ + protected function getAllModuleFiles(array $modules, $root_dir, $lang, $is_default = false) + { + $array_files = array(); + foreach ($modules AS $module) + { + if ($module{0} != '.' AND is_dir($root_dir.$module)) + { + @include_once($root_dir.$module.'/'.$lang.'.php'); + self::getModuleTranslations($is_default); + $this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $root_dir.$module.'/'.$lang.'.php', $is_default); + } + } + return $array_files; + } + public function displayFormModules($lang) + { + global $currentIndex, $_MODULES; + + $array_lang_src = Language::getLanguages(false); + $str_output = ''; + + foreach ($array_lang_src as $language) + { + $this->all_iso_lang[] = $language['iso_code']; + } + + if (!file_exists(_PS_MODULE_DIR_)) + die($this->displayWarning(Tools::displayError('Fatal error: Module directory is not here anymore ').'('._PS_MODULE_DIR_.')')); + if (!is_writable(_PS_MODULE_DIR_)) + $this->displayWarning(Tools::displayError('The module directory must be writable')); + if (!$modules = scandir(_PS_MODULE_DIR_)) + $this->displayWarning(Tools::displayError('There are no modules in your copy of PrestaShop. Use the Modules tab to activate them or go to our Website to download additional Modules.')); + else + { + $arr_find_and_fill = array(); + + $arr_files = $this->getAllModuleFiles($modules, _PS_MODULE_DIR_, $lang, true); + $arr_find_and_fill = array_merge($arr_find_and_fill, $arr_files); + + if(file_exists(_PS_THEME_DIR_.'/modules/')) + { + $modules = scandir(_PS_THEME_DIR_.'/modules/'); + $arr_files = $this->getAllModuleFiles($modules, _PS_THEME_DIR_.'modules/', $lang); + $arr_find_and_fill = array_merge($arr_find_and_fill, $arr_files); + } + foreach ($arr_find_and_fill as $value) + $this->findAndFillTranslations($value['files'], $value['theme'], $value['module'], $value['dir'], $lang); + + $str_output .= ' +

'.$this->l('Language').' : '.Tools::strtoupper($lang).' - '.$this->l('Modules translations').'

+ '.$this->l('Total expressions').' : '.$this->total_expression.'. '.$this->l('Click the fieldset title to expand or close the fieldset.').'.

'; + $str_output .= $this->displayLimitPostWarning($this->total_expression); + if (!$this->suhosin_limit_exceed) + { + $str_output .= ' +
'; + $str_output .= $this->displayToggleButton(); + $str_output .= $this->displayAutoTranslate(); + $str_output .= '

'; + + if (count($this->modules_translations) > 1) + { + $str_output .= '

'.$this->l('List of Themes - Click to access theme translation:').'

'; + $str_output .= ''; + } + + foreach ($this->modules_translations AS $theme_name => $theme) + { + $str_output .= '

>'.$this->l('Theme:').' '.($theme_name === self::DEFAULT_THEME_NAME ? $this->l('default') : $theme_name ).'

'; + foreach ($theme AS $module_name => $module) + { + $str_output .= ''.$this->l('Module:').' '.$module_name.''; + foreach ($module AS $template_name => $newLang) + if (sizeof($newLang)) + { + $countValues = array_count_values($newLang); + $empty = isset($countValues['']) ? $countValues[''] : 0; + $str_output .= ' +
'.($theme_name === 'default' ? $this->l('default') : $theme_name ).' - '.$template_name.' - '.sizeof($newLang).' '.$this->l('expressions').' ('.$empty.') +
+ '; + foreach ($newLang AS $key => $value) + { + $str_output .= ''; + else + $str_output .= ''; + } + $str_output .= ' +
'.stripslashes($key).'= '; + if (strlen($key) < TEXTAREA_SIZED) + $str_output .= '
+
+

'; + } + } + } + $str_output .= '
'; + } + } + echo $str_output; + } + + public function displayFormPDF() + { + global $currentIndex; + + $lang = Tools::strtolower(Tools::getValue('lang')); + $_LANG = array(); + $str_output = ''; + + if (!file_exists(_PS_TRANSLATIONS_DIR_.$lang)) + if (!mkdir(_PS_TRANSLATIONS_DIR_.$lang, 0700)) + die('Please create a "'.$iso.'" directory in '._PS_TRANSLATIONS_DIR_); + if (!file_exists(_PS_TRANSLATIONS_DIR_.$lang.'/pdf.php')) + if (!file_put_contents(_PS_TRANSLATIONS_DIR_.$lang.'/pdf.php', "")) + die('Please create a "'.Tools::strtolower($lang).'.php" file in '.realpath(PS_ADMIN_DIR.'/')); + unset($_LANGPDF); + @include(_PS_TRANSLATIONS_DIR_.$lang.'/pdf.php'); + $files = array(); + $count = 0; + $tab = 'PDF_invoice'; + $pdf = _PS_CLASS_DIR_.'PDF.php'; + $newLang = array(); + $fd = fopen($pdf, 'r'); + $content = fread($fd, filesize($pdf)); + fclose($fd); + $regex = '/self::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U'; + preg_match_all($regex, $content, $matches); + foreach($matches[1] AS $key) + $tabsArray[$tab][$key] = stripslashes(key_exists($tab.md5(addslashes($key)), $_LANGPDF) ? html_entity_decode($_LANGPDF[$tab.md5(addslashes($key))], ENT_COMPAT, 'UTF-8') : ''); + $count += isset($tabsArray[$tab]) ? sizeof($tabsArray[$tab]) : 0; + $closed = sizeof($_LANGPDF) >= $count; + + $str_output .= $this->displayAutoTranslate(); + $str_output .= '

'.$this->l('Language').' : '.Tools::strtoupper($lang).'

' + .$this->l('Expressions to translate').' : '.$count.'. '.$this->l('Click on the titles to open fieldsets').'.

'; + $str_output .= $this->displayLimitPostWarning($count); + if (!$this->suhosin_limit_exceed) + { + $str_output .= ' +
+ + + + '; + $str_output .= '

'; + foreach ($tabsArray AS $k => $newLang) + if (sizeof($newLang)) + { + $countValues = array_count_values($newLang); + $empty = isset($countValues['']) ? $countValues[''] : 0; + $str_output .= '
'.$k.' - '.sizeof($newLang).' '.$this->l('expressions').' ('.$empty.') +
+ '; + foreach ($newLang AS $key => $value) + { + $str_output .= ' + + + '; + } + $str_output .= '
'.stripslashes($key).' + = +
+
+

'; + } + $str_output .= '
'; + } + echo $str_output; + } + + /** + * Return an array with themes and thumbnails + * + * @return array + */ + static public function getThemesList() + { + $dir = opendir(_PS_ALL_THEMES_DIR_); + while ($folder = readdir($dir)) + if ($folder != '.' AND $folder != '..' AND file_exists(_PS_ALL_THEMES_DIR_.'/'.$folder.'/preview.jpg')) + $themes[$folder]['name'] = $folder; + closedir($dir); + return isset($themes) ? $themes : array(); + } +} diff --git a/admin-dev/tabs/AdminWebservice.php b/admin-dev/tabs/AdminWebservice.php new file mode 100755 index 000000000..a6934f4bb --- /dev/null +++ b/admin-dev/tabs/AdminWebservice.php @@ -0,0 +1,230 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../classes/AdminTab.php'); + +class AdminWebservice extends AdminTab +{ + + public function __construct() + { + $this->table = 'webservice_account'; + $this->className = 'WebserviceKey'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + + $this->id_lang_default = Configuration::get('PS_LANG_DEFAULT'); + + $this->fieldsDisplay = array( + 'key' => array('title' => $this->l('Key'), 'align' => 'center', 'width' => 32), + 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false), + 'description' => array('title' => $this->l('Key description'), 'align' => 'center', 'orderby' => false) + ); + + $this->optionTitle = $this->l('Configuration'); + if (file_exists(_PS_ROOT_DIR_.'/.htaccess')) + $this->_fieldsOptions = array('PS_WEBSERVICE' => array('title' => $this->l('Enable PrestaShop Webservice:'), + 'desc' => $this->l('Before activating the webservice, you must be sure to: '). + '
  1. '.$this->l('be certain URL rewrite is available on this server'). + '
  2. '.$this->l('be certain that the 5 methods GET, POST, PUT, DELETE and HEAD are supported by this server'). + '
', + 'cast' => 'intval', + 'type' => 'bool')); + parent::__construct(); + } + + protected function afterAdd($object) { + WebserviceKey::setPermissionForAccount($object->id, Tools::getValue('resources', array())); + } + + protected function afterUpdate($object) { + WebserviceKey::setPermissionForAccount($object->id, Tools::getValue('resources', array())); + } + + public function displayList() + { + global $cookie, $currentIndex; + $warnings = array(); + if (!file_exists(_PS_ROOT_DIR_.'/.htaccess')) + $warnings[] = $this->l('In order to enable the PrestaShop Webservice, please generate the .htaccess file via the "Generators" tab (in the "Tools" tab).'); + if (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) + $warnings[] = $this->l('To avoid operating problems, please use an Apache server.'); + { + if (function_exists('apache_get_modules')) + { + $apache_modules = apache_get_modules(); + if (!in_array('mod_auth_basic', $apache_modules)) + $warnings[] = $this->l('Please activate the Apache module \'mod_auth_basic\' to allow authentication of PrestaShop webservice.'); + if (!in_array('mod_rewrite', $apache_modules)) + $warnings[] = $this->l('Please activate the Apache module \'mod_rewrite\' to allow using the PrestaShop webservice.'); + } + else + { + $warnings[] = $this->l('We could not check if basic authentication and rewrite extensions are activated. Please manually check if they are activated in order to use the PrestaShop webservice.'); + } + } + if (!extension_loaded('SimpleXML')) + $warnings[] = $this->l('Please activate the PHP extension \'SimpleXML\' to allow testing of PrestaShop webservice.'); + if (!configuration::get('PS_SSL_ENABLED')) + $warnings[] = $this->l('If possible, it is preferable to use SSL (https) for webservice calls, as it avoids the security issues of type "man in the middle".'); + + $this->displayWarning($warnings); + + parent::displayList(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Webservice Accounts').' + +
+ + + * +

'.$this->l('Webservice account key').'

+
+ +
+ +

'.$this->l('Key description').'

+
+ +
+ id OR Tools::getValue('active', $obj->active)) ? 'checked="checked" ' : '').'/> + + active) AND $obj->id) ? 'checked="checked" ' : '').'/> + +
+ +
+

'.$this->l('Set the resource permissions for this key:').'

+ + + + + + + + + + + + + + + + + + + + + + + + '; +$ressources = WebserviceRequest::getResources(); +$permissions = WebserviceKey::getPermissionForAccount($obj->key); +foreach ($ressources as $resourceName => $resource) +echo ' + + + + + + + + + '; +echo ' + +
'.$this->l('Resource').''.$this->l('View (GET)').''.$this->l('Modify (PUT)').''.$this->l('Add (POST)').''.$this->l('Delete (DELETE)').''.$this->l('Fast view (HEAD)').'
'.$resourceName.'
+ +
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } + public function postProcess() + { + if (Tools::getValue('key') && strlen(Tools::getValue('key')) < 32) + $this->_errors[] = Tools::displayError($this->l('Key length must be 32 character long')); + return parent::postProcess(); + } +} diff --git a/admin-dev/tabs/AdminZones.php b/admin-dev/tabs/AdminZones.php new file mode 100644 index 000000000..d3393dd1b --- /dev/null +++ b/admin-dev/tabs/AdminZones.php @@ -0,0 +1,83 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../classes/AdminTab.php'); + +class AdminZones extends AdminTab +{ + public function __construct() + { + $this->table = 'zone'; + $this->className = 'Zone'; + $this->lang = false; + $this->edit = true; + $this->delete = true; + + $this->fieldsDisplay = array( + 'id_zone' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Zone'), 'width' => 150), + 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) + ); + + parent::__construct(); + } + + public function displayForm($isMainTab = true) + { + global $currentIndex; + parent::displayForm(); + + if (!($obj = $this->loadObject(true))) + return; + echo ' +
+ '.($obj->id ? '' : '').' +
'.$this->l('Zones').' + +
+ * + '.$this->l('Allowed characters: letters, spaces and').' (-)  +

'.$this->l('Zone name, e.g., Africa, West Coast, Neighboring Countries').'

+
+ +
+ id OR Tools::getValue('active', $obj->active)) ? 'checked="checked" ' : '').'/> + + active) AND $obj->id) ? 'checked="checked" ' : '').'/> + +

'.$this->l('Allow or disallow shipping to this zone').'

+
+
+ +
+
* '.$this->l('Required field').'
+
+
'; + } +} + + diff --git a/admin-dev/themes/flashyturtle/admin.css b/admin-dev/themes/flashyturtle/admin.css new file mode 100644 index 000000000..292c4e399 --- /dev/null +++ b/admin-dev/themes/flashyturtle/admin.css @@ -0,0 +1,61 @@ +body{background:#EFEFEF url(../../../img/admin/bg.png)} +#top_container{background:url(bg-top.png) repeat-x 0 -60px;margin:0;padding:0} +div#header_infos span{color:#FFF} +#header_infos{float:left;font-size:10px;margin:10px 20px 4px 0;width:360px;height:43px} +div#header_infos a#header_shopname span{display:block;font-size:24px;overflow:hidden;margin-bottom:-8px;height:28px} +div#header_infos a#header_logout span{text-decoration:underline} +div#header_infos a#header_foaccess span{text-decoration:none} +div#header_infos a {color:#FFF;} +#header_search{background:url(searchbar.png) no-repeat;float:right;height:39px;width:356px} +#header_search #bo_query{background:transparent;border:none;color:#FFF;float:left;height:16px;line-height:16px;margin:10px 0 0 30px;outline:0;vertical-align:middle;width:140px} +#header_search #bo_search_type{background:#ECECEC;border:#000;float:left;height:21px;line-height:21px;margin-top:9px;vertical-align:middle;width:90px} +#header_search #bo_search_submit{background:url(searchbutton.png) no-repeat;border:none;color:#FFF;cursor:pointer;float:left;font-size:10px;font-weight:700;height:24px;line-height:24px;margin:7px 0 0 2px;outline:0;padding-bottom:2px;width:79px} +#header_search #bo_search_submit:hover{background-position:0 -25px} +#header_search #bo_search_submit:active{background-position:0 -50px} +#header_quick{background:url(bg-quick.png) no-repeat;float:right;height:39px;margin-right:1px;width:175px} +#header_quick #quick_select{background:#ECECEC;border:#000;height:21px;line-height:21px;margin:8px 0 0 30px;vertical-align:middle;width:140px} +#header_myaccount{background:url(bg-lang.png) no-repeat;display:block;float:right;height:39px;margin-right:1px;width:39px} +.button{background:#83CA38 url(center_btn_filter.png) repeat-x 0px -1px;border:1px solid #364A14;border-left:1px solid #475B25;border-top:1px solid #475B25;color:#FFF;cursor:pointer;padding:0 5px;height:24px} +.button[disabled=disabled]{background:#E2EBEE;color:#000000} +input.button[disabled=disabled]:hover{background-color:#FFF6D3} +.button:hover{background-position:0 -27px} +a.button{padding:3px 15px;color:white;} +.table{border:1px solid #416110;padding:0} +.table th a{text-decoration:underline} +.table a:hover{text-decoration:none} +.table tr th{background:#7AB51D url(thead.png) repeat-x top left;border-bottom:1px solid #416110;color:#FFF;padding:4px 6px} +.table tr td{border-bottom:1px solid #F0EADA;color:#963;font-size:.9em;height:23px;padding:0 4px 0 6px} +.table tr.last td{border-bottom:none} +.alt_row{background-color:#EFEFEF} +.path_bar{background-color:#E2EBEE;border:1px solid #999999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:13px;margin-bottom:20px;padding:5px} +.path_bar a{font-weight:700} +.cat_bar{background-color:#F4E8CD;border:1px solid #999999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:12px;font-weight:700;margin-bottom:20px;padding:5px} +.cat_bar a{font-weight:700} +fieldset{background:#FFF;border:1px solid #8E8E8E;font-size:1.1em;margin:0;padding:1em} +legend{background:#7AB51D url(thead.png) repeat-x top left;border:1px solid #364A14;font-weight:700;margin:0;padding:.2em .5em;text-align:left;color:#FFFFFF} +#menu{float:left;height:35px;line-height:normal;margin:10px 0 0;*margin:7px 0 0;padding:0;width:100%} +#menu li{background:url(bg-tab.png) repeat-x;float:left;height:35px;list-style:none;margin:0 1px 0 0} +#menu li a{color:#FFF;display:block;height:35px;padding:6px 8px 4px 0;} +#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px} +#menu li.active{background-position:0 -70px} +#menu li.active a{color:#000} +#submenu{clear:both;color:#666;margin:0;height:38px;padding:0} +.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px} +#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:10px;padding-right:10px;margin-top:8px;float:left;height:20px} +#submenu li a{text-decoration:underline} +#menu li{_height:32px;_padding-top:3px} +#menu li a{_display:inline;_padding:6px 6px 4px} +.tab-page {border:1px solid #383838;background:#F6F6F6} +.tab-row .tab.selected {border:1px solid #383838;background:#812143} +.tab-row .tab.selected a{color:black} +.tab-row .tab {border:1px solid #FDFDFD;background:#EFEFEF;height:24px;line-height:24px;vertical-align:middle} +hr {height: 1px;color:#DEDEDE;background-color:#DEDEDE} +#footer {height:40px;background:#DDDDDD url("footer-bg.png") repeat-x scroll left bottom;border:1px solid #383838;font-size:12px;clear:both;font-size:0.9em;color:#666666} +#content {background-color:#FFF;border-left:1px solid #383838;border-right:1px solid #383838} +input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #416110} +select {border: 1px solid #416110} +.header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} +a.action_module{color: #488C40;text-decoration: underline;} +a.header_module_toggle{font-weight: bold;color: #812143;display:block;} +a.module_toggle_all{color:#FFF;text-decoration:none;display:inherit;} +.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #812143;} diff --git a/admin-dev/themes/flashyturtle/bg-lang.png b/admin-dev/themes/flashyturtle/bg-lang.png new file mode 100644 index 000000000..e099979d2 Binary files /dev/null and b/admin-dev/themes/flashyturtle/bg-lang.png differ diff --git a/admin-dev/themes/flashyturtle/bg-quick.png b/admin-dev/themes/flashyturtle/bg-quick.png new file mode 100644 index 000000000..96503c8f8 Binary files /dev/null and b/admin-dev/themes/flashyturtle/bg-quick.png differ diff --git a/admin-dev/themes/flashyturtle/bg-subtab.png b/admin-dev/themes/flashyturtle/bg-subtab.png new file mode 100644 index 000000000..2ae767a20 Binary files /dev/null and b/admin-dev/themes/flashyturtle/bg-subtab.png differ diff --git a/admin-dev/themes/flashyturtle/bg-tab.png b/admin-dev/themes/flashyturtle/bg-tab.png new file mode 100644 index 000000000..6214b2094 Binary files /dev/null and b/admin-dev/themes/flashyturtle/bg-tab.png differ diff --git a/admin-dev/themes/flashyturtle/bg-top.png b/admin-dev/themes/flashyturtle/bg-top.png new file mode 100644 index 000000000..75fe354e0 Binary files /dev/null and b/admin-dev/themes/flashyturtle/bg-top.png differ diff --git a/admin-dev/themes/flashyturtle/button-bg.png b/admin-dev/themes/flashyturtle/button-bg.png new file mode 100644 index 000000000..3708ba053 Binary files /dev/null and b/admin-dev/themes/flashyturtle/button-bg.png differ diff --git a/admin-dev/themes/flashyturtle/center_btn_filter.png b/admin-dev/themes/flashyturtle/center_btn_filter.png new file mode 100644 index 000000000..f7009ad52 Binary files /dev/null and b/admin-dev/themes/flashyturtle/center_btn_filter.png differ diff --git a/admin-dev/themes/flashyturtle/footer-bg.png b/admin-dev/themes/flashyturtle/footer-bg.png new file mode 100644 index 000000000..227aa8a5e Binary files /dev/null and b/admin-dev/themes/flashyturtle/footer-bg.png differ diff --git a/admin-dev/themes/flashyturtle/header_module.png b/admin-dev/themes/flashyturtle/header_module.png new file mode 100644 index 000000000..98a824487 Binary files /dev/null and b/admin-dev/themes/flashyturtle/header_module.png differ diff --git a/admin-dev/themes/flashyturtle/searchbar.png b/admin-dev/themes/flashyturtle/searchbar.png new file mode 100644 index 000000000..dc69699d1 Binary files /dev/null and b/admin-dev/themes/flashyturtle/searchbar.png differ diff --git a/admin-dev/themes/flashyturtle/searchbutton.png b/admin-dev/themes/flashyturtle/searchbutton.png new file mode 100644 index 000000000..30cc017e2 Binary files /dev/null and b/admin-dev/themes/flashyturtle/searchbutton.png differ diff --git a/admin-dev/themes/flashyturtle/separator_subnav.png b/admin-dev/themes/flashyturtle/separator_subnav.png new file mode 100644 index 000000000..f14a7ca0c Binary files /dev/null and b/admin-dev/themes/flashyturtle/separator_subnav.png differ diff --git a/admin-dev/themes/flashyturtle/thead.png b/admin-dev/themes/flashyturtle/thead.png new file mode 100644 index 000000000..8820a89e9 Binary files /dev/null and b/admin-dev/themes/flashyturtle/thead.png differ diff --git a/admin-dev/themes/oldschool/admin.css b/admin-dev/themes/oldschool/admin.css new file mode 100644 index 000000000..47878050f --- /dev/null +++ b/admin-dev/themes/oldschool/admin.css @@ -0,0 +1,55 @@ +body{background:#EFEFEF} +#top_container{margin:0;padding:0} +#header_infos{float:left;font-size:10px;margin:10px 20px 4px 0;width:380px;height:40px} +#header_infos #header_shopname span{display:block;font-size:24px;height:28px;overflow:hidden;margin-bottom:-8px} +#header_infos #header_logout{text-decoration:underline} +#header_infos #header_foaccess{text-decoration:none} +#header_search{float:right;height:39px;width:356px} +#header_search #bo_query{float:left;height:16px;line-height:16px;margin:8px 2px 0 30px;vertical-align:middle;width:140px} +#header_search #bo_search_type{float:left;height:21px;line-height:21px;margin:8px 2px 0 0;vertical-align:middle;width:90px} +#header_search #bo_search_submit{cursor:pointer;float:left;font-weight:700;margin:7px 0 0 2px;width:79px} +#header_quick{float:right;height:39px;margin-right:1px;width:175px} +#header_quick #quick_select{margin:8px 0 0 20px;vertical-align:middle;width:140px} +#header_myaccount{background:url(bg-lang.png) no-repeat;display:block;float:right;height:16px;margin:8px 1px 0 0;width:16px} +.button{background-color:#FFF6D3;border:1px solid #DFD5AF;border-left:1px solid #FFF6D3;border-top:1px solid #FFF6D3;color:#268CCD;padding:3px} +.button[disabled=disabled]{color:#8C8C8C} +input.button[disabled=disabled]:hover{background-color:#FFF6D3} +.button:hover{background-color:#F0EBD6} +.table{border:1px solid #DFD5C3;padding:0} +.table th a{text-decoration:underline} +.table a:hover{text-decoration:none} +.table tr th{background:#F4E6C9 url(news-bg.gif) repeat-x top left;padding:4px 6px} +.table tr td{border-bottom:1px solid #DEDEDE;color:#963;font-size:.9em;height:23px;padding:0 4px 0 6px} +.table tr.last td{border-bottom:none} +.alt_row{background-color:#EFEFEF} +.path_bar{background-color:#E2EBEE;border:1px solid #999999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:13px;margin-bottom:20px;padding:5px} +.path_bar a{font-weight:700} +.cat_bar{background-color:#F4E8CD;border:1px solid #999999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:12px;font-weight:700;margin-bottom:20px;padding:5px} +.cat_bar a{font-weight:700} +fieldset{background:#FFFFF0;border:1px solid #DFD5C3;font-size:1.1em;margin:0;padding:1em} +legend{background:#FFF6D3;border:1px solid #DFD5C3;font-weight:700;margin:0;padding:.2em .5em;text-align:left} +#menu{float:left;height:30px;line-height:normal;margin:10px 0 0;*margin:7px 0 0;padding:0;width:100%;padding:0 1px} +#menu li{background:url(bg-tab.png) repeat-x 0 -2px;float:left;height:29px;list-style:none;margin:0 1px 0 0;list-style:none;display:block;border:1px solid #999999;-moz-border-radius-topright:6px;-moz-border-radius-topleft:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px} +#menu li a{color:#000;display:block;height:20px;padding:8px 8px 4px 0;font-weight:bold;font-size:0.95em;} +#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px} +#menu li.active,#menu li:hover{background-position:0 -38px;white-space:nowrap;} +#menu li.active a{color:#000} +#submenu{background:#ECEADE;clear:both;color:#666;margin:0;height:32px;padding:0;border:1px solid #999999} +.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px} +#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:7px;padding-right:7px;margin-top:8px;float:left;height:20px} +#submenu li a{text-decoration:underline} +#menu li{_height:32px;_padding-top:3px} +#menu li a{_display:inline;_padding:6px 5px 4px 0} +.tab-page {border:1px solid #ccc;background:#FFFFF0} +.tab-row .tab.selected {border:1px solid #ccc;background:#FFF6D3;margin:1px -3px -3px 0px;top:-2px} +.tab-row .tab {background:#EFEFEF} +hr {height: 1px;color:#E0D0B1;background-color:#E0D0B1} +#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666} +#content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999} +input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #E0D0B1} +select {border: 1px solid #E0D0B1} +.header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} +a.action_module{color: #268CCD;text-decoration: underline;} +a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;} +a.module_toggle_all{color: #268CCD;} +.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #268CCD;} \ No newline at end of file diff --git a/admin-dev/themes/oldschool/bg-lang.png b/admin-dev/themes/oldschool/bg-lang.png new file mode 100644 index 000000000..5db32699e Binary files /dev/null and b/admin-dev/themes/oldschool/bg-lang.png differ diff --git a/admin-dev/themes/oldschool/bg-quick.png b/admin-dev/themes/oldschool/bg-quick.png new file mode 100644 index 000000000..4acbb75b4 Binary files /dev/null and b/admin-dev/themes/oldschool/bg-quick.png differ diff --git a/admin-dev/themes/oldschool/bg-subtab.png b/admin-dev/themes/oldschool/bg-subtab.png new file mode 100644 index 000000000..fdc1b1180 Binary files /dev/null and b/admin-dev/themes/oldschool/bg-subtab.png differ diff --git a/admin-dev/themes/oldschool/bg-tab.png b/admin-dev/themes/oldschool/bg-tab.png new file mode 100644 index 000000000..69f70da30 Binary files /dev/null and b/admin-dev/themes/oldschool/bg-tab.png differ diff --git a/admin-dev/themes/oldschool/button-bg.png b/admin-dev/themes/oldschool/button-bg.png new file mode 100644 index 000000000..bbde5ed57 Binary files /dev/null and b/admin-dev/themes/oldschool/button-bg.png differ diff --git a/admin-dev/themes/oldschool/footer-bg.png b/admin-dev/themes/oldschool/footer-bg.png new file mode 100644 index 000000000..a72c8ba8d Binary files /dev/null and b/admin-dev/themes/oldschool/footer-bg.png differ diff --git a/admin-dev/themes/oldschool/header_module.png b/admin-dev/themes/oldschool/header_module.png new file mode 100644 index 000000000..afaaae61d Binary files /dev/null and b/admin-dev/themes/oldschool/header_module.png differ diff --git a/admin-dev/themes/oldschool/news-bg.gif b/admin-dev/themes/oldschool/news-bg.gif new file mode 100644 index 000000000..9adbd05e5 Binary files /dev/null and b/admin-dev/themes/oldschool/news-bg.gif differ diff --git a/admin-dev/themes/oldschool/searchbar.png b/admin-dev/themes/oldschool/searchbar.png new file mode 100644 index 000000000..26b93aeef Binary files /dev/null and b/admin-dev/themes/oldschool/searchbar.png differ diff --git a/admin-dev/themes/oldschool/searchbutton.gif b/admin-dev/themes/oldschool/searchbutton.gif new file mode 100644 index 000000000..a2f27ddf9 Binary files /dev/null and b/admin-dev/themes/oldschool/searchbutton.gif differ diff --git a/admin-dev/themes/oldschool/separator_subnav.png b/admin-dev/themes/oldschool/separator_subnav.png new file mode 100644 index 000000000..0d2a18ad0 Binary files /dev/null and b/admin-dev/themes/oldschool/separator_subnav.png differ diff --git a/admin-dev/themes/oldschool/submenu-bg.gif b/admin-dev/themes/oldschool/submenu-bg.gif new file mode 100644 index 000000000..c3de2cfc5 Binary files /dev/null and b/admin-dev/themes/oldschool/submenu-bg.gif differ diff --git a/admin-dev/themes/oldschool/tab_right.gif b/admin-dev/themes/oldschool/tab_right.gif new file mode 100644 index 000000000..82740efa4 Binary files /dev/null and b/admin-dev/themes/oldschool/tab_right.gif differ diff --git a/admin-dev/themes/oldschool/thead.png b/admin-dev/themes/oldschool/thead.png new file mode 100644 index 000000000..afaaae61d Binary files /dev/null and b/admin-dev/themes/oldschool/thead.png differ diff --git a/admin-dev/themes/origins/admin.css b/admin-dev/themes/origins/admin.css new file mode 100644 index 000000000..490716a50 --- /dev/null +++ b/admin-dev/themes/origins/admin.css @@ -0,0 +1,59 @@ +body{background:#EFEFEF url(../../../img/admin/bg.png)} +#top_container{background:url(bg-top.png) repeat-x 0 -60px;margin:0;padding:0} +div#header_infos span{color:#FFF} +#header_infos{float:left;font-size:10px;margin:10px 20px 4px 0;width:360px;height:43px} +div#header_infos a#header_shopname span{display:block;font-size:24px;overflow:hidden;margin-bottom:-8px;height:28px} +div#header_infos a#header_logout span{text-decoration:underline} +div#header_infos a#header_foaccess span{text-decoration:none} +div#header_infos a {color:#FFF;} +#header_search{background:url(searchbar.png) no-repeat;float:right;height:39px;width:356px} +#header_search #bo_query{background:transparent;border:none;color:#FFF;float:left;height:16px;line-height:16px;margin:10px 0 0 30px;outline:0;vertical-align:middle;width:140px} +#header_search #bo_search_type{background:#ECECEC;border:#000;float:left;height:21px;line-height:21px;margin-top:9px;vertical-align:middle;width:90px} +#header_search #bo_search_submit{background:url(searchbutton.png) no-repeat;border:none;color:#000;cursor:pointer;float:left;font-size:10px;font-weight:700;height:24px;line-height:24px;margin:7px 0 0 2px;outline:0;padding-bottom:2px;width:79px} +#header_search #bo_search_submit:hover{background-position:0 -24px} +#header_quick{background:url(bg-quick.png) no-repeat;float:right;height:39px;margin-right:1px;width:175px} +#header_quick #quick_select{background:#ECECEC;border:#000;height:21px;line-height:21px;margin:8px 0 0 30px;vertical-align:middle;width:140px} +#header_myaccount{background:url(bg-lang.png) no-repeat;display:block;float:right;height:39px;margin-right:1px;width:39px} +.button{background-color:#FFF6D3;border:1px solid #DFD5AF;border-left:1px solid #FFF6D3;border-top:1px solid #FFF6D3;color:#268CCD;padding:3px} +.button[disabled=disabled]{color:#8C8C8C} +input.button[disabled=disabled]:hover{background-color:#FFF6D3} +.button:hover{background-color:#F0EBD6} +.table{border:1px solid #DFD5C3;padding:0} +.table th a{text-decoration:underline} +.table a:hover{text-decoration:none} +.table tr th{background:#F4E6C9 url(news-bg.gif) repeat-x top left;padding:4px 6px} +.table tr td{border-bottom:1px solid #DEDEDE;color:#963;font-size:.9em;height:23px;padding:0 4px 0 6px} +.table tr.last td{border-bottom:none} +.alt_row{background-color:#EFEFEF} +.path_bar{background-color:#E2EBEE;border:1px solid #999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:13px;margin-bottom:20px;padding:5px} +.path_bar a{font-weight:700} +.cat_bar{background-color:#F4E8CD;border:1px solid #999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:12px;font-weight:700;margin-bottom:20px;padding:5px} +.cat_bar a{font-weight:700} +fieldset{background:#FFFFF0;border:1px solid #DFD5C3;font-size:1.1em;margin:0;padding:1em} +legend{background:#FFF6D3;border:1px solid #DFD5C3;font-weight:700;margin:0;padding:.2em .5em;text-align:left} +#menu{float:left;height:35px;line-height:normal;margin:10px 0 0;*margin:7px 0 0;padding:0;width:100%;} +#menu li{background:url(bg-tab.png) repeat-x 0 -2px;float:left;height:35px;list-style:none;margin:0 1px 0 0;list-style:none;display:block;-moz-border-radius-topright:6px;-moz-border-radius-topleft:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px} +#menu li a{color:#000;display:block;height:20px;padding:6px 8px 4px 0;} +#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px} +#menu li.active{background-position:0 -38px;white-space:nowrap;} +#menu li.active a{color:#000} +#submenu{clear:both;color:#666;margin:0;height:38px;padding:0} +.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px} +#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:9px;padding-right:9px;margin-top:8px;float:left;height:20px} +#submenu li a{text-decoration:underline} +#menu li{_height:32px;_padding-top:3px} +#menu li a{_display:inline;_padding:6px 5px 4px 0} +.tab-page {border:1px solid #ccc;background:#FFFFF0} +.tab-row .tab.selected {border:1px solid #ccc;background:#FFF6D3;margin:1px -3px -3px 0px;top:-2px} +.tab-row .tab {background:#EFEFEF} +hr {height: 1px;color:#E0D0B1;background-color:#E0D0B1} +#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666} +#content {background-color:#FFF;border-left:1px solid #999999;border-right:1px solid #999999} +input[type="text"],input[type="password"],input[type="file"],textarea {border:1px solid #E0D0B1} +select {border: 1px solid #E0D0B1} +.header_module{background:url(header_module.png);padding-left: 0.5em;padding-top: 0.8em;height:20px;color: #812143;border:solid 1px #CCC;} +a.action_module{color: #268CCD;text-decoration: underline;} +a.header_module_toggle{font-weight: bold;color: #268CCD;display:block;} +a.module_toggle_all{color: #268CCD;} +.nbr_module{float:right;margin-right:10px;font-style:italic;font-size:12px;color: #268CCD;} + diff --git a/admin-dev/themes/origins/bg-lang.png b/admin-dev/themes/origins/bg-lang.png new file mode 100644 index 000000000..a1f547194 Binary files /dev/null and b/admin-dev/themes/origins/bg-lang.png differ diff --git a/admin-dev/themes/origins/bg-quick.png b/admin-dev/themes/origins/bg-quick.png new file mode 100644 index 000000000..4acbb75b4 Binary files /dev/null and b/admin-dev/themes/origins/bg-quick.png differ diff --git a/admin-dev/themes/origins/bg-subtab.png b/admin-dev/themes/origins/bg-subtab.png new file mode 100644 index 000000000..fdc1b1180 Binary files /dev/null and b/admin-dev/themes/origins/bg-subtab.png differ diff --git a/admin-dev/themes/origins/bg-tab.png b/admin-dev/themes/origins/bg-tab.png new file mode 100644 index 000000000..f2dcf116f Binary files /dev/null and b/admin-dev/themes/origins/bg-tab.png differ diff --git a/admin-dev/themes/origins/bg-top.png b/admin-dev/themes/origins/bg-top.png new file mode 100644 index 000000000..a07fbec98 Binary files /dev/null and b/admin-dev/themes/origins/bg-top.png differ diff --git a/admin-dev/themes/origins/button-bg.png b/admin-dev/themes/origins/button-bg.png new file mode 100644 index 000000000..bbde5ed57 Binary files /dev/null and b/admin-dev/themes/origins/button-bg.png differ diff --git a/admin-dev/themes/origins/footer-bg.png b/admin-dev/themes/origins/footer-bg.png new file mode 100644 index 000000000..a72c8ba8d Binary files /dev/null and b/admin-dev/themes/origins/footer-bg.png differ diff --git a/admin-dev/themes/origins/header_module.png b/admin-dev/themes/origins/header_module.png new file mode 100644 index 000000000..afaaae61d Binary files /dev/null and b/admin-dev/themes/origins/header_module.png differ diff --git a/admin-dev/themes/origins/img/t/AdminAddonsCatalog.gif b/admin-dev/themes/origins/img/t/AdminAddonsCatalog.gif new file mode 100644 index 000000000..2104e0bed Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminAddonsCatalog.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminAddonsMyAccount.gif b/admin-dev/themes/origins/img/t/AdminAddonsMyAccount.gif new file mode 100644 index 000000000..2104e0bed Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminAddonsMyAccount.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminCatalog.gif b/admin-dev/themes/origins/img/t/AdminCatalog.gif new file mode 100644 index 000000000..34e1aa5f4 Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminCatalog.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminCustomers.gif b/admin-dev/themes/origins/img/t/AdminCustomers.gif new file mode 100644 index 000000000..99650c04b Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminCustomers.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminEmployees.gif b/admin-dev/themes/origins/img/t/AdminEmployees.gif new file mode 100644 index 000000000..1950e2ea4 Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminEmployees.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminModules.gif b/admin-dev/themes/origins/img/t/AdminModules.gif new file mode 100644 index 000000000..2104e0bed Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminModules.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminModulesPositions.gif b/admin-dev/themes/origins/img/t/AdminModulesPositions.gif new file mode 100644 index 000000000..8b043ca74 Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminModulesPositions.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminOrders.gif b/admin-dev/themes/origins/img/t/AdminOrders.gif new file mode 100644 index 000000000..92067bd9e Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminOrders.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminPayment.gif b/admin-dev/themes/origins/img/t/AdminPayment.gif new file mode 100644 index 000000000..89de86e3c Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminPayment.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminPreferences.gif b/admin-dev/themes/origins/img/t/AdminPreferences.gif new file mode 100644 index 000000000..e3274c83d Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminPreferences.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminShipping.gif b/admin-dev/themes/origins/img/t/AdminShipping.gif new file mode 100644 index 000000000..2a85c456c Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminShipping.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminStats.gif b/admin-dev/themes/origins/img/t/AdminStats.gif new file mode 100644 index 000000000..16408519c Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminStats.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminStockMvt.gif b/admin-dev/themes/origins/img/t/AdminStockMvt.gif new file mode 100755 index 000000000..2a85c456c Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminStockMvt.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminStores.gif b/admin-dev/themes/origins/img/t/AdminStores.gif new file mode 100644 index 000000000..92067bd9e Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminStores.gif differ diff --git a/admin-dev/themes/origins/img/t/AdminTools.gif b/admin-dev/themes/origins/img/t/AdminTools.gif new file mode 100644 index 000000000..d875d9167 Binary files /dev/null and b/admin-dev/themes/origins/img/t/AdminTools.gif differ diff --git a/admin-dev/themes/origins/news-bg.gif b/admin-dev/themes/origins/news-bg.gif new file mode 100644 index 000000000..9adbd05e5 Binary files /dev/null and b/admin-dev/themes/origins/news-bg.gif differ diff --git a/admin-dev/themes/origins/searchbar.png b/admin-dev/themes/origins/searchbar.png new file mode 100644 index 000000000..26b93aeef Binary files /dev/null and b/admin-dev/themes/origins/searchbar.png differ diff --git a/admin-dev/themes/origins/searchbutton.png b/admin-dev/themes/origins/searchbutton.png new file mode 100644 index 000000000..31327bf89 Binary files /dev/null and b/admin-dev/themes/origins/searchbutton.png differ diff --git a/admin-dev/themes/origins/separator_subnav.png b/admin-dev/themes/origins/separator_subnav.png new file mode 100644 index 000000000..0d2a18ad0 Binary files /dev/null and b/admin-dev/themes/origins/separator_subnav.png differ diff --git a/admin-dev/themes/origins/tab_right.gif b/admin-dev/themes/origins/tab_right.gif new file mode 100644 index 000000000..82740efa4 Binary files /dev/null and b/admin-dev/themes/origins/tab_right.gif differ diff --git a/admin-dev/themes/origins/thead.png b/admin-dev/themes/origins/thead.png new file mode 100644 index 000000000..afaaae61d Binary files /dev/null and b/admin-dev/themes/origins/thead.png differ diff --git a/admin-dev/uploadProductFile.php b/admin-dev/uploadProductFile.php new file mode 100644 index 000000000..719379c3c --- /dev/null +++ b/admin-dev/uploadProductFile.php @@ -0,0 +1,61 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_ADMIN_DIR', getcwd()); + +include(PS_ADMIN_DIR.'/../config/config.inc.php'); + +if (!class_exists('Cookie')) + exit(); + +$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -10)); +if (!$cookie->isLoggedBack()) + die; + +if (isset($_FILES['virtual_product_file']) AND is_uploaded_file($_FILES['virtual_product_file']['tmp_name']) AND +(isset($_FILES['virtual_product_file']['error']) AND !$_FILES['virtual_product_file']['error']) OR +(!empty($_FILES['virtual_product_file']['tmp_name']) AND $_FILES['virtual_product_file']['tmp_name'] != 'none')) +{ + $filename = $_FILES['virtual_product_file']['name']; + $file = $_FILES['virtual_product_file']['tmp_name']; + $newfilename = ProductDownload::getNewFilename(); + + if (!copy($file, _PS_DOWNLOAD_DIR_.$newfilename)) + { + header('HTTP/1.1 500 Error'); + echo ''; + } + @unlink($file); + + header('HTTP/1.1 200 OK'); + echo ''; +} +else +{ + header('HTTP/1.1 500 Error'); + echo ''; +} \ No newline at end of file diff --git a/attachment.php b/attachment.php new file mode 100644 index 000000000..e0b456151 --- /dev/null +++ b/attachment.php @@ -0,0 +1,38 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +require(dirname(__FILE__).'/init.php'); + +$a = new Attachment((int)(Tools::getValue('id_attachment')), (int)($cookie->id_lang)); + +header('Content-Transfer-Encoding: binary'); +header('Content-Type: '.$a->mime); +header('Content-Length: '.filesize(_PS_DOWNLOAD_DIR_.$a->file)); +header('Content-Disposition: attachment; filename="'.utf8_decode($a->file_name).'"'); +readfile(_PS_DOWNLOAD_DIR_.$a->file); +exit; \ No newline at end of file diff --git a/authentication.php b/authentication.php new file mode 100644 index 000000000..2d7d49039 --- /dev/null +++ b/authentication.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('AuthController')->run(); diff --git a/best-sales.php b/best-sales.php new file mode 100644 index 000000000..685b6b074 --- /dev/null +++ b/best-sales.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('BestSalesController')->run(); diff --git a/cart.php b/cart.php new file mode 100644 index 000000000..2a3266376 --- /dev/null +++ b/cart.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('CartController')->run(); diff --git a/category.php b/category.php new file mode 100644 index 000000000..6d83441e5 --- /dev/null +++ b/category.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('CategoryController')->run(); diff --git a/changecurrency.php b/changecurrency.php new file mode 100644 index 000000000..16158b5b1 --- /dev/null +++ b/changecurrency.php @@ -0,0 +1,39 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/config/config.inc.php'); +include(dirname(__FILE__).'/init.php'); + +$currency = new Currency((int)(Tools::getValue('id_currency'))); +if (Validate::isLoadedObject($currency) AND !$currency->deleted) +{ + $cookie->id_currency = (int)($currency->id); + die('1'); +} +else + die('0'); + diff --git a/classes/.htaccess b/classes/.htaccess new file mode 100755 index 000000000..93169e4eb --- /dev/null +++ b/classes/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/classes/Address.php b/classes/Address.php new file mode 100644 index 000000000..44c282a9f --- /dev/null +++ b/classes/Address.php @@ -0,0 +1,315 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AddressCore extends ObjectModel +{ + /** @var integer Customer id which address belongs */ + public $id_customer = NULL; + + /** @var integer Manufacturer id which address belongs */ + public $id_manufacturer = NULL; + + /** @var integer Supplier id which address belongs */ + public $id_supplier = NULL; + + /** @var integer Country id */ + public $id_country; + + /** @var integer State id */ + public $id_state; + + /** @var string Country name */ + public $country; + + /** @var string Alias (eg. Home, Work...) */ + public $alias; + + /** @var string Company (optional) */ + public $company; + + /** @var string Lastname */ + public $lastname; + + /** @var string Firstname */ + public $firstname; + + /** @var string Address first line */ + public $address1; + + /** @var string Address second line (optional) */ + public $address2; + + /** @var string Postal code */ + public $postcode; + + /** @var string City */ + public $city; + + /** @var string Any other useful information */ + public $other; + + /** @var string Phone number */ + public $phone; + + /** @var string Mobile phone number */ + public $phone_mobile; + + /** @var string VAT number */ + public $vat_number; + + /** @var string DNI number */ + public $dni; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + /** @var boolean True if address has been deleted (staying in database as deleted) */ + public $deleted = 0; + + protected static $_idZones = array(); + protected static $_idCountries = array(); + + protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'city'); + protected $fieldsSize = array('alias' => 32, 'company' => 32, 'lastname' => 32, 'firstname' => 32, + 'address1' => 128, 'address2' => 128, 'postcode' => 12, 'city' => 64, + 'other' => 300, 'phone' => 16, 'phone_mobile' => 16, 'dni' => 16); + protected $fieldsValidate = array('id_customer' => 'isNullOrUnsignedId', 'id_manufacturer' => 'isNullOrUnsignedId', + 'id_supplier' => 'isNullOrUnsignedId', 'id_country' => 'isUnsignedId', 'id_state' => 'isNullOrUnsignedId', + 'alias' => 'isGenericName', 'company' => 'isGenericName', 'lastname' => 'isName','vat_number' => 'isGenericName', + 'firstname' => 'isName', 'address1' => 'isAddress', 'address2' => 'isAddress', 'postcode'=>'isPostCode', + 'city' => 'isCityName', 'other' => 'isMessage', + 'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool', 'dni' => 'isDniLite'); + + protected $table = 'address'; + protected $identifier = 'id_address'; + protected $_includeVars = array('addressType' => 'table'); + protected $_includeContainer = false; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'addresses', + 'fields' => array( + 'id_customer' => array('xlink_resource'=> 'customers'), + 'id_manufacturer' => array('xlink_resource'=> 'manufacturers'), + 'id_supplier' => array('xlink_resource'=> 'suppliers'), + 'id_country' => array('xlink_resource'=> 'countries'), + 'id_state' => array('xlink_resource'=> 'states'), + ), + ); + + /** + * Build an address + * + * @param integer $id_address Existing address id in order to load object (optional) + */ + public function __construct($id_address = NULL, $id_lang = NULL) + { + parent::__construct($id_address); + + /* Get and cache address country name */ + if ($this->id) + { + $result = Db::getInstance()->getRow('SELECT `name` FROM `'._DB_PREFIX_.'country_lang` + WHERE `id_country` = '.(int)($this->id_country).' + AND `id_lang` = '.($id_lang ? (int)($id_lang) : Configuration::get('PS_LANG_DEFAULT'))); + $this->country = $result['name']; + } + } + + public function add($autodate = true, $nullValues = false) + { + if (!parent::add($autodate, $nullValues)) + return false; + + if (Validate::isUnsignedId($this->id_customer)) + Customer::resetAddressCache($this->id_customer); + return true; + } + + public function delete() + { + if (Validate::isUnsignedId($this->id_customer)) + Customer::resetAddressCache($this->id_customer); + + if (!$this->isUsed()) + return parent::delete(); + else + { + $class = get_class($this); + $obj = new $class($this->id); + $obj->deleted = true; + return $obj->update(); + } + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_address'] = (int)($this->id); + $fields['id_customer'] = is_null($this->id_customer) ? 0 : (int)($this->id_customer); + $fields['id_manufacturer'] = is_null($this->id_manufacturer) ? 0 : (int)($this->id_manufacturer); + $fields['id_supplier'] = is_null($this->id_supplier) ? 0 : (int)($this->id_supplier); + $fields['id_country'] = (int)($this->id_country); + $fields['id_state'] = (int)($this->id_state); + $fields['alias'] = pSQL($this->alias); + $fields['company'] = pSQL($this->company); + $fields['lastname'] = pSQL($this->lastname); + $fields['firstname'] = pSQL($this->firstname); + $fields['address1'] = pSQL($this->address1); + $fields['address2'] = pSQL($this->address2); + $fields['postcode'] = pSQL($this->postcode); + $fields['city'] = pSQL($this->city); + $fields['other'] = pSQL($this->other); + $fields['phone'] = pSQL($this->phone); + $fields['phone_mobile'] = pSQL($this->phone_mobile); + $fields['vat_number'] = pSQL($this->vat_number); + $fields['dni'] = pSQL($this->dni); + $fields['deleted'] = (int)($this->deleted); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function validateControler($htmlentities = true) + { + $errors = parent::validateControler($htmlentities); + if (!Configuration::get('VATNUMBER_CHECKING')) + return $errors; + include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'); + if (class_exists('VatNumber', false)) + return array_merge($errors, VatNumber::WebServiceCheck($this->vat_number)); + return $errors; + } + /** + * Get zone id for a given address + * + * @param integer $id_address Address id for which we want to get zone id + * @return integer Zone id + */ + public static function getZoneById($id_address) + { + if (isset(self::$_idZones[$id_address])) + return self::$_idZones[$id_address]; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT s.`id_zone` AS id_zone_state, c.`id_zone` + FROM `'._DB_PREFIX_.'address` a + LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country` + LEFT JOIN `'._DB_PREFIX_.'state` s ON s.`id_state` = a.`id_state` + WHERE a.`id_address` = '.(int)($id_address)); + + self::$_idZones[$id_address] = (int)((int)($result['id_zone_state']) ? $result['id_zone_state'] : $result['id_zone']); + return self::$_idZones[$id_address]; + } + + /** + * Check if country is active for a given address + * + * @param integer $id_address Address id for which we want to get country status + * @return integer Country status + */ + public static function isCountryActiveById($id_address) + { + if (!$result = Db::getInstance()->getRow(' + SELECT c.`active` + FROM `'._DB_PREFIX_.'address` a + LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = a.`id_country` + WHERE a.`id_address` = '.(int)($id_address))) + return false; + return ($result['active']); + } + + /** + * Check if address is used (at least one order placed) + * + * @return integer Order count for this address + */ + public function isUsed() + { + $result = Db::getInstance()->getRow(' + SELECT COUNT(`id_order`) AS used + FROM `'._DB_PREFIX_.'orders` + WHERE `id_address_delivery` = '.(int)($this->id).' + OR `id_address_invoice` = '.(int)($this->id)); + + return isset($result['used']) ? $result['used'] : false; + } + + /** + * @param int $id_address + * @return int + * @deprecated + */ + static public function getManufacturerIdByAddress($id_address) + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_manufacturer` FROM `'._DB_PREFIX_.'address` + WHERE `id_address` = '.(int)($id_address)); + return isset($result['id_manufacturer']) ? $result['id_manufacturer'] : false; + } + + static public function getCountryAndState($id_address) + { + if (isset(self::$_idCountries[$id_address])) + return self::$_idCountries[$id_address]; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_country`, `id_state`, `vat_number`, `postcode` FROM `'._DB_PREFIX_.'address` + WHERE `id_address` = '.(int)($id_address)); + self::$_idCountries[$id_address] = $result; + return $result; + } + + /** + * Specify if an address is already in base + * + * @param $id_address Address id + * @return boolean + */ + static public function addressExists($id_address) + { + $row = Db::getInstance()->getRow(' + SELECT `id_address` + FROM '._DB_PREFIX_.'address a + WHERE a.`id_address` = '.(int)($id_address)); + + return isset($row['id_address']); + } + + static public function getFirstCustomerAddressId($id_customer, $active = true) + { + return Db::getInstance()->getValue(' + SELECT `id_address` + FROM `'._DB_PREFIX_.'address` + WHERE `id_customer` = '.(int)($id_customer).' AND `deleted` = 0'.($active ? ' AND `active` = 1' : '') + ); + } +} + diff --git a/classes/AdminTab.php b/classes/AdminTab.php new file mode 100644 index 000000000..1e04cb99d --- /dev/null +++ b/classes/AdminTab.php @@ -0,0 +1,1833 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class AdminTabCore +{ + /** @var integer Tab id */ + public $id = -1; + + /** @var string Associated table name */ + public $table; + + /** @var string Object identifier inside the associated table */ + protected $identifier = false; + + /** @var string Tab name */ + public $name; + + /** @var string Security token */ + public $token; + + /** @var boolean Automatically join language table if true */ + public $lang = false; + + /** @var boolean Tab Automatically displays edit/delete icons if true */ + public $edit = false; + + /** @var boolean Tab Automatically displays view icon if true */ + public $view = false; + + /** @var boolean Tab Automatically displays delete icon if true */ + public $delete = false; + + /** @var boolean Table records are not deleted but marked as deleted */ + public $deleted = false; + + /** @var boolean Tab Automatically displays duplicate icon if true */ + public $duplicate = false; + + /** @var boolean Content line is clickable if true */ + public $noLink = false; + + /** @var boolean select other required fields */ + public $requiredDatabase = false; + + /** @var boolean Tab Automatically displays '$color' as background color on listing if true */ + public $colorOnBackground = false; + + /** @var string Add fields into data query to display list */ + protected $_select; + + /** @var string Join tables into data query to display list */ + protected $_join; + + /** @var string Add conditions into data query to display list */ + protected $_where; + + /** @var string Group rows into data query to display list */ + protected $_group; + + /** @var string Having rows into data query to display list */ + protected $_having; + + /** @var array Name and directory where class image are located */ + public $fieldImageSettings = array(); + + /** @var string Image type */ + public $imageType = 'jpg'; + + /** @var array Fields to display in list */ + public $fieldsDisplay = array(); + + /** @var array Cache for query results */ + protected $_list = array(); + + /** @var integer Number of results in list */ + protected $_listTotal = 0; + + /** @var array WHERE clause determined by filter fields */ + protected $_filter; + + /** @var array Temporary SQL table WHERE clause determinated by filter fields */ + protected $_tmpTableFilter = ''; + + /** @var array Number of results in list per page (used in select field) */ + protected $_pagination = array(20, 50, 100, 300); + + /** @var string ORDER BY clause determined by field/arrows in list header */ + protected $_orderBy; + + /** @var string Default ORDER BY clause when $_orderBy is not defined */ + protected $_defaultOrderBy = false; + + /** @var string Order way (ASC, DESC) determined by arrows in list header */ + protected $_orderWay; + + /** @var integer Max image size for upload */ + protected $maxImageSize = 2000000; + + /** @var array Errors displayed after post processing */ + public $_errors = array(); + + /** @var array Confirmations displayed after post processing */ + protected $_conf; + + /** @var object Object corresponding to the tab */ + protected $_object = false; + + /** @var array tabAccess */ + public $tabAccess; + + /** @var string specificConfirmDelete */ + public $specificConfirmDelete = NULL; + + protected $identifiersDnd = array('id_product' => 'id_product', 'id_category' => 'id_category_to_move','id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms'); + + /** @var bool Redirect or not ater a creation */ + protected $_redirect = true; + + protected $_languages = NULL; + protected $_defaultFormLanguage = NULL; + + protected $_includeObj = array(); + protected $_includeVars = false; + protected $_includeContainer = true; + + public static $tabParenting = array( + 'AdminProducts' => 'AdminCatalog', + 'AdminCategories' => 'AdminCatalog', + 'AdminImageResize' => 'AdminImages', + 'AdminCMS' => 'AdminCMSContent', + 'AdminCMSCategories' => 'AdminCMSContent', + 'AdminOrdersStates' => 'AdminStatuses', + 'AdminAttributeGenerator' => 'AdminProducts', + 'AdminAttributes' => 'AdminAttributesGroups', + 'AdminFeaturesValues' => 'AdminFeatures', + 'AdminReturnStates' => 'AdminStatuses', + 'AdminStatsTab' => 'AdminStats' + ); + + public function __construct() + { + global $cookie; + + $this->id = Tab::getCurrentTabId(); + $this->_conf = array( + 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), + 3 => $this->l('Creation successful'), 4 => $this->l('Update successful'), + 5 => $this->l('Status update successful'), 6 => $this->l('Settings update successful'), + 7 => $this->l('Image successfully deleted'), 8 => $this->l('Module downloaded successfully'), + 9 => $this->l('Thumbnails successfully regenerated'), 10 => $this->l('Message sent to the customer'), + 11 => $this->l('Comment added'), 12 => $this->l('Module installed successfully'), + 13 => $this->l('Module uninstalled successfully'), 14 => $this->l('Language successfully copied'), + 15 => $this->l('Translations successfully added'), 16 => $this->l('Module transplanted successfully to hook'), + 17 => $this->l('Module removed successfully from hook'), 18 => $this->l('Upload successful'), + 19 => $this->l('Duplication completed successfully'), 20 => $this->l('Translation added successfully but the language has not been created'), + 21 => $this->l('Module reset successfully'), 22 => $this->l('Module deleted successfully'), + 23 => $this->l('Localization pack imported successfully'), 24 => $this->l('Refund Successful')); + if (!$this->identifier) $this->identifier = 'id_'.$this->table; + if (!$this->_defaultOrderBy) $this->_defaultOrderBy = $this->identifier; + $className = get_class($this); + if ($className == 'AdminCategories' OR $className == 'AdminProducts') + $className = 'AdminCatalog'; + $this->token = Tools::getAdminToken($className.(int)($this->id).(int)($cookie->id_employee)); + } + + + /** + * use translations files to replace english expression. + * + * @param mixed $string term or expression in english + * @param string $class + * @param boolan $addslashes if set to true, the return value will pass through addslashes(). Otherwise, stripslashes(). + * @param boolean $htmlentities if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8') + * @return string the translation if available, or the english default text. + */ + protected function l($string, $class = 'AdminTab', $addslashes = FALSE, $htmlentities = TRUE) + { + // if the class is extended by a module, use modules/[module_name]/xx.php lang file + $currentClass = get_class($this); + if(Module::getModuleNameFromClass($currentClass)) + { + $string = str_replace('\'', '\\\'', $string); + return Module::findTranslation(Module::$classInModule[$currentClass], $string, $currentClass); + } + global $_LANGADM; + + if ($class == __CLASS__) + $class = 'AdminTab'; + + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (key_exists(get_class($this).$key, $_LANGADM)) ? $_LANGADM[get_class($this).$key] : ((key_exists($class.$key, $_LANGADM)) ? $_LANGADM[$class.$key] : $string); + $str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; + return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str))); + } + + /** + * Manage page display (form, list...) + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function display() + { + global $currentIndex, $cookie; + + // Include other tab in current tab + if ($this->includeSubTab('display', array('submitAdd2', 'add', 'update', 'view'))); + + // Include current tab + elseif ((Tools::getValue('submitAdd'.$this->table) AND sizeof($this->_errors)) OR isset($_GET['add'.$this->table])) + { + if ($this->tabAccess['add'] === '1') + { + $this->displayForm(); + if ($this->tabAccess['view']) + echo '

'.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'
'; + } + else + echo $this->l('You do not have permission to add here'); + } + elseif (isset($_GET['update'.$this->table])) + { + if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $cookie->id_employee == Tools::getValue('id_employee'))) + { + $this->displayForm(); + if ($this->tabAccess['view']) + echo '

'.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'
'; + } + else + echo $this->l('You do not have permission to edit here'); + } + elseif (isset($_GET['view'.$this->table])) + $this->{'view'.$this->table}(); + + else + { + $this->getList((int)($cookie->id_lang)); + $this->displayList(); + $this->displayOptionsList(); + $this->displayRequiredFields(); + $this->includeSubTab('display'); + } + } + + public function displayRequiredFields() + { + global $currentIndex; + if (!$this->tabAccess['add'] OR !$this->tabAccess['delete'] === '1' OR !$this->requiredDatabase) + return; + $rules = call_user_func_array(array($this->className, 'getValidationRules'), array($this->className)); + $required_class_fields = array($this->identifier); + foreach ($rules['required'] AS $required) + $required_class_fields[] = $required; + + + echo '
+ '.$this->l('Advanced parameters...').' + '; + } + + public function includeSubTab($methodname, $actions = array()) + { + if (!isset($this->_includeTab) OR !is_array($this->_includeTab)) + return ; + $key = 0; + foreach ($this->_includeTab as $subtab => $extraVars) + { + /* New tab loading */ + $classname = 'Admin'.$subtab; + if ($module = Db::getInstance()->getValue('SELECT `module` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($classname).'\'') AND file_exists(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php')) + include_once(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php'); + elseif (file_exists(PS_ADMIN_DIR.'/tabs/'.$classname.'.php')) + include_once('tabs/'.$classname.'.php'); + if (!isset($this->_includeObj[$key])) + $this->_includeObj[$key] = new $classname; + $adminTab = $this->_includeObj[$key]; + $adminTab->token = $this->token; + + /* Extra variables addition */ + if (!empty($extraVars) AND is_array($extraVars)) + foreach ($extraVars AS $varKey => $varValue) + $adminTab->$varKey = $varValue; + + /* Actions management */ + foreach ($actions as $action) + { + switch ($action) + { + + case 'submitAdd1': + if (Tools::getValue('submitAdd'.$adminTab->table)) + $ok_inc = true; + break; + case 'submitAdd2': + if (Tools::getValue('submitAdd'.$adminTab->table) AND sizeof($adminTab->_errors)) + $ok_inc = true; + break; + case 'submitDel': + if (Tools::getValue('submitDel'.$adminTab->table)) + $ok_inc = true; + break; + case 'submitFilter': + if (Tools::isSubmit('submitFilter'.$adminTab->table)) + $ok_inc = true; + case 'submitReset': + if (Tools::isSubmit('submitReset'.$adminTab->table)) + $ok_inc = true; + default: + if (isset($_GET[$action.$adminTab->table])) + $ok_inc = true; + } + } + $inc = false; + if ((isset($ok_inc) AND $ok_inc) OR !sizeof($actions)) + { + if (!$adminTab->viewAccess()) + { + echo Tools::displayError('Access denied'); + return false; + } + if (!sizeof($actions)) + if (($methodname == 'displayErrors' AND sizeof($adminTab->_errors)) OR $methodname != 'displayErrors') + echo (isset($this->_includeTabTitle[$key]) ? '

'.$this->_includeTabTitle[$key].'

' : ''); + if ($adminTab->_includeVars) + foreach ($adminTab->_includeVars AS $var => $value) + $adminTab->$var = $this->$value; + $adminTab->$methodname(); + $inc = true; + } + $key++; + } + return $inc; + } + + /** + * Manage page display (form, list...) + * + * @param string $className Allow to validate a different class than the current one + */ + public function validateRules($className = false) + { + if (!$className) + $className = $this->className; + + /* Class specific validation rules */ + $rules = call_user_func(array($className, 'getValidationRules'), $className); + + if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']))) + { + /* Language() instance determined by default language */ + $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); + + /* All availables languages */ + $languages = Language::getLanguages(false); + } + + /* Checking for required fields */ + foreach ($rules['required'] AS $field) + if (($value = Tools::getValue($field)) == false AND (string)$value != '0') + if (!Tools::getValue($this->identifier) OR ($field != 'passwd' AND $field != 'no-picture')) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is required'); + + /* Checking for multilingual required fields */ + foreach ($rules['requiredLang'] AS $fieldLang) + if (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false OR empty($empty)) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' '.$this->l('is required at least in').' '.$defaultLanguage->name; + + /* Checking for maximum fields sizes */ + foreach ($rules['size'] AS $field => $maxLength) + if (Tools::getValue($field) !== false AND Tools::strlen(Tools::getValue($field)) > $maxLength) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; + + /* Checking for maximum multilingual fields size */ + foreach ($rules['sizeLang'] AS $fieldLang => $maxLength) + foreach ($languages AS $language) + if (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false AND Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max, html chars including').')'; + + /* Overload this method for custom checking */ + $this->_childValidation(); + + /* Checking for fields validity */ + foreach ($rules['validate'] AS $field => $function) + if (($value = Tools::getValue($field)) !== false AND ($field != 'passwd')) + if (!Validate::$function($value)) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is invalid'); + + /* Checking for passwd_old validity */ + if (($value = Tools::getValue('passwd')) != false) + { + if ($className == 'Employee' AND !Validate::isPasswdAdmin($value)) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).' '.$this->l('is invalid'); + elseif ($className == 'Customer' AND !Validate::isPasswd($value)) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).' '.$this->l('is invalid'); + } + + /* Checking for multilingual fields validity */ + foreach ($rules['validateLang'] AS $fieldLang => $function) + foreach ($languages AS $language) + if (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false AND !empty($value)) + if (!Validate::$function($value)) + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is invalid'); + } + + /** + * Overload this method for custom checking + */ + protected function _childValidation() { } + + /** + * Overload this method for custom checking + * + * @param integer $id Object id used for deleting images + */ + public function deleteImage($id) + { + $dir = null; + /* Deleting object images and thumbnails (cache) */ + if (key_exists('dir', $this->fieldImageSettings) AND $this->fieldImageSettings['dir'].'/') + { + $dir = $this->fieldImageSettings['dir'].'/'; + if (file_exists(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType)) + return false; + } + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType) AND !unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType)) + return false; + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType) AND !unlink(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType)) + return false; + $types = ImageType::getImagesTypes(); + foreach ($types AS $imageType) + if (file_exists(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType)) + return false; + return true; + } + + /** + * Manage page processing + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function postProcess() + { + global $currentIndex, $cookie; + if (!isset($this->table)) + return false; + + // set token + $token = Tools::getValue('token') ? Tools::getValue('token') : $this->token; + + // Sub included tab postProcessing + $this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset')); + + /* Delete object image */ + if (isset($_GET['deleteImage'])) + { + if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) + if ($this->deleteImage($object->id)) + Tools::redirectAdmin($currentIndex.'&add'.$this->table.'&'.$this->identifier.'='.Tools::getValue($this->identifier).'&conf=7&token='.$token); + $this->_errors[] = Tools::displayError('An error occurred during image deletion (cannot load object).'); + } + + /* Delete object */ + elseif (isset($_GET['delete'.$this->table])) + { + if ($this->tabAccess['delete'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) + { + // check if request at least one object with noZeroObject + if (isset($object->noZeroObject) AND sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1) + $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); + else + { + $this->deleteImage($object->id); + if ($this->deleted) + { + $object->deleted = 1; + if ($object->update()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); + } + elseif ($object->delete()) + Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); + $this->_errors[] = Tools::displayError('An error occurred during deletion.'); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + + /* Change object statuts (active, inactive) */ + elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Validate::isLoadedObject($object = $this->loadObject())) + { + if ($object->toggleStatus()) + Tools::redirectAdmin($currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); + else + $this->_errors[] = Tools::displayError('An error occurred while updating status.'); + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + /* Move an object */ + elseif (isset($_GET['position'])) + { + if ($this->tabAccess['edit'] !== '1') + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + elseif (!Validate::isLoadedObject($object = $this->loadObject())) + $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) + $this->_errors[] = Tools::displayError('Failed to update the position.'); + else + Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.$token); + Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); + } + /* Delete multiple objects */ + elseif (Tools::getValue('submitDel'.$this->table)) + { + if ($this->tabAccess['delete'] === '1') + { + if (isset($_POST[$this->table.'Box'])) + { + $object = new $this->className(); + if (isset($object->noZeroObject) AND + // Check if all object will be deleted + (sizeof(call_user_func(array($this->className, $object->noZeroObject))) <= 1 OR sizeof($_POST[$this->table.'Box']) == sizeof(call_user_func(array($this->className, $object->noZeroObject))))) + $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); + else + { + $result = true; + if ($this->deleted) + { + foreach(Tools::getValue($this->table.'Box') as $id) + { + $toDelete = new $this->className($id); + $toDelete->deleted = 1; + $result = $result AND $toDelete->update(); + } + } + else + $result = $object->deleteSelection(Tools::getValue($this->table.'Box')); + + if ($result) + Tools::redirectAdmin($currentIndex.'&conf=2&token='.$token); + $this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); + } + } + else + $this->_errors[] = Tools::displayError('You must select at least one element to delete.'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); + } + + /* Create or update an object */ + elseif (Tools::getValue('submitAdd'.$this->table)) + { + /* Checking fields validity */ + $this->validateRules(); + if (!sizeof($this->_errors)) + { + $id = (int)(Tools::getValue($this->identifier)); + + /* Object update */ + if (isset($id) AND !empty($id)) + { + if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $cookie->id_employee == Tools::getValue('id_employee') AND Tools::isSubmit('updateemployee'))) + { + $object = new $this->className($id); + if (Validate::isLoadedObject($object)) + { + /* Specific to objects which must not be deleted */ + if ($this->deleted AND $this->beforeDelete($object)) + { + // Create new one with old objet values + $objectNew = new $this->className($object->id); + $objectNew->id = NULL; + $objectNew->date_add = ''; + $objectNew->date_upd = ''; + + // Update old object to deleted + $object->deleted = 1; + $object->update(); + + // Update new object with post values + $this->copyFromPost($objectNew, $this->table); + $result = $objectNew->add(); + if (Validate::isLoadedObject($objectNew)) + $this->afterDelete($objectNew, $object->id); + } + else + { + $this->copyFromPost($object, $this->table); + $result = $object->update(); + $this->afterUpdate($object); + } + if (!$result) + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; + elseif ($this->postImage($object->id) AND !sizeof($this->_errors)) + { + $parent_id = (int)(Tools::getValue('id_parent', 1)); + // Specific back redirect + if ($back = Tools::getValue('back')) + Tools::redirectAdmin(urldecode($back).'&conf=4'); + // Specific scene feature + if (Tools::getValue('stay_here') == 'on' || Tools::getValue('stay_here') == 'true' || Tools::getValue('stay_here') == '1') + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&updatescene&token='.$token); + // Save and stay on same form + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&update'.$this->table.'&token='.$token); + // Save and back to parent + if (Tools::isSubmit('submitAdd'.$this->table.'AndBackToParent')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=4&token='.$token); + // Default behavior (save and back) + Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$token); + } + } + else + $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + + /* Object creation */ + else + { + if ($this->tabAccess['add'] === '1') + { + $object = new $this->className(); + $this->copyFromPost($object, $this->table); + if (!$object->add()) + $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.' ('.mysql_error().')'; + elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND !sizeof($this->_errors) AND $this->_redirect) + { + $parent_id = (int)(Tools::getValue('id_parent', 1)); + $this->afterAdd($object); + // Save and stay on same form + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$token); + // Save and back to parent + if (Tools::isSubmit('submitAdd'.$this->table.'AndBackToParent')) + Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=3&token='.$token); + // Default behavior (save and back) + Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token); + } + } + else + $this->_errors[] = Tools::displayError('You do not have permission to add here.'); + } + } + $this->_errors = array_unique($this->_errors); + } + + /* Cancel all filters for this tab */ + elseif (isset($_POST['submitReset'.$this->table])) + { + $filters = $cookie->getFamily($this->table.'Filter_'); + foreach ($filters AS $cookieKey => $filter) + if (strncmp($cookieKey, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0) + { + $key = substr($cookieKey, 7 + Tools::strlen($this->table)); + /* Table alias could be specified using a ! eg. alias!field */ + $tmpTab = explode('!', $key); + $key = (count($tmpTab) > 1 ? $tmpTab[1] : $tmpTab[0]); + if (array_key_exists($key, $this->fieldsDisplay)) + unset($cookie->$cookieKey); + } + if (isset($cookie->{'submitFilter'.$this->table})) + unset($cookie->{'submitFilter'.$this->table}); + if (isset($cookie->{$this->table.'Orderby'})) + unset($cookie->{$this->table.'Orderby'}); + if (isset($cookie->{$this->table.'Orderway'})) + unset($cookie->{$this->table.'Orderway'}); + unset($_POST); + } + + /* Submit options list */ + elseif (Tools::getValue('submitOptions'.$this->table)) + { + if ($this->tabAccess['edit'] === '1') + { + foreach ($this->_fieldsOptions as $key => $field) + { + if ($field['type'] == 'textLang' OR $field['type'] == 'textareaLang') + { + $languages = Language::getLanguages(false); + $list = array(); + foreach ($languages as $language) + $list[$language['id_lang']] = (isset($field['cast']) ? $field['cast'](Tools::getValue($key.'_'.$language['id_lang'])) : Tools::getValue($key.'_'.$language['id_lang'])); + Configuration::updateValue($key, $list); + } else + Configuration::updateValue($key, (isset($field['cast']) ? $field['cast'](Tools::getValue($key)) : Tools::getValue($key))); + } + Tools::redirectAdmin($currentIndex.'&conf=6&token='.$token); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } + + /* Manage list filtering */ + elseif (Tools::isSubmit('submitFilter'.$this->table) OR $cookie->{'submitFilter'.$this->table} !== false) + { + $_POST = array_merge($cookie->getFamily($this->table.'Filter_'), (isset($_POST) ? $_POST : array())); + foreach ($_POST AS $key => $value) + { + /* Extracting filters from $_POST on key filter_ */ + if ($value != NULL AND !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table))) + { + $key = Tools::substr($key, 7 + Tools::strlen($this->table)); + /* Table alias could be specified using a ! eg. alias!field */ + $tmpTab = explode('!', $key); + $filter = count($tmpTab) > 1 ? $tmpTab[1] : $tmpTab[0]; + if ($field = $this->filterToField($key, $filter)) + { + $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); + if (($type == 'date' OR $type == 'datetime') AND is_string($value)) + $value = unserialize($value); + $key = isset($tmpTab[1]) ? $tmpTab[0].'.`'.$tmpTab[1].'`' : '`'.$tmpTab[0].'`'; + if (array_key_exists('tmpTableFilter', $field)) + $sqlFilter = & $this->_tmpTableFilter; + elseif (array_key_exists('havingFilter', $field)) + $sqlFilter = & $this->_filterHaving; + else + $sqlFilter = & $this->_filter; + + /* Only for date filtering (from, to) */ + if (is_array($value)) + { + if (isset($value[0]) AND !empty($value[0])) + { + if (!Validate::isDate($value[0])) + $this->_errors[] = Tools::displayError('\'from:\' date format is invalid (YYYY-MM-DD)'); + else + $sqlFilter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; + } + + if (isset($value[1]) AND !empty($value[1])) + { + if (!Validate::isDate($value[1])) + $this->_errors[] = Tools::displayError('\'to:\' date format is invalid (YYYY-MM-DD)'); + else + $sqlFilter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; + } + } + else + { + $sqlFilter .= ' AND '; + if ($type == 'int' OR $type == 'bool') + $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`' OR $key == '`active`') ? 'a.' : '').pSQL($key).' = '.(int)($value).' '; + elseif ($type == 'decimal') + $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = '.(float)($value).' '; + elseif ($type == 'select') + $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = \''.pSQL($value).'\' '; + else + $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' LIKE \'%'.pSQL($value).'%\' '; + } + } + } + } + } + elseif(Tools::isSubmit('submitFields') AND $this->requiredDatabase AND $this->tabAccess['add'] === '1' AND $this->tabAccess['delete'] === '1') + { + if (!is_array($fields = Tools::getValue('fieldsBox'))) + $fields = array(); + + $object = new $this->className(); + if (!$object->addFieldsRequiredDatabase($fields)) + $this->_errors[] = Tools::displayError('Error in updating required fields'); + else + Tools::redirectAdmin($currentIndex.'&conf=4&token='.$token); + } + } + + protected function uploadImage($id, $name, $dir, $ext = false) + { + if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name'])) + { + // Delete old image + $this->deleteImage($id); + + // Check image validity + if ($error = checkImage($_FILES[$name], $this->maxImageSize)) + $this->_errors[] = $error; + elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES[$name]['tmp_name'], $tmpName)) + return false; + else + { + $_FILES[$name]['tmp_name'] = $tmpName; + // Copy new image + if (!imageResize($tmpName, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, NULL, NULL, ($ext ? $ext : $this->imageType))) + $this->_errors[] = Tools::displayError('An error occurred while uploading image.'); + if (sizeof($this->_errors)) + return false; + if ($this->afterImageUpload()) + { + unlink($tmpName); + return true; + } + return false; + } + } + return true; + } + + + + protected function uploadIco($name, $dest) + { + + if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name'])) + { + /* Check ico validity */ + if ($error = checkIco($_FILES[$name], $this->maxImageSize)) + $this->_errors[] = $error; + + /* Copy new ico */ + elseif(!copy($_FILES[$name]['tmp_name'], $dest)) + $this->_errors[] = Tools::displayError('an error occurred while uploading favicon: '.$_FILES[$name]['tmp_name'].' to '.$dest); + } + return !sizeof($this->_errors) ? true : false; + } + + /** + * Overload this method for custom checking + * + * @param integer $id Object id used for deleting images + * @return boolean + */ + protected function postImage($id) + { + if (isset($this->fieldImageSettings['name']) AND isset($this->fieldImageSettings['dir'])) + return $this->uploadImage($id, $this->fieldImageSettings['name'], $this->fieldImageSettings['dir'].'/'); + elseif (!empty($this->fieldImageSettings)) + foreach ($this->fieldImageSettings AS $image) + if (isset($image['name']) AND isset($image['dir'])) + $this->uploadImage($id, $image['name'], $image['dir'].'/'); + return !sizeof($this->_errors) ? true : false; + } + + /** + * Copy datas from $_POST to object + * + * @param object &$object Object + * @param string $table Object table + */ + protected function copyFromPost(&$object, $table) + { + /* Classical fields */ + foreach ($_POST AS $key => $value) + if (key_exists($key, $object) AND $key != 'id_'.$table) + { + /* Do not take care of password field if empty */ + if ($key == 'passwd' AND Tools::getValue('id_'.$table) AND empty($value)) + continue; + /* Automatically encrypt password in MD5 */ + if ($key == 'passwd' AND !empty($value)) + $value = Tools::encrypt($value); + $object->{$key} = $value; + } + + /* Multilingual fields */ + $rules = call_user_func(array(get_class($object), 'getValidationRules'), get_class($object)); + if (sizeof($rules['validateLang'])) + { + $languages = Language::getLanguages(false); + foreach ($languages AS $language) + foreach ($rules['validateLang'] AS $field => $validation) + if (isset($_POST[$field.'_'.(int)($language['id_lang'])])) + $object->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])]; + } + } + + /** + * Display errors + */ + public function displayErrors() + { + if ($nbErrors = count($this->_errors) AND $this->_includeContainer) + { + echo ' +
X'; + if (count($this->_errors) == 1) + echo $this->_errors[0]; + else + { + echo $nbErrors.' '.$this->l('errors').'
    '; + foreach ($this->_errors AS $error) + echo '
  1. '.$error.'
  2. '; + echo '
'; + } + echo '
'; + } + $this->includeSubTab('displayErrors'); + } + + /** + * Display a warning message + * + * @param string $warn Warning message to display + */ + public function displayWarning($warn) + { + $str_output = ''; + if (!empty($warn)) + { + $str_output .= ' +
'; + if (!is_array($warn)) + $str_output .= ''.$warn; + else + { $str_output .= 'X'. + (count($warn) > 1 ? $this->l('There are') : $this->l('There is')).' '.count($warn).' '.(count($warn) > 1 ? $this->l('warnings') : $this->l('warning')) + .' + '.$this->l('Click here to see more').' + '; + } + $str_output .= '
'; + } + echo $str_output; + } + + /** + * Display confirmations + */ + public function displayConf() + { + if ($conf = Tools::getValue('conf')) + echo '
+ + '.$this->_conf[(int)($conf)].' +
'; + } + + /** + * Get the current objects' list form the database + * + * @param integer $id_lang Language used for display + * @param string $orderBy ORDER BY clause + * @param string $_orderWay Order way (ASC, DESC) + * @param integer $start Offset in LIMIT clause + * @param integer $limit Row count in LIMIT clause + */ + public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL) + { + global $cookie; + + /* Manage default params values */ + if (empty($limit)) + $limit = ((!isset($cookie->{$this->table.'_pagination'})) ? $this->_pagination[1] : $limit = $cookie->{$this->table.'_pagination'}); + + if (!Validate::isTableOrIdentifier($this->table)) + die (Tools::displayError('Table name is invalid:').' "'.$this->table.'"'); + + if (empty($orderBy)) + $orderBy = $cookie->__get($this->table.'Orderby') ? $cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy; + if (empty($orderWay)) + $orderWay = $cookie->__get($this->table.'Orderway') ? $cookie->__get($this->table.'Orderway') : 'ASC'; + + $limit = (int)(Tools::getValue('pagination', $limit)); + $cookie->{$this->table.'_pagination'} = $limit; + + /* Check params validity */ + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay) + OR !is_numeric($start) OR !is_numeric($limit) + OR !Validate::isUnsignedId($id_lang)) + die(Tools::displayError('get list params is not valid')); + + /* Determine offset from current page */ + if ((isset($_POST['submitFilter'.$this->table]) OR + isset($_POST['submitFilter'.$this->table.'_x']) OR + isset($_POST['submitFilter'.$this->table.'_y'])) AND + !empty($_POST['submitFilter'.$this->table]) AND + is_numeric($_POST['submitFilter'.$this->table])) + $start = (int)($_POST['submitFilter'.$this->table] - 1) * $limit; + + /* Cache */ + $this->_lang = (int)($id_lang); + $this->_orderBy = $orderBy; + $this->_orderWay = Tools::strtoupper($orderWay); + + /* SQL table : orders, but class name is Order */ + $sqlTable = $this->table == 'order' ? 'orders' : $this->table; + + /* Query in order to get results with all fields */ + $sql = 'SELECT SQL_CALC_FOUND_ROWS + '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '').' + '.($this->lang ? 'b.*, ' : '').'a.*'.(isset($this->_select) ? ', '.$this->_select.' ' : '').' + FROM `'._DB_PREFIX_.$sqlTable.'` a + '.($this->lang ? 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`'.$this->identifier.'` = a.`'.$this->identifier.'` AND b.`id_lang` = '.(int)($id_lang).')' : '').' + '.(isset($this->_join) ? $this->_join.' ' : '').' + WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').($this->deleted ? 'AND a.`deleted` = 0 ' : '').(isset($this->_filter) ? $this->_filter : '').' + '.(isset($this->_group) ? $this->_group.' ' : '').' + '.((isset($this->_filterHaving) || isset($this->_having)) ? 'HAVING ' : '').(isset($this->_filterHaving) ? ltrim($this->_filterHaving, ' AND ') : '').(isset($this->_having) ? $this->_having.' ' : '').' + ORDER BY '.(($orderBy == $this->identifier) ? 'a.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay). + ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : '').' + LIMIT '.(int)($start).','.(int)($limit); + + $this->_list = Db::getInstance()->ExecuteS($sql); + $this->_listTotal = count(Db::getInstance()->ExecuteS('SELECT + '.($this->_tmpTableFilter ? ' * FROM (SELECT ' : '').' + '.($this->lang ? 'b.*, ' : '').'a.*'.(isset($this->_select) ? ', '.$this->_select.' ' : '').' + FROM `'._DB_PREFIX_.$sqlTable.'` a + '.($this->lang ? 'LEFT JOIN `'._DB_PREFIX_.$this->table.'_lang` b ON (b.`'.$this->identifier.'` = a.`'.$this->identifier.'` AND b.`id_lang` = '.(int)($id_lang).')' : '').' + '.(isset($this->_join) ? $this->_join.' ' : '').' + WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').($this->deleted ? 'AND a.`deleted` = 0 ' : '').(isset($this->_filter) ? $this->_filter : '').' + '.(isset($this->_group) ? $this->_group.' ' : '').' + '.((isset($this->_filterHaving) || isset($this->_having)) ? 'HAVING ' : '').(isset($this->_filterHaving) ? ltrim($this->_filterHaving, ' AND ') : '').(isset($this->_having) ? $this->_having.' ' : '').' + ORDER BY '.(($orderBy == $this->identifier) ? 'a.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay). + ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : ''))); + + + } + + /** + * Display image aside object form + * + * @param integer $id Object id + * @param string $image Local image filepath + * @param integer $size Image width + * @param integer $id_image Image id (for products with several images) + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayImage($id, $image, $size, $id_image = NULL, $token = NULL) + { + global $currentIndex; + + if (!isset($token) OR empty($token)) + $token = $this->token; + if ($id AND file_exists($image)) + echo ' +
+ '.cacheImage($image, $this->table.'_'.(int)($id).'.'.$this->imageType, $size, $this->imageType).' +

'.$this->l('File size').' '.(filesize($image) / 1000).'kb

+ + '.$this->l('Delete').' '.$this->l('Delete').' +
'; + } + + /** + * Display list header (filtering, pagination and column names) + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayListHeader($token = NULL) + { + global $currentIndex, $cookie; + $isCms = false; + if (preg_match('/cms/Ui', $this->identifier)) + $isCms = true; + $id_cat = Tools::getValue('id_'.($isCms ? 'cms_' : '').'category'); + + if (!isset($token) OR empty($token)) + $token = $this->token; + + /* Determine total page number */ + $totalPages = ceil($this->_listTotal / Tools::getValue('pagination', (isset($cookie->{$this->table.'_pagination'}) ? $cookie->{$this->table.'_pagination'} : $this->_pagination[0]))); + if (!$totalPages) $totalPages = 1; + + echo ' '; + echo ' + + + + + + + + + '; + foreach ($this->fieldsDisplay AS $key => $params) + { + echo ' '; + } + + /* Check if object can be modified, deleted or detailed */ + if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + echo ' '; + echo ' + + '; + + /* Javascript hack in order to catch ENTER keypress event */ + $keyPress = 'onkeypress="formSubmit(event, \'submitFilterButton_'.$this->table.'\');"'; + + /* Filters (input, select, date or bool) */ + foreach ($this->fieldsDisplay AS $key => $params) + { + $width = (isset($params['width']) ? ' style="width: '.(int)($params['width']).'px;"' : ''); + echo ''; + if (!isset($params['type'])) + $params['type'] = 'text'; + + $value = Tools::getValue($this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)); + if (isset($params['search']) AND !$params['search']) + { + echo '--'; + continue; + } + switch ($params['type']) + { + case 'bool': + echo ' + '; + break; + + case 'date': + case 'datetime': + if (is_string($value)) + $value = unserialize($value); + $name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key); + $nameId = str_replace('!', '__', $name); + includeDatepicker(array($nameId.'_0', $nameId.'_1')); + echo $this->l('From').'
+ '.$this->l('To').' '; + break; + + case 'select': + + if (isset($params['filter_key'])) + { + echo ''; + break; + } + + case 'text': + default: + echo ''; + } + echo ''; + } + + if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + echo '
'; + + echo ' + '; + } + + public function displayTop() + { + } + + /** + * Display list + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayList() + { + global $currentIndex; + + $this->displayTop(); + + if ($this->edit AND (!isset($this->noAdd) OR !$this->noAdd)) + echo '
'.$this->l('Add new').'

'; + /* Append when we get a syntax error in SQL query */ + if ($this->_list === false) + { + $this->displayWarning($this->l('Bad SQL query')); + return false; + } + + /* Display list header (filtering, pagination and column names) */ + $this->displayListHeader(); + if (!sizeof($this->_list)) + echo ''; + + /* Show the content of the table */ + $this->displayListContent(); + + /* Close list table and submit button */ + $this->displayListFooter(); + } + + public function displayListContent($token = NULL) + { + /* Display results in a table + * + * align : determine value alignment + * prefix : displayed before value + * suffix : displayed after value + * image : object image + * icon : icon determined by values + * active : allow to toggle status + */ + + global $currentIndex, $cookie; + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + + $id_category = 1; // default categ + + $irow = 0; + if ($this->_list AND isset($this->fieldsDisplay['position'])) + { + $positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list); + sort($positions); + } + if ($this->_list) + { + $isCms = false; + if (preg_match('/cms/Ui', $this->identifier)) + $isCms = true; + $keyToGet = 'id_'.($isCms ? 'cms_' : '').'category'.(in_array($this->identifier, array('id_category', 'id_cms_category')) ? '_parent' : ''); + foreach ($this->_list AS $i => $tr) + { + $id = $tr[$this->identifier]; + echo 'identifier,$this->identifiersDnd) ? ' id="tr_'.(($id_category = (int)(Tools::getValue('id_'.($isCms ? 'cms_' : '').'category', '1'))) ? $id_category : '').'_'.$id.'_'.$tr['position'].'"' : '').($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($tr['color']) AND $this->colorOnBackground) ? 'style="background-color: '.$tr['color'].'"' : '').'> + '; + foreach ($this->fieldsDisplay AS $key => $params) + { + $tmp = explode('!', $key); + $key = isset($tmp[1]) ? $tmp[1] : $tmp[0]; + echo ' + '; + } + + if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + { + echo ''; + } + echo ''; + } + } + } + + + protected function _displayEnableLink($token, $id, $value, $active, $id_category = NULL, $id_product = NULL) + { + global $currentIndex; + + echo ' + '.($value ? $this->l('Enabled') : $this->l('Disabled')).''; + } + + protected function _displayDuplicate($token = NULL, $id) + { + global $currentIndex; + + $_cacheLang['Duplicate'] = $this->l('Duplicate'); + $_cacheLang['Copy images too?'] = $this->l('Copy images too?', __CLASS__, TRUE, FALSE); + + $duplicate = $currentIndex.'&'.$this->identifier.'='.$id.'&duplicate'.$this->table; + + echo ' + + '.$_cacheLang['Duplicate'].''; + } + + protected function _displayViewLink($token = NULL, $id) + { + global $currentIndex; + + $_cacheLang['View'] = $this->l('View'); + + echo ' + + '.$_cacheLang['View'].''; + } + + protected function _displayEditLink($token = NULL, $id) + { + global $currentIndex; + + $_cacheLang['Edit'] = $this->l('Edit'); + + echo ' + + '; + } + + protected function _displayDeleteLink($token = NULL, $id) + { + global $currentIndex; + + $_cacheLang['Delete'] = $this->l('Delete'); + $_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, TRUE, FALSE); + + echo ' + + '.$_cacheLang['Delete'].''; + } + + /** + * Close list table and submit button + */ + public function displayListFooter($token = NULL) + { + echo '
+ '; + + /* Determine current page number */ + $page = (int)(Tools::getValue('submitFilter'.$this->table)); + if (!$page) $page = 1; + if ($page > 1) + echo ' + +   '; + echo $this->l('Page').' '.$page.' / '.$totalPages; + if ($page < $totalPages) + echo ' + +  '; + echo ' | '.$this->l('Display').' + + / '.(int)($this->_listTotal).' '.$this->l('result(s)').' + + + + + + +
'; + + /* Display column names and arrows for ordering (ASC, DESC) */ + if (array_key_exists($this->identifier,$this->identifiersDnd) AND $this->_orderBy == 'position') + { + echo ' + + + + '; + } + echo 'identifier,$this->identifiersDnd) ? ' id="'.(($id_category = (int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) ? substr($this->identifier,3,strlen($this->identifier)) : '').'"' : '' ).' class="table'.((array_key_exists($this->identifier,$this->identifiersDnd) AND ($this->_orderBy != 'position 'AND $this->_orderWay != 'DESC')) ? ' tableDnD' : '' ).'" cellpadding="0" cellspacing="0"> +
'; + if ($this->delete) + echo ' '; + echo ' '.$params['title']; + if (!isset($params['orderby']) OR $params['orderby']) + { + // Cleaning links + if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway')) + $currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', $currentIndex); + echo '
+ + '; + } + echo '
'.$this->l('Actions').'
'; + if ($this->delete) + echo ' --'; + echo ' --
'.$this->l('No items found').'
'; + if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete))) + echo ''; + echo 'noLink) OR !$this->noLink)) + echo ' onclick="document.location = \''.$currentIndex.'&'.$this->identifier.'='.$id.($this->view? '&view' : '&update').$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'">'.(isset($params['prefix']) ? $params['prefix'] : ''); + else + echo '>'; + if (isset($params['active']) AND isset($tr[$key])) + $this->_displayEnableLink($token, $id, $tr[$key], $params['active'], Tools::getValue('id_category'), Tools::getValue('id_product')); + elseif (isset($params['activeVisu']) AND isset($tr[$key])) + echo ''.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).''; + elseif (isset($params['position'])) + { + if ($this->_orderBy == 'position' AND $this->_orderWay != 'DESC') + { + echo ' + '.$this->l('Down').''; + + echo ' + '.$this->l('Up').''; } + else + echo (int)($tr[$key] + 1); + } + elseif (isset($params['image'])) + { + $image_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id; + echo cacheImage(_PS_IMG_DIR_.$params['image'].'/'.$image_id.(isset($tr['id_image']) ? '-'.(int)($tr['id_image']) : '').'.'.$this->imageType, $this->table.'_mini_'.$image_id.'.'.$this->imageType, 45, $this->imageType); + } + elseif (isset($params['icon']) AND (isset($params['icon'][$tr[$key]]) OR isset($params['icon']['default']))) + echo ''.$tr[$key]).''; + elseif (isset($params['price'])) + echo Tools::displayPrice($tr[$key], (isset($params['currency']) ? Currency::getCurrencyInstance((int)($tr['id_currency'])) : $currency), false, false); + elseif (isset($params['float'])) + echo rtrim(rtrim($tr[$key], '0'), '.'); + elseif (isset($params['type']) AND $params['type'] == 'date') + echo Tools::displayDate($tr[$key], $cookie->id_lang); + elseif (isset($params['type']) AND $params['type'] == 'datetime') + echo Tools::displayDate($tr[$key], $cookie->id_lang, true); + elseif (isset($tr[$key])) + { + $echo = ($key == 'price' ? round($tr[$key], 2) : isset($params['maxlength']) ? Tools::substr($tr[$key], 0, $params['maxlength']).'...' : $tr[$key]); + echo isset($params['callback']) ? call_user_func_array(array($this->className, $params['callback']), array($echo, $tr)) : $echo; + } + else + echo '--'; + + echo (isset($params['suffix']) ? $params['suffix'] : ''). + ''; + if ($this->view) + $this->_displayViewLink($token, $id); + if ($this->edit) + $this->_displayEditLink($token, $id); + if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete))) + $this->_displayDeleteLink($token, $id); + if ($this->duplicate) + $this->_displayDuplicate($token, $id); + echo '
'; + if ($this->delete) + echo '

'; + echo ' + + + + + '; + if (isset($this->_includeTab) AND sizeof($this->_includeTab)) + echo '

'; + } + + /** + * Options lists + */ + public function displayOptionsList() + { + global $currentIndex, $cookie, $tab; + + if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions)) + return ; + + $defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT'); + $this->_languages = Language::getLanguages(false); + $tab = Tab::getTab((int)$cookie->id_lang, Tab::getIdFromClassName($tab)); + echo '

'; + echo (isset($this->optionTitle) ? '

'.$this->optionTitle.'

' : ''); + echo ' + +
+
'; + echo (isset($this->optionTitle) ? ' + ' + .$this->optionTitle.'' : ''); + foreach ($this->_fieldsOptions AS $key => $field) + { + $val = Tools::getValue($key, Configuration::get($key)); + echo ' +
'; + switch ($field['type']) + { + case 'select': + echo ''; + break; + case 'bool': + echo ' + + + + + '; + break; + case 'textLang': + foreach ($this->_languages as $language) + { + $val = Tools::getValue($key.'_'.$language['id_lang'], Configuration::get($key, $language['id_lang'])); + echo ' +
+ +
'; + } + $this->displayFlags($this->_languages, $defaultLanguage, $key, $key); + echo '
'; + break; + case 'textareaLang': + foreach ($this->_languages as $language) + { + $val = Configuration::get($key, $language['id_lang']); + echo ' +
+ +
'; + } + $this->displayFlags($this->_languages, $defaultLanguage, $key, $key); + echo '
'; + break; + case 'text': + default: + echo ''.(isset($field['suffix']) ? $field['suffix'] : ''); + } + + if (isset($field['required']) AND $field['required']) + echo ' *'; + + echo (isset($field['desc']) ? '

'.$field['desc'].'

' : ''); + echo '
'; + } + echo '
+ +
+
+ +
'; + } + + /** + * Load class object using identifier in $_GET (if possible) + * otherwise return an empty object, or die + * + * @param boolean $opt Return an empty object if load fail + * @return object + */ + protected function loadObject($opt = false) + { + if ($id = (int)(Tools::getValue($this->identifier)) AND Validate::isUnsignedId($id)) + { + if (!$this->_object) + $this->_object = new $this->className($id); + if (Validate::isLoadedObject($this->_object)) + return $this->_object; + $this->_errors[] = Tools::displayError('Object cannot be loaded (not found)'); + } + elseif ($opt) + { + $this->_object = new $this->className(); + return $this->_object; + } + else + $this->_errors[] = Tools::displayError('Object cannot be loaded (identifier missing or invalid)'); + + $this->displayErrors(); + } + + /** + * Return field value if possible (both classical and multilingual fields) + * + * Case 1 : Return value if present in $_POST / $_GET + * Case 2 : Return object value + * + * @param object $obj Object + * @param string $key Field name + * @param integer $id_lang Language id (optional) + * @return string + */ + protected function getFieldValue($obj, $key, $id_lang = NULL) + { + if ($id_lang) + $defaultValue = ($obj->id AND isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : ''; + else + $defaultValue = isset($obj->{$key}) ? $obj->{$key} : ''; + + return Tools::getValue($key.($id_lang ? '_'.$id_lang : ''), $defaultValue); + } + + /** + * Display form + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function displayForm($firstCall = true) + { + global $cookie; + + $allowEmployeeFormLang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; + if ($allowEmployeeFormLang && !$cookie->employee_form_lang) + $cookie->employee_form_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + $useLangFromCookie = false; + $this->_languages = Language::getLanguages(false); + if ($allowEmployeeFormLang) + foreach ($this->_languages AS $lang) + if ($cookie->employee_form_lang == $lang['id_lang']) + $useLangFromCookie = true; + if (!$useLangFromCookie) + $this->_defaultFormLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + else + $this->_defaultFormLanguage = (int)($cookie->employee_form_lang); + + // Only if it is the first call to displayForm, otherwise it has already been defined + if ($firstCall) + { + echo ' + '; + } + } + + /** + * Display object details + * + * @global string $currentIndex Current URL in order to keep current Tab + */ + public function viewDetails() { global $currentIndex; } + + /** + * Called before deletion + * + * @param object $object Object + * @return boolean + */ + protected function beforeDelete($object) { return true; } + + /** + * Called before deletion + * + * @param object $object Object + * @return boolean + */ + protected function afterDelete($object, $oldId) { return true; } + + protected function afterAdd($object) { return true; } + + protected function afterUpdate($object) { return true; } + + /** + * Check rights to view the current tab + * + * @return boolean + */ + + protected function afterImageUpload() { + return true; + } + + /** + * Check rights to view the current tab + * + * @return boolean + */ + + public function viewAccess($disable = false) + { + global $cookie; + + if ($disable) + return true; + + $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); + + if ($this->tabAccess['view'] === '1') + return true; + return false; + } + + /** + * Check for security token + */ + public function checkToken() + { + $token = Tools::getValue('token'); + return (!empty($token) AND $token === $this->token); + } + + /** + * Display flags in forms for translations + * + * @param array $languages All languages available + * @param integer $defaultLanguage Default language id + * @param string $ids Multilingual div ids in form + * @param string $id Current div id] + * #param boolean $return define the return way : false for a display, true for a return + */ + public function displayFlags($languages, $defaultLanguage, $ids, $id, $return = false) + { + if (sizeof($languages) == 1) + return false; + $defaultIso = Language::getIsoById($defaultLanguage); + $output = ' +
+ +
+
+ '.$this->l('Choose language:').'

'; + foreach ($languages as $language) + $output .= ''.$language['name'].' '; + $output .= '
'; + + if ($return) + return $output; + echo $output; + } + + protected function filterToField($key, $filter) + { + foreach ($this->fieldsDisplay AS $field) + if (array_key_exists('filter_key', $field) AND $field['filter_key'] == $key) + return $field; + if (array_key_exists($filter, $this->fieldsDisplay)) + return $this->fieldsDisplay[$filter]; + return false; + } +} + diff --git a/classes/Alias.php b/classes/Alias.php new file mode 100644 index 000000000..8c40cea3a --- /dev/null +++ b/classes/Alias.php @@ -0,0 +1,95 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AliasCore extends ObjectModel +{ + public $alias; + public $search; + public $active = true; + + protected $fieldsRequired = array('alias', 'search'); + protected $fieldsSize = array('alias' => 255, 'search' => 255); + protected $fieldsValidate = array('search' => 'isValidSearch', 'alias' => 'isValidSearch', 'active' => 'isBool'); + + protected $table = 'alias'; + protected $identifier = 'id_alias'; + + function __construct($id = NULL, $alias = NULL, $search = NULL, $id_lang = NULL) + { + if ($id) + parent::__construct($id); + elseif ($alias AND Validate::isValidSearch($alias)) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT a.id_alias, a.search, a.alias + FROM `'._DB_PREFIX_.'alias` a + WHERE `alias` LIKE \''.pSQL($alias).'\' AND `active` = 1'); + + if ($row) + { + $this->id = (int)($row['id_alias']); + $this->search = $search ? trim($search) : $row['search']; + $this->alias = $row['alias']; + } + else + { + $this->alias = trim($alias); + $this->search = trim($search); + } + } + } + + static public function deleteAliases($search) + { + return Db::getInstance()->Execute(' + DELETE + FROM `'._DB_PREFIX_.'alias` + WHERE `search` LIKE \''.pSQL($search).'\''); + } + + public function getAliases() + { + $aliases = Db::getInstance()->ExecuteS(' + SELECT a.alias + FROM `'._DB_PREFIX_.'alias` a + WHERE `search` = \''.pSQL($this->search).'\''); + + $aliases = array_map('implode', $aliases); + return implode(', ', $aliases); + } + + public function getFields() + { + parent::validateFields(); + + $fields['alias'] = pSQL($this->alias); + $fields['search'] = pSQL($this->search); + $fields['active'] = (int)($this->active); + return $fields; + } +} + diff --git a/classes/Attachment.php b/classes/Attachment.php new file mode 100644 index 000000000..9c7c5744f --- /dev/null +++ b/classes/Attachment.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AttachmentCore extends ObjectModel +{ + public $file; + public $file_name; + public $name; + public $mime; + public $description; + + /** @var integer position */ + public $position; + + protected $fieldsRequired = array('file', 'mime'); + protected $fieldsSize = array('file' => 40, 'mime' => 64, 'file_name' => 128); + protected $fieldsValidate = array('file' => 'isGenericName', 'mime' => 'isCleanHtml', 'file_name' => 'isGenericName'); + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml'); + + protected $table = 'attachment'; + protected $identifier = 'id_attachment'; + + public function getFields() + { + parent::validateFields(); + $fields['file_name'] = pSQL($this->file_name); + $fields['file'] = pSQL($this->file); + $fields['mime'] = pSQL($this->mime); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'description')); + } + + public function delete() + { + @unlink(_PS_DOWNLOAD_DIR_.$this->file); + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_attachment WHERE id_attachment = '.(int)($this->id)); + return parent::delete(); + } + + public function deleteSelection($attachments) + { + $return = 1; + foreach ($attachments AS $id_attachment) + { + $attachment = new Attachment((int)($id_attachment)); + $return &= $attachment->delete(); + } + return $return; + } + + public static function getAttachments($id_lang, $id_product, $include = true) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'attachment a + LEFT JOIN '._DB_PREFIX_.'attachment_lang al ON (a.id_attachment = al.id_attachment AND al.id_lang = '.(int)($id_lang).') + WHERE a.id_attachment '.($include ? 'IN' : 'NOT IN').' (SELECT pa.id_attachment FROM '._DB_PREFIX_.'product_attachment pa WHERE id_product = '.(int)($id_product).')'); + } + + public static function attachToProduct($id_product, $array) + { + $result1 = Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)($id_product)); + if (is_array($array)) + { + $ids = array(); + foreach ($array as $id_attachment) + $ids[] = '('.(int)($id_product).','.(int)($id_attachment).')'; + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_has_attachments = '.(count($ids) ? '1' : '0').' WHERE id_product = '.(int)($id_product).' LIMIT 1'); + return ($result1 && Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'product_attachment (id_product, id_attachment) VALUES '.implode(',',$ids))); + } + return $result1; + } +} + diff --git a/classes/Attribute.php b/classes/Attribute.php new file mode 100644 index 000000000..0282a74fa --- /dev/null +++ b/classes/Attribute.php @@ -0,0 +1,201 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AttributeCore extends ObjectModel +{ + /** @var integer Group id which attribute belongs */ + public $id_attribute_group; + + /** @var string Name */ + public $name; + public $color; + + public $default; + + protected $fieldsRequired = array('id_attribute_group'); + protected $fieldsValidate = array('id_attribute_group' => 'isUnsignedId', 'color' => 'isColor'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 64); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'attribute'; + protected $identifier = 'id_attribute'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'product_option_values', + 'objectNodeName' => 'product_option_value', + 'fields' => array( + 'id_attribute_group' => array('xlink_resource'=> 'product_options'), + 'default' => array(), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_attribute_group'] = (int)($this->id_attribute_group); + $fields['color'] = pSQL($this->color); + + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + public function delete() + { + if (($result = Db::getInstance()->ExecuteS('SELECT `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute_combination` WHERE `'.$this->identifier.'` = '.(int)($this->id))) === false) + return false; + $combinationIds = array(); + if (Db::getInstance()->numRows()) + { + foreach ($result AS $row) + $combinationIds[] = (int)($row['id_product_attribute']); + if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` WHERE `'.$this->identifier.'` = '.(int)($this->id)) === false) + return false; + if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` IN ('.implode(', ', $combinationIds).')') === false) + return false; + } + return parent::delete(); + } + + /** + * Get all attributes for a given language + * + * @param integer $id_lang Language id + * @param boolean $notNull Get only not null fields if true + * @return array Attributes + */ + static public function getAttributes($id_lang, $notNull = false) + { + return Db::getInstance()->ExecuteS(' + SELECT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group` + FROM `'._DB_PREFIX_.'attribute_group` ag + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute_group` = ag.`id_attribute_group` + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).') + '.($notNull ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL' : '').' + ORDER BY agl.`name` ASC, al.`name` ASC'); + } + + /** + * Get quantity for a given attribute combinaison + * Check if quantity is enough to deserve customer + * + * @param integer $id_product_attribute Product attribute combinaison id + * @param integer $qty Quantity needed + * @return boolean Quantity is available or not + */ + static public function checkAttributeQty($id_product_attribute, $qty) + { + $result = Db::getInstance()->getRow(' + SELECT `quantity` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + + return ($result AND ($qty <= $result['quantity'])); + } + + /** + * Get quantity for product with attributes quantity + * + * @acces public static + * @param integer $id_product + * @return mixed Quantity or false + */ + static public function getAttributeQty($id_product) + { + $row = Db::getInstance()->getRow(' + SELECT SUM(quantity) as quantity + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($id_product)); + + if ($row['quantity'] !== NULL) + return (int)($row['quantity']); + return false; + } + + /** + * Update array with veritable quantity + * + * @acces public static + * @param array &$arr + * return bool + */ + static public function updateQtyProduct(&$arr) + { + $id_product = (int)($arr['id_product']); + $qty = self::getAttributeQty($id_product); + + if ($qty !== false) + { + $arr['quantity'] = (int)($qty); + return true; + } + return false; + } + + public function isColorAttribute() + { + if (!Db::getInstance()->getRow(' + SELECT `is_color_group` FROM `'._DB_PREFIX_.'attribute_group` WHERE `id_attribute_group` = ( + SELECT `id_attribute_group` FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute` = '.(int)($this->id).') + AND is_color_group = 1')) + return false; + return Db::getInstance()->NumRows(); + } + + /** + * Get minimal quantity for product with attributes quantity + * + * @acces public static + * @param integer $id_product_attribute + * @return mixed Minimal Quantity or false + */ + static public function getAttributeMinimalQty($id_product_attribute) + { + $row = Db::getInstance()->getValue(' + SELECT minimal_quantity + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + + if ($row['quantity'] !== NULL) + return (int)($row['quantity']); + return false; + } + +} + diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php new file mode 100644 index 000000000..140021ea0 --- /dev/null +++ b/classes/AttributeGroup.php @@ -0,0 +1,195 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AttributeGroupCore extends ObjectModel +{ + /** @var string Name */ + public $name; + public $is_color_group; + + /** @var string Public Name */ + public $public_name; + + protected $fieldsRequired = array(); + protected $fieldsValidate = array('is_color_group' => 'isBool'); + protected $fieldsRequiredLang = array('name', 'public_name'); + protected $fieldsSizeLang = array('name' => 64, 'public_name' => 64); + protected $fieldsValidateLang = array('name' => 'isGenericName', 'public_name' => 'isGenericName'); + + protected $table = 'attribute_group'; + protected $identifier = 'id_attribute_group'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'product_options', + 'objectNodeName' => 'product_option', + 'fields' => array(), + 'associations' => array( + 'product_option_values' => array('resource' => 'product_option_value', + 'fields' => array( + 'id' => array(), + ), + ), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['is_color_group'] = (int)($this->is_color_group); + + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + return parent::add($autodate, true); + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'public_name')); + } + + static public function cleanDeadCombinations() + { + $attributeCombinations = Db::getInstance()->ExecuteS('SELECT pac.`id_attribute`, pa.`id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` pa LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pa.`id_product_attribute` = pac.`id_product_attribute`)'); + $toRemove = array(); + foreach ($attributeCombinations AS $attributeCombination) + if ((int)($attributeCombination['id_attribute']) == 0) + $toRemove[] = (int)($attributeCombination['id_product_attribute']); + if (!empty($toRemove) AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` IN ('.implode(', ', $toRemove).')') === false) + return false; + return true; + } + + public function delete() + { + /* Select children in order to find linked combinations */ + $attributeIds = Db::getInstance()->ExecuteS('SELECT `id_attribute` FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)($this->id)); + if ($attributeIds === false) + return false; + /* Removing attributes to the found combinations */ + $toRemove = array(); + foreach ($attributeIds AS $attribute) + $toRemove[] = (int)($attribute['id_attribute']); + if (!empty($toRemove) AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` WHERE `id_attribute` IN ('.implode(', ', $toRemove).')') === false) + return false; + /* Remove combinations if they do not possess attributes anymore */ + if (!self::cleanDeadCombinations()) + return false; + /* Also delete related attributes */ + if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'attribute_lang` WHERE `id_attribute` IN (SELECT id_attribute FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)($this->id).')') === false OR Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)($this->id)) === false) + return false; + return parent::delete(); + } + + /** + * Get all attributes for a given language / group + * + * @param integer $id_lang Language id + * @param boolean $id_attribute_group Attribute group id + * @return array Attributes + */ + static public function getAttributes($id_lang, $id_attribute_group) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'attribute` a + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).') + WHERE a.`id_attribute_group` = '.(int)($id_attribute_group).' + ORDER BY `name`'); + } + + /** + * Get all attributes groups for a given language + * + * @param integer $id_lang Language id + * @return array Attributes groups + */ + static public function getAttributesGroups($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'attribute_group` ag + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND `id_lang` = '.(int)($id_lang).') + ORDER BY `name` ASC'); + } + + /** + * Delete several objects from database + * + * return boolean Deletion result + */ + public function deleteSelection($selection) + { + /* Also delete Attributes */ + foreach ($selection AS $value) { + $obj = new AttributeGroup($value); + if (!$obj->delete()) + return false; + } + return true; + } + + public function setWsProductOptionValues($values) + { + $ids = array(); + foreach ($values as $value) + $ids[] = intval($value['id']); + $result = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'attribute` + WHERE `id_attribute_group` = '.(int)$this->id.' + AND `id_attribute` NOT IN ('.implode(',', $ids).')' + ); + $ok = true; + foreach ($values as $value) + { + $result = Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'attribute` + SET `id_attribute_group` = '.(int)$this->id.' + WHERE `id_attribute` = '.(int)$value['id'] + ); + if ($result === false) + $ok = false; + } + return $ok; + } + + public function getWsProductOptionValues() + { + $result = Db::getInstance()->executeS('SELECT id_attribute AS id from `'._DB_PREFIX_.'attribute` WHERE id_attribute_group = '.(int)$this->id); + return $result; + } +} + diff --git a/classes/Backup.php b/classes/Backup.php new file mode 100644 index 000000000..6f3144b69 --- /dev/null +++ b/classes/Backup.php @@ -0,0 +1,249 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class BackupCore +{ + /** @var integer Object id */ + public $id; + + /** @var string Last error messages */ + public $error; + + /** + * Creates a new backup object + * + * @param string $filename Filename of the backup file + */ + public function __construct($filename = NULL) + { + if ($filename) + $this->id = self::getBackupPath($filename); + } + + /** + * Get the full path of the backup file + * + * @param string $filename Filename of the backup file + * @return The full path of the backup file, or false if the backup file does not exists + */ + public static function getBackupPath($filename) + { + $backupdir = realpath(PS_ADMIN_DIR.'/backups/'); + + if ($backupdir === false) + die(Tools::displayError('Backups directory does not exist.')); + + // Check the realpath so we can validate the backup file is under the backup directory + $backupfile = realpath($backupdir.'/'.$filename); + if ($backupfile === false OR strncmp($backupdir, $backupfile, strlen($backupdir)) != 0) + die (Tools::displayError()); + + return $backupfile; + } + + /** + * Get the URL used to retreive this backup file + * + * @return The url used to request the backup file + */ + public function getBackupURL() + { + $adminDir = __PS_BASE_URI__.substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__) ); + $adminDir = substr($adminDir, 0, strrpos($adminDir, '/')); + + return $adminDir.'/backup.php?filename='.basename($this->id); + } + + /** + * Delete the current backup file + * + * @return boolean Deletion result, true on success + */ + public function delete() + { + if (!$this->id || !unlink($this->id)) + { + $this->error = Tools::displayError('Error deleting').' '.($this->id ? '"'.$this->id.'"' : Tools::displayError('Invalid ID')); + return false; + } + return true; + } + + /** + * Deletes a range of backup files + * + * @return boolean True on success + */ + public function deleteSelection($list) + { + foreach ($list as $file) + { + $backup = new Backup($file); + if (!$backup->delete()) + { + $this->error = $backup->error; + return false; + } + } + return true; + } + + /** + * Creates a new backup file + * + * @return boolean true on successful backup + */ + public function add() + { + if ( _DB_TYPE_ !== 'MySQL' ) + { + $this->error = Tools::displayError('Sorry, backup currently only supports MySQL database types. You are using') . ' "' . _DB_TYPE_ . '"'; + return false; + } + + if (!Configuration::get('PS_BACKUP_ALL')) + $ignore_insert_table = array(_DB_PREFIX_.'connections', _DB_PREFIX_.'connections_page', _DB_PREFIX_.'connections_source', _DB_PREFIX_.'guest', _DB_PREFIX_.'statssearch'); + else + $ignore_insert_table = array(); + + // Generate some random number, to make it extra hard to guess backup file names + $rand = dechex ( mt_rand(0, min(0xffffffff, mt_getrandmax() ) ) ); + $date = time(); + $backupfile = PS_ADMIN_DIR . '/backups/' . $date . '-' . $rand . '.sql'; + + // Figure out what compression is available and open the file + if (function_exists('bzopen')) + { + $backupfile .= '.bz2'; + $fp = @bzopen($backupfile, 'w'); + } + else if (function_exists('gzopen')) + { + $backupfile .= '.gz'; + $fp = @gzopen($backupfile, 'w'); + } + else + $fp = @fopen($backupfile, 'w'); + + if ($fp === false) + { + echo Tools::displayError('Unable to create backup file') . ' "' . addslashes($backupfile) . '"'; + return false; + } + + $this->id = realpath($backupfile); + + fwrite($fp, '/* Backup for ' . Tools::getHttpHost(false, false) . __PS_BASE_URI__ . "\n * at " . date($date) . "\n */\n"); + fwrite($fp, "\n".'SET NAMES \'utf8\';'."\n\n"); + + // Find all tables + $tables = Db::getInstance()->ExecuteS('SHOW TABLES'); + $found = 0; + foreach ($tables as $table) + { + $table = current($table); + + // Skip tables which do not start with _DB_PREFIX_ + if (strlen($table) < strlen(_DB_PREFIX_) || strncmp($table, _DB_PREFIX_, strlen(_DB_PREFIX_)) != 0) + continue; + + // Export the table schema + $schema = Db::getInstance()->ExecuteS('SHOW CREATE TABLE `' . $table . '`'); + + if (count($schema) != 1 || !isset($schema[0]['Table']) || !isset($schema[0]['Create Table'])) + { + fclose($fp); + $this->delete(); + echo Tools::displayError('An error occurred while backing up. Unable to obtain the schema of').' "'.$table; + return false; + } + + fwrite($fp, '/* Scheme for table ' . $schema[0]['Table'] . " */\n"); + fwrite($fp, $schema[0]['Create Table'] . ";\n\n"); + + if (!in_array($schema[0]['Table'], $ignore_insert_table)) + { + $data = Db::getInstance()->ExecuteS('SELECT * FROM `' . $schema[0]['Table'] . '`', false); + $sizeof = DB::getInstance()->NumRows(); + $lines = explode("\n", $schema[0]['Create Table']); + + if ($data AND $sizeof > 0) + { + // Export the table data + fwrite($fp, 'INSERT INTO `' . $schema[0]['Table'] . "` VALUES\n"); + $i = 1; + while ($row = DB::getInstance()->nextRow($data)) + { + $s = '('; + + foreach ($row as $field => $value) + { + $tmp = "'" . mysql_real_escape_string($value) . "',"; + if($tmp != "'',") + $s .= $tmp; + else + { + foreach($lines AS $line) + if (strpos($line, '`'.$field.'`') !== false) + { + if (preg_match('/(.*NOT NULL.*)/Ui', $line)) + $s .= "'',"; + else + $s .= 'NULL,'; + break; + } + } + } + $s = rtrim($s, ','); + + if ($i%200 == 0 AND $i < $sizeof) + $s .= ");\nINSERT INTO `".$schema[0]['Table']."` VALUES\n"; + elseif ($i < $sizeof) + $s .= "),\n"; + else + $s .= ");\n"; + + fwrite($fp, $s); + ++$i; + } + } + } + $found++; + } + + fclose($fp); + if ($found == 0) + { + $this->delete(); + echo Tools::displayError('No valid tables were found to backup.' ); + return false; + } + + return true; + } + +} diff --git a/classes/Blowfish.php b/classes/Blowfish.php new file mode 100644 index 000000000..1048762e8 --- /dev/null +++ b/classes/Blowfish.php @@ -0,0 +1,478 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_UNPACK_NATIVE', 1); +define('PS_UNPACK_MODIFIED', 2); + +class Crypt_Blowfish +{ + + var $_P = array( + 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, + 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, + 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, + 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, + 0x9216D5D9, 0x8979FB1B + ); + + var $_S = array( + array( + 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, + 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, + 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, + 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, + 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, + 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, + 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, + 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, + 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, + 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, + 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, + 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, + 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, + 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, + 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, + 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, + 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, + 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, + 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, + 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, + 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, + 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, + 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, + 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, + 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, + 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, + 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, + 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, + 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, + 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, + 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, + 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, + 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, + 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, + 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, + 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, + 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, + 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, + 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, + 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, + 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, + 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, + 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, + 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, + 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, + 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, + 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, + 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, + 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, + 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, + 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, + 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, + 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, + 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, + 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, + 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, + 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, + 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, + 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, + 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, + 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, + 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, + 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, + 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A + ), + array( + 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, + 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, + 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, + 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, + 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, + 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, + 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, + 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, + 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, + 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, + 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, + 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, + 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, + 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, + 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, + 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, + 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, + 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, + 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, + 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, + 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, + 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, + 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, + 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, + 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, + 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, + 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, + 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, + 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, + 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, + 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, + 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, + 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, + 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, + 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, + 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, + 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, + 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, + 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, + 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, + 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, + 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, + 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, + 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, + 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, + 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, + 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, + 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, + 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, + 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, + 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, + 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, + 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, + 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, + 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, + 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, + 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, + 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, + 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, + 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, + 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, + 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, + 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, + 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 + ), + array( + 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, + 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, + 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, + 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, + 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, + 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, + 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, + 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, + 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, + 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, + 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, + 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, + 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, + 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, + 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, + 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, + 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, + 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, + 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, + 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, + 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, + 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, + 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, + 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, + 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, + 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, + 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, + 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, + 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, + 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, + 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, + 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, + 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, + 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, + 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, + 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, + 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, + 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, + 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, + 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, + 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, + 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, + 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, + 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, + 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, + 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, + 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, + 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, + 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, + 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, + 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, + 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, + 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, + 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, + 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, + 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, + 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, + 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, + 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, + 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, + 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, + 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, + 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, + 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 + ), + array( + 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, + 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, + 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, + 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, + 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, + 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, + 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, + 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, + 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, + 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, + 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, + 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, + 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, + 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, + 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, + 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, + 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, + 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, + 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, + 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, + 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, + 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, + 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, + 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, + 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, + 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, + 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, + 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, + 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, + 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, + 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, + 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, + 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, + 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, + 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, + 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, + 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, + 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, + 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, + 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, + 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, + 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, + 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, + 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, + 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, + 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, + 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, + 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, + 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, + 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, + 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, + 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, + 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, + 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, + 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, + 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, + 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, + 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, + 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, + 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, + 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, + 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, + 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, + 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 + ) + ); + + var $_iv = NULL; + + protected $_unpackMode = PS_UNPACK_NATIVE; + + function __construct($key, $iv) + { + $_iv = $iv; + + $len = strlen($key); + + $k = 0; + $data = 0; + $datal = 0; + $datar = 0; + + if (PHP_VERSION_ID == '50201' OR PHP_VERSION_ID == '50206') + $this->_unpackMode = PS_UNPACK_MODIFIED; + + for ($i = 0; $i < 18; $i++) + { + $data = 0; + for ($j = 4; $j > 0; $j--) + { + $data = $data << 8 | ord($key{$k}); + $k = ($k + 1) % $len; + } + $this->_P[$i] ^= $data; + } + + for ($i = 0; $i <= 16; $i += 2) { + $this->_encipher($datal, $datar); + $this->_P[$i] = $datal; + $this->_P[$i+1] = $datar; + } + for ($i = 0; $i < 256; $i += 2) { + $this->_encipher($datal, $datar); + $this->_S[0][$i] = $datal; + $this->_S[0][$i+1] = $datar; + } + for ($i = 0; $i < 256; $i += 2) { + $this->_encipher($datal, $datar); + $this->_S[1][$i] = $datal; + $this->_S[1][$i+1] = $datar; + } + for ($i = 0; $i < 256; $i += 2) { + $this->_encipher($datal, $datar); + $this->_S[2][$i] = $datal; + $this->_S[2][$i+1] = $datar; + } + for ($i = 0; $i < 256; $i += 2) { + $this->_encipher($datal, $datar); + $this->_S[3][$i] = $datal; + $this->_S[3][$i+1] = $datar; + } + } + + function _encipher(&$Xl, &$Xr) + { + for ($i = 0; $i < 16; $i++) { + $temp = $Xl ^ $this->_P[$i]; + $Xl = ((($this->_S[0][($temp>>24) & 255] + + $this->_S[1][($temp>>16) & 255]) ^ + $this->_S[2][($temp>>8) & 255]) + + $this->_S[3][$temp & 255]) ^ $Xr; + $Xr = $temp; + } + $Xr = $Xl ^ $this->_P[16]; + $Xl = $temp ^ $this->_P[17]; + } + + function _decipher(&$Xl, &$Xr) + { + for ($i = 17; $i > 1; $i--) + { + $temp = $Xl ^ $this->_P[$i]; + $Xl = ((($this->_S[0][($temp>>24) & 255] + + $this->_S[1][($temp>>16) & 255]) ^ + $this->_S[2][($temp>>8) & 255]) + + $this->_S[3][$temp & 255]) ^ $Xr; + $Xr = $temp; + } + $Xr = $Xl ^ $this->_P[1]; + $Xl = $temp ^ $this->_P[0]; + } + + function encrypt($plainText) + { + $cipherText = ''; + $len = strlen($plainText); + $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8); + for ($i = 0; $i < $len; $i += 8) + { + list(, $Xl, $Xr) = ($this->_unpackMode == PS_UNPACK_NATIVE ? unpack('N2', substr($plainText, $i, 8)) : $this->myUnpackN2(substr($plainText, $i, 8))); + $this->_encipher($Xl, $Xr); + $cipherText .= pack('N2', $Xl, $Xr); + } + return $cipherText; + } + + function decrypt($cipherText) + { + $plainText = ''; + $len = strlen($cipherText); + $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8); + for ($i = 0; $i < $len; $i += 8) + { + list(, $Xl, $Xr) = ($this->_unpackMode == PS_UNPACK_NATIVE ? unpack('N2', substr($cipherText, $i, 8)) : $this->myUnpackN2(substr($cipherText, $i, 8))); + $this->_decipher($Xl, $Xr); + $plainText .= pack('N2', $Xl, $Xr); + } + return $plainText; + } + + function myUnpackN($str) + { + if (pack('L', 0x6162797A) == pack('V', 0x6162797A)) + return ((ord($str) << 24) | (ord(substr($str, 1)) << 16) | (ord(substr($str, 2)) << 8) | ord(substr($str, 3))); + else + return (ord($str) | (ord(substr($str, 1)) << 8) | (ord(substr($str, 2)) << 16) | (ord(substr($str, 3)) << 24)); + } + + function myUnpackN2($str) + { + return array('1' => $this->myUnpackN($str), '2' => $this->myUnpackN(substr($str, 4))); + } +} + +class BlowfishCore extends Crypt_Blowfish +{ + function encrypt($plaintext) + { + $ciphertext = ''; + $paddedtext = $this->maxi_pad($plaintext); + $strlen = strlen($paddedtext); + for($x = 0; $x < $strlen; $x += 8) + { + $piece = substr($paddedtext, $x, 8); + $cipher_piece = parent::encrypt($piece); + $encoded = base64_encode($cipher_piece); + $ciphertext = $ciphertext.$encoded; + } + return $ciphertext; + } + + function decrypt($ciphertext) + { + $plaintext = ''; + $chunks = explode('=', $ciphertext); + $ending_value = sizeof($chunks) ; + for($counter = 0; $counter < ($ending_value - 1); $counter++) + { + $chunk = $chunks[$counter].'='; + $decoded = base64_decode($chunk); + $piece = parent::decrypt($decoded); + $plaintext = $plaintext.$piece; + } + return $plaintext; + } + + function maxi_pad($plaintext) + { + $str_len = sizeof($plaintext); + $pad_len = $str_len % 8; + for($x = 0; $x < $pad_len; $x++) + $plaintext = $plaintext.' '; + return $plaintext; + } +} + + diff --git a/classes/CMS.php b/classes/CMS.php new file mode 100644 index 000000000..08e16bafe --- /dev/null +++ b/classes/CMS.php @@ -0,0 +1,254 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CMSCore extends ObjectModel +{ + + /** @var string Name */ + public $meta_title; + public $meta_description; + public $meta_keywords; + public $content; + public $link_rewrite; + public $id_cms_category; + public $position; + public $active; + + protected $fieldsRequiredLang = array('meta_title', 'link_rewrite'); + protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, 'meta_title' => 128, 'link_rewrite' => 128, 'content' => 3999999999999); + protected $fieldsValidateLang = array('meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'content' => 'isString'); + + protected $table = 'cms'; + protected $identifier = 'id_cms'; + + public function getFields() + { + parent::validateFields(); + $fields['id_cms'] = (int)($this->id); + $fields['id_cms_category'] = (int)($this->id_cms_category); + $fields['position'] = (int)($this->position); + $fields['active'] = (int)($this->active); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + + $fieldsArray = array('meta_title', 'meta_description', 'meta_keywords', 'link_rewrite'); + $fields = array(); + $languages = Language::getLanguages(false); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = (int)($language['id_lang']); + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + $fields[$language['id_lang']]['content'] = (isset($this->content[$language['id_lang']])) ? pSQL($this->content[$language['id_lang']], true) : ''; + foreach ($fieldsArray as $field) + { + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]); + elseif (in_array($field, $this->fieldsRequiredLang)) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); + else + $fields[$language['id_lang']][$field] = ''; + } + } + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + $this->position = CMS::getLastPosition((int)(Tools::getValue('id_cms_category'))); + return parent::add($autodate, true); + } + + public function update($nullValues = false) + { + if (parent::update($nullValues)) + return $this->cleanPositions($this->id_cms_category); + return false; + } + + public function delete() + { + if (parent::delete()) + return $this->cleanPositions($this->id_cms_category); + return false; + } + + public static function getLinks($id_lang, $selection = NULL, $active = true) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_cms, cl.link_rewrite, cl.meta_title + FROM '._DB_PREFIX_.'cms c + LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (c.id_cms = cl.id_cms AND cl.id_lang = '.(int)($id_lang).') + WHERE 1 + '.(($selection !== NULL) ? ' AND c.id_cms IN ('.implode(',', array_map('intval', $selection)).')' : ''). + ($active ? ' AND c.`active` = 1 ' : ''). + 'ORDER BY c.`position`'); + $link = new Link(); + $links = array(); + if ($result) + foreach ($result as $row) + { + $row['link'] = $link->getCMSLink((int)($row['id_cms']), $row['link_rewrite']); + $links[] = $row; + } + return $links; + } + + public static function listCms($id_lang = NULL, $id_block = false, $active = true) + { + if (empty($id_lang)) + $id_lang = (int)Configuration::get('PS_LANG_DEFAULT'); + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_cms, l.meta_title + FROM '._DB_PREFIX_.'cms c + JOIN '._DB_PREFIX_.'cms_lang l ON (c.id_cms = l.id_cms) + '.(($id_block) ? 'JOIN '._DB_PREFIX_.'block_cms b ON (c.id_cms = b.id_cms)' : '').' + WHERE l.id_lang = '.(int)($id_lang).(($id_block) ? ' AND b.id_block = '.(int)($id_block) : '').($active ? ' AND c.`active` = 1 ' : '').' + ORDER BY c.`position`'); + } + + /** + * @deprecated + */ + public static function isInBlock($id_cms, $id_block) + { + Tools::displayAsDeprecated(); + Db::getInstance()->getRow(' + SELECT id_cms FROM '._DB_PREFIX_.'block_cms + WHERE id_block = '.(int)($id_block).' AND id_cms = '.(int)($id_cms)); + + return (Db::getInstance()->NumRows()); + } + + /** + * @deprecated + */ + public static function updateCmsToBlock($cms, $id_block) + { + Tools::displayAsDeprecated(); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'block_cms` WHERE `id_block` = '.(int)($id_block)); + + $list = ''; + foreach ($cms AS $id_cms) + $list .= '('.(int)($id_block).', '.(int)($id_cms).'),'; + $list = rtrim($list, ','); + + if (!empty($list)) + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'block_cms (id_block, id_cms) VALUES '.pSQL($list)); + + return true; + } + + public function updatePosition($way, $position) + { + if (!$res = Db::getInstance()->ExecuteS(' + SELECT cp.`id_cms`, cp.`position`, cp.`id_cms_category` + FROM `'._DB_PREFIX_.'cms` cp + WHERE cp.`id_cms_category` = '.(int)(Tools::getValue('id_cms_category', 1)).' + ORDER BY cp.`position` ASC' + )) + return false; + + foreach ($res AS $cms) + if ((int)($cms['id_cms']) == (int)($this->id)) + $movedCms = $cms; + + if (!isset($movedCms) || !isset($position)) + return false; + + // < and > statements rather than BETWEEN operator + // since BETWEEN is treated differently according to databases + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms` + SET `position`= `position` '.($way ? '- 1' : '+ 1').' + WHERE `position` + '.($way + ? '> '.(int)($movedCms['position']).' AND `position` <= '.(int)($position) + : '< '.(int)($movedCms['position']).' AND `position` >= '.(int)($position)).' + AND `id_cms_category`='.(int)($movedCms['id_cms_category'])) + AND Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms` + SET `position` = '.(int)($position).' + WHERE `id_cms` = '.(int)($movedCms['id_cms']).' + AND `id_cms_category`='.(int)($movedCms['id_cms_category']))); + } + + static public function cleanPositions($id_category) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_cms` + FROM `'._DB_PREFIX_.'cms` + WHERE `id_cms_category` = '.(int)($id_category).' + ORDER BY `position`'); + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; ++$i){ + $sql = ' + UPDATE `'._DB_PREFIX_.'cms` + SET `position` = '.(int)($i).' + WHERE `id_cms_category` = '.(int)($id_category).' + AND `id_cms` = '.(int)($result[$i]['id_cms']); + Db::getInstance()->Execute($sql); + } + return true; + } + + static public function getLastPosition($id_category) + { + return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'cms` WHERE `id_cms_category` = '.(int)($id_category))); + } + + static public function getCMSPages($id_lang = NULL, $id_cms_category = NULL, $active = true) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'cms` c + JOIN `'._DB_PREFIX_.'cms_lang` l ON (c.id_cms = l.id_cms)'. + (isset($id_cms_category) ? 'WHERE `id_cms_category` = '.(int)($id_cms_category) : ''). + ($active ? ' AND c.`active` = 1 ' : '').' + AND l.id_lang = '.(int)($id_lang).' + ORDER BY `position`'); + } + public static function getUrlRewriteInformations($id_cms) + { + $sql = ' + SELECT l.`id_lang`, c.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_lang` AS c + LEFT JOIN `'._DB_PREFIX_.'lang` AS l ON c.`id_lang` = l.`id_lang` + WHERE c.`id_cms` = '.(int)$id_cms.' + AND l.`active` = 1'; + $arr_return = Db::getInstance()->ExecuteS($sql); + return $arr_return; + } +} + diff --git a/classes/CMSCategory.php b/classes/CMSCategory.php new file mode 100644 index 000000000..399dcacbc --- /dev/null +++ b/classes/CMSCategory.php @@ -0,0 +1,656 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CMSCategoryCore extends ObjectModel +{ + public $id; + + /** @var integer CMSCategory ID */ + public $id_cms_category; + + /** @var string Name */ + public $name; + + /** @var boolean Status for display */ + public $active = 1; + + /** @var string Description */ + public $description; + + /** @var integer Parent CMSCategory ID */ + public $id_parent; + + /** @var integer category position */ + public $position; + + /** @var integer Parents number */ + public $level_depth; + + /** @var string string used in rewrited URL */ + public $link_rewrite; + + /** @var string Meta title */ + public $meta_title; + + /** @var string Meta keywords */ + public $meta_keywords; + + /** @var string Meta description */ + public $meta_description; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected static $_links = array(); + + + protected $tables = array ('cms_category', 'cms_category_lang'); + + protected $fieldsRequired = array('id_parent', 'active'); + protected $fieldsSize = array('id_parent' => 10, 'active' => 1); + protected $fieldsValidate = array('active' => 'isBool'); + protected $fieldsRequiredLang = array('name', 'link_rewrite'); + protected $fieldsSizeLang = array('name' => 64, 'link_rewrite' => 64, 'meta_title' => 128, 'meta_description' => 255, 'meta_keywords' => 255); + protected $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml', + 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName'); + + protected $table = 'cms_category'; + protected $identifier = 'id_cms_category'; + + public function __construct($id_cms_category = NULL, $id_lang = NULL) + { + parent::__construct($id_cms_category, $id_lang); + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_cms_category'] = (int)($this->id); + $fields['active'] = (int)($this->active); + $fields['id_parent'] = (int)($this->id_parent); + $fields['position'] = (int)($this->position); + $fields['level_depth'] = (int)($this->level_depth); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description')); + } + + public function add($autodate = true, $nullValues = false) + { + $this->position = self::getLastPosition((int)(Tools::getValue('id_parent'))); + $this->level_depth = $this->calcLevelDepth(); + foreach ($this->name AS $k => $value) + if (preg_match('/^[1-9]\./', $value)) + $this->name[$k] = '0'.$value; + $ret = parent::add($autodate); + $this->cleanPositions($this->id_parent); + return $ret; + } + + public function update($nullValues = false) + { + $this->level_depth = $this->calcLevelDepth(); + foreach ($this->name AS $k => $value) + if (preg_match('/^[1-9]\./', $value)) + $this->name[$k] = '0'.$value; + return parent::update(); + } + + /** + * Recursive scan of subcategories + * + * @param integer $maxDepth Maximum depth of the tree (i.e. 2 => 3 levels depth) + * @param integer $currentDepth specify the current depth in the tree (don't use it, only for rucursivity!) + * @param array $excludedIdsArray specify a list of ids to exclude of results + * @param integer $idLang Specify the id of the language used + * + * @return array Subcategories lite tree + */ + function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL) + { + global $link; + + //get idLang + $idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); + + //recursivity for subcategories + $children = array(); + if (($maxDepth == 0 OR $currentDepth < $maxDepth) AND $subcats = $this->getSubCategories($idLang, true) AND sizeof($subcats)) + foreach ($subcats as &$subcat) + { + if (!$subcat['id_cms_category']) + break; + elseif ( !is_array($excludedIdsArray) || !in_array($subcat['id_cms_category'], $excludedIdsArray) ) + { + $categ = new CMSCategory($subcat['id_cms_category'] ,$idLang); + $categ->name = CMSCategory::hideCMSCategoryPosition($categ->name); + $children[] = $categ->recurseLiteCategTree($maxDepth, $currentDepth + 1, $idLang, $excludedIdsArray); + } + } + + + return array( + 'id' => $this->id_cms_category, + 'link' => $link->getCMSCategoryLink($this->id, $this->link_rewrite), + 'name' => $this->name, + 'desc'=> $this->description, + 'children' => $children + ); + } + + static public function getRecurseCategory($id_lang = _USER_ID_LANG_, $current = 1, $active = 1, $links = 0) + { + $category = Db::getInstance()->getRow(' + SELECT c.`id_cms_category`, c.`id_parent`, c.`level_depth`, cl.`name`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_category` c + JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON c.`id_cms_category` = cl.`id_cms_category` + WHERE c.`id_cms_category` = '.(int)($current).' + AND `id_lang` = '.(int)($id_lang)); + $result = Db::getInstance()->ExecuteS(' + SELECT c.`id_cms_category` + FROM `'._DB_PREFIX_.'cms_category` c + WHERE c.`id_parent` = '.(int)($current). + ($active ? ' AND c.`active` = 1' : '')); + foreach ($result as $row) + $category['children'][] = self::getRecurseCategory($id_lang, $row['id_cms_category'], $active, $links); + $category['cms'] = Db::getInstance()->ExecuteS(' + SELECT c.`id_cms`, cl.`meta_title`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms` c + JOIN `'._DB_PREFIX_.'cms_lang` cl ON c.`id_cms` = cl.`id_cms` + WHERE `id_cms_category` = '.(int)($current).' + AND cl.`id_lang` = '.(int)($id_lang).($active ? ' AND c.`active` = 1' : '').' + ORDER BY c.`position`'); + if ($links == 1) + { + $link = new Link(); + $category['link'] = $link->getCMSCategoryLink($current, $category['link_rewrite']); + foreach($category['cms'] as $key => $cms) + $category['cms'][$key]['link'] = $link->getCMSLink($cms['id_cms'], $cms['link_rewrite']); + } + return $category; + } + + static public function recurseCMSCategory($categories, $current, $id_cms_category = 1, $id_selected = 1, $is_html = 0) + { + global $currentIndex; + $html = ''; + if ($is_html == 0) + echo $html; + if (isset($categories[$id_cms_category])) + foreach ($categories[$id_cms_category] AS $key => $row) + $html .= self::recurseCMSCategory($categories, $categories[$id_cms_category][$key], $key, $id_selected, $is_html); + return $html; + } + + + + /** + * Recursively add specified CMSCategory childs to $toDelete array + * + * @param array &$toDelete Array reference where categories ID will be saved + * @param array $id_cms_category Parent CMSCategory ID + */ + protected function recursiveDelete(&$toDelete, $id_cms_category) + { + if (!is_array($toDelete) OR !$id_cms_category) + die(Tools::displayError()); + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_cms_category` + FROM `'._DB_PREFIX_.'cms_category` + WHERE `id_parent` = '.(int)($id_cms_category)); + foreach ($result AS $k => $row) + { + $toDelete[] = (int)($row['id_cms_category']); + $this->recursiveDelete($toDelete, (int)($row['id_cms_category'])); + } + } + + public function delete() + { + if ($this->id == 1) return false; + + $this->clearCache(); + + /* Get childs categories */ + $toDelete = array((int)($this->id)); + $this->recursiveDelete($toDelete, (int)($this->id)); + $toDelete = array_unique($toDelete); + + /* Delete CMS Category and its child from database */ + $list = sizeof($toDelete) > 1 ? implode(',', $toDelete) : (int)($this->id); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cms_category` WHERE `id_cms_category` IN ('.$list.')'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cms_category_lang` WHERE `id_cms_category` IN ('.$list.')'); + + self::cleanPositions($this->id_parent); + + /* Delete pages which are in categories to delete */ + $result = Db::getInstance()->ExecuteS(' + SELECT `id_cms` + FROM `'._DB_PREFIX_.'cms` + WHERE `id_cms_category` IN ('.$list.')'); + foreach ($result as $p) + { + $product = new CMS((int)($p['id_cms'])); + if (Validate::isLoadedObject($product)) + $product->delete(); + } + return true; + } + + /** + * Delete several categories from database + * + * return boolean Deletion result + */ + public function deleteSelection($categories) + { + $return = 1; + foreach ($categories AS $id_category_cms) + { + $category_cms = new CMSCategory((int)($id_category_cms)); + $return &= $category_cms->delete(); + } + return $return; + } + + /** + * Get the number of parent categories + * + * @return integer Level depth + */ + public function calcLevelDepth() + { + $parentCMSCategory = new CMSCategory((int)($this->id_parent)); + if (!$parentCMSCategory) + die('parent CMS Category does not exist'); + return $parentCMSCategory->level_depth + 1; + } + + /** + * Return available categories + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array Categories + */ + static public function getCategories($id_lang, $active = true, $order = true) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON c.`id_cms_category` = cl.`id_cms_category` + WHERE `id_lang` = '.(int)($id_lang).' + '.($active ? 'AND `active` = 1' : '').' + ORDER BY `name` ASC'); + + if (!$order) + return $result; + + $categories = array(); + foreach ($result AS $row) + $categories[$row['id_parent']][$row['id_cms_category']]['infos'] = $row; + return $categories; + } + + static public function getSimpleCategories($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_cms_category`, cl.`name` + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category`) + WHERE cl.`id_lang` = '.(int)($id_lang).' + ORDER BY cl.`name`'); + } + + /** + * Return current CMSCategory childs + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array Categories + */ + public function getSubCategories($id_lang, $active = true) + { + global $cookie; + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)($id_lang).') + WHERE `id_parent` = '.(int)($this->id).' + '.($active ? 'AND `active` = 1' : '').' + GROUP BY c.`id_cms_category` + ORDER BY `name` ASC'); + + /* Modify SQL result */ + foreach ($result AS &$row) + { + $row['name'] = CMSCategory::hideCMSCategoryPosition($row['name']); + } + return $result; + } + + /** + * Hide CMSCategory prefix used for position + * + * @param string $name CMSCategory name + * @return string Name without position + */ + static public function hideCMSCategoryPosition($name) + { + return preg_replace('/^[0-9]+\./', '', $name); + } + + /** + * Return main categories + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array categories + */ + static public function getHomeCategories($id_lang, $active = true) + { + return self::getChildren(1, $id_lang, $active); + } + /** + * @deprecated + **/ + static public function getRootCMSCategory($id_lang = NULL) + { + Tools::displayAsDeprecated(); + //get idLang + $id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang); + return new CMSCategory (1, $id_lang); + } + + static public function getChildren($id_parent, $id_lang, $active = true) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_cms_category`, cl.`name`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON c.`id_cms_category` = cl.`id_cms_category` + WHERE `id_lang` = '.(int)($id_lang).' + AND c.`id_parent` = '.(int)($id_parent).' + '.($active ? 'AND `active` = 1' : '').' + ORDER BY `name` ASC'); + + /* Modify SQL result */ + $resultsArray = array(); + foreach ($result AS $row) + { + $row['name'] = CMSCategory::hideCMSCategoryPosition($row['name']); + $resultsArray[] = $row; + } + return $resultsArray; + } + + /** + * Check if CMSCategory can be moved in another one + * + * @param integer $id_parent Parent candidate + * @return boolean Parent validity + */ + public static function checkBeforeMove($id_cms_category, $id_parent) + { + if ($id_cms_category == $id_parent) return false; + if ($id_parent == 1) return true; + $i = (int)($id_parent); + + while (42) + { + $result = Db::getInstance()->getRow('SELECT `id_parent` FROM `'._DB_PREFIX_.'cms_category` WHERE `id_cms_category` = '.(int)($i)); + if (!isset($result['id_parent'])) return false; + if ($result['id_parent'] == $id_cms_category) return false; + if ($result['id_parent'] == 1) return true; + $i = $result['id_parent']; + } + } + + public static function getLinkRewrite($id_cms_category, $id_lang) + { + if (!Validate::isUnsignedId($id_cms_category) OR !Validate::isUnsignedId($id_lang)) + return false; + + if (isset(self::$_links[$id_cms_category.'-'.$id_lang])) + return self::$_links[$id_cms_category.'-'.$id_lang]; + + $result = Db::getInstance()->getRow(' + SELECT cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON c.`id_cms_category` = cl.`id_cms_category` + WHERE `id_lang` = '.(int)($id_lang).' + AND c.`id_cms_category` = '.(int)($id_cms_category)); + self::$_links[$id_cms_category.'-'.$id_lang] = $result['link_rewrite']; + return $result['link_rewrite']; + } + + public function getLink() + { + global $link; + return $link->getCMSCategoryLink($this->id, $this->link_rewrite); + } + + public function getName($id_lang = NULL) + { + if (!$id_lang) + { + global $cookie; + + if (isset($this->name[$cookie->id_lang])) + $id_lang = $cookie->id_lang; + else + $id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + } + return isset($this->name[$id_lang]) ? $this->name[$id_lang] : ''; + } + + /** + * Light back office search for categories + * + * @param integer $id_lang Language ID + * @param string $query Searched string + * @param boolean $unrestricted allows search without lang and includes first CMSCategory and exact match + * @return array Corresponding categories + */ + static public function searchByName($id_lang, $query, $unrestricted = false) + { + if ($unrestricted === true) + return Db::getInstance()->getRow(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category`) + WHERE `name` LIKE \''.pSQL($query).'\''); + else + return Db::getInstance()->ExecuteS(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)($id_lang).') + WHERE `name` LIKE \'%'.pSQL($query).'%\' AND c.`id_cms_category` != 1'); + } + + /** + * Retrieve CMSCategory by name and parent CMSCategory id + * + * @param integer $id_lang Language ID + * @param string $CMSCategory_name Searched CMSCategory name + * @param integer $id_parent_CMSCategory parent CMSCategory ID + * @return array Corresponding CMSCategory + * @deprecated + */ + static public function searchByNameAndParentCMSCategoryId($id_lang, $CMSCategory_name, $id_parent_CMSCategory) + { + Tools::displayAsDeprecated(); + return Db::getInstance()->getRow(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)($id_lang).') + WHERE `name` LIKE \''.pSQL($CMSCategory_name).'\' + AND c.`id_cms_category` != 1 + AND c.`id_parent` = '.(int)($id_parent_CMSCategory)); + } + + /** + * Get Each parent CMSCategory of this CMSCategory until the root CMSCategory + * + * @param integer $id_lang Language ID + * @return array Corresponding categories + */ + public function getParentsCategories($idLang = null) + { + //get idLang + $idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); + + $categories = null; + $idCurrent = (int)($this->id); + while (true) + { + $query = ' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'cms_category` c + LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)($idLang).') + WHERE c.`id_cms_category` = '.$idCurrent.' AND c.`id_parent` != 0 + '; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + + $categories[] = $result[0]; + if(!$result OR $result[0]['id_parent'] == 1) + return $categories; + $idCurrent = $result[0]['id_parent']; + } + } + /** + * Specify if a CMSCategory already in base + * + * @param $id_cms_category CMSCategory id + * @return boolean + * @deprecated + */ + static public function CMSCategoryExists($id_cms_category) + { + Tools::displayAsDeprecated(); + $row = Db::getInstance()->getRow(' + SELECT `id_cms_category` + FROM '._DB_PREFIX_.'cms_category c + WHERE c.`id_cms_category` = '.(int)($id_cms_category)); + + return isset($row['id_cms_category']); + } + + public function updatePosition($way, $position) + { + if (!$res = Db::getInstance()->ExecuteS(' + SELECT cp.`id_cms_category`, cp.`position`, cp.`id_parent` + FROM `'._DB_PREFIX_.'cms_category` cp + WHERE cp.`id_parent` = '.(int)(Tools::getValue('id_cms_category_parent', 1)).' + ORDER BY cp.`position` ASC' + )) + return false; + foreach ($res AS $category) + if ((int)($category['id_cms_category']) == (int)($this->id)) + $movedCategory = $category; + + if (!isset($movedCategory) || !isset($position)) + return false; + // < and > statements rather than BETWEEN operator + // since BETWEEN is treated differently according to databases + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_category` + SET `position`= `position` '.($way ? '- 1' : '+ 1').' + WHERE `position` + '.($way + ? '> '.(int)($movedCategory['position']).' AND `position` <= '.(int)($position) + : '< '.(int)($movedCategory['position']).' AND `position` >= '.(int)($position)).' + AND `id_parent`='.(int)($movedCategory['id_parent'])) + AND Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_category` + SET `position` = '.(int)($position).' + WHERE `id_parent` = '.(int)($movedCategory['id_parent']).' + AND `id_cms_category`='.(int)($movedCategory['id_cms_category']))); + } + + static public function cleanPositions($id_category_parent) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_cms_category` + FROM `'._DB_PREFIX_.'cms_category` + WHERE `id_parent` = '.(int)($id_category_parent).' + ORDER BY `position`'); + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; ++$i){ + $sql = ' + UPDATE `'._DB_PREFIX_.'cms_category` + SET `position` = '.(int)($i).' + WHERE `id_parent` = '.(int)($id_category_parent).' + AND `id_cms_category` = '.(int)($result[$i]['id_cms_category']); + Db::getInstance()->Execute($sql); + } + return true; + } + + static public function getLastPosition($id_category_parent) + { + return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'cms_category` WHERE `id_parent` = '.(int)($id_category_parent))); + } + public static function getUrlRewriteInformations($id_category) + { + $sql = ' + SELECT l.`id_lang`, c.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_category_lang` AS c + LEFT JOIN `'._DB_PREFIX_.'lang` AS l ON c.`id_lang` = l.`id_lang` + WHERE c.`id_cms_category` = '.(int)$id_category.' + AND l.`active` = 1'; + $arr_return = Db::getInstance()->ExecuteS($sql); + return $arr_return; + } +} + + diff --git a/classes/Cache.php b/classes/Cache.php new file mode 100755 index 000000000..70c014286 --- /dev/null +++ b/classes/Cache.php @@ -0,0 +1,80 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class CacheCore +{ + + protected static $_instance; + protected $_keysCached; + protected $_tablesCached = array(); + protected $_blackList = array('cart', + 'cart_discount', + 'cart_product', + 'connections', + 'connections_source', + 'connections_page', + 'customer', + 'customer_group', + 'customized_data', + 'guest', + 'pagenotfound', + 'page_viewed'); + public static function getInstance() + { + if(!isset(self::$_instance)) + { + $caching_system = _PS_CACHING_SYSTEM_; + self::$_instance = new $caching_system(); + + } + return self::$_instance; + } + + protected function __construct() + { + } + + protected function __destruct() + { + } + + protected function isBlacklist($query) + { + foreach ($this->_blackList AS $find) + if (strpos($query, $find)) + return true; + return false; + } + + abstract public function get($key); + abstract public function delete($key, $timeout = 0); + abstract public function set($key, $value, $expire = 0); + abstract public function flush(); + abstract public function setQuery($query, $result); + abstract public function deleteQuery($query); + +} diff --git a/classes/CacheFS.php b/classes/CacheFS.php new file mode 100755 index 000000000..2fbb89903 --- /dev/null +++ b/classes/CacheFS.php @@ -0,0 +1,175 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CacheFSCore extends Cache { + + protected $_depth; + + protected function __construct() + { + parent::__construct(); + return $this->_init(); + } + + protected function _init() + { + $this->_depth = Db::getInstance()->getValue('SELECT value FROM '._DB_PREFIX_.'configuration WHERE name=\'PS_CACHEFS_DIRECTORY_DEPTH\'', false); + return $this->_setKeys(); + } + + public function set($key, $value, $expire = 0) + { + $path = _PS_CACHEFS_DIRECTORY_; + for ($i = 0; $i < $this->_depth; $i++) + { + $path.=$key[$i].'/'; + } + if(file_put_contents($path.$key, serialize($value))) + { + $this->_keysCached[$key] = true; + return $key; + } + return false; + } + + public function setNumRows($key, $value, $expire = 0) + { + return $this->set($key.'_nrows', $value, $expire); + } + + public function getNumRows($key) + { + return $this->get($key.'_nrows'); + } + + public function get($key) + { + if (!isset($this->_keysCached[$key])) + return false; + $path = _PS_CACHEFS_DIRECTORY_; + for ($i = 0; $i < $this->_depth; $i++) + $path.=$key[$i].'/'; + if (!file_exists($path.$key)) + { + unset($this->_keysCached[$key]); + return false; + } + $file = file_get_contents($path.$key); + return unserialize($file); + } + + protected function _setKeys() + { + if (file_exists(_PS_CACHEFS_DIRECTORY_.'keysCached')) + { + $file = file_get_contents(_PS_CACHEFS_DIRECTORY_.'keysCached'); + $this->_keysCached = unserialize($file); + } + if (file_exists(_PS_CACHEFS_DIRECTORY_.'tablesCached')) + { + $file = file_get_contents(_PS_CACHEFS_DIRECTORY_.'tablesCached'); + $this->_tablesCached = unserialize($file); + } + return true; + } + + public function setQuery($query, $result) + { + $md5_query = md5($query); + if (isset($this->_keysCached[$md5_query])) + return true; + if ($this->isBlacklist($query)) + return true; + $key = $this->set($md5_query, $result); + if (preg_match_all('/('._DB_PREFIX_.'[a-z_-]*)`?.*/i', $query, $res)) + foreach($res[1] AS $table) + if(!isset($this->_tablesCached[$table][$key])) + $this->_tablesCached[$table][$key] = true; + } + + public function delete($key, $timeout = 0) + { + $path = _PS_CACHEFS_DIRECTORY_; + if (!isset($this->_keysCached[$key])) + return; + for ($i = 0; $i < $this->_depth; $i++) + $path.=$key[$i].'/'; + if (!file_exists($path.$key)) + return true; + if (!unlink($path.$key)) + return false; + unset($this->_keysCached[$key]); + return true; + } + + public function deleteQuery($query) + { + + if (preg_match_all('/('._DB_PREFIX_.'[a-z_-]*)`?.*/i', $query, $res)) + foreach ($res[1] AS $table) + if (isset($this->_tablesCached[$table])) + { + foreach ($this->_tablesCached[$table] AS $fsKey => $foo) + { + $this->delete($fsKey); + $this->delete($fsKey.'_nrows'); + } + unset($this->_tablesCached[$table]); + } + } + + public function flush() + { + } + + public function __destruct() + { + parent::__destruct(); + file_put_contents(_PS_CACHEFS_DIRECTORY_.'keysCached', serialize($this->_keysCached)); + file_put_contents(_PS_CACHEFS_DIRECTORY_.'tablesCached', serialize($this->_tablesCached)); + } + + public static function deleteCacheDirectory() + { + Tools::deleteDirectory(_PS_CACHEFS_DIRECTORY_, false); + } + + public static function createCacheDirectories($level_depth, $directory = false) + { + if (!$directory) + $directory = _PS_CACHEFS_DIRECTORY_; + $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; + for ($i = 0; $i < strlen($chars); $i++) + { + $new_dir = $directory.$chars[$i].'/'; + if (mkdir($new_dir)) + if (chmod($new_dir, 0777)) + if ($level_depth - 1 > 0) + self::createCacheDirectories($level_depth - 1, $new_dir); + } + } +} diff --git a/classes/Carrier.php b/classes/Carrier.php new file mode 100644 index 000000000..761995055 --- /dev/null +++ b/classes/Carrier.php @@ -0,0 +1,687 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CarrierCore extends ObjectModel +{ + const SHIPPING_METHOD_DEFAULT = 0; + const SHIPPING_METHOD_WEIGHT = 1; + const SHIPPING_METHOD_PRICE = 2; + + /** @var int Tax id (none = 0) */ + public $id_tax_rules_group; + + /** @var string Name */ + public $name; + + /** @var string URL with a '@' for */ + public $url; + + /** @var string Delay needed to deliver customer */ + public $delay; + + /** @var boolean Carrier statuts */ + public $active = true; + + /** @var boolean True if carrier has been deleted (staying in database as deleted) */ + public $deleted = 0; + + /** @var boolean Active or not the shipping handling */ + public $shipping_handling = true; + + /** @var int Behavior taken for unknown range */ + public $range_behavior; + + /** @var boolean Carrier module */ + public $is_module; + + /** @var int shipping behavior: by weight or by price */ + public $shipping_method = 0; + + /** @var boolean Shipping external */ + public $shipping_external = 0; + + /** @var string Shipping external */ + public $external_module_name = NULL; + + /** @var boolean Need Range */ + public $need_range = 0; + + protected $fieldsRequired = array('name', 'active'); + protected $fieldsSize = array('name' => 64); + protected $fieldsValidate = array('id_tax_rules_group' => 'isInt', 'name' => 'isCarrierName', 'active' => 'isBool', 'url' => 'isAbsoluteUrl', 'shipping_handling' => 'isBool', 'range_behavior' => 'isBool', 'shipping_method' => 'isUnsignedInt'); + protected $fieldsRequiredLang = array('delay'); + protected $fieldsSizeLang = array('delay' => 128); + protected $fieldsValidateLang = array('delay' => 'isGenericName'); + + protected $table = 'carrier'; + protected $identifier = 'id_carrier'; + + protected static $priceByWeight = array(); + protected static $priceByWeight2 = array(); + protected static $priceByPrice = array(); + protected static $priceByPrice2 = array(); + + protected static $_cache_tax_rule = array(); + + protected $webserviceParameters = array( + 'fields' => array( + 'id_tax_rules_group' => array(), + 'deleted' => array(), + 'is_module' => array(), + ), + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_tax_rules_group'] = (int)($this->id_tax_rules_group); + $fields['name'] = pSQL($this->name); + $fields['url'] = pSQL($this->url); + $fields['active'] = (int)($this->active); + $fields['deleted'] = (int)($this->deleted); + $fields['shipping_handling'] = (int)($this->shipping_handling); + $fields['range_behavior'] = (int)($this->range_behavior); + $fields['shipping_method'] = (int)($this->shipping_method); + $fields['is_module'] = (int)($this->is_module); + $fields['shipping_external'] = (int)($this->shipping_external); + $fields['external_module_name'] = $this->external_module_name; + $fields['need_range'] = $this->need_range; + + return $fields; + } + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id, $id_lang); + if ($this->name == '0') + $this->name = Configuration::get('PS_SHOP_NAME'); + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('delay')); + } + + public function add($autodate = true, $nullValues = false) + { + if (!parent::add($autodate, $nullValues) OR !Validate::isLoadedObject($this)) + return false; + if (!$result = Db::getInstance()->ExecuteS('SELECT `id_carrier` FROM `'._DB_PREFIX_.$this->table.'` WHERE `deleted` = 0')) + return false; + if (!$numRows = Db::getInstance()->NumRows()) + return false; + if ((int)($numRows) == 1) + Configuration::updateValue('PS_CARRIER_DEFAULT', (int)($this->id)); + return true; + } + + /** + * Change carrier id in delivery prices when updating a carrier + * + * @param integer $id_old Old id carrier + */ + public function setConfiguration($id_old) + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'delivery` SET `id_carrier` = '.(int)($this->id).' WHERE `id_carrier` = '.(int)($id_old)); + } + + /** + * Get delivery prices for a given order + * + * @param floatval $totalWeight Order total weight + * @param integer $id_zone Zone id (for customer delivery address) + * @return float Delivery price + */ + public function getDeliveryPriceByWeight($totalWeight, $id_zone) + { + $cache_key = $this->id.'_'.$totalWeight.'_'.$id_zone; + if (!isset(self::$priceByWeight[$cache_key])) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON (d.`id_range_weight` = w.`id_range_weight`) + WHERE d.`id_zone` = '.(int)($id_zone).' + AND '.(float)($totalWeight).' >= w.`delimiter1` + AND '.(float)($totalWeight).' < w.`delimiter2` + AND d.`id_carrier` = '.(int)($this->id).' + ORDER BY w.`delimiter1` ASC'); + if (!isset($result['price'])) + self::$priceByWeight[$cache_key] = $this->getMaxDeliveryPriceByWeight($id_zone); + else + self::$priceByWeight[$cache_key] = $result['price']; + } + return self::$priceByWeight[$cache_key]; + } + + static public function checkDeliveryPriceByWeight($id_carrier, $totalWeight, $id_zone) + { + $cache_key = $id_carrier.'_'.$totalWeight.'_'.$id_zone; + if (!isset(self::$priceByWeight2[$cache_key])) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + LEFT JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` + WHERE d.`id_zone` = '.(int)($id_zone).' + AND '.(float)($totalWeight).' >= w.`delimiter1` + AND '.(float)($totalWeight).' < w.`delimiter2` + AND d.`id_carrier` = '.(int)($id_carrier).' + ORDER BY w.`delimiter1` ASC'); + self::$priceByWeight2[$cache_key] = (isset($result['price'])); + } + return self::$priceByWeight2[$cache_key]; + } + + public function getMaxDeliveryPriceByWeight($id_zone) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + INNER JOIN `'._DB_PREFIX_.'range_weight` w ON d.`id_range_weight` = w.`id_range_weight` + WHERE d.`id_zone` = '.(int)($id_zone).' + AND d.`id_carrier` = '.(int)($this->id).' + ORDER BY w.`delimiter2` DESC LIMIT 1'); + if (!isset($result[0]['price'])) + return false; + return $result[0]['price']; + } + + /** + * Get delivery prices for a given order + * + * @param floatval $orderTotal Order total to pay + * @param integer $id_zone Zone id (for customer delivery address) + * @return float Delivery price + */ + public function getDeliveryPriceByPrice($orderTotal, $id_zone, $id_currency = NULL) + { + $cache_key = $this->id.'_'.$orderTotal.'_'.$id_zone.'_'.$id_currency; + if (!isset(self::$priceByPrice[$cache_key])) + { + if (!empty($id_currency)) + $orderTotal = Tools::convertPrice($orderTotal, $id_currency, false); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` + WHERE d.`id_zone` = '.(int)($id_zone).' + AND '.(float)($orderTotal).' >= r.`delimiter1` + AND '.(float)($orderTotal).' < r.`delimiter2` + AND d.`id_carrier` = '.(int)($this->id).' + ORDER BY r.`delimiter1` ASC'); + if (!isset($result['price'])) + self::$priceByPrice[$cache_key] = $this->getMaxDeliveryPriceByPrice($id_zone); + else + self::$priceByPrice[$cache_key] = $result['price']; + } + return self::$priceByPrice[$cache_key]; + } + + /** + * Check delivery prices for a given order + * + * @param id_carrier + * @param floatval $orderTotal Order total to pay + * @param integer $id_zone Zone id (for customer delivery address) + * @param integer $id_currency + * @return float Delivery price + */ + static public function checkDeliveryPriceByPrice($id_carrier, $orderTotal, $id_zone, $id_currency = NULL) + { + $cache_key = $id_carrier.'_'.$orderTotal.'_'.$id_zone.'_'.$id_currency; + if (!isset(self::$priceByPrice2[$cache_key])) + { + if (!empty($id_currency)) + $orderTotal = Tools::convertPrice($orderTotal, $id_currency, false); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + LEFT JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` + WHERE d.`id_zone` = '.(int)($id_zone).' + AND '.(float)($orderTotal).' >= r.`delimiter1` + AND '.(float)($orderTotal).' < r.`delimiter2` + AND d.`id_carrier` = '.(int)($id_carrier).' + ORDER BY r.`delimiter1` ASC'); + self::$priceByPrice2[$cache_key] = (isset($result['price'])); + } + return self::$priceByPrice2[$cache_key]; + } + + public function getMaxDeliveryPriceByPrice($id_zone) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT d.`price` + FROM `'._DB_PREFIX_.'delivery` d + INNER JOIN `'._DB_PREFIX_.'range_price` r ON d.`id_range_price` = r.`id_range_price` + WHERE d.`id_zone` = '.(int)($id_zone).' + AND d.`id_carrier` = '.(int)($this->id).' + ORDER BY r.`delimiter2` DESC LIMIT 1'); + if (!isset($result[0]['price'])) + return false; + return $result[0]['price']; + } + + /** + * Get delivery prices for a given shipping method (price/weight) + * + * @param string $rangeTable Table name (price or weight) + * @return array Delivery prices + */ + public static function getDeliveryPriceByRanges($rangeTable, $id_carrier) + { + $rangeTable = pSQL($rangeTable); + return Db::getInstance()->ExecuteS(' + SELECT d.`id_'.$rangeTable.'`, d.`id_carrier`, d.`id_zone`, d.`price` + FROM `'._DB_PREFIX_.'delivery` d + LEFT JOIN `'._DB_PREFIX_.$rangeTable.'` r ON r.`id_'.$rangeTable.'` = d.`id_'.$rangeTable.'` + WHERE (d.`id_'.$rangeTable.'` IS NOT NULL AND d.`id_'.$rangeTable.'` != 0 AND d.`id_carrier` = '.(int)($id_carrier).') + ORDER BY r.`delimiter1` ASC'); + } + + /** + * Get all carriers in a given language + * + * @param integer $id_lang Language id + * @param $modules_filters, possible values: + PS_CARRIERS_ONLY + CARRIERS_MODULE + CARRIERS_MODULE_NEED_RANGE + PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE + ALL_CARRIERS + * @param boolean $active Returns only active carriers when true + * @return array Carriers + */ + public static function getCarriers($id_lang, $active = false, $delete = false, $id_zone = false, $ids_group = NULL, $modules_filters = 1) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + if ($ids_group) + { + $ids = ''; + foreach ($ids_group as $id) + $ids .= (int)($id).', '; + $ids = rtrim($ids, ', '); + if ($ids == '') + return (array()); + } + $sql = ' + SELECT c.*, cl.delay + FROM `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl ON (c.`id_carrier` = cl.`id_carrier` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'carrier_zone` cz ON (cz.`id_carrier` = c.`id_carrier`)'. + ($id_zone ? 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = '.(int)($id_zone).')' : '').' + WHERE c.`deleted` '.($delete ? '= 1' : ' = 0'). + ($active ? ' AND c.`active` = 1' : ''). + ($id_zone ? ' AND cz.`id_zone` = '.(int)($id_zone).' + AND z.`active` = 1 ' : ' '); + switch ($modules_filters) + { + case 1 : + $sql .= 'AND c.is_module = 0 '; + break; + case 2 : + $sql .= 'AND c.is_module = 1 '; + break; + case 3 : + $sql .= 'AND c.is_module = 1 AND c.need_range = 1 '; + break; + case 4 : + $sql .= 'AND (c.is_module = 0 OR c.need_range = 1) '; + break; + case 5 : + $sql .= ''; + break; + + } + $sql .= ($ids_group ? ' AND c.id_carrier IN (SELECT id_carrier FROM '._DB_PREFIX_.'carrier_group WHERE id_group IN ('.$ids.')) ' : '').' + GROUP BY c.`id_carrier`'; + + $carriers = Db::getInstance()->ExecuteS($sql); + + if (is_array($carriers) AND count($carriers)) + { + foreach ($carriers as $key => $carrier) + if ($carrier['name'] == '0') + $carriers[$key]['name'] = Configuration::get('PS_SHOP_NAME'); + } + else + $carriers = array(); + + return $carriers; + } + + public static function getCarriersForOrder($id_zone, $groups = NULL) + { + global $cookie, $cart; + + if (is_array($groups) AND !empty($groups)) + $result = Carrier::getCarriers((int)($cookie->id_lang), true, false, (int)($id_zone), $groups, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); + else + $result = Carrier::getCarriers((int)($cookie->id_lang), true, false, (int)($id_zone), array(1), PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); + $resultsArray = array(); + foreach ($result AS $k => $row) + { + $carrier = new Carrier((int)($row['id_carrier'])); + // Get only carriers that are compliant with shipping method + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + { + unset($result[$k]); + continue ; + } + + // If out-of-range behavior carrier is set on "Desactivate carrier" + if ($row['range_behavior']) + { + // Get id zone + if (!$id_zone) + $id_zone = (int)($defaultCountry->id_zone); + + // Get only carriers that have a range compatible with cart + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone))) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) + { + unset($result[$k]); + continue ; + } + } + $row['name'] = (strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME')); + $row['price'] = $cart->getOrderShippingCost((int)($row['id_carrier'])); + $row['price_tax_exc'] = $cart->getOrderShippingCost((int)($row['id_carrier']), false); + $row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)($row['id_carrier']).'.jpg') ? _THEME_SHIP_DIR_.(int)($row['id_carrier']).'.jpg' : ''; + + // If price is false, then the carrier is unavailable (carrier module) + if ($row['price'] === false) + { + unset($result[$k]); + continue ; + } + + $resultsArray[] = $row; + } + return $resultsArray; + } + + /** + * @param int $id_country + * @param array $groups + * @return Array carriers list + * @deprecated + */ + public static function getCarriersOpc($id_country, $groups = NULL) + { + Tools::displayAsDeprecated(); + + return self::getCarriersForOrder((int)Country::getIdZone((int)($id_country)), $groups); + } + + public static function checkCarrierZone($id_carrier, $id_zone) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_carrier` + FROM `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'carrier_zone` cz ON (cz.`id_carrier` = c.`id_carrier`) + LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = '.(int)($id_zone).') + WHERE c.`id_carrier` = '.(int)($id_carrier).' + AND c.`deleted` = 0 + AND c.`active` = 1 + AND cz.`id_zone` = '.(int)($id_zone).' + AND z.`active` = 1' + ); + } + + /** + * Get all zones + * + * @return array Zones + */ + public function getZones() + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'carrier_zone` cz + LEFT JOIN `'._DB_PREFIX_.'zone` z ON cz.`id_zone` = z.`id_zone` + WHERE cz.`id_carrier` = '. (int)($this->id)); + } + + /** + * Get a specific zones + * + * @return array Zone + */ + public function getZone($id_zone) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'carrier_zone` + WHERE `id_carrier` = '.(int)($this->id).' + AND `id_zone` = '.(int)($id_zone)); + } + + /** + * Add zone + */ + public function addZone($id_zone) + { + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'carrier_zone` (`id_carrier` , `id_zone`) + VALUES ('.(int)($this->id).', '.(int)($id_zone).')'); + } + + /** + * Delete zone + */ + public function deleteZone($id_zone) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'carrier_zone` + WHERE `id_carrier` = '.(int)($this->id).' + AND `id_zone` = '.(int)($id_zone).' LIMIT 1'); + } + + /** + * Clean delivery prices (weight/price) + * + * @param string $rangeTable Table name to clean (weight or price according to shipping method) + * @return boolean Deletion result + */ + public function deleteDeliveryPrice($rangeTable) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'delivery` WHERE `id_carrier` = '.(int)($this->id).' AND (`id_'.$rangeTable.'` IS NOT NULL OR `id_'.$rangeTable.'` = 0)'); + } + + /** + * Add new delivery prices + * + * @param string $priceList Prices list separated by commas + * @return boolean Insertion result + */ + public function addDeliveryPrice($priceList) + { + if (!Validate::isValuesList($priceList)) + die(Tools::displayError()); + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'delivery` (`id_range_price`, `id_range_weight`, `id_carrier`, `id_zone`, `price`) + VALUES '.$priceList); + } + + /** + * Copy old carrier informations when update carrier + * + * @param integer $oldId Old id carrier (copy from that id) + */ + public function copyCarrierData($oldId) + { + if (!Validate::isUnsignedId($oldId)) + die(Tools::displayError()); + + $oldLogo = _PS_SHIP_IMG_DIR_.'/'.(int)($oldId).'.jpg'; + if (file_exists($oldLogo)) + copy($oldLogo, _PS_SHIP_IMG_DIR_.'/'.(int)($this->id).'.jpg'); + + // Copy existing ranges price + $res = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'range_price` + WHERE id_carrier = '.(int)($oldId)); + foreach ($res AS $val) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'range_price` (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)($this->id).','.(float)($val['delimiter1']).','.(float)($val['delimiter2']).')'); + $maxRangePrice = Db::getInstance()->Insert_ID(); + $res2 = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'delivery` + WHERE id_carrier = '.(int)($oldId).' + AND id_range_price = '.(int)($val['id_range_price'])); + foreach ($res2 AS $val2) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'delivery` (`id_carrier`,`id_range_price`,`id_range_weight`,`id_zone`, `price`) + VALUES ('.(int)($this->id).','.(int)($maxRangePrice).',NULL,'.(int)($val2['id_zone']).','.(float)($val2['price']).')'); + } + + // Copy existing ranges weight + $res = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'range_weight` + WHERE id_carrier = '.(int)($oldId)); + foreach ($res as $val) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'range_weight` (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)($this->id).','.(float)($val['delimiter1']).','.(float)($val['delimiter2']).')'); + $maxRangeWeight = Db::getInstance()->Insert_ID(); + $res2 = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'delivery` + WHERE id_carrier = '.(int)($oldId).' + AND id_range_weight = '.(int)($val['id_range_weight'])); + foreach ($res2 as $val2) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'delivery` (`id_carrier`,`id_range_price`,`id_range_weight`,`id_zone`, `price`) + VALUES ('.(int)($this->id).',NULL,'.(int)($maxRangeWeight).','.(int)($val2['id_zone']).','.(float)($val2['price']).')'); + } + + // Copy existing zones + $res = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'carrier_zone` + WHERE id_carrier = '.(int)($oldId)); + foreach ($res as $val) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'carrier_zone` (`id_carrier`, `id_zone`) + VALUES ('.(int)($this->id).','.(int)($val['id_zone']).')'); + + //Copy default carrier + if ((int)(Configuration::get('PS_CARRIER_DEFAULT')) == $oldId) + Configuration::updateValue('PS_CARRIER_DEFAULT', (int)($this->id)); + } + + /** + * Check if carrier is used (at least one order placed) + * + * @return integer Order count for this carrier + */ + public function isUsed() + { + $row = Db::getInstance()->getRow(' + SELECT COUNT(`id_carrier`) AS total + FROM `'._DB_PREFIX_.'orders` + WHERE `id_carrier` = '.(int)($this->id)); + + return (int)($row['total']); + } + + + /** + * Get the price without taxes defined in carrier + * @deprecated + **/ + public function getPriceWithoutTaxes($productPrice) + { + Tools::displayAsDeprecated(); + $tax = new Tax($this->id_tax); + return round($productPrice - ($productPrice * $tax->rate / 100), 2); + } + + + public function getShippingMethod() + { + $method = (int)($this->shipping_method); + + if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT) + { + // backward compatibility + if ((int)(Configuration::get('PS_SHIPPING_METHOD'))) + $method = Carrier::SHIPPING_METHOD_WEIGHT; + else + $method = Carrier::SHIPPING_METHOD_PRICE; + } + + return $method; + } + + public function getRangeTable() + { + return ($this->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) ? 'range_weight' : 'range_price'; + } + + public function getRangeObject() + { + return ($this->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) ? new RangeWeight() : new RangePrice(); + } + + public function getRangeSuffix() + { + $suffix = Configuration::get('PS_WEIGHT_UNIT'); + if ($this->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE) + { + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $suffix = $currency->sign; + } + return $suffix; + } + + public static function getIdTaxRulesGroupByIdCarrier($id_carrier) + { + if (!isset(self::$_cache_tax_rule[(int)$id_carrier])) + { + self::$_cache_tax_rule[$id_carrier] = Db::getInstance()->getValue(' + SELECT `id_tax_rules_group` + FROM `'._DB_PREFIX_.'carrier` + WHERE `id_carrier` = '.(int)$id_carrier); + } + + return self::$_cache_tax_rule[$id_carrier]; + } +} + diff --git a/classes/CarrierModule.php b/classes/CarrierModule.php new file mode 100644 index 000000000..eabb7b2bf --- /dev/null +++ b/classes/CarrierModule.php @@ -0,0 +1,33 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class CarrierModuleCore extends Module +{ + abstract function getOrderShippingCost($params,$shipping_cost); + abstract function getOrderShippingCostExternal($params); +} + diff --git a/classes/Cart.php b/classes/Cart.php new file mode 100644 index 000000000..75b73e6a9 --- /dev/null +++ b/classes/Cart.php @@ -0,0 +1,1599 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CartCore extends ObjectModel +{ + public $id; + + /** @var integer Customer delivery address ID */ + public $id_address_delivery; + + /** @var integer Customer invoicing address ID */ + public $id_address_invoice; + + /** @var integer Customer currency ID */ + public $id_currency; + + /** @var integer Customer ID */ + public $id_customer; + + /** @var integer Guest ID */ + public $id_guest; + + /** @var integer Language ID */ + public $id_lang; + + /** @var integer Carrier ID */ + public $id_carrier; + + /** @var boolean True if the customer wants a recycled package */ + public $recyclable = 1; + + /** @var boolean True if the customer wants a gift wrapping */ + public $gift = 0; + + /** @var string Gift message if specified */ + public $gift_message; + + /** @var string Object creation date */ + public $date_add; + + /** @var string secure_key */ + public $secure_key; + + /** @var string Object last modification date */ + public $date_upd; + + protected static $_nbProducts = NULL; + protected static $_isVirtualCart = array(); + + protected $fieldsRequired = array('id_currency', 'id_lang'); + protected $fieldsValidate = array('id_address_delivery' => 'isUnsignedId', 'id_address_invoice' => 'isUnsignedId', + 'id_currency' => 'isUnsignedId', 'id_customer' => 'isUnsignedId', 'id_guest' => 'isUnsignedId', 'id_lang' => 'isUnsignedId', + 'id_carrier' => 'isUnsignedId', 'recyclable' => 'isBool', 'gift' => 'isBool', 'gift_message' => 'isMessage'); + + protected $_products = NULL; + protected static $_totalWeight = array(); + protected $_taxCalculationMethod = PS_TAX_EXC; + protected static $_discounts = NULL; + protected static $_discountsLite = NULL; + protected static $_carriers = NULL; + protected static $_taxes_rate = NULL; + protected static $_attributesLists = array(); + protected $table = 'cart'; + protected $identifier = 'id_cart'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_address_delivery' => array('xlink_resource' => 'addresses'), + 'id_address_invoice' => array('xlink_resource' => 'addresses'), + 'id_currency' => array('xlink_resource' => 'currencies'), + 'id_customer' => array('xlink_resource' => 'customers'), + 'id_guest' => array('xlink_resource' => 'guests'), + 'id_lang' => array('xlink_resource' => 'languages'), + 'id_carrier' => array('xlink_resource' => 'carriers'), + ), + 'associations' => array( + 'cart_rows' => array('resource' => 'cart_row', 'fields' => array( + 'id_product' => array('required' => true, 'xlink_resource' => 'products'), + 'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'), + 'quantity' => array('required' => true), + ) + ), + ), + ); + + const ONLY_PRODUCTS = 1; + const ONLY_DISCOUNTS = 2; + const BOTH = 3; + const BOTH_WITHOUT_SHIPPING = 4; + const ONLY_SHIPPING = 5; + const ONLY_WRAPPING = 6; + const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7; + + public function getFields() + { + parent::validateFields(); + + $fields['id_address_delivery'] = (int)($this->id_address_delivery); + $fields['id_address_invoice'] = (int)($this->id_address_invoice); + $fields['id_currency'] = (int)($this->id_currency); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_guest'] = (int)($this->id_guest); + $fields['id_lang'] = (int)($this->id_lang); + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['recyclable'] = (int)($this->recyclable); + $fields['gift'] = (int)($this->gift); + $fields['secure_key'] = pSQL($this->secure_key); + $fields['gift_message'] = pSQL($this->gift_message); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id, $id_lang); + if ($this->id_customer) + { + $customer = new Customer((int)($this->id_customer)); + $this->_taxCalculationMethod = Group::getPriceDisplayMethod((int)($customer->id_default_group)); + if (!$this->secure_key AND $customer->secure_key) + { + $this->secure_key = $customer->secure_key; + $this->save(); + } + } + else + $this->_taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); + } + + public function add($autodate = true, $nullValues = false) + { + $return = parent::add($autodate); + Module::hookExec('cart'); + return $return; + } + + public function update($nullValues = false) + { + self::$_nbProducts = NULL; + $this->_products = NULL; + $return = parent::update(); + Module::hookExec('cart'); + return $return; + } + + public function delete() + { + if (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_discount` WHERE `id_cart` = '.(int)($this->id)) OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart` = '.(int)($this->id))) + return false; + return parent::delete(); + } + + static public function getTaxesAverageUsed($id_cart) + { + $cart = new Cart((int)($id_cart)); + if (!Validate::isLoadedObject($cart)) + die(Tools::displayError()); + + if (!Configuration::get('PS_TAX')) + return 0; + + $products = $cart->getProducts(); + $totalProducts_moy = 0; + $ratioTax = 0; + + if (!sizeof($products)) + return 0; + + foreach ($products AS $product) + { + $totalProducts_moy += $product['total_wt']; + $ratioTax += $product['total_wt'] * Tax::getProductTaxRate((int)$product['id_product'], (int)$cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + } + + if ($totalProducts_moy > 0) + return $ratioTax / $totalProducts_moy; + + return 0; + } + + /** + * Return cart discounts + * + * @result array Discounts + */ + public function getDiscounts($lite = false, $refresh = false) + { + if (!$this->id) + return array(); + if (!$lite AND !$refresh AND isset(self::$_discounts[$this->id])) + return self::$_discounts[$this->id]; + if ($lite AND isset(self::$_discountsLite[$this->id])) + return self::$_discountsLite[$this->id]; + + $result = Db::getInstance()->ExecuteS(' + SELECT d.*, `id_cart` + FROM `'._DB_PREFIX_.'cart_discount` c + LEFT JOIN `'._DB_PREFIX_.'discount` d ON c.`id_discount` = d.`id_discount` + WHERE `id_cart` = '.(int)($this->id)); + + $products = $this->getProducts(); + foreach ($result AS $k => $discount) + { + $categories = Discount::getCategories((int)($discount['id_discount'])); + $in_category = false; + foreach ($products AS $product) + if (Product::idIsOnCategoryId((int)($product['id_product']), $categories)) + { + $in_category = true; + break; + } + if (!$in_category) + unset($result[$k]); + } + + if ($lite) + { + self::$_discountsLite[$this->id] = $result; + return $result; + } + + $total_products_wt = $this->getOrderTotal(true, Cart::ONLY_PRODUCTS); + $total_products = $this->getOrderTotal(false, Cart::ONLY_PRODUCTS); + $shipping_wt = $this->getOrderShippingCost(); + $shipping = $this->getOrderShippingCost(NULL, false); + self::$_discounts[$this->id] = array(); + foreach ($result as $row) + { + $discount = new Discount($row['id_discount'], (int)($this->id_lang)); + $row['description'] = $discount->description ? $discount->description : $discount->name; + $row['value_real'] = $discount->getValue(sizeof($result), $total_products_wt, $shipping_wt, $this->id); + $row['value_tax_exc'] = $discount->getValue(sizeof($result), $total_products, $shipping, $this->id, false); + self::$_discounts[$this->id][] = $row; + } + + return isset(self::$_discounts[$this->id]) ? self::$_discounts[$this->id] : NULL; + } + + public function getDiscountsCustomer($id_discount) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_discount` + FROM `'._DB_PREFIX_.'cart_discount` + WHERE `id_discount` = '.(int)($id_discount).' AND `id_cart` = '.(int)($this->id)); + + return Db::getInstance()->NumRows(); + } + + public function getLastProduct() + { + $sql = ' + SELECT `id_product`, `id_product_attribute` + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_cart` = '.(int)($this->id).' + ORDER BY `date_add` DESC'; + $result = Db::getInstance()->getRow($sql); + if ($result AND isset($result['id_product']) AND $result['id_product']) + return $result; + return false; + } + + /** + * Return cart products + * + * @result array Products + */ + public function getProducts($refresh = false, $id_product = false) + { + if (!$this->id) + return array(); + // Product cache must be strictly compared to NULL, or else an empty cart will add dozens of queries + if ($this->_products !== NULL AND !$refresh) + return $this->_products; + $sql = ' + SELECT cp.`id_product_attribute`, cp.`id_product`, cu.`id_customization`, cp.`quantity` AS cart_quantity, cu.`quantity` AS customization_quantity, pl.`name`, + pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, p.`id_category_default`, p.`id_supplier`, p.`id_manufacturer`, p.`on_sale`, p.`ecotax`, p.`additional_shipping_cost`, p.`available_for_order`, + p.`quantity`, p.`price`, p.`weight`, p.`width`, p.`height`, p.`depth`, p.`out_of_stock`, p.`active`, p.`date_add`, p.`date_upd`, IFNULL(pa.`minimal_quantity`, p.`minimal_quantity`) as minimal_quantity, + t.`id_tax`, tl.`name` AS tax, t.`rate`, pa.`price` AS price_attribute, pa.`quantity` AS quantity_attribute, + pa.`ecotax` AS ecotax_attr, i.`id_image`, il.`legend`, pl.`link_rewrite`, cl.`link_rewrite` AS category, CONCAT(cp.`id_product`, cp.`id_product_attribute`) AS unique_id, + IF (IFNULL(pa.`reference`, \'\') = \'\', p.`reference`, pa.`reference`) AS reference, + IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference, + (p.`weight`+ pa.`weight`) weight_attribute, + IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13, IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc, + pai.`id_image` as pai_id_image + FROM `'._DB_PREFIX_.'cart_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$this->id_lang.') + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product_attribute` = cp.`id_product_attribute`) + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)$this->id_lang.') + LEFT JOIN `'._DB_PREFIX_.'customization` cu ON (p.`id_product` = cu.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` pai ON (pai.`id_product_attribute` = pa.`id_product_attribute`) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (IF(pai.`id_image`, + i.`id_image` = + (SELECT i2.`id_image` + FROM `'._DB_PREFIX_.'image` i2 + INNER JOIN `'._DB_PREFIX_.'product_attribute_image` pai2 ON (pai2.`id_image` = i2.`id_image`) + WHERE i2.`id_product` = p.`id_product` AND pai2.`id_product_attribute` = pa.`id_product_attribute` + ORDER BY i2.`position` + LIMIT 1), + i.`id_product` = p.`id_product` AND i.`cover` = 1) + ) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->id_lang.') + WHERE cp.`id_cart` = '.(int)$this->id.' + '.($id_product ? ' AND cp.`id_product` = '.(int)$id_product : '').' + AND p.`id_product` IS NOT NULL + GROUP BY unique_id + ORDER BY cp.date_add ASC'; + $result = Db::getInstance()->ExecuteS($sql); + // Reset the cache before the following return, or else an empty cart will add dozens of queries + + $productsIds = array(); + $paIds = array(); + foreach ($result as $row) + { + $productsIds[] = $row['id_product']; + $paIds[] = $row['id_product_attribute']; + } + // Thus you can avoid one query per product, because there will be only one query for all the products of the cart + Product::cacheProductsFeatures($productsIds); + self::cacheSomeAttributesLists($paIds, $this->id_lang); + + $this->_products = array(); + if (empty($result)) + return array(); + foreach ($result AS $k => $row) + { + if (isset($row['ecotax_attr']) AND $row['ecotax_attr'] > 0) + $row['ecotax'] = (float)($row['ecotax_attr']); + $row['stock_quantity'] = (int)($row['quantity']); + // for compatibility with 1.2 themes + $row['quantity'] = (int)($row['cart_quantity']); + if (isset($row['id_product_attribute']) AND (int)$row['id_product_attribute']) + { + $row['weight'] = $row['weight_attribute']; + $row['stock_quantity'] = $row['quantity_attribute']; + } + if ($this->_taxCalculationMethod == PS_TAX_EXC) + { + $row['price'] = Product::getPriceStatic((int)$row['id_product'], false, isset($row['id_product_attribute']) ? (int)($row['id_product_attribute']) : NULL, 2, NULL, false, true, (int)($row['cart_quantity']), false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput); // Here taxes are computed only once the quantity has been applied to the product price + $row['price_wt'] = Product::getPriceStatic((int)$row['id_product'], true, isset($row['id_product_attribute']) ? (int)($row['id_product_attribute']) : NULL, 2, NULL, false, true, (int)($row['cart_quantity']), false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL)); + $tax_rate = Tax::getProductTaxRate((int)$id_product, (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + $row['total_wt'] = Tools::ps_round($row['price'] * (float)$row['cart_quantity'] * (1 + (float)($tax_rate) / 100), 2); + $row['total'] = $row['price'] * (int)($row['cart_quantity']); + } + else + { + $row['price'] = Product::getPriceStatic((int)$row['id_product'], false, (int)$row['id_product_attribute'], 6, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput); + $row['price_wt'] = Product::getPriceStatic((int)$row['id_product'], true, (int)$row['id_product_attribute'], 2, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL)); + + /* In case when you use QuantityDiscount, getPriceStatic() can be return more of 2 decimals */ + $row['price_wt'] = Tools::ps_round($row['price_wt'], 2); + $row['total_wt'] = $row['price_wt'] * (int)($row['cart_quantity']); + $row['total'] = Tools::ps_round($row['price'] * (int)($row['cart_quantity']), 2); + } + $row['reduction_applies'] = $specificPriceOutput AND (float)($specificPriceOutput['reduction']); + $row['id_image'] = Product::defineProductImage($row,$this->id_lang); + $row['allow_oosp'] = Product::isAvailableWhenOutOfStock($row['out_of_stock']); + $row['features'] = Product::getFeaturesStatic((int)$row['id_product']); + if (array_key_exists($row['id_product_attribute'].'-'.$this->id_lang, self::$_attributesLists)) + $row = array_merge($row, self::$_attributesLists[$row['id_product_attribute'].'-'.$this->id_lang]); + + $this->_products[] = $row; + } + return $this->_products; + } + + public static function cacheSomeAttributesLists($ipaList, $id_lang) + { + $paImplode = array(); + $attributesList = array(); + $attributesListSmall = array(); + foreach ($ipaList as $id_product_attribute) + if ((int)$id_product_attribute AND !array_key_exists($id_product_attribute.'-'.$id_lang, self::$_attributesLists)) + { + $paImplode[] = (int)$id_product_attribute; + self::$_attributesLists[(int)$id_product_attribute.'-'.$id_lang] = array('attributes' => '', 'attributes_small' => ''); + } + if (!count($paImplode)) + return; + + $result = Db::getInstance()->ExecuteS(' + SELECT pac.`id_product_attribute`, agl.`public_name` AS public_group_name, al.`name` AS attribute_name + FROM `'._DB_PREFIX_.'product_attribute_combination` pac + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.') + WHERE pac.`id_product_attribute` IN ('.implode($paImplode, ',').') + ORDER BY agl.`public_name` ASC'); + + foreach ($result as $row) + { + self::$_attributesLists[$row['id_product_attribute'].'-'.$id_lang]['attributes'] .= $row['public_group_name'].' : '.$row['attribute_name'].', '; + self::$_attributesLists[$row['id_product_attribute'].'-'.$id_lang]['attributes_small'] .= $row['attribute_name'].', '; + } + + foreach ($paImplode as $id_product_attribute) + { + self::$_attributesLists[$id_product_attribute.'-'.$id_lang]['attributes'] = rtrim(self::$_attributesLists[$id_product_attribute.'-'.$id_lang]['attributes'], ', '); + self::$_attributesLists[$id_product_attribute.'-'.$id_lang]['attributes_small'] = rtrim(self::$_attributesLists[$id_product_attribute.'-'.$id_lang]['attributes_small'], ', '); + } + } + + /** + * Return cart products quantity + * + * @result integer Products quantity + */ + public function nbProducts() + { + if (!$this->id) + return 0; + return self::getNbProducts($this->id); + } + + public static function getNbProducts($id) + { + // Must be strictly compared to NULL, or else an empty cart will bypass the cache and add dozens of queries + if (self::$_nbProducts !== NULL) + return self::$_nbProducts; + self::$_nbProducts = (int)(Db::getInstance()->getValue('SELECT SUM(`quantity`) FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart` = '.(int)($id))); + return self::$_nbProducts; + } + + /** + * Add a discount to the cart (NO controls except doubles) + * + * @param integer $id_discount The discount to add to the cart + * @result boolean Update result + */ + public function addDiscount($id_discount) + { + return Db::getInstance()->AutoExecute(_DB_PREFIX_.'cart_discount', array('id_discount' => (int)($id_discount), 'id_cart' => (int)($this->id)), 'INSERT'); + } + + public function containsProduct($id_product, $id_product_attribute, $id_customization) + { + return Db::getInstance()->getRow(' + SELECT cp.`quantity` + FROM `'._DB_PREFIX_.'cart_product` cp + '.($id_customization ? 'LEFT JOIN `'._DB_PREFIX_.'customization` c ON (c.`id_product` = cp.`id_product` AND c.`id_product_attribute` = cp.`id_product_attribute`)' : '').' + WHERE cp.`id_product` = '.(int)$id_product.' AND cp.`id_product_attribute` = '.(int)$id_product_attribute.' AND cp.`id_cart` = '.(int)$this->id. + ($id_customization ? ' AND c.`id_customization` = '.(int)$id_customization : '')); + } + + /** + * Update product quantity + * + * @param integer $quantity Quantity to add (or substract) + * @param integer $id_product Product ID + * @param integer $id_product_attribute Attribute ID if needed + * @param string $operator Indicate if quantity must be increased or decreased + */ + public function updateQty($quantity, $id_product, $id_product_attribute = NULL, $id_customization = false, $operator = 'up') + { + $product = new Product((int)$id_product, false, (int)Configuration::get('PS_LANG_DEFAULT')); + + /* If we have a product combination, the minimal quantity is set with the one of this combination */ + if (!empty($id_product_attribute)) + $minimalQuantity = (int)Attribute::getAttributeMinimalQty((int)$id_product_attribute); + else + $minimalQuantity = (int)$product->minimal_quantity; + + if (!Validate::isLoadedObject($product)) + die(Tools::displayError()); + self::$_nbProducts = NULL; + if (array_key_exists($this->id, self::$_totalWeight)) + unset(self::$_totalWeight[$this->id]); + if ((int)$quantity <= 0) + return $this->deleteProduct((int)$id_product, (int)$id_product_attribute, (int)$id_customization); + elseif (!$product->available_for_order OR Configuration::get('PS_CATALOG_MODE')) + return false; + else + { + /* Check if the product is already in the cart */ + $result = $this->containsProduct((int)$id_product, (int)$id_product_attribute, (int)$id_customization); + + /* Update quantity if product already exist */ + if (Db::getInstance()->NumRows()) + { + if ($operator == 'up') + { + $result2 = Db::getInstance()->getRow(' + SELECT '.(!empty($id_product_attribute) ? 'pa' : 'p').'.`quantity`, p.`out_of_stock` + FROM `'._DB_PREFIX_.'product` p + '.(!empty($id_product_attribute) ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON p.`id_product` = pa.`id_product`' : '').' + WHERE p.`id_product` = '.(int)($id_product). + (!empty($id_product_attribute) ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '')); + $productQty = (int)$result2['quantity']; + $newQty = (int)$result['quantity'] + (int)$quantity; + $qty = '+ '.(int)$quantity; + + if (!Product::isAvailableWhenOutOfStock((int)$result2['out_of_stock'])) + if ($newQty > $productQty) + return false; + } + elseif ($operator == 'down') + { + $qty = '- '.(int)$quantity; + $newQty = (int)$result['quantity'] - (int)$quantity; + if ($newQty < $minimalQuantity AND $minimalQuantity > 1) + return -1; + } + else + return false; + + /* Delete product from cart */ + if ($newQty <= 0) + return $this->deleteProduct((int)$id_product, (int)$id_product_attribute, (int)$id_customization); + elseif ($newQty < $minimalQuantity) + return -1; + else + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cart_product` + SET `quantity` = `quantity` '.$qty.' + WHERE `id_product` = '.(int)$id_product. + (!empty($id_product_attribute) ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '').' + AND `id_cart` = '.(int)$this->id.' + LIMIT 1'); + } + + /* Add produt to the cart */ + else + { + $result2 = Db::getInstance()->getRow(' + SELECT '.(!empty($id_product_attribute) ? 'pa' : 'p').'.`quantity`, p.`out_of_stock` + FROM `'._DB_PREFIX_.'product` p + '.(!empty($id_product_attribute) ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON p.`id_product` = pa.`id_product`' : '').' + WHERE p.`id_product` = '.(int)$id_product. + (!empty($id_product_attribute) ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '')); + + if (!Product::isAvailableWhenOutOfStock((int)$result2['out_of_stock'])) + if ((int)$quantity > $result2['quantity']) + return false; + + if ((int)$quantity < $minimalQuantity) + return -1; + + if (!Db::getInstance()->AutoExecute(_DB_PREFIX_.'cart_product', array('id_product' => (int)$id_product, + 'id_product_attribute' => (int)$id_product_attribute, 'id_cart' => (int)$this->id, + 'quantity' => (int)$quantity, 'date_add' => date('Y-m-d H:i:s')), 'INSERT')) + return false; + } + } + // refresh cache of self::_products + $this->_products = $this->getProducts(true); + $this->update(true); + + if ($product->customizable) + return $this->_updateCustomizationQuantity((int)$quantity, (int)$id_customization, (int)$id_product, (int)$id_product_attribute, $operator); + else + return true; + } + + /* + ** Customization management + */ + protected function _updateCustomizationQuantity($quantity, $id_customization, $id_product, $id_product_attribute, $operator = 'up') + { + global $cookie; + + /* Getting datas */ + $files = $cookie->getFamily('pictures_'.(int)($id_product).'_'); + $textFields = $cookie->getFamily('textFields_'.(int)($id_product).'_'); + /* Customization addition */ + if (count($files) > 0 OR count($textFields) > 0) + return $this->_addCustomization((int)$id_product, (int)$id_product_attribute, $files, $textFields, (int)$quantity); + /* Deletion */ + if (!empty($id_customization) AND (int)($quantity) < 1) + return $this->_deleteCustomization((int)$id_customization, (int)$id_product, (int)$id_product_attribute); + /* Quantity update */ + if (!empty($id_customization)) + { + $result = Db::getInstance()->getRow('SELECT `quantity` FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.(int)$id_customization); + if ($result AND Db::getInstance()->NumRows()) + { + if ($operator == 'down' AND (int)($result['quantity']) - (int)($quantity) < 1) + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.(int)$id_customization); + return Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization` SET `quantity` = `quantity` '.($operator == 'up' ? '+ ' : '- ').(int)($quantity).' WHERE `id_customization` = '.(int)($id_customization)); + } + } + // refresh cache of self::_products + $this->_products = $this->getProducts(true); + $this->update(true); + return true; + } + + public function _addCustomization($id_product, $id_product_attribute, $files, $textFields, $quantity) + { + if (!is_array($files) OR !is_array($textFields)) + die(Tools::displayError()); + /* Copying them inside the db */ + if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'customization` (`id_cart`, `id_product`, `id_product_attribute`, `quantity`) VALUES ('.(int)($this->id).', '.(int)($id_product).', '.(int)($id_product_attribute).', '.(int)($quantity).')')) + return false; + if (!$id_customization = Db::getInstance()->Insert_ID()) + return false; + $query = 'INSERT INTO `'._DB_PREFIX_.'customized_data` (`id_customization`, `type`, `index`, `value`) VALUES '; + if (count($files)) + foreach ($files AS $key => $filename) + { + $tmp = explode('_', $key); + $query .= '('.(int)($id_customization).', '._CUSTOMIZE_FILE_.', '.$tmp[2].', \''.$filename.'\'), '; + } + if (count($textFields)) + foreach ($textFields AS $key => $textFieldValue) + { + $tmp = explode('_', $key); + $query .= '('.(int)($id_customization).', '._CUSTOMIZE_TEXTFIELD_.', '.$tmp[2].', \''.$textFieldValue.'\'), '; + } + $query = rtrim($query, ', '); + if (!$result = Db::getInstance()->Execute($query)) + return false; + /* Deleting customized informations from the cart (we just copied them inside the db) */ + return Cart::deleteCustomizationInformations((int)($id_product)); + } + + /** + * Check if order has already been placed + * + * @return boolean result + */ + public function OrderExists() + { + $result = Db::getInstance()->ExecuteS('SELECT `id_cart` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)($this->id)); + return Db::getInstance()->NumRows(); + } + + /* + ** Deletion + */ + + /** + * Delete a discount from the cart + * + * @param integer $id_discount Discount ID + * @return boolean result + */ + public function deleteDiscount($id_discount) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_discount` WHERE `id_discount` = '.(int)($id_discount).' AND `id_cart` = '.(int)($this->id).' LIMIT 1'); + } + + /** + * Delete a product from the cart + * + * @param integer $id_product Product ID + * @param integer $id_product_attribute Attribute ID if needed + * @param integer $id_customization Customization id + * @return boolean result + */ + public function deleteProduct($id_product, $id_product_attribute = NULL, $id_customization = NULL) + { + self::$_nbProducts = NULL; + if ((int)($id_customization)) + { + $productTotalQuantity = (int)(Db::getInstance()->getValue('SELECT `quantity` + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_product` = '.(int)($id_product).' AND `id_product_attribute` = '.(int)($id_product_attribute))); + $customizationQuantity = (int)(Db::getInstance()->getValue('SELECT `quantity` + FROM `'._DB_PREFIX_.'customization` + WHERE `id_cart` = '.(int)($this->id).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute))); + if (!$this->_deleteCustomization((int)($id_customization), (int)($id_product), (int)($id_product_attribute))) + return false; + // refresh cache of self::_products + $this->_products = $this->getProducts(true); + return ($customizationQuantity == $productTotalQuantity AND $this->deleteProduct((int)($id_product), $id_product_attribute, NULL)); + } + + /* Get customization quantity */ + if (($result = Db::getInstance()->getRow('SELECT SUM(`quantity`) AS \'quantity\' FROM `'._DB_PREFIX_.'customization` WHERE `id_cart` = '.(int)($this->id).' AND `id_product` = '.(int)($id_product).' AND `id_product_attribute` = '.(int)($id_product_attribute))) === false) + return false; + + /* If the product still possesses customization it does not have to be deleted */ + if (Db::getInstance()->NumRows() AND (int)($result['quantity'])) + return Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cart_product` SET `quantity` = '.(int)($result['quantity']).' WHERE `id_cart` = '.(int)($this->id).' AND `id_product` = '.(int)($id_product).($id_product_attribute != NULL ? ' AND `id_product_attribute` = '.(int)($id_product_attribute) : '')); + + /* Product deletion */ + if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_product` WHERE `id_product` = '.(int)($id_product).($id_product_attribute != NULL ? ' AND `id_product_attribute` = '.(int)($id_product_attribute) : '').' AND `id_cart` = '.(int)($this->id))) + { + // refresh cache of self::_products + $this->_products = $this->getProducts(true); + /* Update cart */ + return $this->update(true); + } + return false; + } + + /** + * Delete a customization from the cart. If customization is a Picture (type=2), + * then the image is also deleted + * + * @param integer $id_customization + * @return boolean result + */ + protected function _deleteCustomization($id_customization, $id_product, $id_product_attribute) + { + $result = true; + $customization = Db::getInstance()->getRow('SELECT * + FROM `'._DB_PREFIX_.'customization` + WHERE `id_customization` = '.(int)($id_customization)); + + if ($customization and sizeof($customization)) + { + $custData = Db::getInstance()->getRow('SELECT * + FROM `'._DB_PREFIX_.'customized_data` + WHERE `id_customization` = '.(int)($id_customization)); + + if (isset($custData['type']) and $custData['type'] == 0) + $result &= $this->deletePictureToProduct($id_product,$custData['value']); + + $result &= Db::getInstance()->execute('DELETE + FROM `'._DB_PREFIX_.'customized_data` + WHERE `id_customization` = '.(int)($id_customization)); + + if($result) + $result &= Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cart_product` + SET `quantity` = `quantity` - '.(int)($customization['quantity']).' + WHERE `id_cart` = '.(int)($this->id).' + AND `id_product` = '.(int)($id_product).((int)($id_product_attribute) ? ' + AND `id_product_attribute` = '.(int)($id_product_attribute) : '')); + + if (!$result) + return false; + + return Db::getInstance()->Execute('DELETE + FROM `'._DB_PREFIX_.'customization` + WHERE `id_customization` = '.(int)($id_customization)); + } + + return true; + } + + static public function getTotalCart($id_cart, $use_tax_display = false) + { + $cart = new Cart((int)($id_cart)); + if (!Validate::isLoadedObject($cart)) + die(Tools::displayError()); + $with_taxes = $use_tax_display ? $cart->_taxCalculationMethod != PS_TAX_EXC : true; + return Tools::displayPrice($cart->getOrderTotal($with_taxes), Currency::getCurrencyInstance((int)($cart->id_currency)), false, false); + } + + + public static function getOrderTotalUsingTaxCalculationMethod($id_cart) + { + return Cart::getTotalCart($id_cart, true); + } + + /** + * This function returns the total cart amount + * + * Possible values for $type: + * Cart::ONLY_PRODUCTS + * Cart::ONLY_DISCOUNTS + * Cart::BOTH + * Cart::BOTH_WITHOUT_SHIPPING + * Cart::ONLY_SHIPPING + * Cart::ONLY_WRAPPING + * Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING + * + * @param boolean $withTaxes With or without taxes + * @param integer $type Total type + * @return float Order total + */ + public function getOrderTotal($withTaxes = true, $type = Cart::BOTH) + { + if (!$this->id) + return 0; + $type = (int)($type); + if (!in_array($type, array(Cart::ONLY_PRODUCTS, Cart::ONLY_DISCOUNTS, Cart::BOTH, Cart::BOTH_WITHOUT_SHIPPING, Cart::ONLY_SHIPPING, Cart::ONLY_WRAPPING, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING))) + die(Tools::displayError()); + + // no shipping cost if is a cart with only virtuals products + $virtual = $this->isVirtualCart(); + if ($virtual AND $type == Cart::ONLY_SHIPPING) + return 0; + if ($virtual AND $type == Cart::BOTH) + $type = Cart::BOTH_WITHOUT_SHIPPING; + $shipping_fees = ($type != Cart::BOTH_WITHOUT_SHIPPING AND $type != Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING) ? $this->getOrderShippingCost(NULL, (int)($withTaxes)) : 0; + if ($type == Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING) + $type = Cart::ONLY_PRODUCTS; + + $products = $this->getProducts(); + $order_total = 0; + if (Tax::excludeTaxeOption()) + $withTaxes = false; + foreach ($products AS $product) + { + if ($this->_taxCalculationMethod == PS_TAX_EXC) + { + + // Here taxes are computed only once the quantity has been applied to the product price + $price = Product::getPriceStatic((int)$product['id_product'], false, (int)$product['id_product_attribute'], 2, NULL, false, true, $product['cart_quantity'], false, (int)$this->id_customer ? (int)$this->id_customer : NULL, (int)$this->id, ($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + + $total_ecotax = $product['ecotax'] * (int)$product['cart_quantity']; + $total_price = $price * (int)$product['cart_quantity']; + + if ($withTaxes) + { + $total_price = ($total_price - $total_ecotax) * (1 + (float)(Tax::getProductTaxRate((int)$product['id_product'], (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})) / 100); + $total_price = Tools::ps_round($total_price - $total_ecotax, 2); + } + } + else + { + + $price = Product::getPriceStatic((int)($product['id_product']), $withTaxes, (int)($product['id_product_attribute']), 6, NULL, false, true, $product['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL)); + $total_price = Tools::ps_round($price, 2) * (int)($product['cart_quantity']); + } + $order_total += $total_price; + } + $order_total_products = $order_total; + if ($type == Cart::ONLY_DISCOUNTS) + $order_total = 0; + // Wrapping Fees + $wrapping_fees = 0; + if ($this->gift) + { + $wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')); + if ($withTaxes) + { + $wrapping_fees_tax = new Tax((int)(Configuration::get('PS_GIFT_WRAPPING_TAX'))); + $wrapping_fees *= 1 + (((float)($wrapping_fees_tax->rate) / 100)); + } + $wrapping_fees = Tools::convertPrice(Tools::ps_round($wrapping_fees, 2), Currency::getCurrencyInstance((int)($this->id_currency))); + } + + if ($type != Cart::ONLY_PRODUCTS) + { + $discounts = array(); + /* Firstly get all discounts, looking for a free shipping one (in order to substract shipping fees to the total amount) */ + if ($discountIds = $this->getDiscounts(true)) + { + foreach ($discountIds AS $id_discount) + { + $discount = new Discount((int)($id_discount['id_discount'])); + if (Validate::isLoadedObject($discount)) + { + $discounts[] = $discount; + if ($discount->id_discount_type == 3) + foreach($products AS $product) + { + $categories = Discount::getCategories($discount->id); + if (count($categories) AND Product::idIsOnCategoryId($product['id_product'], $categories)) + { + if($type == Cart::ONLY_DISCOUNTS) + $order_total -= $shipping_fees; + $shipping_fees = 0; + break; + } + } + } + } + /* Secondly applying all vouchers to the correct amount */ + $shrunk = false; + foreach ($discounts AS $discount) + if ($discount->id_discount_type != 3) + { + $order_total -= Tools::ps_round((float)($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, (int)($withTaxes))), 2); + if ($discount->id_discount_type == 2) + if (in_array($discount->behavior_not_exhausted, array(1,2))) + $shrunk = true; + } + + $order_total_discount = 0; + if ($shrunk AND $order_total < (-$wrapping_fees - $order_total_products - $shipping_fees)) + $order_total_discount = -$wrapping_fees - $order_total_products - $shipping_fees; + else + $order_total_discount = $order_total; + } + } + + if ($type == Cart::ONLY_SHIPPING) return $shipping_fees; + if ($type == Cart::ONLY_WRAPPING) return $wrapping_fees; + if ($type == Cart::BOTH) $order_total += $shipping_fees + $wrapping_fees; + if ($order_total < 0 AND $type != Cart::ONLY_DISCOUNTS) return 0; + if ($type == Cart::ONLY_DISCOUNTS AND isset($order_total_discount)) + return Tools::ps_round((float)($order_total_discount), 2); + return Tools::ps_round((float)($order_total), 2); + } + + /** + * Return shipping total + * + * @param integer $id_carrier Carrier ID (default : current carrier) + * @return float Shipping total + */ + function getOrderShippingCost($id_carrier = NULL, $useTax = true) + { + global $defaultCountry; + + if ($this->isVirtualCart()) + return 0; + + // Checking discounts in cart + $products = $this->getProducts(); + $discounts = $this->getDiscounts(true); + if ($discounts) + foreach ($discounts AS $id_discount) + if ($id_discount['id_discount_type'] == 3) + { + if ($id_discount['minimal'] > 0) + { + $total_cart = 0; + + $categories = Discount::getCategories((int)($id_discount['id_discount'])); + if (sizeof($categories)) + foreach($products AS $product) + if (Product::idIsOnCategoryId((int)($product['id_product']), $categories)) + $total_cart += $product['total_wt']; + + if ($total_cart >= $id_discount['minimal']) + return 0; + } + else + return 0; + } + + // Order total in default currency without fees + $order_total = $this->getOrderTotal(true, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING); + + // Start with shipping cost at 0 + $shipping_cost = 0; + + // If no product added, return 0 + if ($order_total <= 0 AND !(int)(self::getNbProducts($this->id))) + return $shipping_cost; + + // Get id zone + if ( + isset($this->id_address_delivery) + AND $this->id_address_delivery + AND Customer::customerHasAddress($this->id_customer, $this->id_address_delivery) + ) + $id_zone = Address::getZoneById((int)($this->id_address_delivery)); + else + $id_zone = (int)($defaultCountry->id_zone); + + // If no carrier, select default one + if (!$id_carrier) + $id_carrier = $this->id_carrier; + if (empty($id_carrier)) + { + $carrier = new Carrier((int)(Configuration::get('PS_CARRIER_DEFAULT')), Configuration::get('PS_LANG_DEFAULT')); + + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND (Carrier::checkDeliveryPriceByWeight((int)(Configuration::get('PS_CARRIER_DEFAULT')), $this->getTotalWeight(), $id_zone))) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND (Carrier::checkDeliveryPriceByPrice((int)(Configuration::get('PS_CARRIER_DEFAULT')), $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, (int)($this->id_currency))))) + { + $id_carrier = (int)(Configuration::get('PS_CARRIER_DEFAULT')); + } + + unset($carrier); + } + + if (empty($id_carrier)) + { + if ((int)($this->id_customer)) + { + $customer = new Customer((int)($this->id_customer)); + $result = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true, false, (int)($id_zone), $customer->getGroups()); + unset($customer); + } + else + $result = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true, false, (int)($id_zone)); + + $resultsArray = array(); + foreach ($result AS $k => $row) + { + if ($row['id_carrier'] == Configuration::get('PS_CARRIER_DEFAULT')) + continue; + + if (!isset(self::$_carriers[$row['id_carrier']])) + self::$_carriers[$row['id_carrier']] = new Carrier((int)($row['id_carrier'])); + + $carrier = self::$_carriers[$row['id_carrier']]; + + // Get only carriers that are compliant with shipping method + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + { + unset($result[$k]); + continue ; + } + + // If out-of-range behavior carrier is set on "Desactivate carrier" + if ($row['range_behavior']) + { + // Get only carriers that have a range compatible with cart + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), $id_zone))) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, (int)($this->id_currency))))) + { + unset($result[$k]); + continue ; + } + } + + if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) + { + $shipping = $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone); + + if (!isset($tmp)) + $tmp = $shipping; + + if ($shipping <= $tmp) + $id_carrier = (int)($row['id_carrier']); + } + else // by price + { + $shipping = $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)($this->id_currency)); + + if (!isset($tmp)) + $tmp = $shipping; + + if ($shipping <= $tmp) + $id_carrier = (int)($row['id_carrier']); + } + } + } + + if (empty($id_carrier)) + $id_carrier = Configuration::get('PS_CARRIER_DEFAULT'); + + if (!isset(self::$_carriers[$id_carrier])) + self::$_carriers[$id_carrier] = new Carrier((int)($id_carrier), Configuration::get('PS_LANG_DEFAULT')); + $carrier = self::$_carriers[$id_carrier]; + if (!Validate::isLoadedObject($carrier)) + die(Tools::displayError('Fatal error: "no default carrier"')); + if (!$carrier->active) + return $shipping_cost; + // Select carrier tax + if ($useTax AND !Tax::excludeTaxeOption()) + $carrierTax = Tax::getCarrierTaxRate((int)$carrier->id, (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + + $configuration = Configuration::getMultiple(array('PS_SHIPPING_FREE_PRICE', 'PS_SHIPPING_HANDLING', 'PS_SHIPPING_METHOD', 'PS_SHIPPING_FREE_WEIGHT')); + // Free fees + $free_fees_price = 0; + if (isset($configuration['PS_SHIPPING_FREE_PRICE'])) + $free_fees_price = Tools::convertPrice((float)($configuration['PS_SHIPPING_FREE_PRICE']), Currency::getCurrencyInstance((int)($this->id_currency))); + $orderTotalwithDiscounts = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING); + if ($orderTotalwithDiscounts >= (float)($free_fees_price) AND (float)($free_fees_price) > 0) + return $shipping_cost; + if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) AND $this->getTotalWeight() >= (float)($configuration['PS_SHIPPING_FREE_WEIGHT']) AND (float)($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0) + return $shipping_cost; + + // Get shipping cost using correct method + if ($carrier->range_behavior) + { + // Get id zone + if ( + isset($this->id_address_delivery) + AND $this->id_address_delivery + AND Customer::customerHasAddress($this->id_customer, $this->id_address_delivery) + ) + $id_zone = Address::getZoneById((int)($this->id_address_delivery)); + else + $id_zone = (int)($defaultCountry->id_zone); + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT AND (!Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), $id_zone))) + OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE AND (!Carrier::checkDeliveryPriceByPrice($carrier->id, $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, (int)($this->id_currency))))) + $shipping_cost += 0; + else { + if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) + $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone); + else // by price + $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)($this->id_currency)); + } + } + else + { + if ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) + $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone); + else + $shipping_cost += $carrier->getDeliveryPriceByPrice($order_total, $id_zone, (int)($this->id_currency)); + + } + // Adding handling charges + if (isset($configuration['PS_SHIPPING_HANDLING']) AND $carrier->shipping_handling) + $shipping_cost += (float)($configuration['PS_SHIPPING_HANDLING']); + + $shipping_cost = Tools::convertPrice($shipping_cost, Currency::getCurrencyInstance((int)($this->id_currency))); + + // Additional Shipping Cost per product + foreach($products AS $product) + $shipping_cost += $product['additional_shipping_cost'] * $product['cart_quantity']; + + //get external shipping cost from module + if ($carrier->shipping_external) + { + $moduleName = $carrier->external_module_name; + $module = Module::getInstanceByName($moduleName); + if (key_exists('id_carrier', $module)) + $module->id_carrier = $carrier->id; + if($carrier->need_range) + $shipping_cost = $module->getOrderShippingCost($this, $shipping_cost); + else + $shipping_cost = $module->getOrderShippingCostExternal($this); + + // Check if carrier is available + if ($shipping_cost === false) + return false; + } + + // Apply tax + if (isset($carrierTax)) + $shipping_cost *= 1 + ($carrierTax / 100); + + return (float)(Tools::ps_round((float)($shipping_cost), 2)); + } + + /** + * Return cart weight + * + * @return float Cart weight + */ + public function getTotalWeight() + { + if (!array_key_exists($this->id, self::$_totalWeight)) + { + $result = Db::getInstance()->getRow(' + SELECT SUM((p.`weight` + pa.`weight`) * cp.`quantity`) as nb + FROM `'._DB_PREFIX_.'cart_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON cp.`id_product_attribute` = pa.`id_product_attribute` + WHERE (cp.`id_product_attribute` IS NOT NULL AND cp.`id_product_attribute` != 0) + AND cp.`id_cart` = '.(int)($this->id)); + $result2 = Db::getInstance()->getRow(' + SELECT SUM(p.`weight` * cp.`quantity`) as nb + FROM `'._DB_PREFIX_.'cart_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` + WHERE (cp.`id_product_attribute` IS NULL OR cp.`id_product_attribute` = 0) + AND cp.`id_cart` = '.(int)($this->id)); + self::$_totalWeight[$this->id] = round((float)($result['nb']) + (float)($result2['nb']), 3); + } + return self::$_totalWeight[$this->id]; + } + + /** + * Check discount validity + * + * @return mixed Return a string if an error occurred and false otherwise + */ + function checkDiscountValidity($discountObj, $discounts, $order_total, $products, $checkCartDiscount = false) + { + global $cookie; + + if (!$order_total) + return Tools::displayError('Cannot add voucher if order is free.'); + if (!$discountObj->active) + return Tools::displayError('This voucher has already been used or is disabled.'); + if (!$discountObj->quantity) + return Tools::displayError('This voucher has expired (usage limit attained).'); + if ($discountObj->id_discount_type == 2 AND $this->id_currency != $discountObj->id_currency) + return Tools::displayError('This voucher can only be used in the following currency:').' + '.Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `name` FROM `'._DB_PREFIX_.'currency` WHERE id_currency = '.(int)$discountObj->id_currency); + if ($checkCartDiscount + AND ( + $this->getDiscountsCustomer($discountObj->id) >= $discountObj->quantity_per_user + OR (Order::getDiscountsCustomer((int)($cookie->id_customer), $discountObj->id) + $this->getDiscountsCustomer($discountObj->id) >= $discountObj->quantity_per_user) >= $discountObj->quantity_per_user + ) + ) + return Tools::displayError('You cannot use this voucher anymore (usage limit attained).'); + if (strtotime($discountObj->date_from) > time()) + return Tools::displayError('This voucher is not yet valid'); + if (strtotime($discountObj->date_to) < time()) + return Tools::displayError('This voucher has expired.'); + if (sizeof($discounts) >= 1 AND $checkCartDiscount) + { + if (!$discountObj->cumulable) + return Tools::displayError('This voucher is not valid with other current discounts.'); + foreach ($discounts as $discount) + if (!$discount['cumulable']) + return Tools::displayError('Voucher is not valid with other discounts.'); + } + if (is_array($discounts) AND in_array($discountObj->id, $discounts)) + return Tools::displayError('This voucher is already in your cart'); + $groups = Customer::getGroupsStatic($this->id_customer); + + if (($discountObj->id_customer OR $discountObj->id_group) AND ($this->id_customer != $discountObj->id_customer AND !in_array($discountObj->id_group, $groups))) + { + if (!$cookie->isLogged()) + return Tools::displayError('You cannot use this voucher.').' - '.Tools::displayError('Please log in.'); + return Tools::displayError('You cannot use this voucher.'); + } + $currentDate = date('Y-m-d'); + $onlyProductWithDiscount = true; + if (!$discountObj->cumulable_reduction) + { + foreach ($products as $product) + if (!$product['reduction_applies'] AND !$product['on_sale']) + $onlyProductWithDiscount = false; + } + if (!$discountObj->cumulable_reduction AND $onlyProductWithDiscount) + return Tools::displayError('This voucher is not valid for marked or reduced products.'); + $total_cart = 0; + $categories = Discount::getCategories($discountObj->id); + $returnErrorNoProductCategory = true; + foreach($products AS $product) + { + if(count($categories)) + if (Product::idIsOnCategoryId($product['id_product'], $categories)) + { + if ((!$discountObj->cumulable_reduction AND !$product['reduction_applies'] AND !$product['on_sale']) OR $discountObj->cumulable_reduction) + $total_cart += $product['total_wt']; + $returnErrorNoProductCategory = false; + } + } + if ($returnErrorNoProductCategory) + return Tools::displayError('This discount does not apply to that product category.'); + if ($total_cart < $discountObj->minimal) + return Tools::displayError('The order total is not high enough or this voucher cannot be used with those products.'); + return false; + } + + /** + * @param Discount $discountObj + * @return bool + * @deprecated + */ + public function hasProductInCategory($discountObj) + { + Tools::displayAsDeprecated(); + $products = $this->getProducts(); + $categories = Discount::getCategories($discountObj->id); + foreach ($products AS $product) + { + if (Product::idIsOnCategoryId($product['id_product'], $categories)) + return true; + } + return false; + } + + /** + * Return useful informations for cart + * + * @return array Cart details + */ + function getSummaryDetails() + { + global $cookie; + + $delivery = new Address((int)($this->id_address_delivery)); + $invoice = new Address((int)($this->id_address_invoice)); + + $total_tax = $this->getOrderTotal() - $this->getOrderTotal(false); + if ($total_tax < 0) + $total_tax = 0; + + $total_free_ship = 0; + if ($free_ship = Tools::convertPrice((float)(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency((int)($this->id_currency)))) + { + $discounts = $this->getDiscounts(); + $total_free_ship = $free_ship - ($this->getOrderTotal(true, Cart::ONLY_PRODUCTS) + $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS)); + foreach ($discounts as $discount) + if ($discount['id_discount_type'] == 3) + { + $total_free_ship = 0; + break; + } + } + + return array( + 'delivery' => $delivery, + 'delivery_state' => State::getNameById($delivery->id_state), + 'invoice' => $invoice, + 'invoice_state' => State::getNameById($invoice->id_state), + 'carrier' => new Carrier((int)($this->id_carrier), $cookie->id_lang), + 'products' => $this->getProducts(false), + 'discounts' => $this->getDiscounts(false, true), + 'is_virtual_cart' => (int)$this->isVirtualCart(), + 'total_discounts' => $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS), + 'total_discounts_tax_exc' => $this->getOrderTotal(false, Cart::ONLY_DISCOUNTS), + 'total_wrapping' => $this->getOrderTotal(true, Cart::ONLY_WRAPPING), + 'total_wrapping_tax_exc' => $this->getOrderTotal(false, Cart::ONLY_WRAPPING), + 'total_shipping' => $this->getOrderShippingCost(), + 'total_shipping_tax_exc' => $this->getOrderShippingCost(NULL, false), + 'total_products_wt' => $this->getOrderTotal(true, Cart::ONLY_PRODUCTS), + 'total_products' => $this->getOrderTotal(false, Cart::ONLY_PRODUCTS), + 'total_price' => $this->getOrderTotal(), + 'total_tax' => $total_tax, + 'total_price_without_tax' => $this->getOrderTotal(false), + 'free_ship' => (int)$total_free_ship); + } + + /** + * Return carts thats have not been converted in orders + * + * @param string $dateFrom Select only cart updated after this date + * @param string $dateTo Select only cart updated before this date + * @return array Carts + * @deprecated + */ + static function getNonOrderedCarts($dateFrom, $dateTo) + { + Tools::displayAsDeprecated(); + if (!Validate::isDate($dateFrom) OR !Validate::isDate($dateTo)) + die (Tools::displayError()); + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cart.`id_cart`, cart.`date_upd`, c.`id_customer` AS id_customer, c.`lastname` AS customer_lastname, c.`firstname` AS customer_firstname, + SUM(cp.`quantity`) AS nb_products, + COUNT(cd.`id_cart`) AS nb_discounts + FROM `'._DB_PREFIX_.'cart` cart + LEFT JOIN `'._DB_PREFIX_.'cart_product` cp ON cart.`id_cart` = cp.`id_cart` + LEFT JOIN `'._DB_PREFIX_.'cart_discount` cd ON cart.`id_cart` = cd.`id_cart` + LEFT JOIN `'._DB_PREFIX_.'customer` c ON cart.`id_customer` = c.`id_customer` + WHERE cart.`id_cart` NOT IN (SELECT `id_cart` FROM `'._DB_PREFIX_.'orders`) + AND TO_DAYS(cart.`date_upd`) >= TO_DAYS(\''.pSQL(strftime('%Y-%m-%d %H:%M:%S', strtotime($dateFrom))).'\') + AND TO_DAYS(cart.`date_upd`) <= TO_DAYS(\''.pSQL(strftime('%Y-%m-%d %H:%M:%S', strtotime($dateTo))).'\') + GROUP BY cart.`id_cart`, cp.`id_cart`, cd.`id_cart` + ORDER BY cart.`date_upd` DESC'); + } + + public function checkQuantities() + { + if (Configuration::get('PS_CATALOG_MODE')) + return false; + foreach ($this->getProducts() AS $product) + if (!$product['active'] OR (!$product['allow_oosp'] AND $product['stock_quantity'] < $product['cart_quantity']) OR !$product['available_for_order']) + return false; + return true; + } + + static public function lastNoneOrderedCart($id_customer) + { + if (!$result = Db::getInstance()->getRow(' + SELECT c.`id_cart` + FROM '._DB_PREFIX_.'cart c + LEFT JOIN '._DB_PREFIX_.'orders o ON (c.`id_cart` = o.`id_cart`) + WHERE c.`id_customer` = '.(int)($id_customer).' AND o.`id_cart` IS NULL + ORDER BY c.`date_upd` DESC')) + return false; + return $result['id_cart']; + } + + /** + * Check if cart contains only virtual products + * @return boolean true if is a virtual cart or false + * + */ + public function isVirtualCart() + { + if (!isset(self::$_isVirtualCart[$this->id])) + { + $products = $this->getProducts(); + + if (!sizeof($products)) + return false; + + $list = ''; + foreach ($products AS $product) + $list .= (int)($product['id_product']).','; + $list = rtrim($list, ','); + + $n = (int)Db::getInstance()->getValue(' + SELECT COUNT(`id_product_download`) n + FROM `'._DB_PREFIX_.'product_download` + WHERE `id_product` IN ('.pSQL($list).') AND `active` = 1'); + + self::$_isVirtualCart[$this->id] = ($n == sizeof($products)); + } + return self::$_isVirtualCart[$this->id]; + } + + static public function getCartByOrderId($id_order) + { + if ($id_cart = self::getCartIdByOrderId($id_order)) + return new Cart((int)($id_cart)); + + return false; + } + + static public function getCartIdByOrderId($id_order) + { + $result = Db::getInstance()->getRow('SELECT `id_cart` FROM '._DB_PREFIX_.'orders WHERE `id_order` = '.(int)($id_order)); + if (!$result OR empty($result) OR !key_exists('id_cart', $result)) + return false; + + return $result['id_cart']; + } + + /* + * Add customer's pictures + * + * @return bool Always true + */ + public function addPictureToProduct($id_product, $index, $identifier) + { + global $cookie; + + $varName = 'pictures_'.(int)($id_product).'_'.(int)($index); + if ($cookie->$varName) + { + @unlink(_PS_UPLOAD_DIR_.$cookie->$varName); + @unlink(_PS_UPLOAD_DIR_.$cookie->$varName.'_small'); + } + $cookie->$varName = $identifier; + return true; + } + + /* + * Add customer's text + * + * @return bool Always true + */ + public function addTextFieldToProduct($id_product, $index, $textValue) + { + global $cookie; + $textValue = str_replace(array("\n", "\r"), '', nl2br($textValue)); + $textValue = str_replace('\\', '\\\\', $textValue); + $textValue = str_replace('\'', '\\\'', $textValue); + $cookie->{'textFields_'.(int)($id_product).'_'.(int)($index)} = $textValue; + return true; + } + + /* + * Delete customer's text + * + * @return bool Always true + */ + public function deleteTextFieldFromProduct($id_product, $index) + { + global $cookie; + + unset($cookie->{'textFields_'.(int)($id_product).'_'.(int)($index)}); + return true; + } + + /* + * Remove a customer's picture + * + * @return bool + */ + public function deletePictureToProduct($id_product, $index) + { + global $cookie; + + $varName = 'pictures_'.(int)($id_product).'_'.(int)($index); + // if cookie->varName is empty, use index which is the name of the picture + $picture = !empty($cookie->$varName)?$cookie->$varName:$index; + if ($picture) + { + if (!@unlink(_PS_UPLOAD_DIR_.$picture) OR !@unlink(_PS_UPLOAD_DIR_.$picture.'_small')) + return false; + unset($cookie->$varName); + return true; + } + return false; + } + + static public function deleteCustomizationInformations($id_product) + { + global $cookie; + + $cookie->unsetFamily('pictures_'.(int)($id_product).'_'); + $cookie->unsetFamily('textFields_'.(int)($id_product).'_'); + return true; + } + + static public function getCustomerCarts($id_customer) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'cart c + WHERE c.`id_customer` = '.(int)($id_customer).' + ORDER BY c.`date_add` DESC'); + return $result; + } + + static public function replaceZeroByShopName($echo, $tr) + { + return ($echo == '0' ? Configuration::get('PS_SHOP_NAME') : $echo); + } + + /* DEPRECATED */ + public function getCustomeremail() + { + Tools::displayAsDeprecated(); + $customer = new Customer((int)($this->id_customer)); + return $customer->email; + } + + public function duplicate() + { + if (!Validate::isLoadedObject($this)) + return false; + $cart = new Cart($this->id); + $cart->id = NULL; + $cart->add(); + + if (!Validate::isLoadedObject($cart)) + return false; + + $success = true; + $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart` = '.(int)$this->id); + foreach ($products AS $product) + $success &= $cart->updateQty($product['quantity'], (int)$product['id_product'], (int)$product['id_product_attribute'], NULL, 'up'); + + // Customized products + $customs = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'customization c + LEFT JOIN '._DB_PREFIX_.'customized_data cd ON cd.id_customization = c.id_customization + WHERE c.id_cart = '.(int)$this->id); + + $custom_ids = array(); + $sql_custom_data = 'INSERT INTO '._DB_PREFIX_.'customized_data (id_customization, type, index, value) VALUES '; + if (count($custom_ids)) + { + foreach ($customs AS $custom) + { + Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute(' + INSERT INTO '._DB_PREFIX_.'customization (id_customization, id_cart, id_product_attribute, id_product, quantity) + VALUES(\'\', '.(int)$cart->id.', '.(int)$custom['id_product_attribute'].', '.(int)$custom['id_product'].', '.(int)$custom['quantity'].')'); + $custom_ids[$custom['id_customization']] = Db::getInstance(_PS_USE_SQL_SLAVE_)->Insert_ID(); + $sql_custom_data .= '('.(int)$custom_ids[$custom['id_customization']].', '.(int)$custom['type'].', '.(int)$custom['index'].', \''.pSQL($custom['value']).'\'),'; + } + Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute($sql_custom_data); + } + + return array('cart' => $cart, 'success' => $success); + } + + public function getWsCartRows() + { + $query = 'SELECT id_product, id_product_attribute, quantity + FROM `'._DB_PREFIX_.'cart_product` + WHERE id_cart = '.(int)$this->id; + $result = Db::getInstance()->executeS($query); + return $result; + } + + public function setWsCartRows($values) + { + if ($this->deleteAssociations()) + { + $query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`) VALUES '; + foreach ($values as $value) + $query .= '('.(int)$this->id.', '.(int)$value['id_product'].', '.(int)$value['id_product_attribute'].', '.(int)$value['quantity'].', NOW()),'; + $result = Db::getInstance()->Execute(rtrim($query, ',')); + } + return $result; + } + + public function deleteAssociations() + { + return (Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_cart` = '.(int)($this->id)) !== false); + } + + /** + * isGuestCartByCartId + * + * @param int $id_cart + * @return bool true if cart has been made by a guest customer + */ + static public function isGuestCartByCartId($id_cart) + { + if (!(int)$id_cart) + return false; + return (bool)Db::getInstance()->getValue(' + SELECT `is_guest` + FROM `'._DB_PREFIX_.'customer` cu + LEFT JOIN `'._DB_PREFIX_.'cart` ca ON (ca.`id_customer` = cu.`id_customer`) + WHERE ca.`id_cart` = '.(int)$id_cart); + } +} + diff --git a/classes/Category.php b/classes/Category.php new file mode 100644 index 000000000..1be26e16e --- /dev/null +++ b/classes/Category.php @@ -0,0 +1,924 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CategoryCore extends ObjectModel +{ + public $id; + + /** @var integer category ID */ + public $id_category; + + /** @var string Name */ + public $name; + + /** @var boolean Status for display */ + public $active = 1; + + /** @var integer category position */ + public $position; + + /** @var string Description */ + public $description; + + /** @var integer Parent category ID */ + public $id_parent; + + /** @var integer Parents number */ + public $level_depth; + + /** @var integer Nested tree model "left" value */ + public $nleft; + + /** @var integer Nested tree model "right" value */ + public $nright; + + /** @var string string used in rewrited URL */ + public $link_rewrite; + + /** @var string Meta title */ + public $meta_title; + + /** @var string Meta keywords */ + public $meta_keywords; + + /** @var string Meta description */ + public $meta_description; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected static $_links = array(); + + protected $tables = array ('category', 'category_lang'); + + protected $fieldsRequired = array('active'); + protected $fieldsSize = array('active' => 1); + protected $fieldsValidate = array('nleft' => 'isUnsignedInt', 'nright' => 'isUnsignedInt', 'level_depth' => 'isUnsignedInt', 'active' => 'isBool'); + protected $fieldsRequiredLang = array('name', 'link_rewrite'); + protected $fieldsSizeLang = array('name' => 64, 'link_rewrite' => 64, 'meta_title' => 128, 'meta_description' => 255, 'meta_keywords' => 255); + protected $fieldsValidateLang = array('name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml', + 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName'); + + protected $table = 'category'; + protected $identifier = 'id_category'; + + /** @var string id_image is the category ID when an image exists and 'default' otherwise */ + public $id_image = 'default'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'categories', + 'fields' => array( + 'id_parent' => array('xlink_resource'=> 'categories'), + ), + 'associations' => array( + 'categories' => array('getter' => 'getChildrenWs', 'resource' => 'category', ), + 'products' => array('getter' => 'getProductsWs', 'resource' => 'product', ), + + + ), + ); + + public function __construct($id_category = NULL, $id_lang = NULL) + { + parent::__construct($id_category, $id_lang); + $this->id_image = ($this->id AND file_exists(_PS_CAT_IMG_DIR_.(int)($this->id).'.jpg')) ? (int)($this->id) : false; + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_category'] = (int)($this->id); + $fields['active'] = (int)($this->active); + $fields['id_parent'] = (int)($this->id_parent); + $fields['position'] = (int)($this->position); + $fields['level_depth'] = (int)($this->level_depth); + $fields['nleft'] = (int)($this->nleft); + $fields['nright'] = (int)($this->nright); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description')); + } + + public function add($autodate = true, $nullValues = false) + { + $this->position = self::getLastPosition((int)(Tools::getValue('id_parent'))); + if (!isset($this->level_depth) OR $this->level_depth != 0) + $this->level_depth = $this->calcLevelDepth(); + $ret = parent::add($autodate); + if (!isset($this->doNotRegenerateNTree) OR !$this->doNotRegenerateNTree) + self::regenerateEntireNtree(); + $this->updateGroup(Tools::getValue('groupBox')); + Module::hookExec('categoryAddition', array('category' => $this)); + return $ret; + } + + /** + * update category positions in parent + * + * @param mixed $nullValues + * @return void + */ + public function update($nullValues = false) + { + $this->level_depth = $this->calcLevelDepth(); + $this->cleanPositions((int)$this->id_parent); + $ret = parent::update($nullValues); + if (!isset($this->doNotRegenerateNTree) OR !$this->doNotRegenerateNTree) + self::regenerateEntireNtree(); + Module::hookExec('categoryUpdate', array('category' => $this)); + return $ret; + } + + /** + * Recursive scan of subcategories + * + * @param integer $maxDepth Maximum depth of the tree (i.e. 2 => 3 levels depth) + * @param integer $currentDepth specify the current depth in the tree (don't use it, only for rucursivity!) + * @param array $excludedIdsArray specify a list of ids to exclude of results + * @param integer $idLang Specify the id of the language used + * + * @return array Subcategories lite tree + */ + function recurseLiteCategTree($maxDepth = 3, $currentDepth = 0, $idLang = NULL, $excludedIdsArray = NULL) + { + global $link; + + $idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); + + $children = array(); + if (($maxDepth == 0 OR $currentDepth < $maxDepth) AND $subcats = $this->getSubCategories((int)$idLang, true) AND sizeof($subcats)) + foreach ($subcats AS &$subcat) + { + if (!$subcat['id_category']) + break; + elseif (!is_array($excludedIdsArray) || !in_array($subcat['id_category'], $excludedIdsArray)) + { + $categ = new Category((int)$subcat['id_category'], (int)$idLang); + $children[] = $categ->recurseLiteCategTree($maxDepth, $currentDepth + 1, (int)$idLang, $excludedIdsArray); + } + } + + return array( + 'id' => (int)$this->id_category, + 'link' => $link->getCategoryLink((int)$this->id, $this->link_rewrite), + 'name' => $this->name, + 'desc'=> $this->description, + 'children' => $children + ); + } + + static public function recurseCategory($categories, $current, $id_category = 1, $id_selected = 1) + { + global $currentIndex; + echo ''; + if (isset($categories[$id_category])) + foreach ($categories[$id_category] AS $key => $row) + self::recurseCategory($categories, $categories[$id_category][$key], $key, $id_selected); + } + + + /** + * Recursively add specified category childs to $toDelete array + * + * @param array &$toDelete Array reference where categories ID will be saved + * @param array $id_category Parent category ID + */ + protected function recursiveDelete(&$toDelete, $id_category) + { + if (!is_array($toDelete) OR !$id_category) + die(Tools::displayError()); + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category` + WHERE `id_parent` = '.(int)($id_category)); + foreach ($result AS $k => $row) + { + $toDelete[] = (int)($row['id_category']); + $this->recursiveDelete($toDelete, (int)($row['id_category'])); + } + } + + public function delete() + { + if ((int)($this->id) === 0 OR (int)($this->id) === 1) return false; + + $this->clearCache(); + + /* Get childs categories */ + $toDelete = array((int)($this->id)); + $this->recursiveDelete($toDelete, (int)($this->id)); + $toDelete = array_unique($toDelete); + + /* Delete category and its child from database */ + $list = sizeof($toDelete) > 1 ? implode(',', array_map('intval',$toDelete)) : (int)($this->id); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE `id_category` IN ('.$list.')'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE `id_category` IN ('.$list.')'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_product` WHERE `id_category` IN ('.$list.')'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_category` IN ('.$list.')'); + + self::cleanPositions($this->id_parent); + + /* Delete categories images */ + require_once(_PS_ROOT_DIR_.'/images.inc.php'); + foreach ($toDelete AS $id_category) + deleteImage((int)$id_category); + + /* Delete products which were not in others categories */ + $result = Db::getInstance()->ExecuteS(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'product` + WHERE `id_product` NOT IN (SELECT `id_product` FROM `'._DB_PREFIX_.'category_product`)'); + foreach ($result as $p) + { + $product = new Product((int)$p['id_product']); + if (Validate::isLoadedObject($product)) + $product->delete(); + } + + /* Set category default to 1 where categorie no more exists */ + $result = Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product` + SET `id_category_default` = 1 + WHERE `id_category_default` + NOT IN (SELECT `id_category` FROM `'._DB_PREFIX_.'category`)'); + + /* Rebuild the nested tree */ + if (!isset($this->doNotRegenerateNTree) OR !$this->doNotRegenerateNTree) + self::regenerateEntireNtree(); + + Module::hookExec('categoryDeletion', array('category' => $this)); + return true; + } + + /** + * Delete several categories from database + * + * return boolean Deletion result + */ + public function deleteSelection($categories) + { + $return = 1; + foreach ($categories AS $id_category) + { + $category = new Category((int)($id_category)); + $return &= $category->delete(); + } + return $return; + } + + /** + * Get the depth level for the category + * + * @return integer Depth level + */ + public function calcLevelDepth() + { + /* Root category */ + if (!$this->id_parent) + return 0; + + $parentCategory = new Category((int)($this->id_parent)); + if (!Validate::isLoadedObject($parentCategory)) + die('parent category does not exist'); + return $parentCategory->level_depth + 1; + } + + /** + * Re-calculate the values of all branches of the nested tree + */ + public static function regenerateEntireNtree() + { + $categories = Db::getInstance()->ExecuteS('SELECT id_category, id_parent FROM '._DB_PREFIX_.'category ORDER BY id_category ASC'); + $categoriesArray = array(); + foreach ($categories AS $category) + $categoriesArray[(int)$category['id_parent']]['subcategories'][(int)$category['id_category']] = 1; + $n = 1; + self::_subTree($categoriesArray, 1, $n); + } + + protected static function _subTree(&$categories, $id_category, &$n) + { + $left = (int)$n++; + if (isset($categories[(int)$id_category]['subcategories'])) + foreach ($categories[(int)$id_category]['subcategories'] AS $id_subcategory => $value) + self::_subTree($categories, (int)$id_subcategory, $n); + $right = (int)$n++; + + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'category SET nleft = '.(int)$left.', nright = '.(int)$right.' WHERE id_category = '.(int)$id_category.' LIMIT 1'); + } + + /** + * Return available categories + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array Categories + */ + static public function getCategories($id_lang = false, $active = true, $order = true, $sql_filter = '', $sql_sort = '',$sql_limit = '') + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category` + WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)($id_lang) : '').' + '.($active ? 'AND `active` = 1' : '').' + '.(!$id_lang ? 'GROUP BY c.id_category' : '').' + '.($sql_sort != '' ? $sql_sort : 'ORDER BY c.`level_depth` ASC, c.`position` ASC').' + '.($sql_limit != '' ? $sql_limit : '') + ); + + if (!$order) + return $result; + + $categories = array(); + foreach ($result AS $row) + $categories[$row['id_parent']][$row['id_category']]['infos'] = $row; + + return $categories; + } + + static public function getSimpleCategories($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_category`, cl.`name` + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`) + WHERE cl.`id_lang` = '.(int)($id_lang).' + ORDER BY c.`position`'); + } + + /** + * Return current category childs + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array Categories + */ + public function getSubCategories($id_lang, $active = true) + { + global $cookie; + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) + WHERE `id_parent` = '.(int)($this->id).' + '.($active ? 'AND `active` = 1' : '').' + AND cg.`id_group` '.$sqlGroups.' + GROUP BY c.`id_category` + ORDER BY `level_depth` ASC, c.`position` ASC'); + + foreach ($result AS &$row) + { + $row['id_image'] = (file_exists(_PS_CAT_IMG_DIR_.$row['id_category'].'.jpg')) ? (int)($row['id_category']) : Language::getIsoById($id_lang).'-default'; + $row['legend'] = 'no picture'; + } + return $result; + } + + /** + * Return current category products + * + * @param integer $id_lang Language ID + * @param integer $p Page number + * @param integer $n Number of products per page + * @param boolean $getTotal return the number of results instead of the results themself + * @param boolean $active return only active products + * @param boolean $random active a random filter for returned products + * @param int $randomNumberProducts number of products to return if random is activated + * @param boolean $checkAccess set to false to return all products (even if customer hasn't access) + * @return mixed Products or number of products + */ + public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $random = false, $randomNumberProducts = 1, $checkAccess = true) + { + global $cookie; + if (!$checkAccess OR !$this->checkAccess($cookie->id_customer)) + return false; + + if ($p < 1) $p = 1; + + if (empty($orderBy)) + $orderBy = 'position'; + else + /* Fix for all modules which are now using lowercase values for 'orderBy' parameter */ + $orderBy = strtolower($orderBy); + + if (empty($orderWay)) + $orderWay = 'ASC'; + if ($orderBy == 'id_product' OR $orderBy == 'date_add') + $orderByPrefix = 'p'; + elseif ($orderBy == 'name') + $orderByPrefix = 'pl'; + elseif ($orderBy == 'manufacturer') + { + $orderByPrefix = 'm'; + $orderBy = 'name'; + } + elseif ($orderBy == 'position') + $orderByPrefix = 'cp'; + + if ($orderBy == 'price') + $orderBy = 'orderprice'; + + if (!Validate::isBool($active) OR !Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die (Tools::displayError()); + + $id_supplier = (int)(Tools::getValue('id_supplier')); + + /* Return only the number of products */ + if ($getTotal) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(cp.`id_product`) AS total + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product` + WHERE cp.`id_category` = '.(int)($this->id).($active ? ' AND p.`active` = 1' : '').' + '.($id_supplier ? 'AND p.id_supplier = '.(int)($id_supplier) : '')); + return isset($result) ? $result['total'] : 0; + } + + $sql = ' + SELECT p.*, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new, + (p.`price` * IF(t.`rate`,((100 + (t.`rate`))/100),1)) AS orderprice + FROM `'._DB_PREFIX_.'category_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND default_on = 1) + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + WHERE cp.`id_category` = '.(int)($this->id).($active ? ' AND p.`active` = 1' : '').' + '.($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : ''); + + if ($random === true) + { + $sql .= ' ORDER BY RAND()'; + $sql .= ' LIMIT 0, '.(int)($randomNumberProducts); + } + else + { + $sql .= ' ORDER BY '.(isset($orderByPrefix) ? $orderByPrefix.'.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + + if ($orderBy == 'orderprice') + Tools::orderbyPrice($result, $orderWay); + + if (!$result) + return false; + + /* Modify SQL result */ + return Product::getProductsProperties($id_lang, $result); + } + + /** + * Hide category prefix used for position + * + * @param string $name Category name + * @return string Name without position + */ + static public function hideCategoryPosition($name) + { + Tools::displayAsDeprecated(); + return preg_replace('/^[0-9]+\./', '', $name); + } + + /** + * Return main categories + * + * @param integer $id_lang Language ID + * @param boolean $active return only active categories + * @return array categories + */ + static public function getHomeCategories($id_lang, $active = true) + { + return self::getChildren(1, $id_lang, $active); + } + + static public function getRootCategory($id_lang = NULL) + { + return new Category (1, is_null($id_lang) ? (int)_USER_ID_LANG_ : (int)($id_lang)); + } + + static public function getChildren($id_parent, $id_lang, $active = true) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_category`, cl.`name`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category` + WHERE `id_lang` = '.(int)($id_lang).' + AND c.`id_parent` = '.(int)($id_parent).' + '.($active ? 'AND `active` = 1' : '').' + ORDER BY `position` ASC'); + + return $result; + } + + /** + * Copy products from a category to another + * + * @param integer $id_old Source category ID + * @param boolean $id_new Destination category ID + * @return boolean Duplication result + */ + public static function duplicateProductCategories($id_old, $id_new) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int)($id_old)); + + $row = array(); + if ($result) + foreach ($result AS $i) + $row[] = '('.implode(', ', array((int)($id_new), $i['id_category'], '(SELECT tmp.max + 1 FROM (SELECT MAX(cp.`position`) AS max FROM `'._DB_PREFIX_.'category_product` cp WHERE cp.`id_category`='.(int)($i['id_category']).') AS tmp)')).')'; + + $flag = Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`) VALUES '.implode(',', $row)); + return $flag; + } + + /** + * Check if category can be moved in another one. + * The category cannot be moved in a child category. + * + * @param integer $id_category current category + * @param integer $id_parent Parent candidate + * @return boolean Parent validity + */ + public static function checkBeforeMove($id_category, $id_parent) + { + if ($id_category == $id_parent) return false; + if ($id_parent == 1) return true; + $i = (int)($id_parent); + + while (42) + { + $result = Db::getInstance()->getRow('SELECT `id_parent` FROM `'._DB_PREFIX_.'category` WHERE `id_category` = '.(int)($i)); + if (!isset($result['id_parent'])) return false; + if ($result['id_parent'] == $id_category) return false; + if ($result['id_parent'] == 1) return true; + $i = $result['id_parent']; + } + } + + public static function getLinkRewrite($id_category, $id_lang) + { + if (!Validate::isUnsignedId($id_category) OR !Validate::isUnsignedId($id_lang)) + return false; + + if (isset(self::$_links[$id_category.'-'.$id_lang])) + return self::$_links[$id_category.'-'.$id_lang]; + + $result = Db::getInstance()->getRow(' + SELECT cl.`link_rewrite` + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category` + WHERE `id_lang` = '.(int)($id_lang).' + AND c.`id_category` = '.(int)($id_category)); + self::$_links[$id_category.'-'.$id_lang] = $result['link_rewrite']; + return $result['link_rewrite']; + } + + public function getLink() + { + global $link; + return $link->getCategoryLink($this->id, $this->link_rewrite); + } + + public function getName($id_lang = NULL) + { + if (!$id_lang) + { + global $cookie; + + if (isset($this->name[$cookie->id_lang])) + $id_lang = $cookie->id_lang; + else + $id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + } + return isset($this->name[$id_lang]) ? $this->name[$id_lang] : ''; + } + + /** + * Light back office search for categories + * + * @param integer $id_lang Language ID + * @param string $query Searched string + * @param boolean $unrestricted allows search without lang and includes first category and exact match + * @return array Corresponding categories + */ + static public function searchByName($id_lang, $query, $unrestricted = false) + { + if ($unrestricted === true) + return Db::getInstance()->getRow(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`) + WHERE `name` LIKE \''.pSQL($query).'\''); + else + return Db::getInstance()->ExecuteS(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)($id_lang).') + WHERE `name` LIKE \'%'.pSQL($query).'%\' AND c.`id_category` != 1'); + } + + /** + * Retrieve category by name and parent category id + * + * @param integer $id_lang Language ID + * @param string $category_name Searched category name + * @param integer $id_parent_category parent category ID + * @return array Corresponding category + */ + static public function searchByNameAndParentCategoryId($id_lang, $category_name, $id_parent_category) + { + return Db::getInstance()->getRow(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)($id_lang).') + WHERE `name` LIKE \''.pSQL($category_name).'\' + AND c.`id_category` != 1 + AND c.`id_parent` = '.(int)($id_parent_category)); + } + + /** + * Get Each parent category of this category until the root category + * + * @param integer $id_lang Language ID + * @return array Corresponding categories + */ + public function getParentsCategories($idLang = null) + { + //get idLang + $idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); + + $categories = null; + $idCurrent = (int)($this->id); + while (true) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.*, cl.* + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)($idLang).') + WHERE c.`id_category` = '.(int)$idCurrent.' AND c.`id_parent` != 0 + '); + + $categories[] = $result[0]; + if(!$result OR $result[0]['id_parent'] == 1) + return $categories; + $idCurrent = $result[0]['id_parent']; + } + } + /** + * Specify if a category already in base + * + * @param $id_category Category id + * @return boolean + */ + static public function categoryExists($id_category) + { + $row = Db::getInstance()->getRow(' + SELECT `id_category` + FROM '._DB_PREFIX_.'category c + WHERE c.`id_category` = '.(int)($id_category)); + + return isset($row['id_category']); + } + + + public function cleanGroups() + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_category` = '.(int)($this->id)); + } + + public function addGroups($groups) + { + foreach ($groups as $group) + { + $row = array('id_category' => (int)($this->id), 'id_group' => (int)($group)); + Db::getInstance()->AutoExecute(_DB_PREFIX_.'category_group', $row, 'INSERT'); + } + } + + public function getGroups() + { + $groups = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT cg.`id_group` + FROM '._DB_PREFIX_.'category_group cg + WHERE cg.`id_category` = '.(int)($this->id)); + foreach ($result as $group) + $groups[] = $group['id_group']; + return $groups; + } + + /** + * checkAccess return true if id_customer is in a group allowed to see this category. + * + * @param mixed $id_customer + * @access public + * @return boolean true if access allowed for customer $id_customer + */ + public function checkAccess($id_customer) + { + if (!$id_customer) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT ctg.`id_group` + FROM '._DB_PREFIX_.'category_group ctg + WHERE ctg.`id_category` = '.(int)($this->id).' AND ctg.`id_group` = 1'); + } else { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT ctg.`id_group` + FROM '._DB_PREFIX_.'category_group ctg + INNER JOIN '._DB_PREFIX_.'customer_group cg on (cg.`id_group` = ctg.`id_group` AND cg.`id_customer` = '.(int)($id_customer).') + WHERE ctg.`id_category` = '.(int)($this->id)); + } + if ($result AND isset($result['id_group']) AND $result['id_group']) + return true; + return false; + } + + public function updateGroup($list) + { + $this->cleanGroups(); + if ($list AND sizeof($list)) + $this->addGroups($list); + else + $this->addGroups(array(1)); + } + + static public function setNewGroupForHome($id_group) + { + if (!(int)($id_group)) + return false; + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'category_group` + VALUES (1, '.(int)($id_group).') + '); + } + + public function updatePosition($way, $position) + { + if (!$res = Db::getInstance()->ExecuteS(' + SELECT cp.`id_category`, cp.`position`, cp.`id_parent` + FROM `'._DB_PREFIX_.'category` cp + WHERE cp.`id_parent` = '.(int)(Tools::getValue('id_category_parent', 1)).' + ORDER BY cp.`position` ASC' + )) + return false; + + foreach ($res AS $category) + if ((int)($category['id_category']) == (int)($this->id)) + $movedCategory = $category; + + if (!isset($movedCategory) || !isset($position)) + return false; + // < and > statements rather than BETWEEN operator + // since BETWEEN is treated differently according to databases + $result = (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'category` + SET `position`= `position` '.($way ? '- 1' : '+ 1').' + WHERE `position` + '.($way + ? '> '.(int)($movedCategory['position']).' AND `position` <= '.(int)($position) + : '< '.(int)($movedCategory['position']).' AND `position` >= '.(int)($position)).' + AND `id_parent`='.(int)($movedCategory['id_parent'])) + AND Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'category` + SET `position` = '.(int)($position).' + WHERE `id_parent` = '.(int)($movedCategory['id_parent']).' + AND `id_category`='.(int)($movedCategory['id_category']))); + Module::hookExec('categoryUpdate'); + return $result; + } + + /** + * cleanPositions keep order of category in $id_category_parent, + * but remove duplicate position. Should not be used if positions + * are clean at the beginning ! + * + * @param mixed $id_category_parent + * @return boolean true if succeed + */ + static public function cleanPositions($id_category_parent) + { + $return = true; + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category` + WHERE `id_parent` = '.(int)($id_category_parent).' + ORDER BY `position`'); + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; $i++){ + $sql = ' + UPDATE `'._DB_PREFIX_.'category` + SET `position` = '.(int)($i).' + WHERE `id_parent` = '.(int)($id_category_parent).' + AND `id_category` = '.(int)($result[$i]['id_category']); + $return &= Db::getInstance()->Execute($sql); + } + return $return; + } + + static public function getLastPosition($id_category_parent) + { + return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)($id_category_parent))); + } + + public static function getUrlRewriteInformations($id_category) + { + return Db::getInstance()->ExecuteS(' + SELECT l.`id_lang`, c.`link_rewrite` + FROM `'._DB_PREFIX_.'category_lang` AS c + LEFT JOIN `'._DB_PREFIX_.'lang` AS l ON c.`id_lang` = l.`id_lang` + WHERE c.`id_category` = '.(int)$id_category.' + AND l.`active` = 1' + ); + + } + + public function getChildrenWs() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_category` as id + FROM `'._DB_PREFIX_.'category` c + WHERE c.`id_parent` = '.(int)($this->id).' + AND `active` = 1 + ORDER BY `position` ASC'); + return $result; + } + + public function getProductsWs() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cp.`id_product` as id + FROM `'._DB_PREFIX_.'category_product` cp + WHERE cp.`id_category` = '.(int)($this->id).' + ORDER BY `position` ASC'); + return $result; + } +} diff --git a/classes/Chart.php b/classes/Chart.php new file mode 100644 index 000000000..cd22ec1e7 --- /dev/null +++ b/classes/Chart.php @@ -0,0 +1,178 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ChartCore +{ + protected static $poolId = 0; + + protected $width = 600; + protected $height = 300; + + // Time mode + protected $timeMode = false; + protected $from; + protected $to; + protected $format; + protected $granularity; + + protected $curves = array(); + + /** @prototype void public static function init(void) */ + public static function init() + { + if (!self::$poolId) + { + ++self::$poolId; + echo ' + + '; + } + } + + /** @prototype void public function __construct() */ + public function __construct() + { + self::init(); + ++self::$poolId; + } + + /** @prototype void public function setSize(int $width, int $height) */ + public function setSize($width, $height) + { + $this->width = (int)$width; + $this->height = (int)$height; + } + + /** @prototype void public function setTimeMode($from, $to, $granularity) */ + public function setTimeMode($from, $to, $granularity) + { + $this->granularity = $granularity; + + if (Validate::isDate($from)) + $from = strtotime($from); + $this->from = $from; + if (Validate::isDate($to)) + $to = strtotime($to); + $this->to = $to; + + if ($granularity == 'd') + $this->format = '%d/%m/%y'; + if ($granularity == 'w') + $this->format = '%d/%m/%y'; + if ($granularity == 'm') + $this->format = '%m/%y'; + if ($granularity == 'y') + $this->format = '%y'; + + $this->timeMode = true; + } + + public function getCurve($i) + { + if (!array_key_exists($i, $this->curves)) + $this->curves[$i] = new Curve(); + return $this->curves[$i]; + } + + /** @prototype void public function display() */ + public function display() + { + $options = ''; + if ($this->timeMode) + { + $options = 'xaxis:{mode:"time",timeformat:\''.addslashes($this->format).'\',min:'.$this->from.'000,max:'.$this->to.'000}'; + if ($this->granularity == 'd') + foreach ($this->curves as $curve) + for ($i = $this->from; $i <= $this->to; $i += 86400) + if (!$curve->getPoint($i)) + $curve->setPoint($i, 0); + } + + $jsCurves = array(); + foreach ($this->curves as $curve) + $jsCurves[] = $curve->getValues($this->timeMode); + + if (count($jsCurves)) + echo ' +
+ '; + else + echo ErrorFacade::Display(PS_ERROR_UNDEFINED, 'No values for this chart.'); + } +} + +class Curve +{ + protected $values = array(); + protected $label; + protected $type; + + /** @prototype void public function setValues(array $values) */ + public function setValues(array $values) + { + $this->values = $values; + } + + public function getValues($timeMode = false) + { + ksort($this->values); + $string = ''; + foreach ($this->values as $key => $value) + $string .= '['.addslashes((string)$key).($timeMode ? '000' : '').','.(float)$value.'],'; + return '{data:['.rtrim($string, ',').']'.(!empty($this->label) ? ',label:"'.$this->label.'"' : '').''.(!empty($this->type) ? ','.$this->type : '').'}'; + } + + /** @prototype void public function setPoint(float $x, float $y) */ + public function setPoint($x, $y) + { + $this->values[(string)$x] = (float)$y; + } + + public function setLabel($label) + { + $this->label = $label; + } + + public function setType($type) + { + $this->type = ''; + if ($type == 'bars') + $this->type = 'bars:{show:true}'; + if ($type == 'steps') + $this->type = 'lines:{show:true,steps:true}'; + } + + public function getPoint($x) + { + if (array_key_exists((string)$x, $this->values)) + return $this->values[(string)$x]; + } +} \ No newline at end of file diff --git a/classes/Combination.php b/classes/Combination.php new file mode 100644 index 000000000..7c94a65f4 --- /dev/null +++ b/classes/Combination.php @@ -0,0 +1,159 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CombinationCore extends ObjectModel +{ + public $id_product; + + public $reference; + + public $supplier_reference; + + public $location; + + public $ean13; + + public $upc; + + public $wholesale_price; + + public $price; + + public $ecotax; + + public $quantity; + + public $weight; + + public $default_on; + + protected $fieldsRequired = array( + 'id_product', + ); + protected $fieldsSize = array( + 'reference' => 32, + 'supplier_reference' => 32, + 'location' => 64, + 'ean13' => 13, + 'upc' => 12, + 'wholesale_price' => 27, + 'price' => 20, + 'ecotax' => 20, + 'quantity' => 10 + ); + protected $fieldsValidate = array( + 'id_product' => 'isUnsignedId', + 'location' => 'isGenericName', + 'ean13' => 'isEan13', + 'upc' => 'isUpc', + 'wholesale_price' => 'isPrice', + 'price' => 'isPrice', + 'ecotax' => 'isPrice', + 'quantity' => 'isUnsignedInt', + 'weight' => 'isFloat', + 'default_on' => 'isBool', + ); + + protected $table = 'product_attribute'; + protected $identifier = 'id_product_attribute'; + + protected $webserviceParameters = array( + 'objectNodeName' => 'combination', + 'objectsNodeName' => 'combinations', + 'fields' => array( + 'id_product' => array('required' => true, 'xlink_resource'=> 'products'), + ), + 'associations' => array( + 'product_option_values' => array('resource' => 'product_option_value', 'xlink_resource'=> 'product_option_values'), + ), + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_product'] = (int)($this->id_product); + $fields['reference'] = pSQL($this->reference); + $fields['supplier_reference'] = pSQL($this->supplier_reference); + $fields['location'] = pSQL($this->location); + $fields['ean13'] = pSQL($this->ean13); + $fields['upc'] = pSQL($this->upc); + $fields['wholesale_price'] = pSQL($this->wholesale_price); + $fields['price'] = pSQL($this->price); + $fields['ecotax'] = pSQL($this->ecotax); + $fields['quantity'] = (int)($this->quantity); + $fields['weight'] = pSQL($this->weight); + $fields['default_on'] = (int)($this->default_on); + return $fields; + } + + public function delete() + { + if (!parent::delete() OR $this->deleteAssociations() === false) + return false; + return true; + } + + public function deleteAssociations() + { + if ( + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` = '.(int)($this->id)) === false + || + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_image` + WHERE `id_product_attribute` = '.(int)($this->id)) === false + ) + return false; + return true; + } + + public function setWsProductOptionValues($values) + { + if ($this->deleteAssociations()) + { + $sqlValues = array(); + foreach ($values as $value) + $sqlValues[] = '('.(int)$value['id'].', '.(int)$this->id.')'; + $result = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_attribute`, `id_product_attribute`) + VALUES '.implode(',', $sqlValues) + ); + return $result; + } + return false; + } + + public function getWsProductOptionValues() + { + $result = Db::getInstance()->executeS('SELECT id_attribute AS id from `'._DB_PREFIX_.'product_attribute_combination` WHERE id_product_attribute = '.(int)$this->id); + return $result; + } + +} + + diff --git a/classes/Configuration.php b/classes/Configuration.php new file mode 100644 index 000000000..774cc0389 --- /dev/null +++ b/classes/Configuration.php @@ -0,0 +1,341 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ConfigurationCore extends ObjectModel +{ + public $id; + + /** @var string Key */ + public $name; + + /** @var string Value */ + public $value; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 32); + protected $fieldsValidate = array('name' => 'isConfigName'); + + protected $table = 'configuration'; + protected $identifier = 'id_configuration'; + + /** @var array Configuration cache */ + protected static $_CONF; + /** @var array Configuration multilang cache */ + protected static $_CONF_LANG; + + protected $webserviceParameters = array( + 'fields' => array( + 'value' => array(), + 'date_add' => array(), + 'date_upd' => array() + ) + ); + + protected $webserviceParametersI18n = array( + 'retrieveData' => array('retrieveMethod' => 'getI18nConfigurationList'), + 'fields' => array( + 'value' => array('i18n' => true), + 'date_add' => array('i18n' => true), + 'date_upd' => array('i18n' => true) + ) + ); + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + $fields['value'] = pSQL($this->value); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + if (!is_array($this->value)) + return true; + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('value')); + } + + /** + * Delete a configuration key in database (with or without language management) + * + * @param string $key Key to delete + * @return boolean Deletion result + */ + static public function deleteByName($key) + { + if (!Validate::isConfigName($key)) + die(Tools::displayError()); + + if (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'configuration_lang` WHERE `id_configuration` = + (SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE `name` = \''.pSQL($key).'\')') AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'configuration` WHERE `name` = \''.pSQL($key).'\'')) + { + unset(self::$_CONF[$key]); + return true; + } + return false; + } + + /** + * Get a single configuration value (in one language only) + * + * @param string $key Key wanted + * @param integer $id_lang Language ID + * @return string Value + */ + static public function get($key, $id_lang = NULL) + { + if (!Validate::isConfigName($key)) + die(Tools::displayError()); + if ($id_lang AND isset(self::$_CONF_LANG[(int)($id_lang)][$key])) + return self::$_CONF_LANG[(int)($id_lang)][$key]; + elseif (key_exists($key, self::$_CONF)) + return self::$_CONF[$key]; + return false; + } + + /** + * Set TEMPORARY a single configuration value (in one language only) + * + * @param string $key Key wanted + * @param mixed $values $values is an array if the configuration is multilingual, a single string else. + */ + static public function set($key, $values) + { + if (!Validate::isConfigName($key)) + die(Tools::displayError()); + /* Update classic values */ + if (!is_array($values)) + self::$_CONF[$key] = $values; + /* Update multilingual values */ + else + /* Add multilingual values */ + foreach ($values as $k => $value) + self::$_CONF_LANG[(int)($k)][$key] = $value; + } + + /** + * Get a single configuration value (in multiple languages) + * + * @param string $key Key wanted + * @return array Values in multiple languages + */ + static public function getInt($key) + { + $languages = Language::getLanguages(); + $resultsArray = array(); + foreach($languages as $language) + $resultsArray[$language['id_lang']] = self::get($key, $language['id_lang']); + return $resultsArray; + } + + /** + * Get several configuration values (in one language only) + * + * @param array $keys Keys wanted + * @param integer $id_lang Language ID + * @return array Values + */ + static public function getMultiple($keys, $id_lang = NULL) + { + if (!is_array($keys) OR !is_array(self::$_CONF) OR ($id_lang AND !is_array(self::$_CONF_LANG))) + die(Tools::displayError()); + + $resTab = array(); + if (!$id_lang) + { + foreach ($keys AS $key) + if (key_exists($key, self::$_CONF)) + $resTab[$key] = self::$_CONF[$key]; + } + elseif (key_exists($id_lang, self::$_CONF_LANG)) + foreach ($keys AS $key) + if (key_exists($key, self::$_CONF_LANG[(int)($id_lang)])) + $resTab[$key] = self::$_CONF_LANG[(int)($id_lang)][$key]; + return $resTab; + } + + /** + * Get several configuration values (in multiple languages) + * + * @param array $keys Keys wanted + * @return array Values in multiple languages + * @deprecated + */ + static public function getMultipleInt($keys) + { + Tools::displayAsDeprecated(); + $languages = Language::getLanguages(); + $resultsArray = array(); + foreach($languages as $language) + $resultsArray[$language['id_lang']] = self::getMultiple($keys, $language['id_lang']); + return $resultsArray; + } + + /** + * Insert configuration key and value into database + * + * @param string $key Key + * @param string $value Value + * @eturn boolean Insert result + */ + static protected function _addConfiguration($key, $value = NULL) + { + $newConfig = new Configuration(); + $newConfig->name = $key; + if (!is_null($value)) + $newConfig->value = $value; + return $newConfig->add(); + } + + /** + * Update configuration key and value into database (automatically insert if key does not exist) + * + * @param string $key Key + * @param mixed $values $values is an array if the configuration is multilingual, a single string else. + * @param boolean $html Specify if html is authorized in value + * @return boolean Update result + */ + static public function updateValue($key, $values, $html = false) + { + if ($key == NULL) return; + if (!Validate::isConfigName($key)) + die(Tools::displayError()); + $db = Db::getInstance(); + /* Update classic values */ + if (!is_array($values)) + { + $values = pSQL($values, $html); + if (Configuration::get($key) !== false) + { + $result = $db->AutoExecute( + _DB_PREFIX_.'configuration', + array('value' => $values, 'date_upd' => date('Y-m-d H:i:s')), + 'UPDATE', '`name` = \''.pSQL($key).'\'', true, true); + self::$_CONF[$key] = stripslashes($values); + } + else + { + $result = self::_addConfiguration($key, $values); + if ($result) + self::$_CONF[$key] = stripslashes($values); + return $result; + } + } + + /* Update multilingual values */ + else + { + $result = 1; + /* Add the key in the configuration table if it does not already exist... */ + $conf = $db->getRow('SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE `name` = \''.pSQL($key).'\''); + if (!is_array($conf) OR !array_key_exists('id_configuration', $conf)) + { + self::_addConfiguration($key); + $conf = $db->getRow('SELECT `id_configuration` FROM `'._DB_PREFIX_.'configuration` WHERE `name` = \''.pSQL($key).'\''); + } + /* ... then add multilingual values into configuration_lang table */ + if (!array_key_exists('id_configuration', $conf) OR !(int)($conf['id_configuration'])) + return false; + foreach ($values as $id_lang => $value) + { + $value = pSQL($value, $html); + $result &= $db->Execute('INSERT INTO `'._DB_PREFIX_.'configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) + VALUES ('.$conf['id_configuration'].', '.(int)($id_lang).', \''.$value.'\', NOW()) + ON DUPLICATE KEY UPDATE `value` = \''.$value.'\', `date_upd` = NOW()'); + self::$_CONF_LANG[(int)($id_lang)][$key] = stripslashes($value); + } + } + return $result; + } + + static public function loadConfiguration() + { + /* Configuration */ + self::$_CONF = array(); + $result = Db::getInstance()->ExecuteS('SELECT `name`, `value` FROM `'._DB_PREFIX_.'configuration`'); + if ($result) + foreach ($result AS $row) + self::$_CONF[$row['name']] = stripslashes($row['value']); + + /* Multilingual configuration */ + self::$_CONF_LANG = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT c.`name`, cl.`id_lang`, IFNULL(cl.`value`, c.`value`) AS value + FROM `'._DB_PREFIX_.'configuration_lang` cl + LEFT JOIN `'._DB_PREFIX_.'configuration` c ON c.id_configuration = cl.id_configuration'); + if ($result === false) + die(Tools::displayError('Invalid loadConfiguration() SQL query')); + foreach ($result AS $row) + self::$_CONF_LANG[(int)($row['id_lang'])][$row['name']] = stripslashes($row['value']); + } + + public function getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit) + { + $query = ' + SELECT DISTINCT main.`'.$this->identifier.'` FROM `'._DB_PREFIX_.$this->table.'` main + '.$sql_join.' + WHERE id_configuration NOT IN + ( SELECT id_configuration + FROM '._DB_PREFIX_.$this->table.'_lang + ) '.$sql_filter.' + '.($sql_sort != '' ? $sql_sort : '').' + '.($sql_limit != '' ? $sql_limit : '').' + '; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + } + + public function getI18nConfigurationList($sql_join, $sql_filter, $sql_sort, $sql_limit) + { + $query = ' + SELECT DISTINCT main.`'.$this->identifier.'` FROM `'._DB_PREFIX_.$this->table.'` main + '.$sql_join.' + WHERE id_configuration IN + ( SELECT id_configuration + FROM '._DB_PREFIX_.$this->table.'_lang + ) '.$sql_filter.' + '.($sql_sort != '' ? $sql_sort : '').' + '.($sql_limit != '' ? $sql_limit : '').' + '; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + } +} + + diff --git a/classes/Connection.php b/classes/Connection.php new file mode 100644 index 000000000..fabf92f93 --- /dev/null +++ b/classes/Connection.php @@ -0,0 +1,172 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ConnectionCore extends ObjectModel +{ + /** @var integer */ + public $id_guest; + + /** @var integer */ + public $id_page; + + /** @var string */ + public $ip_address; + + /** @var string */ + public $http_referer; + + /** @var string */ + public $date_add; + + protected $fieldsRequired = array ('id_guest', 'id_page'); + protected $fieldsValidate = array ('id_guest' => 'isUnsignedId', 'id_page' => 'isUnsignedId', + 'ip_address' => 'isInt', 'http_referer' => 'isAbsoluteUrl'); + + /* MySQL does not allow 'connection' for a table name */ + protected $table = 'connections'; + protected $identifier = 'id_connections'; + + public function getFields() + { + parent::validateFields(); + $fields['id_guest'] = (int)($this->id_guest); + $fields['id_page'] = (int)($this->id_page); + $fields['ip_address'] = (int)($this->ip_address); + if (Validate::isAbsoluteUrl($this->http_referer)) + $fields['http_referer'] = pSQL($this->http_referer); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } + + public static function setPageConnection($cookie, $full = true) + { + // The connection is created if it does not exist yet and we get the current page id + if (!isset($cookie->id_connections) OR !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false))) + $id_page = Connection::setNewConnection($cookie); + if (!isset($id_page) OR !$id_page) + $id_page = Page::getCurrentId(); + if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + return array('id_page' => $id_page); + + // The ending time will be updated by an ajax request when the guest will close the page + $time_start = date('Y-m-d H:i:s'); + Db::getInstance()->AutoExecute(_DB_PREFIX_.'connections_page', array('id_connections' => (int)($cookie->id_connections), 'id_page' => (int)($id_page), 'time_start' => $time_start), 'INSERT'); + + // This array is serialized and used by the ajax request to identify the page + return array( + 'id_connections' => (int)($cookie->id_connections), + 'id_page' => (int)($id_page), + 'time_start' => $time_start); + } + + public static function setNewConnection($cookie) + { + if (isset($_SERVER['HTTP_USER_AGENT']) + AND preg_match('/BotLink|ahoy|AlkalineBOT|anthill|appie|arale|araneo|AraybOt|ariadne|arks|ATN_Worldwide|Atomz|bbot|Bjaaland|Ukonline|borg\-bot\/0\.9|boxseabot|bspider|calif|christcrawler|CMC\/0\.01|combine|confuzzledbot|CoolBot|cosmos|Internet Cruiser Robot|cusco|cyberspyder|cydralspider|desertrealm, desert realm|digger|DIIbot|grabber|downloadexpress|DragonBot|dwcp|ecollector|ebiness|elfinbot|esculapio|esther|fastcrawler|FDSE|FELIX IDE|ESI|fido|H�m�h�kki|KIT\-Fireball|fouineur|Freecrawl|gammaSpider|gazz|gcreep|golem|googlebot|griffon|Gromit|gulliver|gulper|hambot|havIndex|hotwired|htdig|iajabot|INGRID\/0\.1|Informant|InfoSpiders|inspectorwww|irobot|Iron33|JBot|jcrawler|Teoma|Jeeves|jobo|image\.kapsi\.net|KDD\-Explorer|ko_yappo_robot|label\-grabber|larbin|legs|Linkidator|linkwalker|Lockon|logo_gif_crawler|marvin|mattie|mediafox|MerzScope|NEC\-MeshExplorer|MindCrawler|udmsearch|moget|Motor|msnbot|muncher|muninn|MuscatFerret|MwdSearch|sharp\-info\-agent|WebMechanic|NetScoop|newscan\-online|ObjectsSearch|Occam|Orbsearch\/1\.0|packrat|pageboy|ParaSite|patric|pegasus|perlcrawler|phpdig|piltdownman|Pimptrain|pjspider|PlumtreeWebAccessor|PortalBSpider|psbot|Getterrobo\-Plus|Raven|RHCS|RixBot|roadrunner|Robbie|robi|RoboCrawl|robofox|Scooter|Search\-AU|searchprocess|Senrigan|Shagseeker|sift|SimBot|Site Valet|skymob|SLCrawler\/2\.0|slurp|ESI|snooper|solbot|speedy|spider_monkey|SpiderBot\/1\.0|spiderline|nil|suke|http:\/\/www\.sygol\.com|tach_bw|TechBOT|templeton|titin|topiclink|UdmSearch|urlck|Valkyrie libwww\-perl|verticrawl|Victoria|void\-bot|Voyager|VWbot_K|crawlpaper|wapspider|WebBandit\/1\.0|webcatcher|T\-H\-U\-N\-D\-E\-R\-S\-T\-O\-N\-E|WebMoose|webquest|webreaper|webs|webspider|WebWalker|wget|winona|whowhere|wlm|WOLP|WWWC|none|XGET|Nederland\.zoek/i', $_SERVER['HTTP_USER_AGENT'])) + { + // This is a bot and we have to retrieve its connection ID + if ($id_connections = Db::getInstance()->getValue(' + SELECT `id_connections` FROM `'._DB_PREFIX_.'connections` c + WHERE ip_address = '.ip2long(Tools::getRemoteAddr()).' + AND DATE_ADD(c.`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\' + ORDER BY c.`date_add` DESC')) + { + $cookie->id_connections = (int)$id_connections; + return Page::getCurrentId(); + } + } + + // A new connection is created if the guest made no actions during 30 minutes + $result = Db::getInstance()->getRow(' + SELECT c.`id_guest` + FROM `'._DB_PREFIX_.'connections` c + WHERE c.`id_guest` = '.(int)($cookie->id_guest).' + AND DATE_ADD(c.`date_add`, INTERVAL 30 MINUTE) > \''.pSQL(date('Y-m-d H:i:00')).'\' + ORDER BY c.`date_add` DESC'); + if (!$result['id_guest'] AND (int)($cookie->id_guest)) + { + // The old connections details are removed from the database in order to spare some memory + Connection::cleanConnectionsPages(); + + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + $arrayUrl = parse_url($referer); + if (!isset($arrayUrl['host']) OR preg_replace('/^www./', '', $arrayUrl['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) + $referer = ''; + $connection = new Connection(); + $connection->id_guest = (int)($cookie->id_guest); + $connection->id_page = Page::getCurrentId(); + $connection->ip_address = Tools::getRemoteAddr() ? ip2long(Tools::getRemoteAddr()) : ''; + if (Validate::isAbsoluteUrl($referer)) + $connection->http_referer = $referer; + $connection->add(); + $cookie->id_connections = $connection->id; + return $connection->id_page; + } + } + + public static function setPageTime($id_connections, $id_page, $time_start, $time) + { + if (!Validate::isUnsignedId($id_connections) + OR !Validate::isUnsignedId($id_page) + OR !Validate::isDate($time_start)) + return; + + // Limited to 5 minutes because more than 5 minutes is considered as an error + if ($time > 300000) + $time = 300000; + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'connections_page` + SET `time_end` = `time_start` + INTERVAL '.(int)($time / 1000).' SECOND + WHERE `id_connections` = '.(int)($id_connections).' + AND `id_page` = '.(int)($id_page).' + AND `time_start` = \''.pSQL($time_start).'\''); + } + + public static function cleanConnectionsPages() + { + $period = Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'); + + if ($period === 'week') + $interval = '1 WEEK'; + else if ($period === 'month') + $interval = '1 MONTH'; + else if ($period === 'year') + $interval = '1 YEAR'; + else + return; + + if ($interval != null) + { + // Records of connections details older than the beginning of the specified interval are deleted + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'connections_page` + WHERE time_start < LAST_DAY(DATE_SUB(NOW(), INTERVAL '.$interval.'))'); + } + } +} + + diff --git a/classes/ConnectionsSource.php b/classes/ConnectionsSource.php new file mode 100644 index 000000000..1fb2fa928 --- /dev/null +++ b/classes/ConnectionsSource.php @@ -0,0 +1,112 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ConnectionsSourceCore extends ObjectModel +{ + public $id_connections; + public $http_referer; + public $request_uri; + public $keywords; + public $date_add; + + // Controler les keywords + + protected $fieldsRequired = array('id_connections', 'date_add'); + protected $fieldsValidate = array('id_connections' => 'isUnsignedId', 'http_referer' => 'isAbsoluteUrl', 'request_uri' => 'isUrl', 'keywords' => 'isMessage'); + + protected $table = 'connections_source'; + protected $identifier = 'id_connections_source'; + + public function getFields() + { + parent::validateFields(); + $fields['id_connections'] = (int)($this->id_connections); + $fields['http_referer'] = pSQL($this->http_referer); + $fields['request_uri'] = pSQL($this->request_uri); + $fields['keywords'] = pSQL($this->keywords); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + if($result = parent::add($autodate, $nullValues)) + Referrer::cacheNewSource($this->id); + return $result; + } + + public static function logHttpReferer() + { + global $cookie; + + if (!isset($cookie->id_connections) OR !Validate::isUnsignedId($cookie->id_connections)) + return false; + if (!isset($_SERVER['HTTP_REFERER']) AND !Configuration::get('TRACKING_DIRECT_TRAFFIC')) + return false; + + $source = new ConnectionsSource(); + if (isset($_SERVER['HTTP_REFERER']) AND Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER'])) + { + $parsed = parse_url($_SERVER['HTTP_REFERER']); + $parsed_host = parse_url(Tools::getProtocol().Tools::getHttpHost(false, false).__PS_BASE_URI__); + if ((preg_replace('/^www./', '', $parsed['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) + AND !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__))) + return false; + if (Validate::isAbsoluteUrl(strval($_SERVER['HTTP_REFERER']))) + { + $source->http_referer = strval($_SERVER['HTTP_REFERER']); + $source->keywords = trim(SearchEngine::getKeywords(strval($_SERVER['HTTP_REFERER']))); + if (!Validate::isMessage($source->keywords)) + return false; + } + } + + $source->id_connections = (int)($cookie->id_connections); + $source->request_uri = Tools::getHttpHost(false, false); + if (isset($_SERVER['REDIRECT_URL'])) + $source->request_uri .= strval($_SERVER['REDIRECT_URL']); + elseif (isset($_SERVER['REQUEST_URI'])) + $source->request_uri .= strval($_SERVER['REQUEST_URI']); + if (!Validate::isUrl($source->request_uri)) + $source->request_uri = ''; + return $source->add(); + } + + public static function getOrderSources($id_order) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cos.http_referer, cos.request_uri, cos.keywords, cos.date_add + FROM '._DB_PREFIX_.'orders o + INNER JOIN '._DB_PREFIX_.'guest g ON g.id_customer = o.id_customer + INNER JOIN '._DB_PREFIX_.'connections co ON co.id_guest = g.id_guest + INNER JOIN '._DB_PREFIX_.'connections_source cos ON cos.id_connections = co.id_connections + WHERE id_order = '.(int)($id_order).' + ORDER BY cos.date_add DESC'); + } +} + + diff --git a/classes/Contact.php b/classes/Contact.php new file mode 100644 index 000000000..f4c42c7bc --- /dev/null +++ b/classes/Contact.php @@ -0,0 +1,88 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ContactCore extends ObjectModel +{ + public $id; + + /** @var string Name */ + public $name; + + /** @var string e-mail */ + public $email; + + /** @var string Detailed description */ + public $description; + + public $customer_service; + + protected $fieldsRequired = array(); + protected $fieldsSize = array('email' => 128); + protected $fieldsValidate = array('email' => 'isEmail', 'customer_service' => 'isBool'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName', 'description' => 'isCleanHtml'); + + protected $table = 'contact'; + protected $identifier = 'id_contact'; + + public function getFields() + { + parent::validateFields(); + $fields['email'] = pSQL($this->email); + $fields['customer_service'] = (int)($this->customer_service); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'description')); + } + + /** + * Return available contacts + * + * @param integer $id_lang Language ID + * @return array Contacts + */ + static public function getContacts($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'contact` c + LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON c.`id_contact` = cl.`id_contact` + WHERE cl.`id_lang` = '.(int)($id_lang).' + ORDER BY `name` ASC'); + } +} + diff --git a/classes/ControllerFactory.php b/classes/ControllerFactory.php new file mode 100644 index 000000000..db7948c4c --- /dev/null +++ b/classes/ControllerFactory.php @@ -0,0 +1,53 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ControllerFactoryCore +{ + public static function includeController($className) + { + if (!class_exists($className, false)) + { + require_once(dirname(__FILE__).'/../controllers/'.$className.'.php'); + if (file_exists(dirname(__FILE__).'/../override/controllers/'.$className.'.php')) + require_once(dirname(__FILE__).'/../override/controllers/'.$className.'.php'); + else + { + $coreClass = new ReflectionClass($className.'Core'); + if ($coreClass->isAbstract()) + eval('abstract class '.$className.' extends '.$className.'Core {}'); + else + eval('class '.$className.' extends '.$className.'Core {}'); + } + } + } + + public static function getController($className, $auth = false, $ssl = false) + { + ControllerFactory::includeController($className); + return new $className($auth, $ssl); + } +} \ No newline at end of file diff --git a/classes/Cookie.php b/classes/Cookie.php new file mode 100644 index 000000000..0792e0116 --- /dev/null +++ b/classes/Cookie.php @@ -0,0 +1,347 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CookieCore +{ + /** @var array Contain cookie content in a key => value format */ + protected $_content; + + /** @var array Crypted cookie name for setcookie() */ + protected $_name; + + /** @var array expiration date for setcookie() */ + protected $_expire; + + /** @var array Website domain for setcookie() */ + protected $_domain; + + /** @var array Path for setcookie() */ + protected $_path; + + /** @var array cipher tool instance */ + protected $_cipherTool; + + /** @var array cipher tool initialization key */ + protected $_key; + + /** @var array cipher tool initilization vector */ + protected $_iv; + + protected $_modified = false; + + /** + * Get data if the cookie exists and else initialize an new one + * + * @param $name Cookie name before encrypting + * @param $path + */ + public function __construct($name, $path = '', $expire = NULL) + { + $this->_content = array(); + $this->_expire = isset($expire) ? (int)($expire) : (time() + 1728000); + $this->_name = md5($name.Tools::getHttpHost()); + $this->_path = trim(__PS_BASE_URI__.$path, '/\\').'/'; + if ($this->_path{0} != '/') $this->_path = '/'.$this->_path; + $this->_path = rawurlencode($this->_path); + $this->_path = str_replace('%2F', '/', $this->_path); + $this->_path = str_replace('%7E', '~', $this->_path); + $this->_key = _COOKIE_KEY_; + $this->_iv = _COOKIE_IV_; + $this->_domain = $this->getDomain(); + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $this->_cipherTool = new Blowfish($this->_key, $this->_iv); + $this->update(); + } + + protected function getDomain() + { + $r = '!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?(?:\:(\d*))?([^#?]+)?(?:\?([^#]+))?(?:#(.+$))?!i'; + preg_match ($r, Tools::getHttpHost(false, false), $out); + if (preg_match('/^(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]|[1-9]).)'. + '{1}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9]).)'. + '{2}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9]){1}))$/', $out[4])) + return false; + if (!strstr(Tools::getHttpHost(false, false), '.')) + return false; + $domain = $out[4]; + $subDomains = SubDomain::getSubDomains(); + if ($subDomains === false) + die(Tools::displayError('Bad SubDomain SQL query.')); + foreach ($subDomains AS $subDomain) + { + $subDomainLength = strlen($subDomain) + 1; + if (strncmp($subDomain.'.', $domain, $subDomainLength) == 0) + $domain = substr($domain, $subDomainLength); + } + return $domain; + } + + /** + * Set expiration date + * + * @param integer $expire Expiration time from now + */ + function setExpire($expire) + { + $this->_expire = (int)($expire); + } + + /** + * Magic method wich return cookie data from _content array + * + * @param $key key wanted + * @return string value corresponding to the key + */ + public function __get($key) + { + return isset($this->_content[$key]) ? $this->_content[$key] : false; + } + + /** + * Magic method which check if key exists in the cookie + * + * @param $key key wanted + * @return boolean key existence + */ + public function __isset($key) + { + return isset($this->_content[$key]); + } + + /** + * Magic method wich add data into _content array + * + * @param $key key desired + * @param $value value corresponding to the key + */ + public function __set($key, $value) + { + if (is_array($value)) + die(Tools::displayError()); + if (preg_match('/¤|\|/', $key.$value)) + throw new Exception('Forbidden chars in cookie'); + if (!$this->_modified AND (!isset($this->_content[$key]) OR (isset($this->_content[$key]) AND $this->_content[$key] != $value))) + $this->_modified = true; + $this->_content[$key] = $value; + $this->write(); + } + + /** + * Magic method wich delete data into _content array + * + * @param $key key wanted + */ + public function __unset($key) + { + if (isset($this->_content[$key])) + $this->_modified = true; + unset($this->_content[$key]); + $this->write(); + } + + /** + * Check customer informations saved into cookie and return customer validity + * + * @return boolean customer validity + */ + public function isLogged($withGuest = false) + { + if (!$withGuest AND $this->is_guest == 1) + return false; + + /* Customer is valid only if it can be load and if cookie password is the same as database one */ + if ($this->logged == 1 AND $this->id_customer AND Validate::isUnsignedId($this->id_customer) AND Customer::checkPassword((int)($this->id_customer), $this->passwd)) + return true; + return false; + } + + /** + * Check employee informations saved into cookie and return employee validity + * + * @return boolean employee validity + */ + public function isLoggedBack() + { + /* Employee is valid only if it can be load and if cookie password is the same as database one */ + return ($this->id_employee + AND Validate::isUnsignedId($this->id_employee) + AND Employee::checkPassword((int)$this->id_employee, $this->passwd) + AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) OR !Configuration::get('PS_COOKIE_CHECKIP')) + ); + } + + /** + * Delete cookie + */ + public function logout() + { + $this->_content = array(); + $this->_setcookie(); + unset($_COOKIE[$this->_name]); + $this->_modified = true; + $this->write(); + } + + /** + * Soft logout, delete everything links to the customer + * but leave there affiliate's informations + */ + public function mylogout() + { + unset($this->_content['id_customer']); + unset($this->_content['id_guest']); + unset($this->_content['is_guest']); + unset($this->_content['id_connections']); + unset($this->_content['customer_lastname']); + unset($this->_content['customer_firstname']); + unset($this->_content['passwd']); + unset($this->_content['logged']); + unset($this->_content['email']); + unset($this->_content['id_cart']); + unset($this->_content['id_address_invoice']); + unset($this->_content['id_address_delivery']); + $this->_modified = true; + $this->write(); + } + + function makeNewLog() + { + unset($this->_content['id_customer']); + unset($this->_content['id_guest']); + Guest::setNewGuest($this); + $this->_modified = true; + } + + /** + * Get cookie content + */ + function update($nullValues = false) + { + + if (isset($_COOKIE[$this->_name])) + { + /* Decrypt cookie content */ + $content = $this->_cipherTool->decrypt($_COOKIE[$this->_name]); + + /* Get cookie checksum */ + $checksum = crc32($this->_iv.substr($content, 0, strrpos($content, '¤') + 2)); + + /* Unserialize cookie content */ + $tmpTab = explode('¤', $content); + foreach ($tmpTab AS $keyAndValue) + { + $tmpTab2 = explode('|', $keyAndValue); + if (sizeof($tmpTab2) == 2) + $this->_content[$tmpTab2[0]] = $tmpTab2[1]; + } + /* Blowfish fix */ + if (isset($this->_content['checksum'])) + $this->_content['checksum'] = (int)($this->_content['checksum']); + + /* Check if cookie has not been modified */ + if (!isset($this->_content['checksum']) OR $this->_content['checksum'] != $checksum) + $this->logout(); + + if (!isset($this->_content['date_add'])) + $this->_content['date_add'] = date('Y-m-d H:i:s'); + } + else + $this->_content['date_add'] = date('Y-m-d H:i:s'); + + //checks if the language exists, if not choose the default language + if (!Language::getLanguage((int)$this->id_lang)) + $this->id_lang = Configuration::get('PS_LANG_DEFAULT'); + + } + + /** + * Setcookie according to php version + */ + protected function _setcookie($cookie = NULL) + { + if ($cookie) + { + $content = $this->_cipherTool->encrypt($cookie); + $time = $this->_expire; + } + else + { + $content = 0; + $time = time() - 1; + } + if (PHP_VERSION_ID <= 50200) /* PHP version > 5.2.0 */ + return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, 0); + else + return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, 0, true); + } + + /** + * Save cookie with setcookie() + */ + public function write() + { + $cookie = ''; + + /* Serialize cookie content */ + if (isset($this->_content['checksum'])) unset($this->_content['checksum']); + foreach ($this->_content AS $key => $value) + $cookie .= $key.'|'.$value.'¤'; + + /* Add checksum to cookie */ + $cookie .= 'checksum|'.crc32($this->_iv.$cookie); + + /* Cookies are encrypted for evident security reasons */ + return $this->_setcookie($cookie); + } + + /** + * Get a family of variables (e.g. "filter_") + */ + public function getFamily($origin) + { + $result = array(); + if (count($this->_content) == 0) + return $result; + foreach ($this->_content AS $key => $value) + if (strncmp($key, $origin, strlen($origin)) == 0) + $result[$key] = $value; + return $result; + } + + /** + * + */ + public function unsetFamily($origin) + { + $family = $this->getFamily($origin); + foreach ($family AS $member => $value) + unset($this->$member); + } + +} diff --git a/classes/Country.php b/classes/Country.php new file mode 100644 index 000000000..122bebccc --- /dev/null +++ b/classes/Country.php @@ -0,0 +1,328 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CountryCore extends ObjectModel +{ + public $id; + + /** @var integer Zone id which country belongs */ + public $id_zone; + + /** @var integer Currency id which country belongs */ + public $id_currency; + + /** @var string 2 letters iso code */ + public $iso_code; + + /** @var integer international call prefix */ + public $call_prefix; + + /** @var string Name */ + public $name; + + /** @var boolean Contain states */ + public $contains_states; + + /** @var boolean Need identification number dni/nif/nie */ + public $need_identification_number; + + /** @var boolean Need Zip Code */ + public $need_zip_code; + + /** @var string Zip Code Format */ + public $zip_code_format; + + /** @var boolean Status for delivery */ + public $active = true; + + protected static $_idZones = array(); + + protected $tables = array ('country', 'country_lang'); + + protected $fieldsRequired = array('id_zone', 'id_currency', 'iso_code', 'contains_states', 'need_identification_number'); + protected $fieldsSize = array('iso_code' => 3); + protected $fieldsValidate = array('id_zone' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', 'call_prefix' => 'isInt', 'iso_code' => 'isLanguageIsoCode', 'active' => 'isBool', 'contains_states' => 'isBool', 'need_identification_number' => 'isBool', 'need_zip_code' => 'isBool', 'zip_code_format' => 'isZipCodeFormat'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 64); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $webserviceParameters = array( + 'objectsNodeName' => 'countries', + 'fields' => array( + 'id_zone' => array('sqlId' => 'id_zone', 'xlink_resource'=> 'zones'), + 'id_currency' => array('sqlId' => 'id_currency', 'xlink_resource'=> 'currencies'), + ), + ); + + protected $table = 'country'; + protected $identifier = 'id_country'; + + public function getFields() + { + parent::validateFields(); + $fields['id_zone'] = (int)($this->id_zone); + $fields['id_currency'] = (int)($this->id_currency); + $fields['iso_code'] = pSQL(strtoupper($this->iso_code)); + $fields['call_prefix'] = (int)($this->call_prefix); + $fields['active'] = (int)($this->active); + $fields['contains_states'] = (int)($this->contains_states); + $fields['need_identification_number'] = (int)($this->need_identification_number); + $fields['need_zip_code'] = (int)($this->need_zip_code); + $fields['zip_code_format'] = $this->zip_code_format; + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + /** + * Return available countries + * + * @param integer $id_lang Language ID + * @param boolean $active return only active coutries + * @return array Countries and corresponding zones + */ + static public function getCountries($id_lang, $active = false, $containStates = NULL) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $states = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT s.* + FROM `'._DB_PREFIX_.'state` s + ORDER BY s.`name` ASC'); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cl.*,c.*, cl.`name` AS country, z.`name` AS zone + FROM `'._DB_PREFIX_.'country` c + LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'zone` z ON z.`id_zone` = c.`id_zone` + WHERE 1 + '.($active ? 'AND c.active = 1' : '').' + '.(!is_null($containStates) ? 'AND c.`contains_states` = '.(int)($containStates) : '').' + ORDER BY cl.name ASC'); + $countries = array(); + foreach ($result AS &$country) + $countries[$country['id_country']] = $country; + foreach ($states AS &$state) + if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */ + $countries[$state['id_country']]['states'][] = $state; + + return $countries; + } + + /** + * Get a country ID with its iso code + * + * @param string $iso_code Country iso code + * @return integer Country ID + */ + static public function getByIso($iso_code) + { + if (!Validate::isLanguageIsoCode($iso_code)) + die(Tools::displayError()); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_country` + FROM `'._DB_PREFIX_.'country` + WHERE `iso_code` = \''.pSQL(strtoupper($iso_code)).'\''); + + return $result['id_country']; + } + + static public function getIdZone($id_country) + { + if (!Validate::isUnsignedId($id_country)) + die(Tools::displayError()); + + if (isset(self::$_idZones[$id_country])) + return self::$_idZones[$id_country]; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_zone` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)($id_country)); + + self::$_idZones[$id_country] = $result['id_zone']; + return $result['id_zone']; + } + + /** + * Get a country name with its ID + * + * @param integer $id_lang Language ID + * @param integer $id_country Country ID + * @return string Country name + */ + static public function getNameById($id_lang, $id_country) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name` + FROM `'._DB_PREFIX_.'country_lang` + WHERE `id_lang` = '.(int)($id_lang).' + AND `id_country` = '.(int)($id_country)); + + return $result['name']; + } + + /** + * Get a country iso with its ID + * + * @param integer $id_country Country ID + * @return string Country iso + */ + static public function getIsoById($id_country) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `iso_code` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)($id_country)); + + return $result['iso_code']; + } + + /** + * Get a country id with its name + * + * @param integer $id_lang Language ID + * @param string $country Country Name + * @return intval Country id + */ + static public function getIdByName($id_lang = NULL, $country) + { + $sql = ' + SELECT `id_country` + FROM `'._DB_PREFIX_.'country_lang` + WHERE `name` LIKE \''.pSQL($country).'\''; + if ($id_lang) + $sql .= ' AND `id_lang` = '.(int)($id_lang); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); + + return ((int)($result['id_country'])); + } + + + /** + * @param $id_country + * @deprecated + */ + static public function getNeedIdentifcationNumber($id_country) + { + Tools::displayAsDeprecated(); + return self::isNeedDniByCountryId($id_country); + } + + static public function getNeedZipCode($id_country) + { + if (!(int)($id_country)) + return false; + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `need_zip_code` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)($id_country)); + } + + static public function getZipCodeFormat($id_country) + { + if (!(int)($id_country)) + return false; + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `zip_code_format` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)($id_country)); + } + + public static function displayCallPrefix($prefix) + { + return ((int)($prefix) ? '+'.$prefix : '-'); + } + + /** + * Returns the default country Id + * + * @return integer default country id + */ + public static function getDefaultCountryId() + { + global $cookie; + + if (Configuration::get('PS_GEOLOCATION_ENABLED') AND Validate::isLanguageIsoCode($cookie->iso_code_country)) + $id_country = (int)(Country::getByIso($cookie->iso_code_country)); + else + $id_country = (int)(Configuration::get('PS_COUNTRY_DEFAULT')); + + return $id_country; + } + + + public static function getCountriesByZoneId($id_zone, $id_lang) + { + if (empty($id_zone) OR empty($id_lang)) + die(Tools::displayError()); + return Db::getInstance()->ExecuteS(' + SELECT DISTINCT c.*, cl.* + FROM `'._DB_PREFIX_.'country` c + LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_country` = c.`id_country`) + LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`) + WHERE (c.`id_zone` = '.(int)$id_zone.' OR s.`id_zone` = '.(int)$id_zone.') + AND `id_lang` = '.(int)$id_lang + ); + } + + public function isNeedDni() + { + return (bool)self::isNeedDniByCountryId($this->id); + } + + static public function isNeedDniByCountryId($id_country) + { + return (bool)Db::getInstance()->getValue(' + SELECT `need_identification_number` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)$id_country); + } + + static public function containsStates($id_country) + { + return (bool)Db::getInstance()->getValue(' + SELECT `contains_states` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)$id_country); + } + +} + diff --git a/classes/County.php b/classes/County.php new file mode 100644 index 000000000..337d0e5a1 --- /dev/null +++ b/classes/County.php @@ -0,0 +1,244 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CountyCore extends ObjectModel +{ + public $id; + public $name; + public $id_state; + public $active; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 64); + protected $fieldsValidate = array('name' => 'isGenericName', 'id_state' => 'isUnsignedId', 'active' => 'isBool'); + + protected $table = 'county'; + protected $identifier = 'id_county'; + + private static $_cache_get_counties = array(); + private static $_cache_county_zipcode = array(); + + const USE_BOTH_TAX = 0; + const USE_COUNTY_TAX = 1; + const USE_STATE_TAX = 2; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_state' => array('xlink_resource'=> 'states'), + ), + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_state'] = (int)($this->id_state); + $fields['name'] = pSQL($this->name); + $fields['active'] = (int)($this->active); + return $fields; + } + + public function delete() + { + $id = $this->id; + parent::delete(); + + // remove associated zip codes & tax rule + return (County::deleteZipCodeByIdCounty($id) AND TaxRule::deleteTaxRuleByIdCounty($id)); + } + + public static function getCounties($id_state) + { + if (!isset(self::$_cache_get_counties[$id_state])) + { + self::$_cache_get_counties[$id_state] = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'county` + WHERE `id_state` = '.(int)$id_state + ); + } + + return self::$_cache_get_counties[$id_state]; + } + + // return the list of associated zipcode + public function getZipCodes() + { + return Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'county_zip_code` + WHERE `id_county` = '.(int)$this->id.' + ORDER BY `from_zip_code` ASC' + ); + } + + public function addZipCodes($zip_codes) + { + list($from, $to) = $this->breakDownZipCode($zip_codes); + + if ($from == 0) + return false; + + return Db::getInstance()->Execute( + 'INSERT INTO `'._DB_PREFIX_.'county_zip_code` (`id_county`, `from_zip_code`, `to_zip_code`) + VALUES ('.(int)$this->id.','.(int)$from.','.(int)$to.')' + ); + } + + + public function removeZipCodes($zip_codes) + { + list($from, $to) = $this->breakDownZipCode($zip_codes); + + if ($from == 0) + return false; + + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'county_zip_code` + WHERE `id_county` = '.(int)$this->id.' + AND `from_zip_code` = '.(int)$from.' + AND `to_zip_code` = '.(int)$to + ); + } + + + public function breakDownZipCode($zip_codes) + { + $zip_codes = preg_split('/-/', $zip_codes); + + if (sizeof($zip_codes) == 2) + { + $from = $zip_codes[0]; + $to = $zip_codes[1]; + if ($zip_codes[0] > $zip_codes[1]) + { + $from = $zip_codes[1]; + $to = $zip_codes[0]; + } + else if ($zip_codes[0] == $zip_codes[1]) + { + $from = $zip_codes[0]; + $to = 0; + } + } + else if (sizeof($zip_codes) == 1) + { + $from = $zip_codes[0]; + $to = 0; + } + + if (!Validate::isInt($from) OR !Validate::isInt($to)) + { + $from = 0; + $to = 0; + } + + return array($from, $to); + } + + public static function getIdCountyByZipCode($id_state, $zip_code) + { + if (!isset(self::$_cache_county_zipcode[$id_state.'-'.$zip_code])) + { + self::$_cache_county_zipcode[$id_state.'-'.$zip_code] = Db::getInstance()->getValue(' + SELECT DISTINCT c.`id_county` FROM `'._DB_PREFIX_.'county` c + LEFT JOIN `'._DB_PREFIX_.'county_zip_code` cz ON (c.`id_county` = cz.`id_county`) + WHERE `id_state` = '.(int)$id_state.' + AND cz.`from_zip_code` >= '.(int)$zip_code.' + AND cz.`to_zip_code` <= '.(int)$zip_code + ); + } + + return self::$_cache_county_zipcode[$id_state.'-'.$zip_code]; + } + + public function isZipCodeRangePresent($zip_codes) + { + $res = false; + list($from, $to) = $this->breakDownZipCode($zip_codes); + + if ($from == 0) + return false; + + if ($to != 0) + { + $res = Db::getInstance()->getValue(' + SELECT COUNT(*) FROM `'._DB_PREFIX_.'county_zip_code` cz + LEFT JOIN `'._DB_PREFIX_.'county` c ON (c.`id_county` = cz.`id_county`) + LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = c.`id_state`) + WHERE `from_zip_code` >= '.(int)$from.' + AND `to_zip_code` <= '.(int)$to.' + AND s.`id_country` = (SELECT `id_country` + FROM `'._DB_PREFIX_.'state` s + LEFT JOIN `'._DB_PREFIX_.'county` c ON (c.`id_state` = s.`id_state`) + WHERE `id_county` = '.(int)$this->id.' + )' + ); + } + + return ($res OR County::isZipCodePresent($from) OR County::isZipCodePresent($to)); + } + + public function isZipCodePresent($zip_code) + { + + if ($zip_code == 0) + return false; + + return (bool) Db::getInstance()->getValue(' + SELECT COUNT(*) FROM `'._DB_PREFIX_.'county_zip_code` cz + LEFT JOIN `'._DB_PREFIX_.'county` c ON (c.`id_county` = cz.`id_county`) + LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = c.`id_state`) + WHERE + (`from_zip_code` <= '.(int)$zip_code.' AND `to_zip_code` >= '.(int)$zip_code.') + OR + (`from_zip_code` = '.(int)$zip_code.') + AND s.`id_country` = (SELECT `id_country` + FROM `'._DB_PREFIX_.'state` s + LEFT JOIN `'._DB_PREFIX_.'county` c ON (c.`id_state` = s.`id_state`) + WHERE `id_county` = '.(int)$this->id.' + )' + ); + } + + public static function deleteZipCodeByIdCounty($id_county) + { + return Db::getInstance()->Execute( + 'DELETE FROM `'._DB_PREFIX_.'county_zip_code` + WHERE `id_county` = '.(int)$id_county + ); + } + + + public static function getIdCountyByNameAndIdState($name, $id_state) + { + return Db::getInstance()->getValue(' + SELECT `id_county` FROM `'._DB_PREFIX_.'county` + WHERE `name` = \''.pSQL($name).'\' + AND `id_state` = '.(int)$id_state + ); + } + +} + diff --git a/classes/Currency.php b/classes/Currency.php new file mode 100644 index 000000000..0a2a13bbf --- /dev/null +++ b/classes/Currency.php @@ -0,0 +1,364 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CurrencyCore extends ObjectModel +{ + public $id; + + /** @var string Name */ + public $name; + + /** @var string Iso code */ + public $iso_code; + + /** @var string Iso code numeric */ + public $iso_code_num; + + /** @var string Symbol for short display */ + public $sign; + + /** @var int bool used for displaying blank between sign and price */ + public $blank; + + /** @var string Conversion rate from euros */ + public $conversion_rate; + + /** @var boolean True if currency has been deleted (staying in database as deleted) */ + public $deleted = 0; + + /** @var int ID used for displaying prices */ + public $format; + + /** @var int bool Display decimals on prices */ + public $decimals; + + /** @var int bool active */ + public $active; + + protected $fieldsRequired = array('name', 'iso_code', 'sign', 'conversion_rate', 'format', 'decimals'); + protected $fieldsSize = array('name' => 32, 'iso_code' => 3, 'iso_code_num' => 3, 'sign' => 8); + protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'iso_code_num' => 'isNumericIsoCode', 'blank' => 'isInt', 'sign' => 'isGenericName', + 'format' => 'isUnsignedId', 'decimals' => 'isBool', 'conversion_rate' => 'isFloat', 'deleted' => 'isBool', 'active' => 'isBool'); + + protected $table = 'currency'; + protected $identifier = 'id_currency'; + + /** @var Currency Current currency */ + static protected $current = NULL; + /** @var array Currency cache */ + static protected $currencies = array(); + + protected $webserviceParameters = array( + 'fields' => array( + ), + ); + + + /** + * Overriding check if currency with the same iso code already exists. + * If it's true, currency is doesn't added. + * + * @see ObjectModelCore::add() + */ + public function add($autodate = true, $nullValues = false) + { + return Currency::exists($this->iso_code) ? false : parent::add(); + } + + /** + * Check if a curency already exists. + * + * @param int|string $iso_code int for iso code number string for iso code + * @return boolean + */ + public static function exists ($iso_code) + { + if(is_int($iso_code)) + $id_currency_exists = Currency::getIdByIsoCodeNum($iso_code); + else + $id_currency_exists = Currency::getIdByIsoCode($iso_code); + + if ($id_currency_exists){ + return true; + } else { + return false; + } + } + public function getFields() + { + parent::validateFields(); + + $fields['name'] = pSQL($this->name); + $fields['iso_code'] = pSQL($this->iso_code); + $fields['iso_code_num'] = pSQL($this->iso_code_num); + $fields['sign'] = pSQL($this->sign); + $fields['format'] = (int)($this->format); + $fields['decimals'] = (int)($this->decimals); + $fields['blank'] = (int)($this->blank); + $fields['conversion_rate'] = (float)($this->conversion_rate); + $fields['deleted'] = (int)($this->deleted); + $fields['active'] = (int)($this->active); + + return $fields; + } + + public function deleteSelection($selection) + { + if (!is_array($selection) OR !Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $result = true; + foreach ($selection AS $id) + { + $obj = new Currency((int)($id)); + $res[$id] = $obj->delete(); + } + foreach ($res AS $value) + if (!$value) + return false; + return true; + } + + public function delete() + { + if ($this->id == Configuration::get('PS_CURRENCY_DEFAULT')) + { + $result = Db::getInstance()->getRow('SELECT `id_currency` FROM '._DB_PREFIX_.'currency WHERE `id_currency` != '.(int)($this->id).' AND `deleted` = 0'); + if (!$result['id_currency']) + return false; + Configuration::updateValue('PS_CURRENCY_DEFAULT', $result['id_currency']); + } + $this->deleted = 1; + return $this->update(); + } + + /** + * Return formated sign + * + * @param string $side left or right + * @return string formated sign + */ + public function getSign($side=NULL) + { + if (!$side) + return $this->sign; + $formated_strings = array( + 'left' => $this->sign.' ', + 'right' => ' '.$this->sign + ); + $formats = array( + 1 => array('left' => &$formated_strings['left'], 'right' => ''), + 2 => array('left' => '', 'right' => &$formated_strings['right']), + 3 => array('left' => &$formated_strings['left'], 'right' => ''), + 4 => array('left' => '', 'right' => &$formated_strings['right']), + ); + return ($formats[$this->format][$side]); + } + + /** + * Return available currencies + * + * @return array Currencies + */ + static public function getCurrencies($object = false, $active = 1) + { + $tab = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'currency` + WHERE `deleted` = 0 + '.($active == 1 ? 'AND `active` = 1' : '').' + ORDER BY `name` ASC'); + if ($object) + foreach ($tab as $key => $currency) + $tab[$key] = Currency::getCurrencyInstance($currency['id_currency']); + return $tab; + } + + static public function getPaymentCurrenciesSpecial($id_module) + { + return Db::getInstance()->getRow(' + SELECT mc.* + FROM `'._DB_PREFIX_.'module_currency` mc + WHERE mc.`id_module` = '.(int)($id_module)); + } + + static public function getPaymentCurrencies($id_module) + { + return Db::getInstance()->ExecuteS(' + SELECT c.* + FROM `'._DB_PREFIX_.'module_currency` mc + LEFT JOIN `'._DB_PREFIX_.'currency` c ON c.`id_currency` = mc.`id_currency` + WHERE c.`deleted` = 0 + AND mc.`id_module` = '.(int)($id_module).' + ORDER BY c.`name` ASC'); + } + + static public function checkPaymentCurrencies($id_module) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT mc.* + FROM `'._DB_PREFIX_.'module_currency` mc + WHERE mc.`id_module` = '.(int)($id_module)); + } + + static public function getCurrency($id_currency) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'currency` + WHERE `deleted` = 0 + AND `id_currency` = '.(int)($id_currency)); + } + + static public function getIdByIsoCode($iso_code) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_currency` + FROM `'._DB_PREFIX_.'currency` + WHERE `deleted` = 0 + AND `iso_code` = \''.pSQL($iso_code).'\''); + return $result['id_currency']; + } + static public function getIdByIsoCodeNum($iso_code) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_currency` + FROM `'._DB_PREFIX_.'currency` + WHERE `deleted` = 0 + AND `iso_code_num` = \''.pSQL($iso_code).'\''); + return (int)$result['id_currency']; + } + + /** + * Refresh the currency conversion rate + * The XML file define conversion rate for each from a default currency ($isoCodeSource). + * + * @param $data XML content which contains all the conversion rates + * @param $isoCodeSource The default currency used in the XML file + * @param $defaultCurrency The default currency object + */ + public function refreshCurrency($data, $isoCodeSource, $defaultCurrency) + { + // fetch the conversion rate of the default currency + $conversion_rate = 1; + if ($defaultCurrency->iso_code != $isoCodeSource) + { + foreach ($data->currency AS $currency) + if ($currency['iso_code'] == $defaultCurrency->iso_code) + { + $conversion_rate = round((float)$currency['rate'], 6); + break; + } + } + + if ($defaultCurrency->iso_code == $this->iso_code) + $this->conversion_rate = 1; + else + { + if ($this->iso_code == $isoCodeSource) + $rate = 1; + else + { + foreach ($data->currency AS $obj) + if ($this->iso_code == strval($obj['iso_code'])) + { + $rate = (float) $obj['rate']; + break; + } + } + + $this->conversion_rate = round($rate / $conversion_rate, 6); + } + $this->update(); + } + + /** + * @deprecated + **/ + static public function refreshCurrenciesGetDefault($data, $isoCodeSource, $idCurrency) + { + Tools::displayAsDeprecated(); + + $defaultCurrency = new Currency($idCurrency); + + /* Change defaultCurrency rate if not as currency of feed source */ + if ($defaultCurrency->iso_code != $isoCodeSource) + foreach ($data->currency AS $obj) + if ($defaultCurrency->iso_code == strval($obj['iso_code'])) + $defaultCurrency->conversion_rate = round((float)($obj['rate']), 6); + + return $defaultCurrency; + } + + public static function getDefaultCurrency() + { + $id_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT'); + if ($id_currency == 0) + return false; + + return new Currency($id_currency); + } + + static public function refreshCurrencies() + { + // Parse + if (!$feed = @simplexml_load_file('http://www.prestashop.com/xml/currencies.xml')) + return Tools::displayError('Cannot parse feed.'); + + // Default feed currency (EUR) + $isoCodeSource = strval($feed->source['iso_code']); + + if (!$default_currency = self::getDefaultCurrency()) + return Tools::displayError('No default currency'); + + $currencies = self::getCurrencies(true); + foreach ($currencies as $currency) + $currency->refreshCurrency($feed->list, $isoCodeSource, $default_currency); + + } + + static public function getCurrent() + { + global $cookie; + + if (!self::$current) + { + if (isset($cookie->id_currency) AND $cookie->id_currency) + self::$current = new Currency((int)($cookie->id_currency)); + else + self::$current = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + } + return self::$current; + } + + static public function getCurrencyInstance($id) + { + if (!array_key_exists($id, self::$currencies)) + self::$currencies[(int)($id)] = new Currency((int)($id)); + return self::$currencies[(int)($id)]; + } +} + diff --git a/classes/Customer.php b/classes/Customer.php new file mode 100644 index 000000000..738e1b3bb --- /dev/null +++ b/classes/Customer.php @@ -0,0 +1,659 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CustomerCore extends ObjectModel +{ + public $id; + + /** @var string Secure key */ + public $secure_key; + + /** @var string protected note */ + public $note; + + /** @var integer Gender ID */ + public $id_gender = 9; + + /** @var integer Default group ID */ + public $id_default_group; + + /** @var string Lastname */ + public $lastname; + + /** @var string Firstname */ + public $firstname; + + /** @var string Birthday (yyyy-mm-dd) */ + public $birthday = NULL; + + /** @var string e-mail */ + public $email; + + /** @var boolean Newsletter subscription */ + public $newsletter; + + /** @var string Newsletter ip registration */ + public $ip_registration_newsletter; + + /** @var string Newsletter ip registration */ + public $newsletter_date_add; + + /** @var boolean Opt-in subscription */ + public $optin; + + /** @var integer Password */ + public $passwd; + + /** @var datetime Password */ + public $last_passwd_gen; + + /** @var boolean Status */ + public $active = true; + + /** @var boolean Status */ + public $is_guest = 0; + + /** @var boolean True if carrier has been deleted (staying in database as deleted) */ + public $deleted = 0; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + public $years; + public $days; + public $months; + + protected $tables = array ('customer'); + + protected $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email'); + protected $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'email' => 128, 'note' => 65000); + protected $fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isName', 'firstname' => 'isName', 'email' => 'isEmail', 'passwd' => 'isPasswd', + 'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool', 'note' => 'isCleanHtml', 'is_guest' => 'isBool'); + + protected $webserviceParameters = array( + 'objectMethods' => array('add' => 'addWs'), + 'fields' => array( + 'id_default_group' => array('xlink_resource' => 'groups'), + 'newsletter_date_add' => array(), + 'ip_registration_newsletter' => array(), + 'last_passwd_gen' => array('setter' => null), + 'secure_key' => array('setter' => null), + 'deleted' => array() + ), + ); + + protected $table = 'customer'; + protected $identifier = 'id_customer'; + + protected static $_defaultGroupId = array(); + protected static $_customerHasAddress = array(); + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_customer'] = (int)($this->id); + $fields['secure_key'] = pSQL($this->secure_key); + $fields['note'] = pSQL($this->note, true); + $fields['id_gender'] = (int)($this->id_gender); + $fields['id_default_group'] = (int)($this->id_default_group); + $fields['lastname'] = pSQL($this->lastname); + $fields['firstname'] = pSQL($this->firstname); + $fields['birthday'] = pSQL($this->birthday); + $fields['email'] = pSQL($this->email); + $fields['newsletter'] = (int)($this->newsletter); + $fields['newsletter_date_add'] = pSQL($this->newsletter_date_add); + $fields['ip_registration_newsletter'] = pSQL($this->ip_registration_newsletter); + $fields['optin'] = (int)($this->optin); + $fields['passwd'] = pSQL($this->passwd); + $fields['last_passwd_gen'] = pSQL($this->last_passwd_gen); + $fields['active'] = (int)($this->active); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['is_guest'] = (int)($this->is_guest); + $fields['deleted'] = (int)($this->deleted); + return $fields; + } + + public function add($autodate = true, $nullValues = true) + { + $this->birthday = (empty($this->years) ? $this->birthday : (int)($this->years).'-'.(int)($this->months).'-'.(int)($this->days)); + $this->secure_key = md5(uniqid(rand(), true)); + $this->last_passwd_gen = date('Y-m-d H:i:s', strtotime('-'.Configuration::get('PS_PASSWD_TIME_FRONT').'minutes')); + if (empty($this->id_default_group)) + $this->id_default_group = 1; + /* Can't create a guest customer, if this feature is disabled */ + if ($this->is_guest AND !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) + return false; + if (!parent::add($autodate, $nullValues)) + return false; + + $row = array('id_customer' => (int)($this->id), 'id_group' => (int)$this->id_default_group); + return Db::getInstance()->AutoExecute(_DB_PREFIX_.'customer_group', $row, 'INSERT'); + } + + public function update($nullValues = false) + { + $this->birthday = (empty($this->years) ? $this->birthday : (int)$this->years.'-'.(int)$this->months.'-'.(int)$this->days); + if ($this->newsletter AND !$this->newsletter_date_add) + $this->newsletter_date_add = date('Y-m-d H:i:s'); + return parent::update(true); + } + + public function delete() + { + $addresses = $this->getAddresses((int)(Configuration::get('PS_LANG_DEFAULT'))); + foreach ($addresses AS $address) + { + $obj = new Address((int)($address['id_address'])); + $obj->delete(); + } + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($this->id)); + Discount::deleteByIdCustomer((int)($this->id)); + return parent::delete(); + } + + /** + * Return customers list + * + * @return array Customers + */ + static public function getCustomers() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `id_customer`, `email`, `firstname`, `lastname` + FROM `'._DB_PREFIX_.'customer` + ORDER BY `id_customer` ASC'); + } + + /** + * Return customer instance from its e-mail (optionnaly check password) + * + * @param string $email e-mail + * @param string $passwd Password is also checked if specified + * @return Customer instance + */ + public function getByEmail($email, $passwd = NULL) + { + if (!Validate::isEmail($email) OR ($passwd AND !Validate::isPasswd($passwd))) + die (Tools::displayError()); + + $result = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_ .'customer` + WHERE `active` = 1 + AND `email` = \''.pSQL($email).'\' + '.(isset($passwd) ? 'AND `passwd` = \''.md5(pSQL(_COOKIE_KEY_.$passwd)).'\'' : '').' + AND `deleted` = 0 + AND `is_guest` = 0'); + + if (!$result) + return false; + $this->id = $result['id_customer']; + foreach ($result AS $key => $value) + if (key_exists($key, $this)) + $this->{$key} = $value; + + return $this; + } + + /** + * Check id the customer is active or not + * + * @return boolean customer validity + */ + public static function isBanned($id_customer) + { + if (!Validate::isUnsignedId($id_customer)) + return true; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_customer` + FROM `'._DB_PREFIX_.'customer` + WHERE `id_customer` = \''.(int)($id_customer).'\' + AND active = 1 + AND `deleted` = 0'); + if (isset($result['id_customer'])) + return false; + return true; + } + + /** + * Check if e-mail is already registered in database + * + * @param string $email e-mail + * @param $return_id boolean + * @param $ignoreGuest boolean, for exclure guest customer + * @return Customer ID if found, false otherwise + */ + static public function customerExists($email, $return_id = false, $ignoreGuest = true) + { + if (!Validate::isEmail($email)) + die (Tools::displayError()); + + $result = Db::getInstance()->getRow(' + SELECT `id_customer` + FROM `'._DB_PREFIX_.'customer` + WHERE `email` = \''.pSQL($email).'\'' + .($ignoreGuest ? 'AND `is_guest` = 0' : '')); + + if ($return_id) + return (int)($result['id_customer']); + else + return isset($result['id_customer']); + } + + /** + * Check if, except current customer, someone else registered this e-email + * + * @return integer Number of customers who have also this e-mail + * @deprecated + */ + public function cantChangeemail() + { + Tools::displayAsDeprecated(); + if (!Validate::isEmail($this->email)) + die (Tools::displayError()); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_customer`) AS total + FROM `'._DB_PREFIX_.'customer` + WHERE `email` = \''.pSQL($this->email).'\' AND `id_customer` != '.(int)($this->id)); + + return $result['total']; + } + + /** + * Check if an address is owned by a customer + * + * @param integer $id_customer Customer ID + * @param integer $id_address Address ID + * @return boolean result + */ + static public function customerHasAddress($id_customer, $id_address) + { + if (!array_key_exists($id_customer, self::$_customerHasAddress)) + { + self::$_customerHasAddress[$id_customer] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `id_address` + FROM `'._DB_PREFIX_.'address` + WHERE `id_customer` = '.(int)($id_customer).' + AND `id_address` = '.(int)($id_address).' + AND `deleted` = 0'); + } + return self::$_customerHasAddress[$id_customer]; + } + + static public function resetAddressCache($id_customer) + { + if (array_key_exists($id_customer, self::$_customerHasAddress)) + unset(self::$_customerHasAddress[$id_customer]); + } + + /** + * Return customer addresses + * + * @param integer $id_lang Language ID + * @return array Addresses + */ + public function getAddresses($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT a.*, cl.`name` AS country, s.name AS state + FROM `'._DB_PREFIX_.'address` a + LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`) + LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`) + LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`) + WHERE `id_lang` = '.(int)($id_lang).' AND `id_customer` = '.(int)($this->id).' AND a.`deleted` = 0'); + } + + + /** + * Returns customer last connections + * + * @param integer $nb Number of connections wanted + * @return array Connections + */ + public function getConnections($nb = 10) + { + Tools::displayAsDeprecated(); + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `ip_address`, `date_add` + FROM `'._DB_PREFIX_.'connections` + WHERE `id_guest` IN (SELECT `id_guest` FROM `'._DB_PREFIX_.'guest` WHERE `id_customer` = '.(int)($this->id).') + ORDER BY `date_add` DESC + LIMIT 0,'.(int)($nb)); + } + + /** + * Count the number of addresses for a customer + * + * @param integer $id_customer Customer ID + * @return integer Number of addresses + */ + public static function getAddressesTotalById($id_customer) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(a.`id_address`) + FROM `'._DB_PREFIX_.'address` a + WHERE a.`id_customer` = '.(int)($id_customer).' + AND a.`deleted` = 0'); + } + + /** + * Check if customer password is the right one + * + * @param string $passwd Password + * @return boolean result + */ + static public function checkPassword($id_customer, $passwd) + { + if (!Validate::isUnsignedId($id_customer) OR !Validate::isMd5($passwd)) + die (Tools::displayError()); + + return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `id_customer` + FROM `'._DB_PREFIX_.'customer` + WHERE `id_customer` = '.(int)($id_customer).' + AND `passwd` = \''.pSQL($passwd).'\''); + } + + /** + * Return customers who have subscribed to the newsletter + * + * @return array Customers + * @deprecated + */ + public static function getNewsletteremails() + { + Tools::displayAsDeprecated(); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `email`, `firstname`, `lastname`, `newsletter`, `ip_registration_newsletter`, `newsletter_date_add` + FROM `'._DB_PREFIX_.'customer` + WHERE `newsletter` = 1 + AND `active` = 1'); + } + + /** + * Return the number of customers who registered today + * + * @return integer number of customers who registered today + * @deprecated + */ + public static function getTodaysRegistration() + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_customer`) as nb + FROM `'._DB_PREFIX_.'customer` + WHERE DAYOFYEAR(`date_add`) = DAYOFYEAR(NOW()) + AND YEAR(`date_add`) = YEAR(NOW())'); + if (!$result['nb']) + return '0'; + return $result['nb']; + } + + /** + * Light back office search for customers + * + * @param string $query Searched string + * @return array Corresponding customers + */ + public static function searchByName($query) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.* + FROM `'._DB_PREFIX_.'customer` c + WHERE c.`email` LIKE \'%'.pSQL($query).'%\' + OR c.`id_customer` LIKE \'%'.pSQL($query).'%\' + OR c.`lastname` LIKE \'%'.pSQL($query).'%\' + OR c.`firstname` LIKE \'%'.pSQL($query).'%\''); + } + + /** + * Return several useful statistics about customer + * + * @return array Stats + */ + public function getStats() + { + $result = Db::getInstance()->getRow(' + SELECT COUNT(`id_order`) AS nb_orders, SUM(`total_paid` / o.`conversion_rate`) AS total_orders + FROM `'._DB_PREFIX_.'orders` o + WHERE o.`id_customer` = '.(int)($this->id).' + AND o.valid = 1'); + + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT MAX(c.`date_add`) AS last_visit + FROM `'._DB_PREFIX_.'guest` g + LEFT JOIN `'._DB_PREFIX_.'connections` c ON c.id_guest = g.id_guest + WHERE g.`id_customer` = '.(int)($this->id)); + + $result3 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT (YEAR(CURRENT_DATE)-YEAR(c.`birthday`)) - (RIGHT(CURRENT_DATE, 5)ExecuteS(' + SELECT c.date_add, COUNT(cp.id_page) AS pages, TIMEDIFF(MAX(cp.time_end), c.date_add) as time, http_referer,INET_NTOA(ip_address) as ipaddress + FROM `'._DB_PREFIX_.'guest` g + LEFT JOIN `'._DB_PREFIX_.'connections` c ON c.id_guest = g.id_guest + LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections + WHERE g.`id_customer` = '.(int)($this->id).' + GROUP BY c.`id_connections` + ORDER BY c.date_add DESC + LIMIT 10'); + } + + /** + * Return last cart ID for this customer + * + * @return integer Cart ID + * @deprecated + */ + public function getLastCart() + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT MAX(c.`id_cart`) AS id_cart + FROM `'._DB_PREFIX_.'cart` c + WHERE c.`id_customer` = '.(int)($this->id)); + if (isset($result['id_cart'])) + return $result['id_cart']; + return false; + } + /* + * Specify if a customer already in base + * + * @param $id_customer Customer id + * @return boolean + */ + // DEPRECATED + public function customerIdExists($id_customer) + { + return self::customerIdExistsStatic((int)($id_customer)); + } + + static public function customerIdExistsStatic($id_customer) + { + $row = Db::getInstance()->getRow(' + SELECT `id_customer` + FROM '._DB_PREFIX_.'customer c + WHERE c.`id_customer` = '.(int)($id_customer)); + + return isset($row['id_customer']); + } + + public function cleanGroups() + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($this->id)); + } + + public function addGroups($groups) + { + foreach ($groups as $group) + { + $row = array('id_customer' => (int)($this->id), 'id_group' => (int)($group)); + Db::getInstance()->AutoExecute(_DB_PREFIX_.'customer_group', $row, 'INSERT'); + } + } + + public static function getGroupsStatic($id_customer) + { + $groups = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT cg.`id_group` + FROM '._DB_PREFIX_.'customer_group cg + WHERE cg.`id_customer` = '.(int)($id_customer)); + foreach ($result AS $group) + $groups[] = (int)($group['id_group']); + return $groups; + } + + public function getGroups() + { + return self::getGroupsStatic((int)($this->id)); + } + + public function isUsed() + { + return false; + } + + /** + * @param int $id_group + * @return int + * @deprecated + */ + public function isMemberOfGroup($id_group) + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT count(cg.`id_group`) as nb + FROM '._DB_PREFIX_.'customer_group cg + WHERE cg.`id_customer` = '.(int)($this->id).' + AND cg.`id_group` = '.(int)($id_group)); + + return $result['nb']; + } + + public function getBoughtProducts() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order + WHERE o.valid = 1 AND o.`id_customer` = '.(int)($this->id)); + } + + /** + * @deprecated + * @return bool + */ + public function getNeedDNI() + { + Tools::displayAsDeprecated(); + + return false; + } + + static public function getDefaultGroupId($id_customer) + { + if (!isset(self::$_defaultGroupId[(int)($id_customer)])) + self::$_defaultGroupId[(int)($id_customer)] = Db::getInstance()->getValue('SELECT `id_default_group` FROM `'._DB_PREFIX_.'customer` WHERE `id_customer` = '.(int)($id_customer)); + return self::$_defaultGroupId[(int)($id_customer)]; + } + + static public function getCurrentCountry($id_customer) + { + global $cart; + + if (!$cart OR !$cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) + $id_address = (int)(Db::getInstance()->getValue('SELECT `id_address` FROM `'._DB_PREFIX_.'address` WHERE `id_customer` = '.(int)($id_customer).' AND `deleted` = 0 ORDER BY `id`')); + else + $id_address = $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; + $ids = Address::getCountryAndState($id_address); + return (int)($ids['id_country'] ? $ids['id_country'] : Configuration::get('PS_COUNTRY_DEFAULT')); + } + + public function toggleStatus() + { + parent::toggleStatus(); + + /* Change status to active/inactive */ + return Db::getInstance()->Execute(' + UPDATE `'.pSQL(_DB_PREFIX_.$this->table).'` + SET `date_upd` = NOW() + WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + } + + + public function isGuest() + { + return (bool)$this->is_guest; + } + + public function transformToCustomer($id_lang, $password = NULL) + { + if (!$this->isGuest()) + return false; + if (empty($password)) + $password = Tools::passwdGen(); + if (!Validate::isPasswd($password)) + return false; + + $this->is_guest = 0; + $this->passwd = Tools::encrypt($password); + if ($this->update()) + { + $vars = array( + '{firstname}' => $this->firstname, + '{lastname}' => $this->lastname, + '{email}' => $this->email, + '{passwd}' => $password + ); + + Mail::Send((int)$id_lang, 'guest_to_customer', Mail::l('Your guest account has been transformed to customer account'), $vars, $this->email, $this->firstname.' '.$this->lastname); + return true; + } + return false; + } + public function addWs($autodate = true, $nullValues = false) + { + $this->passwd = Tools::encrypt($this->passwd); + return $this->add($autodate, $nullValues); + } +} + diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php new file mode 100644 index 000000000..f2c36bc13 --- /dev/null +++ b/classes/CustomerMessage.php @@ -0,0 +1,59 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CustomerMessageCore extends ObjectModel +{ + public $id; + public $id_customer_thread; + public $id_employee; + public $message; + public $file_name; + public $ip_address; + public $user_agent; + public $date_add; + + protected $table = 'customer_message'; + protected $identifier = 'id_customer_message'; + + protected $fieldsRequired = array('message'); + protected $fieldsSize = array('message' => 65000); + protected $fieldsValidate = array('message' => 'isCleanHtml', 'id_employee' => 'isUnsignedId', 'ip_address' => 'isIp2Long'); + + public function getFields() + { + parent::validateFields(); + $fields['id_customer_thread'] = (int)($this->id_customer_thread); + $fields['id_employee'] = (int)($this->id_employee); + $fields['message'] = pSQL($this->message); + $fields['file_name'] = pSQL($this->file_name); + $fields['ip_address'] = (int)($this->ip_address); + $fields['user_agent'] = pSQL($this->user_agent); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } +} + diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php new file mode 100644 index 000000000..3c3b1d624 --- /dev/null +++ b/classes/CustomerThread.php @@ -0,0 +1,82 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CustomerThreadCore extends ObjectModel +{ + public $id; + public $id_lang; + public $id_contact; + public $id_customer; + public $id_order; + public $id_product; + public $status; + public $email; + public $token; + public $date_add; + public $date_upd; + + protected $table = 'customer_thread'; + protected $identifier = 'id_customer_thread'; + + protected $fieldsRequired = array('id_lang', 'id_contact', 'token'); + protected $fieldsSize = array('email' => 254); + protected $fieldsValidate = array('id_lang' => 'isUnsignedId', 'id_contact' => 'isUnsignedId', 'id_customer' => 'isUnsignedId', + 'id_order' => 'isUnsignedId', 'id_product' => 'isUnsignedId', 'email' => 'isEmail', 'token' => 'isGenericName'); + + public function getFields() + { + parent::validateFields(); + $fields['id_lang'] = (int)($this->id_lang); + $fields['id_contact'] = (int)($this->id_contact); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_order'] = (int)($this->id_order); + $fields['id_product'] = (int)($this->id_product); + $fields['status'] = pSQL($this->status); + $fields['email'] = pSQL($this->email); + $fields['token'] = pSQL($this->token); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function delete() + { + if (!Validate::isUnsignedId($this->id)) + return false; + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_message` WHERE `id_customer_thread` = '.(int)($this->id)); + return (parent::delete()); + } + + public static function getCustomerMessages($id_customer) + { + return Db::getInstance()->ExecuteS(' + SELECT * FROM '._DB_PREFIX_.'customer_thread ct + LEFT JOIN '._DB_PREFIX_.'customer_message cm ON ct.id_customer_thread = cm.id_customer_thread + WHERE id_customer = '.(int)($id_customer)); + } +} + diff --git a/classes/Customization.php b/classes/Customization.php new file mode 100644 index 000000000..4bc51bce8 --- /dev/null +++ b/classes/Customization.php @@ -0,0 +1,125 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CustomizationCore +{ + + static public function getReturnedCustomizations($id_order) + { + if (($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT ore.`id_order_return`, ord.`id_order_detail`, ord.`id_customization`, ord.`product_quantity` + FROM `'._DB_PREFIX_.'order_return` ore + INNER JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (ord.`id_order_return` = ore.`id_order_return`) + WHERE ore.`id_order` = '.(int)($id_order).' AND ord.`id_customization` != 0')) === false) + return false; + $customizations = array(); + foreach ($result AS $row) + $customizations[(int)($row['id_customization'])] = $row; + return $customizations; + } + + static public function getOrderedCustomizations($id_cart) + { + if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `id_customization`, `quantity` FROM `'._DB_PREFIX_.'customization` WHERE `id_cart` = '.(int)($id_cart))) + return false; + $customizations = array(); + foreach ($result AS $row) + $customizations[(int)($row['id_customization'])] = $row; + return $customizations; + } + + static public function countCustomizationQuantityByProduct($customizations) + { + $total = array(); + foreach ($customizations AS $customization) + $total[(int)($customization['id_order_detail'])] = !isset($total[(int)($customization['id_order_detail'])]) ? (int)($customization['quantity']) : $total[(int)($customization['id_order_detail'])] + (int)($customization['quantity']); + return $total; + } + + static public function getLabel($id_customization, $id_lang) + { + if (!$id_customization || !$id_lang) + return false; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name` + FROM `'._DB_PREFIX_.'customization_field_lang` + WHERE `id_customization_field` = '.(int)($id_customization).' + AND `id_lang` = '.(int)($id_lang) + ); + + return $result['name']; + } + + public static function retrieveQuantitiesFromIds(array $ids_customizations) + { + $quantities = array(); + + $in_values = ''; + foreach($ids_customizations as $key => $id_customization) + { + if ($key > 0) $in_values += ','; + $in_values += (int)($id_customization); + } + + if (!empty($in_values)) + { + $results = Db::getInstance()->ExecuteS( + 'SELECT `id_customization`, `id_product`, `quantity`, `quantity_refunded`, `quantity_returned` + FROM `'._DB_PREFIX_.'customization` + WHERE `id_customization` IN ('.$in_values.')'); + + foreach($results as $row) + { + $quantities[$row['id_customization']] = $row; + } + } + + return $quantities; + } + + public static function countQuantityByCart($id_cart) + { + $quantity = array(); + + $results = Db::getInstance()->executeS(' + SELECT `id_product`, `id_product_attribute`, SUM(`quantity`) AS quantity + FROM `'._DB_PREFIX_.'customization` + WHERE `id_cart` = '.(int)($id_cart).' + GROUP BY `id_cart`, `id_product`, `id_product_attribute`' + ); + + foreach($results as $row) + { + $quantity[$row['id_product']][$row['product_attribute_id']] = $row['quantity']; + } + + return $quantity; + } + +} + diff --git a/classes/DateRange.php b/classes/DateRange.php new file mode 100644 index 000000000..c6afc142e --- /dev/null +++ b/classes/DateRange.php @@ -0,0 +1,67 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class DateRangeCore extends ObjectModel +{ + public $time_start; + public $time_end; + + protected $fieldsRequired = array ('time_start', 'time_end'); + protected $fieldsValidate = array ('time_start' => 'isDate', 'time_end' => 'isDate'); + + protected $table = 'date_range'; + protected $identifier = 'id_date_range'; + + public function getFields() + { + parent::validateFields(); + $fields['time_start'] = pSQL($this->time_start); + $fields['time_end'] = pSQL($this->time_end); + return $fields; + } + + public static function getCurrentRange() + { + $result = Db::getInstance()->getRow(' + SELECT `id_date_range`, `time_end` + FROM `'._DB_PREFIX_.'date_range` + WHERE `time_end` = (SELECT MAX(`time_end`) FROM `'._DB_PREFIX_.'date_range`)'); + if (!$result['id_date_range'] OR strtotime($result['time_end']) < strtotime(date('Y-m-d H:i:s'))) + { + // The default range is set to 1 day less 1 second (in seconds) + $rangeSize = 86399; + $dateRange = new DateRange(); + $dateRange->time_start = date('Y-m-d'); + $dateRange->time_end = strftime('%Y-%m-%d %H:%M:%S', strtotime($dateRange->time_start) + $rangeSize); + $dateRange->add(); + return $dateRange->id; + } + return $result['id_date_range']; + } +} + + diff --git a/classes/Db.php b/classes/Db.php new file mode 100644 index 000000000..a924f24e1 --- /dev/null +++ b/classes/Db.php @@ -0,0 +1,328 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (file_exists(dirname(__FILE__).'/../config/settings.inc.php')) + include_once(dirname(__FILE__).'/../config/settings.inc.php'); +//include_once(dirname(__FILE__).'/../classes/MySQL.php'); + +abstract class DbCore +{ + /** @var string Server (eg. localhost) */ + protected $_server; + + /** @var string Database user (eg. root) */ + protected $_user; + + /** @var string Database password (eg. can be empty !) */ + protected $_password; + + /** @var string Database type (MySQL, PgSQL) */ + protected $_type; + + /** @var string Database name */ + protected $_database; + + /** @var mixed Ressource link */ + protected $_link; + + /** @var mixed SQL cached result */ + protected $_result; + + /** @var mixed ? */ + protected static $_db; + + /** @var mixed Object instance for singleton */ + protected static $_instance = array(); + + protected static $_servers = array( + array('server' => _DB_SERVER_, 'user' => _DB_USER_, 'password' => _DB_PASSWD_, 'database' => _DB_NAME_), /* MySQL Master server */ + /* Add here your slave(s) server(s)*/ + /*array('server' => '192.168.0.15', 'user' => 'rep', 'password' => '123456', 'database' => 'rep'), + array('server' => '192.168.0.3', 'user' => 'myuser', 'password' => 'mypassword', 'database' => 'mydatabase'), + */ + ); + + protected $_lastQuery; + protected $_lastCached; + + protected static $_idServer; + + /** + * Get Db object instance (Singleton) + * + * @param boolean $master Decides wether the connection to be returned by the master server or the slave server + * @return object Db instance + */ + public static function getInstance($master = 1) + { + if ($master OR ($nServers = sizeof(self::$_servers)) == 1) + $idServer = 0; + else + $idServer = ($nServers > 2 AND ($id = ++self::$_idServer % (int)$nServers) !== 0) ? $id : 1; + + if(!isset(self::$_instance[$idServer])) + self::$_instance[(int)($idServer)] = new MySQL(self::$_servers[(int)($idServer)]['server'], self::$_servers[(int)($idServer)]['user'], self::$_servers[(int)($idServer)]['password'], self::$_servers[(int)($idServer)]['database']); + + return self::$_instance[(int)($idServer)]; + } + + public function getRessource() { return $this->_link;} + + public function __destruct() + { + $this->disconnect(); + } + + /** + * Build a Db object + */ + public function __construct($server, $user, $password, $database) + { + $this->_server = $server; + $this->_user = $user; + $this->_password = $password; + $this->_type = _DB_TYPE_; + $this->_database = $database; + + $this->connect(); + } + + /** + * Filter SQL query within a blacklist + * + * @param string $table Table where insert/update data + * @param string $values Data to insert/update + * @param string $type INSERT or UPDATE + * @param string $where WHERE clause, only for UPDATE (optional) + * @param string $limit LIMIT clause (optional) + * @return mixed|boolean SQL query result + */ + public function autoExecute($table, $values, $type, $where = false, $limit = false, $use_cache = 1) + { + if (!sizeof($values)) + return true; + + if (strtoupper($type) == 'INSERT') + { + $query = 'INSERT INTO `'.$table.'` ('; + foreach ($values AS $key => $value) + $query .= '`'.$key.'`,'; + $query = rtrim($query, ',').') VALUES ('; + foreach ($values AS $key => $value) + $query .= '\''.$value.'\','; + $query = rtrim($query, ',').')'; + if ($limit) + $query .= ' LIMIT '.(int)($limit); + return $this->q($query, $use_cache); + } + elseif (strtoupper($type) == 'UPDATE') + { + $query = 'UPDATE `'.$table.'` SET '; + foreach ($values AS $key => $value) + $query .= '`'.$key.'` = \''.$value.'\','; + $query = rtrim($query, ','); + if ($where) + $query .= ' WHERE '.$where; + if ($limit) + $query .= ' LIMIT '.(int)($limit); + return $this->q($query, $use_cache); + } + + return false; + } + + + /** + * Filter SQL query within a blacklist + * + * @param string $table Table where insert/update data + * @param string $values Data to insert/update + * @param string $type INSERT or UPDATE + * @param string $where WHERE clause, only for UPDATE (optional) + * @param string $limit LIMIT clause (optional) + * @return mixed|boolean SQL query result + */ + public function autoExecuteWithNullValues($table, $values, $type, $where = false, $limit = false) + { + if (!sizeof($values)) + return true; + + if (strtoupper($type) == 'INSERT') + { + $query = 'INSERT INTO `'.$table.'` ('; + foreach ($values AS $key => $value) + $query .= '`'.$key.'`,'; + $query = rtrim($query, ',').') VALUES ('; + foreach ($values AS $key => $value) + $query .= (($value === '' OR $value === NULL) ? 'NULL' : '\''.$value.'\'').','; + $query = rtrim($query, ',').')'; + if ($limit) + $query .= ' LIMIT '.(int)($limit); + return $this->q($query); + } + elseif (strtoupper($type) == 'UPDATE') + { + $query = 'UPDATE `'.$table.'` SET '; + foreach ($values AS $key => $value) + $query .= '`'.$key.'` = '.(($value === '' OR $value === NULL) ? 'NULL' : '\''.$value.'\'').','; + $query = rtrim($query, ','); + if ($where) + $query .= ' WHERE '.$where; + if ($limit) + $query .= ' LIMIT '.(int)($limit); + return $this->q($query); + } + + return false; + } + + /********************************************************* + * ABSTRACT METHODS + *********************************************************/ + + /** + * Open a connection + */ + abstract public function connect(); + + /** + * Get the ID generated from the previous INSERT operation + */ + abstract public function Insert_ID(); + + /** + * Get number of affected rows in previous databse operation + */ + abstract public function Affected_Rows(); + + /** + * Gets the number of rows in a result + */ + abstract public function NumRows(); + + /** + * Delete + */ + abstract public function delete ($table, $where = false, $limit = false, $use_cache = 1); + /** + * Fetches a row from a result set + */ + abstract public function Execute ($query, $use_cache = 1); + + /** + * Fetches an array containing all of the rows from a result set + */ + abstract public function ExecuteS($query, $array = true, $use_cache = 1); + + /* + * Get next row for a query which doesn't return an array + */ + abstract public function nextRow($result = false); + + /** + * Alias of Db::getInstance()->ExecuteS + * + * @acces string query The query to execute + * @return array Array of line returned by MySQL + */ + static public function s($query, $use_cache = 1) + { + return Db::getInstance()->ExecuteS($query, true, $use_cache); + } + + static public function ps($query, $use_cache = 1) + { + $ret = Db::s($query, $use_cache); + p($ret); + return $ret; + } + + static public function ds($query, $use_cache = 1) + { + Db::s($query, $use_cache); + die(); + } + + /** + * getRow return an associative array containing the first row of the query + * This function automatically add "limit 1" to the query + * + * @param mixed $query the select query (without "LIMIT 1") + * @param int $use_cache find it in cache first + * @return array associative array of (field=>value) + */ + abstract public function getRow($query, $use_cache = 1); + + /** + * getValue return the first item of a select query. + * + * @param mixed $query + * @param int $use_cache + * @return void + */ + abstract public function getValue($query, $use_cache = 1); + + /** + * Returns the text of the error message from previous database operation + */ + abstract public function getMsgError(); +} + +/** + * Sanitize data which will be injected into SQL query + * + * @param string $string SQL data which will be injected into SQL query + * @param boolean $htmlOK Does data contain HTML code ? (optional) + * @return string Sanitized data + */ +function pSQL($string, $htmlOK = false) +{ + if (_PS_MAGIC_QUOTES_GPC_) + $string = stripslashes($string); + if (!is_numeric($string)) + { + $link = Db::getInstance()->getRessource(); + $string = _PS_MYSQL_REAL_ESCAPE_STRING_ ? mysql_real_escape_string($string, $link) : addslashes($string); + if (!$htmlOK) + $string = strip_tags(nl2br2($string)); + } + + return $string; +} + +/** + * Convert \n and \r\n and \r to
+ * + * @param string $string String to transform + * @return string New string + */ +function nl2br2($string) +{ + return str_replace(array("\r\n", "\r", "\n"), '
', $string); +} + + diff --git a/classes/Delivery.php b/classes/Delivery.php new file mode 100644 index 000000000..7292d4424 --- /dev/null +++ b/classes/Delivery.php @@ -0,0 +1,77 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class DeliveryCore extends ObjectModel +{ + /** @var integer */ + public $id_delivery; + + /** @var integer */ + public $id_carrier; + + /** @var integer */ + public $id_range_price; + + /** @var integer */ + public $id_range_weight; + + /** @var integer */ + public $id_zone; + + /** @var float */ + public $price; + + protected $fieldsRequired = array ('id_carrier', 'id_range_price', 'id_range_weight', 'id_zone', 'price'); + protected $fieldsValidate = array ('id_carrier' => 'isUnsignedId', 'id_range_price' => 'isUnsignedId', + 'id_range_weight' => 'isUnsignedId', 'id_zone' => 'isUnsignedId', 'price' => 'isPrice'); + + protected $table = 'delivery'; + protected $identifier = 'id_delivery'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_carrier' => array('xlink_resource' => 'carriers'), + 'id_range_price' => array('xlink_resource' => 'priceranges'), + 'id_range_weight' => array('xlink_resource' => 'weightranges'), + 'id_zone' => array('xlink_resource' => 'zones'), + ) + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['id_range_price'] = (int)($this->id_range_price); + $fields['id_range_weight'] = (int)($this->id_range_weight); + $fields['id_zone'] = (int)($this->id_zone); + $fields['price'] = (float)($this->price); + + return $fields; + } +} + diff --git a/classes/Discount.php b/classes/Discount.php new file mode 100644 index 000000000..0c4848664 --- /dev/null +++ b/classes/Discount.php @@ -0,0 +1,502 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class DiscountCore extends ObjectModel +{ + public $id; + + /** @var integer Customer id only if discount is reserved */ + public $id_customer; + + /** @var integer Group id only if discount is reserved */ + public $id_group; + + /** @var integer Currency ID only if the discount type is 2 */ + public $id_currency; + + /** @var integer Discount type ID */ + public $id_discount_type; + + /** @var string Name (the one which must be entered) */ + public $name; + + /** @var string A short description for the discount */ + public $description; + + /** @var string Value in percent as well as in euros */ + public $value; + + /** @var integer Totale quantity available */ + public $quantity; + + /** @var integer User quantity available */ + public $quantity_per_user; + + /** @var boolean Indicate if discount is cumulable with others */ + public $cumulable; + + /** @var integer Indicate if discount is cumulable with already bargained products */ + public $cumulable_reduction; + + /** @var integer Date from wich discount become active */ + public $date_from; + + /** @var integer Date from wich discount is no more active */ + public $date_to; + + /** @var integer Minimum cart total amount required to use the discount */ + public $minimal; + + /** @var integer display the discount in the summary */ + public $cart_display; + + public $behavior_not_exhausted; + + /** @var boolean Status */ + public $active = true; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $fieldsRequired = array('id_discount_type', 'name', 'value', 'quantity', 'quantity_per_user', 'date_from', 'date_to'); + protected $fieldsSize = array('name' => '32', 'date_from' => '32', 'date_to' => '32'); + protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_group' => 'isUnsignedId', 'id_discount_type' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', + 'name' => 'isDiscountName', 'value' => 'isPrice', 'quantity' => 'isUnsignedInt', 'quantity_per_user' => 'isUnsignedInt', + 'cumulable' => 'isBool', 'cumulable_reduction' => 'isBool', 'date_from' => 'isDate', + 'date_to' => 'isDate', 'minimal' => 'isFloat', 'active' => 'isBool'); + protected $fieldsRequiredLang = array('description'); + protected $fieldsSizeLang = array('description' => 128); + protected $fieldsValidateLang = array('description' => 'isVoucherDescription'); + + protected $table = 'discount'; + protected $identifier = 'id_discount'; + + + protected $webserviceParameters = array( + 'fields' => array( + 'id_discount_type' => array('sqlId' => 'id_discount_type', 'xlink_resource' => 'discount_types'), + 'id_customer' => array('sqlId' => 'id_customer', 'xlink_resource' => 'customers'), + 'id_group' => array('sqlId' => 'id_group', 'xlink_resource' => 'groups'), + 'id_currency' => array('sqlId' => 'id_currency', 'xlink_resource' => 'currencies'), + 'name' => array('sqlId' => 'name'), + 'value' => array('sqlId' => 'value'), + 'quantity' => array('sqlId' => 'quantity'), + 'quantity_per_user' => array('sqlId' => 'quantity_per_user'), + 'cumulable' => array('sqlId' => 'cumulable'), + 'cumulable_reduction' => array('sqlId' => 'cumulable_reduction'), + 'behavior_not_exhausted' => array('sqlId' => 'behavior_not_exhausted'), + 'date_from' => array('sqlId' => 'date_from'), + 'date_to' => array('sqlId' => 'date_to'), + 'minimal' => array('sqlId' => 'minimal'), + 'active' => array('sqlId' => 'active'), + 'cart_display' => array('sqlId' => 'cart_display'), + 'date_add' => array('sqlId' => 'date_add'), + 'date_upd' => array('sqlId' => 'date_upd') + ) + ); + + + + public function getFields() + { + parent::validateFields(); + + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_group'] = (int)($this->id_group); + $fields['id_currency'] = (int)($this->id_currency); + $fields['id_discount_type'] = (int)($this->id_discount_type); + $fields['name'] = pSQL($this->name); + $fields['value'] = (float)($this->value); + $fields['quantity'] = (int)($this->quantity); + $fields['quantity_per_user'] = (int)($this->quantity_per_user); + $fields['cumulable'] = (int)($this->cumulable); + $fields['cumulable_reduction'] = (int)($this->cumulable_reduction); + $fields['date_from'] = pSQL($this->date_from); + $fields['date_to'] = pSQL($this->date_to); + $fields['minimal'] = (float)($this->minimal); + $fields['behavior_not_exhausted'] = (int)$this->behavior_not_exhausted; + $fields['active'] = (int)($this->active); + $fields['cart_display'] = (int)($this->cart_display); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function add($autodate = true, $nullValues = false, $categories = null) + { + $ret = NULL; + if (parent::add($autodate, $nullValues)) + $ret = true; + + $this->updateCategories($categories); + return $ret; + } + + /* Categories initialization is different between add() and update() because the addition will set all categories if none are selected (compatibility with old modules) and update won't update categories if none are selected */ + public function update($autodate = true, $nullValues = false, $categories = false) + { + $ret = NULL; + if (parent::update($autodate, $nullValues)) + $ret = true; + + $this->updateCategories($categories); + return $ret; + } + + public function delete() + { + if (!parent::delete()) + return false; + return (Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'cart_discount WHERE id_discount = '.(int)($this->id)) + AND Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'discount_category WHERE id_discount = '.(int)($this->id))); + } + + public function getTranslationsFieldsChild() + { + if (!parent::validateFieldsLang()) + return false; + return parent::getTranslationsFields(array('description')); + } + + /** + * Return discount types list + * + * @return array Discount types + */ + static public function getDiscountTypes($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'discount_type dt + LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)($id_lang).')'); + } + + /** + * Get discount ID from name + * + * @param string $discountName Discount name + * @return integer Discount ID + */ + public static function getIdByName($discountName) + { + if (!Validate::isDiscountName($discountName)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_discount` + FROM `'._DB_PREFIX_.'discount` + WHERE `name` = \''.pSQL($discountName).'\''); + return isset($result['id_discount']) ? $result['id_discount'] : false; + } + + /** + * Return customer discounts + * + * @param integer $id_lang Language ID + * @param boolean $id_customer Customer ID + * @return array Discounts + */ + static public function getCustomerDiscounts($id_lang, $id_customer, $active = false, $includeGenericOnes = true, $stock = false) + { + global $cart; + + $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT d.*, dtl.`name` AS `type`, dl.`description` + FROM `'._DB_PREFIX_.'discount` d + LEFT JOIN `'._DB_PREFIX_.'discount_lang` dl ON (d.`id_discount` = dl.`id_discount` AND dl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'discount_type` dt ON dt.`id_discount_type` = d.`id_discount_type` + LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)($id_lang).') + WHERE (`id_customer` = '.(int)($id_customer).' + OR `id_group` IN (SELECT `id_group` FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($id_customer).')'. + ($includeGenericOnes ? ' OR (`id_customer` = 0 AND `id_group` = 0)' : '').') + '.($active ? ' AND d.`active` = 1' : '').' + '.($stock ? ' AND d.`quantity` != 0' : '')); + + foreach ($res as &$discount) + if ($discount['quantity_per_user']) + { + $quantity_used = Order::getDiscountsCustomer((int)($id_customer), (int)($discount['id_discount'])); + if (isset($cart) AND isset($cart->id)) + $quantity_used += $cart->getDiscountsCustomer((int)($discount['id_discount'])); + $discount['quantity_for_user'] = $discount['quantity_per_user'] - $quantity_used; + } + else + $discount['quantity_for_user'] = 0; + return $res; + } + + public function usedByCustomer($id_customer) + { + return Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'order_discount` od + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (od.`id_order` = o.`id_order`) + WHERE od.`id_discount` = '.(int)($this->id).' + AND o.`id_customer` = '.(int)($id_customer) + ); + } + + /** + * Return discount value + * + * @param integer $nb_discounts Number of discount currently in cart + * @param boolean $order_total_products Total cart products amount + * @return mixed Return a float value or '!' if reduction is 'Shipping free' + */ + public function getValue($nb_discounts = 0, $order_total_products = 0, $shipping_fees = 0, $idCart = false, $useTax = true) + { + $totalAmount = 0; + + $cart = new Cart((int)($idCart)); + if (!Validate::isLoadedObject($cart)) + return 0; + + if ((!$this->cumulable AND (int)($nb_discounts) > 1) OR !$this->active OR (!$this->quantity AND !$cart->OrderExists())) + return 0; + + if ($this->usedByCustomer((int)($cart->id_customer)) >= $this->quantity_per_user AND !$cart->OrderExists()) + return 0; + + $date_start = strtotime($this->date_from); + $date_end = strtotime($this->date_to); + if ((time() < $date_start OR time() > $date_end) AND !$cart->OrderExists()) return 0; + + $products = $cart->getProducts(); + $categories = Discount::getCategories((int)($this->id)); + $in_category = false; + + foreach ($products AS $product) + if (count($categories) AND Product::idIsOnCategoryId($product['id_product'], $categories)) + $totalAmount += $useTax ? $product['total_wt'] : $product['total']; + + $totalAmount += (float)($shipping_fees); + if ($this->minimal > 0 AND $totalAmount < $this->minimal) + return 0; + + switch ($this->id_discount_type) + { + /* Relative value (% of the order total) */ + case 1: + $amount = 0; + $percentage = $this->value / 100; + foreach ($products AS $product) + if (Product::idIsOnCategoryId($product['id_product'], $categories)) + if ((!$this->cumulable_reduction AND !$product['reduction_applies'] AND !$product['on_sale']) OR $this->cumulable_reduction) + $amount += ($useTax ? $product['total_wt'] : $product['total']) * $percentage; + return $amount; + + /* Absolute value */ + case 2: + // An "absolute" voucher is available in one currency only + $currency = ((int)$cart->id_currency ? Currency::getCurrencyInstance($cart->id_currency) : Currency::getCurrent()); + if ($this->id_currency != $currency->id) + return 0; + + $taxDiscount = Cart::getTaxesAverageUsed((int)($cart->id)); + if (!$useTax AND isset($taxDiscount) AND $taxDiscount != 1) + $this->value = abs($this->value / (1 + $taxDiscount * 0.01)); + + // Main return + $value = 0; + foreach ($products AS $product) + if (Product::idIsOnCategoryId($product['id_product'], $categories)) + $value = $this->value; + // Return 0 if there are no applicable categories + return $value; + + /* Free shipping (does not return a value but a special code) */ + case 3: + return '!'; + } + return 0; + } + + /** + * @param int $id_category_product + * @param int $id_category_discount + * @return bool + * @deprecated + */ + static public function isParentCategoryProductDiscount($id_category_product, $id_category_discount) + { + Tools::displayAsDeprecated(); + $category = new Category((int)($id_category_product)); + $parentCategories = $category->getParentsCategories(); + foreach($parentCategories AS $parentCategory) + if($id_category_discount == $parentCategory['id_category']) + return true; + return false; + } + + static public function getCategories($id_discount) + { + return Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'discount_category` + WHERE `id_discount` = '.(int)($id_discount)); + } + + public function updateCategories($categories) + { + /* false value will avoid category update and null value will force all category to be selected */ + if ($categories === false) + return ; + if ($categories === null) + { + // Compatibility for modules which create discount without setting categories (ex. fidelity, sponsorship) + $result = Db::getInstance()->ExecuteS('SELECT id_category FROM '._DB_PREFIX_.'category'); + $categories = array(); + foreach ($result as $row) + $categories[] = $row['id_category']; + } + elseif (!is_array($categories) OR !sizeof($categories)) + return false; + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_category` WHERE `id_discount`='.(int)($this->id)); + foreach($categories AS $category) + { + Db::getInstance()->Execute(' + SELECT `id_discount` + FROM `'._DB_PREFIX_.'discount_category` + WHERE `id_discount`='.(int)($this->id).' AND `id_category`='.(int)($category)); + if (Db::getInstance()->NumRows() == 0) + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'discount_category` (`id_discount`, `id_category`) VALUES('.(int)($this->id).','.(int)($category).')'); + } + } + + static public function discountExists($discountName, $id_discount = 0) + { + return Db::getInstance()->getRow('SELECT `id_discount` FROM '._DB_PREFIX_.'discount WHERE `name` LIKE \''.pSQL($discountName).'\' AND `id_discount` != '.(int)($id_discount)); + } + + static public function createOrderDiscount($order, $productList, $qtyList, $name, $shipping_cost = false, $id_category = 0, $subcategory = 0) + { + $languages = Language::getLanguages($order); + $products = $order->getProducts(false, $productList, $qtyList); + + // Totals are stored in the order currency (or at least should be) + $total = $order->getTotalProductsWithTaxes($products); + $discounts = $order->getDiscounts(true); + $total_tmp = $total; + foreach ($discounts as $discount) + { + if ($discount['id_discount_type'] == 1) + $total -= $total_tmp * ($discount['value'] / 100); + elseif ($discount['id_discount_type'] == 2) + $total -= ($discount['value'] * ($total_tmp / $order->total_products_wt)); + } + if ($shipping_cost) + $total += $order->total_shipping; + + // create discount + $voucher = new Discount(); + $voucher->id_discount_type = 2; + foreach ($languages as $language) + $voucher->description[$language['id_lang']] = strval($name).(int)($order->id); + $voucher->value = (float)($total); + $voucher->name = 'V0C'.(int)($order->id_customer).'O'.(int)($order->id); + $voucher->id_customer = (int)($order->id_customer); + $voucher->id_currency = (int)($order->id_currency); + $voucher->quantity = 1; + $voucher->quantity_per_user = 1; + $voucher->cumulable = 1; + $voucher->cumulable_reduction = 1; + $voucher->minimal = (float)($voucher->value); + $voucher->active = 1; + $voucher->cart_display = 1; + $now = time(); + $voucher->date_from = date('Y-m-d H:i:s', $now); + $voucher->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */ + if (!$voucher->validateFieldsLang(false) OR !$voucher->add()) + return false; + // set correct name + $voucher->name = 'V'.(int)($voucher->id).'C'.(int)($order->id_customer).'O'.$order->id; + if (!$voucher->update()) + return false; + + return $voucher; + } + + static public function display($discountValue, $discountType, $currency = false) + { + if ((float)($discountValue) AND (int)($discountType)) + { + if ($discountType == 1) + return $discountValue.chr(37); // ASCII #37 --> % (percent) + elseif ($discountType == 2) + return Tools::displayPrice($discountValue, $currency); + } + return ''; // return a string because it's a display method + } + + static public function getVouchersToCartDisplay($id_lang, $id_customer) + { + return Db::getInstance()->ExecuteS(' + SELECT d.`name`, dl.`description`, d.`id_discount` + FROM `'._DB_PREFIX_.'discount` d + LEFT JOIN `'._DB_PREFIX_.'discount_lang` dl ON (d.`id_discount` = dl.`id_discount`) + WHERE d.`active` = 1 + AND d.`date_from` <= \''.pSQL(date('Y-m-d H:i:s')).'\' AND d.`date_to` >= \''.pSQL(date('Y-m-d H:i:s')).'\' + AND dl.`id_lang` = '.(int)($id_lang).' + AND d.`cart_display` = 1 AND d.`quantity` > 0 + AND ((d.`id_customer` = 0 AND d.`id_group` = 0) '.($id_customer ? 'OR (d.`id_customer` = '.$id_customer.' + OR d.`id_group` IN (SELECT `id_group` FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($id_customer).')))' : 'OR d.`id_group` = 1)')); + } + + static public function deleteByIdCustomer($id_customer) + { + $discounts = Db::getInstance()->ExecuteS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount` WHERE `id_customer` = '.(int)($id_customer)); + foreach ($discounts as $discount) + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount` WHERE `id_discount` = '.(int)($discount['id_discount'])); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_category` WHERE `id_discount` = '.(int)($discount['id_discount'])); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_lang` WHERE `id_discount` = '.(int)($discount['id_discount'])); + } + return true; + } + + static public function deleteByIdGroup($id_group) + { + $discounts = Db::getInstance()->ExecuteS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount` WHERE `id_group` = '.(int)($id_group)); + foreach ($discounts as $discount) + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount` WHERE `id_discount` = '.(int)($discount['id_discount'])); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_category` WHERE `id_discount` = '.(int)($discount['id_discount'])); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_lang` WHERE `id_discount` = '.(int)($discount['id_discount'])); + } + return true; + } + + static public function getDiscount($id_discount) + { + return Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'discount` WHERE `id_discount` = '.(int)$id_discount); + } +} + + diff --git a/classes/Employee.php b/classes/Employee.php new file mode 100644 index 000000000..c7596e7a5 --- /dev/null +++ b/classes/Employee.php @@ -0,0 +1,212 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class EmployeeCore extends ObjectModel +{ + public $id; + + /** @var string Determine employee profile */ + public $id_profile; + + /** @var string employee language */ + public $id_lang; + + /** @var string Lastname */ + public $lastname; + + /** @var string Firstname */ + public $firstname; + + /** @var string e-mail */ + public $email; + + /** @var string Password */ + public $passwd; + + /** @var datetime Password */ + public $last_passwd_gen; + + public $stats_date_from; + public $stats_date_to; + + /** @var string Display back office background in the specified color */ + public $bo_color; + + /** @var string employee's chosen theme */ + public $bo_theme; + + /** @var string / enum hover or click mode */ + public $bo_uimode; + + /** @var boolean Status */ + public $active = 1; + + protected $fieldsRequired = array('lastname', 'firstname', 'email', 'passwd', 'id_profile', 'id_lang'); + protected $fieldsSize = array('lastname' => 32, 'firstname' => 32, 'email' => 128, 'passwd' => 32, 'bo_color' => 32, 'bo_theme' => 32); + protected $fieldsValidate = array('lastname' => 'isName', 'firstname' => 'isName', 'email' => 'isEmail', 'id_lang' => 'isUnsignedInt', + 'passwd' => 'isPasswdAdmin', 'active' => 'isBool', 'id_profile' => 'isInt', 'bo_color' => 'isColor', 'bo_theme' => 'isGenericName', 'bo_uimode' => 'isGenericName'); + + protected $table = 'employee'; + protected $identifier = 'id_employee'; + + protected $webserviceParameters = array( + 'objectMethods' => array('add' => 'addWs'), + 'fields' => array( + 'id_lang' => array('xlink_resource' => 'languages'), + 'last_passwd_gen' => array('setter' => null), + 'stats_date_from' => array('setter' => null), + 'stats_date_to' => array('setter' => null), + ), + ); + + + public function getFields() + { + parent::validateFields(); + + $fields['id_profile'] = (int)$this->id_profile; + $fields['id_lang'] = (int)$this->id_lang; + $fields['lastname'] = pSQL($this->lastname); + $fields['firstname'] = pSQL(Tools::ucfirst($this->firstname)); + $fields['email'] = pSQL($this->email); + $fields['passwd'] = pSQL($this->passwd); + $fields['last_passwd_gen'] = pSQL($this->last_passwd_gen); + $fields['stats_date_from'] = pSQL($this->stats_date_from); + $fields['stats_date_to'] = pSQL($this->stats_date_to); + $fields['bo_color'] = pSQL($this->bo_color); + $fields['bo_theme'] = pSQL($this->bo_theme); + $fields['bo_uimode'] = pSQL($this->bo_uimode); + $fields['active'] = (int)$this->active; + + return $fields; + } + + /** + * Return all employee id and email + * + * @return array Employees + * @deprecated + */ + static public function getEmployees() + { + Tools::displayAsDeprecated(); + return Db::getInstance()->ExecuteS(' + SELECT `id_employee`, CONCAT(`firstname`, \' \', `lastname`) AS "name" + FROM `'._DB_PREFIX_.'employee` + WHERE `active` = 1 + ORDER BY `email`'); + } + + public function add($autodate = true, $nullValues = true) + { + $this->last_passwd_gen = date('Y-m-d H:i:s', strtotime('-'.Configuration::get('PS_PASSWD_TIME_BACK').'minutes')); + return parent::add($autodate, $nullValues); + } + + /** + * Return employee instance from its e-mail (optionnaly check password) + * + * @param string $email e-mail + * @param string $passwd Password is also checked if specified + * @return Employee instance + */ + public function getByEmail($email, $passwd = NULL) + { + if (!Validate::isEmail($email) OR ($passwd != NULL AND !Validate::isPasswd($passwd))) + die(Tools::displayError()); + + $result = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'employee` + WHERE `active` = 1 + AND `email` = \''.pSQL($email).'\' + '.($passwd ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '')); + if (!$result) + return false; + $this->id = $result['id_employee']; + $this->id_profile = $result['id_profile']; + foreach ($result AS $key => $value) + if (key_exists($key, $this)) + $this->{$key} = $value; + return $this; + } + + static public function employeeExists($email) + { + if (!Validate::isEmail($email)) + die (Tools::displayError()); + + return (bool)Db::getInstance()->getValue(' + SELECT `id_employee` + FROM `'._DB_PREFIX_.'employee` + WHERE `email` = \''.pSQL($email).'\''); + } + + /** + * Check if employee password is the right one + * + * @param string $passwd Password + * @return boolean result + */ + static public function checkPassword($id_employee, $passwd) + { + if (!Validate::isUnsignedId($id_employee) OR !Validate::isPasswd($passwd, 8)) + die (Tools::displayError()); + + return Db::getInstance()->getValue(' + SELECT `id_employee` + FROM `'._DB_PREFIX_.'employee` + WHERE `id_employee` = '.(int)$id_employee.' + AND `passwd` = \''.pSQL($passwd).'\' + AND active = 1'); + } + + static public function countProfile($id_profile, $activeOnly = false) + { + return Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'employee` + WHERE `id_profile` = '.(int)$id_profile.' + '.($activeOnly ? ' AND `active` = 1' : '')); + } + + public function isLastAdmin() + { + return ($this->id_profile == _PS_ADMIN_PROFILE_ + AND Employee::countProfile($this->id_profile, true) == 1 + AND $this->active + ); + } + + + public function addWs($autodate = true, $nullValues = false) + { + $this->passwd = Tools::encrypt($this->passwd); + return $this->add($autodate, $nullValues); + } + +} \ No newline at end of file diff --git a/classes/Feature.php b/classes/Feature.php new file mode 100644 index 000000000..526a7261f --- /dev/null +++ b/classes/Feature.php @@ -0,0 +1,207 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class FeatureCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 128); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'feature'; + protected $identifier = 'id_feature'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'product_features', + 'objectNodeName' => 'product_feature', + 'fields' => array(), + ); + + public function getFields() + { + return array('id_feature' => NULL); + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + /** + * Get a feature data for a given id_feature and id_lang + * + * @param integer $id_lang Language id + * @param integer $id_feature Feature id + * @return array Array with feature's data + * @static + */ + static public function getFeature($id_lang, $id_feature) + { + return Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'feature` f + LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON ( f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)($id_lang).') + WHERE f.`id_feature` = '.(int)($id_feature)); + } + + /** + * Get all features for a given language + * + * @param integer $id_lang Language id + * @return array Multiple arrays with feature's data + * @static + */ + static public function getFeatures($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'feature` f + LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON (f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)($id_lang).') + ORDER BY fl.`name` ASC'); + } + + /** + * Delete several objects from database + * + * @param array $selection Array with items to delete + * @return boolean Deletion result + */ + public function deleteSelection($selection) + { + /* Also delete Attributes */ + foreach ($selection AS $value) { + $obj = new Feature($value); + if (!$obj->delete()) + return false; + } + return true; + } + + public function add($autodate = true, $nullValues = false) + { + return parent::add($autodate, true); + } + + public function delete() + { + /* Also delete related attributes */ + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'feature_value_lang` WHERE `id_feature_value` IN (SELECT id_feature_value FROM `'._DB_PREFIX_.'feature_value` WHERE `id_feature` = '.(int)($this->id).')'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'feature_value` WHERE `id_feature` = '.(int)($this->id)); + /* Also delete related products */ + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'feature_product` WHERE `id_feature` = '.(int)($this->id)); + return parent::delete(); + } + + public function update($nullValues = false) + { + $this->clearCache(); + + $result = 1; + $fields = $this->getTranslationsFieldsChild(); + foreach ($fields as $field) + { + foreach ($field as $key => $value) + if (!Validate::isTableOrIdentifier($key)) + die(Tools::displayError()); + $mode = Db::getInstance()->getRow('SELECT `id_lang` FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier). + '` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang'])); + $result *= (!Db::getInstance()->NumRows()) ? Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') : + Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'. + pSQL($this->identifier).'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang'])); + } + return $result; + } + + /** + * Count number of features for a given language + * + * @param integer $id_lang Language id + * @return int Number of feature + * @static + */ + static public function nbFeatures($id_lang) + { + $result = Db::getInstance()->getRow(' + SELECT COUNT(ag.`id_feature`) as nb + FROM `'._DB_PREFIX_.'feature` ag + LEFT JOIN `'._DB_PREFIX_.'feature_lang` agl ON (ag.`id_feature` = agl.`id_feature` AND `id_lang` = '.(int)($id_lang).') + ORDER BY `name` ASC'); + return ($result['nb']); + } + + /** + * Create a feature from import + * + * @param integer $id_feature Feature id + * @param integer $id_product Product id + * @param array $value Feature Value + */ + static public function addFeatureImport($name) + { + $rq = Db::getInstance()->getRow('SELECT `id_feature` FROM '._DB_PREFIX_.'feature_lang WHERE `name` = \''.pSQL($name).'\' GROUP BY `id_feature`'); + if (!empty($rq)) + return (int)($rq['id_feature']); + // Feature doesn't exist, create it + $feature = new Feature(); + $languages = Language::getLanguages(); + foreach ($languages as $language) + $feature->name[$language['id_lang']] = strval($name); + $feature->add(); + return $feature->id; + } + + public static function getFeaturesForComparison($list_ids_product, $id_lang) + { + $ids = ''; + foreach($list_ids_product as $id) + $ids .= (int)($id).','; + + $ids = rtrim($ids, ','); + + if (empty($ids)) + return false; + + return Db::getInstance()->ExecuteS(' + SELECT * , COUNT(*) as nb + FROM `'._DB_PREFIX_.'feature` f + LEFT JOIN `'._DB_PREFIX_.'feature_product` fp ON f.`id_feature` = fp.`id_feature` + LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON f.`id_feature` = fl.`id_feature` + WHERE fp.`id_product` IN ('.$ids.') + AND `id_lang` = '.(int)($id_lang).' + GROUP BY f.`id_feature` + ORDER BY nb DESC'); + } +} + diff --git a/classes/FeatureValue.php b/classes/FeatureValue.php new file mode 100644 index 000000000..8ecc1e7c7 --- /dev/null +++ b/classes/FeatureValue.php @@ -0,0 +1,175 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class FeatureValueCore extends ObjectModel +{ + /** @var integer Group id which attribute belongs */ + public $id_feature; + + /** @var string Name */ + public $value; + + /** @var boolean Custom */ + public $custom = 0; + + protected $fieldsRequired = array('id_feature'); + protected $fieldsValidate = array('id_feature' => 'isUnsignedId', 'custom' => 'isBool'); + protected $fieldsRequiredLang = array('value'); + protected $fieldsSizeLang = array('value' => 255); + protected $fieldsValidateLang = array('value' => 'isGenericName'); + + protected $table = 'feature_value'; + protected $identifier = 'id_feature_value'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'product_feature_values', + 'objectNodeName' => 'product_feature_value', + 'fields' => array( + 'id_feature' => array('xlink_resource'=> 'product_features'), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_feature'] = (int)$this->id_feature; + $fields['custom'] = (int)$this->custom; + + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('value')); + } + + /** + * Get all values for a given feature + * + * @param boolean $id_feature Feature id + * @return array Array with feature's values + * @static + */ + static public function getFeatureValues($id_feature) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'feature_value` + WHERE `id_feature` = '.(int)$id_feature); + } + + /** + * Get all values for a given feature and language + * + * @param integer $id_lang Language id + * @param boolean $id_feature Feature id + * @return array Array with feature's values + * @static + */ + static public function getFeatureValuesWithLang($id_lang, $id_feature) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'feature_value` v + LEFT JOIN `'._DB_PREFIX_.'feature_value_lang` vl ON (v.`id_feature_value` = vl.`id_feature_value` AND vl.`id_lang` = '.(int)$id_lang.') + WHERE v.`id_feature` = '.(int)$id_feature.' AND (v.`custom` IS NULL OR v.`custom` = 0) + ORDER BY vl.`value` ASC'); + } + + /** + * Get all language for a given value + * + * @param boolean $id_feature_value Feature value id + * @return array Array with value's languages + * @static + */ + static public function getFeatureValueLang($id_feature_value) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'feature_value_lang` + WHERE `id_feature_value` = '.(int)$id_feature_value.' + ORDER BY `id_lang`'); + } + + /** + * Select the good lang in tab + * + * @param array $lang Array with all language + * @param integer $id_lang Language id + * @return string String value name selected + * @static + */ + static public function selectLang($lang, $id_lang) + { + foreach ($lang as $tab) + if ($tab['id_lang'] == $id_lang) + return $tab['value']; + } + + static public function addFeatureValueImport($id_feature, $name) + { + $rq = Db::getInstance()->ExecuteS(' + SELECT fv.`id_feature_value` + FROM '._DB_PREFIX_.'feature_value fv + LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.`id_feature_value` = fv.`id_feature_value`) + WHERE `value` = \''.pSQL($name).'\' + AND fv.`id_feature` = '.(int)$id_feature.' + GROUP BY fv.`id_feature_value` LIMIT 1'); + + if (!isset($rq[0]['id_feature_value']) OR !$id_feature_value = (int)$rq[0]['id_feature_value']) + { + // Feature doesn't exist, create it + $featureValue = new FeatureValue(); + + $languages = Language::getLanguages(); + foreach ($languages AS $language) + $featureValue->value[$language['id_lang']] = strval($name); + + $featureValue->id_feature = (int)$id_feature; + $featureValue->custom = 1; + $featureValue->add(); + + return (int)$featureValue->id; + } + return (int)$id_feature_value; + } + + public function delete() + { + /* Also delete related products */ + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'feature_product` WHERE `id_feature_value` = '.(int)$this->id); + return parent::delete(); + } +} \ No newline at end of file diff --git a/classes/FrontController.php b/classes/FrontController.php new file mode 100755 index 000000000..ebf321d0f --- /dev/null +++ b/classes/FrontController.php @@ -0,0 +1,573 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class FrontControllerCore +{ + public $errors = array(); + protected static $smarty; + protected static $cookie; + protected static $link; + protected static $cart; + public $iso; + + public $orderBy; + public $orderWay; + public $p; + public $n; + + public $auth = false; + public $guestAllowed = false; + public $authRedirection = false; + public $ssl = false; + + protected $restrictedCountry = false; + protected $maintenance = false; + + public static $initialized = false; + + protected static $currentCustomerGroups; + + public function __construct() + { + global $css_files, $js_files, $useSSL; + + $useSSL = $this->ssl; + } + + public function run() + { + $this->init(); + $this->preProcess(); + $this->displayHeader(); + $this->process(); + $this->displayContent(); + $this->displayFooter(); + } + + public function init() + { + global $cookie, $smarty, $cart, $iso, $defaultCountry, $protocol_link, $protocol_content, $link, $css_files, $js_files; + + $css_files = array(); + $js_files = array(); + + if (self::$initialized) + return; + self::$initialized = true; + + if ($this->ssl AND !(empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) != 'off') AND Configuration::get('PS_SSL_ENABLED')) + { + header('HTTP/1.1 301 Moved Permanently'); + header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); + exit(); + } + + ob_start(); + + $cookie = new Cookie('ps'); + $link = new Link(); + + if ($this->auth AND !$cookie->isLogged($this->guestAllowed)) + Tools::redirect('authentication.php'.($this->authRedirection ? '?back='.$this->authRedirection : '')); + + /* Theme is missing or maintenance */ + if (!is_dir(_PS_THEME_DIR_)) + die(Tools::displayError('Current theme unavailable. Please check your theme directory name and permissions.')); + elseif (basename($_SERVER['PHP_SELF']) != 'disabled.php' AND !(int)(Configuration::get('PS_SHOP_ENABLE'))) + $this->maintenance = true; + elseif (Configuration::get('PS_GEOLOCATION_ENABLED')) + $this->geolocationManagement(); + + // Switch language if needed and init cookie language + if ($iso = Tools::getValue('isolang') AND Validate::isLanguageIsoCode($iso) AND ($id_lang = (int)(Language::getIdByIso($iso)))) + $_GET['id_lang'] = $id_lang; + + Tools::switchLanguage(); + Tools::setCookieLanguage(); + + /* attribute id_lang is often needed, so we create a constant for performance reasons */ + if (!defined('_USER_ID_LANG_')) + define('_USER_ID_LANG_', (int)$cookie->id_lang); + + if (isset($_GET['logout']) OR ($cookie->logged AND Customer::isBanned((int)$cookie->id_customer))) + { + $cookie->logout(); + Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL); + } + elseif (isset($_GET['mylogout'])) + { + $cookie->mylogout(); + Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : NULL); + } + + global $currency; + $currency = Tools::setCurrency(); + + $_MODULES = array(); + + if ((int)$cookie->id_cart) + { + $cart = new Cart((int)$cookie->id_cart); + if ($cart->OrderExists()) + unset($cookie->id_cart, $cart); + /* Delete product of cart, if user can't make an order from his country */ + elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) AND !in_array(strtoupper($cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND $cart->nbProducts() AND intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1) + unset($cookie->id_cart, $cart); + elseif ($cookie->id_customer != $cart->id_customer OR $cookie->id_lang != $cart->id_lang OR $cookie->id_currency != $cart->id_currency) + { + if ($cookie->id_customer) + $cart->id_customer = (int)($cookie->id_customer); + $cart->id_lang = (int)($cookie->id_lang); + $cart->id_currency = (int)($cookie->id_currency); + $cart->update(); + } + + } + + if (!isset($cart) OR !$cart->id) + { + $cart = new Cart(); + $cart->id_lang = (int)($cookie->id_lang); + $cart->id_currency = (int)($cookie->id_currency); + $cart->id_guest = (int)($cookie->id_guest); + if ($cookie->id_customer) + { + $cart->id_customer = (int)($cookie->id_customer); + $cart->id_address_delivery = (int)(Address::getFirstCustomerAddressId($cart->id_customer)); + $cart->id_address_invoice = $cart->id_address_delivery; + } + else + { + $cart->id_address_delivery = 0; + $cart->id_address_invoice = 0; + } + } + if (!$cart->nbProducts()) + $cart->id_carrier = NULL; + + $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); + setlocale(LC_COLLATE, $locale); + setlocale(LC_CTYPE, $locale); + setlocale(LC_TIME, $locale); + setlocale(LC_NUMERIC, 'en_US.UTF-8'); + + if (Validate::isLoadedObject($currency)) + $smarty->ps_currency = $currency; + if (Validate::isLoadedObject($ps_language = new Language((int)$cookie->id_lang))) + $smarty->ps_language = $ps_language; + + /* get page name to display it in body id */ + $pathinfo = pathinfo(__FILE__); + $page_name = basename($_SERVER['PHP_SELF'], '.'.$pathinfo['extension']); + $page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name; + $smarty->assign(Tools::getMetaTags($cookie->id_lang, $page_name)); + $smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI']))); + + /* Breadcrumb */ + $navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>'); + $smarty->assign('navigationPipe', $navigationPipe); + + $protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://'; + $protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://'; + if (!defined('_PS_BASE_URL_')) + define('_PS_BASE_URL_', Tools::getShopDomain(true)); + if (!defined('_PS_BASE_URL_SSL_')) + define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); + + $link->preloadPageLinks(); + $this->canonicalRedirection(); + + Product::initPricesComputation(); + + $smarty->assign(array( + 'link' => $link, + 'cart' => $cart, + 'currency' => $currency, + 'cookie' => $cookie, + 'page_name' => $page_name, + 'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__, + 'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__, + 'content_dir' => $protocol_content.Tools::getShopDomain().__PS_BASE_URI__, + 'tpl_dir' => _PS_THEME_DIR_, + 'modules_dir' => _MODULE_DIR_, + 'mail_dir' => _MAIL_DIR_, + 'lang_iso' => $ps_language->iso_code, + 'come_from' => Tools::getHttpHost(true, true).Tools::htmlentitiesUTF8(str_replace('\'', '', urldecode($_SERVER['REQUEST_URI']))), + 'cart_qties' => (int)$cart->nbProducts(), + 'currencies' => Currency::getCurrencies(), + 'languages' => Language::getLanguages(), + 'priceDisplay' => Product::getTaxCalculationMethod(), + 'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + 'shop_name' => Configuration::get('PS_SHOP_NAME'), + 'roundMode' => (int)Configuration::get('PS_PRICE_ROUND_MODE'), + 'use_taxes' => (int)Configuration::get('PS_TAX'), + 'vat_management' => (int)Configuration::get('VATNUMBER_MANAGEMENT'), + 'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'), + 'PS_CATALOG_MODE' => (bool)Configuration::get('PS_CATALOG_MODE') + )); + + // Deprecated + $smarty->assign(array( + 'id_currency_cookie' => (int)$currency->id, + 'logged' => $cookie->isLogged(), + 'customerName' => ($cookie->logged ? $cookie->customer_firstname.' '.$cookie->customer_lastname : false) + )); + + // TODO for better performances (cache usage), remove these assign and use a smarty function to get the right media server in relation to the full ressource name + $assignArray = array( + 'img_ps_dir' => _PS_IMG_, + 'img_cat_dir' => _THEME_CAT_DIR_, + 'img_lang_dir' => _THEME_LANG_DIR_, + 'img_prod_dir' => _THEME_PROD_DIR_, + 'img_manu_dir' => _THEME_MANU_DIR_, + 'img_sup_dir' => _THEME_SUP_DIR_, + 'img_ship_dir' => _THEME_SHIP_DIR_, + 'img_store_dir' => _THEME_STORE_DIR_, + 'img_col_dir' => _THEME_COL_DIR_, + 'img_dir' => _THEME_IMG_DIR_, + 'css_dir' => _THEME_CSS_DIR_, + 'js_dir' => _THEME_JS_DIR_, + 'pic_dir' => _THEME_PROD_PIC_DIR_ + ); + + foreach ($assignArray as $assignKey => $assignValue) + if (substr($assignValue, 0, 1) == '/' OR $protocol_content == 'https://') + $smarty->assign($assignKey, $protocol_content.Tools::getMediaServer($assignValue).$assignValue); + else + $smarty->assign($assignKey, $assignValue); + + // setting properties from global var + self::$cookie = $cookie; + self::$cart = $cart; + self::$smarty = $smarty; + self::$link = $link; + + if ($this->maintenance) + $this->displayMaintenancePage(); + if ($this->restrictedCountry) + $this->displayRestrictedCountryPage(); + + //live edit + if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))) + if (!is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad)) + die(Tools::displayError()); + + + $this->iso = $iso; + $this->setMedia(); + } + + /* Display a maintenance page if shop is closed */ + protected function displayMaintenancePage() + { + + if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) + { + header('HTTP/1.1 503 temporarily overloaded'); + self::$smarty->display(_PS_THEME_DIR_.'maintenance.tpl'); + exit; + } + } + + /* Display a specific page if the user country is not allowed */ + protected function displayRestrictedCountryPage() + { + global $smarty; + + header('HTTP/1.1 503 temporarily overloaded'); + $smarty->display(_PS_THEME_DIR_.'restricted-country.tpl'); + exit; + } + + protected function canonicalRedirection() + { + global $link, $cookie; + + if (Configuration::get('PS_CANONICAL_REDIRECT')) + { + // Automatically redirect to the canonical URL if needed + if (isset($this->php_self) AND !empty($this->php_self)) + { + // $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain + $canonicalURL = $link->getPageLink($this->php_self, $this->ssl, $cookie->id_lang); + if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', (($this->ssl AND Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) + { + header('HTTP/1.0 301 Moved'); + $params = ''; + $excludedKey = array('isolang', 'id_lang'); + foreach ($_GET as $key => $value) + if (!in_array($key, $excludedKey)) + $params .= ($params == '' ? '?' : '&').$key.'='.$value; + if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ AND $_SERVER['REQUEST_URI'] != __PS_BASE_URI__) + die('[Debug] This page has moved
Please use the following URL instead: '.$canonicalURL.$params.''); + Tools::redirectLink($canonicalURL.$params); + } + } + } + } + + protected function geolocationManagement() + { + global $cookie, $smarty; + + if (!in_array($_SERVER['SERVER_NAME'], array('localhost', '127.0.0.1'))) + { + /* Check if Maxmind Database exists */ + if (file_exists(_PS_GEOIP_DIR_.'GeoLiteCity.dat')) + { + if (!isset($cookie->iso_code_country) OR (isset($cookie->iso_code_country) AND !in_array(strtoupper($cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))))) + { + include_once(_PS_GEOIP_DIR_.'geoipcity.inc'); + include_once(_PS_GEOIP_DIR_.'geoipregionvars.php'); + + $gi = geoip_open(realpath(_PS_GEOIP_DIR_.'GeoLiteCity.dat'), GEOIP_STANDARD); + $record = geoip_record_by_addr($gi, Tools::getRemoteAddr()); + + if (is_object($record) AND !in_array(strtoupper($record->country_code), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND !self::isInWhitelistForGeolocation()) + { + if (Configuration::get('PS_GEOLOCATION_BEHAVIOR') == _PS_GEOLOCATION_NO_CATALOG_) + $this->restrictedCountry = true; + elseif (Configuration::get('PS_GEOLOCATION_BEHAVIOR') == _PS_GEOLOCATION_NO_ORDER_) + $smarty->assign(array( + 'restricted_country_mode' => true, + 'geolocation_country' => $record->country_name + )); + } + elseif (is_object($record)) + { + $cookie->iso_code_country = strtoupper($record->country_code); + $hasBeenSet = true; + } + } + + if (isset($cookie->iso_code_country) AND (int)($id_country = Country::getByIso(strtoupper($cookie->iso_code_country)))) + { + /* Update defaultCountry */ + $defaultCountry = new Country($id_country); + if (isset($hasBeenSet) AND $hasBeenSet) + $cookie->id_currency = (int)(Currency::getCurrencyInstance($defaultCountry->id_currency ? (int)$defaultCountry->id_currency : Configuration::get('PS_CURRENCY_DEFAULT'))->id); + } + elseif (Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR') == _PS_GEOLOCATION_NO_CATALOG_) + $this->restrictedCountry = true; + elseif (Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR') == _PS_GEOLOCATION_NO_ORDER_) + $smarty->assign(array( + 'restricted_country_mode' => true, + 'geolocation_country' => 'Undefined' + )); + } + /* If not exists we disabled the geolocation feature */ + else + Configuration::updateValue('PS_GEOLOCATION_ENABLED', 0); + } + } + + public function preProcess() + { + } + + public function setMedia() + { + global $cookie; + + Tools::addCSS(_THEME_CSS_DIR_.'global.css', 'all'); + Tools::addJS(array(_PS_JS_DIR_.'tools.js', _PS_JS_DIR_.'jquery/jquery-1.4.4.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js')); + if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))) + { + Tools::addJS(array( + _PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js', + _PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js', + _PS_JS_DIR_.'hookLiveEdit.js') + ); + Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css'); + } + } + + public function process() + { + } + + public function displayContent() + { + Tools::safePostVars(); + self::$smarty->assign('errors', $this->errors); + } + + public function displayHeader() + { + global $css_files, $js_files; + + if (!self::$initialized) + $this->init(); + + // P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) + header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); + + /* Hooks are volontary out the initialize array (need those variables already assigned) */ + self::$smarty->assign(array( + 'time' => time(), + 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), + 'static_token' => Tools::getToken(false), + 'token' => Tools::getToken(), + 'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'), + 'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'), + 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, + 'content_only' => (int)(Tools::getValue('content_only')) + )); + self::$smarty->assign(array( + 'HOOK_HEADER' => Module::hookExec('header'), + 'HOOK_TOP' => Module::hookExec('top'), + 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn') + )); + + if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache')) + { + // CSS compressor management + if (Configuration::get('PS_CSS_THEME_CACHE')) + Tools::cccCss(); + + //JS compressor management + if (Configuration::get('PS_JS_THEME_CACHE')) + Tools::cccJs(); + } + + self::$smarty->assign('css_files', $css_files); + self::$smarty->assign('js_files', array_unique($js_files)); + self::$smarty->display(_PS_THEME_DIR_.'header.tpl'); + } + + public function displayFooter() + { + global $cookie; + if (!self::$initialized) + $this->init(); + + self::$smarty->assign(array( + 'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn', array('cart' => self::$cart)), + 'HOOK_FOOTER' => Module::hookExec('footer'), + 'content_only' => (int)(Tools::getValue('content_only')))); + self::$smarty->display(_PS_THEME_DIR_.'footer.tpl'); + //live edit + if (Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))) + { + self::$smarty->assign(array('ad' => $ad, 'live_edit' => true)); + self::$smarty->display(_PS_ALL_THEMES_DIR_.'live_edit.tpl'); + } + else + Tools::displayError(); + } + + public function productSort() + { + if (!self::$initialized) + $this->init(); + + $stock_management = (int)(Configuration::get('PS_STOCK_MANAGEMENT')) ? true : false; // no display quantity order if stock management disabled + $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); + $orderWayValues = array(0 => 'asc', 1 => 'desc'); + $this->orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); + $this->orderWay = Tools::strtolower(Tools::getValue('orderway', $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); + if (!in_array($this->orderBy, $orderByValues)) + $this->orderBy = $orderByValues[0]; + if (!in_array($this->orderWay, $orderWayValues)) + $this->orderWay = $orderWayValues[0]; + + self::$smarty->assign(array( + 'orderby' => $this->orderBy, + 'orderway' => $this->orderWay, + 'orderbydefault' => $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))], + 'orderwayposition' => $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))], // Deprecated: orderwayposition + 'orderwaydefault' => $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))], + 'stock_management' => (int)($stock_management))); + } + + public function pagination($nbProducts = 10) + { + if (!self::$initialized) + $this->init(); + + $nArray = (int)(Configuration::get('PS_PRODUCTS_PER_PAGE')) != 10 ? array((int)(Configuration::get('PS_PRODUCTS_PER_PAGE')), 10, 20, 50) : array(10, 20, 50); + asort($nArray); + $this->n = abs((int)(Tools::getValue('n', ((isset(self::$cookie->nb_item_per_page) AND self::$cookie->nb_item_per_page >= 10) ? self::$cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE')))))); + $this->p = abs((int)(Tools::getValue('p', 1))); + $range = 2; /* how many pages around page selected */ + + if ($this->p < 0) + $this->p = 0; + + if (isset(self::$cookie->nb_item_per_page) AND $this->n != self::$cookie->nb_item_per_page AND in_array($this->n, $nArray)) + self::$cookie->nb_item_per_page = $this->n; + + if ($this->p > ($nbProducts / $this->n)) + $this->p = ceil($nbProducts / $this->n); + $pages_nb = ceil($nbProducts / (int)($this->n)); + + $start = (int)($this->p - $range); + if ($start < 1) + $start = 1; + $stop = (int)($this->p + $range); + if ($stop > $pages_nb) + $stop = (int)($pages_nb); + self::$smarty->assign('nb_products', $nbProducts); + $pagination_infos = array( + 'pages_nb' => (int)($pages_nb), + 'p' => (int)($this->p), + 'n' => (int)($this->n), + 'nArray' => $nArray, + 'range' => (int)($range), + 'start' => (int)($start), + 'stop' => (int)($stop) + ); + self::$smarty->assign($pagination_infos); + } + + public static function getCurrentCustomerGroups() + { + if (!isset(self::$cookie) || !self::$cookie->id_customer) + return array(); + if (!is_array(self::$currentCustomerGroups)) + { + self::$currentCustomerGroups = array(); + $result = Db::getInstance()->ExecuteS('SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.(int)self::$cookie->id_customer); + foreach ($result as $row) + self::$currentCustomerGroups[] = $row['id_group']; + } + return self::$currentCustomerGroups; + } + + protected static function isInWhitelistForGeolocation() + { + $allowed = false; + $userIp = Tools::getRemoteAddr(); + $ips = explode(';', Configuration::get('PS_GEOLOCATION_WHITELIST')); + if (is_array($ips) AND sizeof($ips)) + foreach ($ips AS $ip) + if (!empty($ip) AND strpos($userIp, $ip) === 0) + $allowed = true; + return $allowed; + } +} + diff --git a/classes/Group.php b/classes/Group.php new file mode 100644 index 000000000..fb461b73e --- /dev/null +++ b/classes/Group.php @@ -0,0 +1,168 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class GroupCore extends ObjectModel +{ + public $id; + + /** @var string Lastname */ + public $name; + + /** @var string Reduction */ + public $reduction; + + /** @var int Price display method (tax inc/tax exc) */ + public $price_display_method; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $tables = array ('group'); + + protected $fieldsRequired = array('price_display_method'); + protected $fieldsSize = array(); + protected $fieldsValidate = array('reduction' => 'isFloat', 'price_display_method' => 'isPriceDisplayMethod'); + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'group'; + protected $identifier = 'id_group'; + + protected static $_cacheReduction = array(); + protected static $_groupPriceDisplayMethod = array(); + + protected $webserviceParameters = array(); + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_group'] = (int)($this->id); + $fields['reduction'] = (float)($this->reduction); + $fields['price_display_method'] = (int)($this->price_display_method); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + + public function getTranslationsFieldsChild() + { + if (!parent::validateFieldsLang()) + return false; + return parent::getTranslationsFields(array('name')); + } + + static public function getGroups($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT g.`id_group`, g.`reduction`, g.`price_display_method`, gl.`name` + FROM `'._DB_PREFIX_.'group` g + LEFT JOIN `'._DB_PREFIX_.'group_lang` AS gl ON (g.`id_group` = gl.`id_group` AND gl.`id_lang` = '.(int)($id_lang).') + ORDER BY g.`id_group` ASC'); + } + + public function getCustomers() + { + return Db::getInstance()->ExecuteS(' + SELECT cg.`id_customer`, c.* + FROM `'._DB_PREFIX_.'customer_group` cg + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (cg.`id_customer` = c.`id_customer`) + WHERE cg.`id_group` = '.(int)($this->id).' + AND c.`deleted` != 1 + ORDER BY cg.`id_customer` ASC'); + } + + static public function getReduction($id_customer = NULL) + { + if ($id_customer === NULL) + $id_customer = 0; + if (!isset(self::$_cacheReduction['customer'][$id_customer])) + { + if ($id_customer) + $customer = new Customer((int)($id_customer)); + self::$_cacheReduction['customer'][$id_customer] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `reduction` + FROM `'._DB_PREFIX_.'group` + WHERE `id_group` = '.((isset($customer) AND Validate::isLoadedObject($customer)) ? (int)($customer->id_default_group) : 1)); + } + return self::$_cacheReduction['customer'][$id_customer]; + } + + public static function getReductionByIdGroup($id_group) + { + if (!isset(self::$_cacheReduction['group'][$id_group])) + { + self::$_cacheReduction['group'][$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `reduction` + FROM `'._DB_PREFIX_.'group` + WHERE `id_group` = '.$id_group); + } + return self::$_cacheReduction['group'][$id_group]; + } + + static public function getPriceDisplayMethod($id_group) + { + if (!isset(self::$_groupPriceDisplayMethod[$id_group])) + self::$_groupPriceDisplayMethod[$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `price_display_method` + FROM `'._DB_PREFIX_.'group` + WHERE `id_group` = '.(int)($id_group)); + return self::$_groupPriceDisplayMethod[$id_group]; + } + + static public function getDefaultPriceDisplayMethod() + { + return self::getPriceDisplayMethod(1); + } + + public function add($autodate = true, $nullValues = false) + { + return parent::add() && Category::setNewGroupForHome((int)($this->id)); + } + + public function delete() + { + if ($this->id == _PS_DEFAULT_CUSTOMER_GROUP_) + return false; + if (parent::delete()) + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_group` = '.(int)($this->id)); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_group` = '.(int)($this->id)); + Discount::deleteByIdGroup((int)($this->id)); + return true; + } + return false; + } +} + + diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php new file mode 100644 index 000000000..c36e86a4c --- /dev/null +++ b/classes/GroupReduction.php @@ -0,0 +1,108 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class GroupReductionCore extends ObjectModel +{ + public $id_group; + public $id_category; + public $reduction; + + protected $fieldsRequired = array('id_group', 'id_category', 'reduction'); + protected $fieldsValidate = array('id_group' => 'isUnsignedId', 'id_category' => 'isUnsignedId', 'reduction' => 'isPrice'); + + protected $table = 'group_reduction'; + protected $identifier = 'id_group_reduction'; + + protected static $reductionCache = array(); + + public function getFields() + { + parent::validateFields(); + $fields['id_group'] = (int)($this->id_group); + $fields['id_category'] = (int)($this->id_category); + $fields['reduction'] = (float)($this->reduction); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + return (parent::add($autodate, $nullValues) AND $this->_setCache()); + } + + public function update($nullValues = false) + { + return (parent::update($nullValues) AND $this->_clearCache() AND $this->_setCache()); + } + + public function delete() + { + return $this->_clearCache() AND parent::delete(); + } + + protected function _clearCache() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_group` = '.(int)($this->id_group)); + } + + protected function _setCache() + { + $resource = Db::getInstance()->ExecuteS(' + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_product` cp + INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = cp.`id_product`) + WHERE cp.`id_category` = '.(int)($this->id_category) + , false); + $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; + while ($row = Db::getInstance()->nextRow($resource)) + $query .= '('.(int)($row['id_product']).', '.(int)($this->id_group).', '.(float)($this->reduction).'), '; + return Db::getInstance()->Execute(rtrim($query, ', ')); + } + + static public function getGroupReductions($id_group, $id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT gr.`id_group_reduction`, gr.`id_group`, gr.`id_category`, gr.`reduction`, cl.`name` AS category_name + FROM `'._DB_PREFIX_.'group_reduction` gr + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = gr.`id_category` AND cl.`id_lang` = '.(int)($id_lang).') + WHERE `id_group` = '.(int)($id_group) + ); + } + + static public function getValueForProduct($id_product, $id_group) + { + if (!isset(self::$reductionCache[$id_product.'-'.$id_group])) + self::$reductionCache[$id_product.'-'.$id_group] = Db::getInstance()->getValue('SELECT `reduction` FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group)); + return self::$reductionCache[$id_product.'-'.$id_group]; + } + + static public function doesExist($id_group, $id_category) + { + return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_group` FROM `'._DB_PREFIX_.'group_reduction` WHERE `id_group` = '.(int)($id_group).' AND `id_category` = '.(int)($id_category)); + } +} + + diff --git a/classes/Guest.php b/classes/Guest.php new file mode 100644 index 000000000..d1ad33882 --- /dev/null +++ b/classes/Guest.php @@ -0,0 +1,210 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class GuestCore extends ObjectModel +{ + public $id_operating_system; + public $id_web_browser; + public $id_customer; + public $javascript; + public $screen_resolution_x; + public $screen_resolution_y; + public $screen_color; + public $sun_java; + public $adobe_flash; + public $adobe_director; + public $apple_quicktime; + public $real_player; + public $windows_media; + public $accept_language; + + protected $fieldsSize = array('accept_language' => 8); + protected $fieldsValidate = array( + 'id_operating_system' => 'isUnsignedId', + 'id_web_browser' => 'isUnsignedId', + 'id_customer' => 'isUnsignedId', + 'javascript' => 'isBool', + 'screen_resolution_x' => 'isInt', + 'screen_resolution_y' => 'isInt', + 'screen_color' => 'isInt', + 'sun_java' => 'isBool', + 'adobe_flash' => 'isBool', + 'adobe_director' => 'isBool', + 'apple_quicktime' => 'isBool', + 'real_player' => 'isBool', + 'windows_media' => 'isBool', + 'accept_language' => 'isGenericName' + ); + + protected $table = 'guest'; + protected $identifier = 'id_guest'; + + + protected $webserviceParameters = array( + 'fields' => array( + 'id_customer' => array('xlink_resource' => 'customers'), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_operating_system'] = (int)($this->id_operating_system); + $fields['id_web_browser'] = (int)($this->id_web_browser); + $fields['id_customer'] = (int)($this->id_customer); + $fields['javascript'] = (int)($this->javascript); + $fields['screen_resolution_x'] = (int)($this->screen_resolution_x); + $fields['screen_resolution_y'] = (int)($this->screen_resolution_y); + $fields['screen_color'] = (int)($this->screen_color); + $fields['sun_java'] = (int)($this->sun_java); + $fields['adobe_flash'] = (int)($this->adobe_flash); + $fields['adobe_director'] = (int)($this->adobe_director); + $fields['apple_quicktime'] = (int)($this->apple_quicktime); + $fields['real_player'] = (int)($this->real_player); + $fields['windows_media'] = (int)($this->windows_media); + $fields['accept_language'] = pSQL($this->accept_language); + + return $fields; + } + + function userAgent() + { + $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; + $this->id_operating_system = $this->getOs($userAgent); + $this->id_web_browser = $this->getBrowser($userAgent); + $this->accept_language = $this->getLanguage($acceptLanguage); + } + + protected function getLanguage($acceptLanguage) + { + // $langsArray is filled with all the languages accepted, ordered by priority + $langsArray = array(); + preg_match_all('/([a-z]{2}(-[a-z]{2})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/', $acceptLanguage, $array); + if (count($array[1])) + { + $langsArray = array_combine($array[1], $array[4]); + foreach ($langsArray as $lang => $val) + if ($val === '') + $langsArray[$lang] = 1; + arsort($langsArray, SORT_NUMERIC); + } + + // Only the first language is returned + return (sizeof($langsArray) ? key($langsArray) : ''); + } + + protected function getBrowser($userAgent) + { + $browserArray = array( + 'Google Chrome' => 'Chrome/', + 'Safari' => 'Safari', + 'Firefox 3.x' => 'Firefox/3', + 'Firefox 2.x' => 'Firefox/2', + 'Opera' => 'Opera', + 'IE 8.x' => 'MSIE 8', + 'IE 7.x' => 'MSIE 7', + 'IE 6.x' => 'MSIE 6' + ); + foreach ($browserArray as $k => $value) + if (strstr($userAgent, $value)) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_web_browser` + FROM `'._DB_PREFIX_.'web_browser` wb + WHERE wb.`name` = \''.pSQL($k).'\''); + + return $result['id_web_browser']; + } + return NULL; + } + + protected function getOs($userAgent) + { + $osArray = array( + 'Windows Vista' => 'Windows NT 6', + 'Windows XP' => 'Windows NT 5', + 'MacOsX' => 'Mac OS X', + 'Linux' => 'X11' + ); + foreach ($osArray as $k => $value) + if (strstr($userAgent, $value)) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_operating_system` + FROM `'._DB_PREFIX_.'operating_system` os + WHERE os.`name` = \''.pSQL($k).'\''); + + return $result['id_operating_system']; + } + return NULL; + } + + public static function getFromCustomer($id_customer) + { + if (!Validate::isUnsignedId($id_customer)) + return false; + $result = Db::getInstance()->getRow(' + SELECT `id_guest` + FROM `'._DB_PREFIX_.'guest` + WHERE `id_customer` = '.(int)($id_customer)); + return $result['id_guest']; + } + + public function mergeWithCustomer($id_guest, $id_customer) + { + // Since the guests are merged, the guest id in the connections table must be changed too + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'connections` c + SET c.`id_guest` = '.(int)($id_guest).' + WHERE c.`id_guest` = '.(int)($this->id)); + + // The current guest is removed from the database + $this->delete(); + + // $this is still filled with values, so it's id is changed for the old guest + $this->id = (int)($id_guest); + $this->id_customer = (int)($id_customer); + + // $this is now the old guest but filled with the most up to date values + $this->update(); + } + + public static function setNewGuest($cookie) + { + $guest = new Guest(isset($cookie->id_customer) ? Guest::getFromCustomer((int)($cookie->id_customer)) : NULL); + $guest->userAgent(); + if ($guest->id_operating_system OR $guest->id_web_browser) + { + $guest->save(); + $cookie->id_guest = (int)($guest->id); + } + } +} + + diff --git a/classes/HelpAccess.php b/classes/HelpAccess.php new file mode 100644 index 000000000..b0d63b12e --- /dev/null +++ b/classes/HelpAccess.php @@ -0,0 +1,117 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +class HelpAccessCore +{ + const URL = 'http://help.prestashop.com'; + + protected static $_images = array(0 => 'none', + 1 => 'help2.png', + 2 => 'help-new.png'); + + public static function trackClick($label, $version) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'help_access` (`label`, `version`) VALUES (\''.pSQL($label).'\',\''.pSQL($version).'\') + ON DUPLICATE KEY UPDATE `version` = \''.pSQL($version).'\' + '); + } + + public static function getVersion($label) + { + return Db::getInstance()->getValue(' + SELECT `version` FROM `'._DB_PREFIX_.'help_access` + WHERE `label` = \''.pSQL($label).'\' + '); + } + + public static function retrieveInfos($label, $iso_lang, $country, $version) + { + $image = self::$_images[0]; + $tooltip = ''; + $url = HelpAccess::URL.'/documentation/renderIcon?label='.$label.'&iso_lang='.$iso_lang.'&country='.$country.'&version='.$version; + + $ctx = stream_context_create(array( + 'http' => array( + 'timeout' => 10 + ) + )); + + $res = @file_get_contents($url, 0, $ctx); + + $infos = preg_split('/\|/', $res); + if (sizeof($infos) > 0) + { + $version = trim($infos[0]); + if (!empty($version)) + { + $image = self::$_images[1]; + + if (sizeof($infos) > 1) + $tooltip = trim('|'.$infos[1]); + } + } + + $last_version = HelpAccess::getVersion($label); + + if (!empty($version) && $version != $last_version) + $image = self::$_images[2]; + + return array('version' => $version, 'image' => $image, 'tooltip' => $tooltip); + } + + public static function displayHelp($label, $iso_lang, $country, $ps_version) + { + $infos = HelpAccess::retrieveInfos($label, $iso_lang, $country, $ps_version); + if (array_key_exists('image', $infos) && $infos['image'] != 'none') + { + echo ' + + '.Tools::displayError('HELP').' + + + '; + + + if (!empty($infos['tooltip'])) + echo ' '; + } + } +} + diff --git a/classes/Hook.php b/classes/Hook.php new file mode 100644 index 000000000..8c4ae44b4 --- /dev/null +++ b/classes/Hook.php @@ -0,0 +1,220 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class HookCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 32); + protected $fieldsValidate = array('name' => 'isHookName'); + + protected $table = 'hook'; + protected $identifier = 'id_hook'; + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + return $fields; + } + + /** + * Return hook ID from name + * + * @param string $hookName Hook name + * @return integer Hook ID + */ + static public function get($hookName) + { + if (!Validate::isHookName($hookName)) + die(Tools::displayError()); + + $result = Db::getInstance()->getRow(' + SELECT `id_hook`, `name` + FROM `'._DB_PREFIX_.'hook` + WHERE `name` = \''.pSQL($hookName).'\''); + + return ($result ? $result['id_hook'] : false); + } + + static public function getHooks($position = false) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'hook` h + '.($position ? 'WHERE h.`position` = 1' : '')); + } + + static public function getModulesFromHook($id_hook) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON (hm.id_module = m.id_module) + WHERE hm.id_hook = '.(int)($id_hook)); + } + + static public function getModuleFromHook($id_hook, $id_module) + { + return Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON (hm.id_module = m.id_module) + WHERE hm.id_hook = '.(int)($id_hook).' AND m.id_module = '.(int)($id_module)); + } + + static public function newOrder($cart, $order, $customer, $currency, $orderStatus) + { + return Module::hookExec('newOrder', array( + 'cart' => $cart, + 'order' => $order, + 'customer' => $customer, + 'currency' => $currency, + 'orderStatus' => $orderStatus)); + } + + static public function updateOrderStatus($newOrderStatusId, $id_order) + { + $order = new Order((int)($id_order)); + $newOS = new OrderState((int)($newOrderStatusId), $order->id_lang); + + $return = ((int)($newOS->id) == _PS_OS_PAYMENT_) ? Module::hookExec('paymentConfirm', array('id_order' => (int)($order->id))) : true; + $return = Module::hookExec('updateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id))) AND $return; + return $return; + } + + static public function postUpdateOrderStatus($newOrderStatusId, $id_order) + { + $order = new Order((int)($id_order)); + $newOS = new OrderState((int)($newOrderStatusId), $order->id_lang); + $return = Module::hookExec('postUpdateOrderStatus', array('newOrderStatus' => $newOS, 'id_order' => (int)($order->id))); + return $return; + } + + static public function updateQuantity($product, $order) + { + return Module::hookExec('updateQuantity', array('product' => $product, 'order' => $order)); + } + + static public function productFooter($product, $category) + { + return Module::hookExec('productFooter', array('product' => $product, 'category' => $category)); + } + + static public function productOutOfStock($product) + { + return Module::hookExec('productOutOfStock', array('product' => $product)); + } + + static public function addProduct($product) + { + return Module::hookExec('addProduct', array('product' => $product)); + } + + static public function updateProduct($product) + { + return Module::hookExec('updateProduct', array('product' => $product)); + } + + static public function deleteProduct($product) + { + return Module::hookExec('deleteProduct', array('product' => $product)); + } + + static public function updateProductAttribute($id_product_attribute) + { + return Module::hookExec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute)); + } + + static public function orderConfirmation($id_order) + { + if (Validate::isUnsignedId($id_order)) + { + $params = array(); + $order = new Order((int)$id_order); + $currency = new Currency((int)$order->id_currency); + + if (Validate::isLoadedObject($order)) + { + $params['total_to_pay'] = $order->total_paid; + $params['currency'] = $currency->sign; + $params['objOrder'] = $order; + $params['currencyObj'] = $currency; + + return Module::hookExec('orderConfirmation', $params); + } + } + return false; + } + + static public function paymentReturn($id_order, $id_module) + { + if (Validate::isUnsignedId($id_order) AND Validate::isUnsignedId($id_module)) + { + $params = array(); + $order = new Order((int)($id_order)); + $currency = new Currency((int)($order->id_currency)); + + if (Validate::isLoadedObject($order)) + { + $params['total_to_pay'] = $order->total_paid; + $params['currency'] = $currency->sign; + $params['objOrder'] = $order; + $params['currencyObj'] = $currency; + + return Module::hookExec('paymentReturn', $params, (int)($id_module)); + } + } + return false; + } + + static public function PDFInvoice($pdf, $id_order) + { + if (!is_object($pdf) OR !Validate::isUnsignedId($id_order)) + return false; + return Module::hookExec('PDFInvoice', array('pdf' => $pdf, 'id_order' => $id_order)); + } + + static public function backBeforePayment($module) + { + $params['module'] = strval($module); + if (!$params['module']) + return false; + return Module::hookExec('backBeforePayment', $params); + } + + static public function updateCarrier($id_carrier, $carrier) + { + if (!Validate::isUnsignedId($id_carrier) OR !is_object($carrier)) + return false; + return Module::hookExec('updateCarrier', array('id_carrier' => $id_carrier, 'carrier' => $carrier)); + } +} + + diff --git a/classes/Image.php b/classes/Image.php new file mode 100644 index 000000000..e8d8a5c92 --- /dev/null +++ b/classes/Image.php @@ -0,0 +1,301 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ImageCore extends ObjectModel +{ + public $id; + + /** @var integer Image ID */ + public $id_image; + + /** @var integer Product ID */ + public $id_product; + + /** @var string HTML title and alt attributes */ + public $legend; + + /** @var integer Position used to order images of the same product */ + public $position; + + /** @var boolean Image is cover */ + public $cover; + + protected $tables = array ('image', 'image_lang'); + + protected $fieldsRequired = array('id_product'); + protected $fieldsValidate = array('id_product' => 'isUnsignedId', 'position' => 'isUnsignedInt', 'cover' => 'isBool'); + protected $fieldsRequiredLang = array('legend'); + protected $fieldsSizeLang = array('legend' => 128); + protected $fieldsValidateLang = array('legend' => 'isGenericName'); + + protected $table = 'image'; + protected $identifier = 'id_image'; + + protected static $_cacheGetSize = array(); + + public function getFields() + { + parent::validateFields(); + $fields['id_product'] = (int)($this->id_product); + $fields['position'] = (int)($this->position); + $fields['cover'] = (int)($this->cover); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('legend')); + } + + public function delete() + { + parent::delete(); + $result = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($this->id_product).' + ORDER BY `position`'); + $i = 1; + + foreach ($result as $row) + { + $row['position'] = $i++; + Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table, $row, 'UPDATE', '`id_image` = '.(int)($row['id_image']), 1); + } + } + + /** + * Return available images for a product + * + * @param integer $id_lang Language ID + * @param integer $id_product Product ID + * @return array Images + */ + static public function getImages($id_lang, $id_product) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON i.`id_image` = il.`id_image` + WHERE i.`id_product` = '.(int)($id_product).' + AND il.`id_lang` = '.(int)($id_lang).' + ORDER BY `position` ASC'); + } + + /** + * Return Images + * + * @return array Images + */ + static public function getAllImages() + { + return Db::getInstance()->ExecuteS(' + SELECT `id_image`, `id_product` + FROM `'._DB_PREFIX_.'image` + ORDER BY `id_image` ASC'); + } + + /** + * Return number of images for a product + * + * @param integer $id_product Product ID + * @return integer number of images + */ + static public function getImagesTotal($id_product) + { + $result = Db::getInstance()->getRow(' + SELECT COUNT(`id_image`) AS total + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($id_product)); + return $result['total']; + } + + /** + * Return highest position of images for a product + * + * @param integer $id_product Product ID + * @return integer highest position of images + */ + static public function getHighestPosition($id_product) + { + $result = Db::getInstance()->getRow(' + SELECT MAX(`position`) AS max + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($id_product)); + return $result['max']; + } + + /** + * Delete product cover + * + * @param integer $id_product Product ID + * @return boolean result + */ + static public function deleteCover($id_product) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + + if (file_exists(_PS_TMP_IMG_DIR_.'product_'.$id_product.'.jpg')) + unlink(_PS_TMP_IMG_DIR_.'product_'.$id_product.'.jpg'); + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'image` + SET `cover` = 0 + WHERE `id_product` = '.(int)($id_product)); + } + + /** + *Get product cover + * + * @param integer $id_product Product ID + * @return boolean result + */ + static public function getCover($id_product) + { + return Db::getInstance()->getRow(' + SELECT * FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($id_product).' + AND `cover`= 1'); + } + + /** + * Copy images from a product to another + * + * @param integer $id_product_old Source product ID + * @param boolean $id_product_new Destination product ID + */ + static public function duplicateProductImages($id_product_old, $id_product_new, $combinationImages) + { + $imagesTypes = ImageType::getImagesTypes('products'); + $result = Db::getInstance()->ExecuteS(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($id_product_old)); + foreach ($result as $row) + { + $image = new Image($row['id_image']); + $saved_id = $image->id_image; + unset($image->id); + unset($image->id_image); + $image->id_product = (int)($id_product_new); + if ($image->add()) + { + foreach ($imagesTypes AS $k => $imageType) + if (file_exists(_PS_PROD_IMG_DIR_.(int)($id_product_old).'-'.(int)($row['id_image']).'-'.$imageType['name'].'.jpg')) + copy(_PS_PROD_IMG_DIR_.(int)($id_product_old).'-'.(int)($row['id_image']).'-'.$imageType['name'].'.jpg', _PS_PROD_IMG_DIR_. + (int)($id_product_new).'-'.(int)($image->id).'-'.$imageType['name'].'.jpg'); + if (file_exists(_PS_PROD_IMG_DIR_.(int)($id_product_old).'-'.(int)($row['id_image']).'.jpg')) + copy(_PS_PROD_IMG_DIR_.(int)($id_product_old).'-'.(int)($row['id_image']).'.jpg', + _PS_PROD_IMG_DIR_.(int)($id_product_new).'-'.(int)($image->id).'.jpg'); + self::replaceAttributeImageAssociationId($combinationImages, (int)($saved_id), (int)($image->id)); + } + else + return false; + } + return self::duplicateAttributeImageAssociations($combinationImages); + } + + static protected function replaceAttributeImageAssociationId(&$combinationImages, $saved_id, $id_image) + { + if (!isset($combinationImages['new']) OR !is_array($combinationImages['new'])) + return ; + foreach ($combinationImages['new'] AS $id_product_attribute => $imageIds) + foreach ($imageIds AS $key => $imageId) + if ((int)($imageId) == (int)($saved_id)) + $combinationImages['new'][$id_product_attribute][$key] = (int)($id_image); + } + + /** + * Duplicate product attribute image associations + * @param integer $id_product_attribute_old + * @return boolean + */ + static public function duplicateAttributeImageAssociations($combinationImages) + { + if (!isset($combinationImages['new']) OR !is_array($combinationImages['new'])) + return true; + $query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES '; + foreach ($combinationImages['new'] AS $id_product_attribute => $imageIds) + foreach ($imageIds AS $imageId) + $query .= '('.(int)($id_product_attribute).', '.(int)($imageId).'), '; + $query = rtrim($query, ', '); + return DB::getInstance()->Execute($query); + } + + /** + * Reposition image + * + * @param integer $position Position + * @param boolean $direction Direction + */ + public function positionImage($position, $direction) + { + $position = (int)($position); + $direction = (int)($direction); + + // temporary position + $high_position = Image::getHighestPosition($this->id_product) + 1; + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'image` + SET `position` = '.(int)($high_position).' + WHERE `id_product` = '.(int)($this->id_product).' + AND `position` = '.($direction ? $position - 1 : $position + 1)); + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'image` + SET `position` = `position`'.($direction ? '-1' : '+1').' + WHERE `id_image` = '.(int)($this->id)); + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'image` + SET `position` = '.$this->position.' + WHERE `id_product` = '.(int)($this->id_product).' + AND `position` = '.(int)($high_position)); + } + + static public function getSize($type) + { + if (!isset(self::$_cacheGetSize[$type]) OR self::$_cacheGetSize[$type] === NULL) + self::$_cacheGetSize[$type] = Db::getInstance()->getRow('SELECT `width`, `height` FROM '._DB_PREFIX_.'image_type WHERE `name` = \''.pSQL($type).'\''); + return self::$_cacheGetSize[$type]; + } + + /** + * Clear all images in tmp dir + */ + static public function clearTmpDir() + { + foreach (scandir(_PS_TMP_IMG_DIR_) AS $d) + if (preg_match('/(.*)\.jpg$/', $d)) + unlink(_PS_TMP_IMG_DIR_.$d); + } + +} + + diff --git a/classes/ImageType.php b/classes/ImageType.php new file mode 100644 index 000000000..35c2ab554 --- /dev/null +++ b/classes/ImageType.php @@ -0,0 +1,149 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ImageTypeCore extends ObjectModel +{ + public $id; + + /** @var string Name */ + public $name; + + /** @var integer Width */ + public $width; + + /** @var integer Height */ + public $height; + + /** @var boolean Apply to products */ + public $products; + + /** @var integer Apply to categories */ + public $categories; + + /** @var integer Apply to manufacturers */ + public $manufacturers; + + /** @var integer Apply to suppliers */ + public $suppliers; + + /** @var integer Apply to scenes */ + public $scenes; + + /** @var integer Apply to store */ + public $stores; + + protected $fieldsRequired = array('name', 'width', 'height'); + protected $fieldsValidate = array( + 'name' => 'isImageTypeName', + 'width' => 'isImageSize', + 'height' => 'isImageSize', + 'categories' => 'isBool', + 'products' => 'isBool', + 'manufacturers' => 'isBool', + 'suppliers' => 'isBool', + 'scenes' => 'isBool', + 'stores' => 'isBool' + ); + protected $fieldsSize = array('name' => 16); + + protected $table = 'image_type'; + protected $identifier = 'id_image_type'; + + /** + * @var array Image types cache + */ + protected static $images_types_cache = array(); + + protected $webserviceParameters = array(); + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + $fields['width'] = (int)($this->width); + $fields['height'] = (int)($this->height); + $fields['products'] = (int)($this->products); + $fields['categories'] = (int)($this->categories); + $fields['manufacturers'] = (int)($this->manufacturers); + $fields['suppliers'] = (int)($this->suppliers); + $fields['scenes'] = (int)($this->scenes); + $fields['stores'] = (int)($this->store); + return $fields; + } + + /** + * Returns image type definitions + * + * @param string|null Image type + * @return array Image type definitions + */ + static public function getImagesTypes($type = NULL) + { + if (!isset(self::$images_types_cache[$type])) + { + if (!empty($type)) + $where = 'WHERE ' . pSQL($type) . ' = 1 '; + else + $where = ''; + + $query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.'ORDER BY `name` ASC'; + self::$images_types_cache[$type] = Db::getInstance()->ExecuteS($query); + } + + return self::$images_types_cache[$type]; + } + + /** + * Check if type already is already registered in database + * + * @param string $typeName Name + * @return integer Number of results found + */ + static public function typeAlreadyExists($typeName) + { + if (!Validate::isImageTypeName($typeName)) + die(Tools::displayError()); + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_image_type` + FROM `'._DB_PREFIX_.'image_type` + WHERE `name` = \''.pSQL($typeName).'\''); + + return Db::getInstance()->NumRows(); + } + + /** + * Finds image type definition by name and type + * @param string $name + * @param string $type + */ + static public function getByNameNType($name, $type) + { + return Db::getInstance()->getRow('SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes` FROM `'._DB_PREFIX_.'image_type` WHERE `name` = \''.pSQL($name).'\' AND `'.pSQL($type).'` = 1'); + } + +} diff --git a/classes/ImportModule.php b/classes/ImportModule.php new file mode 100644 index 000000000..a3c04ad5b --- /dev/null +++ b/classes/ImportModule.php @@ -0,0 +1,93 @@ + + * @copyright PrestaShop + * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 + * @version 1.4 + * + */ + +abstract class ImportModuleCore extends Module +{ + protected $_link = NULL; + + public $server; + + public $user; + + public $passwd; + + public $database; + + /** @var string Prefix database */ + public $prefix; + + + public function __destruct() + { + if($this->_link) + @mysql_close($this->_link); + } + + protected function initDatabaseConnection() + { + if ($this->_link != NULL) + return $this->_link; + if ($this->_link = mysql_connect($this->server, $this->user, $this->passwd, true)) + { + if(!mysql_select_db($this->database, $this->_link)) + die(Tools::displayError('The database selection cannot be made.')); + if (!mysql_query('SET NAMES \'utf8\'', $this->_link)) + die(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.')); + } + else + die(Tools::displayError('Link to database cannot be established.')); + return $this->_link; + } + + public function ExecuteS($query) + { + $this->initDatabaseConnection(); + $result = mysql_query($query, $this->_link); + $resultArray = array(); + if ($result !== true) + while ($row = mysql_fetch_assoc($result)) + $resultArray[] = $row; + return $resultArray; + } + + public function Execute($query) + { + $this->initDatabaseConnection(); + return mysql_query($query, $this->_link); + } + + public function getValue($query) + { + $this->initDatabaseConnection(); + $result = $this->ExecuteS($query); + if (!sizeof($result)) + return 0; + else + return array_shift($result[0]); + } + + public static function getImportModulesOnDisk () + { + $modules = Module::getModulesOnDisk(); + foreach ($modules as $key => $module) + if(get_parent_class($module) != 'ImportModule') + unset($modules[$key]); + return $modules; + } + + abstract public function getDefaultIdLang(); + +} + +?> diff --git a/classes/Language.php b/classes/Language.php new file mode 100644 index 000000000..4e13a1f80 --- /dev/null +++ b/classes/Language.php @@ -0,0 +1,605 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class LanguageCore extends ObjectModel +{ + public $id; + + /** @var string Name */ + public $name; + + /** @var string 2-letter iso code */ + public $iso_code; + + /** @var string 5-letter iso code */ + public $language_code; + + /** @var boolean Status */ + public $active = true; + + protected $fieldsRequired = array('name', 'iso_code'); + protected $fieldsSize = array('name' => 32, 'iso_code' => 2, 'language_code' => 5); + protected $fieldsValidate = array('name' => 'isGenericName', 'iso_code' => 'isLanguageIsoCode', 'language_code' => 'isLanguageCode', 'active' => 'isBool'); + + protected $table = 'lang'; + protected $identifier = 'id_lang'; + + /** @var array Languages cache */ + protected static $_checkedLangs; + protected static $_LANGUAGES; + protected static $countActiveLanguages; + + protected $webserviceParameters = array(); + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id); + } + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + $fields['iso_code'] = pSQL(strtolower($this->iso_code)); + $fields['language_code'] = pSQL(strtolower($this->language_code)); + if (empty($fields['language_code'])) + $fields['language_code'] = $fields['iso_code']; + $fields['active'] = (int)($this->active); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + if (!parent::add($autodate)) + return false; + + $translationsFiles = array( + 'fields' => '_FIELDS', + 'errors' => '_ERRORS', + 'admin' => '_LANGADM', + 'pdf' => '_LANGPDF', + ); + if (!file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code)) + mkdir(_PS_TRANSLATIONS_DIR_.$this->iso_code); + foreach ($translationsFiles as $file => $var) + if (!file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code.'/'.$file.'.php')) + file_put_contents(_PS_TRANSLATIONS_DIR_.$this->iso_code.'/'.$file.'.php', ''); + + return ($this->loadUpdateSQL() AND Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + )); + } + + public function toggleStatus() + { + if (!parent::toggleStatus()) + return false; + + return (Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + )); + } + + public function checkFiles() + { + return self::checkFilesWithIsoCode($this->iso_code); + } + + + /** + * This functions checks if every files exists for the language $iso_code. + * Concerned files are theses located in translations/$iso_code/ + * and translations/mails/$iso_code . + * + * @param mixed $iso_code + * @returntrue if all files exists + */ + public static function checkFilesWithIsoCode($iso_code) + { + if (isset(self::$_checkedLangs[$iso_code]) AND self::$_checkedLangs[$iso_code]) + return true; + foreach (self::getFilesList($iso_code, _THEME_NAME_, false, false, false, true) as $key => $file) + if (!file_exists($key)) + return false; + self::$_checkedLangs[$iso_code] = true; + return true; + } + + public static function getFilesList($iso_from, $theme_from, $iso_to = false, $theme_to = false, $select = false, $check = false, $modules = false) + { + if (empty($iso_from)) + die(Tools::displayError()); + + $copy = ($iso_to AND $theme_to) ? true : false; + + $lPath_from = _PS_TRANSLATIONS_DIR_.(string)$iso_from.'/'; + $tPath_from = _PS_ROOT_DIR_.'/themes/'.(string)$theme_from.'/'; + $mPath_from = _PS_MAIL_DIR_.(string)$iso_from.'/'; + + if ($copy) + { + $lPath_to = _PS_TRANSLATIONS_DIR_.(string)$iso_to.'/'; + $tPath_to = _PS_ROOT_DIR_.'/themes/'.(string)$theme_to.'/'; + $mPath_to = _PS_MAIL_DIR_.(string)$iso_to.'/'; + } + + $lFiles = array('admin'.'.php', 'errors'.'.php', 'fields'.'.php', 'pdf'.'.php'); + $mFiles = array( + 'account.html', 'account.txt', + 'bankwire.html', 'bankwire.txt', + 'cheque.html', 'cheque.txt', + 'contact.html', 'contact.txt', + 'contact_form.html', 'contact_form.txt', + 'credit_slip.html', 'credit_slip.txt', + 'download_product.html', 'download_product.txt', + 'download-product.tpl', + 'employee_password.html', 'employee_password.txt', + 'forward_msg.html', 'forward_msg.txt', + 'guest_to_customer.html', 'guest_to_customer.txt', + 'in_transit.html', 'in_transit.txt', + 'newsletter.html', 'newsletter.txt', + 'order_canceled.html', 'order_canceled.txt', + 'order_conf.html', 'order_conf.txt', + 'order_customer_comment.html', 'order_customer_comment.txt', + 'order_merchant_comment.html', 'order_merchant_comment.txt', + 'order_return_state.html', 'order_return_state.txt', + 'outofstock.html', 'outofstock.txt', + 'password.html', 'password.txt', + 'password_query.html', 'password_query.txt', + 'payment.html', 'payment.txt', + 'payment_error.html', 'payment_error.txt', + 'preparation.html', 'preparation.txt', + 'refund.html', 'refund.txt', + 'reply_msg.html', 'reply_msg.txt', + 'shipped.html', 'shipped.txt', + 'test.html', 'test.txt', + 'voucher.html', 'voucher.txt', + ); + + $number = -1; + + $files = array(); + $files_tr = array(); + $files_theme = array(); + $files_mail = array(); + $files_modules = array(); + + + // When a copy is made from a theme in specific language + // to an other theme for the same language, + // it's avoid to copy Translations, Mails files + // and modules files which are not override by theme. + if (!$copy OR $iso_from != $iso_to) + { + // Translations files + if (!$check OR ($check AND (string)$iso_from != 'en')) + foreach ($lFiles as $file) + $files_tr[$lPath_from.$file] = ($copy ? $lPath_to.$file : ++$number); + if ($select == 'tr') + return $files_tr; + $files = array_merge($files, $files_tr); + + // Mail files + if (!$check OR ($check AND (string)$iso_from != 'en')) + $files_mail[$mPath_from.'lang.php'] = ($copy ? $mPath_to.'lang.php' : ++$number); + foreach ($mFiles as $file) + $files_mail[$mPath_from.$file] = ($copy ? $mPath_to.$file : ++$number); + if ($select == 'mail') + return $files_mail; + $files = array_merge($files, $files_mail); + + // Modules + if ($modules) + { + $modList = Module::getModulesDirOnDisk(); + foreach ($modList as $k => $mod) + { + $modDir = _PS_MODULE_DIR_.$mod; + // Lang file + if (file_exists($modDir.'/'.(string)$iso_from.'.php')) + $files_modules[$modDir.'/'.(string)$iso_from.'.php'] = ($copy ? $modDir.'/'.(string)$iso_to.'.php' : ++$number); + // Mails files + $modMailDirFrom = $modDir.'/mails/'.(string)$iso_from; + $modMailDirTo = $modDir.'/mails/'.(string)$iso_to; + if (file_exists($modMailDirFrom)) + { + $dirFiles = scandir($modMailDirFrom); + foreach ($dirFiles as $file) + if (file_exists($modMailDirFrom.'/'.$file) AND $file != '.' AND $file != '..' AND $file != '.svn') + $files_modules[$modMailDirFrom.'/'.$file] = ($copy ? $modMailDirTo.'/'.$file : ++$number); + } + } + if ($select == 'modules') + return $files_modules; + $files = array_merge($files, $files_modules); + } + } + else if ($select == 'mail' OR $select == 'tr') + { + return $files; + } + + // Theme files + if (!$check OR ($check AND (string)$iso_from != 'en')) + { + $files_theme[$tPath_from.'lang/'.(string)$iso_from.'.php'] = ($copy ? $tPath_to.'lang/'.(string)$iso_to.'.php' : ++$number); + $module_theme_files = (file_exists($tPath_from.'modules/') ? scandir($tPath_from.'modules/') : array()); + foreach ($module_theme_files as $module) + if ($module !== '.' AND $module != '..' AND $module !== '.svn' AND file_exists($tPath_from.'modules/'.$module.'/'.(string)$iso_from.'.php')) + $files_theme[$tPath_from.'modules/'.$module.'/'.(string)$iso_from.'.php'] = ($copy ? $tPath_to.'modules/'.$module.'/'.(string)$iso_to.'.php' : ++$number); + } + if ($select == 'theme') + return $files_theme; + $files = array_merge($files, $files_theme); + + // Return + return $files; + } + + public function loadUpdateSQL() + { + $tables = Db::getInstance()->ExecuteS('SHOW TABLES LIKE \''._DB_PREFIX_.'%_lang\' '); + $langTables = array(); + + foreach($tables as $table) + foreach($table as $t) + $langTables[] = $t; + + Db::getInstance()->Execute('SET @id_lang_default = (SELECT c.`value` FROM `'._DB_PREFIX_.'configuration` c WHERE c.`name` = \'PS_LANG_DEFAULT\' LIMIT 1)'); + foreach($langTables as $name) + { + $fields = ''; + $columns = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'.$name.'`'); + foreach($columns as $column) + $fields .= $column['Field'].', '; + $fields = rtrim($fields, ', '); + $identifier = 'id_'.str_replace('_lang', '', str_replace(_DB_PREFIX_, '', $name)); + + $sql = 'INSERT IGNORE INTO `'.$name.'` ('.$fields.') (SELECT '; + $sql .= '`'.$identifier.'`, `id_lang`, '; + foreach($columns as $column) + if ($identifier != $column['Field'] and $column['Field'] != 'id_lang') + $sql .= '(SELECT `'.$column['Field'].'` FROM `'.$name.'` tl WHERE tl.`id_lang` = @id_lang_default AND tl.`'.$identifier.'` = `'.str_replace('_lang', '', $name).'`.`'.$identifier.'`), '; + $sql = rtrim($sql, ', '); + $sql .= ' FROM `'._DB_PREFIX_.'lang` CROSS JOIN `'.str_replace('_lang', '', $name).'`) ;'; + Db::getInstance()->Execute(pSQL($sql)); + } + } + + public static function recurseDeleteDir($dir) + { + if (!is_dir($dir)) + return false; + if ($handle = @opendir($dir)) + { + while (false !== ($file = readdir($handle))) + if ($file != '.' && $file != '..') + { + if (is_dir($dir.'/'.$file)) + self::recurseDeleteDir($dir.'/'.$file); + elseif (file_exists($dir.'/'.$file)) + @unlink($dir.'/'.$file); + } + closedir($handle); + } + rmdir($dir); + } + + public function delete() + { + if (empty($this->iso_code)) + $this->iso_code = self::getIsoById($this->id); + + // Database translations deletion + $result = Db::getInstance()->ExecuteS('SHOW TABLES FROM `'._DB_NAME_.'`'); + foreach ($result AS $row) + if (preg_match('/_lang/', $row['Tables_in_'._DB_NAME_])) + if (!Db::getInstance()->Execute('DELETE FROM `'.$row['Tables_in_'._DB_NAME_].'` WHERE `id_lang` = '.(int)($this->id))) + return false; + + // Delete tags + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'tag WHERE id_lang = '.(int)($this->id)); + + // Delete search words + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'search_word WHERE id_lang = '.(int)($this->id)); + + // Files deletion + foreach (self::getFilesList($this->iso_code, _THEME_NAME_, false, false, false, true, true) as $key => $file) + unlink($key); + $modList = scandir(_PS_MODULE_DIR_); + foreach ($modList as $k => $mod) + { + self::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/'.$this->iso_code); + $files = @scandir(_PS_MODULE_DIR_.$mod.'/mails/'); + if (count($files) <= 2) + self::recurseDeleteDir(_PS_MODULE_DIR_.$mod.'/mails/'); + + if(file_exists(_PS_MODULE_DIR_.$mod.'/'.$this->iso_code.'.php')) + { + $return = unlink(_PS_MODULE_DIR_.$mod.'/'.$this->iso_code.'.php'); + $files = @scandir(_PS_MODULE_DIR_.$mod); + if (count($files) <= 2) + self::recurseDeleteDir(_PS_MODULE_DIR_.$mod); + } + } + + if (file_exists(_PS_MAIL_DIR_.$this->iso_code)) + self::recurseDeleteDir(_PS_MAIL_DIR_.$this->iso_code); + if (file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code)) + self::recurseDeleteDir(_PS_TRANSLATIONS_DIR_.$this->iso_code); + if (!parent::delete()) + return false; + + // delete images + $files_copy = array('/en.jpg', '/en-default-thickbox.jpg', '/en-default-home.jpg', '/en-default-large.jpg', '/en-default-medium.jpg', '/en-default-small.jpg', '/en-default-large_scene.jpg'); + $tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_); + foreach($tos AS $to) + foreach($files_copy AS $file) + { + $name = str_replace('/en', ''.$this->iso_code, $file); + + if (file_exists($to.$name)) + unlink($to.$name); + if (file_exists(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg')) + unlink(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg'); + } + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + + public function deleteSelection($selection) + { + if (!is_array($selection) OR !Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $result = true; + foreach ($selection AS $id) + { + $this->id = (int)($id); + $result = $result AND $this->delete(); + } + + Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + + return $result; + } + + /** + * Return available languages + * + * @param boolean $active Select only active languages + * @return array Languages + */ + public static function getLanguages($active = true) + { + if(!self::$_LANGUAGES) + self::loadLanguages(); + + foreach (self::$_LANGUAGES AS $language) + { + if ($active AND !$language['active']) + continue; + $languages[] = $language; + } + return $languages; + } + + public static function getLanguage($id_lang) + { + if (!array_key_exists((int)($id_lang), self::$_LANGUAGES)) + return false; + return self::$_LANGUAGES[(int)($id_lang)]; + } + + /** + * Return iso code from id + * + * @param integer $id_lang Language ID + * @return string Iso code + */ + public static function getIsoById($id_lang) + { + if (isset(self::$_LANGUAGES[(int)($id_lang)]['iso_code'])) + return self::$_LANGUAGES[(int)($id_lang)]['iso_code']; + return false; + } + + /** + * Return id from iso code + * + * @param string $iso_code Iso code + * @return integer Language ID + */ + public static function getIdByIso($iso_code) + { + if (!Validate::isLanguageIsoCode($iso_code)) + die(Tools::displayError('Fatal error : iso code is not correct : ').$iso_code); + + return Db::getInstance()->getValue('SELECT `id_lang` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = \''.pSQL(strtolower($iso_code)).'\''); + } + + public static function getLanguageCodeByIso($iso_code) + { + if (!Validate::isLanguageIsoCode($iso_code)) + die(Tools::displayError('Fatal error : iso code is not correct : ').$iso_code); + + return Db::getInstance()->getValue('SELECT `language_code` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = \''.pSQL(strtolower($iso_code)).'\''); + } + + /** + * Return array (id_lang, iso_code) + * + * @param string $iso_code Iso code + * @return array Language (id_lang, iso_code) + */ + public static function getIsoIds($active = true) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `id_lang`, `iso_code` FROM `'._DB_PREFIX_.'lang` '.($active ? 'WHERE active = 1' : '')); + } + + public static function copyLanguageData($from, $to) + { + $result = Db::getInstance()->ExecuteS('SHOW TABLES FROM `'._DB_NAME_.'`'); + foreach ($result AS $row) + if (preg_match('/_lang/', $row['Tables_in_'._DB_NAME_]) AND $row['Tables_in_'._DB_NAME_] != _DB_PREFIX_.'lang') + { + $result2 = Db::getInstance()->ExecuteS('SELECT * FROM `'.$row['Tables_in_'._DB_NAME_].'` WHERE `id_lang` = '.(int)($from)); + if (!sizeof($result2)) + continue; + Db::getInstance()->Execute('DELETE FROM `'.$row['Tables_in_'._DB_NAME_].'` WHERE `id_lang` = '.(int)($to)); + $query = 'INSERT INTO `'.$row['Tables_in_'._DB_NAME_].'` VALUES '; + foreach ($result2 AS $row2) + { + $query .= '('; + $row2['id_lang'] = $to; + foreach ($row2 AS $field) + $query .= '\''.pSQL($field, true).'\','; + $query = rtrim($query, ',').'),'; + } + $query = rtrim($query, ','); + Db::getInstance()->Execute($query); + } + return true; + } + + /** + * Load all languages in memory for caching + */ + public static function loadLanguages() + { + self::$_LANGUAGES = array(); + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_lang`, `name`, `iso_code`, `active` + FROM `'._DB_PREFIX_.'lang`'); + + foreach ($result AS $row) + self::$_LANGUAGES[(int)($row['id_lang'])] = array('id_lang' => (int)($row['id_lang']), 'name' => $row['name'], 'iso_code' => $row['iso_code'], 'active' => (int)($row['active'])); + } + + public function update($nullValues = false) + { + if (!parent::update($nullValues)) + return false; + + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + public static function checkAndAddLanguage($iso_code) + { + if (Language::getIdByIso($iso_code)) + return true; + else + { + if(@fsockopen('www.prestashop.com', 80)) + { + $lang = new Language(); + $lang->iso_code = $iso_code; + $lang->active = true; + + if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code))) + { + if (isset($lang_pack->name) + && isset($lang_pack->version) + && isset($lang_pack->iso_code)) + $lang->name = $lang_pack->name; + } + if (!$lang->name OR !$lang->add()) + return false; + $insert_id = (int)($lang->id); + + if ($lang_pack) + { + $flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg'); + if ($flag != NULL && !preg_match('//', $flag)) + { + $file = fopen(dirname(__FILE__).'/../img/l/'.$insert_id.'.jpg', 'w'); + if ($file) + { + fwrite($file, $flag); + fclose($file); + } + else + self::_copyNoneFlag($insert_id); + } + else + self::_copyNoneFlag($insert_id); + } + else + self::_copyNoneFlag($insert_id); + + $files_copy = array('/en.jpg', '/en-default-thickbox.jpg', '/en-default-home.jpg', '/en-default-large.jpg', '/en-default-medium.jpg', '/en-default-small.jpg', '/en-default-large_scene.jpg'); + $tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_); + foreach($tos AS $to) + foreach($files_copy AS $file) + { + $name = str_replace('/en', '/'.$iso_code, $file); + copy(dirname(__FILE__).'/../img/l'.$file, $to.$name); + } + return true; + } + else + return false; + } + } + + protected static function _copyNoneFlag($id) + { + return copy(dirname(__FILE__).'/../img/l/none.jpg', dirname(__FILE__).'/../img/l/'.$id.'.jpg'); + } + + public static function isInstalled($iso_code) + { + return Db::getInstance()->getValue('SELECT `id_lang` FROM `'._DB_PREFIX_.'lang` WHERE `iso_code` = "'.pSQL($iso_code).'"'); + } + + public static function countActiveLanguages() + { + if (!self::$countActiveLanguages) + self::$countActiveLanguages = Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'lang` WHERE `active` = 1'); + return self::$countActiveLanguages; + } +} + diff --git a/classes/Link.php b/classes/Link.php new file mode 100644 index 000000000..d9ec35a64 --- /dev/null +++ b/classes/Link.php @@ -0,0 +1,354 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class LinkCore +{ + /** @var boolean Rewriting activation */ + protected $allow; + protected $url; + public static $cache = array('page' => array()); + + /** + * Constructor (initialization only) + */ + public function __construct() + { + $this->allow = (int)Configuration::get('PS_REWRITING_SETTINGS'); + $this->url = $_SERVER['SCRIPT_NAME']; + } + + /** + * This function returns a link to delete a customization picture file + * + * @param mixed $product + * @param mixed $id_picture + * @return void + */ + public function getProductDeletePictureLink($product, $id_picture){ + if (is_object($product)) + return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink().((isset($product->category) AND !empty($product->category) AND $product->category != 'home') ? $product->category.'/' : '').(int)$product->id.'-'.$product->link_rewrite.($product->ean13 ? '-'.$product->ean13 : '').'.html?deletePicture='.$id_picture) : + (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$product->id).'&deletePicture='.$id_picture; + else + return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$product.'&deletePicture='.$id_picture; + } + + /** + * Return the correct link for product/category/supplier/manufacturer + * + * @param mixed $id_OBJ Can be either the object or the ID only + * @param string $alias Friendly URL (only if $id_OBJ is the object) + * @return string link + */ + public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL, $id_lang = NULL) + { + if (is_object($id_product)) + return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang).((isset($id_product->category) AND !empty($id_product->category) AND $id_product->category != 'home') ? $id_product->category.'/' : '').(int)$id_product->id.'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') : + (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product->id); + elseif ($alias) + return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang).(($category AND $category != 'home') ? ($category.'/') : '').(int)$id_product.'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') : + (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product); + else + return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product; + } + + public function getCategoryLink($id_category, $alias = NULL, $id_lang = NULL) + { + if (is_object($id_category)) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_category->id).'-'.$id_category->link_rewrite) : + (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category->id)); + if ($alias) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_category).'-'.$alias) : + (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category)); + return _PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category); + } + + public function getCMSCategoryLink($id_category, $alias = NULL, $id_lang = NULL) + { + if (is_object($id_category)) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/category/'.(int)($id_category->id).'-'.$id_category->link_rewrite) : + (_PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category->id)); + if ($alias) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/category/'.(int)($id_category).'-'.$alias) : + (_PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category)); + return _PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category); + } + + public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = NULL) + { + $base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)); + + if (is_object($cms)) + { + return ($this->allow == 1) ? + ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/'.(int)($cms->id).'-'.$cms->link_rewrite) : + ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms->id)); + } + + if ($alias) + return ($this->allow == 1) ? ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/'.(int)($cms).'-'.$alias) : + ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms)); + return $base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms); + } + + public function getSupplierLink($id_supplier, $alias = NULL, $id_lang = NULL) + { + if (is_object($id_supplier)) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_supplier->id).'__'.$id_supplier->link_rewrite) : + (_PS_BASE_URL_.__PS_BASE_URI__.'supplier.php?id_supplier='.(int)($id_supplier->id)); + if ($alias) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_supplier).'__'.$alias) : + (_PS_BASE_URL_.__PS_BASE_URI__.'supplier.php?id_supplier='.(int)($id_supplier)); + return _PS_BASE_URL_.__PS_BASE_URI__.'supplier.php?id_supplier='.(int)($id_supplier); + } + + public function getManufacturerLink($id_manufacturer, $alias = NULL, $id_lang = NULL) + { + if (is_object($id_manufacturer)) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_manufacturer->id).'_'.$id_manufacturer->link_rewrite) : + (_PS_BASE_URL_.__PS_BASE_URI__.'manufacturer.php?id_manufacturer='.(int)($id_manufacturer->id)); + if ($alias) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_manufacturer).'_'.$alias) : + (_PS_BASE_URL_.__PS_BASE_URI__.'manufacturer.php?id_manufacturer='.(int)($id_manufacturer)); + return _PS_BASE_URL_.__PS_BASE_URI__.'manufacturer.php?id_manufacturer='.(int)($id_manufacturer); + } + + /** + * @deprecated + */ + public function getCustomLink($id_custom, $page, $prefix = '~', $alias = NULL, $id_lang = NULL) + { + Tools::displayAsDeprecated(); + if (is_object($id_custom)) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_custom->id).$prefix.$id_custom->link_rewrite) : + (_PS_BASE_URL_.__PS_BASE_URI__.$page.'?id_custom='.(int)($id_custom->id)); + if ($alias) + return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).(int)($id_custom).$prefix.$alias) : + (_PS_BASE_URL_.__PS_BASE_URI__.$page.'?id_custom='.(int)($id_custom)); + return _PS_BASE_URL_.__PS_BASE_URI__.$page.'?id_custom='.(int)($id_custom); + } + + public function getImageLink($name, $ids, $type = NULL) + { + global $protocol_content; + if ($this->allow == 1) + $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg'; + else + $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg'; + return $protocol_content.Tools::getMediaServer($uri_path).$uri_path; + } + + public function getMediaLink($filepath) + { + return Tools::getProtocol().Tools::getMediaServer($filepath).$filepath; + } + + public function preloadPageLinks() + { + global $cookie; + if ($this->allow != 1) + return; + + $result = Db::getInstance()->ExecuteS(' + SELECT page, url_rewrite + FROM `'._DB_PREFIX_.'meta` m + LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta) + WHERE id_lang = '.(int)$cookie->id_lang); + foreach ($result as $row) + self::$cache['page'][$row['page'].'.php_'.$cookie->id_lang] = $this->getLangLink((int)$cookie->id_lang).$row['url_rewrite']; + } + + public function getPageLink($filename, $ssl = false, $id_lang = NULL) + { + global $cookie; + if ($id_lang == NULL) + $id_lang = (int)($cookie->id_lang); + + if (array_key_exists($filename.'_'.$id_lang, self::$cache['page'])) + $uri_path = self::$cache['page'][$filename.'_'.$id_lang]; + else + { + if ($this->allow == 1) + { + $url_rewrite = ''; + if ($filename != 'index.php') + { + $pagename = substr($filename, 0, -4); + $url_rewrite = Db::getInstance()->getValue(' + SELECT url_rewrite + FROM `'._DB_PREFIX_.'meta` m + LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta) + WHERE id_lang = '.(int)($id_lang).' AND `page` = \''.pSQL($pagename).'\''); + $uri_path = $this->getLangLink((int)$id_lang).($url_rewrite ? $url_rewrite : $filename); + } + else + $uri_path = $this->getLangLink((int)$id_lang); + } + else + { + $uri_path = ''; + if ($filename != 'index.php') + $uri_path = $filename; + } + self::$cache['page'][$filename.'_'.$id_lang] = $uri_path; + } + return (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)).__PS_BASE_URI__.ltrim($uri_path, '/'); + } + + public function getCatImageLink($name, $id_category, $type = null) + { + return ($this->allow == 1) ? (__PS_BASE_URI__.$id_category.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg'); + } + + /** + * Create link after language change, for the change language block + * + * @param integer $id_lang Language ID + * @return string link + */ + public function getLanguageLink($id_lang) + { + global $cookie; + $matches = array(); + $request = $_SERVER['REQUEST_URI']; + preg_match('#^/([a-z]{2})/([^\?]*).*$#', $request, $matches); + if ($matches) + { + $current_iso = $matches[1]; + $rewrite = $matches[2]; + $url_rewrite = Meta::getEquivalentUrlRewrite($id_lang, Language::getIdByIso($current_iso), $rewrite); + $request = str_replace($rewrite, $url_rewrite, $request); + } + + $queryTab = array(); + parse_str($_SERVER['QUERY_STRING'], $queryTab); + unset($queryTab['isolang']); + $query = http_build_query($queryTab); + + if (!empty($query) OR !$this->allow) + $query = '?'.$query; + + $switchLangLink = $this->getPageLink(substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__)), false, $id_lang).$query; + if (!$this->allow) + if ($id_lang != $cookie->id_lang) + { + if (strpos($switchLangLink,'id_lang')) + $switchLangLink = preg_replace('`id_lang=[0-9]*`','id_lang='.$id_lang,$switchLangLink); + else + $switchLangLink = $switchLangLink.'&id_lang='.$id_lang; + } + return $switchLangLink; + } + + /** + * @deprecated + */ + public function getLanguageLinkAdmin($id_lang) + { + Tools::displayAsDeprecated(); + return $this->getUrlWith('id_lang', (int)($id_lang)); + } + + /** + * This function return the current url with a new parameter key=value + * @param mixed $key + * @param mixed $val + * @return url with &key=val (or ?key=val) + * @deprectated + */ + public function getUrlWith($key, $val) + { + // This function does not use rewrite + Tools::displayAsDeprecated(); + $n = 0; + $url = str_replace('index.php', '', htmlentities($this->url, ENT_QUOTES, 'UTF-8')); + + foreach ($_GET as $k => $value) + // adminlang is an hand-written param in BO + if ($k != 'adminlang') + if (!is_array($value) AND $k != $key AND Tools::isSubmit($k)) + $url .= ((!$n++) ? '?' : '&').urlencode($k).($value ? '='.urlencode($value) : ''); + + return $url.($n ? '&' : '?').urlencode($key).'='.urlencode($val); + } + + public function goPage($url, $p) + { + return $url.($p == 1 ? '' : (!strstr($url, '?') ? '?' : '&').'p='.(int)($p)); + } + + public function getPaginationLink($type, $id_object, $nb = false, $sort = false, $pagination = false, $array = false) + { + if ($type AND $id_object) + $url = $this->{'get'.$type.'Link'}($id_object, NULL); + else + { + $url = $this->url; + if (Configuration::get('PS_REWRITING_SETTINGS')) + $url = $this->getPageLink(basename($url)); + } + $vars = (!$array ? '' : array()); + $varsNb = array('n', 'search_query'); + $varsSort = array('orderby', 'orderway'); + $varsPagination = array('p'); + + $n = 0; + foreach ($_GET AS $k => $value) + if ($k != 'id_'.$type) + { + if (Configuration::get('PS_REWRITING_SETTINGS') AND ($k == 'isolang' OR $k == 'id_lang')) + continue; + $ifNb = (!$nb OR ($nb AND !in_array($k, $varsNb))); + $ifSort = (!$sort OR ($sort AND !in_array($k, $varsSort))); + $ifPagination = (!$pagination OR ($pagination AND !in_array($k, $varsPagination))); + if ($ifNb AND $ifSort AND $ifPagination AND !is_array($value)) + !$array ? ($vars .= ((!$n++ AND ($this->allow == 1 OR $url == $this->url)) ? '?' : '&').urlencode($k).'='.urlencode($value)) : ($vars[urlencode($k)] = urlencode($value)); + } + if (!$array) + return $url.$vars; + $vars['requestUrl'] = $url; + if ($type AND $id_object) + $vars['id_'.$type] = (is_object($id_object) ? (int)$id_object->id : (int)$id_object); + return $vars; + } + + public function addSortDetails($url, $orderby, $orderway) + { + return $url.(!strstr($url, '?') ? '?' : '&').'orderby='.urlencode($orderby).'&orderway='.urlencode($orderway); + } + + protected function getLangLink($id_lang = NULL) + { + if (!$this->allow OR Language::countActiveLanguages() <= 1) + return ''; + + global $cookie; + if (!$id_lang) + $id_lang = (int)$cookie->id_lang; + + return Language::getIsoById((int)$id_lang).'/'; + } +} diff --git a/classes/LocalizationPack.php b/classes/LocalizationPack.php new file mode 100644 index 000000000..bc5948f30 --- /dev/null +++ b/classes/LocalizationPack.php @@ -0,0 +1,411 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(_PS_TOOL_DIR_.'tar/Archive_Tar.php'); + +class LocalizationPackCore +{ + public $name; + public $version; + + protected $iso_code_lang; + protected $iso_currency; + protected $_errors = array(); + + public function loadLocalisationPack($file, $selection, $install_mode = false) + { + if (!$xml = simplexml_load_string($file)) + return false; + $mainAttributes = $xml->attributes(); + $this->name = strval($mainAttributes['name']); + $this->version = strval($mainAttributes['version']); + if (empty($selection)) + { + $res = true; + $res &= $this->_installStates($xml); + $res &= $this->_installTaxes($xml); + $res &= $this->_installCurrencies($xml, $install_mode); + $res &= $this->_installUnits($xml); + + if (!defined('_PS_MODE_DEV_') OR !_PS_MODE_DEV_) + $res &= $this->_installLanguages($xml, $install_mode); + + if ($res AND isset($this->iso_code_lang)) + Configuration::updateValue('PS_LANG_DEFAULT', (int)Language::getIdByIso($this->iso_code_lang)); + + if ($install_mode AND $res AND isset($this->iso_currency)) + { + $res &= Configuration::updateValue('PS_CURRENCY_DEFAULT', (int)Currency::getIdByIsoCode($this->iso_currency)); + Currency::refreshCurrencies(); + } + + return $res; + } + foreach ($selection AS $selected) + if (!Validate::isLocalizationPackSelection($selected) OR !$this->{'_install'.ucfirst($selected)}($xml)) + return false; + + return true; + } + + protected function _installStates($xml) + { + if (isset($xml->states->state)) + foreach ($xml->states->state AS $data) + { + $attributes = $data->attributes(); + + if (!$id_state = State::getIdByName($attributes['name'])) + { + $state = new State(); + $state->name = strval($attributes['name']); + $state->iso_code = strval($attributes['iso_code']); + $state->id_country = Country::getByIso(strval($attributes['country'])); + $state->id_zone = (int)(Zone::getIdByName(strval($attributes['zone']))); + + if (!$state->validateFields()) + { + $this->_errors[] = Tools::displayError('Invalid state properties.'); + return false; + } + + $country = new Country($state->id_country); + if (!$country->contains_states) + { + $country->contains_states = 1; + if (!$country->update()) + $this->_errors[] = Tools::displayError('Cannot update the associated country: ').$country->name; + } + + if (!$state->add()) + { + $this->_errors[] = Tools::displayError('An error occurred while adding the state.'); + return false; + } + } else { + $state = new State($id_state); + if (!Validate::isLoadedObject($state)) + { + $this->_errors[] = Tools::displayError('An error occurred while fetching the state.'); + return false; + } + } + + // Add counties + foreach ($data->county AS $xml_county) + { + $county_attributes = $xml_county->attributes(); + if (!$id_county = County::getIdCountyByNameAndIdState($county_attributes['name'], $state->id)) + { + $county = new County(); + $county->name = $county_attributes['name']; + $county->id_state = (int)$state->id; + $county->active = 1; + + if (!$county->validateFields()) + { + $this->_errors[] = Tools::displayError('Invalid County properties'); + return false; + } + + if (!$county->save()) + { + $this->_errors[] = Tools::displayError('An error has occured while adding the county'); + return false; + } + } else { + $county = new County((int)$id_county); + if (!Validate::isLoadedObject($county)) + { + $this->_errors[] = Tools::displayError('An error occurred while fetching the county.'); + return false; + } + } + + // add zip codes + foreach ($xml_county->zipcode AS $xml_zipcode) + { + $zipcode_attributes = $xml_zipcode->attributes(); + + $zipcodes = $zipcode_attributes['from']; + if (isset($zipcode_attributes['to'])) + $zipcodes .= '-'.$zipcode_attributes['to']; + + if ($county->isZipCodeRangePresent($zipcodes)) + continue; + + if (!$county->addZipCodes($zipcodes)) + { + $this->_errors[] = Tools::displayError('An error has occured while adding zipcodes'); + return false; + } + } + } + } + + + return true; + } + + protected function _installTaxes($xml) + { + if (isset($xml->taxes->tax)) + { + $available_behavior = array(PS_PRODUCT_TAX, PS_STATE_TAX, PS_BOTH_TAX); + $assoc_taxes = array(); + foreach ($xml->taxes->tax AS $taxData) + { + $attributes = $taxData->attributes(); + if (Tax::getTaxIdByName($attributes['name'])) + continue; + $tax = new Tax(); + $tax->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] = strval($attributes['name']); + $tax->rate = (float)($attributes['rate']); + $tax->active = 1; + + if (!$tax->validateFields()) + { + $this->_errors[] = Tools::displayError('Invalid tax properties.'); + return false; + } + + if (!$tax->add()) + { + $this->_errors[] = Tools::displayError('An error occurred while importing the tax: ').strval($attributes['name']); + return false; + } + + $assoc_taxes[(int)$attributes['id']] = $tax->id; + } + + foreach ($xml->taxes->taxRulesGroup AS $group) + { + $group_attributes = $group->attributes(); + if (!Validate::isGenericName($group_attributes['name'])) + continue; + + if (TaxRulesGroup::getIdByName($group['name'])) + continue; + + $trg = new TaxRulesGroup(); + $trg->name = $group['name']; + $trg->active = 1; + + if (!$trg->save()) + { + $this->_errors = Tools::displayError('This tax rule can\'t be saved.'); + return false; + } + + foreach($group->taxRule as $rule) + { + $rule_attributes = $rule->attributes(); + + // Validation + if (!isset($rule_attributes['iso_code_country'])) + continue; + + $id_country = Country::getByIso(strtoupper($rule_attributes['iso_code_country'])); + if (!$id_country) + continue; + + if (!isset($rule_attributes['id_tax']) || !array_key_exists(strval($rule_attributes['id_tax']), $assoc_taxes)) + continue; + + // Default values + $id_state = (int) isset($rule_attributes['iso_code_state']) ? State::getIdByIso(strtoupper($rule_attributes['iso_code_state'])) : 0; + $id_county = 0; + $state_behavior = 0; + $county_behavior = 0; + + if ($id_state) + { + if (isset($rule_attributes['state_behavior']) && in_array($rule_attributes['state_behavior'], $available_behavior)) + $state_behavior = (int)$rule_attributes['state_behavior']; + + if (isset($rule_attributes['county_name'])) + { + $id_county = County::getIdCountyByNameAndIdState($rule_attributes['county_name'], (int)$id_state); + if (!$id_county) + continue; + } + + if (isset($rule_attributes['county_behavior']) && in_array($rule_attributes['state_behavior'], $available_behavior)) + $county_behavior = (int)$rule_attributes['county_behavior']; + } + + + // Creation + $tr = new TaxRule(); + $tr->id_tax_rules_group = $trg->id; + $tr->id_country = $id_country; + $tr->id_state = $id_state; + $tr->id_county = $id_county; + $tr->state_behavior = $state_behavior; + $tr->county_behavior = $county_behavior; + $tr->id_tax = $assoc_taxes[strval($rule_attributes['id_tax'])]; + $tr->save(); + } + } + } + + return true; + } + + protected function _installCurrencies($xml, $install_mode = false) + { + if (isset($xml->currencies->currency)) + { + if (!$feed = @simplexml_load_file('http://www.prestashop.com/xml/currencies.xml') AND !$feed = @simplexml_load_file(dirname(__FILE__).'/../localization/currencies.xml')) + { + $this->_errors[] = Tools::displayError('Cannot parse the currencies XML feed.'); + return false; + } + + foreach ($xml->currencies->currency AS $data) + { + $attributes = $data->attributes(); + if(Currency::exists($attributes['iso_code'])) + continue; + $currency = new Currency(); + $currency->name = strval($attributes['name']); + $currency->iso_code = strval($attributes['iso_code']); + $currency->iso_code_num = (int)($attributes['iso_code_num']); + $currency->sign = strval($attributes['sign']); + $currency->blank = (int)($attributes['blank']); + $currency->conversion_rate = 1; // This value will be updated if the store is online + $currency->format = (int)($attributes['format']); + $currency->decimals = (int)($attributes['decimals']); + $currency->active = $install_mode; + if (!$currency->validateFields()) + { + $this->_errors[] = Tools::displayError('Invalid currency properties.'); + return false; + } + if (!Currency::exists($currency->iso_code)) + { + if (!$currency->add()) + { + $this->_errors[] = Tools::displayError('An error occurred while importing the currency: ').strval($attributes['name']); + return false; + } + } + } + + Currency::refreshCurrencies(); + + if (!sizeof($this->_errors) AND $install_mode AND isset($attributes['iso_code']) AND sizeof($xml->currencies->currency) == 1) + $this->iso_currency = $attributes['iso_code']; + } + + return true; + } + + protected function _installLanguages($xml, $install_mode = false) + { + $attributes = array(); + if (isset($xml->languages->language)) + foreach ($xml->languages->language AS $data) + { + $attributes = $data->attributes(); + if (Language::getIdByIso($attributes['iso_code'])) + continue; + $native_lang = Language::getLanguages(); + $native_iso_code = array(); + foreach ($native_lang AS $lang) + $native_iso_code[] = $lang['iso_code']; + if ((in_array((string)$attributes['iso_code'], $native_iso_code) AND !$install_mode) OR !in_array((string)$attributes['iso_code'], $native_iso_code)) + if(@fsockopen('www.prestashop.com', 80, $errno = 0, $errstr = '', 10)) + { + if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code']))) + { + if ($content = file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip')) + { + $file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip'; + if (file_put_contents($file, $content)) + { + $gz = new Archive_Tar($file, true); + + if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) + { + $this->_errors[] = Tools::displayError('Cannot decompress the translation file of the language: ').(string)$attributes['iso_code']; + return false; + } + + if (!Language::checkAndAddLanguage((string)$attributes['iso_code'])) + { + $this->_errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$attributes['iso_code']; + return false; + } + + @unlink($file); + } + else + $this->_errors[] = Tools::displayError('Server does not have permissions for writing.'); + } + } + else + $this->_errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.'); + } + else + $this->_errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.'); + } + + // change the default language if there is only one language in the localization pack + if (!sizeof($this->_errors) AND $install_mode AND isset($attributes['iso_code']) AND sizeof($xml->languages->language) == 1) + $this->iso_code_lang = $attributes['iso_code']; + + return true; + } + + protected function _installUnits($xml) + { + $varNames = array('weight' => 'PS_WEIGHT_UNIT', 'volume' => 'PS_VOLUME_UNIT', 'short_distance' => 'PS_DIMENSION_UNIT', 'base_distance' => 'PS_BASE_DISTANCE_UNIT', 'long_distance' => 'PS_DISTANCE_UNIT'); + if (isset($xml->units->unit)) + foreach ($xml->units->unit AS $data) + { + $attributes = $data->attributes(); + if (!isset($varNames[strval($attributes['type'])])) + { + $this->_errors[] = Tools::displayError('Pack corrupted: wrong unit type.'); + return false; + } + if (!Configuration::updateValue($varNames[strval($attributes['type'])], strval($attributes['value']))) + { + $this->_errors[] = Tools::displayError('An error occurred while setting the units.'); + return false; + } + } + return true; + } + + public function getErrors() + { + return $this->_errors; + } +} + diff --git a/classes/Logger.php b/classes/Logger.php new file mode 100644 index 000000000..5e71eeec7 --- /dev/null +++ b/classes/Logger.php @@ -0,0 +1,161 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class LoggerCore extends ObjectModel +{ + /** @var integer Log id */ + public $id_log; + + /** @var integer Log severity */ + public $severity; + + /** @var integer Error code */ + public $error_code; + + /** @var string Message */ + public $message; + + /** @var string Object type (eg. Order, Customer...) */ + public $object_type; + + /** @var integer Object ID */ + public $object_id; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $fieldsRequired = array('severity', 'message'); + protected $fieldsSize = array(); + protected $fieldsValidate = array('id_log' => 'isUnsignedId', 'severity' => 'isInt', 'error_code' => 'isUnsignedInt', + 'message' => 'isMessage', 'object_id' => 'isUnsignedInt', 'object_type' => 'isName'); + + protected $table = 'log'; + protected $identifier = 'id_log'; + + protected static $_is_present = array(); + + + public function getFields() + { + parent::validateFields(); + + $fields['severity'] = intval($this->severity); + $fields['error_code'] = intval($this->error_code); + $fields['message'] = pSQL($this->message); + $fields['object_type'] = pSQL($this->object_type); + $fields['object_id'] = intval($this->object_id); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + + static public function sendByMail($log) + { + /* Send e-mail to the shop owner only if the minimal severity level has been reached */ + if (intval(Configuration::get('PS_LOGS_BY_EMAIL')) <= intval($log->severity)) + Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'log_alert', Mail::l('[Log] You have a new alert from your shop'), array(), Configuration::get('PS_SHOP_EMAIL')); + } + + /** + * add a log item to the database and send a mail if configured for this $severity + * + * @param string $message the log message + * @param int $severity + * @param int $errorCode + * @param string $objectType + * @param int $objectId + * @param boolean $allowDuplicate if set to true, can log several time the same information (not recommended) + * @return boolean true if succeed + */ + static public function addLog($message, $severity = 1, $errorCode = NULL, $objectType = NULL, $objectId = NULL, $allowDuplicate = false) + { + $log = new Logger(); + $log->severity = intval($severity); + $log->error_code = intval($errorCode); + $log->message = pSQL($message); + $log->date_add = date('Y-m-d H:i:s'); + $log->date_upd = date('Y-m-d H:i:s'); + if (!empty($objectType) AND !empty($objectId)) + { + $log->object_type = pSQL($objectType); + $log->object_id = intval($objectId); + } + + self::sendByMail($log); + + if ($allowDuplicate or !$log->_isPresent() ) + { + $res = $log->add(); + if ($res) + { + self::$_is_present[$log->getHash()] = isset(self::$_is_present[$log->getHash()])?self::$_is_present[$log->getHash()] + 1:1; + return true; + } + } + return false; + } + + /** + * this function md5($this->message.$this->severity.$this->error_code.$this->object_type.$this->object_id) + * + * @return string hash + */ + public function getHash(){ + if (empty($this->hash)) + $this->hash = md5($this->message.$this->severity.$this->error_code.$this->object_type.$this->object_id); + + return $this->hash; + } + + /** + * check if this log message already exists in database. + * + * @param mixed $message + * @return true if exists + */ + private function _isPresent() + { + if (!isset(self::$_is_present[md5($this->message)])) + self::$_is_present[$this->getHash()] = Db::getInstance()->getValue('SELECT COUNT(*) + FROM `'._DB_PREFIX_.'log` + WHERE + `message` = \''.$this->message.'\' + AND `severity` = \''.$this->severity.'\' + AND `error_code` = \''.$this->error_code.'\' + AND `object_type` = \''.$this->object_type.'\' + AND `object_id` = \''.$this->object_id.'\' + '); + + return self::$_is_present[$this->getHash()]; + } + +} + diff --git a/classes/MCached.php b/classes/MCached.php new file mode 100755 index 000000000..3611778f2 --- /dev/null +++ b/classes/MCached.php @@ -0,0 +1,171 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MCachedCore extends Cache +{ + protected $_memcacheObj; + protected $_isConnected = false; + + protected function __construct() + { + parent::__construct(); + return $this->connect(); + } + + public function connect() + { + $this->_memcacheObj = new Memcache(); + $servers = self::getMemcachedServers(); + if (!$servers) + return false; + foreach ($servers AS $server) + $this->_memcacheObj->addServer($server['ip'], $server['port'], $server['weight']); + + $this->_isConnected = true; + return $this->_setKeys(); + } + + public function set($key, $value, $expire = 0) + { + if (!$this->_isConnected) + return false; + if ($this->_memcacheObj->set($key, $value, 0, $expire)) + { + $this->_keysCached[$key] = true; + return $key; + } + } + + public function setNumRows($key, $value, $expire = 0) + { + return $this->set($key.'_nrows', $value, $expire); + } + + public function getNumRows($key) + { + return $this->get($key.'_nrows'); + } + + public function get($key) + { + if (!isset($this->_keysCached[$key])) + return false; + return $this->_memcacheObj->get($key); + } + + protected function _setKeys() + { + if (!$this->_isConnected) + return false; + $this->_keysCached = $this->_memcacheObj->get('keysCached'); + $this->_tablesCached = $this->_memcacheObj->get('tablesCached'); + + return true; + } + + public function setQuery($query, $result) + { + if (!$this->_isConnected) + return false; + if ($this->isBlacklist($query)) + return true; + $md5_query = md5($query); + if (isset($this->_keysCached[$md5_query])) + return true; + $key = $this->set($md5_query, $result); + if(preg_match_all('/('._DB_PREFIX_.'[a-z_-]*)`?.*/i', $query, $res)) + foreach($res[1] AS $table) + if(!isset($this->_tablesCached[$table][$key])) + $this->_tablesCached[$table][$key] = true; + } + + public function delete($key, $timeout = 0) + { + if (!$this->_isConnected) + return false; + if (!empty($key) AND $this->_memcacheObj->delete($key, $timeout)) + unset($this->_keysCached[$key]); + } + + public function deleteQuery($query) + { + if (!$this->_isConnected) + return false; + if (preg_match_all('/('._DB_PREFIX_.'[a-z_-]*)`?.*/i', $query, $res)) + foreach ($res[1] AS $table) + if (isset($this->_tablesCached[$table])) + { + foreach ($this->_tablesCached[$table] AS $memcachedKey => $foo) + { + $this->delete($memcachedKey); + $this->delete($memcachedKey.'_nrows'); + } + unset($this->_tablesCached[$table]); + } + } + + protected function close() + { + if (!$this->_isConnected) + return false; + return $this->_memcacheObj->close(); + } + + public function flush() + { + if(!$this->_isConnected) + return false; + if ($this->_memcacheObj->flush()) + return $this->_setKeys(); + return false; + } + + public function __destruct() + { + parent::__destruct(); + if (!$this->_isConnected) + return false; + $this->_memcacheObj->set('keysCached', $this->_keysCached, 0, 0); + $this->_memcacheObj->set('tablesCached', $this->_tablesCached, 0, 0); + $this->close(); + } + + public static function addServer($ip, $port, $weight) + { + return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'memcached_servers (id_memcached_server, ip, port, weight) VALUES(\'\', \''.pSQL($ip).'\', '.(int)$port.', '.(int)$weight.')', false); + } + + public static function getMemcachedServers() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM '._DB_PREFIX_.'memcached_servers', true, false); + } + + public static function deleteServer($id_server) + { + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'memcached_servers WHERE id_memcached_server='.(int)$id_server); + } +} diff --git a/classes/Mail.php b/classes/Mail.php new file mode 100644 index 000000000..8e09dac42 --- /dev/null +++ b/classes/Mail.php @@ -0,0 +1,228 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(_PS_SWIFT_DIR_.'Swift.php'); +include_once(_PS_SWIFT_DIR_.'Swift/Connection/SMTP.php'); +include_once(_PS_SWIFT_DIR_.'Swift/Connection/NativeMail.php'); +include_once(_PS_SWIFT_DIR_.'Swift/Plugin/Decorator.php'); + +class MailCore +{ + static public function Send($id_lang, $template, $subject, $templateVars, $to, $toName = NULL, $from = NULL, $fromName = NULL, $fileAttachment = NULL, $modeSMTP = NULL, $templatePath = _PS_MAIL_DIR_) + { + $configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_SMTP_ENCRYPTION', 'PS_MAIL_SMTP_PORT', 'PS_MAIL_METHOD', 'PS_MAIL_TYPE')); + if(!isset($configuration['PS_MAIL_SMTP_ENCRYPTION'])) $configuration['PS_MAIL_SMTP_ENCRYPTION'] = 'off'; + if(!isset($configuration['PS_MAIL_SMTP_PORT'])) $configuration['PS_MAIL_SMTP_PORT'] = 'default'; + + if (!isset($from)) $from = $configuration['PS_SHOP_EMAIL']; + if (!isset($fromName)) $fromName = $configuration['PS_SHOP_NAME']; + + if (!empty($from) AND !Validate::isEmail($from)) + die(Tools::displayError('Error: parameter "from" is corrupted')); + + if (!empty($fromName) AND !Validate::isMailName($fromName)) + die(Tools::displayError('Error: parameter "fromName" is corrupted')); + + if (!is_array($to) AND !Validate::isEmail($to)) + die(Tools::displayError('Error: parameter "to" is corrupted')); + + if (!is_array($templateVars)) + die(Tools::displayError('Error: parameter "templateVars" is not an array')); + + // Do not crash for this error, that may be a complicated customer name + if (!empty($toName) AND !Validate::isMailName($toName)) + $toName = NULL; + + if (!Validate::isTplName($template)) + die(Tools::displayError('Error: invalid email template')); + + if (!Validate::isMailSubject($subject)) + die(Tools::displayError('Error: invalid email subject')); + + /* Construct multiple recipients list if needed */ + if (is_array($to)) + { + $to_list = new Swift_RecipientList(); + foreach ($to AS $key => $addr) + { + $to_name = NULL; + $addr = trim($addr); + if (!Validate::isEmail($addr)) + die(Tools::displayError('Error: invalid email address')); + if ($toName AND is_array($toName) AND Validate::isGenericName($toName[$key])) + $to_name = $toName[$key]; + $to_list->addTo($addr, $to_name); + } + $to_plugin = $to[0]; + $to = $to_list; + } else { + /* Simple recipient, one address */ + $to_plugin = $to; + $to = new Swift_Address($to, $toName); + } + try { + /* Connect with the appropriate configuration */ + if ($configuration['PS_MAIL_METHOD'] == 2) + { + if (empty($configuration['PS_MAIL_SERVER']) OR empty($configuration['PS_MAIL_SMTP_PORT'])) + die(Tools::displayError('Error: invalid SMTP server or SMTP port')); + + $connection = new Swift_Connection_SMTP($configuration['PS_MAIL_SERVER'], $configuration['PS_MAIL_SMTP_PORT'], ($configuration['PS_MAIL_SMTP_ENCRYPTION'] == "ssl") ? Swift_Connection_SMTP::ENC_SSL : (($configuration['PS_MAIL_SMTP_ENCRYPTION'] == "tls") ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_OFF)); + $connection->setTimeout(4); + if (!$connection) + return false; + if (!empty($configuration['PS_MAIL_USER'])) + $connection->setUsername($configuration['PS_MAIL_USER']); + if (!empty($configuration['PS_MAIL_PASSWD'])) + $connection->setPassword($configuration['PS_MAIL_PASSWD']); + } + else + $connection = new Swift_Connection_NativeMail(); + + if (!$connection) + return false; + $swift = new Swift($connection, Configuration::get('PS_MAIL_DOMAIN')); + /* Get templates content */ + $iso = Language::getIsoById((int)($id_lang)); + if (!$iso) + die (Tools::displayError('Error - No ISO code for email')); + $template = $iso.'/'.$template; + + $moduleName = false; + $overrideMail = false; + + // get templatePath + if (preg_match('#'.__PS_BASE_URI__.'modules/#', $templatePath) AND preg_match('#modules/([a-z0-9_-]+)/#ui' , $templatePath , $res)) + $moduleName = $res[1]; + + if ($moduleName !== false AND (file_exists(_PS_THEME_DIR_.'modules/'.$moduleName.'/mails/'.$template.'.txt') OR + file_exists(_PS_THEME_DIR_.'modules/'.$moduleName.'/mails/'.$template.'.html'))) + $templatePath = _PS_THEME_DIR_.'modules/'.$moduleName.'/mails/'; + elseif (file_exists(_PS_THEME_DIR_.'mails/'.$template.'.txt') OR file_exists(_PS_THEME_DIR_.'mails/'.$template.'.html')) + { + $templatePath = _PS_THEME_DIR_.'mails/'; + $overrideMail = true; + } + elseif (!file_exists($templatePath.$template.'.txt') OR !file_exists($templatePath.$template.'.html')) + die(Tools::displayError('Error - The following email template is missing:').' '.$templatePath.$template.'.txt'); + + $templateHtml = file_get_contents($templatePath.$template.'.html'); + $templateTxt = strip_tags(html_entity_decode(file_get_contents($templatePath.$template.'.txt'), NULL, 'utf-8')); + + if ($overrideMail AND file_exists($templatePath.$iso.'/lang.php')) + include_once($templatePath.$iso.'/lang.php'); + elseif ($moduleName AND file_exists($templatePath.$iso.'/lang.php')) + include_once(_PS_THEME_DIR_.'mails/'.$iso.'/lang.php'); + else + include_once(dirname(__FILE__).'/../mails/'.$iso.'/lang.php'); + + /* Create mail and attach differents parts */ + $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '. $subject); + $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail.jpg'))) : ((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : ''); + $templateVars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME')); + $templateVars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__; + $swift->attachPlugin(new Swift_Plugin_Decorator(array($to_plugin => $templateVars)), 'decorator'); + if ($configuration['PS_MAIL_TYPE'] == 3 OR $configuration['PS_MAIL_TYPE'] == 2) + $message->attach(new Swift_Message_Part($templateTxt, 'text/plain', '8bit', 'utf-8')); + if ($configuration['PS_MAIL_TYPE'] == 3 OR $configuration['PS_MAIL_TYPE'] == 1) + $message->attach(new Swift_Message_Part($templateHtml, 'text/html', '8bit', 'utf-8')); + if ($fileAttachment AND isset($fileAttachment['content']) AND isset($fileAttachment['name']) AND isset($fileAttachment['mime'])) + $message->attach(new Swift_Message_Attachment($fileAttachment['content'], $fileAttachment['name'], $fileAttachment['mime'])); + /* Send mail */ + $send = $swift->send($message, $to, new Swift_Address($from, $fromName)); + $swift->disconnect(); + return $send; + } + + catch (Swift_ConnectionException $e) { return false; } + } + + static public function sendMailTest($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption) + { + $swift = NULL; + $result = NULL; + try + { + if($smtpChecked) + { + + $smtp = new Swift_Connection_SMTP($smtpServer, $smtpPort, ($smtpEncryption == "off") ? Swift_Connection_SMTP::ENC_OFF : (($smtpEncryption == "tls") ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_SSL)); + $smtp->setUsername($smtpLogin); + $smtp->setpassword($smtpPassword); + $smtp->setTimeout(5); + $swift = new Swift($smtp, Configuration::get('PS_MAIL_DOMAIN')); + } + else + $swift = new Swift(new Swift_Connection_NativeMail(), Configuration::get('PS_MAIL_DOMAIN')); + + $message = new Swift_Message($subject, $content, $type); + + if ($swift->send($message, $to, $from)) + $result = true; + else + $result = 999; + + $swift->disconnect(); + } + catch (Swift_Connection_Exception $e) { $result = $e->getCode(); } + catch (Swift_Message_MimeException $e) { $result = $e->getCode(); } + + return $result; + } + + /** + * This method is used to get the translation for email Object. + * For an object is forbidden to use htmlentities, + * we have to return a sentence with accents. + * + * @param string $string raw sentence (write directly in file) + */ + static public function l($string) + { + global $_LANGMAIL, $cookie; + + $key = str_replace('\'', '\\\'', $string); + $id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)Configuration::get('PS_LANG_DEFAULT') : (int)$cookie->id_lang; + + $file_core = _PS_ROOT_DIR_.'/mails/'.Language::getIsoById((int)$id_lang).'/lang.php'; + if (Tools::file_exists_cache($file_core) && empty($_LANGMAIL)) + include_once($file_core); + + $file_theme = _PS_THEME_DIR_.'mails/'.Language::getIsoById((int)$id_lang).'/lang.php'; + if (Tools::file_exists_cache($file_theme)) + include_once($file_theme); + + if (!is_array($_LANGMAIL)) + return (str_replace('"', '"', $string)); + if (key_exists($key, $_LANGMAIL)) + $str = $_LANGMAIL[$key]; + else + $str = $string; + + return str_replace('"', '"', addslashes($str)); + } +} diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php new file mode 100644 index 000000000..4e57bf86c --- /dev/null +++ b/classes/Manufacturer.php @@ -0,0 +1,363 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ManufacturerCore extends ObjectModel +{ + public $id; + + /** @var integer manufacturer ID */ + public $id_manufacturer;//FIXME is it really usefull...? + + /** @var string Name */ + public $name; + + /** @var string A description */ + public $description; + + /** @var string A short description */ + public $short_description; + + /** @var int Address */ + public $id_address; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + /** @var string Friendly URL */ + public $link_rewrite; + + /** @var string Meta title */ + public $meta_title; + + /** @var string Meta keywords */ + public $meta_keywords; + + /** @var string Meta description */ + public $meta_description; + + /** @var boolean active */ + public $active; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 64); + protected $fieldsValidate = array('name' => 'isCatalogName'); + + protected $fieldsSizeLang = array('short_description' => 254, 'meta_title' => 128, 'meta_description' => 255, 'meta_description' => 255); + protected $fieldsValidateLang = array('description' => 'isString', 'short_description' => 'isString', 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName'); + + protected $table = 'manufacturer'; + protected $identifier = 'id_manufacturer'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_address' => array('xlink_resource'=> 'addresses'), + 'link_rewrite' => array(), + ), + ); + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id, $id_lang); + + /* Get the manufacturer's id_address */ + $this->id_address = $this->getManufacturerAddress(); + + $this->link_rewrite = $this->getLink(); + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_manufacturer'] = (int)($this->id); + $fields['name'] = pSQL($this->name); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['active'] = (int)($this->active); + return $fields; + } + + public function getTranslationsFieldsChild() + { + $fieldsArray = array('description', 'short_description', 'meta_title', 'meta_keywords', 'meta_description'); + $fields = array(); + $languages = Language::getLanguages(false); + $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = $language['id_lang']; + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + $fields[$language['id_lang']]['description'] = (isset($this->description[$language['id_lang']])) ? pSQL($this->description[$language['id_lang']], true) : ''; + $fields[$language['id_lang']]['short_description'] = (isset($this->short_description[$language['id_lang']])) ? pSQL($this->short_description[$language['id_lang']], true) : ''; + + foreach ($fieldsArray as $field) + { + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + + /* Check fields validity */ + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']], true); + elseif (in_array($field, $this->fieldsRequiredLang)) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); + else + $fields[$language['id_lang']][$field] = ''; + + } + } + return $fields; + } + + public function delete() + { + $address = new Address($this->id_address); + if (!$address->delete()) + return false; + return parent::delete(); + } + + /** + * Delete several objects from database + * + * return boolean Deletion result + */ + public function deleteSelection($selection) + { + if (!is_array($selection) OR !Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $result = true; + foreach ($selection AS $id) + { + $this->id = (int)($id); + $this->id_address = self::getManufacturerAddress(); + $result = $result AND $this->delete(); + } + return $result; + } + + protected function getManufacturerAddress() + { + if (!(int)($this->id)) + return false; + $result = Db::GetInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT `id_address` FROM '._DB_PREFIX_.'address WHERE `id_manufacturer` = '.(int)($this->id)); + if (!$result) + return false; + return $result['id_address']; + } + + /** + * Return manufacturers + * + * @param boolean $getNbProducts [optional] return products numbers for each + * @return array Manufacturers + */ + static public function getManufacturers($getNbProducts = false, $id_lang = 0, $active = true, $p = false, $n = false, $all_group = false) + { + if (!$id_lang) + $id_lang = (int)Configuration::get('PS_LANG_DEFAULT'); + $sql = 'SELECT m.*, ml.`description`'; + $sql.= ' FROM `'._DB_PREFIX_.'manufacturer` m + LEFT JOIN `'._DB_PREFIX_.'manufacturer_lang` ml ON (m.`id_manufacturer` = ml.`id_manufacturer` AND ml.`id_lang` = '.(int)($id_lang).') + '.($active ? ' WHERE m.`active` = 1' : ''); + $sql.= ' ORDER BY m.`name` ASC'.($p ? ' LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n) : ''); + $manufacturers = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + if ($manufacturers === false) + return false; + if ($getNbProducts) + { + $sqlGroups = ''; + if (!$all_group) + { + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + } + foreach ($manufacturers as $key => $manufacturer) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) + WHERE m.`id_manufacturer` = '.(int)($manufacturer['id_manufacturer']). + ($active ? ' AND p.`active` = 1 ' : ''). + ($all_group ? '' : ' AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.')')); + + $manufacturers[$key]['nb_products'] = sizeof($result); + } + } + for ($i = 0; $i < sizeof($manufacturers); $i++) + if ((int)(Configuration::get('PS_REWRITING_SETTINGS'))) + $manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false); + else + $manufacturers[$i]['link_rewrite'] = 0; + return $manufacturers; + } + + /** + * @deprecated + */ + static public function getManufacturersWithoutAddress() + { + Tools::displayAsDeprecated(); + $sql = 'SELECT m.* FROM `'._DB_PREFIX_.'manufacturer` m + LEFT JOIN `'._DB_PREFIX_.'address` a ON (a.`id_manufacturer` = m.`id_manufacturer` AND a.`deleted` = 0) + WHERE a.`id_manufacturer` IS NULL'; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + } + + /** + * Return name from id + * + * @param integer $id_manufacturer Manufacturer ID + * @return string name + */ + static protected $cacheName = array(); + static public function getNameById($id_manufacturer) + { + if (!isset(self::$cacheName[$id_manufacturer])) + self::$cacheName[$id_manufacturer] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `name` FROM `'._DB_PREFIX_.'manufacturer` WHERE `id_manufacturer` = '.(int)($id_manufacturer).' AND `active` = 1'); + return self::$cacheName[$id_manufacturer]; + } + + static public function getIdByName($name) + { + $result = Db::getInstance()->getRow(' + SELECT `id_manufacturer` + FROM `'._DB_PREFIX_.'manufacturer` + WHERE `name` = \''.pSQL($name).'\''); + if (isset($result['id_manufacturer'])) + return (int)($result['id_manufacturer']); + return false; + } + + public function getLink() + { + return Tools::link_rewrite($this->name, false); + } + + static public function getProducts($id_manufacturer, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true) + { + if ($p < 1) $p = 1; + if (empty($orderBy) ||$orderBy == 'position') $orderBy = 'name'; + if (empty($orderWay)) $orderWay = 'ASC'; + + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die (Tools::displayError()); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + /* Return only the number of products */ + if ($getTotal) + { + $sql = ' + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.id_manufacturer = '.(int)($id_manufacturer) + .($active ? ' AND p.`active` = 1' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + )'; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + return (int)(sizeof($result)); + } + $sql = ' + SELECT p.*, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new, + (p.`price` * ((100 + (t.`rate`))/100)) AS orderprice + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND default_on = 1) + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + WHERE p.`id_manufacturer` = '.(int)($id_manufacturer).($active ? ' AND p.`active` = 1' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY '.(($orderBy == 'id_product') ? 'p.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + if (!$result) + return false; + if ($orderBy == 'price') + Tools::orderbyPrice($result, $orderWay); + return Product::getProductsProperties($id_lang, $result); + } + + public function getProductsLite($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, pl.`name` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + WHERE p.`id_manufacturer` = '.(int)($this->id)); + } + /* + * Specify if a manufacturer already in base + * + * @param $id_manufacturer Manufacturer id + * @return boolean + */ + static public function manufacturerExists($id_manufacturer) + { + $row = Db::getInstance()->getRow(' + SELECT `id_manufacturer` + FROM '._DB_PREFIX_.'manufacturer m + WHERE m.`id_manufacturer` = '.(int)($id_manufacturer)); + + return isset($row['id_manufacturer']); + } + + public function getAddresses($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT a.*, cl.name AS `country`, s.name AS `state` + FROM `'._DB_PREFIX_.'address` AS a + LEFT JOIN `'._DB_PREFIX_.'country_lang` AS cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'state` AS s ON (s.`id_state` = a.`id_state`) + WHERE `id_manufacturer` = '.(int)($this->id).' + AND a.`deleted` = 0'); + } +} + diff --git a/classes/Message.php b/classes/Message.php new file mode 100644 index 000000000..045304463 --- /dev/null +++ b/classes/Message.php @@ -0,0 +1,165 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MessageCore extends ObjectModel +{ + public $id; + + /** @var string message content */ + public $message; + + /** @var integer Cart ID (if applicable) */ + public $id_cart; + + /** @var integer Order ID (if applicable) */ + public $id_order; + + /** @var integer Customer ID (if applicable) */ + public $id_customer; + + /** @var integer Employee ID (if applicable) */ + public $id_employee; + + /** @var boolean Message is not displayed to the customer */ + public $private; + + /** @var string Object creation date */ + public $date_add; + + protected $fieldsRequired = array('message'); + protected $fieldsSize = array('message' => 1600); + protected $fieldsValidate = array( + 'message' => 'isCleanHtml', 'id_cart' => 'isUnsignedId', 'id_order' => 'isUnsignedId', + 'id_customer' => 'isUnsignedId', 'id_employee' => 'isUnsignedId', 'private' => 'isBool'); + + protected $table = 'message'; + protected $identifier = 'id_message'; + + public function getFields() + { + parent::validateFields(); + + $fields['message'] = pSQL($this->message, true); + $fields['id_cart'] = (int)($this->id_cart); + $fields['id_order'] = (int)($this->id_order); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_employee'] = (int)($this->id_employee); + $fields['private'] = (int)($this->private); + $fields['date_add'] = pSQL($this->date_add); + + return $fields; + } + + /** + * Return the last message from cart + * + * @param integer $id_cart Cart ID + * @return array Message + */ + static public function getMessageByCartId($id_cart) + { + $db = Db::getInstance(); + $result = $db->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'message` + WHERE `id_cart` = '.(int)($id_cart)); + + return $result; + } + + /** + * Return messages from Order ID + * + * @param integer $id_order Order ID + * @param boolean $private return WITH private messages + * @return array Messages + */ + static public function getMessagesByOrderId($id_order, $private = false) + { + if (!Validate::isBool($private)) + die(Tools::displayError()); + + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me + FROM `'._DB_PREFIX_.'message` m + LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` + LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON (mr.id_message = m.id_message AND mr.id_employee = '.(int)$cookie->id_employee.') + LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` + WHERE id_order = '.(int)$id_order.' + '.(!$private ? ' AND m.`private` = 0' : '').' + GROUP BY m.id_message + ORDER BY m.date_add DESC'); + } + + /** + * Return messages from Cart ID + * + * @param integer $id_order Order ID + * @param boolean $private return WITH private messages + * @return array Messages + */ + static public function getMessagesByCartId($id_cart, $private = false) + { + if (!Validate::isBool($private)) + die(Tools::displayError()); + + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me + FROM `'._DB_PREFIX_.'message` m + LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` + LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON (mr.id_message = m.id_message AND mr.id_employee = '.(int)$cookie->id_employee.') + LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` + WHERE id_cart = '.(int)$id_cart.' + '.(!$private ? ' AND m.`private` = 0' : '').' + GROUP BY m.id_message + ORDER BY m.date_add DESC'); + } + + /** + * Registered a message 'readed' + * + * @param integer $id_message Message ID + * @param integer $id_emplyee Employee ID + */ + static public function markAsReaded($id_message, $id_employee) + { + if (!Validate::isUnsignedId($id_message) OR !Validate::isUnsignedId($id_employee)) + die(Tools::displayError()); + + $result = Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'message_readed (id_message , id_employee , date_add) VALUES + ('.(int)($id_message).', '.(int)($id_employee).', NOW()); + '); + return $result; + } +} + + diff --git a/classes/Meta.php b/classes/Meta.php new file mode 100644 index 000000000..363629e97 --- /dev/null +++ b/classes/Meta.php @@ -0,0 +1,184 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MetaCore extends ObjectModel +{ + /** @var string Name */ + public $page; + + public $title; + public $description; + public $keywords; + public $url_rewrite; + + protected $fieldsRequired = array('page'); + protected $fieldsSize = array('page' => 64); + protected $fieldsValidate = array('page' => 'isFileName'); + + protected $fieldsRequiredLang = array(); + protected $fieldsSizeLang = array('title' => 128, 'description' => 255, 'keywords' => 255, 'url_rewrite' => 255); + protected $fieldsValidateLang = array('title' => 'isGenericName', 'description' => 'isGenericName', 'keywords' => 'isGenericName', 'url_rewrite' => 'isLinkRewrite'); + + protected $table = 'meta'; + protected $identifier = 'id_meta'; + + public function getFields() + { + parent::validateFields(); + return array('page' => pSQL($this->page)); + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('title', 'description', 'keywords', 'url_rewrite')); + } + + static public function getPages($excludeFilled = false, $addPage = false) + { + $selectedPages = array(); + if (!$files = scandir(_PS_ROOT_DIR_)) + die(Tools::displayError('Cannot scan root directory')); + + // Exclude pages forbidden + $exludePages = array('category', 'changecurrency', 'cms', 'footer', 'header', 'images.inc', 'init', + 'pagination', 'product', 'product-sort', 'statistics'); + foreach ($files as $file) + if (preg_match('/^[a-z0-9_.-]*\.php$/i', $file) AND !in_array(str_replace('.php', '', $file), $exludePages)) + $selectedPages[] = str_replace('.php', '', $file); + // Exclude page already filled + if ($excludeFilled) + { + $metas = self::getMetas(); + foreach ($metas as $k => $meta) + if (in_array($meta['page'], $selectedPages)) + unset($selectedPages[array_search($meta['page'], $selectedPages)]); + } + // Add selected page + if ($addPage) + { + $selectedPages[] = $addPage; + sort($selectedPages); + } + return $selectedPages; + } + + static public function getMetas() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'meta + ORDER BY page ASC'); + } + + static public function getMetasByIdLang($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'meta` m + LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON m.`id_meta` = ml.`id_meta` + WHERE ml.`id_lang` = '.(int)($id_lang).' + ORDER BY page ASC'); + + } + + static public function getMetaByPage($page, $id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT * + FROM '._DB_PREFIX_.'meta m + LEFT JOIN '._DB_PREFIX_.'meta_lang ml on (m.id_meta = ml.id_meta) + WHERE m.page = \''.pSQL($page).'\' AND ml.id_lang = '.(int)($id_lang)); + } + + public function update($nullValues = false) + { + if (!parent::update($nullValues)) + return false; + + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + public function add($autodate = true, $nullValues = false) + { + if (!parent::add($autodate, $nullValues)); + + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + public function delete() + { + if (!parent::delete()) + return false; + + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + public function deleteSelection($selection) + { + if (!is_array($selection) OR !Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $result = true; + foreach ($selection AS $id) + { + $this->id = (int)($id); + $result = $result AND $this->delete(); + } + + return Tools::generateHtaccess(dirname(__FILE__).'/../.htaccess', + (int)(Configuration::get('PS_REWRITING_SETTINGS')), + (int)(Configuration::get('PS_HTACCESS_CACHE_CONTROL')), + Configuration::get('PS_HTACCESS_SPECIFIC') + ); + } + + static public function getEquivalentUrlRewrite($new_id_lang, $id_lang, $url_rewrite) + { + return Db::getInstance()->getValue(' + SELECT url_rewrite + FROM `'._DB_PREFIX_.'meta_lang` + WHERE id_meta = ( + SELECT id_meta + FROM `'._DB_PREFIX_.'meta_lang` + WHERE url_rewrite = \''.pSQL($url_rewrite).'\' AND id_lang = '.(int)($id_lang).' + ) + AND id_lang = '.(int)($new_id_lang)); + } +} + diff --git a/classes/Module.php b/classes/Module.php new file mode 100644 index 000000000..91028c119 --- /dev/null +++ b/classes/Module.php @@ -0,0 +1,932 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ModuleCore +{ + /** @var integer Module ID */ + public $id = NULL; + + /** @var float Version */ + public $version; + + /** @var string Unique name */ + public $name; + + /** @var string Human name */ + public $displayName; + + /** @var string A little description of the module */ + public $description; + + /** @var string author of the module */ + public $author; + + /** @var string Admin tab correponding to the module */ + public $tab = NULL; + + /** @var boolean Status */ + public $active = false; + + /** @var array current language translations */ + protected $_lang = array(); + + /** @var string Module web path (eg. '/shop/modules/modulename/') */ + protected $_path = NULL; + + /** @var string Fill it if the module is installed but not yet set up */ + public $warning; + + /** @var string Message display before uninstall a module */ + public $beforeUninstall = NULL; + + public $_errors = false; + + protected $table = 'module'; + + protected $identifier = 'id_module'; + + static public $_db; + + /** @var array to store the limited country */ + public $limited_countries = array(); + + /** + * Constructor + * + * @param string $name Module unique name + */ + protected static $modulesCache; + protected static $_hookModulesCache; + + protected static $_INSTANCE = array(); + + protected static $_generateConfigXmlMode = false; + + protected static $l_cache = array(); + + /** + * @var array used by AdminTab to determine which lang file to use (admin.php or module lang file) + */ + public static $classInModule = array(); + + public function __construct($name = NULL) + { + global $cookie; + + if ($this->name == NULL) + $this->name = $this->id; + if ($this->name != NULL) + { + if (self::$modulesCache == NULL AND !is_array(self::$modulesCache)) + { + self::$modulesCache = array(); + $result = Db::getInstance()->ExecuteS('SELECT * FROM `'.pSQL(_DB_PREFIX_.$this->table).'`'); + foreach ($result as $row) + self::$modulesCache[$row['name']] = $row; + } + if (!isset(self::$modulesCache[$this->name])) + return false; + $this->active = true; + $this->id = self::$modulesCache[$this->name]['id_module']; + foreach (self::$modulesCache[$this->name] AS $key => $value) + if (key_exists($key, $this)) + $this->{$key} = $value; + $this->_path = __PS_BASE_URI__.'modules/'.$this->name.'/'; + } + } + + /** + * Insert module into datable + */ + public function install() + { + if (!Validate::isModuleName($this->name)) + die(Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT `id_module` + FROM `'._DB_PREFIX_.'module` + WHERE `name` = \''.pSQL($this->name).'\''); + if ($result) + return false; + $result = Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table, array('name' => $this->name, 'active' => 1), 'INSERT'); + if (!$result) + return false; + $this->id = Db::getInstance()->Insert_ID(); + return true; + } + + /** + * Delete module from datable + * + * @return boolean result + */ + public function uninstall() + { + if (!Validate::isUnsignedId($this->id)) + return false; + $result = Db::getInstance()->ExecuteS(' + SELECT `id_hook` + FROM `'._DB_PREFIX_.'hook_module` hm + WHERE `id_module` = '.(int)($this->id)); + foreach ($result AS $row) + { + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_module` = '.(int)($this->id).' + AND `id_hook` = '.(int)($row['id_hook'])); + $this->cleanPositions($row['id_hook']); + } + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'module` + WHERE `id_module` = '.(int)($this->id)); + } + + /** + * Called when module is set to active + */ + public function enable() + { + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'module` + SET `active`= 1 + WHERE `name` = \''.pSQL($this->name).'\''); + } + + /** + * Called when module is set to deactive + */ + public function disable() + { + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'module` + SET `active`= 0 + WHERE `name` = \''.pSQL($this->name).'\''); + } + + /** + * Connect module to a hook + * + * @param string $hook_name Hook name + * @return boolean result + */ + public function registerHook($hook_name) + { + if (!Validate::isHookName($hook_name)) + die(Tools::displayError()); + if (!isset($this->id) OR !is_numeric($this->id)) + return false; + + // Check if already register + $result = Db::getInstance()->getRow(' + SELECT hm.`id_module` FROM `'._DB_PREFIX_.'hook_module` hm, `'._DB_PREFIX_.'hook` h + WHERE hm.`id_module` = '.(int)($this->id).' + AND h.`name` = \''.pSQL($hook_name).'\' + AND h.`id_hook` = hm.`id_hook`'); + if ($result) + return true; + + // Get hook id + $result = Db::getInstance()->getRow(' + SELECT `id_hook` + FROM `'._DB_PREFIX_.'hook` + WHERE `name` = \''.pSQL($hook_name).'\''); + if (!isset($result['id_hook'])) + return false; + + // Get module position in hook + $result2 = Db::getInstance()->getRow(' + SELECT MAX(`position`) AS position + FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_hook` = '.(int)($result['id_hook'])); + if (!$result2) + return false; + + // Register module in hook + $return = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) + VALUES ('.(int)($this->id).', '.(int)($result['id_hook']).', '.(int)($result2['position'] + 1).')'); + + $this->cleanPositions((int)($result['id_hook'])); + + return $return; + } + + /** + * Display flags in forms for translations + * + * @param array $languages All languages available + * @param integer $defaultLanguage Default language id + * @param string $ids Multilingual div ids in form + * @param string $id Current div id] + * #param boolean $return define the return way : false for a display, true for a return + */ + public function displayFlags($languages, $defaultLanguage, $ids, $id, $return = false) + { + if (sizeof($languages) == 1) + return false; + $output = ' +
+ +
+
+ '.$this->l('Choose language:').'

'; + foreach ($languages as $language) + $output .= ''.$language['name'].' '; + $output .= '
'; + + if ($return) + return $output; + echo $output; + } + + /** + * Unregister module from hook + * + * @param int $id_hook Hook id + * @return boolean result + */ + public function unregisterHook($hook_id) + { + return Db::getInstance()->Execute(' + DELETE + FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_module` = '.(int)($this->id).' + AND `id_hook` = '.(int)($hook_id)); + } + + /** + * Unregister exceptions linked to module + * + * @param int $id_hook Hook id + * @return boolean result + */ + public function unregisterExceptions($hook_id) + { + return Db::getInstance()->Execute(' + DELETE + FROM `'._DB_PREFIX_.'hook_module_exceptions` + WHERE `id_module` = '.(int)($this->id).' + AND `id_hook` = '.(int)($hook_id)); + } + + /** + * Add exceptions for module->Hook + * + * @param int $id_hook Hook id + * @param array $excepts List of file name + * @return boolean result + */ + public function registerExceptions($id_hook, $excepts) + { + foreach ($excepts AS $except) + { + if (!empty($except)) + { + $result = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook_module_exceptions` (`id_module`, `id_hook`, `file_name`) + VALUES ('.(int)($this->id).', '.(int)($id_hook).', \''.pSQL(strval($except)).'\')'); + if (!$result) + return false; + } + } + return true; + } + + public function editExceptions($id_hook, $excepts) + { + // Cleaning... + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'hook_module_exceptions` + WHERE `id_module` = '.(int)($this->id).' AND `id_hook` ='.(int)($id_hook)); + return $this->registerExceptions($id_hook, $excepts); + } + + + /** + * This function is used to determine the module name + * of an AdminTab which belongs to a module, in order to keep translation + * related to a module in its directory (instead of $_LANGADM) + * + * @param mixed $currentClass the + * @return boolean|string if the class belongs to a module, will return the module name. Otherwise, return false. + */ + public static function getModuleNameFromClass($currentClass) + { + // Module can now define AdminTab keeping the module translations method, + // i.e. in modules/[module name]/[iso_code].php + if (!isset(self::$classInModule[$currentClass])) + { + global $_MODULES; + $_MODULE = array(); + $reflectionClass = new ReflectionClass($currentClass); + $filePath = realpath($reflectionClass->getFileName()); + $realpathModuleDir = realpath(_PS_MODULE_DIR_); + if (substr(realpath($filePath), 0, strlen($realpathModuleDir)) == $realpathModuleDir) + { + self::$classInModule[$currentClass] = substr(dirname($filePath), strlen($realpathModuleDir)+1); + + $id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)(Configuration::get('PS_LANG_DEFAULT')) : (int)($cookie->id_lang); + $file = _PS_MODULE_DIR_.self::$classInModule[$currentClass].'/'.Language::getIsoById($id_lang).'.php'; + if (Tools::file_exists_cache($file) AND include_once($file)) + $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; + } + else + self::$classInModule[$currentClass] = false; + } + // return name of the module, or false + return self::$classInModule[$currentClass]; + } + + /** + * Return an instance of the specified module + * + * @param string $moduleName Module name + * @return Module instance + */ + static public function getInstanceByName($moduleName) + { + if (!Tools::file_exists_cache(_PS_MODULE_DIR_.$moduleName.'/'.$moduleName.'.php')) + return false; + include_once(_PS_MODULE_DIR_.$moduleName.'/'.$moduleName.'.php'); + if (!class_exists($moduleName, false)) + return false; + + if (!isset(self::$_INSTANCE[$moduleName])) + self::$_INSTANCE[$moduleName] = new $moduleName; + return self::$_INSTANCE[$moduleName]; + } + + /** + * Return an instance of the specified module + * + * @param integer $id_module Module ID + * @return Module instance + */ + static public function getInstanceById($id_module) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name` + FROM `'._DB_PREFIX_.'module` + WHERE `id_module` = '.(int)($id_module)); + return ($result ? Module::getInstanceByName($result['name']) : false); + } + + /** + * Return available modules + * + * @param boolean $useConfig in order to use config.xml file in module dir + * @return array Modules + */ + public static function getModulesOnDisk($useConfig = false) + { + global $cookie, $_MODULES; + + $moduleList = array(); + $errors = array(); + $modules_dir = self::getModulesDirOnDisk(); + foreach ($modules_dir AS $module) + { + $configFile = _PS_MODULE_DIR_.$module.'/config.xml'; + $xml_exist = file_exists($configFile); + if ($xml_exist) + $needNewConfigFile = (filemtime($configFile) < filemtime(_PS_MODULE_DIR_.$module.'/'.$module.'.php')); + else + $needNewConfigFile = true; + if ($useConfig AND $xml_exist) + { + $xml_module = simplexml_load_file($configFile); + if ((int)$xml_module->need_instance == 0 AND !$needNewConfigFile) + { + $file = _PS_MODULE_DIR_.$module.'/'.Language::getIsoById($cookie->id_lang).'.php'; + if (Tools::file_exists_cache($file) AND include_once($file)) + if(isset($_MODULE) AND is_array($_MODULE)) + $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; + + $xml_module->displayName = Module::findTranslation($xml_module->name, $xml_module->displayName, (string)$xml_module->name); + $xml_module->description = Module::findTranslation($xml_module->name, $xml_module->description, (string)$xml_module->name); + $xml_module->author = Module::findTranslation($xml_module->name, $xml_module->author, (string)$xml_module->name); + + if(isset($xml_module->confirmUninstall)) + $xml_module->confirmUninstall = Module::findTranslation($xml_module->name, $xml_module->confirmUninstall, (string)$xml_module->name); + + + $result = Db::getInstance()->getRow('SELECT `id_module`, `active` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.strval($xml_module->name).'\''); + if (isset($result['active']) AND $result['active']) + $xml_module->active = $result['active']; + if (isset($result['id_module']) AND $result['id_module']) + $xml_module->id = $result['id_module']; + $moduleList[] = $xml_module; + } + } + if (!$useConfig OR !$xml_exist OR (isset($xml_module->need_instance) AND (int)$xml_module->need_instance == 1) OR $needNewConfigFile) + { + $file = trim(file_get_contents(_PS_MODULE_DIR_.$module.'/'.$module.'.php')); + if (substr($file, 0, 5) == '') + $file = substr($file, 0, -2); + if (class_exists($module, false) OR eval($file) !== false) + { + $moduleList[] = new $module; + if (!$xml_exist OR $needNewConfigFile) + { + self::$_generateConfigXmlMode = true; + $tmpModule = new $module; + $tmpModule->_generateConfigXml((isset($xml_module->need_instance) ? (int)$xml_module->need_instance : 1)); + self::$_generateConfigXmlMode = false; + } + } + else + $errors[] = $module; + } + } + + if (sizeof($errors)) + { + echo '

'.Tools::displayError('Parse error(s) in module(s)').'

    '; + foreach ($errors AS $error) + echo '
  1. '.$error.'
  2. '; + echo '
'; + } + return $moduleList; + } + + public static function getModulesDirOnDisk() + { + $moduleList = array(); + $modules = scandir(_PS_MODULE_DIR_); + foreach ($modules AS $name) + { + if (Tools::file_exists_cache($moduleFile = _PS_MODULE_DIR_.'/'.$name.'/'.$name.'.php')) + { + if (!Validate::isModuleName($name)) + die(Tools::displayError().' (Module '.$name.')'); + $moduleList[] = $name; + } + } + return $moduleList; + } + + /** + * Return installed modules + * + * @param int $position Take only positionnables modules + * @return array Modules + */ + public static function getModulesInstalled($position = 0) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'module` m + '.($position ? ' + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON m.`id_module` = hm.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` k ON hm.`id_hook` = k.`id_hook` + WHERE k.`position` = 1' : '')); + } + + /* + * Execute modules for specified hook + * + * @param string $hook_name Hook Name + * @param array $hookArgs Parameters for the functions + * @return string modules output + */ + public static function hookExec($hook_name, $hookArgs = array(), $id_module = NULL) + { + global $cookie; + if ((!empty($id_module) AND !Validate::isUnsignedId($id_module)) OR !Validate::isHookName($hook_name)) + die(Tools::displayError()); + + global $cart, $cookie; + $live_edit = false; + if (!isset($hookArgs['cookie']) OR !$hookArgs['cookie']) + $hookArgs['cookie'] = $cookie; + if (!isset($hookArgs['cart']) OR !$hookArgs['cart']) + $hookArgs['cart'] = $cart; + $hook_name = strtolower($hook_name); + + if (!isset(self::$_hookModulesCache)) + { + $db = Db::getInstance(_PS_USE_SQL_SLAVE_); + $result = $db->ExecuteS(' + SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit` + FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + AND m.`active` = 1 + ORDER BY hm.`position`', false); + self::$_hookModulesCache = array(); + + if ($result) + while ($row = $db->nextRow()) + { + $row['hook'] = strtolower($row['hook']); + if (!isset(self::$_hookModulesCache[$row['hook']])) + self::$_hookModulesCache[$row['hook']] = array(); + self::$_hookModulesCache[$row['hook']][] = array('id_hook' => $row['id_hook'], 'module' => $row['module'], 'id_module' => $row['id_module'], 'live_edit' => $row['live_edit']); + } + } + + if (!isset(self::$_hookModulesCache[$hook_name])) + return; + + $altern = 0; + $output = ''; + foreach (self::$_hookModulesCache[$hook_name] AS $array) + { + if ($id_module AND $id_module != $array['id_module']) + continue; + if (!($moduleInstance = Module::getInstanceByName($array['module']))) + continue; + + $exceptions = $moduleInstance->getExceptions((int)$array['id_hook'], (int)$array['id_module']); + foreach ($exceptions AS $exception) + if (strstr(basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'], $exception['file_name'])) + continue 2; + + if (is_callable(array($moduleInstance, 'hook'.$hook_name))) + { + $hookArgs['altern'] = ++$altern; + + $display = call_user_func(array($moduleInstance, 'hook'.$hook_name), $hookArgs); + if ($array['live_edit'] && ((Tools::isSubmit('live_edit') AND $ad = Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))))) + { + $live_edit = true; + $output .= ' +
+ ' + .$moduleInstance->displayName.' + + + + + '.$display.'
'; + } + else + $output .= $display; + } + } + return ($live_edit ? '
' : '').$output.($live_edit ? '
' : ''); + } + + public static function hookExecPayment() + { + global $cart, $cookie; + $hookArgs = array('cookie' => $cookie, 'cart' => $cart); + $id_customer = (int)($cookie->id_customer); + $billing = new Address((int)($cart->id_address_invoice)); + $output = ''; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position` + FROM `'._DB_PREFIX_.'module_country` mc + LEFT JOIN `'._DB_PREFIX_.'module` m ON m.`id_module` = mc.`id_module` + INNER JOIN `'._DB_PREFIX_.'module_group` mg ON (m.`id_module` = mg.`id_module`) + INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group` AND cg.`id_customer` = '.(int)($id_customer).') + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + WHERE h.`name` = \'payment\' + AND mc.id_country = '.(int)($billing->id_country).' + AND m.`active` = 1 + ORDER BY hm.`position`, m.`name` DESC'); + if ($result) + foreach ($result AS $k => $module) + if (($moduleInstance = Module::getInstanceByName($module['name'])) AND is_callable(array($moduleInstance, 'hookpayment'))) + if (!$moduleInstance->currencies OR ($moduleInstance->currencies AND sizeof(Currency::checkPaymentCurrencies($moduleInstance->id)))) + $output .= call_user_func(array($moduleInstance, 'hookpayment'), $hookArgs); + return $output; + } + + /** + * find translation from $_MODULES and put it in self::$l_cache if not already exist + * and return it. + * + * @param string $name name of the module + * @param string $string term to find + * @param string $source additional param for building translation key + * @return string + */ + public static function findTranslation($name, $string, $source) + { + global $_MODULES; + + $cache_key = $name . '|' . $string . '|' . $source; + + if (!isset(self::$l_cache[$cache_key])) + { + if (!is_array($_MODULES)) + return str_replace('"', '"', $string); + // set array key to lowercase for 1.3 compatibility + $_MODULES = array_change_key_case($_MODULES); + $currentKey = '<{'.strtolower($name).'}'.strtolower(_THEME_NAME_).'>'.strtolower($source).'_'.md5($string); + $defaultKey = '<{'.strtolower($name).'}prestashop>'.strtolower($source).'_'.md5($string); + + if (isset($_MODULES[$currentKey])) + $ret = stripslashes($_MODULES[$currentKey]); + elseif (isset($_MODULES[Tools::strtolower($currentKey)])) + $ret = stripslashes($_MODULES[Tools::strtolower($currentKey)]); + elseif (isset($_MODULES[$defaultKey])) + $ret = stripslashes($_MODULES[$defaultKey]); + elseif (isset($_MODULES[Tools::strtolower($defaultKey)])) + $ret = stripslashes($_MODULES[Tools::strtolower($defaultKey)]); + else + $ret = stripslashes($string); + + self::$l_cache[$cache_key] = str_replace('"', '"', $ret); + } + return self::$l_cache[$cache_key]; + } + /** + * Get translation for a given module text + * + * Note: $specific parameter is mandatory for library files. + * Otherwise, translation key will not match for Module library + * when module is loaded with eval() Module::getModulesOnDisk() + * + * @param string $string String to translate + * @param boolean|string $specific filename to use in translation key + * @return string Translation + */ + public function l($string, $specific = false) + { + if (self::$_generateConfigXmlMode) + return $string; + + global $_MODULES, $_MODULE, $cookie; + + $id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)(Configuration::get('PS_LANG_DEFAULT')) : (int)($cookie->id_lang); + $file = _PS_MODULE_DIR_.$this->name.'/'.Language::getIsoById($id_lang).'.php'; + if (Tools::file_exists_cache($file) AND include_once($file)) + $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; + + $source = $specific ? $specific : $this->name; + $string = str_replace('\'', '\\\'', $string); + $ret = $this->findTranslation($this->name, $string, $source); + return $ret; + } + + /* + * Reposition module + * + * @param boolean $id_hook Hook ID + * @param boolean $way Up (1) or Down (0) + * @param intger $position + */ + public function updatePosition($id_hook, $way, $position = NULL) + { + if (!$res = Db::getInstance()->ExecuteS(' + SELECT hm.`id_module`, hm.`position`, hm.`id_hook` + FROM `'._DB_PREFIX_.'hook_module` hm + WHERE hm.`id_hook` = '.(int)($id_hook).' + ORDER BY hm.`position` '.((int)($way) ? 'ASC' : 'DESC'))) + return false; + foreach ($res AS $key => $values) + if ((int)($values[$this->identifier]) == (int)($this->id)) + { + $k = $key ; + break ; + } + if (!isset($k) OR !isset($res[$k]) OR !isset($res[$k + 1])) + return false; + $from = $res[$k]; + $to = $res[$k + 1]; + + if (isset($position) and !empty($position)) + $to['position'] = (int)($position); + + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'hook_module` + SET `position`= position '.($way ? '-1' : '+1').' + WHERE position between '.(int)(min(array($from['position'], $to['position']))) .' AND '.(int)(max(array($from['position'], $to['position']))).' + AND `id_hook`='.(int)($from['id_hook'])) + AND + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'hook_module` + SET `position`='.(int)($to['position']).' + WHERE `'.pSQL($this->identifier).'` = '.(int)($from[$this->identifier]).' AND `id_hook`='.(int)($to['id_hook'])) + ); + } + + /* + * Reorder modules position + * + * @param boolean $id_hook Hook ID + */ + public function cleanPositions($id_hook) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_module` + FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_hook` = '.(int)($id_hook).' + ORDER BY `position`'); + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; ++$i) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'hook_module` + SET `position` = '.(int)($i + 1).' + WHERE `id_hook` = '.(int)($id_hook).' + AND `id_module` = '.(int)($result[$i]['id_module'])); + return true; + } + + /* + * Return module position for a given hook + * + * @param boolean $id_hook Hook ID + * @return integer position + */ + public function getPosition($id_hook) + { + $result = Db::getInstance()->getRow(' + SELECT `position` + FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_hook` = '.(int)($id_hook).' + AND `id_module` = '.(int)($this->id)); + return $result['position']; + } + + public function displayError($error) + { + $output = ' +
+ '.$error.' +
'; + $this->error = true; + return $output; + } + + public function displayConfirmation($string) + { + $output = ' +
+ '.$string.' +
'; + return $output; + } + + /* + * Return exceptions for module in hook + * + * @param int $id_hook Hook ID + * @return array Exceptions + */ + protected static $exceptionsCache = NULL; + public function getExceptions($id_hook) + { + if (self::$exceptionsCache == NULL AND !is_array(self::$exceptionsCache)) + { + self::$exceptionsCache = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT CONCAT(id_hook, \'-\', id_module) as `key`, `file_name` as value + FROM `'._DB_PREFIX_.'hook_module_exceptions`'); + foreach ($result as $row) + { + if (!array_key_exists($row['key'], self::$exceptionsCache)) + self::$exceptionsCache[$row['key']] = array(); + self::$exceptionsCache[$row['key']][] = array('file_name' => $row['value']); + } + } + return (array_key_exists((int)($id_hook).'-'.(int)($this->id), self::$exceptionsCache) ? self::$exceptionsCache[(int)($id_hook).'-'.(int)($this->id)] : array()); + } + + public static function isInstalled($moduleName) + { + Db::getInstance()->Execute('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($moduleName).'\''); + return (bool)Db::getInstance()->NumRows(); + } + + public function isRegisteredInHook($hook) + { + if (!$this->id) + return false; + + return Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'hook_module` hm + LEFT JOIN `'._DB_PREFIX_.'hook` h ON (h.`id_hook` = hm.`id_hook`) + WHERE h.`name` = \''.pSQL($hook).'\' + AND hm.`id_module` = '.(int)($this->id) + ); + } + + /* + ** Template management (display, overload, cache) + */ + protected static function _isTemplateOverloadedStatic($moduleName, $template) + { + if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$moduleName.'/'.$template)) + return true; + elseif (Tools::file_exists_cache(_PS_MODULE_DIR_.$moduleName.'/'.$template)) + return false; + return NULL; + } + + protected function _isTemplateOverloaded($template) + { + return self::_isTemplateOverloadedStatic($this->name, $template); + } + + public static function display($file, $template, $cacheId = NULL, $compileId = NULL) + { + global $smarty; + + if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */ + { + $previousTemplate = $smarty->currentTemplate; + $smarty->currentTemplate = substr(basename($template), 0, -4); + } + $smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/'); + if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL) + $result = Tools::displayError('No template found for module').' '.basename($file,'.php'); + else + { + $smarty->assign('module_template_dir', ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/'); + $result = $smarty->fetch(($overloaded ? _PS_THEME_DIR_.'modules/'.basename($file, '.php') : _PS_MODULE_DIR_.basename($file, '.php')).'/'.$template, $cacheId, $compileId); + } + if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */ + $smarty->currentTemplate = $previousTemplate; + return $result; + } + + protected function _getApplicableTemplateDir($template) + { + return $this->_isTemplateOverloaded($template) ? _PS_THEME_DIR_ : _PS_MODULE_DIR_.$this->name.'/'; + } + + public function isCached($template, $cacheId = NULL, $compileId = NULL) + { + global $smarty; + + /* Use Smarty 3 API calls */ + if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */ + return $smarty->isCached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId); + /* or keep a backward compatibility if PHP version < 5.1.2 */ + else + return $smarty->is_cached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId); + } + + protected function _clearCache($template, $cacheId = NULL, $compileId = NULL) + { + global $smarty; + + /* Use Smarty 3 API calls */ + if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */ + return $smarty->clearCache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId); + /* or keep a backward compatibility if PHP version < 5.1.2 */ + else + return $smarty->clear_cache($template ? $this->_getApplicableTemplateDir($template).$template : NULL, $cacheId, $compileId); + } + + protected function _generateConfigXml($need_instance = 1) + { + $xml = ' + + '.$this->name.' + '.html_entity_decode(addslashes($this->displayName), ENT_COMPAT, 'UTF-8').' + '.$this->version.' + '.html_entity_decode(addslashes(strip_tags($this->description)), ENT_COMPAT, 'UTF-8').' + '.html_entity_decode(addslashes(strip_tags($this->author)), ENT_COMPAT, 'UTF-8').' + '.html_entity_decode(addslashes($this->tab), ENT_COMPAT, 'UTF-8').''.(isset($this->confirmUninstall) ? "\n\t".''.$this->confirmUninstall.'' : '').' + '.(int)method_exists($this, 'getContent').' + '.$need_instance.''.(isset($this->limited_countries) ? "\n\t".''.(sizeof($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'' : '').' +'; + if (is_writable(_PS_MODULE_DIR_.$this->name.'/')) + file_put_contents(_PS_MODULE_DIR_.$this->name.'/config.xml', utf8_encode($xml)); + } + + /** + * @param string $hook_name + * @return bool if module can be transplanted on hook + */ + public function isHookableOn($hook_name) + { + return is_callable(array($this, 'hook'.ucfirst($hook_name))); + } +} + diff --git a/classes/ModuleGraph.php b/classes/ModuleGraph.php new file mode 100644 index 000000000..6153cbff9 --- /dev/null +++ b/classes/ModuleGraph.php @@ -0,0 +1,266 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ModuleGraphCore extends Module +{ + protected $_employee; + + /** @var integer array graph data */ + protected $_values = array(); + + /** @var string array graph legends (X axis) */ + protected $_legend = array(); + + /**@var string graph titles */ + protected $_titles = array('main' => NULL, 'x' => NULL, 'y' => NULL); + + /** @var ModuleGraphEngine graph engine */ + protected $_render; + + abstract protected function getData($layers); + + public function setEmployee($id_employee) + { + $this->_employee = new Employee((int)($id_employee)); + } + public function setLang($id_lang) + { + $this->_id_lang = $id_lang; + } + + protected function setDateGraph($layers, $legend = false) + { + // Get dates in a manageable format + $fromArray = getdate(strtotime($this->_employee->stats_date_from)); + $toArray = getdate(strtotime($this->_employee->stats_date_to)); + + // If the granularity is inferior to 1 day + if ($this->_employee->stats_date_from == $this->_employee->stats_date_to) + { + if ($legend) + for ($i = 0; $i < 24; $i++) + { + if ($layers == 1) + $this->_values[$i] = 0; + else + for ($j = 0; $j < $layers; $j++) + $this->_values[$j][$i] = 0; + $this->_legend[$i] = ($i % 2) ? '' : sprintf('%02dh', $i); + } + if (is_callable(array($this, 'setDayValues'))) + $this->setDayValues($layers); + } + // If the granularity is inferior to 1 month TODO : change to manage 28 to 31 days + elseif (strtotime($this->_employee->stats_date_to) - strtotime($this->_employee->stats_date_from) <= 2678400) + { + if ($legend) + { + $days = array(); + if ($fromArray['mon'] == $toArray['mon']) + for ($i = $fromArray['mday']; $i <= $toArray['mday']; ++$i) + $days[] = $i; + else + { + $imax = date('t', mktime(0, 0, 0, $fromArray['mon'], 1, $fromArray['year'])); + for ($i = $fromArray['mday']; $i <= $imax; ++$i) + $days[] = $i; + for ($i = 1; $i <= $toArray['mday']; ++$i) + $days[] = $i; + } + foreach ($days as $i) + { + if ($layers == 1) + $this->_values[$i] = 0; + else + for ($j = 0; $j < $layers; $j++) + $this->_values[$j][$i] = 0; + $this->_legend[$i] = ($i % 2) ? '' : sprintf('%02d', $i); + } + } + if (is_callable(array($this, 'setMonthValues'))) + $this->setMonthValues($layers); + } + // If the granularity is superior to 1 month + else + { + if ($legend) + { + $months = array(); + if ($fromArray['year'] == $toArray['year']) + for ($i = $fromArray['mon']; $i <= $toArray['mon']; ++$i) + $months[] = $i; + else + { + for ($i = $fromArray['mon']; $i <= 12; ++$i) + $months[] = $i; + for ($i = 1; $i <= $toArray['mon']; ++$i) + $months[] = $i; + } + foreach ($months as $i) + { + if ($layers == 1) + $this->_values[$i] = 0; + else + for ($j = 0; $j < $layers; $j++) + $this->_values[$j][$i] = 0; + $this->_legend[$i] = sprintf('%02d', $i); + } + } + if (is_callable(array($this, 'setYearValues'))) + $this->setYearValues($layers); + } + } + + protected function csvExport($datas) + { + global $cookie; + $this->setEmployee(intval($cookie->id_employee)); + $this->setLang(intval($cookie->id_lang)); + + $layers = isset($datas['layers']) ? $datas['layers'] : 1; + if (isset($datas['option'])) + $this->setOption($datas['option'], $layers); + $this->getData($layers); + + if (is_array($this->_titles['main'])) + for ($i = 1; $i <= sizeof($this->_titles['main']); $i++) + $this->_csv .= ';'.$this->_titles['main'][$i]; + else + $this->_csv .= ';'.$this->_titles['main']; + $this->_csv .= "\n"; + if (sizeof($this->_legend)) + { + if ($datas['type'] == 'pie') + foreach ($this->_legend AS $key => $legend) + for ($i = 0; $i < (is_array($this->_titles['main']) ? sizeof($this->_values) : 1); ++$i) + $total += (is_array($this->_values[$i]) ? $this->_values[$i][$key] : $this->_values[$key]); + foreach ($this->_legend AS $key => $legend) + { + $this->_csv .= $legend.';'; + for ($i = 0; $i < (is_array($this->_titles['main']) ? sizeof($this->_values) : 1); ++$i) + $this->_csv .= (is_array($this->_values[$i]) ? $this->_values[$i][$key] : $this->_values[$key]) / (($datas['type'] == 'pie') ? $total : 1).';'; + $this->_csv .= "\n"; + } + } + $this->_displayCsv(); + } + + protected function _displayCsv() + { + ob_end_clean(); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename="'.$this->displayName.' - '.time().'.csv"'); + echo $this->_csv; + exit; + } + + public function create($render, $type, $width, $height, $layers) + { + if (!Tools::file_exists_cache($file = dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) + die(Tools::displayError()); + require_once($file); + $this->_render = new $render($type); + + $this->getData($layers); + $this->_render->createValues($this->_values); + $this->_render->setSize($width, $height); + $this->_render->setLegend($this->_legend); + $this->_render->setTitles($this->_titles); + } + + public function draw() + { + $this->_render->draw(); + } + + public static function engine($params) + { + if (!($render = Configuration::get('PS_STATS_RENDER'))) + return Tools::displayError('No graph engine selected'); + if (!file_exists(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) + return Tools::displayError('Graph engine selected is unavailable.'); + + global $cookie; + $id_employee = (int)($cookie->id_employee); + $id_lang = (int)($cookie->id_lang); + + if (!isset($params['layers'])) + $params['layers'] = 1; + if (!isset($params['type'])) + $params['type'] = 'column'; + if (!isset($params['width'])) + $params['width'] = 550; + if (!isset($params['height'])) + $params['height'] = 270; + + global $cookie; + $id_employee = (int)($cookie->id_employee); + $drawer = 'drawer.php?render='.$render.'&module='.Tools::getValue('module').'&type='.$params['type'].'&layers='.$params['layers'].'&id_employee='.$id_employee.'&id_lang='.$id_lang; + if (isset($params['option'])) + $drawer .= '&option='.$params['option']; + + require_once(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php'); + return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer); + } + + protected static function getEmployee($employee = null) + { + if (!$employee) + { + global $cookie; + $employee = new Employee((int)($cookie->id_employee)); + } + + if (empty($employee->stats_date_from) OR empty($employee->stats_date_to) OR $employee->stats_date_from == '0000-00-00' OR $employee->stats_date_to == '0000-00-00') + { + if (empty($employee->stats_date_from) OR $employee->stats_date_from == '0000-00-00') + $employee->stats_date_from = date('Y').'-01-01'; + if (empty($employee->stats_date_to) OR $employee->stats_date_to == '0000-00-00') + $employee->stats_date_to = date('Y').'-12-31'; + $employee->update(); + } + return $employee; + } + + public function getDate() + { + return self::getDateBetween($this->_employee); + } + + public static function getDateBetween($employee = null) + { + $employee = self::getEmployee($employee); + return ' \''.$employee->stats_date_from.' 00:00:00\' AND \''.$employee->stats_date_to.' 23:59:59\' '; + } + + public function getLang() + { + return $this->_id_lang; + } +} + + diff --git a/classes/ModuleGraphEngine.php b/classes/ModuleGraphEngine.php new file mode 100644 index 000000000..5adfb25f0 --- /dev/null +++ b/classes/ModuleGraphEngine.php @@ -0,0 +1,72 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ModuleGraphEngineCore extends Module +{ + protected $_type; + + public function __construct($type) + { + $this->_type = $type; + } + + public function install() + { + if (!parent::install()) + return false; + return Configuration::updateValue('PS_STATS_RENDER', $this->name); + } + + public static function getGraphEngines() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT m.`name` + FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + WHERE h.`name` = \'GraphEngine\''); + + $arrayEngines = array(); + foreach ($result AS $module) + { + $instance = Module::getInstanceByName($module['name']); + if (!$instance) + continue; + $arrayEngines[$module['name']] = array($instance->displayName, $instance->description); + } + + return $arrayEngines; + } + + abstract public function createValues($values); + abstract public function setSize($width, $height); + abstract public function setLegend($legend); + abstract public function setTitles($titles); + abstract public function draw(); +} + + diff --git a/classes/ModuleGrid.php b/classes/ModuleGrid.php new file mode 100644 index 000000000..f58143a44 --- /dev/null +++ b/classes/ModuleGrid.php @@ -0,0 +1,185 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ModuleGridCore extends Module +{ + protected $_employee; + + /** @var string array graph data */ + protected $_values = array(); + + /** @var integer total number of values **/ + protected $_totalCount = 0; + + /**@var string graph titles */ + protected $_title; + + /**@var integer start */ + protected $_start; + + /**@var integer limit */ + protected $_limit; + + /**@var string column name on which to sort */ + protected $_sort = null; + + /**@var string sort direction DESC/ASC */ + protected $_direction = null; + + /** @var ModuleGridEngine grid engine */ + protected $_render; + + public function install() + { + return (parent::install()); + } + + public function setEmployee($id_employee) + { + $this->_employee = new Employee((int)($id_employee)); + } + public function setLang($id_lang) + { + $this->_id_lang = $id_lang; + } + + public function create($render, $type, $width, $height, $start, $limit, $sort, $dir) + { + if (!Tools::file_exists_cache($file = dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) + die(Tools::displayError()); + require_once($file); + $this->_render = new $render($type); + + $this->_start = $start; + $this->_limit = $limit; + $this->_sort = $sort; + $this->_direction = $dir; + + $this->getData(); + + $this->_render->setTitle($this->_title); + $this->_render->setSize($width, $height); + $this->_render->setValues($this->_values); + $this->_render->setTotalCount($this->_totalCount); + $this->_render->setLimit($this->_start, $this->_limit); + } + + public function render() + { + $this->_render->render(); + } + + public static function engine($params) + { + if (!($render = Configuration::get('PS_STATS_GRID_RENDER'))) + return Tools::displayError('No grid engine selected'); + if (!file_exists(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) + return Tools::displayError('Grid engine selected is unavailable.'); + + $grider = 'grider.php?render='.$render.'&module='.Tools::getValue('module'); + + global $cookie; + $grider .= '&id_employee='.(int)($cookie->id_employee); + $grider .= '&id_lang='.(int)($cookie->id_lang); + + if (!isset($params['width']) OR !Validate::IsUnsignedInt($params['width'])) + $params['width'] = 600; + if (!isset($params['height']) OR !Validate::IsUnsignedInt($params['height'])) + $params['height'] = 920; + if (!isset($params['start']) OR !Validate::IsUnsignedInt($params['start'])) + $params['start'] = 0; + if (!isset($params['limit']) OR !Validate::IsUnsignedInt($params['height'])) + $params['limit'] = 40; + + $grider .= '&width='.$params['width']; + $grider .= '&height='.$params['height']; + if (isset($params['start']) AND Validate::IsUnsignedInt($params['start'])) + $grider .= '&start='.$params['start']; + if (isset($params['limit']) AND Validate::IsUnsignedInt($params['limit'])) + $grider .= '&limit='.$params['limit']; + if (isset($params['type']) AND Validate::IsName($params['type'])) + $grider .= '&type='.$params['type']; + if (isset($params['option']) AND Validate::IsGenericName($params['option'])) + $grider .= '&option='.$params['option']; + if (isset($params['sort']) AND Validate::IsName($params['sort'])) + $grider .= '&sort='.$params['sort']; + if (isset($params['dir']) AND Validate::IsSortDirection($params['dir'])) + $grider .= '&dir='.$params['dir']; + + require_once(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php'); + return call_user_func(array($render, 'hookGridEngine'), $params, $grider); + } + + protected function csvExport($datas) + { + global $cookie; + $this->_sort = $datas['defaultSortColumn']; + $this->setLang($cookie->id_lang); + $this->getData(); + + $layers = isset($datas['layers']) ? $datas['layers'] : 1; + + if (isset($datas['option'])) + $this->setOption($datas['option'], $layers); + + if (sizeof($datas['columns'])) + { + foreach ($datas['columns'] AS $column) + $this->_csv .= $column['header'].';'; + $this->_csv = rtrim($this->_csv, ';')."\n"; + + foreach ($this->_values AS $value) + { + foreach ($datas['columns'] AS $column) + $this->_csv .= $value[$column['dataIndex']].';'; + $this->_csv = rtrim($this->_csv, ';')."\n"; + } + } + $this->_displayCsv(); + } + + protected function _displayCsv() + { + ob_end_clean(); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename="'.$this->displayName.' - '.time().'.csv"'); + echo $this->_csv; + exit; + } + + abstract protected function getData(); + + public function getDate() + { + return ModuleGraph::getDateBetween($this->_employee); + } + public function getLang() + { + return $this->_id_lang; + } +} + diff --git a/classes/ModuleGridEngine.php b/classes/ModuleGridEngine.php new file mode 100644 index 000000000..56af640d5 --- /dev/null +++ b/classes/ModuleGridEngine.php @@ -0,0 +1,71 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ModuleGridEngineCore extends Module +{ + protected $_type; + + public function __construct($type) + { + $this->_type = $type; + } + + public function install() + { + if (!parent::install()) + return false; + return Configuration::updateValue('PS_STATS_GRID_RENDER', $this->name); + } + + public static function getGridEngines() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT m.`name` + FROM `'._DB_PREFIX_.'module` m + LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + WHERE h.`name` = \'GridEngine\''); + + $arrayEngines = array(); + foreach ($result AS $module) + { + $instance = Module::getInstanceByName($module['name']); + if (!$instance) + continue; + $arrayEngines[$module['name']] = array($instance->displayName, $instance->description); + } + return $arrayEngines; + } + + abstract public function setValues($values); + abstract public function setTitle($title); + abstract public function setSize($width, $height); + abstract public function setTotalCount($totalCount); + abstract public function setLimit($start, $limit); + abstract public function render(); +} + diff --git a/classes/MySQL.php b/classes/MySQL.php new file mode 100644 index 000000000..bab57c317 --- /dev/null +++ b/classes/MySQL.php @@ -0,0 +1,283 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MySQLCore extends Db +{ + public function connect() + { + if (!defined('_PS_DEBUG_SQL_')) + define('_PS_DEBUG_SQL_', false); + if ($this->_link = mysql_connect($this->_server, $this->_user, $this->_password)) + { + if(!$this->set_db($this->_database)) + die(Tools::displayError('The database selection cannot be made.')); + } + else + die(Tools::displayError('Link to database cannot be established.')); + /* UTF-8 support */ + if (!mysql_query('SET NAMES \'utf8\'', $this->_link)) + die(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.')); + /* Disable some MySQL limitations */ + mysql_query('SET GLOBAL SQL_MODE=\'\'', $this->_link); + return $this->_link; + } + + /* do not remove, useful for some modules */ + public function set_db($db_name) { + return mysql_select_db($db_name, $this->_link); + } + + public function disconnect() + { + if ($this->_link) + @mysql_close($this->_link); + $this->_link = false; + } + + public function getRow($query, $use_cache = 1) + { + $this->_result = false; + $this->_lastQuery = $query; + if($use_cache AND _PS_CACHE_ENABLED_) + if ($result = Cache::getInstance()->get(md5($query))) + { + $this->_lastCached = true; + return $result; + } + if ($this->_link) + if ($this->_result = mysql_query($query.' LIMIT 1', $this->_link)) + { + $this->_lastCached = false; + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + $result = mysql_fetch_assoc($this->_result); + if ($use_cache = 1 AND _PS_CACHE_ENABLED_) + Cache::getInstance()->setQuery($query, $result); + return $result; + } + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + return false; + } + + public function getValue($query, $use_cache = 1) + { + $this->_result = false; + $this->_lastQuery = $query; + if ($use_cache AND _PS_CACHE_ENABLED_) + if ($result = Cache::getInstance()->get(md5($query))) + { + $this->_lastCached = true; + return $result; + } + if ($this->_link AND $this->_result = mysql_query($query.' LIMIT 1', $this->_link) AND is_array($tmpArray = mysql_fetch_assoc($this->_result))) + { + $this->_lastCached = false; + $result = array_shift($tmpArray); + if($use_cache AND _PS_CACHE_ENABLED_) + Cache::getInstance()->setQuery($query, $result); + return $result; + } + return false; + } + + public function Execute($query, $use_cache = 1) + { + $this->_result = false; + if ($this->_link) + { + $this->_result = mysql_query($query, $this->_link); + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + if ($use_cache AND _PS_CACHE_ENABLED_) + Cache::getInstance()->deleteQuery($query); + return $this->_result; + } + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + return false; + } + + /** + * ExecuteS return the result of $query as array, + * or as mysqli_result if $array set to false + * + * @param string $query query to execute + * @param boolean $array return an array instead of a mysql_result object + * @param int $use_cache if query has been already executed, use its result + * @return array or result object + */ + public function ExecuteS($query, $array = true, $use_cache = 1) + { + $this->_result = false; + $this->_lastQuery = $query; + if ($use_cache AND _PS_CACHE_ENABLED_) + if ($array AND ($result = Cache::getInstance()->get(md5($query)))) + { + $this->_lastCached = true; + return $result; + } + if ($this->_link && $this->_result = mysql_query($query, $this->_link)) + { + $this->_lastCached = false; + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + if (!$array) + return $this->_result; + $resultArray = array(); + // Only SELECT queries and a few others return a valid resource usable with mysql_fetch_assoc + if ($this->_result !== true) + while ($row = mysql_fetch_assoc($this->_result)) + $resultArray[] = $row; + if ($use_cache AND _PS_CACHE_ENABLED_) + Cache::getInstance()->setQuery($query, $resultArray); + return $resultArray; + } + if (_PS_DEBUG_SQL_) + $this->displayMySQLError($query); + return false; + } + + public function nextRow($result = false) + { + return mysql_fetch_assoc($result ? $result : $this->_result); + } + + public function delete($table, $where = false, $limit = false, $use_cache = 1) + { + $this->_result = false; + if ($this->_link) + { + $query = 'DELETE FROM `'.pSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)($limit) : ''); + $res = mysql_query($query, $this->_link); + if ($use_cache AND _PS_CACHE_ENABLED_) + Cache::getInstance()->deleteQuery($query); + return $res; + } + + return false; + } + + public function NumRows() + { + if (!$this->_lastCached AND $this->_link AND $this->_result) + { + $nrows = mysql_num_rows($this->_result); + if (_PS_CACHE_ENABLED_) + Cache::getInstance()->setNumRows(md5($this->_lastQuery), $nrows); + return $nrows; + } + elseif (_PS_CACHE_ENABLED_ AND $this->_lastCached) + { + return Cache::getInstance()->getNumRows(md5($this->_lastQuery)); + } + } + + public function Insert_ID() + { + if ($this->_link) + return mysql_insert_id($this->_link); + return false; + } + + public function Affected_Rows() + { + if ($this->_link) + return mysql_affected_rows($this->_link); + return false; + } + + protected function q($query, $use_cache = 1) + { + global $webservice_call; + $this->_result = false; + if ($this->_link) + { + $result = mysql_query($query, $this->_link); + $this->_lastQuery = $query; + if ($webservice_call) + $this->displayMySQLError($query); + if ($use_cache AND _PS_CACHE_ENABLED_) + Cache::getInstance()->deleteQuery($query); + return $result; + } + return false; + } + + /** + * Returns the text of the error message from previous MySQL operation + * + * @acces public + * @return string error + */ + public function getMsgError($query = false) + { + return mysql_error(); + } + + public function getNumberError() + { + return mysql_errno(); + } + + public function displayMySQLError($query = false) + { + global $webservice_call; + if ($webservice_call && mysql_errno()) + { + WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.mysql_error().'. Query was : '.$query, 97); + + } + elseif (_PS_DEBUG_SQL_ AND mysql_errno() AND !defined('PS_INSTALLATION_IN_PROGRESS')) + { + if ($query) + die(Tools::displayError(mysql_error().'

'.$query.'
')); + die(Tools::displayError((mysql_error()))); + } + } + + static public function tryToConnect($server, $user, $pwd, $db) + { + if (!$link = @mysql_connect($server, $user, $pwd)) + return 1; + if (!@mysql_select_db($db, $link)) + return 2; + @mysql_close($link); + return 0; + } + + static public function tryUTF8($server, $user, $pwd) + { + $link = @mysql_connect($server, $user, $pwd); + if (!mysql_query('SET NAMES \'utf8\'', $link)) + $ret = false; + else + $ret = true; + @mysql_close($link); + return $ret; + } +} diff --git a/classes/ObjectModel.php b/classes/ObjectModel.php new file mode 100644 index 000000000..b7daf1f4d --- /dev/null +++ b/classes/ObjectModel.php @@ -0,0 +1,648 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class ObjectModelCore +{ + /** @var integer Object id */ + public $id; + + /** @var string SQL Table name */ + protected $table = NULL; + + /** @var string SQL Table identifier */ + protected $identifier = NULL; + + /** @var array Required fields for admin panel forms */ + protected $fieldsRequired = array(); + + /** @var fieldsRequiredDatabase */ + protected static $fieldsRequiredDatabase = NULL; + + /** @var array Maximum fields size for admin panel forms */ + protected $fieldsSize = array(); + + /** @var array Fields validity functions for admin panel forms */ + protected $fieldsValidate = array(); + + /** @var array Multilingual required fields for admin panel forms */ + protected $fieldsRequiredLang = array(); + + /** @var array Multilingual maximum fields size for admin panel forms */ + protected $fieldsSizeLang = array(); + + /** @var array Multilingual fields validity functions for admin panel forms */ + protected $fieldsValidateLang = array(); + + /** @var array tables */ + protected $tables = array(); + + /** @var array tables */ + protected $webserviceParameters = array(); + + protected static $_cache = array(); + + /** + * Returns object validation rules (fields validity) + * + * @param string $className Child class name for static use (optional) + * @return array Validation rules (fields validity) + */ + static public function getValidationRules($className = __CLASS__) + { + $object = new $className(); + return array( + 'required' => $object->fieldsRequired, + 'size' => $object->fieldsSize, + 'validate' => $object->fieldsValidate, + 'requiredLang' => $object->fieldsRequiredLang, + 'sizeLang' => $object->fieldsSizeLang, + 'validateLang' => $object->fieldsValidateLang); + } + + /** + * Prepare fields for ObjectModel class (add, update) + * All fields are verified (pSQL, intval...) + * + * @return array All object fields + */ + public function getFields() { return array(); } + + /** + * Build object + * + * @param integer $id Existing object id in order to load object (optional) + * @param integer $id_lang Required if object is multilingual (optional) + */ + public function __construct($id = NULL, $id_lang = NULL) + { + /* Connect to database and check SQL table/identifier */ + if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $this->identifier = pSQL($this->identifier); + + /* Load object from database if object id is present */ + if ($id) + { + if (!isset(self::$_cache[$this->table][(int)($id)][(int)($id_lang)])) + self::$_cache[$this->table][(int)($id)][(int)($id_lang)] = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.$this->table.'` a '. + ($id_lang ? ('LEFT JOIN `'.pSQL(_DB_PREFIX_.$this->table).'_lang` b ON (a.`'.$this->identifier.'` = b.`'.$this->identifier).'` AND `id_lang` = '.(int)($id_lang).')' : '') + .' WHERE a.`'.$this->identifier.'` = '.(int)($id)); + + $result = self::$_cache[$this->table][(int)($id)][(int)($id_lang)]; + if (!$result) return false; + $this->id = (int)($id); + foreach ($result AS $key => $value) + if (key_exists($key, $this)) + $this->{$key} = stripslashes($value); + + /* Join multilingual tables */ + if (!$id_lang AND method_exists($this, 'getTranslationsFieldsChild')) + { + $result = Db::getInstance()->ExecuteS('SELECT * FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.$this->identifier.'` = '.(int)($id)); + if ($result) + foreach ($result as $row) + foreach ($row AS $key => $value) + { + if (key_exists($key, $this) AND $key != $this->identifier) + { + if (!is_array($this->{$key})) + $this->{$key} = array(); + $this->{$key}[$row['id_lang']] = stripslashes($value); + } + } + } + } + + if (!is_array(self::$fieldsRequiredDatabase)) + { + $fields = $this->getfieldsRequiredDatabase(true); + if ($fields) + foreach ($fields AS $row) + self::$fieldsRequiredDatabase[$row['object_name']][(int)$row['id_required_field']] = pSQL($row['field_name']); + else + self::$fieldsRequiredDatabase = array(); + } + } + + /** + * Save current object to database (add or update) + * + * return boolean Insertion result + */ + public function save($nullValues = false, $autodate = true) + { + return (int)($this->id) > 0 ? $this->update($nullValues) : $this->add($autodate, $nullValues); + } + + /** + * Add current object to database + * + * return boolean Insertion result + */ + public function add($autodate = true, $nullValues = false) + { + if (!Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + + /* Automatically fill dates */ + if ($autodate AND key_exists('date_add', $this)) + $this->date_add = date('Y-m-d H:i:s'); + if ($autodate AND key_exists('date_upd', $this)) + $this->date_upd = date('Y-m-d H:i:s'); + + /* Database insertion */ + if ($nullValues) + $result = Db::getInstance()->autoExecuteWithNullValues(_DB_PREFIX_.$this->table, $this->getFields(), 'INSERT'); + else + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.$this->table, $this->getFields(), 'INSERT'); + if (!$result) + return false; + /* Get object id in database */ + $this->id = Db::getInstance()->Insert_ID(); + /* Database insertion for multilingual fields related to the object */ + if (method_exists($this, 'getTranslationsFieldsChild')) + { + $fields = $this->getTranslationsFieldsChild(); + if ($fields AND is_array($fields)) + foreach ($fields AS $field) + { + foreach ($field AS $key => $value) + if (!Validate::isTableOrIdentifier($key)) + die(Tools::displayError()); + $field[$this->identifier] = (int)$this->id; + $result = Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') && $result; + } + } + return $result; + } + + /** + * Update current object to database + * + * return boolean Update result + */ + public function update($nullValues = false) + { + if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + + $this->clearCache(); + + /* Automatically fill dates */ + if (key_exists('date_upd', $this)) + $this->date_upd = date('Y-m-d H:i:s'); + + /* Database update */ + if ($nullValues) + $result = Db::getInstance()->autoExecuteWithNullValues(_DB_PREFIX_.$this->table, $this->getFields(), 'UPDATE', '`'.pSQL($this->identifier).'` = '.(int)($this->id)); + else + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.$this->table, $this->getFields(), 'UPDATE', '`'.pSQL($this->identifier).'` = '.(int)($this->id)); + if (!$result) + return false; + + // Database update for multilingual fields related to the object + if (method_exists($this, 'getTranslationsFieldsChild')) + { + $fields = $this->getTranslationsFieldsChild(); + if (is_array($fields)) + foreach ($fields as $field) + { + foreach ($field as $key => $value) + if (!Validate::isTableOrIdentifier($key)) + die(Tools::displayError()); + + // used to insert missing lang entries + $where_lang = '`'.pSQL($this->identifier).'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang']); + + $lang_found = Db::getInstance()->getValue('SELECT COUNT(*) FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE '. $where_lang); + + if (!$lang_found) + $result &= Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT'); + else + $result &= Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', $where_lang); + } + } + return $result; + } + + /** + * Delete current object from database + * + * return boolean Deletion result + */ + public function delete() + { + if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + + $this->clearCache(); + + /* Database deletion */ + $result = Db::getInstance()->Execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + if (!$result) + return false; + + /* Database deletion for multilingual fields related to the object */ + if (method_exists($this, 'getTranslationsFieldsChild')) + Db::getInstance()->Execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + return $result; + } + + /** + * Delete several objects from database + * + * return boolean Deletion result + */ + public function deleteSelection($selection) + { + if (!is_array($selection) OR !Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + $result = true; + foreach ($selection AS $id) + { + $this->id = (int)($id); + $result = $result AND $this->delete(); + } + return $result; + } + + /** + * Toggle object status in database + * + * return boolean Update result + */ + public function toggleStatus() + { + if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + + /* Object must have a variable called 'active' */ + elseif (!key_exists('active', $this)) + die(Tools::displayError()); + + /* Update active status on object */ + $this->active = (int)(!$this->active); + + /* Change status to active/inactive */ + return Db::getInstance()->Execute(' + UPDATE `'.pSQL(_DB_PREFIX_.$this->table).'` + SET `active` = !`active` + WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + } + + /** + * Prepare multilingual fields for database insertion + * + * @param array $fieldsArray Multilingual fields to prepare + * return array Prepared fields for database insertion + */ + protected function getTranslationsFields($fieldsArray) + { + /* WARNING : Product do not use this function, so do not forget to report any modification if necessary */ + if (!Validate::isTableOrIdentifier($this->identifier)) + die(Tools::displayError()); + + $fields = array(); + $languages = Language::getLanguages(); + $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = $language['id_lang']; + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + foreach ($fieldsArray as $field) + { + /* Check fields validity */ + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + + /* Copy the field, or the default language field if it's both required and empty */ + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]); + elseif (in_array($field, $this->fieldsRequiredLang)) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); + else + $fields[$language['id_lang']][$field] = ''; + } + } + + return $fields; + } + + /** + * Check for fields validity before database interaction + */ + public function validateFields($die = true, $errorReturn = false) + { + $fieldsRequired = array_merge($this->fieldsRequired, (isset(self::$fieldsRequiredDatabase[get_class($this)]) ? self::$fieldsRequiredDatabase[get_class($this)] : array())); + foreach ($fieldsRequired as $field) + if (Tools::isEmpty($this->{$field}) AND (!is_numeric($this->{$field}))) + { + if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' is empty)'); + return $errorReturn ? get_class($this).' -> '.$field.' is empty' : false; + } + foreach ($this->fieldsSize as $field => $size) + if (isset($this->{$field}) AND Tools::strlen($this->{$field}) > $size) + { + if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' Length '.$size.')'); + return $errorReturn ? get_class($this).' -> '.$field.' Length '.$size : false; + } + $validate = new Validate(); + foreach ($this->fieldsValidate as $field => $method) + if (!method_exists($validate, $method)) + die (Tools::displayError('Validation function not found.').' '.$method); + elseif (!empty($this->{$field}) AND !call_user_func(array('Validate', $method), $this->{$field})) + { + if ($die) die (Tools::displayError().' ('.get_class($this).' -> '.$field.' = '.$this->{$field}.')'); + return $errorReturn ? get_class($this).' -> '.$field.' = '.$this->{$field} : false; + } + return true; + } + + /** + * Check for multilingual fields validity before database interaction + */ + public function validateFieldsLang($die = true, $errorReturn = false) + { + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + foreach ($this->fieldsRequiredLang as $fieldArray) + { + if (!is_array($this->{$fieldArray})) + continue ; + if (!$this->{$fieldArray} OR !sizeof($this->{$fieldArray}) OR ($this->{$fieldArray}[$defaultLanguage] !== '0' AND empty($this->{$fieldArray}[$defaultLanguage]))) + { + if ($die) die (Tools::displayError().' ('.get_class($this).'->'.$fieldArray.' '.Tools::displayError('is empty for default language.').')'); + return $errorReturn ? get_class($this).'->'.$fieldArray.' '.Tools::displayError('is empty for default language.') : false; + } + } + foreach ($this->fieldsSizeLang as $fieldArray => $size) + { + if (!is_array($this->{$fieldArray})) + continue ; + foreach ($this->{$fieldArray} as $k => $value) + if (Tools::strlen($value) > $size) + { + if ($die) die (Tools::displayError().' ('.get_class($this).'->'.$fieldArray.' '.Tools::displayError('Length').' '.$size.' '.Tools::displayError('for language').')'); + return $errorReturn ? get_class($this).'->'.$fieldArray.' '.Tools::displayError('Length').' '.$size.' '.Tools::displayError('for language') : false; + } + } + $validate = new Validate(); + foreach ($this->fieldsValidateLang as $fieldArray => $method) + { + if (!is_array($this->{$fieldArray})) + continue ; + foreach ($this->{$fieldArray} as $k => $value) + if (!method_exists($validate, $method)) + die (Tools::displayError('Validation function not found.').' '.$method); + elseif (!empty($value) AND !call_user_func(array('Validate', $method), $value)) + { + if ($die) die (Tools::displayError('The following field is invalid according to the validate method ').''.$method.':
('.get_class($this).'->'.$fieldArray.' = '.$value.' '.Tools::displayError('for language').' '.$k.')'); + return $errorReturn ? Tools::displayError('The following field is invalid according to the validate method ').''.$method.':
('. get_class($this).'->'.$fieldArray.' = '.$value.' '.Tools::displayError('for language').' '.$k : false; + } + } + return true; + } + + static public function displayFieldName($field, $className = __CLASS__, $htmlentities = true) + { + global $_FIELDS, $cookie; + $iso = strtolower(Language::getIsoById($cookie->id_lang ? (int)$cookie->id_lang : Configuration::get('PS_LANG_DEFAULT'))); + @include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php'); + + $key = $className.'_'.md5($field); + return ((is_array($_FIELDS) AND array_key_exists($key, $_FIELDS)) ? ($htmlentities ? htmlentities($_FIELDS[$key], ENT_QUOTES, 'utf-8') : $_FIELDS[$key]) : $field); + } + + public function validateControler($htmlentities = true) + { + $errors = array(); + + /* Checking for required fields */ + $fieldsRequired = array_merge($this->fieldsRequired, (isset(self::$fieldsRequiredDatabase[get_class($this)]) ? self::$fieldsRequiredDatabase[get_class($this)] : array())); + foreach ($fieldsRequired AS $field) + if (($value = Tools::getValue($field, $this->{$field})) == false AND (string)$value != '0') + if (!$this->id OR $field != 'passwd') + $errors[] = ''.self::displayFieldName($field, get_class($this), $htmlentities).' '.Tools::displayError('is required.'); + + + /* Checking for maximum fields sizes */ + foreach ($this->fieldsSize AS $field => $maxLength) + if (($value = Tools::getValue($field, $this->{$field})) AND Tools::strlen($value) > $maxLength) + $errors[] = ''.self::displayFieldName($field, get_class($this), $htmlentities).' '.Tools::displayError('is too long.').' ('.Tools::displayError('Maximum length:').' '.$maxLength.')'; + + /* Checking for fields validity */ + foreach ($this->fieldsValidate AS $field => $function) + { + // Hack for postcode required for country which does not have postcodes + if ($value = Tools::getValue($field, $this->{$field}) OR ($field == 'postcode' AND $value == '0')) + { + if (!Validate::$function($value)) + $errors[] = ''.self::displayFieldName($field, get_class($this), $htmlentities).' '.Tools::displayError('is invalid.'); + else + { + if ($field == 'passwd') + { + if ($value = Tools::getValue($field)) + $this->{$field} = Tools::encrypt($value); + } + else + $this->{$field} = $value; + } + } + } + return $errors; + } + + public function getWebserviceParameters($wsParamsAttributeName = NULL) + { + $defaultResourceParameters = array( + 'objectSqlId' => $this->identifier, + 'retrieveData' => array( + 'className' => get_class($this), + 'retrieveMethod' => 'getWebserviceObjectList', + 'params' => array() + ), + 'fields' => array( + 'id' => array('sqlId' => $this->identifier, 'i18n' => false), + ), + ); + + if (is_null($wsParamsAttributeName)) + $wsParamsAttributeName = 'webserviceParameters'; + + + if (!isset($this->{$wsParamsAttributeName}['objectNodeName'])) + $defaultResourceParameters['objectNodeName'] = $this->table; + if (!isset($this->{$wsParamsAttributeName}['objectsNodeName'])) + $defaultResourceParameters['objectsNodeName'] = $this->table.'s'; + + if (isset($this->{$wsParamsAttributeName}['associations'])) + foreach ($this->{$wsParamsAttributeName}['associations'] as $assocName => &$association) + { + if (!array_key_exists('setter', $association)) + $association['setter'] = Tools::toCamelCase('set_ws_'.$assocName); + if (!array_key_exists('getter', $association)) + $association['getter'] = Tools::toCamelCase('get_ws_'.$assocName); + } + + + if (isset($this->{$wsParamsAttributeName}['retrieveData']) && isset($this->{$wsParamsAttributeName}['retrieveData']['retrieveMethod'])) + unset($defaultResourceParameters['retrieveData']['retrieveMethod']); + + $resourceParameters = array_merge_recursive($defaultResourceParameters, $this->{$wsParamsAttributeName}); + if (isset($this->fieldsSize)) + foreach ($this->fieldsSize as $fieldName => $maxSize) + { + if (!isset($resourceParameters['fields'][$fieldName])) + $resourceParameters['fields'][$fieldName] = array('required' => false); + $resourceParameters['fields'][$fieldName] = array_merge( + $resourceParameters['fields'][$fieldName], + $resourceParameters['fields'][$fieldName] = array('sqlId' => $fieldName, 'maxSize' => $maxSize, 'i18n' => false) + ); + } + if (isset($this->fieldsValidate)) + foreach ($this->fieldsValidate as $fieldName => $validateMethod) + { + if (!isset($resourceParameters['fields'][$fieldName])) + $resourceParameters['fields'][$fieldName] = array('required' => false); + $resourceParameters['fields'][$fieldName] = array_merge( + $resourceParameters['fields'][$fieldName], + $resourceParameters['fields'][$fieldName] = array( + 'sqlId' => $fieldName, + 'validateMethod' => ( + array_key_exists('validateMethod', $resourceParameters['fields'][$fieldName]) ? + array_merge($resourceParameters['fields'][$fieldName]['validateMethod'], array($validateMethod)) : + array($validateMethod) + ), + 'i18n' => false + ) + ); + } + if (isset($this->fieldsRequired)) + { + $fieldsRequired = array_merge($this->fieldsRequired, (isset(self::$fieldsRequiredDatabase[get_class($this)]) ? self::$fieldsRequiredDatabase[get_class($this)] : array())); + foreach ($fieldsRequired as $fieldRequired) + { + if (!isset($resourceParameters['fields'][$fieldRequired])) + $resourceParameters['fields'][$fieldRequired] = array(); + $resourceParameters['fields'][$fieldRequired] = array_merge( + $resourceParameters['fields'][$fieldRequired], + $resourceParameters['fields'][$fieldRequired] = array('sqlId' => $fieldRequired, 'required' => true, 'i18n' => false) + ); + } + } + if (isset($this->fieldsSizeLang)) + foreach ($this->fieldsSizeLang as $fieldName => $maxSize) + { + if (!isset($resourceParameters['fields'][$fieldName])) + $resourceParameters['fields'][$fieldName] = array('required' => false); + $resourceParameters['fields'][$fieldName] = array_merge( + $resourceParameters['fields'][$fieldName], + $resourceParameters['fields'][$fieldName] = array('sqlId' => $fieldName, 'maxSize' => $maxSize, 'i18n' => true) + ); + } + if (isset($this->fieldsValidateLang)) + foreach ($this->fieldsValidateLang as $fieldName => $validateMethod) + { + if (!isset($resourceParameters['fields'][$fieldName])) + $resourceParameters['fields'][$fieldName] = array('required' => false); + $resourceParameters['fields'][$fieldName] = array_merge( + $resourceParameters['fields'][$fieldName], + $resourceParameters['fields'][$fieldName] = array( + 'sqlId' => $fieldName, + 'validateMethod' => ( + array_key_exists('validateMethod', $resourceParameters['fields'][$fieldName]) ? + array_merge($resourceParameters['fields'][$fieldName]['validateMethod'], array($validateMethod)) : + array($validateMethod) + ), + 'i18n' => true + ) + ); + } + if (isset($this->fieldsRequiredLang)) + foreach ($this->fieldsRequiredLang as $field) + { + if (!isset($resourceParameters['fields'][$field])) + $resourceParameters['fields'][$field] = array(); + $resourceParameters['fields'][$field] = array_merge( + $resourceParameters['fields'][$field], + $resourceParameters['fields'][$field] = array('sqlId' => $field, 'required' => true, 'i18n' => true) + ); + } + foreach ($resourceParameters['fields'] as $key => &$resourceParametersField) + if (!isset($resourceParametersField['sqlId'])) + $resourceParametersField['sqlId'] = $key; + return $resourceParameters; + } + + public function getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit) + { + $query = ' + SELECT DISTINCT main.`'.$this->identifier.'` FROM `'._DB_PREFIX_.$this->table.'` main + '.$sql_join.' + WHERE 1 '.$sql_filter.' + '.($sql_sort != '' ? $sql_sort : '').' + '.($sql_limit != '' ? $sql_limit : '').' + '; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + } + + public function getFieldsRequiredDatabase($all = false) + { + return Db::getInstance()->ExecuteS(' + SELECT id_required_field, object_name, field_name + FROM '._DB_PREFIX_.'required_field + WHERE 1 '.(!$all ? ' AND object_name = \''.pSQL(get_class($this)).'\'' : '')); + } + + public function addFieldsRequiredDatabase($fields) + { + if (!is_array($fields)) + return false; + + if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'required_field WHERE object_name = \''.pSQL(get_class($this)).'\'')) + return false; + + foreach ($fields AS $field) + if (!Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'required_field (id_required_field, object_name, field_name) + VALUES(\'\', \''.pSQL(get_class($this)).'\', \''.pSQL($field).'\')')) + return false; + + return true; + } + + public function clearCache($all = false) + { + if ($all AND isset(self::$_cache[$this->table])) + unset(self::$_cache[$this->table]); + elseif ($this->id AND isset(self::$_cache[$this->table][(int)$this->id])) + unset(self::$_cache[$this->table][(int)$this->id]); + } +} + diff --git a/classes/Order.php b/classes/Order.php new file mode 100644 index 000000000..bbabe41c7 --- /dev/null +++ b/classes/Order.php @@ -0,0 +1,1042 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderCore extends ObjectModel +{ + /** @var integer Delivery address id */ + public $id_address_delivery; + + /** @var integer Invoice address id */ + public $id_address_invoice; + + /** @var integer Cart id */ + public $id_cart; + + /** @var integer Currency id */ + public $id_currency; + + /** @var integer Language id */ + public $id_lang; + + /** @var integer Customer id */ + public $id_customer; + + /** @var integer Carrier id */ + public $id_carrier; + + /** @var string Secure key */ + public $secure_key; + + /** @var string Payment method id */ + public $payment; + + /** @var string Payment module */ + public $module; + + /** @var float Currency conversion rate */ + public $conversion_rate; + + /** @var boolean Customer is ok for a recyclable package */ + public $recyclable = 1; + + /** @var boolean True if the customer wants a gift wrapping */ + public $gift = 0; + + /** @var string Gift message if specified */ + public $gift_message; + + /** @var string Shipping number */ + public $shipping_number; + + /** @var float Discounts total */ + public $total_discounts; + + /** @var float Total to pay */ + public $total_paid; + + /** @var float Total really paid */ + public $total_paid_real; + + /** @var float Products total */ + public $total_products; + + /** @var float Products total tax excluded */ + public $total_products_wt; + + /** @var float Shipping total */ + public $total_shipping; + + /** @var float Shipping tax rate */ + public $carrier_tax_rate; + + /** @var float Wrapping total */ + public $total_wrapping; + + /** @var integer Invoice number */ + public $invoice_number; + + /** @var integer Delivery number */ + public $delivery_number; + + /** @var string Invoice creation date */ + public $invoice_date; + + /** @var string Delivery creation date */ + public $delivery_date; + + /** @var boolean Order validity (paid and not canceled) */ + public $valid; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $tables = array ('orders'); + + protected $fieldsRequired = array('conversion_rate', 'id_address_delivery', 'id_address_invoice', 'id_cart', 'id_currency', 'id_lang', 'id_customer', 'id_carrier', 'payment', 'total_paid', 'total_paid_real', 'total_products', 'total_products_wt'); + protected $fieldsSize = array('payment' => 32); + protected $fieldsValidate = array( + 'id_address_delivery' => 'isUnsignedId', + 'id_address_invoice' => 'isUnsignedId', + 'id_cart' => 'isUnsignedId', + 'id_currency' => 'isUnsignedId', + 'id_lang' => 'isUnsignedId', + 'id_customer' => 'isUnsignedId', + 'id_carrier' => 'isUnsignedId', + 'secure_key' => 'isMd5', + 'payment' => 'isGenericName', + 'recyclable' => 'isBool', + 'gift' => 'isBool', + 'gift_message' => 'isMessage', + 'total_discounts' => 'isPrice', + 'total_paid' => 'isPrice', + 'total_paid_real' => 'isPrice', + 'total_products' => 'isPrice', + 'total_products_wt' => 'isPrice', + 'total_shipping' => 'isPrice', + 'carrier_tax_rate' => 'isFloat', + 'total_wrapping' => 'isPrice', + 'shipping_number' => 'isUrl', + 'conversion_rate' => 'isFloat' + ); + + protected $webserviceParameters = array( + 'objectMethods' => array('add' => 'addWs'), + 'objectNodeName' => 'order', + 'objectsNodeName' => 'orders', + 'fields' => array( + 'id_address_delivery' => array('xlink_resource'=> 'addresses'), + 'id_address_invoice' => array('xlink_resource'=> 'addresses'), + 'id_cart' => array('xlink_resource'=> 'carts'), + 'id_currency' => array('xlink_resource'=> 'currencies'), + 'id_lang' => array('xlink_resource'=> 'languages'), + 'id_customer' => array('xlink_resource'=> 'customers'), + 'id_carrier' => array('xlink_resource'=> 'carriers'), + 'module' => array(), // mettre en requis + 'invoice_number' => array(), + 'delivery_number' => array(), + 'invoice_date' => array(), + 'delivery_date' => array(), + 'valid' => array(), + 'current_state' => array('getter' => 'getCurrentState', 'setter' => 'setCurrentState', 'xlink_resource'=> 'order_states'), + 'date_add' => array(), + 'date_upd' => array(), + ), + 'associations' => array( + 'order_rows' => array('resource' => 'order_row', 'setter' => null, + 'fields' => array( + 'id' => array(), + 'product_id' => array('required' => true), + 'product_attribute_id' => array('required' => true), + 'product_quantity' => array('required' => true), + 'product_name' => array('setter' => null), + 'product_price' => array('setter' => null), + )), + ), + + ); + + /* MySQL does not allow 'order' for a table name */ + protected $table = 'orders'; + protected $identifier = 'id_order'; + protected $_taxCalculationMethod = PS_TAX_EXC; + + protected static $_historyCache = array(); + + public function getFields() + { + parent::validateFields(); + + $fields['id_address_delivery'] = (int)($this->id_address_delivery); + $fields['id_address_invoice'] = (int)($this->id_address_invoice); + $fields['id_cart'] = (int)($this->id_cart); + $fields['id_currency'] = (int)($this->id_currency); + $fields['id_lang'] = (int)($this->id_lang); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['secure_key'] = pSQL($this->secure_key); + $fields['payment'] = pSQL($this->payment); + $fields['module'] = pSQL($this->module); + $fields['conversion_rate'] = (float)($this->conversion_rate); + $fields['recyclable'] = (int)($this->recyclable); + $fields['gift'] = (int)($this->gift); + $fields['gift_message'] = pSQL($this->gift_message); + $fields['shipping_number'] = pSQL($this->shipping_number); + $fields['total_discounts'] = (float)($this->total_discounts); + $fields['total_paid'] = (float)($this->total_paid); + $fields['total_paid_real'] = (float)($this->total_paid_real); + $fields['total_products'] = (float)($this->total_products); + $fields['total_products_wt'] = (float)($this->total_products_wt); + $fields['total_shipping'] = (float)($this->total_shipping); + $fields['carrier_tax_rate'] = (float)($this->carrier_tax_rate); + $fields['total_wrapping'] = (float)($this->total_wrapping); + $fields['invoice_number'] = (int)($this->invoice_number); + $fields['delivery_number'] = (int)($this->delivery_number); + $fields['invoice_date'] = pSQL($this->invoice_date); + $fields['delivery_date'] = pSQL($this->delivery_date); + $fields['valid'] = (int)($this->valid) ? 1 : 0; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id, $id_lang); + if ($this->id_customer) + { + $customer = new Customer((int)($this->id_customer)); + $this->_taxCalculationMethod = Group::getPriceDisplayMethod((int)($customer->id_default_group)); + } + else + $this->_taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); + } + + public function getTaxCalculationMethod() + { + return (int)($this->_taxCalculationMethod); + } + + /* Does NOT delete a product but "cancel" it (which means return/refund/delete it depending of the case) */ + public function deleteProduct($order, $orderDetail, $quantity) + { + if (!$currentStatus = (int)($this->getCurrentState())) + return false; + + if ($this->hasBeenDelivered()) + { + if (!Configuration::get('PS_ORDER_RETURN')) + die(Tools::displayError()); + $orderDetail->product_quantity_return += (int)($quantity); + return $orderDetail->update(); + } + elseif ($this->hasBeenPaid()) + { + $orderDetail->product_quantity_refunded += (int)($quantity); + return $orderDetail->update(); + } + return $this->_deleteProduct($orderDetail, (int)($quantity)); + } + + /* DOES delete the product */ + protected function _deleteProduct($orderDetail, $quantity) + { + $price = $orderDetail->product_price * (1 + $orderDetail->tax_rate * 0.01); + if ($orderDetail->reduction_percent != 0.00) + $reduction_amount = $price * $orderDetail->reduction_percent / 100; + elseif ($orderDetail->reduction_amount != '0.000000') + $reduction_amount = Tools::ps_round($orderDetail->reduction_amount, 2); + if (isset($reduction_amount) AND $reduction_amount) + $price = Tools::ps_round($price - $reduction_amount, 2); + $productPriceWithoutTax = number_format($price / (1 + $orderDetail->tax_rate * 0.01), 2, '.', ''); + $price += Tools::ps_round($orderDetail->ecotax * (1 + $orderDetail->ecotax_tax_rate / 100), 2); + $productPrice = number_format($quantity * $price, 2, '.', ''); + /* Update cart */ + $cart = new Cart($this->id_cart); + $cart->updateQty($quantity, $orderDetail->product_id, $orderDetail->product_attribute_id, false, 'down'); // customization are deleted in deleteCustomization + $cart->update(); + + /* Update order */ + $shippingDiff = $this->total_shipping - $cart->getOrderShippingCost(); + $this->total_products -= $productPriceWithoutTax; + $this->total_products_wt -= $productPrice; + $this->total_shipping = $cart->getOrderShippingCost(); + /* It's temporary fix for 1.3 version... */ + if ($orderDetail->product_quantity_discount != '0.000000') + $this->total_paid -= ($productPrice + $shippingDiff); + else + $this->total_paid = $cart->getOrderTotal(); + $this->total_paid_real -= ($productPrice + $shippingDiff); + + /* Prevent from floating precision issues (total_products has only 2 decimals) */ + if ($this->total_products < 0) + $this->total_products = 0; + + /* Prevent from floating precision issues */ + $this->total_paid = number_format($this->total_paid, 2, '.', ''); + $this->total_paid_real = number_format($this->total_paid_real, 2, '.', ''); + $this->total_products = number_format($this->total_products, 2, '.', ''); + $this->total_products_wt = number_format($this->total_products_wt, 2, '.', ''); + + /* Update order detail */ + $orderDetail->product_quantity -= (int)($quantity); + + if (!$orderDetail->product_quantity) + { + if (!$orderDetail->delete()) + return false; + if (count($this->getProductsDetail()) == 0) + { + global $cookie; + $history = new OrderHistory(); + $history->id_order = (int)($this->id); + $history->changeIdOrderState(_PS_OS_CANCELED_, (int)($this->id)); + if (!$history->addWithemail()) + return false; + } + return $this->update(); + } + return $orderDetail->update() AND $this->update(); + } + + public function deleteCustomization($id_customization, $quantity, $orderDetail) + { + if (!$currentStatus = (int)($this->getCurrentState())) + return false; + + if ($this->hasBeenDelivered()) + return Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization` SET `quantity_returned` = `quantity_returned` + '.(int)($quantity).' WHERE `id_customization` = '.(int)($id_customization).' AND `id_cart` = '.(int)($this->id_cart).' AND `id_product` = '.(int)($orderDetail->product_id)); + elseif ($this->hasBeenPaid()) + return Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization` SET `quantity_refunded` = `quantity_refunded` + '.(int)($quantity).' WHERE `id_customization` = '.(int)($id_customization).' AND `id_cart` = '.(int)($this->id_cart).' AND `id_product` = '.(int)($orderDetail->product_id)); + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization` SET `quantity` = `quantity` - '.(int)($quantity).' WHERE `id_customization` = '.(int)($id_customization).' AND `id_cart` = '.(int)($this->id_cart).' AND `id_product` = '.(int)($orderDetail->product_id))) + return false; + if (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `quantity` = 0')) + return false; + return $this->_deleteProduct($orderDetail, (int)($quantity)); + } + + /** + * Get order history + * + * @param integer $id_lang Language id + * + * @return array History entries ordered by date DESC + */ + public function getHistory($id_lang, $id_order_state = false, $no_hidden = false) + { + if (!$id_order_state) + $id_order_state = 0; + + if (!isset(self::$_historyCache[$id_order_state]) OR $no_hidden) + { + $id_lang = $id_lang ? (int)($id_lang) : 'o.`id_lang`'; + $result = Db::getInstance()->ExecuteS(' + SELECT oh.*, e.`firstname` AS employee_firstname, e.`lastname` AS employee_lastname, osl.`name` AS ostate_name + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON o.`id_order` = oh.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON os.`id_order_state` = oh.`id_order_state` + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = oh.`id_employee` + WHERE oh.id_order = '.(int)($this->id).' + '.($no_hidden ? ' AND os.hidden = 0' : '').' + '.((int)($id_order_state) ? ' AND oh.`id_order_state` = '.(int)($id_order_state) : '').' + ORDER BY oh.date_add DESC, oh.id_order_history DESC'); + if ($no_hidden) + return $result; + self::$_historyCache[$id_order_state] = $result; + } + return self::$_historyCache[$id_order_state]; + } + + public function getProductsDetail() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_detail` od + WHERE od.`id_order` = '.(int)($this->id)); + } + + + /** + * @return string + * @deprecated + */ + public function getLastMessage() + { + Tools::displayAsDeprecated(); + $sql = 'SELECT `message` FROM `'._DB_PREFIX_.'message` WHERE `id_order` = '.(int)($this->id).' ORDER BY `id_message` desc'; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); + return $result['message']; + } + + public function getFirstMessage() + { + $sql = 'SELECT `message` FROM `'._DB_PREFIX_.'message` WHERE `id_order` = '.(int)($this->id).' ORDER BY `id_message` asc'; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); + return $result['message']; + } + + public function setProductPrices(&$row) + { + if ($this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price'] = Tools::ps_round($row['product_price'], 2); + else + $row['product_price_wt'] = Tools::ps_round($row['product_price'] * (1 + $row['tax_rate'] / 100), 2); + + if ($row['reduction_percent']) + { + if ($this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price'] = $row['product_price'] - $row['product_price'] * ($row['reduction_percent'] * 0.01); + else + $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] - $row['product_price_wt'] * ($row['reduction_percent'] * 0.01), 2); + } + + if ($row['reduction_amount']) + { + if ($this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price'] = $row['product_price'] - $row['reduction_amount'] / (1 + $row['tax_rate'] / 100); + else + $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] - $row['reduction_amount'], 2); + } + + if ($row['group_reduction']) + { + if ($this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price'] = $row['product_price'] - $row['product_price'] * ($row['group_reduction'] * 0.01); + else + $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] - $row['product_price_wt'] * ($row['group_reduction'] * 0.01), 2); + } + + if (($row['reduction_percent'] OR $row['reduction_amount'] OR $row['group_reduction']) AND $this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price'] = Tools::ps_round($row['product_price'], 2); + + if ($this->_taxCalculationMethod == PS_TAX_EXC) + $row['product_price_wt'] = Tools::ps_round($row['product_price'] * (1 + ($row['tax_rate'] * 0.01)), 2) + Tools::ps_round($row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100), 2); + else + { + $row['product_price_wt_but_ecotax'] = $row['product_price_wt']; + $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] + $row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100), 2); + } + + $row['total_wt'] = $row['product_quantity'] * $row['product_price_wt']; + $row['total_price'] = $row['product_quantity'] * $row['product_price']; + } + + /** + * Get order products + * + * @return array Products with price, quantity (with taxe and without) + */ + public function getProducts($products = false, $selectedProducts = false, $selectedQty = false) + { + if (!$products) + $products = $this->getProductsDetail(); + $resultArray = array(); + foreach ($products AS $k => $row) + { + // Change qty if selected + if ($selectedQty) + { + $row['product_quantity'] = 0; + foreach ($selectedProducts AS $key => $id_product) + if ($row['id_order_detail'] == $id_product) + $row['product_quantity'] = (int)($selectedQty[$key]); + if (!$row['product_quantity']) + continue ; + } + $this->setProductPrices($row); + + /* Add information for virtual product */ + if ($row['download_hash'] AND !empty($row['download_hash'])) + $row['filename'] = ProductDownload::getFilenameFromIdProduct($row['product_id']); + + /* Stock product */ + $resultArray[(int)($row['id_order_detail'])] = $row; + } + return $resultArray; + } + + public function getTaxesAverageUsed() + { + return Cart::getTaxesAverageUsed((int)($this->id_cart)); + } + + /** + * Count virtual products in order + * + * @return int number of virtual products + */ + public function getVirtualProducts() + { + $sql = ' + SELECT `product_id`, `download_hash`, `download_deadline` + FROM `'._DB_PREFIX_.'order_detail` od + WHERE od.`id_order` = '.(int)($this->id).' + AND `download_hash` <> \'\''; + return Db::getInstance()->ExecuteS($sql); + } + + /** + * Check if order contains (only) virtual products + * @return boolean true if is a virtual order or false + * + */ + public function isVirtual($strict = true) + { + $products = $this->getProducts(); + if (count($products) < 1) + return false; + $virtual = false; + foreach ($products AS $product) + { + $pd = ProductDownload::getIdFromIdProduct((int)($product['product_id'])); + if ($pd AND Validate::isUnsignedInt($pd) AND $product['download_hash']) + { + if ($strict === false) + return true; + $virtual &= true; + } + } + return $virtual; + } + + + /** + * Get order discounts + * + * @return array Discounts with price and quantity + */ + public function getDiscounts($details = false) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_discount` od '. + ($details ? 'LEFT JOIN `'._DB_PREFIX_.'discount` d ON (d.`id_discount` = od.`id_discount`)' : '').' + WHERE od.`id_order` = '.(int)($this->id)); + } + + static public function getDiscountsCustomer($id_customer, $id_discount) + { + return Db::getInstance()->getValue(' + SELECT COUNT(*) FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN '._DB_PREFIX_.'order_discount od ON (od.id_order = o.id_order) + WHERE o.id_customer = '.(int)($id_customer).' + AND od.id_discount = '.(int)($id_discount)); + } + + /** + * Get current order state (eg. Awaiting payment, Delivered...) + * + * @return array Order state details + */ + public function getCurrentState() + { + $orderHistory = OrderHistory::getLastOrderState($this->id); + if (!isset($orderHistory) OR !$orderHistory) + return false; + return $orderHistory->id; + } + + /** + * Get current order state name (eg. Awaiting payment, Delivered...) + * + * @return array Order state details + */ + public function getCurrentStateFull($id_lang) + { + return Db::getInstance()->getRow(' + SELECT oh.`id_order_state`, osl.`name`, os.`logable` + FROM `'._DB_PREFIX_.'order_history` oh + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (osl.`id_order_state` = oh.`id_order_state`) + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) + WHERE osl.`id_lang` = '.(int)($id_lang).' AND oh.`id_order` = '.(int)($this->id).' + ORDER BY `date_add` DESC, `id_order_history` DESC'); + } + + /** + * @deprecated + */ + public function isLogable() + { + Tools::displayAsDeprecated(); + return $this->valid; + } + + public function hasBeenDelivered() + { + return sizeof($this->getHistory((int)($this->id_lang), _PS_OS_DELIVERED_)); + } + + public function hasBeenPaid() + { + return sizeof($this->getHistory((int)($this->id_lang), _PS_OS_PAYMENT_)); + } + + public function hasBeenShipped() + { + return sizeof($this->getHistory((int)($this->id_lang), _PS_OS_SHIPPING_)); + } + + public function isInPreparation() + { + return sizeof($this->getHistory((int)($this->id_lang), _PS_OS_PREPARATION_)); + } + + /** + * Get customer orders + * + * @param integer $id_customer Customer id + * @return array Customer orders + */ + static public function getCustomerOrders($id_customer) + { + global $cookie; + + $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT o.*, ( + SELECT SUM(od.`product_quantity`) + FROM `'._DB_PREFIX_.'order_detail` od + WHERE od.`id_order` = o.`id_order`) + AS nb_products + FROM `'._DB_PREFIX_.'orders` o + WHERE o.`id_customer` = '.(int)($id_customer).' + GROUP BY o.`id_order` + ORDER BY o.`date_add` DESC'); + if (!$res) + return array(); + + foreach ($res AS $key => $val) + { + $res2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT os.`id_order_state`, osl.`name` AS order_state, os.`invoice` + FROM `'._DB_PREFIX_.'order_history` oh + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) + INNER JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)($cookie->id_lang).') + WHERE oh.`id_order` = '.(int)($val['id_order']).' + AND os.`hidden` != 1 + ORDER BY oh.`date_add` DESC, oh.`id_order_history` DESC + LIMIT 1 + '); + if ($res2) + $res[$key] = array_merge($res[$key], $res2[0]); + } + return $res; + } + + static public function getOrdersIdByDate($date_from, $date_to, $id_customer = NULL, $type = NULL) + { + $sql = ' + SELECT `id_order` + FROM `'._DB_PREFIX_.'orders` + WHERE DATE_ADD(date_upd, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' AND date_upd >= \''.pSQL($date_from).'\'' + .($type ? ' AND '.pSQL(strval($type)).'_number != 0' : '') + .($id_customer ? ' AND id_customer = '.(int)($id_customer) : ''); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + + $orders = array(); + foreach ($result AS $order) + $orders[] = (int)($order['id_order']); + return $orders; + } + + /* + * @deprecated + */ + static public function getOrders($limit = NULL) + { + Tools::displayAsDeprecated(); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'orders` + ORDER BY `date_add` + '.((int)$limit ? 'LIMIT 0, '.(int)$limit : '')); + } + + static public function getOrdersWithInformations($limit = NULL) + { + global $cookie; + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT *, ( + SELECT `name` + FROM `'._DB_PREFIX_.'order_history` oh + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (osl.`id_order_state` = oh.`id_order_state`) + WHERE oh.`id_order` = o.`id_order` + AND osl.`id_lang` = '.(int)$cookie->id_lang.' + ORDER BY oh.`date_add` DESC + LIMIT 1 + ) AS `state_name` + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + ORDER BY o.`date_add` DESC + '.((int)$limit ? 'LIMIT 0, '.(int)$limit : '')); + } + + static public function getOrdersIdInvoiceByDate($date_from, $date_to, $id_customer = NULL, $type = NULL) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `id_order` + FROM `'._DB_PREFIX_.'orders` + WHERE DATE_ADD(invoice_date, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' AND invoice_date >= \''.pSQL($date_from).'\'' + .($type ? ' AND '.pSQL(strval($type)).'_number != 0' : '') + .($id_customer ? ' AND id_customer = '.(int)($id_customer) : ''). + ' ORDER BY invoice_date ASC'); + + $orders = array(); + foreach ($result AS $order) + $orders[] = (int)($order['id_order']); + return $orders; + } + + static public function getOrderIdsByStatus($id_order_state) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT id_order + FROM '._DB_PREFIX_.'orders o + WHERE '.(int)$id_order_state.' = ( + SELECT id_order_state + FROM '._DB_PREFIX_.'order_history oh + WHERE oh.id_order = o .id_order + ORDER BY date_add DESC, id_order_history DESC + LIMIT 1 + ) + ORDER BY invoice_date ASC'); + + $orders = array(); + foreach ($result AS $order) + $orders[] = (int)($order['id_order']); + return $orders; + } + + /** + * Get product total without taxes + * + * @return Product total with taxes + */ + public function getTotalProductsWithoutTaxes($products = false) + { + return $this->total_products; + } + + /** + * Get product total with taxes + * + * @return Product total with taxes + */ + public function getTotalProductsWithTaxes($products = false) + { + if ($this->total_products_wt != '0.00' AND !$products) + return $this->total_products_wt; + /* Retro-compatibility (now set directly on the validateOrder() method) */ + if (!$products) + $products = $this->getProductsDetail(); + + $return = 0; + foreach ($products AS $k => $row) + { + $price = Tools::ps_round($row['product_price'] * (1 + $row['tax_rate'] / 100), 2); + if ($row['reduction_percent']) + $price -= $price * ($row['reduction_percent'] * 0.01); + if ($row['reduction_amount']) + $price -= $row['reduction_amount'] * (1 + ($row['tax_rate'] * 0.01)); + if ($row['group_reduction']) + $price -= $price * ($row['group_reduction'] * 0.01); + $price += $row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100); + $return += Tools::ps_round($price, 2) * $row['product_quantity']; + } + if (!$products) + { + $this->total_products_wt = $return; + $this->update(); + } + return $return; + } + + /** + * Get customer orders number + * + * @param integer $id_customer Customer id + * @return array Customer orders number + */ + static public function getCustomerNbOrders($id_customer) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_order`) AS nb + FROM `'._DB_PREFIX_.'orders` + WHERE `id_customer` = '.(int)($id_customer)); + + return isset($result['nb']) ? $result['nb'] : 0; + } + + /** + * Get an order by its cart id + * + * @param integer $id_cart Cart id + * @return array Order details + */ + static public function getOrderByCartId($id_cart) + { + $result = Db::getInstance()->getRow(' + SELECT `id_order` + FROM `'._DB_PREFIX_.'orders` + WHERE `id_cart` = '.(int)($id_cart)); + + return isset($result['id_order']) ? $result['id_order'] : false; + } + + /** + * Add a discount to order + * + * @param integer $id_discount Discount id + * @param string $name Discount name + * @param float $value Discount value + * @return boolean Query sucess or not + */ + public function addDiscount($id_discount, $name, $value) + { + return Db::getInstance()->AutoExecute(_DB_PREFIX_.'order_discount', array('id_order' => (int)($this->id), 'id_discount' => (int)($id_discount), 'name' => pSQL($name), 'value' => (float)($value)), 'INSERT'); + } + + /** + * Get orders number last week + * + * @return integer Orders number last week + * @deprecated + */ + public static function getWeeklyOrders() + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_order`) as nb + FROM `'._DB_PREFIX_.'orders` + WHERE YEARWEEK(`date_add`) = YEARWEEK(NOW())'); + + return isset($result['nb']) ? $result['nb'] : 0; + } + + /** + * Get sales amount last month + * + * @return float Sales amount last month + * @deprecated + */ + public static function getMonthlySales() + { + Tools::displayAsDeprecated(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(`total_paid`) as nb + FROM `'._DB_PREFIX_.'orders` + WHERE MONTH(`date_add`) = MONTH(NOW()) + AND YEAR(`date_add`) = YEAR(NOW())'); + + return isset($result['nb']) ? $result['nb'] : 0; + } + + public function getNumberOfDays() + { + $nbReturnDays = (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS')); + if (!$nbReturnDays) + return true; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT TO_DAYS(NOW()) - TO_DAYS(`delivery_date`) AS days FROM `'._DB_PREFIX_.'orders` + WHERE `id_order` = '.(int)($this->id)); + if ($result['days'] <= $nbReturnDays) + return true; + return false; + } + + + public function isReturnable() + { + return ((int)(Configuration::get('PS_ORDER_RETURN')) == 1 AND (int)($this->getCurrentState()) == _PS_OS_DELIVERED_ AND $this->getNumberOfDays()); + } + + + public static function getLastInvoiceNumber() + { + return (int)Db::getInstance()->getValue(' + SELECT MAX(`invoice_number`) AS `invoice_number` + FROM `'._DB_PREFIX_.'orders` + '); + } + + public function setInvoice() + { + $number = (int)Configuration::get('PS_INVOICE_START_NUMBER'); + + if ($number) + Configuration::updateValue('PS_INVOICE_START_NUMBER', false); + else + $number = '(SELECT `invoice_number` + FROM ( + SELECT MAX(`invoice_number`) + 1 AS `invoice_number` + FROM `'._DB_PREFIX_.'orders`) + tmp )'; + + // a way to avoid duplicate invoice number + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'orders` + SET `invoice_number` = '.$number.', `invoice_date` = \''.date('Y-m-d H:i:s').'\' + WHERE `id_order` = '.(int)$this->id + ); + + $res = Db::getInstance()->getRow(' + SELECT `invoice_number`, `invoice_date` + FROM `'._DB_PREFIX_.'orders` + WHERE `id_order` = '.(int)$this->id + ); + + $this->invoice_date = $res['invoice_date']; + $this->invoice_number = $res['invoice_number']; + } + + public function setDelivery() + { + // Set delivery number + $number = (int)(Configuration::get('PS_DELIVERY_NUMBER')); + if (!(int)($number)) + die(Tools::displayError('Invalid delivery number')); + $this->delivery_number = $number; + Configuration::updateValue('PS_DELIVERY_NUMBER', $number + 1); + + // Set delivery date + $this->delivery_date = date('Y-m-d H:i:s'); + + // Update object + $this->update(); + } + + static public function printPDFIcons($id_order, $tr) + { + $order = new Order($id_order); + $orderState = OrderHistory::getLastOrderState($id_order); + if (!Validate::isLoadedObject($orderState) OR !Validate::isLoadedObject($order)) + die(Tools::displayError('Invalid objects')); + echo ''; + if (($orderState->invoice AND $order->invoice_number) AND (int)($tr['product_number'])) + echo 'invoice'; + else + echo ' '; + echo ''; + echo ''; + if ($orderState->delivery AND $order->delivery_number) + echo 'delivery'; + else + echo ' '; + echo ''; + } + + static public function getByDelivery($id_delivery) + { + $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT id_order + FROM `'._DB_PREFIX_.'orders` + WHERE `delivery_number` = '.(int)($id_delivery)); + return new Order((int)($res['id_order'])); + } + + public function getTotalWeight() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(product_weight * product_quantity) weight + FROM '._DB_PREFIX_.'order_detail + WHERE id_order = '.(int)($this->id)); + + return (float)($result['weight']); + } + + static public function getInvoice($id_invoice) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `invoice_number`, `id_order` + FROM `'._DB_PREFIX_.'orders` + WHERE invoice_number = '.(int)($id_invoice)); + } + + public function isAssociatedAtGuest($email) + { + if (!$email) + return false; + return (bool)Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + WHERE o.`id_order` = '.(int)$this->id.' + AND c.`email` = \''.pSQL($email).'\' + AND c.`is_guest` = 1 + '); + } + + /** + * @param int $id_order + * @param int $id_customer optionnal + * @return int id_cart + */ + static public function getCartIdStatic($id_order, $id_customer = 0) + { + return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `id_cart` + FROM `'._DB_PREFIX_.'orders` + WHERE `id_order` = '.(int)$id_order.' + '.($id_customer ? 'AND `id_customer` = '.(int)$id_customer : '')); + } + + public function getWsOrderRows() + { + $query = 'SELECT id_order_detail as `id`, id_order, product_attribute_id, product_quantity, product_name + FROM `'._DB_PREFIX_.'order_detail` + WHERE id_order = '.(int)$this->id; + $result = Db::getInstance()->executeS($query); + return $result; + } + + public function setCurrentState($id_order_state) + { + $history = new OrderHistory(); + $history->id_order = (int)($this->id); + $history->changeIdOrderState((int)$id_order_state, (int)($this->id)); + } + + public function addWs($autodate = true, $nullValues = false) + { + $paymentModule = Module::getInstanceByName($this->module); + $id_order_state = 1; // TODO + $customer = new Customer($this->id_customer); + $paymentModule->validateOrder($this->id_cart, $id_order_state, $this->total_paid, $this->payment, NULL, array(), null, false, $customer->secure_key); + return true; + } + + public function deleteAssociations() + { + return (Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'order_detail` + WHERE `id_order` = '.(int)($this->id)) !== false); + } +} diff --git a/classes/OrderDetail.php b/classes/OrderDetail.php new file mode 100644 index 000000000..9f1c4891f --- /dev/null +++ b/classes/OrderDetail.php @@ -0,0 +1,218 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderDetailCore extends ObjectModel +{ + /** @var integer */ + public $id_order_detail; + + /** @var integer */ + public $id_order; + + /** @var integer */ + public $product_id; + + /** @var integer */ + public $product_attribute_id; + + /** @var string */ + public $product_name; + + /** @var integer */ + public $product_quantity; + + /** @var integer */ + public $product_quantity_in_stock; + + /** @var integer */ + public $product_quantity_return; + + /** @var integer */ + public $product_quantity_refunded; + + /** @var integer */ + public $product_quantity_reinjected; + + /** @var float */ + public $product_price; + + /** @var float */ + public $reduction_percent; + + /** @var float */ + public $reduction_amount; + + /** @var float */ + public $group_reduction; + + /** @var float */ + public $product_quantity_discount; + + /** @var string */ + public $product_ean13; + + /** @var string */ + public $product_upc; + + /** @var string */ + public $product_reference; + + /** @var string */ + public $product_supplier_reference; + + /** @var float */ + public $product_weight; + + /** @var string */ + public $tax_name; + + /** @var float */ + public $tax_rate; + + /** @var float */ + public $ecotax; + + /** @var float */ + public $ecotax_tax_rate; + + /** @var integer */ + public $discount_quantity_applied; + + /** @var string */ + public $download_hash; + + /** @var integer */ + public $download_nb; + + /** @var date */ + public $download_deadline; + + protected $tables = array ('order_detail'); + + protected $fieldsRequired = array ('id_order', 'product_name', 'product_quantity', 'product_price', 'tax_rate'); + + protected $fieldsValidate = array ( + 'id_order' => 'isUnsignedId', + 'product_id' => 'isUnsignedId', + 'product_attribute_id' => 'isUnsignedId', + 'product_name' => 'isGenericName', + 'product_quantity' => 'isInt', + 'product_quantity_in_stock' => 'isInt', + 'product_quantity_return' => 'isUnsignedInt', + 'product_quantity_refunded' => 'isUnsignedInt', + 'product_quantity_reinjected' => 'isUnsignedInt', + 'product_price' => 'isPrice', + 'reduction_percent' => 'isFloat', + 'reduction_amount' => 'isPrice', + 'group_reduction' => 'isFloat', + 'product_quantity_discount' => 'isFloat', + 'product_ean13' => 'isEan13', + 'product_upc' => 'isUpc', + 'product_reference' => 'isReference', + 'product_supplier_reference' => 'isReference', + 'product_weight' => 'isFloat', + 'tax_name' => 'isGenericName', + 'tax_rate' => 'isFloat', + 'ecotax' => 'isFloat', + 'ecotax_tax_rate' => 'isFloat', + 'download_nb' => 'isInt', + ); + + protected $table = 'order_detail'; + protected $identifier = 'id_order_detail'; + + protected $webserviceParameters = array( + 'fields' => array ( + 'id_order' => array('xlink_resource' => 'orders'), + 'product_id' => array('xlink_resource' => 'products'), + 'product_attribute_id' => array('xlink_resource' => 'product_attributes'), + 'product_quantity_reinjected' => array(), + 'group_reduction' => array(), + 'discount_quantity_applied' => array(), + 'download_hash' => array(), + 'download_deadline' => array() + ) + ); + + + public function getFields() + { + parent::validateFields(); + + $fields['id_order'] = (int)($this->id_order); + $fields['product_id'] = (int)($this->product_id); + $fields['product_attribute_id'] = (int)($this->product_attribute_id); + $fields['product_name'] = pSQL($this->product_name); + $fields['product_quantity'] = (int)($this->product_quantity); + $fields['product_quantity_in_stock'] = (int)($this->product_quantity_in_stock); + $fields['product_quantity_return'] = (int)($this->product_quantity_return); + $fields['product_quantity_refunded'] = (int)($this->product_quantity_refunded); + $fields['product_quantity_reinjected'] = (int)($this->product_quantity_reinjected); + $fields['product_price'] = (float)($this->product_price); + $fields['reduction_percent'] = (float)($this->reduction_percent); + $fields['reduction_amount'] = (float)($this->reduction_amount); + $fields['group_reduction'] = (float)($this->group_reduction); + $fields['product_quantity_discount'] = (float)($this->product_quantity_discount); + $fields['product_ean13'] = pSQL($this->product_ean13); + $fields['product_upc'] = pSQL($this->product_upc); + $fields['product_reference'] = pSQL($this->product_reference); + $fields['product_supplier_reference'] = pSQL($this->product_reference); + $fields['product_weight'] = (float)($this->product_weight); + $fields['tax_name'] = pSQL($this->tax_name); + $fields['tax_rate'] = (float)($this->tax_rate); + $fields['ecotax'] = (float)($this->ecotax); + $fields['ecotax_tax_rate'] = (float)($this->ecotax_tax_rate); + $fields['download_hash'] = pSQL($this->download_hash); + $fields['download_nb'] = (int)($this->download_nb); + $fields['download_deadline'] = pSQL($this->download_deadline); + + return $fields; + } + + static public function getDownloadFromHash($hash) + { + if ($hash == '') return false; + $sql = 'SELECT * + FROM `'._DB_PREFIX_.'order_detail` od + LEFT JOIN `'._DB_PREFIX_.'product_download` pd ON (od.`product_id`=pd.`id_product`) + WHERE od.`download_hash` = \''.pSQL(strval($hash)).'\' + AND pd.`active` = 1'; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); + } + + static public function incrementDownload($id_order_detail, $increment=1) + { + $sql = 'UPDATE `'._DB_PREFIX_.'order_detail` + SET `download_nb` = `download_nb` + '.(int)($increment).' + WHERE `id_order_detail`= '.(int)($id_order_detail).' + LIMIT 1'; + return Db::getInstance()->Execute($sql); + } + +} + + diff --git a/classes/OrderDiscount.php b/classes/OrderDiscount.php new file mode 100644 index 000000000..4a5655d48 --- /dev/null +++ b/classes/OrderDiscount.php @@ -0,0 +1,71 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderDiscountCore extends ObjectModel +{ + /** @var integer */ + public $id_order_discount; + + /** @var integer */ + public $id_order; + + /** @var integer */ + public $id_discount; + + /** @var string */ + public $name; + + /** @var integer */ + public $value; + + protected $tables = array ('order_discount'); + + protected $fieldsRequired = array ('id_order', 'name', 'value'); + protected $fieldsValidate = array ('id_order' => 'isUnsignedId', 'name' => 'isGenericName', 'value' => 'isInt'); + + /* MySQL does not allow 'order detail' for a table name */ + protected $table = 'order_discount'; + protected $identifier = 'id_order_discount'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_order' => array('xlink_resource' => 'orders'), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_order'] = (int)($this->id_order); + $fields['name'] = pSQL($this->name); + $fields['value'] = (int)($this->value); + + return $fields; + } +} + diff --git a/classes/OrderHistory.php b/classes/OrderHistory.php new file mode 100644 index 000000000..44b8b4888 --- /dev/null +++ b/classes/OrderHistory.php @@ -0,0 +1,199 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderHistoryCore extends ObjectModel +{ + /** @var integer Order id */ + public $id_order; + + /** @var integer Order state id */ + public $id_order_state; + + /** @var integer Employee id for this history entry */ + public $id_employee; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $tables = array ('order_history'); + + protected $fieldsRequired = array('id_order', 'id_order_state'); + protected $fieldsValidate = array('id_order' => 'isUnsignedId', 'id_order_state' => 'isUnsignedId', 'id_employee' => 'isUnsignedId'); + + protected $table = 'order_history'; + protected $identifier = 'id_order_history'; + + protected $webserviceParameters = array( + 'objectsNodeName' => 'order_histories', + 'fields' => array( + 'id_order_state' => array('required' => true, 'xlink_resource'=> 'order_states'), + 'id_order' => array('xlink_resource' => 'orders'), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_order'] = (int)($this->id_order); + $fields['id_order_state'] = (int)($this->id_order_state); + $fields['id_employee'] = (int)($this->id_employee); + $fields['date_add'] = pSQL($this->date_add); + + return $fields; + } + + public function changeIdOrderState($new_order_state = NULL, $id_order) + { + if ($new_order_state != NULL) + { + Hook::updateOrderStatus((int)($new_order_state), (int)($id_order)); + $order = new Order((int)($id_order)); + + /* Best sellers */ + $newOS = new OrderState((int)($new_order_state), $order->id_lang); + $oldOrderStatus = OrderHistory::getLastOrderState((int)($id_order)); + $cart = Cart::getCartByOrderId($id_order); + $isValidated = $this->isValidated(); + if (Validate::isLoadedObject($cart)) + foreach ($cart->getProducts() as $product) + { + /* If becoming logable => adding sale */ + if ($newOS->logable AND (!$oldOrderStatus OR !$oldOrderStatus->logable)) + ProductSale::addProductSale($product['id_product'], $product['cart_quantity']); + /* If becoming unlogable => removing sale */ + elseif (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable)) + ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']); + if (!$isValidated AND $newOS->logable AND isset($oldOrderStatus) AND $oldOrderStatus AND $oldOrderStatus->id == _PS_OS_ERROR_) + { + Product::updateQuantity($product); + Hook::updateQuantity($product, $order); + } + } + + $this->id_order_state = (int)($new_order_state); + + /* Change invoice number of order ? */ + if (!Validate::isLoadedObject($newOS) OR !Validate::isLoadedObject($order)) + die(Tools::displayError('Invalid new order state')); + + /* The order is valid only if the invoice is available and the order is not cancelled */ + $order->valid = $newOS->logable; + $order->update(); + + if ($newOS->invoice AND !$order->invoice_number) + $order->setInvoice(); + if ($newOS->delivery AND !$order->delivery_number) + $order->setDelivery(); + Hook::postUpdateOrderStatus((int)($new_order_state), (int)($id_order)); + } + } + + static public function getLastOrderState($id_order) + { + $id_order_state = Db::getInstance()->getValue(' + SELECT `id_order_state` + FROM `'._DB_PREFIX_.'order_history` + WHERE `id_order` = '.(int)($id_order).' + ORDER BY `date_add` DESC, `id_order_history` DESC'); + if (!$id_order_state) + return false; + return new OrderState($id_order_state, Configuration::get('PS_LANG_DEFAULT')); + } + + public function addWithemail($autodate = true, $templateVars = false) + { + $lastOrderState = $this->getLastOrderState($this->id_order); + + if (!parent::add($autodate)) + return false; + + $result = Db::getInstance()->getRow(' + SELECT osl.`template`, c.`lastname`, c.`firstname`, osl.`name` AS osname, c.`email` + FROM `'._DB_PREFIX_.'order_history` oh + LEFT JOIN `'._DB_PREFIX_.'orders` o ON oh.`id_order` = o.`id_order` + LEFT JOIN `'._DB_PREFIX_.'customer` c ON o.`id_customer` = c.`id_customer` + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON oh.`id_order_state` = os.`id_order_state` + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = o.`id_lang`) + WHERE oh.`id_order_history` = '.(int)($this->id).' + AND os.`send_email` = 1'); + + if (isset($result['template']) AND Validate::isEmail($result['email'])) + { + $topic = $result['osname']; + $data = array('{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)($this->id_order)); + if ($templateVars) $data = array_merge($data, $templateVars); + $order = new Order((int)($this->id_order)); + $data['{total_paid}'] = Tools::displayPrice((float)($order->total_paid), new Currency((int)($order->id_currency)), false, false); + $data['{order_name}'] = sprintf("#%06d", (int)($order->id)); + + // An additional email is sent the first time a virtual item is validated + if ($virtualProducts = $order->getVirtualProducts() AND (!$lastOrderState OR !$lastOrderState->logable) AND $newOrderState = new OrderState($this->id_order_state, Configuration::get('PS_LANG_DEFAULT')) AND $newOrderState->logable) + { + global $smarty; + $assign = array(); + foreach ($virtualProducts AS $key => $virtualProduct) + { + $id_product_download = ProductDownload::getIdFromIdProduct($virtualProduct['product_id']); + $product_download = new ProductDownload($id_product_download); + $assign[$key]['name'] = $product_download->display_filename; + $assign[$key]['link'] = $product_download->getTextLink(false, $virtualProduct['download_hash']); + if ($virtualProduct['download_deadline'] != '0000-00-00 00:00:00') + $assign[$key]['deadline'] = Tools::displayDate($virtualProduct['download_deadline'], $order->id_lang); + if ($product_download->nb_downloadable != 0) + $assign[$key]['downloadable'] = $product_download->nb_downloadable; + } + $smarty->assign('virtualProducts', $assign); + $iso = Language::getIsoById((int)($order->id_lang)); + $links = $smarty->fetch(_PS_MAIL_DIR_.$iso.'/download-product.tpl'); + $tmpArray = array('{nbProducts}' => count($virtualProducts), '{virtualProducts}' => $links); + $data = array_merge ($data, $tmpArray); + global $_LANGMAIL; + Mail::Send((int)($order->id_lang), 'download_product', Mail::l('Virtual product to download'), $data, $result['email'], $result['firstname'].' '.$result['lastname']); + } + + if (Validate::isLoadedObject($order)) + Mail::Send((int)($order->id_lang), $result['template'], $topic, $data, $result['email'], $result['firstname'].' '.$result['lastname']); + } + + return true; + } + + public function isValidated() + { + return Db::getInstance()->getValue(' + SELECT COUNT(oh.`id_order_history`) AS nb + FROM `'._DB_PREFIX_.'order_state` os + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (os.`id_order_state` = oh.`id_order_state`) + WHERE oh.`id_order` = '.(int)$this->id_order.' + AND os.`logable` = 1'); + } + +} diff --git a/classes/OrderMessage.php b/classes/OrderMessage.php new file mode 100644 index 000000000..307dd25f3 --- /dev/null +++ b/classes/OrderMessage.php @@ -0,0 +1,79 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderMessageCore extends ObjectModel +{ + /** @var string name name */ + public $name; + + /** @var string message content */ + public $message; + + /** @var string Object creation date */ + public $date_add; + + protected $fieldsRequired = array(); + protected $fieldsValidate = array(); + protected $fieldsSize = array(); + + protected $fieldsRequiredLang = array('name', 'message'); + protected $fieldsSizeLang = array('name' => 128, 'message' => 1200); + protected $fieldsValidateLang = array('name' => 'isGenericName', 'message' => 'isMessage'); + + protected $table = 'order_message'; + protected $identifier = 'id_order_message'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id' => array('sqlId' => 'id_discount_type', 'xlink_resource' => 'order_message_lang'), + 'date_add' => array('sqlId' => 'date_add') + ) + ); + + + public function getFields() + { + parent::validateFields(); + return array('date_add' => pSQL($this->date_add)); + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'message')); + } + + static public function getOrderMessages($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT om.id_order_message, oml.name, oml.message + FROM '._DB_PREFIX_.'order_message om + LEFT JOIN '._DB_PREFIX_.'order_message_lang oml ON (oml.id_order_message = om.id_order_message) + WHERE oml.id_lang = '.(int)($id_lang).' + ORDER BY name ASC'); + } +} diff --git a/classes/OrderReturn.php b/classes/OrderReturn.php new file mode 100644 index 000000000..2585d024b --- /dev/null +++ b/classes/OrderReturn.php @@ -0,0 +1,205 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderReturnCore extends ObjectModel +{ + /** @var integer */ + public $id; + + /** @var integer */ + public $id_customer; + + /** @var integer */ + public $id_order; + + /** @var integer */ + public $state; + + /** @var string message content */ + public $question; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $tables = array ('order_return'); + + protected $fieldsRequired = array ('id_customer', 'id_order'); + protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'question' => 'isMessage'); + + protected $table = 'order_return'; + protected $identifier = 'id_order_return'; + + public function getFields() + { + parent::validateFields(); + + $fields['id_customer'] = pSQL($this->id_customer); + $fields['id_order'] = pSQL($this->id_order); + $fields['state'] = pSQL($this->state); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['question'] = pSQL(nl2br2($this->question), true); + return $fields; + } + + public function addReturnDetail($orderDetailList, $productQtyList, $customizationIds, $customizationQtyInput) + { + /* Classic product return */ + if ($orderDetailList) + foreach ($orderDetailList AS $key => $orderDetail) + if ($qty = (int)($productQtyList[$key])) + Db::getInstance()->AutoExecute(_DB_PREFIX_.'order_return_detail', array('id_order_return' => (int)($this->id), 'id_order_detail' => (int)($orderDetail), 'product_quantity' => $qty, 'id_customization' => 0), 'INSERT'); + /* Customized product return */ + if ($customizationIds) + foreach ($customizationIds AS $orderDetailId => $customizations) + foreach ($customizations AS $customizationId) + if ($quantity = (int)($customizationQtyInput[(int)($customizationId)])) + Db::getInstance()->AutoExecute(_DB_PREFIX_.'order_return_detail', array('id_order_return' => (int)($this->id), 'id_order_detail' => (int)($orderDetailId), 'product_quantity' => $quantity, 'id_customization' => (int)($customizationId)), 'INSERT'); + } + + public function checkEnoughProduct($orderDetailList, $productQtyList, $customizationIds, $customizationQtyInput) + { + $order = new Order((int)($this->id_order)); + if (!Validate::isLoadedObject($order)) + die(Tools::displayError()); + $products = $order->getProducts(); + /* Products already returned */ + $order_return = self::getOrdersReturn($order->id_customer, $order->id, true); + foreach ($order_return AS $or) + { + $order_return_products = self::getOrdersReturnProducts($or['id_order_return'], $order); + foreach ($order_return_products AS $key => $orp) + $products[$key]['product_quantity'] -= (int)($orp['product_quantity']); + } + /* Quantity check */ + if ($orderDetailList) + foreach ($orderDetailList AS $key => $orderDetail) + if ($qty = (int)($productQtyList[$key])) + if ($products[$key]['product_quantity'] - $qty < 0) + return false; + /* Customization quantity check */ + if ($customizationIds) + { + $orderedCustomizations = Customization::getOrderedCustomizations((int)($order->id_cart)); + foreach ($customizationIds AS $productId => $customizations) + foreach ($customizations AS $customizationId) + { + $customizationId = (int)($customizationId); + if (!isset($orderedCustomizations[$customizationId])) + return false; + $quantity = (isset($customizationQtyInput[$customizationId]) ? (int)($customizationQtyInput[$customizationId]) : 0); + if ((int)($orderedCustomizations[$customizationId]['quantity']) - $quantity < 0) + return false; + } + } + return true; + } + + public function countProduct() + { + if (!$data = Db::getInstance()->getRow(' + SELECT COUNT(`id_order_return`) AS total + FROM `'._DB_PREFIX_.'order_return_detail` + WHERE `id_order_return` = '.(int)($this->id))) + return false; + return (int)($data['total']); + } + + static public function getOrdersReturn($customer_id, $order_id = false, $no_denied = false) + { + global $cookie; + + $data = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_return` + WHERE `id_customer` = '.(int)($customer_id). + ($order_id ? ' AND `id_order` = '.(int)($order_id) : ''). + ($no_denied ? ' AND `state` != 4' : '').' + ORDER BY `date_add` DESC'); + foreach ($data AS $k => $or) + { + $state = new OrderReturnState($or['state']); + $data[$k]['state_name'] = $state->name[$cookie->id_lang]; + } + return $data; + } + + static public function getOrdersReturnDetail($id_order_return) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_return_detail` + WHERE `id_order_return` = '.(int)($id_order_return)); + } + + static public function getOrdersReturnProducts($orderReturnId, $order) + { + $productsRet = self::getOrdersReturnDetail($orderReturnId); + $products = $order->getProducts(); + $tmp = array(); + foreach ($productsRet AS $return_detail) + { + $tmp[$return_detail['id_order_detail']]['quantity'] = isset($tmp[$return_detail['id_order_detail']]['quantity']) ? $tmp[$return_detail['id_order_detail']]['quantity'] + (int)($return_detail['product_quantity']) : (int)($return_detail['product_quantity']); + $tmp[$return_detail['id_order_detail']]['customizations'] = (int)($return_detail['id_customization']); + } + $resTab = array(); + foreach ($products AS $key => $product) + if (isset($tmp[$product['id_order_detail']])) + { + $resTab[$key] = $product; + $resTab[$key]['product_quantity'] = $tmp[$product['id_order_detail']]['quantity']; + $resTab[$key]['customizations'] = $tmp[$product['id_order_detail']]['customizations']; + } + return $resTab; + } + + static public function getReturnedCustomizedProducts($id_order) + { + $returns = Customization::getReturnedCustomizations($id_order); + $order = new Order((int)($id_order)); + if (!Validate::isLoadedObject($order)) + die(Tools::displayError()); + $products = $order->getProducts(); + foreach ($returns AS &$return) + { + $return['product_id'] = (int)($products[(int)($return['id_order_detail'])]['product_id']); + $return['product_attribute_id'] = (int)($products[(int)($return['id_order_detail'])]['product_attribute_id']); + $return['name'] = $products[(int)($return['id_order_detail'])]['product_name']; + $return['reference'] = $products[(int)($return['id_order_detail'])]['product_reference']; + } + return $returns; + } + + static public function deleteOrderReturnDetail($id_order_return, $id_order_detail, $id_customization = 0) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_return_detail` WHERE `id_order_detail` = '.(int)($id_order_detail).' AND `id_order_return` = '.(int)($id_order_return).' AND `id_customization` = '.(int)($id_customization)); + } +} + diff --git a/classes/OrderReturnState.php b/classes/OrderReturnState.php new file mode 100644 index 000000000..6d5fb3581 --- /dev/null +++ b/classes/OrderReturnState.php @@ -0,0 +1,80 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderReturnStateCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + /** @var string Display state in the specified color */ + public $color; + + + protected $fieldsValidate = array('color' => 'isColor'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 64); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'order_return_state'; + protected $identifier = 'id_order_return_state'; + + public function getFields() + { + parent::validateFields(); + $fields['color'] = pSQL($this->color); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + /** + * Get all available order states + * + * @param integer $id_lang Language id for state name + * @return array Order states + */ + static public function getOrderReturnStates($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_return_state` ors + LEFT JOIN `'._DB_PREFIX_.'order_return_state_lang` orsl ON (ors.`id_order_return_state` = orsl.`id_order_return_state` AND orsl.`id_lang` = '.(int)($id_lang).') + ORDER BY ors.`id_order_return_state` ASC'); + } + + +} + diff --git a/classes/OrderSlip.php b/classes/OrderSlip.php new file mode 100644 index 000000000..63bc2ac21 --- /dev/null +++ b/classes/OrderSlip.php @@ -0,0 +1,179 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderSlipCore extends ObjectModel +{ + /** @var integer */ + public $id; + + /** @var integer */ + public $id_customer; + + /** @var integer */ + public $id_order; + + /** @var float */ + public $conversion_rate; + + /** @var integer */ + public $shipping_cost; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $tables = array ('order_slip'); + + protected $fieldsRequired = array ('id_customer', 'id_order', 'conversion_rate'); + protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'id_order' => 'isUnsignedId', 'conversion_rate' => 'isFloat'); + + protected $table = 'order_slip'; + protected $identifier = 'id_order_slip'; + + public function getFields() + { + parent::validateFields(); + + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_order'] = (int)($this->id_order); + $fields['conversion_rate'] = (float)($this->conversion_rate); + $fields['shipping_cost'] = (int)($this->shipping_cost); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function addSlipDetail($orderDetailList, $productQtyList) + { + foreach ($orderDetailList as $key => $orderDetail) + { + if ($qty = (int)($productQtyList[$key])) + Db::getInstance()->AutoExecute(_DB_PREFIX_.'order_slip_detail', array('id_order_slip' => (int)($this->id), 'id_order_detail' => (int)($orderDetail), 'product_quantity' => $qty), 'INSERT'); + } + } + + static public function getOrdersSlip($customer_id, $order_id = false) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_slip` + WHERE `id_customer` = '.(int)($customer_id). + ($order_id ? ' AND `id_order` = '.(int)($order_id) : '').' + ORDER BY `date_add` DESC'); + } + + static public function getOrdersSlipDetail($id_order_slip = true, $id_order_detail = false) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( + ($id_order_detail ? 'SELECT SUM(`product_quantity`) AS `total`' : 'SELECT *'). + 'FROM `'._DB_PREFIX_.'order_slip_detail`' + .($id_order_slip ? ' WHERE `id_order_slip` = '.(int)($id_order_slip) : '') + .($id_order_detail ? ' WHERE `id_order_detail` = '.(int)($id_order_detail) : '')); + } + + static public function getOrdersSlipProducts($orderSlipId, $order) + { + $discounts = $order->getDiscounts(true); + $productsRet = self::getOrdersSlipDetail($orderSlipId); + $products = $order->getProductsDetail(); + + $tmp = array(); + foreach ($productsRet as $slip_detail) + $tmp[$slip_detail['id_order_detail']] = $slip_detail['product_quantity']; + $resTab = array(); + foreach ($products as $key => $product) + if (isset($tmp[$product['id_order_detail']])) + { + $resTab[$key] = $product; + $resTab[$key]['product_quantity'] = $tmp[$product['id_order_detail']]; + if (sizeof($discounts)) + { + $order->setProductPrices($product); + $realProductPrice = $resTab[$key]['product_price']; + foreach ($discounts as $discount) + { + if ($discount['id_discount_type'] == 1) + $resTab[$key]['product_price'] -= $realProductPrice * ($discount['value'] / 100); + elseif ($discount['id_discount_type'] == 2) + $resTab[$key]['product_price'] -= (($discount['value'] * ($product['product_price_wt'] / $order->total_products_wt)) / (1.00 + ($product['tax_rate'] / 100))); + } + + } + } + return $order->getProducts($resTab); + } + + public function getProducts() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT *, osd.product_quantity + FROM `'._DB_PREFIX_.'order_slip_detail` osd + INNER JOIN `'._DB_PREFIX_.'order_detail` od ON osd.id_order_detail = od.id_order_detail + WHERE osd.`id_order_slip` = '.(int)$this->id); + + $order = new Order($this->id_order); + $products = array(); + foreach ($result AS $row) + { + $order->setProductPrices($row); + $products[] = $row; + } + return $products; + } + + static public function getSlipsIdByDate($dateFrom, $dateTo) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `id_order_slip` + FROM `'._DB_PREFIX_.'order_slip` + WHERE `date_add` BETWEEN \''.pSQL($dateFrom).' 00:00:00\' AND \''.pSQL($dateTo).' 23:59:59\' + ORDER BY `date_add` ASC'); + + $slips = array(); + foreach ($result AS $slip) + $slips[] = (int)$slip['id_order_slip']; + return $slips; + } + + static public function createOrderSlip($order, $productList, $qtyList, $shipping_cost = false) + { + $currency = new Currency($order->id_currency); + $orderSlip = new OrderSlip(); + $orderSlip->id_customer = (int)($order->id_customer); + $orderSlip->id_order = (int)($order->id); + $orderSlip->shipping_cost = (int)($shipping_cost); + $orderSlip->conversion_rate = $currency->conversion_rate; + if (!$orderSlip->add()) + return false; + + $orderSlip->addSlipDetail($productList, $qtyList); + return true; + } +} + diff --git a/classes/OrderState.php b/classes/OrderState.php new file mode 100644 index 000000000..4d05e1583 --- /dev/null +++ b/classes/OrderState.php @@ -0,0 +1,132 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderStateCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + /** @var string Template name if there is any e-mail to send */ + public $template; + + /** @var boolean Send an e-mail to customer ? */ + public $send_email; + + /** @var boolean Allow customer to view and download invoice when order is at this state */ + public $invoice; + + /** @var string Display state in the specified color */ + public $color; + + public $unremovable; + + /** @var boolean Log authorization */ + public $logable; + + /** @var boolean Delivery */ + public $delivery; + + /** @var boolean Hidden */ + public $hidden; + + protected $fieldsValidate = array('send_email' => 'isBool', 'invoice' => 'isBool', 'color' => 'isColor', 'logable' => 'isBool'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 64, 'template' => 64); + protected $fieldsValidateLang = array('name' => 'isGenericName', 'template' => 'isTplName'); + + protected $table = 'order_state'; + protected $identifier = 'id_order_state'; + + protected $webserviceParameters = array( + 'fields' => array( + 'unremovable' => array(), + 'delivery' => array(), + 'hidden' => array(), + ), + ); + + public function getFields() + { + parent::validateFields(); + $fields['send_email'] = (int)($this->send_email); + $fields['invoice'] = (int)($this->invoice); + $fields['color'] = pSQL($this->color); + $fields['unremovable'] = (int)($this->unremovable); + $fields['logable'] = (int)($this->logable); + $fields['delivery'] = (int)($this->delivery); + $fields['hidden'] = (int)($this->hidden); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name', 'template')); + } + + /** + * Get all available order states + * + * @param integer $id_lang Language id for state name + * @return array Order states + */ + static public function getOrderStates($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'order_state` os + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)($id_lang).') + ORDER BY `name` ASC'); + } + + /** + * Check if we can make a facture when order is in this state + * + * @param integer $id_order_state State ID + * @return boolean availability + */ + static public function invoiceAvailable($id_order_state) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `invoice` AS ok + FROM `'._DB_PREFIX_.'order_state` + WHERE `id_order_state` = '.(int)($id_order_state)); + return $result['ok']; + } + + public function isRemovable() + { + return !($this->unremovable); + } +} + + diff --git a/classes/PDF.php b/classes/PDF.php new file mode 100644 index 000000000..4fe6c70f0 --- /dev/null +++ b/classes/PDF.php @@ -0,0 +1,1008 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(_PS_FPDF_PATH_.'fpdf.php'); + +class PDF_PageGroupCore extends FPDF +{ + var $NewPageGroup; // variable indicating whether a new group was requested + var $PageGroups; // variable containing the number of pages of the groups + var $CurrPageGroup; // variable containing the alias of the current page group + + // create a new page group; call this before calling AddPage() + function StartPageGroup() + { + $this->NewPageGroup=true; + } + + // current page in the group + function GroupPageNo() + { + return $this->PageGroups[$this->CurrPageGroup]; + } + + // alias of the current page group -- will be replaced by the total number of pages in this group + function PageGroupAlias() + { + return $this->CurrPageGroup; + } + + function _beginpage($orientation, $arg2) + { + parent::_beginpage($orientation, $arg2); + if($this->NewPageGroup) + { + // start a new group + $n = sizeof($this->PageGroups)+1; + $alias = "{nb$n}"; + $this->PageGroups[$alias] = 1; + $this->CurrPageGroup = $alias; + $this->NewPageGroup=false; + } + elseif($this->CurrPageGroup) + $this->PageGroups[$this->CurrPageGroup]++; + } + + function _putpages() + { + $nb = $this->page; + if (!empty($this->PageGroups)) + { + // do page number replacement + foreach ($this->PageGroups as $k => $v) + for ($n = 1; $n <= $nb; $n++) + $this->pages[$n]=str_replace($k, $v, $this->pages[$n]); + } + parent::_putpages(); + } +} + +class PDFCore extends PDF_PageGroupCore +{ + protected static $order = NULL; + protected static $orderReturn = NULL; + protected static $orderSlip = NULL; + protected static $delivery = NULL; + protected static $_priceDisplayMethod; + + /** @var object Order currency object */ + protected static $currency = NULL; + + protected static $_iso; + + /** @var array Special PDF params such encoding and font */ + + protected static $_pdfparams = array(); + protected static $_fpdf_core_fonts = array('courier', 'helvetica', 'helveticab', 'helveticabi', 'helveticai', 'symbol', 'times', 'timesb', 'timesbi', 'timesi', 'zapfdingbats'); + + /** + * Constructor + */ + public function __construct($orientation='P', $unit='mm', $format='A4') + { + global $cookie; + + if (!isset($cookie) OR !is_object($cookie)) + $cookie->id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + self::$_iso = strtoupper(Language::getIsoById($cookie->id_lang)); + FPDF::FPDF($orientation, $unit, $format); + $this->_initPDFFonts(); + } + + protected function _initPDFFonts() + { + if (!$languages = Language::getLanguages()) + die(Tools::displayError()); + foreach ($languages AS $language) + { + $isoCode = strtoupper($language['iso_code']); + $conf = Configuration::getMultiple(array('PS_PDF_ENCODING_'.$isoCode, 'PS_PDF_FONT_'.$isoCode)); + self::$_pdfparams[$isoCode] = array( + 'encoding' => (isset($conf['PS_PDF_ENCODING_'.$isoCode]) AND $conf['PS_PDF_ENCODING_'.$isoCode] == true) ? $conf['PS_PDF_ENCODING_'.$isoCode] : 'iso-8859-1', + 'font' => (isset($conf['PS_PDF_FONT_'.$isoCode]) AND $conf['PS_PDF_FONT_'.$isoCode] == true) ? $conf['PS_PDF_FONT_'.$isoCode] : 'helvetica' + ); + } + + if ($font = self::embedfont()) + { + $this->AddFont($font); + $this->AddFont($font, 'B'); + } + } + + /** + * Invoice header + */ + public function Header() + { + global $cookie; + + $conf = Configuration::getMultiple(array('PS_SHOP_NAME', 'PS_SHOP_ADDR1', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_STATE')); + $conf['PS_SHOP_NAME'] = isset($conf['PS_SHOP_NAME']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_NAME']) : 'Your company'; + $conf['PS_SHOP_ADDR1'] = isset($conf['PS_SHOP_ADDR1']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_ADDR1']) : 'Your company'; + $conf['PS_SHOP_CODE'] = isset($conf['PS_SHOP_CODE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CODE']) : 'Postcode'; + $conf['PS_SHOP_CITY'] = isset($conf['PS_SHOP_CITY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CITY']) : 'City'; + $conf['PS_SHOP_COUNTRY'] = isset($conf['PS_SHOP_COUNTRY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_COUNTRY']) : 'Country'; + $conf['PS_SHOP_STATE'] = isset($conf['PS_SHOP_STATE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_STATE']) : ''; + + if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg')) + $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15); + else if (file_exists(_PS_IMG_DIR_.'/logo.jpg')) + $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15); + $this->SetFont(self::fontname(), 'B', 15); + $this->Cell(115); + + if (self::$orderReturn) + $this->Cell(77, 10, self::l('RETURN #').' '.sprintf('%06d', self::$orderReturn->id), 0, 1, 'R'); + elseif (self::$orderSlip) + $this->Cell(77, 10, self::l('SLIP #').' '.sprintf('%06d', self::$orderSlip->id), 0, 1, 'R'); + elseif (self::$delivery) + $this->Cell(77, 10, self::l('DELIVERY SLIP #').' '.Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_DELIVERY_PREFIX', (int)($cookie->id_lang))).sprintf('%06d', self::$delivery), 0, 1, 'R'); + elseif (self::$order->invoice_number) + $this->Cell(77, 10, self::l('INVOICE #').' '.Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_INVOICE_PREFIX', (int)($cookie->id_lang))).sprintf('%06d', self::$order->invoice_number), 0, 1, 'R'); + else + $this->Cell(77, 10, self::l('ORDER #').' '.sprintf('%06d', self::$order->id), 0, 1, 'R'); + } + + /** + * Invoice footer + */ + public function Footer() + { + $arrayConf = array('PS_SHOP_NAME', 'PS_SHOP_ADDR1', 'PS_SHOP_ADDR2', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_DETAILS', 'PS_SHOP_PHONE', 'PS_SHOP_STATE'); + $conf = Configuration::getMultiple($arrayConf); + $conf['PS_SHOP_NAME_UPPER'] = Tools::strtoupper($conf['PS_SHOP_NAME']); + $y_delta = array_key_exists('PS_SHOP_DETAILS', $conf) ? substr_count($conf['PS_SHOP_DETAILS'],"\n") : 0; + $this->SetY( -33 - ($y_delta * 7)); + $this->SetFont(self::fontname(), '', 7); + $this->Cell(190, 5, ' '."\n".Tools::iconv('utf-8', self::encoding(), 'P. ').$this->GroupPageNo().' / '.$this->PageGroupAlias(), 'T', 1, 'R'); + + /* + * Display a message for customer + */ + if (!self::$delivery) + { + $this->SetFont(self::fontname(), '', 8); + if (self::$orderSlip) + $textFooter = self::l('An electronic version of this invoice is available in your account. To access it, log in to the'); + else + $textFooter = self::l('An electronic version of this invoice is available in your account. To access it, log in to the'); + $this->Cell(0, 10, $textFooter, 0, 0, 'C', 0, (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].__PS_BASE_URI__.'history.php'); + $this->Ln(4); + $this->Cell(0, 10, Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_SHOP_NAME')).' '.self::l('website using your e-mail address and password (which you created when placing your first order).'), 0, 0, 'C', 0, (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].__PS_BASE_URI__.'history.php'); + } + else + $this->Ln(4); + $this->Ln(9); + foreach($conf as $key => $value) + $conf[$key] = Tools::iconv('utf-8', self::encoding(), $value); + foreach ($arrayConf as $key) + if (!isset($conf[$key])) + $conf[$key] = ''; + $this->SetFillColor(240, 240, 240); + $this->SetTextColor(0, 0, 0); + $this->SetFont(self::fontname(), '', 8); + $this->Cell(0, 5, $conf['PS_SHOP_NAME_UPPER']. + (!empty($conf['PS_SHOP_ADDR1']) ? ' - '.self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '').' '.$conf['PS_SHOP_COUNTRY'] : ''), 0, 1, 'C', 1); + $this->Multicell(0, 5, + (!empty($conf['PS_SHOP_DETAILS']) ? self::l('Details:').' '.$conf['PS_SHOP_DETAILS'].' - ' : ''). + (!empty($conf['PS_SHOP_PHONE']) ? self::l('PHONE:').' '.$conf['PS_SHOP_PHONE'] : ''), 0, 'C', 1); + } + + public static function multipleInvoices($invoices) + { + $pdf = new PDF('P', 'mm', 'A4'); + foreach ($invoices AS $id_order) + { + $orderObj = new Order((int)$id_order); + if (Validate::isLoadedObject($orderObj)) + PDF::invoice($orderObj, 'D', true, $pdf); + } + return $pdf->Output('invoices.pdf', 'D'); + } + + public static function multipleOrderSlips($orderSlips) + { + $pdf = new PDF('P', 'mm', 'A4'); + foreach ($orderSlips AS $id_order_slip) + { + $orderSlip = new OrderSlip((int)$id_order_slip); + $order = new Order((int)$orderSlip->id_order); + $order->products = OrderSlip::getOrdersSlipProducts($orderSlip->id, $order); + if (Validate::isLoadedObject($orderSlip) AND Validate::isLoadedObject($order)) + PDF::invoice($order, 'D', true, $pdf, $orderSlip); + } + return $pdf->Output('order_slips.pdf', 'D'); + } + + public static function multipleDelivery($slips) + { + $pdf = new PDF('P', 'mm', 'A4'); + foreach ($slips AS $id_order) + { + $orderObj = new Order((int)$id_order); + if (Validate::isLoadedObject($orderObj)) + PDF::invoice($orderObj, 'D', true, $pdf, false, $orderObj->delivery_number); + } + return $pdf->Output('invoices.pdf', 'D'); + } + + public static function orderReturn($orderReturn, $mode = 'D', $multiple = false, &$pdf = NULL) + { + $pdf = new PDF('P', 'mm', 'A4'); + self::$orderReturn = $orderReturn; + $order = new Order($orderReturn->id_order); + self::$order = $order; + $pdf->SetAutoPageBreak(true, 35); + $pdf->StartPageGroup(); + $pdf->AliasNbPages(); + $pdf->AddPage(); + + /* Display address information */ + $delivery_address = new Address((int)($order->id_address_delivery)); + $deliveryState = $delivery_address->id_state ? new State($delivery_address->id_state) : false; + $arrayConf = array('PS_SHOP_NAME', 'PS_SHOP_ADDR1', 'PS_SHOP_ADDR2', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_DETAILS', 'PS_SHOP_PHONE', 'PS_SHOP_STATE'); + $conf = Configuration::getMultiple($arrayConf); + foreach ($conf as $key => $value) + $conf[$key] = Tools::iconv('utf-8', self::encoding(), $value); + foreach ($arrayConf as $key) + if (!isset($conf[$key])) + $conf[$key] = ''; + + $width = 100; + $pdf->SetX(10); + $pdf->SetY(25); + $pdf->SetFont(self::fontname(), '', 9); + + if (!empty($delivery_address->company)) + { + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->company), 0, 'L'); + $pdf->Ln(5); + } + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->firstname).' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->lastname), 0, 'L'); + $pdf->Ln(5); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address1), 0, 'L'); + $pdf->Ln(5); + if (!empty($delivery_address->address2)) + { + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address2), 0, 'L'); + $pdf->Ln(5); + } + $pdf->Cell($width, 10, $delivery_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L'); + $pdf->Ln(5); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L'); + + /* + * display order information + */ + $pdf->Ln(12); + $pdf->SetFillColor(240, 240, 240); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFont(self::fontname(), '', 9); + $pdf->Cell(0, 6, self::l('RETURN #').sprintf('%06d', self::$orderReturn->id).' '.self::l('from') . ' ' .Tools::displayDate(self::$orderReturn->date_upd, self::$order->id_lang), 1, 2, 'L'); + $pdf->Cell(0, 6, self::l('We have logged your return request.'), 'TRL', 2, 'L'); + $pdf->Cell(0, 6, self::l('Your package must be returned to us within').' '.Configuration::get('PS_ORDER_RETURN_NB_DAYS').' '.self::l('days of receiving your order.'), 'BRL', 2, 'L'); + $pdf->Ln(5); + $pdf->Cell(0, 6, self::l('List of items marked as returned :'), 0, 2, 'L'); + $pdf->Ln(5); + $pdf->ProdReturnTab(); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 10); + $pdf->Cell(0, 6, self::l('Return reference:').' '.self::l('RET').sprintf('%06d', self::$order->id), 0, 2, 'C'); + $pdf->Cell(0, 6, self::l('Please include this number on your return package.'), 0, 2, 'C'); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 9); + $pdf->Cell(0, 6, self::l('REMINDER:'), 0, 2, 'L'); + $pdf->SetFont(self::fontname(), '', 9); + $pdf->Cell(0, 6, self::l('- All products must be returned in their original packaging without damage or wear.'), 0, 2, 'L'); + $pdf->Cell(0, 6, self::l('- Please print out this document and slip it into your package.'), 0, 2, 'L'); + $pdf->Cell(0, 6, self::l('- The package should be sent to the following address:'), 0, 2, 'L'); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 10); + $pdf->Cell(0, 5, Tools::strtoupper($conf['PS_SHOP_NAME']), 0, 1, 'C', 1); + $pdf->Cell(0, 5, (!empty($conf['PS_SHOP_ADDR1']) ? self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].' '.$conf['PS_SHOP_COUNTRY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '') : ''), 0, 1, 'C', 1); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), '', 9); + $pdf->Cell(0, 6, self::l('Upon receiving your package, we will notify you by e-mail. We will then begin processing the reimbursement of your order total.'), 0, 2, 'L'); + $pdf->Cell(0, 6, self::l('Let us know if you have any questions.'), 0, 2, 'L'); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 10); + $pdf->Cell(0, 6, self::l('If the conditions of return listed above are not respected,'), 'TRL', 2, 'C'); + $pdf->Cell(0, 6, self::l('we reserve the right to refuse your package and/or reimbursement.'), 'BRL', 2, 'C'); + + return $pdf->Output(sprintf('%06d', self::$order->id).'.pdf', $mode); + } + + /** + * Product table with references, quantities... + */ + public function ProdReturnTab() + { + $header = array( + array(self::l('Description'), 'L'), + array(self::l('Reference'), 'L'), + array(self::l('Qty'), 'C') + ); + $w = array(110, 25, 20); + $this->SetFont(self::fontname(), 'B', 8); + $this->SetFillColor(240, 240, 240); + for ($i = 0; $i < sizeof($header); $i++) + $this->Cell($w[$i], 5, $header[$i][0], 'T', 0, $header[$i][1], 1); + $this->Ln(); + $this->SetFont(self::fontname(), '', 7); + + $products = OrderReturn::getOrdersReturnProducts(self::$orderReturn->id, self::$order); + foreach ($products AS $product) + { + $before = $this->GetY(); + $this->MultiCell($w[0], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX() + $w[0], $this->GetY() - $lineSize); + $this->Cell($w[1], $lineSize, ($product['product_reference'] != '' ? Tools::iconv('utf-8', self::encoding(), $product['product_reference']) : '---'), 'B'); + $this->Cell($w[2], $lineSize, $product['product_quantity'], 'B', 0, 'C'); + $this->Ln(); + } + } + + /** + * Main + * + * @param object $order Order + * @param string $mode Download or display (optional) + */ + public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false) + { + global $cookie; + + if (!Validate::isLoadedObject($order) OR (!$cookie->id_employee AND (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number))) + die('Invalid order or invalid order state'); + self::$order = $order; + self::$orderSlip = $slip; + self::$delivery = $delivery; + self::$_iso = strtoupper(Language::getIsoById((int)(self::$order->id_lang))); + if ((self::$_priceDisplayMethod = $order->getTaxCalculationMethod()) === false) + die(self::l('No price display method defined for the customer group')); + + if (!$multiple) + $pdf = new PDF('P', 'mm', 'A4'); + + $pdf->SetAutoPageBreak(true, 35); + $pdf->StartPageGroup(); + + self::$currency = Currency::getCurrencyInstance((int)(self::$order->id_currency)); + + $pdf->AliasNbPages(); + $pdf->AddPage(); + /* Display address information */ + $invoice_address = new Address((int)($order->id_address_invoice)); + $invoiceState = $invoice_address->id_state ? new State($invoice_address->id_state) : false; + $delivery_address = new Address((int)($order->id_address_delivery)); + $deliveryState = $delivery_address->id_state ? new State($delivery_address->id_state) : false; + + $width = 100; + + $pdf->SetX(10); + $pdf->SetY(25); + $pdf->SetFont(self::fontname(), '', 12); + $pdf->Cell($width, 10, self::l('Delivery'), 0, 'L'); + $pdf->Cell($width, 10, self::l('Invoicing'), 0, 'L'); + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), '', 9); + + if (!empty($delivery_address->company) OR !empty($invoice_address->company)) + { + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->company), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->company), 0, 'L'); + $pdf->Ln(5); + } + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->firstname).' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->lastname), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->firstname).' '.Tools::iconv('utf-8', self::encoding(), $invoice_address->lastname), 0, 'L'); + $pdf->Ln(5); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address1), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->address1), 0, 'L'); + $pdf->Ln(5); + if (!empty($invoice_address->address2) OR !empty($delivery_address->address2)) + { + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address2), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->address2), 0, 'L'); + $pdf->Ln(5); + } + $pdf->Cell($width, 10, $delivery_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L'); + $pdf->Cell($width, 10, $invoice_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $invoice_address->city), 0, 'L'); + $pdf->Ln(5); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->country.($invoiceState ? ' - '.$invoiceState->name : '')), 0, 'L'); + $pdf->Ln(5); + + if (Configuration::get('VATNUMBER_MANAGEMENT') AND !empty($invoice_address->vat_number)) + { + $vat_delivery = ''; + if ($invoice_address->id != $delivery_address->id) + $vat_delivery = $delivery_address->vat_number; + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $vat_delivery), 0, 'L'); + $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->vat_number), 0, 'L'); + $pdf->Ln(5); + } + + $pdf->Cell($width, 10, $delivery_address->phone, 0, 'L'); + if($invoice_address->dni != NULL) + $pdf->Cell($width, 10, self::l('Tax ID number:').' '.Tools::iconv('utf-8', self::encoding(), $invoice_address->dni), 0, 'L'); + if (!empty($delivery_address->phone_mobile)) + { + $pdf->Ln(5); + $pdf->Cell($width, 10, $delivery_address->phone_mobile, 0, 'L'); + } + + /* + * display order information + */ + $carrier = new Carrier(self::$order->id_carrier); + if ($carrier->name == '0') + $carrier->name = Configuration::get('PS_SHOP_NAME'); + $history = self::$order->getHistory(self::$order->id_lang); + foreach($history as $h) + if ($h['id_order_state'] == _PS_OS_SHIPPING_) + $shipping_date = $h['date_add']; + $pdf->Ln(12); + $pdf->SetFillColor(240, 240, 240); + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFont(self::fontname(), '', 9); + if (self::$orderSlip) + $pdf->Cell(0, 6, self::l('SLIP #').sprintf('%06d', self::$orderSlip->id).' '.self::l('from') . ' ' .Tools::displayDate(self::$orderSlip->date_upd, self::$order->id_lang), 1, 2, 'L', 1); + elseif (self::$delivery) + $pdf->Cell(0, 6, self::l('DELIVERY SLIP #').Configuration::get('PS_DELIVERY_PREFIX', (int)($cookie->id_lang)).sprintf('%06d', self::$delivery).' '.self::l('from') . ' ' .Tools::displayDate(self::$order->delivery_date, self::$order->id_lang), 1, 2, 'L', 1); + else + $pdf->Cell(0, 6, self::l('INVOICE #').Configuration::get('PS_INVOICE_PREFIX', (int)($cookie->id_lang)).sprintf('%06d', self::$order->invoice_number).' '.self::l('from') . ' ' .Tools::displayDate(self::$order->invoice_date, self::$order->id_lang), 1, 2, 'L', 1); + $pdf->Cell(55, 6, self::l('Order #').sprintf('%06d', self::$order->id), 'L', 0); + $pdf->Cell(70, 6, self::l('Carrier:').($order->gift ? ' '.Tools::iconv('utf-8', self::encoding(), $carrier->name) : ''), 'L'); + $pdf->Cell(0, 6, self::l('Payment method:'), 'LR'); + $pdf->Ln(5); + $pdf->Cell(55, 6, (isset($shipping_date) ? self::l('Shipping date:').' '.Tools::displayDate($shipping_date, self::$order->id_lang) : ' '), 'LB', 0); + $pdf->Cell(70, 6, ($order->gift ? self::l('Gift-wrapped order') : Tools::iconv('utf-8', self::encoding(), $carrier->name)), 'LRB'); + $pdf->Cell(0, 6, Tools::iconv('utf-8', self::encoding(), $order->payment), 'LRB'); + $pdf->Ln(15); + $pdf->ProdTab((self::$delivery ? true : '')); + + /* Exit if delivery */ + if (!self::$delivery) + { + if (!self::$orderSlip) + $pdf->DiscTab(); + $priceBreakDown = array(); + $pdf->priceBreakDownCalculation($priceBreakDown); + + if (!self::$orderSlip OR (self::$orderSlip AND self::$orderSlip->shipping_cost)) + { + $priceBreakDown['totalWithoutTax'] += Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2) + Tools::ps_round($priceBreakDown['wrappingCostWithoutTax'], 2); + $priceBreakDown['totalWithTax'] += self::$order->total_shipping + self::$order->total_wrapping; + } + if (!self::$orderSlip) + { + $taxDiscount = self::$order->getTaxesAverageUsed(); + if ($taxDiscount != 0) + $priceBreakDown['totalWithoutTax'] -= Tools::ps_round(self::$order->total_discounts / (1 + self::$order->getTaxesAverageUsed() * 0.01), 2); + else + $priceBreakDown['totalWithoutTax'] -= self::$order->total_discounts; + $priceBreakDown['totalWithTax'] -= self::$order->total_discounts; + } + + /* + * Display price summation + */ + if (Configuration::get('PS_TAX') OR $order->total_products_wt != $order->total_products) + { + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 8); + $width = 165; + $pdf->Cell($width, 0, self::l('Total products (tax excl.)').' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + + $pdf->SetFont(self::fontname(), 'B', 8); + $width = 165; + $pdf->Cell($width, 0, self::l('Total products (tax incl.)').' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithTax'], self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + else + { + $pdf->Ln(5); + $pdf->SetFont(self::fontname(), 'B', 8); + $width = 165; + $pdf->Cell($width, 0, self::l('Total products ').' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + + if (!self::$orderSlip AND self::$order->total_discounts != '0.00') + { + $pdf->Cell($width, 0, self::l('Total discounts (tax incl.)').' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (!self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_discounts, self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + + if(isset(self::$order->total_wrapping) and ((float)(self::$order->total_wrapping) > 0)) + { + $pdf->Cell($width, 0, self::l('Total gift-wrapping').' : ', 0, 0, 'R'); + if (self::$_priceDisplayMethod == PS_TAX_EXC) + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['wrappingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + else + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_wrapping, self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + + if (self::$order->total_shipping != '0.00' AND (!self::$orderSlip OR (self::$orderSlip AND self::$orderSlip->shipping_cost))) + { + $pdf->Cell($width, 0, self::l('Total shipping').' : ', 0, 0, 'R'); + if (self::$_priceDisplayMethod == PS_TAX_EXC) + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(Tools::ps_round($priceBreakDown['shippingCostWithoutTax'], 2), self::$currency, true, false)), 0, 0, 'R'); + else + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_shipping, self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + + if (Configuration::get('PS_TAX') OR $order->total_products_wt != $order->total_products) + { + $pdf->Cell($width, 0, self::l('Total').' '.(self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax incl.)') : self::l(' (tax excl.)')).' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice((self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithTax'] : $priceBreakDown['totalWithoutTax']), self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + $pdf->Cell($width, 0, self::l('Total').' '.(self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax excl.)') : self::l(' (tax incl.)')).' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice((self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithoutTax'] : $priceBreakDown['totalWithTax']), self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + else + { + $pdf->Cell($width, 0, self::l('Total').' : ', 0, 0, 'R'); + $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(($priceBreakDown['totalWithoutTax']), self::$currency, true, false)), 0, 0, 'R'); + $pdf->Ln(4); + } + + $pdf->TaxTab($priceBreakDown); + } + Hook::PDFInvoice($pdf, self::$order->id); + + if (!$multiple) + return $pdf->Output(sprintf('%06d', self::$order->id).'.pdf', $mode); + } + + public function ProdTabHeader($delivery = false) + { + if (!$delivery) + { + $header = array( + array(self::l('Description'), 'L'), + array(self::l('Reference'), 'L'), + array(self::l('U. price'), 'R'), + array(self::l('Qty'), 'C'), + array(self::l('Total'), 'R') + ); + $w = array(100, 15, 30, 15, 30); + } + else + { + $header = array( + array(self::l('Description'), 'L'), + array(self::l('Reference'), 'L'), + array(self::l('Qty'), 'C'), + ); + $w = array(120, 30, 10); + } + $this->SetFont(self::fontname(), 'B', 8); + $this->SetFillColor(240, 240, 240); + if ($delivery) + $this->SetX(25); + for($i = 0; $i < sizeof($header); $i++) + $this->Cell($w[$i], 5, $header[$i][0], 'T', 0, $header[$i][1], 1); + $this->Ln(); + $this->SetFont(self::fontname(), '', 8); + } + + /** + * Product table with price, quantities... + */ + public function ProdTab($delivery = false) + { + if (!$delivery) + $w = array(100, 15, 30, 15, 30); + else + $w = array(120, 30, 10); + self::ProdTabHeader($delivery); + if (!self::$orderSlip) + { + if (isset(self::$order->products) AND sizeof(self::$order->products)) + $products = self::$order->products; + else + $products = self::$order->getProducts(); + } + else + $products = self::$orderSlip->getProducts(); + $customizedDatas = Product::getAllCustomizedDatas((int)(self::$order->id_cart)); + Product::addCustomizationPrice($products, $customizedDatas); + + $counter = 0; + $lines = 25; + $lineSize = 0; + $line = 0; + + + foreach($products AS $product) + if (!$delivery OR ((int)($product['product_quantity']) - (int)($product['product_quantity_refunded']) > 0)) + { + if($counter >= $lines) + { + $this->AddPage(); + $this->Ln(); + self::ProdTabHeader($delivery); + $lineSize = 0; + $counter = 0; + $lines = 40; + $line++; + } + $counter = $counter + ($lineSize / 5) ; + + $i = -1; + + // Unit vars + $unit_without_tax = $product['product_price'] + $product['ecotax']; + $unit_with_tax = $product['product_price_wt'] + ($product['ecotax'] * (1 + $product['ecotax_tax_rate'] / 100)); + if (self::$_priceDisplayMethod == PS_TAX_EXC) + $unit_price = &$unit_without_tax; + else + $unit_price = &$unit_with_tax; + $productQuantity = $delivery ? ((int)($product['product_quantity']) - (int)($product['product_quantity_refunded'])) : (int)($product['product_quantity']); + + if ($productQuantity <= 0) + continue ; + + // Total prices + $total_with_tax = $unit_with_tax * $productQuantity; + $total_without_tax = $unit_without_tax * $productQuantity; + // Spec + if (self::$_priceDisplayMethod == PS_TAX_EXC) + $final_price = &$total_without_tax; + else + $final_price = &$total_with_tax; + // End Spec + + if (isset($customizedDatas[$product['product_id']][$product['product_attribute_id']])) + { + $productQuantity = (int)($product['product_quantity']) - (int)($product['customizationQuantityTotal']); + if ($delivery) + $this->SetX(25); + $before = $this->GetY(); + $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']).' - '.self::l('Customized'), 'B'); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); + $this->Cell($w[++$i], $lineSize, $product['product_reference'], 'B'); + if (!$delivery) + $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($unit_price, self::$currency, true, false)), 'B', 0, 'R'); + $this->Cell($w[++$i], $lineSize, (int)($product['customizationQuantityTotal']), 'B', 0, 'C'); + if (!$delivery) + $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($unit_price * (int)($product['customizationQuantityTotal']), self::$currency, true, false)), 'B', 0, 'R'); + $this->Ln(); + $i = -1; + $total_with_tax = $unit_with_tax * $productQuantity; + $total_without_tax = $unit_without_tax * $productQuantity; + } + if ($delivery) + $this->SetX(25); + if ($productQuantity) + { + $before = $this->GetY(); + $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); + $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); + if (!$delivery) + $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($unit_price, self::$currency, true, false)), 'B', 0, 'R'); + $this->Cell($w[++$i], $lineSize, $productQuantity, 'B', 0, 'C'); + if (!$delivery) + $this->Cell($w[++$i], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($final_price, self::$currency, true, false)), 'B', 0, 'R'); + $this->Ln(); + } + } + + if (!sizeof(self::$order->getDiscounts()) AND !$delivery) + $this->Cell(array_sum($w), 0, ''); + } + + /** + * Discount table with value, quantities... + */ + public function DiscTab() + { + $w = array(90, 25, 15, 10, 25, 25); + $this->SetFont(self::fontname(), 'B', 7); + $discounts = self::$order->getDiscounts(); + + foreach($discounts AS $discount) + { + $this->Cell($w[0], 6, self::l('Discount:').' '.$discount['name'], 'B'); + $this->Cell($w[1], 6, '', 'B'); + $this->Cell($w[2], 6, '', 'B'); + $this->Cell($w[3], 6, '', 'B', 0, 'R'); + $this->Cell($w[4], 6, '1', 'B', 0, 'C'); + $this->Cell($w[5], 6, ((!self::$orderSlip AND $discount['value'] != 0.00) ? '-' : '').self::convertSign(Tools::displayPrice($discount['value'], self::$currency, true, false)), 'B', 0, 'R'); + $this->Ln(); + } + + if (sizeof($discounts)) + $this->Cell(array_sum($w), 0, ''); + } + + public function priceBreakDownCalculation(array &$priceBreakDown) + { + $priceBreakDown['totalsWithoutTax'] = array(); + $priceBreakDown['totalsWithTax'] = array(); + $priceBreakDown['totalsEcotax'] = array(); + $priceBreakDown['wrappingCostWithoutTax'] = 0; + $priceBreakDown['shippingCostWithoutTax'] = 0; + $priceBreakDown['totalWithoutTax'] = 0; + $priceBreakDown['totalWithTax'] = 0; + $priceBreakDown['totalProductsWithoutTax'] = 0; + $priceBreakDown['totalProductsWithTax'] = 0; + $priceBreakDown['hasEcotax'] = 0; + if (self::$order->total_paid == '0.00' AND self::$order->total_discounts == 0) + return ; + + // Setting products tax + if (isset(self::$order->products) AND sizeof(self::$order->products)) + $products = self::$order->products; + else + $products = self::$order->getProducts(); + $amountWithoutTax = 0; + $taxes = array(); + /* Firstly calculate all prices */ + foreach ($products AS &$product) + { + if (!isset($priceBreakDown['totalsWithTax'][$product['tax_rate']])) + $priceBreakDown['totalsWithTax'][$product['tax_rate']] = 0; + if (!isset($priceBreakDown['totalsEcotax'][$product['tax_rate']])) + $priceBreakDown['totalsEcotax'][$product['tax_rate']] = 0; + if (!isset($priceBreakDown['totalsWithoutTax'][$product['tax_rate']])) + $priceBreakDown['totalsWithoutTax'][$product['tax_rate']] = 0; + if (!isset($taxes[$product['tax_rate']])) + $taxes[$product['tax_rate']] = 0; + + /* Without tax */ + if (self::$_priceDisplayMethod == PS_TAX_EXC) + $product['priceWithoutTax'] = Tools::ps_round((float)($product['product_price']) + (float)$product['ecotax'], 2); + else + $product['priceWithoutTax'] = ($product['product_price_wt_but_ecotax'] / (1 + $product['tax_rate'] / 100)) + (float)$product['ecotax']; + + $product['priceWithoutTax'] = $product['priceWithoutTax'] * (int)($product['product_quantity']); + + $amountWithoutTax += $product['priceWithoutTax']; + /* With tax */ + $product['priceWithTax'] = (float)($product['product_price_wt']) * (int)($product['product_quantity']); + $product['priceEcotax'] = $product['ecotax'] * (1 + $product['ecotax_tax_rate'] / 100); + } + + $priceBreakDown['totalsProductsWithoutTax'] = $priceBreakDown['totalsWithoutTax']; + $priceBreakDown['totalsProductsWithTax'] = $priceBreakDown['totalsWithTax']; + + $tmp = 0; + $product = &$tmp; + /* And secondly assign to each tax its own reduction part */ + $discountAmount = (float)(self::$order->total_discounts); + foreach ($products as $product) + { + $ratio = $amountWithoutTax == 0 ? 0 : $product['priceWithoutTax'] / $amountWithoutTax; + $priceWithTaxAndReduction = $product['priceWithTax'] - $discountAmount * $ratio; + if (self::$_priceDisplayMethod == PS_TAX_EXC) + { + $vat = $priceWithTaxAndReduction - Tools::ps_round($priceWithTaxAndReduction / $product['product_quantity'] / (((float)($product['tax_rate']) / 100) + 1), 2) * $product['product_quantity']; + $priceBreakDown['totalsWithoutTax'][$product['tax_rate']] += $product['priceWithoutTax'] ; + $priceBreakDown['totalsProductsWithoutTax'][$product['tax_rate']] += $product['priceWithoutTax']; + } + else + { + $vat = (float)($product['priceWithoutTax']) * ((float)($product['tax_rate']) / 100) * $product['product_quantity']; + $priceBreakDown['totalsWithTax'][$product['tax_rate']] += $product['priceWithTax']; + $priceBreakDown['totalsProductsWithTax'][$product['tax_rate']] += $product['priceWithTax']; + $priceBreakDown['totalsProductsWithoutTax'][$product['tax_rate']] += $product['priceWithoutTax']; + } + $priceBreakDown['totalsEcotax'][$product['tax_rate']] += ($product['priceEcotax'] * $product['product_quantity']); + if ($priceBreakDown['totalsEcotax'][$product['tax_rate']]) + $priceBreakDown['hasEcotax'] = 1; + $taxes[$product['tax_rate']] += $vat; + } + + $carrier_tax_rate = (float)self::$order->carrier_tax_rate; + if (($priceBreakDown['totalsWithoutTax'] == $priceBreakDown['totalsWithTax']) AND (!$carrier_tax_rate OR $carrier_tax_rate == '0.00') AND (!self::$order->total_wrapping OR self::$order->total_wrapping == '0.00')) + return ; + + foreach ($taxes AS $tax_rate => &$vat) + { + if (self::$_priceDisplayMethod == PS_TAX_EXC) + { + $priceBreakDown['totalsWithoutTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate], 2); + $priceBreakDown['totalsProductsWithoutTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate], 2); + $priceBreakDown['totalsWithTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate] * (1 + $tax_rate / 100), 2); + $priceBreakDown['totalsProductsWithTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsProductsWithoutTax'][$tax_rate] * (1 + $tax_rate / 100), 2); + } + else + { + $priceBreakDown['totalsWithoutTax'][$tax_rate] = $priceBreakDown['totalsProductsWithoutTax'][$tax_rate]; + $priceBreakDown['totalsProductsWithoutTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsProductsWithoutTax'][$tax_rate], 2); + } + $priceBreakDown['totalWithTax'] += $priceBreakDown['totalsWithTax'][$tax_rate]; + $priceBreakDown['totalWithoutTax'] += $priceBreakDown['totalsWithoutTax'][$tax_rate]; + $priceBreakDown['totalProductsWithoutTax'] += $priceBreakDown['totalsProductsWithoutTax'][$tax_rate]; + $priceBreakDown['totalProductsWithTax'] += $priceBreakDown['totalsProductsWithTax'][$tax_rate]; + } + $priceBreakDown['taxes'] = $taxes; + $priceBreakDown['shippingCostWithoutTax'] = ($carrier_tax_rate AND $carrier_tax_rate != '0.00') ? (self::$order->total_shipping / (1 + ($carrier_tax_rate / 100))) : self::$order->total_shipping; + if (self::$order->total_wrapping AND self::$order->total_wrapping != '0.00') + { + $wrappingTax = new Tax(Configuration::get('PS_GIFT_WRAPPING_TAX')); + $priceBreakDown['wrappingCostWithoutTax'] = self::$order->total_wrapping / (1 + ((float)($wrappingTax->rate) / 100)); + } + } + + /** + * Tax table + */ + public function TaxTab(array &$priceBreakDown) + { + + $invoiceAddress = new Address(self::$order->id_address_invoice); + if (Configuration::get('VATNUMBER_MANAGEMENT') AND !empty($invoiceAddress->vat_number) AND $invoiceAddress->id_country != Configuration::get('VATNUMBER_COUNTRY')) + { + $this->Ln(); + $this->Cell(30, 0, self::l('Exempt of VAT according section 259B of the General Tax Code.'), 0, 0, 'L'); + return; + } + + if (self::$order->total_paid == '0.00' OR (!(int)(Configuration::get('PS_TAX')) AND self::$order->total_products == self::$order->total_products_wt)) + return ; + + $carrier_tax_rate = (float)self::$order->carrier_tax_rate; + if (($priceBreakDown['totalsWithoutTax'] == $priceBreakDown['totalsWithTax']) AND (!$carrier_tax_rate OR $carrier_tax_rate == '0.00') AND (!self::$order->total_wrapping OR self::$order->total_wrapping == '0.00')) + return ; + + // Displaying header tax + if ($priceBreakDown['hasEcotax']) + { + $header = array(self::l('Tax detail'), self::l('Tax'), self::l('Pre-Tax Total'), self::l('Total Tax'), self::l('Ecotax (Tax Incl.)'), self::l('Total with Tax')); + $w = array(60, 20, 40, 20, 30, 20); + } + else + { + $header = array(self::l('Tax detail'), self::l('Tax'), self::l('Pre-Tax Total'), self::l('Total Tax'), self::l('Total with Tax')); + $w = array(60, 30, 40, 30, 30); + } + $this->SetFont(self::fontname(), 'B', 8); + for($i = 0; $i < sizeof($header); $i++) + $this->Cell($w[$i], 5, $header[$i], 0, 0, 'R'); + + $this->Ln(); + $this->SetFont(self::fontname(), '', 7); + + $nb_tax = 0; + + // Display product tax + foreach ($priceBreakDown['taxes'] AS $tax_rate => $vat) + { + if ($tax_rate != '0.00' AND $priceBreakDown['totalsProductsWithTax'][$tax_rate] != '0.00') + { + $nb_tax++; + $before = $this->GetY(); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX(), $this->GetY() - $lineSize + 3); + $this->Cell($w[0], $lineSize, self::l('Products'), 0, 0, 'R'); + $this->Cell($w[1], $lineSize, number_format($tax_rate, 3, ',', ' ').' %', 0, 0, 'R'); + $this->Cell($w[2], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithoutTax'][$tax_rate], self::$currency, true, false)), 0, 0, 'R'); + $this->Cell($w[3], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithTax'][$tax_rate] - $priceBreakDown['totalsProductsWithoutTax'][$tax_rate], self::$currency, true, false)), 0, 0, 'R'); + if ($priceBreakDown['hasEcotax']) + $this->Cell($w[4], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsEcotax'][$tax_rate], self::$currency, true, false)), 0, 0, 'R'); + $this->Cell($w[$priceBreakDown['hasEcotax'] ? 5 : 4], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithTax'][$tax_rate], self::$currency, true, false)), 0, 0, 'R'); + $this->Ln(); + } + } + + // Display carrier tax + if ($carrier_tax_rate AND $carrier_tax_rate != '0.00' AND ((self::$order->total_shipping != '0.00' AND !self::$orderSlip) OR (self::$orderSlip AND self::$orderSlip->shipping_cost))) + { + $nb_tax++; + $before = $this->GetY(); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX(), $this->GetY() - $lineSize + 3); + $this->Cell($w[0], $lineSize, self::l('Carrier'), 0, 0, 'R'); + $this->Cell($w[1], $lineSize, number_format($carrier_tax_rate, 3, ',', ' ').' %', 0, 0, 'R'); + $this->Cell($w[2], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['shippingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + $this->Cell($w[3], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_shipping - $priceBreakDown['shippingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + if ($priceBreakDown['hasEcotax']) + $this->Cell($w[4], $lineSize, (self::$orderSlip ? '-' : '').'', 0, 0, 'R'); + $this->Cell($w[$priceBreakDown['hasEcotax'] ? 5 : 4], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_shipping, self::$currency, true, false)), 0, 0, 'R'); + $this->Ln(); + } + + // Display wrapping tax + if (self::$order->total_wrapping AND self::$order->total_wrapping != '0.00') + { + $tax = new Tax((int)(Configuration::get('PS_GIFT_WRAPPING_TAX'))); + $taxRate = $tax->rate; + + $nb_tax++; + $before = $this->GetY(); + $lineSize = $this->GetY() - $before; + $this->SetXY($this->GetX(), $this->GetY() - $lineSize + 3); + $this->Cell($w[0], $lineSize, self::l('Gift-wrapping'), 0, 0, 'R'); + $this->Cell($w[1], $lineSize, number_format($taxRate, 3, ',', ' ').' %', 0, 0, 'R'); + $this->Cell($w[2], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['wrappingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + $this->Cell($w[3], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_wrapping - $priceBreakDown['wrappingCostWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); + $this->Cell($w[4], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_wrapping, self::$currency, true, false)), 0, 0, 'R'); + } + + if (!$nb_tax) + $this->Cell(190, 10, self::l('No tax'), 0, 0, 'C'); + } + + static protected function convertSign($s) + { + $arr['before'] = array('€', '£', '¥'); + $arr['after'] = array(chr(128), chr(163), chr(165)); + return str_replace($arr['before'], $arr['after'], $s); + } + + static protected function l($string) + { + global $cookie; + $iso = Language::getIsoById((isset($cookie->id_lang) AND Validate::isUnsignedId($cookie->id_lang)) ? $cookie->id_lang : Configuration::get('PS_LANG_DEFAULT')); + + if (@!include(_PS_TRANSLATIONS_DIR_.$iso.'/pdf.php')) + die('Cannot include PDF translation language file : '._PS_TRANSLATIONS_DIR_.$iso.'/pdf.php'); + + if (!isset($_LANGPDF) OR !is_array($_LANGPDF)) + return str_replace('"', '"', $string); + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (key_exists('PDF_invoice'.$key, $_LANGPDF) ? $_LANGPDF['PDF_invoice'.$key] : $string); + + return (Tools::iconv('utf-8', self::encoding(), $str)); + } + + static public function encoding() + { + return (isset(self::$_pdfparams[self::$_iso]) AND is_array(self::$_pdfparams[self::$_iso]) AND self::$_pdfparams[self::$_iso]['encoding']) ? self::$_pdfparams[self::$_iso]['encoding'] : 'iso-8859-1'; + } + + static public function embedfont() + { + return (((isset(self::$_pdfparams[self::$_iso]) AND is_array(self::$_pdfparams[self::$_iso]) AND self::$_pdfparams[self::$_iso]['font']) AND !in_array(self::$_pdfparams[self::$_iso]['font'], self::$_fpdf_core_fonts)) ? self::$_pdfparams[self::$_iso]['font'] : false); + } + + static public function fontname() + { + $font = self::embedfont(); + if (in_array(self::$_pdfparams[self::$_iso]['font'], self::$_fpdf_core_fonts)) + $font = self::$_pdfparams[self::$_iso]['font']; + return $font ? $font : 'Arial'; + } + +} + diff --git a/classes/Pack.php b/classes/Pack.php new file mode 100644 index 000000000..43a00b8b3 --- /dev/null +++ b/classes/Pack.php @@ -0,0 +1,201 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PackCore extends Product +{ + protected static $cachePackItems = array(); + protected static $cacheIsPack = array(); + protected static $cacheIsPacked = array(); + + public static function isPack($id_product) + { + if (!array_key_exists($id_product, self::$cacheIsPack)) + { + $result = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'pack WHERE id_product_pack = '.(int)($id_product)); + self::$cacheIsPack[$id_product] = ($result > 0); + } + return self::$cacheIsPack[$id_product]; + } + + public static function isPacked($id_product) + { + if (!array_key_exists($id_product, self::$cacheIsPacked)) + { + $result = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'pack WHERE id_product_item = '.(int)($id_product)); + self::$cacheIsPacked[$id_product] = ($result > 0); + } + return self::$cacheIsPacked[$id_product]; + } + + public static function noPackPrice($id_product) + { + global $cookie; + + $sum = 0; + + $price_display_method = !self::$_taxCalculationMethod; + $items = self::getItems($id_product, Configuration::get('PS_LANG_DEFAULT')); + foreach ($items as $item) + $sum += $item->getPrice($price_display_method) * $item->pack_quantity; + return $sum; + } + + public static function getItems($id_product, $id_lang) + { + if (array_key_exists($id_product, self::$cachePackItems)) + return self::$cachePackItems[$id_product]; + $result = Db::getInstance()->ExecuteS('SELECT id_product_item, quantity FROM '._DB_PREFIX_.'pack where id_product_pack = '.(int)($id_product)); + $arrayResult = array(); + foreach ($result AS $row) + { + $p = new Product($row['id_product_item'], false, (int)($id_lang)); + $p->pack_quantity = $row['quantity']; + $arrayResult[] = $p; + } + self::$cachePackItems[$id_product] = $arrayResult; + return self::$cachePackItems[$id_product]; + } + + public static function isInStock($id_product) + { + // Not enough, the quantity must be > to the item quantity of the pack, not just > 0 + $items = self::getItems((int)($id_product), Configuration::get('PS_LANG_DEFAULT')); + foreach ($items AS $item) + if ($item->quantity == 0 AND !$item->isAvailableWhenOutOfStock((int)($item->out_of_stock))) + return false; + return true; + } + + public static function getItemTable($id_product, $id_lang, $full = false) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, pl.*, i.`id_image`, il.`legend`, t.`rate`, cl.`name` AS category_default, a.quantity AS pack_quantity + FROM `'._DB_PREFIX_.'pack` a + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = a.id_product_item + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.id_product = pl.id_product AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') + WHERE a.`id_product_pack` = '.(int)($id_product) + ); + if (!$full) + return $result; + + $arrayResult = array(); + foreach ($result as $row) + if (!Pack::isPack($row['id_product'])) + $arrayResult[] = Product::getProductProperties($id_lang, $row); + return $arrayResult; + } + + public static function getPacksTable($id_product, $id_lang, $full = false, $limit = NULL) + { + $packs = Db::getInstance()->getValue(' + SELECT GROUP_CONCAT(a.`id_product_pack`, ",") + FROM `'._DB_PREFIX_.'pack` a + WHERE a.`id_product_item` = '.(int)$id_product.')'); + if (!(int)$packs) + return array(); + + $sql = ' + SELECT p.*, pl.*, i.`id_image`, il.`legend`, t.`rate` + FROM `'._DB_PREFIX_.'product` p + NATURAL LEFT JOIN `'._DB_PREFIX_.'product_lang` pl + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)$id_lang.') + WHERE pl.`id_lang` = '.(int)$id_lang.' + AND p.`id_product` IN ('.$packs.')'; + if ($limit) + $sql .= ' LIMIT '.(int)$limit; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + if (!$full) + return $result; + + $arrayResult = array(); + foreach ($result as $row) + if (!Pack::isPacked($row['id_product'])) + $arrayResult[] = Product::getProductProperties($id_lang, $row); + return $arrayResult; + } + + public static function deleteItems($id_product) + { + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 0 WHERE id_product = '.(int)($id_product).' LIMIT 1'); + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'pack` WHERE `id_product_pack` = '.(int)($id_product)); + } + + /** + * @deprecated + */ + public static function addItems($id_product, $ids) + { + Tools::displayAsDeprecated(); + + array_pop($ids); + foreach ($ids as $id_product_item) + { + $idQty = explode('x', $id_product_item); + if (!self::addItem($id_product, $idQty[1], $idQty[0])) + return false; + } + return true; + } + + /** + * Add an item to the pack + * + * @param integer $id_product + * @param integer $id_item + * @param integer $qty + * @return boolean true if everything was fine + */ + public static function addItem($id_product, $id_item, $qty) + { + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 1 WHERE id_product = '.(int)($id_product).' LIMIT 1'); + return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('id_product_pack' => (int)($id_product), 'id_product_item' => (int)($id_item), 'quantity' => (int)($qty)), 'INSERT'); + } + + public static function duplicate($id_product_old, $id_product_new) + { + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'pack (id_product_pack, id_product_item, quantity) + (SELECT '.(int)($id_product_new).', id_product_item, quantity FROM '._DB_PREFIX_.'pack WHERE id_product_pack = '.(int)($id_product_old).')'); + + // If return query result, a non-pack product will return false + return true; + } +} + diff --git a/classes/Page.php b/classes/Page.php new file mode 100644 index 000000000..9c235ff78 --- /dev/null +++ b/classes/Page.php @@ -0,0 +1,120 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PageCore extends ObjectModel +{ + public $id_page_type; + public $id_object; + + public $name; + + protected $fieldsRequired = array ('id_page_type'); + protected $fieldsValidate = array ('id_page_type' => 'isUnsignedId', 'id_object' => 'isUnsignedId'); + + protected $table = 'page'; + protected $identifier = 'id_page'; + + public function getFields() + { + parent::validateFields(); + $fields['id_page_type'] = (int)($this->id_page_type); + $fields['id_object'] = (int)($this->id_object); + return $fields; + } + + public static function getCurrentId() + { + $phpSelf = isset($_SERVER['PHP_SELF']) ? substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__)) : ''; + + // Some pages must be distinguished in order to record exactly what is being seen + $specialArray = array( + 'product.php' => 'id_product', + 'category.php' => 'id_category', + 'order.php' => 'step', + 'manufacturer.php' => 'id_manufacturer'); + if (array_key_exists($phpSelf, $specialArray)) + { + $id_object = Tools::getValue($specialArray[$phpSelf]); + $result = Db::getInstance()->getRow(' + SELECT p.`id_page` + FROM `'._DB_PREFIX_.'page` p + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.`id_page_type` = pt.`id_page_type` + WHERE pt.`name` = \''.pSQL($phpSelf).'\' + AND p.`id_object` = '.(int)($id_object)); + if ($result['id_page']) + return $result['id_page']; + else + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'page` (`id_page_type`,`id_object`) + VALUES ((SELECT pt.`id_page_type` FROM `'._DB_PREFIX_.'page_type` pt WHERE pt.`name` = \''.pSQL($phpSelf).'\'), + '.(int)($id_object).')'); + return Db::getInstance()->Insert_ID(); + } + } + else + { + $result = Db::getInstance()->getRow(' + SELECT p.`id_page` + FROM `'._DB_PREFIX_.'page` p + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.`id_page_type` = pt.`id_page_type` + WHERE pt.`name` = \''.pSQL($phpSelf).'\''); + if ($result['id_page']) + return $result['id_page']; + else + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'page_type` (`name`) + VALUES (\''.pSQL($phpSelf).'\')'); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'page` (`id_page_type`) + VALUES ('.(int)(Db::getInstance()->Insert_ID()).')'); + return Db::getInstance()->Insert_ID(); + } + } + } + + public static function setPageViewed($id_page) + { + $id_date_range = DateRange::getCurrentRange(); + + // Try to increment the visits counter + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'page_viewed` + SET `counter` = `counter` + 1 + WHERE `id_date_range` = '.(int)($id_date_range).' + AND `id_page` = '.(int)($id_page)); + + // If no one has seen the page in this date range, it is added + if (Db::getInstance()->Affected_Rows() == 0) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'page_viewed` (`id_date_range`,`id_page`,`counter`) + VALUES ('.(int)($id_date_range).','.(int)($id_page).',1)'); + } +} + + diff --git a/classes/PaymentCC.php b/classes/PaymentCC.php new file mode 100644 index 000000000..a418ca264 --- /dev/null +++ b/classes/PaymentCC.php @@ -0,0 +1,74 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PaymentCCCore extends ObjectModel +{ + public $id_order; + public $id_currency; + public $amount; + public $transaction_id; + public $card_number; + public $card_brand; + public $card_expiration; + public $card_holder; + public $date_add; + + protected $fieldsRequired = array('id_currency', 'amount'); + protected $fieldsSize = array('transaction_id' => 254, 'card_number' => 254, 'card_brand' => 254, 'card_expiration' => 254, 'card_holder' => 254); + protected $fieldsValidate = array( + 'id_order' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', 'amount' => 'isPrice', + 'transaction_id' => 'isAnything', 'card_number' => 'isAnything', 'card_brand' => 'isAnything', 'card_expiration' => 'isAnything', 'card_holder' => 'isAnything'); + + protected $table = 'payment_cc'; + protected $identifier = 'id_payment_cc'; + + public function getFields() + { + parent::validateFields(); + $fields['id_order'] = (int)($this->id_order); + $fields['id_currency'] = (int)($this->id_currency); + $fields['amount'] = (float)($this->amount); + $fields['transaction_id'] = pSQL($this->transaction_id); + $fields['card_number'] = pSQL($this->card_number); + $fields['card_brand'] = pSQL($this->card_brand); + $fields['card_expiration'] = pSQL($this->card_expiration); + $fields['card_holder'] = pSQL($this->card_holder); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + if (parent::add($autodate, $nullValues)) + { + Module::hookExec('paymentCCAdded', array('paymentCC' => $this)); + return true; + } + return false; + } +} + diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php new file mode 100644 index 000000000..2d8fb2c8c --- /dev/null +++ b/classes/PaymentModule.php @@ -0,0 +1,478 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../config/config.inc.php'); + +abstract class PaymentModuleCore extends Module +{ + /** @var integer Current order's id */ + public $currentOrder; + public $currencies = true; + public $currencies_mode = 'checkbox'; + + public function install() + { + if (!parent::install()) + return false; + + // Insert currencies availability + if ($this->currencies_mode == 'checkbox') + { + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_currency` (id_module, id_currency) + SELECT '.(int)($this->id).', id_currency FROM `'._DB_PREFIX_.'currency` WHERE deleted = 0')) + return false; + } + elseif ($this->currencies_mode == 'radio') + { + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_currency` (id_module, id_currency) + VALUES ('.(int)($this->id).', -2)')) + return false; + } + else + Tools::displayError('No currency mode for payment module'); + + // Insert countries availability + $return = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_country` (id_module, id_country) + SELECT '.(int)($this->id).', id_country FROM `'._DB_PREFIX_.'country` WHERE active = 1'); + // Insert group availability + $return &= Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_group` (id_module, id_group) + SELECT '.(int)($this->id).', id_group FROM `'._DB_PREFIX_.'group`'); + + return $return; + } + + public function uninstall() + { + if (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_country` WHERE id_module = '.(int)($this->id)) + OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_currency` WHERE id_module = '.(int)($this->id)) + OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_group` WHERE id_module = '.(int)($this->id))) + return false; + return parent::uninstall(); + } + + /** + * Validate an order in database + * Function called from a payment module + * + * @param integer $id_cart Value + * @param integer $id_order_state Value + * @param float $amountPaid Amount really paid by customer (in the default currency) + * @param string $paymentMethod Payment method (eg. 'Credit card') + * @param string $message Message to attach to order + */ + + public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false) + { + global $cart; + + $cart = new Cart((int)($id_cart)); + // Does order already exists ? + if (Validate::isLoadedObject($cart) AND $cart->OrderExists() === 0) + { + if ($secure_key !== false AND $secure_key != $cart->secure_key) + die(Tools::displayError()); + + // Copying data from cart + $order = new Order(); + $order->id_carrier = (int)($cart->id_carrier); + $order->id_customer = (int)($cart->id_customer); + $order->id_address_invoice = (int)($cart->id_address_invoice); + $order->id_address_delivery = (int)($cart->id_address_delivery); + $vat_address = new Address((int)($order->id_address_delivery)); + $order->id_currency = ($currency_special ? (int)($currency_special) : (int)($cart->id_currency)); + $order->id_lang = (int)($cart->id_lang); + $order->id_cart = (int)($cart->id); + $customer = new Customer((int)($order->id_customer)); + $order->secure_key = ($secure_key ? pSQL($secure_key) : pSQL($customer->secure_key)); + $order->payment = Tools::substr($paymentMethod, 0, 32); + if (isset($this->name)) + $order->module = $this->name; + $order->recyclable = $cart->recyclable; + $order->gift = (int)($cart->gift); + $order->gift_message = $cart->gift_message; + $currency = new Currency($order->id_currency); + $order->conversion_rate = $currency->conversion_rate; + $amountPaid = !$dont_touch_amount ? Tools::ps_round((float)($amountPaid), 2) : $amountPaid; + $order->total_paid_real = $amountPaid; + $order->total_products = (float)($cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)); + $order->total_products_wt = (float)($cart->getOrderTotal(true, Cart::ONLY_PRODUCTS)); + $order->total_discounts = (float)(abs($cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS))); + $order->total_shipping = (float)($cart->getOrderShippingCost()); + $order->carrier_tax_rate = (float)Tax::getCarrierTaxRate($cart->id_carrier, (int)$cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + $order->total_wrapping = (float)(abs($cart->getOrderTotal(true, Cart::ONLY_WRAPPING))); + $order->total_paid = (float)(Tools::ps_round((float)($cart->getOrderTotal(true, Cart::BOTH)), 2)); + $order->invoice_date = '0000-00-00 00:00:00'; + $order->delivery_date = '0000-00-00 00:00:00'; + // Amount paid by customer is not the right one -> Status = payment error + if ($order->total_paid != $order->total_paid_real) + $id_order_state = _PS_OS_ERROR_; + // Creating order + if ($cart->OrderExists() === 0) + $result = $order->add(); + else + { + $errorMessage = Tools::displayError('An order has already been placed using this cart.'); + Logger::addLog($errorMessage, 4, '0000001', 'Cart', intval($order->id_cart)); + die($errorMessage); + } + + // Next ! + if ($result AND isset($order->id)) + { + if (!$secure_key) + $message .= $this->l('Warning : the secure key is empty, check your payment account before validation'); + // Optional message to attach to this order + if (isset($message) AND !empty($message)) + { + $msg = new Message(); + $message = strip_tags($message, '
'); + if (!Validate::isCleanHtml($message)) + $message = $this->l('Payment message is not valid, please check your module!'); + $msg->message = $message; + $msg->id_order = (int)($order->id); + $msg->private = 1; + $msg->add(); + } + + // Insert products from cart into order_detail table + $products = $cart->getProducts(); + $productsList = ''; + $db = Db::getInstance(); + $query = 'INSERT INTO `'._DB_PREFIX_.'order_detail` + (`id_order`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_in_stock`, `product_price`, `reduction_percent`, `reduction_amount`, `group_reduction`, `product_quantity_discount`, `product_ean13`, `product_upc`, `product_reference`, `product_supplier_reference`, `product_weight`, `tax_name`, `tax_rate`, `ecotax`, `ecotax_tax_rate`, `discount_quantity_applied`, `download_deadline`, `download_hash`) + VALUES '; + + $customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart)); + Product::addCustomizationPrice($products, $customizedDatas); + $outOfStock = false; + foreach ($products AS $key => $product) + { + $productQuantity = (int)(Product::getQuantity((int)($product['id_product']), ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL))); + $quantityInStock = ($productQuantity - (int)($product['cart_quantity']) < 0) ? $productQuantity : (int)($product['cart_quantity']); + if ($id_order_state != _PS_OS_CANCELED_ AND $id_order_state != _PS_OS_ERROR_) + { + if (Product::updateQuantity($product, (int)$order->id)) + $product['stock_quantity'] -= $product['cart_quantity']; + if ($product['stock_quantity'] < 0 && Configuration::get('PS_STOCK_MANAGEMENT')) + $outOfStock = true; + + Hook::updateQuantity($product, $order); + Product::updateDefaultAttribute($product['id_product']); + } + $price = Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 6, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + $price_wt = Product::getPriceStatic((int)($product['id_product']), true, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), 2, NULL, false, true, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + // Add some informations for virtual products + $deadline = '0000-00-00 00:00:00'; + $download_hash = NULL; + if ($id_product_download = ProductDownload::getIdFromIdProduct((int)($product['id_product']))) + { + $productDownload = new ProductDownload((int)($id_product_download)); + $deadline = $productDownload->getDeadLine(); + $download_hash = $productDownload->getHash(); + } + + // Exclude VAT + if (Tax::excludeTaxeOption()) + { + $product['tax'] = 0; + $product['rate'] = 0; + $tax_rate = 0; + } + else + $tax_rate = Tax::getProductTaxRate((int)($product['id_product']), $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + + $ecotaxTaxRate = 0; + if (!empty($product['ecotax'])) + $ecotaxTaxRate = Tax::getProductEcotaxRate($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + + $quantityDiscount = SpecificPrice::getQuantityDiscount((int)$product['id_product'], Shop::getCurrentShop(), (int)$cart->id_currency, (int)$vat_address->id_country, (int)$customer->id_default_group, (int)$product['cart_quantity']); + $unitPrice = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? intval($product['id_product_attribute']) : NULL), 2, NULL, false, true, 1, false, (int)$order->id_customer, NULL, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + $quantityDiscountValue = $quantityDiscount ? ((Product::getTaxCalculationMethod((int)$order->id_customer) == PS_TAX_EXC ? Tools::ps_round($unitPrice, 2) : $unitPrice) - $quantityDiscount['price'] * (1 + $tax_rate / 100)) : 0.00; + $query .= '('.(int)($order->id).', + '.(int)($product['id_product']).', + '.(isset($product['id_product_attribute']) ? (int)($product['id_product_attribute']) : 'NULL').', + \''.pSQL($product['name'].((isset($product['attributes']) AND $product['attributes'] != NULL) ? ' - '.$product['attributes'] : '')).'\', + '.(int)($product['cart_quantity']).', + '.$quantityInStock.', + '.(float)(Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), (Product::getTaxCalculationMethod((int)($order->id_customer)) == PS_TAX_EXC ? 2 : 6), NULL, false, false, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}), $specificPrice, FALSE)).', + '.(float)(($specificPrice AND $specificPrice['reduction_type'] == 'percentage') ? $specificPrice['reduction'] * 100 : 0.00).', + '.(float)(($specificPrice AND $specificPrice['reduction_type'] == 'amount') ? (!$specificPrice['id_currency'] ? Tools::convertPrice($specificPrice['reduction'], $order->id_currency) : $specificPrice['reduction']) : 0.00).', + '.(float)(Group::getReduction((int)($order->id_customer))).', + '.$quantityDiscountValue.', + '.(empty($product['ean13']) ? 'NULL' : '\''.pSQL($product['ean13']).'\'').', + '.(empty($product['upc']) ? 'NULL' : '\''.pSQL($product['upc']).'\'').', + '.(empty($product['reference']) ? 'NULL' : '\''.pSQL($product['reference']).'\'').', + '.(empty($product['supplier_reference']) ? 'NULL' : '\''.pSQL($product['supplier_reference']).'\'').', + '.(float)($product['id_product_attribute'] ? $product['weight_attribute'] : $product['weight']).', + \''.(empty($tax_rate) ? '' : pSQL($product['tax'])).'\', + '.(float)($tax_rate).', + '.(float)Tools::convertPrice(floatval($product['ecotax']), intval($order->id_currency)).', + '.(float)$ecotaxTaxRate.', + '.(($specificPrice AND $specificPrice['from_quantity'] > 1) ? 1 : 0).', + \''.pSQL($deadline).'\', + \''.pSQL($download_hash).'\'),'; + + $customizationQuantity = 0; + if (isset($customizedDatas[$product['id_product']][$product['id_product_attribute']])) + { + $customizationText = ''; + foreach ($customizedDatas[$product['id_product']][$product['id_product_attribute']] AS $customization) + if (isset($customization['datas'][_CUSTOMIZE_TEXTFIELD_])) + foreach ($customization['datas'][_CUSTOMIZE_TEXTFIELD_] AS $text) + $customizationText .= $text['name'].$this->l(':').' '.$text['value'].', '; + $customizationText = rtrim($customizationText, ', '); + + $customizationQuantity = (int)($product['customizationQuantityTotal']); + $productsList .= + ' + '.$product['reference'].' + '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').' - '.$this->l('Customized').(!empty($customizationText) ? ' - '.$customizationText : '').' + '.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt, $currency, false, false).' + '.$customizationQuantity.' + '.Tools::displayPrice($customizationQuantity * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false, false).' + '; + } + + if (!$customizationQuantity OR (int)$product['cart_quantity'] > $customizationQuantity) + $productsList .= + ' + '.$product['reference'].' + '.$product['name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').' + '.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt, $currency, false, false).' + '.((int)($product['cart_quantity']) - $customizationQuantity).' + '.Tools::displayPrice(((int)($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false, false).' + '; + } // end foreach ($products) + $query = rtrim($query, ','); + $result = $db->Execute($query); + + // Insert discounts from cart into order_discount table + $discounts = $cart->getDiscounts(); + $discountsList = ''; + $total_discount_value = 0; + $shrunk = false; + foreach ($discounts AS $discount) + { + $objDiscount = new Discount((int)$discount['id_discount'], $order->id_lang); + $value = $objDiscount->getValue(sizeof($discounts), $cart->getOrderTotal(true, Cart::ONLY_PRODUCTS), $order->total_shipping, $cart->id); + if ($objDiscount->id_discount_type == 2 AND in_array($objDiscount->behavior_not_exhausted, array(1,2))) + $shrunk = true; + + if ($shrunk AND ($total_discount_value + $value) > ($order->total_products + $order->total_shipping + $order->total_wrapping)) + { + $amount_to_add = ($order->total_products + $order->total_shipping + $order->total_wrapping) - $total_discount_value; + if ($objDiscount->id_discount_type == 2 AND $objDiscount->behavior_not_exhausted == 2) + { + $voucher = new Discount(); + foreach ($objDiscount AS $key => $discountValue) + $voucher->$key = $discountValue; + $voucher->name = 'VSRK'.(int)$order->id_customer.'O'.(int)$order->id; + $voucher->value = (float)$value - $amount_to_add; + $voucher->add(); + $params['{voucher_amount}'] = Tools::displayPrice($voucher->value, $currency, false, false); + $params['{voucher_num}'] = $voucher->name; + @Mail::Send((int)$order->id_lang, 'voucher', Mail::l('New voucher regarding your order #').$order->id, $params, $customer->email, $customer->firstname.' '.$customer->lastname); + } + } + else + $amount_to_add = $value; + $order->addDiscount($objDiscount->id, $objDiscount->name, $amount_to_add); + $total_discount_value += $amount_to_add; + if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_) + $objDiscount->quantity = $objDiscount->quantity - 1; + $objDiscount->update(); + + $discountsList .= + ' + '.$this->l('Voucher code:').' '.$objDiscount->name.' + '.($value != 0.00 ? '-' : '').Tools::displayPrice($value, $currency, false, false).' + '; + } + + // Specify order id for message + $oldMessage = Message::getMessageByCartId((int)($cart->id)); + if ($oldMessage) + { + $message = new Message((int)$oldMessage['id_message']); + $message->id_order = (int)$order->id; + $message->update(); + } + + // Hook new order + $orderStatus = new OrderState((int)$id_order_state, (int)$order->id_lang); + if (Validate::isLoadedObject($orderStatus)) + { + Hook::newOrder($cart, $order, $customer, $currency, $orderStatus); + foreach ($cart->getProducts() AS $product) + if ($orderStatus->logable) + ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']); + } + + if (isset($outOfStock) AND $outOfStock) + { + $history = new OrderHistory(); + $history->id_order = (int)$order->id; + $history->changeIdOrderState(_PS_OS_OUTOFSTOCK_, (int)$order->id); + $history->addWithemail(); + } + + // Set order state in order history ONLY even if the "out of stock" status has not been yet reached + // So you migth have two order states + $new_history = new OrderHistory(); + $new_history->id_order = (int)$order->id; + $new_history->changeIdOrderState((int)$id_order_state, (int)$order->id); + $new_history->addWithemail(true, $extraVars); + + // Order is reloaded because the status just changed + $order = new Order($order->id); + + // Send an e-mail to customer + if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_ AND $customer->id) + { + $invoice = new Address((int)($order->id_address_invoice)); + $delivery = new Address((int)($order->id_address_delivery)); + $carrier = new Carrier((int)($order->id_carrier), $order->id_lang); + $delivery_state = $delivery->id_state ? new State((int)($delivery->id_state)) : false; + $invoice_state = $invoice->id_state ? new State((int)($invoice->id_state)) : false; + + $data = array( + '{firstname}' => $customer->firstname, + '{lastname}' => $customer->lastname, + '{email}' => $customer->email, + '{delivery_company}' => $delivery->company, + '{delivery_firstname}' => $delivery->firstname, + '{delivery_lastname}' => $delivery->lastname, + '{delivery_address1}' => $delivery->address1, + '{delivery_address2}' => $delivery->address2, + '{delivery_city}' => $delivery->city, + '{delivery_postal_code}' => $delivery->postcode, + '{delivery_country}' => $delivery->country, + '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '', + '{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile, + '{delivery_other}' => $delivery->other, + '{invoice_company}' => $invoice->company, + '{invoice_vat_number}' => $invoice->vat_number, + '{invoice_firstname}' => $invoice->firstname, + '{invoice_lastname}' => $invoice->lastname, + '{invoice_address2}' => $invoice->address2, + '{invoice_address1}' => $invoice->address1, + '{invoice_city}' => $invoice->city, + '{invoice_postal_code}' => $invoice->postcode, + '{invoice_country}' => $invoice->country, + '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', + '{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile, + '{invoice_other}' => $invoice->other, + '{order_name}' => sprintf("#%06d", (int)($order->id)), + '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)($order->id_lang), 1), + '{carrier}' => $carrier->name, + '{payment}' => $order->payment, + '{products}' => $productsList, + '{discounts}' => $discountsList, + '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false), + '{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false, false), + '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false), + '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false), + '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false)); + + if (is_array($extraVars)) + $data = array_merge($data, $extraVars); + + // Join PDF invoice + if ((int)(Configuration::get('PS_INVOICE')) AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number) + { + $fileAttachment['content'] = PDF::invoice($order, 'S'); + $fileAttachment['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)($order->id_lang)).sprintf('%06d', $order->invoice_number).'.pdf'; + $fileAttachment['mime'] = 'application/pdf'; + } + else + $fileAttachment = NULL; + + if (Validate::isEmail($customer->email)) + Mail::Send((int)($order->id_lang), 'order_conf', Mail::l('Order confirmation'), $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); + } + $this->currentOrder = (int)($order->id); + return true; + } + else + { + $errorMessage = Tools::displayError('Order creation failed'); + Logger::addLog($errorMessage, 4, '0000002', 'Cart', intval($order->id_cart)); + die($errorMessage); + } + } + else + { + $errorMessage = Tools::displayError('Cart can\'t be loaded or an order has already been placed using this cart'); + Logger::addLog($errorMessage, 4, '0000001', 'Cart', intval($cart->id)); + die($errorMessage); + } + } + + + /** + * @param int $id_currency : this parameter is optionnal but on 1.5 version of Prestashop, it will be REQUIRED + * @return Currency + */ + public function getCurrency($current_id_currency = NULL) + { + if (!(int)$current_id_currency) + global $cookie; + + if (!$this->currencies) + return false; + if ($this->currencies_mode == 'checkbox') + { + $currencies = Currency::getPaymentCurrencies($this->id); + return $currencies; + } + elseif ($this->currencies_mode == 'radio') + { + $currencies = Currency::getPaymentCurrenciesSpecial($this->id); + $currency = $currencies['id_currency']; + if ($currency == -1) + { + // not use $cookie if $current_id_currency is set + if ((int)$current_id_currency) + $id_currency = (int)$current_id_currency; + else + $id_currency = (int)($cookie->id_currency); + } + elseif ($currency == -2) + $id_currency = (int)(Configuration::get('PS_CURRENCY_DEFAULT')); + else + $id_currency = $currency; + } + if (!isset($id_currency) OR empty($id_currency)) + return false; + return (new Currency($id_currency)); + } +} + diff --git a/classes/Product.php b/classes/Product.php new file mode 100644 index 000000000..eafd4a1a3 --- /dev/null +++ b/classes/Product.php @@ -0,0 +1,3101 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('_CUSTOMIZE_FILE_', 0); +define('_CUSTOMIZE_TEXTFIELD_', 1); + +class ProductCore extends ObjectModel +{ + /** @var string Tax name */ + public $tax_name; + + /** @var string Tax rate */ + public $tax_rate; + + /** @var string Tax rules group */ + public $id_tax_rules_group; + + /** @var integer Manufacturer id */ + public $id_manufacturer; + + /** @var integer Supplier id */ + public $id_supplier; + + /** @var integer default Category id */ + public $id_category_default; + + /** @var integer default Attribute id if color picker is enabled */ + public $id_color_default; + + /** @var string Manufacturer name */ + public $manufacturer_name; + + /** @var string Supplier name */ + public $supplier_name; + + /** @var string Name */ + public $name; + + /** @var string Long description */ + public $description; + + /** @var string Short description */ + public $description_short; + + /** @var integer Quantity available */ + public $quantity = 0; + + /** @var integer Minimal quantity for add to cart */ + public $minimal_quantity = 0; + + /** @var string available_now */ + public $available_now; + + /** @var string available_later */ + public $available_later; + + /** @var float Price in euros */ + public $price = 0; + + /** @var float Additional shipping cost */ + public $additional_shipping_cost = 0; + + /** @var float Wholesale Price in euros */ + public $wholesale_price = 0; + + /** @var boolean on_sale */ + public $on_sale = false; + + /** @var boolean online_only */ + public $online_only = false; + + /** @var string unity */ + public $unity = NULL; + + /** @var float price for product's unity */ + public $unit_price; + + /** @var float price for product's unity ratio */ + public $unit_price_ratio = 0; + + /** @var float Ecotax */ + public $ecotax = 0; + + /** @var string Reference */ + public $reference; + + /** @var string Supplier Reference */ + public $supplier_reference; + + /** @var string Location */ + public $location; + + /** @var string Width in default width unit */ + public $width = 0; + + /** @var string Height in default height unit */ + public $height = 0; + + /** @var string Depth in default depth unit */ + public $depth = 0; + + /** @var string Weight in default weight unit */ + public $weight = 0; + + /** @var string Ean-13 barcode */ + public $ean13; + + /** @var string Upc barcode */ + public $upc; + + /** @var string Friendly URL */ + public $link_rewrite; + + /** @var string Meta tag description */ + public $meta_description; + + /** @var string Meta tag keywords */ + public $meta_keywords; + + /** @var string Meta tag title */ + public $meta_title; + + /** @var integer Out of stock behavior */ + public $out_of_stock = 2; + + /** @var boolean Product statuts */ + public $quantity_discount = 0; + + /** @var boolean Product customization */ + public $customizable; + + /** @var boolean Product is new */ + public $new = NULL; + + /** @var integer Number of uploadable files (concerning customizable products) */ + public $uploadable_files; + + /** @var interger Number of text fields */ + public $text_fields; + + /** @var boolean Product statuts */ + public $active = 1; + + /** @var boolean Product available for order */ + public $available_for_order = 1; + + /** @var enum Product condition (new, used, refurbished) */ + public $condition; + + /** @var boolean Show price of Product */ + public $show_price = 1; + + public $indexed = 0; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + /*** @var array Tags */ + public $tags; + + public $cache_is_pack; + public $cache_has_attachments; + public $cache_default_attribute; + + public static $_taxCalculationMethod = PS_TAX_EXC; + protected static $_prices = array(); + protected static $_pricesLevel2 = array(); + protected static $_pricesLevel3 = array(); + protected static $_incat = array(); + protected static $_cart_quantity = array(); + protected static $_tax_rules_group = array(); + protected static $_cacheFeatures = array(); + protected static $_frontFeaturesCache = array(); + + /** @var array tables */ + protected $tables = array ('product', 'product_lang'); + + protected $fieldsRequired = array('quantity', 'price'); + protected $fieldsSize = array('reference' => 32, 'supplier_reference' => 32, 'location' => 64, 'ean13' => 13, 'upc' => 12, 'unity' => 10); + protected $fieldsValidate = array( + 'id_tax_rules_group' => 'isUnsignedId', + 'id_manufacturer' => 'isUnsignedId', + 'id_supplier' => 'isUnsignedId', + 'id_category_default' => 'isUnsignedId', + 'id_color_default' => 'isUnsignedInt', /* unsigned integer because its value could be 0 if the feature is disabled */ + 'minimal_quantity' => 'isUnsignedInt', + 'price' => 'isPrice', + 'additional_shipping_cost' => 'isPrice', + 'wholesale_price' => 'isPrice', + 'on_sale' => 'isBool', + 'online_only' => 'isBool', + 'ecotax' => 'isPrice', + 'unit_price' => 'isPrice', + 'unity' => 'isString', + 'reference' => 'isReference', + 'supplier_reference' => 'isReference', + 'location' => 'isReference', + 'width' => 'isFloat', + 'height' => 'isFloat', + 'depth' => 'isFloat', + 'weight' => 'isFloat', + 'out_of_stock' => 'isUnsignedInt', + 'quantity_discount' => 'isBool', + 'customizable' => 'isUnsignedInt', + 'uploadable_files' => 'isUnsignedInt', + 'text_fields' => 'isUnsignedInt', + 'active' => 'isBool', + 'available_for_order' => 'isBool', + 'condition' => 'isGenericName', + 'show_price' => 'isBool', + 'ean13' => 'isEan13', + 'upc' => 'isUpc', + 'indexed' => 'isBool', + 'cache_is_pack' => 'isBool', + 'cache_has_attachments' => 'isBool' + ); + protected $fieldsRequiredLang = array('link_rewrite', 'name'); + /* Description short is limited to 400 chars, but without html, so it can't be generic */ + protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, + 'meta_title' => 128, 'link_rewrite' => 128, 'name' => 128, 'available_now' => 255, 'available_later' => 255); + protected $fieldsValidateLang = array( + 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', + 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'name' => 'isCatalogName', + 'description' => 'isString', 'description_short' => 'isString', 'available_now' => 'isGenericName', 'available_later' => 'IsGenericName'); + + protected $table = 'product'; + protected $identifier = 'id_product'; + + protected $webserviceParameters = array( + 'objectNodeNames' => 'products', + 'fields' => array( + 'id_manufacturer' => array('xlink_resource' => 'manufacturers'), + 'id_supplier' => array('xlink_resource' => 'suppliers'), + 'id_category_default' => array('xlink_resource' => 'categories'), + 'out_of_stock' => array('required' => true), + 'new' => array(), + 'cache_default_attribute' => array(), + 'id_default_image' => array('getter' => 'getCoverWs', 'setter' => '', 'xlink_resource' => array('resourceName' => 'images', 'subResourceName' => 'products')), + ), + 'associations' => array( + 'categories' => array('resource' => 'category', 'fields' => array( + 'id' => array('required' => true), + )), + 'images' => array('resource' => 'image','fields' => array('id' => array()) + ), + ), + ); + + public function getCoverWs() + { + $result = $this->getCover($this->id); + return $result['id_image']; + } + + public function getWsImages() + { + //d('a'); + return Db::getInstance()->ExecuteS(' + SELECT `id_image` as id + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($this->id).' + ORDER BY `position`'); + } + + + + public function __construct($id_product = NULL, $full = false, $id_lang = NULL) + { + global $cart; + + parent::__construct($id_product, $id_lang); + if ($full AND $this->id) + { + $this->tax_name = 'deprecated'; // The applicable tax may be BOTH the product one AND the state one (moreover this variable is some deadcode) + $this->manufacturer_name = Manufacturer::getNameById((int)$this->id_manufacturer); + $this->supplier_name = Supplier::getNameById((int)$this->id_supplier); + self::$_tax_rules_group[$this->id] = $this->id_tax_rules_group; + if (is_object($cart) AND $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')} != NULL) + $this->tax_rate = Tax::getProductTaxRate($this->id, $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + else + $this->tax_rate = Tax::getProductTaxRate($this->id, NULL); + $this->new = $this->isNew(); + $this->price = Product::getPriceStatic((int)($this->id), false, NULL, 6, NULL, false, true, 1, false, NULL, NULL, NULL, $this->specificPrice); + $this->unit_price = ($this->unit_price_ratio != 0 ? $this->price / $this->unit_price_ratio : 0); + if ($this->id) + $this->tags = Tag::getProductTags((int)$this->id); + } + + if ($this->id_category_default) + $this->category = Category::getLinkRewrite((int)$this->id_category_default, (int)$id_lang); + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_product'] = (int)($this->id); + $fields['id_tax_rules_group'] = (int)($this->id_tax_rules_group); + $fields['id_manufacturer'] = (int)($this->id_manufacturer); + $fields['id_supplier'] = (int)($this->id_supplier); + $fields['id_category_default'] = (int)($this->id_category_default); + $fields['id_color_default'] = (int)($this->id_color_default); + $fields['quantity'] = (int)($this->quantity); + $fields['minimal_quantity'] = (int)($this->minimal_quantity); + $fields['price'] = (float)($this->price); + $fields['additional_shipping_cost'] = (float)($this->additional_shipping_cost); + $fields['wholesale_price'] = (float)($this->wholesale_price); + $fields['on_sale'] = (int)($this->on_sale); + $fields['online_only'] = (int)($this->online_only); + $fields['ecotax'] = (float)($this->ecotax); + $fields['unity'] = pSQL($this->unity); + $fields['unit_price_ratio'] = (float)($this->unit_price > 0 ? $this->price / $this->unit_price : 0); + $fields['ean13'] = pSQL($this->ean13); + $fields['upc'] = pSQL($this->upc); + $fields['reference'] = pSQL($this->reference); + $fields['supplier_reference'] = pSQL($this->supplier_reference); + $fields['location'] = pSQL($this->location); + $fields['width'] = (float)($this->width); + $fields['height'] = (float)($this->height); + $fields['depth'] = (float)($this->depth); + $fields['weight'] = (float)($this->weight); + $fields['out_of_stock'] = pSQL($this->out_of_stock); + $fields['quantity_discount'] = (int)($this->quantity_discount); + $fields['customizable'] = (int)($this->customizable); + $fields['uploadable_files'] = (int)($this->uploadable_files); + $fields['text_fields'] = (int)($this->text_fields); + $fields['active'] = (int)($this->active); + $fields['available_for_order'] = (int)($this->available_for_order); + $fields['condition'] = pSQL($this->condition); + $fields['show_price'] = (int)($this->show_price); + $fields['indexed'] = 0; // Reset indexation every times + $fields['cache_is_pack'] = (int)($this->cache_is_pack); + $fields['cache_has_attachments'] = (int)($this->cache_has_attachments); + $fields['cache_default_attribute'] = (int)($this->cache_default_attribute); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + self::validateFieldsLang(); + + $fieldsArray = array('meta_description', 'meta_keywords', 'meta_title', 'link_rewrite', 'name', 'available_now', 'available_later'); + $fields = array(); + $languages = Language::getLanguages(false); + $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = $language['id_lang']; + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + $fields[$language['id_lang']]['description'] = (isset($this->description[$language['id_lang']])) ? pSQL($this->description[$language['id_lang']], true) : ''; + $fields[$language['id_lang']]['description_short'] = (isset($this->description_short[$language['id_lang']])) ? pSQL($this->description_short[$language['id_lang']], true) : ''; + foreach ($fieldsArray as $field) + { + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + + /* Check fields validity */ + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]); + elseif (in_array($field, $this->fieldsRequiredLang)) + { + if ($this->{$field} != '') + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); + } + else + $fields[$language['id_lang']][$field] = ''; + } + } + return $fields; + } + + public static function initPricesComputation($id_customer = NULL) + { + global $cookie; + + if ($id_customer) + { + $customer = new Customer((int)($id_customer)); + if (!Validate::isLoadedObject($customer)) + die(Tools::displayError()); + self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)($customer->id_default_group)); + } + elseif ($cookie->id_customer) + { + $customer = new Customer((int)($cookie->id_customer)); + self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)($customer->id_default_group)); + } + else + self::$_taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); + } + + public static function getTaxCalculationMethod($id_customer = NULL) + { + if ($id_customer) + self::initPricesComputation((int)($id_customer)); + return (int)(self::$_taxCalculationMethod); + } + + /** + * Move a product inside its category + * @param boolean $way Up (1) or Down (0) + * @param integer $position + * return boolean Update result + */ + public function updatePosition($way, $position) + { + if (!$res = Db::getInstance()->ExecuteS(' + SELECT cp.`id_product`, cp.`position`, cp.`id_category` + FROM `'._DB_PREFIX_.'category_product` cp + WHERE cp.`id_category` = '.(int)(Tools::getValue('id_category', 1)).' + ORDER BY cp.`position` ASC' + )) + return false; + + foreach ($res AS $product) + if ((int)($product['id_product']) == (int)($this->id)) + $movedProduct = $product; + + if (!isset($movedProduct) || !isset($position)) + return false; + + // < and > statements rather than BETWEEN operator + // since BETWEEN is treated differently according to databases + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'category_product` + SET `position`= `position` '.($way ? '- 1' : '+ 1').' + WHERE `position` + '.($way + ? '> '.(int)($movedProduct['position']).' AND `position` <= '.(int)($position) + : '< '.(int)($movedProduct['position']).' AND `position` >= '.(int)($position)).' + AND `id_category`='.(int)($movedProduct['id_category'])) + AND Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'category_product` + SET `position` = '.(int)($position).' + WHERE `id_product` = '.(int)($movedProduct['id_product']).' + AND `id_category`='.(int)($movedProduct['id_category']))); + } + + /* + * Reorder product position in category $id_category. + * Call it after deleting a product from a category. + * + * @param int $id_category + */ + public static function cleanPositions($id_category) + { + $return = true; + + $result = Db::getInstance()->ExecuteS(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` = '.(int)($id_category).' + ORDER BY `position`'); + $sizeof = sizeof($result); + + for ($i = 0; $i < $sizeof; $i++) + $return &= Db::getInstance()->Execute($sql=' + UPDATE `'._DB_PREFIX_.'category_product` + SET `position` = '.(int)($i).' + WHERE `id_category` = '.(int)($id_category).' + AND `id_product` = '.(int)($result[$i]['id_product'])); + return $return; + } + + /** + * Get the default attribute for a product + * + * @return int Attributes list + */ + public static function getDefaultAttribute($id_product, $minimumQuantity = 0) + { + $sql = 'SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `default_on` = 1 '.((int)($minimumQuantity) > 0 ? 'AND `quantity` >= '.(int)($minimumQuantity).' ' : '').'AND `id_product` = '.(int)($id_product); + $result = Db::getInstance()->getRow($sql); + if (!$result) + $result = Db::getInstance()->getRow(' + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE '.((int)($minimumQuantity) > 0 ? '`quantity` >= '.(int)($minimumQuantity).' AND ' : '').'`id_product` = '.(int)($id_product)); + if (!$result) + $result = Db::getInstance()->getRow(' + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($id_product)); + return $result['id_product_attribute']; + } + + public static function updateDefaultAttribute($id_product) + { + $id_product_attribute = self::getDefaultAttribute($id_product); + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_default_attribute = '.(int)($id_product_attribute).' WHERE id_product = '.(int)($id_product_attribute).' LIMIT 1'); + } + + public function validateFieldsLang($die = true, $errorReturn = false) + { + if (!is_array($this->description_short)) + $this->description_short = array(); + foreach ($this->description_short as $k => $value) + if (Tools::strlen(strip_tags($value)) > 400) + { + if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > 400 for language '.$k.')'); + return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length > 400 for language').' '.$k : false; + } + return parent::validateFieldsLang($die, $errorReturn); + } + + public function delete() + { + Hook::deleteProduct($this); + if (!parent::delete() OR + !$this->deleteCategories(true) OR + !$this->deleteImages() OR + !$this->deleteProductAttributes() OR + !$this->deleteProductFeatures() OR + !$this->deleteTags() OR + !$this->deleteCartProducts() OR + !$this->deleteAttributesImpacts() OR + !$this->deleteAttachments() OR + !$this->deleteCustomization() OR + !SpecificPrice::deleteByProductId((int)($this->id)) OR + !$this->deletePack() OR + !$this->deleteProductSale() OR + !$this->deleteSceneProducts() OR + !$this->deleteSearchIndexes() OR + !$this->deleteAccessories() OR + !$this->deleteFromAccessories()) + return false; + if ($id = ProductDownload::getIdFromIdProduct($this->id)) + if ($productDownload = new ProductDownload($id) AND !$productDownload->delete(true)) + return false; + return true; + } + + public function deleteSelection($products) + { + $return = 1; + foreach ($products AS $id_product) + { + $product = new Product((int)($id_product)); + $return &= $product->delete(); + } + return $return; + } + + /** + * @deprecated + * @param string $reference + */ + public static function getByReference($reference) + { + Tools::displayAsDeprecated(); + if (!Validate::isReference($reference)) + die(Tools::displayError()); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.`reference` = \''.pSQL($reference).'\''); + if (!isset($result['id_product'])) + return false; + + return new self((int)$result['id_product']); + } + + /** + * addToCategories add this product to the category/ies if not exists. + * + * @param mixed $categories id_category or array of id_category + * @return boolean true if succeed + */ + public function addToCategories($categories = array()) + { + if (empty($categories)) + return false; + + if (!is_array($categories)) + $categories=array($categories); + + if (!sizeof($categories)) + return false; + + $currentCategories = $this->getCategories(); + + // for new categ, put product at last position + $resCategNewPos = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql='SELECT id_category, MAX(position)+1 newPos + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` IN('.implode(',', array_map('intval', $categories)).') + GROUP BY id_category'); + foreach ($resCategNewPos as $array) + { + $newCategories[$array['id_category']] = $array['newPos']; + } + + $newCategPos=array(); + foreach ($categories as $id_category) + $newCategPos[$id_category] = isset($newCategories[$id_category])?$newCategories[$id_category]:0; + + $productCats = array(); + + foreach ($categories as $newIdCateg) + if (!in_array($newIdCateg,$currentCategories)) + $productCats[] = '('. $newIdCateg.', '. $this->id.', '. $newCategPos[$newIdCateg].')'; + if (sizeof($productCats)) + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'category_product` (`id_category`, `id_product`, `position`) + VALUES '.implode(',', $productCats)); + + return true; + } + + /** + * Update categories to index product into + * + * @param string $productCategories Categories list to index product into + * @param boolean keepingCurrentPos (deprecated, no more used) + * @return array Update/insertion result + */ + public function updateCategories($categories, $keepingCurrentPos = false) + { + if (empty($categories)) + return false; + $positions = array(); + // get max position in each categories + $result = Db::getInstance()->ExecuteS('SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_category` NOT IN('.implode(',', array_map('intval', $categories)).') + AND id_product = '. $this->id .''); + foreach ($result as $categToDelete){ + $this->deleteCategory($categToDelete['id_category']); + } + // if none are found, it's an error + if (!is_array($result)) + return (false); + + if (!$this->addToCategories($categories)) + return false; + + return true; + } + + /** + * deleteCategory delete this product from the category $id_category + * + * @param mixed $id_category + * @param mixed $cleanPositions + * @return boolean + */ + public function deleteCategory($id_category, $cleanPositions = true) + { + $result = Db::getInstance()->ExecuteS('SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)($this->id) . ' AND id_category = '.(int)$id_category .''); + $return = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)($this->id).' AND id_category = '.(int)$id_category .'' ); + if ($cleanPositions === true) + foreach ($result AS $row) + $this->cleanPositions((int)$row['id_category']); + return $return; + } + + /** + * Delete all association to category where product is indexed + * + * @param boolean $cleanPositions clean category positions after deletion + * @return array Deletion result + */ + public function deleteCategories($cleanPositions = false) + { + $return = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)($this->id)); + if ($cleanPositions === true) + { + $result = Db::getInstance()->ExecuteS('SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)($this->id)); + foreach($result AS $row) + $this->cleanPositions((int)($row['id_category'])); + } + return $return; + } + + /** + * Delete products tags entries + * + * @return array Deletion result + */ + public function deleteTags() + { + return (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_tag` WHERE `id_product` = '.(int)($this->id)) + AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'tag` WHERE `id_tag` NOT IN (SELECT `id_tag` FROM `'._DB_PREFIX_.'product_tag`)')); + } + + /** + * Delete product from cart + * + * @return array Deletion result + */ + public function deleteCartProducts() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_product` WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Delete product images from database + * + * @return array Deletion result + */ + public function deleteImages() + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($this->id)); + foreach($result as $row) + if (!deleteImage((int)($this->id), $row['id_image']) OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'image_lang` WHERE `id_image` = '.(int)($row['id_image']))) + return false; + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'image` WHERE `id_product` = '.(int)($this->id)); + } + + public static function getProductAttributePrice($id_product_attribute) + { + $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `price` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + return $rq['price']; + } + + /** + * Get all available products + * + * @param integer $id_lang Language id + * @param integer $start Start number + * @param integer $limit Number of products to return + * @param string $orderBy Field for ordering + * @param string $orderWay Way for ordering (ASC or DESC) + * @return array Products details + */ + public static function getProducts($id_lang, $start, $limit, $orderBy, $orderWay, $id_category = false, $only_active = false) + { + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die (Tools::displayError()); + if ($orderBy == 'id_product' OR $orderBy == 'price' OR $orderBy == 'date_add') + $orderByPrefix = 'p'; + elseif ($orderBy == 'name') + $orderByPrefix = 'pl'; + elseif ($orderBy == 'position') + $orderByPrefix = 'c'; + + $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, pl.* , t.`rate` AS tax_rate, m.`name` AS manufacturer_name, s.`name` AS supplier_name + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) + LEFT JOIN `'._DB_PREFIX_.'supplier` s ON (s.`id_supplier` = p.`id_supplier`)'. + ($id_category ? 'LEFT JOIN `'._DB_PREFIX_.'category_product` c ON (c.`id_product` = p.`id_product`)' : '').' + WHERE pl.`id_lang` = '.(int)($id_lang). + ($id_category ? ' AND c.`id_category` = '.(int)($id_category) : ''). + ($only_active ? ' AND p.`active` = 1' : '').' + ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay). + ($limit > 0 ? ' LIMIT '.(int)($start).','.(int)($limit) : '') + ); + if($orderBy == 'price') + Tools::orderbyPrice($rq,$orderWay); + return ($rq); + } + + public static function getSimpleProducts($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.`id_product`, pl.`name` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) + WHERE pl.`id_lang` = '.(int)($id_lang).' + ORDER BY pl.`name`'); + } + + /** + * Return the products in the same category than the default category of the instancied product + * + * @param integer $id_lang Language ID + * @return array Products + * @deprecated + */ + public function getDefaultCategoryProducts($idLang = NULL, $limit = NULL) + { + Tools::displayAsDeprecated(); + //get idLang + $idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.`id_product`, pl.`description_short`set, pl.`link_rewrite`, pl.`name`, i.`id_image` + FROM `'._DB_PREFIX_.'category_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = cp.id_product) + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) + WHERE cp.id_category = ' . (int)($this->id_category_default) . ' + AND id_lang = ' . (int)($idLang) . ' + AND p.`active` = 1 + AND i.`cover` = 1 + '. (is_null($limit) ? '' : ' LIMIT 0 , ' . (int)($limit))); + return $result; + } + + public function isNew() + { + $result = Db::getInstance()->ExecuteS(' + SELECT id_product FROM `'._DB_PREFIX_.'product` p + WHERE 1 + AND id_product = '.(int)($this->id).' + AND DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 + '); + return sizeof($result) > 0; + } + + + public function productAttributeExists($attributesList, $currentProductAttribute = false) + { + $result = Db::getInstance()->ExecuteS('SELECT pac.`id_attribute`, pac.`id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` pa + LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`) + WHERE pa.`id_product` = '.(int)($this->id)); + /* If something's wrong */ + if (!$result OR empty($result)) + return false; + /* Product attributes simulation */ + $productAttributes = array(); + foreach ($result AS $productAttribute) + $productAttributes[$productAttribute['id_product_attribute']][] = $productAttribute['id_attribute']; + /* Checking product's attribute existence */ + foreach ($productAttributes AS $key => $productAttribute) + if (sizeof($productAttribute) == sizeof($attributesList)) + { + $diff = false; + for ($i = 0; $diff == false AND isset($productAttribute[$i]); $i++) + if (!in_array($productAttribute[$i], $attributesList) OR $key == $currentProductAttribute) + $diff = true; + if (!$diff) + return true; + } + return false; + } + + /** + * Add a product attribute + * + * @param float $price Additional price + * @param float $weight Additional weight + * @param float $ecotax Additional ecotax + * @param integer $quantity Quantity available + * @param integer $id_images Image ids + * @param string $reference Reference + * @param string $supplier_reference Supplier Reference + * @param string $location Location + * @param string $ean13 Ean-13 barcode + * @param boolean $default Is default attribute for product + * @return mixed $id_product_attribute or false + */ + public function addProductAttribute($price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference, $supplier_reference, $ean13, $default, $location = NULL, $upc = NULL) + { + $price = str_replace(',', '.', $price); + $weight = str_replace(',', '.', $weight); + Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', + array('id_product' => (int)($this->id), 'price' => (float)($price), 'ecotax' => (float)($ecotax), 'quantity' => (int)($quantity), + 'weight' => ($weight ? (float)($weight) : 0), 'unit_price_impact' => ($unit_impact ? (float)($unit_impact) : 0), + 'reference' => pSQL($reference), 'supplier_reference' => pSQL($supplier_reference), + 'location' => pSQL($location), 'ean13' => pSQL($ean13), 'upc' => pSQL($upc), 'default_on' => (int)($default)), + 'INSERT'); + $id_product_attribute = Db::getInstance()->Insert_ID(); + Product::updateDefaultAttribute($this->id); + if (!$id_product_attribute) + return false; + if (empty($id_images)) + return (int)($id_product_attribute); + $query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES '; + foreach ($id_images AS $id_image) + $query .= '('.(int)($id_product_attribute).', '.(int)($id_image).'), '; + $query = trim($query, ', '); + if (!Db::getInstance()->Execute($query)) + return false; + return (int)($id_product_attribute); + } + + public function addCombinationEntity($wholesale_price, $price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference, $supplier_reference, $ean13, $default, $location = NULL, $upc = NULL) + { + if ( + !$id_product_attribute = $this->addProductAttribute($price, $weight, $unit_impact, $ecotax, $quantity, $id_images, $reference, $supplier_reference, $ean13, $default, $location, $upc) + OR !Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product_attribute` SET `wholesale_price` = '.(float)($wholesale_price).' WHERE `id_product_attribute` = '.(int)($id_product_attribute)) + ) + return false; + return (int)($id_product_attribute); + } + + public function addProductAttributeMultiple($attributes, $setDefault = true) + { + $values = array(); + $keys = array(); + $fields = array(); + $default_value = 1; + foreach ($attributes AS &$attribute) + foreach ($attribute AS $key => $value) + if ($value != "") + $fields[$key] = $key; + + foreach ($attributes AS &$attribute) + { + $k = array(); + $v = array(); + foreach ($attribute AS $key => $value) + { + if (in_array($key, $fields)) + { + $k[] = '`'.$key.'`'; + $v[] = '\''.$value.'\''; + } + } + if ($setDefault) + { + $k[] = '`default_on`'; + $v[] = '\''.$default_value.'\''; + $default_value = 0; + } + $values[] = '(' . implode(', ', $v).')'; + $keys[] = implode(', ', $k); + } + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_attribute` ('. $keys[0].') VALUES '.implode(', ', $values)); + + return (array_map(create_function('$elem', 'return $elem[\'id_product_attribute\'];'), + Db::getInstance()->ExecuteS(' + SELECT `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` >= '.(int)(Db::getInstance()->Insert_ID()) + ))); + } + + /** + * Del all default attributes for product + */ + public function deleteDefaultAttributes() + { + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `default_on` = 0 + WHERE `id_product` = '.(int)($this->id)); + } + + public function setDefaultAttribute($id_product_attribute) + { + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `default_on` = 1 + WHERE `id_product` = '.(int)($this->id).' + AND `id_product_attribute` = '.(int)($id_product_attribute)); + } + + /** + * Update a product attribute + * + * @param integer $id_product_attribute Product attribute id + * @param float $price Additional price + * @param float $weight Additional weight + * @param float $ecotax Additional ecotax + * @param integer $quantity Quantity available + * @param integer $id_image Image id + * @param string $reference Reference + * @param string $ean13 Ean-13 barcode + * @param string $upc Upc barcode + * @param string $minimal_quantity Minimal quantity + * @return array Update result + */ + public function updateProductAttribute($id_product_attribute, $wholesale_price, $price, $weight, $unit, $ecotax, $quantity, $id_images, $reference, $supplier_reference, $ean13, $default, $location = NULL, $upc = NULL, $minimal_quantity) + { + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + + $price = str_replace(',', '.', $price); + $weight = str_replace(',', '.', $weight); + $data = array( + 'wholesale_price' => (float)($wholesale_price), + 'price' => (float)($price), + 'ecotax' => (float)($ecotax), + 'weight' => ($weight ? (float)($weight) : 0), + 'unit_price_impact' => ($unit ? (float)($unit) : 0), + 'reference' => pSQL($reference), + 'supplier_reference' => pSQL($supplier_reference), + 'location' => pSQL($location), + 'ean13' => pSQL($ean13), + 'upc' => pSQL($upc), + 'default_on' => (int)($default), + 'minimal_quantity' => (int)($minimal_quantity)); + if ($quantity) + $data['quantity'] = (int)$quantity; + if (!Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', $data, 'UPDATE', '`id_product_attribute` = '.(int)($id_product_attribute)) OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute_image` WHERE `id_product_attribute` = '.(int)($id_product_attribute))) + return false; + if ($quantity) + Hook::updateProductAttribute($id_product_attribute); + Product::updateDefaultAttribute($this->id); + if (empty($id_images)) + return true; + $query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES '; + foreach ($id_images AS $id_image) + $query .= '('.(int)($id_product_attribute).', '.(int)($id_image).'), '; + $query = trim($query, ', '); + return Db::getInstance()->Execute($query); + } + + public function updateQuantityProductWithAttributeQuantity() + { + return Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product` + SET `quantity` = IFNULL( + ( + SELECT SUM(`quantity`) + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($this->id).' + ), \'0\' ) + WHERE `id_product` = '.(int)($this->id)); + } + /** + * Delete product attributes + * + * @return array Deletion result + */ + public function deleteProductAttributes() + { + Module::hookExec('deleteProductAttribute', array('id_product_attribute' => 0, 'id_product' => $this->id, 'deleteAllAttributes' => true)); + + $result = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` IN (SELECT `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product` = '.(int)($this->id).')'); + + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product` = '.(int)($this->id)); + + return ($result & $result2); + } + + /** + * Delete product attributes impacts + * + * @return Deletion result + */ + public function deleteAttributesImpacts() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'attribute_impact` WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Delete product features + * + * @return array Deletion result + */ + public function deleteProductFeatures() + { + return $this->deleteFeatures(); + } + + /** + * Delete product attachments + * + * @return array Deletion result + */ + public function deleteAttachments() + { + $attachments = Db::getInstance()->ExecuteS('SELECT id_attachment FROM `'._DB_PREFIX_.'product_attachment` WHERE `id_product` = '.(int)($this->id)); + $result = true; + foreach ($attachments AS $attachment) + { + $attachmentObj = new Attachment((int)($attachment['id_attachment'])); + if (Validate::isLoadedObject($attachmentObj)) + $result &= $attachmentObj->delete(); + } + + return $result; + } + + /** + * Delete product customizations + * + * @return array Deletion result + */ + public function deleteCustomization() + { + return + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id)) && + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field_lang` WHERE `id_customization_field` NOT IN (SELECT id_customization_field FROM `'._DB_PREFIX_.'customization_field`)'); + } + + /** + * Delete product quantity discounts + * + * @return array Deletion result + * @deprecated + */ + public function deleteQuantityDiscounts() + { + Tools::displayAsDeprecated(); + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'discount_quantity` WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Delete product pack details + * + * @return array Deletion result + */ + public function deletePack() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'pack` WHERE `id_product_pack` = '.(int)($this->id).' OR `id_product_item` = '.(int)($this->id)); + } + + /** + * Delete product sales + * + * @return array Deletion result + */ + public function deleteProductSale() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_sale` WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Delete product in its scenes + * + * @return array Deletion result + */ + public function deleteSceneProducts() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'scene_products` WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Delete product indexed words + * + * @return array Deletion result + */ + public function deleteSearchIndexes() + { + return + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'search_index` WHERE `id_product` = '.(int)($this->id)) && + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'search_word` WHERE `id_word` NOT IN (SELECT id_word FROM `'._DB_PREFIX_.'search_index`)'); + } + + /** + * Add a product attributes combinaison + * + * @param integer $id_product_attribute Product attribute id + * @param array $attributes Attributes to forge combinaison + * @return array Insertion result + */ + public function addAttributeCombinaison($id_product_attribute, $attributes) + { + if (!is_array($attributes)) + die(Tools::displayError()); + if (!sizeof($attributes)) + return false; + $attributesList = ''; + foreach($attributes AS $id_attribute) + $attributesList .= '('.(int)($id_product_attribute).','.(int)($id_attribute).'),'; + $attributesList = rtrim($attributesList, ','); + + if (!Validate::isValuesList($attributesList)) + die(Tools::displayError()); + + $result = Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_product_attribute`, `id_attribute`) VALUES '.$attributesList); + return $result; + } + + public function addAttributeCombinationMultiple($id_attributes, $combinations) + { + $attributesList = ''; + foreach ($id_attributes AS $nb => $id_product_attribute) + if (isset($combinations[$nb])) + foreach ($combinations[$nb] AS $id_attribute) + $attributesList .= '('.(int)($id_product_attribute).','.(int)($id_attribute).'),'; + $attributesList = rtrim($attributesList, ','); + return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_product_attribute`, `id_attribute`) VALUES '.$attributesList); + } + + /** + * Delete a product attributes combinaison + * + * @param integer $id_product_attribute Product attribute id + * @return array Deletion result + */ + public function deleteAttributeCombinaison($id_product_attribute) + { + if (!$id_product_attribute OR !is_numeric($id_product_attribute)) + return false; + + Module::hookExec('deleteProductAttribute', array('id_product_attribute' => $id_product_attribute, 'id_product' => $this->id, 'deleteAllAttributes' => false)); + + $result = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product_attribute` = '.(int)($id_product_attribute).' + AND `id_product` = '.(int)($this->id)); + $result2 = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + $result3 = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + return ($result AND $result2 AND $result3); + } + + /** + * Delete features + * + */ + public function deleteFeatures() + { + // List products features + $result1 = Db::getInstance()->ExecuteS(' + SELECT p.*, f.* + FROM `'._DB_PREFIX_.'feature_product` as p + LEFT JOIN `'._DB_PREFIX_.'feature_value` as f ON (f.`id_feature_value` = p.`id_feature_value`) + WHERE `id_product` = '.(int)($this->id)); + foreach ($result1 as $tab) + // Delete product custom features + if ($tab['custom']) { + $result2 = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'feature_value` + WHERE `id_feature_value` = '.(int)($tab['id_feature_value'])); + $result3 = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'feature_value_lang` + WHERE `id_feature_value` = '.(int)($tab['id_feature_value'])); + } + // Delete product features + $result4 = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'feature_product` + WHERE `id_product` = '.(int)($this->id)); + return ($result4); + } + + /** + * Get all available product attributes combinaisons + * + * @param integer $id_lang Language id + * @return array Product attributes combinaisons + */ + public function getAttributeCombinaisons($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT pa.*, ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, al.`name` AS attribute_name, a.`id_attribute`, pa.`unit_price_impact` + FROM `'._DB_PREFIX_.'product_attribute` pa + LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)($id_lang).') + WHERE pa.`id_product` = '.(int)($this->id).' + ORDER BY pa.`id_product_attribute`'); + } + + public function getCombinationImages($id_lang) + { + if (!$productAttributes = Db::getInstance()->ExecuteS('SELECT `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product` = '.(int)($this->id))) + return false; + $ids = array(); + foreach ($productAttributes AS $productAttribute) + $ids[] = (int)($productAttribute['id_product_attribute']); + if (!$result = Db::getInstance()->ExecuteS(' + SELECT pai.`id_image`, pai.`id_product_attribute`, il.`legend` + FROM `'._DB_PREFIX_.'product_attribute_image` pai + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (il.`id_image` = pai.`id_image`) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_image` = pai.`id_image`) + WHERE pai.`id_product_attribute` IN ('.implode(', ', $ids).') AND il.`id_lang` = '.(int)($id_lang).' ORDER by i.`position`')) + return false; + $images = array(); + foreach ($result AS $row) + $images[$row['id_product_attribute']][] = $row; + return $images; + } + + /** + * Check if product has attributes combinaisons + * + * @return integer Attributes combinaisons number + */ + public function hasAttributes() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(`id_product_attribute`) + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($this->id)); + } + + /** + * Get new products + * + * @param integer $id_lang Language id + * @param integer $pageNumber Start from (optional) + * @param integer $nbProducts Number of products to return (optional) + * @return array New products + */ + public static function getNewProducts($id_lang, $pageNumber = 0, $nbProducts = 10, $count = false, $orderBy = NULL, $orderWay = NULL) + { + if ($pageNumber < 0) $pageNumber = 0; + if ($nbProducts < 1) $nbProducts = 10; + if (empty($orderBy) || $orderBy == 'position') $orderBy = 'date_add'; + if (empty($orderWay)) $orderWay = 'DESC'; + if ($orderBy == 'id_product' OR $orderBy == 'price' OR $orderBy == 'date_add') + $orderByPrefix = 'p'; + elseif ($orderBy == 'name') + $orderByPrefix = 'pl'; + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die(Tools::displayError()); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + if ($count) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_product`) AS nb + FROM `'._DB_PREFIX_.'product` p + WHERE `active` = 1 + AND DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + )'); + return (int)($result['nb']); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, p.`ean13`, p.`upc`, + i.`id_image`, il.`legend`, t.`rate`, m.`name` AS manufacturer_name, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new, + (p.`price` * ((100 + (t.`rate`))/100)) AS orderprice, pa.id_product_attribute + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT OUTER JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND `default_on` = 1) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) + WHERE p.`active` = 1 + AND DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(int)($pageNumber * $nbProducts).', '.(int)($nbProducts)); + + if ($orderBy == 'price') + Tools::orderbyPrice($result, $orderWay); + if (!$result) + return false; + + $productsIds = array(); + foreach ($result as $row) + $productsIds[] = $row['id_product']; + // Thus you can avoid one query per product, because there will be only one query for all the products of the cart + Product::cacheFrontFeatures($productsIds, $id_lang); + + return Product::getProductsProperties((int)$id_lang, $result); + } + + static protected function _getProductIdByDate($beginning, $ending) + { + global $cookie, $cart; + + $id_group = $cookie->id_customer ? (int)(Customer::getDefaultGroupId((int)($cookie->id_customer))) : _PS_DEFAULT_CUSTOMER_GROUP_; + $id_address = $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; + $ids = Address::getCountryAndState($id_address); + $id_country = (int)($ids['id_country'] ? $ids['id_country'] : Configuration::get('PS_COUNTRY_DEFAULT')); + return SpecificPrice::getProductIdByDate((int)(Shop::getCurrentShop()), (int)($cookie->id_currency), $id_country, $id_group, $beginning, $ending); + } + + /** + * Get a random special + * + * @param integer $id_lang Language id + * @return array Special + */ + public static function getRandomSpecial($id_lang, $beginning = false, $ending = false) + { + $currentDate = date('Y-m-d H:i:s'); + $ids_product = self::_getProductIdByDate((!$beginning ? $currentDate : $beginning), (!$ending ? $currentDate : $ending)); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + // Please keep 2 distinct queries because RAND() is an awful way to achieve this result + $sql = ' + SELECT p.id_product + FROM `'._DB_PREFIX_.'product` p + WHERE 1 + AND p.`active` = 1 + AND p.`id_product` IN ('.implode(', ', $ids_product).') + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY RAND()'; + $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); + + if (!$id_product) + return false; + + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, p.`ean13`, p.`upc`, + i.`id_image`, il.`legend`, t.`rate` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + WHERE p.id_product = '.(int)$id_product); + + return Product::getProductProperties($id_lang, $row); + } + + /** + * Get prices drop + * + * @param integer $id_lang Language id + * @param integer $pageNumber Start from (optional) + * @param integer $nbProducts Number of products to return (optional) + * @param boolean $count Only in order to get total number (optional) + * @return array Prices drop + */ + public static function getPricesDrop($id_lang, $pageNumber = 0, $nbProducts = 10, $count = false, $orderBy = NULL, $orderWay = NULL, $beginning = false, $ending = false) + { + if (!Validate::isBool($count)) + die(Tools::displayError()); + + if ($pageNumber < 0) $pageNumber = 0; + if ($nbProducts < 1) $nbProducts = 10; + if (empty($orderBy) || $orderBy == 'position') $orderBy = 'price'; + if (empty($orderWay)) $orderWay = 'DESC'; + if ($orderBy == 'id_product' OR $orderBy == 'price' OR $orderBy == 'date_add') + $orderByPrefix = 'p'; + elseif ($orderBy == 'name') + $orderByPrefix = 'pl'; + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die (Tools::displayError()); + $currentDate = date('Y-m-d H:i:s'); + $ids_product = self::_getProductIdByDate((!$beginning ? $currentDate : $beginning), (!$ending ? $currentDate : $ending)); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + if ($count) + { + $sql = ' + SELECT COUNT(DISTINCT p.`id_product`) AS nb + FROM `'._DB_PREFIX_.'product` p + WHERE p.`active` = 1 + AND p.`show_price` = 1 + '.((!$beginning AND !$ending) ? ' AND p.`id_product` IN('.((is_array($ids_product) AND sizeof($ids_product)) ? implode(', ', $ids_product) : 0).')' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + )'; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); + return (int)($result['nb']); + } + $sql = ' + SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, + pl.`name`, p.`ean13`, p.`upc`, i.`id_image`, il.`legend`, t.`rate`, m.`name` AS manufacturer_name, + DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) + WHERE 1 + AND p.`active` = 1 + AND p.`show_price` = 1 + '.((!$beginning AND !$ending) ? ' AND p.`id_product` IN ('.((is_array($ids_product) AND sizeof($ids_product)) ? implode(', ', $ids_product) : 0).')' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY '.(isset($orderByPrefix) ? pSQL($orderByPrefix).'.' : '').'`'.pSQL($orderBy).'`'.' '.pSQL($orderWay).' + LIMIT '.(int)($pageNumber * $nbProducts).', '.(int)($nbProducts); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + if($orderBy == 'price') + Tools::orderbyPrice($result,$orderWay); + if (!$result) + return false; + return Product::getProductsProperties($id_lang, $result); + } + + + /** + * getProductCategories return an array of categories which this product belongs to + * + * @return array of categories + */ + public static function getProductCategories($id_product = '') + { + $ret = array(); + if ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int)$id_product) + ) + foreach ($row as $val) + { + $ret[] = $val['id_category']; + } + return $ret; + } + + /** + * getCategories return an array of categories which this product belongs to + * + * @return array of categories + */ + public function getCategories() + { + return Product::getProductCategories($this->id); + } + + /** + * Get categories where product is indexed + * + * @param integer $id_product Product id + * @return array Categories where product is indexed + * @deprecated + */ + public static function getIndexedCategories($id_product) + { + Tools::displayAsDeprecated(); + return Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'category_product` + WHERE `id_product` = '.(int)($id_product)); + } + + /** + * Get product images and legends + * + * @param integer $id_lang Language id for multilingual legends + * @return array Product images and legends + */ + public function getImages($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT i.`cover`, i.`id_image`, il.`legend` + FROM `'._DB_PREFIX_.'image` i + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + WHERE i.`id_product` = '.(int)($this->id).' + ORDER BY `position`'); + } + + /** + * Get product cover image + * + * @return array Product cover image + */ + public static function getCover($id_product) + { + return Db::getInstance()->getRow(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'image` + WHERE `id_product` = '.(int)($id_product).' + AND `cover` = 1'); + } + + /** + * Get reduction value for a given product + * ***************************************** + * ** Kept for retro-compatibility issues ** + * ***************************************** + * You should use getPriceStatic() instead (with the parameter $only_reduc set to true) + * + * @param array $result SQL result with reduction informations + * @param boolean $wt With taxes or not (optional) + * @return float Reduction value in euros + */ + /* */ + public static function getReductionValue($reduction_price, $reduction_percent, $date_from, $date_to, $product_price, $usetax, $taxrate) + { + Tools::displayAsDeprecated(); + + // Avoid an error with 1970-01-01 + if (!Validate::isDate($date_from) OR !Validate::isDate($date_to)) + return 0; + $currentDate = date('Y-m-d H:i:s'); + if ($date_from != $date_to AND ($currentDate > $date_to OR $currentDate < $date_from)) + return 0; + + // reduction values + if (!$usetax) + $reduction_price /= (1 + ($taxrate / 100)); + + // make the reduction + if ($reduction_price AND $reduction_price > 0) + { + if ($reduction_price >= $product_price) + $ret = $product_price; + else + $ret = $reduction_price; + } + elseif ($reduction_percent AND $reduction_percent > 0) + { + if ($reduction_percent >= 100) + $ret = $product_price; + else + $ret = $product_price * $reduction_percent / 100; + } + return isset($ret) ? $ret : 0; + } + + /** + * Get product price + * + * @param integer $id_product Product id + * @param boolean $usetax With taxes or not (optional) + * @param integer $id_product_attribute Product attribute id (optional). If set to false, do not apply the combination price impact. NULL does apply the default combination price impact. + * @param integer $decimals Number of decimals (optional) + * @param integer $divisor Useful when paying many time without fees (optional) + * @param boolean $only_reduc Returns only the reduction amount + * @param boolean $usereduc Set if the returned amount will include reduction + * @param integer $quantity Required for quantity discount application (default value: 1) + * @param boolean $forceAssociatedTax Force to apply the associated tax. Only works when the parameter $usetax is true + * @param integer $id_customer Customer ID (for customer group reduction) + * @param integer $id_cart Cart ID. Required when the cookie is not accessible (e.g., inside a payment module, a cron task...) + * @param integer $id_address Customer address ID. Required for price (tax included) calculation regarding the guest localization + * @param variable_reference $specificPriceOutput. If a specific price applies regarding the previous parameters, this variable is filled with the corresponding SpecificPrice object + * @param boolean $with_ecotax insert ecotax in price output. + * @return float Product price + */ + public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, + $usereduc = true, $quantity = 1, $forceAssociatedTax = false, $id_customer = NULL, $id_cart = NULL, $id_address = NULL, &$specificPriceOutput = NULL, $with_ecotax = TRUE) + { + global $cookie, $cart; + $cur_cart = $cart; + + if (isset($divisor)) + Tools::displayParameterAsDeprecated('divisor'); + + if (!Validate::isBool($usetax) OR !Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + // Initializations + if (!$id_customer) + $id_customer = ((Validate::isCookie($cookie) AND isset($cookie->id_customer) AND $cookie->id_customer) ? (int)($cookie->id_customer) : NULL); + $id_group = $id_customer ? (int)(Customer::getDefaultGroupId($id_customer)) : _PS_DEFAULT_CUSTOMER_GROUP_; + if (!is_object($cur_cart) OR (Validate::isUnsignedInt($id_cart) AND $id_cart)) + { + /* + * When a user (e.g., guest, customer, Google...) is on PrestaShop, he has already its cart as the global (see /init.php) + * When a non-user calls directly this method (e.g., payment module...) is on PrestaShop, he does not have already it BUT knows the cart ID + */ + if (!$id_cart AND !Validate::isCookie($cookie)) + die(Tools::displayError()); + $cur_cart = $id_cart ? new Cart((int)($id_cart)) : new Cart((int)($cookie->id_cart)); + } + + if ((int)($id_cart)) + { + if (!isset(self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]) OR self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] != (int)($quantity)) + self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT SUM(`quantity`) + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_product` = '.(int)($id_product).' AND `id_cart` = '.(int)($id_cart) + ); + $cart_quantity = self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]; + } + $quantity = ($id_cart AND $cart_quantity) ? $cart_quantity : $quantity; + $id_currency = (int)(Validate::isLoadedObject($cur_cart) ? $cur_cart->id_currency : ((isset($cookie->id_currency) AND (int)($cookie->id_currency)) ? $cookie->id_currency : Configuration::get('PS_CURRENCY_DEFAULT'))); + if (!$id_address) + $id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; + + if (Tax::excludeTaxeOption()) + $usetax = false; + + $id_country = (int)Country::getDefaultCountryId(); + $id_state = 0; + $id_county = 0; + $id_state = 0; + + + $address_infos = Address::getCountryAndState($id_address); + if ($address_infos['id_country']) + { + $id_country = (int)($address_infos['id_country']); + $id_state = (int)($address_infos['id_state']); + $id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']); + + } + + if ($usetax != false AND !empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) + $usetax = false; + + $id_shop = (int)(Shop::getCurrentShop()); + + return Product::priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $id_county, $id_currency, $id_group, $quantity, $usetax, $decimals, $only_reduc, + $usereduc, $with_ecotax, $specificPriceOutput); + } + + /** + * Price calculation / Get product price + * + * @param integer $id_shop Shop id + * @param integer $id_product Product id + * @param integer $id_product_attribute Product attribute id + * @param integer $id_country Country id + * @param integer $id_state State id + * @param integer $id_currency Currency id + * @param integer $id_group Group id + * @param integer $quantity Quantity Required for Specific prices : quantity discount application + * @param boolean $use_tax with (1) or without (0) tax + * @param integer $decimals Number of decimals returned + * @param boolean $only_reduc Returns only the reduction amount + * @param boolean $use_reduc Set if the returned amount will include reduction + * @param boolean $with_ecotax insert ecotax in price output. + * @param variable_reference $specific_price_output If a specific price applies regarding the previous parameters, this variable is filled with the corresponding SpecificPrice object + * @return float Product price + **/ + public static function priceCalculation($id_shop, $id_product, $id_product_attribute, $id_country, $id_state, $id_county, $id_currency, $id_group, $quantity, $use_tax, $decimals, $only_reduc, $use_reduc, $with_ecotax, &$specific_price_output) + { + // Caching + if ($id_product_attribute === NULL) + $product_attribute_label = 'NULL'; + else + $product_attribute_label = ($id_product_attribute === false ? 'false' : $id_product_attribute); + $cacheId = $id_product.'-'.$id_shop.'-'.$id_currency.'-'.$id_country.'-'.$id_group.'-'.$quantity.'-'.$product_attribute_label.'-'.($use_tax?'1':'0').'-'.$decimals.'-'.($only_reduc?'1':'0').'-'.($use_reduc?'1':'0'); + + if (isset(self::$_prices[$cacheId])) + return self::$_prices[$cacheId]; + + // fetch price & attribute price + $cacheId2 = $id_product.'-'.$id_product_attribute; + if (!isset(self::$_pricesLevel2[$cacheId2])) + self::$_pricesLevel2[$cacheId2] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT p.`price`, p.`ecotax`, + '.($id_product_attribute ? 'pa.`price`' : 'IFNULL((SELECT pa.price FROM `'._DB_PREFIX_.'product_attribute` pa WHERE id_product = '.(int)($id_product).' AND default_on = 1), 0)').' AS attribute_price + FROM `'._DB_PREFIX_.'product` p + '.($id_product_attribute ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.`id_product_attribute` = '.(int)($id_product_attribute) : '').' + WHERE p.`id_product` = '.(int)($id_product)); + $result = self::$_pricesLevel2[$cacheId2]; + + + // Cache for specific prices + $cacheId3 = $id_product.'-'.$id_shop.'-'.$id_currency.'-'.$id_country.'-'.$id_group.'-'.$quantity; + + if (!isset(self::$_pricesLevel3[$cacheId3])) + self::$_pricesLevel3[$cacheId3] = SpecificPrice::getSpecificPrice((int)($id_product), $id_shop, $id_currency, $id_country, $id_group, $quantity); + $specific_price = self::$_pricesLevel3[$cacheId3]; + + $price = (float)(!$specific_price OR $specific_price['price'] == 0) ? $result['price'] : $specific_price['price']; + // convert only if the specific price is in the default currency (id_currency = 0) + if (!$specific_price OR !($specific_price['price'] > 0 AND $specific_price['id_currency'])) + $price = Tools::convertPrice($price, $id_currency); + + // Parameter passed by ref + $specific_price_output = $specific_price; + // Attribute price + $attribute_price = Tools::convertPrice(array_key_exists('attribute_price', $result) ? (float)($result['attribute_price']) : 0, $id_currency); + if ($id_product_attribute !== false) // If you want the default combination, please use NULL value instead + $price += $attribute_price; + + // TaxRate calculation + $tax_rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county); + if ($tax_rate === false) + $tax_rate = 0; + // Add Tax + if ($use_tax) + $price = $price * (1 + ($tax_rate / 100)); + $price = Tools::ps_round($price, $decimals); + + // Reduction + $reduc = 0; + if (($only_reduc OR $use_reduc) AND $specific_price) + { + if ($specific_price['reduction_type'] == 'amount') + { + $reduction_amount = $specific_price['reduction']; + + if (!$specific_price['id_currency']) + $reduction_amount = Tools::convertPrice($reduction_amount, $id_currency); + $reduc = Tools::ps_round(!$use_tax ? $reduction_amount / (1 + $tax_rate / 100) : $reduction_amount, $decimals); + } + else + $reduc = Tools::ps_round($price * $specific_price['reduction'], $decimals); + } + + if ($only_reduc) + return $reduc; + + if ($use_reduc) + $price -= $reduc; + + // Group reduction + if ($reductionFromCategory = (float)(GroupReduction::getValueForProduct($id_product, $id_group))) + $price -= $price * $reductionFromCategory; + else // apply group reduction if there is no group reduction for this category + $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100); + + $price = Tools::ps_round($price, $decimals); + + // Eco Tax + if ($result['ecotax'] AND $with_ecotax) + { + $ecotax = $result['ecotax']; + if ($id_currency) + $ecotax = Tools::convertPrice($ecotax, $id_currency); + if ($use_tax) + { + $taxRate = TaxRulesGroup::getTaxesRate((int)Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'), (int)$id_country, (int)$id_state, (int)$id_county); + $price += $ecotax * (1 + ($taxRate / 100)); + } + else + $price += $ecotax; + } + + $price = Tools::ps_round($price, $decimals); + + if ($price < 0) + $price = 0; + + self::$_prices[$cacheId] = $price; + return self::$_prices[$cacheId]; + } + + public static function convertAndFormatPrice($price, $currency = false) + { + if (!$currency) + $currency = Currency::getCurrent(); + return Tools::displayPrice(Tools::convertPrice($price, $currency), $currency); + } + + public static function isDiscounted($id_product, $quantity = 1) + { + global $cookie, $cart; + + $id_customer = ((Validate::isCookie($cookie) AND isset($cookie->id_customer) AND $cookie->id_customer) ? (int)($cookie->id_customer) : NULL); + $id_group = $id_customer ? (int)(Customer::getDefaultGroupId($id_customer)) : _PS_DEFAULT_CUSTOMER_GROUP_; + $cart_quantity = !$cart ? 0 : Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT SUM(`quantity`) + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_product` = '.(int)($id_product).' AND `id_cart` = '.(int)($cart->id) + ); + $quantity = $cart_quantity ? $cart_quantity : $quantity; + $id_currency = (int)(Validate::isLoadedObject($cart) ? $cart->id_currency : ((isset($cookie->id_currency) AND (int)($cookie->id_currency)) ? $cookie->id_currency : Configuration::get('PS_CURRENCY_DEFAULT'))); + $ids = Address::getCountryAndState((int)($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + $id_country = (int)($ids['id_country'] ? $ids['id_country'] : Configuration::get('PS_COUNTRY_DEFAULT')); + $id_shop = (int)(Shop::getCurrentShop()); + return (bool)SpecificPrice::getSpecificPrice((int)$id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity); + } + + /** + * Get product price + * Same as static function getPriceStatic, no need to specify product id + * + * @param boolean $tax With taxes or not (optional) + * @param integer $id_product_attribute Product attribute id (optional) + * @param integer $decimals Number of decimals (optional) + * @param integer $divisor Util when paying many time without fees (optional) + * @return float Product price in euros + */ + public function getPrice($tax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, $usereduc = true, $quantity = 1) + { + return self::getPriceStatic((int)($this->id), $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity); + } + + /** + * @deprecated + */ + public function getIdProductAttributeMostExpsensive() + { + Tools::displayAsDeprecated(); + return $this->getIdProductAttributeMostExpensive(); + } + + public function getIdProductAttributeMostExpensive() + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `id_product_attribute` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($this->id).' + ORDER BY `price` DESC'); + + return (isset($row['id_product_attribute']) AND $row['id_product_attribute']) ? (int)$row['id_product_attribute'] : 0; + } + + public function getPriceWithoutReduct($notax = false, $id_product_attribute = false) + { + return self::getPriceStatic((int)($this->id), !$notax, $id_product_attribute, 6, NULL, false, false); + } + + /** + * Get product price for display + * Also display currency sign and reduction + * + * @param array $params Product price, reduction... + * @param object $smarty Smarty object + * @return string Product price fully formated in customer currency + */ + static function productPrice($params, &$smarty) + { + $ret = ''; + if (isset($params['p']['reduction']) AND $params['p']['reduction']) + $ret .= ''.Tools::displayPrice($params['p']['price_without_reduction'], $smarty->ps_currency).'
'; + $ret .= Tools::displayPrice($params['p']['price'], $smarty->ps_currency); + return $ret; + } + + static function productPriceWithoutDisplay($params, &$smarty) + { + return Tools::convertPrice($params['p'], $params['c']); + } + + /** + * Display price with right format and currency + * + * @param array $params Params + * @object $smarty Smarty object + * @return string Price with right format and currency + */ + static function convertPrice($params, &$smarty) + { + return Tools::displayPrice($params['price'], $smarty->ps_currency); + } + + static function convertPriceWithCurrency($params, &$smarty) + { + if (!isset($params['convert'])) + $params['convert'] = true; + return Tools::displayPrice($params['price'], $params['currency'], false, $params['convert']); + } + + static function displayWtPrice($params, &$smarty) + { + return Tools::displayPrice($params['p'], $smarty->ps_currency); + } + + static function displayWtPriceWithCurrency($params, &$smarty) + { + return Tools::displayPrice($params['price'], $params['currency'], false, $params['convert']); + } + + /** + * Get available product quantities + * + * @param integer $id_product Product id + * @param integer $id_product_attribute Product attribute id (optional) + * @return integer Available quantities + */ + public static function getQuantity($id_product, $id_product_attribute = NULL, $cache_is_pack = NULL) + { + $lang = Configuration::get('PS_LANG_DEFAULT'); + if (((int)$cache_is_pack OR ($cache_is_pack === NULL AND Pack::isPack((int)$id_product, (int)$lang))) AND !Pack::isInStock((int)$id_product, (int)$lang)) + return 0; + + return Db::getInstance()->getValue(' + SELECT IF(COUNT(id_product_attribute), SUM(pa.`quantity`), p.`quantity`) as total + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_attribute` AS pa ON pa.`id_product` = p.`id_product` + WHERE p.`id_product` = '.(int)($id_product).' + '.(isset($id_product_attribute) ? 'AND `id_product_attribute` = '.(int)($id_product_attribute) : '').' + GROUP BY p.`id_product`'); + } + + /** + * Update available product quantities + * + * @param array $product Array with ordered product (quantity, id_product_attribute if applicable) + * @return mixed Query result + */ + public static function updateQuantity($product, $id_order = NULL) + { + if (!is_array($product)) + die (Tools::displayError()); + + if (!Configuration::get('PS_STOCK_MANAGEMENT')) + return true; + + if (Pack::isPack((int)($product['id_product']))) + { + $products_pack = Pack::getItems((int)($product['id_product']), (int)(Configuration::get('PS_LANG_DEFAULT'))); + foreach($products_pack AS $product_pack) + { + $tab_product_pack['id_product'] = (int)($product_pack->id); + $tab_product_pack['id_product_attribute'] = self::getDefaultAttribute($tab_product_pack['id_product'], 1); + $tab_product_pack['cart_quantity'] = (int)($product_pack->pack_quantity * $product['cart_quantity']); + self::updateQuantity($tab_product_pack); + } + } + + $productObj = new Product((int)$product['id_product'], false, (int)Configuration::get('PS_LANG_DEFAULT')); + return $productObj->addStockMvt(-(int)$product['cart_quantity'], (int)_STOCK_MOVEMENT_ORDER_REASON_, (int)$product['id_product_attribute'], (int)$id_order, NULL); + } + + public static function reinjectQuantities(&$orderDetail, $quantity) + { + global $cookie; + if (!Validate::isLoadedObject($orderDetail)) + die(Tools::displayError()); + + if (Pack::isPack((int)($orderDetail->product_id))) + { + $products_pack = Pack::getItems((int)($orderDetail->product_id), (int)(Configuration::get('PS_LANG_DEFAULT'))); + foreach($products_pack AS $product_pack) + if (!$product_pack->addStockMvt((int)($product_pack->pack_quantity * $quantity), _STOCK_MOVEMENT_ORDER_REASON_, (int)$product_pack->id_product_attribute, (int)$orderDetail->id_order, (int)$cookie->id_employee)) + return false; + } + + $product = new Product((int)$orderDetail->product_id); + if (!$product->addStockMvt((int)$quantity, _STOCK_MOVEMENT_ORDER_REASON_, (int)$orderDetail->product_attribute_id, (int)$orderDetail->id_order, (int)$cookie->id_employee)) + return false; + + $orderDetail->product_quantity_reinjected += (int)($quantity); + return true; + } + + public static function isAvailableWhenOutOfStock($oos) + { + return !Configuration::get('PS_STOCK_MANAGEMENT') ? true : ((int)($oos) == 2 ? (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')) : (int)($oos)); + } + + /** + * Check product availability + * + * @param integer $qty Quantity desired + * @return boolean True if product is available with this quantity + */ + public function checkQty($qty) + { + if (Pack::isPack((int)($this->id)) AND !Pack::isInStock((int)($this->id))) + return false; + + if ($this->isAvailableWhenOutOfStock($this->out_of_stock)) + return true; + + $result = Db::getInstance()->getRow(' + SELECT `quantity` + FROM `'._DB_PREFIX_.'product` + WHERE `id_product` = '.(int)($this->id)); + + return ($result AND $qty <= $result['quantity']); + } + + /** + * Check if there is not a default attribute and create it not + */ + public function checkDefaultAttributes() + { + $row = Db::getInstance()->getRow(' + SELECT id_product + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `default_on` = 1 AND `id_product` = '.(int)($this->id)); + if ($row) + return true; + + $mini = Db::getInstance()->getRow(' + SELECT MIN(pa.id_product_attribute) as `id_attr` + FROM `'._DB_PREFIX_.'product_attribute` pa + WHERE `id_product` = '.(int)($this->id)); + if (!$mini) + return false; + + if (!Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product_attribute` + SET `default_on` = 1 + WHERE `id_product_attribute` = '.(int)($mini['id_attr']))) + return false; + return true; + } + + /** + * Get all available attribute groups + * + * @param integer $id_lang Language id + * @return array Attribute groups + */ + public function getAttributesGroups($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, a.`id_attribute`, al.`name` AS attribute_name, + a.`color` AS attribute_color, pa.`id_product_attribute`, pa.`quantity`, pa.`price`, pa.`ecotax`, pa.`weight`, pa.`default_on`, pa.`reference`, pa.`unit_price_impact`, pa.`minimal_quantity` + FROM `'._DB_PREFIX_.'product_attribute` pa + LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group` + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON a.`id_attribute` = al.`id_attribute` + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON ag.`id_attribute_group` = agl.`id_attribute_group` + WHERE pa.`id_product` = '.(int)($this->id).' + AND al.`id_lang` = '.(int)($id_lang).' + AND agl.`id_lang` = '.(int)($id_lang).' + ORDER BY agl.`public_name`, al.`name`'); + } + + /** + * Delete product accessories + * + * @return mixed Deletion result + */ + public function deleteAccessories() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'accessory` WHERE `id_product_1` = '.(int)($this->id)); + } + + /** + * Delete product from other products accessories + * + * @return mixed Deletion result + */ + public function deleteFromAccessories() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'accessory` WHERE `id_product_2` = '.(int)($this->id)); + } + + /** + * Get product accessories (only names) + * + * @param integer $id_lang Language id + * @param integer $id_product Product id + * @return array Product accessories + */ + public static function getAccessoriesLight($id_lang, $id_product) + { + return Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, p.`reference`, pl.`name` + FROM `'._DB_PREFIX_.'accessory` + LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product`= `id_product_2`) + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + WHERE `id_product_1` = '.(int)($id_product)); + } + + /** + * Get product accessories + * + * @param integer $id_lang Language id + * @return array Product accessories + */ + public function getAccessories($id_lang, $active = true) + { + global $link, $cookie; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, p.`ean13`, p.`upc`, + i.`id_image`, il.`legend`, t.`rate`, m.`name` as manufacturer_name, cl.`name` AS category_default, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), + INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new + FROM `'._DB_PREFIX_.'accessory` + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = `id_product_2` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (p.`id_manufacturer`= m.`id_manufacturer`) + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + WHERE `id_product_1` = '.(int)($this->id).' + '.($active ? 'AND p.`active` = 1' : '')); + + if (!$result) + return false; + + return $this->getProductsProperties($id_lang, $result); + } + + public static function getAccessoryById($accessoryId) + { + return Db::getInstance()->getRow('SELECT `id_product`, `name` FROM `'._DB_PREFIX_.'product_lang` WHERE `id_product` = '.(int)($accessoryId)); + } + + /** + * Link accessories with product + * + * @param array $accessories_id Accessories ids + */ + public function changeAccessories($accessories_id) + { + foreach ($accessories_id as $id_product_2) + Db::getInstance()->AutoExecute(_DB_PREFIX_.'accessory', array('id_product_1' => (int)($this->id), 'id_product_2' => (int)($id_product_2)), 'INSERT'); + } + + /** + * Add new feature to product + */ + public function addFeaturesCustomToDB($id_value, $lang, $cust) + { + $row = array('id_feature_value' => (int)($id_value), 'id_lang' => (int)($lang), 'value' => pSQL($cust)); + return Db::getInstance()->autoExecute(_DB_PREFIX_.'feature_value_lang', $row, 'INSERT'); + } + + public function addFeaturesToDB($id_feature, $id_value, $cust = 0) + { + if ($cust) + { + $row = array('id_feature' => (int)($id_feature), 'custom' => 1); + Db::getInstance()->autoExecute(_DB_PREFIX_.'feature_value', $row, 'INSERT'); + $id_value = Db::getInstance()->Insert_ID(); + } + $row = array('id_feature' => (int)($id_feature), 'id_product' => (int)($this->id), 'id_feature_value' => (int)($id_value)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'feature_product', $row, 'INSERT'); + if ($id_value) + return ($id_value); + } + + public static function addFeatureProductImport($id_product, $id_feature, $id_feature_value) + { + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'feature_product` (`id_feature`, `id_product`, `id_feature_value`) + VALUES ('.(int)($id_feature).', '.(int)($id_product).', '.(int)($id_feature_value).') + ON DUPLICATE KEY UPDATE `id_feature_value` = '.(int)($id_feature_value) + ); + } + + /** + * Select all features for the object + * + * @return array Array with feature product's data + */ + public function getFeatures() + { + return self::getFeaturesStatic((int)$this->id); + } + + public static function getFeaturesStatic($id_product) + { + if (!array_key_exists($id_product, self::$_cacheFeatures)) + self::$_cacheFeatures[$id_product] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT id_feature, id_product, id_feature_value + FROM `'._DB_PREFIX_.'feature_product` + WHERE `id_product` = '.(int)$id_product); + return self::$_cacheFeatures[$id_product]; + } + + public static function cacheProductsFeatures(array $productIds) + { + $productImplode = array(); + foreach ($productIds as $id_product) + if ((int)$id_product AND !array_key_exists($id_product, self::$_cacheFeatures)) + $productImplode[] = (int)$id_product; + if (!count($productImplode)) + return; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT id_feature, id_product, id_feature_value + FROM `'._DB_PREFIX_.'feature_product` + WHERE `id_product` IN ('.implode($productImplode, ',').')'); + foreach ($result as $row) + { + if (!array_key_exists($row['id_product'], self::$_cacheFeatures)) + self::$_cacheFeatures[$row['id_product']] = array(); + self::$_cacheFeatures[$row['id_product']][] = $row; + } + } + + public static function cacheFrontFeatures(array $productIds, $id_lang) + { + $productImplode = array(); + foreach ($productIds as $id_product) + if ((int)$id_product AND !array_key_exists($id_product.'-'.$id_lang, self::$_cacheFeatures)) + $productImplode[] = (int)$id_product; + if (!count($productImplode)) + return; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT id_product, name, value, pf.id_feature + FROM '._DB_PREFIX_.'feature_product pf + LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.') + LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.') + WHERE `id_product` IN ('.implode($productImplode, ',').')'); + + foreach ($result as $row) + { + if (!array_key_exists($row['id_product'].'-'.$id_lang, self::$_frontFeaturesCache)) + self::$_frontFeaturesCache[$row['id_product'].'-'.$id_lang] = array(); + self::$_frontFeaturesCache[$row['id_product'].'-'.$id_lang][] = $row; + } + } + + /** + * Admin panel product search + * + * @param integer $id_lang Language id + * @param string $query Search query + * @return array Matching products + */ + public static function searchByName($id_lang, $query) + { + $result = Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, pl.`name`, pl.`link_rewrite`, p.`weight`, p.`active`, p.`ecotax`, i.`id_image`, p.`reference`, p.`cache_is_pack`, + il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name + FROM `'._DB_PREFIX_.'category_product` cp + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) AND i.`cover` = 1 + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' + GROUP BY `id_product` + ORDER BY pl.`name` ASC'); + + if (!$result) + return false; + + $resultsArray = array(); + foreach ($result AS $k => $row) + { + $row['price'] = Product::getPriceStatic($row['id_product'], true, NULL, 2); + $row['quantity'] = Product::getQuantity($row['id_product'], NULL, $row['cache_is_pack']); + $resultsArray[] = $row; + } + return $resultsArray; + } + + /** + * Duplicate attributes when duplicating a product + * + * @param integer $id_product_old Old product id + * @param integer $id_product_new New product id + */ + public static function duplicateAttributes($id_product_old, $id_product_new) + { + $return = true; + $combinationImages = array(); + + $result = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product` = '.(int)($id_product_old)); + foreach ($result as $row) + { + $id_product_attribute_old = (int)($row['id_product_attribute']); + $result2 = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'product_attribute_combination` + WHERE `id_product_attribute` = '.$id_product_attribute_old); + + $row['id_product'] = $id_product_new; + unset($row['id_product_attribute']); + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', $row, 'INSERT'); + + $id_product_attribute_new = (int)(Db::getInstance()->Insert_ID()); + if ($resultImages = self::_getAttributeImageAssociations($id_product_attribute_old)) + { + $combinationImages['old'][$id_product_attribute_old] = $resultImages; + $combinationImages['new'][$id_product_attribute_new] = $resultImages; + } + foreach ($result2 AS $row2) + { + $row2['id_product_attribute'] = $id_product_attribute_new; + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute_combination', $row2, 'INSERT'); + } + } + return !$return ? false : $combinationImages; + } + + /** + * Get product attribute image associations + * @param integer $id_product_attribute + * @return boolean + */ + public static function _getAttributeImageAssociations($id_product_attribute) + { + $combinationImages = array(); + $data = Db::getInstance()->ExecuteS(' + SELECT `id_image` + FROM `'._DB_PREFIX_.'product_attribute_image` + WHERE `id_product_attribute` = '.(int)($id_product_attribute)); + foreach ($data AS $row) + $combinationImages[] = (int)($row['id_image']); + return $combinationImages; + } + + public static function duplicateAccessories($id_product_old, $id_product_new) + { + $return = true; + + $result = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'accessory` + WHERE `id_product_1` = '.(int)($id_product_old)); + foreach ($result as $row) + { + $data = array( + 'id_product_1' => (int)($id_product_new), + 'id_product_2' => (int)($row['id_product_2'])); + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'accessory', $data, 'INSERT'); + } + return $return; + } + + public static function duplicateTags($id_product_old, $id_product_new) + { + $resource = Db::getInstance()->Execute('SELECT `id_tag` FROM `'._DB_PREFIX_.'product_tag` WHERE `id_product` = '.(int)($id_product_old)); + if (!Db::getInstance()->NumRows()) + return true; + $query = 'INSERT INTO `'._DB_PREFIX_.'product_tag` (`id_product`, `id_tag`) VALUES'; + while ($row = Db::getInstance()->nextRow($resource)) + $query .= ' ('.(int)($id_product_new).', '.(int)($row['id_tag']).'),'; + $query = rtrim($query, ','); + return Db::getInstance()->Execute($query); + } + + public static function duplicateDownload($id_product_old, $id_product_new) + { + $resource = Db::getInstance()->Execute('SELECT `display_filename`, `physically_filename`, `date_deposit`, `date_expiration`, `nb_days_accessible`, `nb_downloadable`, `active` FROM `'._DB_PREFIX_.'product_download` WHERE `id_product` = '.(int)($id_product_old)); + if (!Db::getInstance()->NumRows()) + return true; + $query = 'INSERT INTO `'._DB_PREFIX_.'product_download` (`id_product`, `display_filename`, `physically_filename`, `date_deposit`, `date_expiration`, `nb_days_accessible`, `nb_downloadable`, `active`) VALUES'; + while ($row = Db::getInstance()->nextRow($resource)) + $query .= ' ('.(int)($id_product_new).', \''.pSQL($row['display_filename']).'\', \''.pSQL($row['physically_filename']).'\', \''.pSQL($row['date_deposit']).'\', \''.pSQL($row['date_expiration']).'\', '.(int)($row['nb_days_accessible']).', '.(int)($row['nb_downloadable']).', '.(int)($row['active']).'),'; + $query = rtrim($query, ','); + return Db::getInstance()->Execute($query); + } + + /** + * Duplicate features when duplicating a product + * + * @param integer $id_product_old Old product id + * @param integer $id_product_old New product id + */ + public static function duplicateFeatures($id_product_old, $id_product_new) + { + $return = true; + + $result = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'feature_product` + WHERE `id_product` = '.(int)($id_product_old)); + foreach ($result as $row) + { + $result2 = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'feature_value` + WHERE `id_feature_value` = '.(int)($row['id_feature_value'])); + // Custom feature value, need to duplicate it + if ($result2['custom']) + { + $old_id_feature_value = $result2['id_feature_value']; + unset($result2['id_feature_value']); + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'feature_value', $result2, 'INSERT'); + $max_fv = Db::getInstance()->getRow(' + SELECT MAX(`id_feature_value`) AS nb + FROM `'._DB_PREFIX_.'feature_value`'); + $new_id_feature_value = $max_fv['nb']; + $languages = Language::getLanguages(); + foreach ($languages as $language) + { + $result3 = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'feature_value_lang` + WHERE `id_feature_value` = '.(int)($old_id_feature_value).' + AND `id_lang` = '.(int)($language['id_lang'])); + $result3['id_feature_value'] = $new_id_feature_value; + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'feature_value_lang', $result3, 'INSERT'); + } + $row['id_feature_value'] = $new_id_feature_value; + } + $row['id_product'] = $id_product_new; + $return &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'feature_product', $row, 'INSERT'); + } + return $return; + } + + static protected function _getCustomizationFieldsNLabels($productId) + { + $customizations = array(); + if (($customizations['fields'] = Db::getInstance()->ExecuteS(' + SELECT `id_customization_field`, `type`, `required` + FROM `'._DB_PREFIX_.'customization_field` + WHERE `id_product` = '.(int)($productId).' + ORDER BY `id_customization_field`')) === false) + return false; + if (empty($customizations['fields'])) + return array(); + $customizationFieldIds = array(); + foreach ($customizations['fields'] AS $customizationField) + $customizationFieldIds[] = (int)($customizationField['id_customization_field']); + if (($customizationLabels = Db::getInstance()->ExecuteS(' + SELECT `id_customization_field`, `id_lang`, `name` + FROM `'._DB_PREFIX_.'customization_field_lang` + WHERE `id_customization_field` IN ('.implode(', ', $customizationFieldIds).') + ORDER BY `id_customization_field`')) === false) + return false; + foreach ($customizationLabels AS $customizationLabel) + $customizations['labels'][$customizationLabel['id_customization_field']][] = $customizationLabel; + return $customizations; + } + + public static function duplicateSpecificPrices($oldProductId, $productId) + { + foreach (SpecificPrice::getIdsByProductId((int)($oldProductId)) as $data) + { + $specificPrice = new SpecificPrice((int)($data['id_specific_price'])); + if (!$specificPrice->duplicate((int)($productId))) + return false; + } + return true; + } + + public static function duplicateCustomizationFields($oldProductId, $productId) + { + if (($customizations = self::_getCustomizationFieldsNLabels($oldProductId)) === false) + return false; + if (empty($customizations)) + return true; + foreach ($customizations['fields'] AS $customizationField) + { + /* The new datas concern the new product */ + $customizationField['id_product'] = (int)($productId); + $oldCustomizationFieldId = (int)($customizationField['id_customization_field']); + unset($customizationField['id_customization_field']); + if (!Db::getInstance()->AutoExecute(_DB_PREFIX_.'customization_field', $customizationField, 'INSERT') OR !$customizationFieldId = Db::getInstance()->Insert_ID()) + return false; + if (isset($customizations['labels'])) + { + $query = 'INSERT INTO `'._DB_PREFIX_.'customization_field_lang` (`id_customization_field`, `id_lang`, `name`) VALUES '; + foreach ($customizations['labels'][$oldCustomizationFieldId] AS $customizationLabel) + $query .= '('.(int)($customizationFieldId).', '.(int)($customizationLabel['id_lang']).', \''.pSQL($customizationLabel['name']).'\'), '; + $query = rtrim($query, ', '); + if (!Db::getInstance()->Execute($query)) + return false; + } + } + return true; + } + + /** + * Get the link of the product page of this product + */ + public function getLink() + { + global $link; + return $link->getProductLink($this); + } + + public function getTags($id_lang) + { + if (!($this->tags AND key_exists($id_lang, $this->tags))) + return ''; + $result = ''; + foreach ($this->tags[$id_lang] AS $tagName) + $result .= $tagName.', '; + return rtrim($result, ', '); + } + + public static function defineProductImage($row, $id_lang) + { + if ($row['id_image']) + return $row['id_product'].'-'.$row['id_image']; + return Language::getIsoById((int)$id_lang).'-default'; + } + + protected static $producPropertiesCache = array(); + + public static function getProductProperties($id_lang, $row) + { + if (!$row['id_product']) + return false; + + // Product::getDefaultAttribute is only called if id_product_attribute is missing from the SQL query at the origin of it: consider adding it in order to avoid unnecessary queries + $row['allow_oosp'] = Product::isAvailableWhenOutOfStock($row['out_of_stock']); + if ((!isset($row['id_product_attribute']) OR !$row['id_product_attribute']) + AND ((isset($row['cache_default_attribute']) AND ($ipa_default = $row['cache_default_attribute']) !== NULL) + OR ($ipa_default = Product::getDefaultAttribute($row['id_product'], !$row['allow_oosp']))) + ) + $row['id_product_attribute'] = $ipa_default; + if (!isset($row['id_product_attribute'])) + $row['id_product_attribute'] = 0; + + // Tax + $usetax = Tax::excludeTaxeOption(); + + $cacheKey = $row['id_product'].'-'.$row['id_product_attribute'].'-'.$id_lang.'-'.(int)($usetax); + if (array_key_exists($cacheKey, self::$producPropertiesCache)) + return self::$producPropertiesCache[$cacheKey]; + + // Datas + $link = new Link(); + $row['category'] = Category::getLinkRewrite((int)$row['id_category_default'], (int)($id_lang)); + $row['link'] = $link->getProductLink((int)$row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']); + $row['attribute_price'] = (isset($row['id_product_attribute']) AND $row['id_product_attribute']) ? (float)(Product::getProductAttributePrice($row['id_product_attribute'])) : 0; + $row['price_tax_exc'] = Product::getPriceStatic((int)$row['id_product'], false, ((isset($row['id_product_attribute']) AND !empty($row['id_product_attribute'])) ? (int)($row['id_product_attribute']) : NULL), (self::$_taxCalculationMethod == PS_TAX_EXC ? 2 : 6)); + if (self::$_taxCalculationMethod == PS_TAX_EXC) + { + $row['price_tax_exc'] = Tools::ps_round($row['price_tax_exc'], 2); + $row['price'] = Product::getPriceStatic((int)$row['id_product'], true, ((isset($row['id_product_attribute']) AND !empty($row['id_product_attribute'])) ? (int)($row['id_product_attribute']) : NULL), 6); + } + else + $row['price'] = Tools::ps_round(Product::getPriceStatic((int)$row['id_product'], true, ((isset($row['id_product_attribute']) AND !empty($row['id_product_attribute'])) ? (int)($row['id_product_attribute']) : NULL), 6), 2); + + $row['reduction'] = Product::getPriceStatic((int)($row['id_product']), (bool)$usetax, (int)($row['id_product_attribute']), 6, NULL, true, true, 1, true, NULL, NULL, NULL, $specific_prices); + $row['specific_prices'] = $specific_prices; + $row['price_without_reduction'] = Product::getPriceStatic((int)$row['id_product'], true, ((isset($row['id_product_attribute']) AND !empty($row['id_product_attribute'])) ? (int)($row['id_product_attribute']) : NULL), 6, NULL, false, false); + if ($row['id_product_attribute']) + { + $row['quantity_all_versions'] = $row['quantity']; + $row['quantity'] = Product::getQuantity((int)$row['id_product'], $row['id_product_attribute'], isset($row['cache_is_pack']) ? $row['cache_is_pack'] : NULL); + } + $row['id_image'] = Product::defineProductImage($row, $id_lang); + $row['features'] = Product::getFrontFeaturesStatic((int)$id_lang, $row['id_product']); + $row['attachments'] = ((!isset($row['cache_has_attachments']) OR $row['cache_has_attachments']) ? Product::getAttachmentsStatic((int)($id_lang), $row['id_product']) : array()); + + // Pack management + $row['pack'] = (!isset($row['cache_is_pack']) ? Pack::isPack($row['id_product']) : (int)$row['cache_is_pack']); + $row['packItems'] = $row['pack'] ? Pack::getItemTable($row['id_product'], $id_lang) : array(); + $row['nopackprice'] = $row['pack'] ? Pack::noPackPrice($row['id_product']) : 0; + if ($row['pack'] AND !Pack::isInStock($row['id_product'])) + $row['quantity'] = 0; + + self::$producPropertiesCache[$cacheKey] = $row; + return self::$producPropertiesCache[$cacheKey]; + } + + public static function getProductsProperties($id_lang, $query_result) + { + $resultsArray = array(); + foreach ($query_result AS $row) + if ($row2 = Product::getProductProperties($id_lang, $row)) + $resultsArray[] = $row2; + return $resultsArray; + } + + /* + * Select all features for a given language + * + * @param $id_lang Language id + * @return array Array with feature's data + */ + public static function getFrontFeaturesStatic($id_lang, $id_product) + { + if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache)) + { + self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT name, value, pf.id_feature + FROM '._DB_PREFIX_.'feature_product pf + LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.') + LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.') + WHERE pf.id_product = '.(int)$id_product); + } + return self::$_frontFeaturesCache[$id_product.'-'.$id_lang]; + } + + public function getFrontFeatures($id_lang) + { + return self::getFrontFeaturesStatic($id_lang, $this->id); + } + + public static function getAttachmentsStatic($id_lang, $id_product) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM '._DB_PREFIX_.'product_attachment pa + LEFT JOIN '._DB_PREFIX_.'attachment a ON a.id_attachment = pa.id_attachment + LEFT JOIN '._DB_PREFIX_.'attachment_lang al ON (a.id_attachment = al.id_attachment AND al.id_lang = '.(int)($id_lang).') + WHERE pa.id_product = '.(int)($id_product)); + } + + public function getAttachments($id_lang) + { + return self::getAttachmentsStatic($id_lang, $this->id); + } + + /* + ** Customization management + */ + + public static function getAllCustomizedDatas($id_cart, $id_lang = null) + { + global $cookie; + // No need to query if there isn't any real cart! + if (!$id_cart) + return false; + if (!$id_lang AND !is_null($cookie) AND $cookie->id_lang) + $id_lang = $cookie->id_lang; + else + { + $cart = new Cart((int)($id_cart)); + $id_lang = (int)($cart->id_lang); + } + + if (!$result = Db::getInstance()->ExecuteS(' + SELECT cd.`id_customization`, c.`id_product`, cfl.`id_customization_field`, c.`id_product_attribute`, cd.`type`, cd.`index`, cd.`value`, cfl.`name` + FROM `'._DB_PREFIX_.'customized_data` cd + NATURAL JOIN `'._DB_PREFIX_.'customization` c + LEFT JOIN `'._DB_PREFIX_.'customization_field_lang` cfl ON (cfl.id_customization_field = cd.`index` AND id_lang = '.(int)($id_lang).') + WHERE c.`id_cart` = '.(int)$id_cart.' + ORDER BY `id_product`, `id_product_attribute`, `type`, `index`')) + return false; + $customizedDatas = array(); + foreach ($result AS $row) + $customizedDatas[(int)($row['id_product'])][(int)($row['id_product_attribute'])][(int)($row['id_customization'])]['datas'][(int)($row['type'])][] = $row; + if (!$result = Db::getInstance()->ExecuteS('SELECT `id_product`, `id_product_attribute`, `id_customization`, `quantity`, `quantity_refunded`, `quantity_returned` FROM `'._DB_PREFIX_.'customization` WHERE `id_cart` = '.(int)($id_cart))) + return false; + foreach ($result AS $row) + { + $customizedDatas[(int)($row['id_product'])][(int)($row['id_product_attribute'])][(int)($row['id_customization'])]['quantity'] = (int)($row['quantity']); + $customizedDatas[(int)($row['id_product'])][(int)($row['id_product_attribute'])][(int)($row['id_customization'])]['quantity_refunded'] = (int)($row['quantity_refunded']); + $customizedDatas[(int)($row['id_product'])][(int)($row['id_product_attribute'])][(int)($row['id_customization'])]['quantity_returned'] = (int)($row['quantity_returned']); + } + return $customizedDatas; + } + + + /** + * @param int $id_customization + * @return bool + * @deprecated + */ + public function deleteCustomizedDatas($id_customization) + { + Tools::displayAsDeprecated(); + if (Pack::isPack((int)($product['id_product']))) + { + $products_pack = Pack::getItems((int)($product['id_product']), (int)(Configuration::get('PS_LANG_DEFAULT'))); + foreach($products_pack AS $product_pack) + { + $tab_product_pack['id_product'] = (int)($product_pack->id); + $tab_product_pack['id_product_attribute'] = self::getDefaultAttribute($tab_product_pack['id_product'], 1); + $tab_product_pack['cart_quantity'] = (int)($product_pack->pack_quantity * $product['cart_quantity']); + self::updateQuantity($tab_product_pack); + } + } + if (($result = Db::getInstance()->ExecuteS('SELECT `value` FROM `'._DB_PREFIX_.'customized_data` WHERE `id_customization` = '.(int)($id_customization).' AND `type` = '._CUSTOMIZE_FILE_)) === false) + return false; + foreach ($result AS $row) + if (!@unlink(_PS_UPLOAD_DIR_.$row['value']) OR !@unlink(_PS_UPLOAD_DIR_.$row['value'].'_small')) + return false; + return (Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.(int)($id_customization)) AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customized_data` WHERE `id_customization` = '.(int)($id_customization))); + } + + public static function addCustomizationPrice(&$products, &$customizedDatas) + { + foreach ($products AS &$productUpdate) + { + $customizationQuantity = 0; + $customizationQuantityRefunded = 0; + $customizationQuantityReturned = 0; + /* Compatibility */ + $productId = (int)(isset($productUpdate['id_product']) ? $productUpdate['id_product'] : $productUpdate['product_id']); + $productAttributeId = (int)(isset($productUpdate['id_product_attribute']) ? $productUpdate['id_product_attribute'] : $productUpdate['product_attribute_id']); + $productQuantity = (int)(isset($productUpdate['cart_quantity']) ? $productUpdate['cart_quantity'] : $productUpdate['product_quantity']); + $price = isset($productUpdate['price']) ? $productUpdate['price'] : $productUpdate['product_price']; + $priceWt = $price * (1 + ((isset($productUpdate['tax_rate']) ? $productUpdate['tax_rate'] : $productUpdate['rate']) * 0.01)); + if (isset($customizedDatas[$productId][$productAttributeId])) + foreach ($customizedDatas[$productId][$productAttributeId] AS $customization) + { + $customizationQuantity += (int)($customization['quantity']); + $customizationQuantityRefunded += (int)($customization['quantity_refunded']); + $customizationQuantityReturned += (int)($customization['quantity_returned']); + } + $productUpdate['customizationQuantityTotal'] = $customizationQuantity; + $productUpdate['customizationQuantityRefunded'] = $customizationQuantityRefunded; + $productUpdate['customizationQuantityReturned'] = $customizationQuantityReturned; + if ($customizationQuantity) + { + $productUpdate['total_wt'] = $priceWt * ($productQuantity - $customizationQuantity); + $productUpdate['total_customization_wt'] = $priceWt * $customizationQuantity; + $productUpdate['total'] = $price * ($productQuantity - $customizationQuantity); + $productUpdate['total_customization'] = $price * $customizationQuantity; + } + } + } + + /* + ** Customization fields' label management + */ + + protected function _checkLabelField($field, $value) + { + if (!Validate::isLabel($value)) + return false; + $tmp = explode('_', $field); + if (count($tmp) < 4) + return false; + return $tmp; + } + + protected function _deleteOldLabels() + { + $max = array(_CUSTOMIZE_FILE_ => (int)(Tools::getValue('uploadable_files')), _CUSTOMIZE_TEXTFIELD_ => (int)(Tools::getValue('text_fields'))); + /* Get customization field ids */ + if (($result = Db::getInstance()->ExecuteS('SELECT `id_customization_field`, `type` FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id).' ORDER BY `id_customization_field`')) === false) + return false; + if (empty($result)) + return true; + $customizationFields = array(_CUSTOMIZE_FILE_ => array(), _CUSTOMIZE_TEXTFIELD_ => array()); + foreach ($result AS $row) + $customizationFields[(int)($row['type'])][] = (int)($row['id_customization_field']); + $extraFile = count($customizationFields[_CUSTOMIZE_FILE_]) - $max[_CUSTOMIZE_FILE_]; + $extraText = count($customizationFields[_CUSTOMIZE_TEXTFIELD_]) - $max[_CUSTOMIZE_TEXTFIELD_]; + + /* If too much inside the database, deletion */ + if ($extraFile > 0 AND count($customizationFields[_CUSTOMIZE_FILE_]) - $extraFile >= 0 AND + (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id).' AND `type` = '._CUSTOMIZE_FILE_.' AND `id_customization_field` >= '.(int)($customizationFields[_CUSTOMIZE_FILE_][count($customizationFields[_CUSTOMIZE_FILE_]) - $extraFile])) + OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field_lang` WHERE `id_customization_field` NOT IN (SELECT `id_customization_field` FROM `'._DB_PREFIX_.'customization_field`)'))) + return false; + + if ($extraText > 0 AND count($customizationFields[_CUSTOMIZE_TEXTFIELD_]) - $extraText >= 0 AND + (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id).' AND `type` = '._CUSTOMIZE_TEXTFIELD_.' AND `id_customization_field` >= '.(int)($customizationFields[_CUSTOMIZE_TEXTFIELD_][count($customizationFields[_CUSTOMIZE_TEXTFIELD_]) - $extraText])) + OR !Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization_field_lang` WHERE `id_customization_field` NOT IN (SELECT `id_customization_field` FROM `'._DB_PREFIX_.'customization_field`)'))) + return false; + return true; + } + + protected function _createLabel(&$languages, $type) + { + /* Label insertion */ + if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'customization_field` (`id_product`, `type`, `required`) VALUES ('.(int)($this->id).', '.(int)($type).', 0)') OR !$id_customization_field = (int)(Db::getInstance()->Insert_ID())) + return false; + + /* Multilingual label name creation */ + $values = ''; + foreach ($languages AS $language) + $values .= '('.(int)($id_customization_field).', '.(int)($language['id_lang']).', \'\'), '; + $values = rtrim($values, ', '); + if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'customization_field_lang` (`id_customization_field`, `id_lang`, `name`) VALUES '.$values)) + return false; + return true; + } + + public function createLabels($uploadableFiles, $textFields) + { + $languages = Language::getLanguages(); + if ((int)($uploadableFiles) > 0) + for ($i = 0; $i < (int)($uploadableFiles); $i++) + if (!$this->_createLabel($languages, _CUSTOMIZE_FILE_)) + return false; + if ((int)($textFields) > 0) + for ($i = 0; $i < (int)($textFields); $i++) + if (!$this->_createLabel($languages, _CUSTOMIZE_TEXTFIELD_)) + return false; + return true; + } + + public function updateLabels() + { + $hasRequiredFields = 0; + foreach ($_POST AS $field => $value) + /* Label update */ + if (strncmp($field, 'label_', 6) == 0) + { + if (!$tmp = $this->_checkLabelField($field, $value)) + return false; + /* Multilingual label name update */ + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'customization_field_lang` + (`id_customization_field`, `id_lang`, `name`) VALUES ('.(int)($tmp[2]).', '.(int)($tmp[3]).', \''.pSQL($value).'\') + ON DUPLICATE KEY UPDATE `name` = \''.pSQL($value).'\'')) + return false; + $isRequired = isset($_POST['require_'.(int)($tmp[1]).'_'.(int)($tmp[2])]) ? 1 : 0; + $hasRequiredFields |= $isRequired; + /* Require option update */ + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization_field` SET `required` = '.(int)($isRequired).' WHERE `id_customization_field` = '.(int)($tmp[2]))) + return false; + } + if ($hasRequiredFields AND !Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `customizable` = 2 WHERE `id_product` = '.(int)($this->id))) + return false; + if (!$this->_deleteOldLabels()) + return false; + return true; + } + + public function getCustomizationFields($id_lang = false) + { + if (!$result = Db::getInstance()->ExecuteS(' + SELECT cf.`id_customization_field`, cf.`type`, cf.`required`, cfl.`name`, cfl.`id_lang` + FROM `'._DB_PREFIX_.'customization_field` cf + NATURAL JOIN `'._DB_PREFIX_.'customization_field_lang` cfl + WHERE cf.`id_product` = '.(int)($this->id).($id_lang ? ' AND cfl.`id_lang` = '.(int)($id_lang) : '').' + ORDER BY cf.`id_customization_field`')) + return false; + if ($id_lang) + return $result; + $customizationFields = array(); + foreach ($result AS $row) + $customizationFields[(int)($row['type'])][(int)($row['id_customization_field'])][(int)($row['id_lang'])] = $row; + return $customizationFields; + } + + public function getCustomizationFieldIds() + { + return Db::getInstance()->ExecuteS('SELECT `id_customization_field`, `type` FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id)); + } + + public function getRequiredCustomizableFields() + { + return Db::getInstance()->ExecuteS('SELECT `id_customization_field`, `type` FROM `'._DB_PREFIX_.'customization_field` WHERE `id_product` = '.(int)($this->id).' AND `required` = 1'); + } + + public function hasAllRequiredCustomizableFields() + { + global $cookie; + + $fields = array_merge($cookie->getFamily('pictures_'.(int)($this->id)), $cookie->getFamily('textFields_'.(int)($this->id))); + if (($requiredFields = $this->getRequiredCustomizableFields()) === false) + return false; + $prefix = array(_CUSTOMIZE_FILE_ => 'pictures_'.(int)($this->id).'_', _CUSTOMIZE_TEXTFIELD_ => 'textFields_'.(int)($this->id).'_'); + foreach ($requiredFields AS $field) + if (!isset($fields[$prefix[$field['type']].$field['id_customization_field']]) OR empty($fields[$prefix[$field['type']].$field['id_customization_field']])) + return false; + return true; + } + + /** + * Specify if a product is already in database + * + * @param $id_product Product id + * @return boolean + */ + public static function existsInDatabase($id_product) + { + $row = Db::getInstance()->getRow(' + SELECT `id_product` + FROM '._DB_PREFIX_.'product p + WHERE p.`id_product` = '.(int)($id_product)); + + return isset($row['id_product']); + } + + public static function idIsOnCategoryId($id_product, $categories) + { + $sql = 'SELECT id_product FROM `'._DB_PREFIX_.'category_product` WHERE `id_product`='.(int)($id_product).' AND `id_category` IN('; + foreach ($categories AS $category) + $sql .= (int)($category['id_category']).','; + $sql = rtrim($sql, ',').')'; + + if (isset(self::$_incat[md5($sql)])) + return self::$_incat[md5($sql)]; + + if (!Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute($sql)) + return false; + self::$_incat[md5($sql)] = (Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows() > 0 ? true : false); + return self::$_incat[md5($sql)]; + } + + public function getNoPackPrice() + { + return Pack::noPackPrice($this->id); + } + + public function checkAccess($id_customer) + { + if (!$id_customer) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT ctg.`id_group` + FROM `'._DB_PREFIX_.'category_product` cp + INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`) + WHERE cp.`id_product` = '.(int)($this->id).' AND ctg.`id_group` = 1'); + } else { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT cg.`id_group` + FROM `'._DB_PREFIX_.'category_product` cp + INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`) + INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`) + WHERE cp.`id_product` = '.(int)($this->id).' AND cg.`id_customer` = '.(int)($id_customer)); + } + if ($result AND isset($result['id_group']) AND $result['id_group']) + return true; + return false; + } + + public function addStockMvt($quantity, $id_reason, $id_product_attribute = NULL, $id_order = NULL, $id_employee = NULL) + { + $stockMvt = new StockMvt(); + $stockMvt->id_product = (int)$this->id; + $stockMvt->id_product_attribute = (int)$id_product_attribute; + $stockMvt->id_order = (int)$id_order; + $stockMvt->id_employee = (int)$id_employee; + $stockMvt->quantity = (int)$quantity; + $stockMvt->id_stock_mvt_reason = (int)$id_reason; + return $stockMvt->add(); + } + + public function getStockMvts($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT sm.id_stock_mvt, sm.date_add, sm.quantity, sm.id_order, CONCAT(pl.name, \' \', GROUP_CONCAT(IFNULL(al.name, \'\'), \'\')) product_name, CONCAT(e.lastname, \' \', e.firstname) employee, mrl.name reason + FROM `'._DB_PREFIX_.'stock_mvt` sm + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (sm.id_product = pl.id_product AND pl.id_lang = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'stock_mvt_reason_lang` mrl ON (sm.id_stock_mvt_reason = mrl.id_stock_mvt_reason AND mrl.id_lang = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'employee` e ON (e.id_employee = sm.id_employee) + LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.id_product_attribute = sm.id_product_attribute) + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.id_attribute = pac.id_attribute AND al.id_lang = '.(int)$id_lang.') + WHERE sm.id_product='.(int)$this->id.' + GROUP BY sm.id_stock_mvt'); + } + + public function setWsCategories($values) + { + $ids = array(); + foreach ($values as $value) + $ids[] = $value['id']; + if ($this->deleteCategories()) + { + if ($ids) + { + $sqlValues = ''; + $ids = array_map('intval', $ids); + foreach ($ids as $position => $id) + $sqlValues[] = '('.(int)$id.', '.(int)$this->id.', '.(int)$position.')'; + $result = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'category_product` (`id_category`, `id_product`, `position`) + VALUES '.implode(',', $sqlValues) + ); + return $result; + } + } + return false; + } + + public function getWsCategories() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT `id_category` AS id FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int)$this->id); + return $result; + } + + /** + * @deprecated + */ + public function getBasicPrice() + { + Tools::displayAsDeprecated(); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `price` FROM `'._DB_PREFIX_.'product` WHERE `id_product` = '.(int)($this->id)); + } + + public static function getUrlRewriteInformations($id_product) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT pl.`id_lang`, pl.`link_rewrite`, p.`ean13`, cl.`link_rewrite` AS category_rewrite + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'lang` l ON (pl.`id_lang` = l.`id_lang`) + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = pl.`id_lang`) + WHERE p.`id_product` = '.(int)$id_product. ' + AND l.`active` = 1'); + } + + public static function getIdTaxRulesGroupByIdProduct($id_product) + { + if (!isset(self::$_tax_rules_group[$id_product])) + { + $id_group = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `id_tax_rules_group` + FROM `'._DB_PREFIX_.'product` + WHERE `id_product` = '.(int)$id_product); + self::$_tax_rules_group[$id_product] = $id_group; + } + return self::$_tax_rules_group[$id_product]; + } +} + diff --git a/classes/ProductDownload.php b/classes/ProductDownload.php new file mode 100644 index 000000000..eb37d9ac7 --- /dev/null +++ b/classes/ProductDownload.php @@ -0,0 +1,272 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProductDownloadCore extends ObjectModel +{ + /** @var integer Product id which download belongs */ + public $id_product; + + /** @var string DisplayFilename the name which appear */ + public $display_filename; + + /** @var string PhysicallyFilename the name of the file on hard disk */ + public $physically_filename; + + /** @var string DateDeposit when the file is upload */ + public $date_deposit; + + /** @var string DateExpiration deadline of the file */ + public $date_expiration; + + /** @var string NbDaysAccessible how many days the customer can access to file */ + public $nb_days_accessible; + + /** @var string NbDownloadable how many time the customer can download the file */ + public $nb_downloadable; + + /** @var boolean Active if file is accessible or not */ + public $active = 1; + + protected static $_productIds = array(); + + protected $fieldsRequired = array( + 'id_product', + 'display_filename' + ); + protected $fieldsSize = array( + 'display_filename' => 255, + 'physically_filename' => 255, + 'date_deposit' => 20, + 'date_expiration' => 20, + 'nb_days_accessible' => 10, + 'nb_downloadable' => 10, + 'active' => 1 + ); + protected $fieldsValidate = array( + 'id_product' => 'isUnsignedId', + 'display_filename' => 'isGenericName', + 'physically_filename' => 'isSha1', + 'date_deposit' => 'isDate', + 'date_expiration' => 'isDate', + 'nb_days_accessible' => 'isUnsignedInt', + 'nb_downloadable' => 'isUnsignedInt', + 'active' => 'isUnsignedInt' + ); + + protected $table = 'product_download'; + protected $identifier = 'id_product_download'; + + /** + * Build a virtual product + * + * @param integer $id_product_download Existing productDownload id in order to load object (optional) + */ + public function __construct($id_product_download = NULL) + { + parent::__construct($id_product_download); + // TODO check if the file is present on hard drive + } + + public function delete($deleteFile=false) + { + if ($deleteFile) + $this->deleteFile(); + } + + public function getFields() + { + parent::validateFields(); + + $fields['id_product'] = (int)($this->id_product); + $fields['display_filename'] = pSQL($this->display_filename); + $fields['physically_filename'] = pSQL($this->physically_filename); + $fields['date_deposit'] = pSQL($this->date_deposit); + $fields['date_expiration'] = pSQL($this->date_expiration); + $fields['nb_days_accessible'] = (int)($this->nb_days_accessible); + $fields['nb_downloadable'] = (int)($this->nb_downloadable); + $fields['active'] = (int)($this->active); + return $fields; + } + + + /** + * Delete the file + * + * @return boolean + */ + public function deleteFile() + { + if (!$this->checkFile()) + return false; + return unlink(_PS_DOWNLOAD_DIR_.$this->physically_filename); + } + + /** + * Check if file exists + * + * @return boolean + */ + public function checkFile() + { + if (!$this->physically_filename) return false; + return file_exists(_PS_DOWNLOAD_DIR_.$this->physically_filename); + } + + /** + * Check if download repository is writable + * + * @return boolean + */ + static public function checkWritableDir() + { + return is_writable(_PS_DOWNLOAD_DIR_); + } + + /** + * Return the id_product_download from an id_product + * + * @param int $id_product Product the id + * @return integer Product the id for this virtual product + */ + public static function getIdFromIdProduct($id_product) + { + if (array_key_exists($id_product, self::$_productIds)) + return self::$_productIds[$id_product]; + + $data = Db::getInstance()->getRow(' + SELECT `id_product_download` + FROM `'._DB_PREFIX_.'product_download` + WHERE `id_product` = '.(int)($id_product).' AND `active` = 1'); + + self::$_productIds[$id_product] = isset($data['id_product_download']) ? (int)($data['id_product_download']) : false; + + return self::$_productIds[$id_product]; + } + + /** + * Return the filename from an id_product + * + * @param int $id_product Product the id + * @return string Filename the filename for this virtual product + */ + public static function getFilenameFromIdProduct($id_product) + { + $data = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `physically_filename` + FROM `'._DB_PREFIX_.'product_download` + WHERE `id_product` = '.(int)($id_product).' + AND `active` = 1'); + return $data['physically_filename']; + } + + /** + * Return the display filename from a physical filename + * + * @param string $physically_filename Filename physically + * @return string Filename the display filename for this virtual product + */ + public static function getFilenameFromFilename($physically_filename) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `display_filename` + FROM `'._DB_PREFIX_.'product_download` + WHERE `physically_filename` = \''.pSQL($physically_filename).'\''); + } + + /** + * Return html link + * + * @param string $class CSS selector (optionnal) + * @param bool $admin specific to backend (optionnal) + * @param string $hash hash code in table order detail (optionnal) + * @return string Html all the code for print a link to the file + */ + public function getTextLink($admin=true, $hash=false) + { + $key = $this->physically_filename . '-' . ($hash ? $hash : 'orderdetail'); + $link = ($admin) ? './get-file-admin.php?' : Tools::getHttpHost(true, true).__PS_BASE_URI__.'get-file.php?'; + $link .= ($admin) ? 'file='.$this->physically_filename : 'key='.$key; + return $link; + } + + /** + * Return html link + * + * @param string $class CSS selector (optionnal) + * @param bool $admin specific to backend (optionnal) + * @param string $hash hash code in table order detail (optionnal) + * @return string Html all the code for print a link to the file + */ + public function getHtmlLink($class=false, $admin=true, $hash=false) + { + $link = $this->getTextLink($admin, $hash); + $html = 'display_filename.''; + return $html; + } + + /** + * Return a deadline + * + * @return string Datetime in SQL format + */ + public function getDeadline() + { + if (!(int)($this->nb_days_accessible)) + return '0000-00-00 00:00:00'; + $timestamp = strtotime('+'.(int)($this->nb_days_accessible).' day'); + return date('Y-m-d H:i:s', $timestamp); + } + + /** + * Return a hash for control download access + * + * @return string Hash ready to insert in database + */ + public function getHash() + { + // TODO check if this hash not already in database + return sha1(microtime().$this->id); + } + + /** + * Return a sha1 filename + * + * @return string Sha1 unique filename + */ + static public function getNewFilename() + { + $ret = sha1(microtime()); + if (file_exists(_PS_DOWNLOAD_DIR_.$ret)) + $ret = ProductDownload::getNewFilename(); + return $ret; + } + +} + + diff --git a/classes/ProductSale.php b/classes/ProductSale.php new file mode 100644 index 000000000..ace932319 --- /dev/null +++ b/classes/ProductSale.php @@ -0,0 +1,180 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProductSaleCore +{ + /* + ** Fill the `product_sale` SQL table with data from `order_detail` + ** @return bool True on success + */ + static public function fillProductSales() + { + return Db::getInstance()->Execute(' + REPLACE INTO '._DB_PREFIX_.'product_sale + (`id_product`, `quantity`, `sale_nbr`, `date_upd`) + SELECT od.product_id, COUNT(od.product_id), SUM(od.product_quantity), NOW() + FROM '._DB_PREFIX_.'order_detail od GROUP BY od.product_id'); + } + + /* + ** Get number of actives products sold + ** @return int number of actives products listed in product_sales + */ + static public function getNbSales() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(ps.`id_product`) AS nb + FROM `'._DB_PREFIX_.'product_sale` ps + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ps.`id_product` + WHERE p.`active` = 1'); + return (int)($result['nb']); + } + + /* + ** Get required informations on best sales products + ** + ** @param integer $id_lang Language id + ** @param integer $pageNumber Start from (optional) + ** @param integer $nbProducts Number of products to return (optional) + ** @return array from Product::getProductProperties + */ + static public function getBestSales($id_lang, $pageNumber = 0, $nbProducts = 10, $orderBy=NULL, $orderWay=NULL) + { + if ($pageNumber < 0) $pageNumber = 0; + if ($nbProducts < 1) $nbProducts = 10; + if (empty($orderBy) || $orderBy == 'position') $orderBy = 'sales'; + if (empty($orderWay)) $orderWay = 'DESC'; + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, + pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, + i.`id_image`, il.`legend`, + ps.`quantity` AS sales, t.`rate`, pl.`meta_keywords`, pl.`meta_title`, pl.`meta_description`, + DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new + FROM `'._DB_PREFIX_.'product_sale` ps + LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + WHERE p.`active` = 1 + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY '.(isset($orderByPrefix) ? $orderByPrefix.'.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(int)($pageNumber * $nbProducts).', '.(int)($nbProducts)); + + if ($orderBy == 'price') + Tools::orderbyPrice($result,$orderWay); + if (!$result) + return false; + return Product::getProductsProperties($id_lang, $result); + } + + /* + ** Get required informations on best sales products + ** + ** @param integer $id_lang Language id + ** @param integer $pageNumber Start from (optional) + ** @param integer $nbProducts Number of products to return (optional) + ** @return array keys : id_product, link_rewrite, name, id_image, legend, sales, ean13, upc, link + */ + static public function getBestSalesLight($id_lang, $pageNumber = 0, $nbProducts = 10) + { + global $link; + + if ($pageNumber < 0) $pageNumber = 0; + if ($nbProducts < 1) $nbProducts = 10; + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.id_product, pl.`link_rewrite`, pl.`name`, pl.`description_short`, i.`id_image`, il.`legend`, ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category + FROM `'._DB_PREFIX_.'product_sale` ps + LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product` + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = '.(int)$id_lang.') + WHERE p.`active` = 1 + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY sales DESC + LIMIT '.(int)($pageNumber * $nbProducts).', '.(int)($nbProducts)); + if (!$result) + return $result; + + foreach ($result AS &$row) + { + $row['link'] = $link->getProductLink($row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']); + $row['id_image'] = Product::defineProductImage($row, $id_lang); + } + return $result; + } + + static public function addProductSale($product_id, $qty = 1) + { + return Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'product_sale + (`id_product`, `quantity`, `sale_nbr`, `date_upd`) + VALUES ('.(int)($product_id).', '.(int)($qty).', 1, NOW()) + ON DUPLICATE KEY UPDATE `quantity` = `quantity` + '.(int)($qty).', `sale_nbr` = `sale_nbr` + 1, `date_upd` = NOW()'); + } + + static public function getNbrSales($id_product) + { + $result = Db::getInstance()->getRow('SELECT `sale_nbr` FROM '._DB_PREFIX_.'product_sale WHERE `id_product` = '.(int)($id_product)); + if (!$result OR empty($result) OR !key_exists('sale_nbr', $result)) + return -1; + return (int)($result['sale_nbr']); + } + + static public function removeProductSale($id_product, $qty = 1) + { + $nbrSales = self::getNbrSales($id_product); + if ($nbrSales > 1) + return Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product_sale SET `quantity` = `quantity` - '.(int)($qty).', `sale_nbr` = `sale_nbr` - 1, `date_upd` = NOW() WHERE `id_product` = '.(int)($id_product)); + elseif ($nbrSales == 1) + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_sale WHERE `id_product` = '.(int)($id_product)); + return true; + } +} + diff --git a/classes/Profile.php b/classes/Profile.php new file mode 100644 index 000000000..6aaa414d3 --- /dev/null +++ b/classes/Profile.php @@ -0,0 +1,130 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProfileCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'profile'; + protected $identifier = 'id_profile'; + + public function getFields() + { + return array('id_profile' => $this->id); + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + /** + * Get all available profiles + * + * @return array Profiles + */ + static public function getProfiles($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.`id_profile`, `name` + FROM `'._DB_PREFIX_.'profile` p + LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (p.`id_profile` = pl.`id_profile` AND `id_lang` = '.(int)($id_lang).') + ORDER BY `name` ASC'); + } + + /** + * Get the current profile name + * + * @return string Profile + */ + static public function getProfile($id_profile, $id_lang = NULL) + { + if ($id_lang == NULL) + $id_lang = Configuration::get('PS_LANG_DEFAULT'); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name` + FROM `'._DB_PREFIX_.'profile` p + LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (p.`id_profile` = pl.`id_profile`) + WHERE p.`id_profile` = '.(int)($id_profile).' + AND pl.`id_lang` = '.(int)($id_lang)); + } + + + public function add($autodate = true, $nullValues = false) + { + if (parent::add($autodate, true)) + return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'access (SELECT '.(int)($this->id).', id_tab, 0, 0, 0, 0 FROM '._DB_PREFIX_.'tab)'); + return false; + } + + public function delete() + { + if (parent::delete()) + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'access` WHERE `id_profile` = '.(int)($this->id)); + return false; + } + + public static function getProfileAccess($id_profile, $id_tab) + { + /* Accesses selection */ + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `view`, `add`, `edit`, `delete` + FROM `'._DB_PREFIX_.'access` + WHERE `id_profile` = '.(int)($id_profile).' AND `id_tab` = '.(int)($id_tab)); + } + + public static function getProfileAccesses($id_profile) + { + /* Accesses selection */ + $accesses = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'access` + WHERE `id_profile` = '.(int)($id_profile)); + + $result = array(); + foreach($accesses AS $access) { + /* If it is the first time we meet this tab we prepare it */ + if (!isset($result[$access['id_tab']])) + $result[$access['id_tab']] = array(); + $result[$access['id_tab']] = $access; + } + return $result; + } +} + + diff --git a/classes/QuickAccess.php b/classes/QuickAccess.php new file mode 100644 index 000000000..17f2ba41a --- /dev/null +++ b/classes/QuickAccess.php @@ -0,0 +1,82 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class QuickAccessCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + /** @var string Link */ + public $link; + + /** @var boolean New windows or not */ + public $new_window; + + protected $fieldsRequired = array('link', 'new_window'); + protected $fieldsSize = array('link' => 128); + protected $fieldsValidate = array('link' => 'isUrl', 'new_window' => 'isBool'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'quick_access'; + protected $identifier = 'id_quick_access'; + + public function getFields() + { + parent::validateFields(); + $fields['link'] = pSQL($this->link); + $fields['new_window'] = (int)($this->new_window); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + /** + * Get all available quick_accesses + * + * @return array QuickAccesses + */ + static public function getQuickAccesses($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'quick_access` qa + LEFT JOIN `'._DB_PREFIX_.'quick_access_lang` qal ON (qa.`id_quick_access` = qal.`id_quick_access` AND qal.`id_lang` = '.(int)($id_lang).') + ORDER BY `name` ASC'); + } +} + diff --git a/classes/RangePrice.php b/classes/RangePrice.php new file mode 100644 index 000000000..c26d055be --- /dev/null +++ b/classes/RangePrice.php @@ -0,0 +1,69 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class RangePriceCore extends ObjectModel +{ + public $id_carrier; + public $delimiter1; + public $delimiter2; + + protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2'); + protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isFloat', 'delimiter2' => 'isFloat'); + + protected $table = 'range_price'; + protected $identifier = 'id_range_price'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_carrier' => array('xlink_resource' => 'carriers'), + ) + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['delimiter1'] = (float)($this->delimiter1); + $fields['delimiter2'] = (float)($this->delimiter2); + return $fields; + } + + /** + * Get all available price ranges + * + * @return array Ranges + */ + public static function getRanges($id_carrier) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'range_price` + WHERE `id_carrier` = '.(int)($id_carrier).' + ORDER BY `delimiter1` ASC'); + } +} + diff --git a/classes/RangeWeight.php b/classes/RangeWeight.php new file mode 100644 index 000000000..60867b49b --- /dev/null +++ b/classes/RangeWeight.php @@ -0,0 +1,69 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class RangeWeightCore extends ObjectModel +{ + public $id_carrier; + public $delimiter1; + public $delimiter2; + + protected $fieldsRequired = array('id_carrier', 'delimiter1', 'delimiter2'); + protected $fieldsValidate = array('id_carrier' => 'isInt', 'delimiter1' => 'isFloat', 'delimiter2' => 'isFloat'); + + protected $table = 'range_weight'; + protected $identifier = 'id_range_weight'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_carrier' => array('xlink_resource' => 'carriers'), + ) + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['delimiter1'] = (float)($this->delimiter1); + $fields['delimiter2'] = (float)($this->delimiter2); + return $fields; + } + + /** + * Get all available weight ranges + * + * @return array Ranges + */ + public static function getRanges($id_carrier) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'range_weight` + WHERE `id_carrier` = '.(int)($id_carrier).' + ORDER BY `delimiter1` ASC'); + } +} + diff --git a/classes/Referrer.php b/classes/Referrer.php new file mode 100644 index 000000000..64f66c18e --- /dev/null +++ b/classes/Referrer.php @@ -0,0 +1,315 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ReferrerCore extends ObjectModel +{ + public $name; + public $passwd; + + public $http_referer_regexp; + public $http_referer_like; + public $request_uri_regexp; + public $request_uri_like; + public $http_referer_regexp_not; + public $http_referer_like_not; + public $request_uri_regexp_not; + public $request_uri_like_not; + + public $base_fee; + public $percent_fee; + public $click_fee; + + public $cache_visitors; + public $cache_visits; + public $cache_pages; + public $cache_registrations; + public $cache_orders; + public $cache_sales; + public $cache_reg_rate; + public $cache_order_rate; + + public $date_add; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 64, 'http_referer_regexp' => 64, 'request_uri_regexp' => 64, 'http_referer_like' => 64, 'request_uri_like' => 64, 'passwd' => 32); + protected $fieldsValidate = array( + 'name' => 'isGenericName', 'passwd' => 'isPasswd', + 'http_referer_regexp' => 'isCleanHtml', 'request_uri_regexp' => 'isCleanHtml', 'http_referer_like' => 'isCleanHtml', 'request_uri_like' => 'isCleanHtml', + 'http_referer_regexp_not' => 'isCleanHtml', 'request_uri_regexp_not' => 'isCleanHtml', 'http_referer_like_not' => 'isCleanHtml', 'request_uri_like_not' => 'isCleanHtml', + 'base_fee' => 'isFloat', 'percent_fee' => 'isFloat', 'click_fee' => 'isFloat', + 'cache_visitors' => 'isUnsignedInt', 'cache_visits' => 'isUnsignedInt', 'cache_pages' => 'isUnsignedInt', 'cache_registrations' => 'isUnsignedInt', + 'cache_orders' => 'isUnsignedInt', 'cache_sales' => 'isOptFloat', 'cache_reg_rate' => 'isOptFloat', 'cache_order_rate' => 'isOptFloat'); + + protected $table = 'referrer'; + protected $identifier = 'id_referrer'; + + protected static $_join = '(r.http_referer_like IS NULL OR r.http_referer_like = \'\' OR cs.http_referer LIKE r.http_referer_like) + AND (r.request_uri_like IS NULL OR r.request_uri_like = \'\' OR cs.request_uri LIKE r.request_uri_like) + AND (r.http_referer_like_not IS NULL OR r.http_referer_like_not = \'\' OR cs.http_referer NOT LIKE r.http_referer_like_not) + AND (r.request_uri_like_not IS NULL OR r.request_uri_like_not = \'\' OR cs.request_uri NOT LIKE r.request_uri_like_not) + AND (r.http_referer_regexp IS NULL OR r.http_referer_regexp = \'\' OR cs.http_referer REGEXP r.http_referer_regexp) + AND (r.request_uri_regexp IS NULL OR r.request_uri_regexp = \'\' OR cs.request_uri REGEXP r.request_uri_regexp) + AND (r.http_referer_regexp_not IS NULL OR r.http_referer_regexp_not = \'\' OR cs.http_referer NOT REGEXP r.http_referer_regexp_not) + AND (r.request_uri_regexp_not IS NULL OR r.request_uri_regexp_not = \'\' OR cs.request_uri NOT REGEXP r.request_uri_regexp_not)'; + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + $fields['passwd'] = pSQL($this->passwd); + $fields['http_referer_regexp'] = pSQL($this->http_referer_regexp, true); + $fields['request_uri_regexp'] = pSQL($this->request_uri_regexp, true); + $fields['http_referer_like'] = pSQL($this->http_referer_like, true); + $fields['request_uri_like'] = pSQL($this->request_uri_like, true); + $fields['http_referer_regexp_not'] = pSQL($this->http_referer_regexp_not, true); + $fields['request_uri_regexp_not'] = pSQL($this->request_uri_regexp_not, true); + $fields['http_referer_like_not'] = pSQL($this->http_referer_like_not, true); + $fields['request_uri_like_not'] = pSQL($this->request_uri_like_not, true); + $fields['base_fee'] = number_format($this->base_fee, 2, '.', ''); + $fields['percent_fee'] = number_format($this->percent_fee, 2, '.', ''); + $fields['click_fee'] = number_format($this->click_fee, 2, '.', ''); + $fields['cache_visitors'] = (int)($this->cache_visitors); + $fields['cache_visits'] = (int)($this->cache_visits); + $fields['cache_pages'] = (int)($this->cache_pages); + $fields['cache_registrations'] = (int)($this->cache_registrations); + $fields['cache_orders'] = (int)($this->cache_orders); + $fields['cache_sales'] = number_format($this->cache_sales, 2, '.', ''); + $fields['cache_reg_rate'] = $this->cache_reg_rate > 1 ? 1 : number_format((float)($this->cache_reg_rate), 4, '.', ''); + $fields['cache_order_rate'] = $this->cache_order_rate > 1 ? 1 : number_format((float)($this->cache_order_rate), 4, '.', ''); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + if (!($result = parent::add($autodate, $nullValues))) + return false; + $this->refreshCache(array(array('id_referrer' => $this->id))); + $this->refreshIndex(array(array('id_referrer' => $this->id))); + return $result; + } + + public static function cacheNewSource($id_connections_source) + { + Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'referrer_cache (id_referrer, id_connections_source) ( + SELECT id_referrer, id_connections_source + FROM '._DB_PREFIX_.'referrer r + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON ('.self::$_join.') + WHERE id_connections_source = '.(int)($id_connections_source).' + )'); + } + + public static function getReferrers($id_customer) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT c.date_add, r.name + FROM '._DB_PREFIX_.'guest g + LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON c.id_connections = cs.id_connections + LEFT JOIN '._DB_PREFIX_.'referrer r ON ('.self::$_join.') + WHERE g.id_customer = '.(int)($id_customer).' + AND r.name IS NOT NULL'); + } + + public function getStatsVisits($id_product = null, $employee = null) + { + list($join, $where) = array('',''); + if ((int)($id_product)) + { + $join = 'LEFT JOIN `'._DB_PREFIX_.'page` p ON cp.`id_page` = p.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type`'; + $where = 'AND pt.`name` = \'product.php\' + AND p.`id_object` = '.(int)($id_product); + } + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT cs.id_connections_source) AS visits, + COUNT(DISTINCT cs.id_connections) as visitors, + COUNT(DISTINCT c.id_guest) as uniqs, + COUNT(DISTINCT cp.time_start) as pages + FROM '._DB_PREFIX_.'referrer_cache rc + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON rc.id_connections_source = cs.id_connections_source + LEFT JOIN '._DB_PREFIX_.'connections c ON cs.id_connections = c.id_connections + LEFT JOIN '._DB_PREFIX_.'connections_page cp ON cp.id_connections = c.id_connections + '.$join.' + WHERE cs.date_add BETWEEN '.ModuleGraph::getDateBetween($employee).' + AND rc.id_referrer = '.(int)($this->id).' + '.$where); + } + + public function getRegistrations($id_product = null, $employee = null) + { + list($join, $where) = array('',''); + if ((int)($id_product)) + { + $join = 'LEFT JOIN '._DB_PREFIX_.'connections_page cp ON cp.id_connections = c.id_connections + LEFT JOIN `'._DB_PREFIX_.'page` p ON cp.`id_page` = p.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type`'; + $where = 'AND pt.`name` = \'product.php\' + AND p.`id_object` = '.(int)($id_product); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT cu.id_customer) AS registrations + FROM '._DB_PREFIX_.'referrer_cache rc + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON rc.id_connections_source = cs.id_connections_source + LEFT JOIN '._DB_PREFIX_.'connections c ON cs.id_connections = c.id_connections + LEFT JOIN '._DB_PREFIX_.'guest g ON g.id_guest = c.id_guest + LEFT JOIN '._DB_PREFIX_.'customer cu ON cu.id_customer = g.id_customer + '.$join.' + WHERE cu.date_add BETWEEN '.ModuleGraph::getDateBetween($employee).' + AND cu.date_add > cs.date_add + AND rc.id_referrer = '.(int)($this->id).' + '.$where); + return $result['registrations']; + } + + public function getStatsSales($id_product = null, $employee = null) + { + list($join, $where) = array('',''); + if ((int)($id_product)) + { + $join = 'LEFT JOIN '._DB_PREFIX_.'order_detail od ON oo.id_order = od.id_order'; + $where = 'AND od.product_id = '.(int)($id_product); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' + SELECT oo.id_order + FROM '._DB_PREFIX_.'referrer_cache rc + INNER JOIN '._DB_PREFIX_.'connections_source cs ON rc.id_connections_source = cs.id_connections_source + INNER JOIN '._DB_PREFIX_.'connections c ON cs.id_connections = c.id_connections + INNER JOIN '._DB_PREFIX_.'guest g ON g.id_guest = c.id_guest + LEFT JOIN '._DB_PREFIX_.'orders oo ON oo.id_customer = g.id_customer + '.$join.' + WHERE oo.invoice_date BETWEEN '.ModuleGraph::getDateBetween($employee).' + AND oo.date_add > cs.date_add + AND rc.id_referrer = '.(int)($this->id).' + AND oo.valid = 1 + '.$where); + + $implode = array(); + foreach ($result as $row) + if ((int)$row['id_order']) + $implode[] = (int)$row['id_order']; + + if ($implode) + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(o.id_order) AS orders, SUM(o.total_paid_real / o.conversion_rate) AS sales + FROM '._DB_PREFIX_.'orders o + WHERE o.id_order IN ('.implode($implode, ',').') + AND o.valid = 1'); + else + return array('orders' => 0, 'sales' => 0); + } + + public static function refreshCache($referrers = null, $employee = null) + { + if (!$referrers OR !is_array($referrers)) + $referrers = Db::getInstance()->ExecuteS('SELECT id_referrer FROM '._DB_PREFIX_.'referrer'); + foreach ($referrers as $row) + { + $referrer = new Referrer((int)($row['id_referrer'])); + $statsVisits = $referrer->getStatsVisits(null, $employee); + $referrer->cache_visitors = $statsVisits['uniqs']; + $referrer->cache_visits = $statsVisits['visits']; + $referrer->cache_pages = $statsVisits['pages']; + $registrations = $referrer->getRegistrations(null, $employee); + $referrer->cache_registrations = (int)($registrations); + $statsSales = $referrer->getStatsSales(null, $employee); + $referrer->cache_orders = (int)($statsSales['orders']); + $referrer->cache_sales = number_format($statsSales['sales'], 2, '.', ''); + $referrer->cache_reg_rate = $statsVisits['uniqs'] ? (int)($registrations) / $statsVisits['uniqs'] : 0; + $referrer->cache_order_rate = $statsVisits['uniqs'] ? (int)($statsSales['orders']) / $statsVisits['uniqs'] : 0; + if (!$referrer->update()) + Tools::dieObject(mysql_error()); + Configuration::updateValue('PS_REFERRERS_CACHE_LIKE', ModuleGraph::getDateBetween($employee)); + Configuration::updateValue('PS_REFERRERS_CACHE_DATE', date('Y-m-d H:i:s')); + } + return true; + } + + public static function refreshIndex($referrers = null) + { + if (!$referrers OR !is_array($referrers)) + { + Db::getInstance()->Execute('TRUNCATE '._DB_PREFIX_.'referrer_cache'); + Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'referrer_cache (id_referrer, id_connections_source) ( + SELECT id_referrer, id_connections_source + FROM '._DB_PREFIX_.'referrer r + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON ('.self::$_join.') + )'); + } + else + foreach ($referrers as $row) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'referrer_cache WHERE id_referrer = '.(int)($row['id_referrer'])); + Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'referrer_cache (id_referrer, id_connections_source) ( + SELECT id_referrer, id_connections_source + FROM '._DB_PREFIX_.'referrer r + LEFT JOIN '._DB_PREFIX_.'connections_source cs ON ('.self::$_join.') + WHERE id_referrer = '.(int)($row['id_referrer']).' + )'); + } + } + + public static function getAjaxProduct($id_referrer, $id_product, $employee = null) + { + $product = new Product($id_product, false, Configuration::get('PS_LANG_DEFAULT')); + $currency = Currency::getCurrencyInstance(Configuration::get('PS_CURRENCY_DEFAULT')); + $referrer = new Referrer($id_referrer); + $statsVisits = $referrer->getStatsVisits($id_product, $employee); + $registrations = $referrer->getRegistrations($id_product, $employee); + $statsSales = $referrer->getStatsSales($id_product, $employee); + + // If it's a product and it has no visits nor orders + if ((int)($id_product) AND !$statsVisits['visits'] AND !$statsSales['orders']) + exit; + + $jsonArray = array(); + $jsonArray[] = 'id_product:\''.(int)($product->id).'\''; + $jsonArray[] = 'product_name:\''.addslashes($product->name).'\''; + $jsonArray[] = 'uniqs:\''.(int)($statsVisits['uniqs']).'\''; + $jsonArray[] = 'visitors:\''.(int)($statsVisits['visitors']).'\''; + $jsonArray[] = 'visits:\''.(int)($statsVisits['visits']).'\''; + $jsonArray[] = 'pages:\''.(int)($statsVisits['pages']).'\''; + $jsonArray[] = 'registrations:\''.(int)($registrations).'\''; + $jsonArray[] = 'orders:\''.(int)($statsSales['orders']).'\''; + $jsonArray[] = 'sales:\''.Tools::displayPrice($statsSales['sales'], $currency).'\''; + $jsonArray[] = 'cart:\''.Tools::displayPrice(((int)($statsSales['orders']) ? $statsSales['sales'] / (int)($statsSales['orders']) : 0), $currency).'\''; + $jsonArray[] = 'reg_rate:\''.number_format((int)($statsVisits['uniqs']) ? (int)($registrations) / (int)($statsVisits['uniqs']) : 0, 4, '.', '').'\''; + $jsonArray[] = 'order_rate:\''.number_format((int)($statsVisits['uniqs']) ? (int)($statsSales['orders']) / (int)($statsVisits['uniqs']) : 0, 4, '.', '').'\''; + $jsonArray[] = 'click_fee:\''.Tools::displayPrice((int)($statsVisits['visits']) * $referrer->click_fee, $currency).'\''; + $jsonArray[] = 'base_fee:\''.Tools::displayPrice($statsSales['orders'] * $referrer->base_fee, $currency).'\''; + $jsonArray[] = 'percent_fee:\''.Tools::displayPrice($statsSales['sales'] * $referrer->percent_fee / 100, $currency).'\''; + die ('[{'.implode(',', $jsonArray).'}]'); + } +} + + diff --git a/classes/Rijndael.php b/classes/Rijndael.php new file mode 100644 index 000000000..90ddc9e69 --- /dev/null +++ b/classes/Rijndael.php @@ -0,0 +1,50 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class RijndaelCore +{ + protected $_key; + protected $_iv; + + public function __construct($key, $iv) + { + $this->_key = $key; + $this->_iv = base64_decode($iv); + } + + // Base64 is not required, but it is be more compact than urlencode + public function encrypt($plaintext) + { + return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->_key, $plaintext, MCRYPT_MODE_ECB, $this->_iv)); + } + + public function decrypt($ciphertext) + { + return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $this->_key, base64_decode($ciphertext), MCRYPT_MODE_ECB, $this->_iv); + } +} + diff --git a/classes/Scene.php b/classes/Scene.php new file mode 100644 index 000000000..69032f799 --- /dev/null +++ b/classes/Scene.php @@ -0,0 +1,243 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SceneCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + /** @var boolean Active Scene */ + public $active = true; + + /** @var array Products */ + public $products; + + protected $table = 'scene'; + protected $identifier = 'id_scene'; + + protected $fieldsRequired = array('active'); + protected $fieldsValidate = array('active' => 'isBool'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 100); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + public function __construct($id = NULL, $id_lang = NULL, $liteResult = true, $hideScenePosition = false) + { + parent::__construct((int)($id), (int)($id_lang)); + + if (!$liteResult) + $this->products = $this->getProducts(true, (int)($id_lang), false); + if ($hideScenePosition) + $this->name = Scene::hideScenePosition($this->name); + } + + public function getFields() + { + parent::validateFields(); + $fields['active'] = (int)($this->active); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + public function update($nullValues = false) + { + if (!$this->updateZoneProducts()) + return false; + if (!$this->updateCategories()) + return false; + return parent::update($nullValues); + } + + public function add($autodate = true, $nullValues = false) + { + $zones = Tools::getValue('zones'); + if ($zones) + $this->addZoneProducts($zones); + $categories = Tools::getValue('categoryBox'); + if ($categories) + $this->addCategories($categories); + + return parent::add($autodate, $nullValues); + } + + public function delete() + { + $this->deleteZoneProducts(); + $this->deleteCategories(); + return parent::delete(); + } + + public function addCategories($categories) + { + $result = true; + foreach ($categories AS $category) + { + if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'scene_category` ( `id_scene` , `id_category`) VALUES ('.(int)($this->id).', '.(int)($category).')')) + $result = false; + } + return $result; + } + + public function deleteCategories() + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'scene_category` + WHERE `id_scene` = '.(int)($this->id)); + } + + public function updateCategories() + { + + if (!$this->deleteCategories()) + return false; + $categories = Tools::getValue('categoryBox'); + if ($categories AND !$this->addCategories($categories)) + return false; + return true; + } + + public function addZoneProducts($zones) + { + $result = true; + foreach ($zones AS $zone) + { + $sql = 'INSERT INTO `'._DB_PREFIX_.'scene_products` ( `id_scene` , `id_product` , `x_axis` , `y_axis` , `zone_width` , `zone_height`) VALUES + ('.(int)($this->id).', '.(int)($zone['id_product']).', '.(int)($zone['x1']).', '.(int)($zone['y1']).', '.(int)($zone['width']).', '.(int)($zone['height']).')'; + if (!Db::getInstance()->Execute($sql)) + $result = false; + } + return $result; + } + + public function deleteZoneProducts() + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'scene_products` + WHERE `id_scene` = '.(int)($this->id)); + } + + public function updateZoneProducts() + { + if (!$this->deleteZoneProducts()) + return false; + $zones = Tools::getValue('zones'); + if ($zones AND !$this->addZoneProducts($zones)) + return false; + return true; + } + + /** + * Get all scenes of a category + * + * @return array Products + */ + static public function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true) + { + $id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang); + + $scenes = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT s.* + FROM `'._DB_PREFIX_.'scene_category` sc + LEFT JOIN `'._DB_PREFIX_.'scene` s ON (sc.id_scene = s.id_scene) + LEFT JOIN `'._DB_PREFIX_.'scene_lang` sl ON (sl.id_scene = s.id_scene) + WHERE sc.id_category = '.(int)($id_category).' AND sl.id_lang = '.(int)($id_lang).($onlyActive ? ' AND s.active = 1' : '').' + ORDER BY sl.name ASC'); + + if (!$liteResult AND $scenes) + foreach($scenes AS &$scene) + $scene = new Scene((int)($scene['id_scene']), (int)($id_lang), false, $hideScenePosition); + return $scenes; + } + + /** + * Get all products of this scene + * + * @return array Products + */ + public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true) + { + global $link; + + $id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang); + + $products = Db::getInstance()->ExecuteS(' + SELECT s.* + FROM `'._DB_PREFIX_.'scene_products` s + LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = s.id_product) + WHERE s.id_scene = '.(int)($this->id).($onlyActive ? ' AND p.active = 1' : '')); + + if (!$liteResult AND $products) + foreach ($products AS &$product) + { + $product['details'] = new Product((int)($product['id_product']), !$liteResult, (int)($id_lang)); + $product['link'] = $link->getProductLink((int)($product['details']->id), $product['details']->link_rewrite, $product['details']->category, $product['details']->ean13); + $cover = Product::getCover((int)($product['details']->id)); + if(is_array($cover)) + $product = array_merge($cover, $product); + } + + return $products; + } + + /** + * Get categories where scene is indexed + * + * @param integer $id_scene Scene id + * @return array Categories where scene is indexed + */ + static public function getIndexedCategories($id_scene) + { + return Db::getInstance()->ExecuteS(' + SELECT `id_category` + FROM `'._DB_PREFIX_.'scene_category` + WHERE `id_scene` = '.(int)($id_scene)); + } + + /** + * Hide scene prefix used for position + * + * @param string $name Scene name + * @return string Name without position + */ + static public function hideScenePosition($name) + { + return preg_replace('/^[0-9]+\./', '', $name); + } + +} + + diff --git a/classes/Search.php b/classes/Search.php new file mode 100644 index 000000000..da9431b95 --- /dev/null +++ b/classes/Search.php @@ -0,0 +1,474 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('PS_SEARCH_MAX_WORD_LENGTH', 15); + +/* Copied from Drupal search module, except for \x{0}-\x{2f} that has been replaced by \x{0}-\x{2c}\x{2e}-\x{2f} in order to keep the char '-' */ +define('PREG_CLASS_SEARCH_EXCLUDE', +'\x{0}-\x{2c}\x{2e}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-'. +'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-'. +'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}'. +'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-'. +'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-'. +'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-'. +'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}'. +'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-'. +'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}'. +'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-'. +'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}'. +'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-'. +'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}'. +'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}'. +'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}'. +'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}'. +'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-'. +'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-'. +'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}'. +'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}'. +'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}'. +'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'. +'\x{3099}-\x{309e}\x{30a0}\x{30fb}\x{30fd}\x{30fe}\x{3190}-\x{319f}\x{31c0}-'. +'\x{31cf}\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}'. +'\x{a806}\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}'. +'\x{fd3f}\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}'. +'\x{ff5b}-\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}'); + +define('PREG_CLASS_NUMBERS', +'\x{30}-\x{39}\x{b2}\x{b3}\x{b9}\x{bc}-\x{be}\x{660}-\x{669}\x{6f0}-\x{6f9}'. +'\x{966}-\x{96f}\x{9e6}-\x{9ef}\x{9f4}-\x{9f9}\x{a66}-\x{a6f}\x{ae6}-\x{aef}'. +'\x{b66}-\x{b6f}\x{be7}-\x{bf2}\x{c66}-\x{c6f}\x{ce6}-\x{cef}\x{d66}-\x{d6f}'. +'\x{e50}-\x{e59}\x{ed0}-\x{ed9}\x{f20}-\x{f33}\x{1040}-\x{1049}\x{1369}-'. +'\x{137c}\x{16ee}-\x{16f0}\x{17e0}-\x{17e9}\x{17f0}-\x{17f9}\x{1810}-\x{1819}'. +'\x{1946}-\x{194f}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2153}-\x{2183}'. +'\x{2460}-\x{249b}\x{24ea}-\x{24ff}\x{2776}-\x{2793}\x{3007}\x{3021}-\x{3029}'. +'\x{3038}-\x{303a}\x{3192}-\x{3195}\x{3220}-\x{3229}\x{3251}-\x{325f}\x{3280}-'. +'\x{3289}\x{32b1}-\x{32bf}\x{ff10}-\x{ff19}'); + +define('PREG_CLASS_PUNCTUATION', +'\x{21}-\x{23}\x{25}-\x{2a}\x{2c}-\x{2f}\x{3a}\x{3b}\x{3f}\x{40}\x{5b}-\x{5d}'. +'\x{5f}\x{7b}\x{7d}\x{a1}\x{ab}\x{b7}\x{bb}\x{bf}\x{37e}\x{387}\x{55a}-\x{55f}'. +'\x{589}\x{58a}\x{5be}\x{5c0}\x{5c3}\x{5f3}\x{5f4}\x{60c}\x{60d}\x{61b}\x{61f}'. +'\x{66a}-\x{66d}\x{6d4}\x{700}-\x{70d}\x{964}\x{965}\x{970}\x{df4}\x{e4f}'. +'\x{e5a}\x{e5b}\x{f04}-\x{f12}\x{f3a}-\x{f3d}\x{f85}\x{104a}-\x{104f}\x{10fb}'. +'\x{1361}-\x{1368}\x{166d}\x{166e}\x{169b}\x{169c}\x{16eb}-\x{16ed}\x{1735}'. +'\x{1736}\x{17d4}-\x{17d6}\x{17d8}-\x{17da}\x{1800}-\x{180a}\x{1944}\x{1945}'. +'\x{2010}-\x{2027}\x{2030}-\x{2043}\x{2045}-\x{2051}\x{2053}\x{2054}\x{2057}'. +'\x{207d}\x{207e}\x{208d}\x{208e}\x{2329}\x{232a}\x{23b4}-\x{23b6}\x{2768}-'. +'\x{2775}\x{27e6}-\x{27eb}\x{2983}-\x{2998}\x{29d8}-\x{29db}\x{29fc}\x{29fd}'. +'\x{3001}-\x{3003}\x{3008}-\x{3011}\x{3014}-\x{301f}\x{3030}\x{303d}\x{30a0}'. +'\x{30fb}\x{fd3e}\x{fd3f}\x{fe30}-\x{fe52}\x{fe54}-\x{fe61}\x{fe63}\x{fe68}'. +'\x{fe6a}\x{fe6b}\x{ff01}-\x{ff03}\x{ff05}-\x{ff0a}\x{ff0c}-\x{ff0f}\x{ff1a}'. +'\x{ff1b}\x{ff1f}\x{ff20}\x{ff3b}-\x{ff3d}\x{ff3f}\x{ff5b}\x{ff5d}\x{ff5f}-'. +'\x{ff65}'); + +/** + * Matches all CJK characters that are candidates for auto-splitting + * (Chinese, Japanese, Korean). + * Contains kana and BMP ideographs. + */ +define('PREG_CLASS_CJK', '\x{3041}-\x{30ff}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}'. +'\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}'); + +class SearchCore +{ + public static function sanitize($string, $id_lang, $indexation = false) + { + $string = Tools::strtolower(strip_tags($string)); + $string = html_entity_decode($string, ENT_NOQUOTES, 'utf-8'); + + $string = preg_replace('/(['.PREG_CLASS_NUMBERS.']+)['.PREG_CLASS_PUNCTUATION.']+(?=['.PREG_CLASS_NUMBERS.'])/u', '\1', $string); + $string = preg_replace('/['.PREG_CLASS_SEARCH_EXCLUDE.']+/u', ' ', $string); + + if ($indexation) + $string = preg_replace('/[._-]+/', '', $string); + else + { + $string = preg_replace('/[._]+/', '', $string); + $string = ltrim(preg_replace('/([^ ])-/', '$1', ' '.$string)); + $string = preg_replace('/[._]+/', '', $string); + $string = preg_replace('/[^\s]-+/', '', $string); + } + + $blacklist = Configuration::get('PS_SEARCH_BLACKLIST', $id_lang); + if (!empty($blacklist)) + { + $string = preg_replace('/(?<=\s)('.$blacklist.')(?=\s)/Su', '', $string); + $string = preg_replace('/^('.$blacklist.')(?=\s)/Su', '', $string); + $string = preg_replace('/(?<=\s)('.$blacklist.')$/Su', '', $string); + $string = preg_replace('/^('.$blacklist.')$/Su', '', $string); + } + + if (!$indexation) + { + $alias = new Alias(NULL, $string); + if (Validate::isLoadedObject($alias)) + $string = $alias->search; + } + + if ($indexation) + { + $minWordLen = (int)Configuration::get('PS_SEARCH_MINWORDLEN'); + if ($minWordLen > 1) + { + $minWordLen -= 1; + $string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}(?=\s)/Su', ' ', $string); + $string = preg_replace('/^[^\s]{1,'.$minWordLen.'}(?=\s)/Su', '', $string); + $string = preg_replace('/(?<=\s)[^\s]{1,'.$minWordLen.'}$/Su', '', $string); + $string = preg_replace('/^[^\s]{1,'.$minWordLen.'}$/Su', '', $string); + } + } + + $string = trim(preg_replace('/\s+/', ' ', $string)); + return $string; + } + + public static function find($id_lang, $expr, $pageNumber = 1, $pageSize = 1, $orderBy = 'position', $orderWay = 'desc', $ajax = false) + { + global $cookie; + $db = Db::getInstance(_PS_USE_SQL_SLAVE_); + + // TODO : smart page management + if ($pageNumber < 1) $pageNumber = 1; + if ($pageSize < 1) $pageSize = 1; + + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die(Tools::displayError()); + + $whereArray = array(); + $scoreArray = array(); + $words = explode(' ', Search::sanitize($expr, $id_lang)); + + foreach ($words AS $key => $word) + if (!empty($word) AND strlen($word) >= (int)Configuration::get('PS_SEARCH_MINWORDLEN')) + { + $word = str_replace('%', '\\%', $word); + $word = str_replace('_', '\\_', $word); + $whereArray[] = ' p.id_product '.($word[0] == '-' ? 'NOT' : '').' IN ( + SELECT id_product + FROM '._DB_PREFIX_.'search_word sw + LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word + WHERE sw.id_lang = '.(int)$id_lang.' + AND sw.word LIKE '.($word[0] == '-' ? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'').' + ) '; + if ($word[0] != '-') + $scoreArray[] = 'sw.word LIKE \''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''; + } + else + unset($words[$key]); + + if (!sizeof($words)) + return ($ajax ? array() : array('total' => 0, 'result' => array())); + + $score = ''; + if (sizeof($scoreArray)) + $score = ',( + SELECT SUM(weight) + FROM '._DB_PREFIX_.'search_word sw + LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word + WHERE sw.id_lang = '.(int)$id_lang.' + AND si.id_product = p.id_product + AND ('.implode(' OR ', $scoreArray).') + ) position'; + + $eligibleProducts = $db->ExecuteS(' + SELECT DISTINCT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = cg.`id_category` + INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category` + INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` + WHERE c.`active` = 1 AND p.`active` = 1 + AND cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN ( + SELECT id_group FROM '._DB_PREFIX_.'customer_group + WHERE id_customer = '.(int)$cookie->id_customer.' + )').' + AND '.implode(' AND ', $whereArray)); + + $productPool = ''; + foreach ($eligibleProducts AS $product) + if (!empty($product['id_product'])) + $productPool .= (int)$product['id_product'].','; + if (empty($productPool)) + return ($ajax ? array() : array('total' => 0, 'result' => array())); + $productPool = ((strpos($productPool, ',') === false) ? (' = '.(int)$productPool.' ') : (' IN ('.rtrim($productPool, ',').') ')); + + if ($ajax) + { + if (!$result = $db->ExecuteS(' + SELECT DISTINCT p.id_product, pl.name pname, cl.name cname, + cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.' + FROM '._DB_PREFIX_.'product p + INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.') + INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)$id_lang.') + WHERE p.`id_product` '.$productPool.' + ORDER BY position DESC LIMIT 10')) + return false; + + return $result; + } + + $queryResults = ' + SELECT SQL_CALC_FOUND_ROWS p.*, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, pa.`id_product_attribute`, + tax.`rate`, i.`id_image`, il.`legend`, m.`name` manufacturer_name '.$score.', DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 new + FROM '._DB_PREFIX_.'product p + INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` tax ON (tax.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND default_on = 1) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + WHERE p.`id_product` '.$productPool.' + '.($orderBy ? 'ORDER BY '.$orderBy : '').($orderWay ? ' '.$orderWay : '').' + LIMIT '.(int)(($pageNumber - 1) * $pageSize).','.(int)$pageSize; + + $result = $db->ExecuteS($queryResults); + $total = $db->getValue('SELECT COUNT(*) + FROM '._DB_PREFIX_.'product p + INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` tax ON (tax.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND default_on = 1) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + WHERE p.`id_product` '.$productPool); + + if (!$result) + $resultProperties = false; + else + $resultProperties = Product::getProductsProperties($id_lang, $result); + + return array('total' => $total,'result' => $resultProperties); + } + + public static function getTags($db, $id_product, $id_lang) + { + $tags = ''; + $tagsArray = $db->ExecuteS(' + SELECT t.name FROM '._DB_PREFIX_.'product_tag pt + LEFT JOIN '._DB_PREFIX_.'tag t ON (pt.id_tag = t.id_tag AND t.id_lang = '.(int)$id_lang.') + WHERE pt.id_product = '.(int)$id_product); + foreach ($tagsArray AS $tag) + $tags .= $tag['name'].' '; + return $tags; + } + + public static function getAttributes($db, $id_product, $id_lang) + { + $attributes = ''; + $attributesArray = $db->ExecuteS(' + SELECT al.name FROM '._DB_PREFIX_.'product_attribute pa + INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute + INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.') + WHERE pa.id_product = '.(int)$id_product); + foreach ($attributesArray AS $attribute) + $attributes .= $attribute['name'].' '; + return $attributes; + } + + public static function getFeatures($db, $id_product, $id_lang) + { + $features = ''; + $featuresArray = $db->ExecuteS(' + SELECT fvl.value FROM '._DB_PREFIX_.'feature_product fp + LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fp.id_feature_value = fvl.id_feature_value AND fvl.id_lang = '.(int)$id_lang.') + WHERE fp.id_product = '.(int)$id_product); + foreach ($featuresArray AS $feature) + $features .= $feature['value'].' '; + return $features; + } + + public static function indexation($full = false) + { + $db = Db::getInstance(); + + if ($full) + { + $db->Execute('TRUNCATE '._DB_PREFIX_.'search_index'); + $db->Execute('TRUNCATE '._DB_PREFIX_.'search_word'); + $db->Execute('UPDATE '._DB_PREFIX_.'product SET indexed = 0'); + } + else + { + $products = $db->ExecuteS('SELECT id_product FROM '._DB_PREFIX_.'product WHERE indexed = 0'); + + $ids = array(); + if ($products) + foreach($products AS $product) + $ids[] = (int)$product['id_product']; + if (sizeof($ids)) + $db->Execute('DELETE FROM '._DB_PREFIX_.'search_index WHERE id_product IN ('.implode(',', $ids).')'); + } + + $weightArray = array( + 'pname' => Configuration::get('PS_SEARCH_WEIGHT_PNAME'), + 'reference' => Configuration::get('PS_SEARCH_WEIGHT_REF'), + 'ean13' => Configuration::get('PS_SEARCH_WEIGHT_REF'), + 'upc' => Configuration::get('PS_SEARCH_WEIGHT_REF'), + 'description_short' => Configuration::get('PS_SEARCH_WEIGHT_SHORTDESC'), + 'description' => Configuration::get('PS_SEARCH_WEIGHT_DESC'), + 'cname' => Configuration::get('PS_SEARCH_WEIGHT_CNAME'), + 'mname' => Configuration::get('PS_SEARCH_WEIGHT_MNAME'), + 'tags' => Configuration::get('PS_SEARCH_WEIGHT_TAG'), + 'attributes' => Configuration::get('PS_SEARCH_WEIGHT_ATTRIBUTE'), + 'features' => Configuration::get('PS_SEARCH_WEIGHT_FEATURE') + ); + + $products = $db->ExecuteS(' + SELECT p.id_product, pl.id_lang, pl.name pname, p.reference, p.ean13, p.upc, pl.description_short, pl.description, cl.name cname, m.name mname + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON p.id_product = pl.id_product + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = p.id_category_default AND pl.id_lang = cl.id_lang) + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON m.id_manufacturer = p.id_manufacturer + WHERE p.indexed = 0', false); + + $countWords = 0; + $countProducts = 0; + $queryArray = array(); + $queryArray2 = array(); + $productsArray = array(); + while ($product = $db->nextRow($products)) + { + $product['tags'] = Search::getTags($db, (int)$product['id_product'], (int)$product['id_lang']); + $product['attributes'] = Search::getAttributes($db, (int)$product['id_product'], (int)$product['id_lang']); + $product['features'] = Search::getFeatures($db, (int)$product['id_product'], (int)$product['id_lang']); + + $pArray = array(); + foreach ($product AS $key => $value) + if (strncmp($key, 'id_', 3)) + { + $words = explode(' ', Search::sanitize($value, (int)$product['id_lang'], true)); + foreach ($words AS $word) + if (!empty($word)) + { + $word = Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH); + if (!isset($pArray[$word])) + $pArray[$word] = $weightArray[$key]; + else + $pArray[$word] += $weightArray[$key]; + } + } + + foreach ($pArray AS $word => $weight) + { + if (!$weight) + continue; + $queryArray[] = '('.(int)$product['id_lang'].',\''.pSQL($word).'\')'; + $queryArray2[] = '('.(int)$product['id_product'].',(SELECT id_word FROM '._DB_PREFIX_.'search_word WHERE word = \''.pSQL($word).'\' AND id_lang = '.(int)$product['id_lang'].' LIMIT 1),'.(int)$weight.')'; + + // Force save every 40 words in order to avoid overloading MySQL + if (++$countWords % 40 == 0) + Search::saveIndex($queryArray, $queryArray2); + } + + if (!in_array($product['id_product'], $productsArray)) + $productsArray[] = (int)$product['id_product']; + + // Force save every 20 products in order to avoid overloading MySQL + if (++$countProducts % 20 == 0) // If you change "20" here, you must change the limit in setProductsAsIndexed() + { + Search::setProductsAsIndexed($productsArray); + $productsArray = array(); + } + } + // One last save is done at the end in order to save what's left + Search::saveIndex($queryArray, $queryArray2); + Search::setProductsAsIndexed($productsArray); + + $db->Execute('DELETE FROM '._DB_PREFIX_.'search_word WHERE id_word NOT IN (SELECT id_word FROM '._DB_PREFIX_.'search_index)'); + return true; + } + + protected static function setProductsAsIndexed(array &$products) + { + if (count($products)) + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET indexed = 1 WHERE id_product IN ('.implode(',', $products).') LIMIT 20'); + } + + // $queryArray and $queryArray2 are automatically emptied in order to be reused immediatly + protected static function saveIndex(array &$queryArray, array &$queryArray2) + { + if (count($queryArray) AND count($queryArray2)) + { + if (!($rows = $db = Db::getInstance()->Execute('INSERT IGNORE INTO '._DB_PREFIX_.'search_word (id_lang, word) VALUES '.implode(',',$queryArray))) OR $rows != count($queryArray)) + Tools::d(array(mysql_error(), $queryArray)); + if (!($rows = $db = Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'search_index (id_product, id_word, weight) VALUES '.implode(',',$queryArray2).' ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)')) OR $rows != sizeof($queryArray2)) + Tools::d(array(mysql_error(), $queryArray2)); + } + $queryArray = array(); + $queryArray2 = array(); + } + + public static function searchTag($id_lang, $tag, $count = false, $pageNumber = 0, $pageSize = 10, $orderBy = false, $orderWay = false) + { + global $link; + + if (!is_numeric($pageNumber) OR !is_numeric($pageSize) OR !Validate::isBool($count) OR !Validate::isValidSearch($tag) + OR $orderBy AND !$orderWay OR ($orderBy AND !Validate::isOrderBy($orderBy)) OR ($orderWay AND !Validate::isOrderBy($orderWay))) + die(Tools::displayError()); + + if ($pageNumber < 1) $pageNumber = 1; + if ($pageSize < 1) $pageSize = 10; + + if ($count) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(pt.`id_product`) nb + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_tag` pt ON (p.`id_product` = pt.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.') + WHERE p.`active` = 1 + AND t.`name` LIKE \'%'.pSQL($tag).'%\''); + return isset($result['nb']) ? $result['nb'] : 0; + } + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.*, pl.`description_short`, pl.`link_rewrite`, pl.`name`, tax.`rate`, i.`id_image`, il.`legend`, m.`name` manufacturer_name, 1 position, + DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 new + FROM `'._DB_PREFIX_.'product` p + INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` tax ON (tax.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) + LEFT JOIN `'._DB_PREFIX_.'product_tag` pt ON (p.`id_product` = pt.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.') + WHERE p.`active` = 1 + AND t.`name` LIKE \'%'.pSQL($tag).'%\' + ORDER BY position DESC'.($orderBy ? ', '.$orderBy : '').($orderWay ? ' '.$orderWay : '').' + LIMIT '.(int)(($pageNumber - 1) * $pageSize).','.(int)$pageSize); + if (!$result) return false; + + return Product::getProductsProperties($id_lang, $result); + } +} diff --git a/classes/SearchEngine.php b/classes/SearchEngine.php new file mode 100644 index 000000000..1dbe51bce --- /dev/null +++ b/classes/SearchEngine.php @@ -0,0 +1,72 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SearchEngineCore extends ObjectModel +{ + public $server; + public $getvar; + + protected $fieldsRequired = array ('server', 'getvar'); + protected $fieldsValidate = array ('server' => 'isUrl', 'getvar' => 'isModuleName'); + + protected $table = 'search_engine'; + protected $identifier = 'id_search_engine'; + + public function getFields() + { + parent::validateFields(); + $fields['server'] = pSQL($this->server); + $fields['getvar'] = pSQL($this->getvar); + return $fields; + } + + public static function getKeywords($url) + { + $parsedUrl = @parse_url($url); + if (!isset($parsedUrl['host']) OR !isset($parsedUrl['query'])) + return false; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `server`, `getvar` FROM `'._DB_PREFIX_.'search_engine`'); + foreach ($result as $index => $row) + { + $host =& $row['server']; + $varname =& $row['getvar']; + if (strstr($parsedUrl['host'], $host)) + { + $kArray = array(); + preg_match('/[^a-z]'.$varname.'=.+\&'.'/U', $parsedUrl['query'], $kArray); + if (empty($kArray[0])) + preg_match('/[^a-z]'.$varname.'=.+$'.'/', $parsedUrl['query'], $kArray); + if (empty($kArray[0])) + return false; + $kString = urldecode(str_replace('+', ' ', ltrim(substr(rtrim($kArray[0], '&'), strlen($varname) + 1), '='))); + return $kString; + } + } + } +} + + diff --git a/classes/Shop.php b/classes/Shop.php new file mode 100644 index 000000000..2722b8f10 --- /dev/null +++ b/classes/Shop.php @@ -0,0 +1,52 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ShopCore extends ObjectModel +{ + public function __construct() + { + + } + + static public function getShops() + { + /*return Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'shops` + ');*/ + return array( + array('id_shop' => 1, 'name' => 'Default shop') + ); + } + + static public function getCurrentShop() + { + // During implementation, remind you to NOT trust the cookie, you may be called from a payment module (Mouhahahaha!) + return 1; + } +} + + diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php new file mode 100644 index 000000000..c65e285ed --- /dev/null +++ b/classes/SpecificPrice.php @@ -0,0 +1,256 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SpecificPriceCore extends ObjectModel +{ + public $id_product; + public $id_shop; + public $id_currency; + public $id_country; + public $id_group; + public $price; + public $from_quantity; + public $reduction; + public $reduction_type; + public $from; + public $to; + + protected $fieldsRequired = array('id_product', 'id_shop', 'id_currency', 'id_country', 'id_group', 'price', 'from_quantity', 'reduction', 'reduction_type', 'from', 'to'); + protected $fieldsValidate = array('id_product' => 'isUnsignedId', 'id_shop' => 'isUnsignedId', 'id_country' => 'isUnsignedId', 'id_group' => 'isUnsignedId', 'price' => 'isPrice', 'from_quantity' => 'isUnsignedInt', 'reduction' => 'isPrice', 'reduction_type' => 'isReductionType', 'from' => 'isDateFormat', 'to' => 'isDateFormat'); + + protected $table = 'specific_price'; + protected $identifier = 'id_specific_price'; + + protected static $_specificPriceCache = array(); + protected static $_cache_priorities = array(); + + public function getFields() + { + parent::validateFields(); + $fields['id_product'] = (int)($this->id_product); + $fields['id_shop'] = (int)($this->id_shop); + $fields['id_currency'] = (int)($this->id_currency); + $fields['id_country'] = (int)($this->id_country); + $fields['id_group'] = (int)($this->id_group); + $fields['price'] = (float)($this->price); + $fields['from_quantity'] = (int)($this->from_quantity); + $fields['reduction'] = (float)($this->reduction); + $fields['reduction_type'] = pSQL($this->reduction_type); + $fields['from'] = pSQL($this->from); + $fields['to'] = pSQL($this->to); + return $fields; + } + + static public function getByProductId($id_product) + { + return Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)($id_product) + ); + } + + static public function getIdsByProductId($id_product) + { + return Db::getInstance()->ExecuteS(' + SELECT `id_specific_price` FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)$id_product.' + '); + } + + // score generation for quantity discount + protected static function _getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group) + { + $select = '('; + + $now = date('Y-m-d H:i:s'); + $select .= ' IF (\''.$now.'\' >= `from` AND \''.$now.'\' <= `to`, '.pow(2, 0).', 0) + '; + + $priority = SpecificPrice::getPriority($id_product); + foreach (array_reverse($priority) AS $k => $field) + $select .= ' IF (`'.$field.'` = '.(int)(${$field}).', '.pow(2, $k + 1).', 0) + '; + + return rtrim($select, ' +').') AS `score`'; + } + + public static function getPriority($id_product) + { + + if (!isset(self::$_cache_priorities[(int)$id_product])) + { + self::$_cache_priorities[(int)$id_product] = Db::getInstance()->getValue(' + SELECT `priority` + FROM `'._DB_PREFIX_.'specific_price_priority` + WHERE `id_product` = '.(int)$id_product); + } + + $priority = self::$_cache_priorities[(int)$id_product]; + + if (!$priority) + $priority = Configuration::get('PS_SPECIFIC_PRICE_PRIORITIES'); + + return preg_split('/;/', $priority); + } + + static public function getSpecificPrice($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity) + { + /* + ** The date is not taken into account for the cache, but this is for the better because it keeps the consistency for the whole script. + ** The price must not change between the top and the bottom of the page + */ + + $key = ((int)$id_product.'-'.(int)$id_shop.'-'.(int)$id_currency.'-'.(int)$id_country.'-'.(int)$id_group.'-'.(int)$quantity); + if (!array_key_exists($key, self::$_specificPriceCache)) + { + $now = date('Y-m-d H:i:s'); + self::$_specificPriceCache[$key] = Db::getInstance()->getRow(' + SELECT *, '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group).' + FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_product` IN (0, '.(int)$id_product.') + AND `id_shop` IN (0, '.(int)$id_shop.') + AND `id_currency` IN (0, '.(int)$id_currency.') + AND `id_country` IN (0, '.(int)$id_country.') + AND `id_group` IN (0, '.(int)$id_group.') + AND `from_quantity` <= '.(int)$quantity.' + AND (`from` = \'0000-00-00 00:00:00\' OR (\''.$now.'\' >= `from` AND \''.$now.'\' <= `to`)) + ORDER BY `score` DESC, `from_quantity` DESC'); + } + return self::$_specificPriceCache[$key]; + } + + static public function setPriorities($priorities) + { + $value = ''; + foreach ($priorities as $priority) + $value .= pSQL($priority).';'; + + SpecificPrice::deletePriorities(); + + return Configuration::updateValue('PS_SPECIFIC_PRICE_PRIORITIES', rtrim($value, ';')); + } + + public static function deletePriorities() + { + return Db::getInstance()->Execute(' + TRUNCATE `'._DB_PREFIX_.'specific_price_priority` + '); + } + + static public function setSpecificPriority($id_product, $priorities) + { + $fields = ''; + $value = ''; + foreach ($priorities as $priority) + $value .= pSQL($priority).';'; + + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'specific_price_priority` (`id_product`, `priority`) + VALUES ('.(int)$id_product.',\''.rtrim($value, ';').'\') + ON DUPLICATE KEY UPDATE `priority` = \''.rtrim($value, ';').'\' + '); + } + + static public function getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group) + { + $now = date('Y-m-d H:i:s'); + $res = Db::getInstance()->ExecuteS(' + SELECT *, + '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group).' + FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_product` IN(0, '.(int)($id_product).') AND + `id_shop` IN(0, '.(int)($id_shop).') AND + `id_currency` IN(0, '.(int)($id_currency).') AND + `id_country` IN(0, '.(int)($id_country).') AND + `id_group` IN(0, '.(int)($id_group).') AND + (`from` = \'0000-00-00 00:00:00\' OR (\''.$now.'\' >= `from` AND \''.$now.'\' <= `to`)) + ORDER BY `score` DESC, `from_quantity` DESC + '); + + $targeted_prices = array(); + $max_score = NULL; + + foreach($res as $specific_price) + { + if (!isset($max_score)) + $max_score = $specific_price['score']; + else if ($max_score != $specific_price['score']) + break; + + if ($specific_price['from_quantity'] > 1) + $targeted_prices[] = $specific_price; + } + + return $targeted_prices; + } + + static public function getQuantityDiscount($id_product, $id_shop, $id_currency, $id_country, $id_group, $quantity) + { + $now = date('Y-m-d H:i:s'); + return Db::getInstance()->getRow(' + SELECT *, + '.self::_getScoreQuery($id_product, $id_shop, $id_currency, $id_country, $id_group).' + FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_product` IN(0, '.(int)($id_product).') AND + `id_shop` IN(0, '.(int)($id_shop).') AND + `id_currency` IN(0, '.(int)($id_currency).') AND + `id_country` IN(0, '.(int)($id_country).') AND + `id_group` IN(0, '.(int)($id_group).') AND + `from_quantity` >= '.(int)($quantity).' AND + (`from` = \'0000-00-00 00:00:00\' OR (\''.$now.'\' >= `from` AND \''.$now.'\' <= `to`)) + ORDER BY `score` DESC, `from_quantity` DESC + '); + } + + static public function getProductIdByDate($id_shop, $id_currency, $id_country, $id_group, $beginning, $ending) + { + $resource = Db::getInstance()->ExecuteS(' + SELECT `id_product` + FROM `'._DB_PREFIX_.'specific_price` + WHERE `id_shop` IN(0, '.(int)($id_shop).') AND + `id_currency` IN(0, '.(int)($id_currency).') AND + `id_country` IN(0, '.(int)($id_country).') AND + `id_group` IN(0, '.(int)($id_group).') AND + `from_quantity` = 1 AND + (`from` = \'0000-00-00 00:00:00\' OR (\''.$beginning.'\' >= `from` AND \''.$ending.'\' <= `to`)) AND + `reduction` > 0 + ', false); + $ids_product = array(); + while ($row = DB::getInstance()->nextRow($resource)) + $ids_product[] = (int)($row['id_product']); + return $ids_product; + } + + static public function deleteByProductId($id_product) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)($id_product)); + } + + public function duplicate($id_product = false) + { + if ($id_product) + $this->id_product = (int)($id_product); + return $this->add(); + } +} + diff --git a/classes/State.php b/classes/State.php new file mode 100644 index 000000000..8843060a0 --- /dev/null +++ b/classes/State.php @@ -0,0 +1,193 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StateCore extends ObjectModel +{ + /** @var integer Country id which state belongs */ + public $id_country; + + /** @var integer Zone id which state belongs */ + public $id_zone; + + /** @var string 2 letters iso code */ + public $iso_code; + + /** @var string Name */ + public $name; + + /** @var boolean Status for delivery */ + public $active = true; + + protected $fieldsRequired = array('id_country', 'id_zone', 'iso_code', 'name'); + protected $fieldsSize = array('iso_code' => 4, 'name' => 32); + protected $fieldsValidate = array('id_country' => 'isUnsignedId', 'id_zone' => 'isUnsignedId', 'iso_code' => 'isStateIsoCode', 'name' => 'isGenericName', 'active' => 'isBool'); + + protected $table = 'state'; + protected $identifier = 'id_state'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_zone' => array('xlink_resource'=> 'zones'), + 'id_country' => array('xlink_resource'=> 'countries') + ), + ); + + public function getFields() + { + parent::validateFields(); + $fields['id_country'] = (int)($this->id_country); + $fields['id_zone'] = (int)($this->id_zone); + $fields['iso_code'] = pSQL(strtoupper($this->iso_code)); + $fields['name'] = pSQL($this->name); + $fields['active'] = (int)($this->active); + return $fields; + } + + public static function getStates($id_lang = false, $active = false) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT `id_state`, `id_country`, `id_zone`, `iso_code`, `name`, `active` + FROM `'._DB_PREFIX_.'state` + '.($active ? 'WHERE active = 1' : '').' + ORDER BY `name` ASC'); + } + + /** + * Get a state name with its ID + * + * @param integer $id_state Country ID + * @return string State name + */ + static public function getNameById($id_state) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name` + FROM `'._DB_PREFIX_.'state` + WHERE `id_state` = '.(int)($id_state)); + + return $result['name']; + } + + /** + * Get a state id with its name + * + * @param string $id_state Country ID + * @return integer state id + */ + static public function getIdByName($state) + { + $result = Db::getInstance()->getRow(' + SELECT `id_state` + FROM `'._DB_PREFIX_.'state` + WHERE `name` LIKE \''.pSQL($state).'\''); + + return ((int)($result['id_state'])); + } + + /** + * Get a state id with its iso code + * + * @param string $iso_code Iso code + * @return integer state id + */ + static public function getIdByIso($iso_code) + { + return Db::getInstance()->getValue(' + SELECT `id_state` + FROM `'._DB_PREFIX_.'state` + WHERE `iso_code` = \''.pSQL($iso_code).'\'' + ); + } + + /** + * Delete a state only if is not in use + * + * @return boolean + */ + public function delete() + { + if (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table)) + die(Tools::displayError()); + + if (!$this->isUsed()) + { + /* Database deletion */ + $result = Db::getInstance()->Execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + if (!$result) + return false; + + /* Database deletion for multilingual fields related to the object */ + if (method_exists($this, 'getTranslationsFieldsChild')) + Db::getInstance()->Execute('DELETE FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + return $result; + } + else + return false; + } + + /** + * Check if a state is used + * + * @return boolean + */ + public function isUsed() + { + return ($this->countUsed() > 0); + } + + /** + * Returns the number of utilisation of a state + * + * @return integer count for this state + */ + public function countUsed() + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(*) AS nb_used + FROM `'._DB_PREFIX_.'address` + WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id)); + return $row['nb_used']; + } + + public static function getStatesByIdCountry($id_country) + { + if (empty($id_country)) + die(Tools::displayError()); + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'state` s + WHERE s.`id_country` = '.(int)$id_country + ); + } + + public static function hasCounties($id_state) + { + return sizeof(County::getCounties((int)$id_state)); + } +} + diff --git a/classes/StockMvt.php b/classes/StockMvt.php new file mode 100755 index 000000000..9d5b61a10 --- /dev/null +++ b/classes/StockMvt.php @@ -0,0 +1,121 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StockMvtCore extends ObjectModel +{ + public $id; + + public $id_product; + public $id_product_attribute = NULL; + public $id_order = NULL; + public $id_employee = NULL; + public $quantity; + public $id_stock_mvt_reason; + + public $date_add; + public $date_upd; + + protected $table = 'stock_mvt'; + protected $identifier = 'id_stock_mvt'; + + + protected $fieldsRequired = array('id_product', 'id_stock_mvt_reason', 'quantity'); + protected $fieldsValidate = array('id_product' => 'isUnsignedId', 'id_product_attribute' => 'isUnsignedId','id_order' => 'isUnsignedId','id_employee' => 'isUnsignedId', + 'quantity' => 'isInt', 'id_stock_mvt_reason' => 'isUnsignedId'); + + protected $webserviceParameters = array( + 'objectNodeNames' => 'stock_movements', + ); + + + + public function getFields() + { + parent::validateFields(); + $fields['id_product'] = (int)$this->id_product; + $fields['id_product_attribute'] = (int)$this->id_product_attribute; + $fields['id_order'] = (int)$this->id_order; + $fields['id_employee'] = (int)$this->id_employee; + $fields['id_stock_mvt_reason'] = (int)$this->id_stock_mvt_reason; + $fields['quantity'] = (int)$this->quantity; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function add($autodate = true, $nullValues = false, $update_quantity = true) + { + if (!parent::add($autodate, $nullValues)) + return false; + if (!$update_quantity) + return true; + + if ($this->id_product_attribute) + { + $product = new Product((int)($this->id_product), false, Configuration::get('PS_LANG_DEFAULT')); + return (Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product_attribute SET quantity=quantity+'.(int)$this->quantity.' + WHERE id_product='.(int)$product->id.' AND id_product_attribute='.(int)$this->id_product_attribute) AND $product->updateQuantityProductWithAttributeQuantity()); + } + else + return Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET quantity=quantity+'.(int)$this->quantity.' WHERE id_product='.(int)$this->id_product); + } + + public static function addMissingMvt($id_employee) + { + $products_without_attributes = Db::getInstance()->ExecuteS('SELECT p.id_product, pa.id_product_attribute, (p.quantity - SUM(IFNULL(sm.quantity, 0))) quantity + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'stock_mvt sm ON (sm.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product = p.id_product) + WHERE pa.id_product_attribute IS NULL + GROUP BY p.id_product'); + + $products_with_attributes = Db::getInstance()->ExecuteS('SELECT p.id_product, pa.id_product_attribute, SUM(pa.quantity) - SUM(IFNULL(sm.quantity, 0)) quantity + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'stock_mvt sm ON (sm.id_product = pa.id_product AND sm.id_product_attribute = pa.id_product_attribute) + WHERE pa.id_product_attribute IS NOT NULL + GROUP BY pa.id_product_attribute'); + + + + $products = array_merge($products_without_attributes, $products_with_attributes); + if ($products) + { + foreach ($products AS $product) + { + if (!$product['quantity']) + continue; + $mvt = new self(); + foreach ($product AS $k => $row) + $mvt->{$k} = $row; + $mvt->id_employee = (int)$id_employee; + $mvt->id_stock_mvt_reason = _STOCK_MOVEMENT_MISSING_REASON_; + $mvt->add(true, false, false); + } + } + } +} diff --git a/classes/StockMvtReason.php b/classes/StockMvtReason.php new file mode 100755 index 000000000..ce580e118 --- /dev/null +++ b/classes/StockMvtReason.php @@ -0,0 +1,71 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StockMvtReasonCore extends ObjectModel +{ + public $id; + public $name; + + public $sign; + + public $date_add; + public $date_upd; + + protected $table = 'stock_mvt_reason'; + protected $identifier = 'id_stock_mvt_reason'; + + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 255); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $webserviceParameters = array( + 'objectNodeNames' => 'stock_movement_reasons', + ); + + public function getFields() + { + parent::validateFields(); + $fields['sign'] = (int)$this->sign; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + static public function getStockMvtReasons($id_lang) + { + return Db::getInstance()->ExecuteS('SELECT smrl.name, smr.id_stock_mvt_reason, smr.sign + FROM '._DB_PREFIX_.'stock_mvt_reason smr + LEFT JOIN '._DB_PREFIX_.'stock_mvt_reason_lang smrl ON (smr.id_stock_mvt_reason = smrl.id_stock_mvt_reason AND smrl.id_lang='.(int)$id_lang.')'); + } +} diff --git a/classes/Store.php b/classes/Store.php new file mode 100644 index 000000000..fcee4786d --- /dev/null +++ b/classes/Store.php @@ -0,0 +1,123 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StoreCore extends ObjectModel +{ + /** @var integer Country id */ + public $id_country; + + /** @var integer State id */ + public $id_state; + + /** @var string Store name */ + public $name; + + /** @var string Address first line */ + public $address1; + + /** @var string Address second line (optional) */ + public $address2; + + /** @var string Postal code */ + public $postcode; + + /** @var string City */ + public $city; + + /** @var float Latitude */ + public $latitude; + + /** @var float Longitude */ + public $longitude; + + /** @var string Store hours (PHP serialized) */ + public $hours; + + /** @var string Phone number */ + public $phone; + + /** @var string Fax number */ + public $fax; + + /** @var string Note */ + public $note; + + /** @var string e-mail */ + public $email; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + /** @var boolean Store status */ + public $active = true; + + protected $fieldsRequired = array('id_country', 'name', 'address1', 'city', 'active'); + protected $fieldsSize = array('name' => 128, 'address1' => 128, 'address2' => 128, 'postcode' => 12, 'city' => 64, 'latitude' => 10, 'longitude' => 10, 'hours' => 254, 'phone' => 16, 'fax' => 16, 'email' => 128, 'note' => 65000); + protected $fieldsValidate = array('id_country' => 'isUnsignedId', 'id_state' => 'isNullOrUnsignedId', 'name' => 'isGenericName', 'address1' => 'isAddress', 'address2' => 'isAddress', + 'city' => 'isCityName', 'latitude' => 'isCoordinate', 'longitude' => 'isCoordinate', 'hours' => 'isSerializedArray', 'phone' => 'isPhoneNumber', 'fax' => 'isPhoneNumber', + 'note' => 'isCleanHtml', 'email' => 'isEmail', 'active' => 'isBool'); + + protected $table = 'store'; + protected $identifier = 'id_store'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_country' => array('xlink_resource'=> 'countries'), + 'id_state' => array('xlink_resource'=> 'states'), + ), + ); + + public function getFields() + { + parent::validateFields(); + + $fields['id_country'] = (int)($this->id_country); + $fields['id_state'] = (int)($this->id_state); + $fields['name'] = pSQL($this->name); + $fields['address1'] = pSQL($this->address1); + $fields['address2'] = pSQL($this->address2); + $fields['postcode'] = pSQL($this->postcode); + $fields['city'] = pSQL($this->city); + $fields['latitude'] = (float)($this->latitude); + $fields['longitude'] = (float)($this->longitude); + $fields['hours'] = pSQL($this->hours); + $fields['phone'] = pSQL($this->phone); + $fields['fax'] = pSQL($this->fax); + $fields['note'] = pSQL($this->note); + $fields['email'] = pSQL($this->email); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['active'] = (int)($this->active); + + return $fields; + } +} + + diff --git a/classes/SubDomain.php b/classes/SubDomain.php new file mode 100644 index 000000000..ba32e6511 --- /dev/null +++ b/classes/SubDomain.php @@ -0,0 +1,56 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SubDomainCore extends ObjectModel +{ + public $name; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 16); + protected $fieldsValidate = array('name' => 'isSubDomainName'); + + protected $table = 'subdomain'; + protected $identifier = 'id_subdomain'; + + public function getFields() + { + parent::validateFields(); + $fields['name'] = pSQL($this->name); + return $fields; + } + + static public function getSubDomains() + { + if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `name` FROM `'._DB_PREFIX_.'subdomain`')) + return false; + $subDomains = array(); + foreach ($result AS $row) + $subDomains[] = $row['name']; + return $subDomains; + } +} + diff --git a/classes/Supplier.php b/classes/Supplier.php new file mode 100644 index 000000000..b4fd2fbfe --- /dev/null +++ b/classes/Supplier.php @@ -0,0 +1,272 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SupplierCore extends ObjectModel +{ + public $id; + + /** @var integer supplier ID */ + public $id_supplier; + + /** @var string Name */ + public $name; + + /** @var string A short description for the discount */ + public $description; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + /** @var string Friendly URL */ + public $link_rewrite; + + /** @var string Meta title */ + public $meta_title; + + /** @var string Meta keywords */ + public $meta_keywords; + + /** @var string Meta description */ + public $meta_description; + + /** @var boolean active */ + public $active; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 64); + protected $fieldsValidate = array('name' => 'isCatalogName'); + + protected $fieldsSizeLang = array('meta_title' => 128, 'meta_description' => 255, 'meta_keywords' => 255); + protected $fieldsValidateLang = array('description' => 'isGenericName', 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName'); + + protected $table = 'supplier'; + protected $identifier = 'id_supplier'; + + protected $webserviceParameters = array( + 'fields' => array( + 'link_rewrite' => array('sqlId' => 'link_rewrite'), + ), + ); + + public function __construct($id = NULL, $id_lang = NULL) + { + parent::__construct($id, $id_lang); + + $this->link_rewrite = $this->getLink(); + } + + public function getLink() + { + return Tools::link_rewrite($this->name, false); + } + + public function getFields() + { + parent::validateFields(); + if (isset($this->id)) + $fields['id_supplier'] = (int)($this->id); + $fields['name'] = pSQL($this->name); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['active'] = (int)($this->active); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('description', 'meta_title', 'meta_keywords', 'meta_description')); + } + + /** + * Return suppliers + * + * @return array Suppliers + */ + static public function getSuppliers($getNbProducts = false, $id_lang = 0, $active = true, $p = false, $n = false, $all_groups = false) + { + global $cookie; + + if (!$id_lang) + $id_lang = Configuration::get('PS_LANG_DEFAULT'); + $query = 'SELECT s.*, sl.`description`'; + $query .= ' FROM `'._DB_PREFIX_.'supplier` as s + LEFT JOIN `'._DB_PREFIX_.'supplier_lang` sl ON (s.`id_supplier` = sl.`id_supplier` AND sl.`id_lang` = '.(int)($id_lang).') + '.($active ? ' WHERE s.`active` = 1 ' : ''); + $query .= ' ORDER BY s.`name` ASC'.($p ? ' LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n) : ''); + $suppliers = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + if ($suppliers === false) + return false; + if ($getNbProducts) + { + $sqlGroups = ''; + if (!$all_groups) + { + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + } + foreach ($suppliers as $key => $supplier) + { + $sql = ' + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'supplier` as m ON (m.`id_supplier`= p.`id_supplier`) + WHERE m.`id_supplier` = '.(int)($supplier['id_supplier']). + ($active ? ' AND p.`active` = 1' : ''). + ($all_groups ? '' :' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + )'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + $suppliers[$key]['nb_products'] = sizeof($result); + } + } + for ($i = 0; $i < sizeof($suppliers); $i++) + if ((int)(Configuration::get('PS_REWRITING_SETTINGS'))) + $suppliers[$i]['link_rewrite'] = Tools::link_rewrite($suppliers[$i]['name'], false); + else + $suppliers[$i]['link_rewrite'] = 0; + return $suppliers; + } + + /** + * Return name from id + * + * @param integer $id_supplier Supplier ID + * @return string name + */ + static protected $cacheName = array(); + static public function getNameById($id_supplier) + { + if (!isset(self::$cacheName[$id_supplier])) + self::$cacheName[$id_supplier] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT `name` FROM `'._DB_PREFIX_.'supplier` WHERE `id_supplier` = '.(int)($id_supplier)); + return self::$cacheName[$id_supplier]; + } + static public function getIdByName($name) + { + $result = Db::getInstance()->getRow(' + SELECT `id_supplier` + FROM `'._DB_PREFIX_.'supplier` + WHERE `name` = \''.pSQL($name).'\''); + if (isset($result['id_supplier'])) + return (int)($result['id_supplier']); + return false; + } + + static public function getProducts($id_supplier, $id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true) + { + if ($p < 1) $p = 1; + if (empty($orderBy) OR $orderBy == 'position') $orderBy = 'name'; + if (empty($orderWay)) $orderWay = 'ASC'; + + if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)) + die (Tools::displayError()); + + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + /* Return only the number of products */ + if ($getTotal) + { + $sql = ' + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.id_supplier = '.(int)($id_supplier) + .($active ? ' AND p.`active` = 1' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + )'; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + return (int)(sizeof($result)); + } + + $sql = ' + SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, s.`name` AS supplier_name, tl.`name` AS tax_name, t.`rate`, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new, + (p.`price` * ((100 + (t.`rate`))/100)) AS orderprice, m.`name` AS manufacturer_name + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) + LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group` + AND tr.`id_country` = '.(int)Country::getDefaultCountryId().' + AND tr.`id_state` = 0) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'supplier` s ON s.`id_supplier` = p.`id_supplier` + LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` + WHERE p.`id_supplier` = '.(int)($id_supplier).($active ? ' AND p.`active` = 1' : '').' + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + ORDER BY '.(($orderBy == 'id_product') ? 'p.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' + LIMIT '.(((int)($p) - 1) * (int)($n)).','.(int)($n); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); + if (!$result) + return false; + if ($orderBy == 'price') + Tools::orderbyPrice($result, $orderWay); + return Product::getProductsProperties($id_lang, $result); + } + + public function getProductsLite($id_lang) + { + return Db::getInstance()->ExecuteS(' + SELECT p.`id_product`, pl.`name` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)($id_lang).') + WHERE p.`id_supplier` = '.(int)($this->id)); + } + /* + * Specify if a supplier already in base + * + * @param $id_supplier Supplier id + * @return boolean + */ + static public function supplierExists($id_supplier) + { + $row = Db::getInstance()->getRow(' + SELECT `id_supplier` + FROM '._DB_PREFIX_.'supplier s + WHERE s.`id_supplier` = '.(int)($id_supplier)); + + return isset($row['id_supplier']); + } +} + diff --git a/classes/Tab.php b/classes/Tab.php new file mode 100644 index 000000000..0112949b6 --- /dev/null +++ b/classes/Tab.php @@ -0,0 +1,234 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TabCore extends ObjectModel +{ + /** @var string Displayed name*/ + public $name; + + /** @var string Class and file name*/ + public $class_name; + + public $module; + + /** @var integer parent ID */ + public $id_parent; + + /** @var integer position */ + public $position; + + protected $fieldsRequired = array('class_name', 'position'); + protected $fieldsSize = array('class_name' => 64, 'module' => 64); + protected $fieldsValidate = array('id_parent' => 'isInt', 'position' => 'isUnsignedInt', 'module' => 'isTabName'); + + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'tab'; + protected $identifier = 'id_tab'; + + protected static $_getIdFromClassName = array(); + + public function getFields() + { + parent::validateFields(); + $fields['id_parent'] = (int)($this->id_parent); + $fields['class_name'] = pSQL($this->class_name); + $fields['module'] = pSQL($this->module); + $fields['position'] = (int)($this->position); + return $fields; + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + public function add($autodate = true, $nullValues = false) + { + $this->position = self::getNbTabs($this->id_parent) + 1; + if (parent::add($autodate, $nullValues)) + return self::initAccess($this->id); + return false; + } + + static public function initAccess($id_tab) + { + /* Cookie's loading */ + global $cookie; + if (!is_object($cookie) OR !$cookie->profile) + return false; + /* Profile selection */ + $profiles = Db::getInstance()->ExecuteS('SELECT `id_profile` FROM '._DB_PREFIX_.'profile'); + if (!$profiles OR empty($profiles)) + return false; + /* Query definition */ + $query = 'INSERT INTO `'._DB_PREFIX_.'access` VALUES '; + foreach ($profiles AS $profile) + { + $rights = (((int)($profile['id_profile']) == 1 OR (int)($profile['id_profile']) == $cookie->profile) ? 1 : 0); + $query .= ($profile === $profiles[0] ? '' : ', ').'('.(int)($profile['id_profile']).', '.(int)($id_tab).', '.$rights.', '.$rights.', '.$rights.', '.$rights.')'; + } + return Db::getInstance()->Execute($query); + } + + public function delete() + { + if (Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'access WHERE `id_tab` = '.(int)($this->id)) AND parent::delete()) + return $this->cleanPositions($this->id_parent); + return false; + } + + /** + * Get tab id + * + * @return integer tab id + */ + static public function getCurrentTabId() + { + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE LOWER(class_name)=\''.pSQL(Tools::strtolower(Tools::getValue('tab'))).'\'')) + return $result['id_tab']; + return -1; + } + + /** + * Get tab parent id + * + * @return integer tab parent id + */ + static public function getCurrentParentId() + { + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT `id_parent` FROM `'._DB_PREFIX_.'tab` WHERE LOWER(class_name)=\''.pSQL(Tools::strtolower(Tools::getValue('tab'))).'\'')) + return $result['id_parent']; + return -1; + } + + /** + * Get tabs + * + * @return array tabs + */ + static public function getTabs($id_lang = false, $id_parent = NULL) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'tab` t + '.($id_lang ? 'LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)($id_lang).')' : ''). + ($id_parent !== NULL ? ('WHERE t.`id_parent` = '.(int)($id_parent)) : '').' + ORDER BY t.`position` ASC'); + } + + /** + * Get tab + * + * @return array tab + */ + static public function getTab($id_lang, $id_tab) + { + /* Tabs selection */ + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'tab` t + LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)($id_lang).') + WHERE t.`id_tab` = '.(int)($id_tab)); + } + + /** + * Get tab id from name + * + * @param string class_name + * @return int id_tab + */ + static public function getIdFromClassName($class_name) + { + if (isset(self::$_getIdFromClassName[$class_name]) AND self::$_getIdFromClassName[$class_name]) + return (int)self::$_getIdFromClassName[$class_name]['id']; + + self::$_getIdFromClassName[$class_name] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT id_tab AS id + FROM `'._DB_PREFIX_.'tab` t + WHERE LOWER(t.`class_name`) = \''.pSQL($class_name).'\''); + + return (int)self::$_getIdFromClassName[$class_name]['id']; + } + + /** + * @deprecated + * @param int $id_tab + */ + static public function getClassNameFromID($id_tab) + { + Tools::displayAsDeprecated(); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT class_name FROM `'._DB_PREFIX_.'tab` t WHERE t.`id_tab` = \''.(int)$id_tab.'\''); + } + + static public function getNbTabs($id_parent = NULL) + { + return (int)Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'tab` t + '.($id_parent !== NULL ? 'WHERE t.`id_parent` = '.(int)$id_parent : '')); + } + + public function move($direction) + { + $nbTabs = self::getNbTabs($this->id_parent); + if ($direction != 'l' AND $direction != 'r') + return false; + if ($nbTabs <= 1) + return false; + if ($direction == 'l' AND $this->position <= 1) + return false; + if ($direction == 'r' AND $this->position >= $nbTabs) + return false; + + $newPosition = ($direction == 'l') ? $this->position - 1 : $this->position + 1; + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'tab` t SET position = '.(int)($this->position).' WHERE id_parent = '.(int)($this->id_parent).' AND position = '.(int)($newPosition)); + $this->position = $newPosition; + return $this->update(); + } + + public function cleanPositions($id_parent) + { + $result = Db::getInstance()->ExecuteS(' + SELECT `id_tab` + FROM `'._DB_PREFIX_.'tab` + WHERE `id_parent` = '.(int)($id_parent).' + ORDER BY `position`'); + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; ++$i) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'tab` + SET `position` = '.($i + 1).' + WHERE `id_tab` = '.(int)($result[$i]['id_tab'])); + return true; + } +} + + diff --git a/classes/Tag.php b/classes/Tag.php new file mode 100644 index 000000000..be11b4ff2 --- /dev/null +++ b/classes/Tag.php @@ -0,0 +1,203 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TagCore extends ObjectModel +{ + /** @var integer Language id */ + public $id_lang; + + /** @var string Name */ + public $name; + + protected $fieldsRequired = array('id_lang', 'name'); + protected $fieldsValidate = array('id_lang' => 'isUnsignedId', 'name' => 'isGenericName'); + + protected $table = 'tag'; + protected $identifier = 'id_tag'; + + protected $webserviceParameters = array( + 'fields' => array( + 'id_lang' => array('xlink_resource' => 'languages'), + ), + ); + + public function __construct($id = NULL, $name = NULL, $id_lang = NULL) + { + if ($id) + parent::__construct($id); + elseif ($name AND Validate::isGenericName($name) AND $id_lang AND Validate::isUnsignedId($id_lang)) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'tag` t + WHERE `name` LIKE \''.pSQL($name).'\' AND `id_lang` = '.(int)($id_lang)); + + if ($row) + { + $this->id = (int)($row['id_tag']); + $this->id_lang = (int)($row['id_lang']); + $this->name = $row['name']; + } + } + } + + public function getFields() + { + parent::validateFields(); + $fields['id_lang'] = (int)($this->id_lang); + $fields['name'] = pSQL($this->name); + return $fields; + } + + public function add($autodate = true, $nullValues = false) + { + if (!parent::add($autodate, $nullValues)) + return false; + elseif (isset($_POST['products'])) + return $this->setProducts(Tools::getValue('products')); + return true; + } + + /** + * Add several tags in database and link it to a product + * + * @param integer $id_lang Language id + * @param integer $id_product Product id to link tags with + * @param string $string Tags separated by commas + * + * @return boolean Operation success + */ + static public function addTags($id_lang, $id_product, $string) + { + if (!Validate::isUnsignedId($id_lang) OR !Validate::isTagsList($string)) + return false; + + $tmpTab = array_unique(array_map('trim', preg_split('/,/', $string, NULL, PREG_SPLIT_NO_EMPTY))); + $list = array(); + foreach ($tmpTab AS $tag) + { + if (!Validate::isGenericName($tag)) + return false; + $tagObj = new Tag(NULL, trim($tag), (int)($id_lang)); + + /* Tag does not exist in database */ + if (!Validate::isLoadedObject($tagObj)) + { + $tagObj->name = trim($tag); + $tagObj->id_lang = (int)($id_lang); + $tagObj->add(); + } + if (!in_array($tagObj->id, $list)) + $list[] = $tagObj->id; + } + $data = ''; + foreach ($list AS $tag) + $data .= '('.(int)($tag).','.(int)($id_product).'),'; + $data = rtrim($data, ','); + + return Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_tag` (`id_tag`, `id_product`) + VALUES '.$data); + } + + static public function getMainTags($id_lang, $nb = 10) + { + $groups = FrontController::getCurrentCustomerGroups(); + $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT t.name, COUNT(pt.id_tag) AS times + FROM `'._DB_PREFIX_.'product_tag` pt + LEFT JOIN `'._DB_PREFIX_.'tag` t ON (t.id_tag = pt.id_tag) + LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = pt.id_product) + WHERE t.`id_lang` = '.(int)($id_lang).' + AND p.`active` = 1 + AND p.`id_product` IN ( + SELECT cp.`id_product` + FROM `'._DB_PREFIX_.'category_group` cg + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) + WHERE cg.`id_group` '.$sqlGroups.' + ) + GROUP BY t.id_tag + ORDER BY times DESC + LIMIT 0, '.(int)($nb)); + } + + static public function getProductTags($id_product) + { + if (!$tmp = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT t.`id_lang`, t.`name` + FROM '._DB_PREFIX_.'tag t + LEFT JOIN '._DB_PREFIX_.'product_tag pt ON (pt.id_tag = t.id_tag) + WHERE pt.`id_product`='.(int)($id_product))) + return false; + $result = array(); + foreach ($tmp AS $tag) + $result[$tag['id_lang']][] = $tag['name']; + return $result; + } + + public function getProducts($associated = true) + { + global $cookie; + $id_lang = $this->id_lang ? $this->id_lang : $cookie->id_lang; + + if (!$this->id AND $associated) + return array(); + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT pl.name, pl.id_product + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.id_product = pl.id_product + WHERE pl.id_lang = '.(int)($id_lang).' + AND p.active = 1 + '.($this->id ? ('AND p.id_product '.($associated ? 'IN' : 'NOT IN').' (SELECT pt.id_product FROM `'._DB_PREFIX_.'product_tag` pt WHERE pt.id_tag = '.(int)($this->id).')') : '').' + ORDER BY pl.name'); + } + + public function setProducts($array) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_tag WHERE id_tag = '.(int)$this->id); + if (is_array($array)) + { + $array = array_map('intval', $array); + $result1 = Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET indexed = 0 WHERE id_product IN ('.implode(',', $array).')'); + $ids = array(); + foreach ($array as $id_product) + $ids[] = '('.(int)$id_product.','.(int)$this->id.')'; + return ($result1 && Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'product_tag (id_product, id_tag) VALUES '.implode(',',$ids)) && Search::indexation(false)); + } + return $result1; + } + + static public function deleteTagsForProduct($id_product) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_tag` WHERE `id_product` = '.(int)($id_product)); + } +} + + diff --git a/classes/Tax.php b/classes/Tax.php new file mode 100644 index 000000000..a7b3a9060 --- /dev/null +++ b/classes/Tax.php @@ -0,0 +1,399 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TaxCore extends ObjectModel +{ + /** @var string Name */ + public $name; + + /** @var float Rate (%) */ + public $rate; + + /** @var bool active state */ + public $active; + + protected $fieldsRequired = array('rate'); + protected $fieldsValidate = array('rate' => 'isFloat'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 32); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'tax'; + protected $identifier = 'id_tax'; + + protected static $_product_country_tax = array(); + protected static $_product_tax_via_rules = array(); + + public $noZeroObject = 'getTaxes'; + + public function getFields() + { + parent::validateFields(); + $fields['rate'] = (float)($this->rate); + $fields['active'] = (int)($this->active); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + public function delete() + { + /* Clean associations */ + TaxRule::deleteTaxRuleByIdTax((int)$this->id); + return parent::delete(); + } + + /** + * @deprecated zones are not related to a tax + */ + public static function checkTaxZone($id_tax, $id_zone) + { + Tools::displayAsDeprecated(); + return true; + } + + /** + * @deprecated states are not related to a tax. Check TaxRules. + */ + public function getStates() + { + Tools::displayAsDeprecated(); + return false; + } + + /** + * @deprecated states are not related to a tax. Check TaxRules. + */ + public function getState($id_state) + { + Tools::displayAsDeprecated(); + return false; + } + + /** + * @deprecated states are not related to a tax. Check TaxRules. + */ + public function addState($id_state) + { + Tools::displayAsDeprecated(); + return true; + } + + + /** + * @deprecated states are not related to a tax. Check TaxRules. + */ + public function deleteState($id_state) + { + Tools::displayAsDeprecated(); + return true; + } + + /** + * Get all zones + * + * @return array Zones + * @deprecated zones are not related to a tax + */ + public function getZones() + { + Tools::displayAsDeprecated(); + return false; + } + + /** + * Get a specific zones + * + * @return array Zone + * @deprecated zones are not related to a tax + */ + public function getZone($id_zone) + { + Tools::displayAsDeprecated(); + return false; + } + + /** + * Add zone + * @deprecated zones are not related to a tax + */ + public function addZone($id_zone) + { + Tools::displayAsDeprecated(); + return true; + } + + /** + * Delete zone + * @deprecated zones are not related to a tax + */ + public function deleteZone($id_zone) + { + Tools::displayAsDeprecated(); + return true; + } + + /** + * Get all available taxes + * + * @return array Taxes + */ + static public function getTaxes($id_lang = false, $active = 1) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT t.id_tax, t.rate'.((int)($id_lang) ? ', tl.name, tl.id_lang ' : '').' + FROM `'._DB_PREFIX_.'tax` t + '.((int)($id_lang) ? 'LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)($id_lang).')' + .($active == 1 ? 'WHERE t.`active` = 1' : '').' + ORDER BY `name` ASC' : '')); + } + + static public function excludeTaxeOption() + { + return !Configuration::get('PS_TAX'); + } + + /* + * @deprecated zones are not related to a tax + */ + static public function zoneHasTax($id_tax, $id_zone) + { + Tools::displayAsDeprecated(); + return true; + } + + + + /** + * @deprecated states are not related to a tax. Check TaxRules. + */ + static public function getRateByState($id_state, $active = 1) + { + Tools::displayAsDeprecated(); + return false; + } + + /** + * Return the applicable tax rate depending of the country and state + * @deprecated use getApplicableTaxRate + * @param integer $id_tax + * @param float $productTax + * @param integer $id_address + * + * @return float taxe_rate + */ + static public function getApplicableTax($id_tax, $productTax, $id_address = NULL) + { + Tools::displayAsDeprecated(); + return Tax::getApplicableTaxRate($id_tax, $productTax, $id_address); + } + + /** + * Return the applicable tax rate depending of the country and state + * + * @param integer $id_tax + * @param float $productTax + * @param integer $id_address + * + * @return float taxe_rate + */ + public static function getApplicableTaxRate($id_tax, $productTax, $id_address = NULL) + { + Tools::displayAsDeprecated(); + global $cart, $cookie, $defaultCountry; + + return $productTax; + } + + static public function getTaxIdByRate($rate, $active = 1) + { + Tools::displayAsDeprecated(); + $tax = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT t.`id_tax` + FROM `'._DB_PREFIX_.'tax` t + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.id_tax = tl.id_tax) + WHERE t.`rate` = '.(float)($rate). + ($active == 1 ? ' AND t.`active` = 1' : '')); + return $tax ? (int)($tax['id_tax']) : false; + } + + public static function getTaxIdByName($tax_name, $active =1) + { + $tax = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT t.`id_tax` + FROM `'._DB_PREFIX_.'tax` t + LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.id_tax = t.id_tax) + WHERE tl.`name` = \''.pSQL($tax_name).'\' '. + ($active == 1 ? ' AND t.`active` = 1' : '')); + + return $tax ? (int)($tax['id_tax']) : false; + } + + static public function getDataByProductId($id_product) + { + Tools::displayAsDeprecated(); + + $tax_rate = Tax::getProductTaxRate((int)$id_product); + $id_tax = Tax::getTaxIdByRate($tax_rate); + + return array('id_tax' => $id_tax, 'rate' => $tax_rate); + } + + /** + * Return the product tax + * + * @param integer $id_product + * @param integer $id_country + * @return Tax + */ + public static function getProductTaxRate($id_product, $id_address = NULL) + { + $id_country = (int)Country::getDefaultCountryId(); + $id_state = 0; + $id_county = 0; + $rate = 0; + if (!empty($id_address)) + { + $address_infos = Address::getCountryAndState($id_address); + if ($address_infos['id_country']) + { + $id_country = (int)($address_infos['id_country']); + $id_state = (int)$address_infos['id_state']; + $id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']); + } + + if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) + return 0; + } + + if ($rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county)) + return $rate; + + return $rate; + } + + public static function getProductEcotaxRate($id_address = NULL) + { + $id_country = (int)Country::getDefaultCountryId(); + $id_state = 0; + $id_county = 0; + $rate = 0; + if (!empty($id_address)) + { + $address_infos = Address::getCountryAndState($id_address); + if ($address_infos['id_country']) + { + $id_country = (int)($address_infos['id_country']); + $id_state = (int)$address_infos['id_state']; + $id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']); + } + + if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) + return 0; + } + + if ($rate = TaxRulesGroup::getTaxesRate((int)Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'), (int)$id_country, (int)$id_state, (int)$id_county)) + return $rate; + + return $rate; + } + + /** + * Return the product tax rate using the tax rules system + * + * @param integer $id_product + * @param integer $id_country + * @return Tax + */ + public static function getProductTaxRateViaRules($id_product, $id_country, $id_state, $id_county) + { + if (!isset(self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$id_state.'-'.$id_county])) + { + $tax_rate = TaxRulesGroup::getTaxesRate((int)Product::getIdTaxRulesGroupByIdProduct((int)$id_product), (int)$id_country, (int)$id_state, (int)$id_county); + self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$id_county] = $tax_rate; + } + + return self::$_product_tax_via_rules[$id_product.'-'.$id_country.'-'.$id_county]; + } + + + public static function getCarrierTaxRate($id_carrier, $id_address = NULL) + { + $id_country = (int)Country::getDefaultCountryId(); + $id_state = 0; + $id_county = 0; + if (!empty($id_address)) + { + $address_infos = Address::getCountryAndState($id_address); + if ($address_infos['id_country']) + { + $id_country = (int)($address_infos['id_country']); + $id_state = (int)$address_infos['id_state']; + $id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']); + } + + if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) + return 0; + } + + return TaxRulesGroup::getTaxesRate((int)Carrier::getIdTaxRulesGroupByIdCarrier((int)$id_carrier), (int)$id_country, (int)$id_state, (int)$id_county); + } + + public function toggleStatus() + { + if (parent::toggleStatus()) + return $this->_onStatusChange(); + + return false; + } + + public function update($nullValues = false) + { + if (parent::update($nullValues)) + return $this->_onStatusChange(); + + return false; + } + + protected function _onStatusChange() + { + if (!$this->active) + return TaxRule::deleteTaxRuleByIdTax($this->id); + + return true; + } +} + diff --git a/classes/TaxRule.php b/classes/TaxRule.php new file mode 100644 index 000000000..b5fae456e --- /dev/null +++ b/classes/TaxRule.php @@ -0,0 +1,111 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TaxRuleCore extends ObjectModel +{ + public $id_tax_rules_group; + public $id_country; + public $id_state; + public $id_county; + public $id_tax; + public $state_behavior; + public $county_behavior; + + protected $fieldsRequired = array('id_tax_rules_group', 'id_country', 'id_tax'); + protected $fieldsValidate = array('id_tax_rules_group' => 'isUnsignedId', 'id_country' => 'isUnsignedId', 'id_state' => 'isUnsignedId', 'id_county' => 'isUnsignedId', 'id_tax' => 'isUnsignedId', 'state_behavior' => 'isUnsignedInt', 'county_behavior' => 'isUnsignedInt'); + + protected $table = 'tax_rule'; + protected $identifier = 'id_tax_rule'; + + public function getFields() + { + parent::validateFields(); + $fields['id_tax_rules_group'] = (int)($this->id_tax_rules_group); + $fields['id_country'] = (int)$this->id_country; + $fields['id_state'] = (int)$this->id_state; + $fields['id_county'] = (int)$this->id_county; + $fields['state_behavior'] = (int)$this->state_behavior; + $fields['county_behavior'] = (int)$this->county_behavior; + $fields['id_tax'] = (int)($this->id_tax); + + return $fields; + } + + public static function deleteByGroupId($id_group) + { + if (empty($id_group)) + die(Tools::displayError()); + + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'tax_rule` + WHERE `id_tax_rules_group` = '.(int)$id_group + ); + } + + public static function getTaxRulesByGroupId($id_group) + { + if (empty($id_group)) + die(Tools::displayError()); + + $results = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rule` + WHERE `id_tax_rules_group` = '.(int)$id_group + ); + + $res = array(); + foreach ($results AS $row) + $res[$row['id_country']][$row['id_state']][$row['id_county']] = array('id_tax' => $row['id_tax'], 'state_behavior' => $row['state_behavior'], 'county_behavior' => $row['county_behavior']); + + return $res; + } + + public static function deleteTaxRuleByIdTax($id_tax) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'tax_rule` + WHERE `id_tax` = '.(int)$id_tax + ); + } + + + public static function deleteTaxRuleByIdCounty($id_county) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'tax_rule` + WHERE `id_county` = '.(int)$id_county + ); + } + + public static function isTaxInUse($id_tax) + { + return Db::getInstance()->getValue(' + SELECT COUNT(*) FROM `'._DB_PREFIX_.'tax_rule` WHERE `id_tax` = '.(int)$id_tax + ); + } +} + diff --git a/classes/TaxRulesGroup.php b/classes/TaxRulesGroup.php new file mode 100644 index 000000000..f970bb3e0 --- /dev/null +++ b/classes/TaxRulesGroup.php @@ -0,0 +1,166 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +class TaxRulesGroupCore extends ObjectModel +{ + public $name; + + /** @var bool active state */ + public $active; + + protected $fieldsRequired = array('name'); + protected $fieldsSize = array('name' => 64); + protected $fieldsValidate = array('name' => 'isGenericName'); + + protected $table = 'tax_rules_group'; + protected $identifier = 'id_tax_rules_group'; + + protected static $_taxes = array(); + + public function getFields() + { + parent::validateFields(); + $fields['name'] = ($this->name); + $fields['active'] = (int)($this->active); + return $fields; + } + + public static function getTaxRulesGroups($only_active = true) + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .($only_active ? ' WHERE g.`active` = 1' : '') + ); + } + + public static function getTaxRulesGroupsForOptions() + { + $tax_rules[] = array('id_tax_rules_group' => 0, 'name' => Tools::displayError('No tax')); + return array_merge($tax_rules, TaxRulesGroup::getTaxRulesGroups()); + } + + public static function getTaxes($id_tax_rules_group, $id_country, $id_state, $id_county) + { + if (empty($id_tax_rules_group) OR empty($id_country)) + return array(new Tax()); // No Tax + + if (isset(self::$_taxes[$id_tax_rules_group.'-'.$id_country.'-'.$id_state.'-'.$id_county])) + return self::$_taxes[$id_tax_rules_group.'-'.$id_country.'-'.$id_state.'-'.$id_county]; + + $rows = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rule` + WHERE `id_country` = '.(int)$id_country.' + AND `id_tax_rules_group` = '.(int)$id_tax_rules_group.' + AND `id_state` IN (0, '.(int)$id_state.') + AND `id_county` IN (0, '.(int)$id_county.') + ORDER BY `id_county` DESC, `id_state` DESC' + ); + + + $taxes = array(); + foreach ($rows AS $row) + { + if ($row['id_county'] != 0) + { + switch($row['county_behavior']) + { + case County::USE_BOTH_TAX: + $taxes[] = new Tax($row['id_tax']); + break; + + case County::USE_COUNTY_TAX: + $taxes = array(new Tax($row['id_tax'])); + break 2; + + case County::USE_STATE_TAX: // do nothing + break; + } + } + else if ($row['id_state'] != 0) + { + switch($row['state_behavior']) + { + case PS_STATE_TAX: // use only product tax + $taxes[] = new Tax($row['id_tax']); + break 2; // switch + foreach + + case PS_BOTH_TAX: + $taxes[] = new Tax($row['id_tax']); + break; + + case PS_PRODUCT_TAX: // do nothing use country tax + break; + } + } + else + $taxes[] = new Tax((int)$row['id_tax']); + } + + self::$_taxes[$id_tax_rules_group.'-'.$id_country.'-'.$id_state.'-'.$id_county] = $taxes; + return $taxes; + } + + public static function getAssociatedTaxRatesByIdCountry($id_country) + { + $rows = Db::getInstance()->ExecuteS(' + SELECT rg.`id_tax_rules_group`, t.`rate` + FROM `'._DB_PREFIX_.'tax_rules_group` rg + LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (tr.`id_tax_rules_group` = rg.`id_tax_rules_group`) + LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`) + WHERE tr.`id_country` = '.(int)$id_country.' + AND tr.`id_state` = 0 + AND tr.`id_county` = 0' + ); + + $res = array(); + foreach ($rows AS $row) + $res[$row['id_tax_rules_group']] = $row['rate']; + + return $res; + } + + public static function getTaxesRate($id_tax_rules_group, $id_country, $id_state, $id_county) + { + $rate = 0; + foreach (TaxRulesGroup::getTaxes($id_tax_rules_group, $id_country, $id_state, $id_county) AS $tax) + $rate += (float)$tax->rate; + + return $rate; + } + + public static function getIdByName($name) + { + return Db::getInstance()->getValue( + 'SELECT `id_tax_rules_group` + FROM `'._DB_PREFIX_.'tax_rules_group` rg + WHERE `name` = \''.pSQL($name).'\'' + ); + } +} \ No newline at end of file diff --git a/classes/Tools.php b/classes/Tools.php new file mode 100644 index 000000000..b658603af --- /dev/null +++ b/classes/Tools.php @@ -0,0 +1,1880 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ToolsCore +{ + protected static $file_exists_cache = array(); + protected static $_forceCompile; + protected static $_caching; + + /** + * Random password generator + * + * @param integer $length Desired length (optional) + * @return string Password + */ + public static function passwdGen($length = 8) + { + $str = 'abcdefghijkmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + for ($i = 0, $passwd = ''; $i < $length; $i++) + $passwd .= self::substr($str, mt_rand(0, self::strlen($str) - 1), 1); + return $passwd; + } + + /** + * Redirect user to another page + * + * @param string $url Desired URL + * @param string $baseUri Base URI (optional) + */ + public static function redirect($url, $baseUri = __PS_BASE_URI__) + { + if (strpos($url, 'http://') === FALSE) + { + global $link; + if (strpos($url, $baseUri) !== FALSE && strpos($url, $baseUri) == 0) + $url = substr($url, strlen($baseUri)); + $explode = explode('?', $url); + $url = $link->getPageLink($explode[0], true); + if (isset($explode[1])) + $url .= '?'.$explode[1]; + $baseUri = ''; + } + + if (isset($_SERVER['HTTP_REFERER']) AND ($url == $_SERVER['HTTP_REFERER'])) + header('Location: '.$_SERVER['HTTP_REFERER']); + else + header('Location: '.$baseUri.$url); + exit; + } + + /** + * Redirect url wich allready PS_BASE_URI + * + * @param string $url Desired URL + */ + public static function redirectLink($url) + { + if (!preg_match('@^https?://@i', $url)) + { + global $link; + if (strpos($url, __PS_BASE_URI__) !== FALSE && strpos($url, __PS_BASE_URI__) == 0) + $url = substr($url, strlen(__PS_BASE_URI__)); + $explode = explode('?', $url); + $url = $link->getPageLink($explode[0]); + if (isset($explode[1])) + $url .= '?'.$explode[1]; + } + + header('Location: '.$url); + exit; + } + + /** + * Redirect user to another admin page + * + * @param string $url Desired URL + */ + public static function redirectAdmin($url) + { + header('Location: '.$url); + exit; + } + + /** + * getProtocol return the set protocol according to configuration (http[s]) + * @param Boolean true if require ssl + * @return String (http|https) + */ + public static function getProtocol($use_ssl = null) + { + return (!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://'); + } + + /** + * getHttpHost return the current host used, with the protocol (http or https) if $http is true + * This function should not be used to choose http or https domain name. + * Use Tools::getShopDomain() or Tools::getShopDomainSsl instead + * + * @param boolean $http + * @param boolean $entities + * @return void + */ + public static function getHttpHost($http = false, $entities = false) + { + $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); + if ($entities) + $host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8'); + if ($http) + $host = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$host; + return $host; + } + + /** + * getShopDomain return domain name according to configuration + * + * @param boolean $http if true, return domain name with protocol + * @param boolean $entities if true, + * @return void + */ + public static function getShopDomain($http = false, $entities = false) + { + if (!($domain = Configuration::get('PS_SHOP_DOMAIN'))) + $domain = self::getHttpHost(); + if ($entities) + $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8'); + if ($http) + $domain = 'http://'.$domain; + return $domain; + } + + public static function getShopDomainSsl($http = false, $entities = false) + { + if (!($domain = Configuration::get('PS_SHOP_DOMAIN_SSL'))) + $domain = self::getHttpHost(); + if ($entities) + $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8'); + if ($http) + $domain = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$domain; + return $domain; + } + + /** + * Get the server variable SERVER_NAME + * + * @param string $referrer URL referrer + */ + static function getServerName() + { + if (isset($_SERVER['HTTP_X_FORWARDED_SERVER']) AND $_SERVER['HTTP_X_FORWARDED_SERVER']) + return $_SERVER['HTTP_X_FORWARDED_SERVER']; + return $_SERVER['SERVER_NAME']; + } + + /** + * Get the server variable REMOTE_ADDR + * + * @param string $remote_addr ip of client + */ + static function getRemoteAddr() + { + if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR']) + { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) + { + $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); + return $ips[0]; + } + else + return $_SERVER['HTTP_X_FORWARDED_FOR']; + } + return $_SERVER['REMOTE_ADDR']; + } + + /** + * Secure an URL referrer + * + * @param string $referrer URL referrer + */ + public static function secureReferrer($referrer) + { + if (preg_match('/^http[s]?:\/\/'.self::getServerName().'(:'._PS_SSL_PORT_.')?\/.*$/Ui', $referrer)) + return $referrer; + return __PS_BASE_URI__; + } + + /** + * Get a value from $_POST / $_GET + * if unavailable, take a default value + * + * @param string $key Value key + * @param mixed $defaultValue (optional) + * @return mixed Value + */ + public static function getValue($key, $defaultValue = false) + { + if (!isset($key) OR empty($key) OR !is_string($key)) + return false; + $ret = (isset($_POST[$key]) ? $_POST[$key] : (isset($_GET[$key]) ? $_GET[$key] : $defaultValue)); + + if (is_string($ret) === true) + $ret = urldecode(preg_replace('/((\%5C0+)|(\%00+))/i', '', urlencode($ret))); + return !is_string($ret)? $ret : stripslashes($ret); + } + + public static function getIsset($key) + { + if (!isset($key) OR empty($key) OR !is_string($key)) + return false; + return isset($_POST[$key]) ? true : (isset($_GET[$key]) ? true : false); + } + + /** + * Change language in cookie while clicking on a flag + */ + public static function setCookieLanguage() + { + global $cookie; + + /* If language does not exist or is disabled, erase it */ + if ($cookie->id_lang) + { + $lang = new Language((int)$cookie->id_lang); + if (!Validate::isLoadedObject($lang) OR !$lang->active) + $cookie->id_lang = NULL; + } + + /* Automatically detect language if not already defined */ + if (!$cookie->id_lang AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + $array = explode(',', self::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); + if (self::strlen($array[0]) > 2) + { + $tab = explode('-', $array[0]); + $string = $tab[0]; + } + else + $string = $array[0]; + if (Validate::isLanguageIsoCode($string)) + { + $lang = new Language((int)(Language::getIdByIso($string))); + if (Validate::isLoadedObject($lang) AND $lang->active) + $cookie->id_lang = (int)($lang->id); + } + } + + /* If language file not present, you must use default language file */ + if (!$cookie->id_lang OR !Validate::isUnsignedId($cookie->id_lang)) + $cookie->id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + + $iso = Language::getIsoById((int)$cookie->id_lang); + @include_once(_PS_THEME_DIR_.'lang/'.$iso.'.php'); + + return $iso; + } + + public static function switchLanguage() + { + global $cookie; + + if ($id_lang = (int)(self::getValue('id_lang')) AND Validate::isUnsignedId($id_lang)) + $cookie->id_lang = $id_lang; + } + + public static function setCurrency() + { + global $cookie; + + if (self::isSubmit('SubmitCurrency')) + if (isset($_POST['id_currency']) AND is_numeric($_POST['id_currency'])) + { + $currency = Currency::getCurrencyInstance((int)($_POST['id_currency'])); + if (is_object($currency) AND $currency->id AND !$currency->deleted) + $cookie->id_currency = (int)($currency->id); + } + + if ((int)$cookie->id_currency) + { + $currency = Currency::getCurrencyInstance((int)$cookie->id_currency); + if (is_object($currency) AND (int)$currency->id AND (int)$currency->deleted != 1 AND $currency->active) + return $currency; + } + $currency = Currency::getCurrencyInstance((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + if (is_object($currency) AND $currency->id) + $cookie->id_currency = (int)($currency->id); + return $currency; + } + + /** + * Return price with currency sign for a given product + * + * @param float $price Product price + * @param object $currency Current currency (object, id_currency, NULL => getCurrent()) + * @return string Price correctly formated (sign, decimal separator...) + */ + public static function displayPrice($price, $currency = NULL, $no_utf8 = false) + { + if ($currency === NULL) + $currency = Currency::getCurrent(); + /* if you modified this function, don't forget to modify the Javascript function formatCurrency (in tools.js) */ + if (is_int($currency)) + $currency = Currency::getCurrencyInstance((int)($currency)); + $c_char = (is_array($currency) ? $currency['sign'] : $currency->sign); + $c_format = (is_array($currency) ? $currency['format'] : $currency->format); + $c_decimals = (is_array($currency) ? (int)($currency['decimals']) : (int)($currency->decimals)) * _PS_PRICE_DISPLAY_PRECISION_; + $c_blank = (is_array($currency) ? $currency['blank'] : $currency->blank); + $blank = ($c_blank ? ' ' : ''); + $ret = 0; + if (($isNegative = ($price < 0))) + $price *= -1; + $price = self::ps_round($price, $c_decimals); + switch ($c_format) + { + /* X 0,000.00 */ + case 1: + $ret = $c_char.$blank.number_format($price, $c_decimals, '.', ','); + break; + /* 0 000,00 X*/ + case 2: + $ret = number_format($price, $c_decimals, ',', ' ').$blank.$c_char; + break; + /* X 0.000,00 */ + case 3: + $ret = $c_char.$blank.number_format($price, $c_decimals, ',', '.'); + break; + /* 0,000.00 X */ + case 4: + $ret = number_format($price, $c_decimals, '.', ',').$blank.$c_char; + break; + } + if ($isNegative) + $ret = '-'.$ret; + if ($no_utf8) + return str_replace('€', chr(128), $ret); + return $ret; + } + + public static function displayPriceSmarty($params, &$smarty) + { + if (array_key_exists('currency', $params)) + { + $currency = Currency::getCurrencyInstance((int)($params['currency'])); + if (Validate::isLoadedObject($currency)) + return self::displayPrice($params['price'], $currency, false); + } + return self::displayPrice($params['price']); + } + + /** + * Return price converted + * + * @param float $price Product price + * @param object $currency Current currency object + * @param boolean $to_currency convert to currency or from currency to default currency + */ + public static function convertPrice($price, $currency = NULL, $to_currency = true) + { + if ($currency === NULL) + $currency = Currency::getCurrent(); + elseif (is_numeric($currency)) + $currency = Currency::getCurrencyInstance($currency); + + $c_id = (is_array($currency) ? $currency['id_currency'] : $currency->id); + $c_rate = (is_array($currency) ? $currency['conversion_rate'] : $currency->conversion_rate); + + if ($c_id != (int)(Configuration::get('PS_CURRENCY_DEFAULT'))) + { + if ($to_currency) + $price *= $c_rate; + else + $price /= $c_rate; + } + + return $price; + } + + + + /** + * Display date regarding to language preferences + * + * @param array $params Date, format... + * @param object $smarty Smarty object for language preferences + * @return string Date + */ + public static function dateFormat($params, &$smarty) + { + return self::displayDate($params['date'], $smarty->ps_language->id, (isset($params['full']) ? $params['full'] : false)); + } + + /** + * Display date regarding to language preferences + * + * @param string $date Date to display format UNIX + * @param integer $id_lang Language id + * @param boolean $full With time or not (optional) + * @return string Date + */ + public static function displayDate($date, $id_lang, $full = false, $separator='-') + { + if (!$date OR !strtotime($date)) + return $date; + if (!Validate::isDate($date) OR !Validate::isBool($full)) + die (self::displayError('Invalid date')); + $tmpTab = explode($separator, substr($date, 0, 10)); + $hour = ' '.substr($date, -8); + + $language = Language::getLanguage((int)($id_lang)); + if ($language AND strtolower($language['iso_code']) == 'fr') + return ($tmpTab[2].'-'.$tmpTab[1].'-'.$tmpTab[0].($full ? $hour : '')); + else + return ($tmpTab[0].'-'.$tmpTab[1].'-'.$tmpTab[2].($full ? $hour : '')); + } + + /** + * Sanitize a string + * + * @param string $string String to sanitize + * @param boolean $full String contains HTML or not (optional) + * @return string Sanitized string + */ + public static function safeOutput($string, $html = false) + { + if (!$html) + $string = @htmlentities(strip_tags($string), ENT_QUOTES, 'utf-8'); + return $string; + } + + public static function htmlentitiesUTF8($string, $type = ENT_QUOTES) + { + if (is_array($string)) + return array_map(array('Tools', 'htmlentitiesUTF8'), $string); + return htmlentities($string, $type, 'utf-8'); + } + + public static function htmlentitiesDecodeUTF8($string) + { + if (is_array($string)) + return array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $string); + return html_entity_decode($string, ENT_QUOTES, 'utf-8'); + } + + public static function safePostVars() + { + $_POST = array_map(array('Tools', 'htmlentitiesUTF8'), $_POST); + } + + /** + * Delete directory and subdirectories + * + * @param string $dirname Directory name + */ + public static function deleteDirectory($dirname, $delete_self = true) + { + $dirname = rtrim($dirname, '/').'/'; + $files = scandir($dirname); + foreach ($files as $file) + if ($file != '.' AND $file != '..') + { + if (is_dir($dirname.$file)) + self::deleteDirectory($dirname.$file, true); + elseif (file_exists($dirname.$file)) + unlink($dirname.$file); + else + p('Unable to delete '.$dirname.$file); + } + if($delete_self) + rmdir($dirname); + } + + /** + * Display an error according to an error code + * + * @param integer $code Error code + */ + public static function displayError($string = 'Fatal error', $htmlentities = true) + { + global $_ERRORS, $cookie; + + $iso = strtolower(Language::getIsoById((is_object($cookie) AND $cookie->id_lang) ? (int)$cookie->id_lang : (int)Configuration::get('PS_LANG_DEFAULT'))); + @include_once(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php'); + + if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ AND $string == 'Fatal error') + return ('
'.print_r(debug_backtrace(), true).'
'); + if (!is_array($_ERRORS)) + return str_replace('"', '"', $string); + $key = md5(str_replace('\'', '\\\'', $string)); + $str = (isset($_ERRORS) AND is_array($_ERRORS) AND key_exists($key, $_ERRORS)) ? ($htmlentities ? htmlentities($_ERRORS[$key], ENT_COMPAT, 'UTF-8') : $_ERRORS[$key]) : $string; + return str_replace('"', '"', stripslashes($str)); + } + + /** + * Display an error with detailed object + * + * @param mixed $object + * @param boolean $kill + * @return $object if $kill = false; + */ + public static function dieObject($object, $kill = true) + { + if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_) + { + echo '
';
+			print_r($object);
+			echo '

'; + if ($kill) + die('END'); + } + return $object; + } + + /** + * ALIAS OF dieObject() - Display an error with detailed object + * + * @param object $object Object to display + */ + public static function d($object, $kill = true) + { + return (self::dieObject($object, $kill = true)); + } + + /** + * ALIAS OF dieObject() - Display an error with detailed object but don't stop the execution + * + * @param object $object Object to display + */ + public static function p($object) + { + return (self::dieObject($object, false)); + } + + /** + * Check if submit has been posted + * + * @param string $submit submit name + */ + public static function isSubmit($submit) + { + return ( + isset($_POST[$submit]) OR isset($_POST[$submit.'_x']) OR isset($_POST[$submit.'_y']) + OR isset($_GET[$submit]) OR isset($_GET[$submit.'_x']) OR isset($_GET[$submit.'_y']) + ); + } + + /** + * Get meta tages for a given page + * + * @param integer $id_lang Language id + * @return array Meta tags + */ + public static function getMetaTags($id_lang, $page_name) + { + global $maintenance; + + if (!(isset($maintenance) AND (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))))) + { + /* Products specifics meta tags */ + if ($id_product = self::getValue('id_product')) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description_short` + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`) + WHERE pl.id_lang = '.(int)($id_lang).' AND pl.id_product = '.(int)($id_product).' AND p.active = 1'); + if ($row) + { + if (empty($row['meta_description'])) + $row['meta_description'] = strip_tags($row['description_short']); + return self::completeMetaTags($row, $row['name']); + } + } + + /* Categories specifics meta tags */ + elseif ($id_category = self::getValue('id_category')) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description` + FROM `'._DB_PREFIX_.'category_lang` + WHERE id_lang = '.(int)($id_lang).' AND id_category = '.(int)($id_category)); + if ($row) + { + if (empty($row['meta_description'])) + $row['meta_description'] = strip_tags($row['description']); + return self::completeMetaTags($row, $row['name']); + } + } + + /* Manufacturers specifics meta tags */ + elseif ($id_manufacturer = self::getValue('id_manufacturer')) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `meta_title`, `meta_description`, `meta_keywords` + FROM `'._DB_PREFIX_.'manufacturer_lang` + WHERE id_lang = '.(int)($id_lang).' AND id_manufacturer = '.(int)($id_manufacturer)); + if ($row) + { + if (empty($row['meta_description'])) + $row['meta_description'] = strip_tags($row['meta_description']); + $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); + return self::completeMetaTags($row, $row['meta_title']); + } + } + + /* Suppliers specifics meta tags */ + elseif ($id_supplier = self::getValue('id_supplier')) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `meta_title`, `meta_description`, `meta_keywords` + FROM `'._DB_PREFIX_.'supplier_lang` + WHERE id_lang = '.(int)($id_lang).' AND id_supplier = '.(int)($id_supplier)); + if ($row) + { + if (empty($row['meta_description'])) + $row['meta_description'] = strip_tags($row['meta_description']); + $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); + return self::completeMetaTags($row, $row['meta_title']); + } + } + + /* CMS specifics meta tags */ + elseif ($id_cms = self::getValue('id_cms')) + { + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT `meta_title`, `meta_description`, `meta_keywords` + FROM `'._DB_PREFIX_.'cms_lang` + WHERE id_lang = '.(int)($id_lang).' AND id_cms = '.(int)($id_cms)); + if ($row) + { + $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); + return self::completeMetaTags($row, $row['meta_title']); + } + } + } + + /* Default meta tags */ + return self::getHomeMetaTags($id_lang, $page_name); + } + + /** + * Get meta tags for a given page + * + * @param integer $id_lang Language id + * @return array Meta tags + */ + public static function getHomeMetaTags($id_lang, $page_name) + { + global $cookie; + + /* Metas-tags */ + $metas = Meta::getMetaByPage($page_name, $id_lang); + $ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? $metas['title'].' - '.Configuration::get('PS_SHOP_NAME') : Configuration::get('PS_SHOP_NAME'); + $ret['meta_description'] = (isset($metas['description']) AND $metas['description']) ? $metas['description'] : ''; + $ret['meta_keywords'] = (isset($metas['keywords']) AND $metas['keywords']) ? $metas['keywords'] : ''; + return $ret; + } + + + public static function completeMetaTags($metaTags, $defaultValue) + { + global $cookie; + + if ($metaTags['meta_title'] == NULL) + $metaTags['meta_title'] = $defaultValue.' - '.Configuration::get('PS_SHOP_NAME'); + if ($metaTags['meta_description'] == NULL) + $metaTags['meta_description'] = Configuration::get('PS_META_DESCRIPTION', (int)($cookie->id_lang)) ? Configuration::get('PS_META_DESCRIPTION', (int)($cookie->id_lang)) : ''; + if ($metaTags['meta_keywords'] == NULL) + $metaTags['meta_keywords'] = Configuration::get('PS_META_KEYWORDS', (int)($cookie->id_lang)) ? Configuration::get('PS_META_KEYWORDS', (int)($cookie->id_lang)) : ''; + return $metaTags; + } + + /** + * Encrypt password + * + * @param object $object Object to display + */ + public static function encrypt($passwd) + { + return md5(pSQL(_COOKIE_KEY_.$passwd)); + } + + /** + * Get token to prevent CSRF + * + * @param string $token token to encrypt + */ + public static function getToken($page = true) + { + global $cookie; + if ($page === true) + return (self::encrypt($cookie->id_customer.$cookie->passwd.$_SERVER['SCRIPT_NAME'])); + else + return (self::encrypt($cookie->id_customer.$cookie->passwd.$page)); + } + + /** + * Encrypt password + * + * @param object $object Object to display + */ + public static function getAdminToken($string) + { + return !empty($string) ? self::encrypt($string) : false; + } + public static function getAdminTokenLite($tab) + { + global $cookie; + return Tools::getAdminToken($tab.(int)(Tab::getIdFromClassName($tab)).(int)($cookie->id_employee)); + } + + /** + * Get the user's journey + * + * @param integer $id_category Category ID + * @param string $path Path end + * @param boolean $linkOntheLastItem Put or not a link on the current category + * @param string [optionnal] $categoryType defined what type of categories is used (products or cms) + */ + public static function getPath($id_category, $path = '', $linkOntheLastItem = false, $categoryType = 'products') + { + global $link, $cookie; + + if ($id_category == 1) + return ''.$path.''; + + $pipe = Configuration::get('PS_NAVIGATION_PIPE'); + if (empty($pipe)) + $pipe = '>'; + + if ($categoryType === 'products') + { + $category = Db::getInstance()->getRow(' + SELECT id_category, level_depth, nleft, nright + FROM '._DB_PREFIX_.'category + WHERE id_category = '.(int)$id_category); + + if (isset($category['id_category'])) + { + $categories = Db::getInstance()->ExecuteS(' + SELECT c.id_category, cl.name, cl.link_rewrite + FROM '._DB_PREFIX_.'category c + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category) + WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).' AND c.id_category != 1 + ORDER BY c.level_depth ASC + LIMIT '.(int)$category['level_depth']); + + $fullPath = ''; + $n = 1; + $nCategories = (int)sizeof($categories); + foreach ($categories AS $category) + { + $fullPath .= + (($n < $nCategories OR $linkOntheLastItem) ? '' : ''). + htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8'). + (($n < $nCategories OR $linkOntheLastItem) ? '' : ''). + (($n++ != $nCategories OR !empty($path)) ? ''.$pipe.'' : ''); + } + + return $fullPath.$path; + } + } + elseif ($categoryType === 'CMS') + { + $category = new CMSCategory((int)($id_category), (int)($cookie->id_lang)); + if (!Validate::isLoadedObject($category)) + die(self::displayError()); + $categoryLink = $link->getCMSCategoryLink($category); + + if ($path != $category->name) + $fullPath .= ''.htmlentities($category->name, ENT_NOQUOTES, 'UTF-8').''.$pipe.''.$path; + else + $fullPath = ($linkOntheLastItem ? '' : '').htmlentities($path, ENT_NOQUOTES, 'UTF-8').($linkOntheLastItem ? '' : ''); + + return self::getPath((int)($category->id_parent), $fullPath, $linkOntheLastItem, $categoryType); + } + } + + /** + * @param string [optionnal] $type_cat defined what type of categories is used (products or cms) + */ + public static function getFullPath($id_category, $end, $type_cat = 'products') + { + global $cookie; + + $pipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>'); + + if($type_cat === 'products') + $category = new Category((int)($id_category), (int)($cookie->id_lang)); + else if ($type_cat === 'CMS') + $category = new CMSCategory((int)($id_category), (int)($cookie->id_lang)); + + if (!Validate::isLoadedObject($category)) + $id_category = 1; + if ($id_category == 1) + return htmlentities($end, ENT_NOQUOTES, 'UTF-8'); + + return self::getPath($id_category, $category->name, true, $type_cat).''.$pipe.' '.htmlentities($end, ENT_NOQUOTES, 'UTF-8').''; + } + + /** + * @deprecated + */ + public static function getCategoriesTotal() + { + Tools::displayAsDeprecated(); + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT COUNT(`id_category`) AS total FROM `'._DB_PREFIX_.'category`'); + return (int)($row['total']); + } + + /** + * @deprecated + */ + public static function getProductsTotal() + { + Tools::displayAsDeprecated(); + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT COUNT(`id_product`) AS total FROM `'._DB_PREFIX_.'product`'); + return (int)($row['total']); + } + + /** + * @deprecated + */ + public static function getCustomersTotal() + { + Tools::displayAsDeprecated(); + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT COUNT(`id_customer`) AS total FROM `'._DB_PREFIX_.'customer`'); + return (int)($row['total']); + } + + /** + * @deprecated + */ + public static function getOrdersTotal() + { + Tools::displayAsDeprecated(); + $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT COUNT(`id_order`) AS total FROM `'._DB_PREFIX_.'orders`'); + return (int)($row['total']); + } + + /* + ** Historyc translation function kept for compatibility + ** Removing soon + */ + public static function historyc_l($key, $translations) + { + global $cookie; + if (!$translations OR !is_array($translations)) + die(self::displayError()); + $iso = strtoupper(Language::getIsoById($cookie->id_lang)); + $lang = key_exists($iso, $translations) ? $translations[$iso] : false; + return (($lang AND is_array($lang) AND key_exists($key, $lang)) ? stripslashes($lang[$key]) : $key); + } + + public static function link_rewrite($str, $utf8_decode = false) + { + $purified = ''; + $length = self::strlen($str); + if ($utf8_decode) + $str = utf8_decode($str); + for ($i = 0; $i < $length; $i++) + { + $char = self::substr($str, $i, 1); + if (self::strlen(htmlentities($char)) > 1) + { + $entity = htmlentities($char, ENT_COMPAT, 'UTF-8'); + $purified .= $entity{1}; + } + elseif (preg_match('|[[:alpha:]]{1}|u', $char)) + $purified .= $char; + elseif (preg_match('<[[:digit:]]|-{1}>', $char)) + $purified .= $char; + elseif ($char == ' ') + $purified .= '-'; + elseif ($char == '\'') + $purified .= '-'; + } + return trim(self::strtolower($purified)); + } + + /** + * Truncate strings + * + * @param string $str + * @param integer $maxLen Max length + * @param string $suffix Suffix optional + * @return string $str truncated + */ + /* CAUTION : Use it only on module hookEvents. + ** For other purposes use the smarty function instead */ + public static function truncate($str, $maxLen, $suffix = '...') + { + if (self::strlen($str) <= $maxLen) + return $str; + $str = utf8_decode($str); + return (utf8_encode(substr($str, 0, $maxLen - self::strlen($suffix)).$suffix)); + } + + /** + * Generate date form + * + * @param integer $year Year to select + * @param integer $month Month to select + * @param integer $day Day to select + * @return array $tab html data with 3 cells :['days'], ['months'], ['years'] + * + */ + public static function dateYears() + { + for ($i = date('Y') - 10; $i >= 1900; $i--) + $tab[] = $i; + return $tab; + } + + public static function dateDays() + { + for ($i = 1; $i != 32; $i++) + $tab[] = $i; + return $tab; + } + + public static function dateMonths() + { + for ($i = 1; $i != 13; $i++) + $tab[$i] = date('F', mktime(0, 0, 0, $i, date('m'), date('Y'))); + return $tab; + } + + public static function hourGenerate($hours, $minutes, $seconds) + { + return implode(':', array($hours, $minutes, $seconds)); + } + + public static function dateFrom($date) + { + $tab = explode(' ', $date); + if (!isset($tab[1])) + $date .= ' ' . self::hourGenerate(0, 0, 0); + return $date; + } + + public static function dateTo($date) + { + $tab = explode(' ', $date); + if (!isset($tab[1])) + $date .= ' ' . self::hourGenerate(23, 59, 59); + return $date; + } + + /** + * @deprecated + */ + public static function getExactTime() + { + Tools::displayAsDeprecated(); + return time()+microtime(); + } + + static function strtolower($str) + { + if (is_array($str)) + return false; + if (function_exists('mb_strtolower')) + return mb_strtolower($str, 'utf-8'); + return strtolower($str); + } + + static function strlen($str, $encoding = 'UTF-8') + { + if (is_array($str)) + return false; + $str = html_entity_decode($str, ENT_COMPAT, 'UTF-8'); + if (function_exists('mb_strlen')) + return mb_strlen($str, $encoding); + return strlen($str); + } + + static function stripslashes($string) + { + if (_PS_MAGIC_QUOTES_GPC_) + $string = stripslashes($string); + return $string; + } + + static function strtoupper($str) + { + if (is_array($str)) + return false; + if (function_exists('mb_strtoupper')) + return mb_strtoupper($str, 'utf-8'); + return strtoupper($str); + } + + static function substr($str, $start, $length = false, $encoding = 'utf-8') + { + if (is_array($str)) + return false; + if (function_exists('mb_substr')) + return mb_substr($str, (int)($start), ($length === false ? self::strlen($str) : (int)($length)), $encoding); + return substr($str, $start, ($length === false ? self::strlen($str) : (int)($length))); + } + + static function ucfirst($str) + { + return self::strtoupper(self::substr($str, 0, 1)).self::substr($str, 1); + } + + public static function orderbyPrice(&$array, $orderWay) + { + foreach($array as &$row) + $row['price_tmp'] = Product::getPriceStatic($row['id_product'], true, ((isset($row['id_product_attribute']) AND !empty($row['id_product_attribute'])) ? (int)($row['id_product_attribute']) : NULL), 2); + if(strtolower($orderWay) == 'desc') + uasort($array, 'cmpPriceDesc'); + else + uasort($array, 'cmpPriceAsc'); + foreach($array as &$row) + unset($row['price_tmp']); + } + + public static function iconv($from, $to, $string) + { + if (function_exists('iconv')) + return iconv($from, $to.'//TRANSLIT', str_replace('¥', '¥', str_replace('£', '£', str_replace('€', '€', $string)))); + return html_entity_decode(htmlentities($string, ENT_NOQUOTES, $from), ENT_NOQUOTES, $to); + } + + public static function isEmpty($field) + { + return ($field === '' OR $field === NULL); + } + + /** + * @deprecated + **/ + public static function getTimezones($select = false) + { + Tools::displayAsDeprecated(); + + static $_cache = 0; + + // One select + if ($select) + { + // No cache + if (!$_cache) + { + $tmz = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT `name` FROM '._DB_PREFIX_.'timezone WHERE id_timezone = '.(int)($select)); + $_cache = $tmz['name']; + } + return $_cache; + } + + // Multiple select + $tmz = Db::getInstance(_PS_USE_SQL_SLAVE_)->s('SELECT * FROM '._DB_PREFIX_.'timezone'); + $tab = array(); + foreach ($tmz as $timezone) + $tab[$timezone['id_timezone']] = str_replace('_', ' ', $timezone['name']); + return $tab; + } + + /** + * @deprecated + **/ + public static function ps_set_magic_quotes_runtime($var) + { + Tools::displayAsDeprecated(); + + if (function_exists('set_magic_quotes_runtime')) + set_magic_quotes_runtime($var); + } + + public static function ps_round($value, $precision = 0) + { + $method = (int)(Configuration::get('PS_PRICE_ROUND_MODE')); + if ($method == PS_ROUND_UP) + return Tools::ceilf($value, $precision); + elseif ($method == PS_ROUND_DOWN) + return Tools::floorf($value, $precision); + return round($value, $precision); + } + + public static function ceilf($value, $precision = 0) + { + $precisionFactor = $precision == 0 ? 1 : pow(10, $precision); + $tmp = $value * $precisionFactor; + $tmp2 = (string)$tmp; + // If the current value has already the desired precision + if (strpos($tmp2, '.') === false) + return ($value); + if ($tmp2[strlen($tmp2) - 1] == 0) + return $value; + return ceil($tmp) / $precisionFactor; + } + + public static function floorf($value, $precision = 0) + { + $precisionFactor = $precision == 0 ? 1 : pow(10, $precision); + $tmp = $value * $precisionFactor; + $tmp2 = (string)$tmp; + // If the current value has already the desired precision + if (strpos($tmp2, '.') === false) + return ($value); + if ($tmp2[strlen($tmp2) - 1] == 0) + return $value; + return floor($tmp) / $precisionFactor; + } + + /** + * file_exists() wrapper with cache to speedup performance + * + * @param string $filename File name + * @return boolean Cached result of file_exists($filename) + */ + public static function file_exists_cache($filename) + { + if (!isset(self::$file_exists_cache[$filename])) + self::$file_exists_cache[$filename] = file_exists($filename); + return self::$file_exists_cache[$filename]; + } + + public static function file_get_contents($url, $useIncludePath = false, $streamContext = NULL) + { + if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) + return file_get_contents($url, $useIncludePath, $streamContext); + else if (function_exists('curl_init')) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_URL, $url); + $content = curl_exec($curl); + curl_close($curl); + return $content; + } + else + return false; + } + + public static function minifyHTML($html_content) + { + if (strlen($html_content) > 0) + { + //set an alphabetical order for args + $html_content = preg_replace_callback( + '/(<[a-zA-Z0-9]+)((\s?[a-zA-Z0-9]+=[\"\\\'][^\"\\\']*[\"\\\']\s?)*)>/' + ,array('Tools', 'minifyHTMLpregCallback') + ,$html_content); + + require_once(_PS_TOOL_DIR_.'minify_html/minify_html.class.php'); + $html_content = Minify_HTML::minify($html_content, array('xhtml', 'cssMinifier', 'jsMinifier')); + + if (Configuration::get('PS_HIGH_HTML_THEME_COMPRESSION')) + { + //$html_content = preg_replace('/"([^\>\s"]*)"/i', '$1', $html_content);//FIXME create a js bug + $html_content = preg_replace('/]*dtd\">/is', '', $html_content); + $html_content = preg_replace('/\s\>/is', '>', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('', '', $html_content); + //$html_content = str_replace('

', '', $html_content);//FIXME doesnt work... + $html_content = str_replace("\n", '', $html_content);//TODO with bellow + $html_content = str_replace('', '', $html_content); + $html_content = str_replace('
- '. + Tools::displayError('You will be redirected to your cart in a few seconds.')) : ''); + } + elseif (!$updateQuantity) + { + if (Tools::getValue('ajax') == 'true') + die('{"hasError" : true, "errors" : ["'.Tools::displayError('You already have the maximum quantity available for this product.', false).'"]}'); + else + $this->errors[] = Tools::displayError('You already have the maximum quantity available for this product.') + .((isset($_SERVER['HTTP_REFERER']) AND basename($_SERVER['HTTP_REFERER']) == 'order.php' OR (!Tools::isSubmit('ajax') AND substr(basename($_SERVER['REQUEST_URI']),0, strlen('cart.php')) == 'cart.php')) ? ('
- '. + Tools::displayError('You will be redirected to your cart in a few seconds.')) : ''); + } + } + } + elseif ($delete) + { + if (self::$cart->deleteProduct((int)($idProduct), (int)($idProductAttribute), (int)($customizationId))) + if (!Cart::getNbProducts((int)(self::$cart->id))) + { + self::$cart->id_carrier = 0; + self::$cart->gift = 0; + self::$cart->gift_message = ''; + self::$cart->update(); + } + } + } + $discounts = self::$cart->getDiscounts(); + foreach($discounts AS $discount) + { + $discountObj = new Discount((int)($discount['id_discount']), (int)(self::$cookie->id_lang)); + if ($error = self::$cart->checkDiscountValidity($discountObj, $discounts, self::$cart->getOrderTotal(true, Cart::ONLY_PRODUCTS), self::$cart->getProducts())) + { + self::$cart->deleteDiscount((int)($discount['id_discount'])); + self::$cart->update(); + $errors[] = $error; + } + } + if (!sizeof($this->errors)) + { + $queryString = Tools::safeOutput(Tools::getValue('query', NULL)); + if ($queryString AND !Configuration::get('PS_CART_REDIRECT')) + Tools::redirect('search.php?search='.$queryString); + if (isset($_SERVER['HTTP_REFERER'])) + { + // Redirect to previous page + preg_match('!http(s?)://(.*)/(.*)!', $_SERVER['HTTP_REFERER'], $regs); + if (isset($regs[3]) AND !Configuration::get('PS_CART_REDIRECT') AND Tools::getValue('ajax') != 'true') + Tools::redirect($regs[3]); + } + } + } + if (Tools::getValue('ajax') != 'true' AND !sizeof($this->errors)) + Tools::redirect('order.php?'.(isset($idProduct) ? 'ipa='.(int)($idProduct) : '')); + + } + } + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'errors.tpl'); + } +} diff --git a/controllers/CategoryController.php b/controllers/CategoryController.php new file mode 100644 index 000000000..1fb358b36 --- /dev/null +++ b/controllers/CategoryController.php @@ -0,0 +1,169 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CategoryControllerCore extends FrontController +{ + protected $category; + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(array( + _PS_CSS_DIR_.'jquery.cluetip.css' => 'all', + _THEME_CSS_DIR_.'scenes.css' => 'all', + _THEME_CSS_DIR_.'category.css' => 'all', + _THEME_CSS_DIR_.'product_list.css' => 'all')); + + if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0) + Tools::addJS(_THEME_JS_DIR_.'products-comparison.js'); + } + + public function displayHeader() + { + parent::displayHeader(); + $this->productSort(); + } + + public function preProcess() + { + if ($id_category = (int)Tools::getValue('id_category')) + $this->category = new Category($id_category, self::$cookie->id_lang); + if (!Validate::isLoadedObject($this->category)) + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + } + else + { + // Automatically redirect to the canonical URL if the current in is the right one + // $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain + $currentURL = self::$link->getCategoryLink($this->category); + $currentURL = preg_replace('/[?&].*$/', '', $currentURL); + if (!preg_match('/^'.Tools::pRegexp($currentURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) + { + header('HTTP/1.0 301 Moved'); + if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ ) + die('[Debug] This page has moved
Please use the following URL instead: '.$currentURL.''); + Tools::redirectLink($currentURL); + } + } + + parent::preProcess(); + + if((int)(Configuration::get('PS_REWRITING_SETTINGS'))) + if ($id_category = (int)Tools::getValue('id_category')) + { + $rewrite_infos = Category::getUrlRewriteInformations((int)$id_category); + + $default_rewrite = array(); + foreach ($rewrite_infos AS $infos) + $default_rewrite[$infos['id_lang']] = self::$link->getCategoryLink((int)$id_category, $infos['link_rewrite'], $infos['id_lang']); + + self::$smarty->assign('lang_rewrite_urls', $default_rewrite); + } + } + + public function process() + { + parent::process(); + if (!($id_category = (int)Tools::getValue('id_category')) OR !Validate::isUnsignedId($id_category)) + $this->errors[] = Tools::displayError('Missing category ID'); + else + { + if (!Validate::isLoadedObject($this->category)) + $this->errors[] = Tools::displayError('Category does not exist'); + elseif (!$this->category->checkAccess((int)(self::$cookie->id_customer))) + $this->errors[] = Tools::displayError('You do not have access to this category.'); + elseif (!$this->category->active) + self::$smarty->assign('category', $this->category); + else + { + $rewrited_url = self::$link->getCategoryLink((int)$this->category->id, $this->category->link_rewrite); + + /* Scenes (could be externalised to another controler if you need them */ + self::$smarty->assign('scenes', Scene::getScenes((int)($this->category->id), (int)(self::$cookie->id_lang), true, false)); + + /* Scenes images formats */ + if ($sceneImageTypes = ImageType::getImagesTypes('scenes')) + { + foreach ($sceneImageTypes AS $sceneImageType) + { + if ($sceneImageType['name'] == 'thumb_scene') + $thumbSceneImageType = $sceneImageType; + elseif ($sceneImageType['name'] == 'large_scene') + $largeSceneImageType = $sceneImageType; + } + self::$smarty->assign('thumbSceneImageType', isset($thumbSceneImageType) ? $thumbSceneImageType : NULL); + self::$smarty->assign('largeSceneImageType', isset($largeSceneImageType) ? $largeSceneImageType : NULL); + } + + $this->category->description = nl2br2($this->category->description); + $subCategories = $this->category->getSubCategories((int)(self::$cookie->id_lang)); + self::$smarty->assign('category', $this->category); + if (Db::getInstance()->numRows()) + { + self::$smarty->assign('subcategories', $subCategories); + self::$smarty->assign(array( + 'subcategories_nb_total' => sizeof($subCategories), + 'subcategories_nb_half' => ceil(sizeof($subCategories) / 2))); + } + if ($this->category->id != 1) + { + $nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); + $this->pagination((int)$nbProducts); + self::$smarty->assign('nb_products', (int)$nbProducts); + $cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay); + } + self::$smarty->assign(array( + 'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL, + 'id_category' => (int)($this->category->id), + 'id_category_parent' => (int)($this->category->id_parent), + 'return_category_name' => Tools::safeOutput($this->category->name), + 'path' => Tools::getPath((int)($this->category->id)), + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + 'categorySize' => Image::getSize('category'), + 'mediumSize' => Image::getSize('medium'), + 'thumbSceneSize' => Image::getSize('thumb_scene'), + 'homeSize' => Image::getSize('home') + )); + } + } + + self::$smarty->assign(array( + 'allow_oosp' => (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')), + 'comparator_max_item' => (int)(Configuration::get('PS_COMPARATOR_MAX_ITEM')), + 'suppliers' => Supplier::getSuppliers() + )); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'category.tpl'); + } +} + diff --git a/controllers/CompareController.php b/controllers/CompareController.php new file mode 100644 index 000000000..2363e8cd1 --- /dev/null +++ b/controllers/CompareController.php @@ -0,0 +1,101 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class CompareControllerCore extends FrontController +{ + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'/comparator.css'); + } + + public function process() + { + parent::process(); + + $hasProduct = false; + $product_list = Tools::getValue('compare_product_list'); + $postProducts = isset($product_list) ? rtrim($product_list,'|') : ''; + + if (!Configuration::get('PS_COMPARATOR_MAX_ITEM')) + return Tools::redirect('404.php'); + + if ($postProducts) + { + $ids = array_unique(explode('|', $postProducts)); + + if (sizeof($ids) > 0) + { + if (sizeof($ids) > Configuration::get('PS_COMPARATOR_MAX_ITEM')) + $ids = array_slice($ids, 0, Configuration::get('PS_COMPARATOR_MAX_ITEM')); + + $listProducts = array(); + $listFeatures = array(); + + foreach ($ids AS $id) + { + $curProduct = new Product((int)($id), true, (int)(self::$cookie->id_lang)); + if (!Validate::isLoadedObject($curProduct)) + continue; + + foreach ($curProduct->getFrontFeatures(self::$cookie->id_lang) AS $feature) + $listFeatures[$curProduct->id][$feature['id_feature']] = $feature['value']; + + $cover = Product::getCover((int)$id); + + $curProduct->id_image = Tools::htmlentitiesUTF8(Product::defineProductImage(array('id_image' => $cover['id_image'], 'id_product' => $id), self::$cookie->id_lang)); + $listProducts[] = $curProduct; + } + + if (sizeof($listProducts) > 0) + { + $width = 80 / sizeof($listProducts); + + $hasProduct = true; + $ordered_features = Feature::getFeaturesForComparison($ids, self::$cookie->id_lang); + self::$smarty->assign(array( + 'ordered_features' => $ordered_features, + 'product_features' => $listFeatures, + 'products' => $listProducts, + 'link' => new Link(), + 'width' => $width, + 'homeSize' => Image::getSize('home') + )); + self::$smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Module::hookExec('extraProductComparison', array('list_ids_product' => $ids))); + } + } + } + self::$smarty->assign('hasProduct', $hasProduct); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'products-comparison.tpl'); + } +} + diff --git a/controllers/ContactController.php b/controllers/ContactController.php new file mode 100644 index 000000000..f2ac56ada --- /dev/null +++ b/controllers/ContactController.php @@ -0,0 +1,264 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ContactControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'contact-form.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function preProcess() + { + parent::preProcess(); + + if (self::$cookie->isLogged()) + { + self::$smarty->assign('isLogged', 1); + $customer = new Customer((int)(self::$cookie->id_customer)); + if (!Validate::isLoadedObject($customer)) + die(Tools::displayError('Customer not found')); + $products = array(); + $orders = array(); + $getOrders = Db::getInstance()->ExecuteS(' + SELECT id_order + FROM '._DB_PREFIX_.'orders + WHERE id_customer = '.(int)$customer->id.' ORDER BY date_add'); + foreach ($getOrders as $row) + { + $order = new Order($row['id_order']); + $date = explode(' ', $order->date_add); + $orders[$row['id_order']] = Tools::displayDate($date[0], self::$cookie->id_lang); + $tmp = $order->getProducts(); + foreach ($tmp as $key => $val) + $products[$val['product_id']] = $val['product_name']; + } + + $orderList = ''; + foreach ($orders as $key => $val) + $orderList .= ''; + $orderedProductList = ''; + + foreach ($products as $key => $val) + $orderedProductList .= ''; + self::$smarty->assign('orderList', $orderList); + self::$smarty->assign('orderedProductList', $orderedProductList); + } + + if (Tools::isSubmit('submitMessage')) + { + $fileAttachment = NULL; + if (isset($_FILES['fileUpload']['name']) AND !empty($_FILES['fileUpload']['name']) AND !empty($_FILES['fileUpload']['tmp_name'])) + { + $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); + $filename = uniqid().substr($_FILES['fileUpload']['name'], -5); + $fileAttachment['content'] = file_get_contents($_FILES['fileUpload']['tmp_name']); + $fileAttachment['name'] = $_FILES['fileUpload']['name']; + $fileAttachment['mime'] = $_FILES['fileUpload']['type']; + } + $message = Tools::htmlentitiesUTF8(Tools::getValue('message')); + if (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)) + $this->errors[] = Tools::displayError('Invalid e-mail address'); + elseif (!($message = nl2br2($message))) + $this->errors[] = Tools::displayError('Message cannot be blank'); + elseif (!Validate::isMessage($message)) + $this->errors[] = Tools::displayError('Invalid message'); + elseif (!($id_contact = (int)(Tools::getValue('id_contact'))) OR !(Validate::isLoadedObject($contact = new Contact((int)($id_contact), (int)(self::$cookie->id_lang))))) + $this->errors[] = Tools::displayError('Please select a subject on the list.'); + elseif (!empty($_FILES['fileUpload']['name']) AND $_FILES['fileUpload']['error'] != 0) + $this->errors[] = Tools::displayError('An error occurred during the file upload'); + elseif (!empty($_FILES['fileUpload']['name']) AND !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) AND !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) + $this->errors[] = Tools::displayError('Bad file extension'); + else + { + if ((int)(self::$cookie->id_customer)) + $customer = new Customer((int)(self::$cookie->id_customer)); + else + { + $customer = new Customer(); + $customer->getByEmail($from); + } + + $contact = new Contact($id_contact, self::$cookie->id_lang); + + if (!(( + $id_customer_thread = (int)Tools::getValue('id_customer_thread') + AND (int)Db::getInstance()->getValue(' + SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm + WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND token = \''.pSQL(Tools::getValue('token')).'\'') + ) OR ( + $id_customer_thread = (int)Db::getInstance()->getValue(' + SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm + WHERE cm.email = \''.pSQL($from).'\' AND cm.id_order = '.(int)(Tools::getValue('id_order')).'') + ))) + { + $fields = Db::getInstance()->ExecuteS(' + SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email + FROM '._DB_PREFIX_.'customer_thread cm + WHERE email = \''.pSQL($from).'\' AND ('. + ($customer->id ? 'id_customer = '.(int)($customer->id).' OR ' : '').' + id_order = '.(int)(Tools::getValue('id_order')).')'); + $score = 0; + foreach ($fields as $key => $row) + { + $tmp = 0; + if ((int)$row['id_customer'] AND $row['id_customer'] != $customer->id AND $row['email'] != $from) + continue; + if ($row['id_order'] != 0 AND Tools::getValue('id_order') != $row['id_order']) + continue; + if ($row['email'] == $from) + $tmp += 4; + if ($row['id_contact'] == $id_contact) + $tmp++; + if (Tools::getValue('id_product') != 0 AND $row['id_product'] == Tools::getValue('id_product')) + $tmp += 2; + if ($tmp >= 5 AND $tmp >= $score) + { + $score = $tmp; + $id_customer_thread = $row['id_customer_thread']; + } + } + } + $old_message = Db::getInstance()->getValue(' + SELECT cm.message FROM '._DB_PREFIX_.'customer_message cm + WHERE cm.id_customer_thread = '.(int)($id_customer_thread).' + ORDER BY date_add DESC'); + if ($old_message == htmlentities($message, ENT_COMPAT, 'UTF-8')) + { + self::$smarty->assign('alreadySent', 1); + $contact->email = ''; + $contact->customer_service = 0; + } + if (!empty($contact->email)) + { + if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment) + AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from)) + self::$smarty->assign('confirmation', 1); + else + $this->errors[] = Tools::displayError('An error occurred while sending message.'); + } + + if ($contact->customer_service) + { + if ((int)$id_customer_thread) + { + $ct = new CustomerThread($id_customer_thread); + $ct->status = 'open'; + $ct->id_lang = (int)self::$cookie->id_lang; + $ct->id_contact = (int)($id_contact); + if ($id_order = (int)Tools::getValue('id_order')) + $ct->id_order = $id_order; + if ($id_product = (int)Tools::getValue('id_product')) + $ct->id_product = $id_product; + $ct->update(); + } + else + { + $ct = new CustomerThread(); + if (isset($customer->id)) + $ct->id_customer = (int)($customer->id); + if ($id_order = (int)Tools::getValue('id_order')) + $ct->id_order = $id_order; + if ($id_product = (int)Tools::getValue('id_product')) + $ct->id_product = $id_product; + $ct->id_contact = (int)($id_contact); + $ct->id_lang = (int)self::$cookie->id_lang; + $ct->email = $from; + $ct->status = 'open'; + $ct->token = Tools::passwdGen(12); + $ct->add(); + } + + if ($ct->id) + { + $cm = new CustomerMessage(); + $cm->id_customer_thread = $ct->id; + $cm->message = htmlentities($message, ENT_COMPAT, 'UTF-8'); + if (isset($filename) AND rename($_FILES['fileUpload']['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename)) + $cm->file_name = $filename; + $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); + $cm->user_agent = $_SERVER['HTTP_USER_AGENT']; + if ($cm->add()) + { + if (empty($contact->email)) + Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from); + self::$smarty->assign('confirmation', 1); + } + else + $this->errors[] = Tools::displayError('An error occurred while sending message.'); + } + else + $this->errors[] = Tools::displayError('An error occurred while sending message.'); + } + if (count($this->errors) > 1) + array_unique($this->errors); + } + } + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'contact-form.css'); + } + + public function process() + { + parent::process(); + + $email = Tools::safeOutput(Tools::getValue('from', ((isset(self::$cookie) AND isset(self::$cookie->email) AND Validate::isEmail(self::$cookie->email)) ? self::$cookie->email : ''))); + self::$smarty->assign(array( + 'errors' => $this->errors, + 'email' => $email, + 'fileupload' => Configuration::get('PS_CUSTOMER_SERVICE_FILE_UPLOAD') + )); + + + if ($id_customer_thread = (int)Tools::getValue('id_customer_thread') AND $token = Tools::getValue('token')) + { + $customerThread = Db::getInstance()->getRow(' + SELECT cm.* FROM '._DB_PREFIX_.'customer_thread cm + WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND token = \''.pSQL($token).'\''); + self::$smarty->assign('customerThread', $customerThread); + } + + self::$smarty->assign(array('contacts' => Contact::getContacts((int)(self::$cookie->id_lang)), + 'message' => html_entity_decode(Tools::getValue('message')) + )); + } + + public function displayContent() + { + $_POST = array_merge($_POST, $_GET); + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'contact-form.tpl'); + } +} + diff --git a/controllers/DiscountController.php b/controllers/DiscountController.php new file mode 100644 index 000000000..37e5769d3 --- /dev/null +++ b/controllers/DiscountController.php @@ -0,0 +1,59 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class DiscountControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'discount.php'; + $this->authRedirection = 'discount.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function process() + { + parent::process(); + + $discounts = Discount::getCustomerDiscounts((int)(self::$cookie->id_lang), (int)(self::$cookie->id_customer), true, false); + $nbDiscounts = 0; + foreach ($discounts AS $discount) + if ($discount['quantity_for_user']) + $nbDiscounts++; + + self::$smarty->assign(array('nbDiscounts' => (int)($nbDiscounts), 'discount' => $discounts)); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'discount.tpl'); + } +} + diff --git a/controllers/GuestTrackingController.php b/controllers/GuestTrackingController.php new file mode 100644 index 000000000..dfe4a7317 --- /dev/null +++ b/controllers/GuestTrackingController.php @@ -0,0 +1,127 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class GuestTrackingControllerCore extends FrontController +{ + public function preProcess() + { + parent::preProcess(); + + if (self::$cookie->isLogged()) + Tools::redirect('history.php'); + } + + public function process() + { + parent::process(); + + if ($id_order = Tools::getValue('id_order') AND $email = Tools::getValue('email')) + { + $order = new Order((int)$id_order); + if (!Validate::isLoadedObject($order)) + $this->errors[] = Tools::displayError('Invalid order'); + elseif (!$order->isAssociatedAtGuest($email)) + $this->errors[] = Tools::displayError('Invalid order'); + else + { + $customer = new Customer((int)$order->id_customer); + $id_order_state = (int)($order->getCurrentState()); + $carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang)); + $addressInvoice = new Address((int)($order->id_address_invoice)); + $addressDelivery = new Address((int)($order->id_address_delivery)); + if ($order->total_discounts > 0) + self::$smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts)); + $products = $order->getProducts(); + $customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart)); + Product::addCustomizationPrice($products, $customizedDatas); + + self::$smarty->assign(array( + 'shop_name' => Configuration::get('PS_SHOP_NAME'), + 'order' => $order, + 'return_allowed' => false, + 'currency' => new Currency($order->id_currency), + 'order_state' => (int)($id_order_state), + 'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')), + 'invoice' => (OrderState::invoiceAvailable((int)($id_order_state)) AND $order->invoice_number), + 'order_history' => $order->getHistory((int)(self::$cookie->id_lang), false, true), + 'products' => $products, + 'discounts' => $order->getDiscounts(), + 'carrier' => $carrier, + 'address_invoice' => $addressInvoice, + 'invoiceState' => (Validate::isLoadedObject($addressInvoice) AND $addressInvoice->id_state) ? new State((int)($addressInvoice->id_state)) : false, + 'address_delivery' => $addressDelivery, + 'deliveryState' => (Validate::isLoadedObject($addressDelivery) AND $addressDelivery->id_state) ? new State((int)($addressDelivery->id_state)) : false, + 'is_guest' => true, + 'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC), + 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, + 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, + 'use_tax' => Configuration::get('PS_TAX'), + 'customizedDatas' => $customizedDatas)); + if ($carrier->url AND $order->shipping_number) + self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); + self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order))); + Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order)); + + if (Tools::isSubmit('submitTransformGuestToCustomer')) + { + if (!Validate::isPasswd(Tools::getValue('password'))) + $this->errors[] = Tools::displayError('Invalid password'); + $customer = new Customer((int)$order->id_customer); + if (!Validate::isLoadedObject($customer)) + $this->errors[] = Tools::displayError('Invalid customer'); + if (!$customer->transformToCustomer(self::$cookie->id_lang, Tools::getValue('password'))) + $this->errors[] = Tools::displayError('An error occurred while transforming guest to customer.'); + else + self::$smarty->assign('transformSuccess', true); + } + } + if (sizeof($this->errors)) + /* Handle brute force attacks */ + sleep(1); + } + + self::$smarty->assign(array( + 'action' => 'guest-tracking.php', + 'errors' => $this->errors + )); + } + + public function setMedia() + { + parent::setMedia(); + + Tools::addCSS(_THEME_CSS_DIR_.'history.css'); + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + } + + public function displayContent() + { + parent::displayContent(); + + self::$smarty->display(_PS_THEME_DIR_.'guest-tracking.tpl'); + } +} diff --git a/controllers/HistoryController.php b/controllers/HistoryController.php new file mode 100644 index 000000000..a8b6ef07d --- /dev/null +++ b/controllers/HistoryController.php @@ -0,0 +1,72 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class HistoryControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'history.php'; + $this->authRedirection = 'history.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'history.css'); + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js', _THEME_JS_DIR_.'history.js')); + } + + public function process() + { + parent::process(); + + if ($orders = Order::getCustomerOrders((int)(self::$cookie->id_customer))) + foreach ($orders AS &$order) + { + $myOrder = new Order((int)($order['id_order'])); + if (Validate::isLoadedObject($myOrder)) + $order['virtual'] = $myOrder->isVirtual(false); + } + self::$smarty->assign(array( + 'orders' => $orders, + 'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')), + 'slowValidation' => Tools::isSubmit('slowvalidation') + )); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'history.tpl'); + } +} + diff --git a/controllers/IdentityController.php b/controllers/IdentityController.php new file mode 100644 index 000000000..96d38a610 --- /dev/null +++ b/controllers/IdentityController.php @@ -0,0 +1,129 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class IdentityControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'identity.php'; + $this->authRedirection = 'identity.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function preProcess() + { + parent::preProcess(); + + $customer = new Customer((int)(self::$cookie->id_customer)); + + if (sizeof($_POST)) + { + $exclusion = array('secure_key', 'old_passwd', 'passwd', 'active', 'date_add', 'date_upd', 'last_passwd_gen', 'newsletter_date_add', 'id_default_group'); + $fields = $customer->getFields(); + foreach ($fields AS $key => $value) + if (!in_array($key, $exclusion)) + $customer->{$key} = key_exists($key, $_POST) ? trim($_POST[$key]) : 0; + } + + if (isset($_POST['years']) AND isset($_POST['months']) AND isset($_POST['days'])) + $customer->birthday = (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']); + + if (Tools::isSubmit('submitIdentity')) + { + if (!@checkdate(Tools::getValue('months'), Tools::getValue('days'), Tools::getValue('years')) AND + !(Tools::getValue('months') == '' AND Tools::getValue('days') == '' AND Tools::getValue('years') == '')) + $this->errors[] = Tools::displayError('Invalid date of birth'); + else + { + $customer->birthday = (empty($_POST['years']) ? '' : (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days'])); + + $_POST['old_passwd'] = trim($_POST['old_passwd']); + if (empty($_POST['old_passwd']) OR (Tools::encrypt($_POST['old_passwd']) != self::$cookie->passwd)) + $this->errors[] = Tools::displayError('Your password is incorrect.'); + elseif ($_POST['passwd'] != $_POST['confirmation']) + $this->errors[] = Tools::displayError('Password and confirmation do not match'); + else + { + $prev_id_default_group = $customer->id_default_group; + $this->errors = $customer->validateControler(); + } + if (!sizeof($this->errors)) + { + $customer->id_default_group = (int)($prev_id_default_group); + $customer->firstname = Tools::ucfirst(Tools::strtolower($customer->firstname)); + if (Tools::getValue('passwd')) + self::$cookie->passwd = $customer->passwd; + if ($customer->update()) + { + self::$cookie->customer_lastname = $customer->lastname; + self::$cookie->customer_firstname = $customer->firstname; + self::$smarty->assign('confirmation', 1); + } + else + $this->errors[] = Tools::displayError('Cannot update information'); + } + } + } + else + $_POST = array_map('stripslashes', $customer->getFields()); + + if ($customer->birthday) + $birthday = explode('-', $customer->birthday); + else + $birthday = array('-', '-', '-'); + + /* Generate years, months and days */ + self::$smarty->assign(array( + 'years' => Tools::dateYears(), + 'sl_year' => $birthday[0], + 'months' => Tools::dateMonths(), + 'sl_month' => $birthday[1], + 'days' => Tools::dateDays(), + 'sl_day' => $birthday[2], + 'errors' => $this->errors + )); + + self::$smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'identity.css'); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'identity.tpl'); + } +} + + diff --git a/controllers/IndexController.php b/controllers/IndexController.php new file mode 100644 index 000000000..1ba1847d0 --- /dev/null +++ b/controllers/IndexController.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class IndexControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = Configuration::get('PS_HOMEPAGE_PHP_SELF'); + + parent::__construct(); + } + + public function process() + { + parent::process(); + self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'index.tpl'); + } +} diff --git a/controllers/ManufacturerController.php b/controllers/ManufacturerController.php new file mode 100644 index 000000000..545fa6c0a --- /dev/null +++ b/controllers/ManufacturerController.php @@ -0,0 +1,101 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ManufacturerControllerCore extends FrontController +{ + protected $manufacturer; + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'product_list.css'); + } + + public function process() + { + if ($id_manufacturer = Tools::getValue('id_manufacturer')) + { + $this->manufacturer = new Manufacturer((int)$id_manufacturer, self::$cookie->id_lang); + if (Validate::isLoadedObject($this->manufacturer) AND $this->manufacturer->active) + { + $nbProducts = $this->manufacturer->getProducts($id_manufacturer, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); + $this->pagination((int)$nbProducts); + self::$smarty->assign(array( + 'nb_products' => $nbProducts, + 'products' => $this->manufacturer->getProducts($id_manufacturer, (int)self::$cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay), + 'path' => ($this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : ''), + 'manufacturer' => $this->manufacturer)); + } + else + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + $this->errors[] = Tools::displayError('Manufacturer does not exist.'); + } + } + else + { + if (Configuration::get('PS_DISPLAY_SUPPLIERS')) + { + $data = call_user_func(array('Manufacturer', 'getManufacturers'), true, (int)(self::$cookie->id_lang), true); + $nbProducts = count($data); + $this->pagination($nbProducts); + + $data = call_user_func(array('Manufacturer', 'getManufacturers'), true, (int)(self::$cookie->id_lang), true, $this->p, $this->n); + $imgDir = _PS_MANU_IMG_DIR_; + foreach ($data AS &$item) + $item['image'] = (!file_exists($imgDir.'/'.$item['id_manufacturer'].'-medium.jpg')) ? + Language::getIsoById((int)(self::$cookie->id_lang)).'-default' : $item['id_manufacturer']; + self::$smarty->assign(array( + 'pages_nb' => ceil($nbProducts / (int)($this->n)), + 'nbManufacturers' => $nbProducts, + 'mediumSize' => Image::getSize('medium'), + 'manufacturers' => $data, + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + )); + } + else + self::$smarty->assign('nbManufacturers', 0); + } + } + + public function displayHeader() + { + parent::displayHeader(); + $this->productSort(); + } + + public function displayContent() + { + parent::displayContent(); + if ($this->manufacturer) + self::$smarty->display(_PS_THEME_DIR_.'manufacturer.tpl'); + else + self::$smarty->display(_PS_THEME_DIR_.'manufacturer-list.tpl'); + } + +} \ No newline at end of file diff --git a/controllers/MyAccountController.php b/controllers/MyAccountController.php new file mode 100644 index 000000000..871fb76b1 --- /dev/null +++ b/controllers/MyAccountController.php @@ -0,0 +1,63 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MyAccountControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'my-account.php'; + $this->authRedirection = 'my-account.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'my-account.css'); + } + + public function process() + { + parent::process(); + + self::$smarty->assign(array( + 'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')), + 'returnAllowed' => (int)(Configuration::get('PS_ORDER_RETURN')) + )); + self::$smarty->assign('HOOK_CUSTOMER_ACCOUNT', Module::hookExec('customerAccount')); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'my-account.tpl'); + } +} + diff --git a/controllers/NewProductsController.php b/controllers/NewProductsController.php new file mode 100644 index 000000000..0a8832c17 --- /dev/null +++ b/controllers/NewProductsController.php @@ -0,0 +1,65 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class NewProductsControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'new-products.php'; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'product_list.css'); + } + + public function process() + { + parent::process(); + + $this->productSort(); + $nbProducts = (int)(Product::getNewProducts((int)(self::$cookie->id_lang), isset($this->p) ? (int)($this->p) - 1 : NULL, isset($this->n) ? (int)($this->n) : NULL, true)); + $this->pagination($nbProducts); + + self::$smarty->assign(array( + 'products' => Product::getNewProducts((int)(self::$cookie->id_lang), (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay), + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + 'nbProducts' => (int)($nbProducts), + 'homeSize' => Image::getSize('home') + )); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'new-products.tpl'); + } +} + diff --git a/controllers/OrderConfirmationController.php b/controllers/OrderConfirmationController.php new file mode 100644 index 000000000..448398040 --- /dev/null +++ b/controllers/OrderConfirmationController.php @@ -0,0 +1,94 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderConfirmationControllerCore extends FrontController +{ + public $id_cart; + public $id_module; + public $id_order; + public $secure_key; + + public function __construct() + { + $this->php_self = 'order-confirmation.php'; + + parent::__construct(); + } + + public function preProcess() + { + parent::preProcess(); + + $this->id_cart = (int)(Tools::getValue('id_cart', 0)); + + /* check if the cart has been made by a Guest customer, for redirect link */ + if (Cart::isGuestCartByCartId($this->id_cart)) + $redirectLink = 'guest-tracking.php'; + else + $redirectLink = 'history.php'; + + $this->id_module = (int)(Tools::getValue('id_module', 0)); + $this->id_order = Order::getOrderByCartId((int)($this->id_cart)); + $this->secure_key = Tools::getValue('key', false); + if (!$this->id_order OR !$this->id_module OR !$this->secure_key OR empty($this->secure_key)) + Tools::redirect($redirectLink.(Tools::isSubmit('slowvalidation') ? '?slowvalidation' : '')); + + $order = new Order((int)($this->id_order)); + if (!Validate::isLoadedObject($order) OR $order->id_customer != self::$cookie->id_customer OR $this->secure_key != $order->secure_key) + Tools::redirect($redirectLink); + $module = Module::getInstanceById((int)($this->id_module)); + if ($order->payment != $module->displayName) + Tools::redirect($redirectLink); + } + + public function process() + { + parent::process(); + self::$smarty->assign(array( + 'is_guest' => self::$cookie->is_guest, + 'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int)($this->id_order)), + 'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int)($this->id_order), (int)($this->id_module)) + )); + + if (self::$cookie->is_guest) + { + self::$smarty->assign(array( + 'id_order' => $this->id_order, + 'id_order_formatted' => sprintf('#%06d', $this->id_order) + )); + /* If guest we clear the cookie for security reason */ + self::$cookie->logout(); + } + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl'); + } +} + diff --git a/controllers/OrderController.php b/controllers/OrderController.php new file mode 100644 index 000000000..0c627667b --- /dev/null +++ b/controllers/OrderController.php @@ -0,0 +1,268 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +ControllerFactory::includeController('ParentOrderController'); + +class OrderControllerCore extends ParentOrderController +{ + public $step; + + public function init() + { + parent::init(); + + $this->step = (int)(Tools::getValue('step')); + if (!$this->nbProducts) + $this->step = -1; + } + + public function preProcess() + { + global $isVirtualCart, $orderTotal; + + parent::preProcess(); + + /* If some products have disappear */ + if (!self::$cart->checkQuantities()) + { + $this->step = 0; + $this->errors[] = Tools::displayError('An item in your cart is no longer available for this quantity, you cannot proceed with your order.'); + } + + /* Check minimal amount */ + $currency = Currency::getCurrency((int)self::$cart->id_currency); + + $orderTotal = self::$cart->getOrderTotal(); + $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); + + if ($orderTotal < $minimalPurchase) + { + $this->step = 0; + $this->errors[] = Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). + ' '.Tools::displayError('is required in order to validate your order.'); + } + + if (!self::$cookie->isLogged(true) AND in_array($this->step, array(1, 2, 3))) + Tools::redirect('authentication.php?back=order.php?step='.$this->step); + + if ($this->nbProducts) + self::$smarty->assign('virtual_cart', $isVirtualCart); + } + + public function displayHeader() + { + if (!Tools::getValue('ajax')) + parent::displayHeader(); + } + + public function process() + { + parent::process(); + + /* 4 steps to the order */ + switch ((int)$this->step) + { + case -1; + self::$smarty->assign('empty', 1); + break; + case 1: + $this->_assignAddress(); + break; + case 2: + if(Tools::isSubmit('processAddress')) + $this->processAddress(); + $this->autoStep(); + $this->_assignCarrier(); + break; + case 3: + if(Tools::isSubmit('processCarrier')) + $this->processCarrier(); + $this->autoStep(); + /* Bypass payment step if total is 0 */ + if (($id_order = $this->_checkFreeOrder()) AND $id_order) + { + if (self::$cookie->is_guest) + { + $email = self::$cookie->email; + self::$cookie->logout(); // If guest we clear the cookie for security reason + Tools::redirect('guest-tracking.php?id_order='.(int)$id_order.'&email='.urlencode($email)); + } + else + Tools::redirect('history.php'); + } + $this->_assignPayment(); + break; + default: + $this->_assignSummaryInformations(); + break; + } + } + + public function displayContent() + { + parent::displayContent(); + + switch ((int)$this->step) + { + case -1: + self::$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl'); + break; + case 1: + self::$smarty->display(_PS_THEME_DIR_.'order-address.tpl'); + break; + case 2: + self::$smarty->display(_PS_THEME_DIR_.'order-carrier.tpl'); + break; + case 3: + self::$smarty->display(_PS_THEME_DIR_.'order-payment.tpl'); + break; + default: + self::$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl'); + break; + } + } + + public function displayFooter() + { + if (!Tools::getValue('ajax')) + parent::displayFooter(); + } + + /* Order process controller */ + public function autoStep() + { + global $isVirtualCart; + + if ($this->step >= 2 AND (!self::$cart->id_address_delivery OR !self::$cart->id_address_invoice)) + Tools::redirect('order.php?step=1'); + $delivery = new Address((int)(self::$cart->id_address_delivery)); + $invoice = new Address((int)(self::$cart->id_address_invoice)); + if ($delivery->deleted OR $invoice->deleted) + { + if ($delivery->deleted) + unset(self::$cart->id_address_delivery); + if ($invoice->deleted) + unset(self::$cart->id_address_invoice); + Tools::redirect('order.php?step=1'); + } + elseif ($this->step >= 3 AND !self::$cart->id_carrier AND !$isVirtualCart) + Tools::redirect('order.php?step=2'); + } + + /* + * Manage address + */ + public function processAddress() + { + if (!Tools::isSubmit('id_address_delivery') OR !Address::isCountryActiveById((int)Tools::getValue('id_address_delivery'))) + $this->errors[] = Tools::displayError('This address is not in a valid area.'); + else + { + self::$cart->id_address_delivery = (int)(Tools::getValue('id_address_delivery')); + self::$cart->id_address_invoice = Tools::isSubmit('same') ? self::$cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice')); + if (!self::$cart->update()) + $this->errors[] = Tools::displayError('An error occurred while updating your cart.'); + + if (Tools::isSubmit('message')) + $this->_updateMessage(Tools::getValue('message')); + } + if (sizeof($this->errors)) + { + if (Tools::getValue('ajax')) + die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}'); + $this->step = 1; + } + if (Tools::getValue('ajax')) + die(true); + } + + /* Carrier step */ + protected function processCarrier() + { + global $orderTotal; + + parent::_processCarrier(); + + if (sizeof($this->errors)) + { + self::$smarty->assign('errors', $this->errors); + $this->_assignCarrier(); + $this->step = 2; + $this->displayContent(); + include(dirname(__FILE__).'/../footer.php'); + exit; + } + $orderTotal = self::$cart->getOrderTotal(); + } + + /* Address step */ + protected function _assignAddress() + { + parent::_assignAddress(); + + self::$smarty->assign('cart', self::$cart); + if (self::$cookie->is_guest) + Tools::redirect('order.php?step=2'); + } + + /* Carrier step */ + protected function _assignCarrier() + { + global $defaultCountry; + + if (isset(self::$cookie->id_customer)) + $customer = new Customer((int)(self::$cookie->id_customer)); + else + die(Tools::displayError('Fatal error: No customer')); + // Assign carrier + parent::_assignCarrier(); + // Assign wrapping and TOS + $this->_assignWrappingAndTOS(); + + self::$smarty->assign('is_guest' ,(isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0)); + } + + /* Payment step */ + protected function _assignPayment() + { + global $orderTotal; + + // Redirect instead of displaying payment modules if any module are grefted on + Hook::backBeforePayment('order.php?step=3'); + + /* We may need to display an order summary */ + self::$smarty->assign(self::$cart->getSummaryDetails()); + self::$smarty->assign(array( + 'total_price' => (float)($orderTotal), + 'taxes_enabled' => (int)(Configuration::get('PS_TAX')) + )); + self::$cookie->checkedTOS = '1'; + + parent::_assignPayment(); + } +} + diff --git a/controllers/OrderDetailController.php b/controllers/OrderDetailController.php new file mode 100644 index 000000000..e33ce3f85 --- /dev/null +++ b/controllers/OrderDetailController.php @@ -0,0 +1,167 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderDetailControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->authRedirection = 'history.php'; + $this->ssl = true; + + parent::__construct(); + + header("Cache-Control: no-cache, must-revalidate"); + header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); + } + + public function preProcess() + { + parent::preProcess(); + + if (Tools::isSubmit('submitMessage')) + { + $idOrder = (int)(Tools::getValue('id_order')); + $msgText = htmlentities(Tools::getValue('msgText'), ENT_COMPAT, 'UTF-8'); + + if (!$idOrder OR !Validate::isUnsignedId($idOrder)) + $this->errors[] = Tools::displayError('Order is no longer valid'); + elseif (empty($msgText)) + $this->errors[] = Tools::displayError('Message cannot be blank'); + elseif (!Validate::isMessage($msgText)) + $this->errors[] = Tools::displayError('Message is invalid (HTML is not allowed)'); + if(!sizeof($this->errors)) + { + $order = new Order((int)($idOrder)); + if (Validate::isLoadedObject($order) AND $order->id_customer == self::$cookie->id_customer) + { + $message = new Message(); + $message->id_customer = (int)(self::$cookie->id_customer); + $message->message = $msgText; + $message->id_order = (int)($idOrder); + $message->private = false; + $message->add(); + if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) + $to = strval(Configuration::get('PS_SHOP_EMAIL')); + else + { + $to = new Contact((int)(Configuration::get('PS_MAIL_EMAIL_MESSAGE'))); + $to = strval($to->email); + } + $toName = strval(Configuration::get('PS_SHOP_NAME')); + $customer = new Customer((int)(self::$cookie->id_customer)); + if (Validate::isLoadedObject($customer)) + Mail::Send((int)(self::$cookie->id_lang), 'order_customer_comment', Mail::l('Message from a customer'), + array( + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{email}' => $customer->email, + '{id_order}' => (int)($message->id_order), + '{message}' => $message->message), + $to, $toName, $customer->email, $customer->firstname.' '.$customer->lastname); + if (Tools::getValue('ajax') != 'true') + Tools::redirect('order-detail.php?id_order='.(int)($idOrder)); + } + else + { + $this->errors[] = Tools::displayError('Order not found'); + } + } + } + + if (!$id_order = (int)(Tools::getValue('id_order')) OR !Validate::isUnsignedId($id_order)) + $this->errors[] = Tools::displayError('Order ID required'); + else + { + $order = new Order($id_order); + if (Validate::isLoadedObject($order) AND $order->id_customer == self::$cookie->id_customer) + { + $id_order_state = (int)($order->getCurrentState()); + $carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang)); + $addressInvoice = new Address((int)($order->id_address_invoice)); + $addressDelivery = new Address((int)($order->id_address_delivery)); + if ($order->total_discounts > 0) + self::$smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts)); + $products = $order->getProducts(); + + $customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart)); + Product::addCustomizationPrice($products, $customizedDatas); + + $customer = new Customer($order->id_customer); + + self::$smarty->assign(array( + 'shop_name' => strval(Configuration::get('PS_SHOP_NAME')), + 'order' => $order, + 'return_allowed' => (int)($order->isReturnable()), + 'currency' => new Currency($order->id_currency), + 'order_state' => (int)($id_order_state), + 'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')), + 'invoice' => (OrderState::invoiceAvailable((int)($id_order_state)) AND $order->invoice_number), + 'order_history' => $order->getHistory((int)(self::$cookie->id_lang), false, true), + 'products' => $products, + 'discounts' => $order->getDiscounts(), + 'carrier' => $carrier, + 'address_invoice' => $addressInvoice, + 'invoiceState' => (Validate::isLoadedObject($addressInvoice) AND $addressInvoice->id_state) ? new State((int)($addressInvoice->id_state)) : false, + 'address_delivery' => $addressDelivery, + 'deliveryState' => (Validate::isLoadedObject($addressDelivery) AND $addressDelivery->id_state) ? new State((int)($addressDelivery->id_state)) : false, + 'is_guest' => false, + 'messages' => Message::getMessagesByOrderId((int)($order->id)), + 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, + 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, + 'use_tax' => Configuration::get('PS_TAX'), + 'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC), + 'customizedDatas' => $customizedDatas)); + if ($carrier->url AND $order->shipping_number) + self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); + self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order))); + Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order)); + } + else + $this->errors[] = Tools::displayError('Cannot find this order'); + } + } + + public function displayHeader() + { + if (Tools::getValue('ajax') != 'true') + parent::displayHeader(); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'order-detail.tpl'); + } + + public function displayFooter() + { + if (Tools::getValue('ajax') != 'true') + parent::displayFooter(); + } +} + diff --git a/controllers/OrderFollowController.php b/controllers/OrderFollowController.php new file mode 100644 index 000000000..2fee624fc --- /dev/null +++ b/controllers/OrderFollowController.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderFollowControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'order-follow.php'; + $this->authRedirection = 'order-follow.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function preProcess() + { + parent::preProcess(); + + if (Tools::isSubmit('submitReturnMerchandise')) + { + $customizationQtyInput = Tools::getValue('customization_qty_input'); + + if (!$id_order = (int)(Tools::getValue('id_order'))) + Tools::redirect('history.php'); + if (!$order_qte_input = Tools::getValue('order_qte_input')) + Tools::redirect('order-follow.php?errorDetail1'); + if ($customizationIds = Tools::getValue('customization_ids') AND !$customizationQtyInput) + Tools::redirect('order-follow.php?errorDetail1'); + if (!$ids_order_detail = Tools::getValue('ids_order_detail') AND !$customizationIds) + Tools::redirect('order-follow.php?errorDetail2'); + + $order = new Order((int)($id_order)); + if (!$order->isReturnable()) Tools::redirect('order-follow.php?errorNotReturnable'); + if ($order->id_customer != self::$cookie->id_customer) + die(Tools::displayError()); + $orderReturn = new OrderReturn(); + $orderReturn->id_customer = (int)(self::$cookie->id_customer); + $orderReturn->id_order = $id_order; + $orderReturn->question = strval(Tools::getValue('returnText')); + if (empty($orderReturn->question)) + Tools::redirect('order-follow.php?errorMsg'); + if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput)) + Tools::redirect('order-follow.php?errorQuantity'); + + $orderReturn->state = 1; + $orderReturn->add(); + $orderReturn->addReturnDetail($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput); + Module::hookExec('orderReturn', array('orderReturn' => $orderReturn)); + Tools::redirect('order-follow.php'); + } + + $ordersReturn = OrderReturn::getOrdersReturn((int)(self::$cookie->id_customer)); + if (Tools::isSubmit('errorQuantity')) + self::$smarty->assign('errorQuantity', true); + elseif (Tools::isSubmit('errorMsg')) + self::$smarty->assign('errorMsg', true); + elseif (Tools::isSubmit('errorDetail1')) + self::$smarty->assign('errorDetail1', true); + elseif (Tools::isSubmit('errorDetail2')) + self::$smarty->assign('errorDetail2', true); + elseif (Tools::isSubmit('errorNotReturnable')) + self::$smarty->assign('errorNotReturnable',true); + + self::$smarty->assign('ordersReturn', $ordersReturn); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'history.css'); + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js', _THEME_JS_DIR_.'history.js')); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'order-follow.tpl'); + } +} + diff --git a/controllers/OrderOpcController.php b/controllers/OrderOpcController.php new file mode 100644 index 000000000..29e4aa346 --- /dev/null +++ b/controllers/OrderOpcController.php @@ -0,0 +1,451 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +ControllerFactory::includeController('ParentOrderController'); + +class OrderOpcControllerCore extends ParentOrderController +{ + public $isLogged; + + public function preProcess() + { + parent::preProcess(); + if ($this->nbProducts) + self::$smarty->assign('virtual_cart', false); + $this->isLogged = (bool)((int)(self::$cookie->id_customer) AND Customer::customerIdExistsStatic((int)(self::$cookie->id_customer))); + + if (self::$cart->nbProducts()) + { + if (Tools::isSubmit('ajax')) + { + if (Tools::isSubmit('method')) + { + switch (Tools::getValue('method')) + { + case 'updateMessage': + if (Tools::isSubmit('message')) + { + $txtMessage = urldecode(Tools::getValue('message')); + $this->_updateMessage($txtMessage); + if (sizeof($this->errors)) + die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}'); + die(true); + } + break; + case 'updateCarrierAndGetPayments': + if (Tools::isSubmit('id_carrier') AND Tools::isSubmit('recyclable') AND Tools::isSubmit('gift') AND Tools::isSubmit('gift_message')) + { + if ($this->_processCarrier()) + { + $return = array( + 'summary' => self::$cart->getSummaryDetails(), + 'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), + 'HOOK_PAYMENT' => self::_getPaymentMethods() + ); + die(Tools::jsonEncode($return)); + } + else + $this->errors[] = Tools::displayError('Error occurred updating cart.'); + if (sizeof($this->errors)) + die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}'); + exit; + } + break; + case 'updateTOSStatusAndGetPayments': + if (Tools::isSubmit('checked')) + { + self::$cookie->checkedTOS = (int)(Tools::getValue('checked')); + die(Tools::jsonEncode(array( + 'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), + 'HOOK_PAYMENT' => self::_getPaymentMethods() + ))); + } + break; + case 'getCarrierList': + die(Tools::jsonEncode(self::_getCarrierList())); + break; + case 'editCustomer': + if (!$this->isLogged) + exit; + $customer = new Customer((int)self::$cookie->id_customer); + if (Tools::getValue('years')) + $customer->birthday = (int)Tools::getValue('years').'-'.(int)Tools::getValue('months').'-'.(int)Tools::getValue('days'); + $_POST['lastname'] = $_POST['customer_lastname']; + $_POST['firstname'] = $_POST['customer_firstname']; + $this->errors = $customer->validateControler(); + $customer->newsletter = (int)Tools::isSubmit('newsletter'); + $customer->optin = (int)Tools::isSubmit('optin'); + $return = array( + 'hasError' => !empty($this->errors), + 'errors' => $this->errors, + 'id_customer' => (int)self::$cookie->id_customer, + 'token' => Tools::getToken(false) + ); + if (!sizeof($this->errors)) + $return['isSaved'] = (bool)$customer->update(); + else + $return['isSaved'] = false; + die(Tools::jsonEncode($return)); + break; + case 'getAddressBlockAndCarriersAndPayments': + if (self::$cookie->isLogged()) + { + if (file_exists(_PS_MODULE_DIR_.'blockuserinfo/blockuserinfo.php')) + { + include_once(_PS_MODULE_DIR_.'blockuserinfo/blockuserinfo.php'); + $blockUserInfo = new BlockUserInfo(); + } + self::$smarty->assign('isVirtualCart', self::$cart->isVirtualCart()); + $this->_assignAddress(); + // Wrapping fees + $wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')); + $wrapping_fees_tax = new Tax((int)(Configuration::get('PS_GIFT_WRAPPING_TAX'))); + $wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100))); + $return = array( + 'order_opc_adress' => self::$smarty->fetch(_PS_THEME_DIR_.'order-address.tpl'), + 'block_user_info' => (isset($blockUserInfo) ? $blockUserInfo->hookTop(array()) : ''), + 'carrier_list' => self::_getCarrierList(), + 'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), + 'HOOK_PAYMENT' => self::_getPaymentMethods(), + 'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)(self::$cookie->id_currency)))) + ); + die(Tools::jsonEncode($return)); + } + die(Tools::displayError()); + break; + case 'makeFreeOrder': + /* Bypass payment step if total is 0 */ + if (($id_order = $this->_checkFreeOrder()) AND $id_order) + { + $email = self::$cookie->email; + if (self::$cookie->is_guest) + self::$cookie->logout(); // If guest we clear the cookie for security reason + die('freeorder:'.$id_order.':'.$email); + } + exit; + break; + case 'updateAddressesSelected': + $id_address_delivery = (int)(Tools::getValue('id_address_delivery')); + $id_address_invoice = (int)(Tools::getValue('id_address_invoice')); + $address_delivery = new Address((int)(Tools::getValue('id_address_delivery'))); + $address_invoice = ((int)(Tools::getValue('id_address_delivery')) == (int)(Tools::getValue('id_address_invoice')) ? $address_delivery : new Address((int)(Tools::getValue('id_address_invoice')))); + + if (!Address::isCountryActiveById((int)(Tools::getValue('id_address_delivery')))) + $this->errors[] = Tools::displayError('This address is not in a valid area.'); + elseif (!Validate::isLoadedObject($address_delivery) OR !Validate::isLoadedObject($address_invoice) OR $address_invoice->deleted OR $address_delivery->deleted) + $this->errors[] = Tools::displayError('This address is invalid.'); + else + { + self::$cart->id_address_delivery = (int)(Tools::getValue('id_address_delivery')); + self::$cart->id_address_invoice = Tools::isSubmit('same') ? self::$cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice')); + if (!self::$cart->update()) + $this->errors[] = Tools::displayError('An error occurred while updating your cart.'); + if (!sizeof($this->errors)) + { + if (self::$cookie->id_customer) + { + $customer = new Customer((int)(self::$cookie->id_customer)); + $groups = $customer->getGroups(); + } + else + $groups = array(1); + $result = self::_getCarrierList(); + // Wrapping fees + $wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')); + $wrapping_fees_tax = new Tax((int)(Configuration::get('PS_GIFT_WRAPPING_TAX'))); + $wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100))); + $result = array_merge($result, array( + 'summary' => self::$cart->getSummaryDetails(), + 'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), + 'HOOK_PAYMENT' => self::_getPaymentMethods(), + 'gift_price' => Tools::displayPrice(Tools::convertPrice(Product::getTaxCalculationMethod() == 1 ? $wrapping_fees : $wrapping_fees_tax_inc, new Currency((int)(self::$cookie->id_currency)))) + )); + die(Tools::jsonEncode($result)); + } + } + if (sizeof($this->errors)) + die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}'); + break; + default: + exit; + } + } + exit; + } + } + elseif (Tools::isSubmit('ajax')) + exit; + } + + public function setMedia() + { + parent::setMedia(); + + // Adding CSS style sheet + Tools::addCSS(_THEME_CSS_DIR_.'order-opc.css'); + // Adding JS files + Tools::addJS(_THEME_JS_DIR_.'order-opc.js'); + Tools::addJs(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js'); + Tools::addJS(_THEME_JS_DIR_.'tools/statesManagement.js'); + } + + public function process() + { + // SHOPPING CART + $this->_assignSummaryInformations(); + // WRAPPING AND TOS + $this->_assignWrappingAndTOS(); + + $selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT')); + $countries = Country::getCountries((int)(self::$cookie->id_lang), true); + self::$smarty->assign(array( + 'isLogged' => $this->isLogged, + 'isGuest' => isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0, + 'countries' => $countries, + 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, + 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), + 'errorCarrier' => Tools::displayError('You must choose a carrier before', false), + 'errorTOS' => Tools::displayError('You must accept terms of service before', false), + 'isPaymentStep' => (bool)(isset($_GET['isPaymentStep']) AND $_GET['isPaymentStep']) + )); + $years = Tools::dateYears(); + $months = Tools::dateMonths(); + $days = Tools::dateDays(); + self::$smarty->assign(array( + 'years' => $years, + 'months' => $months, + 'days' => $days, + )); + + /* Load guest informations */ + if ($this->isLogged AND self::$cookie->is_guest) + self::$smarty->assign('guestInformations', $this->_getGuestInformations()); + + if ($this->isLogged) + $this->_assignAddress(); // ADDRESS + // CARRIER + $this->_assignCarrier(); + // PAYMENT + $this->_assignPayment(); + Tools::safePostVars(); + + self::$smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active); + } + + public function displayHeader() + { + if (Tools::getValue('ajax') != 'true') + parent::displayHeader(); + } + + public function displayContent() + { + parent::displayContent(); + + self::$smarty->display(_PS_THEME_DIR_.'errors.tpl'); + self::$smarty->display(_PS_THEME_DIR_.'order-opc.tpl'); + } + + public function displayFooter() + { + if (Tools::getValue('ajax') != 'true') + parent::displayFooter(); + } + + protected function _getGuestInformations() + { + $customer = new Customer((int)(self::$cookie->id_customer)); + $address_delivery = new Address((int)self::$cart->id_address_delivery); + + if ($customer->birthday) + $birthday = explode('-', $customer->birthday); + else + $birthday = array('0', '0', '0'); + + return array( + 'id_customer' => (int)(self::$cookie->id_customer), + 'email' => Tools::htmlentitiesUTF8($customer->email), + 'customer_lastname' => Tools::htmlentitiesUTF8($customer->lastname), + 'customer_firstname' => Tools::htmlentitiesUTF8($customer->firstname), + 'newsletter' => (int)$customer->newsletter, + 'optin' => (int)$customer->optin, + 'id_address_delivery' => (int)self::$cart->id_address_delivery, + 'company' => Tools::htmlentitiesUTF8($address_delivery->company), + 'lastname' => Tools::htmlentitiesUTF8($address_delivery->lastname), + 'firstname' => Tools::htmlentitiesUTF8($address_delivery->firstname), + 'vat_number' => Tools::htmlentitiesUTF8($address_delivery->vat_number), + 'dni' => Tools::htmlentitiesUTF8($address_delivery->dni), + 'address1' => Tools::htmlentitiesUTF8($address_delivery->address1), + 'postcode' => Tools::htmlentitiesUTF8($address_delivery->postcode), + 'city' => Tools::htmlentitiesUTF8($address_delivery->city), + 'phone' => Tools::htmlentitiesUTF8($address_delivery->phone), + 'phone_mobile' => Tools::htmlentitiesUTF8($address_delivery->phone_mobile), + 'id_country' => (int)($address_delivery->id_country), + 'id_state' => (int)($address_delivery->id_state), + 'id_gender' => (int)$customer->id_gender, + 'sl_year' => $birthday[0], + 'sl_month' => $birthday[1], + 'sl_day' => $birthday[2] + ); + } + + protected function _assignCarrier() + { + if (!$this->isLogged) + { + $carriers = Carrier::getCarriersForOrder(Country::getIdZone((int)Configuration::get('PS_COUNTRY_DEFAULT'))); + self::$smarty->assign(array( + 'checked' => $this->_setDefaultCarrierSelection($carriers), + 'carriers' => $carriers, + 'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')), + 'HOOK_EXTRACARRIER' => NULL, + 'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)) + )); + } + else + parent::_assignCarrier(); + } + + protected function _assignPayment() + { + self::$smarty->assign(array( + 'HOOK_TOP_PAYMENT' => ($this->isLogged ? Module::hookExec('paymentTop') : ''), + 'HOOK_PAYMENT' => self::_getPaymentMethods() + )); + } + + protected function _getPaymentMethods() + { + if (!$this->isLogged) + return '

'.Tools::displayError('Please sign in to see payment methods').'

'; + if (self::$cart->OrderExists()) + return '

'.Tools::displayError('Error: this order is already validated').'

'; + if (!self::$cart->id_customer OR !Customer::customerIdExistsStatic(self::$cart->id_customer) OR Customer::isBanned(self::$cart->id_customer)) + return '

'.Tools::displayError('Error: no customer').'

'; + $address_delivery = new Address(self::$cart->id_address_delivery); + $address_invoice = (self::$cart->id_address_delivery == self::$cart->id_address_invoice ? $address_delivery : new Address(self::$cart->id_address_invoice)); + if (!self::$cart->id_address_delivery OR !self::$cart->id_address_invoice OR !Validate::isLoadedObject($address_delivery) OR !Validate::isLoadedObject($address_invoice) OR $address_invoice->deleted OR $address_delivery->deleted) + return '

'.Tools::displayError('Error: please choose an address').'

'; + if (!self::$cart->id_carrier AND !self::$cart->isVirtualCart()) + return '

'.Tools::displayError('Error: please choose a carrier').'

'; + elseif (self::$cart->id_carrier != 0) + { + $carrier = new Carrier((int)(self::$cart->id_carrier)); + if (!Validate::isLoadedObject($carrier) OR $carrier->deleted OR !$carrier->active) + return '

'.Tools::displayError('Error: the carrier is invalid').'

'; + } + if (!self::$cart->id_currency) + return '

'.Tools::displayError('Error: no currency has been selected').'

'; + if (!self::$cookie->checkedTOS AND Configuration::get('PS_CONDITIONS')) + return '

'.Tools::displayError('Please accept Terms of Service').'

'; + + /* If some products have disappear */ + if (!self::$cart->checkQuantities()) + return '

'.Tools::displayError('An item in your cart is no longer available, you cannot proceed with your order.').'

'; + + /* Check minimal amount */ + $currency = Currency::getCurrency((int)self::$cart->id_currency); + + $orderTotal = self::$cart->getOrderTotal(); + $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); + if ($orderTotal < $minimalPurchase) + return '

'.Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). + ' '.Tools::displayError('is required in order to validate your order.').'

'; + + /* Bypass payment step if total is 0 */ + if (self::$cart->getOrderTotal() <= 0) + return '

'; + + $return = Module::hookExecPayment(); + if (!$return) + return '

'.Tools::displayError('No payment method is available').'

'; + return $return; + } + + protected function _getCarrierList() + { + $address_delivery = new Address(self::$cart->id_address_delivery); + if (self::$cookie->id_customer) + { + $customer = new Customer((int)(self::$cookie->id_customer)); + $groups = $customer->getGroups(); + } + else + $groups = array(1); + if (!Address::isCountryActiveById((int)(self::$cart->id_address_delivery))) + $this->errors[] = Tools::displayError('This address is not in a valid area.'); + elseif (!Validate::isLoadedObject($address_delivery) OR $address_delivery->deleted) + $this->errors[] = Tools::displayError('This address is invalid.'); + else + { + $carriers = Carrier::getCarriersForOrder((int)Address::getZoneById((int)($address_delivery->id)), $groups); + $result = array( + 'checked' => $this->_setDefaultCarrierSelection($carriers), + 'carriers' => $carriers, + 'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)), + 'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address_delivery)) + ); + return $result; + } + if (sizeof($this->errors)) + return array( + 'hasError' => true, + 'errors' => $this->errors + ); + } + + protected function _setDefaultCarrierSelection($carriers) + { + if (sizeof($carriers)) + { + $defaultCarrierIsPresent = false; + if (self::$cart->id_carrier != 0) + foreach ($carriers AS $carrier) + if ($carrier['id_carrier'] == self::$cart->id_carrier) + { + $defaultCarrierIsPresent = true; + self::$cart->id_carrier = $carrier['id_carrier']; + } + if (!$defaultCarrierIsPresent) + foreach ($carriers AS $carrier) + if ($carrier['id_carrier'] == Configuration::get('PS_CARRIER_DEFAULT')) + { + $defaultCarrierIsPresent = true; + self::$cart->id_carrier = $carrier['id_carrier']; + } + if (!$defaultCarrierIsPresent) + self::$cart->id_carrier = $carriers[0]['id_carrier']; + } + else + self::$cart->id_carrier = 0; + if (self::$cart->update()) + return self::$cart->id_carrier; + return 0; + } +} + + diff --git a/controllers/OrderReturnController.php b/controllers/OrderReturnController.php new file mode 100644 index 000000000..367533d64 --- /dev/null +++ b/controllers/OrderReturnController.php @@ -0,0 +1,99 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderReturnControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'order-return.php'; + $this->authRedirection = 'order-follow.php'; + $this->ssl = true; + + parent::__construct(); + + header("Cache-Control: no-cache, must-revalidate"); + header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); + } + + public function preProcess() + { + parent::preProcess(); + + if (!isset($_GET['id_order_return']) OR !Validate::isUnsignedId($_GET['id_order_return'])) + $this->errors[] = Tools::displayError('Order ID required'); + else + { + $orderRet = new OrderReturn((int)($_GET['id_order_return'])); + if (Validate::isLoadedObject($orderRet) AND $orderRet->id_customer == self::$cookie->id_customer) + { + $order = new Order((int)($orderRet->id_order)); + if (Validate::isLoadedObject($order)) + { + $state = new OrderReturnState((int)($orderRet->state)); + self::$smarty->assign(array( + 'orderRet' => $orderRet, + 'order' => $order, + 'state_name' => $state->name[(int)(self::$cookie->id_lang)], + 'return_allowed' => false, + 'products' => OrderReturn::getOrdersReturnProducts((int)($orderRet->id), $order), + 'returnedCustomizations' => OrderReturn::getReturnedCustomizedProducts((int)($orderRet->id_order)), + 'customizedDatas' => Product::getAllCustomizedDatas((int)($order->id_cart)) + )); + } + else + $this->errors[] = Tools::displayError('Cannot find this order return'); + } + else + $this->errors[] = Tools::displayError('Cannot find this order return'); + } + + self::$smarty->assign(array( + 'errors' => $this->errors, + 'nbdaysreturn' => (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS')) + )); + } + + public function displayHeader() + { + if (Tools::getValue('ajax') != 'true') + parent::displayHeader(); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'order-return.tpl'); + } + + public function displayFooter() + { + if (Tools::getValue('ajax') != 'true') + parent::displayFooter(); + } +} + diff --git a/controllers/OrderSlipController.php b/controllers/OrderSlipController.php new file mode 100644 index 000000000..2b3b6feaa --- /dev/null +++ b/controllers/OrderSlipController.php @@ -0,0 +1,60 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class OrderSlipControllerCore extends FrontController +{ + public function __construct() + { + $this->auth = true; + $this->php_self = 'order-slip.php'; + $this->authRedirection = 'order-slip.php'; + $this->ssl = true; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'history.css'); + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js',_THEME_JS_DIR_.'history.js')); + } + + public function process() + { + parent::process(); + self::$smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)(self::$cookie->id_customer))); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'order-slip.tpl'); + } +} + diff --git a/controllers/PageNotFoundController.php b/controllers/PageNotFoundController.php new file mode 100644 index 000000000..7776a60d9 --- /dev/null +++ b/controllers/PageNotFoundController.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PageNotFoundControllerCore extends FrontController +{ + public function displayContent() + { + self::$smarty->display(_PS_THEME_DIR_.'404.tpl'); + } +} + diff --git a/controllers/ParentOrderController.php b/controllers/ParentOrderController.php new file mode 100644 index 000000000..347c1a02d --- /dev/null +++ b/controllers/ParentOrderController.php @@ -0,0 +1,391 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Class FreeOrder to use PaymentModule (abstract class, cannot be instancied) */ +class FreeOrder extends PaymentModule {} + +class ParentOrderControllerCore extends FrontController +{ + public $nbProducts; + + public function __construct() + { + $this->ssl = true; + parent::__construct(); + + /* Disable some cache related bugs on the cart/order */ + header('Cache-Control: no-cache, must-revalidate'); + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); + } + + public function init() + { + parent::init(); + $this->nbProducts = self::$cart->nbProducts(); + } + + public function preProcess() + { + global $isVirtualCart; + + parent::preProcess(); + + // Redirect to the good order process + if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 0 AND strpos($_SERVER['PHP_SELF'], 'order.php') === false) + Tools::redirect('order.php'); + if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1 AND strpos($_SERVER['PHP_SELF'], 'order-opc.php') === false) + { + if (isset($_GET['step']) AND $_GET['step'] == 3) + Tools::redirect('order-opc.php?isPaymentStep=true'); + Tools::redirect('order-opc.php'); + } + + if (Configuration::get('PS_CATALOG_MODE')) + $this->errors[] = Tools::displayError('This store has not accepted your new order.'); + + if (Tools::isSubmit('submitReorder') AND $id_order = (int)Tools::getValue('id_order')) + { + $oldCart = new Cart(Order::getCartIdStatic((int)$id_order, (int)self::$cookie->id_customer)); + $duplication = $oldCart->duplicate(); + if (!$duplication OR !Validate::isLoadedObject($duplication['cart'])) + $this->errors[] = Tools::displayError('Sorry, we cannot renew your order.'); + elseif (!$duplication['success']) + $this->errors[] = Tools::displayError('Missing items - we are unable renew your order'); + else + { + self::$cookie->id_cart = $duplication['cart']->id; + self::$cookie->write(); + if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) + Tools::redirect('order-opc.php'); + Tools::redirect('order.php'); + } + } + + if ($this->nbProducts) + { + if (Tools::isSubmit('submitAddDiscount') AND Tools::getValue('discount_name')) + { + $discountName = Tools::getValue('discount_name'); + if (!Validate::isDiscountName($discountName)) + $this->errors[] = Tools::displayError('Voucher name invalid.'); + else + { + $discount = new Discount((int)(Discount::getIdByName($discountName))); + if (Validate::isLoadedObject($discount)) + { + if ($tmpError = self::$cart->checkDiscountValidity($discount, self::$cart->getDiscounts(), self::$cart->getOrderTotal(), self::$cart->getProducts(), true)) + $this->errors[] = $tmpError; + } + else + $this->errors[] = Tools::displayError('Voucher name invalid.'); + if (!sizeof($this->errors)) + { + self::$cart->addDiscount((int)($discount->id)); + Tools::redirect('order-opc.php'); + } + } + self::$smarty->assign(array( + 'errors' => $this->errors, + 'discount_name' => Tools::safeOutput($discountName) + )); + } + elseif (isset($_GET['deleteDiscount']) AND Validate::isUnsignedId($_GET['deleteDiscount'])) + { + self::$cart->deleteDiscount((int)($_GET['deleteDiscount'])); + Tools::redirect('order-opc.php'); + } + + /* Is there only virtual product in cart */ + if ($isVirtualCart = self::$cart->isVirtualCart()) + $this->_setNoCarrier(); + } + + self::$smarty->assign('back', Tools::safeOutput(Tools::getValue('back'))); + } + + public function setMedia() + { + parent::setMedia(); + + // Adding CSS style sheet + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen'); + + // Adding JS files + Tools::addJS(_THEME_JS_DIR_.'tools.js'); + if ((Configuration::get('PS_ORDER_PROCESS_TYPE') == 0 AND Tools::getValue('step') == 1) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) + Tools::addJS(_THEME_JS_DIR_.'order-address.js'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js'); + if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) + { + Tools::addJS(_THEME_JS_DIR_.'cart-summary.js'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery-typewatch.pack.js'); + } + + } + + /** + * @return boolean + */ + protected function _checkFreeOrder() + { + if (self::$cart->getOrderTotal() <= 0) + { + $order = new FreeOrder(); + $order->free_order_class = true; + $order->validateOrder((int)(self::$cart->id), _PS_OS_PAYMENT_, 0, Tools::displayError('Free order', false)); + return (int)Order::getOrderByCartId((int)self::$cart->id); + } + return false; + } + + protected function _updateMessage($messageContent) + { + if ($messageContent) + { + if (!Validate::isMessage($messageContent)) + $this->errors[] = Tools::displayError('Invalid message'); + elseif ($oldMessage = Message::getMessageByCartId((int)(self::$cart->id))) + { + $message = new Message((int)($oldMessage['id_message'])); + $message->message = htmlentities($messageContent, ENT_COMPAT, 'UTF-8'); + $message->update(); + } + else + { + $message = new Message(); + $message->message = htmlentities($messageContent, ENT_COMPAT, 'UTF-8'); + $message->id_cart = (int)(self::$cart->id); + $message->id_customer = (int)(self::$cart->id_customer); + $message->add(); + } + } + else + { + if ($oldMessage = Message::getMessageByCartId((int)(self::$cart->id))) + { + $message = new Message((int)($oldMessage['id_message'])); + $message->delete(); + } + } + return true; + } + + protected function _processCarrier() + { + self::$cart->recyclable = (int)(Tools::getValue('recyclable')); + self::$cart->gift = (int)(Tools::getValue('gift')); + if ((int)(Tools::getValue('gift'))) + { + if (!Validate::isMessage($_POST['gift_message'])) + $this->errors[] = Tools::displayError('Invalid gift message'); + else + self::$cart->gift_message = strip_tags($_POST['gift_message']); + } + + if (isset(self::$cookie->id_customer) AND self::$cookie->id_customer) + { + $address = new Address((int)(self::$cart->id_address_delivery)); + if (!($id_zone = Address::getZoneById($address->id))) + $this->errors[] = Tools::displayError('No zone match with your address'); + } + else + $id_zone = Country::getIdZone((int)Configuration::get('PS_COUNTRY_DEFAULT')); + + if (Validate::isInt(Tools::getValue('id_carrier')) AND sizeof(Carrier::checkCarrierZone((int)(Tools::getValue('id_carrier')), (int)($id_zone)))) + self::$cart->id_carrier = (int)(Tools::getValue('id_carrier')); + elseif (!self::$cart->isVirtualCart() AND (int)(Tools::getValue('id_carrier')) != 0) + $this->errors[] = Tools::displayError('Invalid carrier or no carrier selected'); + + Module::hookExec('processCarrier', array('cart' => self::$cart)); + + return self::$cart->update(); + } + + protected function _assignSummaryInformations() + { + global $currency; + + if (file_exists(_PS_SHIP_IMG_DIR_.(int)(self::$cart->id_carrier).'.jpg')) + self::$smarty->assign('carrierPicture', 1); + $summary = self::$cart->getSummaryDetails(); + $customizedDatas = Product::getAllCustomizedDatas((int)(self::$cart->id)); + Product::addCustomizationPrice($summary['products'], $customizedDatas); + + if ($free_ship = Tools::convertPrice((float)(Configuration::get('PS_SHIPPING_FREE_PRICE')), new Currency((int)(self::$cart->id_currency)))) + { + $discounts = self::$cart->getDiscounts(); + $total_free_ship = $free_ship - ($summary['total_products_wt'] + $summary['total_discounts']); + foreach ($discounts as $discount) + if ($discount['id_discount_type'] == 3) + { + $total_free_ship = 0; + break; + } + self::$smarty->assign('free_ship', $total_free_ship); + } + // for compatibility with 1.2 themes + foreach($summary['products'] AS $key => $product) + $summary['products'][$key]['quantity'] = $product['cart_quantity']; + self::$smarty->assign($summary); + self::$smarty->assign(array( + 'token_cart' => Tools::getToken(false), + 'isVirtualCart' => self::$cart->isVirtualCart(), + 'productNumber' => self::$cart->nbProducts(), + 'voucherAllowed' => Configuration::get('PS_VOUCHERS'), + 'shippingCost' => self::$cart->getOrderTotal(true, Cart::ONLY_SHIPPING), + 'shippingCostTaxExc' => self::$cart->getOrderTotal(false, Cart::ONLY_SHIPPING), + 'customizedDatas' => $customizedDatas, + 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, + 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, + 'lastProductAdded' => self::$cart->getLastProduct(), + 'displayVouchers' => Discount::getVouchersToCartDisplay((int)(self::$cookie->id_lang), (isset(self::$cookie->id_customer) ? (int)(self::$cookie->id_customer) : 0)), + 'currencySign' => $currency->sign, + 'currencyRate' => $currency->conversion_rate, + 'currencyFormat' => $currency->format, + 'currencyBlank' => $currency->blank)); + self::$smarty->assign(array( + 'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary), + 'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary) + )); + } + + protected function _assignAddress() + { + if (!Customer::getAddressesTotalById((int)(self::$cookie->id_customer))) + Tools::redirect('address.php?back=order.php?step=1'); + $customer = new Customer((int)(self::$cookie->id_customer)); + if (Validate::isLoadedObject($customer)) + { + /* Getting customer addresses */ + $customerAddresses = $customer->getAddresses((int)(self::$cookie->id_lang)); + self::$smarty->assign('addresses', $customerAddresses); + + /* Setting default addresses for cart */ + if ((!isset(self::$cart->id_address_delivery) OR empty(self::$cart->id_address_delivery)) AND sizeof($customerAddresses)) + { + self::$cart->id_address_delivery = (int)($customerAddresses[0]['id_address']); + $update = 1; + } + if ((!isset(self::$cart->id_address_invoice) OR empty(self::$cart->id_address_invoice)) AND sizeof($customerAddresses)) + { + self::$cart->id_address_invoice = (int)($customerAddresses[0]['id_address']); + $update = 1; + } + /* Update cart addresses only if needed */ + if (isset($update) AND $update) + self::$cart->update(); + + /* If delivery address is valid in cart, assign it to Smarty */ + if (isset(self::$cart->id_address_delivery)) + { + $deliveryAddress = new Address((int)(self::$cart->id_address_delivery)); + if (Validate::isLoadedObject($deliveryAddress) AND ($deliveryAddress->id_customer == $customer->id)) + self::$smarty->assign('delivery', $deliveryAddress); + } + + /* If invoice address is valid in cart, assign it to Smarty */ + if (isset(self::$cart->id_address_invoice)) + { + $invoiceAddress = new Address((int)(self::$cart->id_address_invoice)); + if (Validate::isLoadedObject($invoiceAddress) AND ($invoiceAddress->id_customer == $customer->id)) + self::$smarty->assign('invoice', $invoiceAddress); + } + } + if ($oldMessage = Message::getMessageByCartId((int)(self::$cart->id))) + self::$smarty->assign('oldMessage', $oldMessage['message']); + } + + protected function _assignCarrier() + { + $customer = new Customer((int)(self::$cookie->id_customer)); + $address = new Address((int)(self::$cart->id_address_delivery)); + $id_zone = Address::getZoneById((int)($address->id)); + $carriers = Carrier::getCarriersForOrder($id_zone, $customer->getGroups()); + + $checked = 0; + if (Validate::isUnsignedInt(self::$cart->id_carrier) AND self::$cart->id_carrier) + { + $carrier = new Carrier((int)(self::$cart->id_carrier)); + if ($carrier->active AND !$carrier->deleted) + $checked = (int)(self::$cart->id_carrier); + } + self::$smarty->assign(array( + 'checked' => (int)($checked), + 'carriers' => $carriers, + 'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')), + 'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)), + 'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers)) + )); + } + + protected function _assignWrappingAndTOS() + { + // Wrapping fees + $wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')); + $wrapping_fees_tax = new Tax((int)(Configuration::get('PS_GIFT_WRAPPING_TAX'))); + $wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100))); + + // TOS + $cms = new CMS((int)(Configuration::get('PS_CONDITIONS_CMS_ID')), (int)(self::$cookie->id_lang)); + $this->link_conditions = self::$link->getCMSLink($cms, $cms->link_rewrite, true); + if (!strpos($this->link_conditions, '?')) + $this->link_conditions .= '?content_only=1'; + else + $this->link_conditions .= '&content_only=1'; + + self::$smarty->assign(array( + 'checkedTOS' => (int)(self::$cookie->checkedTOS), + 'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')), + 'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')), + 'cms_id' => (int)(Configuration::get('PS_CONDITIONS_CMS_ID')), + 'conditions' => (int)(Configuration::get('PS_CONDITIONS')), + 'link_conditions' => $this->link_conditions, + 'recyclable' => (int)(self::$cart->recyclable), + 'gift_wrapping_price' => (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')), + 'total_wrapping_cost' => Tools::convertPrice($wrapping_fees_tax_inc, new Currency((int)(self::$cookie->id_currency))), + 'total_wrapping_tax_exc_cost' => Tools::convertPrice($wrapping_fees, new Currency((int)(self::$cookie->id_currency))))); + } + + protected function _assignPayment() + { + self::$smarty->assign(array( + 'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'), + 'HOOK_PAYMENT' => Module::hookExecPayment() + )); + } + + /** + * Set id_carrier to 0 (no shipping price) + * + */ + protected function _setNoCarrier() + { + self::$cart->id_carrier = 0; + self::$cart->update(); + } +} diff --git a/controllers/PasswordController.php b/controllers/PasswordController.php new file mode 100644 index 000000000..5d4dd6a25 --- /dev/null +++ b/controllers/PasswordController.php @@ -0,0 +1,116 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('MIN_PASSWD_LENGTH', 8); + +class PasswordControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'password.php'; + + parent::__construct(); + } + + public function process() + { + parent::process(); + + if (Tools::isSubmit('email')) + { + if (!($email = Tools::getValue('email')) OR !Validate::isEmail($email)) + $this->errors[] = Tools::displayError('Invalid e-mail address'); + else + { + $customer = new Customer(); + $customer->getByemail($email); + if (!Validate::isLoadedObject($customer)) + $this->errors[] = Tools::displayError('There is no account registered to this e-mail address.'); + else + { + if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) + $this->errors[] = Tools::displayError('You can regenerate your password only each').' '.(int)($min_time).' '.Tools::displayError('minute(s)'); + else + { + if (Mail::Send((int)(self::$cookie->id_lang), 'password_query', Mail::l('Password query confirmation'), + array('{email}' => $customer->email, + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{url}' => self::$link->getPageLink('password.php', true).'?token='.$customer->secure_key.'&id_customer='.(int)$customer->id), + $customer->email, + $customer->firstname.' '.$customer->lastname)) + self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email)); + else + $this->errors[] = Tools::displayError('Error occured when sending the e-mail.'); + } + } + } + } + elseif (($token = Tools::getValue('token')) && ($id_customer = (int)(Tools::getValue('id_customer')))) + { + $email = Db::getInstance()->getValue('SELECT `email` FROM '._DB_PREFIX_.'customer c WHERE c.`secure_key` = "'.pSQL($token).'" AND c.id_customer='.(int)($id_customer)); + if ($email) + { + $customer = new Customer(); + $customer->getByemail($email); + if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) + Tools::redirect('authentication.php?error_regen_pwd'); + else + { + $customer->passwd = Tools::encrypt($password = Tools::passwdGen((int)(MIN_PASSWD_LENGTH))); + $customer->last_passwd_gen = date('Y-m-d H:i:s', time()); + if ($customer->update()) + { + if (Mail::Send((int)(self::$cookie->id_lang), 'password', Mail::l('Your password'), + array('{email}' => $customer->email, + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{passwd}' => $password), + $customer->email, + $customer->firstname.' '.$customer->lastname)) + self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email)); + else + $this->errors[] = Tools::displayError('Error occured when sending the e-mail.'); + } + else + $this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.'); + } + } + else + $this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted'); + } + elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer'))) + $this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted'); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'password.tpl'); + } +} + diff --git a/controllers/PricesDropController.php b/controllers/PricesDropController.php new file mode 100644 index 000000000..18a76a2f8 --- /dev/null +++ b/controllers/PricesDropController.php @@ -0,0 +1,65 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PricesDropControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'prices-drop.php'; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'product_list.css'); + } + + public function process() + { + parent::process(); + + $this->productSort(); + $nbProducts = Product::getPricesDrop((int)(self::$cookie->id_lang), NULL, NULL, true); + $this->pagination($nbProducts); + + self::$smarty->assign(array( + 'products' => Product::getPricesDrop((int)(self::$cookie->id_lang), (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay), + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + 'nbProducts' => $nbProducts, + 'homeSize' => Image::getSize('home') + )); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'prices-drop.tpl'); + } +} + diff --git a/controllers/ProductController.php b/controllers/ProductController.php new file mode 100644 index 000000000..ebc1a8b5a --- /dev/null +++ b/controllers/ProductController.php @@ -0,0 +1,461 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProductControllerCore extends FrontController +{ + protected $product; + + public function setMedia() + { + parent::setMedia(); + + Tools::addCSS(_THEME_CSS_DIR_.'product.css'); + Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen'); + Tools::addJS(array( + _PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js', + _PS_JS_DIR_.'jquery/jquery.idTabs.modified.js', + _PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js', + _PS_JS_DIR_.'jquery/jquery.serialScroll-1.2.2-min.js', + _THEME_JS_DIR_.'tools.js', + _THEME_JS_DIR_.'product.js')); + + if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) + { + Tools::addCSS(_PS_CSS_DIR_.'jqzoom.css', 'screen'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery.jqzoom.js'); + } + } + + public function preProcess() + { + if ($id_product = (int)Tools::getValue('id_product')) + $this->product = new Product($id_product, true, self::$cookie->id_lang); + + if (!Validate::isLoadedObject($this->product)) + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + } + else + { + // Automatically redirect to the canonical URL if the current in is the right one + // $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain + if (Validate::isLoadedObject($this->product)) + { + $canonicalURL = self::$link->getProductLink($this->product); + if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) + { + header('HTTP/1.0 301 Moved'); + if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_) + die('[Debug] This page has moved
Please use the following URL instead: '.$canonicalURL.''); + Tools::redirectLink($canonicalURL); + } + } + } + + parent::preProcess(); + + if((int)(Configuration::get('PS_REWRITING_SETTINGS'))) + if ($id_product = (int)Tools::getValue('id_product')) + { + $rewrite_infos = Product::getUrlRewriteInformations((int)$id_product); + + $default_rewrite = array(); + foreach ($rewrite_infos AS $infos) + $default_rewrite[$infos['id_lang']] = self::$link->getProductLink((int)$id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int)$infos['id_lang']); + + self::$smarty->assign('lang_rewrite_urls', $default_rewrite); + } + } + + public function process() + { + parent::process(); + global $cart; + + if (!$id_product = (int)(Tools::getValue('id_product')) OR !Validate::isUnsignedId($id_product)) + $this->errors[] = Tools::displayError('Product not found'); + else + { + if (!Validate::isLoadedObject($this->product) + OR (!$this->product->active AND (Tools::getValue('adtoken') != Tools::encrypt('PreviewProduct'.$this->product->id)) + || !file_exists(dirname(__FILE__).'/../'.Tools::getValue('ad').'/ajax.php'))) + { + header('HTTP/1.1 404 page not found'); + $this->errors[] = Tools::displayError('Pproduct is no longer available.'); + } + elseif (!$this->product->checkAccess((int)(self::$cookie->id_customer))) + $this->errors[] = Tools::displayError('You do not have access to this product.'); + else + { + self::$smarty->assign('virtual', ProductDownload::getIdFromIdProduct((int)($this->product->id))); + + if (!$this->product->active) + self::$smarty->assign('adminActionDisplay', true); + + /* rewrited url set */ + $rewrited_url = self::$link->getProductLink($this->product->id, $this->product->link_rewrite); + + /* Product pictures management */ + require_once('images.inc.php'); + self::$smarty->assign('customizationFormTarget', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI']))); + + if (Tools::isSubmit('submitCustomizedDatas')) + { + $this->pictureUpload($this->product, $cart); + $this->textRecord($this->product, $cart); + $this->formTargetFormat(); + } + elseif (isset($_GET['deletePicture']) AND !$cart->deletePictureToProduct((int)($this->product->id), (int)(Tools::getValue('deletePicture')))) + $this->errors[] = Tools::displayError('An error occurred while deleting the selected picture'); + + $files = self::$cookie->getFamily('pictures_'.(int)($this->product->id)); + $textFields = self::$cookie->getFamily('textFields_'.(int)($this->product->id)); + foreach ($textFields as $key => $textField) + $textFields[$key] = str_replace('
', "\n", $textField); + self::$smarty->assign(array( + 'pictures' => $files, + 'textFields' => $textFields)); + + $productPriceWithTax = Product::getPriceStatic($id_product, true, NULL, 6); + if (Product::$_taxCalculationMethod == PS_TAX_INC) + $productPriceWithTax = Tools::ps_round($productPriceWithTax, 2); + + $productPriceWithoutEcoTax = (float)($productPriceWithTax - $this->product->ecotax); + $configs = Configuration::getMultiple(array('PS_ORDER_OUT_OF_STOCK', 'PS_LAST_QTIES')); + + /* Features / Values */ + $features = $this->product->getFrontFeatures((int)(self::$cookie->id_lang)); + $attachments = $this->product->getAttachments((int)(self::$cookie->id_lang)); + + /* Category */ + $category = false; + if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html')) + { + if (isset($regs[2]) AND is_numeric($regs[2])) + { + if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[2]))))) + $category = new Category((int)($regs[2]), (int)(self::$cookie->id_lang)); + } + elseif (isset($regs[5]) AND is_numeric($regs[5])) + { + if (Product::idIsOnCategoryId((int)($this->product->id), array('0' => array('id_category' => (int)($regs[5]))))) + $category = new Category((int)($regs[5]), (int)(self::$cookie->id_lang)); + } + } + if (!$category) + $category = new Category($this->product->id_category_default, (int)(self::$cookie->id_lang)); + + if (isset($category) AND Validate::isLoadedObject($category)) + { + self::$smarty->assign(array( + 'path' => Tools::getPath((int)$category->id, $this->product->name, true), + 'category' => $category, + 'subCategories' => $category->getSubCategories((int)(self::$cookie->id_lang), true), + 'id_category_current' => (int)($category->id), + 'id_category_parent' => (int)($category->id_parent), + 'return_category_name' => Tools::safeOutput($category->name))); + } + else + self::$smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name)); + + self::$smarty->assign('return_link', (isset($category->id) AND $category->id) ? Tools::safeOutput(self::$link->getCategoryLink($category)) : 'javascript: history.back();'); + + $lang = Configuration::get('PS_LANG_DEFAULT'); + if (Pack::isPack((int)($this->product->id), (int)($lang)) AND !Pack::isInStock((int)($this->product->id), (int)($lang))) + $this->product->quantity = 0; + + $group_reduction = (100 - Group::getReduction((int)(self::$cookie->id_customer))) / 100; + $id_customer = (isset(self::$cookie->id_customer) AND self::$cookie->id_customer) ? (int)(self::$cookie->id_customer) : 0; + $id_group = $id_customer ? (int)(Customer::getDefaultGroupId($id_customer)) : _PS_DEFAULT_CUSTOMER_GROUP_; + $id_country = (int)($id_customer ? Customer::getCurrentCountry($id_customer) : Configuration::get('PS_COUNTRY_DEFAULT')); + + // Tax + $tax = (float)(Tax::getProductTaxRate((int)($this->product->id), $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); + self::$smarty->assign('tax_rate', $tax); + + $ecotax_rate = (float) Tax::getProductEcotaxRate($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + $ecotaxTaxAmount = Tools::ps_round($this->product->ecotax, 2); + if (Product::$_taxCalculationMethod == PS_TAX_INC) + $ecotaxTaxAmount = Tools::ps_round($ecotaxTaxAmount * (1 + $ecotax_rate / 100), 2); + + self::$smarty->assign(array( + 'quantity_discounts' => $this->formatQuantityDiscounts(SpecificPrice::getQuantityDiscounts((int)($this->product->id), (int)(Shop::getCurrentShop()), (int)(self::$cookie->id_currency), $id_country, $id_group), $this->product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, false), (float)($tax)), + 'product' => $this->product, + 'ecotax_tax_inc' => $ecotaxTaxAmount, + 'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2), + 'ecotaxTax_rate' => $ecotax_rate, + 'homeSize' => Image::getSize('home'), + 'product_manufacturer' => new Manufacturer((int)($this->product->id_manufacturer), Configuration::get('PS_LANG_DEFAULT')), + 'token' => Tools::getToken(false), + 'productPriceWithoutEcoTax' => (float)($productPriceWithoutEcoTax), + 'features' => $features, + 'attachments' => $attachments, + 'allow_oosp' => $this->product->isAvailableWhenOutOfStock((int)($this->product->out_of_stock)), + 'last_qties' => (int)($configs['PS_LAST_QTIES']), + 'group_reduction' => $group_reduction, + 'col_img_dir' => _PS_COL_IMG_DIR_, + )); + self::$smarty->assign(array( + 'HOOK_EXTRA_LEFT' => Module::hookExec('extraLeft'), + 'HOOK_EXTRA_RIGHT' => Module::hookExec('extraRight'), + 'HOOK_PRODUCT_OOS' => Hook::productOutOfStock($this->product), + 'HOOK_PRODUCT_FOOTER' => Hook::productFooter($this->product, $category), + 'HOOK_PRODUCT_ACTIONS' => Module::hookExec('productActions'), + 'HOOK_PRODUCT_TAB' => Module::hookExec('productTab'), + 'HOOK_PRODUCT_TAB_CONTENT' => Module::hookExec('productTabContent') + )); + + $images = $this->product->getImages((int)(self::$cookie->id_lang)); + $productImages = array(); + foreach ($images AS $k => $image) + { + if ($image['cover']) + { + self::$smarty->assign('mainImage', $images[0]); + $cover = $image; + $cover['id_image'] = (int)($this->product->id).'-'.$cover['id_image']; + $cover['id_image_only'] = (int)($image['id_image']); + } + $productImages[(int)($image['id_image'])] = $image; + } + if (!isset($cover)) + $cover = array('id_image' => Language::getIsoById(self::$cookie->id_lang).'-default', 'legend' => 'No picture', 'title' => 'No picture'); + $size = Image::getSize('large'); + self::$smarty->assign(array( + 'cover' => $cover, + 'imgWidth' => (int)($size['width']), + 'mediumSize' => Image::getSize('medium'), + 'largeSize' => Image::getSize('large'), + 'accessories' => $this->product->getAccessories((int)(self::$cookie->id_lang)))); + if (sizeof($productImages)) + self::$smarty->assign('images', $productImages); + + /* Attributes / Groups & colors */ + $colors = array(); + $attributesGroups = $this->product->getAttributesGroups((int)(self::$cookie->id_lang)); + if (is_array($attributesGroups) AND sizeof($attributesGroups)) + { + $combinationImages = $this->product->getCombinationImages((int)(self::$cookie->id_lang)); + foreach ($attributesGroups AS $k => $row) + { + /* Color management */ + if (((isset($row['attribute_color']) AND $row['attribute_color']) OR (file_exists(_PS_COL_IMG_DIR_.$row['id_attribute'].'.jpg'))) AND $row['id_attribute_group'] == $this->product->id_color_default) + { + $colors[$row['id_attribute']]['value'] = $row['attribute_color']; + $colors[$row['id_attribute']]['name'] = $row['attribute_name']; + if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) + $colors[$row['id_attribute']]['attributes_quantity'] = 0; + $colors[$row['id_attribute']]['attributes_quantity'] += (int)($row['quantity']); + } + + $groups[$row['id_attribute_group']]['attributes'][$row['id_attribute']] = $row['attribute_name']; + $groups[$row['id_attribute_group']]['name'] = $row['public_group_name']; + $groups[$row['id_attribute_group']]['is_color_group'] = $row['is_color_group']; + if ($row['default_on']) + $groups[$row['id_attribute_group']]['default'] = (int)($row['id_attribute']); + if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) + $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0; + $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] += (int)($row['quantity']); + + $combinations[$row['id_product_attribute']]['attributes_values'][$row['id_attribute_group']] = $row['attribute_name']; + $combinations[$row['id_product_attribute']]['attributes'][] = (int)($row['id_attribute']); + $combinations[$row['id_product_attribute']]['price'] = (float)($row['price']); + $combinations[$row['id_product_attribute']]['ecotax'] = (float)($row['ecotax']); + $combinations[$row['id_product_attribute']]['weight'] = (float)($row['weight']); + $combinations[$row['id_product_attribute']]['quantity'] = (int)($row['quantity']); + $combinations[$row['id_product_attribute']]['reference'] = $row['reference']; + $combinations[$row['id_product_attribute']]['unit_impact'] = $row['unit_price_impact']; + $combinations[$row['id_product_attribute']]['minimal_quantity'] = $row['minimal_quantity']; + $combinations[$row['id_product_attribute']]['id_image'] = isset($combinationImages[$row['id_product_attribute']][0]['id_image']) ? $combinationImages[$row['id_product_attribute']][0]['id_image'] : -1; + } + //wash attributes list (if some attributes are unavailables and if allowed to wash it) + if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) + { + foreach ($groups AS &$group) + foreach ($group['attributes_quantity'] AS $key => &$quantity) + if (!$quantity) + unset($group['attributes'][$key]); + foreach ($colors AS $key => $color) + if (!$color['attributes_quantity']) + unset($colors[$key]); + } + foreach($groups AS &$group) + natcasesort($group['attributes']); + foreach ($combinations AS $id_product_attribute => $comb) + { + $attributeList = ''; + foreach ($comb['attributes'] AS $id_attribute) + $attributeList .= '\''.(int)($id_attribute).'\','; + $attributeList = rtrim($attributeList, ','); + $combinations[$id_product_attribute]['list'] = $attributeList; + } + self::$smarty->assign(array( + 'groups' => $groups, + 'combinaisons' => $combinations, /* Kept for compatibility purpose only */ + 'combinations' => $combinations, + 'colors' => (sizeof($colors) AND $this->product->id_color_default) ? $colors : false, + 'combinationImages' => $combinationImages)); + } + + self::$smarty->assign(array( + 'no_tax' => Tax::excludeTaxeOption() OR !Tax::getProductTaxRate((int)$this->product->id, $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}), + 'customizationFields' => $this->product->getCustomizationFields((int)(self::$cookie->id_lang)) + )); + + // Pack management + self::$smarty->assign('packItems', $this->product->cache_is_pack ? Pack::getItemTable($this->product->id, (int)(self::$cookie->id_lang), true) : array()); + self::$smarty->assign('packs', Pack::getPacksTable($this->product->id, (int)(self::$cookie->id_lang), true, 1)); + } + } + + self::$smarty->assign(array( + 'ENT_NOQUOTES' => ENT_NOQUOTES, + 'outOfStockAllowed' => (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')), + 'errors' => $this->errors, + 'categories' => Category::getHomeCategories((int)(self::$cookie->id_lang)), + 'have_image' => Product::getCover((int)(Tools::getValue('id_product'))), + 'tax_enabled' => Configuration::get('PS_TAX'), + 'display_qties' => (int)(Configuration::get('PS_DISPLAY_QTIES')), + 'display_ht' => !Tax::excludeTaxeOption(), + 'ecotax' => (!sizeof($this->errors) AND $this->product->ecotax > 0 ? Tools::convertPrice((float)($this->product->ecotax)) : 0), + )); + + global $currency; + self::$smarty->assign(array( + 'currencySign' => $currency->sign, + 'currencyRate' => $currency->conversion_rate, + 'currencyFormat' => $currency->format, + 'currencyBlank' => $currency->blank, + 'jqZoomEnabled' => Configuration::get('PS_DISPLAY_JQZOOM') + )); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'product.tpl'); + } + + public function pictureUpload(Product $product, Cart $cart) + { + if (!$fieldIds = $this->product->getCustomizationFieldIds()) + return false; + $authorizedFileFields = array(); + foreach ($fieldIds AS $fieldId) + if ($fieldId['type'] == _CUSTOMIZE_FILE_) + $authorizedFileFields[(int)($fieldId['id_customization_field'])] = 'file'.(int)($fieldId['id_customization_field']); + $indexes = array_flip($authorizedFileFields); + foreach ($_FILES AS $fieldName => $file) + if (in_array($fieldName, $authorizedFileFields) AND isset($file['tmp_name']) AND !empty($file['tmp_name'])) + { + $fileName = md5(uniqid(rand(), true)); + if ($error = checkImage($file, (int)(Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE')))) + $this->errors[] = $error; + + if ($error OR (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName))) + return false; + /* Original file */ + elseif (!imageResize($tmpName, _PS_UPLOAD_DIR_.$fileName)) + $this->errors[] = Tools::displayError('An error occurred during the image upload.'); + /* A smaller one */ + elseif (!imageResize($tmpName, _PS_UPLOAD_DIR_.$fileName.'_small', (int)(Configuration::get('PS_PRODUCT_PICTURE_WIDTH')), (int)(Configuration::get('PS_PRODUCT_PICTURE_HEIGHT')))) + $this->errors[] = Tools::displayError('An error occurred during the image upload.'); + elseif (!chmod(_PS_UPLOAD_DIR_.$fileName, 0777) OR !chmod(_PS_UPLOAD_DIR_.$fileName.'_small', 0777)) + $this->errors[] = Tools::displayError('An error occurred during the image upload.'); + else + $cart->addPictureToProduct((int)($this->product->id), $indexes[$fieldName], $fileName); + unlink($tmpName); + } + return true; + } + + public function textRecord(Product $product, Cart $cart) + { + if (!$fieldIds = $this->product->getCustomizationFieldIds()) + return false; + $authorizedTextFields = array(); + foreach ($fieldIds AS $fieldId) + if ($fieldId['type'] == _CUSTOMIZE_TEXTFIELD_) + $authorizedTextFields[(int)($fieldId['id_customization_field'])] = 'textField'.(int)($fieldId['id_customization_field']); + $indexes = array_flip($authorizedTextFields); + foreach ($_POST AS $fieldName => $value) + if (in_array($fieldName, $authorizedTextFields) AND !empty($value)) + { + if (!Validate::isMessage($value)) + $this->errors[] = Tools::displayError('Invalid message'); + else + $cart->addTextFieldToProduct((int)($this->product->id), $indexes[$fieldName], $value); + } + elseif (in_array($fieldName, $authorizedTextFields) AND empty($value)) + $cart->deleteTextFieldFromProduct((int)($this->product->id), $indexes[$fieldName]); + } + + public function formTargetFormat() + { + $customizationFormTarget = Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])); + foreach ($_GET AS $field => $value) + if (strncmp($field, 'group_', 6) == 0) + $customizationFormTarget = preg_replace('/&group_([[:digit:]]+)=([[:digit:]]+)/', '', $customizationFormTarget); + if (isset($_POST['quantityBackup'])) + self::$smarty->assign('quantityBackup', (int)($_POST['quantityBackup'])); + self::$smarty->assign('customizationFormTarget', $customizationFormTarget); + } + + public function formatQuantityDiscounts($specificPrices, $price, $taxRate) + { + foreach ($specificPrices AS $key => &$row) + { + $row['quantity'] = &$row['from_quantity']; + if ($row['price'] != 0) // The price may be directly set + { + $cur_price = (Product::$_taxCalculationMethod == PS_TAX_EXC ? $row['price'] : $row['price'] * (1 + $taxRate / 100)); + + if ($row['reduction_type'] == 'amount') + { + $cur_price = Product::$_taxCalculationMethod == PS_TAX_INC ? $cur_price - $row['reduction'] : $cur_price - ($row['reduction'] / (1 + $taxRate / 100)); + } else { + $cur_price = $cur_price * ( 1 - ($row['reduction'])); + } + + $row['real_value'] = $price - $cur_price; + } + else + { + if ($row['reduction_type'] == 'amount') + { + $row['real_value'] = Product::$_taxCalculationMethod == PS_TAX_INC ? $row['reduction'] : $row['reduction'] / (1 + $taxRate / 100); + } else { + $row['real_value'] = $row['reduction'] * 100; + } + } + $row['nextQuantity'] = (isset($specificPrices[$key + 1]) ? (int)($specificPrices[$key + 1]['from_quantity']) : -1); + } + return $specificPrices; + } +} + diff --git a/controllers/SearchController.php b/controllers/SearchController.php new file mode 100644 index 000000000..12bf6ca8c --- /dev/null +++ b/controllers/SearchController.php @@ -0,0 +1,140 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SearchControllerCore extends FrontController +{ + public $instantSearch; + public $ajaxSearch; + + public function __construct() + { + $this->php_self = 'search.php'; + + parent::__construct(); + + $this->instantSearch = Tools::getValue('instantSearch'); + $this->ajaxSearch = Tools::getValue('ajaxSearch'); + } + + public function preProcess() + { + parent::preProcess(); + + $query = urldecode(Tools::getValue('q')); + if ($this->ajaxSearch) + { + self::$link = new Link(); + $searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true); + foreach ($searchResults AS &$product) + $product['product_link'] = self::$link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']); + die(Tools::jsonEncode($searchResults)); + } + + if ($this->instantSearch && !is_array($query)) + { + $this->productSort(); + $this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')))); + $this->p = abs((int)(Tools::getValue('p', 1))); + $search = Search::find((int)(self::$cookie->id_lang), $query, $this->p, $this->n, $this->orderBy, $this->orderWay); + Module::hookExec('search', array('expr' => $query, 'total' => $search['total'])); + $nbProducts = $search['total']; + $this->pagination($nbProducts); + self::$smarty->assign(array( + 'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module + 'search_products' => $search['result'], + 'nbProducts' => $search['total'], + 'search_query' => $query, + 'instantSearch' => $this->instantSearch, + 'homeSize' => Image::getSize('home'))); + } + elseif ($query = Tools::getValue('search_query', Tools::getValue('ref')) AND !is_array($query)) + { + $this->productSort(); + $this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')))); + $this->p = abs((int)(Tools::getValue('p', 1))); + $search = Search::find((int)(self::$cookie->id_lang), $query, $this->p, $this->n, $this->orderBy, $this->orderWay); + Module::hookExec('search', array('expr' => $query, 'total' => $search['total'])); + $nbProducts = $search['total']; + $this->pagination($nbProducts); + self::$smarty->assign(array( + 'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module + 'search_products' => $search['result'], + 'nbProducts' => $search['total'], + 'search_query' => $query, + 'homeSize' => Image::getSize('home'))); + } + elseif ($tag = urldecode(Tools::getValue('tag')) AND !is_array($tag)) + { + $nbProducts = (int)(Search::searchTag((int)(self::$cookie->id_lang), $tag, true)); + $this->pagination($nbProducts); + $result = Search::searchTag((int)(self::$cookie->id_lang), $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay); + Module::hookExec('search', array('expr' => $tag, 'total' => sizeof($result))); + self::$smarty->assign(array( + 'search_tag' => $tag, + 'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module + 'search_products' => $result, + 'nbProducts' => $nbProducts, + 'homeSize' => Image::getSize('home'))); + } + else + { + self::$smarty->assign(array( + 'products' => array(), + 'search_products' => array(), + 'pages_nb' => 1, + 'nbProducts' => 0)); + } + self::$smarty->assign('add_prod_display', Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')); + } + + public function displayHeader() + { + if (!$this->instantSearch AND !$this->ajaxSearch) + parent::displayHeader(); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'search.tpl'); + } + + public function displayFooter() + { + if (!$this->instantSearch AND !$this->ajaxSearch) + parent::displayFooter(); + } + + public function setMedia() + { + parent::setMedia(); + + if (!$this->instantSearch AND !$this->ajaxSearch) + Tools::addCSS(_THEME_CSS_DIR_.'product-list.css'); + } +} + diff --git a/controllers/SitemapController.php b/controllers/SitemapController.php new file mode 100644 index 000000000..a2c1d9138 --- /dev/null +++ b/controllers/SitemapController.php @@ -0,0 +1,64 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SitemapControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'sitemap.php'; + + parent::__construct(); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'sitemap.css'); + Tools::addJS(_THEME_JS_DIR_.'tools/treeManagement.js'); + } + + public function process() + { + parent::process(); + + self::$smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0)); + self::$smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(_USER_ID_LANG_, 1, 1, 1)); + self::$smarty->assign('voucherAllowed', (int)(Configuration::get('PS_VOUCHERS'))); + $blockmanufacturer = Module::getInstanceByName('blockmanufacturer'); + $blocksupplier = Module::getInstanceByName('blocksupplier'); + self::$smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id AND Configuration::get('PS_DISPLAY_SUPPLIERS')) ? true : false)); + self::$smarty->assign('display_supplier_link', (((int)$blocksupplier->id AND Configuration::get('PS_DISPLAY_SUPPLIERS')) ? true : false)); + self::$smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS')); + self::$smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP')); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'sitemap.tpl'); + } +} diff --git a/controllers/StoresController.php b/controllers/StoresController.php new file mode 100644 index 000000000..0a973bf01 --- /dev/null +++ b/controllers/StoresController.php @@ -0,0 +1,170 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StoresControllerCore extends FrontController +{ + public function __construct() + { + $this->php_self = 'stores.php'; + + parent::__construct(); + } + + public function preProcess() + { + global $smarty, $cookie; + + $simplifiedStoreLocator = Configuration::get('PS_STORES_SIMPLIFIED'); + $distanceUnit = Configuration::get('PS_DISTANCE_UNIT'); + if (!in_array($distanceUnit, array('km', 'mi'))) + $distanceUnit = 'km'; + + if ($simplifiedStoreLocator) + { + $stores = Db::getInstance()->ExecuteS(' + SELECT s.*, cl.name country, st.iso_code state + FROM '._DB_PREFIX_.'store s + LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country) + LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state) + WHERE s.active = 1 AND cl.id_lang = '.(int)($cookie->id_lang)); + + foreach ($stores AS &$store) + $store['has_picture'] = file_exists(_PS_STORE_IMG_DIR_.(int)($store['id_store']).'.jpg'); + } + else + { + if (Tools::getValue('all') == 1) + { + $stores = Db::getInstance()->ExecuteS(' + SELECT s.*, cl.name country, st.iso_code state + FROM '._DB_PREFIX_.'store s + LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country) + LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state) + WHERE s.active = 1 AND cl.id_lang = '.(int)($cookie->id_lang)); + } + else + { + $distance = (int)(Tools::getValue('radius', 100)); + $multiplicator = ($distanceUnit == 'km' ? 6371 : 3959); + + $stores = Db::getInstance()->ExecuteS(' + SELECT s.*, cl.name country, st.iso_code state, + ('.(int)($multiplicator).' * acos(cos(radians('.(float)(Tools::getValue('latitude')).')) * cos(radians(latitude)) * cos(radians(longitude) - radians('.(float)(Tools::getValue('longitude')).')) + sin(radians('.(float)(Tools::getValue('latitude')).')) * sin(radians(latitude)))) distance + FROM '._DB_PREFIX_.'store s + LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country) + LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state) + WHERE s.active = 1 AND cl.id_lang = '.(int)($cookie->id_lang).' + HAVING distance < '.(int)($distance).' + ORDER BY distance ASC + LIMIT 0,20'); + } + + if (Tools::getValue('ajax') == 1) + { + $dom = new DOMDocument('1.0'); + $node = $dom->createElement('markers'); + $parnode = $dom->appendChild($node); + + $days[1] = 'Monday'; + $days[2] = 'Tuesday'; + $days[3] = 'Wednesday'; + $days[4] = 'Thursday'; + $days[5] = 'Friday'; + $days[6] = 'Saturday'; + $days[7] = 'Sunday'; + + foreach ($stores AS $store) + { + $days_datas = array(); + $node = $dom->createElement('marker'); + $newnode = $parnode->appendChild($node); + $newnode->setAttribute('name', $store['name']); + $address = $store['address1'].(!empty($store['address2']) ? '
'.$store['address2'] : '').'
'.$store['postcode'].' '.$store['city'].', '.$store['state'].'
'.$store['country']; + $other = ''; + if (!empty($store['hours'])) + { + $hours = unserialize($store['hours']); + + for ($i = 1; $i < 8; $i++) + { + $hours_datas = array(); + $hours_datas['day'] = $days[$i]; + $hours_datas['hours'] = $hours[(int)($i) - 1]; + $days_datas[] = $hours_datas; + } + $smarty->assign('days_datas', $days_datas); + $other .= self::$smarty->fetch(_PS_THEME_DIR_.'store_infos.tpl'); + } + + $newnode->setAttribute('addressNoHtml', strip_tags(str_replace('
', ' ', $address))); + $newnode->setAttribute('address', $address); + $newnode->setAttribute('other', $other); + $newnode->setAttribute('phone', $store['phone']); + $newnode->setAttribute('id_store', (int)($store['id_store'])); + $newnode->setAttribute('has_store_picture', file_exists(_PS_STORE_IMG_DIR_.(int)($store['id_store']).'.jpg')); + $newnode->setAttribute('lat', (float)($store['latitude'])); + $newnode->setAttribute('lng', (float)($store['longitude'])); + + if (isset($store['distance'])) + $newnode->setAttribute('distance', (int)($store['distance'])); + } + + header('Content-type: text/xml'); + die($dom->saveXML()); + } + else + $smarty->assign('hasStoreIcon', file_exists(dirname(__FILE__).'/../img/logo_stores.gif')); + } + + $smarty->assign(array('distance_unit' => $distanceUnit, 'simplifiedStoresDiplay' => $simplifiedStoreLocator, 'stores' => $stores, 'mediumSize' => Image::getSize('medium'))); + } + + public function process() + { + parent::process(); + + self::$smarty->assign(array( + 'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'), + 'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG') + )); + } + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'stores.css'); + if (!Configuration::get('PS_STORES_SIMPLIFIED')) + Tools::addJS(_THEME_JS_DIR_.'stores.js'); + Tools::addJS('http://maps.google.com/maps/api/js?sensor=true'); + } + + public function displayContent() + { + parent::displayContent(); + self::$smarty->display(_PS_THEME_DIR_.'stores.tpl'); + } +} diff --git a/controllers/SupplierController.php b/controllers/SupplierController.php new file mode 100644 index 000000000..56ae636e2 --- /dev/null +++ b/controllers/SupplierController.php @@ -0,0 +1,101 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SupplierControllerCore extends FrontController +{ + protected $supplier; + + public function setMedia() + { + parent::setMedia(); + Tools::addCSS(_THEME_CSS_DIR_.'product_list.css'); + } + + public function process() + { + if ($id_supplier = Tools::getValue('id_supplier')) + { + $this->supplier = new Supplier((int)$id_supplier, self::$cookie->id_lang); + if (Validate::isLoadedObject($this->supplier) AND $this->supplier->active) + { + $nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); + $this->pagination((int)$nbProducts); + self::$smarty->assign(array( + 'nb_products' => $nbProducts, + 'products' => $this->supplier->getProducts($id_supplier, (int)self::$cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay), + 'path' => ($this->supplier->active ? Tools::safeOutput($this->supplier->name) : ''), + 'supplier' => $this->supplier)); + } + else + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + $this->errors[] = Tools::displayError('Supplier does not exist'); + } + } + else + { + if (Configuration::get('PS_DISPLAY_SUPPLIERS')) + { + $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int)(self::$cookie->id_lang), true); + $nbProducts = count($data); + $this->pagination($nbProducts); + + $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int)(self::$cookie->id_lang), true, $this->p, $this->n); + $imgDir = _PS_MANU_IMG_DIR_; + foreach ($data AS &$item) + $item['image'] = (!file_exists($imgDir.'/'.$item['id_supplier'].'-medium.jpg')) ? + Language::getIsoById((int)(self::$cookie->id_lang)).'-default' : $item['id_supplier']; + self::$smarty->assign(array( + 'pages_nb' => ceil($nbProducts / (int)($this->n)), + 'nbSuppliers' => $nbProducts, + 'mediumSize' => Image::getSize('medium'), + 'suppliers' => $data, + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + )); + } + else + self::$smarty->assign('nbSuppliers', 0); + } + } + + public function displayHeader() + { + parent::displayHeader(); + $this->productSort(); + } + + public function displayContent() + { + parent::displayContent(); + if ($this->supplier) + self::$smarty->display(_PS_THEME_DIR_.'supplier.tpl'); + else + self::$smarty->display(_PS_THEME_DIR_.'supplier-list.tpl'); + } + +} \ No newline at end of file diff --git a/css/admin-ie.css b/css/admin-ie.css new file mode 100644 index 000000000..77a7f4b38 --- /dev/null +++ b/css/admin-ie.css @@ -0,0 +1,2 @@ +fieldset {position:relative;padding-top:25px} +fieldset legend {position:absolute;top:-0.5em;left:1.1em} \ No newline at end of file diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 000000000..f7127cfd5 --- /dev/null +++ b/css/admin.css @@ -0,0 +1,1492 @@ +/* CSS Admin PrestaShop */ +* {font-family: Arial,Verdana,Helvetica,sans-serif} + +body { + margin: 0; + padding: 0; + font-size: 12px; + color: #000; + text-align: center; +/* behavior: url(csshover.htc); */ +} + +.float {float:left} +.floatr {float:right} + +a img { + border: 0; +} + +a { + color: #000; + text-decoration: none; + outline: 0pt; +} + +a:hover { + color: #222; + text-decoration: none; +} + +a.link, a.link:hover { + color: #999999; +} +a.link { + text-decoration: underline; +} +.warn a{ + text-decoration: underline; +} + +img { + vertical-align: middle; +} + +input { + vertical-align: middle; +} + +p { + margin: 0.5em 0; +} + +hr { + border: none; + padding: 0; + margin-top: 10px; + margin-bottom: 10px; +} + +.block { + display: block; +} + +/* FONTS */ + +.bold { + font-weight: bold; +} + +legend, th { + font-family : Trebuchet,Arial,Helvetica,sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + font-family : "Trebuchet MS",Trebuchet,Arial,Helvetica,sans-serif; +} + +h1 { + font-size: 1.6em; + margin: 0 0 .67em 0; +} +h2 { + font-size: 1.4em; + margin: 0 0 .83em 0; + color: #268CCD; +} +h3 { + font-size: 1.1em; + margin: 0 0 .83em 0; +} +h4 { + margin: 1.33em 0; +} +h5 { + font-size: 0.83em; + margin: 1.67em 0; +} +h6 { + font-size: 0.67em; + margin: 2.33em 0; +} + +h3.blue { + color: #268CCD; +} + +.red { + color: red; +} + +form { + margin: 0; + padding: 0; +} + +form p { + margin: 0.5em 0 0 0; + padding: 0 0 0.5em 0; +} + +form sup { + color: #CC0000; + font-weight: bold; + vertical-align: text-top; +} +form .simulate-disable-input{ + min-width:127px; + display:inline-block; + padding:3px; + border:1px solid #E0D0B1; + background-color:#dddddd; + color:#666666; + font-size:12px; +} +.block-mail { + margin:0 0 20px 0; +} +.mail-form { + margin:0 0 0 220px; + width:auto; + color: #7F7F7F; + font-size: 0.85em; +} +.label-subject { + padding:0; + margin:0 0 10px 0; + text-align:left; +} +.label-subject input{ + width:555px; +} +.mail-label table { + width:555px; +} +.mails_field { + margin:0; + background: none repeat scroll 0 0 #FFFFF0; + border: 1px solid #DFD5C3; + font-size: 1.1em; + margin: 20px 0 20px 0; + padding: 2em 1em 1em 1em; + position:relative; +} + +.mails_field h3{ + position:absolute; + margin:0; + top:-10px; + font-size:1em; + background-color:#FFF6D3; + border:1px solid #DFD5C3; + padding: 2px 5px 2px 5px; + display:inline-block; +} + +.style-themeModuleMail { + margin: 0; + padding: 0.2em 0.5em; + border: 1px solid #DFD5C3; + background: #FFF6D3; + font-weight: bold; + text-align: left; + cursor : pointer; + font-size: 12px; +} + +.style-themeModuleName { + margin: 0; + padding: 0.2em 0.5em; + border: 1px solid #DFD5C3; + background: #FFF6D3; + font-weight: bold; + text-align: left; + cursor : pointer; + font-size: 12px; +} + +.margin-form { + padding: 0 0 1em 210px; + color: #7F7F7F; + font-size: 0.85em; +} + +fieldset.width1 .margin-form { + margin: 0 0 1em 130px; +} + +fieldset img { + padding: 0 4px 0 0; + vertical-align: bottom; +} + +label { + float: left; + width: 200px; + padding: 0.2em 0.5em 0 0; + text-align: right; + font-weight: bold; +} + +#preview_import label { + float:left; + font-weight:bold; + padding:0.2em 0 0; + text-align:left; + width:270px; +} + +label.t { + float: none; + clear: none; + padding: 0px; + margin: 0px; + font-weight: bold; + font-size: 12px; +} +label.std { + float: none; + margin: 0px; + width: 170px; + display: block; + font-size: 12px; + text-align: right; + font-weight: bold; +} +form div.std { + margin-top: -2em; +} + +fieldset.width1 label { + width: 110px; +} + +label:after { + clear: both; +} + +input, textarea, option { + color: #000; + font-size: 12px; + margin: 0; + padding: 0; +} + +input[type="text"], input[type="password"], input[type="file"], textarea { + padding: 2px 4px; +} + +input[type="text"], input[type="password"], input[type="file"], textarea, select, option { + background-color:#FFF; +} +input[type="radio"], input[type="checkbox"] { + background-color:transparent; +} + +input:focus, textarea:focus { + background-color: #F0EBD6; +} + +fieldset { + _position: relative; +} + +legend { + _position: relative; + _top: -2em; + _margin-top: 12px; +} +select optgroup { + background: #fff; + padding: 2px; + color: #000 +} +select optgroup option { + padding: 0 9px; + color: #000 +} + +.lab_modules_positions { + float: none; + text-align: left; + font-weight: normal; + padding: 0; + cursor: pointer; + display: block; + width: 425px; +} + +.lab_modules { + float: none; + text-align: left; + font-weight: normal; + padding-left: 10px; + cursor: pointer; + display: block; + width: 350px; +} + +/* STRUCTURE */ + +#container { + width: 960px; + margin: 0 auto 2em auto; + text-align: left; +} + +#main { + clear: left; + /*border: 1px solid #999; + border-bottom: none;*/ +} + +#content { + padding: 1.25em; +} + +#news { + width: 640px; + border: 1px solid #E0D0B1; +} + +#help { + float: right; + width: 150px; + padding: 4px; + border: 1px solid #DFD5C3; + font-size: 0.9em; +} + +#image { + float: none; + padding: 6px; + background: #fff; + border: 1px solid #DFD5C3; + font-size: 0.9em; + text-align: center; +} +#image img { margin: 0; padding: 0 } + +#id_image_attr +{ + list-style: none; +} + +#product_link { + width: 240px; + float: right; + padding: 4px; + margin-top: 8px; + font-size: 0.9em; + text-align: center; + clear: right; +} + +#help:after, +#image:after { + clear: both; +} + +/* NAV */ + +#nav { + float: right; + margin: 1em 0; + font-size: 1.1em; + font-weight: bold; + vertical-align: middle; +} + +#nav li { + display: inline; + list-style: none; + margin: 0 0 0 2em +} + +#nav img { + vertical-align: bottom; +} + +.warn .pico { + vertical-align: middle; + padding: 0; + margin: 0 +} + +#content .alert { + width: 500px; + margin: 0 0 15px 0; + padding: 10px 15px; + border-top: 1px solid #DF7B7B; + border-bottom: 1px solid #DF7B7B; + background-color: #FFE6E6; +} + +#content .warning { + width: 400px; + margin: 0 0 15px 0; + line-height: 20px; + padding: 10px 20px 10px 20px; + border-top: 1px solid #FF9900; + border-bottom: 1px solid #FF9900; + background-color: #FFEBCC; +} + +#unhook_button_position_bottom { + overflow: hidden; + width: 600px; + padding-top: 10px; +} + +#unhook_button_position_top { + overflow: hidden; + width: 600px; +} + +#content .conf, #content .warn, #content .error { + color:#383838; + font-weight:700; + margin: 0 0 10px 0; + line-height: 20px; + padding: 10px 15px; +} + +#content .error-inline { + color:#ff0000; + font-weight:bold; +} + +#content .conf { + border: 1px solid #72CB67; + background-color: #DFFAD3; +} +#content .conf img, #content .warn img, #content .error img { + margin:-4px 5px 0 0; +} + +#content .error { + border: 1px solid #EC9B9B; + background-color: #FAE2E3; +} + +#content .warn { + border: 1px solid #D3C200; + background-color: #FFFAC6; +} + +#content .error ol { + clear: both; + margin-top: 5px; + padding-bottom: 0; +} + +#content .error ol li{ + font-weight:200; + margin-left:30px; +} + +#content .confirm h3 { + padding: 0 0 0 20px; + background: url(../img/admin/ok.gif) no-repeat 0 0; +} + +#content .warn h3 { + padding: 0 0 0 20px; + background: url(../img/admin/warning.gif) no-repeat 0 0; +} + +#content .error h3 { + padding: 0 0 0 20px; + background: url(../img/admin/warning.gif) no-repeat 0 0; +} + +/* CONTENT - COLUMN */ + +.column { + float: left; + width: 173px; + margin: 0 50px 1.5em 0; + padding: 10px; + -moz-border-radius: 20px; + text-align: center; +} + +#col_1 { + height: 235px; + color: #FFFFFF; + background: #FF8C76 url(../img/admin/col_1.gif) no-repeat; +} + +#col_2 { + height: 235px; + color: #FFFFFF; + background: #FFC44F url(../img/admin/col_2.gif) no-repeat; +} + +#col_3 { + height: 235px; + color: #FFFFFF; + background: #8CFF70 url(../img/admin/col_3.gif) no-repeat; +} + +/* CONTENT - NEWS */ + +#news img { + padding: 0 6px 0 0; + vertical-align: middle; +} + +#news .infos, +#news .content { + margin: 0; + padding: 4px; + font-family: Arial,Helvetica,sans-serif; + font-weight: normal; +} + +.table tr.last td { + border-bottom: none; +} + +.footer_link, .footer_link:hover { + color: #812143; + font-weight: bold; + text-decoration: underline; +} + +/* CLASS */ + +h3.title { + clear: both; + margin: 0; + padding: 4px 10px; + border: 1px solid #E0D0B1; + border: none; +} + +h3.subtitle { + color: #FF8D42; + font-size: 1.2em; +} + +p.infos { + float: right; + margin: 0; + padding: 0; + font-size: 0.9em; + line-height: 1em; + vertical-align: top; +} + +.width1 { + width: 350px; +} + +.width2 { + width: 500px; +} + +.width3 { + width: 600px; +} + +.width4 { + width: 745px; +} + +.width5 { + width: 655px; +} + +.widthfull { + width: 100%; +} + +tr.deleted td { + background-color: #EEEEEE; +} + +.contextnav { + margin: 10px 0; + padding: 3px 6px; + line-height: 1.30em; + border: 1px solid #E0D0B1; +} + +.contextnav img { + vertical-align: text-top; +} + +.contextnavleft { + float: left; + width: 6em; +} + +.contextnavcenter { + text-align: center; +} + +.contextnavcenter a, +.contextnavcenter b { + letter-spacing: 6pt; +} + +.contextnavright { + float: right; + width: 6em; + text-align: right; +} + +.hidden { + height: 1px; + border-width: 1px 0 0 0; + border-style: solid; + border-color: #fff; +} + +.clear { + clear: both; +} + +.flatclear { + clear: both; + height:0px; + line-height:0px; +} + +.space { + margin-top: 13px; +} + +.pspace { + padding-top: 1em; +} + +.double-space { + margin-top: 2em ; +} + +.space-bottom { + margin-bottom: 1em; +} + +.double-bottom-space { + margin-bottom: 2em ; +} + +.left { + text-align: left; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.small { + font-size: 0.85em; +} + +.row { + background: #F4E6C9 url(../img/admin/news-bg.gif) repeat-x top left; +} + +.noborder { + border: none; +} + +.highlight { + background-color: #FFFF66; + font-weight: bold; +} + +.discount_name { + background: #FFEBCC; + padding: 2px; + text-transform: uppercase; +} + +.displayed_flag { + float: left; + margin: 4px 0 0 4px; +} + +.language_flags { + display: none; + float: left; + background: #FFF; + margin: 4px; + padding: 8px; + width: 80px; + border: 1px solid #555; +} + +.pointer { + cursor: pointer; +} + +.imgm { + margin: 3px 0px 3px 0px; +} + +.green { + color: forestgreen; +} + +.bullet { + display: list-item; + list-style: disc; + margin-left: 30px; +} + +/* access management */ +#ajax_confirmation { + padding-top: 3px; + padding-bottom: 6px; +} + +/* help boxes */ +.hint { + display: none; + position: relative; + left: 0px; + margin-top: 4px; + margin-bottom: 2px; + border: 1px solid #50B0EC; + padding: 8px 6px 8px 34px ; + color: #383838; + background: #DDE9F7 url(../img/admin/help2.png) no-repeat 6px 5px; +} + +/* The pointer image is added by using another span */ +.hint .hint-pointer { + position: absolute; + left: -10px; + top: 5px; + width: 10px; + height: 19px; +} + +#flagsLanguage img { + padding: 3px; + margin-bottom: -4px; +} + +#flagsLanguage .selected_language { + border: 1px solid #BBB; + padding: 2px; + margin-bottom: -4px; +} + +.disable, .disable:hover { + background-color: #CCCCCC; + color: #AAAAAA; +} + +/* Ajax classes */ +.ajax-warning, .ajax-success, .ajax-error { + border: 1px solid #CCCCCC; + padding: 5px 20px; + margin: 5px; + width: 70%; +} +.ajax-warning { + background-color: #FFBD6F; +} +.ajax-success { + background-color: #9FDF8B; +} +.ajax-error { + background-color: #FF7F84; +} +.ajax-loader { + margin: 5px 10px; +} + +/* tab: AdminProducts */ +#upload-confirmation { + background-color: yellow; + font-weight:bold; +} + +.productFieldComment { + color: #7F7F7F; + font-size: 0.8em; +} + +/* Confirm box */ +a.confirm_yes, a.confirm_no { + width: 50px; + margin-left: 60px; + padding: 10px; + border-style: solid; + border-width: 1px; + text-align: center; + font-weight: bold; + color: white; +} +a.confirm_yes { + border-color: red; + background-color: red; +} +a.confirm_no { + border-color: green; + background-color: green; +} + +/* tab: AdminImport */ + +form#import_form { + padding-bottom:22px; + margin-left:15px; + margin-bottom:20px; +} +.table_overflow { + width:900px; + height:500px; + overflow:auto; +} + +.new_message{ + background-color:#FFE35C; +} +.myDragClass { + background-color: #FFAA55; +} +.dragHandle{ +cursor: move; +} + +p#mailResultCheck{ + margin:2px 0; + padding-left:18px; + font-size:12px; +} + +p.ok{ + background:url('../img/admin/enabled.gif') no-repeat top left; + color:green; +} + +p.fail{ + background:url('../img/admin/disabled.gif') no-repeat top left; + font-weight:bold; + color:red; +} +#resultCheckLangPack{ + border: 1px solid #DFD5C3; + padding:10px; + margin-bottom:10px; +} + +/* TinyMCE */ +span.defaultSkin .mceToolbar { height: auto } +span.defaultSkin table.mceLayout tr.mceFirst td { float: left } + +/* webservice */ +table.permissions { + border:1px solid #DFD5C3; +} +table.permissions th { + background:#FFF6D3; + text-align:center; + height:20px; +} +table.permissions td { + padding:5px; + text-align:center; +} + +/* */ +.path_bar{ + background-color:#EFEFEF; + font-family:Arial; + font-size:13px; + margin-bottom:20px; + padding:5px; +} + +.path_bar a{ + font-weight:700; +} +.adminHeader h1{ + font-family:Arial; + color:#812143; + font-size:18pt; + margin: 0; +} + +#adminHeader hr{ + background-color: #812143; + margin: 0; +} + +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; +} + +html[xmlns] .clearfix { + display: block; +} + +* html .clearfix { + height: 1%; +} + +#adminHeader #help_img{ + float: right; + margin-top: 5px; +} +#adminpresentation{ + width: 923px; + border:1px solid #8E8E8E; + background-color: #EFEFEF; + float: left; + padding: 1px; + font-size: 8pt; +} + +#listpresentation{ + float: left; + width: 100px; +} + +#iframe{ + width: 450px; + height: 220px; + float: left; + margin: 10px; + background: #DDD; + border: 1px solid #666; +} + +#adminpresentation ul li{ + list-style: none; +} + +#list_video{ + float: left; + width: 220px; +} + +#list_video h3{ + color: #882F4F; + font-size: 12pt; + padding-top: 25px; + margin: 0; +} + +#list_video ul{ + text-align: left; + padding: 0; + margin: 0; +} + +#list_video ul li{ + float: left; + width: 195px; + text-decoration: underline; + padding-left: 25px; + margin-top: 5px; +} + +#footer_iframe_home{ + float: left; + background-color: #DEDEDE; + width: 100%; + height: 25px; + padding-top: 10px; +} + +#footer_iframe_home label{ + float: none; + padding-left: 10px; + color: #903E5B; + line-height: 15px; +} + +#footer_iframe_home input{ + margin-left: 10px; +} + +#footer_iframe_home a{ + float: right; + margin: 0px 15px 0px 0px; + text-decoration: underline; + color: #903E5B; +} + +#column_left{ + width: 610px; + float: left; + padding-top: 20px; +} + +#column_right{ + width: 315px; + float: right; + padding-top: 20px; +} + +.F_list{ + list-style: none; + padding: 0; + margin: 0; +} + +#first_block{ + margin: 0; + background: #EFEFEF url('../img/admin/catalog_xl.png') no-repeat 6px 6px; +} + +#second_block{ + background: #EFEFEF url('../img/admin/customer_xl.png') no-repeat 6px 6px; +} + +#third_block{ + background: #EFEFEF url('../img/admin/stats_xl.png') no-repeat 6px 6px; +} + +#fourth_block{ + background: #EFEFEF url('../img/admin/employees_xl.png') no-repeat 6px 6px; +} + +.F_list li{ + width: 125px; + float: left; + margin-left: 14px; + border: 1px solid #8E8E8E; + padding: 5px; + height: 120px; +} + +.F_list li h4{ + width: 115px; + color: #903E5B; + text-decoration: underline; + font-size: 12px; + margin-top: 35px; + margin-bottom: 0; +} + +.F_list a{ + color: #903E5B; +} + +.F_list a:hover{ + color: #903E5B; +} + +.F_list li p{ + font-size: 8pt; +} + +.table_info{ + width: 283px; + float: left; + padding: 1px; + border: 1px solid #8E8E8E; + margin-right: 15px; + margin-top: 20px; +} + +.table_info h5{ + background-image: url('../img/admin/green-gradient.png'); + color: #FFFFFF; + margin: 0; + line-height: 29px; + padding-left: 15px; + font-size: 12pt; +} + +.table_info h5 a, +.admin-box1 h5 a{ + color: #FFFFFF; + font-size: 8pt; + float: right; + text-decoration: underline; + font-weight: normal; + padding-right: 10px; +} + +.admin-box2 h5 a{ + color: #FFFFFF; + font-size: 8pt; + float: right; + text-decoration: underline; + font-weight: normal; + padding-right: 10px; +} + +#table_info_last{ + margin-left: 0; + float: left; +} + +.table_info_details{ + width: 283px; + border: 0; +} + +.table_info_details tr{ + height: 30px; + background-color: #EFEFEF; + width: 290px; + color: #000000; + font-weight: bold; + padding-left: 5px; + width: 100%; + text-align: center; +} + +.tr_odd td{ + background-color: #DEDEDE; +} +.table_info_details tr td.td_align_left{ + text-align: left; + padding-left: 10px; + width: 150px; +} + +.table_info_details tr td{ + text-align: right; + padding-right: 10px; +} + +#table_info_large{ + margin-top: 20px; + margin-bottom: 20px; + width: 586px; + float: left; + padding: 1px; + border: 1px solid #8E8E8E; +} + +#table_info_large h5{ + background-image: url('../img/admin/green-gradient.png'); + color: #FFFFFF; + margin: 0; + line-height: 29px; + padding-left: 15px; + font-size: 12pt; + font-weight: normal; +} + +#table_info_large h5 a{ + color: #FFFFFF; + float: right; + font-size: 8pt; + text-decoration: underline; + font-weight: normal; + padding-right: 8px; +} + +#stat_google{ + width: 586px; + height: 175px; + background-color: #DEDEDE; +} + +.admin-box1{ + width: 310px; + float: left; + padding: 1px; + border: 1px solid #8E8E8E; + font-size: 8pt; + margin-bottom: 20px; +} + +.admin-box1 h5{ + background-image: url('../img/admin/orange-gradient.png'); + color: #FFFFFF; + margin: 0; + line-height: 29px; + padding-left: 15px; + font-size: 12pt; +} + +.admin-box2{ + width: 310px; + float: left; + padding: 1px; + border: 1px solid #8E8E8E; + font-size: 8pt; + margin-bottom: 20px; + background-color: #f2f2f2; +} + +.admin-box2 h5{ + background-image: url('../img/admin/pink-gradient.png'); + color: #FFFFFF; + margin: 0; + line-height: 29px; + padding-left: 15px; + font-size: 12pt; +} + + +.admin-home-box-list li img{ + margin: 0 15px 0 5px; +} +.admin-home-box-list{ + padding-left:0; + margin: 0px; + list-style: none; +} + +#prestashop_link{ + background: url('../img/admin/bg_pslink.png') no-repeat 0px 0px; +} + +.admin-home-box-list li{ + margin: 1px; + padding:5px 0; +} + +#prestashop_link li{ + height: 67px; + margin: 1px; +} + +.admin-home-box-list li p{ + padding: 5px 5px 0px 90px; +} +.admin-home-box-list li a{ + color: #812143; + font-weight: bold; + text-decoration: underline; + line-height: 18px; + font-size: 8.5pt; + text-align: left; +} + +#prestashop_link li a{ + color: #812143; + margin-left: 90px; + font-weight: bold; + text-decoration: underline; + line-height: 18px; + font-size: 8.5pt; + text-align: left; + float:left; +} + +#table_customer{ + width: 590px; + cellpadding: 0; + cellspacing: 0; +} + +#table_customer thead span{ + background: url('../img/admin/greenlight-gradient.png'); + color: #FFFFFF; + line-height: 35px; + border: 1px solid #416110; + display: block; + text-align: center; + height: 30px; + border-left: none; + border-right: none; +} + +#table_customer thead span.first{ + border: 1px solid #416110; + border-right: none; +} + +#table_customer thead span.last{ + border: 1px solid #416110; + border-left: none; +} + +#table_customer thead th{ + margin: 0; +} + +#order_id{ + width: 52px; + text-align: center; +} + +#order_customer{ + width: 175px; +} + +#order_status{ + width: 130px; +} + +#order_total{ + width: 100px; +} + +.order_action{ + text-align: center; +} + +#order_line1{ + background-color: #EFEFEF; +} + +#table_customer tbody{ + font-size: 8pt; +} + +#table_customer tbody tr td.order_td_first{ + text-align: center; + padding: 0; + height: 35px; +} + +#table_customer tbody tr td{ + border: 1px solid #E0E0E0; + border-top: none; + padding-left: 10px; + height: 35px; +} + +#table_info_news{ + width: 310px; + float: left; + padding: 1px; + border: 1px solid #8E8E8E; + margin-top: 20px; + font-size: 8pt; +} + +#table_info_news h5{ + background-color: #7Ab51D; + color: #FFFFFF; + margin: 0; + line-height: 29px; + padding-left: 15px; + font-size: 12pt; +} + +#table_info_news h5 a{ + color: #FFFFFF; + float: right; + font-size: 8pt; + text-decoration: underline; + font-weight: normal; + padding-right: 10px; +} + +#table_info_news ul{ + list-style: none outside none; + padding: 0; + margin: 0; +} + +#block_news_first{ + background-color: #E1EBD2; + padding: 5px; +} +#block_news_first a{ + color: #812143; + font-weight: bold; + text-decoration: underline; + line-height: 18px; +} + +#block_news_first p{ + line-height: 12px; + padding-left: 10px; + margin: 0; +} + +#block_news_first p a{ + color: #812143; + font-weight: bold; + margin-right: 8px; + margin-left: 200px; +} + +#table_info_news ul li a{ + line-height: 25px; + padding-left: 10px; + margin: 0; + text-decoration: underline; +} + +.block_news_odd{ + background-color: #DEDEDE; + line-height: 25px; +} + +#block_news_last{ + background-color: #EFEFEF; +} + +#see_newsletter{ + margin-left: 5px; + background: url(../img/admin/email.gif) no-repeat left center; +} + +#follow_on_facebook{ + margin-left: 5px; + background: url(../img/admin/facebook.jpg) no-repeat left center; +} + +#follow_on_twitter{ + margin-left: 5px; + background: url(../img/admin/twitter.jpg) no-repeat left center; +} + +#block_news_last ul li a{ + color: #812143; + padding-left: 20px; +} + +.viewed{ + background: url('../img/admin/enabled.gif') no-repeat left center; +} + +.clear{ + clear: both; +} + +a.blue { + color:blue; +} + +a.blue:hover { + color:#0000AA; +} + + +/* help cluetip */ +.cluetip-help-button { + width: auto; + text-align:left; + background-color:white; + padding:10px; + border:1px solid gray; + background:#F1F2F4 url(../img/admin/block_bg.jpg) repeat-x scroll left bottom; + opacity:0.75; +} + +.ac_results ul { + list-style: none; + text-align: left; + background: white; + padding: 0; +} +.ac_results li { + padding: 5px; +} +.ac_even { + background: #EFEFEF; +} +.ac_over { + background: #ECEADE; +} +.button-translate { + padding:0px; + margin : 0 0 0 10px; + height:15px; + width:15px; + cursor:pointer; +} diff --git a/css/csshover.htc.htc b/css/csshover.htc.htc new file mode 100644 index 000000000..3ba936ac3 --- /dev/null +++ b/css/csshover.htc.htc @@ -0,0 +1,120 @@ + + \ No newline at end of file diff --git a/css/datePicker.css b/css/datePicker.css new file mode 100644 index 000000000..a22417f78 --- /dev/null +++ b/css/datePicker.css @@ -0,0 +1,142 @@ +table.jCalendar { + border: 1px solid #000; + background: #aaa; + border-collapse: separate; + border-spacing: 2px; +} +table.jCalendar th { + background: #333; + color: #fff; + font-weight: bold; + padding: 3px 5px; +} +table.jCalendar td { + background: #ccc; + color: #000; + padding: 3px 5px; + text-align: center; +} +table.jCalendar td.other-month { + background: #ddd; + color: #aaa; +} +table.jCalendar td.today { + background: #666; + color: #fff; +} +table.jCalendar td.selected { + background: #f66; + color: #fff; +} +table.jCalendar td.selected:hover { + background: #f33; + color: #fff; +} +table.jCalendar td:hover, table.jCalendar td.dp-hover { + background: #fff; + color: #000; +} +table.jCalendar td.disabled, table.jCalendar td.disabled:hover { + background: #bbb; + color: #888; +} + +/* For the popup */ + +/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */ +/* located in demo.css and creates a little calendar icon + * instead of a text link for "Choose date" + */ +a.dp-choose-date { + /*float: left; + display: block; + text-indent: -2000px;*/ + width: 16px; + height: 18px; + overflow: visible; + padding: 0; + margin: 2px 3px 0 3px; + background: url('../img/admin/calendar.png') no-repeat 0px -1px; +} +a.dp-choose-date.dp-disabled { + background-position: 0 -20px; + cursor: default; +} +/* makes the input field shorter once the date picker code + * has run (to allow space for the calendar icon + */ +input.dp-applied { + width: 100px; + /*float: left;*/ +} + + + +div.dp-popup { + position: relative; + background: #ccc; + font-size: 10px; + font-family: arial, sans-serif; + padding: 2px; + width: 171px; + line-height: 1.2em; +} +div#dp-popup { + position: absolute; + z-index: 199; +} +div.dp-popup h2 { + font-size: 12px; + text-align: center; + margin: 2px 0; + padding: 0; +} +a#dp-close { + font-size: 11px; + padding: 4px 0; + text-align: center; + display: block; +} +a#dp-close:hover { + text-decoration: underline; +} +div.dp-popup a { + color: #000; + text-decoration: none; + padding: 3px 2px 0; +} +div.dp-popup div.dp-nav-prev { + position: absolute; + top: 2px; + left: 4px; + width: 100px; +} +div.dp-popup div.dp-nav-prev a { + float: left; +} +/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */ +div.dp-popup div.dp-nav-prev a, div.dp-popup div.dp-nav-next a { + cursor: pointer; +} +div.dp-popup div.dp-nav-prev a.disabled, div.dp-popup div.dp-nav-next a.disabled { + cursor: default; +} +div.dp-popup div.dp-nav-next { + position: absolute; + top: 2px; + right: 4px; + width: 100px; +} +div.dp-popup div.dp-nav-next a { + float: right; +} +div.dp-popup a.disabled { + cursor: default; + color: #aaa; +} +div.dp-popup td { + cursor: pointer; +} +div.dp-popup td.disabled { + cursor: default; +} \ No newline at end of file diff --git a/css/index.php b/css/index.php new file mode 100644 index 000000000..4c46c3561 --- /dev/null +++ b/css/index.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; +?> \ No newline at end of file diff --git a/css/install.css b/css/install.css new file mode 100644 index 000000000..e29531b37 --- /dev/null +++ b/css/install.css @@ -0,0 +1,349 @@ +/* POS CSS Install */ + +body { + height: 100%; + font-family: Arial, Verdana, sans-serif; + font-size: 13px; + font-weight: bold; + margin: 0; + padding: 0; + text-align: center; + background-color: #FFF; + color: #333; +} + +a { + color: #C73178; + text-decoration: none; + font-weight: normal; +} + +a:hover { + color: #333; + font-weight: normal; + text-decoration: underline; +} + +img { + margin-right: 10px; +} + +a img { + border: 0px; +} + +form { + margin: 0; + padding: 0; +} + +input, select { + font-family: Arial, Verdana, sans-serif; + font-weight: normal; + font-size: 12px; + margin: 2px 0 2px 0; +} + +#required { + color: #C73178; +} + + +/* STRUCTURE */ + +#page { + width: 100%; +} + +#container { + margin-top: 10px; + padding: 10px 0 0 0; + background: #FFF; +} + +#container-inner { + width: 940px; + margin: 0 auto 0 auto; + padding: 0; + text-align: left; +} + +#content { + float: right; + width: 697px; + border-left: 1px solid #65B821; + min-height: 380px; + margin: 0 0 20px 0; + padding: 5px 14px; +} + +#sidebar { + float: left; + width: 200px; + padding: 5px 0 0 0; +} + + +/* HEADER */ + +#header { + background-color: #DFF5CD; +} + +#header table{ + margin-left: 240px; + +} + +#frame { + color: #666; + width: 860px; + text-align: right; + padding-top: 50px; + padding-right: 10px; + padding-left: 20px; + margin-top: 30px; + float: right; +} + +#frame a{ + color: #666; + text-decoration: none; + font-weight: bold; +} + +#frame a:hover { + color: #333; + font-weight: bold; + text-decoration: underline; +} + +#spanTitle { + margin-top: -5px; + font-size: 23px; + float: left; + color: #555; +} + + +/* WELCOME */ + +#welcome { + margin-bottom: 2em; +} + +#welcome h3 { + font-size: 115%; +} + +#welcome p { + margin: 1.5em 180px 1em 0; + line-height: 1.5em; +} + +#welcome ul { + margin: 0 190px 0 20px; + padding: 0; + list-style: none; +} + +#welcome ul li { + margin: 0 0 10px 0; + padding: 0 0 0 26px; + font-size: 110%; + line-height: 1.3em; + font-weight: normal; + color: #666; + background: url(../img/install/icon-checksm_gris.gif) no-repeat 0 4px; +} + +/* CONTENT */ + +#content h1 { + margin: 0 0 12px 0; + padding: 0; + border-bottom: 1.5px solid #65B821; + color: #666; + font-size: 1.5em; +} + +#content h1 .faint { + background: #65B821; + width: inherit; + margin: 0 0.4em 0 0; + padding: 0 0.2em 0 0.2em; + color: #fff; + text-align: center; +} + +#content h2 { + color: #C73178; + font-size: 1.3em; + border-bottom: 2px solid #F4D7E4; + margin: 12px 0 12px 0; +} + +#content h3 { + margin: 0; + color: #C73178; +} + +/* TABLE */ + +.table { + width: 450px; + margin: 0 0 20px 0; + padding: 0; + border: 1px solid #F4D7E4; + border-collapse: collapse; +} + +.table th, .table td { + margin: 0; + padding: 5px; + border-bottom: 1px inset #F0EADA; +} + +.table td { + text-align: center; +} + + +/* FORM TABLE */ + +table.form-table { + width: 550px; + margin-top: 0.65em; + padding: 0; + border-collapse: collapse; +} + +table.form-table th, +table.form-table td { + margin: 0; + padding: 8px; + border-bottom: 1px dotted #F4D7E4; +} + +table.form-table th { + width: 135px; + padding-top: 12px; + text-align: right; + vertical-align: top; + color: #333; +} + +table.form-table td p.note { + margin: 0; + padding: 2px 0 2px 0; + font-family: "Lucida Grande", Arial, Verdana, sans-serif; + font-size: 90%; + font-weight: normal; + color: #666; +} + +/* HELP BOXES : HINT TO HIDE AND REVEAL PASSWORDS */ + +.reveal { + height: 50px; + font-size: 12px; + color: #333; + padding: 9px 10px 2px 10px; +} + +/* ERROR */ + +#content div.alert { + width: 450px; + margin: 15px 0; + padding: 10px 15px; + border-top : 1px dotted #666; + border-bottom: 1px dotted #666; + background: #F9E3EE; +} + +#content div.error h4 { + margin: 0; + padding: 0 0 0 20px; + font-family: "Lucida Grande", Verdana, sans-serif; + font-size: 110%; + text-transform: none; + font-weight: normal; + letter-spacing: 0; + text-align: left; + color: #C73178; + border: none; + background: url(../img/install/warning.gif) no-repeat 0 0; +} + +#content div.error ol { + margin: 15px 0 0 0; + padding-bottom: 0; + color: #C73178; + font-weight: normal; +} + + +/* WAITING */ + +#waiting { + margin: 10px; + display: none; + width: 230px; + background: #FFF; + border: 1px #666 dotted; + padding: 10px; +} + + +/* INFOS */ + +#infos { + width : 320px; + margin-left: 20px; + border: 1px solid #65B821; + background-color: #DFF5CD; + font-weight: normal; + padding: 10px; +} + + +/* SIDEBAR */ + +#sidebar div { + vertical-align: middle; + margin: auto 0 5px 0; + line-height: 27px; + font-size: 0.9em; + font-weight: bold; + color: #666; +} + +#sidebar .number { + line-height: 60px; + float: left; + height: 62px; + padding: 5px; + font-size: 4.0em; +} + +#sidebar .step { + float: right; + width: 140px; + height: 60px; + padding: 5px; + border: 1px solid #F4D7E4; +} + + +/* FOOTER */ + +#footer { + clear: both; + margin: 0; + padding: 8px 5px 20px 5px; + border-top: 1px solid #F4D7E4; + text-align: center; + font-size: 90%; + line-height: 1em; +} \ No newline at end of file diff --git a/css/jquery.autocomplete.css b/css/jquery.autocomplete.css new file mode 100644 index 000000000..ab37428d7 --- /dev/null +++ b/css/jquery.autocomplete.css @@ -0,0 +1,51 @@ +.ac_results { + text-align: left; + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; +} + +/* +.ac_loading { + background: white url('indicator.gif') right center no-repeat; +} +*/ + +.ac_odd { + background-color: #eee; +} + +.ac_over { + background-color: #0A246A; + color: white; +} diff --git a/css/jquery.cluetip.css b/css/jquery.cluetip.css new file mode 100644 index 000000000..335e03591 --- /dev/null +++ b/css/jquery.cluetip.css @@ -0,0 +1,63 @@ +#cluetip-close img { + border: 0; +} +#cluetip-title { + overflow: hidden; +} +#cluetip-title #cluetip-close { + float: right; + position: relative; +} +#cluetip-waitimage { + width: 43px; + height: 11px; + position: absolute; + background-image: url('../img/loader.gif'); +} +.cluetip-arrows { + display: none; + position: absolute; + top: 0; + left: -11px; + height: 22px; + width: 11px; + background-repeat: no-repeat; + background-position: 0 0; +} +#cluetip-extra { + display: none; +} + +.cluetip-default { + background-color: transparent; +} +.cluetip-default #cluetip-outer { + border: 2px solid #ccc; + position: relative; + background-color: #fff; +} + +.cluetip-default h3#cluetip-title { + margin: 0 0 5px; + padding: 2px 5px; + font-size: 12px; + font-weight: normal; + background-color: #ccc; + color: #333; +} + +.cluetip-default #cluetip-inner { + padding: 0 5px 5px; + display: inline-block; +} +.cluetip-default div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #900; +} + +/* stupid IE6 HasLayout hack */ +.cluetip-rounded #cluetip-title, +.cluetip-rounded #cluetip-inner { + zoom: 1; +} \ No newline at end of file diff --git a/css/jquery.fancybox-1.3.4.css b/css/jquery.fancybox-1.3.4.css new file mode 100644 index 000000000..a14169775 --- /dev/null +++ b/css/jquery.fancybox-1.3.4.css @@ -0,0 +1,374 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +/* PrestaShop + * + * We did several modifications in this file: + * + * - Persistant arrows + * - Fixed IE 6 path on the AlphaLoader method + * - Specific path for background images + * + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('../js/jquery/fancybox/fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('../js/jquery/fancybox/fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('../js/jquery/fancybox/blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -30px; + left: 20px; /* PrestaShop - make left arrow permanently visible */ +} + +#fancybox-right-ico { + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -60px; + /* PrestaShop - make right arrow permanently visible */ + right: 20px; + left: auto; + /* End */ +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('../js/jquery/fancybox/fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('../js/jquery/fancybox/fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('../js/jquery/fancybox/fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('../js/jquery/fancybox/fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('../js/jquery/fancybox/fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('../js/jquery/fancybox/fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('../js/jquery/fancybox/fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('../js/jquery/fancybox/fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('../js/jquery/fancybox/fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='js/jquery/fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ + +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../js/jquery/fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } \ No newline at end of file diff --git a/css/jquery.jgrowl.css b/css/jquery.jgrowl.css new file mode 100644 index 000000000..02e041002 --- /dev/null +++ b/css/jquery.jgrowl.css @@ -0,0 +1,127 @@ + +div.jGrowl { + padding: 10px; + z-index: 9999; +} + +/** Special IE6 Style Positioning **/ +div.ie6 { + position: absolute; +} + +div.ie6.top-right { + right: auto; + bottom: auto; + left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.top-left { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.bottom-right { + left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.bottom-left { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.center { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); + width: 100%; +} + +/** Normal Style Positions **/ +body > div.jGrowl { + position: fixed; +} + +body > div.jGrowl.top-left { + left: 0px; + top: 0px; +} + +body > div.jGrowl.top-right { + right: 0px; + top: 0px; +} + +body > div.jGrowl.bottom-left { + left: 0px; + bottom: 0px; +} + +body > div.jGrowl.bottom-right { + right: 0px; + bottom: 0px; +} + +body > div.jGrowl.center { + top: 0px; + width: 50%; + left: 25%; +} + +/** Cross Browser Styling **/ +div.center div.jGrowl-notification, div.center div.jGrowl-closer { + margin-left: auto; + margin-right: auto; +} + +div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { + background-color: #000; + color: #fff; + opacity: .85; + filter: alpha(opacity = 85); + zoom: 1; + width: 235px; + padding: 10px; + margin-top: 5px; + margin-bottom: 5px; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: left; + display: none; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +div.jGrowl div.jGrowl-notification { + min-height: 40px; +} + +div.jGrowl div.jGrowl-notification div.header { + font-weight: bold; + font-size: 10px; +} + +div.jGrowl div.jGrowl-notification div.close { + z-index: 99; + float: right; + font-weight: bold; + font-size: 12px; + cursor: pointer; +} + +div.jGrowl div.jGrowl-closer { + height: 15px; + padding-top: 4px; + padding-bottom: 4px; + cursor: pointer; + font-size: 11px; + font-weight: bold; + text-align: center; +} + +/** Hide jGrowl when printing **/ +@media print { + div.jGrowl { + display: none; + } +} \ No newline at end of file diff --git a/css/jqzoom.css b/css/jqzoom.css new file mode 100644 index 000000000..1d5cdc988 --- /dev/null +++ b/css/jqzoom.css @@ -0,0 +1,21 @@ +div.zoomdiv { +z-index : 100; +position : absolute; +top:0px; +left:0px; +width : 200px; +height : 200px; +background: #ffffff; +border:1px solid #CCCCCC; +display:none; +text-align: center; +overflow: hidden; + +} + + +img.jqzoom{ +cursor:crosshair; +position:relative; + +} diff --git a/css/login.css b/css/login.css new file mode 100644 index 000000000..1151ce652 --- /dev/null +++ b/css/login.css @@ -0,0 +1,146 @@ +/* CSS Document */ + +body { + margin: 0; + padding: 0; + font-family: Arial; + font-size: 13px; + color: #333; + text-align: center; + background-image: url('../img/admin/bg_2.png'); +} + +h1 { + color: #902F52; + font-size: 20pt; + padding: 15px 10px 10px 30px; + margin: 0; + overflow: hidden; +} + +h2 a { + color: #dedede; + font-size: 7pt; + text-decoration: underline; + margin: 0; +} + +h2 a:hover { + color: #dedede; + font-size: 7pt; + text-decoration: underline; + margin: 0; +} + +a { + color: #902d50; + text-decoration: underline; +} + +a:hover { + color: #902d50; + text-decoration: none; +} + +input, textarea, option, select { + color: #000; + font-family: Arial; + font-size: 12px; + margin: 0; + padding: 0; +} + +input:focus, textarea:focus { + border: 1px solid #686868; + background-color: #DFDFDF; +} + +/* CONTENT */ + +#container { + width: 464px; + margin: 5em auto 1em auto; + padding: 0; +} + +#login { + height: 313px; + background: url('../img/admin/bg_login.gif') no-repeat top center; + color: #383838; + text-align: left; + font-weight: bold; +} + +#login form { + margin: 0; + padding: 40px 30px 25px 30px; +} + +#login #submit { + margin: 1em 1px; + padding: 0; + display: block; +} + +#login #submit input { + padding: 2px 4px; + _padding: 0; +} + +#login #lost { + + font-size: 0.95em; +} + +/* ERROR */ + +#error { + margin: 0 30px 15px 30px; + padding: 10px 15px; + border: 1px solid #EC9B9B; + background-color: #FAE2E3; + text-align: left; +} + +#error ol { + margin: 15px 0 0 0; + padding-bottom: 0; +} + +#error li { + _margin-left: 45px; + font-family: Arial; + font-size: 11px; +} + +#error h3 { + margin: 0 0 .83em 0; + padding: 5px 0 0 30px; + background: url(../img/admin/error.png) no-repeat 0 0; + font-size: 1em; +} + +/* CLASS */ + +.input { + width: 260px; + margin-top: 2px; + padding: 2px 4px; + border: 1px solid #588216; +} + +.button { + border: 1px solid #DFD5AF; + border-top: 1px solid #FFF6D3; + border-left: 1px solid #FFF6D3; + color: #268CCD; + background-color: #FFF6D3; +} + +.button:hover { + background-color: #F0EBD6; +} + +.center { + text-align: center; +} diff --git a/css/tabpane.css b/css/tabpane.css new file mode 100644 index 000000000..f9606ad8d --- /dev/null +++ b/css/tabpane.css @@ -0,0 +1,67 @@ +.tab-pane { + float: left; + position: relative; + width: 928px; +} + +.tab-pane-tax { + float: left; + position: relative; + width: 900px; +} + +.tab-row .tab { + text-align: center; + font-weight: bold; + display: inline; + margin: 0; + float: left; + padding: 2px 8px 3px 8px; + background: #EFEFEF; + z-index: 1; + white-space: nowrap; + position: relative; + font-size: 1.1em; +} + +.tab-row .tab.selected { + border: 1px solid #ccc; + border-bottom: 0; + background: #FFF6D3; + z-index: 3; + padding: 2px 25px 4px 25px; + margin: 1px -3px -3px 0px; + top: -2px; +} + +.tab-page { + clear: both; + border: 1px solid #ccc; + background: #FFFFF0; + z-index: 2; + position: relative; + padding: 10px; +} + +.tab-page table tr td.col-left { + width: 150px; + vertical-align: top; +} + +.tab-page table tr td p { + margin: 0.5em 0 0 0; + padding: 0 0 0.5em 0; + color: #7F7F7F; + font-size: 0.95em; +} + +.tab-page table tr td p.block { + display: block; + clear: both; +} + +.tab-row { + z-index: 1; + white-space: nowrap; +} + diff --git a/css/thickbox.css b/css/thickbox.css new file mode 100644 index 000000000..0226a1ac2 --- /dev/null +++ b/css/thickbox.css @@ -0,0 +1,174 @@ +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +*{padding: 0; margin: 0;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_window { + font: 12px Arial, Helvetica, sans-serif; + color: #333333; +} + +#TB_secondLine { + font: 10px Arial, Helvetica, sans-serif; + color:#666666; +} + +/*#TB_window a:link {color: #666666;} +#TB_window a:visited {color: #666666;} +#TB_window a:hover {color: #000;} +#TB_window a:active {color: #666666;} +#TB_window a:focus{color: #666666;}*/ +#TB_window h2 { + text-align:center; + padding-bottom: 25px; + display: block; +} + + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_overlay { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.TB_overlayMacFFBGHack {background: url(../img/macFFBgHack.png) repeat;} +.TB_overlayBG { + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; +} + +#TB_title{ + background-color:#e8e8e8; + height:27px; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} + +*+html #TB_window { /* ie7 hack */ + position: absolute; + margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} \ No newline at end of file diff --git a/discount.php b/discount.php new file mode 100644 index 000000000..973297f96 --- /dev/null +++ b/discount.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('DiscountController')->run(); diff --git a/docs/dev/dbmodel.mwb b/docs/dev/dbmodel.mwb new file mode 100644 index 000000000..63b998337 Binary files /dev/null and b/docs/dev/dbmodel.mwb differ diff --git a/docs/licences/cropper.txt b/docs/licences/cropper.txt new file mode 100644 index 000000000..f696f2532 --- /dev/null +++ b/docs/licences/cropper.txt @@ -0,0 +1,12 @@ +Copyright (c) 2006, David Spurr (www.defusion.org.uk) +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +http://www.opensource.org/licenses/bsd-license.php \ No newline at end of file diff --git a/docs/licences/fpdf.txt b/docs/licences/fpdf.txt new file mode 100644 index 000000000..694f0269a --- /dev/null +++ b/docs/licences/fpdf.txt @@ -0,0 +1,7 @@ +/******************************************************************************* +* FPDF * +* * +* Version : 1.6 * +* Date : 2008-08-03 * +* Auteur : Olivier PLATHEY * +*******************************************************************************/ \ No newline at end of file diff --git a/docs/licences/index.php b/docs/licences/index.php new file mode 100644 index 000000000..4c46c3561 --- /dev/null +++ b/docs/licences/index.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; +?> \ No newline at end of file diff --git a/docs/licences/open-software-3.0.txt b/docs/licences/open-software-3.0.txt new file mode 100644 index 000000000..f18dbccb9 --- /dev/null +++ b/docs/licences/open-software-3.0.txt @@ -0,0 +1,44 @@ +Open Source Links +Submitted by Michael Tiemann on Tue, 2006-09-19 03:53. :: +There are many resources (good and bad) on the web offering information, advice, and interpretation concerning Open Source. The following are references that we, the OSI Board, have found useful, either for informing ourselves or for helping others begin their education about open source. And as you explore these links, be mindful of these words attributed to the Buddha, "Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense..." + +Rich References + + * Open Source on Wikipedia. Note that Wikipedia itself is implemented using MediaWiki software, which is covered by the GNU GPL, a popular license that is both a free software license and also approved by the OSI as an Open Source license. + * David Wheeler's Why OSS? Just look at the numbers! + * David Wheeler's References + * The Free, Libre, and Open Source Software (FLOSS) Surveys and reports. + * The Economic impact of FLOSS on innovation and competitiveness of the EU ICT sector, published 20 November 2006 by UNU-Merit. (Also linked from our Research page). + +Books + + * The Cathedral and the Bazaar (online and book), Eric S. Raymond, 1997 + * Open Sources: Voices from the Open Source Revolution, Chris DiBona, Sam Ockman, and Mark Stone, 1999 + * Open Sources 2.0: The Continuing Evolution, Chris DiBona, Mark Stone, and Danese Cooper, 2005 + * The Success of Open Source, Steven Weber, 2004 + * Producing Open Source Software, Karl Fogel, 2005 + * Open Source Licensing, Larry Rosen, 2004 + * Collaborative Ownership and the Digital Economy, Rishab Aiyer Ghosh, 2005 + +Open Source Software + + * The Free Software Directory Lists over 5,000 packages. (Yes, Free Software is also Open Source Software) + * sourceforge.net Lists over 120,000 projects in varying stages of development. Mainly for developers. The public sourceforge.net site only hosts projects covered by an OSI-approved license. + * freshmeat.net Lists over 60,000 new releases of Open Source packages. Mainly for people who want to download the latest releases from developers. freshmeat.net strongly prefers software covered by an OSI-approved license (but will host non-open source software in exchange for a fee). + +Open Source Conferences and User Groups + + * OSCON. Note that O'Reilly Media put on many other conferences, most of which have strong open source components and/or constitutents. + * FOSS4G. Free and Open Source Geospatial Information Systems conference. + * Blender Conference. There are other regional versions of this conference that can be found at the blender.org website. + * The Ottawa Linux Symposium. A premier event for hackers to discuss implementation experiences and chart the future of Linux. + * The Wizards of OS conference in Berlin. + * The FISL conference in Porto Alegre, Brazil. + * The FOSSSL conference (and other events) in Colombo, Sri Lanka. + * There are hundreds of conferences per year all over the world that advertise "Open Source" as a topic. Alas, these have varying degrees of quality and felicity and the OSI does not vouch for (nor recommend against) the ones not listed in this section. Check to see whether an OSI-affiliated speaker is listed as presenting if you wish to hear the OSI's thoughts or positions. + * User groups tend to focus on software or groups of software used in a particular context: Linux users in Northern Virginia (NOVALUG), PostgreSQL users in Dubai (EMIRPUG), GIS developers and users who formed the Indian Chapter of OSGeo, or the dozens of topic-specific users of the R package and its extensions. There are many thousands of user groups, and the best way to find the one that's right for you is to search the web, find the mailing lists, and make contact. + +Packaged Open Source Software + +Hundreds, if not thousands, of companies now sell commercially packaged and supported open source software. While many open source software packages do run on proprietary systems (Apache is quite popular on all operating systems platforms), Linux distributions provide a complete (and in some cases, exclusively) open source environment suitable for hand-held, desktop, server, and high-end enterprise/cluster/mainframe use. +The OSI website is built with and runs exclusively open source software, including Apache (web server), Drupal (content management and blogs), the PHP scripting language, the MySQL database, to name a few of the more well-known packages. \ No newline at end of file diff --git a/docs/licences/tinymce-smarty-swift.txt b/docs/licences/tinymce-smarty-swift.txt new file mode 100644 index 000000000..070b42c74 --- /dev/null +++ b/docs/licences/tinymce-smarty-swift.txt @@ -0,0 +1,460 @@ +TinyMCE, Smarty and Swift are licenced under LGPL : + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + 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 Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +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 other code 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. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + 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, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) 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. + + d) 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. + + e) 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 materials to be 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 with +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 Lesser 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 diff --git a/download/.htaccess b/download/.htaccess new file mode 100644 index 000000000..93169e4eb --- /dev/null +++ b/download/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/download/index.php b/download/index.php new file mode 100644 index 000000000..e3a60fae7 --- /dev/null +++ b/download/index.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 000000000..4b25c2d64 --- /dev/null +++ b/footer.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$controller = new FrontController(); +$controller->displayFooter(); diff --git a/get-file.php b/get-file.php new file mode 100644 index 000000000..c66cc201b --- /dev/null +++ b/get-file.php @@ -0,0 +1,300 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/config/config.inc.php'); +include(dirname(__FILE__).'/init.php'); + +function displayError($msg) +{ + $translations = array( + 'Invalid key.' => Tools::displayError('Invalid key.'), + 'This product does not exist in our store.' => Tools::displayError('This product does not exist in our store.'), + 'This product has been deleted.' => Tools::displayError('This product has been deleted.'), + 'This file no longer exists.' => Tools::displayError('This file no longer exists.'), + 'The product deadline is in the past.' => Tools::displayError('The product deadline is in the past.'), + 'Expiration date exceeded' => Tools::displayError('Expiration date exceeded'), + 'You have reached the maximum number of allowed downloads.' => Tools::displayError('You have reached the maximum number of allowed downloads.')); +?> + +isLoggedBack() AND Tools::getValue('file')) +{ + /* Admin can directly access to file */ + $filename = Tools::getValue('file'); + if (!Validate::isSha1($filename)) + die(Tools::displayError()); + $file = _PS_DOWNLOAD_DIR_.strval(preg_replace('/\.{2,}/', '.',$filename)); + $filename = ProductDownload::getFilenameFromFilename(Tools::getValue('file')); + if (empty($filename)) + { + $newFileName = Tools::getValue('filename'); + if (!empty($newFileName)) + $filename = Tools::getValue('filename'); + else + $filename = 'file'; + } + + if (!file_exists($file)) + Tools::redirect('index.php'); +} +else +{ + if (!($key = Tools::getValue('key'))) + displayError('Invalid key.'); + + $cookie = new Cookie('ps'); + Tools::setCookieLanguage(); + if (!$cookie->isLogged() AND !Tools::getValue('secure_key') AND !Tools::getValue('id_order')) + Tools::redirect('authentication.php?back=get-file.php&key='.$key); + elseif (!$cookie->isLogged() AND Tools::getValue('secure_key') AND Tools::getValue('id_order')) + { + $order = new Order((int)Tools::getValue('id_order')); + if (!Validate::isLoadedObject($order)) + displayError('Invalid key.'); + if ($order->secure_key != Tools::getValue('secure_key')) + displayError('Invalid key.'); + } + + /* Key format: - */ + $tmp = explode('-', $key); + if (sizeof($tmp) != 2) + displayError('Invalid key.'); + + $filename = $tmp[0]; + $hash = $tmp[1]; + + if (!($info = OrderDetail::getDownloadFromHash($hash))) + displayError('This product does not exist in our store.'); + + /* Product no more present in catalog */ + if (!isset($info['id_product_download']) OR empty($info['id_product_download'])) + displayError('This product has been deleted.'); + + if (!file_exists(_PS_DOWNLOAD_DIR_.$filename)) + displayError('This file no longer exists.'); + + $now = time(); + + $product_deadline = strtotime($info['download_deadline']); + if ($now > $product_deadline AND $info['download_deadline'] != '0000-00-00 00:00:00') + displayError('The product deadline is in the past.'); + + $customer_deadline = strtotime($info['date_expiration']); + if ($now > $customer_deadline AND $info['date_expiration'] != '0000-00-00 00:00:00') + displayError('Expiration date exceeded'); + + if ($info['download_nb'] >= $info['nb_downloadable'] AND $info['nb_downloadable']) + displayError('You have reached the maximum number of allowed downloads.'); + + /* Access is authorized -> increment download value for the customer */ + OrderDetail::incrementDownload($info['id_order_detail']); + + $file = _PS_DOWNLOAD_DIR_.$info['physically_filename']; + $filename = $info['display_filename']; +} + +/* Detect mime content type */ +$mimeType = false; +if (function_exists('finfo_open')) +{ + $finfo = @finfo_open(FILEINFO_MIME); + $mimeType = @finfo_file($finfo, $file); + @finfo_close($finfo); +} +elseif (function_exists('mime_content_type')) + $mimeType = @mime_content_type($file); +elseif (function_exists('exec')) +{ + $mimeType = trim(@exec('file -b --mime-type '.escapeshellarg($file))); + if (!$mimeType) + $mimeType = trim(@exec('file --mime '.escapeshellarg($file))); + if (!$mimeType) + $mimeType = trim(@exec('file -bi '.escapeshellarg($file))); +} + +if (empty($mimeType)) +{ + $bName = basename($filename); + $bName = explode('.', $bName); + $bName = strtolower($bName[count($bName) - 1]); + + $mimeTypes = array( + 'ez' => 'application/andrew-inset', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'doc' => 'application/msword', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'bcpio' => 'application/x-bcpio', + 'vcd' => 'application/x-cdlink', + 'pgn' => 'application/x-chess-pgn', + 'cpio' => 'application/x-cpio', + 'csh' => 'application/x-csh', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'spl' => 'application/x-futuresplash', + 'gtar' => 'application/x-gtar', + 'hdf' => 'application/x-hdf', + 'js' => 'application/x-javascript', + 'skp' => 'application/x-koan', + 'skd' => 'application/x-koan', + 'skt' => 'application/x-koan', + 'skm' => 'application/x-koan', + 'latex' => 'application/x-latex', + 'nc' => 'application/x-netcdf', + 'cdf' => 'application/x-netcdf', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'tar' => 'application/x-tar', + 'tcl' => 'application/x-tcl', + 'tex' => 'application/x-tex', + 'texinfo' => 'application/x-texinfo', + 'texi' => 'application/x-texinfo', + 't' => 'application/x-troff', + 'tr' => 'application/x-troff', + 'roff' => 'application/x-troff', + 'man' => 'application/x-troff-man', + 'me' => 'application/x-troff-me', + 'ms' => 'application/x-troff-ms', + 'ustar' => 'application/x-ustar', + 'src' => 'application/x-wais-source', + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'au' => 'audio/basic', + 'snd' => 'audio/basic', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'kar' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'm3u' => 'audio/x-mpegurl', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'wav' => 'audio/x-wav', + 'pdb' => 'chemical/x-pdb', + 'xyz' => 'chemical/x-xyz', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'ief' => 'image/ief', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tif', + 'djvu' => 'image/vnd.djvu', + 'djv' => 'image/vnd.djvu', + 'wbmp' => 'image/vnd.wap.wbmp', + 'ras' => 'image/x-cmu-raster', + 'pnm' => 'image/x-portable-anymap', + 'pbm' => 'image/x-portable-bitmap', + 'pgm' => 'image/x-portable-graymap', + 'ppm' => 'image/x-portable-pixmap', + 'rgb' => 'image/x-rgb', + 'xbm' => 'image/x-xbitmap', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-windowdump', + 'igs' => 'model/iges', + 'iges' => 'model/iges', + 'msh' => 'model/mesh', + 'mesh' => 'model/mesh', + 'silo' => 'model/mesh', + 'wrl' => 'model/vrml', + 'vrml' => 'model/vrml', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'asc' => 'text/plain', + 'txt' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'sgml' => 'text/sgml', + 'sgm' => 'text/sgml', + 'tsv' => 'text/tab-seperated-values', + 'wml' => 'text/vnd.wap.wml', + 'wmls' => 'text/vnd.wap.wmlscript', + 'etx' => 'text/x-setext', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'mxu' => 'video/vnd.mpegurl', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'ice' => 'x-conference-xcooltalk'); + + if (isset($mimeTypes[$bName])) + $mimeType = $mimeTypes[$bName]; + else + $mimeType = 'application/octet-stream'; +} + + +/* Set headers for download */ +header('Content-Transfer-Encoding: binary'); +header('Content-Type: '.$mimeType); +header('Content-Length: '.filesize($file)); +header('Content-Disposition: attachment; filename="'.$filename.'"'); +ob_end_flush(); +$fp = fopen($file, 'rb'); +while (!feof($fp)) + echo fgets($fp, 16384); + +exit; diff --git a/guest-tracking.php b/guest-tracking.php new file mode 100644 index 000000000..c5ac5c5e3 --- /dev/null +++ b/guest-tracking.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('GuestTrackingController')->run(); diff --git a/header.php b/header.php new file mode 100644 index 000000000..3c247b7a7 --- /dev/null +++ b/header.php @@ -0,0 +1,30 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$controller = new FrontController(); +$controller->displayHeader(); + diff --git a/history.php b/history.php new file mode 100644 index 000000000..11370d2ce --- /dev/null +++ b/history.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('HistoryController')->run(); diff --git a/identity.php b/identity.php new file mode 100644 index 000000000..4dac92f1c --- /dev/null +++ b/identity.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('IdentityController')->run(); diff --git a/images.inc.php b/images.inc.php new file mode 100644 index 000000000..0d851e178 --- /dev/null +++ b/images.inc.php @@ -0,0 +1,345 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Generate a cached thumbnail for object lists (eg. carrier, order states...etc) + * + * @param string $image Real image filename + * @param string $cacheImage Cached filename + * @param integer $size Desired size + */ +function cacheImage($image, $cacheImage, $size, $imageType = 'jpg') +{ + if (file_exists($image)) + { + if (!file_exists(_PS_TMP_IMG_DIR_.$cacheImage)) + { + $imageGd = ($imageType == 'gif' ? imagecreatefromgif($image) : imagecreatefromjpeg($image)); + $x = imagesx($imageGd); + $y = imagesy($imageGd); + $max_x = ((int)$size)*3; + /* Size is already ok */ + if ($y < $size && $x <= $max_x ) + copy($image, _PS_TMP_IMG_DIR_.$cacheImage); + + /* We need to resize */ + else + { + $ratioX = $x / ($y / $size); + if($ratioX > $max_x) + { + $ratioX = $max_x; + $size = $y / ($x / $max_x); + } + $newImage = ($imageType == 'gif' ? imagecreate($ratioX, $size) : imagecreatetruecolor($ratioX, $size)); + + /* Allow to keep nice look even if resized */ + $white = imagecolorallocate($newImage, 255, 255, 255); + imagefill($newImage, 0, 0, $white); + imagecopyresampled($newImage, $imageGd, 0, 0, 0, 0, $ratioX, $size, $x, $y); + imagecolortransparent($newImage, $white); + + /* Quality alteration and image creation */ + if ($imageType == 'gif') + imagegif($newImage, _PS_TMP_IMG_DIR_.$cacheImage); + else + imagejpeg($newImage, _PS_TMP_IMG_DIR_.$cacheImage, 86); + } + } + return ''; + } + return ''; +} + +/** + * Check image upload + * + * @param array $file Upload $_FILE value + * @param integer $maxFileSize Maximum upload size + */ +function checkImage($file, $maxFileSize) +{ + if ($file['size'] > $maxFileSize) + return Tools::displayError('Image is too large').' ('.($file['size'] / 1000).Tools::displayError('KB').'). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).Tools::displayError('KB'); + if (!isPicture($file)) + return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png'); + if ($file['error']) + return Tools::displayError('Error while uploading image; please change your server\'s settings.').'('.Tools::displayError('Error code: ').$file['error'].')'; + return false; +} + + + +function checkImageUploadError($file) +{ + if ($file['error']) + { + switch ($file['error']) + { + case 1: + return Tools::displayError('The file is too large.'); + break; + + case 2: + return Tools::displayError('The file is too large.'); + break; + + case 3: + return Tools::displayError('The file was partialy uploaded'); + break; + + case 4: + return Tools::displayError('The file is empty'); + break; + } + } +} + +/** + * Check image MIME type + * + * @param string $file $_FILE of the current file + * @param array $types Allowed MIME types + */ +function isPicture($file, $types = NULL) +{ + /* Detect mime content type */ + $mimeType = false; + if (!$types) + $types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png'); + + /* Try 4 different methods to determine the mime type */ + if (function_exists('finfo_open')) + { + $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; + $finfo = finfo_open($const); + $mimeType = finfo_file($finfo, $file['tmp_name']); + finfo_close($finfo); + } + elseif (function_exists('mime_content_type')) + $mimeType = mime_content_type($file['tmp_name']); + elseif (function_exists('exec')) + { + $mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name']))); + if (!$mimeType) + $mimeType = trim(exec('file --mime '.escapeshellarg($file['tmp_name']))); + if (!$mimeType) + $mimeType = trim(exec('file -bi '.escapeshellarg($file['tmp_name']))); + } + if (empty($mimeType) OR $mimeType == 'regular file') + $mimeType = $file['type']; + + /* For each allowed MIME type, we are looking for it inside the current MIME type */ + foreach ($types AS $type) + if (strstr($mimeType, $type)) + return true; + + return false; +} + +/** + * Check icon upload + * + * @param array $file Upload $_FILE value + * @param integer $maxFileSize Maximum upload size + */ +function checkIco($file, $maxFileSize) +{ + if ($file['size'] > $maxFileSize) + return Tools::displayError('Image is too large').' ('.($file['size'] / 1000).'ko). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).'ko'; + if (substr($file['name'], -4) != '.ico') + return Tools::displayError('Image format not recognized, allowed formats are: .ico'); + if ($file['error']) + return Tools::displayError('Error while uploading image; please change your server\'s settings.'); + return false; +} + +/** + * Resize, cut and optimize image + * + * @param array $sourceFile Image object from $_FILE + * @param string $destFile Destination filename + * @param integer $destWidth Desired width (optional) + * @param integer $destHeight Desired height (optional) + * + * @return boolean Operation result + */ +function imageResize($sourceFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg') +{ + list($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($sourceFile); + if (!$sourceWidth) + return false; + if ($destWidth == NULL) $destWidth = $sourceWidth; + if ($destHeight == NULL) $destHeight = $sourceHeight; + + $sourceImage = createSrcImage($type, $sourceFile); + + $widthDiff = $destWidth / $sourceWidth; + $heightDiff = $destHeight / $sourceHeight; + + if ($widthDiff > 1 AND $heightDiff > 1) + { + $nextWidth = $sourceWidth; + $nextHeight = $sourceHeight; + } + else + { + if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 OR (!Configuration::get('PS_IMAGE_GENERATION_METHOD') AND $widthDiff > $heightDiff)) + { + $nextHeight = $destHeight; + $nextWidth = round(($sourceWidth * $nextHeight) / $sourceHeight); + $destWidth = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $destWidth : $nextWidth); + } + else + { + $nextWidth = $destWidth; + $nextHeight = round($sourceHeight * $destWidth / $sourceWidth); + $destHeight = (int)(!Configuration::get('PS_IMAGE_GENERATION_METHOD') ? $destHeight : $nextHeight); + } + } + + $destImage = imagecreatetruecolor($destWidth, $destHeight); + + $white = imagecolorallocate($destImage, 255, 255, 255); + imagefilledrectangle ($destImage, 0, 0, $destWidth, $destHeight, $white); + + imagecopyresampled($destImage, $sourceImage, (int)(($destWidth - $nextWidth) / 2), (int)(($destHeight - $nextHeight) / 2), 0, 0, $nextWidth, $nextHeight, $sourceWidth, $sourceHeight); + imagecolortransparent($destImage, $white); + return (returnDestImage($fileType, $destImage, $destFile)); +} + +/** + * Cut image + * + * @param array $srcFile Image object from $_FILE + * @param string $destFile Destination filename + * @param integer $destWidth Desired width (optional) + * @param integer $destHeight Desired height (optional) + * + * @return boolean Operation result + */ +function imageCut($srcFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg', $destX = 0, $destY = 0) +{ + if (!isset($srcFile['tmp_name']) OR !file_exists($srcFile['tmp_name'])) + return false; + + // Source infos + $srcInfos = getimagesize($srcFile['tmp_name']); + $src['width'] = $srcInfos[0]; + $src['height'] = $srcInfos[1]; + $src['ressource'] = createSrcImage($srcInfos[2], $srcFile['tmp_name']); + + // Destination infos + $dest['x'] = $destX; + $dest['y'] = $destY; + $dest['width'] = $destWidth != NULL ? $destWidth : $src['width']; + $dest['height'] = $destHeight != NULL ? $destHeight : $src['height']; + $dest['ressource'] = createDestImage($dest['width'], $dest['height']); + + $white = imagecolorallocate($dest['ressource'], 255, 255, 255); + imagecopyresampled($dest['ressource'], $src['ressource'], 0, 0, $dest['x'], $dest['y'], $dest['width'], $dest['height'], $dest['width'], $dest['height']); + imagecolortransparent($dest['ressource'], $white); + $return = returnDestImage($fileType, $dest['ressource'], $destFile); + return ($return); +} + +function createSrcImage($type, $filename) +{ + switch ($type) + { + case 1: + return imagecreatefromgif($filename); + break; + case 3: + return imagecreatefrompng($filename); + break; + case 2: + default: + return imagecreatefromjpeg($filename); + break; + } +} + +function createDestImage($width, $height) +{ + $image = imagecreatetruecolor($width, $height); + $white = imagecolorallocate($image, 255, 255, 255); + imagefill($image, 0, 0, $white); + return $image; +} + +function returnDestImage($type, $ressource, $filename) +{ + $flag = false; + switch ($type) + { + case 'gif': + $flag = imagegif($ressource, $filename); + break; + case 'png': + $flag = imagepng($ressource, $filename, 7); + break; + case 'jpeg': + default: + $flag = imagejpeg($ressource, $filename, 90); + break; + } + imagedestroy($ressource); + return $flag; +} + +/** + * Delete product or category image + * + * @param integer $id_item Product or category id + * @param integer $id_image Image id + */ +function deleteImage($id_item, $id_image = NULL) +{ + $path = ($id_image) ? _PS_PROD_IMG_DIR_ : _PS_CAT_IMG_DIR_; + $table = ($id_image) ? 'product' : 'category'; + + if (file_exists(_PS_TMP_IMG_DIR_.$table.'_'.$id_item.'.jpg')) + unlink(_PS_TMP_IMG_DIR_.$table.'_'.$id_item.'.jpg'); + + if ($id_image AND file_exists($path.$id_item.'-'.$id_image.'.jpg')) + unlink($path.$id_item.'-'.$id_image.'.jpg'); + elseif (!$id_image AND file_exists($path.$id_item.'.jpg')) + unlink($path.$id_item.'.jpg'); + /* Auto-generated images */ + $imagesTypes = ImageType::getImagesTypes(); + foreach ($imagesTypes AS $k => $imagesType) + if ($id_image AND file_exists($path.$id_item.'-'.$id_image.'-'.$imagesType['name'].'.jpg')) + unlink($path.$id_item.'-'.$id_image.'-'.$imagesType['name'].'.jpg'); + elseif (!$id_image AND file_exists($path.$id_item.'-'.$imagesType['name'].'.jpg')) + unlink($path.$id_item.'-'.$imagesType['name'].'.jpg'); + /* BO "mini" image */ + if (file_exists(_PS_TMP_IMG_DIR_.$table.'_mini_'.$id_item.'.jpg')) + unlink(_PS_TMP_IMG_DIR_.$table.'_mini_'.$id_item.'.jpg'); + return true; +} + diff --git a/img/404.gif b/img/404.gif new file mode 100644 index 000000000..e61d3b039 Binary files /dev/null and b/img/404.gif differ diff --git a/img/admin/AdminCatalog.gif b/img/admin/AdminCatalog.gif new file mode 100644 index 000000000..0e24cbc0c Binary files /dev/null and b/img/admin/AdminCatalog.gif differ diff --git a/img/admin/AdminCustomers.gif b/img/admin/AdminCustomers.gif new file mode 100644 index 000000000..faef1dc53 Binary files /dev/null and b/img/admin/AdminCustomers.gif differ diff --git a/img/admin/AdminEmployees.gif b/img/admin/AdminEmployees.gif new file mode 100644 index 000000000..38e91df29 Binary files /dev/null and b/img/admin/AdminEmployees.gif differ diff --git a/img/admin/AdminModules.gif b/img/admin/AdminModules.gif new file mode 100644 index 000000000..29b86c2b2 Binary files /dev/null and b/img/admin/AdminModules.gif differ diff --git a/img/admin/AdminNext.gif b/img/admin/AdminNext.gif new file mode 100644 index 000000000..9e6deea25 Binary files /dev/null and b/img/admin/AdminNext.gif differ diff --git a/img/admin/AdminOrders.gif b/img/admin/AdminOrders.gif new file mode 100644 index 000000000..5717dc046 Binary files /dev/null and b/img/admin/AdminOrders.gif differ diff --git a/img/admin/AdminPayment.gif b/img/admin/AdminPayment.gif new file mode 100644 index 000000000..14bb881bd Binary files /dev/null and b/img/admin/AdminPayment.gif differ diff --git a/img/admin/AdminPreferences.gif b/img/admin/AdminPreferences.gif new file mode 100644 index 000000000..5c1dedd6e Binary files /dev/null and b/img/admin/AdminPreferences.gif differ diff --git a/img/admin/AdminShipping.gif b/img/admin/AdminShipping.gif new file mode 100644 index 000000000..362e2928e Binary files /dev/null and b/img/admin/AdminShipping.gif differ diff --git a/img/admin/AdminStats.gif b/img/admin/AdminStats.gif new file mode 100644 index 000000000..a348d0efb Binary files /dev/null and b/img/admin/AdminStats.gif differ diff --git a/img/admin/AdminTools.gif b/img/admin/AdminTools.gif new file mode 100644 index 000000000..854e17468 Binary files /dev/null and b/img/admin/AdminTools.gif differ diff --git a/img/admin/___info-ca.gif b/img/admin/___info-ca.gif new file mode 100644 index 000000000..0bb96b05d Binary files /dev/null and b/img/admin/___info-ca.gif differ diff --git a/img/admin/access.png b/img/admin/access.png new file mode 100644 index 000000000..1800f8e56 Binary files /dev/null and b/img/admin/access.png differ diff --git a/img/admin/add-btn.png b/img/admin/add-btn.png new file mode 100644 index 000000000..642a6e173 Binary files /dev/null and b/img/admin/add-btn.png differ diff --git a/img/admin/add.gif b/img/admin/add.gif new file mode 100644 index 000000000..df08c0b6b Binary files /dev/null and b/img/admin/add.gif differ diff --git a/img/admin/add_2.gif b/img/admin/add_2.gif new file mode 100644 index 000000000..5e461f7e1 Binary files /dev/null and b/img/admin/add_2.gif differ diff --git a/img/admin/addresses_edit.gif b/img/admin/addresses_edit.gif new file mode 100644 index 000000000..369fc46ed Binary files /dev/null and b/img/admin/addresses_edit.gif differ diff --git a/img/admin/affiliation.png b/img/admin/affiliation.png new file mode 100644 index 000000000..aaa2d245c Binary files /dev/null and b/img/admin/affiliation.png differ diff --git a/img/admin/ajax-loader.gif b/img/admin/ajax-loader.gif new file mode 100644 index 000000000..f2a1bc0c6 Binary files /dev/null and b/img/admin/ajax-loader.gif differ diff --git a/img/admin/appearance.gif b/img/admin/appearance.gif new file mode 100644 index 000000000..1e5f79e9b Binary files /dev/null and b/img/admin/appearance.gif differ diff --git a/img/admin/arrow-left.png b/img/admin/arrow-left.png new file mode 100644 index 000000000..bbd58a2f9 Binary files /dev/null and b/img/admin/arrow-left.png differ diff --git a/img/admin/arrow-right.png b/img/admin/arrow-right.png new file mode 100644 index 000000000..9a28a7692 Binary files /dev/null and b/img/admin/arrow-right.png differ diff --git a/img/admin/arrow.gif b/img/admin/arrow.gif new file mode 100644 index 000000000..99b6f50b8 Binary files /dev/null and b/img/admin/arrow.gif differ diff --git a/img/admin/arrow2.gif b/img/admin/arrow2.gif new file mode 100644 index 000000000..f5c7f4856 Binary files /dev/null and b/img/admin/arrow2.gif differ diff --git a/img/admin/arrow_down.png b/img/admin/arrow_down.png new file mode 100644 index 000000000..4d6ceaaac Binary files /dev/null and b/img/admin/arrow_down.png differ diff --git a/img/admin/arrow_in.png b/img/admin/arrow_in.png new file mode 100755 index 000000000..134e12263 Binary files /dev/null and b/img/admin/arrow_in.png differ diff --git a/img/admin/arrow_out.png b/img/admin/arrow_out.png new file mode 100755 index 000000000..2e9bc42be Binary files /dev/null and b/img/admin/arrow_out.png differ diff --git a/img/admin/arrow_up.png b/img/admin/arrow_up.png new file mode 100644 index 000000000..1ab1ee714 Binary files /dev/null and b/img/admin/arrow_up.png differ diff --git a/img/admin/asterisk.gif b/img/admin/asterisk.gif new file mode 100644 index 000000000..897dc0a63 Binary files /dev/null and b/img/admin/asterisk.gif differ diff --git a/img/admin/barcode.gif b/img/admin/barcode.gif new file mode 100644 index 000000000..c5194ed3f Binary files /dev/null and b/img/admin/barcode.gif differ diff --git a/img/admin/basket_error.png b/img/admin/basket_error.png new file mode 100644 index 000000000..5606ab366 Binary files /dev/null and b/img/admin/basket_error.png differ diff --git a/img/admin/bg.png b/img/admin/bg.png new file mode 100644 index 000000000..bef777e26 Binary files /dev/null and b/img/admin/bg.png differ diff --git a/img/admin/bg_2.png b/img/admin/bg_2.png new file mode 100644 index 000000000..22ea7050e Binary files /dev/null and b/img/admin/bg_2.png differ diff --git a/img/admin/bg_login.gif b/img/admin/bg_login.gif new file mode 100644 index 000000000..4a2017602 Binary files /dev/null and b/img/admin/bg_login.gif differ diff --git a/img/admin/bg_pslink.png b/img/admin/bg_pslink.png new file mode 100644 index 000000000..432bdb734 Binary files /dev/null and b/img/admin/bg_pslink.png differ diff --git a/img/admin/binoculars.png b/img/admin/binoculars.png new file mode 100644 index 000000000..3c9de0454 Binary files /dev/null and b/img/admin/binoculars.png differ diff --git a/img/admin/blank.gif b/img/admin/blank.gif new file mode 100644 index 000000000..6e289cecc Binary files /dev/null and b/img/admin/blank.gif differ diff --git a/img/admin/block_bg.jpg b/img/admin/block_bg.jpg new file mode 100644 index 000000000..12d87c9d8 Binary files /dev/null and b/img/admin/block_bg.jpg differ diff --git a/img/admin/calendar.png b/img/admin/calendar.png new file mode 100644 index 000000000..b98c29f4a Binary files /dev/null and b/img/admin/calendar.png differ diff --git a/img/admin/cart.gif b/img/admin/cart.gif new file mode 100644 index 000000000..be9175d6f Binary files /dev/null and b/img/admin/cart.gif differ diff --git a/img/admin/catalog_xl.png b/img/admin/catalog_xl.png new file mode 100644 index 000000000..58778b34a Binary files /dev/null and b/img/admin/catalog_xl.png differ diff --git a/img/admin/center_btn_filter.png b/img/admin/center_btn_filter.png new file mode 100644 index 000000000..f7009ad52 Binary files /dev/null and b/img/admin/center_btn_filter.png differ diff --git a/img/admin/charged_ko.gif b/img/admin/charged_ko.gif new file mode 100644 index 000000000..2ed560ec4 Binary files /dev/null and b/img/admin/charged_ko.gif differ diff --git a/img/admin/charged_ok.gif b/img/admin/charged_ok.gif new file mode 100644 index 000000000..f2d449b1d Binary files /dev/null and b/img/admin/charged_ok.gif differ diff --git a/img/admin/close-white.png b/img/admin/close-white.png new file mode 100644 index 000000000..b23fdb88e Binary files /dev/null and b/img/admin/close-white.png differ diff --git a/img/admin/close.png b/img/admin/close.png new file mode 100644 index 000000000..2ceb6133f Binary files /dev/null and b/img/admin/close.png differ diff --git a/img/admin/cms.gif b/img/admin/cms.gif new file mode 100644 index 000000000..176c99a23 Binary files /dev/null and b/img/admin/cms.gif differ diff --git a/img/admin/cog.gif b/img/admin/cog.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/img/admin/cog.gif differ diff --git a/img/admin/color.png b/img/admin/color.png new file mode 100644 index 000000000..35eefe489 Binary files /dev/null and b/img/admin/color.png differ diff --git a/img/admin/colorpicker.png b/img/admin/colorpicker.png new file mode 100644 index 000000000..9e125df52 Binary files /dev/null and b/img/admin/colorpicker.png differ diff --git a/img/admin/comment.gif b/img/admin/comment.gif new file mode 100644 index 000000000..7bc9233ea Binary files /dev/null and b/img/admin/comment.gif differ diff --git a/img/admin/commercial.gif b/img/admin/commercial.gif new file mode 100644 index 000000000..716701bee Binary files /dev/null and b/img/admin/commercial.gif differ diff --git a/img/admin/computer_key.png b/img/admin/computer_key.png new file mode 100644 index 000000000..fd3b96a27 Binary files /dev/null and b/img/admin/computer_key.png differ diff --git a/img/admin/contact.gif b/img/admin/contact.gif new file mode 100644 index 000000000..2e0b0e373 Binary files /dev/null and b/img/admin/contact.gif differ diff --git a/img/admin/copy_files.gif b/img/admin/copy_files.gif new file mode 100644 index 000000000..8b10e8781 Binary files /dev/null and b/img/admin/copy_files.gif differ diff --git a/img/admin/coupon.gif b/img/admin/coupon.gif new file mode 100644 index 000000000..f61d4f7bd Binary files /dev/null and b/img/admin/coupon.gif differ diff --git a/img/admin/customer_xl.png b/img/admin/customer_xl.png new file mode 100644 index 000000000..bfc1ba4e2 Binary files /dev/null and b/img/admin/customer_xl.png differ diff --git a/img/admin/database_gear.gif b/img/admin/database_gear.gif new file mode 100644 index 000000000..ee12dc40f Binary files /dev/null and b/img/admin/database_gear.gif differ diff --git a/img/admin/date.gif b/img/admin/date.gif new file mode 100644 index 000000000..38cbc7852 Binary files /dev/null and b/img/admin/date.gif differ diff --git a/img/admin/date.png b/img/admin/date.png new file mode 100644 index 000000000..62df31c93 Binary files /dev/null and b/img/admin/date.png differ diff --git a/img/admin/delete.gif b/img/admin/delete.gif new file mode 100644 index 000000000..20874bb38 Binary files /dev/null and b/img/admin/delete.gif differ diff --git a/img/admin/delivery.gif b/img/admin/delivery.gif new file mode 100644 index 000000000..482ceea3c Binary files /dev/null and b/img/admin/delivery.gif differ diff --git a/img/admin/delivery_ko.gif b/img/admin/delivery_ko.gif new file mode 100644 index 000000000..5e38dce1a Binary files /dev/null and b/img/admin/delivery_ko.gif differ diff --git a/img/admin/details.gif b/img/admin/details.gif new file mode 100644 index 000000000..95eaaa9a3 Binary files /dev/null and b/img/admin/details.gif differ diff --git a/img/admin/disabled.gif b/img/admin/disabled.gif new file mode 100644 index 000000000..5b47cbe5e Binary files /dev/null and b/img/admin/disabled.gif differ diff --git a/img/admin/dollar.gif b/img/admin/dollar.gif new file mode 100644 index 000000000..a8672a610 Binary files /dev/null and b/img/admin/dollar.gif differ diff --git a/img/admin/down-white.gif b/img/admin/down-white.gif new file mode 100755 index 000000000..b969607d3 Binary files /dev/null and b/img/admin/down-white.gif differ diff --git a/img/admin/down.gif b/img/admin/down.gif new file mode 100644 index 000000000..f806d8534 Binary files /dev/null and b/img/admin/down.gif differ diff --git a/img/admin/down_d.gif b/img/admin/down_d.gif new file mode 100644 index 000000000..6ddb4ab14 Binary files /dev/null and b/img/admin/down_d.gif differ diff --git a/img/admin/download_page.png b/img/admin/download_page.png new file mode 100644 index 000000000..6bc3f4f0a Binary files /dev/null and b/img/admin/download_page.png differ diff --git a/img/admin/duplicate.gif b/img/admin/duplicate.gif new file mode 100644 index 000000000..ec5dc73f4 Binary files /dev/null and b/img/admin/duplicate.gif differ diff --git a/img/admin/duplicate.png b/img/admin/duplicate.png new file mode 100644 index 000000000..f7ad39ca0 Binary files /dev/null and b/img/admin/duplicate.png differ diff --git a/img/admin/edit.gif b/img/admin/edit.gif new file mode 100644 index 000000000..7934bbc8c Binary files /dev/null and b/img/admin/edit.gif differ diff --git a/img/admin/edit_2.gif b/img/admin/edit_2.gif new file mode 100644 index 000000000..5d62aac1a Binary files /dev/null and b/img/admin/edit_2.gif differ diff --git a/img/admin/email.gif b/img/admin/email.gif new file mode 100644 index 000000000..94ba79d85 Binary files /dev/null and b/img/admin/email.gif differ diff --git a/img/admin/email_edit.gif b/img/admin/email_edit.gif new file mode 100644 index 000000000..2e0b0e373 Binary files /dev/null and b/img/admin/email_edit.gif differ diff --git a/img/admin/employee.gif b/img/admin/employee.gif new file mode 100644 index 000000000..d1ca455c7 Binary files /dev/null and b/img/admin/employee.gif differ diff --git a/img/admin/employees_xl.png b/img/admin/employees_xl.png new file mode 100644 index 000000000..d9215fbd6 Binary files /dev/null and b/img/admin/employees_xl.png differ diff --git a/img/admin/enabled-2.gif b/img/admin/enabled-2.gif new file mode 100644 index 000000000..085b57b29 Binary files /dev/null and b/img/admin/enabled-2.gif differ diff --git a/img/admin/enabled.gif b/img/admin/enabled.gif new file mode 100644 index 000000000..5f3c6e571 Binary files /dev/null and b/img/admin/enabled.gif differ diff --git a/img/admin/error.png b/img/admin/error.png new file mode 100644 index 000000000..3c19c0ba1 Binary files /dev/null and b/img/admin/error.png differ diff --git a/img/admin/error2.png b/img/admin/error2.png new file mode 100644 index 000000000..5d52e2f1d Binary files /dev/null and b/img/admin/error2.png differ diff --git a/img/admin/exchangesrate.gif b/img/admin/exchangesrate.gif new file mode 100644 index 000000000..8e95c9c21 Binary files /dev/null and b/img/admin/exchangesrate.gif differ diff --git a/img/admin/export.gif b/img/admin/export.gif new file mode 100644 index 000000000..61f4912cc Binary files /dev/null and b/img/admin/export.gif differ diff --git a/img/admin/female.gif b/img/admin/female.gif new file mode 100644 index 000000000..1cf832899 Binary files /dev/null and b/img/admin/female.gif differ diff --git a/img/admin/female_2.gif b/img/admin/female_2.gif new file mode 100644 index 000000000..659255212 Binary files /dev/null and b/img/admin/female_2.gif differ diff --git a/img/admin/folder.gif b/img/admin/folder.gif new file mode 100644 index 000000000..54966407e Binary files /dev/null and b/img/admin/folder.gif differ diff --git a/img/admin/forbbiden.gif b/img/admin/forbbiden.gif new file mode 100644 index 000000000..c772d4989 Binary files /dev/null and b/img/admin/forbbiden.gif differ diff --git a/img/admin/gold.gif b/img/admin/gold.gif new file mode 100644 index 000000000..2cd6cec1b Binary files /dev/null and b/img/admin/gold.gif differ diff --git a/img/admin/google.gif b/img/admin/google.gif new file mode 100644 index 000000000..d24a14a90 Binary files /dev/null and b/img/admin/google.gif differ diff --git a/img/admin/graybar.jpg b/img/admin/graybar.jpg new file mode 100755 index 000000000..d3d2ccce2 Binary files /dev/null and b/img/admin/graybar.jpg differ diff --git a/img/admin/green-gradient.png b/img/admin/green-gradient.png new file mode 100755 index 000000000..e0fffbdd7 Binary files /dev/null and b/img/admin/green-gradient.png differ diff --git a/img/admin/greenlight-gradient.png b/img/admin/greenlight-gradient.png new file mode 100755 index 000000000..b289a372a Binary files /dev/null and b/img/admin/greenlight-gradient.png differ diff --git a/img/admin/grid.gif b/img/admin/grid.gif new file mode 100755 index 000000000..78b54c0f6 Binary files /dev/null and b/img/admin/grid.gif differ diff --git a/img/admin/group.gif b/img/admin/group.gif new file mode 100644 index 000000000..213f3a2c7 Binary files /dev/null and b/img/admin/group.gif differ diff --git a/img/admin/help-new.png b/img/admin/help-new.png new file mode 100644 index 000000000..dfb44849d Binary files /dev/null and b/img/admin/help-new.png differ diff --git a/img/admin/help.png b/img/admin/help.png new file mode 100644 index 000000000..d533abd3a Binary files /dev/null and b/img/admin/help.png differ diff --git a/img/admin/help2.png b/img/admin/help2.png new file mode 100644 index 000000000..04d4851da Binary files /dev/null and b/img/admin/help2.png differ diff --git a/img/admin/home.gif b/img/admin/home.gif new file mode 100644 index 000000000..d88478243 Binary files /dev/null and b/img/admin/home.gif differ diff --git a/img/admin/home.png b/img/admin/home.png new file mode 100644 index 000000000..bf9f725ed Binary files /dev/null and b/img/admin/home.png differ diff --git a/img/admin/htaccess.gif b/img/admin/htaccess.gif new file mode 100644 index 000000000..e10fb736f Binary files /dev/null and b/img/admin/htaccess.gif differ diff --git a/img/admin/import.gif b/img/admin/import.gif new file mode 100644 index 000000000..fdd46317e Binary files /dev/null and b/img/admin/import.gif differ diff --git a/img/admin/index.php b/img/admin/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/admin/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/admin/info.png b/img/admin/info.png new file mode 100644 index 000000000..bb000acac Binary files /dev/null and b/img/admin/info.png differ diff --git a/img/admin/information.png b/img/admin/information.png new file mode 100644 index 000000000..121c7336d Binary files /dev/null and b/img/admin/information.png differ diff --git a/img/admin/invoice.gif b/img/admin/invoice.gif new file mode 100644 index 000000000..7c1674351 Binary files /dev/null and b/img/admin/invoice.gif differ diff --git a/img/admin/less.png b/img/admin/less.png new file mode 100644 index 000000000..6f9bd66f8 Binary files /dev/null and b/img/admin/less.png differ diff --git a/img/admin/list-next.gif b/img/admin/list-next.gif new file mode 100644 index 000000000..20f5d9225 Binary files /dev/null and b/img/admin/list-next.gif differ diff --git a/img/admin/list-next2.gif b/img/admin/list-next2.gif new file mode 100644 index 000000000..41cafb4d7 Binary files /dev/null and b/img/admin/list-next2.gif differ diff --git a/img/admin/list-prev.gif b/img/admin/list-prev.gif new file mode 100644 index 000000000..69dcd1b21 Binary files /dev/null and b/img/admin/list-prev.gif differ diff --git a/img/admin/list-prev2.gif b/img/admin/list-prev2.gif new file mode 100644 index 000000000..f69818291 Binary files /dev/null and b/img/admin/list-prev2.gif differ diff --git a/img/admin/localization.gif b/img/admin/localization.gif new file mode 100644 index 000000000..c1d63637f Binary files /dev/null and b/img/admin/localization.gif differ diff --git a/img/admin/login-bg.jpg b/img/admin/login-bg.jpg new file mode 100644 index 000000000..135e4d128 Binary files /dev/null and b/img/admin/login-bg.jpg differ diff --git a/img/admin/lv1.gif b/img/admin/lv1.gif new file mode 100644 index 000000000..98a27e4a0 Binary files /dev/null and b/img/admin/lv1.gif differ diff --git a/img/admin/lv1.png b/img/admin/lv1.png new file mode 100644 index 000000000..a9a924bee Binary files /dev/null and b/img/admin/lv1.png differ diff --git a/img/admin/lv2_b.gif b/img/admin/lv2_b.gif new file mode 100644 index 000000000..a1d164d60 Binary files /dev/null and b/img/admin/lv2_b.gif differ diff --git a/img/admin/lv2_b.png b/img/admin/lv2_b.png new file mode 100644 index 000000000..7047534ba Binary files /dev/null and b/img/admin/lv2_b.png differ diff --git a/img/admin/lv2_f.gif b/img/admin/lv2_f.gif new file mode 100644 index 000000000..ee3a5ef3f Binary files /dev/null and b/img/admin/lv2_f.gif differ diff --git a/img/admin/lv2_f.png b/img/admin/lv2_f.png new file mode 100644 index 000000000..10a601c06 Binary files /dev/null and b/img/admin/lv2_f.png differ diff --git a/img/admin/lv3_b.png b/img/admin/lv3_b.png new file mode 100644 index 000000000..f438d9385 Binary files /dev/null and b/img/admin/lv3_b.png differ diff --git a/img/admin/lv3_f.png b/img/admin/lv3_f.png new file mode 100644 index 000000000..23e19d590 Binary files /dev/null and b/img/admin/lv3_f.png differ diff --git a/img/admin/lv4_b.png b/img/admin/lv4_b.png new file mode 100644 index 000000000..98410c19e Binary files /dev/null and b/img/admin/lv4_b.png differ diff --git a/img/admin/lv4_f.png b/img/admin/lv4_f.png new file mode 100644 index 000000000..739858993 Binary files /dev/null and b/img/admin/lv4_f.png differ diff --git a/img/admin/lv5_b.png b/img/admin/lv5_b.png new file mode 100644 index 000000000..d09db6c53 Binary files /dev/null and b/img/admin/lv5_b.png differ diff --git a/img/admin/lv5_f.png b/img/admin/lv5_f.png new file mode 100644 index 000000000..933b08b51 Binary files /dev/null and b/img/admin/lv5_f.png differ diff --git a/img/admin/lvl_0.gif b/img/admin/lvl_0.gif new file mode 100755 index 000000000..379e26f7f Binary files /dev/null and b/img/admin/lvl_0.gif differ diff --git a/img/admin/lvl_1.gif b/img/admin/lvl_1.gif new file mode 100755 index 000000000..5b27e6c4f Binary files /dev/null and b/img/admin/lvl_1.gif differ diff --git a/img/admin/male.gif b/img/admin/male.gif new file mode 100644 index 000000000..18f749232 Binary files /dev/null and b/img/admin/male.gif differ diff --git a/img/admin/male_2.gif b/img/admin/male_2.gif new file mode 100644 index 000000000..e170f93d7 Binary files /dev/null and b/img/admin/male_2.gif differ diff --git a/img/admin/manufacturers.gif b/img/admin/manufacturers.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/img/admin/manufacturers.gif differ diff --git a/img/admin/medal.png b/img/admin/medal.png new file mode 100644 index 000000000..3a5377cc6 Binary files /dev/null and b/img/admin/medal.png differ diff --git a/img/admin/meta100.png b/img/admin/meta100.png new file mode 100644 index 000000000..f596774da Binary files /dev/null and b/img/admin/meta100.png differ diff --git a/img/admin/metatags.gif b/img/admin/metatags.gif new file mode 100644 index 000000000..0a6f7d589 Binary files /dev/null and b/img/admin/metatags.gif differ diff --git a/img/admin/module_disabled.png b/img/admin/module_disabled.png new file mode 100644 index 000000000..87044f454 Binary files /dev/null and b/img/admin/module_disabled.png differ diff --git a/img/admin/module_install.png b/img/admin/module_install.png new file mode 100644 index 000000000..4f0790e5c Binary files /dev/null and b/img/admin/module_install.png differ diff --git a/img/admin/module_notinstall.png b/img/admin/module_notinstall.png new file mode 100644 index 000000000..fb08568ae Binary files /dev/null and b/img/admin/module_notinstall.png differ diff --git a/img/admin/module_warning.png b/img/admin/module_warning.png new file mode 100644 index 000000000..5d4c1dfe4 Binary files /dev/null and b/img/admin/module_warning.png differ diff --git a/img/admin/money.gif b/img/admin/money.gif new file mode 100644 index 000000000..b91777ebb Binary files /dev/null and b/img/admin/money.gif differ diff --git a/img/admin/money.png b/img/admin/money.png new file mode 100644 index 000000000..b93ac44dd Binary files /dev/null and b/img/admin/money.png differ diff --git a/img/admin/more.png b/img/admin/more.png new file mode 100644 index 000000000..0be351eb4 Binary files /dev/null and b/img/admin/more.png differ diff --git a/img/admin/msg-forward.png b/img/admin/msg-forward.png new file mode 100644 index 000000000..e8156909d Binary files /dev/null and b/img/admin/msg-forward.png differ diff --git a/img/admin/msg-is-pending.png b/img/admin/msg-is-pending.png new file mode 100644 index 000000000..7e235bde0 Binary files /dev/null and b/img/admin/msg-is-pending.png differ diff --git a/img/admin/msg-ok.png b/img/admin/msg-ok.png new file mode 100644 index 000000000..35f391cd7 Binary files /dev/null and b/img/admin/msg-ok.png differ diff --git a/img/admin/msg-pending.png b/img/admin/msg-pending.png new file mode 100644 index 000000000..d912a1d5d Binary files /dev/null and b/img/admin/msg-pending.png differ diff --git a/img/admin/nav-home.gif b/img/admin/nav-home.gif new file mode 100644 index 000000000..d88478243 Binary files /dev/null and b/img/admin/nav-home.gif differ diff --git a/img/admin/nav-logout.gif b/img/admin/nav-logout.gif new file mode 100644 index 000000000..1d7775de6 Binary files /dev/null and b/img/admin/nav-logout.gif differ diff --git a/img/admin/nav-user.gif b/img/admin/nav-user.gif new file mode 100644 index 000000000..27508ef3e Binary files /dev/null and b/img/admin/nav-user.gif differ diff --git a/img/admin/navigation.png b/img/admin/navigation.png new file mode 100644 index 000000000..ce1e28ed6 Binary files /dev/null and b/img/admin/navigation.png differ diff --git a/img/admin/news-new.gif b/img/admin/news-new.gif new file mode 100644 index 000000000..f310c6b40 Binary files /dev/null and b/img/admin/news-new.gif differ diff --git a/img/admin/next-msg.png b/img/admin/next-msg.png new file mode 100644 index 000000000..c67f987ae Binary files /dev/null and b/img/admin/next-msg.png differ diff --git a/img/admin/next.gif b/img/admin/next.gif new file mode 100644 index 000000000..b3325cd69 Binary files /dev/null and b/img/admin/next.gif differ diff --git a/img/admin/ok.gif b/img/admin/ok.gif new file mode 100644 index 000000000..113588016 Binary files /dev/null and b/img/admin/ok.gif differ diff --git a/img/admin/ok2.png b/img/admin/ok2.png new file mode 100644 index 000000000..4207a363c Binary files /dev/null and b/img/admin/ok2.png differ diff --git a/img/admin/orange-gradient.png b/img/admin/orange-gradient.png new file mode 100755 index 000000000..ccb2a5b03 Binary files /dev/null and b/img/admin/orange-gradient.png differ diff --git a/img/admin/page_world.png b/img/admin/page_world.png new file mode 100644 index 000000000..b8895ddec Binary files /dev/null and b/img/admin/page_world.png differ diff --git a/img/admin/payment.gif b/img/admin/payment.gif new file mode 100644 index 000000000..de6b15204 Binary files /dev/null and b/img/admin/payment.gif differ diff --git a/img/admin/pdf.gif b/img/admin/pdf.gif new file mode 100644 index 000000000..d5d9488f3 Binary files /dev/null and b/img/admin/pdf.gif differ diff --git a/img/admin/photo.gif b/img/admin/photo.gif new file mode 100644 index 000000000..4221ace66 Binary files /dev/null and b/img/admin/photo.gif differ diff --git a/img/admin/photo_add.gif b/img/admin/photo_add.gif new file mode 100644 index 000000000..50c0b42af Binary files /dev/null and b/img/admin/photo_add.gif differ diff --git a/img/admin/picture.gif b/img/admin/picture.gif new file mode 100644 index 000000000..c33d0e62b Binary files /dev/null and b/img/admin/picture.gif differ diff --git a/img/admin/pink-gradient.png b/img/admin/pink-gradient.png new file mode 100755 index 000000000..07d129f65 Binary files /dev/null and b/img/admin/pink-gradient.png differ diff --git a/img/admin/prefs.gif b/img/admin/prefs.gif new file mode 100644 index 000000000..1a1f43562 Binary files /dev/null and b/img/admin/prefs.gif differ diff --git a/img/admin/prestastore.gif b/img/admin/prestastore.gif new file mode 100644 index 000000000..642599e07 Binary files /dev/null and b/img/admin/prestastore.gif differ diff --git a/img/admin/previous.gif b/img/admin/previous.gif new file mode 100644 index 000000000..0487f56fd Binary files /dev/null and b/img/admin/previous.gif differ diff --git a/img/admin/previous.png b/img/admin/previous.png new file mode 100644 index 000000000..980b4d664 Binary files /dev/null and b/img/admin/previous.png differ diff --git a/img/admin/printer.gif b/img/admin/printer.gif new file mode 100644 index 000000000..a350d1871 Binary files /dev/null and b/img/admin/printer.gif differ diff --git a/img/admin/products.gif b/img/admin/products.gif new file mode 100644 index 000000000..a1036fe42 Binary files /dev/null and b/img/admin/products.gif differ diff --git a/img/admin/profiles.png b/img/admin/profiles.png new file mode 100644 index 000000000..d80eb2606 Binary files /dev/null and b/img/admin/profiles.png differ diff --git a/img/admin/quick.gif b/img/admin/quick.gif new file mode 100644 index 000000000..d876e5e9c Binary files /dev/null and b/img/admin/quick.gif differ diff --git a/img/admin/return.gif b/img/admin/return.gif new file mode 100644 index 000000000..198a934a3 Binary files /dev/null and b/img/admin/return.gif differ diff --git a/img/admin/right_btn_filter.png b/img/admin/right_btn_filter.png new file mode 100644 index 000000000..fb9b95f57 Binary files /dev/null and b/img/admin/right_btn_filter.png differ diff --git a/img/admin/robots.gif b/img/admin/robots.gif new file mode 100644 index 000000000..68c4f98e8 Binary files /dev/null and b/img/admin/robots.gif differ diff --git a/img/admin/search.gif b/img/admin/search.gif new file mode 100644 index 000000000..cf3d97f75 Binary files /dev/null and b/img/admin/search.gif differ diff --git a/img/admin/separator_breadcrum.png b/img/admin/separator_breadcrum.png new file mode 100644 index 000000000..900d19e8c Binary files /dev/null and b/img/admin/separator_breadcrum.png differ diff --git a/img/admin/separator_filter.png b/img/admin/separator_filter.png new file mode 100644 index 000000000..088b28e18 Binary files /dev/null and b/img/admin/separator_filter.png differ diff --git a/img/admin/slip.gif b/img/admin/slip.gif new file mode 100644 index 000000000..e5df19aaf Binary files /dev/null and b/img/admin/slip.gif differ diff --git a/img/admin/stats_xl.png b/img/admin/stats_xl.png new file mode 100644 index 000000000..20a814651 Binary files /dev/null and b/img/admin/stats_xl.png differ diff --git a/img/admin/statsettings.gif b/img/admin/statsettings.gif new file mode 100644 index 000000000..414f98790 Binary files /dev/null and b/img/admin/statsettings.gif differ diff --git a/img/admin/status_green.gif b/img/admin/status_green.gif new file mode 100644 index 000000000..ec305b843 Binary files /dev/null and b/img/admin/status_green.gif differ diff --git a/img/admin/status_orange.gif b/img/admin/status_orange.gif new file mode 100644 index 000000000..911c89e48 Binary files /dev/null and b/img/admin/status_orange.gif differ diff --git a/img/admin/status_red.gif b/img/admin/status_red.gif new file mode 100644 index 000000000..8861c72ac Binary files /dev/null and b/img/admin/status_red.gif differ diff --git a/img/admin/subdomain.gif b/img/admin/subdomain.gif new file mode 100644 index 000000000..8554b38b5 Binary files /dev/null and b/img/admin/subdomain.gif differ diff --git a/img/admin/submenu-bg.gif b/img/admin/submenu-bg.gif new file mode 100644 index 000000000..c3de2cfc5 Binary files /dev/null and b/img/admin/submenu-bg.gif differ diff --git a/img/admin/submenu-bg.png b/img/admin/submenu-bg.png new file mode 100644 index 000000000..1cdb92378 Binary files /dev/null and b/img/admin/submenu-bg.png differ diff --git a/img/admin/submenu-bg_2.png b/img/admin/submenu-bg_2.png new file mode 100644 index 000000000..1cdb92378 Binary files /dev/null and b/img/admin/submenu-bg_2.png differ diff --git a/img/admin/submenu-configuration.gif b/img/admin/submenu-configuration.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/img/admin/submenu-configuration.gif differ diff --git a/img/admin/success.png b/img/admin/success.png new file mode 100644 index 000000000..9c941c781 Binary files /dev/null and b/img/admin/success.png differ diff --git a/img/admin/summary.png b/img/admin/summary.png new file mode 100644 index 000000000..70f78a75f Binary files /dev/null and b/img/admin/summary.png differ diff --git a/img/admin/supplier.gif b/img/admin/supplier.gif new file mode 100644 index 000000000..e5cb1f263 Binary files /dev/null and b/img/admin/supplier.gif differ diff --git a/img/admin/suppliers.gif b/img/admin/suppliers.gif new file mode 100644 index 000000000..e5cb1f263 Binary files /dev/null and b/img/admin/suppliers.gif differ diff --git a/img/admin/tab-categories.gif b/img/admin/tab-categories.gif new file mode 100644 index 000000000..bc48e2e06 Binary files /dev/null and b/img/admin/tab-categories.gif differ diff --git a/img/admin/tab-contact.gif b/img/admin/tab-contact.gif new file mode 100644 index 000000000..7f85b9660 Binary files /dev/null and b/img/admin/tab-contact.gif differ diff --git a/img/admin/tab-customers.gif b/img/admin/tab-customers.gif new file mode 100644 index 000000000..2194c59db Binary files /dev/null and b/img/admin/tab-customers.gif differ diff --git a/img/admin/tab-groups.gif b/img/admin/tab-groups.gif new file mode 100644 index 000000000..213f3a2c7 Binary files /dev/null and b/img/admin/tab-groups.gif differ diff --git a/img/admin/tab-invoice.gif b/img/admin/tab-invoice.gif new file mode 100644 index 000000000..f2d449b1d Binary files /dev/null and b/img/admin/tab-invoice.gif differ diff --git a/img/admin/tab-orders.gif b/img/admin/tab-orders.gif new file mode 100644 index 000000000..be9175d6f Binary files /dev/null and b/img/admin/tab-orders.gif differ diff --git a/img/admin/tab-payment.gif b/img/admin/tab-payment.gif new file mode 100644 index 000000000..b91777ebb Binary files /dev/null and b/img/admin/tab-payment.gif differ diff --git a/img/admin/tab-plugins.gif b/img/admin/tab-plugins.gif new file mode 100644 index 000000000..3061be7d4 Binary files /dev/null and b/img/admin/tab-plugins.gif differ diff --git a/img/admin/tab-preferences.gif b/img/admin/tab-preferences.gif new file mode 100644 index 000000000..ae196b88a Binary files /dev/null and b/img/admin/tab-preferences.gif differ diff --git a/img/admin/tab-products.gif b/img/admin/tab-products.gif new file mode 100644 index 000000000..84330f935 Binary files /dev/null and b/img/admin/tab-products.gif differ diff --git a/img/admin/tab-shipping.gif b/img/admin/tab-shipping.gif new file mode 100644 index 000000000..482ceea3c Binary files /dev/null and b/img/admin/tab-shipping.gif differ diff --git a/img/admin/tab-stats.gif b/img/admin/tab-stats.gif new file mode 100644 index 000000000..9102f3a81 Binary files /dev/null and b/img/admin/tab-stats.gif differ diff --git a/img/admin/tab-tools.gif b/img/admin/tab-tools.gif new file mode 100644 index 000000000..dd772b72c Binary files /dev/null and b/img/admin/tab-tools.gif differ diff --git a/img/admin/tab.gif b/img/admin/tab.gif new file mode 100644 index 000000000..492754058 Binary files /dev/null and b/img/admin/tab.gif differ diff --git a/img/admin/thead.png b/img/admin/thead.png new file mode 100644 index 000000000..f3c871b52 Binary files /dev/null and b/img/admin/thead.png differ diff --git a/img/admin/themes.gif b/img/admin/themes.gif new file mode 100644 index 000000000..bda9d7c2a Binary files /dev/null and b/img/admin/themes.gif differ diff --git a/img/admin/time.gif b/img/admin/time.gif new file mode 100644 index 000000000..f15768f13 Binary files /dev/null and b/img/admin/time.gif differ diff --git a/img/admin/translation.gif b/img/admin/translation.gif new file mode 100644 index 000000000..af91f09a4 Binary files /dev/null and b/img/admin/translation.gif differ diff --git a/img/admin/transparentpixel.gif b/img/admin/transparentpixel.gif new file mode 100755 index 000000000..b7406476a Binary files /dev/null and b/img/admin/transparentpixel.gif differ diff --git a/img/admin/unknow.gif b/img/admin/unknow.gif new file mode 100644 index 000000000..27491d2f9 Binary files /dev/null and b/img/admin/unknow.gif differ diff --git a/img/admin/unknown.gif b/img/admin/unknown.gif new file mode 100644 index 000000000..b9ef51c1b Binary files /dev/null and b/img/admin/unknown.gif differ diff --git a/img/admin/up.gif b/img/admin/up.gif new file mode 100644 index 000000000..67345103c Binary files /dev/null and b/img/admin/up.gif differ diff --git a/img/admin/up_d.gif b/img/admin/up_d.gif new file mode 100644 index 000000000..c86a9a635 Binary files /dev/null and b/img/admin/up_d.gif differ diff --git a/img/admin/visitors.gif b/img/admin/visitors.gif new file mode 100644 index 000000000..fe52c94a5 Binary files /dev/null and b/img/admin/visitors.gif differ diff --git a/img/admin/warn2.png b/img/admin/warn2.png new file mode 100644 index 000000000..b06d10dc7 Binary files /dev/null and b/img/admin/warn2.png differ diff --git a/img/admin/warning.gif b/img/admin/warning.gif new file mode 100644 index 000000000..a4316825e Binary files /dev/null and b/img/admin/warning.gif differ diff --git a/img/admin/world.gif b/img/admin/world.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/admin/world.gif differ diff --git a/img/c/2-category.jpg b/img/c/2-category.jpg new file mode 100644 index 000000000..7b6e82f8a Binary files /dev/null and b/img/c/2-category.jpg differ diff --git a/img/c/2-large.jpg b/img/c/2-large.jpg new file mode 100644 index 000000000..3d3d24dd9 Binary files /dev/null and b/img/c/2-large.jpg differ diff --git a/img/c/2-medium.jpg b/img/c/2-medium.jpg new file mode 100644 index 000000000..c9692889a Binary files /dev/null and b/img/c/2-medium.jpg differ diff --git a/img/c/2-small.jpg b/img/c/2-small.jpg new file mode 100644 index 000000000..76c7df8e7 Binary files /dev/null and b/img/c/2-small.jpg differ diff --git a/img/c/2.jpg b/img/c/2.jpg new file mode 100644 index 000000000..2701f071b Binary files /dev/null and b/img/c/2.jpg differ diff --git a/img/c/3-category.jpg b/img/c/3-category.jpg new file mode 100644 index 000000000..cf93e8c87 Binary files /dev/null and b/img/c/3-category.jpg differ diff --git a/img/c/3-large.jpg b/img/c/3-large.jpg new file mode 100644 index 000000000..33f929178 Binary files /dev/null and b/img/c/3-large.jpg differ diff --git a/img/c/3-medium.jpg b/img/c/3-medium.jpg new file mode 100644 index 000000000..45e6dc0b5 Binary files /dev/null and b/img/c/3-medium.jpg differ diff --git a/img/c/3-small.jpg b/img/c/3-small.jpg new file mode 100644 index 000000000..981e037f0 Binary files /dev/null and b/img/c/3-small.jpg differ diff --git a/img/c/3.jpg b/img/c/3.jpg new file mode 100644 index 000000000..1628a6b4f Binary files /dev/null and b/img/c/3.jpg differ diff --git a/img/c/4-category.jpg b/img/c/4-category.jpg new file mode 100644 index 000000000..b65021440 Binary files /dev/null and b/img/c/4-category.jpg differ diff --git a/img/c/4-large.jpg b/img/c/4-large.jpg new file mode 100644 index 000000000..f752acee9 Binary files /dev/null and b/img/c/4-large.jpg differ diff --git a/img/c/4-medium.jpg b/img/c/4-medium.jpg new file mode 100644 index 000000000..945480537 Binary files /dev/null and b/img/c/4-medium.jpg differ diff --git a/img/c/4-small.jpg b/img/c/4-small.jpg new file mode 100644 index 000000000..8be08be8c Binary files /dev/null and b/img/c/4-small.jpg differ diff --git a/img/c/4.jpg b/img/c/4.jpg new file mode 100644 index 000000000..54a32b006 Binary files /dev/null and b/img/c/4.jpg differ diff --git a/img/c/de-default-category.jpg b/img/c/de-default-category.jpg new file mode 100755 index 000000000..27daddad2 Binary files /dev/null and b/img/c/de-default-category.jpg differ diff --git a/img/c/de-default-large.jpg b/img/c/de-default-large.jpg new file mode 100755 index 000000000..dcc29c8f1 Binary files /dev/null and b/img/c/de-default-large.jpg differ diff --git a/img/c/de-default-medium.jpg b/img/c/de-default-medium.jpg new file mode 100755 index 000000000..c0ee66646 Binary files /dev/null and b/img/c/de-default-medium.jpg differ diff --git a/img/c/de-default-small.jpg b/img/c/de-default-small.jpg new file mode 100755 index 000000000..11e9c3688 Binary files /dev/null and b/img/c/de-default-small.jpg differ diff --git a/img/c/de.jpg b/img/c/de.jpg new file mode 100755 index 000000000..43716f653 Binary files /dev/null and b/img/c/de.jpg differ diff --git a/img/c/en-default-category.jpg b/img/c/en-default-category.jpg new file mode 100644 index 000000000..c28c90de1 Binary files /dev/null and b/img/c/en-default-category.jpg differ diff --git a/img/c/en-default-large.jpg b/img/c/en-default-large.jpg new file mode 100644 index 000000000..d08a055e0 Binary files /dev/null and b/img/c/en-default-large.jpg differ diff --git a/img/c/en-default-medium.jpg b/img/c/en-default-medium.jpg new file mode 100644 index 000000000..0d18d71b3 Binary files /dev/null and b/img/c/en-default-medium.jpg differ diff --git a/img/c/en-default-small.jpg b/img/c/en-default-small.jpg new file mode 100644 index 000000000..b3c609b9d Binary files /dev/null and b/img/c/en-default-small.jpg differ diff --git a/img/c/en.jpg b/img/c/en.jpg new file mode 100644 index 000000000..7d07b871d Binary files /dev/null and b/img/c/en.jpg differ diff --git a/img/c/es-default-category.jpg b/img/c/es-default-category.jpg new file mode 100644 index 000000000..4bf610f55 Binary files /dev/null and b/img/c/es-default-category.jpg differ diff --git a/img/c/es-default-large.jpg b/img/c/es-default-large.jpg new file mode 100644 index 000000000..74320f26e Binary files /dev/null and b/img/c/es-default-large.jpg differ diff --git a/img/c/es-default-medium.jpg b/img/c/es-default-medium.jpg new file mode 100644 index 000000000..745c9f1c9 Binary files /dev/null and b/img/c/es-default-medium.jpg differ diff --git a/img/c/es-default-small.jpg b/img/c/es-default-small.jpg new file mode 100644 index 000000000..9465b597b Binary files /dev/null and b/img/c/es-default-small.jpg differ diff --git a/img/c/es.jpg b/img/c/es.jpg new file mode 100644 index 000000000..28d7b8c81 Binary files /dev/null and b/img/c/es.jpg differ diff --git a/img/c/fr-default-category.jpg b/img/c/fr-default-category.jpg new file mode 100644 index 000000000..5c77b7622 Binary files /dev/null and b/img/c/fr-default-category.jpg differ diff --git a/img/c/fr-default-large.jpg b/img/c/fr-default-large.jpg new file mode 100644 index 000000000..70c8ca6b7 Binary files /dev/null and b/img/c/fr-default-large.jpg differ diff --git a/img/c/fr-default-medium.jpg b/img/c/fr-default-medium.jpg new file mode 100644 index 000000000..a216e5ea4 Binary files /dev/null and b/img/c/fr-default-medium.jpg differ diff --git a/img/c/fr-default-small.jpg b/img/c/fr-default-small.jpg new file mode 100644 index 000000000..69e05318a Binary files /dev/null and b/img/c/fr-default-small.jpg differ diff --git a/img/c/fr.jpg b/img/c/fr.jpg new file mode 100644 index 000000000..ed443472f Binary files /dev/null and b/img/c/fr.jpg differ diff --git a/img/c/index.php b/img/c/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/c/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/c/it-default-category.jpg b/img/c/it-default-category.jpg new file mode 100755 index 000000000..add52ebb9 Binary files /dev/null and b/img/c/it-default-category.jpg differ diff --git a/img/c/it-default-large.jpg b/img/c/it-default-large.jpg new file mode 100755 index 000000000..97bf6f2f0 Binary files /dev/null and b/img/c/it-default-large.jpg differ diff --git a/img/c/it-default-medium.jpg b/img/c/it-default-medium.jpg new file mode 100755 index 000000000..461031f99 Binary files /dev/null and b/img/c/it-default-medium.jpg differ diff --git a/img/c/it-default-small.jpg b/img/c/it-default-small.jpg new file mode 100755 index 000000000..8c72ec678 Binary files /dev/null and b/img/c/it-default-small.jpg differ diff --git a/img/c/it.jpg b/img/c/it.jpg new file mode 100755 index 000000000..94802add7 Binary files /dev/null and b/img/c/it.jpg differ diff --git a/img/co/index.php b/img/co/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/co/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/favicon.ico b/img/favicon.ico new file mode 100644 index 000000000..883937325 Binary files /dev/null and b/img/favicon.ico differ diff --git a/img/index.php b/img/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/l/1.jpg b/img/l/1.jpg new file mode 100644 index 000000000..72b962fa6 Binary files /dev/null and b/img/l/1.jpg differ diff --git a/img/l/2.jpg b/img/l/2.jpg new file mode 100644 index 000000000..4cd7f3806 Binary files /dev/null and b/img/l/2.jpg differ diff --git a/img/l/3.jpg b/img/l/3.jpg new file mode 100644 index 000000000..adb6dc5d9 Binary files /dev/null and b/img/l/3.jpg differ diff --git a/img/l/4.jpg b/img/l/4.jpg new file mode 100644 index 000000000..5abbc8cfa Binary files /dev/null and b/img/l/4.jpg differ diff --git a/img/l/5.jpg b/img/l/5.jpg new file mode 100644 index 000000000..744eb0eef Binary files /dev/null and b/img/l/5.jpg differ diff --git a/img/l/en-default-home.jpg b/img/l/en-default-home.jpg new file mode 100644 index 000000000..ae6658431 Binary files /dev/null and b/img/l/en-default-home.jpg differ diff --git a/img/l/en-default-large.jpg b/img/l/en-default-large.jpg new file mode 100644 index 000000000..d08a055e0 Binary files /dev/null and b/img/l/en-default-large.jpg differ diff --git a/img/l/en-default-large_scene.jpg b/img/l/en-default-large_scene.jpg new file mode 100644 index 000000000..0c8b30dbe Binary files /dev/null and b/img/l/en-default-large_scene.jpg differ diff --git a/img/l/en-default-medium.jpg b/img/l/en-default-medium.jpg new file mode 100644 index 000000000..0d18d71b3 Binary files /dev/null and b/img/l/en-default-medium.jpg differ diff --git a/img/l/en-default-small.jpg b/img/l/en-default-small.jpg new file mode 100644 index 000000000..50f7c97b8 Binary files /dev/null and b/img/l/en-default-small.jpg differ diff --git a/img/l/en-default-thickbox.jpg b/img/l/en-default-thickbox.jpg new file mode 100755 index 000000000..499711f24 Binary files /dev/null and b/img/l/en-default-thickbox.jpg differ diff --git a/img/l/en.jpg b/img/l/en.jpg new file mode 100644 index 000000000..7d07b871d Binary files /dev/null and b/img/l/en.jpg differ diff --git a/img/l/index.php b/img/l/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/l/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/l/none.jpg b/img/l/none.jpg new file mode 100644 index 000000000..5e4c07cd4 Binary files /dev/null and b/img/l/none.jpg differ diff --git a/img/loader.gif b/img/loader.gif new file mode 100644 index 000000000..cd4e37cc2 Binary files /dev/null and b/img/loader.gif differ diff --git a/img/loadingAnimation.gif b/img/loadingAnimation.gif new file mode 100644 index 000000000..82290f483 Binary files /dev/null and b/img/loadingAnimation.gif differ diff --git a/img/logo.jpg b/img/logo.jpg new file mode 100644 index 000000000..d0cc82adf Binary files /dev/null and b/img/logo.jpg differ diff --git a/img/logo_stores.gif b/img/logo_stores.gif new file mode 100644 index 000000000..cb2ffaaba Binary files /dev/null and b/img/logo_stores.gif differ diff --git a/img/m/1-large.jpg b/img/m/1-large.jpg new file mode 100644 index 000000000..6000b1be5 Binary files /dev/null and b/img/m/1-large.jpg differ diff --git a/img/m/1-medium.jpg b/img/m/1-medium.jpg new file mode 100644 index 000000000..373c85b79 Binary files /dev/null and b/img/m/1-medium.jpg differ diff --git a/img/m/1-small.jpg b/img/m/1-small.jpg new file mode 100644 index 000000000..d3fb7f964 Binary files /dev/null and b/img/m/1-small.jpg differ diff --git a/img/m/1.jpg b/img/m/1.jpg new file mode 100644 index 000000000..795d132c5 Binary files /dev/null and b/img/m/1.jpg differ diff --git a/img/m/2-large.jpg b/img/m/2-large.jpg new file mode 100644 index 000000000..ee4eb5fa8 Binary files /dev/null and b/img/m/2-large.jpg differ diff --git a/img/m/2-medium.jpg b/img/m/2-medium.jpg new file mode 100644 index 000000000..d80ee0e5e Binary files /dev/null and b/img/m/2-medium.jpg differ diff --git a/img/m/2-small.jpg b/img/m/2-small.jpg new file mode 100644 index 000000000..bdf87c651 Binary files /dev/null and b/img/m/2-small.jpg differ diff --git a/img/m/2.jpg b/img/m/2.jpg new file mode 100644 index 000000000..f64258f9a Binary files /dev/null and b/img/m/2.jpg differ diff --git a/img/m/de-default-large.jpg b/img/m/de-default-large.jpg new file mode 100755 index 000000000..dcc29c8f1 Binary files /dev/null and b/img/m/de-default-large.jpg differ diff --git a/img/m/de-default-medium.jpg b/img/m/de-default-medium.jpg new file mode 100755 index 000000000..c0ee66646 Binary files /dev/null and b/img/m/de-default-medium.jpg differ diff --git a/img/m/de-default-small.jpg b/img/m/de-default-small.jpg new file mode 100755 index 000000000..11e9c3688 Binary files /dev/null and b/img/m/de-default-small.jpg differ diff --git a/img/m/de.jpg b/img/m/de.jpg new file mode 100755 index 000000000..43716f653 Binary files /dev/null and b/img/m/de.jpg differ diff --git a/img/m/en-default-large.jpg b/img/m/en-default-large.jpg new file mode 100644 index 000000000..d08a055e0 Binary files /dev/null and b/img/m/en-default-large.jpg differ diff --git a/img/m/en-default-medium.jpg b/img/m/en-default-medium.jpg new file mode 100644 index 000000000..0d18d71b3 Binary files /dev/null and b/img/m/en-default-medium.jpg differ diff --git a/img/m/en-default-small.jpg b/img/m/en-default-small.jpg new file mode 100644 index 000000000..b3c609b9d Binary files /dev/null and b/img/m/en-default-small.jpg differ diff --git a/img/m/en.jpg b/img/m/en.jpg new file mode 100644 index 000000000..7d07b871d Binary files /dev/null and b/img/m/en.jpg differ diff --git a/img/m/es-default-large.jpg b/img/m/es-default-large.jpg new file mode 100644 index 000000000..6683d919f Binary files /dev/null and b/img/m/es-default-large.jpg differ diff --git a/img/m/es-default-medium.jpg b/img/m/es-default-medium.jpg new file mode 100644 index 000000000..890436615 Binary files /dev/null and b/img/m/es-default-medium.jpg differ diff --git a/img/m/es-default-small.jpg b/img/m/es-default-small.jpg new file mode 100644 index 000000000..b3118b097 Binary files /dev/null and b/img/m/es-default-small.jpg differ diff --git a/img/m/es-default-thickbox.jpg b/img/m/es-default-thickbox.jpg new file mode 100644 index 000000000..6bd5603f7 Binary files /dev/null and b/img/m/es-default-thickbox.jpg differ diff --git a/img/m/es.jpg b/img/m/es.jpg new file mode 100644 index 000000000..28d7b8c81 Binary files /dev/null and b/img/m/es.jpg differ diff --git a/img/m/fr-default-large.jpg b/img/m/fr-default-large.jpg new file mode 100644 index 000000000..70c8ca6b7 Binary files /dev/null and b/img/m/fr-default-large.jpg differ diff --git a/img/m/fr-default-medium.jpg b/img/m/fr-default-medium.jpg new file mode 100644 index 000000000..a216e5ea4 Binary files /dev/null and b/img/m/fr-default-medium.jpg differ diff --git a/img/m/fr-default-small.jpg b/img/m/fr-default-small.jpg new file mode 100644 index 000000000..69e05318a Binary files /dev/null and b/img/m/fr-default-small.jpg differ diff --git a/img/m/fr.jpg b/img/m/fr.jpg new file mode 100644 index 000000000..ed443472f Binary files /dev/null and b/img/m/fr.jpg differ diff --git a/img/m/index.php b/img/m/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/m/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/m/it-default-large.jpg b/img/m/it-default-large.jpg new file mode 100755 index 000000000..97bf6f2f0 Binary files /dev/null and b/img/m/it-default-large.jpg differ diff --git a/img/m/it-default-medium.jpg b/img/m/it-default-medium.jpg new file mode 100755 index 000000000..461031f99 Binary files /dev/null and b/img/m/it-default-medium.jpg differ diff --git a/img/m/it-default-small.jpg b/img/m/it-default-small.jpg new file mode 100755 index 000000000..8c72ec678 Binary files /dev/null and b/img/m/it-default-small.jpg differ diff --git a/img/m/it.jpg b/img/m/it.jpg new file mode 100755 index 000000000..94802add7 Binary files /dev/null and b/img/m/it.jpg differ diff --git a/img/macFFBgHack.png b/img/macFFBgHack.png new file mode 100644 index 000000000..c6473b324 Binary files /dev/null and b/img/macFFBgHack.png differ diff --git a/img/os/1.gif b/img/os/1.gif new file mode 100644 index 000000000..e7c5f3153 Binary files /dev/null and b/img/os/1.gif differ diff --git a/img/os/10.gif b/img/os/10.gif new file mode 100644 index 000000000..2780d81e7 Binary files /dev/null and b/img/os/10.gif differ diff --git a/img/os/11.gif b/img/os/11.gif new file mode 100644 index 000000000..57abc204b Binary files /dev/null and b/img/os/11.gif differ diff --git a/img/os/2.gif b/img/os/2.gif new file mode 100644 index 000000000..192829587 Binary files /dev/null and b/img/os/2.gif differ diff --git a/img/os/3.gif b/img/os/3.gif new file mode 100644 index 000000000..56d6cefc5 Binary files /dev/null and b/img/os/3.gif differ diff --git a/img/os/4.gif b/img/os/4.gif new file mode 100644 index 000000000..54a3e55c7 Binary files /dev/null and b/img/os/4.gif differ diff --git a/img/os/5.gif b/img/os/5.gif new file mode 100644 index 000000000..cbce89abe Binary files /dev/null and b/img/os/5.gif differ diff --git a/img/os/6.gif b/img/os/6.gif new file mode 100644 index 000000000..8d4e46519 Binary files /dev/null and b/img/os/6.gif differ diff --git a/img/os/7.gif b/img/os/7.gif new file mode 100644 index 000000000..c3a61298f Binary files /dev/null and b/img/os/7.gif differ diff --git a/img/os/8.gif b/img/os/8.gif new file mode 100644 index 000000000..b16b55530 Binary files /dev/null and b/img/os/8.gif differ diff --git a/img/os/9.gif b/img/os/9.gif new file mode 100644 index 000000000..f4d413d42 Binary files /dev/null and b/img/os/9.gif differ diff --git a/img/os/index.php b/img/os/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/os/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/p/1-1-home.jpg b/img/p/1-1-home.jpg new file mode 100644 index 000000000..6ad2eb662 Binary files /dev/null and b/img/p/1-1-home.jpg differ diff --git a/img/p/1-1-large.jpg b/img/p/1-1-large.jpg new file mode 100644 index 000000000..b3b83fb2a Binary files /dev/null and b/img/p/1-1-large.jpg differ diff --git a/img/p/1-1-medium.jpg b/img/p/1-1-medium.jpg new file mode 100644 index 000000000..dbc7a49ba Binary files /dev/null and b/img/p/1-1-medium.jpg differ diff --git a/img/p/1-1-small.jpg b/img/p/1-1-small.jpg new file mode 100644 index 000000000..75f2654ea Binary files /dev/null and b/img/p/1-1-small.jpg differ diff --git a/img/p/1-1-thickbox.jpg b/img/p/1-1-thickbox.jpg new file mode 100644 index 000000000..2aa9606b2 Binary files /dev/null and b/img/p/1-1-thickbox.jpg differ diff --git a/img/p/1-1.jpg b/img/p/1-1.jpg new file mode 100644 index 000000000..01c4d317f Binary files /dev/null and b/img/p/1-1.jpg differ diff --git a/img/p/1-2-home.jpg b/img/p/1-2-home.jpg new file mode 100644 index 000000000..f2489a032 Binary files /dev/null and b/img/p/1-2-home.jpg differ diff --git a/img/p/1-2-large.jpg b/img/p/1-2-large.jpg new file mode 100644 index 000000000..61892c592 Binary files /dev/null and b/img/p/1-2-large.jpg differ diff --git a/img/p/1-2-medium.jpg b/img/p/1-2-medium.jpg new file mode 100644 index 000000000..64e0e9a8f Binary files /dev/null and b/img/p/1-2-medium.jpg differ diff --git a/img/p/1-2-small.jpg b/img/p/1-2-small.jpg new file mode 100644 index 000000000..d8eb2ed9d Binary files /dev/null and b/img/p/1-2-small.jpg differ diff --git a/img/p/1-2-thickbox.jpg b/img/p/1-2-thickbox.jpg new file mode 100644 index 000000000..9133e8834 Binary files /dev/null and b/img/p/1-2-thickbox.jpg differ diff --git a/img/p/1-2.jpg b/img/p/1-2.jpg new file mode 100644 index 000000000..4b5948802 Binary files /dev/null and b/img/p/1-2.jpg differ diff --git a/img/p/1-3-home.jpg b/img/p/1-3-home.jpg new file mode 100644 index 000000000..95b305500 Binary files /dev/null and b/img/p/1-3-home.jpg differ diff --git a/img/p/1-3-large.jpg b/img/p/1-3-large.jpg new file mode 100644 index 000000000..048ff8e78 Binary files /dev/null and b/img/p/1-3-large.jpg differ diff --git a/img/p/1-3-medium.jpg b/img/p/1-3-medium.jpg new file mode 100644 index 000000000..82b56de65 Binary files /dev/null and b/img/p/1-3-medium.jpg differ diff --git a/img/p/1-3-small.jpg b/img/p/1-3-small.jpg new file mode 100644 index 000000000..79e2636f6 Binary files /dev/null and b/img/p/1-3-small.jpg differ diff --git a/img/p/1-3-thickbox.jpg b/img/p/1-3-thickbox.jpg new file mode 100644 index 000000000..18ac0d7a9 Binary files /dev/null and b/img/p/1-3-thickbox.jpg differ diff --git a/img/p/1-3.jpg b/img/p/1-3.jpg new file mode 100644 index 000000000..f511332e8 Binary files /dev/null and b/img/p/1-3.jpg differ diff --git a/img/p/1-37-home.jpg b/img/p/1-37-home.jpg new file mode 100644 index 000000000..237df68c8 Binary files /dev/null and b/img/p/1-37-home.jpg differ diff --git a/img/p/1-37-large.jpg b/img/p/1-37-large.jpg new file mode 100644 index 000000000..7bb9f9b5b Binary files /dev/null and b/img/p/1-37-large.jpg differ diff --git a/img/p/1-37-medium.jpg b/img/p/1-37-medium.jpg new file mode 100644 index 000000000..77c82cc2d Binary files /dev/null and b/img/p/1-37-medium.jpg differ diff --git a/img/p/1-37-small.jpg b/img/p/1-37-small.jpg new file mode 100644 index 000000000..1db056336 Binary files /dev/null and b/img/p/1-37-small.jpg differ diff --git a/img/p/1-37-thickbox.jpg b/img/p/1-37-thickbox.jpg new file mode 100644 index 000000000..e378c3b5b Binary files /dev/null and b/img/p/1-37-thickbox.jpg differ diff --git a/img/p/1-37.jpg b/img/p/1-37.jpg new file mode 100644 index 000000000..262687ad6 Binary files /dev/null and b/img/p/1-37.jpg differ diff --git a/img/p/1-38-home.jpg b/img/p/1-38-home.jpg new file mode 100644 index 000000000..483ad0b83 Binary files /dev/null and b/img/p/1-38-home.jpg differ diff --git a/img/p/1-38-large.jpg b/img/p/1-38-large.jpg new file mode 100644 index 000000000..96208b1e0 Binary files /dev/null and b/img/p/1-38-large.jpg differ diff --git a/img/p/1-38-medium.jpg b/img/p/1-38-medium.jpg new file mode 100644 index 000000000..4e9b86777 Binary files /dev/null and b/img/p/1-38-medium.jpg differ diff --git a/img/p/1-38-small.jpg b/img/p/1-38-small.jpg new file mode 100644 index 000000000..fcb936332 Binary files /dev/null and b/img/p/1-38-small.jpg differ diff --git a/img/p/1-38-thickbox.jpg b/img/p/1-38-thickbox.jpg new file mode 100644 index 000000000..077999b2c Binary files /dev/null and b/img/p/1-38-thickbox.jpg differ diff --git a/img/p/1-38.jpg b/img/p/1-38.jpg new file mode 100644 index 000000000..6ae301a6c Binary files /dev/null and b/img/p/1-38.jpg differ diff --git a/img/p/1-39-home.jpg b/img/p/1-39-home.jpg new file mode 100644 index 000000000..d01d08f48 Binary files /dev/null and b/img/p/1-39-home.jpg differ diff --git a/img/p/1-39-large.jpg b/img/p/1-39-large.jpg new file mode 100644 index 000000000..097af0de7 Binary files /dev/null and b/img/p/1-39-large.jpg differ diff --git a/img/p/1-39-medium.jpg b/img/p/1-39-medium.jpg new file mode 100644 index 000000000..f9855ef8c Binary files /dev/null and b/img/p/1-39-medium.jpg differ diff --git a/img/p/1-39-small.jpg b/img/p/1-39-small.jpg new file mode 100644 index 000000000..0ea3d1ca8 Binary files /dev/null and b/img/p/1-39-small.jpg differ diff --git a/img/p/1-39-thickbox.jpg b/img/p/1-39-thickbox.jpg new file mode 100644 index 000000000..782173a26 Binary files /dev/null and b/img/p/1-39-thickbox.jpg differ diff --git a/img/p/1-39.jpg b/img/p/1-39.jpg new file mode 100644 index 000000000..743b8289a Binary files /dev/null and b/img/p/1-39.jpg differ diff --git a/img/p/1-4-home.jpg b/img/p/1-4-home.jpg new file mode 100644 index 000000000..949fd9082 Binary files /dev/null and b/img/p/1-4-home.jpg differ diff --git a/img/p/1-4-large.jpg b/img/p/1-4-large.jpg new file mode 100644 index 000000000..8c2fe00f4 Binary files /dev/null and b/img/p/1-4-large.jpg differ diff --git a/img/p/1-4-medium.jpg b/img/p/1-4-medium.jpg new file mode 100644 index 000000000..7be62a7b3 Binary files /dev/null and b/img/p/1-4-medium.jpg differ diff --git a/img/p/1-4-small.jpg b/img/p/1-4-small.jpg new file mode 100644 index 000000000..a23697904 Binary files /dev/null and b/img/p/1-4-small.jpg differ diff --git a/img/p/1-4-thickbox.jpg b/img/p/1-4-thickbox.jpg new file mode 100644 index 000000000..ee7712d43 Binary files /dev/null and b/img/p/1-4-thickbox.jpg differ diff --git a/img/p/1-4.jpg b/img/p/1-4.jpg new file mode 100644 index 000000000..1dc2fe931 Binary files /dev/null and b/img/p/1-4.jpg differ diff --git a/img/p/1-40-home.jpg b/img/p/1-40-home.jpg new file mode 100644 index 000000000..0ce18969e Binary files /dev/null and b/img/p/1-40-home.jpg differ diff --git a/img/p/1-40-large.jpg b/img/p/1-40-large.jpg new file mode 100644 index 000000000..9586b4d0f Binary files /dev/null and b/img/p/1-40-large.jpg differ diff --git a/img/p/1-40-medium.jpg b/img/p/1-40-medium.jpg new file mode 100644 index 000000000..aa41664b5 Binary files /dev/null and b/img/p/1-40-medium.jpg differ diff --git a/img/p/1-40-small.jpg b/img/p/1-40-small.jpg new file mode 100644 index 000000000..1608814b2 Binary files /dev/null and b/img/p/1-40-small.jpg differ diff --git a/img/p/1-40-thickbox.jpg b/img/p/1-40-thickbox.jpg new file mode 100644 index 000000000..2c4316aea Binary files /dev/null and b/img/p/1-40-thickbox.jpg differ diff --git a/img/p/1-40.jpg b/img/p/1-40.jpg new file mode 100644 index 000000000..66f4e1147 Binary files /dev/null and b/img/p/1-40.jpg differ diff --git a/img/p/1-41-home.jpg b/img/p/1-41-home.jpg new file mode 100644 index 000000000..3f7dc71ce Binary files /dev/null and b/img/p/1-41-home.jpg differ diff --git a/img/p/1-41-large.jpg b/img/p/1-41-large.jpg new file mode 100644 index 000000000..2cb0f90be Binary files /dev/null and b/img/p/1-41-large.jpg differ diff --git a/img/p/1-41-medium.jpg b/img/p/1-41-medium.jpg new file mode 100644 index 000000000..32bb8fcf5 Binary files /dev/null and b/img/p/1-41-medium.jpg differ diff --git a/img/p/1-41-small.jpg b/img/p/1-41-small.jpg new file mode 100644 index 000000000..3f030fdd3 Binary files /dev/null and b/img/p/1-41-small.jpg differ diff --git a/img/p/1-41-thickbox.jpg b/img/p/1-41-thickbox.jpg new file mode 100644 index 000000000..e60a7b7ae Binary files /dev/null and b/img/p/1-41-thickbox.jpg differ diff --git a/img/p/1-41.jpg b/img/p/1-41.jpg new file mode 100644 index 000000000..d1e35ad30 Binary files /dev/null and b/img/p/1-41.jpg differ diff --git a/img/p/1-42-home.jpg b/img/p/1-42-home.jpg new file mode 100644 index 000000000..0ebbe9961 Binary files /dev/null and b/img/p/1-42-home.jpg differ diff --git a/img/p/1-42-large.jpg b/img/p/1-42-large.jpg new file mode 100644 index 000000000..7772ae8e2 Binary files /dev/null and b/img/p/1-42-large.jpg differ diff --git a/img/p/1-42-medium.jpg b/img/p/1-42-medium.jpg new file mode 100644 index 000000000..0ff989892 Binary files /dev/null and b/img/p/1-42-medium.jpg differ diff --git a/img/p/1-42-small.jpg b/img/p/1-42-small.jpg new file mode 100644 index 000000000..4466ebc69 Binary files /dev/null and b/img/p/1-42-small.jpg differ diff --git a/img/p/1-42-thickbox.jpg b/img/p/1-42-thickbox.jpg new file mode 100644 index 000000000..c96f186b1 Binary files /dev/null and b/img/p/1-42-thickbox.jpg differ diff --git a/img/p/1-42.jpg b/img/p/1-42.jpg new file mode 100644 index 000000000..331e3b93c Binary files /dev/null and b/img/p/1-42.jpg differ diff --git a/img/p/1-44-home.jpg b/img/p/1-44-home.jpg new file mode 100644 index 000000000..daa729998 Binary files /dev/null and b/img/p/1-44-home.jpg differ diff --git a/img/p/1-44-large.jpg b/img/p/1-44-large.jpg new file mode 100644 index 000000000..40feb4231 Binary files /dev/null and b/img/p/1-44-large.jpg differ diff --git a/img/p/1-44-medium.jpg b/img/p/1-44-medium.jpg new file mode 100644 index 000000000..d5b387d4d Binary files /dev/null and b/img/p/1-44-medium.jpg differ diff --git a/img/p/1-44-small.jpg b/img/p/1-44-small.jpg new file mode 100644 index 000000000..40e9cedf1 Binary files /dev/null and b/img/p/1-44-small.jpg differ diff --git a/img/p/1-44-thickbox.jpg b/img/p/1-44-thickbox.jpg new file mode 100644 index 000000000..cbe36c52d Binary files /dev/null and b/img/p/1-44-thickbox.jpg differ diff --git a/img/p/1-44.jpg b/img/p/1-44.jpg new file mode 100644 index 000000000..81795b2f9 Binary files /dev/null and b/img/p/1-44.jpg differ diff --git a/img/p/1-45-home.jpg b/img/p/1-45-home.jpg new file mode 100644 index 000000000..f19e48d39 Binary files /dev/null and b/img/p/1-45-home.jpg differ diff --git a/img/p/1-45-large.jpg b/img/p/1-45-large.jpg new file mode 100644 index 000000000..956ace051 Binary files /dev/null and b/img/p/1-45-large.jpg differ diff --git a/img/p/1-45-medium.jpg b/img/p/1-45-medium.jpg new file mode 100644 index 000000000..54701493a Binary files /dev/null and b/img/p/1-45-medium.jpg differ diff --git a/img/p/1-45-small.jpg b/img/p/1-45-small.jpg new file mode 100644 index 000000000..47c8f3bfc Binary files /dev/null and b/img/p/1-45-small.jpg differ diff --git a/img/p/1-45-thickbox.jpg b/img/p/1-45-thickbox.jpg new file mode 100644 index 000000000..c422fd872 Binary files /dev/null and b/img/p/1-45-thickbox.jpg differ diff --git a/img/p/1-45.jpg b/img/p/1-45.jpg new file mode 100644 index 000000000..96b6abb2c Binary files /dev/null and b/img/p/1-45.jpg differ diff --git a/img/p/2-46-home.jpg b/img/p/2-46-home.jpg new file mode 100644 index 000000000..bf0ae1e37 Binary files /dev/null and b/img/p/2-46-home.jpg differ diff --git a/img/p/2-46-large.jpg b/img/p/2-46-large.jpg new file mode 100644 index 000000000..9ebcb82b2 Binary files /dev/null and b/img/p/2-46-large.jpg differ diff --git a/img/p/2-46-medium.jpg b/img/p/2-46-medium.jpg new file mode 100644 index 000000000..fdff1e7f9 Binary files /dev/null and b/img/p/2-46-medium.jpg differ diff --git a/img/p/2-46-small.jpg b/img/p/2-46-small.jpg new file mode 100644 index 000000000..0abadf72d Binary files /dev/null and b/img/p/2-46-small.jpg differ diff --git a/img/p/2-46-thickbox.jpg b/img/p/2-46-thickbox.jpg new file mode 100644 index 000000000..e38056f46 Binary files /dev/null and b/img/p/2-46-thickbox.jpg differ diff --git a/img/p/2-46.jpg b/img/p/2-46.jpg new file mode 100644 index 000000000..ac4676bdb Binary files /dev/null and b/img/p/2-46.jpg differ diff --git a/img/p/2-47-home.jpg b/img/p/2-47-home.jpg new file mode 100644 index 000000000..fb63c3e3f Binary files /dev/null and b/img/p/2-47-home.jpg differ diff --git a/img/p/2-47-large.jpg b/img/p/2-47-large.jpg new file mode 100644 index 000000000..67472a981 Binary files /dev/null and b/img/p/2-47-large.jpg differ diff --git a/img/p/2-47-medium.jpg b/img/p/2-47-medium.jpg new file mode 100644 index 000000000..c4979c257 Binary files /dev/null and b/img/p/2-47-medium.jpg differ diff --git a/img/p/2-47-small.jpg b/img/p/2-47-small.jpg new file mode 100644 index 000000000..47e09a44b Binary files /dev/null and b/img/p/2-47-small.jpg differ diff --git a/img/p/2-47-thickbox.jpg b/img/p/2-47-thickbox.jpg new file mode 100644 index 000000000..274784a99 Binary files /dev/null and b/img/p/2-47-thickbox.jpg differ diff --git a/img/p/2-47.jpg b/img/p/2-47.jpg new file mode 100644 index 000000000..f684926bb Binary files /dev/null and b/img/p/2-47.jpg differ diff --git a/img/p/2-48-home.jpg b/img/p/2-48-home.jpg new file mode 100644 index 000000000..110006570 Binary files /dev/null and b/img/p/2-48-home.jpg differ diff --git a/img/p/2-48-large.jpg b/img/p/2-48-large.jpg new file mode 100644 index 000000000..7cf5e2a83 Binary files /dev/null and b/img/p/2-48-large.jpg differ diff --git a/img/p/2-48-medium.jpg b/img/p/2-48-medium.jpg new file mode 100644 index 000000000..7224a6f42 Binary files /dev/null and b/img/p/2-48-medium.jpg differ diff --git a/img/p/2-48-small.jpg b/img/p/2-48-small.jpg new file mode 100644 index 000000000..a1b502ab1 Binary files /dev/null and b/img/p/2-48-small.jpg differ diff --git a/img/p/2-48-thickbox.jpg b/img/p/2-48-thickbox.jpg new file mode 100644 index 000000000..82f8d50bc Binary files /dev/null and b/img/p/2-48-thickbox.jpg differ diff --git a/img/p/2-48.jpg b/img/p/2-48.jpg new file mode 100644 index 000000000..67cf9de33 Binary files /dev/null and b/img/p/2-48.jpg differ diff --git a/img/p/2-49-home.jpg b/img/p/2-49-home.jpg new file mode 100644 index 000000000..1ffe47e48 Binary files /dev/null and b/img/p/2-49-home.jpg differ diff --git a/img/p/2-49-large.jpg b/img/p/2-49-large.jpg new file mode 100644 index 000000000..15847b088 Binary files /dev/null and b/img/p/2-49-large.jpg differ diff --git a/img/p/2-49-medium.jpg b/img/p/2-49-medium.jpg new file mode 100644 index 000000000..4892ae73e Binary files /dev/null and b/img/p/2-49-medium.jpg differ diff --git a/img/p/2-49-small.jpg b/img/p/2-49-small.jpg new file mode 100644 index 000000000..c6191a372 Binary files /dev/null and b/img/p/2-49-small.jpg differ diff --git a/img/p/2-49-thickbox.jpg b/img/p/2-49-thickbox.jpg new file mode 100644 index 000000000..5f1ba4d62 Binary files /dev/null and b/img/p/2-49-thickbox.jpg differ diff --git a/img/p/2-49.jpg b/img/p/2-49.jpg new file mode 100644 index 000000000..754de0739 Binary files /dev/null and b/img/p/2-49.jpg differ diff --git a/img/p/2-5-home.jpg b/img/p/2-5-home.jpg new file mode 100644 index 000000000..a91c78790 Binary files /dev/null and b/img/p/2-5-home.jpg differ diff --git a/img/p/2-5-large.jpg b/img/p/2-5-large.jpg new file mode 100644 index 000000000..668c069e8 Binary files /dev/null and b/img/p/2-5-large.jpg differ diff --git a/img/p/2-5-medium.jpg b/img/p/2-5-medium.jpg new file mode 100644 index 000000000..c42763f57 Binary files /dev/null and b/img/p/2-5-medium.jpg differ diff --git a/img/p/2-5-small.jpg b/img/p/2-5-small.jpg new file mode 100644 index 000000000..af4f06eb1 Binary files /dev/null and b/img/p/2-5-small.jpg differ diff --git a/img/p/2-5-thickbox.jpg b/img/p/2-5-thickbox.jpg new file mode 100644 index 000000000..15292f0eb Binary files /dev/null and b/img/p/2-5-thickbox.jpg differ diff --git a/img/p/2-5.jpg b/img/p/2-5.jpg new file mode 100644 index 000000000..68815f075 Binary files /dev/null and b/img/p/2-5.jpg differ diff --git a/img/p/2-6-home.jpg b/img/p/2-6-home.jpg new file mode 100644 index 000000000..832813912 Binary files /dev/null and b/img/p/2-6-home.jpg differ diff --git a/img/p/2-6-large.jpg b/img/p/2-6-large.jpg new file mode 100644 index 000000000..20c85e59b Binary files /dev/null and b/img/p/2-6-large.jpg differ diff --git a/img/p/2-6-medium.jpg b/img/p/2-6-medium.jpg new file mode 100644 index 000000000..ce6e9064a Binary files /dev/null and b/img/p/2-6-medium.jpg differ diff --git a/img/p/2-6-small.jpg b/img/p/2-6-small.jpg new file mode 100644 index 000000000..74e46ed98 Binary files /dev/null and b/img/p/2-6-small.jpg differ diff --git a/img/p/2-6-thickbox.jpg b/img/p/2-6-thickbox.jpg new file mode 100644 index 000000000..e715a39aa Binary files /dev/null and b/img/p/2-6-thickbox.jpg differ diff --git a/img/p/2-6.jpg b/img/p/2-6.jpg new file mode 100644 index 000000000..e7f8b0ef7 Binary files /dev/null and b/img/p/2-6.jpg differ diff --git a/img/p/2-7-home.jpg b/img/p/2-7-home.jpg new file mode 100644 index 000000000..1b9f13a53 Binary files /dev/null and b/img/p/2-7-home.jpg differ diff --git a/img/p/2-7-large.jpg b/img/p/2-7-large.jpg new file mode 100644 index 000000000..8452fbd19 Binary files /dev/null and b/img/p/2-7-large.jpg differ diff --git a/img/p/2-7-medium.jpg b/img/p/2-7-medium.jpg new file mode 100644 index 000000000..75e6d8a16 Binary files /dev/null and b/img/p/2-7-medium.jpg differ diff --git a/img/p/2-7-small.jpg b/img/p/2-7-small.jpg new file mode 100644 index 000000000..fada0f8a2 Binary files /dev/null and b/img/p/2-7-small.jpg differ diff --git a/img/p/2-7-thickbox.jpg b/img/p/2-7-thickbox.jpg new file mode 100644 index 000000000..f364b70af Binary files /dev/null and b/img/p/2-7-thickbox.jpg differ diff --git a/img/p/2-7.jpg b/img/p/2-7.jpg new file mode 100644 index 000000000..7a2d38e27 Binary files /dev/null and b/img/p/2-7.jpg differ diff --git a/img/p/2-8-home.jpg b/img/p/2-8-home.jpg new file mode 100644 index 000000000..8603e61f2 Binary files /dev/null and b/img/p/2-8-home.jpg differ diff --git a/img/p/2-8-large.jpg b/img/p/2-8-large.jpg new file mode 100644 index 000000000..02c7c889a Binary files /dev/null and b/img/p/2-8-large.jpg differ diff --git a/img/p/2-8-medium.jpg b/img/p/2-8-medium.jpg new file mode 100644 index 000000000..7a9a88122 Binary files /dev/null and b/img/p/2-8-medium.jpg differ diff --git a/img/p/2-8-small.jpg b/img/p/2-8-small.jpg new file mode 100644 index 000000000..ef2b01062 Binary files /dev/null and b/img/p/2-8-small.jpg differ diff --git a/img/p/2-8-thickbox.jpg b/img/p/2-8-thickbox.jpg new file mode 100644 index 000000000..40809fc56 Binary files /dev/null and b/img/p/2-8-thickbox.jpg differ diff --git a/img/p/2-8.jpg b/img/p/2-8.jpg new file mode 100644 index 000000000..446931592 Binary files /dev/null and b/img/p/2-8.jpg differ diff --git a/img/p/2-9-home.jpg b/img/p/2-9-home.jpg new file mode 100644 index 000000000..0511c80fe Binary files /dev/null and b/img/p/2-9-home.jpg differ diff --git a/img/p/2-9-large.jpg b/img/p/2-9-large.jpg new file mode 100644 index 000000000..c1ca01aaa Binary files /dev/null and b/img/p/2-9-large.jpg differ diff --git a/img/p/2-9-medium.jpg b/img/p/2-9-medium.jpg new file mode 100644 index 000000000..11a22e2fa Binary files /dev/null and b/img/p/2-9-medium.jpg differ diff --git a/img/p/2-9-small.jpg b/img/p/2-9-small.jpg new file mode 100644 index 000000000..f8c3977f9 Binary files /dev/null and b/img/p/2-9-small.jpg differ diff --git a/img/p/2-9-thickbox.jpg b/img/p/2-9-thickbox.jpg new file mode 100644 index 000000000..cb654a5f9 Binary files /dev/null and b/img/p/2-9-thickbox.jpg differ diff --git a/img/p/2-9.jpg b/img/p/2-9.jpg new file mode 100644 index 000000000..a23b6a8ed Binary files /dev/null and b/img/p/2-9.jpg differ diff --git a/img/p/5-15-home.jpg b/img/p/5-15-home.jpg new file mode 100644 index 000000000..5af00dd93 Binary files /dev/null and b/img/p/5-15-home.jpg differ diff --git a/img/p/5-15-large.jpg b/img/p/5-15-large.jpg new file mode 100644 index 000000000..f1c9a858d Binary files /dev/null and b/img/p/5-15-large.jpg differ diff --git a/img/p/5-15-medium.jpg b/img/p/5-15-medium.jpg new file mode 100644 index 000000000..8ac000dbe Binary files /dev/null and b/img/p/5-15-medium.jpg differ diff --git a/img/p/5-15-small.jpg b/img/p/5-15-small.jpg new file mode 100644 index 000000000..6e7b475bc Binary files /dev/null and b/img/p/5-15-small.jpg differ diff --git a/img/p/5-15-thickbox.jpg b/img/p/5-15-thickbox.jpg new file mode 100644 index 000000000..876011964 Binary files /dev/null and b/img/p/5-15-thickbox.jpg differ diff --git a/img/p/5-15.jpg b/img/p/5-15.jpg new file mode 100644 index 000000000..1960498ee Binary files /dev/null and b/img/p/5-15.jpg differ diff --git a/img/p/5-16-home.jpg b/img/p/5-16-home.jpg new file mode 100644 index 000000000..2e9c8dd22 Binary files /dev/null and b/img/p/5-16-home.jpg differ diff --git a/img/p/5-16-large.jpg b/img/p/5-16-large.jpg new file mode 100644 index 000000000..df53cf7e1 Binary files /dev/null and b/img/p/5-16-large.jpg differ diff --git a/img/p/5-16-medium.jpg b/img/p/5-16-medium.jpg new file mode 100644 index 000000000..dfd870baf Binary files /dev/null and b/img/p/5-16-medium.jpg differ diff --git a/img/p/5-16-small.jpg b/img/p/5-16-small.jpg new file mode 100644 index 000000000..a9b64a4b3 Binary files /dev/null and b/img/p/5-16-small.jpg differ diff --git a/img/p/5-16-thickbox.jpg b/img/p/5-16-thickbox.jpg new file mode 100644 index 000000000..ccb830ecf Binary files /dev/null and b/img/p/5-16-thickbox.jpg differ diff --git a/img/p/5-16.jpg b/img/p/5-16.jpg new file mode 100644 index 000000000..4f0877bac Binary files /dev/null and b/img/p/5-16.jpg differ diff --git a/img/p/5-17-home.jpg b/img/p/5-17-home.jpg new file mode 100644 index 000000000..fc80cc7f0 Binary files /dev/null and b/img/p/5-17-home.jpg differ diff --git a/img/p/5-17-large.jpg b/img/p/5-17-large.jpg new file mode 100644 index 000000000..34b5f88bc Binary files /dev/null and b/img/p/5-17-large.jpg differ diff --git a/img/p/5-17-medium.jpg b/img/p/5-17-medium.jpg new file mode 100644 index 000000000..4f7565101 Binary files /dev/null and b/img/p/5-17-medium.jpg differ diff --git a/img/p/5-17-small.jpg b/img/p/5-17-small.jpg new file mode 100644 index 000000000..172d1d28f Binary files /dev/null and b/img/p/5-17-small.jpg differ diff --git a/img/p/5-17-thickbox.jpg b/img/p/5-17-thickbox.jpg new file mode 100644 index 000000000..28e8f2bd6 Binary files /dev/null and b/img/p/5-17-thickbox.jpg differ diff --git a/img/p/5-17.jpg b/img/p/5-17.jpg new file mode 100644 index 000000000..29d21da77 Binary files /dev/null and b/img/p/5-17.jpg differ diff --git a/img/p/6-18-home.jpg b/img/p/6-18-home.jpg new file mode 100644 index 000000000..2b6d451af Binary files /dev/null and b/img/p/6-18-home.jpg differ diff --git a/img/p/6-18-large.jpg b/img/p/6-18-large.jpg new file mode 100644 index 000000000..25b98137c Binary files /dev/null and b/img/p/6-18-large.jpg differ diff --git a/img/p/6-18-medium.jpg b/img/p/6-18-medium.jpg new file mode 100644 index 000000000..c7c5c293a Binary files /dev/null and b/img/p/6-18-medium.jpg differ diff --git a/img/p/6-18-small.jpg b/img/p/6-18-small.jpg new file mode 100644 index 000000000..b6a562e15 Binary files /dev/null and b/img/p/6-18-small.jpg differ diff --git a/img/p/6-18-thickbox.jpg b/img/p/6-18-thickbox.jpg new file mode 100644 index 000000000..cb56e5a67 Binary files /dev/null and b/img/p/6-18-thickbox.jpg differ diff --git a/img/p/6-18.jpg b/img/p/6-18.jpg new file mode 100644 index 000000000..b29f3fe55 Binary files /dev/null and b/img/p/6-18.jpg differ diff --git a/img/p/6-19-home.jpg b/img/p/6-19-home.jpg new file mode 100644 index 000000000..b7e2e252f Binary files /dev/null and b/img/p/6-19-home.jpg differ diff --git a/img/p/6-19-large.jpg b/img/p/6-19-large.jpg new file mode 100644 index 000000000..1726b9711 Binary files /dev/null and b/img/p/6-19-large.jpg differ diff --git a/img/p/6-19-medium.jpg b/img/p/6-19-medium.jpg new file mode 100644 index 000000000..c6f3cf1bf Binary files /dev/null and b/img/p/6-19-medium.jpg differ diff --git a/img/p/6-19-small.jpg b/img/p/6-19-small.jpg new file mode 100644 index 000000000..d2835e13e Binary files /dev/null and b/img/p/6-19-small.jpg differ diff --git a/img/p/6-19-thickbox.jpg b/img/p/6-19-thickbox.jpg new file mode 100644 index 000000000..aa86db11a Binary files /dev/null and b/img/p/6-19-thickbox.jpg differ diff --git a/img/p/6-19.jpg b/img/p/6-19.jpg new file mode 100644 index 000000000..ea5e14a37 Binary files /dev/null and b/img/p/6-19.jpg differ diff --git a/img/p/6-20-home.jpg b/img/p/6-20-home.jpg new file mode 100644 index 000000000..4f45e69d5 Binary files /dev/null and b/img/p/6-20-home.jpg differ diff --git a/img/p/6-20-large.jpg b/img/p/6-20-large.jpg new file mode 100644 index 000000000..27cc9190d Binary files /dev/null and b/img/p/6-20-large.jpg differ diff --git a/img/p/6-20-medium.jpg b/img/p/6-20-medium.jpg new file mode 100644 index 000000000..99303fc10 Binary files /dev/null and b/img/p/6-20-medium.jpg differ diff --git a/img/p/6-20-small.jpg b/img/p/6-20-small.jpg new file mode 100644 index 000000000..a9ef63ac8 Binary files /dev/null and b/img/p/6-20-small.jpg differ diff --git a/img/p/6-20-thickbox.jpg b/img/p/6-20-thickbox.jpg new file mode 100644 index 000000000..f0f73e881 Binary files /dev/null and b/img/p/6-20-thickbox.jpg differ diff --git a/img/p/6-20.jpg b/img/p/6-20.jpg new file mode 100644 index 000000000..4a53c6814 Binary files /dev/null and b/img/p/6-20.jpg differ diff --git a/img/p/7-24-home.jpg b/img/p/7-24-home.jpg new file mode 100644 index 000000000..61e14a4c6 Binary files /dev/null and b/img/p/7-24-home.jpg differ diff --git a/img/p/7-24-large.jpg b/img/p/7-24-large.jpg new file mode 100644 index 000000000..957a11b22 Binary files /dev/null and b/img/p/7-24-large.jpg differ diff --git a/img/p/7-24-medium.jpg b/img/p/7-24-medium.jpg new file mode 100644 index 000000000..8532093d4 Binary files /dev/null and b/img/p/7-24-medium.jpg differ diff --git a/img/p/7-24-small.jpg b/img/p/7-24-small.jpg new file mode 100644 index 000000000..8179f3877 Binary files /dev/null and b/img/p/7-24-small.jpg differ diff --git a/img/p/7-24-thickbox.jpg b/img/p/7-24-thickbox.jpg new file mode 100644 index 000000000..868fdd3c5 Binary files /dev/null and b/img/p/7-24-thickbox.jpg differ diff --git a/img/p/7-24.jpg b/img/p/7-24.jpg new file mode 100644 index 000000000..8a3f0cc3c Binary files /dev/null and b/img/p/7-24.jpg differ diff --git a/img/p/7-26-home.jpg b/img/p/7-26-home.jpg new file mode 100644 index 000000000..e18019683 Binary files /dev/null and b/img/p/7-26-home.jpg differ diff --git a/img/p/7-26-large.jpg b/img/p/7-26-large.jpg new file mode 100644 index 000000000..0e2357185 Binary files /dev/null and b/img/p/7-26-large.jpg differ diff --git a/img/p/7-26-medium.jpg b/img/p/7-26-medium.jpg new file mode 100644 index 000000000..1d3b8d850 Binary files /dev/null and b/img/p/7-26-medium.jpg differ diff --git a/img/p/7-26-small.jpg b/img/p/7-26-small.jpg new file mode 100644 index 000000000..657960993 Binary files /dev/null and b/img/p/7-26-small.jpg differ diff --git a/img/p/7-26-thickbox.jpg b/img/p/7-26-thickbox.jpg new file mode 100644 index 000000000..e37ddab82 Binary files /dev/null and b/img/p/7-26-thickbox.jpg differ diff --git a/img/p/7-26.jpg b/img/p/7-26.jpg new file mode 100644 index 000000000..cf547f514 Binary files /dev/null and b/img/p/7-26.jpg differ diff --git a/img/p/7-27-home.jpg b/img/p/7-27-home.jpg new file mode 100644 index 000000000..53fbe8711 Binary files /dev/null and b/img/p/7-27-home.jpg differ diff --git a/img/p/7-27-large.jpg b/img/p/7-27-large.jpg new file mode 100644 index 000000000..84098b969 Binary files /dev/null and b/img/p/7-27-large.jpg differ diff --git a/img/p/7-27-medium.jpg b/img/p/7-27-medium.jpg new file mode 100644 index 000000000..ab04c2c16 Binary files /dev/null and b/img/p/7-27-medium.jpg differ diff --git a/img/p/7-27-small.jpg b/img/p/7-27-small.jpg new file mode 100644 index 000000000..43a581a8a Binary files /dev/null and b/img/p/7-27-small.jpg differ diff --git a/img/p/7-27-thickbox.jpg b/img/p/7-27-thickbox.jpg new file mode 100644 index 000000000..d05a22039 Binary files /dev/null and b/img/p/7-27-thickbox.jpg differ diff --git a/img/p/7-27.jpg b/img/p/7-27.jpg new file mode 100644 index 000000000..a09ffb565 Binary files /dev/null and b/img/p/7-27.jpg differ diff --git a/img/p/7-29-home.jpg b/img/p/7-29-home.jpg new file mode 100644 index 000000000..6c0c79143 Binary files /dev/null and b/img/p/7-29-home.jpg differ diff --git a/img/p/7-29-large.jpg b/img/p/7-29-large.jpg new file mode 100644 index 000000000..fe6b353f9 Binary files /dev/null and b/img/p/7-29-large.jpg differ diff --git a/img/p/7-29-medium.jpg b/img/p/7-29-medium.jpg new file mode 100644 index 000000000..40f8e96aa Binary files /dev/null and b/img/p/7-29-medium.jpg differ diff --git a/img/p/7-29-small.jpg b/img/p/7-29-small.jpg new file mode 100644 index 000000000..4105bcdba Binary files /dev/null and b/img/p/7-29-small.jpg differ diff --git a/img/p/7-29-thickbox.jpg b/img/p/7-29-thickbox.jpg new file mode 100644 index 000000000..8c9c7acc9 Binary files /dev/null and b/img/p/7-29-thickbox.jpg differ diff --git a/img/p/7-29.jpg b/img/p/7-29.jpg new file mode 100644 index 000000000..f77be18d1 Binary files /dev/null and b/img/p/7-29.jpg differ diff --git a/img/p/7-30-home.jpg b/img/p/7-30-home.jpg new file mode 100644 index 000000000..fa72ad431 Binary files /dev/null and b/img/p/7-30-home.jpg differ diff --git a/img/p/7-30-large.jpg b/img/p/7-30-large.jpg new file mode 100644 index 000000000..31a7f84d4 Binary files /dev/null and b/img/p/7-30-large.jpg differ diff --git a/img/p/7-30-medium.jpg b/img/p/7-30-medium.jpg new file mode 100644 index 000000000..cc03e842b Binary files /dev/null and b/img/p/7-30-medium.jpg differ diff --git a/img/p/7-30-small.jpg b/img/p/7-30-small.jpg new file mode 100644 index 000000000..f7d794a5e Binary files /dev/null and b/img/p/7-30-small.jpg differ diff --git a/img/p/7-30-thickbox.jpg b/img/p/7-30-thickbox.jpg new file mode 100644 index 000000000..5fa11a916 Binary files /dev/null and b/img/p/7-30-thickbox.jpg differ diff --git a/img/p/7-30.jpg b/img/p/7-30.jpg new file mode 100644 index 000000000..fdd92a611 Binary files /dev/null and b/img/p/7-30.jpg differ diff --git a/img/p/7-32-home.jpg b/img/p/7-32-home.jpg new file mode 100644 index 000000000..88fb3e801 Binary files /dev/null and b/img/p/7-32-home.jpg differ diff --git a/img/p/7-32-large.jpg b/img/p/7-32-large.jpg new file mode 100644 index 000000000..cf35df960 Binary files /dev/null and b/img/p/7-32-large.jpg differ diff --git a/img/p/7-32-medium.jpg b/img/p/7-32-medium.jpg new file mode 100644 index 000000000..841730a91 Binary files /dev/null and b/img/p/7-32-medium.jpg differ diff --git a/img/p/7-32-small.jpg b/img/p/7-32-small.jpg new file mode 100644 index 000000000..61ad554d0 Binary files /dev/null and b/img/p/7-32-small.jpg differ diff --git a/img/p/7-32-thickbox.jpg b/img/p/7-32-thickbox.jpg new file mode 100644 index 000000000..8c6dbc048 Binary files /dev/null and b/img/p/7-32-thickbox.jpg differ diff --git a/img/p/7-32.jpg b/img/p/7-32.jpg new file mode 100644 index 000000000..c66c26932 Binary files /dev/null and b/img/p/7-32.jpg differ diff --git a/img/p/8-33-home.jpg b/img/p/8-33-home.jpg new file mode 100644 index 000000000..1296372bc Binary files /dev/null and b/img/p/8-33-home.jpg differ diff --git a/img/p/8-33-large.jpg b/img/p/8-33-large.jpg new file mode 100644 index 000000000..b598030d0 Binary files /dev/null and b/img/p/8-33-large.jpg differ diff --git a/img/p/8-33-medium.jpg b/img/p/8-33-medium.jpg new file mode 100644 index 000000000..ed4a6208b Binary files /dev/null and b/img/p/8-33-medium.jpg differ diff --git a/img/p/8-33-small.jpg b/img/p/8-33-small.jpg new file mode 100644 index 000000000..1d81d8704 Binary files /dev/null and b/img/p/8-33-small.jpg differ diff --git a/img/p/8-33-thickbox.jpg b/img/p/8-33-thickbox.jpg new file mode 100644 index 000000000..80b3c0f55 Binary files /dev/null and b/img/p/8-33-thickbox.jpg differ diff --git a/img/p/8-33.jpg b/img/p/8-33.jpg new file mode 100644 index 000000000..936488d1a Binary files /dev/null and b/img/p/8-33.jpg differ diff --git a/img/p/9-36-home.jpg b/img/p/9-36-home.jpg new file mode 100644 index 000000000..79f87c5a4 Binary files /dev/null and b/img/p/9-36-home.jpg differ diff --git a/img/p/9-36-large.jpg b/img/p/9-36-large.jpg new file mode 100644 index 000000000..ee0159fa9 Binary files /dev/null and b/img/p/9-36-large.jpg differ diff --git a/img/p/9-36-medium.jpg b/img/p/9-36-medium.jpg new file mode 100644 index 000000000..ad8a49bea Binary files /dev/null and b/img/p/9-36-medium.jpg differ diff --git a/img/p/9-36-small.jpg b/img/p/9-36-small.jpg new file mode 100644 index 000000000..b52411168 Binary files /dev/null and b/img/p/9-36-small.jpg differ diff --git a/img/p/9-36-thickbox.jpg b/img/p/9-36-thickbox.jpg new file mode 100644 index 000000000..d18acc958 Binary files /dev/null and b/img/p/9-36-thickbox.jpg differ diff --git a/img/p/9-36.jpg b/img/p/9-36.jpg new file mode 100644 index 000000000..aaf80c7c1 Binary files /dev/null and b/img/p/9-36.jpg differ diff --git a/img/p/de-default-home.jpg b/img/p/de-default-home.jpg new file mode 100755 index 000000000..2a3f86bfb Binary files /dev/null and b/img/p/de-default-home.jpg differ diff --git a/img/p/de-default-large.jpg b/img/p/de-default-large.jpg new file mode 100755 index 000000000..dcc29c8f1 Binary files /dev/null and b/img/p/de-default-large.jpg differ diff --git a/img/p/de-default-medium.jpg b/img/p/de-default-medium.jpg new file mode 100755 index 000000000..c0ee66646 Binary files /dev/null and b/img/p/de-default-medium.jpg differ diff --git a/img/p/de-default-small.jpg b/img/p/de-default-small.jpg new file mode 100755 index 000000000..11e9c3688 Binary files /dev/null and b/img/p/de-default-small.jpg differ diff --git a/img/p/de-default-thickbox.jpg b/img/p/de-default-thickbox.jpg new file mode 100755 index 000000000..c37db2680 Binary files /dev/null and b/img/p/de-default-thickbox.jpg differ diff --git a/img/p/de.jpg b/img/p/de.jpg new file mode 100755 index 000000000..43716f653 Binary files /dev/null and b/img/p/de.jpg differ diff --git a/img/p/en-default-home.jpg b/img/p/en-default-home.jpg new file mode 100644 index 000000000..ae6658431 Binary files /dev/null and b/img/p/en-default-home.jpg differ diff --git a/img/p/en-default-large.jpg b/img/p/en-default-large.jpg new file mode 100644 index 000000000..d08a055e0 Binary files /dev/null and b/img/p/en-default-large.jpg differ diff --git a/img/p/en-default-medium.jpg b/img/p/en-default-medium.jpg new file mode 100644 index 000000000..0d18d71b3 Binary files /dev/null and b/img/p/en-default-medium.jpg differ diff --git a/img/p/en-default-small.jpg b/img/p/en-default-small.jpg new file mode 100644 index 000000000..50f7c97b8 Binary files /dev/null and b/img/p/en-default-small.jpg differ diff --git a/img/p/en-default-thickbox.jpg b/img/p/en-default-thickbox.jpg new file mode 100644 index 000000000..6bd5603f7 Binary files /dev/null and b/img/p/en-default-thickbox.jpg differ diff --git a/img/p/en.jpg b/img/p/en.jpg new file mode 100644 index 000000000..7d07b871d Binary files /dev/null and b/img/p/en.jpg differ diff --git a/img/p/es-default-home.jpg b/img/p/es-default-home.jpg new file mode 100644 index 000000000..a047358b8 Binary files /dev/null and b/img/p/es-default-home.jpg differ diff --git a/img/p/es-default-large.jpg b/img/p/es-default-large.jpg new file mode 100644 index 000000000..6683d919f Binary files /dev/null and b/img/p/es-default-large.jpg differ diff --git a/img/p/es-default-medium.jpg b/img/p/es-default-medium.jpg new file mode 100644 index 000000000..890436615 Binary files /dev/null and b/img/p/es-default-medium.jpg differ diff --git a/img/p/es-default-small.jpg b/img/p/es-default-small.jpg new file mode 100644 index 000000000..b3118b097 Binary files /dev/null and b/img/p/es-default-small.jpg differ diff --git a/img/p/es-default-thickbox.jpg b/img/p/es-default-thickbox.jpg new file mode 100644 index 000000000..3db0c85b3 Binary files /dev/null and b/img/p/es-default-thickbox.jpg differ diff --git a/img/p/es.jpg b/img/p/es.jpg new file mode 100644 index 000000000..28d7b8c81 Binary files /dev/null and b/img/p/es.jpg differ diff --git a/img/p/fr-default-home.jpg b/img/p/fr-default-home.jpg new file mode 100644 index 000000000..b69c6bb70 Binary files /dev/null and b/img/p/fr-default-home.jpg differ diff --git a/img/p/fr-default-large.jpg b/img/p/fr-default-large.jpg new file mode 100644 index 000000000..70c8ca6b7 Binary files /dev/null and b/img/p/fr-default-large.jpg differ diff --git a/img/p/fr-default-medium.jpg b/img/p/fr-default-medium.jpg new file mode 100644 index 000000000..a216e5ea4 Binary files /dev/null and b/img/p/fr-default-medium.jpg differ diff --git a/img/p/fr-default-small.jpg b/img/p/fr-default-small.jpg new file mode 100644 index 000000000..1c3ae1720 Binary files /dev/null and b/img/p/fr-default-small.jpg differ diff --git a/img/p/fr-default-thickbox.jpg b/img/p/fr-default-thickbox.jpg new file mode 100644 index 000000000..1f932656b Binary files /dev/null and b/img/p/fr-default-thickbox.jpg differ diff --git a/img/p/fr.jpg b/img/p/fr.jpg new file mode 100644 index 000000000..ed443472f Binary files /dev/null and b/img/p/fr.jpg differ diff --git a/img/p/index.php b/img/p/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/p/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/p/it-default-home.jpg b/img/p/it-default-home.jpg new file mode 100755 index 000000000..54c4bd95b Binary files /dev/null and b/img/p/it-default-home.jpg differ diff --git a/img/p/it-default-large.jpg b/img/p/it-default-large.jpg new file mode 100755 index 000000000..97bf6f2f0 Binary files /dev/null and b/img/p/it-default-large.jpg differ diff --git a/img/p/it-default-medium.jpg b/img/p/it-default-medium.jpg new file mode 100755 index 000000000..461031f99 Binary files /dev/null and b/img/p/it-default-medium.jpg differ diff --git a/img/p/it-default-small.jpg b/img/p/it-default-small.jpg new file mode 100755 index 000000000..8c72ec678 Binary files /dev/null and b/img/p/it-default-small.jpg differ diff --git a/img/p/it-default-thickbox.jpg b/img/p/it-default-thickbox.jpg new file mode 100755 index 000000000..96fc64a4e Binary files /dev/null and b/img/p/it-default-thickbox.jpg differ diff --git a/img/p/it.jpg b/img/p/it.jpg new file mode 100755 index 000000000..94802add7 Binary files /dev/null and b/img/p/it.jpg differ diff --git a/img/s/index.php b/img/s/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/s/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/scenes/1-large_scene.jpg b/img/scenes/1-large_scene.jpg new file mode 100644 index 000000000..d4e31adc1 Binary files /dev/null and b/img/scenes/1-large_scene.jpg differ diff --git a/img/scenes/1.jpg b/img/scenes/1.jpg new file mode 100644 index 000000000..d5ece377f Binary files /dev/null and b/img/scenes/1.jpg differ diff --git a/img/scenes/2-large_scene.jpg b/img/scenes/2-large_scene.jpg new file mode 100644 index 000000000..7567634e6 Binary files /dev/null and b/img/scenes/2-large_scene.jpg differ diff --git a/img/scenes/2.jpg b/img/scenes/2.jpg new file mode 100644 index 000000000..19ba0dfc8 Binary files /dev/null and b/img/scenes/2.jpg differ diff --git a/img/scenes/3-large_scene.jpg b/img/scenes/3-large_scene.jpg new file mode 100644 index 000000000..56f034133 Binary files /dev/null and b/img/scenes/3-large_scene.jpg differ diff --git a/img/scenes/3.jpg b/img/scenes/3.jpg new file mode 100644 index 000000000..16de52e68 Binary files /dev/null and b/img/scenes/3.jpg differ diff --git a/img/scenes/de-default-large_scene.jpg b/img/scenes/de-default-large_scene.jpg new file mode 100755 index 000000000..c99cfc7a6 Binary files /dev/null and b/img/scenes/de-default-large_scene.jpg differ diff --git a/img/scenes/de-default-thumb_scene.jpg b/img/scenes/de-default-thumb_scene.jpg new file mode 100755 index 000000000..28702094e Binary files /dev/null and b/img/scenes/de-default-thumb_scene.jpg differ diff --git a/img/scenes/en-default-large_scene.jpg b/img/scenes/en-default-large_scene.jpg new file mode 100644 index 000000000..0c8b30dbe Binary files /dev/null and b/img/scenes/en-default-large_scene.jpg differ diff --git a/img/scenes/en-default-thumb_scene.jpg b/img/scenes/en-default-thumb_scene.jpg new file mode 100644 index 000000000..47d2def48 Binary files /dev/null and b/img/scenes/en-default-thumb_scene.jpg differ diff --git a/img/scenes/es-default-large_scene.jpg b/img/scenes/es-default-large_scene.jpg new file mode 100755 index 000000000..0c8b30dbe Binary files /dev/null and b/img/scenes/es-default-large_scene.jpg differ diff --git a/img/scenes/es-default-thumb_scene.jpg b/img/scenes/es-default-thumb_scene.jpg new file mode 100755 index 000000000..47d2def48 Binary files /dev/null and b/img/scenes/es-default-thumb_scene.jpg differ diff --git a/img/scenes/fr-default-large_scene.jpg b/img/scenes/fr-default-large_scene.jpg new file mode 100644 index 000000000..b68f5ddca Binary files /dev/null and b/img/scenes/fr-default-large_scene.jpg differ diff --git a/img/scenes/fr-default-thumb_scene.jpg b/img/scenes/fr-default-thumb_scene.jpg new file mode 100644 index 000000000..91d22f97f Binary files /dev/null and b/img/scenes/fr-default-thumb_scene.jpg differ diff --git a/img/scenes/index.php b/img/scenes/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/scenes/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/scenes/it-default-large_scene.jpg b/img/scenes/it-default-large_scene.jpg new file mode 100755 index 000000000..be32f833b Binary files /dev/null and b/img/scenes/it-default-large_scene.jpg differ diff --git a/img/scenes/it-default-thumb_scene.jpg b/img/scenes/it-default-thumb_scene.jpg new file mode 100755 index 000000000..72fddf890 Binary files /dev/null and b/img/scenes/it-default-thumb_scene.jpg differ diff --git a/img/scenes/thumbs/1-thumb_scene.jpg b/img/scenes/thumbs/1-thumb_scene.jpg new file mode 100644 index 000000000..d39f00884 Binary files /dev/null and b/img/scenes/thumbs/1-thumb_scene.jpg differ diff --git a/img/scenes/thumbs/2-thumb_scene.jpg b/img/scenes/thumbs/2-thumb_scene.jpg new file mode 100644 index 000000000..c21b53279 Binary files /dev/null and b/img/scenes/thumbs/2-thumb_scene.jpg differ diff --git a/img/scenes/thumbs/3-thumb_scene.jpg b/img/scenes/thumbs/3-thumb_scene.jpg new file mode 100644 index 000000000..3efcb3b59 Binary files /dev/null and b/img/scenes/thumbs/3-thumb_scene.jpg differ diff --git a/img/scenes/thumbs/index.php b/img/scenes/thumbs/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/scenes/thumbs/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/st/1-category.jpg b/img/st/1-category.jpg new file mode 100644 index 000000000..c85876e0d Binary files /dev/null and b/img/st/1-category.jpg differ diff --git a/img/st/1-large.jpg b/img/st/1-large.jpg new file mode 100644 index 000000000..8a983e349 Binary files /dev/null and b/img/st/1-large.jpg differ diff --git a/img/st/1-medium.jpg b/img/st/1-medium.jpg new file mode 100644 index 000000000..ad01d54a3 Binary files /dev/null and b/img/st/1-medium.jpg differ diff --git a/img/st/1-small.jpg b/img/st/1-small.jpg new file mode 100644 index 000000000..e08448060 Binary files /dev/null and b/img/st/1-small.jpg differ diff --git a/img/st/1.jpg b/img/st/1.jpg new file mode 100644 index 000000000..34b45eee6 Binary files /dev/null and b/img/st/1.jpg differ diff --git a/img/st/2-category.jpg b/img/st/2-category.jpg new file mode 100644 index 000000000..c85876e0d Binary files /dev/null and b/img/st/2-category.jpg differ diff --git a/img/st/2-large.jpg b/img/st/2-large.jpg new file mode 100644 index 000000000..8a983e349 Binary files /dev/null and b/img/st/2-large.jpg differ diff --git a/img/st/2-medium.jpg b/img/st/2-medium.jpg new file mode 100644 index 000000000..ad01d54a3 Binary files /dev/null and b/img/st/2-medium.jpg differ diff --git a/img/st/2-small.jpg b/img/st/2-small.jpg new file mode 100644 index 000000000..e08448060 Binary files /dev/null and b/img/st/2-small.jpg differ diff --git a/img/st/2.jpg b/img/st/2.jpg new file mode 100644 index 000000000..34b45eee6 Binary files /dev/null and b/img/st/2.jpg differ diff --git a/img/st/3-category.jpg b/img/st/3-category.jpg new file mode 100644 index 000000000..c85876e0d Binary files /dev/null and b/img/st/3-category.jpg differ diff --git a/img/st/3-large.jpg b/img/st/3-large.jpg new file mode 100644 index 000000000..8a983e349 Binary files /dev/null and b/img/st/3-large.jpg differ diff --git a/img/st/3-medium.jpg b/img/st/3-medium.jpg new file mode 100644 index 000000000..ad01d54a3 Binary files /dev/null and b/img/st/3-medium.jpg differ diff --git a/img/st/3-small.jpg b/img/st/3-small.jpg new file mode 100644 index 000000000..e08448060 Binary files /dev/null and b/img/st/3-small.jpg differ diff --git a/img/st/3.jpg b/img/st/3.jpg new file mode 100644 index 000000000..34b45eee6 Binary files /dev/null and b/img/st/3.jpg differ diff --git a/img/st/4-category.jpg b/img/st/4-category.jpg new file mode 100644 index 000000000..c85876e0d Binary files /dev/null and b/img/st/4-category.jpg differ diff --git a/img/st/4-large.jpg b/img/st/4-large.jpg new file mode 100644 index 000000000..8a983e349 Binary files /dev/null and b/img/st/4-large.jpg differ diff --git a/img/st/4-medium.jpg b/img/st/4-medium.jpg new file mode 100644 index 000000000..ad01d54a3 Binary files /dev/null and b/img/st/4-medium.jpg differ diff --git a/img/st/4-small.jpg b/img/st/4-small.jpg new file mode 100644 index 000000000..e08448060 Binary files /dev/null and b/img/st/4-small.jpg differ diff --git a/img/st/4.jpg b/img/st/4.jpg new file mode 100644 index 000000000..34b45eee6 Binary files /dev/null and b/img/st/4.jpg differ diff --git a/img/st/5-category.jpg b/img/st/5-category.jpg new file mode 100644 index 000000000..c85876e0d Binary files /dev/null and b/img/st/5-category.jpg differ diff --git a/img/st/5-large.jpg b/img/st/5-large.jpg new file mode 100644 index 000000000..8a983e349 Binary files /dev/null and b/img/st/5-large.jpg differ diff --git a/img/st/5-medium.jpg b/img/st/5-medium.jpg new file mode 100644 index 000000000..ad01d54a3 Binary files /dev/null and b/img/st/5-medium.jpg differ diff --git a/img/st/5-small.jpg b/img/st/5-small.jpg new file mode 100644 index 000000000..e08448060 Binary files /dev/null and b/img/st/5-small.jpg differ diff --git a/img/st/5.jpg b/img/st/5.jpg new file mode 100644 index 000000000..34b45eee6 Binary files /dev/null and b/img/st/5.jpg differ diff --git a/img/st/index.php b/img/st/index.php new file mode 100755 index 000000000..189b03953 --- /dev/null +++ b/img/st/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/su/1-large.jpg b/img/su/1-large.jpg new file mode 100644 index 000000000..f4bbc33c2 Binary files /dev/null and b/img/su/1-large.jpg differ diff --git a/img/su/1-medium.jpg b/img/su/1-medium.jpg new file mode 100644 index 000000000..3f22b4582 Binary files /dev/null and b/img/su/1-medium.jpg differ diff --git a/img/su/1-small.jpg b/img/su/1-small.jpg new file mode 100644 index 000000000..4701b6858 Binary files /dev/null and b/img/su/1-small.jpg differ diff --git a/img/su/1.jpg b/img/su/1.jpg new file mode 100644 index 000000000..223ea51a9 Binary files /dev/null and b/img/su/1.jpg differ diff --git a/img/su/2-large.jpg b/img/su/2-large.jpg new file mode 100644 index 000000000..ee4eb5fa8 Binary files /dev/null and b/img/su/2-large.jpg differ diff --git a/img/su/2-medium.jpg b/img/su/2-medium.jpg new file mode 100644 index 000000000..d80ee0e5e Binary files /dev/null and b/img/su/2-medium.jpg differ diff --git a/img/su/2-small.jpg b/img/su/2-small.jpg new file mode 100644 index 000000000..bdf87c651 Binary files /dev/null and b/img/su/2-small.jpg differ diff --git a/img/su/2.jpg b/img/su/2.jpg new file mode 100644 index 000000000..f64258f9a Binary files /dev/null and b/img/su/2.jpg differ diff --git a/img/su/de-default-large.jpg b/img/su/de-default-large.jpg new file mode 100755 index 000000000..dcc29c8f1 Binary files /dev/null and b/img/su/de-default-large.jpg differ diff --git a/img/su/de-default-medium.jpg b/img/su/de-default-medium.jpg new file mode 100755 index 000000000..c0ee66646 Binary files /dev/null and b/img/su/de-default-medium.jpg differ diff --git a/img/su/de-default-small.jpg b/img/su/de-default-small.jpg new file mode 100755 index 000000000..11e9c3688 Binary files /dev/null and b/img/su/de-default-small.jpg differ diff --git a/img/su/de.jpg b/img/su/de.jpg new file mode 100755 index 000000000..43716f653 Binary files /dev/null and b/img/su/de.jpg differ diff --git a/img/su/en-default-large.jpg b/img/su/en-default-large.jpg new file mode 100644 index 000000000..83f20252e Binary files /dev/null and b/img/su/en-default-large.jpg differ diff --git a/img/su/en-default-medium.jpg b/img/su/en-default-medium.jpg new file mode 100644 index 000000000..13546aa40 Binary files /dev/null and b/img/su/en-default-medium.jpg differ diff --git a/img/su/en-default-small.jpg b/img/su/en-default-small.jpg new file mode 100644 index 000000000..8cb9417b6 Binary files /dev/null and b/img/su/en-default-small.jpg differ diff --git a/img/su/en.jpg b/img/su/en.jpg new file mode 100644 index 000000000..7d07b871d Binary files /dev/null and b/img/su/en.jpg differ diff --git a/img/su/es-default-large.jpg b/img/su/es-default-large.jpg new file mode 100755 index 000000000..83f20252e Binary files /dev/null and b/img/su/es-default-large.jpg differ diff --git a/img/su/es-default-medium.jpg b/img/su/es-default-medium.jpg new file mode 100755 index 000000000..13546aa40 Binary files /dev/null and b/img/su/es-default-medium.jpg differ diff --git a/img/su/es-default-small.jpg b/img/su/es-default-small.jpg new file mode 100755 index 000000000..8cb9417b6 Binary files /dev/null and b/img/su/es-default-small.jpg differ diff --git a/img/su/es.jpg b/img/su/es.jpg new file mode 100755 index 000000000..7d07b871d Binary files /dev/null and b/img/su/es.jpg differ diff --git a/img/su/fr-default-large.jpg b/img/su/fr-default-large.jpg new file mode 100644 index 000000000..a1fb7b9e6 Binary files /dev/null and b/img/su/fr-default-large.jpg differ diff --git a/img/su/fr-default-medium.jpg b/img/su/fr-default-medium.jpg new file mode 100644 index 000000000..485a36c72 Binary files /dev/null and b/img/su/fr-default-medium.jpg differ diff --git a/img/su/fr-default-small.jpg b/img/su/fr-default-small.jpg new file mode 100644 index 000000000..335ddd86f Binary files /dev/null and b/img/su/fr-default-small.jpg differ diff --git a/img/su/fr.jpg b/img/su/fr.jpg new file mode 100644 index 000000000..ed443472f Binary files /dev/null and b/img/su/fr.jpg differ diff --git a/img/su/index.php b/img/su/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/su/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/su/it-default-large.jpg b/img/su/it-default-large.jpg new file mode 100755 index 000000000..97bf6f2f0 Binary files /dev/null and b/img/su/it-default-large.jpg differ diff --git a/img/su/it-default-medium.jpg b/img/su/it-default-medium.jpg new file mode 100755 index 000000000..461031f99 Binary files /dev/null and b/img/su/it-default-medium.jpg differ diff --git a/img/su/it-default-small.jpg b/img/su/it-default-small.jpg new file mode 100755 index 000000000..8c72ec678 Binary files /dev/null and b/img/su/it-default-small.jpg differ diff --git a/img/su/it.jpg b/img/su/it.jpg new file mode 100755 index 000000000..94802add7 Binary files /dev/null and b/img/su/it.jpg differ diff --git a/img/t/0.gif b/img/t/0.gif new file mode 100644 index 000000000..d88478243 Binary files /dev/null and b/img/t/0.gif differ diff --git a/img/t/AdminAccess.gif b/img/t/AdminAccess.gif new file mode 100644 index 000000000..bb0cd495c Binary files /dev/null and b/img/t/AdminAccess.gif differ diff --git a/img/t/AdminAddonsCatalog.gif b/img/t/AdminAddonsCatalog.gif new file mode 100644 index 000000000..2104e0bed Binary files /dev/null and b/img/t/AdminAddonsCatalog.gif differ diff --git a/img/t/AdminAddonsMyAccount.gif b/img/t/AdminAddonsMyAccount.gif new file mode 100644 index 000000000..2104e0bed Binary files /dev/null and b/img/t/AdminAddonsMyAccount.gif differ diff --git a/img/t/AdminAddresses.gif b/img/t/AdminAddresses.gif new file mode 100644 index 000000000..2e0b0e373 Binary files /dev/null and b/img/t/AdminAddresses.gif differ diff --git a/img/t/AdminAliases.gif b/img/t/AdminAliases.gif new file mode 100644 index 000000000..662738879 Binary files /dev/null and b/img/t/AdminAliases.gif differ diff --git a/img/t/AdminAppearance.gif b/img/t/AdminAppearance.gif new file mode 100644 index 000000000..1e5f79e9b Binary files /dev/null and b/img/t/AdminAppearance.gif differ diff --git a/img/t/AdminAttachments.gif b/img/t/AdminAttachments.gif new file mode 100644 index 000000000..0fea309c9 Binary files /dev/null and b/img/t/AdminAttachments.gif differ diff --git a/img/t/AdminAttributesGroups.gif b/img/t/AdminAttributesGroups.gif new file mode 100644 index 000000000..897dc0a63 Binary files /dev/null and b/img/t/AdminAttributesGroups.gif differ diff --git a/img/t/AdminBackup.gif b/img/t/AdminBackup.gif new file mode 100644 index 000000000..15991a4c7 Binary files /dev/null and b/img/t/AdminBackup.gif differ diff --git a/img/t/AdminCMS.gif b/img/t/AdminCMS.gif new file mode 100644 index 000000000..176c99a23 Binary files /dev/null and b/img/t/AdminCMS.gif differ diff --git a/img/t/AdminCMSContent.gif b/img/t/AdminCMSContent.gif new file mode 100644 index 000000000..176c99a23 Binary files /dev/null and b/img/t/AdminCMSContent.gif differ diff --git a/img/t/AdminCarriers.gif b/img/t/AdminCarriers.gif new file mode 100644 index 000000000..482ceea3c Binary files /dev/null and b/img/t/AdminCarriers.gif differ diff --git a/img/t/AdminCarts.gif b/img/t/AdminCarts.gif new file mode 100644 index 000000000..0fadd3c2b Binary files /dev/null and b/img/t/AdminCarts.gif differ diff --git a/img/t/AdminCatalog.gif b/img/t/AdminCatalog.gif new file mode 100644 index 000000000..bc48e2e06 Binary files /dev/null and b/img/t/AdminCatalog.gif differ diff --git a/img/t/AdminContact.gif b/img/t/AdminContact.gif new file mode 100644 index 000000000..7f85b9660 Binary files /dev/null and b/img/t/AdminContact.gif differ diff --git a/img/t/AdminContacts.gif b/img/t/AdminContacts.gif new file mode 100644 index 000000000..2e0b0e373 Binary files /dev/null and b/img/t/AdminContacts.gif differ diff --git a/img/t/AdminCountries.gif b/img/t/AdminCountries.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/t/AdminCountries.gif differ diff --git a/img/t/AdminCounty.gif b/img/t/AdminCounty.gif new file mode 100644 index 000000000..96fbf8379 Binary files /dev/null and b/img/t/AdminCounty.gif differ diff --git a/img/t/AdminCurrencies.gif b/img/t/AdminCurrencies.gif new file mode 100644 index 000000000..a8672a610 Binary files /dev/null and b/img/t/AdminCurrencies.gif differ diff --git a/img/t/AdminCustomerThreads.gif b/img/t/AdminCustomerThreads.gif new file mode 100644 index 000000000..2194c59db Binary files /dev/null and b/img/t/AdminCustomerThreads.gif differ diff --git a/img/t/AdminCustomers.gif b/img/t/AdminCustomers.gif new file mode 100644 index 000000000..2194c59db Binary files /dev/null and b/img/t/AdminCustomers.gif differ diff --git a/img/t/AdminDb.gif b/img/t/AdminDb.gif new file mode 100644 index 000000000..ee12dc40f Binary files /dev/null and b/img/t/AdminDb.gif differ diff --git a/img/t/AdminDeliverySlip.gif b/img/t/AdminDeliverySlip.gif new file mode 100644 index 000000000..5a732a5a6 Binary files /dev/null and b/img/t/AdminDeliverySlip.gif differ diff --git a/img/t/AdminDiscounts.gif b/img/t/AdminDiscounts.gif new file mode 100644 index 000000000..f61d4f7bd Binary files /dev/null and b/img/t/AdminDiscounts.gif differ diff --git a/img/t/AdminEmails.gif b/img/t/AdminEmails.gif new file mode 100644 index 000000000..94ba79d85 Binary files /dev/null and b/img/t/AdminEmails.gif differ diff --git a/img/t/AdminEmployees.gif b/img/t/AdminEmployees.gif new file mode 100644 index 000000000..d1ca455c7 Binary files /dev/null and b/img/t/AdminEmployees.gif differ diff --git a/img/t/AdminFeatures.gif b/img/t/AdminFeatures.gif new file mode 100644 index 000000000..857f861f6 Binary files /dev/null and b/img/t/AdminFeatures.gif differ diff --git a/img/t/AdminGenerator.gif b/img/t/AdminGenerator.gif new file mode 100644 index 000000000..7b277197b Binary files /dev/null and b/img/t/AdminGenerator.gif differ diff --git a/img/t/AdminGeolocalization.gif b/img/t/AdminGeolocalization.gif new file mode 100755 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/t/AdminGeolocalization.gif differ diff --git a/img/t/AdminGeolocation.gif b/img/t/AdminGeolocation.gif new file mode 100644 index 000000000..96fbf8379 Binary files /dev/null and b/img/t/AdminGeolocation.gif differ diff --git a/img/t/AdminGroups.gif b/img/t/AdminGroups.gif new file mode 100644 index 000000000..213f3a2c7 Binary files /dev/null and b/img/t/AdminGroups.gif differ diff --git a/img/t/AdminHome.gif b/img/t/AdminHome.gif new file mode 100644 index 000000000..c5c8f1b7e Binary files /dev/null and b/img/t/AdminHome.gif differ diff --git a/img/t/AdminImages.gif b/img/t/AdminImages.gif new file mode 100644 index 000000000..c33d0e62b Binary files /dev/null and b/img/t/AdminImages.gif differ diff --git a/img/t/AdminImport.gif b/img/t/AdminImport.gif new file mode 100644 index 000000000..23e376a82 Binary files /dev/null and b/img/t/AdminImport.gif differ diff --git a/img/t/AdminInformation.gif b/img/t/AdminInformation.gif new file mode 100644 index 000000000..c8c2fbc90 Binary files /dev/null and b/img/t/AdminInformation.gif differ diff --git a/img/t/AdminInvoices.gif b/img/t/AdminInvoices.gif new file mode 100644 index 000000000..f2d449b1d Binary files /dev/null and b/img/t/AdminInvoices.gif differ diff --git a/img/t/AdminLanguages.gif b/img/t/AdminLanguages.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/t/AdminLanguages.gif differ diff --git a/img/t/AdminLocalization.gif b/img/t/AdminLocalization.gif new file mode 100644 index 000000000..c1d63637f Binary files /dev/null and b/img/t/AdminLocalization.gif differ diff --git a/img/t/AdminLogs.gif b/img/t/AdminLogs.gif new file mode 100755 index 000000000..e5df19aaf Binary files /dev/null and b/img/t/AdminLogs.gif differ diff --git a/img/t/AdminManufacturers.gif b/img/t/AdminManufacturers.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/img/t/AdminManufacturers.gif differ diff --git a/img/t/AdminMessages.gif b/img/t/AdminMessages.gif new file mode 100644 index 000000000..2e0b0e373 Binary files /dev/null and b/img/t/AdminMessages.gif differ diff --git a/img/t/AdminMeta.gif b/img/t/AdminMeta.gif new file mode 100644 index 000000000..0a6f7d589 Binary files /dev/null and b/img/t/AdminMeta.gif differ diff --git a/img/t/AdminModules.gif b/img/t/AdminModules.gif new file mode 100644 index 000000000..3061be7d4 Binary files /dev/null and b/img/t/AdminModules.gif differ diff --git a/img/t/AdminModulesPositions.gif b/img/t/AdminModulesPositions.gif new file mode 100644 index 000000000..8b043ca74 Binary files /dev/null and b/img/t/AdminModulesPositions.gif differ diff --git a/img/t/AdminOrderMessage.gif b/img/t/AdminOrderMessage.gif new file mode 100644 index 000000000..fe8e87068 Binary files /dev/null and b/img/t/AdminOrderMessage.gif differ diff --git a/img/t/AdminOrders.gif b/img/t/AdminOrders.gif new file mode 100644 index 000000000..be9175d6f Binary files /dev/null and b/img/t/AdminOrders.gif differ diff --git a/img/t/AdminPDF.gif b/img/t/AdminPDF.gif new file mode 100644 index 000000000..d5d9488f3 Binary files /dev/null and b/img/t/AdminPDF.gif differ diff --git a/img/t/AdminPPreferences.gif b/img/t/AdminPPreferences.gif new file mode 100644 index 000000000..be9175d6f Binary files /dev/null and b/img/t/AdminPPreferences.gif differ diff --git a/img/t/AdminPayment.gif b/img/t/AdminPayment.gif new file mode 100644 index 000000000..de6b15204 Binary files /dev/null and b/img/t/AdminPayment.gif differ diff --git a/img/t/AdminPerformance.gif b/img/t/AdminPerformance.gif new file mode 100644 index 000000000..7d865ed9b Binary files /dev/null and b/img/t/AdminPerformance.gif differ diff --git a/img/t/AdminPreferences.gif b/img/t/AdminPreferences.gif new file mode 100644 index 000000000..c2e2f68e5 Binary files /dev/null and b/img/t/AdminPreferences.gif differ diff --git a/img/t/AdminProfiles.gif b/img/t/AdminProfiles.gif new file mode 100644 index 000000000..1b909d4a5 Binary files /dev/null and b/img/t/AdminProfiles.gif differ diff --git a/img/t/AdminQuickAccesses.gif b/img/t/AdminQuickAccesses.gif new file mode 100644 index 000000000..d876e5e9c Binary files /dev/null and b/img/t/AdminQuickAccesses.gif differ diff --git a/img/t/AdminRangePrice.gif b/img/t/AdminRangePrice.gif new file mode 100644 index 000000000..a8672a610 Binary files /dev/null and b/img/t/AdminRangePrice.gif differ diff --git a/img/t/AdminRangeWeight.gif b/img/t/AdminRangeWeight.gif new file mode 100644 index 000000000..3583c0303 Binary files /dev/null and b/img/t/AdminRangeWeight.gif differ diff --git a/img/t/AdminReferrers.gif b/img/t/AdminReferrers.gif new file mode 100644 index 000000000..b0a077d65 Binary files /dev/null and b/img/t/AdminReferrers.gif differ diff --git a/img/t/AdminReturn.gif b/img/t/AdminReturn.gif new file mode 100644 index 000000000..198a934a3 Binary files /dev/null and b/img/t/AdminReturn.gif differ diff --git a/img/t/AdminScenes.gif b/img/t/AdminScenes.gif new file mode 100644 index 000000000..4221ace66 Binary files /dev/null and b/img/t/AdminScenes.gif differ diff --git a/img/t/AdminSearch.gif b/img/t/AdminSearch.gif new file mode 100644 index 000000000..6ddb543b8 Binary files /dev/null and b/img/t/AdminSearch.gif differ diff --git a/img/t/AdminSearchConf.gif b/img/t/AdminSearchConf.gif new file mode 100644 index 000000000..63b11643c Binary files /dev/null and b/img/t/AdminSearchConf.gif differ diff --git a/img/t/AdminSearchEngines.gif b/img/t/AdminSearchEngines.gif new file mode 100644 index 000000000..d5dd1e7b2 Binary files /dev/null and b/img/t/AdminSearchEngines.gif differ diff --git a/img/t/AdminShipping.gif b/img/t/AdminShipping.gif new file mode 100644 index 000000000..482ceea3c Binary files /dev/null and b/img/t/AdminShipping.gif differ diff --git a/img/t/AdminSlip.gif b/img/t/AdminSlip.gif new file mode 100644 index 000000000..e5df19aaf Binary files /dev/null and b/img/t/AdminSlip.gif differ diff --git a/img/t/AdminStates.gif b/img/t/AdminStates.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/t/AdminStates.gif differ diff --git a/img/t/AdminStats.gif b/img/t/AdminStats.gif new file mode 100644 index 000000000..9102f3a81 Binary files /dev/null and b/img/t/AdminStats.gif differ diff --git a/img/t/AdminStatsConf.gif b/img/t/AdminStatsConf.gif new file mode 100644 index 000000000..414f98790 Binary files /dev/null and b/img/t/AdminStatsConf.gif differ diff --git a/img/t/AdminStatsModules.gif b/img/t/AdminStatsModules.gif new file mode 100644 index 000000000..db0f5067e Binary files /dev/null and b/img/t/AdminStatsModules.gif differ diff --git a/img/t/AdminStatuses.gif b/img/t/AdminStatuses.gif new file mode 100644 index 000000000..f15768f13 Binary files /dev/null and b/img/t/AdminStatuses.gif differ diff --git a/img/t/AdminStockMvt.gif b/img/t/AdminStockMvt.gif new file mode 100755 index 000000000..2a85c456c Binary files /dev/null and b/img/t/AdminStockMvt.gif differ diff --git a/img/t/AdminStores.gif b/img/t/AdminStores.gif new file mode 100644 index 000000000..574ca9161 Binary files /dev/null and b/img/t/AdminStores.gif differ diff --git a/img/t/AdminSubDomains.gif b/img/t/AdminSubDomains.gif new file mode 100644 index 000000000..8554b38b5 Binary files /dev/null and b/img/t/AdminSubDomains.gif differ diff --git a/img/t/AdminSuppliers.gif b/img/t/AdminSuppliers.gif new file mode 100644 index 000000000..e5cb1f263 Binary files /dev/null and b/img/t/AdminSuppliers.gif differ diff --git a/img/t/AdminTabs.gif b/img/t/AdminTabs.gif new file mode 100644 index 000000000..492754058 Binary files /dev/null and b/img/t/AdminTabs.gif differ diff --git a/img/t/AdminTags.gif b/img/t/AdminTags.gif new file mode 100644 index 000000000..a01d9ea43 Binary files /dev/null and b/img/t/AdminTags.gif differ diff --git a/img/t/AdminTaxRulesGroup.gif b/img/t/AdminTaxRulesGroup.gif new file mode 100755 index 000000000..b91777ebb Binary files /dev/null and b/img/t/AdminTaxRulesGroup.gif differ diff --git a/img/t/AdminTaxes.gif b/img/t/AdminTaxes.gif new file mode 100644 index 000000000..b91777ebb Binary files /dev/null and b/img/t/AdminTaxes.gif differ diff --git a/img/t/AdminThemes.gif b/img/t/AdminThemes.gif new file mode 100644 index 000000000..1e5f79e9b Binary files /dev/null and b/img/t/AdminThemes.gif differ diff --git a/img/t/AdminTools.gif b/img/t/AdminTools.gif new file mode 100644 index 000000000..dd772b72c Binary files /dev/null and b/img/t/AdminTools.gif differ diff --git a/img/t/AdminTracking.gif b/img/t/AdminTracking.gif new file mode 100644 index 000000000..c3cbb5dfb Binary files /dev/null and b/img/t/AdminTracking.gif differ diff --git a/img/t/AdminTranslations.gif b/img/t/AdminTranslations.gif new file mode 100644 index 000000000..af91f09a4 Binary files /dev/null and b/img/t/AdminTranslations.gif differ diff --git a/img/t/AdminWebservice.gif b/img/t/AdminWebservice.gif new file mode 100644 index 000000000..a37e6ddce Binary files /dev/null and b/img/t/AdminWebservice.gif differ diff --git a/img/t/AdminZones.gif b/img/t/AdminZones.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/img/t/AdminZones.gif differ diff --git a/img/t/index.php b/img/t/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/t/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/tmp/index.php b/img/tmp/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/img/tmp/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/img/tmp/order_state_mini_11.gif b/img/tmp/order_state_mini_11.gif new file mode 100644 index 000000000..57abc204b Binary files /dev/null and b/img/tmp/order_state_mini_11.gif differ diff --git a/img/tmp/store_1.jpg b/img/tmp/store_1.jpg new file mode 100644 index 000000000..c8ecc8811 Binary files /dev/null and b/img/tmp/store_1.jpg differ diff --git a/img/tmp/store_2.jpg b/img/tmp/store_2.jpg new file mode 100644 index 000000000..c8ecc8811 Binary files /dev/null and b/img/tmp/store_2.jpg differ diff --git a/img/tmp/store_3.jpg b/img/tmp/store_3.jpg new file mode 100644 index 000000000..c8ecc8811 Binary files /dev/null and b/img/tmp/store_3.jpg differ diff --git a/img/tmp/store_4.jpg b/img/tmp/store_4.jpg new file mode 100644 index 000000000..c8ecc8811 Binary files /dev/null and b/img/tmp/store_4.jpg differ diff --git a/index.php b/index.php new file mode 100644 index 000000000..47cef0884 --- /dev/null +++ b/index.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require(dirname(__FILE__).'/config/config.inc.php'); +ControllerFactory::getController('IndexController')->run(); diff --git a/init.php b/init.php new file mode 100644 index 000000000..ff61af756 --- /dev/null +++ b/init.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$controller = new FrontController(); +$controller->init(); \ No newline at end of file diff --git a/install-dev/classes/AddConfToFile.php b/install-dev/classes/AddConfToFile.php new file mode 100644 index 000000000..00aeb72ed --- /dev/null +++ b/install-dev/classes/AddConfToFile.php @@ -0,0 +1,91 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AddConfToFile +{ + public $fd; + public $file; + public $mode; + public $error = false; + + public function __construct($file, $mode = 'r+') + { + $this->file = $file; + $this->mode = $mode; + $this->checkFile($file); + if ($mode == 'w' AND !$this->error) + if (!$res = @fwrite($this->fd, 'error = 6; + } + + public function __destruct() + { + if (!$this->error) + @fclose($this->fd); + } + + private function checkFile($file) + { + if (!$fd = @fopen($this->file, $this->mode)) + $this->error = 5; + elseif (!is_writable($this->file)) + $this->error = 6; + $this->fd = $fd; + } + + public function writeInFile($name, $data) + { + if (!$res = @fwrite($this->fd, + 'define(\''.$name.'\', \''.$this->checkString($data).'\');'."\n")) + { + $this->error = 6; + return false; + } + return true; + } + + public function writeEndTagPhp() + { + if (!$res = @fwrite($this->fd, '?>'."\n")) { + $this->error = 6; + return false; + } + return true; + } + + public function checkString($string) + { + if (get_magic_quotes_gpc()) + $string = stripslashes($string); + if (!is_numeric($string)) + { + $string = addslashes($string); + $string = strip_tags(nl2br($string)); + } + return $string; + } +} diff --git a/install-dev/classes/ConfigurationTest.php b/install-dev/classes/ConfigurationTest.php new file mode 100644 index 000000000..c150a67f4 --- /dev/null +++ b/install-dev/classes/ConfigurationTest.php @@ -0,0 +1,215 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ConfigurationTest +{ + static function check($tests) + { + $res = array(); + foreach ($tests AS $key => $test) + $res[$key] = self::run($key, $test); + return $res; + } + + static function run($ptr, $arg = 0) + { + if (call_user_func(array('ConfigurationTest', 'test_'.$ptr), $arg)) + return ('ok'); + return ('fail'); + } + + // Misc functions + static function test_phpversion() + { + return version_compare(substr(phpversion(), 0, 3), '5.0', '>='); + } + + static function test_mysql_support() + { + return function_exists('mysql_connect'); + } + + static function test_upload() + { + return ini_get('file_uploads'); + } + + static function test_fopen() + { + return ini_get('allow_url_fopen'); + } + + static function test_system($funcs) + { + foreach ($funcs AS $func) + if (!function_exists($func)) + return false; + return true; + } + + static function test_gd() + { + return function_exists('imagecreatetruecolor'); + } + + static function test_register_globals() + { + return !ini_get('register_globals'); + } + + static function test_gz() + { + if (function_exists('gzencode')) + return !(@gzencode('dd') === false); + return false; + } + + // is_writable dirs + static function test_dir($dir, $recursive = false) + { + if (!file_exists($dir) OR !$dh = opendir($dir)) + return false; + $dummy = rtrim($dir, '/').'/'.uniqid(); + if (@file_put_contents($dummy, 'test')) + { + @unlink($dummy); + if (!$recursive) + return true; + } + elseif (!is_writable($dir)) + return false; + if ($recursive) + { + while (($file = readdir($dh)) !== false) + if (@filetype($dir.$file) == 'dir' AND $file != '.' AND $file != '..') + if (!self::test_dir($dir.$file, true)) + return false; + } + closedir($dh); + return true; + } + + // is_writable files + static function test_file($file) + { + return (file_exists($file) AND is_writable($file)); + } + + static function test_config_dir($dir) + { + return self::test_dir($dir); + } + + static function test_sitemap($dir) + { + return self::test_file($dir); + } + + static function test_root_dir($dir) + { + return self::test_dir($dir); + } + + static function test_admin_dir($dir) + { + return self::test_dir($dir); + } + + static function test_img_dir($dir) + { + return self::test_dir($dir, true); + } + + static function test_module_dir($dir) + { + return self::test_dir($dir, true); + } + + static function test_tools_dir($dir) + { + return self::test_dir($dir); + } + + static function test_cache_dir($dir) + { + return self::test_dir($dir); + } + + static function test_tools_v2_dir($dir) + { + return self::test_dir($dir); + } + + static function test_cache_v2_dir($dir) + { + return self::test_dir($dir); + } + + static function test_download_dir($dir) + { + return self::test_dir($dir); + } + + static function test_mails_dir($dir) + { + return self::test_dir($dir, true); + } + + static function test_translations_dir($dir) + { + return self::test_dir($dir, true); + } + + static function test_theme_lang_dir($dir) + { + if (!file_exists($dir)) + return true; + return self::test_dir($dir, true); + } + + static function test_theme_cache_dir($dir) + { + if (!file_exists($dir)) + return true; + return self::test_dir($dir, true); + } + + static function test_customizable_products_dir($dir) + { + return self::test_dir($dir); + } + + static function test_virtual_products_dir($dir) + { + return self::test_dir($dir); + } + + static function test_mcrypt() + { + return function_exists('mcrypt_encrypt'); + } +} diff --git a/install-dev/classes/LanguagesManager.php b/install-dev/classes/LanguagesManager.php new file mode 100644 index 000000000..e381968f0 --- /dev/null +++ b/install-dev/classes/LanguagesManager.php @@ -0,0 +1,105 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once("../classes/Validate.php"); + +class LanguageManager +{ + private $url_xml; + private $lang; + private $xml_file; + + function __construct ($url_xml) + { + $this->loadXML($url_xml); + $this->setLanguage(); + $this->getIncludeTradFilename(); + } + + private function loadXML($url_xml) + { + global $errors; + if (!$this->xml_file = simplexml_load_file($url_xml)) + $errors = 'Error when loading XML language file : '.$url_xml; + } + + public function getIdSelectedLang() + { + return $this->lang['id']; + } + + public function getIsoCodeSelectedLang() + { + return $this->lang->idLangPS; + } + + public function countLangs() + { + return sizeof($this->xml_file); + } + + public function getAvailableLangs() + { + return $this->xml_file; + } + + public function getSelectedLang() + { + return $this->lang; + } + + private function getIdByHAL(){ + + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + $FirstHAL = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + $iso = $FirstHAL[0]; + if ($iso != "en-us") + foreach ($this->xml_file as $lang) + foreach ($lang->isos->iso as $anIso) + if ($anIso == $iso) + return $lang['id']; + } + else + return 0; + + } + + private function setLanguage() + { + if( isset($_GET['language']) AND Validate::isInt($_GET['language'])) + $id_lang = (int)($_GET['language']); + if (!isset($id_lang)) + $id_lang = ($this->getIdByHAL()); + $this->lang = $this->xml_file->lang[(int)($id_lang)]; + } + + public function getIncludeTradFilename() + { + return ($this->lang == NULL) ? false : dirname(__FILE__).$this->lang['trad_file']; + } +} \ No newline at end of file diff --git a/install-dev/classes/ToolsInstall.php b/install-dev/classes/ToolsInstall.php new file mode 100644 index 000000000..4561dd953 --- /dev/null +++ b/install-dev/classes/ToolsInstall.php @@ -0,0 +1,189 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +class ToolsInstall +{ + public static function checkDB ($srv, $login, $password, $name, $posted = true, $engine = false) + { + include_once(INSTALL_PATH.'/../classes/Validate.php'); + include_once(INSTALL_PATH.'/../classes/Db.php'); + include_once(INSTALL_PATH.'/../classes/MySQL.php'); + + if($posted) + { + // Check POST data... + $data_check = array( + !isset($_GET['server']) OR empty($_GET['server']), + !Validate::isMailName($_GET['server']), + !isset($_GET['type']) OR empty($_GET['type']), + !Validate::isMailName($_GET['type']), + !isset($_GET['name']) OR empty($_GET['name']), + !Validate::isMailName($_GET['name']), + !isset($_GET['login']) OR empty($_GET['login']), + !Validate::isMailName($_GET['login']), + !isset($_GET['password']) + ); + foreach ($data_check AS $data) + if ($data) + return 8; + } + + switch(MySQL::tryToConnect(trim($srv), trim($login), trim($password), trim($name), trim($engine))) + { + case 0: + if (MySQL::tryUTF8(trim($srv), trim($login), trim($password))) + return true; + return 49; + break; + case 1: + return 25; + break; + case 2: + return 24; + break; + case 3: + return 50; + break; + } + } + + public static function getHttpHost($http = false, $entities = false) + { + $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); + if ($entities) + $host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8'); + if ($http) + $host = 'http://'.$host; + return $host; + } + + public static function sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption) + { + include(INSTALL_PATH.'/../tools/swift/Swift.php'); + include(INSTALL_PATH.'/../tools/swift/Swift/Connection/SMTP.php'); + include(INSTALL_PATH.'/../tools/swift/Swift/Connection/NativeMail.php'); + + $swift = NULL; + $result = NULL; + try + { + + if($smtpChecked) + { + + $smtp = new Swift_Connection_SMTP($smtpServer, $smtpPort, ($smtpEncryption == "off") ? Swift_Connection_SMTP::ENC_OFF : (($smtpEncryption == "tls") ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_SSL)); + $smtp->setUsername($smtpLogin); + $smtp->setpassword($smtpPassword); + $smtp->setTimeout(5); + $swift = new Swift($smtp); + } + else + { + $swift = new Swift(new Swift_Connection_NativeMail()); + } + + $message = new Swift_Message($subject, $content, $type); + + if ($swift->send($message, $to, $from)) + { + $result = true; + } + else + { + $result = 999; + } + $swift->disconnect(); + } + catch (Swift_Connection_Exception $e) + { + $result = $e->getCode(); + } + catch (Swift_Message_MimeException $e) + { + $result = $e->getCode(); + } + return $result; + } + + public static function getNotificationMail($shopName, $shopUrl, $shopLogo, $firstname, $lastname, $password, $email) + { + $iso_code = $_GET['isoCodeLocalLanguage']; + $pathTpl = INSTALL_PATH.'/../mails/en/employee_password.html'; + $pathTplLocal = INSTALL_PATH.'/../mails/'.$iso_code.'/employee_password.html'; + + $content = (file_exists($pathTplLocal)) ? file_get_contents($pathTplLocal) : file_get_contents($pathTpl); + $content = str_replace('{shop_name}', $shopName, $content); + $content = str_replace('{shop_url}', $shopUrl, $content); + $content = str_replace('{shop_logo}', $shopLogo, $content); + $content = str_replace('{firstname}', $firstname, $content); + $content = str_replace('{lastname}', $lastname, $content); + $content = str_replace('{passwd}', $password, $content); + $content = str_replace('{email}', $email, $content); + return $content; + } + + public static function getLangString($idLang) + { + switch ($idLang) + { + case 'en' : return 'English (English)'; + case 'fr' : return 'Français (French)'; + } + } + + static function strtolower($str) + { + if (function_exists('mb_strtolower')) + return mb_strtolower($str, 'utf-8'); + return strtolower($str); + } + + static function strtoupper($str) + { + if (function_exists('mb_strtoupper')) + return mb_strtoupper($str, 'utf-8'); + return strtoupper($str); + } + + static function ucfirst($str) + { + return self::strtoupper(self::substr($str, 0, 1)).self::substr($str, 1); + } + + static function substr($str, $start, $length = false, $encoding = 'utf-8') + { + if (function_exists('mb_substr')) + return mb_substr($str, $start, ($length === false ? self::strlen($str) : $length), $encoding); + return substr($str, $start, $length); + } + + static function strlen($str) + { + if (function_exists('mb_strlen')) + return mb_strlen($str, 'utf-8'); + return strlen($str); + } +} diff --git a/install-dev/controller.js b/install-dev/controller.js new file mode 100644 index 000000000..84694d42b --- /dev/null +++ b/install-dev/controller.js @@ -0,0 +1,1032 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +//constant +verifMailREGEX = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/; +verifNameREGEX = /^[^0-9!<>,;?=+()@#"°{}_$%:]*$/; + +//params +configIsOk = false; +createdBase = false; +mailIsOk = false; +smtpChecked = false; +validShopInfos = false; +upgradeCertify = false; +dropdb=false; +application="install"; + +function nextTab() +{ + if(verifyThisStep()) + { + showStep(step+1, 'next'); + } +} +function backTab() +{ + if (step != 6) { + showStep(step - 1, 'back'); + } + else { + constructInstallerTabs(); + showStep(1, 'back'); + } +} + +function showStep(aStep, way) +{ + step = aStep; + + //show the sheet + $('div.sheet.shown').fadeOut('fast', function() { + $($('div.sheet')[(step-1)]).fadeIn('slow').addClass('shown'); + }).removeClass('shown'); + + //upgrade the tab + $('#tabs li') + .removeClass("selected") + .removeClass("finished"); + if (step < 6) { + $('#tabs li:nth-child(' + step + ')').addClass("selected"); + $('#tabs li:lt(' + (step - 1) + ')').addClass("finished"); + } + else + { + switch (step) + { + + case 6 : + $('#tabs li:nth-child(1)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(2)').addClass("selected").removeClass("finished"); + $('#tabs li:nth-child(3)').removeClass("selected").removeClass("finished"); + $('#tabs li:nth-child(4)').removeClass("selected").removeClass("finished"); + break; + + case 7 : + $('#tabs li:nth-child(1)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(2)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(3)').addClass("selected").removeClass("finished"); + $('#tabs li:nth-child(4)').removeClass("selected").removeClass("finished"); + break; + + case 8 : + $('#tabs li:nth-child(1)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(2)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(3)').addClass("selected").removeClass("finished"); + $('#tabs li:nth-child(4)').removeClass("selected").removeClass("finished"); + break; + + case 9 : + $('#tabs li:nth-child(1)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(2)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(3)').removeClass("selected").addClass("finished"); + $('#tabs li:nth-child(4)').addClass("selected").removeClass("finished"); + break; + + } + } + + //title of the window and buttons + switch(step) + { + case 1 : + document.title = Step1Title; + $("#btBack") + .attr("disabled", "disabled") + .addClass("disabled") + .show('slow'); + $("#btNext") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 2: + document.title = step2title; + application = "install"; + if (way == 'next') + verifyAndSetRequire(1); + else + verifyAndSetRequire(0); + $("#btBack") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 3: + document.title = step3title; + $("#btBack") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 4: + document.title = step4title; + $("#btBack") + .attr("disabled", "disabled") + .addClass("disabled") + .hide('slow'); + break; + + case 5 : + document.title = step5title; + $("#btBack") + .attr("disabled", "disabled") + .addClass("disabled") + .hide('slow'); + $("#btNext").hide('slow'); + break; + + case 6 : + document.title = step6title; + application = "update"; + if (!upgradeCertify) { + $("#btNext") + .attr("disabled", "disabled") + .addClass("disabled"); + } else { + $("#btNext") + .removeAttr("disabled") + .removeClass("disabled"); + } + $("#btBack") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 7: + document.title = step7title; + verifyAndSetRequire(0); + $("#btBack") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 8 : + document.title = step8title; + $("#btNext") + .attr("disabled", "disabled") + .addClass("disabled"); + $("#btBack") + .removeAttr("disabled") + .removeClass("disabled") + .show('slow'); + break; + + case 9 : + document.title = step9title; + $("#btBack").hide(); + $("#btNext").hide(); + break; + } +} + +function verifyThisStep() +{ + switch (step) + { + case 1 : + if($("#formSetMethod input[type=radio]:checked").val() == "install" ){ + showStep(2, 'next'); + } + else + { + constructUpdaterTabs(); + showStep(6, 'next'); + } + return false; + break; + + case 2 : + return configIsOk; + break; + + case 3 : + createDB(); + return false; + break; + + case 4 : + verifyShopInfos(); + return validShopInfos; + break; + + case 6 : + return true; + break; + + case 7 : + doUpgrade(); + break; + + } + +} + +function setInstallerLanguage () +{ + $("#formSetInstallerLanguage").submit(); +} + +function verifyAndSetRequire(firsttime) +{ + $("div#"+(application == "install" ? "sheet_require" : "sheet_require_update")+" > ul").slideUp("1500"); + $.ajax( + { + url: "model.php", + data: "method=checkConfig&firsttime="+firsttime, + success: function(ret) + { + isUpdate = application == "install" ? "" : "_update"; + testLists = ret.getElementsByTagName('testList'); + + configIsOk = true; + + testListRequired = testLists[0].getElementsByTagName('test'); + for (i = 0; i < testListRequired.length; i++){ + result = testListRequired[i].getAttribute("result"); + $($("div#sheet_require"+isUpdate+" > ul#required"+isUpdate+" .required")[i]) + .removeClass( (result == "fail") ? "ok" : "fail" ) + .addClass(result); + if (result == "fail") configIsOk = false; + } + + + testListOptional = testLists[1].getElementsByTagName('test'); + + for (i = 0; i < testListOptional.length; i++){ + result = testListOptional[i].getAttribute("result"); + $($("div#sheet_require"+isUpdate+" > ul#optional"+isUpdate+" li.optional")[i]) + .removeClass( (result == "fail") ? "ok" : "fail" ) + .addClass(result); + } + + if (!configIsOk) { + $('#btNext').attr({'disabled':'disabled','class':'button little disabled'}); + $('h3#resultConfig'+isUpdate).html(txtConfigIsNotOk).slideDown('slow'); + $('h3#resultConfigHelper').show(); + $("div#sheet_require"+isUpdate+" > ul").slideDown("1500"); + } else { + $("#btNext").removeAttr('disabled'); + $('#btNext').removeClass('disabled'); + $("input#btNext").focus(); + var firsttime = ret.getElementsByTagName('firsttime'); + if (firsttime && firsttime[0].getAttribute("value") == 1) + $("input#btNext").click(); + else + { + $('h3#resultConfig'+isUpdate).html(txtConfigIsOk).slideDown('slow'); + $('h3#resultConfigHelper').hide(); + $("div#sheet_require"+isUpdate+" > ul").slideDown("1500"); + } + } + } + } + ); +} + +function verifyDbAccess () +{ + //local verifications + if($("#dbServer[value=]").length > 0) + { + $("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbServerEmpty).show('slow'); + return false; + } + else + { + $("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html(''); + } + + if($("#dbLogin[value=]").length > 0) + { + $("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbLoginEmpty).show('slow'); + return false; + } + else + { + $("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html(''); + } + + if($("#dbName[value=]").length > 0) + { + $("#dbResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtDbNameEmpty).show('slow'); + return false; + } + else + { + $("#dbResultCheck").removeClass("fail").removeClass("ok").removeClass('userInfos').html(''); + } + + //external verifications and sets + $.ajax( + { + cache: false, + url: "model.php", + data: + "method=checkDB" + +"&type=MySQL" + +"&server="+ $("#dbServer").val() + +"&login="+ $("#dbLogin").val() + +"&password="+encodeURIComponent($("#dbPassword").val()) + +"&engine="+$("#dbEngine option:selected").val() + +"&name="+ $("#dbName").val(), + success: function(ret) + { + ret = ret.getElementsByTagName('action')[0]; + if (ret.getAttribute("result") == "ok") + { + $("#dbResultCheck") + .addClass("ok") + .removeClass("fail") + .html(txtError[23]) + .show('slow'); + $("#dbCreateResultCheck") + .hide('slow'); + } else + { + $("#dbResultCheck") + .addClass("fail") + .removeClass("ok") + .html(txtError[parseInt(ret.getAttribute("error"))]) + .show('slow'); + $("#dbCreateResultCheck") + .hide('slow'); + } + } + } + ); + +} + +function createDB() +{ + $("#dbResultCheck").hide(); + $.ajax( + { + url: "model.php", + cache: false, + data: + "method=createDB" + +"&tablePrefix="+ $("#db_prefix").val() + +"&mode="+ $("#dbTableParam input[type=radio]:checked").val()+ + "&type=MySQL"+ + "&server="+ $("#dbServer").val()+ + "&login="+ $("#dbLogin").val()+ + "&password="+encodeURIComponent($("#dbPassword").val())+ + "&engine="+$("#dbEngine option:selected").val()+ + "&name="+ $("#dbName").val()+ + "&language="+ id_lang+ + (dropdb ? "&dropAndCreate=true" : '') + , + success: function(ret) + { + var action_ret; + try { + action_ret = ret.getElementsByTagName('action')[0]; + } catch (e) { + $("#dbCreateResultCheck") + .addClass("fail") + .removeClass("ok") + .removeClass('userInfos') + .html(ret) + .show(); + return; + } + if (action_ret.getAttribute("result") == "ok") + { + var countries_ret = ret.getElementsByTagName('country'); + var timezone_ret = ret.getElementsByTagName('timezone'); + var html = ''; + for (i = 0; countries_ret[i]; i=i+1) + { + html = html + ''; + } + $('#infosCountry').html(html); + html = ''; + for (i = 0; timezone_ret[i]; i=i+1) + { + html = html + ''; + } + $('#infosTimezone').html(html); + showStep(step+1, 'next'); + } + else + { + if (action_ret.getAttribute("error") == "11") + { + $("#dbCreateResultCheck") + .addClass("fail") + .removeClass("ok") + .removeClass('userInfos') + .html( + txtError[11]+ "
\'"+ + action_ret.getAttribute("sqlQuery") + "\'
"+ + action_ret.getAttribute("sqlMsgError") + "(" + txtError[18] + " : " + action_ret.getAttribute("sqlNumberError") +")" + ) + .show(); + } + else + { + $("#dbCreateResultCheck") + .addClass("fail") + .removeClass("ok") + .removeClass('userInfos') + .html(txtError[parseInt(action_ret.getAttribute("error"))]) + .show(); + } + } + } + }); +} + + +function verifyMail() +{ + //local verifications + if ($("#testEmail[value=]").length > 0) + { + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[0]); + return false; + } + else if (!verifMailREGEX.test( $("#testEmail").val() )) + { + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[3]); + return false; + } + else + { + + if (smtpChecked) + { + //local verifications + if($("#smtpSrv[value=]").length > 0) + { + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtSmtpSrvEmpty); + smtpIsOk = false; + return false; + } + } + + + //external verifications and sets + $.ajax( + { + url: "model.php", + cache: false, + data: + "method=checkMail"+ + "&mailMethod= "+(smtpChecked ? "smtp" : "native")+ + "&smtpSrv="+ $("input#smtpSrv").val()+ + "&testEmail="+ $("#testEmail").val()+ + "&smtpLogin="+ $("input#smtpLogin").val()+ + "&smtpPassword="+ $("input#smtpPassword").val()+ + "&smtpPort="+ $("input#smtpPort").val()+ + "&smtpEnc="+ $("select#smtpEnc option:selected").val()+ + "&testMsg="+testMsg+ + "&testSubject="+testSubject + , + success: function(ret) + { + ret = ret.getElementsByTagName('action')[0]; + + if (ret.getAttribute("result") == "ok") + { + $("#mailResultCheck").addClass("ok").removeClass("fail").removeClass('userInfos').html(mailSended); + mailIsOk = true; + } + else + { + mailIsOk = false; + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(txtError[26]); + } + } + } + ); + } +} + +function uploadLogo () +{ + $.ajaxFileUpload + ( + { + url:'xml/uploadLogo.php', + secureuri:false, + fileElementId:'fileToUpload', + dataType: 'json', + success: function (data, status) + { + if(typeof(data.error) != 'undefined') + { + $("#uploadedImage").slideUp('slow', function() + { + if(data.error != '') + { + $("#resultInfosLogo").html( txtError[parseInt(data.error)] ).addClass("fail").show(); + } + else + { + $(this).attr('src', ps_base_uri + 'img/logo.jpg?' + (new Date())) + $(this).show('slow'); + $("#resultInfosLogo").html("").removeClass("fail").hide(); + } + }); + } + }, + error: function (data, status, e) + { + $("#uploadedImage").attr('src', ps_base_uri + 'img/logo.jpg?' + (new Date())); + $("#resultInfosLogo").html("").addClass("fail"); + } + } + ) +} + +function moveLanguage(direction) +{ + + switch (direction) + { + + case "al2wl" : + $("#aLList option:selected").each( + function() + { + $(this).appendTo("#wLList"); + $(this).clone().prependTo("#dLList"); + } + ); + + break; + + case "wl2al" : + if ($("#wLList option").length > 1) + { + $("#wLList option:selected").each( + function() + { + if($(this).val() != "en" ) + { + $(this).appendTo("#aLList"); + $("#dLList option[value = '" + $(this).attr('value') + "']").remove(); + } + } + ); + } + break; + } +} + +function ajaxRefreshField(nthField, idResultField, fieldsList, inputId) +{ + var result = fieldsList[nthField].getAttribute("result"); + if (result != "ok") + { + $("#"+idResultField) + .html( txtError[parseInt(fieldsList[nthField].getAttribute("error"))] ) + .addClass("fail") + .show("slow"); + if (validShopInfos) + $("#"+inputId).focus(); + return false; + } + else + { + $("#"+idResultField) + .html("") + .removeClass("fail") + .show("slow"); + return true; + } +} + +function verifyShopInfos() +{ + urlLanguages = ""; + $("#wLList option").each( + function() + { + urlLanguages += "&infosWL[]=" + $(this).val(); + } + ); + urlLanguages += "&infosDL[]=" + $("#dLList option:selected").val(); + + $.ajax( + { + url: "model.php", + async: false, + cache: false, + data: + "method=checkShopInfos"+ + "&isoCode="+isoCodeLocalLanguage+ + "&infosActivity="+ encodeURIComponent($("select#infosActivity").val())+ + "&infosCountry="+ encodeURIComponent($("select#infosCountry").val())+ + "&infosTimezone="+ encodeURIComponent($("select#infosTimezone").val())+ + "&infosShop="+ encodeURIComponent($("input#infosShop").val())+ + "&infosFirstname="+ encodeURIComponent($("input#infosFirstname").val())+ + "&infosName="+ encodeURIComponent($("input#infosName").val())+ + "&infosEmail="+ encodeURIComponent($("input#infosEmail").val())+ + "&infosPassword="+ encodeURIComponent($("input#infosPassword").val())+ + "&infosPasswordRepeat="+ encodeURIComponent($("input#infosPasswordRepeat").val())+ + "&infosNotification="+ ( ($("#infosNotification:checked").length > 0) ? "on" : "off" )+ + "&countryName="+encodeURIComponent($("select#infosCountry option:selected").attr('rel'))+ + urlLanguages+ + "&catalogMode="+ encodeURIComponent($("input[name=catalogMode]:checked").val())+ + "&infosMailMethod=" + ((smtpChecked) ? "smtp" : "native")+ + "&smtpSrv="+ encodeURIComponent($("input#smtpSrv").val())+ + "&smtpLogin="+ encodeURIComponent($("input#smtpLogin").val())+ + "&smtpPassword="+ encodeURIComponent($("input#smtpPassword").val())+ + "&smtpPort="+ encodeURIComponent($("input#smtpPort").val())+ + "&smtpEnc="+ encodeURIComponent($("select#smtpEnc option:selected").val())+ + "&mailSubject="+ encodeURIComponent(mailSubject)+ + "&isoCodeLocalLanguage="+isoCodeLocalLanguage + , + + success: function(ret) + { + fieldsList = ret.getElementsByTagName('shopConfig')[0].getElementsByTagName('field'); + validShopInfos = true; + if (!ajaxRefreshField(0, "resultInfosShop", fieldsList, "infosShop")) validShopInfos = false; + else if (!ajaxRefreshField(4, "resultInfosShop", fieldsList, "validateShop")) validShopInfos = false; + else if (!ajaxRefreshField(1, "resultInfosFirstname", fieldsList, "infosFirstname")) validShopInfos = false; + else if (!ajaxRefreshField(2, "resultInfosName", fieldsList, "infosName")) validShopInfos = false; + else if (!ajaxRefreshField(3, "resultInfosEmail", fieldsList, "infosEmail")) validShopInfos = false; + else if (!ajaxRefreshField(7, "resultInfosPassword", fieldsList, "infosPassword")) validShopInfos = false; + else if (!ajaxRefreshField(8, "resultInfosPasswordRepeat", fieldsList, "infosPasswordRepeat")) validShopInfos = false; + else if (!ajaxRefreshField(9, "resultInfosLanguages", fieldsList, "infosLanguages")) validShopInfos = false; + else if (!ajaxRefreshField(11, "resultInfosSQL", fieldsList, "infosSQL")) validShopInfos = false; + else if (!ajaxRefreshField(10, "resultInfosNotification", fieldsList, "infosNotification")) validShopInfos = false; + else if (!ajaxRefreshField(5, "resultInfosFirstname", fieldsList, "validateFirstname")) validShopInfos = false; + else if (!ajaxRefreshField(6, "resultInfosName", fieldsList, "validateName")) validShopInfos = false; + else if (!ajaxRefreshField(12, "resultCatalogMode", fieldsList, "validateCatalogMode")) validCatalogMode = false; + else + { + $('#endShopName').html($('input#infosShop').val()); + $('#endFirstName').html($('input#infosFirstname').val()); + $('#endName').html($('input#infosName').val()); + $('#endEmail').html($('input#infosEmail').val()); + } + } + } + ); +} + +function autoCheckField(idField, idResultSpan, typeVerif) +{ + switch (typeVerif) + { + case "required" : + $(idField).blur(function() + { + if($(this).val() == "") + { + $(idResultSpan) + .show("slow") + .addClass("fail") + .html(txtError[0]); + } + else + { + $(idResultSpan) + .hide("slow") + .removeClass("fail") + .html(""); + } + } + ); + break; + + case "mailFormat" : + $(idField).blur( + function() + { + if (!verifMailREGEX.test( $(this).val() )) + { + $(idResultSpan) + .show("slow") + .addClass("fail") + .html(txtError[3]); + } + else + { + $(idResultSpan) + .hide("slow") + .removeClass("fail") + .html(""); + } + } + ); + break; + + case "firstnameFormat" : + $(idField).blur( + function() + { + if (!verifNameREGEX.test( $(this).val() )) + { + $(idResultSpan) + .show("slow") + .addClass("fail") + .html(txtError[47]); + } + else + { + $(idResultSpan) + .hide("slow") + .removeClass("fail") + .html(""); + } + } + ); + break; + + case "nameFormat" : + $(idField).blur( + function() + { + if (!verifNameREGEX.test( $(this).val() )) + { + $(idResultSpan) + .show("slow") + .addClass("fail") + .html(txtError[48]); + } + else + { + $(idResultSpan) + .hide("slow") + .removeClass("fail") + .html(""); + } + } + ); + break; + + default : return false; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//upgrader +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +function constructUpdaterTabs() +{ + $("#tabs") + .empty() + .append("
  • "+txtTabUpdater1+"
  • ") + .append("
  • "+txtTabUpdater2+"
  • ") + .append("
  • "+txtTabUpdater3+"
  • ") + .append("
  • "+txtTabUpdater4+"
  • ") + ; + $(".installerVersion").hide(); + $(".updaterVersion").show(); +} + +function constructInstallerTabs() +{ + $("#tabs") + .empty() + .append("
  • "+txtTabInstaller1+"
  • ") + .append("
  • "+txtTabInstaller2+"
  • ") + .append("
  • "+txtTabInstaller3+"
  • ") + .append("
  • "+txtTabInstaller4+"
  • ") + .append("
  • "+txtTabInstaller5+"
  • ") + ; + $(".installerVersion").show(); + $(".updaterVersion").hide(); +} + +function doUpgrade() +{ + $.ajax( + { + url: "model.php", + cache: false, + data: + "method=doUpgrade" + , + success: function(ret) + { + var ret; + try { + ret = ret.getElementsByTagName('action')[0]; + } catch (e) { + $("#resultUpdate").html(ret); + showStep(8); + return; + } + + var countSqlError = 0; + if (ret.getAttribute("result") == "ok" || (ret.getAttribute("result") == "fail" && (ret.getAttribute("error") == "34"))) + { + requests = ret.getElementsByTagName('request'); + $("#updateLog").empty(); + + $(requests).each(function() + { + $("#updateLog").append("
    " + $(this).children("sqlQuery").text() + "

    "); + if($(this).attr("result") == "fail") + { + countSqlError++; + $("#updateLog").append("(" + $(this).children("sqlNumberError").text() + ") " + $(this).children("sqlMsgError").text() + "
    "); + } + }); + if (ret.getAttribute("error") == "34") + $("#txtErrorUpdateSQL").html(txtError[35]+" "+countSqlError+" "+txtError[36]); + showStep(9); + } + else + { + $("#resultUpdate").html(txtError[parseInt(ret.getAttribute("error"))]); + showStep(8); + } + }, + error: function (data, status, e) + { + $('#resultUpdate').html('

    Error during install/upgrade: '+data.responseText.replace(/<\/?[^>]+>/gi, '')+'

    You may have to:

    1. Fix the error(s) displayed
    2. Put your database backup
    3. Modify the file settings.inc.php to put the old version for the line with _PS_VERSION_
    4. Restart the upgrade process from the begining

    '); + $('#detailsError').html(data); + showStep(8); + } + }); +} + +function showUpdateLog(){ + $("div#updateLog").toggle('slow'); +} + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// end upgrader +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//when ready.... +$(document).ready( + function() + { + //show container only if JS is available + $("#noJavaScript").hide(); + $("#container").show(); + + //ajax animation + $("#loader").ajaxStart( + function() + { + $(this).fadeIn(); + $("#btNext[disabled!=1], #btBack[disabled!=1]").attr("disabled", "disabled").addClass("disabled").addClass("lockedForAjax"); + } + ); + $("#loader").ajaxComplete( + function() + { + $(this).fadeOut(); + $(".lockedForAjax").removeAttr("disabled").removeClass("disabled").removeClass("lockedForAjax"); + } + ); + //set actions on clicks + $('#btNext').bind("click",nextTab); + $('#btBack').bind("click",backTab); + $('#btVerifyMail').bind("click",verifyMail); + + $('#al2wl, #wl2al').click( + function() + { + moveLanguage(this.id); + } + ); + $('#req_bt_refresh, #req_bt_refresh_update').click( + function() + { + verifyAndSetRequire(0); + } + ); + + //set SMTP pannels states + $("#set_stmp").bind("click", + function() + { + switch ($("input#set_stmp:checked").length) + { + case 0 : + $("div#mailSMTPParam").slideUp('slow'); + smtpChecked = false; + $("#mailResultCheck").addClass("userInfos").removeClass("ok").removeClass('fail').html(""); + break; + + case 1 : + $("div#mailSMTPParam").slideDown('slow'); + smtpChecked = true; + $("#mailResultCheck").addClass("userInfos").removeClass("ok").removeClass('fail').html(""); + break; + } + } + ); + + //preset mail step 4 + $("#testEmail").change( + function() + { + $('#infosEmail').val( $(this).val() ); + } + ); + + //certification needed for upgrade + $('#btDisclaimerOk').click(function() + { + if ($(this).attr('checked')) + { + upgradeCertify = true; + $('#btNext').removeAttr('disabled').removeClass('disabled'); + $('#upgradeProcess').slideDown(500); + } + else + { + upgradeCertify = false; + $('#btNext').attr('disabled', 'disabled').addClass('disabled'); + $('#upgradeProcess').slideUp(500); + } + }); + + //autocheck fields + autoCheckField("#infosShop", "#resultInfosShop", "required"); + autoCheckField("#infosFirstname", "#resultInfosFirstname", "firstnameFormat"); + autoCheckField("#infosName", "#resultInfosName", "nameFormat"); + autoCheckField("#infosEmail", "#resultInfosEmail", "mailFormat"); + autoCheckField("#infosPassword", "#resultInfosPassword", "required"); + autoCheckField("#infosPasswordRepeat", "#resultInfosPasswordRepeat", "required"); + autoCheckField("#infosPasswordRepeat", "#resultInfosPassword", "required"); + + //fix PNG for IE < IE7 + /* + $(document).ready(function(){ + $("#dfdsf").pngFix(); + });*/ + + + constructInstallerTabs(); + + //show 1st step + step=1; + $("input#btNext").focus(); + + // hide next button for licence validation + $("#btNext") + .attr("disabled", "disabled") + .addClass("disabled"); + + + + function checkLicenseButton(elt) + { + if ($(elt).is(':checked')) + { + $("#btNext") + .removeAttr('disabled') + .removeClass('disabled'); + } + else + { + $("#btNext") + .attr("disabled", "disabled") + .addClass("disabled"); + } + } + + $('#set_license').click(function() { + checkLicenseButton(this); + }); + } +); diff --git a/install-dev/img/01-gd100.png b/install-dev/img/01-gd100.png new file mode 100644 index 000000000..973481997 Binary files /dev/null and b/install-dev/img/01-gd100.png differ diff --git a/install-dev/img/01-pt100.png b/install-dev/img/01-pt100.png new file mode 100644 index 000000000..a04e370c4 Binary files /dev/null and b/install-dev/img/01-pt100.png differ diff --git a/install-dev/img/01-pt70.png b/install-dev/img/01-pt70.png new file mode 100644 index 000000000..ad00a8ee0 Binary files /dev/null and b/install-dev/img/01-pt70.png differ diff --git a/install-dev/img/02-gd100.png b/install-dev/img/02-gd100.png new file mode 100644 index 000000000..48eb1bb30 Binary files /dev/null and b/install-dev/img/02-gd100.png differ diff --git a/install-dev/img/02-pt100.png b/install-dev/img/02-pt100.png new file mode 100644 index 000000000..ab6a27c00 Binary files /dev/null and b/install-dev/img/02-pt100.png differ diff --git a/install-dev/img/02-pt70.png b/install-dev/img/02-pt70.png new file mode 100644 index 000000000..d84e1b7ec Binary files /dev/null and b/install-dev/img/02-pt70.png differ diff --git a/install-dev/img/03-gd100.png b/install-dev/img/03-gd100.png new file mode 100644 index 000000000..b4a20bafb Binary files /dev/null and b/install-dev/img/03-gd100.png differ diff --git a/install-dev/img/03-pt100.png b/install-dev/img/03-pt100.png new file mode 100644 index 000000000..1b74f7d6a Binary files /dev/null and b/install-dev/img/03-pt100.png differ diff --git a/install-dev/img/03-pt70.png b/install-dev/img/03-pt70.png new file mode 100644 index 000000000..7c63ad1c4 Binary files /dev/null and b/install-dev/img/03-pt70.png differ diff --git a/install-dev/img/04-gd100.png b/install-dev/img/04-gd100.png new file mode 100644 index 000000000..4eabafbbd Binary files /dev/null and b/install-dev/img/04-gd100.png differ diff --git a/install-dev/img/04-pt100.png b/install-dev/img/04-pt100.png new file mode 100644 index 000000000..317ab7c97 Binary files /dev/null and b/install-dev/img/04-pt100.png differ diff --git a/install-dev/img/04-pt70.png b/install-dev/img/04-pt70.png new file mode 100644 index 000000000..5bcd74e8c Binary files /dev/null and b/install-dev/img/04-pt70.png differ diff --git a/install-dev/img/05-gd100.png b/install-dev/img/05-gd100.png new file mode 100644 index 000000000..761328841 Binary files /dev/null and b/install-dev/img/05-gd100.png differ diff --git a/install-dev/img/05-pt100.png b/install-dev/img/05-pt100.png new file mode 100644 index 000000000..efede9454 Binary files /dev/null and b/install-dev/img/05-pt100.png differ diff --git a/install-dev/img/05-pt70.png b/install-dev/img/05-pt70.png new file mode 100644 index 000000000..97b6180de Binary files /dev/null and b/install-dev/img/05-pt70.png differ diff --git a/install-dev/img/bad.gif b/install-dev/img/bad.gif new file mode 100644 index 000000000..adcfa44bb Binary files /dev/null and b/install-dev/img/bad.gif differ diff --git a/install-dev/img/bg-body.png b/install-dev/img/bg-body.png new file mode 100644 index 000000000..ce9aa4c97 Binary files /dev/null and b/install-dev/img/bg-body.png differ diff --git a/install-dev/img/bg-ctnr.png b/install-dev/img/bg-ctnr.png new file mode 100644 index 000000000..431a99ea3 Binary files /dev/null and b/install-dev/img/bg-ctnr.png differ diff --git a/install-dev/img/bg-tab.png b/install-dev/img/bg-tab.png new file mode 100644 index 000000000..20d2f2c1a Binary files /dev/null and b/install-dev/img/bg-tab.png differ diff --git a/install-dev/img/bg_help.png b/install-dev/img/bg_help.png new file mode 100644 index 000000000..f87116b86 Binary files /dev/null and b/install-dev/img/bg_help.png differ diff --git a/install-dev/img/boutonpt-disabled.png b/install-dev/img/boutonpt-disabled.png new file mode 100644 index 000000000..8e5a14c19 Binary files /dev/null and b/install-dev/img/boutonpt-disabled.png differ diff --git a/install-dev/img/boutonpt-on.png b/install-dev/img/boutonpt-on.png new file mode 100644 index 000000000..17106acfd Binary files /dev/null and b/install-dev/img/boutonpt-on.png differ diff --git a/install-dev/img/boutonpt-over.png b/install-dev/img/boutonpt-over.png new file mode 100644 index 000000000..851be19fe Binary files /dev/null and b/install-dev/img/boutonpt-over.png differ diff --git a/install-dev/img/bt-dsbl.png b/install-dev/img/bt-dsbl.png new file mode 100644 index 000000000..cb87b5c87 Binary files /dev/null and b/install-dev/img/bt-dsbl.png differ diff --git a/install-dev/img/bt-hover.png b/install-dev/img/bt-hover.png new file mode 100644 index 000000000..9e682dcfa Binary files /dev/null and b/install-dev/img/bt-hover.png differ diff --git a/install-dev/img/bt.png b/install-dev/img/bt.png new file mode 100644 index 000000000..291c6f85f Binary files /dev/null and b/install-dev/img/bt.png differ diff --git a/install-dev/img/btn-installeur.png b/install-dev/img/btn-installeur.png new file mode 100644 index 000000000..cfc4709cc Binary files /dev/null and b/install-dev/img/btn-installeur.png differ diff --git a/install-dev/img/bullet.png b/install-dev/img/bullet.png new file mode 100644 index 000000000..1da7af138 Binary files /dev/null and b/install-dev/img/bullet.png differ diff --git a/install-dev/img/ico_help.gif b/install-dev/img/ico_help.gif new file mode 100644 index 000000000..511538f8e Binary files /dev/null and b/install-dev/img/ico_help.gif differ diff --git a/install-dev/img/logo.png b/install-dev/img/logo.png new file mode 100644 index 000000000..3dda499e8 Binary files /dev/null and b/install-dev/img/logo.png differ diff --git a/install-dev/img/ok.gif b/install-dev/img/ok.gif new file mode 100644 index 000000000..113588016 Binary files /dev/null and b/install-dev/img/ok.gif differ diff --git a/install-dev/img/ombrage-bas.png b/install-dev/img/ombrage-bas.png new file mode 100644 index 000000000..0451e3be5 Binary files /dev/null and b/install-dev/img/ombrage-bas.png differ diff --git a/install-dev/img/ombrage-droit.png b/install-dev/img/ombrage-droit.png new file mode 100644 index 000000000..60cee9e05 Binary files /dev/null and b/install-dev/img/ombrage-droit.png differ diff --git a/install-dev/img/phone.png b/install-dev/img/phone.png new file mode 100644 index 000000000..862e85be9 Binary files /dev/null and b/install-dev/img/phone.png differ diff --git a/install-dev/img/puce.gif b/install-dev/img/puce.gif new file mode 100644 index 000000000..d32f60750 Binary files /dev/null and b/install-dev/img/puce.gif differ diff --git a/install-dev/img/shadow-left.png b/install-dev/img/shadow-left.png new file mode 100644 index 000000000..f3122811f Binary files /dev/null and b/install-dev/img/shadow-left.png differ diff --git a/install-dev/index.php b/install-dev/index.php new file mode 100644 index 000000000..938056b77 --- /dev/null +++ b/install-dev/index.php @@ -0,0 +1,1064 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date dans le passé + +if (function_exists('date_default_timezone_set')) + date_default_timezone_set('Europe/Paris'); + +/* Redefine REQUEST_URI if empty (on some webservers...) */ +$_SERVER['REQUEST_URI'] = str_replace('//', '/', $_SERVER['REQUEST_URI']); +if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '') + $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; +if ($tmp = strpos($_SERVER['REQUEST_URI'], '?')) + $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, $tmp); + +define('INSTALL_VERSION', '1.4.1.0'); +define('MINIMUM_VERSION_TO_UPDATE', '0.8.5'); +define('INSTALL_PATH', dirname(__FILE__)); +if (version_compare(phpversion(), '5.0.0', '<')) +{ + echo ' + + + + + +

    PrestaShop requires PHP5 or later, you are currently running: '.phpversion().'
    + '.lang('If you do not know how to enable it, use our turnkey solution PrestaBox at').' http://www.prestabox.com.

    + '; + die; +} + +require(dirname(__FILE__).'/../config/autoload.php'); +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); + +/* Prevent from bad URI parsing when using index.php */ +$requestUri = str_replace('index.php', '', $_SERVER['REQUEST_URI']); +$tmpBaseUri = substr($requestUri, 0, -1 * (strlen($requestUri) - strrpos($requestUri, '/')) - strlen(substr(substr($requestUri,0,-1), strrpos( substr($requestUri,0,-1),"/" )+1))); +define('PS_BASE_URI', $tmpBaseUri[strlen($tmpBaseUri) - 1] == '/' ? $tmpBaseUri : $tmpBaseUri.'/'); +define('PS_BASE_URI_ABSOLUTE', 'http://'.ToolsInstall::getHttpHost(false, true).PS_BASE_URI); + +/* Old version detection */ +$oldversion = false; +$sameVersions = false; +$tooOld = true; +$installOfOldVersion = false; +if (file_exists(INSTALL_PATH.'/../config/settings.inc.php')) +{ + include(INSTALL_PATH.'/../config/settings.inc.php'); + $oldversion =_PS_VERSION_; + $tooOld = (version_compare($oldversion, MINIMUM_VERSION_TO_UPDATE) == -1); + $sameVersions = (version_compare($oldversion, INSTALL_VERSION) == 0); + $installOfOldVersion = (version_compare($oldversion, INSTALL_VERSION) == 1); +} + +include(INSTALL_PATH.'/classes/LanguagesManager.php'); +$lm = new LanguageManager(dirname(__FILE__).'/langs/list.xml'); +$_LANG = array(); +$_LIST_WORDS = array(); +function lang($txt) { + global $_LANG , $_LIST_WORDS; + return (isset($_LANG[$txt]) ? $_LANG[$txt] : $txt); +} +if ($lm->getIncludeTradFilename()) + include_once($lm->getIncludeTradFilename()); + +?> + + + + + + + + + <?php echo lang('PrestaShop '.INSTALL_VERSION.' Installer')?> + + + + + + + + + + + + +
    + +
    + +
    + +
    +
     
    +
    + +
    +

    + +
    PrestaShop '.lang('Installer'); ?>
    +
    PrestaShop '.lang('Updater'); ?>
    +

    + +
    1.  
    + +
    + help + +
    +

    +

    + +
      +

    • +

    • +
    +
    +
    + + getIsoCodeSelectedLang() == 'fr'): ?> +

    + '.lang('A question about PrestaShop or issues during installation or upgrade? Call us!').'
    '.lang('+33 (0)1.40.18.30.04'); ?> +

    + +
    + + +
    + +
    +

    +


    +


    +
      +
    • +
    • +
    • +
    +

    + . +

    + +

    +
    +
      + getAvailableLangs() as $lang): ?> +
    • getIdSelectedLang() ) ? "checked=\"checked\"" : '' ?> id="lang_" name="language" style="vertical-align: middle; margin-right: 0;" />
    • + + +
    +
    +

    +

    + http://www.prestashop.com +

    + +

    +
    +

    type="radio" value="install" name="typeInstall" id="typeInstallInstall"/>

    +

    > type="radio" value="upgrade" name="typeInstall" id="typeInstallUpgrade"/>

    +
    +

    +
    +

    Open Software License ("OSL") v. 3.0

    +

    This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:

    +

    Licensed under the Open Software License version 3.0

    +

    1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:

    +
      +
    1. to reproduce the Original Work in copies, either alone or as part of a collective work
    2. +
    3. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work
    4. +
    5. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License
    6. +
    7. to perform the Original Work publicly
    8. +
    9. to display the Original Work publicly
    10. +
    +

    2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.

    +

    3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.

    +

    4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.

    +

    5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).

    +

    6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.

    +

    7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.

    +

    8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.

    +

    9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).

    +

    10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.

    +

    11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.

    +

    12. Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.

    +

    13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.

    +

    14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

    +

    15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.

    +

    16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

    +
    +

    +
    +

    +
    + +
    + +

    + +

    + +

    + + + + +

    + + +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • /config
    • +
    • /tools/smarty/compile
    • +
    • /tools/smarty/cache
    • +
    • /tools/smarty_v2/compile
    • +
    • /tools/smarty_v2/cache
    • +
    • /sitemap.xml
    • +
    • +
    • /img
    • +
    • /mails
    • +
    • /modules
    • +
    • /themes/prestashop/lang
    • +
    • /themes/prestashop/cache
    • +
    • /translations
    • +
    • /upload
    • +
    • /download
    • +
    + +

    +
      +
    • +
    • +
    • +
    • +
    • +
    + +

    + +
    + +
    +

    + +

    +
    +

    +

    + + +

    +

    + + +

    +

    + + +

    +

    + + +

    +

    + + +

    +

    + +

    +

    +
    + +
    +
    +

    +

    +

    +
    + +

    +
    +

    +
    +
    +

    + +

    +
    + +

    + +
    +
    +

    + + +

    +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + + +

    + +
    +
    +

    + + +

    + +

    +
    +
    + +
    +
    + +

    + +

    +
    +
    + +
    +
    + + +

    +
    +
    + + +
    +
    + + +
    +
    + + + +

    + +
    +
    + + + + + +

    +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +

    +
    + + + + + + + + + + + + '), trim($object->{$field.'_'.((int)($_GET['language'])+1)})); + if (property_exists($object, $field.'_1')) + return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_1'})); + return ''; + } + + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/preactivation/partners.php?version=1.0', false, $context); + if ($content && $content[0] == '<') + { + $result = simplexml_load_string($content); + if ($result->partner) + { + $modulesHelpInstall = array(); + $modulesDescription = array(); + $modulesPrechecked = array(); + foreach ($result->partner as $p) + { + $modulesDescription[trim($p->key)] = array('name' => trim($p->label), 'logo' => trim($p->logo), 'label' => getPreinstallXmlLang($p, 'label'), 'description' => getPreinstallXmlLang($p, 'description').getPreinstallXmlLang($p, 'more')); + foreach ($p->country as $country_iso_code) + $modulesHelpInstall[trim($country_iso_code)][] = trim($p->key); + if ($p->prechecked) + foreach ($p->prechecked as $country_iso_code) + $modulesPrechecked[trim($p->key)][trim($country_iso_code)] = 1; + } + + foreach ($modulesHelpInstall as $country_iso_code => $modulesList) + { + echo '
    '; + foreach ($modulesList as $module) + { + echo '
    +
    +
    '.$modulesDescription[$module]['name'].'
    +
    +
    + +

    '.$modulesDescription[$module]['description'].'

    + +
    '; + echo ""; + } + echo '
    '; + } + } + } + + ?> + + + + + + + + + + + + + +
    + +
    + + +
    + +
    + +
    +
    +

    +

    +

    +

    + + + + + + + + + + + + + + + + + +
     
     
     
     
    +

    + + + + + + + + + + + +
    +
    + + + + + +
    + +
    +

    +

    +

    +



    +
    + + +
    + + +
    + +
    + +

    + +

    + +

    + + + + +

    + + +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • /config
    • +
    • /tools/smarty/compile
    • +
    • /tools/smarty/cache
    • +
    • /tools/smarty_v2/compile
    • +
    • /tools/smarty_v2/cache
    • +
    • /sitemap.xml
    • +
    • +
    • /img
    • +
    • /mails
    • +
    • /modules
    • +
    • /themes/prestashop/lang
    • +
    • /themes/prestashop/cache
    • +
    • /translations
    • +
    • /upload
    • +
    • /download
    • +
    + +

    +
      +
    • +
    • +
    • +
    • +
    • +
    + +

    + +
    + +
    +

    +

    +

    +

    +
    + +
    +
    +

    +

    +

    +

    +
    +


    + + '.lang('New features in PrestaShop v').INSTALL_VERSION.'

    + '; + } + + ?> + +

    + + + + + + + + + + + + + +
    + + +
    + + + + + + diff --git a/install-dev/langs/de.php b/install-dev/langs/de.php new file mode 100644 index 000000000..bf2cc0dcf --- /dev/null +++ b/install-dev/langs/de.php @@ -0,0 +1,233 @@ + klicken Sie auf Weiter zum Fortfahren!'; +$_LANG['Your configuration is invalid. Please fix the issues below:'] = 'Ihre Konfiguration ist nicht gültig,
    bitte beheben Sie diese Probleme:'; +$_LANG['You have to create a database, help available in readme_en.txt'] = 'Sie müssen zunächst eine Datenbank erstellen (Hilfe in der Datei readme.txt verfügbar)'; +$_LANG['If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'] = 'Diese Option kann hinderlich sein, wenn Ihre E-Mail-Konfiguration falsch ist, bitte deaktivieren Sie sie, wenn Sie nicht zum nächsten Schritt gehen können.'; +$_LANG['Mcrypt is available (recommended)'] = 'Mcrypt ist verfügbar (empfohlen)'; +$_LANG['Your MySQL server doesn\'t support this engine, please use another one like MyISAM'] = 'Diese Datenbank-Engine wird nicht unterstützt, bitte wählen Sie eine andere als MyISAM'; +$_LANG['Adult'] = 'Erwachsene und Dessous'; +$_LANG['Animals and Pets'] = 'Tiere'; +$_LANG['Art and Culture'] = 'Kultur und Freizeit'; +$_LANG['Babies'] = 'Baby-Artikel'; +$_LANG['Beauty and Personal Care'] = 'Gesundheit und Schönheit'; +$_LANG['Cars'] = 'Auto und Motorrad'; +$_LANG['Computer Hardware and Software'] = 'Computer & Software'; +$_LANG['Download'] = 'Download'; +$_LANG['Fashion and accessories'] = 'Kleidung und Accessoires'; +$_LANG['Flowers, Gifts and Crafts'] = 'Blumen und Geschenke'; +$_LANG['Food and beverage'] = 'Lebensmittel und Gastronomie'; +$_LANG['HiFi, Photo and Video'] = 'Hifi, Foto und Video'; +$_LANG['Home and Garden'] = 'Haus & Garten'; +$_LANG['Home Appliances'] = 'Haushaltsgeräte'; +$_LANG['Jewelry'] = 'Schmuck'; +$_LANG['Mobile and Telecom'] = 'Telefonie und Kommunikation'; +$_LANG['Services'] = 'Dienstleistungen'; +$_LANG['Shoes and accessories'] = 'Schuhe und Accessoires'; +$_LANG['Sport and Entertainment'] = 'Sport und Freizeit'; +$_LANG['Travel'] = 'Reise und Tourismus'; +$_LANG['Main activity:'] = 'Haupttätigkeit'; +$_LANG['-- Please choose your main activity --'] = '- Wählen Sie eine Tätigkeit --'; +$_LANG['A question about PrestaShop or issues during installation or upgrade? Call us!'] = 'Eine Frage zu PrestaShop oder ein Problem bei der Installation oder beim Upgrade? Rufen Sie uns an!'; +$_LANG['Invalid catalog mode'] = 'Feld Katalog-Modus ungültig'; +$_LANG['Catalog mode:'] = 'Katalog-Modus:'; +$_LANG['Yes'] = 'Ja'; +$_LANG['No'] = 'Nein'; +$_LANG['If you activate this feature, all purchase features will be disabled. You can activate this feature later in your back office'] = 'Wenn Sie diese Option aktivieren, werden alle Kauf-Funktionen deaktiviert. Sie können diese Option später in Ihrem Back-Office aktivieren'; +$_LANG['the already installed version detected is too recent, no update available'] = 'Die bereits installierte Version, die erkannt wurde, ist neu, keine Updates verfügbar'; +$_LANG['This information isn\'t required, it will be used for statistical purposes. This information doesn\'t change anything in your store.'] = 'Diese Information ist nicht erforderlich, sie wird zu statistischen Zwecken verwendet. Diese Information ändert nichts in Ihrem Shop.'; +$_LANG['If you do not know how to enable it, use our turnkey solution PrestaBox at'] = 'Wenn Sie nicht wissen, wie Sie es aktivieren müssen, nutzen Sie unsere Fertiglösung PrestaBox'; +$_LANG['Invalid shop name'] = 'Ungültiger Shopname'; +$_LANG['Your firstname contains some invalid characters'] = 'Ihr Vorname enthält einige ungültige Zeichen'; +$_LANG['Your lastname contains some invalid characters'] = 'Ihr Nachname enthält einige ungültige Zeichen'; +$_LANG['The file /img/logo.jpg is not writable, please CHMOD 755 this file or CHMOD 777'] = 'Die Datei /img/logo.jpg kann nicht geschrieben werden, bitte ändern Sie die Dateirechte mit CHMOD 755 oder CHMOD 777'; +$_LANG['the already installed version detected is too old, no more update available'] = 'Die bereits installierte erkannte Version ist zu alt, es ist kein Update mehr verfügbar'; +$_LANG['If you do not know how to fix these issues, use turnkey solution PrestaBox at'] = 'Wenn Sie nicht wissen, wie Sie diese Themen festlegen können, nutzen Sie die Fertiglösung PrestaBox'; +$_LANG['Database Engine:'] = 'Datenbank-Engine'; +$_LANG['Installation type'] = 'Installationstyp'; +$_LANG['Simple mode: Basic installation'] = 'Einfacher Modus: Grundinstallation'; +$_LANG['(FREE)'] = '(KOSTENLOS)'; +$_LANG['Full mode: includes'] = 'Komplettmodus: beinhaltet'; +$_LANG['100+ additional modules'] = '100+zusätzliche Module'; +$_LANG['and demo products'] = 'und Demo-Produkte'; +$_LANG['(FREE too!)'] = '(ebenfalls KOSTENLOS!)'; +$_LANG['Shop configuration'] = 'Shop-Konfiguration'; +$_LANG['I certify that I backed up my database and application files. I assume all responsibility for any data loss or damage related to this upgrade.'] = 'Ich bestätige, dass ich meine Datenbank und meine Anwendungsdateien durch ein Backup gesichert habe. Ich übernehme die volle Verantwortung für jeglichen Datenverlust oder jegliche Datenbeschädigung, die im Zusammenhang mit diesem Upgrade stehen.'; + diff --git a/install-dev/langs/es.php b/install-dev/langs/es.php new file mode 100644 index 000000000..b42c3fcc0 --- /dev/null +++ b/install-dev/langs/es.php @@ -0,0 +1,271 @@ +gracias por corregir la configuración:'; +$_LANG['You have to create a database, help available in readme_en.txt'] = 'Debe crear una base de datos, puede encontrar ayuda en el archivo readme_es.txt'; +$_LANG['Discover your store'] = 'Descubra su tienda'; +$_LANG['If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'] = 'Esta opción se puede bloquear si su configuración de correo electrónico está mal, gracias a desactivarla si usted no puede moverse a la siguiente etapa.'; +$_LANG['A question about PrestaShop or issues during installation or upgrade? Call us!'] = '¿Alguna pregunta sobre PrestaShop o problemas durante su instalación o actualización? ¡Llámenos!'; +$_LANG['Invalid catalog mode'] = 'Campo modo catálogo no válido'; +$_LANG['Catalog mode:'] = 'Modo Catálogo:'; +$_LANG['Yes'] = 'Sí'; +$_LANG['No'] = 'No'; +$_LANG['If you activate this feature, all purchase features will be disabled. You can activate this feature later in your back office'] = 'Si activa esta opción, se desactivarán todas las aplicaciones de compra. Puede activar dicha opción posteriormente en el panel de administración.'; +$_LANG['the already installed version detected is too recent, no update available'] = 'la versi√≥n instalada que se ha detectado es demasiado reciente, no hay ninguna actualizaci√≥n disponible'; +$_LANG['If you do not know how to enable it, use our turnkey solution PrestaBox at'] = 'Si no sabe activarla, utilice nuestra solución PrestaBox en'; +$_LANG['Invalid shop name'] = 'Nombre de la tienda no válido'; +$_LANG['Your firstname contains some invalid characters'] = 'Su nombre contiene caracteres no válidos'; +$_LANG['Your lastname contains some invalid characters'] = 'Su apellido contiene caracteres no válidos'; +$_LANG['Your MySQL server doesn\'t support this engine, please use another one like MyISAM'] = 'El soporte de este motor de base de datos no se puede soportar, elija otro como por ejemplo MyISAM'; +$_LANG['The file /img/logo.jpg is not writable, please CHMOD 755 this file or CHMOD 777'] = 'El archivo /img/logo.jpg no tiene derechos de escritura, por favor efectúe un CHMOD 755 o 777 en el archivo'; +$_LANG['The config/defines.inc.php file was not found. Where did you move it?'] = 'El archivo config/defines.inc.php no se ha encontrado. ¿Dónde se encuentra?'; +$_LANG['All tips and advice about PrestaShop'] = 'Todos los trucos y consejos sobre PrestaShop'; +$_LANG['+33 (0)1.40.18.30.04'] = '+33 (0)1.40.18.30.04'; +$_LANG['the already installed version detected is too old, no more update available'] = 'la versión instalada es demasiado antigua, no existen actualizaciones.'; +$_LANG['Mcrypt is available (recommended)'] = 'Mcrypt está disponible (aconsejable)'; +$_LANG['If you do not know how to fix these issues, use turnkey solution PrestaBox at'] = 'Si no puede solucionar estos problemas, utilice nuestra solución PrestaBox en'; +$_LANG['Database Engine:'] = 'Tipo de base de datos:'; +$_LANG['Installation type'] = 'Tipo de instalación'; +$_LANG['Simple mode: Basic installation'] = 'Modo básico: instalación simplificada'; +$_LANG['(FREE)'] = '(GRATIS)'; +$_LANG['Full mode: includes'] = 'Modo completo: incluido'; +$_LANG['100+ additional modules'] = '100 módulos'; +$_LANG['and demo products'] = 'y productos de demostración'; +$_LANG['(FREE too!)'] = '(¡TAMBIEN GRATIS!)'; +$_LANG['Shop configuration'] = 'Configuración de la tienda'; +$_LANG['Main activity:'] = 'Actividad principal'; +$_LANG['-- Please choose your main activity --'] = '-- Elija una actividad --'; +$_LANG['Adult'] = 'Adulto y lencería'; +$_LANG['Animals and Pets'] = 'Animales'; +$_LANG['Art and Culture'] = 'Cultura y ocio'; +$_LANG['Babies'] = 'Artículos para bebés'; +$_LANG['Beauty and Personal Care'] = 'Salud y belleza'; +$_LANG['Cars'] = 'Automóvil y motos'; +$_LANG['Computer Hardware and Software'] = 'Informática y programas'; +$_LANG['Download'] = 'Descargas'; +$_LANG['Fashion and accessories'] = 'Ropa y complementos'; +$_LANG['Flowers, Gifts and Crafts'] = 'Flores y regalos'; +$_LANG['Food and beverage'] = 'Alimentación y gastronomía'; +$_LANG['HiFi, Photo and Video'] = 'Hifi, foto y vídeo'; +$_LANG['Home and Garden'] = 'Casa y jardín'; +$_LANG['Home Appliances'] = 'Electrodomésticos'; +$_LANG['Jewelry'] = 'Joyería'; +$_LANG['Mobile and Telecom'] = 'Telefonía y comunicación'; +$_LANG['Services'] = 'Servicios'; +$_LANG['Shoes and accessories'] = 'Calzado y complementos'; +$_LANG['Sport and Entertainment'] = 'Deporte y ocio'; +$_LANG['Travel'] = 'Viajes y turismo'; +$_LANG['This information isn\'t required, it will be used for statistical purposes. This information doesn\'t change anything in your store.'] = 'Esta información no es obligatoria, solo se utilizará para estadísticas. Proporcionarla o no, no cambiará nada en su tienda.'; +$_LANG['E-mail:'] = 'Email :'; +$_LANG['I certify that I backed up my database and application files. I assume all responsibility for any data loss or damage related to this upgrade.'] = 'Certifico que he efectuado una copia de seguridad de mi base de datos y de mis archivos. Asumo plenamente la responsabilidad en caso en que se pierdan los datos o se produzca un error relacionado con esta actualización.'; +$_LANG['Upgrade in progress'] = 'Actualización en curso'; +$_LANG['Current query:'] = 'Búsqueda actual:'; +$_LANG['Details about this upgrade'] = 'Detalles sobre esta actualización'; +$_LANG['Thank you, you will be able to continue the upgrade process by clicking on the "Next" button.'] = 'Gracias, puede continuar la actualización, pulsando en "Siguiente".'; +$_LANG['PrestaShop is upgrading your shop one version after the other, the following upgrade files will be processed:'] = 'PrestaShop actualiza las versiones de su tienda de una en una, los siguientes archivos de actualización van a ser tratados:'; +$_LANG['Upgrade file'] = 'Archivo de actualizaciones'; +$_LANG['Modifications to process'] = 'Modificaciones que deben tenerse en cuenta'; +$_LANG['(major)'] = '(majeure)'; +$_LANG['TOTAL'] = 'TOTAL'; +$_LANG['Estimated time to complete the'] = 'Tiempo estimado para realizar la'; +$_LANG['modifications:'] = 'modificaciones :'; +$_LANG['minutes'] = 'minutos'; +$_LANG['minute'] = 'minuto'; +$_LANG['seconds'] = 'segundos'; +$_LANG['second'] = 'segundo'; +$_LANG['Depending on your server and the size of your shop'] = 'En función de la potencia de su servidor y el tamaño de su tienda...'; +$_LANG['You did not update your shop for a while,'] = 'No ha actualizado su tienda desde hace algún tiempo,'; +$_LANG['major releases have been made ??available since.'] = 'hay versiones mayores a disposición desde entonces.'; +$_LANG['This is not a problem however the update may take several minutes, try to update your shop more frequently.'] = 'No es un problema pero la actualización puede durar algunos minutos. Intente actualizar su tienda más a menudo.'; +$_LANG['No files to process, this might be an error.'] = 'No hay ningún archivo para tratar, se trata sin duda de un error'; +$_LANG['Hosting parameters'] = 'Parámetros hosting'; +$_LANG['PrestaShop tries to automatically set the best settings for your server in order the update to be successful.'] = 'PrestaShop intenta configurar por usted los parámetros de su servidor para que la actualización se efectúe de manera correcta.'; +$_LANG['PHP parameter'] = 'Parámetro PHP'; +$_LANG['Description'] = 'Descripción'; +$_LANG['Current value'] = 'Valor actual'; +$_LANG['Maximum allowed time for the upgrade'] = 'Tiempo máximo autorizado para la actualización'; +$_LANG['Maximum memory allowed for the upgrade'] = 'Memoria máxima autorizada para la actualización'; +$_LANG['All your settings seem to be OK, go for it!'] = 'Todos los parámetros son correctos, ¡adelante!'; +$_LANG['Beware, your settings look correct but are not optimal, if you encounter problems (upgrade too long, memory error...), please ask your hosting provider to increase the values of these parameters (max_execution_time & memory_limit).'] = 'Atención, los parámetros parecen correctos pero no son óptimos, si encuentra una dificultad (actualización bloqueada antes de su finalización, error de memoria...), pida a su hosting que aumente los valores de dichos parámetros (max_execution_time & memory_limit).'; +$_LANG['We strongly recommend that you inform your hosting provider to modify the settings before process to the update.'] = 'Le aconsejamos que avise a su hosting antes de comenzar la actualización para que modifique los parámetros PHP.'; +$_LANG['Let\'s go!'] = 'El proceso ha comenzado'; +$_LANG['Click on the "Next" button to start the upgrade, this can take several minutes,'] = 'Pulse en "Siguiente" para comenzar la actualización, esto puede llevar unos minutos,'; +$_LANG['do not close the window and be patient.'] = 'no cierre la ventana y espere.'; +$_LANG['Your update is completed!'] = 'La actualización ha concluido con éxito'; +$_LANG['Your shop version is now'] = 'La versión de su tienda ya está'; +$_LANG['New features in PrestaShop v'] = 'Nuevas aplicaciones en dans PrestaShop v'; + diff --git a/install-dev/langs/fr.php b/install-dev/langs/fr.php new file mode 100644 index 000000000..f8720ff8e --- /dev/null +++ b/install-dev/langs/fr.php @@ -0,0 +1,270 @@ +cliquez sur suivant pour continuer !'; +$_LANG['Your configuration is invalid. Please fix the issues below:'] = 'Votre configuration n\'est pas valide,
    merci de corriger ces problèmes :'; +$_LANG['You have to create a database, help available in readme_en.txt'] = 'Vous devez au préalable créer une base de données (aide disponible dans le fichier readme.txt)'; +$_LANG['If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'] = 'Cette option peut être bloquante si votre configuration e-mail est erronée, merci de la désactiver si vous ne pouvez pas passer à l\'étape suivante.'; +$_LANG['Mcrypt is available (recommended)'] = 'Mcrypt est disponible (recommandé)'; +$_LANG['Your MySQL server doesn\'t support this engine, please use another one like MyISAM'] = 'Le support de ce moteur de base de donnée n\'est pas supporté, veuillez en choisir un autre tel que MyISAM'; +$_LANG['Adult'] = 'Adulte et lingerie'; +$_LANG['Animals and Pets'] = 'Animaux'; +$_LANG['Art and Culture'] = 'Culture et divertissements'; +$_LANG['Babies'] = 'Articles pour bébé'; +$_LANG['Beauty and Personal Care'] = 'Santé et beauté'; +$_LANG['Cars'] = 'Auto et moto'; +$_LANG['Computer Hardware and Software'] = 'Informatique et logiciels'; +$_LANG['Download'] = 'Téléchargement'; +$_LANG['Fashion and accessories'] = 'Vêtements et accessoires'; +$_LANG['Flowers, Gifts and Crafts'] = 'Fleurs et cadeaux'; +$_LANG['Food and beverage'] = 'Alimentation et gastronomie'; +$_LANG['HiFi, Photo and Video'] = 'Hifi, photo et vidéos'; +$_LANG['Home and Garden'] = 'Maison et jardin'; +$_LANG['Home Appliances'] = 'Électroménager'; +$_LANG['Jewelry'] = 'Bijouterie'; +$_LANG['Mobile and Telecom'] = 'Téléphonie et communication'; +$_LANG['Services'] = 'Services'; +$_LANG['Shoes and accessories'] = 'Chaussures et accessoires'; +$_LANG['Sport and Entertainment'] = 'Sport et loisirs'; +$_LANG['Travel'] = 'Voyage et tourisme'; +$_LANG['Main activity:'] = 'Activité principale'; +$_LANG['-- Please choose your main activity --'] = '-- Choisissez une activité --'; +$_LANG['A question about PrestaShop or issues during installation or upgrade? Call us!'] = 'Une question à propos de PrestaShop ou un problème lors de l\'installation ou la mise à jour ? Appelez-nous !'; +$_LANG['Invalid catalog mode'] = 'Champ mode catalog invalide'; +$_LANG['Catalog mode:'] = 'Mode Catalogue :'; +$_LANG['Yes'] = 'Oui'; +$_LANG['No'] = 'Non'; +$_LANG['If you activate this feature, all purchase features will be disabled. You can activate this feature later in your back office'] = 'Si vous activez cette option, toutes les fonctionnalités d\'achats vont être désactivées. Vous pouvez activer cette option plus tard dans votre back-office'; +$_LANG['the already installed version detected is too recent, no update available'] = 'la version déjà installée qui a été détectée est trop récente, aucune mise à jour disponible'; +$_LANG['This information isn\'t required, it will be used for statistical purposes. This information doesn\'t change anything in your store.'] = 'Cette information n\'est pas obligatoire, elle sera utilisée à des fins statistiques. Cette information ne changera rien dans votre boutique.'; +$_LANG['Invalid shop name'] = 'Nom de boutique invalide'; +$_LANG['Your firstname contains some invalid characters'] = 'Votre prénom contient des caractères invalides'; +$_LANG['Your lastname contains some invalid characters'] = 'Votre nom contient des caractères invalides'; +$_LANG['PrestaShop '.INSTALL_VERSION.' Installer'] = ''; +$_LANG['+33 (0)1.40.18.30.04'] = '+33 (0)1.40.18.30.04'; +$_LANG['(FREE)'] = '(GRATUIT)'; +$_LANG['(FREE too!)'] = '(GRATUIT AUSSI !)'; +$_LANG['Shop configuration'] = 'Configuration de la boutique'; +$_LANG['Database Engine:'] = 'Type de base de données :'; +$_LANG['I certify that I backed up my database and application files. I assume all responsibility for any data loss or damage related to this upgrade.'] = 'Je certifie avoir effectué une sauvegarde de ma base de données et de mes fichiers. J\'assume pleinement l\'ensemble des responsabilités liées à toute perte de données ou dommage lié à cette mise à jour.'; +$_LANG['The file /img/logo.jpg is not writable, please CHMOD 755 this file or CHMOD 777'] = 'Le fichier /img/logo.jpg n\'a pas les droits d\'écriture, merci d\'effectuer un CHMOD 755 ou 777 sur ce fichier'; +$_LANG['If you do not know how to enable it, use our turnkey solution PrestaBox at'] = 'Si vous ne savez pas comment l\'activer, utilisez notre solution PrestaBox sur'; +$_LANG['If you do not know how to fix these issues, use turnkey solution PrestaBox at'] = 'Si vous ne parvenez pas à régler ces problèmes, utilisez notre solution PrestaBox sur'; +$_LANG['the already installed version detected is too old, no more update available'] = 'la version déjà installée est trop ancienne, aucune mise à jour possible.'; +$_LANG['Simple mode: Basic installation'] = 'Mode basique : installation simplifiée'; +$_LANG['Full mode: includes'] = 'Mode complet : inclut'; +$_LANG['100+ additional modules'] = '100 modules'; +$_LANG['and demo products'] = 'et des produits de démonstration'; +$_LANG['Installation type'] = 'Type d\'installation'; +$_LANG['Upgrade in progress'] = 'Mise à jour en cours'; +$_LANG['Current query:'] = 'Requête actuelle :'; +$_LANG['Details about this upgrade'] = 'Détails à propos de cette mise à jour'; +$_LANG['Thank you, you will be able to continue the upgrade process by clicking on the "Next" button.'] = 'Merci, vous pouvez continuer la mise à jour en cliquant sur le bouton "Suivant".'; +$_LANG['PrestaShop is upgrading your shop one version after the other, the following upgrade files will be processed:'] = 'PrestaShop met à jour votre boutique une version après l\'autre, les fichiers de mise à jour suivants vont être traités :'; +$_LANG['Upgrade file'] = 'Fichier de mise à jour'; +$_LANG['Modifications to process'] = 'Modifications à prendre en compte'; +$_LANG['(major)'] = '(majeure)'; +$_LANG['TOTAL'] = 'TOTAL'; +$_LANG['Estimated time to complete the'] = 'Temps estimé pour réaliser la'; +$_LANG['modifications:'] = 'modifications :'; +$_LANG['minutes'] = 'minutes'; +$_LANG['minute'] = 'minute'; +$_LANG['seconds'] = 'secondes'; +$_LANG['second'] = 'seconde'; +$_LANG['Depending on your server and the size of your shop'] = 'Selon la puissance de votre serveur et la taille de votre boutique...'; +$_LANG['You did not update your shop for a while,'] = 'Vous n\'avez pas mis à jour votre boutique depuis un moment,'; +$_LANG['major releases have been made ​​available since.'] = 'versions majeures ont été mis à disposition depuis.'; +$_LANG['This is not a problem however the update may take several minutes, try to update your shop more frequently.'] = 'Ce n\'est pas un problème cependant la mise à jour risque de durer quelques minutes. A l\'avenir, essayez de mettre à jour votre boutique plus souvent.'; +$_LANG['No files to process, this might be an error.'] = 'Aucun fichier à traiter, il s\'agit probablement d\'une erreur'; +$_LANG['Hosting parameters'] = 'Paramètres hébergement'; +$_LANG['PrestaShop tries to automatically set the best settings for your server in order the update to be successful.'] = 'PrestaShop essaye automatiquement de configurer pour vous les paramètres de votre serveur afin que la mise à jour se déroule correctement.'; +$_LANG['PHP parameter'] = 'Paramètre PHP'; +$_LANG['Description'] = 'Description'; +$_LANG['Current value'] = 'Valeur actuelle'; +$_LANG['Maximum allowed time for the upgrade'] = 'Temps maximum autorisé pour la mise à jour'; +$_LANG['Maximum memory allowed for the upgrade'] = 'Mémoire maximum autorisée pour la mise à jour'; +$_LANG['All your settings seem to be OK, go for it!'] = 'Tous vos paramètres semblent OK, foncez !'; +$_LANG['Let\'s go!'] = 'C\'est parti !'; +$_LANG['Click on the "Next" button to start the upgrade, this can take several minutes,'] = 'Cliquez sur le bouton "Suivant" pour démarrer la mise à jour, cela peut prendre plusieurs minutes,'; +$_LANG['do not close the window and be patient.'] = 'ne fermez pas la fenêtre et soyez patient.'; +$_LANG['Your update is completed!'] = 'Votre mise à jour est terminée !'; +$_LANG['Your shop version is now'] = 'La version de votre boutique est maintenant'; +$_LANG['New features in PrestaShop v'] = 'Nouvelles fonctionnalités dans PrestaShop v'; +$_LANG['Beware, your settings look correct but are not optimal, if you encounter problems (upgrade too long, memory error...), please ask your hosting provider to increase the values of these parameters (max_execution_time & memory_limit).'] = 'Attention, votre paramètres semblent corrects mais ne sont pas optimaux, si jamais vous rencontrez des soucis (mise à jour qui se bloque avant la fin, erreur de mémoire...), merci de demander à votre hébergeur d\'augmenter les valeurs de ces paramètres (max_execution_time & memory_limit).'; +$_LANG['We strongly recommend that you inform your hosting provider to modify the settings before process to the update.'] = 'Nous vous recommandons fortement de prévenir votre hébergeur avant de procéder à la mise à jour afin qu\'il modifie ces paramètres PHP.'; \ No newline at end of file diff --git a/install-dev/langs/it.php b/install-dev/langs/it.php new file mode 100644 index 000000000..9e9cf9086 --- /dev/null +++ b/install-dev/langs/it.php @@ -0,0 +1,269 @@ +clicca su successivo per continuare!'; +$_LANG['Your configuration is invalid. Please fix the issues below:'] = 'La tua configurazione non è valida,
    correggi questi problemi:'; +$_LANG['You have to create a database, help available in readme_en.txt'] = 'Devi prima creare un database (aiuto disponibile nel file readme.txt)'; +$_LANG['If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'] = 'Se la tua configurazione e-mail è errata, questa opzione può essere bloccata; disattivala se non puoi passare alla fase successiva.'; +$_LANG['Mcrypt is available (recommended)'] = 'Mcrypt è disponibile (consigliato)'; +$_LANG['Your MySQL server doesn\'t support this engine, please use another one like MyISAM'] = 'Il supporto di questo motore di database non è supportato, scegline un altro come MyISAM'; +$_LANG['Adult'] = 'Adulti e indumenti intimi'; +$_LANG['Animals and Pets'] = 'Animali'; +$_LANG['Art and Culture'] = 'Cultura e svaghi'; +$_LANG['Babies'] = 'Articoli per bambini'; +$_LANG['Beauty and Personal Care'] = 'Salute e bellezza'; +$_LANG['Cars'] = 'Auto e moto'; +$_LANG['Computer Hardware and Software'] = 'Informatica e software'; +$_LANG['Download'] = 'Download'; +$_LANG['Fashion and accessories'] = 'Abiti e accessori'; +$_LANG['Flowers, Gifts and Crafts'] = 'Fiori e regali'; +$_LANG['Food and beverage'] = 'Alimentazione e gastronomia'; +$_LANG['HiFi, Photo and Video'] = 'Hifi, foto e video'; +$_LANG['Home and Garden'] = 'Casa e giardinaggio'; +$_LANG['Home Appliances'] = 'Elettrodomestici'; +$_LANG['Jewelry'] = 'Gioielleria'; +$_LANG['Mobile and Telecom'] = 'Telefonia e comunicazioni'; +$_LANG['Services'] = 'Servizi'; +$_LANG['Shoes and accessories'] = 'Scarpe e accessori'; +$_LANG['Sport and Entertainment'] = 'Sport e divertimenti'; +$_LANG['Travel'] = 'Viaggi e turismo'; +$_LANG['Main activity:'] = 'Attività principale'; +$_LANG['-- Please choose your main activity --'] = '-- Scegli un\'attività --'; +$_LANG['A question about PrestaShop or issues during installation or upgrade? Call us!'] = 'Hai domande su PrestaShop o un problema per l\'installazione o l\'aggiornamento? Chiamaci!'; +$_LANG['Invalid catalog mode'] = 'Campo modalità catalogo non valido'; +$_LANG['Catalog mode:'] = 'Modalità catalogo:'; +$_LANG['Yes'] = 'Sì'; +$_LANG['No'] = 'No'; +$_LANG['If you activate this feature, all purchase features will be disabled. You can activate this feature later in your back office'] = 'Se attivi questa opzione, tutte le funzioni di acquisto saranno disattivate. Potrai attivare questa opzione più tardi nel tuo back-office'; +$_LANG['the already installed version detected is too recent, no update available'] = 'la versione già installata individuata è troppo recente, nessun aggiornamento disponibile'; +$_LANG['This information isn\'t required, it will be used for statistical purposes. This information doesn\'t change anything in your store.'] = 'Queste informazioni non sono obbligatorie, saranno utilizzate a fini statistici. Queste informazioni non cambieranno nulla nel tuo negozio.'; +$_LANG['If you do not know how to enable it, use our turnkey solution PrestaBox at'] = 'Se non sai come abilitarlo, usa la nostra soluzione innovativa PrestaBox su'; +$_LANG['Invalid shop name'] = 'nome negozio non valido'; +$_LANG['Your firstname contains some invalid characters'] = 'Il tuo nome contiene dei caratteri non validi'; +$_LANG['Your lastname contains some invalid characters'] = 'Il tuo cognome contiene dei caratteri non validi'; +$_LANG['The file /img/logo.jpg is not writable, please CHMOD 755 this file or CHMOD 777'] = 'Il file /img/logo.jpg non ?scrivibile, ti preghiamo di effettuare CHMOD 755 oppure CHMOD 777'; +$_LANG['the already installed version detected is too old, no more update available'] = 'La versione già installata individuata è troppo vecchia, non ci sono più aggiornamenti disponibili'; +$_LANG['If you do not know how to fix these issues, use turnkey solution PrestaBox at'] = 'Se non sai come correggere questi problemi, usa la soluzione innovativa PrestaBox su'; +$_LANG['Database Engine:'] = 'Motore database'; +$_LANG['Installation type'] = 'Tipo di installazione'; +$_LANG['Simple mode: Basic installation'] = 'Modalità semplice: installazione base'; +$_LANG['(FREE)'] = '(GRATUITO)'; +$_LANG['Full mode: includes'] = 'Modalità completa: include'; +$_LANG['100+ additional modules'] = 'Più di 100 moduli aggiuntivi'; +$_LANG['and demo products'] = 'e prodotti demo'; +$_LANG['(FREE too!)'] = 'GRATUITI!'; +$_LANG['Shop configuration'] = 'Configurazione negozio'; +$_LANG['I certify that I backed up my database and application files. I assume all responsibility for any data loss or damage related to this upgrade.'] = 'Dichiaro di aver effettuato il backup del mio database e dei file di applicazione. Mi assumo tutte le responsabilità per qualsiasi perdita dei dati o danni relativi a questo aggiornamento'; +$_LANG['Upgrade in progress'] = 'Aggiornamento in corso'; +$_LANG['Current query:'] = 'Domanda attuale'; +$_LANG['Details about this upgrade'] = 'Dettagli su questo aggiornamento'; +$_LANG['Thank you, you will be able to continue the upgrade process by clicking on the "Next" button.'] = 'Grazie, potrai continuare il processo di aggiornamento cliccando sul tasto “Successivo”.'; +$_LANG['PrestaShop is upgrading your shop one version after the other, the following upgrade files will be processed:'] = 'Prestashop sta aggiornando il tuo negozio una versione dopo l\'altra; saranno elaborati i seguenti file di aggiornamento:'; +$_LANG['Upgrade file'] = 'Aggiorna file'; +$_LANG['Modifications to process'] = 'Modifiche da elaborare'; +$_LANG['(major)'] = '(maggiore)'; +$_LANG['TOTAL'] = 'TOTALE'; +$_LANG['Estimated time to complete the'] = 'Tempo previsto per completare'; +$_LANG['modifications:'] = 'modifiche:'; +$_LANG['minutes'] = 'minuti'; +$_LANG['minute'] = 'minuto'; +$_LANG['seconds'] = 'secondi'; +$_LANG['second'] = 'secondo'; +$_LANG['Depending on your server and the size of your shop'] = 'In base al tuo server e alle dimensioni del tuo negozio'; +$_LANG['You did not update your shop for a while,'] = 'E\' da un po\' di tempo che non aggiorni il tuo negozio'; +$_LANG['major releases have been made available since.'] = 'Sono state messe a disposizione importanti novità'; +$_LANG['This is not a problem however the update may take several minutes, try to update your shop more frequently.'] = 'Questo non è un problema, comunque l’aggiornamento può impiegare diversi minuti: cerca di aggiornare il tuo negozio più spesso'; +$_LANG['No files to process, this might be an error.'] = 'Nessun file da elaborare, potrebbe esserci un errore'; +$_LANG['Hosting parameters'] = 'Parametri host'; +$_LANG['PrestaShop tries to automatically set the best settings for your server in order the update to be successful.'] = 'PrestaShop cerca di impostare automaticamente le migliori configurazioni per il tuo server in modo che l’aggiornamento riesca con successo.'; +$_LANG['PHP parameter'] = 'Parametro PHP'; +$_LANG['Description'] = 'Descrizione'; +$_LANG['Current value'] = 'Valuta attuale'; +$_LANG['Maximum allowed time for the upgrade'] = 'Tempo massimo concesso per l\'aggiornamento'; +$_LANG['Maximum memory allowed for the upgrade'] = 'Memoria massima concessa per l\'aggiornamento'; +$_LANG['All your settings seem to be OK, go for it!'] = 'Tutte le impostazioni sembrano OK, procedi pure!'; +$_LANG['Beware, your settings look correct but are not optimal, if you encounter problems (upgrade too long, memory error...), please ask your hosting provider to increase the values of these parameters (max_execution_time & memory_limit).'] = 'Attenzione, le tue impostazioni sembrano corrette ma non ottimali; se incontrassi dei problemi (aggiornamento troppo lungo, errore di memoria...), chiedi al tuo host di aumentare i valori di questi parametri (tempo massimo di esecuzione e limite di memoria).'; +$_LANG['We strongly recommend that you inform your hosting provider to modify the settings before process to the update.'] = 'Ti suggeriamo di informare il tuo host in modo da modificare le impostazioni prima di iniziare l’aggiornamento.'; +$_LANG['Let\'s go!'] = 'Via!'; +$_LANG['Click on the "Next" button to start the upgrade, this can take several minutes,'] = 'Clicca sul tasto “Successivo” per iniziare l’aggiornamento; potrebbero volerci alcuni minuti,'; +$_LANG['do not close the window and be patient.'] = 'non chiudere la finestra e attendi'; +$_LANG['Your update is completed!'] = 'L\'aggiornamento è completo!'; +$_LANG['Your shop version is now'] = 'La tua versione adesso è'; +$_LANG['New features in PrestaShop v'] = 'Nuove caratteristiche in PrestaShop v'; + diff --git a/install-dev/langs/list.xml b/install-dev/langs/list.xml new file mode 100644 index 000000000..a41934cd5 --- /dev/null +++ b/install-dev/langs/list.xml @@ -0,0 +1,53 @@ + + + + + + ../img/l/1.jpg + + + en-us + + en + + + + ../img/l/2.jpg + + + fr-fr + fr + + fr + + + + ../img/l/3.jpg + + + es-es + es + + es + + + + ../img/l/4.jpg + + + de-de + de + + de + + + + ../img/l/5.jpg + + + it-it + it + + it + + diff --git a/install-dev/langs/us.php b/install-dev/langs/us.php new file mode 100644 index 000000000..e8a1ffbfd --- /dev/null +++ b/install-dev/langs/us.php @@ -0,0 +1,85 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +@set_time_limit(0); +@ini_set('max_execution_time', '0'); +@ini_set('memory_limit', '64M'); +require(dirname(__FILE__).'/../config/autoload.php'); + +/* Redefine REQUEST_URI if empty (on some webservers...) */ +if (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] == '') + $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; +if ($tmp = strpos($_SERVER['REQUEST_URI'], '?')) + $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], 0, $tmp); +$_SERVER['REQUEST_URI'] = str_replace('//', '/', $_SERVER['REQUEST_URI']); + +define('INSTALL_VERSION', '1.4.1.0'); +define('INSTALL_PATH', dirname(__FILE__)); +define('PS_INSTALLATION_IN_PROGRESS', true); +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +define('SETTINGS_FILE', INSTALL_PATH.'/../config/settings.inc.php'); +define('DEFINES_FILE', INSTALL_PATH.'/../config/defines.inc.php'); +define('INSTALLER__PS_BASE_URI', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/')+1)))); +define('INSTALLER__PS_BASE_URI_ABSOLUTE', 'http://'.ToolsInstall::getHttpHost(false, true).INSTALLER__PS_BASE_URI); + +// XML Header +header('Content-Type: text/xml'); + +// Switching method +if(isset($_GET['method'])) +{ + switch ($_GET['method']) + { + case 'checkConfig' : + include_once('xml/checkConfig.php'); + break; + + case 'checkDB' : + include_once('xml/checkDB.php'); + break; + + case 'createDB' : + include_once('xml/createDB.php'); + break; + + case 'checkMail' : + include_once('xml/checkMail.php'); + break; + + case 'checkShopInfos' : + include_once('xml/checkShopInfos.php'); + break; + + case 'doUpgrade' : + include_once('xml/doUpgrade.php'); + break; + } +} diff --git a/install-dev/module_tools.php b/install-dev/module_tools.php new file mode 100644 index 000000000..1b4b7a224 --- /dev/null +++ b/install-dev/module_tools.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function moduleReinstaller($moduleName, $force = false) +{ + $module = Module::getInstanceByName($moduleName); + if (!is_object($module)) + die(Tools::displayError()); + if ($module->id AND ($module->uninstall() OR $force)) + return $module->install(); + return false; +} + diff --git a/install-dev/php/add_module_to_hook.php b/install-dev/php/add_module_to_hook.php new file mode 100644 index 000000000..8c86d9c22 --- /dev/null +++ b/install-dev/php/add_module_to_hook.php @@ -0,0 +1,58 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function add_module_to_hook($module_name, $hook_name) +{ + $result = false; + + $id_module = Db::getInstance()->getValue(' + SELECT `id_module` FROM `'._DB_PREFIX_.'module` + WHERE `name` = \''.pSQL($module_name).'\'' + ); + + if ((int)$id_module > 0) + { + $id_hook = Db::getInstance()->getValue(' + SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook_name).'\' + '); + + if ((int)$id_hook > 0) + { + $result = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) + VALUES ( + '.(int)$id_module.', + '.(int)$id_hook.', + (SELECT IFNULL( + (SELECT max_position from (SELECT MAX(position)+1 as max_position FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = '.(int)$id_hook.') AS max_position), 1)) + )'); + } + } + + return $result; +} + diff --git a/install-dev/php/add_new_tab.php b/install-dev/php/add_new_tab.php new file mode 100644 index 000000000..04657035a --- /dev/null +++ b/install-dev/php/add_new_tab.php @@ -0,0 +1,59 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function add_new_tab($className, $name, $id_parent) +{ + $array = array(); + foreach (explode('|', $name) AS $item) + { + $temp = explode(':', $item); + $array[$temp[0]] = $temp[1]; + } + + if (!(int)Db::getInstance()->getValue('SELECT count(id_tab) FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($className).'\' ')) + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\', + (SELECT MAX(t.position)+ 1 FROM `'._DB_PREFIX_.'tab` t WHERE t.id_parent = '.(int)$id_parent.'))'); + + foreach (Language::getLanguages() AS $lang) + { + Db::getInstance()->Execute(' + INSERT IGNORE INTO `'._DB_PREFIX_.'tab_lang` (`id_lang`, `id_tab`, `name`) + VALUES ('.(int)$lang['id_lang'].', ( + SELECT `id_tab` + FROM `'._DB_PREFIX_.'tab` + WHERE `class_name` = \''.pSQL($className).'\' LIMIT 0,1 + ), \''.pSQL(isset($array[$lang['iso_code']]) ? $array[$lang['iso_code']] : $array['en']).'\') + '); + } + + Db::getInstance()->Execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) + (SELECT `id_profile`, ( + SELECT `id_tab` + FROM `'._DB_PREFIX_.'tab` + WHERE `class_name` = \''.pSQL($className).'\' LIMIT 0,1 + ), 1, 1, 1, 1 FROM `'._DB_PREFIX_.'profile` )'); +} \ No newline at end of file diff --git a/install-dev/php/admin_stores_tab.php b/install-dev/php/admin_stores_tab.php new file mode 100644 index 000000000..3c844b033 --- /dev/null +++ b/install-dev/php/admin_stores_tab.php @@ -0,0 +1,21 @@ +ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \'AdminStores\'')) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tab` (`class_name`, `id_parent`, `position`) VALUES (\'AdminStores\', 0, 11)'); + + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tab_lang` (`id_lang`, `id_tab`, `name`) + VALUES + (1, (SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \'AdminStores\'), \'Stores\'), + (2, (SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \'AdminStores\'), \'Magasins\'), + (3, (SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \'AdminStores\'), \'Tiendas\')'); + + + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) ( + SELECT `id_profile`, (SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \'AdminStores\' LIMIT 1), 1, 1, 1, 1 FROM `'._DB_PREFIX_.'profile` + )'); + } +} + diff --git a/install-dev/php/alter_cms_block.php b/install-dev/php/alter_cms_block.php new file mode 100644 index 000000000..ded5fc023 --- /dev/null +++ b/install-dev/php/alter_cms_block.php @@ -0,0 +1,40 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function alter_cms_block() +{ + // No one will know if the table does not exist :] Thanks Damien for your solution ;) + DB::getInstance()->Execute('ALTER TABLE `PREFIX_cms_block_lang` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL'); + + DB::getInstance()->Execute('ALTER TABLE `PREFIX_cms_block` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL'); + + DB::getInstance()->Execute('ALTER TABLE `PREFIX_cms_block_page` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL'); + + DB::getInstance()->Execute('ALTER TABLE `ps_cms_block_page` CHANGE `id_block_cms_page` `id_cms_block_page` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT'); + +} + diff --git a/install-dev/php/blocknewsletter.php b/install-dev/php/blocknewsletter.php new file mode 100644 index 000000000..1c8908275 --- /dev/null +++ b/install-dev/php/blocknewsletter.php @@ -0,0 +1,33 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function blocknewsletter() +{ + // No one will know if the table does not exist :] + DB::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'newsletter ADD `http_referer` VARCHAR(255) NULL'); +} + diff --git a/install-dev/php/cms_block.php b/install-dev/php/cms_block.php new file mode 100644 index 000000000..13a441d4f --- /dev/null +++ b/install-dev/php/cms_block.php @@ -0,0 +1,33 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +function cms_block() +{ + if (!Db::getInstance()->execute('SELECT `display_store` FROM `'._DB_PREFIX_.'cms_block` LIMIT 1')) + return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'cms_block` ADD `display_store` TINYINT NOT NULL DEFAULT \'1\''); + return true; +} + diff --git a/install-dev/php/confcleaner.php b/install-dev/php/confcleaner.php new file mode 100644 index 000000000..d251e8889 --- /dev/null +++ b/install-dev/php/confcleaner.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function configuration_double_cleaner() +{ + $result = Db::getInstance()->ExecuteS(' + SELECT name, MIN(id_configuration) AS minid + FROM '._DB_PREFIX_.'configuration + GROUP BY name + HAVING count(name) > 1'); + foreach ($result as $row) + { + DB::getInstance()->Execute(' + DELETE FROM '._DB_PREFIX_.'configuration + WHERE name = \''.addslashes($row['name']).'\' + AND id_configuration != '.(int)($row['minid'])); + } + DB::getInstance()->Execute(' + DELETE FROM '._DB_PREFIX_.'configuration_lang + WHERE id_configuration NOT IN ( + SELECT id_configuration + FROM '._DB_PREFIX_.'configuration)'); +} + diff --git a/install-dev/php/country_to_timezone.php b/install-dev/php/country_to_timezone.php new file mode 100644 index 000000000..741bce232 --- /dev/null +++ b/install-dev/php/country_to_timezone.php @@ -0,0 +1,39 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$country = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $_GET['country']); + +$special = array( + 'US' => 'US/Eastern', + 'RU' => 'Europe/Moscow' +); + +if (!empty($_GET['country']) AND !empty($special[$_GET['country']])) + $country[0] = $special[$_GET['country']]; + +if(isset($country[0])) + echo $country[0]; diff --git a/install-dev/php/customizations.php b/install-dev/php/customizations.php new file mode 100644 index 000000000..9735aae4f --- /dev/null +++ b/install-dev/php/customizations.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('_CONTAINS_REQUIRED_FIELD_', 2); + +function add_required_customization_field_flag() +{ + if (($result = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'customization_field` WHERE `required` = 1')) === false) + return false; + if (Db::getInstance()->numRows()) + { + $productIds = array(); + foreach ($result AS $row) + $productIds[] = (int)($row['id_product']); + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `customizable` = '._CONTAINS_REQUIRED_FIELD_.' WHERE `id_product` IN ('.implode(', ', $productIds).')')) + return false; + } + return true; +} + diff --git a/install-dev/php/database_structure.php b/install-dev/php/database_structure.php new file mode 100644 index 000000000..c52dbd3e3 --- /dev/null +++ b/install-dev/php/database_structure.php @@ -0,0 +1,47 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function group_reduction_column_fix() +{ + if (!Db::getInstance()->execute('SELECT `group_reduction` FROM `'._DB_PREFIX_.'order_detail` LIMIT 1')) + return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `group_reduction` DECIMAL(10, 2) NOT NULL AFTER `reduction_amount`'); + return true; +} + +function ecotax_tax_application_fix() +{ + if (!Db::getInstance()->execute('SELECT `ecotax_tax_rate` FROM `'._DB_PREFIX_.'order_detail` LIMIT 1')) + return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `ecotax_tax_rate` DECIMAL(5, 3) NOT NULL AFTER `ecotax`'); + return true; +} + +function id_currency_country_fix() +{ + if (!Db::getInstance()->execute('SELECT `id_currency` FROM `'._DB_PREFIX_.'country` LIMIT 1')) + return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'country` ADD `id_currency` INT NOT NULL DEFAULT \'0\' AFTER `id_zone`'); + return true; +} \ No newline at end of file diff --git a/install-dev/php/deliverynumber.php b/install-dev/php/deliverynumber.php new file mode 100644 index 000000000..04dfded4d --- /dev/null +++ b/install-dev/php/deliverynumber.php @@ -0,0 +1,55 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function delivery_number_set() +{ + Configuration::loadConfiguration(); + $number = 1; + + // Update each order with a number + $result = Db::getInstance()->ExecuteS(' + SELECT id_order + FROM '._DB_PREFIX_.'orders + ORDER BY id_order'); + foreach ($result as $row) + { + $order = new Order((int)($row['id_order'])); + $history = $order->getHistory(false); + foreach ($history as $row2) + { + $oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT')); + if ($oS->delivery) + { + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET delivery_number = '.(int)($number++).', `delivery_date` = `date_add` WHERE id_order = '.(int)($order->id)); + break ; + } + } + } + // Add configuration var + Configuration::updateValue('PS_DELIVERY_NUMBER', (int)($number)); +} + diff --git a/install-dev/php/editorial_update.php b/install-dev/php/editorial_update.php new file mode 100644 index 000000000..5e5be356c --- /dev/null +++ b/install-dev/php/editorial_update.php @@ -0,0 +1,73 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function editorial_update() +{ + /*Table creation*/ + + if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name`="editorial"')) + { + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'editorial` ( + `id_editorial` int(10) unsigned NOT NULL auto_increment, + `body_home_logo_link` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`)) + ENGINE=MyISAM DEFAULT CHARSET=utf8'); + + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'editorial_lang` ( + `id_editorial` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `body_title` varchar(255) NOT NULL, + `body_subheading` varchar(255) NOT NULL, + `body_paragraph` text NOT NULL, + `body_logo_subheading` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`, `id_lang`)) + ENGINE=MyISAM DEFAULT CHARSET=utf8'); + + if (file_exists(dirname(__FILE__).'/../../modules/editorial/editorial.xml')) + { + $xml = simplexml_load_file(dirname(__FILE__).'/../../modules/editorial/editorial.xml'); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'editorial`(`id_editorial`, `body_home_logo_link`) VALUES(1, "'.(isset($xml->body->home_logo_link) ? pSQL($xml->body->home_logo_link) : '').'")'); + + + $languages = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'lang`'); + foreach ($languages as $language) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'editorial_lang` (`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`) + VALUES (1, '.(int)($language['id_lang']).', + "'.(isset($xml->body->{'title_'.$language['id_lang']}) ? pSQL($xml->body->{'title_'.$language['id_lang']}) : '').'", + "'.(isset($xml->body->{'subheading_'.$language['id_lang']}) ? pSQL($xml->body->{'subheading_'.$language['id_lang']}) : '').'", + "'.(isset($xml->body->{'paragraph_'.$language['id_lang']}) ? pSQL($xml->body->{'paragraph_'.$language['id_lang']}, true) : '').'", + "'.(isset($xml->body->{'logo_subheading_'.$language['id_lang']}) ? pSQL($xml->body->{'logo_subheading_'.$language['id_lang']}) : '').'")'); + + unlink(dirname(__FILE__).'/../../modules/editorial/editorial.xml'); + } + } +} + diff --git a/install-dev/php/generate_ntree.php b/install-dev/php/generate_ntree.php new file mode 100644 index 000000000..2bfaf107c --- /dev/null +++ b/install-dev/php/generate_ntree.php @@ -0,0 +1,31 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function generate_ntree() +{ + Category::regenerateEntireNtree(); +} diff --git a/install-dev/php/generate_tax_rules.php b/install-dev/php/generate_tax_rules.php new file mode 100644 index 000000000..59f47fb69 --- /dev/null +++ b/install-dev/php/generate_tax_rules.php @@ -0,0 +1,87 @@ +active = 1; + $group->name = 'Rule '.$tax['rate'].'%'; + $group->save(); + $id_tax_rules_group = $group->id; + + + $countries = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'country` c + LEFT JOIN `'._DB_PREFIX_.'zone` z ON (c.`id_zone` = z.`id_zone`) + LEFT JOIN `'._DB_PREFIX_.'tax_zone` tz ON (tz.`id_zone` = z.`id_zone`) + WHERE `id_tax` = '.(int)$id_tax + ); + if ($countries) + { + foreach ($countries AS $country) + { + $res = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`) + VALUES ( + '.(int)$group->id.', + '.(int)$country['id_country'].', + 0, + 0, + '.(int)$id_tax. + ')'); + + } + } + + $states = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'states s + LEFT JOIN `'._DB_PREFIX_.'tax_state ts ON (ts.`id_state` = s.`id_state`) + WHERE `id_tax` = '.(int)$id_tax + ); + + if ($states) + { + foreach ($states AS $state) + { + if (!in_array($state['tax_behavior'], array(PS_PRODUCT_TAX, PS_STATE_TAX, PS_BOTH_TAX))) + $tax_behavior = PS_PRODUCT_TAX; + else + $tax_behavior = $state['tax_behavior']; + + $res = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`) + VALUES ( + '.(int)$group->id.', + '.(int)$state['id_country'].', + '.(int)$state['id_state'].', + '.(int)$tax_behavior.', + '.(int)$id_tax. + ')'); + } + } + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product` + SET `id_tax_rules_group` = '.(int)$group->id.' + WHERE `id_tax` = '.(int)$id_tax + ); + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET `id_tax_rules_group` = '.(int)$group->id.' + WHERE `id_tax` = '.(int)$id_tax + ); + + + if (Configuration::get('SOCOLISSIMO_OVERCOST_TAX') == $id_tax) + Configuration::updateValue('SOCOLISSIMO_OVERCOST_TAX', $group->id); + } +} + diff --git a/install-dev/php/gridextjs_deprecated.php b/install-dev/php/gridextjs_deprecated.php new file mode 100644 index 000000000..2edbcc84d --- /dev/null +++ b/install-dev/php/gridextjs_deprecated.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function gridextjs_deprecated() +{ + if (file_exists(dirname(__FILE__).'/../../modules/gridextjs')) + return rename(dirname(__FILE__).'/../../modules/gridextjs', dirname(__FILE__).'/../../modules/gridextjs.deprecated'); + + return true; +} + diff --git a/install-dev/php/invoicenumber.php b/install-dev/php/invoicenumber.php new file mode 100644 index 000000000..6e05b8461 --- /dev/null +++ b/install-dev/php/invoicenumber.php @@ -0,0 +1,55 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function invoice_number_set() +{ + Configuration::loadConfiguration(); + $number = 1; + + // Update each order with a number + $result = Db::getInstance()->ExecuteS(' + SELECT id_order + FROM '._DB_PREFIX_.'orders + ORDER BY id_order'); + foreach ($result as $row) + { + $order = new Order((int)($row['id_order'])); + $history = $order->getHistory(false); + foreach ($history as $row2) + { + $oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT')); + if ($oS->invoice) + { + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET invoice_number = '.(int)($number++).', `invoice_date` = `date_add` WHERE id_order = '.(int)($order->id)); + break ; + } + } + } + // Add configuration var + Configuration::updateValue('PS_INVOICE_NUMBER', (int)($number)); +} + diff --git a/install-dev/php/module_tools.php b/install-dev/php/module_tools.php new file mode 100644 index 000000000..de5de2799 --- /dev/null +++ b/install-dev/php/module_tools.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function moduleReinstaller($moduleName, $force = false) +{ + $module = Module::getInstanceByName($moduleName); + if (!is_object($module)) + die(Tools::displayError()); + if ($module->uninstall() OR $force) + return $module->install(); + return false; +} + diff --git a/install-dev/php/move_crossselling.php b/install-dev/php/move_crossselling.php new file mode 100644 index 000000000..44aefb5f9 --- /dev/null +++ b/install-dev/php/move_crossselling.php @@ -0,0 +1,14 @@ +ExecuteS('SELECT FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\'')) +{ +Db::getInstance()->Execute(' +INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) +VALUES ((SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\'), 9, (SELECT max_position FROM (SELECT MAX(position)+1 as max_position FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = 9) tmp))'); +} + +} + diff --git a/install-dev/php/price_converter.php b/install-dev/php/price_converter.php new file mode 100644 index 000000000..2979bdb54 --- /dev/null +++ b/install-dev/php/price_converter.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Convert product prices from the PS < 1.3 wrong rounding system to the new 1.3 one */ +function convert_product_price() +{ + $taxes = Tax::getTaxes(); + $taxRates = array(); + foreach ($taxes as $data) + $taxRates[$data['id_tax']] = (float)($data['rate']) / 100; + $resource = DB::getInstance()->ExecuteS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`', false); + while ($row = DB::getInstance()->nextRow($resource)) + if ($row['id_tax']) + { + $price = $row['price'] * (1 + $taxRates[$row['id_tax']]); + $decimalPart = $price - (int)$price; + if ($decimalPart < 0.000001) + { + $newPrice = (float)(number_format($price, 6, '.', '')); + $newPrice = Tools::floorf($newPrice / (1 + $taxRates[$row['id_tax']]), 6); + DB::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `price` = '.$newPrice.' WHERE `id_product` = '.(int)($row['id_product'])); + } + } +} diff --git a/install-dev/php/regenerate_level_depth.php b/install-dev/php/regenerate_level_depth.php new file mode 100644 index 000000000..ab16f192b --- /dev/null +++ b/install-dev/php/regenerate_level_depth.php @@ -0,0 +1,42 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function regenerate_level_depth() +{ + $category = new Category(); + $cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT')); + foreach($cats as $cat) + { + $category = new Category((int)$cat['id_category']); + $catParent = new Category((int)$category->id_parent); + $category->level_depth = $catParent->level_depth +1; + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$category->level_depth.' WHERE `id_category` = '.(int)$category->id); + } + + Category::regenerateEntireNtree(); + +} \ No newline at end of file diff --git a/install-dev/php/reorderpositions.php b/install-dev/php/reorderpositions.php new file mode 100644 index 000000000..8560a08bf --- /dev/null +++ b/install-dev/php/reorderpositions.php @@ -0,0 +1,71 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function reorderpositions() +{ + /* Clean products positions */ + if ($cat = Category::getCategories(1, false, false)) + foreach($cat AS $i => $categ) + Product::cleanPositions((int)$categ['id_category']); + + //clean Category position and delete old position system + Language::loadLanguages(); + $language = Language::getLanguages(); + $cat_parent = Db::getInstance()->ExecuteS('SELECT DISTINCT c.id_parent FROM `'._DB_PREFIX_.'category` c WHERE id_category != 1'); + foreach($cat_parent AS $parent) + { + $result = Db::getInstance()->ExecuteS(' + SELECT DISTINCT c.*, cl.* + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)(Configuration::get('PS_LANG_DEFAULT')).') + WHERE c.id_parent = '.(int)($parent['id_parent']).' + ORDER BY name ASC'); + foreach($result AS $i => $categ) + { + $sizeof = sizeof($result); + for ($i = 0; $i < $sizeof; ++$i) + { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'category` + SET `position` = '.(int)($i).' + WHERE `id_parent` = '.(int)($categ['id_parent']).' + AND `id_category` = '.(int)($result[$i]['id_category'])); + } + + foreach($language AS $lang) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`) + SET `name` = \''.preg_replace('/^[0-9]+\./', '',$categ['name']).'\' + WHERE c.id_category = '.(int)($categ['id_category']).' AND id_lang = \''.(int)($lang['id_lang']).'\''); + } + } + + /* Clean CMS positions */ + if ($cms_cat = CMSCategory::getCategories(1, false, false)) + foreach($cms_cat AS $i => $categ) + CMS::cleanPositions((int)($categ['id_cms_category'])); +} \ No newline at end of file diff --git a/install-dev/php/setallgroupsonhomecategory.php b/install-dev/php/setallgroupsonhomecategory.php new file mode 100755 index 000000000..63d7605e6 --- /dev/null +++ b/install-dev/php/setallgroupsonhomecategory.php @@ -0,0 +1,40 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function setAllGroupsOnHomeCategory() +{ + $results = Group::getGroups(Configuration::get('PS_LANG_DEFAULT')); + $groups = array(); + foreach ($results AS $result) + $groups[] = $result['id_group']; + if (is_array($groups) && sizeof($groups)) + { + $category = new Category(1); + $category->cleanGroups(); + $category->addGroups($groups); + } +} diff --git a/install-dev/php/setdiscountcategory.php b/install-dev/php/setdiscountcategory.php new file mode 100644 index 000000000..7f61d7605 --- /dev/null +++ b/install-dev/php/setdiscountcategory.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function set_discount_category() +{ + $discounts = Db::getInstance()->ExecuteS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount`'); + $categories = Db::getInstance()->ExecuteS('SELECT `id_category` FROM `'._DB_PREFIX_.'category`'); + foreach ($discounts AS $discount) + foreach ($categories AS $category) + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'discount_category` (`id_discount`,`id_category`) VALUES ('.(int)($discount['id_discount']).','.(int)($category['id_category']).')'); +} + + diff --git a/install-dev/php/setpaymentmodule.php b/install-dev/php/setpaymentmodule.php new file mode 100644 index 000000000..2ed4f06fb --- /dev/null +++ b/install-dev/php/setpaymentmodule.php @@ -0,0 +1,54 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function set_payment_module() +{ + // Get all modules then select only payment ones + $modules = Module::getModulesInstalled(); + foreach ($modules AS $module) + { + $file = _PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php'; + if (!file_exists($file)) + continue; + $fd = fopen($file, 'r'); + if (!$fd) + continue ; + $content = fread($fd, filesize($file)); + if (preg_match_all('/extends PaymentModule/U', $content, $matches)) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_country` (id_module, id_country) + SELECT '.(int)($module['id_module']).', id_country FROM `'._DB_PREFIX_.'country` WHERE active = 1'); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_currency` (id_module, id_currency) + SELECT '.(int)($module['id_module']).', id_currency FROM `'._DB_PREFIX_.'currency` WHERE deleted = 0'); + } + fclose($fd); + } +} + + diff --git a/install-dev/php/setpaymentmodulegroup.php b/install-dev/php/setpaymentmodulegroup.php new file mode 100644 index 000000000..a13082677 --- /dev/null +++ b/install-dev/php/setpaymentmodulegroup.php @@ -0,0 +1,50 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function set_payment_module_group() +{ + // Get all modules then select only payment ones + $modules = Module::getModulesInstalled(); + foreach ($modules AS $module) + { + $file = _PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php'; + if (!file_exists($file)) + continue; + $fd = @fopen($file, 'r'); + if (!$fd) + continue ; + $content = fread($fd, filesize($file)); + if (preg_match_all('/extends PaymentModule/U', $content, $matches)) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'module_group` (id_module, id_group) + SELECT '.(int)($module['id_module']).', id_group FROM `'._DB_PREFIX_.'group`'); + } + fclose($fd); + } +} + diff --git a/install-dev/php/shop_url.php b/install-dev/php/shop_url.php new file mode 100644 index 000000000..7d4d06ac3 --- /dev/null +++ b/install-dev/php/shop_url.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function shop_url() +{ + if (!($host = Configuration::get('CANONICAL_URL'))) + $host = Tools::getHttpHost(); + Configuration::updateValue('PS_SHOP_DOMAIN', $host); + Configuration::updateValue('PS_SHOP_DOMAIN_SSL', $host); + return true; +} \ No newline at end of file diff --git a/install-dev/php/update_for_13version.php b/install-dev/php/update_for_13version.php new file mode 100644 index 000000000..488be28e2 --- /dev/null +++ b/install-dev/php/update_for_13version.php @@ -0,0 +1,16 @@ += 0) + return; // if the old version is a 1.4 version + + // Disable the Smarty 3 + Configuration::updateValue('PS_FORCE_SMARTY_2', 1); + // Disable the URL rewritting + Configuration::updateValue('PS_REWRITING_SETTINGS', 0); + // Disable Canonical redirection + Configuration::updateValue('PS_CANONICAL_REDIRECT', 0); +} \ No newline at end of file diff --git a/install-dev/php/update_image_size_in_db.php b/install-dev/php/update_image_size_in_db.php new file mode 100644 index 000000000..014dc40cf --- /dev/null +++ b/install-dev/php/update_image_size_in_db.php @@ -0,0 +1,42 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function update_image_size_in_db() +{ + if (file_exists(realpath(INSTALL_PATH.'/../img').'/logo.jpg')) + { + list($width, $height, $type, $attr) = getimagesize(realpath(INSTALL_PATH.'/../img').'/logo.jpg'); + Configuration::updateValue('SHOP_LOGO_WIDTH', (int)round($width)); + Configuration::updateValue('SHOP_LOGO_HEIGHT', (int)round($height)); + } + if (file_exists(realpath(INSTALL_PATH.'/../modules/editorial').'/homepage_logo.jpg')) + { + list($width, $height, $type, $attr) = getimagesize(realpath(INSTALL_PATH.'/../modules/editorial').'/homepage_logo.jpg'); + Configuration::updateValue('EDITORIAL_IMAGE_WIDTH', (int)round($width)); + Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height)); + } +} diff --git a/install-dev/php/update_order_details.php b/install-dev/php/update_order_details.php new file mode 100644 index 000000000..8cb6c8d0f --- /dev/null +++ b/install-dev/php/update_order_details.php @@ -0,0 +1,39 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function update_order_details() +{ + $res = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.'order_detail` LIKE \'reduction_percent\''); + + if (sizeof($res) == 0) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_percent` DECIMAL(10, 2) NOT NULL default \'0.00\' AFTER `product_price`'); + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_amount` DECIMAL(20, 6) NOT NULL default \'0.000000\' AFTER `reduction_percent`'); + } +} + + diff --git a/install-dev/php/update_products_ecotax_v133.php b/install-dev/php/update_products_ecotax_v133.php new file mode 100644 index 000000000..f7dc552ae --- /dev/null +++ b/install-dev/php/update_products_ecotax_v133.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function update_products_ecotax_v133() +{ + global $oldversion; + if($oldversion < '1.3.3.0') + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `ecotax` = \'0\' WHERE 1'); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'order_detail` SET `ecotax` = \'0\' WHERE 1;'); + } +} \ No newline at end of file diff --git a/install-dev/php/updatecarrierurl.php b/install-dev/php/updatecarrierurl.php new file mode 100644 index 000000000..03e6184e4 --- /dev/null +++ b/install-dev/php/updatecarrierurl.php @@ -0,0 +1,43 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function update_carrier_url() +{ + // Get all carriers + $sql = ' + SELECT c.`id_carrier`, c.`url` + FROM `'._DB_PREFIX_.'carrier` c'; + $carriers = Db::getInstance()->ExecuteS($sql); + + // Check each one and erase carrier URL if not correct URL + foreach ($carriers as $carrier) + if (!Validate::isAbsoluteUrl($carrier['url'])) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET `url` = \'\' + WHERE `id_carrier`= '.(int)($carrier['id_carrier'])); +} diff --git a/install-dev/php/updatemodulessql.php b/install-dev/php/updatemodulessql.php new file mode 100644 index 000000000..ef7c57b3a --- /dev/null +++ b/install-dev/php/updatemodulessql.php @@ -0,0 +1,41 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function update_modules_sql() +{ + Configuration::loadConfiguration(); + $blocklink = Module::getInstanceByName('blocklink'); + if ($blocklink->id) + Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'blocklink_lang` ADD PRIMARY KEY (`id_link`, `id_lang`);'); + $productComments = Module::getInstanceByName('productcomments'); + if ($productComments->id) + { + Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_grade` ADD PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`);'); + Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_product_comment_criterion`, `id_lang`);'); + Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion_product` ADD PRIMARY KEY(`id_product`, `id_product_comment_criterion`);'); + } +} diff --git a/install-dev/php/updateproductcomments.php b/install-dev/php/updateproductcomments.php new file mode 100644 index 000000000..68f3e929e --- /dev/null +++ b/install-dev/php/updateproductcomments.php @@ -0,0 +1,58 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function updateproductcomments() +{ + if (Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'product_comment') !== false) + { + Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_lang ( + `id_product_comment_criterion` INT( 11 ) UNSIGNED NOT NULL , + `id_lang` INT(11) UNSIGNED NOT NULL , + `name` VARCHAR(64) NOT NULL , + PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` ) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_category ( + `id_product_comment_criterion` int(10) unsigned NOT NULL, + `id_category` int(10) unsigned NOT NULL, + PRIMARY KEY(`id_product_comment_criterion`, `id_category`), + KEY `id_category` (`id_category`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `id_guest` INT(11) NULL AFTER `id_customer`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `customer_name` varchar(64) NULL AFTER `content`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `deleted` tinyint(1) NOT NULL AFTER `validate`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_customer)'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_guest)'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_product)'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `id_lang`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `name`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `id_product_comment_criterion_type` tinyint(1) NOT NULL AFTER `id_product_comment_criterion`'); + Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `active` tinyint(1) NOT NULL AFTER `id_product_comment_criterion_type`'); + Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment` ADD `title` VARCHAR(64) NULL AFTER `id_guest`;'); + } +} + + diff --git a/install-dev/php/utf8.php b/install-dev/php/utf8.php new file mode 100644 index 000000000..869a547d6 --- /dev/null +++ b/install-dev/php/utf8.php @@ -0,0 +1,135 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); +define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string')); + +function latin1_database_to_utf8() +{ + global $requests, $warningExist; + + $tables = array( + array('name' => 'address', 'id' => 'id_address', 'fields' => array('alias', 'company', 'name', 'surname', 'address1', 'address2', 'postcode', 'city', 'other', 'phone', 'phone_mobile')), + array('name' => 'alias', 'id' => 'id_alias', 'fields' => array('alias', 'search')), + array('name' => 'attribute_group_lang', 'id' => 'id_attribute_group', 'lang' => true, 'fields' => array('name', 'public_name')), + array('name' => 'attribute_lang', 'id' => 'id_attribute', 'lang' => true, 'fields' => array('name')), + array('name' => 'carrier', 'id' => 'id_carrier', 'fields' => array('name', 'url')), + array('name' => 'carrier_lang', 'id' => 'id_carrier', 'lang' => true, 'fields' => array('delay')), + array('name' => 'cart', 'id' => 'id_cart', 'fields' => array('gift_message')), + array('name' => 'category_lang', 'id' => 'id_category', 'lang' => true, 'fields' => array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description')), + array('name' => 'configuration', 'id' => 'id_configuration', 'fields' => array('name', 'value')), + array('name' => 'configuration_lang', 'id' => 'id_configuration', 'lang' => true, 'fields' => array('value')), + array('name' => 'contact', 'id' => 'id_contact', 'fields' => array('email')), + array('name' => 'contact_lang', 'id' => 'id_contact', 'lang' => true, 'fields' => array('name', 'description')), + array('name' => 'country', 'id' => 'id_country', 'fields' => array('iso_code')), + array('name' => 'country_lang', 'id' => 'id_country', 'lang' => true, 'fields' => array('name')), + array('name' => 'currency', 'id' => 'id_currency', 'fields' => array('name', 'iso_code', 'sign')), + array('name' => 'customer', 'id' => 'id_customer', 'fields' => array('email', 'passwd', 'name', 'surname')), + array('name' => 'discount', 'id' => 'id_discount', 'fields' => array('name')), + array('name' => 'discount_lang', 'id' => 'id_discount', 'lang' => true, 'fields' => array('description')), + array('name' => 'discount_type_lang', 'id' => 'id_discount_type', 'lang' => true, 'fields' => array('name')), + array('name' => 'employee', 'id' => 'id_employee', 'fields' => array('name', 'surname', 'email', 'passwd')), + array('name' => 'feature_lang', 'id' => 'id_feature', 'lang' => true, 'fields' => array('name')), + array('name' => 'feature_value_lang', 'id' => 'id_feature_value', 'lang' => true, 'fields' => array('value')), + array('name' => 'hook', 'id' => 'id_hook', 'fields' => array('name', 'title', 'description')), + array('name' => 'hook_module_exceptions', 'id' => 'id_hook_module_exceptions', 'fields' => array('file_name')), + array('name' => 'image_lang', 'id' => 'id_image', 'lang' => true, 'fields' => array('legend')), + array('name' => 'image_type', 'id' => 'id_image_type', 'fields' => array('name')), + array('name' => 'lang', 'id' => 'id_lang', 'fields' => array('name', 'iso_code')), + array('name' => 'manufacturer', 'id' => 'id_manufacturer', 'fields' => array('name')), + array('name' => 'message', 'id' => 'id_message', 'fields' => array('message')), + array('name' => 'module', 'id' => 'id_module', 'fields' => array('name')), + array('name' => 'orders', 'id' => 'id_order', 'fields' => array('payment', 'module', 'gift_message', 'shipping_number')), + array('name' => 'order_detail', 'id' => 'id_order_detail', 'fields' => array('product_name', 'product_reference', 'tax_name', 'download_hash')), + array('name' => 'order_discount', 'id' => 'id_order_discount', 'fields' => array('name')), + array('name' => 'order_state', 'id' => 'id_order_state', 'fields' => array('color')), + array('name' => 'order_state_lang', 'id' => 'id_order_state', 'lang' => true, 'fields' => array('name', 'template')), + array('name' => 'product', 'id' => 'id_product', 'fields' => array('ean13', 'reference')), + array('name' => 'product_attribute', 'id' => 'id_product_attribute', 'fields' => array('reference', 'ean13')), + array('name' => 'product_download', 'id' => 'id_product_download', 'fields' => array('display_filename', 'physically_filename')), + array('name' => 'product_lang', 'id' => 'id_product', 'lang' => true, 'fields' => array('description', 'description_short', 'link_rewrite', 'meta_description', 'meta_keywords', 'meta_title', 'name', 'availability')), + array('name' => 'profile_lang', 'id' => 'id_profile', 'lang' => true, 'fields' => array('name')), + array('name' => 'quick_access', 'id' => 'id_quick_access', 'fields' => array('link')), + array('name' => 'quick_access_lang', 'id' => 'id_quick_access', 'lang' => true, 'fields' => array('name')), + array('name' => 'supplier', 'id' => 'id_supplier', 'fields' => array('name')), + array('name' => 'tab', 'id' => 'id_tab', 'fields' => array('class_name')), + array('name' => 'tab_lang', 'id' => 'id_tab', 'lang' => true, 'fields' => array('name')), + array('name' => 'tag', 'id' => 'id_tag', 'fields' => array('name')), + array('name' => 'tax_lang', 'id' => 'id_tax', 'lang' => true, 'fields' => array('name')), + array('name' => 'zone', 'id' => 'id_zone', 'fields' => array('name')) + ); + + foreach ($tables AS $table) + { + /* Latin1 datas' selection */ + if (!Db::getInstance()->Execute('SET NAMES latin1')) + echo 'Cannot change the sql encoding to latin1!'; + $query = 'SELECT `'.$table['id'].'`'; + foreach ($table['fields'] AS $field) + $query .= ', `'.$field.'`'; + if (isset($table['lang']) AND $table['lang']) + $query .= ', `id_lang`'; + $query .= ' FROM `'._DB_PREFIX_.$table['name'].'`'; + $latin1Datas = Db::getInstance()->ExecuteS($query); + if ($latin1Datas === false) + { + $warningExist = true; + $requests .= ' + + + getMsgError()).']]> + getNumberError()).']]> + '."\n"; + } + + if (Db::getInstance()->NumRows()) + { + /* Utf-8 datas' restitution */ + if (!Db::getInstance()->Execute('SET NAMES utf8')) + echo 'Cannot change the sql encoding to utf8!'; + foreach ($latin1Datas AS $latin1Data) + { + $query = 'UPDATE `'._DB_PREFIX_.$table['name'].'` SET'; + foreach ($table['fields'] AS $field) + $query .= ' `'.$field.'` = \''.pSQL($latin1Data[$field]).'\','; + $query = rtrim($query, ','); + $query .= ' WHERE `'.$table['id'].'` = '.(int)($latin1Data[$table['id']]); + if (isset($table['lang']) AND $table['lang']) + $query .= ' AND `id_lang` = '.(int)($latin1Data['id_lang']); + if (!Db::getInstance()->Execute($query)) + { + $warningExist = true; + $requests .= ' + + + getMsgError()).']]> + getNumberError()).']]> + '."\n"; + } + } + } + } +} diff --git a/install-dev/preactivation.php b/install-dev/preactivation.php new file mode 100644 index 000000000..245bc3029 --- /dev/null +++ b/install-dev/preactivation.php @@ -0,0 +1,122 @@ +'), trim($object->{$field.'_'.((int)($_GET['language'])+1)})); + if (property_exists($object, $field.'_1')) + return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_1'})); + return ''; + } + + + + if ($_GET['request'] == 'form') + { + $p = addslashes(strtolower($_GET['partner'])); + $c = addslashes(strtolower($_GET['country_iso_code'])); + + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/preactivation/fields.php?version=1.0&partner='.$p.'&country_iso_code='.$c, false, $context); + + if ($content && $content[0] == '<') + { + $result = simplexml_load_string($content); + if ($result) + { + $varList = ""; + echo '
    '; + foreach ($result->field as $field) + { + echo '
    '; + if ($field->type == 'text' || $field->type == 'password') + echo 'size) ? 'size="'.$field->size.'"' : '').' value="'.(isset($_GET[trim($field->key)]) ? $_GET[trim($field->key)] : $field->default).'" />'; + elseif ($field->type == 'radio') + { + foreach ($field->values as $key => $value) + echo getPreinstallXmlLang($value, 'label').' value == $field->default ? 'checked="checked"' : '').' />'; + } + elseif ($field->type == 'select') + { + echo ''; + } + elseif ($field->type == 'date') + { + echo ''; + echo ''; + echo ''; + } + if (getPreinstallXmlLang($field, 'help')) + echo ' '.getPreinstallXmlLang($field, 'help'); + echo '

    '; + if ($field->type == 'date') + $varList .= "'&".$field->key."='+$('#".$p."_".$c."_form_".$field->key."_year').val()+'-'+$('#".$p."_".$c."_form_".$field->key."_month').val()+'-'+$('#".$p."_".$c."_form_".$field->key."_day').val()+\n"; + else + $varList .= "'&".$field->key."='+ encodeURIComponent($('#".$p."_".$c."_form_".$field->key."').val())+\n"; + } + echo ' + '; + } + } + + } + + + if ($_GET['request'] == 'send') + { + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $url = 'https://www.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']); + + // Protect fields + foreach ($_GET as $key => $value) + $_GET[$key] = strip_tags(str_replace(array('\'', '"'), '', trim($value))); + + // Encore Get, Send It and Get Answers + @require_once('../config/settings.inc.php'); + foreach ($_GET as $key => $val) + $url .= '&'.$key.'='.urlencode($val); + $url .= '&security='.md5($_GET['email']._COOKIE_IV_); + $content = @file_get_contents($url, false, $context); + if ($content) + echo $content; + else + echo 'KO|Could not connect with Prestashop.com'; + } + +?> diff --git a/install-dev/sql/db.sql b/install-dev/sql/db.sql new file mode 100644 index 000000000..e26fb12ed --- /dev/null +++ b/install-dev/sql/db.sql @@ -0,0 +1,1639 @@ +SET NAMES 'utf8'; + +CREATE TABLE `PREFIX_access` ( + `id_profile` int(10) unsigned NOT NULL, + `id_tab` int(10) unsigned NOT NULL, + `view` int(11) NOT NULL, + `add` int(11) NOT NULL, + `edit` int(11) NOT NULL, + `delete` int(11) NOT NULL, + PRIMARY KEY (`id_profile`,`id_tab`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_accessory` ( + `id_product_1` int(10) unsigned NOT NULL, + `id_product_2` int(10) unsigned NOT NULL, + KEY `accessory_product` (`id_product_1`,`id_product_2`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_address` ( + `id_address` int(10) unsigned NOT NULL auto_increment, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned default NULL, + `id_customer` int(10) unsigned NOT NULL default '0', + `id_manufacturer` int(10) unsigned NOT NULL default '0', + `id_supplier` int(10) unsigned NOT NULL default '0', + `alias` varchar(32) NOT NULL, + `company` varchar(32) default NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) default NULL, + `postcode` varchar(12) default NULL, + `city` varchar(64) NOT NULL, + `other` text, + `phone` varchar(16) default NULL, + `phone_mobile` varchar(16) default NULL, + `vat_number` varchar(32) default NULL, + `dni` varchar(16) DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '1', + `deleted` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_address`), + KEY `address_customer` (`id_customer`), + KEY `id_country` (`id_country`), + KEY `id_state` (`id_state`), + KEY `id_manufacturer` (`id_manufacturer`), + KEY `id_supplier` (`id_supplier`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_alias` ( + `id_alias` int(10) unsigned NOT NULL auto_increment, + `alias` varchar(255) NOT NULL, + `search` varchar(255) NOT NULL, + `active` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_alias`), + UNIQUE KEY `alias` (`alias`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attachment` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `file` varchar(40) NOT NULL, + `file_name` varchar(128) NOT NULL, + `mime` varchar(64) NOT NULL, + PRIMARY KEY (`id_attachment`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attachment_lang` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) default NULL, + `description` TEXT, + PRIMARY KEY (`id_attachment`, `id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attachment` ( + `id_product` int(10) unsigned NOT NULL, + `id_attachment` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product`,`id_attachment`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attribute` ( + `id_attribute` int(10) unsigned NOT NULL auto_increment, + `id_attribute_group` int(10) unsigned NOT NULL, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_attribute`), + KEY `attribute_group` (`id_attribute_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attribute_group` ( + `id_attribute_group` int(10) unsigned NOT NULL auto_increment, + `is_color_group` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_attribute_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attribute_group_lang` ( + `id_attribute_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `public_name` varchar(64) NOT NULL, + PRIMARY KEY (`id_attribute_group`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attribute_impact` ( + `id_attribute_impact` int(10) unsigned NOT NULL auto_increment, + `id_product` int(11) unsigned NOT NULL, + `id_attribute` int(11) unsigned NOT NULL, + `weight` float NOT NULL, + `price` decimal(17,2) NOT NULL, + PRIMARY KEY (`id_attribute_impact`), + UNIQUE KEY `id_product` (`id_product`,`id_attribute`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attribute_lang` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + PRIMARY KEY `attribute_lang` (`id_attribute`,`id_lang`), + KEY `id_lang` (`id_lang`,`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_carrier` ( + `id_carrier` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_tax_rules_group` int(10) unsigned DEFAULT '0', + `name` varchar(64) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0', + `shipping_handling` tinyint(1) unsigned NOT NULL DEFAULT '1', + `range_behavior` tinyint(1) unsigned NOT NULL DEFAULT '0', + `is_module` tinyint(1) unsigned NOT NULL DEFAULT '0', + `shipping_external` tinyint(1) unsigned NOT NULL DEFAULT '0', + `need_range` tinyint(1) unsigned NOT NULL DEFAULT '0', + `external_module_name` varchar(64) DEFAULT NULL, + `shipping_method` int(2) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_carrier`), + KEY `deleted` (`deleted`,`active`), + KEY `id_tax_rules_group` (`id_tax_rules_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_carrier_lang` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `delay` varchar(128) default NULL, + UNIQUE KEY `shipper_lang_index` (`id_lang`,`id_carrier`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_carrier_zone` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_zone` int(10) unsigned NOT NULL, + PRIMARY KEY `carrier_zone_index` (`id_carrier`,`id_zone`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cart` ( + `id_cart` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `id_address_delivery` int(10) unsigned NOT NULL, + `id_address_invoice` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_guest` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `recyclable` tinyint(1) unsigned NOT NULL default '1', + `gift` tinyint(1) unsigned NOT NULL default '0', + `gift_message` text, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_cart`), + KEY `cart_customer` (`id_customer`), + KEY `id_address_delivery` (`id_address_delivery`), + KEY `id_address_invoice` (`id_address_invoice`), + KEY `id_carrier` (`id_carrier`), + KEY `id_lang` (`id_lang`), + KEY `id_currency` (`id_currency`), + KEY `id_guest` (`id_guest`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cart_discount` ( + `id_cart` int(10) unsigned NOT NULL, + `id_discount` int(10) unsigned NOT NULL, + KEY `cart_discount_index` (`id_cart`,`id_discount`), + KEY `id_discount` (`id_discount`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cart_product` ( + `id_cart` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned default NULL, + `quantity` int(10) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + KEY `cart_product_index` (`id_cart`,`id_product`), + KEY `id_product_attribute` (`id_product_attribute`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_category` ( + `id_category` int(10) unsigned NOT NULL auto_increment, + `id_parent` int(10) unsigned NOT NULL, + `level_depth` tinyint(3) unsigned NOT NULL default '0', + `nleft` int(10) unsigned NOT NULL default '0', + `nright` int(10) unsigned NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_category`), + KEY `category_parent` (`id_parent`), + KEY `nleftright` (`nleft`,`nright`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_category_group` ( + `id_category` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + KEY `category_group_index` (`id_category`,`id_group`), + KEY `id_category` (`id_category`), + KEY `id_group` (`id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_category_lang` ( + `id_category` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `description` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_title` varchar(128) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_description` varchar(255) default NULL, + UNIQUE KEY `category_lang_index` (`id_category`,`id_lang`), + KEY `category_name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_category_product` ( + `id_category` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + KEY `category_product_index` (`id_category`,`id_product`), + INDEX (`id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms` ( + `id_cms` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_cms_category` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL DEFAULT '0', + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_cms`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_lang` ( + `id_cms` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `meta_title` varchar(128) NOT NULL, + `meta_description` varchar(255) default NULL, + `meta_keywords` varchar(255) default NULL, + `content` longtext, + `link_rewrite` varchar(128) NOT NULL, + PRIMARY KEY (`id_cms`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_category` ( + `id_cms_category` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_parent` int(10) unsigned NOT NULL, + `level_depth` tinyint(3) unsigned NOT NULL DEFAULT '0', + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_cms_category`), + KEY `category_parent` (`id_parent`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_category_lang` ( + `id_cms_category` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `description` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_title` varchar(128) DEFAULT NULL, + `meta_keywords` varchar(255) DEFAULT NULL, + `meta_description` varchar(255) DEFAULT NULL, + UNIQUE KEY `category_lang_index` (`id_cms_category`,`id_lang`), + KEY `category_name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_configuration` ( + `id_configuration` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `value` text, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_configuration`), + UNIQUE KEY `name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_configuration_lang` ( + `id_configuration` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `value` text, + `date_upd` datetime default NULL, + PRIMARY KEY (`id_configuration`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_connections` ( + `id_connections` int(10) unsigned NOT NULL auto_increment, + `id_guest` int(10) unsigned NOT NULL, + `id_page` int(10) unsigned NOT NULL, + `ip_address` BIGINT NULL DEFAULT NULL, + `date_add` datetime NOT NULL, + `http_referer` varchar(255) default NULL, + PRIMARY KEY (`id_connections`), + KEY `id_guest` (`id_guest`), + KEY `date_add` (`date_add`), + KEY `id_page` (`id_page`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_connections_page` ( + `id_connections` int(10) unsigned NOT NULL, + `id_page` int(10) unsigned NOT NULL, + `time_start` datetime NOT NULL, + `time_end` datetime default NULL, + PRIMARY KEY (`id_connections`,`id_page`,`time_start`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_connections_source` ( + `id_connections_source` int(10) unsigned NOT NULL auto_increment, + `id_connections` int(10) unsigned NOT NULL, + `http_referer` varchar(255) default NULL, + `request_uri` varchar(255) default NULL, + `keywords` varchar(255) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_connections_source`), + KEY `connections` (`id_connections`), + KEY `orderby` (`date_add`), + KEY `http_referer` (`http_referer`), + KEY `request_uri` (`request_uri`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_contact` ( + `id_contact` int(10) unsigned NOT NULL auto_increment, + `email` varchar(128) NOT NULL, + `customer_service` tinyint(1) NOT NULL DEFAULT 0, + `position` tinyint(2) unsigned NOT NULL default '0', + PRIMARY KEY (`id_contact`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_contact_lang` ( + `id_contact` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `description` text, + UNIQUE KEY `contact_lang_index` (`id_contact`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_country` ( + `id_country` int(10) unsigned NOT NULL auto_increment, + `id_zone` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL default '0', + `iso_code` varchar(3) NOT NULL, + `call_prefix` int(10) NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `contains_states` tinyint(1) NOT NULL default '0', + `need_identification_number` tinyint(1) NOT NULL default '0', + `need_zip_code` tinyint(1) NOT NULL default '1', + `zip_code_format` varchar(12) NOT NULL default '', + PRIMARY KEY (`id_country`), + KEY `country_iso_code` (`iso_code`), + KEY `country_` (`id_zone`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_country_lang` ( + `id_country` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `country_lang_index` (`id_country`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_country_tax` ( + `id_country_tax` int(11) NOT NULL AUTO_INCREMENT, + `id_country` int(11) NOT NULL, + `id_tax_rules_group` int(11) NOT NULL, + PRIMARY KEY (`id_country_tax`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_currency` ( + `id_currency` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `iso_code` varchar(3) NOT NULL default '0', + `iso_code_num` varchar(3) NOT NULL default '0', + `sign` varchar(8) NOT NULL, + `blank` tinyint(1) unsigned NOT NULL default '0', + `format` tinyint(1) unsigned NOT NULL default '0', + `decimals` tinyint(1) unsigned NOT NULL default '1', + `conversion_rate` decimal(13,6) NOT NULL, + `deleted` tinyint(1) unsigned NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '1', + PRIMARY KEY (`id_currency`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customer` ( + `id_customer` int(10) unsigned NOT NULL auto_increment, + `id_gender` int(10) unsigned NOT NULL, + `id_default_group` int(10) unsigned NOT NULL DEFAULT '1', + `firstname` varchar(32) NOT NULL, + `lastname` varchar(32) NOT NULL, + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP, + `birthday` date default NULL, + `newsletter` tinyint(1) unsigned NOT NULL default '0', + `ip_registration_newsletter` varchar(15) default NULL, + `newsletter_date_add` datetime default NULL, + `optin` tinyint(1) unsigned NOT NULL default '0', + `secure_key` varchar(32) NOT NULL default '-1', + `note` text, + `active` tinyint(1) unsigned NOT NULL default '0', + `is_guest` tinyint(1) NOT NULL default '0', + `deleted` tinyint(1) NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer`), + KEY `customer_email` (`email`), + KEY `customer_login` (`email`,`passwd`), + KEY `id_customer_passwd` (`id_customer`,`passwd`), + KEY `id_gender` (`id_gender`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customer_group` ( + `id_customer` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + PRIMARY KEY `customer_group_index` (`id_customer`,`id_group`), + INDEX customer_login(id_group), + KEY `id_customer` (`id_customer`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customer_message` ( + `id_customer_message` int(10) unsigned NOT NULL auto_increment, + `id_customer_thread` int(11) default NULL, + `id_employee` int(10) unsigned default NULL, + `message` text NOT NULL, + `file_name` varchar(18) DEFAULT NULL, + `ip_address` int(11) default NULL, + `user_agent` varchar(128) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_customer_message`), + KEY `id_customer_thread` (`id_customer_thread`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customer_thread` ( + `id_customer_thread` int(11) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `id_contact` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned default NULL, + `id_order` int(10) unsigned default NULL, + `id_product` int(10) unsigned default NULL, + `status` enum('open','closed','pending1','pending2') NOT NULL default 'open', + `email` varchar(128) NOT NULL, + `token` varchar(12) default NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer_thread`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_customization` ( + `id_customization` int(10) unsigned NOT NULL auto_increment, + `id_product_attribute` int(10) unsigned NOT NULL default '0', + `id_cart` int(10) unsigned NOT NULL, + `id_product` int(10) NOT NULL, + `quantity` int(10) NOT NULL, + `quantity_refunded` INT NOT NULL DEFAULT '0', + `quantity_returned` INT NOT NULL DEFAULT '0', + PRIMARY KEY (`id_customization`,`id_cart`,`id_product`), + KEY `id_product_attribute` (`id_product_attribute`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customization_field` ( + `id_customization_field` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `type` tinyint(1) NOT NULL, + `required` tinyint(1) NOT NULL, + PRIMARY KEY (`id_customization_field`), + KEY `id_product` (`id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customization_field_lang` ( + `id_customization_field` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id_customization_field`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customized_data` ( + `id_customization` int(10) unsigned NOT NULL, + `type` tinyint(1) NOT NULL, + `index` int(3) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id_customization`,`type`,`index`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_date_range` ( + `id_date_range` int(10) unsigned NOT NULL auto_increment, + `time_start` datetime NOT NULL, + `time_end` datetime NOT NULL, + PRIMARY KEY (`id_date_range`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_delivery` ( + `id_delivery` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_range_price` int(10) unsigned default NULL, + `id_range_weight` int(10) unsigned default NULL, + `id_zone` int(10) unsigned NOT NULL, + `price` decimal(17,2) NOT NULL, + PRIMARY KEY (`id_delivery`), + KEY `id_zone` (`id_zone`), + KEY `id_carrier` (`id_carrier`,`id_zone`), + KEY `id_range_price` (`id_range_price`), + KEY `id_range_weight` (`id_range_weight`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_discount` ( + `id_discount` int(10) unsigned NOT NULL auto_increment, + `id_discount_type` int(10) unsigned NOT NULL, + `behavior_not_exhausted` TINYINT(3) DEFAULT '1', + `id_customer` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL default 0, + `id_currency` int unsigned NOT NULL default 0, + `name` varchar(32) NOT NULL, + `value` decimal(17,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `quantity_per_user` int(10) unsigned NOT NULL default '1', + `cumulable` tinyint(1) unsigned NOT NULL default '0', + `cumulable_reduction` tinyint(1) unsigned NOT NULL default '0', + `date_from` datetime NOT NULL, + `date_to` datetime NOT NULL, + `minimal` decimal(17,2) default NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `cart_display` tinyint(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_discount`), + KEY `discount_name` (`name`), + KEY `discount_customer` (`id_customer`), + KEY `id_discount_type` (`id_discount_type`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_discount_category` ( + `id_category` int(11) unsigned NOT NULL, + `id_discount` int(11) unsigned NOT NULL, + PRIMARY KEY (`id_category`, `id_discount`), + KEY `discount` (`id_discount`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_discount_lang` ( + `id_discount` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_discount`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_discount_type` ( + `id_discount_type` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_discount_type`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_discount_type_lang` ( + `id_discount_type` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + PRIMARY KEY (`id_discount_type`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_employee` ( + `id_employee` int(10) unsigned NOT NULL auto_increment, + `id_profile` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL DEFAULT 0, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP, + `stats_date_from` date default NULL, + `stats_date_to` date default NULL, + `bo_color` varchar(32) default NULL, + `bo_theme` varchar(32) default NULL, + `bo_uimode` ENUM('hover','click') default 'click', + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_employee`), + KEY `employee_login` (`email`,`passwd`), + KEY `id_employee_passwd` (`id_employee`,`passwd`), + KEY `id_profile` (`id_profile`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_feature` ( + `id_feature` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_feature`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_feature_lang` ( + `id_feature` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) default NULL, + PRIMARY KEY (`id_feature`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_feature_product` ( + `id_feature` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_feature_value` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_feature`,`id_product`), + KEY `id_feature_value` (`id_feature_value`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_feature_value` ( + `id_feature_value` int(10) unsigned NOT NULL auto_increment, + `id_feature` int(10) unsigned NOT NULL, + `custom` tinyint(3) unsigned default NULL, + PRIMARY KEY (`id_feature_value`), + KEY `feature` (`id_feature`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_feature_value_lang` ( + `id_feature_value` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `value` varchar(255) default NULL, + PRIMARY KEY (`id_feature_value`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_group` ( + `id_group` int(10) unsigned NOT NULL auto_increment, + `reduction` decimal(17,2) NOT NULL default '0.00', + `price_display_method` TINYINT NOT NULL DEFAULT 0, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_group_lang` ( + `id_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `attribute_lang_index` (`id_group`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_group_reduction` ( + `id_group_reduction` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_group` INT(10) UNSIGNED NOT NULL, + `id_category` INT(10) UNSIGNED NOT NULL, + `reduction` DECIMAL(4, 3) NOT NULL, + PRIMARY KEY(`id_group_reduction`), + UNIQUE KEY(`id_group`, `id_category`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_group_reduction_cache` ( + `id_product` INT UNSIGNED NOT NULL, + `id_group` INT UNSIGNED NOT NULL, + `reduction` DECIMAL(4, 3) NOT NULL, + PRIMARY KEY(`id_product`, `id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_guest` ( + `id_guest` int(10) unsigned NOT NULL auto_increment, + `id_operating_system` int(10) unsigned default NULL, + `id_web_browser` int(10) unsigned default NULL, + `id_customer` int(10) unsigned default NULL, + `javascript` tinyint(1) default '0', + `screen_resolution_x` smallint(5) unsigned default NULL, + `screen_resolution_y` smallint(5) unsigned default NULL, + `screen_color` tinyint(3) unsigned default NULL, + `sun_java` tinyint(1) default NULL, + `adobe_flash` tinyint(1) default NULL, + `adobe_director` tinyint(1) default NULL, + `apple_quicktime` tinyint(1) default NULL, + `real_player` tinyint(1) default NULL, + `windows_media` tinyint(1) default NULL, + `accept_language` varchar(8) default NULL, + PRIMARY KEY (`id_guest`), + KEY `id_customer` (`id_customer`), + KEY `id_operating_system` (`id_operating_system`), + KEY `id_web_browser` (`id_web_browser`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_hook` ( + `id_hook` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `title` varchar(64) NOT NULL, + `description` text, + `position` tinyint(1) NOT NULL default '1', + `live_edit` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_hook`), + UNIQUE KEY `hook_name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_hook_module` ( + `id_module` int(10) unsigned NOT NULL, + `id_hook` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_hook`), + KEY `id_hook` (`id_hook`), + KEY `id_module` (`id_module`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_hook_module_exceptions` ( + `id_hook_module_exceptions` int(10) unsigned NOT NULL auto_increment, + `id_module` int(10) unsigned NOT NULL, + `id_hook` int(10) unsigned NOT NULL, + `file_name` varchar(255) default NULL, + PRIMARY KEY (`id_hook_module_exceptions`), + KEY `id_module` (`id_module`), + KEY `id_hook` (`id_hook`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_image` ( + `id_image` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL default '0', + `cover` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_image`), + KEY `image_product` (`id_product`), + UNIQUE KEY `product_position` (`id_product`,`position`), + KEY `id_product_cover` (`id_product`,`cover`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_image_lang` ( + `id_image` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `legend` varchar(128) default NULL, + UNIQUE KEY `image_lang_index` (`id_image`,`id_lang`), + KEY `id_image` (`id_image`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_image_type` ( + `id_image_type` int(10) unsigned NOT NULL auto_increment, + `name` varchar(16) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + `products` tinyint(1) NOT NULL default '1', + `categories` tinyint(1) NOT NULL default '1', + `manufacturers` tinyint(1) NOT NULL default '1', + `suppliers` tinyint(1) NOT NULL default '1', + `scenes` tinyint(1) NOT NULL default '1', + `stores` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_image_type`), + KEY `image_type_name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_lang` ( + `id_lang` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL default '0', + `iso_code` char(2) NOT NULL, + `language_code` char(5) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) NOT NULL default 0, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `short_description` varchar(254) default NULL, + `meta_title` varchar(128) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_description` varchar(255) default NULL, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_message` ( + `id_message` int(10) unsigned NOT NULL auto_increment, + `id_cart` int(10) unsigned default NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_employee` int(10) unsigned default NULL, + `id_order` int(10) unsigned NOT NULL, + `message` text NOT NULL, + `private` tinyint(1) unsigned NOT NULL default '1', + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_message`), + KEY `message_order` (`id_order`), + KEY `id_cart` (`id_cart`), + KEY `id_customer` (`id_customer`), + KEY `id_employee` (`id_employee`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_message_readed` ( + `id_message` int(10) unsigned NOT NULL, + `id_employee` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_message`,`id_employee`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_meta` ( + `id_meta` int(10) unsigned NOT NULL auto_increment, + `page` varchar(64) NOT NULL, + PRIMARY KEY (`id_meta`), + KEY `meta_name` (`page`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_meta_lang` ( + `id_meta` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `title` varchar(128) default NULL, + `description` varchar(255) default NULL, + `keywords` varchar(255) default NULL, + `url_rewrite` varchar(254) NOT NULL, + PRIMARY KEY (`id_meta`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module` ( + `id_module` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_module`), + KEY `name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module_country` ( + `id_module` int(10) unsigned NOT NULL, + `id_country` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_country`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module_currency` ( + `id_module` int(10) unsigned NOT NULL, + `id_currency` int(11) NOT NULL, + PRIMARY KEY (`id_module`,`id_currency`), + KEY `id_module` (`id_module`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module_group` ( + `id_module` int(10) unsigned NOT NULL, + `id_group` int(11) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_operating_system` ( + `id_operating_system` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + PRIMARY KEY (`id_operating_system`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_orders` ( + `id_order` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_cart` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL, + `id_address_delivery` int(10) unsigned NOT NULL, + `id_address_invoice` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `payment` varchar(255) NOT NULL, + `conversion_rate` decimal(13,6) NOT NULL default 1, + `module` varchar(255) default NULL, + `recyclable` tinyint(1) unsigned NOT NULL default '0', + `gift` tinyint(1) unsigned NOT NULL default '0', + `gift_message` text, + `shipping_number` varchar(32) default NULL, + `total_discounts` decimal(17,2) NOT NULL default '0.00', + `total_paid` decimal(17,2) NOT NULL default '0.00', + `total_paid_real` decimal(17,2) NOT NULL default '0.00', + `total_products` decimal(17,2) NOT NULL default '0.00', + `total_products_wt` DECIMAL(17, 2) NOT NULL default '0.00', + `total_shipping` decimal(17,2) NOT NULL default '0.00', + `carrier_tax_rate` DECIMAL(10, 3) NOT NULL default '0.00', + `total_wrapping` decimal(17,2) NOT NULL default '0.00', + `invoice_number` int(10) unsigned NOT NULL default '0', + `delivery_number` int(10) unsigned NOT NULL default '0', + `invoice_date` datetime NOT NULL, + `delivery_date` datetime NOT NULL, + `valid` int(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order`), + KEY `id_customer` (`id_customer`), + KEY `id_cart` (`id_cart`), + KEY `invoice_number` (`invoice_number`), + KEY `id_carrier` (`id_carrier`), + KEY `id_lang` (`id_lang`), + KEY `id_currency` (`id_currency`), + KEY `id_address_delivery` (`id_address_delivery`), + KEY `id_address_invoice` (`id_address_invoice`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_detail` ( + `id_order_detail` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `product_id` int(10) unsigned NOT NULL, + `product_attribute_id` int(10) unsigned default NULL, + `product_name` varchar(255) NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + `product_quantity_in_stock` int(10) unsigned NOT NULL default 0, + `product_quantity_refunded` int(10) unsigned NOT NULL default '0', + `product_quantity_return` int(10) unsigned NOT NULL default '0', + `product_quantity_reinjected` int(10) unsigned NOT NULL default 0, + `product_price` decimal(20,6) NOT NULL default '0.000000', + `reduction_percent` DECIMAL(10, 2) NOT NULL default '0.00', + `reduction_amount` DECIMAL(20, 6) NOT NULL default '0.000000', + `group_reduction` DECIMAL(10, 2) NOT NULL default '0.000000', + `product_quantity_discount` decimal(20,6) NOT NULL default '0.000000', + `product_ean13` varchar(13) default NULL, + `product_upc` varchar(12) default NULL, + `product_reference` varchar(32) default NULL, + `product_supplier_reference` varchar(32) default NULL, + `product_weight` float NOT NULL, + `tax_name` varchar(16) NOT NULL, + `tax_rate` DECIMAL(10, 3) NOT NULL DEFAULT '0.000', + `ecotax` decimal(21,6) NOT NULL default '0.00', + `ecotax_tax_rate` DECIMAL(5,3) NOT NULL DEFAULT '0.000', + `discount_quantity_applied` TINYINT(1) NOT NULL DEFAULT 0, + `download_hash` varchar(255) default NULL, + `download_nb` int(10) unsigned default '0', + `download_deadline` datetime default '0000-00-00 00:00:00', + PRIMARY KEY (`id_order_detail`), + KEY `order_detail_order` (`id_order`), + KEY `product_id` (`product_id`), + KEY `product_attribute_id` (`product_attribute_id`), + KEY `id_order_id_order_detail` (`id_order`, `id_order_detail`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_discount` ( + `id_order_discount` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `id_discount` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `value` decimal(17,2) NOT NULL default '0.00', + PRIMARY KEY (`id_order_discount`), + KEY `order_discount_order` (`id_order`), + KEY `id_discount` (`id_discount`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_history` ( + `id_order_history` int(10) unsigned NOT NULL auto_increment, + `id_employee` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `id_order_state` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_history`), + KEY `order_history_order` (`id_order`), + KEY `id_employee` (`id_employee`), + KEY `id_order_state` (`id_order_state`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_message` ( + `id_order_message` int(10) unsigned NOT NULL auto_increment, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_message`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_message_lang` ( + `id_order_message` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `message` text NOT NULL, + PRIMARY KEY (`id_order_message`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_return` ( + `id_order_return` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `state` tinyint(1) unsigned NOT NULL default '1', + `question` text NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_return`), + KEY `order_return_customer` (`id_customer`), + KEY `id_order` (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_return_detail` ( + `id_order_return` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `id_customization` int(10) unsigned NOT NULL default '0', + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_return`,`id_order_detail`,`id_customization`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_return_state` ( + `id_order_return_state` int(10) unsigned NOT NULL auto_increment, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_order_return_state`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_return_state_lang` ( + `id_order_return_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_return_state`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_slip` ( + `id_order_slip` int(10) unsigned NOT NULL auto_increment, + `conversion_rate` decimal(13,6) NOT NULL default 1, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `shipping_cost` tinyint(3) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_slip`), + KEY `order_slip_customer` (`id_customer`), + KEY `id_order` (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_slip_detail` ( + `id_order_slip` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_slip`,`id_order_detail`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_state` ( + `id_order_state` int(10) unsigned NOT NULL auto_increment, + `invoice` tinyint(1) unsigned default '0', + `send_email` tinyint(1) unsigned NOT NULL default '0', + `color` varchar(32) default NULL, + `unremovable` tinyint(1) unsigned NOT NULL, + `hidden` tinyint(1) UNSIGNED NOT NULL default '0', + `logable` tinyint(1) NOT NULL default '0', + `delivery` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_state`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_order_state_lang` ( + `id_order_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + `template` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_state`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_pack` ( + `id_product_pack` int(10) unsigned NOT NULL, + `id_product_item` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (`id_product_pack`,`id_product_item`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_page` ( + `id_page` int(10) unsigned NOT NULL auto_increment, + `id_page_type` int(10) unsigned NOT NULL, + `id_object` int(10) unsigned default NULL, + PRIMARY KEY (`id_page`), + KEY `id_page_type` (`id_page_type`), + KEY `id_object` (`id_object`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_page_type` ( + `id_page_type` int(10) unsigned NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id_page_type`), + KEY `name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_page_viewed` ( + `id_page` int(10) unsigned NOT NULL, + `id_date_range` int(10) unsigned NOT NULL, + `counter` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_page`,`id_date_range`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_payment_cc` ( + `id_payment_cc` INT NOT NULL auto_increment, + `id_order` INT UNSIGNED NULL, + `id_currency` INT UNSIGNED NOT NULL, + `amount` DECIMAL(10,2) NOT NULL, + `transaction_id` VARCHAR(254) NULL, + `card_number` VARCHAR(254) NULL, + `card_brand` VARCHAR(254) NULL, + `card_expiration` CHAR(7) NULL, + `card_holder` VARCHAR(254) NULL, + `date_add` DATETIME NOT NULL, + PRIMARY KEY (`id_payment_cc`), + KEY `id_order` (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product` ( + `id_product` int(10) unsigned NOT NULL auto_increment, + `id_supplier` int(10) unsigned default NULL, + `id_manufacturer` int(10) unsigned default NULL, + `id_tax_rules_group` int(10) unsigned NOT NULL, + `id_category_default` int(10) unsigned default NULL, + `id_color_default` int(10) unsigned default NULL, + `on_sale` tinyint(1) unsigned NOT NULL default '0', + `online_only` tinyint(1) unsigned NOT NULL default '0', + `ean13` varchar(13) default NULL, + `upc` varchar(12) default NULL, + `ecotax` decimal(17,6) NOT NULL default '0.00', + `quantity` int(10) NOT NULL default '0', + `minimal_quantity` int(10) unsigned NOT NULL default '1', + `price` decimal(20,6) NOT NULL default '0.000000', + `wholesale_price` decimal(20,6) NOT NULL default '0.000000', + `unity` varchar(255) default NULL, + `unit_price_ratio` decimal(20,6) NOT NULL default '0.000000', + `additional_shipping_cost` decimal(20,2) NOT NULL default '0.00', + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `width` float NOT NULL default '0', + `height` float NOT NULL default '0', + `depth` float NOT NULL default '0', + `weight` float NOT NULL default '0', + `out_of_stock` int(10) unsigned NOT NULL default '2', + `quantity_discount` tinyint(1) default '0', + `customizable` tinyint(2) NOT NULL default '0', + `uploadable_files` tinyint(4) NOT NULL default '0', + `text_fields` tinyint(4) NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `available_for_order` tinyint(1) NOT NULL default '1', + `condition` ENUM('new', 'used', 'refurbished') NOT NULL DEFAULT 'new', + `show_price` tinyint(1) NOT NULL default '1', + `indexed` tinyint(1) NOT NULL default '0', + `cache_is_pack` tinyint(1) NOT NULL default '0', + `cache_has_attachments` tinyint(1) NOT NULL default '0', + `cache_default_attribute` int(10) unsigned default NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_product`), + KEY `product_supplier` (`id_supplier`), + KEY `product_manufacturer` (`id_manufacturer`), + KEY `id_category_default` (`id_category_default`), + KEY `id_color_default` (`id_color_default`), + KEY `date_add` (`date_add`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attribute` ( + `id_product_attribute` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `ean13` varchar(13) default NULL, + `upc` varchar(12) default NULL, + `wholesale_price` decimal(20,6) NOT NULL default '0.000000', + `price` decimal(20,6) NOT NULL default '0.000000', + `ecotax` decimal(17,6) NOT NULL default '0.00', + `quantity` int(10) NOT NULL default '0', + `weight` float NOT NULL default '0', + `unit_price_impact` decimal(17,2) NOT NULL default '0.00', + `default_on` tinyint(1) unsigned NOT NULL default '0', + `minimal_quantity` int(10) unsigned NOT NULL DEFAULT '1', + PRIMARY KEY (`id_product_attribute`), + KEY `product_attribute_product` (`id_product`), + KEY `reference` (`reference`), + KEY `supplier_reference` (`supplier_reference`), + KEY `product_default` (`id_product`,`default_on`), + KEY `id_product_id_product_attribute` (`id_product_attribute` , `id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attribute_combination` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_attribute`,`id_product_attribute`), + KEY `id_product_attribute` (`id_product_attribute`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attribute_image` ( + `id_product_attribute` int(10) unsigned NOT NULL, + `id_image` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product_attribute`,`id_image`), + KEY `id_image` (`id_image`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_download` ( + `id_product_download` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `display_filename` varchar(255) default NULL, + `physically_filename` varchar(255) default NULL, + `date_deposit` datetime NOT NULL, + `date_expiration` datetime default NULL, + `nb_days_accessible` int(10) unsigned default NULL, + `nb_downloadable` int(10) unsigned default '1', + `active` tinyint(1) unsigned NOT NULL default '1', + PRIMARY KEY (`id_product_download`), + KEY `product_active` (`id_product`,`active`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_lang` ( + `id_product` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `description_short` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_description` varchar(255) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_title` varchar(128) default NULL, + `name` varchar(128) NOT NULL, + `available_now` varchar(255) default NULL, + `available_later` varchar(255) default NULL, + UNIQUE KEY `product_lang_index` (`id_product`,`id_lang`), + KEY `id_lang` (`id_lang`), + KEY `name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_sale` ( + `id_product` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL default '0', + `sale_nbr` int(10) unsigned NOT NULL default '0', + `date_upd` date NOT NULL, + PRIMARY KEY (`id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_tag` ( + `id_product` int(10) unsigned NOT NULL, + `id_tag` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product`,`id_tag`), + KEY `id_tag` (`id_tag`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_profile` ( + `id_profile` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_profile`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_profile_lang` ( + `id_lang` int(10) unsigned NOT NULL, + `id_profile` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + PRIMARY KEY (`id_profile`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_quick_access` ( + `id_quick_access` int(10) unsigned NOT NULL auto_increment, + `new_window` tinyint(1) NOT NULL default '0', + `link` varchar(128) NOT NULL, + PRIMARY KEY (`id_quick_access`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_quick_access_lang` ( + `id_quick_access` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_quick_access`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_range_price` ( + `id_range_price` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `delimiter1` decimal(20,6) NOT NULL, + `delimiter2` decimal(20,6) NOT NULL, + PRIMARY KEY (`id_range_price`), + UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_range_weight` ( + `id_range_weight` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `delimiter1` decimal(20,6) NOT NULL, + `delimiter2` decimal(20,6) NOT NULL, + PRIMARY KEY (`id_range_weight`), + UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_referrer` ( + `id_referrer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `passwd` varchar(32) default NULL, + `http_referer_regexp` varchar(64) default NULL, + `http_referer_like` varchar(64) default NULL, + `request_uri_regexp` varchar(64) default NULL, + `request_uri_like` varchar(64) default NULL, + `http_referer_regexp_not` varchar(64) default NULL, + `http_referer_like_not` varchar(64) default NULL, + `request_uri_regexp_not` varchar(64) default NULL, + `request_uri_like_not` varchar(64) default NULL, + `base_fee` decimal(5,2) NOT NULL default '0.00', + `percent_fee` decimal(5,2) NOT NULL default '0.00', + `click_fee` decimal(5,2) NOT NULL default '0.00', + `cache_visitors` int(11) default NULL, + `cache_visits` int(11) default NULL, + `cache_pages` int(11) default NULL, + `cache_registrations` int(11) default NULL, + `cache_orders` int(11) default NULL, + `cache_sales` decimal(17,2) default NULL, + `cache_reg_rate` decimal(5,4) default NULL, + `cache_order_rate` decimal(5,4) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_referrer`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_referrer_cache` ( + `id_connections_source` int(11) unsigned NOT NULL, + `id_referrer` int(11) unsigned NOT NULL, + PRIMARY KEY (`id_connections_source`, `id_referrer`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_scene` ( + `id_scene` int(10) unsigned NOT NULL auto_increment, + `active` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_scene`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_scene_category` ( + `id_scene` int(10) unsigned NOT NULL, + `id_category` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_scene`,`id_category`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_scene_lang` ( + `id_scene` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(100) NOT NULL, + PRIMARY KEY (`id_scene`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_scene_products` ( + `id_scene` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `x_axis` int(4) NOT NULL, + `y_axis` int(4) NOT NULL, + `zone_width` int(3) NOT NULL, + `zone_height` int(3) NOT NULL, + PRIMARY KEY (`id_scene`, `id_product`, `x_axis`, `y_axis`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_search_engine` ( + `id_search_engine` int(10) unsigned NOT NULL auto_increment, + `server` varchar(64) NOT NULL, + `getvar` varchar(16) NOT NULL, + PRIMARY KEY (`id_search_engine`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_search_index` ( + `id_product` int(11) unsigned NOT NULL, + `id_word` int(11) unsigned NOT NULL, + `weight` smallint(4) unsigned NOT NULL default 1, + PRIMARY KEY (`id_word`, `id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_search_word` ( + `id_word` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `word` varchar(15) NOT NULL, + PRIMARY KEY (`id_word`), + UNIQUE KEY `id_lang` (`id_lang`,`word`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_specific_price` ( + `id_specific_price` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_product` INT UNSIGNED NOT NULL, + `id_shop` TINYINT UNSIGNED NOT NULL, + `id_currency` INT UNSIGNED NOT NULL, + `id_country` INT UNSIGNED NOT NULL, + `id_group` INT UNSIGNED NOT NULL, + `price` DECIMAL(20, 6) NOT NULL, + `from_quantity` SMALLINT UNSIGNED NOT NULL, + `reduction` DECIMAL(20, 6) NOT NULL, + `reduction_type` ENUM('amount', 'percentage') NOT NULL, + `from` DATETIME NOT NULL, + `to` DATETIME NOT NULL, + PRIMARY KEY(`id_specific_price`), + KEY (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `from`, `to`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_state` ( + `id_state` int(10) unsigned NOT NULL auto_increment, + `id_country` int(11) unsigned NOT NULL, + `id_zone` int(11) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + `iso_code` char(4) NOT NULL, + `tax_behavior` smallint(1) NOT NULL default '0', + `active` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_state`), + KEY `id_country` (`id_country`), + KEY `id_zone` (`id_zone`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_subdomain` ( + `id_subdomain` int(10) unsigned NOT NULL auto_increment, + `name` varchar(16) NOT NULL, + PRIMARY KEY (`id_subdomain`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_supplier` ( + `id_supplier` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) NOT NULL default 0, + PRIMARY KEY (`id_supplier`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `meta_title` varchar(128) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_description` varchar(255) default NULL, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tab` ( + `id_tab` int(10) unsigned NOT NULL auto_increment, + `id_parent` int(11) NOT NULL, + `class_name` varchar(64) NOT NULL, + `module` varchar(64) NULL, + `position` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_tab`), + KEY `class_name` (`class_name`), + KEY `id_parent` (`id_parent`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tab_lang` ( + `id_lang` int(10) unsigned NOT NULL, + `id_tab` int(10) unsigned NOT NULL, + `name` varchar(32) default NULL, + PRIMARY KEY (`id_tab`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tag` ( + `id_tag` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_tag`), + KEY `tag_name` (`name`), + KEY `id_lang` (`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tax` ( + `id_tax` int(10) unsigned NOT NULL auto_increment, + `rate` DECIMAL(10, 3) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '1', + PRIMARY KEY (`id_tax`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tax_lang` ( + `id_tax` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `tax_lang_index` (`id_tax`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_timezone ( + id_timezone int(10) unsigned NOT NULL auto_increment, + name VARCHAR(32) NOT NULL, + PRIMARY KEY timezone_index(`id_timezone`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_web_browser` ( + `id_web_browser` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + PRIMARY KEY (`id_web_browser`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_zone` ( + `id_zone` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_zone`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_carrier_group` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + UNIQUE KEY `id_carrier` (`id_carrier`,`id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_stock_mvt` ( + `id_stock_mvt` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id_product` int(11) unsigned DEFAULT NULL, + `id_product_attribute` int(11) unsigned DEFAULT NULL, + `id_order` int(11) unsigned DEFAULT NULL, + `id_stock_mvt_reason` int(11) unsigned NOT NULL, + `id_employee` int(11) unsigned NOT NULL, + `quantity` int(11) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_stock_mvt`), + KEY `id_order` (`id_order`), + KEY `id_product` (`id_product`), + KEY `id_product_attribute` (`id_product_attribute`), + KEY `id_stock_mvt_reason` (`id_stock_mvt_reason`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_stock_mvt_reason` ( + `id_stock_mvt_reason` int(11) NOT NULL AUTO_INCREMENT, + `sign` tinyint(1) NOT NULL DEFAULT 1, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_stock_mvt_reason`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_stock_mvt_reason_lang` ( + `id_stock_mvt_reason` int(11) NOT NULL, + `id_lang` int(11) NOT NULL, + `name` varchar(255) CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`id_stock_mvt_reason`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_store` ( + `id_store` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned DEFAULT NULL, + `name` varchar(128) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) DEFAULT NULL, + `city` varchar(64) NOT NULL, + `postcode` varchar(12) NOT NULL, + `latitude` float(10,6) DEFAULT NULL, + `longitude` float(10,6) DEFAULT NULL, + `hours` varchar(254) DEFAULT NULL, + `phone` varchar(16) DEFAULT NULL, + `fax` varchar(16) DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `note` text, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_store`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_webservice_account` ( + `id_webservice_account` int(11) NOT NULL AUTO_INCREMENT, + `key` varchar(32) NOT NULL, + `description` text NULL, + `class_name` VARCHAR( 50 ) NOT NULL DEFAULT 'WebserviceRequest', + `active` tinyint(2) NOT NULL, + PRIMARY KEY (`id_webservice_account`), + KEY `key` (`key`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_webservice_permission` ( + `id_webservice_permission` int(11) NOT NULL AUTO_INCREMENT, + `resource` varchar(50) NOT NULL, + `method` enum('GET','POST','PUT','DELETE','HEAD') NOT NULL, + `id_webservice_account` int(11) NOT NULL, + PRIMARY KEY (`id_webservice_permission`), + UNIQUE KEY `resource_2` (`resource`,`method`,`id_webservice_account`), + KEY `resource` (`resource`), + KEY `method` (`method`), + KEY `id_webservice_account` (`id_webservice_account`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_required_field` ( + `id_required_field` int(11) NOT NULL AUTO_INCREMENT, + `object_name` varchar(32) NOT NULL, + `field_name` varchar(32) NOT NULL, + PRIMARY KEY (`id_required_field`), + KEY `object_name` (`object_name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_memcached_servers` ( +`id_memcached_server` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`ip` VARCHAR( 254 ) NOT NULL , +`port` INT(11) UNSIGNED NOT NULL , +`weight` INT(11) UNSIGNED NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_country_tax` ( + `id_product` int(11) NOT NULL, + `id_country` int(11) NOT NULL, + `id_tax` int(11) NOT NULL, + UNIQUE KEY `id_product` (`id_product`,`id_country`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_tax_rule` ( + `id_tax_rule` int(11) NOT NULL AUTO_INCREMENT, + `id_tax_rules_group` int(11) NOT NULL, + `id_country` int(11) NOT NULL, + `id_state` int(11) NOT NULL, + `id_county` int(11) NOT NULL, + `id_tax` int(11) NOT NULL, + `state_behavior` int(11) NOT NULL, + `county_behavior` int(11) NOT NULL, + PRIMARY KEY (`id_tax_rule`), + KEY `id_tax_rules_group` (`id_tax_rules_group`), + KEY `id_tax` (`id_tax`), + UNIQUE KEY `tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `id_county`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tax_rules_group` ( +`id_tax_rules_group` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`name` VARCHAR( 50 ) NOT NULL , +`active` INT NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_help_access` ( + `id_help_access` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(45) NOT NULL, + `version` varchar(8) NOT NULL, + PRIMARY KEY (`id_help_access`), + UNIQUE KEY `label` (`label`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_specific_price_priority` ( + `id_specific_price_priority` INT NOT NULL AUTO_INCREMENT , + `id_product` INT NOT NULL , + `priority` VARCHAR( 80 ) NOT NULL , + PRIMARY KEY ( `id_specific_price_priority` , `id_product` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_log` ( + `id_log` int(10) unsigned NOT NULL AUTO_INCREMENT, + `severity` tinyint(1) NOT NULL, + `error_code` int(11) DEFAULT NULL, + `message` text NOT NULL, + `object_type` varchar(32) DEFAULT NULL, + `object_id` int(10) unsigned DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_log`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_import_match` ( + `id_import_match` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(32) NOT NULL, + `match` text NOT NULL, + `skip` int(2) NOT NULL, + PRIMARY KEY (`id_import_match`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_county` ( + `id_county` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `id_state` int(11) NOT NULL, + `active` tinyint(1) NOT NULL, + PRIMARY KEY (`id_county`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ; + + +CREATE TABLE `PREFIX_county_zip_code` ( + `id_county` INT NOT NULL , + `from_zip_code` INT NOT NULL , + `to_zip_code` INT NOT NULL , + PRIMARY KEY ( `id_county` , `from_zip_code` , `to_zip_code` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + diff --git a/install-dev/sql/db_settings_extends.sql b/install-dev/sql/db_settings_extends.sql new file mode 100644 index 000000000..342231116 --- /dev/null +++ b/install-dev/sql/db_settings_extends.sql @@ -0,0 +1,1078 @@ +SET NAMES 'utf8'; + +/* Carrier */ +INSERT INTO `PREFIX_carrier` (`id_carrier`, `id_tax_rules_group`, `name`, `active`, `deleted`, `shipping_handling`) VALUES (2, 1, 'My carrier', 1, 0, 1); +INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) VALUES (2, 1); +INSERT INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`) VALUES (2, 1, 'Delivery next day!'),(2, 2, 'Livraison le lendemain !'),(2, 3, '¡Entrega día siguiente!'),(2, 4, 'Zustellung am nächsten Tag!'),(2, 5, 'Consegna il giorno dopo!'); +INSERT INTO `PREFIX_carrier_zone` (`id_carrier`, `id_zone`) VALUES (2, 1),(2, 2); + +UPDATE `PREFIX_configuration` SET `value` = '2' WHERE `name` = 'PS_CARRIER_DEFAULT'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('MB_PAY_TO_EMAIL', 'testmerchant@moneybookers.com', NOW(), NOW()), + ('MB_SECRET_WORD', 'mbtest', NOW(), NOW()), + ('MB_HIDE_LOGIN', 1, NOW(), NOW()), + ('MB_ID_LOGO', 1, NOW(), NOW()), + ('MB_ID_LOGO_WALLET', 1, NOW(), NOW()), + ('MB_PARAMETERS', 1, NOW(), NOW()), + ('MB_PARAMETERS_2', 1, NOW(), NOW()), + ('MB_DISPLAY_MODE', 0, NOW(), NOW()), + ('MB_CANCEL_URL', 'http://www.yoursite.com', NOW(), NOW()), + ('MB_LOCAL_METHODS', '2', NOW(), NOW()), + ('MB_INTER_METHODS', '5', NOW(), NOW()), + ('BANK_WIRE_CURRENCIES', '2,1', NOW(), NOW()), + ('CHEQUE_CURRENCIES', '2,1', NOW(), NOW()), + ('PRODUCTS_VIEWED_NBR', '2', NOW(), NOW()), + ('BLOCK_CATEG_DHTML', '1', NOW(), NOW()), + ('BLOCK_CATEG_MAX_DEPTH', '3', NOW(), NOW()), + ('MANUFACTURER_DISPLAY_FORM', '1', NOW(), NOW()), + ('MANUFACTURER_DISPLAY_TEXT', '1', NOW(), NOW()), + ('MANUFACTURER_DISPLAY_TEXT_NB', '5', NOW(), NOW()), + ('NEW_PRODUCTS_NBR', '5', NOW(), NOW()), + ('PS_TOKEN_ENABLE', '1', NOW(), NOW()), + ('PS_STATS_RENDER', 'graphxmlswfcharts', NOW(), NOW()), + ('PS_STATS_OLD_CONNECT_AUTO_CLEAN', 'never', NOW(), NOW()), + ('PS_STATS_GRID_RENDER', 'gridhtml', NOW(), NOW()), + ('BLOCKTAGS_NBR', '10', NOW(), NOW()), + ('CHECKUP_DESCRIPTIONS_LT', '100', NOW(), NOW()), + ('CHECKUP_DESCRIPTIONS_GT', '400', NOW(), NOW()), + ('CHECKUP_IMAGES_LT', '1', NOW(), NOW()), + ('CHECKUP_IMAGES_GT', '2', NOW(), NOW()), + ('CHECKUP_SALES_LT', '1', NOW(), NOW()), + ('CHECKUP_SALES_GT', '2', NOW(), NOW()), + ('CHECKUP_STOCK_LT', '1', NOW(), NOW()), + ('CHECKUP_STOCK_GT', '3', NOW(), NOW()), + ('FOOTER_CMS', '0_3|0_4', NOW(), NOW()), + ('FOOTER_BLOCK_ACTIVATION', '0_3|0_4', NOW(), NOW()), + ('BLOCKADVERT_LINK', 0, NOW(), NOW()), + ('BLOCKSTORE_IMG', 'store.jpg', NOW(), NOW()); + +INSERT INTO `PREFIX_module` (`id_module`, `name`, `active`) VALUES (1, 'homefeatured', 1),(2, 'gsitemap', 1),(3, 'cheque', 1),(4, 'moneybookers', 1),(5, 'editorial', 1), +(6, 'bankwire', 1),(7, 'blockadvertising', 1),(8, 'blockbestsellers', 1),(9, 'blockcart', 1),(10, 'blockcategories', 1),(11, 'blockcurrencies', 1),(12, 'blockcms', 1), +(13, 'blocklanguages', 1),(14, 'blockmanufacturer', 1),(15, 'blockmyaccount', 1),(16, 'blocknewproducts', 1),(17, 'blockpaymentlogo', 1),(18, 'blockpermanentlinks', 1), +(19, 'blocksearch', 1),(20, 'blockspecials', 1),(21, 'blocktags', 1),(22, 'blockuserinfo', 1),(24, 'blockviewed', 1),(25, 'statsdata', 1), +(26, 'statsvisits', 1),(27, 'statssales', 1),(28, 'statsregistrations', 1),(30, 'statspersonalinfos', 1),(31, 'statslive', 1),(32, 'statsequipment', 1),(33, 'statscatalog', 1), +(34, 'graphvisifire', 1),(35, 'graphxmlswfcharts', 1),(36, 'graphgooglechart', 1),(37, 'graphartichow', 1),(39, 'gridhtml', 1),(40, 'statsbestcustomers', 1), +(41, 'statsorigin', 1),(42, 'pagesnotfound', 1),(43, 'sekeywords', 1),(44, 'statsproduct', 1),(45, 'statsbestproducts', 1),(46, 'statsbestcategories', 1), +(47, 'statsbestvouchers', 1),(48, 'statsbestsuppliers', 1),(49, 'statscarrier', 1),(50, 'statsnewsletter', 1),(51, 'statssearch', 1),(52, 'statscheckup', 1),(53, 'statsstock', 1), +(54, 'blockstore', 1),(55, 'statsforecast', 1); + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES + ('myAccountBlock', 'My account block', 'Display extra informations inside the "my account" block', 1); + +INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES (3, 1, 1),(6, 1, 2),(4, 1, 3),(4, 4, 3),(8, 2, 1),(3, 4, 1),(6, 4, 2),(9, 6, 1),(16, 6, 2),(8, 6, 3), +(20, 6, 4),(12, 6, 5),(54, 6, 6),(15, 7, 1),(21, 7, 2),(10, 7, 3),(24, 7, 4),(14, 7, 5),(12, 7, 6),(7, 7, 7),(17, 7, 8),(5, 8, 1),(1, 8, 2),(11, 14, 1),(13, 14, 2),(18, 14, 3), +(19, 14, 4),(22, 14, 5),(8, 19, 1),(12, 21, 1),(25, 11, 1),(25, 21, 2),(26, 32, 1),(27, 32, 2),(28, 32, 3),(30, 32, 4),(31, 32, 5),(32, 32, 6),(33, 32, 7),(34, 33, 1), +(35, 33, 2),(36, 33, 3),(37, 33, 4),(39, 37, 1),(40, 32, 8),(41, 32, 9),(42, 32, 10),(43, 32, 11),(42, 14, 6),(43, 14, 7),(44, 32, 12),(45, 32, 13),(46, 32, 15), +(47, 32, 14),(48, 32, 16),(49, 32, 17),(55, 32, 22),(50, 32, 18),(51, 32, 19),(51, 45, 1),(25, 25, 1),(41, 20, 2),(52, 32, 20),(53, 32, 21),(17, 9, 2),(18, 9, 3),(24, 9, 4),(9, 9, 5), +(15, 9, 6),(5, 9, 7),(8, 9, 8),(10, 9, 9),(20, 9, 10),(11, 9, 11),(16, 9, 12),(22, 9, 13),(13, 9, 14),(14, 9, 15),(12, 9, 16),(7, 9, 17),(21, 9, 18),(10, 60, 1),(10, 61, 1),(10, 62, 1),(54, 9, 19) +,(10,65,1), (10,66,1); + +CREATE TABLE `PREFIX_pagenotfound` ( + `id_pagenotfound` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `request_uri` VARCHAR(256) NOT NULL, + `http_referer` VARCHAR(256) NOT NULL, + `date_add` DATETIME NOT NULL, + PRIMARY KEY(`id_pagenotfound`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_statssearch` ( + `id_statssearch` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `keywords` VARCHAR(255) NOT NULL, + `results` INT(6) NOT NULL DEFAULT 0, + `date_add` DATETIME NOT NULL, + PRIMARY KEY(`id_statssearch`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_sekeyword` ( + `id_sekeyword` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `keyword` VARCHAR(256) NOT NULL, + `date_add` DATETIME NOT NULL, + PRIMARY KEY(`id_sekeyword`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +CREATE TABLE `PREFIX_cms_block` ( + `id_cms_block` int(10) unsigned NOT NULL auto_increment, + `id_cms_category` int(10) unsigned NOT NULL, + `name` varchar(40) NOT NULL, + `location` tinyint(1) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + `display_store` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`id_cms_block`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_block_page` ( + `id_cms_block_page` int(10) unsigned NOT NULL auto_increment, + `id_cms_block` int(10) unsigned NOT NULL, + `id_cms` int(10) unsigned NOT NULL, + `is_category` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`id_cms_block_page`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_block_lang` ( + `id_cms_block` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(40) NOT NULL default '', + PRIMARY KEY (`id_cms_block`, `id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_editorial` ( + `id_editorial` int(10) unsigned NOT NULL auto_increment, + `body_home_logo_link` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_editorial_lang` ( + `id_editorial` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `body_title` varchar(255) NOT NULL, + `body_subheading` varchar(255) NOT NULL, + `body_paragraph` text NOT NULL, + `body_logo_subheading` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`, `id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_editorial` (`id_editorial`, `body_home_logo_link`) VALUES (1, 'http://www.prestashop.com'); +INSERT INTO `PREFIX_editorial_lang` (`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`) VALUES +(1, 1, 'Lorem ipsum dolor sit amet', 'Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', '

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

    ', 'Excepteur sint prestashop cupidatat non proident'), +(1, 2, 'Lorem ipsum dolor sit amet', 'Excepteur sint occaecat cupidatat non proident', '

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

    ', 'Lorem ipsum presta shop amet'), +(1, 3, 'Lorem ipsum dolor sit amet', 'Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', '

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

    ', 'Excepteur sint prestashop cupidatat non proident'), +(1, 4, 'Lorem ipsum dolor sit amet', 'Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', '

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

    ', 'Excepteur sint prestashop cupidatat non proident'), +(1, 5, 'Lorem ipsum dolor sit amet', 'Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', '

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

    ', 'Excepteur sint prestashop cupidatat non proident'); + +INSERT INTO `PREFIX_range_price` (`id_range_price`, `id_carrier`, `delimiter1`, `delimiter2`) VALUES (1, 2, 0, 10000); +INSERT INTO `PREFIX_range_weight` (`id_range_weight`, `id_carrier`, `delimiter1`, `delimiter2`) VALUES (1, 2, 0, 10000); +INSERT INTO `PREFIX_delivery` (`id_delivery`, `id_range_price`, `id_range_weight`, `id_carrier`, `id_zone`, `price`) VALUES +(1, NULL, 1, 2, 1, 5.00),(2, NULL, 1, 2, 2, 5.00),(4, 1, NULL, 2, 1, 5.00),(5, 1, NULL, 2, 2, 5.00); + +INSERT INTO `PREFIX_customer_group` (`id_customer`, `id_group`) VALUES (1, 1); +INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) VALUES (2, 1),(3, 1),(4, 1); + +INSERT INTO `PREFIX_customer` (`id_customer`, `id_gender`, `id_default_group`, `secure_key`, `email`, `passwd`, `birthday`, `lastname`, `newsletter`, `optin`, `firstname`, `active`, `is_guest`, `date_add`, `date_upd`) + VALUES (1, 1, 1, '47ce86627c1f3c792a80773c5d2deaf8', 'pub@prestashop.com', 'ad807bdf0426766c05c64041124d30ce', '1970-01-15', 'DOE', 1, 1, 'John', 1, 0, NOW(), NOW()); +INSERT INTO `PREFIX_connections` (`id_connections`, `id_guest`, `id_page`, `ip_address`, `date_add`, `http_referer`) + VALUES (1, 1, 1, '2130706433', NOW(), 'http://www.prestashop.com'); +INSERT INTO `PREFIX_guest` (`id_guest`, `id_operating_system`, `id_web_browser`, `id_customer`, `javascript`, `screen_resolution_x`, `screen_resolution_y`, `screen_color`, `sun_java`, `adobe_flash`, `adobe_director`, `apple_quicktime`, `real_player`, `windows_media`, `accept_language`) + VALUES (1, 1, 3, 1, 1, 1680, 1050, 32, 1, 1, 0, 1, 1, 0, 'en-us'); + +INSERT INTO `PREFIX_cart` (`id_cart`, `id_carrier`, `id_lang`, `id_address_delivery`, `id_address_invoice`, `id_currency`, `id_customer`, `id_guest`, `recyclable`, `gift`, `date_add`, `date_upd`) + VALUES (1, 2, 2, 6, 6, 1, 1, 1, 1, 0, NOW(), NOW()); +INSERT INTO `PREFIX_cart_product` (`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`) VALUES (1, 7, 23, 1, NOW()); +INSERT INTO `PREFIX_cart_product` (`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`) VALUES (1, 9, 0, 1, NOW()); + +INSERT INTO `PREFIX_orders` (`id_order`, `id_carrier`, `id_lang`, `id_customer`, `id_cart`, `id_currency`, `id_address_delivery`, `id_address_invoice`, `secure_key`, `payment`, `module`, `recyclable`, `gift`, `gift_message`, `shipping_number`, `total_discounts`, `total_paid`, `total_paid_real`, `total_products`, `total_products_wt`, `total_shipping`, `total_wrapping`, `invoice_number`, `delivery_number`, `invoice_date`, `delivery_date`, `date_add`, `date_upd`) + VALUES (1, 2, 2, 1, 1, 1, 2, 2, '47ce86627c1f3c792a80773c5d2deaf8', 'Chèque', 'cheque', 0, 0, '', '', '0.00', '625.98', '625.98', '516.72', '618.00', '7.98', '0.00', 0, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', NOW(), NOW()); +INSERT INTO `PREFIX_order_detail` (`id_order_detail`, `id_order`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_return`, `product_price`, `product_quantity_discount`, `product_ean13`, `product_reference`, `product_supplier_reference`, `product_weight`, `tax_name`, `tax_rate`, `ecotax`, `download_hash`, `download_nb`, `download_deadline`) + VALUES (1, 1, 7, 23, 'iPod touch - Capacité: 32Go', 1, 0, '392.140500', '0.000000', NULL, NULL, NULL, 0, 'TVA 19.6%', '19.60', '0.00', '', 0, '0000-00-00 00:00:00'); +INSERT INTO `PREFIX_order_detail` (`id_order_detail`, `id_order`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_return`, `product_price`, `product_quantity_discount`, `product_ean13`, `product_reference`, `product_supplier_reference`, `product_weight`, `tax_name`, `tax_rate`, `ecotax`, `download_hash`, `download_nb`, `download_deadline`) + VALUES (2, 1, 9, 0, 'Écouteurs à isolation sonore Shure SE210', 1, 0, '124.581900', '0.000000', NULL, NULL, NULL, 0, 'TVA 19.6%', '19.60', '0.00', '', 0, '0000-00-00 00:00:00'); +INSERT INTO `PREFIX_order_history` (`id_order_history`, `id_employee`, `id_order`, `id_order_state`, `date_add`) VALUES (1, 0, 1, 1, NOW()); + +INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'Apple Computer, Inc', NOW(), NOW(), 1); +INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES(2, 'Shure Incorporated', NOW(), NOW(), 1); + +INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `lastname`, `firstname`, `address1`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`) + VALUES (1, 21, 5, 0, 1, 0, 'manufacturer', 'JOBS', 'STEVE', '1 Infinite Loop', '95014', 'Cupertino', '(800) 275-2273', NOW(), NOW(), 1, 0); +INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `company`, `lastname`, `firstname`, `address1`, `address2`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`) + VALUES (2, 8, 0, 1, 0, 0, 'Mon adresse', 'My Company', 'DOE', 'John', '16, Main street', '2nd floor', '75000', 'Paris ', '0102030405', NOW(), NOW(), 1, 0); + +INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'AppleStore', NOW(), NOW(), 1); +INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (2, 'Shure Online Store', NOW(), NOW(), 1); + +INSERT INTO `PREFIX_product` (`id_product`, `indexed`, `id_supplier`, `id_manufacturer`, `id_tax_rules_group`, `id_category_default`, `id_color_default`, `on_sale`, `online_only`, `ean13`, `ecotax`, `quantity`, `price`, `wholesale_price`, `reference`, `supplier_reference`, `weight`, `out_of_stock`, `quantity_discount`, `customizable`, `uploadable_files`, `text_fields`, `active`, `date_add`, `date_upd`) VALUES +(1, 1, 1, 1, 1, 2, 2, 0, 0, '0', 0.00, 800, 124.581940, 70.000000, '', '', 0.5, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(2, 1, 1, 1, 1, 2, 0, 0, 0, '0', 0.00, 100, 66.053500, 33.000000, '', '', 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(5, 1, 1, 1, 1, 4, 0, 0, 0, '0', 0.00, 274, 1504.180602, 1000.000000, '', NULL, 1.36, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(6, 1, 1, 1, 1, 4, 0, 0, 0, '0', 0.00, 250, 1170.568561, 0.000000, '', NULL, 0.75, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(7, 1, 0, 0, 1, 2, 0, 0, 0, '', 0.00, 180, 241.638796, 200.000000, '', NULL, 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(8, 1, 0, 0, 1, 3, 0, 0, 1, '', 0.00, 1, 25.041806, 0.000000, '', NULL, 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()), +(9, 1, 2, 2, 1, 3, 0, 0, 1, '', 0.00, 1, 124.581940, 0.000000, '', NULL, 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()); + + +INSERT INTO `PREFIX_product_lang` (`id_product`, `id_lang`, `description`, `description_short`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`, `available_now`, `available_later`) VALUES +(1, 1, '

    Curved ahead of the curve.

    \r\n

    For those about to rock, we give you nine amazing colors. But that''s only part of the story. Feel the curved, all-aluminum and glass design and you won''t want to put iPod nano down.

    \r\n

    Great looks. And brains, too.

    \r\n

    The new Genius feature turns iPod nano into your own highly intelligent, personal DJ. It creates playlists by finding songs in your library that go great together.

    \r\n

    Made to move with your moves.

    \r\n

    The accelerometer comes to iPod nano. Give it a shake to shuffle your music. Turn it sideways to view Cover Flow. And play games designed with your moves in mind.

    ', '

    New design. New features. Now in 8GB and 16GB. iPod nano rocks like never before.

    ', 'ipod-nano', '', '', '', 'iPod Nano', 'In stock', ''), +(1, 2, '

    Des courbes avantageuses.

    \r\n

    Pour les amateurs de sensations, voici neuf nouveaux coloris. Et ce n''est pas tout ! Faites l''expérience du design elliptique en aluminum et verre. Vous ne voudrez plus le lâcher.

    \r\n

    Beau et intelligent.

    \r\n

    La nouvelle fonctionnalité Genius fait d''iPod nano votre DJ personnel. Genius crée des listes de lecture en recherchant dans votre bibliothèque les chansons qui vont bien ensemble.

    \r\n

    Fait pour bouger avec vous.

    \r\n

    iPod nano est équipé de l''accéléromètre. Secouez-le pour mélanger votre musique. Basculez-le pour afficher Cover Flow. Et découvrez des jeux adaptés à vos mouvements.

    ', '

    Nouveau design. Nouvelles fonctionnalités. Désormais en 8 et 16 Go. iPod nano, plus rock que jamais.

    ', 'ipod-nano', '', '', '', 'iPod Nano', 'En stock', ''), +(2, 1, '

    Instant attachment.

    \r\n

    Wear up to 500 songs on your sleeve. Or your belt. Or your gym shorts. iPod shuffle is a badge of musical devotion. Now in new, more brilliant colors.

    \r\n

    Feed your iPod shuffle.

    \r\n

    iTunes is your entertainment superstore. It’s your ultra-organized music collection and jukebox. And it’s how you load up your iPod shuffle in one click.

    \r\n

    Beauty and the beat.

    \r\n

    Intensely colorful anodized aluminum complements the simple design of iPod shuffle. Now in blue, green, pink, red, and original silver.

    ', '

    iPod shuffle, the world’s most wearable music player, now clips on in more vibrant blue, green, pink, and red.

    ', 'ipod-shuffle', '', '', '', 'iPod shuffle', 'In stock', ''), +(2, 2, '

    Un lien immédiat.

    \r\n

    Portez jusqu''à 500 chansons accrochées à votre manche, à votre ceinture ou à votre short. Arborez votre iPod shuffle comme signe extérieur de votre passion pour la musique. Existe désormais en quatre nouveaux coloris encore plus éclatants.

    \r\n

    Emplissez votre iPod shuffle.

    \r\n

    iTunes est un immense magasin dédié au divertissement, une collection musicale parfaitement organisée et un jukebox. Vous pouvez en un seul clic remplir votre iPod shuffle de chansons.

    \r\n

    La musique en technicolor.

    \r\n

    iPod shuffle s''affiche désormais dans de nouveaux coloris intenses qui rehaussent le design épuré du boîtier en aluminium anodisé. Choisissez parmi le bleu, le vert, le rose, le rouge et l''argenté d''origine.

    ', '

    iPod shuffle, le baladeur le plus portable du monde, se clippe maintenant en bleu, vert, rose et rouge.

    ', 'ipod-shuffle', '', '', '', 'iPod shuffle', 'En stock', ''), +(5, 1, '

    MacBook Air is nearly as thin as your index finger. Practically every detail that could be streamlined has been. Yet it still has a 13.3-inch widescreen LED display, full-size keyboard, and large multi-touch trackpad. It’s incomparably portable without the usual ultraportable screen and keyboard compromises.

    The incredible thinness of MacBook Air is the result of numerous size- and weight-shaving innovations. From a slimmer hard drive to strategically hidden I/O ports to a lower-profile battery, everything has been considered and reconsidered with thinness in mind.

    MacBook Air is designed and engineered to take full advantage of the wireless world. A world in which 802.11n Wi-Fi is now so fast and so available, people are truly living untethered — buying and renting movies online, downloading software, and sharing and storing files on the web.

    ', 'MacBook Air is ultrathin, ultraportable, and ultra unlike anything else. But you don’t lose inches and pounds overnight. It’s the result of rethinking conventions. Of multiple wireless innovations. And of breakthrough design. With MacBook Air, mobile computing suddenly has a new standard.', 'macbook-air', '', '', '', 'MacBook Air', '', NULL), +(5, 2, '

    MacBook Air est presque aussi fin que votre index. Pratiquement tout ce qui pouvait être simplifié l''a été. Il n''en dispose pas moins d''un écran panoramique de 13,3 pouces, d''un clavier complet et d''un vaste trackpad multi-touch. Incomparablement portable il vous évite les compromis habituels en matière d''écran et de clavier ultra-portables.

    L''incroyable finesse de MacBook Air est le résultat d''un grand nombre d''innovations en termes de réduction de la taille et du poids. D''un disque dur plus fin à des ports d''E/S habilement dissimulés en passant par une batterie plus plate, chaque détail a été considéré et reconsidéré avec la finesse à l''esprit.

    MacBook Air a été conçu et élaboré pour profiter pleinement du monde sans fil. Un monde dans lequel la norme Wi-Fi 802.11n est désormais si rapide et si accessible qu''elle permet véritablement de se libérer de toute attache pour acheter des vidéos en ligne, télécharger des logicééééiels, stocker et partager des fichiers sur le Web.

    ', 'MacBook Air est ultra fin, ultra portable et ultra différent de tout le reste. Mais on ne perd pas des kilos et des centimètres en une nuit. C''est le résultat d''une réinvention des normes. D''une multitude d''innovations sans fil. Et d''une révolution dans le design. Avec MacBook Air, l''informatique mobile prend soudain une nouvelle dimension.', 'macbook-air', '', '', '', 'MacBook Air', '', NULL), +(6, 1, 'Every MacBook has a larger hard drive, up to 250GB, to store growing media collections and valuable data.

    The 2.4GHz MacBook models now include 2GB of memory standard — perfect for running more of your favorite applications smoothly.', 'MacBook makes it easy to hit the road thanks to its tough polycarbonate case, built-in wireless technologies, and innovative MagSafe Power Adapter that releases automatically if someone accidentally trips on the cord.', 'macbook', '', '', '', 'MacBook', '', NULL), +(6, 2, 'Chaque MacBook est équipé d''un disque dur plus spacieux, d''une capacité atteignant 250 Go, pour stocker vos collections multimédia en expansion et vos données précieuses.

    Le modèle MacBook à 2,4 GHz intègre désormais 2 Go de mémoire en standard. L''idéal pour exécuter en souplesse vos applications préférées.', 'MacBook vous offre la liberté de mouvement grâce à son boîtier résistant en polycarbonate, à ses technologies sans fil intégrées et à son adaptateur secteur MagSafe novateur qui se déconnecte automatiquement si quelqu''un se prend les pieds dans le fil.', 'macbook', '', '', '', 'MacBook', '', NULL), +(7, 1, '

    Five new hands-on applications

    \r\n

    View rich HTML email with photos as well as PDF, Word, and Excel attachments. Get maps, directions, and real-time traffic information. Take notes and read stock and weather reports.

    \r\n

    Touch your music, movies, and more

    \r\n

    The revolutionary Multi-Touch technology built into the gorgeous 3.5-inch display lets you pinch, zoom, scroll, and flick with your fingers.

    \r\n

    Internet in your pocket

    \r\n

    With the Safari web browser, see websites the way they were designed to be seen and zoom in and out with a tap.2 And add Web Clips to your Home screen for quick access to favorite sites.

    \r\n

    What''s in the box

    \r\n', '', 'ipod-touch', '', '', '', 'iPod touch', '', NULL), +(7, 2, '

    Titre 1

    \r\n

    Titre 2

    \r\n

    Titre 3

    \r\n

    Titre 4

    \r\n
    Titre 5
    \r\n
    Titre 6
    \r\n\r\n
      \r\n
    1. OL
    2. \r\n
    3. OL
    4. \r\n
    5. OL
    6. \r\n
    7. OL
    8. \r\n
    \r\n

    paragraphe...

    \r\n

    paragraphe...

    \r\n

    paragraphe...

    \r\n\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    th th th
    tdtdtd
    tdtdtd
    \r\n

    Cinq nouvelles applications sous la main

    \r\n

    Consultez vos e-mails au format HTML enrichi, avec photos et pieces jointes au format PDF, Word et Excel. Obtenez des cartes, des itinéraires et des informations sur l''état de la circulation en temps réel. Rédigez des notes et consultez les cours de la Bourse et les bulletins météo.

    \r\n

    Touchez du doigt votre musique et vos vidéos. Entre autres.

    \r\n

    La technologie multi-touch révolutionnaire intégrée au superbe écran de 3,5 pouces vous permet d''effectuer des zooms avant et arrière, de faire défiler et de feuilleter des pages à l''aide de vos seuls doigts.

    \r\n

    Internet dans votre poche

    \r\n

    Avec le navigateur Safari, vous pouvez consulter des sites web dans leur mise en page d''origine et effectuer un zoom avant et arrière d''une simple pression sur l''écran.

    \r\n

    Contenu du coffret

    \r\n\r\n

     

    ', '

    Interface multi-touch révolutionnaire
    Écran panoramique couleur de 3,5 pouces
    Wi-Fi (802.11b/g)
    8 mm d''épaisseur
    Safari, YouTube, iTunes Wi-Fi Music Store, Courrier, Cartes, Bourse, Météo, Notes

    ', 'ipod-touch', '', '', '', 'iPod touch', 'En stock', NULL), +(8, 1, '

    Lorem ipsum

    ', '

    Lorem ipsum

    ', 'belkin-leather-folio-for-ipod-nano-black-chocolate', '', '', '', 'Belkin Leather Folio for iPod nano - Black / Chocolate', '', NULL), +(8, 2, '

    Caractéristiques

    \r\n
  • Cuir doux résistant
  • \r\n
  • Accès au bouton Hold
  • \r\n
  • Fermeture magnétique
  • \r\n
  • Accès au Dock Connector
  • \r\n
  • Protège-écran
  • ', '

    Cet étui en cuir tendance assure une protection complète contre les éraflures et les petits aléas de la vie quotidienne. Sa conception élégante et compacte vous permet de glisser votre iPod directement dans votre poche ou votre sac à main.

    ', 'housse-portefeuille-en-cuir-ipod-nano-noir-chocolat', '', '', '', 'Housse portefeuille en cuir (iPod nano) - Noir/Chocolat', '', NULL), +(9, 1, '
    Using Hi-Definition MicroSpeakers to deliver full-range audio, the ergonomic and lightweight design of the SE210 earphones is ideal for premium on-the-go listening on your iPod or iPhone. They offer the most accurate audio reproduction from both portable and home stereo audio sources--for the ultimate in precision highs and rich low end. In addition, the flexible design allows you to choose the most comfortable fit from a variety of wearing positions.

    Features
    \r\n
      \r\n
    • Sound-isolating design
    • \r\n
    • Hi-Definition MicroSpeaker with a single balanced armature driver
    • \r\n
    • Detachable, modular cable so you can make the cable longer or shorter depending on your activity
    • \r\n
    • Connector compatible with earphone ports on both iPod and iPhone
    • \r\n
    \r\nSpecifications
    \r\n
      \r\n
    • Speaker type: Hi-Definition MicroSpeaker
    • \r\n
    • Frequency range: 25Hz-18.5kHz
    • \r\n
    • Impedance (1kHz): 26 Ohms
    • \r\n
    • Sensitivity (1mW): 114 dB SPL/mW
    • \r\n
    • Cable length (with extension): 18.0 in./45.0 cm (54.0 in./137.1 cm)
    • \r\n
    \r\nIn the box
    \r\n
      \r\n
    • Shure SE210 earphones
    • \r\n
    • Extension cable (36.0 in./91.4 cm)
    • \r\n
    • Three pairs foam earpiece sleeves (small, medium, large)
    • \r\n
    • Three pairs soft flex earpiece sleeves (small, medium, large)
    • \r\n
    • One pair triple-flange earpiece sleeves
    • \r\n
    • Carrying case
    • \r\n
    \r\nWarranty
    Two-year limited
    (For details, please visit
    www.shure.com/PersonalAudio/CustomerSupport/ProductReturnsAndWarranty/index.htm.)

    Mfr. Part No.: SE210-A-EFS

    Note: Products sold through this website that do not bear the Apple Brand name are serviced and supported exclusively by their manufacturers in accordance with terms and conditions packaged with the products. Apple''s Limited Warranty does not apply to products that are not Apple-branded, even if packaged or sold with Apple products. Please contact the manufacturer directly for technical support and customer service.
    ', '

    Evolved from personal monitor technology road-tested by pro musicians and perfected by Shure engineers, the lightweight and stylish SE210 delivers full-range audio that''s free from outside noise.

    ', 'ecouteurs-a-isolation-sonore-shure-se210-blanc', '', '', '', 'Shure SE210 Sound-Isolating Earphones for iPod and iPhone', '', NULL), +(9, 2, '

    Basés sur la technologie des moniteurs personnels testée sur la route par des musiciens professionnels et perfectionnée par les ingénieurs Shure, les écouteurs SE210, légers et élégants, fournissent une sortie audio à gamme étendue exempte de tout bruit externe.


    Conception à isolation sonore
    Les embouts à isolation sonore fournis bloquent plus de 90 % du bruit ambiant. Combinés à un design ergonomique séduisant et un câble modulaire, ils minimisent les intrusions du monde extérieur, vous permettant de vous concentrer sur votre musique. Conçus pour les amoureux de la musique qui souhaitent faire évoluer leur appareil audio portable, les écouteurs SE210 vous permettent d''emmener la performance avec vous.

    Micro-transducteur haute définition
    Développés pour une écoute de qualité supérieure en déplacement, les écouteurs SE210 utilisent un seul transducteur à armature équilibrée pour bénéficier d''une gamme audio étendue. Le résultat ? Un confort d''écoute époustouflant qui restitue tous les détails d''un spectacle live.

    \r\n

    Le kit universel Deluxe comprend les éléments suivants :
    - Embouts à isolation sonore
    Les embouts à isolation sonore inclus ont un double rôle : bloquer les bruits ambiants et garantir un maintien et un confort personnalisés. Comme chaque oreille est différente, le kit universel Deluxe comprend trois tailles (S, M, L) d''embouts mousse et flexibles. Choisissez la taille et le style d''embout qui vous conviennent le mieux : une bonne étanchéité est un facteur clé pour optimiser l''isolation sonore et la réponse des basses, ainsi que pour accroître le confort en écoute prolongée.

    - Câble modulaire
    En se basant sur les commentaires de nombreux utilisateurs, les ingénieurs de Shure ont développé une solution de câble détachable pour permettre un degré de personnalisation sans précédent. Le câble de 1 mètre fourni vous permet d''adapter votre confort en fonction de l''activité et de l''application.

    - Étui de transport
    Outre les embouts à isolation sonore et le câble modulaire, un étui de transport compact et résistant est fourni avec les écouteurs SE210 pour vous permettre de ranger vos écouteurs de manière pratique et sans encombres.

    - Garantie limitée de deux ans
    Chaque solution SE210 achetée est couverte par une garantie pièces et main-d''œuvre de deux ans.

    Caractéristiques techniques

    \r\n\r\n

    Contenu du coffret

    \r\n', '

    Les écouteurs à isolation sonore ergonomiques et légers offrent la reproduction audio la plus fidèle en provenance de sources audio stéréo portables ou de salon.

    ', 'ecouteurs-a-isolation-sonore-shure-se210', '', '', '', 'Écouteurs à isolation sonore Shure SE210', '', NULL), +(7, 3, '

    Cinco nuevas aplicaciones a mano

    \r\n


    Consulta tu correo en formato HTML enriquecido, con fotos y ficheros adjuntos en formato PDF, Word y Excel. Consigue mapas, itinerarios e información sobre el estado de la carreteras en tiempo real. Escribe notas y consulta la bolsa y el tiempo.
    Alcanza con un dedo tu música y tus videos, entre otras cosas.
    La tecnología multi-touch revolucionaria integrada a la magnífica pantalla de 3,5 pulgadas te permitirá efectuar zoom hacia adelante y hacia atrás, y pasar y ojear las páginas solo con la ayuda de tus dedos.

    \r\n

    Internet en tu bolsillo

    \r\n

    Con el navegador Safari, podrás consultar sitios web en su compaginación de origen y efectuar un zoom hacia adelante y hacia atrás con la simple presión de un dedo en la pantalla.

    \r\n

    Contenido del estuche
    * iPod touch
    * Auriculares
    * Cable USB 2.0
    * Adaptador Dock
    * Paño de limpieza
    * Base
    * Guía de inicio rápido
    Título
    Párrafo

    ', '

    Interfaz multi-touch revolucionaria
    Pantalla panorámica color de 3,5 pulgadas
    Wi-Fi (802.11b/g)
    8 mm de espesor
    Safari, YouTube, iTunes Wi-Fi Music Store, Correo, Mapas, Bolsa, El tiempo, Notas

    ', 'ipod-touch', '', '', '', 'iPod touch', 'Disponible', ''), +(1, 3, '

    Curvas aerodinámicas.

    \r\n

    Para los aficionados a las sensaciones fuertes, os presentamos nueve nuevos colores. ¡ Y eso no es todo ! Experimenta el diseño elíptico de aluminio y vidrio. ¡ No querrás separarte de él nunca más !

    \r\n


    Estético e inteligente.

    \r\n

    La nueva aplicación Genius hace de iPod nano tu discjockey personal. Genuis crea listas de lectura buscando en tu biblioteca las canciones que combinan entre si.

    \r\n


    Hecho para moverse contigo.

    iPod nano está equipado de un acelerómetro. Muévelo para mezclar tu música. Voltéalo para mostrar Cover Flow. Y descubre juegos adaptados a tus movimientos.

    ', '

    Nuevo diseño. Nuevas aplicaciones. Ahora disponible en 8 y 16 Go. iPod nano, más rock que nunca.

    ', 'ipod-nano', '', '', '', 'iPod Nano', 'Disponible', ''), +(2, 3, '

    Un enlace inmediato.

    Lleva hasta 500 canciones colgadas de tu manga, de tu cinturón o de tu pantalón. Presume con tu iPod shuffle como signo exterior de tu pasión por la música. Ahora ya existen cuatro nuevos colores más llamativos.

    Llena tu iPod shuffle.

    iTunes es una enorme tienda dedicada a la diversión, una colección de música organizada perfectamente y un jukebox. Con tan solo un clic puedes llenar tu iPod shuffle con canciones.

    La música en tecnicolor.

    iPod shuffle presenta nuevos colores vivos que realzan su diseño estilizado en aluminio anodizado. Elige entre azul, verde, rosa, rojo y el plateado de origen.

    ', '

    iPod shuffle, el walkman más portátil del mundo, ahora en azul, verde, rosa y rojo.

    ', 'ipod-shuffle', '', '', '', 'iPod shuffle', 'Disponible', ''), +(6, 3, '

    Cada MacBook está equipado de un disco duro más espacioso, de una capacidad de hasta 250 Go, para almacenar tus colecciones multimedia en expansión y tus datos más preciados.
    El modelo MacBook de 2,4 GHz integra 2 Go de memoria en estándar. Lo ideal para realizar sin dificultad tus aplicaciones preferidas.

    ', '

    MacBook te ofrece una gran libertad de movimientos gracias a su exterior resistente en policarbonato, a su tecnología sin cable y a su adaptador cargador sector innovador que se desconecta automáticamente si alguien se engancha en el cable.

    ', 'macbook', '', '', '', 'MacBook', 'Disponible', ''), +(5, 3, '

    MacBook Air es casi tan fino como tu dedo. Se ha simplificado al máximo y a pesar de ello dispone de una pantalla panorámica de 13,3 pulgadas, de un teclado completo y de un amplio trackpad multi-touch. Portátil al 100%, te evitará tener que hacer un compromiso en lo que concierne a la pantalla y al teclado.

    La increíble sutileza de MacBook Air es el resultado de un gran número de innovaciones en materia de reducción de tamaño y peso. Desde un disco duro más fino hasta puertos E/S disimulados hábilmente pasando por una batería más plana, cada detalle se consideró para que el resultado fuera lo más fino posible.

    MacBook Air fue creado y elaborado para disfrutar plenamente del mundo inalámbrico. Un mundo en el que la norma Wi-Fi 802.11n es tan rápida y accesible que permite liberarse completamente de cualquier atadura para comprar videos en línea, descargar programas, almacenar y compartir archivos en la Red.

    ', '

    MacBook Air es ultra fino, ultra portátil y ultra diferente de todo el resto. Pero no se pierden kilos y centímetros en tan solo una noche. Todo esto es el resultado de un nuevo invento de normas. De un sinfín de novedades sin cable. Y de una revolución en el diseño. Con MacBook Air, la informática móvil adquiere una nueva dimensión.

    ', 'macbook-air', '', '', '', 'MacBook Air', 'Disponible', ''), +(8, 3, '

    Características

    \r\n', '

    Este estuche de cuero de última moda garantiza una completa protección contra los arañazos y los pequeños contratiempos de la vida diaria. Su diseño elegante y compacto te permite meter tu Ipod directamente en tu bolsillo o en tu bolso.

    ', 'funda-cuero-ipod-nano-negro-chocolate', '', '', '', 'Leather Case (iPod nano) - Negro / Chocolate', 'Disponible', ''), +(9, 3, '

    Los auriculares SE210, ligeros y elegantes, están basados en la tecnología de los monitores personales que los músicos profesionales utilizan en carretera y que los ingenieros de Shure han perfeccionado. También están provistos de una salida audio de gama extendida exenta de todo ruido exterior.

    Creado para un aislamiento sonoro

    \r\n

    Las almohadillas provistas de un aislamiento sonoro bloquean más del 90% del ruido ambiente. Combinadas con un diseño ergonómico atractivo y un cable modular, minimizan las intrusiones del mundo exterior y te permiten concentrarte en tu música. Creados para los apasionados por la música que quieren que su aparato audio móvil evolucione, los auriculares SE210 te permitirán llevar la tecnología allí donde tú vayas.

    Micro-transductor alta definición
    Desarrollados para poder tener una audición de calidad durante los desplazamientos, los auriculares SE210 utilizan un único transductor con un armazón equilibrado para poder disfrutar de una gama audio extendida. ¿El resultado ? Un confort audio increíble que restituye cada detalle de un espectáculo en directo.

    El kit universal Deluxe incluye los siguientes elementos :
    - Almohadillas para aislamiento sonoro
    Las almohadillas para el aislamiento sonoro tienen una doble función : bloquear el ruido ambiente y garantizar una estabilidad y un confort personalizados. Como cada oreja es diferente el kit universal Deluxe incluye tres tallas (S, M, L) de almohadillas de espuma y flexibles. Elige la talla y el estilo de almohadilla que mejor te convenga : un buen aislamiento es un factor clave tanto para optimizar el aislamiento sonoro y la respuesta de los bajos como para aumentar el confort durante una audición prolongada.

    - Cable modular

    \r\n

    Basándose en los comentarios de los numerosos usuarios, los ingenieros de Shure han creado una solución de cable separable para permitir un grado de personalización sin precedentes. El cable de 1 metro te permite adaptar el confort en función de la actividad del momento y de la aplicación.

    - Estuche para el transporte

    \r\n

    Además de las almohadillas de aislamiento sonoro y del cable modular, los auriculares SE210 están provistos de un estuche de transporte compacto y resistente para guardar los auriculares de manera práctica y sin dificultad.
    - Garantía límite de dos años
    Cada solución SE210 tiene una garantía piezas y mano de obra de dos años.

    \r\n


    Características técnicas

    \r\n\r\n


    Contenido de la caja

    \r\n', '

    Los auriculares con aislamiento ergonómicos y ligeros ofrecen la reproducción más fiel proveniente de fuentes audio estéreo móviles o de salón.

    ', 'auriculares-aislantes-del-sonido-shure-se210', '', '', '', 'Auriculares aislantes del sonido Shure SE210', 'Disponible', ''), +(1, 4, '

    Immer eine Kurve voraus.

    \r\n

    Für all die, die gleich losrocken wollen, gibt es jetzt neun tolle Farben zur Auswahl. Aber das ist nur ein Teil der Geschichte. Mit seinem runden Design, das komplett aus Aluminium und Glas besteht, werden Sie den iPod nano nicht mehr weglegen wollen.

    \r\n

    Tolles Design. Und viel Köpfchen.

    \r\n

    Die neue Genius-Funktion verwandelt den iPod nano in Ihren hoch intelligenten, persönlichen DJ. Es erstellt Abspiellisten aus den Songs in Ihrer Sammlung, die gut zusammenpassen.

    \r\n

    Passt sich Ihren Bewegungen an.

    \r\n

    Der iPod nano jetzt mit Beschleunigungsmesser. Einmal schütteln, und Ihre Musik wird neu sortiert. Kippen Sie es zur Seite für die Cover Flow-Ansicht. Und spielen Sie mit den Bewegungen, an die Sie denken.

    ', '

    New design. New features. Now in 8GB and 16GB. iPod nano rocks like never before.

    ', 'ipod-nano', '', '', '', 'iPod Nano', 'In stock', ''), +(2, 4, '

    style="font-size: small;">Gleich festmachen.

    \r\n

    Tragen Sie bis zu 500 Songs am Ärmel. Oder an Ihrem Gürtel. Oder an Ihrer Sporthose. iPod shuffle ist ein Erkennungszeichen echter Musikfans. Jetzt in neuen, noch leuchtenderen Farben.

    \r\n

    style="font-size: small;">Füttern Sie Ihren iPod shuffle.

    \r\n

    iTunes ist Ihr Super-Store für Unterhaltung. Es ist Ihre optimal organisierte Musik-Sammlung und Jukebox. Und Sie können Ihren iPod shuffle mit einem Klick laden.

    \r\n

    style="font-size: small;">Die Schöne und der Beat.

    \r\n

    Das farbintensive eloxierte Aluminium ergänzt das schlichte Design des iPod shuffle. Jetzt in Blau, Grün, Rosa, Rot und klassischem Silber.

    ', '

    iPod shuffle, the world’s most wearable music player, now clips on in more vibrant blue, green, pink, and red.

    ', 'ipod-shuffle', '', '', '', 'iPod shuffle', 'In stock', ''), +(5, 4, '

    MacBook Air ist kaum dicker als Ihr Zeigefinger. Nahezu jedes Detail wurde abgeflacht. Und dabei hat es immer noch einen 13,3-Zoll-Widescreen-LED-Display, eine Tastatur in voller Größe und einen großen Multi-Touch-Trackpad. Es besitzt eine unvergleichliche Tragbarkeit, ohne die üblichen Kompromisse für ultraportable Bildschirme und Tastaturen.

    Der unglaublich dünne MacBook Air ist das Ergebnis zahlreicher Innovationen zur Größen- und Gewichtsoptimierung. Die flachere Festplatte, die strategisch versteckten I/O-Ports und eine noch flachere Batterie: Alles wurde immer wieder überdacht, immer mit dem Ziel, es noch dünner zu gestalten.

    Das Design und Konzept von MacBook Air ist voll auf die Vorteile der Kabelfreiheit ausgerichtet. Eine Welt, in der 802.11n WLAN heutzutage so schnell und so leicht verfügbar ist, dass die Menschen heute grenzenlos Filme online kaufen oder mieten, Software downloaden und Dateien über das Internet teilen oder speichern können.

    ', 'MacBook Air is ultrathin, ultraportable, and ultra unlike anything else. But you don’t lose inches and pounds overnight. It’s the result of rethinking conventions. Of multiple wireless innovations. And of breakthrough design. With MacBook Air, mobile computing suddenly has a new standard.', 'macbook-Air', '', '', '', 'MacBook Air', '', NULL), +(6, 4, 'Jedes MacBook verfügt über eine größere Festplatte, bis zu 250GB, zum Speichern immer größer werdender Mediensammlungen und wertvoller Daten.

    Die 2,4 GHz MacBook-Modelle haben nun 2 GB Standard-Arbeitsspeicher - ideal zum reibungslosen Abspielen Ihrer Lieblings-Anwendungen.', 'MacBook makes it easy to hit the road thanks to its tough polycarbonate case, built-in wireless technologies, and innovative MagSafe Power Adapter that releases automatically if someone accidentally trips on the cord.', 'macbook', '', '', '', 'MacBook', '', NULL), +(7, 4, '

    Fünf neue Hands-on-Anwendungen

    \r\n

    Rich-HTML-E-Mails mit Fotos anzeigen sowie PDF-, Word-und Excel-Anhänge. Holen Sie sich Karten, Wegbeschreibungen und Echtzeit-Verkehrsinformationen. Sie können sich Notizen machen und Börsen- und Wetterberichte lesen.

    \r\n

    Berühren Sie Ihre Musik, Filme und vieles mehr

    \r\n

    Mit der revolutionären, in den wunderschönen 3,5-Zoll-Display integrierten Multi-Touch-Technologie können Sie zuziehen, zoomen, scrollen und streichen.

    \r\n

    Internet in Ihrer Tasche

    \r\n

    Mit dem Safari-Webbrowser sehen Sie Webseiten so, wie sie gesehen werden sollten und vergrößern und verkleinern sie mit einer Berührung.2Fügen Sie Web-Clips zu Ihrer Startseite hinzu für den Schnellzugriff auf Ihre bevorzugten Webseiten.

    \r\n

    Zum Set gehören/h3>\r\n
      \r\n
    • der iPod touch
    • \r\n
    • Ohrhörer
    • \r\n
    • USB 2.0-Kabel
    • \r\n
    • Anschluss-Adapter
    • \r\n
    • Poliertuch
    • \r\n
    • Basis
    • \r\n
    • Quick Start Guide
    • \r\n
    ', '
      \r\n
    • Revolutionary Multi-Touch interface
    • \r\n
    • 3.5-inch widescreen color display
    • \r\n
    • Wi-Fi (802.11b/g)
    • \r\n
    • 8 mm thin
    • \r\n
    • Safari, YouTube, Mail, Stocks, Weather, Notes, iTunes Wi-Fi Music Store, Maps
    • \r\n
    ', 'iPod-Touch', '', '', '', 'iPod touch', '', NULL), +(8, 4, '

    Lorem ipsum

    ', '

    Lorem ipsum

    ', 'lederhulle-belkin-fur-ipod-nano-schwarz-schokolade', '', '', '', 'Lederhülle Belkin für ipod nano - Schwarz/Schokolade', '', NULL), +(9, 4, '
    Mit ihren hochauflösenden Micro-Lautsprechern, die vollen Klang liefern und ihrem ergonomischen, leichten Design sind die SE210 Ohrhörer ideal zum mobilen Extraklasse-Musik hören auf Ihrem iPod oder iPhone. Sie bieten die genaueste Tonwiedergabe, sowohl aus tragbaren als auch aus Home-Stereo-Audio-Quellen - für ultimative präzisen Höhen und kraftvolle Bässe. Darüber hinaus ermöglicht das flexible Design optimalen Tragekomfort durch eine Vielzahl von Tragemöglichkeiten.

    Funktionen
    \r\n
      \r\n
    • Klangisolierendes Design
    • \r\n
    • Hochauflösende Micro-Lautsprecher mit Single Balanced Armature-Treiber
    • \r\n
    • Abnehmbare modulare Kabel, die Sie je nach Aktivität länger oder kürzer einstellen können
    • \r\n
    • Kompatibler Stecker mit Kopfhörer-Anschlüssen für iPod und iPhone
    • \r\n
    \r\nDaten
    \r\n
      \r\n
    • Lautsprecher-Typ: Hochauflösende Micro-Lautsprecher
    • \r\n
    • Frequenzbereich: 25Hz-18.5kHz
    • \r\n
    • Impedanz (1kHz): 26 Ohm
    • \r\n
    • Empfindlichkeit (1mW): 114 dB SPL/mW
    • \r\n
    • Kabellänge (mit Erweiterung): 18,0 Zoll/45,0 cm (54,0 Zoll/137,1 cm)
    • \r\n
    \r\nIm Set enthalten
    \r\n
      \r\n
    • Shure SE210 Ohrhörer
    • \r\n
    • Verlängerungskabel (36,0 Zoll/91,4 cm)
    • \r\n
    • Drei Paar Schaumstoff-Hörmuschelhüllen (klein, mittel, groß)
    • \r\n
    • Drei Paar weiche Flex-Hörmuschelhüllen (klein, mittel, groß)
    • \r\n
    • Ein Paar Triple-Flange-Hörmuschelhüllen
    • \r\n
    • Trage-Etui
    • \r\n
    \r\nGarantie
    Zwei Jahre
    (Einzelheiten hierzu finden Sie auf
    www.shure.com/PersonalAudio/CustomerSupport/ProductReturnsAndWarranty/index.htm).

    Mfr. Teilenummer: SE210-A-EFS

    Hinweis: Für Produkte auf dieser Website, die nicht den Markennamen Apple tragen, werden Service und Support ausschließlich von den Herstellern gemäß der den Produkten beiliegenden Nutzungsbedingungen übernommen. Die von Apple angebotene Garantiezeit gilt nicht für Produkte, die kein Apple-Markenzeichen tragen, selbst wenn diese zusammen mit Apple-Produkten verpackt oder verkauft wurden. Bitte wenden Sie sich direkt an den Hersteller für den technischen Support und Kundendienst.
    ', '

    Evolved from personal monitor technology road-tested by pro musicians and perfected by Shure engineers, the lightweight and stylish SE210 delivers full-range audio that''s free from outside noise.

    ', 'klangisolierte-ohrhorer-shure-se210-weib', '', '', '', 'Shure SE210 Klangisolierte Ohrhörer für iPod und iPhone', '', NULL), +(1, 5, '

    Curve mozzafiato.

    \r\n

    Per te che ami le sensazioni forti, ecco nove fantastici colori. Ma non è finito qui. Accarezza il design sinuoso fatto di vetro e alluminio dell\'iPod nano, e non lo lascerai più.

    \r\n

    Bello e intelligente.

    \r\n

    La nuova funzione Genius trasforma l\'iPod nano nel tuo DJ personale. Sa creare delle playlist andando a cercare nella libreria musicale le canzoni che stanno bene insieme.

    \r\n

    Fatto per muoversi con te.

    \r\n

    L\'accelerometro è integrato all\'iPod nano. Scuotilo per dare uno shuffle alla tua musica. Ruotalo di lato per vedere il Cover Flow. E divertiti con i giochi adattati alle tue movenze.

    ', '

    Nuovo design. Nuove funzioni. Adesso in 8GB e 16GB. iPod nano, forte come non mai.

    ', 'ipod-nano', '', '', '', 'iPod Nano', 'In magazzino', ''), +(2, 5, '

    Sempre attaccato.

    \r\n

    Metti 500 canzoni in tasca. O nella cintura. O nei pantaloncini. iPod shuffle ti fa avere le canzoni sempre addosso. Adesso in colori più nuovi e brillanti.

    \r\n

    Ricarica il tuo iPod shuffle.

    \r\n

    iTunes è il tuo superstore del divertimento. La tua raccolta musicale super organizzata, il tuo juke-box. E puoi ricaricare il tuo iPod shuffle con un click.

    \r\n

    Musica coloratissima.

    \r\n

    Complementi dai colori intensi in alluminio anodizzato: questo è il design semplice di iPod shuffle. Adesso in blu, verde rosa, rosso, e argento originale.

    ', '

    iPod shuffle, il lettore musicale più indossabile del mondo, adesso anche nelle tonalità più vibranti di blu, verde, rosa e rosso.

    ', 'ipod-shuffle', '', '', '', 'iPod shuffle', 'In magazzino', ''), +(5, 5, '

    MacBook Air è sottile quasi come il tuo indice. Praticamente ogni dettaglio è stato semplificato al massimo. Eppure riesce ad avere uno schermo LED di 13,3 pollici, tastiera completa, e un ampio track-pad multi-touch. Incredibilmente portatile, non soffre dei compromessi tra schermo e tastiera.

    La sottigliezza incredibile di MacBook Air è il risultato di moltissime innovazioni nel campo della riduzione di dimensioni e peso. Un hard drive più sottile, porte I/O strategicamente nascoste, batteria più piatta: tutto è stato ben calibrato pensando sempre alla sottigliezza.

    MacBook Air è stato progettato e realizzato per godere a pieno dell\'universo del wireless. In un mondo in cui la norma 802.11n Wi-Fi è ormai rapida e disponibile, le persone vivono connesse - acquistano e noleggiano film online, scaricano programmi, condividono e conservano file nel web.

    ', 'MacBook Air è ultra-piatto, ultra-portatile, e ultra come nient\'altro al mondo. Ma non si perdono chili e centimetri in una notte. E\' il risultato di una rielaborazione degli standard. Di moltissime innovazioni sul wireless. E di un design rivoluzionario. Con MacBook Air, l\'informatica mobile acquista una nuova dimensione.', 'macbook-air', '', '', '', 'MacBook Air', '', NULL), +(6, 5, 'Tutti i MacBook hanno un hard drive più ampio, fino a 250GB, per conservare le tue raccolte multimediali e i dati importanti.

    I modelli MacBook a 2,4GHz ora includono 2GB di memoria standard — ideale per le tue applicazioni preferite.', 'MacBook ti offre il massimo della libertà di movimento grazie alla sua struttura resistente in policarbonato, alle tecnologie integrate wireless, e all\'innovativo MagSafe Power Adapter che si stacca automaticamente se qualcuno accidentalmente inciampa nel cavo.', 'macbook', '', '', '', 'MacBook', '', NULL), +(7, 5, '

    Cinque nuove applicazioni sotto mano

    \r\n

    Consulta le tue e-mail in formato rich HTML con foto e allegati PDF, Word, e Excel. Ottieni mappe, indicazioni stradali e sul traffico in tempo reale. Prendi appunti e consulta la Borsa e le previsioni meteo.

    \r\n

    Tocca la musica, i film e altro ancora

    \r\n

    La rivoluzionaria tecnologia Multi-Touch integrata al bellissimo schermo da 3,5 pollici ti permette di zoomare avanti e indietro, sfogliare e far scorrere le pagine con le dita.

    \r\n

    Internet in tasca

    \r\n

    Con il web browser Safari, consulta i siti web nella loro impaginazione originale e usa lo zoom avanti e indietro con la sola pressione delle dita.2 Aggiungi Web Clips al tuo schermo per accedere subito ai siti preferiti.

    \r\n

    Nella confezione

    \r\n', '', 'ipod-touch', '', '', '', 'iPod touch', '', NULL), +(8, 5, '

    Lorem ipsum

    ', '

    Lorem ipsum

    ', 'custodia-portafoglio-in-pelle-belkin-per-ipod-nano-nero-cioccolato', '', '', '', 'Custodia portafoglio in pelle Belkin per iPod nano - Nero/Cioccolato', '', NULL), +(9, 5, '
    L\'ascolto con la tecnologia dei Micro-Auricolari ad Alta Definizione permette l\'ascolto ideale del tuo iPod o iPhone. E\' quanto ti offre il design leggero, ergonomico ed elegante degli auricolari SE210. Ti garantiscono un rendimento audio ad alto livello di stereo portatili e fissi, per un livello di precisione mai raggiunto prima. Inoltre, la forma flessibile ti peremtte di scegliere la posizione migliore per indossarli.

    Caratteristiche
    \r\n
      \r\n
    • Design di isolamento del suono
    • \r\n
    • Micro-speaker ad alta definizione con driver singolo ad armatura bilanciata
    • \r\n
    • Cavo staccabile e regolabile in modo da poterlo allungare o accorciare in base alle tue attività
    • \r\n
    • Connettore compatibile con porte auricolari sia su iPod che iPhone
    • \r\n
    \r\nSpecifiche tecniche
    \r\n
      \r\n
    • Tipo speaker: MicroSpeaker ad alta definizione
    • \r\n
    • Gamma di frequenza: 25Hz-18.5kHz
    • \r\n
    • Impedenza (1kHz): 26 Ohms
    • \r\n
    • Sensibilità (1mW): 114 dB SPL/mW
    • \r\n
    • Lunghezza cavo (con prolunga): 18.0 in./45,0 cm (54.0 in./137,1 cm)
    • \r\n
    \r\nNella confezione
    \r\n
      \r\n
    • Auricolari Shure SE210
    • \r\n
    • Cavo prolunga (36.0 in./91,4 cm)
    • \r\n
    • Tre paia di imbuti in spugna (small, medium, large)
    • \r\n
    • Tre paia di imbuti morbidi (small, medium, large)
    • \r\n
    • Un paio di imbuti a tripla aletta
    • \r\n
    • Custodia da viaggio
    • \r\n
    \r\nGaranzia
    Due anni limitata
    (Per informazioni, visitare
    www.shure.com/PersonalAudio/CustomerSupport/ProductReturnsAndWarranty/index.htm.)

    Mfr. Parte N.: SE210-A-EFS

    Nota: I prodotti venduti tramite questo sito web e che non hanno il marchio Apple ricevono assistenza esclusivamente dai loro produttori con i termini e le condizioni contenute nella confezione del prodotto. La Garanzia Limitata di Apple non si applica ai prodotti che non appartengono al marchio Apple, anche se imballati o venduti con i prodotti Apple . Contatta direttamente il produttore per supporto tecnico e servizio clienti.
    ', '

    Basati sulla tecnologia all\'avanguardia, testati da musicisti professionisti, e messi a punto da ingegneri Shure, i leggeri ed eleganti SE210 offrono un suono nitido e privo di rumori di fondo.

    ', 'ecouteurs-a-isolation-sonore-shure-se210-blanc', '', '', '', 'auricolari-sound-isolating-shure-se210-per-ipod-e-iphone', '', NULL); + +INSERT INTO `PREFIX_specific_price` (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `price`, `from_quantity`, `reduction`, `reduction_type`, `from`, `to`) VALUES +(1, 0, 0, 0, 0, 0, 1, 0.05, 'percentage', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); + +INSERT INTO `PREFIX_category` (`id_category`, `id_parent`, `level_depth`, `nleft`, `nright`, `active`, `date_add`, `date_upd`, `position`) VALUES +(2, 1, 1, 2, 3, 1, NOW(), NOW(), 0),(3, 1, 1, 3, 4, 1, NOW(), NOW(), 1),(4, 1, 1, 4, 5, 1, NOW(), NOW(), 2); + +INSERT INTO `PREFIX_category_lang` (`id_category`, `id_lang`, `name`, `description`, `link_rewrite`, `meta_title`, `meta_keywords`, `meta_description`) VALUES +(2, 1, 'iPods', 'Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater.', 'music-ipods', '', '', ''), +(2, 2, 'iPods', 'Il est temps, pour le meilleur lecteur de musique, de remonter sur scène pour un rappel. Avec le nouvel iPod, le monde est votre scène.', 'musique-ipods', '', '', ''), +(3, 1, 'Accessories', 'Wonderful accessories for your iPod', 'accessories-ipod', '', '', ''), +(3, 2, 'Accessoires', 'Tous les accessoires à la mode pour votre iPod', 'accessoires-ipod', '', '', ''), +(4, 1, 'Laptops', 'The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part.', 'laptops', 'Apple laptops', 'Apple laptops MacBook Air', 'Powerful and chic Apple laptops'), +(4, 2, 'Portables', 'Le tout dernier processeur Intel, un disque dur plus spacieux, de la mémoire à profusion et d''autres nouveautés. Le tout, dans à peine 2,59 cm qui vous libèrent de toute entrave. Les nouveaux portables Mac réunissent les performances, la puissance et la connectivité d''un ordinateur de bureau. Sans la partie bureau.', 'portables-apple', 'Portables Apple', 'portables apple macbook air', 'portables apple puissants et design'), +(4, 3, 'Portátiles', 'El último procesador Intel, un disco duro más grande, con profusión de memoria y otras novedades. Todo en sólo 2,59 cm libres de cualquier obstrucción. Las nuevas portátiles Mac cumplir rendimiento, potencia y conectividad de una computadora de escritorio. Sin la parte del escritorio.', 'portatiles-apple', 'Portátiles Apple', 'portátiles apple macbook air', 'portátiles apple poderoso y el diseño'), +(3, 3, 'Accesorios', 'Todos los accesorios de moda para tu iPod', 'ipod-accesorios', '', '', ''), +(2, 3, 'iPods', 'Es hora de que el mejor jugador de la música, al escenario para hacer un bis. Con el nuevo iPod, el mundo es tu escenario.', 'musica-ipods', '', '', ''), +(2, 4, 'iPods', 'Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater.', 'musik-iPods', '', '', ''), +(3, 4, 'Zubehör', 'Wonderful accessories for your iPod', 'zubehor-ipod', '', '', ''), +(4, 4, 'Laptops', 'The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part.', 'laptops', 'Apple laptops', 'Apple MacBook Air-Laptops', 'Powerful and chic Apple laptops'), +(2, 5, 'iPods', 'Adesso che puoi acquistare film dall\'iTunes Store e inserirli nel tuo iPod, il tuo mondo è un palcoscenico.', 'musica-ipods', '', '', ''), +(3, 5, 'Accessori', 'Fantastici accessori per il tuo iPod', 'accessori-ipod', '', '', ''), +(4, 5, 'Laptop', 'L\'ultimissimo processore Intel, hard drive più ampio, moltissima memoria, e ancora più funzioni tutte inserite in 2,54 centimetri. I nuovi laptop Mac offrono le prestazioni, la potenza e la connettività di un computer da tavolo. Senza bisogno del tavolo.', 'laptop', 'laptop Apple', 'laptot Apple MacBook Air', 'Laptop Apple potenti ed eleganti'); + +INSERT INTO `PREFIX_category_product` (`id_category`, `id_product`, `position`) VALUES +(1, 1, 0),(1, 2, 1),(1, 6, 2),(1, 7, 3),(2, 1, 0),(2, 2, 1),(2, 7, 2),(3, 8, 0),(3, 9, 1),(4, 5, 0),(4, 6, 1); + +INSERT INTO `PREFIX_attribute_group` (`id_attribute_group`, `is_color_group`) VALUES (1, 0),(2, 1),(3, 0); + +INSERT INTO `PREFIX_attribute_group_lang` (`id_attribute_group`, `id_lang`, `name`, `public_name`) VALUES +(1, 1, 'Disk space', 'Disk space'),(1, 2, 'Capacité', 'Capacité'),(2, 1, 'Color', 'Color'),(2, 2, 'Couleur', 'Couleur'),(3, 1, 'ICU', 'Processor'), +(3, 2, 'ICU', 'Processeur'),(1, 3, 'Capacidad', 'Capacidad'),(2, 3, 'Color', 'Color'),(3, 3, 'ICU', 'Procesador'),(1, 4, 'Speicherplatz', 'Disk space'),(2, 4, 'Farbe', 'Color'),(3, 4, 'ICU', 'Processor'),(1, 5, 'Spazio disco', 'Spazio disco'),(2, 5, 'Colore', 'Colore'),(3, 5, 'ICU', 'Processore'); + +INSERT INTO `PREFIX_attribute_impact` (`id_attribute_impact`, `id_product`, `id_attribute`, `weight`, `price`) VALUES +(1, 1, 2, 0, 60.00),(2, 1, 5, 0, 0.00),(3, 1, 16, 0, 50.00),(4, 1, 15, 0, 0.00),(5, 1, 4, 0, 0.00),(6, 1, 19, 0, 0.00),(7, 1, 3, 0, 0.00),(8, 1, 14, 0, 0.00), +(9, 1, 7, 0, 0.00),(10, 1, 20, 0, 0.00),(11, 1, 6, 0, 0.00),(12, 1, 18, 0, 0.00); + +INSERT INTO `PREFIX_scene` (`id_scene`, `active`) VALUES (1, 1),(2, 1),(3, 1); + +INSERT INTO `PREFIX_scene_category` (`id_scene`, `id_category`) VALUES (1, 2),(2, 2),(3, 4); + +INSERT INTO `PREFIX_scene_lang` (`id_scene`, `id_lang`, `name`) VALUES +(1, 1, 'The iPods Nano'),(1, 2, 'Les iPods Nano'),(1, 3, 'El iPod Nano'),(1, 4, 'Die iPods Nano'),(1, 5, 'Gli iPod Nano'), +(2, 1, 'The iPods'),(2, 2, 'Les iPods'),(2, 3, 'El iPod'),(2, 4, 'Die iPods'),(2, 5, 'Gli iPod'), +(3, 1, 'The MacBooks'),(3, 2, 'Les MacBooks'),(3, 3, 'El MacBook'),(3, 4, 'Die MacBooks'),(3, 5, 'I MacBook'); + +INSERT INTO `PREFIX_scene_products` (`id_scene`, `id_product`, `x_axis`, `y_axis`, `zone_width`, `zone_height`) VALUES +(1, 1, 474, 15, 72, 166),(2, 2, 389, 137, 51, 46),(2, 7, 111, 83, 161, 108),(2, 1, 340, 31, 46, 151),(3, 6, 355, 37, 151, 103),(3, 6, 50, 47, 128, 84), +(3, 5, 198, 47, 137, 92),(1, 1, 394, 14, 73, 168),(1, 1, 318, 14, 69, 168),(1, 1, 244, 14, 66, 169),(1, 1, 180, 13, 59, 168),(1, 1, 6, 12, 30, 175), +(1, 1, 38, 12, 30, 170),(1, 1, 76, 14, 41, 169),(1, 1, 123, 13, 49, 169); + +INSERT INTO `PREFIX_attribute` (`id_attribute`, `id_attribute_group`) VALUES (1, 1),(2, 1),(8, 1),(9, 1),(10, 3),(11, 3),(12, 1),(13, 1); +INSERT INTO `PREFIX_attribute` (`id_attribute`, `id_attribute_group`, `color`) VALUES (3, 2, '#D2D6D5'),(4, 2, '#008CB7'),(5, 2, '#F3349E'),(6, 2, '#93D52D'), +(7, 2, '#FD9812'),(15, 1, ''),(16, 1, ''),(17, 1, ''),(18, 2, '#7800F0'),(19, 2, '#F6EF04'),(20, 2, '#F60409'),(14, 2, '#000000'); + +INSERT INTO `PREFIX_attribute_lang` VALUES (1, 1, '2GB'),(1, 2, '2Go'),(1, 3, '2Go'),(2, 1, '4GB'),(2, 2, '4Go'),(2, 3, '4Go'),(3, 1, 'Metal'),(3, 2, 'Metal'),(3, 3, 'Metal'), +(4, 1, 'Blue'),(4, 2, 'Bleu'),(4, 3, 'Azul'),(5, 1, 'Pink'),(5, 2, 'Rose'),(5, 3, 'Rosa'),(6, 1, 'Green'),(6, 2, 'Vert'),(6, 3, 'Verde'),(7, 1, 'Orange'),(7, 2, 'Orange'), +(7, 3, 'Naranja'),(8, 1, 'Optional 64GB solid-state drive'),(8, 2, 'Disque dur SSD (solid-state drive) de 64 Go '),(8, 3, 'SSD (solid-state drive) 64 Go '), +(9, 1, '80GB Parallel ATA Drive @ 4200 rpm'),(9, 2, 'Disque dur PATA de 80 Go à 4 200 tr/min'),(9, 3, 'Disco duro PATA 80 Go 4 200 tr/min'),(10, 1, '1.60GHz Intel Core 2 Duo'), +(10, 2, 'Intel Core 2 Duo à 1,6 GHz'),(10, 3, 'Intel Core 2 Duo para 1,6 GHz'),(11, 1, '1.80GHz Intel Core 2 Duo'),(11, 2, 'Intel Core 2 Duo à 1,8 GHz'), +(11, 3, 'Intel Core 2 Duo para 1,8 GHz'),(12, 1, '80GB: 20,000 Songs'),(12, 2, '80 Go : 20 000 chansons'),(12, 3, '80 Go : 20 000 canciones'),(13, 1, '160GB: 40,000 Songs'), +(13, 2, '160 Go : 40 000 chansons'),(13, 3, '160 Go : 40 000 canciones'),(14, 2, 'Noir'),(14, 3, 'Negro'),(14, 1, 'Black'),(15, 1, '8Go'),(15, 2, '8Go'),(15, 3, '8Go'), +(16, 1, '16Go'),(16, 2, '16Go'),(16, 3, '16Go'),(17, 1, '32Go'),(17, 2, '32Go'),(17, 3, '32Go'),(1, 4, '2GB'),(2, 4, '4GB'),(3, 4, 'Metallic'), +(4, 4, 'Blau'),(5, 4, 'Pink'),(6, 4, 'Grün'),(7, 4, 'Orange'),(8, 4, 'Optionale 64 GB Solid-State-Drive'), +(9, 4, 'Parallele ATA 80GB Drive @ 4200 rpm'),(10, 4, '1.60GHz Intel Core 2 Duo'), +(11, 4, '1.80GHz Intel Core 2 Duo'),(12, 4, '80GB: 20.000 Songs'),(13, 4, '160GB: 40.000 Songs'),(14, 4, 'Schwarz'),(15, 4, '8Go'), +(16, 4, '16Go'),(17, 4, '32Go'),(1, 5, '2GB'),(2, 5, '4GB'),(3, 5, 'Metallico'), +(4, 5, 'Blu'),(5, 5, 'Rosa'),(6, 5, 'Verde'),(7, 5, 'Arancio'),(8, 5, 'Opzionale solid-state drive 64GB'), +(9, 5, '80GB Parallel ATA Drive @ 4200 rpm'),(10, 5, '1.60GHz Intel Core 2 Duo'), +(11, 5, '1.80GHz Intel Core 2 Duo'),(12, 5, '80GB: 20.000 canzoni'),(13, 5, '160GB: 40,000 canzoni'),(14, 5, 'Nero'),(15, 5, '8Go'), +(16, 5, '16Go'),(17, 5, '32Go'); + +INSERT INTO `PREFIX_attribute_lang` (`id_attribute`, `id_lang`, `name`) VALUES +(18, 1, 'Purple'),(18, 2, 'Violet'),(18, 3, 'Violeta'),(19, 1, 'Yellow'),(19, 2, 'Jaune'),(19, 3, 'Amarillo'),(20, 1, 'Red'),(20, 2, 'Rouge'),(20, 3, 'Rojo'),(18, 4, 'Violett'),(19, 4, 'Gelb'),(20, 4, 'Rot'),(18, 5, 'Viola'),(19, 5, 'Giallo'),(20, 5, 'Rosso'); + +INSERT INTO `PREFIX_product_attribute` (`id_product_attribute`, `id_product`, `reference`, `supplier_reference`, `ean13`, `wholesale_price`, `price`, `ecotax`, `quantity`, `weight`, `default_on`, `minimal_quantity`) VALUES +(30, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(29, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(28, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(27, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(26, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(25, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 4), +(7, 2, '', '', '', 0.000000, 0.00, 0.00, 10, 0, 0, 1), +(8, 2, '', '', '', 0.000000, 0.00, 0.00, 20, 0, 1, 1), +(9, 2, '', '', '', 0.000000, 0.00, 0.00, 30, 0, 0, 1), +(10, 2, '', '', '', 0.000000, 0.00, 0.00, 40, 0, 0, 1), +(12, 5, '', NULL, '', 0.000000, 751.672241, 0.00, 100, 0, 0, 1), +(13, 5, '', NULL, '', 0.000000, 0.00, 0.00, 99, 0, 1, 1), +(14, 5, '', NULL, '', 0.000000, 225.752508, 0.00, 50, 0, 0, 1), +(15, 5, '', NULL, '', 0.000000, 977.424749, 0.00, 25, 0, 0, 1), +(23, 7, '', NULL, '', 0.000000, 150.501672, 0.00, 70, 0, 0, 1), +(22, 7, '', NULL, '', 0.000000, 75.250836, 0.00, 60, 0, 0, 1), +(19, 7, '', NULL, '', 0.000000, 0.00, 0.00, 50, 0, 1, 1), +(31, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 1, 1), +(32, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(33, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(34, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(35, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(36, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(39, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(40, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1), +(41, 1, '', '', '', 0.000000, 41.806020, 0.00, 50, 0, 0, 1), +(42, 1, '', '', '', 0.000000, 0.00, 0.00, 50, 0, 0, 1); + +INSERT INTO `PREFIX_product_attribute_image` (`id_product_attribute`, `id_image`) VALUES (30, 44),(29, 44),(28, 45),(27, 45),(26, 38),(25, 38),(7, 46),(8, 47),(9, 49), +(10, 48),(12, 0),(13, 0),(14, 0),(15, 0),(23, 0),(22, 0),(19, 0),(31, 37),(32, 37),(33, 40),(34, 40),(35, 41),(36, 41),(39, 39),(40, 39),(41, 42),(42, 42); + +INSERT INTO `PREFIX_product_attribute_combination` (`id_attribute`, `id_product_attribute`) VALUES (3, 9),(3, 12),(3, 13),(3, 14),(3, 15),(3, 29),(3, 30),(4, 7),(4, 25), +(4, 26),(5, 10),(5, 35),(5, 36),(6, 8),(6, 39),(6, 40),(7, 33),(7, 34),(8, 13),(8, 15),(9, 12),(9, 14),(10, 12),(10, 13),(11, 14),(11, 15),(14, 31),(14, 32),(15, 19), +(15, 26),(15, 28),(15, 30),(15, 32),(15, 34),(15, 36),(15, 40),(15, 42),(16, 22),(16, 25),(16, 27),(16, 29),(16, 31),(16, 33),(16, 35),(16, 39),(16, 41),(17, 23),(18, 41),(18, 42),(19, 27),(19, 28); + +INSERT INTO `PREFIX_feature` (`id_feature`) VALUES (1), (2), (3), (4), (5); + +INSERT INTO `PREFIX_feature_lang` (`id_feature`, `id_lang`, `name`) VALUES +(1, 1, 'Height'), (1, 2, 'Hauteur'),(2, 1, 'Width'), (2, 2, 'Largeur'),(3, 1, 'Depth'), (3, 2, 'Profondeur'),(4, 1, 'Weight'), (4, 2, 'Poids'),(5, 1, 'Headphone'), (5, 2, 'Prise casque'), +(1, 3, 'Alto'),(2, 3, 'Ancho'),(3, 3, 'Profundo'),(4, 3, 'Peso'),(5, 3, 'Toma auriculares'), +(1, 4, 'Höhe'),(2, 4, 'Breite'),(3, 4, 'Tiefe'),(4, 4, 'Gewicht'),(5, 4, 'Kopfhörer'), +(1, 5, 'Altezza'),(2, 5, 'Larghezza'),(3, 5, 'Profondità'),(4, 5, 'Peso'),(5, 5, 'Auricolare'); + +INSERT INTO `PREFIX_feature_product` (`id_feature`, `id_product`, `id_feature_value`) VALUES +(1, 1, 11),(1, 2, 15),(2, 1, 12),(2, 2, 16),(3, 1, 14),(3, 2, 18),(4, 1, 13),(4, 2, 17),(5, 1, 10),(5, 2, 10),(3, 7, 26),(5, 7, 9),(4, 7, 25),(2, 7, 24),(1, 7, 23); + +INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES +(11, 1, 1),(15, 1, 1),(12, 2, 1),(16, 2, 1),(14, 3, 1),(18, 3, 1),(13, 4, 1),(17, 4, 1),(26, 3, 1),(25, 4, 1),(24, 2, 1),(23, 1, 1); + +INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES (9, 5, NULL), (10, 5, NULL); + +INSERT INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`) VALUES +(13, 1, '49.2 g'),(13, 2, '49,2 g'),(13, 3, '49,2 g'),(13, 4, '49.2 g'),(13, 5, '49.2 g'),(12, 2, '52,3 mm'),(12, 1, '2.06 in'),(12, 3, '52.3 mm'),(12, 4, '52.3 mm'),(12, 5, '52.3 mm'),(11, 2, '69,8 mm'),(11, 1, '2.75 in'),(11, 3, '69.8 mm'),(11, 4, '69.8 mm'),(11, 5, '69.8 mm'), +(17, 2, '15,5 g'),(17, 1, '15.5 g'),(17, 3, '15.5 g'),(17, 4, '15.5 g'),(17, 5, '15.5 g'),(16, 2, '41,2 mm'),(16, 1, '1.62 in'),(16, 3, '41.2 mm'),(16, 4, '41.2 mm'),(16, 5, '41.2 mm'),(15, 2, '27,3 mm'),(15, 1, '1.07 in'),(15, 3, '27.3 mm'),(15, 4, '27.3 mm'),(15, 5, '27.3 mm'),(9, 1, 'Jack stereo'),(9, 4, 'Jack stereo'),(9, 5, 'Jack stereo'), +(9, 2, 'Jack stéréo'),(9, 3, 'Jack stereo'),(10, 1, 'Mini-jack stereo'),(10, 2, 'Mini-jack stéréo'),(10, 3, 'Mini-jack stéréo'),(10, 4, 'Mini-jack stéréo'),(10, 5, 'Mini-jack stéréo'),(14, 1, '0.26 in'),(14, 2, '6,5 mm'),(14, 3, '6,5 mm'),(14, 4, '6,5 mm'),(14, 5, '6,5 mm'),(18, 4, '10,5 mm'),(18, 5, '10,5 mm)'), +(18, 1, '0.41 in (clip included)'),(18, 2, '10,5 mm (clip compris)'),(18, 3, '10,5 mm (clip incluyendo)'),(26, 2, '8 mm'),(26, 1, '0.31 in'),(26, 3, '8 mm'),(26, 4, '8 mm'),(26, 5, '8 mm'),(25, 2, '120g'),(25, 3, '120g'),(25, 4, '120g'),(25, 5, '120g'),(25, 1, '120g'),(24, 2, '70 mm'),(24, 1, '2.76 in'),(24, 3, '70 mm'),(24, 4, '70 mm'),(24, 5, '70 mm'), +(23, 2, '110 mm'),(23, 3, '110 mm'),(23, 1, '4.33 in'),(23, 4, '4.33 in'),(23, 5, '4.33 in'); + +INSERT INTO `PREFIX_image` (`id_image`, `id_product`, `position`, `cover`) VALUES +(40, 1, 4, 0),(39, 1, 3, 0),(38, 1, 2, 0),(37, 1, 1, 1),(48, 2, 3, 0),(47, 2, 2, 0),(49, 2, 4, 0),(46, 2, 1, 1),(15, 5, 1, 1),(16, 5, 2, 0),(17, 5, 3, 0),(18, 6, 4, 0),(19, 6, 5, 0), +(20, 6, 1, 1),(24, 7, 1, 1),(33, 8, 1, 1),(27, 7, 3, 0),(26, 7, 2, 0),(29, 7, 4, 0),(30, 7, 5, 0),(32, 7, 6, 0),(36, 9, 1, 1),(41, 1, 5, 0),(42, 1, 6, 0),(44, 1, 7, 0),(45, 1, 8, 0); + +INSERT INTO `PREFIX_image_lang` (`id_image`, `id_lang`, `legend`) VALUES +(40, 2, 'iPod Nano'),(40, 3, 'iPod Nano'),(40, 4, 'iPod Nano'),(40, 5, 'iPod Nano'),(40, 1, 'iPod Nano'),(39, 2, 'iPod Nano'),(39, 3, 'iPod Nano'),(39, 1, 'iPod Nano'),(39, 4, 'iPod Nano'),(39, 5, 'iPod Nano'), +(38, 2, 'iPod Nano'),(38, 3, 'iPod Nano'),(38, 1, 'iPod Nano'),(38, 4, 'iPod Nano'),(38, 5, 'iPod Nano'), +(37, 2, 'iPod Nano'),(37, 3, 'iPod Nano'),(37, 1, 'iPod Nano'),(37, 4, 'iPod Nano'),(37, 5, 'iPod Nano'),(48, 2, 'iPod shuffle'),(48, 3, 'iPod shuffle'),(48, 1, 'iPod shuffle'),(48, 4, 'iPod shuffle'),(48, 5, 'iPod shuffle'),(47, 2, 'iPod shuffle'),(47, 3, 'iPod shuffle'),(47, 4, 'iPod shuffle'),(47, 5, 'iPod shuffle'), +(47, 1, 'iPod shuffle'),(49, 2, 'iPod shuffle'),(49, 3, 'iPod shuffle'),(49, 1, 'iPod shuffle'),(49, 4, 'iPod shuffle'),(49, 5, 'iPod shuffle'),(46, 2, 'iPod shuffle'),(46, 3, 'iPod shuffle'),(46, 1, 'iPod shuffle'),(46, 4, 'iPod shuffle'),(46, 5, 'iPod shuffle'), +(10, 1, 'luxury-cover-for-ipod-video'),(10, 3, 'luxury-cover-for-ipod-video'),(10, 4, 'luxury-cover-for-ipod-video'),(10, 5, 'luxury-cover-for-ipod-video'),(10, 2, 'housse-luxe-pour-ipod-video'),(11, 1, 'cover'),(11, 2, 'housse'),(11, 3, 'cubrir'),(11, 4, 'cover'),(11, 5, 'cover'), +(12, 1, 'myglove-ipod-nano'),(12, 2, 'myglove-ipod-nano'),(12, 3, 'myglove-ipod-nano'),(12, 4, 'myglove-ipod-nano'),(12, 5, 'myglove-ipod-nano'),(13, 1, 'myglove-ipod-nano'),(13, 2, 'myglove-ipod-nano'),(13, 3, 'myglove-ipod-nano'),(13, 4, 'myglove-ipod-nano'),(13, 5, 'myglove-ipod-nano'), +(14, 1, 'myglove-ipod-nano'),(14, 2, 'myglove-ipod-nano'),(14, 3, 'myglove-ipod-nano'),(14, 4, 'myglove-ipod-nano'),(14, 5, 'myglove-ipod-nano'),(15, 1, 'MacBook Air'),(15, 2, 'macbook-air-1'),(15, 3, 'macbook-air-1'),(15, 4, 'macbook-air-1'),(15, 5, 'macbook-air-1'),(16, 1, 'MacBook Air'),(16, 2, 'macbook-air-2'),(16, 3, 'macbook-air-2'),(16, 4, 'macbook-air-2'),(16, 5, 'macbook-air-2'),(17, 1, 'MacBook Air'),(17, 2, 'macbook-air-3'),(17, 3, 'macbook-air-3'),(17, 4, 'macbook-air-3'),(17, 5, 'macbook-air-3'),(18, 1, 'MacBook Air'),(18, 2, 'macbook-air-4'), +(18, 3, 'macbook-air-4'),(18, 4, 'macbook-air-4'),(18, 5, 'macbook-air-4'),(19, 1, 'MacBook Air'),(19, 2, 'macbook-air-5'),(19, 3, 'macbook-air-5'),(19, 4, 'macbook-air-5'),(19, 5, 'macbook-air-5'),(20, 1, ' MacBook Air SuperDrive'),(20, 2, 'superdrive-pour-macbook-air-1'), +(20, 3, 'superdrive-pour-macbook-air-1'),(20, 4, 'superdrive-pour-macbook-air-1'),(20, 5, 'superdrive-pour-macbook-air-1'),(24, 2, 'iPod touch'),(24, 1, 'iPod touch'),(24, 3, 'iPod touch'),(24, 4, 'iPod touch'),(24, 5, 'iPod touch'),(33, 1, 'housse-portefeuille-en-cuir'),(33, 3, 'housse-portefeuille-en-cuir'),(33, 4, 'housse-portefeuille-en-cuir'),(33, 5, 'housse-portefeuille-en-cuir'), +(26, 1, 'iPod touch'),(26, 2, 'iPod touch'),(26, 3, 'iPod touch'),(26, 4, 'iPod touch'),(26, 5, 'iPod touch'),(27, 1, 'iPod touch'),(27, 2, 'iPod touch'),(27, 3, 'iPod touch'),(27, 4, 'iPod touch'),(27, 5, 'iPod touch'),(29, 1, 'iPod touch'),(29, 2, 'iPod touch'),(29, 3, 'iPod touch'),(29, 4, 'iPod touch'),(29, 5, 'iPod touch'),(30, 1, 'iPod touch'),(30, 2, 'iPod touch'),(30, 3, 'iPod touch'),(30, 4, 'iPod touch'),(30, 5, 'iPod touch'),(32, 1, 'iPod touch'),(32, 2, 'iPod touch'),(32, 3, 'iPod touch'),(32, 4, 'iPod touch'),(32, 5, 'iPod touch'), +(33, 2, 'housse-portefeuille-en-cuir-ipod-nano'),(36, 2, 'Écouteurs à isolation sonore Shure SE210'),(36, 3, 'Auriculares aislantes del sonido Shure SE210'), +(36, 1, 'Shure SE210 Sound-Isolating Earphones for iPod and iPhone'),(36, 4, 'Shure SE210 Sound-Isolating Earphones for iPod and iPhone'),(36, 5, 'Shure SE210 Sound-Isolating Earphones for iPod and iPhone'),(41, 1, 'iPod Nano'),(41, 2, 'iPod Nano'),(41, 3, 'iPod Nano'),(41, 4, 'iPod Nano'),(41, 5, 'iPod Nano'),(42, 1, 'iPod Nano'),(42, 2, 'iPod Nano'), +(42, 3, 'iPod Nano'),(42, 4, 'iPod Nano'),(42, 5, 'iPod Nano'),(44, 1, 'iPod Nano'),(44, 2, 'iPod Nano'),(44, 3, 'iPod Nano'),(44, 4, 'iPod Nano'),(44, 5, 'iPod Nano'),(45, 1, 'iPod Nano'),(45, 2, 'iPod Nano'),(45, 3, 'iPod Nano'),(45, 4, 'iPod Nano'),(45, 5, 'iPod Nano'); + +INSERT INTO `PREFIX_tag` (`id_tag`, `id_lang`, `name`) VALUES (5, 1, 'apple'),(6, 2, 'ipod'),(7, 2, 'nano'),(8, 2, 'apple'),(18, 2, 'shuffle'), +(19, 2, 'macbook'),(20, 2, 'macbookair'),(21, 2, 'air'),(22, 1, 'superdrive'),(27, 2, 'marche'),(26, 2, 'casque'),(25, 2, 'écouteurs'), +(24, 2, 'ipod touch tacticle'),(23, 1, 'Ipod touch'),(28, 1, 'ipod'),(29, 1, 'nano'),(30, 3, 'ipod'),(31, 3, 'nano'),(32, 3, 'apple'),(33, 1, 'shuffle'), +(34, 3, 'shuffle'),(35, 2, 'superdrive'),(36, 3, 'superdrive'),(37, 3, 'Ipod touch'); + +INSERT INTO `PREFIX_product_tag` (`id_product`, `id_tag`) VALUES (1, 5),(1, 6),(1, 7),(1, 8),(1, 28),(1, 29),(1, 30),(1, 31),(1, 32),(2, 6),(2, 18),(2, 28), +(2, 30),(2, 33),(2, 34),(5, 8),(5, 19),(5, 20),(5, 21),(6, 5),(6, 8),(6, 22),(6, 32),(6, 35),(6, 36),(7, 23),(7, 24),(7, 37),(9, 25),(9, 26),(9, 27); + +INSERT INTO `PREFIX_alias` (`alias`, `search`, `active`, `id_alias`) VALUES ('piod', 'ipod', 1, 4),('ipdo', 'ipod', 1, 3); +INSERT INTO `PREFIX_order_message` (`id_order_message`, `date_add`) VALUES (1, NOW()); +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 1, 'Delay', 'Hi, + +Unfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery. +Please accept our apologies and rest assured that we are working hard to rectify this. + +Best regards,'); + +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 2, 'Délai', 'Bonjour, + +Un des éléments de votre commande est actuellement en réapprovisionnement, ce qui peut légèrement retarder son envoi. + +Merci de votre compréhension. + +Cordialement,'); + +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 3, 'Plazo', 'Hola, + +Uno de los elementos de su solicitud se encuentra actualmente la reposición, el cual poco puede retrasar el envío. + +Gracias por su comprensión. + +Saludos cordiales,'); + +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 4, 'Frist', 'Hi, + +Leider ist einer der Artikel aus Ihrer Bestellung momentan nicht auf Lager. Dies kann zu einer leichten Lieferverzögerung führen. Wir entschuldigen uns hierfür und bemühen uns schnellstens um Abhilfe. + +Mit freundlichen Grüßen,'); + +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 5, 'Ritardo', 'Salve, + +purtroppo un articolo che hai ordinato non è al momento in magazzino. Questo potrebbe provocare un leggero ritardo nella consegna. +Ti preghiamo di scusarci; ci stiamo organizzando per ovviare a questo inconveniente. + +Cordialmente,'); + +/* Block CMS module*/ + +INSERT INTO `PREFIX_cms_block` (`id_cms_block`, `id_cms_category`, `name`, `location`, `position`) VALUES(1, 1, '', 0, 0); +INSERT INTO `PREFIX_cms_block_page` (`id_cms_block_page`, `id_cms_block`, `id_cms`, `is_category`) VALUES(1, 1, 1, 0), (2, 1, 2, 0), (3, 1, 3, 0), (4, 1, 4, 0), (5, 1, 5, 0); +INSERT INTO `PREFIX_cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES (1, 1, 'Information'),(1, 2, 'Informations'),(1, 3, 'Informaciónes'),(1, 4, 'Information'),(1, 5, 'Informazioni'); + +/* Currency/Country module */ +INSERT INTO `PREFIX_module_currency` (`id_module`, `id_currency`) VALUES (3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(6, 1),(6, 2),(6, 3); +INSERT INTO `PREFIX_module_group` (`id_module`, `id_group`) VALUES (3, 1),(4, 1),(6, 1); + +INSERT INTO `PREFIX_module_country` (`id_module`, `id_country`) VALUES (3, 1),(3, 2),(3, 3),(3, 4),(3, 5),(3, 6),(3, 7),(3, 8), +(3, 9),(3, 10),(3, 11),(3, 12),(3, 13),(3, 14),(3, 15),(3, 16),(3, 17),(3, 18),(3, 19),(3, 20),(3, 21),(3, 22),(3, 23),(3, 24), +(3, 25),(3, 26),(3, 27),(3, 28),(3, 29),(3, 30),(3, 31),(3, 32),(3, 33),(3, 34),(4, 1),(4, 2),(4, 3),(4, 4),(4, 5),(4, 6),(4, 7), +(4, 8),(4, 9),(4, 10),(4, 11),(4, 12),(4, 13),(4, 14),(4, 15),(4, 16),(4, 17),(4, 18),(4, 19),(4, 20),(4, 21),(4, 22),(4, 23), +(4, 24),(4, 25),(4, 26),(4, 27),(4, 28),(4, 29),(4, 30),(4, 31),(4, 32),(4, 33),(4, 34),(6, 1),(6, 2),(6, 3),(6, 4),(6, 5),(6, 6), +(6, 7),(6, 8),(6, 9),(6, 10),(6, 11),(6, 12),(6, 13),(6, 14),(6, 15),(6, 16),(6, 17),(6, 18),(6, 19),(6, 20),(6, 21),(6, 22),(6, 23), +(6, 24),(6, 25),(6, 26),(6, 27),(6, 28),(6, 29),(6, 30),(6, 31),(6, 32),(6, 33),(6, 34); + +INSERT INTO `PREFIX_search_index` (`id_product`, `id_word`, `weight`) VALUES (1, 1, 10),(1, 2, 10),(1, 3, 2),(1, 4, 1),(1, 5, 1),(1, 6, 1), +(1, 7, 1),(1, 8, 1),(1, 9, 1),(1, 10, 1),(1, 11, 1),(1, 12, 1),(1, 13, 1),(1, 14, 1),(1, 15, 1),(1, 16, 2),(1, 17, 1),(1, 18, 1),(1, 19, 1), +(1, 20, 1),(1, 21, 1),(1, 22, 1),(1, 23, 1),(1, 24, 1),(1, 25, 1),(1, 26, 1),(1, 27, 1),(1, 28, 1),(1, 29, 1),(1, 30, 1),(1, 31, 2), +(1, 32, 1),(1, 33, 1),(1, 34, 1),(1, 35, 1),(1, 36, 1),(1, 37, 1),(1, 38, 5),(1, 39, 1),(1, 40, 1),(1, 41, 1),(1, 42, 1),(1, 43, 1), +(1, 44, 1),(1, 45, 1),(1, 46, 1),(1, 47, 1),(1, 48, 1),(1, 49, 1),(1, 50, 1),(1, 51, 2),(1, 52, 2),(1, 53, 1),(1, 54, 1),(1, 55, 1), +(1, 56, 1),(1, 57, 1),(1, 58, 1),(1, 59, 1),(1, 60, 1),(1, 61, 1),(1, 62, 1),(1, 63, 1),(1, 64, 1),(1, 65, 1),(1, 66, 1),(1, 67, 3), +(1, 68, 3),(1, 69, 3),(1, 70, 4),(1, 71, 16),(1, 72, 4),(1, 73, 4),(1, 74, 4),(1, 75, 4),(1, 76, 4),(1, 77, 4),(1, 78, 4),(1, 79, 2), +(1, 80, 2),(1, 81, 2),(1, 82, 12),(1, 83, 12),(1, 84, 1),(1, 85, 2),(1, 86, 1),(1, 87, 2),(1, 88, 1),(1, 89, 1),(1, 90, 2),(1, 91, 1), +(1, 92, 1),(1, 93, 1),(1, 94, 1),(1, 95, 4),(1, 96, 1),(1, 97, 1),(1, 98, 1),(1, 99, 1),(1, 100, 1),(1, 101, 1),(1, 102, 1), +(1, 103, 1),(1, 104, 1),(1, 105, 1),(1, 106, 1),(1, 107, 1),(1, 108, 1),(1, 109, 2),(1, 110, 1),(1, 111, 1),(1, 112, 1),(1, 113, 1), +(1, 114, 1),(1, 115, 2),(1, 116, 2),(1, 117, 1),(1, 118, 3),(1, 119, 1),(1, 120, 1),(1, 121, 1),(1, 122, 1),(1, 123, 1),(1, 124, 1), +(1, 125, 1),(1, 126, 1),(1, 127, 1),(1, 128, 1),(1, 129, 1),(1, 130, 1),(1, 131, 1),(1, 132, 1),(1, 133, 1),(1, 134, 1),(1, 135, 1), +(1, 136, 1),(1, 137, 1),(1, 138, 1),(1, 139, 1),(1, 140, 1),(1, 141, 1),(1, 142, 1),(1, 143, 1),(1, 144, 1),(1, 145, 3),(1, 146, 7), +(1, 147, 3),(1, 148, 4),(1, 149, 16),(1, 150, 4),(1, 151, 4),(1, 152, 4),(1, 153, 4),(1, 154, 4),(1, 155, 4),(1, 156, 4),(1, 157, 2), +(1, 158, 2),(1, 159, 2),(1, 160, 9),(1, 161, 8),(1, 162, 1),(1, 163, 2),(1, 164, 1),(1, 165, 1),(1, 166, 1),(1, 167, 1),(1, 168, 1), +(1, 169, 1),(1, 170, 2),(1, 171, 1),(1, 172, 1),(1, 173, 4),(1, 174, 1),(1, 175, 1),(1, 176, 1),(1, 177, 1),(1, 178, 1),(1, 179, 1), +(1, 180, 1),(1, 181, 1),(1, 182, 1),(1, 183, 1),(1, 184, 1),(1, 185, 1),(1, 186, 1),(1, 187, 1),(1, 188, 1),(1, 189, 1),(1, 190, 1), +(1, 191, 1),(1, 192, 1),(1, 193, 1),(1, 194, 1),(1, 195, 1),(1, 196, 1),(1, 197, 1),(1, 198, 1),(1, 199, 1),(1, 200, 1),(1, 201, 1), +(1, 202, 1),(1, 203, 1),(1, 204, 1),(1, 205, 1),(1, 206, 1),(1, 207, 1),(1, 208, 1),(1, 209, 1),(1, 210, 1),(1, 211, 1),(1, 212, 1), +(1, 213, 1),(1, 214, 1),(1, 215, 1),(1, 216, 1),(1, 217, 1),(1, 218, 1),(1, 219, 1),(1, 220, 1),(1, 221, 1),(1, 222, 3),(1, 223, 3), +(1, 224, 3),(1, 225, 4),(1, 226, 16),(1, 227, 4),(1, 228, 4),(1, 229, 4),(1, 230, 4),(1, 231, 4),(1, 232, 4),(1, 233, 4),(1, 234, 2), +(1, 235, 2),(2, 1, 11),(2, 56, 10),(2, 236, 1),(2, 237, 1),(2, 238, 1),(2, 239, 1),(2, 57, 2),(2, 240, 1),(2, 241, 1),(2, 242, 2), +(2, 243, 1),(2, 244, 2),(2, 245, 2),(2, 246, 2),(2, 247, 1),(2, 248, 1),(2, 249, 1),(2, 45, 1),(2, 38, 7),(2, 250, 1),(2, 251, 1),(2, 252, 1), +(2, 253, 1),(2, 254, 1),(2, 255, 1),(2, 256, 1),(2, 257, 1),(2, 19, 1),(2, 258, 1),(2, 259, 1),(2, 260, 1),(2, 261, 1),(2, 262, 1),(2, 263, 1), +(2, 264, 1),(2, 265, 1),(2, 266, 1),(2, 267, 1),(2, 268, 1),(2, 269, 1),(2, 270, 1),(2, 271, 1),(2, 272, 1),(2, 273, 1),(2, 274, 1),(2, 3, 1), +(2, 275, 1),(2, 276, 1),(2, 277, 1),(2, 67, 3),(2, 68, 3),(2, 69, 3),(2, 73, 2),(2, 77, 2),(2, 70, 2),(2, 76, 2),(2, 278, 2),(2, 279, 2), +(2, 80, 2),(2, 81, 2),(2, 82, 15),(2, 280, 14),(2, 281, 1),(2, 282, 1),(2, 90, 2),(2, 283, 1),(2, 284, 1),(2, 285, 1),(2, 286, 1),(2, 287, 2), +(2, 288, 2),(2, 154, 3),(2, 289, 2),(2, 290, 1),(2, 291, 1),(2, 292, 1),(2, 0, 1),(2, 126, 2),(2, 294, 1),(2, 118, 7),(2, 295, 1),(2, 296, 1), +(2, 297, 1),(2, 298, 1),(2, 299, 1),(2, 300, 1),(2, 301, 1),(2, 302, 1),(2, 95, 1),(2, 136, 2),(2, 303, 1),(2, 88, 2),(2, 304, 1),(2, 100, 2), +(2, 101, 2),(2, 305, 1),(2, 306, 1),(2, 307, 1),(2, 308, 1),(2, 309, 1),(2, 310, 1),(2, 311, 1),(2, 312, 1),(2, 313, 1),(2, 314, 1),(2, 315, 1), +(2, 316, 1),(2, 317, 1),(2, 109, 1),(2, 318, 1),(2, 319, 1),(2, 320, 1),(2, 321, 1),(2, 322, 1),(2, 323, 1),(2, 124, 1),(2, 324, 1),(2, 325, 1), +(2, 85, 1),(2, 326, 1),(2, 327, 1),(2, 328, 1),(2, 329, 1),(2, 330, 1),(2, 331, 1),(2, 332, 1),(2, 333, 1),(2, 334, 1),(2, 145, 3),(2, 146, 3), +(2, 147, 3),(2, 151, 2),(2, 155, 2),(2, 148, 2),(2, 335, 2),(2, 336, 2),(2, 158, 2),(2, 159, 2),(2, 160, 11),(2, 337, 10),(2, 338, 1),(2, 339, 1), +(2, 340, 1),(2, 341, 1),(2, 166, 2),(2, 342, 2),(2, 343, 2),(2, 231, 3),(2, 344, 2),(2, 345, 1),(2, 346, 1),(2, 347, 1),(2, 348, 1),(2, 202, 2), +(2, 349, 1),(2, 350, 1),(2, 351, 1),(2, 352, 1),(2, 353, 1),(2, 354, 1),(2, 355, 1),(2, 356, 1),(2, 357, 1),(2, 213, 3),(2, 358, 1),(2, 359, 1), +(2, 179, 2),(2, 180, 2),(2, 360, 1),(2, 361, 1),(2, 362, 1),(2, 363, 1),(2, 364, 1),(2, 365, 1),(2, 366, 1),(2, 367, 1),(2, 368, 1),(2, 369, 1), +(2, 370, 1),(2, 371, 1),(2, 372, 1),(2, 373, 1),(2, 374, 1),(2, 375, 1),(2, 376, 1),(2, 377, 1),(2, 378, 1),(2, 163, 1),(2, 379, 1),(2, 184, 1), +(2, 380, 1),(2, 381, 1),(2, 204, 1),(2, 382, 1),(2, 383, 1),(2, 384, 1),(2, 222, 3),(2, 223, 3),(2, 224, 3),(2, 228, 2),(2, 232, 2),(2, 225, 2), +(2, 385, 2),(2, 386, 2),(2, 234, 2),(2, 235, 2),(5, 387, 10),(5, 388, 1),(5, 389, 1),(5, 390, 1),(5, 391, 1),(5, 392, 1),(5, 393, 1),(5, 394, 1), +(5, 395, 1),(5, 396, 1),(5, 397, 1),(5, 398, 2),(5, 399, 1),(5, 400, 1),(5, 401, 1),(5, 402, 2),(5, 403, 2),(5, 404, 1),(5, 3, 1),(5, 51, 2), +(5, 405, 1),(5, 406, 1),(5, 407, 1),(5, 408, 1),(5, 409, 1),(5, 410, 1),(5, 411, 1),(5, 38, 1),(5, 412, 1),(5, 413, 1),(5, 414, 1),(5, 415, 1), +(5, 416, 1),(5, 47, 1),(5, 417, 1),(5, 418, 1),(5, 419, 2),(5, 420, 1),(5, 421, 1),(5, 422, 1),(5, 423, 1),(5, 424, 1),(5, 425, 1),(5, 426, 1), +(5, 427, 1),(5, 428, 1),(5, 429, 1),(5, 430, 1),(5, 431, 1),(5, 432, 1),(5, 433, 1),(5, 434, 1),(5, 435, 1),(5, 436, 1),(5, 437, 1),(5, 438, 2), +(5, 439, 1),(5, 440, 1),(5, 441, 1),(5, 442, 1),(5, 443, 1),(5, 444, 1),(5, 445, 9),(5, 446, 1),(5, 447, 1),(5, 448, 1),(5, 449, 1),(5, 450, 1), +(5, 451, 1),(5, 452, 1),(5, 453, 1),(5, 454, 1),(5, 65, 1),(5, 455, 1),(5, 456, 1),(5, 457, 1),(5, 458, 1),(5, 237, 2),(5, 459, 1),(5, 460, 1), +(5, 461, 1),(5, 462, 1),(5, 463, 1),(5, 464, 1),(5, 465, 1),(5, 466, 1),(5, 467, 1),(5, 468, 1),(5, 469, 1),(5, 470, 1),(5, 471, 1),(5, 472, 1), +(5, 473, 1),(5, 474, 1),(5, 475, 1),(5, 476, 1),(5, 477, 3),(5, 68, 3),(5, 69, 3),(5, 70, 8),(5, 478, 4),(5, 479, 4),(5, 480, 4),(5, 481, 4), +(5, 482, 8),(5, 483, 8),(5, 484, 4),(5, 485, 4),(5, 486, 4),(5, 487, 4),(5, 488, 14),(5, 489, 3),(5, 490, 1),(5, 283, 2),(5, 491, 1),(5, 103, 2), +(5, 492, 1),(5, 493, 1),(5, 494, 1),(5, 495, 1),(5, 496, 1),(5, 497, 1),(5, 498, 1),(5, 499, 2),(5, 500, 3),(5, 501, 1),(5, 502, 1),(5, 503, 1), +(5, 504, 2),(5, 505, 2),(5, 506, 1),(5, 124, 2),(5, 85, 1),(5, 131, 2),(5, 507, 1),(5, 508, 1),(5, 509, 1),(5, 510, 1),(5, 511, 1),(5, 114, 1), +(5, 512, 1),(5, 513, 1),(5, 514, 1),(5, 118, 1),(5, 515, 1),(5, 516, 1),(5, 517, 1),(5, 518, 1),(5, 519, 1),(5, 520, 1),(5, 521, 1),(5, 522, 1), +(5, 523, 5),(5, 524, 1),(5, 525, 1),(5, 526, 1),(5, 527, 2),(5, 528, 1),(5, 529, 1),(5, 530, 1),(5, 531, 1),(5, 532, 1),(5, 109, 1),(5, 533, 1), +(5, 534, 1),(5, 535, 1),(5, 536, 1),(5, 537, 1),(5, 538, 1),(5, 539, 2),(5, 540, 1),(5, 541, 1),(5, 542, 1),(5, 543, 1),(5, 544, 1),(5, 545, 1), +(5, 546, 9),(5, 90, 2),(5, 547, 1),(5, 548, 1),(5, 549, 1),(5, 550, 1),(5, 551, 1),(5, 552, 1),(5, 553, 1),(5, 554, 1),(5, 555, 1),(5, 556, 1), +(5, 557, 1),(5, 558, 1),(5, 559, 1),(5, 95, 2),(5, 560, 1),(5, 561, 1),(5, 562, 2),(5, 563, 1),(5, 564, 1),(5, 565, 1),(5, 566, 1),(5, 88, 1), +(5, 567, 1),(5, 568, 1),(5, 569, 1),(5, 570, 1),(5, 571, 1),(5, 572, 1),(5, 573, 1),(5, 574, 1),(5, 575, 1),(5, 576, 1),(5, 577, 1),(5, 578, 1), +(5, 579, 1),(5, 580, 1),(5, 581, 1),(5, 582, 1),(5, 583, 3),(5, 146, 7),(5, 147, 3),(5, 584, 4),(5, 148, 8),(5, 585, 4),(5, 586, 8),(5, 587, 8), +(5, 588, 4),(5, 589, 4),(5, 590, 11),(5, 591, 3),(5, 592, 1),(5, 340, 2),(5, 593, 1),(5, 181, 2),(5, 594, 1),(5, 595, 1),(5, 596, 1),(5, 597, 1), +(5, 598, 1),(5, 371, 1),(5, 599, 1),(5, 600, 1),(5, 601, 3),(5, 162, 1),(5, 602, 1),(5, 603, 1),(5, 604, 1),(5, 605, 1),(5, 606, 1),(5, 607, 1), +(5, 163, 1),(5, 608, 1),(5, 609, 1),(5, 610, 1),(5, 611, 1),(5, 190, 1),(5, 612, 1),(5, 613, 1),(5, 614, 3),(5, 354, 1),(5, 615, 1),(5, 616, 1), +(5, 617, 1),(5, 618, 1),(5, 619, 1),(5, 620, 1),(5, 621, 2),(5, 622, 1),(5, 623, 1),(5, 624, 2),(5, 625, 1),(5, 626, 1),(5, 627, 1),(5, 628, 1), +(5, 629, 1),(5, 630, 1),(5, 631, 1),(5, 632, 1),(5, 633, 1),(5, 634, 1),(5, 635, 1),(5, 636, 1),(5, 637, 1),(5, 638, 1),(5, 639, 1),(5, 640, 1), +(5, 641, 1),(5, 642, 1),(5, 643, 1),(5, 644, 1),(5, 645, 5),(5, 646, 5),(5, 348, 1),(5, 647, 1),(5, 648, 1),(5, 649, 1),(5, 650, 1),(5, 651, 1), +(5, 652, 1),(5, 653, 1),(5, 654, 1),(5, 655, 1),(5, 173, 11),(5, 656, 1),(5, 657, 1),(5, 658, 1),(5, 659, 1),(5, 660, 1),(5, 661, 1),(5, 662, 2), +(5, 663, 1),(5, 664, 1),(5, 665, 1),(5, 666, 1),(5, 667, 1),(5, 668, 1),(5, 669, 1),(5, 670, 1),(5, 671, 1),(5, 672, 1),(5, 673, 1),(5, 674, 1), +(5, 675, 1),(5, 676, 1),(5, 677, 1),(5, 678, 1),(5, 679, 1),(5, 680, 1),(5, 681, 1),(5, 682, 3),(5, 223, 3),(5, 224, 3),(5, 225, 8),(5, 683, 4), +(5, 684, 8),(5, 685, 8),(5, 686, 4),(5, 687, 4),(6, 387, 9),(6, 688, 1),(6, 689, 1),(6, 690, 1),(6, 691, 1),(6, 692, 1),(6, 693, 1),(6, 694, 1), +(6, 695, 1),(6, 402, 1),(6, 696, 1),(6, 697, 1),(6, 698, 1),(6, 699, 1),(6, 700, 1),(6, 47, 1),(6, 701, 1),(6, 702, 1),(6, 703, 1),(6, 704, 1), +(6, 705, 1),(6, 706, 1),(6, 415, 1),(6, 707, 1),(6, 444, 1),(6, 708, 1),(6, 709, 1),(6, 710, 1),(6, 711, 1),(6, 712, 1),(6, 713, 1),(6, 714, 1), +(6, 715, 1),(6, 716, 1),(6, 717, 1),(6, 718, 1),(6, 719, 1),(6, 409, 1),(6, 720, 1),(6, 721, 1),(6, 242, 1),(6, 38, 1),(6, 722, 1),(6, 723, 1), +(6, 724, 1),(6, 477, 3),(6, 68, 7),(6, 69, 3),(6, 725, 4),(6, 488, 9),(6, 109, 1),(6, 726, 1),(6, 727, 1),(6, 728, 1),(6, 729, 1),(6, 327, 1),(6, 730, 1), +(6, 731, 1),(6, 732, 1),(6, 505, 1),(6, 733, 1),(6, 734, 1),(6, 735, 1),(6, 736, 1),(6, 737, 1),(6, 738, 1),(6, 739, 1),(6, 740, 1),(6, 510, 1),(6, 741, 1), +(6, 124, 1),(6, 553, 1),(6, 132, 1),(6, 523, 1),(6, 546, 1),(6, 90, 1),(6, 742, 1),(6, 500, 1),(6, 743, 1),(6, 744, 1),(6, 95, 2),(6, 580, 1), +(6, 745, 1),(6, 746, 1),(6, 747, 1),(6, 748, 1),(6, 749, 1),(6, 750, 1),(6, 751, 1),(6, 88, 1),(6, 752, 1),(6, 753, 1),(6, 754, 1),(6, 755, 1), +(6, 756, 1),(6, 757, 1),(6, 758, 1),(6, 583, 3),(6, 146, 3),(6, 147, 3),(6, 590, 9),(6, 759, 1),(6, 637, 1),(6, 760, 1),(6, 221, 1),(6, 761, 1), +(6, 356, 1),(6, 762, 1),(6, 763, 1),(6, 764, 1),(6, 606, 2),(6, 765, 1),(6, 766, 1),(6, 767, 1),(6, 768, 1),(6, 769, 1),(6, 770, 1),(6, 771, 1), +(6, 772, 1),(6, 653, 1),(6, 208, 1),(6, 209, 1),(6, 645, 1),(6, 646, 1),(6, 773, 1),(6, 774, 1),(6, 348, 1),(6, 173, 2),(6, 679, 1),(6, 775, 1), +(6, 776, 1),(6, 777, 1),(6, 778, 1),(6, 779, 1),(6, 780, 1),(6, 781, 1),(6, 782, 1),(6, 783, 1),(6, 784, 1),(6, 785, 1),(6, 786, 1),(6, 165, 1), +(6, 787, 1),(6, 682, 3),(6, 223, 3),(6, 224, 3),(7, 1, 11),(7, 788, 12),(7, 789, 2),(7, 427, 2),(7, 790, 1),(7, 791, 2),(7, 422, 1),(7, 792, 1), +(7, 793, 2),(7, 461, 2),(7, 794, 1),(7, 411, 1),(7, 795, 1),(7, 796, 1),(7, 797, 1),(7, 798, 1),(7, 799, 1),(7, 800, 1),(7, 259, 1),(7, 57, 1), +(7, 801, 1),(7, 802, 1),(7, 803, 1),(7, 804, 1),(7, 723, 1),(7, 60, 1),(7, 805, 1),(7, 806, 1),(7, 807, 1),(7, 51, 4),(7, 808, 1),(7, 809, 1), +(7, 810, 1),(7, 811, 1),(7, 812, 1),(7, 813, 1),(7, 814, 1),(7, 815, 1),(7, 816, 1),(7, 817, 1),(7, 818, 1),(7, 456, 1),(7, 819, 1),(7, 820, 1), +(7, 821, 1),(7, 822, 1),(7, 823, 1),(7, 38, 4),(7, 824, 1),(7, 825, 1),(7, 242, 1),(7, 826, 1),(7, 827, 1),(7, 37, 1),(7, 828, 1),(7, 829, 1), +(7, 830, 1),(7, 831, 1),(7, 832, 1),(7, 833, 1),(7, 834, 1),(7, 835, 1),(7, 836, 1),(7, 837, 1),(7, 838, 1),(7, 839, 1),(7, 840, 1),(7, 841, 1), +(7, 65, 1),(7, 842, 1),(7, 843, 1),(7, 844, 1),(7, 241, 1),(7, 845, 1),(7, 434, 1),(7, 846, 2),(7, 847, 1),(7, 722, 1),(7, 848, 1),(7, 849, 1), +(7, 850, 1),(7, 851, 1),(7, 852, 1),(7, 700, 1),(7, 853, 1),(7, 854, 1),(7, 855, 1),(7, 856, 1),(7, 857, 1),(7, 67, 3),(7, 858, 2),(7, 71, 2), +(7, 859, 2),(7, 81, 2),(7, 860, 2),(7, 861, 2),(7, 862, 2),(7, 82, 11),(7, 863, 11),(7, 864, 1),(7, 531, 2),(7, 865, 2),(7, 525, 1),(7, 866, 1), +(7, 867, 1),(7, 868, 1),(7, 869, 1),(7, 870, 1),(7, 308, 1),(7, 565, 1),(7, 871, 1),(7, 872, 1),(7, 873, 1),(7, 874, 2),(7, 875, 1),(7, 876, 1), +(7, 877, 2),(7, 878, 6),(7, 879, 3),(7, 880, 1),(7, 86, 1),(7, 757, 1),(7, 881, 1),(7, 882, 1),(7, 883, 2),(7, 884, 1),(7, 885, 2),(7, 886, 1), +(7, 887, 1),(7, 131, 2),(7, 888, 1),(7, 889, 1),(7, 890, 1),(7, 891, 1),(7, 892, 1),(7, 893, 1),(7, 894, 1),(7, 895, 1),(7, 896, 1),(7, 897, 1), +(7, 898, 1),(7, 899, 1),(7, 900, 1),(7, 901, 1),(7, 902, 1),(7, 903, 1),(7, 904, 1),(7, 905, 1),(7, 906, 1),(7, 907, 1),(7, 118, 2),(7, 136, 1), +(7, 576, 1),(7, 908, 1),(7, 909, 1),(7, 910, 1),(7, 911, 1),(7, 912, 1),(7, 524, 1),(7, 913, 1),(7, 109, 2),(7, 570, 1),(7, 914, 1),(7, 915, 1), +(7, 916, 2),(7, 917, 1),(7, 918, 1),(7, 919, 1),(7, 920, 1),(7, 921, 1),(7, 922, 1),(7, 923, 1),(7, 924, 1),(7, 925, 1),(7, 124, 2),(7, 926, 1), +(7, 927, 1),(7, 928, 1),(7, 318, 1),(7, 929, 1),(7, 930, 1),(7, 931, 1),(7, 932, 1),(7, 933, 1),(7, 334, 1),(7, 934, 1),(7, 935, 1),(7, 936, 1), +(7, 500, 1),(7, 937, 1),(7, 938, 1),(7, 939, 1),(7, 940, 1),(7, 941, 1),(7, 942, 1),(7, 943, 1),(7, 734, 1),(7, 944, 1),(7, 945, 1),(7, 946, 1), +(7, 947, 1),(7, 948, 1),(7, 949, 1),(7, 567, 1),(7, 145, 3),(7, 950, 4),(7, 951, 2),(7, 149, 2),(7, 952, 2),(7, 159, 2),(7, 953, 2),(7, 954, 2), +(7, 955, 2),(7, 160, 7),(7, 956, 7),(7, 957, 1),(7, 628, 2),(7, 958, 2),(7, 621, 3),(7, 622, 1),(7, 959, 1),(7, 960, 2),(7, 665, 2),(7, 961, 1), +(7, 962, 1),(7, 963, 2),(7, 964, 1),(7, 362, 1),(7, 965, 1),(7, 966, 1),(7, 967, 1),(7, 968, 2),(7, 969, 1),(7, 970, 1),(7, 971, 2),(7, 972, 1), +(7, 164, 1),(7, 165, 1),(7, 973, 1),(7, 974, 2),(7, 975, 1),(7, 976, 2),(7, 977, 1),(7, 978, 1),(7, 979, 1),(7, 980, 1),(7, 981, 1),(7, 982, 1), +(7, 983, 1),(7, 984, 1),(7, 985, 1),(7, 986, 1),(7, 987, 1),(7, 988, 1),(7, 989, 1),(7, 990, 1),(7, 991, 2),(7, 992, 1),(7, 993, 1),(7, 994, 1), +(7, 995, 1),(7, 615, 2),(7, 213, 1),(7, 996, 1),(7, 204, 1),(7, 997, 1),(7, 998, 1),(7, 764, 1),(7, 999, 1),(7, 1000, 1),(7, 1001, 1), +(7, 1002, 2),(7, 1003, 2),(7, 1004, 4),(7, 1005, 2),(7, 1006, 1),(7, 1007, 1),(7, 1008, 1),(7, 1009, 1),(7, 371, 1),(7, 1010, 1),(7, 1011, 1), +(7, 1012, 1),(7, 1013, 1),(7, 1014, 1),(7, 1015, 1),(7, 1016, 1),(7, 1017, 1),(7, 1018, 1),(7, 384, 1),(7, 1019, 1),(7, 1020, 1),(7, 1021, 1), +(7, 1022, 1),(7, 1023, 1),(7, 1024, 1),(7, 606, 1),(7, 765, 1),(7, 1025, 1),(7, 1026, 1),(7, 1027, 1),(7, 1028, 1),(7, 1029, 1),(7, 1030, 1), +(7, 1031, 1),(7, 1032, 1),(7, 1033, 1),(7, 222, 3),(7, 1034, 2),(7, 226, 2),(7, 1035, 2),(7, 235, 2),(7, 1036, 2),(7, 1037, 2),(7, 1038, 2), +(8, 1039, 6),(8, 1040, 6),(8, 1041, 6),(8, 1042, 6),(8, 1043, 6),(8, 1, 6),(8, 2, 6),(8, 1044, 6),(8, 1045, 6),(8, 1046, 2),(8, 1047, 2), +(8, 1048, 3),(8, 1049, 6),(8, 1050, 6),(8, 1051, 8),(8, 1052, 6),(8, 1053, 6),(8, 152, 6),(8, 1054, 6),(8, 1055, 1),(8, 1056, 1),(8, 1057, 1), +(8, 1058, 1),(8, 1059, 1),(8, 1060, 1),(8, 1061, 1),(8, 1062, 1),(8, 1063, 1),(8, 1064, 1),(8, 1065, 1),(8, 1066, 1),(8, 1067, 1),(8, 109, 1), +(8, 570, 1),(8, 1068, 1),(8, 118, 3),(8, 82, 1),(8, 1069, 1),(8, 124, 1),(8, 926, 1),(8, 882, 1),(8, 1070, 1),(8, 1071, 1),(8, 730, 1),(8, 1072, 2), +(8, 1073, 1),(8, 1074, 1),(8, 1075, 1),(8, 1076, 1),(8, 944, 1),(8, 1077, 1),(8, 1078, 1),(8, 1079, 3),(8, 1080, 6),(8, 1081, 6),(8, 1082, 6), +(8, 1083, 6),(8, 229, 6),(8, 1084, 6),(8, 1085, 1),(8, 1023, 1),(8, 1086, 2),(8, 1087, 1),(8, 1088, 1),(8, 1089, 1),(8, 1090, 1),(8, 1091, 1), +(8, 1092, 1),(8, 1093, 1),(8, 1094, 1),(8, 1095, 1),(8, 1096, 1),(8, 1097, 1),(8, 163, 1),(8, 1098, 1),(8, 1099, 1),(8, 669, 1),(8, 1100, 1), +(8, 160, 1),(8, 1101, 1),(8, 1013, 1),(8, 1102, 1),(8, 1103, 1),(8, 1104, 1),(8, 762, 1),(8, 1105, 2),(8, 1106, 1),(8, 1107, 1),(8, 1108, 1), +(8, 1109, 1),(8, 1025, 1),(8, 1110, 1),(8, 1111, 1),(8, 1112, 1),(8, 1113, 3),(9, 1114, 11),(9, 1115, 9),(9, 1116, 7),(9, 850, 8),(9, 1, 8), +(9, 1117, 8),(9, 1118, 1),(9, 442, 4),(9, 41, 1),(9, 1119, 1),(9, 826, 1),(9, 1120, 1),(9, 1121, 1),(9, 1122, 1),(9, 1123, 1),(9, 1124, 2),(9, 1125, 1), +(9, 1126, 1),(9, 1127, 2),(9, 1128, 3),(9, 20, 1),(9, 1129, 1),(9, 1130, 1),(9, 1131, 1),(9, 1132, 1),(9, 1133, 3),(9, 1134, 1),(9, 1135, 1), +(9, 1136, 1),(9, 1137, 1),(9, 3, 3),(9, 1138, 1),(9, 1139, 1),(9, 1140, 1),(9, 1141, 1),(9, 38, 2),(9, 840, 1),(9, 1142, 1),(9, 238, 2),(9, 1143, 1), +(9, 1144, 1),(9, 1145, 2),(9, 430, 1),(9, 845, 1),(9, 81, 1),(9, 1146, 1),(9, 1147, 1),(9, 1148, 1),(9, 1149, 1),(9, 805, 1),(9, 1150, 1),(9, 1151, 1), +(9, 1152, 1),(9, 1153, 1),(9, 1154, 1),(9, 1155, 1),(9, 1156, 1),(9, 1157, 1),(9, 4, 1),(9, 1158, 2),(9, 51, 5),(9, 1159, 1),(9, 1160, 1),(9, 1161, 1), +(9, 1162, 1),(9, 1163, 1),(9, 1164, 1),(9, 851, 4),(9, 1165, 1),(9, 1166, 1),(9, 1167, 1),(9, 1168, 1),(9, 1169, 1),(9, 1170, 1),(9, 1171, 1),(9, 1172, 1), +(9, 448, 1),(9, 1173, 1),(9, 1174, 1),(9, 1175, 1),(9, 1176, 1),(9, 1177, 1),(9, 1178, 1),(9, 1179, 1),(9, 1180, 1),(9, 1181, 1),(9, 1182, 1),(9, 1183, 1), +(9, 1184, 1),(9, 1185, 1),(9, 1186, 1),(9, 1187, 1),(9, 1188, 1),(9, 1189, 1),(9, 1190, 1),(9, 1191, 2),(9, 1192, 2),(9, 1193, 1),(9, 1194, 3), +(9, 1195, 3),(9, 1196, 2),(9, 1197, 2),(9, 1198, 2),(9, 1199, 1),(9, 1200, 1),(9, 1201, 1),(9, 1202, 1),(9, 1203, 1),(9, 1204, 1),(9, 1205, 2), +(9, 1206, 1),(9, 1207, 2),(9, 1208, 1),(9, 1209, 1),(9, 1210, 2),(9, 1211, 1),(9, 1212, 1),(9, 1213, 1),(9, 1214, 1),(9, 1215, 1),(9, 1216, 1), +(9, 22, 1),(9, 1217, 1),(9, 1218, 1),(9, 1219, 4),(9, 1220, 2),(9, 1221, 1),(9, 1222, 1),(9, 1223, 1),(9, 47, 2),(9, 1224, 1),(9, 68, 2), +(9, 1225, 1),(9, 1226, 1),(9, 1227, 1),(9, 1228, 1),(9, 1229, 1),(9, 1230, 1),(9, 1231, 1),(9, 1232, 1),(9, 1233, 1),(9, 1234, 1),(9, 1235, 2), +(9, 1236, 1),(9, 1237, 1),(9, 1238, 1),(9, 1239, 1),(9, 1240, 1),(9, 1241, 1),(9, 1242, 1),(9, 1243, 1),(9, 1244, 1),(9, 1245, 1),(9, 1246, 1), +(9, 1247, 1),(9, 1048, 3),(9, 1248, 3),(9, 942, 17),(9, 1249, 13),(9, 1250, 13),(9, 1251, 11),(9, 1252, 11),(9, 1253, 1),(9, 1254, 2),(9, 1255, 1), +(9, 1256, 1),(9, 1257, 5),(9, 90, 2),(9, 1258, 1),(9, 1259, 1),(9, 1260, 1),(9, 159, 1),(9, 583, 1),(9, 1261, 1),(9, 1262, 1),(9, 910, 1), +(9, 1263, 1),(9, 1264, 1),(9, 1265, 1),(9, 1266, 1),(9, 1267, 1),(9, 1268, 1),(9, 1269, 1),(9, 1270, 2),(9, 1271, 1),(9, 1272, 1),(9, 1273, 1), +(9, 1274, 1),(9, 1275, 1),(9, 1276, 3),(9, 1277, 2),(9, 1278, 1),(9, 103, 1),(9, 1279, 2),(9, 1280, 1),(9, 1065, 1),(9, 1281, 4),(9, 1282, 1), +(9, 1283, 1),(9, 1284, 1),(9, 1285, 1),(9, 85, 1),(9, 1286, 1),(9, 1287, 1),(9, 943, 7),(9, 1288, 3),(9, 1289, 1),(9, 1290, 1),(9, 562, 1), +(9, 1291, 1),(9, 109, 7),(9, 1292, 1),(9, 1293, 1),(9, 118, 2),(9, 136, 2),(9, 1294, 1),(9, 95, 7),(9, 1295, 1),(9, 1296, 1),(9, 918, 1), +(9, 1297, 1),(9, 931, 1),(9, 1298, 1),(9, 1299, 1),(9, 1300, 1),(9, 1301, 1),(9, 1302, 1),(9, 131, 3),(9, 1303, 2),(9, 1304, 2),(9, 1305, 2), +(9, 1306, 1),(9, 1307, 2),(9, 1308, 1),(9, 1309, 1),(9, 1310, 1),(9, 1311, 1),(9, 319, 1),(9, 1312, 2),(9, 1313, 1),(9, 1314, 1),(9, 1315, 1), +(9, 500, 1),(9, 499, 1),(9, 1316, 4),(9, 1317, 1),(9, 1318, 1),(9, 1319, 1),(9, 1320, 1),(9, 1321, 1),(9, 523, 1),(9, 1322, 1),(9, 1323, 1), +(9, 1324, 3),(9, 1325, 3),(9, 1326, 2),(9, 1327, 1),(9, 1328, 1),(9, 1329, 1),(9, 1330, 1),(9, 1331, 1),(9, 1332, 1),(9, 1333, 1),(9, 1334, 1), +(9, 1335, 1),(9, 1336, 1),(9, 1337, 1),(9, 299, 1),(9, 553, 2),(9, 1338, 1),(9, 1339, 1),(9, 1340, 1),(9, 1341, 1),(9, 1342, 1),(9, 1343, 1), +(9, 1344, 1),(9, 330, 1),(9, 544, 1),(9, 1345, 1),(9, 1346, 1),(9, 1347, 1),(9, 1348, 1),(9, 1349, 1),(9, 1350, 1),(9, 1351, 1),(9, 1352, 1), +(9, 1353, 1),(9, 1354, 1),(9, 1355, 1),(9, 1356, 1),(9, 1357, 1),(9, 1358, 1),(9, 1359, 1),(9, 1360, 1),(9, 1361, 1),(9, 1362, 1),(9, 1363, 1), +(9, 1364, 1),(9, 1365, 2),(9, 1366, 1),(9, 1367, 2),(9, 1368, 1),(9, 1369, 1),(9, 505, 2),(9, 1370, 1),(9, 1371, 1),(9, 1372, 2),(9, 570, 1), +(9, 1373, 1),(9, 1374, 1),(9, 1375, 1),(9, 1376, 1),(9, 1055, 3),(9, 1377, 2),(9, 1378, 1),(9, 1379, 1),(9, 730, 1),(9, 1380, 1),(9, 1381, 1), +(9, 1382, 1),(9, 1383, 1),(9, 1384, 2),(9, 1385, 1),(9, 1386, 2),(9, 1387, 1),(9, 1388, 1),(9, 889, 1),(9, 1389, 1),(9, 1390, 1),(9, 1391, 1), +(9, 1392, 1),(9, 1393, 1),(9, 938, 1),(9, 1394, 1),(9, 1395, 1),(9, 1396, 1),(9, 1397, 1),(9, 1398, 1),(9, 1399, 1),(9, 940, 1),(9, 941, 1), +(9, 1400, 1),(9, 1401, 1),(9, 1402, 1),(9, 1079, 3),(9, 1403, 3),(9, 1404, 4),(9, 1405, 4),(9, 1024, 12),(9, 1406, 6),(9, 1407, 6),(9, 1408, 12), +(9, 1409, 11),(9, 1410, 9),(9, 1411, 1),(9, 1412, 2),(9, 1413, 1),(9, 1414, 1),(9, 1415, 1),(9, 1416, 1),(9, 1417, 1),(9, 1418, 5),(9, 1419, 1), +(9, 1420, 1),(9, 1421, 1),(9, 1422, 1),(9, 1423, 1),(9, 1424, 3),(9, 1425, 1),(9, 764, 2),(9, 1426, 1),(9, 1427, 1),(9, 1428, 1),(9, 1429, 1), +(9, 1430, 2),(9, 1431, 1),(9, 1432, 2),(9, 1433, 1),(9, 1434, 1),(9, 1435, 2),(9, 1436, 1),(9, 1437, 3),(9, 1438, 2),(9, 1439, 1),(9, 181, 1), +(9, 1440, 3),(9, 356, 2),(9, 658, 2),(9, 173, 11),(9, 1441, 6),(9, 1442, 5),(9, 1443, 1),(9, 1444, 1),(9, 1445, 2),(9, 1446, 1),(9, 163, 1), +(9, 1447, 1),(9, 1448, 1),(9, 606, 7),(9, 1449, 3),(9, 1450, 1),(9, 1451, 1),(9, 662, 1),(9, 1452, 1),(9, 1453, 1),(9, 213, 2),(9, 1454, 1), +(9, 1455, 1),(9, 1456, 1),(9, 1457, 1),(9, 610, 1),(9, 1458, 1),(9, 1459, 1),(9, 1460, 1),(9, 1461, 1),(9, 1462, 1),(9, 1463, 1),(9, 1464, 2), +(9, 1465, 2),(9, 1466, 2),(9, 1467, 1),(9, 1468, 2),(9, 631, 1),(9, 1469, 2),(9, 1470, 1),(9, 1471, 2),(9, 1472, 1),(9, 1473, 1),(9, 1474, 2), +(9, 1475, 1),(9, 1476, 1),(9, 660, 1),(9, 601, 1),(9, 1477, 4),(9, 635, 1),(9, 1478, 1),(9, 653, 3),(9, 654, 1),(9, 1479, 1),(9, 1480, 1), +(9, 1481, 3),(9, 1482, 3),(9, 1483, 2),(9, 1484, 1),(9, 1485, 1),(9, 1486, 1),(9, 1487, 1),(9, 1488, 2),(9, 1489, 1),(9, 1490, 1),(9, 1491, 1), +(9, 1492, 1),(9, 354, 2),(9, 1493, 1),(9, 593, 1),(9, 1494, 1),(9, 1495, 1),(9, 1496, 1),(9, 1497, 1),(9, 381, 1),(9, 1498, 1),(9, 1499, 1), +(9, 1500, 1),(9, 1501, 1),(9, 1502, 1),(9, 1503, 1),(9, 1504, 1),(9, 1505, 1),(9, 1506, 1),(9, 1507, 1),(9, 1508, 1),(9, 1509, 1),(9, 1510, 1), +(9, 1511, 1),(9, 1512, 1),(9, 1513, 1),(9, 1514, 1),(9, 1515, 1),(9, 1516, 1),(9, 1517, 2),(9, 1518, 1),(9, 1519, 1),(9, 1520, 1),(9, 1521, 1), +(9, 1522, 1),(9, 1523, 1),(9, 669, 1),(9, 1524, 1),(9, 1525, 1),(9, 1526, 1),(9, 191, 1),(9, 1023, 3),(9, 1527, 2),(9, 1528, 1),(9, 1099, 1), +(9, 762, 1),(9, 1529, 1),(9, 1530, 1),(9, 1531, 1),(9, 786, 1),(9, 1532, 2),(9, 1533, 1),(9, 1534, 2),(9, 1535, 1),(9, 1536, 1),(9, 973, 1), +(9, 1537, 1),(9, 1103, 1),(9, 1538, 1),(9, 1539, 1),(9, 1540, 1),(9, 1021, 1),(9, 1541, 1),(9, 1542, 1),(9, 1543, 1),(9, 1544, 1),(9, 1545, 1), +(9, 1546, 1),(9, 1022, 1),(9, 1547, 1),(9, 1548, 1),(9, 1549, 1),(9, 1550, 1),(9, 1551, 1),(9, 1113, 3),(9, 1552, 3); + +INSERT INTO `PREFIX_search_word` (`id_word`, `id_lang`, `word`) VALUES (1, 1, 'ipod'),(2, 1, 'nano'),(3, 1, 'design'),(4, 1, 'features'),(5, 1, '16gb'), +(6, 1, 'rocks'),(7, 1, 'like'),(8, 1, 'never'),(9, 1, 'before'),(10, 1, 'curved'),(11, 1, 'ahead'),(12, 1, 'curve'),(13, 1, 'those'),(14, 1, 'about'), +(15, 1, 'rock,'),(16, 1, 'give'),(17, 1, 'nine'),(18, 1, 'amazing'),(19, 1, 'colors'),(20, 1, 'that''s'),(21, 1, 'only'),(22, 1, 'part'), +(23, 1, 'story'),(24, 1, 'feel'),(25, 1, 'curved,'),(26, 1, 'allaluminum'),(27, 1, 'glass'),(28, 1, 'won''t'),(29, 1, 'want'),(30, 1, 'down'), +(31, 1, 'great'),(32, 1, 'looks'),(33, 1, 'brains,'),(34, 1, 'genius'),(35, 1, 'feature'),(36, 1, 'turns'),(37, 1, 'into'),(38, 1, 'your'), +(39, 1, 'highly'),(40, 1, 'intelligent,'),(41, 1, 'personal'),(42, 1, 'creates'),(43, 1, 'playlists'),(44, 1, 'finding'),(45, 1, 'songs'), +(46, 1, 'library'),(47, 1, 'that'),(48, 1, 'together'),(49, 1, 'made'),(50, 1, 'move'),(51, 1, 'with'),(52, 1, 'moves'),(53, 1, 'accelerometer'), +(54, 1, 'comes'),(55, 1, 'shake'),(56, 1, 'shuffle'),(57, 1, 'music'),(58, 1, 'turn'),(59, 1, 'sideways'),(60, 1, 'view'),(61, 1, 'cover'),(62, 1, 'flow'), +(63, 1, 'play'),(64, 1, 'games'),(65, 1, 'designed'),(66, 1, 'mind'),(67, 1, 'ipods'),(68, 1, 'apple'),(69, 1, 'computer,'),(70, 1, 'metal'), +(71, 1, '16go'),(72, 1, 'yellow'),(73, 1, 'blue'),(74, 1, 'black'),(75, 1, 'orange'),(76, 1, 'pink'),(77, 1, 'green'),(78, 1, 'purple'),(79, 1, 'g'), +(80, 1, 'minijack'),(81, 1, 'stereo'),(82, 2, 'ipod'),(83, 2, 'nano'),(84, 2, 'nouveau'),(85, 2, 'design'),(86, 2, 'nouvelles'),(87, 2, 'fonctionnalité'), +(88, 2, 'désormais'),(89, 2, 'nano,'),(90, 2, 'plus'),(91, 2, 'rock'),(92, 2, 'jamais'),(93, 2, 'courbes'),(94, 2, 'avantageuses'),(95, 2, 'pour'), +(96, 2, 'amateurs'),(97, 2, 'sensations,'),(98, 2, 'voici'),(99, 2, 'neuf'),(100, 2, 'nouveaux'),(101, 2, 'coloris'),(102, 2, 'n''est'),(103, 2, 'tout'), +(104, 2, 'faites'),(105, 2, 'l''expérience'),(106, 2, 'elliptique'),(107, 2, 'aluminum'),(108, 2, 'verre'),(109, 2, 'vous'),(110, 2, 'voudrez'), +(111, 2, 'lâcher'),(112, 2, 'beau'),(113, 2, 'intelligent'),(114, 2, 'nouvelle'),(115, 2, 'genius'),(116, 2, 'fait'),(117, 2, 'd''ipod'),(118, 2, 'votre'), +(119, 2, 'personnel'),(120, 2, 'crée'),(121, 2, 'listes'),(122, 2, 'lecture'),(123, 2, 'recherchant'),(124, 2, 'dans'),(125, 2, 'bibliothèque'), +(126, 2, 'chansons'),(127, 2, 'vont'),(128, 2, 'bien'),(129, 2, 'ensemble'),(130, 2, 'bouger'),(131, 2, 'avec'),(132, 2, 'équipé'),(133, 2, 'l''accéléromè'), +(134, 2, 'secouezle'),(135, 2, 'mélanger'),(136, 2, 'musique'),(137, 2, 'basculezle'),(138, 2, 'afficher'),(139, 2, 'cover'),(140, 2, 'flow'), +(141, 2, 'découvrez'),(142, 2, 'jeux'),(143, 2, 'adaptés'),(144, 2, 'mouvements'),(145, 2, 'ipods'),(146, 2, 'apple'),(147, 2, 'computer,'),(148, 2, 'metal'), +(149, 2, '16go'),(150, 2, 'jaune'),(151, 2, 'bleu'),(152, 2, 'noir'),(153, 2, 'orange'),(154, 2, 'rose'),(155, 2, 'vert'),(156, 2, 'violet'), +(157, 2, 'g'),(158, 2, 'minijack'),(159, 2, 'stéréo'),(160, 3, 'ipod'),(161, 3, 'nano'),(162, 3, 'nuevo'),(163, 3, 'diseño'),(164, 3, 'nuevas'), +(165, 3, 'aplicaciones'),(166, 3, 'ahora'),(167, 3, 'disponible'),(168, 3, 'nano,'),(169, 3, 'rock'),(170, 3, 'nunca'),(171, 3, 'curvas'), +(172, 3, 'aerodinámicas'),(173, 3, 'para'),(174, 3, 'aficionados'),(175, 3, 'sensaciones'),(176, 3, 'fuertes,'),(177, 3, 'presentamos'),(178, 3, 'nueve'), +(179, 3, 'nuevos'),(180, 3, 'colores'),(181, 3, 'todo'),(182, 3, 'experimenta'),(183, 3, 'elíptico'),(184, 3, 'aluminio'),(185, 3, 'vidrio'), +(186, 3, 'querrás'),(187, 3, 'separarte'),(188, 3, 'estético'),(189, 3, 'inteligente'),(190, 3, 'nueva'),(191, 3, 'aplicación'),(192, 3, 'genius'), +(193, 3, 'hace'),(194, 3, 'discjockey'),(195, 3, 'personal'),(196, 3, 'genuis'),(197, 3, 'crea'),(198, 3, 'listas'),(199, 3, 'lectura'),(200, 3, 'buscando'), +(201, 3, 'biblioteca'),(202, 3, 'canciones'),(203, 3, 'combinan'),(204, 3, 'entre'),(205, 3, 'hecho'),(206, 3, 'moverse'),(207, 3, 'contigo'),(208, 3, 'está'), +(209, 3, 'equipado'),(210, 3, 'acelerómetro'),(211, 3, 'muévelo'),(212, 3, 'mezclar'),(213, 3, 'música'),(214, 3, 'voltéalo'),(215, 3, 'mostrar'), +(216, 3, 'cover'),(217, 3, 'flow'),(218, 3, 'descubre'),(219, 3, 'juegos'),(220, 3, 'adaptados'),(221, 3, 'movimientos'),(222, 3, 'ipods'),(223, 3, 'apple'), +(224, 3, 'computer,'),(225, 3, 'metal'),(226, 3, '16go'),(227, 3, 'amarillo'),(228, 3, 'azul'),(229, 3, 'negro'),(230, 3, 'naranja'),(231, 3, 'rosa'), +(232, 3, 'verde'),(233, 3, 'violeta'),(234, 3, 'minijack'),(235, 3, 'stéréo'),(236, 1, 'shuffle,'),(237, 1, 'world'),(238, 1, 'most'),(239, 1, 'wearable'), +(240, 1, 'player,'),(241, 1, 'clips'),(242, 1, 'more'),(243, 1, 'vibrant'),(244, 1, 'blue,'),(245, 1, 'green,'),(246, 1, 'pink,'),(247, 1, 'instant'), +(248, 1, 'attachment'),(249, 1, 'wear'),(250, 1, 'sleeve'),(251, 1, 'belt'),(252, 1, 'shorts'),(253, 1, 'badge'),(254, 1, 'musical'),(255, 1, 'devotion'), +(256, 1, 'new,'),(257, 1, 'brilliant'),(258, 1, 'feed'),(259, 1, 'itunes'),(260, 1, 'entertainment'),(261, 1, 'superstore'),(262, 1, 'ultraorganized'), +(263, 1, 'collection'),(264, 1, 'jukebox'),(265, 1, 'load'),(266, 1, 'click'),(267, 1, 'beauty'),(268, 1, 'beat'),(269, 1, 'intensely'),(270, 1, 'colorful'), +(271, 1, 'anodized'),(272, 1, 'aluminum'),(273, 1, 'complements'),(274, 1, 'simple'),(275, 1, 'red,'),(276, 1, 'original'),(277, 1, 'silver'),(278, 1, '(clip'), +(279, 1, 'compris)'),(280, 2, 'shuffle'),(281, 2, 'shuffle,'),(282, 2, 'baladeur'),(283, 2, 'portable'),(284, 2, 'monde,'),(285, 2, 'clippe'),(286, 2, 'maintenant'), +(287, 2, 'bleu,'),(288, 2, 'vert,'),(289, 2, 'rouge'),(290, 2, 'lien'),(291, 2, 'immédiat'),(292, 2, 'portez'),(294, 2, 'accrochées'),(295, 2, 'manche,'), +(296, 2, 'ceinture'),(297, 2, 'short'),(298, 2, 'arborez'),(299, 2, 'comme'),(300, 2, 'signe'),(301, 2, 'extérieur'),(302, 2, 'passion'),(303, 2, 'existe'), +(304, 2, 'quatre'),(305, 2, 'encore'),(306, 2, 'éclatants'),(307, 2, 'emplissez'),(308, 2, 'itunes'),(309, 2, 'immense'),(310, 2, 'magasin'),(311, 2, 'dédié'), +(312, 2, 'divertissement,'),(313, 2, 'collection'),(314, 2, 'musicale'),(315, 2, 'parfaitement'),(316, 2, 'organisée'),(317, 2, 'jukebox'),(318, 2, 'pouvez'), +(319, 2, 'seul'),(320, 2, 'clic'),(321, 2, 'remplir'),(322, 2, 'technicolor'),(323, 2, 's''affiche'),(324, 2, 'intenses'),(325, 2, 'rehaussent'),(326, 2, 'épuré'), +(327, 2, 'boîtier'),(328, 2, 'aluminium'),(329, 2, 'anodisé'),(330, 2, 'choisissez'),(331, 2, 'parmi'),(332, 2, 'rose,'),(333, 2, 'l''argenté'),(334, 2, 'd''origine'), +(335, 2, '(clip'),(336, 2, 'compris)'),(337, 3, 'shuffle'),(338, 3, 'shuffle,'),(339, 3, 'walkman'),(340, 3, 'portátil'),(341, 3, 'mundo,'),(342, 3, 'azul,'), +(343, 3, 'verde,'),(344, 3, 'rojo'),(345, 3, 'enlace'),(346, 3, 'inmediato'),(347, 3, 'lleva'),(348, 3, 'hasta'),(349, 3, 'colgadas'),(350, 3, 'manga,'), +(351, 3, 'cinturón'),(352, 3, 'pantalón'),(353, 3, 'presume'),(354, 3, 'como'),(355, 3, 'signo'),(356, 3, 'exterior'),(357, 3, 'pasión'),(358, 3, 'existen'), +(359, 3, 'cuatro'),(360, 3, 'llamativos'),(361, 3, 'llena'),(362, 3, 'itunes'),(363, 3, 'enorme'),(364, 3, 'tienda'),(365, 3, 'dedicada'),(366, 3, 'diversión,'), +(367, 3, 'colección'),(368, 3, 'organizada'),(369, 3, 'perfectamente'),(370, 3, 'jukebox'),(371, 3, 'solo'),(372, 3, 'clic'),(373, 3, 'puedes'),(374, 3, 'llenar'), +(375, 3, 'tecnicolor'),(376, 3, 'presenta'),(377, 3, 'vivos'),(378, 3, 'realzan'),(379, 3, 'estilizado'),(380, 3, 'anodizado'),(381, 3, 'elige'),(382, 3, 'rosa,'), +(383, 3, 'plateado'),(384, 3, 'origen'),(385, 3, '(clip'),(386, 3, 'incluyendo)'),(387, 1, 'macbook'),(388, 1, 'ultrathin,'),(389, 1, 'ultraportable,'), +(390, 1, 'ultra'),(391, 1, 'unlike'),(392, 1, 'anything'),(393, 1, 'else'),(394, 1, 'lose'),(395, 1, 'inches'),(396, 1, 'pounds'),(397, 1, 'overnight'), +(398, 1, 'result'),(399, 1, 'rethinking'),(400, 1, 'conventions'),(401, 1, 'multiple'),(402, 1, 'wireless'),(403, 1, 'innovations'),(404, 1, 'breakthrough'), +(405, 1, 'air,'),(406, 1, 'mobile'),(407, 1, 'computing'),(408, 1, 'suddenly'),(409, 1, 'standard'),(410, 1, 'nearly'),(411, 1, 'thin'),(412, 1, 'index'), +(413, 1, 'finger'),(414, 1, 'practically'),(415, 1, 'every'),(416, 1, 'detail'),(417, 1, 'could'),(418, 1, 'streamlined'),(419, 1, 'been'),(420, 1, 'still'), +(421, 1, '133inch'),(422, 1, 'widescreen'),(423, 1, 'display,'),(424, 1, 'fullsize'),(425, 1, 'keyboard,'),(426, 1, 'large'),(427, 1, 'multitouch'), +(428, 1, 'trackpad'),(429, 1, 'incomparably'),(430, 1, 'portable'),(431, 1, 'without'),(432, 1, 'usual'),(433, 1, 'ultraportable'),(434, 1, 'screen'), +(435, 1, 'keyboard'),(436, 1, 'compromisesthe'),(437, 1, 'incredible'),(438, 1, 'thinness'),(439, 1, 'numerous'),(440, 1, 'size'),(441, 1, 'weightshaving'), +(442, 1, 'from'),(443, 1, 'slimmer'),(444, 1, 'hard'),(445, 1, 'drive'),(446, 1, 'strategically'),(447, 1, 'hidden'),(448, 1, 'ports'),(449, 1, 'lowerprofile'), +(450, 1, 'battery,'),(451, 1, 'everything'),(452, 1, 'considered'),(453, 1, 'reconsidered'),(454, 1, 'mindmacbook'),(455, 1, 'engineered'),(456, 1, 'take'), +(457, 1, 'full'),(458, 1, 'advantage'),(459, 1, 'which'),(460, 1, '80211n'),(461, 1, 'wifi'),(462, 1, 'fast'),(463, 1, 'available,'),(464, 1, 'people'), +(465, 1, 'truly'),(466, 1, 'living'),(467, 1, 'untethered'),(468, 1, 'buying'),(469, 1, 'renting'),(470, 1, 'movies'),(471, 1, 'online,'),(472, 1, 'downloading'), +(473, 1, 'software,'),(474, 1, 'sharing'),(475, 1, 'storing'),(476, 1, 'files'),(477, 1, 'laptops'),(478, 1, '80gb'),(479, 1, 'parallel'),(480, 1, '4200'), +(481, 1, '160ghz'),(482, 1, 'intel'),(483, 1, 'core'),(484, 1, 'optional'),(485, 1, '64gb'),(486, 1, 'solidstate'),(487, 1, '180ghz'),(488, 2, 'macbook'), +(489, 2, 'ultra'),(490, 2, 'fin,'),(491, 2, 'différent'),(492, 2, 'reste'),(493, 2, 'mais'),(494, 2, 'perd'),(495, 2, 'kilos'),(496, 2, 'centimètres'), +(497, 2, 'nuit'),(498, 2, 'c''est'),(499, 2, 'résultat'),(500, 2, 'd''une'),(501, 2, 'réinvention'),(502, 2, 'normes'),(503, 2, 'multitude'), +(504, 2, 'd''innovations'),(505, 2, 'sans'),(506, 2, 'révolution'),(507, 2, 'air,'),(508, 2, 'l''informatique'),(509, 2, 'mobile'),(510, 2, 'prend'), +(511, 2, 'soudain'),(512, 2, 'dimension'),(513, 2, 'presque'),(514, 2, 'aussi'),(515, 2, 'index'),(516, 2, 'pratiquement'),(517, 2, 'pouvait'), +(518, 2, 'être'),(519, 2, 'simplifié'),(520, 2, 'n''en'),(521, 2, 'dispose'),(522, 2, 'moins'),(523, 2, 'd''un'),(524, 2, 'écran'),(525, 2, 'panoramique'), +(526, 2, 'pouces,'),(527, 2, 'clavier'),(528, 2, 'complet'),(529, 2, 'vaste'),(530, 2, 'trackpad'),(531, 2, 'multitouch'),(532, 2, 'incomparablemen'), +(533, 2, 'évite'),(534, 2, 'compromis'),(535, 2, 'habituels'),(536, 2, 'matière'),(537, 2, 'd''écran'),(538, 2, 'ultraportablesl'),(539, 2, 'finesse'), +(540, 2, 'grand'),(541, 2, 'nombre'),(542, 2, 'termes'),(543, 2, 'réduction'),(544, 2, 'taille'),(545, 2, 'poids'),(546, 2, 'disque'),(547, 2, 'ports'), +(548, 2, 'habilement'),(549, 2, 'dissimulés'),(550, 2, 'passant'),(551, 2, 'batterie'),(552, 2, 'plate,'),(553, 2, 'chaque'),(554, 2, 'détail'), +(555, 2, 'considéré'),(556, 2, 'reconsidéré'),(557, 2, 'l''espritmacbook'),(558, 2, 'conçu'),(559, 2, 'élaboré'),(560, 2, 'profiter'),(561, 2, 'pleinement'), +(562, 2, 'monde'),(563, 2, 'lequel'),(564, 2, 'norme'),(565, 2, 'wifi'),(566, 2, '80211n'),(567, 2, 'rapide'),(568, 2, 'accessible'),(569, 2, 'qu''elle'), +(570, 2, 'permet'),(571, 2, 'véritablement'),(572, 2, 'libérer'),(573, 2, 'toute'),(574, 2, 'attache'),(575, 2, 'acheter'),(576, 2, 'vidéos'),(577, 2, 'ligne,'), +(578, 2, 'télécharger'),(579, 2, 'logicééééie'),(580, 2, 'stocker'),(581, 2, 'partager'),(582, 2, 'fichiers'),(583, 2, 'portables'),(584, 2, 'macbookair'), +(585, 2, 'pata'),(586, 2, 'intel'),(587, 2, 'core'),(588, 2, '(solidstate'),(589, 2, 'drive)'),(590, 3, 'macbook'),(591, 3, 'ultra'),(592, 3, 'fino,'), +(593, 3, 'diferente'),(594, 3, 'resto'),(595, 3, 'pero'),(596, 3, 'pierden'),(597, 3, 'kilos'),(598, 3, 'centímetros'),(599, 3, 'noche'),(600, 3, 'esto'), +(601, 3, 'resultado'),(602, 3, 'invento'),(603, 3, 'normas'),(604, 3, 'sinfín'),(605, 3, 'novedades'),(606, 3, 'cable'),(607, 3, 'revolución'), +(608, 3, 'air,'),(609, 3, 'informática'),(610, 3, 'móvil'),(611, 3, 'adquiere'),(612, 3, 'dimensión'),(613, 3, 'casi'),(614, 3, 'fino'),(615, 3, 'dedo'), +(616, 3, 'simplificado'),(617, 3, 'máximo'),(618, 3, 'pesar'),(619, 3, 'ello'),(620, 3, 'dispone'),(621, 3, 'pantalla'),(622, 3, 'panorámica'), +(623, 3, 'pulgadas,'),(624, 3, 'teclado'),(625, 3, 'completo'),(626, 3, 'amplio'),(627, 3, 'trackpad'),(628, 3, 'multitouch'),(629, 3, '100%,'), +(630, 3, 'evitará'),(631, 3, 'tener'),(632, 3, 'hacer'),(633, 3, 'compromiso'),(634, 3, 'concierne'),(635, 3, 'increíble'),(636, 3, 'sutileza'), +(637, 3, 'gran'),(638, 3, 'número'),(639, 3, 'innovaciones'),(640, 3, 'materia'),(641, 3, 'reducción'),(642, 3, 'tamaño'),(643, 3, 'peso'),(644, 3, 'desde'), +(645, 3, 'disco'),(646, 3, 'duro'),(647, 3, 'puertos'),(648, 3, 'disimulados'),(649, 3, 'hábilmente'),(650, 3, 'pasando'),(651, 3, 'batería'), +(652, 3, 'plana,'),(653, 3, 'cada'),(654, 3, 'detalle'),(655, 3, 'consideró'),(656, 3, 'fuera'),(657, 3, 'posible'),(658, 3, 'creado'),(659, 3, 'elaborado'), +(660, 3, 'disfrutar'),(661, 3, 'plenamente'),(662, 3, 'mundo'),(663, 3, 'inalámbrico'),(664, 3, 'norma'),(665, 3, 'wifi'),(666, 3, '80211n'), +(667, 3, 'rápida'),(668, 3, 'accesible'),(669, 3, 'permite'),(670, 3, 'liberarse'),(671, 3, 'completamente'),(672, 3, 'cualquier'),(673, 3, 'atadura'), +(674, 3, 'comprar'),(675, 3, 'videos'),(676, 3, 'línea,'),(677, 3, 'descargar'),(678, 3, 'programas,'),(679, 3, 'almacenar'),(680, 3, 'compartir'), +(681, 3, 'archivos'),(682, 3, 'portátiles'),(683, 3, 'pata'),(684, 3, 'intel'),(685, 3, 'core'),(686, 3, '(solidstate'),(687, 3, 'drive)'),(688, 1, 'makes'), +(689, 1, 'easy'),(690, 1, 'road'),(691, 1, 'thanks'),(692, 1, 'tough'),(693, 1, 'polycarbonate'),(694, 1, 'case,'),(695, 1, 'builtin'),(696, 1, 'technologies,'), +(697, 1, 'innovative'),(698, 1, 'magsafe'),(699, 1, 'power'),(700, 1, 'adapter'),(701, 1, 'releases'),(702, 1, 'automatically'),(703, 1, 'someone'), +(704, 1, 'accidentally'),(705, 1, 'trips'),(706, 1, 'cord'),(707, 1, 'larger'),(708, 1, 'drive,'),(709, 1, '250gb,'),(710, 1, 'store'),(711, 1, 'growing'), +(712, 1, 'media'),(713, 1, 'collections'),(714, 1, 'valuable'),(715, 1, 'datathe'),(716, 1, '24ghz'),(717, 1, 'models'),(718, 1, 'include'),(719, 1, 'memory'), +(720, 1, 'perfect'),(721, 1, 'running'),(722, 1, 'favorite'),(723, 1, 'applications'),(724, 1, 'smoothly'),(725, 1, 'superdrive'),(726, 2, 'offre'), +(727, 2, 'liberté'),(728, 2, 'mouvement'),(729, 2, 'grâce'),(730, 2, 'résistant'),(731, 2, 'polycarbonate,'),(732, 2, 'technologies'),(733, 2, 'intégrées'), +(734, 2, 'adaptateur'),(735, 2, 'secteur'),(736, 2, 'magsafe'),(737, 2, 'novateur'),(738, 2, 'déconnecte'),(739, 2, 'automatiquement'),(740, 2, 'quelqu''un'), +(741, 2, 'pieds'),(742, 2, 'spacieux,'),(743, 2, 'capacité'),(744, 2, 'atteignant'),(745, 2, 'collections'),(746, 2, 'multimédia'),(747, 2, 'expansion'), +(748, 2, 'données'),(749, 2, 'précieusesle'),(750, 2, 'modèle'),(751, 2, 'intègre'),(752, 2, 'mémoire'),(753, 2, 'standard'),(754, 2, 'l''idéal'), +(755, 2, 'exécuter'),(756, 2, 'souplesse'),(757, 2, 'applications'),(758, 2, 'préférées'),(759, 3, 'ofrece'),(760, 3, 'libertad'),(761, 3, 'gracias'), +(762, 3, 'resistente'),(763, 3, 'policarbonato,'),(764, 3, 'tecnología'),(765, 3, 'adaptador'),(766, 3, 'cargador'),(767, 3, 'sector'),(768, 3, 'innovador'), +(769, 3, 'desconecta'),(770, 3, 'automáticament'),(771, 3, 'alguien'),(772, 3, 'engancha'),(773, 3, 'espacioso,'),(774, 3, 'capacidad'),(775, 3, 'colecciones'), +(776, 3, 'multimedia'),(777, 3, 'expansión'),(778, 3, 'datos'),(779, 3, 'preciados'),(780, 3, 'modelo'),(781, 3, 'integra'),(782, 3, 'memoria'),(783, 3, 'estándar'), +(784, 3, 'ideal'),(785, 3, 'realizar'),(786, 3, 'dificultad'),(787, 3, 'preferidas'),(788, 1, 'touch'),(789, 1, 'revolutionary'),(790, 1, 'interface'), +(791, 1, '35inch'),(792, 1, 'color'),(793, 1, 'display'),(794, 1, '(80211b'),(795, 1, 'safari,'),(796, 1, 'youtube,'),(797, 1, 'mail,'),(798, 1, 'stocks,'), +(799, 1, 'weather,'),(800, 1, 'notes,'),(801, 1, 'store,'),(802, 1, 'maps'),(803, 1, 'five'),(804, 1, 'handson'),(805, 1, 'rich'),(806, 1, 'html'), +(807, 1, 'email'),(808, 1, 'photos'),(809, 1, 'well'),(810, 1, 'pdf,'),(811, 1, 'word,'),(812, 1, 'excel'),(813, 1, 'attachments'),(814, 1, 'maps,'), +(815, 1, 'directions,'),(816, 1, 'realtime'),(817, 1, 'traffic'),(818, 1, 'information'),(819, 1, 'notes'),(820, 1, 'read'),(821, 1, 'stock'),(822, 1, 'weather'), +(823, 1, 'reports'),(824, 1, 'music,'),(825, 1, 'movies,'),(826, 1, 'technology'),(827, 1, 'built'),(828, 1, 'gorgeous'),(829, 1, 'lets'),(830, 1, 'pinch,'), +(831, 1, 'zoom,'),(832, 1, 'scroll,'),(833, 1, 'flick'),(834, 1, 'fingers'),(835, 1, 'internet'),(836, 1, 'pocket'),(837, 1, 'safari'),(838, 1, 'browser,'), +(839, 1, 'websites'),(840, 1, 'they'),(841, 1, 'were'),(842, 1, 'seen'),(843, 1, 'zoom'),(844, 1, 'tap2'),(845, 1, 'home'),(846, 1, 'quick'),(847, 1, 'access'), +(848, 1, 'sites'),(849, 1, 'what''s'),(850, 1, 'earphones'),(851, 1, 'cable'),(852, 1, 'dock'),(853, 1, 'polishing'),(854, 1, 'cloth'),(855, 1, 'stand'), +(856, 1, 'start'),(857, 1, 'guide'),(858, 1, '32go'),(859, 1, 'jack'),(860, 1, '120g'),(861, 1, '70mm'),(862, 1, '110mm'),(863, 2, 'touch'), +(864, 2, 'interface'),(865, 2, 'révolutionnair'),(866, 2, 'couleur'),(867, 2, 'pouceswifi'),(868, 2, '(80211b'),(869, 2, 'd''épaisseursaf'),(870, 2, 'youtube,'), +(871, 2, 'music'),(872, 2, 'store,'),(873, 2, 'courrier,'),(874, 2, 'cartes,'),(875, 2, 'bourse,'),(876, 2, 'météo,'),(877, 2, 'notes'),(878, 2, 'titre'), +(879, 2, 'paragraphe'),(880, 2, 'cinq'),(881, 2, 'sous'),(882, 2, 'main'),(883, 2, 'consultez'),(884, 2, 'emails'),(885, 2, 'format'),(886, 2, 'html'), +(887, 2, 'enrichi,'),(888, 2, 'photos'),(889, 2, 'pieces'),(890, 2, 'jointes'),(891, 2, 'pdf,'),(892, 2, 'word'),(893, 2, 'excel'),(894, 2, 'obtenez'), +(895, 2, 'itinéraires'),(896, 2, 'informations'),(897, 2, 'l''état'),(898, 2, 'circulation'),(899, 2, 'temps'),(900, 2, 'réel'),(901, 2, 'rédigez'), +(902, 2, 'cours'),(903, 2, 'bourse'),(904, 2, 'bulletins'),(905, 2, 'météo'),(906, 2, 'touchez'),(907, 2, 'doigt'),(908, 2, 'entre'),(909, 2, 'autres'), +(910, 2, 'technologie'),(911, 2, 'intégrée'),(912, 2, 'superbe'),(913, 2, 'pouces'),(914, 2, 'd''effectuer'),(915, 2, 'zooms'),(916, 2, 'avant'), +(917, 2, 'arrière,'),(918, 2, 'faire'),(919, 2, 'défiler'),(920, 2, 'feuilleter'),(921, 2, 'pages'),(922, 2, 'l''aide'),(923, 2, 'seuls'),(924, 2, 'doigts'), +(925, 2, 'internet'),(926, 2, 'poche'),(927, 2, 'navigateur'),(928, 2, 'safari,'),(929, 2, 'consulter'),(930, 2, 'sites'),(931, 2, 'leur'),(932, 2, 'mise'), +(933, 2, 'page'),(934, 2, 'effectuer'),(935, 2, 'zoom'),(936, 2, 'arrière'),(937, 2, 'simple'),(938, 2, 'pression'),(939, 2, 'l''écran'),(940, 2, 'contenu'), +(941, 2, 'coffret'),(942, 2, 'écouteurs'),(943, 2, 'câble'),(944, 2, 'dock'),(945, 2, 'chiffon'),(946, 2, 'nettoyage'),(947, 2, 'support'),(948, 2, 'guide'), +(949, 2, 'démarrage'),(950, 2, 'tacticle'),(951, 2, '32go'),(952, 2, 'jack'),(953, 2, '120g'),(954, 2, '70mm'),(955, 2, '110mm'),(956, 3, 'touch'), +(957, 3, 'interfaz'),(958, 3, 'revolucionaria'),(959, 3, 'color'),(960, 3, 'pulgadas'),(961, 3, '(80211b'),(962, 3, 'espesor'),(963, 3, 'safari,'), +(964, 3, 'youtube,'),(965, 3, 'music'),(966, 3, 'store,'),(967, 3, 'correo,'),(968, 3, 'mapas,'),(969, 3, 'bolsa,'),(970, 3, 'tiempo,'),(971, 3, 'notas'), +(972, 3, 'cinco'),(973, 3, 'mano'),(974, 3, 'consulta'),(975, 3, 'correo'),(976, 3, 'formato'),(977, 3, 'html'),(978, 3, 'enriquecido,'),(979, 3, 'fotos'), +(980, 3, 'ficheros'),(981, 3, 'adjuntos'),(982, 3, 'pdf,'),(983, 3, 'word'),(984, 3, 'excel'),(985, 3, 'consigue'),(986, 3, 'itinerarios'),(987, 3, 'información'), +(988, 3, 'sobre'),(989, 3, 'estado'),(990, 3, 'carreteras'),(991, 3, 'tiempo'),(992, 3, 'real'),(993, 3, 'escribe'),(994, 3, 'bolsa'),(995, 3, 'alcanza'), +(996, 3, 'videos,'),(997, 3, 'otras'),(998, 3, 'cosas'),(999, 3, 'integrada'),(1000, 3, 'magnífica'),(1001, 3, 'permitirá'),(1002, 3, 'efectuar'),(1003, 3, 'zoom'), +(1004, 3, 'hacia'),(1005, 3, 'adelante'),(1006, 3, 'atrás,'),(1007, 3, 'pasar'),(1008, 3, 'ojear'),(1009, 3, 'páginas'),(1010, 3, 'ayuda'),(1011, 3, 'dedos'), +(1012, 3, 'internet'),(1013, 3, 'bolsillo'),(1014, 3, 'navegador'),(1015, 3, 'podrás'),(1016, 3, 'consultar'),(1017, 3, 'sitios'),(1018, 3, 'compaginación'), +(1019, 3, 'atrás'),(1020, 3, 'simple'),(1021, 3, 'presión'),(1022, 3, 'contenido'),(1023, 3, 'estuche'),(1024, 3, 'auriculares'),(1025, 3, 'dock'),(1026, 3, 'paño'), +(1027, 3, 'limpieza'),(1028, 3, 'base'),(1029, 3, 'guía'),(1030, 3, 'inicio'),(1031, 3, 'rápido'),(1032, 3, 'título'),(1033, 3, 'párrafo'),(1034, 3, '32go'), +(1035, 3, 'jack'),(1036, 3, '120g'),(1037, 3, '70mm'),(1038, 3, '110mm'),(1039, 1, 'housse'),(1040, 1, 'portefeuille'),(1041, 1, 'cuir'),(1042, 1, 'belkin'), +(1043, 1, 'pour'),(1044, 1, 'noir'),(1045, 1, 'chocolat'),(1046, 1, 'lorem'),(1047, 1, 'ipsum'),(1048, 1, 'accessories'),(1049, 2, 'housse'),(1050, 2, 'portefeuille'), +(1051, 2, 'cuir'),(1052, 2, '(ipod'),(1053, 2, 'nano)'),(1054, 2, 'chocolat'),(1055, 2, 'étui'),(1056, 2, 'tendance'),(1057, 2, 'assure'),(1058, 2, 'protection'), +(1059, 2, 'complète'),(1060, 2, 'contre'),(1061, 2, 'éraflures'),(1062, 2, 'petits'),(1063, 2, 'aléas'),(1064, 2, 'quotidienne'),(1065, 2, 'conception'), +(1066, 2, 'élégante'),(1067, 2, 'compacte'),(1068, 2, 'glisser'),(1069, 2, 'directement'),(1070, 2, 'caractéristiqu'),(1071, 2, 'doux'),(1072, 2, 'accès'), +(1073, 2, 'bouton'),(1074, 2, 'hold'),(1075, 2, 'fermeture'),(1076, 2, 'magnétique'),(1077, 2, 'connector'),(1078, 2, 'protègeécran'),(1079, 2, 'accessoires'), +(1080, 3, 'leather'),(1081, 3, 'case'),(1082, 3, '(ipod'),(1083, 3, 'nano)'),(1084, 3, 'chocolate'),(1085, 3, 'este'),(1086, 3, 'cuero'),(1087, 3, 'última'), +(1088, 3, 'moda'),(1089, 3, 'garantiza'),(1090, 3, 'completa'),(1091, 3, 'protección'),(1092, 3, 'contra'),(1093, 3, 'arañazos'),(1094, 3, 'pequeños'), +(1095, 3, 'contratiempos'),(1096, 3, 'vida'),(1097, 3, 'diaria'),(1098, 3, 'elegante'),(1099, 3, 'compacto'),(1100, 3, 'meter'),(1101, 3, 'directamente'), +(1102, 3, 'bolso'),(1103, 3, 'característica'),(1104, 3, 'suave'),(1105, 3, 'acceso'),(1106, 3, 'tecla'),(1107, 3, 'hold'),(1108, 3, 'cierre'), +(1109, 3, 'magnético'),(1110, 3, 'conector'),(1111, 3, 'salva'),(1112, 3, 'pantallas'),(1113, 3, 'accesorios'),(1114, 1, 'shure'),(1115, 1, 'se210'), +(1116, 1, 'soundisolating'),(1117, 1, 'iphone'),(1118, 1, 'evolved'),(1119, 1, 'monitor'),(1120, 1, 'roadtested'),(1121, 1, 'musicians'),(1122, 1, 'perfected'), +(1123, 1, 'engineers,'),(1124, 1, 'lightweight'),(1125, 1, 'stylish'),(1126, 1, 'delivers'),(1127, 1, 'fullrange'),(1128, 1, 'audio'),(1129, 1, 'free'), +(1130, 1, 'outside'),(1131, 1, 'noise'),(1132, 1, 'using'),(1133, 1, 'hidefinition'),(1134, 1, 'microspeakers'),(1135, 1, 'deliver'),(1136, 1, 'audio,'), +(1137, 1, 'ergonomic'),(1138, 1, 'ideal'),(1139, 1, 'premium'),(1140, 1, 'onthego'),(1141, 1, 'listening'),(1142, 1, 'offer'),(1143, 1, 'accurate'), +(1144, 1, 'reproduction'),(1145, 1, 'both'),(1146, 1, 'sourcesfor'),(1147, 1, 'ultimate'),(1148, 1, 'precision'),(1149, 1, 'highs'), +(1150, 1, 'addition,'),(1151, 1, 'flexible'),(1152, 1, 'allows'),(1153, 1, 'choose'),(1154, 1, 'comfortable'),(1155, 1, 'variety'), +(1156, 1, 'wearing'),(1157, 1, 'positions'),(1158, 1, 'microspeaker'),(1159, 1, 'single'),(1160, 1, 'balanced'),(1161, 1, 'armature'), +(1162, 1, 'driver'),(1163, 1, 'detachable,'),(1164, 1, 'modular'),(1165, 1, 'make'),(1166, 1, 'longer'),(1167, 1, 'shorter'),(1168, 1, 'depending'), +(1169, 1, 'activity'),(1170, 1, 'connector'),(1171, 1, 'compatible'),(1172, 1, 'earphone'),(1173, 1, 'specifications'),(1174, 1, 'speaker'), +(1175, 1, 'type'),(1176, 1, 'frequency'),(1177, 1, 'range'),(1178, 1, '25hz185khz'),(1179, 1, 'impedance'),(1180, 1, '(1khz)'),(1181, 1, 'ohms'), +(1182, 1, 'sensitivity'),(1183, 1, '(1mw)'),(1184, 1, 'length'),(1185, 1, '(with'),(1186, 1, 'extension)'),(1187, 1, '(540'),(1188, 1, '1371'), +(1189, 1, 'extension'),(1190, 1, '(360'),(1191, 1, 'three'),(1192, 1, 'pairs'),(1193, 1, 'foam'),(1194, 1, 'earpiece'),(1195, 1, 'sleeves'), +(1196, 1, '(small,'),(1197, 1, 'medium,'),(1198, 1, 'large)'),(1199, 1, 'soft'),(1200, 1, 'flex'),(1201, 1, 'pair'),(1202, 1, 'tripleflange'), +(1203, 1, 'carrying'),(1204, 1, 'case'),(1205, 1, 'warranty'),(1206, 1, 'twoyear'),(1207, 1, 'limited'),(1208, 1, '(for'),(1209, 1, 'details,'), +(1210, 1, 'please'),(1211, 1, 'visit'),(1212, 1, 'wwwshurecom'),(1213, 1, 'personalaudio'),(1214, 1, 'customersupport'),(1215, 1, 'productreturnsa'), +(1216, 1, 'indexhtm)'),(1217, 1, 'se210aefs'),(1218, 1, 'note'),(1219, 1, 'products'),(1220, 1, 'sold'),(1221, 1, 'through'),(1222, 1, 'this'), +(1223, 1, 'website'),(1224, 1, 'bear'),(1225, 1, 'brand'),(1226, 1, 'name'),(1227, 1, 'serviced'),(1228, 1, 'supported'),(1229, 1, 'exclusively'), +(1230, 1, 'their'),(1231, 1, 'manufacturers'),(1232, 1, 'accordance'),(1233, 1, 'terms'),(1234, 1, 'conditions'),(1235, 1, 'packaged'), +(1236, 1, 'apple''s'),(1237, 1, 'does'),(1238, 1, 'apply'),(1239, 1, 'applebranded,'),(1240, 1, 'even'),(1241, 1, 'contact'),(1242, 1, 'manufacturer'), +(1243, 1, 'directly'),(1244, 1, 'technical'),(1245, 1, 'support'),(1246, 1, 'customer'),(1247, 1, 'service'),(1248, 1, 'incorporated'), +(1249, 2, 'isolation'),(1250, 2, 'sonore'),(1251, 2, 'shure'),(1252, 2, 'se210'),(1253, 2, 'ergonomiques'),(1254, 2, 'légers'),(1255, 2, 'offrent'), +(1256, 2, 'reproduction'),(1257, 2, 'audio'),(1258, 2, 'fidèle'),(1259, 2, 'provenance'),(1260, 2, 'sources'),(1261, 2, 'salon'),(1262, 2, 'basés'), +(1263, 2, 'moniteurs'),(1264, 2, 'personnels'),(1265, 2, 'testée'),(1266, 2, 'route'),(1267, 2, 'musiciens'),(1268, 2, 'professionnels'),(1269, 2, 'perfectionnée'), +(1270, 2, 'ingénieurs'),(1271, 2, 'shure,'),(1272, 2, 'se210,'),(1273, 2, 'élégants,'),(1274, 2, 'fournissent'),(1275, 2, 'sortie'),(1276, 2, 'gamme'), +(1277, 2, 'étendue'),(1278, 2, 'exempte'),(1279, 2, 'bruit'),(1280, 2, 'externe'),(1281, 2, 'embouts'),(1282, 2, 'fournis'),(1283, 2, 'bloquent'), +(1284, 2, 'ambiant'),(1285, 2, 'combinés'),(1286, 2, 'ergonomique'),(1287, 2, 'séduisant'),(1288, 2, 'modulaire,'),(1289, 2, 'minimisent'),(1290, 2, 'intrusions'), +(1291, 2, 'extérieur,'),(1292, 2, 'permettant'),(1293, 2, 'concentrer'),(1294, 2, 'conçus'),(1295, 2, 'amoureux'),(1296, 2, 'souhaitent'),(1297, 2, 'évoluer'), +(1298, 2, 'appareil'),(1299, 2, 'portable,'),(1300, 2, 'permettent'),(1301, 2, 'd''emmener'),(1302, 2, 'performance'),(1303, 2, 'microtransducte'),(1304, 2, 'haute'), +(1305, 2, 'définition'),(1306, 2, 'développés'),(1307, 2, 'écoute'),(1308, 2, 'qualité'),(1309, 2, 'supérieure'),(1310, 2, 'déplacement,'),(1311, 2, 'utilisent'), +(1312, 2, 'transducteur'),(1313, 2, 'armature'),(1314, 2, 'équilibrée'),(1315, 2, 'bénéficier'),(1316, 2, 'confort'),(1317, 2, 'd''écoute'),(1318, 2, 'époustouflant'), +(1319, 2, 'restitue'),(1320, 2, 'tous'),(1321, 2, 'détails'),(1322, 2, 'spectacle'),(1323, 2, 'live'),(1324, 2, 'universel'),(1325, 2, 'deluxe'), +(1326, 2, 'comprend'),(1327, 2, 'éléments'),(1328, 2, 'suivants'),(1329, 2, 'inclus'),(1330, 2, 'double'),(1331, 2, 'rôle'),(1332, 2, 'bloquer'), +(1333, 2, 'bruits'),(1334, 2, 'ambiants'),(1335, 2, 'garantir'),(1336, 2, 'maintien'),(1337, 2, 'personnalisés'),(1338, 2, 'oreille'),(1339, 2, 'différente,'), +(1340, 2, 'trois'),(1341, 2, 'tailles'),(1342, 2, 'd''embouts'),(1343, 2, 'mousse'),(1344, 2, 'flexibles'),(1345, 2, 'style'),(1346, 2, 'd''embout'), +(1347, 2, 'conviennent'),(1348, 2, 'mieux'),(1349, 2, 'bonne'),(1350, 2, 'étanchéité'),(1351, 2, 'facteur'),(1352, 2, 'optimiser'),(1353, 2, 'l''isolation'), +(1354, 2, 'réponse'),(1355, 2, 'basses,'),(1356, 2, 'ainsi'),(1357, 2, 'accroître'),(1358, 2, 'prolongée'),(1359, 2, 'modulaire'),(1360, 2, 'basant'), +(1361, 2, 'commentaires'),(1362, 2, 'nombreux'),(1363, 2, 'utilisateurs,'),(1364, 2, 'développé'),(1365, 2, 'solution'),(1366, 2, 'détachable'), +(1367, 2, 'permettre'),(1368, 2, 'degré'),(1369, 2, 'personnalisatio'),(1370, 2, 'précédent'),(1371, 2, 'mètre'),(1372, 2, 'fourni'),(1373, 2, 'd''adapter'), +(1374, 2, 'fonction'),(1375, 2, 'l''activité'),(1376, 2, 'l''application'),(1377, 2, 'transport'),(1378, 2, 'outre'),(1379, 2, 'compact'),(1380, 2, 'ranger'), +(1381, 2, 'manière'),(1382, 2, 'pratique'),(1383, 2, 'encombres'),(1384, 2, 'garantie'),(1385, 2, 'limitée'),(1386, 2, 'deux'),(1387, 2, 'achetée'), +(1388, 2, 'couverte'),(1389, 2, 'maind''œuvre'),(1390, 2, 'anscaractérist'),(1391, 2, 'techniques'),(1392, 2, 'type'),(1393, 2, 'sensibilité'), +(1394, 2, 'acoustique'),(1395, 2, 'impédance'),(1396, 2, 'khz)'),(1397, 2, 'fréquences'),(1398, 2, 'longueur'),(1399, 2, 'rallonge'),(1400, 2, '(embouts'), +(1401, 2, 'sonore,'),(1402, 2, 'transport)'),(1403, 2, 'incorporated'),(1404, 2, 'casque'),(1405, 2, 'marche'),(1406, 3, 'aislantes'),(1407, 3, 'sonido'), +(1408, 3, 'shure'),(1409, 3, 'se210'),(1410, 3, 'aislamiento'),(1411, 3, 'ergonómicos'),(1412, 3, 'ligeros'),(1413, 3, 'ofrecen'),(1414, 3, 'reproducción'), +(1415, 3, 'fiel'),(1416, 3, 'proveniente'),(1417, 3, 'fuentes'),(1418, 3, 'audio'),(1419, 3, 'estéreo'),(1420, 3, 'móviles'),(1421, 3, 'salón'),(1422, 3, 'se210,'), +(1423, 3, 'elegantes,'),(1424, 3, 'están'),(1425, 3, 'basados'),(1426, 3, 'monitores'),(1427, 3, 'personales'),(1428, 3, 'músicos'),(1429, 3, 'profesionales'), +(1430, 3, 'utilizan'),(1431, 3, 'carretera'),(1432, 3, 'ingenieros'),(1433, 3, 'perfeccionado'),(1434, 3, 'también'),(1435, 3, 'provistos'),(1436, 3, 'salida'), +(1437, 3, 'gama'),(1438, 3, 'extendida'),(1439, 3, 'exenta'),(1440, 3, 'ruido'),(1441, 3, 'sonoro'),(1442, 3, 'almohadillas'),(1443, 3, 'provistas'), +(1444, 3, 'bloquean'),(1445, 3, 'ambiente'),(1446, 3, 'combinadas'),(1447, 3, 'ergonómico'),(1448, 3, 'atractivo'),(1449, 3, 'modular,'),(1450, 3, 'minimizan'), +(1451, 3, 'intrusiones'),(1452, 3, 'permiten'),(1453, 3, 'concentrarte'),(1454, 3, 'creados'),(1455, 3, 'apasionados'),(1456, 3, 'quieren'),(1457, 3, 'aparato'), +(1458, 3, 'evolucione,'),(1459, 3, 'permitirán'),(1460, 3, 'llevar'),(1461, 3, 'allí'),(1462, 3, 'donde'),(1463, 3, 'vayas'),(1464, 3, 'microtransducto'), +(1465, 3, 'alta'),(1466, 3, 'definición'),(1467, 3, 'desarrollados'),(1468, 3, 'poder'),(1469, 3, 'audición'),(1470, 3, 'calidad'),(1471, 3, 'durante'), +(1472, 3, 'desplazamientos'),(1473, 3, 'único'),(1474, 3, 'transductor'),(1475, 3, 'armazón'),(1476, 3, 'equilibrado'),(1477, 3, 'confort'), +(1478, 3, 'restituye'),(1479, 3, 'espectáculo'),(1480, 3, 'directo'),(1481, 3, 'universal'),(1482, 3, 'deluxe'),(1483, 3, 'incluye'),(1484, 3, 'siguientes'), +(1485, 3, 'elementos'),(1486, 3, 'tienen'),(1487, 3, 'doble'),(1488, 3, 'función'),(1489, 3, 'bloquear'),(1490, 3, 'garantizar'),(1491, 3, 'estabilidad'), +(1492, 3, 'personalizados'),(1493, 3, 'oreja'),(1494, 3, 'tres'),(1495, 3, 'tallas'),(1496, 3, 'espuma'),(1497, 3, 'flexibles'),(1498, 3, 'talla'), +(1499, 3, 'estilo'),(1500, 3, 'almohadilla'),(1501, 3, 'mejor'),(1502, 3, 'convenga'),(1503, 3, 'buen'),(1504, 3, 'factor'),(1505, 3, 'clave'),(1506, 3, 'tanto'), +(1507, 3, 'optimizar'),(1508, 3, 'respuesta'),(1509, 3, 'bajos'),(1510, 3, 'aumentar'),(1511, 3, 'prolongada'),(1512, 3, 'modular'),(1513, 3, 'basándose'), +(1514, 3, 'comentarios'),(1515, 3, 'numerosos'),(1516, 3, 'usuarios,'),(1517, 3, 'solución'),(1518, 3, 'separable'),(1519, 3, 'permitir'),(1520, 3, 'grado'), +(1521, 3, 'personalizació'),(1522, 3, 'precedentes'),(1523, 3, 'metro'),(1524, 3, 'adaptar'),(1525, 3, 'actividad'),(1526, 3, 'momento'),(1527, 3, 'transporte'), +(1528, 3, 'además'),(1529, 3, 'guardar'),(1530, 3, 'manera'),(1531, 3, 'práctica'),(1532, 3, 'garantía'),(1533, 3, 'límite'),(1534, 3, 'años'),(1535, 3, 'tiene'), +(1536, 3, 'piezas'),(1537, 3, 'obra'),(1538, 3, 'técnicas'),(1539, 3, 'tipo'),(1540, 3, 'sensibilidad'),(1541, 3, 'acústica'),(1542, 3, 'impedancia'), +(1543, 3, 'khz)'),(1544, 3, 'frecuencias'),(1545, 3, 'longitud'),(1546, 3, 'alargador'),(1547, 3, 'caja'),(1548, 3, 'altavoces'),(1549, 3, '(almohadillas'), +(1550, 3, 'sonoro,'),(1551, 3, 'transporte)'),(1552, 3, 'incorporated'); + +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES +(2, 1, 1, 1, 1, 1), +(2, 2, 1, 1, 1, 1), +(2, 3, 1, 1, 1, 1), +(2, 4, 0, 0, 0, 0), +(2, 5, 1, 1, 1, 1), +(2, 6, 0, 0, 0, 0), +(2, 7, 0, 0, 0, 0), +(2, 8, 0, 0, 0, 0), +(2, 9, 0, 0, 0, 0), +(2, 10, 0, 0, 0, 0), +(2, 11, 0, 0, 0, 0), +(2, 12, 1, 1, 1, 1), +(2, 13, 1, 1, 1, 1), +(2, 14, 0, 0, 0, 0), +(2, 15, 0, 0, 0, 0), +(2, 16, 0, 0, 0, 0), +(2, 17, 1, 1, 1, 1), +(2, 18, 0, 0, 0, 0), +(2, 19, 0, 0, 0, 0), +(2, 20, 1, 1, 1, 1), +(2, 21, 1, 1, 1, 1), +(2, 22, 0, 0, 0, 0), +(2, 23, 0, 0, 0, 0), +(2, 24, 0, 0, 0, 0), +(2, 26, 0, 0, 0, 0), +(2, 27, 0, 0, 0, 0), +(2, 28, 0, 0, 0, 0), +(2, 29, 0, 0, 0, 0), +(2, 30, 0, 0, 0, 0), +(2, 31, 0, 0, 0, 0), +(2, 32, 0, 0, 0, 0), +(2, 33, 0, 0, 0, 0), +(2, 34, 1, 1, 1, 1), +(2, 35, 0, 0, 0, 0), +(2, 36, 0, 0, 0, 0), +(2, 37, 0, 0, 0, 0), +(2, 38, 0, 0, 0, 0), +(2, 39, 0, 0, 0, 0), +(2, 40, 0, 0, 0, 0), +(2, 41, 0, 0, 0, 0), +(2, 42, 1, 1, 1, 1), +(2, 43, 0, 0, 0, 0), +(2, 44, 0, 0, 0, 0), +(2, 46, 0, 0, 0, 0), +(2, 47, 1, 1, 1, 1), +(2, 48, 0, 0, 0, 0), +(2, 49, 1, 1, 1, 1), +(2, 51, 0, 0, 0, 0), +(2, 52, 0, 0, 0, 0), +(2, 53, 0, 0, 0, 0), +(2, 54, 0, 0, 0, 0), +(2, 55, 1, 1, 1, 1), +(2, 56, 0, 0, 0, 0), +(2, 57, 0, 0, 0, 0), +(2, 58, 0, 0, 0, 0), +(2, 59, 1, 1, 1, 1), +(2, 60, 1, 1, 1, 1), +(2, 61, 0, 0, 0, 0), +(2, 62, 0, 0, 0, 0), +(2, 63, 0, 0, 0, 0), +(2, 64, 0, 0, 0, 0), +(2, 65, 0, 0, 0, 0), +(2, 66, 0, 0, 0, 0), +(2, 67, 0, 0, 0, 0), +(2, 68, 0, 0, 0, 0), +(2, 69, 0, 0, 0, 0), +(2, 70, 0, 0, 0, 0), +(2, 71, 0, 0, 0, 0), +(2, 72, 0, 0, 0, 0), +(2, 73, 1, 1, 1, 1), +(2, 80, 0, 0, 0, 0), +(2, 81, 0, 0, 0, 0), +(2, 82, 0, 0, 0, 0), +(2, 83, 0, 0, 0, 0), +(2, 84, 0, 0, 0, 0), +(2, 85, 0, 0, 0, 0), +(2, 86, 0, 0, 0, 0), +(2, 87, 0, 0, 0, 0), +(2, 88, 1, 1, 1, 1), +(3, 1, 1, 1, 1, 1), +(3, 2, 0, 0, 0, 0), +(3, 3, 0, 0, 0, 0), +(3, 4, 0, 0, 0, 0), +(3, 5, 0, 0, 0, 0), +(3, 6, 0, 0, 0, 0), +(3, 7, 0, 0, 0, 0), +(3, 8, 0, 0, 0, 0), +(3, 9, 1, 0, 0, 0), +(3, 10, 0, 0, 0, 0), +(3, 11, 0, 0, 0, 0), +(3, 12, 0, 0, 0, 0), +(3, 13, 0, 0, 0, 0), +(3, 14, 0, 0, 0, 0), +(3, 15, 0, 0, 0, 0), +(3, 16, 0, 0, 0, 0), +(3, 17, 0, 0, 0, 0), +(3, 18, 0, 0, 0, 0), +(3, 19, 0, 0, 0, 0), +(3, 20, 0, 0, 0, 0), +(3, 21, 0, 0, 0, 0), +(3, 22, 0, 0, 0, 0), +(3, 23, 0, 0, 0, 0), +(3, 24, 0, 0, 0, 0), +(3, 26, 0, 0, 0, 0), +(3, 27, 0, 0, 0, 0), +(3, 28, 0, 0, 0, 0), +(3, 29, 0, 0, 0, 0), +(3, 30, 0, 0, 0, 0), +(3, 31, 0, 0, 0, 0), +(3, 32, 1, 1, 1, 1), +(3, 33, 1, 1, 1, 1), +(3, 34, 0, 0, 0, 0), +(3, 35, 0, 0, 0, 0), +(3, 36, 0, 0, 0, 0), +(3, 37, 0, 0, 0, 0), +(3, 38, 0, 0, 0, 0), +(3, 39, 0, 0, 0, 0), +(3, 40, 0, 0, 0, 0), +(3, 41, 0, 0, 0, 0), +(3, 42, 0, 0, 0, 0), +(3, 43, 1, 0, 0, 0), +(3, 44, 0, 0, 0, 0), +(3, 46, 0, 0, 0, 0), +(3, 47, 0, 0, 0, 0), +(3, 48, 0, 0, 0, 0), +(3, 49, 0, 0, 0, 0), +(3, 51, 0, 0, 0, 0), +(3, 52, 0, 0, 0, 0), +(3, 53, 0, 0, 0, 0), +(3, 54, 0, 0, 0, 0), +(3, 55, 0, 0, 0, 0), +(3, 56, 0, 0, 0, 0), +(3, 57, 1, 1, 1, 1), +(3, 58, 0, 0, 0, 0), +(3, 59, 0, 0, 0, 0), +(3, 60, 0, 0, 0, 0), +(3, 61, 0, 0, 0, 0), +(3, 62, 0, 0, 0, 0), +(3, 63, 0, 0, 0, 0), +(3, 64, 0, 0, 0, 0), +(3, 65, 0, 0, 0, 0), +(3, 66, 0, 0, 0, 0), +(3, 67, 0, 0, 0, 0), +(3, 68, 0, 0, 0, 0), +(3, 69, 0, 0, 0, 0), +(3, 70, 0, 0, 0, 0), +(3, 71, 0, 0, 0, 0), +(3, 72, 0, 0, 0, 0), +(3, 73, 0, 0, 0, 0), +(3, 80, 0, 0, 0, 0), +(3, 81, 0, 0, 0, 0), +(3, 82, 0, 0, 0, 0), +(3, 83, 0, 0, 0, 0), +(3, 84, 0, 0, 0, 0), +(3, 85, 0, 0, 0, 0), +(3, 86, 0, 0, 0, 0), +(3, 87, 0, 0, 0, 0), +(3, 88, 1, 1, 1, 1), +(4, 1, 1, 1, 1, 1), +(4, 2, 1, 1, 1, 1), +(4, 3, 1, 1, 1, 1), +(4, 4, 0, 0, 0, 0), +(4, 5, 0, 0, 0, 0), +(4, 6, 1, 1, 1, 1), +(4, 7, 0, 0, 0, 0), +(4, 8, 0, 0, 0, 0), +(4, 9, 0, 0, 0, 0), +(4, 10, 1, 0, 0, 0), +(4, 11, 0, 0, 0, 0), +(4, 12, 1, 1, 1, 1), +(4, 13, 0, 0, 0, 0), +(4, 14, 0, 0, 0, 0), +(4, 15, 0, 0, 0, 0), +(4, 16, 0, 0, 0, 0), +(4, 17, 0, 0, 0, 0), +(4, 18, 0, 0, 0, 0), +(4, 19, 0, 0, 0, 0), +(4, 20, 0, 0, 0, 0), +(4, 21, 0, 0, 0, 0), +(4, 22, 0, 0, 0, 0), +(4, 23, 0, 0, 0, 0), +(4, 24, 0, 0, 0, 0), +(4, 26, 0, 0, 0, 0), +(4, 27, 0, 0, 0, 0), +(4, 28, 0, 0, 0, 0), +(4, 29, 0, 0, 0, 0), +(4, 30, 0, 0, 0, 0), +(4, 31, 0, 0, 0, 0), +(4, 32, 0, 0, 0, 0), +(4, 33, 0, 0, 0, 0), +(4, 34, 0, 0, 0, 0), +(4, 35, 0, 0, 0, 0), +(4, 36, 0, 0, 0, 0), +(4, 37, 0, 0, 0, 0), +(4, 38, 0, 0, 0, 0), +(4, 39, 0, 0, 0, 0), +(4, 40, 0, 0, 0, 0), +(4, 41, 0, 0, 0, 0), +(4, 42, 1, 1, 1, 1), +(4, 43, 1, 0, 0, 0), +(4, 44, 0, 0, 0, 0), +(4, 46, 0, 0, 0, 0), +(4, 47, 0, 0, 0, 0), +(4, 48, 0, 0, 0, 0), +(4, 49, 1, 1, 1, 1), +(4, 51, 0, 0, 0, 0), +(4, 52, 0, 0, 0, 0), +(4, 53, 0, 0, 0, 0), +(4, 54, 1, 1, 1, 1), +(4, 55, 0, 0, 0, 0), +(4, 56, 0, 0, 0, 0), +(4, 57, 0, 0, 0, 0), +(4, 58, 0, 0, 0, 0), +(4, 59, 1, 1, 1, 1), +(4, 60, 0, 0, 0, 0), +(4, 61, 0, 0, 0, 0), +(4, 62, 1, 1, 1, 1), +(4, 63, 1, 1, 1, 1), +(4, 64, 0, 0, 0, 0), +(4, 65, 1, 1, 1, 1), +(4, 66, 0, 0, 0, 0), +(4, 67, 0, 0, 0, 0), +(4, 68, 0, 0, 0, 0), +(4, 69, 0, 0, 0, 0), +(4, 70, 0, 0, 0, 0), +(4, 71, 0, 0, 0, 0), +(4, 72, 0, 0, 0, 0), +(4, 73, 0, 0, 0, 0), +(4, 80, 0, 0, 0, 0), +(4, 81, 0, 0, 0, 0), +(4, 82, 1, 1, 1, 1), +(4, 83, 0, 0, 0, 0), +(4, 84, 0, 0, 0, 0), +(4, 85, 0, 0, 0, 0), +(4, 86, 0, 0, 0, 0), +(4, 87, 0, 0, 0, 0), +(4, 88, 1, 1, 1, 1); + +INSERT INTO `PREFIX_profile` (`id_profile`) VALUES (2),(3),(4); +INSERT INTO `PREFIX_profile_lang` (`id_lang`, `id_profile`, `name`) VALUES +(1, 2, 'Logistician'),(2, 2, 'Logisticien'),(3, 2, 'Logistician'),(4, 2, 'Logistiker'),(5, 2, 'Logista'), +(1, 3, 'Translator'),(2, 3, 'Traducteur'),(3, 3, 'Translator'),(4, 3, 'Übersetzer'),(5, 3, 'Traduttore'), +(1, 4, 'Salesman'),(2, 4, 'Commercial'),(3, 4, 'Salesman'),(4, 4, 'Verkäufer'),(5, 4, 'Venditore'); + +INSERT INTO `PREFIX_stock_mvt` (`id_stock_mvt`, `id_product`, `id_product_attribute`, `id_order`, `id_stock_mvt_reason`, `id_employee`, `quantity`, `date_add`, `date_upd`) VALUES +(1, 6, 0, 0, 2, 1, 250, NOW(), NOW()),(2, 8, 0, 0, 2, 1, 1, NOW(), NOW()),(3, 9, 0, 0, 2, 1, 1, NOW(), NOW()),(4, 2, 7, 0, 2, 1, 10, NOW(), NOW()),(5, 2, 8, 0, 2, 1, 20, NOW(), NOW()),(6, 2, 9, 0, 2, 1, 30, NOW(), NOW()),(7, 2, 10, 0, 2, 1, 40, NOW(), NOW()),(8, 5, 12, 0, 2, 1, 100, NOW(), NOW()),(9, 5, 13, 0, 2, 1, 99, NOW(), NOW()),(10, 5, 14, 0, 2, 1, 50, NOW(), NOW()),(11, 5, 15, 0, 2, 1, 25, NOW(), NOW()),(12, 7, 19, 0, 2, 1, 50, NOW(), NOW()),(13, 7, 22, 0, 2, 1, 60, NOW(), NOW()),(14, 7, 23, 0, 2, 1, 70, NOW(), NOW()),(15, 1, 25, 0, 2, 1, 50, NOW(), NOW()),(16, 1, 26, 0, 2, 1, 50, NOW(), NOW()),(17, 1, 27, 0, 2, 1, 50, NOW(), NOW()),(18, 1, 28, 0, 2, 1, 50, NOW(), NOW()),(19, 1, 29, 0, 2, 1, 50, NOW(), NOW()),(20, 1, 30, 0, 2, 1, 50, NOW(), NOW()),(21, 1, 31, 0, 2, 1, 50, NOW(), NOW()),(22, 1, 32, 0, 2, 1, 50, NOW(), NOW()),(23, 1, 33, 0, 2, 1, 50, NOW(), NOW()),(24, 1, 34, 0, 2, 1, 50, NOW(), NOW()),(25, 1, 35, 0, 2, 1, 50, NOW(), NOW()),(26, 1, 36, 0, 2, 1, 50, NOW(), NOW()),(27, 1, 39, 0, 2, 1, 50, NOW(), NOW()),(28, 1, 40, 0, 2, 1, 50, NOW(), NOW()),(29, 1, 41, 0, 2, 1, 50, NOW(), NOW()),(30, 1, 42, 0, 2, 1, 50, NOW(), NOW()); + +INSERT INTO `PREFIX_store` (`id_store`, `id_country`, `id_state`, `name`, `address1`, `address2`, `city`, `postcode`, `latitude`, `longitude`, `hours`, `phone`, `fax`, `email`, `note`, `active`, `date_add`, `date_upd`) VALUES +(1, 21, 9, 'Dade County', '3030 SW 8th St Miami', '', 'Miami', ' 33135', 25.765005, -80.243797, 'a:7:{i:0;s:13:"09:00 - 19:00";i:1;s:13:"09:00 - 19:00";i:2;s:13:"09:00 - 19:00";i:3;s:13:"09:00 - 19:00";i:4;s:13:"09:00 - 19:00";i:5;s:13:"10:00 - 16:00";i:6;s:13:"10:00 - 16:00";}', '', '', '', '', 1, '2010-11-09 10:53:13', '2010-11-09 10:53:13'), +(2, 21, 9, 'E Fort Lauderdale', '1000 Northeast 4th Ave Fort Lauderdale', '', 'miami', ' 33304', 26.137936, -80.139435, 'a:7:{i:0;s:13:"09:00 - 19:00";i:1;s:13:"09:00 - 19:00";i:2;s:13:"09:00 - 19:00";i:3;s:13:"09:00 - 19:00";i:4;s:13:"09:00 - 19:00";i:5;s:13:"10:00 - 16:00";i:6;s:13:"10:00 - 16:00";}', '', '', '', '', 1, '2010-11-09 10:56:26', '2010-11-09 10:56:26'), +(3, 21, 9, 'Pembroke Pines', '11001 Pines Blvd Pembroke Pines', '', 'miami', '33026', 26.009987, -80.294472, 'a:7:{i:0;s:13:"09:00 - 19:00";i:1;s:13:"09:00 - 19:00";i:2;s:13:"09:00 - 19:00";i:3;s:13:"09:00 - 19:00";i:4;s:13:"09:00 - 19:00";i:5;s:13:"10:00 - 16:00";i:6;s:13:"10:00 - 16:00";}', '', '', '', '', 1, '2010-11-09 10:58:42', '2010-11-09 11:01:11'), +(4, 21, 9, 'Coconut Grove', '2999 SW 32nd Avenue', '', ' Miami', ' 33133', 25.736296, -80.244797, 'a:7:{i:0;s:13:"09:00 - 19:00";i:1;s:13:"09:00 - 19:00";i:2;s:13:"09:00 - 19:00";i:3;s:13:"09:00 - 19:00";i:4;s:13:"09:00 - 19:00";i:5;s:13:"10:00 - 16:00";i:6;s:13:"10:00 - 16:00";}', '', '', '', '', 1, '2010-11-09 11:00:38', '2010-11-09 11:04:52'), +(5, 21, 9, 'N Miami/Biscayne', '12055 Biscayne Blvd', '', 'Miami', '33181', 25.886740, -80.163292, 'a:7:{i:0;s:13:"09:00 - 19:00";i:1;s:13:"09:00 - 19:00";i:2;s:13:"09:00 - 19:00";i:3;s:13:"09:00 - 19:00";i:4;s:13:"09:00 - 19:00";i:5;s:13:"10:00 - 16:00";i:6;s:13:"10:00 - 16:00";}', '', '', '', '', 1, '2010-11-09 11:11:28', '2010-11-09 11:11:28'); + diff --git a/install-dev/sql/db_settings_lite.sql b/install-dev/sql/db_settings_lite.sql new file mode 100644 index 000000000..62709cac4 --- /dev/null +++ b/install-dev/sql/db_settings_lite.sql @@ -0,0 +1,1028 @@ +SET NAMES 'utf8'; + +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`, `live_edit`) VALUES +(1, 'payment', 'Payment', NULL, 1, 1), +(2, 'newOrder', 'New orders', NULL, 0, 0), +(3, 'paymentConfirm', 'Payment confirmation', NULL, 0, 0), +(4, 'paymentReturn', 'Payment return', NULL, 0, 0), +(5, 'updateQuantity', 'Quantity update', 'Quantity is updated only when the customer effectively place his order.', 0, 0), +(6, 'rightColumn', 'Right column blocks', NULL, 1, 1), +(7, 'leftColumn', 'Left column blocks', NULL, 1, 1), +(8, 'home', 'Homepage content', NULL, 1, 1), +(9, 'header', 'Header of pages', 'A hook which allow you to do things in the header of each pages', 1, 0), +(10, 'cart', 'Cart creation and update', NULL, 0, 0), +(11, 'authentication', 'Successful customer authentication', NULL, 0, 0), +(12, 'addproduct', 'Product creation', NULL, 0, 0), +(13, 'updateproduct', 'Product Update', NULL, 0, 0), +(14, 'top', 'Top of pages', 'A hook which allow you to do things a the top of each pages.', 1, 0), +(15, 'extraRight', 'Extra actions on the product page (right column).', NULL, 0, 0), +(16, 'deleteproduct', 'Product deletion', 'This hook is called when a product is deleted', 0, 0), +(17, 'productfooter', 'Product footer', 'Add new blocks under the product description', 1, 1), +(18, 'invoice', 'Invoice', 'Add blocks to invoice (order)', 1, 0), +(19, 'updateOrderStatus', 'Order''s status update event', 'Launch modules when the order''s status of an order change.', 0, 0), +(20, 'adminOrder', 'Display in Back-Office, tab AdminOrder', 'Launch modules when the tab AdminOrder is displayed on back-office.', 0, 0), +(21, 'footer', 'Footer', 'Add block in footer', 1, 0), +(22, 'PDFInvoice', 'PDF Invoice', 'Allow the display of extra informations into the PDF invoice', 0, 0), +(23, 'adminCustomers', 'Display in Back-Office, tab AdminCustomers', 'Launch modules when the tab AdminCustomers is displayed on back-office.', 0, 0), +(24, 'orderConfirmation', 'Order confirmation page', 'Called on order confirmation page', 0, 0), +(25, 'createAccount', 'Successful customer create account', 'Called when new customer create account successfuled', 0, 0), +(26, 'customerAccount', 'Customer account page display in front office', 'Display on page account of the customer', 1, 0), +(27, 'orderSlip', 'Called when a order slip is created', 'Called when a quantity of one product change in an order.', 0, 0), +(28, 'productTab', 'Tabs on product page', 'Called on order product page tabs', 0, 0), +(29, 'productTabContent', 'Content of tabs on product page', 'Called on order product page tabs', 0, 0), +(30, 'shoppingCart', 'Shopping cart footer', 'Display some specific informations on the shopping cart page', 0, 0), +(31, 'createAccountForm', 'Customer account creation form', 'Display some information on the form to create a customer account', 1, 0), +(32, 'AdminStatsModules','Stats - Modules', NULL, 1, 0), +(33, 'GraphEngine','Graph Engines', NULL, 0, 0), +(34, 'orderReturn','Product returned', NULL, 0, 0), +(35, 'productActions', 'Product actions', 'Put new action buttons on product page', 1, 0), +(36, 'backOfficeHome', 'Administration panel homepage', NULL, 1, 0), +(37, 'GridEngine','Grid Engines', NULL, 0, 0), +(38, 'watermark','Watermark', NULL, 0, 0), +(39, 'cancelProduct', 'Product cancelled', 'This hook is called when you cancel a product in an order', 0, 0), +(40, 'extraLeft', 'Extra actions on the product page (left column).', NULL, 0, 0), +(41, 'productOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1, 0), +(42, 'updateProductAttribute', 'Product attribute update', NULL, 0, 0), +(43, 'extraCarrier', 'Extra carrier (module mode)', NULL, 0, 0), +(44, 'shoppingCartExtra', 'Shopping cart extra button', 'Display some specific informations', 1, 0), +(45, 'search', 'Search', NULL, 0, 0), +(46, 'backBeforePayment', 'Redirect in order process', 'Redirect user to the module instead of displaying payment modules', 0, 0), +(47, 'updateCarrier', 'Carrier Update', 'This hook is called when a carrier is updated', 0, 0), +(48, 'postUpdateOrderStatus', 'Post update of order status', NULL, 0, 0), +(49, 'createAccountTop', 'Block above the form for create an account', NULL, 1, 0), +(50, 'backOfficeHeader', 'Administration panel header', NULL , 0, 0), +(51, 'backOfficeTop', 'Administration panel hover the tabs', NULL , 1, 0), +(52, 'backOfficeFooter', 'Administration panel footer', NULL , 1, 0), +(53, 'deleteProductAttribute', 'Product Attribute Deletion', NULL, 0, 0), +(54, 'processCarrier', 'Carrier Process', NULL, 0, 0), +(55, 'orderDetail', 'Order Detail', 'To set the follow-up in smarty when order detail is called', 0, 0), +(56, 'beforeCarrier', 'Before carrier list', 'This hook is display before the carrier list on Front office', 1, 0), +(57, 'orderDetailDisplayed', 'Order detail displayed', 'Displayed on order detail on front office', 1, 0), +(58, 'paymentCCAdded', 'Payment CC added', 'Payment CC added', 0, 0), +(59, 'extraProductComparison', 'Extra Product Comparison', 'Extra Product Comparison', 0, 0), +(60, 'categoryAddition', 'Category creation', '', 0, 0), +(61, 'categoryUpdate', 'Category modification', '', 0, 0), +(62, 'categoryDeletion', 'Category removal', '', 0, 0), +(63, 'beforeAuthentication', 'Before Authentication', 'Before authentication', 0, 0), +(64, 'paymentTop', 'Top of payment page', 'Top of payment page', 0, 0), +(65, 'afterCreateHtaccess', 'After htaccess creation', 'After htaccess creation', 0, 0), +(66, 'afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0); + +INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES +(1, 'PS_LANG_DEFAULT', '1', NOW(), NOW()), +(2, 'PS_CURRENCY_DEFAULT', '1', NOW(), NOW()), +(3, 'PS_COUNTRY_DEFAULT', '8', NOW(), NOW()), +(4, 'PS_REWRITING_SETTINGS', '0', NOW(), NOW()), +(5, 'PS_ORDER_OUT_OF_STOCK', '0', NOW(), NOW()), +(6, 'PS_LAST_QTIES', '3', NOW(), NOW()), +(7, 'PS_CART_REDIRECT', '1', NOW(), NOW()), +(8, 'PS_HELPBOX', '1', NOW(), NOW()), +(9, 'PS_CONDITIONS', '1', NOW(), NOW()), +(10, 'PS_RECYCLABLE_PACK', '1', NOW(), NOW()), +(11, 'PS_GIFT_WRAPPING', '1', NOW(), NOW()), +(12, 'PS_GIFT_WRAPPING_PRICE', '0', NOW(), NOW()), +(13, 'PS_STOCK_MANAGEMENT', '1', NOW(), NOW()), +(14, 'PS_NAVIGATION_PIPE', '>', NOW(), NOW()), +(15, 'PS_PRODUCTS_PER_PAGE', '10', NOW(), NOW()), +(16, 'PS_PURCHASE_MINIMUM', '0', NOW(), NOW()), +(17, 'PS_PRODUCTS_ORDER_WAY', '0', NOW(), NOW()), +(18, 'PS_PRODUCTS_ORDER_BY', '4', NOW(), NOW()), +(19, 'PS_DISPLAY_QTIES', '1', NOW(), NOW()), +(20, 'PS_SHIPPING_HANDLING', '2', NOW(), NOW()), +(21, 'PS_SHIPPING_FREE_PRICE', '300', NOW(), NOW()), +(22, 'PS_SHIPPING_FREE_WEIGHT', '20', NOW(), NOW()), +(23, 'PS_SHIPPING_METHOD', '1', NOW(), NOW()), +(24, 'PS_TAX', '1', NOW(), NOW()), +(25, 'PS_SHOP_ENABLE', '1', NOW(), NOW()), +(26, 'PS_NB_DAYS_NEW_PRODUCT', '20', NOW(), NOW()), +(27, 'PS_SSL_ENABLED', '0', NOW(), NOW()), +(28, 'PS_WEIGHT_UNIT', 'kg', NOW(), NOW()), +(29, 'PS_BLOCK_CART_AJAX', '1', NOW(), NOW()), +(30, 'PS_ORDER_RETURN', '0', NOW(), NOW()), +(31, 'PS_ORDER_RETURN_NB_DAYS', '7', NOW(), NOW()), +(32, 'PS_MAIL_TYPE', '3', NOW(), NOW()), +(33, 'PS_PRODUCT_PICTURE_MAX_SIZE', '131072', NOW(), NOW()), +(34, 'PS_PRODUCT_PICTURE_WIDTH', '64', NOW(), NOW()), +(35, 'PS_PRODUCT_PICTURE_HEIGHT', '64', NOW(), NOW()), +(36, 'PS_INVOICE_PREFIX', 'IN', NOW(), NOW()), +(37, 'PS_INVOICE_NUMBER', '1', NOW(), NOW()), +(38, 'PS_DELIVERY_PREFIX', 'DE', NOW(), NOW()), +(39, 'PS_DELIVERY_NUMBER', '1', NOW(), NOW()), +(40, 'PS_INVOICE', '1', NOW(), NOW()), +(41, 'PS_PASSWD_TIME_BACK', '360', NOW(), NOW()), +(42, 'PS_PASSWD_TIME_FRONT', '360', NOW(), NOW()), +(43, 'PS_DISP_UNAVAILABLE_ATTR', '1', NOW(), NOW()), +(44, 'PS_VOUCHERS', '1', NOW(), NOW()), +(45, 'PS_SEARCH_MINWORDLEN', '3', NOW(), NOW()), +(46, 'PS_SEARCH_BLACKLIST', '', NOW(), NOW()), +(47, 'PS_SEARCH_WEIGHT_PNAME', '6', NOW(), NOW()), +(48, 'PS_SEARCH_WEIGHT_REF', '10', NOW(), NOW()), +(49, 'PS_SEARCH_WEIGHT_SHORTDESC', '1', NOW(), NOW()), +(50, 'PS_SEARCH_WEIGHT_DESC', '1', NOW(), NOW()), +(51, 'PS_SEARCH_WEIGHT_CNAME', '3', NOW(), NOW()), +(52, 'PS_SEARCH_WEIGHT_MNAME', '3', NOW(), NOW()), +(53, 'PS_SEARCH_WEIGHT_TAG', '4', NOW(), NOW()), +(54, 'PS_SEARCH_WEIGHT_ATTRIBUTE', '2', NOW(), NOW()), +(55, 'PS_SEARCH_WEIGHT_FEATURE', '2', NOW(), NOW()), +(56, 'PS_SEARCH_AJAX', '1', NOW(), NOW()), +(57, 'PS_TIMEZONE', 'Europe/Paris', NOW(), NOW()), +(58, 'PS_THEME_V11', 0, NOW(), NOW()), +(59, 'PRESTASTORE_LIVE', 1, NOW(), NOW()), +(60, 'PS_TIN_ACTIVE', 0, NOW(), NOW()), +(61, 'PS_SHOW_ALL_MODULES', 0, NOW(), NOW()), +(62, 'PS_BACKUP_ALL', 0, NOW(), NOW()), +(63, 'PS_1_3_UPDATE_DATE', NOW(), NOW(), NOW()), +(64, 'PS_PRICE_ROUND_MODE', 2, NOW(), NOW()), +(65, 'PS_1_3_2_UPDATE_DATE', NOW(), NOW(), NOW()), +(66, 'PS_CONDITIONS_CMS_ID', 3, NOW(), NOW()), +(67, 'TRACKING_DIRECT_TRAFFIC', 0, NOW(), NOW()), +(68, 'PS_META_KEYWORDS', 0, NOW(), NOW()), +(69, 'PS_DISPLAY_JQZOOM', 0, NOW(), NOW()), +(70, 'PS_VOLUME_UNIT', 'cl', NOW(), NOW()), +(71, 'PS_CIPHER_ALGORITHM', 0, NOW(), NOW()), +(72, 'PS_ATTRIBUTE_CATEGORY_DISPLAY', 1, NOW(), NOW()), +(73, 'PS_CUSTOMER_SERVICE_FILE_UPLOAD', 1, NOW(), NOW()), +(74, 'PS_CUSTOMER_SERVICE_SIGNATURE', '', NOW(), NOW()), +(75, 'PS_BLOCK_BESTSELLERS_DISPLAY', 0, NOW(), NOW()), +(76, 'PS_BLOCK_NEWPRODUCTS_DISPLAY', 0, NOW(), NOW()), +(77, 'PS_BLOCK_SPECIALS_DISPLAY', 0, NOW(), NOW()), +(78, 'PS_STOCK_MVT_REASON_DEFAULT', 3, NOW(), NOW()), +(79, 'PS_COMPARATOR_MAX_ITEM', 3, NOW(), NOW()), +(80, 'PS_ORDER_PROCESS_TYPE', 0, NOW(), NOW()), +(81, 'PS_SPECIFIC_PRICE_PRIORITIES', 'id_shop;id_currency;id_country;id_group', NOW(), NOW()), +(82, 'PS_TAX_DISPLAY', 0, NOW(), NOW()), +(83, 'PS_SMARTY_FORCE_COMPILE', 1, NOW(), NOW()), +(84, 'PS_DISTANCE_UNIT', 'km', NOW(), NOW()), +(85, 'PS_STORES_DISPLAY_CMS', 1, NOW(), NOW()), +(86, 'PS_STORES_DISPLAY_FOOTER', 1, NOW(), NOW()), +(87, 'PS_STORES_SIMPLIFIED', 0, NOW(), NOW()), +(88, 'SHOP_LOGO_WIDTH', 224, NOW(), NOW()), +(89, 'SHOP_LOGO_HEIGHT', 73, NOW(), NOW()), +(90, 'EDITORIAL_IMAGE_WIDTH', 530, NOW(), NOW()), +(91, 'EDITORIAL_IMAGE_HEIGHT', 228, NOW(), NOW()), +(92, 'PS_STATSDATA_CUSTOMER_PAGESVIEWS', 0, NOW(), NOW()), +(93, 'PS_STATSDATA_PAGESVIEWS', 0, NOW(), NOW()), +(94, 'PS_STATSDATA_PLUGINS', 0, NOW(), NOW()), +(95, 'PS_GEOLOCATION_ENABLED', '0', NOW(), NOW()), +(96, 'PS_ALLOWED_COUNTRIES', 'AF;ZA;AX;AL;DZ;DE;AD;AO;AI;AQ;AG;AN;SA;AR;AM;AW;AU;AT;AZ;BS;BH;BD;BB;BY;BE;BZ;BJ;BM;BT;BO;BA;BW;BV;BR;BN;BG;BF;MM;BI;KY;KH;CM;CA;CV;CF;CL;CN;CX;CY;CC;CO;KM;CG;CD;CK;KR;KP;CR;CI;HR;CU;DK;DJ;DM;EG;IE;SV;AE;EC;ER;ES;EE;ET;FK;FO;FJ;FI;FR;GA;GM;GE;GS;GH;GI;GR;GD;GL;GP;GU;GT;GG;GN;GQ;GW;GY;GF;HT;HM;HN;HK;HU;IM;MU;VG;VI;IN;ID;IR;IQ;IS;IL;IT;JM;JP;JE;JO;KZ;KE;KG;KI;KW;LA;LS;LV;LB;LR;LY;LI;LT;LU;MO;MK;MG;MY;MW;MV;ML;MT;MP;MA;MH;MQ;MR;YT;MX;FM;MD;MC;MN;ME;MS;MZ;NA;NR;NP;NI;NE;NG;NU;NF;NO;NC;NZ;IO;OM;UG;UZ;PK;PW;PS;PA;PG;PY;NL;PE;PH;PN;PL;PF;PR;PT;QA;DO;CZ;RE;RO;GB;RU;RW;EH;BL;KN;SM;MF;PM;VA;VC;LC;SB;WS;AS;ST;SN;RS;SC;SL;SG;SK;SI;SO;SD;LK;SE;CH;SR;SJ;SZ;SY;TJ;TW;TZ;TD;TF;TH;TL;TG;TK;TO;TT;TN;TM;TC;TR;TV;UA;UY;US;VU;VE;VN;WF;YE;ZM;ZW', NOW(), NOW()), +(97, 'PS_GEOLOCATION_BEHAVIOR', '0', NOW(), NOW()), +(98, 'PS_LOCALE_LANGUAGE', '', NOW(), NOW()), +(99, 'PS_LOCALE_COUNTRY', '', NOW(), NOW()), +(100, 'PS_ATTACHMENT_MAXIMUM_SIZE', '2', NOW(), NOW()), +(101, 'PS_SMARTY_CACHE', '1', NOW(), NOW()), +(102, 'PS_DIMENSION_UNIT', 'cm', NOW(), NOW()), +(103, 'PS_FORCE_SMARTY_2', '0', NOW(), NOW()), +(104, 'PS_GUEST_CHECKOUT_ENABLED', '0', NOW(), NOW()), +(105, 'PS_DISPLAY_SUPPLIERS', '0', NOW(), NOW()), +(106, 'PS_CATALOG_MODE', '0', NOW(), NOW()), +(107, 'PS_GEOLOCATION_WHITELIST', '209.185.108;209.185.253;209.85.238;209.85.238.11;209.85.238.4;216.239.33.96;216.239.33.97;216.239.33.98;216.239.33.99;216.239.37.98;216.239.37.99;216.239.39.98;216.239.39.99;216.239.41.96;216.239.41.97;216.239.41.98;216.239.41.99;216.239.45.4;216.239.46;216.239.51.96;216.239.51.97;216.239.51.98;216.239.51.99;216.239.53.98;216.239.53.99;216.239.57.96;216.239.57.97;216.239.57.98;216.239.57.99;216.239.59.98;216.239.59.99;216.33.229.163;64.233.173.193;64.233.173.194;64.233.173.195;64.233.173.196;64.233.173.197;64.233.173.198;64.233.173.199;64.233.173.200;64.233.173.201;64.233.173.202;64.233.173.203;64.233.173.204;64.233.173.205;64.233.173.206;64.233.173.207;64.233.173.208;64.233.173.209;64.233.173.210;64.233.173.211;64.233.173.212;64.233.173.213;64.233.173.214;64.233.173.215;64.233.173.216;64.233.173.217;64.233.173.218;64.233.173.219;64.233.173.220;64.233.173.221;64.233.173.222;64.233.173.223;64.233.173.224;64.233.173.225;64.233.173.226;64.233.173.227;64.233.173.228;64.233.173.229;64.233.173.230;64.233.173.231;64.233.173.232;64.233.173.233;64.233.173.234;64.233.173.235;64.233.173.236;64.233.173.237;64.233.173.238;64.233.173.239;64.233.173.240;64.233.173.241;64.233.173.242;64.233.173.243;64.233.173.244;64.233.173.245;64.233.173.246;64.233.173.247;64.233.173.248;64.233.173.249;64.233.173.250;64.233.173.251;64.233.173.252;64.233.173.253;64.233.173.254;64.233.173.255;64.68.80;64.68.81;64.68.82;64.68.83;64.68.84;64.68.85;64.68.86;64.68.87;64.68.88;64.68.89;64.68.90.1;64.68.90.10;64.68.90.11;64.68.90.12;64.68.90.129;64.68.90.13;64.68.90.130;64.68.90.131;64.68.90.132;64.68.90.133;64.68.90.134;64.68.90.135;64.68.90.136;64.68.90.137;64.68.90.138;64.68.90.139;64.68.90.14;64.68.90.140;64.68.90.141;64.68.90.142;64.68.90.143;64.68.90.144;64.68.90.145;64.68.90.146;64.68.90.147;64.68.90.148;64.68.90.149;64.68.90.15;64.68.90.150;64.68.90.151;64.68.90.152;64.68.90.153;64.68.90.154;64.68.90.155;64.68.90.156;64.68.90.157;64.68.90.158;64.68.90.159;64.68.90.16;64.68.90.160;64.68.90.161;64.68.90.162;64.68.90.163;64.68.90.164;64.68.90.165;64.68.90.166;64.68.90.167;64.68.90.168;64.68.90.169;64.68.90.17;64.68.90.170;64.68.90.171;64.68.90.172;64.68.90.173;64.68.90.174;64.68.90.175;64.68.90.176;64.68.90.177;64.68.90.178;64.68.90.179;64.68.90.18;64.68.90.180;64.68.90.181;64.68.90.182;64.68.90.183;64.68.90.184;64.68.90.185;64.68.90.186;64.68.90.187;64.68.90.188;64.68.90.189;64.68.90.19;64.68.90.190;64.68.90.191;64.68.90.192;64.68.90.193;64.68.90.194;64.68.90.195;64.68.90.196;64.68.90.197;64.68.90.198;64.68.90.199;64.68.90.2;64.68.90.20;64.68.90.200;64.68.90.201;64.68.90.202;64.68.90.203;64.68.90.204;64.68.90.205;64.68.90.206;64.68.90.207;64.68.90.208;64.68.90.21;64.68.90.22;64.68.90.23;64.68.90.24;64.68.90.25;64.68.90.26;64.68.90.27;64.68.90.28;64.68.90.29;64.68.90.3;64.68.90.30;64.68.90.31;64.68.90.32;64.68.90.33;64.68.90.34;64.68.90.35;64.68.90.36;64.68.90.37;64.68.90.38;64.68.90.39;64.68.90.4;64.68.90.40;64.68.90.41;64.68.90.42;64.68.90.43;64.68.90.44;64.68.90.45;64.68.90.46;64.68.90.47;64.68.90.48;64.68.90.49;64.68.90.5;64.68.90.50;64.68.90.51;64.68.90.52;64.68.90.53;64.68.90.54;64.68.90.55;64.68.90.56;64.68.90.57;64.68.90.58;64.68.90.59;64.68.90.6;64.68.90.60;64.68.90.61;64.68.90.62;64.68.90.63;64.68.90.64;64.68.90.65;64.68.90.66;64.68.90.67;64.68.90.68;64.68.90.69;64.68.90.7;64.68.90.70;64.68.90.71;64.68.90.72;64.68.90.73;64.68.90.74;64.68.90.75;64.68.90.76;64.68.90.77;64.68.90.78;64.68.90.79;64.68.90.8;64.68.90.80;64.68.90.9;64.68.91;64.68.92;66.249.64;66.249.65;66.249.66;66.249.67;66.249.68;66.249.69;66.249.70;66.249.71;66.249.72;66.249.73;66.249.78;66.249.79;72.14.199;8.6.48', NOW(), NOW()), +(108, 'PS_LOGS_BY_EMAIL', '5', NOW(), NOW()), +(109, 'PS_COOKIE_CHECKIP', '1', NOW(), NOW()), +(110, 'PS_STORES_CENTER_LAT', '25.948969', NOW(), NOW()), +(111, 'PS_STORES_CENTER_LONG', '-80.226439', NOW(), NOW()), +(112, 'PS_HOMEPAGE_PHP_SELF', 'index.php', NOW(), NOW()), +(113, 'PS_USE_ECOTAX', '0', NOW(), NOW()), +(114, 'PS_CANONICAL_REDIRECT', '1', NOW(), NOW()), +(115, 'PS_IMG_UPDATE_TIME', UNIX_TIMESTAMP(), NOW(), NOW()); + + + +INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES +(36, 1, 'IN', NOW()),(36, 2, 'FA', NOW()),(36, 3, 'CU', NOW()),(36, 4, 'FA', NOW()),(36, 5, 'FA', NOW()), +(38, 1, 'DE', NOW()),(38, 2, 'LI', NOW()),(38, 3, 'EN', NOW()),(38, 4, 'LI', NOW()),(38, 5, 'BC', NOW()), +(46, 1, 'a|the|of|on|in|and|to', NOW()),(46, 2, 'le|les|de|et|en|des|les|une', NOW()),(46, 3, 'de|los|las|lo|la|en|de|y|el|a', NOW()),(46, 4, '', NOW()),(46, 5, '', NOW()), +(68, 1, 0, NOW()),(68, 2, 0, NOW()),(68, 3, 0, NOW()),(68, 4, 0, NOW()),(68, 5, 0, NOW()), +(74, 1, 'Dear Customer,\r\n\r\nRegards,\r\nCustomer service', NOW()), +(74, 2, 'Cher client,\r\n\r\nCordialement,\r\nLe service client', NOW()), +(74, 3, 'Estimado cliente,\r\n\r\nUn cordial saludo,\r\nAtención al cliente', NOW()), +(74, 4, 'Lieber Kunde,\r\n\r\nMit freundlichen Grüßen,\r\nIhr Kundenservice', NOW()), +(74, 5, 'Gentile Cliente,\r\n\r\nCordiali saluti,\r\nServizio Clienti', NOW()); + +INSERT INTO `PREFIX_lang` (`id_lang`, `name`, `active`, `iso_code`, `language_code`) VALUES +(1, 'English (English)', 1, 'en', 'en-us'),(2, 'Français (French)', 1, 'fr', 'fr'),(3, 'Español (Spanish)', 1, 'es', 'es'),(4, 'Deutsch (German)', 1, 'de', 'de'),(5, 'Italiano (Italian)', 1, 'it', 'it'); + +INSERT INTO `PREFIX_category` (`id_category`, `id_parent`, `level_depth`, `nleft`, `nright`, `active`, `date_add`, `date_upd`, `position`) VALUES (1, 0, 0, 1, 8, 1, NOW(), NOW(), 0); +INSERT INTO `PREFIX_category_lang` (`id_category`, `id_lang`, `name`, `description`, `link_rewrite`, `meta_title`, `meta_keywords`, `meta_description`) VALUES +(1, 1, 'Home', '', 'home', NULL, NULL, NULL),(1, 2, 'Accueil', '', 'home', NULL, NULL, NULL),(1, 3, 'Inicio', '', 'home', NULL, NULL, NULL),(1, 4, 'Start', '', 'home', NULL, NULL, NULL),(1, 5, 'Home page', '', 'home', NULL, NULL, NULL); + +INSERT INTO `PREFIX_order_state` (`id_order_state`, `invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`) VALUES +(1, 0, 1, 'lightblue', 1, 0, 0),(2, 1, 1, '#DDEEFF', 1, 1, 0),(3, 1, 1, '#FFDD99', 1, 1, 1),(4, 1, 1, '#EEDDFF', 1, 1, 1),(5, 1, 0, '#DDFFAA', 1, 1, 1), +(6, 0, 1, '#DADADA', 1, 0, 0),(7, 1, 1, '#FFFFBB', 1, 0, 0),(8, 0, 1, '#FFDFDF', 1, 0, 0),(9, 1, 1, '#FFD3D3', 1, 0, 0),(10, 0, 1, 'lightblue', 1, 0, 0),(11, 0, 0, 'lightblue', 1, 0, 0); + +INSERT INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) VALUES +(1, 1, 'Awaiting cheque payment', 'cheque'), +(2, 1, 'Payment accepted', 'payment'), +(3, 1, 'Preparation in progress', 'preparation'), +(4, 1, 'Shipped', 'shipped'), +(5, 1, 'Delivered', ''), +(6, 1, 'Canceled', 'order_canceled'), +(7, 1, 'Refund', 'refund'), +(8, 1, 'Payment error', 'payment_error'), +(9, 1, 'On backorder', 'outofstock'), +(10, 1, 'Awaiting bank wire payment', 'bankwire'), +(11, 1, 'Awaiting PayPal payment', ''), +(1, 2, 'En attente du paiement par chèque', 'cheque'), +(2, 2, 'Paiement accepté', 'payment'), +(3, 2, 'Préparation en cours', 'preparation'), +(4, 2, 'En cours de livraison', 'shipped'), +(5, 2, 'Livré', ''), +(6, 2, 'Annulé', 'order_canceled'), +(7, 2, 'Remboursé', 'refund'), +(8, 2, 'Erreur de paiement', 'payment_error'), +(9, 2, 'En attente de réapprovisionnement', 'outofstock'), +(10, 2, 'En attente du paiement par virement bancaire', 'bankwire'), +(11, 2, 'En attente du paiement par PayPal', ''), +(1, 3, 'En espera de pago por cheque', 'cheque'), +(2, 3, 'Pago aceptamos', 'payment'), +(3, 3, 'Preparación en curso', 'preparation'), +(4, 3, 'Enviado', 'shipped'), +(5, 3, 'Entregado', ''), +(6, 3, 'Cancelada', 'order_canceled'), +(7, 3, 'Reembolsado', 'refund'), +(8, 3, 'Error de pago', 'payment_error'), +(9, 3, 'Productos fuera de línea', 'outofstock'), +(10, 3, 'En espera de pago por transferencia bancaria', 'bankwire'), +(11, 3, 'En espera de pago por PayPal', ''), +(1, 4, 'Scheckzahlung wird erwartet', 'cheque'), +(2, 4, 'Zahlung angenommen', 'payment'), +(3, 4, 'Vorbereitung im Gang', 'preparation'), +(4, 4, 'Wird geliefert', 'shipped'), +(5, 4, 'Geliefert', ''), +(6, 4, 'Abgebrochen', 'order_canceled'), +(7, 4, 'Erstattet', 'refund'), +(8, 4, 'Zahlungsfehler', 'payment_error'), +(9, 4, 'Auffüllung im Gang', 'outofstock'), +(10, 4, 'Zahlung durch Banküberweisung wird erwartet', 'bankwire'), +(11, 4, 'Zahlung per PayPal wird erwartet', ''), +(1, 5, 'In attesa di pagamento con assegno', 'cheque'), +(2, 5, 'Pagamento accettato', 'payment'), +(3, 5, 'Preparazione in corso', 'preparation'), +(4, 5, 'Consegna in corso', 'shipped'), +(5, 5, 'Consegnato', ''), +(6, 5, 'Annullato', 'order_canceled'), +(7, 5, 'Rimborsato', 'refund'), +(8, 5, 'Errore di pagamento', 'payment_error'), +(9, 5, 'In attesa di rifornimento', 'outofstock'), +(10, 5, 'In attesa di pagamento con bonifico bancario', 'bankwire'), +(11, 5, 'In attesa di pagamento con PayPal', ''); + +INSERT INTO `PREFIX_zone` (`id_zone`, `name`, `active`) VALUES +(1, 'Europe', 1),(2, 'North America', 1),(3, 'Asia', 1),(4, 'Africa', 1), +(5, 'Oceania', 1),(6, 'South America', 1),(7, 'Europe (out E.U)', 1),(8, 'Centrale America/Antilla', 1); + +INSERT INTO `PREFIX_country` (`id_country`, `id_zone`, `iso_code`, `call_prefix`, `active`, `contains_states`, `need_identification_number`, `need_zip_code`, `zip_code_format`) VALUES +(1, 1, 'DE', 49, 1, 0, 0, 1, 'NNNNN'),(2, 1, 'AT', 43, 1, 0, 0, 1, 'NNNN'),(3, 1, 'BE', 32, 1, 0, 0, 1, 'NNNN'),(4, 2, 'CA', 1, 1, 1, 0, 1, 'LNL NLN'),(5, 3, 'CN', 86, 1, 0, 0, 1, 'NNNNNN'), +(6, 1, 'ES', 34, 1, 0, 1, 1, 'NNNNN'),(7, 1, 'FI', 358, 1, 0, 0, 1, 'NNNNN'),(8, 1, 'FR', 33, 1, 0, 0, 1, 'NNNNN'),(9, 1, 'GR', 30, 1, 0, 0, 1, 'NNNNN'),(10, 1, 'IT', 39, 1, 0, 0, 1, 'NNNNN'), +(11, 3, 'JP', 81, 1, 0, 0, 1, 'NNN-NNNN'),(12, 1, 'LU', 352, 1, 0, 0, 1, 'NNNN'),(13, 1, 'NL', 31, 1, 0, 0, 1, 'NNNN LL'),(14, 1, 'PL', 48, 1, 0, 0, 1, 'NN-NNN'), +(15, 1, 'PT', 351, 1, 0, 0, 1, 'NNNN NNN'),(16, 1, 'CZ', 420, 1, 0, 0, 1, 'NNN NN'),(17, 1, 'GB', 44, 1, 0, 0, 1, ''),(18, 1, 'SE', 46, 1, 0, 0, 1, 'NNN NN'), +(19, 7, 'CH', 41, 1, 0, 0, 1, 'NNNN'),(20, 1, 'DK', 45, 1, 0, 0, 1, 'NNNN'),(21, 2, 'US', 1, 1, 1, 0, 1, 'NNNNN'),(22, 3, 'HK', 852, 1, 0, 0, 0, ''),(23, 1, 'NO', 47, 1, 0, 0, 1, 'NNNN'), +(24, 5, 'AU', 61, 1, 0, 0, 1, 'NNNN'),(25, 3, 'SG', 65, 1, 0, 0, 1, 'NNNNNN'),(26, 1, 'IE', 353, 1, 0, 0, 1, ''),(27, 5, 'NZ', 64, 1, 0, 0, 1, 'NNNN'),(28, 3, 'KR', 82, 1, 0, 0, 1, 'NNN-NNN'), +(29, 3, 'IL', 972, 1, 0, 0, 1, 'NNNNN'),(30, 4, 'ZA', 27, 1, 0, 0, 1, 'NNNN'),(31, 4, 'NG', 234, 1, 0, 0, 1, ''),(32, 4, 'CI', 225, 1, 0, 0, 1, ''),(33, 4, 'TG', 228, 1, 0, 0, 1, ''), +(34, 6, 'BO', 591, 1, 0, 0, 1, ''),(35, 4, 'MU', 230, 1, 0, 0, 1, ''),(36, 1, 'RO', 40, 1, 0, 0, 1, 'NNNNNN'),(37, 1, 'SK', 421, 1, 0, 0, 1, 'NNN NN'),(38, 4, 'DZ', 213, 1, 0, 0, 1, 'NNNNN'), +(39, 2, 'AS', 0, 1, 0, 0, 1, ''),(40, 7, 'AD', 376, 1, 0, 0, 1, 'CNNN'),(41, 4, 'AO', 244, 1, 0, 0, 0, ''),(42, 8, 'AI', 0, 1, 0, 0, 1, ''),(43, 2, 'AG', 0, 1, 0, 0, 1, ''), +(44, 6, 'AR', 54, 1, 1, 0, 1, 'LNNNN'),(45, 3, 'AM', 374, 1, 0, 0, 1, 'NNNN'),(46, 8, 'AW', 297, 1, 0, 0, 1, ''),(47, 3, 'AZ', 994, 1, 0, 0, 1, 'CNNNN'),(48, 2, 'BS', 0, 1, 0, 0, 1, ''), +(49, 3, 'BH', 973, 1, 0, 0, 1, ''),(50, 3, 'BD', 880, 1, 0, 0, 1, 'NNNN'),(51, 2, 'BB', 0, 1, 0, 0, 1, 'CNNNNN'),(52, 7, 'BY', 0, 1, 0, 0, 1, 'NNNNNN'),(53, 8, 'BZ', 501, 1, 0, 0, 0, ''), +(54, 4, 'BJ', 229, 1, 0, 0, 0, ''),(55, 2, 'BM', 0, 1, 0, 0, 1, ''),(56, 3, 'BT', 975, 1, 0, 0, 1, ''),(57, 4, 'BW', 267, 1, 0, 0, 1, ''),(58, 6, 'BR', 55, 1, 0, 0, 1, 'NNNNN-NNN'), +(59, 3, 'BN', 673, 1, 0, 0, 1, 'LLNNNN'),(60, 4, 'BF', 226, 1, 0, 0, 1, ''),(61, 3, 'MM', 95, 1, 0, 0, 1, ''),(62, 4, 'BI', 257, 1, 0, 0, 1, ''),(63, 3, 'KH', 855, 1, 0, 0, 1, 'NNNNN'), +(64, 4, 'CM', 237, 1, 0, 0, 1, ''),(65, 4, 'CV', 238, 1, 0, 0, 1, 'NNNN'),(66, 4, 'CF', 236, 1, 0, 0, 1, ''),(67, 4, 'TD', 235, 1, 0, 0, 1, ''),(68, 6, 'CL', 56, 1, 0, 0, 1, 'NNN-NNNN'), +(69, 6, 'CO', 57, 1, 0, 0, 1, 'NNNNNN'),(70, 4, 'KM', 269, 1, 0, 0, 1, ''),(71, 4, 'CD', 242, 1, 0, 0, 1, ''),(72, 4, 'CG', 243, 1, 0, 0, 1, ''),(73, 8, 'CR', 506, 1, 0, 0, 1, 'NNNNN'), +(74, 7, 'HR', 385, 1, 0, 0, 1, 'NNNNN'),(75, 8, 'CU', 53, 1, 0, 0, 1, ''),(76, 1, 'CY', 357, 1, 0, 0, 1, 'NNNN'),(77, 4, 'DJ', 253, 1, 0, 0, 1, ''),(78, 8, 'DM', 0, 1, 0, 0, 1, ''), +(79, 8, 'DO', 0, 1, 0, 0, 1, ''),(80, 3, 'TL', 670, 1, 0, 0, 1, ''),(81, 6, 'EC', 593, 1, 0, 0, 1, 'CNNNNNN'),(82, 4, 'EG', 20, 1, 0, 0, 0, ''),(83, 8, 'SV', 503, 1, 0, 0, 1, ''), +(84, 4, 'GQ', 240, 1, 0, 0, 1, ''),(85, 4, 'ER', 291, 1, 0, 0, 1, ''),(86, 1, 'EE', 372, 1, 0, 0, 1, 'NNNNN'),(87, 4, 'ET', 251, 1, 0, 0, 1, ''),(88, 8, 'FK', 0, 1, 0, 0, 1, 'LLLL NLL'), +(89, 7, 'FO', 298, 1, 0, 0, 1, ''),(90, 5, 'FJ', 679, 1, 0, 0, 1, ''),(91, 4, 'GA', 241, 1, 0, 0, 1, ''),(92, 4, 'GM', 220, 1, 0, 0, 1, ''),(93, 3, 'GE', 995, 1, 0, 0, 1, 'NNNN'), +(94, 4, 'GH', 233, 1, 0, 0, 1, ''),(95, 8, 'GD', 0, 1, 0, 0, 1, ''),(96, 7, 'GL', 299, 1, 0, 0, 1, ''),(97, 7, 'GI', 350, 1, 0, 0, 1, ''),(98, 8, 'GP', 590, 1, 0, 0, 1, ''), +(99, 8, 'GU', 0, 1, 0, 0, 1, ''),(100, 8, 'GT', 502, 1, 0, 0, 1, ''),(101, 7, 'GG', 0, 1, 0, 0, 1, 'LLN NLL'),(102, 4, 'GN', 224, 1, 0, 0, 1, ''),(103, 4, 'GW', 245, 1, 0, 0, 1, ''), +(104, 6, 'GY', 592, 1, 0, 0, 1, ''),(105, 8, 'HT', 509, 1, 0, 0, 1, ''),(106, 5, 'HM', 0, 1, 0, 0, 1, ''),(107, 7, 'VA', 379, 1, 0, 0, 1, 'NNNNN'),(108, 8, 'HN', 504, 1, 0, 0, 1, ''), +(109, 7, 'IS', 354, 1, 0, 0, 1, 'NNN'),(110, 3, 'IN', 91, 1, 0, 0, 1, 'NNN NNN'),(111, 3, 'ID', 62, 1, 0, 0, 1, 'NNNNN'),(112, 3, 'IR', 98, 1, 0, 0, 1, 'NNNNN-NNNNN'), +(113, 3, 'IQ', 964, 1, 0, 0, 1, 'NNNNN'),(114, 7, 'IM', 0, 1, 0, 0, 1, 'CN NLL'),(115, 8, 'JM', 0, 1, 0, 0, 1, ''),(116, 7, 'JE', 0, 1, 0, 0, 1, 'CN NLL'),(117, 3, 'JO', 962, 1, 0, 0, 1, ''), +(118, 3, 'KZ', 7, 1, 0, 0, 1, 'NNNNNN'),(119, 4, 'KE', 254, 1, 0, 0, 1, ''),(120, 7, 'KI', 686, 1, 0, 0, 1, ''),(121, 3, 'KP', 850, 1, 0, 0, 1, ''),(122, 3, 'KW', 965, 1, 0, 0, 1, ''), +(123, 3, 'KG', 996, 1, 0, 0, 1, ''),(124, 3, 'LA', 856, 1, 0, 0, 1, ''),(125, 1, 'LV', 371, 1, 0, 0, 1, 'C-NNNN'),(126, 3, 'LB', 961, 1, 0, 0, 1, ''),(127, 4, 'LS', 266, 1, 0, 0, 1, ''), +(128, 4, 'LR', 231, 1, 0, 0, 1, ''),(129, 4, 'LY', 218, 1, 0, 0, 1, ''),(130, 1, 'LI', 423, 1, 0, 0, 1, 'NNNN'),(131, 1, 'LT', 370, 1, 0, 0, 1, 'NNNNN'),(132, 3, 'MO', 853, 1, 0, 0, 0, ''), +(133, 7, 'MK', 389, 1, 0, 0, 1, ''),(134, 4, 'MG', 261, 1, 0, 0, 1, ''),(135, 4, 'MW', 265, 1, 0, 0, 1, ''),(136, 3, 'MY', 60, 1, 0, 0, 1, 'NNNNN'),(137, 3, 'MV', 960, 1, 0, 0, 1, ''), +(138, 4, 'ML', 223, 1, 0, 0, 1, ''),(139, 1, 'MT', 356, 1, 0, 0, 1, 'LLL NNNN'),(140, 5, 'MH', 692, 1, 0, 0, 1, ''),(141, 8, 'MQ', 596, 1, 0, 0, 1, ''),(142, 4, 'MR', 222, 1, 0, 0, 1, ''), +(143, 1, 'HU', 36, 1, 0, 0, 1, 'NNNN'),(144, 4, 'YT', 262, 1, 0, 0, 1, ''),(145, 2, 'MX', 52, 1, 0, 0, 1, 'NNNNN'),(146, 5, 'FM', 691, 1, 0, 0, 1, ''),(147, 7, 'MD', 373, 1, 0, 0, 1, 'C-NNNN'), +(148, 7, 'MC', 377, 1, 0, 0, 1, '980NN'),(149, 3, 'MN', 976, 1, 0, 0, 1, ''),(150, 7, 'ME', 382, 1, 0, 0, 1, 'NNNNN'),(151, 8, 'MS', 0, 1, 0, 0, 1, ''),(152, 4, 'MA', 212, 1, 0, 0, 1, 'NNNNN'), +(153, 4, 'MZ', 258, 1, 0, 0, 1, ''),(154, 4, 'NA', 264, 1, 0, 0, 1, ''),(155, 5, 'NR', 674, 1, 0, 0, 1, ''),(156, 3, 'NP', 977, 1, 0, 0, 1, ''),(157, 8, 'AN', 599, 1, 0, 0, 1, ''), +(158, 5, 'NC', 687, 1, 0, 0, 1, ''),(159, 8, 'NI', 505, 1, 0, 0, 1, 'NNNNNN'),(160, 4, 'NE', 227, 1, 0, 0, 1, ''),(161, 5, 'NU', 683, 1, 0, 0, 1, ''),(162, 5, 'NF', 0, 1, 0, 0, 1, ''), +(163, 5, 'MP', 0, 1, 0, 0, 1, ''),(164, 3, 'OM', 968, 1, 0, 0, 1, ''),(165, 3, 'PK', 92, 1, 0, 0, 1, ''),(166, 5, 'PW', 680, 1, 0, 0, 1, ''),(167, 3, 'PS', 0, 1, 0, 0, 1, ''), +(168, 8, 'PA', 507, 1, 0, 0, 1, 'NNNNNN'),(169, 5, 'PG', 675, 1, 0, 0, 1, ''),(170, 6, 'PY', 595, 1, 0, 0, 1, ''),(171, 6, 'PE', 51, 1, 0, 0, 1, ''),(172, 3, 'PH', 63, 1, 0, 0, 1, 'NNNN'), +(173, 5, 'PN', 0, 1, 0, 0, 1, 'LLLL NLL'),(174, 8, 'PR', 0, 1, 0, 0, 1, 'NNNNN'),(175, 3, 'QA', 974, 1, 0, 0, 1, ''),(176, 4, 'RE', 262, 1, 0, 0, 1, ''),(177, 7, 'RU', 7, 1, 0, 0, 1, 'NNNNNN'), +(178, 4, 'RW', 250, 1, 0, 0, 1, ''),(179, 8, 'BL', 0, 1, 0, 0, 1, ''),(180, 8, 'KN', 0, 1, 0, 0, 1, ''),(181, 8, 'LC', 0, 1, 0, 0, 1, ''),(182, 8, 'MF', 0, 1, 0, 0, 1, ''), +(183, 8, 'PM', 508, 1, 0, 0, 1, ''),(184, 8, 'VC', 0, 1, 0, 0, 1, ''),(185, 5, 'WS', 685, 1, 0, 0, 1, ''),(186, 7, 'SM', 378, 1, 0, 0, 1, 'NNNNN'),(187, 4, 'ST', 239, 1, 0, 0, 1, ''), +(188, 3, 'SA', 966, 1, 0, 0, 1, ''),(189, 4, 'SN', 221, 1, 0, 0, 1, ''),(190, 7, 'RS', 381, 1, 0, 0, 1, 'NNNNN'),(191, 4, 'SC', 248, 1, 0, 0, 1, ''),(192, 4, 'SL', 232, 1, 0, 0, 1, ''), +(193, 1, 'SI', 386, 1, 0, 0, 1, 'C-NNNN'),(194, 5, 'SB', 677, 1, 0, 0, 1, ''),(195, 4, 'SO', 252, 1, 0, 0, 1, ''),(196, 8, 'GS', 0, 1, 0, 0, 1, 'LLLL NLL'),(197, 3, 'LK', 94, 1, 0, 0, 1, 'NNNNN'), +(198, 4, 'SD', 249, 1, 0, 0, 1, ''),(199, 8, 'SR', 597, 1, 0, 0, 1, ''),(200, 7, 'SJ', 0, 1, 0, 0, 1, ''),(201, 4, 'SZ', 268, 1, 0, 0, 1, ''),(202, 3, 'SY', 963, 1, 0, 0, 1, ''), +(203, 3, 'TW', 886, 1, 0, 0, 1, 'NNNNN'),(204, 3, 'TJ', 992, 1, 0, 0, 1, ''),(205, 4, 'TZ', 255, 1, 0, 0, 1, ''),(206, 3, 'TH', 66, 1, 0, 0, 1, 'NNNNN'),(207, 5, 'TK', 690, 1, 0, 0, 1, ''), +(208, 5, 'TO', 676, 1, 0, 0, 1, ''),(209, 6, 'TT', 0, 1, 0, 0, 1, ''),(210, 4, 'TN', 216, 1, 0, 0, 1, ''),(211, 7, 'TR', 90, 1, 0, 0, 1, 'NNNNN'),(212, 3, 'TM', 993, 1, 0, 0, 1, ''), +(213, 8, 'TC', 0, 1, 0, 0, 1, 'LLLL NLL'),(214, 5, 'TV', 688, 1, 0, 0, 1, ''),(215, 4, 'UG', 256, 1, 0, 0, 1, ''),(216, 1, 'UA', 380, 1, 0, 0, 1, 'NNNNN'),(217, 3, 'AE', 971, 1, 0, 0, 1, ''), +(218, 6, 'UY', 598, 1, 0, 0, 1, ''),(219, 3, 'UZ', 998, 1, 0, 0, 1, ''),(220, 5, 'VU', 678, 1, 0, 0, 1, ''),(221, 6, 'VE', 58, 1, 0, 0, 1, ''),(222, 3, 'VN', 84, 1, 0, 0, 1, 'NNNNNN'), +(223, 2, 'VG', 0, 1, 0, 0, 1, 'CNNNN'),(224, 2, 'VI', 0, 1, 0, 0, 1, ''),(225, 5, 'WF', 681, 1, 0, 0, 1, ''),(226, 4, 'EH', 0, 1, 0, 0, 1, ''),(227, 3, 'YE', 967, 1, 0, 0, 1, ''), +(228, 4, 'ZM', 260, 1, 0, 0, 1, ''),(229, 4, 'ZW', 263, 1, 0, 0, 1, ''),(230, 7, 'AL', 355, 1, 0, 0, 1, 'NNNN'),(231, 3, 'AF', 93, 1, 0, 0, 0, ''),(232, 5, 'AQ', 0, 1, 0, 0, 1, ''), +(233, 1, 'BA', 387, 1, 0, 0, 1, ''),(234, 5, 'BV', 0, 1, 0, 0, 1, ''),(235, 5, 'IO', 0, 1, 0, 0, 1, 'LLLL NLL'),(236, 1, 'BG', 359, 1, 0, 0, 1, 'NNNN'),(237, 8, 'KY', 0, 1, 0, 0, 1, ''), +(238, 3, 'CX', 0, 1, 0, 0, 1, ''),(239, 3, 'CC', 0, 1, 0, 0, 1, ''),(240, 5, 'CK', 682, 1, 0, 0, 1, ''),(241, 6, 'GF', 594, 1, 0, 0, 1, ''),(242, 5, 'PF', 689, 1, 0, 0, 1, ''), +(243, 5, 'TF', 0, 1, 0, 0, 1, ''),(244, 7, 'AX', 0, 1, 0, 0, 1, 'NNNNN'); + +INSERT INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`) VALUES +(1, 1, 'Germany'),(1, 2, 'Allemagne'),(1, 3, 'Alemania'),(2, 1, 'Austria'),(2, 2, 'Autriche'),(2, 3, 'Austria'), +(3, 1, 'Belgium'),(3, 2, 'Belgique'),(3, 3, 'Bélgica'),(4, 1, 'Canada'),(4, 2, 'Canada'),(4, 3, 'Canadá'),(5, 1, 'China'), +(5, 2, 'Chine'),(5, 3, 'Porcelana'),(6, 1, 'Spain'),(6, 2, 'Espagne'),(6, 3, 'España'),(7, 1, 'Finland'),(7, 2, 'Finlande'), +(7, 3, 'Finlandia'),(8, 1, 'France'),(8, 2, 'France'),(8, 3, 'Francia'),(9, 1, 'Greece'),(9, 2, 'Grèce'),(9, 3, 'Grecia'), +(10, 1, 'Italy'),(10, 2, 'Italie'),(10, 3, 'Italia'),(11, 1, 'Japan'),(11, 2, 'Japon'),(11, 3, 'Japón'), +(12, 1, 'Luxemburg'),(12, 2, 'Luxembourg'),(12, 3, 'Luxemburgo'),(13, 1, 'Netherlands'),(13, 2, 'Pays-bas'),(13, 3, 'Países Bajos'), +(14, 1, 'Poland'),(14, 2, 'Pologne'),(14, 3, 'Polonia'),(15, 1, 'Portugal'),(15, 2, 'Portugal'),(15, 3, 'Portugal'), +(16, 1, 'Czech Republic'),(16, 2, 'République Tchèque'),(16, 3, 'República Checa'),(17, 1, 'United Kingdom'),(17, 2, 'Royaume-Uni'),(17, 3, 'Reino Unido'), +(18, 1, 'Sweden'),(18, 2, 'Suède'),(18, 3, 'Suecia'),(19, 1, 'Switzerland'),(19, 2, 'Suisse'),(19, 3, 'Suiza'),(20, 1, 'Denmark'), +(20, 2, 'Danemark'),(20, 3, 'Dinamarca'),(21, 1, 'USA'),(21, 2, 'États-Unis'),(21, 3, 'EE.UU.'),(22, 1, 'HongKong'),(22, 2, 'Hong-Kong'), +(22, 3, 'Hong Kong'),(23, 1, 'Norway'),(23, 2, 'Norvège'),(23, 3, 'Noruega'),(24, 1, 'Australia'),(24, 2, 'Australie'),(24, 3, 'Australia'), +(25, 1, 'Singapore'),(25, 2, 'Singapour'),(25, 3, 'Singapur'),(26, 1, 'Ireland'),(26, 2, 'Eire'),(26, 3, 'Irlanda'),(27, 1, 'New Zealand'), +(27, 2, 'Nouvelle-Zélande'),(27, 3, 'Nueva Zelanda'),(28, 1, 'South Korea'),(28, 2, 'Corée du Sud'),(28, 3, 'Corea del Sur'),(29, 1, 'Israel'), +(29, 2, 'Israël'),(29, 3, 'Israel'),(30, 1, 'South Africa'),(30, 2, 'Afrique du Sud'),(30, 3, 'Sudáfrica'),(31, 1, 'Nigeria'),(31, 2, 'Nigeria'), +(31, 3, 'Nigeria'),(32, 1, 'Ivory Coast'),(32, 2, 'Côte d''Ivoire'),(32, 3, 'Costa de Marfil'),(33, 1, 'Togo'),(33, 2, 'Togo'),(33, 3, 'Togo'), +(34, 1, 'Bolivia'),(34, 2, 'Bolivie'),(34, 3, 'Bolivia'),(35, 1, 'Mauritius'),(35, 2, 'Ile Maurice'),(35, 3, 'Mauricio'),(36, 1, 'Romania'), +(36, 2, 'Roumanie'),(36, 3, 'Rumania'),(37, 1, 'Slovakia'),(37, 2, 'Slovaquie'),(37, 3, 'Eslovaquia'),(38, 1, 'Algeria'),(38, 2, 'Algérie'), +(38, 3, 'Argelia'),(39, 1, 'American Samoa'),(39, 2, 'Samoa Américaines'),(39, 3, 'Samoa Americana'),(40, 1, 'Andorra'),(40, 2, 'Andorre'),(40, 3, 'Andorra'), +(41, 1, 'Angola'),(41, 2, 'Angola'),(41, 3, 'Angola'),(42, 1, 'Anguilla'),(42, 2, 'Anguilla'),(42, 3, 'Anguila'),(43, 1, 'Antigua and Barbuda'), +(43, 2, 'Antigua et Barbuda'),(43, 3, 'Antigua y Barbuda'),(44, 1, 'Argentina'),(44, 2, 'Argentine'),(44, 3, 'Argentina'),(45, 1, 'Armenia'), +(45, 2, 'Arménie'),(45, 3, 'Armenia'),(46, 1, 'Aruba'),(46, 2, 'Aruba'),(46, 3, 'Aruba'),(47, 1, 'Azerbaijan'),(47, 2, 'Azerbaïdjan'),(47, 3, 'Azerbaiyán'), +(48, 1, 'Bahamas'),(48, 2, 'Bahamas'),(48, 3, 'Bahamas'),(49, 1, 'Bahrain'),(49, 2, 'Bahreïn'),(49, 3, 'Bahrein'),(50, 1, 'Bangladesh'), +(50, 2, 'Bangladesh'),(50, 3, 'Bangladesh'),(51, 1, 'Barbados'),(51, 2, 'Barbade'),(51, 3, 'Barbados'),(52, 1, 'Belarus'),(52, 2, 'Bélarus'), +(52, 3, 'Belarús'),(53, 1, 'Belize'),(53, 2, 'Belize'),(53, 3, 'Belice'),(54, 1, 'Benin'),(54, 2, 'Bénin'),(54, 3, 'Benin'),(55, 1, 'Bermuda'), +(55, 2, 'Bermudes'),(55, 3, 'Bermudas'),(56, 1, 'Bhutan'),(56, 2, 'Bhoutan'),(56, 3, 'Bhután'),(57, 1, 'Botswana'),(57, 2, 'Botswana'),(57, 3, 'Botswana'), +(58, 1, 'Brazil'),(58, 2, 'Brésil'),(58, 3, 'Brasil'),(59, 1, 'Brunei'),(59, 2, 'Brunéi Darussalam'),(59, 3, 'Brunei'),(60, 1, 'Burkina Faso'), +(60, 2, 'Burkina Faso'),(60, 3, 'Burkina Faso'),(61, 1, 'Burma (Myanmar)'),(61, 2, 'Burma (Myanmar)'),(61, 3, 'Birmania (Myanmar)'),(62, 1, 'Burundi'),(62, 2, 'Burundi'), +(62, 3, 'Burundi'),(63, 1, 'Cambodia'),(63, 2, 'Cambodge'),(63, 3, 'Camboya'),(64, 1, 'Cameroon'),(64, 2, 'Cameroun'),(64, 3, 'Camerún'),(65, 1, 'Cape Verde'),(65, 2, 'Cap-Vert'), +(65, 3, 'Cabo Verde'),(66, 1, 'Central African Republic'),(66, 2, 'Centrafricaine, République'),(66, 3, 'República Centroafricana'),(67, 1, 'Chad'),(67, 2, 'Tchad'),(67, 3, 'Chad'), +(68, 1, 'Chile'),(68, 2, 'Chili'),(68, 3, 'Chile'),(69, 1, 'Colombia'),(69, 2, 'Colombie'),(69, 3, 'Colombia'),(70, 1, 'Comoros'),(70, 2, 'Comores'), +(70, 3, 'Comoras'),(71, 1, 'Congo, Dem. Republic'),(71, 2, 'Congo, Rép. Dém.'),(71, 3, 'Congo, Rep. Dem.'),(72, 1, 'Congo, Republic'),(72, 2, 'Congo, Rép.'),(72, 3, 'Congo, República'), +(73, 1, 'Costa Rica'),(73, 2, 'Costa Rica'),(73, 3, 'Costa Rica'),(74, 1, 'Croatia'),(74, 2, 'Croatie'),(74, 3, 'Croacia'),(75, 1, 'Cuba'), +(75, 2, 'Cuba'),(75, 3, 'Cuba'),(76, 1, 'Cyprus'),(76, 2, 'Chypre'),(76, 3, 'Chipre'),(77, 1, 'Djibouti'),(77, 2, 'Djibouti'),(77, 3, 'Djibouti'),(78, 1, 'Dominica'), +(78, 2, 'Dominica'),(78, 3, 'Dominica'),(79, 1, 'Dominican Republic'),(79, 2, 'République Dominicaine'),(79, 3, 'República Dominicana'),(80, 1, 'East Timor'),(80, 2, 'Timor oriental'), +(80, 3, 'Timor Oriental'),(81, 1, 'Ecuador'),(81, 2, 'Équateur'),(81, 3, 'Ecuador'),(82, 1, 'Egypt'),(82, 2, 'Égypte'),(82, 3, 'Egipto'),(83, 1, 'El Salvador'), +(83, 2, 'El Salvador'),(83, 3, 'El Salvador'),(84, 1, 'Equatorial Guinea'),(84, 2, 'Guinée Équatoriale'),(84, 3, 'Guinea Ecuatorial'),(85, 1, 'Eritrea'), +(85, 2, 'Érythrée'),(85, 3, 'Eritrea'),(86, 1, 'Estonia'),(86, 2, 'Estonie'),(86, 3, 'Estonia'),(87, 1, 'Ethiopia'),(87, 2, 'Éthiopie'),(87, 3, 'Etiopía'), +(88, 1, 'Falkland Islands'),(88, 2, 'Falkland, Îles'),(88, 3, 'Islas Malvinas'),(89, 1, 'Faroe Islands'),(89, 2, 'Féroé, Îles'),(89, 3, 'Islas Feroe'),(90, 1, 'Fiji'),(90, 2, 'Fidji'), +(90, 3, 'Fiji'),(91, 1, 'Gabon'),(91, 2, 'Gabon'),(91, 3, 'Gabón'),(92, 1, 'Gambia'),(92, 2, 'Gambie'),(92, 3, 'Gambia'),(93, 1, 'Georgia'), +(93, 2, 'Géorgie'),(93, 3, 'Georgia'),(94, 1, 'Ghana'),(94, 2, 'Ghana'),(94, 3, 'Ghana'),(95, 1, 'Grenada'),(95, 2, 'Grenade'),(95, 3, 'Granada'), +(96, 1, 'Greenland'),(96, 2, 'Groenland'),(96, 3, 'Groenlandia'),(97, 1, 'Gibraltar'),(97, 2, 'Gibraltar'),(97, 3, 'Gibraltar'),(98, 1, 'Guadeloupe'),(98, 2, 'Guadeloupe'), +(98, 3, 'Guadalupe'),(99, 1, 'Guam'),(99, 2, 'Guam'),(99, 3, 'Guam'),(100, 1, 'Guatemala'),(100, 2, 'Guatemala'),(100, 3, 'Guatemala'),(101, 1, 'Guernsey'), +(101, 2, 'Guernesey'),(101, 3, 'Guernsey'),(102, 1, 'Guinea'),(102, 2, 'Guinée'),(102, 3, 'Guinea'),(103, 1, 'Guinea-Bissau'),(103, 2, 'Guinée-Bissau'), +(103, 3, 'Guinea-Bissau'),(104, 1, 'Guyana'),(104, 2, 'Guyana'),(104, 3, 'Guyana'),(105, 1, 'Haiti'),(105, 2, 'Haîti'),(105, 3, 'Haití'),(106, 1, 'Heard Island and McDonald Islands'),(106, 2, 'Heard, Île et Mcdonald, Îles'), +(106, 3, 'Islas Heard y McDonald Islas'),(107, 1, 'Vatican City State'),(107, 2, 'Saint-Siege (État de la Cité du Vatican)'),(107, 3, 'Ciudad del Vaticano'),(108, 1, 'Honduras'),(108, 2, 'Honduras'),(108, 3, 'Honduras'),(109, 1, 'Iceland'), +(109, 2, 'Islande'),(109, 3, 'Islandia'),(110, 1, 'India'),(110, 2, 'Inde'),(110, 3, 'India'),(111, 1, 'Indonesia'),(111, 2, 'Indonésie'), +(111, 3, 'Indonesia'),(112, 1, 'Iran'),(112, 2, 'Iran'),(112, 3, 'Irán'),(113, 1, 'Iraq'),(113, 2, 'Iraq'),(113, 3, 'Iraq'),(114, 1, 'Man Island'), +(114, 2, 'Man, Île de'),(114, 3, 'Man, Isla'),(115, 1, 'Jamaica'),(115, 2, 'Jamaique'),(115, 3, 'Jamaica'),(116, 1, 'Jersey'),(116, 2, 'Jersey'), +(116, 3, 'Jersey'),(117, 1, 'Jordan'),(117, 2, 'Jordanie'),(117, 3, 'Jordania'),(118, 1, 'Kazakhstan'),(118, 2, 'Kazakhstan'),(118, 3, 'Kazajstán'),(119, 1, 'Kenya'), +(119, 2, 'Kenya'),(119, 3, 'Kenya'),(120, 1, 'Kiribati'),(120, 2, 'Kiribati'),(120, 3, 'Kiribati'),(121, 1, 'Korea, Dem. Republic of'),(121, 2, 'Corée, Rép. Populaire Dém. de'),(121, 3, 'KOREA, DEM. República de'), +(122, 1, 'Kuwait'),(122, 2, 'Koweït'),(122, 3, 'Kuwait'),(123, 1, 'Kyrgyzstan'),(123, 2, 'Kirghizistan'),(123, 3, 'Kirguistán'),(124, 1, 'Laos'),(124, 2, 'Laos'), +(124, 3, 'Laos'),(125, 1, 'Latvia'),(125, 2, 'Lettonie'),(125, 3, 'Letonia'),(126, 1, 'Lebanon'),(126, 2, 'Liban'),(126, 3, 'Líbano'),(127, 1, 'Lesotho'), +(127, 2, 'Lesotho'),(127, 3, 'Lesotho'),(128, 1, 'Liberia'),(128, 2, 'Libéria'),(128, 3, 'Liberia'),(129, 1, 'Libya'),(129, 2, 'Libyenne, Jamahiriya Arabe'),(129, 3, 'Libia'), +(130, 1, 'Liechtenstein'),(130, 2, 'Liechtenstein'),(130, 3, 'Liechtenstein'),(131, 1, 'Lithuania'),(131, 2, 'Lituanie'),(131, 3, 'Lituania'),(132, 1, 'Macau'), +(132, 2, 'Macao'),(132, 3, 'Macao'),(133, 1, 'Macedonia'),(133, 2, 'Macédoine'),(133, 3, 'Macedonia'),(134, 1, 'Madagascar'),(134, 2, 'Madagascar'), +(134, 3, 'Madagascar'),(135, 1, 'Malawi'),(135, 2, 'Malawi'),(135, 3, 'Malawi'),(136, 1, 'Malaysia'),(136, 2, 'Malaisie'),(136, 3, 'Malasia'), +(137, 1, 'Maldives'),(137, 2, 'Maldives'),(137, 3, 'Maldivas'),(138, 1, 'Mali'),(138, 2, 'Mali'),(138, 3, 'Malí'),(139, 1, 'Malta'),(139, 2, 'Malte'), +(139, 3, 'Malta'),(140, 1, 'Marshall Islands'),(140, 2, 'Marshall, Îles'),(140, 3, 'Marshall, Islas'),(141, 1, 'Martinique'),(141, 2, 'Martinique'), +(141, 3, 'Martinica'),(142, 1, 'Mauritania'),(142, 2, 'Mauritanie'),(142, 3, 'Mauritania'),(143, 1, 'Hungary'),(143, 2, 'Hongrie'),(143, 3, 'Hungría'), +(144, 1, 'Mayotte'),(144, 2, 'Mayotte'),(144, 3, 'Mayotte'),(145, 1, 'Mexico'),(145, 2, 'Mexique'),(145, 3, 'México'),(146, 1, 'Micronesia'),(146, 2, 'Micronésie'), +(146, 3, 'Micronesia'),(147, 1, 'Moldova'),(147, 2, 'Moldova'),(147, 3, 'Moldavia'),(148, 1, 'Monaco'),(148, 2, 'Monaco'),(148, 3, 'Mónaco'), +(149, 1, 'Mongolia'),(149, 2, 'Mongolie'),(149, 3, 'Mongolia'),(150, 1, 'Montenegro'),(150, 2, 'Monténégro'),(150, 3, 'Montenegro'),(151, 1, 'Montserrat'), +(151, 2, 'Montserrat'),(151, 3, 'Montserrat'),(152, 1, 'Morocco'),(152, 2, 'Maroc'),(152, 3, 'Marruecos'),(153, 1, 'Mozambique'),(153, 2, 'Mozambique'),(153, 3, 'Mozambique'), +(154, 1, 'Namibia'),(154, 2, 'Namibie'),(154, 3, 'Namibia'),(155, 1, 'Nauru'),(155, 2, 'Nauru'),(155, 3, 'Nauru'),(156, 1, 'Nepal'),(156, 2, 'Népal'), +(156, 3, 'Nepal'),(157, 1, 'Netherlands Antilles'),(157, 2, 'Antilles Néerlandaises'),(157, 3, 'Antillas Neerlandesas'),(158, 1, 'New Caledonia'),(158, 2, 'Nouvelle-Calédonie'),(158, 3, 'Nueva Caledonia'), +(159, 1, 'Nicaragua'),(159, 2, 'Nicaragua'),(159, 3, 'Nicaragua'),(160, 1, 'Niger'),(160, 2, 'Niger'),(160, 3, 'Níger'),(161, 1, 'Niue'), +(161, 2, 'Niué'),(161, 3, 'Niue'),(162, 1, 'Norfolk Island'),(162, 2, 'Norfolk, Île'),(162, 3, 'Norfolk Island'),(163, 1, 'Northern Mariana Islands'),(163, 2, 'Mariannes du Nord, Îles'), +(163, 3, 'Islas Marianas del Norte'),(164, 1, 'Oman'),(164, 2, 'Oman'),(164, 3, 'Omán'),(165, 1, 'Pakistan'),(165, 2, 'Pakistan'),(165, 3, 'Pakistán'), +(166, 1, 'Palau'),(166, 2, 'Palaos'),(166, 3, 'Palau'),(167, 1, 'Palestinian Territories'),(167, 2, 'Palestinien Occupé, Territoire'),(167, 3, 'Territorios Palestinos'),(168, 1, 'Panama'), +(168, 2, 'Panama'),(168, 3, 'Panamá'),(169, 1, 'Papua New Guinea'),(169, 2, 'Papouasie-Nouvelle-Guinée'),(169, 3, 'Papua Nueva Guinea'),(170, 1, 'Paraguay'),(170, 2, 'Paraguay'), +(170, 3, 'Paraguay'),(171, 1, 'Peru'),(171, 2, 'Pérou'),(171, 3, 'Perú'),(172, 1, 'Philippines'),(172, 2, 'Philippines'),(172, 3, 'Filipinas'),(173, 1, 'Pitcairn'), +(173, 2, 'Pitcairn'),(173, 3, 'Pitcairn'),(174, 1, 'Puerto Rico'),(174, 2, 'Porto Rico'),(174, 3, 'Puerto Rico'),(175, 1, 'Qatar'),(175, 2, 'Qatar'),(175, 3, 'Qatar'), +(176, 1, 'Reunion Island'),(176, 2, 'Réunion, Île de la'),(176, 3, 'Reunión, Isla de la'),(177, 1, 'Russian Federation'),(177, 2, 'Russie, Fédération de'),(177, 3, 'Rusia, Federación de'),(178, 1, 'Rwanda'), +(178, 2, 'Rwanda'),(178, 3, 'Rwanda'),(179, 1, 'Saint Barthelemy'),(179, 2, 'Saint-Barthélemy'),(179, 3, 'San Bartolomé'),(180, 1, 'Saint Kitts and Nevis'),(180, 2, 'Saint-Kitts-et-Nevis'), +(180, 3, 'Saint Kitts y Nevis'),(181, 1, 'Saint Lucia'),(181, 2, 'Sainte-Lucie'),(181, 3, 'Santa Lucía'),(182, 1, 'Saint Martin'),(182, 2, 'Saint-Martin'),(182, 3, 'Saint Martin'), +(183, 1, 'Saint Pierre and Miquelon'),(183, 2, 'Saint-Pierre-et-Miquelon'),(183, 3, 'San Pedro y Miquelón'),(184, 1, 'Saint Vincent and the Grenadines'),(184, 2, 'Saint-Vincent-et-Les Grenadines'),(184, 3, 'San Vicente y las Granadinas'),(185, 1, 'Samoa'), +(185, 2, 'Samoa'),(185, 3, 'Samoa'),(186, 1, 'San Marino'),(186, 2, 'Saint-Marin'),(186, 3, 'San Marino'),(187, 1, 'São Tomé and Príncipe'),(187, 2, 'Sao Tomé-et-Principe'),(187, 3, 'Santo Tomé y Príncipe'), +(188, 1, 'Saudi Arabia'),(188, 2, 'Arabie Saoudite'),(188, 3, 'Arabia Saudita'),(189, 1, 'Senegal'),(189, 2, 'Sénégal'),(189, 3, 'Senegal'),(190, 1, 'Serbia'), +(190, 2, 'Serbie'),(190, 3, 'Serbia'),(191, 1, 'Seychelles'),(191, 2, 'Seychelles'),(191, 3, 'Seychelles'),(192, 1, 'Sierra Leone'),(192, 2, 'Sierra Leone'), +(192, 3, 'Sierra Leona'),(193, 1, 'Slovenia'),(193, 2, 'Slovénie'),(193, 3, 'Eslovenia'),(194, 1, 'Solomon Islands'),(194, 2, 'Salomon, Îles'),(194, 3, 'Salomón, Islas'),(195, 1, 'Somalia'), +(195, 2, 'Somalie'),(195, 3, 'Somalia'),(196, 1, 'South Georgia and the South Sandwich Islands'),(196, 2, 'Géorgie du Sud et les Îles Sandwich du Sud'),(196, 3, 'Georgia del Sur e Islas Sandwich del Sur'),(197, 1, 'Sri Lanka'),(197, 2, 'Sri Lanka'), +(197, 3, 'Sri Lanka'),(198, 1, 'Sudan'),(198, 2, 'Soudan'),(198, 3, 'Sudán'),(199, 1, 'Suriname'),(199, 2, 'Suriname'),(199, 3, 'Suriname'),(200, 1, 'Svalbard and Jan Mayen'), +(200, 2, 'Svalbard et Île Jan Mayen'),(200, 3, 'Svalbard y Jan Mayen'),(201, 1, 'Swaziland'),(201, 2, 'Swaziland'),(201, 3, 'Swazilandia'),(202, 1, 'Syria'),(202, 2, 'Syrienne'), +(202, 3, 'Siria'),(203, 1, 'Taiwan'),(203, 2, 'Taïwan'),(203, 3, 'Taiwán'),(204, 1, 'Tajikistan'),(204, 2, 'Tadjikistan'),(204, 3, 'Tayikistán'), +(205, 1, 'Tanzania'),(205, 2, 'Tanzanie'),(205, 3, 'Tanzania'),(206, 1, 'Thailand'),(206, 2, 'Thaïlande'),(206, 3, 'Tailandia'),(207, 1, 'Tokelau'), +(207, 2, 'Tokelau'),(207, 3, 'Tokelau'),(208, 1, 'Tonga'),(208, 2, 'Tonga'),(208, 3, 'Tonga'),(209, 1, 'Trinidad and Tobago'),(209, 2, 'Trinité-et-Tobago'),(209, 3, 'Trinidad y Tobago'), +(210, 1, 'Tunisia'),(210, 2, 'Tunisie'),(210, 3, 'Túnez'),(211, 1, 'Turkey'),(211, 2, 'Turquie'),(211, 3, 'Turquía'),(212, 1, 'Turkmenistan'),(212, 2, 'Turkménistan'), +(212, 3, 'Turkmenistán'),(213, 1, 'Turks and Caicos Islands'),(213, 2, 'Turks et Caiques, Îles'),(213, 3, 'Islas Turcas y Caicos'),(214, 1, 'Tuvalu'),(214, 2, 'Tuvalu'),(214, 3, 'Tuvalu'), +(215, 1, 'Uganda'),(215, 2, 'Ouganda'),(215, 3, 'Uganda'),(216, 1, 'Ukraine'),(216, 2, 'Ukraine'),(216, 3, 'Ucrania'),(217, 1, 'United Arab Emirates'), +(217, 2, 'Émirats Arabes Unis'),(217, 3, 'Emiratos Árabes Unidos'),(218, 1, 'Uruguay'),(218, 2, 'Uruguay'),(218, 3, 'Uruguay'),(219, 1, 'Uzbekistan'),(219, 2, 'Ouzbékistan'), +(219, 3, 'Uzbekistán'),(220, 1, 'Vanuatu'),(220, 2, 'Vanuatu'),(220, 3, 'Vanuatu'),(221, 1, 'Venezuela'),(221, 2, 'Venezuela'),(221, 3, 'Venezuela'), +(222, 1, 'Vietnam'),(222, 2, 'Vietnam'),(222, 3, 'Vietnam'),(223, 1, 'Virgin Islands (British)'),(223, 2, 'Îles Vierges Britanniques'),(223, 3, 'Islas Vírgenes (Británicas)'),(224, 1, 'Virgin Islands (U.S.)'), +(224, 2, 'Îles Vierges des États-Unis'),(224, 3, 'Islas Vírgenes (EE.UU.)'),(225, 1, 'Wallis and Futuna'),(225, 2, 'Wallis et Futuna'),(225, 3, 'Wallis y Futuna'),(226, 1, 'Western Sahara'),(226, 2, 'Sahara Occidental'), +(226, 3, 'Sáhara Occidental'),(227, 1, 'Yemen'),(227, 2, 'Yémen'),(227, 3, 'Yemen'),(228, 1, 'Zambia'),(228, 2, 'Zambie'),(228, 3, 'Zambia'),(229, 1, 'Zimbabwe'), +(229, 2, 'Zimbabwe'),(229, 3, 'Zimbabwe'),(230, 1, 'Albania'),(230, 2, 'Albanie'),(230, 3, 'Albania'),(231, 1, 'Afghanistan'),(231, 2, 'Afghanistan'),(231, 3, 'Afganistán'), +(232, 1, 'Antarctica'),(232, 2, 'Antarctique'),(232, 3, 'Antártida'),(233, 1, 'Bosnia and Herzegovina'),(233, 2, 'Bosnie-Herzégovine'),(233, 3, 'Bosnia y Herzegovina'),(234, 1, 'Bouvet Island'), +(234, 2, 'Bouvet, Île'),(234, 3, 'Isla Bouvet'),(235, 1, 'British Indian Ocean Territory'),(235, 2, 'Océan Indien, Territoire Britannique de L'''),(235, 3, 'British Indian Ocean Territory'),(236, 1, 'Bulgaria'),(236, 2, 'Bulgarie'), +(236, 3, 'Bulgaria'),(237, 1, 'Cayman Islands'),(237, 2, 'Caïmans, Îles'),(237, 3, 'Caimán, Islas'),(238, 1, 'Christmas Island'),(238, 2, 'Christmas, Île'),(238, 3, 'Navidad, Isla de'), +(239, 1, 'Cocos (Keeling) Islands'),(239, 2, 'Cocos (Keeling), Îles'),(239, 3, 'Cocos (Keeling), Islas'),(240, 1, 'Cook Islands'),(240, 2, 'Cook, Îles'),(240, 3, 'Cook, Islas'), +(241, 1, 'French Guiana'),(241, 2, 'Guyane Française'),(241, 3, 'Francés Guayana'),(242, 1, 'French Polynesia'),(242, 2, 'Polynésie Française'),(242, 3, 'Polinesia francés'),(243, 1, 'French Southern Territories'), +(243, 2, 'Terres Australes Françaises'),(243, 3, 'Territorios del sur francés'),(244, 1, 'Åland Islands'),(244, 2, 'Åland, Îles'),(244, 3, 'Islas Åland'); + +INSERT IGNORE INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`) + (SELECT `id_country`, id_lang, (SELECT tl.`name` + FROM `PREFIX_country_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_country`=`PREFIX_country`.`id_country`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_country`); + +INSERT INTO `PREFIX_state` (`id_state`, `id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES +(1, 21, 2, 'Alabama', 'AL', 1),(2, 21, 2, 'Alaska', 'AK', 1),(3, 21, 2, 'Arizona', 'AZ', 1),(4, 21, 2, 'Arkansas', 'AR', 1), +(5, 21, 2, 'California', 'CA', 1),(6, 21, 2, 'Colorado', 'CO', 1),(7, 21, 2, 'Connecticut', 'CT', 1),(8, 21, 2, 'Delaware', 'DE', 1), +(9, 21, 2, 'Florida', 'FL', 1),(10, 21, 2, 'Georgia', 'GA', 1),(11, 21, 2, 'Hawaii', 'HI', 1),(12, 21, 2, 'Idaho', 'ID', 1), +(13, 21, 2, 'Illinois', 'IL', 1),(14, 21, 2, 'Indiana', 'IN', 1),(15, 21, 2, 'Iowa', 'IA', 1),(16, 21, 2, 'Kansas', 'KS', 1), +(17, 21, 2, 'Kentucky', 'KY', 1),(18, 21, 2, 'Louisiana', 'LA', 1),(19, 21, 2, 'Maine', 'ME', 1),(20, 21, 2, 'Maryland', 'MD', 1), +(21, 21, 2, 'Massachusetts', 'MA', 1),(22, 21, 2, 'Michigan', 'MI', 1),(23, 21, 2, 'Minnesota', 'MN', 1), +(24, 21, 2, 'Mississippi', 'MS', 1),(25, 21, 2, 'Missouri', 'MO', 1),(26, 21, 2, 'Montana', 'MT', 1),(27, 21, 2, 'Nebraska', 'NE', 1), +(28, 21, 2, 'Nevada', 'NV', 1),(29, 21, 2, 'New Hampshire', 'NH', 1),(30, 21, 2, 'New Jersey', 'NJ', 1),(31, 21, 2, 'New Mexico', 'NM', 1), +(32, 21, 2, 'New York', 'NY', 1),(33, 21, 2, 'North Carolina', 'NC', 1),(34, 21, 2, 'North Dakota', 'ND', 1),(35, 21, 2, 'Ohio', 'OH', 1), +(36, 21, 2, 'Oklahoma', 'OK', 1),(37, 21, 2, 'Oregon', 'OR', 1),(38, 21, 2, 'Pennsylvania', 'PA', 1),(39, 21, 2, 'Rhode Island', 'RI', 1), +(40, 21, 2, 'South Carolina', 'SC', 1),(41, 21, 2, 'South Dakota', 'SD', 1),(42, 21, 2, 'Tennessee', 'TN', 1),(43, 21, 2, 'Texas', 'TX', 1), +(44, 21, 2, 'Utah', 'UT', 1),(45, 21, 2, 'Vermont', 'VT', 1),(46, 21, 2, 'Virginia', 'VA', 1),(47, 21, 2, 'Washington', 'WA', 1), +(48, 21, 2, 'West Virginia', 'WV', 1),(49, 21, 2, 'Wisconsin', 'WI', 1),(50, 21, 2, 'Wyoming', 'WY', 1),(51, 21, 2, 'Puerto Rico', 'PR', 1), +(52, 21, 2, 'US Virgin Islands', 'VI', 1),(53, 21, 2, 'District of Columbia', 'DC', 1); + +INSERT INTO `PREFIX_state` (`id_country`, `id_zone`, `name`, `iso_code`, `tax_behavior`, `active`) VALUES +(145, 2, 'Aguascalientes', 'AGS', 0, 1), +(145, 2, 'Baja California', 'BCN', 0, 1), +(145, 2, 'Baja California Sur', 'BCS', 0, 1), +(145, 2, 'Campeche', 'CAM', 0, 1), +(145, 2, 'Chiapas', 'CHP', 0, 1), +(145, 2, 'Chihuahua', 'CHH', 0, 1), +(145, 2, 'Coahuila', 'COA', 0, 1), +(145, 2, 'Colima', 'COL', 0, 1), +(145, 2, 'Distrito Federal', 'DIF', 0, 1), +(145, 2, 'Durango', 'DUR', 0, 1), +(145, 2, 'Guanajuato', 'GUA', 0, 1), +(145, 2, 'Guerrero', 'GRO', 0, 1), +(145, 2, 'Hidalgo', 'HID', 0, 1), +(145, 2, 'Jalisco', 'JAL', 0, 1), +(145, 2, 'Estado de México', 'MEX', 0, 1), +(145, 2, 'Michoacán', 'MIC', 0, 1), +(145, 2, 'Morelos', 'MOR', 0, 1), +(145, 2, 'Nayarit', 'NAY', 0, 1), +(145, 2, 'Nuevo León', 'NLE', 0, 1), +(145, 2, 'Oaxaca', 'OAX', 0, 1), +(145, 2, 'Puebla', 'PUE', 0, 1), +(145, 2, 'Querétaro', 'QUE', 0, 1), +(145, 2, 'Quintana Roo', 'ROO', 0, 1), +(145, 2, 'San Luis Potosí', 'SLP', 0, 1), +(145, 2, 'Sinaloa', 'SIN', 0, 1), +(145, 2, 'Sonora', 'SON', 0, 1), +(145, 2, 'Tabasco', 'TAB', 0, 1), +(145, 2, 'Tamaulipas', 'TAM', 0, 1), +(145, 2, 'Tlaxcala', 'TLA', 0, 1), +(145, 2, 'Veracruz', 'VER', 0, 1), +(145, 2, 'Yucatán', 'YUC', 0, 1), +(145, 2, 'Zacatecas', 'ZAC', 0, 1); + +INSERT INTO `PREFIX_state` (`id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES +(4, 2, 'Ontario', 'ON', 1), +(4, 2, 'Quebec', 'QC', 1), +(4, 2, 'British Columbia', 'BC', 1), +(4, 2, 'Alberta', 'AB', 1), +(4, 2, 'Manitoba', 'MB', 1), +(4, 2, 'Saskatchewan', 'SK', 1), +(4, 2, 'Nova Scotia', 'NS', 1), +(4, 2, 'New Brunswick', 'NB', 1), +(4, 2, 'Newfoundland and Labrador', 'NL', 1), +(4, 2, 'Prince Edward Island', 'PE', 1), +(4, 2, 'Northwest Territories', 'NT', 1), +(4, 2, 'Yukon', 'YT', 1), +(4, 2, 'Nunavut', 'NU', 1); + +INSERT INTO `PREFIX_state` (`id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES +(44, 6, 'Buenos Aires', 'B', 1), +(44, 6, 'Catamarca', 'K', 1), +(44, 6, 'Chaco', 'H', 1), +(44, 6, 'Chubut', 'U', 1), +(44, 6, 'Ciudad de Buenos Aires', 'C', 1), +(44, 6, 'Córdoba', 'X', 1), +(44, 6, 'Corrientes', 'W', 1), +(44, 6, 'Entre Ríos', 'E', 1), +(44, 6, 'Formosa', 'P', 1), +(44, 6, 'Jujuy', 'Y', 1), +(44, 6, 'La Pampa', 'L', 1), +(44, 6, 'La Rioja', 'F', 1), +(44, 6, 'Mendoza', 'M', 1), +(44, 6, 'Misiones', 'N', 1), +(44, 6, 'Neuquén', 'Q', 1), +(44, 6, 'Río Negro', 'R', 1), +(44, 6, 'Salta', 'A', 1), +(44, 6, 'San Juan', 'J', 1), +(44, 6, 'San Luis', 'D', 1), +(44, 6, 'Santa Cruz', 'Z', 1), +(44, 6, 'Santa Fe', 'S', 1), +(44, 6, 'Santiago del Estero', 'G', 1), +(44, 6, 'Tierra del Fuego', 'V', 1), +(44, 6, 'Tucumán', 'T', 1); + +INSERT INTO `PREFIX_currency` (`name`, `iso_code`, `iso_code_num`, `sign`, `blank`, `conversion_rate`, `format`, `deleted`, `active`) VALUES +('Euro', 'EUR', '978', '€', 1, 1, 2, 0, 1), ('Dollar', 'USD', '840', '$', 0, 1.32, 1, 0, 1), ('Pound', 'GBP', '826', '£', 0, 0.8, 1, 0, 1); +/*('Yen', 'JPY', '392', '¥', 0, 113.14, 2, 0, 0), +('Lev', 'BGN', '975', 'лв', 1, 1.96, 2, 0, 0), ('Couronne', 'CZK', '203', 'Kč', 1, 24.58, 2, 0, 0), ('Couronne', 'DKK', '208', 'kr', 1, 7.45, 2, 0, 0), +('Couronne', 'EEK', '233', 'kr', 1, 15.65, 2, 0, 0), ('Forint', 'HUF', '348', 'Ft', 1, 279.65, 2, 0, 0), ('Litas', 'LTL', '440', 'Lt', 1, 3.45, 2, 0, 0), +('Lats letton', 'LVL', '428', 'Ls', 1, 0.71, 2, 0, 0), ('Zloty', 'PLN', '985', 'zł', 1, 3.94, 2, 0, 0), ('Leu', 'RON', '946', 'lei', 1, 4.26, 2, 0, 0), +('Couronne', 'SEK', '752', 'kr', 1, 9.13, 2, 0, 0), ('Franc Suisse', 'CHF', '756', 'CHF', 1, 1.32, 2, 0, 0), ('Couronne', 'NOK', '578', 'kr', 1, 7.90, 2, 0, 0), +('Kuna', 'HRK', '191', 'kn', 1, 7.28, 2, 0, 0), ('Rouble', 'RUB', '643', 'руб', 1, 41.46, 2, 0, 0), ('Livre', 'TRY', '949', 'TL', 1, 1.98, 2, 0, 0), +('Australian Dollar', 'AUD', '036', '$', 1, 1.40, 2, 0, 0), ('Réal', 'BRL', '986', 'R$', 1, 2.28, 2, 0, 0), ('Canadian Dollar', 'CAD', '124', '$', 1, 1.37, 2, 0, 0), +('Yuan renminbi', 'CNY', '156', '¥', 1, 8.96, 2, 0, 0), ('Hong Kong Dollar', 'HKD', '344', '$', 1, 10.37, 2, 0, 0), ('Rupiah', 'IDR', '360', 'Rp', 1, 11956.81, 2, 0, 0), +('Rupees', 'INR', '356', 'rupees', 1, 60.93, 2, 0, 0), ('Won', 'KRW', '410', '₩', 1, 1537.58, 2, 0, 0), ('Mexican Peso', 'MXN', '484', '$', 1, 16.96, 2, 0, 0), +('Ringgit', 'MYR', '458', 'RM', 1, 4.13, 2, 0, 0), ('New-Zeland Dollar', 'NZD', '554', '$', 1, 1.81, 2, 0, 0), ('Peso Phillipin', 'PHP', '608', 'Php', 1, 58.61, 2, 0, 0), +('Singapour Dollar', 'SGD', '702', '$', 1, 1.77, 2, 0, 0), ('Baht', 'THB', '764', '฿', 1, 40.96, 2, 0, 0), ('Rand', 'ZAR', '710', 'R', 1, 9.38, 2, 0, 0);*/ + +INSERT INTO `PREFIX_image_type` (`id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes`) VALUES +(1, 'small', 45, 45, 1, 1, 1, 1, 0), +(2, 'medium', 80, 80, 1, 1, 1, 1, 0), +(3, 'large', 300, 300, 1, 1, 1, 1, 0), +(4, 'thickbox', 600, 600, 1, 0, 0, 0, 0), +(5, 'category', 500, 150, 0, 1, 0, 0, 0), +(6, 'home', 129, 129, 1, 0, 0, 0, 0), +(7, 'large_scene', 556, 200, 0, 0, 0, 0, 1), +(8, 'thumb_scene', 161, 58, 0, 0, 0, 0, 1); + +INSERT INTO `PREFIX_contact_lang` (`id_contact`, `id_lang`, `name`, `description`) VALUES +(1, 1, 'Webmaster', 'If a technical problem occurs on this website'), +(1, 2, 'Webmaster', 'Si un problème technique survient sur le site'), +(1, 3, 'Webmaster', 'Si se produce un problema técnico en el sitio'), +(1, 4, 'Webmaster', 'Falls ein technisches Problem auf der Webseite auftritt'), +(1, 5, 'Webmaster', 'Se nel sito interviene un problema tecnico'), +(2, 1, 'Customer service', 'For any question about a product, an order'), +(2, 2, 'Service client', 'Pour toute question ou réclamation sur une commande'), +(2, 3, 'Service client', 'Para cualquier pregunta o queja acerca de un pedido'), +(2, 4, 'Kundenservice', 'Bei Fragen oder Reklamationen zu einer Bestellung'), +(2, 5, 'Servizio clienti', 'Per qualsiasi domanda o reclamo riguardo ad un ordine'); + +INSERT INTO `PREFIX_discount_type` (`id_discount_type`) VALUES (1),(2),(3); +INSERT INTO `PREFIX_discount_type_lang` (`id_discount_type`, `id_lang`, `name`) VALUES +(1, 1, 'Discount on order (%)'),(2, 1, 'Discount on order (amount)'),(3, 1, 'Free shipping'), +(1, 2, 'Réduction sur la commande (%)'),(2, 2, 'Réduction sur la commande (montant)'),(3, 2, 'Frais de port gratuits'), +(1, 3, 'Descuento orden (%)'),(2, 3, 'Descuento (el orden de cantidad)'),(3, 3, 'Gastos de envío gratis'), +(1, 4, 'Preisnachlass auf die Bestellung (%)'),(2, 4, 'Preisnachlass auf die Bestellung (Betrag)'),(3, 4, 'Versandkosten gratis'), +(1, 5, 'Sconto sull’ordine (%)'),(2, 5, 'Sconto sull’ordine (importo)'),(3, 5, 'Spese di porto gratuite'); + +INSERT INTO `PREFIX_profile` (`id_profile`) VALUES (1); +INSERT INTO `PREFIX_profile_lang` (`id_profile`, `id_lang`, `name`) VALUES (1, 1, 'Administrator'),(1, 2, 'Administrateur'),(1, 3, 'Administrador'),(1, 4, 'Administrator'),(1, 5, 'Administrator'); + +INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUES (1, 'AdminCatalog', 0, 1),(2, 'AdminCustomers', 0, 2),(3, 'AdminOrders', 0, 3), +(4, 'AdminPayment', 0, 4),(5, 'AdminShipping', 0, 5),(6, 'AdminStats', 0, 6),(7, 'AdminModules', 0, 7),(29, 'AdminEmployees', 0, 8),(8, 'AdminPreferences', 0, 9), +(9, 'AdminTools', 0, 10),(82, 'AdminStores', 9, 11),(60, 'AdminTracking', 1, 1),(10, 'AdminManufacturers', 1, 2),(34, 'AdminSuppliers', 1, 3),(11, 'AdminAttributesGroups', 1, 4), +(36, 'AdminFeatures', 1, 5),(58, 'AdminScenes', 1, 6),(66, 'AdminTags', 1, 7),(68, 'AdminAttachments', 1, 7),(12, 'AdminAddresses', 2, 1),(63, 'AdminGroups', 2, 2), +(65, 'AdminCarts', 2, 3),(42, 'AdminInvoices', 3, 1),(55, 'AdminDeliverySlip', 3, 2),(47, 'AdminReturn', 3, 3),(49, 'AdminSlip', 3, 4),(59, 'AdminMessages', 3, 5), +(13, 'AdminStatuses', 3, 6),(54, 'AdminOrderMessage', 3, 7),(14, 'AdminDiscounts', 4, 4),(15, 'AdminCurrencies', 4, 1),(16, 'AdminTaxes', 4, 2), +(17, 'AdminCarriers', 5, 1),(46, 'AdminStates', 5, 2),(18, 'AdminCountries', 5, 3),(19, 'AdminZones', 5, 5),(20, 'AdminRangePrice', 5, 6), +(21, 'AdminRangeWeight', 5, 7),(51, 'AdminStatsConf', 6, 1),(61, 'AdminSearchEngines', 6, 2),(62, 'AdminReferrers', 6, 3), +(22, 'AdminModulesPositions', 7, 4),(30, 'AdminProfiles', 29, 1),(31, 'AdminAccess', 29, 2),(28, 'AdminContacts', 29, 3),(39, 'AdminContact', 8, 1), +(38, 'AdminAppearance', 8, 2),(56, 'AdminMeta', 8, 3),(27, 'AdminPPreferences', 8, 4),(24, 'AdminEmails', 8, 5),(26, 'AdminImages', 8, 6),(23, 'AdminDb', 8, 7), +(48, 'AdminPDF', 3, 8),(44, 'AdminLocalization', 8, 9),(67, 'AdminSearchConf', 8, 10),(32, 'AdminLanguages', 9, 1),(33, 'AdminTranslations', 9, 2), +(35, 'AdminTabs', 29, 3),(37, 'AdminQuickAccesses', 9, 4),(40, 'AdminAliases', 8, 5),(41, 'AdminImport', 9, 6),(52, 'AdminSubDomains', 9, 7), +(53, 'AdminBackup', 9, 8),(57, 'AdminCMSContent', 9, 9),(64, 'AdminGenerator', 9, 10),(43, 'AdminSearch', -1, 0),(69, 'AdminInformation', 9, 11), +(70, 'AdminPerformance', 8, 11),(71, 'AdminCustomerThreads', 29, 4),(72, 'AdminWebservice', 9, 12),(73, 'AdminStockMvt', 1, 9), +(80, 'AdminAddonsCatalog', 7, 1),(81, 'AdminAddonsMyAccount', 7, 2),(83, 'AdminThemes', 7, 3),(84, 'AdminGeolocation', 8, 12), +(85, 'AdminTaxRulesGroup', 4, 3),(86, 'AdminLogs', 9, 13), (87, 'AdminCounty', 5, 4),(88,'AdminHome',-1,0); + +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) (SELECT 1, id_tab, 1, 1, 1, 1 FROM PREFIX_tab); + +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES +(1, 1, 'Catalog'),(1, 2, 'Customers'),(1, 3, 'Orders'),(1, 4, 'Payment'), +(1, 5, 'Shipping'),(1, 6, 'Stats'),(1, 7, 'Modules'),(1, 8, 'Preferences'),(1, 9, 'Tools'),(1, 10, 'Manufacturers'),(1, 11, 'Attributes and Groups'), +(1, 12, 'Addresses'),(1, 13, 'Statuses'),(1, 14, 'Vouchers'),(1, 15, 'Currencies'),(1, 16, 'Taxes'),(1, 17, 'Carriers'),(1, 18, 'Countries'), +(1, 19, 'Zones'),(1, 20, 'Price Ranges'),(1, 21, 'Weight Ranges'),(1, 22, 'Positions'),(1, 23, 'Database'),(1, 24, 'E-mail'),(1, 26, 'Image'), +(1, 27, 'Products'),(1, 28, 'Contacts'),(1, 29, 'Employees'),(1, 30, 'Profiles'),(1, 31, 'Permissions'),(1, 32, 'Languages'),(1, 33, 'Translations'), +(1, 34, 'Suppliers'),(1, 35, 'Tabs'),(1, 36, 'Features'),(1, 37, 'Quick Access'),(1, 38, 'Appearance'),(1, 39, 'Contact Information'),(1, 40, 'Aliases'), +(1, 41, 'Import'),(1, 42, 'Invoices'),(1, 43, 'Search'),(1, 44, 'Localization'),(1, 46, 'States'),(1, 47, 'Merchandise Returns'),(1, 48, 'PDF'), +(1, 49, 'Credit Slips'),(1, 51, 'Settings'),(1, 52, 'Subdomains'),(1, 53, 'DB backup'),(1, 54, 'Order Messages'), +(1, 55, 'Delivery Slips'),(1, 56, 'SEO & URLs'),(1, 57, 'CMS'),(1, 58, 'Image Mapping'),(1, 59, 'Customer Messages'),(1, 60, 'Tracking'), +(1, 61, 'Search Engines'),(1, 62, 'Referrers'),(1, 63, 'Groups'),(1, 64, 'Generators'),(1, 65, 'Shopping Carts'),(1, 66, 'Tags'),(1, 67, 'Search'), +(1, 68, 'Attachments'),(1, 69, 'Configuration Information'),(1, 70, 'Performance'),(1, 71, 'Customer Service'),(1, 72, 'Webservice'),(1, 73, 'Stock Movements'), +(1, 80, 'Modules & Themes Catalog'),(1, 81, 'My Account'),(1, 82, 'Stores'),(1, 83, 'Themes'),(1, 84, 'Geolocation'),(1, 85, 'Tax Rules'),(1, 86, 'Log'), +(1, 87, 'Counties'),(1, 88, 'Home'); + +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES +(2, 1, 'Catalogue'),(2, 2, 'Clients'),(2, 3, 'Commandes'),(2, 4, 'Paiement'),(2, 5, 'Transport'), +(2, 6, 'Stats'),(2, 7, 'Modules'),(2, 8, 'Préférences'),(2, 9, 'Outils'),(2, 10, 'Fabricants'),(2, 11, 'Attributs et groupes'),(2, 12, 'Adresses'),(2, 13, 'Statuts'), +(2, 14, 'Bons de réduction'),(2, 15, 'Devises'),(2, 16, 'Taxes'),(2, 17, 'Transporteurs'),(2, 18, 'Pays'),(2, 19, 'Zones'),(2, 20, 'Tranches de prix'), +(2, 21, 'Tranches de poids'),(2, 22, 'Positions'),(2, 23, 'Base de données'),(2, 24, 'Emails'),(2, 26, 'Images'),(2, 27, 'Produits'),(2, 28, 'Contacts'), +(2, 29, 'Employés'),(2, 30, 'Profils'),(2, 31, 'Permissions'),(2, 32, 'Langues'),(2, 33, 'Traductions'),(2, 34, 'Fournisseurs'),(2, 35, 'Onglets'), +(2, 36, 'Caractéristiques'),(2, 37, 'Accès rapide'),(2, 38, 'Apparence'),(2, 39, 'Coordonnées'),(2, 40, 'Alias'),(2, 41, 'Import'),(2, 42, 'Factures'), +(2, 43, 'Recherche'),(2, 44, 'Localisation'),(2, 46, 'Etats'),(2, 47, 'Retours produits'),(2, 48, 'PDF'),(2, 49, 'Avoirs'), +(2, 51, 'Configuration'),(2, 52, 'Sous domaines'),(2, 53, 'Sauvegarde BDD'),(2, 54, 'Messages prédéfinis'),(2, 55, 'Bons de livraison'), +(2, 56, 'SEO & URLs'),(2, 57, 'CMS'),(2, 58, 'Scènes'),(2, 59, 'Messages clients'),(2, 60, 'Suivi'),(2, 61, 'Moteurs de recherche'), +(2, 62, 'Sites affluents'),(2, 63, 'Groupes'),(2, 64, 'Générateurs'),(2, 65, 'Paniers'),(2, 66, 'Tags'),(2, 67, 'Recherche'), +(2, 68, 'Documents joints'),(2, 69, 'Informations'),(2, 70, 'Performances'),(2, 71, 'SAV'),(2, 72, 'Service web'),(2, 73, 'Mouvements de Stock'), +(2, 80, 'Catalogue de modules et thèmes'),(2, 81, 'Mon compte'),(2, 82, 'Magasins'),(2, 83, 'Thèmes'),(2, 84, 'Géolocalisation'),(2, 85, 'Règles de taxes'),(2, 86, 'Log'), +(2, 87, 'Comtés'),(2,88,'Accueil'); + +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES +(3, 1, 'Catálogo'),(3, 2, 'Clientes'),(3, 3, 'Pedidos'),(3, 4, 'Pago'),(3, 5, 'Transporte'), +(3, 6, 'Estadísticas'),(3, 7, 'Módulos'),(3, 8, 'Preferencias'),(3, 9, 'Herramientas'),(3, 10, 'Fabricantes'),(3, 11, 'Atributos y grupos'),(3, 12, 'Direcciones'), +(3, 13, 'Estados'),(3, 14, 'Vales de descuento'),(3, 15, 'Divisas'),(3, 16, 'Impuestos'),(3, 17, 'Transportistas'),(3, 18, 'Países'),(3, 19, 'Zonas'), +(3, 20, 'Franja de precios'),(3, 21, 'Franja de pesos'),(3, 22, 'Posiciones'),(3, 23, 'Base de datos'),(3, 24, 'Emails'),(3, 26, 'Imágenes'), +(3, 27, 'Productos'),(3, 28, 'Contactos'),(3, 29, 'Empleados'),(3, 30, 'Perfiles'),(3, 31, 'Permisos'),(3, 32, 'Idiomas'),(3, 33, 'Traducciones'), +(3, 34, 'Proovedores'),(3, 35, 'Pestañas'),(3, 36, 'Características'),(3, 37, 'Acceso rápido'),(3, 38, 'Aspecto'),(3, 39, 'Datos'),(3, 40, 'Alias'), +(3, 41, 'Importar'),(3, 42, 'Facturas'),(3, 43, 'Búsqueda'),(3, 44, 'Ubicación'),(3, 46, 'Estados'),(3, 47, 'Devolución productos'),(3, 48, 'PDF'), +(3, 49, 'Vales'),(3, 51, 'Configuración'),(3, 52, 'Subcampos'),(3, 53, 'Copia de seguridad'),(3, 54, 'Mensajes de Orden'), +(3, 55, 'Albaranes de entrega'),(3, 56, 'SEO & URLs'),(3, 57, 'CMS'),(3, 58, 'Mapeo de la imagen'),(3, 59, 'Mensajes del cliente'),(3, 60, 'Rastreo'), +(3, 61, 'Motores de búsqueda'),(3, 62, 'Referido'),(3, 63, 'Grupos'),(3, 64, 'Generadores'),(3, 65, 'Carritos'),(3, 66, 'Etiquetas'),(3, 67, 'Búsqueda'),(3, 68, 'Adjuntos'), +(3, 69, 'Informations'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'), +(3, 87, 'Condados'),(3,88,'Home'); + +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES +(4, 1, 'Katalog'),(4, 2, 'Kunden'),(4, 3, 'Bestellungen'),(4, 4, 'Zahlung'), +(4, 5, 'Versandkosten'),(4, 6, 'Statistik'),(4, 7, 'Module'),(4, 8, 'Voreinstellungen'),(4, 9, 'Tools'),(4, 10, 'Hersteller'),(4, 11, 'Attribute und Gruppen'), +(4, 12, 'Adressen'),(4, 13, 'Status'),(4, 14, 'Gutscheine'),(4, 15, 'Währungen'),(4, 16, 'Steuern'),(4, 17, 'Lieferanten'),(4, 18, 'Länder'), +(4, 19, 'Zonen'),(4, 20, 'Preislagen'),(4, 21, 'Gewichtsklassen'),(4, 22, 'Positionen'),(4, 23, 'Datenbank'),(4, 24, 'E-Mail'),(4, 26, 'Bild'), +(4, 27, 'Produkte'),(4, 28, 'Kontakte'),(4, 29, 'Mitarbeiter'),(4, 30, 'Profile'),(4, 31, 'Berechtigungen'),(4, 32, 'Sprachen'),(4, 33, 'Übersetzungen'), +(4, 34, 'Zulieferer'),(4, 35, 'Tabs'),(4, 36, 'Funktionen'),(4, 37, 'Schnellzugriff'),(4, 38, 'Aussehen'),(4, 39, 'Kontaktinformation'),(4, 40, 'Alias'), +(4, 41, 'Import'),(4, 42, 'Rechnungen'),(4, 43, 'Suche'),(4, 44, 'Lokalisierung'),(4, 46, 'Staaten'),(4, 47, 'Warenrücksendungen'),(4, 48, 'PDF'), +(4, 49, 'Gutscheine'),(4, 51, 'Einstellungen'),(4, 52, 'Subdomains'),(4, 53, 'DB-Backup'),(4, 54, 'Bestellnachrichten'), +(4, 55, 'Lieferscheine'),(4, 56, 'SEO & URLs'),(4, 57, 'CMS'),(4, 58, 'Image Mapping'),(4, 59, 'Kundennachrichten'),(4, 60, 'Tracking'), +(4, 61, 'Suchmaschinen'),(4, 62, 'Referrer'),(4, 63, 'Gruppen'),(4, 64, 'Generatoren'),(4, 65, 'Warenkörbe'),(4, 66, 'Tags'),(4, 67, 'Suche'), +(4, 68, 'Anhänge'),(4, 69, 'Konfigurationsinformationen'),(4, 70, 'Leistung'),(4, 71, 'Kundenservice'),(4, 72, 'Webservice'),(4, 73, 'Lagerbewegungen'), +(4, 80, 'Module und Themenkatalog'),(4, 81, 'Mein Konto'),(4, 82, 'Shops'),(4, 83, 'Themen'),(4, 84, 'Geotargeting'),(4, 85, 'Steuerregeln'),(4, 86, 'Log'), +(4,87,'Counties'),(4,88,'Home'); + +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES +(5, 1, 'Catalogo'),(5, 2, 'Clienti'),(5, 3, 'Ordini'),(5, 4, 'Pagamento'), +(5, 5, 'Spedizione'),(5, 6, 'Stat'),(5, 7, 'Moduli'),(5, 8, 'Preferenze'),(5, 9, 'Strumenti'),(5, 10, 'Produttori'),(5, 11, 'Attributi e Gruppi'), +(5, 12, 'Indirizzi'),(5, 13, 'Status'),(5, 14, 'Voucher'),(5, 15, 'Valute'),(5, 16, 'Tasse'),(5, 17, 'Corrieri'),(5, 18, 'Nazioni'), +(5, 19, 'Zone'),(5, 20, 'Fasce di prezzo'),(5, 21, 'Fasce di peso'),(5, 22, 'Posizioni'),(5, 23, 'Database'),(5, 24, 'E-mail'),(5, 26, 'Immagine'), +(5, 27, 'Prodotti'),(5, 28, 'Contatti'),(5, 29, 'Impiegati'),(5, 30, 'Profili'),(5, 31, 'Permessi'),(5, 32, 'Lingue'),(5, 33, 'Traduzioni'), +(5, 34, 'Fornitori'),(5, 35, 'Tab'),(5, 36, 'Caratteristiche'),(5, 37, 'Accesso rapido'),(5, 38, 'Aspetto'),(5, 39, 'Informazioni di contatto'),(5, 40, 'Alias'), +(5, 41, 'Importa'),(5, 42, 'Fatture'),(5, 43, 'Cerca'),(5, 44, 'Localizzazione'),(5, 46, 'Stati'),(5, 47, 'Resi merci'),(5, 48, 'PDF'), +(5, 49, 'Note di credito'),(5, 51, 'Impostazioni'),(5, 52, 'Sottodomini'),(5, 53, 'DB backup'),(5, 54, 'Messaggi ordine'), +(5, 55, 'Note di consegna'),(5, 56, 'SEO & URLs'),(5, 57, 'CMS'),(5, 58, 'Mappatura immagine'),(5, 59, 'Messaggi cliente'),(5, 60, 'Rintracciare'), +(5, 61, 'Motori di ricerca'),(5, 62, 'Referenti'),(5, 63, 'Gruppi'),(5, 64, 'Generatori'),(5, 65, 'Carrelli shopping'),(5, 66, 'Tag'),(5, 67, 'Cerca'), +(5, 68, 'Allegati'),(5, 69, 'Informazioni di configurazione'),(5, 70, 'Performance'),(5, 71, 'Servizio clienti'),(5, 72, 'Webservice'),(5, 73, 'Movimenti magazzino'), +(5, 80, 'Moduli & Temi catalogo'),(5, 81, 'Il mio Account'),(5, 82, 'Negozi'),(5, 83, 'Temi'),(5, 84, 'Geolocalizzazione'),(5, 85, 'Regimi fiscali'),(5, 86, 'Log'), +(5,87,'Counties'),(5,88,'Home'); + +INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`) + (SELECT `id_tab`, id_lang, (SELECT tl.`name` + FROM `PREFIX_tab_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_tab`=`PREFIX_tab`.`id_tab`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_tab`); + +INSERT INTO `PREFIX_quick_access` (`id_quick_access`, `link`, `new_window`) VALUES +(1, 'index.php', 0),(2, '../', 1),(3, 'index.php?tab=AdminCatalog&addcategory', 0),(4, 'index.php?tab=AdminCatalog&addproduct', 0),(5, 'index.php?tab=AdminDiscounts&adddiscount', 0); + +INSERT INTO `PREFIX_quick_access_lang` (`id_quick_access`, `id_lang`, `name`) VALUES +(1, 1, 'Home'),(1, 2, 'Accueil'),(1, 3, 'Inicio'),(1, 4, 'Start'),(1, 5, 'Home page'), +(2, 1, 'My Shop'),(2, 2, 'Ma boutique'),(2, 3, 'Mi tienda'),(2, 4, 'Mein Shop'),(2, 5, 'Il mio negozio'), +(3, 1, 'New category'),(3, 2, 'Nouvelle catégorie'),(3, 3, 'Nueva categoría'),(3, 4, 'Neue Kategorie'),(3, 5, 'Nuova categoria'), +(4, 1, 'New product'),(4, 2, 'Nouveau produit'),(4, 3, 'Nuevo producto'),(4, 4, 'Neues Produkt'),(4, 5, 'Nuovo prodotto'), +(5, 1, 'New voucher'),(5, 2, 'Nouveau bon de réduction'),(5, 3, 'Nuevo cupón'),(5, 4, 'Neuer Ermäßigungsgutschein'),(5, 5, 'Nuovo buono sconto'); + +INSERT INTO `PREFIX_order_return_state` (`id_order_return_state`, `color`) VALUES (1, '#ADD8E6'),(2, '#EEDDFF'),(3, '#DDFFAA'),(4, '#FFD3D3'),(5, '#FFFFBB'); + +INSERT INTO `PREFIX_order_return_state_lang` (`id_order_return_state`, `id_lang`, `name`) VALUES +(1, 1, 'Waiting for confirmation'),(2, 1, 'Waiting for package'),(3, 1, 'Package received'),(4, 1, 'Return denied'),(5, 1, 'Return completed'), +(1, 2, 'En attente de confirmation'),(2, 2, 'En attente du colis'),(3, 2, 'Colis reçu'),(4, 2, 'Retour refusé'),(5, 2, 'Retour terminé'), +(1, 3, 'Pendiente de confirmación'),(2, 3, 'En espera de paquetes'),(3, 3, 'Paquetes recibidos'),(4, 3, 'Volver negó'),(5, 3, 'Diligenciados'), +(1, 4, 'Bestätigung wird erwartet'),(2, 4, 'Paket wird erwartet'),(3, 4, 'Paket erhalten'),(4, 4, 'Rücksendung abgelehnt'),(5, 4, 'Rücksendung beendet'), +(1, 5, 'In attesa di conferma'),(2, 5, 'In attesa del pacco'),(3, 5, 'Pacco ricevuto'),(4, 5, 'Restituzione non accettata'),(5, 5, 'Restituzione terminata'); + +INSERT INTO `PREFIX_meta` (`id_meta`, `page`) VALUES +(1, '404'), +(2, 'best-sales'), +(3, 'contact-form'), +(4, 'index'), +(5, 'manufacturer'), +(6, 'new-products'), +(7, 'password'), +(8, 'prices-drop'), +(9, 'sitemap'), +(10, 'supplier'), +(11, 'address'), +(12, 'addresses'), +(13, 'authentication'), +(14, 'cart'), +(15, 'discount'), +(16, 'history'), +(17, 'identity'), +(18, 'my-account'), +(19, 'order-follow'), +(20, 'order-slip'), +(21, 'order'), +(22, 'search'), +(23, 'stores'), +(24, 'order-opc'), +(25, 'guest-tracking'); + +INSERT INTO `PREFIX_meta_lang` (`id_meta`, `id_lang`, `title`, `description`, `keywords`, `url_rewrite`) VALUES +(1, 1, '404 error', 'This page cannot be found', 'error, 404, not found', 'page-not-found'), +(1, 2, 'Erreur 404', 'Cette page est introuvable', 'erreur, 404, introuvable', 'page-non-trouvee'), +(1, 3, 'Error 404', 'Esta página no se encuentra', 'error, 404, No se ha encontrado', 'pagina-no-encuentra'), +(2, 1, 'Best sales', 'Our best sales', 'best sales', 'best-sales'), +(2, 2, 'Meilleures ventes', 'Liste de nos produits les mieux vendus', 'meilleures ventes', 'meilleures-ventes'), +(2, 3, 'Los más vendidos', 'Lista de los de mayor venta de productos', 'los más vendidos', 'mas-vendidos'), +(3, 1, 'Contact us', 'Use our form to contact us', 'contact, form, e-mail', 'contact-us'), +(3, 2, 'Contactez-nous', 'Utilisez notre formulaire pour nous contacter', 'contact, formulaire, e-mail', 'contactez-nous'), +(3, 3, 'Contáctenos', 'Use nuestro formulario de contacto con nosotros', 'formulario de contacto, e-mail', 'contactenos'), +(4, 1, '', 'Shop powered by PrestaShop', 'shop, prestashop', ''), +(4, 2, '', 'Boutique propulsée par PrestaShop', 'boutique, prestashop', ''), +(4, 3, '', 'Shop powered by PrestaShop', 'tienda, prestashop', ''), +(5, 1, 'Manufacturers', 'Manufacturers list', 'manufacturer', 'manufacturers'), +(5, 2, 'Fabricants', 'Liste de nos fabricants', 'fabricants', 'fabricants'), +(5, 3, 'Fabricantes', 'Lista de Fabricantes', 'fabricantes', 'fabricantes'), +(6, 1, 'New products', 'Our new products', 'new, products', 'new-products'), +(6, 2, 'Nouveaux produits', 'Liste de nos nouveaux produits', 'nouveau, produit', 'nouveaux-produits'), +(6, 3, 'Nuevos Productos', 'Lista de nuestros nuevos productos', 'nuevo, productos', 'nuevos-productos'), +(7, 1, 'Forgot your password', 'Enter your e-mail address used to register in goal to get e-mail with your new password', 'forgot, password, e-mail, new, reset', 'password-recovery'), +(7, 2, 'Mot de passe oublié', 'Renseignez votre adresse e-mail afin de recevoir votre nouveau mot de passe.', 'mot de passe, oublié, e-mail, nouveau, regénération', 'mot-de-passe-oublie'), +(7, 3, 'Olvidaste tu contraseña', 'Ingrese su dirección de correo electrónico para recibir su nueva contraseña.', 'contraseña, has olvidado, e-mail, nuevo, regeneración', 'contrasena-olvidado'), +(8, 1, 'Prices drop', 'Our special products', 'special, prices drop', 'prices-drop'), +(8, 2, 'Promotions', 'Nos produits en promotion', 'promotion, réduction', 'promotions'), +(8, 3, 'Promociones', 'Nuestros productos promocionales', 'promoción, reducción', 'promocion'), +(9, 1, 'Sitemap', 'Lost ? Find what your are looking for', 'sitemap', 'sitemap'), +(9, 2, 'Plan du site', 'Perdu ? Trouvez ce que vous cherchez', 'plan, site', 'plan-du-site'), +(9, 3, 'Mapa del sitio', '¿Perdido? Encuentra lo que buscas', 'plan, sitio', 'mapa-del-sitio'), +(10, 1, 'Suppliers', 'Suppliers list', 'supplier', 'supplier'), +(10, 2, 'Fournisseurs', 'Liste de nos fournisseurs', 'fournisseurs', 'fournisseurs'), +(10, 3, 'Proveedores', 'Lista de Proveedores', 'proveedores', 'proveedores'), +(11, 1, 'Address', '', '', 'address'), +(11, 2, 'Adresse', '', '', 'adresse'), +(11, 3, 'Dirección', '', '', 'direccion'), +(12, 1, 'Addresses', '', '', 'addresses'), +(12, 2, 'Adresses', '', '', 'adresses'), +(12, 3, 'Direcciones', '', '', 'direcciones'), +(13, 1, 'Authentication', '', '', 'authentication'), +(13, 2, 'Authentification', '', '', 'authentification'), +(13, 3, 'Autenticación', '', '', 'autenticacion'), +(14, 1, 'Cart', '', '', 'cart'), +(14, 2, 'Panier', '', '', 'panier'), +(14, 3, 'Carro de la compra', '', '', 'carro-de-la-compra'), +(15, 1, 'Discount', '', '', 'discount'), +(15, 2, 'Bons de réduction', '', '', 'bons-de-reduction'), +(15, 3, 'Descuento', '', '', 'descuento'), +(16, 1, 'Order history', '', '', 'order-history'), +(16, 2, 'Historique des commandes', '', '', 'historique-des-commandes'), +(16, 3, 'Historial de pedidos', '', '', 'historial-de-pedidos'), +(17, 1, 'Identity', '', '', 'identity'), +(17, 2, 'Identité', '', '', 'identite'), +(17, 3, 'Identidad', '', '', 'identidad'), +(18, 1, 'My account', '', '', 'my-account'), +(18, 2, 'Mon compte', '', '', 'mon-compte'), +(18, 3, 'Mi Cuenta', '', '', 'mi-cuenta'), +(19, 1, 'Order follow', '', '', 'order-follow'), +(19, 2, 'Détails de la commande', '', '', 'details-de-la-commande'), +(19, 3, 'Devolución de productos', '', '', 'devolucion-de-productos'), +(20, 1, 'Order slip', '', '', 'order-slip'), +(20, 2, 'Avoirs', '', '', 'avoirs'), +(20, 3, 'Vales', '', '', 'vales'), +(21, 1, 'Order', '', '', 'order'), +(21, 2, 'Commande', '', '', 'commande'), +(21, 3, 'Carrito', '', '', 'carrito'), +(22, 1, 'Search', '', '', 'search'), +(22, 2, 'Recherche', '', '', 'recherche'), +(22, 3, 'Buscar', '', '', 'buscar'), +(23, 1, 'Stores', '', '', 'stores'), +(23, 2, 'Magasins', '', '', 'magasins'), +(23, 3, 'Tiendas', '', '', 'tiendas'), +(24, 1, 'Order', '', '', 'quick-order'), +(24, 2, 'Commande', '', '', 'commande-rapide'), +(24, 3, 'Carrito', '', '', 'pedido-rapido'), +(25, 1, 'Guest tracking', '', '', 'guest-tracking'), +(25, 2, 'Suivi de commande invité', '', '', 'suivi-commande-invite'), +(25, 3, 'Estado del pedido', '', '', 'estado-pedido'), +(1, 4, 'Fehler 404', 'Seite wurde nicht gefunden', 'Fehler 404, nicht gefunden', 'seite-nicht-gefunden'), +(2, 4, 'Verkaufshits', 'Unsere Verkaufshits', 'Verkaufshits', 'verkaufshits'), +(3, 4, 'Kontaktieren Sie uns', 'Nutzen Sie unser Kontaktformular', 'Kontakt, Formular, E-Mail', 'kontaktieren-sie-uns'), +(4, 4, '', 'Shop powered by PrestaShop', 'Shop, prestashop', ''), +(5, 4, 'Hersteller', 'Herstellerliste', 'Hersteller', 'hersteller'), +(6, 4, 'Neue Produkte', 'Unsere neuen Produkte', 'neu, Produkte', 'neue-Produkte'), +(7, 4, 'Kennwort vergessen', 'Geben Sie die E-Mailadresse ein, die Sie zum Einloggen benutzen, damit Sie eine E-Mail mit dem neuen Kennwort erhalt', 'vergessen, Kennwort, E-Mail, neu, Reset', 'kennwort-wiederherstellung'), +(8, 4, 'Preise fallen', 'Unsere Sonderangebote', 'besonders, Preise fallen', 'preise-fallen'), +(9, 4, 'Sitemap', 'Verloren? Finden Sie, was Sie suchen', 'sitemap', 'sitemap'), +(10, 4, 'Zulieferer', 'Zuliefererliste', 'Zulieferer', 'zulieferer'), +(11, 4, 'Adresse', '', '', 'adresse'), +(12, 4, 'Adressen', '', '', 'adressen'), +(13, 4, 'Authentifizierung', '', '', 'authentifizierung'), +(14, 4, 'Warenkorb', '', '', 'warenkorb'), +(15, 4, 'Discount', '', '', 'discount'), +(16, 4, 'Bestellungsverlauf', '', '', 'bestellungsverlauf'), +(17, 4, 'Kennung', '', '', 'kennung'), +(18, 4, 'Mein Konto', '', '', 'mein-Konto'), +(19, 4, 'Bestellungsverfolgung', '', '', 'bestellungsverfolgung'), +(20, 4, 'Bestellschein', '', '', 'bestellschein'), +(21, 4, 'Bestellung', '', '', 'bestellung'), +(22, 4, 'Suche', '', '', 'suche'), +(23, 4, 'Shops', '', '', 'shops'), +(24, 4, 'Bestellung', '', '', 'schnell-bestellung'), +(25, 4, 'Auftragsverfolgung Gast', '', '', 'auftragsverfolgung-gast'), +(1, 5, 'errore 404', 'Impossibile trovare questa pagina', 'errore, 404, non trovato', 'pagina-non-trovata'), +(2, 5, 'Vendite migliori', 'Le nostre vendite migliori', 'vendite migliori', 'vendite-migliori'), +(3, 5, 'Contattaci', 'Usa il nostro modulo per contattarci', 'contatto, modulo, e-mail', 'contattaci'), +(4, 5, '', 'Negozio powered by PrestaShop', 'negozio, prestashop', ''), +(5, 5, 'Produttori', 'Elenco produttori', 'produttore', 'produttori'), +(6, 5, 'Nuovi prodotti', 'I nostri nuovi prodotti', 'nuovi, prodotti', 'nuovi-prodotti'), +(7, 5, 'Hai dimenticato la password', 'Inserisci l\'indirizzo e-mail usato per registrarti per poter ottenere una e-mail with con la tua nuova password', 'dimenticato, password, e-mail, nuovo, reset', 'password-recupero'), +(8, 5, 'Riduzioni prezzi', 'I nostri prodotti speciali', 'speciali, riduzione prezzi', 'riduzione-prezzi'), +(9, 5, 'Mappa del sito', 'Ti sei perso? Trova quello che stai cercando', 'sitemap', 'sitemap'), +(10, 5, 'Fornitori', 'Elenco fornitori', 'fornitori', 'fornitore'), +(11, 5, 'Indirizzo', '', '', 'indirizzo'), +(12, 5, 'Indirizzi', '', '', 'indirizzi'), +(13, 5, 'Autenticazione', '', '', 'autenticazione'), +(14, 5, 'Carrello', '', '', 'carrello'), +(15, 5, 'Sconto', '', '', 'sconto'), +(16, 5, 'Storico ordine', '', '', 'storico-ordine'), +(17, 5, 'Identità', '', '', 'identità'), +(18, 5, 'Il mio account', '', '', 'il-mio-account'), +(19, 5, 'Seguito ordine', '', '', 'seguito-ordine'), +(20, 5, 'Nota di ordine', '', '', 'nota-di-ordine'), +(21, 5, 'Ordine', '', '', 'ordine'), +(22, 5, 'Cerca', '', '', 'cerca'), +(23, 5, 'Negozi', '', '', 'negozi'), +(24, 5, 'Ordine', '', '', 'ordine-veloce'), +(25, 5, 'Ospite di monitoraggio', '', '', 'ospite-monitoraggio'); + +/* Stats */ +INSERT INTO `PREFIX_operating_system` (`name`) VALUES ('Windows XP'),('Windows Vista'),('MacOsX'),('Linux'); +INSERT INTO `PREFIX_web_browser` (`name`) VALUES ('Safari'),('Firefox 2.x'),('Firefox 3.x'),('Opera'),('IE 6.x'),('IE 7.x'),('IE 8.x'),('Google Chrome'); +INSERT INTO `PREFIX_page_type` (`id_page_type`, `name`) VALUES +(13, 'authentication.php'),(11, 'best-sales.php'),(2, 'category.php'),(7, 'cms.php'),(12, 'contact-form.php'),(5, 'index.php'),(4, 'manufacturer.php'), +(3, 'order.php'),(10, 'prices-drop.php'),(1, 'product.php'),(8, 'search.php'),(14, 'sitemap.php'),(9, 'stores.php'),(6, 'supplier.php'); +INSERT INTO `PREFIX_search_engine` (`server`,`getvar`) +VALUES ('google','q'),('aol','q'),('yandex','text'),('ask.com','q'),('nhl.com','q'),('yahoo','p'),('baidu','wd'), +('lycos','query'),('exalead','q'),('search.live','q'),('voila','rdata'),('altavista','q'),('bing','q'),('daum','q'), +('eniro','search_word'),('naver','query'),('msn','q'),('netscape','query'),('cnn','query'),('about','terms'),('mamma','query'), +('alltheweb','q'),('virgilio','qs'),('alice','qs'),('najdi','q'),('mama','query'),('seznam','q'),('onet','qt'),('szukacz','q'), +('yam','k'),('pchome','q'),('kvasir','q'),('sesam','q'),('ozu','q'),('terra','query'),('mynet','q'),('ekolay','q'),('rambler','words'); + +/* SubDomains */ +INSERT INTO `PREFIX_subdomain` (`id_subdomain`, `name`) VALUES (NULL, 'www'); + +/* CMS */ +INSERT INTO `PREFIX_cms` (`id_cms`, `id_cms_category`, `position`, `active`) VALUES (1, 1, 0, 1), (2, 1, 1, 1), (3, 1, 2, 1), (4, 1, 3, 1), (5, 1, 4, 1); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(1, 1, 'Delivery', 'Our terms and conditions of delivery', 'conditions, delivery, delay, shipment, pack', '

    Shipments and returns

    Your pack shipment

    Packages are generally dispatched within 2 days after receipt of payment and are shipped via UPS with tracking and drop-off without signature. If you prefer delivery by UPS Extra with required signature, an additional cost will be applied, so please contact us before choosing this method. Whichever shipment choice you make, we will provide you with a link to track your package online.

    Shipping fees include handling and packing fees as well as postage costs. Handling fees are fixed, whereas transport fees vary according to total weight of the shipment. We advise you to group your items in one order. We cannot group two distinct orders placed separately, and shipping fees will apply to each of them. Your package will be dispatched at your own risk, but special care is taken to protect fragile objects.

    Boxes are amply sized and your items are well-protected.

    ', 'delivery'), +(1, 2, 'Livraison', 'Nos conditions générales de livraison', 'conditions, livraison, délais, transport, colis', '

    Livraisons et retours

    Le transport de votre colis

    Les colis sont généralement expédiés en 48h après réception de votre paiement. Le mode d''expédition standard est le Colissimo suivi, remis sans signature. Si vous souhaitez une remise avec signature, un coût supplémentaire s''applique, merci de nous contacter. Quel que soit le mode d''expédition choisi, nous vous fournirons dès que possible un lien qui vous permettra de suivre en ligne la livraison de votre colis.

    Les frais d''expédition comprennent l''emballage, la manutention et les frais postaux. Ils peuvent contenir une partie fixe et une partie variable en fonction du prix ou du poids de votre commande. Nous vous conseillons de regrouper vos achats en une unique commande. Nous ne pouvons pas grouper deux commandes distinctes et vous devrez vous acquitter des frais de port pour chacune d''entre elles. Votre colis est expédié à vos propres risques, un soin particulier est apporté au colis contenant des produits fragiles..

    Les colis sont surdimensionnés et protégés.

    ', 'livraison'), +(2, 1, 'Legal Notice', 'Legal notice', 'notice, legal, credits', '

    Legal

    Credits

    Concept and production:

    This Web site was created using PrestaShop™ open-source software.

    ', 'legal-notice'), +(2, 2, 'Mentions légales', 'Mentions légales', 'mentions, légales, crédits', '

    Mentions légales

    Crédits

    Concept et production :

    Ce site internet a été réalisé en utilisant la solution open-source PrestaShop™ .

    ', 'mentions-legales'), +(3, 1, 'Terms and conditions of use', 'Our terms and conditions of use', 'conditions, terms, use, sell', '

    Your terms and conditions of use

    Rule 1

    Here is the rule 1 content

    \r\n

    Rule 2

    Here is the rule 2 content

    \r\n

    Rule 3

    Here is the rule 3 content

    ', 'terms-and-conditions-of-use'), +(3, 2, 'Conditions d''utilisation', 'Nos conditions générales de ventes', 'conditions, utilisation, générales, ventes', '

    Vos conditions de ventes

    Règle n°1

    Contenu de la règle numéro 1

    \r\n

    Règle n°2

    Contenu de la règle numéro 2

    \r\n

    Règle n°3

    Contenu de la règle numéro 3

    ', 'conditions-generales-de-ventes'), +(4, 1, 'About us', 'Learn more about us', 'about us, informations', '

    About us

    \r\n

    Our company

    Our company

    \r\n

    Our team

    Our team

    \r\n

    Informations

    Informations

    ', 'about-us'), +(4, 2, 'A propos', 'Apprenez-en d''avantage sur nous', 'à propos, informations', '

    A propos

    \r\n

    Notre entreprise

    Notre entreprise

    \r\n

    Notre équipe

    Notre équipe

    \r\n

    Informations

    Informations

    ', 'a-propos'), +(5, 1, 'Secure payment', 'Our secure payment mean', 'secure payment, ssl, visa, mastercard, paypal', '

    Secure payment

    \r\n

    Our secure payment

    With SSL

    \r\n

    Using Visa/Mastercard/Paypal

    About this services

    ', 'secure-payment'), +(5, 2, 'Paiement sécurisé', 'Notre offre de paiement sécurisé', 'paiement sécurisé, ssl, visa, mastercard, paypal', '

    Paiement sécurisé

    \r\n

    Notre offre de paiement sécurisé

    Avec SSL

    \r\n

    Utilisation de Visa/Mastercard/Paypal

    A propos de ces services

    ', 'paiement-securise'), +(1, 3, 'Entrega', 'Nuestras condiciones de entrega', 'condiciones, plazos de entrega, transporte, paquetería', '

    shipping & Returns

    \r\n

    El transporte de su paquete

    \r\n

    Los paquetes son generalmente enviados en 48 horas después de la recepción de su pago. La moda es el estándar expédition Colissimo seguido, entrega sin firma. Si desea una entrega con la firma, un cargo adicional, gracias al contacto con nosotros. Sea cual sea el método de envío seleccionado, vamos a presentar lo antes posible, un vínculo que le permite rastrear el envío en línea de su paquete.

    Gastos de envío incluyen el embalaje, la manipulación y envío. Pueden contener un fijo y una parte variable basado en el precio o el peso de su solicitud. Le recomendamos que para consolidar sus compras en un solo comando. No podemos grupo de dos órdenes distintos y hay que pagar gastos de envío para cada uno. Su paquete es enviado a su propio riesgo, se presta especial atención a las parcelas que contienen objetos frágiles ..

    Los paquetes son de gran tamaño y protegidas.

    ', 'entrega'), +(2, 3, 'Aviso legal', 'Aviso legal', 'términos, condiciones y créditos fotográficos', '

    Pie de imprenta

    \r\n

    Créditos

    \r\n

    \r\n


    Concepto y producción:

    Este sitio web fue creado utilizando la solución de código abierto PrestaShop™.

    ', 'aviso-legal'), +(3, 3, 'Condiciones de uso', 'Condiciones de uso', 'condiciones, el consumo, las ventas generales', '

    Sus condiciones de venta

    \r\n

    Regla N º 1

    \r\n

    Contenido de la Regla Número 1

    \r\n

    Regla N º 2

    \r\n

    Contenido de la Regla N º 2

    \r\n

    Regla N º 3

    \r\n

    Contenido de la Regla Número 3

    ', 'condiciones-de-uso'), +(4, 3, 'Sobre', 'Conozca más sobre nosotros', 'sobre, información', '

    Sobre

    ', 'sobre'), +(5, 3, 'Pago seguro', 'Ofrecemos pago seguro', 'pago seguro, ssl, visa, mastercard, paypal', '

    Pago seguro

    \r\n

    Ofrecemos pago seguro

    \r\n

    SSL

    \r\n

    Utilice Visa / Mastercard / Paypal

    \r\n

    Acerca de estos servicios

    ', 'pago-seguro'), +(1, 4, 'Lieferung', 'Unsere Lieferbedingungen', 'Bedingungen, Lieferung, Frist, Versand, Verpackung', '

    Versand und Rücknahme

    Ihre Versandverpackung

    Pakete werden normalerweise 2 Tage nach Zahlungseingang mit UPS mit Bestellverfolgemöglichkeit und Ablieferung ohne Unterschrift geliefert. Wenn Sie lieber eine UPS-Sendung per Einschreiben erhalten möchten, entstehen zusätzliche Kosten. Bitte kontaktieren Sie uns, bevor Sie dieses Liefermethode wählen. Wir senden Ihnen einen Link für die Bestellverfolgung unabhängig davon, welche Liefermethode Sie wählen.

    Die Versandkosten beinhalten Lade- und Verpackungsgebühren sowie die Portokosten. Die Verladegebühren stehen fest, wobei Transportkosten schwanken, je nach Gesamtgewicht des Pakets. Wir raten Ihnen, mehrere Artikel in einer Bestellung zusammenzufassen. Wir können zwei verschiedene Bestellungen nicht zusammenlegen, und die Versandkosten werden separat für jede Bestellung gerechnet. Ihr Paket wird auf Ihr Risiko versandt, aber zerbrechliche Ware wird besonders sorgsam behandelt.

    Die Versandschachteln sind weit geschnitten und ihre Ware wird gut geschützt verpackt.

    ', 'Lieferung'), +(2, 4, 'Rechtliche Hinweise', 'Rechtliche Hinweise', 'Hinweise, rechtlich, Gutscheine', '

    Legal

    Credits

    Konzept und Gestaltung:

    Diese Webseite wurde hergestellt unter Verwendung von PrestaShop™ open-source software.

    ', 'rechtliche-hinweise'), +(3, 4, 'Allgemeine Nutzungsbedingungen', 'Unsere allgemeinen Nutzungsbedingungen', 'Voraussetzungen, Bedingungen, nutzen, verkaufen', '

    Your terms and conditions of use

    Rule 1

    Here is the rule 1 content

    \r\n

    Rule 2

    Here is the rule 2 content

    \r\n

    Rule 3

    Here is the rule 3 content

    ', 'allgemeine-nutzungsbedingungen'), +(4, 4, 'Über uns', 'Learn more about us', 'über uns, Informationen', '

    About us

    \r\n

    Our company

    Our company

    \r\n

    Our team

    Our team

    \r\n

    Informations

    Informations

    ', 'uber-uns'), +(5, 4, 'Sichere Zahlung', 'Unsere Sicherheits-Zahlungsmethoden', 'Sichere Zahlung, SSL, Visa, MasterCard, PayPal', '

    Secure payment

    \r\n

    Our secure payment

    With SSL

    \r\n

    Using Visa/Mastercard/Paypal

    About this services

    ', 'sichere-zahlung'), +(1, 5, 'Consegna', 'I nostri termini e condizioni di consegna', 'condizioni, consegna, tempo, spedizione, pacco', '

    Spedizioni e resi

    Spedizione del tuo pacco

    I pacchi sono solitamente spediti entro 2 giorni dopo il ricevimento del pagamento e inviati tramite UPS con controllo e consegna senza firma. Se preferisci una consegna con UPS Extra con richiesta di firma, sarà applicato un costo aggiuntivo, pertanto contattaci prima di scegliere questo mezzo. Qualunque tipo di spedizione tu scelga, ti garantiremo un link per controllare online il percorso del tuo pacco.

    Le spese di spedizione comprendono le spese di imballaggio e affrancatura. Le spese di imballaggio sono fisse, mentre quelle di trasporto variano in base al peso totale della spedizione. Ti consigliamo di raggruppare i tuoi articoli in un unico ordine. Non possiamo raggruppare due ordini distinti eseguiti separatamente, e ad ognuno di esso saranno applicate le spese di spedizione. Il tuo pacco sarà inviato sotto la tua responsabilità, ma un\'attenzione particolare è riservata agli oggetti fragili.

    Le scatole hanno dimensioni ragionevoli e i tuoi articoli sono ben protetti.

    ', 'consegna'), +(2, 5, 'Nota Legale', 'Nota legale', 'nota, legale, crediti', '

    Legale

    Crediti

    Creazione e produzione:

    Questo sito web è stato realizzato usando un software open-sourcePrestaShop™.

    ', 'nota-legale'), +(3, 5, 'Termini e condizioni d\'uso', 'I nostri termini e condizioni d\'uso', 'condizioni, termini, uso, vendi', '

    I tuoi termini e condizioni d\'uso

    Regola 1

    Ecco il contenuto della regola 1

    \r\n

    Regola 2

    Ecco il contenuto della regola 2

    \r\n

    Regola 3

    Ecco il contenuto della regola 3

    ', 'termini-e-condizioni-di-uso'), +(4, 5, 'Chi siamo', 'Per sapere chi siamo', 'chi siamo, informazioni', '

    Chi siamo

    \r\n

    La nostra azienda

    La nostra azienda

    \r\n

    Il nostro team

    Il nostro team

    \r\n

    Informazioni

    Informazioni

    ', 'chi-siamo'), +(5, 5, 'Pagamento sicuro', 'Il nostro mezzo di pagamento sicuro', 'pagamento sicuro, ssl, visa, mastercard, paypal', '

    Pagamento sicuro

    \r\n

    Il nostro pagamento sicuro

    Con SSL

    \r\n

    Usando Visa/Mastercard/Paypal

    Cosa sono questi servizi

    ', 'pagamento-sicuro'); + +INSERT INTO `PREFIX_cms_category_lang` (`id_cms_category`, `id_lang`, `name`, `description`, `link_rewrite`, `meta_title`, `meta_keywords`, `meta_description`) VALUES +(1, 1, 'Home', '', 'home', NULL, NULL, NULL), +(1, 2, 'Accueil', '', 'home', NULL, NULL, NULL), +(1, 3, 'Inicio', '', 'home', NULL, NULL, NULL), +(1, 4, 'Start', '', 'Start', NULL, NULL, NULL), +(1, 5, 'Home', '', 'home', NULL, NULL, NULL); + +INSERT INTO `PREFIX_cms_category` (`id_cms_category`, `id_parent`, `level_depth`, `active`, `date_add`, `date_upd`) VALUES(1, 0, 0, 1, NOW(), NOW()); + +/* Carrier */ +INSERT INTO `PREFIX_carrier` (`id_carrier`, `id_tax_rules_group`, `name`, `active`, `deleted`, `shipping_handling`) VALUES (1, 0, 0, 1, 0, 0); + +INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) VALUES (1, 1); + +INSERT INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`) VALUES (1, 1, 'Pick up in-store'),(1, 2, 'Retrait au magasin'),(1, 3, 'Recogida en la tienda'),(1, 4, 'Abholung im Geschäft'),(1, 5, 'Ritiro in magazzino'); + +INSERT INTO `PREFIX_carrier_zone` (`id_carrier`, `id_zone`) VALUES (1, 1); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_CARRIER_DEFAULT', '1', NOW(), NOW()); + +/* Timezone */ +INSERT INTO `PREFIX_timezone` (`name`) VALUES ('Africa/Abidjan'),('Africa/Accra'),('Africa/Addis_Ababa'),('Africa/Algiers'), +('Africa/Asmara'),('Africa/Asmera'),('Africa/Bamako'),('Africa/Bangui'),('Africa/Banjul'),('Africa/Bissau'),('Africa/Blantyre'), +('Africa/Brazzaville'),('Africa/Bujumbura'),('Africa/Cairo'),('Africa/Casablanca'),('Africa/Ceuta'),('Africa/Conakry'),('Africa/Dakar'), +('Africa/Dar_es_Salaam'),('Africa/Djibouti'),('Africa/Douala'),('Africa/El_Aaiun'),('Africa/Freetown'),('Africa/Gaborone'),('Africa/Harare'), +('Africa/Johannesburg'),('Africa/Kampala'),('Africa/Khartoum'),('Africa/Kigali'),('Africa/Kinshasa'),('Africa/Lagos'),('Africa/Libreville'), +('Africa/Lome'),('Africa/Luanda'),('Africa/Lubumbashi'),('Africa/Lusaka'),('Africa/Malabo'),('Africa/Maputo'),('Africa/Maseru'), +('Africa/Mbabane'),('Africa/Mogadishu'),('Africa/Monrovia'),('Africa/Nairobi'),('Africa/Ndjamena'),('Africa/Niamey'),('Africa/Nouakchott'), +('Africa/Ouagadougou'),('Africa/Porto-Novo'),('Africa/Sao_Tome'),('Africa/Timbuktu'),('Africa/Tripoli'),('Africa/Tunis'),('Africa/Windhoek'), +('America/Adak'),('America/Anchorage '),('America/Anguilla'),('America/Antigua'),('America/Araguaina'),('America/Argentina/Buenos_Aires'), +('America/Argentina/Catamarca'),('America/Argentina/ComodRivadavia'),('America/Argentina/Cordoba'),('America/Argentina/Jujuy'), +('America/Argentina/La_Rioja'),('America/Argentina/Mendoza'),('America/Argentina/Rio_Gallegos'),('America/Argentina/Salta'), +('America/Argentina/San_Juan'),('America/Argentina/San_Luis'),('America/Argentina/Tucuman'),('America/Argentina/Ushuaia'),('America/Aruba'), +('America/Asuncion'),('America/Atikokan'),('America/Atka'),('America/Bahia'),('America/Barbados'),('America/Belem'),('America/Belize'), +('America/Blanc-Sablon'),('America/Boa_Vista'),('America/Bogota'),('America/Boise'),('America/Buenos_Aires'),('America/Cambridge_Bay'), +('America/Campo_Grande'),('America/Cancun'),('America/Caracas'),('America/Catamarca'),('America/Cayenne'),('America/Cayman'),('America/Chicago'), +('America/Chihuahua'),('America/Coral_Harbour'),('America/Cordoba'),('America/Costa_Rica'),('America/Cuiaba'),('America/Curacao'), +('America/Danmarkshavn'),('America/Dawson'),('America/Dawson_Creek'),('America/Denver'),('America/Detroit'),('America/Dominica'), +('America/Edmonton'),('America/Eirunepe'),('America/El_Salvador'),('America/Ensenada'),('America/Fort_Wayne'),('America/Fortaleza'), +('America/Glace_Bay'),('America/Godthab'),('America/Goose_Bay'),('America/Grand_Turk'),('America/Grenada'),('America/Guadeloupe'), +('America/Guatemala'),('America/Guayaquil'),('America/Guyana'),('America/Halifax'),('America/Havana'),('America/Hermosillo'), +('America/Indiana/Indianapolis'),('America/Indiana/Knox'),('America/Indiana/Marengo'),('America/Indiana/Petersburg'), +('America/Indiana/Tell_City'),('America/Indiana/Vevay'),('America/Indiana/Vincennes'),('America/Indiana/Winamac'),('America/Indianapolis'), +('America/Inuvik'),('America/Iqaluit'),('America/Jamaica'),('America/Jujuy'),('America/Juneau'),('America/Kentucky/Louisville'), +('America/Kentucky/Monticello'),('America/Knox_IN'),('America/La_Paz'),('America/Lima'),('America/Los_Angeles'),('America/Louisville'), +('America/Maceio'),('America/Managua'),('America/Manaus'),('America/Marigot'),('America/Martinique'),('America/Mazatlan'),('America/Mendoza'), +('America/Menominee'),('America/Merida'),('America/Mexico_City'),('America/Miquelon'),('America/Moncton'),('America/Monterrey'), +('America/Montevideo'),('America/Montreal'),('America/Montserrat'),('America/Nassau'),('America/New_York'),('America/Nipigon'), +('America/Nome'),('America/Noronha'),('America/North_Dakota/Center'),('America/North_Dakota/New_Salem'),('America/Panama'), +('America/Pangnirtung'),('America/Paramaribo'),('America/Phoenix'),('America/Port-au-Prince'),('America/Port_of_Spain'),('America/Porto_Acre'), +('America/Porto_Velho'),('America/Puerto_Rico'),('America/Rainy_River'),('America/Rankin_Inlet'),('America/Recife'),('America/Regina'), +('America/Resolute'),('America/Rio_Branco'),('America/Rosario'),('America/Santarem'),('America/Santiago'),('America/Santo_Domingo'), +('America/Sao_Paulo'),('America/Scoresbysund'),('America/Shiprock'),('America/St_Barthelemy'),('America/St_Johns'),('America/St_Kitts'), +('America/St_Lucia'),('America/St_Thomas'),('America/St_Vincent'),('America/Swift_Current'),('America/Tegucigalpa'),('America/Thule'), +('America/Thunder_Bay'),('America/Tijuana'),('America/Toronto'),('America/Tortola'),('America/Vancouver'),('America/Virgin'),('America/Whitehorse'), +('America/Winnipeg'),('America/Yakutat'),('America/Yellowknife'),('Antarctica/Casey'),('Antarctica/Davis'),('Antarctica/DumontDUrville'), +('Antarctica/Mawson'),('Antarctica/McMurdo'),('Antarctica/Palmer'),('Antarctica/Rothera'),('Antarctica/South_Pole'),('Antarctica/Syowa'), +('Antarctica/Vostok'),('Arctic/Longyearbyen'),('Asia/Aden'),('Asia/Almaty'),('Asia/Amman'),('Asia/Anadyr'),('Asia/Aqtau'),('Asia/Aqtobe'), +('Asia/Ashgabat'),('Asia/Ashkhabad'),('Asia/Baghdad'),('Asia/Bahrain'),('Asia/Baku'),('Asia/Bangkok'),('Asia/Beirut'),('Asia/Bishkek'), +('Asia/Brunei'),('Asia/Calcutta'),('Asia/Choibalsan'),('Asia/Chongqing'),('Asia/Chungking'),('Asia/Colombo'),('Asia/Dacca'),('Asia/Damascus'), +('Asia/Dhaka'),('Asia/Dili'),('Asia/Dubai'),('Asia/Dushanbe'),('Asia/Gaza'),('Asia/Harbin'),('Asia/Ho_Chi_Minh'),('Asia/Hong_Kong'),('Asia/Hovd'), +('Asia/Irkutsk'),('Asia/Istanbul'),('Asia/Jakarta'),('Asia/Jayapura'),('Asia/Jerusalem'),('Asia/Kabul'),('Asia/Kamchatka'),('Asia/Karachi'), +('Asia/Kashgar'),('Asia/Kathmandu'),('Asia/Katmandu'),('Asia/Kolkata'),('Asia/Krasnoyarsk'),('Asia/Kuala_Lumpur'),('Asia/Kuching'),('Asia/Kuwait'), +('Asia/Macao'),('Asia/Macau'),('Asia/Magadan'),('Asia/Makassar'),('Asia/Manila'),('Asia/Muscat'),('Asia/Nicosia'),('Asia/Novosibirsk'),('Asia/Omsk'), +('Asia/Oral'),('Asia/Phnom_Penh'),('Asia/Pontianak'),('Asia/Pyongyang'),('Asia/Qatar'),('Asia/Qyzylorda'),('Asia/Rangoon'),('Asia/Riyadh'), +('Asia/Saigon'),('Asia/Sakhalin'),('Asia/Samarkand'),('Asia/Seoul'),('Asia/Shanghai'),('Asia/Singapore'),('Asia/Taipei'),('Asia/Tashkent'), +('Asia/Tbilisi'),('Asia/Tehran'),('Asia/Tel_Aviv'),('Asia/Thimbu'),('Asia/Thimphu'),('Asia/Tokyo'),('Asia/Ujung_Pandang'),('Asia/Ulaanbaatar'), +('Asia/Ulan_Bator'),('Asia/Urumqi'),('Asia/Vientiane'),('Asia/Vladivostok'),('Asia/Yakutsk'),('Asia/Yekaterinburg'),('Asia/Yerevan'), +('Atlantic/Azores'),('Atlantic/Bermuda'),('Atlantic/Canary'),('Atlantic/Cape_Verde'),('Atlantic/Faeroe'),('Atlantic/Faroe'),('Atlantic/Jan_Mayen'), +('Atlantic/Madeira'),('Atlantic/Reykjavik'),('Atlantic/South_Georgia'),('Atlantic/St_Helena'),('Atlantic/Stanley'),('Australia/ACT'), +('Australia/Adelaide'),('Australia/Brisbane'),('Australia/Broken_Hill'),('Australia/Canberra'),('Australia/Currie'),('Australia/Darwin'), +('Australia/Eucla'),('Australia/Hobart'),('Australia/LHI'),('Australia/Lindeman'),('Australia/Lord_Howe'),('Australia/Melbourne'),('Australia/North'), +('Australia/NSW'),('Australia/Perth'),('Australia/Queensland'),('Australia/South'),('Australia/Sydney'),('Australia/Tasmania'),('Australia/Victoria'), +('Australia/West'),('Australia/Yancowinna'),('Europe/Amsterdam'),('Europe/Andorra'),('Europe/Athens'),('Europe/Belfast'),('Europe/Belgrade'), +('Europe/Berlin'),('Europe/Bratislava'),('Europe/Brussels'),('Europe/Bucharest'),('Europe/Budapest'),('Europe/Chisinau'),('Europe/Copenhagen'), +('Europe/Dublin'),('Europe/Gibraltar'),('Europe/Guernsey'),('Europe/Helsinki'),('Europe/Isle_of_Man'),('Europe/Istanbul'),('Europe/Jersey'), +('Europe/Kaliningrad'),('Europe/Kiev'),('Europe/Lisbon'),('Europe/Ljubljana'),('Europe/London'),('Europe/Luxembourg'),('Europe/Madrid'),('Europe/Malta'), +('Europe/Mariehamn'),('Europe/Minsk'),('Europe/Monaco'),('Europe/Moscow'),('Europe/Nicosia'),('Europe/Oslo'),('Europe/Paris'),('Europe/Podgorica'), +('Europe/Prague'),('Europe/Riga'),('Europe/Rome'),('Europe/Samara'),('Europe/San_Marino'),('Europe/Sarajevo'),('Europe/Simferopol'),('Europe/Skopje'), +('Europe/Sofia'),('Europe/Stockholm'),('Europe/Tallinn'),('Europe/Tirane'),('Europe/Tiraspol'),('Europe/Uzhgorod'),('Europe/Vaduz'),('Europe/Vatican'), +('Europe/Vienna'),('Europe/Vilnius'),('Europe/Volgograd'),('Europe/Warsaw'),('Europe/Zagreb'),('Europe/Zaporozhye'),('Europe/Zurich'), +('Indian/Antananarivo'),('Indian/Chagos'),('Indian/Christmas'),('Indian/Cocos'),('Indian/Comoro'),('Indian/Kerguelen'),('Indian/Mahe'),('Indian/Maldives'), +('Indian/Mauritius'),('Indian/Mayotte'),('Indian/Reunion'),('Pacific/Apia'),('Pacific/Auckland'),('Pacific/Chatham'),('Pacific/Easter'),('Pacific/Efate'), +('Pacific/Enderbury'),('Pacific/Fakaofo'),('Pacific/Fiji'),('Pacific/Funafuti'),('Pacific/Galapagos'),('Pacific/Gambier'),('Pacific/Guadalcanal'), +('Pacific/Guam'),('Pacific/Honolulu'),('Pacific/Johnston'),('Pacific/Kiritimati'),('Pacific/Kosrae'),('Pacific/Kwajalein'),('Pacific/Majuro'), +('Pacific/Marquesas'),('Pacific/Midway'),('Pacific/Nauru'),('Pacific/Niue'),('Pacific/Norfolk'),('Pacific/Noumea'),('Pacific/Pago_Pago'),('Pacific/Palau'), +('Pacific/Pitcairn'),('Pacific/Ponape'),('Pacific/Port_Moresby'),('Pacific/Rarotonga'),('Pacific/Saipan'),('Pacific/Samoa'),('Pacific/Tahiti'), +('Pacific/Tarawa'),('Pacific/Tongatapu'),('Pacific/Truk'),('Pacific/Wake'),('Pacific/Wallis'),('Pacific/Yap'),('Brazil/Acre'),('Brazil/DeNoronha'), +('Brazil/East'),('Brazil/West'),('Canada/Atlantic'),('Canada/Central'),('Canada/East-Saskatchewan'),('Canada/Eastern'),('Canada/Mountain'), +('Canada/Newfoundland'),('Canada/Pacific'),('Canada/Saskatchewan'),('Canada/Yukon'),('CET'),('Chile/Continental'),('Chile/EasterIsland'),('CST6CDT'), +('Cuba'),('EET'),('Egypt'),('Eire'),('EST'),('EST5EDT'),('Etc/GMT'),('Etc/GMT+0'),('Etc/GMT+1'),('Etc/GMT+10'),('Etc/GMT+11'),('Etc/GMT+12'), +('Etc/GMT+2'),('Etc/GMT+3'),('Etc/GMT+4'),('Etc/GMT+5'),('Etc/GMT+6'),('Etc/GMT+7'),('Etc/GMT+8'),('Etc/GMT+9'),('Etc/GMT-0'),('Etc/GMT-1'), +('Etc/GMT-10'),('Etc/GMT-11'),('Etc/GMT-12'),('Etc/GMT-13'),('Etc/GMT-14'),('Etc/GMT-2'),('Etc/GMT-3'),('Etc/GMT-4'),('Etc/GMT-5'),('Etc/GMT-6'), +('Etc/GMT-7'),('Etc/GMT-8'),('Etc/GMT-9'),('Etc/GMT0'),('Etc/Greenwich'),('Etc/UCT'),('Etc/Universal'),('Etc/UTC'),('Etc/Zulu'),('Factory'),('GB'), +('GB-Eire'),('GMT'),('GMT+0'),('GMT-0'),('GMT0'),('Greenwich'),('Hongkong'),('HST'),('Iceland'),('Iran'),('Israel'),('Jamaica'),('Japan'),('Kwajalein'), +('Libya'),('MET'),('Mexico/BajaNorte'),('Mexico/BajaSur'),('Mexico/General'),('MST'),('MST7MDT'),('Navajo'),('NZ'),('NZ-CHAT'),('Poland'),('Portugal'), +('PRC'),('PST8PDT'),('ROC'),('ROK'),('Singapore'),('Turkey'),('UCT'),('Universal'),('US/Alaska'),('US/Aleutian'),('US/Arizona'),('US/Central'), +('US/East-Indiana'),('US/Eastern'),('US/Hawaii'),('US/Indiana-Starke'),('US/Michigan'),('US/Mountain'),('US/Pacific'),('US/Pacific-New'),('US/Samoa'), +('UTC'),('W-SU'),('WET'),('Zulu'); + +INSERT INTO `PREFIX_group` (`id_group`, `reduction`, `date_add`, `date_upd`) VALUES (1, 0, NOW(), NOW()); + +INSERT INTO `PREFIX_group_lang` (`id_group`, `id_lang`, `name`) VALUES (1, 1, 'Default'),(1, 2, 'Défaut'),(1, 3, 'Predeterminado'),(1, 4, 'Default'),(1, 5, 'Default'); + +INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) VALUES (1, 1); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TAX_ADDRESS_TYPE', 'id_address_delivery', NOW(), NOW()); + +INSERT INTO `PREFIX_stock_mvt_reason` (`id_stock_mvt_reason`, `sign`, `date_add`, `date_upd`) VALUES +(1, 1, NOW(), NOW()), (2, -1, NOW(), NOW()), (3, -1, NOW(), NOW()), (4, -1, NOW(), NOW()), (5, 1, NOW(), NOW()); +INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`) VALUES +(1, 1, 'Increase'), +(1, 2, 'Augmenter'), +(1, 3, 'Aumentar'), +(1, 4, 'Erhöhen'), +(1, 5, 'Increase'), +(2, 1, 'Decrease'), +(2, 2, 'Diminuer'), +(2, 3, 'Disminuir'), +(2, 4, 'Reduzieren'), +(2, 5, 'Decrease'), +(3, 1, 'Order'), +(3, 2, 'Commande'), +(3, 3, 'Pedido'), +(3, 4, 'Bestellung'), +(3, 5, 'Ordine'), +(4, 1, 'Missing Stock Movement'), +(4, 2, 'Mouvement de stock manquant'), +(4, 3, 'Movimiento de stock que falta'), +(4, 4, 'Lagerbewegung nicht stattgefunden'), +(4, 5, 'Movimento di merce mancante'), +(5, 1, 'Restocking'), +(5, 2, 'Réassort'), +(5, 3, 'Reaprovisionar'), +(5, 4, 'Auffüllung'), +(5, 5, 'Riassortimento'); + diff --git a/install-dev/sql/upgrade/0.9.1.2.sql b/install-dev/sql/upgrade/0.9.1.2.sql new file mode 100644 index 000000000..4ff1333c6 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.1.2.sql @@ -0,0 +1,30 @@ +/* STRUCTURE */ +CREATE TABLE `PREFIX_product_sale` ( +`id_product` INT( 10 ) UNSIGNED NOT NULL , +`quantity` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0', +`nb_vente` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0', +`date_upd` DATE NOT NULL , +PRIMARY KEY ( `id_product` ) +) ENGINE = MYISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_image_type` + ADD `manufacturers` BOOL NOT NULL DEFAULT '1' AFTER `categories`; + +ALTER TABLE `PREFIX_address` + ADD `id_manufacturer` INT( 10 ) UNSIGNED NOT NULL AFTER `id_customer` ; + +ALTER TABLE `PREFIX_address` + ADD `id_supplier` INT( 10 ) UNSIGNED NOT NULL AFTER `id_manufacturer` ; + +ALTER TABLE `PREFIX_order_discount` + ADD `id_discount` INT( 10 ) UNSIGNED NOT NULL AFTER `id_order` ; + +ALTER TABLE `PREFIX_discount` + ADD `quantity_per_user` INT( 10 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `quantity` ; + +ALTER TABLE `PREFIX_contact` CHANGE `position` `position` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0'; + +/* CONTENTS */ + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/0.9.1.sql b/install-dev/sql/upgrade/0.9.1.sql new file mode 100644 index 000000000..5b0fabb09 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.1.sql @@ -0,0 +1,9 @@ +/* STRUCTURE */ +ALTER TABLE `PREFIX_product` CHANGE `price` `price` DECIMAL(13,6) NOT NULL DEFAULT '0.000000'; + +/* CONTENTS */ +DELETE FROM `PREFIX_carrier_lang` WHERE `id_carrier` = (SELECT c.`id_carrier` FROM `PREFIX_carrier` c WHERE c.`name` = 'My download manager' LIMIT 1); +DELETE FROM `PREFIX_carrier` WHERE `name` = 'My download manager'; + +/* Conf vars */ +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TAX_NO', '0', NOW(), NOW()); \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.5.1.sql b/install-dev/sql/upgrade/0.9.5.1.sql new file mode 100644 index 000000000..10deba89a --- /dev/null +++ b/install-dev/sql/upgrade/0.9.5.1.sql @@ -0,0 +1,75 @@ +/* STRUCTURE */ +ALTER TABLE `PREFIX_order_state` + ADD `logable` TINYINT(1) NOT NULL DEFAULT 0; +ALTER TABLE `PREFIX_product_sale` + CHANGE `nb_vente` `sale_nbr` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `PREFIX_carrier` + CHANGE `tax` `id_tax` INT(10) UNSIGNED NULL DEFAULT 0 AFTER `id_carrier`; +ALTER TABLE `PREFIX_carrier` + ADD `shipping_handling` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `deleted`; +ALTER TABLE `PREFIX_address` + CHANGE `id_country` `id_country` INT(10) UNSIGNED NOT NULL DEFAULT 0, + CHANGE `id_customer` `id_customer` INT(10) UNSIGNED NOT NULL DEFAULT 0, + CHANGE `id_manufacturer` `id_manufacturer` INT(10) UNSIGNED NOT NULL DEFAULT 0; +RENAME TABLE `PREFIX_product_attribute_combinaison` TO `PREFIX_product_attribute_combination`; +ALTER TABLE `PREFIX_product_attribute_combination` + DROP INDEX `product_attribute_combinaison_index`, + ADD PRIMARY KEY (`id_attribute`, `id_product_attribute`); + +CREATE TABLE `PREFIX_carrier_zone` ( + id_carrier int(10) unsigned NOT NULL, + id_zone int(10) unsigned NOT NULL, + INDEX carrier_zone_index(id_carrier, id_zone) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tax_zone` ( + id_tax int(10) unsigned NOT NULL, + id_zone int(10) unsigned NOT NULL, + INDEX tax_zone_index(id_tax, id_zone) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +/* CONTENTS */ + +/* Adding tab Contact */ +INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM`PREFIX_tab` t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminContact', 6); +INSERT INTO `PREFIX_tab_lang` (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminContact' LIMIT 1), + 'Contact' FROM `PREFIX_lang`); +UPDATE `PREFIX_tab_lang` SET `name` = 'Coordonnées' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminContact' LIMIT 1) + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr' LIMIT 1); +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) + VALUES ('1', (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminContact' LIMIT 1), '1', '1', '1', '1'); + +/* Rename old tab */ +UPDATE `PREFIX_tab_lang` SET `name` = 'Produits' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminPPreferences') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +UPDATE `PREFIX_tab_lang` SET `name` = 'Emails' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminEmails') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +UPDATE `PREFIX_tab_lang` SET `name` = 'Images' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImages') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); + +/* New BankWire state */ +UPDATE `PREFIX_order_state` SET `logable` = 1 WHERE `id_order_state` < 6 AND `id_order_state` > 1; +INSERT INTO `PREFIX_order_state` (`id_order_state`, `invoice`, `send_email`, `color`, `unremovable`, `logable`) VALUES (10, 0, 1, 'lightblue', 1, 0); +INSERT INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) VALUES +(10, 1, 'Awaiting bank wire payment', 'bankwire'), +(10, 2, 'En attente du paiement par virement bancaire', 'bankwire'); + +/* New hook */ +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('updateOrderStatus', 'Order''s status update event', 'Launch modules when the order''s status of an order change.', 0); + +/* Adding zones for tax/carrier */ +INSERT INTO `PREFIX_tax_zone` (id_tax, id_zone) (SELECT id_tax, id_zone FROM `PREFIX_tax` CROSS JOIN `PREFIX_zone`); +INSERT INTO `PREFIX_carrier_zone` (id_carrier, id_zone) (SELECT id_carrier, id_zone FROM `PREFIX_carrier` CROSS JOIN `PREFIX_zone`); + +/* CONFIGURATION VARIABLE */ + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PREFIX_PURCHASE_MINIMUM', '0', NOW(), NOW()), +('PREFIX_SHOP_ENABLE', '1', NOW(), NOW()); \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.5.2.sql b/install-dev/sql/upgrade/0.9.5.2.sql new file mode 100644 index 000000000..57f9b765c --- /dev/null +++ b/install-dev/sql/upgrade/0.9.5.2.sql @@ -0,0 +1,5 @@ +/* STRUCTURE */ + +/* CONTENTS */ + +/* CONFIGURATION VARIABLE */ \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.6.1.sql b/install-dev/sql/upgrade/0.9.6.1.sql new file mode 100644 index 000000000..fa371d9b9 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.6.1.sql @@ -0,0 +1,51 @@ +/* STRUCTURE */ + +CREATE TABLE `PREFIX_alias` ( + alias varchar(255) NOT NULL, + search varchar(255) NOT NULL, + active tinyint(1) NOT NULL default 1, + id_alias int(10) NOT NULL auto_increment, + PRIMARY KEY (id_alias), + UNIQUE KEY alias (alias) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_configuration` + ADD UNIQUE `name` (`name`); +ALTER TABLE `PREFIX_product` + ADD `wholesale_price` DECIMAL( 13, 6 ) NOT NULL AFTER `price`; +ALTER TABLE `PREFIX_range_weight` + CHANGE `delimiter1` `delimiter1` DECIMAL( 13, 6 ) NOT NULL DEFAULT '0.000000'; +ALTER TABLE `PREFIX_range_weight` + CHANGE `delimiter2` `delimiter2` DECIMAL( 13, 6 ) NOT NULL DEFAULT '0.000000'; + ALTER TABLE `PREFIX_discount_type_lang` + CHANGE `name` `name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + ALTER TABLE `PREFIX_product` + CHANGE `bargain` `on_sale` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `PREFIX_image_type` + ADD `suppliers` BOOL NOT NULL DEFAULT 1; + +/* CONTENTS */ + +/* Adding tab alias */ +INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES ((SELECT tmp.id_tab FROM (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminAliases', 9); +INSERT INTO `PREFIX_tab_lang` (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAliases' LIMIT 1), + 'Alias' FROM `PREFIX_lang`); +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) + VALUES ('1', (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAliases' LIMIT 1), '1', '1', '1', '1'); + +/* Adding tab import */ +INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES ((SELECT tmp.id_tab FROM (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminImport', 10); +INSERT INTO `PREFIX_tab_lang` (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImport' LIMIT 1), + 'Import' FROM `PREFIX_lang`); +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) + VALUES ('1', (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImport' LIMIT 1), '1', '1', '1', '1'); + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`) +VALUES ('adminOrder', 'Display in Back-Office, tab AdminOrder', 'Launch modules when the tab AdminOrder is displayed on back-office.'); + + +/* CONFIGURATION VARIABLE */ \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.6.2.sql b/install-dev/sql/upgrade/0.9.6.2.sql new file mode 100644 index 000000000..c55fefbb8 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.6.2.sql @@ -0,0 +1,7 @@ +/* STRUCTURE */ + +ALTER TABLE `PREFIX_product` CHANGE `wholesale_price` `wholesale_price` DECIMAL(13, 6) NULL; + +/* CONTENTS */ + +/* CONFIGURATION VARIABLE */ \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.7.1.sql b/install-dev/sql/upgrade/0.9.7.1.sql new file mode 100644 index 000000000..5a8ded7f5 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.7.1.sql @@ -0,0 +1,14 @@ +/* STRUCTURE */ + +ALTER TABLE `PREFIX_module` ADD INDEX (`name`); + +/* CONTENTS */ + +INSERT INTO `PREFIX_hook` (`name` , `title`, `description`, `position`) VALUES +('footer', 'Footer', 'Add block in footer', 1), +('PDFInvoice', 'PDF Invoice', 'Allow the display of extra informations into the PDF invoice', 0); +UPDATE `PREFIX_hook` SET `description` = 'Add blocks in the header', `position` = '1' WHERE `name` = 'header' LIMIT 1 ; +UPDATE `PREFIX_currency` SET `iso_code` = 'XXX' WHERE `iso_code` IS NULL; + + +/* CONFIGURATION VARIABLE */ \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.7.2.sql b/install-dev/sql/upgrade/0.9.7.2.sql new file mode 100644 index 000000000..c0ebf4949 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.7.2.sql @@ -0,0 +1,21 @@ +/* STRUCTURE */ + +CREATE TABLE `PREFIX_discount_quantity` ( + id_discount_quantity INT UNSIGNED NOT NULL auto_increment, + id_discount_type INT UNSIGNED NOT NULL, + id_product INT UNSIGNED NOT NULL, + id_product_attribute INT UNSIGNED NULL, + quantity INT UNSIGNED NOT NULL, + value DECIMAL(10,2) UNSIGNED NOT NULL, + PRIMARY KEY (id_discount_quantity) +) ENGINE=MYISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_product` ADD quantity_discount BOOL NULL DEFAULT 0 AFTER out_of_stock; + +/* CONTENTS */ + + +/* CONFIGURATION VARIABLE */ + +UPDATE `PREFIX_configuration` SET name = 'PS_TAX', value = 1 WHERE name = 'PS_TAX_NO' AND value = 0; +UPDATE `PREFIX_configuration` SET name = 'PS_TAX', value = 0 WHERE name = 'PS_TAX_NO' AND value = 1; \ No newline at end of file diff --git a/install-dev/sql/upgrade/0.9.sql b/install-dev/sql/upgrade/0.9.sql new file mode 100644 index 000000000..abef1ee07 --- /dev/null +++ b/install-dev/sql/upgrade/0.9.sql @@ -0,0 +1,39 @@ +/* STRUCTURE */ + +ALTER TABLE `PREFIX_currency` ADD `iso_code` VARCHAR( 3 ) NOT NULL DEFAULT '0' AFTER `name`; +ALTER TABLE `PREFIX_product_attribute` ADD `default_on` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `weight`; +ALTER TABLE `PREFIX_carrier` ADD `tax` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `deleted`; + +ALTER TABLE `PREFIX_order_detail` + ADD `download_hash` VARCHAR(255) default NULL AFTER `tax_rate`, + ADD `download_nb` INT(10) unsigned default 0 AFTER `tax_rate`, + ADD `download_deadline` DATETIME DEFAULT NULL AFTER `tax_rate`; + +CREATE TABLE `PREFIX_product_download` ( + `id_product_download` INT(10) unsigned NOT NULL auto_increment, + `id_product` INT(10) unsigned NOT NULL, + `display_filename` VARCHAR(255) default NULL, + `physically_filename` VARCHAR(255) default NULL, + `date_deposit` DATETIME NOT NULL, + `date_expiration` DATETIME default NULL, + `nb_days_accessible` int(10) unsigned default NULL, + `nb_downloadable` int(10) unsigned default 1, + PRIMARY KEY (`id_product_download`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +/* CONTENTS */ + +/* Adding tab Appearance */ +UPDATE `PREFIX_tab` SET `class_name` = 'AdminAppearance' WHERE class_name = 'AdminHomepage'; +UPDATE `PREFIX_tab_lang` SET `name` = 'Appearance' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAppearance'); +UPDATE `PREFIX_tab_lang` SET `name` = 'Apparence' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAppearance') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); + +/* Adding iso_code to currency */ +UPDATE `PREFIX_currency` SET `iso_code` = 'XXX'; + +/* Conf vars */ +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_DISPLAY_QTIES', '1', NOW(), NOW()); \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.0.0.1.sql b/install-dev/sql/upgrade/1.0.0.1.sql new file mode 100644 index 000000000..d1bd27dd1 --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.1.sql @@ -0,0 +1,129 @@ +/* PHP */ +/* PHP:latin1_database_to_utf8(); */; + +/* STRUCTURE */ +SET NAMES 'utf8'; + +CREATE TABLE PREFIX_attribute_impact ( + id_attribute_impact int(11) NOT NULL AUTO_INCREMENT, + id_product int(11) NOT NULL, + id_attribute int(11) NOT NULL, + weight float NOT NULL, + price decimal(10,2) NOT NULL, + PRIMARY KEY (id_attribute_impact), + UNIQUE KEY id_product (id_product,id_attribute) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_supplier_lang ( + id_supplier INTEGER UNSIGNED NOT NULL, + id_lang INTEGER UNSIGNED NOT NULL, + description TEXT NULL, + INDEX supplier_lang_index(id_supplier, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_manufacturer_lang ( + id_manufacturer INTEGER UNSIGNED NOT NULL, + id_lang INTEGER UNSIGNED NOT NULL, + description TEXT NULL, + INDEX manufacturer_lang_index(id_manufacturer, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_state ( + id_state int(10) unsigned NOT NULL AUTO_INCREMENT, + id_country int(11) NOT NULL, + name varchar(64) NOT NULL, + iso_code varchar(3) NOT NULL, + active tinyint(1) NOT NULL default 0, + PRIMARY KEY (id_state) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE PREFIX_customer ADD secure_key VARCHAR(32) NOT NULL DEFAULT '-1' AFTER id_gender; +ALTER TABLE PREFIX_orders ADD secure_key VARCHAR(32) NOT NULL DEFAULT '-1' AFTER id_address_invoice; +ALTER TABLE PREFIX_product ADD id_category_default INT NULL AFTER id_tax; +ALTER TABLE PREFIX_category_product ADD position INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER id_product; +ALTER TABLE PREFIX_product ADD INDEX (id_category_default); +ALTER TABLE PREFIX_order_detail ADD ecotax DECIMAL(10, 2) NOT NULL DEFAULT 0 AFTER tax_rate; +ALTER TABLE PREFIX_employee + CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE PREFIX_address + CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE PREFIX_customer + CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE PREFIX_quick_access ADD new_window TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER id_quick_access; + +/* CONTENTS */ +UPDATE PREFIX_hook_module SET id_hook = 14 WHERE id_hook = 9; +UPDATE PREFIX_quick_access SET new_window = 1 WHERE id_quick_access = 2 LIMIT 1; +INSERT INTO PREFIX_hook (name, title, description, position) VALUES ('orderConfirmation', 'Order confirmation page', 'Called on order confirmation page', 0); +UPDATE PREFIX_order_detail odt + SET product_price = ( + odt.product_price * ( + SELECT conversion_rate FROM PREFIX_currency c, PREFIX_orders o WHERE o.id_order = odt.id_order AND c.id_currency = o.id_currency + ) +); +UPDATE PREFIX_product p SET p.id_category_default = (SELECT id_category FROM PREFIX_category_product cp WHERE cp.id_product = p.id_product GROUP BY id_product ORDER BY cp.id_category ASC); +UPDATE PREFIX_category_product cp SET cp.position= cp.id_product; + +/* NEW TABS */ +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminPDF', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPDF' LIMIT 1), + 'PDF Invoice' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Facture PDF' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminPDF') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPDF' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminPrintPDF', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPrintPDF' LIMIT 1), + 'Print invoices' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Impression factures' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminPrintPDF') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPrintPDF' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES (-1, 'AdminSearch', 2); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearch' LIMIT 1), + 'Search' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Recherche' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSearch') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearch' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminLocalization', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminLocalization' LIMIT 1), + 'Localization' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Localisation' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminLocalization') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminLocalization' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminShipping' LIMIT 1) AS tmp), 'AdminStates', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminShipping' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminStates' LIMIT 1), + 'States' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Etats' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminStates') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (`id_profile`, `id_tab`, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminStates' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('home', 129, 129, 1, 0, 0, 0); + +/* CONFIGURATION VARIABLE */ +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_NB_DAYS_NEW_PRODUCT', 20, NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_WEIGHT_UNIT', 'kg', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_BLOCK_CART_AJAX', '1', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_FO_PROTOCOL', 'http://', NOW(), NOW()); +UPDATE PREFIX_configuration SET name = 'PS_MAIL_SMTP_PORT', value = 25 WHERE name = 'PS_MAIL_SMTP_PORT' AND value = 'default'; +UPDATE PREFIX_configuration SET name = 'PS_MAIL_SMTP_PORT', value = 465 WHERE name = 'PS_MAIL_SMTP_PORT' AND value = 'secure'; diff --git a/install-dev/sql/upgrade/1.0.0.2.sql b/install-dev/sql/upgrade/1.0.0.2.sql new file mode 100644 index 000000000..fb0c72687 --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.2.sql @@ -0,0 +1,13 @@ + +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_currency CHANGE COLUMN conversion_rate conversion_rate DECIMAL(10,6) NOT NULL; + +/* CONTENTS */ + +INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('thickbox', 600, 600, 1, 0, 0, 0); +INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('category', 600, 150, 0, 1, 0, 0); +INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('thickbox', 129, 129, 1, 0, 0, 0); + +/* CONFIGURATION VARIABLE */ diff --git a/install-dev/sql/upgrade/1.0.0.3.sql b/install-dev/sql/upgrade/1.0.0.3.sql new file mode 100644 index 000000000..e82995b59 --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.3.sql @@ -0,0 +1,441 @@ +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_attribute_group_lang DROP INDEX attribute_group_lang_index, ADD PRIMARY KEY (id_attribute_group, id_lang); +ALTER TABLE PREFIX_discount_lang DROP INDEX discount_lang_index, ADD PRIMARY KEY (id_discount, id_lang); +ALTER TABLE PREFIX_discount_type_lang DROP INDEX discount_type_lang_index, ADD PRIMARY KEY (id_discount_type, id_lang); +ALTER TABLE PREFIX_manufacturer_lang DROP INDEX manufacturer_lang_index, ADD PRIMARY KEY (id_manufacturer, id_lang); +ALTER TABLE PREFIX_supplier_lang DROP INDEX supplier_lang_index, ADD PRIMARY KEY (id_supplier, id_lang); +ALTER TABLE PREFIX_profile_lang DROP INDEX profile_lang_index, ADD PRIMARY KEY (id_profile, id_lang); +ALTER TABLE PREFIX_configuration_lang DROP INDEX configuration_lang_index, ADD PRIMARY KEY (id_configuration, id_lang); +ALTER TABLE PREFIX_tab_lang DROP INDEX tab_lang, ADD PRIMARY KEY (id_tab, id_lang); + +ALTER TABLE PREFIX_product ADD id_color_default INT UNSIGNED NULL AFTER id_category_default; +ALTER TABLE PREFIX_attribute_group ADD is_color_group TINYINT(1) NOT NULL DEFAULT 0; +ALTER TABLE PREFIX_attribute ADD color VARCHAR(32) NULL DEFAULT NULL; +ALTER TABLE PREFIX_currency CHANGE conversion_rate conversion_rate DECIMAL(13, 6) NOT NULL ; +ALTER TABLE PREFIX_address ADD id_state INT NULL AFTER id_country; +ALTER TABLE PREFIX_state ADD id_zone INT NULL AFTER id_country; +ALTER TABLE PREFIX_country ADD contains_states tinyint(1) NOT NULL DEFAULT 0; + +UPDATE PREFIX_customer SET secure_key = MD5(RAND()) WHERE secure_key = '-1'; +UPDATE PREFIX_orders o SET secure_key = (SELECT secure_key FROM PREFIX_customer c WHERE c.id_customer = o.id_customer); + +CREATE TABLE PREFIX_order_return ( + id_order_return INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + id_customer INTEGER UNSIGNED NOT NULL, + id_order INTEGER UNSIGNED NOT NULL, + state tinyint(1) unsigned NOT NULL DEFAULT 0, + question TEXT NOT NULL, + date_add DATETIME NOT NULL, + date_upd DATETIME NOT NULL, + PRIMARY KEY(id_order_return), + INDEX order_return_customer(id_customer) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_return_detail ( + id_order_return INTEGER UNSIGNED NOT NULL, + id_order_detail INTEGER UNSIGNED NOT NULL, + product_quantity int(10) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (id_order_return,id_order_detail) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_return_state ( + id_order_return_state int(10) unsigned NOT NULL auto_increment, + color varchar(32) default NULL, + PRIMARY KEY (`id_order_return_state`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_return_state_lang ( + id_order_return_state int(10) unsigned NOT NULL, + id_lang int(10) unsigned NOT NULL, + name varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_return_state`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_slip ( + id_order_slip INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + id_customer INTEGER UNSIGNED NOT NULL, + id_order INTEGER UNSIGNED NOT NULL, + date_add DATETIME NOT NULL, + date_upd DATETIME NOT NULL, + PRIMARY KEY(id_order_slip), + INDEX order_slip_customer(id_customer) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_slip_detail ( + id_order_slip INTEGER UNSIGNED NOT NULL, + id_order_detail INTEGER UNSIGNED NOT NULL, + product_quantity int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id_order_slip`,`id_order_detail`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_tax_state ( + id_tax int(10) unsigned NOT NULL, + id_state int(10) unsigned NOT NULL, + INDEX tax_state_index(id_tax, id_state) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* CONTENTS */ + +INSERT INTO PREFIX_order_return_state (`id_order_return_state`, `color`) VALUES +(1, '#ADD8E6'), +(2, '#EEDDFF'), +(3, '#DDFFAA'), +(4, '#FFD3D3'), +(5, '#FFFFBB'); + +INSERT INTO PREFIX_order_return_state_lang (`id_order_return_state`, `id_lang`, `name`) VALUES +(1, 1, 'Waiting for confirmation'), +(2, 1, 'Waiting for package'), +(3, 1, 'Package received'), +(4, 1, 'Return denied'), +(5, 1, 'Return completed'), +(1, 2, 'En attente de confirmation'), +(2, 2, 'En attente du colis'), +(3, 2, 'Colis reçu'), +(4, 2, 'Retour refusé'), +(5, 2, 'Retour terminé'); + +UPDATE PREFIX_country SET contains_states = 1 WHERE id_country = 21; + +INSERT INTO `PREFIX_state` (`id_state`, `id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES +(1, 21, 2, 'Alabama', 'AL', 1), +(2, 21, 2, 'Alaska', 'AK', 1), +(3, 21, 2, 'Arizona', 'AZ', 1), +(4, 21, 2, 'Arkansas', 'AR', 1), +(5, 21, 2, 'California', 'CA', 1), +(6, 21, 2, 'Colorado', 'CO', 1), +(7, 21, 2, 'Connecticut', 'CT', 1), +(8, 21, 2, 'Delaware', 'DE', 1), +(9, 21, 2, 'Florida', 'FL', 1), +(10, 21, 2, 'Georgia', 'GA', 1), +(11, 21, 2, 'Hawaii', 'HI', 1), +(12, 21, 2, 'Idaho', 'ID', 1), +(13, 21, 2, 'Illinois', 'IL', 1), +(14, 21, 2, 'Indiana', 'IN', 1), +(15, 21, 2, 'Iowa', 'IA', 1), +(16, 21, 2, 'Kansas', 'KS', 1), +(17, 21, 2, 'Kentucky', 'KY', 1), +(18, 21, 2, 'Louisiana', 'LA', 1), +(19, 21, 2, 'Maine', 'ME', 1), +(20, 21, 2, 'Maryland', 'MD', 1), +(21, 21, 2, 'Massachusetts', 'MA', 1), +(22, 21, 2, 'Michigan', 'MI', 1), +(23, 21, 2, 'Minnesota', 'MN', 1), +(24, 21, 2, 'Mississippi', 'MS', 1), +(25, 21, 2, 'Missouri', 'MO', 1), +(26, 21, 2, 'Montana', 'MT', 1), +(27, 21, 2, 'Nebraska', 'NE', 1), +(28, 21, 2, 'Nevada', 'NV', 1), +(29, 21, 2, 'New Hampshire', 'NH', 1), +(30, 21, 2, 'New Jersey', 'NJ', 1), +(31, 21, 2, 'New Mexico', 'NM', 1), +(32, 21, 2, 'New York', 'NY', 1), +(33, 21, 2, 'North Carolina', 'NC', 1), +(34, 21, 2, 'North Dakota', 'ND', 1), +(35, 21, 2, 'Ohio', 'OH', 1), +(36, 21, 2, 'Oklahoma', 'OK', 1), +(37, 21, 2, 'Oregon', 'OR', 1), +(38, 21, 2, 'Pennsylvania', 'PA', 1), +(39, 21, 2, 'Rhode Island', 'RI', 1), +(40, 21, 2, 'South Carolina', 'SC', 1), +(41, 21, 2, 'South Dakota', 'SD', 1), +(42, 21, 2, 'Tennessee', 'TN', 1), +(43, 21, 2, 'Texas', 'TX', 1), +(44, 21, 2, 'Utah', 'UT', 1), +(45, 21, 2, 'Vermont', 'VT', 1), +(46, 21, 2, 'Virginia', 'VA', 1), +(47, 21, 2, 'Washington', 'WA', 1), +(48, 21, 2, 'West Virginia', 'WV', 1), +(49, 21, 2, 'Wisconsin', 'WI', 1), +(50, 21, 2, 'Wyoming', 'WY', 1), +(51, 21, 2, 'Puerto Rico', 'PR', 1), +(52, 21, 2, 'US Virgin Islands', 'VI', 1); + +INSERT INTO `PREFIX_lang` (`name`, `active`, `iso_code`) VALUES +('Deutsch (German)', 1, 'de'), +('Español (Spanish)', 1, 'es'), +('Nederlands (Dutch)', 1, 'nl'), +('Bahasa Indonesia (Indonesian)', 1, 'id'), +('Italiano (Italian)', 1, 'it'), +('Język polski (Polish)', 1, 'pl'), +('Português (Portuguese)', 1, 'pt'), +('Čeština (Czech)', 1, 'cs'), +('Pусский язык (Russian)', 0, 'ru'), +('Türkçe (Turkish)', 0, 'tr'), +('Tiếng Việt (Vietnamese)', 0, 'vn'); + +/* NEW LANGS */ + +INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`) + (SELECT `id_tab`, id_lang, (SELECT tl.`name` + FROM `PREFIX_tab_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_tab`=`PREFIX_tab`.`id_tab`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_tab`); + +INSERT IGNORE INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`) + (SELECT `id_country`, id_lang, (SELECT tl.`name` + FROM `PREFIX_country_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_country`=`PREFIX_country`.`id_country`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_country`); + +INSERT IGNORE INTO `PREFIX_quick_access_lang` (`id_quick_access`, `id_lang`, `name`) + (SELECT `id_quick_access`, id_lang, (SELECT tl.`name` + FROM `PREFIX_quick_access_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_quick_access`=`PREFIX_quick_access`.`id_quick_access`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_quick_access`); + +INSERT IGNORE INTO `PREFIX_attribute_group_lang` (`id_attribute_group`, `id_lang`, `name`, `public_name`) + (SELECT `id_attribute_group`, id_lang, (SELECT tl.`name` + FROM `PREFIX_attribute_group_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute_group`=`PREFIX_attribute_group`.`id_attribute_group`), + (SELECT tl.`public_name` + FROM `PREFIX_attribute_group_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute_group`=`PREFIX_attribute_group`.`id_attribute_group`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_attribute_group`); + +INSERT IGNORE INTO `PREFIX_attribute_lang` (`id_attribute`, `id_lang`, `name`) + (SELECT `id_attribute`, id_lang, (SELECT tl.`name` + FROM `PREFIX_attribute_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute`=`PREFIX_attribute`.`id_attribute`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_attribute`); + +INSERT IGNORE INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`) + (SELECT `id_carrier`, id_lang, (SELECT tl.`delay` + FROM `PREFIX_carrier_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_carrier`=`PREFIX_carrier`.`id_carrier`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_carrier`); + +INSERT IGNORE INTO `PREFIX_contact_lang` (`id_contact`, `id_lang`, `name`, `description`) + (SELECT `id_contact`, id_lang, (SELECT tl.`name` + FROM `PREFIX_contact_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_contact`=`PREFIX_contact`.`id_contact`), + (SELECT tl.`description` + FROM `PREFIX_contact_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_contact`=`PREFIX_contact`.`id_contact`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_contact`); + +INSERT IGNORE INTO `PREFIX_discount_lang` (`id_discount`, `id_lang`, `description`) + (SELECT `id_discount`, id_lang, (SELECT tl.`description` + FROM `PREFIX_discount_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount`=`PREFIX_discount`.`id_discount`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount`); + +INSERT IGNORE INTO `PREFIX_discount_type_lang` (`id_discount_type`, `id_lang`, `name`) + (SELECT `id_discount_type`, id_lang, (SELECT tl.`name` + FROM `PREFIX_discount_type_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount_type`=`PREFIX_discount_type`.`id_discount_type`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount_type`); + +INSERT IGNORE INTO `PREFIX_feature_lang` (`id_feature`, `id_lang`, `name`) + (SELECT `id_feature`, id_lang, (SELECT tl.`name` + FROM `PREFIX_feature_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_feature`=`PREFIX_feature`.`id_feature`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_feature`); + +INSERT IGNORE INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`) + (SELECT `id_feature_value`, id_lang, (SELECT tl.`value` + FROM `PREFIX_feature_value_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_feature_value`=`PREFIX_feature_value`.`id_feature_value`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_feature_value`); + +INSERT IGNORE INTO `PREFIX_image_lang` (`id_image`, `id_lang`, `legend`) + (SELECT `id_image`, id_lang, (SELECT tl.`legend` + FROM `PREFIX_image_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_image`=`PREFIX_image`.`id_image`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_image`); + +INSERT IGNORE INTO `PREFIX_manufacturer_lang` (`id_manufacturer`, `id_lang`, `description`) + (SELECT `id_manufacturer`, id_lang, (SELECT tl.`description` + FROM `PREFIX_manufacturer_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_manufacturer`=`PREFIX_manufacturer`.`id_manufacturer`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_manufacturer`); + +INSERT IGNORE INTO `PREFIX_order_return_state_lang` (`id_order_return_state`, `id_lang`, `name`) + (SELECT `id_order_return_state`, id_lang, (SELECT tl.`name` + FROM `PREFIX_order_return_state_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_return_state`=`PREFIX_order_return_state`.`id_order_return_state`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_return_state`); + +INSERT IGNORE INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) + (SELECT `id_order_state`, id_lang, (SELECT tl.`name` + FROM `PREFIX_order_state_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_state`=`PREFIX_order_state`.`id_order_state`), + (SELECT tl.`template` + FROM `PREFIX_order_state_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_state`=`PREFIX_order_state`.`id_order_state`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_state`); + +INSERT IGNORE INTO `PREFIX_profile_lang` (`id_profile`, `id_lang`, `name`) + (SELECT `id_profile`, id_lang, (SELECT tl.`name` + FROM `PREFIX_profile_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_profile`=`PREFIX_profile`.`id_profile`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_profile`); + +INSERT IGNORE INTO `PREFIX_supplier_lang` (`id_supplier`, `id_lang`, `description`) + (SELECT `id_supplier`, id_lang, (SELECT tl.`description` + FROM `PREFIX_supplier_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_supplier`=`PREFIX_supplier`.`id_supplier`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_supplier`); + +INSERT IGNORE INTO `PREFIX_tax_lang` (`id_tax`, `id_lang`, `name`) + (SELECT `id_tax`, id_lang, (SELECT tl.`name` + FROM `PREFIX_tax_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_tax`=`PREFIX_tax`.`id_tax`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_tax`); + +/* products */ +INSERT IGNORE INTO `PREFIX_product_lang` (`id_product`, `id_lang`, `description`, `description_short`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`, `availability`) + (SELECT `id_product`, id_lang, + (SELECT tl.`description` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`description_short` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`link_rewrite` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`meta_description` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`meta_keywords` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`meta_title` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`name` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`), + (SELECT tl.`availability` + FROM `PREFIX_product_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_product`); + +/* categories */ +INSERT IGNORE INTO `PREFIX_category_lang` (`id_category`, `id_lang`, `description`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`) + (SELECT `id_category`, id_lang, + (SELECT tl.`description` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`), + (SELECT tl.`link_rewrite` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`), + (SELECT tl.`meta_description` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`), + (SELECT tl.`meta_keywords` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`), + (SELECT tl.`meta_title` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`), + (SELECT tl.`name` + FROM `PREFIX_category_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_category`); + + + +/* NEW TABS */ + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminReturn', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReturn' LIMIT 1), + 'Merchandise returns (RMAs)' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Retours produit' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminReturn') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReturn' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminSlip', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSlip' LIMIT 1), + 'Credit slips' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Avoirs' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSlip') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSlip' LIMIT 1), 1, 1, 1, 1); + + +/* CONFIGURATION VARIABLE */ +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ORDER_RETURN', '0', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ORDER_RETURN_NB_DAYS', '7', NOW(), NOW()); +UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED' WHERE name = 'PS_FO_PROTOCOL'; +UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED', value = 0 WHERE name = 'PS_SSL_ENABLED' AND value = 'http://'; +UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED', value = 1 WHERE name = 'PS_SSL_ENABLED' AND value = 'https://'; + diff --git a/install-dev/sql/upgrade/1.0.0.4.sql b/install-dev/sql/upgrade/1.0.0.4.sql new file mode 100644 index 000000000..1d5697ce5 --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.4.sql @@ -0,0 +1,88 @@ +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_order_detail + ADD product_ean13 VARCHAR(13) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER product_price; +ALTER TABLE PREFIX_order_detail + ADD product_quantity_return INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER product_quantity; + +ALTER TABLE PREFIX_state + ADD tax_behavior SMALLINT(1) NOT NULL DEFAULT 0 AFTER iso_code; + +ALTER TABLE PREFIX_product + ADD reduction_from DATE NOT NULL AFTER reduction_percent; +ALTER TABLE PREFIX_product + ADD reduction_to DATE NOT NULL AFTER reduction_from; + +ALTER TABLE PREFIX_range_weight + ADD id_carrier INTEGER UNSIGNED DEFAULT NULL AFTER id_range_weight; +ALTER TABLE PREFIX_range_weight + DROP INDEX range_weight_index, + ADD UNIQUE range_weight_unique (delimiter1, delimiter2, id_carrier); +ALTER TABLE PREFIX_range_price + ADD id_carrier INTEGER UNSIGNED DEFAULT NULL AFTER id_range_price; +ALTER TABLE PREFIX_range_price + DROP INDEX range_price_index, + ADD UNIQUE range_price_unique (delimiter1, delimiter2, id_carrier); + +/* CONTENTS */ +/* One request per insert, if one die, other can be inserted */ +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('adminCustomers', 'Display in Back-Office, tab AdminCustomers', 'Launch modules when the tab AdminCustomers is displayed on back-office.', 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('createAccount', 'Successful customer create account', 'Called when new customer create account successfuled', 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('customerAccount', 'Customer account page display in front office', 'Called when a customer access to his account.', 1); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('orderSlip', 'Called when a order slip is created', 'Called when a quantity of one product change in an order.', 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('productTab', 'Tabs on product page', 'Called on order product page tabs', 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('productTabContent', 'Content of tabs on product page', 'Called on order product page tabs', 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('shoppingCart', 'Shopping cart footer', 'Display some specific informations on the shopping cart page', 0); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_MAIL_TYPE', '3', NOW(), NOW()); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TOKEN_ENABLE', '0', NOW(), NOW()); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_GIFT_WRAPPING_PRICE', '0', NOW(), NOW()); + +/* NEW RANGES */ + +INSERT IGNORE INTO PREFIX_range_price ( id_carrier, delimiter1, delimiter2 ) + (SELECT c.id_carrier, rp.delimiter1, rp.delimiter2 + FROM PREFIX_range_price rp + CROSS JOIN PREFIX_carrier c + WHERE c.deleted = 0 + AND c.active = 1 + ); + +UPDATE `PREFIX_delivery` d SET d.`id_range_price` = ( + SELECT rw.`id_range_price` FROM `PREFIX_range_price` rw WHERE + rw.`id_carrier` = d.`id_carrier` AND + rw.`delimiter1` = ( + SELECT `delimiter1` FROM `PREFIX_range_price` rw2 WHERE rw2.`id_range_price` = d.`id_range_price` LIMIT 1 + ) AND + rw.`delimiter2` = ( + SELECT `delimiter2` FROM `PREFIX_range_price` rw3 WHERE rw3.`id_range_price` = d.`id_range_price` LIMIT 1 + ) +); + +INSERT IGNORE INTO PREFIX_range_weight ( id_carrier, delimiter1, delimiter2 ) + (SELECT c.id_carrier, rp.delimiter1, rp.delimiter2 + FROM PREFIX_range_weight rp + CROSS JOIN PREFIX_carrier c + WHERE c.deleted = 0 + AND c.active = 1 + ); + +UPDATE `PREFIX_delivery` d SET d.`id_range_weight` = ( + SELECT rw.`id_range_weight` FROM `PREFIX_range_weight` rw WHERE + rw.`id_carrier` = d.`id_carrier` AND + rw.`delimiter1` = ( + SELECT `delimiter1` FROM `PREFIX_range_weight` rw2 WHERE rw2.`id_range_weight` = d.`id_range_weight` LIMIT 1 + ) AND + rw.`delimiter2` = ( + SELECT `delimiter2` FROM `PREFIX_range_weight` rw3 WHERE rw3.`id_range_weight` = d.`id_range_weight` LIMIT 1 + ) +); + +DELETE FROM PREFIX_range_price WHERE id_carrier IS NULL; +DELETE FROM PREFIX_range_weight WHERE id_carrier IS NULL; + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/1.0.0.5.sql b/install-dev/sql/upgrade/1.0.0.5.sql new file mode 100644 index 000000000..de1edb4bd --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.5.sql @@ -0,0 +1,35 @@ +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_orders + ADD total_wrapping DECIMAL(10,2) NOT NULL DEFAULT 0 AFTER total_shipping; + +ALTER TABLE PREFIX_carrier + ADD range_behavior TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER shipping_handling; + +ALTER TABLE PREFIX_order_detail + ADD product_supplier_reference VARCHAR(32) NULL AFTER product_reference; + +ALTER TABLE PREFIX_product + ADD supplier_reference VARCHAR(32) NULL AFTER reference; + +ALTER TABLE PREFIX_product_attribute + ADD supplier_reference VARCHAR(32) NULL AFTER reference; + +ALTER TABLE PREFIX_customer + ADD UNIQUE customer_email(email(128)); + +ALTER TABLE PREFIX_product_download + ADD active TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER nb_downloadable; + + +/* CONTENTS */ +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('createAccountForm', 'Customer account creation form', 'Display some information on the form to create a customer account', 1); + +INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES +('Română (Romanian)', 0, 'ro'), +('Νεοελληνική (Greek)', 0, 'gr'), +('Slovenčina (Slovak)', 0, 'sk'); + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/1.0.0.6.sql b/install-dev/sql/upgrade/1.0.0.6.sql new file mode 100644 index 000000000..b2eb0806c --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.6.sql @@ -0,0 +1,11 @@ +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_order_detail + CHANGE product_price product_price DECIMAL(13, 6) NOT NULL DEFAULT '0.000000'; + + +/* CONTENTS */ + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/1.0.0.7.sql b/install-dev/sql/upgrade/1.0.0.7.sql new file mode 100644 index 000000000..d7b148ca6 --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.7.sql @@ -0,0 +1,21 @@ +/* PHP */ +/* PHP:AttributeGroup::cleanDeadCombinations(); */; + +/* STRUCTURE */ +SET NAMES 'utf8'; + +ALTER TABLE PREFIX_order_detail + ADD product_quantity_discount DECIMAL(13,6) NOT NULL DEFAULT 0 AFTER product_price; +ALTER TABLE PREFIX_country + ADD deleted TINYINT(1) NOT NULL DEFAULT 0; + + +/* CONTENTS */ + +INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES +('Norsk (Norwegian)', 0, 'no'), +('ภาษาไทย (Thai)', 0, 'th'), +('Dansk (Danish)', 0, 'dk'); + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/1.0.0.8.sql b/install-dev/sql/upgrade/1.0.0.8.sql new file mode 100644 index 000000000..254c4f0dc --- /dev/null +++ b/install-dev/sql/upgrade/1.0.0.8.sql @@ -0,0 +1,17 @@ +/* PHP */ +/* PHP:AttributeGroup::cleanDeadCombinations(); */; + +/* STRUCTURE */ +SET NAMES 'utf8'; + +/* CONTENTS */ + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_DISP_UNAVAILABLE_ATTR', '1', NOW(), NOW()); + +INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES +('Svenska (Swedish)', 0, 'se'), +('עברית (Hebrew)', 0, 'he'); + +/* CONFIGURATION VARIABLE */ + diff --git a/install-dev/sql/upgrade/1.1.0.1.sql b/install-dev/sql/upgrade/1.1.0.1.sql new file mode 100644 index 000000000..c00a3176e --- /dev/null +++ b/install-dev/sql/upgrade/1.1.0.1.sql @@ -0,0 +1,629 @@ +/* PHP */ +/* PHP:AttributeGroup::cleanDeadCombinations(); */; +/* PHP:configuration_double_cleaner(); */; + +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ +DROP TABLE IF EXISTS PREFIX_gender; +DROP TABLE IF EXISTS PREFIX_search; +ALTER TABLE PREFIX_category_lang + ADD INDEX category_name (name); +ALTER TABLE PREFIX_order_detail + MODIFY COLUMN product_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; +ALTER TABLE PREFIX_order_detail + ADD deleted TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE PREFIX_configuration + MODIFY COLUMN name VARCHAR(32) NOT NULL UNIQUE; +ALTER TABLE PREFIX_orders + ADD invoice_number INTEGER(10) UNSIGNED NOT NULL DEFAULT 0 AFTER total_wrapping; +ALTER TABLE PREFIX_orders + ADD delivery_number INTEGER(10) UNSIGNED NOT NULL DEFAULT 0 AFTER invoice_number; +ALTER TABLE PREFIX_orders + ADD invoice_date DATETIME NOT NULL AFTER delivery_number; +ALTER TABLE PREFIX_orders + ADD delivery_date DATETIME NOT NULL AFTER invoice_date; +ALTER TABLE PREFIX_order_detail + CHANGE product_price product_price DECIMAL(13, 6) NOT NULL DEFAULT 0.000000; +ALTER TABLE PREFIX_order_slip + ADD shipping_cost TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER id_order; +ALTER TABLE PREFIX_order_state + ADD delivery TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER logable; +ALTER TABLE PREFIX_country + DROP deleted; +ALTER TABLE PREFIX_product + ADD customizable BOOL NOT NULL DEFAULT 0 AFTER quantity_discount; +ALTER TABLE PREFIX_product + ADD uploadable_files TINYINT NOT NULL DEFAULT 0 AFTER customizable; +ALTER TABLE PREFIX_product + ADD text_fields TINYINT NOT NULL DEFAULT 0 AFTER uploadable_files; +ALTER TABLE PREFIX_product_lang + CHANGE availability available_now VARCHAR(255) NULL; +ALTER TABLE PREFIX_product_lang + ADD available_later VARCHAR(255) NULL AFTER available_now; +ALTER TABLE PREFIX_access + DROP id_access; +ALTER TABLE PREFIX_access + DROP INDEX access_profile; +ALTER TABLE PREFIX_access + DROP INDEX access_tab; +ALTER TABLE PREFIX_access + ADD PRIMARY KEY(id_profile, id_tab); +ALTER TABLE PREFIX_currency + ADD blank TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER sign; +ALTER TABLE PREFIX_currency + ADD decimals TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER format; +ALTER TABLE PREFIX_product_attribute + ADD wholesale_price decimal(13,6) NOT NULL DEFAULT 0.000000 AFTER ean13; +ALTER TABLE PREFIX_employee + ADD last_passwd_gen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER passwd; +ALTER TABLE PREFIX_customer + ADD last_passwd_gen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER passwd; +ALTER TABLE PREFIX_customer + ADD ip_registration_newsletter VARCHAR(15) NULL DEFAULT NULL AFTER newsletter; +ALTER TABLE PREFIX_image_type + ADD scenes TINYINT(1) NOT NULL DEFAULT 1; +ALTER TABLE PREFIX_image_lang + CHANGE legend legend VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; + +/* CMS */ +CREATE TABLE PREFIX_cms ( + id_cms INTEGER UNSIGNED NOT NULL auto_increment, + PRIMARY KEY (id_cms) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_cms_lang ( + id_cms INTEGER UNSIGNED NOT NULL auto_increment, + id_lang INTEGER UNSIGNED NOT NULL, + meta_title VARCHAR(128) NOT NULL, + meta_description VARCHAR(255) DEFAULT NULL, + meta_keywords VARCHAR(255) DEFAULT NULL, + content longtext NULL, + link_rewrite VARCHAR(128) NOT NULL, + PRIMARY KEY (id_cms, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_block_cms ( + id_block INTEGER(10) NOT NULL, + id_cms INTEGER(10) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* PAYMENT MODULE RESTRICTIONS */ +CREATE TABLE `PREFIX_module_country` ( + `id_module` INTEGER UNSIGNED NOT NULL, + `id_country` INTEGER UNSIGNED NOT NULL, + PRIMARY KEY (`id_module`, `id_country`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module_currency` ( + `id_module` INTEGER UNSIGNED NOT NULL, + `id_currency` INTEGER NOT NULL, + PRIMARY KEY (`id_module`, `id_currency`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* ORDER-MESSAGE */ +CREATE TABLE PREFIX_order_message +( + id_order_message int(10) unsigned NOT NULL auto_increment, + date_add datetime NOT NULL, + PRIMARY KEY (id_order_message) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_order_message_lang +( + id_order_message int(10) unsigned NOT NULL, + id_lang int(10) unsigned NOT NULL, + name varchar(128) NOT NULL, + message text NOT NULL, + PRIMARY KEY (id_order_message,id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* SUB-DOMAINS */ +CREATE TABLE PREFIX_subdomain ( + id_subdomain INTEGER(10) NOT NULL AUTO_INCREMENT, + name VARCHAR(16) NOT NULL, + PRIMARY KEY(id_subdomain) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* META-CLASS */ +CREATE TABLE PREFIX_meta ( + id_meta INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + page VARCHAR(64) NOT NULL, + PRIMARY KEY(id_meta), + KEY `meta_name` (`page`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_meta_lang ( + id_meta INTEGER UNSIGNED NOT NULL, + id_lang INTEGER UNSIGNED NOT NULL, + title VARCHAR(255) NULL, + description VARCHAR(255) NULL, + keywords VARCHAR(255) NULL, + PRIMARY KEY (id_meta, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_discount_category ( + id_discount INTEGER(11) NOT NULL, + id_category INTEGER(11) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* Customized products */ +CREATE TABLE PREFIX_customization ( + id_customization int(10) NOT NULL AUTO_INCREMENT, + id_product_attribute int(10) NOT NULL DEFAULT 0, + id_cart int(10) NOT NULL, + id_product int(10) NOT NULL, + PRIMARY KEY(id_customization, id_cart, id_product) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_customized_data ( + id_customization int(10) NOT NULL, + `type` tinyint(1) NOT NULL, + `index` int(3) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY(id_customization, `type`, `index`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_customization_field ( + id_customization_field int(10) NOT NULL AUTO_INCREMENT, + id_product int(10) NOT NULL, + type tinyint(1) NOT NULL, + required tinyint(1) NOT NULL, + PRIMARY KEY(id_customization_field) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_customization_field_lang ( + id_customization_field int(10) NOT NULL, + id_lang int(10) NOT NULL, + name varchar(255) NOT NULL, + PRIMARY KEY(id_customization_field, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* Product location */ +ALTER TABLE `PREFIX_product_attribute` ADD `location` VARCHAR(64) NULL AFTER `supplier_reference`; +ALTER TABLE `PREFIX_product` ADD `location` VARCHAR(64) NULL AFTER `supplier_reference`; + +/* Paypal default e-mail fix */ +UPDATE `PREFIX_configuration` SET value = 'paypal@prestashop.com' WHERE name = 'PAYPAL_BUSINESS' AND value = 'your-address@paypal.com'; + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ +INSERT INTO PREFIX_subdomain (id_subdomain, name) VALUES (NULL, 'www'); +UPDATE PREFIX_currency SET blank = 1 WHERE iso_code = 'EUR'; +UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 3; +UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 4; +UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 5; + +/* IMAGE MAPPING */ +UPDATE PREFIX_image_type SET scenes = 0; +INSERT INTO `PREFIX_image_type` (`name` ,`width` ,`height` ,`products` ,`categories` ,`manufacturers` ,`suppliers` ,`scenes`) VALUES ('large_scene', '556', '200', '0', '0', '0', '0', '1'); +INSERT INTO `PREFIX_image_type` (`name` ,`width` ,`height` ,`products` ,`categories` ,`manufacturers` ,`suppliers` ,`scenes`) VALUES ('thumb_scene', '161', '58', '0', '0', '0', '0', '1'); + +/* CONFIGURATION VARIABLE */ +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_INVOICE', '1', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_INVOICE_PREFIX', 'IN', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_DELIVERY_PREFIX', 'DE', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_MAX_SIZE', '131072', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_WIDTH', '64', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_HEIGHT', '64', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PASSWD_TIME_BACK', '360', NOW(), NOW()); +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PASSWD_TIME_FRONT', '360', NOW(), NOW()); + +INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_INVOICE_PREFIX' LIMIT 1), 1, 'IN', NOW()); +INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_INVOICE_PREFIX' LIMIT 1), 2, 'FA', NOW()); +INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_DELIVERY_PREFIX' LIMIT 1), 1, 'DE', NOW()); +INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_DELIVERY_PREFIX' LIMIT 1), 2, 'LI', NOW()); + +/* HOOKS/MODULES */ +UPDATE PREFIX_hook SET description = 'This hook is called when a product is deleted' WHERE name = 'deleteProduct' LIMIT 1; +UPDATE PREFIX_hook SET name = 'extraLeft', title = 'Extra actions on the product page (left column).' WHERE name = 'extra' LIMIT 1; +INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('orderReturn', 'Product returned', 0, 'When an order return is made'); +INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('postUpdateOrderStatus', 'Post Order\'s status update event', 0, 'Launch modules when the order\'s status was changed (enables automated workflow).'); +INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('productActions', 'Product actions', 1, 'Put new action buttons on product page'); +INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('cancelProduct', 'Product cancelled', 0, 'This hook is called when you cancel a product in an order'); +INSERT INTO PREFIX_hook (name, title, position) VALUES ('backOfficeHome', 'Administration panel homepage', 1); +INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('extraRight', 'Extra actions on the product page (right column).', 0, NULL); +UPDATE PREFIX_hook SET position = 1 WHERE name = 'top'; +UPDATE PREFIX_hook SET position = 0 WHERE name = 'header'; + +/* ORDER MESSAGES */ +INSERT INTO `PREFIX_order_message` (`id_order_message`, `date_add`) VALUES (1, NOW()); +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 1, 'Delay', 'Hi, + +Unfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery. +Please accept our apologies and rest assured that we are working hard to rectify this. + +Best regards, +'); +INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES +(1, 2, 'Délai', 'Bonjour, + +Un des éléments de votre commande est actuellement en réapprovisionnement, ce qui peut légèrement retarder son envoi. + +Merci de votre compréhension. + +Cordialement, +'); + +/* META */ +INSERT INTO `PREFIX_meta` (`id_meta`, `page`) VALUES +(1, '404'), +(2, 'best-sales'), +(3, 'contact-form'), +(4, 'index'), +(5, 'manufacturer'), +(6, 'new-products'), +(7, 'password'), +(8, 'prices-drop'), +(9, 'sitemap'), +(10, 'supplier'); + +INSERT INTO `PREFIX_meta_lang` (`id_meta`, `id_lang`, `title`, `description`, `keywords`) VALUES +(1, 1, '404 error', 'This page cannot be found', 'error, 404, not found'), +(1, 2, 'Erreur 404', 'Cette page est introuvable', 'erreur, 404, introuvable'), +(2, 1, 'Best sales', 'Our best sales', 'best sales'), +(2, 2, 'Meilleurs ventes', 'Liste de nos produits les mieux vendus', 'meilleurs ventes'), +(3, 1, 'Contact us', 'Use our form to contact us', 'contact, form, e-mail'), +(3, 2, 'Contactez-nous', 'Utilisez notre formulaire pour nous contacter', 'contact, formulaire, e-mail'), +(4, 1, '', 'Shop powered by PrestaShop', 'shop, prestashop'), +(4, 2, '', 'Boutique propulsé par PrestaShop', 'boutique, prestashop'), +(5, 1, 'Manufacturers', 'Manufacturers list', 'manufacturer'), +(5, 2, 'Fabricants', 'Liste de nos fabricants', 'fabricants'), +(6, 1, 'New products', 'Our new products', 'new, products'), +(6, 2, 'Nouveaux produits', 'Liste de nos nouveaux produits', 'nouveau, produit'), +(7, 1, 'Forgot your password', 'Enter your e-mail address used to register in goal to get e-mail with your new password', 'forgot, password, e-mail, new, reset'), +(7, 2, 'Mot de passe oublié', 'Renseignez votre adresse e-mail afin de recevoir votre nouveau mot de passe.', 'mot de passe, oublié, e-mail, nouveau, regénération'), +(8, 1, 'Specials', 'Our special products', 'special, prices drop'), +(8, 2, 'Promotions', 'Nos produits en promotion', 'promotion, réduction'), +(9, 1, 'Sitemap', 'Lost ? Find what your are looking for', 'sitemap'), +(9, 2, 'Plan du site', 'Perdu ? Trouvez ce que vous cherchez', 'plan, site'), +(10, 1, 'Suppliers', 'Suppliers list', 'supplier'), +(10, 2, 'Fournisseurs', 'Liste de nos fournisseurs', 'fournisseurs'); + +/* CMS */ +INSERT INTO `PREFIX_cms` VALUES (1),(2),(3),(4),(5); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(1, 1, 'Delivery', 'Our terms and conditions of delivery', 'conditions, delivery, delay, shipment, pack', '

    Shipments and returns

    Your pack shipment

    Packages are generally dispatched within 2 days after receipt of payment and are shipped via Colissimo with tracking and drop-off without signature. If you prefer delivery by Colissimo Extra with required signature, an additional cost will be applied, so please contact us before choosing this method. Whichever shipment choice you make, we will provide you with a link to track your package online.

    Shipping fees include handling and packing fees as well as postage costs. Handling fees are fixed, whereas transport fees vary according to total weight of the shipment. We advise you to group your items in one order. We cannot group two distinct orders placed separately, and shipping fees will apply to each of them. Your package will be dispatched at your own risk, but special care is taken to protect fragile objects.

    Boxes are amply sized and your items are well-protected.

    ', 'delivery'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(1, 2, 'Livraison', 'Nos conditions générales de livraison', 'conditions, livraison, délais, transport, colis', '

    Livraisons et retours

    Le transport de votre colis

    Les colis sont généralement expédiés en 48h après réception de votre paiement. Le mode d''expédidition standard est le Colissimo suivi, remis sans signature. Si vous souhaitez une remise avec signature, un coût supplémentaire s''applique, merci de nous contacter. Quel que soit le mode d''expédition choisi, nous vous fournirons dès que possible un lien qui vous permettra de suivre en ligne la livraison de votre colis.

    Les frais d''expédition comprennent l''emballage, la manutention et les frais postaux. Ils peuvent contenir une partie fixe et une partie variable en fonction du prix ou du poids de votre commande. Nous vous conseillons de regrouper vos achats en une unique commande. Nous ne pouvons pas grouper deux commandes distinctes et vous devrez vous acquitter des frais de port pour chacune d''entre elles. Votre colis est expédié à vos propres risques, un soin particulier est apporté au colis contenant des produits fragiles..

    Les colis sont surdimensionnés et protégés.

    ', 'livraison'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(2, 1, 'Legal Notice', 'Legal notice', 'notice, legal, credits', '

    Legal

    Credits

    Concept and production:

    This Web site was created using PrestaShop™ open-source software.

    ', 'legal-notice'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(2, 2, 'Mentions légales', 'Mentions légales', 'mentions, légales, crédits', '

    Mentions légales

    Crédits

    Concept et production :

    Ce site internet a été réalisé en utilisant la solution open-source PrestaShop™ .

    ', 'mentions-legales'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(3, 1, 'Terms and conditions of use', 'Our terms and conditions of use', 'conditions, terms, use, sell', '

    Your terms and conditions of use

    Rule 1

    Here is the rule 1 content

    \r\n

    Rule 2

    Here is the rule 2 content

    \r\n

    Rule 3

    Here is the rule 3 content

    ', 'terms-and-conditions-of-use'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(3, 2, 'Conditions d''utilisation', 'Nos conditions générales de ventes', 'conditions, utilisation, générales, ventes', '

    Vos conditions de ventes

    Règle n°1

    Contenu de la règle numéro 1

    \r\n

    Règle n°2

    Contenu de la règle numéro 2

    \r\n

    Règle n°3

    Contenu de la règle numéro 3

    ', 'conditions-generales-de-ventes'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(4, 1, 'About us', 'Learn more about us', 'about us, informations', '

    About us

    \r\n

    Our company

    Our company

    \r\n

    Our team

    Our team

    \r\n

    Informations

    Informations

    ', 'about-us'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(4, 2, 'A propos', 'Apprenez-en d''avantage sur nous', 'à propos, informations', '

    A propos

    \r\n

    Notre entreprise

    Notre entreprise

    \r\n

    Notre équipe

    Notre équipe

    \r\n

    Informations

    Informations

    ', 'a-propos'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(5, 1, 'Secure payment', 'Our secure payment mean', 'secure payment, ssl, visa, mastercard, paypal', '

    Secure payment

    \r\n

    Our secure payment

    With SSL

    \r\n

    Using Visa/Mastercard/Paypal

    About this services

    ', 'secure-payment'); +INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES +(5, 2, 'Paiement sécurisé', 'Notre offre de paiement sécurisé', 'paiement sécurisé, ssl, visa, mastercard, paypal', '

    Paiement sécurisé

    \r\n

    Notre offre de paiement sécurisé

    Avec SSL

    \r\n

    Utilisation de Visa/Mastercard/Paypal

    A propos de ces services

    ', 'paiement-securise'); + +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockvariouslinks' LIMIT 1), 0), 3); +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockvariouslinks' LIMIT 1), 0), 4); +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 1); +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 2); +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 3); +INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 4); +DELETE FROM PREFIX_block_cms WHERE id_block = 0; + +/* NEW TABS */ +UPDATE PREFIX_tab_lang + SET name = 'Vouchers' + WHERE id_lang = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'en' LIMIT 1) + AND id_tab = (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminDiscounts' LIMIT 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminCMS', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCMS' LIMIT 1), + 'CMS' FROM PREFIX_lang); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCMS' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminSubDomains', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSubDomains' LIMIT 1), + 'Subdomains' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Sous domaines' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSubDomains') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSubDomains' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminOrderMessage', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminOrderMessage' LIMIT 1), + 'Order messages' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Messages prédéfinis' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminOrderMessage') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminOrderMessage' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminDeliverySlip', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminDeliverySlip' LIMIT 1), + 'Delivery slips' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Bons de livraison' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminDeliverySlip') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminDeliverySlip' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminBackup', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminBackup' LIMIT 1), + 'Database backup' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Sauvegarde BDD' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminBackup') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminBackup' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminMeta', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMeta' LIMIT 1), + 'Meta-tags' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Méta-Tags' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminMeta') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMeta' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp), 'AdminScenes', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminScenes' LIMIT 1), + 'Image mapping' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Scènes' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminScenes') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminScenes' LIMIT 1), 1, 1, 1, 1); + +/* NEW TEAM TAB */ +UPDATE PREFIX_tab SET position = 10 WHERE class_name = 'AdminTools'; +UPDATE PREFIX_tab SET position = 9 WHERE class_name = 'AdminPreferences'; +UPDATE PREFIX_tab SET position = 8, id_parent = 0 WHERE class_name = 'AdminEmployees'; +UPDATE PREFIX_tab SET position = 1, id_parent = 29 WHERE class_name = 'AdminProfiles'; +UPDATE PREFIX_tab SET position = 2, id_parent = 29 WHERE class_name = 'AdminAccess'; +UPDATE PREFIX_tab SET position = 3, id_parent = 29 WHERE class_name = 'AdminContacts'; +UPDATE PREFIX_tab SET position = 1 WHERE class_name = 'AdminLanguages'; +UPDATE PREFIX_tab SET position = 2 WHERE class_name = 'AdminTranslations'; +UPDATE PREFIX_tab SET position = 3 WHERE class_name = 'AdminTabs'; +UPDATE PREFIX_tab SET position = 4 WHERE class_name = 'AdminQuickAccesses'; +UPDATE PREFIX_tab SET position = 5 WHERE class_name = 'AdminAliases'; +UPDATE PREFIX_tab SET position = 6 WHERE class_name = 'AdminImport'; +UPDATE PREFIX_tab SET position = 7 WHERE class_name = 'AdminSubDomains'; + +/* UPDATE ORDER TABS */ +UPDATE PREFIX_tab SET class_name = 'AdminInvoices' WHERE class_name = 'AdminPrintPDF'; +UPDATE PREFIX_tab SET position = 1 WHERE class_name = 'AdminInvoices'; +UPDATE PREFIX_tab SET position = 2 WHERE class_name = 'AdminReturn'; +UPDATE PREFIX_tab SET position = 3 WHERE class_name = 'AdminSlip'; +UPDATE PREFIX_tab SET position = 4 WHERE class_name = 'AdminOrdersStates'; +UPDATE PREFIX_tab_lang SET name = 'Invoices' WHERE name = 'PDF Invoice'; +UPDATE PREFIX_tab_lang SET name = 'Factures' WHERE name = 'Facture PDF'; + +/* ##################################### */ +/* STATS */ +/* ##################################### */ +CREATE TABLE PREFIX_web_browser ( + id_web_browser INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(64) NULL, + PRIMARY KEY(id_web_browser) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_operating_system ( + id_operating_system INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(64) NULL, + PRIMARY KEY(id_operating_system) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_page_type ( + id_page_type INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(256) NOT NULL, + PRIMARY KEY(id_page_type) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_date_range ( + id_date_range INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + time_start DATETIME NOT NULL, + time_end DATETIME NOT NULL, + PRIMARY KEY(id_date_range) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_page ( + id_page INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + id_page_type INTEGER(10) UNSIGNED NOT NULL, + id_object VARCHAR(256) NULL, + PRIMARY KEY(id_page) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_page_viewed ( + id_page INTEGER(10) UNSIGNED NOT NULL, + id_date_range INTEGER UNSIGNED NOT NULL, + counter INTEGER UNSIGNED NOT NULL, + PRIMARY KEY(id_page, id_date_range) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_guest ( + id_guest INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + id_operating_system INTEGER(10) UNSIGNED NULL DEFAULT NULL, + id_web_browser INTEGER(10) UNSIGNED NULL DEFAULT NULL, + id_customer INTEGER(10) UNSIGNED NULL DEFAULT NULL, + javascript BOOL NULL DEFAULT 0, + screen_resolution_x SMALLINT UNSIGNED NULL DEFAULT NULL, + screen_resolution_y SMALLINT UNSIGNED NULL DEFAULT NULL, + screen_color TINYINT UNSIGNED NULL DEFAULT NULL, + sun_java BOOL NULL DEFAULT NULL, + adobe_flash BOOL NULL DEFAULT NULL, + adobe_director BOOL NULL DEFAULT NULL, + apple_quicktime BOOL NULL DEFAULT NULL, + real_player BOOL NULL DEFAULT NULL, + windows_media BOOL NULL DEFAULT NULL, + accept_language VARCHAR(8) NULL DEFAULT NULL, + PRIMARY KEY(id_guest) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_scene` ( + `id_scene` int(10) NOT NULL auto_increment, + `active` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_scene`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_scene_category` ( + `id_scene` int(10) NOT NULL, + `id_category` int(10) NOT NULL, + PRIMARY KEY (`id_scene`,`id_category`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_scene_lang` ( + `id_scene` int(10) NOT NULL, + `id_lang` int(10) NOT NULL, + `name` varchar(100) NOT NULL, + PRIMARY KEY (`id_scene`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_scene_products` ( + `id_scene` int(10) NOT NULL, + `id_product` int(10) NOT NULL, + `x_axis` int(4) NOT NULL, + `y_axis` int(4) NOT NULL, + `zone_width` int(3) NOT NULL, + `zone_height` int(3) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO PREFIX_guest (id_customer) SELECT id_customer FROM PREFIX_customer; + +ALTER TABLE PREFIX_connections ADD id_guest INTEGER(10) UNSIGNED NULL AFTER id_connections; +ALTER TABLE PREFIX_connections ADD id_page INTEGER(10) UNSIGNED NOT NULL AFTER id_guest; +ALTER TABLE PREFIX_connections ADD http_referer VARCHAR(256) NULL; +ALTER TABLE PREFIX_connections CHANGE date date_add DATETIME NOT NULL; + +UPDATE PREFIX_connections, PREFIX_guest SET PREFIX_connections.id_guest=PREFIX_guest.id_guest WHERE PREFIX_connections.id_customer=PREFIX_guest.id_customer; +ALTER TABLE PREFIX_connections CHANGE id_guest id_guest INTEGER(10) UNSIGNED NOT NULL; +ALTER TABLE PREFIX_connections DROP id_customer; + +CREATE TABLE PREFIX_connections_page ( + id_connections INTEGER(10) UNSIGNED NOT NULL, + id_page INTEGER(10) UNSIGNED NOT NULL, + time_start DATETIME NOT NULL, + time_end DATETIME NULL, + PRIMARY KEY(id_connections, id_page, time_start) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_operating_system` (`name`) VALUES ('Windows XP'),('Windows Vista'),('MacOsX'),('Linux'); +INSERT INTO `PREFIX_web_browser` (`name`) VALUES ('Safari'),('Firefox 2.x'),('Firefox 3.x'),('Opera'),('IE 6.x'),('IE 7.x'),('IE 8.x'),('Google Chrome'); +INSERT INTO `PREFIX_page_type` (`name`) VALUES ('product.php'),('category.php'),('order.php'),('manufacturer.php'); + +INSERT INTO `PREFIX_hook` (`name`, `title`, `position`) VALUES +('AdminStatsModules', 'Stats - Modules', 1), +('GraphEngine', 'Graph Engines', 0), +('GridEngine', 'Grid Engines', 0); + +/* Temporary configuration variable used in the following query */ +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('TMP_ID_TAB_STATS', (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStats'), NOW(), NOW()); +INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES + ((SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS'), 'AdminStatsModules', 1); +INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES + ((SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS'), 'AdminStatsConf', 2); +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES + (1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 'Modules'); +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES + (2, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 'Modules'); +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES + (1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 'Settings'); +INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES + (2, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 'Configuration'); +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES + (1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 1, 1, 1, 1); +INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES + (1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 1, 1, 1, 1); +DELETE FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS'; + +/* ##################################### */ +/* DOUBLE LANGUAGE */ +/* ##################################### */ +INSERT IGNORE INTO `PREFIX_discount_type_lang` (`id_discount_type`, `id_lang`, `name`) + (SELECT `id_discount_type`, id_lang, (SELECT tl.`name` + FROM `PREFIX_discount_type_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount_type`=`PREFIX_discount_type`.`id_discount_type`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount_type`); + +INSERT IGNORE INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `content`) + (SELECT `id_cms`, id_lang, + (SELECT tl.`link_rewrite` + FROM `PREFIX_cms_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`), + (SELECT tl.`meta_description` + FROM `PREFIX_cms_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`), + (SELECT tl.`meta_keywords` + FROM `PREFIX_cms_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`), + (SELECT tl.`meta_title` + FROM `PREFIX_cms_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`), + (SELECT tl.`content` + FROM `PREFIX_cms_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_cms`); + +INSERT IGNORE INTO `PREFIX_meta_lang` (`id_meta`, `id_lang`, `description`, `keywords`, `title`) + (SELECT `id_meta`, id_lang, + (SELECT tl.`description` + FROM `PREFIX_meta_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`), + (SELECT tl.`keywords` + FROM `PREFIX_meta_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`), + (SELECT tl.`title` + FROM `PREFIX_meta_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_meta`); + +INSERT IGNORE INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) + (SELECT `id_order_message`, id_lang, + (SELECT tl.`name` + FROM `PREFIX_order_message_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_message`=`PREFIX_order_message`.`id_order_message`), + (SELECT tl.`message` + FROM `PREFIX_order_message_lang` tl + WHERE tl.`id_lang` = (SELECT c.`value` + FROM `PREFIX_configuration` c + WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_message`=`PREFIX_order_message`.`id_order_message`) + FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_message`); + +/* PHP */ +/* PHP:invoice_number_set(); */; +/* PHP:delivery_number_set(); */; +/* PHP:set_payment_module(); */; +/* PHP:set_discount_category(); */; diff --git a/install-dev/sql/upgrade/1.1.0.2.sql b/install-dev/sql/upgrade/1.1.0.2.sql new file mode 100644 index 000000000..ee56776c5 --- /dev/null +++ b/install-dev/sql/upgrade/1.1.0.2.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +/* ##################################### */ diff --git a/install-dev/sql/upgrade/1.1.0.3.sql b/install-dev/sql/upgrade/1.1.0.3.sql new file mode 100644 index 000000000..5fb70c0ab --- /dev/null +++ b/install-dev/sql/upgrade/1.1.0.3.sql @@ -0,0 +1,10 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +DROP TABLE IF EXISTS PREFIX_product_picture; + +/* PHP */ +/* PHP:moduleReinstaller('blockmyaccount'); */; diff --git a/install-dev/sql/upgrade/1.1.0.4.sql b/install-dev/sql/upgrade/1.1.0.4.sql new file mode 100644 index 000000000..1bd039324 --- /dev/null +++ b/install-dev/sql/upgrade/1.1.0.4.sql @@ -0,0 +1,28 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE PREFIX_order_detail + DROP `deleted`, + ADD product_quantity_cancelled INT(10) UNSIGNED NOT NULL AFTER product_quantity_return; + +ALTER TABLE PREFIX_customization ADD quantity INT(10) NOT NULL; + +ALTER TABLE PREFIX_order_return_detail ADD id_customization INT(10) NOT NULL DEFAULT 0 AFTER id_order_detail; +ALTER TABLE PREFIX_order_return_detail DROP PRIMARY KEY; +ALTER TABLE PREFIX_order_return_detail ADD PRIMARY KEY (id_order_return, id_order_detail, id_customization); + + +ALTER TABLE PREFIX_orders + CHANGE payment payment VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + CHANGE module module VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; + +/* ################################# */ +/* CONTENTS */ +/* ################################# */ + +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('productOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1), + ('updateProductAttribute', 'Product attribute update', NULL, 1); diff --git a/install-dev/sql/upgrade/1.1.0.5.sql b/install-dev/sql/upgrade/1.1.0.5.sql new file mode 100644 index 000000000..08b08b3a5 --- /dev/null +++ b/install-dev/sql/upgrade/1.1.0.5.sql @@ -0,0 +1,20 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE PREFIX_product + CHANGE customizable customizable TINYINT(2) NOT NULL DEFAULT 0; +ALTER TABLE PREFIX_connections + CHANGE ip_address ip_address VARCHAR(16) NULL; +ALTER TABLE PREFIX_customer + ADD newsletter_date_add DATETIME NULL; +ALTER TABLE PREFIX_cart_product + ADD date_add DATETIME NOT NULL; + +/* ################################# */ +/* CONTENTS */ +/* ################################# */ + +/* PHP:add_required_customization_field_flag(); */; diff --git a/install-dev/sql/upgrade/1.2.0.1.sql b/install-dev/sql/upgrade/1.2.0.1.sql new file mode 100644 index 000000000..08ca93240 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.1.sql @@ -0,0 +1,1078 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +DROP TABLE IF EXISTS PREFIX_order_customization_return; + +ALTER TABLE PREFIX_cart + ADD id_guest INT UNSIGNED NULL AFTER id_customer; + +ALTER TABLE PREFIX_tab + ADD `module` varchar(64) NULL AFTER class_name; + +ALTER TABLE PREFIX_product + ADD `indexed` tinyint(1) NOT NULL default '0' AFTER `active`; + +ALTER TABLE PREFIX_orders + DROP INDEX `orders_customer`; +ALTER TABLE PREFIX_orders + ADD INDEX id_customer (id_customer); +ALTER TABLE PREFIX_orders + ADD valid INTEGER(1) UNSIGNED NOT NULL DEFAULT '0' AFTER delivery_date; +ALTER TABLE PREFIX_orders + ADD INDEX `id_cart` (`id_cart`); + +ALTER TABLE PREFIX_customer + ADD deleted TINYINT(1) NOT NULL DEFAULT '0' AFTER active; + +ALTER TABLE PREFIX_employee + ADD stats_date_to DATE NULL DEFAULT NULL AFTER last_passwd_gen; +ALTER TABLE PREFIX_employee + ADD stats_date_from DATE NULL DEFAULT NULL AFTER last_passwd_gen; + +ALTER TABLE PREFIX_order_state + ADD hidden TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER unremovable; + +ALTER TABLE PREFIX_carrier + ADD is_module TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER range_behavior; +ALTER TABLE PREFIX_carrier + ADD INDEX deleted (`deleted`, `active`); + +ALTER TABLE PREFIX_state + CHANGE iso_code `iso_code` char(4) NOT NULL; + +ALTER TABLE PREFIX_order_detail + CHANGE product_quantity_cancelled product_quantity_refunded INT(10) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE PREFIX_order_detail + ADD INDEX product_id (product_id); + +ALTER TABLE PREFIX_attribute_lang + ADD INDEX id_lang (`id_lang`, `name`); +ALTER TABLE PREFIX_attribute_lang + ADD INDEX id_lang_2 (`id_lang`); +ALTER TABLE PREFIX_attribute_lang + ADD INDEX id_attribute (`id_attribute`); + +ALTER TABLE PREFIX_block_cms + ADD PRIMARY KEY (`id_block`, `id_cms`); + +ALTER TABLE PREFIX_connections + CHANGE `http_referer` `http_referer` VARCHAR(255) DEFAULT NULL; +ALTER TABLE PREFIX_connections + ADD INDEX `date_add` (`date_add`); + +ALTER TABLE PREFIX_customer + DROP INDEX `customer_email`; +ALTER TABLE PREFIX_customer + ADD UNIQUE `customer_email` (`email`); + +ALTER TABLE PREFIX_delivery + ADD INDEX id_zone (`id_zone`); +ALTER TABLE PREFIX_delivery + ADD INDEX id_carrier (`id_carrier`, `id_zone`); + +ALTER TABLE PREFIX_discount_category + ADD INDEX id_category (`id_category`); + +ALTER TABLE PREFIX_feature_product + ADD INDEX `id_feature` (`id_feature`); + +ALTER TABLE PREFIX_hook_module + DROP INDEX `hook_module_index`; +ALTER TABLE PREFIX_hook_module + ADD PRIMARY KEY (id_module,id_hook); +ALTER TABLE PREFIX_hook_module + ADD INDEX id_module (`id_module`); +ALTER TABLE PREFIX_hook_module + ADD INDEX id_hook (`id_hook`); + +ALTER TABLE PREFIX_module + CHANGE `active` `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; + +ALTER TABLE PREFIX_page + CHANGE `id_object` `id_object` INT UNSIGNED NULL DEFAULT NULL; +ALTER TABLE PREFIX_page + ADD INDEX `id_page_type` (`id_page_type`); +ALTER TABLE PREFIX_page + ADD INDEX `id_object` (`id_object`); + +ALTER TABLE PREFIX_page_type + CHANGE `name` `name` VARCHAR(255) NOT NULL; +ALTER TABLE PREFIX_page_type + ADD INDEX `name` (`name`); + +ALTER TABLE PREFIX_product_attribute + ADD INDEX reference (reference); +ALTER TABLE PREFIX_product_attribute + ADD INDEX supplier_reference (supplier_reference); + +ALTER TABLE PREFIX_product_lang + ADD INDEX id_product (id_product); +ALTER TABLE PREFIX_product_lang + ADD INDEX id_lang (id_lang); +ALTER TABLE PREFIX_product_lang + ADD INDEX `name` (`name`); +ALTER TABLE PREFIX_product_lang + ADD FULLTEXT KEY ftsname (`name`); + +ALTER TABLE PREFIX_cart_discount + ADD INDEX `id_discount` (`id_discount`); + +ALTER TABLE PREFIX_discount_category + ADD PRIMARY KEY (id_category,id_discount); + +ALTER TABLE PREFIX_image_lang + ADD INDEX id_image (id_image); + +ALTER TABLE PREFIX_range_price + CHANGE `delimiter1` `delimiter1` DECIMAL(13, 6) NOT NULL; +ALTER TABLE PREFIX_range_price + CHANGE `delimiter2` `delimiter2` DECIMAL(13, 6) NOT NULL; +ALTER TABLE PREFIX_range_price + CHANGE `id_carrier` `id_carrier` INT(10) UNSIGNED NOT NULL; +ALTER TABLE PREFIX_range_price + DROP INDEX `range_price_unique`; +ALTER TABLE PREFIX_range_price + ADD UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`); + +ALTER TABLE PREFIX_range_weight + CHANGE `delimiter1` `delimiter1` DECIMAL(13, 6) NOT NULL; +ALTER TABLE PREFIX_range_weight + CHANGE `delimiter2` `delimiter2` DECIMAL(13, 6) NOT NULL; +ALTER TABLE PREFIX_range_weight + CHANGE `id_carrier` `id_carrier` INT(10) UNSIGNED NOT NULL; +ALTER TABLE PREFIX_range_weight + DROP INDEX `range_weight_unique`; +ALTER TABLE PREFIX_range_weight + ADD UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`); + +ALTER TABLE PREFIX_scene_products + ADD PRIMARY KEY (`id_scene`, `id_product`, `x_axis`, `y_axis`); + +ALTER TABLE PREFIX_product_lang DROP INDEX fts; +ALTER TABLE PREFIX_product_lang DROP INDEX ftsname ; + +/* KEY management */ +ALTER TABLE PREFIX_attribute_lang DROP INDEX `id_lang_2`; +ALTER TABLE PREFIX_attribute_lang DROP INDEX `id_attribute`; +ALTER TABLE PREFIX_attribute_lang DROP INDEX `attribute_lang_index`, ADD PRIMARY KEY (`id_attribute`, `id_lang`); +ALTER TABLE PREFIX_carrier_zone DROP INDEX `carrier_zone_index`, ADD PRIMARY KEY (`id_carrier`, `id_zone`); +ALTER TABLE PREFIX_discount_category CHANGE `id_discount` `id_discount` int(11) NOT NULL AFTER `id_category`; +ALTER TABLE PREFIX_discount_category DROP INDEX `id_category`; +ALTER TABLE PREFIX_feature_product DROP INDEX `id_feature`; +ALTER TABLE PREFIX_hook_module DROP INDEX `id_module`; +ALTER TABLE PREFIX_image_lang DROP INDEX `id_image`; +ALTER TABLE PREFIX_product_lang DROP INDEX `id_product`; + +/* ############################################################ */ + +CREATE TABLE `PREFIX_customer_group` ( + `id_customer` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + PRIMARY KEY `customer_group_index` (`id_customer`,`id_group`), + INDEX customer_login(id_group) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_category_group ( + id_category INTEGER UNSIGNED NOT NULL, + id_group INTEGER UNSIGNED NOT NULL, + INDEX category_group_index(id_category, id_group) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_group` ( + id_group INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + reduction DECIMAL(10,2) NOT NULL DEFAULT 0, + date_add DATETIME NOT NULL, + date_upd DATETIME NOT NULL, + PRIMARY KEY(id_group) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_group_lang ( + id_group INTEGER UNSIGNED NOT NULL, + id_lang INTEGER UNSIGNED NOT NULL, + name VARCHAR(32) NOT NULL, + UNIQUE INDEX attribute_lang_index(id_group, id_lang) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_message_readed ( + id_message INTEGER UNSIGNED NOT NULL, + id_employee INTEGER UNSIGNED NOT NULL, + date_add DATETIME NOT NULL, + PRIMARY KEY (id_message,id_employee) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attachment` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `file` varchar(40) NOT NULL, + `mime` varchar(32) NOT NULL, + PRIMARY KEY (`id_attachment`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_attachment_lang` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) default NULL, + `description` TEXT, + PRIMARY KEY (`id_attachment`, `id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attachment` ( + `id_product` int(10) NOT NULL, + `id_attachment` int(10) NOT NULL, + PRIMARY KEY (`id_product`,`id_attachment`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_connections_source` ( + id_connections_source INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + id_connections INTEGER UNSIGNED NOT NULL, + http_referer VARCHAR(255) NULL, + request_uri VARCHAR(255) NULL, + keywords VARCHAR(255) NULL, + date_add DATETIME NOT NULL, + PRIMARY KEY (id_connections_source), + INDEX connections (id_connections), + INDEX orderby (date_add), + INDEX http_referer (`http_referer`), + INDEX request_uri(`request_uri`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_referrer` ( + `id_referrer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `passwd` varchar(32) default NULL, + `http_referer_regexp` varchar(64) default NULL, + `http_referer_like` varchar(64) default NULL, + `request_uri_regexp` varchar(64) default NULL, + `request_uri_like` varchar(64) default NULL, + `http_referer_regexp_not` varchar(64) default NULL, + `http_referer_like_not` varchar(64) default NULL, + `request_uri_regexp_not` varchar(64) default NULL, + `request_uri_like_not` varchar(64) default NULL, + `base_fee` decimal(5,2) NOT NULL default '0.00', + `percent_fee` decimal(5,2) NOT NULL default '0.00', + `click_fee` decimal(5,2) NOT NULL default '0.00', + `cache_visitors` int(11) default NULL, + `cache_visits` int(11) default NULL, + `cache_pages` int(11) default NULL, + `cache_registrations` int(11) default NULL, + `cache_orders` int(11) default NULL, + `cache_sales` decimal(10,2) default NULL, + `cache_reg_rate` decimal(5,4) default NULL, + `cache_order_rate` decimal(5,4) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_referrer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_referrer_cache` ( + `id_connections_source` int(11) NOT NULL, + `id_referrer` int(11) NOT NULL, + PRIMARY KEY (`id_connections_source`, `id_referrer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_search_engine` ( + id_search_engine INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + server VARCHAR(64) NOT NULL, + getvar VARCHAR(16) NOT NULL, + PRIMARY KEY(id_search_engine) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_module_group` ( + `id_module` INTEGER UNSIGNED NOT NULL, + `id_group` INTEGER NOT NULL, + PRIMARY KEY (`id_module`, `id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_attribute_image` ( + `id_product_attribute` int(10) NOT NULL, + `id_image` int(10) NOT NULL, + PRIMARY KEY (`id_product_attribute`,`id_image`), + KEY `id_image` (`id_image`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_search_index` ( + `id_product` int(11) NOT NULL, + `id_word` int(11) NOT NULL, + `weight` tinyint(4) NOT NULL default '1', + PRIMARY KEY (`id_word`, `id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_search_word` ( + `id_word` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `word` varchar(15) NOT NULL, + PRIMARY KEY (`id_word`), + UNIQUE KEY `id_lang` (`id_lang`,`word`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE PREFIX_timezone ( + id_timezone INTEGER UNSIGNED NOT NULL auto_increment, + name VARCHAR(32) NOT NULL, + PRIMARY KEY timezone_index(`id_timezone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +INSERT INTO `PREFIX_order_state` (`id_order_state`, `invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`) VALUES + (11, 0, 0, 'lightblue', 1, 0, 0); + +INSERT INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) VALUES + (11, 1, 'Awaiting PayPal payment', ''); +INSERT INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) VALUES + (11, 2, 'En attente du paiement par PayPal', ''); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_MINWORDLEN', '3', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_PNAME', '6', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_REF', '10', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_SHORTDESC', '1', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_DESC', '1', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_CNAME', '3', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_MNAME', '3', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_TAG', '4', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_ATTRIBUTE', '2', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_WEIGHT_FEATURE', '2', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_SEARCH_AJAX', '1', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('PS_TIMEZONE', '374', NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES + ('BLOCKTAGS_NBR', '10', NOW(), NOW()); + +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('extraCarrier', 'Extra carrier (module mode)', NULL, 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('shoppingCartExtra', 'Shopping cart extra button', 'Display some specific informations', 1); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('search', 'Search', NULL, 0); +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('backBeforePayment', 'Redirect in order process', 'Redirect user to the module instead of displaying payment modules', 0); + +UPDATE PREFIX_orders o SET o.valid = IFNULL(( + SELECT os.logable + FROM PREFIX_order_history oh + LEFT JOIN PREFIX_order_state os ON os.id_order_state = oh.id_order_state + WHERE oh.id_order = o.id_order + ORDER BY oh.date_add DESC, oh.id_order_history DESC + LIMIT 1 +), 0); + +INSERT INTO `PREFIX_search_engine` (`id_search_engine`, `server`,`getvar`) VALUES + (1, 'google','q'), + (2, 'search.aol','query'), + (3, 'yandex.ru','text'), + (4, 'ask.com','q'), + (5, 'nhl.com','q'), + (6, 'search.yahoo','p'), + (7, 'baidu.com','wd'), + (8, 'search.lycos','query'), + (9, 'exalead','q'), + (10, 'search.live.com','q'), + (11, 'search.ke.voila','rdata'), + (12, 'altavista','q') + ON DUPLICATE KEY UPDATE server = server; + +/* GROUPS, CUSTOMERS GROUPS, & CATEGORY GROUPS */ +INSERT INTO `PREFIX_group` (`reduction`, `date_add`, `date_upd`) VALUES (0, NOW(), NOW()); +INSERT INTO `PREFIX_group_lang` (`id_lang`, `id_group`, `name`) ( + SELECT `id_lang`, + (SELECT `id_group` FROM `PREFIX_group` LIMIT 1), + 'Default' FROM `PREFIX_lang`); +UPDATE `PREFIX_group_lang` SET `name` = 'Défaut' + WHERE `id_group` = (SELECT `id_group` FROM `PREFIX_group` LIMIT 1) + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO `PREFIX_customer_group` (`id_customer`, `id_group`) + (SELECT `id_customer`, + (SELECT `id_group` FROM `PREFIX_group` LIMIT 1) FROM `PREFIX_customer`); +INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) + (SELECT `id_category`, + (SELECT `id_group` FROM `PREFIX_group` LIMIT 1) FROM `PREFIX_category`); + +/* NEW TABS */ +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminMessages', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMessages' LIMIT 1), + 'Customer messages' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Messages clients' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminMessages') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMessages' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp), 'AdminTracking', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminTracking' LIMIT 1), + 'Tracking' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Suivi' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminTracking') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminTracking' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminStats' LIMIT 1) AS tmp), 'AdminSearchEngines', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminStats' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearchEngines' LIMIT 1), + 'Search Engines' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Moteurs de recherche' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSearchEngines') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearchEngines' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminStats' LIMIT 1) AS tmp), 'AdminReferrers', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminStats' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReferrers' LIMIT 1), + 'Referrers' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Sites affluents' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminReferrers') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReferrers' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCustomers' LIMIT 1) AS tmp), 'AdminGroups', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCustomers' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminGroups' LIMIT 1), + 'Groups' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Groupes' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminGroups') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminGroups' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminGenerator', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminGenerator' LIMIT 1), + 'Generator' FROM PREFIX_lang); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminGenerator' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCustomers' LIMIT 1) AS tmp), 'AdminCarts', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCustomers' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCarts' LIMIT 1), + 'Carts' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Paniers' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminCarts') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCarts' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp), 'AdminTags', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminTags' LIMIT 1), + 'Tags' FROM PREFIX_lang); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminTags' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminSearchConf', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearchConf' LIMIT 1), + 'Search' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Recherche' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSearchConf') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearchConf' LIMIT 1), 1, 1, 1, 1); + +INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp), 'AdminAttachments', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp )) AS tmp)); +INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) ( + SELECT id_lang, + (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminAttachments' LIMIT 1), + 'Attachments' FROM PREFIX_lang); +UPDATE `PREFIX_tab_lang` SET `name` = 'Documents joints' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAttachments') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); +INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminAttachments' LIMIT 1), 1, 1, 1, 1); + +/* CHANGE TABS */ +UPDATE `PREFIX_tab` SET `class_name` = 'AdminStatuses' WHERE `class_name` = 'AdminOrdersStates'; +UPDATE `PREFIX_tab_lang` SET `name` = 'Statuses' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminStatuses') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'en'); +UPDATE `PREFIX_tab_lang` SET `name` = 'Statuts' + WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminStatuses') + AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr'); + +INSERT INTO PREFIX_product_attribute_image (id_image, id_product_attribute) (SELECT id_image, id_product_attribute FROM PREFIX_product_attribute); +/* ALTER query must stay here (right after the INSERT INTO PREFIX_product_attribute_image)! */ +ALTER TABLE PREFIX_product_attribute DROP id_image; + +UPDATE PREFIX_category_lang SET link_rewrite = 'home' WHERE id_category = 1; + +/* TIMEZONES */ + +INSERT INTO `PREFIX_timezone` (`id_timezone`, `name`) VALUES +(1, 'Africa/Abidjan'), +(2, 'Africa/Accra'), +(3, 'Africa/Addis_Ababa'), +(4, 'Africa/Algiers'), +(5, 'Africa/Asmara'), +(6, 'Africa/Asmera'), +(7, 'Africa/Bamako'), +(8, 'Africa/Bangui'), +(9, 'Africa/Banjul'), +(10, 'Africa/Bissau'), +(11, 'Africa/Blantyre'), +(12, 'Africa/Brazzaville'), +(13, 'Africa/Bujumbura'), +(14, 'Africa/Cairo'), +(15, 'Africa/Casablanca'), +(16, 'Africa/Ceuta'), +(17, 'Africa/Conakry'), +(18, 'Africa/Dakar'), +(19, 'Africa/Dar_es_Salaam'), +(20, 'Africa/Djibouti'), +(21, 'Africa/Douala'), +(22, 'Africa/El_Aaiun'), +(23, 'Africa/Freetown'), +(24, 'Africa/Gaborone'), +(25, 'Africa/Harare'), +(26, 'Africa/Johannesburg'), +(27, 'Africa/Kampala'), +(28, 'Africa/Khartoum'), +(29, 'Africa/Kigali'), +(30, 'Africa/Kinshasa'), +(31, 'Africa/Lagos'), +(32, 'Africa/Libreville'), +(33, 'Africa/Lome'), +(34, 'Africa/Luanda'), +(35, 'Africa/Lubumbashi'), +(36, 'Africa/Lusaka'), +(37, 'Africa/Malabo'), +(38, 'Africa/Maputo'), +(39, 'Africa/Maseru'), +(40, 'Africa/Mbabane'), +(41, 'Africa/Mogadishu'), +(42, 'Africa/Monrovia'), +(43, 'Africa/Nairobi'), +(44, 'Africa/Ndjamena'), +(45, 'Africa/Niamey'), +(46, 'Africa/Nouakchott'), +(47, 'Africa/Ouagadougou'), +(48, 'Africa/Porto-Novo'), +(49, 'Africa/Sao_Tome'), +(50, 'Africa/Timbuktu'), +(51, 'Africa/Tripoli'), +(52, 'Africa/Tunis'), +(53, 'Africa/Windhoek'), +(54, 'America/Adak'), +(55, 'America/Anchorage '), +(56, 'America/Anguilla'), +(57, 'America/Antigua'), +(58, 'America/Araguaina'), +(59, 'America/Argentina/Buenos_Aires'), +(60, 'America/Argentina/Catamarca'), +(61, 'America/Argentina/ComodRivadavia'), +(62, 'America/Argentina/Cordoba'), +(63, 'America/Argentina/Jujuy'), +(64, 'America/Argentina/La_Rioja'), +(65, 'America/Argentina/Mendoza'), +(66, 'America/Argentina/Rio_Gallegos'), +(67, 'America/Argentina/Salta'), +(68, 'America/Argentina/San_Juan'), +(69, 'America/Argentina/San_Luis'), +(70, 'America/Argentina/Tucuman'), +(71, 'America/Argentina/Ushuaia'), +(72, 'America/Aruba'), +(73, 'America/Asuncion'), +(74, 'America/Atikokan'), +(75, 'America/Atka'), +(76, 'America/Bahia'), +(77, 'America/Barbados'), +(78, 'America/Belem'), +(79, 'America/Belize'), +(80, 'America/Blanc-Sablon'), +(81, 'America/Boa_Vista'), +(82, 'America/Bogota'), +(83, 'America/Boise'), +(84, 'America/Buenos_Aires'), +(85, 'America/Cambridge_Bay'), +(86, 'America/Campo_Grande'), +(87, 'America/Cancun'), +(88, 'America/Caracas'), +(89, 'America/Catamarca'), +(90, 'America/Cayenne'), +(91, 'America/Cayman'), +(92, 'America/Chicago'), +(93, 'America/Chihuahua'), +(94, 'America/Coral_Harbour'), +(95, 'America/Cordoba'), +(96, 'America/Costa_Rica'), +(97, 'America/Cuiaba'), +(98, 'America/Curacao'), +(99, 'America/Danmarkshavn'), +(100, 'America/Dawson'), +(101, 'America/Dawson_Creek'), +(102, 'America/Denver'), +(103, 'America/Detroit'), +(104, 'America/Dominica'), +(105, 'America/Edmonton'), +(106, 'America/Eirunepe'), +(107, 'America/El_Salvador'), +(108, 'America/Ensenada'), +(109, 'America/Fort_Wayne'), +(110, 'America/Fortaleza'), +(111, 'America/Glace_Bay'), +(112, 'America/Godthab'), +(113, 'America/Goose_Bay'), +(114, 'America/Grand_Turk'), +(115, 'America/Grenada'), +(116, 'America/Guadeloupe'), +(117, 'America/Guatemala'), +(118, 'America/Guayaquil'), +(119, 'America/Guyana'), +(120, 'America/Halifax'), +(121, 'America/Havana'), +(122, 'America/Hermosillo'), +(123, 'America/Indiana/Indianapolis'), +(124, 'America/Indiana/Knox'), +(125, 'America/Indiana/Marengo'), +(126, 'America/Indiana/Petersburg'), +(127, 'America/Indiana/Tell_City'), +(128, 'America/Indiana/Vevay'), +(129, 'America/Indiana/Vincennes'), +(130, 'America/Indiana/Winamac'), +(131, 'America/Indianapolis'), +(132, 'America/Inuvik'), +(133, 'America/Iqaluit'), +(134, 'America/Jamaica'), +(135, 'America/Jujuy'), +(136, 'America/Juneau'), +(137, 'America/Kentucky/Louisville'), +(138, 'America/Kentucky/Monticello'), +(139, 'America/Knox_IN'), +(140, 'America/La_Paz'), +(141, 'America/Lima'), +(142, 'America/Los_Angeles'), +(143, 'America/Louisville'), +(144, 'America/Maceio'), +(145, 'America/Managua'), +(146, 'America/Manaus'), +(147, 'America/Marigot'), +(148, 'America/Martinique'), +(149, 'America/Mazatlan'), +(150, 'America/Mendoza'), +(151, 'America/Menominee'), +(152, 'America/Merida'), +(153, 'America/Mexico_City'), +(154, 'America/Miquelon'), +(155, 'America/Moncton'), +(156, 'America/Monterrey'), +(157, 'America/Montevideo'), +(158, 'America/Montreal'), +(159, 'America/Montserrat'), +(160, 'America/Nassau'), +(161, 'America/New_York'), +(162, 'America/Nipigon'), +(163, 'America/Nome'), +(164, 'America/Noronha'), +(165, 'America/North_Dakota/Center'), +(166, 'America/North_Dakota/New_Salem'), +(167, 'America/Panama'), +(168, 'America/Pangnirtung'), +(169, 'America/Paramaribo'), +(170, 'America/Phoenix'), +(171, 'America/Port-au-Prince'), +(172, 'America/Port_of_Spain'), +(173, 'America/Porto_Acre'), +(174, 'America/Porto_Velho'), +(175, 'America/Puerto_Rico'), +(176, 'America/Rainy_River'), +(177, 'America/Rankin_Inlet'), +(178, 'America/Recife'), +(179, 'America/Regina'), +(180, 'America/Resolute'), +(181, 'America/Rio_Branco'), +(182, 'America/Rosario'), +(183, 'America/Santarem'), +(184, 'America/Santiago'), +(185, 'America/Santo_Domingo'), +(186, 'America/Sao_Paulo'), +(187, 'America/Scoresbysund'), +(188, 'America/Shiprock'), +(189, 'America/St_Barthelemy'), +(190, 'America/St_Johns'), +(191, 'America/St_Kitts'), +(192, 'America/St_Lucia'), +(193, 'America/St_Thomas'), +(194, 'America/St_Vincent'), +(195, 'America/Swift_Current'), +(196, 'America/Tegucigalpa'), +(197, 'America/Thule'), +(198, 'America/Thunder_Bay'), +(199, 'America/Tijuana'), +(200, 'America/Toronto'), +(201, 'America/Tortola'), +(202, 'America/Vancouver'), +(203, 'America/Virgin'), +(204, 'America/Whitehorse'), +(205, 'America/Winnipeg'), +(206, 'America/Yakutat'), +(207, 'America/Yellowknife'), +(208, 'Antarctica/Casey'), +(209, 'Antarctica/Davis'), +(210, 'Antarctica/DumontDUrville'), +(211, 'Antarctica/Mawson'), +(212, 'Antarctica/McMurdo'), +(213, 'Antarctica/Palmer'), +(214, 'Antarctica/Rothera'), +(215, 'Antarctica/South_Pole'), +(216, 'Antarctica/Syowa'), +(217, 'Antarctica/Vostok'), +(218, 'Arctic/Longyearbyen'), +(219, 'Asia/Aden'), +(220, 'Asia/Almaty'), +(221, 'Asia/Amman'), +(222, 'Asia/Anadyr'), +(223, 'Asia/Aqtau'), +(224, 'Asia/Aqtobe'), +(225, 'Asia/Ashgabat'), +(226, 'Asia/Ashkhabad'), +(227, 'Asia/Baghdad'), +(228, 'Asia/Bahrain'), +(229, 'Asia/Baku'), +(230, 'Asia/Bangkok'), +(231, 'Asia/Beirut'), +(232, 'Asia/Bishkek'), +(233, 'Asia/Brunei'), +(234, 'Asia/Calcutta'), +(235, 'Asia/Choibalsan'), +(236, 'Asia/Chongqing'), +(237, 'Asia/Chungking'), +(238, 'Asia/Colombo'), +(239, 'Asia/Dacca'), +(240, 'Asia/Damascus'), +(241, 'Asia/Dhaka'), +(242, 'Asia/Dili'), +(243, 'Asia/Dubai'), +(244, 'Asia/Dushanbe'), +(245, 'Asia/Gaza'), +(246, 'Asia/Harbin'), +(247, 'Asia/Ho_Chi_Minh'), +(248, 'Asia/Hong_Kong'), +(249, 'Asia/Hovd'), +(250, 'Asia/Irkutsk'), +(251, 'Asia/Istanbul'), +(252, 'Asia/Jakarta'), +(253, 'Asia/Jayapura'), +(254, 'Asia/Jerusalem'), +(255, 'Asia/Kabul'), +(256, 'Asia/Kamchatka'), +(257, 'Asia/Karachi'), +(258, 'Asia/Kashgar'), +(259, 'Asia/Kathmandu'), +(260, 'Asia/Katmandu'), +(261, 'Asia/Kolkata'), +(262, 'Asia/Krasnoyarsk'), +(263, 'Asia/Kuala_Lumpur'), +(264, 'Asia/Kuching'), +(265, 'Asia/Kuwait'), +(266, 'Asia/Macao'), +(267, 'Asia/Macau'), +(268, 'Asia/Magadan'), +(269, 'Asia/Makassar'), +(270, 'Asia/Manila'), +(271, 'Asia/Muscat'), +(272, 'Asia/Nicosia'), +(273, 'Asia/Novosibirsk'), +(274, 'Asia/Omsk'), +(275, 'Asia/Oral'), +(276, 'Asia/Phnom_Penh'), +(277, 'Asia/Pontianak'), +(278, 'Asia/Pyongyang'), +(279, 'Asia/Qatar'), +(280, 'Asia/Qyzylorda'), +(281, 'Asia/Rangoon'), +(282, 'Asia/Riyadh'), +(283, 'Asia/Saigon'), +(284, 'Asia/Sakhalin'), +(285, 'Asia/Samarkand'), +(286, 'Asia/Seoul'), +(287, 'Asia/Shanghai'), +(288, 'Asia/Singapore'), +(289, 'Asia/Taipei'), +(290, 'Asia/Tashkent'), +(291, 'Asia/Tbilisi'), +(292, 'Asia/Tehran'), +(293, 'Asia/Tel_Aviv'), +(294, 'Asia/Thimbu'), +(295, 'Asia/Thimphu'), +(296, 'Asia/Tokyo'), +(297, 'Asia/Ujung_Pandang'), +(298, 'Asia/Ulaanbaatar'), +(299, 'Asia/Ulan_Bator'), +(300, 'Asia/Urumqi'), +(301, 'Asia/Vientiane'), +(302, 'Asia/Vladivostok'), +(303, 'Asia/Yakutsk'), +(304, 'Asia/Yekaterinburg'), +(305, 'Asia/Yerevan'), +(306, 'Atlantic/Azores'), +(307, 'Atlantic/Bermuda'), +(308, 'Atlantic/Canary'), +(309, 'Atlantic/Cape_Verde'), +(310, 'Atlantic/Faeroe'), +(311, 'Atlantic/Faroe'), +(312, 'Atlantic/Jan_Mayen'), +(313, 'Atlantic/Madeira'), +(314, 'Atlantic/Reykjavik'), +(315, 'Atlantic/South_Georgia'), +(316, 'Atlantic/St_Helena'), +(317, 'Atlantic/Stanley'), +(318, 'Australia/ACT'), +(319, 'Australia/Adelaide'), +(320, 'Australia/Brisbane'), +(321, 'Australia/Broken_Hill'), +(322, 'Australia/Canberra'), +(323, 'Australia/Currie'), +(324, 'Australia/Darwin'), +(325, 'Australia/Eucla'), +(326, 'Australia/Hobart'), +(327, 'Australia/LHI'), +(328, 'Australia/Lindeman'), +(329, 'Australia/Lord_Howe'), +(330, 'Australia/Melbourne'), +(331, 'Australia/North'), +(332, 'Australia/NSW'), +(333, 'Australia/Perth'), +(334, 'Australia/Queensland'), +(335, 'Australia/South'), +(336, 'Australia/Sydney'), +(337, 'Australia/Tasmania'), +(338, 'Australia/Victoria'), +(339, 'Australia/West'), +(340, 'Australia/Yancowinna'), +(341, 'Europe/Amsterdam'), +(342, 'Europe/Andorra'), +(343, 'Europe/Athens'), +(344, 'Europe/Belfast'), +(345, 'Europe/Belgrade'), +(346, 'Europe/Berlin'), +(347, 'Europe/Bratislava'), +(348, 'Europe/Brussels'), +(349, 'Europe/Bucharest'), +(350, 'Europe/Budapest'), +(351, 'Europe/Chisinau'), +(352, 'Europe/Copenhagen'), +(353, 'Europe/Dublin'), +(354, 'Europe/Gibraltar'), +(355, 'Europe/Guernsey'), +(356, 'Europe/Helsinki'), +(357, 'Europe/Isle_of_Man'), +(358, 'Europe/Istanbul'), +(359, 'Europe/Jersey'), +(360, 'Europe/Kaliningrad'), +(361, 'Europe/Kiev'), +(362, 'Europe/Lisbon'), +(363, 'Europe/Ljubljana'), +(364, 'Europe/London'), +(365, 'Europe/Luxembourg'), +(366, 'Europe/Madrid'), +(367, 'Europe/Malta'), +(368, 'Europe/Mariehamn'), +(369, 'Europe/Minsk'), +(370, 'Europe/Monaco'), +(371, 'Europe/Moscow'), +(372, 'Europe/Nicosia'), +(373, 'Europe/Oslo'), +(374, 'Europe/Paris'), +(375, 'Europe/Podgorica'), +(376, 'Europe/Prague'), +(377, 'Europe/Riga'), +(378, 'Europe/Rome'), +(379, 'Europe/Samara'), +(380, 'Europe/San_Marino'), +(381, 'Europe/Sarajevo'), +(382, 'Europe/Simferopol'), +(383, 'Europe/Skopje'), +(384, 'Europe/Sofia'), +(385, 'Europe/Stockholm'), +(386, 'Europe/Tallinn'), +(387, 'Europe/Tirane'), +(388, 'Europe/Tiraspol'), +(389, 'Europe/Uzhgorod'), +(390, 'Europe/Vaduz'), +(391, 'Europe/Vatican'), +(392, 'Europe/Vienna'), +(393, 'Europe/Vilnius'), +(394, 'Europe/Volgograd'), +(395, 'Europe/Warsaw'), +(396, 'Europe/Zagreb'), +(397, 'Europe/Zaporozhye'), +(398, 'Europe/Zurich'), +(399, 'Indian/Antananarivo'), +(400, 'Indian/Chagos'), +(401, 'Indian/Christmas'), +(402, 'Indian/Cocos'), +(403, 'Indian/Comoro'), +(404, 'Indian/Kerguelen'), +(405, 'Indian/Mahe'), +(406, 'Indian/Maldives'), +(407, 'Indian/Mauritius'), +(408, 'Indian/Mayotte'), +(409, 'Indian/Reunion'), +(410, 'Pacific/Apia'), +(411, 'Pacific/Auckland'), +(412, 'Pacific/Chatham'), +(413, 'Pacific/Easter'), +(414, 'Pacific/Efate'), +(415, 'Pacific/Enderbury'), +(416, 'Pacific/Fakaofo'), +(417, 'Pacific/Fiji'), +(418, 'Pacific/Funafuti'), +(419, 'Pacific/Galapagos'), +(420, 'Pacific/Gambier'), +(421, 'Pacific/Guadalcanal'), +(422, 'Pacific/Guam'), +(423, 'Pacific/Honolulu'), +(424, 'Pacific/Johnston'), +(425, 'Pacific/Kiritimati'), +(426, 'Pacific/Kosrae'), +(427, 'Pacific/Kwajalein'), +(428, 'Pacific/Majuro'), +(429, 'Pacific/Marquesas'), +(430, 'Pacific/Midway'), +(431, 'Pacific/Nauru'), +(432, 'Pacific/Niue'), +(433, 'Pacific/Norfolk'), +(434, 'Pacific/Noumea'), +(435, 'Pacific/Pago_Pago'), +(436, 'Pacific/Palau'), +(437, 'Pacific/Pitcairn'), +(438, 'Pacific/Ponape'), +(439, 'Pacific/Port_Moresby'), +(440, 'Pacific/Rarotonga'), +(441, 'Pacific/Saipan'), +(442, 'Pacific/Samoa'), +(443, 'Pacific/Tahiti'), +(444, 'Pacific/Tarawa'), +(445, 'Pacific/Tongatapu'), +(446, 'Pacific/Truk'), +(447, 'Pacific/Wake'), +(448, 'Pacific/Wallis'), +(449, 'Pacific/Yap'), +(450, 'Brazil/Acre'), +(451, 'Brazil/DeNoronha'), +(452, 'Brazil/East'), +(453, 'Brazil/West'), +(454, 'Canada/Atlantic'), +(455, 'Canada/Central'), +(456, 'Canada/East-Saskatchewan'), +(457, 'Canada/Eastern'), +(458, 'Canada/Mountain'), +(459, 'Canada/Newfoundland'), +(460, 'Canada/Pacific'), +(461, 'Canada/Saskatchewan'), +(462, 'Canada/Yukon'), +(463, 'CET'), +(464, 'Chile/Continental'), +(465, 'Chile/EasterIsland'), +(466, 'CST6CDT'), +(467, 'Cuba'), +(468, 'EET'), +(469, 'Egypt'), +(470, 'Eire'), +(471, 'EST'), +(472, 'EST5EDT'), +(473, 'Etc/GMT'), +(474, 'Etc/GMT+0'), +(475, 'Etc/GMT+1'), +(476, 'Etc/GMT+10'), +(477, 'Etc/GMT+11'), +(478, 'Etc/GMT+12'), +(479, 'Etc/GMT+2'), +(480, 'Etc/GMT+3'), +(481, 'Etc/GMT+4'), +(482, 'Etc/GMT+5'), +(483, 'Etc/GMT+6'), +(484, 'Etc/GMT+7'), +(485, 'Etc/GMT+8'), +(486, 'Etc/GMT+9'), +(487, 'Etc/GMT-0'), +(488, 'Etc/GMT-1'), +(489, 'Etc/GMT-10'), +(490, 'Etc/GMT-11'), +(491, 'Etc/GMT-12'), +(492, 'Etc/GMT-13'), +(493, 'Etc/GMT-14'), +(494, 'Etc/GMT-2'), +(495, 'Etc/GMT-3'), +(496, 'Etc/GMT-4'), +(497, 'Etc/GMT-5'), +(498, 'Etc/GMT-6'), +(499, 'Etc/GMT-7'), +(500, 'Etc/GMT-8'), +(501, 'Etc/GMT-9'), +(502, 'Etc/GMT0'), +(503, 'Etc/Greenwich'), +(504, 'Etc/UCT'), +(505, 'Etc/Universal'), +(506, 'Etc/UTC'), +(507, 'Etc/Zulu'), +(508, 'Factory'), +(509, 'GB'), +(510, 'GB-Eire'), +(511, 'GMT'), +(512, 'GMT+0'), +(513, 'GMT-0'), +(514, 'GMT0'), +(515, 'Greenwich'), +(516, 'Hongkong'), +(517, 'HST'), +(518, 'Iceland'), +(519, 'Iran'), +(520, 'Israel'), +(521, 'Jamaica'), +(522, 'Japan'), +(523, 'Kwajalein'), +(524, 'Libya'), +(525, 'MET'), +(526, 'Mexico/BajaNorte'), +(527, 'Mexico/BajaSur'), +(528, 'Mexico/General'), +(529, 'MST'), +(530, 'MST7MDT'), +(531, 'Navajo'), +(532, 'NZ'), +(533, 'NZ-CHAT'), +(534, 'Poland'), +(535, 'Portugal'), +(536, 'PRC'), +(537, 'PST8PDT'), +(538, 'ROC'), +(539, 'ROK'), +(540, 'Singapore'), +(541, 'Turkey'), +(542, 'UCT'), +(543, 'Universal'), +(544, 'US/Alaska'), +(545, 'US/Aleutian'), +(546, 'US/Arizona'), +(547, 'US/Central'), +(548, 'US/East-Indiana'), +(549, 'US/Eastern'), +(550, 'US/Hawaii'), +(551, 'US/Indiana-Starke'), +(552, 'US/Michigan'), +(553, 'US/Mountain'), +(554, 'US/Pacific'), +(555, 'US/Pacific-New'), +(556, 'US/Samoa'), +(557, 'UTC'), +(558, 'W-SU'), +(559, 'WET'), +(560, 'Zulu'); + +/* PHP:blocknewsletter(); */; +/* PHP:set_payment_module_group(); */; diff --git a/install-dev/sql/upgrade/1.2.0.2.sql b/install-dev/sql/upgrade/1.2.0.2.sql new file mode 100644 index 000000000..605edb065 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.2.sql @@ -0,0 +1,610 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +CREATE TABLE `PREFIX_pack` ( + `id_product_pack` int(10) unsigned NOT NULL, + `id_product_item` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (`id_product_pack`,`id_product_item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_manufacturer_lang` + ADD `short_description` VARCHAR( 254 ) NULL DEFAULT NULL; +ALTER TABLE `PREFIX_manufacturer_lang` + ADD `meta_title` VARCHAR( 254 ) NULL DEFAULT NULL; +ALTER TABLE `PREFIX_manufacturer_lang` + ADD `meta_keywords` VARCHAR( 254 ) NULL DEFAULT NULL; +ALTER TABLE `PREFIX_manufacturer_lang` + ADD `meta_description` VARCHAR( 254 ) NULL DEFAULT NULL; + +ALTER TABLE `PREFIX_supplier_lang` + ADD `meta_title` VARCHAR( 254 ) NULL DEFAULT NULL; +ALTER TABLE `PREFIX_supplier_lang` + ADD `meta_keywords` VARCHAR( 254 ) NULL DEFAULT NULL; +ALTER TABLE `PREFIX_supplier_lang` + ADD `meta_description` VARCHAR( 254 ) NULL DEFAULT NULL; + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +TRUNCATE TABLE `PREFIX_timezone`; +INSERT INTO `PREFIX_timezone` (`name`) VALUES + ('Africa/Abidjan'), + ('Africa/Accra'), + ('Africa/Addis_Ababa'), + ('Africa/Algiers'), + ('Africa/Asmara'), + ('Africa/Asmera'), + ('Africa/Bamako'), + ('Africa/Bangui'), + ('Africa/Banjul'), + ('Africa/Bissau'), + ('Africa/Blantyre'), + ('Africa/Brazzaville'), + ('Africa/Bujumbura'), + ('Africa/Cairo'), + ('Africa/Casablanca'), + ('Africa/Ceuta'), + ('Africa/Conakry'), + ('Africa/Dakar'), + ('Africa/Dar_es_Salaam'), + ('Africa/Djibouti'), + ('Africa/Douala'), + ('Africa/El_Aaiun'), + ('Africa/Freetown'), + ('Africa/Gaborone'), + ('Africa/Harare'), + ('Africa/Johannesburg'), + ('Africa/Kampala'), + ('Africa/Khartoum'), + ('Africa/Kigali'), + ('Africa/Kinshasa'), + ('Africa/Lagos'), + ('Africa/Libreville'), + ('Africa/Lome'), + ('Africa/Luanda'), + ('Africa/Lubumbashi'), + ('Africa/Lusaka'), + ('Africa/Malabo'), + ('Africa/Maputo'), + ('Africa/Maseru'), + ('Africa/Mbabane'), + ('Africa/Mogadishu'), + ('Africa/Monrovia'), + ('Africa/Nairobi'), + ('Africa/Ndjamena'), + ('Africa/Niamey'), + ('Africa/Nouakchott'), + ('Africa/Ouagadougou'), + ('Africa/Porto-Novo'), + ('Africa/Sao_Tome'), + ('Africa/Timbuktu'), + ('Africa/Tripoli'), + ('Africa/Tunis'), + ('Africa/Windhoek'), + ('America/Adak'), + ('America/Anchorage '), + ('America/Anguilla'), + ('America/Antigua'), + ('America/Araguaina'), + ('America/Argentina/Buenos_Aires'), + ('America/Argentina/Catamarca'), + ('America/Argentina/ComodRivadavia'), + ('America/Argentina/Cordoba'), + ('America/Argentina/Jujuy'), + ('America/Argentina/La_Rioja'), + ('America/Argentina/Mendoza'), + ('America/Argentina/Rio_Gallegos'), + ('America/Argentina/Salta'), + ('America/Argentina/San_Juan'), + ('America/Argentina/San_Luis'), + ('America/Argentina/Tucuman'), + ('America/Argentina/Ushuaia'), + ('America/Aruba'), + ('America/Asuncion'), + ('America/Atikokan'), + ('America/Atka'), + ('America/Bahia'), + ('America/Barbados'), + ('America/Belem'), + ('America/Belize'), + ('America/Blanc-Sablon'), + ('America/Boa_Vista'), + ('America/Bogota'), + ('America/Boise'), + ('America/Buenos_Aires'), + ('America/Cambridge_Bay'), + ('America/Campo_Grande'), + ('America/Cancun'), + ('America/Caracas'), + ('America/Catamarca'), + ('America/Cayenne'), + ('America/Cayman'), + ('America/Chicago'), + ('America/Chihuahua'), + ('America/Coral_Harbour'), + ('America/Cordoba'), + ('America/Costa_Rica'), + ('America/Cuiaba'), + ('America/Curacao'), + ('America/Danmarkshavn'), + ('America/Dawson'), + ('America/Dawson_Creek'), + ('America/Denver'), + ('America/Detroit'), + ('America/Dominica'), + ('America/Edmonton'), + ('America/Eirunepe'), + ('America/El_Salvador'), + ('America/Ensenada'), + ('America/Fort_Wayne'), + ('America/Fortaleza'), + ('America/Glace_Bay'), + ('America/Godthab'), + ('America/Goose_Bay'), + ('America/Grand_Turk'), + ('America/Grenada'), + ('America/Guadeloupe'), + ('America/Guatemala'), + ('America/Guayaquil'), + ('America/Guyana'), + ('America/Halifax'), + ('America/Havana'), + ('America/Hermosillo'), + ('America/Indiana/Indianapolis'), + ('America/Indiana/Knox'), + ('America/Indiana/Marengo'), + ('America/Indiana/Petersburg'), + ('America/Indiana/Tell_City'), + ('America/Indiana/Vevay'), + ('America/Indiana/Vincennes'), + ('America/Indiana/Winamac'), + ('America/Indianapolis'), + ('America/Inuvik'), + ('America/Iqaluit'), + ('America/Jamaica'), + ('America/Jujuy'), + ('America/Juneau'), + ('America/Kentucky/Louisville'), + ('America/Kentucky/Monticello'), + ('America/Knox_IN'), + ('America/La_Paz'), + ('America/Lima'), + ('America/Los_Angeles'), + ('America/Louisville'), + ('America/Maceio'), + ('America/Managua'), + ('America/Manaus'), + ('America/Marigot'), + ('America/Martinique'), + ('America/Mazatlan'), + ('America/Mendoza'), + ('America/Menominee'), + ('America/Merida'), + ('America/Mexico_City'), + ('America/Miquelon'), + ('America/Moncton'), + ('America/Monterrey'), + ('America/Montevideo'), + ('America/Montreal'), + ('America/Montserrat'), + ('America/Nassau'), + ('America/New_York'), + ('America/Nipigon'), + ('America/Nome'), + ('America/Noronha'), + ('America/North_Dakota/Center'), + ('America/North_Dakota/New_Salem'), + ('America/Panama'), + ('America/Pangnirtung'), + ('America/Paramaribo'), + ('America/Phoenix'), + ('America/Port-au-Prince'), + ('America/Port_of_Spain'), + ('America/Porto_Acre'), + ('America/Porto_Velho'), + ('America/Puerto_Rico'), + ('America/Rainy_River'), + ('America/Rankin_Inlet'), + ('America/Recife'), + ('America/Regina'), + ('America/Resolute'), + ('America/Rio_Branco'), + ('America/Rosario'), + ('America/Santarem'), + ('America/Santiago'), + ('America/Santo_Domingo'), + ('America/Sao_Paulo'), + ('America/Scoresbysund'), + ('America/Shiprock'), + ('America/St_Barthelemy'), + ('America/St_Johns'), + ('America/St_Kitts'), + ('America/St_Lucia'), + ('America/St_Thomas'), + ('America/St_Vincent'), + ('America/Swift_Current'), + ('America/Tegucigalpa'), + ('America/Thule'), + ('America/Thunder_Bay'), + ('America/Tijuana'), + ('America/Toronto'), + ('America/Tortola'), + ('America/Vancouver'), + ('America/Virgin'), + ('America/Whitehorse'), + ('America/Winnipeg'), + ('America/Yakutat'), + ('America/Yellowknife'), + ('Antarctica/Casey'), + ('Antarctica/Davis'), + ('Antarctica/DumontDUrville'), + ('Antarctica/Mawson'), + ('Antarctica/McMurdo'), + ('Antarctica/Palmer'), + ('Antarctica/Rothera'), + ('Antarctica/South_Pole'), + ('Antarctica/Syowa'), + ('Antarctica/Vostok'), + ('Arctic/Longyearbyen'), + ('Asia/Aden'), + ('Asia/Almaty'), + ('Asia/Amman'), + ('Asia/Anadyr'), + ('Asia/Aqtau'), + ('Asia/Aqtobe'), + ('Asia/Ashgabat'), + ('Asia/Ashkhabad'), + ('Asia/Baghdad'), + ('Asia/Bahrain'), + ('Asia/Baku'), + ('Asia/Bangkok'), + ('Asia/Beirut'), + ('Asia/Bishkek'), + ('Asia/Brunei'), + ('Asia/Calcutta'), + ('Asia/Choibalsan'), + ('Asia/Chongqing'), + ('Asia/Chungking'), + ('Asia/Colombo'), + ('Asia/Dacca'), + ('Asia/Damascus'), + ('Asia/Dhaka'), + ('Asia/Dili'), + ('Asia/Dubai'), + ('Asia/Dushanbe'), + ('Asia/Gaza'), + ('Asia/Harbin'), + ('Asia/Ho_Chi_Minh'), + ('Asia/Hong_Kong'), + ('Asia/Hovd'), + ('Asia/Irkutsk'), + ('Asia/Istanbul'), + ('Asia/Jakarta'), + ('Asia/Jayapura'), + ('Asia/Jerusalem'), + ('Asia/Kabul'), + ('Asia/Kamchatka'), + ('Asia/Karachi'), + ('Asia/Kashgar'), + ('Asia/Kathmandu'), + ('Asia/Katmandu'), + ('Asia/Kolkata'), + ('Asia/Krasnoyarsk'), + ('Asia/Kuala_Lumpur'), + ('Asia/Kuching'), + ('Asia/Kuwait'), + ('Asia/Macao'), + ('Asia/Macau'), + ('Asia/Magadan'), + ('Asia/Makassar'), + ('Asia/Manila'), + ('Asia/Muscat'), + ('Asia/Nicosia'), + ('Asia/Novosibirsk'), + ('Asia/Omsk'), + ('Asia/Oral'), + ('Asia/Phnom_Penh'), + ('Asia/Pontianak'), + ('Asia/Pyongyang'), + ('Asia/Qatar'), + ('Asia/Qyzylorda'), + ('Asia/Rangoon'), + ('Asia/Riyadh'), + ('Asia/Saigon'), + ('Asia/Sakhalin'), + ('Asia/Samarkand'), + ('Asia/Seoul'), + ('Asia/Shanghai'), + ('Asia/Singapore'), + ('Asia/Taipei'), + ('Asia/Tashkent'), + ('Asia/Tbilisi'), + ('Asia/Tehran'), + ('Asia/Tel_Aviv'), + ('Asia/Thimbu'), + ('Asia/Thimphu'), + ('Asia/Tokyo'), + ('Asia/Ujung_Pandang'), + ('Asia/Ulaanbaatar'), + ('Asia/Ulan_Bator'), + ('Asia/Urumqi'), + ('Asia/Vientiane'), + ('Asia/Vladivostok'), + ('Asia/Yakutsk'), + ('Asia/Yekaterinburg'), + ('Asia/Yerevan'), + ('Atlantic/Azores'), + ('Atlantic/Bermuda'), + ('Atlantic/Canary'), + ('Atlantic/Cape_Verde'), + ('Atlantic/Faeroe'), + ('Atlantic/Faroe'), + ('Atlantic/Jan_Mayen'), + ('Atlantic/Madeira'), + ('Atlantic/Reykjavik'), + ('Atlantic/South_Georgia'), + ('Atlantic/St_Helena'), + ('Atlantic/Stanley'), + ('Australia/ACT'), + ('Australia/Adelaide'), + ('Australia/Brisbane'), + ('Australia/Broken_Hill'), + ('Australia/Canberra'), + ('Australia/Currie'), + ('Australia/Darwin'), + ('Australia/Eucla'), + ('Australia/Hobart'), + ('Australia/LHI'), + ('Australia/Lindeman'), + ('Australia/Lord_Howe'), + ('Australia/Melbourne'), + ('Australia/North'), + ('Australia/NSW'), + ('Australia/Perth'), + ('Australia/Queensland'), + ('Australia/South'), + ('Australia/Sydney'), + ('Australia/Tasmania'), + ('Australia/Victoria'), + ('Australia/West'), + ('Australia/Yancowinna'), + ('Europe/Amsterdam'), + ('Europe/Andorra'), + ('Europe/Athens'), + ('Europe/Belfast'), + ('Europe/Belgrade'), + ('Europe/Berlin'), + ('Europe/Bratislava'), + ('Europe/Brussels'), + ('Europe/Bucharest'), + ('Europe/Budapest'), + ('Europe/Chisinau'), + ('Europe/Copenhagen'), + ('Europe/Dublin'), + ('Europe/Gibraltar'), + ('Europe/Guernsey'), + ('Europe/Helsinki'), + ('Europe/Isle_of_Man'), + ('Europe/Istanbul'), + ('Europe/Jersey'), + ('Europe/Kaliningrad'), + ('Europe/Kiev'), + ('Europe/Lisbon'), + ('Europe/Ljubljana'), + ('Europe/London'), + ('Europe/Luxembourg'), + ('Europe/Madrid'), + ('Europe/Malta'), + ('Europe/Mariehamn'), + ('Europe/Minsk'), + ('Europe/Monaco'), + ('Europe/Moscow'), + ('Europe/Nicosia'), + ('Europe/Oslo'), + ('Europe/Paris'), + ('Europe/Podgorica'), + ('Europe/Prague'), + ('Europe/Riga'), + ('Europe/Rome'), + ('Europe/Samara'), + ('Europe/San_Marino'), + ('Europe/Sarajevo'), + ('Europe/Simferopol'), + ('Europe/Skopje'), + ('Europe/Sofia'), + ('Europe/Stockholm'), + ('Europe/Tallinn'), + ('Europe/Tirane'), + ('Europe/Tiraspol'), + ('Europe/Uzhgorod'), + ('Europe/Vaduz'), + ('Europe/Vatican'), + ('Europe/Vienna'), + ('Europe/Vilnius'), + ('Europe/Volgograd'), + ('Europe/Warsaw'), + ('Europe/Zagreb'), + ('Europe/Zaporozhye'), + ('Europe/Zurich'), + ('Indian/Antananarivo'), + ('Indian/Chagos'), + ('Indian/Christmas'), + ('Indian/Cocos'), + ('Indian/Comoro'), + ('Indian/Kerguelen'), + ('Indian/Mahe'), + ('Indian/Maldives'), + ('Indian/Mauritius'), + ('Indian/Mayotte'), + ('Indian/Reunion'), + ('Pacific/Apia'), + ('Pacific/Auckland'), + ('Pacific/Chatham'), + ('Pacific/Easter'), + ('Pacific/Efate'), + ('Pacific/Enderbury'), + ('Pacific/Fakaofo'), + ('Pacific/Fiji'), + ('Pacific/Funafuti'), + ('Pacific/Galapagos'), + ('Pacific/Gambier'), + ('Pacific/Guadalcanal'), + ('Pacific/Guam'), + ('Pacific/Honolulu'), + ('Pacific/Johnston'), + ('Pacific/Kiritimati'), + ('Pacific/Kosrae'), + ('Pacific/Kwajalein'), + ('Pacific/Majuro'), + ('Pacific/Marquesas'), + ('Pacific/Midway'), + ('Pacific/Nauru'), + ('Pacific/Niue'), + ('Pacific/Norfolk'), + ('Pacific/Noumea'), + ('Pacific/Pago_Pago'), + ('Pacific/Palau'), + ('Pacific/Pitcairn'), + ('Pacific/Ponape'), + ('Pacific/Port_Moresby'), + ('Pacific/Rarotonga'), + ('Pacific/Saipan'), + ('Pacific/Samoa'), + ('Pacific/Tahiti'), + ('Pacific/Tarawa'), + ('Pacific/Tongatapu'), + ('Pacific/Truk'), + ('Pacific/Wake'), + ('Pacific/Wallis'), + ('Pacific/Yap'), + ('Brazil/Acre'), + ('Brazil/DeNoronha'), + ('Brazil/East'), + ('Brazil/West'), + ('Canada/Atlantic'), + ('Canada/Central'), + ('Canada/East-Saskatchewan'), + ('Canada/Eastern'), + ('Canada/Mountain'), + ('Canada/Newfoundland'), + ('Canada/Pacific'), + ('Canada/Saskatchewan'), + ('Canada/Yukon'), + ('CET'), + ('Chile/Continental'), + ('Chile/EasterIsland'), + ('CST6CDT'), + ('Cuba'), + ('EET'), + ('Egypt'), + ('Eire'), + ('EST'), + ('EST5EDT'), + ('Etc/GMT'), + ('Etc/GMT+0'), + ('Etc/GMT+1'), + ('Etc/GMT+10'), + ('Etc/GMT+11'), + ('Etc/GMT+12'), + ('Etc/GMT+2'), + ('Etc/GMT+3'), + ('Etc/GMT+4'), + ('Etc/GMT+5'), + ('Etc/GMT+6'), + ('Etc/GMT+7'), + ('Etc/GMT+8'), + ('Etc/GMT+9'), + ('Etc/GMT-0'), + ('Etc/GMT-1'), + ('Etc/GMT-10'), + ('Etc/GMT-11'), + ('Etc/GMT-12'), + ('Etc/GMT-13'), + ('Etc/GMT-14'), + ('Etc/GMT-2'), + ('Etc/GMT-3'), + ('Etc/GMT-4'), + ('Etc/GMT-5'), + ('Etc/GMT-6'), + ('Etc/GMT-7'), + ('Etc/GMT-8'), + ('Etc/GMT-9'), + ('Etc/GMT0'), + ('Etc/Greenwich'), + ('Etc/UCT'), + ('Etc/Universal'), + ('Etc/UTC'), + ('Etc/Zulu'), + ('Factory'), + ('GB'), + ('GB-Eire'), + ('GMT'), + ('GMT+0'), + ('GMT-0'), + ('GMT0'), + ('Greenwich'), + ('Hongkong'), + ('HST'), + ('Iceland'), + ('Iran'), + ('Israel'), + ('Jamaica'), + ('Japan'), + ('Kwajalein'), + ('Libya'), + ('MET'), + ('Mexico/BajaNorte'), + ('Mexico/BajaSur'), + ('Mexico/General'), + ('MST'), + ('MST7MDT'), + ('Navajo'), + ('NZ'), + ('NZ-CHAT'), + ('Poland'), + ('Portugal'), + ('PRC'), + ('PST8PDT'), + ('ROC'), + ('ROK'), + ('Singapore'), + ('Turkey'), + ('UCT'), + ('Universal'), + ('US/Alaska'), + ('US/Aleutian'), + ('US/Arizona'), + ('US/Central'), + ('US/East-Indiana'), + ('US/Eastern'), + ('US/Hawaii'), + ('US/Indiana-Starke'), + ('US/Michigan'), + ('US/Mountain'), + ('US/Pacific'), + ('US/Pacific-New'), + ('US/Samoa'), + ('UTC'), + ('W-SU'), + ('WET'), + ('Zulu'); + +DELETE FROM `PREFIX_discount_category` +WHERE `id_discount` IN ( + SELECT `id_discount` FROM ( + SELECT dc.`id_discount` + FROM `PREFIX_discount_category` dc + LEFT JOIN `PREFIX_discount`d ON (d.`id_discount` = dc.`id_discount`) + WHERE d.`id_discount` IS NULL + GROUP BY dc.`id_discount`) discount_category_tmp + ); + +DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_DISPLAY_WITHOUT_TAX'; + +INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES + ('updateCarrier', 'Carrier update', 'This hook is called when a carrier is updated', 0); diff --git a/install-dev/sql/upgrade/1.2.0.3.sql b/install-dev/sql/upgrade/1.2.0.3.sql new file mode 100644 index 000000000..9f6f078ee --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.3.sql @@ -0,0 +1,33 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE `PREFIX_customization` + ADD `quantity_refunded` INT NOT NULL DEFAULT '0'; +ALTER TABLE `PREFIX_customization` + ADD `quantity_returned` INT NOT NULL DEFAULT '0'; + +ALTER TABLE `PREFIX_alias` + CHANGE `id_alias` `id_alias` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `PREFIX_attribute_impact` + CHANGE `id_attribute_impact` `id_attribute_impact` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `PREFIX_customization` + CHANGE `id_customization` `id_customization` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `PREFIX_customization_field` + CHANGE `id_customization_field` `id_customization_field` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT; +ALTER TABLE `PREFIX_subdomain` + CHANGE `id_subdomain` `id_subdomain` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT; + + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +INSERT INTO `PREFIX_search_engine` (`server`,`getvar`) VALUES + ('bing.com','q'); + +INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES + (19, 9, 1); + diff --git a/install-dev/sql/upgrade/1.2.0.4.sql b/install-dev/sql/upgrade/1.2.0.4.sql new file mode 100644 index 000000000..2b4f66a32 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.4.sql @@ -0,0 +1,10 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + diff --git a/install-dev/sql/upgrade/1.2.0.5.sql b/install-dev/sql/upgrade/1.2.0.5.sql new file mode 100644 index 000000000..7512ab24a --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.5.sql @@ -0,0 +1,17 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +UPDATE `PREFIX_order_state_lang` +SET `name` = 'Shipped' +WHERE `id_order_state` = 4 AND `id_lang` = 1; + +UPDATE `PREFIX_order_state_lang` SET `template` = 'shipped' WHERE `id_order_state` = 4 AND `template` = 'shipping'; + +/* PHP:reorderpositions(); */; \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.2.0.6.sql b/install-dev/sql/upgrade/1.2.0.6.sql new file mode 100644 index 000000000..fc88820b8 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.6.sql @@ -0,0 +1,14 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE `PREFIX_configuration` DROP INDEX `configuration_name`; +ALTER TABLE `PREFIX_order_detail` ADD `product_quantity_in_stock` INT(10) NOT NULL DEFAULT 0 AFTER `product_quantity`; +ALTER TABLE `PREFIX_order_detail` ADD `product_quantity_reinjected` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `product_quantity_return`; + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ +UPDATE `PREFIX_product` SET `out_of_stock` = 0 WHERE `id_product` IN ((SELECT `id_product` FROM `PREFIX_product_download`)); diff --git a/install-dev/sql/upgrade/1.2.0.7.sql b/install-dev/sql/upgrade/1.2.0.7.sql new file mode 100644 index 000000000..5cd1d4109 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.7.sql @@ -0,0 +1,12 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +/* PHP:update_modules_sql(); */; diff --git a/install-dev/sql/upgrade/1.2.0.8.sql b/install-dev/sql/upgrade/1.2.0.8.sql new file mode 100644 index 000000000..eeda18cd2 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.0.8.sql @@ -0,0 +1,10 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ diff --git a/install-dev/sql/upgrade/1.2.1.0.sql b/install-dev/sql/upgrade/1.2.1.0.sql new file mode 100644 index 000000000..d11032a29 --- /dev/null +++ b/install-dev/sql/upgrade/1.2.1.0.sql @@ -0,0 +1,16 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_THEME_V11', 0, NOW(), NOW()); + +/* PHP */ +/* PHP:update_carrier_url(); */; +/* PHP:moduleReinstaller('blocksearch'); */; diff --git a/install-dev/sql/upgrade/1.2.2.0.sql b/install-dev/sql/upgrade/1.2.2.0.sql new file mode 100644 index 000000000..27e0498df --- /dev/null +++ b/install-dev/sql/upgrade/1.2.2.0.sql @@ -0,0 +1,6 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_discount_category` ADD INDEX ( `id_discount` ); + +DELETE FROM `PREFIX_delivery` WHERE `id_range_weight` != NULL AND `id_range_weight` NOT IN (SELECT `id_range_weight` FROM `PREFIX_range_weight`); +DELETE FROM `PREFIX_delivery` WHERE `id_range_price` != NULL AND `id_range_weight` NOT IN (SELECT `id_range_price` FROM `PREFIX_range_price`); diff --git a/install-dev/sql/upgrade/1.2.3.0.sql b/install-dev/sql/upgrade/1.2.3.0.sql new file mode 100644 index 000000000..3f288763f --- /dev/null +++ b/install-dev/sql/upgrade/1.2.3.0.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_category_product` ADD INDEX (`id_product`); diff --git a/install-dev/sql/upgrade/1.2.4.0.sql b/install-dev/sql/upgrade/1.2.4.0.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.2.4.0.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.2.5.0.sql b/install-dev/sql/upgrade/1.2.5.0.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.2.5.0.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.0.1.sql b/install-dev/sql/upgrade/1.3.0.1.sql new file mode 100644 index 000000000..be84fc456 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.1.sql @@ -0,0 +1,92 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE `PREFIX_product` +CHANGE `reduction_from` `reduction_from` DATE NOT NULL DEFAULT '1970-01-01', +CHANGE `reduction_to` `reduction_to` DATE NOT NULL DEFAULT '1970-01-01'; + +ALTER TABLE `PREFIX_order_detail` CHANGE `tax_rate` `tax_rate` DECIMAL(10, 3) NOT NULL DEFAULT '0.000'; +ALTER TABLE `PREFIX_group` ADD `price_display_method` TINYINT NOT NULL DEFAULT 0 AFTER `reduction`; + +CREATE TABLE `PREFIX_carrier_group` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + UNIQUE KEY `id_carrier` (`id_carrier`,`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_country` ADD `need_identification_number` TINYINT( 1 ) NOT NULL; +ALTER TABLE `PREFIX_customer` ADD `dni` VARCHAR( 16 ) NULL AFTER `firstname`; + +ALTER TABLE `PREFIX_image` ADD INDEX `product_position` (`id_product`, `position`); +ALTER TABLE `PREFIX_hook_module` ADD INDEX `id_module` (`id_module`); +ALTER TABLE `PREFIX_customer` ADD INDEX `id_customer_passwd` (`id_customer`, `passwd`); +ALTER TABLE `PREFIX_tag` ADD INDEX `id_lang` (`id_lang`); +ALTER TABLE `PREFIX_customer_group` ADD INDEX `id_customer` (`id_customer`); +ALTER TABLE `PREFIX_category_group` ADD INDEX `id_category` (`id_category`); +ALTER TABLE `PREFIX_image` ADD INDEX `id_product_cover` (`id_product`, `cover`); +ALTER TABLE `PREFIX_employee` ADD INDEX `id_employee_passwd` (`id_employee`, `passwd`); +ALTER TABLE `PREFIX_product_attribute` ADD INDEX `product_default` (`id_product`, `default_on`); +ALTER TABLE `PREFIX_product_download` ADD INDEX `product_active` (`id_product`, `active`); +ALTER TABLE `PREFIX_tab` ADD INDEX `class_name` (`class_name`); +ALTER TABLE `PREFIX_module_currency` ADD INDEX `id_module` (`id_module`); +ALTER TABLE `PREFIX_product_attribute_combination` ADD INDEX `id_product_attribute` (`id_product_attribute`); +ALTER TABLE `PREFIX_orders` ADD INDEX `invoice_number` (`invoice_number`); +ALTER TABLE `PREFIX_product_tag` ADD INDEX `id_tag` (`id_tag`); +ALTER TABLE `PREFIX_cms_lang` CHANGE `id_cms` `id_cms` INT(10) UNSIGNED NOT NULL; +ALTER TABLE `PREFIX_tax` CHANGE `rate` `rate` DECIMAL(10, 3) NOT NULL; + +ALTER TABLE `PREFIX_order_detail` ADD `discount_quantity_applied` TINYINT(1) NOT NULL DEFAULT 0 AFTER `ecotax`; +ALTER TABLE `PREFIX_orders` ADD `total_products_wt` DECIMAL(10, 2) NOT NULL AFTER `total_products`; + +/* ##################################### */ +/* CONTENTS */ +/* ##################################### */ + +UPDATE `PREFIX_group` SET `price_display_method` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_PRICE_DISPLAY'); + +UPDATE `PREFIX_configuration` +SET `value` = ROUND(value / (1 + ( + SELECT rate FROM ( + SELECT t.`rate`, COUNT(*) n + FROM `PREFIX_orders` o + LEFT JOIN `PREFIX_carrier` c ON (o.`id_carrier` = c.`id_carrier`) + LEFT JOIN `PREFIX_tax` t ON (t.`id_tax` = c.`id_tax`) + WHERE c.`deleted` = 0 + AND c.`shipping_handling` = 1 + GROUP BY o.`id_carrier` + ORDER BY n DESC + LIMIT 1 + ) myrate +) / 100), 6) +WHERE `name` = 'PS_SHIPPING_HANDLING'; + +DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_PRICE_DISPLAY'; +DELETE FROM `PREFIX_product_attachment` WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_discount_quantity` WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_pack` WHERE `id_product_pack` NOT IN (SELECT `id_product` FROM `PREFIX_product`) OR `id_product_item` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_product_sale` WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_scene_products` WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_search_index` WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product`); +DELETE FROM `PREFIX_search_word` WHERE `id_word` NOT IN (SELECT `id_word` FROM `PREFIX_search_index`); +DELETE FROM `PREFIX_tag` WHERE `id_lang` NOT IN (SELECT `id_lang` FROM `PREFIX_lang`); +DELETE FROM `PREFIX_search_word` WHERE `id_lang` NOT IN (SELECT `id_lang` FROM `PREFIX_lang`); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PRESTASTORE_LIVE', 1, NOW(), NOW()), +('PS_SHOW_ALL_MODULES', 0, NOW(), NOW()), +('PS_BACKUP_ALL', 0, NOW(), NOW()), +('PS_1_3_UPDATE_DATE', NOW(), NOW(), NOW()), +('PS_PRICE_ROUND_MODE', 2, NOW(), NOW()); +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES +('createAccountTop', 'Block above the form for create an account', NULL , '1'), +('backOfficeHeader', 'Administration panel header', NULL , '0'), +('backOfficeTop', 'Administration panel top hover the tabs', NULL , '1'), +('backOfficeFooter', 'Administration panel footer', NULL , '1'); + +INSERT INTO `PREFIX_carrier_group` (id_carrier, id_group) (SELECT id_carrier, id_group FROM `PREFIX_carrier` c, `PREFIX_group` g WHERE c.active = 1); + +/* PHP */ +/* PHP:convert_product_price(); */; diff --git a/install-dev/sql/upgrade/1.3.0.10.sql b/install-dev/sql/upgrade/1.3.0.10.sql new file mode 100644 index 000000000..5354e7131 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.10.sql @@ -0,0 +1,5 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_order_detail` ADD INDEX `id_order_id_order_detail` (`id_order`, `id_order_detail`); +ALTER TABLE `PREFIX_category_group` ADD INDEX `id_group` (`id_group`); +ALTER TABLE `PREFIX_product` ADD INDEX `date_add` (`date_add`); \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.3.0.2.sql b/install-dev/sql/upgrade/1.3.0.2.sql new file mode 100644 index 000000000..9069781e8 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.2.sql @@ -0,0 +1,147 @@ +SET NAMES 'utf8'; + +/* ##################################### */ +/* STRUCTURE */ +/* ##################################### */ + +ALTER TABLE `PREFIX_product_attachment` +CHANGE `id_product` `id_product` INT(10) UNSIGNED NOT NULL, +CHANGE `id_attachment` `id_attachment` INT(10) UNSIGNED NOT NULL; + +ALTER TABLE `PREFIX_attribute_impact` +CHANGE `id_product` `id_product` INT(11) UNSIGNED NOT NULL, +CHANGE `id_attribute` `id_attribute` INT(11) UNSIGNED NOT NULL; + +ALTER TABLE `PREFIX_block_cms` +CHANGE `id_block` `id_block` INT(10) UNSIGNED NOT NULL, +CHANGE `id_cms` `id_cms` INT(10) UNSIGNED NOT NULL; + +ALTER TABLE `PREFIX_customization` +CHANGE `id_cart` `id_cart` int(10) unsigned NOT NULL, +CHANGE `id_product_attribute` `id_product_attribute` int(10) unsigned NOT NULL default '0'; + +ALTER TABLE `PREFIX_customization_field` +CHANGE `id_product` `id_product` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_customization_field_lang` +CHANGE `id_customization_field` `id_customization_field` int(10) unsigned NOT NULL, +CHANGE `id_lang` `id_lang` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_customized_data` +CHANGE `id_customization` `id_customization` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_discount_category` +CHANGE `id_category` `id_category` int(11) unsigned NOT NULL, +CHANGE `id_discount` `id_discount` int(11) unsigned NOT NULL; + +ALTER TABLE `PREFIX_module_group` +CHANGE `id_group` `id_group` int(11) unsigned NOT NULL; + +ALTER TABLE `PREFIX_order_return_detail` +CHANGE `id_customization` `id_customization` int(10) unsigned NOT NULL default '0'; + +ALTER TABLE `PREFIX_product_attribute_image` +CHANGE `id_product_attribute` `id_product_attribute` int(10) unsigned NOT NULL, +CHANGE `id_image` `id_image` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_referrer_cache` +CHANGE `id_connections_source` `id_connections_source` int(11) unsigned NOT NULL, +CHANGE `id_referrer` `id_referrer` int(11) unsigned NOT NULL; + +ALTER TABLE `PREFIX_scene_category` +CHANGE `id_scene` `id_scene` int(10) unsigned NOT NULL, +CHANGE `id_category` `id_category` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_scene_lang` +CHANGE `id_scene` `id_scene` int(10) unsigned NOT NULL, +CHANGE `id_lang` `id_lang` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_scene_products` +CHANGE `id_scene` `id_scene` int(10) unsigned NOT NULL, +CHANGE `id_product` `id_product` int(10) unsigned NOT NULL; + +ALTER TABLE `PREFIX_search_index` +CHANGE `id_product` `id_product` int(11) unsigned NOT NULL, +CHANGE `id_word` `id_word` int(11) unsigned NOT NULL; + +ALTER TABLE `PREFIX_state` +CHANGE `id_country` `id_country` int(11) unsigned NOT NULL, +CHANGE `id_zone` `id_zone` int(11) unsigned NOT NULL; + +ALTER TABLE `PREFIX_category_lang` +CHANGE `meta_keywords` `meta_keywords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, +CHANGE `meta_description` `meta_description` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ; + +ALTER TABLE `PREFIX_supplier_lang` +CHANGE `meta_title` `meta_title` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, +CHANGE `meta_keywords` `meta_keywords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, +CHANGE `meta_description` `meta_description` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ; + +ALTER TABLE `PREFIX_manufacturer_lang` +CHANGE `meta_title` `meta_title` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, +CHANGE `meta_keywords` `meta_keywords` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, +CHANGE `meta_description` `meta_description` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ; + +ALTER TABLE `PREFIX_meta_lang` +CHANGE `title` `title` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ; + +/* ##################################### */ +/* PRICE RANGE */ +/* ##################################### */ + +ALTER TABLE `PREFIX_attribute_impact` CHANGE `price` `price` DECIMAL(17, 2) NOT NULL; + +ALTER TABLE `PREFIX_delivery` CHANGE `price` `price` DECIMAL(17, 2) NOT NULL; + +ALTER TABLE `PREFIX_discount` CHANGE `value` `value` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `minimal` `minimal` DECIMAL(17, 2) NULL DEFAULT NULL; + +ALTER TABLE `PREFIX_discount_quantity` CHANGE `value` `value` DECIMAL(17, 2) UNSIGNED NOT NULL; + +ALTER TABLE `PREFIX_group` CHANGE `reduction` `reduction` DECIMAL(17, 2) NOT NULL DEFAULT '0.00'; + +ALTER TABLE `PREFIX_orders` CHANGE `total_discounts` `total_discounts` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_paid` `total_paid` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_paid_real` `total_paid_real` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_products` `total_products` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_products_wt` `total_products_wt` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_shipping` `total_shipping` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `total_wrapping` `total_wrapping` DECIMAL(17, 2) NOT NULL DEFAULT '0.00'; + +ALTER TABLE `PREFIX_order_detail` CHANGE `product_price` `product_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000', +CHANGE `product_quantity_discount` `product_quantity_discount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000', +CHANGE `ecotax` `ecotax` decimal(17,2) NOT NULL default '0.00'; + +ALTER TABLE `PREFIX_order_discount` CHANGE `value` `value` DECIMAL(17, 2) NOT NULL DEFAULT '0.00'; + +ALTER TABLE `PREFIX_product` CHANGE `price` `price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000', +CHANGE `wholesale_price` `wholesale_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000', +CHANGE `ecotax` `ecotax` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `reduction_price` `reduction_price` DECIMAL(17, 2) NULL DEFAULT NULL; + +ALTER TABLE `PREFIX_product_attribute` CHANGE `wholesale_price` `wholesale_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000', +CHANGE `price` `price` DECIMAL(17, 2) NOT NULL DEFAULT '0.00', +CHANGE `ecotax` `ecotax` DECIMAL(17, 2) NOT NULL DEFAULT '0.00'; + +ALTER TABLE `PREFIX_range_price` CHANGE `delimiter1` `delimiter1` DECIMAL(20, 6) NOT NULL, +CHANGE `delimiter2` `delimiter2` DECIMAL(20, 6) NOT NULL; + +ALTER TABLE `PREFIX_range_weight` CHANGE `delimiter1` `delimiter1` DECIMAL(20, 6) NOT NULL, +CHANGE `delimiter2` `delimiter2` DECIMAL(20, 6) NOT NULL; + +ALTER TABLE `PREFIX_referrer` CHANGE `cache_sales` `cache_sales` DECIMAL(17, 2) NULL DEFAULT NULL; + +UPDATE `PREFIX_configuration` +SET `value` = IFNULL(ROUND(value / (1 + ( + SELECT `rate` + FROM `PREFIX_tax` + WHERE `id_tax` = ( + SELECT `value` + FROM ( + SELECT `value` + FROM `PREFIX_configuration` + WHERE `name` = 'PS_GIFT_WRAPPING_TAX' + )tmp + ) +) / 100), 2), 0) +WHERE `name` = 'PS_GIFT_WRAPPING_PRICE'; diff --git a/install-dev/sql/upgrade/1.3.0.3.sql b/install-dev/sql/upgrade/1.3.0.3.sql new file mode 100644 index 000000000..7adb283eb --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.3.sql @@ -0,0 +1,15 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_tab` CHANGE `id_parent` `id_parent` INT(11) NOT NULL; +INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) +VALUES (43, 'AdminSearch', -1, 0) +ON DUPLICATE KEY +UPDATE `id_parent` = -1; + +ALTER TABLE `PREFIX_search_engine` ADD UNIQUE (`server`,`getvar`); +REPLACE INTO `PREFIX_search_engine` (`server`,`getvar`) +VALUES ('google','q'),('aol','q'),('yandex','text'),('ask.com','q'),('nhl.com','q'),('yahoo','p'),('baidu','wd'), +('lycos','query'),('exalead','q'),('search.live','q'),('voila','rdata'),('altavista','q'),('bing','q'),('daum','q'), +('eniro','search_word'),('naver','query'),('msn','q'),('netscape','query'),('cnn','query'),('about','terms'),('mamma','query'), +('alltheweb','q'),('virgilio','qs'),('alice','qs'),('najdi','q'),('mama','query'),('seznam','q'),('onet','qt'),('szukacz','q'), +('yam','k'),('pchome','q'),('kvasir','q'),('sesam','q'),('ozu','q'),('terra','query'),('mynet','q'),('ekolay','q'),('rambler','words'); \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.3.0.4.sql b/install-dev/sql/upgrade/1.3.0.4.sql new file mode 100644 index 000000000..46ad8ccb4 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.4.sql @@ -0,0 +1,83 @@ +SET NAMES 'utf8'; + +DELETE FROM `PREFIX_tax_state` WHERE `id_tax` NOT IN (SELECT `id_tax` FROM `PREFIX_tax`); + +ALTER TABLE `PREFIX_product` CHANGE `reduction_from` `reduction_from` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00', +CHANGE `reduction_to` `reduction_to` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'; + +UPDATE `PREFIX_product` +SET `reduction_to` = DATE_ADD(reduction_to, INTERVAL 1 DAY) +WHERE `reduction_from` != `reduction_to`; + +ALTER TABLE `PREFIX_discount` ADD `id_currency` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `id_customer`; +UPDATE `PREFIX_discount` SET `id_currency` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_CURRENCY_DEFAULT' LIMIT 1) WHERE `id_discount_type` = 2; + +ALTER TABLE `PREFIX_address` ADD INDEX (id_country); +ALTER TABLE `PREFIX_address` ADD INDEX (id_state); +ALTER TABLE `PREFIX_address` ADD INDEX (id_manufacturer); +ALTER TABLE `PREFIX_address` ADD INDEX (id_supplier); +ALTER TABLE `PREFIX_carrier` ADD INDEX (id_tax); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_address_delivery); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_address_invoice); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_carrier); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_lang); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_currency); +ALTER TABLE `PREFIX_cart_product` ADD INDEX (id_product_attribute); +ALTER TABLE `PREFIX_connections` ADD INDEX (id_page); +ALTER TABLE `PREFIX_customer` ADD INDEX (id_gender); +ALTER TABLE `PREFIX_customization` ADD INDEX (id_product_attribute); +ALTER TABLE `PREFIX_customization_field` ADD INDEX (id_product); +ALTER TABLE `PREFIX_delivery` ADD INDEX (id_range_price); +ALTER TABLE `PREFIX_delivery` ADD INDEX (id_range_weight); +ALTER TABLE `PREFIX_discount` ADD INDEX (id_discount_type); +ALTER TABLE `PREFIX_discount_quantity` ADD INDEX (id_discount_type); +ALTER TABLE `PREFIX_discount_quantity` ADD INDEX (id_product); +ALTER TABLE `PREFIX_discount_quantity` ADD INDEX (id_product_attribute); +ALTER TABLE `PREFIX_employee` ADD INDEX (id_profile); +ALTER TABLE `PREFIX_feature_product` ADD INDEX (id_feature_value); +ALTER TABLE `PREFIX_guest` ADD INDEX (id_operating_system); +ALTER TABLE `PREFIX_guest` ADD INDEX (id_web_browser); +ALTER TABLE `PREFIX_hook_module_exceptions` ADD INDEX (id_module); +ALTER TABLE `PREFIX_hook_module_exceptions` ADD INDEX (id_hook); +ALTER TABLE `PREFIX_message` ADD INDEX (id_cart); +ALTER TABLE `PREFIX_message` ADD INDEX (id_customer); +ALTER TABLE `PREFIX_message` ADD INDEX (id_employee); +ALTER TABLE `PREFIX_order_detail` ADD INDEX (product_attribute_id); +ALTER TABLE `PREFIX_order_discount` ADD INDEX (id_discount); +ALTER TABLE `PREFIX_order_history` ADD INDEX (id_employee); +ALTER TABLE `PREFIX_order_history` ADD INDEX (id_order_state); +ALTER TABLE `PREFIX_order_return` ADD INDEX (id_order); +ALTER TABLE `PREFIX_order_slip` ADD INDEX (id_order); +ALTER TABLE `PREFIX_orders` ADD INDEX (id_carrier); +ALTER TABLE `PREFIX_orders` ADD INDEX (id_lang); +ALTER TABLE `PREFIX_orders` ADD INDEX (id_currency); +ALTER TABLE `PREFIX_orders` ADD INDEX (id_address_delivery); +ALTER TABLE `PREFIX_orders` ADD INDEX (id_address_invoice); +ALTER TABLE `PREFIX_product` ADD INDEX (id_tax); +ALTER TABLE `PREFIX_product` ADD INDEX (id_category_default); +ALTER TABLE `PREFIX_product` ADD INDEX (id_color_default); +ALTER TABLE `PREFIX_state` ADD INDEX (id_country); +ALTER TABLE `PREFIX_state` ADD INDEX (id_zone); +ALTER TABLE `PREFIX_tab` ADD INDEX (id_parent); +ALTER TABLE `PREFIX_cart` ADD INDEX (id_guest); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) +( + SELECT 'MA_LAST_QTIES', '3', NOW(), NOW() + FROM `PREFIX_module` WHERE `name` = 'mailalerts' +); + +ALTER TABLE `PREFIX_customer` ADD `id_default_group` INT UNSIGNED NOT NULL DEFAULT '1' AFTER `id_gender`; + +UPDATE `PREFIX_customer` c SET `id_default_group` = ( + SELECT ( + IFNULL( + (SELECT g.`id_group` + FROM `PREFIX_group` g + LEFT JOIN `PREFIX_customer_group` cg ON (cg.`id_group` = g.`id_group`) + WHERE g.`reduction` > 0 AND cg.`id_customer` = c.`id_customer` + ORDER BY g.`reduction` + LIMIT 1) + , 1) + ) +); diff --git a/install-dev/sql/upgrade/1.3.0.5.sql b/install-dev/sql/upgrade/1.3.0.5.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.5.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.0.6.sql b/install-dev/sql/upgrade/1.3.0.6.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.6.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.0.7.sql b/install-dev/sql/upgrade/1.3.0.7.sql new file mode 100755 index 000000000..158212ef5 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.7.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +/* PHP:setAllGroupsOnHomeCategory(); */; diff --git a/install-dev/sql/upgrade/1.3.0.8.sql b/install-dev/sql/upgrade/1.3.0.8.sql new file mode 100644 index 000000000..e988c8279 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.8.sql @@ -0,0 +1,5 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_product_attribute` ADD INDEX `id_product_id_product_attribute` (`id_product_attribute` , `id_product`); +ALTER TABLE `PREFIX_image_lang` ADD INDEX `id_image` (`id_image`); + diff --git a/install-dev/sql/upgrade/1.3.0.9.sql b/install-dev/sql/upgrade/1.3.0.9.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.0.9.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.1.1.sql b/install-dev/sql/upgrade/1.3.1.1.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.1.1.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.2.1.sql b/install-dev/sql/upgrade/1.3.2.1.sql new file mode 100755 index 000000000..da21b32f2 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.2.1.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + + diff --git a/install-dev/sql/upgrade/1.3.2.2.sql b/install-dev/sql/upgrade/1.3.2.2.sql new file mode 100755 index 000000000..180ac77b6 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.2.2.sql @@ -0,0 +1,27 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_order_detail` ADD `reduction_percent` DECIMAL(10, 2) NOT NULL AFTER `product_price`; +ALTER TABLE `PREFIX_order_detail` ADD `reduction_amount` DECIMAL(20, 6) NOT NULL AFTER `reduction_percent`; + +ALTER TABLE `PREFIX_country` CHANGE `need_identification_number` `need_identification_number` TINYINT(1) NOT NULL DEFAULT '0'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_1_3_2_UPDATE_DATE', NOW(), NOW(), NOW()); + +ALTER TABLE `PREFIX_search_index` CHANGE `weight` `weight` SMALLINT(4) unsigned NOT NULL DEFAULT '1'; + +ALTER TABLE `PREFIX_image` DROP INDEX `product_position`, ADD UNIQUE `product_position` (`id_product`, `position`); + +ALTER TABLE `PREFIX_zone` DROP `enabled`; + +SET @id_hook = (SELECT id_hook FROM PREFIX_hook WHERE name = 'backOfficeHeader'); +SET @position = (SELECT IFNULL(MAX(position),0)+1 FROM PREFIX_hook_module WHERE id_hook = @id_hook); +INSERT IGNORE INTO PREFIX_hook_module (id_hook, id_module, position) VALUES (@id_hook, (SELECT id_module FROM PREFIX_module WHERE name = 'statsbestcustomers'), @position); +SET @position = @position + 1; +INSERT IGNORE INTO PREFIX_hook_module (id_hook, id_module, position) VALUES (@id_hook, (SELECT id_module FROM PREFIX_module WHERE name = 'statsbestproducts'), @position); +SET @position = @position + 1; +INSERT IGNORE INTO PREFIX_hook_module (id_hook, id_module, position) VALUES (@id_hook, (SELECT id_module FROM PREFIX_module WHERE name = 'statsbestvouchers'), @position); +SET @position = @position + 1; +INSERT IGNORE INTO PREFIX_hook_module (id_hook, id_module, position) VALUES (@id_hook, (SELECT id_module FROM PREFIX_module WHERE name = 'statsbestcategories'), @position); +SET @position = @position + 1; +INSERT IGNORE INTO PREFIX_hook_module (id_hook, id_module, position) VALUES (@id_hook, (SELECT id_module FROM PREFIX_module WHERE name = 'statsbestcarriers'), @position); diff --git a/install-dev/sql/upgrade/1.3.2.3.sql b/install-dev/sql/upgrade/1.3.2.3.sql new file mode 100755 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.2.3.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.3.3.0.sql b/install-dev/sql/upgrade/1.3.3.0.sql new file mode 100644 index 000000000..a8c43bb44 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.3.0.sql @@ -0,0 +1,8 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_order_detail` ADD `group_reduction` DECIMAL(10, 2) NOT NULL AFTER `reduction_amount`; +ALTER TABLE `PREFIX_order_detail` ADD `ecotax_tax_rate` DECIMAL(5, 3) NOT NULL AFTER `ecotax`; +ALTER TABLE `PREFIX_product` CHANGE `ecotax` `ecotax` DECIMAL(21, 6) NOT NULL DEFAULT '0.00'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) SELECT 'PS_LOCALE_LANGUAGE', l.`iso_code`, NOW(), NOW() FROM `PREFIX_configuration` c INNER JOIN `PREFIX_lang` l ON (l.`id_lang` = c.`value`) WHERE c.`name` = 'PS_LANG_DEFAULT'; +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) SELECT 'PS_LOCALE_COUNTRY', co.`iso_code`, NOW(), NOW() FROM `PREFIX_configuration` c INNER JOIN `PREFIX_country` co ON (co.`id_country` = c.`value`) WHERE c.`name` = 'PS_COUNTRY_DEFAULT'; diff --git a/install-dev/sql/upgrade/1.3.4.0.sql b/install-dev/sql/upgrade/1.3.4.0.sql new file mode 100644 index 000000000..22c382dd4 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.4.0.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.3.5.0.sql b/install-dev/sql/upgrade/1.3.5.0.sql new file mode 100644 index 000000000..22c382dd4 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.5.0.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.3.6.0.sql b/install-dev/sql/upgrade/1.3.6.0.sql new file mode 100755 index 000000000..083171282 --- /dev/null +++ b/install-dev/sql/upgrade/1.3.6.0.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +/* PHP:update_products_ecotax_v133(); */; diff --git a/install-dev/sql/upgrade/1.3.7.0.sql b/install-dev/sql/upgrade/1.3.7.0.sql new file mode 100644 index 000000000..0b4cf1b2f --- /dev/null +++ b/install-dev/sql/upgrade/1.3.7.0.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/install-dev/sql/upgrade/1.4.0.1.sql b/install-dev/sql/upgrade/1.4.0.1.sql new file mode 100644 index 000000000..525c317c0 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.1.sql @@ -0,0 +1,2 @@ +SET NAMES 'utf8'; + diff --git a/install-dev/sql/upgrade/1.4.0.10.sql b/install-dev/sql/upgrade/1.4.0.10.sql new file mode 100644 index 000000000..64833005c --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.10.sql @@ -0,0 +1,20 @@ +SET NAMES 'utf8'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_CATALOG_MODE', '0', NOW(), NOW()); + +ALTER TABLE `PREFIX_specific_price` DROP `priority`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_GEOLOCATION_WHITELIST', '209.185.108;209.185.253;209.85.238;209.85.238.11;209.85.238.4;216.239.33.96;216.239.33.97;216.239.33.98;216.239.33.99;216.239.37.98;216.239.37.99;216.239.39.98;216.239.39.99;216.239.41.96;216.239.41.97;216.239.41.98;216.239.41.99;216.239.45.4;216.239.46;216.239.51.96;216.239.51.97;216.239.51.98;216.239.51.99;216.239.53.98;216.239.53.99;216.239.57.96;216.239.57.97;216.239.57.98;216.239.57.99;216.239.59.98;216.239.59.99;216.33.229.163;64.233.173.193;64.233.173.194;64.233.173.195;64.233.173.196;64.233.173.197;64.233.173.198;64.233.173.199;64.233.173.200;64.233.173.201;64.233.173.202;64.233.173.203;64.233.173.204;64.233.173.205;64.233.173.206;64.233.173.207;64.233.173.208;64.233.173.209;64.233.173.210;64.233.173.211;64.233.173.212;64.233.173.213;64.233.173.214;64.233.173.215;64.233.173.216;64.233.173.217;64.233.173.218;64.233.173.219;64.233.173.220;64.233.173.221;64.233.173.222;64.233.173.223;64.233.173.224;64.233.173.225;64.233.173.226;64.233.173.227;64.233.173.228;64.233.173.229;64.233.173.230;64.233.173.231;64.233.173.232;64.233.173.233;64.233.173.234;64.233.173.235;64.233.173.236;64.233.173.237;64.233.173.238;64.233.173.239;64.233.173.240;64.233.173.241;64.233.173.242;64.233.173.243;64.233.173.244;64.233.173.245;64.233.173.246;64.233.173.247;64.233.173.248;64.233.173.249;64.233.173.250;64.233.173.251;64.233.173.252;64.233.173.253;64.233.173.254;64.233.173.255;64.68.80;64.68.81;64.68.82;64.68.83;64.68.84;64.68.85;64.68.86;64.68.87;64.68.88;64.68.89;64.68.90.1;64.68.90.10;64.68.90.11;64.68.90.12;64.68.90.129;64.68.90.13;64.68.90.130;64.68.90.131;64.68.90.132;64.68.90.133;64.68.90.134;64.68.90.135;64.68.90.136;64.68.90.137;64.68.90.138;64.68.90.139;64.68.90.14;64.68.90.140;64.68.90.141;64.68.90.142;64.68.90.143;64.68.90.144;64.68.90.145;64.68.90.146;64.68.90.147;64.68.90.148;64.68.90.149;64.68.90.15;64.68.90.150;64.68.90.151;64.68.90.152;64.68.90.153;64.68.90.154;64.68.90.155;64.68.90.156;64.68.90.157;64.68.90.158;64.68.90.159;64.68.90.16;64.68.90.160;64.68.90.161;64.68.90.162;64.68.90.163;64.68.90.164;64.68.90.165;64.68.90.166;64.68.90.167;64.68.90.168;64.68.90.169;64.68.90.17;64.68.90.170;64.68.90.171;64.68.90.172;64.68.90.173;64.68.90.174;64.68.90.175;64.68.90.176;64.68.90.177;64.68.90.178;64.68.90.179;64.68.90.18;64.68.90.180;64.68.90.181;64.68.90.182;64.68.90.183;64.68.90.184;64.68.90.185;64.68.90.186;64.68.90.187;64.68.90.188;64.68.90.189;64.68.90.19;64.68.90.190;64.68.90.191;64.68.90.192;64.68.90.193;64.68.90.194;64.68.90.195;64.68.90.196;64.68.90.197;64.68.90.198;64.68.90.199;64.68.90.2;64.68.90.20;64.68.90.200;64.68.90.201;64.68.90.202;64.68.90.203;64.68.90.204;64.68.90.205;64.68.90.206;64.68.90.207;64.68.90.208;64.68.90.21;64.68.90.22;64.68.90.23;64.68.90.24;64.68.90.25;64.68.90.26;64.68.90.27;64.68.90.28;64.68.90.29;64.68.90.3;64.68.90.30;64.68.90.31;64.68.90.32;64.68.90.33;64.68.90.34;64.68.90.35;64.68.90.36;64.68.90.37;64.68.90.38;64.68.90.39;64.68.90.4;64.68.90.40;64.68.90.41;64.68.90.42;64.68.90.43;64.68.90.44;64.68.90.45;64.68.90.46;64.68.90.47;64.68.90.48;64.68.90.49;64.68.90.5;64.68.90.50;64.68.90.51;64.68.90.52;64.68.90.53;64.68.90.54;64.68.90.55;64.68.90.56;64.68.90.57;64.68.90.58;64.68.90.59;64.68.90.6;64.68.90.60;64.68.90.61;64.68.90.62;64.68.90.63;64.68.90.64;64.68.90.65;64.68.90.66;64.68.90.67;64.68.90.68;64.68.90.69;64.68.90.7;64.68.90.70;64.68.90.71;64.68.90.72;64.68.90.73;64.68.90.74;64.68.90.75;64.68.90.76;64.68.90.77;64.68.90.78;64.68.90.79;64.68.90.8;64.68.90.80;64.68.90.9;64.68.91;64.68.92;66.249.64;66.249.65;66.249.66;66.249.67;66.249.68;66.249.69;66.249.70;66.249.71;66.249.72;66.249.73;66.249.78;66.249.79;72.14.199;8.6.48', NOW(), NOW()); + +ALTER TABLE `PREFIX_address` ADD `dni` VARCHAR(16) NULL AFTER `vat_number`; + +UPDATE `PREFIX_address` a SET `dni` = ( + SELECT `dni` + FROM `PREFIX_customer` c + WHERE c.`id_customer` = a.`id_customer` +); + +ALTER TABLE `PREFIX_customer` DROP `dni`; + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('paymentTop', 'Top of payment page', 'Top of payment page', 0); diff --git a/install-dev/sql/upgrade/1.4.0.11.sql b/install-dev/sql/upgrade/1.4.0.11.sql new file mode 100644 index 000000000..8e73ca69b --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.11.sql @@ -0,0 +1,36 @@ +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) +VALUES +( +'PREFIX_INVOICE_START_NUMBER', +( SELECT `invoice_number` FROM (SELECT GREATEST(`value`, (SELECT CAST(MAX(`invoice_number`) AS CHAR) FROM `PREFIX_orders`)) AS `invoice_number` FROM `PREFIX_configuration` WHERE `name` = 'PREFIX_INVOICE_NUMBER' ) as tmp), +NOW(), +NOW() +); + +DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_INVOICE_NUMBER'; + +CREATE TABLE `PREFIX_log` ( + `id_log` int(10) unsigned NOT NULL AUTO_INCREMENT, + `severity` tinyint(1) NOT NULL, + `error_code` int(11) DEFAULT NULL, + `message` text NOT NULL, + `object_type` varchar(32) DEFAULT NULL, + `object_id` int(10) unsigned DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_log`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_LOGS_BY_EMAIL', '5', NOW(), NOW()); + +ALTER TABLE `PREFIX_tax_rules_group` CHANGE `name` `name` VARCHAR( 50 ) NOT NULL; + +CREATE TABLE `PREFIX_import_match` ( + `id_import_match` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(32) NOT NULL, + `match` text NOT NULL, + `skip` int(2) NOT NULL, + PRIMARY KEY (`id_import_match`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +/* PHP:add_new_tab(AdminLogs, en:Log|fr:Log|es:Log|de:Log|it:Log, 9); */; diff --git a/install-dev/sql/upgrade/1.4.0.12.sql b/install-dev/sql/upgrade/1.4.0.12.sql new file mode 100644 index 000000000..36f3b024b --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.12.sql @@ -0,0 +1,9 @@ +ALTER TABLE `PREFIX_product` CHANGE `ecotax` `ecotax` DECIMAL( 17, 6 ) NOT NULL DEFAULT '0.00'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_LAST_SHOP_UPDATE', NOW(), NOW(), NOW()); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_STORES_DISPLAY_SITEMAP', 1, NOW(), NOW()); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_COOKIE_CHECKIP', 1, NOW(), NOW()); + +/* PHP:regenerate_level_depth(); */; \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.4.0.13.sql b/install-dev/sql/upgrade/1.4.0.13.sql new file mode 100644 index 000000000..6caee5265 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.13.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +/* PHP:regenerate_level_depth(); */; diff --git a/install-dev/sql/upgrade/1.4.0.14.sql b/install-dev/sql/upgrade/1.4.0.14.sql new file mode 100644 index 000000000..5370dea04 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.14.sql @@ -0,0 +1,24 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_tax_rule` DROP PRIMARY KEY ; +ALTER TABLE `PREFIX_tax_rule` ADD `id_tax_rule` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ; +ALTER TABLE `PREFIX_tax_rule` ADD INDEX ( `id_tax` ) ; +ALTER TABLE `PREFIX_tax_rule` ADD INDEX ( `id_tax_rules_group` ) ; + +ALTER TABLE `PREFIX_address` MODIFY `dni` VARCHAR(16) NULL AFTER `vat_number`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('BLOCKSTORE_IMG', 'store.jpg', NOW(), NOW()), +('PS_STORES_CENTER_LAT', '25.948969', NOW(), NOW()), +('PS_STORES_CENTER_LONG', '-80.226439', NOW(), NOW()); + +/* PHP:add_new_tab(AdminInformation, en:Configuration Information|fr:Informations|es:Informations|it:Informazioni di configurazione|de:Konfigurationsinformationen, 9); */; +/* PHP:add_new_tab(AdminPerformance, de:Leistung|en:Performance|it:Performance|fr:Performances|es:Rendimiento, 8); */; +/* PHP:add_new_tab(AdminCustomerThreads, en:Customer Service|de:Kundenservice|fr:SAV|es:Servicio al cliente|it:Servizio clienti, 29); */; +/* PHP:add_new_tab(AdminWebservice, fr:Service web|es:Web service|en:Webservice|de:Webservice|it:Webservice, 8); */; +/* PHP:add_new_tab(AdminAddonsCatalog, fr:Catalogue de modules et thèmes|de:Module und Themenkatalog|en:Modules & Themes Catalog|it:Moduli & Temi catalogo, 7); */; +/* PHP:add_new_tab(AdminAddonsMyAccount, it:Il mio Account|de:Mein Konto|fr:Mon compte|en:My Account, 7); */; +/* PHP:add_new_tab(AdminThemes, es:Temas|it:Temi|de:Themen|en:Themes|fr:Thèmes, 7); */; +/* PHP:add_new_tab(AdminGeolocation, es:Geolocalización|it:Geolocalizzazione|en:Geolocation|de:Geotargeting|fr:Géolocalisation, 8); */; +/* PHP:add_new_tab(AdminTaxRulesGroup, it:Regimi fiscali|es:Reglas de Impuestos|fr:Règles de taxes|de:Steuerregeln|en:Tax Rules, 4); */; +/* PHP:add_new_tab(AdminLogs, en:Log|fr:Log|es:Log|de:Log|it:Log, 9); */; diff --git a/install-dev/sql/upgrade/1.4.0.15.sql b/install-dev/sql/upgrade/1.4.0.15.sql new file mode 100644 index 000000000..7a0227965 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.15.sql @@ -0,0 +1,41 @@ +/* PHP:add_new_tab(AdminCounty, fr:Comtés|es:Condados|en:Counties|de:Counties|it:Counties, 5); */; + +ALTER TABLE `PREFIX_tax_rule` ADD `county_behavior` INT NOT NULL AFTER `state_behavior`; +ALTER TABLE `PREFIX_tax_rule` ADD `id_county` INT NOT NULL AFTER `state_behavior`; + +ALTER TABLE `PREFIX_tax_rule` ADD UNIQUE ( +`id_tax_rules_group` , +`id_country` , +`id_state` , +`id_county` +); + +CREATE TABLE `PREFIX_county` ( + `id_county` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `id_state` int(11) NOT NULL, + `active` tinyint(1) NOT NULL, + PRIMARY KEY (`id_county`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ; + + +CREATE TABLE `PREFIX_county_zip_code` ( + `id_county` INT NOT NULL , + `from_zip_code` INT NOT NULL , + `to_zip_code` INT NOT NULL , + PRIMARY KEY ( `id_county` , `from_zip_code` , `to_zip_code` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_HOMEPAGE_PHP_SELF', 'index.php', NOW(), NOW()); + + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) +VALUES ('PS_USE_ECOTAX', + (SELECT IF((SELECT `ecotax` FROM `PREFIX_product` WHERE `ecotax` != 0 LIMIT 1),'1','0')), + NOW(), + NOW()); + +ALTER TABLE `PREFIX_hook` ADD `live_edit` TINYINT NOT NULL DEFAULT '0'; + +UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `PREFIX_hook`.`name` IN ('rightColumn', 'leftColumn', 'home'); diff --git a/install-dev/sql/upgrade/1.4.0.16.sql b/install-dev/sql/upgrade/1.4.0.16.sql new file mode 100644 index 000000000..6b1a9fe12 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.16.sql @@ -0,0 +1,39 @@ +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) +VALUES (NULL, 'afterCreateHtaccess', 'After htaccess creation', 'After htaccess creation', 0); + +UPDATE `PREFIX_meta_lang` SET `url_rewrite` = 'kontaktieren-sie-uns' WHERE id_meta = 3 AND id_lang = 4 AND url_rewrite = 'Kontaktieren Sie uns'; +UPDATE `PREFIX_meta_lang` SET `url_rewrite` = 'kennwort-wiederherstellung' WHERE id_meta = 7 AND id_lang = 4 AND url_rewrite = 'Kennwort Wiederherstellung'; +UPDATE `PREFIX_meta_lang` SET `url_rewrite` = 'il-mio-account' WHERE id_meta = 18 AND id_lang = 5 AND url_rewrite = 'il mio-account'; +UPDATE `PREFIX_meta_lang` SET `url_rewrite` = 'nota-di-ordine' WHERE id_meta = 20 AND id_lang = 5 AND url_rewrite = 'nota di-ordine'; + +INSERT INTO `PREFIX_meta` (`page`) VALUES ('order-opc'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) +( + SELECT `id_lang`, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-opc'), 'Order', 'quick-order' + FROM `PREFIX_lang` +); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('guest-tracking'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) +( + SELECT `id_lang`, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'guest-tracking'), 'Guest tracking', 'guest-tracking' + FROM `PREFIX_lang` +); + +UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `PREFIX_hook`.`name` IN ('productfooter', 'payment'); + +UPDATE `PREFIX_configuration` SET name = 'PS_GEOLOCATION_ENABLED' WHERE name = 'PS_GEOLOCALIZATION_ENABLED'; +UPDATE `PREFIX_configuration` SET name = 'PS_GEOLOCATION_BEHAVIOR' WHERE name = 'PS_GEOLOCALIZATION_BEHAVIOR'; +UPDATE `PREFIX_configuration` SET name = 'PS_GEOLOCATION_WHITELIST' WHERE name = 'PS_GEOLOCALIZATION_WHITELIST'; +UPDATE `PREFIX_tab` SET class_name = 'AdminGeolocation' WHERE class_name = 'AdminGeolocalization'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_CANONICAL_REDIRECT', '0', NOW(), NOW()); + +ALTER TABLE `PREFIX_webservice_account` ADD `class_name` VARCHAR( 50 ) NOT NULL DEFAULT 'WebserviceRequest' AFTER `key`; +ALTER TABLE `PREFIX_webservice_account` ADD `description` text NULL AFTER `key`; + +/* PHP:add_module_to_hook(blockcategories, afterCreateHtaccess); */; +/* PHP:add_new_tab(AdminHome, en:Home|fr:Accueil|es:Home|de:Home|it:Home, -1); */; +/* PHP:add_new_tab(AdminStockMvt, de:Lagerbewegungen|fr:Mouvements de Stock|it:Movimenti magazzino|en:Stock Movements, 1); */; +/* PHP:update_for_13version(); */; + diff --git a/install-dev/sql/upgrade/1.4.0.17.sql b/install-dev/sql/upgrade/1.4.0.17.sql new file mode 100644 index 000000000..dc6af7ab0 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.17.sql @@ -0,0 +1,22 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_stock_mvt_reason` ADD `sign` TINYINT(1) NOT NULL AFTER `id_stock_mvt_reason`; +UPDATE `PREFIX_stock_mvt_reason` SET `sign`=-1; +UPDATE `PREFIX_stock_mvt_reason` SET `sign`=1 WHERE `id_stock_mvt_reason`=3; +UPDATE `PREFIX_stock_mvt_reason` SET `id_stock_mvt_reason`=`id_stock_mvt_reason`+2 ORDER BY `id_stock_mvt_reason` DESC; +UPDATE `PREFIX_stock_mvt` SET `id_stock_mvt_reason`=`id_stock_mvt_reason`+2; +UPDATE `PREFIX_stock_mvt_reason_lang` SET `id_stock_mvt_reason`=`id_stock_mvt_reason`+2 ORDER BY `id_stock_mvt_reason` DESC; +INSERT INTO `PREFIX_stock_mvt_reason` (`id_stock_mvt_reason` ,`sign` ,`date_add` ,`date_upd`) VALUES ('1', '1', NOW(), NOW()), ('2', '-1', NOW(), NOW()); + +INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason` ,`id_lang` ,`name`) VALUES +('1', '1', 'Increase'), +('1', '2', 'Augmenter'), +('1', '3', 'Aumentar'), +('1', '4', 'Erhöhen'), +('1', '5', 'Aumento'), +('2', '1', 'Decrease'), +('2', '2', 'Diminuer'), +('2', '3', 'Disminuir'), +('2', '4', 'Reduzieren'), +('2', '5', 'Diminuzione'); + diff --git a/install-dev/sql/upgrade/1.4.0.2.sql b/install-dev/sql/upgrade/1.4.0.2.sql new file mode 100644 index 000000000..609c323be --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.2.sql @@ -0,0 +1,689 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_employee` ADD `bo_color` varchar(32) default NULL AFTER `stats_date_to`; +ALTER TABLE `PREFIX_employee` ADD `bo_theme` varchar(32) default NULL AFTER `bo_color`; +ALTER TABLE `PREFIX_employee` ADD `bo_uimode` ENUM('hover','click') default 'click' AFTER `bo_theme`; +ALTER TABLE `PREFIX_employee` ADD `id_lang` int(10) unsigned NOT NULL default 0 AFTER `id_profile`; + +ALTER TABLE `PREFIX_cms` ADD `id_cms_category` int(10) unsigned NOT NULL default '0' AFTER `id_cms`; +ALTER TABLE `PREFIX_cms` ADD `position` int(10) unsigned NOT NULL default '0' AFTER `id_cms_category`; + +CREATE TABLE `PREFIX_cms_category` ( + `id_cms_category` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_parent` int(10) unsigned NOT NULL, + `level_depth` tinyint(3) unsigned NOT NULL DEFAULT '0', + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_cms_category`), + KEY `category_parent` (`id_parent`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_cms_category_lang` ( + `id_cms_category` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `description` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_title` varchar(128) DEFAULT NULL, + `meta_keywords` varchar(255) DEFAULT NULL, + `meta_description` varchar(255) DEFAULT NULL, + UNIQUE KEY `category_lang_index` (`id_cms_category`,`id_lang`), + KEY `category_name` (`name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_cms_category_lang` VALUES(1, 1, 'Home', '', 'home', NULL, NULL, NULL); +INSERT INTO `PREFIX_cms_category_lang` VALUES(1, 2, 'Accueil', '', 'home', NULL, NULL, NULL); +INSERT INTO `PREFIX_cms_category_lang` VALUES(1, 3, 'Inicio', '', 'home', NULL, NULL, NULL); + +INSERT INTO `PREFIX_cms_category` VALUES(1, 0, 0, 1, NOW(), NOW(),0); + +UPDATE `PREFIX_cms_category` SET `position` = 0; +UPDATE `PREFIX_cms` SET `position` = 0; +UPDATE `PREFIX_cms` SET `id_cms_category` = 0; + +ALTER TABLE `PREFIX_category` ADD `position` int(10) unsigned NOT NULL default '0' AFTER `date_upd`; + +UPDATE `PREFIX_employee` SET `id_lang` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` LIKE "PS_LANG_DEFAULT"); + +ALTER TABLE `PREFIX_customer` ADD `note` text AFTER `secure_key`; + +ALTER TABLE `PREFIX_contact` ADD `customer_service` tinyint(1) NOT NULL DEFAULT 0 AFTER `email`; + +CREATE TABLE `PREFIX_customer_thread` ( + `id_customer_thread` int(11) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `id_contact` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned default NULL, + `id_order` int(10) unsigned default NULL, + `id_product` int(10) unsigned default NULL, + `status` enum('open','closed','pending1','pending2') NOT NULL default 'open', + `email` varchar(128) NOT NULL, + `token` varchar(12) default NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer_thread`), + KEY `id_customer_thread` (`id_customer_thread`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_customer_message` ( + `id_customer_message` int(10) unsigned NOT NULL auto_increment, + `id_customer_thread` int(11) default NULL, + `id_employee` int(10) unsigned default NULL, + `message` text NOT NULL, + `file_name` varchar(18) DEFAULT NULL, + `ip_address` int(11) default NULL, + `user_agent` varchar(128) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_customer_message`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_payment_cc` ( + `id_payment_cc` INT NOT NULL auto_increment, + `id_order` INT UNSIGNED NULL, + `id_currency` INT UNSIGNED NOT NULL, + `amount` DECIMAL(10,2) NOT NULL, + `transaction_id` VARCHAR(254) NULL, + `card_number` VARCHAR(254) NULL, + `card_brand` VARCHAR(254) NULL, + `card_expiration` CHAR(7) NULL, + `card_holder` VARCHAR(254) NULL, + `date_add` DATETIME NOT NULL, + PRIMARY KEY (`id_payment_cc`), + KEY `id_order` (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_specific_price` ( + `id_specific_price` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_product` INT UNSIGNED NOT NULL, + `id_shop` TINYINT UNSIGNED NOT NULL, + `id_currency` INT UNSIGNED NOT NULL, + `id_country` INT UNSIGNED NOT NULL, + `id_group` INT UNSIGNED NOT NULL, + `priority` SMALLINT UNSIGNED NOT NULL, + `price` DECIMAL(20, 6) NOT NULL, + `from_quantity` SMALLINT UNSIGNED NOT NULL, + `reduction` DECIMAL(20, 6) NOT NULL, + `reduction_type` ENUM('amount', 'percentage') NOT NULL, + `from` DATETIME NOT NULL, + `to` DATETIME NOT NULL, + PRIMARY KEY(`id_specific_price`), + KEY (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `from`, `to`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_specific_price` (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `priority`, `price`, `from_quantity`, `reduction`, `reduction_type`, `from`, `to`) + ( SELECT dq.`id_product`, 1, 1, 0, 1, 0, 0.00, dq.`quantity`, IF(dq.`id_discount_type` = 2, dq.`value`, dq.`value` / 100), IF (dq.`id_discount_type` = 2, 'amount', 'percentage'), '0000-00-00 00:00:00', '0000-00-00 00:00:00' + FROM `PREFIX_discount_quantity` dq + INNER JOIN `PREFIX_product` p ON (p.`id_product` = dq.`id_product`) + ); +DROP TABLE `PREFIX_discount_quantity`; + +INSERT INTO `PREFIX_specific_price` (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `priority`, `price`, `from_quantity`, `reduction`, `reduction_type`, `from`, `to`) ( + SELECT + p.`id_product`, + 1, + 0, + 0, + 0, + 0, + 0.00, + 1, + IF(p.`reduction_price` > 0, p.`reduction_price`, p.`reduction_percent` / 100), + IF(p.`reduction_price` > 0, 'amount', 'percentage'), + IF (p.`reduction_from` = p.`reduction_to`, '0000-00-00 00:00:00', p.`reduction_from`), + IF (p.`reduction_from` = p.`reduction_to`, '0000-00-00 00:00:00', p.`reduction_to`) + FROM `PREFIX_product` p + WHERE p.`reduction_price` OR p.`reduction_percent` +); +ALTER TABLE `PREFIX_product` + DROP `reduction_price`, + DROP `reduction_percent`, + DROP `reduction_from`, + DROP `reduction_to`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_SPECIFIC_PRICE_PRIORITIES', 'id_shop;id_currency;id_country;id_group', NOW(), NOW()), +('PS_TAX_DISPLAY', 0, NOW(), NOW()), +('PS_SMARTY_FORCE_COMPILE', 1, NOW(), NOW()), +('PS_DISTANCE_UNIT', 'km', NOW(), NOW()), +('PS_STORES_DISPLAY_CMS', 0, NOW(), NOW()), +('PS_STORES_DISPLAY_FOOTER', 0, NOW(), NOW()), +('PS_STORES_SIMPLIFIED', 0, NOW(), NOW()), +('PS_STATSDATA_CUSTOMER_PAGESVIEWS', 1, NOW(), NOW()), +('PS_STATSDATA_PAGESVIEWS', 1, NOW(), NOW()), +('PS_STATSDATA_PLUGINS', 1, NOW(), NOW()); + +CREATE TABLE `PREFIX_group_reduction` ( + `id_group_reduction` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_group` INT(10) UNSIGNED NOT NULL, + `id_category` INT(10) UNSIGNED NOT NULL, + `reduction` DECIMAL(4, 3) NOT NULL, + PRIMARY KEY(`id_group_reduction`), + UNIQUE KEY(`id_group`, `id_category`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_product_group_reduction_cache` ( + `id_product` INT UNSIGNED NOT NULL, + `id_group` INT UNSIGNED NOT NULL, + `reduction` DECIMAL(4, 3) NOT NULL, + PRIMARY KEY(`id_product`, `id_group`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_currency` ADD `iso_code_num` varchar(3) NOT NULL default '0' AFTER `iso_code`; +UPDATE `PREFIX_currency` SET iso_code_num = '978' WHERE iso_code LIKE 'EUR' LIMIT 1; +UPDATE `PREFIX_currency` SET iso_code_num = '840' WHERE iso_code LIKE 'USD' LIMIT 1; +UPDATE `PREFIX_currency` SET iso_code_num = '826' WHERE iso_code LIKE 'GBP' LIMIT 1; + +ALTER TABLE `PREFIX_country` ADD `call_prefix` int(10) NOT NULL default '0' AFTER `iso_code`; + +UPDATE `PREFIX_country` SET `call_prefix` = 49 WHERE `iso_code` = 'DE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 43 WHERE `iso_code` = 'AT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 32 WHERE `iso_code` = 'BE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 1 WHERE `iso_code` = 'CA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 86 WHERE `iso_code` = 'CN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 34 WHERE `iso_code` = 'ES' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 358 WHERE `iso_code` = 'FI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 33 WHERE `iso_code` = 'FR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 30 WHERE `iso_code` = 'GR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 39 WHERE `iso_code` = 'IT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 81 WHERE `iso_code` = 'JP' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 352 WHERE `iso_code` = 'LU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 31 WHERE `iso_code` = 'NL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 48 WHERE `iso_code` = 'PL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 351 WHERE `iso_code` = 'PT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 420 WHERE `iso_code` = 'CZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 44 WHERE `iso_code` = 'GB' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 46 WHERE `iso_code` = 'SE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 41 WHERE `iso_code` = 'CH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 45 WHERE `iso_code` = 'DK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 1 WHERE `iso_code` = 'US' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 852 WHERE `iso_code` = 'HK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 47 WHERE `iso_code` = 'NO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 61 WHERE `iso_code` = 'AU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 65 WHERE `iso_code` = 'SG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 353 WHERE `iso_code` = 'IE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 64 WHERE `iso_code` = 'NZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 82 WHERE `iso_code` = 'KR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 972 WHERE `iso_code` = 'IL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 27 WHERE `iso_code` = 'ZA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 234 WHERE `iso_code` = 'NG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 225 WHERE `iso_code` = 'CI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 228 WHERE `iso_code` = 'TG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 591 WHERE `iso_code` = 'BO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 230 WHERE `iso_code` = 'MU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 40 WHERE `iso_code` = 'RO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 421 WHERE `iso_code` = 'SK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 213 WHERE `iso_code` = 'DZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 376 WHERE `iso_code` = 'AD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 244 WHERE `iso_code` = 'AO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 54 WHERE `iso_code` = 'AR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 374 WHERE `iso_code` = 'AM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 297 WHERE `iso_code` = 'AW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 994 WHERE `iso_code` = 'AZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 973 WHERE `iso_code` = 'BH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 880 WHERE `iso_code` = 'BD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 501 WHERE `iso_code` = 'BZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 229 WHERE `iso_code` = 'BJ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 975 WHERE `iso_code` = 'BT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 267 WHERE `iso_code` = 'BW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 55 WHERE `iso_code` = 'BR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 673 WHERE `iso_code` = 'BN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 226 WHERE `iso_code` = 'BF' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 95 WHERE `iso_code` = 'MM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 257 WHERE `iso_code` = 'BI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 855 WHERE `iso_code` = 'KH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 237 WHERE `iso_code` = 'CM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 238 WHERE `iso_code` = 'CV' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 236 WHERE `iso_code` = 'CF' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 235 WHERE `iso_code` = 'TD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 56 WHERE `iso_code` = 'CL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 57 WHERE `iso_code` = 'CO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 269 WHERE `iso_code` = 'KM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 242 WHERE `iso_code` = 'CD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 243 WHERE `iso_code` = 'CG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 506 WHERE `iso_code` = 'CR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 385 WHERE `iso_code` = 'HR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 53 WHERE `iso_code` = 'CU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 357 WHERE `iso_code` = 'CY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 253 WHERE `iso_code` = 'DJ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 670 WHERE `iso_code` = 'TL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 593 WHERE `iso_code` = 'EC' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 20 WHERE `iso_code` = 'EG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 503 WHERE `iso_code` = 'SV' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 240 WHERE `iso_code` = 'GQ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 291 WHERE `iso_code` = 'ER' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 372 WHERE `iso_code` = 'EE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 251 WHERE `iso_code` = 'ET' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 298 WHERE `iso_code` = 'FO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 679 WHERE `iso_code` = 'FJ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 241 WHERE `iso_code` = 'GA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 220 WHERE `iso_code` = 'GM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 995 WHERE `iso_code` = 'GE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 233 WHERE `iso_code` = 'GH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 299 WHERE `iso_code` = 'GL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 350 WHERE `iso_code` = 'GI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 590 WHERE `iso_code` = 'GP' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 502 WHERE `iso_code` = 'GT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 224 WHERE `iso_code` = 'GN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 245 WHERE `iso_code` = 'GW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 592 WHERE `iso_code` = 'GY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 509 WHERE `iso_code` = 'HT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 379 WHERE `iso_code` = 'VA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 504 WHERE `iso_code` = 'HN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 354 WHERE `iso_code` = 'IS' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 91 WHERE `iso_code` = 'IN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 62 WHERE `iso_code` = 'ID' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 98 WHERE `iso_code` = 'IR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 964 WHERE `iso_code` = 'IQ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 962 WHERE `iso_code` = 'JO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 7 WHERE `iso_code` = 'KZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 254 WHERE `iso_code` = 'KE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 686 WHERE `iso_code` = 'KI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 850 WHERE `iso_code` = 'KP' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 965 WHERE `iso_code` = 'KW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 996 WHERE `iso_code` = 'KG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 856 WHERE `iso_code` = 'LA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 371 WHERE `iso_code` = 'LV' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 961 WHERE `iso_code` = 'LB' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 266 WHERE `iso_code` = 'LS' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 231 WHERE `iso_code` = 'LR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 218 WHERE `iso_code` = 'LY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 423 WHERE `iso_code` = 'LI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 370 WHERE `iso_code` = 'LT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 853 WHERE `iso_code` = 'MO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 389 WHERE `iso_code` = 'MK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 261 WHERE `iso_code` = 'MG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 265 WHERE `iso_code` = 'MW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 60 WHERE `iso_code` = 'MY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 960 WHERE `iso_code` = 'MV' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 223 WHERE `iso_code` = 'ML' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 356 WHERE `iso_code` = 'MT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 692 WHERE `iso_code` = 'MH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 596 WHERE `iso_code` = 'MQ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 222 WHERE `iso_code` = 'MR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 36 WHERE `iso_code` = 'HU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 262 WHERE `iso_code` = 'YT' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 52 WHERE `iso_code` = 'MX' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 691 WHERE `iso_code` = 'FM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 373 WHERE `iso_code` = 'MD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 377 WHERE `iso_code` = 'MC' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 976 WHERE `iso_code` = 'MN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 382 WHERE `iso_code` = 'ME' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 212 WHERE `iso_code` = 'MA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 258 WHERE `iso_code` = 'MZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 264 WHERE `iso_code` = 'NA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 674 WHERE `iso_code` = 'NR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 977 WHERE `iso_code` = 'NP' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 599 WHERE `iso_code` = 'AN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 687 WHERE `iso_code` = 'NC' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 505 WHERE `iso_code` = 'NI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 227 WHERE `iso_code` = 'NE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 683 WHERE `iso_code` = 'NU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 968 WHERE `iso_code` = 'OM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 92 WHERE `iso_code` = 'PK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 680 WHERE `iso_code` = 'PW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 507 WHERE `iso_code` = 'PA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 675 WHERE `iso_code` = 'PG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 595 WHERE `iso_code` = 'PY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 51 WHERE `iso_code` = 'PE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 63 WHERE `iso_code` = 'PH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 974 WHERE `iso_code` = 'QA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 262 WHERE `iso_code` = 'RE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 7 WHERE `iso_code` = 'RU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 250 WHERE `iso_code` = 'RW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 508 WHERE `iso_code` = 'PM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 685 WHERE `iso_code` = 'WS' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 378 WHERE `iso_code` = 'SM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 239 WHERE `iso_code` = 'ST' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 966 WHERE `iso_code` = 'SA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 221 WHERE `iso_code` = 'SN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 381 WHERE `iso_code` = 'RS' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 248 WHERE `iso_code` = 'SC' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 232 WHERE `iso_code` = 'SL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 386 WHERE `iso_code` = 'SI' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 677 WHERE `iso_code` = 'SB' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 252 WHERE `iso_code` = 'SO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 94 WHERE `iso_code` = 'LK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 249 WHERE `iso_code` = 'SD' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 597 WHERE `iso_code` = 'SR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 268 WHERE `iso_code` = 'SZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 963 WHERE `iso_code` = 'SY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 886 WHERE `iso_code` = 'TW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 992 WHERE `iso_code` = 'TJ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 255 WHERE `iso_code` = 'TZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 66 WHERE `iso_code` = 'TH' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 690 WHERE `iso_code` = 'TK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 676 WHERE `iso_code` = 'TO' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 216 WHERE `iso_code` = 'TN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 90 WHERE `iso_code` = 'TR' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 993 WHERE `iso_code` = 'TM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 688 WHERE `iso_code` = 'TV' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 256 WHERE `iso_code` = 'UG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 380 WHERE `iso_code` = 'UA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 971 WHERE `iso_code` = 'AE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 598 WHERE `iso_code` = 'UY' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 998 WHERE `iso_code` = 'UZ' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 678 WHERE `iso_code` = 'VU' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 58 WHERE `iso_code` = 'VE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 84 WHERE `iso_code` = 'VN' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 681 WHERE `iso_code` = 'WF' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 967 WHERE `iso_code` = 'YE' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 260 WHERE `iso_code` = 'ZM' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 263 WHERE `iso_code` = 'ZW' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 355 WHERE `iso_code` = 'AL' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 93 WHERE `iso_code` = 'AF' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 387 WHERE `iso_code` = 'BA' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 359 WHERE `iso_code` = 'BG' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 682 WHERE `iso_code` = 'CK' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 594 WHERE `iso_code` = 'GF' LIMIT 1; +UPDATE `PREFIX_country` SET `call_prefix` = 689 WHERE `iso_code` = 'PF' LIMIT 1; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_CONDITIONS_CMS_ID', IFNULL((SELECT `id_cms` FROM `PREFIX_cms` WHERE `id_cms` = 3), 0), NOW(), NOW()); +UPDATE `PREFIX_configuration` SET `value` = IF((SELECT value FROM (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_CONDITIONS_CMS_ID')tmp), 1, 0) WHERE `name` = 'PS_CONDITIONS'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_CIPHER_ALGORITHM', 0, NOW(), NOW()); +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ORDER_PROCESS_TYPE', 0, NOW(), NOW()); + +ALTER TABLE `PREFIX_product` ADD `minimal_quantity` INT NOT NULL DEFAULT '1' AFTER `quantity`; +ALTER TABLE `PREFIX_product` ADD `cache_default_attribute` int(10) unsigned default NULL AFTER `indexed`; +ALTER TABLE `PREFIX_product` ADD `cache_has_attachments` TINYINT(1) NOT NULL default '0' AFTER `indexed`; +ALTER TABLE `PREFIX_product` ADD `cache_is_pack` TINYINT(1) NOT NULL default '0' AFTER `indexed`; +ALTER TABLE `PREFIX_product` ADD `available_for_order` TINYINT(1) NOT NULL DEFAULT '1' AFTER `active`; +ALTER TABLE `PREFIX_product` ADD `show_price` TINYINT(1) NOT NULL DEFAULT '1' AFTER `available_for_order`; +ALTER TABLE `PREFIX_product` ADD `online_only` TINYINT(1) NOT NULL DEFAULT '0' AFTER `on_sale`; +ALTER TABLE `PREFIX_product` ADD `condition` ENUM('new', 'used', 'refurbished') NOT NULL DEFAULT 'new' AFTER `available_for_order`; +ALTER TABLE `PREFIX_product` ADD `upc` VARCHAR( 12 ) NULL AFTER `ean13`; + +ALTER TABLE `PREFIX_product_attribute` ADD `upc` VARCHAR( 12 ) NULL AFTER `ean13`; + +SET @defaultOOS = (SELECT value FROM `PREFIX_configuration` WHERE name = 'PS_ORDER_OUT_OF_STOCK'); +/* Set 0 for every non-attribute product */ +UPDATE `PREFIX_product` p SET `cache_default_attribute` = 0 WHERE `id_product` NOT IN (SELECT `id_product` FROM `PREFIX_product_attribute`); +/* First default attribute in stock */ +UPDATE `PREFIX_product` p SET `cache_default_attribute` = (SELECT `id_product_attribute` FROM `PREFIX_product_attribute` WHERE `id_product` = p.`id_product` AND default_on = 1 AND quantity > 0 LIMIT 1) WHERE `cache_default_attribute` IS NULL; +/* Then default attribute without stock if we don't care */ +UPDATE `PREFIX_product` p SET `cache_default_attribute` = (SELECT `id_product_attribute` FROM `PREFIX_product_attribute` WHERE `id_product` = p.`id_product` AND default_on = 1 LIMIT 1) WHERE `cache_default_attribute` IS NULL AND `out_of_stock` = 1 OR `out_of_stock` = IF(@defaultOOS = 1, 2, 1); +/* Next, the default attribute can be any attribute with stock */ +UPDATE `PREFIX_product` p SET `cache_default_attribute` = (SELECT `id_product_attribute` FROM `PREFIX_product_attribute` WHERE `id_product` = p.`id_product` AND quantity > 0 LIMIT 1) WHERE `cache_default_attribute` IS NULL; +/* If there is still no default attribute, then we go back to the default one */ +UPDATE `PREFIX_product` p SET `cache_default_attribute` = (SELECT `id_product_attribute` FROM `PREFIX_product_attribute` WHERE `id_product` = p.`id_product` AND default_on = 1 LIMIT 1) WHERE `cache_default_attribute` IS NULL; + +UPDATE `PREFIX_product` p SET +cache_is_pack = (SELECT IF(COUNT(*) > 0, 1, 0) FROM `PREFIX_pack` pp WHERE pp.`id_product_pack` = p.`id_product`), +cache_has_attachments = (SELECT IF(COUNT(*) > 0, 1, 0) FROM `PREFIX_product_attachment` pa WHERE pa.`id_product` = p.`id_product`); + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('deleteProductAttribute', 'Product Attribute Deletion', NULL, 0); +INSERT INTO `PREFIX_hook` (`name` ,`title` ,`description` ,`position`) VALUES ('beforeCarrier', 'Before carrier list', 'This hook is display before the carrier list on Front office', 1); +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('orderDetailDisplayed', 'Order detail displayed', 'Displayed on order detail on front office', 1); + +INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES +((SELECT IFNULL((SELECT `id_module` FROM `PREFIX_module` WHERE `name` = 'mailalerts'), 0)), +(SELECT `id_hook` FROM `PREFIX_hook` WHERE `name` = 'deleteProductAttribute'), 1); + +DELETE FROM `PREFIX_hook_module` WHERE `id_module` = 0; + +ALTER TABLE `PREFIX_country` ADD `need_zip_code` TINYINT(1) NOT NULL DEFAULT '1'; +ALTER TABLE `PREFIX_country` ADD `zip_code_format` VARCHAR(12) NOT NULL DEFAULT ''; + +ALTER TABLE `PREFIX_product` ADD `unit_price` DECIMAL(20,6) NOT NULL DEFAULT '0.000000' AFTER `wholesale_price`; +ALTER TABLE `PREFIX_product` ADD `unity` VARCHAR(10) NOT NULL DEFAULT '0.000000' AFTER `unit_price` ; +ALTER TABLE `PREFIX_product_attribute` ADD `unit_price_impact`DECIMAL(17,2) NOT NULL DEFAULT '0.00' AFTER `weight`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_VOLUME_UNIT', 'cl', NOW(), NOW()); + +ALTER TABLE `PREFIX_carrier` ADD `shipping_external` TINYINT( 1 ) UNSIGNED NOT NULL; +ALTER TABLE `PREFIX_carrier` ADD `external_module_name` varchar(64) DEFAULT NULL; +ALTER TABLE `PREFIX_carrier` ADD `need_range` TINYINT( 1 ) UNSIGNED NOT NULL; + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('processCarrier', 'Carrier Process', NULL, 0); +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('orderDetail', 'Order Detail', 'To set the follow-up in smarty when order detail is called', 0); +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('paymentCCAdded', 'Payment CC added', 'Payment CC added', '0'); +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('extraProductComparison', 'Extra Product Comparison', 'Extra Product Comparison', '0'); + +ALTER TABLE `PREFIX_address` ADD `vat_number` varchar(32) NULL DEFAULT NULL AFTER `phone_mobile`; +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TAX_ADDRESS_TYPE', 'id_address_delivery', NOW(), NOW()); + + +/* PHP:add_module_to_hook(blockpaymentlogo, header); */; +/* PHP:add_module_to_hook(blockpermanentlinks, header); */; +/* PHP:add_module_to_hook(blockviewed, header); */; +/* PHP:add_module_to_hook(blockcart, header); */; +/* PHP:add_module_to_hook(editorial, header); */; +/* PHP:add_module_to_hook(blockbestsellers, header); */; +/* PHP:add_module_to_hook(blockcategories, header); */; +/* PHP:add_module_to_hook(blockspecials, header); */; +/* PHP:add_module_to_hook(blockcurrencies, header); */; +/* PHP:add_module_to_hook(blocknewproducts, header); */; +/* PHP:add_module_to_hook(blockuserinfo, header); */; +/* PHP:add_module_to_hook(blockcms, header); */; +/* PHP:add_module_to_hook(blocklanguages, header); */; +/* PHP:add_module_to_hook(blockmanufacturer, header); */; +/* PHP:add_module_to_hook(blockadvertising, header); */; +/* PHP:add_module_to_hook(blocktags, header); */; +/* PHP:add_module_to_hook(blockmyaccount, header); */; + +ALTER TABLE `PREFIX_product` ADD `additional_shipping_cost` DECIMAL(20,2) NOT NULL DEFAULT '0.000000' AFTER `unit_price`; + +ALTER TABLE `PREFIX_currency` ADD `active` TINYINT(1) NOT NULL DEFAULT '1'; +ALTER TABLE `PREFIX_tax` ADD `active` TINYINT(1) NOT NULL DEFAULT '1'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ATTRIBUTE_CATEGORY_DISPLAY', 1, NOW(), NOW()); + +ALTER TABLE `PREFIX_discount` ADD `cart_display` TINYINT( 4 ) NOT NULL AFTER `active` , ADD `date_add` DATETIME NOT NULL AFTER `cart_display` , ADD `date_upd` DATETIME NOT NULL AFTER `date_add` ; + +ALTER TABLE `PREFIX_carrier` ADD `shipping_method` INT( 2 ) NOT NULL DEFAULT '0'; + +CREATE TABLE `PREFIX_stock_mvt` ( + `id_stock_mvt` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id_product` int(11) unsigned DEFAULT NULL, + `id_product_attribute` int(11) unsigned DEFAULT NULL, + `id_order` int(11) unsigned DEFAULT NULL, + `id_stock_mvt_reason` int(11) unsigned NOT NULL, + `id_employee` int(11) unsigned NOT NULL, + `quantity` int(11) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_stock_mvt`), + KEY `id_order` (`id_order`), + KEY `id_product` (`id_product`), + KEY `id_product_attribute` (`id_product_attribute`), + KEY `id_stock_mvt_reason` (`id_stock_mvt_reason`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_stock_mvt_reason` ( + `id_stock_mvt_reason` int(11) NOT NULL AUTO_INCREMENT, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_stock_mvt_reason`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +ALTER TABLE `PREFIX_product` CHANGE `quantity` `quantity` INT( 10 ) NOT NULL DEFAULT '0'; +ALTER TABLE `PREFIX_product_attribute` CHANGE `quantity` `quantity` INT( 10 ) NOT NULL DEFAULT '0'; + +CREATE TABLE `PREFIX_stock_mvt_reason_lang` ( + `id_stock_mvt_reason` int(11) NOT NULL, + `id_lang` int(11) NOT NULL, + `name` varchar(255) CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`id_stock_mvt_reason`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_stock_mvt_reason` (`id_stock_mvt_reason`, `date_add`, `date_upd`) VALUES +(1, NOW(), NOW()), (2, NOW(), NOW()), (3, NOW(), NOW()); + +INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`) VALUES +(1, 1, 'Order'), +(1, 2, 'Commande'), +(2, 1, 'Missing Stock Movement'), +(2, 2, 'Mouvement de stock manquant'), +(3, 1, 'Restocking'), +(3, 2, 'Réassort'); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_COMPARATOR_MAX_ITEM', 0, NOW(), NOW()); + +ALTER TABLE `PREFIX_meta_lang` ADD `url_rewrite` VARCHAR( 255 ) NOT NULL , ADD INDEX ( `url_rewrite` ); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('address'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'address'), 'Address', 'address'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'address'), 'Adresse', 'adresse'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'address'), 'Dirección', 'direccion'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('addresses'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'addresses'), 'Addresses', 'addresses'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'addresses'), 'Adresses', 'adresses'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'addresses'), 'Direcciones', 'direcciones'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('authentication'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'authentication'), 'Authentication', 'authentication'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'authentication'), 'Authentification', 'authentification'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'authentication'), 'Autenticación', 'autenticacion'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('cart'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'cart'), 'Cart', 'cart'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'cart'), 'Panier', 'panier'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'cart'), 'Carro de la compra', 'carro-de-la-compra'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('discount'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'discount'), 'Discount', 'discount'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'discount'), 'Bons de réduction', 'bons-de-reduction'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'discount'), 'Descuento', 'descuento'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('history'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'history'), 'Order history', 'order-history'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'history'), 'Historique des commandes', 'historique-des-commandes'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'history'), 'Historial de pedidos', 'historial-de-pedidos'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('identity'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'identity'), 'Identity', 'identity'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'identity'), 'Identité', 'identite'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'identity'), 'Identidad', 'identidad'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('my-account'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'my-account'), 'My account', 'my-account'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'my-account'), 'Mon compte', 'mon-compte'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'my-account'), 'Mi Cuenta', 'mi-cuenta'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('order-follow'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-follow'), 'Order follow', 'order-follow'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-follow'), 'Détails de la commande', 'details-de-la-commande'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-follow'), 'Devolución de productos', 'devolucion-de-productos'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('order-slip'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-slip'), 'Order slip', 'order-slip'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-slip'), 'Avoirs', 'avoirs'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order-slip'), 'Vales', 'vales'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('order'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order'), 'Order', 'order'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order'), 'Commande', 'commande'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order'), 'Carrito', 'carrito'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('search'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Search', 'search'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Recherche', 'recherche'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Buscar', 'buscar'); +INSERT INTO `PREFIX_meta` (`page`) VALUES ('stores'); +INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES +(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'stores'), 'Stores', 'stores'), +(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'stores'), 'Magagins', 'magasins'), +(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'stores'), 'Tiendas', 'tiendas'); + +ALTER TABLE `PREFIX_manufacturer` ADD `active` tinyint(1) NOT NULL default 0; +ALTER TABLE `PREFIX_supplier` ADD `active` tinyint(1) NOT NULL default 0; +UPDATE `PREFIX_manufacturer` SET `active` = 1; +UPDATE `PREFIX_supplier` SET `active` = 1; +ALTER TABLE `PREFIX_cms` ADD `active` tinyint(1) unsigned NOT NULL default 0; +UPDATE `PREFIX_cms` SET `active` = 1; + +UPDATE `PREFIX_tab_lang` SET `name` = 'SEO' WHERE `id_tab` = 56 AND `id_lang` IN(1,2,3); + +ALTER TABLE `PREFIX_cart` ADD `secure_key` varchar(32) NOT NULL default '-1' AFTER `id_guest`; + +ALTER TABLE `PREFIX_order_detail` ADD `product_upc` varchar(12) default NULL AFTER `product_ean13`; + +ALTER TABLE `PREFIX_discount` ADD `id_group` int(10) unsigned NOT NULL default 0; + +CREATE TABLE `PREFIX_store` ( + `id_store` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned DEFAULT NULL, + `name` varchar(128) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) DEFAULT NULL, + `city` varchar(64) NOT NULL, + `postcode` varchar(12) NOT NULL, + `latitude` float(10,6) DEFAULT NULL, + `longitude` float(10,6) DEFAULT NULL, + `hours` varchar(254) DEFAULT NULL, + `phone` varchar(16) DEFAULT NULL, + `fax` varchar(16) DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `note` text, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_store`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES +('categoryAddition', '', 'Temporary hook. Must NEVER be used. Will soon be replaced by a generic CRUD hook system.', 0), +('categoryUpdate', '', 'Temporary hook. Must NEVER be used. Will soon be replaced by a generic CRUD hook system.', 0), +('categoryDeletion', '', 'Temporary hook. Must NEVER be used. Will soon be replaced by a generic CRUD hook system.', 0); + + +/* PHP:add_module_to_hook(blockcategories, categoryAddition); */; +/* PHP:add_module_to_hook(blockcategories, categoryUpdate); */; +/* PHP:add_module_to_hook(blockcategories, categoryDeletion); */; + +DELETE FROM `PREFIX_hook_module` WHERE `id_module` = 0; + +CREATE TABLE `PREFIX_required_field` ( + `id_required_field` int(11) NOT NULL AUTO_INCREMENT, + `object_name` varchar(32) NOT NULL, + `field_name` varchar(32) NOT NULL, + PRIMARY KEY (`id_required_field`), + KEY `object_name` (`object_name`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_memcached_servers` ( +`id_memcached_server` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`ip` VARCHAR( 254 ) NOT NULL , +`port` INT(11) UNSIGNED NOT NULL , +`weight` INT(11) UNSIGNED NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_webservice_account` ( + `id_webservice_account` int(11) NOT NULL AUTO_INCREMENT, + `key` varchar(32) NOT NULL, + `active` tinyint(2) NOT NULL, + PRIMARY KEY (`id_webservice_account`), + KEY `key` (`key`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_webservice_permission` ( + `id_webservice_permission` int(11) NOT NULL AUTO_INCREMENT, + `resource` varchar(50) NOT NULL, + `method` enum('GET','POST','PUT','DELETE') NOT NULL, + `id_webservice_account` int(11) NOT NULL, + PRIMARY KEY (`id_webservice_permission`), + UNIQUE KEY `resource_2` (`resource`,`method`,`id_webservice_account`), + KEY `resource` (`resource`), + KEY `method` (`method`), + KEY `id_webservice_account` (`id_webservice_account`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + + +/* PHP */ +/* PHP:editorial_update(); */; +/* PHP:reorderpositions(); */; +/* PHP:update_image_size_in_db(); */; +/* PHP:update_order_details(); */; +/* PHP:add_new_tab(AdminInformation, en:Configuration Information|fr:Informations|es:Informations|it:Informazioni di configurazione|de:Konfigurationsinformationen, 9); */; +/* PHP:add_new_tab(AdminCustomerThreads, en:Customer Service|de:Kundenservice|fr:SAV|es:Servicio al cliente|it:Servizio clienti, 29); */; +/* PHP:add_new_tab(AdminAddonsCatalog, fr:Catalogue de modules et thèmes|de:Module und Themenkatalog|en:Modules & Themes Catalog|it:Moduli & Temi catalogo, 7); */; +/* PHP:add_new_tab(AdminAddonsMyAccount, it:Il mio Account|de:Mein Konto|fr:Mon compte|en:My Account, 7); */; +/* PHP:add_new_tab(AdminPerformance, de:Leistung|en:Performance|it:Performance|fr:Performances|es:Rendimiento, 8); */; +/* PHP:add_new_tab(AdminThemes, es:Temas|it:Temi|de:Themen|en:Themes|fr:Thèmes, 7); */; +/* PHP:add_new_tab(AdminWebservice, fr:Service web|es:Web service|en:Webservice|de:Webservice|it:Webservice, 8); */; + diff --git a/install-dev/sql/upgrade/1.4.0.3.sql b/install-dev/sql/upgrade/1.4.0.3.sql new file mode 100644 index 000000000..55eb3d2eb --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.3.sql @@ -0,0 +1,67 @@ +SET NAMES 'utf8'; + +CREATE TABLE IF NOT EXISTS `PREFIX_country_tax` ( + `id_country_tax` int(11) NOT NULL AUTO_INCREMENT, + `id_country` int(11) NOT NULL, + `id_tax` int(11) NOT NULL, + PRIMARY KEY (`id_country_tax`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_country_tax` ( + `id_product` int(11) NOT NULL, + `id_country` int(11) NOT NULL, + `id_tax` int(11) NOT NULL, + UNIQUE KEY `id_product` (`id_product`,`id_country`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +DELETE FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules' LIMIT 1; +DELETE FROM `PREFIX_tab_lang` WHERE `id_tab` NOT IN (SELECT id_tab FROM `PREFIX_tab`); +DELETE FROM `PREFIX_access` WHERE `id_tab` NOT IN (SELECT id_tab FROM `PREFIX_tab`); + +INSERT INTO `PREFIX_module` (`name`, `active`) VALUES ('statsforecast', 1); +INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook` , `position`) (SELECT id_module, 32, (SELECT max_position from (SELECT MAX(position)+1 as max_position FROM `PREFIX_hook_module` WHERE `id_hook` = 32) tmp) FROM `PREFIX_module` WHERE `name` = 'statsforecast'); + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_GEOLOCATION_ENABLED', '0', NOW(), NOW()), +('PS_ALLOWED_COUNTRIES', +'AF;ZA;AX;AL;DZ;DE;AD;AO;AI;AQ;AG;AN;SA;AR;AM;AW;AU;AT;AZ;BS;BH;BD;BB;BY;BE;BZ;BJ;BM;BT;BO;BA;BW;BV;BR;BN;BG;BF;MM;BI;KY;KH;CM;CA;CV;CF;CL;CN;CX;CY;CC;CO;KM;CG;CD;CK;KR;KP;CR;CI;HR;CU;DK;DJ;DM;EG;IE;SV;AE;EC;ER;ES;EE;ET;FK;FO;FJ;FI;FR;GA;GM;GE;GS;GH;GI;GR;GD;GL;GP;GU;GT;GG;GN;GQ;GW;GY;GF;HT;HM;HN;HK;HU;IM;MU;VG;VI;IN;ID;IR;IQ;IS;IL;IT;JM;JP;JE;JO;KZ;KE;KG;KI;KW;LA;LS;LV;LB;LR;LY;LI;LT;LU;MO;MK;MG;MY;MW;MV;ML;MT;MP;MA;MH;MQ;MR;YT;MX;FM;MD;MC;MN;ME;MS;MZ;NA;NR;NP;NI;NE;NG;NU;NF;NO;NC;NZ;IO;OM;UG;UZ;PK;PW;PS;PA;PG;PY;NL;PE;PH;PN;PL;PF;PR;PT;QA;DO;CZ;RE;RO;UK;RU;RW;EH;BL;KN;SM;MF;PM;VA;VC;LC;SB;WS;AS;ST;SN;RS;SC;SL;SG;SK;SI;SO;SD;LK;SE;CH;SR;SJ;SZ;SY;TJ;TW;TZ;TD;TF;TH;TL;TG;TK;TO;TT;TN;TM;TC;TR;TV;UA;UY;US;VU;VE;VN;WF;YE;ZM;ZW', NOW(), NOW()), +('PS_GEOLOCATION_BEHAVIOR', '0', NOW(), NOW()); + +ALTER TABLE `PREFIX_orders` ADD `conversion_rate` decimal(13,6) NOT NULL default 1 AFTER `payment`; +UPDATE `PREFIX_orders` o SET o.`conversion_rate` = ( + SELECT c.`conversion_rate` + FROM `PREFIX_currency` c + WHERE c.`id_currency` = o.`id_currency` + LIMIT 1 +); + +ALTER TABLE `PREFIX_order_slip` ADD `conversion_rate` decimal(13,6) NOT NULL default 1 AFTER `id_order`; +UPDATE `PREFIX_order_slip` os SET os.`conversion_rate` = ( + SELECT o.`conversion_rate` + FROM `PREFIX_orders` o + WHERE os.`id_order` = o.`id_order` + LIMIT 1 +); + +UPDATE `PREFIX_configuration` SET `value` = 'gridhtml' WHERE `name` = 'PS_STATS_GRID_RENDER' LIMIT 1; +UPDATE `PREFIX_module` SET `name` = 'gridhtml' WHERE `name` = 'gridextjs' LIMIT 1; + +ALTER TABLE `PREFIX_attachment` CHANGE `mime` `mime` varchar(64) NOT NULL; +ALTER TABLE `PREFIX_attachment` ADD `file_name` varchar(128) NOT NULL default '' AFTER `file`; +UPDATE `PREFIX_attachment` a SET `file_name` = ( + SELECT `name` FROM `PREFIX_attachment_lang` al WHERE al.`id_attachment` = a.`id_attachment` AND al.`id_lang` = ( + SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_LANG_DEFAULT') + ); + +UPDATE `PREFIX_tab` SET `class_name` = 'AdminCMSContent' WHERE `class_name` = 'AdminCMS' LIMIT 1; + +SET @id_timezone = (SELECT `name` FROM `PREFIX_timezone` WHERE `id_timezone` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_TIMEZONE' LIMIT 1) LIMIT 1); +UPDATE `PREFIX_configuration` SET `value` = @id_timezone WHERE `name` = "PS_TIMEZONE" LIMIT 1; + +ALTER TABLE `PREFIX_country` ADD `id_currency` INT NOT NULL DEFAULT '0' AFTER `id_zone`; + +/* PHP */ +/* PHP:group_reduction_column_fix(); */; +/* PHP:ecotax_tax_application_fix(); */; +/* PHP:cms_block(); */; +/* PHP:add_new_tab(AdminGeolocation, es:Geolocalización|it:Geolocalizzazione|en:Geolocation|de:Geotargeting|fr:Géolocalisation, 8); */; diff --git a/install-dev/sql/upgrade/1.4.0.4.sql b/install-dev/sql/upgrade/1.4.0.4.sql new file mode 100644 index 000000000..9f5a803e7 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.4.sql @@ -0,0 +1,21 @@ +SET NAMES 'utf8'; +ALTER TABLE `PREFIX_product` CHANGE `ecotax` `ecotax` DECIMAL(21, 6) NOT NULL DEFAULT '0.00'; +/* PHP:move_crossselling(); */; + +UPDATE `PREFIX_cms` SET `id_cms_category` = 1; + +/* PHP:admin_stores_tab(); */; + +INSERT IGNORE INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) SELECT 'PS_LOCALE_LANGUAGE', l.`iso_code`, NOW(), NOW() FROM `PREFIX_configuration` c INNER JOIN `PREFIX_lang` l ON (l.`id_lang` = c.`value`) WHERE c.`name` = 'PS_LANG_DEFAULT'; +INSERT IGNORE INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) SELECT 'PS_LOCALE_COUNTRY', co.`iso_code`, NOW(), NOW() FROM `PREFIX_configuration` c INNER JOIN `PREFIX_country` co ON (co.`id_country` = c.`value`) WHERE c.`name` = 'PS_COUNTRY_DEFAULT'; +/* PHP:reorderpositions(); */; + +ALTER TABLE `PREFIX_webservice_permission` CHANGE `method` `method` ENUM( 'GET', 'POST', 'PUT', 'DELETE', 'HEAD' ) NOT NULL; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_ATTACHMENT_MAXIMUM_SIZE', '2', NOW(), NOW()), +('PS_SMARTY_CACHE', '1', NOW(), NOW()); + +ALTER TABLE `PREFIX_product_attribute` CHANGE `price` `price` decimal(20,6) NOT NULL default '0.000000'; +UPDATE `PREFIX_product_attribute` pa SET pa.`price` = pa.`price` / (1 + IFNULL((SELECT t.`rate` FROM `PREFIX_tax` t INNER JOIN `PREFIX_product` p ON (p.`id_tax` = t.`id_tax`) WHERE p.`id_product` = pa.`id_product`) ,0) / 100); + diff --git a/install-dev/sql/upgrade/1.4.0.5.sql b/install-dev/sql/upgrade/1.4.0.5.sql new file mode 100644 index 000000000..c13ce351c --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.5.sql @@ -0,0 +1,72 @@ +SET NAMES 'utf8'; + +SET @alias = (SELECT IFNULL((SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = "AdminAlias" LIMIT 1), '0')); +UPDATE `PREFIX_tab` SET `id_parent` = 8 WHERE `id_tab` = @alias LIMIT 1; +SET @stores = (SELECT IFNULL((SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = "AdminStores" LIMIT 1), '0')); +UPDATE `PREFIX_tab` SET `id_parent` = 9 WHERE `id_tab` = @stores LIMIT 1; +SET @pdf = (SELECT IFNULL((SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = "AdminPDF" LIMIT 1), '0')); +UPDATE `PREFIX_tab` SET `id_parent` = 3 WHERE `id_tab` = @pdf LIMIT 1; +SET @tabs = (SELECT IFNULL((SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = "AdminTabs" LIMIT 1), '0')); +UPDATE `PREFIX_tab` SET `id_parent` = 29 WHERE `id_tab` = @tabs LIMIT 1; + +ALTER TABLE `PREFIX_image_type` ADD `stores` tinyint(1) NOT NULL default '1'; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_FORCE_SMARTY_2', '0', NOW(), NOW()), +('PS_DIMENSION_UNIT', 'cm', NOW(), NOW()); + +ALTER TABLE `PREFIX_product` +ADD `width` FLOAT NOT NULL AFTER `location`, +ADD `height` FLOAT NOT NULL AFTER `width`, +ADD `depth` FLOAT NOT NULL AFTER `height`; + +SET @id_module = (SELECT IFNULL((SELECT `id_module` FROM `PREFIX_module` WHERE `name` = "statshome" LIMIT 1), '0')); +DELETE FROM `PREFIX_module` WHERE `id_module` = @id_module; +DELETE FROM `PREFIX_hook_module` WHERE `id_module` = @id_module; + +ALTER TABLE `PREFIX_customer` ADD `is_guest` TINYINT(1) NOT NULL DEFAULT '0' AFTER `deleted`; +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_GUEST_CHECKOUT_ENABLED', '0', NOW(), NOW()); + +ALTER TABLE `PREFIX_category` ADD `nleft` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `level_depth`; +ALTER TABLE `PREFIX_category` ADD `nright` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `nleft`; +ALTER TABLE `PREFIX_category` ADD INDEX `nleftright` (`nleft`, `nright`); + +ALTER TABLE `PREFIX_product` ADD `id_tax_rules_group` int(10) unsigned NOT NULL AFTER `id_tax`; +ALTER TABLE `PREFIX_carrier` ADD `id_tax_rules_group` int(10) unsigned NOT NULL AFTER `id_tax`; + +CREATE TABLE `PREFIX_tax_rule` ( +`id_tax_rules_group` INT NOT NULL , +`id_country` INT NOT NULL , +`id_state` INT NOT NULL , +`id_tax` INT NOT NULL , +`state_behavior` INT NOT NULL , +PRIMARY KEY ( `id_tax_rules_group`, `id_country` , `id_state` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE `PREFIX_tax_rules_group` ( +`id_tax_rules_group` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`name` VARCHAR( 32 ) NOT NULL , +`active` INT NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_help_access` ( + `id_help_access` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(45) NOT NULL, + `version` varchar(8) NOT NULL, + PRIMARY KEY (`id_help_access`), + UNIQUE KEY `label` (`label`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +/* PHP:add_new_tab(AdminTaxRulesGroup, it:Regimi fiscali|es:Reglas de Impuestos|fr:Règles de taxes|de:Steuerregeln|en:Tax Rules, 4); */; +/* PHP:generate_ntree(); */; +/* PHP:generate_tax_rules(); */; +/* PHP:id_currency_country_fix(); */; +/* PHP:update_modules_sql(); */; + +ALTER TABLE `PREFIX_product` DROP `id_tax`; +ALTER TABLE `PREFIX_carrier` DROP `id_tax`; + +DROP TABLE `PREFIX_tax_state`, `PREFIX_tax_zone`, `PREFIX_country_tax`; +ALTER TABLE `PREFIX_orders` ADD `carrier_tax_rate` DECIMAL(10, 3) NOT NULL default '0.00' AFTER `total_shipping`; + +INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES (NULL, 'beforeAuthentication', 'Before Authentication', 'Before authentication', 0); diff --git a/install-dev/sql/upgrade/1.4.0.6.sql b/install-dev/sql/upgrade/1.4.0.6.sql new file mode 100644 index 000000000..f3b33b76d --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.6.sql @@ -0,0 +1,12 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_customer` DROP INDEX `customer_email`; +ALTER TABLE `PREFIX_customer` ADD INDEX `customer_email` (`email`); + +ALTER TABLE `PREFIX_lang` ADD `language_code` char(5) NULL AFTER `iso_code`; +UPDATE `PREFIX_lang` SET language_code = iso_code; +ALTER TABLE `PREFIX_lang` MODIFY `language_code` char(5) NOT NULL; + +DELETE FROM `PREFIX_module` WHERE `name` = 'gridextjs' LIMIT 1; +DELETE FROM `PREFIX_hook_module` WHERE `id_module` NOT IN (SELECT id_module FROM `PREFIX_module`); +UPDATE `PREFIX_configuration` SET `value` = 'gridhtml' WHERE `name` = 'PS_STATS_GRID_RENDER' AND `value` = 'gridextjs' LIMIT 1; diff --git a/install-dev/sql/upgrade/1.4.0.7.sql b/install-dev/sql/upgrade/1.4.0.7.sql new file mode 100644 index 000000000..1edfbdac1 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.7.sql @@ -0,0 +1,10 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_product_attribute` ADD `minimal_quantity` int(10) unsigned NOT NULL DEFAULT '1' AFTER `default_on`; + +ALTER TABLE `PREFIX_orders` ADD `reference` VARCHAR(14) NOT NULL AFTER `id_address_invoice`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_DISPLAY_SUPPLIERS', '1', NOW(), NOW()); + +/* PHP:update_products_ecotax_v133(); */; + diff --git a/install-dev/sql/upgrade/1.4.0.8.sql b/install-dev/sql/upgrade/1.4.0.8.sql new file mode 100644 index 000000000..a35527ade --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.8.sql @@ -0,0 +1,21 @@ +SET NAMES 'utf8'; + +UPDATE `PREFIX_tab` +SET `position` = `position` + 1 +WHERE `id_parent` = (SELECT * FROM (SELECT `id_parent` FROM `PREFIX_tab` WHERE `class_name` = 'AdminTaxes') tmp) +AND `position` > (SELECT * FROM (SELECT `position` FROM `PREFIX_tab` WHERE `class_name` = 'AdminTaxes') tmp2); + +UPDATE `PREFIX_tab` +SET `position` = (SELECT * FROM (SELECT `position` FROM `PREFIX_tab` WHERE `class_name` = 'AdminTaxes') tmp) + 1 +WHERE `class_name` = 'AdminTaxRulesGroup'; + +UPDATE `PREFIX_hook` SET `title` = 'Category creation', description = '' WHERE `name` = 'categoryAddition' LIMIT 1; +UPDATE `PREFIX_hook` SET `title` = 'Category modification', description = '' WHERE `name` = 'categoryUpdate' LIMIT 1; +UPDATE `PREFIX_hook` SET `title` = 'Category removal', description = '' WHERE `name` = 'categoryDeletion' LIMIT 1; + +DELETE FROM `PREFIX_module` WHERE `name` = 'canonicalurl' LIMIT 1; +DELETE FROM `PREFIX_hook_module` WHERE `id_module` NOT IN (SELECT id_module FROM `PREFIX_module`); + +/* PHP:gridextjs_deprecated(); */; +/* PHP:shop_url(); */; +/* PHP:updateproductcomments(); */; \ No newline at end of file diff --git a/install-dev/sql/upgrade/1.4.0.9.sql b/install-dev/sql/upgrade/1.4.0.9.sql new file mode 100644 index 000000000..a975b0927 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.0.9.sql @@ -0,0 +1,16 @@ +SET NAMES 'utf8'; + +CREATE TABLE `PREFIX_specific_price_priority` ( +`id_specific_price_priority` INT NOT NULL AUTO_INCREMENT , +`id_product` INT NOT NULL , +`priority` VARCHAR( 80 ) NOT NULL , +PRIMARY KEY ( `id_specific_price_priority` , `id_product` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +ALTER TABLE `PREFIX_product` ADD `unit_price_ratio` DECIMAL(20, 6) NOT NULL default '0.00' AFTER `unit_price`; + +UPDATE `PREFIX_product` SET `unit_price_ratio` = IF (`unit_price` != 0, `price` / `unit_price`, 0); + +ALTER TABLE `PREFIX_product` DROP `unit_price`; + +ALTER TABLE `PREFIX_discount` ADD `behavior_not_exhausted` TINYINT(3) DEFAULT '1' AFTER `id_discount_type`; diff --git a/install-dev/sql/upgrade/1.4.1.0.sql b/install-dev/sql/upgrade/1.4.1.0.sql new file mode 100755 index 000000000..d49cab601 --- /dev/null +++ b/install-dev/sql/upgrade/1.4.1.0.sql @@ -0,0 +1,22 @@ +SET NAMES 'utf8'; + +INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0); + +INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES +( +(SELECT `id_module` FROM `PREFIX_module` WHERE `name` = 'blockcategories'), +(SELECT `id_hook` FROM `PREFIX_hook` WHERE `name` = 'afterSaveAdminMeta'), 1 +); + + +ALTER TABLE `PREFIX_webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT '0' AFTER `class_name` , +ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES +('PS_IMG_UPDATE_TIME', UNIX_TIMESTAMP(), NOW(), NOW()); + +UPDATE `PREFIX_cms_lang` set link_rewrite = "uber-uns" where link_rewrite like "%ber-uns"; + +ALTER TABLE `PREFIX_connections` CHANGE `ip_address` `ip_address` BIGINT NULL DEFAULT NULL; + +/* PHP:alter_cms_block(); */; diff --git a/install-dev/view.css b/install-dev/view.css new file mode 100644 index 000000000..7fb954a49 --- /dev/null +++ b/install-dev/view.css @@ -0,0 +1,590 @@ +@CHARSET "UTF-8"; + +/* +purple #d41958 + +green #7eb423 +*/ + +body{ + background-image : url(img/bg-body.png); + font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; +} + +a:link, a:active, a:visited{ + text-decoration:none; + color:#d41958; +} +a:hover{ + color:#7eb423; +} + +#container{ + margin:1em auto 0 auto; + width:930px; + padding:10px 30px 0px 30px; + font-size:0.8em; + background : #456d01 url(img/bg-ctnr.png) top repeat-x; + display:none; +} + +#loaderSpace{ + height:24px; +} +div#loader{ + float:right; + background-image:url(../img/loadingAnimation.gif); + height:13px; + width:208px; + color:white; + display:none; +} + +div#leftpannel{ + float:left; + width:250px; + margin-top: 15px; +} + +div#leftpannel div#help{ + width:175px; + height:129px; + margin:20px 0; + padding:5px; + background:url('img/bg_help.png') no-repeat; + font-family:Arial, sans-serif; +} +div#leftpannel div#help img.ico_help{float:left; margin:5px;} +div#leftpannel div#help div.content{ + float:right; + width:125px; +} +div#leftpannel div#help div.content p.title{color:#fff;font-weight:bold;font-size:10.5pt;margin:6pt 0 3px 0;} +div#leftpannel div#help div.content p.title_down{color:#383838;font-size:8pt;margin:0;} +div#leftpannel div#help div.content ul{margin:10px 0;padding:0;} +div#leftpannel div#help div.content ul li{clear:both;padding-bottom:5px;list-style-type:none;} +div#leftpannel div#help div.content ul li img, + div#leftpannel div#help div.content ul li a{ float:left; } +div#leftpannel div#help div.content ul li a{ + display:block; + margin-left:6px; + color:#fff; + font-weight:bold; + line-height:17px; + vertical-align:middle; + text-decoration:underline; +} + +ol#tabs{ + list-style-type:none; + margin:0; + padding:0; +} + +ol#tabs li{ + background-color:#CFE5BD; + font-size:1em; + height:25px; + padding-top:10px; + clear:both; + background-color:#699d0f; + color:white; + font-weight:bold; +} + +ol#tabs li.selected{ + background : url(img/bg-tab.png) repeat-x; + height:36px; + padding-top:23px; +} + +ol#tabs li.finished{ + font-weight:normal; +} +ol#tabs li span { + display:block; + padding-left:20px; + margin-left:20px; + height:18px; +} + +ol#tabs li span.number1 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/01-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number1 { + filter: none; + background: url('img/01-pt100.png') no-repeat; +} + + +ol#tabs li.selected span.number1 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/01-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number1 { + filter: none; + background: url('img/01-gd100.png') no-repeat; +} + + + +ol#tabs li.finished span.number1 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/01-pt70.png', sizingMethod='crop'); +} +html>body ol#tabs li.finished span.number1 { + filter: none; + background: url('img/01-pt70.png') no-repeat; +} + +ol#tabs li span.number2 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/02-pt100.png', sizingMethod='crop'); +} +html>body ol#tabs li span.number2 { + filter: none; + background: url('img/02-pt100.png') no-repeat; +} + + + +ol#tabs li.selected span.number2 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/02-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number2 { + filter: none; + background: url('img/02-gd100.png') no-repeat; +} + + +ol#tabs li.finished span.number2 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/02-pt70.png', sizingMethod='crop'); +} +html>body ol#tabs li.finished span.number2 { + filter: none; + background: url('img/02-pt70.png') no-repeat; +} + +ol#tabs li span.number3 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/03-pt100.png', sizingMethod='crop'); +} +html>body ol#tabs li span.number3 { + filter: none; + background: url('img/03-pt100.png') no-repeat; +} + +ol#tabs li.selected span.number3 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/03-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number3 { + filter: none; + background: url('img/03-gd100.png') no-repeat; +} + +ol#tabs li.finished span.number3 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/03-pt70.png', sizingMethod='crop'); +} +html>body ol#tabs li.finished span.number3 { + filter: none; + background: url('img/03-pt70.png') no-repeat; +} + +ol#tabs li span.number4 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/04-pt100.png', sizingMethod='crop'); +} +html>body ol#tabs li span.number4 { + filter: none; + background: url('img/04-pt100.png') no-repeat; +} + +ol#tabs li.selected span.number4 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/04-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number4 { + filter: none; + background: url('img/04-gd100.png') no-repeat; +} + +ol#tabs li.finished span.number4 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/04-pt70.png', sizingMethod='crop'); +} +html>body ol#tabs li.finished span.number4 { + filter: none; + background: url('img/04-pt70.png') no-repeat; +} + +ol#tabs li span.number5 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/05-pt100.png', sizingMethod='crop'); +} +html>body ol#tabs li span.number5 { + filter: none; + background: url('img/05-pt100.png') no-repeat; +} + +ol#tabs li.selected span.number5 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/05-gd100.png', sizingMethod='crop'); +} +html>body ol#tabs li.selected span.number5 { + filter: none; + background: url('img/05-gd100.png') no-repeat; +} + +ol#tabs li.finished span.number5 { + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/05-pt70.png', sizingMethod='crop'); +} +html>body ol#tabs li.finished span.number5 { + filter: none; + background: url('img/05-pt70.png') no-repeat; +} + +div#sheets { + float:left; + background-color:white; + margin-top:15px; + min-height:400px; + +} +* html div#sheets { + height: 400px; +} + +#sheets div.sheet{ + display:none; + width:650px; + padding:1em; +} + +h1{ + color:#7EB423; + margin:0; + text-align:center; +} + +h2{ + color:#7EB423; + font-size:1.3em; + margin:0pt 0pt 0.5em; + text-transform:uppercase; + font-weight:bold; +} + +h3{ + color:#d41958; + margin:2em 0; + font-size:0.9em; +} +p{ + margin : 0.5em 0; +} + +#sheets div#sheet_lang{ + display:block; +} + +ul#langList { + list-style-type:none; +} + +ul#langList img { + margin:0 2px; +} + +input.button { + background:transparent url(img/bt.png) no-repeat scroll 0%; + border:medium none; + color:white; + font-size:0.97em; + font-weight:bold; + margin:0pt 0.1em; + height:26px; + width:177px; + padding-bottom:0.3em; +} +input.button.little{ + background : url(img/boutonpt-on.png) no-repeat; + height:23px; + width:102px; +} + +input.button:hover { + background : url(img/bt-hover.png) no-repeat; +} +input.button.little:hover{ + background : url(img/boutonpt-over.png) no-repeat; +} + +input.button.disabled { + background : url(img/bt-dsbl.png) no-repeat; +} +input.button.little.disabled{ + background : url(img/boutonpt-disabled.png) no-repeat; +} + + +label.disabled, p.disabled{ + color:gray; +} + +input.text { + border:1px gray solid; + width:175px; +} +input.text.required { + border-color:#D41958; +} + +div#buttons{ + clear:both; + margin-right:2px; + margin-bottom:0px; + margin-top:0px; + text-align:right; + height:70px; +} + +* html div#buttons { + margin-bottom:60px; + margin-top:-30px; +} + +div#buttons input{ + margin-top :5px; + margin-left :5px; +} + +div#sheet_require ul, div#sheet_require_update ul{ + list-style-type:none; +} + +div#sheets .ok{ + padding-left: 20px; + background: url(img/ok.gif) left no-repeat; +} + +div#sheets .fail{ + font-weight:bold; + padding-left: 20px; + background: url(img/bad.gif) left no-repeat; + color:#D41958; +} + +.userInfos{ + color:gray; + font-style:italic; + font-size:0.85em; +} +p.userInfos.aligned{ + margin-left:160px; +} + +div#mailSMTPParam{ + display:none; +} + +img#uploadedImage{ + border:3px dashed #E0E0E0; + margin:auto; + padding:3px; +} +ul#footer{ + margin-top:5px; + list-style-type:none; + text-align:center; + font-size:0.7em; + margin-bottom:2px; + color:white; +} +ul#footer li{ + display:inline; +} + +ul#footer a:link, ul#footer a:active, ul#footer a:visited{ + text-decoration:none; + color:white; +} +ul#footer a:hover{ + color:#7eb423; +} + + +label.aligned{ + width:245px; + float:left; + display:block; + text-align:right; + margin-right:1em; +} +input.aligned{ + margin-left:258px; +} +* html input.aligned{ + margin-left:0; +} +span.aligned{ + margin-left:258px; +} +div.field { + margin-bottom:1.5em; +} +span.result{ + display:none; +} +div#disclaimerDivCertify{ + text-align:center; +} +div#updateLog{ + height:200px; + width:100%; + border:gray 1px dashed; + overflow:auto; + display:none; +} + +table#resultInstall{ + width:100%; + margin:10px auto 5px auto; + border:none; +} +table#resultInstall td{ + border-bottom:3px solid #FFF; + background:#F5FFE4; + padding:5px; +} +table#resultInstall td.label{ + width:35%; + text-align:right; +} +table#resultInstall td.resultEnd{width:65%;color:#D41956;font-weight:bold;} +p#alignedLogo{ + text-align:center; +} + +form.aligned{ + border:1px dashed gray; + padding:10px; + width:60%; + margin:20px 0; +} +form.aligned p{ +height:30px; +} +form.aligned label { + display:block; + width:150px; + float:left; +} +form.aligned input.text { + display:block; + width:150px; + float:left; +} + +p.aligned{ + text-align:center; +} +li.title{ + font-weight:bold; + margin:0.5em 0; +} +#infosFirstname{ + text-transform:capitalize; +} +div.request{ + border-top:1px gray dotted; + margin-top:10px; + padding-top:10px; +} +div#PrestaShopLogo{ + background:none; + width:233px; + height:68px; + text-indent:-1000px; + margin:0 auto; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/logo.png', sizingMethod='crop'); +} +html>body div#PrestaShopLogo { + filter: none; + background: url(img/logo.png) left no-repeat; +} + +div.installerVersion, div.updaterVersion { + color:#FFFFFF; + font-size:14px; + text-align:left; + padding:10px; + text-transform:uppercase; +} + +p#dbResultCheck{ + height:auto; +} +div#resultEnd{ + clear:both; +} + +div#noJavaScript{ + margin: 100px 200px 20px 200px; + padding: 100px 30px; + background-color: white; + text-align: center; +} + +a#access, a#access_update{ + display:block; + width:300px; + height:150px; + background:url('img/btn-installeur.png') top left; + font-family:Arial, sans-serif; +} +a#access:hover,a#access_update:hover{background:url('img/btn-installeur.png') bottom left;} +a#access.BO{float:left;} +a#access.FO{float:right;} +a#access span{display:block;} +a#access span.title{margin:5px 15px;font-size:18pt;font-weight:bold;color:#FFF;} +a#access span.description{margin:10px 20px;color:#FFF;height:63px;} +a#access span.message{margin-left:20px;font-weight:bold;color:#FFF;} +a#access_update{float:left;} +a#access_update span{display:block;} +a#access_update span.title{margin:5px 15px;font-size:18pt;font-weight:bold;color:#FFF;} +a#access_update span.description{margin:10px 20px;color:#FFF;height:63px;} +a#access_update span.message{margin-left:20px;font-weight:bold;color:#FFF;} +h3.no-margin{margin:0;} +iframe#prestastore{width:100%;height:430px;border:none;margin:0px;} +iframe#prestastore_update{clear:both;width:100%;height:430px;border:none;margin-top:15px;} +p#php5_nok { + color:#fff; +} +p#php5_nok a { + color:#fff; + font-weight:bold; + text-decoration:underline; +} +#resultConfigHelper a{ + text-decoration:underline; +} + +#phone_block{ + font-size: 16px; + color: #fff; + height: 25px; + width: 225px; + margin-left: 3px; +} + +#phone_block span{ + font-size: 11px; + display: block; + width: 185px; +} diff --git a/install-dev/xml/checkConfig.php b/install-dev/xml/checkConfig.php new file mode 100644 index 000000000..45cffbc54 --- /dev/null +++ b/install-dev/xml/checkConfig.php @@ -0,0 +1,78 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date dans le passé +include_once(INSTALL_PATH.'/classes/ConfigurationTest.php'); + +// Functions list to test with 'test_system' +$funcs = array('fopen', 'fclose', 'fread', 'fwrite', 'rename', 'file_exists', 'unlink', 'rmdir', 'mkdir', 'getcwd', 'chdir', 'chmod'); + +// Test list to execute (function/args) +$tests = array( + 'phpversion' => false, + 'upload' => false, + 'system' => $funcs, + 'gd' => false, + 'mysql_support' => false, + 'config_dir' => INSTALL_PATH.'/../config/', + 'tools_dir' => INSTALL_PATH.'/../tools/smarty/compile/', + 'cache_dir' => INSTALL_PATH.'/../tools/smarty/cache/', + 'tools_v2_dir' => INSTALL_PATH.'/../tools/smarty_v2/compile/', + 'cache_v2_dir' => INSTALL_PATH.'/../tools/smarty_v2/cache/', + 'sitemap' => INSTALL_PATH.'/../sitemap.xml', + 'img_dir' => INSTALL_PATH.'/../img/', + 'mails_dir' => INSTALL_PATH.'/../mails/', + 'module_dir' => INSTALL_PATH.'/../modules/', + 'theme_lang_dir' => INSTALL_PATH.'/../themes/prestashop/lang/', + 'theme_cache_dir' => INSTALL_PATH.'/../themes/prestashop/cache/', + 'translations_dir' => INSTALL_PATH.'/../translations/', + 'customizable_products_dir' => INSTALL_PATH.'/../upload/', + 'virtual_products_dir' => INSTALL_PATH.'/../download/', +); +$tests_op = array( + 'fopen' => false, + 'register_globals' => false, + 'gz' => false, + 'mcrypt' => false, +); + +// Execute tests +$res = ConfigurationTest::check($tests); +$res_op = ConfigurationTest::check($tests_op); + +// Building XML Tree... +echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + foreach ($res AS $key => $line) + echo ''."\n"; + echo ''."\n"; + echo ''."\n"; + foreach ($res_op AS $key => $line) + echo ''."\n"; + echo ''."\n"; +echo ''; diff --git a/install-dev/xml/checkDB.php b/install-dev/xml/checkDB.php new file mode 100644 index 000000000..62b1f456c --- /dev/null +++ b/install-dev/xml/checkDB.php @@ -0,0 +1,29 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true, $_GET['engine']); +die("\n"); diff --git a/install-dev/xml/checkMail.php b/install-dev/xml/checkMail.php new file mode 100644 index 000000000..91b9aa982 --- /dev/null +++ b/install-dev/xml/checkMail.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); + +$smtpChecked = (trim($_GET['mailMethod']) == 'smtp'); +$smtpServer = $_GET['smtpSrv']; +$content = $_GET['testMsg']; +$subject = $_GET['testSubject']; +$type = 'text/html'; +$to = $_GET['testEmail']; +$from = 'no-reply@'.ToolsInstall::getHttpHost(false, true); +$smtpLogin = $_GET['smtpLogin']; +$smtpPassword = $_GET['smtpPassword']; +$smtpPort = $_GET['smtpPort']; +$smtpEncryption = $_GET['smtpEnc']; + +$result = ToolsInstall::sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort, $smtpEncryption); +die($result ? '' : ''); + diff --git a/install-dev/xml/checkShopInfos.php b/install-dev/xml/checkShopInfos.php new file mode 100644 index 000000000..bbaa6967c --- /dev/null +++ b/install-dev/xml/checkShopInfos.php @@ -0,0 +1,269 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (function_exists('date_default_timezone_set')) + date_default_timezone_set('Europe/Paris'); + +define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); +define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string')); + +include(INSTALL_PATH.'/classes/AddConfToFile.php'); +include(INSTALL_PATH.'/../classes/Validate.php'); +include(INSTALL_PATH.'/../classes/Db.php'); +include(INSTALL_PATH.'/../classes/Tools.php'); +include_once(INSTALL_PATH.'/../config/settings.inc.php'); + +function isFormValid() +{ + global $error; + $validInfos = true; + foreach ($error as $anError) + if ($anError != '') + $validInfos = false; + return $validInfos; +} + +$error = array(); +foreach ($_GET AS &$var) +{ + if (is_string($var)) + $var = html_entity_decode($var, ENT_COMPAT, 'UTF-8'); + elseif (is_array($var)) + foreach ($var AS &$row) + $row = html_entity_decode($row, ENT_COMPAT, 'UTF-8'); +} + +if(!isset($_GET['infosShop']) OR empty($_GET['infosShop'])) + $error['infosShop'] = '0'; +else + $error['infosShop'] = ''; + +if(!isset($_GET['infosFirstname']) OR empty($_GET['infosFirstname'])) + $error['infosFirstname'] = '0'; +else + $error['infosFirstname'] = ''; + +if(!isset($_GET['infosName']) OR empty($_GET['infosName'])) + $error['infosName'] = '0'; +else + $error['infosName'] = ''; + +if(isset($_GET['infosEmail']) AND !Validate::isEmail($_GET['infosEmail'])) + $error['infosEmail'] = '3'; +else + $error['infosEmail'] = ''; + +if (isset($_GET['infosShop']) AND !Validate::isGenericName($_GET['infosShop'])) + $error['validateShop'] = '46'; +else + $error['validateShop'] = ''; + +if (isset($_GET['infosFirstname']) AND !Validate::isName($_GET['infosFirstname'])) + $error['validateFirstname'] = '47'; +else + $error['validateFirstname'] = ''; + +if (isset($_GET['infosName']) AND !Validate::isName($_GET['infosName'])) + $error['validateName'] = '48'; +else + $error['validateName'] = ''; + +if (isset($_GET['catalogMode']) AND !Validate::isInt($_GET['catalogMode'])) + $error['validateCatalogMode'] = '52'; +else + $error['validateCatalogMode'] = ''; + +if(!isset($_GET['infosEmail']) OR empty($_GET['infosEmail'])) + $error['infosEmail'] = '0'; + +if (!isset($_GET['infosPassword']) OR empty($_GET['infosPassword'])) + $error['infosPassword'] = '0'; +else + $error['infosPassword'] = ''; + +if (!isset($_GET['infosPasswordRepeat']) OR empty($_GET['infosPasswordRepeat'])) + $error['infosPasswordRepeat'] = '0'; +else + $error['infosPasswordRepeat'] = ''; + +if($error['infosPassword'] == '' AND $_GET['infosPassword'] != $_GET['infosPasswordRepeat']) + $error['infosPassword'] = '2'; + +if($error['infosPassword'] == '' AND (Tools::strlen($_GET['infosPassword']) < 8 OR !Validate::isPasswdAdmin($_GET['infosPassword']))) + $error['infosPassword'] = '12'; + +///////////////////////////// +// IF ALL IS OK DO THE NEXT// +///////////////////////////// + +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +$dbInstance = Db::getInstance(); +// set Languages +$error['infosLanguages'] = ''; +if(isFormValid()) +{ + /*$idDefault = array_search($_GET['infosDL'][0], $_GET['infosWL']) + 1; + //prepare the requests + $sqlLanguages = array(); + + $sqlLanguages[] = "UPDATE `"._DB_PREFIX_."configuration` SET `value` = '".$idDefault."' WHERE `"._DB_PREFIX_."configuration`.`id_configuration` =1"; + $sqlLanguages[] = "TRUNCATE TABLE `"._DB_PREFIX_."lang`"; + + foreach ($_GET['infosWL'] AS $wl) + $sqlLanguages[] = "INSERT INTO `"._DB_PREFIX_."lang` (`id_lang` ,`name` ,`active` ,`iso_code`)VALUES (NULL , '".ToolsInstall::getLangString($wl)."', '1', '".pSQL($wl)."')"; + foreach($sqlLanguages AS $query) + if(!Db::getInstance()->Execute($query)) + $error['infosLanguages'] = '11'; + + // Flags copy + if(!$languagesId = Db::getInstance()->ExecuteS('SELECT `id_lang`, `iso_code` FROM `'._DB_PREFIX_.'lang`')) + $error['infosLanguages'] = '11'; + + unset($dbInstance);*/ +} + +// Mail Notification +$error['infosNotification'] = ''; +if (isFormValid()) +{ + if (isset($_GET['infosNotification']) AND $_GET['infosNotification'] == 'on') { + include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); + $smtpChecked = (trim($_GET['infosMailMethod']) == 'smtp'); + $smtpServer = $_GET['smtpSrv']; + $subject = $_GET['infosShop']." - " . $_GET['mailSubject']; + $type = 'text/html'; + $to = $_GET['infosEmail']; + $from = "no-reply@".ToolsInstall::getHttpHost(false, true); + $smtpLogin = $_GET['smtpLogin']; + $smtpPassword = $_GET['smtpPassword']; + $smtpPort = $_GET['smtpPort'];//'default','secure' + $smtpEncryption = $_GET['smtpEnc'];//"tls","ssl","off" + $content = ToolsInstall::getNotificationMail($_GET['infosShop'], INSTALLER__PS_BASE_URI_ABSOLUTE, INSTALLER__PS_BASE_URI_ABSOLUTE."img/logo.jpg", ToolsInstall::strtoupper($_GET['infosFirstname']), $_GET['infosName'], $_GET['infosPassword'], $_GET['infosEmail']); + + $result = @ToolsInstall::sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort, $smtpEncryption); + } +} + +//Insert configuration parameters into the database +$error['infosInsertSQL'] = ''; +if (isFormValid()) +{ + $sqlParams = array(); + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_DOMAIN', '".Tools::getHttpHost()."', NOW(), NOW())"; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_DOMAIN_SSL', '".Tools::getHttpHost()."', NOW(), NOW())"; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_INSTALL_VERSION', '".pSQL(INSTALL_VERSION)."', NOW(), NOW())"; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_NAME', '".pSQL($_GET['infosShop'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_EMAIL', '".pSQL($_GET['infosEmail'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_METHOD', '".pSQL($_GET['infosMailMethod'] == "smtp" ? "2": "1")."', NOW(), NOW())"; + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = \''.pSQL($_GET['isoCode']).'\' WHERE name = \'PS_LOCALE_LANGUAGE\''; + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = \''.(int)$_GET['catalogMode'].'\' WHERE name = \'PS_CATALOG_MODE\''; + $sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_ACTIVITY', '".(int)($_GET['infosActivity'])."', NOW(), NOW())"; + if ((int)($_GET['infosCountry']) != 0) + { + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = '.(int)($_GET['infosCountry']).' WHERE name = \'PS_COUNTRY_DEFAULT\''; + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = "'.pSQL($_GET['infosTimezone']).'" WHERE name = \'PS_TIMEZONE\''; + $sql_isocode = Db::getInstance()->getValue('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($_GET['infosCountry'])); + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = \''.pSQL($sql_isocode).'\' WHERE name = \'PS_LOCALE_COUNTRY\''; + + } + Language::loadLanguages(); + Configuration::loadConfiguration(); + require_once(dirname(__FILE__).'/../../config/defines.inc.php'); + require_once(dirname(__FILE__).'/../../classes/LocalizationPack.php'); + + + $context = stream_context_create(array('http' => array('timeout' => 5))); + $localization_file = @Tools::file_get_contents('http://www.prestashop.com/download/localization_pack.php?country='.$_GET['countryName'], false, $context); + if (!$localization_file AND file_exists(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml')) + $localization_file = @file_get_contents(dirname(__FILE__).'/../../localization/'.strtolower($_GET['countryName']).'.xml'); + if ($localization_file) + { + $localizationPack = new LocalizationPackCore(); + $localizationPack->loadLocalisationPack($localization_file, '', true); + if (Configuration::get('PS_LANG_DEFAULT') == 1) + { + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = (SELECT id_lang FROM '._DB_PREFIX_.'lang WHERE iso_code = \''.pSQL($_GET['isoCode']).'\') WHERE name = \'PS_LANG_DEFAULT\''; + } + } + if (isset($_GET['infosMailMethod']) AND $_GET['infosMailMethod'] == "smtp") + { + $sqlParams[] = "INSERT INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_SERVER', '".pSQL($_GET['smtpSrv'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_USER', '".pSQL($_GET['smtpLogin'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_PASSWD', '".pSQL($_GET['smtpPassword'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_SMTP_ENCRYPTION', '".pSQL($_GET['smtpEnc'])."', NOW(), NOW())"; + $sqlParams[] = "INSERT INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_MAIL_SMTP_PORT', '".pSQL($_GET['smtpPort'])."', NOW(), NOW())"; + } + $sqlParams[] = 'INSERT INTO '._DB_PREFIX_.'employee (id_employee, lastname, firstname, email, passwd, last_passwd_gen, bo_theme, active, id_profile, id_lang) VALUES (NULL, \''.pSQL(ToolsInstall::ucfirst($_GET['infosName'])).'\', \''.pSQL(ToolsInstall::ucfirst($_GET['infosFirstname'])).'\', \''.pSQL($_GET['infosEmail']).'\', \''.md5(pSQL(_COOKIE_KEY_.$_GET['infosPassword'])).'\', \''.date('Y-m-d h:i:s', strtotime('-360 minutes')).'\', \'oldschool\', 1, 1, (SELECT `value` FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE "PS_LANG_DEFAULT"))'; + $sqlParams[] = 'INSERT INTO '._DB_PREFIX_.'contact (id_contact, email, customer_service) VALUES (NULL, \''.pSQL($_GET['infosEmail']).'\', 1), (NULL, \''.pSQL($_GET['infosEmail']).'\', 1)'; + + if (function_exists('mcrypt_encrypt')) + { + $settings = file_get_contents(dirname(__FILE__).'/../../config/settings.inc.php'); + if (!strstr($settings, '_RIJNDAEL_KEY_')) + { + $key_size = mcrypt_get_key_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); + $key = Tools::passwdGen($key_size); + $settings = preg_replace('/define\(\'_COOKIE_KEY_\', \'([a-z0-9=\/+-_]+)\'\);/i', 'define(\'_COOKIE_KEY_\', \'\1\');'."\n".'define(\'_RIJNDAEL_KEY_\', \''.$key.'\');', $settings); + } + if (!strstr($settings, '_RIJNDAEL_IV_')) + { + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); + $iv = base64_encode(mcrypt_create_iv($iv_size, MCRYPT_RAND)); + $settings = preg_replace('/define\(\'_COOKIE_IV_\', \'([a-z0-9=\/+-_]+)\'\);/i', 'define(\'_COOKIE_IV_\', \'\1\');'."\n".'define(\'_RIJNDAEL_IV_\', \''.$iv.'\');', $settings); + } + if (file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $settings)) + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = 1 WHERE name = \'PS_CIPHER_ALGORITHM\''; + } + + if (file_exists(realpath(INSTALL_PATH.'/../img').'/logo.jpg')) + { + list($width, $height, $type, $attr) = getimagesize(realpath(INSTALL_PATH.'/../img').'/logo.jpg'); + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = '.(int)round($width).' WHERE name = \'SHOP_LOGO_WIDTH\''; + $sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = '.(int)round($height).' WHERE name = \'SHOP_LOGO_HEIGHT\''; + } + + if ((int)$_GET['catalogMode'] == 1) + { + $sqlParams[] = 'DELETE c, cl FROM `'._DB_PREFIX_.'cms` AS c LEFT JOIN `'._DB_PREFIX_.'cms_lang` AS cl ON c.id_cms = cl.id_cms WHERE 1 AND c.`id_cms` IN (1, 5)'; + } + + $dbInstance = Db::getInstance(); + foreach($sqlParams as $query) + if(!$dbInstance->Execute($query)) + $error['infosInsertSQL'] = '11'; + unset($dbInstance); +} + +////////////////////////// +// Building XML Response// +////////////////////////// + +echo ''."\n"; +foreach ($error AS $key => $line) + echo ''."\n"; +echo ''; + diff --git a/install-dev/xml/createDB.php b/install-dev/xml/createDB.php new file mode 100644 index 000000000..d715a57d1 --- /dev/null +++ b/install-dev/xml/createDB.php @@ -0,0 +1,213 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (function_exists('date_default_timezone_set')) + date_default_timezone_set('Europe/Paris'); + +//delete settings file if it exist +if (file_exists(SETTINGS_FILE)) + if (!unlink(SETTINGS_FILE)) + die(''."\n"); + +include(INSTALL_PATH.'/classes/AddConfToFile.php'); +include(INSTALL_PATH.'/../classes/Validate.php'); +include(INSTALL_PATH.'/../classes/Db.php'); +include(INSTALL_PATH.'/../classes/Tools.php'); + +//check db access +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true, $_GET['engine']); +if ($resultDB !== true){ + die("\n"); +} + + +// Check POST data... +$data_check = array( + !isset($_GET['mode']) OR ( $_GET['mode'] != "full" AND $_GET['mode'] != "lite"), + !isset($_GET['tablePrefix']) OR !Validate::isMailName($_GET['tablePrefix']) OR !preg_match('/^[a-z0-9_]*$/i', $_GET['tablePrefix']) +); +foreach ($data_check AS $data) + if ($data) + die(''."\n"); + +// Writing data in settings file +$oldLevel = error_reporting(E_ALL); +$__PS_BASE_URI__ = str_replace(' ', '%20', INSTALLER__PS_BASE_URI); +$datas = array( + array('_DB_SERVER_', trim($_GET['server'])), + array('_DB_TYPE_', trim($_GET['type'])), + array('_DB_NAME_', trim($_GET['name'])), + array('_DB_USER_', trim($_GET['login'])), + array('_DB_PASSWD_', trim($_GET['password'])), + array('_DB_PREFIX_', trim($_GET['tablePrefix'])), + array('_MYSQL_ENGINE_', $_GET['engine']), + array('__PS_BASE_URI__', $__PS_BASE_URI__), + array('_PS_CACHING_SYSTEM_', 'MCached'), + array('_PS_CACHE_ENABLED_', '0'), + array('_MEDIA_SERVER_1_', ''), + array('_MEDIA_SERVER_2_', ''), + array('_MEDIA_SERVER_3_', ''), + array('_THEME_NAME_', 'prestashop'), + array('_COOKIE_KEY_', Tools::passwdGen(56)), + array('_COOKIE_IV_', Tools::passwdGen(8)), + array('_PS_CREATION_DATE_', date('Y-m-d')), + array('_PS_VERSION_', INSTALL_VERSION) +); +error_reporting($oldLevel); +$confFile = new AddConfToFile(SETTINGS_FILE, 'w'); +if ($confFile->error) + die(''."\n"); + +foreach ($datas AS $data){ + $confFile->writeInFile($data[0], $data[1]); +} +$confFile->writeEndTagPhp(); + +// Settings updated, compile and cache directories must be emptied +foreach (array(INSTALL_PATH.'/../tools/smarty/cache/', INSTALL_PATH.'/../tools/smarty/compile/', INSTALL_PATH.'/../tools/smarty_v2/cache/', INSTALL_PATH.'/../tools/smarty_v2/compile/') as $dir) + if (file_exists($dir)) + foreach (scandir($dir) as $file) + if ($file[0] != '.' AND $file != 'index.php') + unlink($dir.$file); + +if ($confFile->error != false) + die(''."\n"); + +//load new settings +include(SETTINGS_FILE); + +//----------- +//import SQL data +//----------- +switch (_DB_TYPE_) { + case "MySQL" : + + $filePrefix = 'PREFIX_'; + $engineType = 'ENGINE_TYPE'; + //send the SQL structure file requests + $structureFile = dirname(__FILE__)."/../sql/db.sql"; + if(!file_exists($structureFile)) + die(''."\n"); + $db_structure_settings =""; + if ( !$db_structure_settings .= file_get_contents($structureFile) ) + die(''."\n"); + $db_structure_settings = str_replace(array($filePrefix, $engineType), array($_GET['tablePrefix'], $_GET['engine']), $db_structure_settings); + $db_structure_settings = preg_split("/;\s*[\r\n]+/",$db_structure_settings); + if (isset($_GET['dropAndCreate']) && $_GET['dropAndCreate'] == 'true') + { + array_unshift($db_structure_settings, 'USE `'.trim($_GET['name']).'`;'); + array_unshift($db_structure_settings, 'CREATE DATABASE `'.trim($_GET['name']).'`;'); + array_unshift($db_structure_settings, 'DROP DATABASE `'.trim($_GET['name']).'`;'); + } + foreach($db_structure_settings as $query){ + $query = trim($query); + if(!empty($query)){ + if(!Db::getInstance()->Execute($query)){ + if(Db::getInstance()->getNumberError() == 1050){ + die(''."\n"); + } else { + die( + '' + ); + } + } + } + } + + //send the SQL data file requests + + $db_data_settings = ""; + + $liteFile = dirname(__FILE__)."/../sql/db_settings_lite.sql"; + if(!file_exists($liteFile)) + die(''."\n"); + if ( !$db_data_settings .= file_get_contents( $liteFile ) ) + die(''."\n"); + + if($_GET['mode'] == "full"){ + $fullFile = dirname(__FILE__)."/../sql/db_settings_extends.sql"; + if(!file_exists($fullFile)) + die(''."\n"); + if (!$db_data_settings .= file_get_contents($fullFile)) + die(''."\n"); + } + $db_data_settings .= "\n".'UPDATE `PREFIX_customer` SET `passwd` = \''.md5(_COOKIE_KEY_.'123456789').'\' WHERE `id_customer` =1'; + $db_data_settings = str_replace(array($filePrefix, $engineType), array($_GET['tablePrefix'], $_GET['engine']), $db_data_settings); + $db_data_settings = preg_split("/;\s*[\r\n]+/",$db_data_settings); + /* UTF-8 support */ + array_unshift($db_data_settings, 'SET NAMES \'utf8\';'); + foreach($db_data_settings as $query){ + $query = trim($query); + if(!empty($query)){ + if(!Db::getInstance()->Execute($query)){ + if(Db::getInstance()->getNumberError() == 1050){ + die(''."\n"); + } else { + die( + '' + ); + } + } + } + } + break; +} +$xml = ''."\n"; + +$countries = Db::getInstance()->ExecuteS(' +SELECT c.`id_country`, cl.`name`, c.`iso_code` FROM `'.$_GET['tablePrefix'].'country` c +INNER JOIN `'.$_GET['tablePrefix'].'country_lang` cl ON (c.`id_country` = cl.`id_country`) +WHERE cl.`id_lang` = '.(int)($_GET['language'] + 1).' +ORDER BY cl.`name`'); + +$timezones = Db::getInstance()->ExecuteS(' +SELECT * FROM `'.$_GET['tablePrefix'].'timezone` +ORDER BY `name`'); + +$xml .= ''."\n"; +foreach ($countries as $country) + $xml .= "\t".''."\n"; +$xml .= ''."\n".''."\n"; +foreach ($timezones as $timezone) + $xml .= "\t".''."\n"; +$xml .= ''."\n"; + +die($xml); + diff --git a/install-dev/xml/doUpgrade.php b/install-dev/xml/doUpgrade.php new file mode 100644 index 000000000..750ec4edb --- /dev/null +++ b/install-dev/xml/doUpgrade.php @@ -0,0 +1,293 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$filePrefix = 'PREFIX_'; +$engineType = 'ENGINE_TYPE'; + +if (function_exists('date_default_timezone_set')) + date_default_timezone_set('Europe/Paris'); + +define('_PS_MODULE_DIR_', realpath(INSTALL_PATH).'/../modules/'); +define('_PS_INSTALLER_PHP_UPGRADE_DIR_', 'php/'); + +// utf-8 conversion if needed (before v0.9.8.1 utf-8 was badly supported) +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'utf8.php'); +// Configuration cleaner in order to get unique configuration names +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'confcleaner.php'); +// Order number in goal to add a number to each old orders +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'invoicenumber.php'); +// Order number in goal to add a number to each old orders +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'deliverynumber.php'); +// Set all groups for home category +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'setallgroupsonhomecategory.php'); +// Set payment module for each currency/country +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'setpaymentmodule.php'); +// Set payment module for each group +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'setpaymentmodulegroup.php'); +// Set discount for all categories +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'setdiscountcategory.php'); +// Module installation tools +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'module_tools.php'); +// Customizations +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'customizations.php'); +// Block newsletter +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'blocknewsletter.php'); +// Reorder product positions for drag an drop +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'reorderpositions.php'); +// Clean some module sql structures +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'updatemodulessql.php'); +// Clean carrier URL +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'updatecarrierurl.php'); +// Convert prices to the new 1.3 rounding system +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'price_converter.php'); +// Update editorial module to delete all xml methods +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'editorial_update.php'); +// Update logo and editorial image size +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_image_size_in_db.php'); +// Update product comments +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'updateproductcomments.php'); +// Update order details +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_order_details.php'); +// Update database structure (use algorithms requiring PHP) +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'database_structure.php'); +// Update cms block +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'cms_block.php'); +// Move crossselling +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'move_crossselling.php'); +// adminstores tab +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'admin_stores_tab.php'); +// generate_tax_rules +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'generate_tax_rules.php'); +// generate_ntree +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'generate_ntree.php'); +// Before version 1.3.3 ecotax are not calculated into the price +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_products_ecotax_v133.php'); + +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'shop_url.php'); + +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'gridextjs_deprecated.php'); +// generate level depth +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'regenerate_level_depth.php'); +// add a new tab +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_new_tab.php'); + +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_module_to_hook.php'); + +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_for_13version.php'); + +require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_cms_block.php'); + +//old version detection +global $oldversion; +$oldversion = false; +if (file_exists(SETTINGS_FILE) AND file_exists(DEFINES_FILE)) +{ + include_once(SETTINGS_FILE); + include_once(DEFINES_FILE); + $oldversion = _PS_VERSION_; +} +else + die(''."\n"); +if (!file_exists(DEFINES_FILE)) + die(''."\n"); +include_once(SETTINGS_FILE); + +if (!defined('_THEMES_DIR_')) + define('_THEMES_DIR_', __PS_BASE_URI__.'themes/'); +if (!defined('_PS_IMG_')) + define('_PS_IMG_', __PS_BASE_URI__.'img/'); +if (!defined('_PS_JS_DIR_')) + define('_PS_JS_DIR_', __PS_BASE_URI__.'js/'); +if (!defined('_PS_CSS_DIR_')) + define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/'); +include_once(DEFINES_FILE); + +$oldversion = _PS_VERSION_; + +$versionCompare = version_compare(INSTALL_VERSION, _PS_VERSION_); +if ($versionCompare == '-1') + die(''."\n"); +elseif ($versionCompare == 0) + die(''."\n"); +elseif ($versionCompare === false) + die(''."\n"); + +//check DB access +include_once(INSTALL_PATH.'/classes/ToolsInstall.php'); +$resultDB = ToolsInstall::checkDB(_DB_SERVER_, _DB_USER_, _DB_PASSWD_, _DB_NAME_, false); +if ($resultDB !== true) + die("\n"); + +//custom sql file creation +$upgradeFiles = array(); +if ($handle = opendir(INSTALL_PATH.'/sql/upgrade')) +{ + while (false !== ($file = readdir($handle))) + if ($file != '.' AND $file != '..') + $upgradeFiles[] = str_replace(".sql", "", $file); + closedir($handle); +} +if (empty($upgradeFiles)) + die(''."\n"); +natcasesort($upgradeFiles); +$neededUpgradeFiles = array(); +foreach ($upgradeFiles AS $version) + if (version_compare($version, _PS_VERSION_) == 1 AND version_compare(INSTALL_VERSION, $version) != -1) + $neededUpgradeFiles[] = $version; +if (empty($neededUpgradeFiles)) + die(''."\n"); + + +//refresh conf file +include(INSTALL_PATH.'/classes/AddConfToFile.php'); +$oldLevel = error_reporting(E_ALL); +$mysqlEngine = (defined('_MYSQL_ENGINE_') ? _MYSQL_ENGINE_ : 'MyISAM'); +$datas = array( + array('_DB_SERVER_', _DB_SERVER_), + array('_DB_TYPE_', _DB_TYPE_), + array('_DB_NAME_', _DB_NAME_), + array('_DB_USER_', _DB_USER_), + array('_DB_PASSWD_', _DB_PASSWD_), + array('_DB_PREFIX_', _DB_PREFIX_), + array('_MYSQL_ENGINE_', $mysqlEngine), + array('_PS_CACHING_SYSTEM_', (defined('_PS_CACHING_SYSTEM_') AND _PS_CACHING_SYSTEM_ != 'MemCached') ? _PS_CACHING_SYSTEM_ : 'MCached'), + array('_PS_CACHE_ENABLED_', defined('_PS_CACHE_ENABLED_') ? _PS_CACHE_ENABLED_ : '0'), + array('_MEDIA_SERVER_1_', defined('_MEDIA_SERVER_1_') ? _MEDIA_SERVER_1_ : ''), + array('_MEDIA_SERVER_2_', defined('_MEDIA_SERVER_2_') ? _MEDIA_SERVER_2_ : ''), + array('_MEDIA_SERVER_3_', defined('_MEDIA_SERVER_3_') ? _MEDIA_SERVER_3_ : ''), + array('__PS_BASE_URI__', __PS_BASE_URI__), + array('_THEME_NAME_', _THEME_NAME_), + array('_COOKIE_KEY_', _COOKIE_KEY_), + array('_COOKIE_IV_', _COOKIE_IV_), + array('_PS_CREATION_DATE_', defined("_PS_CREATION_DATE_") ? _PS_CREATION_DATE_ : date('Y-m-d')), + array('_PS_VERSION_', INSTALL_VERSION) +); +if (defined('_RIJNDAEL_KEY_')) + $datas[] = array('_RIJNDAEL_KEY_', _RIJNDAEL_KEY_); +if (defined('_RIJNDAEL_IV_')) + $datas[] = array('_RIJNDAEL_IV_', _RIJNDAEL_IV_); +if(!defined('_PS_CACHE_ENABLED_')) + define('_PS_CACHE_ENABLED_', '0'); +if(!defined('_MYSQL_ENGINE_')) + define('_MYSQL_ENGINE_', 'MyISAM'); + +$sqlContent = ''; +foreach($neededUpgradeFiles AS $version) +{ + $file = INSTALL_PATH.'/sql/upgrade/'.$version.'.sql'; + if (!file_exists($file)) + die(''."\n"); + if (!$sqlContent .= file_get_contents($file)) + die(''."\n"); + $sqlContent .= "\n"; +} + +$sqlContent = str_replace(array($filePrefix, $engineType), array(_DB_PREFIX_, $mysqlEngine), $sqlContent); +$sqlContent = preg_split("/;\s*[\r\n]+/",$sqlContent); + +error_reporting($oldLevel); +$confFile = new AddConfToFile(SETTINGS_FILE, 'w'); +if ($confFile->error) + die(''."\n"); + +foreach ($datas AS $data){ + $confFile->writeInFile($data[0], $data[1]); +} + +if ($confFile->error != false) + die(''."\n"); + +// Settings updated, compile and cache directories must be emptied +foreach (array(INSTALL_PATH.'/../tools/smarty/cache/', INSTALL_PATH.'/../tools/smarty/compile/', INSTALL_PATH.'/../tools/smarty_v2/cache/', INSTALL_PATH.'/../tools/smarty_v2/compile/') as $dir) + if (file_exists($dir)) + foreach (scandir($dir) as $file) + if ($file[0] != '.' AND $file != 'index.php') + unlink($dir.$file); + +//sql file execution +global $requests, $warningExist; +$requests = ''; +$warningExist = false; + +Configuration::loadConfiguration(); + +foreach($sqlContent as $query) +{ + $query = trim($query); + if(!empty($query)) + { + /* If php code have to be executed */ + if (strpos($query, '/* PHP:') !== false) + { + /* Parsing php code */ + $pos = strpos($query, '/* PHP:') + strlen('/* PHP:'); + $phpString = substr($query, $pos, strlen($query) - $pos - strlen(' */;')); + $php = explode('::', $phpString); + preg_match('/\((.*)\)/', $phpString, $pattern); + $paramsString = trim($pattern[0], '()'); + preg_match_all('/([^,]+),? ?/', $paramsString, $parameters); + if (isset($parameters[1])) + $parameters = $parameters[1]; + else + $parameters = array(); + if (is_array($parameters)) + foreach ($parameters AS &$parameter) + $parameter = str_replace('\'', '', $parameter); + + /* Call a simple function */ + if (strpos($phpString, '::') === false) + call_user_func_array(str_replace($pattern[0], '', $php[0]), $parameters); + /* Or an object method */ + else + call_user_func_array(array($php[0], str_replace($pattern[0], '', $php[1])), $parameters); + $requests .= +' + + '."\n"; + } + elseif(!Db::getInstance()->Execute($query)) + { + $warningExist = true; + $requests .= +' + + getMsgError()).']]> + getNumberError()).']]> + '."\n"; + } + else + $requests .= +' + + '."\n"; + } +} +Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 0); +$result = $warningExist ? ''."\n" : ''."\n"; +$result .= $requests; +die($result.''."\n"); + diff --git a/install-dev/xml/uploadLogo.php b/install-dev/xml/uploadLogo.php new file mode 100644 index 000000000..75197ae60 --- /dev/null +++ b/install-dev/xml/uploadLogo.php @@ -0,0 +1,116 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +define('INSTALL_PATH', dirname(__FILE__)); + + $error = ""; + $msg = ""; + $fileElementName = 'fileToUpload'; + + if(!empty($_FILES[$fileElementName]['error'])) + { + switch($_FILES[$fileElementName]['error']) + { + + case '1': + $error = '38'; + break; + case '2': + $error = '39'; + break; + case '3': + $error = '40'; + break; + case '4': + $error = '41'; + break; + + case '6': + $error = '42'; + break; + case '7': + $error = '43'; + break; + case '8': + $error = '44'; + break; + case '999': + default: + $error = '999'; + } + } + else + { + if(empty($_FILES[$fileElementName]['tmp_name']) OR $_FILES[$fileElementName]['tmp_name'] == 'none') + { + $error = '41'; + } + else + { + list($width, $height, $type, $attr) = getimagesize($_FILES[$fileElementName]['tmp_name']); + + if($height == 0) + { + $error = '16'; + } + else + { + $newheight = $height > 500 ? 500 : $height; + $percent = $newheight / $height; + $newwidth = $width * $percent; + $newheight = $height * $percent; + $thumb = imagecreatetruecolor($newwidth, $newheight); + switch ($type) { + case 1: + $sourceImage = imagecreatefromgif($_FILES[$fileElementName]['tmp_name']); + break; + case 2: + $sourceImage = imagecreatefromjpeg($_FILES[$fileElementName]['tmp_name']); + break; + case 3: + $sourceImage = imagecreatefrompng($_FILES[$fileElementName]['tmp_name']); + break; + default: + return false; + } + + imagecopyresampled($thumb, $sourceImage, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + + if(!is_writable(realpath(INSTALL_PATH.'/../../img').'/logo.jpg')) + $error = '58'; + else + { + if(!imagejpeg($thumb, realpath(INSTALL_PATH.'/../../img').'/logo.jpg', 90)) + { + $error = '7'; + } + } + } + } + } + echo "{"; + echo " error: '" . $error . "',\n"; + echo "}"; diff --git a/js/admin-dnd.js b/js/admin-dnd.js new file mode 100644 index 000000000..e604bf824 --- /dev/null +++ b/js/admin-dnd.js @@ -0,0 +1,168 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(document).ready(function() { + $('table.tableDnD').tableDnD({ + + onDragStart: function(table, row) { + originalOrder = $.tableDnD.serialize(); + reOrder = ':even'; + if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row')) + reOrder = ':odd'; + $('#'+table.id+ '#' + row.id).parent('tr').addClass('myDragClass'); + }, + dragHandle: 'dragHandle', + onDragClass: 'myDragClass', + onDrop: function(table, row) { + if (originalOrder != $.tableDnD.serialize()) { + + var way = (originalOrder.indexOf(row.id) < $.tableDnD.serialize().indexOf(row.id))? 1 : 0; + var ids = row.id.split('_'); + var tableDrag = $('#' + table.id); + var params = ''; + if (table.id == 'cms_category') + params = { + ajaxCMSCategoriesPositions: true, + id_cms_category_parent: ids[1], + id_cms_category_to_move: ids[2], + way: way, + token: token + }; + if (table.id == 'category') + params = { + ajaxCategoriesPositions: true, + id_category_parent: ids[1], + id_category_to_move: ids[2], + way: way, + token: token + }; + if (table.id == 'cms') + params = { + ajaxCMSPositions: true, + id_cms_category: ids[1], + id_cms: ids[2], + way: way, + token: token + }; + if (come_from == 'AdminModulesPositions') + params = { + ajaxModulesPositions: true, + id_hook: ids[0], + id_module: ids[1], + way: way, + token: token + }; + if (table.id == 'product') { + params = { + ajaxProductsPositions: true, + id_category: ids[1], + id_product: ids[2], + way: way, + token: token + }; + } + + $.ajax({ + type: 'POST', + async: false, + url: 'ajax.php?' + $.tableDnD.serialize(), + data: params, + success: function(data) { + if (come_from == 'AdminModulesPositions') { + tableDrag.find('tr').removeClass('alt_row'); + tableDrag.find('tr' + reOrder).addClass('alt_row'); + tableDrag.find('td.positions').each(function(i) { + $(this).html(i+1); + }); + tableDrag.find('td.dragHandle a:hidden').show(); + tableDrag.find('td.dragHandle:first a:even').hide(); + tableDrag.find('td.dragHandle:last a:odd').hide(); + } + else if (table.id == 'product') { + var reg = /_[0-9][0-9]*$/g; + tableDrag.find('tbody tr').each(function(i) { + $(this).attr('id', $(this).attr('id').replace(reg, '_' + i)); + + // Update link position + var up_reg = new RegExp('position=[-]?[0-9]+&'); + + // Up links + $(this).find('td.dragHandle a:odd').attr('href', $(this).find('td.dragHandle a:odd').attr('href').replace(up_reg, 'position='+ (i - 1) +'&')); + + // Down links + $(this).find('td.dragHandle a:even').attr('href', $(this).find('td.dragHandle a:even').attr('href').replace(up_reg, 'position='+ (i + 1) +'&')); + + }); + tableDrag.find('tr').not('.nodrag').removeClass('alt_row'); + tableDrag.find('tr:not(".nodrag"):odd').addClass('alt_row'); + tableDrag.find('tr td.dragHandle a:hidden').show(); + + if (alternate) { + tableDrag.find('tr td.dragHandle:first a:odd').hide(); + tableDrag.find('tr td.dragHandle:last a:even').hide(); + } + else { + tableDrag.find('tr td.dragHandle:first a:even').hide(); + tableDrag.find('tr td.dragHandle:last a:odd').hide(); + } + } + else + { + var reg = /_[0-9]$/g; + tableDrag.find('tbody tr').each(function(i) { + $(this).attr('id', $(this).attr('id').replace(reg, '_' + i)); + + // Update link position + var up_reg = new RegExp('position=[-]?[0-9]+&'); + + // Up links + $(this).find('td.dragHandle a:odd').attr('href', $(this).find('td.dragHandle a:odd').attr('href').replace(up_reg, 'position='+ (i - 1) +'&')); + + // Down links + $(this).find('td.dragHandle a:even').attr('href', $(this).find('td.dragHandle a:even').attr('href').replace(up_reg, 'position='+ (i + 1) +'&')); + + }); + + tableDrag.find('tr').not('.nodrag').removeClass('alt_row'); + tableDrag.find('tr:not(".nodrag"):odd').addClass('alt_row'); + tableDrag.find('tr td.dragHandle a:hidden').show(); + + if (alternate) { + tableDrag.find('tr td.dragHandle:first a:odd').hide(); + tableDrag.find('tr td.dragHandle:last a:even').hide(); + } + else { + tableDrag.find('tr td.dragHandle:first a:even').hide(); + tableDrag.find('tr td.dragHandle:last a:odd').hide(); + } + + } + } + }); + } + } + }); +}) diff --git a/js/admin-scene-cropping.js b/js/admin-scene-cropping.js new file mode 100644 index 000000000..75b57e2d4 --- /dev/null +++ b/js/admin-scene-cropping.js @@ -0,0 +1,177 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* global variables */ + +zoneCurrent = 0; +selectionCurrent = null; +valueOfZoneEdited = null; + +/* functions called by cropping events */ + +function showZone(){ + $('#large_scene_image').imgAreaSelect({show:true}); +} + +function hideAutocompleteBox(){ + $('#ajax_choose_product:visible').hide(); +} + +function onSelectEnd(img, selection) { + selectionCurrent = selection; + showAutocompleteBox(selection.x1, selection.y1+selection.height); +} + +function undoEdit(){ + hideAutocompleteBox(); + $('#large_scene_image').imgAreaSelect({hide:true}); + $(document).unbind('keydown'); +} + +function showAutocompleteBox(x1, y1) { + $('#ajax_choose_product:hidden') + .slideDown('fast'); + $('#product_autocomplete_input').focus(); + $(document).keydown(function(event) { + if (event.keyCode == '27') { + undoEdit(); + } + }); +} + +function editThisZone(aInFixedZoneElement) { + $fixedZoneElement = $(aInFixedZoneElement).parent(); + var x1 = $fixedZoneElement.css('margin-left'); + x1 = x1.substring(0,x1.indexOf('px')); + x1 = parseInt(x1); + var y1 = $fixedZoneElement.css('margin-top'); + y1 = y1.substring(0,y1.indexOf('px')); + y1 = parseInt(y1); + var width = $fixedZoneElement.css('width'); + width = width.substring(0,width.indexOf('px')); + var x2 = x1 + parseInt(width); + var height = $fixedZoneElement.css('height'); + height = height.substring(0,height.indexOf('px')); + var y2 = y1 + parseInt(height); + + valueOfZoneEdited = $fixedZoneElement.find('a').attr('rel'); + + selectionCurrent = new Array(); + selectionCurrent['x1'] = x1; + selectionCurrent['y1'] = y1; + selectionCurrent['width'] = width; + selectionCurrent['height'] = height; + + $fixedZoneElement.remove(); + $('#product_autocomplete_input').val( $fixedZoneElement.find('p').text() ); + showAutocompleteBox(x1, y1+parseInt(height)); + + $('#large_scene_image').imgAreaSelect({ x1: x1, y1: y1, x2: x2, y2: y2 }); +} + +/* function called by cropping process (buttons clicks) */ + +function deleteProduct(index_zone){ + $('#visual_zone_' + index_zone).fadeOut('fast', function(){ + $(this).remove(); + }); + return false; +} + +function afterTextInserted (event, data, formatted) { + if (data == null){ + return false; + } + zoneCurrent++; + var idProduct = data[1]; + var nameProduct = data[0]; + var x1 = selectionCurrent.x1; + var y1 = selectionCurrent.y1; + var width = selectionCurrent.width; + var height = selectionCurrent.height; + addProduct(zoneCurrent, x1, y1, width, height, idProduct, nameProduct); +} + +function addProduct(zoneIndex, x1, y1, width, height, idProduct, nameProduct){ + $('#large_scene_image') + .imgAreaSelect({hide:true}) + .before('\ +
    \ + \ + \ + \ + \ + \ +

    ' + nameProduct + '

    \ + \ + \ + \ + \ + \ + \ +
    \ + '); + $('.fixed_zone').css('opacity', '0.8'); + $('#save_scene').fadeIn('slow'); + $('#ajax_choose_product:visible') + .fadeOut('slow') + .find('#product_autocomplete_input').val(''); +} + +$(window).load(function () { + + /* function autocomplete */ + $('#product_autocomplete_input') + .autocomplete('ajax_products_list.php', { + minChars: 1, + autoFill: true, + max:20, + matchContains: true, + mustMatch:true, + scroll:false + }) + .result(afterTextInserted); + + $('#large_scene_image').imgAreaSelect({ + borderWidth: 1, + onSelectEnd: onSelectEnd, + onSelectStart: showZone, + onSelectChange: hideAutocompleteBox, + minHeight:30, + minWidth:30 + }); + + /* load existing products zone */ + for(var i = 0; i < startingData.length; i++) + { + addProduct(i, startingData[i][2], startingData[i][3], startingData[i][4], startingData[i][5], startingData[i][1], startingData[i][0]); + } + zoneCurrent = startingData.length; + + if (startingData.length) + $('#save_scene').show(); + +}); diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 000000000..85df2aa48 --- /dev/null +++ b/js/admin.js @@ -0,0 +1,819 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!id_language) + var id_language = Number(1); + +function str2url(str,encoding,ucfirst) +{ + str = str.toUpperCase(); + str = str.toLowerCase(); + + str = str.replace(/[\u0105\u0104\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g,'a'); + str = str.replace(/[\u00E7\u010D\u0107\u0106]/g,'c'); + str = str.replace(/[\u010F]/g,'d'); + str = str.replace(/[\u00E8\u00E9\u00EA\u00EB\u011B\u0119\u0118]/g,'e'); + str = str.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,'i'); + str = str.replace(/[\u0142\u0141]/g,'l'); + str = str.replace(/[\u00F1\u0148]/g,'n'); + str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u00D3]/g,'o'); + str = str.replace(/[\u0159]/g,'r'); + str = str.replace(/[\u015B\u015A\u0161]/g,'s'); + str = str.replace(/[\u00DF]/g,'ss'); + str = str.replace(/[\u0165]/g,'t'); + str = str.replace(/[\u00F9\u00FA\u00FB\u00FC\u016F]/g,'u'); + str = str.replace(/[\u00FD\u00FF]/g,'y'); + str = str.replace(/[\u017C\u017A\u017B\u0179\u017E]/g,'z'); + str = str.replace(/[\u00E6]/g,'ae'); + str = str.replace(/[\u0153]/g,'oe'); + str = str.replace(/[\u013E\u013A]/g,'l'); + str = str.replace(/[\u0155]/g,'r'); + + str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,''); + str = str.replace(/[\s\'\:\/\[\]-]+/g,' '); + str = str.replace(/[ ]/g,'-'); + str = str.replace(/[\/]/g,'-'); + + if (ucfirst == 1) { + c = str.charAt(0); + str = c.toUpperCase()+str.slice(1); + } + + return str; +} + +function strToAltImgAttr(str,encoding,ucfirst) +{ + str = str.replace(/[\u0105\u0104\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g,'a'); + str = str.replace(/[\u00E7\u010D\u0107\u0106]/g,'c'); + str = str.replace(/[\u010F]/g,'d'); + str = str.replace(/[\u00E8\u00E9\u00EA\u00EB\u011B\u0119\u0118]/g,'e'); + str = str.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,'i'); + str = str.replace(/[\u0142\u0141]/g,'l'); + str = str.replace(/[\u00F1\u0148]/g,'n'); + str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u00D3]/g,'o'); + str = str.replace(/[\u0159]/g,'r'); + str = str.replace(/[\u015B\u015A\u0161]/g,'s'); + str = str.replace(/[\u00DF]/g,'ss'); + str = str.replace(/[\u0165]/g,'t'); + str = str.replace(/[\u00F9\u00FA\u00FB\u00FC\u016F]/g,'u'); + str = str.replace(/[\u00FD\u00FF]/g,'y'); + str = str.replace(/[\u017C\u017A\u017B\u0179\u017E]/g,'z'); + str = str.replace(/[\u00E6]/g,'ae'); + str = str.replace(/[\u0153]/g,'oe'); + str = str.replace(/[\u013E\u013A]/g,'l'); + str = str.replace(/[\u0155]/g,'r'); + + str = str.replace(/[^a-zA-Z0-9\s\'\:\/\[\]-]/g,''); + str = str.replace(/[\s\'\:\/\[\]-]+/g,' '); + + if (ucfirst == 1) { + c = str.charAt(0); + str = c.toUpperCase()+str.slice(1); + } + + return str; +} + +function copy2friendlyURL() +{ + $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8')); +} + +function copyMeta2friendlyURL() +{ + $('#input_link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8')); +} + +function updateCurrentText() +{ + $('#current_product').html($('#name_' + id_language).val()); +} +function updateFriendlyURLByName() +{ + $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val(), 'UTF-8')); + $('#friendly-url').html($('#link_rewrite_' + id_language).val()); +} +function updateFriendlyURL() +{ + $('#link_rewrite_' + id_language).val(str2url($('#link_rewrite_' + id_language).val(), 'UTF-8')); + $('#seo #friendly-url').text($('#link_rewrite_' + id_language).val()); +} + +function toggleLanguageFlags(elt) +{ + $(elt).parents('.displayed_flag').siblings('.language_flags').toggle(); +} + +// Kept for retrocompatibility only (out of AdminProducts & AdminCategories) +function changeLanguage(field, fieldsString, id_language_new, iso_code) +{ + var fields = fieldsString.split('¤'); + for (var i = 0; i < fields.length; ++i) + { + getE(fields[i] + '_' + id_language).style.display = 'none'; + getE(fields[i] + '_' + id_language_new).style.display = 'block'; + getE('language_current_' + fields[i]).src = '../img/l/' + id_language_new + '.jpg'; + } + getE('languages_' + field).style.display = 'none'; + id_language = id_language_new; +} + +function changeFormLanguage(id_language_new, iso_code, employee_cookie) +{ + $('.translatable').each(function() { + $(this).find('.lang_' + id_language_new) + .show() + .siblings('div:not(.displayed_flag):not(.clear)').hide(); + $('.language_current').attr('src', '../img/l/' + id_language_new + '.jpg'); + }); + $('.language_flags').hide(); + if (employee_cookie) + $.post("ajax.php", { form_language_id: id_language_new }); + id_language = id_language_new; + updateFriendlyURL(); + updateCurrentText(); +} + +function displayFlags(languages, defaultLanguageID, employee_cookie) +{ + if ($('.translatable')) + { + $('.translatable').each(function() { + if (!$(this).find('.displayed_flag').length > 0) { + $.each(languages, function(key, language) { + if (language['id_lang'] == defaultLanguageID) + { + defaultLanguage = language; + return false; + } + }); + var displayFlags = $('
    ') + .addClass('displayed_flag') + .append($('') + .addClass('language_current') + .addClass('pointer') + .attr('src', '../img/l/' + defaultLanguage['id_lang'] + '.jpg') + .attr('alt', defaultLanguage['name']) + .click(function() { + toggleLanguageFlags(this); + }) + ); + var languagesFlags = $('
    ') + .addClass('language_flags') + .html('Choose language:

    '); + $.each(languages, function(key, language) { + var img = $('') + .addClass('pointer') + .css('margin', '0 2px') + .attr('src', '../img/l/' + language['id_lang'] + '.jpg') + .attr('alt', language['name']) + .click(function() { + changeFormLanguage(language['id_lang'], language['iso_code'], employee_cookie); + }); + languagesFlags.append(img); + }); + if ($(this).find('p:last-child').hasClass('clear')) + $(this).find('p:last-child').before(displayFlags).before(languagesFlags); + else + $(this).append(displayFlags).append(languagesFlags); + } + }); + } +} + +function checkAll(pForm) +{ + for (i = 0, n = pForm.elements.length; i < n; i++) + { + var objName = pForm.elements[i].name; + var objType = pForm.elements[i].type; + if (objType = 'checkbox' && objName != 'checkme') + { + box = eval(pForm.elements[i]); + box.checked = !box.checked; + } + } +} + +function checkDelBoxes(pForm, boxName, parent) +{ + for (i = 0; i < pForm.elements.length; i++) + if (pForm.elements[i].name == boxName) + pForm.elements[i].checked = parent; +} + +function checkPaymentBoxes(name, module) +{ + setPaymentBoxes(name, module); + current = $('input#checkedBox_'+ name +'_'+ module + '[type=hidden]'); + $('form#form_'+ name +' input[type=checkbox]').each( + function() + { + if ($(this).attr('name') == module + '_' + name + '[]') + $(this).attr("checked", ((current.val() == 'checked') ? true : false)); + } + ); + current.val() == 'checked' ? current.val('unchecked') : current.val('checked'); +} + +function setPaymentBoxes(name, module) +{ + current = $('input#checkedBox_'+ name +'_'+ module + '[type=hidden]'); + total = 0; + checked = 0; + $('form#form_'+ name +' input[type=checkbox]').each( + function() + { + if ($(this).attr('name') == module + '_' + name + '[]') + { + ($(this).attr("checked") ? checked++ : ''); + total++; + } + } + ); + (checked == total) ? current.val('unchecked') : current.val('checked'); +} + +function getE(name) +{ + if (document.getElementById) + var elem = document.getElementById(name); + else if (document.all) + var elem = document.all[name]; + else if (document.layers) + var elem = document.layers[name]; + return elem; +} + +function changeFormParam(pForm, url, gid) +{ + pForm.action = url; + pForm.elements["groupid"].value = gid; +} + +function addAccessory(event, data, formatted) +{ + if (data == null) + return false; + var productId = data[1]; + var productName = data[0]; + + var $divAccessories = $('#divAccessories'); + var $inputAccessories = $('#inputAccessories'); + var $nameAccessories = $('#nameAccessories'); + + /* delete product from select + add product line to the div, input_name, input_ids elements */ + $divAccessories.html($divAccessories.html() + productName + '
    '); + $nameAccessories.val($nameAccessories.val() + productName + '¤'); + $inputAccessories.val($inputAccessories.val() + productId + '-'); + $('#product_autocomplete_input').val(''); + $('#product_autocomplete_input').setOptions({ + extraParams: {excludeIds : $('#inputAccessories').val().replace(/\-/g,',').replace(/\,$/,'')} + }); +} + + +function delAccessory(id) +{ + var div = getE('divAccessories'); + var input = getE('inputAccessories'); + var name = getE('nameAccessories'); + + // Cut hidden fields in array + var inputCut = input.value.split('-'); + var nameCut = name.value.split('¤'); + + if (inputCut.lenght != nameCut.lenght) + return alert('Bad size'); + + // Reset all hidden fields + input.value = ''; + name.value = ''; + div.innerHTML = ''; + for (i in inputCut) + { + // If empty, error, next + if (!inputCut[i] || !nameCut[i]) + continue ; + + // Add to hidden fields no selected products OR add to select field selected product + if (inputCut[i] != id) + { + input.value += inputCut[i] + '-'; + name.value += nameCut[i] + '¤'; + div.innerHTML += nameCut[i] + '
    '; + } + else + $('#selectAccessories').append(''); + } +} + +function dontChange(srcText) +{ + if (srcText == '') + return false; + if (window.search_texts) + for (var i in search_texts) + if (srcText == search_texts[i]) + return false; + return true; +} + +function queryType() +{ + var search_type = getE('bo_search_type').value; + var bo_query = getE('bo_query'); + + if (!dontChange(bo_query.value)) + bo_query.value = search_texts[search_type]; +} + +function formSubmit(e, button) +{ + var key; + + key = window.event ? window.event.keyCode : e.which; + if (key == 13) + { + getE(button).focus(); + getE(button).click(); + } +} +function noComma(elem) +{ + getE(elem).value = getE(elem).value.replace(new RegExp(',', 'g'), '.'); +} + +/* Help boxes */ +function addLoadEvent(func) { + var oldonload = window.onload; + if (typeof window.onload != 'function') { + window.onload = func; + } else { + window.onload = function() { + oldonload(); + func(); + } + } +} + +function helpboxParser(current) +{ + // While the span exists and we didn't find the right one, for each attribute, if attribute is "name" and has value == "help_box" + for (var j = 0; j < current.parentNode.getElementsByTagName('span').length; j++) + for(var k = 0; k < current.parentNode.getElementsByTagName('span')[j].attributes.length; k++) + if (current.parentNode.getElementsByTagName('span')[j].attributes[k].name === 'name' && current.parentNode.getElementsByTagName('span')[j].attributes[k].nodeValue === 'help_box') + return j; + + return -1; +} + +if (helpboxes) +{ + $(function() + { + if ($('input')) + { + $('input').focus(function() { $(this).parent().find('.hint:first').css('display', 'block'); }); + $('input').blur(function() { $(this).parent().find('.hint:first').css('display', 'none'); }); + } + }); +} + +function changePic(id_product, id_image) +{ + if (id_image == -1) + { + getE('pic').style.display = 'none'; + return; + } + getE('pic').style.display = 'block'; + getE('pic').src = '../img/p/'+parseInt(id_product)+'-'+parseInt(id_image)+'.jpg'; +} + +/* Code generator for Affiliation and vourchers */ +function gencode(size) +{ + getE('code').value = ''; + var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + for (var i = 1; i <= size; ++i) + getE('code').value += chars.charAt(Math.floor(Math.random() * chars.length)); +} + +function free_shipping() +{ + if (getE('id_discount_type').value == 3 && getE('discount_value').value == '') + getE('discount_value').value = '0'; +} + +var newWin = null; + +function closeWin () +{ + if (newWin != null) + if (!newWin.closed) + newWin.close(); +} + +function openWin(url, title, width, height, top, left) +{ + var options; + var sizes; + + closeWin(); + options = 'toolbar=0, location=0, directories=0, statfr=no, menubar=0, scrollbars=yes, resizable=yes'; + sizes = 'width='+width+', height='+height+', top='+top+', left='+left+''; + newWin = window.open(url, title, options+', '+sizes); + newWin.focus(); +} + +function viewTemplates(id_select, id_lang, prefix, ext) +{ + var id_list = document.getElementById(id_select); + var loc = id_list.options[id_list.selectedIndex].value; + if (loc != 0) + openWin (prefix+loc+ext, 'tpl_viewing', '520', '400', '50', '300'); + return ; +} + +function validateImportation(mandatory) +{ + var type_value = []; + var seted_value = []; + var elem; + var col = 'unknow'; + + toggle(getE('error_duplicate_type'), false); + toggle(getE('required_column'), false); + for (i = 0; elem = getE('type_value['+i+']'); i++) + { + if (seted_value[elem.options[elem.selectedIndex].value]) + { + scroll(0,0); + toggle(getE('error_duplicate_type'), true); + return false; + } + else if (elem.options[elem.selectedIndex].value != 'no') + seted_value[elem.options[elem.selectedIndex].value] = true; + } + for (needed in mandatory) + if (!seted_value[mandatory[needed]]) + { + scroll(0,0); + toggle(getE('required_column'), true); + getE('missing_column').innerHTML = mandatory[needed]; + elem = getE('type_value[0]'); + for (i = 0; i < elem.length; ++i) + { + if (elem.options[i].value == mandatory[needed]) + { + getE('missing_column').innerHTML = elem.options[i].innerHTML; + break ; + } + } + return false + } +} + +function askFeatureName(selected, selector) +{ + var elem; + + if (selected.value == 'feature') + { + $('#features_' + selector).show(); + $('#feature_name_' + selector).attr('name', selected.name); + } +} + +function replaceFeature(toReplace, selector) +{ + var elem; + + if ($('#feature_name_' + selector).val() == '') + return false; + + elem = getE(toReplace); + elem.options[elem.selectedIndex].text = $('#feature_name_' + selector).val(); + elem.options[elem.selectedIndex].value = '#F_' + $('#feature_name_' + selector).val(); + $('#features_' + selector).toggle(); + $('#feature_name_' + selector).val(''); + $('#feature_name_' + selector).attr('name', ''); +} + +/* Manage default category on page: edit product */ +function checkDefaultCategory(category_id) +{ + var oldCheckbox = $('.id_category_default'); + oldCheckbox.removeClass('id_category_default'); + var checkbox = $('#categoryBox_'+category_id); + checkbox.attr('checked', 'checked'); + checkbox.addClass('id_category_default'); +} + +function checkDefaultGroup(group_id) +{ + var oldCheckbox = $('.id_group_default'); + oldCheckbox.removeClass('id_group_default'); + var checkbox = $('#groupBox_'+group_id); + checkbox.attr('checked', 'checked'); + checkbox.addClass('id_group_default'); +} + +function chooseTypeTranslation(id_lang) +{ + getE('translation_lang').value = id_lang; + document.getElementById('typeTranslationForm').submit(); +} + + +function showDiv(select_id, while_id, dest) +{ + var select = document.getElementById(select_id); + if (select.options[select.selectedIndex].value == while_id) + return toggle(getE(dest), true); + return toggle(getE(dest)); +} + +function orderDeleteProduct(txtConfirm, txtExplain) +{ + ret = true; + $('table#cancelProducts input[type=checkbox]:checked').each( + function() + { + totalCancel = parseInt($(this).parent().parent().find('td.cancelQuantity input[type=text]').val()); + totalQty = parseInt($(this).parent().find('input#totalQty[type=hidden]').val()); + totalQtyReturn = parseInt($(this).parent().find('input#totalQtyReturn[type=hidden]').val()); + productName = $(this).parent().find('input#productName[type=hidden]').val(); + totalAvailable = totalQty - totalQtyReturn; + if (totalCancel > totalAvailable) + { + alert(txtConfirm + ' : \'' + ' ' + productName + '\' ! \n\n' + txtExplain + ' ('+ totalCancel + ' > ' + totalAvailable +')' + '\n '); + ret = false; + } + } + ); + return ret; +} + +function selectCheckbox(obj) +{ + $(obj).parent().parent().find('td.cancelCheck input[type=checkbox]').attr("checked", true); +} + +function toogleShippingCost(obj) +{ + generateDiscount = $(obj).parent().find('#generateDiscount').attr("checked"); + generateCreditSlip = $(obj).parent().find('#generateCreditSlip').attr("checked"); + if (generateDiscount != true && generateCreditSlip != true) + { + $(obj).parent().find('#spanShippingBack input[type=checkbox]').attr("checked", false); + $(obj).parent().find('#spanShippingBack').css('display', 'none'); + } + else + $(obj).parent().find('#spanShippingBack').css('display', 'block'); +} + +function removeLabel(label, fieldType, type) +{ + $(label).remove(); + if (fieldType == 0) + { + if (type == 0) + customizationUploadableFileNumber--; + else + uploadableFileLabel--; + } + else + { + if (type == 0) + customizationTextFieldNumber--; + else + textFieldLabel--; + } +} + +function browseAndRemoveLabels(newCustomizationFieldNumber, customizationFieldNumber, fieldType, type) +{ + var $current = $('body').find('div[id^="' + (type == 0 ? 'label' : 'newLabel') + 'Container_' + fieldType + '_"]'); + var ids = new Array(); + var pos = $current.length - 1; + + $current.each(function() { + ids[pos--] = $(this).attr('id'); + }); + + for (var i = 0; i < $current.length; i++) + if (customizationFieldNumber > newCustomizationFieldNumber) + { + removeLabel($('#'+ids[i]), fieldType, type); + customizationFieldNumber--; + } + return customizationFieldNumber; +} + +function displayCustomizationProperties(type, force) +{ + var newCustomizationFieldNumber = Math.abs(type == 0 ? parseInt($('#uploadable_files').val()) : parseInt($('#text_fields').val())); + var customizationFieldNumber = Math.abs(type == 0 ? (parseInt(customizationUploadableFileNumber) + parseInt(uploadableFileLabel)) : (parseInt(customizationTextFieldNumber) + parseInt(textFieldLabel))); + var label = type == 0 ? parseInt(uploadableFileLabel) : parseInt(textFieldLabel); + var target = type == 0 ? '#customizationFileProperties' : '#customizationTextFieldProperties'; + /* Add some fields */ + if (newCustomizationFieldNumber > customizationFieldNumber || force) + { + var content = ''; + var j = label; + + for (var i = 0; i < newCustomizationFieldNumber - customizationFieldNumber; i++, j++) + { + var fieldsName = 'newLabel_' + type + '_' + j; + var fieldsContainerName = 'newLabelContainer_' + type + '_' + j; + content += '
    '; + /* Generates input field */ + for (k = 0; k < languages.length; k++) + content += '
    ' + newLabel + ' #' + (j + 1) + '
    '; + /* Generates language selector & require checkbox */ + content += '
    ' + required + '
    ' + choose_language + '

    '; + /* Generate language flags */ + for (k = 0; k < languages.length; k++) + content += '' + languages[k][2] + ''; + content += '
    '; + if (type == 0) + uploadableFileLabel++; + else + textFieldLabel++; + } + $(target).append(content); + } + /* Remove */ + else + { + customizationFieldNumber = browseAndRemoveLabels(newCustomizationFieldNumber, customizationFieldNumber, type, 1); + browseAndRemoveLabels(newCustomizationFieldNumber, customizationFieldNumber, type, 0); + } +} + +function showAttributeColorGroup(name, container) +{ + var id_list; + var value; + + id_list = document.getElementById(name); + value = id_list.options[id_list.selectedIndex].value; + if (attributesGroups[value]) + $('#colorAttributeProperties').fadeIn(); + else + $('#colorAttributeProperties').fadeOut(); +} + +function orderOverwriteMessage(sl, text) +{ + var $zone = $('#txt_msg'); + var sl_value = sl.options[sl.selectedIndex].value; + + if (sl_value != '0') + { + if ($zone.val().length > 0 && !confirm(text)) + return ; + $zone.val(sl_value); + } +} + +function setCancelQuantity(itself, id_order_detail, quantity) +{ + $('#cancelQuantity_' + id_order_detail).val($(itself).attr('checked') ? quantity : ''); +} + +function stockManagementActivationAuthorization() +{ + if (getE('PS_STOCK_MANAGEMENT_on').checked) + { + getE('PS_ORDER_OUT_OF_STOCK_on').disabled = false; + getE('PS_ORDER_OUT_OF_STOCK_off').disabled = false; + getE('PS_DISPLAY_QTIES_on').disabled = false; + getE('PS_DISPLAY_QTIES_off').disabled = false; + } + else + { + getE('PS_DISPLAY_QTIES_off').checked = true; + getE('PS_DISPLAY_QTIES_on').disabled = 'disabled'; + getE('PS_DISPLAY_QTIES_off').disabled = 'disabled'; + getE('PS_ORDER_OUT_OF_STOCK_on').checked = true; + getE('PS_ORDER_OUT_OF_STOCK_on').disabled = 'disabled'; + getE('PS_ORDER_OUT_OF_STOCK_off').disabled = 'disabled'; + } +} + +function hookCheckboxes(id, opt, champ) +{ + if (opt == 1 && champ.checked == false) + $('#Ghook'+id).attr('checked', false); + else if (opt == 0) + { + if (champ.checked) + $('.hook'+id).attr('checked', "checked"); + else + $('.hook'+id).attr('checked', false); + } +} + +function changeCMSActivationAuthorization() +{ + if (getE('PS_CONDITIONS_on').checked) + getE('PS_CONDITIONS_CMS_ID').disabled = false; + else + getE('PS_CONDITIONS_CMS_ID').disabled = 'disabled'; +} + +function disableZipFormat() +{ + if ($('#need_zip_code_on').attr('checked') == false) + { + $('.zip_code_format').hide(); + $('#zip_code_format').val(''); + } + else + $('.zip_code_format').show(); +} + + +function spreadFees(id_range) +{ + newVal = $('#fees_all_'+id_range).val(); + $('.fees_'+id_range).val(newVal); +} + +function clearAllFees(id_range) +{ + $('#fees_all_'+id_range).val(''); +} + +function toggleDraftWarning(show) +{ + if (show) + $('.draft').slideDown('slow'); + else + $('.draft').slideUp('slow'); +} + +function showOptions(show) +{ + if (show) + $('tr#product_options').slideDown('slow'); + else + $('tr#product_options').slideUp('slow'); +} + +function submitAddProductAndPreview() +{ + $('#fakeSubmitAddProductAndPreview').attr('name','submitAddProductAndPreview'); + $('#product').submit(); +} + +function submitAddcmsAndPreview() +{ + $('#previewSubmitAddcmsAndPreview').attr('name','submitAddcmsAndPreview'); + $('#cms').submit(); +} + +function showHelp(url, label, iso_lang, ps_version, doc_version, country) +{ + trackClickOnHelp(label, doc_version); + $('#help-'+label).attr('src','../img/admin/help2.png'); + window.open(url +'/'+iso_lang+'/doc/'+label+'?version='+ps_version+'&country='+country+'#', '_blank', 'scrollbars=yes,menubar=no,toolbar=no,location=no,width=517,height=600'); + return false; +} + + +function trackClickOnHelp(label, doc_version) +{ + $.ajax({ + url: 'ajax.php', + data: 'submitTrackClickOnHelp&label='+ label +'&version='+doc_version + }); +} + diff --git a/js/adminImport.js b/js/adminImport.js new file mode 100644 index 000000000..9f89dfa45 --- /dev/null +++ b/js/adminImport.js @@ -0,0 +1,111 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(document).ready(function(){ + + $('#saveImportMatchs').unbind('click').click(function(){ + + var newImportMatchs = $('#newImportMatchs').attr('value'); + if (newImportMatchs == '') + alert(errorEmpty); + else + { + var matchFields = ''; + $('.type_value').each( function () { + matchFields += '&'+$(this).attr('id')+'='+$(this).attr('value'); + }); + $.ajax({ + type: 'GET', + url: 'ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&saveImportMatchs&skip='+$('input[name=skip]').attr('value')+'&newImportMatchs='+newImportMatchs+matchFields, + success: function(jsonData) + { + $('#valueImportMatchs').append(''); + $('#selectDivImportMatchs').fadeIn('slow'); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + alert('TECHNICAL ERROR Details: '+XMLHttpRequest.responseText); + + } + }); + + } + }); + + $('#loadImportMatchs').unbind('click').click(function(){ + + var idToLoad = $('select#valueImportMatchs option:selected').attr('id'); + $.ajax({ + type: 'GET', + url: 'ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&loadImportMatchs&idImportMatchs='+idToLoad, + success: function(jsonData) + { + var matchs = jsonData.matchs.split('|') + $('input[name=skip]').val(jsonData.skip); + for (i=0;i +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +var query; +var lang = Array(); + +function setLang(array_lang) { lang = array_lang; } + +function getQuery() { + var result; + + result = query; + if (result == null) { + if (window.XMLHttpRequest) + result = new XMLHttpRequest(); + else if (window.ActiveXObject) + result = new ActiveXObject('Microsoft.XMLHTTP'); + } + return result; +} + +function onQueryChange() { + if (query.readyState == 4 && query.status == 200) + document.getElementById('ajax_confirmation').innerHTML = ''+lang[0]+''; +} + +function request_failed() { alert(lang[1]); } + +function showActivity() { + document.getElementById('ajax_confirmation').innerHTML = ''+lang[2]+''; +} + +function check_for_all_accesses(tabsize, tabnumber) +{ + var i = 0; + var res = 0; + var right = 0; + var rights = new Array('view', 'add', 'edit', 'delete', 'all'); + + while (i != tabsize + 1) + { + if ($('#view'+i).attr('checked') == false || $('#edit'+i).attr('checked') == false || $('#add'+i).attr('checked') == false || $('#delete'+i).attr('checked') == false) + $('#all'+i).attr('checked', false); + else + $('#all'+i).attr('checked', "checked"); + i++; + } + right = 0; + while (right != 5) + { + res = 0; + i = 0; + while (i != tabsize) + { + if ($('#'+rights[right]+i).attr('checked') == true) + res++; + i++; + } + if (res == tabnumber - 1) + $('#'+rights[right]+'all').attr('checked', "checked"); + else + $('#'+rights[right]+'all').attr('checked', false); + right++; + } +} + +function perfect_access_js_gestion(src, action, id_tab, tabsize, tabnumber) +{ + if (id_tab == '-1' && action == 'all') + { + $('.add').attr('checked', src.checked); + $('.edit').attr('checked', src.checked); + $('.delete').attr('checked', src.checked); + $('.view').attr('checked', src.checked); + $('.all').attr('checked', src.checked); + $('.31').attr('checked', "checked"); + } + else if (action == 'all') + $('.'+id_tab).attr('checked', src.checked); + else if (id_tab == '-1') + { + $('.'+action).attr('checked', src.checked); + $('#'+action+'31').attr('checked', "checked"); + } + check_for_all_accesses(tabsize, tabnumber); +} + +function ajax_power(src, action, id_tab, id_profile, token, tabsize, tabnumber) +{ + query = getQuery(); + perfect_access_js_gestion(src, action, id_tab, tabsize, tabnumber); + if (query != null) { + try { + query.open('POST', 'index.php?tab=AdminAccess', true); + query.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + query.onreadystatechange = onQueryChange; + query.send('submitAddaccess=1&action='+action+'&perm='+parseInt(src.checked ? '1' : status = '0')+'&id_tab='+parseInt(id_tab)+'&id_profile='+parseInt(id_profile)+'&token='+token); + showActivity(); + } + catch(exc) { + request_failed(); + } + } + else + alert(lang[3]); +} + +function redirect(new_page) { window.location = new_page; } \ No newline at end of file diff --git a/js/attributesBack.js b/js/attributesBack.js new file mode 100644 index 000000000..00d217bf2 --- /dev/null +++ b/js/attributesBack.js @@ -0,0 +1,379 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function fillCombinaison(wholesale_price, price_impact, weight_impact, unit_impact, reference, supplier_reference, ean, quantity, image, old_attr, id_product_attribute, default_attribute, eco_tax, location, upc, minimal_quantity) +{ + init_elems(); + $('#stock_mvt_attribute').show(); + $('#initial_stock_attribute').hide(); + $('#attribute_quantity').html(quantity); + $('#attribute_quantity').show(); + $('#attr_qty_stock').show(); + getE('minimal_quantity').value = minimal_quantity; + getE('attribute_reference').value = reference; + getE('attribute_supplier_reference').value = supplier_reference; + getE('attribute_ean13').value = ean; + getE('attribute_upc').value = upc; + getE('submitProductAttribute').value = modifyattributegroup; + getE('attribute_wholesale_price').value = Math.abs(wholesale_price); + getE('attribute_price').value = Math.abs(price_impact); + getE('attribute_weight').value = Math.abs(weight_impact); + getE('attribute_unity').value = Math.abs(unit_impact); + if ($('#attribute_ecotax').length != 0) + getE('attribute_ecotax').value = eco_tax; + getE('attribute_location').value = location; + if (default_attribute == 1) + getE('attribute_default').checked = true; + else + getE('attribute_default').checked = false; + + if (price_impact < 0) + { + getE('attribute_price_impact').options[getE('attribute_price_impact').selectedIndex].value = -1; + getE('attribute_price_impact').selectedIndex = 2; + } + else if (!price_impact) + { + getE('attribute_price_impact').options[getE('attribute_price_impact').selectedIndex].value = 0; + getE('attribute_price_impact').selectedIndex = 0; + } + else if (price_impact > 0) + { + getE('attribute_price_impact').options[getE('attribute_price_impact').selectedIndex].value = 1; + getE('attribute_price_impact').selectedIndex = 1; + } + if (weight_impact < 0) + { + getE('attribute_weight_impact').options[getE('attribute_weight_impact').selectedIndex].value = -1; + getE('attribute_weight_impact').selectedIndex = 2; + } + else if (!weight_impact) + { + getE('attribute_weight_impact').options[getE('attribute_weight_impact').selectedIndex].value = 0; + getE('attribute_weight_impact').selectedIndex = 0; + } + else if (weight_impact > 0) + { + getE('attribute_weight_impact').options[getE('attribute_weight_impact').selectedIndex].value = 1; + getE('attribute_weight_impact').selectedIndex = 1; + } + if (unit_impact < 0) + { + getE('attribute_unit_impact').options[getE('attribute_unit_impact').selectedIndex].value = -1; + getE('attribute_unit_impact').selectedIndex = 2; + } + else if (!unit_impact) + { + getE('attribute_unit_impact').options[getE('attribute_unit_impact').selectedIndex].value = 0; + getE('attribute_unit_impact').selectedIndex = 0; + } + else if (unit_impact > 0) + { + getE('attribute_unit_impact').options[getE('attribute_unit_impact').selectedIndex].value = 1; + getE('attribute_unit_impact').selectedIndex = 1; + } + + /* Reset all combination images */ + combinationImages = $('#id_image_attr').find("input[id^=id_image_attr_]"); + combinationImages.each(function() { + this.checked = false; + }); + + /* Check combination images */ + if (typeof(combination_images[id_product_attribute]) != 'undefined') + for (i = 0; i < combination_images[id_product_attribute].length; i++) + getE('id_image_attr_' + combination_images[id_product_attribute][i]).checked = true; + + check_impact(); + check_weight_impact(); + check_unit_impact(); + + var elem = getE('product_att_list'); + for (var i = 0; i < old_attr.length; i++) + { + var opt = document.createElement('option'); + opt.text = old_attr[i++]; + opt.value = old_attr[i]; + + try { + elem.add(opt, null); + } + catch(ex) { + elem.add(opt); + } + } + getE('id_product_attribute').value = id_product_attribute; + if (document.getElementById) + var style = document.getElementById('ResetSpan').style; + else if (document.all) + var style = document.all['ResetSpan'].style; + else if (document.layers) + var style = document.layers['ResetSpan'].style; + if (style.display == 'none') + style.display = 'block'; +} + +function populate_attrs() +{ + var attr_group = getE('attribute_group'); + if (!attr_group) + return; + var attr_name = getE('attribute'); + var number = attr_group.options.length ? attr_group.options[attr_group.selectedIndex].value : 0; + + if (!number) + { + attr_name.options.length = 0; + attr_name.options[0] = new Option('---', 0); + return; + } + + var list = attrs[number]; + attr_name.options.length = 0; + + for(i = 0; i < list.length; i += 2) + attr_name.options[i / 2] = new Option(list[i + 1], list[i]); +} + +function check_impact() +{ + if ($('#attribute_price_impact').get(0).selectedIndex == 0) + { + $('#attribute_price').val('0.00'); + $('#span_impact').hide(); + } + else + $('#span_impact').show(); +} + +function check_weight_impact() +{ + if ($('#attribute_weight_impact').get(0).selectedIndex == 0) + { + $('#span_weight_impact').hide(); + $('#attribute_weight').val('0.00'); + } + else + $('#span_weight_impact').show(); +} + +function check_unit_impact() +{ + if ($('#attribute_unit_impact').get(0).selectedIndex == 0) + { + $('#span_unit_impact').hide(); + $('#attribute_unity').val('0.00'); + } + else + $('#span_unit_impact').show(); +} + +function init_elems() +{ + $('#stock_mvt_attribute').hide(); + $('#initial_stock_attribute').show(); + $('#attr_qty_stock').hide(); + var elem = getE('product_att_list'); + + if (elem.length) + for (i = elem.length - 1; i >= 0; i--) + if (elem[i]) + elem.remove(i); + + getE('attribute_price_impact').selectedIndex = 0; + getE('attribute_weight_impact').selectedIndex = 0; + getE('attribute_unit_impact').selectedIndex = 0; + $('#span_unit_impact').hide(); + $('#unity_third').html($('#unity_second').html()); + if ($('#unity').get(0).value.length > 0) + $('#tr_unit_impact').show(); + else + $('#tr_unit_impact').hide(); + try + { + if (impact.options[impact.selectedIndex].value == 0) + getE('span_impact').style.display = 'none'; + if (impact2.options[impact.selectedIndex].value == 0) + getE('span_weight_impact').style.display = 'none'; + } + catch (e) + { + getE('span_impact').style.display = 'none'; + getE('span_weight_impact').style.display = 'none'; + } +} + +function attr_selectall() +{ + var elem = getE('product_att_list'); + var i; + + for (i = 0; i < elem.length; i++) + elem.options[i].selected = true; +} + +function del_attr_multiple() +{ + var attr = getE('attribute_group'); + + if (!attr) + return ; + var length = attr.length; + var target; + + for (var i = 0; i < length; ++i) + { + elem = attr.options[i]; + if (elem.selected) + { + target = getE('table_' + elem.parentNode.getAttribute('name')); + if (target && getE('result_' + elem.getAttribute('name'))) + { + target.removeChild(getE('result_' + elem.getAttribute('name'))); + if (!target.lastChild || !target.lastChild.id) + toggle(target.parentNode, false); + } + } + } +} + +function create_attribute_row(id, id_group, name, price, weight) +{ + var row = document.createElement('tr'); + var col1 = document.createElement('td'); + var col2 = document.createElement('td'); + var col3 = document.createElement('td'); + var col1_content = document.createElement('input'); + var col2_content = document.createElement('input'); + var col3_content = document.createElement('input'); + + col1.innerHTML = name; + + + col1_content.name = 'options['+id_group+']['+id+']'; + col1_content.value = id; + col1_content.type = 'hidden'; + + col2_content.name = 'price_impact['+id+']'; + col2_content.value = price; + col2_content.style.width = '50px'; + + col3_content.value = weight; + col3_content.name = 'weight_impact['+id+']'; + col3_content.style.width = '50px'; + + col1.appendChild(col1_content); + col2.appendChild(col2_content); + col3.appendChild(col3_content); + row.appendChild(col1); + row.appendChild(col2); + row.appendChild(col3); + row.id = 'result_' + id; + return row; +} + +function add_attr_multiple() +{ + var attr = getE('attribute_group'); + if (!attr) + return ; + var length = attr.length; + var target; + var new_elem; + + for (var i = 0; i < length; ++i) + { + elem = attr.options[i]; + if (elem.selected) + { + name = elem.parentNode.getAttribute('name'); + target = getE('table_' + name); + if (target && !getE('result_' + elem.getAttribute('name'))) + { + new_elem = create_attribute_row(elem.getAttribute('name'), elem.parentNode.getAttribute('name'), elem.value, '0.00', '0.00'); + target.appendChild(new_elem); + toggle(target.parentNode, true); + } + } + } +} + +function del_attr() +{ + var elem = getE('product_att_list'); + var i; + + for (i = elem.length - 1; i >= 0; i--) + { + if (elem.options[i].selected) + elem.remove(i); + } +} + +function add_attr() +{ + var attr_group = getE('attribute_group'); + var attr_name = getE('attribute'); + var opt = document.createElement('option'); + var elem = getE('product_att_list'); + var gs = attr_group.options.length ? attr_group.options[attr_group.selectedIndex] : 0; + var as = attr_name.options.length ? attr_name.options[attr_name.selectedIndex] : 0; + var list = getE('product_att_list'); + var i; + + if (gs.value == 0) alert('Please choose a group'); + else if (as.value == 0) alert('Please choose an attribute'); + else + { + opt.text = gs.text + ' : ' + as.text; + opt.value = as.value; + + for (i = list.length - 1; i >= 0; i--) + if (list.options[i].value == as.value) + { + alert('You cannot add same attribute twice'); + return; + } + + try { + elem.add(opt, null); + } + catch(ex) { + elem.add(opt); + } + } +} + +function openCloseLayer(whichLayer) +{ + if (document.getElementById) + var style = document.getElementById(whichLayer).style; + else if (document.all) + var style = document.all[whichLayer].style; + else if (document.layers) + var style = document.layers[whichLayer].style; + style.display = style.display == 'none' ? 'block' : 'none'; +} diff --git a/js/checkLangPack.js b/js/checkLangPack.js new file mode 100644 index 000000000..6c6b50eca --- /dev/null +++ b/js/checkLangPack.js @@ -0,0 +1,50 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function checkLangPack(){ + $('p#resultCheckLangPack').hide(); + if ($('#iso_code').val().length == 2) + { + $.ajax( + { + url: "ajax_lang_packs.php", + cache: false, + data: {iso_lang:$('#iso_code').val(), ps_version:$('#ps_version').val()}, + dataType : 'json', + success: function(ret) + { + if(typeof ret == 'object') + $('p#resultCheckLangPack').html(langPackOk+' '+ret.name+') :'+'
    '+langPackVersion+''+ret.version+' '+download+'
    '+langPackInfo).show("slow"); + else if (ret == "offline") + $('p#resultCheckLangPack').show('slow'); + } + }); + } +} + +$(document).ready(function() { + $('p#resultCheckLangPack').hide(); +}); diff --git a/js/cropper/builder.js b/js/cropper/builder.js new file mode 100644 index 000000000..5b15ba939 --- /dev/null +++ b/js/cropper/builder.js @@ -0,0 +1,101 @@ +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// See scriptaculous.js for full license. + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, + // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, + // due to a Firefox bug + node: function(elementName) { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } catch(e) {} + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if(element && (element.tagName != elementName)) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if(!element) element = document.createElement(elementName); + + // abort if nothing could be created + if(!element) return; + + // attributes (or text) + if(arguments[1]) + if(this._isStringOrNumber(arguments[1]) || + (arguments[1] instanceof Array)) { + this._children(element, arguments[1]); + } else { + var attrs = this._attributes(arguments[1]); + if(attrs.length) { + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" +elementName + " " + + attrs + ">"; + } catch(e) {} + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if(!element) { + element = document.createElement(elementName); + for(attr in arguments[1]) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if(element.tagName != elementName) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if(arguments[2]) + this._children(element, arguments[2]); + + return element; + }, + _text: function(text) { + return document.createTextNode(text); + }, + _attributes: function(attributes) { + var attrs = []; + for(attribute in attributes) + attrs.push((attribute=='className' ? 'class' : attribute) + + '="' + attributes[attribute].toString().escapeHTML() + '"'); + return attrs.join(" "); + }, + _children: function(element, children) { + if(typeof children=='object') { // array can hold nodes and text + children.flatten().each( function(e) { + if(typeof e=='object') + element.appendChild(e) + else + if(Builder._isStringOrNumber(e)) + element.appendChild(Builder._text(e)); + }); + } else + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function(param) { + return(typeof param=='string' || typeof param=='number'); + } +} \ No newline at end of file diff --git a/js/cropper/cropper.css b/js/cropper/cropper.css new file mode 100644 index 000000000..cba90a029 --- /dev/null +++ b/js/cropper/cropper.css @@ -0,0 +1,143 @@ +.imgCrop_wrap { + position: relative; + cursor: crosshair; +} + +.imgCrop_wrap.opera8 .imgCrop_overlay, +.imgCrop_wrap.opera8 .imgCrop_clickArea { + background-color: transparent; +} + +.imgCrop_wrap, +.imgCrop_wrap * { + font-size: 0; +} + +.imgCrop_overlay { + background-color: #000; + opacity: 0.5; + filter:alpha(opacity=50); + position: absolute; + width: 100%; + height: 100%; +} + +.imgCrop_selArea { + position: absolute; + cursor: move; + z-index: 2; +} + +.imgCrop_clickArea { + width: 100%; + height: 100%; + background-color: #FFF; + opacity: 0.01; + filter:alpha(opacity=01); +} + +.imgCrop_marqueeHoriz { + position: absolute; + width: 100%; + height: 1px; + background: transparent url(marqueeHoriz.gif) repeat-x 0 0; + z-index: 3; +} + +.imgCrop_marqueeVert { + position: absolute; + height: 100%; + width: 1px; + background: transparent url(marqueeVert.gif) repeat-y 0 0; + z-index: 3; +} + +.imgCrop_marqueeNorth { top: 0; left: 0; } +.imgCrop_marqueeEast { top: 0; right: 0; } +.imgCrop_marqueeSouth { bottom: 0px; left: 0; } +.imgCrop_marqueeWest { top: 0; left: 0; } + + +.imgCrop_handle { + position: absolute; + border: 1px solid #333; + width: 6px; + height: 6px; + background: #FFF; + opacity: 0.5; + filter:alpha(opacity=50); + z-index: 4; +} + +* html .imgCrop_handle { + width: 8px; + height: 8px; + wid\th: 6px; + hei\ght: 6px; +} + +.imgCrop_handleN { + top: -3px; + left: 0; + cursor: n-resize; +} + +.imgCrop_handleNE { + top: -3px; + right: -3px; + cursor: ne-resize; +} + +.imgCrop_handleE { + top: 0; + right: -3px; + cursor: e-resize; +} + +.imgCrop_handleSE { + right: -3px; + bottom: -3px; + cursor: se-resize; +} + +.imgCrop_handleS { + right: 0; + bottom: -3px; + cursor: s-resize; +} + +.imgCrop_handleSW { + left: -3px; + bottom: -3px; + cursor: sw-resize; +} + +.imgCrop_handleW { + top: 0; + left: -3px; + cursor: w-resize; +} + +.imgCrop_handleNW { + top: -3px; + left: -3px; + cursor: nw-resize; +} + +.imgCrop_dragArea { + width: 100%; + height: 100%; + z-index: 200; + position: absolute; + top: 0; + left: 0; +} + +.imgCrop_previewWrap { + margin: 20px 0 0 20px; + float: left; +} + +#testImage { + position: absolute; +} \ No newline at end of file diff --git a/js/cropper/cropper.js b/js/cropper/cropper.js new file mode 100644 index 000000000..b159988fd --- /dev/null +++ b/js/cropper/cropper.js @@ -0,0 +1,572 @@ +/** + * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://www.opensource.org/licenses/bsd-license.php + * + * See scriptaculous.js for full scriptaculous licence + */ + +var CropDraggable=Class.create(); +Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){ +this.options=Object.extend({drawMethod:function(){ +}},arguments[1]||{}); +this.element=$(_1); +this.handle=this.element; +this.delta=this.currentDelta(); +this.dragging=false; +this.eventMouseDown=this.initDrag.bindAsEventListener(this); +Event.observe(this.handle,"mousedown",this.eventMouseDown); +Draggables.register(this); +},draw:function(_2){ +var _3=Position.cumulativeOffset(this.element); +var d=this.currentDelta(); +_3[0]-=d[0]; +_3[1]-=d[1]; +var p=[0,1].map(function(i){ +return (_2[i]-_3[i]-this.offset[i]); +}.bind(this)); +this.options.drawMethod(p); +}}); +var Cropper={}; +Cropper.Img=Class.create(); +Cropper.Img.prototype={initialize:function(_7,_8){ +this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true,onloadCoords:null,maxWidth:0,maxHeight:0},_8||{}); +this.img=$(_7); +this.clickCoords={x:0,y:0}; +this.dragging=false; +this.resizing=false; +this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent); +this.isIE=/MSIE/.test(navigator.userAgent); +this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent); +this.ratioX=0; +this.ratioY=0; +this.attached=false; +this.fixedWidth=(this.options.maxWidth>0&&(this.options.minWidth>=this.options.maxWidth)); +this.fixedHeight=(this.options.maxHeight>0&&(this.options.minHeight>=this.options.maxHeight)); +if(typeof this.img=="undefined"){ +return; +} +$A(document.getElementsByTagName("script")).each(function(s){ +if(s.src.match(/cropper\.js/)){ +var _a=s.src.replace(/cropper\.js(.*)?/,""); +var _b=document.createElement("link"); +_b.rel="stylesheet"; +_b.type="text/css"; +_b.href=_a+"cropper.css"; +_b.media="screen"; +document.getElementsByTagName("head")[0].appendChild(_b); +} +}); +if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){ +var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y); +this.ratioX=this.options.ratioDim.x/_c; +this.ratioY=this.options.ratioDim.y/_c; +} +this.subInitialize(); +if(this.img.complete||this.isWebKit){ +this.onLoad(); +}else{ +Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this)); +} +},getGCD:function(a,b){ +if(b==0){ +return a; +} +return this.getGCD(b,a%b); +},onLoad:function(){ +var _f="imgCrop_"; +var _10=this.img.parentNode; +var _11=""; +if(this.isOpera8){ +_11=" opera8"; +} +this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11}); +this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]); +this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]); +this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]); +this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]); +var _12=[this.north,this.east,this.south,this.west]; +this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12); +this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"}); +this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"}); +this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"}); +this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"}); +this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"}); +this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"}); +this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); +this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); +this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); +this.imgWrap.appendChild(this.img); +this.imgWrap.appendChild(this.dragArea); +this.dragArea.appendChild(this.selArea); +this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"})); +_10.appendChild(this.imgWrap); +this.startDragBind=this.startDrag.bindAsEventListener(this); +Event.observe(this.dragArea,"mousedown",this.startDragBind); +this.onDragBind=this.onDrag.bindAsEventListener(this); +Event.observe(document,"mousemove",this.onDragBind); +this.endCropBind=this.endCrop.bindAsEventListener(this); +Event.observe(document,"mouseup",this.endCropBind); +this.resizeBind=this.startResize.bindAsEventListener(this); +this.handles=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; +this.registerHandles(true); +if(this.options.captureKeys){ +this.keysBind=this.handleKeys.bindAsEventListener(this); +Event.observe(document,"keypress",this.keysBind); +} +new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)}); +this.setParams(); +},registerHandles:function(_13){ +for(var i=0;i0&&this.options.ratioDim.y>0){ +_1a.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2); +_1a.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); +_1a.x2=_1a.x1+this.options.ratioDim.x; +_1a.y2=_1a.y1+this.options.ratioDim.y; +_1b=true; +} +} +//this.setAreaCoords(_1a,false,false,1); +if(this.options.displayOnInit&&_1b){ +this.selArea.show(); +this.drawArea(); +this.endCrop(); +} +this.attached=true; +},remove:function(){ +if(this.attached){ +this.attached=false; +this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap); +this.imgWrap.parentNode.removeChild(this.imgWrap); +Event.stopObserving(this.dragArea,"mousedown",this.startDragBind); +Event.stopObserving(document,"mousemove",this.onDragBind); +Event.stopObserving(document,"mouseup",this.endCropBind); +this.registerHandles(false); +if(this.options.captureKeys){ +Event.stopObserving(document,"keypress",this.keysBind); +} +} +}, +reset:function(minWidth, minHeight, maxWidth, maxHeight) +{ + if(!this.attached){ + this.onLoad(); + }else{ + this.setParams(); + } + this.endCrop(); + this.options.minWidth = minWidth; + this.options.minHeight = minHeight; + this.options.maxWidth = maxWidth; + this.options.maxHeight = maxHeight; +},handleKeys:function(e){ +var dir={x:0,y:0}; +if(!this.dragging){ +switch(e.keyCode){ +case (37): +dir.x=-1; +break; +case (38): +dir.y=-1; +break; +case (39): +dir.x=1; +break; +case (40): +dir.y=1; +break; +} +if(dir.x!=0||dir.y!=0){ +if(e.shiftKey){ +dir.x*=10; +dir.y*=10; +} +this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]); +Event.stop(e); +} +} +},calcW:function(){ +return (this.areaCoords.x2-this.areaCoords.x1); +},calcH:function(){ +return (this.areaCoords.y2-this.areaCoords.y1); +},moveArea:function(_1e){ +this.setAreaCoords({x1:_1e[0],y1:_1e[1],x2:_1e[0]+this.calcW(),y2:_1e[1]+this.calcH()},true,false); +this.drawArea(); +},cloneCoords:function(_1f){ +return {x1:_1f.x1,y1:_1f.y1,x2:_1f.x2,y2:_1f.y2}; +},setAreaCoords:function(_20,_21,_22,_23,_24){ +if(_21){ +var _25=_20.x2-_20.x1; +var _26=_20.y2-_20.y1; +if(_20.x1<0){ +_20.x1=0; +_20.x2=_25; +} +if(_20.y1<0){ +_20.y1=0; +_20.y2=_26; +} +if(_20.x2>this.imgW){ +_20.x2=this.imgW; +_20.x1=this.imgW-_25; +} +if(_20.y2>this.imgH){ +_20.y2=this.imgH; +_20.y1=this.imgH-_26; +} +}else{ +if(_20.x1<0){ +_20.x1=0; +} +if(_20.y1<0){ +_20.y1=0; +} +if(_20.x2>this.imgW){ +_20.x2=this.imgW; +} +if(_20.y2>this.imgH){ +_20.y2=this.imgH; +} +if(_23!=null){ +if(this.ratioX>0){ +this.applyRatio(_20,{x:this.ratioX,y:this.ratioY},_23,_24); +}else{ +if(_22){ +this.applyRatio(_20,{x:1,y:1},_23,_24); +} +} +var _27=[this.options.minWidth,this.options.minHeight]; +var _28=[this.options.maxWidth,this.options.maxHeight]; +if(_27[0]>0||_27[1]>0||_28[0]>0||_28[1]>0){ +var _29={a1:_20.x1,a2:_20.x2}; +var _2a={a1:_20.y1,a2:_20.y2}; +var _2b={min:0,max:this.imgW}; +var _2c={min:0,max:this.imgH}; +if((_27[0]!=0||_27[1]!=0)&&_22){ +if(_27[0]>0){ +_27[1]=_27[0]; +}else{ +if(_27[1]>0){ +_27[0]=_27[1]; +} +} +} +if((_28[0]!=0||_28[0]!=0)&&_22){ +if(_28[0]>0&&_28[0]<=_28[1]){ +_28[1]=_28[0]; +}else{ +if(_28[1]>0&&_28[1]<=_28[0]){ +_28[0]=_28[1]; +} +} +} +if(_27[0]>0){ +this.applyDimRestriction(_29,_27[0],_23.x,_2b,"min"); +} +if(_27[1]>1){ +this.applyDimRestriction(_2a,_27[1],_23.y,_2c,"min"); +} +if(_28[0]>0){ +this.applyDimRestriction(_29,_28[0],_23.x,_2b,"max"); +} +if(_28[1]>1){ +this.applyDimRestriction(_2a,_28[1],_23.y,_2c,"max"); +} +_20={x1:_29.a1,y1:_2a.a1,x2:_29.a2,y2:_2a.a2}; +} +} +} +this.areaCoords=_20; +},applyDimRestriction:function(_2d,val,_2f,_30,_31){ +var _32; +if(_31=="min"){ +_32=((_2d.a2-_2d.a1)val); +} +if(_32){ +if(_2f==1){ +_2d.a2=_2d.a1+val; +}else{ +_2d.a1=_2d.a2-val; +} +if(_2d.a1<_30.min){ +_2d.a1=_30.min; +_2d.a2=val; +}else{ +if(_2d.a2>_30.max){ +_2d.a1=_30.max-val; +_2d.a2=_30.max; +} +} +} +},applyRatio:function(_33,_34,_35,_36){ +var _37; +if(_36=="N"||_36=="S"){ +_37=this.applyRatioToAxis({a1:_33.y1,b1:_33.x1,a2:_33.y2,b2:_33.x2},{a:_34.y,b:_34.x},{a:_35.y,b:_35.x},{min:0,max:this.imgW}); +_33.x1=_37.b1; +_33.y1=_37.a1; +_33.x2=_37.b2; +_33.y2=_37.a2; +}else{ +_37=this.applyRatioToAxis({a1:_33.x1,b1:_33.y1,a2:_33.x2,b2:_33.y2},{a:_34.x,b:_34.y},{a:_35.x,b:_35.y},{min:0,max:this.imgH}); +_33.x1=_37.a1; +_33.y1=_37.b1; +_33.x2=_37.a2; +_33.y2=_37.b2; +} +},applyRatioToAxis:function(_38,_39,_3a,_3b){ +var _3c=Object.extend(_38,{}); +var _3d=_3c.a2-_3c.a1; +var _3e=Math.floor(_3d*_39.b/_39.a); +var _3f; +var _40; +var _41=null; +if(_3a.b==1){ +_3f=_3c.b1+_3e; +if(_3f>_3b.max){ +_3f=_3b.max; +_41=_3f-_3c.b1; +} +_3c.b2=_3f; +}else{ +_3f=_3c.b2-_3e; +if(_3f<_3b.min){ +_3f=_3b.min; +_41=_3f+_3c.b2; +} +_3c.b1=_3f; +} +if(_41!=null){ +_40=Math.floor(_41*_39.a/_39.b); +if(_3a.a==1){ +_3c.a2=_3c.a1+_40; +}else{ +_3c.a1=_3c.a1=_3c.a2-_40; +} +} +return _3c; +},drawArea:function(){ +var _42=this.calcW(); +var _43=this.calcH(); +var px="px"; +var _45=[this.areaCoords.x1+px,this.areaCoords.y1+px,_42+px,_43+px,this.areaCoords.x2+px,this.areaCoords.y2+px,(this.img.width-this.areaCoords.x2)+px,(this.img.height-this.areaCoords.y2)+px]; +var _46=this.selArea.style; +_46.left=_45[0]; +_46.top=_45[1]; +_46.width=_45[2]; +_46.height=_45[3]; +var _47=Math.ceil((_42-6)/2)+px; +var _48=Math.ceil((_43-6)/2)+px; +this.handleN.style.left=_47; +this.handleE.style.top=_48; +this.handleS.style.left=_47; +this.handleW.style.top=_48; +this.north.style.height=_45[1]; +var _49=this.east.style; +_49.top=_45[1]; +_49.height=_45[3]; +_49.left=_45[4]; +_49.width=_45[6]; +var _4a=this.south.style; +_4a.top=_45[5]; +_4a.height=_45[7]; +var _4b=this.west.style; +_4b.top=_45[1]; +_4b.height=_45[3]; +_4b.width=_45[0]; +this.subDrawArea(); +this.forceReRender(); +},forceReRender:function(){ +if(this.isIE||this.isWebKit){ +var n=document.createTextNode(" "); +var d,el,fixEL,i; +if(this.isIE){ +fixEl=this.selArea; +}else{ +if(this.isWebKit){ +fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0]; +d=Builder.node("div",""); +d.style.visibility="hidden"; +var _4e=["SE","S","SW"]; +for(i=0;i<_4e.length;i++){ +el=document.getElementsByClassName("imgCrop_handle"+_4e[i],this.selArea)[0]; +if(el.childNodes.length){ +el.removeChild(el.childNodes[0]); +} +el.appendChild(d); +} +} +} +fixEl.appendChild(n); +fixEl.removeChild(n); +} +},startResize:function(e){ +this.startCoords=this.cloneCoords(this.areaCoords); +this.resizing=true; +this.resizeHandle=Event.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); +Event.stop(e); +},startDrag:function(e){ +this.selArea.show(); +this.clickCoords=this.getCurPos(e); +this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null); +this.dragging=true; +this.onDrag(e); +Event.stop(e); +},getCurPos:function(e){ +var el=this.imgWrap,wrapOffsets=Position.cumulativeOffset(el); +while(el.nodeName!="BODY"){ +wrapOffsets[1]-=el.scrollTop||0; +wrapOffsets[0]-=el.scrollLeft||0; +el=el.parentNode; +} +return curPos={x:Event.pointerX(e)-wrapOffsets[0],y:Event.pointerY(e)-wrapOffsets[1]}; +},onDrag:function(e){ +if(this.dragging||this.resizing){ +var _54=null; +var _55=this.getCurPos(e); +var _56=this.cloneCoords(this.areaCoords); +var _57={x:1,y:1}; +if(this.dragging){ +if(_55.x_59){ +_5c.reverse(); +} +_5a[_5b+"1"]=_5c[0]; +_5a[_5b+"2"]=_5c[1]; +},endCrop:function(){ +this.dragging=false; +this.resizing=false; +this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()}); +},subInitialize:function(){ +},subDrawArea:function(){ +}}; +Cropper.ImgWithPreview=Class.create(); +Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){ +this.hasPreviewImg=false; +if(typeof (this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){ +this.previewWrap=$(this.options.previewWrap); +this.previewImg=this.img.cloneNode(false); +this.previewImg.id="imgCrop_"+this.previewImg.id; +this.options.displayOnInit=true; +this.hasPreviewImg=true; +this.previewWrap.addClassName("imgCrop_previewWrap"); +this.previewWrap.setStyle({width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); +this.previewWrap.appendChild(this.previewImg); +} +},subDrawArea:function(){ +if(this.hasPreviewImg){ +var _5d=this.calcW(); +var _5e=this.calcH(); +var _5f={x:this.imgW/_5d,y:this.imgH/_5e}; +var _60={x:_5d/this.options.minWidth,y:_5e/this.options.minHeight}; +var _61={w:Math.ceil(this.options.minWidth*_5f.x)+"px",h:Math.ceil(this.options.minHeight*_5f.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_60.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_60.y)+"px"}; +var _62=this.previewImg.style; +_62.width=_61.w; +_62.height=_61.h; +_62.left=_61.x; +_62.top=_61.y; +} +}}); + diff --git a/js/cropper/dragdrop.js b/js/cropper/dragdrop.js new file mode 100644 index 000000000..be2a30f53 --- /dev/null +++ b/js/cropper/dragdrop.js @@ -0,0 +1,915 @@ +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// See scriptaculous.js for full license. + +/*--------------------------------------------------------------------------*/ + +var Droppables = { + drops: [], + + remove: function(element) { + this.drops = this.drops.reject(function(d) { return d.element==$(element) }); + }, + + add: function(element) { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || {}); + + // cache containers + if(options.containment) { + options._containers = []; + var containment = options.containment; + if((typeof containment == 'object') && + (containment.constructor == Array)) { + containment.each( function(c) { options._containers.push($(c)) }); + } else { + options._containers.push($(containment)); + } + } + + if(options.accept) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function(drops) { + deepest = drops[0]; + + for (i = 1; i < drops.length; ++i) + if (Element.isParent(drops[i].element, deepest.element)) + deepest = drops[i]; + + return deepest; + }, + + isContained: function(element, drop) { + var containmentNode; + if(drop.tree) { + containmentNode = element.treeNode; + } else { + containmentNode = element.parentNode; + } + return drop._containers.detect(function(c) { return containmentNode == c }); + }, + + isAffected: function(point, element, drop) { + return ( + (drop.element!=element) && + ((!drop._containers) || + this.isContained(element, drop)) && + ((!drop.accept) || + (Element.classNames(element).detect( + function(v) { return drop.accept.include(v) } ) )) && + Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function(drop) { + if(drop.hoverclass) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function(drop) { + if(drop.hoverclass) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function(point, element) { + if(!this.drops.length) return; + var affected = []; + + if(this.last_active) this.deactivate(this.last_active); + this.drops.each( function(drop) { + if(Droppables.isAffected(point, element, drop)) + affected.push(drop); + }); + + if(affected.length>0) { + drop = Droppables.findDeepestChild(affected); + Position.within(drop.element, point[0], point[1]); + if(drop.onHover) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + Droppables.activate(drop); + } + }, + + fire: function(event, element) { + if(!this.last_active) return; + Position.prepare(); + + if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) + if (this.last_active.onDrop) + this.last_active.onDrop(element, this.last_active.element, event); + }, + + reset: function() { + if(this.last_active) + this.deactivate(this.last_active); + } +} + +var Draggables = { + drags: [], + observers: [], + + register: function(draggable) { + if(this.drags.length == 0) { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function(draggable) { + this.drags = this.drags.reject(function(d) { return d==draggable }); + if(this.drags.length == 0) { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function(draggable) { + window.focus(); // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + }, + + deactivate: function() { + this.activeDraggable = null; + }, + + updateDrag: function(event) { + if(!this.activeDraggable) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; + this._lastPointer = pointer; + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function(event) { + if(!this.activeDraggable) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function(event) { + if(this.activeDraggable) + this.activeDraggable.keyPress(event); + }, + + addObserver: function(observer) { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function(element) { // element instead of observer fixes mem leaks + this.observers = this.observers.reject( function(o) { return o.element==element }); + this._cacheObserverCallbacks(); + }, + + notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' + if(this[eventName+'Count'] > 0) + this.observers.each( function(o) { + if(o[eventName]) o[eventName](eventName, draggable, event); + }); + }, + + _cacheObserverCallbacks: function() { + ['onStart','onEnd','onDrag'].each( function(eventName) { + Draggables[eventName+'Count'] = Draggables.observers.select( + function(o) { return o[eventName]; } + ).length; + }); + } +} + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create(); +Draggable.prototype = { + initialize: function(element) { + var options = Object.extend({ + handle: false, + starteffect: function(element) { + element._opacity = Element.getOpacity(element); + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + }, + reverteffect: function(element, top_offset, left_offset) { + var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; + element._revert = new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur}); + }, + endeffect: function(element) { + var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0 + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity}); + }, + zindex: 1000, + revert: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false // false, or xy or [x,y] or function(x,y){ return [x,y] } + }, arguments[1] || {}); + + this.element = $(element); + + if(options.handle && (typeof options.handle == 'string')) { + var h = Element.childrenWithClassName(this.element, options.handle, true); + if(h.length>0) this.handle = h[0]; + } + if(!this.handle) this.handle = $(options.handle); + if(!this.handle) this.handle = this.element; + + if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) + options.scroll = $(options.scroll); + + Element.makePositioned(this.element); // fix IE + + this.delta = this.currentDelta(); + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() { + return([ + parseInt(Element.getStyle(this.element,'left') || '0'), + parseInt(Element.getStyle(this.element,'top') || '0')]); + }, + + initDrag: function(event) { + if(Event.isLeftClick(event)) { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if(src.tagName && ( + src.tagName=='INPUT' || + src.tagName=='SELECT' || + src.tagName=='OPTION' || + src.tagName=='BUTTON' || + src.tagName=='TEXTAREA')) return; + + if(this.element._revert) { + this.element._revert.cancel(); + this.element._revert = null; + } + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function(event) { + this.dragging = true; + + if(this.options.zindex) { + this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if(this.options.ghosting) { + this._clone = this.element.cloneNode(true); + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if(this.options.scroll) { + if (this.options.scroll == window) { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } else { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + if(this.options.starteffect) this.options.starteffect(this.element); + }, + + updateDrag: function(event, pointer) { + if(!this.dragging) this.startDrag(event); + Position.prepare(); + Droppables.show(pointer, this.element); + Draggables.notify('onDrag', this, event); + this.draw(pointer); + if(this.options.change) this.options.change(this); + + if(this.options.scroll) { + this.stopScrolling(); + + var p; + if (this.options.scroll == window) { + with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } + } else { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft; + p[1] += this.options.scroll.scrollTop; + p.push(p[0]+this.options.scroll.offsetWidth); + p.push(p[1]+this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); + if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); + if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); + if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + + Event.stop(event); + }, + + finishDrag: function(event, success) { + this.dragging = false; + + if(this.options.ghosting) { + Position.relativize(this.element); + Element.remove(this._clone); + this._clone = null; + } + + if(success) Droppables.fire(event, this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if(revert && typeof revert == 'function') revert = revert(this.element); + + var d = this.currentDelta(); + if(revert && this.options.reverteffect) { + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); + } else { + this.delta = d; + } + + if(this.options.zindex) + this.element.style.zIndex = this.originalZ; + + if(this.options.endeffect) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function(event) { + if(event.keyCode!=Event.KEY_ESC) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function(event) { + if(!this.dragging) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function(point) { + var pos = Position.cumulativeOffset(this.element); + var d = this.currentDelta(); + pos[0] -= d[0]; pos[1] -= d[1]; + + if(this.options.scroll && (this.options.scroll != window)) { + pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; + } + + var p = [0,1].map(function(i){ + return (point[i]-pos[i]-this.offset[i]) + }.bind(this)); + + if(this.options.snap) { + if(typeof this.options.snap == 'function') { + p = this.options.snap(p[0],p[1],this); + } else { + if(this.options.snap instanceof Array) { + p = p.map( function(v, i) { + return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this)) + } else { + p = p.map( function(v) { + return Math.round(v/this.options.snap)*this.options.snap }.bind(this)) + } + }} + + var style = this.element.style; + if((!this.options.constraint) || (this.options.constraint=='horizontal')) + style.left = p[0] + "px"; + if((!this.options.constraint) || (this.options.constraint=='vertical')) + style.top = p[1] + "px"; + if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() { + if(this.scrollInterval) { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function(speed) { + this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if(this.options.scroll == window) { + with (this._getWindowScroll(this.options.scroll)) { + if (this.scrollSpeed[0] || this.scrollSpeed[1]) { + var d = delta / 1000; + this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); + } + } + } else { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if (Draggables._lastScrollPointer[0] < 0) + Draggables._lastScrollPointer[0] = 0; + if (Draggables._lastScrollPointer[1] < 0) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + + if(this.options.change) this.options.change(this); + }, + + _getWindowScroll: function(w) { + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight + } + } + return { top: T, left: L, width: W, height: H }; + } +} + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create(); +SortableObserver.prototype = { + initialize: function(element, observer) { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() { + Sortable.unmark(); + if(this.lastValue != Sortable.serialize(this.element)) + this.observer(this.element) + } +} + +var Sortable = { + sortables: {}, + + _findRootElement: function(element) { + while (element.tagName != "BODY") { + if(element.id && Sortable.sortables[element.id]) return element; + element = element.parentNode; + } + }, + + options: function(element) { + element = Sortable._findRootElement($(element)); + if(!element) return; + return Sortable.sortables[element.id]; + }, + + destroy: function(element){ + var s = Sortable.options(element); + + if(s) { + Draggables.removeObserver(s.element); + s.droppables.each(function(d){ Droppables.remove(d) }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function(element) { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + hoverclass: null, + ghosting: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: /^[^_]*_(.*)$/, + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || {}); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if(options.starteffect) + options_for_draggable.starteffect = options.starteffect; + + if(options.reverteffect) + options_for_draggable.reverteffect = options.reverteffect; + else + if(options.ghosting) options_for_draggable.reverteffect = function(element) { + element.style.top = 0; + element.style.left = 0; + }; + + if(options.endeffect) + options_for_draggable.endeffect = options.endeffect; + + if(options.zindex) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + //greedy: !options.dropOnEmpty + } + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + } + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if(options.dropOnEmpty || options.tree) { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (this.findElements(element, options) || []).each( function(e) { + // handles are per-draggable + var handle = options.handle ? + Element.childrenWithClassName(e, options.handle)[0] : e; + options.draggables.push( + new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if(options.tree) e.treeNode = element; + options.droppables.push(e); + }); + + if(options.tree) { + (Sortable.findTreeElements(element, options) || []).each( function(e) { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + + // return all suitable-for-sortable elements in a guaranteed order + findElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function(element, dropon, overlap) { + if(Element.isParent(dropon, element)) return; + + if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { + return; + } else if(overlap>0.5) { + Sortable.mark(dropon, 'before'); + if(dropon.previousSibling != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } else { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if(nextElement != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function(element, dropon, overlap) { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if(!Element.isParent(dropon, element)) { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag}); + var child = null; + + if(children) { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for (index = 0; index < children.length; index += 1) { + if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { + offset -= Element.offsetSize (children[index], droponOptions.overlap); + } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } else { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() { + if(Sortable._marker) Element.hide(Sortable._marker); + }, + + mark: function(dropon, position) { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if(sortable && !sortable.ghosting) return; + + if(!Sortable._marker) { + Sortable._marker = $('dropmarker') || document.createElement('DIV'); + Element.hide(Sortable._marker); + Element.addClassName(Sortable._marker, 'dropmarker'); + Sortable._marker.style.position = 'absolute'; + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.style.left = offsets[0] + 'px'; + Sortable._marker.style.top = offsets[1] + 'px'; + + if(position=='after') + if(sortable.overlap == 'horizontal') + Sortable._marker.style.left = (offsets[0]+dropon.clientWidth) + 'px'; + else + Sortable._marker.style.top = (offsets[1]+dropon.clientHeight) + 'px'; + + Element.show(Sortable._marker); + }, + + _tree: function(element, options, parent) { + var children = Sortable.findElements(element, options) || []; + + for (var i = 0; i < children.length; ++i) { + var match = children[i].id.match(options.format); + + if (!match) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: new Array, + position: parent.children.length, + container: Sortable._findChildrenElement(children[i], options.treeTag.toUpperCase()) + } + + /* Get the element containing the children and recurse over it */ + if (child.container) + this._tree(child.container, options, child) + + parent.children.push (child); + } + + return parent; + }, + + /* Finds the first element of the given tag type within a parent element. + Used for finding the first LI[ST] within a L[IST]I[TEM].*/ + _findChildrenElement: function (element, containerTag) { + if (element && element.hasChildNodes) + for (var i = 0; i < element.childNodes.length; ++i) + if (element.childNodes[i].tagName == containerTag) + return element.childNodes[i]; + + return null; + }, + + tree: function(element) { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || {}); + + var root = { + id: null, + parent: null, + children: new Array, + container: element, + position: 0 + } + + return Sortable._tree (element, options, root); + }, + + /* Construct a [i] index for a particular node */ + _constructIndex: function(node) { + var index = ''; + do { + if (node.id) index = '[' + node.position + ']' + index; + } while ((node = node.parent) != null); + return index; + }, + + sequence: function(element) { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || {}); + + return $(this.findElements(element, options) || []).map( function(item) { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function(element, new_sequence) { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || {}); + + var nodeMap = {}; + this.findElements(element, options).each( function(n) { + if (n.id.match(options.format)) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function(ident) { + var n = nodeMap[ident]; + if (n) { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function(element) { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || {}); + var name = encodeURIComponent( + (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if (options.tree) { + return Sortable.tree(element, arguments[1]).children.map( function (item) { + return [name + Sortable._constructIndex(item) + "=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } else { + return Sortable.sequence(element, arguments[1]).map( function(item) { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +} + +/* Returns true if child is contained within element */ +Element.isParent = function(child, element) { + if (!child.parentNode || child == element) return false; + + if (child.parentNode == element) return true; + + return Element.isParent(child.parentNode, element); +} + +Element.findChildren = function(element, only, recursive, tagName) { + if(!element.hasChildNodes()) return null; + tagName = tagName.toUpperCase(); + if(only) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each( function(e) { + if(e.tagName && e.tagName.toUpperCase()==tagName && + (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) + elements.push(e); + if(recursive) { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if(grandchildren) elements.push(grandchildren); + } + }); + + return (elements.length>0 ? elements.flatten() : []); +} + +Element.offsetSize = function (element, type) { + if (type == 'vertical' || type == 'height') + return element.offsetHeight; + else + return element.offsetWidth; +} \ No newline at end of file diff --git a/js/cropper/index.php b/js/cropper/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/cropper/index.php @@ -0,0 +1,11 @@ + + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.0_rc0', + ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', + + emptyFunction: function() {}, + K: function(x) {return x} +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (var property in source) { + destination[property] = source[property]; + } + return destination; +} + +Object.inspect = function(object) { + try { + if (object == undefined) return 'undefined'; + if (object == null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } +} + +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this; + return function(event) { + return __method.call(object, event || window.event); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() { + var digits = this.toString(16); + if (this < 16) return '0' + digits; + return digits; + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + } +}); + +var Try = { + these: function() { + var returnValue; + + for (var i = 0; i < arguments.length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(); + } finally { + this.currentlyExecuting = false; + } + } + } +} +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += (replacement(match) || '').toString(); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var div = document.createElement('div'); + var text = document.createTextNode(this); + div.appendChild(text); + return div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; + }, + + toQueryParams: function() { + var pairs = this.match(/^\??(.*)$/)[1].split('&'); + return pairs.inject({}, function(params, pairString) { + var pair = pairString.split('='); + params[pair[0]] = pair[1]; + return params; + }); + }, + + toArray: function() { + return this.split(''); + }, + + camelize: function() { + var oStringList = this.split('-'); + if (oStringList.length == 1) return oStringList[0]; + + var camelizedString = this.indexOf('-') == 0 + ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) + : oStringList[0]; + + for (var i = 1, len = oStringList.length; i < len; i++) { + var s = oStringList[i]; + camelizedString += s.charAt(0).toUpperCase() + s.substring(1); + } + + return camelizedString; + }, + + inspect: function() { + return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'"; + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (typeof replacement == 'function') return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.prototype = { + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + return this.template.gsub(this.pattern, function(match) { + var before = match[1]; + if (before == '\\') return match[2]; + return before + (object[match[3]] || '').toString(); + }); + } +} + +var $break = new Object(); +var $continue = new Object(); + +var Enumerable = { + each: function(iterator) { + var index = 0; + try { + this._each(function(value) { + try { + iterator(value, index++); + } catch (e) { + if (e != $continue) throw e; + } + }); + } catch (e) { + if (e != $break) throw e; + } + }, + + all: function(iterator) { + var result = true; + this.each(function(value, index) { + result = result && !!(iterator || Prototype.K)(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator) { + var result = true; + this.each(function(value, index) { + if (result = !!(iterator || Prototype.K)(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator) { + var results = []; + this.each(function(value, index) { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function (iterator) { + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator) { + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(pattern, iterator) { + var results = []; + this.each(function(value, index) { + var stringValue = value.toString(); + if (stringValue.match(pattern)) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function(object) { + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inject: function(memo, iterator) { + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.collect(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator) { + var trues = [], falses = []; + this.each(function(value, index) { + ((iterator || Prototype.K)(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value, index) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator) { + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator) { + return this.collect(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.collect(Prototype.K); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (typeof args.last() == 'function') + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + inspect: function() { + return '#'; + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); +var $A = Array.from = function(iterable) { + if (!iterable) return []; + if (iterable.toArray) { + return iterable.toArray(); + } else { + var results = []; + for (var i = 0; i < iterable.length; i++) + results.push(iterable[i]); + return results; + } +} + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) + Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0; i < this.length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != undefined || value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(value && value.constructor == Array ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + indexOf: function(object) { + for (var i = 0; i < this.length; i++) + if (this[i] == object) return i; + return -1; + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + } +}); +var Hash = { + _each: function(iterator) { + for (var key in this) { + var value = this[key]; + if (typeof value == 'function') continue; + + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + merge: function(hash) { + return $H(hash).inject($H(this), function(mergedHash, pair) { + mergedHash[pair.key] = pair.value; + return mergedHash; + }); + }, + + toQueryString: function() { + return this.map(function(pair) { + return pair.map(encodeURIComponent).join('='); + }).join('&'); + }, + + inspect: function() { + return '#'; + } +} + +function $H(object) { + var hash = Object.extend({}, object || {}); + Object.extend(hash, Enumerable); + Object.extend(hash, Hash); + return hash; +} +ObjectRange = Class.create(); +Object.extend(ObjectRange.prototype, Enumerable); +Object.extend(ObjectRange.prototype, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + do { + iterator(value); + value = value.succ(); + } while (this.include(value)); + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +} + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +} + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responderToAdd) { + if (!this.include(responderToAdd)) + this.responders.push(responderToAdd); + }, + + unregister: function(responderToRemove) { + this.responders = this.responders.without(responderToRemove); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (responder[callback] && typeof responder[callback] == 'function') { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) {} + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { + Ajax.activeRequestCount++; + }, + + onComplete: function() { + Ajax.activeRequestCount--; + } +}); + +Ajax.Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + parameters: '' + } + Object.extend(this.options, options || {}); + }, + + responseIsSuccess: function() { + return this.transport.status == undefined + || this.transport.status == 0 + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + responseIsFailure: function() { + return !this.responseIsSuccess(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + initialize: function(url, options) { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function(url) { + var parameters = this.options.parameters || ''; + if (parameters.length > 0) parameters += '&_='; + + try { + this.url = url; + if (this.options.method == 'get' && parameters.length > 0) + this.url += (this.url.match(/\?/) ? '&' : '?') + parameters; + + Ajax.Responders.dispatch('onCreate', this, this.transport); + + this.transport.open(this.options.method, this.url, + this.options.asynchronous); + + if (this.options.asynchronous) { + this.transport.onreadystatechange = this.onStateChange.bind(this); + setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); + } + + this.setRequestHeaders(); + + var body = this.options.postBody ? this.options.postBody : parameters; + this.transport.send(this.options.method == 'post' ? body : null); + + } catch (e) { + this.dispatchException(e); + } + }, + + setRequestHeaders: function() { + var requestHeaders = + ['X-Requested-With', 'XMLHttpRequest', + 'X-Prototype-Version', Prototype.Version, + 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*']; + + if (this.options.method == 'post') { + requestHeaders.push('Content-type', this.options.contentType); + + /* Force "Connection: close" for Mozilla browsers to work around + * a bug where XMLHttpReqeuest sends an incorrect Content-length + * header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType) + requestHeaders.push('Connection', 'close'); + } + + if (this.options.requestHeaders) + requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); + + for (var i = 0; i < requestHeaders.length; i += 2) + this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState != 1) + this.respondToReadyState(this.transport.readyState); + }, + + header: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) {} + }, + + evalJSON: function() { + try { + return eval('(' + this.header('X-JSON') + ')'); + } catch (e) {} + }, + + evalResponse: function() { + try { + return eval(this.transport.responseText); + } catch (e) { + this.dispatchException(e); + } + }, + + respondToReadyState: function(readyState) { + var event = Ajax.Request.Events[readyState]; + var transport = this.transport, json = this.evalJSON(); + + if (event == 'Complete') { + try { + (this.options['on' + this.transport.status] + || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(transport, json); + } catch (e) { + this.dispatchException(e); + } + + if ((this.header('Content-type') || '').match(/^text\/javascript/i)) + this.evalResponse(); + } + + try { + (this.options['on' + event] || Prototype.emptyFunction)(transport, json); + Ajax.Responders.dispatch('on' + event, this, transport, json); + } catch (e) { + this.dispatchException(e); + } + + /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ + if (event == 'Complete') + this.transport.onreadystatechange = Prototype.emptyFunction; + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Updater = Class.create(); + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function(container, url, options) { + this.containers = { + success: container.success ? $(container.success) : $(container), + failure: container.failure ? $(container.failure) : + (container.success ? null : $(container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function(transport, object) { + this.updateContent(); + onComplete(transport, object); + }).bind(this); + + this.request(url); + }, + + updateContent: function() { + var receiver = this.responseIsSuccess() ? + this.containers.success : this.containers.failure; + var response = this.transport.responseText; + + if (!this.options.evalScripts) + response = response.stripScripts(); + + if (receiver) { + if (this.options.insertion) { + new this.options.insertion(receiver, response); + } else { + Element.update(receiver, response); + } + } + + if (this.responseIsSuccess()) { + if (this.onComplete) + setTimeout(this.onComplete.bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function(container, url, options) { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(request) { + if (this.options.decay) { + this.decay = (request.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), + this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $() { + var results = [], element; + for (var i = 0; i < arguments.length; i++) { + element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + results.push(Element.extend(element)); + } + return results.length < 2 ? results[0] : results; +} + +document.getElementsByClassName = function(className, parentElement) { + var children = ($(parentElement) || document.body).getElementsByTagName('*'); + return $A(children).inject([], function(elements, child) { + if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) + elements.push(Element.extend(child)); + return elements; + }); +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Element) + var Element = new Object(); + +Element.extend = function(element) { + if (!element) return; + if (_nativeExtensions) return element; + + if (!element._extended && element.tagName && element != window) { + var methods = Element.Methods, cache = Element.extend.cache; + for (property in methods) { + var value = methods[property]; + if (typeof value == 'function') + element[property] = cache.findOrStore(value); + } + } + + element._extended = true; + return element; +} + +Element.extend.cache = { + findOrStore: function(value) { + return this[value] = this[value] || function() { + return value.apply(null, [this].concat($A(arguments))); + } + } +} + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + Element[Element.visible(element) ? 'hide' : 'show'](element); + } + }, + + hide: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = 'none'; + } + }, + + show: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = ''; + } + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + update: function(element, html) { + $(element).innerHTML = html.stripScripts(); + setTimeout(function() {html.evalScripts()}, 10); + }, + + replace: function(element, html) { + element = $(element); + if (element.outerHTML) { + element.outerHTML = html.stripScripts(); + } else { + var range = element.ownerDocument.createRange(); + range.selectNodeContents(element); + element.parentNode.replaceChild( + range.createContextualFragment(html.stripScripts()), element); + } + setTimeout(function() {html.evalScripts()}, 10); + }, + + getHeight: function(element) { + element = $(element); + return element.offsetHeight; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).include(className); + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).add(className); + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + return Element.classNames(element).remove(className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + }, + + empty: function(element) { + return $(element).innerHTML.match(/^\s*$/); + }, + + childOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + while (element = element.parentNode) + if (element == ancestor) return true; + return false; + }, + + scrollTo: function(element) { + element = $(element); + var x = element.x ? element.x : element.offsetLeft, + y = element.y ? element.y : element.offsetTop; + window.scrollTo(x, y); + }, + + getStyle: function(element, style) { + element = $(element); + var value = element.style[style.camelize()]; + if (!value) { + if (document.defaultView && document.defaultView.getComputedStyle) { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css.getPropertyValue(style) : null; + } else if (element.currentStyle) { + value = element.currentStyle[style.camelize()]; + } + } + + if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) + if (Element.getStyle(element, 'position') == 'static') value = 'auto'; + + return value == 'auto' ? null : value; + }, + + setStyle: function(element, style) { + element = $(element); + for (var name in style) + element.style[name.camelize()] = style[name]; + }, + + getDimensions: function(element) { + element = $(element); + if (Element.getStyle(element, 'display') != 'none') + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = ''; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = 'none'; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (window.opera) { + element.style.top = 0; + element.style.left = 0; + } + } + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return; + element._overflow = element.style.overflow; + if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') + element.style.overflow = 'hidden'; + }, + + undoClipping: function(element) { + element = $(element); + if (element._overflow) return; + element.style.overflow = element._overflow; + element._overflow = undefined; + } +} + +Object.extend(Element, Element.Methods); + +var _nativeExtensions = false; + +if(!HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) { + var HTMLElement = {} + HTMLElement.prototype = document.createElement('div').__proto__; +} + +Element.addMethods = function(methods) { + Object.extend(Element.Methods, methods || {}); + + if(typeof HTMLElement != 'undefined') { + var methods = Element.Methods, cache = Element.extend.cache; + for (property in methods) { + var value = methods[property]; + if (typeof value == 'function') + HTMLElement.prototype[property] = cache.findOrStore(value); + } + _nativeExtensions = true; + } +} + +Element.addMethods(); + +var Toggle = new Object(); +Toggle.display = Element.toggle; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function(adjacency) { + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function(element, content) { + this.element = $(element); + this.content = content.stripScripts(); + + if (this.adjacency && this.element.insertAdjacentHTML) { + try { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } catch (e) { + var tagName = this.element.tagName.toLowerCase(); + if (tagName == 'tbody' || tagName == 'tr') { + this.insertContent(this.contentFromAnonymousTable()); + } else { + throw e; + } + } + } else { + this.range = this.element.ownerDocument.createRange(); + if (this.initializeRange) this.initializeRange(); + this.insertContent([this.range.createContextualFragment(this.content)]); + } + + setTimeout(function() {content.evalScripts()}, 10); + }, + + contentFromAnonymousTable: function() { + var div = document.createElement('div'); + div.innerHTML = '' + this.content + '
    '; + return $A(div.childNodes[0].childNodes[0].childNodes); + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() { + this.range.setStartBefore(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, this.element); + }).bind(this)); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function(fragments) { + fragments.reverse(false).each((function(fragment) { + this.element.insertBefore(fragment, this.element.firstChild); + }).bind(this)); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.appendChild(fragment); + }).bind(this)); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() { + this.range.setStartAfter(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, + this.element.nextSibling); + }).bind(this)); + } +}); + +/*--------------------------------------------------------------------------*/ + +Element.ClassNames = Class.create(); +Element.ClassNames.prototype = { + initialize: function(element) { + this.element = $(element); + }, + + _each: function(iterator) { + this.element.className.split(/\s+/).select(function(name) { + return name.length > 0; + })._each(iterator); + }, + + set: function(className) { + this.element.className = className; + }, + + add: function(classNameToAdd) { + if (this.include(classNameToAdd)) return; + this.set(this.toArray().concat(classNameToAdd).join(' ')); + }, + + remove: function(classNameToRemove) { + if (!this.include(classNameToRemove)) return; + this.set(this.select(function(className) { + return className != classNameToRemove; + }).join(' ')); + }, + + toString: function() { + return this.toArray().join(' '); + } +} + +Object.extend(Element.ClassNames.prototype, Enumerable); +var Selector = Class.create(); +Selector.prototype = { + initialize: function(expression) { + this.params = {classNames: []}; + this.expression = expression.toString().strip(); + this.parseExpression(); + this.compileMatcher(); + }, + + parseExpression: function() { + function abort(message) { throw 'Parse error in selector: ' + message; } + + if (this.expression == '') abort('empty expression'); + + var params = this.params, expr = this.expression, match, modifier, clause, rest; + while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) { + params.attributes = params.attributes || []; + params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''}); + expr = match[1]; + } + + if (expr == '*') return this.params.wildcard = true; + + while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { + modifier = match[1], clause = match[2], rest = match[3]; + switch (modifier) { + case '#': params.id = clause; break; + case '.': params.classNames.push(clause); break; + case '': + case undefined: params.tagName = clause.toUpperCase(); break; + default: abort(expr.inspect()); + } + expr = rest; + } + + if (expr.length > 0) abort(expr.inspect()); + }, + + buildMatchExpression: function() { + var params = this.params, conditions = [], clause; + + if (params.wildcard) + conditions.push('true'); + if (clause = params.id) + conditions.push('element.id == ' + clause.inspect()); + if (clause = params.tagName) + conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); + if ((clause = params.classNames).length > 0) + for (var i = 0; i < clause.length; i++) + conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')'); + if (clause = params.attributes) { + clause.each(function(attribute) { + var value = 'element.getAttribute(' + attribute.name.inspect() + ')'; + var splitValueBy = function(delimiter) { + return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; + } + + switch (attribute.operator) { + case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break; + case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break; + case '|=': conditions.push( + splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect() + ); break; + case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; + case '': + case undefined: conditions.push(value + ' != null'); break; + default: throw 'Unknown operator ' + attribute.operator + ' in selector'; + } + }); + } + + return conditions.join(' && '); + }, + + compileMatcher: function() { + this.match = new Function('element', 'if (!element.tagName) return false; \ + return ' + this.buildMatchExpression()); + }, + + findElements: function(scope) { + var element; + + if (element = $(this.params.id)) + if (this.match(element)) + if (!scope || Element.childOf(element, scope)) + return [element]; + + scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); + + var results = []; + for (var i = 0; i < scope.length; i++) + if (this.match(element = scope[i])) + results.push(Element.extend(element)); + + return results; + }, + + toString: function() { + return this.expression; + } +} + +function $$() { + return $A(arguments).map(function(expression) { + return expression.strip().split(/\s+/).inject([null], function(results, expr) { + var selector = new Selector(expr); + return results.map(selector.findElements.bind(selector)).flatten(); + }); + }).flatten(); +} +var Field = { + clear: function() { + for (var i = 0; i < arguments.length; i++) + $(arguments[i]).value = ''; + }, + + focus: function(element) { + $(element).focus(); + }, + + present: function() { + for (var i = 0; i < arguments.length; i++) + if ($(arguments[i]).value == '') return false; + return true; + }, + + select: function(element) { + $(element).select(); + }, + + activate: function(element) { + element = $(element); + element.focus(); + if (element.select) + element.select(); + } +} + +/*--------------------------------------------------------------------------*/ + +var Form = { + serialize: function(form) { + var elements = Form.getElements($(form)); + var queryComponents = new Array(); + + for (var i = 0; i < elements.length; i++) { + var queryComponent = Form.Element.serialize(elements[i]); + if (queryComponent) + queryComponents.push(queryComponent); + } + + return queryComponents.join('&'); + }, + + getElements: function(form) { + form = $(form); + var elements = new Array(); + + for (var tagName in Form.Element.Serializers) { + var tagElements = form.getElementsByTagName(tagName); + for (var j = 0; j < tagElements.length; j++) + elements.push(tagElements[j]); + } + return elements; + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) + return inputs; + + var matchingInputs = new Array(); + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || + (name && input.name != name)) + continue; + matchingInputs.push(input); + } + + return matchingInputs; + }, + + disable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.blur(); + element.disabled = 'true'; + } + }, + + enable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.disabled = ''; + } + }, + + findFirstElement: function(form) { + return Form.getElements(form).find(function(element) { + return element.type != 'hidden' && !element.disabled && + ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + Field.activate(Form.findFirstElement(form)); + }, + + reset: function(form) { + $(form).reset(); + } +} + +Form.Element = { + serialize: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) { + var key = encodeURIComponent(parameter[0]); + if (key.length == 0) return; + + if (parameter[1].constructor != Array) + parameter[1] = [parameter[1]]; + + return parameter[1].map(function(value) { + return key + '=' + encodeURIComponent(value); + }).join('&'); + } + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) + return parameter[1]; + } +} + +Form.Element.Serializers = { + input: function(element) { + switch (element.type.toLowerCase()) { + case 'submit': + case 'hidden': + case 'password': + case 'text': + return Form.Element.Serializers.textarea(element); + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + } + return false; + }, + + inputSelector: function(element) { + if (element.checked) + return [element.name, element.value]; + }, + + textarea: function(element) { + return [element.name, element.value]; + }, + + select: function(element) { + return Form.Element.Serializers[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + }, + + selectOne: function(element) { + var value = '', opt, index = element.selectedIndex; + if (index >= 0) { + opt = element.options[index]; + value = opt.value || opt.text; + } + return [element.name, value]; + }, + + selectMany: function(element) { + var value = []; + for (var i = 0; i < element.length; i++) { + var opt = element.options[i]; + if (opt.selected) + value.push(opt.value || opt.text); + } + return [element.name, value]; + } +} + +/*--------------------------------------------------------------------------*/ + +var $F = Form.Element.getValue; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() {} +Abstract.TimedObserver.prototype = { + initialize: function(element, frequency, callback) { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() {} +Abstract.EventObserver.prototype = { + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + var elements = Form.getElements(this.element); + for (var i = 0; i < elements.length; i++) + this.registerCallback(elements[i]); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + case 'password': + case 'text': + case 'textarea': + case 'select-one': + case 'select-multiple': + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) { + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + + element: function(event) { + return event.target || event.srcElement; + }, + + isLeftClick: function(event) { + return (((event.which) && (event.which == 1)) || + ((event.button) && (event.button == 1))); + }, + + pointerX: function(event) { + return event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function(event) { + return event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function(event) { + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.returnValue = false; + event.cancelBubble = true; + } + }, + + // find the first node with the given tagName, starting from the + // node the event was triggered on; traverses the DOM upwards + findElement: function(event, tagName) { + var element = Event.element(event); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function(element, name, observer, useCapture) { + if (!this.observers) this.observers = []; + if (element.addEventListener) { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } else if (element.attachEvent) { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() { + if (!Event.observers) return; + for (var i = 0; i < Event.observers.length; i++) { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.attachEvent)) + name = 'keydown'; + + this._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.detachEvent)) + name = 'keydown'; + + if (element.removeEventListener) { + element.removeEventListener(name, observer, useCapture); + } else if (element.detachEvent) { + element.detachEvent('on' + name, observer); + } + } +}); + +/* prevent memory leaks in IE */ +if (navigator.appVersion.match(/\bMSIE\b/)) + Event.observe(window, 'unload', Event.unloadCache, false); +var Position = { + // set to true if needed, warning: firefox performance problems + // NOT neeeded for page scrolling, only if draggable contained in + // scrollable elements + includeScrollOffsets: false, + + // must be called before calling withinIncludingScrolloffset, every time the + // page is scrolled + prepare: function() { + this.deltaX = window.pageXOffset + || document.documentElement.scrollLeft + || document.body.scrollLeft + || 0; + this.deltaY = window.pageYOffset + || document.documentElement.scrollTop + || document.body.scrollTop + || 0; + }, + + realOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [valueL, valueT]; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [valueL, valueT]; + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + p = Element.getStyle(element, 'position'); + if (p == 'relative' || p == 'absolute') break; + } + } while (element); + return [valueL, valueT]; + }, + + offsetParent: function(element) { + if (element.offsetParent) return element.offsetParent; + if (element == document.body) return element; + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return element; + + return document.body; + }, + + // caches x/y coordinate pair to use with overlap + within: function(element, x, y) { + if (this.includeScrollOffsets) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && + y < this.offset[1] + element.offsetHeight && + x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function(element, x, y) { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && + this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && + this.xcomp < this.offset[0] + element.offsetWidth); + }, + + // within must be called directly before + overlap: function(mode, element) { + if (!mode) return 0; + if (mode == 'vertical') + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / + element.offsetHeight; + if (mode == 'horizontal') + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / + element.offsetWidth; + }, + + clone: function(source, target) { + source = $(source); + target = $(target); + target.style.position = 'absolute'; + var offsets = this.cumulativeOffset(source); + target.style.top = offsets[1] + 'px'; + target.style.left = offsets[0] + 'px'; + target.style.width = source.offsetWidth + 'px'; + target.style.height = source.offsetHeight + 'px'; + }, + + page: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent==document.body) + if (Element.getStyle(element,'position')=='absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } while (element = element.parentNode); + + return [valueL, valueT]; + }, + + clone: function(source, target) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || {}) + + // find page position of source + source = $(source); + var p = Position.page(source); + + // find coordinate system to use + target = $(target); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(target,'position') == 'absolute') { + parent = Position.offsetParent(target); + delta = Position.page(parent); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if(options.setWidth) target.style.width = source.offsetWidth + 'px'; + if(options.setHeight) target.style.height = source.offsetHeight + 'px'; + }, + + absolutize: function(element) { + element = $(element); + if (element.style.position == 'absolute') return; + Position.prepare(); + + var offsets = Position.positionedOffset(element); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + }, + + relativize: function(element) { + element = $(element); + if (element.style.position == 'relative') return; + Position.prepare(); + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + } +} + +// Safari returns margins on body which is incorrect if the child is absolutely +// positioned. For performance reasons, redefine Position.cumulativeOffset for +// KHTML/WebKit only. +if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { + Position.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return [valueL, valueT]; + } +} \ No newline at end of file diff --git a/js/cropper/scriptaculous.js b/js/cropper/scriptaculous.js new file mode 100644 index 000000000..f61fc57f7 --- /dev/null +++ b/js/cropper/scriptaculous.js @@ -0,0 +1,47 @@ +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE 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. + +var Scriptaculous = { + Version: '1.6.1', + require: function(libraryName) { + // inserting via DOM fails in Safari 2.0, so brute force approach + document.write(''); + }, + load: function() { + if((typeof Prototype=='undefined') || + (typeof Element == 'undefined') || + (typeof Element.Methods=='undefined') || + parseFloat(Prototype.Version.split(".")[0] + "." + + Prototype.Version.split(".")[1]) < 1.5) + throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0"); + + $A(document.getElementsByTagName("script")).findAll( function(s) { + return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) + }).each( function(s) { + var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); + var includes = s.src.match(/\?.*load=([a-z,]*)/); + (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each( + function(include) { Scriptaculous.require(path+include+'.js') }); + }); + } +} + +Scriptaculous.load(); \ No newline at end of file diff --git a/js/date.js b/js/date.js new file mode 100644 index 000000000..a9003f7be --- /dev/null +++ b/js/date.js @@ -0,0 +1,467 @@ +/* + * Date prototype extensions. Doesn't depend on any + * other code. Doens't overwrite existing methods. + * + * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear, + * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear, + * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods + * + * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * + * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString - + * I've added my name to these methods so you know who to blame if they are broken! + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * An Array of day names starting with Sunday. + * + * @example dayNames[0] + * @result 'Sunday' + * + * @name dayNames + * @type Array + * @cat Plugins/Methods/Date + */ +Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + +/** + * An Array of abbreviated day names starting with Sun. + * + * @example abbrDayNames[0] + * @result 'Sun' + * + * @name abbrDayNames + * @type Array + * @cat Plugins/Methods/Date + */ +Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; + +/** + * An Array of month names starting with Janurary. + * + * @example monthNames[0] + * @result 'January' + * + * @name monthNames + * @type Array + * @cat Plugins/Methods/Date + */ +Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; + +/** + * An Array of abbreviated month names starting with Jan. + * + * @example abbrMonthNames[0] + * @result 'Jan' + * + * @name monthNames + * @type Array + * @cat Plugins/Methods/Date + */ +Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +/** + * The first day of the week for this locale. + * + * @name firstDayOfWeek + * @type Number + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ +Date.firstDayOfWeek = 1; + +/** + * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc). + * + * @name format + * @type String + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ +//Date.format = 'dd/mm/yyyy'; +//Date.format = 'mm/dd/yyyy'; +Date.format = 'yyyy-mm-dd'; +//Date.format = 'dd mmm yy'; + +/** + * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear + * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes. + * + * @name format + * @type String + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ +Date.fullYearStart = '20'; + +(function() { + + /** + * Adds a given method under the given name + * to the Date prototype if it doesn't + * currently exist. + * + * @private + */ + function add(name, method) { + if( !Date.prototype[name] ) { + Date.prototype[name] = method; + } + }; + + /** + * Checks if the year is a leap year. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.isLeapYear(); + * @result true + * + * @name isLeapYear + * @type Boolean + * @cat Plugins/Methods/Date + */ + add("isLeapYear", function() { + var y = this.getFullYear(); + return (y%4==0 && y%100!=0) || y%400==0; + }); + + /** + * Checks if the day is a weekend day (Sat or Sun). + * + * @example var dtm = new Date("01/12/2008"); + * dtm.isWeekend(); + * @result false + * + * @name isWeekend + * @type Boolean + * @cat Plugins/Methods/Date + */ + add("isWeekend", function() { + return this.getDay()==0 || this.getDay()==6; + }); + + /** + * Check if the day is a day of the week (Mon-Fri) + * + * @example var dtm = new Date("01/12/2008"); + * dtm.isWeekDay(); + * @result false + * + * @name isWeekDay + * @type Boolean + * @cat Plugins/Methods/Date + */ + add("isWeekDay", function() { + return !this.isWeekend(); + }); + + /** + * Gets the number of days in the month. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getDaysInMonth(); + * @result 31 + * + * @name getDaysInMonth + * @type Number + * @cat Plugins/Methods/Date + */ + add("getDaysInMonth", function() { + return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]; + }); + + /** + * Gets the name of the day. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getDayName(); + * @result 'Saturday' + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getDayName(true); + * @result 'Sat' + * + * @param abbreviated Boolean When set to true the name will be abbreviated. + * @name getDayName + * @type String + * @cat Plugins/Methods/Date + */ + add("getDayName", function(abbreviated) { + return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()]; + }); + + /** + * Gets the name of the month. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getMonthName(); + * @result 'Janurary' + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getMonthName(true); + * @result 'Jan' + * + * @param abbreviated Boolean When set to true the name will be abbreviated. + * @name getDayName + * @type String + * @cat Plugins/Methods/Date + */ + add("getMonthName", function(abbreviated) { + return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()]; + }); + + /** + * Get the number of the day of the year. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getDayOfYear(); + * @result 11 + * + * @name getDayOfYear + * @type Number + * @cat Plugins/Methods/Date + */ + add("getDayOfYear", function() { + var tmpdtm = new Date("1/1/" + this.getFullYear()); + return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000); + }); + + /** + * Get the number of the week of the year. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.getWeekOfYear(); + * @result 2 + * + * @name getWeekOfYear + * @type Number + * @cat Plugins/Methods/Date + */ + add("getWeekOfYear", function() { + return Math.ceil(this.getDayOfYear() / 7); + }); + + /** + * Set the day of the year. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.setDayOfYear(1); + * dtm.toString(); + * @result 'Tue Jan 01 2008 00:00:00' + * + * @name setDayOfYear + * @type Date + * @cat Plugins/Methods/Date + */ + add("setDayOfYear", function(day) { + this.setMonth(0); + this.setDate(day); + return this; + }); + + /** + * Add a number of years to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addYears(1); + * dtm.toString(); + * @result 'Mon Jan 12 2009 00:00:00' + * + * @name addYears + * @type Date + * @cat Plugins/Methods/Date + */ + add("addYears", function(num) { + this.setFullYear(this.getFullYear() + num); + return this; + }); + + /** + * Add a number of months to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addMonths(1); + * dtm.toString(); + * @result 'Tue Feb 12 2008 00:00:00' + * + * @name addMonths + * @type Date + * @cat Plugins/Methods/Date + */ + add("addMonths", function(num) { + var tmpdtm = this.getDate(); + + this.setMonth(this.getMonth() + num); + + if (tmpdtm > this.getDate()) + this.addDays(-this.getDate()); + + return this; + }); + + /** + * Add a number of days to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addDays(1); + * dtm.toString(); + * @result 'Sun Jan 13 2008 00:00:00' + * + * @name addDays + * @type Date + * @cat Plugins/Methods/Date + */ + add("addDays", function(num) { + this.setDate(this.getDate() + num); + return this; + }); + + /** + * Add a number of hours to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addHours(24); + * dtm.toString(); + * @result 'Sun Jan 13 2008 00:00:00' + * + * @name addHours + * @type Date + * @cat Plugins/Methods/Date + */ + add("addHours", function(num) { + this.setHours(this.getHours() + num); + return this; + }); + + /** + * Add a number of minutes to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addMinutes(60); + * dtm.toString(); + * @result 'Sat Jan 12 2008 01:00:00' + * + * @name addMinutes + * @type Date + * @cat Plugins/Methods/Date + */ + add("addMinutes", function(num) { + this.setMinutes(this.getMinutes() + num); + return this; + }); + + /** + * Add a number of seconds to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addSeconds(60); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:01:00' + * + * @name addSeconds + * @type Date + * @cat Plugins/Methods/Date + */ + add("addSeconds", function(num) { + this.setSeconds(this.getSeconds() + num); + return this; + }); + + /** + * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant. + * + * @example var dtm = new Date(); + * dtm.zeroTime(); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:01:00' + * + * @name zeroTime + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + add("zeroTime", function() { + this.setMilliseconds(0); + this.setSeconds(0); + this.setMinutes(0); + this.setHours(0); + return this; + }); + + /** + * Returns a string representation of the date object according to Date.format. + * (Date.toString may be used in other places so I purposefully didn't overwrite it) + * + * @example var dtm = new Date("01/12/2008"); + * dtm.asString(); + * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy' + * + * @name asString + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + add("asString", function() { + var r = Date.format; + return r + .split('yyyy').join(this.getFullYear()) + .split('yy').join((this.getFullYear() + '').substring(2)) + .split('mmm').join(this.getMonthName(true)) + .split('mm').join(_zeroPad(this.getMonth()+1)) + .split('dd').join(_zeroPad(this.getDate())); + }); + + /** + * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object + * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere) + * + * @example var dtm = Date.fromString("12/01/2008"); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy' + * + * @name fromString + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + Date.fromString = function(s) + { + var f = Date.format; + var d = new Date('01/01/1977'); + var iY = f.indexOf('yyyy'); + if (iY > -1) { + d.setFullYear(Number(s.substr(iY, 4))); + } else { + // TODO - this doesn't work very well - are there any rules for what is meant by a two digit year? + d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2))); + } + var iM = f.indexOf('mmm'); + if (iM > -1) { + var mStr = s.substr(iM, 3); + for (var i=0; i'+gg_translate['tooltip_title']+''); + }); + $('.button-translate').mouseover(function() + { + gg_current_bt = $(this); + }) + .click(function(e) + { + var field = $(this).prev(); + if (current_translate != '') + { + if (field.is('input[type="text"]')) field.val(current_translate); + if (field.is('textarea')) field.html(current_translate); + } + }) + .cluetip({ + splitTitle: '|', // use the invoking element's title attribute to populate the clueTip... + // ...and split the contents into separate divs where there is a "|" + showTitle: true, // hide the clueTip's heading + dropShadow: false, + onShow : function(ct, c_inner) + { + current_translate = ''; + $('#cluetip-inner').html('loader'); + var button = gg_current_bt; + if (button.parent("td").prev().html()) + { + google.language.translate(button.parent("td").prev().html(), 'en', gg_translate['language_code'], function(result) + { + if (!result.error) + { + current_translate = result.translation.replace(''', '\''); + while (current_translate != (current_translate = current_translate.replace(''', '\''))); + $('#cluetip-inner').html(current_translate); + } + else if (display_once == 0) + { + display_once = 1; + $('#cluetip-inner').html(''+result.error.message+''); + current_translate = ''; + } + }); + } + } + }); + } +}); +function ggIsTranslatable(iso_lang) +{ + if(iso_lang.length == 2) + return google.language.isTranslatable(iso_lang); + else if (iso_lang.length > 2) + { + iso_lang = iso_lang.substring(0, 2); + gg_translate['language_code'] = iso_lang; + return ggIsTranslatable(iso_lang); + } +} +function setErrorMessage(string) +{ + $('#content .path_bar').after(output_error); + $('#content .gg-errors-output:eq(0)').html(string); +} \ No newline at end of file diff --git a/js/hookLiveEdit.js b/js/hookLiveEdit.js new file mode 100644 index 000000000..d7b69a48d --- /dev/null +++ b/js/hookLiveEdit.js @@ -0,0 +1,218 @@ +var modules_list = new Array(); +var hooks_list = new Array(); +var hookable_list = new Array(); +var timer; +$(document).ready(function() { + + $('body').css('margin-bottom', '45px'); + $('#fancy').fancybox({ + autoDimensions: true, + autoScale: true, + width: 300, + height: 300, + padding: 0, + hideOnOverlayClick: false, + hideOnContentClick: false, + showCloseButton: false + }); + $('#live_edit_feedback_str').html(''); + $('a').each(function() { + var href = $(this).attr('href'); + var search = $(this).attr('search'); + var hrefAdd = 'live_edit&liveToken=' + get('liveToken') + '&ad=' + get('ad'); + if (href != undefined && href != '#' && href.substr(0, baseDir.length) == baseDir) { + if (search.length == 0) { + $(this).attr('search', hrefAdd); + } + else { + $(this).attr('search', search + '&' + hrefAdd); + } + } + }); + getHookableList(); + $('.unregisterHook').unbind('click').click(function() { + id = $(this).attr('id'); + $(this).parent().parent().parent().fadeOut('slow', function() { + $(this).remove(); + }); + return false; + }); + + $('#cancelMove').unbind('click').click(function() { + $('#' + cancelMove + '').sortable('cancel'); + return false; + }); + + $('#saveLiveEdit').unbind('click').click(function() { + saveModulePosition(); + return false; + }); + + $('#closeLiveEdit').unbind('click').click(function() { + $("#live_edit_feedback_str").html('

    ' + confirmClose + '

    ' + confirm + '' + cancel + '

    '); + $("#fancy").attr('href', '#live_edit_feedback'); + $("#fancy").trigger("click"); + }); + + $('.add_module_live_edit').unbind('click').click(function() { + $("#live_edit_feedback_str").html('
    '); + $("#fancy").attr('href', '#live_edit_feedback'); + $("#fancy").trigger("click"); + var id = $(this).attr('id'); + getHookableModuleList(id.substr(4, id.length)); + return false; + }); + + $('.dndHook').each(function() { + var id_hook = $(this).attr('id'); + var new_target = ''; + var old_target = ''; + var cancel = false; + + $('#' + id_hook + '').sortable({ + opacity: 0.5, + cursor: 'move', + + connectWith: '.dndHook', + receive: function(event, ui) { + if (new_target == '') { + new_target = event.target.id; + } + }, + start: function(event, ui) { + new_target = ui.item[0].parentNode.id; + }, + stop: function(event, ui) { + + if (cancel) { + $(this).sortable('cancel'); + } + else { + old_target = event.target.id; + cancelMove = old_target; + if (new_target == '') new_target = old_target; + } + }, + change: function(event, ui) { + new_target = $(ui.placeholder).parent().attr('id'); + ids = ui.item[0].id.split('_'); + if ($.inArray(ids[5], hookable_list[new_target]) != -1) { + cancel = false; + ui.placeholder.css({ + visibility: 'visible', + border: '1px solid #72CB67', + background: '#DFFAD3' + }); + } + else { + ui.placeholder.css({ + visibility: 'visible', + border: '1px solid #EC9B9B', + background: '#FAE2E3' + }); + cancel = true; + } + } + }); + $('#' + id_hook + '').disableSelection(); + }); +}); + +function getHookableList() { + $.ajax({ + type: 'GET', + url: baseDir + ad + '/ajax.php', + async: true, + dataType: 'json', + data: 'ajax=true&getHookableList&hooks_list=' + hooks_list + '&modules_list=' + modules_list, + success: function(jsonData) { + hookable_list = jsonData; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + $('#live_edit_feedback_str').html('

    TECHNICAL ERROR:

    ' + loadFail + '

    ' + close + '
    '); + $("#fancy").attr('href', '#live_edit_feedback'); + $("#fancy").trigger("click"); + } + }); +} + +function getHookableModuleList(hook) { + + $.ajax({ + type: 'GET', + url: baseDir + ad + '/ajax.php', + async: true, + dataType: 'json', + data: 'ajax=true&getHookableModuleList&hook=' + hook, + success: function(jsonData) { + + var select = ''; + $("#live_edit_feedback_str").html('
    ' + select + '

    ' + add + '

    ' + cancel + ''); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + alert("TECHNICAL ERROR: unable to unregister hook \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); + } + }); +} + +function saveModulePosition() { + $("#live_edit_feedback_str").html('
    '); + $("#fancy").attr('href', '#live_edit_feedback'); + $("#fancy").trigger("click"); + var str = ''; + for (var i = 0; i < hooks_list.length; i++) { + str += '&' + hooks_list[i] + '='; + $('#' + hooks_list[i] + ' > .dndModule').each(function() { + ids = $(this).attr('id').split('_'); + str += ids[1] + '_' + ids[3] + ','; + }); + str = str.substr(0, str.length - 1); + } + $.ajax({ + type: 'GET', + url: baseDir + ad + '/ajax.php', + async: true, + dataType: 'json', + data: 'ajax=true&saveHook&hooks_list=' + hooks_list + str, + success: function(jsonData) { + $('#live_edit_feedback_str').html('

    ' + saveOK + '

    ' + close + '
    '); + timer = setTimeout("hideFeedback()", 3000); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + $('#live_edit_feedback_str').html('

    TECHNICAL ERROR:

    ' + unableToSaveModulePosition + '

    ' + close + '
    '); + } + }); +} + +function closeFancybox() { + clearTimeout(timer); + $.fancybox.close(); + $('#live_edit_feedback_str').html(''); +} + +function closeLiveEdit(){ + window.location.href = window.location.protocol+'//'+window.location.host+window.location.pathname; +} + +function hideFeedback() { + $('#live_edit_feed_back').fadeOut('slow', function() { + $.fancybox.close(); + $('#live_edit_feedback_str').html(''); + }); +}; + +function get(name) { + var regexS = "[\\?&]" + name + "=([^&#]*)"; + var regex = new RegExp(regexS); + var results = regex.exec(window.location.href); + if (results == null) { + return ""; + } + else { + return results[1]; + } +} diff --git a/js/index.php b/js/index.php new file mode 100644 index 000000000..189b03953 --- /dev/null +++ b/js/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/js/jquery/accordion/accordion.css b/js/jquery/accordion/accordion.css new file mode 100644 index 000000000..376f29059 --- /dev/null +++ b/js/jquery/accordion/accordion.css @@ -0,0 +1,695 @@ + * jQuery UI Accordion @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } + +.ui-widget { +font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; +font-size:1.1em; +} +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { +font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; +font-size:1em; +} +.ui-widget-header { +border:1px solid #E78F08; +color:#FFFFFF; +font-weight:bold; +} +.ui-widget-header a { +color:#FFFFFF; +} +.ui-widget-content { +border:1px solid #DDDDDD; +color:#333333; +display:none; +} +.ui-widget-content a { +color:#333333; +} +.ui-state-default, .ui-widget-content .ui-state-default { +border:1px solid #CCCCCC; +color:#1C94C4; +font-weight:bold; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-default a { +color:#1C94C4; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { +background:#FDF5CE url(fdf5ce.png) repeat-x scroll 50% 50%; +border:1px solid #FBCB09; +color:#C77405; +font-weight:bold; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-hover a { +color:#C77405; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-active, .ui-widget-content .ui-state-active { +border:1px solid #FBD850; +color:#EB8F00; +font-weight:bold; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-active a { +color:#EB8F00; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-highlight, .ui-widget-content .ui-state-highlight { +border:1px solid #FED22F; +color:#363636; +} +.ui-state-error, .ui-widget-content .ui-state-error { +border:1px solid #CD0A0A; +color:#FFFFFF; +} +.ui-state-error-text, .ui-widget-content .ui-state-error-text { +color:#FFFFFF; +} +.ui-state-disabled, .ui-widget-content .ui-state-disabled { +background-image:none; +opacity:0.35; +} +.ui-priority-primary, .ui-widget-content .ui-priority-primary { +font-weight:bold; +} +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { +font-weight:normal; +opacity:0.7; +} +.ui-icon { +background-image:url(222222.png); +height:16px; +width:16px; +} +.ui-widget-content .ui-icon { +background-image:url(icons222222.png); +} +.ui-widget-header .ui-icon { +background-image:url(iconsffffff.png); +} +.ui-state-default .ui-icon { +background-image:url(iconsef8c08.png); +} +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { +background-image:url(iconsef8c08.png); +} +.ui-state-active .ui-icon { +background-image:url(iconsef8c08.png); +} +.ui-state-highlight .ui-icon { +background-image:url(icons228ef1.png); +} +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { +background-image:url(iconsffd27a.png); +} +.ui-icon-carat-1-n { +background-position:0 0; +} +.ui-icon-carat-1-ne { +background-position:-16px 0; +} +.ui-icon-carat-1-e { +background-position:-32px 0; +} +.ui-icon-carat-1-se { +background-position:-48px 0; +} +.ui-icon-carat-1-s { +background-position:-64px 0; +} +.ui-icon-carat-1-sw { +background-position:-80px 0; +} +.ui-icon-carat-1-w { +background-position:-96px 0; +} +.ui-icon-carat-1-nw { +background-position:-112px 0; +} +.ui-icon-carat-2-n-s { +background-position:-128px 0; +} +.ui-icon-carat-2-e-w { +background-position:-144px 0; +} +.ui-icon-triangle-1-n { +background-position:0 -16px; +} +.ui-icon-triangle-1-ne { +background-position:-16px -16px; +} +.ui-icon-triangle-1-e { +background-position:-32px -16px; +} +.ui-icon-triangle-1-se { +background-position:-48px -16px; +} +.ui-icon-triangle-1-s { +background-position:-64px -16px; +} +.ui-icon-triangle-1-sw { +background-position:-80px -16px; +} +.ui-icon-triangle-1-w { +background-position:-96px -16px; +} +.ui-icon-triangle-1-nw { +background-position:-112px -16px; +} +.ui-icon-triangle-2-n-s { +background-position:-128px -16px; +} +.ui-icon-triangle-2-e-w { +background-position:-144px -16px; +} +.ui-icon-arrow-1-n { +background-position:0 -32px; +} +.ui-icon-arrow-1-ne { +background-position:-16px -32px; +} +.ui-icon-arrow-1-e { +background-position:-32px -32px; +} +.ui-icon-arrow-1-se { +background-position:-48px -32px; +} +.ui-icon-arrow-1-s { +background-position:-64px -32px; +} +.ui-icon-arrow-1-sw { +background-position:-80px -32px; +} +.ui-icon-arrow-1-w { +background-position:-96px -32px; +} +.ui-icon-arrow-1-nw { +background-position:-112px -32px; +} +.ui-icon-arrow-2-n-s { +background-position:-128px -32px; +} +.ui-icon-arrow-2-ne-sw { +background-position:-144px -32px; +} +.ui-icon-arrow-2-e-w { +background-position:-160px -32px; +} +.ui-icon-arrow-2-se-nw { +background-position:-176px -32px; +} +.ui-icon-arrowstop-1-n { +background-position:-192px -32px; +} +.ui-icon-arrowstop-1-e { +background-position:-208px -32px; +} +.ui-icon-arrowstop-1-s { +background-position:-224px -32px; +} +.ui-icon-arrowstop-1-w { +background-position:-240px -32px; +} +.ui-icon-arrowthick-1-n { +background-position:0 -48px; +} +.ui-icon-arrowthick-1-ne { +background-position:-16px -48px; +} +.ui-icon-arrowthick-1-e { +background-position:-32px -48px; +} +.ui-icon-arrowthick-1-se { +background-position:-48px -48px; +} +.ui-icon-arrowthick-1-s { +background-position:-64px -48px; +} +.ui-icon-arrowthick-1-sw { +background-position:-80px -48px; +} +.ui-icon-arrowthick-1-w { +background-position:-96px -48px; +} +.ui-icon-arrowthick-1-nw { +background-position:-112px -48px; +} +.ui-icon-arrowthick-2-n-s { +background-position:-128px -48px; +} +.ui-icon-arrowthick-2-ne-sw { +background-position:-144px -48px; +} +.ui-icon-arrowthick-2-e-w { +background-position:-160px -48px; +} +.ui-icon-arrowthick-2-se-nw { +background-position:-176px -48px; +} +.ui-icon-arrowthickstop-1-n { +background-position:-192px -48px; +} +.ui-icon-arrowthickstop-1-e { +background-position:-208px -48px; +} +.ui-icon-arrowthickstop-1-s { +background-position:-224px -48px; +} +.ui-icon-arrowthickstop-1-w { +background-position:-240px -48px; +} +.ui-icon-arrowreturnthick-1-w { +background-position:0 -64px; +} +.ui-icon-arrowreturnthick-1-n { +background-position:-16px -64px; +} +.ui-icon-arrowreturnthick-1-e { +background-position:-32px -64px; +} +.ui-icon-arrowreturnthick-1-s { +background-position:-48px -64px; +} +.ui-icon-arrowreturn-1-w { +background-position:-64px -64px; +} +.ui-icon-arrowreturn-1-n { +background-position:-80px -64px; +} +.ui-icon-arrowreturn-1-e { +background-position:-96px -64px; +} +.ui-icon-arrowreturn-1-s { +background-position:-112px -64px; +} +.ui-icon-arrowrefresh-1-w { +background-position:-128px -64px; +} +.ui-icon-arrowrefresh-1-n { +background-position:-144px -64px; +} +.ui-icon-arrowrefresh-1-e { +background-position:-160px -64px; +} +.ui-icon-arrowrefresh-1-s { +background-position:-176px -64px; +} +.ui-icon-arrow-4 { +background-position:0 -80px; +} +.ui-icon-arrow-4-diag { +background-position:-16px -80px; +} +.ui-icon-extlink { +background-position:-32px -80px; +} +.ui-icon-newwin { +background-position:-48px -80px; +} +.ui-icon-refresh { +background-position:-64px -80px; +} +.ui-icon-shuffle { +background-position:-80px -80px; +} +.ui-icon-transfer-e-w { +background-position:-96px -80px; +} +.ui-icon-transferthick-e-w { +background-position:-112px -80px; +} +.ui-icon-folder-collapsed { +background-position:0 -96px; +} +.ui-icon-folder-open { +background-position:-16px -96px; +} +.ui-icon-document { +background-position:-32px -96px; +} +.ui-icon-document-b { +background-position:-48px -96px; +} +.ui-icon-note { +background-position:-64px -96px; +} +.ui-icon-mail-closed { +background-position:-80px -96px; +} +.ui-icon-mail-open { +background-position:-96px -96px; +} +.ui-icon-suitcase { +background-position:-112px -96px; +} +.ui-icon-comment { +background-position:-128px -96px; +} +.ui-icon-person { +background-position:-144px -96px; +} +.ui-icon-print { +background-position:-160px -96px; +} +.ui-icon-trash { +background-position:-176px -96px; +} +.ui-icon-locked { +background-position:-192px -96px; +} +.ui-icon-unlocked { +background-position:-208px -96px; +} +.ui-icon-bookmark { +background-position:-224px -96px; +} +.ui-icon-tag { +background-position:-240px -96px; +} +.ui-icon-home { +background-position:0 -112px; +} +.ui-icon-flag { +background-position:-16px -112px; +} +.ui-icon-calendar { +background-position:-32px -112px; +} +.ui-icon-cart { +background-position:-48px -112px; +} +.ui-icon-pencil { +background-position:-64px -112px; +} +.ui-icon-clock { +background-position:-80px -112px; +} +.ui-icon-disk { +background-position:-96px -112px; +} +.ui-icon-calculator { +background-position:-112px -112px; +} +.ui-icon-zoomin { +background-position:-128px -112px; +} +.ui-icon-zoomout { +background-position:-144px -112px; +} +.ui-icon-search { +background-position:-160px -112px; +} +.ui-icon-wrench { +background-position:-176px -112px; +} +.ui-icon-gear { +background-position:-192px -112px; +} +.ui-icon-heart { +background-position:-208px -112px; +} +.ui-icon-star { +background-position:-224px -112px; +} +.ui-icon-link { +background-position:-240px -112px; +} +.ui-icon-cancel { +background-position:0 -128px; +} +.ui-icon-plus { +background-position:-16px -128px; +} +.ui-icon-plusthick { +background-position:-32px -128px; +} +.ui-icon-minus { +background-position:-48px -128px; +} +.ui-icon-minusthick { +background-position:-64px -128px; +} +.ui-icon-close { +background-position:-80px -128px; +} +.ui-icon-closethick { +background-position:-96px -128px; +} +.ui-icon-key { +background-position:-112px -128px; +} +.ui-icon-lightbulb { +background-position:-128px -128px; +} +.ui-icon-scissors { +background-position:-144px -128px; +} +.ui-icon-clipboard { +background-position:-160px -128px; +} +.ui-icon-copy { +background-position:-176px -128px; +} +.ui-icon-contact { +background-position:-192px -128px; +} +.ui-icon-image { +background-position:-208px -128px; +} +.ui-icon-video { +background-position:-224px -128px; +} +.ui-icon-alert { +background-position:0 -144px; +} +.ui-icon-info { +background-position:-16px -144px; +} +.ui-icon-notice { +background-position:-32px -144px; +} +.ui-icon-help { +background-position:-48px -144px; +} +.ui-icon-check { +background-position:-64px -144px; +} +.ui-icon-bullet { +background-position:-80px -144px; +} +.ui-icon-radio-off { +background-position:-96px -144px; +} +.ui-icon-radio-on { +background-position:-112px -144px; +} +.ui-icon-play { +background-position:0 -160px; +} +.ui-icon-pause { +background-position:-16px -160px; +} +.ui-icon-seek-next { +background-position:-32px -160px; +} +.ui-icon-seek-prev { +background-position:-48px -160px; +} +.ui-icon-seek-end { +background-position:-64px -160px; +} +.ui-icon-seek-first { +background-position:-80px -160px; +} +.ui-icon-stop { +background-position:-96px -160px; +} +.ui-icon-eject { +background-position:-112px -160px; +} +.ui-icon-volume-off { +background-position:-128px -160px; +} +.ui-icon-volume-on { +background-position:-144px -160px; +} +.ui-icon-power { +background-position:0 -176px; +} +.ui-icon-signal-diag { +background-position:-16px -176px; +} +.ui-icon-signal { +background-position:-32px -176px; +} +.ui-icon-battery-0 { +background-position:-48px -176px; +} +.ui-icon-battery-1 { +background-position:-64px -176px; +} +.ui-icon-battery-2 { +background-position:-80px -176px; +} +.ui-icon-battery-3 { +background-position:-96px -176px; +} +.ui-icon-circle-plus { +background-position:0 -192px; +} +.ui-icon-circle-minus { +background-position:-16px -192px; +} +.ui-icon-circle-close { +background-position:-32px -192px; +} +.ui-icon-circle-triangle-e { +background-position:-48px -192px; +} +.ui-icon-circle-triangle-s { +background-position:-64px -192px; +} +.ui-icon-circle-triangle-w { +background-position:-80px -192px; +} +.ui-icon-circle-triangle-n { +background-position:-96px -192px; +} +.ui-icon-circle-arrow-e { +background-position:-112px -192px; +} +.ui-icon-circle-arrow-s { +background-position:-128px -192px; +} +.ui-icon-circle-arrow-w { +background-position:-144px -192px; +} +.ui-icon-circle-arrow-n { +background-position:-160px -192px; +} +.ui-icon-circle-zoomin { +background-position:-176px -192px; +} +.ui-icon-circle-zoomout { +background-position:-192px -192px; +} +.ui-icon-circle-check { +background-position:-208px -192px; +} +.ui-icon-circlesmall-plus { +background-position:0 -208px; +} +.ui-icon-circlesmall-minus { +background-position:-16px -208px; +} +.ui-icon-circlesmall-close { +background-position:-32px -208px; +} +.ui-icon-squaresmall-plus { +background-position:-48px -208px; +} +.ui-icon-squaresmall-minus { +background-position:-64px -208px; +} +.ui-icon-squaresmall-close { +background-position:-80px -208px; +} +.ui-icon-grip-dotted-vertical { +background-position:0 -224px; +} +.ui-icon-grip-dotted-horizontal { +background-position:-16px -224px; +} +.ui-icon-grip-solid-vertical { +background-position:-32px -224px; +} +.ui-icon-grip-solid-horizontal { +background-position:-48px -224px; +} +.ui-icon-gripsmall-diagonal-se { +background-position:-64px -224px; +} +.ui-icon-grip-diagonal-se { +background-position:-80px -224px; +} +.ui-corner-tl { +-moz-border-radius-topleft:4px; +} +.ui-corner-tr { +-moz-border-radius-topright:4px; +} +.ui-corner-bl { +-moz-border-radius-bottomleft:4px; +} +.ui-corner-br { +-moz-border-radius-bottomright:4px; +} +.ui-corner-top { +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +} +.ui-corner-bottom { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-bottomright:4px; +} +.ui-corner-right { +-moz-border-radius-bottomright:4px; +-moz-border-radius-topright:4px; +} +.ui-corner-left { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-topleft:4px; +} +.ui-corner-all { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-bottomright:4px; +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +} +.ui-widget-overlay { +background:#666666 url(666666.png) repeat scroll 50% 50%; +opacity:0.5; +} +.ui-widget-shadow { +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +background:#000000 url(000000.png) repeat-x scroll 50% 50%; +margin:-5px 0 0 -5px; +opacity:0.2; +padding:5px; +} diff --git a/js/jquery/accordion/accordion.ui.js b/js/jquery/accordion/accordion.ui.js new file mode 100644 index 000000000..cf34b8363 --- /dev/null +++ b/js/jquery/accordion/accordion.ui.js @@ -0,0 +1,402 @@ +/*! + * jQuery UI 1.8.5 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, +NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, +"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); +if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, +"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this, +h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); +c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); +d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, +b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| +0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== +"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& +a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), +10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): +f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; +if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= +"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, +{version:"1.8.5"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, +function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= +(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= +false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- +a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", +b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", +"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, +f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= +a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ +a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& +e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", +height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= +d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, +arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= +c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, +{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); +if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", +a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); +if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, +c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== +document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", +null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): +d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute|| +"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")}, +_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!= +this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a= +this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable"); +if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h= +0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width= +this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f}, +update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b= +null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this)); +this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])? +g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive", +g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over= +0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); +c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| +typeof c=="number"||f.fx.speeds[c]||!f.effects[c])return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[c])return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[c]||typeof c== +"boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c, +a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/= +e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+ +b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/ +2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* +f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",function(g){return a._keydown(g)}).next().attr("role", +"tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers); +this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); +a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j, +down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})}); +f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.5",animations:{slide:function(a, +b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1], +unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", +paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +(function(e){e.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!a.options.disabled){var d=e.ui.keyCode;switch(c.keyCode){case d.PAGE_UP:a._move("previousPage", +c);break;case d.PAGE_DOWN:a._move("nextPage",c);break;case d.UP:a._move("previous",c);c.preventDefault();break;case d.DOWN:a._move("next",c);c.preventDefault();break;case d.ENTER:case d.NUMPAD_ENTER:a.menu.element.is(":visible")&&c.preventDefault();case d.TAB:if(!a.menu.active)return;a.menu.select(c);break;case d.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay); +break}}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=e("
      ").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",b)[0]).mousedown(function(c){var d=a.menu.element[0]; +c.target===d&&setTimeout(function(){e(document).one("mousedown",function(f){f.target!==a.element[0]&&f.target!==d&&!e.ui.contains(d,f.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",null,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete");var f=a.previous;if(a.element[0]!==b.activeElement){a.element.focus(); +a.previous=f}if(false!==a._trigger("select",c,{item:d})){a.term=d.value;a.element.val(d.value)}a.close(c);a.selectedItem=d},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); +this.menu.element.remove();e.Widget.prototype.destroy.call(this)},_setOption:function(a,b){e.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(e(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a=this,b,c;if(e.isArray(this.options.source)){b=this.options.source;this.source=function(d,f){f(e.ui.autocomplete.filter(b,d.term))}}else if(typeof this.options.source==="string"){c=this.options.source;this.source= +function(d,f){a.xhr&&a.xhr.abort();a.xhr=e.getJSON(c,d,function(g,i,h){h===a.xhr&&f(g);a.xhr=null})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(e("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});e.extend(e.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}, +filter:function(a,b){var c=new RegExp(e.ui.autocomplete.escapeRegex(b),"i");return e.grep(a,function(d){return c.test(d.label||d.value||d)})}})})(jQuery); +(function(e){e.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(e(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(b){a.activate(b,e(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.attr("scrollTop"),f=this.element.height();if(c<0)this.element.attr("scrollTop",d+c);else c>=f&&this.element.attr("scrollTop",d+c-f+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})}, +deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0); +a.length?this.activate(c,a):this.activate(c,this.element.children(b))}else this.activate(c,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(":first"));else{var b=this.active.offset().top,c=this.element.height(),d=this.element.children("li").filter(function(){var f=e(this).offset().top-b-c+e(this).height();return f<10&&f>-10});d.length||(d=this.element.children(":last"));this.activate(a,d)}else this.activate(a,this.element.children(!this.active|| +this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(":last"));else{var b=this.active.offset().top,c=this.element.height();result=this.element.children("li").filter(function(){var d=e(this).offset().top-b+c-e(this).height();return d<10&&d>-10});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))}, +hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary"); +this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init()},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":visible").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); +(function(d,G){function L(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= +"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", +"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", +minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('
      ')}function E(a,b){d.extend(a, +b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.5"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]= +f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
      ')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor== +Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]); +d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}}, +_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b= +d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; +for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target|| +a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a); +d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&& +d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f, +h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover"); +this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover"); +this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); +a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(), +k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"]; +a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val(): +"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&& +!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth; +b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b= +this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a= +d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a, +"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b== +"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1 +-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24* +60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e? +"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k= +this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a, +"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+ +n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
      '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
      ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
      '+(/all|left/.test(t)&&C==0?c? +f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'
      ';var A=k?'":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!k?"":'";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+""}g++;if(g>11){g=0;m++}x+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(q)+""+(B&&!w?" ":K?''+q.getDate()+ +"":''+q.getDate()+"")+"
      "+(l?""+(i[0]>0&&D==i[1]-1?'
      ':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='
      ',o="";if(h||!k)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(j+=o+(h||!(k&&l)?" ":""));if(h||!l)j+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b, +i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?" ":"")+o;j+="
      ";return j},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); +return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.5";window["DP_jQuery_"+y]=d})(jQuery); +(function(c,j){c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title"); +if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",f=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog", +"aria-labelledby":f}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var e=(a.uiDialogTitlebar=c("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i); +return false}).appendTo(e);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",f).html(d).prependTo(e);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;e.find("*").add(e).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&& +g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog"); +b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0])d=Math.max(d,c(this).css("z-index"))});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,f=d.options;if(f.modal&&!a||!f.stack&&!f.modal)return d._trigger("focus",b);if(f.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ= +f.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;d.next().length&&d.appendTo("body");a._size();a._position(b.position);d.show(b.show); +a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(f){if(f.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),e=g.filter(":first");g=g.filter(":last");if(f.target===g[0]&&!f.shiftKey){e.focus(1);return false}else if(f.target===e[0]&&f.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false, +f=c("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
      ").addClass("ui-dialog-buttonset").appendTo(f);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(e,h){h=c.isFunction(h)?{click:h,text:e}:h;e=c("",h).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&e.button()});f.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(e){return{position:e.position, +offset:e.offset}}var b=this,d=b.options,f=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",e,a(h))},drag:function(e,h){b._trigger("drag",e,a(h))},stop:function(e,h){d.position=[h.position.left-f.scrollLeft(),h.position.top-f.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g); +b._trigger("dragStop",e,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}a=a===j?this.options.resizable:a;var d=this,f=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:d._minHeight(), +handles:a,start:function(e,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",e,b(h))},resize:function(e,h){d._trigger("resize",e,b(h))},stop:function(e,h){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();d._trigger("resizeStop",e,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight, +a.height)},_position:function(a){var b=[],d=[0,0],f;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,e){if(+b[g]===b[g]){d[g]=b[g];b[g]=e}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a); +f||this.uiDialog.hide()},_setOption:function(a,b){var d=this,f=d.uiDialog,g=f.is(":data(resizable)"),e=false;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);e=true;break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":f.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case "draggable":b? +d._makeDraggable():f.draggable("destroy");break;case "height":e=true;break;case "maxHeight":g&&f.resizable("option","maxHeight",b);e=true;break;case "maxWidth":g&&f.resizable("option","maxWidth",b);e=true;break;case "minHeight":g&&f.resizable("option","minHeight",b);e=true;break;case "minWidth":g&&f.resizable("option","minWidth",b);e=true;break;case "position":d._position(b);break;case "resizable":g&&!b&&f.resizable("destroy");g&&typeof b==="string"&&f.resizable("option","handles",b);!g&&b!==false&& +d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break;case "width":e=true;break}c.Widget.prototype._setOption.apply(d,arguments);e&&d._size()},_size:function(){var a=this.options,b;this.element.css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();this.element.css(a.height==="auto"?{minHeight:Math.max(a.minHeight-b,0),height:c.support.minHeight?"auto":Math.max(a.minHeight- +b,0)}:{minHeight:0,height:Math.max(a.height-b,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.5",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), +function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){this.oldInstances.push(this.instances.splice(c.inArray(a,this.instances),1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var b=0;c.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var a, +b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0]; +b.left+=a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d= +c(b),g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +(function(b,c){b.widget("ui.progressbar",{options:{value:0},min:0,max:100,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this._value()});this.valueDiv=b("
      ").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===c)return this._value();this._setOption("value",a);return this},_setOption:function(a,d){if(a==="value"){this.options.value=d;this._refreshValue();this._trigger("change")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.max,Math.max(this.min,a))},_refreshValue:function(){var a=this.value();this.valueDiv.toggleClass("ui-corner-right", +a===this.max).width(a+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.5"})})(jQuery); +(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");b.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"); +this.range=d([]);if(b.range){if(b.range===true){this.range=d("
      ");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("
      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); +if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur(); +else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= +false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");h=a._start(c,f);if(h===false)return}break}i=a.options.step;h=a.options.values&&a.options.values.length?(g=a.values(f)):(g=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=a._valueMin();break;case d.ui.keyCode.END:g=a._valueMax();break;case d.ui.keyCode.PAGE_UP:g=a._trimAlignValue(h+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=a._trimAlignValue(h-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== +a._valueMax())return;g=a._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-i);break}a._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,h,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(b.range===true&&this.values(1)===b.min){g+=1;f=d(this.handles[g])}if(this._start(a, +g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();b=f.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-f.width()/2,top:a.pageY-b.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= +this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= +this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); +c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;fthis._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= +this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({width:f- +g+"%"},{queue:false,duration:b.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:b.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"}, +b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.5"})})(jQuery); +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(true)},_setOption:function(a,e){if(a=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[a]=e;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_ui:function(a,e){return{tab:a,panel:e,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var a= +d(this);a.html(a.data("label.tabs")).removeData("label.tabs")})},_tabify:function(a){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var b=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))b.panels=b.panels.add(b._sanitizeSelector(i));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=b._tabId(f);f.href="#"+i;f=d("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(b.panels[g-1]||b.list);f.data("destroy.tabs",true)}b.panels=b.panels.add(f)}else c.disabled.push(g)});if(a){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(b._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return b.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){this.panels.eq(c.selected).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");b.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[c.selected],b.panels[c.selected]))});this.load(c.selected)}d(window).bind("unload",function(){b.lis.add(b.anchors).unbind(".tabs");b.lis=b.anchors=b.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[c.collapsible?"addClass": +"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);a=0;for(var j;j=this.lis[a];a++)d(j)[d.inArray(a,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+g)};this.lis.bind("mouseover.tabs", +function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",function(){e(f,o);b._trigger("show", +null,b._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");b._trigger("show",null,b._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);b.element.dequeue("tabs")})}:function(g,f){b.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");b.element.dequeue("tabs")};this.anchors.bind(c.event+".tabs", +function(){var g=this,f=d(g).closest("li"),i=b.panels.filter(":not(.ui-tabs-hide)"),l=d(b._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||b.panels.filter(":animated").length||b._trigger("select",null,b._ui(this,l[0]))===false){this.blur();return false}c.selected=b.anchors.index(this);b.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=-1;c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs", +function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this));this.blur();return false}c.cookie&&b._cookie(c.selected,c.cookie);if(l.length){i.length&&b.element.queue("tabs",function(){s(g,i)});b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs", +function(){return false})},_getIndex:function(a){if(typeof a=="string")a=this.anchors.index(this.anchors.filter("[href$="+a+"]"));return a},destroy:function(){var a=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href= +e;var b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){b.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});a.cookie&&this._cookie(null,a.cookie);return this},add:function(a,e,b){if(b===p)b=this.anchors.length; +var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e));a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=d("#"+a);j.length||(j=d(h.panelTemplate).attr("id",a).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(b>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[b]); +j.insertBefore(this.panels[b])}h.disabled=d.map(h.disabled,function(k){return k>=b?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[b],this.panels[b]));return this},remove:function(a){a=this._getIndex(a);var e=this.options,b=this.lis.eq(a).remove(),c=this.panels.eq(a).remove(); +if(b.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(a+(a+1=a?--h:h});this._tabify();this._trigger("remove",null,this._ui(b.find("a")[0],c[0]));return this},enable:function(a){a=this._getIndex(a);var e=this.options;if(d.inArray(a,e.disabled)!=-1){this.lis.eq(a).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(b){return b!=a});this._trigger("enable",null, +this._ui(this.anchors[a],this.panels[a]));return this}},disable:function(a){a=this._getIndex(a);var e=this.options;if(a!=e.selected){this.lis.eq(a).addClass("ui-state-disabled");e.disabled.push(a);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this}, +load:function(a){a=this._getIndex(a);var e=this,b=this.options,c=this.anchors.eq(a)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(a).addClass("ui-state-processing");if(b.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(b.spinner)}this.xhr=d.ajax(d.extend({},b.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(c.hash)).html(k);e._cleanup();b.cache&&d.data(c,"cache.tabs", +true);e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.error(k,n,a,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(a, +e){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.5"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(a,e){var b=this,c=this.options,h=b._rotate||(b._rotate=function(j){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var k=c.selected;b.select(++k');if(typeof uri=='boolean'){io.src='javascript:false';} +else if(typeof uri=='string'){io.src=uri;}} +else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;} +io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);return io},createUploadForm:function(id,fileElementId) +{var formId='jUploadForm'+id;var fileId='jUploadFile'+id;var form=$('
      ');var oldElement=$('#'+fileElementId);var newElement=$(oldElement).clone();$(oldElement).attr('id',fileId);$(oldElement).before(newElement);$(oldElement).appendTo(form);$(form).css('position','absolute');$(form).css('top','-1200px');$(form).css('left','-1200px');$(form).appendTo('body');return form;},ajaxFileUpload:function(s){s=jQuery.extend({},jQuery.ajaxSettings,s);var id=new Date().getTime() +var form=jQuery.createUploadForm(id,s.fileElementId);var io=jQuery.createUploadIframe(id,s.secureuri);var frameId='jUploadFrame'+id;var formId='jUploadForm'+id;if(s.global&&!jQuery.active++) +{jQuery.event.trigger("ajaxStart");} +var requestDone=false;var xml={} +if(s.global) +jQuery.event.trigger("ajaxSend",[xml,s]);var uploadCallback=function(isTimeout) +{var io=document.getElementById(frameId);try +{if(io.contentWindow) +{xml.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;xml.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}else if(io.contentDocument) +{xml.responseText=io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;xml.responseXML=io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;}}catch(e) +{jQuery.handleError(s,xml,null,e);} +if(xml||isTimeout=="timeout") +{requestDone=true;var status;try{status=isTimeout!="timeout"?"success":"error";if(status!="error") +{var data=jQuery.uploadHttpData(xml,s.dataType);if(s.success) +s.success(data,status);if(s.global) +jQuery.event.trigger("ajaxSuccess",[xml,s]);}else +jQuery.handleError(s,xml,status);}catch(e) +{status="error";jQuery.handleError(s,xml,status,e);} +if(s.global) +jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active) +jQuery.event.trigger("ajaxStop");if(s.complete) +s.complete(xml,status);jQuery(io).unbind() +setTimeout(function() +{try +{$(io).remove();$(form).remove();}catch(e) +{jQuery.handleError(s,xml,null,e);}},100) +xml=null}} +if(s.timeout>0) +{setTimeout(function(){if(!requestDone)uploadCallback("timeout");},s.timeout);} +try +{var form=$('#'+formId);$(form).attr('action',s.url);$(form).attr('method','POST');$(form).attr('target',frameId);if(form.encoding) +{form.encoding='multipart/form-data';} +else +{form.enctype='multipart/form-data';} +$(form).submit();}catch(e) +{jQuery.handleError(s,xml,null,e);} +if(window.attachEvent){document.getElementById(frameId).attachEvent('onload',uploadCallback);} +else{document.getElementById(frameId).addEventListener('load',uploadCallback,false);} +return{abort:function(){}};},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script") +jQuery.globalEval(data);if(type=="json") +eval("data = "+data);if(type=="html") +jQuery("
      ").html(data).evalScripts();return data;}}) diff --git a/js/jquery/datepicker/000000.png b/js/jquery/datepicker/000000.png new file mode 100644 index 000000000..abdc01082 Binary files /dev/null and b/js/jquery/datepicker/000000.png differ diff --git a/js/jquery/datepicker/666666.png b/js/jquery/datepicker/666666.png new file mode 100644 index 000000000..889ebac73 Binary files /dev/null and b/js/jquery/datepicker/666666.png differ diff --git a/js/jquery/datepicker/b81900.png b/js/jquery/datepicker/b81900.png new file mode 100644 index 000000000..0599bdd9c Binary files /dev/null and b/js/jquery/datepicker/b81900.png differ diff --git a/js/jquery/datepicker/datepicker.css b/js/jquery/datepicker/datepicker.css new file mode 100644 index 000000000..98652379f --- /dev/null +++ b/js/jquery/datepicker/datepicker.css @@ -0,0 +1,875 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://themeroller.com/?ctl=themeroller&tr=&ffDefault=Trebuchet+MS,+Tahoma,+Verdana,+Arial,+sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +*/ + +.ui-widget { +font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; +font-size:1.1em; +} +.ui-widget-header { +background:#F6A828 url(f6a828.png) repeat-x scroll 50% 50%; +border:1px solid #E78F08; +color:#FFFFFF; +font-weight:bold; +} +.ui-widget-header a { +color:#FFFFFF; +} +.ui-widget-content { +background:#EEEEEE url(eeeeee.png) repeat-x scroll 50% 0; +border:1px solid #DDDDDD; +color:#333333; +display:none; +} +.ui-widget-content a { +color:#488c40; +text-decoration: underline; +} +.ui-state-default, .ui-widget-content .ui-state-default { +background:#F6F6F6 url(f6f6f6.png) repeat-x scroll 50% 50%; +border:1px solid #CCCCCC; +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-default a { +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { +background:#F6F6F6 url(f6f6f6.png) repeat-x scroll 50% 50%; +border:1px solid #CCCCCC; +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-hover a { +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-active, .ui-widget-content .ui-state-active { +background:#F6F6F6 url(f6f6f6.png) repeat-x scroll 50% 50%; +border:1px solid #CCCCCC; +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +} +.ui-state-active a { +color:#812143; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:medium; +text-decoration:none; +} +.ui-state-highlight, .ui-widget-content .ui-state-highlight { +background:#FFE45C url(ffe45c.png) repeat-x scroll 50% 0; +border:1px solid #FED22F; +color:#363636; +} +.ui-state-error, .ui-widget-content .ui-state-error { +background:#B81900 url(b81900.png) repeat scroll 50% 50%; +border:1px solid #CD0A0A; +color:#FFFFFF; +} +.ui-state-error-text, .ui-widget-content .ui-state-error-text { +color:#FFFFFF; +} +.ui-state-disabled, .ui-widget-content .ui-state-disabled { +background-image:none; +opacity:0.35; +} +.ui-priority-primary, .ui-widget-content .ui-priority-primary { +font-weight:bold; +} +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { +font-weight:normal; +opacity:0.7; +} +.ui-icon { +background-image:url(222222.png); +height:16px; +width:16px; +} +.ui-widget-content .ui-icon { +background-image:url(icons222222.png); +} +.ui-widget-header .ui-icon { +background-image:url(iconsffffff.png); +} +.ui-state-default .ui-icon { +background-image:url(iconsef8c08.png); +} +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { +background-image:url(iconsef8c08.png); +} +.ui-state-active .ui-icon { +background-image: url("../../../img/admin/less.png"); +background-repeat: no-repeat; +} +.ui-state-highlight .ui-icon { +background-image:url(icons228ef1.png); +} +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { +background-image:url(iconsffd27a.png); +} +.ui-icon-carat-1-n { +background-position:0 0; +} +.ui-icon-carat-1-ne { +background-position:-16px 0; +} +.ui-icon-carat-1-e { +background-position:-32px 0; +} +.ui-icon-carat-1-se { +background-position:-48px 0; +} +.ui-icon-carat-1-s { +background-position:-64px 0; +} +.ui-icon-carat-1-sw { +background-position:-80px 0; +} +.ui-icon-carat-1-w { +background-position:-96px 0; +} +.ui-icon-carat-1-nw { +background-position:-112px 0; +} +.ui-icon-carat-2-n-s { +background-position:-128px 0; +} +.ui-icon-carat-2-e-w { +background-position:-144px 0; +} +.ui-icon-triangle-1-n { +background-position:0 -16px; +} +.ui-icon-triangle-1-ne { +background-position:-16px -16px; +} +.ui-icon-triangle-1-e { +background-position:-32px -16px; +} +.ui-icon-triangle-1-se { +background-position:-48px -16px; +} +.ui-icon-triangle-1-s { +background-image: url('../../../img/admin/more.png'); +} +.ui-state-default .ui-icon-triangle-1-e +{ +background-image: url('../../../img/admin/more.png'); +background-position: 3px 4px; +background-repeat: no-repeat; +} +.ui-state-default .ui-icon-triangle-1-s +{ +background-image: url('../../../img/admin/less.png'); +background-position: 0px 4px; +background-repeat: no-repeat; +} +.ui-icon-triangle-1-sw { +background-position:-80px -16px; +} +.ui-icon-triangle-1-w { +background-position:-96px -16px; +} +.ui-icon-triangle-1-nw { +background-position:-112px -16px; +} +.ui-icon-triangle-2-n-s { +background-position:-128px -16px; +} +.ui-icon-triangle-2-e-w { +background-position:-144px -16px; +} +.ui-icon-arrow-1-n { +background-position:0 -32px; +} +.ui-icon-arrow-1-ne { +background-position:-16px -32px; +} +.ui-icon-arrow-1-e { +background-position:-32px -32px; +} +.ui-icon-arrow-1-se { +background-position:-48px -32px; +} +.ui-icon-arrow-1-s { +background-position:-64px -32px; +} +.ui-icon-arrow-1-sw { +background-position:-80px -32px; +} +.ui-icon-arrow-1-w { +background-position:-96px -32px; +} +.ui-icon-arrow-1-nw { +background-position:-112px -32px; +} +.ui-icon-arrow-2-n-s { +background-position:-128px -32px; +} +.ui-icon-arrow-2-ne-sw { +background-position:-144px -32px; +} +.ui-icon-arrow-2-e-w { +background-position:-160px -32px; +} +.ui-icon-arrow-2-se-nw { +background-position:-176px -32px; +} +.ui-icon-arrowstop-1-n { +background-position:-192px -32px; +} +.ui-icon-arrowstop-1-e { +background-position:-208px -32px; +} +.ui-icon-arrowstop-1-s { +background-position:-224px -32px; +} +.ui-icon-arrowstop-1-w { +background-position:-240px -32px; +} +.ui-icon-arrowthick-1-n { +background-position:0 -48px; +} +.ui-icon-arrowthick-1-ne { +background-position:-16px -48px; +} +.ui-icon-arrowthick-1-e { +background-position:-32px -48px; +} +.ui-icon-arrowthick-1-se { +background-position:-48px -48px; +} +.ui-icon-arrowthick-1-s { +background-position:-64px -48px; +} +.ui-icon-arrowthick-1-sw { +background-position:-80px -48px; +} +.ui-icon-arrowthick-1-w { +background-position:-96px -48px; +} +.ui-icon-arrowthick-1-nw { +background-position:-112px -48px; +} +.ui-icon-arrowthick-2-n-s { +background-position:-128px -48px; +} +.ui-icon-arrowthick-2-ne-sw { +background-position:-144px -48px; +} +.ui-icon-arrowthick-2-e-w { +background-position:-160px -48px; +} +.ui-icon-arrowthick-2-se-nw { +background-position:-176px -48px; +} +.ui-icon-arrowthickstop-1-n { +background-position:-192px -48px; +} +.ui-icon-arrowthickstop-1-e { +background-position:-208px -48px; +} +.ui-icon-arrowthickstop-1-s { +background-position:-224px -48px; +} +.ui-icon-arrowthickstop-1-w { +background-position:-240px -48px; +} +.ui-icon-arrowreturnthick-1-w { +background-position:0 -64px; +} +.ui-icon-arrowreturnthick-1-n { +background-position:-16px -64px; +} +.ui-icon-arrowreturnthick-1-e { +background-position:-32px -64px; +} +.ui-icon-arrowreturnthick-1-s { +background-position:-48px -64px; +} +.ui-icon-arrowreturn-1-w { +background-position:-64px -64px; +} +.ui-icon-arrowreturn-1-n { +background-position:-80px -64px; +} +.ui-icon-arrowreturn-1-e { +background-position:-96px -64px; +} +.ui-icon-arrowreturn-1-s { +background-position:-112px -64px; +} +.ui-icon-arrowrefresh-1-w { +background-position:-128px -64px; +} +.ui-icon-arrowrefresh-1-n { +background-position:-144px -64px; +} +.ui-icon-arrowrefresh-1-e { +background-position:-160px -64px; +} +.ui-icon-arrowrefresh-1-s { +background-position:-176px -64px; +} +.ui-icon-arrow-4 { +background-position:0 -80px; +} +.ui-icon-arrow-4-diag { +background-position:-16px -80px; +} +.ui-icon-extlink { +background-position:-32px -80px; +} +.ui-icon-newwin { +background-position:-48px -80px; +} +.ui-icon-refresh { +background-position:-64px -80px; +} +.ui-icon-shuffle { +background-position:-80px -80px; +} +.ui-icon-transfer-e-w { +background-position:-96px -80px; +} +.ui-icon-transferthick-e-w { +background-position:-112px -80px; +} +.ui-icon-folder-collapsed { +background-position:0 -96px; +} +.ui-icon-folder-open { +background-position:-16px -96px; +} +.ui-icon-document { +background-position:-32px -96px; +} +.ui-icon-document-b { +background-position:-48px -96px; +} +.ui-icon-note { +background-position:-64px -96px; +} +.ui-icon-mail-closed { +background-position:-80px -96px; +} +.ui-icon-mail-open { +background-position:-96px -96px; +} +.ui-icon-suitcase { +background-position:-112px -96px; +} +.ui-icon-comment { +background-position:-128px -96px; +} +.ui-icon-person { +background-position:-144px -96px; +} +.ui-icon-print { +background-position:-160px -96px; +} +.ui-icon-trash { +background-position:-176px -96px; +} +.ui-icon-locked { +background-position:-192px -96px; +} +.ui-icon-unlocked { +background-position:-208px -96px; +} +.ui-icon-bookmark { +background-position:-224px -96px; +} +.ui-icon-tag { +background-position:-240px -96px; +} +.ui-icon-home { +background-position:0 -112px; +} +.ui-icon-flag { +background-position:-16px -112px; +} +.ui-icon-calendar { +background-position:-32px -112px; +} +.ui-icon-cart { +background-position:-48px -112px; +} +.ui-icon-pencil { +background-position:-64px -112px; +} +.ui-icon-clock { +background-position:-80px -112px; +} +.ui-icon-disk { +background-position:-96px -112px; +} +.ui-icon-calculator { +background-position:-112px -112px; +} +.ui-icon-zoomin { +background-position:-128px -112px; +} +.ui-icon-zoomout { +background-position:-144px -112px; +} +.ui-icon-search { +background-position:-160px -112px; +} +.ui-icon-wrench { +background-position:-176px -112px; +} +.ui-icon-gear { +background-position:-192px -112px; +} +.ui-icon-heart { +background-position:-208px -112px; +} +.ui-icon-star { +background-position:-224px -112px; +} +.ui-icon-link { +background-position:-240px -112px; +} +.ui-icon-cancel { +background-position:0 -128px; +} +.ui-icon-plus { +background-position:-16px -128px; +} +.ui-icon-plusthick { +background-position:-32px -128px; +} +.ui-icon-minus { +background-position:-48px -128px; +} +.ui-icon-minusthick { +background-position:-64px -128px; +} +.ui-icon-close { +background-position:-80px -128px; +} +.ui-icon-closethick { +background-position:-96px -128px; +} +.ui-icon-key { +background-position:-112px -128px; +} +.ui-icon-lightbulb { +background-position:-128px -128px; +} +.ui-icon-scissors { +background-position:-144px -128px; +} +.ui-icon-clipboard { +background-position:-160px -128px; +} +.ui-icon-copy { +background-position:-176px -128px; +} +.ui-icon-contact { +background-position:-192px -128px; +} +.ui-icon-image { +background-position:-208px -128px; +} +.ui-icon-video { +background-position:-224px -128px; +} +.ui-icon-alert { +background-position:0 -144px; +} +.ui-icon-info { +background-position:-16px -144px; +} +.ui-icon-notice { +background-position:-32px -144px; +} +.ui-icon-help { +background-position:-48px -144px; +} +.ui-icon-check { +background-position:-64px -144px; +} +.ui-icon-bullet { +background-position:-80px -144px; +} +.ui-icon-radio-off { +background-position:-96px -144px; +} +.ui-icon-radio-on { +background-position:-112px -144px; +} +.ui-icon-play { +background-position:0 -160px; +} +.ui-icon-pause { +background-position:-16px -160px; +} +.ui-icon-seek-next { +background-position:-32px -160px; +} +.ui-icon-seek-prev { +background-position:-48px -160px; +} +.ui-icon-seek-end { +background-position:-64px -160px; +} +.ui-icon-seek-first { +background-position:-80px -160px; +} +.ui-icon-stop { +background-position:-96px -160px; +} +.ui-icon-eject { +background-position:-112px -160px; +} +.ui-icon-volume-off { +background-position:-128px -160px; +} +.ui-icon-volume-on { +background-position:-144px -160px; +} +.ui-icon-power { +background-position:0 -176px; +} +.ui-icon-signal-diag { +background-position:-16px -176px; +} +.ui-icon-signal { +background-position:-32px -176px; +} +.ui-icon-battery-0 { +background-position:-48px -176px; +} +.ui-icon-battery-1 { +background-position:-64px -176px; +} +.ui-icon-battery-2 { +background-position:-80px -176px; +} +.ui-icon-battery-3 { +background-position:-96px -176px; +} +.ui-icon-circle-plus { +background-position:0 -192px; +} +.ui-icon-circle-minus { +background-position:-16px -192px; +} +.ui-icon-circle-close { +background-position:-32px -192px; +} +.ui-icon-circle-triangle-e { +background-position:-48px -192px; +} +.ui-icon-circle-triangle-s { +background-position:-64px -192px; +} +.ui-icon-circle-triangle-w { +background-position:-80px -192px; +} +.ui-icon-circle-triangle-n { +background-position:-96px -192px; +} +.ui-icon-circle-arrow-e { +background-position:-112px -192px; +} +.ui-icon-circle-arrow-s { +background-position:-128px -192px; +} +.ui-icon-circle-arrow-w { +background-position:-144px -192px; +} +.ui-icon-circle-arrow-n { +background-position:-160px -192px; +} +.ui-icon-circle-zoomin { +background-position:-176px -192px; +} +.ui-icon-circle-zoomout { +background-position:-192px -192px; +} +.ui-icon-circle-check { +background-position:-208px -192px; +} +.ui-icon-circlesmall-plus { +background-position:0 -208px; +} +.ui-icon-circlesmall-minus { +background-position:-16px -208px; +} +.ui-icon-circlesmall-close { +background-position:-32px -208px; +} +.ui-icon-squaresmall-plus { +background-position:-48px -208px; +} +.ui-icon-squaresmall-minus { +background-position:-64px -208px; +} +.ui-icon-squaresmall-close { +background-position:-80px -208px; +} +.ui-icon-grip-dotted-vertical { +background-position:0 -224px; +} +.ui-icon-grip-dotted-horizontal { +background-position:-16px -224px; +} +.ui-icon-grip-solid-vertical { +background-position:-32px -224px; +} +.ui-icon-grip-solid-horizontal { +background-position:-48px -224px; +} +.ui-icon-gripsmall-diagonal-se { +background-position:-64px -224px; +} +.ui-icon-grip-diagonal-se { +background-position:-80px -224px; +} +.ui-corner-tl { +-moz-border-radius-topleft:4px; +} +.ui-corner-tr { +-moz-border-radius-topright:4px; +} +.ui-corner-bl { +-moz-border-radius-bottomleft:4px; +} +.ui-corner-br { +-moz-border-radius-bottomright:4px; +} +.ui-corner-top { +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +} +.ui-corner-bottom { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-bottomright:4px; +} +.ui-corner-right { +-moz-border-radius-bottomright:4px; +-moz-border-radius-topright:4px; +} +.ui-corner-left { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-topleft:4px; +} +.ui-corner-all { +-moz-border-radius-bottomleft:4px; +-moz-border-radius-bottomright:4px; +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +} +.ui-widget-overlay { +background:#666666 url(666666.png) repeat scroll 50% 50%; +opacity:0.5; +} +.ui-widget-shadow { +-moz-border-radius-bottomleft:5px; +-moz-border-radius-bottomright:5px; +-moz-border-radius-topleft:5px; +-moz-border-radius-topright:5px; +background:#000000 url(000000.png) repeat-x scroll 50% 50%; +margin:-5px 0 0 -5px; +opacity:0.2; +padding:5px; +} + +.ui-datepicker { +padding:0.2em 0.2em 0; +width:17em; +z-index:99; +} +.ui-datepicker-header { +padding:0.2em 0; +position:relative; +} +.ui-datepicker-prev, .ui-datepicker-next { +height:1.8em; +position:absolute; +top:2px; +width:1.8em; +} +.ui-datepicker-prev:hover, .ui-datepicker-next:hover { +top:1px; +} +.ui-datepicker-prev { +left:2px; +} +.ui-datepicker-next { +right:2px; +} +.ui-datepicker-prev:hover { +left:1px; +} +.ui-datepicker-next:hover { +right:1px; +} +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { +display:block; +left:50%; +margin-left:-8px; +margin-top:-8px; +position:absolute; +top:50%; +} +.ui-datepicker-title { +line-height:1.8em; +margin:0 2.3em; +text-align:center; +} +.ui-datepicker-title select { +float:left; +font-size:1em; +margin:1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { +width:100%; +} +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { +width:49%; +} +.ui-datepicker-title select.ui-datepicker-year { +float:right; +} +.ui-datepicker table { +border-collapse:collapse; +font-size:0.9em; +margin:0 0 0.4em; +width:100%; +} +.ui-datepicker th { +font-weight:bold; +padding:0.7em 0.3em; +text-align:center; +} +.ui-datepicker td span, .ui-datepicker td a { +display:block; +padding:0.2em; +text-align:right; +text-decoration:none; +} +.ui-datepicker-buttonpane { +background-image:none; +border-bottom:0 none; +border-left:0 none; +border-right:0 none; +margin:0.7em 0 0; +padding:0 0.2em; +} +.ui-datepicker-buttonpane button { +cursor:pointer; +float:right; +margin:0.5em 0.2em 0.4em; +overflow:visible; +padding:0.2em 0.6em 0.3em; +width:auto; +} +.ui-datepicker-buttonpane button.ui-datepicker-current { +float:left; +} +.ui-datepicker.ui-datepicker-multi { +width:auto; +} +.ui-datepicker-multi .ui-datepicker-group { +float:left; +} +.ui-datepicker-multi .ui-datepicker-group table { +margin:0 auto 0.4em; +width:95%; +} +.ui-datepicker-multi-2 .ui-datepicker-group { +width:50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { +width:33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { +width:25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { +border-left-width:0; +} +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { +border-left-width:0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { +clear:left; +} +.ui-datepicker-rtl { +direction:rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { +left:auto; +right:2px; +} +.ui-datepicker-rtl .ui-datepicker-next { +left:2px; +right:auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { +left:auto; +right:1px; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { +left:1px; +right:auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { +clear:right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { +float:left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { +float:right; +} +.ui-datepicker-rtl .ui-datepicker-group { +float:right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { +border-left-width:1px; +border-right-width:0; +} +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { +border-left-width:1px; +border-right-width:0; +} +.ui-datepicker-cover { +display:block; +height:200px; +left:-4px; +position:absolute; +top:-4px; +width:200px; +z-index:-1; +} +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative;zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .2em ; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: 5px; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { border-top: 0; margin-top: -2px; position: relative;overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; } diff --git a/js/jquery/datepicker/eeeeee.png b/js/jquery/datepicker/eeeeee.png new file mode 100644 index 000000000..98f298b90 Binary files /dev/null and b/js/jquery/datepicker/eeeeee.png differ diff --git a/js/jquery/datepicker/f6a828.png b/js/jquery/datepicker/f6a828.png new file mode 100644 index 000000000..39d5824d6 Binary files /dev/null and b/js/jquery/datepicker/f6a828.png differ diff --git a/js/jquery/datepicker/f6f6f6.png b/js/jquery/datepicker/f6f6f6.png new file mode 100644 index 000000000..98a824487 Binary files /dev/null and b/js/jquery/datepicker/f6f6f6.png differ diff --git a/js/jquery/datepicker/fdf5ce.png b/js/jquery/datepicker/fdf5ce.png new file mode 100644 index 000000000..744f92551 Binary files /dev/null and b/js/jquery/datepicker/fdf5ce.png differ diff --git a/js/jquery/datepicker/ffe45c.png b/js/jquery/datepicker/ffe45c.png new file mode 100644 index 000000000..55840b351 Binary files /dev/null and b/js/jquery/datepicker/ffe45c.png differ diff --git a/js/jquery/datepicker/ffffff.png b/js/jquery/datepicker/ffffff.png new file mode 100644 index 000000000..2c16183ff Binary files /dev/null and b/js/jquery/datepicker/ffffff.png differ diff --git a/js/jquery/datepicker/icons222222.png b/js/jquery/datepicker/icons222222.png new file mode 100644 index 000000000..71580d129 Binary files /dev/null and b/js/jquery/datepicker/icons222222.png differ diff --git a/js/jquery/datepicker/icons228ef1.png b/js/jquery/datepicker/icons228ef1.png new file mode 100644 index 000000000..2f8f19b0b Binary files /dev/null and b/js/jquery/datepicker/icons228ef1.png differ diff --git a/js/jquery/datepicker/iconsef8c08.png b/js/jquery/datepicker/iconsef8c08.png new file mode 100644 index 000000000..0fbde0604 Binary files /dev/null and b/js/jquery/datepicker/iconsef8c08.png differ diff --git a/js/jquery/datepicker/iconsffd27a.png b/js/jquery/datepicker/iconsffd27a.png new file mode 100644 index 000000000..d630afa4d Binary files /dev/null and b/js/jquery/datepicker/iconsffd27a.png differ diff --git a/js/jquery/datepicker/iconsffffff.png b/js/jquery/datepicker/iconsffffff.png new file mode 100644 index 000000000..49a1ef08d Binary files /dev/null and b/js/jquery/datepicker/iconsffffff.png differ diff --git a/js/jquery/datepicker/index.php b/js/jquery/datepicker/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/jquery/datepicker/index.php @@ -0,0 +1,11 @@ +35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(l(B){f H=B.4f.3q,D=B.1G.9t&&(9a(B.1G.3I)<1.9);B.r={3I:"1.6f",9E:{4H:l(K,J,N){f M=B.r[K].3R;1E(f L 7l N){M.59[L]=M.59[L]||[];M.59[L].9B([J,N[L]])}},4s:l(J,L,K){f N=J.59[L];h(!N){p}1E(f M=0;M\').2N(J).1o({1K:"3H",2p:"-8I",1Z:"-8I",6t:"97"}).9w("2g");B.r.54[J]=!!((!(/6h|2G/).1P(K.1o("6M"))||(/^[1-9]/).1P(K.1o("31"))||(/^[1-9]/).1P(K.1o("25"))||!(/6Q/).1P(K.1o("9x"))||!(/9P|9M\\(0, 0, 0, 0\\)/).1P(K.1o("9f"))));5c{B("2g").6l(0).9g(K.6l(0))}5g(L){}p B.r.54[J]},9h:l(L,J){h(B(L).1o("3W")=="3v"){p S}f M=(J&&J=="1Z")?"3U":"3T",K=S;h(L[M]>0){p 1m}L[M]=1;K=(L[M]>0);L[M]=0;p K},6j:l(J,L,K){p(J>L)&&(J<(L+K))},9c:l(O,J,N,M,L,K){p B.r.6j(O,N,L)&&B.r.6j(J,M,K)},5J:{9o:8,9p:20,9j:9d,9y:17,au:46,as:40,av:35,aw:13,ax:27,ar:36,aq:45,am:37,al:9S,ao:ap,ay:aH,aI:aJ,aK:aG,aB:aA,aC:34,aD:33,aj:a2,9Y:39,9U:16,9W:32,9X:9,a5:38}};h(D){f E=B.2M,C=B.4f.6m,I="af://ac.a7.ab/an/aa/6i",F=/^6n-/,G=/^7F:/;B.2M=l(K,J,L){f M=L!==4d;p(J=="a9"?(M?E.4s(b,K,J,"7F:"+L):(E.21(b,3K)||"").4X(G,"")):(F.1P(J)?(M?K.a8(I,J.4X(F,"6i:"),L):E.4s(b,K,J.4X(F,"6i:"))):E.21(b,3K)))};B.4f.6m=l(J){p(F.1P(J)?b.3e(l(){b.ad(I,J.4X(F,""))}):C.4s(b,J))}}B.4f.3h({3q:l(){B("*",b).4H(b).3e(l(){B(b).80("3q")});p H.21(b,3K)},ai:l(){p b.2M("2I","ah").1o("7A","").3l("7G.r")},ae:l(){p b.2M("2I","81").1o("7A","6Q").23("7G.r",l(){p S})},a6:l(){f J;h((B.1G.44&&(/(93|7P)/).1P(b.1o("1K")))||(/3H/).1P(b.1o("1K"))){J=b.3z().68(l(){p(/(7P|3H|5M)/).1P(B.42(b,"1K",1))&&(/(6h|7N)/).1P(B.42(b,"3W",1)+B.42(b,"3W-y",1)+B.42(b,"3W-x",1))}).7w(0)}1d{J=b.3z().68(l(){p(/(6h|7N)/).1P(B.42(b,"3W",1)+B.42(b,"3W-y",1)+B.42(b,"3W-x",1))}).7w(0)}p(/5M/).1P(b.1o("1K"))||!J.1r?B(1l):J}});B.3h(B.9V[":"],{2t:l(K,L,J){p!!B.2t(K,J[3])},9T:l(K,L,J){f N=K.1q.4g();l M(O){p!(B(O).7J(":3v")||B(O).3z(":3v").1r)}p(K.9Z>=0&&(("a"==N&&K.7Y)||(/u|3u|a4|1X/.1P(N)&&"3v"!=K.2W&&!K.1u))&&M(K))}});l A(N,J,O,M){l L(Q){f P=B[N][J][Q]||[];p(1L P=="2O"?P.5j(/,?\\s+/):P)}f K=L("a3");h(M.1r==1&&1L M[0]=="2O"){K=K.6v(L("7I"))}p(B.a0(O,K)!=-1)}B.2C=l(J,K){f L=J.5j(".")[0];J=J.5j(".")[1];B.4f[J]=l(P){f N=(1L P=="2O"),O=6P.3R.8U.4s(3K,1);h(N&&P.a1(0,1)=="6u"){p b}h(N&&A(L,J,P,O)){f M=B.2t(b[0],J);p(M?M[P].21(M,O):4d)}p b.3e(l(){f Q=B.2t(b,J);(!Q&&!N&&B.2t(b,J,Z B[L][J](b,P)));(Q&&N&&B.ak(Q[P])&&Q[P].21(Q,O))})};B[L]=B[L]||{};B[L][J]=l(N,O){f M=b;b.6o=L;b.2R=J;b.6g=B[L][J].aE||J;b.6p=L+"-"+J;b.1D=B.3h({},B.2C.5z,B[L][J].5z,B.7v&&B.7v.6l(N)[J],O);b.2A=B(N).23("6H."+J,l(Q,P,R){h(Q.q==N){p M.4S(P,R)}}).23("6G."+J,l(Q,P){h(Q.q==N){p M.6q(P)}}).23("3q",l(){p M.8l()});b.8w()};B[L][J].3R=B.3h({},B.2C.3R,K);B[L][J].7I="4x"};B.2C.3R={8w:l(){},8l:l(){b.2A.7p(b.2R).2Y(b.6p+"-1u "+b.6o+"-1U-1u").6m("6n-1u")},4x:l(L,M){f K=L,J=b;h(1L L=="2O"){h(M===4d){p b.6q(L)}K={};K[L]=M}B.3e(K,l(N,O){J.4S(N,O)})},6q:l(J){p b.1D[J]},4S:l(J,K){b.1D[J]=K;h(J=="1u"){b.2A[K?"2N":"2Y"](b.6p+"-1u "+b.6o+"-1U-1u").2M("6n-1u",K)}},aL:l(){b.4S("1u",S)},9s:l(){b.4S("1u",1m)},9n:l(K,L,M){f J=(K==b.6g?K:b.6g+K);L=L||B.v.9l({2W:J,q:b.2A[0]});p b.2A.80(J,[L,M],b.1D[K])}};B.2C.5z={1u:S};B.r.8b={9q:l(){f J=b;b.2A.23("8P."+b.2R,l(K){p J.7T(K)}).23("8m."+b.2R,l(K){h(J.65){J.65=S;p S}});h(B.1G.44){b.7X=b.2A.2M("2I");b.2A.2M("2I","81")}b.9e=S},9i:l(){b.2A.3l("."+b.2R);(B.1G.44&&b.2A.2M("2I",b.7X))},7T:l(L){(b.2Q&&b.56(L));b.5w=L;f J=b,M=(L.9R==1),K=(1L b.1D.6c=="2O"?B(L.q).3z().4H(L.q).68(b.1D.6c).1r:S);h(!M||K||!b.8a(L)){p 1m}b.5W=!b.1D.6b;h(!b.5W){b.9I=9u(l(){J.5W=1m},b.1D.6b)}h(b.69(L)&&b.6a(L)){b.2Q=(b.6e(L)!==S);h(!b.2Q){L.5p();p 1m}}b.67=l(N){p J.7U(N)};b.66=l(N){p J.56(N)};B(1l).23("7V."+b.2R,b.67).23("7W."+b.2R,b.66);h(!B.1G.5Z){L.5p()}p 1m},7U:l(J){h(B.1G.44&&!J.1X){p b.56(J)}h(b.2Q){b.6d(J);p J.5p()}h(b.69(J)&&b.6a(J)){b.2Q=(b.6e(b.5w,J)!==S);(b.2Q?b.6d(J):b.56(J))}p!b.2Q},56:l(J){B(1l).3l("7V."+b.2R,b.67).3l("7W."+b.2R,b.66);h(b.2Q){b.2Q=S;b.65=1m;b.89(J)}p S},69:l(J){p(26.3g(26.82(b.5w.6J-J.6J),26.82(b.5w.6K-J.6K))>=b.1D.87)},6a:l(J){p b.5W},6e:l(J){},6d:l(J){},89:l(J){},8a:l(J){p 1m}};B.r.8b.5z={6c:z,87:1,6b:0}})(2w);(l($){$.3h($.r,{k:{3I:"1.6f"}});f 3x="k";l 4F(){b.7Z=S;b.3V=z;b.5i=S;b.2S=[];b.3A=S;b.3n=S;b.63="r-k-1J";b.5S="r-k-1I";b.6O="r-k-4p";b.3c="r-k-4c";b.5Y="r-k-9H";b.9C="r-k-1u";b.7o="r-k-2I";b.7m="r-k-7R-1e";b.5q="r-k-9z-9F-9G";b.6r=[];b.6r[""]={9N:"9O",8x:"9L",2H:"9J",9b:"UU",2K:"9k",9m:"VV",3F:"9r",1N:["ag","aY","co","cx","84","ct","cn","cb","bR","bL","bX","c6"],1Q:["c7","ca","c2","c1","84","c0","bY","bZ","c3","c4","c8","bO"],2a:["bN","bM","bK","bQ","bV","bT","bS"],2l:["cs","cr","cp","cq","cu","aM","cw"],5D:["cg","cf","ce","cc","cd","ch","ci"],3E:"5I/4h/3P",1O:0,1t:S};b.24={3G:"3t",2s:"6y",5X:{},2o:z,4Y:"",3s:"...",4e:"",8s:S,4J:S,4m:S,7f:S,3Y:S,41:S,4Z:S,8M:"-10:+10",4q:S,7e:b.5G,2k:"+10",1g:z,1n:z,1C:"cm",4V:z,4O:z,3o:z,88:z,4L:z,8o:1,5N:0,2B:1,3O:12,55:"",58:"",7x:1m,5P:S};$.3h(b.24,b.6r[""]);b.1f=$(\'<1J 1b="\'+b.63+\'" 1j="r-k r-2C r-2C-76 r-5r-6Z r-2E-2v r-5r-3v-cl">\')}$.3h(4F.3R,{2x:"ck",7a:l(){h(b.7Z){cj.7a.21("",3K)}},bI:l(V){4k(b.24,V||{});p b},7z:l(q,V){f 4C=z;1E(f 5C 7l b.24){f 5E=q.b6("n:"+5C);h(5E){4C=4C||{};5c{4C[5C]=b7(5E)}5g(7L){4C[5C]=5E}}}f 1q=q.1q.4g();f 1I=(1q=="1J"||1q=="1x");h(!q.1b){q.1b="8h"+(++b.6s)}f c=b.6F($(q),1I);c.V=$.3h({},V||{},4C||{});h(1q=="u"){b.8q(q,c)}1d{h(1I){b.8g(q,c)}}},6F:l(q,1I){f 1b=q[0].1b.4X(/([:\\[\\]\\.])/g,"\\\\\\\\$1");p{1b:1b,u:q,2d:0,1M:0,1T:0,1a:0,1c:0,1I:1I,1f:(!1I?b.1f:$(\'<1J 1j="\'+b.5S+\' r-k r-2C r-2C-76 r-5r-6Z r-2E-2v">\'))}},8q:l(q,c){f u=$(q);h(u.3j(b.2x)){p}f 4Y=b.t(c,"4Y");f 1t=b.t(c,"1t");h(4Y){u[1t?"8t":"8n"](\'<1x 1j="\'+b.6O+\'">\'+4Y+"")}f 3G=b.t(c,"3G");h(3G=="3t"||3G=="8r"){u.3t(b.4l)}h(3G=="1X"||3G=="8r"){f 3s=b.t(c,"3s");f 4e=b.t(c,"4e");f 4c=$(b.t(c,"8s")?$("<5Q/>").2N(b.3c).2M({79:4e,8v:3s,2T:3s}):$(\'<1X 2W="1X">\').2N(b.3c).1Y(4e==""?3s:$("<5Q/>").2M({79:4e,8v:3s,2T:3s})));u[1t?"8t":"8n"](4c);4c.8m(l(){h($.k.3A&&$.k.4i==q){$.k.2P()}1d{$.k.4l(q)}p S})}u.2N(b.2x).6N(b.5U).7t(b.64).23("6H.k",l(v,3r,18){c.V[3r]=18}).23("6G.k",l(v,3r){p b.t(c,3r)});$.2t(q,3x,c)},8g:l(q,c){f 6I=$(q);h(6I.3j(b.2x)){p}6I.2N(b.2x).4p(c.1f).23("6H.k",l(v,3r,18){c.V[3r]=18}).23("6G.k",l(v,3r){p b.t(c,3r)});$.2t(q,3x,c);b.6R(c,b.5F(c));b.2V(c);b.5o(c)},b2:l(u,8k,3o,V,30){f c=b.8i;h(!c){f 1b="8h"+(++b.6s);b.2J=$(\'\');b.2J.6N(b.5U);$("2g").4p(b.2J);c=b.8i=b.6F(b.2J,S);c.V={};$.2t(b.2J[0],3x,c)}4k(c.V,V||{});b.2J.3N(8k);b.2j=(30?(30.1r?30:[30.6J,30.6K]):z);h(!b.2j){f 5l=5f.8z||1l.2c.5d||1l.2g.5d;f 5m=5f.8A||1l.2c.5h||1l.2g.5h;f 3M=1l.2c.3U||1l.2g.3U;f 3Q=1l.2c.3T||1l.2g.3T;b.2j=[(5l/2)-3y+3M,(5m/2)-bc+3Q]}b.2J.1o("1Z",b.2j[0]+"57").1o("2p",b.2j[1]+"57");c.V.3o=3o;b.3n=1m;b.1f.2N(b.5Y);b.4l(b.2J[0]);h($.51){$.51(b.1f)}$.2t(b.2J[0],3x,c);p b},bb:l(q){f $q=$(q);h(!$q.3j(b.2x)){p}f 1q=q.1q.4g();$.7p(q,3x);h(1q=="u"){$q.4n("."+b.6O).3q().3a().4n("."+b.3c).3q().3a().2Y(b.2x).3l("3t",b.4l).3l("6N",b.5U).3l("7t",b.64)}1d{h(1q=="1J"||1q=="1x"){$q.2Y(b.2x).92()}}},b0:l(q){f $q=$(q);h(!$q.3j(b.2x)){p}f 1q=q.1q.4g();h(1q=="u"){q.1u=S;$q.4n("1X."+b.3c).3e(l(){b.1u=S}).3a().4n("5Q."+b.3c).1o({7u:"1.0",6M:""})}1d{h(1q=="1J"||1q=="1x"){f 1I=$q.5T("."+b.5S);1I.5T().2Y("r-1U-1u")}}b.2S=$.7q(b.2S,l(18){p(18==q?z:18)})},aR:l(q){f $q=$(q);h(!$q.3j(b.2x)){p}f 1q=q.1q.4g();h(1q=="u"){q.1u=1m;$q.4n("1X."+b.3c).3e(l(){b.1u=1m}).3a().4n("5Q."+b.3c).1o({7u:"0.5",6M:"2G"})}1d{h(1q=="1J"||1q=="1x"){f 1I=$q.5T("."+b.5S);1I.5T().2N("r-1U-1u")}}b.2S=$.7q(b.2S,l(18){p(18==q?z:18)});b.2S[b.2S.1r]=q},4Q:l(q){h(!q){p S}1E(f i=0;i-1)}},4l:l(u){u=u.q||u;h(u.1q.4g()!="u"){u=$("u",u.7D)[0]}h($.k.4Q(u)||$.k.4i==u){p}f c=$.k.1S(u);f 4O=$.k.t(c,"4O");4k(c.V,(4O?4O.21(u,[u,c]):{}));$.k.2P(z,"");$.k.4i=u;$.k.7c(c);h($.k.3n){u.18=""}h(!$.k.2j){$.k.2j=$.k.6z(u);$.k.2j[1]+=u.bu}f 1V=S;$(u).3z().3e(l(){1V|=$(b).1o("1K")=="5M";p!1V});h(1V&&$.1G.6A){$.k.2j[0]-=1l.2c.3U;$.k.2j[1]-=1l.2c.3T}f 1h={1Z:$.k.2j[0],2p:$.k.2j[1]};$.k.2j=z;c.2D=z;c.1f.1o({1K:"3H",6t:"97",2p:"-bm"});$.k.2V(c);1h=$.k.8D(c,1h,1V);c.1f.1o({1K:($.k.3n&&$.51?"93":(1V?"5M":"3H")),6t:"6Q",1Z:1h.1Z+"57",2p:1h.2p+"57"});h(!c.1I){f 2s=$.k.t(c,"2s")||"6y";f 1C=$.k.t(c,"1C");f 3J=l(){$.k.3A=1m;h($.1G.44&&22($.1G.3I,10)<7){$("5e.r-k-7n").1o({25:c.1f.25()+4,31:c.1f.31()+4})}};h($.5u&&$.5u[2s]){c.1f.6y(2s,$.k.t(c,"5X"),1C,3J)}1d{c.1f[2s](1C,3J)}h(1C==""){3J()}h(c.u[0].2W!="3v"){c.u[0].3t()}$.k.3V=c}},2V:l(c){f 6C={25:c.1f.25()+4,31:c.1f.31()+4};f 96=b;c.1f.92().4p(b.90(c)).5k("5e.r-k-7n").1o({25:6C.25,31:6C.31}).3a().5k("1X, .r-k-4o, .r-k-4A, .r-k-5y 3p a").23("bj",l(){$(b).2Y("r-1U-6B")}).23("99",l(){h(!96.4Q(c.1I?c.1f.bh()[0]:c.u[0])){$(b).3z(".r-k-5y").5k("a").2Y("r-1U-6B");$(b).2N("r-1U-6B")}}).3a().5k("."+b.5q+" a").4c("99").3a();f 1F=b.5V(c);f 5n=1F[1];f 25=17;h(5n>1){c.1f.2N("r-k-4E-"+5n).1o("25",(25*5n)+"bo")}1d{c.1f.2Y("r-k-4E-2 r-k-4E-3 r-k-4E-4").25("")}c.1f[(1F[0]!=1||1F[1]!=1?"4H":"3q")+"8Y"]("r-k-4E");c.1f[(b.t(c,"1t")?"4H":"3q")+"8Y"]("r-k-8E");h(c.u&&c.u[0].2W!="3v"&&c==$.k.3V){$(c.u[0]).3t()}},8D:l(c,1h,1V){f 30=c.u?b.6z(c.u[0]):z;f 5l=5f.8z||(1l.2c?1l.2c.5d:1l.2g.5d);f 5m=5f.8A||(1l.2c?1l.2c.5h:1l.2g.5h);f 3M=1l.2c.3U||1l.2g.3U;f 3Q=1l.2c.3T||1l.2g.3T;h(b.t(c,"1t")||(1h.1Z+c.1f.25()-3M)>5l){1h.1Z=26.3g((1V?0:3M),30[0]+(c.u?c.u.25():0)-(1V?3M:0)-c.1f.25()-(1V&&$.1G.6A?1l.2c.3U:0))}1d{1h.1Z-=(1V?3M:0)}h((1h.2p+c.1f.31()-3Q)>5m){1h.2p=26.3g((1V?0:3Q),30[1]-(1V?3Q:0)-(b.3n?0:c.1f.31())-(1V&&$.1G.6A?1l.2c.3T:0))}1d{1h.2p-=(1V?3Q:0)}p 1h},6z:l(3C){3k(3C&&(3C.2W=="3v"||3C.bq!=1)){3C=3C.bn}f 1K=$(3C).1h();p[1K.1Z,1K.2p]},2P:l(u,1C){f c=b.3V;h(!c||(u&&c!=$.2t(u,3x))){p}h(c.4j){b.5L("#"+c.1b,b.4D(c,c.1W,c.2r,c.2f))}c.4j=S;h(b.3A){1C=(1C!=z?1C:b.t(c,"1C"));f 2s=b.t(c,"2s");f 3J=l(){$.k.60(c)};h(1C!=""&&$.5u&&$.5u[2s]){c.1f.62(2s,$.k.t(c,"5X"),1C,3J)}1d{c.1f[(1C==""?"62":(2s=="bl"?"bv":(2s=="bE"?"bF":"62")))](1C,3J)}h(1C==""){b.60(c)}f 4L=b.t(c,"4L");h(4L){4L.21((c.u?c.u[0]:z),[(c.u?c.u.3N():""),c])}b.3A=S;b.4i=z;h(b.3n){b.2J.1o({1K:"3H",1Z:"0",2p:"-8Q"});h($.51){$.bg();$("2g").4p(b.1f)}}b.3n=S}b.3V=z},60:l(c){c.1f.2Y(b.5Y).3l(".r-k-5y")},8N:l(v){h(!$.k.3V){p}f $q=$(v.q);h(($q.3z("#"+$.k.63).1r==0)&&!$q.3j($.k.2x)&&!$q.3j($.k.3c)&&$.k.3A&&!($.k.3n&&$.51)){$.k.2P(z,"")}},2e:l(1b,1h,2y){f q=$(1b);f c=b.1S(q[0]);h(b.4Q(q[0])){p}b.5R(c,1h,2y);b.2V(c)},72:l(1b){f q=$(1b);f c=b.1S(q[0]);h(b.t(c,"7f")&&c.1W){c.2d=c.1W;c.1a=c.1M=c.2r;c.1c=c.1T=c.2f}1d{f n=Z X();c.2d=n.1p();c.1a=c.1M=n.1v();c.1c=c.1T=n.1i()}b.4I(c);b.2e(q)},6x:l(1b,3u,2y){f q=$(1b);f c=b.1S(q[0]);c.5B=S;c["4G"+(2y=="M"?"8T":"8L")]=c["bJ"+(2y=="M"?"8T":"8L")]=22(3u.1D[3u.b4].18,10);b.4I(c);b.2e(q)},7i:l(1b){f q=$(1b);f c=b.1S(q[0]);h(c.u&&c.5B&&!$.1G.44){c.u[0].3t()}c.5B=!c.5B},7k:l(1b,19,U,3p){f q=$(1b);h($(3p).3j(b.7o)||b.4Q(q[0])){p}f c=b.1S(q[0]);c.2d=c.1W=$("a",3p).1Y();c.1M=c.2r=19;c.1T=c.2f=U;h(c.4j){c.48=c.4U=c.29=z}b.5L(1b,b.4D(c,c.1W,c.2r,c.2f));h(c.4j){c.2D=b.1y(Z X(c.2f,c.2r,c.1W));b.2V(c)}},8K:l(1b){f q=$(1b);f c=b.1S(q[0]);c.4j=S;c.48=c.4U=c.29=c.2D=z;b.5L(q,"")},5L:l(1b,3i){f q=$(1b);f c=b.1S(q[0]);3i=(3i!=z?3i:b.4D(c));h(c.u){c.u.3N(3i)}b.5o(c);f 3o=b.t(c,"3o");h(3o){3o.21((c.u?c.u[0]:z),[3i,c])}1d{h(c.u){c.u.4c("cv")}}h(c.1I){b.2V(c)}1d{h(!c.4j){b.2P(z,b.t(c,"1C"));b.4i=c.u[0];h(1L(c.u[0])!="5x"){c.u[0].3t()}b.4i=z}}},5o:l(c){f 55=b.t(c,"55");h(55){f 58=b.t(c,"58")||b.t(c,"3E");f n=b.7h(c);3i=b.4t(58,n,b.3B(c));$(55).3e(l(){$(b).3N(3i)})}},c9:l(n){f 1e=n.4a();p[(1e>0&&1e<6),""]},5G:l(n){f 2z=Z X(n.1i(),n.1v(),n.1p());f 4v=Z X(2z.1i(),1-1,4);f 1O=4v.4a()||7;4v.4P(4v.1p()+1-1O);h(1O<4&&2z<4v){2z.4P(2z.1p()-3);p $.k.5G(2z)}1d{h(2z>Z X(2z.1i(),12-1,28)){1O=Z X(2z.1i()+1,1-1,4).4a()||7;h(1O>4&&(2z.4a()||7)<1O-3){p 1}}}p 26.c5(((2z-4v)/bW)/7)+1},8V:l(1s,18,V){h(1s==z||18==z){4u"74 3K"}18=(1L 18=="5x"?18.61():18+"");h(18==""){p z}f 2k=(V?V.2k:z)||b.24.2k;f 2l=(V?V.2l:z)||b.24.2l;f 2a=(V?V.2a:z)||b.24.2a;f 1Q=(V?V.1Q:z)||b.24.1Q;f 1N=(V?V.1N:z)||b.24.1N;f U=-1;f 19=-1;f 1e=-1;f 3L=-1;f 2h=S;f 2i=l(1R){f 2b=(1k+1<1s.1r&&1s.1w(1k+1)==1R);h(2b){1k++}p 2b};f 4w=l(1R){2i(1R);f 7d=(1R=="@"?14:(1R=="y"?4:(1R=="o"?3:2)));f 2L=7d;f 2X=0;3k(2L>0&&2n<18.1r&&18.1w(2n)>="0"&&18.1w(2n)<="9"){2X=2X*10+22(18.1w(2n++),10);2L--}h(2L==7d){4u"8F 73 at 1K "+2n}p 2X};f 78=l(1R,5a,5v){f 4M=(2i(1R)?5v:5a);f 2L=0;1E(f j=0;j<4M.1r;j++){2L=26.3g(2L,4M[j].1r)}f 1B="";f 8J=2n;3k(2L>0&&2n<18.1r){1B+=18.1w(2n++);1E(f i=0;i<4M.1r;i++){h(1B==4M[i]){p i+1}}2L--}4u"cz 1B at 1K "+8J};f 5A=l(){h(18.1w(2n)!=1s.1w(1k)){4u"cy 2h at 1K "+2n}2n++};f 2n=0;1E(f 1k=0;1k<1s.1r;1k++){h(2h){h(1s.1w(1k)=="\'"&&!2i("\'")){2h=S}1d{5A()}}1d{49(1s.1w(1k)){T"d":1e=4w("d");15;T"D":78("D",2l,2a);15;T"o":3L=4w("o");15;T"m":19=4w("m");15;T"M":19=78("M",1Q,1N);15;T"y":U=4w("y");15;T"@":f n=Z X(4w("@"));U=n.1i();19=n.1v()+1;1e=n.1p();15;T"\'":h(2i("\'")){5A()}1d{2h=1m}15;2G:5A()}}}h(U==-1){U=Z X().1i()}1d{h(U<3y){U+=Z X().1i()-Z X().1i()%3y+(U<=2k?0:-3y)}}h(3L>-1){19=1;1e=3L;bP{f 6V=b.3S(U,19-1);h(1e<=6V){15}19++;1e-=6V}3k(1m)}f n=b.1y(Z X(U,19-1,1e));h(n.1i()!=U||n.1v()+1!=19||n.1p()!=1e){4u"74 n"}p n},b8:"3P-5I-4h",ba:"D, 4h M 3P",aS:"3P-5I-4h",aU:"D, d M y",aZ:"aX, 4h-M-y",aV:"D, d M y",aW:"D, d M 3P",bf:"D, d M 3P",bz:"D, d M y",bx:"@",bB:"3P-5I-4h",4t:l(1s,n,V){h(!n){p""}f 2l=(V?V.2l:z)||b.24.2l;f 2a=(V?V.2a:z)||b.24.2a;f 1Q=(V?V.1Q:z)||b.24.1Q;f 1N=(V?V.1N:z)||b.24.1N;f 2i=l(1R){f 2b=(1k+1<1s.1r&&1s.1w(1k+1)==1R);h(2b){1k++}p 2b};f 5b=l(1R,18,8O){f 2X=""+18;h(2i(1R)){3k(2X.1r<8O){2X="0"+2X}}p 2X};f 6U=l(1R,18,5a,5v){p(2i(1R)?5v[18]:5a[18])};f 2q="";f 2h=S;h(n){1E(f 1k=0;1k<1s.1r;1k++){h(2h){h(1s.1w(1k)=="\'"&&!2i("\'")){2h=S}1d{2q+=1s.1w(1k)}}1d{49(1s.1w(1k)){T"d":2q+=5b("d",n.1p(),2);15;T"D":2q+=6U("D",n.4a(),2l,2a);15;T"o":f 3L=n.1p();1E(f m=n.1v()-1;m>=0;m--){3L+=b.3S(n.1i(),m)}2q+=5b("o",3L,3);15;T"m":2q+=5b("m",n.1v()+1,2);15;T"M":2q+=6U("M",n.1v(),1Q,1N);15;T"y":2q+=(2i("y")?n.1i():(n.8S()%3y<10?"0":"")+n.8S()%3y);15;T"@":2q+=n.1A();15;T"\'":h(2i("\'")){2q+="\'"}1d{2h=1m}15;2G:2q+=1s.1w(1k)}}}}p 2q},8W:l(1s){f 2Z="";f 2h=S;1E(f 1k=0;1k<1s.1r;1k++){h(2h){h(1s.1w(1k)=="\'"&&!2i("\'")){2h=S}1d{2Z+=1s.1w(1k)}}1d{49(1s.1w(1k)){T"d":T"m":T"y":T"@":2Z+="bi";15;T"D":T"M":p z;T"\'":h(2i("\'")){2Z+="\'"}1d{2h=1m}15;2G:2Z+=1s.1w(1k)}}}p 2Z},t:l(c,1B){p c.V[1B]!==4d?c.V[1B]:b.24[1B]},7c:l(c){f 3E=b.t(c,"3E");f 4W=c.u?c.u.3N():z;c.48=c.4U=c.29=z;f n=2o=b.5F(c);f V=b.3B(c);5c{n=b.8V(3E,4W,V)||2o}5g(v){b.7a(v);n=2o}c.2d=n.1p();c.1a=c.1M=n.1v();c.1c=c.1T=n.1i();c.1W=(4W?n.1p():0);c.2r=(4W?n.1v():0);c.2f=(4W?n.1i():0);b.5R(c)},5F:l(c){f n=b.5s(b.t(c,"2o"),Z X());f 1g=b.3f(c,"3d",1m);f 1n=b.3f(c,"3g");n=(1g&&n<1g?1g:n);n=(1n&&n>1n?1n:n);p n},5s:l(n,2o){f 8y=l(1h){f n=Z X();n.4P(n.1p()+1h);p n};f 8B=l(1h,7b){f n=Z X();f U=n.1i();f 19=n.1v();f 1e=n.1p();f 7j=/([+-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g;f 2b=7j.8C(1h);3k(2b){49(2b[2]||"d"){T"d":T"D":1e+=22(2b[1],10);15;T"w":T"W":1e+=22(2b[1],10)*7;15;T"m":T"M":19+=22(2b[1],10);1e=26.3d(1e,7b(U,19));15;T"y":T"Y":U+=22(2b[1],10);1e=26.3d(1e,7b(U,19));15}2b=7j.8C(1h)}p Z X(U,19,1e)};n=(n==z?2o:(1L n=="2O"?8B(n,b.3S):(1L n=="73"?(7s(n)?2o:8y(n)):n)));n=(n&&n.61()=="74 X"?2o:n);h(n){n.8X(0);n.br(0);n.bs(0);n.bt(0)}p b.1y(n)},1y:l(n){h(!n){p z}n.8X(n.98()>12?n.98()+2:0);p n},6R:l(c,n,47){f 95=!(n);f 91=c.1M;f 8Z=c.1T;n=b.5s(n,Z X());c.2d=c.1W=n.1p();c.1a=c.1M=c.2r=n.1v();c.1c=c.1T=c.2f=n.1i();h(91!=c.1M||8Z!=c.1T){b.4I(c)}b.5R(c);h(c.u){c.u.3N(95?"":b.4D(c))}},7h:l(c){f 94=(!c.2f||(c.u&&c.u.3N()=="")?z:b.1y(Z X(c.2f,c.2r,c.1W)));p 94},90:l(c){f 3b=Z X();3b=b.1y(Z X(3b.1i(),3b.1v(),3b.1p()));f 1t=b.t(c,"1t");f 5P=b.t(c,"5P");f 4J=b.t(c,"4J");f 4m=b.t(c,"4m");f 1F=b.5V(c);f 5N=b.t(c,"5N");f 2B=b.t(c,"2B");f 3O=b.t(c,"3O");f 5O=(1F[0]!=1||1F[1]!=1);f 52=b.1y((!c.1W?Z X(bk,9,9):Z X(c.2f,c.2r,c.1W)));f 1g=b.3f(c,"3d",1m);f 1n=b.3f(c,"3g");f 1a=c.1a-5N;f 1c=c.1c;h(1a<0){1a+=12;1c--}h(1n){f 4N=b.1y(Z X(1n.1i(),1n.1v()-1F[1]+1,1n.1p()));4N=(1g&&4N<1g?1g:4N);3k(b.1y(Z X(1c,1a,1))>4N){1a--;h(1a<0){1a=11;1c--}}}f 2H=b.t(c,"2H");2H=(!4m?2H:b.4t(2H,b.1y(Z X(1c,1a-2B,1)),b.3B(c)));f 4o=(b.70(c,-1,1c,1a)?\'<1x 1j="r-3m r-3m-5K-5H-\'+(1t?"e":"w")+\'">\'+2H+"":(4J?"":\'<1x 1j="r-3m r-3m-5K-5H-\'+(1t?"e":"w")+\'">\'+2H+""));f 2K=b.t(c,"2K");2K=(!4m?2K:b.4t(2K,b.1y(Z X(1c,1a+2B,1)),b.3B(c)));f 4A=(b.70(c,+1,1c,1a)?\'<1x 1j="r-3m r-3m-5K-5H-\'+(1t?"w":"e")+\'">\'+2K+"":(4J?"":\'<1x 1j="r-3m r-3m-5K-5H-\'+(1t?"w":"e")+\'">\'+2K+""));f 3F=b.t(c,"3F");f 71=(b.t(c,"7f")&&c.1W?52:3b);3F=(!4m?3F:b.4t(3F,71,b.3B(c)));f 6S=\'<1X 2W="1X" 1j="r-k-bG r-1U-2G r-7r-bH r-2E-2v" 43="2w.k.2P();">\'+b.t(c,"8x")+"";f 8e=(5P)?\'<1J 1j="r-k-bA r-2C-76">\'+(1t?6S:"")+(b.6Y(c,71)?\'<1X 2W="1X" 1j="r-k-7R r-1U-2G r-7r-4b r-2E-2v" 43="2w.k.72(\\\'#\'+c.1b+"\');\\">"+3F+"":"")+(1t?"":6S)+"":"";f 1O=22(b.t(c,"1O"));1O=(7s(1O)?0:1O);f 2a=b.t(c,"2a");f 2l=b.t(c,"2l");f 5D=b.t(c,"5D");f 1N=b.t(c,"1N");f 1Q=b.t(c,"1Q");f 4V=b.t(c,"4V");f 4q=b.t(c,"4q");f 7e=b.t(c,"7e")||b.5G;f 47=c.48?b.1y(Z X(c.29,c.4U,c.48)):52;f 2o=b.5F(c);f 1Y="";1E(f 4B=0;4B<1F[0];4B++){f 4R="";1E(f 4T=0;4T<1F[1];4T++){f 3Z=b.1y(Z X(1c,1a,c.2d));f 3D=" r-2E-2v";f 2u="";h(5O){2u+=\'<1J 1j="r-k-4R r-k-4R-\';49(4T){T 0:2u+="b1";3D=" r-2E-"+(1t?"6W":"1Z");15;T 1F[1]-1:2u+="bd";3D=" r-2E-"+(1t?"1Z":"6W");15;2G:2u+="be";3D="";15}2u+=\'">\'}2u+=\'<1J 1j="r-k-8f r-2C-8f r-5r-6Z\'+3D+\'">\'+(/2v|1Z/.1P(3D)&&4B==0?(1t?4A:4o):"")+(/2v|6W/.1P(3D)&&4B==0?(1t?4o:4A):"")+b.7M(c,1a,1c,1g,1n,3Z,4B>0||4T>0,1N,1Q)+\'<8c 1j="r-k-5y"><50><5t>\';f 50="";1E(f 2U=0;2U<7;2U++){f 1e=(2U+1O)%7;50+="<8p"+((2U+1O+6)%7>=5?\' 1j="r-k-83-3a"\':"")+\'><1x 2T="\'+2a[1e]+\'">\'+5D[1e]+""}2u+=50+"<53>";f 75=b.3S(1c,1a);h(1c==c.1T&&1a==c.1M){c.2d=26.3d(c.2d,75)}f 77=(b.8j(1c,1a)-1O+7)%7;f 8d=(5O?6:26.b5((77+75)/7));f 1z=b.1y(Z X(1c,1a,1-77));1E(f 6T=0;6T<8d;6T++){2u+="<5t>";f 53="";1E(f 2U=0;2U<7;2U++){f 4K=(4V?4V.21((c.u?c.u[0]:z),[1z]):[1m,""]);f 4z=(1z.1v()!=1a);f 2I=4z||!4K[0]||(1g&&1z<1g)||(1n&&1z>1n);53+=\'<3p 1j="\'+((2U+1O+6)%7>=5?" r-k-83-3a":"")+(4z?" r-k-9v-19":"")+((1z.1A()==3Z.1A()&&1a==c.1M&&c.5i)||(2o.1A()==1z.1A()&&2o.1A()==3Z.1A())?" "+b.5q:"")+(2I?" "+b.7o+" r-1U-1u":"")+(4z&&!4q?"":" "+4K[1]+(1z.1A()>=52.1A()&&1z.1A()<=47.1A()?" "+b.7m:"")+(1z.1A()==3b.1A()?" r-k-3b":""))+\'"\'+((!4z||4q)&&4K[2]?\' 2T="\'+4K[2]+\'"\':"")+(2I?"":" 43=\\"2w.k.7k(\'#"+c.1b+"\',"+1a+","+1c+\', b);p S;"\')+">"+(4z?(4q?1z.1p():"X;"):(2I?1z.1p():\'=52.1A()&&1z.1A()<=47.1A()?" r-1U-9K":"")+\'" 7Y="#">\'+1z.1p()+""))+"";1z.4P(1z.1p()+1);1z=b.1y(1z)}2u+=53+""}1a++;h(1a>11){1a=0;1c++}2u+=""+(5O?"":"");4R+=2u}1Y+=4R}1Y+=(!c.1I?8e:"")+($.1G.44&&22($.1G.3I,10)<7&&!c.1I?\'<5e 79="az:S;" 1j="r-k-7n" aF="0">\':"");c.5i=S;p 1Y},7M:l(c,1a,1c,1g,1n,3Z,4b,1N,1Q){1g=(c.2D&&1g&&3Z<1g?3Z:1g);f 3Y=b.t(c,"3Y");f 41=b.t(c,"41");f 4Z=b.t(c,"4Z");f 1Y=\'<1J 1j="r-k-2T">\';f 3X="";h(4b||!3Y){3X+=\'<1x 1j="r-k-19">\'+1N[1a]+" "}1d{f 7Q=(1g&&1g.1i()==1c);f 7B=(1n&&1n.1i()==1c);3X+=\'<3u 1j="r-k-19" 8G="2w.k.6x(\\\'#\'+c.1b+"\', b, \'M\');\\" 43=\\"2w.k.7i(\'#"+c.1b+"\');\\">";1E(f 19=0;19<12;19++){h((!7Q||19>=1g.1v())&&(!7B||19<=1n.1v())){3X+=\'<4x 18="\'+19+\'"\'+(19==1a?\' 4G="4G"\':"")+">"+1Q[19]+""}}3X+=""}h(!4Z){1Y+=3X+((4b||3Y||41)&&(!(3Y&&41))?"X;":"")}h(4b||!41){1Y+=\'<1x 1j="r-k-U">\'+1c+""}1d{f 3w=b.t(c,"8M").5j(":");f U=0;f 29=0;h(3w.1r!=2){U=1c-10;29=1c+10}1d{h(3w[0].1w(0)=="+"||3w[0].1w(0)=="-"){U=29=Z X().1i();U+=22(3w[0],10);29+=22(3w[1],10)}1d{U=22(3w[0],10);29=22(3w[1],10)}}U=(1g?26.3g(U,1g.1i()):U);29=(1n?26.3d(29,1n.1i()):29);1Y+=\'<3u 1j="r-k-U" 8G="2w.k.6x(\\\'#\'+c.1b+"\', b, \'Y\');\\" 43=\\"2w.k.7i(\'#"+c.1b+"\');\\">";1E(;U<=29;U++){1Y+=\'<4x 18="\'+U+\'"\'+(U==1c?\' 4G="4G"\':"")+">"+U+""}1Y+=""}h(4Z){1Y+=(4b||3Y||41?"X;":"")+3X}1Y+="";p 1Y},5R:l(c,1h,2y){f U=c.1c+(2y=="Y"?1h:0);f 19=c.1a+(2y=="M"?1h:0);f 1e=26.3d(c.2d,b.3S(U,19))+(2y=="D"?1h:0);f n=b.1y(Z X(U,19,1e));f 1g=b.3f(c,"3d",1m);f 1n=b.3f(c,"3g");n=(1g&&n<1g?1g:n);n=(1n&&n>1n?1n:n);c.2d=n.1p();c.1a=c.1M=n.1v();c.1c=c.1T=n.1i();h(2y=="M"||2y=="Y"){b.4I(c)}},4I:l(c){f 7g=b.t(c,"88");h(7g){7g.21((c.u?c.u[0]:z),[c.1T,c.1M+1,c])}},5V:l(c){f 1F=b.t(c,"8o");p(1F==z?[1,1]:(1L 1F=="73"?[1,1F]:1F))},3f:l(c,8u,7S){f n=b.5s(b.t(c,8u+"X"),z);p(!7S||!c.2D?n:(!n||c.2D>n?c.2D:n))},3S:l(U,19){p 32-Z X(U,19,32).1p()},8j:l(U,19){p Z X(U,19,1).4a()},70:l(c,1h,7y,7E){f 1F=b.5V(c);f n=b.1y(Z X(7y,7E+(1h<0?1h:1F[1]),1));h(1h<0){n.4P(b.3S(n.1i(),n.1v()))}p b.6Y(c,n)},6Y:l(c,n){f 4r=(!c.2D?z:b.1y(Z X(c.1T,c.1M,c.2d)));4r=(4r&&c.2D<4r?c.2D:4r);f 1g=4r||b.3f(c,"3d");f 1n=b.3f(c,"3g");p((!1g||n>=1g)&&(!1n||n<=1n))},3B:l(c){f 2k=b.t(c,"2k");2k=(1L 2k!="2O"?2k:Z X().1i()%3y+22(2k,10));p{2k:2k,2l:b.t(c,"2l"),2a:b.t(c,"2a"),1Q:b.t(c,"1Q"),1N:b.t(c,"1N")}},4D:l(c,1e,19,U){h(!1e){c.1W=c.2d;c.2r=c.1M;c.2f=c.1T}f n=(1e?(1L 1e=="5x"?1e:b.1y(Z X(U,19,1e))):b.1y(Z X(c.2f,c.2r,c.1W)));p b.4t(b.t(c,"3E"),n,b.3B(c))}});l 4k(q,4y){$.3h(q,4y);1E(f 1B 7l 4y){h(4y[1B]==z||4y[1B]==4d){q[1B]=4y[1B]}}p q}l bU(a){p(a&&(($.1G.5Z&&1L a=="5x"&&a.1r)||(a.8R&&a.8R.61().1R(/\\6P\\(\\)/))))}$.4f.k=l(1D){h(!$.k.6L){$(1l.2g).4p($.k.1f).8P($.k.8N);$.k.6L=1m}f 6D=6P.3R.8U.4s(3K,1);h(1L 1D=="2O"&&(1D=="bp"||1D=="1p")){p $.k["6u"+1D+"4F"].21($.k,[b[0]].6v(6D))}p b.3e(l(){1L 1D=="2O"?$.k["6u"+1D+"4F"].21($.k,[b].6v(6D)):$.k.7z(b,1D)})};$.k=Z 4F();$.k.6L=S;$.k.6s=Z X().1A();$.k.3I="1.6f"})(2w);',62,780,'|||||||||||this|inst|||var||if|||datepicker|function||date||return|target|ui||_get|input|event||||null|||||||||||||||||||false|case|year|settings||Date||new||||||break|||value|month|drawMonth|id|drawYear|else|day|dpDiv|minDate|offset|getFullYear|class|iFormat|document|true|maxDate|css|getDate|nodeName|length|format|isRTL|disabled|getMonth|charAt|span|_daylightSavingAdjust|printDate|getTime|name|duration|options|for|numMonths|browser|ctrlKey|inline|div|position|typeof|selectedMonth|monthNames|firstDay|test|monthNamesShort|match|_getInst|selectedYear|state|isFixed|currentDay|button|html|left||apply|parseInt|bind|_defaults|width|Math|||endYear|dayNames|matches|documentElement|selectedDay|_adjustDate|currentYear|body|literal|lookAhead|_pos|shortYearCutoff|dayNamesShort|metaKey|iValue|defaultDate|top|output|currentMonth|showAnim|data|calender|all|jQuery|markerClassName|period|checkDate|element|stepMonths|widget|rangeStart|corner|handled|default|prevText|unselectable|_dialogInput|nextText|size|attr|addClass|string|_hideDatepicker|_mouseStarted|widgetName|_disabledInputs|title|dow|_updateDatepicker|type|num|removeClass|chars|pos|height|||||||||end|today|_triggerClass|min|each|_getMinMaxDate|max|extend|dateStr|hasClass|while|unbind|icon|_inDialog|onSelect|td|remove|key|buttonText|focus|select|hidden|years|PROP_NAME|100|parents|_datepickerShowing|_getFormatConfig|obj|cornerClass|dateFormat|currentText|showOn|absolute|version|postProcess|arguments|doy|scrollX|val|stepBigMonths|yy|scrollY|prototype|_getDaysInMonth|scrollTop|scrollLeft|_curInst|overflow|monthHtml|changeMonth|selectedDate||changeYear|curCSS|onclick|msie|||endDate|endDay|switch|getDay|secondary|trigger|undefined|buttonImage|fn|toLowerCase|dd|_lastInput|stayOpen|extendRemove|_showDatepicker|navigationAsDateFormat|siblings|prev|append|showOtherMonths|newMinDate|call|formatDate|throw|firstMon|getNumber|option|props|otherMonth|next|row|inlineSettings|_formatDate|multi|Datepicker|selected|add|_notifyChange|hideIfNoPrevNext|daySettings|onClose|names|maxDraw|beforeShow|setDate|_isDisabledDatepicker|group|_setData|col|endMonth|beforeShowDay|dates|replace|appendText|showMonthAfterYear|thead|blockUI|currentDate|tbody|cssCache|altField|_mouseUp|px|altFormat|plugins|shortNames|formatNumber|try|clientWidth|iframe|window|catch|clientHeight|_keyEvent|split|find|browserWidth|browserHeight|cols|_updateAlternate|preventDefault|_dayOverClass|helper|_determineDate|tr|effects|longNames|_mouseDownEvent|object|calendar|defaults|checkLiteral|_selectingMonthYear|attrName|dayNamesMin|attrValue|_getDefaultDate|iso8601Week|triangle|mm|keyCode|circle|_selectDate|fixed|showCurrentAtPos|isMultiMonth|showButtonPanel|img|_adjustInstDate|_inlineClass|children|_doKeyDown|_getNumberOfMonths|mouseDelayMet|showOptions|_dialogClass|safari|_tidyDialog|toString|hide|_mainDivId|_doKeyPress|_preventClickEvent|_mouseUpDelegate|_mouseMoveDelegate|filter|_mouseDistanceMet|_mouseDelayMet|delay|cancel|_mouseDrag|_mouseStart|6rc4|widgetEventPrefix|auto|aaa|isOverAxis|contains|get|removeAttr|aria|namespace|widgetBaseClass|_getData|regional|uuid|display|_|concat|chr|_selectMonthYear|show|_findPos|opera|hover|dims|otherArgs|sel|_newInst|getData|setData|divSpan|pageX|pageY|initialized|cursor|keydown|_appendClass|Array|none|_setDate|controls|dRow|formatName|dim|right|xa0|_isInRange|clearfix|_canAdjustMonth|gotoDate|_gotoToday|number|Invalid|daysInMonth|content|leadDays|getName|src|log|getDaysInMonth|_setDateFromField|origSize|calculateWeek|gotoCurrent|onChange|_getDate|_clickMonthYear|pattern|_selectDay|in|_currentClass|cover|_unselectableClass|removeData|map|priority|isNaN|keypress|opacity|metadata|eq|constrainInput|curYear|_attachDatepicker|MozUserSelect|inMaxYear|charCode|parentNode|curMonth|wairole|selectstart|altKey|getterSetter|is|_optionDatepicker|err|_generateMonthYearHeader|scroll|originalEvent|relative|inMinYear|current|checkRange|_mouseDown|_mouseMove|mousemove|mouseup|_mouseUnselectable|href|debug|triggerHandler|on|abs|week|May|x3c|x3e|distance|onChangeMonthYear|_mouseStop|_mouseCapture|mouse|table|numRows|buttonPanel|header|_inlineDatepicker|dp|_dialogInst|_getFirstDayOfMonth|dateText|destroy|click|after|numberOfMonths|th|_connectDatepicker|both|buttonImageOnly|before|minMax|alt|_init|closeText|offsetNumeric|innerWidth|innerHeight|offsetString|exec|_checkOffset|rtl|Missing|onchange|compareDocumentPosition|5000px|iInit|_clearDate|Year|yearRange|_checkExternalClick|len|mousedown|100px|constructor|getYear|Month|slice|parseDate|_possibleChars|setHours|Class|origYear|_generateHTML|origMonth|empty|static|startDate|clear|self|block|getHours|mouseover|parseFloat|prevBigText|isOver|188|started|backgroundColor|removeChild|hasScroll|_mouseDestroy|COMMA|Next|fix|nextBigText|_trigger|BACKSPACE|CAPS_LOCK|_mouseInit|Today|disable|mozilla|setTimeout|other|appendTo|backgroundImage|CONTROL|days|gen|push|_disableClass|522|plugin|cell|over|dialog|_mouseDelayTimer|Prev|active|Done|rgba|clearText|Clear|transparent|highlight|which|107|tabbable|SHIFT|expr|SPACE|TAB|RIGHT|tabIndex|inArray|substring|190|getter|textarea|UP|scrollParent|w3|setAttributeNS|role|07|org|www|removeAttributeNS|disableSelection|http|January|off|enableSelection|PERIOD|isFunction|NUMPAD_ADD|LEFT|2005|NUMPAD_DECIMAL|110|INSERT|HOME|DOWN||DELETE|END|ENTER|ESCAPE|NUMPAD_DIVIDE|javascript|109|NUMPAD_SUBTRACT|PAGE_DOWN|PAGE_UP|eventPrefix|frameborder|106|111|NUMPAD_ENTER|108|NUMPAD_MULTIPLY|enable|Fri|_refreshDatepicker|_setDateDatepicker|_changeDatepicker|instance|_disableDatepicker|ISO_8601|_getDateDatepicker|RFC_822|RFC_1036|RFC_1123|DD|February|RFC_850|_enableDatepicker|first|_dialogDatepicker|text|selectedIndex|ceil|getAttribute|eval|ATOM|style|COOKIE|_destroyDatepicker|150|last|middle|RFC_2822|unblockUI|parent|0123456789|mouseout|9999|slideDown|1000px|nextSibling|em|isDisabled|nodeType|setMinutes|setSeconds|setMilliseconds|offsetHeight|slideUp|String|TIMESTAMP|stopPropagation|RSS|buttonpane|W3C|fromCharCode|indexOf|fadeIn|fadeOut|close|primary|setDefaults|draw|Tuesday|October|Monday|Sunday|Dec|do|Wednesday|September|Saturday|Friday|isArray|Thursday|86400000|November|Jul|Aug|Jun|Apr|Mar|Sep|Oct|floor|December|Jan|Nov|noWeekends|Feb|August|We|Th|Tu|Mo|Su|Fr|Sa|console|hasDatepicker|accessible|normal|July|March|Tue|Wed|Mon|Sun|June|Thu|change|Sat|April|Unexpected|Unknown'.split('|'),0,{})) diff --git a/js/jquery/datepicker/ui/i18n/index.php b/js/jquery/datepicker/ui/i18n/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/index.php @@ -0,0 +1,11 @@ + */ +jQuery(function($){ + $.datepicker.regional['lt'] = { + clearText: 'Išvalyti', clearStatus: '', + closeText: 'Uždaryti', closeStatus: '', + prevText: '<Atgal', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Pirmyn>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Šiandien', currentStatus: '', + monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', + 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], + monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', + 'Lie','Rugp','Rugs','Spa','Lap','Gru'], + monthStatus: '', yearStatus: '', + weekHeader: '', weekStatus: '', + dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], + dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], + dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lt']); +});/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* @author Arturas Paleicikas */ +jQuery(function($){ + $.datepicker.regional['lv'] = { + clearText: 'Notīrīt', clearStatus: '', + closeText: 'Aizvērt', closeStatus: '', + prevText: 'Iepr', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nāka', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Šodien', currentStatus: '', + monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', + 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', + 'Jūl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Nav', weekStatus: '', + dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], + dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], + dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd-mm-yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lv']); +});/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Mathias Bynens */ +jQuery(function($){ + $.datepicker.regional.nl = { + clearText: 'Wissen', clearStatus: 'Wis de huidige datum', + closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering', + prevText: '←', prevStatus: 'Bekijk de vorige maand', + prevBigText: '«', nextBigStatus: 'Bekijk het vorige jaar', + nextText: '→', nextStatus: 'Bekijk de volgende maand', + nextBigText: '»', nextBigStatus: 'Bekijk het volgende jaar', + currentText: 'Vandaag', currentStatus: 'Bekijk de huidige maand', + monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', + 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + monthStatus: 'Bekijk een andere maand', yearStatus: 'Bekijk een ander jaar', + weekHeader: 'Wk', weekStatus: 'Week van het jaar', + dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], + dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + dayStatus: 'Stel DD in als eerste dag van de week', dateStatus: 'dd/mm/yy', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: 'Kies een datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional.nl); +});/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['no'] = { + clearText: 'Tøm', clearStatus: '', + closeText: 'Lukk', closeStatus: '', + prevText: '«Forrige', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Neste»', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'I dag', currentStatus: '', + monthNames: ['Januar','Februar','Mars','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Uke', weekStatus: '', + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['no']); +}); +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = { + clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę', + closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania', + prevText: '<Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Następny>', nextStatus: 'Pokaż następny miesiąc', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok', + weekHeader: 'Tydz', weekStatus: 'Tydzień roku', + dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: '\'Wybierz\' D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: 'Wybierz datę', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pl']); +}); +/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = { + clearText: 'Limpar', clearStatus: '', + closeText: 'Fechar', closeStatus: '', + prevText: '<Anterior', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Próximo>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Hoje', currentStatus: '', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); +});/* Romanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Edmond L. (ll_edmond@walla.com). */ +jQuery(function($){ + $.datepicker.regional['ro'] = { + clearText: 'Curat', clearStatus: 'Sterge data curenta', + closeText: 'Inchide', closeStatus: 'Inchide fara schimbare', + prevText: '<Anterior', prevStatus: 'Arata luna trecuta', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Urmator>', nextStatus: 'Arata luna urmatoare', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Azi', currentStatus: 'Arata luna curenta', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie', + 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], + monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit', + weekHeader: 'Sapt', weekStatus: 'Saptamana anului', + dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'], + dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: 'Selecteaza o data', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ro']); +}); +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = { + clearText: 'Очистить', clearStatus: '', + closeText: 'Закрыть', closeStatus: '', + prevText: '<Пред', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'След>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Сегодня', currentStatus: '', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ru']); +});/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = { + clearText: 'Zmazať', clearStatus: '', + closeText: 'Zavrieť', closeStatus: '', + prevText: '<Predchádzajúci', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nasledujúci>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Dnes', currentStatus: '', + monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', + 'Júl','August','September','Október','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ty', weekStatus: '', + dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sk']); +}); +/* Slovenian initialisation for the jQuery UI date picker plugin. */ +/* Written by Jaka Jancar (jaka@kubje.org). */ +/* c = č, s = š z = ž C = Č S = Š Z = Ž */ +jQuery(function($){ + $.datepicker.regional['sl'] = { + clearText: 'Izbriši', clearStatus: 'Izbriši trenutni datum', + closeText: 'Zapri', closeStatus: 'Zapri brez spreminjanja', + prevText: '<Prejšnji', prevStatus: 'Prikaži prejšnji mesec', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Naslednji>', nextStatus: 'Prikaži naslednji mesec', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Trenutni', currentStatus: 'Prikaži trenutni mesec', + monthNames: ['Januar','Februar','Marec','April','Maj','Junij', + 'Julij','Avgust','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Avg','Sep','Okt','Nov','Dec'], + monthStatus: 'Prikaži drug mesec', yearStatus: 'Prikaži drugo leto', + weekHeader: 'Teden', weekStatus: 'Teden v letu', + dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'], + dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'], + dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'], + dayStatus: 'Nastavi DD za prvi dan v tednu', dateStatus: 'Izberi DD, d MM yy', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Izbira datuma', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sl']); +}); +/* Albanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Flakron Bytyqi (flakron@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['sq'] = { + clearText: 'fshije', clearStatus: 'fshije datën aktuale', + closeText: 'mbylle', closeStatus: 'mbylle pa ndryshime', + prevText: '<mbrapa', prevStatus: 'trego muajin e fundit', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Përpara>', nextStatus: 'trego muajin tjetër', + nextBigText: '>>', nextBigStatus: '', + currentText: 'sot', currentStatus: '', + monthNames: ['Janar','Shkurt','Mars','Pril','Maj','Qershor', + 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], + monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', + 'Kor','Gus','Sht','Tet','Nën','Dhj'], + monthStatus: 'trego muajin tjetër', yearStatus: 'trego tjetër vit', + weekHeader: 'Ja', weekStatus: 'Java e muajit', + dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], + dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], + dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], + dayStatus: 'Vendose DD si ditë të parë të javës', dateStatus: '\'Zgjedh\' D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Zgjedhe një datë', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sq']); +}); +/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +jQuery(function($){ + $.datepicker.regional['sv'] = { + clearText: 'Rensa', clearStatus: '', + closeText: 'Stäng', closeStatus: '', + prevText: '«Förra', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nästa»', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Idag', currentStatus: '', + monthNames: ['Januari','Februari','Mars','April','Maj','Juni', + 'Juli','Augusti','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ve', weekStatus: '', + dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], + dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], + dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sv']); +}); +/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = { + clearText: 'ลบ', clearStatus: '', + closeText: 'ปิด', closeStatus: '', + prevText: '« ย้อน', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'ถัดไป »', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'วันนี้', currentStatus: '', + monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], + monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], + dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['th']); +});/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = { + clearText: 'temizle', clearStatus: 'geçerli tarihi temizler', + closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat', + prevText: '<geri', prevStatus: 'önceki ayı göster', + prevBigText: '<<', prevBigStatus: '', + nextText: 'ileri>', nextStatus: 'sonraki ayı göster', + nextBigText: '>>', nextBigStatus: '', + currentText: 'bugün', currentStatus: '', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + monthStatus: 'başka ay', yearStatus: 'başka yıl', + weekHeader: 'Hf', weekStatus: 'Ayın haftaları', + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Bir tarih seçiniz', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['tr']); +});/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['uk'] = { + clearText: 'Очистити', clearStatus: '', + closeText: 'Закрити', closeStatus: '', + prevText: '<', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: '>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Сьогодні', currentStatus: '', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['uk']); +});/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = { + clearText: '清除', clearStatus: '清除已选日期', + closeText: '关闭', closeStatus: '不改变当前选择', + prevText: '<上月', prevStatus: '显示上月', + prevBigText: '<<', prevBigStatus: '显示上一年', + nextText: '下月>', nextStatus: '显示下月', + nextBigText: '>>', nextBigStatus: '显示下一年', + currentText: '今天', currentStatus: '显示本月', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一','二','三','四','五','六', + '七','八','九','十','十一','十二'], + monthStatus: '选择月份', yearStatus: '选择年份', + weekHeader: '周', weekStatus: '年内周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '请选择日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +}); +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Ressol (ressol@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-TW'] = { + clearText: '清除', clearStatus: '清除已選日期', + closeText: '關閉', closeStatus: '不改變目前的選擇', + prevText: '<上月', prevStatus: '顯示上月', + prevBigText: '<<', prevBigStatus: '顯示上一年', + nextText: '下月>', nextStatus: '顯示下月', + nextBigText: '>>', nextBigStatus: '顯示下一年', + currentText: '今天', currentStatus: '顯示本月', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一','二','三','四','五','六', + '七','八','九','十','十一','十二'], + monthStatus: '選擇月份', yearStatus: '選擇年份', + weekHeader: '周', weekStatus: '年內周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + dayStatus: '設定 DD 為一周起始', dateStatus: '選擇 m月 d日, DD', + dateFormat: 'yy/mm/dd', firstDay: 1, + initStatus: '請選擇日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-TW']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ar.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ar.js new file mode 100644 index 000000000..52101e921 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ar.js @@ -0,0 +1,26 @@ +/* Arabic Translation for jQuery UI date picker plugin. */ +/* Khaled Al Horani -- koko.dw@gmail.com */ +/* خالد الحوراني -- koko.dw@gmail.com */ +/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ +jQuery(function($){ + $.datepicker.regional['ar'] = { + clearText: 'مسح', clearStatus: 'امسح التاريخ الحالي', + closeText: 'إغلاق', closeStatus: 'إغلاق بدون حفظ', + prevText: '<السابق', prevStatus: 'عرض الشهر السابق', + prevBigText: '<<', prevBigStatus: '', + nextText: 'التالي>', nextStatus: 'عرض الشهر القادم', + nextBigText: '>>', nextBigStatus: '', + currentText: 'اليوم', currentStatus: 'عرض الشهر الحالي', + monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران', + 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], + monthStatus: 'عرض شهر آخر', yearStatus: 'عرض سنة آخرى', + weekHeader: 'أسبوع', weekStatus: 'أسبوع السنة', + dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'], + dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], + dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], + dayStatus: 'اختر DD لليوم الأول من الأسبوع', dateStatus: 'اختر D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'اختر يوم', isRTL: true}; + $.datepicker.setDefaults($.datepicker.regional['ar']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-bg.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-bg.js new file mode 100644 index 000000000..f11de66bc --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-bg.js @@ -0,0 +1,25 @@ +/* Bulgarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Stoyan Kyosev (http://svest.org). */ +jQuery(function($){ + $.datepicker.regional['bg'] = { + clearText: 'изчисти', clearStatus: 'изчисти актуалната дата', + closeText: 'затвори', closeStatus: 'затвори без промени', + prevText: '<назад', prevStatus: 'покажи последния месец', + prevBigText: '<<', prevBigStatus: '', + nextText: 'напред>', nextStatus: 'покажи следващия месец', + nextBigText: '>>', nextBigStatus: '', + currentText: 'днес', currentStatus: '', + monthNames: ['Януари','Февруари','Март','Април','Май','Юни', + 'Юли','Август','Септември','Октомври','Ноември','Декември'], + monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', + 'Юли','Авг','Сеп','Окт','Нов','Дек'], + monthStatus: 'покажи друг месец', yearStatus: 'покажи друга година', + weekHeader: 'Wk', weekStatus: 'седмица от месеца', + dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], + dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], + dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], + dayStatus: 'Сложи DD като първи ден от седмицата', dateStatus: 'Избери D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Избери дата', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['bg']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ca.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ca.js new file mode 100644 index 000000000..414600f23 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ca.js @@ -0,0 +1,25 @@ +/* Inicialitzaci en catal per a l'extenci 'calendar' per jQuery. */ +/* Writers: (joan.leon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ca'] = { + clearText: 'Netejar', clearStatus: '', + closeText: 'Tancar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Seg>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Avui', currentStatus: '', + monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny', + 'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'], + monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Oct','Nov','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], + dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], + dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ca']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-cs.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-cs.js new file mode 100644 index 000000000..1f5118f1c --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-cs.js @@ -0,0 +1,25 @@ +/* Czech initialisation for the jQuery UI date picker plugin. */ +/* Written by Tomas Muller (tomas@tomas-muller.net). */ +jQuery(function($){ + $.datepicker.regional['cs'] = { + clearText: 'Vymazat', clearStatus: 'Vymaže zadané datum', + closeText: 'Zavřít', closeStatus: 'Zavře kalendář beze změny', + prevText: '<Dříve', prevStatus: 'Přejít na předchozí měsí', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Později>', nextStatus: 'Přejít na další měsíc', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Nyní', currentStatus: 'Přejde na aktuální měsíc', + monthNames: ['leden','únor','březen','duben','květen','červen', + 'červenec','srpen','září','říjen','listopad','prosinec'], + monthNamesShort: ['led','úno','bře','dub','kvě','čer', + 'čvc','srp','zář','říj','lis','pro'], + monthStatus: 'Přejít na jiný měsíc', yearStatus: 'Přejít na jiný rok', + weekHeader: 'Týd', weekStatus: 'Týden v roce', + dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], + dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], + dayNamesMin: ['ne','po','út','st','čt','pá','so'], + dayStatus: 'Nastavit DD jako první den v týdnu', dateStatus: '\'Vyber\' DD, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Vyberte datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['cs']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-da.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-da.js new file mode 100644 index 000000000..525f3de3c --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-da.js @@ -0,0 +1,25 @@ +/* Danish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jan Christensen ( deletestuff@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['da'] = { + clearText: 'Nulstil', clearStatus: 'Nulstil den aktuelle dato', + closeText: 'Luk', closeStatus: 'Luk uden ændringer', + prevText: '<Forrige', prevStatus: 'Vis forrige måned', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Næste>', nextStatus: 'Vis næste måned', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Idag', currentStatus: 'Vis aktuel måned', + monthNames: ['Januar','Februar','Marts','April','Maj','Juni', + 'Juli','August','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: 'Vis en anden måned', yearStatus: 'Vis et andet år', + weekHeader: 'Uge', weekStatus: 'Årets uge', + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'Sæt DD som første ugedag', dateStatus: 'Vælg D, M d', + dateFormat: 'dd-mm-yy', firstDay: 0, + initStatus: 'Vælg en dato', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['da']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-de.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-de.js new file mode 100644 index 000000000..ce8f78391 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-de.js @@ -0,0 +1,25 @@ +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +jQuery(function($){ + $.datepicker.regional['de'] = { + clearText: 'löschen', clearStatus: 'aktuelles Datum löschen', + closeText: 'schließen', closeStatus: 'ohne Änderungen schließen', + prevText: '<zurück', prevStatus: 'letzten Monat zeigen', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen', + nextBigText: '>>', nextBigStatus: '', + currentText: 'heute', currentStatus: '', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen', + weekHeader: 'Wo', weekStatus: 'Woche des Monats', + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Wähle ein Datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['de']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-eo.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-eo.js new file mode 100644 index 000000000..42e9118ab --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-eo.js @@ -0,0 +1,25 @@ +/* Esperanto initialisation for the jQuery UI date picker plugin. */ +/* Written by Olivier M. (olivierweb@ifrance.com). */ +jQuery(function($){ + $.datepicker.regional['eo'] = { + clearText: 'Vakigi', clearStatus: '', + closeText: 'Fermi', closeStatus: 'Fermi sen modifi', + prevText: '<Anta', prevStatus: 'Vidi la antaŭan monaton', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Sekv>', nextStatus: 'Vidi la sekvan monaton', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Nuna', currentStatus: 'Vidi la nunan monaton', + monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', + 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aŭg','Sep','Okt','Nov','Dec'], + monthStatus: 'Vidi alian monaton', yearStatus: 'Vidi alian jaron', + weekHeader: 'Sb', weekStatus: '', + dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], + dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], + dayStatus: 'Uzi DD kiel unua tago de la semajno', dateStatus: 'Elekti DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Elekti la daton', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['eo']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-es.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-es.js new file mode 100644 index 000000000..7d0199279 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-es.js @@ -0,0 +1,25 @@ +/* Inicializacin en espaol para la extensin 'UI date picker' para jQuery. */ +/* Traducido por Vester (xvester@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['es'] = { + clearText: 'Limpiar', clearStatus: '', + closeText: 'Cerrar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Sig>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Hoy', currentStatus: '', + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', + 'Jul','Ago','Sep','Oct','Nov','Dic'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['es']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-fa.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-fa.js new file mode 100644 index 000000000..0ce4c7c98 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-fa.js @@ -0,0 +1,25 @@ +/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ +/* Javad Mowlanezhad -- jmowla@gmail.com */ +/* Jalali calendar should supported soon! (Its implemented but I have to test it) */ +jQuery(function($) { + $.datepicker.regional['fa'] = { + clearText: 'حذف تاريخ', clearStatus: 'پاک کردن تاريخ جاري', + closeText: 'بستن', closeStatus: 'بستن بدون اعمال تغييرات', + prevText: '<قبلي', prevStatus: 'نمايش ماه قبل', + prevBigText: '<<', prevBigStatus: '', + nextText: 'بعدي>', nextStatus: 'نمايش ماه بعد', + nextBigText: '>>', nextBigStatus: '', + currentText: 'امروز', currentStatus: 'نمايش ماه جاري', + monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور', + 'مهر','آبان','آذر','دي','بهمن','اسفند'], + monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], + monthStatus: 'نمايش ماه متفاوت', yearStatus: 'نمايش سال متفاوت', + weekHeader: 'هف', weekStatus: 'هفتهِ سال', + dayNames: ['يکشنبه','دوشنبه','سه‌شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'], + dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'], + dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'], + dayStatus: 'قبول DD بعنوان اولين روز هفته', dateStatus: 'انتخاب D, M d', + dateFormat: 'yy/mm/dd', firstDay: 6, + initStatus: 'انتخاب تاريخ', isRTL: true}; + $.datepicker.setDefaults($.datepicker.regional['fa']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-fi.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-fi.js new file mode 100644 index 000000000..8dc39c5be --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-fi.js @@ -0,0 +1,25 @@ +/* Finnish initialisation for the jQuery UI date picker plugin. */ +/* Written by Harri Kilpi (harrikilpio@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['fi'] = { + clearText: 'Tyhjennä', clearStatus: '', + closeText: 'Sulje', closeStatus: '', + prevText: '«Edellinen', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Seuraava»', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Tänään', currentStatus: '', + monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', + 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], + monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', + 'Heinä','Elo','Syys','Loka','Marras','Joulu'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vk', weekStatus: '', + dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], + dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], + dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fi']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-fr.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-fr.js new file mode 100644 index 000000000..512229d4f --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-fr.js @@ -0,0 +1,25 @@ +/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood@virginbroadband.com.au) and Stéphane Nahmani (sholby@sholby.net). */ +jQuery(function($){ + $.datepicker.regional['fr'] = { + clearText: 'Effacer', clearStatus: 'Effacer la date sélectionnée', + closeText: 'Fermer', closeStatus: 'Fermer sans modifier', + prevText: '<Préc', prevStatus: 'Voir le mois précédent', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Suiv>', nextStatus: 'Voir le mois suivant', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Courant', currentStatus: 'Voir le mois courant', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', + 'Jul','Aoû','Sep','Oct','Nov','Déc'], + monthStatus: 'Voir un autre mois', yearStatus: 'Voir une autre année', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: '\'Choisir\' le DD d MM', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: 'Choisir la date', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fr']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-he.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-he.js new file mode 100644 index 000000000..929e87c92 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-he.js @@ -0,0 +1,25 @@ +/* Hebrew initialisation for the UI Datepicker extension. */ +/* Written by Amir Hardon (ahardon at gmail dot com). */ +jQuery(function($){ + $.datepicker.regional['he'] = { + clearText: 'נקה', clearStatus: '', + closeText: 'סגור', closeStatus: '', + prevText: '<הקודם', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'הבא>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'היום', currentStatus: '', + monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', + 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], + monthNamesShort: ['1','2','3','4','5','6', + '7','8','9','10','11','12'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], + dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + dayStatus: 'DD', dateStatus: 'DD, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: true}; + $.datepicker.setDefaults($.datepicker.regional['he']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-hr.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-hr.js new file mode 100644 index 000000000..597aa4ae6 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-hr.js @@ -0,0 +1,25 @@ +/* Croatian i18n for the jQuery UI date picker plugin. */ +/* Written by Vjekoslav Nesek. */ +jQuery(function($){ + $.datepicker.regional['hr'] = { + clearText: 'izbriši', clearStatus: 'Izbriši trenutni datum', + closeText: 'Zatvori', closeStatus: 'Zatvori kalendar', + prevText: '<', prevStatus: 'Prikaži prethodni mjesec', + prevBigText: '<<', prevBigStatus: '', + nextText: '>', nextStatus: 'Prikaži slijedeći mjesec', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Danas', currentStatus: 'Današnji datum', + monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani', + 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], + monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', + 'Srp','Kol','Ruj','Lis','Stu','Pro'], + monthStatus: 'Prikaži mjesece', yearStatus: 'Prikaži godine', + weekHeader: 'Tje', weekStatus: 'Tjedan', + dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], + dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], + dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], + dayStatus: 'Odaber DD za prvi dan tjedna', dateStatus: '\'Datum\' D, M d', + dateFormat: 'dd.mm.yy.', firstDay: 1, + initStatus: 'Odaberi datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hr']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-hu.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-hu.js new file mode 100644 index 000000000..29f2ad375 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-hu.js @@ -0,0 +1,25 @@ +/* Hungarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */ +jQuery(function($){ + $.datepicker.regional['hu'] = { + clearText: 'törlés', clearStatus: '', + closeText: 'bezárás', closeStatus: '', + prevText: '« vissza', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'előre »', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'ma', currentStatus: '', + monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', + 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', + 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Hé', weekStatus: '', + dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], + dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], + dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hu']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-hy.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-hy.js new file mode 100644 index 000000000..2022efb49 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-hy.js @@ -0,0 +1,25 @@ +/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ +jQuery(function($){ + $.datepicker.regional['hy'] = { + clearText: 'Մաքրել', clearStatus: '', + closeText: 'Փակել', closeStatus: '', + prevText: '<Նախ.', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Հաջ.>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Այսօր', currentStatus: '', + monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', + 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], + monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', + 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], + monthStatus: '', yearStatus: '', + weekHeader: 'ՇԲՏ', weekStatus: '', + dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], + dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hy']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-id.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-id.js new file mode 100644 index 000000000..7ff1a3a9e --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-id.js @@ -0,0 +1,25 @@ +/* Indonesian initialisation for the jQuery UI date picker plugin. */ +/* Written by Deden Fathurahman (dedenf@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['id'] = { + clearText: 'kosongkan', clearStatus: 'bersihkan tanggal yang sekarang', + closeText: 'Tutup', closeStatus: 'Tutup tanpa mengubah', + prevText: '<mundur', prevStatus: 'Tampilkan bulan sebelumnya', + prevBigText: '<<', prevBigStatus: '', + nextText: 'maju>', nextStatus: 'Tampilkan bulan berikutnya', + nextBigText: '>>', nextBigStatus: '', + currentText: 'hari ini', currentStatus: 'Tampilkan bulan sekarang', + monthNames: ['Januari','Februari','Maret','April','Mei','Juni', + 'Juli','Agustus','September','Oktober','Nopember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Agus','Sep','Okt','Nop','Des'], + monthStatus: 'Tampilkan bulan yang berbeda', yearStatus: 'Tampilkan tahun yang berbeda', + weekHeader: 'Mg', weekStatus: 'Minggu dalam tahun', + dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], + dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], + dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], + dayStatus: 'gunakan DD sebagai awal hari dalam minggu', dateStatus: 'pilih le DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Pilih Tanggal', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['id']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-is.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-is.js new file mode 100644 index 000000000..4647f37e9 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-is.js @@ -0,0 +1,25 @@ +/* Icelandic initialisation for the jQuery UI date picker plugin. */ +/* Written by Haukur H. Thorsson (haukur@eskill.is). */ +jQuery(function($){ + $.datepicker.regional['is'] = { + clearText: 'Hreinsa', clearStatus: '', + closeText: 'Loka', closeStatus: '', + prevText: '< Fyrri', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Næsti >', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Í dag', currentStatus: '', + monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', + 'Júlí','Ágúst','September','Október','Nóvember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', + 'Júl','Ágú','Sep','Okt','Nóv','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vika', weekStatus: '', + dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], + dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], + dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['is']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-it.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-it.js new file mode 100644 index 000000000..fb05f5f80 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-it.js @@ -0,0 +1,25 @@ +/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Apaella (apaella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it'] = { + clearText: 'Svuota', clearStatus: 'Annulla', + closeText: 'Chiudi', closeStatus: 'Chiudere senza modificare', + prevText: '<Prec', prevStatus: 'Mese precedente', + prevBigText: '<<', prevBigStatus: 'Mostra l\'anno precedente', + nextText: 'Succ>', nextStatus: 'Mese successivo', + nextBigText: '>>', nextBigStatus: 'Mostra l\'anno successivo', + currentText: 'Oggi', currentStatus: 'Mese corrente', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + monthStatus: 'Seleziona un altro mese', yearStatus: 'Seleziona un altro anno', + weekHeader: 'Sm', weekStatus: 'Settimana dell\'anno', + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'], + dayStatus: 'Usa DD come primo giorno della settimana', dateStatus: '\'Seleziona\' D, M d', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: 'Scegliere una data', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['it']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ja.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ja.js new file mode 100644 index 000000000..1ecf40221 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ja.js @@ -0,0 +1,26 @@ +/* Japanese initialisation for the jQuery UI date picker plugin. */ +/* Written by Kentaro SATO (kentaro@ranvis.com). */ +jQuery(function($){ + $.datepicker.regional['ja'] = { + clearText: 'クリア', clearStatus: '日付をクリアします', + closeText: '閉じる', closeStatus: '変更せずに閉じます', + prevText: '<前', prevStatus: '前月を表示します', + prevBigText: '<<', prevBigStatus: '前年を表示します', + nextText: '次>', nextStatus: '翌月を表示します', + nextBigText: '>>', nextBigStatus: '翌年を表示します', + currentText: '今日', currentStatus: '今月を表示します', + monthNames: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthNamesShort: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthStatus: '表示する月を変更します', yearStatus: '表示する年を変更します', + weekHeader: '週', weekStatus: '暦週で第何週目かを表します', + dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], + dayNamesShort: ['日','月','火','水','木','金','土'], + dayNamesMin: ['日','月','火','水','木','金','土'], + dayStatus: '週の始まりをDDにします', dateStatus: 'Md日(D)', + dateFormat: 'yy/mm/dd', firstDay: 0, + initStatus: '日付を選択します', isRTL: false, + showMonthAfterYear: true}; + $.datepicker.setDefaults($.datepicker.regional['ja']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ko.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ko.js new file mode 100644 index 000000000..b380311cf --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ko.js @@ -0,0 +1,25 @@ +/* Korean initialisation for the jQuery calendar extension. */ +/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ko'] = { + clearText: '지우기', clearStatus: '', + closeText: '닫기', closeStatus: '', + prevText: '이전달', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: '다음달', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: '오늘', currentStatus: '', + monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', + '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], + monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', + '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], + monthStatus: '', yearStatus: '', + weekHeader: 'Wk', weekStatus: '', + dayNames: ['일','월','화','수','목','금','토'], + dayNamesShort: ['일','월','화','수','목','금','토'], + dayNamesMin: ['일','월','화','수','목','금','토'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ko']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-lt.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-lt.js new file mode 100644 index 000000000..ab5ee859c --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-lt.js @@ -0,0 +1,25 @@ +/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* @author Arturas Paleicikas */ +jQuery(function($){ + $.datepicker.regional['lt'] = { + clearText: 'Išvalyti', clearStatus: '', + closeText: 'Uždaryti', closeStatus: '', + prevText: '<Atgal', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Pirmyn>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Šiandien', currentStatus: '', + monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', + 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], + monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', + 'Lie','Rugp','Rugs','Spa','Lap','Gru'], + monthStatus: '', yearStatus: '', + weekHeader: '', weekStatus: '', + dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], + dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], + dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lt']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-lv.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-lv.js new file mode 100644 index 000000000..981d42b8d --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-lv.js @@ -0,0 +1,25 @@ +/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* @author Arturas Paleicikas */ +jQuery(function($){ + $.datepicker.regional['lv'] = { + clearText: 'Notīrīt', clearStatus: '', + closeText: 'Aizvērt', closeStatus: '', + prevText: 'Iepr', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nāka', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Šodien', currentStatus: '', + monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', + 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', + 'Jūl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Nav', weekStatus: '', + dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], + dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], + dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd-mm-yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lv']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-nl.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-nl.js new file mode 100644 index 000000000..200974e7c --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-nl.js @@ -0,0 +1,25 @@ +/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Mathias Bynens */ +jQuery(function($){ + $.datepicker.regional.nl = { + clearText: 'Wissen', clearStatus: 'Wis de huidige datum', + closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering', + prevText: '←', prevStatus: 'Bekijk de vorige maand', + prevBigText: '«', nextBigStatus: 'Bekijk het vorige jaar', + nextText: '→', nextStatus: 'Bekijk de volgende maand', + nextBigText: '»', nextBigStatus: 'Bekijk het volgende jaar', + currentText: 'Vandaag', currentStatus: 'Bekijk de huidige maand', + monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', + 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + monthStatus: 'Bekijk een andere maand', yearStatus: 'Bekijk een ander jaar', + weekHeader: 'Wk', weekStatus: 'Week van het jaar', + dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], + dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + dayStatus: 'Stel DD in als eerste dag van de week', dateStatus: 'dd/mm/yy', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: 'Kies een datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional.nl); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-no.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-no.js new file mode 100644 index 000000000..e9a05e838 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-no.js @@ -0,0 +1,25 @@ +/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['no'] = { + clearText: 'Tøm', clearStatus: '', + closeText: 'Lukk', closeStatus: '', + prevText: '«Forrige', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Neste»', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'I dag', currentStatus: '', + monthNames: ['Januar','Februar','Mars','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Uke', weekStatus: '', + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['no']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-pl.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-pl.js new file mode 100644 index 000000000..b8503af84 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-pl.js @@ -0,0 +1,25 @@ +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = { + clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę', + closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania', + prevText: '<Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Następny>', nextStatus: 'Pokaż następny miesiąc', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok', + weekHeader: 'Tydz', weekStatus: 'Tydzień roku', + dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: '\'Wybierz\' D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: 'Wybierz datę', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pl']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-pt.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-pt.js new file mode 100644 index 000000000..484743afe --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-pt.js @@ -0,0 +1,25 @@ +/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = { + clearText: 'Limpar', clearStatus: '', + closeText: 'Fechar', closeStatus: '', + prevText: '<Anterior', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Próximo>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Hoje', currentStatus: '', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ro.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ro.js new file mode 100644 index 000000000..5a0eeaf26 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ro.js @@ -0,0 +1,25 @@ +/* Romanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Edmond L. (ll_edmond@walla.com). */ +jQuery(function($){ + $.datepicker.regional['ro'] = { + clearText: 'Curat', clearStatus: 'Sterge data curenta', + closeText: 'Inchide', closeStatus: 'Inchide fara schimbare', + prevText: '<Anterior', prevStatus: 'Arata luna trecuta', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Urmator>', nextStatus: 'Arata luna urmatoare', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Azi', currentStatus: 'Arata luna curenta', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie', + 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], + monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit', + weekHeader: 'Sapt', weekStatus: 'Saptamana anului', + dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'], + dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: 'Selecteaza o data', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ro']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-ru.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-ru.js new file mode 100644 index 000000000..d52248347 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-ru.js @@ -0,0 +1,25 @@ +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = { + clearText: 'Очистить', clearStatus: '', + closeText: 'Закрыть', closeStatus: '', + prevText: '<Пред', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'След>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Сегодня', currentStatus: '', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ru']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-sk.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-sk.js new file mode 100644 index 000000000..315f60b94 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-sk.js @@ -0,0 +1,25 @@ +/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = { + clearText: 'Zmazať', clearStatus: '', + closeText: 'Zavrieť', closeStatus: '', + prevText: '<Predchádzajúci', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nasledujúci>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Dnes', currentStatus: '', + monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', + 'Júl','August','September','Október','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ty', weekStatus: '', + dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sk']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-sl.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-sl.js new file mode 100644 index 000000000..36eca54bf --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-sl.js @@ -0,0 +1,26 @@ +/* Slovenian initialisation for the jQuery UI date picker plugin. */ +/* Written by Jaka Jancar (jaka@kubje.org). */ +/* c = č, s = š z = ž C = Č S = Š Z = Ž */ +jQuery(function($){ + $.datepicker.regional['sl'] = { + clearText: 'Izbriši', clearStatus: 'Izbriši trenutni datum', + closeText: 'Zapri', closeStatus: 'Zapri brez spreminjanja', + prevText: '<Prejšnji', prevStatus: 'Prikaži prejšnji mesec', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Naslednji>', nextStatus: 'Prikaži naslednji mesec', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Trenutni', currentStatus: 'Prikaži trenutni mesec', + monthNames: ['Januar','Februar','Marec','April','Maj','Junij', + 'Julij','Avgust','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Avg','Sep','Okt','Nov','Dec'], + monthStatus: 'Prikaži drug mesec', yearStatus: 'Prikaži drugo leto', + weekHeader: 'Teden', weekStatus: 'Teden v letu', + dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'], + dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'], + dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'], + dayStatus: 'Nastavi DD za prvi dan v tednu', dateStatus: 'Izberi DD, d MM yy', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Izbira datuma', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sl']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-sq.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-sq.js new file mode 100644 index 000000000..49a1ac66f --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-sq.js @@ -0,0 +1,25 @@ +/* Albanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Flakron Bytyqi (flakron@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['sq'] = { + clearText: 'fshije', clearStatus: 'fshije datën aktuale', + closeText: 'mbylle', closeStatus: 'mbylle pa ndryshime', + prevText: '<mbrapa', prevStatus: 'trego muajin e fundit', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Përpara>', nextStatus: 'trego muajin tjetër', + nextBigText: '>>', nextBigStatus: '', + currentText: 'sot', currentStatus: '', + monthNames: ['Janar','Shkurt','Mars','Pril','Maj','Qershor', + 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], + monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', + 'Kor','Gus','Sht','Tet','Nën','Dhj'], + monthStatus: 'trego muajin tjetër', yearStatus: 'trego tjetër vit', + weekHeader: 'Ja', weekStatus: 'Java e muajit', + dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], + dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], + dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], + dayStatus: 'Vendose DD si ditë të parë të javës', dateStatus: '\'Zgjedh\' D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Zgjedhe një datë', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sq']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-sv.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-sv.js new file mode 100644 index 000000000..c51cc9611 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-sv.js @@ -0,0 +1,25 @@ +/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +jQuery(function($){ + $.datepicker.regional['se'] = { + clearText: 'Rensa', clearStatus: '', + closeText: 'Stäng', closeStatus: '', + prevText: '«Förra', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Nästa»', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Idag', currentStatus: '', + monthNames: ['Januari','Februari','Mars','April','Maj','Juni', + 'Juli','Augusti','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ve', weekStatus: '', + dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], + dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], + dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['se']); +}); diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-th.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-th.js new file mode 100644 index 000000000..8801f85d6 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-th.js @@ -0,0 +1,25 @@ +/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = { + clearText: 'ลบ', clearStatus: '', + closeText: 'ปิด', closeStatus: '', + prevText: '« ย้อน', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'ถัดไป »', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'วันนี้', currentStatus: '', + monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], + monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], + dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['th']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-tr.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-tr.js new file mode 100644 index 000000000..c4e115ef9 --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-tr.js @@ -0,0 +1,25 @@ +/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = { + clearText: 'temizle', clearStatus: 'geçerli tarihi temizler', + closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat', + prevText: '<geri', prevStatus: 'önceki ayı göster', + prevBigText: '<<', prevBigStatus: '', + nextText: 'ileri>', nextStatus: 'sonraki ayı göster', + nextBigText: '>>', nextBigStatus: '', + currentText: 'bugün', currentStatus: '', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + monthStatus: 'başka ay', yearStatus: 'başka yıl', + weekHeader: 'Hf', weekStatus: 'Ayın haftaları', + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Bir tarih seçiniz', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['tr']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-uk.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-uk.js new file mode 100644 index 000000000..59c3d71cc --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-uk.js @@ -0,0 +1,25 @@ +/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['uk'] = { + clearText: 'Очистити', clearStatus: '', + closeText: 'Закрити', closeStatus: '', + prevText: '<', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: '>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Сьогодні', currentStatus: '', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['uk']); +}); \ No newline at end of file diff --git a/js/jquery/datepicker/ui/i18n/ui.datepicker-zh.js b/js/jquery/datepicker/ui/i18n/ui.datepicker-zh.js new file mode 100644 index 000000000..d24ee268b --- /dev/null +++ b/js/jquery/datepicker/ui/i18n/ui.datepicker-zh.js @@ -0,0 +1,25 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = { + clearText: '清除', clearStatus: '清除已选日期', + closeText: '关闭', closeStatus: '不改变当前选择', + prevText: '<上月', prevStatus: '显示上月', + prevBigText: '<<', prevBigStatus: '显示上一年', + nextText: '下月>', nextStatus: '显示下月', + nextBigText: '>>', nextBigStatus: '显示下一年', + currentText: '今天', currentStatus: '显示本月', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一','二','三','四','五','六', + '七','八','九','十','十一','十二'], + monthStatus: '选择月份', yearStatus: '选择年份', + weekHeader: '周', weekStatus: '年内周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '请选择日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +}); diff --git a/js/jquery/datepicker/ui/index.php b/js/jquery/datepicker/ui/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/jquery/datepicker/ui/index.php @@ -0,0 +1,11 @@ +1){j--}if(6*j<1){return i+(Z-i)*6*j}else{if(2*j<1){return Z}else{if(3*j<2){return i+(Z-i)*(2/3-j)*6}else{return i}}}}function Y(Z){var AE,p=1;Z=String(Z);if(Z.charAt(0)=="#"){AE=Z}else{if(/^rgb/.test(Z)){var m=g(Z);var AE="#",AF;for(var j=0;j<3;j++){if(m[j].indexOf("%")!=-1){AF=Math.floor(C(m[j])*255)}else{AF=Number(m[j])}AE+=I[N(AF,0,255)]}p=m[3]}else{if(/^hsl/.test(Z)){var m=g(Z);AE=c(m);p=m[3]}else{AE=B[Z]||Z}}}return{color:AE,alpha:p}}var L={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var f={};function X(Z){if(f[Z]){return f[Z]}var m=document.createElement("div");var j=m.style;try{j.font=Z}catch(i){}return f[Z]={style:j.fontStyle||L.style,variant:j.fontVariant||L.variant,weight:j.fontWeight||L.weight,size:j.fontSize||L.size,family:j.fontFamily||L.family}}function P(j,i){var Z={};for(var AF in j){Z[AF]=j[AF]}var AE=parseFloat(i.currentStyle.fontSize),m=parseFloat(j.size);if(typeof j.size=="number"){Z.size=j.size}else{if(j.size.indexOf("px")!=-1){Z.size=m}else{if(j.size.indexOf("em")!=-1){Z.size=AE*m}else{if(j.size.indexOf("%")!=-1){Z.size=(AE/100)*m}else{if(j.size.indexOf("pt")!=-1){Z.size=m/0.75}else{Z.size=AE}}}}}Z.size*=0.981;return Z}function AA(Z){return Z.style+" "+Z.variant+" "+Z.weight+" "+Z.size+"px "+Z.family}function t(Z){switch(Z){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function W(i){this.m_=V();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=D*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var Z=i.ownerDocument.createElement("div");Z.style.width=i.clientWidth+"px";Z.style.height=i.clientHeight+"px";Z.style.overflow="hidden";Z.style.position="absolute";i.appendChild(Z);this.element_=Z;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var M=W.prototype;M.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};M.beginPath=function(){this.currentPath_=[]};M.moveTo=function(i,Z){var j=this.getCoords_(i,Z);this.currentPath_.push({type:"moveTo",x:j.x,y:j.y});this.currentX_=j.x;this.currentY_=j.y};M.lineTo=function(i,Z){var j=this.getCoords_(i,Z);this.currentPath_.push({type:"lineTo",x:j.x,y:j.y});this.currentX_=j.x;this.currentY_=j.y};M.bezierCurveTo=function(j,i,AI,AH,AG,AE){var Z=this.getCoords_(AG,AE);var AF=this.getCoords_(j,i);var m=this.getCoords_(AI,AH);e(this,AF,m,Z)};function e(Z,m,j,i){Z.currentPath_.push({type:"bezierCurveTo",cp1x:m.x,cp1y:m.y,cp2x:j.x,cp2y:j.y,x:i.x,y:i.y});Z.currentX_=i.x;Z.currentY_=i.y}M.quadraticCurveTo=function(AG,j,i,Z){var AF=this.getCoords_(AG,j);var AE=this.getCoords_(i,Z);var AH={x:this.currentX_+2/3*(AF.x-this.currentX_),y:this.currentY_+2/3*(AF.y-this.currentY_)};var m={x:AH.x+(AE.x-this.currentX_)/3,y:AH.y+(AE.y-this.currentY_)/3};e(this,AH,m,AE)};M.arc=function(AJ,AH,AI,AE,i,j){AI*=D;var AN=j?"at":"wa";var AK=AJ+U(AE)*AI-F;var AM=AH+J(AE)*AI-F;var Z=AJ+U(i)*AI-F;var AL=AH+J(i)*AI-F;if(AK==Z&&!j){AK+=0.125}var m=this.getCoords_(AJ,AH);var AG=this.getCoords_(AK,AM);var AF=this.getCoords_(Z,AL);this.currentPath_.push({type:AN,x:m.x,y:m.y,radius:AI,xStart:AG.x,yStart:AG.y,xEnd:AF.x,yEnd:AF.y})};M.rect=function(j,i,Z,m){this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath()};M.strokeRect=function(j,i,Z,m){var p=this.currentPath_;this.beginPath();this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath();this.stroke();this.currentPath_=p};M.fillRect=function(j,i,Z,m){var p=this.currentPath_;this.beginPath();this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath();this.fill();this.currentPath_=p};M.createLinearGradient=function(i,m,Z,j){var p=new v("gradient");p.x0_=i;p.y0_=m;p.x1_=Z;p.y1_=j;return p};M.createRadialGradient=function(m,AE,j,i,p,Z){var AF=new v("gradientradial");AF.x0_=m;AF.y0_=AE;AF.r0_=j;AF.x1_=i;AF.y1_=p;AF.r1_=Z;return AF};M.drawImage=function(AO,j){var AH,AF,AJ,AV,AM,AK,AQ,AX;var AI=AO.runtimeStyle.width;var AN=AO.runtimeStyle.height;AO.runtimeStyle.width="auto";AO.runtimeStyle.height="auto";var AG=AO.width;var AT=AO.height;AO.runtimeStyle.width=AI;AO.runtimeStyle.height=AN;if(arguments.length==3){AH=arguments[1];AF=arguments[2];AM=AK=0;AQ=AJ=AG;AX=AV=AT}else{if(arguments.length==5){AH=arguments[1];AF=arguments[2];AJ=arguments[3];AV=arguments[4];AM=AK=0;AQ=AG;AX=AT}else{if(arguments.length==9){AM=arguments[1];AK=arguments[2];AQ=arguments[3];AX=arguments[4];AH=arguments[5];AF=arguments[6];AJ=arguments[7];AV=arguments[8]}else{throw Error("Invalid number of arguments")}}}var AW=this.getCoords_(AH,AF);var m=AQ/2;var i=AX/2;var AU=[];var Z=10;var AE=10;AU.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",AU.join(""))};M.stroke=function(AM){var m=10;var AN=10;var AE=5000;var AG={x:null,y:null};var AL={x:null,y:null};for(var AH=0;AHAL.x){AL.x=Z.x}if(AG.y==null||Z.yAL.y){AL.y=Z.y}}}AK.push(' ">');if(!AM){R(this,AK)}else{a(this,AK,AG,AL)}AK.push("");this.element_.insertAdjacentHTML("beforeEnd",AK.join(""))}};function R(j,AE){var i=Y(j.strokeStyle);var m=i.color;var p=i.alpha*j.globalAlpha;var Z=j.lineScale_*j.lineWidth;if(Z<1){p*=Z}AE.push("')}function a(AO,AG,Ah,AP){var AH=AO.fillStyle;var AY=AO.arcScaleX_;var AX=AO.arcScaleY_;var Z=AP.x-Ah.x;var m=AP.y-Ah.y;if(AH instanceof v){var AL=0;var Ac={x:0,y:0};var AU=0;var AK=1;if(AH.type_=="gradient"){var AJ=AH.x0_/AY;var j=AH.y0_/AX;var AI=AH.x1_/AY;var Aj=AH.y1_/AX;var Ag=AO.getCoords_(AJ,j);var Af=AO.getCoords_(AI,Aj);var AE=Af.x-Ag.x;var p=Af.y-Ag.y;AL=Math.atan2(AE,p)*180/Math.PI;if(AL<0){AL+=360}if(AL<0.000001){AL=0}}else{var Ag=AO.getCoords_(AH.x0_,AH.y0_);Ac={x:(Ag.x-Ah.x)/Z,y:(Ag.y-Ah.y)/m};Z/=AY*D;m/=AX*D;var Aa=z.max(Z,m);AU=2*AH.r0_/Aa;AK=2*AH.r1_/Aa-AU}var AS=AH.colors_;AS.sort(function(Ak,i){return Ak.offset-i.offset});var AN=AS.length;var AR=AS[0].color;var AQ=AS[AN-1].color;var AW=AS[0].alpha*AO.globalAlpha;var AV=AS[AN-1].alpha*AO.globalAlpha;var Ab=[];for(var Ae=0;Ae')}else{if(AH instanceof u){if(Z&&m){var AF=-Ah.x;var AZ=-Ah.y;AG.push("')}}else{var Ai=Y(AO.fillStyle);var AT=Ai.color;var Ad=Ai.alpha*AO.globalAlpha;AG.push('')}}}M.fill=function(){this.stroke(true)};M.closePath=function(){this.currentPath_.push({type:"close"})};M.getCoords_=function(j,i){var Z=this.m_;return{x:D*(j*Z[0][0]+i*Z[1][0]+Z[2][0])-F,y:D*(j*Z[0][1]+i*Z[1][1]+Z[2][1])-F}};M.save=function(){var Z={};Q(this,Z);this.aStack_.push(Z);this.mStack_.push(this.m_);this.m_=d(V(),this.m_)};M.restore=function(){if(this.aStack_.length){Q(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function H(Z){return isFinite(Z[0][0])&&isFinite(Z[0][1])&&isFinite(Z[1][0])&&isFinite(Z[1][1])&&isFinite(Z[2][0])&&isFinite(Z[2][1])}function y(i,Z,j){if(!H(Z)){return }i.m_=Z;if(j){var p=Z[0][0]*Z[1][1]-Z[0][1]*Z[1][0];i.lineScale_=k(b(p))}}M.translate=function(j,i){var Z=[[1,0,0],[0,1,0],[j,i,1]];y(this,d(Z,this.m_),false)};M.rotate=function(i){var m=U(i);var j=J(i);var Z=[[m,j,0],[-j,m,0],[0,0,1]];y(this,d(Z,this.m_),false)};M.scale=function(j,i){this.arcScaleX_*=j;this.arcScaleY_*=i;var Z=[[j,0,0],[0,i,0],[0,0,1]];y(this,d(Z,this.m_),true)};M.transform=function(p,m,AF,AE,i,Z){var j=[[p,m,0],[AF,AE,0],[i,Z,1]];y(this,d(j,this.m_),true)};M.setTransform=function(AE,p,AG,AF,j,i){var Z=[[AE,p,0],[AG,AF,0],[j,i,1]];y(this,Z,true)};M.drawText_=function(AK,AI,AH,AN,AG){var AM=this.m_,AQ=1000,i=0,AP=AQ,AF={x:0,y:0},AE=[];var Z=P(X(this.font),this.element_);var j=AA(Z);var AR=this.element_.currentStyle;var p=this.textAlign.toLowerCase();switch(p){case"left":case"center":case"right":break;case"end":p=AR.direction=="ltr"?"right":"left";break;case"start":p=AR.direction=="rtl"?"right":"left";break;default:p="left"}switch(this.textBaseline){case"hanging":case"top":AF.y=Z.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":AF.y=-Z.size/2.25;break}switch(p){case"right":i=AQ;AP=0.05;break;case"center":i=AP=AQ/2;break}var AO=this.getCoords_(AI+AF.x,AH+AF.y);AE.push('');if(AG){R(this,AE)}else{a(this,AE,{x:-i,y:0},{x:AP,y:Z.size})}var AL=AM[0][0].toFixed(3)+","+AM[1][0].toFixed(3)+","+AM[0][1].toFixed(3)+","+AM[1][1].toFixed(3)+",0,0";var AJ=K(AO.x/D)+","+K(AO.y/D);AE.push('','','');this.element_.insertAdjacentHTML("beforeEnd",AE.join(""))};M.fillText=function(j,Z,m,i){this.drawText_(j,Z,m,i,false)};M.strokeText=function(j,Z,m,i){this.drawText_(j,Z,m,i,true)};M.measureText=function(j){if(!this.textMeasureEl_){var Z='';this.element_.insertAdjacentHTML("beforeEnd",Z);this.textMeasureEl_=this.element_.lastChild}var i=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(i.createTextNode(j));return{width:this.textMeasureEl_.offsetWidth}};M.clip=function(){};M.arcTo=function(){};M.createPattern=function(i,Z){return new u(i,Z)};function v(Z){this.type_=Z;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}v.prototype.addColorStop=function(i,Z){Z=Y(Z);this.colors_.push({offset:i,color:Z.color,alpha:Z.alpha})};function u(i,Z){q(i);switch(Z){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=Z;break;default:n("SYNTAX_ERR")}this.src_=i.src;this.width_=i.width;this.height_=i.height}function n(Z){throw new o(Z)}function q(Z){if(!Z||Z.nodeType!=1||Z.tagName!="IMG"){n("TYPE_MISMATCH_ERR")}if(Z.readyState!="complete"){n("INVALID_STATE_ERR")}}function o(Z){this.code=this[Z];this.message=Z+": DOM Exception "+this.code}var x=o.prototype=new Error;x.INDEX_SIZE_ERR=1;x.DOMSTRING_SIZE_ERR=2;x.HIERARCHY_REQUEST_ERR=3;x.WRONG_DOCUMENT_ERR=4;x.INVALID_CHARACTER_ERR=5;x.NO_DATA_ALLOWED_ERR=6;x.NO_MODIFICATION_ALLOWED_ERR=7;x.NOT_FOUND_ERR=8;x.NOT_SUPPORTED_ERR=9;x.INUSE_ATTRIBUTE_ERR=10;x.INVALID_STATE_ERR=11;x.SYNTAX_ERR=12;x.INVALID_MODIFICATION_ERR=13;x.NAMESPACE_ERR=14;x.INVALID_ACCESS_ERR=15;x.VALIDATION_ERR=16;x.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=E;CanvasRenderingContext2D=W;CanvasGradient=v;CanvasPattern=u;DOMException=o})()}; \ No newline at end of file diff --git a/js/jquery/fancybox/blank.gif b/js/jquery/fancybox/blank.gif new file mode 100644 index 000000000..35d42e808 Binary files /dev/null and b/js/jquery/fancybox/blank.gif differ diff --git a/js/jquery/fancybox/fancy_close.png b/js/jquery/fancybox/fancy_close.png new file mode 100644 index 000000000..07035307a Binary files /dev/null and b/js/jquery/fancybox/fancy_close.png differ diff --git a/js/jquery/fancybox/fancy_loading.png b/js/jquery/fancybox/fancy_loading.png new file mode 100644 index 000000000..250301796 Binary files /dev/null and b/js/jquery/fancybox/fancy_loading.png differ diff --git a/js/jquery/fancybox/fancy_nav_left.png b/js/jquery/fancybox/fancy_nav_left.png new file mode 100644 index 000000000..ebaa6a4fd Binary files /dev/null and b/js/jquery/fancybox/fancy_nav_left.png differ diff --git a/js/jquery/fancybox/fancy_nav_right.png b/js/jquery/fancybox/fancy_nav_right.png new file mode 100644 index 000000000..873294e96 Binary files /dev/null and b/js/jquery/fancybox/fancy_nav_right.png differ diff --git a/js/jquery/fancybox/fancy_shadow_e.png b/js/jquery/fancybox/fancy_shadow_e.png new file mode 100644 index 000000000..2eda08936 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_e.png differ diff --git a/js/jquery/fancybox/fancy_shadow_n.png b/js/jquery/fancybox/fancy_shadow_n.png new file mode 100644 index 000000000..69aa10e23 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_n.png differ diff --git a/js/jquery/fancybox/fancy_shadow_ne.png b/js/jquery/fancybox/fancy_shadow_ne.png new file mode 100644 index 000000000..79f6980a3 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_ne.png differ diff --git a/js/jquery/fancybox/fancy_shadow_nw.png b/js/jquery/fancybox/fancy_shadow_nw.png new file mode 100644 index 000000000..7182cd938 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_nw.png differ diff --git a/js/jquery/fancybox/fancy_shadow_s.png b/js/jquery/fancybox/fancy_shadow_s.png new file mode 100644 index 000000000..d8858bfb7 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_s.png differ diff --git a/js/jquery/fancybox/fancy_shadow_se.png b/js/jquery/fancybox/fancy_shadow_se.png new file mode 100644 index 000000000..541e3ffd3 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_se.png differ diff --git a/js/jquery/fancybox/fancy_shadow_sw.png b/js/jquery/fancybox/fancy_shadow_sw.png new file mode 100644 index 000000000..b451689fa Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_sw.png differ diff --git a/js/jquery/fancybox/fancy_shadow_w.png b/js/jquery/fancybox/fancy_shadow_w.png new file mode 100644 index 000000000..8a4e4a887 Binary files /dev/null and b/js/jquery/fancybox/fancy_shadow_w.png differ diff --git a/js/jquery/fancybox/fancy_title_left.png b/js/jquery/fancybox/fancy_title_left.png new file mode 100644 index 000000000..6049223d1 Binary files /dev/null and b/js/jquery/fancybox/fancy_title_left.png differ diff --git a/js/jquery/fancybox/fancy_title_main.png b/js/jquery/fancybox/fancy_title_main.png new file mode 100644 index 000000000..8044271f2 Binary files /dev/null and b/js/jquery/fancybox/fancy_title_main.png differ diff --git a/js/jquery/fancybox/fancy_title_over.png b/js/jquery/fancybox/fancy_title_over.png new file mode 100644 index 000000000..d9f458f4b Binary files /dev/null and b/js/jquery/fancybox/fancy_title_over.png differ diff --git a/js/jquery/fancybox/fancy_title_right.png b/js/jquery/fancybox/fancy_title_right.png new file mode 100644 index 000000000..e36d9db2a Binary files /dev/null and b/js/jquery/fancybox/fancy_title_right.png differ diff --git a/js/jquery/fancybox/fancybox-x.png b/js/jquery/fancybox/fancybox-x.png new file mode 100644 index 000000000..c2130f869 Binary files /dev/null and b/js/jquery/fancybox/fancybox-x.png differ diff --git a/js/jquery/fancybox/fancybox-y.png b/js/jquery/fancybox/fancybox-y.png new file mode 100644 index 000000000..7ef399b99 Binary files /dev/null and b/js/jquery/fancybox/fancybox-y.png differ diff --git a/js/jquery/fancybox/fancybox.png b/js/jquery/fancybox/fancybox.png new file mode 100644 index 000000000..65e14f68f Binary files /dev/null and b/js/jquery/fancybox/fancybox.png differ diff --git a/js/jquery/ifxtransfer.js b/js/jquery/ifxtransfer.js new file mode 100644 index 000000000..fb689214a --- /dev/null +++ b/js/jquery/ifxtransfer.js @@ -0,0 +1,13 @@ +/** + * Interface Elements for jQuery + * FX - transfer + * + * http://interface.eyecon.ro + * + * Copyright (c) 2006 Stefan Petre + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1.2=q;1.Q.P=i(o){p m.O(\'s\',i(){R 1.A.w(m,o)})};1.A.w=i(e,o){5(1.2==q){1(\'S\',n).V(\'\');1.2=1(\'#2\')}1.2.3(\'B\',\'T\').3(\'W\',\'L\');I z=m;z.c=1(e);5(!o||!o.4){p}5(o.4.H==K&&n.G(o.4)){o.4=n.G(o.4)}J 5(!o.4.M){p}5(!o.a){o.a=U}z.a=o.a;z.4=o.4;z.b=o.10;z.9=o.9;5(z.b){1.2.19(z.b)}z.g=0;z.h=0;5(1.18){z.g=(6(1.2.3(\'17\'))||0)+(6(1.2.3(\'1a\'))||0)+(6(1.2.3(\'X\'))||0)+(6(1.2.3(\'1d\'))||0);z.h=(6(1.2.3(\'1c\'))||0)+(6(1.2.3(\'16\'))||0)+(6(1.2.3(\'15\'))||0)+(6(1.2.3(\'Z\'))||0)}z.7=1.u(1.k.v(z.c.l(0)),1.k.r(z.c.l(0)));z.8=1.u(1.k.v(z.4),1.k.r(z.4));z.7.j-=z.g;z.7.d-=z.h;z.8.j-=z.g;z.8.d-=z.h;z.11=o.9;1.2.3(\'C\',z.7.j+\'f\').3(\'E\',z.7.d+\'f\').3(\'F\',z.7.y+\'f\').3(\'D\',z.7.x+\'f\').13({F:z.8.y,D:z.8.x,C:z.8.j,E:z.8.d},z.a,i(){5(z.b)1.2.1b(z.b);1.2.3(\'B\',\'1e\');5(z.9&&z.9.H==Y){z.9.14(z.c.l(0),[z.4])}1.12(z.c.l(0),\'s\')})};',62,77,'|jQuery|transferHelper|css|to|if|parseInt|start|end|complete|duration|classname|el|hb||px|diffWidth|diffHeight|function|wb|iUtil|get|this|document||return|null|getSize|interfaceFX|div|extend|getPosition|itransferTo||||fx|display|width|left|height|top|getElementById|constructor|var|else|String|absolute|childNodes|id|queue|TransferTo|fn|new|body|block|500|append|position|paddingLeft|Function|paddingBottom|className|callback|dequeue|animate|apply|paddingTop|borderBottomWidth|borderLeftWidth|boxModel|addClass|borderRightWidth|removeClass|borderTopWidth|paddingRight|none'.split('|'),0,{})) diff --git a/js/jquery/imgareaselect/border-anim-h.gif b/js/jquery/imgareaselect/border-anim-h.gif new file mode 100644 index 000000000..ec9f5da73 Binary files /dev/null and b/js/jquery/imgareaselect/border-anim-h.gif differ diff --git a/js/jquery/imgareaselect/border-anim-v.gif b/js/jquery/imgareaselect/border-anim-v.gif new file mode 100644 index 000000000..331cc90b0 Binary files /dev/null and b/js/jquery/imgareaselect/border-anim-v.gif differ diff --git a/js/jquery/imgareaselect/border-h.gif b/js/jquery/imgareaselect/border-h.gif new file mode 100644 index 000000000..a2aa5b0d0 Binary files /dev/null and b/js/jquery/imgareaselect/border-h.gif differ diff --git a/js/jquery/imgareaselect/border-v.gif b/js/jquery/imgareaselect/border-v.gif new file mode 100644 index 000000000..4bfd55564 Binary files /dev/null and b/js/jquery/imgareaselect/border-v.gif differ diff --git a/js/jquery/imgareaselect/imgareaselect-animated.css b/js/jquery/imgareaselect/imgareaselect-animated.css new file mode 100644 index 000000000..82d3d42fb --- /dev/null +++ b/js/jquery/imgareaselect/imgareaselect-animated.css @@ -0,0 +1,41 @@ +/* + * imgAreaSelect animated border style + */ + +.imgareaselect-border1 { + background: url(border-anim-v.gif) repeat-y left top; +} + +.imgareaselect-border2 { + background: url(border-anim-h.gif) repeat-x left top; +} + +.imgareaselect-border3 { + background: url(border-anim-v.gif) repeat-y right top; +} + +.imgareaselect-border4 { + background: url(border-anim-h.gif) repeat-x left bottom; +} + +.imgareaselect-border1, .imgareaselect-border2, +.imgareaselect-border3, .imgareaselect-border4 { + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-handle { + background-color: #fff; + border: solid 1px #000; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-outer { + background-color: #000; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-selection { +} \ No newline at end of file diff --git a/js/jquery/imgareaselect/imgareaselect-default.css b/js/jquery/imgareaselect/imgareaselect-default.css new file mode 100644 index 000000000..18bf07b24 --- /dev/null +++ b/js/jquery/imgareaselect/imgareaselect-default.css @@ -0,0 +1,41 @@ +/* + * imgAreaSelect default style + */ + +.imgareaselect-border1 { + background: url(border-v.gif) repeat-y left top; +} + +.imgareaselect-border2 { + background: url(border-h.gif) repeat-x left top; +} + +.imgareaselect-border3 { + background: url(border-v.gif) repeat-y right top; +} + +.imgareaselect-border4 { + background: url(border-h.gif) repeat-x left bottom; +} + +.imgareaselect-border1, .imgareaselect-border2, +.imgareaselect-border3, .imgareaselect-border4 { + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-handle { + background-color: #fff; + border: solid 1px #000; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-outer { + background-color: #000; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-selection { +} \ No newline at end of file diff --git a/js/jquery/imgareaselect/imgareaselect-deprecated.css b/js/jquery/imgareaselect/imgareaselect-deprecated.css new file mode 100644 index 000000000..e2809ccff --- /dev/null +++ b/js/jquery/imgareaselect/imgareaselect-deprecated.css @@ -0,0 +1,36 @@ +/* + * imgAreaSelect style to be used with deprecated options + */ + +.imgareaselect-border1, .imgareaselect-border2, +.imgareaselect-border3, .imgareaselect-border4 { + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-border1 { + border: solid 1px #000; +} + +.imgareaselect-border2 { + border: dashed 1px #fff; +} + +.imgareaselect-handle { + background-color: #fff; + border: solid 1px #000; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.imgareaselect-outer { + background-color: #000; + opacity: 0.4; + filter: alpha(opacity=40); +} + +.imgareaselect-selection { + background-color: #fff; + opacity: 0; + filter: alpha(opacity=0); +} diff --git a/js/jquery/imgareaselect/index.php b/js/jquery/imgareaselect/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/jquery/imgareaselect/index.php @@ -0,0 +1,11 @@ +35?String.fromCharCode(c+29):c.toString(36))};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(m($){1o W=2o.4F,F=2o.4E,M=2o.4D,G=2o.4C;m S(){v $("<4B/>")};$.R=m(X,b){1o L=$(X),2x,A=S(),1k=S(),I=S().u(S()).u(S()).u(S()),B=S().u(S()).u(S()).u(S()),E=$([]),1D,H,q,1g,12,U,1n,1f,1b=0,1B="1A",2e,2d,25,24,1M=10,N,P,1H,c,f,l,j,g={c:0,f:0,l:0,j:0,C:0,J:0},$p,d,i,o,w,h,2k;m 11(x){v x+1g.D-1f.D};m 1m(y){v y+1g.q-1f.q};m 19(x){v x-1g.D+1f.D};m 18(y){v y-1g.q+1f.q};m 1y(3G){v 3G.4A-1f.D};m 1x(3F){v 3F.4z-1f.q};m 14(2W){1o 1i=2W||25,1h=2W||24;v{c:G(g.c*1i),f:G(g.f*1h),l:G(g.l*1i),j:G(g.j*1h),C:G(g.l*1i)-G(g.c*1i),J:G(g.j*1h)-G(g.f*1h)}};m 2t(c,f,l,j,2V){1o 1i=2V||25,1h=2V||24;g={c:G(c/1i),f:G(f/1h),l:G(l/1i),j:G(j/1h)};g.C=(l=11(g.l))-(c=11(g.c));g.J=(j=11(g.j))-(f=11(g.f))};m 1c(){a(!L.C()){v}1g={D:G(L.2n().D),q:G(L.2n().q)};12=L.C();U=L.J();a($().4y=="1.3.2"&&$.1l.33&&1B=="26"){1g.q+=F(V.3E.2l,$("1r").2l());1g.D+=F(V.3E.2m,$("1r").2m())}1f=$.4x(1n.r("1p"),["1A","4w"])+1?{D:G(1n.2n().D)-1n.2m(),q:G(1n.2n().q)-1n.2l()}:1B=="26"?{D:$(V).2m(),q:$(V).2l()}:{D:0,q:0};H=11(0);q=1m(0)};m 1s(3B){a(!1H){v}A.r({D:11(g.c),q:1m(g.f)}).u(1k).C(w=g.C).J(h=g.J);1k.u(I).u(E).r({D:0,q:0});I.C(F(w-I.2U()+I.3z(),0)).J(F(h-I.3D()+I.4v(),0));$(B[0]).r({D:H,q:q,C:g.c,J:U});$(B[1]).r({D:H+g.c,q:q,C:w,J:g.f});$(B[2]).r({D:H+g.l,q:q,C:12-g.l,J:U});$(B[3]).r({D:H+g.c,q:q+g.j,C:w,J:U-g.j});w-=E.2U();h-=E.3D();2H(E.3n){15 8:$(E[4]).r({D:w/2});$(E[5]).r({D:w,q:h/2});$(E[6]).r({D:w/2,q:h});$(E[7]).r({q:h/2});15 4:E.3C(1,3).r({D:w});E.3C(2,4).r({q:h})}a(3B!==Y){a($.R.1Y!=2L){$(V).T($.R.1Y,$.R.3A)}a(b.1J){$(V)[$.R.1Y]($.R.3A=2L)}}a($.1l.1X&&I.2U()-I.3z()==2){I.r("3y",0);3t(m(){I.r("3y","4u")},0)}};m 1Z(2T,2p){b.1G?2T.4t(b.1G,2p):2T.1t()};m 1d(2S){1o x=19(1y(2S))-g.c,y=18(1x(2S))-g.f;a(!2k){1c();2k=1a;A.1j("4s",m(){2k=Y})}N="";a(b.2r){a(y<=1M){N="n"}Z{a(y>=g.J-1M){N="s"}}a(x<=1M){N+="w"}Z{a(x>=g.C-1M){N+="e"}}}A.r("2R",N?N+"-17":b.1U?"4r":"");a(1D){1D.4q()}};m 2O(4p){$("1r").r("2R","");a(b.4o||g.C*g.J==0){1Z(A.u(B),m(){$(Q).1t()})}b.1R(X,14());$(V).T("O",2f);A.O(1d)};m 2v(1L){a(1L.2K!=1){v Y}1c();a(N){$("1r").r("2R",N+"-17");c=11(g[/w/.2h(N)?"l":"c"]);f=1m(g[/n/.2h(N)?"j":"f"]);$(V).O(2f).1j("1K",2O);A.T("O",1d)}Z{a(b.1U){2e=H+g.c-1y(1L);2d=q+g.f-1x(1L);A.T("O",1d);$(V).O(2P).1j("1K",m(){b.1R(X,14());$(V).T("O",2P);A.O(1d)})}Z{L.1F(1L)}}v Y};m 29(){l=F(H,M(H+12,c+W(j-f)*P*(l>c||-1)));j=G(F(q,M(q+U,f+W(l-c)/P*(j>f||-1))));l=G(l)};m 2a(){j=F(q,M(q+U,f+W(l-c)/P*(j>f||-1)));l=G(F(H,M(H+12,c+W(j-f)*P*(l>c||-1))));j=G(j)};m 28(){a(W(l-c)H+12){c=H+12-b.2j}}}a(W(j-f)q+U){f=q+U-b.2i}}}l=F(H,M(l,H+12));j=F(q,M(j,q+U));a(P){a(W(l-c)/P>W(j-f)){2a()}Z{29()}}a(W(l-c)>b.3x){l=c-b.3x*(lb.3w){j=f-b.3w*(j1b){1b=$p.r("z-2E")}a($p.r("1p")=="26"){1B="26"}$p=$p.1T()}a(!1u(b.1q)){1b=b.1q}a(K.2D!=3l){E.4h();E=$([]);i=K.2D?K.2D=="4g"?4:8:0;3m(i--){E=E.u(S())}E.21(b.1C+"-4f").r({1p:"1A",4e:0,1q:1b+1||1});a(!4d(E.r("C"))){E.C(5).J(5)}a(o=b.2C){E.r({2C:o,2z:"3h"})}1I(E,{3i:"2B-20",3g:"2A-20",3j:"1e"})}25=b.4c/12||1;24=b.4b/U||1;a(K.c!=3l){2t(K.c,K.f,K.l,K.j);K.2y=!K.1t}a(K.1J){b.1J=$.1V({23:1,22:"17"},K.1J)}B.21(b.1C+"-4a");1k.21(b.1C+"-49");3k(i=0;i++<4;){$(I[i-1]).21(b.1C+"-2B"+i)}1I(1k,{48:"2A-20",47:"1e"});1I(I,{3j:"1e",2C:"2B-C"});1I(B,{46:"2A-20",45:"1e"});a(o=b.3i){$(I[0]).r({2z:"3h",3f:o})}a(o=b.3g){$(I[1]).r({2z:"44",3f:o})}A.3e(1k.u(I).u(E).u(1D));a($.1l.1X){a(o=B.r("3d").3c(/1e=([0-9]+)/)){B.r("1e",o[1]/1W)}a(o=I.r("3d").3c(/1e=([0-9]+)/)){I.r("1e",o[1]/1W)}}a(K.1t){1Z(A.u(B))}Z{a(K.2y&&2x){1H=1a;A.u(B).2w(b.1G||0);1s()}}P=(d=(b.43||"").42(/:/))[0]/d[1];a(b.1P||b.1z===Y){A.T("O",1d).T("1F",2v);L.u(B).T("1F",2u);$(3b).T("17",1E);L.u(L.3a()).T("36",1E)}Z{a(b.1z||b.1P===Y){a(b.2r||b.1U){A.O(1d).1F(2v)}a(!b.41){L.u(B).1F(2u)}$(3b).17(1E);L.u(L.3a()).36(1E)}}b.1z=b.1P=1O};Q.3Z=m(){v b};Q.2X=2s;Q.3Y=14;Q.3X=2t;Q.3W=m 35(34){1c();1s(34);c=11(g.c);f=1m(g.f);l=11(g.l);j=1m(g.j)};a($.1l.1X){L.3V("3U","3T")}$.R.1Y=$.1l.1X||$.1l.33?"3S":"3R";a($.1l.3Q){1D=S().r({C:"1W%",J:"1W%",1p:"1A",1q:1b+2||2})}2s(b=$.1V({1C:"3P",1U:1a,2r:1a,1T:"1r",32:m(){},31:m(){},1S:m(){},1R:m(){}},b));A.u(B).r({30:"2Z",1p:1B,3O:"2Z",1q:1b||"0"});A.r({1q:1b+2||2});1k.u(I).r({1p:"1A"});X.2Y||X.3N=="2Y"||!L.1Q("3M")?2q():L.1j("3L",2q)};$.2p.R=m(16){16=16||{};Q.3K(m(){a($(Q).1N("R")){$(Q).1N("R").2X(16)}Z{a(16.1z===1O&&16.1P===1O){16.1z=1a}$(Q).1N("R",3J $.R(Q,16))}});a(16.3I){v $(Q).1N("R")}v Q}})(3H);',62,290,'||||||||||if|_7|x1|||y1|_20|||y2||x2|function||||top|css|||add|return|||||_a|_d|width|left|_e|_2|_4|_10|_c|height|_4d|_8|_3|_1d|mousemove|_1e|this|imgAreaSelect|_5|unbind|_13|document|_1|_6|false|else||_22|_12|_48|_28|case|_4f|resize|_25|_24|true|_16|_2c|_32|opacity|_15|_11|sy|sx|one|_b|browser|_23|_14|var|position|zIndex|body|_2d|hide|isNaN|break|_3e|evY|evX|enable|absolute|_17|classPrefix|_f|_46|mousedown|fadeSpeed|_1f|_49|keys|mouseup|_38|_1c|data|undefined|disable|is|onSelectEnd|onSelectChange|parent|movable|extend|100|msie|keyPress|_30|color|addClass|ctrl|shift|_1b|_1a|fixed|option|_3c|_3a|_3b|altKey|_45|_19|_18|_36|_41|test|minHeight|minWidth|_21|scrollTop|scrollLeft|offset|Math|fn|_47|resizable|_4c|_2a|_44|_37|fadeIn|_9|show|borderStyle|background|border|borderWidth|handles|index|_4b|key|switch|alt|arrows|which|_2f|_43|_42|_34|_39|_3d|cursor|_33|_31|outerWidth|_2b|_29|setOptions|complete|hidden|visibility|onSelectStart|onInit|safari|_4e|doUpdate|scroll||||parents|window|match|filter|append|borderColor|borderColor2|solid|borderColor1|borderOpacity|for|null|while|length|_4a|default|originalEvent|ctrlKey|shiftKey|setTimeout|_40|_3f|maxHeight|maxWidth|margin|innerWidth|onKeyPress|_2e|slice|outerHeight|documentElement|_27|_26|jQuery|instance|new|each|load|img|readyState|overflow|imgareaselect|opera|keypress|keydown|on|unselectable|attr|update|setSelection|getSelection|getOptions||persistent|split|aspectRatio|dashed|outerOpacity|outerColor|selectionOpacity|selectionColor|selection|outer|imageHeight|imageWidth|parseInt|fontSize|handle|corners|remove|in|keyCode|animated|visible|not|preventDefault|autoHide|_35|toggle|move|mouseout|fadeOut|auto|innerHeight|relative|inArray|jquery|pageY|pageX|div|round|min|max|abs'.split('|'))) diff --git a/js/jquery/index.php b/js/jquery/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/js/jquery/index.php @@ -0,0 +1,11 @@ +35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9.J={1C:6(e){4 x=0;4 y=0;4 7=e.Y;4 12=1H;c(9(e).8(\'A\')==\'T\'){4 N=7.B;4 Q=7.z;12=1f;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\'}4 3=e;R(3){x+=3.1h+(3.O&&!9.1m.1i?d(3.O.17)||0:0);y+=3.1n+(3.O&&!9.1m.1i?d(3.O.18)||0:0);3=3.1t}3=e;R(3&&3.1e&&3.1e.16()!=\'f\'){x-=3.u||0;y-=3.F||0;3=3.1D}c(12==1f){7.A=\'T\';7.z=Q;7.B=N}a{x:x,y:y}},1B:6(3){4 x=0,y=0;R(3){x+=3.1h||0;y+=3.1n||0;3=3.1t}a{x:x,y:y}},1s:6(e){4 w=9.8(e,\'1E\');4 h=9.8(e,\'1G\');4 o=0;4 q=0;4 7=e.Y;c(9(e).8(\'A\')!=\'T\'){o=e.V;q=e.U}p{4 N=7.B;4 Q=7.z;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\';o=e.V;q=e.U;7.A=\'T\';7.z=Q;7.B=N}a{w:w,h:h,o:o,q:q}},1F:6(3){a{o:3.V||0,q:3.U||0}},1I:6(e){4 h,w,C;c(e){w=e.I;h=e.G}p{C=5.j;w=1c.14||P.14||(C&&C.I)||5.f.I;h=1c.10||P.10||(C&&C.G)||5.f.G}a{w:w,h:h}},1p:6(e){4 t=0,l=0,w=0,h=0,s=0,E=0;c(e&&e.1u.16()!=\'f\'){t=e.F;l=e.u;w=e.15;h=e.W;s=0;E=0}p{c(5.j){t=5.j.F;l=5.j.u;w=5.j.15;h=5.j.W}p c(5.f){t=5.f.F;l=5.f.u;w=5.f.15;h=5.f.W}s=P.14||5.j.I||5.f.I||0;E=P.10||5.j.G||5.f.G||0}a{t:t,l:l,w:w,h:h,s:s,E:E}},1v:6(e,D){4 3=9(e);4 t=3.8(\'1w\')||\'\';4 r=3.8(\'1x\')||\'\';4 b=3.8(\'1A\')||\'\';4 l=3.8(\'1z\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},1y:6(e,D){4 3=9(e);4 t=3.8(\'1J\')||\'\';4 r=3.8(\'1M\')||\'\';4 b=3.8(\'27\')||\'\';4 l=3.8(\'28\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},26:6(e,D){4 3=9(e);4 t=3.8(\'18\')||\'\';4 r=3.8(\'22\')||\'\';4 b=3.8(\'23\')||\'\';4 l=3.8(\'17\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)||0};p a{t:t,r:r,b:b,l:l}},2e:6(L){4 x=L.2d||(L.2b+(5.j.u||5.f.u))||0;4 y=L.2c||(L.29+(5.j.F||5.f.F))||0;a{x:x,y:y}},X:6(g,13){13(g);g=g.1O;R(g){9.J.X(g,13);g=g.1L}},1N:6(g){9.J.X(g,6(3){19(4 Z 1T 3){c(1Z 3[Z]===\'6\'){3[Z]=1a}}})},1X:6(3,H){4 k=9.J.1p();4 11=9.J.1s(3);c(!H||H==\'1W\')9(3).8({1U:k.t+((1g.1o(k.h,k.E)-k.t-11.q)/2)+\'1j\'});c(!H||H==\'20\')9(3).8({1Y:k.l+((1g.1o(k.w,k.s)-k.l-11.o)/2)+\'1j\'})},2f:6(3,1l){4 1k=9(\'25[@M*="S"]\',3||5),S;1k.24(6(){S=K.M;K.M=1l;K.Y.2a="21:1R.1P.1V(M=\'"+S+"\')"})}};[].1b||(1S.1Q.1b=6(v,n){n=(n==1a)?0:n;4 m=K.1K;19(4 i=n;i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('u m(){$.5={D:y,v:y};$(G).12(m(){8 h=G.W(\'I\');$(h).e({\'3\':\'J\',\'6-3\':\'K\'});$(\'L\').M(h);$.5.v=(h.s&&h.s==2);$(h).N();b($.5.v)o;$.5.D=O;$.5.A();$(\':5\').5()});$.5.A=m(){8 p=u E(\'6-3\',\'6-4\',\'9-3\',\'9-4\');8 5=u E();Q(8 i=0;i7[\'9-3\'])k=7[\'9-3\'];b(7[\'6-3\']!=f.g&&k<7[\'6-3\'])k=7[\'6-3\'];b(7[\'9-4\']!=f.g&&l>7[\'9-4\'])l=7[\'9-4\'];b(7[\'6-4\']!=f.g&&l<7[\'6-4\'])l=7[\'6-4\'];b(k!=3)$(c).e(\'3\',k);b(l!=4)$(c).e(\'4\',l)})};m r(t,p){8 q=$(t).e(p);b(q==f.g||q==\'z\')o f.g;8 j;j=q.B(/^\\+?(\\d*(?:\\.\\d+)?)%$/);b(j){o T.V(C((/3$/.h(p)?$(t).F().H(0).s:$(t).F().H(0).w)*j[1]/P))}j=q.B(/^\\+?(\\d*(?:\\.\\d+)?)(?:11)?$/);b(j){o C(j[1])}o f.g}}();',62,65,'|||width|height|minmax|min|constraint|var|max||if|this||css|window|undefined|test||result|newWidth|newHeight|function|expr|return||raw|calculate|offsetWidth|obj|new|native|offsetHeight||false|auto|expressions|match|Number|active|Array|parent|document|get|div|1px|2px|body|append|remove|true|100|for|length|0px|Math|charAt|round|createElement|none|join|fn|each|px|ready'.split('|'),0,{})) diff --git a/js/jquery/jquery-1.4.4.min.js b/js/jquery/jquery-1.4.4.min.js new file mode 100644 index 000000000..8f3ca2e2d --- /dev/null +++ b/js/jquery/jquery-1.4.4.min.js @@ -0,0 +1,167 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
      a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
      ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
      t
      ";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="

      ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="
      ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, +""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
      ","
      "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
      ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/js/jquery/jquery-colorpicker.js b/js/jquery/jquery-colorpicker.js new file mode 100644 index 000000000..7f4189458 --- /dev/null +++ b/js/jquery/jquery-colorpicker.js @@ -0,0 +1,573 @@ +/* + mColorPicker + Version: 1.0 r21 + + Copyright (c) 2010 Meta100 LLC. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + Except as contained in this notice, the name(s) of the above + copyright holders shall not be used in advertising or otherwise + to promote the sale, use or other dealings in this Software + without prior written authorization. + + THE 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. +*/ + +// After this script loads set: +// $.fn.mColorPicker.init.replace = '.myclass' +// to have this script apply to input.myclass, +// instead of the default input[type=color] +// To turn of automatic operation and run manually set: +// $.fn.mColorPicker.init.replace = false +// To use manually call like any other jQuery plugin +// $('input.foo').mColorPicker({options}) +// options: +// imageFolder - Change to move image location. +// swatches - Initial colors in the swatch, must an array of 10 colors. +// init: +// $.fn.mColorPicker.init.enhancedSwatches - Turn of saving and loading of swatch to cookies. +// $.fn.mColorPicker.init.allowTransparency - Turn off transperancy as a color option. +// $.fn.mColorPicker.init.showLogo - Turn on/off the meta100 logo (You don't really want to turn it off, do you?). + +(function($){ + + $.fn.mColorPicker = function(options) { + + $o = $.extend($.fn.mColorPicker.defaults, options); + + if ($o.swatches.length < 10) $o.swatches = $.fn.mColorPicker.defaults.swatches + if ($("div#mColorPicker").length < 1) $.fn.mColorPicker.drawPicker(); + + this.each(function () { + + $.fn.mColorPicker.drawPickerTriggers($(this)); + }); + + $('.mColorPickerInput').unbind().bind('keyup', function () { + + try { + + $(this).css({ + 'background-color': $(this).val() + }).css({ + 'color': $.fn.mColorPicker.textColor($(this).css('background-color')) + }).trigger('change'); + } catch (r) {} + }); + }; + + $.fn.mColorPicker.currentColor = false; + $.fn.mColorPicker.currentValue = false; + $.fn.mColorPicker.color = false; + + $.fn.mColorPicker.init = { + replace: '[type=color]', + enhancedSwatches: true, + allowTransparency: true, + showLogo: true + }; + + $.fn.mColorPicker.defaults = { + imageFolder: '../img/admin/', + swatches: [ + "#ffffff", + "#ffff00", + "#00ff00", + "#00ffff", + "#0000ff", + "#ff00ff", + "#ff0000", + "#4c2b11", + "#3b3b3b", + "#000000" + ] + }; + + $.fn.mColorPicker.drawPickerTriggers = function ($t) { + + if ($t[0].nodeName.toLowerCase() != 'input') return false + if ($t.data('mColorPicker') == 'true') return false + + var id = $t.attr('id'), + currentTime = new Date(), + hidden = false; + + if (id == '') id = $t.attr('name'); + if (id == '') id = 'color_' + Math.round(Math.random() * currentTime.getTime()); + + $t.attr('id', id); + + if ($t.attr('text') == 'hidden' || $t.attr('data-text') == 'hidden') hidden = true; + + var color = $t.val(), + width = ($t.width() > 0)? $t.width(): parseInt($t.css('width'), 10), + height = ($t.height())? $t.height(): parseInt($t.css('height'), 10), + flt = $t.css('float'), + image = (color == 'transparent')? "url('" + $o.imageFolder + "/grid.gif')": '', + colorPicker = ''; + + $('body').append(''); + $('span#color_work_area').append($t.clone(true)); + colorPicker = $('span#color_work_area').html().replace(/type=[^a-z]*color[^a-z]*/gi, (hidden)? 'type="hidden"': 'type="text"'); + $('span#color_work_area').html('').remove(); + $t.after( + (hidden)? ' ': '' + ).after(colorPicker).remove(); + + if (hidden) { + + $('#icp_' + id).css({ + 'background-color': color, + 'background-image': image, + 'display': 'inline-block' + }); + } else { + + $('#' + id).css({ + 'background-color': color, + 'background-image': image + }).css({ + 'color': $.fn.mColorPicker.textColor($('#' + id).css('background-color')) + }).after( + '' + ).addClass('mColorPickerInput'); + } + + $('#icp_' + id).bind('click', function () { + + $.fn.mColorPicker.colorShow(id, hidden); + }).data('mColorPicker', 'true'); + }; + + $.fn.mColorPicker.drawPicker = function () { + + $(document.createElement("div")).attr( + "id","mColorPicker" + ).css( + 'display','none' + ).html( + '
      ' + ).appendTo("body"); + + $(document.createElement("div")).attr("id","mColorPickerBg").css({ + 'display': 'none' + }).appendTo("body"); + + for (n = 9; n > -1; n--) { + + $(document.createElement("div")).attr({ + 'id': 'cell' + n, + 'class': "mPastColor" + ((n > 0)? ' mNoLeftBorder': '') + }).html( + ' ' + ).prependTo("#mColorPickerSwatches"); + } + + $('#mColorPicker').css({ + 'border':'1px solid #ccc', + 'color':'#fff', + 'z-index':999998, + 'width':'194px', + 'height':'157px', + 'font-size':'12px', + 'font-family':'times' + }); + + $('.mPastColor').css({ + 'height':'18px', + 'width':'18px', + 'border':'1px solid #000', + 'float':'left' + }); + + $('#colorPreview').css({ + 'height':'50px' + }); + + $('.mNoLeftBorder').css({ + 'border-left':0 + }); + + $('.mClear').css({ + 'clear':'both' + }); + + $('#mColorPickerWrapper').css({ + 'position':'relative', + 'border':'solid 1px gray', + 'z-index':999999 + }); + + $('#mColorPickerImg').css({ + 'height':'128px', + 'width':'192px', + 'border':0, + 'cursor':'crosshair', + 'background-image':"url('" + $o.imageFolder + "colorpicker.png')" + }); + + $('#mColorPickerImgGray').css({ + 'height':'8px', + 'width':'192px', + 'border':0, + 'cursor':'crosshair', + 'background-image':"url('" + $o.imageFolder + "graybar.jpg')" + }); + + $('#mColorPickerInput').css({ + 'border':'solid 1px gray', + 'font-size':'10pt', + 'margin':'3px', + 'width':'80px' + }); + + $('#mColorPickerImgGrid').css({ + 'border':0, + 'height':'20px', + 'width':'20px', + 'vertical-align':'text-bottom' + }); + + $('#mColorPickerSwatches').css({ + 'border-right':'1px solid #000' + }); + + $('#mColorPickerFooter').css({ + 'background-image':"url('" + $o.imageFolder + "grid.gif')", + 'position': 'relative', + 'height':'26px' + }); + + if ($.fn.mColorPicker.init.allowTransparency) $('#mColorPickerFooter').prepend('transparent'); + if ($.fn.mColorPicker.init.showLogo) $('#mColorPickerFooter').prepend('Meta100 - Designing Fun'); + + $("#mColorPickerBg").click(function() { + + $("#mColorPickerBg").hide(); + $("#mColorPicker").fadeOut() + }); + + var swatch = ($.fn.mColorPicker.init.enhancedSwatches)? $.fn.mColorPicker.getCookie('swatches'): $o.swatches, + i = 0; + + if (swatch == null) swatch = $o.swatches; + else swatch = swatch.split('||'); + + if (swatch.length < 10) swatch = $o.swatches; + + $(".mPastColor").each(function() { + + $(this).css('background-color', swatch[i++].toLowerCase()); + }); + }; + + $.fn.mColorPicker.colorShow = function (id, updateInput) { + + var $e = $("#icp_" + id); + pos = $e.offset(), + $i = $("#" + id); + hex = $i.attr('data-hex') || $i.attr('hex'), + pickerTop = pos.top + $e.outerHeight(), + pickerLeft = pos.left, + $d = $(document), + $m = $("#mColorPicker"); + + // KEEP COLOR PICKER IN VIEWPORT + if (pickerTop + $m.height() > $d.height()) pickerTop = pos.top - $m.height(); + if (pickerLeft + $m.width() > $d.width()) pickerLeft = pos.left - $m.width() + $e.outerWidth(); + + $m.css({ + 'top':(pickerTop) + "px", + 'left':(pickerLeft) + "px", + 'position':'absolute' + }).fadeIn("fast"); + + $("#mColorPickerBg").css({ + 'z-index':999990, + 'background':'black', + 'opacity': .01, + 'position':'absolute', + 'top':0, + 'left':0, + 'width': parseInt($d.width(), 10) + 'px', + 'height': parseInt($d.height(), 10) + 'px' + }).show(); + + var def = $i.val(); + + $('#colorPreview span').text(def); + $('#colorPreview').css('background', def); + $('#color').val(def); + + if (updateInput) $.fn.mColorPicker.currentColor = $e.css('background-color'); + else $.fn.mColorPicker.currentColor = $i.css('background-color'); + + if (hex == 'true') $.fn.mColorPicker.currentColor = $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.currentColor); + + $("#mColorPickerInput").val($.fn.mColorPicker.currentColor); + $('.mColor, .mPastColor').bind('mousemove', function(e) { + + var offset = $(this).offset(); + + $.fn.mColorPicker.color = $(this).css("background-color"); + + if ($(this).hasClass('mPastColor') && hex == 'true') $.fn.mColorPicker.color = $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.color); + else if ($(this).hasClass('mPastColor') && hex != 'true') $.fn.mColorPicker.color = $.fn.mColorPicker.hexToRGB($.fn.mColorPicker.color); + else if ($(this).attr('id') == 'mColorPickerTransparent') $.fn.mColorPicker.color = 'transparent'; + else if (!$(this).hasClass('mPastColor')) $.fn.mColorPicker.color = $.fn.mColorPicker.whichColor(e.pageX - offset.left, e.pageY - offset.top + (($(this).attr('id') == 'mColorPickerImgGray')? 128: 0), hex); + + $.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.color, updateInput); + }).click(function() { + + $.fn.mColorPicker.colorPicked(id); + }); + + $('#mColorPickerInput').bind('keyup', function (e) { + + try { + + $.fn.mColorPicker.color = $('#mColorPickerInput').val(); + $.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.color, updateInput); + + if (e.which == 13) { + $.fn.mColorPicker.colorPicked(id); + } + } catch (r) {} + }).bind('blur', function () { + + $.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.currentColor, updateInput); + }); + + $('#mColorPickerWrapper').bind('mouseleave', function () { + + $.fn.mColorPicker.setInputColor(id, $.fn.mColorPicker.currentColor, updateInput); + }); + }; + + $.fn.mColorPicker.setInputColor = function (id, color, updateInput) { + + var image = (color == 'transparent')? "url('" + $o.imageFolder + "grid.gif')": '', + textColor = $.fn.mColorPicker.textColor(color); + + if (updateInput) $("#icp_" + id).css({'background-color': color, 'background-image': image}); + $("#" + id).val(color).css({'background-color': color, 'background-image': image, 'color' : textColor}).trigger('change'); + if(typeof(employeePage) != 'undefined') + $('body').css('background-color', color); + $("#mColorPickerInput").val(color); + }; + + $.fn.mColorPicker.textColor = function (val) { + + if (typeof val == 'undefined' || val == 'transparent') return "black"; + val = $.fn.mColorPicker.RGBtoHex(val); + return (parseInt(val.substr(1, 2), 16) + parseInt(val.substr(3, 2), 16) + parseInt(val.substr(5, 2), 16) < 400)? 'white': 'black'; + }; + + $.fn.mColorPicker.setCookie = function (name, value, days) { + + var cookie_string = name + "=" + escape(value), + expires = new Date(); + expires.setDate(expires.getDate() + days); + cookie_string += "; expires=" + expires.toGMTString(); + + document.cookie = cookie_string; + }; + + $.fn.mColorPicker.getCookie = function (name) { + + var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' ); + + if (results) return (unescape(results[2])); + else return null; + }; + + $.fn.mColorPicker.colorPicked = function (id) { + + $(".mColor, .mPastColor, #mColorPickerInput, #mColorPickerWrapper").unbind(); + $("#mColorPickerBg").hide(); + $("#mColorPicker").fadeOut(); + + if ($.fn.mColorPicker.init.enhancedSwatches) $.fn.mColorPicker.addToSwatch(); + + $("#" + id).trigger('colorpicked'); + }; + + $.fn.mColorPicker.addToSwatch = function (color) { + + var swatch = [] + i = 0; + + if (typeof color == 'string') $.fn.mColorPicker.color = color.toLowerCase(); + + $.fn.mColorPicker.currentValue = $.fn.mColorPicker.currentColor = $.fn.mColorPicker.color; + + if ($.fn.mColorPicker.color != 'transparent') swatch[0] = $.fn.mColorPicker.color.toLowerCase(); + + $('.mPastColor').each(function() { + + $.fn.mColorPicker.color = $(this).css('background-color').toLowerCase(); + + if ($.fn.mColorPicker.color != swatch[0] && $.fn.mColorPicker.RGBtoHex($.fn.mColorPicker.color) != swatch[0] && $.fn.mColorPicker.hexToRGB($.fn.mColorPicker.color) != swatch[0] && swatch.length < 10) swatch[swatch.length] = $.fn.mColorPicker.color; + + $(this).css('background-color', swatch[i++]) + }); + + if ($.fn.mColorPicker.init.enhancedSwatches) $.fn.mColorPicker.setCookie('swatches', swatch.join('||'), 365); + }; + + $.fn.mColorPicker.whichColor = function (x, y, hex) { + + var colorR = colorG = colorB = 255; + + if (x < 32) { + + colorG = x * 8; + colorB = 0; + } else if (x < 64) { + + colorR = 256 - (x - 32 ) * 8; + colorB = 0; + } else if (x < 96) { + + colorR = 0; + colorB = (x - 64) * 8; + } else if (x < 128) { + + colorR = 0; + colorG = 256 - (x - 96) * 8; + } else if (x < 160) { + + colorR = (x - 128) * 8; + colorG = 0; + } else { + + colorG = 0; + colorB = 256 - (x - 160) * 8; + } + + if (y < 64) { + + colorR += (256 - colorR) * (64 - y) / 64; + colorG += (256 - colorG) * (64 - y) / 64; + colorB += (256 - colorB) * (64 - y) / 64; + } else if (y <= 128) { + + colorR -= colorR * (y - 64) / 64; + colorG -= colorG * (y - 64) / 64; + colorB -= colorB * (y - 64) / 64; + } else if (y > 128) { + + colorR = colorG = colorB = 256 - ( x / 192 * 256 ); + } + + colorR = Math.round(Math.min(colorR, 255)); + colorG = Math.round(Math.min(colorG, 255)); + colorB = Math.round(Math.min(colorB, 255)); + + if (hex == 'true') { + + colorR = colorR.toString(16); + colorG = colorG.toString(16); + colorB = colorB.toString(16); + + if (colorR.length < 2) colorR = 0 + colorR; + if (colorG.length < 2) colorG = 0 + colorG; + if (colorB.length < 2) colorB = 0 + colorB; + + return "#" + colorR + colorG + colorB; + } + + return "rgb(" + colorR + ', ' + colorG + ', ' + colorB + ')'; + }; + + $.fn.mColorPicker.RGBtoHex = function (color) { + + color = color.toLowerCase(); + + if (typeof color == 'undefined') return ''; + if (color.indexOf('#') > -1 && color.length > 6) return color; + if (color.indexOf('rgb') < 0) return color; + + if (color.indexOf('#') > -1) { + + return '#' + color.substr(1, 1) + color.substr(1, 1) + color.substr(2, 1) + color.substr(2, 1) + color.substr(3, 1) + color.substr(3, 1); + } + + var hexArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"], + decToHex = "#", + code1 = 0; + + color = color.replace(/[^0-9,]/g, '').split(","); + + for (var n = 0; n < color.length; n++) { + + code1 = Math.floor(color[n] / 16); + decToHex += hexArray[code1] + hexArray[color[n] - code1 * 16]; + } + + return decToHex; + }; + + $.fn.mColorPicker.hexToRGB = function (color) { + + color = color.toLowerCase(); + + if (typeof color == 'undefined') return ''; + if (color.indexOf('rgb') > -1) return color; + if (color.indexOf('#') < 0) return color; + + var c = color.replace('#', ''); + + if (c.length < 6) c = c.substr(0, 1) + c.substr(0, 1) + c.substr(1, 1) + c.substr(1, 1) + c.substr(2, 1) + c.substr(2, 1); + + return 'rgb(' + parseInt(c.substr(0, 2), 16) + ', ' + parseInt(c.substr(2, 2), 16) + ', ' + parseInt(c.substr(4, 2), 16) + ')'; + } + + if ($.fn.mColorPicker.init.replace == '[type=color]') { + + $(document).ready(function () { + + $('input').filter(function(index) { + + return this.getAttribute("type") == 'color'; + }).mColorPicker(); + + $(document).bind('ajaxSuccess', function () { + + $('input').filter(function(index) { + + return this.getAttribute("type") == 'color'; + }).mColorPicker(); + }); + }); + } else if ($.fn.mColorPicker.init.replace) { + + $(document).ready(function () { + + $('input' + $.fn.mColorPicker.init.replace).mColorPicker(); + + $(document).bind('ajaxSuccess', function () { + + $('input' + $.fn.mColorPicker.init.replace).mColorPicker(); + }); + }); + } +})(jQuery); diff --git a/js/jquery/jquery-typewatch.pack.js b/js/jquery/jquery-typewatch.pack.js new file mode 100644 index 000000000..89a3ed671 --- /dev/null +++ b/js/jquery/jquery-typewatch.pack.js @@ -0,0 +1,89 @@ +/* + * TypeWatch 2.0 - Original by Denny Ferrassoli / Refactored by Charles Christolini + * + * Examples/Docs: www.dennydotnet.com + * + * Copyright(c) 2007 Denny Ferrassoli - DennyDotNet.com + * Coprright(c) 2008 Charles Christolini - BinaryPie.com + * Modified by Lucas CHERIFI @ PrestaShop : now this plugin works with the Dean Edward's JS Packer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html +*/ + +(function(jQuery) { + jQuery.fn.typeWatch = function(o){ + // Options + var options = jQuery.extend({ + wait : 750, + callback : function() { }, + highlight : true, + captureLength : 2 + }, o); + + function checkElement(timer, override) { + var elTxt = jQuery(timer.el).val(); + + // Fire if text > options.captureLength AND text != saved txt OR if override AND text > options.captureLength + if ((elTxt.length > options.captureLength && elTxt.toUpperCase() != timer.text) + || (override && elTxt.length > options.captureLength)) { + timer.text = elTxt.toUpperCase(); + timer.cb(elTxt); + } + }; + + function watchElement(elem) { + // Must be text or textarea + if (elem.type.toUpperCase() == "TEXT" || elem.nodeName.toUpperCase() == "TEXTAREA") { + + // Allocate timer element + var timer = { + timer : null, + text : jQuery(elem).val().toUpperCase(), + cb : options.callback, + el : elem, + wait : options.wait + }; + + // Set focus action (highlight) + if (options.highlight) { + jQuery(elem).focus( + function() { + this.select(); + }); + } + + // Key watcher / clear and reset the timer + var startWatch = function(evt) { + var timerWait = timer.wait; + var overrideBool = false; + + if (evt.keyCode == 13 && this.type.toUpperCase() == "TEXT") { + timerWait = 1; + overrideBool = true; + } + + var timerCallbackFx = function() + { + checkElement(timer, overrideBool); + } + + // Clear timer + clearTimeout(timer.timer); + timer.timer = setTimeout(timerCallbackFx, timerWait); + + }; + + jQuery(elem).keydown(startWatch); + } + }; + + // Watch Each Element + return this.each(function(index){ + watchElement(this); + }); + + }; + +})(jQuery); diff --git a/js/jquery/jquery-ui-1.8.10.custom.min.js b/js/jquery/jquery-ui-1.8.10.custom.min.js new file mode 100755 index 000000000..7d4ff1cec --- /dev/null +++ b/js/jquery/jquery-ui-1.8.10.custom.min.js @@ -0,0 +1,782 @@ +/*! + * jQuery UI 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, +NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, +"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); +if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, +"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, +d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); +c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); +return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", +true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= +m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); +d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&& +this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| +0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== +"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? +0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), +10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== +Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): +f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; +if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ +b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
      ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, +stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= +document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing"); +this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top= +null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+ +this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b, +a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a, +c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize, +originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.10"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize= +b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width", +"height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})}; +if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height- +g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width, +height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d= +e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options, +d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper? +d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height= +a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&& +/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable"); +b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/ +(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
      ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, +arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= +c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, +{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); +if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", +a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); +if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, +c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== +document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length- +1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null}); +this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&& +a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h= +d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)}); +return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g= +d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top= +e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; +if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder); +c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length=== +1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top< +this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0], +this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out", +g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+ +a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), +e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| +e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", +tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.10",animations:{slide:function(a,b){a= +c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);f[i]={value:j[1], +unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", +paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=false;var f=d.ui.keyCode; +switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem= +null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("
        ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| +"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"), +i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); +this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source=== +"string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b); +else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})}, +deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0); +e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e, +g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first")); +this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,f=d.primary&&d.secondary,e=[];if(d.primary||d.secondary){e.push("ui-button-text-icon"+(f?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){e.push(f?"ui-button-icons-only":"ui-button-icon-only"); +b.removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");this.hasTitle||b.attr("title",c)}}else e.push("ui-button-text-only");b.addClass(e.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this, +arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); +a.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&& +c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
        ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex", +-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
        ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", +"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose= +b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&& +a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index"); +isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ); +d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}}); +c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
        ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
        ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f, +h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g= +d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize, +position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f, +h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length=== +1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in +l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled"); +break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e= +this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&& +this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.10",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== +0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), +height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); +b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("
        ");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); +if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); +else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= +false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== +b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, +g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, +_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; +if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= +this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, +_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); +if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, +1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.10"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
        ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
      • #{label}
      • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.10"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]== +null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.10"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); +f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
        ')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{}); +b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); +this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", +this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, +function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: +f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true}, +_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos= +d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b, +c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&& +d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout", +function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!= +-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a, +"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))), +parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left, +b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); +this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear= +false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay= +d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); +else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b= +a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort, +g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y", +RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= +a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), +b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= +this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
        '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
        ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= +this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- +1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
        '+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'
        ';var A=j?'":"";for(t=0;t<7;t++){var q= +(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var F= +p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= +P+""}g++;if(g>11){g=0;m++}x+="
        '+this._get(a,"weekHeader")+"
        '+this._get(a,"calculateWeek")(q)+""+(B&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
        "+(l?"
        "+(i[0]>0&&D==i[1]-1?'
        ':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
        ', +o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& +l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
        ";return k},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, +[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.10";window["DP_jQuery_"+y]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
        ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.10"})})(jQuery); +;/* + * jQuery UI Effects 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0]; +h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c, +a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.10",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent", +border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); +return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); +else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), +b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, +a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, +a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== +e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], +10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/js/jquery/jquery.autocomplete.js b/js/jquery/jquery.autocomplete.js new file mode 100644 index 000000000..29dd30473 --- /dev/null +++ b/js/jquery/jquery.autocomplete.js @@ -0,0 +1,758 @@ +/* + * Autocomplete - jQuery plugin 1.0.2 + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ + * + */ + +;(function($) { + +$.fn.extend({ + autocomplete: function(urlOrData, options) { + var isUrl = typeof urlOrData == "string"; + options = $.extend({}, $.Autocompleter.defaults, { + url: isUrl ? urlOrData : null, + data: isUrl ? null : urlOrData, + delay: isUrl ? $.Autocompleter.defaults.delay : 10, + max: options && !options.scroll ? 10 : 150 + }, options); + + // if highlight is set to false, replace it with a do-nothing function + options.highlight = options.highlight || function(value) { return value; }; + + // if the formatMatch option is not specified, then use formatItem for backwards compatibility + options.formatMatch = options.formatMatch || options.formatItem; + + return this.each(function() { + new $.Autocompleter(this, options); + }); + }, + result: function(handler) { + return this.bind("result", handler); + }, + search: function(handler) { + return this.trigger("search", [handler]); + }, + flushCache: function() { + return this.trigger("flushCache"); + }, + setOptions: function(options){ + return this.trigger("setOptions", [options]); + }, + unautocomplete: function() { + return this.trigger("unautocomplete"); + } +}); + +$.Autocompleter = function(input, options) { + + var KEY = { + UP: 38, + DOWN: 40, + DEL: 46, + TAB: 9, + RETURN: 13, + ESC: 27, + COMMA: 188, + PAGEUP: 33, + PAGEDOWN: 34, + BACKSPACE: 8 + }; + + // Create $ object for input element + var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); + + var timeout; + var previousValue = ""; + var cache = $.Autocompleter.Cache(options); + var hasFocus = 0; + var lastKeyPressCode; + var config = { + mouseDownOnSelect: false + }; + var select = $.Autocompleter.Select(options, input, selectCurrent, config); + + var blockSubmit; + + // prevent form submit in opera when selecting with return key + $.browser.opera && $(input.form).bind("submit.autocomplete", function() { + if (blockSubmit) { + blockSubmit = false; + return false; + } + }); + + // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all + $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { + // track last key pressed + lastKeyPressCode = event.keyCode; + switch(event.keyCode) { + + case KEY.UP: + event.preventDefault(); + if ( select.visible() ) { + select.prev(); + } else { + onChange(0, true); + } + break; + + case KEY.DOWN: + event.preventDefault(); + if ( select.visible() ) { + select.next(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEUP: + event.preventDefault(); + if ( select.visible() ) { + select.pageUp(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEDOWN: + event.preventDefault(); + if ( select.visible() ) { + select.pageDown(); + } else { + onChange(0, true); + } + break; + + // matches also semicolon + case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: + case KEY.TAB: + case KEY.RETURN: + if( selectCurrent() ) { + // stop default to prevent a form submit, Opera needs special handling + event.preventDefault(); + blockSubmit = true; + return false; + } + break; + + case KEY.ESC: + select.hide(); + break; + + default: + clearTimeout(timeout); + timeout = setTimeout(onChange, options.delay); + break; + } + }).focus(function(){ + // track whether the field has focus, we shouldn't process any + // results if the field no longer has focus + hasFocus++; + }).blur(function() { + hasFocus = 0; + if (!config.mouseDownOnSelect) { + hideResults(); + } + }).click(function() { + // show select when clicking in a focused field + if ( hasFocus++ > 1 && !select.visible() ) { + onChange(0, true); + } + }).bind("search", function() { + // TODO why not just specifying both arguments? + var fn = (arguments.length > 1) ? arguments[1] : null; + function findValueCallback(q, data) { + var result; + if( data && data.length ) { + for (var i=0; i < data.length; i++) { + if( data[i].result.toLowerCase() == q.toLowerCase() ) { + result = data[i]; + break; + } + } + } + if( typeof fn == "function" ) fn(result); + else $input.trigger("result", result && [result.data, result.value]); + } + $.each(trimWords($input.val()), function(i, value) { + request(value, findValueCallback, findValueCallback); + }); + }).bind("flushCache", function() { + cache.flush(); + }).bind("setOptions", function() { + $.extend(options, arguments[1]); + // if we've updated the data, repopulate + if ( "data" in arguments[1] ) + cache.populate(); + }).bind("unautocomplete", function() { + select.unbind(); + $input.unbind(); + $(input.form).unbind(".autocomplete"); + }); + + + function selectCurrent() { + var selected = select.selected(); + if( !selected ) + return false; + + var v = selected.result; + previousValue = v; + + if ( options.multiple ) { + var words = trimWords($input.val()); + if ( words.length > 1 ) { + v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; + } + v += options.multipleSeparator; + } + + $input.val(v); + hideResultsNow(); + $input.trigger("result", [selected.data, selected.value]); + return true; + } + + function onChange(crap, skipPrevCheck) { + if( lastKeyPressCode == KEY.DEL ) { + select.hide(); + return; + } + + var currentValue = $input.val(); + + if ( !skipPrevCheck && currentValue == previousValue ) + return; + + previousValue = currentValue; + + currentValue = lastWord(currentValue); + if ( currentValue.length >= options.minChars) { + $input.addClass(options.loadingClass); + if (!options.matchCase) + currentValue = currentValue.toLowerCase(); + request(currentValue, receiveData, hideResultsNow); + } else { + stopLoading(); + select.hide(); + } + }; + + function trimWords(value) { + if ( !value ) { + return [""]; + } + var words = value.split( options.multipleSeparator ); + var result = []; + $.each(words, function(i, value) { + if ( $.trim(value) ) + result[i] = $.trim(value); + }); + return result; + } + + function lastWord(value) { + if ( !options.multiple ) + return value; + var words = trimWords(value); + return words[words.length - 1]; + } + + // fills in the input box w/the first match (assumed to be the best match) + // q: the term entered + // sValue: the first matching result + function autoFill(q, sValue){ + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + // if the last user key pressed was backspace, don't autofill + if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); + // select the portion of the value not typed by the user (so the next character will erase) + $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); + } + }; + + function hideResults() { + clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + var wasVisible = select.visible(); + select.hide(); + clearTimeout(timeout); + stopLoading(); + if (options.mustMatch) { + // call search and run callback + $input.search( + function (result){ + // if no value found, clear the input box + if( !result ) { + if (options.multiple) { + var words = trimWords($input.val()).slice(0, -1); + $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); + } + else + $input.val( "" ); + } + } + ); + } + if (wasVisible) + // position cursor at end of input field + $.Autocompleter.Selection(input, input.value.length, input.value.length); + }; + + function receiveData(q, data) { + if ( data && data.length && hasFocus ) { + stopLoading(); + select.display(data, q); + autoFill(q, data[0].value); + select.show(); + } else { + hideResultsNow(); + } + }; + + function request(term, success, failure) { + if (!options.matchCase) + term = term.toLowerCase(); + var data = cache.load(term); + // recieve the cached data + if (data && data.length) { + success(term, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + + var extraParams = { + timestamp: +new Date() + }; + $.each(options.extraParams, function(key, param) { + extraParams[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + // try to leverage ajaxQueue plugin to abort previous requests + mode: "abort", + // limit abortion to this input + port: "autocomplete" + input.name, + dataType: options.dataType, + url: options.url, + data: $.extend({ + q: lastWord(term), + limit: options.max + }, extraParams), + success: function(data) { + var parsed = options.parse && options.parse(data) || parse(data); + cache.add(term, parsed); + success(term, parsed); + } + }); + } else { + // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match + select.emptyList(); + failure(term); + } + }; + + function parse(data) { + var parsed = []; + var rows = data.split("\n"); + for (var i=0; i < rows.length; i++) { + var row = $.trim(rows[i]); + if (row) { + row = row.split("|"); + parsed[parsed.length] = { + data: row, + value: row[0], + result: options.formatResult && options.formatResult(row, row[0]) || row[0] + }; + } + } + return parsed; + }; + + function stopLoading() { + $input.removeClass(options.loadingClass); + }; + +}; + +$.Autocompleter.defaults = { + inputClass: "ac_input", + resultsClass: "ac_results", + loadingClass: "ac_loading", + minChars: 1, + delay: 400, + matchCase: false, + matchSubset: true, + matchContains: false, + cacheLength: 10, + max: 100, + mustMatch: false, + extraParams: {}, + selectFirst: true, + formatItem: function(row) { return row[0]; }, + formatMatch: null, + autoFill: false, + width: 0, + multiple: false, + multipleSeparator: ", ", + highlight: function(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + }, + scroll: true, + scrollHeight: 180 +}; + +$.Autocompleter.Cache = function(options) { + + var data = {}; + var length = 0; + + function matchSubset(s, sub) { + if (!options.matchCase) + s = s.toLowerCase(); + var i = s.indexOf(sub); + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + function add(q, value) { + if (length > options.cacheLength){ + flush(); + } + if (!data[q]){ + length++; + } + data[q] = value; + } + + function populate(){ + if( !options.data ) return false; + // track the matches + var stMatchSets = {}, + nullData = 0; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( !options.url ) options.cacheLength = 1; + + // track all options for minChars = 0 + stMatchSets[""] = []; + + // loop through the array and create a lookup structure + for ( var i = 0, ol = options.data.length; i < ol; i++ ) { + var rawValue = options.data[i]; + // if rawValue is a string, make an array otherwise just reference the array + rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; + + var value = options.formatMatch(rawValue, i+1, options.data.length); + if ( value === false ) + continue; + + var firstChar = value.charAt(0).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[firstChar] ) + stMatchSets[firstChar] = []; + + // if the match is a string + var row = { + value: value, + data: rawValue, + result: options.formatResult && options.formatResult(rawValue) || value + }; + + // push the current match into the set list + stMatchSets[firstChar].push(row); + + // keep track of minChars zero items + if ( nullData++ < options.max ) { + stMatchSets[""].push(row); + } + }; + + // add the data items to the cache + $.each(stMatchSets, function(i, value) { + // increase the cache size + options.cacheLength++; + // add to the cache + add(i, value); + }); + } + + // populate any existing data + setTimeout(populate, 25); + + function flush(){ + data = {}; + length = 0; + } + + return { + flush: flush, + add: add, + populate: populate, + load: function(q) { + if (!options.cacheLength || !length) + return null; + /* + * if dealing w/local data and matchContains than we must make sure + * to loop through all the data collections looking for matches + */ + if( !options.url && options.matchContains ){ + // track all matches + var csub = []; + // loop through all the data grids for matches + for( var k in data ){ + // don't search through the stMatchSets[""] (minChars: 0) cache + // this prevents duplicates + if( k.length > 0 ){ + var c = data[k]; + $.each(c, function(i, x) { + // if we've got a match, add it to the array + if (matchSubset(x.value, q)) { + csub.push(x); + } + }); + } + } + return csub; + } else + // if the exact item exists, use it + if (data[q]){ + return data[q]; + } else + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var c = data[q.substr(0, i)]; + if (c) { + var csub = []; + $.each(c, function(i, x) { + if (matchSubset(x.value, q)) { + csub[csub.length] = x; + } + }); + return csub; + } + } + } + return null; + } + }; +}; + +$.Autocompleter.Select = function (options, input, select, config) { + var CLASSES = { + ACTIVE: "ac_over" + }; + + var listItems, + active = -1, + data, + term = "", + needsInit = true, + element, + list; + + // Create results + function init() { + if (!needsInit) + return; + element = $("
        ") + .hide() + .addClass(options.resultsClass) + .css("position", "absolute") + .appendTo(document.body); + + list = $("
          ").appendTo(element).mouseover( function(event) { + if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { + active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); + $(target(event)).addClass(CLASSES.ACTIVE); + } + }).click(function(event) { + $(target(event)).addClass(CLASSES.ACTIVE); + select(); + // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus + input.focus(); + return false; + }).mousedown(function() { + config.mouseDownOnSelect = true; + }).mouseup(function() { + config.mouseDownOnSelect = false; + }); + + if( options.width > 0 ) + element.css("width", options.width); + + needsInit = false; + } + + function target(event) { + var element = event.target; + while(element && element.tagName != "LI") + element = element.parentNode; + // more fun with IE, sometimes event.target is empty, just ignore it then + if(!element) + return []; + return element; + } + + function moveSelect(step) { + listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); + movePosition(step); + var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); + if(options.scroll) { + var offset = 0; + listItems.slice(0, active).each(function() { + offset += this.offsetHeight; + }); + if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { + list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); + } else if(offset < list.scrollTop()) { + list.scrollTop(offset); + } + } + }; + + function movePosition(step) { + active += step; + if (active < 0) { + active = listItems.size() - 1; + } else if (active >= listItems.size()) { + active = 0; + } + } + + function limitNumberOfItems(available) { + return options.max && options.max < available + ? options.max + : available; + } + + function fillList() { + list.empty(); + var max = limitNumberOfItems(data.length); + for (var i=0; i < max; i++) { + if (!data[i]) + continue; + var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); + if ( formatted === false ) + continue; + var li = $("
        • ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; + $.data(li, "ac_data", data[i]); + } + listItems = list.find("li"); + if ( options.selectFirst ) { + listItems.slice(0, 1).addClass(CLASSES.ACTIVE); + active = 0; + } + // apply bgiframe if available + if ( $.fn.bgiframe ) + list.bgiframe(); + } + + return { + display: function(d, q) { + init(); + data = d; + term = q; + fillList(); + }, + next: function() { + moveSelect(1); + }, + prev: function() { + moveSelect(-1); + }, + pageUp: function() { + if (active != 0 && active - 8 < 0) { + moveSelect( -active ); + } else { + moveSelect(-8); + } + }, + pageDown: function() { + if (active != listItems.size() - 1 && active + 8 > listItems.size()) { + moveSelect( listItems.size() - 1 - active ); + } else { + moveSelect(8); + } + }, + hide: function() { + element && element.hide(); + listItems && listItems.removeClass(CLASSES.ACTIVE); + active = -1; + }, + visible : function() { + return element && element.is(":visible"); + }, + current: function() { + return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); + }, + show: function() { + var offset = $(input).offset(); + element.css({ + width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), + top: offset.top + input.offsetHeight, + left: offset.left + }).show(); + if(options.scroll) { + list.css({ + maxHeight: options.scrollHeight, + overflow: 'auto' + }); + + if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { + var listHeight = 0; + listItems.each(function() { + listHeight += this.offsetHeight; + }); + var scrollbarsVisible = listHeight > options.scrollHeight; + list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); + if (!scrollbarsVisible) { + // IE doesn't recalculate width when scrollbar disappears + listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); + } + } + + } + }, + selected: function() { + var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); + return selected && selected.length && $.data(selected[0], "ac_data"); + }, + emptyList: function (){ + list && list.empty(); + }, + unbind: function() { + element && element.remove(); + } + }; +}; + +$.Autocompleter.Selection = function(field, start, end) { + if( field.createTextRange ){ + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart("character", start); + selRange.moveEnd("character", end); + selRange.select(); + } else if( field.setSelectionRange ){ + field.setSelectionRange(start, end); + } else { + if( field.selectionStart ){ + field.selectionStart = start; + field.selectionEnd = end; + } + } + field.focus(); +}; + +})(jQuery); diff --git a/js/jquery/jquery.cluetip.js b/js/jquery/jquery.cluetip.js new file mode 100644 index 000000000..fa7cc0725 --- /dev/null +++ b/js/jquery/jquery.cluetip.js @@ -0,0 +1,42 @@ +/* + * documentation & download : http://plugins.learningjquery.com/cluetip/ +*/ +/* + * jQuery clueTip plugin + * Version 0.9.8 (05/22/2008) + * @requires jQuery v1.1.4+ + * @requires Dimensions plugin (for jQuery versions < 1.2.5) + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +;(function($){var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;} +return this.each(function(index){var $this=$(this);var opts=$.extend(false,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=parseInt(opts.cluezIndex,10)-1;var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$cluetipInner=$('
          ');$cluetipTitle=$('

          ');$cluetipOuter=$('
          ').append($cluetipInner).prepend($cluetipTitle);$cluetip=$('
          ').css({zIndex:opts.cluezIndex}).append($cluetipOuter).append('
          ')[insertionType](insertionElement).hide();$('
          ').css({position:'absolute',zIndex:cluezIndex-1}).insertBefore('#cluetip').hide();$cluetip.css({position:'absolute',zIndex:cluezIndex});$cluetipOuter.css({position:'relative',zIndex:cluezIndex+1});$cluetipArrows=$('
          ').css({zIndex:cluezIndex+1}).appendTo('#cluetip');} +var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i
        ').css({zIndex:cluezIndex-i-1,opacity:.1,top:1+i,left:1+i}));};$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);} +var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js)return true;if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();} +var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight;var defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=isNaN(parseInt(opts.width,10))?275:parseInt(opts.width,10);var tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'))||0)+(parseInt($cluetip.css('paddingRight'))||0)+dropShadowSteps;var linkWidth=this.offsetWidth;var linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';} +tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();} +var localContent;var activate=function(event){if(!opts.onActivate($this)){return false;} +isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);} +$this.attr('title','');if(opts.hoverClass){$this.addClass(opts.hoverClass);} +linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if($this[0].tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();} +if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if($this[0].tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}} +var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0)});} +wHeight=$(window).height();if(js){$cluetipInner.html(js);cluetipShow(pY);} +else if(tipParts){var tpl=tipParts.length;for(var i=0;i'+tipParts[i]+'');}};cluetipShow(pY);} +else if(!opts.local&&tipAttribute.indexOf('#')!=0){if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);} +else{var ajaxSettings=opts.ajaxSettings;ajaxSettings.url=tipAttribute;ajaxSettings.beforeSend=function(){$cluetipOuter.children().empty();if(opts.waitImage){$('#cluetip-waitimage').css({top:mouseY+20,left:mouseX+20}).show();}};ajaxSettings.error=function(){if(isActive){$cluetipInner.html('sorry, the contents could not be loaded');}};ajaxSettings.success=function(data){cluetipContents=opts.ajaxProcess(data);if(isActive){$cluetipInner.html(cluetipContents);}};ajaxSettings.complete=function(){imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').load(function(){imgCount--;if(imgCount<1){$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY);}});}else{$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY);}};$.ajax(ajaxSettings);}}else if(opts.local){var $localContent=$(tipAttribute+':first');var localCluetip=$.fn.wrapInner?$localContent.wrapInner('
        ').children().clone(true):$localContent.html();$.fn.wrapInner?$cluetipInner.empty().append(localCluetip):$cluetipInner.html(localCluetip);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);} +function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html(' '):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.click(function(){cluetipClose();return false;});if(opts.mouseOutClose){if($.fn.hoverIntent&&opts.hoverIntent){$cluetip.hoverIntent({over:doNothing,timeout:opts.hoverIntent.timeout,out:function(){$closeLink.trigger('click');}});}else{$cluetip.hover(doNothing,function(){$closeLink.trigger('click');});}}else{$cluetip.unbind('mouseout');}} +var direction='';$cluetipOuter.css({overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posXmouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||$this[0].tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;} +if(direction==''){posX=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();} +$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!='show'&&opts.fx.openSpeed);if(opts.dropShadow)$dropShadow.css({height:tipHeight,width:tipInnerWidth}).show();if($.fn.bgiframe){$cluetip.bgiframe();} +if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);} +opts.onShow($cluetip,$cluetipInner);};var inactivate=function(){isActive=false;$('#cluetip-waitimage').hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);};if(opts.hoverClass){$this.removeClass(opts.hoverClass);} +$('.cluetip-clicked').removeClass('cluetip-clicked');};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass().end().children().empty();if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);} +$this.css('cursor','');if(opts.arrows)$cluetipArrows.css({top:''});};if((/click|toggle/).test(opts.activation)){$this.click(function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);} +this.blur();return false;});}else if(opts.activation=='focus'){$this.focus(function(event){activate(event);});$this.blur(function(event){inactivate(event);});}else{$this.click(function(){if($this.attr('href')&&$this.attr('href')==tipAttribute&&!opts.clickThrough){return false;}});var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.mousemove(function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.mouseover(function(){$this.attr('title','');}).hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove');}});}else{$this.hover(function(event){activate(event);mouseTracks(event);},function(event){inactivate(event);$this.unbind('mousemove');});}}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,c){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(//g,'').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip={};$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;} +if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery); diff --git a/js/jquery/jquery.dimensions.js b/js/jquery/jquery.dimensions.js new file mode 100644 index 000000000..34c06deea --- /dev/null +++ b/js/jquery/jquery.dimensions.js @@ -0,0 +1,12 @@ +/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $ + * $Rev: 4257 $ + * + * Version: 1.2 + * + * Requires: jQuery 1.2+ + */ +(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.easing.1.3.js b/js/jquery/jquery.easing.1.3.js new file mode 100644 index 000000000..0369b1d17 --- /dev/null +++ b/js/jquery/jquery.easing.1.3.js @@ -0,0 +1,146 @@ +/* + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Uses the built In easIng capabilities added In jQuery 1.1 + * to offer multiple easIng options + * + * Copyright (c) 2007 George Smith + * Licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + */ + +// t: current time, b: begInnIng value, c: change In value, d: duration +jQuery.easing['jswing'] = jQuery.easing['swing']; + +jQuery.extend( jQuery.easing, +{ + def: 'easeOutQuad', + swing: function (x, t, b, c, d) { + //alert(jQuery.easing.default); + return jQuery.easing[jQuery.easing.def](x, t, b, c, d); + }, + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); diff --git a/js/jquery/jquery.fancybox-1.3.4.js b/js/jquery/jquery.fancybox-1.3.4.js new file mode 100644 index 000000000..be7727537 --- /dev/null +++ b/js/jquery/jquery.fancybox-1.3.4.js @@ -0,0 +1,1156 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function($) { + var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, + + selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], + + ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, + + loadingTimer, loadingFrame = 1, + + titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
        ')[0], { prop: 0 }), + + isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, + + /* + * Private methods + */ + + _abort = function() { + loading.hide(); + + imgPreloader.onerror = imgPreloader.onload = null; + + if (ajaxLoader) { + ajaxLoader.abort(); + } + + tmp.empty(); + }, + + _error = function() { + if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { + loading.hide(); + busy = false; + return; + } + + selectedOpts.titleShow = false; + + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + + tmp.html( '

        The requested content cannot be loaded.
        Please try again later.

        ' ); + + _process_inline(); + }, + + _start = function() { + var obj = selectedArray[ selectedIndex ], + href, + type, + title, + str, + emb, + ret; + + _abort(); + + selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); + + ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); + + if (ret === false) { + busy = false; + return; + } else if (typeof ret == 'object') { + selectedOpts = $.extend(selectedOpts, ret); + } + + title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; + + if (obj.nodeName && !selectedOpts.orig) { + selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); + } + + if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { + title = selectedOpts.orig.attr('alt'); + } + + href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; + + if ((/^(?:javascript)/i).test(href) || href == '#') { + href = null; + } + + if (selectedOpts.type) { + type = selectedOpts.type; + + if (!href) { + href = selectedOpts.content; + } + + } else if (selectedOpts.content) { + type = 'html'; + + } else if (href) { + if (href.match(imgRegExp)) { + type = 'image'; + + } else if (href.match(swfRegExp)) { + type = 'swf'; + + } else if ($(obj).hasClass("iframe")) { + type = 'iframe'; + + } else if (href.indexOf("#") === 0) { + type = 'inline'; + + } else { + type = 'ajax'; + } + } + + if (!type) { + _error(); + return; + } + + if (type == 'inline') { + obj = href.substr(href.indexOf("#")); + type = $(obj).length > 0 ? 'inline' : 'ajax'; + } + + selectedOpts.type = type; + selectedOpts.href = href; + selectedOpts.title = title; + + if (selectedOpts.autoDimensions) { + if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + } else { + selectedOpts.autoDimensions = false; + } + } + + if (selectedOpts.modal) { + selectedOpts.overlayShow = true; + selectedOpts.hideOnOverlayClick = false; + selectedOpts.hideOnContentClick = false; + selectedOpts.enableEscapeButton = false; + selectedOpts.showCloseButton = false; + } + + selectedOpts.padding = parseInt(selectedOpts.padding, 10); + selectedOpts.margin = parseInt(selectedOpts.margin, 10); + + tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); + + $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { + $(this).replaceWith(content.children()); + }); + + switch (type) { + case 'html' : + tmp.html( selectedOpts.content ); + _process_inline(); + break; + + case 'inline' : + if ( $(obj).parent().is('#fancybox-content') === true) { + busy = false; + return; + } + + $('
        ') + .hide() + .insertBefore( $(obj) ) + .bind('fancybox-cleanup', function() { + $(this).replaceWith(content.children()); + }).bind('fancybox-cancel', function() { + $(this).replaceWith(tmp.children()); + }); + + $(obj).appendTo(tmp); + + _process_inline(); + break; + + case 'image': + busy = false; + + $.fancybox.showActivity(); + + imgPreloader = new Image(); + + imgPreloader.onerror = function() { + _error(); + }; + + imgPreloader.onload = function() { + busy = true; + + imgPreloader.onerror = imgPreloader.onload = null; + + _process_image(); + }; + + imgPreloader.src = href; + break; + + case 'swf': + selectedOpts.scrolling = 'no'; + + str = ''; + emb = ''; + + $.each(selectedOpts.swf, function(name, val) { + str += ''; + emb += ' ' + name + '="' + val + '"'; + }); + + str += ''; + + tmp.html(str); + + _process_inline(); + break; + + case 'ajax': + busy = false; + + $.fancybox.showActivity(); + + selectedOpts.ajax.win = selectedOpts.ajax.success; + + ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { + url : href, + data : selectedOpts.ajax.data || {}, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if ( XMLHttpRequest.status > 0 ) { + _error(); + } + }, + success : function(data, textStatus, XMLHttpRequest) { + var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; + if (o.status == 200) { + if ( typeof selectedOpts.ajax.win == 'function' ) { + ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); + + if (ret === false) { + loading.hide(); + return; + } else if (typeof ret == 'string' || typeof ret == 'object') { + data = ret; + } + } + + tmp.html( data ); + _process_inline(); + } + } + })); + + break; + + case 'iframe': + _show(); + break; + } + }, + + _process_inline = function() { + var + w = selectedOpts.width, + h = selectedOpts.height; + + if (w.toString().indexOf('%') > -1) { + w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; + + } else { + w = w == 'auto' ? 'auto' : w + 'px'; + } + + if (h.toString().indexOf('%') > -1) { + h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; + + } else { + h = h == 'auto' ? 'auto' : h + 'px'; + } + + tmp.wrapInner('
        '); + + selectedOpts.width = tmp.width(); + selectedOpts.height = tmp.height(); + + _show(); + }, + + _process_image = function() { + selectedOpts.width = imgPreloader.width; + selectedOpts.height = imgPreloader.height; + + $("").attr({ + 'id' : 'fancybox-img', + 'src' : imgPreloader.src, + 'alt' : selectedOpts.title + }).appendTo( tmp ); + + _show(); + }, + + _show = function() { + var pos, equal; + + loading.hide(); + + if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + $.event.trigger('fancybox-cancel'); + + busy = false; + return; + } + + busy = true; + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { + wrap.css('height', wrap.height()); + } + + currentArray = selectedArray; + currentIndex = selectedIndex; + currentOpts = selectedOpts; + + if (currentOpts.overlayShow) { + overlay.css({ + 'background-color' : currentOpts.overlayColor, + 'opacity' : currentOpts.overlayOpacity, + 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', + 'height' : $(document).height() + }); + + if (!overlay.is(':visible')) { + if (isIE6) { + $('select:not(#fancybox-tmp select)').filter(function() { + return this.style.visibility !== 'hidden'; + }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { + this.style.visibility = 'inherit'; + }); + } + + overlay.show(); + } + } else { + overlay.hide(); + } + + final_pos = _get_zoom_to(); + + _process_title(); + + if (wrap.is(":visible")) { + $( close.add( nav_left ).add( nav_right ) ).hide(); + + pos = wrap.position(), + + start_pos = { + top : pos.top, + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); + + content.fadeTo(currentOpts.changeFade, 0.3, function() { + var finish_resizing = function() { + content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); + }; + + $.event.trigger('fancybox-change'); + + content + .empty() + .removeAttr('filter') + .css({ + 'border-width' : currentOpts.padding, + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }); + + if (equal) { + finish_resizing(); + + } else { + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.changeSpeed, + easing : currentOpts.easingChange, + step : _draw, + complete : finish_resizing + }); + } + }); + + return; + } + + wrap.removeAttr("style"); + + content.css('border-width', currentOpts.padding); + + if (currentOpts.transitionIn == 'elastic') { + start_pos = _get_zoom_from(); + + content.html( tmp.contents() ); + + wrap.show(); + + if (currentOpts.opacity) { + final_pos.opacity = 0; + } + + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.speedIn, + easing : currentOpts.easingIn, + step : _draw, + complete : _finish + }); + + return; + } + + if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { + title.show(); + } + + content + .css({ + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }) + .html( tmp.contents() ); + + wrap + .css(final_pos) + .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); + }, + + _format_title = function(title) { + if (title && title.length) { + if (currentOpts.titlePosition == 'float') { + return '
        ' + title + '
        '; + } + + return '
        ' + title + '
        '; + } + + return false; + }, + + _process_title = function() { + titleStr = currentOpts.title || ''; + titleHeight = 0; + + title + .empty() + .removeAttr('style') + .removeClass(); + + if (currentOpts.titleShow === false) { + title.hide(); + return; + } + + titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); + + if (!titleStr || titleStr === '') { + title.hide(); + return; + } + + title + .addClass('fancybox-title-' + currentOpts.titlePosition) + .html( titleStr ) + .appendTo( 'body' ) + .show(); + + switch (currentOpts.titlePosition) { + case 'inside': + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'marginLeft' : currentOpts.padding, + 'marginRight' : currentOpts.padding + }); + + titleHeight = title.outerHeight(true); + + title.appendTo( outer ); + + final_pos.height += titleHeight; + break; + + case 'over': + title + .css({ + 'marginLeft' : currentOpts.padding, + 'width' : final_pos.width - (currentOpts.padding * 2), + 'bottom' : currentOpts.padding + }) + .appendTo( outer ); + break; + + case 'float': + title + .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) + .appendTo( wrap ); + break; + + default: + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'paddingLeft' : currentOpts.padding, + 'paddingRight' : currentOpts.padding + }) + .appendTo( wrap ); + break; + } + + title.hide(); + }, + + _set_navigation = function() { + if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { + $(document).bind('keydown.fb', function(e) { + if (e.keyCode == 27 && currentOpts.enableEscapeButton) { + e.preventDefault(); + $.fancybox.close(); + + } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { + e.preventDefault(); + $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); + } + }); + } + + if (!currentOpts.showNavArrows) { + nav_left.hide(); + nav_right.hide(); + return; + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { + nav_left.show(); + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { + nav_right.show(); + } + }, + + _finish = function () { + if (!$.support.opacity) { + content.get(0).style.removeAttribute('filter'); + wrap.get(0).style.removeAttribute('filter'); + } + + if (selectedOpts.autoDimensions) { + content.css('height', 'auto'); + } + + wrap.css('height', 'auto'); + + if (titleStr && titleStr.length) { + title.show(); + } + + if (currentOpts.showCloseButton) { + close.show(); + } + + _set_navigation(); + + if (currentOpts.hideOnContentClick) { + content.bind('click', $.fancybox.close); + } + + if (currentOpts.hideOnOverlayClick) { + overlay.bind('click', $.fancybox.close); + } + + $(window).bind("resize.fb", $.fancybox.resize); + + if (currentOpts.centerOnScroll) { + $(window).bind("scroll.fb", $.fancybox.center); + } + + if (currentOpts.type == 'iframe') { + $('').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('
        '), + loading = $('
        '), + overlay = $('
        '), + wrap = $('
        ') + ); + + outer = $('
        ') + .append('
        ') + .appendTo( wrap ); + + outer.append( + content = $('
        '), + close = $(''), + title = $('
        '), + + nav_left = $(''), + nav_right = $('') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + +})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.flot.min.js b/js/jquery/jquery.flot.min.js new file mode 100644 index 000000000..31f465b83 --- /dev/null +++ b/js/jquery/jquery.flot.min.js @@ -0,0 +1 @@ +(function(){jQuery.color={};jQuery.color.make=function(G,H,J,I){var A={};A.r=G||0;A.g=H||0;A.b=J||0;A.a=I!=null?I:1;A.add=function(C,D){for(var E=0;E=1){return"rgb("+[A.r,A.g,A.b].join(",")+")"}else{return"rgba("+[A.r,A.g,A.b,A.a].join(",")+")"}};A.normalize=function(){function C(E,D,F){return DF?F:D)}A.r=C(0,parseInt(A.r),255);A.g=C(0,parseInt(A.g),255);A.b=C(0,parseInt(A.b),255);A.a=C(0,A.a,1);return A};A.clone=function(){return jQuery.color.make(A.r,A.b,A.g,A.a)};return A.normalize()};jQuery.color.extract=function(E,F){var A;do{A=E.css(F).toLowerCase();if(A!=""&&A!="transparent"){break}E=E.parent()}while(!jQuery.nodeName(E.get(0),"body"));if(A=="rgba(0, 0, 0, 0)"){A="transparent"}return jQuery.color.parse(A)};jQuery.color.parse=function(A){var F,H=jQuery.color.make;if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(A)){return H(parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10))}if(F=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(A)){return H(parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10),parseFloat(F[4]))}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(A)){return H(parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55)}if(F=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(A)){return H(parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55,parseFloat(F[4]))}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(A)){return H(parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16))}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(A)){return H(parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16))}var G=jQuery.trim(A).toLowerCase();if(G=="transparent"){return H(255,255,255,0)}else{F=B[G];return H(F[0],F[1],F[2])}};var B={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})();(function(C){function B(l,W,X,E){var O=[],g={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{mode:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02},x2axis:{autoscaleMargin:null},y2axis:{autoscaleMargin:0.02},series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,tickColor:"rgba(0,0,0,0.15)",labelMargin:5,borderWidth:2,borderColor:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},P=null,AC=null,AD=null,Y=null,AJ=null,s={xaxis:{},yaxis:{},x2axis:{},y2axis:{}},e={left:0,right:0,top:0,bottom:0},y=0,Q=0,I=0,t=0,L={processOptions:[],processRawData:[],processDatapoints:[],draw:[],bindEvents:[],drawOverlay:[]},G=this;G.setData=f;G.setupGrid=k;G.draw=AH;G.getPlaceholder=function(){return l};G.getCanvas=function(){return P};G.getPlotOffset=function(){return e};G.width=function(){return I};G.height=function(){return t};G.offset=function(){var AK=AD.offset();AK.left+=e.left;AK.top+=e.top;return AK};G.getData=function(){return O};G.getAxes=function(){return s};G.getOptions=function(){return g};G.highlight=AE;G.unhighlight=x;G.triggerRedrawOverlay=q;G.pointOffset=function(AK){return{left:parseInt(T(AK,"xaxis").p2c(+AK.x)+e.left),top:parseInt(T(AK,"yaxis").p2c(+AK.y)+e.top)}};G.hooks=L;b(G);r(X);c();f(W);k();AH();AG();function Z(AM,AK){AK=[G].concat(AK);for(var AL=0;AL=g.colors.length){AP=0;++AO}}var AQ=0,AW;for(AP=0;APAl.datamax){Al.datamax=Aj}}for(Ac=0;Ac0&&Ab[AZ-AX]!=null&&Ab[AZ-AX]!=Ab[AZ]&&Ab[AZ-AX+1]!=Ab[AZ+1]){for(AV=0;AVAU){AU=Ai}}if(Af.y){if(AiAd){Ad=Ai}}}}if(AR.bars.show){var Ag=AR.bars.align=="left"?0:-AR.bars.barWidth/2;if(AR.bars.horizontal){AY+=Ag;Ad+=Ag+AR.bars.barWidth}else{AS+=Ag;AU+=Ag+AR.bars.barWidth}}AN(AR.xaxis,AS,AU);AN(AR.yaxis,AY,Ad)}for(AK in s){if(s[AK].datamin==AW){s[AK].datamin=null}if(s[AK].datamax==AQ){s[AK].datamax=null}}}function c(){function AK(AM,AL){var AN=document.createElement("canvas");AN.width=AM;AN.height=AL;if(C.browser.msie){AN=window.G_vmlCanvasManager.initElement(AN)}return AN}y=l.width();Q=l.height();l.html("");if(l.css("position")=="static"){l.css("position","relative")}if(y<=0||Q<=0){throw"Invalid dimensions for plot, width = "+y+", height = "+Q}if(C.browser.msie){window.G_vmlCanvasManager.init_(document)}P=C(AK(y,Q)).appendTo(l).get(0);Y=P.getContext("2d");AC=C(AK(y,Q)).css({position:"absolute",left:0,top:0}).appendTo(l).get(0);AJ=AC.getContext("2d");AJ.stroke()}function AG(){AD=C([AC,P]);if(g.grid.hoverable){AD.mousemove(D)}if(g.grid.clickable){AD.click(d)}Z(L.bindEvents,[AD])}function k(){function AL(AT,AU){function AP(AV){return AV}var AS,AO,AQ=AU.transform||AP,AR=AU.inverseTransform;if(AT==s.xaxis||AT==s.x2axis){AS=AT.scale=I/(AQ(AT.max)-AQ(AT.min));AO=AQ(AT.min);if(AQ==AP){AT.p2c=function(AV){return(AV-AO)*AS}}else{AT.p2c=function(AV){return(AQ(AV)-AO)*AS}}if(!AR){AT.c2p=function(AV){return AO+AV/AS}}else{AT.c2p=function(AV){return AR(AO+AV/AS)}}}else{AS=AT.scale=t/(AQ(AT.max)-AQ(AT.min));AO=AQ(AT.max);if(AQ==AP){AT.p2c=function(AV){return(AO-AV)*AS}}else{AT.p2c=function(AV){return(AO-AQ(AV))*AS}}if(!AR){AT.c2p=function(AV){return AO-AV/AS}}else{AT.c2p=function(AV){return AR(AO-AV/AS)}}}}function AN(AR,AT){var AQ,AS=[],AP;AR.labelWidth=AT.labelWidth;AR.labelHeight=AT.labelHeight;if(AR==s.xaxis||AR==s.x2axis){if(AR.labelWidth==null){AR.labelWidth=y/(AR.ticks.length>0?AR.ticks.length:1)}if(AR.labelHeight==null){AS=[];for(AQ=0;AQ'+AP+"
        ")}}if(AS.length>0){var AO=C('
        '+AS.join("")+'
        ').appendTo(l);AR.labelHeight=AO.height();AO.remove()}}}else{if(AR.labelWidth==null||AR.labelHeight==null){for(AQ=0;AQ'+AP+"
        ")}}if(AS.length>0){var AO=C('
        '+AS.join("")+"
        ").appendTo(l);if(AR.labelWidth==null){AR.labelWidth=AO.width()}if(AR.labelHeight==null){AR.labelHeight=AO.find("div").height()}AO.remove()}}}if(AR.labelWidth==null){AR.labelWidth=0}if(AR.labelHeight==null){AR.labelHeight=0}}function AM(){var AP=g.grid.borderWidth;for(i=0;i0){e.bottom=Math.max(AP,s.xaxis.labelHeight+AO)}if(s.yaxis.labelWidth>0){e.left=Math.max(AP,s.yaxis.labelWidth+AO)}if(s.x2axis.labelHeight>0){e.top=Math.max(AP,s.x2axis.labelHeight+AO)}if(s.y2axis.labelWidth>0){e.right=Math.max(AP,s.y2axis.labelWidth+AO)}I=y-e.left-e.right;t=Q-e.bottom-e.top}var AK;for(AK in s){K(s[AK],g[AK])}if(g.grid.show){for(AK in s){F(s[AK],g[AK]);p(s[AK],g[AK]);AN(s[AK],g[AK])}AM()}else{e.left=e.right=e.top=e.bottom=0;I=y;t=Q}for(AK in s){AL(s[AK],g[AK])}if(g.grid.show){h()}AI()}function K(AN,AQ){var AM=+(AQ.min!=null?AQ.min:AN.datamin),AK=+(AQ.max!=null?AQ.max:AN.datamax),AP=AK-AM;if(AP==0){var AL=AK==0?1:0.01;if(AQ.min==null){AM-=AL}if(AQ.max==null||AQ.min!=null){AK+=AL}}else{var AO=AQ.autoscaleMargin;if(AO!=null){if(AQ.min==null){AM-=AP*AO;if(AM<0&&AN.datamin!=null&&AN.datamin>=0){AM=0}}if(AQ.max==null){AK+=AP*AO;if(AK>0&&AN.datamax!=null&&AN.datamax<=0){AK=0}}}}AN.min=AM;AN.max=AK}function F(AP,AS){var AO;if(typeof AS.ticks=="number"&&AS.ticks>0){AO=AS.ticks}else{if(AP==s.xaxis||AP==s.x2axis){AO=0.3*Math.sqrt(y)}else{AO=0.3*Math.sqrt(Q)}}var AX=(AP.max-AP.min)/AO,AZ,AT,AV,AW,AR,AM,AL;if(AS.mode=="time"){var AU={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var AY=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var AN=0;if(AS.minTickSize!=null){if(typeof AS.tickSize=="number"){AN=AS.tickSize}else{AN=AS.minTickSize[0]*AU[AS.minTickSize[1]]}}for(AR=0;AR=AN){break}}AZ=AY[AR][0];AV=AY[AR][1];if(AV=="year"){AM=Math.pow(10,Math.floor(Math.log(AX/AU.year)/Math.LN10));AL=(AX/AU.year)/AM;if(AL<1.5){AZ=1}else{if(AL<3){AZ=2}else{if(AL<7.5){AZ=5}else{AZ=10}}}AZ*=AM}if(AS.tickSize){AZ=AS.tickSize[0];AV=AS.tickSize[1]}AT=function(Ac){var Ah=[],Af=Ac.tickSize[0],Ai=Ac.tickSize[1],Ag=new Date(Ac.min);var Ab=Af*AU[Ai];if(Ai=="second"){Ag.setUTCSeconds(A(Ag.getUTCSeconds(),Af))}if(Ai=="minute"){Ag.setUTCMinutes(A(Ag.getUTCMinutes(),Af))}if(Ai=="hour"){Ag.setUTCHours(A(Ag.getUTCHours(),Af))}if(Ai=="month"){Ag.setUTCMonth(A(Ag.getUTCMonth(),Af))}if(Ai=="year"){Ag.setUTCFullYear(A(Ag.getUTCFullYear(),Af))}Ag.setUTCMilliseconds(0);if(Ab>=AU.minute){Ag.setUTCSeconds(0)}if(Ab>=AU.hour){Ag.setUTCMinutes(0)}if(Ab>=AU.day){Ag.setUTCHours(0)}if(Ab>=AU.day*4){Ag.setUTCDate(1)}if(Ab>=AU.year){Ag.setUTCMonth(0)}var Ak=0,Aj=Number.NaN,Ad;do{Ad=Aj;Aj=Ag.getTime();Ah.push({v:Aj,label:Ac.tickFormatter(Aj,Ac)});if(Ai=="month"){if(Af<1){Ag.setUTCDate(1);var Aa=Ag.getTime();Ag.setUTCMonth(Ag.getUTCMonth()+1);var Ae=Ag.getTime();Ag.setTime(Aj+Ak*AU.hour+(Ae-Aa)*Af);Ak=Ag.getUTCHours();Ag.setUTCHours(0)}else{Ag.setUTCMonth(Ag.getUTCMonth()+Af)}}else{if(Ai=="year"){Ag.setUTCFullYear(Ag.getUTCFullYear()+Af)}else{Ag.setTime(Aj+Ab)}}}while(AjAK){AQ=AK}AM=Math.pow(10,-AQ);AL=AX/AM;if(AL<1.5){AZ=1}else{if(AL<3){AZ=2;if(AL>2.25&&(AK==null||AQ+1<=AK)){AZ=2.5;++AQ}}else{if(AL<7.5){AZ=5}else{AZ=10}}}AZ*=AM;if(AS.minTickSize!=null&&AZ0){AO.ticks=AO.tickGenerator(AO)}}else{if(AQ.ticks){var AP=AQ.ticks;if(C.isFunction(AP)){AP=AP({min:AO.min,max:AO.max})}var AN,AK;for(AN=0;AN1){AL=AM[1]}}else{AK=AM}if(AL==null){AL=AO.tickFormatter(AK,AO)}AO.ticks[AN]={v:AK,label:AL}}}}}if(AQ.autoscaleMargin!=null&&AO.ticks.length>0){if(AQ.min==null){AO.min=Math.min(AO.min,AO.ticks[0].v)}if(AQ.max==null&&AO.ticks.length>1){AO.max=Math.max(AO.max,AO.ticks[AO.ticks.length-1].v)}}}function AH(){Y.clearRect(0,0,y,Q);var AL=g.grid;if(AL.show&&!AL.aboveData){S()}for(var AK=0;AKAP){return{from:AP,to:AQ,axis:AN}}return{from:AQ,to:AP,axis:AN}}function S(){var AO;Y.save();Y.translate(e.left,e.top);if(g.grid.backgroundColor){Y.fillStyle=R(g.grid.backgroundColor,t,0,"rgba(255, 255, 255, 0)");Y.fillRect(0,0,I,t)}var AL=g.grid.markings;if(AL){if(C.isFunction(AL)){AL=AL({xmin:s.xaxis.min,xmax:s.xaxis.max,ymin:s.yaxis.min,ymax:s.yaxis.max,xaxis:s.xaxis,yaxis:s.yaxis,x2axis:s.x2axis,y2axis:s.y2axis})}for(AO=0;AOAQ.axis.max||AN.toAN.axis.max){continue}AQ.from=Math.max(AQ.from,AQ.axis.min);AQ.to=Math.min(AQ.to,AQ.axis.max);AN.from=Math.max(AN.from,AN.axis.min);AN.to=Math.min(AN.to,AN.axis.max);if(AQ.from==AQ.to&&AN.from==AN.to){continue}AQ.from=AQ.axis.p2c(AQ.from);AQ.to=AQ.axis.p2c(AQ.to);AN.from=AN.axis.p2c(AN.from);AN.to=AN.axis.p2c(AN.to);if(AQ.from==AQ.to||AN.from==AN.to){Y.beginPath();Y.strokeStyle=AK.color||g.grid.markingsColor;Y.lineWidth=AK.lineWidth||g.grid.markingsLineWidth;Y.moveTo(AQ.from,AN.from);Y.lineTo(AQ.to,AN.to);Y.stroke()}else{Y.fillStyle=AK.color||g.grid.markingsColor;Y.fillRect(AQ.from,AN.to,AQ.to-AQ.from,AN.from-AN.to)}}}Y.lineWidth=1;Y.strokeStyle=g.grid.tickColor;Y.beginPath();var AM,AP=s.xaxis;for(AO=0;AO=s.xaxis.max){continue}Y.moveTo(Math.floor(AP.p2c(AM))+Y.lineWidth/2,0);Y.lineTo(Math.floor(AP.p2c(AM))+Y.lineWidth/2,t)}AP=s.yaxis;for(AO=0;AO=AP.max){continue}Y.moveTo(0,Math.floor(AP.p2c(AM))+Y.lineWidth/2);Y.lineTo(I,Math.floor(AP.p2c(AM))+Y.lineWidth/2)}AP=s.x2axis;for(AO=0;AO=AP.max){continue}Y.moveTo(Math.floor(AP.p2c(AM))+Y.lineWidth/2,-5);Y.lineTo(Math.floor(AP.p2c(AM))+Y.lineWidth/2,5)}AP=s.y2axis;for(AO=0;AO=AP.max){continue}Y.moveTo(I-5,Math.floor(AP.p2c(AM))+Y.lineWidth/2);Y.lineTo(I+5,Math.floor(AP.p2c(AM))+Y.lineWidth/2)}Y.stroke();if(g.grid.borderWidth){var AR=g.grid.borderWidth;Y.lineWidth=AR;Y.strokeStyle=g.grid.borderColor;Y.strokeRect(-AR/2,-AR/2,I+AR,t+AR)}Y.restore()}function h(){l.find(".tickLabels").remove();var AK=['
        '];function AM(AP,AQ){for(var AO=0;AOAP.max){continue}AK.push(AQ(AN,AP))}}var AL=g.grid.labelMargin+g.grid.borderWidth;AM(s.xaxis,function(AN,AO){return'
        '+AN.label+"
        "});AM(s.yaxis,function(AN,AO){return'
        '+AN.label+"
        "});AM(s.x2axis,function(AN,AO){return'
        '+AN.label+"
        "});AM(s.y2axis,function(AN,AO){return'
        '+AN.label+"
        "});AK.push("
        ");l.append(AK.join(""))}function AA(AK){if(AK.lines.show){a(AK)}if(AK.bars.show){n(AK)}if(AK.points.show){o(AK)}}function a(AN){function AM(AY,AZ,AR,Ad,Ac){var Ae=AY.points,AS=AY.pointsize,AW=null,AV=null;Y.beginPath();for(var AX=AS;AX=Aa&&Ab>Ac.max){if(Aa>Ac.max){continue}AU=(Ac.max-Ab)/(Aa-Ab)*(AT-AU)+AU;Ab=Ac.max}else{if(Aa>=Ab&&Aa>Ac.max){if(Ab>Ac.max){continue}AT=(Ac.max-Ab)/(Aa-Ab)*(AT-AU)+AU;Aa=Ac.max}}if(AU<=AT&&AU=AT&&AU>Ad.max){if(AT>Ad.max){continue}Ab=(Ad.max-AU)/(AT-AU)*(Aa-Ab)+Ab;AU=Ad.max}else{if(AT>=AU&&AT>Ad.max){if(AU>Ad.max){continue}Aa=(Ad.max-AU)/(AT-AU)*(Aa-Ab)+Ab;AT=Ad.max}}if(AU!=AW||Ab!=AV){Y.moveTo(Ad.p2c(AU)+AZ,Ac.p2c(Ab)+AR)}AW=AT;AV=Aa;Y.lineTo(Ad.p2c(AT)+AZ,Ac.p2c(Aa)+AR)}Y.stroke()}function AO(AX,Ae,Ac){var Af=AX.points,AR=AX.pointsize,AS=Math.min(Math.max(0,Ac.min),Ac.max),Aa,AV=0,Ad=false;for(var AW=AR;AW=AT&&AU>Ae.max){if(AT>Ae.max){continue}Ab=(Ae.max-AU)/(AT-AU)*(AZ-Ab)+Ab;AU=Ae.max}else{if(AT>=AU&&AT>Ae.max){if(AU>Ae.max){continue}AZ=(Ae.max-AU)/(AT-AU)*(AZ-Ab)+Ab;AT=Ae.max}}if(!Ad){Y.beginPath();Y.moveTo(Ae.p2c(AU),Ac.p2c(AS));Ad=true}if(Ab>=Ac.max&&AZ>=Ac.max){Y.lineTo(Ae.p2c(AU),Ac.p2c(Ac.max));Y.lineTo(Ae.p2c(AT),Ac.p2c(Ac.max));AV=AT;continue}else{if(Ab<=Ac.min&&AZ<=Ac.min){Y.lineTo(Ae.p2c(AU),Ac.p2c(Ac.min));Y.lineTo(Ae.p2c(AT),Ac.p2c(Ac.min));AV=AT;continue}}var Ag=AU,AY=AT;if(Ab<=AZ&&Ab=Ac.min){AU=(Ac.min-Ab)/(AZ-Ab)*(AT-AU)+AU;Ab=Ac.min}else{if(AZ<=Ab&&AZ=Ac.min){AT=(Ac.min-Ab)/(AZ-Ab)*(AT-AU)+AU;AZ=Ac.min}}if(Ab>=AZ&&Ab>Ac.max&&AZ<=Ac.max){AU=(Ac.max-Ab)/(AZ-Ab)*(AT-AU)+AU;Ab=Ac.max}else{if(AZ>=Ab&&AZ>Ac.max&&Ab<=Ac.max){AT=(Ac.max-Ab)/(AZ-Ab)*(AT-AU)+AU;AZ=Ac.max}}if(AU!=Ag){if(Ab<=Ac.min){Aa=Ac.min}else{Aa=Ac.max}Y.lineTo(Ae.p2c(Ag),Ac.p2c(Aa));Y.lineTo(Ae.p2c(AU),Ac.p2c(Aa))}Y.lineTo(Ae.p2c(AU),Ac.p2c(Ab));Y.lineTo(Ae.p2c(AT),Ac.p2c(AZ));if(AT!=AY){if(AZ<=Ac.min){Aa=Ac.min}else{Aa=Ac.max}Y.lineTo(Ae.p2c(AT),Ac.p2c(Aa));Y.lineTo(Ae.p2c(AY),Ac.p2c(Aa))}AV=Math.max(AT,AY)}if(Ad){Y.lineTo(Ae.p2c(AV),Ac.p2c(AS));Y.fill()}}Y.save();Y.translate(e.left,e.top);Y.lineJoin="round";var AP=AN.lines.lineWidth,AK=AN.shadowSize;if(AP>0&&AK>0){Y.lineWidth=AK;Y.strokeStyle="rgba(0,0,0,0.1)";var AQ=Math.PI/18;AM(AN.datapoints,Math.sin(AQ)*(AP/2+AK/2),Math.cos(AQ)*(AP/2+AK/2),AN.xaxis,AN.yaxis);Y.lineWidth=AK/2;AM(AN.datapoints,Math.sin(AQ)*(AP/2+AK/4),Math.cos(AQ)*(AP/2+AK/4),AN.xaxis,AN.yaxis)}Y.lineWidth=AP;Y.strokeStyle=AN.color;var AL=V(AN.lines,AN.color,0,t);if(AL){Y.fillStyle=AL;AO(AN.datapoints,AN.xaxis,AN.yaxis)}if(AP>0){AM(AN.datapoints,0,0,AN.xaxis,AN.yaxis)}Y.restore()}function o(AN){function AP(AU,AT,Ab,AR,AV,AZ,AY){var Aa=AU.points,AQ=AU.pointsize;for(var AS=0;ASAZ.max||AWAY.max){continue}Y.beginPath();Y.arc(AZ.p2c(AX),AY.p2c(AW)+AR,AT,0,AV,false);if(Ab){Y.fillStyle=Ab;Y.fill()}Y.stroke()}}Y.save();Y.translate(e.left,e.top);var AO=AN.lines.lineWidth,AL=AN.shadowSize,AK=AN.points.radius;if(AO>0&&AL>0){var AM=AL/2;Y.lineWidth=AM;Y.strokeStyle="rgba(0,0,0,0.1)";AP(AN.datapoints,AK,null,AM+AM/2,Math.PI,AN.xaxis,AN.yaxis);Y.strokeStyle="rgba(0,0,0,0.2)";AP(AN.datapoints,AK,null,AM/2,Math.PI,AN.xaxis,AN.yaxis)}Y.lineWidth=AO;Y.strokeStyle=AN.color;AP(AN.datapoints,AK,V(AN.points,AN.color),0,2*Math.PI,AN.xaxis,AN.yaxis);Y.restore()}function AB(AV,AU,Ad,AQ,AY,AN,AL,AT,AS,Ac,AZ){var AM,Ab,AR,AX,AO,AK,AW,AP,Aa;if(AZ){AP=AK=AW=true;AO=false;AM=Ad;Ab=AV;AX=AU+AQ;AR=AU+AY;if(AbAT.max||AXAS.max){return }if(AMAT.max){Ab=AT.max;AK=false}if(ARAS.max){AX=AS.max;AW=false}AM=AT.p2c(AM);AR=AS.p2c(AR);Ab=AT.p2c(Ab);AX=AS.p2c(AX);if(AL){Ac.beginPath();Ac.moveTo(AM,AR);Ac.lineTo(AM,AX);Ac.lineTo(Ab,AX);Ac.lineTo(Ab,AR);Ac.fillStyle=AL(AR,AX);Ac.fill()}if(AO||AK||AW||AP){Ac.beginPath();Ac.moveTo(AM,AR+AN);if(AO){Ac.lineTo(AM,AX+AN)}else{Ac.moveTo(AM,AX+AN)}if(AW){Ac.lineTo(Ab,AX+AN)}else{Ac.moveTo(Ab,AX+AN)}if(AK){Ac.lineTo(Ab,AR+AN)}else{Ac.moveTo(Ab,AR+AN)}if(AP){Ac.lineTo(AM,AR+AN)}else{Ac.moveTo(AM,AR+AN)}Ac.stroke()}}function n(AM){function AL(AS,AR,AU,AP,AT,AW,AV){var AX=AS.points,AO=AS.pointsize;for(var AQ=0;AQ")}AP.push("");AN=true}if(AV){AR=AV(AR,AU)}AP.push('
        '+AR+"")}if(AN){AP.push("")}if(AP.length==0){return }var AT=''+AP.join("")+"
        ";if(g.legend.container!=null){C(g.legend.container).html(AT)}else{var AQ="",AL=g.legend.position,AM=g.legend.margin;if(AM[0]==null){AM=[AM,AM]}if(AL.charAt(0)=="n"){AQ+="top:"+(AM[1]+e.top)+"px;"}else{if(AL.charAt(0)=="s"){AQ+="bottom:"+(AM[1]+e.bottom)+"px;"}}if(AL.charAt(1)=="e"){AQ+="right:"+(AM[0]+e.right)+"px;"}else{if(AL.charAt(1)=="w"){AQ+="left:"+(AM[0]+e.left)+"px;"}}var AS=C('
        '+AT.replace('style="','style="position:absolute;'+AQ+";")+"
        ").appendTo(l);if(g.legend.backgroundOpacity!=0){var AO=g.legend.backgroundColor;if(AO==null){AO=g.grid.backgroundColor;if(AO&&typeof AO=="string"){AO=C.color.parse(AO)}else{AO=C.color.extract(AS,"background-color")}AO.a=1;AO=AO.toString()}var AK=AS.children();C('
        ').prependTo(AS).css("opacity",g.legend.backgroundOpacity)}}}var w=[],J=null;function AF(AR,AP,AM){var AX=g.grid.mouseActiveRadius,Aj=AX*AX+1,Ah=null,Aa=false,Af,Ad;for(Af=0;AfAL||AT-AZ<-AL||AS-AW>AK||AS-AW<-AK){continue}var AV=Math.abs(AQ.p2c(AT)-AR),AU=Math.abs(AO.p2c(AS)-AP),Ab=AV*AV+AU*AU;if(Ab<=Aj){Aj=Ab;Ah=[Af,Ad/Ac]}}}if(AY.bars.show&&!Ah){var AN=AY.bars.align=="left"?0:-AY.bars.barWidth/2,Ag=AN+AY.bars.barWidth;for(Ad=0;Ad=Math.min(Ai,AT)&&AW>=AS+AN&&AW<=AS+Ag):(AZ>=AT+AN&&AZ<=AT+Ag&&AW>=Math.min(Ai,AS)&&AW<=Math.max(Ai,AS))){Ah=[Af,Ad/Ac]}}}}if(Ah){Af=Ah[0];Ad=Ah[1];Ac=O[Af].datapoints.pointsize;return{datapoint:O[Af].datapoints.points.slice(Ad*Ac,(Ad+1)*Ac),dataIndex:Ad,series:O[Af],seriesIndex:Af}}return null}function D(AK){if(g.grid.hoverable){H("plothover",AK,function(AL){return AL.hoverable!=false})}}function d(AK){H("plotclick",AK,function(AL){return AL.clickable!=false})}function H(AL,AK,AM){var AN=AD.offset(),AS={pageX:AK.pageX,pageY:AK.pageY},AQ=AK.pageX-AN.left-e.left,AO=AK.pageY-AN.top-e.top;if(s.xaxis.used){AS.x=s.xaxis.c2p(AQ)}if(s.yaxis.used){AS.y=s.yaxis.c2p(AO)}if(s.x2axis.used){AS.x2=s.x2axis.c2p(AQ)}if(s.y2axis.used){AS.y2=s.y2axis.c2p(AO)}var AT=AF(AQ,AO,AM);if(AT){AT.pageX=parseInt(AT.series.xaxis.p2c(AT.datapoint[0])+AN.left+e.left);AT.pageY=parseInt(AT.series.yaxis.p2c(AT.datapoint[1])+AN.top+e.top)}if(g.grid.autoHighlight){for(var AP=0;APAQ.max||ARAP.max){return }var AO=AN.points.radius+AN.points.lineWidth/2;AJ.lineWidth=AO;AJ.strokeStyle=C.color.parse(AN.color).scale("a",0.5).toString();var AK=1.5*AO;AJ.beginPath();AJ.arc(AQ.p2c(AL),AP.p2c(AR),AK,0,2*Math.PI,false);AJ.stroke()}function z(AN,AK){AJ.lineWidth=AN.bars.lineWidth;AJ.strokeStyle=C.color.parse(AN.color).scale("a",0.5).toString();var AM=C.color.parse(AN.color).scale("a",0.5).toString();var AL=AN.bars.align=="left"?0:-AN.bars.barWidth/2;AB(AK[0],AK[1],AK[2]||0,AL,AL+AN.bars.barWidth,0,function(){return AM},AN.xaxis,AN.yaxis,AJ,AN.bars.horizontal)}function R(AM,AL,AQ,AO){if(typeof AM=="string"){return AM}else{var AP=Y.createLinearGradient(0,AQ,0,AL);for(var AN=0,AK=AM.colors.length;AN12){K=K-12}else{if(K==0){K=12}}}for(var F=0;F +* +* @param f onMouseOver function || An object with configuration options +* @param g onMouseOut function || Nothing (use configuration options object) +* @author Brian Cherne +*/ +(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))').addClass($.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} +if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
        [ close all ]
        ',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications[this.notifications.length]={message:message,options:o};o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('
        '+o.closeTemplate+'
        '+o.header+'
        '+message+'
        ').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();(o.glue=='after')?$('div.jGrowl-notification:last',this.element).after(notification):$('div.jGrowl-notification:first',this.element).before(notification);$(notification).bind("mouseover.jGrowl",function(){$(this).data("jGrowl").pause=true;}).bind("mouseout.jGrowl",function(){$(this).data("jGrowl").pause=false;}).bind('jGrowl.beforeOpen',function(){o.beforeOpen.apply(self.element,[self.element,message,o]);}).bind('jGrowl.open',function(){o.open.apply(self.element,[self.element,message,o]);}).bind('jGrowl.beforeClose',function(){o.beforeClose.apply(self.element,[self.element,message,o]);}).bind('jGrowl.close',function(){$(this).data('jGrowl').pause=true;$(this).trigger('jGrowl.beforeClose').animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();o.close.apply(self.element,[self.element,message,o]);});}).trigger('jGrowl.beforeOpen').animate(o.animateOpen,o.speed,o.easing,function(){$(this).data("jGrowl").created=new Date();}).trigger('jGrowl.open');if($.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',this.element).size()>1&&$('div.jGrowl-closer',this.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer').addClass(this.defaults.theme).appendTo(this.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer))self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){$(this).trigger('jGrowl.close');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},this.defaults.check);if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"])$(this.element).addClass('ie6');},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.jqzoom.js b/js/jquery/jquery.jqzoom.js new file mode 100644 index 000000000..5a73f0578 --- /dev/null +++ b/js/jquery/jquery.jqzoom.js @@ -0,0 +1,80 @@ +//************************************************************** +// jQZoom allows you to realize a small magnifier window,close +// to the image or images on your web page easily. +// +// jqZoom version 1.2 +// Author Doc. Ing. Renzi Marco(www.mind-projects.it) +// Released on Dec 05 2007 +// i'm searching for a job,pick me up!!! +// mail: renzi.mrc@gmail.com +//************************************************************** + +(function($) { + $.fn.jqueryzoom = function(options) { + var settings = { + xzoom: 200, //zoomed width default width + yzoom: 200, //zoomed div default width + offset: 10, //zoomed div default offset + position: "right" //zoomed div default position,offset position is to the right of the image + }; + + if(options) + $.extend(settings, options); + + var noalt =''; + + $(this).hover(function() { + var imageLeft = $(this).get(0).offsetLeft; + var imageTop = $(this).get(0).offsetTop; + var imageWidth = $(this).get(0).offsetWidth; + var imageHeight = $(this).get(0).offsetHeight; + + noalt = $(this).attr("alt"); + var bigimage = noalt; + $(this).attr("alt", ''); + + if($("div.zoomdiv").get().length == 0) + $(this).after("
        "); + + if(settings.position == "right") + leftpos = imageLeft + imageWidth + settings.offset; + else + leftpos = imageLeft - settings.xzoom - settings.offset; + + $("div.zoomdiv").css({top: imageTop,left: leftpos}); + $("div.zoomdiv").width(settings.xzoom); + $("div.zoomdiv").height(settings.yzoom); + $("div.zoomdiv").show(); + + $(document.body).mousemove(function(e) { + var bigwidth = $(".bigimg").get(0).offsetWidth; + var bigheight = $(".bigimg").get(0).offsetHeight; + var scaley ='x'; + var scalex= 'y'; + + if(isNaN(scalex)|isNaN(scaley)) { + var scalex = Math.round(bigwidth/imageWidth) ; + var scaley = Math.round(bigheight/imageHeight); + } + + mouse = new MouseEvent(e); + + scrolly = mouse.y - imageTop - ($("div.zoomdiv").height()*1/scaley)/2 ; + $("div.zoomdiv").get(0).scrollTop = scrolly * scaley ; + scrollx = mouse.x - imageLeft - ($("div.zoomdiv").width()*1/scalex)/2 ; + $("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ; + }); + }, function() { + $(this).attr("alt", noalt); + $("div.zoomdiv").hide(); + $(document.body).unbind("mousemove"); + $(".lenszoom").remove(); + $("div.zoomdiv").remove(); + }); + } +})(jQuery); + +function MouseEvent(e) { + this.x = e.pageX + this.y = e.pageY +} \ No newline at end of file diff --git a/js/jquery/jquery.pngFix.pack.js b/js/jquery/jquery.pngFix.pack.js new file mode 100644 index 000000000..f39c17dff --- /dev/null +++ b/js/jquery/jquery.pngFix.pack.js @@ -0,0 +1,11 @@ +/** + * -------------------------------------------------------------------- + * jQuery-Plugin "pngFix" + * Version: 1.1, 11.09.2007 + * by Andreas Eberhard, andreas.eberhard@gmail.com + * http://jquery.andreaseberhard.de/ + * + * Copyright (c) 2007 Andreas Eberhard + * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s($){3.1s.1k=s(j){j=3.1a({12:\'1m.1j\'},j);8 k=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 5.5")!=-1);8 l=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 6.0")!=-1);o(3.17.16&&(k||l)){3(2).L("1r[@m$=.M]").z(s(){3(2).7(\'q\',3(2).q());3(2).7(\'p\',3(2).p());8 a=\'\';8 b=\'\';8 c=(3(2).7(\'K\'))?\'K="\'+3(2).7(\'K\')+\'" \':\'\';8 d=(3(2).7(\'A\'))?\'A="\'+3(2).7(\'A\')+\'" \':\'\';8 e=(3(2).7(\'C\'))?\'C="\'+3(2).7(\'C\')+\'" \':\'\';8 f=(3(2).7(\'B\'))?\'B="\'+3(2).7(\'B\')+\'" \':\'\';8 g=(3(2).7(\'R\'))?\'1d:\'+3(2).7(\'R\')+\';\':\'\';8 h=(3(2).1c().7(\'1b\'))?\'19:18;\':\'\';o(2.9.y){a+=\'y:\'+2.9.y+\';\';2.9.y=\'\'}o(2.9.t){a+=\'t:\'+2.9.t+\';\';2.9.t=\'\'}o(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}8 i=(2.9.15);b+=\'\';o(a!=\'\'){b=\'\'+b+\'\'}3(2).1i();3(2).1h(b)});3(2).L("*").z(s(){8 a=3(2).T(\'N-S\');o(a.E(".M")!=-1){8 b=a.X(\'1g("\')[1].X(\'")\')[0];3(2).T(\'N-S\',\'1f\');3(2).Q(0).Y.J="I:H.r.G(m=\'"+b+"\',D=\'F\')"}});3(2).L("1e[@m$=.M]").z(s(){8 a=3(2).7(\'m\');3(2).Q(0).Y.J=\'I:H.r.G\'+\'(m=\\\'\'+a+\'\\\', D=\\\'F\\\');\';3(2).7(\'m\',j.12)})}1t 3}})(3);',62,92,'||this|jQuery||||attr|var|style|||||||||||||src|navigator|if|height|width|Microsoft|function|padding|px|appVersion|margin|span|border|each|class|alt|title|sizingMethod|indexOf|scale|AlphaImageLoader|DXImageTransform|progid|filter|id|find|png|background|display|appName|get|align|image|css|parseInt|block|inline|split|runtimeStyle|Explorer|Internet|relative|blankgif|position|MSIE|cssText|msie|browser|hand|cursor|extend|href|parent|float|input|none|url|after|hide|gif|pngFix|transparent|blank|line|pre|space|white|img|fn|return'.split('|'),0,{})) \ No newline at end of file diff --git a/js/jquery/jquery.scrollTo-1.4.2-min.js b/js/jquery/jquery.scrollTo-1.4.2-min.js new file mode 100644 index 000000000..73a334184 --- /dev/null +++ b/js/jquery/jquery.scrollTo-1.4.2-min.js @@ -0,0 +1,11 @@ +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 5/25/2009 + * @author Ariel Flesler + * @version 1.4.2 + * + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + */ +;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.serialScroll-1.2.2-min.js b/js/jquery/jquery.serialScroll-1.2.2-min.js new file mode 100644 index 000000000..d716124f9 --- /dev/null +++ b/js/jquery/jquery.serialScroll-1.2.2-min.js @@ -0,0 +1,10 @@ +/* + * jQuery.SerialScroll - Animated scrolling of series + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 06/14/2009 + * @author Ariel Flesler + * @version 1.2.2 + * http://flesler.blogspot.com/2008/02/jqueryserialscroll.html + */ +;(function(a){var b=a.serialScroll=function(c){return a(window).serialScroll(c)};b.defaults={duration:1e3,axis:"x",event:"click",start:0,step:1,lock:!0,cycle:!0,constant:!0};a.fn.serialScroll=function(c){return this.each(function(){var t=a.extend({},b.defaults,c),s=t.event,i=t.step,r=t.lazy,e=t.target?this:document,u=a(t.target||this,e),p=u[0],m=t.items,h=t.start,g=t.interval,k=t.navigation,l;if(!r){m=d()}if(t.force){f({},h)}a(t.prev||[],e).bind(s,-i,q);a(t.next||[],e).bind(s,i,q);if(!p.ssbound){u.bind("prev.serialScroll",-i,q).bind("next.serialScroll",i,q).bind("goto.serialScroll",f)}if(g){u.bind("start.serialScroll",function(v){if(!g){o();g=!0;n()}}).bind("stop.serialScroll",function(){o();g=!1})}u.bind("notify.serialScroll",function(x,w){var v=j(w);if(v>-1){h=v}});p.ssbound=!0;if(t.jump){(r?u:d()).bind(s,function(v){f(v,j(v.target))})}if(k){k=a(k,e).bind(s,function(v){v.data=Math.round(d().length/k.length)*k.index(this);f(v,this)})}function q(v){v.data+=h;f(v,this)}function f(B,z){if(!isNaN(z)){B.data=z;z=p}var C=B.data,v,D=B.type,A=t.exclude?d().slice(0,-t.exclude):d(),y=A.length,w=A[C],x=t.duration;if(D){B.preventDefault()}if(g){o();l=setTimeout(n,t.interval)}if(!w){v=C<0?0:y-1;if(h!=v){C=v}else{if(!t.cycle){return}else{C=y-v-1}}w=A[C]}if(!w||t.lock&&u.is(":animated")||D&&t.onBefore&&t.onBefore(B,w,u,d(),C)===!1){return}if(t.stop){u.queue("fx",[]).stop()}if(t.constant){x=Math.abs(x/i*(h-C))}u.scrollTo(w,x,t).trigger("notify.serialScroll",[C])}function n(){u.trigger("next.serialScroll")}function o(){clearTimeout(l)}function d(){return a(m,p)}function j(w){if(!isNaN(w)){return w}var x=d(),v;while((v=x.index(w))==-1&&w!=p){w=w.parentNode}return v}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.tablednd_0_5.js b/js/jquery/jquery.tablednd_0_5.js new file mode 100644 index 000000000..54e584787 --- /dev/null +++ b/js/jquery/jquery.tablednd_0_5.js @@ -0,0 +1,308 @@ +/** + * TableDnD plug-in for JQuery, allows you to drag and drop table rows + * Copyright (c) Denis Howlett + * Licensed like jQuery, see http://docs.jquery.com/License. +*/ +jQuery.tableDnD = { + /** Keep hold of the current table being dragged */ + currentTable : null, + /** Keep hold of the current drag object if any */ + dragObject: null, + /** The current mouse offset */ + mouseOffset: null, + /** Remember the old value of Y so that we don't do too much processing */ + oldY: 0, + + /** Actually build the structure */ + build: function(options) { + // Set up the defaults if any + + this.each(function() { + // This is bound to each matching table, set up the defaults and override with user options + this.tableDnDConfig = jQuery.extend({ + onDragStyle: null, + onDropStyle: null, + // Add in the default class for whileDragging + onDragClass: "tDnD_whileDrag", + onDrop: null, + onDragStart: null, + scrollAmount: 5, + serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs + serializeParamName: null, // If you want to specify another parameter name instead of the table ID + dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable + }, options || {}); + // Now make the rows draggable + jQuery.tableDnD.makeDraggable(this); + }); + + // Now we need to capture the mouse up and mouse move event + // We can use bind so that we don't interfere with other event handlers + jQuery(document) + .bind('mousemove', jQuery.tableDnD.mousemove) + .bind('mouseup', jQuery.tableDnD.mouseup); + + // Don't break the chain + return this; + }, + + /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */ + makeDraggable: function(table) { + var config = table.tableDnDConfig; + if (table.tableDnDConfig.dragHandle) { + // We only need to add the event to the specified cells + var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table); + cells.each(function() { + // The cell is bound to "this" + jQuery(this).mousedown(function(ev) { + jQuery.tableDnD.dragObject = this.parentNode; + jQuery.tableDnD.currentTable = table; + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev); + if (config.onDragStart) { + // Call the onDrop method if there is one + config.onDragStart(table, this); + } + return false; + }); + }) + } else { + // For backwards compatibility, we add the event to the whole row + var rows = jQuery("tbody tr", table); // get all the rows as a wrapped set + rows.each(function() { + // Iterate through each row, the row is bound to "this" + var row = jQuery(this); + if (! row.hasClass("nodrag")) { + row.mousedown(function(ev) { + if (ev.target.tagName == "TD") { + jQuery.tableDnD.dragObject = this; + jQuery.tableDnD.currentTable = table; + jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev); + if (config.onDragStart) { + // Call the onDrop method if there is one + config.onDragStart(table, this); + } + return false; + } + }).css("cursor", "move"); // Store the tableDnD object + } + }); + } + }, + + updateTables: function() { + this.each(function() { + // this is now bound to each matching table + if (this.tableDnDConfig) { + jQuery.tableDnD.makeDraggable(this); + } + }) + }, + + /** Get the mouse coordinates from the event (allowing for browser differences) */ + mouseCoords: function(ev){ + if(ev.pageX || ev.pageY){ + return {x:ev.pageX, y:ev.pageY}; + } + return { + x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, + y:ev.clientY + document.body.scrollTop - document.body.clientTop + }; + }, + + /** Given a target element and a mouse event, get the mouse offset from that element. + To do this we need the element's position and the mouse position */ + getMouseOffset: function(target, ev) { + ev = ev || window.event; + + var docPos = this.getPosition(target); + var mousePos = this.mouseCoords(ev); + return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y}; + }, + + /** Get the position of an element by going up the DOM tree and adding up all the offsets */ + getPosition: function(e){ + var left = 0; + var top = 0; + /** Safari fix -- thanks to Luis Chato for this! */ + if (e.offsetHeight == 0) { + /** Safari 2 doesn't correctly grab the offsetTop of a table row + this is detailed here: + http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/ + the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild. + note that firefox will return a text node as a first child, so designing a more thorough + solution may need to take that into account, for now this seems to work in firefox, safari, ie */ + e = e.firstChild; // a table cell + } + + while (e.offsetParent){ + left += e.offsetLeft; + top += e.offsetTop; + e = e.offsetParent; + } + + left += e.offsetLeft; + top += e.offsetTop; + + return {x:left, y:top}; + }, + + mousemove: function(ev) { + if (jQuery.tableDnD.dragObject == null) { + return; + } + + var dragObj = jQuery(jQuery.tableDnD.dragObject); + var config = jQuery.tableDnD.currentTable.tableDnDConfig; + var mousePos = jQuery.tableDnD.mouseCoords(ev); + var y = mousePos.y - jQuery.tableDnD.mouseOffset.y; + //auto scroll the window + var yOffset = window.pageYOffset; + if (document.all) { + // Windows version + //yOffset=document.body.scrollTop; + if (typeof document.compatMode != 'undefined' && + document.compatMode != 'BackCompat') { + yOffset = document.documentElement.scrollTop; + } + else if (typeof document.body != 'undefined') { + yOffset=document.body.scrollTop; + } + + } + + if (mousePos.y-yOffset < config.scrollAmount) { + window.scrollBy(0, -config.scrollAmount); + } else { + var windowHeight = window.innerHeight ? window.innerHeight + : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; + if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) { + window.scrollBy(0, config.scrollAmount); + } + } + + + if (y != jQuery.tableDnD.oldY) { + // work out if we're going up or down... + var movingDown = y > jQuery.tableDnD.oldY; + // update the old value + jQuery.tableDnD.oldY = y; + // update the style to show we're dragging + if (config.onDragClass) { + dragObj.addClass(config.onDragClass); + } else { + dragObj.css(config.onDragStyle); + } + // If we're over a row then move the dragged row to there so that the user sees the + // effect dynamically + var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y); + if (currentRow) { + // TODO worry about what happens when there are multiple TBODIES + if (movingDown && jQuery.tableDnD.dragObject != currentRow) { + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling); + } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) { + jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow); + } + } + } + + return false; + }, + + /** We're only worried about the y position really, because we can only move rows up and down */ + findDropTargetRow: function(draggedRow, y) { + var rows = jQuery.tableDnD.currentTable.rows; + for (var i=0; i rowY - rowHeight) && (y < (rowY + rowHeight))) { + // that's the row we're over + // If it's the same as the current row, ignore it + if (row == draggedRow) {return null;} + var config = jQuery.tableDnD.currentTable.tableDnDConfig; + if (config.onAllowDrop) { + if (config.onAllowDrop(draggedRow, row)) { + return row; + } else { + return null; + } + } else { + // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic) + var nodrop = jQuery(row).hasClass("nodrop"); + if (! nodrop) { + return row; + } else { + return null; + } + } + return row; + } + } + return null; + }, + + mouseup: function(e) { + if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) { + var droppedRow = jQuery.tableDnD.dragObject; + var config = jQuery.tableDnD.currentTable.tableDnDConfig; + // If we have a dragObject, then we need to release it, + // The row will already have been moved to the right place so we just reset stuff + if (config.onDragClass) { + jQuery(droppedRow).removeClass(config.onDragClass); + } else { + jQuery(droppedRow).css(config.onDropStyle); + } + jQuery.tableDnD.dragObject = null; + if (config.onDrop) { + // Call the onDrop method if there is one + config.onDrop(jQuery.tableDnD.currentTable, droppedRow); + } + jQuery.tableDnD.currentTable = null; // let go of the table too + } + }, + + serialize: function() { + if (jQuery.tableDnD.currentTable) { + return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable); + } else { + return "Error: No Table id set, you need to set an id on your table and every row"; + } + }, + + serializeTable: function(table) { + var result = ""; + var tableId = table.id; + var rows = jQuery("tbody tr", table); + for (var i=0; i 0) result += "&"; + var rowId = rows[i].id; + if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) { + rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0]; + } + + result += tableId + '[]=' + rowId; + } + return result; + }, + + serializeTables: function() { + var result = ""; + this.each(function() { + // this is now bound to each matching table + result += jQuery.tableDnD.serializeTable(this); + }); + return result; + } + +} +jQuery.fn.extend( + { + tableDnD : jQuery.tableDnD.build, + tableDnDUpdate : jQuery.tableDnD.updateTables, + tableDnDSerialize: jQuery.tableDnD.serializeTables + } +); \ No newline at end of file diff --git a/js/jquery/thickbox-modified.js b/js/jquery/thickbox-modified.js new file mode 100644 index 000000000..6d9dfa1ae --- /dev/null +++ b/js/jquery/thickbox-modified.js @@ -0,0 +1,40 @@ +/* + * Thickbox 3.1 - One Box To Rule Them All. + * By Cody Lindley (http://www.codylindley.com) + * Copyright (c) 2007 cody lindley + * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php + * + * Patched Version by Jamie Thompson - Fixes IE7 Positioning Issues + * http://jamazon.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/ + * Patched Version by PrestaShop - Translated fields + * http://www.prestashop.com +*/ + + +$.browser.msie6=$.browser.msie&&/MSIE 6\.0/i.test(window.navigator.userAgent)&&!/MSIE 7\.0/i.test(window.navigator.userAgent);$(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){$(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;}).removeClass('thickbox');} +function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("
        ");$("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){$("body").append("
        ");$("#TB_overlay").click(tb_remove);}} +if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{$("#TB_overlay").addClass("TB_overlayBG");} +if(caption===null){caption="";} +$("body").append("
        ");$('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;} +var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=$("a[@rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter  "+ThickboxI18nNext+"";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="  "+ThickboxI18nPrev+"";}}else{TB_FoundURL=true;TB_imageCount=ThickboxI18nImage+' '+(TB_Counter+1)+' '+ThickboxI18nOf+' '+(TB_TempArray.length);}}} +imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}} +TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;$("#TB_window").append(""+caption+""+"
        "+caption+"
        "+TB_imageCount+TB_PrevHTML+TB_NextHTML+"
        "+ThickboxI18nClose+" "+ThickboxI18nOrEscKey+"
        ");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} +$("#TB_window").remove();$("body").append("
        ");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;} +$("#TB_prev").click(goPrev);} +if(!(TB_NextHTML==="")){function goNext(){$("#TB_window").remove();$("body").append("
        ");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;} +$("#TB_next").click(goNext);} +document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;} +if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();$("#TB_load").remove();$("#TB_Image").click(tb_remove);$("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');$("#TB_iframeContent").remove();if(params['modal']!="true"){$("#TB_window").append("
        "+caption+"
        "+ThickboxI18nClose+" "+ThickboxI18nOrEscKey+"
        ");}else{$("#TB_overlay").unbind();$("#TB_window").append("");}}else{if($("#TB_window").css("display")!="block"){if(params['modal']!="true"){$("#TB_window").append("
        "+caption+"
        "+ThickboxI18nClose+" "+ThickboxI18nOrEscKey+"
        ");}else{$("#TB_overlay").unbind();$("#TB_window").append("
        ");}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(caption);}} +$("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").append($('#'+params['inlineId']).children());$("#TB_window").unload(function(){$('#'+params['inlineId']).append($("#TB_ajaxContent").children());});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"});}}else{$("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"});});}} +if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;} +if(keycode==27){tb_remove();}};}}catch(e){}} +function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"});} +function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","");} +document.onkeydown="";document.onkeyup="";return false;} +function tb_position(){$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie6)){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}} +function tb_parseQuery(query){var Params={};if(!query){return Params;} +var Pairs=query.split(/[;&]/);for(var i=0;if(b[a],10)){return 1}if(f(c[a],10)"+d.plugin.HTML+"<"+f+"object>";if(d.head.firstChild){d.head.insertBefore(document.createElement("object"),d.head.firstChild)}else{d.head.appendChild(document.createElement("object"))}d.head.firstChild.outerHTML=c;try{d.head.firstChild.classid=d.plugin.classID}catch(g){}a=false;try{if(d.head.firstChild.object){a=true}}catch(g){}try{if(a&&d.head.firstChild.readyState<4){d.garbage=true}}catch(g){}d.head.removeChild(d.head.firstChild);return a},codebaseSearch:function(c){var e=this;if(!e.ActiveXEnabled){return null}if(typeof c!="undefined"){return e.isActiveXObject(c)};var j=[0,0,0,0],g,f,b=e.plugin.digits,i=function(k,m){var l=(k==0?m:j[0])+","+(k==1?m:j[1])+","+(k==2?m:j[2])+","+(k==3?m:j[3]);return e.isActiveXObject(l)};var h,d,a=false;for(g=0;g0&&a){break}if(h-j[g]>1){d=Math.round((h+j[g])/2);if(i(g,d)){j[g]=d;a=true}else{h=d}}else{if(h-j[g]==1){h--;if(!a&&i(g,h)){a=true}break}else{if(!a&&i(g,h)){a=true}break}}}if(!a){return null}}return j.join(",")},dummy1:0}}PluginDetect.onDetectionDone=function(g,e,d,a){return -1};PluginDetect.onWindowLoaded=function(c){var b=PluginDetect,a=window;if(b.EventWinLoad===true){}else{b.winLoaded=false;b.EventWinLoad=true;if(typeof a.addEventListener!="undefined"){a.addEventListener("load",b.runFuncs,false)}else{if(typeof a.attachEvent!="undefined"){a.attachEvent("onload",b.runFuncs)}else{if(typeof a.onload=="function"){b.funcs[b.funcs.length]=a.onload}a.onload=b.runFuncs}}}if(typeof c=="function"){b.funcs[b.funcs.length]=c}};PluginDetect.funcs=[0];PluginDetect.runFuncs=function(){var b=PluginDetect,a;b.winLoaded=true;for(a=0;a',getCodeBaseVersion:function(a){return'codebase="#version='+a+'"'},digits:[8,64,16,0],clipTo3digits:function(f){if(f===null||typeof f=="undefined"){return null}var e,d,h,g=this.$;e=f.split(",");if(g.compareNums(f,"7,60,0,0")<0&&g.compareNums(f,"7,50,0,0")>=0){d=e[0]+","+e[1].charAt(0)+","+e[1].charAt(1)+","+e[2]}else{d=e[0]+","+e[1]+","+e[2]+","+e[3]}h=d.split(",");return h[0]+","+h[1]+","+h[2]+",0"},getVersion:function(){var a=null,d,b=this.$,e=true;if(!b.isIE){if(navigator.platform&&(/linux/i).test(navigator.platform)){e=false}if(e){d=b.findNavPlugin(["QuickTime","(Plug-in|Plugin)"]);if(d&&d.name&&b.hasMimeType(this.mimeType)){a=b.getNum(d.name)}}this.installed=a?1:-1}else{var c;if(b.IEver>=this.minIEver&&b.getAXO(this.progID0,1)){a=b.codebaseSearch()}else{c=b.getAXO(this.progID);if(c&&c.QuickTimeVersion){a=c.QuickTimeVersion.toString(16);a=a.charAt(0)+"."+a.charAt(1)+"."+a.charAt(2)}}this.installed=a?1:(b.getAXO(this.progID0,1)?0:-1)}this.version=this.clipTo3digits(b.formatNum(a))}};PluginDetect.java={mimeType:"application/x-java-applet",classID:"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93",DTKclassID:"clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA",DTKmimeType:"application/npruntime-scriptable-plugin;DeploymentToolkit",JavaVersions:[[1,9,2,25],[1,8,2,25],[1,7,2,25],[1,6,2,25],[1,5,2,25],[1,4,2,25],[1,3,1,25]],searchJavaPluginAXO:function(){var h=null,a=this,c=a.$,g=[],j=[1,5,0,14],i=[1,6,0,2],f=[1,3,1,0],e=[1,4,2,0],d=[1,5,0,7],b=false;if(!c.ActiveXEnabled){return null};if(c.IEver>=a.minIEver){g=a.searchJavaAXO(i,i,b);if(g.length>0&&b){g=a.searchJavaAXO(j,j,b)}}else{if(g.length==0){g=a.searchJavaAXO(f,e,false)}}if(g.length>0){h=g[0]}a.JavaPlugin_versions=[].concat(g);return h},searchJavaAXO:function(l,i,m){var n,f,h=this.$,p,k,a,e,g,j,b,q=[];if(h.compareNums(l.join(","),i.join(","))>0){i=l}i=h.formatNum(i.join(","));var o,d="1,4,2,0",c="JavaPlugin."+l[0]+""+l[1]+""+l[2]+""+(l[3]>0?("_"+(l[3]<10?"0":"")+l[3]):"");for(n=0;n=0;a--){b="JavaWebStart.isInstalled."+g+a+".0";if(h.compareNums(f[0]+","+f[1]+","+a+",0",i)>=0&&!h.getAXO(b,1)){continue}o=h.compareNums(f[0]+","+f[1]+","+a+",0",d)<0?true:false;for(e=f[3];e>=0;e--){k=a+"_"+(e<10?"0"+e:e);j=p+k;if(h.getAXO(j,1)&&(o||h.getAXO(b,1))){q[q.length]=g+k;if(!m){return q}}if(j==c){return q}}if(h.getAXO(p+a,1)&&(o||h.getAXO(b,1))){q[q.length]=g+a;if(!m){return q}}if(p+a==c){return q}}}return q},minIEver:7,getFromMimeType:function(a){var h,f,c=this.$,j=new RegExp(a),d,k,i={},e=0,b,g=[""];for(h=0;h0){b=d}}}g[f]=i["a"+b];i["a"+b]=null}if(!(/windows|macintosh/i).test(navigator.userAgent)){g=[g[0]]}return g},queryJavaHandler:function(){var b=PluginDetect.java,a=window.java,c;b.hasRun=true;try{if(typeof a.lang!="undefined"&&typeof a.lang.System!="undefined"){b.value=[a.lang.System.getProperty("java.version")+" ",a.lang.System.getProperty("java.vendor")+" "]}}catch(c){}},queryJava:function(){var c=this,d=c.$,b=navigator.userAgent,f;if(typeof window.java!="undefined"&&navigator.javaEnabled()&&!c.hasRun){if(d.isGecko){if(d.hasMimeType("application/x-java-vm")){try{var g=document.createElement("div"),a=document.createEvent("HTMLEvents");a.initEvent("focus",false,true);g.addEventListener("focus",c.queryJavaHandler,false);g.dispatchEvent(a)}catch(f){}if(!c.hasRun){c.queryJavaHandler()}}}else{if((/opera.9\.(0|1)/i).test(b)&&(/mac/i).test(b)){}else{if(!c.hasRun){c.queryJavaHandler()}}}}return c.value},forceVerifyTag:[],jar:[],VENDORS:["Sun Microsystems Inc.","Apple Computer, Inc."],init:function(){var a=this,b=a.$;if(typeof a.app!="undefined"){a.delJavaApplets(b)}a.hasRun=false;a.value=[null,null];a.useTag=[2,2,2];a.app=[0,0,0,0,0,0];a.appi=3;a.queryDTKresult=null;a.OTF=0;a.BridgeResult=[[null,null],[null,null],[null,null]];a.JavaActive=[0,0,0];a.All_versions=[];a.DeployTK_versions=[];a.MimeType_versions=[];a.JavaPlugin_versions=[];a.funcs=[];var c=a.NOTF;if(c){c.$=b;if(c.javaInterval){clearInterval(c.javaInterval)}c.EventJavaReady=null;c.javaInterval=null;c.count=0;c.intervalLength=250;c.countMax=40}a.lateDetection=b.winLoaded;if(!a.lateDetection){b.onWindowLoaded(a.delJavaApplets)}},getVersion:function(f,l){var h,d=this,g=d.$,j=null,n=null,e=null,c=navigator.javaEnabled();if(d.getVersionDone===null){d.init()}var k;if(typeof l!="undefined"&&l.constructor==Array){for(k=0;k0){j=i;n=d.VENDORS[0]}if(!g.isIE){var q,m,b,o,a;a=g.hasMimeType(d.mimeType);o=(a&&c)?true:false;if(d.MimeType_versions.length==0&&a){h=d.getFromMimeType("application/x-java-applet.*jpi-version.*=");if(h[0]!=""){if(!j){j=h[0]}d.MimeType_versions=h}}if(!j&&a){h="Java[^\\d]*Plug-in";b=g.findNavPlugin(h);if(b){h=new RegExp(h,"i");q=h.test(b.description)?g.getNum(b.description):null;m=h.test(b.name)?g.getNum(b.name):null;if(q&&m){j=(g.compareNums(g.formatNum(q),g.formatNum(m))>=0)?q:m}else{j=q||m}}}if(!j&&a&&(/macintosh.*safari/i).test(navigator.userAgent)){b=g.findNavPlugin("Java.*\\d.*Plug-in.*Cocoa",false);if(b){q=g.getNum(b.description);if(q){j=q}}}if(j){d.version0=j;if(c){e=j}}if(!e||d.useAnyTag()){b=d.queryExternalApplet(f);if(b[0]){e=b[0];n=b[1]}}if(!e){b=d.queryJava();if(b[0]){d.version0=b[0];e=b[0];n=b[1];if(d.installed==-0.5){d.installed=0.5}}}if(d.installed===null&&!e&&o&&!(/macintosh.*ppc/i).test(navigator.userAgent)){h=d.getFromMimeType("application/x-java-applet.*version.*=");if(h[0]!=""){e=h[0]}}if(!e&&o){if(/macintosh.*safari/i.test(navigator.userAgent)){if(d.installed===null){d.installed=0}else{if(d.installed==-0.5){d.installed=0.5}}}}}else{if(!j&&i!=-1){j=d.searchJavaPluginAXO();if(j){n=d.VENDORS[0]}}if(!j){d.JavaFix()}if(j){d.version0=j;if(c&&g.ActiveXEnabled){e=j}}if(!e||d.useAnyTag()){h=d.queryExternalApplet(f);if(h[0]){e=h[0];n=h[1]}}}if(d.installed===null){d.installed=e?1:(j?-0.2:-1)}d.EndGetVersion(e,n)},EndGetVersion:function(b,d){var a=this,c=a.$;if(a.version0){a.version0=c.formatNum(c.getNum(a.version0))}if(b){a.version=c.formatNum(c.getNum(b));a.vendor=(typeof d=="string"?d:"")}if(a.getVersionDone!=1){a.getVersionDone=0}},queryDeploymentToolKit:function(){var d=this,g=d.$,i,b,h=null,a=null;if((g.isGecko&&g.compareNums(g.GeckoRV,g.formatNum("1.6"))<=0)||g.isSafari||(g.isIE&&!g.ActiveXEnabled)){d.queryDTKresult=0}if(d.queryDTKresult!==null){return d.queryDTKresult}if(g.isIE&&g.IEver>=6){d.app[0]=g.instantiate("object",[],[]);h=g.getObject(d.app[0])}else{if(!g.isIE&&g.hasMimeType(d.DTKmimeType)){d.app[0]=g.instantiate("object",["type",d.DTKmimeType],[]);h=g.getObject(d.app[0])}}if(h){if(g.isIE&&g.IEver>=6){try{h.classid=d.DTKclassID}catch(i){}}try{var c,f=h.jvms;if(f){a=f.getLength();if(typeof a=="number"){for(b=0;b0?d.DeployTK_versions[0]:(a==0?-1:0);return d.queryDTKresult},queryExternalApplet:function(d){var c=this,e=c.$,h=c.BridgeResult,b=c.app,g=c.appi,a="    ";if(typeof d!="string"||!(/\.jar\s*$/).test(d)){return[null,null]}if(c.OTF<1){c.OTF=1}if(!e.isIE){if((e.isGecko||e.isChrome)&&!e.hasMimeType(c.mimeType)&&!c.queryJava()[0]){return[null,null]}}if(c.OTF<2){c.OTF=2}if(!b[g]&&c.canUseObjectTag()&&c.canUseThisTag(0)){b[1]=e.instantiate("object",[],[],a);b[g]=e.isIE?e.instantiate("object",["archive",d,"code","A.class","type",c.mimeType],["archive",d,"code","A.class","mayscript","true","scriptable","true"],a):e.instantiate("object",["archive",d,"classid","java:A.class","type",c.mimeType],["archive",d,"mayscript","true","scriptable","true"],a);h[0]=[0,0];c.query1Applet(g)}if(!b[g+1]&&c.canUseAppletTag()&&c.canUseThisTag(1)){b[g+1]=e.instantiate("applet",["archive",d,"code","A.class","alt",a,"mayscript","true"],["mayscript","true"],a);h[1]=[0,0];c.query1Applet(g+1)}if(e.isIE&&!b[g+2]&&c.canUseObjectTag()&&c.canUseThisTag(2)){b[g+2]=e.instantiate("object",["classid",c.classID],["archive",d,"code","A.class","mayscript","true","scriptable","true"],a);h[2]=[0,0];c.query1Applet(g+2)};var j,f=0;for(j=0;j0){c.getVersionDone=0}}return c.getBR()},canUseAppletTag:function(){return((!this.$.isIE||navigator.javaEnabled())?true:false)},canUseObjectTag:function(){return((!this.$.isIE||this.$.ActiveXEnabled)?true:false)},useAnyTag:function(){var b=this,a;for(a=0;a=0;a--){b.uninstantiate(c[a])}},query1Applet:function(g){var f,c=this,d=c.$,a=null,h=null,b=d.getObject(c.app[g],true);try{if(b){a=b.getVersion()+" ";h=b.getVendor()+" ";if(d.num(a)){c.BridgeResult[g-c.appi]=[a,h];d.hideObject(c.app[g])}if(d.isIE&&a&&b.readyState!=4){d.garbage=true;d.uninstantiate(c.app[g])}}}catch(f){}},NOTF:{isJavaActive:function(){}},append:function(e,d){for(var c=0;c2;f--){a=g.getAXO(this.progID+"."+f);if(a){d=f.toString();break}}if(d=="6"){try{a.AllowScriptAccess="always"}catch(h){return"6,0,21,0"}}try{b=c(a.GetVariable("$version"))}catch(h){}if(!b&&d){b=d}}this.installed=b?1:-1;this.version=g.formatNum(b);return true}};PluginDetect.shockwave={mimeType:"application/x-director",progID:"SWCtl.SWCtl",classID:"clsid:166B1BCA-3F9C-11CF-8075-444553540000",getVersion:function(){var a=null,b=null,f,d,c=this.$;if(!c.isIE){d=c.findNavPlugin("Shockwave for Director");if(d&&d.description&&c.hasMimeType(this.mimeType)){a=c.getNum(d.description)}}else{try{b=c.getAXO(this.progID).ShockwaveVersion("")}catch(f){}if(typeof b=="string"&&b.length>0){a=c.getNum(b)}else{if(c.getAXO(this.progID+".8",1)){a="8"}else{if(c.getAXO(this.progID+".7",1)){a="7"}else{if(c.getAXO(this.progID+".1",1)){a="6"}}}}}this.installed=a?1:-1;this.version=c.formatNum(a)}};PluginDetect.div=null;PluginDetect.pluginSize=1;PluginDetect.DOMbody=null;PluginDetect.uninstantiate=function(a){var c,b=this;if(!a){return}try{if(a[0]&&a[0].firstChild){a[0].removeChild(a[0].firstChild)}if(a[0]&&b.div){b.div.removeChild(a[0])}if(b.div&&b.div.childNodes.length==0){b.div.parentNode.removeChild(b.div);b.div=null;if(b.DOMbody&&b.DOMbody.parentNode){b.DOMbody.parentNode.removeChild(b.DOMbody)}b.DOMbody=null}a[0]=null}catch(c){}};PluginDetect.getObject=function(b,a){var f,c=this,d=null;try{if(b&&b[0]&&b[0].firstChild){d=b[0].firstChild}}catch(f){}try{if(a&&d&&typeof d.focus!="undefined"&&typeof document.hasFocus!="undefined"&&!document.hasFocus()){d.focus()}}catch(f){}return d};PluginDetect.getContainer=function(a){var c,b=null;if(a&&a[0]){b=a[0]}return b};PluginDetect.hideObject=function(a){var b=this.getObject(a);if(b&&b.style){b.style.height="0"}};PluginDetect.instantiate=function(h,b,c,a){var j=function(d){var e=d.style;if(!e){return}e.border="0px";e.padding="0px";e.margin="0px";e.fontSize=(g.pluginSize+3)+"px";e.height=(g.pluginSize+3)+"px";e.visibility="visible";if(d.tagName&&d.tagName.toLowerCase()=="div"){e.width="100%";e.display="block"}else{if(d.tagName&&d.tagName.toLowerCase()=="span"){e.width=g.pluginSize+"px";e.display="inline"}}};var k,l=document,g=this,p,i=(l.getElementsByTagName("body")[0]||l.body),o=l.createElement("span"),n,f,m="/";if(typeof a=="undefined"){a=""}p="<"+h+' width="'+g.pluginSize+'" height="'+g.pluginSize+'" ';for(n=0;n'}p+=a+"<"+m+h+">";if(!g.div){g.div=l.createElement("div");f=l.getElementById("plugindetect");if(f){j(f);f.appendChild(g.div)}else{if(i){try{if(i.firstChild&&typeof i.insertBefore!="undefined"){i.insertBefore(g.div,i.firstChild)}else{i.appendChild(g.div)}}catch(k){}}else{try{l.write('
        o<'+m+"div>");i=(l.getElementsByTagName("body")[0]||l.body);i.appendChild(g.div);i.removeChild(l.getElementById("pd33993399"))}catch(k){try{g.DOMbody=l.createElement("body");l.getElementsByTagName("html")[0].appendChild(g.DOMbody);g.DOMbody.appendChild(g.div)}catch(k){}}}}j(g.div)}if(g.div&&g.div.parentNode&&g.div.parentNode.parentNode){g.div.appendChild(o);try{o.innerHTML=p}catch(k){}j(o);return[o]}return[null]};PluginDetect.windowsmediaplayer={mimeType:["application/x-mplayer2","application/asx"],progID:"wmplayer.ocx",classID:"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6",getVersion:function(){var a=null,e=this.$,b=null;this.installed=-1;if(!e.isIE){if(e.hasMimeType(this.mimeType)){if(e.findNavPlugin(["Windows","Media","(Plug-in|Plugin)"],false)||e.findNavPlugin(["Flip4Mac","Windows","Media"],false)){this.installed=0}var d=e.isGecko&&e.compareNums(e.GeckoRV,e.formatNum("1.8"))<0;if(!d&&e.findNavPlugin(["Windows","Media","Firefox Plugin"],false)){var c=e.instantiate("object",["type",this.mimeType[0]],[]),f=e.getObject(c);if(f){a=f.versionInfo}e.uninstantiate(c)}}}else{b=e.getAXO(this.progID);if(b){a=b.versionInfo}}if(a){this.installed=1}this.version=e.formatNum(a)}};PluginDetect.silverlight={mimeType:"application/x-silverlight",progID:"AgControl.AgControl",digits:[9,20,9,12,31],getVersion:function(){var c=this.$,j=document,g=null,b=null,f=false;if(!c.isIE){var a=[null,null],e=c.findNavPlugin("Silverlight Plug-in",false),h=c.isGecko&&c.compareNums(c.GeckoRV,c.formatNum("1.6"))<=0;if(e&&c.hasMimeType(this.mimeType)){g=c.formatNum(e.description);if(g){p=g.split(",");if(parseInt(p[2],10)>=30226&&parseInt(p[0],10)<2){p[0]="2"}g=p.join(",")}if(c.isGecko&&!h){f=true}if(!f&&!h&&g){a=c.instantiate("object",["type",this.mimeType],[]);b=c.getObject(a);if(b){if(typeof b.IsVersionSupported!="undefined"){f=true}if(!f){b.data="data:"+this.mimeType+",";if(typeof b.IsVersionSupported!="undefined"){f=true}}}c.uninstantiate(a)}}}else{b=c.getAXO(this.progID);var p=[1,0,1,1,1],l,k,o,i=function(d){return(d<10?"0":"")+d.toString()},m=function(q,d,s,t,r){return(q+"."+d+"."+s+i(t)+i(r)+".0")},n=function(d,s){var q,r=m((d==0?s:p[0]),(d==1?s:p[1]),(d==2?s:p[2]),(d==3?s:p[3]),(d==4?s:p[4]));try{return b.IsVersionSupported(r)}catch(q){}return false};if(b&&typeof b.IsVersionSupported!="undefined"){for(l=0;l0)?RegExp.$2.charCodeAt(0):-1;i=/([\d]+)([a-z]?)/.test(h[g]);a=parseInt(RegExp.$1,10);e=(g==2&&RegExp.$2.length>0)?RegExp.$2.charCodeAt(0):-1;if(b!=a){return(b>a?1:-1)}if(g==2&&f!=e){return(f>e?1:-1)}}return 0},getVersion:function(){var b=this.$,d,a=null,c;if(!b.isIE){if(b.hasMimeType(this.mimeType)){d=b.findNavPlugin(["VLC","(Plug-in|Plugin)"],false);if(d&&d.description){a=b.getNum(d.description,"[\\d][\\d\\.]*[a-z]*")}}this.installed=a?1:-1}else{d=b.getAXO(this.progID);if(d){try{a=b.getNum(d.VersionInfo,"[\\d][\\d\\.]*[a-z]*")}catch(c){}}this.installed=d?1:-1}this.version=b.formatNum(a)}};PluginDetect.initScript(); \ No newline at end of file diff --git a/js/price.js b/js/price.js new file mode 100644 index 000000000..32421adf8 --- /dev/null +++ b/js/price.js @@ -0,0 +1,224 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function getTax() +{ + if (noTax) + return 0; + var selectedTax = document.getElementById('id_tax_rules_group'); + var taxId = selectedTax.options[selectedTax.selectedIndex].value; + return taxesArray[taxId]; +} + +function getEcotaxTaxIncluded() +{ + return ($('#ecotax').length && $('#ecotax').val() != '') ? parseFloat($('#ecotax').val()) : 0; +} + +function getEcotaxTaxExcluded() +{ + return getEcotaxTaxIncluded() / (1 + ecotaxTaxRate); +} + +function formatPrice(price) +{ + var fixedToSix = (Math.round(price * 1000000) / 1000000); + return (Math.round(fixedToSix) == fixedToSix + 0.000001 ? fixedToSix + 0.000001 : fixedToSix); +} + +function calcPriceTI() +{ + var tax = getTax(); + var priceTE = parseFloat(document.getElementById('priceTE').value.replace(/,/g, '.')); + var newPrice = priceTE * ((tax / 100) + 1); + document.getElementById('priceTI').value = (isNaN(newPrice) == true || newPrice < 0) ? '' : + ps_round(newPrice, 2); + document.getElementById('finalPrice').innerHTML = (isNaN(newPrice) == true || newPrice < 0) ? '' : + ps_round(newPrice, 2).toFixed(2); + document.getElementById('finalPriceWithoutTax').innerHTML = (isNaN(priceTE) == true || priceTE < 0) ? '' : + (ps_round(priceTE, 2) + getEcotaxTaxExcluded()).toFixed(2); + calcReduction(); + document.getElementById('priceTI').value = parseFloat(document.getElementById('priceTI').value) + getEcotaxTaxIncluded(); + document.getElementById('finalPrice').innerHTML = parseFloat(document.getElementById('priceTI').value); +} + +function calcPriceTE() +{ + var tax = getTax(); + var priceTI = parseFloat(document.getElementById('priceTI').value.replace(/,/g, '.')); + var newPrice = ps_round(priceTI - getEcotaxTaxIncluded(), 2) / ((tax / 100) + 1); + document.getElementById('priceTE').value = (isNaN(newPrice) == true || newPrice < 0) ? '' : + ps_round(newPrice.toFixed(6), 6); + document.getElementById('finalPrice').innerHTML = (isNaN(newPrice) == true || newPrice < 0) ? '' : + ps_round(priceTI.toFixed(2), 2); + document.getElementById('finalPriceWithoutTax').innerHTML = (isNaN(newPrice) == true || newPrice < 0) ? '' : + ps_round(newPrice.toFixed(2), 2) + getEcotaxTaxExcluded(); + calcReduction(); +} + +function calcImpactPriceTI() +{ + var tax = getTax(); + var priceTE = parseFloat(document.getElementById('attribute_price').value.replace(/,/g, '.')); + var newPrice = priceTE * ((tax / 100) + 1); + $('#attribute_priceTI').val((isNaN(newPrice) == true || newPrice < 0) ? '' :ps_round(newPrice.toFixed(6), 6)); + var total = ps_round((parseFloat($('#attribute_priceTI').val())*parseInt($('#attribute_price_impact').val())+parseFloat($('#finalPrice').html())), 2); + if (isNaN(total) || total < 0) + $('#attribute_new_total_price').html('0.00'); + else + $('#attribute_new_total_price').html(total); +} + +function calcImpactPriceTE() +{ + var tax = getTax(); + var priceTI = parseFloat(document.getElementById('attribute_priceTI').value.replace(/,/g, '.')); + priceTI = (isNaN(priceTI)) ? 0 : ps_round(priceTI); + var newPrice = ps_round(priceTI, 2) / ((tax / 100) + 1); + $('#attribute_price').val((isNaN(newPrice) == true || newPrice < 0) ? '' :ps_round(newPrice.toFixed(6), 6)); + var total = ps_round((parseFloat($('#attribute_priceTI').val())*parseInt($('#attribute_price_impact').val())+parseFloat($('#finalPrice').html())), 2); + if (isNaN(total) || total < 0) + $('#attribute_new_total_price').html('0.00'); + else + $('#attribute_new_total_price').html(total); +} + +function calcReduction() +{ + if (parseFloat($('#reduction_price').val()) > 0) + reductionPrice(); + else if (parseFloat($('#reduction_percent').val()) > 0) + reductionPercent(); +} + +function reductionPrice() +{ + var tax = getTax(); + var price = document.getElementById('priceTI'); + var priceWhithoutTaxes = document.getElementById('priceTE'); + var newprice = document.getElementById('finalPrice'); + var newpriceWithoutTax = document.getElementById('finalPriceWithoutTax'); + var curPrice = price.value; + + document.getElementById('reduction_percent').value = 0; + if (isInReductionPeriod()) + { + var rprice = document.getElementById('reduction_price'); + if (parseFloat(curPrice) <= parseFloat(rprice.value)) + rprice.value = curPrice; + if (parseFloat(rprice.value) < 0 || isNaN(parseFloat(curPrice))) + rprice.value = 0; + curPrice = curPrice - rprice.value; + } + + newprice.innerHTML = (ps_round(parseFloat(curPrice),2) + getEcotaxTaxIncluded()).toFixed(2); + var rpriceWithoutTaxes = ps_round(rprice.value / ((tax / 100) + 1), 2); + newpriceWithoutTax.innerHTML = ps_round(priceWhithoutTaxes.value - rpriceWithoutTaxes,2).toFixed(2); +} + +function reductionPercent() +{ + var tax = getTax(); + var price = document.getElementById('priceTI'); + var newprice = document.getElementById('finalPrice'); + var newpriceWithoutTax = document.getElementById('finalPriceWithoutTax'); + var curPrice = price.value; + + document.getElementById('reduction_price').value = 0; + if (isInReductionPeriod()) + { + var newprice = document.getElementById('finalPrice'); + var rpercent = document.getElementById('reduction_percent'); + + if (parseFloat(rpercent.value) >= 100) + rpercent.value = 100; + if (parseFloat(rpercent.value) < 0) + rpercent.value = 0; + curPrice = price.value * (1 - (rpercent.value / 100)); + } + + newprice.innerHTML = (ps_round(parseFloat(curPrice),2) + getEcotaxTaxIncluded()).toFixed(2); + newpriceWithoutTax.innerHTML = ps_round(parseFloat(ps_round(curPrice, 2) / ((tax / 100) + 1)),2).toFixed(2); +} + +function isInReductionPeriod() +{ + var start = document.getElementById('reduction_from').value; + var end = document.getElementById('reduction_to').value; + + if (start == end && start != "" && start != "0000-00-00 00:00:00") return true; + + var sdate = new Date(start.replace(/-/g,'/')); + var edate = new Date(end.replace(/-/g,'/')); + var today = new Date(); + + return (sdate <= today && edate >= today); +} + +function decimalTruncate(source, decimals) +{ + if (typeof(decimals) == 'undefined') + decimals = 6; + source = source.toString(); + var pos = source.indexOf('.'); + return parseFloat(source.substr(0, pos + decimals + 1)); +} + +function unitPriceWithTax(type) +{ + var tax = getTax(); + var priceWithTax = parseFloat(document.getElementById(type+'_price').value.replace(/,/g, '.')); + var newPrice = priceWithTax * ((tax / 100) + 1); + $('#'+type+'_price_with_tax').html((isNaN(newPrice) == true || newPrice < 0) ? '0.00' : ps_round(newPrice, 2).toFixed(2)); +} + +function unitySecond() +{ + $('#unity_second').html($('#unity').val()); + if ($('#unity').get(0).value.length > 0) + { + $('#unity_third').html($('#unity').val()); + $('#tr_unit_impact').show(); + } + else + $('#tr_unit_impact').hide(); +} + +function changeCurrencySpecificPrice(index) +{ + var id_currency = $('#spm_currency_' + index).val(); + if (currencies[id_currency]["format"] == 2 || currencies[id_currency]["format"] == 4) + { + $('#spm_currency_sign_pre_' + index).html(''); + $('#spm_currency_sign_post_' + index).html(' ' + currencies[id_currency]["sign"]); + } + else if (currencies[id_currency]["format"] == 1 || currencies[id_currency]["format"] == 3) + { + $('#spm_currency_sign_post_' + index).html(''); + $('#spm_currency_sign_pre_' + index).html(currencies[id_currency]["sign"] + ' '); + } +} + diff --git a/js/sendMailTest.js b/js/sendMailTest.js new file mode 100644 index 000000000..7f8708be3 --- /dev/null +++ b/js/sendMailTest.js @@ -0,0 +1,80 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License (OSL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/osl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +//constant +verifMailREGEX = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/; + +function verifyMail(testMsg, testSubject) +{ + $("#mailResultCheck").removeClass("ok").removeClass('fail').html(''); + $("#mailResultCheck").slideDown("slow"); + + //local verifications + if ($("#testEmail[value=]").length > 0) + { + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(errorMail); + return false; + } + else if (!verifMailREGEX.test( $("#testEmail").val() )) + { + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(errorMail); + return false; + } + else + { + //external verifications and sets + $.ajax( + { + url: "ajax_send_mail_test.php", + cache: false, + data: + "mailMethod="+(($("input#PS_MAIL_METHOD").val() == 2) ? "smtp" : "native")+ + "&smtpSrv="+ $("input#PS_MAIL_SERVER").val()+ + "&testEmail="+ $("#testEmail").val()+ + "&smtpLogin="+ $("input#PS_MAIL_USER").val()+ + "&smtpPassword="+ $("input#PS_MAIL_PASSWD").val()+ + "&smtpPort="+ $("input#PS_MAIL_SMTP_PORT").val()+ + "&smtpEnc="+ $("select#PS_MAIL_SMTP_ENCRYPTION").val()+ + "&testMsg="+textMsg+ + "&testSubject="+textSubject + , + success: function(ret) + { + if (ret == "ok") + { + $("#mailResultCheck").addClass("ok").removeClass("fail").removeClass('userInfos').html(textSendOk); + mailIsOk = true; + } + else + { + mailIsOk = false; + $("#mailResultCheck").addClass("fail").removeClass("ok").removeClass('userInfos').html(textSendError); + } + } + } + ); + } +} \ No newline at end of file diff --git a/js/tabpane.js b/js/tabpane.js new file mode 100644 index 000000000..908c6037a --- /dev/null +++ b/js/tabpane.js @@ -0,0 +1,287 @@ +/*----------------------------------------------------------------------------\ +| Tab Pane 1.02 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +\----------------------------------------------------------------------------*/ + +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; +} + +function WebFXTabPane( el ) { + if ( !hasSupport() || el == null ) return; + + this.element = el; + this.element.tabPane = this; + this.pages = []; + this.selectedIndex = null; + + // 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 = pos_select; + 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(); + + // Add-on jQuery + loadTab(this.selectedIndex+1); + } +}; + +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; +}; + +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; + } + } + + 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 ); + + 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"; + pos_select = this.element.id.substring(4, 5) - 1; + document.getElementById('tabs').value = pos_select; + loadTab(pos_select+1); +}; + +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; + } +} + +// Select the right tabs +if (!pos_select) + pos_select = 0; + +// 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 diff --git a/js/tiny_mce/langs/en.js b/js/tiny_mce/langs/en.js new file mode 100755 index 000000000..d3e24c71a --- /dev/null +++ b/js/tiny_mce/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n({en:{common:{"more_colors":"More colors","invalid_data":"Error: Invalid values entered, these are marked in red.","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.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\\nDo you want more information about this issue?","not_set":"-- Not set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert time","insertdate_desc":"Insert date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction right to left","ltr_desc":"Direction left to right"},layer:{content:"New layer...","absolute_desc":"Toggle absolute positioning","backward_desc":"Move backward","forward_desc":"Move forward","insertlayer_desc":"Insert new layer"},save:{"save_desc":"Save","cancel_desc":"Cancel all changes"},nonbreaking:{"nonbreaking_desc":"Insert non-breaking space character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Run spell checking"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Horizontal rule"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/edit image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/edit link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode_sticky":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use CTRL+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep linebreaks","text_title":"Use CTRL+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete table","copy_row_desc":"Copy table row","cut_row_desc":"Cut table row","paste_row_after_desc":"Paste table row after","paste_row_before_desc":"Paste table row before","props_desc":"Table properties","cell_desc":"Table cell properties","row_desc":"Table row properties","merge_cells_desc":"Merge table cells","split_cells_desc":"Split merged table cells","delete_col_desc":"Remove column","col_after_desc":"Insert column after","col_before_desc":"Insert column before","delete_row_desc":"Delete row","row_after_desc":"Insert row after","row_before_desc":"Insert row before",desc:"Inserts a new table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\\n\\nAre you sure you want to restore the saved content?.","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle fullscreen mode"},media:{"delta_height":"","delta_width":"",edit:"Edit embedded media",desc:"Insert / edit embedded media"},fullpage:{desc:"Document properties","delta_width":"","delta_height":""},template:{desc:"Insert predefined template content"},visualchars:{desc:"Visual control characters on/off."},spellchecker:{desc:"Toggle spellchecker",menu:"Spellchecker settings","ignore_word":"Ignore word","ignore_words":"Ignore all",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No suggestions","no_mpell":"No misspellings found."},pagebreak:{desc:"Insert page break."},advlist:{types:"Types",def:"Default","lower_alpha":"Lower alpha","lower_greek":"Lower greek","lower_roman":"Lower roman","upper_alpha":"Upper alpha","upper_roman":"Upper roman",circle:"Circle",disc:"Disc",square:"Square"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/es.js b/js/tiny_mce/langs/es.js new file mode 100755 index 000000000..ff1d88526 --- /dev/null +++ b/js/tiny_mce/langs/es.js @@ -0,0 +1 @@ +tinyMCE.addI18n({es:{common:{"more_colors":"M\u00e1s colores","invalid_data":"Error: Introdujo un valor no v\u00e1lido, est\u00e1n marcados en rojo.","popup_blocked":"Lo sentimos, su bloqueo de ventanas emergentes ha deshabilitado una ventana que provee funcionalidades a la aplicaci\u00f3n. Necesita deshabilitar este bloqueo en este sitio para poder utilizar todas las funciones.","clipboard_no_support":"Su navegador no soporta las funciones de cortapapeles, use los accesos por teclado.","clipboard_msg":"Copiar/Cortar/Pegar no se encuentra disponible en Mozilla y Firefox.\\n \u00bfDesea obtener m\u00e1s informaci\u00f3n acerca de este tema?","not_set":"-- Ninguno --","class_name":"Clase",browse:"Examinar",close:"Cerrar",cancel:"Cancelar",update:"Actualizar",insert:"Insertar",apply:"Aplicar","edit_confirm":" \u00bfDesea utilizar el modo WYSIWYG para esta caja de texto?"},contextmenu:{full:"Justificado",right:"Derecha",center:"Centrado",left:"Izquierda",align:"Alineaci\u00f3n"},insertdatetime:{"day_short":"Dom,Lun,Mar,Mie,Jue,Vie,Sab,Dom","day_long":"Domingo,Lunes,Martes,Mi\u00e9rcoles,Jueves,Viernes,S\u00e1bado,Domingo","months_short":"Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic","months_long":"Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre","inserttime_desc":"Insertar hora","insertdate_desc":"Insertar fecha","time_fmt":"%H:%M:%S","date_fmt":"%d-%m-%Y"},print:{"print_desc":"Imprimir"},preview:{"preview_desc":"Vista previa"},directionality:{"rtl_desc":"Direcci\u00f3n derecha a izquierda","ltr_desc":"Direcci\u00f3n izquierda a derecha"},layer:{content:"Nueva capa...","absolute_desc":"Cambiar a posici\u00f3n absoluta","backward_desc":"Retroceder","forward_desc":"Avanzar","insertlayer_desc":"Insertar nueva capa"},save:{"save_desc":"Guardar","cancel_desc":"Cancelar todos los cambios"},nonbreaking:{"nonbreaking_desc":"Insertar caracter de espacio \'non-breaking\'"},iespell:{download:"No se detect\u00f3 \'ieSpell\'. \u00bfDesea instalarlo ahora?","iespell_desc":"Corrector ortogr\u00e1fico"},advhr:{"advhr_desc":"Regla horizontal","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Emoticones","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Buscar/Reemplazar","search_desc":"Buscar","delta_width":"","delta_height":""},advimage:{"image_desc":"Insertar/editar imagen","delta_width":"","delta_height":""},advlink:{"link_desc":"Insertar/editar hiperv\u00ednculo","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Insertar/Editar atributos","ins_desc":"Inserci\u00f3n","del_desc":"Borrado","acronym_desc":"Acr\u00f3nimo","abbr_desc":"Abreviatura","cite_desc":"Cita","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"Editar Estilo CSS","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode_sticky":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Elegir todo","paste_word_desc":"Pegar desde Word","paste_text_desc":"Pegar como texto plano"},"paste_dlg":{"word_title":"Use CTRL+V en su teclado para pegar el texto en la ventana.","text_linebreaks":"Keep linebreaks","text_title":"Use CTRL+V en su teclado para pegar el texto en la ventana."},table:{cell:"Celda",col:"Columna",row:"Fila",del:"Eliminar tabla","copy_row_desc":"Copiar fila","cut_row_desc":"Cortar fila","paste_row_after_desc":"Pegar filas (despu\u00e9s)","paste_row_before_desc":"Pegar filas (antes)","props_desc":"Propiedades de la tabla","cell_desc":"Propiedades de la celda","row_desc":"Propiedades de la fila","merge_cells_desc":"Vincular celdas","split_cells_desc":"Dividir celdas","delete_col_desc":"Suprimir columna","col_after_desc":"Insertar columna (despu\u00e9s)","col_before_desc":"Insertar columna (antes)","delete_row_desc":"Suprimir fila","row_after_desc":"Insertar fila (despu\u00e9s)","row_before_desc":"Insertar fila (antes)",desc:"Inserta una nueva tabla","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Se reestablece en contenido guardado, perder\u00e1 todo el contenido que est\u00e1 actualmente en el editor.\\n\\nEst\u00e1 seguro de que quiere reestablecer el contenido guardado.","restore_content":"Reestablecer contenido guardado autom\u00e1ticamente","unload_msg":"Los cambios realizados se perder\u00e1n si sale de esta p\u00e1gina."},fullscreen:{desc:"Cambiar a modo Pantalla Completa"},media:{edit:"Editar medio embebido",desc:"Insertar/editar medio embebido","delta_height":"","delta_width":""},fullpage:{desc:"Propiedades del documento","delta_width":"Ancho","delta_height":"Alto"},template:{desc:"Insertar contenido de plantilla predefinida"},visualchars:{desc:"Caracteres de control ON/OFF."},spellchecker:{desc:"Cambiar a corrector ortogr\u00e1fico",menu:"Configuraci\u00f3n de corrector ortogr\u00e1fico","ignore_word":"Ignorar","ignore_words":"Ignorar todo",langs:"Idiomas",wait:"Espere...",sug:"Sugerencias","no_sug":"Sin sugerencias","no_mpell":"No se encontraron errores."},pagebreak:{desc:"Insertar fin de p\u00e1gina"},advlist:{types:"Tipo",def:"Preestablecido","lower_alpha":"Menos opaco","lower_greek":"Menos greek","lower_roman":"Menos roman","upper_alpha":"M\u00e1s opaco","upper_roman":"M\u00e1s roman",circle:"Circulo",disc:"Disc",square:"Cuadro"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/et.js b/js/tiny_mce/langs/et.js new file mode 100755 index 000000000..6d1fbb0c4 --- /dev/null +++ b/js/tiny_mce/langs/et.js @@ -0,0 +1 @@ +tinyMCE.addI18n({et:{common:{more_colors:"Rohkem v\u00e4rve",invalid_data:"Viga: Kehtetud v\u00e4\u00e4rtused sisestatud, need on m\u00e4rgitud punasega.",popup_blocked:"Vabandust, aga Teie h\u00fcpikakna t\u00f5kestaja on blokeerinud akna, mis varustab rakenduse funktsionaalsust. Palun lubage h\u00fcpikaknad sellel kodulehel, et t\u00e4ielikult kasutada seda vahendit.",clipboard_no_support:"Hetkel ei ole toetatud Teie lehitseja poolt, kasutage klaviatuuri otseteid selle asemel.",clipboard_msg:"Kopeeri/L\u00f5ika/Kleebi ei ole saadaval Mozillas ja Firefoxis.\\nKas soovite rohkem infot selle probleemi kohta?",not_set:"-- Seadmata --",class_name:"Klass",browse:"Sirvi",close:"Sule",cancel:"T\u00fchista",update:"Uuenda",insert:"Sisesta",apply:"Rakenda",edit_confirm:"Kas soovite kasutada WYSIWYG re\u017eiimi sellel tekstialal?"},contextmenu:{full:"T\u00e4is",right:"Parem",center:"Kesk",left:"Vasak",align:"Joondus"},insertdatetime:{day_short:"P,E,T,K,N,R,L,P",day_long:"P\u00fchap\u00e4ev,Esmasp\u00e4ev,Teisip\u00e4ev,Kolmap\u00e4ev,Neljap\u00e4ev,Reede,Laup\u00e4ev,P\u00fchap\u00e4ev",months_short:"Jaan,Veeb,M\u00e4rts,Apr,Mai,Juuni,Juuli,Aug,Sept,Okt,Nov,Dets",months_long:"Jaanuar,Veebruar,M\u00e4rts,Aprill,Mai,Juuni,Juuli,August,September,Oktoober,November,Detsember",inserttime_desc:"Sisesta aeg",insertdate_desc:"Sisesta kuup\u00e4ev",time_fmt:"%T:%M:%S",date_fmt:"%A-%k-%p"},print:{print_desc:"Print"},preview:{preview_desc:"Eelvaade"},directionality:{rtl_desc:"Suund paremalt vasakule",ltr_desc:"Suund vasakult paremale"},layer:{content:"Uus kiht...",absolute_desc:"L\u00fclita \u00fcmber absoluutne positsioneerimine",backward_desc:"Liiguta tagasi",forward_desc:"Liiguta edasi",insertlayer_desc:"Sisesta uus kiht"},save:{save_desc:"Salvesta",cancel_desc:"T\u00fchista k\u00f5ik muudatused"},nonbreaking:{nonbreaking_desc:"Sisesta mittekatkestav t\u00fchik"},iespell:{download:"ie\u00d5igekiri tuvastamata. Kas soovite paigaldada n\u00fc\u00fcd?",iespell_desc:"\u00d5igekirja kontroll"},advhr:{advhr_desc:"Horisontaalne joonlaud",delta_height:"",delta_width:""},emotions:{emotions_desc:"Emotsioonid",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Otsi/Asenda",search_desc:"Otsi",delta_width:"",delta_height:""},advimage:{image_desc:"Sisesta/redigeeri pilt",delta_width:"",delta_height:""},advlink:{link_desc:"Sisesta/redigeeri link",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Sisesta muuda atribuute",ins_desc:"Lisandus",del_desc:"Kustutus",acronym_desc:"Akron\u00fc\u00fcm",abbr_desc:"L\u00fchend",cite_desc:"Tsitaat",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Redigeeri CSS stiili",delta_height:"",delta_width:""},paste:{selectall_desc:"Vali k\u00f5ik",paste_word_desc:"Kleebi Wordist",paste_text_desc:"Kleebi tavalise tekstina",plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode."},paste_dlg:{word_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks.",text_linebreaks:"J\u00e4ta reavahetused",text_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks."},table:{cell:"Lahter",col:"Veerg",row:"Rida",del:"Kustuta tabel",copy_row_desc:"Kopeeri tabeli rida",cut_row_desc:"L\u00f5ika tabeli rida",paste_row_after_desc:"Kleebi tabeli rida j\u00e4rgi",paste_row_before_desc:"Kleebi tabeli rida ette",props_desc:"Tabeli omadused",cell_desc:"Tabeli lahtri omadused",row_desc:"Tabeli rea omadused",merge_cells_desc:"\u00dchenda tabeli lahtrid",split_cells_desc:"Eralda \u00fchendatud tabeli lahtrid",delete_col_desc:"Kustuta veerg",col_after_desc:"Sisesta veerg j\u00e4rgi",col_before_desc:"Sisesta veerg ette",delete_row_desc:"Kustuta rida",row_after_desc:"Sisesta rida j\u00e4rgi",row_before_desc:"Sisesta rida ette",desc:"Sisestab uue tabeli",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{unload_msg:"Tehtud muudatused kaovad, kui lahkute siit lehelt.",warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\\n\\nAre you sure you want to restore the saved content?.",restore_content:"Restore auto-saved content."},fullscreen:{desc:"L\u00fclita \u00fcmber t\u00e4isekraani re\u017eiim"},media:{edit:"Redigeeri manustatud meedia",desc:"Sisesta / redigeeri manustatud meedia",delta_height:"",delta_width:""},fullpage:{desc:"Dokumendi omadused",delta_width:"",delta_height:""},template:{desc:"Sisesta eeldefineeritud \u0161ablooni sisu"},visualchars:{desc:"Visuaalsed kontrollt\u00e4hem\u00e4rgid sisse/v\u00e4lja"},spellchecker:{desc:"L\u00fclita \u00fcmber \u00f5igekirja kontroll",menu:"\u00d5igekirja kontrolli seaded",ignore_word:"J\u00e4ta s\u00f5na vahele",ignore_words:"J\u00e4ra k\u00f5ik vahele",langs:"Keeled",wait:"Palun oota...",sug:"Soovitused",no_sug:"Soovitusi pole",no_mpell:"Valesti kirjutamisi ei leitud."},pagebreak:{desc:"Sisesta lehevahetus."},advlist:{types:"Types",def:"Default",lower_alpha:"Lower alpha",lower_greek:"Lower greek",lower_roman:"Lower roman",upper_alpha:"Upper alpha",upper_roman:"Upper roman",circle:"Circle",disc:"Disc",square:"Square"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/fi.js b/js/tiny_mce/langs/fi.js new file mode 100755 index 000000000..d5282dc61 --- /dev/null +++ b/js/tiny_mce/langs/fi.js @@ -0,0 +1 @@ +tinyMCE.addI18n({fi:{common:{more_colors:"Enemm\u00e4n v\u00e4rej\u00e4",invalid_data:"Virhe: Sy\u00f6tit virheellisi\u00e4 arvoja, ne n\u00e4kyv\u00e4t punaisina.",popup_blocked:"Sinulla on k\u00e4yt\u00f6ss\u00e4si ohjelma, joka est\u00e4\u00e4 ponnahdusikkunoiden n\u00e4yt\u00f6n. Sinun t\u00e4ytyy kytke\u00e4 ponnahdusikkunoiden esto pois p\u00e4\u00e4lt\u00e4 voidaksesi hy\u00f6dynt\u00e4\u00e4 t\u00e4ysin t\u00e4t\u00e4 ty\u00f6kalua.",clipboard_no_support:"Selaimesi ei ole tuettu, k\u00e4yt\u00e4 sen sijaan n\u00e4pp\u00e4inoikoteit\u00e4.",clipboard_msg:"Kopioi/Leikkaa/Liit\u00e4 ei ole k\u00e4ytett\u00e4viss\u00e4 Mozilla ja Firefox -selaimilla.\\nHaluatko lis\u00e4tietoa t\u00e4st\u00e4 ongelmasta?",not_set:"-- Ei m\u00e4\u00e4ritetty --",class_name:"Luokka",browse:"Selaa",close:"Sulje",cancel:"Peru",update:"P\u00e4ivit\u00e4",insert:"Lis\u00e4\u00e4",apply:"K\u00e4yt\u00e4",edit_confirm:"Haluatko k\u00e4ytt\u00e4\u00e4 WYSIWYG-tilaa t\u00e4ss\u00e4 tekstikent\u00e4ss\u00e4?"},contextmenu:{full:"Molemmille puolille",right:"Oikealle",center:"Keskelle",left:"Vasemmalle",align:"Tasaus"},insertdatetime:{day_short:"su,ma,ti,ke,to,pe,la,su",day_long:"sunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai,sunnuntai",months_short:"tammi,helmi,maalis,huhti,touko,kes\u00e4,hein\u00e4,elo,syys,loka,marras,joulu",months_long:"tammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kes\u00e4kuu,hein\u00e4kuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu",inserttime_desc:"Lis\u00e4\u00e4 kellonaika",insertdate_desc:"Lis\u00e4\u00e4 p\u00e4iv\u00e4m\u00e4\u00e4r\u00e4",time_fmt:"%H:%M:%S",date_fmt:"%d.%m.%Y"},print:{print_desc:"Tulosta"},preview:{preview_desc:"Esikatselu"},directionality:{rtl_desc:"Suunta oikealta vasemmalle",ltr_desc:"Suunta vasemmalta oikealle"},layer:{content:"Uusi taso...",absolute_desc:"Absoluuttinen sijainti",backward_desc:"Siirr\u00e4 taaksep\u00e4in",forward_desc:"Siirr\u00e4 eteenp\u00e4in",insertlayer_desc:"Lis\u00e4\u00e4 uusi taso"},save:{save_desc:"Tallenna",cancel_desc:"Peru kaikki muutokset"},nonbreaking:{nonbreaking_desc:"Lis\u00e4\u00e4 tyhj\u00e4 merkki (nbsp)"},iespell:{download:"ieSpell-ohjelmaa ei havaittu. Haluatko asentaa sen nyt?",iespell_desc:"Oikeinkirjoituksen tarkistus"},advhr:{advhr_desc:"Vaakatasoviivain",delta_height:"",delta_width:""},emotions:{emotions_desc:"Hymi\u00f6t",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Etsi ja korvaa",search_desc:"Etsi",delta_width:"",delta_height:""},advimage:{image_desc:"Lis\u00e4\u00e4/muokkaa kuvaa",delta_width:"",delta_height:""},advlink:{link_desc:"Lis\u00e4\u00e4/muokkaa linkki\u00e4",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Lis\u00e4\u00e4/muokkaa attribuutteja",ins_desc:"Lis\u00e4ys",del_desc:"Poisto",acronym_desc:"Kirjainlyhenne",abbr_desc:"Lyhenne",cite_desc:"Sitaatti",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Muokkaa CSS-tyylej\u00e4",delta_height:"",delta_width:""},paste:{plaintext_mode:"Liitt\u00e4minen on nyt pelkk\u00e4n\u00e4 tekstin\u00e4. Klikkaa uudelleen vaihtaaksesi takaisin tavalliseen tilaan.",plaintext_mode_sticky:"Liitt\u00e4minen on nyt pelkk\u00e4n\u00e4 tekstin\u00e4. Klikkaa uudelleen vaihtaaksesi takaisin tavalliseen tilaan. Palaat takaisin tavalliseen tilaan liitetty\u00e4si jotakin.",selectall_desc:"Valitse kaikki",paste_word_desc:"Liit\u00e4 Wordist\u00e4",paste_text_desc:"Liit\u00e4 pelkk\u00e4n\u00e4 tekstin\u00e4"},paste_dlg:{word_title:"Paina Ctrl+V liitt\u00e4\u00e4ksesi sis\u00e4ll\u00f6n ikkunaan.",text_linebreaks:"S\u00e4ilyt\u00e4 rivinvaihdot",text_title:"Paina Ctrl+V liitt\u00e4\u00e4ksesi sis\u00e4ll\u00f6n ikkunaan."},table:{cellprops_delta_width:"80",cell:"Solu",col:"Sarake",row:"Rivi",del:"Poista taulukko",copy_row_desc:"Kopioi taulukon rivi",cut_row_desc:"Leikkaa taulukon rivi",paste_row_after_desc:"Liit\u00e4 taulukon rivi j\u00e4lkeen",paste_row_before_desc:"Liit\u00e4 taulukon rivi ennen",props_desc:"Taulukon asetukset",cell_desc:"Taulukon solun asetukset",row_desc:"Taulukon rivin asetukset",merge_cells_desc:"Yhdist\u00e4 taulukon solut",split_cells_desc:"Jaa yhdistetyt taulukon solut",delete_col_desc:"Poista sarake",col_after_desc:"Lis\u00e4\u00e4 sarake j\u00e4lkeen",col_before_desc:"Lis\u00e4\u00e4 sarake ennen",delete_row_desc:"Poista rivi",row_after_desc:"Lis\u00e4\u00e4 rivi j\u00e4lkeen",row_before_desc:"Lis\u00e4\u00e4 rivi ennen",desc:"Lis\u00e4\u00e4 uusi taulukko",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Jos palautat automaattisesti tallennetun sis\u00e4ll\u00f6n, menet\u00e4t t\u00e4ll\u00e4 hetkell\u00e4 editorissa olevan sis\u00e4ll\u00f6n.\\n\\nHaluatko varmasti palauttaa tallennetun sis\u00e4ll\u00f6n?",restore_content:"Palauta automaattisesti tallennettu sis\u00e4lt\u00f6.",unload_msg:"Tekem\u00e4si muutokset menetet\u00e4\u00e4n jos poistut t\u00e4lt\u00e4 sivulta."},fullscreen:{desc:"Kokoruututila"},media:{edit:"Muokkaa upotettua mediaa",desc:"Lis\u00e4\u00e4/muokkaa upotettua mediaa",delta_height:"",delta_width:""},fullpage:{desc:"Tiedoston asetukset",delta_width:"",delta_height:""},template:{desc:"Lis\u00e4\u00e4 esim\u00e4\u00e4ritetty\u00e4 sivupohjasis\u00e4lt\u00f6\u00e4"},visualchars:{desc:"N\u00e4yt\u00e4/piilota muotoilumerkit."},spellchecker:{desc:"Oikeinkirjoituksen tarkistus",menu:"Oikeinkirjoituksen asetukset",ignore_word:"Ohita sana",ignore_words:"Ohita kaikki",langs:"Kielet",wait:"Odota ole hyv\u00e4...",sug:"Ehdotukset",no_sug:"Ei ehdotuksia",no_mpell:"Virheit\u00e4 ei l\u00f6ytynyt."},pagebreak:{desc:"Lis\u00e4\u00e4 sivunvaihto."},advlist:{types:"Tyypit",def:"Oletus",lower_alpha:"pienet kirjaimet: a, b, c",lower_greek:"pienet kirjaimet: \u03b1, \u03b2, \u03b3",lower_roman:"pienet kirjaimet: i, ii, iii",upper_alpha:"isot kirjaimet: A, B, C",upper_roman:"isot kirjaimet: I, II, III",circle:"Pallo",disc:"Ympyr\u00e4",square:"Neli\u00f6"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/fr.js b/js/tiny_mce/langs/fr.js new file mode 100755 index 000000000..c968352f6 --- /dev/null +++ b/js/tiny_mce/langs/fr.js @@ -0,0 +1 @@ +tinyMCE.addI18n({fr:{common:{more_colors:"Plus de couleurs",invalid_data:"Erreur : saisie de valeurs incorrectes. Elles sont mises en \u00e9vidence en rouge.",popup_blocked:"D\u00e9sol\u00e9, nous avons d\u00e9tect\u00e9 que votre bloqueur de popup a bloqu\u00e9 une fen\u00eatre dont l\'application a besoin. Vous devez d\u00e9sactiver votre bloqueur de popup pour pouvoir utiliser cet outil.",clipboard_no_support:"Actuellement non support\u00e9 par votre navigateur.\\n Veuillez utiliser les raccourcis clavier \u00e0 la place.",clipboard_msg:"Les fonctions Copier/Couper/Coller ne sont pas valables sur Mozilla et Firefox.\\nSouhaitez-vous avoir plus d\'informations sur ce sujet ?",not_set:"-- non d\u00e9fini --",class_name:"Classe",browse:"parcourir",close:"Fermer",cancel:"Annuler",update:"Mettre \u00e0 jour",insert:"Ins\u00e9rer",apply:"Appliquer",edit_confirm:"Souhaitez-vous utiliser le mode WYSIWYG pour cette zone de texte ?"},contextmenu:{full:"Justifi\u00e9",right:"Droite",center:"Centr\u00e9",left:"Gauche",align:"Alignement"},insertdatetime:{day_short:"Dim,Lun,Mar,Mer,Jeu,Ven,Sam,Dim",day_long:"Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi,Dimanche",months_short:"Jan,F\u00e9v,Mar,Avr,Mai,Juin,Juil,Ao\u00fbt,Sep,Oct,Nov,D\u00e9c",months_long:"Janvier,F\u00e9vrier,Mars,Avril,Mai,Juin,Juillet,Ao\u00fbt,Septembre,Octobre,Novembre,D\u00e9cembre",inserttime_desc:"Ins\u00e9rer l\'heure",insertdate_desc:"Ins\u00e9rer la date",time_fmt:"%H:%M:%S",date_fmt:"%d-%m-%Y"},print:{print_desc:"Imprimer"},preview:{preview_desc:"Pr\u00e9visualiser"},directionality:{rtl_desc:"\u00c9criture de droite \u00e0 gauche",ltr_desc:"\u00c9criture de gauche \u00e0 droite"},layer:{content:"Nouvelle couche\u2026",absolute_desc:"Activer le positionnement absolu",backward_desc:"D\u00e9placer vers l\'arri\u00e8re",forward_desc:"D\u00e9placer vers l\'avant",insertlayer_desc:"Ins\u00e9rer une nouvelle couche"},save:{save_desc:"Enregistrer",cancel_desc:"Annuler toutes les modifications"},nonbreaking:{nonbreaking_desc:"Ins\u00e9rer une espace ins\u00e9cable"},iespell:{download:"ieSpell n\'est pas install\u00e9. Souhaitez-vous l\'installer maintenant ?",iespell_desc:"Lancer le v\u00e9rificateur d\'orthographe"},advhr:{delta_height:"Ecart de hauteur",delta_width:"Ecart de largeur",advhr_desc:"Ins\u00e9rer un trait horizontal"},emotions:{emotions_desc:"\u00c9motic\u00f4nes",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Rechercher / remplacer",search_desc:"Rechercher",delta_width:"",delta_height:""},advimage:{image_desc:"Ins\u00e9rer / \u00e9diter une image",delta_width:"",delta_height:""},advlink:{link_desc:"Ins\u00e9rer / \u00e9diter un lien",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Ins\u00e9rer / \u00e9diter les attributs",ins_desc:"Ins\u00e9r\u00e9",del_desc:"Barr\u00e9",acronym_desc:"Acronyme",abbr_desc:"Abr\u00e9viation",cite_desc:"Citation",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"\u00c9diter la feuille de style (CSS)",delta_height:"",delta_width:""},paste:{plaintext_mode:"Le collage est actuellement en mode texte non format\u00e9. Cliquez \u00e0 nouveau pour revenir en mode de collage ordinaire.",plaintext_mode_sticky:"Le collage est actuellement en mode texte non format\u00e9. Cliquez \u00e0 nouveau pour revenir en mode de collage ordinaire. Apr\u00e8s avoir coll\u00e9 quelque chose, vous retournerez en mode de collage ordinaire.",selectall_desc:"Tout s\u00e9lectionner",paste_word_desc:"Coller un texte cr\u00e9\u00e9 sous Word",paste_text_desc:"Coller comme texte brut"},paste_dlg:{word_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre.",text_linebreaks:"Conserver les retours \u00e0 la ligne",text_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre."},table:{cell:"Cellule",col:"Colonne",row:"Ligne",del:"Effacer le tableau",copy_row_desc:"Copier la ligne",cut_row_desc:"Couper la ligne",paste_row_after_desc:"Coller la ligne apr\u00e8s",paste_row_before_desc:"Coller la ligne avant",props_desc:"Propri\u00e9t\u00e9s du tableau",cell_desc:"Propri\u00e9t\u00e9s de la cellule",row_desc:"Propri\u00e9t\u00e9s de la ligne",merge_cells_desc:"Fusionner les cellules",split_cells_desc:"Scinder les cellules fusionn\u00e9es",delete_col_desc:"Effacer la colonne",col_after_desc:"Ins\u00e9rer une colonne apr\u00e8s",col_before_desc:"Ins\u00e9rer une colonne avant",delete_row_desc:"Effacer la ligne",row_after_desc:"Ins\u00e9rer une ligne apr\u00e8s",row_before_desc:"Ins\u00e9rer une ligne avant",desc:"Ins\u00e9rer un nouveau tableau",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Si vous restaurez le contenu sauv\u00e9, vous perdrez le contenu qui est actuellement dans l\'\u00e9diteur.\\n\\n\u00cates-vous s\u00fbr de vouloir restaurer le contenu sauv\u00e9 ?",restore_content:"Restaurer le contenu auto-sauvegard\u00e9.",unload_msg:"Les modifications apport\u00e9es seront perdus si vous quittez cette page."},fullscreen:{desc:"Passer en mode plein \u00e9cran"},media:{edit:"\u00c9diter un m\u00e9dia incorpor\u00e9",desc:"Ins\u00e9rer / \u00e9diter un m\u00e9dia incorpor\u00e9",delta_height:"",delta_width:""},fullpage:{desc:"Propri\u00e9t\u00e9s du document",delta_width:"",delta_height:""},template:{desc:"Ins\u00e9rer un mod\u00e8le pr\u00e9d\u00e9fini."},visualchars:{desc:"Activer les caract\u00e8res de mise en page."},spellchecker:{desc:"Activer le v\u00e9rificateur d\'orthographe",menu:"Param\u00e8tres du v\u00e9rificateur d\'orthographe",ignore_word:"Ignorer le mot",ignore_words:"Tout ignorer",langs:"Langues",wait:"Veuillez patienter\u2026",sug:"Suggestions",no_sug:"Aucune suggestion",no_mpell:"Aucune erreur trouv\u00e9e."},pagebreak:{desc:"Ins\u00e9rer un saut de page."},advlist:{types:"Types",def:"D\u00e9faut",lower_alpha:"Alpha minuscule",lower_greek:"Grec minuscule",lower_roman:"Romain minuscule",upper_alpha:"Alpha majuscule",upper_roman:"Romain majuscule",circle:"Cercle",disc:"Disque",square:"Carr\u00e9"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/gl.js b/js/tiny_mce/langs/gl.js new file mode 100755 index 000000000..18586e925 --- /dev/null +++ b/js/tiny_mce/langs/gl.js @@ -0,0 +1 @@ +tinyMCE.addI18n({gl:{common:{more_colors:"Mais cores",invalid_data:"Error: Introducidos valores non v\u00e1lidos, est\u00e1n marcados en vermello.",popup_blocked:"O seu bloqueador de vent\u00e1s emerxentes deshabilitou unha vent\u00e1 que precisa pra o funcionamento da aplicaci\u00f3n. Precisa deshabilita-lo bloqueo de `popups` neste sitio pra utilizar \u00f3 m\u00e1ximo esta ferramenta.",clipboard_no_support:"O seu navegador non soporta estas funci\u00f3ns, use os atallos de teclado.",clipboard_msg:"Copiar/Cortar/Pegar non est\u00e1 disponible en Mozilla e Firefox.\\n\u00bfDesexa obter mais informaci\u00f3n sobre de este asunto?",not_set:"-- Ning\u00fan --",class_name:"Clase",browse:"Examinar",close:"Cerrar",cancel:"Cancelar",update:"Actualizar",insert:"Insertar",apply:"Apricar",edit_confirm:"\u00bfDesexa utiliza-lo modo WYSIWYG pra esta caixa de texto?"},contextmenu:{full:"Xustificado",right:"Dereita",center:"Centrado",left:"Esquerda",align:"Ali\u00f1amento"},insertdatetime:{day_short:"Dom,Lun,Mar,M\u00e9r,Xov,Ver,S\u00e1b,Dom",day_long:"Domingo,Luns,Martes,M\u00e9rcores,Xoves,Venres,S\u00e1bado,Domingo",months_short:"Xan,Feb,Mar,Abr,Mai,Xu\u00f1,Xul,Ago,Set,Out,Nov,Dec",months_long:"Xaneito,Febreiro,Marzo,Abril,Maio,Xu\u00f1o,Xullo,Agosto,Setembro,Outubro,Novembro,Decembro",inserttime_desc:"Insertar hora",insertdate_desc:"Insertar data",time_fmt:"%H:%M:%S",date_fmt:"%d-%m-%Y"},print:{print_desc:"Imprimir"},preview:{preview_desc:"Vista previa"},directionality:{rtl_desc:"Direcci\u00f3n dereita a esquerda",ltr_desc:"Direcci\u00f3n esquerda a dereita"},layer:{content:"Nova capa...",absolute_desc:"Posici\u00f3n absoluta",backward_desc:"Recuar",forward_desc:"Avanzar",insertlayer_desc:"Insertar nova capa"},save:{save_desc:"Gardar",cancel_desc:"Cancelar todo-los cambios"},nonbreaking:{nonbreaking_desc:"Insertar espacio non colapsable"},iespell:{download:"Non se detectou \'ieSpell\'. \u00bfDesexa instala-lo agora?",iespell_desc:"Corrector ortogr\u00e1fico"},advhr:{advhr_desc:"Regra horizontal",delta_height:"",delta_width:""},emotions:{emotions_desc:"Emoticones",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Buscar/Reemplazar",search_desc:"Buscar",delta_width:"",delta_height:""},advimage:{image_desc:"Insertar/editar imaxe",delta_width:"",delta_height:""},advlink:{link_desc:"Insertar/editar hiperv\u00ednculo",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Insertar/Editar atributos",ins_desc:"Inserci\u00f3n",del_desc:"Borrado",acronym_desc:"Acr\u00f3nimo",abbr_desc:"Abreviatura",cite_desc:"Cita",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Editar Estilo CSS",delta_height:"",delta_width:""},paste:{selectall_desc:"Seleccionar todo",paste_word_desc:"Pegar desde Word",paste_text_desc:"Pegar como texto simple",plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode."},paste_dlg:{word_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00e1.",text_linebreaks:"Manter salto de li\u00f1as",text_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00e1."},table:{cell:"Celda",col:"Columna",row:"Fila",del:"Eliminar t\u00e1boa",copy_row_desc:"Copiar fila",cut_row_desc:"Cortar fila",paste_row_after_desc:"Pegar filas (desp\u00f3is)",paste_row_before_desc:"Pegar filas (antes)",props_desc:"Propiedades da t\u00e1boa",cell_desc:"Propiedades da celda",row_desc:"Propiedades da fila",merge_cells_desc:"Vincular celdas",split_cells_desc:"Dividir celdas",delete_col_desc:"Suprimir columna",col_after_desc:"Insertar columna (desp\u00f3is)",col_before_desc:"Insertar columna (antes)",delete_row_desc:"Suprimir fila",row_after_desc:"Insertar fila (desp\u00f3is)",row_before_desc:"Insertar fila (antes)",desc:"Inserta unha nova t\u00e1boa",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{unload_msg:"Os cambios realizados perderanse se sae desta p\u00e1xina.",warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\\n\\nAre you sure you want to restore the saved content?.",restore_content:"Restore auto-saved content."},fullscreen:{desc:"Cambiar a modo Pantalla Completa"},media:{edit:"Editar medio embebido",desc:"Insertar/editar medio embebido",delta_height:"",delta_width:""},fullpage:{desc:"Propiedades do documento",delta_width:"",delta_height:""},template:{desc:"Insertar contido de plantilla predefinida"},visualchars:{desc:"Caracteres de control ON/OFF."},spellchecker:{desc:"Conmutar corrector ortogr\u00e1fico",menu:"Configuraci\u00f3n de corrector ortogr\u00e1fico",ignore_word:"Ignorar verba",ignore_words:"Ignorar todo",langs:"Idiomas",wait:"Agarde...",sug:"Suxerencias",no_sug:"Sen suxerencias",no_mpell:"Non se atoparon erros."},pagebreak:{desc:"Insertar fin de p\u00e1xina"},advlist:{types:"Types",def:"Default",lower_alpha:"Lower alpha",lower_greek:"Lower greek",lower_roman:"Lower roman",upper_alpha:"Upper alpha",upper_roman:"Upper roman",circle:"Circle",disc:"Disc",square:"Square"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/he.js b/js/tiny_mce/langs/he.js new file mode 100755 index 000000000..b3d6a0cbe --- /dev/null +++ b/js/tiny_mce/langs/he.js @@ -0,0 +1 @@ +tinyMCE.addI18n({he:{common:{more_colors:"\u05e2\u05d5\u05d3 \u05e6\u05d1\u05e2\u05d9\u05dd",invalid_data:"\u05e9\u05d2\u05d9\u05d0\u05d4: \u05d4\u05d5\u05e7\u05dc\u05d3 \u05de\u05d9\u05d3\u05e2 \u05dc\u05d0 \u05ea\u05e7\u05e0\u05d9. \u05d4\u05de\u05d9\u05d3\u05e2 \u05e1\u05d5\u05de\u05df \u05d1\u05d0\u05d3\u05d5\u05dd.",popup_blocked:"\u05d7\u05d5\u05e1\u05dd \u05e4\u05e8\u05d9\u05d8\u05d9\u05dd \u05de\u05d5\u05e7\u05e4\u05e6\u05d9\u05dd \u05de\u05e0\u05e2 \u05de\u05d7\u05dc\u05d5\u05df \u05d7\u05e9\u05d5\u05d1 \u05de\u05dc\u05d4\u05e4\u05ea\u05d7,\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05db\u05dc\u05d9 \u05d6\u05d4 \u05e2\u05dc\u05d9\u05da \u05dc\u05d1\u05d8\u05dc \u05d0\u05ea \u05d7\u05d5\u05e1\u05dd \u05d4\u05e4\u05e8\u05d9\u05d8\u05d9\u05dd",clipboard_no_support:"\u05db\u05e8\u05d2\u05e2 \u05dc\u05d0 \u05e0\u05ea\u05de\u05da \u05e2\u05dc \u05d9\u05d3\u05d9 \u05d4\u05d3\u05e4\u05d3\u05e4\u05df \u05e9\u05dc\u05da. \u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e7\u05d9\u05e6\u05d5\u05e8\u05d9 \u05d4\u05de\u05e7\u05dc\u05d3\u05ea.",clipboard_msg:"\n \u05d4\u05e2\u05ea\u05e7\u05d4/\u05d2\u05d6\u05d9\u05e8\u05d4 \u05d5\u05d4\u05d3\u05d1\u05e7\u05d4 \u05d0\u05d9\u05e0\u05dd \u05d6\u05de\u05d9\u05e0\u05d9\u05dd \u05d1 Mozilla \u05d5\u05d1-Firefox.\n \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05e7\u05d1\u05dc \u05de\u05d9\u05d3\u05e2 \u05e0\u05d5\u05e1\u05e3 \u05e2\u05dc \u05d4\u05e0\u05d5\u05e9\u05d0?\n ",not_set:"-- \u05dc\u05d0 \u05d4\u05d5\u05d2\u05d3\u05e8 --",class_name:"\u05de\u05d7\u05dc\u05e7\u05d4",browse:"\u05e2\u05d9\u05d5\u05df",close:"\u05e1\u05d2\u05d9\u05e8\u05d4",cancel:"\u05d1\u05d9\u05d8\u05d5\u05dc",update:"\u05e2\u05d3\u05db\u05d5\u05df",insert:"\u05d4\u05d5\u05e1\u05e4\u05d4",apply:"\u05d0\u05d9\u05e9\u05d5\u05e8",edit_confirm:"\u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e2\u05d5\u05e8\u05da \u05d4\u05de\u05ea\u05e7\u05d3\u05dd?"},contextmenu:{full:"\u05e9\u05e0\u05d9 \u05d4\u05e6\u05d3\u05d3\u05d9\u05dd",right:"\u05d9\u05de\u05d9\u05df",center:"\u05d0\u05de\u05e6\u05e2",left:"\u05e9\u05de\u05d0\u05dc",align:"\u05d9\u05d9\u05e9\u05d5\u05e8"},insertdatetime:{day_short:"\u05d9\u05d5\u05dd \u05d0\',\u05d9\u05d5\u05dd \u05d1\',\u05d9\u05d5\u05dd \u05d2\',\u05d9\u05d5\u05dd \u05d3\',\u05d9\u05d5\u05dd \u05d4\',\u05d9\u05d5\u05dd \u05d5\',\u05e9\u05d1\u05ea,\u05d9\u05d5\u05dd \u05d0\'",day_long:"\u05d9\u05d5\u05dd \u05e8\u05d0\u05e9\u05d5\u05df,\u05d9\u05d5\u05dd \u05e9\u05e0\u05d9,\u05d9\u05d5\u05dd \u05e9\u05dc\u05d9\u05e9\u05d9,\u05d9\u05d5\u05dd \u05e8\u05d1\u05d9\u05e2\u05d9,\u05d9\u05d5\u05dd \u05d7\u05de\u05d9\u05e9\u05d9,\u05d9\u05d5\u05dd \u05e9\u05d9\u05e9,\u05d9\u05d5\u05dd \u05e9\u05d1\u05ea,\u05d9\u05d5\u05dd \u05e8\u05d0\u05e9\u05d5\u05df",months_short:"\u05d9\u05e0\u05d5\u05d0\u05e8,\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8,\u05de\u05e8\u05e5,\u05d0\u05e4\u05e8\u05d9\u05dc,\u05de\u05d0\u05d9,\u05d9\u05d5\u05e0\u05e2,\u05d9\u05d5\u05dc\u05d9,\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8,\u05e1\u05e4\u05d8\u05de\u05d1\u05e8,\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8,\u05e0\u05d5\u05d1\u05de\u05d1\u05e8,\u05d3\u05e6\u05de\u05d1\u05e8",months_long:"\u05d9\u05e0\u05d5\u05d0\u05e8,\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8,\u05de\u05e8\u05e5,\u05d0\u05e4\u05e8\u05d9\u05dc,\u05de\u05d0\u05d9,\u05d9\u05d5\u05e0\u05e2,\u05d9\u05d5\u05dc\u05d9,\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8,\u05e1\u05e4\u05d8\u05de\u05d1\u05e8,\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8,\u05e0\u05d5\u05d1\u05de\u05d1\u05e8,\u05d3\u05e6\u05de\u05d1\u05e8",inserttime_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05d6\u05de\u05df",insertdate_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05ea\u05d0\u05e8\u05d9\u05da",time_fmt:"%H:%M:%S",date_fmt:"%d-%m-%Y"},print:{print_desc:"\u05d4\u05d3\u05e4\u05e1\u05d4"},preview:{preview_desc:"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05d4"},directionality:{rtl_desc:"\u05db\u05d9\u05d5\u05d5\u05df \u05d8\u05e7\u05e1\u05d8 \u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc",ltr_desc:"\u05db\u05d9\u05d5\u05d5\u05df \u05d8\u05e7\u05e1\u05d8 \u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df"},layer:{content:"\u05e9\u05db\u05d1\u05d4 \u05d7\u05d3\u05e9\u05d4...",absolute_desc:"\u05d1\u05d7\u05d9\u05e8\u05ea \u05de\u05d9\u05e7\u05d5\u05dd \u05de\u05d5\u05d7\u05dc\u05d8",backward_desc:"\u05d4\u05e2\u05d1\u05e8\u05d4 \u05d0\u05d7\u05d5\u05e8\u05d4",forward_desc:"\u05d4\u05e2\u05d1\u05e8\u05d4 \u05e7\u05d3\u05d9\u05de\u05d4",insertlayer_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05db\u05d1\u05d4 \u05d7\u05d3\u05e9\u05d4"},save:{save_desc:"\u05e9\u05de\u05d9\u05e8\u05d4",cancel_desc:"\u05d1\u05d9\u05d8\u05d5\u05dc \u05db\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9\u05dd"},nonbreaking:{nonbreaking_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05e8\u05d5\u05d5\u05d7"},iespell:{download:" \u05dc\u05d0 \u05e0\u05de\u05e6\u05d0 ieSpell. \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05ea\u05e7\u05d9\u05df?",iespell_desc:"\u05d1\u05d3\u05d9\u05e7\u05ea \u05d0\u05d9\u05d5\u05ea \u05d1\u05d0\u05e0\u05d2\u05dc\u05d9\u05ea"},advhr:{advhr_desc:"\u05e7\u05d5 \u05d0\u05d5\u05e4\u05e7\u05d9",delta_height:"",delta_width:""},emotions:{emotions_desc:"\u05e1\u05de\u05d9\u05d9\u05dc\u05d9\u05dd",delta_height:"",delta_width:""},searchreplace:{replace_desc:"\u05d4\u05d7\u05dc\u05e4\u05d4",search_desc:"\u05d7\u05d9\u05e4\u05d5\u05e9",delta_width:"",delta_height:""},advimage:{image_desc:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4",delta_width:"",delta_height:""},advlink:{link_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"\u05d4\u05db\u05e0\u05e1/\u05e2\u05e8\u05d5\u05da \u05ea\u05db\u05d5\u05e0\u05d5\u05ea",ins_desc:"\u05d4\u05db\u05e0\u05e1\u05d4",del_desc:"\u05de\u05d7\u05d9\u05e7\u05d4",acronym_desc:"\u05e8\u05d0\u05e9\u05d9 \u05ea\u05d9\u05d1\u05d5\u05ea",abbr_desc:"\u05e7\u05d9\u05e6\u05d5\u05e8",cite_desc:"\u05e6\u05d9\u05d8\u05d5\u05d8",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"\u05e2\u05d3\u05db\u05d5\u05df \u05d4\u05d2\u05d3\u05e8\u05d5\u05ea CSS",delta_height:"",delta_width:""},paste:{plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",selectall_desc:"\u05d1\u05d7\u05e8 \u05d4\u05db\u05dc",paste_word_desc:"\u05d4\u05d3\u05d1\u05e7\u05d4 \u05de-WORD",paste_text_desc:"\u05d4\u05d3\u05d1\u05e7\u05d4 \u05db\u05d8\u05e7\u05e1\u05d8 \u05d1\u05dc\u05d1\u05d3"},paste_dlg:{word_title:"\u05d4\u05d3\u05d1\u05d9\u05e7\u05d5 \u05d1\u05d7\u05dc\u05d5\u05df \u05d6\u05d4 \u05d0\u05ea \u05d4\u05d8\u05e7\u05e1\u05d8 \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4\u05de\u05e7\u05e9\u05d9\u05dd CTRL+V.",text_linebreaks:"\u05d4\u05e9\u05d0\u05e8 \u05d0\u05ea \u05e9\u05d5\u05e8\u05d5\u05ea \u05d4\u05e8\u05d5\u05d5\u05d7",text_title:"\u05d4\u05d3\u05d1\u05d9\u05e7\u05d5 \u05d1\u05d7\u05dc\u05d5\u05df \u05d6\u05d4 \u05d0\u05ea \u05d4\u05d8\u05e7\u05e1\u05d8 \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4\u05de\u05e7\u05e9\u05d9\u05dd CTRL+V."},table:{cell:"\u05ea\u05d0",col:"\u05e2\u05de\u05d5\u05d3\u05d4",row:"\u05e9\u05d5\u05e8\u05d4",del:"\u05de\u05d7\u05d9\u05e7\u05ea \u05d8\u05d1\u05dc\u05d4",copy_row_desc:"\u05d4\u05e2\u05ea\u05e7\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4",cut_row_desc:"\u05d2\u05d6\u05d9\u05e8\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4",paste_row_after_desc:"\u05d4\u05d3\u05d1\u05e7\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4 \u05d0\u05d7\u05e8\u05d9",paste_row_before_desc:"\u05d4\u05d3\u05d1\u05e7\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4 \u05dc\u05e4\u05e0\u05d9",props_desc:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4",cell_desc:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05ea\u05d0 \u05d1\u05d8\u05d1\u05dc\u05d4",row_desc:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4",merge_cells_desc:"\u05d0\u05d9\u05d7\u05d5\u05d3 \u05ea\u05d0\u05d9\u05dd \u05d1\u05d8\u05d1\u05dc\u05d4",split_cells_desc:"\u05e4\u05d9\u05e6\u05d5\u05dc \u05ea\u05d0\u05d9\u05dd \u05d1\u05d8\u05d1\u05dc\u05d4",delete_col_desc:"\u05d4\u05e1\u05e8\u05ea \u05e2\u05de\u05d5\u05d3\u05d4",col_after_desc:"\u05d4\u05db\u05e0\u05e1\u05ea \u05e2\u05de\u05d5\u05d3\u05d4 \u05de\u05e9\u05de\u05d0\u05dc",col_before_desc:"\u05d4\u05db\u05e0\u05e1\u05ea \u05e2\u05de\u05d5\u05d3\u05d4 \u05de\u05d9\u05de\u05d9\u05df",delete_row_desc:"\u05de\u05d7\u05d9\u05e7\u05ea \u05e9\u05d5\u05e8\u05d4",row_after_desc:"\u05d4\u05db\u05e0\u05e1\u05ea \u05e9\u05d5\u05e8\u05d4 \u05de\u05ea\u05d7\u05ea",row_before_desc:"\u05d4\u05db\u05e0\u05e1\u05ea \u05e9\u05d5\u05e8\u05d4 \u05de\u05e2\u05dc",desc:"\u05d4\u05db\u05e0\u05e1\u05ea \u05d0\u05d5 \u05e2\u05e8\u05d9\u05db\u05ea \u05d8\u05d1\u05dc\u05d4",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"\u05d0\u05dd \u05ea\u05e9\u05d7\u05d6\u05e8 \u05d0\u05ea \u05d4\u05ea\u05d5\u05db\u05df \u05dc\u05d2\u05e8\u05d9\u05e1\u05d0 \u05d4\u05e9\u05de\u05d5\u05e8\u05d4, \u05ea\u05d0\u05d1\u05d3 \u05d0\u05ea \u05db\u05dc \u05d4\u05ea\u05d5\u05db\u05df \u05e9\u05e0\u05de\u05e6\u05d0 \u05db\u05e2\u05ea \u05d1\u05e2\u05d5\u05e8\u05da. \u05d4\u05d0\u05dd \u05d0\u05ea\u05d4 \u05d1\u05d8\u05d5\u05d7 \u05e9\u05d0\u05ea\u05d4 \u05e8\u05d5\u05e6\u05d4 \u05dc\u05e9\u05d7\u05d6\u05e8 \u05d0\u05ea \u05d4\u05ea\u05d5\u05db\u05df \u05dc\u05d2\u05d9\u05e8\u05e1\u05d0 \u05d4\u05e9\u05de\u05d5\u05e8\u05d4?.",restore_content:"\u05e9\u05d7\u05d6\u05d5\u05e8 \u05dc\u05d2\u05d9\u05e8\u05e1\u05d0 \u05e9\u05de\u05d5\u05e8\u05d4 \u05d0\u05d5\u05d8\u05d5\u05de\u05d8\u05d9\u05ea",unload_msg:"\u05d4\u05e9\u05d9\u05e0\u05d5\u05d9\u05d9\u05dd \u05e9\u05d1\u05d9\u05e6\u05e2\u05ea \u05dc\u05d0 \u05d9\u05e9\u05de\u05e8\u05d5 \u05d0\u05dd \u05ea\u05e2\u05d1\u05d5\u05e8 \u05de\u05d3\u05e3 \u05d6\u05d4"},fullscreen:{desc:"\u05de\u05e2\u05d1\u05e8 \u05dc\u05de\u05e1\u05da \u05de\u05dc\u05d0/\u05d7\u05dc\u05e7\u05d9"},media:{edit:"\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05e8\u05d8\u05d5\u05df",desc:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05e8\u05d8\u05d5\u05df",delta_height:"",delta_width:""},fullpage:{desc:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05e2\u05de\u05d5\u05d3",delta_width:"",delta_height:""},template:{desc:"Insert predefined template content"},visualchars:{desc:"\u05d4\u05e6\u05d2/\u05d4\u05e1\u05ea\u05e8 \u05ea\u05d5\u05d5\u05d9 \u05d1\u05e7\u05e8\u05d4"},spellchecker:{desc:"\u05d4\u05e4\u05e2\u05dc\u05ea \u05d1\u05d5\u05d3\u05e7 \u05d0\u05d9\u05d5\u05ea",menu:"\u05d4\u05d2\u05d3\u05e8\u05d5\u05ea \u05d1\u05d5\u05d3\u05e7 \u05d0\u05d9\u05d5\u05ea",ignore_word:"\u05dc\u05d4\u05ea\u05e2\u05dc\u05dd \u05de\u05d4\u05de\u05d9\u05dc\u05d4",ignore_words:"\u05dc\u05d4\u05ea\u05e2\u05dc\u05dd \u05de\u05d4\u05db\u05dc",langs:"\u05e9\u05e4\u05d5\u05ea",wait:"\u05e0\u05d0 \u05dc\u05d4\u05de\u05ea\u05d9\u05df..",sug:"\u05d4\u05e6\u05e2\u05d5\u05ea",no_sug:"\u05d0\u05d9\u05df \u05d4\u05e6\u05e2\u05d5\u05ea",no_mpell:"\u05dc\u05d0 \u05e0\u05de\u05e6\u05d0\u05d5 \u05e9\u05d2\u05d9\u05d0\u05d5\u05ea \u05d0\u05d9\u05d5\u05ea"},pagebreak:{desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05de\u05e2\u05d1\u05e8 \u05d3\u05e3"},advlist:{types:"\u05e1\u05d5\u05d2\u05d9\u05dd",def:"\u05d1\u05e8\u05d9\u05e8\u05ea \u05de\u05d7\u05d3\u05dc",lower_alpha:"Lower alpha",lower_greek:"Lower greek",lower_roman:"Lower roman",upper_alpha:"Upper alpha",upper_roman:"Upper roman",circle:"\u05e2\u05d2\u05d5\u05dc",disc:"\u05d3\u05d9\u05e1\u05e7",square:"\u05de\u05e8\u05d5\u05d1\u05e2"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/hu.js b/js/tiny_mce/langs/hu.js new file mode 100755 index 000000000..833a7953f --- /dev/null +++ b/js/tiny_mce/langs/hu.js @@ -0,0 +1 @@ +tinyMCE.addI18n({hu:{common:{"more_colors":"T\u00f6bb sz\u00edn","invalid_data":"Hiba: \u00c9rv\u00e9nytelen adatok, pirossal jel\u00f6lve.","popup_blocked":"A felugr\u00f3 ablakok tilt\u00e1sa miatt nem siker\u00fclt megjelen\u00edteni egy, az alkalmaz\u00e1shoz sz\u00fcks\u00e9ges ablakot. Enged\u00e9lyezze a b\u00f6ng\u00e9sz\u0151j\u00e9ben a felugr\u00f3 ablakokat, hogy minden funkci\u00f3t haszn\u00e1lhasson.","clipboard_no_support":"Jelenleg nem t\u00e1mogatja a b\u00f6ng\u00e9sz\u0151je, haszn\u00e1lja a billenty\u0171kombin\u00e1ci\u00f3kat helyette.","clipboard_msg":"A M\u00e1sol\u00e1s/Kiv\u00e1g\u00e1s/Besz\u00far\u00e1s funkci\u00f3k nem \u00e9rhet\u0151ek el Mozilla \u00e9s Firefox alatt.\\nK\u00edv\u00e1n t\u00f6bbet tudni err\u0151l a t\u00e9m\u00e1r\u00f3l?","not_set":"-- Nincs megadva --","class_name":"Oszt\u00e1ly",browse:"Tall\u00f3z\u00e1s",close:"Bez\u00e1r\u00e1s",cancel:"M\u00e9gsem",update:"Friss\u00edt\u00e9s",insert:"Besz\u00far\u00e1s",apply:"Alkalmaz\u00e1s","edit_confirm":"Haszn\u00e1lni k\u00edv\u00e1nja a sz\u00f6vegszerkeszt\u0151 m\u00f3dot ebben a sz\u00f6vegdobozban?"},contextmenu:{full:"Sorkiz\u00e1r\u00e1s",right:"Jobbra",center:"K\u00f6z\u00e9pre",left:"Balra",align:"Igaz\u00edt\u00e1s"},insertdatetime:{"day_short":"V,H,K,Sze,Cs,P,Szo,V","day_long":"vas\u00e1rnap,h\u00e9tf\u0151,kedd,szerda,cs\u00fct\u00f6rt\u00f6k,p\u00e9ntek,szombat,vas\u00e1rnap","months_short":"jan,feb,m\u00e1r,\u00e1pr,m\u00e1j,j\u00fan,j\u00fal,aug,szept,okt,nov,dec","months_long":"janu\u00e1r,febru\u00e1r,m\u00e1rcius,\u00e1prilis,m\u00e1jus,j\u00fanius,j\u00falius,augusztus,szeptember,okt\u00f3ber,november,december","inserttime_desc":"Id\u0151 besz\u00far\u00e1sa","insertdate_desc":"D\u00e1tum besz\u00far\u00e1sa","time_fmt":"%H:%M:%S","date_fmt":"%Y.%m.%d."},print:{"print_desc":"Nyomtat\u00e1s"},preview:{"preview_desc":"El\u0151n\u00e9zet"},directionality:{"rtl_desc":"Jobbr\u00f3l balra","ltr_desc":"Balr\u00f3l jobbra"},layer:{content:"\u00daj r\u00e9teg...","absolute_desc":"Abszol\u00fat poz\u00edci\u00f3 ki-/bekapcsol\u00e1sa","backward_desc":"Mozgat\u00e1s h\u00e1tra","forward_desc":"Mozgat\u00e1s el\u0151re","insertlayer_desc":"\u00daj r\u00e9teg besz\u00far\u00e1sa"},save:{"save_desc":"Ment\u00e9s","cancel_desc":"\u00d6sszes v\u00e1ltoz\u00e1s visszavon\u00e1sa"},nonbreaking:{"nonbreaking_desc":"Nemsort\u00f6r\u0151 sz\u00f3k\u00f6z besz\u00far\u00e1sa"},iespell:{download:"ieSpell nem tal\u00e1lhat\u00f3. Telep\u00edti most?","iespell_desc":"Helyes\u00edr\u00e1s-ellen\u0151rz\u00e9s futtat\u00e1sa"},advhr:{"advhr_desc":"V\u00edzszintes vonal","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Hangulatjelek","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Keres\u00e9s/Csere","search_desc":"Keres\u00e9s","delta_width":"","delta_height":""},advimage:{"image_desc":"K\u00e9p besz\u00far\u00e1sa/szerkeszt\u00e9se","delta_width":"","delta_height":""},advlink:{"link_desc":"Link besz\u00far\u00e1sa/szerkeszt\u00e9s","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Tulajdons\u00e1gok besz\u00far\u00e1sa/szerkeszt\u00e9se","ins_desc":"Besz\u00fart","del_desc":"T\u00f6r\u00f6lt","acronym_desc":"Bet\u0171sz\u00f3","abbr_desc":"R\u00f6vid\u00edt\u00e9s","cite_desc":"Id\u00e9zet","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"CSS st\u00edlus szerkeszt\u00e9se","delta_height":"","delta_width":""},paste:{"plaintext_mode":"A besz\u00far\u00e1s mostant\u00f3l egyszer\u0171 sz\u00f6veg m\u00f3dban van. Kattintson ide \u00fajra ezen m\u00f3d ki/be kapcsol\u00e1s\u00e1hoz.","plaintext_mode_sticky":"A besz\u00far\u00e1s mostant\u00f3l egyszer\u0171 sz\u00f6veg m\u00f3dban van. Kattintson ide \u00fajra ezen m\u00f3d ki/be kapcsol\u00e1s\u00e1hoz. Miut\u00e1n besz\u00far valamit, visszaker\u00fcl norm\u00e1l m\u00f3dba.","selectall_desc":"Mindent kijel\u00f6l","paste_word_desc":"Besz\u00far\u00e1s Wordb\u0151l","paste_text_desc":"Besz\u00far\u00e1s sz\u00f6vegk\u00e9nt"},"paste_dlg":{"word_title":"Haszn\u00e1lja a Ctrl+V-t a billenty\u0171zet\u00e9n a beilleszt\u00e9shez.","text_linebreaks":"Sort\u00f6r\u00e9sek megtart\u00e1sa","text_title":"Haszn\u00e1lja a Ctrl+V-t a billenty\u0171zet\u00e9n a beilleszt\u00e9shez."},table:{cell:"Cella",col:"Oszlop",row:"Sor",del:"T\u00e1bl\u00e1zat t\u00f6rl\u00e9se","copy_row_desc":"Sor m\u00e1sol\u00e1sa","cut_row_desc":"Sor kiv\u00e1g\u00e1sa","paste_row_after_desc":"Sor bem\u00e1sol\u00e1sa ut\u00e1na","paste_row_before_desc":"Sor bem\u00e1sol\u00e1sa el\u00e9","props_desc":"T\u00e1bl\u00e1zat tulajdons\u00e1gai","cell_desc":"Cella tulajdons\u00e1gai","row_desc":"Sor tulajdons\u00e1gai","merge_cells_desc":"Cell\u00e1k \u00f6sszevon\u00e1sa","split_cells_desc":"Cell\u00e1k feloszt\u00e1sa","delete_col_desc":"Oszlop t\u00f6rl\u00e9se","col_after_desc":"Oszlop besz\u00far\u00e1sa ut\u00e1na","col_before_desc":"Oszlop besz\u00far\u00e1sa el\u00e9","delete_row_desc":"Sor t\u00f6rl\u00e9se","row_after_desc":"Sor besz\u00far\u00e1sa ut\u00e1na","row_before_desc":"Sor besz\u00far\u00e1sa el\u00e9",desc:"T\u00e1bl\u00e1zat besz\u00far\u00e1sa/szerkeszt\u00e9se","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Ha visszat\u00f6lti a mentett be\u00e1ll\u00edt\u00e1sokat, a jelenlegi \u00e1llapot elv\u00e9sz.\\n\\nBiztosan visszat\u00f6lti a mentett \u00e1llapotot?.","restore_content":"Automatikus ment\u00e9s bet\u00f6lt\u00e9se.","unload_msg":"A m\u00f3dos\u00edt\u00e1sok nem lesznek mentve, ha elhagyja az oldalt."},fullscreen:{desc:"Teljesk\u00e9perny\u0151s m\u00f3d ki-/bekapcsol\u00e1sa"},media:{edit:"Be\u00e1gyazott m\u00e9dia szerkeszt\u00e9se",desc:"Be\u00e1gyazott m\u00e9dia besz\u00far\u00e1sa/szerkeszt\u00e9se","delta_height":"","delta_width":""},fullpage:{desc:"Dokumentum tulajdons\u00e1gai","delta_width":"","delta_height":""},template:{desc:"Sablon beilleszt\u00e9se"},visualchars:{desc:"Vizu\u00e1lis vez\u00e9rl\u0151karakterek be/ki."},spellchecker:{desc:"Helyes\u00edr\u00e1s-ellen\u0151rz\u0151 ki-/bekapcsol\u00e1sa",menu:"Helyes\u00edr\u00e1s-ellen\u0151rz\u0151 tulajdons\u00e1gai","ignore_word":"Sz\u00f3 kihagy\u00e1sa","ignore_words":"Mindet kihagy",langs:"Nyelvek",wait:"K\u00e9rem, v\u00e1rjon...",sug:"Aj\u00e1nl\u00e1sok","no_sug":"Nincs aj\u00e1nl\u00e1s","no_mpell":"Nem tal\u00e1ltam helyes\u00edr\u00e1si hib\u00e1t."},pagebreak:{desc:"Oldalt\u00f6r\u00e9s besz\u00far\u00e1sa."},advlist:{types:"T\u00edpusok",def:"Alap\u00e9rtelmezett","lower_alpha":"Kisbet\u0171s abc","lower_greek":"Kisbet\u0171s g\u00f6r\u00f6g","lower_roman":"Lisbet\u0171s r\u00f3mai","upper_alpha":"Nagybet\u0171s ABC","upper_roman":"Nagybet\u0171s r\u00f3mai",circle:"K\u00f6r",disc:"Lemez",square:"N\u00e9gyzet"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/id.js b/js/tiny_mce/langs/id.js new file mode 100755 index 000000000..e3a97dfe0 --- /dev/null +++ b/js/tiny_mce/langs/id.js @@ -0,0 +1 @@ +tinyMCE.addI18n({id:{common:{more_colors:"More colors",invalid_data:"Error: nilai invalid, ditandai dengan dengan warna merah",popup_blocked:"Maaf, popup-blocker anda telah menonaktifkan jendela aplikasi yang menyediakan fungsionalitas. Nonaktifkan popup-blocker untuk sepenuhnya memanfaatkan alat ini.",clipboard_no_support:"Tidak didukung Browser, gunakan shortcut dari keyboard.",clipboard_msg:"Copy/Cut/Paste tidak tersedia pada Mozilla dan Firefox.\\nButuh info selengkapnya?",not_set:"-- Not set --",class_name:"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply",edit_confirm:"Gunakan mode WYSIWYG untuk textarea ini?"},contextmenu:{full:"Penuh",right:"Kanan",center:"Tengah",left:"Kiri",align:"Alignment"},insertdatetime:{day_short:"Min,Sen,Sel,Rab,Kam,Jum,Sab,Min",day_long:"Minggu,Senin,Selasa,Rabu,Kamis,Jumat,Sabtu,Minggu",months_short:"Jan,Feb,Mar,Apr,Mei,Jun,Jul,Ags,Sep,Okt,Nov,Des",months_long:"Januari,Februari,Maren,April,Mei,Juni,Juli,Agustus,September,Oktober,November,Desember",inserttime_desc:"sisipkan waktu",insertdate_desc:"sisipkan tanggal",time_fmt:"%H:%M:%S",date_fmt:"%Y-%m-%d"},print:{print_desc:"Cetak"},preview:{preview_desc:"Preview"},directionality:{rtl_desc:"Arah kanan ke kiri",ltr_desc:"Arah kiri ke kanan"},layer:{content:"Layer baru...",absolute_desc:"Beralih posisi absolut",backward_desc:"Pindah ke belakang",forward_desc:"Pindah ke depan",insertlayer_desc:"sisipkan layer Baru"},save:{save_desc:"Simpan",cancel_desc:"Batalkan semua perubahan"},nonbreaking:{nonbreaking_desc:"sisipkan karakter non-breaking space"},iespell:{download:"ieSpell tidak terdeteksi. Instal sekarang?",iespell_desc:"Jalankan spell checking"},advhr:{advhr_desc:"Horizontal rule",delta_height:"",delta_width:""},emotions:{emotions_desc:"Emotions",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Cari/Ganti",search_desc:"Cari",delta_width:"",delta_height:""},advimage:{image_desc:"sisipkan/Ubah Gambar",delta_width:"",delta_height:""},advlink:{link_desc:"Sisipkan/Ubah link",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Sisip/Ubah Atribut",ins_desc:"Penyisipan",del_desc:"Penghapusan",acronym_desc:"Akronim",abbr_desc:"Singkatan/Kependekan Kata",cite_desc:"Kutipan",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Ubah CSS Style",delta_height:"",delta_width:""},paste:{selectall_desc:"Select All",paste_word_desc:"Paste from Word",paste_text_desc:"Paste as Plain Text",plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode."},paste_dlg:{word_title:"Gunakan CTRL+V pada keyboard untuk paste.",text_linebreaks:"Keep linebreaks",text_title:"Gunakan CTRL+V pada keyboard untuk paste."},table:{cell:"Cell",col:"Column",row:"Row",del:"Hapus Tabel",copy_row_desc:"Copy row tabel",cut_row_desc:"Cut row tabel",paste_row_after_desc:"Paste row tabel sesudah",paste_row_before_desc:"Paste row tabel sebelum",props_desc:"Properti tabel",cell_desc:"Properti cell tabel",row_desc:"Properti row tabel",merge_cells_desc:"Merge cell tabel",split_cells_desc:"Pisahkan cell tabel yang di-merge",delete_col_desc:"Hapus column",col_after_desc:"Sisipkan column setelah",col_before_desc:"Sisipkan column sebelum",delete_row_desc:"Hapus row",row_after_desc:"Sisipkan row sesudah",row_before_desc:"Sisipkan row sebelum",desc:"Sisipkan tabel baru",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{unload_msg:"Perubahan yang dilakukan akan hilang jika Anda pindah dari halaman ini.",warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\\n\\nAre you sure you want to restore the saved content?.",restore_content:"Restore auto-saved content."},fullscreen:{desc:"Toggle fullscreen mode"},media:{edit:"Edit embedded media",desc:"Insert / edit embedded media",delta_height:"",delta_width:""},fullpage:{desc:"Properti Dokumen",delta_width:"",delta_height:""},template:{desc:"Menyisipkan template standar isi"},visualchars:{desc:"Pengendalian visual karakter on/off"},spellchecker:{desc:"Toggle spellchecker",menu:"Pengaturan Spellchecker ",ignore_word:"Abaikan kata",ignore_words:"Abaikan semua",langs:"Bahasa",wait:"Harap tunggu...",sug:"Saran",no_sug:"Tidak ada saran",no_mpell:"Tidak ada misspellings ditemukan."},pagebreak:{desc:"Sisipkan page break."},advlist:{types:"Types",def:"Default",lower_alpha:"Lower alpha",lower_greek:"Lower greek",lower_roman:"Lower roman",upper_alpha:"Upper alpha",upper_roman:"Upper roman",circle:"Circle",disc:"Disc",square:"Square"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/it.js b/js/tiny_mce/langs/it.js new file mode 100755 index 000000000..17c2117f8 --- /dev/null +++ b/js/tiny_mce/langs/it.js @@ -0,0 +1 @@ +tinyMCE.addI18n({it:{common:{more_colors:"Colori aggiuntivi",invalid_data:"Errore: valori inseriti non validi, sono marcati in rosso.",popup_blocked:"Spiacente, ma il blocco popup ha disabilitato una finestra che fornisce funzionalit\u00e0 dell\'applicazione. Si deve disabilitare il blocco popup per questo sito per poter utlizzare appieno questo strumento.",clipboard_no_support:"Attualmente non supportato dal browser in uso, usare le scorciatoie da tastiera.",clipboard_msg:"Copia/Taglia/Incolla non \u00e8 disponibile in Mozilla e Firefox.\\nSi desidera avere maggiori informazioni su questo problema?",not_set:"-- Non impostato --",class_name:"Classe",browse:"Sfoglia",close:"Chiudi",cancel:"Annulla",update:"Aggiorna",insert:"Inserisci",apply:"Applica",edit_confirm:"Usare la modalit\u00e0 WYSIWYG per questa textarea?"},contextmenu:{full:"Giustifica",right:"Allinea a destra",center:"Centra",left:"Allinea a sinistra",align:"Allineamento"},insertdatetime:{day_short:"Dom,Lun,Mar,Mer,Gio,Ven,Sab,Dom",day_long:"Domenica,Luned\u00ec,Marted\u00ec,Mercoled\u00ec,Gioved\u00ec,Venerd\u00ec,Sabato,Domenica",months_short:"Gen,Feb,Mar,Apr,Mag,Giu,Lug,Ago,Set,Ott,Nov,Dic",months_long:"Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre",inserttime_desc:"Inserisci ora",insertdate_desc:"Inserisci data",time_fmt:"%H:%M:%S",date_fmt:"%Y-%m-%d"},print:{print_desc:"Stampa"},preview:{preview_desc:"Anteprima"},directionality:{rtl_desc:"Direzione da destra a sinistra",ltr_desc:"Direzione da sinistra a destra"},layer:{content:"Nuovo layer...",absolute_desc:"Attiva/Disattiva posizionamento assoluto",backward_desc:"Porta in sfondo",forward_desc:"Porta in rilievo",insertlayer_desc:"Inserisci nuovo layer"},save:{save_desc:"Salva",cancel_desc:"Cancella tutte le modifiche"},nonbreaking:{nonbreaking_desc:"Inserisci uno spazio"},iespell:{download:"ieSpell non rilevato. Installarlo ora?",iespell_desc:"Esegui controllo ortografico"},advhr:{advhr_desc:"Riga orizzontale",delta_height:"",delta_width:""},emotions:{emotions_desc:"Faccine",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Trova/Sostituisci",search_desc:"Trova",delta_width:"",delta_height:""},advimage:{image_desc:"Inserisci/modifica immagine",delta_width:"",delta_height:""},advlink:{link_desc:"Inserisci/modifica collegamento",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Inserisci/modifica attributi",ins_desc:"Inserimento",del_desc:"Cancellamento",acronym_desc:"Acronimo",abbr_desc:"Abbreviazione",cite_desc:"Citazione",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Modifica stile CSS",delta_height:"",delta_width:""},paste:{plaintext_mode:"Incolla adesso e in modalit\u00e0 testo. Clicca nuovamente per tornare alla modalit\u00e0 normale.",plaintext_mode_sticky:"Incolla adesso e in modalit\u00e0 testo. Clicca nuovamente per tornare alla modalit\u00e0 normale. Dopo che avrai incollato qualcosa tornerai alla modalit\u00e0 normale",selectall_desc:"Seleziona tutto",paste_word_desc:"Incolla da Word",paste_text_desc:"Incolla come testo semplice"},paste_dlg:{word_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra.",text_linebreaks:"Mantieni interruzioni di riga",text_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra."},table:{cell:"Cella",col:"Colonna",row:"Riga",del:"Elimina tabella",copy_row_desc:"Copia riga",cut_row_desc:"Taglia riga",paste_row_after_desc:"Incolla riga dopo",paste_row_before_desc:"Incolla riga prima",props_desc:"Propriet\u00e0 tabella",cell_desc:"Propriet\u00e0 cella",row_desc:"Propriet\u00e0 riga",merge_cells_desc:"Unisci celle",split_cells_desc:"Separa celle",delete_col_desc:"Elimina colonna",col_after_desc:"Inserisci colonna dopo",col_before_desc:"Inserisci colonna prima",delete_row_desc:"Elimina riga",row_after_desc:"Inserisci riga dopo",row_before_desc:"Inserisci riga prima",desc:"Inserisci una nuova tabella",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Se ripristini i dati salvati automaticamente perderai i dati attuali dell\'editor\\n\\nSei sicuro di voler ripristinare i dati?.",restore_content:"Ripristina i dati salvati automaticamente",unload_msg:"I cambiamenti effettuati saranno persi se si abbandona la pagina corrente."},fullscreen:{desc:"Attiva/disattiva modalit\u00e0 a tutto schermo"},media:{edit:"Modifica file multimediale",desc:"Inserisci/modifica file multimediale",delta_height:"",delta_width:""},fullpage:{desc:"Propriet\u00e0 Documento",delta_width:"",delta_height:""},template:{desc:"Inserisci contenuto da modello predefinito"},visualchars:{desc:"Attiva/disattiva caratteri di controllo visuale."},spellchecker:{desc:"Attiva/disattiva controllo ortografico",menu:"Impostazioni controllo ortografico",ignore_word:"Ignora parola",ignore_words:"Ignora tutto",langs:"Lingue",wait:"Attendere prego...",sug:"Suggerimenti",no_sug:"Nessun suggerimento",no_mpell:"Nessun errore rilevato."},pagebreak:{desc:"Inserisci intterruzione di pagina."},advlist:{types:"Tipi",def:"Default",lower_alpha:"Minuscolo alfanumerico",lower_greek:"Minuscolo lettera greca",lower_roman:"Minuscolo lettere romane",upper_alpha:"Maiuscolo alfanumerico",upper_roman:"Maiuscolo lettere romane",circle:"Cerchio",disc:"Punto",square:"Quadrato"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/lt.js b/js/tiny_mce/langs/lt.js new file mode 100755 index 000000000..6a28fdad8 --- /dev/null +++ b/js/tiny_mce/langs/lt.js @@ -0,0 +1 @@ +tinyMCE.addI18n({lt:{common:{more_colors:"Daugiau spalv\u0173",invalid_data:"Klaida: Blogai \u012fvestos reik\u0161m\u0117s, kurios pa\u017eym\u0117tos raudonai.",popup_blocked:"Atsipra\u0161ome, ta\u010diau pasteb\u0117jome, kad j\u016bs\u0173 i\u0161kylan\u010di\u0173 lang\u0173 blokavimo programa i\u0161jung\u0117 lang\u0105, kuris teikia aplikacijai funkcionalum\u0105. Tur\u0117tum\u0117te atjungti i\u0161kylan\u010di\u0173 lang\u0173 blokavim\u0105 \u0161iam tinklalapiui, kad i\u0161naudotum\u0117te visas galimybes.",clipboard_no_support:"\u0160i nar\u0161ykl\u0117 nepalaiko \u0161io veikimo, tod\u0117l naudokite klaviat\u016bros spar\u010diuosius klavi\u0161us.",clipboard_msg:"Kopijavimas/i\u0161kirpimas/\u012fd\u0117jimas paspaudus \u0161\u012f mygtuk\u0105 negalimas Mozilla ir Firefox nar\u0161ykl\u0117se.\\nNukopijuoti galima paspaudus: Ctrl + C, i\u0161kirpti: Ctrl + X, \u012fd\u0117ti: Ctrl + V.\\nAr norite daugiau informacijos apie \u0161i\u0105 problem\u0105?",not_set:"-- Nenurodyta --",class_name:"Klas\u0117",browse:"Nar\u0161yti",close:"U\u017everti",cancel:"Atsisakyti",update:"Atnaujinti",insert:"\u012eterpti",apply:"Taikyti",edit_confirm:"Ar norite naudoti tekst\u0173 redaktoriaus re\u017eim\u0105 \u0161iam teksto redagavimo langui?"},contextmenu:{full:"I\u0161 abiej\u0173 pusi\u0173",right:"De\u0161in\u0117je",center:"Centre",left:"Kair\u0117je",align:"Lygiavimas"},insertdatetime:{day_short:"Sekm,Pirm,Antr,Tre\u010d,Ketv,Penk,\u0160e\u0161t,Sekm",day_long:"Sekmadienis,Pirmadienis,Antradienis,Tre\u010diadienis,Ketvirtadienis,Penktadienis,\u0160e\u0161tadienis,Sekmadienis",months_short:"Sau,Vas,Kov,Bal,Geg,Bir,Lie,Rugpj,Rugs,Spa,Lapkr,Gruo",months_long:"Sausis,Vasaris,Kovas,Balandis,Gegu\u017e\u0117,Bir\u017eelis,Liepa,Rugpj\u016btis,Rugs\u0117jis,Spalis,Lapkritis,Gruodis",inserttime_desc:"\u012eterpti laik\u0105",insertdate_desc:"\u012eterpti dat\u0105",time_fmt:"%H:%M:%S",date_fmt:"%Y-%m-%d"},print:{print_desc:"Spausdinti"},preview:{preview_desc:"Per\u017ei\u016bra"},directionality:{rtl_desc:"Kryptis i\u0161 de\u0161in\u0117s \u012f kair\u0119",ltr_desc:"Kryptis i\u0161 kair\u0117s \u012f de\u0161in\u0119"},layer:{content:"Naujas sluoksnis...",absolute_desc:"Perjungti absoliut\u0173 pozicionavim\u0105",backward_desc:"Perkelti atgal",forward_desc:"Perkelti \u012f priek\u012f",insertlayer_desc:"\u012eterpti nauj\u0105 sluoksn\u012f"},save:{save_desc:"I\u0161saugoti",cancel_desc:"Atsisakyti vis\u0173 pakeitim\u0173"},nonbreaking:{nonbreaking_desc:"\u012eterpti jungiamojo tarpo simbol\u012f"},iespell:{download:"ieSpell neaptiktas. Ar norite dabar j\u012f \u012fdiegti?",iespell_desc:"Paleisti ra\u0161ybos tikrintuv\u0119"},advhr:{delta_width:"10",advhr_desc:"Horizontali linija",delta_height:""},emotions:{emotions_desc:"Jaustukai",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Ie\u0161koti/Pakeisti",delta_width:"10",delta_height:"20",search_desc:"Ie\u0161koti"},advimage:{delta_width:"10",image_desc:"\u012eterpti/Redaguoti paveiksl\u0117l\u012f",delta_height:""},advlink:{delta_width:"10",link_desc:"\u012eterpti/Redaguoti nuorod\u0105",delta_height:""},xhtmlxtras:{attribs_delta_width:"10",ins_delta_width:"10",del_delta_width:"10",acronym_delta_width:"10",abbr_delta_width:"10",cite_delta_width:"10",attribs_desc:"\u012eterpti/Redaguoti atributus",ins_desc:"\u012eterpimas",del_desc:"Panaikinimas",acronym_desc:"Akronimas",abbr_desc:"Santrumpa",cite_desc:"Citavimas",attribs_delta_height:"",ins_delta_height:"",del_delta_height:"",acronym_delta_height:"",abbr_delta_height:"",cite_delta_height:""},style:{delta_width:"40",desc:"Redaguoti CSS stili\u0173",delta_height:""},paste:{plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",selectall_desc:"Visk\u0105 pa\u017eym\u0117ti",paste_word_desc:"\u012ed\u0117ti i\u0161 Word",paste_text_desc:"\u012ed\u0117ti kaip paprast\u0105 tekst\u0105"},paste_dlg:{word_title:"Naudokite CTRL+V tekstui \u012fd\u0117ti \u012f \u0161\u012f lang\u0105.",text_linebreaks:"Palikti eilu\u010di\u0173 l\u016b\u017eius",text_title:"Naudokite CTRL+V tekstui \u012fd\u0117ti \u012f \u0161\u012f lang\u0105."},table:{merge_cells_delta_width:"10",table_delta_width:"10",cellprops_delta_width:"10",rowprops_delta_width:"10",cell:"Langelis",col:"Stulpelis",row:"Eilut\u0117",del:"\u0160alinti lentel\u0119",copy_row_desc:"Kopijuoti lentel\u0117s eilut\u0119",cut_row_desc:"I\u0161kirpti lentel\u0117s eilut\u0119",paste_row_after_desc:"\u012ed\u0117ti lentel\u0117s eilut\u0119 po",paste_row_before_desc:"\u012ed\u0117ti lentel\u0117s eilut\u0119 prie\u0161",props_desc:"Lentel\u0117s nustatymai",cell_desc:"Lentel\u0117s langelio nustatymai",row_desc:"Lentel\u0117s eilut\u0117s nustatymai",merge_cells_desc:"Sujungti lentel\u0117s langelius",split_cells_desc:"Skaidyti sulietus lentel\u0117s langelius",delete_col_desc:"\u0160alinti stulpel\u012f",col_after_desc:"\u012eterpti stulpel\u012f po",col_before_desc:"\u012eterpti stulpel\u012f prie\u0161",delete_row_desc:"\u0160alinti eilut\u0119",row_after_desc:"\u012eterpti eilut\u0119 po",row_before_desc:"\u012eterpti eilut\u0119 prie\u0161",desc:"\u012eterpti/Redaguoti lentel\u0119",merge_cells_delta_height:"",table_delta_height:"",cellprops_delta_height:"",rowprops_delta_height:""},autosave:{warning_message:"Jei atstatysite i\u0161saugot\u0105 turin\u012f, prarasite esam\u0105 turin\u012f redaktoriaus lange.\\n\\nAr tikrai norite atstatyti i\u0161saugot\u0105 turin\u012f?",restore_content:"Atstatyti automati\u0161kai i\u0161saugot\u0105 turin\u012f.",unload_msg:"Visi pakeitimai bus prarasti, jei i\u0161eisite i\u0161 \u0161io puslapio."},fullscreen:{desc:"Perjungti viso ekrano re\u017eim\u0105"},media:{delta_width:"10",edit:"Redaguoti integruot\u0105 daugialyp\u0119 terp\u0119",desc:"\u012eterpti/redaguoti integruot\u0105 daugialyp\u0119 terp\u0119",delta_height:""},fullpage:{desc:"Dokumento nustatymai",delta_width:"10",delta_height:""},template:{desc:"\u012eterpti numatyt\u0105 \u0161ablono turin\u012f"},visualchars:{desc:"Vizualiniai valdymo simboliai \u012fjungti/i\u0161jungti."},spellchecker:{desc:"Perjungti ra\u0161ybos tikrintuv\u0119",menu:"Ra\u0161ybos tikrintuv\u0117s nustatymai",ignore_word:"Ignoruoti \u017eod\u012f",ignore_words:"Ignoruoti visk\u0105",langs:"Kalbos",wait:"Pra\u0161ome palaukti...",sug:"Pasi\u016blymai",no_sug:"Pasi\u016blym\u0173 nerasta",no_mpell:"Klaid\u0173 nerasta."},pagebreak:{desc:"\u012eterpti puslapio pabaigos \u017eym\u0119."},advlist:{types:"Tipai",def:"Numatytasis",lower_alpha:"Ma\u017eosiomis raid\u0117mis",lower_greek:"Ma\u017eaisiais graik\u0173",lower_roman:"Ma\u017eaisiais rom\u0117n\u0173",upper_alpha:"Did\u017eiosiomis raid\u0117mis",upper_roman:"Did\u017eiaisiais rom\u0117n\u0173",circle:"Apskritimas",disc:"Diskas",square:"Kvadratas"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/lv.js b/js/tiny_mce/langs/lv.js new file mode 100755 index 000000000..2f6e3a976 --- /dev/null +++ b/js/tiny_mce/langs/lv.js @@ -0,0 +1 @@ +tinyMCE.addI18n({lv:{common:{more_colors:"Vair\u0101k kr\u0101su",invalid_data:"K\u013c\u016bda: Ievad\u012btas neder\u012bgas v\u0113rt\u012bbas. T\u0101s ir atz\u012bm\u0113tas sarkan\u0101 kr\u0101s\u0101.",popup_blocked:"Atvainojiet, bet m\u0113s esam konstat\u0113ju\u0161i, ka J\u016bsu uzleco\u0161o logu blo\u0137\u0113t\u0101js ir atsp\u0113jojis logu, kas nodro\u0161ina programmas funkcionalit\u0101ti. Lai piln\u012bb\u0101 izmantotu \u0161o r\u012bku, Jums ir j\u0101atsl\u0113dz uzleco\u0161o logu blo\u0137\u0113tajs \u0161ai vietnei. ",clipboard_no_support:"\u0160obr\u012bd J\u016bsu p\u0101rl\u016bks neatbalsta \u0161o iesp\u0113ju, t\u0101 viet\u0101 l\u016bdzu izmantotjiet tastat\u016bras sa\u012bsin\u0101jumtausti\u0146us.",clipboard_msg:"Iesp\u0113ja Kop\u0113t/Izgriezt/Iekop\u0113t nav pieejama p\u0101rl\u016bkiem Mozilla and Firefox.\\nVai J\u016bs v\u0113laties uzzin\u0101t vair\u0101k par \u0161o probl\u0113mu?",not_set:"-- Nav nor\u0101d\u012bts --",class_name:"Klase",browse:"P\u0101rl\u016bkot",close:"Aizv\u0113rt",cancel:"Atcelt",update:"Atjaunin\u0101t",insert:"Ievietot",apply:"Apstiprin\u0101t",edit_confirm:"Vai tu v\u0113lies izmantot WYSIWYG \u0161im teksta laukam?"},contextmenu:{full:"Pilns",right:"Pa labi",center:"Centr\u0113ts",left:"Pa kreisi",align:"Novietojums"},insertdatetime:{day_short:"Sv\u0113,Pir,Otr,Tre,Cet,Pie,Ses,Sv\u0113",day_long:"Sv\u0113tdiena,Pirmdiena,Otrdiena,Tre\u0161diena,Ceturtdiena,Piektdiena,Sestdiena,Sv\u0113tdiena",months_short:"Jan,Feb,Mar,Apr,Mai,J\u016bn,J\u016bl,Aug,Sep,Okt,Nov,Dec",months_long:"Janv\u0101ris,Febru\u0101ris,Marts,Apr\u012blis,Maijs,J\u016bnijs,J\u016blijs,Augusts,Seprembris,Oktobris,Novembris,Decembris",inserttime_desc:"Ievietot laiku",insertdate_desc:"Ievietot datumu",time_fmt:"%H:%M:%S",date_fmt:"%Y-%m-%d"},print:{print_desc:"Druk\u0101t"},preview:{preview_desc:"Priek\u0161skat\u012bt"},directionality:{rtl_desc:"Virziens no lab\u0101s uz kreiso",ltr_desc:"Virziens no kreis\u0101s uz labo"},layer:{content:"Jauns sl\u0101nis...",absolute_desc:"Iestat\u012bt/Nov\u0101kt absol\u016bto novietojumu ",backward_desc:"Atpaka\u013c",forward_desc:"Uz priek\u0161u",insertlayer_desc:"Ievietot jaunu sl\u0101ni"},save:{save_desc:"Saglab\u0101t",cancel_desc:"Atcelt visas izmai\u0146as"},nonbreaking:{nonbreaking_desc:"Ievietot tuk\u0161uma simbolu"},iespell:{download:"ieSpell netika atrasts. Vai J\u016bs v\u0113laties to uzst\u0101d\u012bt?",iespell_desc:"Uzs\u0101kt pareizrakst\u012bbas p\u0101rbaudi"},advhr:{advhr_desc:"Horizont\u0101la sv\u012btra",delta_height:"",delta_width:""},emotions:{emotions_desc:"Smaidi\u0146i",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Mekl\u0113t/Aizvietot",search_desc:"Mekl\u0113t",delta_width:"",delta_height:""},advimage:{image_desc:"Ievietot/Redi\u0123\u0113t att\u0113lu",delta_width:"",delta_height:""},advlink:{link_desc:"Ievietot/Redi\u0123\u0113t saiti",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Pielikt/redi\u0123\u0113t \u012bpa\u0161\u012bbas",ins_desc:"Insertion",del_desc:"Deletion",acronym_desc:"Acronym",abbr_desc:"Sa\u012bsin\u0101jums",cite_desc:"Cit\u0101ts",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Edit CSS Style",delta_height:"",delta_width:""},paste:{selectall_desc:"Iez\u012bm\u0113t visu",paste_word_desc:"Iekop\u0113t no Word",paste_text_desc:"Iekop\u0113t ka parasto tekstu",plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode.",plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode."},paste_dlg:{word_title:"Izmantojiet CTRL+V uz j\u016bsu tastat\u016bras lai iekop\u0113t tekstu log\u0101.",text_linebreaks:"Sagl\u0101b\u0101t l\u012bniju sadal\u012bt\u0101jus",text_title:"Izmantojiet CTRL+V uz j\u016bsu tastat\u016bras lai iekop\u0113t tekstu log\u0101."},table:{cell:"Aile",col:"St\u0101bs",row:"Rinda",del:"Izdz\u0113st tabulu",copy_row_desc:"Kop\u0113t tabulas rindu",cut_row_desc:"Izgriezt tabulas rindu",paste_row_after_desc:"Ielikt tabulas rindu aiz",paste_row_before_desc:"Ielikt tabulas rindu priek\u0161\u0101",props_desc:"Tabulas \u012bpa\u0161\u012bbas",cell_desc:"Tabulas ailes \u012bpa\u0161\u012bbas",row_desc:"Tabulas rindas \u012bpa\u0161\u012bbas",merge_cells_desc:"Apvienot tabulas ailes",split_cells_desc:"Sadal\u012bt apvienotas tabules ailes",delete_col_desc:"Izdz\u0113st stabu",col_after_desc:"Ielikt jaunu stabu aiz",col_before_desc:"Ielikt jaunu stabu priek\u0161\u0101",delete_row_desc:"Izdz\u0113st rindu",row_after_desc:"Ielikt jaunu rindu aiz",row_before_desc:"Ielikt jaunu rindu priek\u0161\u0101",desc:"Ielikt jaunu tabulu",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{unload_msg:"The changes you made will be lost if you navigate away from this page.",warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\\n\\nAre you sure you want to restore the saved content?.",restore_content:"Restore auto-saved content."},fullscreen:{desc:"Toggle fullscreen mode"},media:{edit:"Edit embedded media",desc:"Insert / edit embedded media",delta_height:"",delta_width:""},fullpage:{desc:"Document properties",delta_width:"",delta_height:""},template:{desc:"Insert predefined template content"},visualchars:{desc:"Visual control characters on/off."},spellchecker:{desc:"Toggle spellchecker",menu:"Spellchecker settings",ignore_word:"Ignore word",ignore_words:"Ignore all",langs:"Languages",wait:"Please wait...",sug:"Suggestions",no_sug:"No suggestions",no_mpell:"No misspellings found."},pagebreak:{desc:"Insert page break."},advlist:{types:"Types",def:"Default",lower_alpha:"Lower alpha",lower_greek:"Lower greek",lower_roman:"Lower roman",upper_alpha:"Upper alpha",upper_roman:"Upper roman",circle:"Circle",disc:"Disc",square:"Square"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/nl.js b/js/tiny_mce/langs/nl.js new file mode 100755 index 000000000..50af4b4a7 --- /dev/null +++ b/js/tiny_mce/langs/nl.js @@ -0,0 +1 @@ +tinyMCE.addI18n({nl:{common:{"more_colors":"Meer kleuren","invalid_data":"Fout: Er zijn ongeldige waardes ingevoerd, deze zijn rood gemarkeerd.","popup_blocked":"U zult uw popup-blocker tijdelijk moeten uitschakelen voor deze website om gebruik te kunnen maken van alle functies van deze teksteditor.","clipboard_no_support":"Kopi\u00ebren/knippen/plakken wordt niet ondersteund door uw browser, gebruik hiervoor de sneltoetsen.","clipboard_msg":"Kopi\u00ebren/knippen/plakken is niet beschikbaar in Mozilla en Firefox.\\nWilt u meer informatie over deze beperking?","not_set":"- Standaard -","class_name":"Klasse",browse:"Bladeren",close:"Sluiten",cancel:"Annuleren",update:"Bijwerken",insert:"Invoegen",apply:"Toepassen","edit_confirm":"Weet u zeker dat u tekst in WYSIWYG mode wilt bewerken in dit tekstveld?"},contextmenu:{full:"Uitvullen",right:"Rechts",center:"Centreren",left:"Links",align:"Uitlijning"},insertdatetime:{"day_short":"zo,ma,di,wo,do,vr,za,zo","day_long":"Zondag,Maandag,Dinsdag,Woensdag,Donderdag,Vrijdag,Zaterdag,Zondag","months_short":"Jan,Feb,Mar,Apr,Mei,Jun,Jul,Aug,Sep,Okt,Nov,Dec","months_long":"Januari,Februari,Maart,April,Mei,Juni,Juli,Augustus,September,Oktober,November,December","inserttime_desc":"Tijd invoegen","insertdate_desc":"Datum invoegen","time_fmt":"%H:%M:%S","date_fmt":"%d-%m-%Y"},print:{"print_desc":"Afdrukken"},preview:{"preview_desc":"Voorbeeld"},directionality:{"rtl_desc":"Van rechts naar links","ltr_desc":"Van links naar rechts"},layer:{content:"Nieuwe laag...","absolute_desc":"Absoluut positioneren inschakelen","backward_desc":"Vorige laag","forward_desc":"Volgende laag","insertlayer_desc":"Nieuwe laag invoegen"},save:{"save_desc":"Opslaan","cancel_desc":"Alle wijzigingen annuleren"},nonbreaking:{"nonbreaking_desc":"Open ruimte invoegen"},iespell:{download:"ieSpell niet gevonden. Wilt u deze nu installeren?","iespell_desc":"Spellingcontrole"},advhr:{"advhr_desc":"Scheidingslijn","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Emoties","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Zoeken/Vervangen","search_desc":"Zoeken","delta_width":"","delta_height":""},advimage:{"image_desc":"Afbeelding invoegen/bewerken","delta_width":"","delta_height":""},advlink:{"link_desc":"Link invoegen/bewerken","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Attributen invoegen/bewerken","ins_desc":"Ingevoegd","del_desc":"Verwijderd","acronym_desc":"Synoniem","abbr_desc":"Afkorting","cite_desc":"Citaat","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"CSS Stijl bewerken","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Plakken is nu in plattetekstmoduse. Klik nog een keer om terug te gaan naar normaal plakken.","plaintext_mode_sticky":"Plakken is nu in plattetekstmodus. Klik nog een keer om terug te gaan naar normaal plakken. Nadat u iets plakt, keert u terug naar normaal plakken.","selectall_desc":"Alles selecteren","paste_word_desc":"Vanuit Word plakken","paste_text_desc":"Als platte tekst plakken"},"paste_dlg":{"word_title":"Gebruik Ctrl+V om tekst in het venster te plakken.","text_linebreaks":"Regelafbreking bewaren","text_title":"Gebruik Ctrl+V om tekst in het venster te plakken."},table:{cell:"Cel",col:"Kolom",row:"Rij",del:"Tabel verwijderen","copy_row_desc":"Rij kopi\u00ebren","cut_row_desc":"Rij knippen","paste_row_after_desc":"Rij onder plakken","paste_row_before_desc":"Rij boven plakken","props_desc":"Tabeleigenschappen","cell_desc":"Cel-eigenschappen","row_desc":"Rij-eigenschappen","merge_cells_desc":"Cellen samenvoegen","split_cells_desc":"Cellen splitsen","delete_col_desc":"Kolom verwijderen","col_after_desc":"Kolom rechts invoegen","col_before_desc":"Kolom links invoegen","delete_row_desc":"Rij verwijderen","row_after_desc":"Rij onder invoegen","row_before_desc":"Rij boven invoegen",desc:"Nieuwe tabel invoegen","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Als u de opgeslagen inhoud laadt, verliest u de inhoud die zich momenteel in de editor bevindt.\\n\\nWeet u zeker dat u de opgeslagen inhoud wilt laden?","restore_content":"Automatisch opgeslagen inhoud laden.","unload_msg":"De wijzigingen zullen verloren gaan als u nu deze pagina verlaat."},fullscreen:{desc:"Volledig scherm"},media:{edit:"Media bewerken",desc:"Media invoegen/bewerken","delta_height":"","delta_width":""},fullpage:{desc:"Documenteigenschappen","delta_width":"","delta_height":""},template:{desc:"Voorgedefinieerd sjabloon invoegen"},visualchars:{desc:"Zichtbare symbolen"},spellchecker:{desc:"Spellingcontrole",menu:"Instellingen spellingcontrole","ignore_word":"Woord negeren","ignore_words":"Alles negeren",langs:"Talen",wait:"Een ogenblik geduld\u2026",sug:"Suggesties","no_sug":"Geen suggesties","no_mpell":"Geen spelfouten gevonden."},pagebreak:{desc:"Pagina-einde invoegen"},advlist:{types:"Types",def:"Standaard","lower_alpha":"Alfa (klein)","lower_greek":"Griekse letters (klein)","lower_roman":"Romeinse letters (klein)","upper_alpha":"Alfa (groot)","upper_roman":"Romeinse letters (groot)",circle:"Cirkel",disc:"Schijf",square:"Vierkant"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/no.js b/js/tiny_mce/langs/no.js new file mode 100755 index 000000000..43e63a702 --- /dev/null +++ b/js/tiny_mce/langs/no.js @@ -0,0 +1 @@ +tinyMCE.addI18n({no:{common:{"more_colors":"Flere farger","invalid_data":"Feil: Ugyldig verdi er skrevet inn, disse er merket med r\u00f8dt","popup_blocked":"Beklager, men vi har registrert at din popup-sperrer har blokkert et vindu i nettleseren. Du m\u00e5 oppheve popup-sperren for at nettstedet skal f\u00e5 tilgang til dette verkt\u00f8yet","clipboard_no_support":"For tiden ikke st\u00f8ttet av din nettleser, bruk tastatursnarveier i stedet.","clipboard_msg":"Klipp ut / Kopier /Lim inn fungerer ikke i Mozilla og Firefox. Vil du vite mer om dette?","not_set":"--Ikke satt--","class_name":"Klasse",browse:"Bla gjennom",close:"Lukk",cancel:"Avbryt",update:"Oppdater",insert:"Sett inn",apply:"Bruk","edit_confirm":"Vil du bruke WYSIWYG-editoren for dette tekstfeltet?"},contextmenu:{full:"Full",right:"H\u00f8yre",center:"Midtstilt",left:"Venstre",align:"Justering"},insertdatetime:{"day_short":"S\u00f8n,Man,Tir,Ons,Tor,Fre,L\u00f8r,S\u00f8n","day_long":"s\u00f8ndag,mandag,tirsdag,onsdag,torsdag,fredag,l\u00f8rdag,s\u00f8ndag","months_short":"jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des","months_long":"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember","inserttime_desc":"Sett inn tid","insertdate_desc":"Sett inn dato","time_fmt":"%H:%M:%S","date_fmt":"%d-%m-%Y"},print:{"print_desc":"Skriv ut"},preview:{"preview_desc":"Forh\u00e5ndsvisning"},directionality:{"rtl_desc":"Retning h\u00f8yre mot venstre","ltr_desc":"Retning venstre mot h\u00f8yre"},layer:{content:"Nytt lag ...","absolute_desc":"Sl\u00e5 p\u00e5/av absolutt plassering","backward_desc":"Flytt bakover","forward_desc":"Flytt fremover","insertlayer_desc":"Sett inn nytt lag"},save:{"save_desc":"Lagre","cancel_desc":"Kanseller alle endringer"},nonbreaking:{"nonbreaking_desc":"Sett inn karakter for hardt mellomrom"},iespell:{download:"ieSpell ikke funnet. \u00d8nsker du \u00e5 installere ieSpell?","iespell_desc":"Stavekontroll"},advhr:{"advhr_desc":"Horisontal linje","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Hum\u00f8rfjes","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"S\u00f8k/Erstatt","search_desc":"S\u00f8k","delta_width":"","delta_height":""},advimage:{"image_desc":"Sett inn/editer bilde","delta_width":"","delta_height":""},advlink:{"link_desc":"Sett inn/editer lenke","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Sett inn/Editer egenskaper","ins_desc":"Innsetting","del_desc":"Sletting","acronym_desc":"Akronym","abbr_desc":"Forkortelse","cite_desc":"Sitat","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"Rediger CSS-stil","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Lim inn er n\u00e5 i vanlig tekst modus. Klikk igjen for \u00e5 bytte til vanlig innlimings modus.","plaintext_mode_sticky":"Lim inn er n\u00e5 i vanlig tekst modus. Klikk igjen for \u00e5 bytte til vanlig innlimings modus. Etter at du limer inn noe vil du g\u00e5 tilbake til ordin\u00e6r innliming.","selectall_desc":"Merk alt","paste_word_desc":"Lim inn fra Word","paste_text_desc":"Lim inn som ren tekst"},"paste_dlg":{"word_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn teksten i dette vinduet.","text_linebreaks":"Behold tekstbryting","text_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn teksten i dette vinduet."},table:{cell:"Celle",col:"Kolonne",row:"Rad",del:"Slett tabell","copy_row_desc":"Kopier rad","cut_row_desc":"Slett rad","paste_row_after_desc":"Lime inn rad etter","paste_row_before_desc":"Lime inn rad foran","props_desc":"Tabell egenskaper","cell_desc":"Celle egenskaper","row_desc":"Rad egenskaper","merge_cells_desc":"Sl\u00e5 sammen celler","split_cells_desc":"Splitte sammensl\u00e5tte celler","delete_col_desc":"Slett kolonne","col_after_desc":"Sett inn kolonne etter","col_before_desc":"Sett inn kolonne forand","delete_row_desc":"Slett rad","row_after_desc":"Sett inn rad etter","row_before_desc":"Sett inn rad foran",desc:"Setter inn ny tabell","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Hvis du gjenoppretter tidligere lagret innhold s\u00e5 vil du miste alt n\u00e5v\u00e6rende innhold i editoren.\\n\\nEr du sikker du vil gjenopprette tidligere lagret innhold?.","restore_content":"Gjenopprette autolagret innhold.","unload_msg":"Utf\u00f8rte endringer g\u00e5r tapt hvis du navigerer vekk fra denne siden!"},fullscreen:{desc:"Sl\u00e5 fullskjermmodus av/p\u00e5"},media:{edit:"Editer innebygget objekt",desc:"Sett inn/editer innebygget objekt","delta_height":"","delta_width":""},fullpage:{desc:"Dokument egenskaper","delta_width":"","delta_height":""},template:{desc:"Sett inn forh\u00e5ndsdefinert malinnhold"},visualchars:{desc:"Visuelle konktrolltegn p\u00e5/av"},spellchecker:{desc:"Stavekontroll p\u00e5/av",menu:"Oppsett stavekontroll","ignore_word":"Ignorer ord","ignore_words":"Ignorer alt",langs:"Spr\u00e5k",wait:"Vennligst vent ...",sug:"Forslag","no_sug":"Ingen forslag","no_mpell":"Ingen stavefeil funnet."},pagebreak:{desc:"Sett inn sideskift"},advlist:{types:"Types",def:"Standard","lower_alpha":"Sm\u00e5 alfanumerisk","lower_greek":"Sm\u00e5 gresk","lower_roman":"Sm\u00e5 roman","upper_alpha":"Store alfanumerisk","upper_roman":"Store roman",circle:"Sirkel",disc:"Plate",square:"Firkant"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/pl.js b/js/tiny_mce/langs/pl.js new file mode 100755 index 000000000..7b3672e19 --- /dev/null +++ b/js/tiny_mce/langs/pl.js @@ -0,0 +1 @@ +tinyMCE.addI18n({pl:{common:{"more_colors":"Wi\u0119cej kolor\u00f3w","invalid_data":"B\u0142\u0105d: Zosta\u0142y wprowadzone b\u0142\u0119dne dane, s\u0105 zaznaczone na czerwono.","popup_blocked":"Zauwa\u017cyli\u015bmy, \u017ce opcja blokowania wyskakuj\u0105cych okienek wy\u0142\u0105czy\u0142a okno, kt\u00f3re dostarcza funkcjonalno\u015b\u0107 aplikacji. Aby w pe\u0142ni wykorzysta\u0107 to narz\u0119dzie musisz wy\u0142\u0105czy\u0107 blokowanie wyskakuj\u0105cych okienek na tej stronie.","clipboard_no_support":"Aktualnie nie jest obs\u0142ugiwany przez Twoj\u0105 przegl\u0105dark\u0119, u\u017cyj skr\u00f3t\u00f3w klawiaturowych w zamian.","clipboard_msg":"Akcje Kopiuj/Wytnij/Wklej nie s\u0105 dost\u0119pne w Mozilli i Firefox.\\nCzy chcesz wi\u0119cej informacji o tym problemie?","not_set":"-- Brak --","class_name":"Klasa",browse:"Przegl\u0105daj",close:"Zamknij",cancel:"Anuluj",update:"Aktualizuj",insert:"Wstaw",apply:"Zastosuj","edit_confirm":"Czy chcesz u\u017cy\u0107 trybu WYSIWYG dla tego pola formularza?"},contextmenu:{full:"Wyjustuj",right:"Do prawej",center:"Do \u015brodka",left:"Do lewej",align:"Wyr\u00f3wnanie"},insertdatetime:{"day_short":"N,Pn,Wt,\u015ar,Cz,Pt,So,N","day_long":"Niedziela, Poniedzia\u0142ek, Wtorek, \u015aroda, Czwartek, Pi\u0105tek, Sobota, Niedziela","months_short":"Sty,Lut,Mar,Kwi,Maj,Cze,Lip,Sie,Wrz,Pa\u017a,Lis,Gru","months_long":"Stycze\u0144, Luty, Marzec, Kwiecie\u0144, Maj, Czerwiec, Lipiec, Sierpie\u0144, Wrzesie\u0144, Pa\u017adziernik, Listopad, Grudzie\u0144","inserttime_desc":"Wstaw czas","insertdate_desc":"Wstaw dat\u0119","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Drukuj"},preview:{"preview_desc":"Podgl\u0105d"},directionality:{"rtl_desc":"Kierunek od prawej do lewej","ltr_desc":"Kierunek od lewej do prawej"},layer:{content:"Nowa warstwa...","absolute_desc":"Prze\u0142\u0105cz pozycjonowanie absolutne","backward_desc":"Przesu\u0144 pod sp\u00f3d","forward_desc":"Przesu\u0144 na wierzch","insertlayer_desc":"Wstaw now\u0105 warstw\u0119"},save:{"save_desc":"Zachowaj","cancel_desc":"Anuluj wszystkie zmiany"},nonbreaking:{"nonbreaking_desc":"Wstaw tward\u0105 spacj\u0119"},iespell:{download:"ieSpell nie wykryte. Czy przeprowadzi\u0107 instalacj\u0119 tego komponentu?","iespell_desc":"Sprawd\u017a pisowni\u0119"},advhr:{"advhr_desc":"Pozioma linia","delta_height":"","delta_width":""},emotions:{"emotions_desc":"Emotikony","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"Znajd\u017a/zamie\u0144","search_desc":"Znajd\u017a","delta_width":"","delta_height":""},advimage:{"image_desc":"Wstaw/edytuj obraz","delta_width":"","delta_height":""},advlink:{"link_desc":"Wstaw/edytuj link","delta_height":"","delta_width":""},xhtmlxtras:{"attribs_desc":"Wstaw / Edytuj atrybuty","ins_desc":"Wstawienie","del_desc":"Usuni\u0119cie","acronym_desc":"Akronim","abbr_desc":"Skr\u00f3t","cite_desc":"Cytat","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"Edytuj Style CSS","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Wklejanie jest teraz dost\u0119pne w trybie tekstowym. Kliknij ponownie, aby prze\u0142\u0105czy\u0107 si\u0119 z powrotem do trybu wklejania sformatowanego tekstu.","plaintext_mode_sticky":"Wklejanie jest teraz dost\u0119pne w trybie tekstowym. Kliknij ponownie, aby prze\u0142\u0105czy\u0107 si\u0119 z powrotem do trybu wklejania sformatowanego tekstu. Po wklejeniu tekstu nast\u0105pi powr\u00f3t do trybu wklejania sformatowanego tekstu.","selectall_desc":"Zaznacz wszystko","paste_word_desc":"Wklej z Worda","paste_text_desc":"Wklej jako zwyk\u0142y tekst"},"paste_dlg":{"word_title":"U\u017cyj CTRL+V na swojej klawiaturze \u017ceby wklei\u0107 tekst do okna.","text_linebreaks":"Zachowaj ko\u0144ce linii.","text_title":"U\u017cyj CTRL+V na swojej klawiaturze \u017ceby wklei\u0107 tekst do okna."},table:{cell:"Kom\u00f3rka",col:"Kolumna",row:"Wiersz",del:"Usu\u0144 tabel\u0119","copy_row_desc":"Kopiuj wiersz...","cut_row_desc":"Wytnij wiersz...","paste_row_after_desc":"Wklej wiersz po...","paste_row_before_desc":"Wklej wiersz przed...","props_desc":"W\u0142a\u015bciwo\u015bci tabeli","cell_desc":"W\u0142a\u015bciwo\u015bci kom\u00f3rki","row_desc":"W\u0142a\u015bciwo\u015bci wiersza","merge_cells_desc":"Po\u0142\u0105cz kom\u00f3rki","split_cells_desc":"Podziel po\u0142\u0105czone kom\u00f3rki","delete_col_desc":"Usu\u0144 kolumn\u0119","col_after_desc":"Wstaw kolumn\u0119 po...","col_before_desc":"Wstaw kolumn\u0119 przed...","delete_row_desc":"Usu\u0144 wiersz","row_after_desc":"Wstaw nowy wiersz po...","row_before_desc":"Wstaw nowy wiersz przed...",desc:"Wstaw now\u0105 tabel\u0119","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"Je\u015bli przywr\u00f3cisz zapisan\u0105 tre\u015b\u0107, stracisz ca\u0142\u0105 tre\u015b\u0107, kt\u00f3ra teraz si\u0119 znajduje w edytorze.\\n\\nJeste\u015b pewien, \u017ce chcesz przywr\u00f3ci\u0107 zapisan\u0105 tre\u015b\u0107?","restore_content":"Przywr\u00f3\u0107 tre\u015b\u0107 zapisan\u0105 automatycznie.","unload_msg":"Zmiany, kt\u00f3rych dokona\u0142e\u015b zostan\u0105 utracone je\u015bli opu\u015bcisz t\u0119 stron\u0119."},fullscreen:{desc:"Prze\u0142\u0105cz tryb pe\u0142noekranowy"},media:{"delta_height":"",edit:"Edytuj wbudowane media",desc:"Wstaw/edytuj wbudowane media","delta_width":""},fullpage:{desc:"W\u0142a\u015bciwo\u015bci dokumentu","delta_width":"","delta_height":""},template:{desc:"Wstaw tre\u015b\u0107 szablonu"},visualchars:{desc:"W\u0142\u0105cz/wy\u0142\u0105cz znaki kontrolne."},spellchecker:{desc:"Sprawdzanie pisowni",menu:"Ustawienia sprawdzania pisowni","ignore_word":"Ignoruj s\u0142owo","ignore_words":"Ignoruj wszystkie",langs:"J\u0119zyki",wait:"Prosz\u0119 czeka\u0107...",sug:"Sugestie","no_sug":"Brak sugestii","no_mpell":"Nie znaleziono b\u0142\u0119d\u00f3w."},pagebreak:{desc:"Wstaw znak nowej strony."},advlist:{types:"Rodzaje",def:"Domy\u015blny","lower_alpha":"Ma\u0142e alfabetu","lower_greek":"Ma\u0142e greckie","lower_roman":"Ma\u0142e rzymskie","upper_alpha":"Du\u017ce alfabetu","upper_roman":"Du\u017ce rzymskie",circle:"Ko\u0142o",disc:"Elipsa",square:"Kwadrat"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/pt.js b/js/tiny_mce/langs/pt.js new file mode 100755 index 000000000..a260d0ed1 --- /dev/null +++ b/js/tiny_mce/langs/pt.js @@ -0,0 +1 @@ +tinyMCE.addI18n({pt:{common:{more_colors:"Mais Cores",invalid_data:"Erro: Valores inv\u00e1lidos marcados em vermelho.",popup_blocked:"Detectamos que o seu bloqueador de popups bloqueou uma janela que \u00e9 essencial para a aplica\u00e7\u00e3o. Voc\u00ea precisa desativar o bloqueador de janelas de popups para utilizar esta ferramenta.",clipboard_no_support:"O seu browser n\u00e3o suporta esta fun\u00e7\u00e3o, use os atalhos do teclado.",clipboard_msg:"Copiar/recortar/colar n\u00e3o est\u00e1 dispon\u00edvel no Mozilla e Firefox.\\nDeseja mais informa\u00e7\u00f5es sobre este problema?",not_set:"-- N/A --",class_name:"Classe",browse:"Procurar",close:"Fechar",cancel:"Cancelar",update:"Atualizar",insert:"Inserir",apply:"Aplicar",edit_confirm:"Deseja usar o modo de edi\u00e7\u00e3o avan\u00e7ado neste campo de texto?"},contextmenu:{full:"Justificado",right:"Direita",center:"Centro",left:"Esquerda",align:"Alinhamento"},insertdatetime:{day_short:"Dom,Seg,Ter,Qua,Qui,Sex,Sab,Dom",day_long:"Domingo,Segunda-feira,Ter\u00e7a-feira,Quarta-feira,Quinta-feira,Sexta-feira,S\u00e1bado,Domingo",months_short:"Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",months_long:"Janeiro,Fevereiro,Mar\u00e7o,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro",inserttime_desc:"Inserir hora",insertdate_desc:"Inserir data",time_fmt:"%H:%M:%S",date_fmt:"%d-%m-%Y"},print:{print_desc:"Imprimir"},preview:{preview_desc:"Pr\u00e9-visualizar"},directionality:{rtl_desc:"Da direita para esquerda",ltr_desc:"Da esquerda para direita"},layer:{content:"Nova camada...",absolute_desc:"Alternar o posicionamento absoluto",backward_desc:"Mover para tr\u00e1s",forward_desc:"Mover para frente",insertlayer_desc:"Inserir nova camada"},save:{save_desc:"Salvar",cancel_desc:"Cancelar todas as altera\u00e7\u00f5es"},nonbreaking:{nonbreaking_desc:"Inserir um espa\u00e7o \"sem quebra\""},iespell:{download:"Plugin de ortografia n\u00e3o-detectado. Deseja instalar agora?",iespell_desc:"Verificar ortografia"},advhr:{advhr_desc:"Separador horizontal",delta_height:"",delta_width:""},emotions:{emotions_desc:"Emoticons",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Localizar/substituir",search_desc:"Localizar",delta_width:"",delta_height:""},advimage:{image_desc:"Inserir/editar imagem",delta_width:"",delta_height:""},advlink:{link_desc:"Inserir/editar hyperlink",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Inserir/Editar atributos",ins_desc:"Inserir",del_desc:"Apagar",acronym_desc:"Acr\u00f4nimo",abbr_desc:"Abrevia\u00e7\u00e3o",cite_desc:"Cita\u00e7\u00e3o",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Editar CSS",delta_height:"",delta_width:""},paste:{plaintext_mode:"Comando colar est\u00e1 em modo texto simples. Clique novamente para voltar para o modo normal.",plaintext_mode_sticky:"Comando colar est\u00e1 em modo texto simples. Clique novamente para voltar para o modo normal. Depois de colar alguma coisa retornar\u00e1 para o modo normal.",selectall_desc:"Selecionar tudo",paste_word_desc:"Colar (copiado do WORD)",paste_text_desc:"Colar como texto simples"},paste_dlg:{word_title:"Use CTRL+V para colar o texto na janela.",text_linebreaks:"Manter quebras de linha",text_title:"Use CTRL+V para colar o texto na janela."},table:{cell:"C\u00e9lula",col:"Coluna",row:"Linha",del:"Apagar tabela",copy_row_desc:"Copiar linha",cut_row_desc:"Recortar linha",paste_row_after_desc:"Colar linha depois",paste_row_before_desc:"Colar linha antes",props_desc:"Propriedades da tabela",cell_desc:"Propriedades das c\u00e9lulas",row_desc:"Propriedades das linhas",merge_cells_desc:"Unir c\u00e9lulas",split_cells_desc:"Dividir c\u00e9lulas",delete_col_desc:"Remover coluna",col_after_desc:"Inserir coluna depois",col_before_desc:"Inserir coluna antes",delete_row_desc:"Apagar linha",row_after_desc:"Inserir linha depois",row_before_desc:"Inserir linha antes",desc:"Inserir nova tabela",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Se restaurar o conte\u00fado, voc\u00ea ir\u00e1 perder tudo que est\u00e1 atualmente no editor.\\n\\nTem certeza que quer restaurar o conte\u00fado salvo?",restore_content:"Restaura conte\u00fado salvo automaticamente.",unload_msg:"As mudan\u00e7as efetuadas ser\u00e3o perdidas se sair desta p\u00e1gina."},fullscreen:{desc:"Tela Inteira"},media:{edit:"Editar m\u00eddia incorporada",desc:"Inserir/Editar m\u00eddia incorporada",delta_height:"",delta_width:""},fullpage:{desc:"Propriedades do Documento",delta_width:"",delta_height:""},template:{desc:"Inserir template"},visualchars:{desc:"Caracteres de controle visual ligado/desligado"},spellchecker:{desc:"Alternar verifica\u00e7\u00e3o ortogr\u00e1fica",menu:"Configura\u00e7\u00f5es de ortografia",ignore_word:"Ignorar palavra",ignore_words:"Ignorar tudo",langs:"Linguagens",wait:"Aguarde...",sug:"Sugest\u00f5es",no_sug:"Sem sugest\u00f5es",no_mpell:"N\u00e3o foram detectados erros de ortografia."},pagebreak:{desc:"Inserir quebra de p\u00e1gina."},advlist:{types:"Tipos",def:"Padr\u00e3o",lower_alpha:"Alfabeto min\u00fasculo",lower_greek:"Alfabeto grego",lower_roman:"Num. romanos min\u00fasculos",upper_alpha:"Alfabeto mai\u00fasculos",upper_roman:"Num. romanos mai\u00fasculos",circle:"C\u00edrculo",disc:"Disco",square:"Quadrado"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/ro.js b/js/tiny_mce/langs/ro.js new file mode 100755 index 000000000..8f83a149f --- /dev/null +++ b/js/tiny_mce/langs/ro.js @@ -0,0 +1 @@ +tinyMCE.addI18n({ro:{common:{more_colors:"Mai multe culori",invalid_data:"Ave\u0163i erori. Datele gre\u015fite sunt \u00een ro\u015fu.",popup_blocked:"Ne pare r\u0103u, dar un popup-blocker a dezativat o fereastr\u0103 care d\u0103 func\u0163ionalitate aplica\u0163iei.Trebuie s\u0103 dezactiva\u0163i acel popup-blocker pentru acest site pentru a folosi aplica\u0163ia la capacitate maxim\u0103.",clipboard_no_support:"Deocamdat\u0103 nu este suportat\u0103 de browser. V\u0103 rug\u0103m s\u0103 folosi\u0163i combina\u0163ii de taste.",clipboard_msg:"Copiere/T\u0103iere/Lipire nu sunt disponibile \u00een Mozilla \u015fi Firefox.\\nDori\u0163i mai multe informa\u0163ii despre aceast\u0103 problem\u0103?",not_set:"-- Nestat\u0103 --",class_name:"Clas\u0103",browse:"R\u0103sfoie\u015fte",close:"\u00cenchide",cancel:"Anulare",update:"Actualizeaz\u0103",insert:"Insereaz\u0103",apply:"Aplic\u0103",edit_confirm:"Dori\u0163i s\u0103 folosi\u0163i un editor avansat pentru aceast\u0103 zon\u0103 de text?"},contextmenu:{full:"Justify",right:"Dreapta",center:"Centru",left:"St\u00e2nga",align:"Aliniere"},insertdatetime:{day_short:"Dum,Lun,Mar,Mie,Joi,Vin,S\u00e2m,Dum",day_long:"Duminic\u0103,Luni,Mar\u0163i,Miercuri,Joi,Vineri,S\u00e2mb\u0103t\u0103,Duminic\u0103",months_short:"Ian,Feb,Mar,Apr,Mai,Iun,Iul,Aug,Sep,Oct,Noi,Dec",months_long:"Ianuarie,Februarie,Martie,Aprilie,Mai,Iunie,Iulie,August,Septembrie,Octombrie,Noiembrie,Decembrie ",inserttime_desc:"Insereaz\u0103 or\u0103",insertdate_desc:"Insereaz\u0103 dat\u0103",time_fmt:"%H:%M:%S",date_fmt:"%Y-%m-%d"},print:{print_desc:"Imprimare"},preview:{preview_desc:"Previzualizare"},directionality:{rtl_desc:"Direc\u0163ia de la dreapta la st\u00e2nga",ltr_desc:"Direc\u0163ia de la st\u00e2nga la dreapta"},layer:{content:"Strat nou ...",absolute_desc:"Pozi\u0163ionare absolut\u0103",backward_desc:"Mut\u0103 \u00eenapoi",forward_desc:"Mut\u0103 \u00eenainte",insertlayer_desc:"Insereaz\u0103 stat nou"},save:{save_desc:"Salveaz\u0103",cancel_desc:"Anuleaz\u0103 toate schimb\u0103rile"},nonbreaking:{nonbreaking_desc:"Insereaz\u0103 caracterul spa\u0163iu"},iespell:{download:"ieSpell nu a fost detectat. Dori\u0163i s\u0103-l instala\u0163i?",iespell_desc:"Ruleaz\u0103 corectorul de limb\u0103"},advhr:{advhr_desc:"Linie orizontal\u0103",delta_height:"",delta_width:""},emotions:{emotions_desc:"Figurine",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Caut\u0103/\u00cenlocuie\u015fte",search_desc:"Caut\u0103",delta_width:"",delta_height:""},advimage:{image_desc:"Inserare/editare imagine",delta_width:"",delta_height:""},advlink:{link_desc:"Inserare/editare leg\u0103tur\u0103",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Insereaz\u0103/editeaz\u0103 atribute",ins_desc:"Inserare",del_desc:"\u015etergere",acronym_desc:"Acronim",abbr_desc:"Abreviere",cite_desc:"Citat",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"Editare CSS",delta_height:"",delta_width:""},paste:{plaintext_mode:"Lipirea este acum \u00een modul text simplu. Ap\u0103sa\u0163i din nou pentru comutarea la modul normal de lipire.",plaintext_mode_sticky:"Lipirea este acum \u00een modul text simplu. Ap\u0103sa\u0163i aici pentru comutarea la modul normal de lipire. Dup\u0103 ce ve\u0163i lipi ceva ve\u0163i reveni la modul normal de lipire.",selectall_desc:"Selecteaz\u0103 tot",paste_word_desc:"Lipire din Word",paste_text_desc:"Lipire ca text simplu"},paste_dlg:{word_title:"Folosi\u0163i CTRL+V pentru a lipi \u00een aceast\u0103 zon\u0103.",text_linebreaks:"P\u0103streaz\u0103 separatoarele de linii.",text_title:"Folosi\u0163i CTRL+V pentru a lipi \u00een aceast\u0103 zon\u0103."},table:{cell:"Celul\u0103",col:"Coloan\u0103",row:"R\u00e2nd",del:"\u015eterge tabel",copy_row_desc:"Copiaz\u0103 r\u00e2nd",cut_row_desc:"Taie r\u00e2nd",paste_row_after_desc:"Lipe\u015fte r\u00e2nd dup\u0103",paste_row_before_desc:"Lipe\u015fte r\u00e2nd \u00eenainte",props_desc:"Propriet\u0103\u0163i tabel",cell_desc:"Propriet\u0103\u0163i celul\u0103",row_desc:"Propriet\u0103\u0163i r\u00e2nd",merge_cells_desc:"Uni\u0163i celule",split_cells_desc:"Separa\u0163i celule unite",delete_col_desc:"\u015eterge coloan\u0103",col_after_desc:"Inserare coloan\u0103 dup\u0103",col_before_desc:"Inserare coloan\u0103 \u00eenainte",delete_row_desc:"\u015eterge r\u00e2nd",row_after_desc:"Inserare r\u00e2nd dup\u0103",row_before_desc:"Inserare r\u00e2nd \u00eenainte",desc:"Insereaz\u0103 tabel nou",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Daca restaurati continutul salvat vei pierde tot continutul existent din editor.\\n\\nSigur doriti sa restaurati continutul salvat?.",restore_content:"Restaureaz\u0103 con\u0163inutul salvat automat.",unload_msg:"Modific\u0103rile nu vor fi salvate."},fullscreen:{desc:"Mod ecran complet"},media:{edit:"Editeaz\u0103 media",desc:"Insereaz\u0103 / editeaz\u0103 media",delta_height:"",delta_width:""},fullpage:{desc:"Propriet\u0103\u0163i document",delta_width:"",delta_height:""},template:{desc:"Insereaz\u0103 un \u015fablon predefinit"},visualchars:{desc:"Comut\u0103 caracterele vizuale de control"},spellchecker:{desc:"Activare/dezactivare dic\u0163ionar",menu:"Set\u0103ri dic\u0163ionar",ignore_word:"Ignor\u0103 cuv\u00e2nt",ignore_words:"Ignor\u0103 toate",langs:"Limbi",wait:"V\u0103 rog a\u015ftepta\u0163i...",sug:"Sugestii",no_sug:"Nu sunt sugestii.",no_mpell:"Nu sunt gre\u015feli."},pagebreak:{desc:"Insereaz\u0103 un separator de pagin\u0103"},advlist:{types:"Tipuri",def:"Implicit",lower_alpha:"Minuscule alfabetice",lower_greek:"Minuscule grece\u015fti",lower_roman:"Minuscule romane",upper_alpha:"Majuscule alfabetice",upper_roman:"Majuscule romane",circle:"Cerc",disc:"Disc",square:"P\u0103trat"}}}); \ No newline at end of file diff --git a/js/tiny_mce/langs/ru.js b/js/tiny_mce/langs/ru.js new file mode 100755 index 000000000..ca333d7c3 --- /dev/null +++ b/js/tiny_mce/langs/ru.js @@ -0,0 +1 @@ +tinyMCE.addI18n({ru:{common:{"more_colors":"\u0414\u0440\u0443\u0433\u0438\u0435 \u0446\u0432\u0435\u0442\u0430...","invalid_data":"\u041e\u0448\u0438\u0431\u043a\u0430: \u0412\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c.","popup_blocked":"\u0411\u043b\u043e\u043a\u0438\u0440\u0430\u0442\u043e\u0440 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u043a\u043e\u043d \u0437\u0430\u043a\u0440\u044b\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043e\u043a\u043d\u043e. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u043c \u0441\u0430\u0439\u0442\u0435.","clipboard_no_support":"\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0412\u0430\u0448\u0438\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438.","clipboard_msg":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0440\u0435\u0437\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Firefox.\\r\\n\u0425\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e?","not_set":"- \u041d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e -","class_name":"\u041a\u043b\u0430\u0441\u0441",browse:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",cancel:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c",update:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c",insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",apply:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c","edit_confirm":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c WYSIWYG \u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f?"},contextmenu:{full:"\u041f\u043e \u0448\u0438\u0440\u0438\u043d\u0435",right:"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",center:"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443",left:"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align:"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435"},insertdatetime:{"day_short":"\u0432\u0441,\u043f\u043d,\u0432\u0442,\u0441\u0440,\u0447\u0442,\u043f\u0442,\u0441\u0431,\u0432\u0441","day_long":"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0432\u0442\u043e\u0440\u043d\u0438\u043a,\u0441\u0440\u0435\u0434\u0430,\u0447\u0435\u0442\u0432\u0435\u0440\u0433,\u043f\u044f\u0442\u043d\u0438\u0446\u0430,\u0441\u0443\u0431\u0431\u043e\u0442\u0430,\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","months_short":"\u044f\u043d\u0432,\u0444\u0435\u0432,\u043c\u0430\u0440\u0442,\u0430\u043f\u0440,\u043c\u0430\u0439,\u0438\u044e\u043d\u044c,\u0438\u044e\u043b\u044c,\u0430\u0432\u0433,\u0441\u0435\u043d,\u043e\u043a\u0442,\u043d\u043e\u044f,\u0434\u0435\u043a","months_long":"\u044f\u043d\u0432\u0430\u0440\u044c,\u0444\u0435\u0432\u0440\u0430\u043b\u044c,\u043c\u0430\u0440\u0442,\u0430\u043f\u0440\u0435\u043b\u044c,\u043c\u0430\u0439,\u0438\u044e\u043d\u044c,\u0438\u044e\u043b\u044c,\u0430\u0432\u0433\u0443\u0441\u0442,\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c,\u043e\u043a\u0442\u044f\u0431\u0440\u044c,\u043d\u043e\u044f\u0431\u0440\u044c,\u0434\u0435\u043a\u0430\u0431\u0440\u044c","inserttime_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f","insertdate_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u0442\u0443","time_fmt":"%H:%M:%S","date_fmt":"%d.%m.%Y"},print:{"print_desc":"\u041f\u0435\u0447\u0430\u0442\u044c"},preview:{"preview_desc":"\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440"},directionality:{"rtl_desc":"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e","ltr_desc":"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e"},layer:{content:"\u041d\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0439","absolute_desc":"\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435","backward_desc":"\u041d\u0430 \u0437\u0430\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u043d","forward_desc":"\u041d\u0430 \u043f\u0435\u0440\u0435\u0434\u043d\u0438\u0439 \u043f\u043b\u0430\u043d","insertlayer_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0439"},save:{"save_desc":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c","cancel_desc":"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f"},nonbreaking:{"nonbreaking_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0440\u0430\u0437\u0440\u044b\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u043b"},iespell:{download:"ieSpell \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d. \u0416\u0435\u043b\u0430\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c?","iespell_desc":"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044e"},advhr:{"advhr_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c","delta_height":"","delta_width":""},emotions:{"emotions_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043c\u0430\u0439\u043b","delta_height":"","delta_width":""},searchreplace:{"replace_desc":"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c","search_desc":"\u041d\u0430\u0439\u0442\u0438","delta_width":"","delta_height":""},advimage:{"delta_width":"200","image_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","delta_height":""},advlink:{"delta_width":"200","link_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443","delta_height":""},xhtmlxtras:{"attribs_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442","ins_desc":"\u0417\u0430\u043c\u0435\u043d\u0430","del_desc":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435","acronym_desc":"\u0410\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0446\u0438\u044f","abbr_desc":"\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435","cite_desc":"\u0426\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435","attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":""},style:{desc:"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c CSS \u0441\u0442\u0438\u043b\u044c","delta_height":"","delta_width":""},paste:{"plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode_sticky":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"\u0412\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435","paste_word_desc":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 Word","paste_text_desc":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442"},"paste_dlg":{"word_title":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043e\u043a\u043d\u043e.","text_linebreaks":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a","text_title":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043e\u043a\u043d\u043e."},table:{"cellprops_delta_width":"30",cell:"\u042f\u0447\u0435\u0439\u043a\u0430",col:"\u0421\u0442\u043e\u043b\u0431\u0435\u0446",row:"\u0421\u0442\u0440\u043e\u043a\u0430",del:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443","copy_row_desc":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443","cut_row_desc":"\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443","paste_row_after_desc":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u043d\u0438\u0437\u0443","paste_row_before_desc":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u0432\u0435\u0440\u0445\u0443","props_desc":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b","cell_desc":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044f\u0447\u0435\u0439\u043a\u0438","row_desc":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0442\u0440\u043e\u043a\u0438","merge_cells_desc":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438","split_cells_desc":"\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0443","delete_col_desc":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446","col_after_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043f\u0440\u0430\u0432\u0430","col_before_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043b\u0435\u0432\u0430","delete_row_desc":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443","row_after_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u043d\u0438\u0437\u0443","row_before_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u0432\u0435\u0440\u0445\u0443",desc:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435/\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b","merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","rowprops_delta_height":"","rowprops_delta_width":""},autosave:{"warning_message":"\u0412\u0441\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d\u044b.\\n\\n\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f?","restore_content":"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435","unload_msg":"\u041f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d\u044b, \u0435\u0441\u043b\u0438 \u0412\u044b \u0443\u0439\u0434\u0435\u0442\u0435 \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b."},fullscreen:{desc:"\u041f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c"},media:{edit:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0438\u043f\u0430",desc:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043b\u0438\u043f","delta_height":"","delta_width":""},fullpage:{desc:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430","delta_width":"","delta_height":""},template:{desc:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d"},visualchars:{desc:"\u0412\u0441\u0435 \u0437\u043d\u0430\u043a\u0438"},spellchecker:{desc:"\u041f\u0440\u0430\u0432\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",menu:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0430\u0432\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f","ignore_word":"\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c","ignore_words":"\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435",langs:"\u042f\u0437\u044b\u043a\u0438",wait:"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435...",sug:"\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b","no_sug":"\u041d\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432","no_mpell":"\u041e\u0448\u0438\u0431\u043e\u043a \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e."},pagebreak:{desc:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b"},advlist:{types:"\u0421\u0438\u043c\u0432\u043e\u043b\u044b",def:"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435","lower_alpha":"\u0421\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b","lower_greek":"\u0421\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0433\u0440\u0435\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b","lower_roman":"\u0421\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0440\u0438\u043c\u0441\u043a\u0438\u0435 \u0446\u0438\u0444\u0440\u044b","upper_alpha":"\u0417\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b","upper_roman":"\u0417\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0440\u0438\u043c\u0441\u043a\u0438\u0435 \u0446\u0438\u0444\u0440\u044b",circle:"\u041a\u0440\u0443\u0433\u0438",disc:"\u041e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438",square:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u044b"}}}); \ No newline at end of file diff --git a/js/tiny_mce/license.txt b/js/tiny_mce/license.txt new file mode 100644 index 000000000..60d6d4c8f --- /dev/null +++ b/js/tiny_mce/license.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + 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 Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +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 other code 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. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + 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, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) 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. + + d) 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. + + e) 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 materials to be 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 with +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 Lesser 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 + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/js/tiny_mce/plugins/advimage/css/advimage.css b/js/tiny_mce/plugins/advimage/css/advimage.css new file mode 100644 index 000000000..0a6251a69 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/css/advimage.css @@ -0,0 +1,13 @@ +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; 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;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/js/tiny_mce/plugins/advimage/editor_plugin.js b/js/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100644 index 000000000..4c7a9c3a8 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/editor_plugin_src.js b/js/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100644 index 000000000..2625dd213 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedImagePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceAdvImage', function() { + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + file : url + '/image.htm', + width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), + height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('image', { + title : 'advimage.image_desc', + cmd : 'mceAdvImage' + }); + }, + + getInfo : function() { + return { + longname : 'Advanced image', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/image.htm b/js/tiny_mce/plugins/advimage/image.htm new file mode 100644 index 000000000..ed16b3d4a --- /dev/null +++ b/js/tiny_mce/plugins/advimage/image.htm @@ -0,0 +1,235 @@ + + + + {#advimage_dlg.dialog_title} + + + + + + + + + + +
        + + +
        +
        +
        + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + + +
        + +
        + {#advimage_dlg.preview} + +
        +
        + +
        +
        + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + {#advimage_dlg.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. +
        +
        + + x + + px +
          + + + + +
        +
        +
        +
        + +
        +
        + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
        + + + + +
         
        + + + + +
         
        +
        + +
        + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + +
        + + + + +
         
        +
        +
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/advimage/img/sample.gif b/js/tiny_mce/plugins/advimage/img/sample.gif new file mode 100644 index 000000000..53bf6890b Binary files /dev/null and b/js/tiny_mce/plugins/advimage/img/sample.gif differ diff --git a/js/tiny_mce/plugins/advimage/js/image.js b/js/tiny_mce/plugins/advimage/js/image.js new file mode 100644 index 000000000..d1bca6446 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/js/image.js @@ -0,0 +1,445 @@ +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', 'tinyMCEImageList'); + this.fillFileList('over_list', 'tinyMCEImageList'); + this.fillFileList('out_list', 'tinyMCEImageList'); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value.replace(/ /g, '%20'), + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = '0 none none'; + else + img.style.border = v + 'px solid black'; + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/js/tiny_mce/plugins/advimage/langs/ar_dlg.js b/js/tiny_mce/plugins/advimage/langs/ar_dlg.js new file mode 100755 index 000000000..e9d89e5fc --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.advimage_dlg',{image_list:"Image list",align_right:"\u064a\u0645\u064a\u0646",align_left:"\u064a\u0633\u0627\u0631",align_textbottom:"\u0627\u0633\u0641\u0644 \u0627\u0644\u0646\u0635",align_texttop:"\u0627\u0639\u0644\u0649 \u0627\u0644\u0646\u0635",align_bottom:"\u0627\u0633\u0641\u0644",align_middle:"Middle",align_top:"\u0627\u0644\u0627\u0639\u0644\u0649",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"\u0645\u0634\u0627\u0647\u062f\u0647",title:"\u0627\u0644\u0639\u0646\u0648\u0627\u0646",general:"\u0639\u0627\u0645",tab_advanced:"\u062e\u064a\u0627\u0631\u0627\u062a \u0645\u062a\u0642\u062f\u0645\u0647",tab_appearance:"\u0627\u0644\u0645\u0638\u0647\u0631",tab_general:"\u0639\u0627\u0645"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/az_dlg.js b/js/tiny_mce/plugins/advimage/langs/az_dlg.js new file mode 100755 index 000000000..44491ae2b --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.advimage_dlg',{image_list:"\u015e\u0259kil siyah\u0131s\u0131",align_right:"Sa\u011fa",align_left:"Sola",align_textbottom:"M\u0259tn a\u015fa\u011f\u0131s\u0131 il\u0259",align_texttop:"M\u0259tn yuxar\u0131 il\u0259",align_bottom:"A\u015fa\u011f\u0131 il\u0259",align_middle:"M\u0259rk\u0259z il\u0259",align_top:"Yuxar\u0131 il\u0259",align_baseline:"Bin\u00f6vr\u0259 il\u0259",align:"Tarazla\u015fd\u0131rma",hspace:"\u00dcf\u00fcqi f\u0259za",vspace:"\u015eaquli f\u0259za",dimensions:"\u00d6l\u00e7\u00fcl\u0259r",border:"S\u0259rh\u0259d",list:"\u015e\u0259kil siyah\u0131s\u0131",alt:"\u015e\u0259kil t\u0259sviri",src:"\u015e\u0259kil \u00fcnvan\u0131",dialog_title:"\u015e\u0259kil \u0259lav\u0259/redakt\u0259 et",missing_alt:"\u018fminsiniz ki, \u015f\u0259kl\u0259 t\u0259svir yazmadan davam etm\u0259k ist\u0259yirsiniz? T\u0259svirsiz \u015f\u0259kil i\u015f qabiliyy\u0259ti a\u015fa\u011f\u0131 olan v\u0259 ya \u015f\u0259klin s\u00f6nd\u00fcr\u00fclm\u00fc\u015f funksiyas\u0131 il\u0259 m\u0259tn b\u0259l\u0259d\u00e7isind\u0259n istifad\u0259 ed\u0259n istifad\u0259\u00e7il\u0259r\u0259 \u0259l\u00e7atmaz ola bil\u0259r.",example_img:"Xarici g\u00f6r\u00fcn\u00fc\u015f\u0259 ilkin bax\u0131\u015f",misc:"M\u00fcxt\u0259lif",mouseout:"si\u00e7an\u0131 uzaqla\u015fd\u0131rd\u0131qda",mouseover:"si\u00e7an\u0131 g\u0259tirdikd\u0259",alt_image:"Alternativ \u015f\u0259kil",swap_image:"\u015e\u0259kli d\u0259yi\u015f",map:"X\u0259rit\u0259-\u015f\u0259kil",id:"\u0130dentifikator",rtl:"Sa\u011fda-sola",ltr:"Solda-sa\u011fa",classes:"Sinifl\u0259r",style:"Stil",long_desc:"\u018ftrafl\u0131 t\u0259svir\u0259 ke\u00e7id",langcode:"Dil kodu",langdir:"Dilin istiqam\u0259tl\u0259ndirilm\u0259si",constrain_proportions:"Proporsiyalar\u0131 saxla",preview:"\u0130lkin bax\u0131\u015f",title:"Ad\u0131",general:"\u00dcmumi",tab_advanced:"\u018flav\u0259",tab_appearance:"G\u00f6r\u00fcn\u00fc\u015f",tab_general:"\u00dcmumi"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/be_dlg.js b/js/tiny_mce/plugins/advimage/langs/be_dlg.js new file mode 100755 index 000000000..e06998ef0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.advimage_dlg',{image_list:"\u0421\u043f\u0456\u0441 \u043c\u0430\u043b\u044e\u043d\u043a\u0430\u045e",align_right:"\u041d\u0430\u043f\u0440\u0430\u0432\u0430",align_left:"\u041d\u0430\u043b\u0435\u0432\u0430",align_textbottom:"\u041f\u0430 \u043d\u0456\u0437\u0435 \u0442\u044d\u043a\u0441\u0442\u0443",align_texttop:"\u041f\u0430 \u0432\u0435\u0440\u0441\u0435 \u0442\u044d\u043a\u0441\u0442\u0443",align_bottom:"\u041f\u0430 \u043d\u0456\u0437\u0435",align_middle:"\u041f\u0430 \u0446\u044d\u043d\u0442\u0440\u044b",align_top:"\u041f\u0430 \u0432\u0435\u0440\u0441\u0435",align_baseline:"\u041f\u0430 \u043f\u0430\u0434\u0441\u0442\u0430\u0432\u0435",align:"\u0412\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435",hspace:"\u0413\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u0441\u0442\u043e\u0440\u0430",vspace:"\u0412\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u0441\u0442\u043e\u0440\u0430",dimensions:"\u041f\u0430\u043c\u0435\u0440\u044b",border:"\u041c\u044f\u0436\u0430",list:"\u0421\u043f\u0456\u0441 \u043c\u0430\u043b\u044e\u043d\u043a\u0430\u045e",alt:"\u0410\u043f\u0456\u0441\u0430\u043d\u043d\u0435 \u043c\u0430\u043b\u044e\u043d\u043a\u0430",src:"\u0410\u0434\u0440\u0430\u0441 \u043c\u0430\u043b\u044e\u043d\u043a\u0430",dialog_title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044c/\u0440\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044c \u043c\u0430\u043b\u044e\u043d\u0430\u043a",missing_alt:"\u0412\u044b \u045e\u043f\u044d\u045e\u043d\u0435\u043d\u044b\u044f, \u0448\u0442\u043e \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u043f\u0440\u0430\u0446\u044f\u0433\u043d\u0443\u0446\u044c \u0431\u0435\u0437 \u0430\u043f\u0456\u0441\u0430\u043d\u043d\u044f \u043c\u0430\u043b\u044e\u043d\u043a\u0430? \u0411\u0435\u0437 \u044f\u0433\u043e \u043c\u0430\u043b\u044e\u043d\u0430\u043a \u043c\u043e\u0436\u0430 \u0431\u044b\u0446\u044c \u043d\u0435\u0434\u0430\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u0430\u0440\u044b\u0441\u0442\u0430\u0447\u0430\u043c \u0437 \u0430\u0431\u043c\u0435\u0436\u0430\u0432\u0430\u043d\u0430\u0439 \u043f\u0440\u0430\u0446\u0430\u0437\u0434\u043e\u043b\u044c\u043d\u0430\u0441\u0446\u044e, \u0430\u0431\u043e \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u043e\u045e\u0432\u0430\u043b\u044b\u043c \u0442\u044d\u043a\u0441\u0442\u0430\u0432\u044b \u0431\u0440\u0430\u045e\u0437\u044d\u0440, \u0430\u0431\u043e \u044f\u043a\u0456\u044f \u0433\u043b\u044f\u0434\u0437\u044f\u0446\u044c \u0441\u0442\u0430\u0440\u043e\u043d\u043a\u0456 \u0437 \u0430\u0434\u043a\u043b\u044e\u0447\u0430\u043d\u044b\u043c\u0456 \u043c\u0430\u043b\u044e\u043d\u043a\u0430\u043c\u0456.",example_img:"\u041f\u0430\u043f\u044f\u0440\u044d\u0434\u043d\u0456 \u043f\u0440\u0430\u0433\u043b\u044f\u0434 \u0432\u043e\u043d\u043a\u0430\u0432\u0430\u0433\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0443",misc:"\u0420\u043e\u0437\u043d\u0430\u0435",mouseout:"\u043f\u0440\u044b \u0430\u0434\u0432\u044f\u0434\u0437\u0435\u043d\u043d\u0456 \u043c\u044b\u0448\u044b",mouseover:"\u043f\u0440\u044b \u043d\u0430\u0432\u044f\u0434\u0437\u0435\u043d\u043d\u0456 \u043c\u044b\u0448\u044b",alt_image:"\u0410\u043b\u044c\u0442\u044d\u0440\u043d\u0430\u0442\u044b\u045e\u043d\u044b \u043c\u0430\u043b\u044e\u043d\u0430\u043a",swap_image:"\u041f\u0430\u043c\u044f\u043d\u044f\u0446\u044c \u043c\u0430\u043b\u044e\u043d\u0430\u043a",map:"\u041c\u0430\u043b\u044e\u043d\u0430\u043a-\u043a\u0430\u0440\u0442\u0430",id:"\u0406\u0434\u044d\u043d\u0442\u044b\u0444\u0456\u043a\u0430\u0442\u0430\u0440",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u0430",ltr:"\u0417\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u0430",classes:"\u041a\u043b\u0430\u0441\u044b",style:"\u0421\u0442\u044b\u043b\u044c",long_desc:"\u0421\u043f\u0430\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0430\u0434\u0440\u0430\u0431\u044f\u0437\u043d\u0430\u0435 \u0430\u043f\u0456\u0441\u0430\u043d\u043d\u0435",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u044b",langdir:"\u041a\u0456\u0440\u0443\u043d\u0430\u043a \u043c\u043e\u0432\u044b",constrain_proportions:"\u0417\u0430\u0445\u043e\u045e\u0432\u0430\u0446\u044c \u043f\u0440\u0430\u043f\u043e\u0440\u0446\u044b\u0456",preview:"\u041f\u0430\u043f\u044f\u0440\u044d\u0434\u043d\u0456 \u043f\u0440\u0430\u0433\u043b\u044f\u0434",title:"\u041d\u0430\u0437\u043e\u045e",general:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f",tab_advanced:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f",tab_appearance:"\u0412\u043e\u043d\u043a\u0430\u0432\u044b \u0432\u044b\u0433\u043b\u044f\u0434",tab_general:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/bg_dlg.js b/js/tiny_mce/plugins/advimage/langs/bg_dlg.js new file mode 100755 index 000000000..90fa58d05 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.advimage_dlg',{image_list:"\u0421\u043f\u0438\u0441\u044a\u043a \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438",align_right:"\u0414\u044f\u0441\u043d\u043e",align_left:"\u041b\u044f\u0432\u043e",align_textbottom:"\u0422\u0435\u043a\u0441\u0442 \u0434\u043e\u043b\u0443",align_texttop:"\u0422\u0435\u043a\u0441\u0442 \u0433\u043e\u0440\u0435",align_bottom:"\u0414\u043e\u043b\u0443",align_middle:"\u0426\u0435\u043d\u0442\u044a\u0440",align_top:"\u0413\u043e\u0440\u0435",align_baseline:"\u0411\u0430\u0437\u043e\u0432\u0430 \u043b\u0438\u043d\u0438\u044f",align:"\u041f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435",hspace:"\u0425\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u043d\u043e \u0440\u0430\u0437\u0441\u0442\u043e\u044f\u043d\u0438\u0435",vspace:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u043d\u043e \u0440\u0430\u0437\u0441\u0442\u043e\u044f\u043d\u0438\u0435",dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440\u0438",border:"\u0420\u0430\u043c\u043a\u0430",list:"\u0421\u043f\u0438\u0441\u044a\u043a \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438",alt:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",src:"URL \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",dialog_title:"\u0412\u043c\u044a\u043a\u043d\u0438/\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",missing_alt:"\u0421\u0438\u0433\u0443\u0440\u0435\u043d \u043b\u0438 \u0441\u0442\u0435 \u0447\u0435 \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0434\u0430 \u043f\u0440\u043e\u0434\u044a\u043b\u0436\u0438\u0442\u0435 \u0431\u0435\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0442\u0430? \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0442\u0430 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u044a\u043f\u043d\u0430 \u0437\u0430 \u043d\u044f\u043a\u043e\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 \u0441 \u043d\u0435\u0434\u044a\u0437\u0438, \u0438\u043b\u0438 \u0437\u0430 \u0442\u0435\u0437\u0438 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0449\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0431\u0440\u0430\u0443\u0437\u044a\u0440, \u0438\u043b\u0438 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0449\u0438 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441 \u0438\u0437\u043a\u043b\u044e\u0447\u0435\u043d\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.",example_img:"\u041f\u0440\u0435\u0433\u043b\u0435\u0434 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0442\u0430",misc:"\u0420\u0430\u0437\u043d\u0438",mouseout:"\u0437\u0430 mouse out",mouseover:"\u0437\u0430 mouse over",alt_image:"\u0420\u0435\u0437\u0435\u0440\u0432\u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",swap_image:"\u0421\u043c\u0435\u043d\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",map:"\u041a\u0430\u0440\u0442\u0438\u043d\u0430 \u043a\u0430\u0440\u0442\u0430",id:"Id",rtl:"\u041e\u0442\u0434\u044f\u0441\u043d\u043e \u043d\u0430 \u043b\u044f\u0432\u043e",ltr:"\u041e\u0442\u043b\u044f\u0432\u043e \u043d\u0430 \u0434\u044f\u0441\u043d\u043e",classes:"\u041a\u043b\u0430\u0441\u043e\u0432\u0435",style:"\u0421\u0442\u0438\u043b",long_desc:"\u0425\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0430 \u043a\u044a\u043c \u0434\u044a\u043b\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",langcode:"\u041a\u043e\u0434 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",langdir:"\u041f\u043e\u0441\u043e\u043a\u0430 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",constrain_proportions:"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438\u0442\u0435",preview:"\u041f\u0440\u0435\u0433\u043b\u0435\u0434",title:"\u0417\u0430\u0433\u043b\u0430\u0432\u0438\u0435",general:"\u041e\u0431\u0449\u0438",tab_advanced:"\u0417\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",tab_appearance:"\u0412\u044a\u043d\u0448\u0435\u043d \u0432\u0438\u0434",tab_general:"\u041e\u0431\u0449\u0438"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/bn_dlg.js b/js/tiny_mce/plugins/advimage/langs/bn_dlg.js new file mode 100755 index 000000000..3ba89300f --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.advimage_dlg',{"image_list":"Image list","align_right":"Right","align_left":"Left","align_textbottom":"Text bottom","align_texttop":"Text top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL","dialog_title":"Insert/edit 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.","example_img":"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over","alt_image":"Alternative image","swap_image":"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style","long_desc":"Long description link",langcode:"Language code",langdir:"Language direction","constrain_proportions":"Constrain proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/br_dlg.js b/js/tiny_mce/plugins/advimage/langs/br_dlg.js new file mode 100755 index 000000000..77c725c84 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.advimage_dlg',{image_list:"Lista de imagens",align_right:"Direita",align_left:"Esquerda",align_textbottom:"Base do texto",align_texttop:"Topo do texto",align_bottom:"Abaixo",align_middle:"Meio",align_top:"Topo",align_baseline:"Sobre a linha de texto",align:"Alinhamento",hspace:"Espa\u00e7o horizontal",vspace:"Espa\u00e7o vertical",dimensions:"Dimens\u00f5es",border:"Limite",list:"Lista de imagens",alt:"Descri\u00e7\u00e3o da imagem",src:"Endere\u00e7o da imagem",dialog_title:"Inserir/editar imagem",missing_alt:"Tem certeza que deseja continuar sem acrescentar uma descri\u00e7\u00e3o \u00e0\u00a0imagem? (Isto pode gerar problemas de acessibilidade em alguns navegadores)",example_img:"Pr\u00e9-visualiza\u00e7\u00e3o",misc:"Misto",mouseout:"mouseout",mouseover:"mouseover",alt_image:"Imagem alternativa",swap_image:"Trocar imagem",map:"Mapa de imagem",id:"Id",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",classes:"Classes",style:"Estilo",long_desc:"Descri\u00e7\u00e3o extensa",langcode:"C\u00f3digo de idioma",langdir:"Dire\u00e7\u00e3o do texto",constrain_proportions:"Manter propor\u00e7\u00f5es",preview:"Pr\u00e9-Visualiza\u00e7\u00e3o",title:"T\u00edtulo",general:"Geral",tab_advanced:"Avan\u00e7ado",tab_appearance:"Apar\u00eancia",tab_general:"Geral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/bs_dlg.js b/js/tiny_mce/plugins/advimage/langs/bs_dlg.js new file mode 100755 index 000000000..78330038a --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.advimage_dlg',{image_list:"Lista slika",align_right:"Desno",align_left:"Lijevo",align_textbottom:"Dno teksta",align_texttop:"Vrh teksta",align_bottom:"Dno",align_middle:"Sredina",align_top:"Vrh",align_baseline:"Osnovna linija",align:"Poravnavanje",hspace:"Vodoravni razmak",vspace:"Okomiti razmak",dimensions:"Dimenzije",border:"Obrub",list:"Lista slika",alt:"Opis slike",src:"URL slike",dialog_title:"Umetni/uredi sliku",missing_alt:"Jeste li sigurni da \u017eelite izostaviti opis slike? Slika mo\u017ee biti nedostupna ljudima s pote\u0161ko\u0107ama ili onima koji koriste preglednike bez prikaza slika.",example_img:"Prikaz slike",misc:"Razno",mouseout:"za izlazak mi\u0161a van slike",mouseover:"za prelazak mi\u0161a preko slike",alt_image:"Alternativna slika",swap_image:"Izmjenjiva slika",map:"Karta slike",id:"Id",rtl:"S desna na lijevo",ltr:"S lijeva na desno",classes:"Klase",style:"Stil",long_desc:"Poveznica dugog opisa",langcode:"Kod jezika",langdir:"Smjer jezika",constrain_proportions:"Zadr\u017ei proporcije",preview:"Prikaz",title:"Naslov",general:"Osnovno",tab_advanced:"Napredno",tab_appearance:"Izgled",tab_general:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ca_dlg.js b/js/tiny_mce/plugins/advimage/langs/ca_dlg.js new file mode 100755 index 000000000..ace03f87e --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.advimage_dlg',{"image_list":"Llista d\'imatges","align_right":"A la dreta","align_left":"A l\'esquerra","align_textbottom":"Baix del text","align_texttop":"Dalt del text","align_bottom":"Inferior","align_middle":"Mitjan lloc","align_top":"Superior","align_baseline":"L\u00ednia de base",align:"Alineaci\u00f3",hspace:"Espai horitzontal",vspace:"Espai vertical",dimensions:"Dimensions",border:"Vora",list:"Llista de la imatge",alt:"Descripci\u00f3 de la imatge",src:"URL de la imatge","dialog_title":"Insereix/edita imatge","missing_alt":"Esteu segur que voleu continuar sense incloure una descripci\u00f3 de la imatge? La imatge pot no ser accessible a usuaris amb discapacitats, o a aquells que utilitzin navegadors de text o que naveguin amb les imatges desactivades.","example_img":"Aparen\u00e7a imatge previsualitzada",misc:"Miscel\u00b7l\u00e0nia",mouseout:"quan el ratol\u00ed marxa",mouseover:"quan el ratol\u00ed arriba","alt_image":"Imatge alternativa","swap_image":"Canvia imatge",map:"Mapa de la imatge",id:"Id",rtl:"De dreta a esquerra",ltr:"D\'esquerra a dreta",classes:"Classes",style:"Estil","long_desc":"Enlla\u00e7 a la descripci\u00f3 llarga",langcode:"Codi de l\'idioma",langdir:"Direcci\u00f3 de l\'idioma","constrain_proportions":"Mant\u00e9 la proporci\u00f3",preview:"Previsualitzaci\u00f3",title:"T\u00edtol",general:"General","tab_advanced":"Avan\u00e7at","tab_appearance":"Aparen\u00e7a","tab_general":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ch_dlg.js b/js/tiny_mce/plugins/advimage/langs/ch_dlg.js new file mode 100755 index 000000000..7fad9ba18 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.advimage_dlg',{image_list:"\u56fe\u7247\u6e05\u5355",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u9760\u4e0b",align_middle:"\u7f6e\u4e2d",align_top:"\u9760\u4e0a",align_baseline:"\u57fa\u51c6\u7ebf",align:"\u5bf9\u9f50\u65b9\u5f0f",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u6e05\u5355",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247URL",dialog_title:"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247",missing_alt:"\u56fe\u7247\u6ca1\u6709\u8bf4\u660e\u6587\u5b57\uff0c\u662f\u5426\u7ee7\u7eed\uff1f",example_img:"\u56fe\u7247\u5916\u89c2\u9884\u89c8",misc:"\u5176\u5b83",mouseout:"\u9f20\u6807\u79fb\u51fa",mouseover:"\u9f20\u6807\u79fb\u5165",alt_image:"\u53d6\u4ee3\u56fe\u7247",swap_image:"\u56fe\u7247\u5207\u6362",map:"\u56fe\u7247 Map",id:"ID",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",long_desc:"\u957f\u8fde\u7ed3",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",constrain_proportions:"\u7ea6\u675f\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u6807\u9898",general:"\u4e00\u822c",tab_advanced:"\u9ad8\u7ea7",tab_appearance:"\u5916\u89c2",tab_general:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/cn_dlg.js b/js/tiny_mce/plugins/advimage/langs/cn_dlg.js new file mode 100755 index 000000000..3e7ae01c1 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.advimage_dlg',{"image_list":"\u56fe\u7247\u5217\u8868","align_right":"\u9760\u53f3","align_left":"\u9760\u5de6","align_textbottom":"\u6587\u5b57\u5e95\u90e8","align_texttop":"\u6587\u5b57\u9876\u90e8","align_bottom":"\u5e95\u90e8","align_middle":"\u4e2d\u95f4","align_top":"\u9876\u90e8","align_baseline":"\u57fa\u7ebf",align:"\u5bf9\u9f50",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u5217\u8868",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247\u5730\u5740URL","dialog_title":"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247","missing_alt":"\u56fe\u7247\u6ca1\u6709\u8bf4\u660e\u6587\u5b57\uff0c\u662f\u5426\u7ee7\u7eed\uff1f","example_img":"\u56fe\u7247\u9884\u89c8",misc:"\u5176\u5b83",mouseout:"\u9f20\u6807\u79fb\u51fa",mouseover:"\u9f20\u6807\u79fb\u5165","alt_image":"\u66ff\u4ee3\u56fe\u7247","swap_image":"\u56fe\u7247\u5207\u6362",map:"\u56fe\u7247 Map",id:"Id\u540d\u79f0",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",classes:"\u7c7b\u522b",style:"\u6837\u5f0f","long_desc":"\u957f\u8fde\u7ed3",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u6587\u672c\u65b9\u5411","constrain_proportions":"\u7ea6\u675f\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u6807\u9898",general:"\u5e38\u89c4","tab_advanced":"\u9ad8\u7ea7","tab_appearance":"\u5916\u89c2","tab_general":"\u5e38\u89c4"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/cs_dlg.js b/js/tiny_mce/plugins/advimage/langs/cs_dlg.js new file mode 100755 index 000000000..8d344591d --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.advimage_dlg',{image_list:"Seznam obr\u00e1zk\u016f",align_right:"Vpravo",align_left:"Vlevo",align_textbottom:"Se spodkem \u0159\u00e1dku",align_texttop:"S vrchem \u0159\u00e1dku",align_bottom:"Dol\u016f",align_middle:"Na st\u0159ed \u0159\u00e1dku",align_top:"Nahoru",align_baseline:"Na z\u00e1kladnu",align:"Zarovn\u00e1n\u00ed",hspace:"Horizont\u00e1ln\u00ed odsazen\u00ed",vspace:"Vertik\u00e1ln\u00ed odsazen\u00ed",dimensions:"Rozm\u011bry",border:"R\u00e1me\u010dek",list:"Seznam obr\u00e1zk\u016f",alt:"Popis obr\u00e1zku",src:"URL obr\u00e1zku",dialog_title:"Vlo\u017eit/upravit obr\u00e1zek",missing_alt:"Skute\u010dn\u011b chcete pokra\u010dovat bez vlo\u017een\u00e9ho popisu obr\u00e1zku? Bez popisu m\u016f\u017ee b\u00fdt obr\u00e1zek nep\u0159\u00edstupn\u00fd u\u017eivatel\u016fm se zrakov\u00fdm posti\u017een\u00edm, u\u017eivatel\u016fm textov\u00fdch prohl\u00ed\u017ee\u010d\u016f nebo u\u017eivatel\u016fm, kte\u0159\u00ed maj\u00ed vypnuto zobrazov\u00e1n\u00ed obr\u00e1zk\u016f.",example_img:"P\u0159\u00edklad obr\u00e1zku",misc:"R\u016fzn\u00e9",mouseout:"Po odjet\u00ed my\u0161i...",mouseover:"P\u0159i najet\u00ed my\u0161i...",alt_image:"Alternativn\u00ed obr\u00e1zek",swap_image:"P\u0159epnout obr\u00e1zek",map:"Obr\u00e1zkov\u00e1 mapa",id:"ID",rtl:"Zprava doleva",ltr:"Zleva doprava",classes:"T\u0159\u00eddy",style:"Styl",long_desc:"Dlouh\u00fd popis",langcode:"K\u00f3d jazyka",langdir:"Sm\u011br textu",constrain_proportions:"Zachovat proporce",preview:"N\u00e1hled",title:"Titulek",general:"Obecn\u00e9 parametry",tab_advanced:"Roz\u0161\u00ed\u0159en\u00e9",tab_appearance:"Vzhled",tab_general:"Obecn\u00e9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/cy_dlg.js b/js/tiny_mce/plugins/advimage/langs/cy_dlg.js new file mode 100755 index 000000000..cc2651076 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.advimage_dlg',{image_list:"Rhestr delweddau",align_right:"De",align_left:"Chwith",align_textbottom:"Gwaelod testun",align_texttop:"Pen testun",align_bottom:"Gwaelod",align_middle:"Canol",align_top:"Pen",align_baseline:"Gwaelodlin",align:"Aliniad",hspace:"Gofod llorweddol",vspace:"Gofod fertigol",dimensions:"Dimensiynau",border:"Border",list:"Rhestr delweddau",alt:"Disgrifiad delwedd",src:"URL delwedd",dialog_title:"Mewnosod/golygu delwedd",missing_alt:"A ydych chi\'n si\u0175r eich bod eisiau parhau heb cynnwys Disgrifiad Delwedd? Hebddo fo ni fydd y delwedd yn hygyrchol i ddefnyddwyr gyda anableddau, neu sy\'n defnyddio porwr testun, neu sy\'n pori\'r we gyda delweddau wedi\'u diffodd.",example_img:"Delwedd rhagolygiad ymddangosiad",misc:"Amrywiol",mouseout:"ar gyfer llygoden allan",mouseover:"ar gyfer llygoden drosti",alt_image:"Delwedd arall",swap_image:"Cyfnewid delwedd",map:"Map delweddau",id:"Id",rtl:"De i\'r chwith",ltr:"Chwith i\'r dde",classes:"Dosbarthiadau",style:"Arddull",long_desc:"Cyswllt disgrifiad hir",langcode:"Cod iaith",langdir:"Cyfeiriad iaith",constrain_proportions:"Cynfyngu cyfraneddau",preview:"Rhagolwg",title:"Teitl",general:"Cyffredinol",tab_advanced:"Uwch",tab_appearance:"Ymddangosiad",tab_general:"Cyffredinol"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/da_dlg.js b/js/tiny_mce/plugins/advimage/langs/da_dlg.js new file mode 100755 index 000000000..046bb976b --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.advimage_dlg',{image_list:"Billedliste",align_right:"H\u00f8jre",align_left:"Venstre",align_textbottom:"Tekstbund",align_texttop:"Teksttop",align_bottom:"Bund",align_middle:"Midte",align_top:"Top",align_baseline:"Grundlinje",align:"Justering",hspace:"Horisontal afstand",vspace:"Vertikal afstand",dimensions:"Dimentioner",border:"Kant",list:"Billedliste",alt:"Billedbeskrivelse",src:"Billed-URL",dialog_title:"Inds\u00e6t/rediger billede",missing_alt:"Er du sikker p\u00e5, at du vil forts\u00e6tte uden at inkludere en billedebeskrivelse? Uden denne er billedet m\u00e5ske ikke tilg\u00e6ngeligt for nogle brugere med handicaps, eller for dem der bruger en tekstbrowser, eller som browser internettet med billeder sl\u00e5et fra.",example_img:"Forh\u00e5ndsvisning af billede",misc:"Diverse",mouseout:"for mus-ud",mouseover:"for mus-over",alt_image:"Alternativt billede",swap_image:"Byt billede",map:"Billede map",id:"Id",rtl:"H\u00f8jre til venstre",ltr:"Venstre til h\u00f8jre",classes:"Klasser",style:"Stil",long_desc:"Lang beskrivelseslink",langcode:"Sprogkode",langdir:"Sprogretning",constrain_proportions:"Bibehold proportioner",preview:"Vis",title:"Titel",general:"Generelt",tab_advanced:"Avanceret",tab_appearance:"Udseende",tab_general:"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/de_dlg.js b/js/tiny_mce/plugins/advimage/langs/de_dlg.js new file mode 100755 index 000000000..cf3561f17 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advimage_dlg',{image_list:"Bilderliste",align_right:"Rechts",align_left:"Links",align_textbottom:"Unten im Text",align_texttop:"Oben im Text",align_bottom:"Unten",align_middle:"Mittig",align_top:"Oben",align_baseline:"Zeile",align:"Ausrichtung",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",dimensions:"Ausma\u00dfe",border:"Rahmen",list:"Bilderliste",alt:"Beschreibung",src:"Adresse",dialog_title:"Bild einf\u00fcgen/bearbeiten",missing_alt:"Wollen Sie wirklich keine Beschreibung eingeben? Bestimmte Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnen so nicht darauf zugreifen, ebenso solche, die einen Textbrowser benutzen oder die Anzeige von Bildern deaktiviert haben.",example_img:"Aussehen der Vorschau",misc:"Verschiedenes",mouseout:"bei keinem Mauskontakt",mouseover:"bei Mauskontakt",alt_image:"Alternatives Bild",swap_image:"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Rechts nach links",ltr:"Links nach rechts",classes:"Klassen",style:"Format",long_desc:"Ausf\u00fchrliche Beschreibung",langcode:"Sprachcode",langdir:"Schriftrichtung",constrain_proportions:"Seitenverh\u00e4ltnis beibehalten",preview:"Vorschau",title:"Titel",general:"Allgemein",tab_advanced:"Erweitert",tab_appearance:"Aussehen",tab_general:"Allgemein"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/dv_dlg.js b/js/tiny_mce/plugins/advimage/langs/dv_dlg.js new file mode 100755 index 000000000..b03dd065b --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/el_dlg.js b/js/tiny_mce/plugins/advimage/langs/el_dlg.js new file mode 100755 index 000000000..2ed51002d --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.advimage_dlg',{image_list:"\u039b\u03af\u03c3\u03c4\u03b1 \u03b5\u03b9\u03ba\u03cc\u03bd\u03c9\u03bd",align_right:"\u0394\u03b5\u03be\u03b9\u03ac",align_left:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",align_textbottom:"\u039a\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03ba\u03ac\u03c4\u03c9",align_texttop:"\u039a\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03c0\u03ac\u03bd\u03c9",align_bottom:"\u039a\u03ac\u03c4\u03c9",align_middle:"\u039c\u03ad\u03c3\u03b7",align_top:"\u03a0\u03ac\u03bd\u03c9",align_baseline:"\u0393\u03c1\u03b1\u03bc\u03bc\u03ae \u03c3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ac\u03c4\u03c9\u03bd",align:"\u03a3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7",hspace:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03bf\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1",vspace:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03ba\u03ac\u03b8\u03b5\u03c4\u03b7",dimensions:"\u0394\u03b9\u03b1\u03c3\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2",border:"\u03a0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf",list:"\u039b\u03af\u03c3\u03c4\u03b1 \u03b5\u03b9\u03ba\u03cc\u03bd\u03c9\u03bd",alt:"\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",src:"\u0394\u03b9\u03b1\u03b4\u03c1\u03bf\u03bc\u03ae URL \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",dialog_title:"\u0395\u03b9\u03c3\u03b1\u03b3\u03c9\u03b3\u03ae/\u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",missing_alt:"\u03a3\u03af\u03b3\u03bf\u03c5\u03c1\u03b1 \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bd\u03b5\u03c7\u03af\u03c3\u03b5\u03c4\u03b5 \u03c7\u03c9\u03c1\u03af\u03c2 \u03c0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2; \u03a7\u03c9\u03c1\u03af\u03c2 \u03b1\u03c5\u03c4\u03ae\u03bd\u03b7 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03bc\u03b7\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03b2\u03ac\u03c3\u03b9\u03bc\u03b7 \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03c5\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b5\u03c2 \u03bc\u03b5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03b1, \u03ae \u03c3\'\u03b1\u03c5\u03c4\u03bf\u03cd\u03c2 \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd \u03c6\u03c5\u03bb\u03bb\u03bf\u03bc\u03b5\u03c4\u03c1\u03b7\u03c4\u03ae \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5, \u03ae \u03b2\u03bb\u03ad\u03c0\u03bf\u03c5\u03bd \u03c4\u03bf \u0399\u03bd\u03c4\u03b5\u03c1\u03bd\u03b5\u03c4 \u03c7\u03c9\u03c1\u03af\u03c2 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b5\u03c2.",example_img:"\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1",misc:"\u0394\u03b9\u03ac\u03c6\u03bf\u03c1\u03b1",mouseout:"\u03b3\u03b9\u03b1 mouse out",mouseover:"\u03b3\u03b9\u03b1 mouse over",alt_image:"\u0395\u03bd\u03b1\u03bb\u03bb\u03b1\u03ba\u03c4\u03b9\u03ba\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1",swap_image:"\u0391\u03bd\u03c4\u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",map:"\u03a7\u03ac\u03c1\u03c4\u03b7\u03c2 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",id:"Id",rtl:"\u0394\u03b5\u03be\u03b9\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",ltr:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b4\u03b5\u03be\u03b9\u03ac",classes:"\u039a\u03bb\u03ac\u03c3\u03b5\u03b9\u03c2",style:"\u03a3\u03c4\u03c5\u03bb",long_desc:"\u03a3\u03cd\u03bd\u03b4\u03b5\u03c3\u03bc\u03bf\u03c2 \u03c0\u03bb\u03ae\u03c1\u03bf\u03c5\u03c2 \u03c0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2",langcode:"\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",langdir:"\u039a\u03b1\u03c4\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",constrain_proportions:"\u0394\u03b9\u03b1\u03c4\u03ae\u03c1\u03b7\u03c3\u03b7 \u03b1\u03bd\u03b1\u03bb\u03bf\u03b3\u03af\u03b1\u03c2 \u03c0\u03bb. - \u03cd\u03c8\u03bf\u03c5\u03c2",preview:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7",title:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",general:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac",tab_advanced:"\u0393\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03bf\u03c5\u03c2",tab_appearance:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7",tab_general:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/en_dlg.js b/js/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100755 index 000000000..e14dcf4ed --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image list","align_right":"Right","align_left":"Left","align_textbottom":"Text bottom","align_texttop":"Text top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL","dialog_title":"Insert/edit 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.","example_img":"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over","alt_image":"Alternative image","swap_image":"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style","long_desc":"Long description link",langcode:"Language code",langdir:"Language direction","constrain_proportions":"Constrain proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/es_dlg.js b/js/tiny_mce/plugins/advimage/langs/es_dlg.js new file mode 100755 index 000000000..89fbf7369 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.advimage_dlg',{"image_list":"Lista de imagen","align_right":"Derecha","align_left":"Izquierda","align_textbottom":"Texto abajo","align_texttop":"Texto arriba","align_bottom":"Debajo","align_middle":"Medio","align_top":"Arriba","align_baseline":"L\u00ednea base",align:"Alineaci\u00f3n",hspace:"Espacio horizontal",vspace:"Espacio vertical",dimensions:"Dimensiones",border:"Bordes",list:"Lista de imagen",alt:"Descripci\u00f3n de la imagen",src:"URL de la imagen","dialog_title":"Insertar/editar imagen","missing_alt":" \u00bfEsta seguro de continuar sin introducir una descripci\u00f3n a la imagen? Sin ella puede no ser accesible para usuarios con discapacidades, o para aquellos que usen navegadores de modo texto, o tengan deshabilitadas las im\u00e1genes de la p\u00e1gina.","example_img":"Vista previa de la imagen",misc:"Miscel\u00e1neo",mouseout:"para mouseout",mouseover:"para mouseover","alt_image":"Imagen alternativa","swap_image":"Intercambiar imagen",map:"Mapa de imagen",id:"Id",rtl:"Derecha a izquierda",ltr:"Izquierda a derecha",classes:"Clases",style:"Estilos","long_desc":"V\u00ednculo para descripci\u00f3n larga",langcode:"C\u00f3digo del lenguaje",langdir:"Direcci\u00f3n del lenguaje","constrain_proportions":"Bloquear relaci\u00f3n de aspecto",preview:"Vista previa",title:"T\u00edtulo",general:"General","tab_advanced":"Avanzado","tab_appearance":"Apariencia","tab_general":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/et_dlg.js b/js/tiny_mce/plugins/advimage/langs/et_dlg.js new file mode 100755 index 000000000..7fc429760 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.advimage_dlg',{image_list:"Piltide nimekiri",align_right:"Paremal",align_left:"Vasakul",align_textbottom:"Tekst all",align_texttop:"Tekst \u00fcleval",align_bottom:"All",align_middle:"Keskel",align_top:"\u00dcleval",align_baseline:"Baas",align:"Joondus",hspace:"Horisontaalne vahe",vspace:"Vertikaalne vahe",dimensions:"M\u00f5\u00f5tmed",border:"Raam",list:"Piltide nimekiri",alt:"Pildi kirjeldus",src:"Pildi URL",dialog_title:"Sisesta/muuda pilti",missing_alt:"Oled kindel, et soovid j\u00e4tkata pildile kirjeldust lisamata?",example_img:"Eelvaate pildi v\u00e4limus",misc:"Mitmesugune",mouseout:"\u201eKursor maas\u201c",mouseover:"\u201eKursor peal\u201c",alt_image:"Alternatiivne pilt",swap_image:"Vaheta pilti",map:"Pildi kaart",id:"ID",rtl:"Paremalt vasakule",ltr:"Vasakult paremale",classes:"Klassid",style:"Stiil",long_desc:"Pikk kirjelduse link",langcode:"Keele kood",langdir:"Keele suund",constrain_proportions:"Piira proportioone",preview:"Eelvaade",title:"Pealkiri",general:"\u00dcldine",tab_advanced:"P\u00f5hjalikum",tab_appearance:"V\u00e4limus",tab_general:"\u00dcldine"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/eu_dlg.js b/js/tiny_mce/plugins/advimage/langs/eu_dlg.js new file mode 100755 index 000000000..1a2d8242e --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.advimage_dlg',{image_list:"Irudi-zerrenda",align_right:"Eskuinean",align_left:"Ezkerrean",align_textbottom:"Testua behean",align_texttop:"Testua goian",align_bottom:"Behean",align_middle:"Tartean",align_top:"Goian",align_baseline:"Oinarri-marra",align:"Alineazioa",hspace:"Tarte horizontala",vspace:"Tarte bertikala",dimensions:"Tamaina",border:"Inguruko marra",list:"Irudi-zerrenda",alt:"Irudiaren deskribapena",src:"Irudiaren URL helbidea",dialog_title:"Irudia txertatu/editatu",missing_alt:"Irudiaren deskribapena gehitu gabe jarraitu nahi duzu? Hau horrela, ezgaitasunak dituztenentzat edo testu nabigatzaile bat darabiltenentzat ez da irisgarria izango.",example_img:"Nola ikusiko den",misc:"Bestelakoak",mouseout:"xagua kentzen denean",mouseover:"xagua gainean dagoenean",alt_image:"Ordezko irudia",swap_image:"Irudia ordezkatu",map:"Irudi-mapa",id:"Id",rtl:"Eskuinetik ezkerrera",ltr:"Ezkerretik eskuinera",classes:"Klaseak",style:"Estiloa",long_desc:"Deskribaepn luzearen lotura",langcode:"Hizkuntza-kodea",langdir:"Hizkuntzaren norabidea",constrain_proportions:"Proportzioak mantendu",preview:"Aurrebista",title:"Izenburua",general:"Orokorra",tab_advanced:"Aurreratua",tab_appearance:"Itxura",tab_general:"Orokorra"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/fa_dlg.js b/js/tiny_mce/plugins/advimage/langs/fa_dlg.js new file mode 100755 index 000000000..105e3f332 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.advimage_dlg',{image_list:"\u0644\u06cc\u0633\u062a \u062a\u0635\u0648\u06cc\u0631",align_right:"\u0631\u0627\u0633\u062a",align_left:"\u0686\u067e",align_textbottom:"\u0645\u062a\u0646 \u067e\u0627\u06cc\u06cc\u0646",align_texttop:"\u0645\u062a\u0646 \u0628\u0627\u0644\u0627",align_bottom:"\u067e\u0627\u06cc\u06cc\u0646",align_middle:"\u0648\u0633\u0637",align_top:"\u0628\u0627\u0644\u0627",align_baseline:"\u062e\u0637 \u067e\u0627\u06cc\u0647",align:"\u062a\u0631\u0627\u0632",hspace:"\u0641\u0627\u0635\u0644\u0647 \u0627\u0641\u0642\u06cc",vspace:"\u0641\u0627\u0635\u0644\u0647 \u0639\u0645\u0648\u062f\u06cc",dimensions:"\u0627\u0628\u0639\u0627\u062f",border:"\u062d\u0627\u0634\u06cc\u0647",list:"\u0644\u06cc\u0633\u062a \u062a\u0635\u0648\u06cc\u0631",alt:"\u062a\u0648\u0636\u06cc\u062d \u062a\u0635\u0648\u06cc\u0631",src:"\u0622\u062f\u0631\u0633 \u062a\u0635\u0648\u06cc\u0631 (URL)",dialog_title:"\u062f\u0631\u062c/\u0648\u06cc\u0631\u0627\u06cc\u0634 \u062a\u0635\u0648\u06cc\u0631",missing_alt:"\u0622\u06cc\u0627 \u0634\u0645\u0627 \u0627\u0632 \u0627\u062f\u0627\u0645\u0647 \u0628\u062f\u0648\u0646 \u0634\u0627\u0645\u0644 \u06a9\u0631\u062f\u0646 \u06cc\u06a9 \u062a\u0648\u0636\u06cc\u062d \u0628\u0631\u0627\u06cc \u062a\u0635\u0648\u06cc\u0631 \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062f\u0627\u0631\u06cc\u062f\u061f \u0628\u062f\u0648\u0646 \u0622\u0646 \u0645\u0645\u06a9\u0646 \u0646\u06cc\u0633\u062a \u062a\u0635\u0627\u0648\u06cc\u0631 \u0628\u0631\u0627\u06cc \u0628\u0631\u062e\u06cc \u06a9\u0627\u0631\u0628\u0631\u0627\u0646\u06cc \u06a9\u0647 \u0642\u0627\u0628\u0644\u06cc\u062a \u062f\u06cc\u062f\u0646 \u062a\u0635\u0627\u0648\u06cc\u0631 \u0631\u0627 \u0646\u062f\u0627\u0631\u0646\u062f \u060c \u06cc\u0627 \u0622\u0646\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0627\u0632 \u06cc\u06a9 \u0645\u0631\u0648\u0631\u06af\u0631 \u0645\u062a\u0646\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u0646\u062f \u060c \u06cc\u0627 \u062f\u0631 \u062d\u0627\u0644 \u062f\u06cc\u062f\u0646 \u0648\u0628 \u0628\u062f\u0648\u0646 \u062a\u0635\u0648\u06cc\u0631 \u0645\u06cc \u0628\u0627\u0634\u0646\u062f \u060c \u0642\u0627\u0628\u0644 \u062f\u0633\u062a\u06cc\u0627\u0628\u06cc \u0628\u0627\u0634\u062f.",example_img:"\u062a\u0635\u0648\u06cc\u0631 \u067e\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634 \u0638\u0627\u0647\u0631",misc:"\u0645\u062a\u0641\u0631\u0642\u0647",mouseout:"\u0628\u0631\u0627\u06cc \u0631\u0641\u062a\u0646 \u0645\u0648\u0633",mouseover:"\u0628\u0631\u0627\u06cc \u0622\u0645\u062f\u0646 \u0645\u0648\u0633",alt_image:"\u062a\u0635\u0648\u06cc\u0631 \u062c\u0627\u06cc\u06af\u0632\u06cc\u0646",swap_image:"\u062a\u0639\u0648\u06cc\u0636 \u062a\u0635\u0648\u06cc\u0631",map:"\u0646\u0642\u0634\u0647 \u062a\u0635\u0648\u06cc\u0631",id:"\u0634\u0646\u0627\u0633\u0647",rtl:"\u0631\u0627\u0633\u062a \u0628\u0647 \u0686\u067e",ltr:"\u0686\u067e \u0628\u0647 \u0631\u0627\u0633\u062a",classes:"\u06a9\u0644\u0627\u0633 \u0647\u0627",style:"\u0627\u0633\u062a\u06cc\u0644",long_desc:"\u0644\u06cc\u0646\u06a9 \u062a\u0648\u0636\u06cc\u062d \u0637\u0648\u0644\u0627\u0646\u06cc",langcode:"\u06a9\u062f \u0632\u0628\u0627\u0646",langdir:"\u062c\u0647\u062a \u0632\u0628\u0627\u0646",constrain_proportions:"\u062d\u0641\u0638 \u062a\u0646\u0627\u0633\u0628",preview:"\u067e\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634",title:"\u0639\u0646\u0648\u0627\u0646",general:"\u0639\u0645\u0648\u0645\u06cc",tab_advanced:"\u067e\u06cc\u0634\u0631\u0641\u062a\u0647",tab_appearance:"\u0638\u0627\u0647\u0631",tab_general:"\u0639\u0645\u0648\u0645\u06cc"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/fi_dlg.js b/js/tiny_mce/plugins/advimage/langs/fi_dlg.js new file mode 100755 index 000000000..496d05d9e --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.advimage_dlg',{image_list:"Kuvalista",align_right:"Oikealla",align_left:"Vasemmalla",align_textbottom:"Teksti alhaalla",align_texttop:"Teksti ylh\u00e4\u00e4ll\u00e4",align_bottom:"Alhaalla",align_middle:"Keskell\u00e4",align_top:"Ylh\u00e4\u00e4ll\u00e4",align_baseline:"Rivill\u00e4",align:"Tasaus",hspace:"vaakasuora tila",vspace:"pystysuora tila",dimensions:"Mitat",border:"Kehys",list:"Kuvalista",alt:"Kuvan kuvaus",src:"Kuvan URL",dialog_title:"Lis\u00e4\u00e4/muokkaa kuvaa",missing_alt:"Haluatko varmasti jatkaa lis\u00e4\u00e4m\u00e4tt\u00e4 kuvausta? Kuvauksen puuttuminen saattaa h\u00e4irit\u00e4 sellaisia, jotka k\u00e4ytt\u00e4v\u00e4t tekstipohjaista selainta tai ovat kytkeneet kuvien n\u00e4kymisen pois p\u00e4\u00e4lt\u00e4.",example_img:"Ulkoasun esikatselukuva",misc:"Sekalaiset",mouseout:"mouseoutille",mouseover:"mouseoverille",alt_image:"Vaihtoehtoinen kuva",swap_image:"Vaihda kuva",map:"Kuvakartta",id:"Id",rtl:"Oikealta vasemmalle",ltr:"Vasemmalta oikealle",classes:"Luokat",style:"Tyyli",long_desc:"Pitk\u00e4n kuvauksen linkki",langcode:"Kielen koodi",langdir:"Kielen suunta",constrain_proportions:"S\u00e4ilyt\u00e4 mittasuhteet",preview:"Esikatselu",title:"Otsikko",general:"Yleiset",tab_advanced:"Edistynyt",tab_appearance:"N\u00e4kyminen",tab_general:"Yleiset"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/fr_dlg.js b/js/tiny_mce/plugins/advimage/langs/fr_dlg.js new file mode 100755 index 000000000..1aa451bbc --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.advimage_dlg',{image_list:"Liste d\'images",align_right:"Droite (flottant)",align_left:"Gauche (flottant)",align_textbottom:"Texte en bas",align_texttop:"Texte en haut",align_bottom:"En bas",align_middle:"Au milieu",align_top:"En haut",align_baseline:"Normal",align:"Alignement",hspace:"Espacement horizontal",vspace:"Espacement vertical",dimensions:"Dimensions",border:"Bordure",list:"Liste d\'images",alt:"Description de l\'image",src:"URL de l\'image",dialog_title:"Ins\u00e9rer / \u00e9diter une image",missing_alt:"\u00cates-vous s\u00fbr de vouloir continuer sans d\u00e9finir de description pour l\'image ? Sans elle, l\'image peut ne pas \u00eatre accessible \u00e0 certains utilisateurs handicap\u00e9s, ceux utilisant un navigateur texte ou ceux qui naviguent sans affichage des images.",example_img:"Apparence de l\'image",misc:"Divers",mouseout:"\u00e0 la sortie de la souris",mouseover:"au survol de la souris",alt_image:"Image alternative",swap_image:"Image de remplacement",map:"Image cliquable",id:"Id",rtl:"De droite \u00e0 gauche",ltr:"De gauche \u00e0 droite",classes:"Classes",style:"Style",long_desc:"Description longue du lien",langcode:"Code de la langue",langdir:"Sens de lecture",constrain_proportions:"Conserver les proportions",preview:"Pr\u00e9visualisation",title:"Titre",general:"G\u00e9n\u00e9ral",tab_advanced:"Avanc\u00e9",tab_appearance:"Apparence",tab_general:"G\u00e9n\u00e9ral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/gl_dlg.js b/js/tiny_mce/plugins/advimage/langs/gl_dlg.js new file mode 100755 index 000000000..83fbb83ea --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.advimage_dlg',{image_list:"Lista de imaxes",align_right:"Dereita",align_left:"Esquerda",align_textbottom:"Texto abaixo",align_texttop:"Texto arriba",align_bottom:"Abaixo",align_middle:"Medio",align_top:"Arriba",align_baseline:"Li\u00f1a base",align:"Ali\u00f1amento",hspace:"Espacio horizontal",vspace:"Espacio vertical",dimensions:"Dimensi\u00f3ns",border:"Bordes",list:"Lista de imaxes",alt:"Descripci\u00f3n da imaxe",src:"URL da imaxe",dialog_title:"Insertar/editar imaxe",missing_alt:"\u00bfEsta seguro de continuar sen introducir unha descripci\u00f3n \u00e1 imaxe? Sen ela pode non ser accesible pra usuarios con discapacidades, ou pra aqueles que usen navegadores de modo texto, ou te\u00f1an deshabilitadas as imaxes da p\u00e1xina.",example_img:"Vista previa da imaxe",misc:"Miscel\u00e1neo",mouseout:"pra mouseout",mouseover:"pra mouseover",alt_image:"Imaxe alternativa",swap_image:"Intercambiar imaxe",map:"Mapa de imaxe",id:"Id",rtl:"Dereita a esquerda",ltr:"Esquerda a dereita",classes:"Clases",style:"Estilos",long_desc:"V\u00ednculo pra descripci\u00f3n larga",langcode:"C\u00f3digo do idioma",langdir:"Direcci\u00f3n do idioma",constrain_proportions:"Bloquear proporci\u00f3ns",preview:"Vista previa",title:"T\u00edtulo",general:"Xeral",tab_advanced:"Avanzado",tab_appearance:"Apariencia",tab_general:"Xeral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/gu_dlg.js b/js/tiny_mce/plugins/advimage/langs/gu_dlg.js new file mode 100755 index 000000000..bbceb8c14 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/he_dlg.js b/js/tiny_mce/plugins/advimage/langs/he_dlg.js new file mode 100755 index 000000000..834d4680a --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.advimage_dlg',{image_list:"\u05e8\u05e9\u05d9\u05de\u05ea \u05ea\u05de\u05d5\u05e0\u05d5\u05ea",align_right:"\u05dc\u05d9\u05de\u05d9\u05df",align_left:"\u05dc\u05e9\u05de\u05d0\u05dc",align_textbottom:"\u05d8\u05e7\u05e1\u05d8 \u05ea\u05d7\u05ea\u05d5\u05df",align_texttop:"\u05d8\u05e7\u05e1\u05d8 \u05e2\u05dc\u05d9\u05d5\u05df",align_bottom:"\u05ea\u05d7\u05ea\u05d9\u05ea",align_middle:"\u05d0\u05de\u05e6\u05e2",align_top:"\u05e2\u05dc\u05d9\u05d5\u05df",align_baseline:"\u05e7\u05d5 \u05d1\u05e1\u05d9\u05e1\u05d9",align:"\u05d9\u05e9\u05d5\u05e8",hspace:"\u05e7\u05d5 \u05d0\u05d5\u05e4\u05e7\u05d9",vspace:"\u05e7\u05d5 \u05d0\u05e0\u05db\u05d9",dimensions:"\u05de\u05d9\u05de\u05d3\u05d9\u05dd",border:"\u05d2\u05d1\u05d5\u05dc",list:"\u05e8\u05e9\u05d9\u05de\u05ea \u05ea\u05de\u05d5\u05e0\u05d5\u05ea",alt:"\u05ea\u05d9\u05d0\u05d5\u05e8 \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",src:"URL \u05e9\u05dc \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",dialog_title:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4",missing_alt:"\u05dc\u05d4\u05de\u05e9\u05d9\u05da \u05de\u05d1\u05dc\u05d9 \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05ea\u05d9\u05d0\u05d5\u05e8 \u05dc\u05ea\u05de\u05d5\u05e0\u05d4?",example_img:"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",misc:"\u05e9\u05d5\u05e0\u05d5\u05ea",mouseout:"\u05d4\u05e1\u05de\u05df \u05e2\u05d1\u05e8 \u05d0\u05ea \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",mouseover:"\u05d1\u05e2\u05ea \u05de\u05e2\u05d1\u05e8 \u05d4\u05e1\u05de\u05df \u05e2\u05dc \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",alt_image:"\u05ea\u05de\u05d5\u05e0\u05d4 \u05d7\u05dc\u05d9\u05e4\u05d9\u05ea",swap_image:"\u05d4\u05d7\u05dc\u05e4\u05ea \u05ea\u05de\u05d5\u05e0\u05d4",map:"Image map",id:"Id",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",classes:"Classes",style:"\u05e1\u05d2\u05e0\u05d5\u05df",long_desc:"\u05ea\u05d9\u05d0\u05d5\u05e8 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d0\u05e8\u05d5\u05da",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",constrain_proportions:"\u05e9\u05de\u05d9\u05e8\u05d4 \u05e2\u05dc \u05e4\u05e8\u05d5\u05e4\u05d5\u05e8\u05e6\u05d9\u05d5\u05ea",preview:"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05d4",title:"\u05db\u05d5\u05ea\u05e8\u05ea",general:"\u05db\u05dc\u05dc\u05d9",tab_advanced:"\u05de\u05ea\u05e7\u05d3\u05dd",tab_appearance:"\u05de\u05e8\u05d0\u05d4",tab_general:"\u05db\u05dc\u05dc\u05d9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/hi_dlg.js b/js/tiny_mce/plugins/advimage/langs/hi_dlg.js new file mode 100755 index 000000000..288201b47 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/hr_dlg.js b/js/tiny_mce/plugins/advimage/langs/hr_dlg.js new file mode 100755 index 000000000..8b0ac01d6 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.advimage_dlg',{image_list:"Lista slika",align_right:"Desno",align_left:"Lijevo",align_textbottom:"Dno teksta",align_texttop:"Vrh teksta",align_bottom:"Dno",align_middle:"Sredina",align_top:"Vrh",align_baseline:"Osnovna linija",align:"Poravnavanje",hspace:"Vodoravni razmak",vspace:"Okomiti razmak",dimensions:"Dimenzije",border:"Obrub",list:"Lista slika",alt:"Opis slike",src:"URL slike",dialog_title:"Umetni/uredi sliku",missing_alt:"Jeste li sigurni da \u017eelite izostaviti opis slike? Slika mo\u017ee biti nedostupna ljudima s pote\u0161ko\u0107ama ili onima koji koriste preglednike bez prikaza slika.",example_img:"Prikaz slike",misc:"Razno",mouseout:"za izlazak mi\u0161a van slike",mouseover:"za prelazak mi\u0161a preko slike",alt_image:"Alternativna slika",swap_image:"Izmjenjiva slika",map:"Karta slike",id:"Id",rtl:"S desna na lijevo",ltr:"S lijeva na desno",classes:"Klase",style:"Stil",long_desc:"Poveznica dugog opisa",langcode:"Kod jezika",langdir:"Smjer jezika",constrain_proportions:"Zadr\u017ei proporcije",preview:"Prikaz",title:"Naslov",general:"Osnovno",tab_advanced:"Napredno",tab_appearance:"Izgled",tab_general:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/hu_dlg.js b/js/tiny_mce/plugins/advimage/langs/hu_dlg.js new file mode 100755 index 000000000..98768e2d0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.advimage_dlg',{"image_list":"K\u00e9plista","align_right":"Jobbra","align_left":"Balra","align_textbottom":"Sz\u00f6veg alj\u00e1hoz","align_texttop":"Sz\u00f6veg tetej\u00e9hez","align_bottom":"Lentre","align_middle":"K\u00f6z\u00e9pre","align_top":"Fentre","align_baseline":"Alapvonalhoz",align:"Igaz\u00edt\u00e1s",hspace:"V\u00edzszintes t\u00e1vols\u00e1g",vspace:"F\u00fcgg\u0151leges t\u00e1vols\u00e1g",dimensions:"Dimenzi\u00f3k",border:"Keret",list:"K\u00e9plista",alt:"K\u00e9p helyettes\u00edt\u0151 sz\u00f6vege",src:"K\u00e9p URL","dialog_title":"K\u00e9p besz\u00far\u00e1s/szerkeszt\u00e9s","missing_alt":"Biztosan folytatja helyettes\u00edt\u0151 sz\u00f6veg n\u00e9lk\u00fcl? En\u00e9lk\u00fcl a korl\u00e1toz\u00e1ssal \u00e9l\u0151k, sz\u00f6veges b\u00f6ng\u00e9sz\u0151t haszn\u00e1l\u00f3k \u00e9s a k\u00e9pek megjelen\u00edt\u00e9s\u00e9t letilt\u00f3 felhaszn\u00e1l\u00f3k h\u00e1tr\u00e1nyban lesznek.","example_img":"El\u0151n\u00e9zeti k\u00e9p",misc:"Vegyes",mouseout:"K\u00e9p az eg\u00e9rkurzor lev\u00e9telekor",mouseover:"K\u00e9p az eg\u00e9rkurzor f\u00f6l\u00e9vitelekor","alt_image":"Alternat\u00edv k\u00e9p","swap_image":"K\u00e9pcsere",map:"K\u00e9p t\u00e9rk\u00e9p",id:"Id",rtl:"Jobbr\u00f3l balra",ltr:"Balr\u00f3l jobbra",classes:"Class-ok",style:"Style","long_desc":"B\u0151vebb le\u00edr\u00e1s link",langcode:"Nyelv k\u00f3d",langdir:"Nyelv \u00edr\u00e1s ir\u00e1ny","constrain_proportions":"Ar\u00e1nytart\u00e1s",preview:"El\u0151n\u00e9zet",title:"C\u00edm",general:"\u00c1ltal\u00e1nos","tab_advanced":"Halad\u00f3","tab_appearance":"Megjelen\u00e9s","tab_general":"\u00c1ltal\u00e1nos"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/hy_dlg.js b/js/tiny_mce/plugins/advimage/langs/hy_dlg.js new file mode 100755 index 000000000..e4b15a96e --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.advimage_dlg',{image_list:"\u0546\u056f\u0561\u0580\u0576\u0565\u0580\u056b \u0581\u0561\u0576\u056f",align_right:"\u0538\u057d\u057f \u0561\u057b \u0565\u0566\u0580\u056b",align_left:"\u0538\u057d\u057f \u0571\u0561\u056d \u0565\u0566\u0580\u056b",align_textbottom:"\u0538\u057d\u057f \u057f\u0565\u0584\u057d\u057f\u056b \u057d\u057f\u0578\u0580\u056b\u0576 \u0565\u0566\u0580\u056b",align_texttop:"\u0538\u057d\u057f \u057f\u0565\u0584\u057d\u057f\u056b \u057e\u0565\u0580\u056b\u0576 \u0565\u0566\u0580\u056b",align_bottom:"\u0538\u057d\u057f \u057d\u057f\u0578\u0580\u056b\u0576 \u0565\u0566\u0580\u056b",align_middle:"\u053f\u0565\u0576\u057f\u0580\u0578\u0576\u0561\u0581\u0576\u0565\u056c",align_top:"\u0538\u057d\u057f \u057e\u0565\u0580\u056b \u0565\u0566\u0580\u056b",align_baseline:"\u0538\u057d\u057f \u0562\u0561\u0566\u0561\u0575\u056b\u0576 \u0563\u056e\u056b",align:"\u0540\u0561\u057e\u0561\u057d\u0561\u0580\u0565\u0581\u0578\u0582\u0574",hspace:"\u0540\u0578\u0580\u056b\u0566. \u0570\u0565\u057c\u0561\u0581\u0578\u0582\u0574",vspace:"\u0548\u0582\u0572\u0572. \u0570\u0565\u057c\u0561\u0581\u0578\u0582\u0574",dimensions:"\u0549\u0561\u0583\u057d\u0565\u0580",border:"\u0535\u0566\u0580",list:"\u0546\u056f\u0561\u0580\u0576\u0565\u0580\u056b \u0581\u0561\u0576\u056f",alt:"\u0546\u056f\u0561\u0580\u0561\u0563\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576",src:"\u0546\u056f\u0561\u0580\u056b \u0570\u0561\u057d\u0581\u0565",dialog_title:"\u0531\u057e\u0565\u056c\u0561\u0581\u0576\u0565\u056c / \u0583\u0578\u0583\u0578\u056d\u0565\u056c \u0576\u056f\u0561\u0580",missing_alt:"\u0534\u0578\u0582\u0584 \u056b\u0580\u0578\u055e\u0584 \u0579\u0565\u0584 \u0581\u0561\u0576\u056f\u0561\u0576\u0578\u0582\u0574 \u0576\u056f\u0561\u0580\u0561\u0563\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576 \u0576\u0565\u0580\u0561\u057c\u0565\u056c\u0589",example_img:"\u0546\u056f\u0561\u0580\u056b \u0564\u056b\u057f\u0574\u0561\u0576 \u057f\u0565\u057d\u0584",misc:"\u0531\u0575\u056c",mouseout:"\u0570\u0565\u057c\u0561\u0581\u0574\u0561\u0576 \u057a\u0561\u0570\u056b\u0576",mouseover:"\u0544\u0578\u057f\u0565\u0581\u0574\u0561\u0576 \u057a\u0561\u0570\u056b\u0576",alt_image:"\u0531\u056c\u057f\u0565\u0580\u0576\u0561\u057f\u056b\u057e \u0576\u056f\u0561\u0580",swap_image:"Swap",map:"\u0546\u056f\u0561\u0580\u056b map",id:"Id",rtl:"\u0531\u057b\u056b\u0581 \u0571\u0561\u056d",ltr:"\u0541\u0561\u056d\u056b\u0581 \u0561\u057b",classes:"\u0534\u0561\u057d\u0565\u0580",style:"\u0548\u0573",long_desc:"\u0544\u0561\u0576\u0580\u0561\u0574\u0561\u057d\u0576 \u0562\u0561\u0581\u0561\u057f\u0580\u0578\u0582\u0569\u0575\u0561\u0576 \u0570\u0572\u0578\u0582\u0574",langcode:"\u053c\u0565\u0566\u057e\u056b \u056f\u0578\u0564",langdir:"\u053c\u0565\u0566\u057e\u056b \u0578\u0582\u0572\u0572\u057e\u0561\u056e\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568",constrain_proportions:"\u054a\u0561\u0570\u057a\u0561\u0576\u0565\u056c \u0579\u0561\u0583\u0565\u0580\u056b \u0570\u0561\u0580\u0561\u0562\u0565\u0580\u0561\u056f\u0581\u0578\u0582\u0569\u0575\u0578\u0582\u0576\u0568",preview:"\u0546\u0561\u056d\u0561\u0564\u056b\u057f\u0578\u0582\u0574",title:"\u054e\u0565\u0580\u0576\u0561\u0563\u056b\u0580",general:"\u0540\u056b\u0574\u0576\u0561\u056f\u0561\u0576",tab_advanced:"\u053c\u0580\u0561\u0581\u0578\u0582\u0581\u056b\u0579",tab_appearance:"\u054f\u0565\u057d\u0584",tab_general:"\u0540\u056b\u0574\u0576\u0561\u056f\u0561\u0576"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ia_dlg.js b/js/tiny_mce/plugins/advimage/langs/ia_dlg.js new file mode 100755 index 000000000..62229ec04 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.advimage_dlg',{image_list:"\u56fe\u7247\u6e05\u5355",align_right:"\u5c45\u53f3",align_left:"\u5c45\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u5e95\u90e8",align_middle:"\u4e2d\u90e8",align_top:"\u9876\u90e8",align_baseline:"\u57fa\u7ebf",align:"\u5bf9\u9f50\u65b9\u5f0f",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u6e05\u5355",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247\u5730\u5740",dialog_title:"\u63d2\u5165/\u7f16\u8f91 \u56fe\u7247",missing_alt:" \u662f\u5426\u4e0d\u4e3a\u56fe\u7247\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff0c\u5982\u679c\u4e0d\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff0c\u5c06\u5bfc\u81f4\u4e0d\u652f\u6301\u56fe\u7247\u7684\u6d4f\u89c8\u5668\u5ffd\u7565\u672c\u5185\u5bb9",example_img:"\u9884\u89c8\u56fe\u7247",misc:"\u5176\u5b83",mouseout:"\u9f20\u6807\u79fb\u51fa",mouseover:"\u9f20\u6807\u5212\u8fc7",alt_image:"\u4ea4\u66ff\u56fe\u7247",swap_image:"\u5207\u6362\u56fe\u7247",map:"\u56fe\u7247\u70ed\u70b9",id:"Id",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",classes:"\u6837\u5f0f\u7c7b",style:"\u6837\u5f0f",long_desc:"\u63cf\u8ff0",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u67e5\u627e",general:"\u57fa\u672c",tab_advanced:"\u9ad8\u7ea7",tab_appearance:"\u5916\u89c2",tab_general:"\u57fa\u672c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/id_dlg.js b/js/tiny_mce/plugins/advimage/langs/id_dlg.js new file mode 100755 index 000000000..560b25441 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.advimage_dlg',{image_list:"Daftar Gambar",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensi",border:"Border",list:"Daftar Gambar",alt:"Deskripsi Gambar",src:"URL Gambar",dialog_title:"sisipkan/Ubah Gambar",missing_alt:"Yakin ingin melanjutkan tanpa menyertakan deskripsi gambar? Gambar mungkin tidak dapat diakses oleh beberapa pengguna yang yang memiliki keterbatasan, atau mereka yang menggunakan modus teks browser, atau berselancar di Web dengan gambar dimatikan.",example_img:"Gambar pra-tampil",misc:"Rupa-rupa",mouseout:"untuk mouse out",mouseover:"untuk mouse over",alt_image:"Alternatif gambar",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",classes:"Classes",style:"Style",long_desc:"Deskripsi panjang link",langcode:"Kode bahasa",langdir:"Bahasa",constrain_proportions:"Proporsi dibatasi",preview:"Preview",title:"Judul",general:"Umun",tab_advanced:"Advanced",tab_appearance:"Tampilan",tab_general:"Umum"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/is_dlg.js b/js/tiny_mce/plugins/advimage/langs/is_dlg.js new file mode 100755 index 000000000..e396e06ef --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"J\u00f6fnun",hspace:"L\u00e1r\u00e9tt loftun",vspace:"L\u00f3\u00f0r\u00e9tt loftun",dimensions:"St\u00e6r\u00f0ir",border:"Rammi",list:"Myndalisti",alt:"L\u00fdsing",src:"Sl\u00f3\u00f0 \u00e1 mynd",dialog_title:"Setja inn/breyta mynd",missing_alt:"Ertu viss um a\u00f0 halda \u00e1fram \u00e1n l\u00fdsingu myndar? \u00c1n hennar er myndin \u00f3a\u00f0genginleg fyrir suma notendur me\u00f0 skj\u00e1lesara, texta vafra e\u00f0a me\u00f0 sl\u00f6kkt \u00e1 birtingu mynda \u00ed vafranum s\u00ednum.",example_img:"Birting prufumyndar",misc:"\u00ddmislegt",mouseout:"\u00feegar m\u00fas fer af",mouseover:"\u00feegar m\u00fas er yfir",alt_image:"\u00d6nnur mynd",swap_image:"Skipta mynd \u00fat",map:"Image map",id:"Id",rtl:"H\u00e6gri til vinstri",ltr:"Vinstri til h\u00e6gri",classes:"Klasar",style:"St\u00edll",long_desc:"L\u00f6ng l\u00fdsing \u00e1 hlekki",langcode:"K\u00f3\u00f0i tungum\u00e1ls",langdir:"\u00c1tt tungum\u00e1ls",constrain_proportions:"Halda hlutf\u00f6llum",preview:"Forsko\u00f0un",title:"Titill",general:"Almennt",tab_advanced:"N\u00e1nar",tab_appearance:"\u00datlit",tab_general:"Almennt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/it_dlg.js b/js/tiny_mce/plugins/advimage/langs/it_dlg.js new file mode 100755 index 000000000..79c8e873f --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.advimage_dlg',{image_list:"Lista immagini",align_right:"A destra",align_left:"A sinistra",align_textbottom:"In basso al testo",align_texttop:"In alto al testo",align_bottom:"In basso",align_middle:"In mezzo",align_top:"In alto",align_baseline:"Alla base",align:"Allineamento",hspace:"Spaziatura orizzontale",vspace:"Spaziatura verticale",dimensions:"Dimensioni",border:"Bordo",list:"Lista immagini",alt:"Descrizione immagine",src:"URL immagine",dialog_title:"Inserisci/modifica immagine",missing_alt:"Sicuro di continuare senza includere una descrizione dell\'immagine? Senza di essa l\'immagine pu\u00f2 non essere accessibile ad alcuni utenti con disabilit\u00e0, o per coloro che usano un browser testuale oppure che hanno disabilitato la visualizzazione delle immagini nel loro browser.",example_img:"Anteprima aspetto immagine",misc:"Impostazioni varie",mouseout:"quando mouse fuori",mouseover:"quando mouse sopra",alt_image:"Immagine alternativa",swap_image:"Sostituisci immagine",map:"Immagine come mappa",id:"Id",rtl:"Destra verso sinistraa",ltr:"Sinistra verso destra",classes:"Classe",style:"Stile",long_desc:"Descrizione del collegamento",langcode:"codice lingua",langdir:"Direzione testo",constrain_proportions:"Mantieni proporzioni",preview:"Anteprima",title:"Titolo",general:"Generale",tab_advanced:"Avanzate",tab_appearance:"Aspetto",tab_general:"Generale"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ja_dlg.js b/js/tiny_mce/plugins/advimage/langs/ja_dlg.js new file mode 100755 index 000000000..28d5f859d --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.advimage_dlg',{"image_list":"\u4e00\u89a7\u304b\u3089\u9078\u3076","align_right":"Right","align_left":"Left","align_textbottom":"Text bottom","align_texttop":"Text top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"\u914d\u7f6e",hspace:"\u5de6\u53f3\u4f59\u767d",vspace:"\u4e0a\u4e0b\u4f59\u767d",dimensions:"\u30b5\u30a4\u30ba",border:"\u67a0\u7dda",list:"\u4e00\u89a7\u304b\u3089\u9078\u3076",alt:"\u753b\u50cf\u306e\u8aac\u660e",src:"\u753b\u50cfURL","dialog_title":"\u753b\u50cf\u306e\u633f\u5165/\u7de8\u96c6","missing_alt":"\u753b\u50cf\u306e\u8aac\u660e\u6587\u304c\u5165\u529b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u76ee\u306e\u4e0d\u81ea\u7531\u306a\u65b9\u3084\u30c6\u30ad\u30b9\u30c8\u30d6\u30e9\u30a6\u30b6\u3092\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u65b9\u3078\u914d\u616e\u3057\u3001\u753b\u50cf\u8aac\u660e\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3092\u304a\u85a6\u3081\u3057\u307e\u3059\u3002","example_img":"Appearance preview image",misc:"\u305d\u306e\u4ed6",mouseout:"\u30de\u30a6\u30b9\u30a2\u30a6\u30c8\u6642",mouseover:"\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u6642","alt_image":"\u753b\u50cf\u5207\u66ff\u3092\u884c\u3046","swap_image":"\u30ed\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\u52b9\u679c",map:"\u30a4\u30e1\u30fc\u30b8\u30de\u30c3\u30d7",id:"Id",rtl:"\u53f3\u304b\u3089\u5de6",ltr:"\u5de6\u304b\u3089\u53f3",classes:"\u30af\u30e9\u30b9",style:"\u30b9\u30bf\u30a4\u30eb","long_desc":"\u8a73\u7d30\u8aac\u660e\u30ea\u30f3\u30af",langcode:"\u8a00\u8a9e\u30b3\u30fc\u30c9",langdir:"\u6587\u7ae0\u306e\u65b9\u5411","constrain_proportions":"\u7e26\u6a2a\u6bd4\u306e\u4fdd\u5b58",preview:"\u30d7\u30ec\u30d3\u30e5\u30fc",title:"\u30bf\u30a4\u30c8\u30eb",general:"\u4e00\u822c","tab_advanced":"\u9ad8\u5ea6\u306a\u8a2d\u5b9a","tab_appearance":"\u8868\u793a","tab_general":"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ka_dlg.js b/js/tiny_mce/plugins/advimage/langs/ka_dlg.js new file mode 100755 index 000000000..c29f0483c --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.advimage_dlg',{image_list:"\u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d4\u10d1\u10d8\u10e1 \u10e1\u10d8\u10d0",align_right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_textbottom:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_texttop:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10d6\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_bottom:"\u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_middle:"\u10ea\u10d4\u10dc\u10e2\u10e0\u10d6\u10d4",align_top:"\u10d6\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_baseline:"\u10e1\u10d0\u10d1\u10d0\u10d6\u10d8\u10e1\u10dd \u10ee\u10d0\u10d6\u10d6\u10d4",align:"\u10db\u10dd\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",hspace:"\u10f0\u10dd\u10e0\u10d8\u10d6\u10dd\u10dc\u10e2. \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",vspace:"\u10d5\u10d4\u10e0\u10e2. \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",dimensions:"\u10d6\u10dd\u10db\u10d4\u10d1\u10d8",border:"\u10e9\u10d0\u10e0\u10e9\u10dd",list:"\u10e1\u10d8\u10d0",alt:"\u10d0\u10e6\u10ec\u10d4\u10e0\u10d0",src:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8",dialog_title:"\u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",missing_alt:"\u10d0\u10e0 \u10d2\u10e1\u10e3\u10e0\u10d7 \u10d0\u10e6\u10ec\u10d4\u10e0\u10d8\u10e1 \u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d0? \u10d0\u10e6\u10ec\u10d4\u10e0\u10d8\u10e1 \u10d2\u10d0\u10e0\u10d4\u10e8\u10d4 \u10e1\u10e3\u10e0\u10d0\u10d7\u10d8 \u10e8\u10d4\u10d8\u10eb\u10da\u10d4\u10d1\u10d0 \u10d6\u10dd\u10d2\u10d8 \u10db\u10dc\u10d0\u10ee\u10d5\u10d4\u10da\u10d8\u10e1\u10d7\u10d5\u10d8\u10e1 \u10d8\u10e7\u10dd\u10e1 \u10db\u10d8\u10e3\u10ec\u10d5\u10d3\u10dd\u10db\u10d4\u10da\u10d8.",example_img:"\u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",misc:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7\u10d8 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",mouseout:"\u10e1\u10d8\u10db\u10e8\u10d5\u10d8\u10d3\u10d4\u10e8\u10d8",mouseover:"\u10d9\u10e3\u10e0\u10e1\u10dd\u10e0\u10d8\u10e1 \u10db\u10d8\u10e7\u10d5\u10d0\u10dc\u10d8\u10e1\u10d0\u10e1",alt_image:"\u10d0\u10da\u10e2\u10d4\u10e0\u10dc\u10d0\u10e2\u10d8\u10e3\u10da\u10d8 \u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d0",swap_image:"\u10d3\u10d8\u10dc\u10d0\u10db\u10d8\u10e3\u10e0\u10d8 \u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d0",map:"\u10d1\u10db\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10e0\u10e3\u10e5\u10d0",id:"\u10d4\u10da\u10d4\u10db\u10d4\u10dc\u10e2\u10d8\u10e1 \u10e1\u10d0\u10ee\u10d4\u10da\u10ec\u10dd\u10d3\u10d4\u10d1\u10d0",rtl:"\u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ea\u10e1\u10dc\u10d8\u10d5",ltr:"\u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d5",classes:"\u10d9\u10da\u10d0\u10e1\u10d4\u10d1\u10d8",style:"\u10e1\u10e2\u10d8\u10da\u10d8",long_desc:"\u10d1\u10db\u10e3\u10da\u10d8 \u10e1\u10e0\u10e3\u10da \u10d0\u10e6\u10ec\u10d4\u10e0\u10d0\u10d6\u10d4",langcode:"\u10d4\u10dc\u10d8\u10e1 \u10d9\u10dd\u10d3\u10d8",langdir:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10db\u10d8\u10db\u10d0\u10e0\u10d7\u10e3\u10da\u10d4\u10d1\u10d0",constrain_proportions:"\u10de\u10e0\u10dd\u10de\u10dd\u10e0\u10ea\u10d8\u10d4\u10d1\u10d8\u10e1 \u10e8\u10d4\u10dc\u10d0\u10ee\u10d5\u10d0",preview:"\u10ec\u10d8\u10dc\u10d0\u10e1\u10ec\u10d0\u10e0 \u10d3\u10d0\u10d7\u10d5\u10d0\u10da\u10d8\u10d4\u10e0\u10d4\u10d1\u10d0",title:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",general:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",tab_advanced:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7",tab_appearance:"\u10db\u10d3\u10d2\u10dd\u10db\u10d0\u10e0\u10d4\u10dd\u10d1\u10d0",tab_general:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/kl_dlg.js b/js/tiny_mce/plugins/advimage/langs/kl_dlg.js new file mode 100755 index 000000000..c2b9b0d54 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/km_dlg.js b/js/tiny_mce/plugins/advimage/langs/km_dlg.js new file mode 100755 index 000000000..6a788bcf5 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.advimage_dlg',{image_list:"\u1794\u1789\u17d2\u1787\u17b8\u179a\u17bc\u1794\u1797\u17b6\u1796",align_right:"\u179f\u17d2\u178f\u17b6\u17c6",align_left:"\u1786\u17d2\u179c\u17c1\u1784",align_textbottom:"\u1780\u17d2\u179a\u17c4\u1798\u17a2\u178f\u17d2\u1790\u1794\u1791",align_texttop:"\u179b\u17be\u17a2\u178f\u17d2\u1790\u1794\u1791",align_bottom:"\u1780\u17d2\u179a\u17c4\u1798",align_middle:"\u1780\u178e\u17d2\u178f\u17b6\u179b",align_top:"\u179b\u17be",align_baseline:"\u1781\u17d2\u179f\u17c2\u1782\u17c4\u179b",align:"\u1780\u17b6\u179a\u178f\u1798\u17d2\u179a\u17b9\u1798",hspace:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1795\u17d2\u178f\u17c1\u1780",vspace:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1794\u1789\u17d2\u1788\u179a",dimensions:"\u179c\u17b7\u1798\u17b6\u178f\u17d2\u179a",border:"\u179f\u17ca\u17bb\u1798",list:"\u1794\u1789\u17d2\u1787\u17b8\u179a\u17bc\u1794\u1797\u17b6\u1796",alt:"\u1796\u17b7\u1796\u178e\u17cc\u1793\u17b6\u179a\u17bc\u1794\u1797\u17b6\u1796",src:"\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793URL\u179a\u17bc\u1794\u1797\u17b6\u1796",dialog_title:"\u1794\u1789\u17d2\u1785\u17bc\u179b/\u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u179a\u17bc\u1794\u1797\u17b6\u1796",missing_alt:"\u178f\u17be\u17a2\u17d2\u1793\u1780\u1796\u17b7\u178f\u1787\u17b6\u1785\u1784\u17cb\u1794\u1793\u17d2\u178f\u179a\u178a\u17c4\u1799\u1798\u17b7\u1793\u1794\u17b6\u1793\u1794\u1789\u17d2\u1785\u17bc\u179b\u1780\u17b6\u179a\u1796\u17b7\u1796\u178e\u17cc\u1793\u17b6\u179a\u17bc\u1794\u1797\u17b6\u1796\u17ac? \u1794\u17be\u1798\u17b7\u1793\u1798\u17b6\u1793\u17a2\u178f\u17d2\u1790\u1794\u1791\u1796\u178e\u17cc\u1793\u17b6\u1791\u17c1 \u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17be\u1798\u17bd\u1799\u1785\u17c6\u1793\u17bd\u1793\u178a\u17c2\u179b\u1787\u17b6\u1787\u1793\u17a2\u179f\u1798\u178f\u17d2\u178f\u1797\u17b6\u1796 \u17ac\u1780\u17cf\u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17be\u17a7\u1794\u1780\u179a\u178e\u17cd\u179a\u17bb\u1780\u179a\u1780\u178f\u17c2\u17a2\u178f\u17d2\u1790\u1794\u1791 \u1793\u17b7\u1784\u17a2\u17d2\u1793\u1780\u178a\u17c2\u179b\u179a\u1780\u1798\u17be\u179b\u179b\u17be\u1794\u178e\u17d2\u178f\u17b6\u1789\u178a\u17c4\u1799\u1794\u17b7\u1791\u179a\u17bc\u1794\u1797\u17b6\u1796 \u1793\u17b9\u1784\u1798\u17b7\u1793\u17a2\u17b6\u1785\u1798\u17be\u179b\u1783\u17be\u1789\u179a\u17bc\u1794\u1797\u17b6\u1796\u1793\u17c1\u17c7\u1794\u17b6\u1793\u17a1\u17be\u1799\u17d4",example_img:"\u1798\u17be\u179b\u179a\u17bc\u1794\u179a\u17b6\u1784\u179a\u17bc\u1794\u1797\u17b6\u1796\u1787\u17b6\u1798\u17bb\u1793",misc:"\u1795\u17d2\u179f\u17c1\u1784\u17d7",mouseout:"\u1780\u178e\u17d2\u178f\u17bb\u179a\u1785\u17c1\u1789\u1780\u17d2\u179a\u17c5",mouseover:"\u1780\u178e\u17d2\u178f\u17bb\u179a\u178a\u17b6\u1780\u17cb\u179b\u17be",alt_image:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1787\u17c6\u1793\u17bd\u179f",swap_image:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1794\u17d2\u178a\u17bc\u179a",map:"\u1795\u17c2\u1793\u1791\u17b8\u179a\u17bc\u1794\u1797\u17b6\u1796",id:"\u179b.\u179f.",rtl:"\u1796\u17b8\u179f\u17d2\u178f\u17b6\u17c6\u1791\u17c5\u1786\u17d2\u179c\u17c1\u1784",ltr:"\u1796\u17b8\u1786\u17d2\u179c\u17c1\u1784\u1791\u17c5\u179f\u17d2\u178f\u17b6\u17c6",classes:"\u1790\u17d2\u1793\u17b6\u1780\u17cb",style:"\u179a\u1785\u1793\u17b6\u1794\u17d2\u1798\u17d0\u1791",long_desc:"\u1796\u17b7\u1796\u178e\u17cc\u1793\u17b6\u1796\u17b7\u179f\u17d2\u178f\u17b6\u179a\u178f\u17c6\u178e",langcode:"\u1780\u17bc\u178a\u1797\u17b6\u179f\u17b6",langdir:"\u1791\u17b7\u179f\u1797\u17b6\u179f\u17b6",constrain_proportions:"\u1794\u1784\u17d2\u1781\u17c6\u17b2\u17d2\u1799\u1798\u17b6\u1793\u179f\u1798\u17b6\u1798\u17b6\u178f\u17d2\u179a",preview:"\u1798\u17be\u179b\u1787\u17b6\u1798\u17bb\u1793",title:"\u1785\u17c6\u178e\u1784\u1787\u17be\u1784",general:"\u1791\u17bc\u1791\u17c5",tab_advanced:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",tab_appearance:"\u179a\u17bc\u1794\u179a\u17b6\u1784",tab_general:"\u1791\u17bc\u1791\u17c5"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ko_dlg.js b/js/tiny_mce/plugins/advimage/langs/ko_dlg.js new file mode 100755 index 000000000..c3096d4f5 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.advimage_dlg',{image_list:"\uc774\ubbf8\uc9c0 \ubaa9\ub85d",align_right:"\uc6b0",align_left:"\uc88c",align_textbottom:"\ubb38\uc790\uc5f4 \uc544\ub798\ub85c",align_texttop:"\ubb38\uc790\uc5f4 \uc704\ub85c",align_bottom:"\ud558",align_middle:"\uc911\uc559",align_top:"\uc0c1",align_baseline:"\uae30\uc900\uc120",align:"\uc815\ub82c",hspace:"\uc88c\uc6b0 \uc5ec\ubc31",vspace:"\uc0c1\ud558 \uc5ec\ubc31",dimensions:"\ud06c\uae30",border:"\ud14c\ub450\ub9ac\uc120",list:"\uc774\ubbf8\uc9c0 \ubaa9\ub85d",alt:"\uc774\ubbf8\uc9c0 \uc124\uba85",src:"\uc774\ubbf8\uc9c0 URL",dialog_title:"\uc774\ubbf8\uc9c0\uc758 \uc0bd\uc785/\ud3b8\uc9d1",missing_alt:"\uc774\ubbf8\uc9c0 \uc124\uba85\uc774 \uc5c6\uc2b5\ub2c8\ub2e4\ub9cc \uc88b\uc2b5\ub2c8\uae4c? \uc774\ubbf8\uc9c0 \uc124\uba85\uc774 \uc5c6\ub294 \uacbd\uc6b0, \ub9f9\uc778\uc774\ub098 \ud14d\uc2a4\ud2b8 \ube0c\ub77c\uc6b0\uc800\ub97c \uc774\uc6a9\ud558\uace0 \uc788\ub294 \ubd84, \ub610 \uc774\ubbf8\uc9c0 \ud45c\uc2dc\ub97c OFF(\uc73c)\ub85c \ud558\uace0 \uc788\ub294 \uc720\uc800\uc758 \uc811\uadfc\uc131\uc774 \uc800\ud558\ub429\ub2c8\ub2e4.",example_img:"\ubbf8\ub9ac\ubcf4\uae30 \uc774\ubbf8\uc9c0",misc:"\uadf8 \uc678",mouseout:"\ub9c8\uc6b0\uc2a4 \uc544\uc6c3 \uc774\ubbf8\uc9c0",mouseover:"\ub9c8\uc6b0\uc2a4 \uc624\ubc84 \uc774\ubbf8\uc9c0",alt_image:"\ub300\uccb4 \uc774\ubbf8\uc9c0",swap_image:"\ub864 \uc624\ubc84 \ud6a8\uacfc",map:"\uc774\ubbf8\uc9c0 \ub9f5",id:"Id",rtl:"\uc624\ub978\ucabd\uc5d0\uc11c \uc67c\ucabd",ltr:"\uc67c\ucabd\uc5d0\uc11c \uc624\ub978\ucabd",classes:"\ud074\ub798\uc2a4",style:"\uc2a4\ud0c0\uc77c",long_desc:"\uc124\uba85 \ub9c1\ud06c",langcode:"\uc5b8\uc5b4 \ucf54\ub4dc",langdir:"\ubb38\uc790 \ubc29\ud5a5",constrain_proportions:"\uc885\ud6a1\ube44 \ubcf4\uc874",preview:"\ubbf8\ub9ac\ubcf4\uae30",title:"\uc81c\ubaa9",general:"\uc77c\ubc18",tab_advanced:"\uace0\uae09",tab_appearance:"\ud45c\uc2dc",tab_general:"\uc77c\ubc18"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/lb_dlg.js b/js/tiny_mce/plugins/advimage/langs/lb_dlg.js new file mode 100755 index 000000000..809f7adc0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.advimage_dlg',{image_list:"Billerl\u00ebscht",align_right:"Riets",align_left:"L\u00e9nks",align_textbottom:"\u00cbnnen am Text",align_texttop:"Uewen am Text",align_bottom:"\u00cbnnen",align_middle:"M\u00ebtteg",align_top:"Uewen",align_baseline:"Zeil",align:"Ausriichtung",hspace:"Horizontalen Ofstand",vspace:"Vertikalen Ofstand",dimensions:"Ausmoossen",border:"Rumm",list:"Billerl\u00ebschten",alt:"Beschreiwung",src:"Adress",dialog_title:"Bild af\u00fcgen/beaarbechten",missing_alt:"W\u00ebll Dir wierklech keng Beschreiwung aginn? Best\u00ebmmt Benotzer mat kierperlechen Aschr\u00e4nkungen k\u00ebnnen sou net dorop zougr\u00e4ifen, genau sou d\u00e9i, d\u00e9i een Textbrowser benotzen oder d\'Uweise vu Biller desaktiv\u00e9iert hunn.",example_img:"Ausgesinn vun der Virschau",misc:"Verschiddenes",mouseout:"bei kengem Mauskontakt",mouseover:"bei Mauskontakt",alt_image:"Alternativt Bild",swap_image:"Bild austauschen",map:"Image-Map",id:"ID",rtl:"Riets no l\u00e9nks",ltr:"L\u00e9nks no riets",classes:"Klassen",style:"Format",long_desc:"Ausf\u00e9ierlech Beschreiwung",langcode:"Sproochcode",langdir:"Schr\u00ebftrichtung",constrain_proportions:"S\u00e4iteverh\u00e4ltnis b\u00e4ibehalen",preview:"Virschau",title:"Titel",general:"Allgemeng",tab_advanced:"Erweidert",tab_appearance:"Ausgesinn",tab_general:"Allgemeng"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/lt_dlg.js b/js/tiny_mce/plugins/advimage/langs/lt_dlg.js new file mode 100755 index 000000000..af56c5a6f --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.advimage_dlg',{image_list:"Paveiksl\u0117li\u0173 s\u0105ra\u0161as",align_right:"De\u0161in\u0117je",align_left:"Kair\u0117je",align_textbottom:"Teksto apa\u010dioje",align_texttop:"Teksto vir\u0161uje",align_bottom:"Apa\u010dioje",align_middle:"Viduryje",align_top:"Vir\u0161uje",align_baseline:"Pradiniame ta\u0161ke",align:"Lygiavimas",hspace:"Horizontalus tarpas",vspace:"Vertikalus tarpas",dimensions:"I\u0161matavimai",border:"R\u0117melis",list:"Paveiksl\u0117li\u0173 s\u0105ra\u0161as",alt:"Paveiksl\u0117lio apra\u0161as",src:"Paveiksl\u0117lio URL adresas",dialog_title:"\u012eterpti/redaguoti paveiksl\u0117l\u012f",missing_alt:"Ar norite t\u0119sti ne\u012fved\u0119 paveiksl\u0117lio apra\u0161o? Be apra\u0161o jo neatpa\u017eins \u017emon\u0117s su negalia, tie kurie naudoja tekstines nar\u0161ykles, arba tie, kurie nar\u0161o internet\u0105 i\u0161jung\u0119 paveiksl\u0117li\u0173 rodym\u0105.",example_img:"I\u0161vaizdos per\u017ei\u016bros paveiksl\u0117lis",misc:"\u012evair\u016bs",mouseout:"nuvedant pel\u0119",mouseover:"u\u017evedant pele",alt_image:"Alternatyvus paveiksl\u0117lis",swap_image:"Sukeisti paveiksl\u0117l\u012f",map:"Paveiksl\u0117lio planas",id:"Id",rtl:"I\u0161 de\u0161in\u0117s \u012f kair\u0119",ltr:"I\u0161 kair\u0117s \u012f de\u0161in\u0119",classes:"Klas\u0117s",style:"Stilius",long_desc:"Ilgo apra\u0161o nuoroda",langcode:"Kalbos kodas",langdir:"Kalbos teksto kryptis",constrain_proportions:"Priverstin\u0117s proporcijos",preview:"Per\u017ei\u016bra",title:"Pavadinimas",general:"Bendra",tab_advanced:"I\u0161pl\u0117sta",tab_appearance:"I\u0161vaizda",tab_general:"Bendra"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/lv_dlg.js b/js/tiny_mce/plugins/advimage/langs/lv_dlg.js new file mode 100755 index 000000000..b4e6546e0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.advimage_dlg',{image_list:"Att\u0113lu saraksts",align_right:"Pa labi",align_left:"Pa kreisi",align_textbottom:"Teksta apak\u0161a",align_texttop:"Teksta aug\u0161a",align_bottom:"Apak\u0161a",align_middle:"Vidus",align_top:"Aug\u0161a",align_baseline:"Pati apak\u0161a",align:"Novietojums",hspace:"Horizont\u0101l\u0101 atstarpe",vspace:"Vertik\u0101l\u0101 atstarpe",dimensions:"Izm\u0113ri",border:"Apmale",list:"Att\u0113lu saraksts",alt:"Att\u0113la apraksts",src:"Att\u0113la URL",dialog_title:"Ievietot/Redi\u0123\u0113t att\u0113lu",missing_alt:"Vai esat p\u0101rliecin\u0101ti, ka v\u0113laties turpin\u0101t, neiek\u013caujot bildes aprakstu? Bez apraksta bilde neb\u016bs saprotama lietot\u0101jiem ar nesp\u0113ju redz\u0113t, vai lietotajiem, kas lieto teksta p\u0101rl\u016bkus, vai izsl\u0113gu\u0161i bil\u017eu r\u0101d\u012b\u0161anu.",example_img:"Att\u0113la izskata priek\u0161skats",misc:"Da\u017e\u0101di",mouseout:"kad pele \u0101rpus",mouseover:"kad pele virs",alt_image:"Otra bilde",swap_image:"Main\u012bt bildi",map:"Att\u0113lkarte",id:"Id",rtl:"No lab\u0101s uz kreiso",ltr:"No kreis\u0101s uz labo",classes:"Klases",style:"Stils",long_desc:"Saite uz garo aprakstu",langcode:"Valodas kods",langdir:"Valodas virziens",constrain_proportions:"Saglab\u0101t proporcijas",preview:"Priek\u0161skats",title:"Nosaukums",general:"Iestat\u012bjumi",tab_advanced:"Papildiestat\u012bjumi",tab_appearance:"Izskats",tab_general:"Iestat\u012bjumi"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/mk_dlg.js b/js/tiny_mce/plugins/advimage/langs/mk_dlg.js new file mode 100755 index 000000000..fd9b0b778 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.advimage_dlg',{image_list:"Lista slika",align_right:"Desno",align_left:"Levo",align_textbottom:"Dno teksta",align_texttop:"Vrh teksta",align_bottom:"Dno",align_middle:"Sredina",align_top:"Vrh",align_baseline:"Osnovna linija",align:"Poravnavanje",hspace:"Vodoravni razmak",vspace:"Okomiti razmak",dimensions:"Dimenzije",border:"Obrub",list:"Lista slika",alt:"Opis slike",src:"URL slike",dialog_title:"\u0412\u043c\u0435\u0442\u043d\u0438/uredi sliku",missing_alt:"Jeste li sigurni da \u017eelite izostaviti opis slike? Slika mo\u017ee biti nedostupna ljudima s pote\u0161ko\u0107ama ili onima koji koriste preglednike bez prikaza slika.",example_img:"Prikaz slike",misc:"Razno",mouseout:"za izlazak mi\u0161a van slike",mouseover:"za prelazak mi\u0161a preko slike",alt_image:"Alternativna slika",swap_image:"Izmjenjiva slika",map:"Karta slike",id:"Id",rtl:"S desna na levo",ltr:"S leva na desno",classes:"Klase",style:"Stil",long_desc:"Poveznica dugog opisa",langcode:"Kod jezika",langdir:"Smjer jezika",constrain_proportions:"Zadr\u017ei proporcije",preview:"Prikaz",title:"\u041d\u0430\u0441\u043b\u043e\u0432",general:"Osnovno",tab_advanced:"Napredno",tab_appearance:"Izgled",tab_general:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ml_dlg.js b/js/tiny_mce/plugins/advimage/langs/ml_dlg.js new file mode 100755 index 000000000..5a0c99e13 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/mn_dlg.js b/js/tiny_mce/plugins/advimage/langs/mn_dlg.js new file mode 100755 index 000000000..7cf152d95 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.advimage_dlg',{image_list:"\u0417\u0443\u0440\u0433\u0438\u0439\u043d \u0436\u0430\u0433\u0441\u0430\u0430\u043b\u0442",align_right:"\u0411\u0430\u0440\u0443\u0443\u043d",align_left:"\u0417\u04af\u04af\u043d",align_textbottom:"\u0411\u0438\u0447\u0432\u044d\u0440\u0438\u0439\u043d \u0434\u043e\u043e\u0440",align_texttop:"\u0411\u0438\u0447\u0432\u044d\u0440\u0438\u0439\u043d \u0434\u044d\u044d\u0440",align_bottom:"\u0414\u043e\u043e\u0440",align_middle:"\u0414\u0443\u043d\u0434",align_top:"\u0414\u044d\u044d\u0440",align_baseline:"\u041c\u04e9\u0440",align:"\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",hspace:"\u0425\u044d\u0432\u0442\u044d\u044d \u0430\u043b\u0441\u043b\u0430\u043b\u0442",vspace:"\u0411\u043e\u0441\u043e\u043e \u0430\u043b\u0441\u043b\u0430\u043b\u0442",dimensions:"\u0425\u044d\u043c\u0436\u044d\u044d\u0441",border:"\u0425\u04af\u0440\u044d\u044d",list:"\u0417\u0443\u0440\u0433\u0438\u0439\u043d \u0436\u0430\u0433\u0441\u0430\u0430\u043b\u0442",alt:"\u0422\u0430\u0439\u043b\u0431\u0430\u0440",src:"\u0425\u0430\u044f\u0433",dialog_title:"\u0417\u0443\u0440\u0430\u0433 \u043e\u0440\u0443\u0443\u043b\u0430\u0445/\u0437\u0430\u0441\u0430\u0445",missing_alt:"\u0422\u0430 \u04af\u043d\u044d\u0445\u044d\u044d\u0440 \u0442\u0430\u0439\u043b\u0431\u0430\u0440 \u0445\u0438\u0439\u0445\u0433\u04af\u0439 \u0431\u0430\u0439\u0445\u044b\u0433 \u0445\u04af\u0441\u044d\u0436 \u0431\u0430\u0439\u043d\u0430 \u0443\u0443? \u0417\u0430\u0440\u0438\u043c \u0445\u04e9\u0433\u0436\u043b\u0438\u0439\u043d \u0431\u044d\u0440\u0445\u0448\u044d\u044d\u043b\u0442\u044d\u0439 \u044d\u0441\u0432\u044d\u043b \u0431\u0438\u0447\u0432\u044d\u0440 \u0445\u04e9\u0442\u04e9\u0447 \u0430\u0448\u0438\u0433\u043b\u0430\u0436 \u0431\u0443\u0439 \u044d\u0441\u0432\u044d\u043b \u0437\u0443\u0440\u0430\u0433 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445\u044b\u0433 \u0445\u0430\u0430\u0441\u0430\u043d \u0445\u044d\u0440\u044d\u0433\u043b\u044d\u0433\u0447\u0438\u0434 \u0445\u0430\u043d\u0434\u0430\u0445 \u0431\u043e\u043b\u043e\u043c\u0436\u0433\u04af\u0439\u0433 \u0430\u043d\u0445\u0430\u0430\u0440\u043d\u0430 \u0443\u0443.",example_img:"\u041d\u044f\u0433\u0442\u043b\u0430\u043d \u0445\u0430\u0440\u0430\u0445",misc:"\u042f\u043d\u0437 \u0431\u04af\u0440\u0438\u0439\u043d \u0437\u04af\u0439\u043b\u0441",mouseout:"\u0425\u0443\u043b\u0433\u0430\u043d\u0430 \u0433\u0430\u0440\u0430\u0445\u0430\u0434",mouseover:"\u0425\u0443\u043b\u0433\u0430\u043d\u0430 \u043e\u0440\u043e\u0445\u043e\u0434",alt_image:"\u0425\u043e\u0451\u0440\u0434\u043e\u0433\u0447 \u0437\u0443\u0440\u0430\u0433",swap_image:"\u0417\u0443\u0440\u0430\u0433 \u0441\u043e\u043b\u0438\u0445",map:"\u0411\u04af\u0441\u0447\u0438\u043b\u0441\u0430\u043d \u0437\u0443\u0440\u0430\u0433",id:"\u0422\u0422",rtl:"\u0411\u0430\u0440\u0443\u0443\u043d\u0430\u0430\u0441 \u0437\u04af\u04af\u043d",ltr:"\u0417\u04af\u04af\u043d\u044d\u044d\u0441 \u0431\u0430\u0440\u0443\u0443\u043d",classes:"\u0410\u043d\u0433\u0438",style:"\u0424\u043e\u0440\u043c\u0430\u0442",long_desc:"\u0414\u044d\u043b\u0433\u044d\u0440\u044d\u043d\u0433\u04af\u0439 \u0442\u0430\u0439\u043b\u0431\u0430\u0440",langcode:"\u0425\u044d\u043b\u043d\u0438\u0439 \u043a\u043e\u0434",langdir:"\u0411\u0438\u0447\u0433\u0438\u0439\u043d \u0447\u0438\u0433\u043b\u044d\u043b",constrain_proportions:"\u0425\u044d\u043c\u0436\u044d\u044d\u0441",preview:"\u041d\u044f\u0433\u0442\u043b\u0430\u043d \u0445\u0430\u0440\u0430\u0445",title:"\u0413\u0430\u0440\u0447\u0438\u0433",general:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439",tab_advanced:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d",tab_appearance:"\u0425\u0430\u0440\u0430\u0433\u0434\u0430\u0446",tab_general:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ms_dlg.js b/js/tiny_mce/plugins/advimage/langs/ms_dlg.js new file mode 100755 index 000000000..c221996a4 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.advimage_dlg',{image_list:"Senarai imej",align_right:"Kanan",align_left:"Kiri",align_textbottom:"Teks bawah",align_texttop:"Teks atas",align_bottom:"Bawah",align_middle:"Tengah",align_top:"Atas",align_baseline:"Garis pangkal",align:"Penyelarian",hspace:"Ruangan ufuk",vspace:"Ruangan tegak",dimensions:"Dimensi",border:"Sempadan",list:"Senarai imej",alt:"Huraian imej",src:"URL imej",dialog_title:"Sisip/sunting imej",missing_alt:"Adakah anda pasti untuk teruskan tanpa masukkan huraian imej? Tanpa huraian, imej mungkin tidak dapat difahami oleh orang yang kurang upaya, orang yang menggunakan pelayaran teks.",example_img:"Penglihatan pratonton imej",misc:"Pelbagai",mouseout:"untuk tetikus di luar",mouseover:"untuk tetikus di atas",alt_image:"Imej alternatif",swap_image:"Tukar imej",map:"Imej map",id:"Id",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",classes:"Kelas-kelas",style:"Gaya",long_desc:"Pautan huraian panjang",langcode:"Kod bahasa",langdir:"Arah bahasa",constrain_proportions:"Kadar tahanan",preview:"Pratonton",title:"Tajuk",general:"Am",tab_advanced:"Lanjutan",tab_appearance:"Penglihatan",tab_general:"Am"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/my_dlg.js b/js/tiny_mce/plugins/advimage/langs/my_dlg.js new file mode 100755 index 000000000..46de27e8b --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.advimage_dlg',{image_list:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f \u1005\u102c\u101b\u1004\u103a\u1038",align_right:"\u100a\u102c",align_left:"\u1018\u101a\u103a",align_textbottom:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001\u1010\u103d\u1004\u103a \u1005\u102c\u101e\u102c\u1038",align_texttop:"\u1011\u102d\u1015\u103a\u1010\u103d\u1004\u103a \u1005\u102c\u101e\u102c\u1038",align_bottom:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001",align_middle:"\u1021\u101c\u101a\u103a",align_top:"\u1011\u102d\u1015\u103a",align_baseline:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001\u1019\u103b\u1009\u103a\u1038",align:"\u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1019\u103e\u102f",hspace:"\u1021\u101c\u103b\u103e\u102c\u1038\u101c\u102d\u102f\u1000\u103a \u1000\u103d\u1000\u103a\u101c\u1015\u103a",vspace:"\u1031\u1012\u102b\u1004\u103a\u101c\u102d\u102f\u1000\u103a \u1000\u103d\u1000\u103a\u101c\u1015\u103a",dimensions:"\u1021\u1010\u102d\u102f\u1004\u103a\u1038\u1021\u1011\u103d\u102c\u1019\u103b\u102c\u1038",border:"\u1014\u101a\u103a\u1005\u100a\u103a\u1038",list:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f \u1005\u102c\u101b\u1004\u103a\u1038",alt:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f \u1005\u102c\u100a\u103d\u103e\u1014\u103a\u1038",src:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f URL",dialog_title:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f \u1011\u100a\u103a\u1037/\u103c\u1015\u1004\u103a",missing_alt:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f\u1005\u102c\u100a\u103d\u103e\u1014\u103a\u1038\u1019\u1015\u102b\u1018\u1032 \u1006\u1000\u103a\u101c\u1000\u103a\u101c\u102f\u1015\u103a\u1031\u1006\u102c\u1004\u103a\u101c\u102d\u102f\u1010\u102c \u1031\u101e\u1001\u103b\u102c\u101b\u1032\u1037\u101c\u102c\u1038? \u1011\u102d\u102f\u101e\u102d\u102f\u1037 \u1031\u1016\u102c\u103a\u103c\u1015\u1001\u103b\u1000\u103a \u1005\u102c\u100a\u103d\u103e\u1014\u103a\u1038 \u1019\u1015\u102b\u101c\u103b\u103e\u1004\u103a \u101b\u102f\u1015\u103a\u1015\u1036\u102f\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1015\u102d\u1010\u103a\u1011\u102c\u1038\u103c\u1015\u102e\u1038 Web \u1000\u102d\u102f\u103c\u1000\u100a\u103a\u1037\u101b\u103e\u102f\u1031\u1014\u1031\u101e\u102c (\u101e\u102d\u102f\u1037) \u1005\u102c\u101e\u102c\u1038 \u1018\u1031\u101b\u102c\u1000\u103a\u1007\u102c\u1000\u102d\u102f \u1021\u101e\u1036\u102f\u1038\u103c\u1015\u102f\u1031\u1014\u1031\u101e\u102c (\u101e\u102d\u102f\u1037) \u1000\u102d\u102f\u101a\u103a\u1001\u1014\u1039\u1013\u102c\u1019\u101e\u1014\u103a\u1005\u103d\u1019\u103a\u1038\u1031\u101e\u102c \u1021\u1001\u103b\u102d\u102f\u1037\u101e\u1036\u102f\u1038\u101e\u1030\u1019\u103b\u102c\u1038 \u1011\u102d\u102f\u101b\u102f\u1015\u103a\u1015\u1036\u102f\u1000\u102d\u102f \u101b\u101a\u1030\u101e\u1036\u102f\u1038\u1005\u103d\u1032\u1014\u102d\u102f\u1004\u103a\u1019\u100a\u103a \u1019\u101f\u102f\u1010\u103a\u1015\u102b\u104b",example_img:"\u1021\u1005\u1019\u103a\u1038\u103c\u1000\u100a\u103a\u1037 \u101b\u102f\u1015\u103a\u1015\u1036\u102f \u1021\u101e\u103d\u1004\u103a\u1021\u103c\u1015\u1004\u103a",misc:"\u1031\u101e\u102c\u1004\u103a\u1038\u1031\u103c\u1015\u102c\u1004\u103a\u1038\u1031\u1011\u103d\u101c\u102c",mouseout:"For Mouse Out",mouseover:"For Mouse Over",alt_image:"\u1021\u1011\u1030\u1038\u103c\u1015\u102f \u101b\u102f\u1015\u103a\u1015\u1036\u102f",swap_image:"Swap Image",map:"Image Map",id:"ID",rtl:"\u100a\u102c\u1019\u103e \u1018\u101a\u103a",ltr:"\u1018\u101a\u103a\u1019\u103e \u100a\u102c",classes:"Class \u1019\u103b\u102c\u1038",style:"\u1005\u1010\u102d\u102f\u1004\u103a",long_desc:"\u101b\u103e\u100a\u103a\u101c\u103b\u102c\u1038\u1031\u101e\u102c \u1031\u1016\u102c\u103a\u103c\u1015\u1001\u103b\u1000\u103a \u1001\u103b\u102d\u1010\u103a\u1006\u1000\u103a\u101c\u102d\u1015\u103a\u1005\u102c",langcode:"\u1018\u102c\u101e\u102c\u1005\u1000\u102c\u1038 \u1000\u102f\u1010\u103a",langdir:"\u1005\u102c\u1031\u101b\u1038\u101e\u102c\u1038\u1019\u103e\u102f \u1025\u102e\u1038\u1010\u100a\u103a\u1001\u103b\u1000\u103a",constrain_proportions:"\u1021\u1001\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038 \u1011\u102d\u1014\u103a\u1038\u100a\u102d\u103e",preview:"\u1021\u1005\u1019\u103a\u1038\u103c\u1000\u100a\u103a\u1037",title:"\u1031\u1001\u102b\u1004\u103a\u1038\u1005\u102e\u1038\u1021\u1019\u100a\u103a",general:"\u1021\u1031\u1011\u103d\u1031\u1011\u103d",tab_advanced:"\u1021\u1011\u1030\u1038",tab_appearance:"\u1021\u101e\u103d\u1004\u103a\u1021\u103c\u1015\u1004\u103a",tab_general:"\u1021\u1031\u1011\u103d\u1031\u1011\u103d"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/nb_dlg.js b/js/tiny_mce/plugins/advimage/langs/nb_dlg.js new file mode 100755 index 000000000..9d6a6e377 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.advimage_dlg',{"image_list":"Bildeliste","align_right":"H\u00f8yre","align_left":"Venstre","align_textbottom":"Tekst bunn","align_texttop":"Tekst topp","align_bottom":"Bunn","align_middle":"Midtstilt","align_top":"Topp","align_baseline":"Grunnlinje",align:"Justering",hspace:"Horisontal avstand",vspace:"Vertikal avstand",dimensions:"Dimensjoner",border:"Ramme",list:"Bildeliste",alt:"Bildebeskrivelse",src:"Bildets URL","dialog_title":"Sett inn / endre bilde","missing_alt":"Er du sikker p\u00e5 at du vil fortsette uten \u00e5 sette inn en beskrivelse av bildet? Uten beskrivelse vil bildet ikke gi mening for enkelte funksjonshemmede eller for personer som bruker en nettleser med bildevisning avsl\u00e5tt.","example_img":"Utseende Forh\u00e5ndsvisning bilde",misc:"Annet",mouseout:"for musepeker utenfor",mouseover:"for musepeker p\u00e5","alt_image":"Alternativt bilde","swap_image":"Bytt bilde",map:"Bildekart",id:"Id",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",classes:"Klasser",style:"Stil","long_desc":"Lang beskrivelse",langcode:"Spr\u00e5kkode",langdir:"Skriftretning","constrain_proportions":"Behold st\u00f8rrelsesforhold",preview:"Forh\u00e5ndsvisning",title:"Tittel",general:"Generelt","tab_advanced":"Avansert","tab_appearance":"Utseende","tab_general":"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/nl_dlg.js b/js/tiny_mce/plugins/advimage/langs/nl_dlg.js new file mode 100755 index 000000000..a004b3e24 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.advimage_dlg',{"image_list":"Lijst","align_right":"Rechts","align_left":"Links","align_textbottom":"Onderkant tekst","align_texttop":"Bovenkant tekst","align_bottom":"Onder","align_middle":"Midden","align_top":"Boven","align_baseline":"Basislijn",align:"Uitlijning",hspace:"Horizontale ruimte",vspace:"Verticale ruimte",dimensions:"Afmetingen",border:"Rand",list:"Lijst",alt:"Beschrijving",src:"Bestand/URL","dialog_title":"Afbeelding invoegen/bewerken","missing_alt":"Wilt u de afbeelding zonder beschrijving invoegen? De afbeelding wordt dan mogelijk niet opgemerkt door mensen met een visuele handicap, of welke zonder afbeeldingen browsen.","example_img":"Voorbeeldweergave",misc:"Diversen",mouseout:"Bij muis uit",mouseover:"Bij muis over","alt_image":"Alternatieve afbeeldingen","swap_image":"Afbeelding wisselen",map:"Afbeeldingsplattegrond",id:"Id",rtl:"Van rechts naar links",ltr:"Van links naar rechts",classes:"Klasses",style:"Stijl","long_desc":"Uitgebreide beschrijving",langcode:"Taalcode",langdir:"Taalrichting","constrain_proportions":"Verhouding behouden",preview:"Voorbeeld",title:"Titel",general:"Algemeen","tab_advanced":"Geavanceerd","tab_appearance":"Weergave","tab_general":"Algemeen"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/nn_dlg.js b/js/tiny_mce/plugins/advimage/langs/nn_dlg.js new file mode 100755 index 000000000..60cec12bb --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.advimage_dlg',{image_list:"Liste med bilete",align_right:"H\u00f8gre",align_left:"Venstre",align_textbottom:"Tekst botn",align_texttop:"Tekst topp",align_bottom:"Botn",align_middle:"Midtstilt",align_top:"Topp",align_baseline:"Basislinje",align:"Justering",hspace:"Horisontal avstand",vspace:"Vertikal avstand",dimensions:"Dimensjonar",border:"Ramme",list:"Bileteliste",alt:"Bileteomtale",src:"Bilete-URL",dialog_title:"Set inn / endre bilete",missing_alt:"Er du sikker p\u00e5 at du vil fortsetje utan \u00e5 setje inn ei omtale av biletet? Utan omtale vil biletet ikkje gje meining for enkelte funksjonshemma eller for personar som bruker ein nettlesar med biletvisinga avsl\u00e5tt.",example_img:"Sj\u00e5 f\u00f8rebels utkast av bilete",misc:"Anna",mouseout:"for musepeikar utanfor",mouseover:"for musepeikar over",alt_image:"Alternativt bilete",swap_image:"Byt bilete",map:"Biletekart",id:"Id",rtl:"H\u00f8gre mot venstre",ltr:"Venstre mot h\u00f8gre",classes:"Klasser",style:"Stil",long_desc:"Lang omtale",langcode:"Spr\u00e5kkode",langdir:"Skriftretning",constrain_proportions:"Behald proporsjonar",preview:"Sj\u00e5 f\u00f8rebels utkast",title:"Tittel",general:"Generelt",tab_advanced:"Avansert",tab_appearance:"Utsj\u00e5nad",tab_general:"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/no_dlg.js b/js/tiny_mce/plugins/advimage/langs/no_dlg.js new file mode 100755 index 000000000..1f2d40f52 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.advimage_dlg',{"image_list":"Liste over bilder","align_right":"H\u00f8yre","align_left":"Venstre","align_textbottom":"Tekst bunn","align_texttop":"Tekst topp","align_bottom":"Bunn","align_middle":"Midtstilt","align_top":"Topp","align_baseline":"Basislinje",align:"Justering",hspace:"Horisontal avstand",vspace:"Vertikal avstand",dimensions:"Dimensjoner",border:"Ramme",list:"Bildeliste",alt:"Bildebeskrivelse",src:"Bilde URL","dialog_title":"Sett inn/editer bilde","missing_alt":"Er du sikker du vil fortsette uten \u00e5 sette inn bildebeskrivelse? Uten beskrivelse vil ikke bildet gi mening for enkelte funksjonshemmde eller personer som bruker nettleser med avsl\u00e5tt bildevising.","example_img":"Utseende forh\u00e5ndsvisning",misc:"Diverse",mouseout:"for musepeker utenfor",mouseover:"for musepeker over","alt_image":"Alternativt bilde","swap_image":"Bytt bilde",map:"Bildekart",id:"Id",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",classes:"Klasse",style:"Stil","long_desc":"Lang beskrivelse",langcode:"Spr\u00e5k kode",langdir:"Skriftretning","constrain_proportions":"Behold proporsjoner",preview:"Forh\u00e5ndsvisning",title:"Tittel",general:"Generelt","tab_advanced":"Avansert","tab_appearance":"Utseende","tab_general":"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/pl_dlg.js b/js/tiny_mce/plugins/advimage/langs/pl_dlg.js new file mode 100755 index 000000000..fa8b023a5 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.advimage_dlg',{"image_list":"Lista obrazk\u00f3w","align_right":"Prawy","align_left":"Lewy","align_textbottom":"Tekst dolny","align_texttop":"Tekst g\u00f3rny","align_bottom":"Dolny","align_middle":"\u015arodkowy","align_top":"G\u00f3rny","align_baseline":"G\u0142\u00f3wna linia",align:"Wyr\u00f3wnanie",hspace:"Odst\u0119p poziomy",vspace:"Odst\u0119p pionowy",dimensions:"Rozmiary",border:"Obramowanie",list:"Lista obrazk\u00f3w",alt:"Opis obrazka",src:"URL obrazka","dialog_title":"Wklej/edytuj obraz","missing_alt":"Czy jeste\u015b pewien, \u017ce chcesz kontynuowa\u0107 bez opisu obrazka? Obrazek bez opisu mo\u017ce nie by\u0107 dost\u0119pny dla u\u017cytkownik\u00f3w u\u017cywaj\u0105cych tekstowe przegl\u0105darki lub przegl\u0105daj\u0105cych stron\u0119 z wy\u0142\u0105czonymi obrazkami.","example_img":"Podgl\u0105d wygl\u0105du obrazka",misc:"R\u00f3\u017cne",mouseout:"dla mouseout",mouseover:"dla mouseover","alt_image":"alternatywny obrazek","swap_image":"Zamiana obrazka",map:"Mapa obrazu",id:"Id",rtl:"Z prawej do lewej",ltr:"Z lewej do prawej",classes:"Klasy",style:"Styl","long_desc":"D\u0142ugi opis linku",langcode:"Kod j\u0119zyka",langdir:"Kierunek j\u0119zyka","constrain_proportions":"Zachowaj proporcje",preview:"Podgl\u0105d",title:"Tytu\u0142",general:"Og\u00f3lne","tab_advanced":"Zaawansowane","tab_appearance":"Wygl\u0105d","tab_general":"Og\u00f3lne"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ps_dlg.js b/js/tiny_mce/plugins/advimage/langs/ps_dlg.js new file mode 100755 index 000000000..58a4ac5ce --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/pt_dlg.js b/js/tiny_mce/plugins/advimage/langs/pt_dlg.js new file mode 100755 index 000000000..ba7d07e3a --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.advimage_dlg',{image_list:"Lista de imagens",align_right:"Direita",align_left:"Esquerda",align_textbottom:"Base do texto",align_texttop:"Topo do texto",align_bottom:"Abaixo",align_middle:"Meio",align_top:"Topo",align_baseline:"Sobre a linha de texto",align:"Alinhamento",hspace:"Espa\u00e7o horizontal",vspace:"Espa\u00e7o vertical",dimensions:"Dimens\u00f5es",border:"Limite",list:"Lista de imagens",alt:"Descri\u00e7\u00e3o da imagem",src:"Endere\u00e7o da imagem",dialog_title:"Inserir/editar imagem",missing_alt:"Tem certeza que deseja continuar sem acrescentar uma descri\u00e7\u00e3o \u00e0 imagem? (Isto pode gerar problemas de acessibilidade em alguns navegadores)",example_img:"Pr\u00e9-Visualiza\u00e7\u00e3o",misc:"Misto",mouseout:"mouseout",mouseover:"mouseover",alt_image:"Imagem alternativa",swap_image:"Trocar imagem",map:"Mapa de imagem",id:"Id",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",classes:"Classes",style:"Estilo",long_desc:"Descri\u00e7\u00e3o extensa",langcode:"C\u00f3digo do idioma",langdir:"Dire\u00e7\u00e3o do texto",constrain_proportions:"Manter propor\u00e7\u00f5es",preview:"Pr\u00e9-Visualiza\u00e7\u00e3o",title:"T\u00edtulo",general:"Geral",tab_advanced:"Avan\u00e7ado",tab_appearance:"Apar\u00eancia",tab_general:"Geral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ro_dlg.js b/js/tiny_mce/plugins/advimage/langs/ro_dlg.js new file mode 100755 index 000000000..2df6247d0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.advimage_dlg',{image_list:"List\u0103 de imagini",align_right:"Dreapta",align_left:"St\u00e2nga",align_textbottom:"Textul jos",align_texttop:"Textul sus",align_bottom:"Jos",align_middle:"La mijloc",align_top:"Sus",align_baseline:"Baseline",align:"Aliniere",hspace:"Spa\u0163iu orizontal",vspace:"Spa\u0163iu vertical",dimensions:"Dimensiuni",border:"Bordur\u0103",list:"List\u0103 imagini",alt:"Descriere imagine",src:"URL imagine",dialog_title:"Inserare/editare imagine",missing_alt:"Sigur dori\u0163i s\u0103 continua\u0163i f\u0103r\u0103 a introduce o descriere a imaginii?",example_img:"Imagine mic\u0103",misc:"Diverse",mouseout:"Pentru maus \u00een afar\u0103",mouseover:"Pentru maus deasupra",alt_image:"Imagine alternativ\u0103",swap_image:"Schimb\u0103 imaginea",map:"Hart\u0103 imagine",id:"Id",rtl:"De la dreapta la st\u00e2nga",ltr:"De la st\u00e2nga la dreapta",classes:"Clase",style:"Stil",long_desc:"Descriere leg\u0103tur\u0103",langcode:"Cod limb\u0103",langdir:"Direc\u0163ie limb\u0103",constrain_proportions:"Men\u0163ine propor\u0163ii",preview:"Previzualizare",title:"Titlu",general:"General",tab_advanced:"Avansat",tab_appearance:"Afi\u015fare",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ru_dlg.js b/js/tiny_mce/plugins/advimage/langs/ru_dlg.js new file mode 100755 index 000000000..2b984e5c3 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.advimage_dlg',{"image_list":"\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a","align_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_textbottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0430","align_texttop":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0430","align_bottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_middle":"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443","align_top":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_baseline":"\u041f\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043b\u0438\u043d\u0438\u0438",align:"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435",hspace:"\u0413\u043e\u0440\u0438\u0437. \u043e\u0442\u0441\u0442\u0443\u043f",vspace:"\u0412\u0435\u0440\u0442. \u043e\u0442\u0441\u0442\u0443\u043f",dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440",border:"\u0413\u0440\u0430\u043d\u0438\u0446\u0430",list:"\u0421\u043f\u0438\u0441\u043e\u043a",alt:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",src:"\u0410\u0434\u0440\u0435\u0441","dialog_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","missing_alt":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0431\u0435\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f? \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c.","example_img":"\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",misc:"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b",mouseout:"\u0412 \u043f\u043e\u043a\u043e\u0435",mouseover:"\u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438","alt_image":"\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","swap_image":"\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",map:"\u041a\u0430\u0440\u0442\u0430 \u0441\u0441\u044b\u043b\u043e\u043a",id:"\u0418\u043c\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e",ltr:"\u0421\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e",classes:"\u041a\u043b\u0430\u0441\u0441\u044b",style:"\u0421\u0442\u0438\u043b\u044c","long_desc":"\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",langcode:"\u041a\u043e\u0434 \u044f\u0437\u044b\u043a\u0430",langdir:"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","constrain_proportions":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438",preview:"\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",title:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",general:"\u041e\u0431\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b","tab_advanced":"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e","tab_appearance":"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435","tab_general":"\u041e\u0431\u0449\u0435\u0435"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sc_dlg.js b/js/tiny_mce/plugins/advimage/langs/sc_dlg.js new file mode 100755 index 000000000..ff2ef1bf5 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.advimage_dlg',{image_list:"\u56fe\u7247\u5217\u8868",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u4e0b\u65b9",align_middle:"\u5c45\u4e2d",align_top:"\u4e0a\u65b9",align_baseline:"\u57fa\u7ebf",align:"\u5bf9\u9f50\u65b9\u5f0f",hspace:"\u5782\u76f4\u95f4\u8ddd",vspace:"\u6c34\u51c6\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u5217\u8868",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247\u7f51\u5740",dialog_title:"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247",missing_alt:"\u8bf7\u95ee\u662f\u5426\u786e\u5b9a\u4e0d\u4e3a\u56fe\u7247\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff1f\u82e5\u6ca1\u6709\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff0c\u5f53\u7528\u6237\u4f7f\u7528\u4e0d\u8bfb\u5165\u56fe\u7247\u6216\u6587\u5b57\u4f53\u7684\u6d41\u89c8\u5668\u65f6\uff0c\u5c06\u4f1a\u770b\u4e0d\u5230\u8fd9\u4e2a\u56fe\u7247\u3002 ",example_img:"\u9884\u89c8\u56fe\u7247",misc:"\u5176\u4ed6",mouseout:"\u6ed1\u9f20\u79fb\u51fa\u56fe\u7247",mouseover:"\u6ed1\u9f20\u79fb\u5165\u56fe\u7247",alt_image:"\u66ff\u6362\u56fe\u7247",swap_image:"\u5bf9\u6362\u56fe\u7247",map:"\u56fe\u7247\u5730\u56fe",id:"Id",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",classes:"\u7c7b\u578b",style:"\u6837\u5f0f",long_desc:"\u957f\u63cf\u8ff0\u8fde\u7ed3",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u67e5\u627e",general:"\u4e00\u822c",tab_advanced:"\u9ad8\u7ea7",tab_appearance:"\u5916\u89c2",tab_general:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/se_dlg.js b/js/tiny_mce/plugins/advimage/langs/se_dlg.js new file mode 100755 index 000000000..5caed52d9 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.advimage_dlg',{image_list:"Bildlista",align_right:"V\u00e4nster",align_left:"H\u00f6ger",align_textbottom:"Botten av texten",align_texttop:"Toppen av texten",align_bottom:"Botten",align_middle:"Mitten",align_top:"Toppen",align_baseline:"Baslinje",align:"Justering",hspace:"Horisontalrymd",vspace:"Vertikalrymd",dimensions:"Dimensioner",border:"Ram",list:"Bildlista",alt:"Bildens beskrivning",src:"Bildens URL",dialog_title:"Infoga/redigera bild",missing_alt:"Vill du forts\u00e4tta utan bildbeskrivning. Icke grafiska webbl\u00e4sare kommer inte kunna tolka bilden f\u00f6r anv\u00e4ndaren.",example_img:"Exempelbild",misc:"\u00d6vrigt",mouseout:"vid musen utanf\u00f6r",mouseover:"vid musen ovanf\u00f6r",alt_image:"Alternativbild",swap_image:"Utbytningsbild",map:"L\u00e4nkkarta",id:"Id",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",classes:"Klasser",style:"Stil",long_desc:"L\u00e5ng beskrivning",langcode:"Spr\u00e5kkod",langdir:"Skriftriktning",constrain_proportions:"Bibeh\u00e5ll proportionerna",preview:"F\u00f6rhandsvisning",title:"Titel",general:"Generellt",tab_advanced:"Avancerat",tab_appearance:"Utseende",tab_general:"Generellt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/si_dlg.js b/js/tiny_mce/plugins/advimage/langs/si_dlg.js new file mode 100755 index 000000000..54e9220c3 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sk_dlg.js b/js/tiny_mce/plugins/advimage/langs/sk_dlg.js new file mode 100755 index 000000000..227f7668c --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.advimage_dlg',{image_list:"Zoznam obr\u00e1zkov",align_right:"Vpravo",align_left:"V\u013eavo",align_textbottom:"So spodkom riadku",align_texttop:"S vrcholom riadku",align_bottom:"Dole",align_middle:"Na stred riadku",align_top:"Hore",align_baseline:"Na z\u00e1klad\u0148u",align:"Zarovnanie",hspace:"Horizont\u00e1lne odsadenie",vspace:"Vertik\u00e1lne odsadenie",dimensions:"Rozmery",border:"Or\u00e1movanie",list:"Zoznam obr\u00e1zkov",alt:"Popis obr\u00e1zku",src:"URL obr\u00e1zka",dialog_title:"Vlo\u017ei\u0165/upravi\u0165 obr\u00e1zok",missing_alt:"Naozaj chcete pokra\u010dova\u0165 bez vlo\u017een\u00e9ho popisu obr\u00e1zka? Bez popisu m\u00f4\u017ee by\u0165 obr\u00e1zok nepr\u00edstupn\u00fd u\u017e\u00edvate\u013eom so zrakov\u00fdm postihnut\u00edm, u\u017e\u00edvate\u013eom textov\u00fdch prehliada\u010dov alebo u\u017e\u00edvate\u013eom, ktor\u00ed maj\u00fa vypnut\u00e9 zobrazovanie obr\u00e1zkov.",example_img:"Pr\u00edklad obr\u00e1zka",misc:"R\u00f4zne",mouseout:"Po odjazden\u00ed my\u0161i",mouseover:"Pri nabehnut\u00ed my\u0161i",alt_image:"Alternat\u00edvny obr\u00e1zok",swap_image:"Prepnutie obr\u00e1zka",map:"Obr\u00e1zkov\u00e1 mapa",id:"ID",rtl:"Sprava do\u013eava",ltr:"Z\u013eava doprava",classes:"Triedy",style:"\u0160t\u00fdl",long_desc:"Dlh\u00fd popis",langcode:"K\u00f3d jazyka",langdir:"Smer textu",constrain_proportions:"Zachova\u0165 pomer str\u00e1n",preview:"N\u00e1h\u013ead",title:"Titulok",general:"Obecn\u00e9 parametre",tab_advanced:"Roz\u0161\u00edren\u00e9",tab_appearance:"Vzh\u013ead",tab_general:"Obecn\u00e9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sl_dlg.js b/js/tiny_mce/plugins/advimage/langs/sl_dlg.js new file mode 100755 index 000000000..4a1b53f3e --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.advimage_dlg',{image_list:"Seznam slik",align_right:"desno, plavajo\u010de",align_left:"levo, plavajo\u010de",align_textbottom:"dno besedila",align_texttop:"vrh besedila",align_bottom:"dno",align_middle:"sredina",align_top:"vrh",align_baseline:"osnovna \u010drta",align:"Poravnava",hspace:"Prostor le/de",vspace:"Prostor zg/sp",dimensions:"Dimenzije",border:"Obroba",list:"Seznam slik",alt:"Opis slike",src:"Naslov URL slike",dialog_title:"Vstavi/uredi sliko",missing_alt:"Zares \u017eelite nadaljevati, brez da bi dolo\u010dili opis slike? Brez njega slika nekaterim uporabnikom ne bo na voljo (izklopljen prikaz slik, tekstni brskalnik ali ljudje s slab\u0161im vidom).",example_img:"Predogled izgleda",misc:"Razno",mouseout:"pri mi\u0161ki izven",mouseover:"pri mi\u0161ki nad",alt_image:"Nadomestna slika",swap_image:"Zamenjava slike",map:"Karta slike",id:"Id",rtl:"Od desne proti levi",ltr:"Od leve proti desni",classes:"Razredi",style:"Slog",long_desc:"Povezava do opisa",langcode:"Koda jezika",langdir:"Smer jezika",constrain_proportions:"Zakleni razmerje",preview:"Predogled",title:"Naslov",general:"Splo\u0161no",tab_advanced:"Napredno",tab_appearance:"Izgled",tab_general:"Splo\u0161no"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sq_dlg.js b/js/tiny_mce/plugins/advimage/langs/sq_dlg.js new file mode 100755 index 000000000..1e400c7b7 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.advimage_dlg',{image_list:"Lista e fotove",align_right:"Djathtas",align_left:"Majtas",align_textbottom:"Posht\u00eb tekstit",align_texttop:"Sip\u00ebr tekstit",align_bottom:"Fund",align_middle:"Mes",align_top:"Krye",align_baseline:"Vij\u00eb fundore",align:"Drejtimi",hspace:"Hap\u00ebsira horizontale",vspace:"Hap\u00ebsira vertikale",dimensions:"P\u00ebrmasat",border:"Korniza",list:"Lista e fotove",alt:"P\u00ebrshkrimi i fotos",src:"URL e fotos",dialog_title:"Fut/edito foto",missing_alt:"Jeni t\u00eb sigurt q\u00eb doni t\u00eb vazhdoni pa p\u00ebrfshir\u00eb nj\u00eb p\u00ebrshkrim alternativ? Pa t\u00eb, foto mund t\u00eb jet\u00eb e pa aksesueshme nga njer\u00ebz me shikim t\u00eb kufizuar, q\u00eb p\u00ebrdorin shfletues q\u00eb nuk i shfaqin fotot apo i kan\u00eb \u00e7aktivizuar ato.",example_img:"Paraqitje e fotos",misc:"T\u00eb Ndryshme",mouseout:"n\u00eb mouse-in jasht\u00eb",mouseover:"n\u00eb mouse-in sip\u00ebr",alt_image:"P\u00ebrshkrimi alternativ",swap_image:"Nd\u00ebrro foto",map:"Harta e fotos",id:"Id",rtl:"Djathtas-Majtas",ltr:"Majtas-Djathtas",classes:"Klasat",style:"Stili",long_desc:"Lidhja e p\u00ebrshkrimit t\u00eb gjat\u00eb",langcode:"Kodi i gjuh\u00ebs",langdir:"Drejtimi i gjuh\u00ebs",constrain_proportions:"Ruaj raportet",preview:"Paraqitje",title:"Titulli",general:"T\u00eb P\u00ebrgjithshme",tab_advanced:"T\u00eb Avancuara",tab_appearance:"Pamja",tab_general:"T\u00eb P\u00ebrgjithshme"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sr_dlg.js b/js/tiny_mce/plugins/advimage/langs/sr_dlg.js new file mode 100755 index 000000000..bfc6cee31 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.advimage_dlg',{image_list:"Lista slika",align_right:"Desno",align_left:"Levo",align_textbottom:"Dno teksta",align_texttop:"Vrh teksta",align_bottom:"Dno",align_middle:"Sredina",align_top:"Vrh",align_baseline:"Osnovna linija",align:"Poravnavanje",hspace:"Horizontalni razmak",vspace:"Vertikalni razmak",dimensions:"Dimenzije",border:"Ivice",list:"Lista slika",alt:"Opis slike",src:"URL slike",dialog_title:"Ubaci/uredi sliku",missing_alt:"Da li ste sigurni da \u017eelite da izostavite opis slike? Slika mo\u017ee biti nedostupna ljudima s pote\u0161ko\u0107ama ili onima koji koriste pretra\u017eiva\u010de bez prikaza slika.",example_img:"Prikaz slike",misc:"Razno",mouseout:"za izlazak mi\u0161a sa slike",mouseover:"za prelazak mi\u0161a preko slike",alt_image:"Alternativna slika",swap_image:"Promeni slika",map:"Mapa slike",id:"Id",rtl:"S desna na levo",ltr:"S leva na desno",classes:"Klase",style:"Stil",long_desc:"Link dugog opisa",langcode:"Kod jezika",langdir:"Smer jezika",constrain_proportions:"Zadr\u017ei proporcije",preview:"Pregled",title:"Naslov",general:"Osnovno",tab_advanced:"Napredno",tab_appearance:"Izgled",tab_general:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/sv_dlg.js b/js/tiny_mce/plugins/advimage/langs/sv_dlg.js new file mode 100755 index 000000000..3cc2c99e0 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.advimage_dlg',{"image_list":"Bildlista","align_right":"H\u00f6ger","align_left":"V\u00e4nster","align_textbottom":"Botten av texten","align_texttop":"Toppen av texten","align_bottom":"Botten","align_middle":"Mitten","align_top":"Toppen","align_baseline":"Baslinje",align:"Justering",hspace:"Horisontalrymd",vspace:"Vertikalrymd",dimensions:"Dimensioner",border:"Ram",list:"Bildlista",alt:"Bildens beskrivning",src:"Bildens URL","dialog_title":"Infoga/redigera bild","missing_alt":"Vill du forts\u00e4tta utan bildbeskrivning?\\nIcke grafiska webbl\u00e4sare kommer inte att kunna tolka bilden f\u00f6r anv\u00e4ndaren.","example_img":"Exempelbild",misc:"\u00d6vrigt",mouseout:"vid musen utanf\u00f6r",mouseover:"vid musen ovanf\u00f6r","alt_image":"Alternativbild","swap_image":"Utbytningsbild",map:"L\u00e4nkkarta",id:"Id",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",classes:"Klasser",style:"Stil","long_desc":"L\u00e5ng beskrivning",langcode:"Spr\u00e5kkod",langdir:"Skriftriktning","constrain_proportions":"Bibeh\u00e5ll proportionerna",preview:"F\u00f6rhandsvisning",title:"Titel",general:"Generellt","tab_advanced":"Avancerat","tab_appearance":"Utseende","tab_general":"Generellt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ta_dlg.js b/js/tiny_mce/plugins/advimage/langs/ta_dlg.js new file mode 100755 index 000000000..bd7e4a36d --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/te_dlg.js b/js/tiny_mce/plugins/advimage/langs/te_dlg.js new file mode 100755 index 000000000..764258dc1 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/th_dlg.js b/js/tiny_mce/plugins/advimage/langs/th_dlg.js new file mode 100755 index 000000000..a2cf71d75 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.advimage_dlg',{image_list:"\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e23\u0e39\u0e1b",align_right:"\u0e02\u0e27\u0e32",align_left:"\u0e0b\u0e49\u0e32\u0e22",align_textbottom:"\u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23\u0e2d\u0e22\u0e39\u0e48\u0e25\u0e48\u0e32\u0e07",align_texttop:"\u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23\u0e2d\u0e22\u0e39\u0e48\u0e1a\u0e19",align_bottom:"\u0e25\u0e48\u0e32\u0e07",align_middle:"\u0e01\u0e25\u0e32\u0e07",align_top:"\u0e1a\u0e19",align_baseline:"\u0e40\u0e2a\u0e49\u0e19\u0e1e\u0e37\u0e49\u0e19",align:"\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e08\u0e31\u0e14\u0e27\u0e32\u0e07",hspace:"\u0e23\u0e30\u0e22\u0e30\u0e2b\u0e48\u0e32\u0e07\u0e41\u0e19\u0e27\u0e19\u0e2d\u0e19",vspace:"\u0e23\u0e30\u0e22\u0e30\u0e2b\u0e48\u0e32\u0e07\u0e41\u0e19\u0e27\u0e15\u0e31\u0e49\u0e07",dimensions:"\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07",border:"\u0e01\u0e23\u0e2d\u0e1a",list:"\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e23\u0e39\u0e1b",alt:"\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e23\u0e39\u0e1b",src:"\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e23\u0e39\u0e1b",dialog_title:"\u0e40\u0e1e\u0e34\u0e48\u0e21/\u0e41\u0e01\u0e49\u0e44\u0e02 image",missing_alt:"\u0e04\u0e38\u0e13\u0e41\u0e19\u0e48\u0e43\u0e08\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48\u0e27\u0e48\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e43\u0e2a\u0e48\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e23\u0e39\u0e1b\u0e20\u0e32\u0e1e ? \u0e01\u0e32\u0e23\u0e43\u0e2a\u0e48\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e23\u0e39\u0e1b\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e1c\u0e39\u0e49\u0e1e\u0e34\u0e01\u0e32\u0e23\u0e17\u0e32\u0e07\u0e2a\u0e32\u0e22\u0e15\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e23\u0e39\u0e49\u0e44\u0e14\u0e49\u0e27\u0e48\u0e32\u0e23\u0e39\u0e1b\u0e04\u0e38\u0e13\u0e04\u0e37\u0e2d\u0e23\u0e39\u0e1b\u0e2d\u0e30\u0e44\u0e23",example_img:"\u0e14\u0e39\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b",misc:"\u0e40\u0e1a\u0e47\u0e14\u0e40\u0e15\u0e25\u0e47\u0e14",mouseout:"\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e2d\u0e32\u0e40\u0e21\u0e49\u0e32\u0e2a\u0e4c\u0e2d\u0e2d\u0e01",mouseover:"\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e2d\u0e32\u0e40\u0e21\u0e49\u0e32\u0e2a\u0e4c\u0e0a\u0e35\u0e49",alt_image:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e1b",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"\u0e02\u0e27\u0e32\u0e44\u0e1b\u0e0b\u0e49\u0e32\u0e22",ltr:"\u0e0b\u0e49\u0e32\u0e22\u0e44\u0e1b\u0e02\u0e27\u0e32",classes:"\u0e04\u0e25\u0e32\u0e2a",style:"\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a",long_desc:"\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",langcode:"\u0e42\u0e04\u0e49\u0e14\u0e20\u0e32\u0e29\u0e32",langdir:"\u0e17\u0e34\u0e28\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e48\u0e32\u0e19",constrain_proportions:"\u0e04\u0e07\u0e2a\u0e31\u0e14\u0e2a\u0e48\u0e27\u0e19",preview:"\u0e14\u0e39\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07",title:"\u0e0a\u0e37\u0e48\u0e2d",general:"\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b",tab_advanced:"\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",tab_appearance:"\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30",tab_general:"\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/tn_dlg.js b/js/tiny_mce/plugins/advimage/langs/tn_dlg.js new file mode 100755 index 000000000..b41d05870 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/tr_dlg.js b/js/tiny_mce/plugins/advimage/langs/tr_dlg.js new file mode 100755 index 000000000..405161019 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.advimage_dlg',{image_list:"Resim listesi",align_right:"Sa\u011f",align_left:"Sol",align_textbottom:"Metin altta",align_texttop:"Metin \u00fcstte",align_bottom:"Alt",align_middle:"Orta",align_top:"\u00dcst",align_baseline:"Taban hizas\u0131",align:"Hizalama",hspace:"Yatay bo\u015fluk",vspace:"Dikey bo\u015fluk",dimensions:"Boyutlar",border:"Kenarl\u0131k",list:"Resim listesi",alt:"Resim a\u00e7\u0131klamas\u0131",src:"Resmin URL\'si",dialog_title:"Resim ekle/d\u00fczenle",missing_alt:"Resim a\u00e7\u0131klamas\u0131 girmeden devam etmek istedi\u011finize emini misiniz? Bu olmadan taray\u0131c\u0131da resimleri kapatanlar, metin bazl\u0131 taray\u0131c\u0131lar veya resim baz\u0131 engelli kullan\u0131c\u0131lar g\u00f6remeyeceklerdir.",example_img:"Resim \u00f6nizleme g\u00f6r\u00fcn\u00fcm\u00fc",misc:"\u00c7e\u015fitli",mouseout:"Fare d\u0131\u015f\u0131ndayken",mouseover:"Fare \u00fczerindeyken",alt_image:"Alternatif resim",swap_image:"Resmi takas et",map:"Resim haritas\u0131",id:"Id",rtl:"Soldan sa\u011fa",ltr:"Sa\u011fdan sola",classes:"S\u0131n\u0131fla",style:"Stil",long_desc:"Uzun a\u00e7\u0131klamal\u0131 ba\u011flant\u0131",langcode:"Dil kodu",langdir:"Dil y\u00f6n\u00fc",constrain_proportions:"Oran\u0131 s\u0131n\u0131rla",preview:"\u00d6nizleme",title:"Ba\u015fl\u0131k",general:"Genel",tab_advanced:"Geli\u015fmi\u015f",tab_appearance:"G\u00f6r\u00fcn\u00fcm",tab_general:"Genel"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/tt_dlg.js b/js/tiny_mce/plugins/advimage/langs/tt_dlg.js new file mode 100755 index 000000000..10f8162f8 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.advimage_dlg',{image_list:"\u5716\u7247\u6e05\u55ae",align_right:"\u5c45\u53f3",align_left:"\u5c45\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u5e95\u90e8",align_middle:"\u4e2d\u90e8",align_top:"\u9802\u90e8",align_baseline:"\u57fa\u7dda",align:"\u5c0d\u9f4a\u65b9\u5f0f",hspace:"\u6c34\u5e73\u9593\u8ddd",vspace:"\u5782\u76f4\u9593\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u908a\u6846",list:"\u5716\u7247\u6e05\u55ae",alt:"\u5716\u7247\u8aaa\u660e",src:"\u5716\u7247\u4f4d\u5740",dialog_title:"\u63d2\u5165/\u7de8\u8f2f \u5716\u7247",missing_alt:" \u662f\u5426\u4e0d\u7232\u5716\u7247\u52a0\u5165\u8aaa\u660e\u6587\u5b57\uff0c\u5982\u679c\u4e0d\u52a0\u5165\u8aaa\u660e\u6587\u5b57\uff0c\u5c07\u5c0e\u81f4\u4e0d\u652f\u63f4\u5716\u7247\u7684\u700f\u89bd\u5668\u5ffd\u7565\u672c\u5167\u5bb9",example_img:"\u9810\u89bd\u5716\u7247",misc:"\u5176\u4ed6",mouseout:"\u6ed1\u9f20\u79fb\u51fa",mouseover:"\u6ed1\u9f20\u5283\u904e",alt_image:"\u4ea4\u66ff\u5716\u7247",swap_image:"\u5207\u63db\u5716\u7247",map:"\u5716\u7247\u71b1\u9ede",id:"Id",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",classes:"\u6a23\u5f0f\u985e",style:"\u6a23\u5f0f",long_desc:"\u63cf\u8ff0",langcode:"\u8a9e\u8a00\u7de8\u78bc",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",preview:"\u9810\u89bd",title:"\u641c\u5c0b",general:"\u57fa\u672c",tab_advanced:"\u9032\u968e",tab_appearance:"\u5916\u89c0",tab_general:"\u57fa\u672c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/tw_dlg.js b/js/tiny_mce/plugins/advimage/langs/tw_dlg.js new file mode 100755 index 000000000..19058a4bd --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.advimage_dlg',{image_list:"\u5716\u7247\u6e05\u55ae",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u9760\u4e0b",align_middle:"\u7f6e\u4e2d",align_top:"\u9760\u4e0a",align_baseline:"\u57fa\u6e96\u7dda",align:"\u5c0d\u9f4a\u65b9\u5f0f",hspace:"\u6c34\u5e73\u9593\u8ddd",vspace:"\u5782\u76f4\u9593\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u908a\u6846",list:"\u5716\u7247\u6e05\u55ae",alt:"\u5716\u7247\u8aaa\u660e",src:"\u5716\u7247URL",dialog_title:"\u63d2\u5165/\u7de8\u8f2f\u5716\u7247",missing_alt:"\u5716\u7247\u6c92\u6709\u8aaa\u660e\u6587\u5b57\uff0c\u662f\u5426\u7e7c\u7e8c\uff1f",example_img:"\u5716\u7247\u5916\u89c0\u9810\u89bd",misc:"\u5176\u5b83",mouseout:"\u6ed1\u9f20\u79fb\u51fa",mouseover:"\u6ed1\u9f20\u79fb\u5165",alt_image:"\u53d6\u4ee3\u5716\u7247",swap_image:"\u5716\u7247\u5207\u63db",map:"\u5716\u7247 Map",id:"ID",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",classes:"\u985e\u5225",style:"\u6a23\u5f0f",long_desc:"\u9577\u63cf\u8ff0\u9023\u7d50",langcode:"\u8a9e\u8a00\u7de8\u78bc",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",constrain_proportions:"\u9396\u5b9a\u6bd4\u4f8b",preview:"\u9810\u89bd",title:"\u6a19\u984c",general:"\u4e00\u822c",tab_advanced:"\u9032\u968e",tab_appearance:"\u5916\u89c0",tab_general:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/uk_dlg.js b/js/tiny_mce/plugins/advimage/langs/uk_dlg.js new file mode 100755 index 000000000..133e52016 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.advimage_dlg',{image_list:"\u0421\u043f\u0438\u0441\u043e\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c",align_right:"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_left:"\u041f\u043e \u043b\u0456\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_textbottom:"\u041f\u043e \u043d\u0438\u0436\u043d\u044c\u043e\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0443",align_texttop:"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u044c\u043e\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0443",align_bottom:"\u041f\u043e \u043d\u0438\u0436\u043d\u044c\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_middle:"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443",align_top:"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u044c\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_baseline:"\u041f\u043e \u0431\u0430\u0437\u043e\u0432\u0456\u0439 \u043b\u0456\u043d\u0456\u0457",align:"\u0412\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",hspace:"\u0413\u043e\u0440\u0438\u0437. \u0432\u0456\u0434\u0441\u0442\u0443\u043f",vspace:"\u0412\u0435\u0440\u0442. \u0432\u0456\u0434\u0441\u0442\u0443\u043f",dimensions:"\u0420\u043e\u0437\u043c\u0456\u0440\u0438",border:"\u0420\u0430\u043c\u043a\u0430",list:"\u0421\u043f\u0438\u0441\u043e\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c",alt:"\u041e\u043f\u0438\u0441",src:"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",dialog_title:"\u0414\u043e\u0434\u0430\u0442\u0438/\u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",missing_alt:"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u043d\u0456, \u0449\u043e \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438 \u0431\u0435\u0437 \u043e\u043f\u0438\u0441\u0443 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f? \u0411\u0435\u0437 \u0446\u044c\u043e\u0433\u043e, \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0435 \u0431\u0443\u0434\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u043c \u0434\u0435\u044f\u043a\u0438\u043c \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430\u043c \u0437 \u0432\u0430\u0434\u0430\u043c\u0438, \u0430\u0431\u043e \u0442\u0438\u043c, \u0445\u0442\u043e \u043a\u043e\u0440\u0438\u0442\u0443\u0454\u0442\u044c\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u0434\u0430\u0447\u0430\u043c\u0438, \u0430\u0431\u043e \u043f\u0440\u043e\u0433\u043b\u044f\u0434\u0430\u0454 \u0456\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438 \u0437 \u0432\u0438\u043c\u043a\u043d\u0435\u043d\u0438\u043c\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f\u043c\u0438.",example_img:"\u0412\u0438\u0433\u043b\u044f\u0434 \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u0434\u0443 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",misc:"\u0406\u043d\u0448\u0435",mouseout:"\u043f\u0440\u0438 \u0432\u0456\u0434\u0432\u0435\u0434\u0435\u043d\u043d\u0456",mouseover:"\u043f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u043d\u0456",alt_image:"\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",swap_image:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u043c\u0456\u043d\u043d\u0438\u043a",map:"\u041c\u0430\u043f\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",id:"\u0406\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447",ltr:"\u0417\u043b\u0456\u0432\u0430 \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447",classes:"\u041a\u043b\u0430\u0441\u0438",style:"\u0421\u0442\u0438\u043b\u044c",long_desc:"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u043f\u043e\u0432\u043d\u0438\u0439 \u043e\u043f\u0438\u0441",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u0438",langdir:"\u041d\u0430\u043f\u0440\u044f\u043c\u043e\u043a \u043c\u043e\u0432\u0438",constrain_proportions:"\u0417\u0431\u0435\u0440\u0456\u0433\u0430\u0442\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0456\u0457",preview:"\u041f\u0435\u0440\u0435\u0433\u043b\u044f\u0434",title:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",general:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435",tab_advanced:"\u0414\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e",tab_appearance:"\u0412\u0438\u0433\u043b\u044f\u0434",tab_general:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/ur_dlg.js b/js/tiny_mce/plugins/advimage/langs/ur_dlg.js new file mode 100755 index 000000000..d7e609de9 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.advimage_dlg',{image_list:"Image list",align_right:"Right",align_left:"Left",align_textbottom:"Text bottom",align_texttop:"Text top",align_bottom:"Bottom",align_middle:"Middle",align_top:"Top",align_baseline:"Baseline",align:"Alignment",hspace:"Horizontal space",vspace:"Vertical space",dimensions:"Dimensions",border:"Border",list:"Image list",alt:"Image description",src:"Image URL",dialog_title:"Insert/edit 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.",example_img:"Appearance preview image",misc:"Miscellaneous",mouseout:"for mouse out",mouseover:"for mouse over",alt_image:"Alternative image",swap_image:"Swap image",map:"Image map",id:"Id",rtl:"Right to left",ltr:"Left to right",classes:"Classes",style:"Style",long_desc:"Long description link",langcode:"Language code",langdir:"Language direction",constrain_proportions:"Constrain proportions",preview:"Preview",title:"Title",general:"General",tab_advanced:"Advanced",tab_appearance:"Appearance",tab_general:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/vi_dlg.js b/js/tiny_mce/plugins/advimage/langs/vi_dlg.js new file mode 100755 index 000000000..31fbfc937 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.advimage_dlg',{image_list:"Danh s\u00e1ch \u1ea3nh",align_right:"Ph\u1ea3i",align_left:"Tr\u00e1i",align_textbottom:"V\u0103n b\u1ea3n d\u01b0\u1edbi c\u00f9ng",align_texttop:"V\u0103n b\u1ea3n tr\u00ean c\u00f9ng",align_bottom:"D\u01b0\u1edbi c\u00f9ng",align_middle:"Gi\u1eefa",align_top:"Tr\u00ean c\u00f9ng",align_baseline:"D\u00f2ng c\u01a1 s\u1edf",align:"Canh l\u1ec1",hspace:"Kho\u1ea3ng c\u00e1ch ngang",vspace:"Kho\u1ea3ng c\u00e1ch d\u1ecdc",dimensions:"K\u00edch th\u01b0\u1edbc",border:"Vi\u1ec1n",list:"Danh s\u00e1ch \u1ea3nh",alt:"M\u00f4 t\u1ea3 \u1ea3nh",src:"URL \u1ea3nh",dialog_title:"Ch\u00e8n/s\u1eeda \u1ea3nh",missing_alt:"Ti\u1ebfp t\u1ee5c v\u1edbi \u0111\u01b0\u1eddng d\u1eabn kh\u00f4ng t\u1ed3n t\u1ea1i ?.",example_img:"Hi\u1ec3n th\u1ecb h\u00ecnh \u1ea3nh xem tr\u01b0\u1edbc",misc:"Linh tinh",mouseout:"cho chu\u1ed9t ra",mouseover:"cho chu\u1ed9t l\u00ean",alt_image:"\u1ea2nh thay th\u1ebf",swap_image:"Trao \u0111\u1ed5i \u1ea3nh",map:"S\u01a1 \u0111\u1ed3 \u1ea3nh",id:"Id",rtl:"Ph\u1ea3i qua tr\u00e1i",ltr:"Tr\u00e1i qua ph\u1ea3i",classes:"L\u1edbp",style:"Ki\u1ec3u d\u00e1ng",long_desc:"Li\u00ean k\u1ebft m\u00f4 t\u1ea3 d\u00e0i",langcode:"M\u00e3 ng\u00f4n ng\u1eef",langdir:"H\u01b0\u1edbng ng\u00f4n ng\u1eef",constrain_proportions:"R\u00e0ng bu\u1ed9c t\u1ec9 l\u1ec7",preview:"Xem tr\u01b0\u1edbc",title:"Ti\u00eau \u0111\u1ec1",general:"Chung",tab_advanced:"N\u00e2ng cao",tab_appearance:"Xu\u1ea5t hi\u1ec7n",tab_general:"Chung"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/advimage/langs/zh-cn_dlg.js new file mode 100755 index 000000000..90ea29895 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.advimage_dlg',{"image_list":"\u56fe\u7247\u5217\u8868","align_right":"\u53f3\u5bf9\u9f50","align_left":"\u5de6\u5bf9\u9f50","align_textbottom":"\u6587\u5b57\u4e0b\u65b9","align_texttop":"\u6587\u5b57\u4e0a\u65b9","align_bottom":"\u5e95\u7aef\u5bf9\u9f50","align_middle":"\u5c45\u4e2d\u5bf9\u9f50","align_top":"\u9876\u7aef\u5bf9\u9f50","align_baseline":"\u5e95\u7ebf",align:"\u5bf9\u9f50",hspace:"\u6c34\u5e73\u8ddd\u79bb",vspace:"\u5782\u76f4\u8ddd\u79bb",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u5217\u8868",alt:"\u56fe\u7247\u63cf\u8ff0",src:"\u56fe\u7247\u94fe\u63a5","dialog_title":"\u63d2\u5165/\u7f16\u8f91 \u56fe\u7247","missing_alt":"\u56fe\u7247\u6ca1\u6709\u8bf4\u660e\u6587\u5b57\uff0c\u60a8\u662f\u5426\u8981\u7ee7\u7eed\uff1f\u6ca1\u6709\u8bf4\u660e\u6587\u5b57\u7684\u56fe\u7247\uff0c\u53ef\u80fd\u7ed9\u6b8b\u75be\u4eba\u58eb\u3001\u6587\u672c\u6d4f\u89c8\u5668\u6216\u5173\u95ed\u56fe\u7247\u529f\u80fd\u7684\u6d4f\u89c8\u5668\u8bbf\u95ee\u9020\u6210\u56f0\u96be\u3002","example_img":"\u5916\u89c2\u9884\u89c8\u56fe",misc:"\u5176\u4ed6",mouseout:"\u9f20\u6807\u6ed1\u51fa",mouseover:"\u9f20\u6807\u6ed1\u5165","alt_image":"\u66ff\u6362\u56fe\u7247","swap_image":"\u56fe\u7247\u5207\u6362",map:"\u56fe\u7247map",id:"ID",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",classes:"\u7c7b\u522b",style:"\u6837\u5f0f","long_desc":"\u957f\u63cf\u8ff0\u94fe\u63a5",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u6587\u5b57\u65b9\u5411","constrain_proportions":"\u4fdd\u6301\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u6807\u9898",general:"\u666e\u901a","tab_advanced":"\u9ad8\u7ea7","tab_appearance":"\u5916\u89c2","tab_general":"\u666e\u901a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/zh_dlg.js b/js/tiny_mce/plugins/advimage/langs/zh_dlg.js new file mode 100755 index 000000000..f7982e9b3 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.advimage_dlg',{image_list:"\u56fe\u7247\u6e05\u5355",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u9760\u4e0b",align_middle:"\u7f6e\u4e2d",align_top:"\u9760\u4e0a",align_baseline:"\u57fa\u51c6\u7ebf",align:"\u5bf9\u9f50\u65b9\u5f0f",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u6e05\u5355",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247URL",dialog_title:"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247",missing_alt:"\u56fe\u7247\u6ca1\u6709\u8bf4\u660e\u6587\u5b57\uff0c\u662f\u5426\u7ee7\u7eed\uff1f",example_img:"\u56fe\u7247\u5916\u89c2\u9884\u89c8",misc:"\u5176\u5b83",mouseout:"\u9f20\u6807\u79fb\u51fa",mouseover:"\u9f20\u6807\u79fb\u5165",alt_image:"\u53d6\u4ee3\u56fe\u7247",swap_image:"\u56fe\u7247\u5207\u6362",map:"\u56fe\u7247 Map",id:"ID",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",long_desc:"\u957f\u8fde\u7ed3",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",constrain_proportions:"\u7ea6\u675f\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u6807\u9898",general:"\u4e00\u822c",tab_advanced:"\u9ad8\u7ea7",tab_appearance:"\u5916\u89c2",tab_general:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advimage/langs/zu_dlg.js b/js/tiny_mce/plugins/advimage/langs/zu_dlg.js new file mode 100755 index 000000000..e6509e493 --- /dev/null +++ b/js/tiny_mce/plugins/advimage/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.advimage_dlg',{image_list:"\u56fe\u7247\u6e05\u5355",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_textbottom:"\u6587\u5b57\u4e0b\u65b9",align_texttop:"\u6587\u5b57\u4e0a\u65b9",align_bottom:"\u4e0b\u65b9",align_middle:"\u5c45\u4e2d",align_top:"\u4e0a\u65b9",align_baseline:"\u57fa\u7ebf",align:"\u5bf9\u9f50\u65b9\u5f0f",hspace:"\u5782\u76f4\u95f4\u8ddd",vspace:"\u6c34\u51c6\u95f4\u8ddd",dimensions:"\u5c3a\u5bf8",border:"\u8fb9\u6846",list:"\u56fe\u7247\u6e05\u5355",alt:"\u56fe\u7247\u8bf4\u660e",src:"\u56fe\u7247\u7f51\u5740",dialog_title:"\u63d2\u5165/\u7f16\u8f91\u56fe\u7247",missing_alt:"\u8bf7\u95ee\u662f\u5426\u786e\u5b9a\u4e0d\u4e3a\u56fe\u7247\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff1f\u82e5\u6ca1\u6709\u52a0\u5165\u8bf4\u660e\u6587\u5b57\uff0c\u5f53\u4f7f\u7528\u8005\u4f7f\u7528\u4e0d\u8bfb\u5165\u56fe\u7247\u6216\u6587\u5b57\u4f53\u7684\u6d41\u89c8\u5668\u65f6\uff0c\u5c06\u4f1a\u770b\u4e0d\u5230\u8fd9\u4e2a\u56fe\u7247\u3002",example_img:"\u9884\u89c8\u56fe\u7247",misc:"\u5176\u5b83",mouseout:"\u6ed1\u9f20\u79fb\u51fa\u56fe\u7247",mouseover:"\u6ed1\u9f20\u79fb\u5165\u56fe\u7247",alt_image:"\u66ff\u6362\u56fe\u7247",swap_image:"\u5bf9\u6362\u56fe\u7247",map:"\u56fe\u7247\u5730\u56fe",id:"Id",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",classes:"\u7c7b\u578b",style:"\u6837\u5f0f",long_desc:"\u957f\u63cf\u8ff0\u8fde\u7ed3",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",preview:"\u9884\u89c8",title:"\u67e5\u627e",general:"\u4e00\u822c",tab_advanced:"\u9ad8\u7ea7",tab_appearance:"\u5916\u89c2",tab_general:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/css/advlink.css b/js/tiny_mce/plugins/advlink/css/advlink.css new file mode 100644 index 000000000..14364316a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/css/advlink.css @@ -0,0 +1,8 @@ +.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;} diff --git a/js/tiny_mce/plugins/advlink/editor_plugin.js b/js/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100644 index 000000000..983fe5a9c --- /dev/null +++ b/js/tiny_mce/plugins/advlink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/editor_plugin_src.js b/js/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100644 index 000000000..14e46a762 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/editor_plugin_src.js @@ -0,0 +1,61 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { + init : function(ed, url) { + this.editor = ed; + + // Register commands + ed.addCommand('mceAdvLink', function() { + var se = ed.selection; + + // No selection and not in link + if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) + return; + + ed.windowManager.open({ + file : url + '/link.htm', + width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), + height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('link', { + title : 'advlink.link_desc', + cmd : 'mceAdvLink' + }); + + ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('link', co && n.nodeName != 'A'); + cm.setActive('link', n.nodeName == 'A' && !n.name); + }); + }, + + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/js/advlink.js b/js/tiny_mce/plugins/advlink/js/advlink.js new file mode 100644 index 000000000..5fd6d91e0 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/js/advlink.js @@ -0,0 +1,523 @@ +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + 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 = inst.dom.getParent(elm, "A"); + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', inst.dom.getAttrib(elm, 'target')); + setFormValue('classes', inst.dom.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', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +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']; + + 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'); + for (var i=0; i'; + html += ''; + + for (i=0, len=nodes.length; i' + name + ''; + } + + html += ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/advlink/langs/ar_dlg.js b/js/tiny_mce/plugins/advlink/langs/ar_dlg.js new file mode 100755 index 000000000..4ff541876 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.advlink_dlg',{target_name:"\u0627\u0633\u0645 \u0627\u0644\u0647\u062f\u0641",classes:"\u0635\u0646\u0641",style:"\u0634\u0643\u0644",id:"Id",popup_position:"\u0645\u0648\u0642\u0639 (X/Y)",langdir:"\u0627\u062a\u062c\u0627\u0647 \u0627\u0644\u0644\u063a\u0629",popup_size:"\u062d\u062c\u0645",popup_dependent:"\u062e\u0627\u0636\u0639 (Mozilla/Firefox only)",popup_resizable:"\u062a\u063a\u064a\u064a\u0631 \u062d\u062c\u0645 \u0646\u0627\u0641\u0630\u0629",popup_location:"\u0639\u0631\u0636 \u0634\u0631\u064a\u0637 \u0627\u0644\u0645\u0648\u0642\u0639",popup_menubar:"\u0639\u0631\u0636 \u0634\u0631\u064a\u0637 \u0627\u0644\u0642\u0648\u0627\u0626\u0645",popup_toolbar:"\u0625\u0638\u0647\u0627\u0631 \u0634\u0631\u064a\u0637 \u0627\u0644\u0623\u062f\u0648\u0627\u062a",popup_statusbar:"\u0639\u0631\u0636 \u0634\u0631\u064a\u0637 \u0627\u0644\u062d\u0627\u0644\u0629",popup_scrollbars:"\u0639\u0631\u0636 \u0623\u0634\u0631\u0637\u0629 \u0627\u0644\u062a\u0645\u0631\u064a\u0631",popup_return:"\u0625\u062f\u0631\u0627\u062c \'\u0639\u0648\u062f\u0629 \u0643\u0627\u0630\u0628\u0629\' \'return false\'",popup_name:"\u0627\u0633\u0645 \u0627\u0644\u0646\u0627\u0641\u0630\u0629",popup_url:"\u0631\u0627\u0628\u0637 \u0637\u0641\u0648 \u0639\u0644\u0649 \u0627\u0644\u0633\u0637\u062d",popup:"\u062c\u0627\u0641\u0627 \u0633\u0643\u0631\u064a\u0628\u062a",target_blank:"\u0641\u064a \u0641\u062a\u062d \u0646\u0627\u0641\u0630\u0629 \u062c\u062f\u064a\u062f\u0629",target_top:"\u0641\u062a\u062d \u0641\u064a \u0627\u0644\u0625\u0637\u0627\u0631 \u0627\u0644\u0639\u0644\u0648\u064a (\u064a\u062d\u0644 \u0645\u062d\u0644 \u0643\u0627\u0641\u0629 \u0627\u0644\u0625\u0637\u0627\u0631\u0627\u062a)",target_parent:"\u0641\u062a\u062d \u0641\u064a \u0627\u0644\u0625\u0637\u0627\u0631 \u0627\u0644\u0623\u0635\u0644",target_same:"\u0641\u062a\u062d \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0625\u0637\u0627\u0631",anchor_names:"\u0645\u0631\u062a\u0643\u0632\u0627\u062a",popup_opts:"\u062e\u064a\u0627\u0631\u0627\u062a",advanced_props:"\u062e\u0635\u0627\u0626\u0635 \u0645\u062a\u0642\u062f\u0645\u0629",event_props:"\u0623\u062d\u062f\u0627\u062b",popup_props:"\u062e\u0635\u0627\u0626\u0635 \u0645\u0631\u0628\u0639 \u0637\u0641\u0648 \u0639\u0644\u0649 \u0627\u0644\u0633\u0637\u062d ",general_props:"\u0627\u0644\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u0639\u0627\u0645\u0629",advanced_tab:"\u0645\u062a\u0642\u062f\u0645",events_tab:"\u0623\u062d\u062f\u0627\u062b",popup_tab:"\u064a\u0645\u0631\u0628\u0639 \u0637\u0641\u0648 \u0639\u0644\u0649 \u0627\u0644\u0633\u0637\u062d",general_tab:"\u0639\u0627\u0645",list:"\u0642\u0627\u0626\u0645\u0647 \u0627\u0644\u0645\u0648\u0627\u0642\u0639",is_external:"\u0627\u0644\u0631\u0627\u0628\u0637 \u064a\u0628\u062f\u0648 \u0627\u0646\u0647 \u0644\u0645\u0648\u0642\u0639 \u062e\u0627\u0631\u062c\u0649 \u0647\u0644 \u062a\u0631\u064a\u062f \u0627\u0646 \u0646\u0636\u0639 http://",is_email:"\u0627\u0644\u0631\u0627\u0628\u0637 \u0631\u0628\u0645\u0627 \u0628\u0631\u064a\u062f \u0627\u0644\u0627\u0643\u062a\u0631\u0648\u0646\u0649 \u0647\u0644 \u062a\u0631\u064a\u062f \u0627\u0646 \u0646\u0636\u0639 \u0648\u0633\u0645 \u0631\u0627\u0628\u0637 \u0627\u0644\u0628\u0631\u064a\u062f",titlefield:"\u0627\u0633\u0645 \u0627\u0644\u0631\u0627\u0628\u0637",target:"Target",url:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0631\u0627\u0628\u0637",title:"\u0627\u062f\u062e\u0627\u0644 -\u062a\u0639\u062f\u064a\u0644 \u0631\u0627\u0628\u0637",link_list:"\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0631\u0648\u0627\u0628\u0637",rtl:"\u0645\u0646 \u0627\u0644\u064a\u0645\u064a\u0646 \u0625\u0644\u0649 \u0627\u0644\u064a\u0633\u0627\u0631",ltr:"\u0645\u0646 \u0627\u0644\u064a\u0633\u0627\u0631 \u0625\u0644\u0649 \u0627\u0644\u064a\u0645\u064a\u0646",accesskey:"\u0645\u0641\u062a\u0627\u062d \u0627\u0644\u0648\u0635\u0648\u0644",tabindex:" Tab \u0641\u0647\u0631\u0633",rev:"\u0639\u0644\u0627\u0642\u0629 \u0627\u0644\u0647\u062f\u0641 \u0644\u0635\u0641\u062d\u0629",rel:"\u0627\u0644\u0639\u0644\u0627\u0642\u0629 \u0627\u0644\u0635\u0641\u062d\u0629 \u0644\u0627\u0633\u062a\u0647\u062f\u0627\u0641",mime:"\u0627\u0644\u0647\u062f\u0641 \u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641",encoding:"\u0631\u0645\u0632 \u0627\u0644\u0644\u063a\u0629",langcode:"Language code",target_langcode:"\u0644\u063a\u0629 \u0627\u0644\u0647\u062f\u0641"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/az_dlg.js b/js/tiny_mce/plugins/advlink/langs/az_dlg.js new file mode 100755 index 000000000..7ed1896d5 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.advlink_dlg',{target_name:"H\u0259d\u0259f ad\u0131",classes:"Sinifl\u0259r",style:"Sil",id:"\u0130dentifikator",popup_position:"M\u00f6vqe (X/Y)",langdir:"Dil istiqam\u0259ti",popup_size:"\u00f6l\u00e7\u00fc",popup_dependent:"As\u0131l\u0131 olan (yaln\u0131z Mozilla/Firefox)",popup_resizable:"P\u0259nc\u0259r\u0259 \u00f6l\u00e7\u00fcs\u00fcn\u00fc d\u0259yi\u015fil\u0259n et",popup_location:"\u00dcnvan s\u0259trini g\u00f6st\u0259r",popup_menubar:"Menyu s\u0259trini g\u00f6st\u0259r",popup_toolbar:"Al\u0259tl\u0259r panelini g\u00f6st\u0259r",popup_statusbar:"M\u0259tn v\u0259ziyy\u0259tini g\u00f6st\u0259r",popup_scrollbars:"F\u0131rlanan\u0131n zolaqlar\u0131n\u0131 g\u00f6st\u0259r",popup_return:"\'return false\' \u0259lav\u0259 et",popup_name:"P\u0259nc\u0259r\u0259nin ad\u0131",popup_url:"\u00dcz\u0259 \u00e7\u0131xan p\u0259nc\u0259r\u0259nin \u00fcnvan\u0131",popup:"\u00dcz\u0259 \u00e7\u0131xan Javascript-p\u0259nc\u0259r\u0259",target_blank:"Yeni p\u0259nc\u0259r\u0259d\u0259 a\u00e7",target_top:"Yuxar\u0131 \u00e7\u0259r\u00e7iv\u0259d\u0259 a\u00e7 (dig\u0259rl\u0259rini d\u0259 doldurur)",target_parent:"Ana p\u0259nc\u0259r\u0259d\u0259 a\u00e7 / \u00e7\u0259r\u00e7iv\u0259",target_same:"Bu p\u0259nc\u0259r\u0259d\u0259 a\u00e7 / \u00e7\u0259r\u00e7iv\u0259",anchor_names:"L\u00f6vb\u0259r",popup_opts:"Parametrl\u0259r",advanced_props:"\u018flav\u0259 x\u00fcsusiyy\u0259tl\u0259r",event_props:"Hadis\u0259l\u0259r",popup_props:"\u00dcz\u0259 \u00e7\u0131xan p\u0259nc\u0259r\u0259l\u0259rin x\u00fcsusiyy\u0259tl\u0259ti",general_props:"\u00dcmumi x\u00fcsusiyy\u0259tl\u0259ri",advanced_tab:"\u018flav\u0259l\u0259r",events_tab:"Hadis\u0259l\u0259r",popup_tab:"\u00dcz\u0259 \u00e7\u0131xan p\u0259nc\u0259r\u0259",general_tab:"\u00dcmumi",list:"Ke\u00e7id siyah\u0131s\u0131",is_external:"Daxil edil\u0259n \u00fcnvan xarici ke\u00e7id\u0259 b\u0259nz\u0259yir. http:// prefiksini \u0259lav\u0259 etm\u0259k ist\u0259yirsiniz?",is_email:"Daxil edil\u0259n \u00fcnvan e-po\u00e7ta b\u0259nz\u0259yir. mailto: prefiksini \u0259lav\u0259 etm\u0259k ist\u0259yirsiniz?",titlefield:"Ad\u0131",target:"H\u0259d\u0259f",url:"Ke\u00e7id \u00fcnvan\u0131",title:"Ke\u00e7idi \u0259lav\u0259/redakt\u0259 et",link_list:"Ke\u00e7id siyah\u0131s\u0131",rtl:"Sa\u011fda-sola",ltr:"Solda-sa\u011fa",accesskey:"Giri\u015f klavi\u015fi",tabindex:"Hesab indeksi",rev:"H\u0259d\u0259fin p\u0259nc\u0259r\u0259y\u0259 m\u00fcnasib\u0259ti",rel:"P\u0259nc\u0259r\u0259nin h\u0259d\u0259f\u0259 m\u00fcnasib\u0259ti",mime:"H\u0259d\u0259fli MIME-n\u00f6v",encoding:"H\u0259d\u0259fli kodla\u015fd\u0131rma",langcode:"Dil kodu",target_langcode:"H\u0259d\u0259fli dil"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/be_dlg.js b/js/tiny_mce/plugins/advlink/langs/be_dlg.js new file mode 100755 index 000000000..09c18446b --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.advlink_dlg',{target_name:"\u041d\u0430\u0437\u043e\u045e \u043c\u044d\u0442\u044b",classes:"\u041a\u043b\u0430\u0441\u044b",style:"\u0421\u0442\u044b\u043b\u044c",id:"\u0406\u0434\u044d\u043d\u0442\u044b\u0444\u0456\u043a\u0430\u0442\u0430\u0440",popup_position:"\u041f\u0430\u0437\u0456\u0446\u044b\u044f (X/Y)",langdir:"\u041a\u0456\u0440\u0443\u043d\u0430\u043a \u043c\u043e\u0432\u044b",popup_size:"\u041f\u0430\u043c\u0435\u0440",popup_dependent:"\u0417\u0430\u043b\u0435\u0436\u043d\u044b\u044f (\u0442\u043e\u043b\u044c\u043a\u0456 Mozilla/Firefox)",popup_resizable:"\u0417\u0440\u0430\u0431\u0456\u0446\u044c \u043f\u0430\u043c\u0435\u0440 \u0430\u043a\u043d\u0430 \u0437\u043c\u044f\u043d\u044f\u043d\u044b\u043c",popup_location:"\u041f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u0440\u0430\u0434\u043e\u043a \u0430\u0434\u0440\u0430\u0441\u0443",popup_menubar:"\u041f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u0440\u0430\u0434\u043e\u043a \u043c\u0435\u043d\u044e",popup_toolbar:"\u041f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u043f\u0430\u043d\u044d\u043b\u0456 \u043f\u0440\u044b\u043b\u0430\u0434",popup_statusbar:"\u041f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u0440\u0430\u0434\u043e\u043a \u0441\u0442\u0430\u043d\u0443",popup_scrollbars:"\u041f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u043f\u0430\u043b\u043e\u0441\u044b \u043f\u0440\u0430\u0433\u043e\u0440\u0442\u043a\u0456",popup_return:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044c \'return false\'",popup_name:"\u041d\u0430\u0437\u043e\u045e \u0430\u043a\u043d\u0430",popup_url:"\u0410\u0434\u0440\u0430\u0441 \u0443\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u044c\u043d\u0430\u0433\u0430 \u0430\u043a\u043d\u0430",popup:"\u0423\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u044c\u043d\u0430\u0435 Javascript-\u0430\u043a\u043d\u043e",target_blank:"\u0410\u0434\u043a\u0440\u044b\u0446\u044c \u0443 \u043d\u043e\u0432\u044b\u043c \u0430\u043a\u043d\u0435",target_top:"\u0410\u0434\u043a\u0440\u044b\u0446\u044c \u0443 \u0432\u0435\u0440\u0445\u043d\u0456\u043c \u0444\u0440\u044d\u0439\u043c\u0435 (\u0437\u0430\u043c\u044f\u0448\u0447\u0430\u0435 \u045e\u0441\u0451 \u0430\u0441\u0442\u0430\u0442\u043d\u0456\u044f)",target_parent:"\u0410\u0434\u043a\u0440\u044b\u0446\u044c \u0443 \u0431\u0430\u0446\u044c\u043a\u043e\u045e\u0441\u043a\u0456\u043c \u0430\u043a\u043d\u0435 / \u0444\u0440\u044d\u0439\u043c\u0435",target_same:"\u0410\u0434\u043a\u0440\u044b\u0446\u044c \u0443 \u0433\u044d\u0442\u044b\u043c \u0430\u043a\u043d\u0435 / \u0444\u0440\u044d\u0439\u043c\u0435",anchor_names:"\u042f\u043a\u0430\u0440\u044b",popup_opts:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b",advanced_props:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f \u045e\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456",event_props:"\u041f\u0430\u0434\u0437\u0435\u0456",popup_props:"\u0423\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u045e\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u044c\u043d\u0430\u0433\u0430 \u0430\u043a\u043d\u0430",general_props:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f \u045e\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456",advanced_tab:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f",events_tab:"\u041f\u0430\u0434\u0437\u0435\u0456",popup_tab:"\u0423\u0441\u043f\u043b\u044b\u0432\u0430\u043b\u044c\u043d\u0430\u0435 \u0430\u043a\u043d\u043e",general_tab:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f",list:"\u0421\u043f\u0456\u0441 \u0441\u043f\u0430\u0441\u044b\u043b\u0430\u043a",is_external:"\u0423\u0432\u0435\u0434\u0437\u0435\u043d\u044b \u0430\u0434\u0440\u0430\u0441 \u043f\u0430\u0434\u043e\u0431\u043d\u044b \u043d\u0430 \u0432\u043e\u043d\u043a\u0430\u0432\u0443\u044e \u0441\u043f\u0430\u0441\u044b\u043b\u043a\u0443, \u0432\u044b \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0434\u0430\u0434\u0430\u0446\u044c \u043f\u0440\u044d\u0444\u0456\u043a\u0441 http://?",is_email:"\u0423\u0432\u0435\u0434\u0437\u0435\u043d\u044b \u0430\u0434\u0440\u0430\u0441 \u043f\u0430\u0434\u043e\u0431\u043d\u044b \u043d\u0430 email, \u0432\u044b \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u0434\u0430\u0434\u0430\u0446\u044c \u043f\u0440\u044d\u0444\u0456\u043a\u0441 mailto:?",titlefield:"\u041d\u0430\u0437\u043e\u045e",target:"\u041c\u044d\u0442\u0430",url:"\u0410\u0434\u0440\u0430\u0441 \u0441\u043f\u0430\u0441\u044b\u043b\u043a\u0456",title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044c/\u0440\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044c \u0441\u043f\u0430\u0441\u044b\u043b\u043a\u0443",link_list:"\u0421\u043f\u0456\u0441 \u0441\u043f\u0430\u0441\u044b\u043b\u0430\u043a",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u0430",ltr:"\u0417\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u0430",accesskey:"\u041a\u043b\u0430\u0432\u0456\u0448\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0443",tabindex:"\u0410\u0437\u043d\u0430\u0447\u043d\u0456\u043a \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u044b\u0456",rev:"\u0421\u0442\u0430\u045e\u043b\u0435\u043d\u043d\u0435 \u043c\u044d\u0442\u0430 \u0434\u0430 \u0441\u0442\u0430\u0440\u043e\u043d\u043a\u0456",rel:"\u0421\u0442\u0430\u045e\u043b\u0435\u043d\u043d\u0435 \u0441\u0442\u0430\u0440\u043e\u043d\u043a\u0430 \u0434\u0430 \u043c\u044d\u0442\u044b",mime:"\u041c\u044d\u0442\u0430\u0432\u044b MIME-\u0442\u044b\u043f",encoding:"\u041c\u044d\u0442\u0430\u0432\u0430\u044f \u043a\u0430\u0434\u043e\u045e\u043a\u0430",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u044b",target_langcode:"\u041c\u044d\u0442\u0430\u0432\u0430\u044f \u043c\u043e\u0432\u0430"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/bg_dlg.js b/js/tiny_mce/plugins/advlink/langs/bg_dlg.js new file mode 100755 index 000000000..ea83f6253 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.advlink_dlg',{target_name:"\u0418\u043c\u0435 \u043d\u0430 \u0446\u0435\u043b",classes:"\u041a\u043b\u0430\u0441\u043e\u0432\u0435",style:"\u0421\u0442\u0438\u043b",id:"Id",popup_position:"\u041f\u043e\u0437\u0438\u0446\u0438\u044f (X/Y)",langdir:"\u041f\u043e\u0441\u043e\u043a\u0430 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",popup_size:"\u0420\u0430\u0437\u043c\u0435\u0440",popup_dependent:"\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u0438 (Mozilla/Firefox only)",popup_resizable:"\u0420\u0430\u0437\u0440\u0435\u0448\u0438 \u043f\u0440\u0435\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u044f\u0432\u0430\u043d\u0435 \u043d\u0430 \u043f\u0440\u043e\u0437\u043e\u0440\u0446\u0438\u0442\u0435",popup_location:"\u041f\u043e\u043a\u0430\u0436\u0438 location bar",popup_menubar:"\u041f\u043e\u043a\u0430\u0436\u0438 \u043b\u0435\u043d\u0442\u0430\u0442\u0430 \u0441 \u043c\u0435\u043d\u044e\u0442\u0430",popup_toolbar:"\u041f\u043e\u043a\u0430\u0436\u0438 \u043b\u0435\u043d\u0442\u0438\u0442\u0435 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0438",popup_statusbar:"\u041f\u043e\u043a\u0430\u0436\u0438 status bar",popup_scrollbars:"\u041f\u043e\u043a\u0430\u0436\u0438 \u0441\u043a\u0440\u043e\u043b\u0435\u0440\u0438",popup_return:"\u0412\u043c\u044a\u043a\u043d\u0438 \'return false\'",popup_name:"\u0418\u043c\u0435 \u043d\u0430 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446\u0430",popup_url:"URL \u043d\u0430 popup-\u0430",popup:"Javascript popup",target_blank:"\u041e\u0442\u0432\u043e\u0440\u0438 \u0432 \u043d\u043e\u0432 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446",target_top:"\u041e\u0442\u0432\u043e\u0440\u0438 \u0432 \u043d\u0430\u0439-\u0433\u043e\u0440\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c (\u0437\u0430\u043c\u0435\u0441\u0442\u0432\u0430 \u0432\u0441\u0438\u0447\u043a\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0432\u0435)",target_parent:"\u041e\u0442\u0432\u043e\u0440\u0438 \u0432 \u0433\u043e\u0440\u043d\u0438\u044f \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446 / \u0444\u0440\u0435\u0439\u043c",target_same:"\u041e\u0442\u0432\u043e\u0440\u0438 \u0432 \u0442\u043e\u0437\u0438 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446 / \u0444\u0440\u0435\u0439\u043c",anchor_names:"\u041a\u043e\u0442\u0432\u0438",popup_opts:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",advanced_props:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",event_props:"\u0421\u044a\u0431\u0438\u0442\u0438\u044f",popup_props:"Popup \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",general_props:"\u041e\u0431\u0449\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",advanced_tab:"\u0417\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",events_tab:"\u0421\u044a\u0431\u0438\u0442\u0438\u044f",popup_tab:"Popup",general_tab:"\u041e\u0431\u0449\u0438",list:"\u0421\u043f\u0438\u0441\u044a\u043a \u0441 \u0445\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0438",is_external:"URL-\u0442\u043e \u043a\u043e\u0435\u0442\u043e \u0432\u044a\u0432\u0435\u0434\u043e\u0445\u0442\u0435 \u0435 \u0432\u044a\u043d\u0448\u043d\u0430 \u0445\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0430, \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u043b\u0438 \u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u0438\u044f\u0442 http:// \u043f\u0440\u0435\u0444\u0438\u043a\u0441?",is_email:"URL-\u0442\u043e \u043a\u043e\u0435\u0442\u043e \u0432\u044a\u0432\u0435\u0434\u043e\u0445\u0442\u0435 \u0435 email \u0430\u0434\u0440\u0435\u0441, \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u043b\u0438 \u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u0438\u044f\u0442 mailto: \u043f\u0440\u0435\u0444\u0438\u043a\u0441?",titlefield:"\u0417\u0430\u0433\u043b\u0430\u0432\u0438\u0435",target:"\u0426\u0435\u043b",url:"URL \u043d\u0430 \u0445\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0430",title:"\u0412\u043c\u044a\u043a\u043d\u0438/\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u0439 \u0445\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0430",link_list:"\u0421\u043f\u0438\u0441\u044a\u043a \u0441 \u0445\u0438\u043f\u0435\u0440\u0432\u0440\u044a\u0437\u043a\u0438",rtl:"\u041e\u0442\u0434\u044f\u0441\u043d\u043e \u043d\u0430 \u043b\u044f\u0432\u043e",ltr:"\u041e\u0442\u043b\u044f\u0432\u043e \u043d\u0430 \u0434\u044f\u0441\u043d\u043e",accesskey:"\u041a\u043b\u0430\u0432\u0438\u0448",tabindex:"\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u043d\u043e\u0441\u0442",rev:"\u0412\u0437\u0430\u0438\u043c\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0446\u0435\u043b - \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430",rel:"\u0412\u0437\u0430\u0438\u043c\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 - \u0446\u0435\u043b",mime:"MIME \u0442\u0438\u043f",encoding:"\u041a\u043e\u0434\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0442\u0435",langcode:"\u041a\u043e\u0434 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",target_langcode:"\u0415\u0437\u0438\u043a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/bn_dlg.js b/js/tiny_mce/plugins/advlink/langs/bn_dlg.js new file mode 100755 index 000000000..f71254efd --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.advlink_dlg',{"target_name":"Target name",classes:"Classes",style:"Style",id:"Id","popup_position":"Position (X/Y)",langdir:"Language direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox only)","popup_resizable":"Make window resizable","popup_location":"Show location bar","popup_menubar":"Show menu bar","popup_toolbar":"Show toolbars","popup_statusbar":"Show status bar","popup_scrollbars":"Show scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window name","popup_url":"Popup URL",popup:"Javascript popup","target_blank":"Open in new window","target_top":"Open in top frame (replaces all frames)","target_parent":"Open in parent window / frame","target_same":"Open in this window / frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced properties","event_props":"Events","popup_props":"Popup properties","general_props":"General properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link list","is_external":"The URL you entered seems to external link, do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link","link_list":"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code","target_langcode":"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/br_dlg.js b/js/tiny_mce/plugins/advlink/langs/br_dlg.js new file mode 100755 index 000000000..0045d0049 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.advlink_dlg',{target_name:"Nome do alvo",classes:"Classes",style:"Estilo",id:"Id",popup_position:"Posi\u00e7\u00e3o (X/Y)",langdir:"Dire\u00e7\u00e3o do texto",popup_size:"Tamanho",popup_dependent:"Dependente (Mozilla/Firefox apenas)",popup_resizable:"Permitir altera\u00e7\u00e3o do tamanho da janela",popup_location:"Mostrar barra de endere\u00e7os",popup_menubar:"Mostrar barra de menu",popup_toolbar:"Mostrar barras de ferramentas",popup_statusbar:"Mostrar barra de status",popup_scrollbars:"Mostrar barras de scroll",popup_return:"Inserir \'return false\'",popup_name:"Nome da janela",popup_url:"URL do popup",popup:"Popup javascript",target_blank:"Abrir numa nova janela",target_top:"Abrir na p\u00e1gina inteira (substitui todos os quadros)",target_parent:"Abrir na janela/quadro pai",target_same:"Abrir nesta janela/quadro",anchor_names:"\u00c2ncoras",popup_opts:"Op\u00e7\u00f5es",advanced_props:"Propriedades avan\u00e7adas",event_props:"Eventos",popup_props:"Propriedades de popup",general_props:"Propriedades gerais",advanced_tab:"Avan\u00e7ado",events_tab:"Eventos",popup_tab:"Popup",general_tab:"Geral",list:"Lista de hyperlinks",is_external:"A URL digitada parece conduzir a um link externo. Deseja acrescentar o (necess\u00e1rio) prefixo http://?",is_email:"A URL digitada parece ser um endere\u00e7o de e-mail. Deseja acrescentar o (necess\u00e1rio) prefixo mailto:?",titlefield:"T\u00edtulo",target:"Alvo",url:"URL do hyperlink",title:"Inserir/editar hyperlink",link_list:"Lista de hyperlinks",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",accesskey:"Chave de acesso",tabindex:"Tabindex",rev:"Rela\u00e7\u00e3o alvo/p\u00e1gina",rel:"Rela\u00e7\u00e3o p\u00e1gina/alvo",mime:"Tipo MIME alvo",encoding:"Codifica\u00e7\u00e3o de caracteres",langcode:"C\u00f3digo da linguagem",target_langcode:"linguagem alvo"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/bs_dlg.js b/js/tiny_mce/plugins/advlink/langs/bs_dlg.js new file mode 100755 index 000000000..4c5fb4873 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.advlink_dlg',{target_name:"Ime mete",classes:"Klasa",style:"Stil",id:"Id",popup_position:"Pozicija (X/Y)",langdir:"Smjer jezika",popup_size:"Veli\u010dina",popup_dependent:"Ovisan (samo za Mozilla/Firefox)",popup_resizable:"Prozor promjenjive veli\u010dine",popup_location:"Poka\u017ei traku lokacije",popup_menubar:"Poka\u017ei izbornik",popup_toolbar:"Poka\u017ei alatne trake",popup_statusbar:"Poka\u017ei statusnu traku",popup_scrollbars:"Poka\u017ei kliza\u010de",popup_return:"Umetni \'return false\'",popup_name:"Ime prozora",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Otvori u novom prozoru",target_top:"Otvori u gornjem okviru (zamjenjuje sve okvire)",target_parent:"Otvori u izvornom prozoru / okvir",target_same:"Otovori u novom prozoru / okviru",anchor_names:"Sidra",popup_opts:"Opcije",advanced_props:"Napredna svojstva",event_props:"Doga\u0111aji",popup_props:"Svojstva popup prozora",general_props:"Osnovna svojstva",advanced_tab:"Napredno",events_tab:"Doga\u0111aj",popup_tab:"Popup",general_tab:"Osnovno",list:"Lista poveznica",is_external:"URL koji ste unijeli izgleda kao vanjska poveznica, \u017eelite li dodati potrebni http:// prefiks?",is_email:"URL koji ste unijeli izgleda kao e-mail adresa, \u017eelite li dodati potrebni mailto: prefiks?",titlefield:"Naslov",target:"Meta",url:"URL poveznice",title:"Umetni/uredi poveznicu",link_list:"Lista poveznica",rtl:"S desna na lijevo",ltr:"S lijeva na desno",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Odnos mete prema stranici",rel:"Odnos stranice prema meti",mime:"MIME tip",encoding:"Kodiranje znakova",langcode:"Kod jezika",target_langcode:"Jezik"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ca_dlg.js b/js/tiny_mce/plugins/advlink/langs/ca_dlg.js new file mode 100755 index 000000000..c45dd2e21 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.advlink_dlg',{"target_name":"Nom del dest\u00ed",classes:"Classes",style:"Estil",id:"Id","popup_position":"Posici\u00f3 (X/Y)",langdir:"Direcci\u00f3 de l\'idioma","popup_size":"Mida","popup_dependent":"Dependent (nom\u00e9s Mozilla/Firefox)","popup_resizable":"Fes la finestra redimensionable","popup_location":"Mostra la barra d\'ubicaci\u00f3","popup_menubar":"Mostra la barra de men\u00fa","popup_toolbar":"Mostra la barra d\'eines","popup_statusbar":"Mostra la barra d\'estat","popup_scrollbars":"Mostra les barres de despla\u00e7ament","popup_return":"Insereix \'return false\'","popup_name":"Nom de la finestra","popup_url":"URL de la finestra emergent",popup:"Finestra emergent javascript","target_blank":"Obre en una nova finestra","target_top":"Obre en el marc superior (reempla\u00e7a tots els marcs)","target_parent":"Obre en la finestra / marc pare","target_same":"Obre en aquesta finestra / marc","anchor_names":"\u00c0ncores","popup_opts":"Opcions","advanced_props":"Propietats avan\u00e7ades","event_props":"Esdeveniments","popup_props":"Propietats de la finestra emergent","general_props":"Propietats generals","advanced_tab":"Avan\u00e7at","events_tab":"Esdeveniments","popup_tab":"Finestra emergent","general_tab":"General",list:"Llista d\'enlla\u00e7os","is_external":"L\'URL que heu introdu\u00eft sembla ser un enlla\u00e7 extern, voleu afegir-hi el prefix requerit http:// ?","is_email":"L\'URL que heu introdu\u00eft sembla ser una adre\u00e7a de correu electr\u00f2nic, voleu afegir-hi el prefix requerit mailto: ?",titlefield:"T\u00edtol",target:"Objectiu",url:"URL de l\'enlla\u00e7",title:"Insereix/edita enlla\u00e7","link_list":"Llista d\'enlla\u00e7os",rtl:"De dreta a esquerra",ltr:"D\'esquerra a dreta",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relaci\u00f3 de dest\u00ed a p\u00e0gina",rel:"Relaci\u00f3 de p\u00e0gina a dest\u00ed",mime:"Tipus MIME del dest\u00ed",encoding:"Codificaci\u00f3 de car\u00e0cters del dest\u00ed",langcode:"Codi de l\'idioma","target_langcode":"Idioma del dest\u00ed"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ch_dlg.js b/js/tiny_mce/plugins/advlink/langs/ch_dlg.js new file mode 100755 index 000000000..c9dd3ab74 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.advlink_dlg',{target_name:"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",id:"ID",popup_position:"\u4f4d\u7f6e\uff08X/Y\uff09",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",popup_size:"\u5927\u5c0f",popup_dependent:"\u6d4f\u89c8\u5668\u9650\u5236\uff08\u4ec5\u652f\u63f4 Mozilla/Firefox\uff09",popup_resizable:"\u5f39\u7a97\u53ef\u8c03\u6574\u5927\u5c0f",popup_location:"\u663e\u793a\u5730\u5740\u680f",popup_menubar:"\u663e\u793a\u83dc\u5355\u5217",popup_toolbar:"\u663e\u793a\u5de5\u5177\u5217",popup_statusbar:"\u663e\u793a\u72b6\u6001\u5217",popup_scrollbars:"\u663e\u793a\u6eda\u52a8\u6761",popup_return:"\u63d2\u5165 \"return false\"",popup_name:"\u89c6\u7a97\u540d\u79f0",popup_url:"\u5f39\u51fa\u89c6\u7a97URL",popup:"JavaScript \u5f39\u51fa\u89c6\u7a97",target_blank:"\u5728\u65b0\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_top:"\u5728\u9876\u90e8\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_parent:"\u5728\u7236\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_same:"\u5728\u76ee\u524d\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",anchor_names:"\u4e66\u7b7e",popup_opts:"\u9009\u9879",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5f39\u51fa\u89c6\u7a97\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7\u5c5e\u6027",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5f39\u51fa\u89c6\u7a97",general_tab:"\u4e00\u822c",list:"\u8d85\u8fde\u7ed3\u6e05\u5355",is_external:"\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u4e3a\u5916\u90e8\u8d85\u8fde\u7ed3\uff0c\u662f\u5426\u8981\u52a0\u4e0a \"http://\" ?",is_email:"\u60a8\u8f93\u5165\u7684\u4f3c\u4e4e\u662f\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u662f\u5426\u9700\u8981\u52a0 mailto:?",titlefield:"\u6807\u9898",target:"\u76ee\u6807",url:"\u8d85\u8fde\u7ed3URL",title:"\u63d2\u5165/\u7f16\u8f91\u8d85\u8fde\u7ed3",link_list:"\u8d85\u8fde\u7ed3\u6e05\u5355",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u952e",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6807\u5230\u7f51\u9875\u7684\u5173\u7cfb",rel:"\u7f51\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u76ee\u6807\u8bed\u8a00\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801",target_langcode:"\u76ee\u6807\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/cn_dlg.js b/js/tiny_mce/plugins/advlink/langs/cn_dlg.js new file mode 100755 index 000000000..90d554311 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.advlink_dlg',{"target_name":"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",id:"Id\u7f16\u53f7","popup_position":"\u4f4d\u7f6e (X/Y)",langdir:"\u6587\u672c\u65b9\u5411","popup_size":"\u6587\u672c\u5927\u5c0f","popup_dependent":"\u6d4f\u89c8\u5668\u9650\u5236(\u4ec5\u652f\u6280Mozilla/Firefox)","popup_resizable":"\u7a97\u53e3\u5927\u5c0f\u53ef\u8c03","popup_location":"\u663e\u793a\u5730\u5740\u680f","popup_menubar":"\u663e\u793a\u83dc\u5355\u680f","popup_toolbar":"\u663e\u793a\u5de5\u5177\u680f","popup_statusbar":"\u663e\u793a\u72b6\u6001\u680f","popup_scrollbars":"\u663e\u793a\u6eda\u52a8\u6761","popup_return":"\u63d2\u5165 \"return false\"","popup_name":"\u65b0\u7a97\u53e3\u540d\u79f0","popup_url":"\u5f39\u7a97URL\u5730\u5740",popup:"JavaScript \u5f39\u51fa","target_blank":"\u5728\u65b0\u7a97\u53e3\u6253\u5f00","target_top":"\u5728\u9876\u90e8\u7a97\u53e3\u6253\u5f00\u8d85\u94fe\u63a5","target_parent":"\u5728\u7236\u7ea7\u7a97\u53e3\u6253\u5f00\u8d85\u94fe\u63a5","target_same":"\u5728\u76ee\u524d\u7a97\u53e3\u6253\u5f00\u8d85\u94fe\u63a5","anchor_names":"\u951a\u70b9","popup_opts":"\u9009\u9879","advanced_props":"\u9ad8\u7ea7\u5c5e\u6027","event_props":"\u4e8b\u4ef6","popup_props":"\u5f39\u51fa\u5c5e\u6027","general_props":"\u5e38\u89c4\u5c5e\u6027","advanced_tab":"\u9ad8\u7ea7","events_tab":"\u4e8b\u4ef6","popup_tab":"\u5f39\u7a97","general_tab":"\u5e38\u89c4",list:"\u94fe\u63a5\u5217\u8868","is_external":"\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u4e3a\u5916\u90e8\u8d85\u8fde\u7ed3\uff0c\u662f\u5426\u8981\u52a0\u4e0a \u201chttp://\u201d\u524d\u7f00?","is_email":"\u60a8\u8f93\u5165\u7684\u4f3c\u4e4e\u662f\u7535\u5b50\u90ae\u4ef6\u5730\u5740,\u662f\u5426\u9700\u8981\u52a0 mailto:\uff1f",titlefield:"\u6807\u9898",target:"\u76ee\u6807",url:"\u94fe\u63a5URL\u5730\u5740",title:"\u63d2\u5165/\u7f16\u8f91\u94fe\u63a5","link_list":"\u94fe\u63a5\u5217\u8868",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",accesskey:"\u5feb\u6377\u952e",tabindex:"Tab\u952e\u8bbf\u95ee\u987a\u5e8f",rev:"\u76ee\u6807\u5230\u7f51\u9875\u7684\u5173\u7cfb",rel:"\u7f51\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u76ee\u6807\u5b57\u7b26\u96c6\uff08UTF-8\uff09",langcode:"\u8bed\u8a00\u7f16\u7801","target_langcode":"\u76ee\u6807\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/cs_dlg.js b/js/tiny_mce/plugins/advlink/langs/cs_dlg.js new file mode 100755 index 000000000..a1f3ab1bf --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.advlink_dlg',{target_name:"N\u00e1zev c\u00edle",classes:"T\u0159\u00eddy",style:"Styl",id:"ID",popup_position:"Um\u00edst\u011bn\u00ed (X/Y)",langdir:"Sm\u011br textu",popup_size:"Velikost",popup_dependent:"Z\u00e1vislost (pouze Mozilla/Firefox)",popup_resizable:"Umo\u017enit zm\u011bnu velikosti",popup_location:"Zobrazit pole s adresou",popup_menubar:"Zobrazit nab\u00eddku",popup_toolbar:"Zobrazit n\u00e1strojovou li\u0161tu",popup_statusbar:"Zobrazit stavov\u00fd \u0159\u00e1dek",popup_scrollbars:"Zobrazit posuvn\u00edky",popup_return:"Vlo\u017eit \'return false\'",popup_name:"N\u00e1zev okna",popup_url:"URL vyskakovac\u00edho okna",popup:"Javascriptov\u00e9 okno",target_blank:"Otev\u0159\u00edt v nov\u00e9m okn\u011b/r\u00e1mu",target_top:"Otev\u0159\u00edt v hlavn\u00edm okn\u011b/r\u00e1mu (nahradit v\u0161echny r\u00e1my)",target_parent:"Otev\u0159\u00edt v nad\u0159azen\u00e9m okn\u011b/r\u00e1mu",target_same:"Otev\u0159\u00edt v tomto okn\u011b/r\u00e1mu",anchor_names:"Z\u00e1lo\u017eka",popup_opts:"Mo\u017enosti",advanced_props:"Roz\u0161\u00ed\u0159en\u00e9 parametry",event_props:"Ud\u00e1losti",popup_props:"Vlastnosti vyskakovac\u00edho okna",general_props:"Obecn\u00e9 parametry",advanced_tab:"Roz\u0161\u00ed\u0159en\u00e9",events_tab:"Ud\u00e1losti",popup_tab:"Vyskakovac\u00ed okno",general_tab:"Obecn\u00e9",list:"Seznam odkaz\u016f",is_external:"Zadan\u00e9 URL vypad\u00e1 jako extern\u00ed odkaz, chcete doplnit povinn\u00fd prefix http://?",is_email:"Zadan\u00e9 URL vypad\u00e1 jako e-mailov\u00e1 adresa, chcete doplnit povinn\u00fd prefix mailto:?",titlefield:"Titulek",target:"C\u00edl",url:"URL odkazu",title:"Vlo\u017eit/upravit odkaz",link_list:"Seznam odkaz\u016f",rtl:"Zprava doleva",ltr:"Zleva doprava",accesskey:"Kl\u00e1vesov\u00e1 zkratka",tabindex:"Po\u0159ad\u00ed pro tabul\u00e1tor",rev:"Vztah c\u00edle ke str\u00e1nce",rel:"Vztah str\u00e1nky k c\u00edli",mime:"MIME typ",encoding:"K\u00f3dov\u00e1n\u00ed",langcode:"K\u00f3d jazyka",target_langcode:"Jazyk c\u00edle"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/cy_dlg.js b/js/tiny_mce/plugins/advlink/langs/cy_dlg.js new file mode 100755 index 000000000..37acc679c --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.advlink_dlg',{target_name:"Enw targed",classes:"Dosbarthiadau",style:"Arddull",id:"Id",popup_position:"Safle (X/Y)",langdir:"Cyfeiriad iaith",popup_size:"Maint",popup_dependent:"Dibynnol (dim ond Mozilla/Firefox)",popup_resizable:"Gwneud ffenest yn ailfeintiol",popup_location:"Dangos bar lleoliad",popup_menubar:"Dangos bar dewislen",popup_toolbar:"Dangos barrau offer",popup_statusbar:"Dangor bar statws",popup_scrollbars:"Dangos bar sgrolio",popup_return:"Mewnosod \'return false\'",popup_name:"Enw ffenest",popup_url:"URL naidlen",popup:"Naidlen JavaScript",target_blank:"Agor mewn ffenest newydd",target_top:"Agor mewn pen ffr\u00e2m (amnewid pob ffr\u00e2m)",target_parent:"Agos mewn y ffenest / ffr\u00e2m rhiant",target_same:"Agos mewn y ffenest / ffr\u00e2m yma",anchor_names:"Angorau",popup_opts:"Dewisiadau",advanced_props:"Priodweddau uwch",event_props:"Digwyddiadau",popup_props:"Priodweddau cyffredinol",general_props:"Priodweddau cyfferdinol",advanced_tab:"Uwch",events_tab:"Digwyddiadau",popup_tab:"Naidlen",general_tab:"Cyffredinol",list:"Rhestr cysylltau",is_external:"Mae\'r URL a rydych wedi rhoi yn edrych fel cyswllt allannol, ydych chi eisiau ychwanegu\'r rhagddodiad http:// sydd angen?",is_email:"Mae\'r URL a rydych wedi rhoi yn edrych fel cyferiad e-bost, ydych chi eisiau ychwanegu\'r rhagddodiad mailto: sydd angen?",titlefield:"Teitl",target:"Targed",url:"URL cyswllt",title:"Mewnosod/Golygu cyswllt",link_list:"Rhestr cysylltau",rtl:"De i\'r chwith",ltr:"Chwith i\'r dde",accesskey:"Bysell mynediad",tabindex:"Trefn tabio",rev:"Perthynas y targed i\'r tudalen",rel:"Perthynas y tudalen i\'r targed",mime:"Math MIME targed",encoding:"Amgodiad nodau targed",langcode:"Cod iaith",target_langcode:"Iaith targed"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/da_dlg.js b/js/tiny_mce/plugins/advlink/langs/da_dlg.js new file mode 100755 index 000000000..cac424619 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.advlink_dlg',{target_name:"Destinationsnavn",classes:"Klasser",style:"Stil",id:"Id",popup_position:"Position (X/Y)",langdir:"Sprogretning",popup_size:"St\u00f8rrelse",popup_dependent:"Afh\u00e6ngig (Kun Mozilla/Firefox)",popup_resizable:"Lad det v\u00e6re muligt at \u00e6ndre st\u00f8rrelsen p\u00e5 vinduet",popup_location:"Vis adresselinje",popup_menubar:"Vis menulinje",popup_toolbar:"Vis v\u00e6rkt\u00f8jslinjer",popup_statusbar:"Vis statuslinje",popup_scrollbars:"Vis rullepanel",popup_return:"Inds\u00e6t \'return false\'",popup_name:"Vinduesnavn",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"\u00c5ben i nyt vindue",target_top:"\u00c5ben i \u00f8verste vindue / ramme (erstatter alle rammer)",target_parent:"\u00c5ben i overliggende vindue / ramme",target_same:"\u00c5ben i dette vindue / ramme",anchor_names:"Ankre",popup_opts:"Indstillinger",advanced_props:"Avancerede egenskaber",event_props:"H\u00e6ndelser",popup_props:"Popup egenskaber",general_props:"Generelle egenskaber",advanced_tab:"Advanceret",events_tab:"H\u00e6ndelser",popup_tab:"Popup",general_tab:"Generelt",list:"Liste over links",is_external:"Den URL, der er indtastet, ser ud til at v\u00e6re et eksternt link. Vil du have tilf\u00f8jet det p\u00e5kr\u00e6vede http:// foran?",is_email:"Den URL, der er indtastet, ser ud til at v\u00e6re en emailadresse. Vil du have tilf\u00f8jet det p\u00e5kr\u00e6vede mailto: foran?",titlefield:"Titel",target:"M\u00e5l",url:"Link URL",title:"Inds\u00e6t/rediger link",link_list:"Liste over links",rtl:"H\u00f8jre mod venstre",ltr:"Venstre mod h\u00f8jre",accesskey:"Genvejstast",tabindex:"Tabindex",rev:"Relativ destination til side",rel:"Relativ side til destination",mime:"Destinations-MIME-type",encoding:"Destinationstegns\u00e6t",langcode:"Sprogkode",target_langcode:"Destinationssprog"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/de_dlg.js b/js/tiny_mce/plugins/advlink/langs/de_dlg.js new file mode 100755 index 000000000..e18e7c158 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.advlink_dlg',{target_name:"Name der Zielseite",classes:"Klassen",style:"Format",id:"ID",popup_position:"Position (X/Y)",langdir:"Schriftrichtung",popup_size:"Gr\u00f6\u00dfe",popup_dependent:"Vom Elternfenster abh\u00e4ngig
        (nur Mozilla/Firefox) ",popup_resizable:"Vergr\u00f6\u00dfern des Fenster zulassen",popup_location:"Adressleiste anzeigen",popup_menubar:"Browsermen\u00fc anzeigen",popup_toolbar:"Werkzeugleisten anzeigen",popup_statusbar:"Statusleiste anzeigen",popup_scrollbars:"Scrollbalken anzeigen",popup_return:"Link trotz Popup folgen",popup_name:"Name des Fensters",popup_url:"Popup-Adresse",popup:"JavaScript-Popup",target_blank:"In neuem Fenster \u00f6ffnen",target_top:"Im obersten Frame \u00f6ffnen (sprengt das Frameset)",target_parent:"Im \u00fcbergeordneten Fenster/Frame \u00f6ffnen",target_same:"Im selben Fenster/Frame \u00f6ffnen",anchor_names:"Anker",popup_opts:"Optionen",advanced_props:"Erweiterte Eigenschaften",event_props:"Ereignisse",popup_props:"Popup-Eigenschaften",general_props:"Allemeine Eigenschaften",advanced_tab:"Erweitert",events_tab:"Ereignisse",popup_tab:"Popup",general_tab:"Allgemein",list:"Linkliste",is_external:"Diese Adresse scheint ein externer Link zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"http://\" voranstellen?",is_email:"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00f6chten Sie das dazu ben\u00f6tigte \"mailto:\" voranstellen?",titlefield:"Titel",target:"Fenster",url:"Adresse",title:"Link einf\u00fcgen/bearbeiten",link_list:"Linkliste",rtl:"Rechts nach links",ltr:"Links nach rechts",accesskey:"Tastenk\u00fcrzel",tabindex:"Tabindex",rev:"Beziehung des Linkziels zur Seite",rel:"Beziehung der Seite zum Linkziel",mime:"MIME-Type der Zielseite",encoding:"Zeichenkodierung der Zielseite",langcode:"Sprachcode",target_langcode:"Sprache der Zielseite"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/dv_dlg.js b/js/tiny_mce/plugins/advlink/langs/dv_dlg.js new file mode 100755 index 000000000..84d7ebe14 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/el_dlg.js b/js/tiny_mce/plugins/advlink/langs/el_dlg.js new file mode 100755 index 000000000..b4e2a61d9 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.advlink_dlg',{target_name:"\u038c\u03bd\u03bf\u03bc\u03b1 \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5",classes:"\u039a\u03bb\u03ac\u03c3\u03b5\u03b9\u03c2",style:"\u03a3\u03c4\u03c5\u03bb",id:"Id",popup_position:"\u0398\u03ad\u03c3\u03b7 (X/Y)",langdir:"\u039a\u03b1\u03c4\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",popup_size:"\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2",popup_dependent:"\u0395\u03be\u03b1\u03c1\u03c4\u03ce\u03bc\u03b5\u03bd\u03bf (\u03bc\u03cc\u03bd\u03bf \u03b3\u03b9\u03b1 Mozilla/Firefox)",popup_resizable:"\u039d\u03b1 \u03b1\u03bb\u03bb\u03ac\u03b6\u03bf\u03c5\u03bd \u03bf\u03b9 \u03b4\u03b9\u03b1\u03c3\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03b1\u03b8\u03cd\u03c1\u03bf\u03c5",popup_location:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2 \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1\u03c2",popup_menubar:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03bc\u03b5\u03bd\u03bf\u03cd",popup_toolbar:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd \u03b5\u03c1\u03b3\u03b1\u03bb\u03b5\u03af\u03c9\u03bd",popup_statusbar:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2",popup_scrollbars:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c1\u03ac\u03b2\u03b4\u03c9\u03bd \u03ba\u03cd\u03bb\u03b9\u03c3\u03b7\u03c2",popup_return:"\u0395\u03b9\u03c3\u03b1\u03b3\u03c9\u03b3\u03ae \'return false\'",popup_name:"\u038c\u03bd\u03bf\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03b8\u03cd\u03c1\u03bf\u03c5",popup_url:"\u0394\u03b9\u03b1\u03b4\u03c1\u03bf\u03bc\u03ae URL \u03c4\u03bf\u03c5 Popup",popup:"Javascript popup",target_blank:"\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c3\u03b5 \u03bd\u03ad\u03bf \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf",target_top:"\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c3\u03c4\u03bf \u03c0\u03b9\u03bf \u03c0\u03ac\u03bd\u03c9 frame (\u03b1\u03bd\u03c4\u03b9\u03ba\u03b1\u03b8\u03b9\u03c3\u03c4\u03ac \u03cc\u03bb\u03b1 \u03c4\u03b1 frames)",target_parent:"\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c3\u03c4\u03bf \u03b3\u03bf\u03bd\u03b9\u03ba\u03cc window / frame",target_same:"\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c3\u03b5 \u03af\u03b4\u03b9\u03bf \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf / frame",anchor_names:"Anchors",popup_opts:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2",advanced_props:"\u03a0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03b5\u03c2 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2",event_props:"\u0393\u03b5\u03b3\u03bf\u03bd\u03cc\u03c4\u03b1",popup_props:"\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 Popup",general_props:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ad\u03c2 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2",advanced_tab:"\u0393\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03bf\u03c5\u03c2",events_tab:"\u0393\u03b5\u03b3\u03bf\u03bd\u03cc\u03c4\u03b1",popup_tab:"Popup",general_tab:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac",list:"\u039b\u03af\u03c3\u03c4\u03b1 \u03c3\u03c5\u03bd\u03b4\u03ad\u03c3\u03bc\u03c9\u03bd",is_external:"\u0397 \u03b4\u03b9\u03b1\u03b4\u03c1\u03bf\u03bc\u03ae URL \u03c0\u03bf\u03c5 \u03b5\u03b9\u03c3\u03ac\u03b3\u03b1\u03c4\u03b5 \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03be\u03c9\u03c4\u03b5\u03c1\u03b9\u03ba\u03cc\u03c2 \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03bc\u03bf\u03c2, \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c4\u03b5\u03b8\u03b5\u03af \u03c4\u03bf \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03bf http:// ;",is_email:"\u0397 \u03b4\u03b9\u03b1\u03b4\u03c1\u03bf\u03bc\u03ae URL \u03c0\u03bf\u03c5 \u03b5\u03b9\u03c3\u03ac\u03b3\u03b1\u03c4\u03b5 \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 email, \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c4\u03b5\u03b8\u03b5\u03af \u03c4\u03bf \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03bf mailto: ;",titlefield:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",target:"\u03a3\u03c4\u03cc\u03c7\u03bf\u03c2",url:"\u0394\u03b9\u03b1\u03b4\u03c1\u03bf\u03bc\u03ae URL \u03c3\u03c5\u03bd\u03b4\u03ad\u03c3\u03bc\u03bf\u03c5",title:"\u0395\u03b9\u03c3\u03b1\u03b3\u03c9\u03b3\u03ae/\u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c3\u03c5\u03bd\u03b4\u03ad\u03c3\u03bc\u03bf\u03c5",link_list:"\u039b\u03af\u03c3\u03c4\u03b1 \u03c3\u03c5\u03bd\u03b4\u03ad\u03c3\u03bc\u03c9\u03bd",rtl:"\u0394\u03b5\u03be\u03b9\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",ltr:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b4\u03b5\u03be\u03b9\u03ac",accesskey:"\u03a0\u03bb\u03ae\u03ba\u03c4\u03c1\u03bf \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2",tabindex:"Tabindex",rev:"\u03a3\u03c7\u03ad\u03c3\u03b7 \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5 \u03c0\u03c1\u03bf\u03c2 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 (REV)",rel:"\u03a3\u03c7\u03ad\u03c3\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c2 \u03c3\u03c4\u03cc\u03c7\u03bf (REL)",mime:"\u03a4\u03cd\u03c0\u03bf\u03c2 MIME \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5",encoding:"\u039a\u03c9\u03b4\u03b9\u03ba\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03c9\u03bd \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5",langcode:"\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",target_langcode:"\u0393\u03bb\u03ce\u03c3\u03c3\u03b1 \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/en_dlg.js b/js/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100644 index 000000000..dba4e88ce --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target name",classes:"Classes",style:"Style",id:"Id","popup_position":"Position (X/Y)",langdir:"Language direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox only)","popup_resizable":"Make window resizable","popup_location":"Show location bar","popup_menubar":"Show menu bar","popup_toolbar":"Show toolbars","popup_statusbar":"Show status bar","popup_scrollbars":"Show scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window name","popup_url":"Popup URL",popup:"Javascript popup","target_blank":"Open in new window","target_top":"Open in top frame (replaces all frames)","target_parent":"Open in parent window / frame","target_same":"Open in this window / frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced properties","event_props":"Events","popup_props":"Popup properties","general_props":"General properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link list","is_external":"The URL you entered seems to external link, do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link","link_list":"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code","target_langcode":"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/es_dlg.js b/js/tiny_mce/plugins/advlink/langs/es_dlg.js new file mode 100755 index 000000000..aaede5138 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.advlink_dlg',{"target_name":"Nombre del Target",classes:"Clases",style:"Estilo",id:"Id","popup_position":"Posici\u00f3n (X/Y)",langdir:"Direcci\u00f3n del lenguaje","popup_size":"Tama\u00f1o","popup_dependent":"Dependientes (s\u00f3lo Mozilla/Firefox)","popup_resizable":"Permitir cambiar el tama\u00f1o de la ventana","popup_location":"Barra de localizaci\u00f3n","popup_menubar":"Barra de men\u00fa","popup_toolbar":"Barra de herramientas","popup_statusbar":"Barra de estado","popup_scrollbars":"Barras de desplazamiento","popup_return":"Insertar \'return false\'","popup_name":"Nombre de la ventana","popup_url":"URL de la ventana emergente",popup:"Javascript popup","target_blank":"Abrir en ventana nueva","target_top":"Abrir en el marco superior (reemplaza todos los marcos)","target_parent":"Abrir en ventana padre / marco","target_same":"Abrir en esta ventana / marco","anchor_names":"Anclas","popup_opts":"Opciones","advanced_props":"Propiedades avanzadas","event_props":"Eventos","popup_props":"Propiedades de ventanas emergentes","general_props":"Propiedades generales","advanced_tab":"Avanzado","events_tab":"Eventos","popup_tab":"Ventana emergente","general_tab":"General",list:"Lista de v\u00ednculos","is_external":"La URL que ha introducido parece ser un v\u00ednculo externo, \u00bfdesea agregar el prefijo http:// necesario?","is_email":"La URL que ha introducido parece ser una direci\u00f3n de correo, \u00bfdesea agregar el prefijo mailto: necesario?",titlefield:"T\u00edtulo",target:"Destino",url:"URL del hiperv\u00ednculo",title:"Insertar/editar hiperv\u00ednculo","link_list":"Lista de v\u00ednculo",rtl:"Derecha a izquierda",ltr:"Izquierda a derecha",accesskey:"Tecla de acceso",tabindex:"Indice de tabulaci\u00f3n",rev:"Relaci\u00f3n target a p\u00e1gina",rel:"Relaci\u00f3n p\u00e1gina a target",mime:"Tipo MIME del Target",encoding:"Codificaci\u00f3n de caracteres del Target",langcode:"C\u00f3digo del lenguaje","target_langcode":"Lenguaje del Target"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/et_dlg.js b/js/tiny_mce/plugins/advlink/langs/et_dlg.js new file mode 100755 index 000000000..954cdd59a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.advlink_dlg',{target_name:"Sihtm\u00e4rgi nimi",classes:"Klassid",style:"Stiil",id:"ID",popup_position:"Positsioon (X/Y)",langdir:"Keele suund",popup_size:"Suurus",popup_dependent:"S\u00f5ltuv (ainult Mozilla/Firefox)",popup_resizable:"Muuda akna suurus muudetavaks",popup_location:"N\u00e4ita asukohariba",popup_menubar:"N\u00e4ita men\u00fc\u00fcriba",popup_toolbar:"N\u00e4ita seadistusriba",popup_statusbar:"N\u00e4ita staatuse riba",popup_scrollbars:"N\u00e4ita kerimisribasid",popup_return:"Sisesta \'tagasiminek eba\u00f5nnestus\'",popup_name:"Akna nimi",popup_url:"Pop-up\u2019i URL",popup:"Javascript\u2019i pop-up",target_blank:"Ava uues aknas",target_top:"Ava k\u00f5rgeimas raamis (asenda k\u00f5ik raamid)",target_parent:"Ava pea-aknas/raamis",target_same:"Ava selles aknas/raamis",anchor_names:"Ankrud",popup_opts:"Valikud",advanced_props:"\u00dcldised seadistused",event_props:"S\u00fcndmused",popup_props:"Pop-up\u2019i seadistus",general_props:"\u00dcldised seadistused",advanced_tab:"P\u00f5hjalikum",events_tab:"S\u00fcndmused",popup_tab:"Pop-up",general_tab:"\u00dcldine",list:"Linkide nimekiri",is_external:"URL, mille sisestasid, tundub olevat v\u00e4line link, kas soovid sellele lisada http://?",is_email:" URL, mille sisestasid, tundub olevat e-posti aadress, kas soovid sellele lisada mailto: funktsiooni?",titlefield:"Pealkiri",target:"Sihtm\u00e4rk",url:" URL\u2019i link",title:"Sisesta muuda linki",link_list:"Linkide list",rtl:"Paremalt vasakule",ltr:"Vasakult paremale",accesskey:"Ligip\u00e4\u00e4suklahv",tabindex:"Sisujuht",rev:"Seo sihtm\u00e4rk lehega",rel:"Seo leht sihtm\u00e4rgiga",mime:"M\u00e4rgista MIME t\u00fc\u00fcp",encoding:"Sihtm\u00e4rgi kodeering",langcode:"Keele kood",target_langcode:"Sihtm\u00e4rgi keel"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/eu_dlg.js b/js/tiny_mce/plugins/advlink/langs/eu_dlg.js new file mode 100755 index 000000000..430a5dd54 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.advlink_dlg',{target_name:"Helburuaren izena",classes:"Klaseak",style:"Estiloa",id:"Id",popup_position:"Kokapena (X/Y)",langdir:"Hizkuntzaren norabidea",popup_size:"Tamaina",popup_dependent:"Menpekoa (Mozilla/Firefoxen bakarrik)",popup_resizable:"Leihoaren tamaina aldatzea aktibatu",popup_location:"Helbide-barra erakutsi",popup_menubar:"Menu-barra erakutsi",popup_toolbar:"Tresna-barrak erakutsi",popup_statusbar:"Egoera-barra erakutsi",popup_scrollbars:"Gora-behera barra erakutsi",popup_return:"\'return false\' txertatu",popup_name:"Leihoaren izena",popup_url:"Popuparen URL helbidea",popup:"Javascript popupa",target_blank:"Leiho berrian ireki",target_top:"Gorengo markoan ireki (marko guztiak ordezkatzen ditu)",target_parent:"Leiho/marko gurasoan ireki",target_same:"Leiho/marko honetan ireki",anchor_names:"Aingurak",popup_opts:"Aukerak",advanced_props:"Aukera aurreratuak",event_props:"Ebentuak",popup_props:"Popuparen aukerak",general_props:"Aukera orokorrak",advanced_tab:"Gehigarriak",events_tab:"Ebentuak",popup_tab:"Popupa",general_tab:"Orokorra",list:"Lotura-zerrenda",is_external:"Sartutako helbideak kanpoko webgune batena dirudi, aurretik http:// gehitzea nahi duzu?",is_email:"Sartutako helbideak e-posta bat dirudi, aurretik mailto: gehitzea nahi duzu?",titlefield:"Izenburua",target:"Helburua",url:"Loturaren URL helbidea",title:"Lotura txertatu/editatu",link_list:"Lotura-zerrenda",rtl:"Eskuinetik ezkerrera",ltr:"Ezkerretik eskuinera",accesskey:"Laster-tekla",tabindex:"Tabulazio ordena",rev:"Helburuaren eta orrialdearen arteko erlazioa",rel:"Orrialdearen eta helburuaren arteko erlazioa",mime:"Helburuaren MIME mota",encoding:"Helburuaren karaktere-kodeketa",langcode:"Hizkuntza-kodea",target_langcode:"Helburu-hizkuntza"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/fa_dlg.js b/js/tiny_mce/plugins/advlink/langs/fa_dlg.js new file mode 100755 index 000000000..fc5872261 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.advlink_dlg',{target_name:"\u0646\u0627\u0645 \u0645\u0642\u0635\u062f (Target)",classes:"\u06a9\u0644\u0627\u0633 \u0647\u0627",style:"\u0627\u0633\u062a\u06cc\u0644",id:"\u0634\u0646\u0627\u0633\u0647",popup_position:"\u0645\u0648\u0642\u0639\u06cc\u062a (X/Y)",langdir:"\u062c\u0647\u062a \u0632\u0628\u0627\u0646",popup_size:"\u0627\u0646\u062f\u0627\u0632\u0647",popup_dependent:"\u0648\u0627\u0628\u0633\u062a\u0647 (\u0641\u0642\u0637 Mozilla/Firefox)",popup_resizable:"\u0627\u06cc\u062c\u0627\u062f \u067e\u0646\u062c\u0631\u0647 \u0642\u0627\u0628\u0644 \u0627\u0646\u062f\u0627\u0632\u0647 \u0628\u0646\u062f\u06cc \u0645\u062c\u062f\u062f",popup_location:"\u0646\u0645\u0627\u06cc\u0634 \u0646\u0648\u0627\u0631 \u0645\u06a9\u0627\u0646",popup_menubar:"\u0646\u0645\u0627\u06cc\u0634 \u0646\u0648\u0627\u0631 \u0645\u0646\u0648",popup_toolbar:"\u0646\u0645\u0627\u06cc\u0634 \u0646\u0648\u0627\u0631 \u0627\u0628\u0632\u0627\u0631",popup_statusbar:"\u0646\u0645\u0627\u06cc\u0634 \u0646\u0648\u0627\u0631 \u0648\u0636\u0639\u06cc\u062a",popup_scrollbars:"\u0646\u0645\u0627\u06cc\u0634 \u0646\u0648\u0627\u0631 \u067e\u06cc\u0645\u0627\u06cc\u0634 \u0647\u0627",popup_return:"\u062f\u0631\u062c \'return false\'",popup_name:"\u0646\u0627\u0645 \u067e\u0646\u062c\u0631\u0647",popup_url:"URL \u067e\u0646\u062c\u0631\u0647 \u0628\u0627\u0632\u0634\u0648 (Popup)",popup:"\u067e\u0646\u062c\u0631\u0647 \u0628\u0627\u0632\u0634\u0648\u06cc Javascript",target_blank:"\u0628\u0627\u0632\u0634\u062f\u0646 \u062f\u0631 \u067e\u0646\u062c\u0631\u0647 \u062c\u062f\u06cc\u062f",target_top:"\u0628\u0627\u0632\u0634\u062f\u0646 \u062f\u0631 \u0642\u0627\u0628 \u0628\u0627\u0644\u0627 (Top Frame) (\u062a\u0645\u0627\u0645\u06cc \u0642\u0627\u0628 \u0647\u0627 \u0631\u0627 \u062a\u0639\u0648\u06cc\u0636 \u0645\u06cc \u06a9\u0646\u062f)",target_parent:"\u0628\u0627\u0632\u0634\u062f\u0646 \u062f\u0631 \u067e\u0646\u062c\u0631\u0647 / \u0642\u0627\u0628 \u0648\u0627\u0644\u062f (Parent Frame)",target_same:"\u0628\u0627\u0632\u0634\u062f\u0646 \u062f\u0631 \u0627\u06cc\u0646 \u067e\u0646\u062c\u0631\u0647 / \u0642\u0627\u0628 (Frame)",anchor_names:"\u0644\u0646\u06af\u0631\u0647\u0627 (Anchor)",popup_opts:"\u06af\u0632\u06cc\u0646\u0647 \u0647\u0627",advanced_props:"\u0645\u0634\u062e\u0635\u0627\u062a \u067e\u06cc\u0634\u0631\u0641\u062a\u0647",event_props:"\u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627",popup_props:"\u0645\u0634\u062e\u0635\u0627\u062a \u067e\u0646\u062c\u0631\u0647 \u0628\u0627\u0632\u0634\u0648 (Popup)",general_props:"\u0645\u0634\u062e\u0635\u0627\u062a \u0639\u0645\u0648\u0645\u06cc",advanced_tab:"\u067e\u06cc\u0634\u0631\u0641\u062a\u0647",events_tab:"\u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627",popup_tab:"\u067e\u0646\u062c\u0631\u0647 \u0628\u0627\u0632\u0634\u0648 (Popup)",general_tab:"\u0639\u0645\u0648\u0645\u06cc",list:"\u0644\u06cc\u0633\u062a \u0644\u06cc\u0646\u06a9",is_external:"URL \u06cc \u06a9\u0647 \u0648\u0627\u0631\u062f \u06a9\u0631\u062f\u0647 \u0627\u06cc\u062f \u0628\u0647 \u0646\u0638\u0631 \u0645\u06cc \u0622\u06cc\u062f \u06a9\u0647 \u06cc\u06a9 \u0644\u06cc\u0646\u06a9 \u062e\u0627\u0631\u062c\u06cc \u0645\u06cc \u0628\u0627\u0634\u062f \u060c \u0622\u06cc\u0627 \u0645\u0627\u06cc\u0644\u06cc\u062f \u062a\u0627 \u067e\u06cc\u0634\u0648\u0646\u062f \u0644\u0627\u0632\u0645\u0647 //:http \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0646\u0645\u0627\u0626\u06cc\u062f\u061f",is_email:"URL \u06cc \u06a9\u0647 \u0648\u0627\u0631\u062f \u06a9\u0631\u062f\u0647 \u0627\u06cc\u062f \u0628\u0647 \u0646\u0638\u0631 \u0645\u06cc \u0622\u06cc\u062f \u06a9\u0647 \u06cc\u06a9 \u0622\u062f\u0631\u0633 \u0627\u06cc\u0645\u06cc\u0644 \u0645\u06cc \u0628\u0627\u0634\u062f \u060c \u0622\u06cc\u0627 \u0645\u0627\u06cc\u0644\u06cc\u062f \u062a\u0627 \u067e\u06cc\u0634\u0648\u0646\u062f \u0644\u0627\u0632\u0645\u0647 :mailto \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0646\u0645\u0627\u0626\u06cc\u062f\u061f",titlefield:"\u0639\u0646\u0648\u0627\u0646",target:"\u0645\u0642\u0635\u062f (Target)",url:"URL \u0644\u06cc\u0646\u06a9",title:"\u062f\u0631\u062c/\u0648\u06cc\u0631\u0627\u06cc\u0634 \u0644\u06cc\u0646\u06a9",link_list:"\u0644\u06cc\u0633\u062a \u0644\u06cc\u0646\u06a9",rtl:"\u0631\u0627\u0633\u062a \u0628\u0647 \u0686\u067e",ltr:"\u0686\u067e \u0628\u0647 \u0631\u0627\u0633\u062a",accesskey:"Accesskey",tabindex:"Tabindex",rev:"\u0631\u0627\u0628\u0637\u0647 \u0645\u0642\u0635\u062f (Target) \u0628\u0627 \u0635\u0641\u062d\u0647",rel:"\u0631\u0627\u0628\u0637\u0647 \u0635\u0641\u062d\u0647 \u0628\u0627 \u0645\u0642\u0635\u062f (Target)",mime:"\u0646\u0648\u0639 MIME \u0645\u0642\u0635\u062f (Target)",encoding:"\u0631\u0645\u0632\u06af\u0630\u0627\u0631\u06cc \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631 \u0645\u0642\u0635\u062f (Target)",langcode:"\u06a9\u062f \u0632\u0628\u0627\u0646",target_langcode:"\u0632\u0628\u0627\u0646 \u0645\u0642\u0635\u062f (Target)"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/fi_dlg.js b/js/tiny_mce/plugins/advlink/langs/fi_dlg.js new file mode 100755 index 000000000..0b3b568f7 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.advlink_dlg',{target_name:"Kohteen nimi",classes:"Luokat",style:"Tyyli",id:"Id",popup_position:"Sijainti (X/Y)",langdir:"Kielen suunta",popup_size:"Koko",popup_dependent:"Riippuvainen (vain Mozilla/Firefox)",popup_resizable:"Tee ikkunan koko muokattavaksi",popup_location:"N\u00e4yt\u00e4 sijaintipalkki",popup_menubar:"N\u00e4yt\u00e4 valikkopalkki",popup_toolbar:"N\u00e4yt\u00e4 ty\u00f6kalut",popup_statusbar:"N\u00e4yt\u00e4 tilapalkki",popup_scrollbars:"N\u00e4yt\u00e4 vierityspalkit",popup_return:"Lis\u00e4\u00e4 \'return false\'",popup_name:"Ikkunan nimi",popup_url:"Ponnahdusikkunan URL",popup:"JavaScript-ponnahdusikkuna",target_blank:"Avaa uudessa ikkunassa",target_top:"Avaa ylimm\u00e4ss\u00e4 ruudussa (korvaa kaikki ruudut)",target_parent:"Avaa ylemm\u00e4ss\u00e4 ikkunassa",target_same:"Avaa t\u00e4ss\u00e4 ikkunassa",anchor_names:"Ankkurit",popup_opts:"Valinta",advanced_props:"Edistyneet asetukset",event_props:"Tapahtumat (events)",popup_props:"Ponnahdusikkunan asetukset",general_props:"Yleiset asetukset",advanced_tab:"Edistynyt",events_tab:"Tapahtumat",popup_tab:"Ponnahdusikkuna",general_tab:"Yleiset",list:"Linkkilista",is_external:"Sy\u00f6tt\u00e4m\u00e4si URL n\u00e4ytt\u00e4\u00e4 olevan sivuston ulkoinen osoite, haluatko lis\u00e4t\u00e4 http://-etuliitteen?",is_email:"Sy\u00f6tt\u00e4m\u00e4si URL n\u00e4ytt\u00e4\u00e4 olevan s\u00e4hk\u00f6postiosoite, haluatko lis\u00e4t\u00e4 mailto:-etuliitteen?",titlefield:"Otsikko",target:"Kohde (target)",url:"Linkin URL",title:"Lis\u00e4\u00e4/muokkaa linkki\u00e4",link_list:"Linkkilista",rtl:"Oikealta vasemmalle",ltr:"Vasemmalta oikealle",accesskey:"Pikan\u00e4pp\u00e4in",tabindex:"Tabulaattori-indeksi",rev:"Kohteen suhde sivuun",rel:"Sivun suhde kohteeseen",mime:"Kohteen MIME-tyyppi",encoding:"Kohteen merkist\u00f6koodaus",langcode:"Kielen koodi",target_langcode:"Kohteen kieli"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/fr_dlg.js b/js/tiny_mce/plugins/advlink/langs/fr_dlg.js new file mode 100755 index 000000000..2213e0de6 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.advlink_dlg',{target_name:"Nom de la cible",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Sens de lecture",popup_size:"Taille",popup_dependent:"D\u00e9pendante (seulement sous Mozilla/Firefox)",popup_resizable:"Autoriser le redimensionnement de la fen\u00eatre",popup_location:"Afficher la barre d\'adresse",popup_menubar:"Afficher la barre de menu",popup_toolbar:"Afficher la barre d\'outils",popup_statusbar:"Afficher la barre d\'\u00e9tat",popup_scrollbars:"Afficher les ascenseurs",popup_return:"Ins\u00e9rer \'return false\'",popup_name:"Nom de la fen\u00eatre",popup_url:"URL de la popup",popup:"Popup Javascript",target_blank:"Ouvrir dans une nouvelle fen\u00eatre",target_top:"Ouvrir dans le cadre principal (remplace tous les cadres)",target_parent:"Ouvrir dans la fen\u00eatre / le cadre parent",target_same:"Ouvrir dans cette fen\u00eatre / dans ce cadre",anchor_names:"Ancres",popup_opts:"Options",advanced_props:"Propri\u00e9t\u00e9s avanc\u00e9es",event_props:"\u00c9v\u00e8nements",popup_props:"Propri\u00e9t\u00e9s de la popup",general_props:"Propri\u00e9t\u00e9s g\u00e9n\u00e9rales",advanced_tab:"Avanc\u00e9",events_tab:"\u00c9v\u00e8nements",popup_tab:"Popup",general_tab:"G\u00e9n\u00e9ral",list:"Liste de liens",is_external:"L\'URL que vous avez saisie semble \u00eatre une adresse web externe. Souhaitez-vous ajouter le pr\u00e9fixe \u00ab http:// \u00bb ?",is_email:"L\'URL que vous avez saisie semble \u00eatre une adresse e-mail, souhaitez-vous ajouter le pr\u00e9fixe \u00ab mailto: \u00bb ?",titlefield:"Titre",target:"Cible",url:"URL du lien",title:"Ins\u00e9rer / \u00e9diter un lien",link_list:"Liste des liens",rtl:"Droite \u00e0 gauche",ltr:"Gauche \u00e0 droite",accesskey:"Touche d\'acc\u00e8s rapide",tabindex:"Tabindex",rev:"Relation de la cible \u00e0 la page",rel:"Relation de la page \u00e0 la cible",mime:"Type MIME de la cible",encoding:"Encodage de la cible",langcode:"Code de la langue",target_langcode:"Langue de la cible"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/gl_dlg.js b/js/tiny_mce/plugins/advlink/langs/gl_dlg.js new file mode 100755 index 000000000..382156bc5 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.advlink_dlg',{target_name:"Nome do obxetivo",classes:"Clases",style:"Estilo",id:"Id",popup_position:"Posici\u00f3n (X/Y)",langdir:"Direcci\u00f3n da lenguaxe",popup_size:"Tama\u00f1o",popup_dependent:"Dependentes (s\u00f3lo Mozilla/Firefox)",popup_resizable:"Permitir cambia-lo tama\u00f1o da vent\u00e1",popup_location:"Barra de localizaci\u00f3n",popup_menubar:"Barra de men\u00fa",popup_toolbar:"Barra de ferramentas",popup_statusbar:"Barra de estado",popup_scrollbars:"Barras de desprazamento",popup_return:"Insertar \'return false\'",popup_name:"Nome da vent\u00e1",popup_url:"URL da vent\u00e1 emerxente",popup:"Javascript popup",target_blank:"Abrir en vent\u00e1 nova",target_top:"Abrir no marco superior (reemplaza todo-los marcos)",target_parent:"Abrir na vent\u00e1 / marco padre",target_same:"Abrir nesta vent\u00e1 / marco",anchor_names:"\u00c1ncoras",popup_opts:"Opci\u00f3ns",advanced_props:"Propiedades avanzadas",event_props:"Eventos",popup_props:"Propiedades de vent\u00e1s emerxentes",general_props:"Propiedades xerales",advanced_tab:"Avanzado",events_tab:"Eventos",popup_tab:"Ventana emerxente",general_tab:"Xeral",list:"Lista de v\u00ednculos",is_external:"A URL introducida semella ser un v\u00ednculo externo, \u00bfDesexa engadi-lo prefixo necesario http://?",is_email:"A URL introducida semella ser un enderezo de e-mail, \u00bfDesexa engadi-lo prefixo necesario mailto:?",titlefield:"T\u00edtulo",target:"Destino",url:"URL do hiperv\u00ednculo",title:"Insertar/editar hiperv\u00ednculo",link_list:"Lista de v\u00ednculo",rtl:"Dereita a esquerda",ltr:"Esquerda a dereita",accesskey:"Tecla de acceso",tabindex:"\u00cdndice de tabulaci\u00f3n",rev:"Relaci\u00f3n obxetivo a p\u00e1xina",rel:"Relaci\u00f3n p\u00e1xina a obxetivo",mime:"Tipo MIME do obxetivo",encoding:"Codificaci\u00f3n de caracteres do obxetivo",langcode:"C\u00f3digo da lenguaxe",target_langcode:"Lenguaxe do obxetivo"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/gu_dlg.js b/js/tiny_mce/plugins/advlink/langs/gu_dlg.js new file mode 100755 index 000000000..89f92a18f --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/he_dlg.js b/js/tiny_mce/plugins/advlink/langs/he_dlg.js new file mode 100755 index 000000000..4981261bc --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"\u05e1\u05d2\u05e0\u05d5\u05df",id:"\u05de\u05e1\u05e4\u05e8 \u05e1\u05d9\u05d3\u05d5\u05e8\u05d9",popup_position:"\u05de\u05d9\u05e7\u05d5\u05dd (X/Y)",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",popup_size:"\u05d2\u05d5\u05d3\u05dc",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"\u05d7\u05dc\u05d5\u05df \u05d3\u05d9\u05e0\u05d0\u05de\u05d9(resizable)",popup_location:"\u05d4\u05e6\u05d2\u05ea location bar ",popup_menubar:"\u05d4\u05e6\u05d2\u05ea \u05ea\u05e4\u05e8\u05d9\u05d8",popup_toolbar:"\u05d4\u05e6\u05d2\u05ea \u05e1\u05e8\u05d2\u05dc\u05d9 \u05db\u05dc\u05d9\u05dd",popup_statusbar:"\u05d4\u05e6\u05d2\u05ea \u05e9\u05d5\u05e8\u05ea \u05e1\u05d8\u05d0\u05d8\u05d5\u05e1",popup_scrollbars:"\u05d4\u05e6\u05d2\u05ea \u05e4\u05e1 \u05d2\u05dc\u05d9\u05dc\u05d4",popup_return:"\u05d9\u05e9 \u05dc\u05d4\u05db\u05e0\u05d9\u05e1 \'return false\'",popup_name:"\u05e9\u05dd \u05d4\u05d7\u05dc\u05d5\u05df",popup_url:"\u05d7\u05dc\u05d5\u05df \u05de\u05d5\u05e7\u05e4\u05e5 URL",popup:"\u05d7\u05dc\u05d5\u05df \u05de\u05d5\u05e7\u05e4\u05e5 javascript",target_blank:"\u05e4\u05ea\u05d9\u05d7\u05d4 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9",target_top:"\u05e4\u05ea\u05d9\u05d7\u05d4 \u05d1\u05d7\u05dc\u05d5\u05df \u05d4\u05d1\u05df \u05d4\u05e8\u05d0\u05e9\u05d9(\u05de\u05d7\u05dc\u05d9\u05e3 \u05d0\u05ea \u05db\u05dc \u05d7\u05dc\u05d5\u05e0\u05d5\u05ea \u05d4\u05d1\u05e0\u05d9\u05dd)",target_parent:"\u05e4\u05ea\u05d9\u05d7\u05d4 \u05d1\u05dc\u05d5\u05df \u05d4\u05d0\u05d1\u05d0/\u05d7\u05dc\u05d5\u05df \u05d1\u05df",target_same:"\u05e4\u05ea\u05d9\u05d7\u05d4 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9/\u05d7\u05dc\u05d5\u05df \u05d1\u05df",anchor_names:"\u05e7\u05d9\u05e9\u05d5\u05e8 \u05dc\u05e1\u05d9\u05de\u05e0\u05d9\u05d4",popup_opts:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea",advanced_props:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05de\u05ea\u05e7\u05d3\u05de\u05d5\u05ea",event_props:"\u05de\u05d0\u05d5\u05e8\u05e2\u05d5\u05ea",popup_props:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05d7\u05dc\u05d5\u05df \u05de\u05d5\u05e7\u05e4\u05e5",general_props:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05db\u05dc\u05dc\u05d9\u05d5\u05ea",advanced_tab:"\u05de\u05ea\u05e7\u05d3\u05dd",events_tab:"\u05d0\u05e8\u05d5\u05e2\u05d9\u05dd",popup_tab:"\u05d7\u05dc\u05d5\u05df \u05de\u05d5\u05e7\u05e4\u05e5",general_tab:"\u05db\u05dc\u05dc\u05d9",list:"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd",is_external:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?",is_email:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?",titlefield:"\u05db\u05d5\u05ea\u05e8\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8",target:"\u05d9\u05e2\u05d3",url:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8",title:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",link_list:"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/hi_dlg.js b/js/tiny_mce/plugins/advlink/langs/hi_dlg.js new file mode 100755 index 000000000..095fc8940 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/hr_dlg.js b/js/tiny_mce/plugins/advlink/langs/hr_dlg.js new file mode 100755 index 000000000..55c2999d0 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.advlink_dlg',{target_name:"Ime mete",classes:"Klasa",style:"Stil",id:"Id",popup_position:"Pozicija (X/Y)",langdir:"Smjer jezika",popup_size:"Veli\u010dina",popup_dependent:"Ovisan (samo za Mozilla/Firefox)",popup_resizable:"Prozor promjenjive veli\u010dine",popup_location:"Poka\u017ei traku lokacije",popup_menubar:"Poka\u017ei izbornik",popup_toolbar:"Poka\u017ei alatne trake",popup_statusbar:"Poka\u017ei statusnu traku",popup_scrollbars:"Poka\u017ei kliza\u010de",popup_return:"Umetni \'return false\'",popup_name:"Ime prozora",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Otvori u novom prozoru",target_top:"Otvori u gornjem okviru (zamjenjuje sve okvire)",target_parent:"Otvori u izvornom prozoru / okvir",target_same:"Otovori u novom prozoru / okviru",anchor_names:"Sidra",popup_opts:"Opcije",advanced_props:"Napredna svojstva",event_props:"Doga\u0111aji",popup_props:"Svojstva popup prozora",general_props:"Osnovna svojstva",advanced_tab:"Napredno",events_tab:"Doga\u0111aj",popup_tab:"Popup",general_tab:"Osnovno",list:"Lista poveznica",is_external:"URL koji ste unijeli izgleda kao vanjska poveznica, \u017eelite li dodati potrebni http:// prefiks?",is_email:"URL koji ste unijeli izgleda kao e-mail adresa, \u017eelite li dodati potrebni mailto: prefiks?",titlefield:"Naslov",target:"Meta",url:"URL poveznice",title:"Umetni/uredi poveznicu",link_list:"Lista poveznica",rtl:"S desna na lijevo",ltr:"S lijeva na desno",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Odnos mete prema stranici",rel:"Odnos stranice prema meti",mime:"MIME tip",encoding:"Kodiranje znakova",langcode:"Kod jezika",target_langcode:"Jezik"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/hu_dlg.js b/js/tiny_mce/plugins/advlink/langs/hu_dlg.js new file mode 100755 index 000000000..36fa87497 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.advlink_dlg',{"target_name":"C\u00e9l neve",classes:"Class-ok",style:"Style",id:"Id","popup_position":"Poz\u00edci\u00f3 (X/Y)",langdir:"Nyelv \u00edr\u00e1s ir\u00e1ny","popup_size":"M\u00e9ret","popup_dependent":"F\u00fcgg\u0151 (csak Mozilla/Firefox)","popup_resizable":"\u00c1tm\u00e9retezhet\u0151 ablak","popup_location":"C\u00edm mez\u0151 mutat\u00e1sa","popup_menubar":"Men\u00fcsor mutat\u00e1sa","popup_toolbar":"Eszk\u00f6zsor mutat\u00e1sa","popup_statusbar":"St\u00e1tuszsor mutat\u00e1sa","popup_scrollbars":"G\u00f6rget\u0151s\u00e1vok mutat\u00e1sa","popup_return":"\'return false\' besz\u00far\u00e1sa","popup_name":"Ablakn\u00e9v","popup_url":"Felugr\u00f3 ablak URL",popup:"JavaScript felugr\u00f3 ablak","target_blank":"\u00daj ablakban megnyit\u00e1s","target_top":"Azonos ablakban/keretben megnyit\u00e1s legfel\u00fcl","target_parent":"Sz\u00fcl\u0151 ablakban/keretben megnyit\u00e1s","target_same":"Azonos ablakban/keretben megnyit\u00e1s","anchor_names":"Horgonyok","popup_opts":"Be\u00e1ll\u00edt\u00e1sok","advanced_props":"Halad\u00f3 tulajdons\u00e1gok","event_props":"Esem\u00e9nyek","popup_props":"Felugr\u00f3 ablak tulajdons\u00e1gai","general_props":"\u00c1ltal\u00e1nos tulajdons\u00e1gok","advanced_tab":"Halad\u00f3","events_tab":"Esem\u00e9nyek","popup_tab":"Felugr\u00f3 ablak","general_tab":"\u00c1ltal\u00e1nos",list:"Link lista","is_external":"A be\u00edrt URL k\u00fcls\u0151 hivatkoz\u00e1snak t\u0171nik, k\u00edv\u00e1nja a sz\u00fcks\u00e9ges http://-t el\u00e9 tenni?","is_email":"A be\u00edrt URL e-mail c\u00edmnek t\u0171nik, k\u00edv\u00e1nja a sz\u00fcks\u00e9ges mailto:-t el\u00e9 tenni?",titlefield:"C\u00edm",target:"Target",url:"Link URL",title:"Link besz\u00far\u00e1s/szerkeszt\u00e9s","link_list":"Link lista",rtl:"Jobbr\u00f3l balra",ltr:"Balr\u00f3l jobbra",accesskey:"Gyorsgomb",tabindex:"Tabindex",rev:"C\u00e9l kapcsolata az oldallal",rel:"Oldal kapcsolata a c\u00e9llal",mime:"C\u00e9l MIME t\u00edpus",encoding:"C\u00e9l karakterk\u00f3dol\u00e1s",langcode:"Nyelv k\u00f3d","target_langcode":"C\u00e9l nyelv"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/hy_dlg.js b/js/tiny_mce/plugins/advlink/langs/hy_dlg.js new file mode 100755 index 000000000..9bee85bff --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.advlink_dlg',{target_name:"Target name",classes:"\u0534\u0561\u057d\u0565\u0580",style:"\u0548\u0573",id:"Id",popup_position:"\u054f\u0565\u0572\u0561\u056f\u0561\u0575\u0578\u0582\u0574 (X / Y)",langdir:"\u0548\u0582\u0572\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",popup_size:"\u0549\u0561\u0583\u057d",popup_dependent:"Dependent (\u0574\u056b\u0561\u0575\u0576 Mozilla / Firefox)",popup_resizable:"\u0539\u0578\u0582\u0575\u056c\u0561\u057f\u0580\u0565\u056c \u0579\u0561\u0583\u0565\u0580\u056b \u0583\u0578\u0583\u0578\u056d\u0578\u0582\u0574",popup_location:"\u0551\u0578\u0582\u0581\u0561\u0564\u0580\u0565\u056c location \u057e\u0561\u0570\u0561\u0576\u0561\u056f\u0568",popup_menubar:"\u0551\u0578\u0582\u0581\u0561\u0564\u0580\u0565\u056c \u0574\u0565\u0576\u0575\u0578\u0582\u0576",popup_toolbar:"\u0551\u0578\u0582\u0581\u0561\u0564\u0580\u0565\u056c \u0563\u0578\u0580\u056e\u056b\u0584\u0561\u0575\u056b\u0576 \u057e\u0561\u0570\u0561\u0576\u0561\u056f\u0576\u0565\u0580\u0568",popup_statusbar:"\u0551\u0578\u0582\u0581\u0561\u0564\u0580\u0565\u056c \u057d\u057f\u0561\u057f\u0578\u0582\u057d\u0568",popup_scrollbars:"\u0551\u0578\u0582\u0581\u0561\u0564\u0580\u0565\u056c \u057d\u0584\u0580\u0578\u056c\u056c\u0576\u0565\u0580\u0568",popup_return:"\u054f\u0565\u0572\u0561\u0564\u0580\u0565\u056c \'return false\'",popup_name:"\u054a\u0561\u057f\u0578\u0582\u0570\u0561\u0576\u056b \u0561\u0576\u057e\u0561\u0576\u0578\u0582\u0574",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"\u0532\u0561\u0581\u0565\u056c \u0576\u0578\u0580 \u057a\u0561\u057f\u0578\u0582\u0570\u0561\u0576\u0578\u0582\u0574",target_top:"\u0532\u0561\u0581\u0565\u056c \u057e\u0565\u0580\u056b\u0576 \u0586\u0580\u0565\u0575\u0574\u0578\u0582\u0574 (\u0583\u0578\u0583\u0578\u056d\u0565\u056c \u0562\u0578\u056c\u0578\u0580 \u0586\u0580\u0565\u0575\u0574\u0565\u0580\u0568)",target_parent:"\u0532\u0561\u0581\u0565\u056c \u0570\u056b\u0574\u0576\u0561\u056f\u0561\u0576 \u057a\u0561\u057f\u0578\u0582\u0570\u0561\u0576\u0578\u0582\u0574 / \u0586\u0580\u0565\u0575\u0574\u0578\u0582\u0574",target_same:"\u0532\u0561\u0581\u0565\u056c \u0561\u0575\u057d \u057a\u0561\u057f\u0578\u0582\u0570\u0561\u0576\u0578\u0582\u0574 / \u0586\u0580\u0565\u0575\u0574\u0578\u0582\u0574",anchor_names:"\u053d\u0561\u0580\u056b\u057d\u056d",popup_opts:"\u054a\u0561\u0580\u0561\u0574\u0565\u057f\u0580\u0565\u0580",advanced_props:"\u053c\u0580\u0561\u0581\u0578\u0582\u0581\u056b\u0579 \u0564\u0565\u057a\u0584\u0565\u0580",event_props:"\u0534\u0565\u057a\u0584\u0565\u0580",popup_props:"Popup \u057a\u0561\u0580\u0561\u0574\u0565\u057f\u0580\u0565\u0580",general_props:"\u0538\u0576\u0564\u0570\u0561\u0576\u0578\u0582\u0580 \u057a\u0561\u0580\u0561\u0574\u0565\u057f\u0580\u0565\u0580",advanced_tab:"\u053c\u0580\u0561\u0581\u0578\u0582\u0581\u056b\u0579",events_tab:"\u0534\u0565\u057a\u0584\u0565\u0580",popup_tab:"Popup",general_tab:"\u0540\u056b\u0574\u0576\u0561\u056f\u0561\u0576",list:"\u0540\u0572\u0578\u0582\u0574\u0576\u0565\u0580\u056b \u0581\u0561\u0576\u056f",is_external:"\u0546\u0565\u0580\u0561\u056e\u057e\u0561\u056e URL \u0570\u0561\u057d\u0581\u0565\u0576 \u0576\u0574\u0561\u0576 \u0567 \u0561\u0580\u057f\u0561\u0584\u056b\u0576 \u0570\u0572\u0574\u0561\u0576, \u0534\u0578\u0582\u0584 \u0581\u0561\u0576\u056f\u0561\u0576\u0578\u0582\u055e\u0574 \u0565\u0584 \u0561\u057e\u0565\u056c\u0561\u0581\u0576\u0565\u056c http://",is_email:"\u0546\u0565\u0580\u0561\u056e\u057e\u0561\u056e URL \u0570\u0561\u057d\u0581\u0565\u0576 \u0576\u0574\u0561\u0576 \u0567 email \u0570\u0561\u057d\u0581\u0565\u056b, \u0534\u0578\u0582\u0584 \u0581\u0561\u0576\u056f\u0561\u0576\u0578\u0582\u055e\u0574 \u0565\u0584 \u0561\u057e\u0565\u056c\u0561\u0581\u0576\u0565\u056c mailto:",titlefield:"\u054e\u0565\u0580\u0576\u0561\u0563\u056b\u0580",target:"\u0532\u0561\u0581\u0565\u056c ...",url:"\u0540\u0561\u057d\u0581\u0565",title:"\u054f\u0565\u0572\u0561\u0564\u0580\u0565\u056c / \u0583\u0578\u0583\u0578\u056d\u0565\u056c \u0570\u0572\u0578\u0582\u0574",link_list:"\u0540\u0572\u0578\u0582\u0574\u0576\u0565\u0580\u056b \u0581\u0561\u0576\u056f",rtl:"\u0531\u057b\u056b\u0581 \u0571\u0561\u056d",ltr:"\u0541\u0561\u056d\u056b\u0581 \u0561\u057b",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"\u053c\u0565\u0566\u057e\u056b \u056f\u0578\u0564",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ia_dlg.js b/js/tiny_mce/plugins/advlink/langs/ia_dlg.js new file mode 100755 index 000000000..9759b649f --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.advlink_dlg',{target_name:"\u76ee\u6807\u540d\u79f0",classes:"\u6837\u5f0f\u7c7b",style:"\u6837\u5f0f",id:"Id",popup_position:"\u5750\u6807 (X/Y)",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",popup_size:"\u5927\u5c0f",popup_dependent:"\u4ece\u5c5e\u4e8e ( \u4ec5 Mozilla/Firefox \u6709\u6548 )",popup_resizable:"\u53ef\u8c03\u6574\u7a97\u53e3\u5927\u5c0f",popup_location:"\u663e\u793a\u5730\u5740\u680f",popup_menubar:"\u663e\u793a\u83dc\u5355\u5217",popup_toolbar:"\u663e\u793a\u5de5\u5177\u5217",popup_statusbar:"\u663e\u793a\u72b6\u6001\u5217",popup_scrollbars:"\u663e\u793a\u6eda\u52a8\u6761",popup_return:"\u63d2\u5165 \'return false\'",popup_name:"\u7a97\u53e3\u540d\u79f0",popup_url:"\u5f39\u51fa\u7a97\u53e3\u5730\u5740",popup:"Javascript \u5feb\u663e\u7a97\u53e3",target_blank:"\u5728\u65b0\u7a97\u53e3\u6253\u5f00",target_top:"\u5728\u9876\u5c42\u7a97\u53e3\u6253\u5f00",target_parent:"\u5728\u7236\u7a97\u53e3\u6253\u5f00",target_same:"\u5728\u5f53\u524d\u7a97\u53e3\u6253\u5f00",anchor_names:"\u951a\u70b9",popup_opts:"\u9009\u9879",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5feb\u663e\u7a97\u53e3\u5c5e\u6027",general_props:"\u57fa\u672c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5feb\u663e\u7a97\u53e3",general_tab:"\u57fa\u672c",list:"\u8fde\u7ed3\u6e05\u5355",is_external:"\u60a8\u8f93\u5165\u7684\u7f51\u5740\u5e94\u8be5\u662f\u4e00\u4e2a\u5916\u90e8\u8fde\u7ed3\uff0c\u662f\u5426\u9700\u8981\u5728\u7f51\u5740\u524d\u52a0\u4e0a http:// ?",is_email:"\u60a8\u8f93\u5165\u7684\u5e94\u8be5\u662f\u4e00\u4e2a\u7535\u5b50\u90ae\u5bc4\u5730\u5740\uff0c\u662f\u5426\u9700\u8981\u5728\u7f51\u5740\u524d\u52a0\u4e0a mailto: ? ",titlefield:"\u67e5\u627e",target:"\u76ee\u6807",url:"\u8fde\u7ed3\u5730\u5740",title:"\u63d2\u5165/\u7f16\u8f91 \u8fde\u7ed3",link_list:"\u8fde\u7ed3\u6e05\u5355",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u952e",tabindex:"Tab\u7d22\u5f15",rev:"rev",rel:"rel",mime:"\u76ee\u6807 MIME \u7c7b\u578b",encoding:"\u76ee\u6807\u8bed\u8a00\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801",target_langcode:"\u76ee\u6807\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/id_dlg.js b/js/tiny_mce/plugins/advlink/langs/id_dlg.js new file mode 100755 index 000000000..cefdb1b56 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.advlink_dlg',{target_name:"Nama Target",classes:"Classes",style:"Style",id:"Id",popup_position:"Posisi (X/Y)",langdir:"Bahasa",popup_size:"Ukuran",popup_dependent:"Tergantung (khusus Mozilla/Firefox)",popup_resizable:"Jadikan window resizable",popup_location:"Tampilkan location bar",popup_menubar:"Tampilkan menu bar",popup_toolbar:"Tampilkan toolbars",popup_statusbar:"Tampilkan status bar",popup_scrollbars:"Tampilkan scrollbars",popup_return:"sisipkan \'return false\'",popup_name:"Nama Window",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Buka pada Window baru",target_top:"Buka pada frame atas (Gantikan semua frame)",target_parent:"Buka pada parent window/frame",target_same:"Buka pada window/frame ini",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Properti Pop-Up",general_props:"Properti Umum",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"Umum",list:"Daftar Link",is_external:"URL yang Anda sisipkan tampaknya link eksternal, Anda ingin menambahkan awalan \'http://\'?",is_email:"URL yang Anda sisipkan tampaknya e-mail, Anda ingin menambahkan awalan \'mailto:\'?",titlefield:"Judul",target:"Target",url:"Link URL",title:"Sisipkan/Ubah link",link_list:"Daftar Link",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Hubungan target dengan page",rel:"Hubungan page dengan target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Kode Bahasa",target_langcode:"Bahasa Target"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ii_dlg.js b/js/tiny_mce/plugins/advlink/langs/ii_dlg.js new file mode 100755 index 000000000..a2018fb08 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ii_dlg.js @@ -0,0 +1,52 @@ +tinyMCE.addI18n('ii.advlink_dlg',{ +title:"\u63D2\u5165/\u7F16\u8F91\u8FDE\u7ED3", +url:"\u8FDE\u7ED3\u4F4D\u5740", +target:"\u76EE\u6807", +titlefield:"\u67E5\u627E", +is_email:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u90AE\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", +is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", +list:"\u8FDE\u7ED3\u6E05\u5355", +general_tab:"\u4E00\u822C", +popup_tab:"\u5F39\u51FA\u7A97\u53E3", +events_tab:"\u4E8B\u4EF6", +advanced_tab:"\u9AD8\u7EA7", +general_props:"\u4E00\u822C\u5C5E\u6027", +popup_props:"\u5F39\u51FA\u7A97\u53E3\u5C5E\u6027", +event_props:"\u4E8B\u4EF6", +advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", +popup_opts:"\u9009\u9879", +anchor_names:"\u951A\u70B9", +target_same:"\u6253\u5F00\u5728\u65B0\u7A97\u53E3/\u6846\u67B6", +target_parent:"\u6253\u5F00\u5728\u7236\u7A97\u53E3/\u6846\u67B6", +target_top:"\u6253\u5F00\u5728\u6700\u4E0A\u5C42\u7684\u6846\u67B6(\u66FF\u6362\u6240\u6709\u6846\u67B6)", +target_blank:"\u6253\u5F00\u5728\u65B0\u7A97\u53E3", +popup:"Javascript\u5F39\u51FA\u7A97\u53E3", +popup_url:"\u5F39\u51FA\u7A97\u53E3\u7F51\u5740", +popup_name:"\u7A97\u53E3\u540D\u79F0", +popup_return:"\u63D2\u5165'return false'", +popup_scrollbars:"\u663E\u793A\u8FB9\u6761", +popup_statusbar:"\u663E\u793A\u72B6\u6001\u680F", +popup_toolbar:"\u663E\u793A\u5DE5\u5177\u5217", +popup_menubar:"\u663E\u793A\u529F\u80FD\u8868", +popup_location:"\u663E\u793A\u7F51\u5740\u5217", +popup_resizable:"\u53EF\u8C03\u6574\u7A97\u53E3\u5C3A\u5BF8", +popup_dependent:"\u4ECE\u5C5E(\u53EA\u6709Mozilla/Firefox\u6709\u6548)", +popup_size:"\u5C3A\u5BF8", +popup_position:"\u5EA7\u6807(X/Y)", +id:"Id", +style:"\u6837\u5F0F", +classes:"\u7C7B\u578B", +target_name:"\u76EE\u6807\u540D\u79F0", +langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", +target_langcode:"\u76EE\u7684\u8BED\u8A00", +langcode:"\u8BED\u8A00\u7F16\u7801", +encoding:"\u7F16\u7801", +mime:"\u76EE\u6807MIME\u7C7B\u578B", +rel:"\u9875\u5230\u76EE\u6807\u7684\u5173\u7CFB", +rev:"\u76EE\u6807\u5230\u9875\u7684\u5173\u7CFB", +tabindex:"Tab\u7D22\u5F15", +accesskey:"\u5FEB\u901F\u952E", +ltr:"\u7531\u5DE6\u5230\u53F3", +rtl:"\u7531\u53F3\u5230\u5DE6", +link_list:"\u8FDE\u7ED3\u6E05\u5355" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/is_dlg.js b/js/tiny_mce/plugins/advlink/langs/is_dlg.js new file mode 100755 index 000000000..759fd70e4 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.advlink_dlg',{target_name:"Target heiti",classes:"Klasi",style:"St\u00edll",id:"Id",popup_position:"Sta\u00f0setning (X/Y)",langdir:"\u00c1tt tungum\u00e1ls",popup_size:"St\u00e6r\u00f0",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Leyfa breytingu st\u00e6r\u00f0ar \u00e1 glugga",popup_location:"Birta vefsl\u00f3\u00f0",popup_menubar:"Birta valmynd",popup_toolbar:"Show toolbars",popup_statusbar:"Birta st\u00f6\u00f0u sl\u00e1",popup_scrollbars:"Birta runusl\u00e1",popup_return:"B\u00e6ta vi\u00f0 \'return false\'",popup_name:"Heiti gluggans",popup_url:"Sl\u00f3\u00f0 sprettigluggans",popup:"Javascript sprettigluggi",target_blank:"Opna \u00ed n\u00fdjum glugga",target_top:"Opna \u00ed efsta ramma (kemur \u00ed sta\u00f0inn fyrir alla ramma)",target_parent:"Opna \u00ed yfir glugga / ramma",target_same:"Opna \u00ed \u00feessum glugga / ramma",anchor_names:"Anchors",popup_opts:"M\u00f6guleikar",advanced_props:"Frekari eiginleikar",event_props:"Vi\u00f0bur\u00f0ir",popup_props:"Eiginleikar sprettiglugga",general_props:"Almennir eiginleikar",advanced_tab:"N\u00e1nar",events_tab:"Vi\u00f0bur\u00f0ir",popup_tab:"Sprettigluggi",general_tab:"Almennt",list:"Listi hlekkja",is_external:"Sl\u00f3\u00f0in sem \u00fe\u00fa skr\u00e1\u00f0ir vir\u00f0ist vera sl\u00f3\u00f0 utan vefs, vilt \u00fe\u00fa b\u00e6ta vi\u00f0 forskeytinu http://?",is_email:"Sl\u00f3\u00f0in sem \u00fe\u00fa skr\u00e1\u00f0ir vir\u00f0ist vera netfang, vilt \u00fe\u00fa b\u00e6ta vi\u00f0 forskeytinu mailto:?",titlefield:"Titill",target:"Target",url:"Sl\u00f3\u00f0",title:"Setja inn/breyta hlekk",link_list:"Listi hlekkja",rtl:"H\u00e6gri til vinstri",ltr:"Vinstri til h\u00e6gri",accesskey:"Fl\u00fdtihnappur",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"K\u00f3\u00f0i tungum\u00e1ls",target_langcode:"\u00c6tla\u00f0 tungum\u00e1l"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/it_dlg.js b/js/tiny_mce/plugins/advlink/langs/it_dlg.js new file mode 100755 index 000000000..8af57349b --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.advlink_dlg',{target_name:"Nome target",classes:"Classe",style:"Stile",id:"Id",popup_position:"Posizione (X/Y)",langdir:"Direzione del testo",popup_size:"Dimensioni",popup_dependent:"Dipendente (Solo in Mozilla/Firefox)",popup_resizable:"Rendi la finestra ridimensionabile",popup_location:"Mostra barra navigazione",popup_menubar:"Mostra barra menu",popup_toolbar:"Mostra barre strumenti",popup_statusbar:"Mostra barra di stato",popup_scrollbars:"Mostra barre di scorrimento",popup_return:"Inserisci \'return false\'",popup_name:"Nome finestra",popup_url:"URL Popup",popup:"Popup Javascript",target_blank:"Apri in una nuova finestra",target_top:"Apri nella cornice superiore (sostituisce tutte le cornici)",target_parent:"Apri nella finestra / cornice genitore",target_same:"Apri in questa finestra / cornice",anchor_names:"Ancore",popup_opts:"Opzioni",advanced_props:"Propriet\u00e0 avanzate",event_props:"Eventi",popup_props:"Propriet\u00e0 popup",general_props:"Propriet\u00e0 generali",advanced_tab:"Avanzate",events_tab:"Eventi",popup_tab:"Popup",general_tab:"Generale",list:"Lista collegamenti",is_external:"L\'URL inserito sembra essere un link esterno. Aggiungere il necessario prefisso http:// ?",is_email:"L\'URL inserito sembra essere un indirizzo email. Aggiungere il necessario prefisso mailto: ?",titlefield:"Titolo",target:"Target",url:"URL collegamento",title:"Inserisci/modifica link",link_list:"Lista collegamenti",rtl:"Destra verso sinistra",ltr:"Sinistra verso destra",accesskey:"Carattere di accesso",tabindex:"Indice tabulazione",rev:"Relazione da target a pagina",rel:"Relazione da pagina a target",mime:"Tipo MIME del target",encoding:"Codifica carattere del target",langcode:"Lingua",target_langcode:"Lingua del target"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ja_dlg.js b/js/tiny_mce/plugins/advlink/langs/ja_dlg.js new file mode 100755 index 000000000..54e9a0124 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.advlink_dlg',{"target_name":"\u30bf\u30fc\u30b2\u30c3\u30c8\u540d",classes:"\u30af\u30e9\u30b9",style:"\u30b9\u30bf\u30a4\u30eb",id:"ID","popup_position":"\u4f4d\u7f6e (X/Y)",langdir:"\u6587\u7ae0\u306e\u65b9\u5411","popup_size":"\u30b5\u30a4\u30ba","popup_dependent":"Dependent (Mozilla/Firefox\u306e\u307f)","popup_resizable":"\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u30b5\u30a4\u30ba\u5909\u66f4\u3092\u8a31\u53ef\u3059\u308b","popup_location":"\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u3092\u8868\u793a","popup_menubar":"\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u3092\u8868\u793a","popup_toolbar":"\u30c4\u30fc\u30eb\u30d0\u30fc\u3092\u8868\u793a","popup_statusbar":"\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u3092\u8868\u793a","popup_scrollbars":"\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u8868\u793a","popup_return":"\'return false\'\u3092\u633f\u5165\u3059\u308b","popup_name":"\u30a6\u30a4\u30f3\u30c9\u30a6\u540d","popup_url":"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7URL",popup:"Javascript\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7","target_blank":"\u65b0\u3057\u3044\u30a6\u30a4\u30f3\u30c9\u30a6\u3067\u958b\u304f","target_top":"\u30c8\u30c3\u30d7\u306e\u30d5\u30ec\u30fc\u30e0\u3067\u958b\u304f","target_parent":"\u89aa\u30a6\u30a4\u30f3\u30c9\u30a6/\u89aa\u30d5\u30ec\u30fc\u30e0\u3067\u958b\u304f","target_same":"\u3053\u306e\u30a6\u30a4\u30f3\u30c9\u30a6/\u30d5\u30ec\u30fc\u30e0\u3067\u958b\u304f","anchor_names":"\u30a2\u30f3\u30ab\u30fc","popup_opts":"\u30aa\u30d7\u30b7\u30e7\u30f3","advanced_props":"\u9ad8\u5ea6\u306a\u8a2d\u5b9a","event_props":"\u30a4\u30d9\u30f3\u30c8","popup_props":"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7","general_props":"\u4e00\u822c","advanced_tab":"\u4e0a\u7d1a\u8005\u5411\u3051","events_tab":"\u30a4\u30d9\u30f3\u30c8","popup_tab":"\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7","general_tab":"\u4e00\u822c",list:"\u4e00\u89a7\u304b\u3089\u9078\u3076","is_external":"\u30ea\u30f3\u30af\u306bhttp://\u3092\u4ed8\u52a0\u3057\u307e\u3059\u304b\uff1f","is_email":"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u5165\u529b\u3055\u308c\u307e\u3057\u305f\u3002\u30ea\u30f3\u30af\u306bmailto:\u3092\u4ed8\u52a0\u3057\u307e\u3059\u304b\uff1f",titlefield:"\u30bf\u30a4\u30c8\u30eb",target:"\u30bf\u30fc\u30b2\u30c3\u30c8",url:"\u30ea\u30f3\u30afURL",title:"\u30ea\u30f3\u30af\u306e\u633f\u5165/\u7de8\u96c6","link_list":"\u4e00\u89a7\u304b\u3089\u9078\u3076",rtl:"\u53f3\u304b\u3089\u5de6",ltr:"\u5de6\u304b\u3089\u53f3",accesskey:"\u30a2\u30af\u30bb\u30b9\u30ad\u30fc",tabindex:"\u30bf\u30d6\u30a4\u30f3\u30c7\u30c3\u30af\u30b9",rev:"\u30bf\u30fc\u30b2\u30c3\u30c8\u306e\u3053\u306e\u30da\u30fc\u30b8\u306b\u5bfe\u3059\u308b\u95a2\u4fc2",rel:"\u3053\u306e\u30da\u30fc\u30b8\u306e\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u5bfe\u3059\u308b\u95a2\u4fc2",mime:"\u30bf\u30fc\u30b2\u30c3\u30c8\u306eMIME\u30bf\u30a4\u30d7",encoding:"\u30bf\u30fc\u30b2\u30c3\u30c8\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0",langcode:"\u8a00\u8a9e\u30b3\u30fc\u30c9","target_langcode":"\u30bf\u30fc\u30b2\u30c3\u30c8\u306e\u8a00\u8a9e"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ka_dlg.js b/js/tiny_mce/plugins/advlink/langs/ka_dlg.js new file mode 100755 index 000000000..2032210c4 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.advlink_dlg',{target_name:"\u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10e1\u10d0\u10ee\u10d4\u10da\u10d8",classes:"\u10d9\u10da\u10d0\u10e1\u10d4\u10d1\u10d8",style:"\u10e1\u10e2\u10d8\u10da\u10d8",id:"\u10e1\u10d0\u10ee\u10d4\u10da\u10d8",popup_position:"\u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10d0 (X/Y)",langdir:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10db\u10d8\u10db\u10d0\u10e0\u10d7\u10e3\u10da\u10d1\u10d0",popup_size:"\u10d6\u10dd\u10db\u10d0",popup_dependent:"\u10d3\u10d0\u10db\u10dd\u10d9\u10d8\u10d3\u10d4\u10d1\u10e3\u10da\u10d4\u10d1\u10d0 (\u10db\u10ee\u10dd\u10da\u10dd\u10d3 Firefox)",popup_resizable:"\u10d6\u10dd\u10db\u10d8\u10e1 \u10ea\u10d5\u10da\u10d8\u10da\u10d4\u10d1\u10d8\u10e1 \u10d3\u10d0\u10e8\u10d5\u10d4\u10d1\u10d0",popup_location:"\u10d2\u10d0\u10dc\u10da\u10d0\u10d2\u10d4\u10d1\u10d8\u10e1 \u10de\u10d0\u10dc\u10d4\u10da\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",popup_menubar:"\u10db\u10d4\u10dc\u10d8\u10e3\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",popup_toolbar:"\u10d8\u10dc\u10e1\u10e2\u10e0\u10e3\u10db\u10d4\u10dc\u10e2\u10d4\u10d1\u10d8\u10e1 \u10de\u10d0\u10dc\u10d4\u10da\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",popup_statusbar:"\u10db\u10d3\u10d2\u10dd\u10db\u10d0\u10e0\u10d4\u10dd\u10d1\u10d8\u10e1 \u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",popup_scrollbars:"\u10d2\u10d0\u10d3\u10d0\u10ee\u10d5\u10d4\u10d5\u10d8\u10e1 \u10d5\u10d4\u10da\u10d4\u10d1\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",popup_return:"\'return false\' \u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d0",popup_name:"\u10e4\u10d0\u10dc\u10ef\u10e0\u10d8\u10e1 \u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",popup_url:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8",popup:"\u10d2\u10d0\u10e8\u10da\u10d0 Java-\u10e1 \u10d2\u10d0\u10db\u10dd\u10e7\u10d4\u10dc\u10d4\u10d1\u10d8\u10d7",target_blank:"\u10d0\u10ee\u10d0\u10da \u10e4\u10d0\u10dc\u10ef\u10d0\u10e0\u10d0\u10e8\u10d8 \u10d2\u10d0\u10ee\u10e1\u10dc\u10d0",target_top:"\u10d6\u10d4\u10d3\u10d0 \u10d9\u10d0\u10d3\u10e0\u10e8\u10d8 \u10d2\u10d0\u10ee\u10e1\u10dc\u10d0",target_parent:"\u10e1\u10d0\u10d9\u10e3\u10d7\u10d0\u10e0\u10d0 \u10e4\u10d0\u10dc\u10ef\u10d0\u10e0\u10d0\u10e8\u10d8 \u10d2\u10d0\u10ee\u10e1\u10dc\u10d0",target_same:"\u10db\u10dd\u10ea\u10d4\u10db\u10e3\u10da \u10e4\u10d0\u10dc\u10ef\u10d0\u10e0\u10d0\u10e8\u10d8 \u10d2\u10d0\u10ee\u10e1\u10dc\u10d0",anchor_names:"\u10e6\u10e3\u10d6\u10d4\u10d1\u10d8",popup_opts:"\u10db\u10d0\u10ee\u10d0\u10e1\u10d8\u10d0\u10d7\u10d4\u10d1\u10da\u10d4\u10d1\u10d8",advanced_props:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7\u10d8 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",event_props:"\u10db\u10dd\u10d5\u10da\u10d4\u10dc\u10d4\u10d1\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",popup_props:"\u10d2\u10d0\u10e8\u10da\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",general_props:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",advanced_tab:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7",events_tab:"\u10db\u10dd\u10d5\u10da\u10d4\u10dc\u10d0",popup_tab:"\u10d2\u10d0\u10e8\u10da\u10d0",general_tab:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd",list:"\u10e1\u10d8\u10d0",is_external:"\u10e8\u10d4\u10e7\u10d5\u10d0\u10dc\u10d8\u10da\u10d8 \u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8 \u10d2\u10d0\u10d5\u10e1 \u10d2\u10d0\u10e0\u10d4 \u10d1\u10db\u10e3\u10da\u10e1, \u10d3\u10d0\u10d5\u10d0\u10db\u10d0\u10d7\u10dd\u10e2 \u10de\u10e0\u10d4\u10e4\u10d8\u10e5\u10e1\u10d8 http://?",is_email:" \u10e8\u10d4\u10e7\u10d5\u10d0\u10dc\u10d8\u10da\u10d8 \u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8 \u10d2\u10d0\u10d5\u10e1 \u10d4\u10da.\u10e4\u10dd\u10e1\u10e2\u10d8\u10e1 \u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10e1, \u10d3\u10d0\u10d5\u10d0\u10db\u10d0\u10e2\u10dd\u10d7 \u10de\u10e0\u10d4\u10e4\u10d8\u10e5\u10e1\u10d8 mailto:?",titlefield:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",target:"\u10db\u10d8\u10d6\u10d0\u10dc\u10d8",url:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8",title:"\u10d1\u10db\u10e3\u10da\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",link_list:"\u10d1\u10db\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10e1\u10d8\u10d0",rtl:"\u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d5",ltr:"\u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d5",accesskey:"\u10e8\u10d4\u10e0\u10ec\u10d4\u10d5\u10d8\u10e1 \u10d2\u10d0\u10e1\u10d0\u10e6\u10d4\u10d1\u10d8",tabindex:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",rev:"\u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10d3\u10d0\u10db\u10dd\u10d9\u10d8\u10d3\u10d4\u10d1\u10e3\u10da\u10d4\u10d1\u10d0 \u10d2\u10d5\u10d4\u10e0\u10d3\u10d7\u10d0\u10dc",rel:"\u10d2\u10d5\u10d4\u10e0\u10d3\u10d8\u10e1 \u10d3\u10d0\u10db\u10dd\u10d9\u10d8\u10d3\u10d4\u10d1\u10e3\u10da\u10d4\u10d1\u10d0 \u10db\u10d8\u10d6\u10d0\u10dc\u10d7\u10d0\u10dc",mime:"MIME \u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10e2\u10d8\u10de\u10d8",encoding:"\u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10d9\u10dd\u10d3\u10d8\u10e0\u10d4\u10d1\u10d0",langcode:"\u10d4\u10dc\u10d8\u10e1 \u10d9\u10dd\u10d3\u10d8",target_langcode:"\u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10d4\u10dc\u10d0"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/kl_dlg.js b/js/tiny_mce/plugins/advlink/langs/kl_dlg.js new file mode 100755 index 000000000..435a1f5a1 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/km_dlg.js b/js/tiny_mce/plugins/advlink/langs/km_dlg.js new file mode 100755 index 000000000..359c368ca --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.advlink_dlg',{target_name:"\u1788\u17d2\u1798\u17c4\u17c7\u1782\u17c4\u179b\u178a\u17c5",classes:"\u1790\u17d2\u1793\u17b6\u1780\u17cb",style:"\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798",id:"\u179b\u179f.",popup_position:"\u1791\u17b8\u178f\u17b6\u17c6\u1784 (X/Y)",langdir:"\u1791\u17b7\u179f\u178a\u17c5\u1797\u17b6\u179f\u17b6",popup_size:"\u1791\u17c6\u17a0\u17c6",popup_dependent:"\u17a2\u17b6\u179f\u17d2\u179a\u17d0\u1799 (Mozilla/Firefox \u178f\u17c2\u1794\u17c9\u17bb\u178e\u17d2\u178e\u17c4\u17c7)",popup_resizable:"\u17b1\u17d2\u1799\u1794\u1784\u17d2\u17a2\u17bd\u1785\u17a2\u17b6\u1785\u1794\u17d2\u178f\u17bc\u179a\u1791\u17c6\u17a0\u17c6\u1794\u17b6\u1793",popup_location:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u179a\u1794\u17b6\u179a\u1791\u17b8\u178f\u17b6\u17c6\u1784",popup_menubar:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u179a\u1794\u17b6\u179a\u1798\u17c9\u17ba\u1793\u17bb\u1799",popup_toolbar:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u179a\u1794\u17b6\u179a\u17a7\u1794\u1780\u179a\u178e\u17cd",popup_statusbar:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u179a\u1794\u17b6\u179a\u179f\u17d2\u1790\u17b6\u1793\u1797\u17b6\u1796",popup_scrollbars:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u179a\u1794\u17b6\u179a\u179a\u1798\u17bc\u179a",popup_return:"\u1794\u1789\u17d2\u1785\u17bc\u179b\'return false\'",popup_name:"\u1788\u17d2\u1798\u17c4\u17c7\u1794\u1784\u17d2\u17a2\u17bc\u1785",popup_url:"\u17a2\u17b6\u179f\u178a\u17d2\u178b\u17b6\u1793\u1794\u1784\u17d2\u17a2\u17bd\u1785\u179b\u17c1\u1785\u17a1\u17be\u1784",popup:"\u1794\u1784\u17d2\u17a2\u17bd\u1785\u179b\u17c1\u1785\u17a1\u17be\u1784 Javascript",target_blank:"\u1794\u17be\u1780\u1780\u17d2\u1793\u17bb\u1784\u1794\u1784\u17d2\u17a2\u17bd\u1785\u1790\u17d2\u1798\u17b8",target_top:"\u1794\u17be\u1780\u1780\u17d2\u1793\u17bb\u1784\u179f\u17ca\u17bb\u1798\u179b\u17be (\u1787\u17c6\u1793\u17bd\u179f\u1782\u17d2\u179a\u1794\u17cb\u179f\u17ca\u17bb\u1798\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb)",target_parent:"\u1794\u17be\u1780\u1780\u17d2\u1793\u17bb\u1784\u1794\u1784\u17d2\u17a2\u17bd\u1785/\u179f\u17ca\u17bb\u1798\u1798\u17c1",target_same:"\u1794\u17be\u1780\u1780\u17d2\u1793\u17bb\u1784\u1794\u1784\u17d2\u17a2\u17bd\u1785/\u179f\u17ca\u17bb\u1798\u1793\u17c1\u17c7",anchor_names:"\u1799\u17bb\u1790\u17d2\u1780\u17b6",popup_opts:"\u1787\u1798\u17d2\u179a\u17be\u179f\u179b\u17c1\u1785\u17a1\u17be\u1784",advanced_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",event_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1796\u17d2\u179a\u17b9\u178f\u17d2\u178f\u17b7\u1780\u17b6\u179a\u178e\u17cd",popup_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u179b\u17c1\u1785\u17a1\u17be\u1784",general_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1791\u17bc\u1791\u17c5",advanced_tab:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",events_tab:"\u1796\u17d2\u179a\u17b9\u178f\u17d2\u178f\u17b7\u1780\u17b6\u179a\u178e\u17cd",popup_tab:"\u179b\u17c1\u1785\u17a1\u17be\u1784",general_tab:"\u1791\u17bc\u1791\u17c5",list:"\u1794\u1789\u17d2\u1787\u17b8\u178f\u17c6\u178e",is_external:"\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u178a\u17c2\u179b\u17a2\u17d2\u1793\u1780\u1794\u17b6\u1793\u1794\u1789\u17d2\u1785\u17bc\u179b\u1791\u17c6\u1793\u1784\u1787\u17b6\u178f\u17c6\u178e\u1791\u17c5\u1780\u17d2\u179a\u17c5, \u178f\u17be\u17a2\u17d2\u1793\u1780\u1785\u1784\u17cb\u179f\u179a\u179f\u17c1\u179a http:// \u1793\u17c5\u178a\u17be\u1798\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u1791\u17c1?",is_email:"\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u178a\u17c2\u179b\u17a2\u17d2\u1793\u1780\u1794\u17b6\u1793\u1794\u1789\u17d2\u1785\u17bc\u179b\u1791\u17c6\u1793\u1784\u1787\u17b6\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u17a2\u17ca\u17b8\u1798\u17c2\u179b, \u178f\u17be\u17a2\u17d2\u1793\u1780\u1785\u1784\u17cb\u179f\u179a\u179f\u17c1\u179a mailto: \u1793\u17c5\u178a\u17be\u1798\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u1791\u17c1?",titlefield:"\u1785\u17c6\u178e\u1784\u1787\u17be\u1784",target:"\u1782\u17c4\u179b\u178a\u17c5",url:"\u17a2\u17b6\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u178f\u17c6\u178e",title:"\u1794\u1789\u17d2\u1785\u17bc\u179b/\u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u178f\u17c6\u178e",link_list:"\u1794\u1789\u17d2\u1787\u17b8\u178f\u17c6\u178e",rtl:"\u1796\u17b8\u179f\u17d2\u178f\u17b6\u17c6\u1791\u17c5\u1786\u17d2\u179c\u17c1\u1784",ltr:"\u1796\u17b8\u1786\u17d2\u179c\u17c1\u1784\u1791\u17c5\u179f\u17d2\u178f\u17b6\u17c6",accesskey:"\u1782\u17d2\u179a\u17b6\u1794\u17cb\u1785\u17bb\u1785\u1795\u17d2\u179b\u17bc\u179c\u1780\u17b6\u178f\u17cb",tabindex:"\u1795\u17d2\u1791\u17b6\u17c6\u1784\u179b\u17b7\u1794\u17b7\u1780\u17d2\u179a\u1798",rev:"\u1791\u17c6\u1793\u17b6\u1780\u17cb\u1791\u17c6\u1793\u1784\u1782\u17c4\u179b\u178a\u17c5\u1791\u17c5\u1793\u17b9\u1784\u1791\u17c6\u1796\u17d0\u179a",rel:"\u1791\u17c6\u1793\u17b6\u1780\u17cb\u1791\u17c6\u1793\u1784\u1791\u17c6\u1796\u17d0\u179a\u1791\u17c5\u1793\u17b9\u1784\u1782\u17c4\u179b\u178a\u17c5",mime:"\u1794\u17d2\u179a\u1797\u17c1\u1791 MIME \u1782\u17c4\u179b\u178a\u17c5",encoding:"\u1780\u17b6\u179a\u179c\u17c1\u1785\u1780\u17bc\u178a\u178f\u17bd\u17a2\u1780\u17d2\u179f\u179a\u179a\u1794\u179f\u17cb\u1782\u17c4\u179b\u178a\u17c5",langcode:"\u1780\u17bc\u178a\u1797\u17b6\u179f\u17b6",target_langcode:"\u1797\u17b6\u179f\u17b6\u1782\u17c4\u179b\u178a\u17c5"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ko_dlg.js b/js/tiny_mce/plugins/advlink/langs/ko_dlg.js new file mode 100755 index 000000000..bc49a99ba --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.advlink_dlg',{target_name:"Target \uc774\ub984",classes:"\ud074\ub798\uc2a4",style:"\uc2a4\ud0c0\uc77c",id:"Id",popup_position:"\uc704\uce58(X/Y)",langdir:"\ud398\uc774\uc9c0 \ubb38\uc790 \ubc29\ud5a5",popup_size:"\ud06c\uae30",popup_dependent:"\uc5f0\ub3d9 (Mozilla/Firefox\ub9cc)",popup_resizable:"\ud06c\uae30\ubcc0\uacbd \uac00\ub2a5",popup_location:"\uc8fc\uc18c\ubc14\ub97c \ud45c\uc2dc",popup_menubar:"\uba54\ub274\ub97c \ud45c\uc2dc",popup_toolbar:"\ud234\ubc14\ub97c \ud45c\uc2dc",popup_statusbar:"\uc0c1\ud0dc\uc904\uc744 \ud45c\uc2dc",popup_scrollbars:"\uc2a4\ud06c\ub864\ubc14\ub97c \ud45c\uc2dc",popup_return:"\'return false\'\ub97c \uc0bd\uc785",popup_name:"Window \uc774\ub984",popup_url:"\ud31d\uc5c5 URL",popup:"Javascript \ud31d\uc5c5",target_blank:"\uc0c8\ucc3d\uc73c\ub85c \uc5f4\ub9b0\ub2e4",target_top:"\ucd5c\uc0c1\uc704 \ud504\ub808\uc784\uc73c\ub85c \uc5f4\ub9b0\ub2e4 (\ubaa8\ub4e0 \ud504\ub808\uc784 \ubcc0\uacbd)",target_parent:"\ubd80\ubaa8\ucc3d/\ud504\ub808\uc784\uc73c\ub85c \uc5f4\ub9b0\ub2e4",target_same:"\uc774 \ucc3d/\ud504\ub808\uc784\uc73c\ub85c \uc5f4\ub9b0\ub2e4",anchor_names:"\uc5e5\ucee4",popup_opts:"\uc635\uc158",advanced_props:"\uace0\uae09\uc758 \uc124\uc815",event_props:"\uc774\ubca4\ud2b8",popup_props:"\ud31d\uc5c5 \uc124\uc815",general_props:"\uc77c\ubc18 \uc124\uc815",advanced_tab:"\uace0\uae09",events_tab:"\uc774\ubca4\ud2b8",popup_tab:"\ud31d\uc5c5",general_tab:"\uc77c\ubc18",list:"\ub9c1\ud06c \ubaa9\ub85d",is_external:"\uc678\ubd80URL\uc774 \uc785\ub825\ub418\uc5c8\uc2b5\ub2c8\ub2e4.URL\uc758 \uc55e\uc5d0http://\ub97c \ubd99\uc785\ub2c8\uae4c?",is_email:"\uba54\uc77c\uc8fc\uc18c\uac00 \uc785\ub825\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uba54\uc77c\uc8fc\uc18c\uc758 \uc55e\uc5d0 mailto:\ub97c \ubd99\uc785\ub2c8\uae4c?",titlefield:"\uc81c\ubaa9",target:"Target",url:"\ub9c1\ud06c URL",title:"\ub9c1\ud06c\uc758 \uc0bd\uc785/\ud3b8\uc9d1",link_list:"\ub9c1\ud06c \ubaa9\ub85d",rtl:"\uc624\ub978\ucabd\uc5d0\uc11c \uc67c\ucabd",ltr:"\uc67c\ucabd\uc5d0\uc11c \uc624\ub978\ucabd",accesskey:"\uc561\uc138\uc2a4 \ud0a4",tabindex:"\ud0ed \uc778\ub371\uc2a4",rev:"\ub9c1\ud06c\ub85c\ubd80\ud130\uc758 \uad00\uacc4",rel:"\ub9c1\ud06c\uc5d0 \uad00\uacc4",mime:"MIME\ud0c0\uc785",encoding:"\ubb38\uc790 \uc778\ucf54\ub529",langcode:"\uc5b8\uc5b4 \ucf54\ub4dc",target_langcode:"\ud398\uc774\uc9c0 \uc5b8\uc5b4"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/lb_dlg.js b/js/tiny_mce/plugins/advlink/langs/lb_dlg.js new file mode 100755 index 000000000..0b456356a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.advlink_dlg',{target_name:"Numm vun der Zils\u00e4it",classes:"Klassen",style:"Format",id:"ID",popup_position:"Positioun (X/Y)",langdir:"Schr\u00ebftrichtung",popup_size:"Gr\u00e9isst",popup_dependent:"Vun der Elteref\u00ebnster onofh\u00e4ngeg
        (n\u00ebmmen Mozilla/Firefox) ",popup_resizable:"Vergr\u00e9isseren vun der F\u00ebnster zouloossen",popup_location:"Adressleescht uweisen",popup_menubar:"Browsermen\u00fc uweisen",popup_toolbar:"Geschirleeschten uweisen",popup_statusbar:"Statusleeschten uweisen",popup_scrollbars:"Scrollbalken uweisen",popup_return:"Link trotz Popup suiv\u00e9ieren",popup_name:"Numm vun der F\u00ebnster",popup_url:"Popup-Adress",popup:"JavaScript-Popup",target_blank:"An enger neier F\u00ebnster opmaachen",target_top:"Am ieweschte Frame opmaacheen (sprengt d\'Frameset)",target_parent:"An der iwwergeuerdneter F\u00ebnster/Frame opmaachen",target_same:"An der selwechter F\u00ebnster/Frame opmaachen",anchor_names:"Anker",popup_opts:"Optiounen",advanced_props:"Erweidert Eegeschaften",event_props:"Evenement",popup_props:"Popup-Eegeschaften",general_props:"Allgemeng Eegeschaften",advanced_tab:"Erweidert",events_tab:"Evenement",popup_tab:"Popup",general_tab:"Allgemeng",list:"Linkl\u00ebscht",is_external:"D\u00ebs Adress sch\u00e9ngt een externe Link ze sinn. W\u00ebllt Dir den dofir ben\u00e9idegte Pr\u00e4fix \"http://\" virdru setzen?",is_email:"D\u00ebs Adress sch\u00e9ngt eng Email-Adress ze sinn. W\u00ebllt Dir den dofir ben\u00e9idegte Pr\u00e4fix \"mailto:\" virdru setzen?",titlefield:"Titel",target:"F\u00ebnster",url:"Adress",title:"Link af\u00fcgen/beaarbechten",link_list:"Linkl\u00ebscht",rtl:"Riets no l\u00e9nks",ltr:"L\u00e9nks no riets",accesskey:"Tastekierzel",tabindex:"Tabindex",rev:"Bez\u00e9iung vum Linkzil zur S\u00e4it",rel:"Bez\u00e9iung vun der S\u00e4it zum Linkzil",mime:"MIME-Typ vun der Zils\u00e4it",encoding:"Zeechekod\u00e9ierung vun der Zils\u00e4it",langcode:"Sproochcode",target_langcode:"Sprooch vun der Zils\u00e4it"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/lt_dlg.js b/js/tiny_mce/plugins/advlink/langs/lt_dlg.js new file mode 100755 index 000000000..e477b4554 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.advlink_dlg',{target_name:"Paskirties vardas",classes:"Klas\u0117s",style:"Stilius",id:"Id",popup_position:"Pozicija (X/Y)",langdir:"Kalbos kryptis",popup_size:"Dydis",popup_dependent:"Proporcionaliai (tik Mozilla/Firefox)",popup_resizable:"Galima koreguoti lango i\u0161matavimus",popup_location:"Rodyti adres\u0173 juost\u0105",popup_menubar:"Rodyti meniu juost\u0105",popup_toolbar:"Rodyti \u012franki\u0173 juost\u0105",popup_statusbar:"Rodyti b\u016bsenos juost\u0105",popup_scrollbars:"Rodyti slankjuostes",popup_return:"\u012eterpti \u201ereturn false\u201c",popup_name:"Lango vardas",popup_url:"I\u0161kylan\u010dio lango URL adresas",popup:"Javascript i\u0161kylantis langas",target_blank:"Atverti naujame lange",target_top:"Atverti vir\u0161utiniame lange (pakei\u010dia visus langus)",target_parent:"Atverti t\u0117viniame lange",target_same:"Atverti tame pa\u010diame lange",anchor_names:"Prierai\u0161ai",popup_opts:"Nustatymai",advanced_props:"I\u0161pl\u0117stiniai nustatymai",event_props:"\u012evykiai",popup_props:"I\u0161kylan\u010dio lango nustatymai",general_props:"Bendri nustatymai",advanced_tab:"I\u0161pl\u0117sta",events_tab:"\u012evykiai",popup_tab:"I\u0161kylantis langas",general_tab:"Bendra",list:"Nuorod\u0173 s\u0105ra\u0161as",is_external:"URL adresas, kur\u012f \u012fved\u0117te yra i\u0161orin\u0117 nuoroda, ar norite prid\u0117ti reikaling\u0105 http:// prefiks\u0105?",is_email:"URL adresas, kur\u012f \u012fved\u0117te yra el. pa\u0161to adresas, ar norite prid\u0117ti reikaling\u0105 mailto: prefiks\u0105?",titlefield:"Pavadinimas",target:"Paskirtis",url:"Nuorodos URL adresas",title:"\u012eterpti/Redaguoti nuorod\u0105",link_list:"Nuorod\u0173 s\u0105ra\u0161as",rtl:"I\u0161 de\u0161in\u0117s \u012f kair\u0119",ltr:"I\u0161 kair\u0117s \u012f de\u0161in\u0119",accesskey:"Prieigos klavi\u0161as",tabindex:"Tabuliavimo indeksas",rev:"Ry\u0161ys paskirties su puslapiu",rel:"Ry\u0161ys puslapio su paskirtimi",mime:"Paskirties MIME tipas",encoding:"Kalbos koduot\u0117",langcode:"Kalbos kodas",target_langcode:"Paskirties kalba"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/lv_dlg.js b/js/tiny_mce/plugins/advlink/langs/lv_dlg.js new file mode 100755 index 000000000..b5f94ee40 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.advlink_dlg',{target_name:"M\u0113r\u0137a nosaukums",classes:"Klases",style:"St\u012bls",id:"Id",popup_position:"Poz\u012bcija (X/Y)",langdir:"Valodas virziens",popup_size:"Izm\u0113rs",popup_dependent:"Atkar\u012bgs (tikai priek\u0161 Mozilla/Firefox)",popup_resizable:"Iedot iesp\u0113ju main\u012bt loga izmerus",popup_location:"Par\u0101d\u012bt adreses joslu",popup_menubar:"Par\u0101d\u012bt izvelnes joslu",popup_toolbar:"Par\u0101d\u012bt r\u012bkjoslu",popup_statusbar:"Par\u0101d\u012bt status bar",popup_scrollbars:"Par\u0101d\u012bt scrollbars",popup_return:"Ielikt \'return false\'",popup_name:"Loga nosaukums",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Atvert jaun\u0101j\u0101 log\u0101",target_top:"Atvert pa virsu \u0161im r\u0101m\u012bm (aizvieto visus r\u0101mjus)",target_parent:"Atvert \u0161aj\u0101 log\u0101 / r\u0101m\u012b",target_same:"Atvert \u0161aj\u0101 log\u0101 / r\u0101m\u012b",anchor_names:"Enkuri",popup_opts:"Opcijas",advanced_props:"Advanced \u012bpa\u0161\u012bbas",event_props:"Notikumi",popup_props:"Popup \u012bpa\u0161\u012bbas",general_props:"Kop\u012bgas \u012bpa\u0161\u012bbas",advanced_tab:"Advanced",events_tab:"Notikumi",popup_tab:"Popup",general_tab:"Kop\u012bgais",list:"Link list",is_external:"Ievad\u012btais URL \u0161\u0137iet ir \u0101r\u0113j\u0101 saite, vai J\u016bs v\u0113laties pirms t\u0101s pievienot http:// pried\u0113kli?",is_email:"Ievad\u012btais URL \u0161\u0137iet ir e-pasta adrese, vai J\u016bs v\u0113laties pirms t\u0101s pievienot mailto: pried\u0113kli?",titlefield:"Nosaukums",target:"M\u0113r\u0137is",url:"Saites URL",title:"Ievietot/Redi\u0123\u0113t saiti",link_list:"Sakaru saraksts",rtl:"No labas puses uz kreiso",ltr:"No kreisas puses uz labo",accesskey:"Pieejas poga",tabindex:"Tabindex",rev:"M\u0113r\u0137a attiec\u012bbas pret lapu",rel:"Lapas attiec\u012bbas pret m\u0113r\u0137i",mime:"M\u0113r\u0137a MIME tips",encoding:"M\u0113r\u0137a valodas koda tabula",langcode:"Valodas kods",target_langcode:"M\u0113r\u0137a valoda"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/mk_dlg.js b/js/tiny_mce/plugins/advlink/langs/mk_dlg.js new file mode 100755 index 000000000..96bd02fed --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.advlink_dlg',{target_name:"Ime mete",classes:"Klasa",style:"Stil",id:"Id",popup_position:"Pozicija (X/Y)",langdir:"Smjer jezika",popup_size:"Veli\u010dina",popup_dependent:"Ovisan (samo za Mozilla/Firefox)",popup_resizable:"Prozor promjenjive veli\u010dine",popup_location:"Poka\u017ei traku lokacije",popup_menubar:"Poka\u017ei izbornik",popup_toolbar:"Poka\u017ei alatne trake",popup_statusbar:"Poka\u017ei statusnu traku",popup_scrollbars:"Poka\u017ei kliza\u010de",popup_return:"\u0412\u043c\u0435\u0442\u043d\u0438 \'return false\'",popup_name:"Ime prozora",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Otvori u novom prozoru",target_top:"Otvori u gornjem okviru (zamjenjuje sve okvire)",target_parent:"Otvori u izvornom prozoru / okvir",target_same:"Otovori u novom prozoru / okviru",anchor_names:"Sidra",popup_opts:"Opcije",advanced_props:"Napredna svojstva",event_props:"Doga\u0111aji",popup_props:"Svojstva popup prozora",general_props:"Osnovna svojstva",advanced_tab:"Napredno",events_tab:"Doga\u0111aj",popup_tab:"Popup",general_tab:"Osnovno",list:"Lista poveznica",is_external:"URL koji ste uneli izgleda kao vanjska poveznica, \u017eelite li dodati potrebni http:// prefiks?",is_email:"URL koji ste uneli izgleda kao e-mail adresa, \u017eelite li dodati potrebni mailto: prefiks?",titlefield:"\u041d\u0430\u0441\u043b\u043e\u0432",target:"Meta",url:"URL poveznice",title:"\u0412\u043c\u0435\u0442\u043d\u0438/uredi poveznicu",link_list:"Lista poveznica",rtl:"S desna na levo",ltr:"S leva na desno",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Odnos mete prema stranici",rel:"Odnos stranice prema meti",mime:"MIME tip",encoding:"Kodiranje znakova",langcode:"Kod jezika",target_langcode:"Jezik"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ml_dlg.js b/js/tiny_mce/plugins/advlink/langs/ml_dlg.js new file mode 100755 index 000000000..2649a7fde --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/mn_dlg.js b/js/tiny_mce/plugins/advlink/langs/mn_dlg.js new file mode 100755 index 000000000..06afa8184 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.advlink_dlg',{target_name:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u0443\u0443\u0434\u0430\u0441\u043d\u044b \u043d\u044d\u0440",classes:"\u0410\u043d\u0433\u0438",style:"\u0424\u043e\u0440\u043c\u0430\u0442",id:"\u0422\u0422",popup_position:"\u0411\u0430\u0439\u0440\u043b\u0430\u043b (X/Y)",langdir:"\u0411\u0438\u0447\u0433\u0438\u0439\u043d \u0447\u0438\u0433\u043b\u044d\u043b",popup_size:"\u0425\u044d\u043c\u0436\u044d\u044d",popup_dependent:"\u042d\u0445 \u0446\u043e\u043d\u0445\u043d\u043e\u043e\u0441 \u0445\u0430\u043c\u0430\u0430\u0440\u0430\u043b\u0442\u0430\u0439 (\u0417\u04e9\u0432\u0445\u04e9\u043d Mozilla/Firefox)",popup_resizable:"\u0426\u043e\u043d\u0445 \u0442\u043e\u043c\u0440\u0443\u0443\u043b\u0430\u0445\u044b\u0433 \u0437\u04e9\u0432\u0448\u04e9\u04e9\u0440\u04e9\u0445",popup_location:"\u0425\u0430\u044f\u0433\u0438\u0439\u043d \u0441\u0430\u043c\u0431\u0430\u0440 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",popup_menubar:"\u0425\u04e9\u0442\u04e9\u0447\u0438\u0439\u043d \u0446\u044d\u0441 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",popup_toolbar:"\u0411\u0430\u0433\u0430\u0436 \u0441\u0430\u043c\u0431\u0430\u0440 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",popup_statusbar:"\u0422\u04e9\u043b\u04e9\u0432 \u0441\u0430\u043c\u0431\u0430\u0440 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",popup_scrollbars:"\u0413\u04af\u0439\u043b\u0433\u044d\u0433\u0447 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",popup_return:"\u041f\u043e\u043f\u0430\u043f \u0431\u0430\u0439\u0441\u0430\u043d \u0447 \u0445\u043e\u043b\u0431\u043e\u043e\u0441\u044b\u0433 \u0434\u0430\u0433\u0430\u043d\u0430",popup_name:"\u0426\u043e\u043d\u0445\u043d\u044b \u043d\u044d\u0440",popup_url:"\u041f\u043e\u043f\u0430\u043f-\u0445\u0430\u044f\u0433",popup:"\u0416\u0430\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442-\u043f\u043e\u043f\u0430\u043f",target_blank:"\u0428\u0438\u043d\u044d \u0446\u043e\u043d\u0445\u043e\u043d\u0434 \u043d\u044d\u044d\u0445",target_top:"\u0425\u0430\u043c\u0433\u0438\u0439\u043d \u0434\u044d\u044d\u0434 \u0446\u043e\u043d\u0445/\u0444\u0440\u044d\u0439\u043c\u0434 \u043d\u044d\u044d\u0445",target_parent:"\u042d\u0445 \u0446\u043e\u043d\u0445/\u0444\u0440\u044d\u0439\u043c\u0434 \u043d\u044d\u044d\u0445",target_same:"\u0422\u0443\u0445\u0430\u0439\u043d \u0446\u043e\u043d\u0445/\u0444\u0440\u044d\u0439\u043c\u0434 \u043d\u044d\u044d\u0445",anchor_names:"\u0413\u0430\u0434\u0430\u0441",popup_opts:"\u0421\u043e\u043d\u0433\u043e\u043b\u0442",advanced_props:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d \u0448\u0438\u043d\u0436",event_props:"\u04ae\u0437\u044d\u0433\u0434\u044d\u043b",popup_props:"\u041f\u043e\u043f\u0430\u043f-\u0448\u0438\u043d\u0436",general_props:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439 \u0448\u0438\u043d\u0436",advanced_tab:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d",events_tab:"\u04ae\u0437\u044d\u0433\u0434\u044d\u043b",popup_tab:"\u041f\u043e\u043f\u0430\u043f",general_tab:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439",list:"\u0425\u043e\u043b\u0431\u043e\u043e\u0441\u044b\u043d \u0436\u0430\u0433\u0441\u0430\u0430\u043b\u0442",is_external:"\u0425\u0430\u044f\u0433 \u0434\u044d\u044d\u0440 \u0433\u0430\u0434\u0430\u0430\u0434 \u0445\u043e\u043b\u0431\u043e\u043e\u0441 \u0431\u0430\u0439\u0433\u0430\u0430 \u0445\u0430\u0440\u0430\u0433\u0434\u0430\u043d\u0430. \u0422\u0430 \u0437\u04e9\u0432 \u0445\u043e\u043b\u0431\u043e\u043e\u0441 \u0431\u043e\u043b\u0433\u043e\u0445\u044b\u043d \u0442\u0443\u043b\u0434 http:// \u043d\u044d\u043c\u044d\u0445\u0438\u0439\u0433 \u0445\u04af\u0441\u044d\u0436 \u0431\u0430\u0439\u043d\u0430 \u0443\u0443?",is_email:"\u0425\u0430\u044f\u0433 \u0434\u044d\u044d\u0440 \u0418\u043c\u044d\u0439\u043b \u0445\u0430\u044f\u0433 \u0431\u0430\u0439\u0445 \u0448\u0438\u0433 \u0445\u0430\u0440\u0430\u0433\u0434\u0430\u043d\u0430. \u0422\u0430 \u0442\u04af\u04af\u043d\u0434 \u0448\u0430\u0430\u0440\u0434\u043b\u0430\u0433\u0430\u0442\u0430\u0439 mailto: \u043d\u044d\u043c\u044d\u0445\u0438\u0439\u0433 \u0445\u04af\u0441\u044d\u0436 \u0431\u0430\u0439\u043d\u0430 \u0443\u0443?",titlefield:"\u0413\u0430\u0440\u0447\u0438\u0433",target:"\u0426\u043e\u043d\u0445",url:"\u0425\u0430\u044f\u0433",title:"\u0425\u043e\u043b\u0431\u043e\u043e\u0441 \u043e\u0440\u0443\u0443\u043b\u0430\u0445/\u0437\u0430\u0441\u0430\u0445",link_list:"\u0425\u043e\u043b\u0431\u043e\u043e\u0441\u044b\u043d \u0436\u0430\u0433\u0441\u0430\u0430\u043b\u0442",rtl:"\u0411\u0430\u0440\u0443\u0443\u043d\u0430\u0430\u0441 \u0437\u04af\u04af\u043d",ltr:"\u0417\u04af\u04af\u043d\u044d\u044d\u0441 \u0431\u0430\u0440\u0443\u0443\u043d",accesskey:"\u0422\u043e\u0432\u0447\u0438\u043b\u0431\u043e\u0440",tabindex:"\u0422\u0430\u0431\u0443\u043b\u0430\u0442\u043e\u0440 \u0438\u043d\u0434\u0435\u043a\u0441",rev:"\u0425\u0443\u0443\u0434\u0430\u0441\u043d\u0430\u0430\u0441 \u0442\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u043e\u043b\u0431\u043e\u043e\u0441\u043e\u043e\u0441 \u0445\u043e\u043b\u0431\u043e\u043b\u0442",rel:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u043e\u043b\u0431\u043e\u043e\u0441\u043e\u043e\u0441 \u0445\u0443\u0443\u0434\u0430\u0441\u043d\u044b \u0445\u043e\u043b\u0431\u043e\u043b\u0442",mime:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u0443\u0443\u0434\u0430\u0441\u043d\u044b MIME \u0442\u04e9\u0440\u04e9\u043b",encoding:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u0443\u0443\u0434\u0430\u0441\u043d\u044b \u043a\u043e\u0434\u0447\u0438\u043b\u043e\u043b",langcode:"\u0425\u044d\u043b\u043d\u0438\u0439 \u043a\u043e\u0434",target_langcode:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d \u0445\u0443\u0443\u0434\u0430\u0441\u043d\u044b \u0445\u044d\u043b"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ms_dlg.js b/js/tiny_mce/plugins/advlink/langs/ms_dlg.js new file mode 100755 index 000000000..c3267c04a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.advlink_dlg',{target_name:"Nama sasaran",classes:"Kelas-kelas",style:"Gaya",id:"Id",popup_position:"Posisi (X/Y)",langdir:"Arah bahasa",popup_size:"Saiz",popup_dependent:"Tanggungan (Hanya Mozilla/Firefox)",popup_resizable:"Jadikan tetingkap boleh diubahsuai",popup_location:"Tunjuk bar lokasi",popup_menubar:"Tunjuk bar menu",popup_toolbar:"Tunjuk bar alatan",popup_statusbar:"Tunjuk bar status",popup_scrollbars:"Tunjuk bar gulung",popup_return:"Masukkan \'return false\'",popup_name:"Nama tetingkap",popup_url:"Popup URL",popup:"Popup Javascript ",target_blank:"Buka dalam tetingkap baru.",target_top:"Buka bingkaian atas (gantikan kesemua bingkai)",target_parent:"Buka dalam tetingkap yang lain",target_same:"Buka tetingkap ini",anchor_names:"Sauh",popup_opts:"Pilihan",advanced_props:"Alatan lanjutan",event_props:"Peristiwa",popup_props:"Alatan Popup",general_props:"Alatan am",advanced_tab:"Lanjutan",events_tab:"Peristiwa",popup_tab:"Popup",general_tab:"Am",list:"Senarai pautan",is_external:"URL yang dimasukkan adalah pautan luar, tambah \"http://\" di awalan?",is_email:"URL yang dimasukkan adalah alamat emel, tambah \"mailto\": di awalan?",titlefield:"Tajuk",target:"Sasaran",url:"Pautan URL",title:"Sisip/sunting pautan",link_list:"Senarai pautan",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",accesskey:"Kunci akses",tabindex:"Tanda indeks",rev:"Kaitan sasaran kepada halaman",rel:"Kaitan halaman kepada sasaran",mime:"Sasaran jenis MIME",encoding:"Sasaran enkod perkataan",langcode:"Kod bahasa",target_langcode:"Bahasa sasaran"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/my_dlg.js b/js/tiny_mce/plugins/advlink/langs/my_dlg.js new file mode 100755 index 000000000..02cc985a2 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/nb_dlg.js b/js/tiny_mce/plugins/advlink/langs/nb_dlg.js new file mode 100755 index 000000000..fc29ce712 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.advlink_dlg',{"target_name":"M\u00e5lnavn",classes:"Klasser",style:"Stil",id:"Id","popup_position":"Posisjon (X/Y)",langdir:"Skriftretning","popup_size":"St\u00f8rrelse","popup_dependent":"Avhengig vindu (bare i Mozilla/Firefox)","popup_resizable":"Gj\u00f8r vinduet skalerbart","popup_location":"Vis plasseringslinje","popup_menubar":"Vis menylinje","popup_toolbar":"Vis verkt\u00f8ylinjer","popup_statusbar":"Vis statuslinje","popup_scrollbars":"Vis rullefelt","popup_return":"Sett inn \'return false\'","popup_name":"Vindunavn","popup_url":"Popup URL",popup:"Javascript-popup","target_blank":"\u00c5pne i nytt vindu","target_top":"\u00c5pne i toppvindu (erstatter alle rammer)","target_parent":"\u00c5pne i overordnet vindu/ramme","target_same":"\u00c5pne i samme vindu/ramme","anchor_names":"Anker","popup_opts":"Innstillinger","advanced_props":"Generelle egenskaper","event_props":"Hendelser","popup_props":"Popup-egenskaper","general_props":"Generelle egenskaper","advanced_tab":"Avansert","events_tab":"Hendelser","popup_tab":"Popup","general_tab":"Generelt",list:"Lenkeliste","is_external":"URL\'en du oppga synes \u00e5 v\u00e6re en ekstern lenke, \u00f8nsker du \u00e5 legge til den n\u00f8dvendige http:// prefix?","is_email":"URL\'en du oppga synes \u00e5 v\u00e6re en email adresse, \u00f8nsker du \u00e5 legge til den n\u00f8dvendige mailto: prefix?",titlefield:"Tittel",target:"M\u00e5l",url:"Lenkens URL",title:"Sett inn / rediger lenke","link_list":"Lenkeliste",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",accesskey:"Hurtigtast",tabindex:"Tabulatorindeks",rev:"M\u00e5lets forhold til siden",rel:"Sidens forhold til m\u00e5let",mime:"M\u00e5lets MIME-type",encoding:"Tegnkonvertering",langcode:"Spr\u00e5kkode","target_langcode":"M\u00e5lspr\u00e5k"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/nl_dlg.js b/js/tiny_mce/plugins/advlink/langs/nl_dlg.js new file mode 100755 index 000000000..f6a51bb35 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.advlink_dlg',{"target_name":"Doel",classes:"Klassen",style:"Stijl",id:"Id","popup_position":"Positie (X/Y)",langdir:"Taalrichting","popup_size":"Grootte","popup_dependent":"Afhankelijk (Alleen Mozilla/Firefox)","popup_resizable":"Aanpasbaar venster","popup_location":"Lokatiebalk weergeven","popup_menubar":"Menubalk weergeven","popup_toolbar":"Werkbalk weergeven","popup_statusbar":"Statusbalk weergeven","popup_scrollbars":"Scrollbalken weergeven","popup_return":"\'return false\' invoegen","popup_name":"Venstertitel","popup_url":"Popup URL",popup:"Javascript popup","target_blank":"In nieuw venster openen","target_top":"In bovenste frame openen (vervangt gehele pagina)","target_parent":"In bovenliggend venster / frame openen","target_same":"In dit venster / frame openen","anchor_names":"Ankers","popup_opts":"Opties","advanced_props":"Geavanceerde eigenschappen","event_props":"Gebeurtenissen","popup_props":"Popup eigenschappen","general_props":"Algemene eigenschappen","advanced_tab":"Geavanceerd","events_tab":"Gebeurtenissen","popup_tab":"Popup","general_tab":"Algemeen",list:"Lijst","is_external":"De ingevoerde URL lijkt op een externe link. Wilt u de vereiste http:// tekst voorvoegen?","is_email":"De ingevoerde URL lijkt op een e-mailadres. Wilt u de vereiste mailto: tekst voorvoegen?",titlefield:"Titel",target:"Doel",url:"URL",title:"Link invoegen/bewerken","link_list":"Lijst",rtl:"Van rechts naar links",ltr:"Van links naar rechts",accesskey:"Toegangstoets",tabindex:"Tabvolgorde",rev:"Relatie van doel tot pagina",rel:"Relatie van pagina tot doel",mime:"MIME type",encoding:"Taalcodering",langcode:"Taalcode","target_langcode":"Taal"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/nn_dlg.js b/js/tiny_mce/plugins/advlink/langs/nn_dlg.js new file mode 100755 index 000000000..82ccda6a4 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.advlink_dlg',{target_name:"M\u00e5lnamn",classes:"Klasser",style:"Stil",id:"Id",popup_position:"Posisjon (X/Y)",langdir:"Skriftretning",popup_size:"Storleik",popup_dependent:"Avhengig vindu (berre i Mozilla/Firefox)",popup_resizable:"Gjer vindauget skalerbart",popup_location:"Vis plasseringsline",popup_menubar:"Vis menyline",popup_toolbar:"Vis verktyliner",popup_statusbar:"Vis statusline",popup_scrollbars:"Vis rullefelt",popup_return:"Set inn \\\'return false\\\'",popup_name:"Namn p\u00e5 vindauge",popup_url:"Popup URL",popup:"Javascript-popup",target_blank:"Opne i nytt vindauge",target_top:"Opne i toppvindauge (erstattar alle rammer)",target_parent:"Opne i overordna vindauge/ramme",target_same:"Opne i same vindauge/ramme",anchor_names:"Anker",popup_opts:"Innstillingar",advanced_props:"Generelle eigenskapar",event_props:"Hendingar",popup_props:"Popup-eigenskapar",general_props:"Generelt",advanced_tab:"Avansert",events_tab:"Hendingar",popup_tab:"Popup",general_tab:"Generelt",list:"Lenkjeliste",is_external:"URL-en du skreiv inn ser ut til \u00e5 vere ei eksern lenkje. \u00d8nskjer du \u00e5 leggje til det obligatoriske http://-prefikset?",is_email:"URL-en du skreiv inn ser ut til \u00e5 vere ei e-postadresse. \u00d8nskjer du \u00e5 leggje til det obligatoriske mailto:-prefikset?",titlefield:"Tittel",target:"M\u00e5l",url:"Lenkje-URL",title:"Set inn / rediger lenkje",link_list:"Lenkjeliste",rtl:"H\u00f8gre mot venstre",ltr:"Venstre mot h\u00f8gre",accesskey:"Hurtigtast",tabindex:"Tabulatorindeks",rev:"M\u00e5let sitt forhold til sida",rel:"Sida sitt forhold til m\u00e5let",mime:"M\u00e5let sin MIME-type",encoding:"Teiknkonvertering",langcode:"Spr\u00e5kkode",target_langcode:"M\u00e5lspr\u00e5k"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/no_dlg.js b/js/tiny_mce/plugins/advlink/langs/no_dlg.js new file mode 100755 index 000000000..d4c59261f --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.advlink_dlg',{"target_name":"M\u00e5lnavn",classes:"Klasse",style:"Stil",id:"Id","popup_position":"Posisjon (X/Y)",langdir:"Skriftretning","popup_size":"St\u00f8rrelse","popup_dependent":"Avhengig vindu (kun i Mozilla/Firefox)","popup_resizable":"Gj\u00f8r vinduet skalerbart","popup_location":"Vis plasseringslinje","popup_menubar":"Vis menylinje","popup_toolbar":"Vis verkt\u00f8ylinjer","popup_statusbar":"Vis statusline","popup_scrollbars":"Vis rullefelt","popup_return":"Sett inn \\\'return false\\\'","popup_name":"Navn p\u00e5 vindu","popup_url":"Popup URL",popup:"Javascript popup","target_blank":"\u00c5pne i nytt vindu","target_top":"\u00c5pne i toppvindu (erstatter alle rammer)","target_parent":"\u00c5pne i overordnet vindu/ramme","target_same":"\u00c5pne i samme vindu/ramme","anchor_names":"Anker","popup_opts":"Innstillinger","advanced_props":"Avanserte egenskaper","event_props":"Hendelser","popup_props":"Popup egenskaper","general_props":"Generelle egenskaper","advanced_tab":"Avansert","events_tab":"Hendelser","popup_tab":"Popup","general_tab":"Generelt",list:"Liste over lenker","is_external":"URLen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern lenke. \u00d8nsker du \u00e5 legge til obligatorisk http://-prefiks?","is_email":"URLen du skrev inn ser ut til \u00e5 v\u00e6re Epost adresse. \u00d8nsker du \u00e5 legge til obligatorisk mailto:-prefiks?",titlefield:"Tittel",target:"M\u00e5l",url:"Lenke URL",title:"Sett inn/editer lenke","link_list":"Liste over lenker",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",accesskey:"Hurtigtast",tabindex:"Tabulator indeks",rev:"Forholdet mellom m\u00e5l og side",rel:"Forholdet mellom side og m\u00e5l",mime:"M\u00e5l MIME type",encoding:"M\u00e5l karakter koding",langcode:"Spr\u00e5kkode","target_langcode":"M\u00e5lspr\u00e5k"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/pl_dlg.js b/js/tiny_mce/plugins/advlink/langs/pl_dlg.js new file mode 100755 index 000000000..037898a04 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.advlink_dlg',{"target_name":"Nazwa celu",classes:"Klasy",style:"Styl",id:"Id","popup_position":"Pozycja (X/Y)",langdir:"Kierunek czytania tekstu","popup_size":"Rozmiar","popup_dependent":"Zale\u017cny (Mozilla/Firefox wy\u0142\u0105cznie)","popup_resizable":"Stw\u00f3rz okno z mo\u017cliwo\u015bci\u0105 zmiany rozmiaru","popup_location":"Poka\u017c pasek adresu","popup_menubar":"Poka\u017c pasek menu","popup_toolbar":"Poka\u017c narz\u0119dzia","popup_statusbar":"Poka\u017c pasek statusu","popup_scrollbars":"Poka\u017c paski przewijania","popup_return":"Wstaw \'return false\'","popup_name":"Nazwa okna","popup_url":"URL okna",popup:"Wyskakuj\u0105ce okno","target_blank":"Otw\u00f3rz w nowym oknie","target_top":"Otw\u00f3rz w g\u00f3rnej ramce (zamie\u0144 wszystkie ramki)","target_parent":"Otw\u00f3rz w nadrz\u0119dnym oknie / ramce","target_same":"Otw\u00f3rz w tym oknie / ramce","anchor_names":"Kotwice","popup_opts":"Opcje","advanced_props":"Zaawansowae w\u0142a\u015bciwo\u015bci","event_props":"Zdarzenia","popup_props":"W\u0142a\u015bciwo\u015bci okna","general_props":"W\u0142a\u015bciwo\u015bci og\u00f3lne","advanced_tab":"Zaawansowane","events_tab":"Zdarzenia","popup_tab":"Popup","general_tab":"Og\u00f3lne",list:"Lista link\u00f3w","is_external":"Podany adres wydaje si\u0119 by\u0107 zewn\u0119trznym linkiem, czy chcesz doda\u0107 wymagany prefiks http://?","is_email":"Podany adres wydaje si\u0119 by\u0107 adresem emailowym, czy chcesz doda\u0107 wymagany prefiks mailto:?",titlefield:"Tytu\u0142",target:"Cel",url:"URL linka",title:"Wstaw/edytuj link","link_list":"Lista odno\u015bnik\u00f3w",rtl:"Kierunek z prawej do lewej",ltr:"Kierunek z lewej do prawej",accesskey:"Klawisz skr\u00f3tu",tabindex:"Numer tab",rev:"Relacje celu do strony",rel:"Relacje strony do celu",mime:"Docelowy typ MIME",encoding:"Kodowanie znak\u00f3w celu",langcode:"Kod j\u0119zyka","target_langcode":"Docelowy kod j\u0119zyka"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ps_dlg.js b/js/tiny_mce/plugins/advlink/langs/ps_dlg.js new file mode 100755 index 000000000..525473137 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/pt_dlg.js b/js/tiny_mce/plugins/advlink/langs/pt_dlg.js new file mode 100755 index 000000000..7a7a4a205 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.advlink_dlg',{target_name:"Nome do alvo",classes:"Classes",style:"Estilo",id:"Id",popup_position:"Posi\u00e7\u00e3o (X/Y)",langdir:"Dire\u00e7\u00e3o do texto",popup_size:"Tamanho",popup_dependent:"Dependente (Mozilla/Firefox apenas)",popup_resizable:"Permitir altera\u00e7\u00e3o do tamanho da janela",popup_location:"Mostrar a barra de endere\u00e7os",popup_menubar:"Mostrar a barra de menu",popup_toolbar:"Mostrar a barra de ferramentas",popup_statusbar:"Mostrar a barra de status",popup_scrollbars:"Mostrar as barras de scroll",popup_return:"Inserir \"return false\"",popup_name:"Nome da janela",popup_url:"URL do popup",popup:"Popup javascript",target_blank:"Abrir numa nova janela",target_top:"Abrir na p\u00e1gina inteira (substitui todos os quadros)",target_parent:"Abrir na janela/quadro pai",target_same:"Abrir nesta janela/quadro",anchor_names:"\u00c2ncoras",popup_opts:"Op\u00e7\u00f5es",advanced_props:"Propriedades avan\u00e7adas",event_props:"Eventos",popup_props:"Propriedades de popup",general_props:"Propriedades gerais",advanced_tab:"Avan\u00e7ado",events_tab:"Eventos",popup_tab:"Popup",general_tab:"Geral",list:"Lista de hyperlinks",is_external:"A URL digitada parece conduzir a um link externo. Deseja acrescentar o prefixo necess\u00e1rio http://?",is_email:"A URL digitada parece ser um endere\u00e7o de e-mail. Deseja acrescentar o prefixo necess\u00e1rio mailto:?",titlefield:"T\u00edtulo",target:"Alvo",url:"URL do hyperlink",title:"Inserir/editar hyperlink",link_list:"Lista de hyperlinks",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",accesskey:"Chave de acesso",tabindex:"Tabindex",rev:"Rela\u00e7\u00e3o alvo/p\u00e1gina",rel:"Rela\u00e7\u00e3o p\u00e1gina/alvo",mime:"Tipo MIME alvo",encoding:"Codifica\u00e7\u00e3o de caracteres",langcode:"C\u00f3digo do idioma",target_langcode:"Idioma alvo"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ro_dlg.js b/js/tiny_mce/plugins/advlink/langs/ro_dlg.js new file mode 100755 index 000000000..fa5e4d6e3 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.advlink_dlg',{target_name:"Nume \u0163int\u0103",classes:"Clase",style:"Stil",id:"Id",popup_position:"Pozi\u0163ie (X/Y)",langdir:"Direc\u0163ie limb\u0103",popup_size:"M\u0103rime",popup_dependent:"Dependent (Mozilla/Firefox)?",popup_resizable:"Fereastr\u0103 redimensionabil\u0103?",popup_location:"Arat\u0103 bara de adrese",popup_menubar:"Arat\u0103 meniul",popup_toolbar:"Arat\u0103 toolbar-uri",popup_statusbar:"Arat\u0103 bara de stare",popup_scrollbars:"Arat\u0103 barele de derulare",popup_return:"Insereaz\u0103 \'return false\'",popup_name:"Nume fereastr\u0103",popup_url:"URL Popup",popup:"Javascript Popup",target_blank:"Deschide \u00een fereastr\u0103 nou\u0103",target_top:"Deschide \u00een frame-ul cel mai mare (\u00eenlocuie\u015fte celelalte frame-uri)",target_parent:"Deschide leg\u0103tura \u00een fereastra/cadrul p\u0103rinte",target_same:"Deschide leg\u0103tura \u00een aceea\u015fi fereastr\u0103/acela\u015fi cadru",anchor_names:"Ancore",popup_opts:"Op\u0163iuni",advanced_props:"Propriet\u0103\u0163i avansate",event_props:"Evenimente",popup_props:"Propriet\u0103\u0163i popup",general_props:"Propriet\u0103\u0163i generale",advanced_tab:"Avansat",events_tab:"Evenimente",popup_tab:"Popup",general_tab:"General",list:"List\u0103 de leg\u0103turi",is_external:"URL-ul pe care l-a\u0163i introdus pare a fi o leg\u0103tur\u0103 extern\u0103. Dori\u0163i s\u0103 adaug \u015fi prefixul http:// necesar?",is_email:"URL-ul pe care l-a\u0163i introdus pare a fi o adres\u0103 de e-mail. Dori\u0163i s\u0103 adaug \u015fi prefixul mailto: necesar?",titlefield:"Titlu",target:"\u0162int\u0103",url:"URL leg\u0103tur\u0103",title:"Insereaz\u0103/editeaz\u0103 link",link_list:"List\u0103 leg\u0103turi",rtl:"Dreapta la st\u00e2nga",ltr:"St\u00e2nga la dreapta",accesskey:"Cheie de acces",tabindex:"Tabindex",rev:"Rela\u0163ia \u0163intei cu pagina",rel:"Rela\u0163ia paginii cu \u0163inta",mime:"MIME type \u0163int\u0103",encoding:"Set de caractere \u0163int\u0103",langcode:"Cod limb\u0103",target_langcode:"Limb\u0103"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ru_dlg.js b/js/tiny_mce/plugins/advlink/langs/ru_dlg.js new file mode 100755 index 000000000..4c67e390e --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.advlink_dlg',{"target_name":"\u0418\u043c\u044f \u0446\u0435\u043b\u0438",classes:"\u041a\u043b\u0430\u0441\u0441\u044b",style:"\u0421\u0442\u0438\u043b\u044c",id:"\u0418\u043c\u044f","popup_position":"\u041f\u043e\u0437\u0438\u0446\u0438\u044f (X/Y)",langdir:"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","popup_size":"\u0420\u0430\u0437\u043c\u0435\u0440","popup_dependent":"\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Firefox)","popup_resizable":"\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440","popup_location":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f","popup_menubar":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043c\u0435\u043d\u044e","popup_toolbar":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432","popup_statusbar":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f","popup_scrollbars":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0441\u044b \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438","popup_return":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \'return false\'","popup_name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u043a\u043d\u0430","popup_url":"\u0410\u0434\u0440\u0435\u0441",popup:"\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Java","target_blank":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435","target_top":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043a\u0430\u0434\u0440\u0435 (\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u0434\u0440\u044b)","target_parent":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043e\u043a\u043d\u0435/\u043a\u0430\u0434\u0440\u0435","target_same":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043e\u043a\u043d\u0435/\u043a\u0430\u0434\u0440\u0435","anchor_names":"\u042f\u043a\u043e\u0440\u044f","popup_opts":"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430","advanced_props":"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b","event_props":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439","popup_props":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f","general_props":"\u041e\u0431\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b","advanced_tab":"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e","events_tab":"\u0421\u043e\u0431\u044b\u0442\u0438\u044f","popup_tab":"\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435","general_tab":"\u041e\u0431\u0449\u0435\u0435",list:"\u0421\u043f\u0438\u0441\u043e\u043a","is_external":"\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 http://?","is_email":"\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 mailto:?",titlefield:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",target:"\u0426\u0435\u043b\u044c",url:"\u0410\u0434\u0440\u0435\u0441",title:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0441\u044b\u043b\u043a\u0438","link_list":"\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e",ltr:"\u0421\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e",accesskey:"\u041a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430",tabindex:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",rev:"\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435",rel:"\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043a \u0446\u0435\u043b\u0438",mime:"MIME \u0442\u0438\u043f \u0446\u0435\u043b\u0438",encoding:"\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0446\u0435\u043b\u0438",langcode:"\u041a\u043e\u0434 \u044f\u0437\u044b\u043a\u0430","target_langcode":"\u042f\u0437\u044b\u043a \u0446\u0435\u043b\u0438"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sc_dlg.js b/js/tiny_mce/plugins/advlink/langs/sc_dlg.js new file mode 100755 index 000000000..151cba4b0 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.advlink_dlg',{target_name:"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u578b",style:"\u6837\u5f0f",id:"Id",popup_position:"\u5ea7\u6807(X/Y)",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",popup_size:"\u5c3a\u5bf8",popup_dependent:"\u4ece\u5c5e(\u53ea\u6709Mozilla/Firefox\u6709\u6548)",popup_resizable:"\u53ef\u8c03\u6574\u89c6\u7a97\u5c3a\u5bf8",popup_location:"\u663e\u793a\u7f51\u5740\u5217",popup_menubar:"\u663e\u793a\u529f\u80fd\u8868",popup_toolbar:"\u663e\u793a\u5de5\u5177\u680f",popup_statusbar:"\u663e\u793a\u72b6\u6001\u680f",popup_scrollbars:"\u663e\u793a\u8fb9\u6761",popup_return:"\u63d2\u5165\'return false\'",popup_name:"\u7a97\u53e3\u540d\u79f0",popup_url:"\u5f39\u51fa\u7a97\u53e3\u7f51\u5740",popup:"Javascript\u5f39\u51fa\u7a97\u53e3",target_blank:"\u6253\u5f00\u5728\u65b0\u89c6\u7a97",target_top:"\u6253\u5f00\u5728\u6700\u4e0a\u5c42\u7684\u6846\u67b6(\u66ff\u6362\u6240\u6709\u6846\u67b6)",target_parent:"\u6253\u5f00\u5728\u7236\u89c6\u7a97/\u6846\u67b6",target_same:"\u6253\u5f00\u5728\u65b0\u89c6\u7a97/\u6846\u67b6",anchor_names:"\u951a\u70b9",popup_opts:"\u9009\u9879",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5f39\u51fa\u89c6\u7a97\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5f39\u51fa\u7a97\u53e3",general_tab:"\u4e00\u822c",list:"\u94fe\u7ed3\u6e05\u5355",is_external:"\u60a8\u8f93\u5165\u7684\u7f51\u5740\u5e94\u8be5\u662f\u4e00\u4e2a\u5916\u90e8\u8fde\u7ed3\uff0c\u662f\u5426\u9700\u8981\u5728\u7f51\u5740\u524d\u65b9\u52a0\u5165http://\uff1f ",is_email:"\u60a8\u8f93\u5165\u7684\u7f51\u5740\u5e94\u8be5\u662f\u4e00\u4e2a\u7535\u5b50\u90ae\u5bc4\u4f4d\u5740\uff0c\u662f\u5426\u9700\u8981\u5728\u90ae\u5740\u524d\u65b9\u52a0\u5165mailto:\uff1f ",titlefield:"\u67e5\u627e",target:"\u76ee\u6807",url:"\u94fe\u7ed3\u4f4d\u5740",title:"\u63d2\u5165/\u7f16\u8f91\u8fde\u7ed3",link_list:"\u94fe\u7ed3\u6e05\u5355",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",accesskey:"\u5feb\u6377\u952e",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6807\u5230\u9875\u7684\u5173\u7cfb",rel:"\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801",target_langcode:"\u76ee\u7684\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/se_dlg.js b/js/tiny_mce/plugins/advlink/langs/se_dlg.js new file mode 100755 index 000000000..093ddba29 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.advlink_dlg',{target_name:"M\u00e5lnamn",classes:"Klasser",style:"Stil",id:"Id",popup_position:"Position (x/y)",langdir:"Skriftriktning",popup_size:"Storlek",popup_dependent:"Beroende av (Mozilla/Firefox enbart)",popup_resizable:"Skalbart f\u00f6nster",popup_location:"Adressraden",popup_menubar:"Menyrad",popup_toolbar:"Verktygsf\u00e4lt",popup_statusbar:"Statusf\u00e4lt",popup_scrollbars:"Rullningslister",popup_return:"Infoga \'return false\'",popup_name:"F\u00f6nsternamn",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"\u00d6ppna i nytt f\u00f6nster",target_top:"\u00d6ppna i toppramen (ers\u00e4tter alla ramar)",target_parent:"\u00d6ppna i \u00f6verliggande f\u00f6nster/ram",target_same:"\u00d6ppna i detta f\u00f6nster/ram",anchor_names:"Bokm\u00e4rken",popup_opts:"Inst\u00e4llningar",advanced_props:"Avancerade inst\u00e4llningar",event_props:"H\u00e4ndelser",popup_props:"Popup-inst\u00e4llningar",general_props:"Generella inst\u00e4llningar",advanced_tab:"Avancerat",events_tab:"H\u00e4ndelser",popup_tab:"Popup",general_tab:"Generellt",list:"L\u00e4nklista",is_external:"L\u00e4nken du angav verkar vara en extern adress. Vill du infoga http:// prefixet p\u00e5 l\u00e4nken?",is_email:"L\u00e4nken du angav verkar vara en e-post adress. Vill du infoga mailto: prefixet p\u00e5 l\u00e4nken?",titlefield:"Titel",target:"M\u00e5l",url:"L\u00e4nkens URL",title:"Infoga/redigera l\u00e4nk",link_list:"L\u00e4nklista",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",accesskey:"Snabbtangent",tabindex:"Tabbindex",rev:"Omv\u00e4nd relation (rev)",rel:"Relation (rel attribut)",mime:"MIME type",encoding:"Teckenformattering",langcode:"Spr\u00e5kkod",target_langcode:"M\u00e5lspr\u00e5k"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/si_dlg.js b/js/tiny_mce/plugins/advlink/langs/si_dlg.js new file mode 100755 index 000000000..f24e10b58 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sk_dlg.js b/js/tiny_mce/plugins/advlink/langs/sk_dlg.js new file mode 100755 index 000000000..eba5b7260 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.advlink_dlg',{target_name:"N\u00e1zov cie\u013ea",classes:"Triedy",style:"\u0160t\u00fdl",id:"ID",popup_position:"Umiestnenie (X/Y)",langdir:"Smer textu",popup_size:"Ve\u013ekos\u0165",popup_dependent:"Z\u00e1vislos\u0165 (iba Mozilla/Firefox)",popup_resizable:"Umo\u017eni\u0165 zmenu ve\u013ekosti",popup_location:"Zobrazi\u0165 li\u0161tu umiestnen\u00ed",popup_menubar:"Zobrazi\u0165 ponuku",popup_toolbar:"Zobrazi\u0165 n\u00e1strojov\u00fa li\u0161tu",popup_statusbar:"Zobrazi\u0165 stavov\u00fd riadok",popup_scrollbars:"Zobrazi\u0165 posuvn\u00edky",popup_return:"Vlo\u017ei\u0165 \'return false\'",popup_name:"N\u00e1zov okna",popup_url:"URL vyskakovacieho okna",popup:"JavaScriptov\u00e9 okno",target_blank:"Otvori\u0165 v novom okne",target_top:"Otvori\u0165 v hlavnom okne/r\u00e1me (nahradi\u0165 v\u0161etky r\u00e1my)",target_parent:"Otvori\u0165 v nadradenom okne/r\u00e1me",target_same:"Otvori\u0165 v rovnakom okne/r\u00e1me",anchor_names:"Z\u00e1lo\u017eka",popup_opts:"Mo\u017enosti",advanced_props:"Roz\u0161\u00edren\u00e9 parametre",event_props:"Udalosti",popup_props:"Vlastnosti vyskakovacieho okna",general_props:"Obecn\u00e9 parametre",advanced_tab:"Roz\u0161\u00edren\u00e9",events_tab:"Udalosti",popup_tab:"Vyskakovacie okno",general_tab:"Obecn\u00e9",list:"Zoznam odkazov",is_external:"Zadan\u00e1 URL vyzer\u00e1 ako extern\u00fd odkaz, chcete doplni\u0165 povinn\u00fd prefix http://?",is_email:"Zadan\u00e1 URL vyzer\u00e1 ako e-mailov\u00e1 adresa, chcete doplni\u0165 povinn\u00fd prefix mailto:?",titlefield:"Titulok",target:"Cie\u013e",url:"URL odkazu",title:"Vlo\u017ei\u0165/upravi\u0165 odkaz",link_list:"Zoznam odkazov",rtl:"Sprava do\u013eava",ltr:"Z\u013eava doprava",accesskey:"Kl\u00e1vesov\u00e1 skratka",tabindex:"Poradie pre tabul\u00e1tor",rev:"Vz\u0165ah cie\u013ea k str\u00e1nke",rel:"Vz\u0165ah str\u00e1nky k cie\u013eu",mime:"MIME typ",encoding:"K\u00f3dovanie",langcode:"K\u00f3d jazyka",target_langcode:"Jazyk cie\u013ea"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sl_dlg.js b/js/tiny_mce/plugins/advlink/langs/sl_dlg.js new file mode 100755 index 000000000..5d3777621 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.advlink_dlg',{target_name:"Ime cilja",classes:"Razredi",style:"Slog",id:"Id",popup_position:"Polo\u017eaj (X/Y)",langdir:"Smer pisave",popup_size:"Velikost",popup_dependent:"Odvisno (le za Mozillo/Firefox)",popup_resizable:"Omogo\u010di pvoe\u010devanje okna",popup_location:"Prika\u017ei vrstico naslova",popup_menubar:"Prika\u017ei meni",popup_toolbar:"Prika\u017ei orodjarno",popup_statusbar:"Prika\u017ei vrstico stanja",popup_scrollbars:"Prika\u017ei drsnike",popup_return:"Vstavi \\\'return false\\\'",popup_name:"Ime okna",popup_url:"Naslov URL okna",popup:"Dodatno okno z javascriptom",target_blank:"Odpri v novem oknu",target_top:"Odpri v vrhnjem okviru (nadomesti vse okvire)",target_parent:"Odpri v nadrejenem oknu / okviru",target_same:"Odpri v tem oknu / okviru",anchor_names:"Sidra",popup_opts:"Mo\u017enosti",advanced_props:"Napredne lastnosti",event_props:"Dogodki",popup_props:"Lastnosti okna",general_props:"Splo\u0161ne lastnosti",advanced_tab:"Napredno",events_tab:"Dogodki",popup_tab:"Dodatno okno",general_tab:"Splo\u0161no",list:"Seznam povezav",is_external:"Vneseni naslov verjetno predstavlja zunanjo povezavo, \u017eelite da dodam zahtevano predpono",is_email:"Vneseni naslov verjetno prestavlja e-naslov, \u017eelite da dodam zahtevano predpono \\\'mailto:\\\'?",titlefield:"Naslov",target:"Cilj",url:"Naslov URL",title:"Vstavi/uredi povezavo",link_list:"Seznam povezav",rtl:"Od desne proti levi",ltr:"Od leve proti desni",accesskey:"Tipka dostopa",tabindex:"Zap. \u0161t.",rev:"Razmerje cilja do strani",rel:"Razmerje strani do cilja",mime:"Tip MIME cilja",encoding:"Kodiranje znakov cilja",langcode:"Koda jezika",target_langcode:"Jezik cilja"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sq_dlg.js b/js/tiny_mce/plugins/advlink/langs/sq_dlg.js new file mode 100755 index 000000000..84914b6c4 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.advlink_dlg',{target_name:"Emri",classes:"Klasat",style:"Stili",id:"Id",popup_position:"Pozicioni (X/Y)",langdir:"Drejtimi i gjuh\u00ebs",popup_size:"Madh\u00ebsia",popup_dependent:"I varur (vet\u00ebm Mozilla/Firefox)",popup_resizable:"B\u00ebje dritaren t\u00eb zmadhueshme",popup_location:"Shfaq shiritin e adres\u00ebs",popup_menubar:"Shfaq menun\u00eb",popup_toolbar:"Shfaq butonat",popup_statusbar:"Shfaq shiritin e statusit",popup_scrollbars:"Shfaq ashensor\u00ebt",popup_return:"Fut \'return false\'",popup_name:"Emri i dritares",popup_url:"URL e popup",popup:"Popup me Javascript",target_blank:"Hape n\u00eb dritare t\u00eb re",target_top:"Hape n\u00eb frame-in e m\u00ebsip\u00ebrm",target_parent:"Hape n\u00eb dritaren m\u00ebm\u00eb / frame",target_same:"Hape n\u00eb k\u00ebt\u00eb dritare / frame",anchor_names:"Lidhjet",popup_opts:"Opsionet",advanced_props:"Tipare t\u00eb avancuara",event_props:"Ngjarjet",popup_props:"Tiparet e popup",general_props:"Tipare t\u00eb p\u00ebrgjithshme",advanced_tab:"T\u00eb Avancuara",events_tab:"Ngjarjet",popup_tab:"Popup",general_tab:"T\u00eb P\u00ebrgjithshme",list:"Lista e lidhjeve",is_external:"Adresa q\u00eb keni futur duket si lidhje e jashtme. D\u00ebshironi t\u00eb shtoni prefiksin http://?",is_email:"Adresa q\u00eb keni futur duket si email. D\u00ebshironi t\u00eb shtoni prefiksin mailto:?",titlefield:"Titulli",target:"Sh\u00ebnjestra",url:"URL e lidhjes",title:"Fut/edito lidhje",link_list:"Lista e lidhjeve",rtl:"Djathtas-Majtas",ltr:"Majtas-Djathtas",accesskey:"Butoni i aksesit",tabindex:"Indeksi i Tab",rev:"Marr\u00ebdh\u00ebnia sh\u00ebnjest\u00ebr-faqe",rel:"Marr\u00ebdh\u00ebnia faqe-sh\u00ebnjest\u00ebr",mime:"Tipi MIME i sh\u00ebnjestr\u00ebs",encoding:"Kodimi i karaktereve t\u00eb sh\u00ebnjestr\u00ebs",langcode:"Kodi i gjuh\u00ebs",target_langcode:"Gjuha e sh\u00ebnjestr\u00ebs"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sr_dlg.js b/js/tiny_mce/plugins/advlink/langs/sr_dlg.js new file mode 100755 index 000000000..3a5c3e974 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.advlink_dlg',{target_name:"Ime mete",classes:"Klasa",style:"Stil",id:"Id",popup_position:"Pozicija (X/Y)",langdir:"Smer jezika",popup_size:"Veli\u010dina",popup_dependent:"Zavistan (samo za Mozilla/Firefox)",popup_resizable:"Prozor promenljive veli\u010dine",popup_location:"Prika\u017ei traku lokacije",popup_menubar:"Prika\u017ei Meni",popup_toolbar:"Prika\u017ei trake sa alatima",popup_statusbar:"Prika\u017ei statusnu traku",popup_scrollbars:"Prika\u017ei kliza\u010de",popup_return:"Ubaci \'return false\'",popup_name:"Ime prozora",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Otvori u novom prozoru",target_top:"Otvori u gornjem ramu (zamenjuje sve ramove)",target_parent:"Otvori u izvornom prozoru / ramu",target_same:"Otovori u novom prozoru / ramu",anchor_names:"Sidra",popup_opts:"Opcije",advanced_props:"Napredna svojstva",event_props:"Doga\u0111aji",popup_props:"Detalji popup prozora",general_props:"Detalji",advanced_tab:"Napredno",events_tab:"Doga\u0111aji",popup_tab:"Popup",general_tab:"Op\u0161te opcije",list:"Lista linkova",is_external:"URL koji ste uneli izgleda kao spolja\u0161nji link, da li \u017eelite da dodate neophodni http:// prefiks?",is_email:"URL koji ste uneli izgleda kao e-mail adresa, da li \u017eelite da dodate neophodni mailto: prefiks?",titlefield:"Naslov",target:"Meta",url:"URL link",title:"Ubaci/izmeni link",link_list:"Lista linkova",rtl:"S desna na levo",ltr:"S leva na desno",accesskey:"Taster za pristup",tabindex:"Tabindex",rev:"Odnos mete prema stranici",rel:"Odnos stranice prema meti",mime:"MIME tip",encoding:"Kodiranje znakova",langcode:"Kod jezika",target_langcode:"Jezik"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/sv_dlg.js b/js/tiny_mce/plugins/advlink/langs/sv_dlg.js new file mode 100755 index 000000000..272f76233 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.advlink_dlg',{"target_name":"M\u00e5lnamn",classes:"Klasser",style:"Stil",id:"Id","popup_position":"Position (x/y)",langdir:"Skriftriktning","popup_size":"Storlek","popup_dependent":"Beroende av (Mozilla/Firefox enbart)","popup_resizable":"Skalbart f\u00f6nster","popup_location":"Adressraden","popup_menubar":"Menyrad","popup_toolbar":"Verktygsf\u00e4lt","popup_statusbar":"Statusf\u00e4lt","popup_scrollbars":"Rullningslister","popup_return":"Infoga \'return false\'","popup_name":"F\u00f6nsternamn","popup_url":"Popup URL",popup:"Javascript popup","target_blank":"\u00d6ppna i nytt f\u00f6nster","target_top":"\u00d6ppna i toppramen (ers\u00e4tter alla ramar)","target_parent":"\u00d6ppna i \u00f6verliggande f\u00f6nster/ram","target_same":"\u00d6ppna i detta f\u00f6nster/ram","anchor_names":"Bokm\u00e4rken","popup_opts":"Inst\u00e4llningar","advanced_props":"Avancerade inst\u00e4llningar","event_props":"H\u00e4ndelser","popup_props":"Popup-inst\u00e4llningar","general_props":"Generella inst\u00e4llningar","advanced_tab":"Avancerat","events_tab":"H\u00e4ndelser","popup_tab":"Popup","general_tab":"Generellt",list:"L\u00e4nklista","is_external":"L\u00e4nken du angav verkar vara en extern adress. Vill du infoga http:// prefixet p\u00e5 l\u00e4nken?","is_email":"L\u00e4nken du angav verkar vara en e-post adress. Vill du infoga mailto: prefixet p\u00e5 l\u00e4nken?",titlefield:"Titel",target:"M\u00e5l",url:"L\u00e4nkens URL",title:"Infoga/redigera l\u00e4nk","link_list":"L\u00e4nklista",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",accesskey:"Snabbtangent",tabindex:"Tabbindex",rev:"Omv\u00e4nd relation (rev)",rel:"Relation (rel attribut)",mime:"MIME type",encoding:"Teckenformattering",langcode:"Spr\u00e5kkod","target_langcode":"M\u00e5lspr\u00e5k"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ta_dlg.js b/js/tiny_mce/plugins/advlink/langs/ta_dlg.js new file mode 100755 index 000000000..cf932189a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/te_dlg.js b/js/tiny_mce/plugins/advlink/langs/te_dlg.js new file mode 100755 index 000000000..92c3d0306 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/th_dlg.js b/js/tiny_mce/plugins/advlink/langs/th_dlg.js new file mode 100755 index 000000000..dd0eb79c8 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.advlink_dlg',{target_name:"\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",classes:"\u0e04\u0e25\u0e32\u0e2a",style:"\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a",id:"Id",popup_position:"\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07 (X/Y)",langdir:"\u0e17\u0e34\u0e28\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e48\u0e32\u0e19",popup_size:"\u0e02\u0e19\u0e32\u0e14",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e02\u0e19\u0e32\u0e14\u0e02\u0e2d\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e44\u0e14\u0e49",popup_location:"\u0e41\u0e2a\u0e14\u0e07\u0e0a\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48",popup_menubar:"\u0e41\u0e2a\u0e14\u0e07\u0e41\u0e16\u0e1a\u0e40\u0e21\u0e19\u0e39",popup_toolbar:"\u0e41\u0e2a\u0e14\u0e07\u0e17\u0e39\u0e25\u0e1a\u0e32\u0e23\u0e4c",popup_statusbar:"\u0e41\u0e2a\u0e14\u0e07\u0e41\u0e16\u0e1a\u0e2a\u0e16\u0e32\u0e19\u0e30",popup_scrollbars:"\u0e41\u0e2a\u0e14\u0e07\u0e2a\u0e01\u0e23\u0e2d\u0e25\u0e1a\u0e32\u0e23\u0e4c",popup_return:"\u0e40\u0e1e\u0e34\u0e48\u0e21 \'return false\'",popup_name:"\u0e0a\u0e37\u0e48\u0e2d\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07",popup_url:"\u0e1b\u0e4a\u0e2d\u0e1b-\u0e2d\u0e31\u0e1e URL",popup:"\u0e08\u0e32\u0e27\u0e32 \u0e1b\u0e4a\u0e2d\u0e1b-\u0e2d\u0e31\u0e1e",target_blank:"\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e43\u0e2b\u0e21\u0e48",target_top:"\u0e40\u0e1b\u0e34\u0e14\u0e17\u0e35\u0e48\u0e40\u0e1f\u0e23\u0e21\u0e1a\u0e19 (\u0e41\u0e17\u0e19\u0e17\u0e35\u0e48\u0e17\u0e38\u0e01\u0e40\u0e1f\u0e23\u0e21)",target_parent:"\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e40\u0e14\u0e34\u0e21 / \u0e40\u0e1f\u0e23\u0e21",target_same:"\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e43\u0e2b\u0e21\u0e48 / \u0e40\u0e1f\u0e23\u0e21",anchor_names:"\u0e0a\u0e37\u0e48\u0e2d\u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",popup_opts:"\u0e15\u0e31\u0e27\u0e40\u0e25\u0e37\u0e2d\u0e01",advanced_props:"\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",event_props:"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21",popup_props:"\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e1b\u0e4a\u0e2d\u0e1b-\u0e2d\u0e31\u0e1e",general_props:"\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b",advanced_tab:"\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",events_tab:"\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21",popup_tab:"\u0e1b\u0e4a\u0e2d\u0e1b-\u0e2d\u0e31\u0e1e",general_tab:"\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b",list:"\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",is_external:"URL \u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e1b\u0e49\u0e2d\u0e19\u0e14\u0e39\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e27\u0e48\u0e32\u0e20\u0e32\u0e22\u0e19\u0e2d\u0e01\u0e25\u0e34\u0e07\u0e04\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21 http:// \u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48 ?",is_email:"URL \u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e1b\u0e49\u0e2d\u0e19\u0e14\u0e39\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e27\u0e48\u0e32\u0e08\u0e30\u0e21\u0e35\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e2d\u0e35\u0e40\u0e21\u0e25\u0e2d\u0e22\u0e39\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21 mailto: \u0e19\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48 ",titlefield:"\u0e0a\u0e37\u0e48\u0e2d",target:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",url:"\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48 \u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",title:"\u0e40\u0e1e\u0e34\u0e48\u0e21/\u0e41\u0e01\u0e49\u0e44\u0e02 \u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",link_list:"\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e25\u0e34\u0e49\u0e07\u0e04\u0e4c",rtl:"\u0e02\u0e27\u0e32\u0e44\u0e1b\u0e0b\u0e49\u0e32\u0e22",ltr:"\u0e0b\u0e49\u0e32\u0e22\u0e44\u0e1b\u0e02\u0e27\u0e32",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22 MIME type",encoding:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e31\u0e01\u0e29\u0e23",langcode:"\u0e42\u0e04\u0e49\u0e14\u0e20\u0e32\u0e29\u0e32",target_langcode:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22 \u0e20\u0e32\u0e29\u0e32"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/tn_dlg.js b/js/tiny_mce/plugins/advlink/langs/tn_dlg.js new file mode 100755 index 000000000..ecd0d5ad4 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/tr_dlg.js b/js/tiny_mce/plugins/advlink/langs/tr_dlg.js new file mode 100755 index 000000000..2b39f826d --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.advlink_dlg',{target_name:"Hedef ad\u0131",classes:"S\u0131n\u0131fla",style:"Stil",id:"Id",popup_position:"Konum (X/Y)",langdir:"Dil y\u00f6n\u00fc",popup_size:"Boyut",popup_dependent:"Ba\u011f\u0131ml\u0131 (Sadece Mozilla Firefox)",popup_resizable:"Pencereyi boyutland\u0131r\u0131labilir yap",popup_location:"Aderes \u00e7ubu\u011funu g\u00f6ster",popup_menubar:"Men\u00fc \u00e7ubu\u011funu g\u00f6ster",popup_toolbar:"Ara\u00e7 kutusunu g\u00f6ster",popup_statusbar:"Durum \u00e7ubu\u011funu g\u00f6ster",popup_scrollbars:"Kayd\u0131rma \u00e7ubuklar\u0131n\u0131 g\u00f6ster",popup_return:"Ekle \'return false\'",popup_name:"Pencere ad\u0131",popup_url:"A\u00e7\u0131l\u0131r pencere URL\'si",popup:"Javascript a\u00e7\u0131l\u0131r pencere",target_blank:"Yeni pencerede a\u00e7",target_top:"\u00dcst \u00e7er\u00e7evede a\u00e7 (t\u00fcm \u00e7er\u00e7eveleri de\u011fi\u015ftir) ",target_parent:"Ana pencerede / \u00e7er\u00e7evede a\u00e7",target_same:"Pencerede / \u00e7er\u00e7evede a\u00e7",anchor_names:"Nesne tutucular",popup_opts:"Se\u00e7enekler",advanced_props:"Geli\u015fmi\u015f \u00f6zellikler",event_props:"Olaylar",popup_props:"A\u00e7\u0131l\u0131r pencere \u00f6zellikleri",general_props:"Genel \u00f6zellikler",advanced_tab:"Geli\u015fmi\u015f",events_tab:"Olaylar",popup_tab:"A\u00e7\u0131l\u0131r pencere",general_tab:"Genel",list:"Ba\u011flant\u0131 listesi",is_external:"Girdi\u011fiz URL d\u0131\u015f ba\u011flant\u0131 gibi g\u00f6r\u00fcn\u00fcyor; gerekli olan http:// \u00f6nekinin eklenmesini ister misiniz?",is_email:"Girdi\u011finiz URL e-posta adresi gibi g\u00f6r\u00fcn\u00fcyor; gerekli olan mailto: \u00f6nekinin eklenmesini ister misiniz? prefix?",titlefield:"Ba\u015fl\u0131k",target:"Hedef",url:"Ba\u011flant\u0131 URL\'si",title:"Ba\u011flant\u0131 ekle/d\u00fczenle",link_list:"Ba\u011flant\u0131 listesi",rtl:"Soldan sa\u011fa",ltr:"Sa\u011fdan sola",accesskey:"Eri\u015fim tu\u015fu",tabindex:"Sekme indeksi",rev:"Sayfadan hedefe ili\u015fki",rel:"Hedeften sayfaya ili\u015fki",mime:"Hedef MIME tipi",encoding:"Hedef karakter kodlama",langcode:"Dil kodu",target_langcode:"Hedef dil"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/tt_dlg.js b/js/tiny_mce/plugins/advlink/langs/tt_dlg.js new file mode 100755 index 000000000..1f89be18a --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.advlink_dlg',{target_name:"\u76ee\u6a19\u540d\u7a31",classes:"\u6a23\u5f0f\u985e",style:"\u6a23\u5f0f",id:"Id",popup_position:"\u5ea7\u6a19 (X/Y)",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",popup_size:"\u5927\u5c0f",popup_dependent:"\u5f9e\u5c6c\u65bc ( \u50c5 Mozilla/Firefox \u6709\u6548 )",popup_resizable:"\u53ef\u8abf\u6574\u7a97\u53e3\u5927\u5c0f",popup_location:"\u986f\u793a\u4f4d\u5740\u6b04",popup_menubar:"\u986f\u793a\u529f\u80fd\u8868\u5217",popup_toolbar:"\u986f\u793a\u5de5\u5177\u5217",popup_statusbar:"\u986f\u793a\u72c0\u614b\u5217",popup_scrollbars:"\u986f\u793a\u6372\u8ef8",popup_return:"\u63d2\u5165 \'return false\'",popup_name:"\u7a97\u53e3\u540d\u7a31",popup_url:"\u5f48\u51fa\u7a97\u53e3\u4f4d\u5740",popup:"Javascript \u5feb\u986f\u7a97\u53e3",target_blank:"\u5728\u65b0\u7a97\u53e3\u6253\u958b",target_top:"\u5728\u9802\u5c64\u7a97\u53e3\u6253\u958b",target_parent:"\u5728\u7236\u7a97\u53e3\u6253\u958b",target_same:"\u5728\u7576\u524d\u7a97\u53e3\u6253\u958b",anchor_names:"\u9328\u9ede",popup_opts:"\u9078\u9805",advanced_props:"\u9032\u968e\u5c6c\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5feb\u986f\u8996\u7a97\u5c6c\u6027",general_props:"\u57fa\u672c\u5c6c\u6027",advanced_tab:"\u9032\u968e",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5feb\u986f\u7a97\u53e3",general_tab:"\u57fa\u672c",list:"\u9023\u7d50\u6e05\u55ae",is_external:"\u60a8\u8f38\u5165\u7684\u7db2\u5740\u61c9\u8a72\u662f\u4e00\u500b\u5916\u90e8\u9023\u7d50\uff0c\u662f\u5426\u9700\u8981\u5728\u7db2\u5740\u524d\u52a0\u4e0a http:// ?",is_email:"\u60a8\u8f38\u5165\u7684\u61c9\u8a72\u662f\u4e00\u500b\u96fb\u5b50\u90f5\u4ef6\u5730\u5740\uff0c\u662f\u5426\u9700\u8981\u5728\u7db2\u5740\u524d\u52a0\u4e0a mailto: ? ",titlefield:"\u641c\u5c0b",target:"\u76ee\u6a19",url:"\u9023\u7d50\u5730\u5740",title:"\u63d2\u5165/\u7de8\u8f2f \u9023\u7d50",link_list:"\u9023\u7d50\u6e05\u55ae",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u9375",tabindex:"Tab\u7d22\u5f15",rev:"rev",rel:"rel",mime:"\u76ee\u6a19 MIME \u985e\u578b",encoding:"\u76ee\u7684\u8a9e\u8a00\u7de8\u78bc",langcode:"\u8a9e\u8a00\u7de8\u78bc",target_langcode:"\u76ee\u7684\u8a9e\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/tw_dlg.js b/js/tiny_mce/plugins/advlink/langs/tw_dlg.js new file mode 100755 index 000000000..9334653cc --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.advlink_dlg',{target_name:"\u76ee\u6a19\u540d\u7a31",classes:"\u985e\u5225",style:"\u6a23\u5f0f",id:"ID",popup_position:"\u4f4d\u7f6e(X/Y)",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",popup_size:"\u5927\u5c0f",popup_dependent:"\u700f\u89bd\u5668\u9650\u5236(\u50c5\u652f\u63f4 Mozilla/Firefox)",popup_resizable:"\u5f48\u7a97\u53ef\u8abf\u6574\u5927\u5c0f",popup_location:"\u986f\u793a\u5730\u5740\u6b04",popup_menubar:"\u986f\u793a\u529f\u80fd\u9078\u55ae\u5217",popup_toolbar:"\u986f\u793a\u5de5\u5177\u5217",popup_statusbar:"\u986f\u793a\u72c0\u614b\u5217",popup_scrollbars:"\u986f\u793a\u6efe\u52d5\u689d",popup_return:"\u63d2\u5165 \"return false\"",popup_name:"\u8996\u7a97\u540d\u7a31",popup_url:"\u5f48\u51fa\u8996\u7a97URL",popup:"JavaScript \u5f48\u51fa\u8996\u7a97",target_blank:"\u5728\u65b0\u8996\u7a97\u6253\u958b\u8d85\u9023\u7d50",target_top:"\u5728\u9802\u90e8\u8996\u7a97\u6253\u958b\u8d85\u9023\u7d50",target_parent:"\u5728\u7236\u8996\u7a97\u6253\u958b\u8d85\u9023\u7d50",target_same:"\u5728\u76ee\u524d\u8996\u7a97\u6253\u958b\u8d85\u9023\u7d50",anchor_names:"\u66f8\u7c64",popup_opts:"\u9078\u9805",advanced_props:"\u9ad8\u7d1a\u5c6c\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5f48\u51fa\u8996\u7a97\u5c6c\u6027",general_props:"\u4e00\u822c\u5c6c\u6027",advanced_tab:"\u9ad8\u7d1a\u5c6c\u6027",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5f48\u51fa\u8996\u7a97",general_tab:"\u4e00\u822c",list:"\u8d85\u9023\u7d50\u6e05\u55ae",is_external:"\u60a8\u8f38\u5165\u7684 URL \u4f3c\u4e4e\u70ba\u5916\u90e8\u8d85\u9023\u7d50\uff0c\u662f\u5426\u8981\u52a0\u4e0a \"http://\" \uff1f",is_email:"\u60a8\u8f38\u5165\u7684\u4f3c\u4e4e\u662f\u96fb\u5b50\u90f5\u4ef6\u5730\u5740,\u662f\u5426\u9700\u8981\u52a0 mailto:\uff1f",titlefield:"\u6a19\u984c",target:"\u76ee\u6a19",url:"\u8d85\u9023\u7d50URL",title:"\u63d2\u5165/\u7de8\u8f2f\u8d85\u9023\u7d50",link_list:"\u8d85\u9023\u7d50\u6e05\u55ae",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u9375",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6a19\u5230\u7db2\u9801\u7684\u95dc\u4fc2",rel:"\u7db2\u9801\u5230\u76ee\u6a19\u7684\u95dc\u4fc2",mime:"\u76ee\u6a19MIME\u985e\u578b",encoding:"\u76ee\u6a19\u8a9e\u8a00\u7de8\u78bc",langcode:"\u8a9e\u8a00\u7de8\u78bc",target_langcode:"\u76ee\u6a19\u8a9e\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/uk_dlg.js b/js/tiny_mce/plugins/advlink/langs/uk_dlg.js new file mode 100755 index 000000000..6a00141ea --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.advlink_dlg',{target_name:"\u041d\u0430\u0437\u0432\u0430 \u0446\u0456\u043b\u0456",classes:"\u041a\u043b\u0430\u0441\u0438",style:"\u0421\u0442\u0438\u043b\u044c",id:"\u0406\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440",popup_position:"\u041f\u043e\u0437\u0438\u0446\u0456\u044f (X/Y)",langdir:"\u041d\u0430\u043f\u0440\u044f\u043c \u043c\u043e\u0432\u0438",popup_size:"\u0420\u043e\u0437\u043c\u0456\u0440",popup_dependent:"\u0417\u0430\u043b\u0435\u0436\u043d\u0438\u0439 (\u043b\u0438\u0448\u0435 \u0434\u043b\u044f Mozilla/Firefox)",popup_resizable:"\u0414\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u0438 \u0437\u043c\u0456\u043d\u044e\u0432\u0430\u0442\u0438 \u0440\u043e\u0437\u043c\u0456\u0440",popup_location:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043d\u0435\u043b\u044c location",popup_menubar:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043c\u0435\u043d\u044e",popup_toolbar:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043d\u0435\u043b\u0456 \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0456\u0432",popup_statusbar:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u0442\u0430\u0442\u0443\u0441",popup_scrollbars:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u043a\u0440\u043e\u043b\u0435\u0440\u0438",popup_return:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \'return false\'",popup_name:"\u041d\u0430\u0437\u0432\u0430 \u0432\u0456\u043a\u043d\u0430",popup_url:"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u0432\u0438\u0440\u0438\u043d\u0430\u044e\u0447\u0435 \u0432\u0456\u043a\u043d\u043e",popup:"\u0412\u0438\u0440\u0438\u043d\u0430\u044e\u0447\u0435 \u0432\u0456\u043a\u043d\u043e Javascript",target_blank:"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0438 \u0432 \u043d\u043e\u0432\u043e\u043c\u0443 \u0432\u0456\u043a\u043d\u0456",target_top:"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0438 \u0443 \u0432\u0435\u0440\u0445\u043d\u044c\u043e\u043c\u0443 \u0444\u0440\u0435\u0439\u043c\u0456 (\u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438 \u0432\u0441\u0456 \u0444\u0440\u0435\u0439\u043c\u0438)",target_parent:"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0438 \u0432 \u0431\u0430\u0442\u044c\u043a\u0456\u0432\u0441\u044c\u043a\u043e\u043c\u0443 \u0432\u0456\u043a\u043d\u0456 / \u0444\u0440\u0435\u0439\u043c\u0456",target_same:"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0438 \u0432 \u0446\u044c\u043e\u043c\u0443 \u0436 \u0432\u0456\u043a\u043d\u0456 / \u0444\u0440\u0435\u0439\u043c\u0456",anchor_names:"\u042f\u043a\u043e\u0440\u0456",popup_opts:"\u0412\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",advanced_props:"\u0420\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u0456 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",event_props:"\u041f\u043e\u0434\u0456\u0457",popup_props:"\u0412\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u0432\u0438\u0440\u0438\u043d\u0430\u044e\u0447\u043e\u0433\u043e \u0432\u0456\u043a\u043d\u0430",general_props:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0456 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",advanced_tab:"\u0414\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e",events_tab:"\u041f\u043e\u0434\u0456\u0457",popup_tab:"\u0412\u0438\u0440\u0438\u043d\u0430\u044e\u0447\u0435 \u0432\u0456\u043a\u043d\u043e",general_tab:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435",list:"\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c",is_external:"\u0412\u0432\u0435\u0434\u0435\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0441\u0445\u043e\u0436\u0435 \u043d\u0430 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0454 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f, \u0432\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0434\u043e\u0434\u0430\u0442\u0438 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u0438\u0439 \u043f\u0440\u0435\u0444\u0456\u043a\u0441 http://?",is_email:"\u0412\u0432\u0435\u0434\u0435\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0441\u0445\u043e\u0436\u0435 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0443 \u0435\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0457 \u043f\u043e\u0448\u0442\u0438, \u0432\u0438 \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u0434\u043e\u0434\u0430\u0442\u0438 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u0438\u0439 \u043f\u0440\u0435\u0444\u0456\u043a\u0441 mailto:?",titlefield:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",target:"\u0412\u0456\u0434\u043a\u0440\u0438\u0442\u0438 \u0432...",url:"\u0410\u0434\u0440\u0435\u0441\u0430",title:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438/\u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f",link_list:"\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043b\u0456\u0432\u043e\u0440\u0443\u0447",ltr:"\u0417\u043b\u0456\u0432\u0430 \u043f\u0440\u0430\u0432\u043e\u0440\u0443\u0447",accesskey:"\u041a\u043b\u0430\u0432\u0456\u0448\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0443",tabindex:"\u0422\u0430\u0431\u0456\u043d\u0434\u0435\u043a\u0441",rev:"\u0417\u0432\'\u044f\u0437\u043e\u043a \u043c\u0456\u0436 \u0446\u0456\u043b\u043b\u044e \u0442\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u043e\u044e",rel:"\u0417\u0432\'\u044f\u0437\u043e\u043a \u043c\u0456\u0436 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u043e\u044e \u0442\u0430 \u0446\u0456\u043b\u043b\u044e",mime:"MIME \u0442\u0438\u043f \u0446\u0456\u043b\u0456",encoding:"\u041a\u043e\u0434\u0443\u0432\u0430\u043d\u043d\u044f \u0446\u0456\u043b\u0456",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u0438",target_langcode:"\u041c\u043e\u0432\u0430 \u0446\u0456\u043b\u0456"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/ur_dlg.js b/js/tiny_mce/plugins/advlink/langs/ur_dlg.js new file mode 100755 index 000000000..2c6ded889 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.advlink_dlg',{target_name:"Target name",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Language direction",popup_size:"Size",popup_dependent:"Dependent (Mozilla/Firefox only)",popup_resizable:"Make window resizable",popup_location:"Show location bar",popup_menubar:"Show menu bar",popup_toolbar:"Show toolbars",popup_statusbar:"Show status bar",popup_scrollbars:"Show scrollbars",popup_return:"Insert \'return false\'",popup_name:"Window name",popup_url:"Popup URL",popup:"Javascript popup",target_blank:"Open in new window",target_top:"Open in top frame (replaces all frames)",target_parent:"Open in parent window / frame",target_same:"Open in this window / frame",anchor_names:"Anchors",popup_opts:"Options",advanced_props:"Advanced properties",event_props:"Events",popup_props:"Popup properties",general_props:"General properties",advanced_tab:"Advanced",events_tab:"Events",popup_tab:"Popup",general_tab:"General",list:"Link list",is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/edit link",link_list:"Link list",rtl:"Right to left",ltr:"Left to right",accesskey:"Accesskey",tabindex:"Tabindex",rev:"Relationship target to page",rel:"Relationship page to target",mime:"Target MIME type",encoding:"Target character encoding",langcode:"Language code",target_langcode:"Target language"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/vi_dlg.js b/js/tiny_mce/plugins/advlink/langs/vi_dlg.js new file mode 100755 index 000000000..9d72fbb27 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.advlink_dlg',{target_name:"T\u00ean \u0111\u00edch",classes:"L\u1edbp",style:"Ki\u1ec3u d\u00e1ng",id:"Id",popup_position:"V\u1ecb tr\u00ed (X/Y)",langdir:"H\u01b0\u1edbng ng\u00f4n ng\u1eef",popup_size:"K\u00edch th\u01b0\u1edbc",popup_dependent:"Ph\u1ee5 thu\u1ed9c (ch\u1ec9 Mozilla/Firefox)",popup_resizable:"L\u00e0m cho c\u1eeda s\u1ed5 c\u00f3 th\u1ec3 thay \u0111\u1ed5i k\u00edch c\u1ee1",popup_location:"Hi\u1ec7n th\u1ecb thanh v\u1ecb tr\u00ed",popup_menubar:"Hi\u1ec3n th\u1ecb thanh th\u1ef1c \u0111\u01a1n",popup_toolbar:"Hi\u1ec7n th\u1ecb thanh c\u00f4ng c\u1ee5",popup_statusbar:"Hi\u1ec7n th\u1ecb thanh tr\u1ea1ng th\u00e1i",popup_scrollbars:"Hi\u1ec3n th\u1ecb thanh cu\u1ed9n",popup_return:"Ch\u00e8n \'return false\'",popup_name:"T\u00ean c\u1eeda s\u1ed5",popup_url:"URL b\u1eadt l\u00ean",popup:"Javascript b\u1eadt l\u00ean",target_blank:"M\u1edf trong c\u1eeda s\u1ed5 m\u1edbi",target_top:"M\u1edf trong khung tr\u00ean c\u00f9ng (thay th\u1ebf t\u1ea5t c\u00e1c khung)",target_parent:"M\u1edf trong c\u1eeda s\u1ed5/khung cha",target_same:"M\u1edf trong c\u1eeda s\u1ed5/khung n\u00e0y",anchor_names:"M\u1ecf neo",popup_opts:"T\u00f9y ch\u1ecdn",advanced_props:"Thu\u1ed9c t\u00ednh n\u00e2ng cao",event_props:"S\u1ef1 ki\u1ec7n",popup_props:"Thu\u1ed9c t\u00ednh b\u1eadt l\u00ean",general_props:"Thu\u1ed9c t\u00ednh chung",advanced_tab:"N\u00e2ng cao",events_tab:"S\u1ef1 ki\u1ec7n",popup_tab:"B\u1eadt l\u00ean",general_tab:"Chung",list:"Danh s\u00e1ch li\u00ean k\u1ebft",is_external:"URL b\u1ea1n \u0111\u00e3 nh\u1eadp c\u00f3 v\u1ebb l\u00e0 m\u1ed9t li\u00ean k\u1ebft ngo\u00e0i, b\u1ea1n c\u00f3 mu\u1ed1n th\u00eam ti\u1ec1n t\u1ed1 http://?",is_email:"URL b\u1ea1n \u0111\u00e3 nh\u1eadp c\u00f3 v\u1ebb l\u00e0 m\u1ed9t \u0111\u1ecba ch\u1ec9 \u0111i\u1ec7n th\u01b0, B\u1ea1n c\u00f3 mu\u1ed1n th\u00eam ti\u1ec1n t\u1ed1 mailto?",titlefield:"Ti\u00eau \u0111\u1ec1",target:"\u0110\u00edch",url:"URL Li\u00ean k\u1ebft",title:"Th\u00eam/S\u1eeda Li\u00ean k\u1ebft",link_list:"Danh s\u00e1ch li\u00ean k\u1ebft",rtl:"Ph\u1ea3i qua tr\u00e1i",ltr:"Tr\u00e1i qua ph\u1ea3i",accesskey:"Ph\u00edm truy c\u1eadp",tabindex:"Ch\u1ec9 m\u1ee5c th\u1ebb",rev:"\u0110\u00edch li\u00ean quan t\u1edbi trang",rel:"Trang li\u00ean quan t\u1edbi \u0111\u00edch",mime:"Ki\u1ec3u MIME \u0111\u00edch",encoding:"M\u00e3 h\u00f3a k\u00fd t\u1ef1 \u0111\u00edch",langcode:"M\u00e3 ng\u00f4n ng\u1eef",target_langcode:"Ng\u00f4n ng\u1eef \u0111\u00edch"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/advlink/langs/zh-cn_dlg.js new file mode 100755 index 000000000..1fdcbbefc --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.advlink_dlg',{"target_name":"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",id:"ID","popup_position":"\u4f4d\u7f6e(X/Y)",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411","popup_size":"\u5927\u5c0f","popup_dependent":"\u9650\u5236(\u4ec5\u652f\u6301Mozilla/Firefox)","popup_resizable":"\u7a97\u53e3\u53ef\u8c03\u6574\u5927\u5c0f","popup_location":"\u663e\u793a\u5730\u5740\u680f","popup_menubar":"\u663e\u793a\u83dc\u5355\u680f","popup_toolbar":"\u663e\u793a\u5de5\u5177\u680f","popup_statusbar":"\u663e\u793a\u72b6\u6001\u680f","popup_scrollbars":"\u663e\u793a\u6eda\u52a8\u6761","popup_return":"\u63d2\u5165\'return false\'","popup_name":"\u7a97\u53e3\u540d\u79f0","popup_url":"\u5f39\u51faURL",popup:"Javascript\u5f39\u7a97","target_blank":"\u5728\u65b0\u7a97\u53e3\u6253\u5f00","target_top":"\u5728\u9876\u90e8\u6846\u67b6\u6253\u5f00\uff08\u91cd\u7f6e\u6240\u6709\u6846\u67b6\uff09","target_parent":"\u5728\u7236\u7a97\u53e3/\u6846\u67b6\u6253\u5f00","target_same":"\u5728\u5f53\u524d\u7a97\u53e3/\u6846\u67b6\u6253\u5f00","anchor_names":"\u951a","popup_opts":"\u9009\u9879","advanced_props":"\u9ad8\u7ea7\u5c5e\u6027","event_props":"\u4e8b\u4ef6","popup_props":"\u5f39\u51fa\u5c5e\u6027","general_props":"\u666e\u901a\u5c5e\u6027","advanced_tab":"\u9ad8\u7ea7","events_tab":"\u4e8b\u4ef6","popup_tab":"\u5f39\u51fa","general_tab":"\u666e\u901a",list:"\u94fe\u63a5\u5217\u8868","is_external":"\u60a8\u8f93\u5165\u7684URL\u662f\u4e00\u4e2a\u5916\u90e8\u94fe\u63a5\uff0c\u662f\u5426\u8981\u52a0\u4e0a\"http://\"\u524d\u7f00\uff1f","is_email":"\u60a8\u8f93\u5165URL\u662f\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u662f\u5426\u9700\u8981\u52a0\"mailto:\"\u524d\u7f00\uff1f",titlefield:"\u6807\u9898",target:"\u6253\u5f00\u65b9\u5f0f",url:"\u8d85\u94fe\u63a5URL",title:"\u63d2\u5165/\u7f16\u8f91 \u8d85\u94fe\u63a5","link_list":"\u94fe\u63a5\u5217\u8868",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",accesskey:"\u5feb\u6377\u952e",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6807\u5230\u7f51\u9875\u7684\u5173\u7cfb",rel:"\u7f51\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u76ee\u6807\u8bed\u8a00\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801","target_langcode":"\u76ee\u6807\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/zh_dlg.js b/js/tiny_mce/plugins/advlink/langs/zh_dlg.js new file mode 100755 index 000000000..6f9be24b7 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.advlink_dlg',{target_name:"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u522b",style:"\u6837\u5f0f",id:"ID",popup_position:"\u4f4d\u7f6e(X/Y)",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",popup_size:"\u5927\u5c0f",popup_dependent:"\u6d4f\u89c8\u5668\u9650\u5236(\u4ec5\u652f\u63f4 Mozilla/Firefox)",popup_resizable:"\u5f39\u7a97\u53ef\u8c03\u6574\u5927\u5c0f",popup_location:"\u663e\u793a\u5730\u5740\u680f",popup_menubar:"\u663e\u793a\u83dc\u5355\u5217",popup_toolbar:"\u663e\u793a\u5de5\u5177\u5217",popup_statusbar:"\u663e\u793a\u72b6\u6001\u5217",popup_scrollbars:"\u663e\u793a\u6eda\u52a8\u6761",popup_return:"\u63d2\u5165 \"return false\"",popup_name:"\u89c6\u7a97\u540d\u79f0",popup_url:"\u5f39\u51fa\u89c6\u7a97URL",popup:"JavaScript \u5f39\u51fa\u89c6\u7a97",target_blank:"\u5728\u65b0\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_top:"\u5728\u9876\u90e8\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_parent:"\u5728\u7236\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",target_same:"\u5728\u76ee\u524d\u89c6\u7a97\u6253\u5f00\u8d85\u8fde\u7ed3",anchor_names:"\u4e66\u7b7e",popup_opts:"\u9009\u9879",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5f39\u51fa\u89c6\u7a97\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7\u5c5e\u6027",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5f39\u51fa\u89c6\u7a97",general_tab:"\u4e00\u822c",list:"\u8d85\u8fde\u7ed3\u6e05\u5355",is_external:"\u60a8\u8f93\u5165\u7684 URL \u4f3c\u4e4e\u4e3a\u5916\u90e8\u8d85\u8fde\u7ed3\uff0c\u662f\u5426\u8981\u52a0\u4e0a \"http://\" \uff1f",is_email:"\u60a8\u8f93\u5165\u7684\u4f3c\u4e4e\u662f\u7535\u5b50\u90ae\u4ef6\u5730\u5740,\u662f\u5426\u9700\u8981\u52a0 mailto:\uff1f",titlefield:"\u6807\u9898",target:"\u76ee\u6807",url:"\u8d85\u8fde\u7ed3URL",title:"\u63d2\u5165/\u7f16\u8f91\u8d85\u8fde\u7ed3",link_list:"\u8d85\u8fde\u7ed3\u6e05\u5355",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u952e",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6807\u5230\u7f51\u9875\u7684\u5173\u7cfb",rel:"\u7f51\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u76ee\u6807\u8bed\u8a00\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801",target_langcode:"\u76ee\u6807\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/langs/zu_dlg.js b/js/tiny_mce/plugins/advlink/langs/zu_dlg.js new file mode 100755 index 000000000..0587a3918 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.advlink_dlg',{target_name:"\u76ee\u6807\u540d\u79f0",classes:"\u7c7b\u578b",style:"\u6837\u5f0f",id:"Id",popup_position:"\u5ea7\u6807(X/Y)",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",popup_size:"\u5c3a\u5bf8",popup_dependent:"\u4ece\u5c5e(\u53ea\u6709Mozilla/Firefox\u6709\u6548)",popup_resizable:"\u53ef\u8c03\u6574\u89c6\u7a97\u5c3a\u5bf8",popup_location:"\u663e\u793a\u7f51\u5740\u5217",popup_menubar:"\u663e\u793a\u529f\u80fd\u8868",popup_toolbar:"\u663e\u793a\u5de5\u5177\u5217",popup_statusbar:"\u663e\u793a\u72b6\u6001\u680f",popup_scrollbars:"\u663e\u793a\u8fb9\u6761",popup_return:"\u63d2\u5165\'return false\'",popup_name:"\u7a97\u53e3\u540d\u79f0",popup_url:"\u5feb\u663e\u89c6\u7a97\u7f51\u5740",popup:"Javascript\u5feb\u663e\u89c6\u7a97",target_blank:"\u6253\u5f00\u5728\u65b0\u89c6\u7a97",target_top:"\u6253\u5f00\u5728\u6700\u4e0a\u5c42\u7684\u6846\u67b6(\u66ff\u6362\u6240\u6709\u6846\u67b6)",target_parent:"\u6253\u5f00\u5728\u7236\u89c6\u7a97/\u6846\u67b6",target_same:"\u6253\u5f00\u5728\u65b0\u89c6\u7a97/\u6846\u67b6",anchor_names:"\u951a\u70b9",popup_opts:"\u9009\u9879",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",event_props:"\u4e8b\u4ef6",popup_props:"\u5feb\u663e\u89c6\u7a97\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",events_tab:"\u4e8b\u4ef6",popup_tab:"\u5feb\u663e\u89c6\u7a97",general_tab:"\u4e00\u822c",list:"\u8fde\u7ed3\u6e05\u5355",is_external:"\u60a8\u8f93\u5165\u7684\u7f51\u5740\u5e94\u8be5\u662f\u4e00\u4e2a\u5916\u90e8\u8fde\u7ed3\uff0c\u662f\u5426\u9700\u8981\u5728\u7f51\u5740\u524d\u65b9\u52a0\u5165http://\uff1f",is_email:"\u60a8\u8f93\u5165\u7684\u7f51\u5740\u5e94\u8be5\u662f\u4e00\u4e2a\u7535\u5b50\u90ae\u5bc4\u5730\u5740\uff0c\u662f\u5426\u9700\u8981\u5728\u90ae\u5740\u524d\u65b9\u52a0\u5165mailto:\uff1f",titlefield:"\u67e5\u627e",target:"\u76ee\u6807",url:"\u8fde\u7ed3\u4f4d\u5740",title:"\u63d2\u5165/\u7f16\u8f91\u8fde\u7ed3",link_list:"\u8fde\u7ed3\u6e05\u5355",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",accesskey:"\u5feb\u901f\u952e",tabindex:"Tab\u7d22\u5f15",rev:"\u76ee\u6807\u5230\u9875\u7684\u5173\u7cfb",rel:"\u9875\u5230\u76ee\u6807\u7684\u5173\u7cfb",mime:"\u76ee\u6807MIME\u7c7b\u578b",encoding:"\u7f16\u7801",langcode:"\u8bed\u8a00\u7f16\u7801",target_langcode:"\u76ee\u7684\u8bed\u8a00"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/advlink/link.htm b/js/tiny_mce/plugins/advlink/link.htm new file mode 100644 index 000000000..6c2d9a5d0 --- /dev/null +++ b/js/tiny_mce/plugins/advlink/link.htm @@ -0,0 +1,338 @@ + + + + {#advlink_dlg.title} + + + + + + + + + +
        + + + + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/contextmenu/editor_plugin.js b/js/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100644 index 000000000..ca7468a6c --- /dev/null +++ b/js/tiny_mce/plugins/contextmenu/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,i,f,d;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if(k.ctrlKey&&!d){return}if(i){j.selection.setRng(i)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageX);a.add(j.getDoc(),"click",function(l){g(j,l)});a.cancel(k)});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=null;if(k&&k.button==2){i=j.selection.getRng();return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g)}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 000000000..56c93abeb --- /dev/null +++ b/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,156 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; + + /** + * This plugin a context menu to TinyMCE editor instances. + * + * @class tinymce.plugins.ContextMenu + */ + tinymce.create('tinymce.plugins.ContextMenu', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @method init + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed) { + var t = this, lastRng, showMenu, contextmenuNeverUseNative; + + t.editor = ed; + + contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; + + /** + * This event gets fired when the context menu is shown. + * + * @event onContextMenu + * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. + * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. + */ + t.onContextMenu = new tinymce.util.Dispatcher(this); + + showMenu = ed.onContextMenu.add(function(ed, e) { + if (e.ctrlKey && !contextmenuNeverUseNative) return; + + // Restore the last selection since it was removed + if (lastRng) + ed.selection.setRng(lastRng); + + t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageX); + Event.add(ed.getDoc(), 'click', function(e) { + hide(ed, e); + }); + Event.cancel(e); + }); + + ed.onRemove.add(function() { + if (t._menu) + t._menu.removeAll(); + }); + + function hide(ed, e) { + lastRng = null; + + // Since the contextmenu event moves + // the selection we need to store it away + if (e && e.button == 2) { + lastRng = ed.selection.getRng(); + return; + } + + if (t._menu) { + t._menu.removeAll(); + t._menu.destroy(); + Event.remove(ed.getDoc(), 'click', hide); + } + }; + + ed.onMouseDown.add(hide); + ed.onKeyDown.add(hide); + ed.onKeyDown.add(function(ed, e) { + if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { + Event.cancel(e); + showMenu(ed, e); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @method getInfo + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Contextmenu', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _getMenu : function(ed) { + var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; + + if (m) { + m.removeAll(); + m.destroy(); + } + + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('contextmenu', { + offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), + offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), + constrain : 1, + keyboard_focus: true + }); + + t._menu = m; + + m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); + m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); + m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); + + if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { + m.addSeparator(); + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + } + + m.addSeparator(); + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + + m.addSeparator(); + am = m.addMenu({title : 'contextmenu.align'}); + am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); + am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); + am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); + am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); + + t.onContextMenu.dispatch(t, m, el, col); + + return m; + } + }); + + // Register plugin + tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); +})(); diff --git a/js/tiny_mce/plugins/fullscreen/editor_plugin.js b/js/tiny_mce/plugins/fullscreen/editor_plugin.js new file mode 100644 index 000000000..6eae3ec84 --- /dev/null +++ b/js/tiny_mce/plugins/fullscreen/editor_plugin.js @@ -0,0 +1 @@ +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent({format:"raw"}),{format:"raw"});d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js new file mode 100644 index 000000000..3477c86c9 --- /dev/null +++ b/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js @@ -0,0 +1,159 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.FullScreenPlugin', { + init : function(ed, url) { + var t = this, s = {}, vp, posCss; + + t.editor = ed; + + // Register commands + ed.addCommand('mceFullScreen', function() { + var win, de = DOM.doc.documentElement; + + if (ed.getParam('fullscreen_is_enabled')) { + if (ed.getParam('fullscreen_new_window')) + closeFullscreen(); // Call to close in new window + else { + DOM.win.setTimeout(function() { + tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); + tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); + tinyMCE.remove(ed); + DOM.remove('mce_fullscreen_container'); + de.style.overflow = ed.getParam('fullscreen_html_overflow'); + DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); + DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); + tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings + }, 10); + } + + return; + } + + if (ed.getParam('fullscreen_new_window')) { + win = DOM.win.open(url + "/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) { + // Ignore + } + } else { + tinyMCE.oldSettings = tinyMCE.settings; // Store old settings + s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; + s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); + vp = DOM.getViewPort(); + s.fullscreen_scrollx = vp.x; + s.fullscreen_scrolly = vp.y; + + // Fixes an Opera bug where the scrollbars doesn't reappear + if (tinymce.isOpera && s.fullscreen_overflow == 'visible') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where horizontal scrollbars would appear + if (tinymce.isIE && s.fullscreen_overflow == 'scroll') + s.fullscreen_overflow = 'auto'; + + // Fixes an IE bug where the scrollbars doesn't reappear + if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) + s.fullscreen_html_overflow = 'auto'; + + if (s.fullscreen_overflow == '0px') + s.fullscreen_overflow = ''; + + DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); + de.style.overflow = 'hidden'; //Fix for IE6/7 + vp = DOM.getViewPort(); + DOM.win.scrollTo(0, 0); + + if (tinymce.isIE) + vp.h -= 1; + + // Use fixed position if it exists + if (tinymce.isIE6) + posCss = 'absolute;top:' + vp.y; + else + posCss = 'fixed;top:0'; + + n = DOM.add(DOM.doc.body, 'div', { + id : 'mce_fullscreen_container', + style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); + DOM.add(n, 'div', {id : 'mce_fullscreen'}); + + tinymce.each(ed.settings, function(v, n) { + s[n] = v; + }); + + s.id = 'mce_fullscreen'; + s.width = n.clientWidth; + s.height = n.clientHeight - 15; + s.fullscreen_is_enabled = true; + s.fullscreen_editor_id = ed.id; + s.theme_advanced_resizing = false; + s.save_onsavecallback = function() { + ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'}); + ed.execCommand('mceSave'); + }; + + tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { + s[k] = v; + }); + + if (s.theme_advanced_toolbar_location === 'external') + s.theme_advanced_toolbar_location = 'top'; + + t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); + t.fullscreenEditor.onInit.add(function() { + t.fullscreenEditor.setContent(ed.getContent()); + t.fullscreenEditor.focus(); + }); + + t.fullscreenEditor.render(); + + t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); + t.fullscreenElement.update(); + //document.body.overflow = 'hidden'; + + t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { + var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; + + // Get outer/inner size to get a delta size that can be used to calc the new iframe size + outerSize = fed.dom.getSize(fed.getContainer().firstChild); + innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); + + fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); + }); + } + }); + + // Register buttons + ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); + }); + }, + + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/fullscreen/fullscreen.htm b/js/tiny_mce/plugins/fullscreen/fullscreen.htm new file mode 100644 index 000000000..4c4f27e48 --- /dev/null +++ b/js/tiny_mce/plugins/fullscreen/fullscreen.htm @@ -0,0 +1,109 @@ + + + + + + + + +
        + +
        + + + + + diff --git a/js/tiny_mce/plugins/inlinepopups/editor_plugin.js b/js/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100644 index 000000000..ef648174f --- /dev/null +++ b/js/tiny_mce/plugins/inlinepopups/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
        "));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100644 index 000000000..ac6fb1cb9 --- /dev/null +++ b/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js @@ -0,0 +1,696 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; + + tinymce.create('tinymce.plugins.InlinePopups', { + init : function(ed, url) { + // Replace window manager + ed.onBeforeRenderUI.add(function() { + ed.windowManager = new tinymce.InlineWindowManager(ed); + DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); + }); + }, + + getInfo : function() { + return { + longname : 'InlinePopups', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { + InlineWindowManager : function(ed) { + var t = this; + + t.parent(ed); + t.zIndex = 300000; + t.count = 0; + t.windows = {}; + }, + + open : function(f, p) { + var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; + + f = f || {}; + p = p || {}; + + // Run native windows + if (!f.inline) + return t.parent(f, p); + + parentWindow = t._frontWindow(); + if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { + parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; + } + + // Only store selection if the type is a normal window + if (!f.type) + t.bookmark = ed.selection.getBookmark(1); + + id = DOM.uniqueId(); + vp = DOM.getViewPort(); + f.width = parseInt(f.width || 320); + f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); + f.min_width = parseInt(f.min_width || 150); + f.min_height = parseInt(f.min_height || 100); + f.max_width = parseInt(f.max_width || 2000); + f.max_height = parseInt(f.max_height || 2000); + f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); + f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); + f.movable = f.resizable = true; + p.mce_width = f.width; + p.mce_height = f.height; + p.mce_inline = true; + p.mce_window_id = id; + p.mce_auto_focus = f.auto_focus; + + // Transpose +// po = DOM.getPos(ed.getContainer()); +// f.left -= po.x; +// f.top -= po.y; + + t.features = f; + t.params = p; + t.onOpen.dispatch(t, f, p); + + if (f.type) { + opt += ' mceModal'; + + if (f.type) + opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); + + f.resizable = false; + } + + if (f.statusbar) + opt += ' mceStatusbar'; + + if (f.resizable) + opt += ' mceResizable'; + + if (f.minimizable) + opt += ' mceMinimizable'; + + if (f.maximizable) + opt += ' mceMaximizable'; + + if (f.movable) + opt += ' mceMovable'; + + // Create DOM objects + t._addAll(DOM.doc.body, + ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, + ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, + ['div', {id : id + '_top', 'class' : 'mceTop'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_title'}, f.title || ''] + ], + + ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, + ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], + ['span', {id : id + '_content'}], + ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] + ], + + ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, + ['div', {'class' : 'mceLeft'}], + ['div', {'class' : 'mceCenter'}], + ['div', {'class' : 'mceRight'}], + ['span', {id : id + '_status'}, 'Content'] + ], + + ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], + ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], + ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], + ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] + ] + ] + ); + + DOM.setStyles(id, {top : -10000, left : -10000}); + + // Fix gecko rendering bug, where the editors iframe messed with window contents + if (tinymce.isGecko) + DOM.setStyle(id, 'overflow', 'auto'); + + // Measure borders + if (!f.type) { + dw += DOM.get(id + '_left').clientWidth; + dw += DOM.get(id + '_right').clientWidth; + dh += DOM.get(id + '_top').clientHeight; + dh += DOM.get(id + '_bottom').clientHeight; + } + + // Resize window + DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); + + u = f.url || f.file; + if (u) { + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + } + + if (!f.type) { + DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); + DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); + DOM.setAttrib(id + '_ifr', 'src', u); + } else { + DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); + + if (f.type == 'confirm') + DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); + + DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); + DOM.setHTML(id + '_content', f.content.replace('\n', '
        ')); + + Event.add(id, 'keyup', function(evt) { + var VK_ESCAPE = 27; + if (evt.keyCode === VK_ESCAPE) { + f.button_func(false); + return Event.cancel(evt); + } + }); + + Event.add(id, 'keydown', function(evt) { + var cancelButton, VK_TAB = 9; + if (evt.keyCode === VK_TAB) { + cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; + if (cancelButton && cancelButton !== evt.target) { + cancelButton.focus(); + } else { + DOM.get(id + '_ok').focus(); + } + return Event.cancel(evt); + } + }); + } + + // Register events + mdf = Event.add(id, 'mousedown', function(e) { + var n = e.target, w, vp; + + w = t.windows[id]; + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + if (n.className == 'mceMax') { + w.oldPos = w.element.getXY(); + w.oldSize = w.element.getSize(); + + vp = DOM.getViewPort(); + + // Reduce viewport size to avoid scrollbars + vp.w -= 2; + vp.h -= 2; + + w.element.moveTo(vp.x, vp.y); + w.element.resizeTo(vp.w, vp.h); + DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); + DOM.addClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMed') { + // Reset to old size + w.element.moveTo(w.oldPos.x, w.oldPos.y); + w.element.resizeTo(w.oldSize.w, w.oldSize.h); + w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); + + DOM.removeClass(id + '_wrapper', 'mceMaximized'); + } else if (n.className == 'mceMove') + return t._startDrag(id, e, n.className); + else if (DOM.hasClass(n, 'mceResize')) + return t._startDrag(id, e, n.className.substring(13)); + } + }); + + clf = Event.add(id, 'click', function(e) { + var n = e.target; + + t.focus(id); + + if (n.nodeName == 'A' || n.nodeName == 'a') { + switch (n.className) { + case 'mceClose': + t.close(null, id); + return Event.cancel(e); + + case 'mceButton mceOk': + case 'mceButton mceCancel': + f.button_func(n.className == 'mceButton mceOk'); + return Event.cancel(e); + } + } + }); + + // Make sure the tab order loops within the dialog. + Event.add([id + '_left', id + '_right'], 'focus', function(evt) { + var iframe = DOM.get(id + '_ifr'); + if (iframe) { + var body = iframe.contentWindow.document.body; + var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); + if (evt.target.id === (id + '_left')) { + focusable[focusable.length - 1].focus(); + } else { + focusable[0].focus(); + } + } else { + DOM.get(id + '_ok').focus(); + } + }); + + // Add window + w = t.windows[id] = { + id : id, + mousedown_func : mdf, + click_func : clf, + element : new Element(id, {blocker : 1, container : ed.getContainer()}), + iframeElement : new Element(id + '_ifr'), + features : f, + deltaWidth : dw, + deltaHeight : dh + }; + + w.iframeElement.on('focus', function() { + t.focus(id); + }); + + // Setup blocker + if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { + DOM.add(DOM.doc.body, 'div', { + id : 'mceModalBlocker', + 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', + style : {zIndex : t.zIndex - 1} + }); + + DOM.show('mceModalBlocker'); // Reduces flicker in IE + DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); + } else + DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); + + if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) + DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); + + DOM.setAttrib(id, 'aria-hidden', 'false'); + t.focus(id); + t._fixIELayout(id, 1); + + // Focus ok button + if (DOM.get(id + '_ok')) + DOM.get(id + '_ok').focus(); + t.count++; + + return w; + }, + + focus : function(id) { + var t = this, w; + + if (w = t.windows[id]) { + w.zIndex = this.zIndex++; + w.element.setStyle('zIndex', w.zIndex); + w.element.update(); + + id = id + '_wrapper'; + DOM.removeClass(t.lastId, 'mceFocus'); + DOM.addClass(id, 'mceFocus'); + t.lastId = id; + + if (w.focussedElement) { + w.focussedElement.focus(); + } else if (DOM.get(id + '_ok')) { + DOM.get(w.id + '_ok').focus(); + } else if (DOM.get(w.id + '_ifr')) { + DOM.get(w.id + '_ifr').focus(); + } + } + }, + + _addAll : function(te, ne) { + var i, n, t = this, dom = tinymce.DOM; + + if (is(ne, 'string')) + te.appendChild(dom.doc.createTextNode(ne)); + else if (ne.length) { + te = te.appendChild(dom.create(ne[0], ne[1])); + + for (i=2; i ix) { + fw = w; + ix = w.zIndex; + } + }); + return fw; + }, + + setTitle : function(w, ti) { + var e; + + w = this._findId(w); + + if (e = DOM.get(w + '_title')) + e.innerHTML = DOM.encode(ti); + }, + + alert : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'alert', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + confirm : function(txt, cb, s) { + var t = this, w; + + w = t.open({ + title : t, + type : 'confirm', + button_func : function(s) { + if (cb) + cb.call(s || t, s); + + t.close(null, w.id); + }, + content : DOM.encode(t.editor.getLang(txt, txt)), + inline : 1, + width : 400, + height : 130 + }); + }, + + // Internal functions + + _findId : function(w) { + var t = this; + + if (typeof(w) == 'string') + return w; + + each(t.windows, function(wo) { + var ifr = DOM.get(wo.id + '_ifr'); + + if (ifr && w == ifr.contentWindow) { + w = wo.id; + return false; + } + }); + + return w; + }, + + _fixIELayout : function(id, s) { + var w, img; + + if (!tinymce.isIE6) + return; + + // Fixes the bug where hover flickers and does odd things in IE6 + each(['n','s','w','e','nw','ne','sw','se'], function(v) { + var e = DOM.get(id + '_resize_' + v); + + DOM.setStyles(e, { + width : s ? e.clientWidth : '', + height : s ? e.clientHeight : '', + cursor : DOM.getStyle(e, 'cursor', 1) + }); + + DOM.setStyle(id + "_bottom", 'bottom', '-1px'); + + e = 0; + }); + + // Fixes graphics glitch + if (w = this.windows[id]) { + // Fixes rendering bug after resize + w.element.hide(); + w.element.show(); + + // Forced a repaint of the window + //DOM.get(id).style.filter = ''; + + // IE has a bug where images used in CSS won't get loaded + // sometimes when the cache in the browser is disabled + // This fix tries to solve it by loading the images using the image object + each(DOM.select('div,a', id), function(e, i) { + if (e.currentStyle.backgroundImage != 'none') { + img = new Image(); + img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); + } + }); + + DOM.get(id).style.filter = ''; + } + } + }); + + // Register plugin + tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); +})(); + diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100644 index 000000000..94abd0876 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100644 index 000000000..e671094cb Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100644 index 000000000..6baf64ad3 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100644 index 000000000..497307a85 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100644 index 000000000..c894b2e83 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100644 index 000000000..c2a2ad454 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100644 index 000000000..43a735f22 Binary files /dev/null and b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif differ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100644 index 000000000..a50d4fc57 --- /dev/null +++ b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -0,0 +1,90 @@ +/* Clearlooks 2 */ + +/* Reset */ +.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} + +/* General */ +.clearlooks2 {position:absolute; direction:ltr} +.clearlooks2 .mceWrapper {position:static} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} + +/* Top */ +.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} +.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} +.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} +.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} +.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} +.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} +.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} +.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} +.clearlooks2 .mceFocus .mceTop span {color:#FFF} + +/* Middle */ +.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} +.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} +.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} +.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} + +/* Bottom */ +.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} +.clearlooks2 .mceBottom {left:0; bottom:0; width:100%} +.clearlooks2 .mceBottom div {top:0} +.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} +.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} +.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .mceBottom span {display:none} +.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} +.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} +.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} +.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} +.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} + +/* Actions */ +.clearlooks2 a {width:29px; height:16px; top:3px;} +.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} +.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} +.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} +.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} +.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} +.clearlooks2 .mceMovable .mceMove {display:block} +.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} +.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} +.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} +.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} +.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} +.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} +.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} + +/* Resize */ +.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} +.clearlooks2 .mceResizable .mceResize {display:block} +.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} +.clearlooks2 .mceMinimizable .mceMin {display:block} +.clearlooks2 .mceMaximizable .mceMax {display:block} +.clearlooks2 .mceMaximized .mceMed {display:block} +.clearlooks2 .mceMaximized .mceMax {display:none} +.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} +.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} +.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} +.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} +.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} +.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} +.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} +.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} + +/* Alert/Confirm */ +.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} +.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} +.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} +.clearlooks2 a:hover {font-weight:bold;} +.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} +.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} +.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} +.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} +.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} +.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} diff --git a/js/tiny_mce/plugins/inlinepopups/template.htm b/js/tiny_mce/plugins/inlinepopups/template.htm new file mode 100644 index 000000000..f9ec64219 --- /dev/null +++ b/js/tiny_mce/plugins/inlinepopups/template.htm @@ -0,0 +1,387 @@ + + + +Template for dialogs + + + + +
        +
        +
        +
        +
        +
        +
        + Blured +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Focused +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Statusbar +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Statusbar, Resizable +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Resizable, Maximizable +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Blurred, Maximizable, Statusbar, Resizable +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Maximized, Maximizable, Minimizable +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Blured +
        + +
        +
        + Content +
        +
        + +
        +
        +
        +
        + Statusbar text. +
        + + + + + + + + + + + + + + +
        +
        + +
        +
        +
        +
        +
        +
        + Alert +
        + +
        +
        + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
        +
        +
        + +
        +
        +
        +
        +
        + + + Ok + +
        +
        + +
        +
        +
        +
        +
        +
        + Confirm +
        + +
        +
        + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
        +
        +
        + +
        +
        +
        +
        +
        + + + Ok + Cancel + +
        +
        +
        + + + diff --git a/js/tiny_mce/plugins/media/css/media.css b/js/tiny_mce/plugins/media/css/media.css new file mode 100644 index 000000000..0c45c7ff6 --- /dev/null +++ b/js/tiny_mce/plugins/media/css/media.css @@ -0,0 +1,17 @@ +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } +.panel_wrapper div.current { height: 420px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } +iframe {border: 1px solid gray} diff --git a/js/tiny_mce/plugins/media/editor_plugin.js b/js/tiny_mce/plugins/media/editor_plugin.js new file mode 100644 index 000000000..66219078c --- /dev/null +++ b/js/tiny_mce/plugins/media/editor_plugin.js @@ -0,0 +1 @@ +(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m0){L+=(L?"&":"")+M+"="+escape(N)}});if(L.length){D.params.flashvars=L}I=o.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(I,function(N,M){D.params[M]=""+N})}}D=g.parse(x.attr("data-mce-json"));p=this.getType(x.attr("class"));z=x.attr("data-mce-style");if(!z){z=x.attr("style");if(z){z=o.dom.serializeStyle(o.dom.parseStyle(z,"img"))}}if(p.name==="Iframe"){v=new b("iframe",1);tinymce.each(d,function(i){var G=x.attr(i);if(i=="class"&&G){G=G.replace(/mceItem.+ ?/g,"")}if(G&&G.length>0){v.attr(i,G)}});for(F in D.params){v.attr(F,D.params[F])}v.attr({style:z,src:D.params.src});x.replace(v);return}if(this.editor.settings.media_use_script){v=new b("script",1).attr("type","text/javascript");w=new b("#text",3);w.value="write"+p.name+"("+g.serialize(tinymce.extend(D.params,{width:x.attr("width"),height:x.attr("height")}))+");";v.append(w);x.replace(v);return}if(p.name==="Video"&&D.video.sources[0]){A=new b("video",1).attr(tinymce.extend({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z},D.video.attrs));if(D.video.attrs){l=D.video.attrs.poster}k=D.video.sources=c(D.video.sources);for(y=0;y 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = JSON.parse(node.attr('data-mce-json')); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style') + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); + }); + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src + }); + + node.replace(replacement); + + return; + } + + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); + + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; + } + + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } + + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } + + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + object.attr(name, data[name]); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); + } + + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); + + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: typeItem.mimes[0] + }); + + for (name in data.params) + embed.attr(name, data.params[name]); + + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); + + object.append(embed); + } + + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (video || object) + node.replace(video || object); + else + node.remove(); + }, + + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; + + // If node isn't in document + if (!node.parent) + return; + + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } + + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' + }); + + // Video element + name = node.name; + if (name === 'video') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', 'video')}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', 'video'); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; + } + + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); + } + + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } + + if (iframe) { + // Get width/height + width = iframe.attr('width'); + height = iframe.attr('height'); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); + }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } + } + + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } + + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); + + if (video) + type = lookup.video.name; + + if (object && !type) + type = (lookup[(object.attr('clsid') || '').toLowerCase()] || lookup[(object.attr('type') || '').toLowerCase()] || {}).name; + + if (embed && !type) + type = (lookup[(embed.attr('type') || '').toLowerCase()] || {}).name; + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || "320", + height : height || "240", + "data-mce-json" : JSON.serialize(data, "'") + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/js/embed.js b/js/tiny_mce/plugins/media/js/embed.js new file mode 100644 index 000000000..f8dc81052 --- /dev/null +++ b/js/tiny_mce/plugins/media/js/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''); + + function get(id) { + return document.getElementById(id); + } + + function getVal(id) { + var elm = get(id); + + if (elm.nodeName == "SELECT") + return elm.options[elm.selectedIndex].value; + + if (elm.type == "checkbox") + return elm.checked; + + return elm.value; + } + + function setVal(id, value) { + if (typeof(value) != 'undefined') { + var elm = get(id); + + if (elm.nodeName == "SELECT") + selectByValue(document.forms[0], id, value); + else if (elm.type == "checkbox") { + if (typeof(value) == 'string') + elm.checked = value.toLowerCase() === 'true' ? true : false; + else + elm.checked = !!value; + } else + elm.value = value; + } + } + + window.Media = { + init : function() { + var html, editor; + + this.editor = editor = tinyMCEPopup.editor; + + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource2','video_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); + + html = this.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; + + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + this.data = tinyMCEPopup.getWindowArg('data'); + this.dataToForm(); + this.preview(); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, data = this.data, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name]); + } else { + delete list[name]; + + value = getVal(formItemName); + if (type == 'video' && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } + + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); + + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); + + setVal('media_type', data.type); + } + + if (data.type == "video") { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src: getVal('src')}; + } + } + + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,preload,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || 320); + setVal('height', data.height || 240); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = this.editor.plugins.media.htmlToData(getVal('source')); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || "320", 10); + this.height = parseInt(getVal('height') || "240", 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || "320", 10); + height = parseInt(getVal('height') || "240", 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, + + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; + } + }; + + tinyMCEPopup.requireLangPack(); + tinyMCEPopup.onInit.add(function() { + Media.init(); + }); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ar_dlg.js b/js/tiny_mce/plugins/media/langs/ar_dlg.js new file mode 100755 index 000000000..7249ba54b --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"\u0639\u0627\u0645",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"\u064a\u0633\u0627\u0631",align_bottom:"\u0627\u0633\u0641\u0644",align_right:"\u064a\u0645\u064a\u0646",align_top:"\u0627\u0644\u0627\u0639\u0644\u0649",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/az_dlg.js b/js/tiny_mce/plugins/media/langs/az_dlg.js new file mode 100755 index 000000000..64e11576a --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.media_dlg',{list:"Siyah\u0131",file:"Fayl/\u00fcnvan",advanced:"\u018flav\u0259l\u0259r",general:"\u00dcmumi",title:"Mediya-obyekti \u0259lav\u0259/redakt\u0259 et",align_top_left:"\u00dcst sol",align_center:"M\u0259tk\u0259z",align_left:"Sol",align_bottom:"Alt",align_right:"Sa\u011f",align_top:"\u00dcst",qt_stream_warn:"Haz\u0131rki ax\u0131lan rtsp m\u0259nb\u0259l\u0259ri QT Src sah\u0259sin\u0259 \u0259lav\u0259 edilm\u0259lidir.\\nSiz h\u0259m\u00e7inin Src sah\u0259sin\u0259 qeyri-ax\u0131lan versiyan\u0131 da \u0259lav\u0259 etm\u0259lisiniz..",qtsrc:"QT Src",progress:"\u0130l\u0259rl\u0259yi\u015f",sound:"S\u0259s",swstretchvalign:"Uzat D-D\u00fczl\u0259ndir",swstretchhalign:"Uzat Y-D\u00fczl\u0259ndir",swstretchstyle:"Uzatma stili",scriptcallbacks:"Skript \u00e7a\u011f\u0131r\u0131mlar\u0131",align_top_right:"\u00dcst sa\u011f",uimode:"UI \u00dcsulu",rate:"Norma",playcount:"Oynatma say\u0131",defaultframe:"Susmaya g\u00f6r\u0259 \u00e7\u0259r\u00e7iv\u0259",currentposition:"Haz\u0131rki m\u00f6vqe",currentmarker:"Haz\u0131rki marker",captioningid:"Ba\u015fl\u0131qland\u0131rma id",baseurl:"Baza URL",balance:"Balans",windowlessvideo:"P\u0259nc\u0259r\u0259siz vide",stretchtofit:"S\u0131\u011facaq q\u0259d\u0259r \u00f6l\u00e7\u00fcl\u0259ndir",mute:"S\u0259ssiz",invokeurls:"\u00c7a\u011f\u0131r\u0131lacaq URL \u00fcnvanlar",fullscreen:"Tam ekran",enabled:"Yan\u0131l\u0131b",autostart:"Avtomatik ba\u015flat",volume:"S\u0259s",target:"H\u0259d\u0259f",qtsrcchokespeed:"Drossel s\u00fcr\u0259ti",href:"Href",endtime:"Bit\u0259c\u0259k zaman",starttime:"Ba\u015flan\u011f\u0131c zaman",enablejavascript:"JavaScript-i yand\u0131r",correction:"D\u0259yi\u015fiklik yoxdur",targetcache:"H\u0259d\u0259f ke\u015f",playeveryframe:"H\u0259r \u00e7\u0259r\u00e7iv\u0259ni oynat",kioskmode:"Kiosk \u00fcsulu",controller:"\u0130dar\u0259\u00e7i",menu:"Menyunu g\u00f6st\u0259r",loop:"\u0130lm\u0259k",play:"Avtomatik oynat",hspace:"\u00dcf\u00fcqi f\u0259za",vspace:"\u015eaquli f\u0259za",class_name:"Sinif",name:"Ad\u0131",id:"\u0130dentifikator",type:"N\u00f6v",size:"\u00d6\u00e7\u00fcl\u0259ri",preview:"\u0130lkin bax\u0131\u015f",constrain_proportions:"Proporsiyalar\u0131 saxla",controls:"Kontroller",numloop:"R\u0259q\u0259mli ilm\u0259l\u0259r",console:"Konsol",cache:"Ke\u015f",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"T\u0259m\u0259l",bgcolor:"Fon",wmode:"WMode",salign:"SAlign",align:"Tarazla\u015fmaq",scale:"Miqyas",quality:"Keyfiyy\u0259t",shuffle:"Qar\u0131\u015fd\u0131r",prefetch:"\u00d6n-g\u0259tirm\u0259",nojava:"Java yox",maintainaspect:"Aspekti qoru",imagestatus:"\u015e\u0259kil statusu",center:"M\u0259rk\u0259z",autogotourl:"Avtomatik gedil\u0259c\u0259k URL",shockwave_options:"Shockwave nizamlamalar\u0131",rmp_options:"Real media player nizamlamalar\u0131",wmp_options:"Windows media player nizamlamalar\u0131",qt_options:"Quicktime nizamlamalar\u0131",flash_options:"Flash nizamlamalar\u0131",hidden:"Gizli",align_bottom_left:"A\u015fa\u011f\u0131 sol",align_bottom_right:"A\u015fa\u011f\u0131 sa\u011f",flv_options:"Fla\u015f video nizamlamalar\u0131",flv_scalemode:"Miqyas \u00fcsulu",flv_buffer:"Bufer",flv_startimage:"Ba\u015flan\u011f\u0131c \u015f\u0259kil",flv_starttime:"Ba\u015flan\u011f\u0131c zaman",flv_defaultvolume:"Susmaya g\u00f6r\u0259 s\u0259s",flv_hiddengui:"Gizli GUI",flv_autostart:"Avtomatik ba\u015flat",flv_loop:"\u0130lm\u0259",flv_showscalemodes:"\u00d6l\u00e7\u0259k rejiml\u0259ri g\u00f6st\u0259r",flv_smoothvideo:"Videonu yum\u015falt",flv_jscallback:"JS \u00c7a\u011f\u0131r\u0131mlar\u0131"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/be_dlg.js b/js/tiny_mce/plugins/media/langs/be_dlg.js new file mode 100755 index 000000000..2f2ed6c7d --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.media_dlg',{list:"\u0421\u043f\u0456\u0441",file:"\u0424\u0430\u0439\u043b/\u0430\u0434\u0440\u0430\u0441",advanced:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f",general:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f",title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044c/\u0440\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044c \u043c\u0435\u0434\u044b\u044f-\u0430\u0431\'\u0435\u043a\u0442",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"\u0410\u0434\u043b\u044e\u0441\u0442\u0440\u0430\u0432\u0430\u0446\u044c \u043c\u0435\u043d\u044e",loop:"\u0417\u0430\u0446\u044b\u043a\u043b\u0456\u0446\u044c",play:"\u041f\u0440\u0430\u0439\u0433\u0440\u0430\u0432\u0430\u0446\u044c \u0430\u045e\u0442\u0430\u043c\u0430\u0442\u044b\u0447\u043d\u0430",hspace:"\u0413\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u0441\u0442\u043e\u0440\u0430",vspace:"\u0412\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u0441\u0442\u043e\u0440\u0430",class_name:"\u041a\u043b\u0430\u0441",name:"\u041d\u0430\u0437\u043e\u045e",id:"\u0406\u0434\u044d\u043d\u0442\u044b\u0444\u0456\u043a\u0430\u0442\u0430\u0440",type:"\u0422\u044b\u043f",size:"\u041f\u0430\u043c\u0435\u0440\u044b",preview:"\u041f\u0430\u043f\u044f\u0440\u044d\u0434\u043d\u0456 \u043f\u0440\u0430\u0433\u043b\u044f\u0434",constrain_proportions:"\u0417\u0430\u0445\u043e\u045e\u0432\u0430\u0446\u044c \u043f\u0440\u0430\u043f\u043e\u0440\u0446\u044b\u0456",controls:"Controls",numloop:"Num loops",console:"Console",cache:"\u041a\u044d\u0448",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"\u0410\u0441\u043d\u043e\u0432\u0430",bgcolor:"\u0424\u043e\u043d",wmode:"WMode",salign:"SAlign",align:"\u0412\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435",scale:"\u041c\u0430\u0448\u0442\u0430\u0431",quality:"\u042f\u043a\u0430\u0441\u0446\u044c",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"\u0421\u043a\u0440\u044b\u0442\u043e\u0435",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/bg_dlg.js b/js/tiny_mce/plugins/media/langs/bg_dlg.js new file mode 100755 index 000000000..ef620292f --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.media_dlg',{list:"\u0421\u043f\u0438\u0441\u044a\u043a",file:"\u0424\u0430\u0439\u043b/URL",advanced:"\u0417\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",general:"\u041e\u0431\u0449\u0438",title:"\u0412\u043c\u044a\u043a\u043d\u0438/\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u0439 \u043c\u0435\u0434\u0438\u0430\u0442\u0430",align_top_left:"\u0413\u043e\u0440\u0435 \u043b\u044f\u0432\u043e",align_center:"\u0426\u0435\u043d\u0442\u044a\u0440",align_left:"\u041b\u044f\u0432\u043e",align_bottom:"\u0414\u043e\u043b\u0443",align_right:"\u0414\u044f\u0441\u043d\u043e",align_top:"\u0413\u043e\u0440\u0435",qt_stream_warn:"\u041f\u043e\u0442\u043e\u0447\u043d\u0438\u0442\u0435 rtsp \u0440\u0435\u0441\u0443\u0440\u0441\u0438 \u0442\u0440\u044f\u0431\u0432\u0430 \u0434\u0430 \u0441\u0435 \u0434\u043e\u0431\u0430\u0432\u044f\u0442 \u0432 QT Src \u043f\u043e\u043b\u0435\u0442\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0437\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438.\\n\u0422\u0440\u044f\u0431\u0432\u0430 \u0441\u044a\u0449\u043e \u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u043d\u0435 \u043f\u043e\u0442\u043e\u0447\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0432 Src \u043f\u043e\u043b\u0435\u0442\u043e..",qtsrc:"QT Src",progress:"\u041f\u0440\u043e\u0433\u0440\u0435\u0441",sound:"\u0417\u0432\u0443\u043a",swstretchvalign:"\u0420\u0430\u0437\u043f\u044a\u0432\u0430\u043d\u0435 V-Align",swstretchhalign:"\u0420\u0430\u0437\u043f\u044a\u0432\u0430\u043d\u0435 H-Align",swstretchstyle:"\u0421\u0442\u0438\u043b \u043d\u0430 \u0440\u0430\u0437\u043f\u044a\u0432\u0430\u043d\u0435",scriptcallbacks:"Script callbacks",align_top_right:"\u0413\u043e\u0440\u0435 \u0434\u044f\u0441\u043d\u043e",uimode:"UI \u0440\u0435\u0436\u0438\u043c",rate:"\u0411\u044a\u0440\u0437\u0438\u043d\u0430",playcount:"\u0411\u0440\u043e\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f",defaultframe:"\u041d\u0430\u0447\u0430\u043b\u0435\u043d \u043a\u0430\u0434\u044a\u0440",currentposition:"\u0422\u0435\u043a\u0443\u0449\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f",currentmarker:"\u0422\u0435\u043a\u0443\u0449 \u043c\u0430\u0440\u043a\u0435\u0440",captioningid:"Captioning id",baseurl:"\u0411\u0430\u0437\u043e\u0432\u043e URL",balance:"\u0411\u0430\u043b\u0430\u043d\u0441",windowlessvideo:"\u0412\u0438\u0434\u0435\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446",stretchtofit:"\u0420\u0430\u0437\u043f\u044a\u043d\u0438",mute:"\u0417\u0430\u0433\u043b\u0443\u0448\u0438",invokeurls:"Invoke URLs",fullscreen:"\u0426\u044f\u043b \u0435\u043a\u0440\u0430\u043d",enabled:"\u0412\u043a\u043b\u044e\u0447\u0435\u043d",autostart:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435",volume:"\u0421\u0438\u043b\u0430 \u043d\u0430 \u0437\u0432\u0443\u043a\u0430",target:"\u0426\u0435\u043b",qtsrcchokespeed:"\u041f\u0440\u0435\u0434\u0435\u043b\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442",href:"Href",endtime:"\u0412\u0440\u0435\u043c\u0435 \u0437\u0430 \u043a\u0440\u0430\u0439",starttime:"\u0412\u0440\u0435\u043c\u0435 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435",enablejavascript:"\u0412\u043a\u043b\u044e\u0447\u0438 JavaScript",correction:"\u0411\u0435\u0437 \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0438",targetcache:"\u0426\u0435\u043b\u0435\u0432\u0438 \u043a\u0435\u0448",playeveryframe:"\u041f\u043e\u043a\u0430\u0437\u0432\u0430\u0439 \u0432\u0441\u0435\u043a\u0438 \u043a\u0430\u0434\u044a\u0440",kioskmode:"Kiosk \u0440\u0435\u0436\u0438\u043c",controller:"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440",menu:"\u041f\u043e\u043a\u0430\u0436\u0438 \u043c\u0435\u043d\u044e",loop:"\u041f\u043e\u0432\u0442\u0430\u0440\u044f\u0439",play:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u0443\u0441\u043a\u0430\u043d\u0435",hspace:"H-Space",vspace:"V-Space",class_name:"\u041a\u043b\u0430\u0441",name:"\u0418\u043c\u0435",id:"Id",type:"\u0422\u0438\u043f",size:"\u0420\u0430\u0437\u043c\u0435\u0440\u0438",preview:"\u041f\u0440\u0435\u0433\u043b\u0435\u0434",constrain_proportions:"\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438\u0442\u0435",controls:"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435",numloop:"\u0411\u0440\u043e\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f",console:"\u041a\u043e\u043d\u0437\u043e\u043b\u0430",cache:"\u041a\u0435\u0448",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"\u041e\u0441\u043d\u043e\u0432\u0430",bgcolor:"\u0424\u043e\u043d",wmode:"WMode",salign:"SAlign",align:"\u041f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435",scale:"\u041f\u0440\u0435\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u0438",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",shuffle:"\u0420\u0430\u0437\u0431\u044a\u0440\u043a\u0430\u0439",prefetch:"\u0421\u0432\u0430\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u043d\u043e",nojava:"\u0411\u0435\u0437 JAVA",maintainaspect:"\u041f\u043e\u0434\u0434\u044a\u0440\u0436\u0430\u0439 \u0441\u044a\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435\u0442\u043e",imagestatus:"\u0421\u0442\u0430\u0442\u0443\u0441 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",center:"\u0426\u0435\u043d\u0442\u044a\u0440",autogotourl:"\u041e\u0442\u0438\u0434\u0438 \u043d\u0430 URL",shockwave_options:"\u041e\u043f\u0446\u0438\u0438 \u0437\u0430 Shockwave",rmp_options:"\u041e\u043f\u0446\u0438\u0438 \u0437\u0430 Real media player",wmp_options:"\u041e\u043f\u0446\u0438\u0438 \u0437\u0430 Windows media player",qt_options:"\u041e\u043f\u0446\u0438\u0438 \u0437\u0430 Quicktime",flash_options:"\u041e\u043f\u0446\u0438\u0438 \u0437\u0430 Flash",hidden:"\u0421\u043a\u0440\u0438\u0442",align_bottom_left:"\u0414\u043e\u043b\u0443 \u043b\u044f\u0432\u043e",align_bottom_right:"\u0414\u043e\u043b\u0443 \u0434\u044f\u0441\u043d\u043e",flv_options:"\u0412\u0438\u0434\u0435\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430 Flash",flv_scalemode:"\u0420\u0435\u0436\u0438\u043c \u043d\u0430 \u043f\u0440\u0435\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u044f\u0432\u0430\u043d\u0435",flv_buffer:"\u0411\u0443\u0444\u0435\u0440",flv_startimage:"\u041d\u0430\u0447\u0430\u043b\u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",flv_starttime:"\u041d\u0430\u0447\u0430\u043b\u043d\u043e \u0432\u0440\u0435\u043c\u0435",flv_defaultvolume:"\u0421\u0438\u043b\u0430 \u043d\u0430 \u0437\u0432\u0443\u043a\u0430 \u043f\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043d\u0435",flv_hiddengui:"\u0421\u043a\u0440\u0438\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435",flv_autostart:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u043d \u0441\u0442\u0430\u0440\u0442",flv_loop:"\u041f\u043e\u0432\u0442\u0430\u0440\u044f\u0439",flv_showscalemodes:"\u041f\u043e\u043a\u0430\u0436\u0438 \u0440\u0435\u0436\u0438\u043c\u0438\u0442\u0435 \u043d\u0430 \u043f\u0440\u0435\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u044f\u0432\u0430\u043d\u0435",flv_smoothvideo:"\u0413\u043b\u0430\u0434\u043a\u043e \u0432\u0438\u0434\u0435\u043e",flv_jscallback:"JS \u043f\u043e\u0434\u0434\u0440\u044a\u0436\u043a\u0430"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/bn_dlg.js b/js/tiny_mce/plugins/media/langs/bn_dlg.js new file mode 100755 index 000000000..9c4bdd847 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.media_dlg',{list:"\u09b2\u09bf\u09b8\u09cd\u099f",file:"\u09ab\u09be\u0987\u09b2/\u0987\u0989 \u0986\u09b0 \u098f\u09b2",advanced:"\u098f\u09a1\u09ad\u09be\u09a8\u09cd\u09b8\u09a1",general:"\u099c\u09c7\u09a8\u09be\u09b0\u09c7\u09b2",title:"\u0987\u09a8\u09b8\u09be\u09b0\u09cd\u099f/ \u098f\u09ae\u09ac\u09c7\u09a1\u09c7\u09a1 \u09ae\u09bf\u09a1\u09bf\u09df\u09be \u098f\u09a1\u09bf\u099f \u0995\u09b0\u09be","align_top_left":"\u0989\u09aa\u09b0\u09c7\u09b0 \u09ac\u09be\u09ae \u0995\u09cb\u09a8\u09c7","align_center":"\u09ae\u09be\u099d\u0996\u09be\u09a8\u09c7","align_left":"\u09ac\u09be\u09ae\u09c7","align_bottom":"\u09a8\u09bf\u099a\u09c7","align_right":"\u09a1\u09be\u09a8\u09c7","align_top":"\u0989\u09aa\u09b0\u09c7","qt_stream_warn":"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks","align_top_right":"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL","shockwave_options":"Shockwave options","rmp_options":"Real media player options","wmp_options":"Windows media player options","qt_options":"Quicktime options","flash_options":"Flash options",hidden:"Hidden","align_bottom_left":"Bottom left","align_bottom_right":"Bottom right","flv_options":"Flash video options","flv_scalemode":"Scale mode","flv_buffer":"Buffer","flv_startimage":"Start image","flv_starttime":"Start time","flv_defaultvolume":"Default volumne","flv_hiddengui":"Hidden GUI","flv_autostart":"Auto start","flv_loop":"Loop","flv_showscalemodes":"Show scale modes","flv_smoothvideo":"Smooth video","flv_jscallback":"JS Callback","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/br_dlg.js b/js/tiny_mce/plugins/media/langs/br_dlg.js new file mode 100755 index 000000000..437a7d770 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.media_dlg',{list:"Lista",file:"Arquivo/URL",advanced:"Avan\u00e7ado",general:"Geral",title:"Inserir/Editar m\u00eddia incorporada",align_top_left:"Topo \u00e0\u00a0 esquerda",align_center:"Centro",align_left:"Esquerda",align_bottom:"Abaixo",align_right:"Direita",align_top:"Topo",qt_stream_warn:"Fluxos de recursos rtsp devem ser acrescentados ao campo QT Src no Modo Avan\u00e7ado.\\NUma vers\u00e3o sem fluxo tamb\u00e9m deve ser acrescentada ao campo Src.",qtsrc:"QT Src",progress:"Progresso",sound:"Som",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"callbacks de script",align_top_right:"Topo \u00e0\u00a0 direita",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Frame padr\u00e3o",currentposition:"Posi\u00e7\u00e3o actual",currentmarker:"Marcador actual",captioningid:"Id de legenda",baseurl:"Base URL",balance:"Stereo",windowlessvideo:"V\u00eddeo sem janela",stretchtofit:"Estender",mute:"Mudo",invokeurls:"Invocar URLs",fullscreen:"Ecr\u00e3 inteiro",enabled:"Activado",autostart:"Execu\u00e7\u00e3o autom\u00e1tica",volume:"Volume",target:"Alvo",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Hora do fim",starttime:"Hora de in\u00edcio",enablejavascript:"Disponibilizar javaScript",correction:"Sem correc\u00e7\u00f5es",targetcache:"Cache alvo",playeveryframe:"Executar todas as frames",kioskmode:"Modo Quiosque",controller:"Controlador",menu:"Mostrar menu",loop:"Repeti\u00e7\u00e3o autom\u00e1tica",play:"Execu\u00e7\u00e3o autom\u00e1tica",hspace:"Espa\u00e7o horizontal",vspace:"Espa\u00e7o vertical",class_name:"Classe",name:"Nome",id:"Id",type:"Tipo",size:"Dimens\u00f5es",preview:"Previs\u00e3o",constrain_proportions:"Manter propor\u00e7\u00f5es",controls:"Controles",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Fundo",wmode:"WMode",salign:"SAlign",align:"Alinhamento",scale:"Escala",quality:"Qualidade",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Centro",autogotourl:"Auto goto URL",shockwave_options:"Op\u00e7\u00f5es Shockwave",rmp_options:"Op\u00e7\u00f5es Real Media Player",wmp_options:"Op\u00e7\u00f5es Windows Media Player",qt_options:"Op\u00e7\u00f5es Quicktime",flash_options:"Op\u00e7\u00f5es Flash",hidden:"Oculto",align_bottom_left:"Abaixo \u00e0\u00a0 esquerda",align_bottom_right:"Abaixo \u00e0\u00a0 direita",flv_options:"Op\u00e7\u00f5es de Flash video",flv_scalemode:"Modo escala",flv_buffer:"Buffer",flv_startimage:"Imagem inicial",flv_starttime:"Hora inicial",flv_defaultvolume:"Volume padr\u00e3o",flv_hiddengui:"GUI oculta",flv_autostart:"Execu\u00e7\u00e3o Autom\u00e1tica",flv_loop:"Loop",flv_showscalemodes:"Mostrar modos escala",flv_smoothvideo:"Smooth video",flv_jscallback:"JS callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/bs_dlg.js b/js/tiny_mce/plugins/media/langs/bs_dlg.js new file mode 100755 index 000000000..36435b4b5 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ca_dlg.js b/js/tiny_mce/plugins/media/langs/ca_dlg.js new file mode 100755 index 000000000..d10ef41d6 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.media_dlg',{list:"Llista",file:"Fitxer/URL",advanced:"Avan\u00e7at",general:"General",title:"Insereix / edita multim\u00e8dia incrustada","align_top_left":"Superior esquerra","align_center":"Centre","align_left":"Esquerra","align_bottom":"Inferior","align_right":"Dreta","align_top":"Superior","qt_stream_warn":"Els recursos rtsp fets flux s\'haurien d\'afegir al camp QT Src sota la pestanya avan\u00e7ada.\\nTamb\u00e9 haur\u00edeu d\'afegir una versi\u00f3 no feta flux al camp Src..",qtsrc:"QT Src",progress:"Progr\u00e9s",sound:"S\u00f2",swstretchvalign:"Alineaci\u00f3 vertical de l\'extensor",swstretchhalign:"Alineaci\u00f3 horitzontal de l\'extensor",swstretchstyle:"Estil de l\'extensor",scriptcallbacks:"Crides de retorn a script","align_top_right":"Superior dreta",uimode:"Mode UI",rate:"Velocitat",playcount:"Compte de reproducci\u00f3",defaultframe:"Marc per defecte",currentposition:"Posici\u00f3 actual",currentmarker:"Retolador actual",captioningid:"Id nominal",baseurl:"URL base",balance:"Equilibri",windowlessvideo:"V\u00eddeo sense finestra",stretchtofit:"Estirar fins a encaixar",mute:"Silenci",invokeurls:"Invoca els URL",fullscreen:"Pantalla completa",enabled:"Habilitat",autostart:"Inici autom\u00e0tic",volume:"Volumen",target:"Dest\u00ed",qtsrcchokespeed:"Velocitat",href:"Href",endtime:"Fi",starttime:"Inici",enablejavascript:"Habilita el javascript",correction:"Sense correcci\u00f3",targetcache:"Target cache",playeveryframe:"Reprodueix cada marc",kioskmode:"Mode quiosc",controller:"Controlador",menu:"Mostra el men\u00fa",loop:"Bucle",play:"Reproducci\u00f3 autom\u00e0tica",hspace:"Espai horitzontal",vspace:"Espai vertical","class_name":"Classe",name:"Nom",id:"Id",type:"Tipus",size:"Dimensions",preview:"Previsualitzaci\u00f3","constrain_proportions":"Mant\u00e9 les proporcions",controls:"Controls",numloop:"Nre. bucles",console:"Consola",cache:"Mem\u00f2ria cau",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Fons",wmode:"Mode W",salign:"Alinea S",align:"Alinea",scale:"Escala",quality:"Qualitat",shuffle:"Shuffle",prefetch:"Prec\u00e0rrega",nojava:"Sense java",maintainaspect:"Mant\u00e9 l\'aspecte",imagestatus:"Estat de la imatge",center:"Alinea al centre",autogotourl:"URL goto autom\u00e0tic","shockwave_options":"Opcions del Shockwave","rmp_options":"Opcions del Real media player","wmp_options":"Opcions del Windows media player","qt_options":"Opcions del Quicktime","flash_options":"Opcions del Flash",hidden:"Ocult","align_bottom_left":"Inferior esquerra","align_bottom_right":"Inferior dreta","flv_options":"Opcions de v\u00eddeo Flash","flv_scalemode":"Mode d\'escalat","flv_buffer":"Mem\u00f2ria interm\u00e8dia","flv_startimage":"Imatge d\'inici","flv_starttime":"Hora d\'inici","flv_defaultvolume":"Volumen per defecte","flv_hiddengui":"GUI ocult","flv_autostart":"Inici autom\u00e0tic","flv_loop":"Bucle","flv_showscalemodes":"Mostra els modes d\'escalat","flv_smoothvideo":"V\u00eddeo suau","flv_jscallback":"Crida de retorn JS","html5_video_options":"Opcions de v\u00eddeo HTML5",altsource1:"Font alternatiu 1",altsource2:"Font alternatiu 2",preload:"Pre-c\u00e0rrega",poster:"Anunci",source:"Font"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ch_dlg.js b/js/tiny_mce/plugins/media/langs/ch_dlg.js new file mode 100755 index 000000000..b5baf9e1b --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.media_dlg',{list:"\u5217\u8868",file:"\u5a92\u4f53URL",advanced:"\u9ad8\u7ea7",general:"\u4e00\u822c",title:"\u63d2\u5165/\u7f16\u8f91\u5a92\u4f53",align_top_left:"\u5de6\u4e0a",align_center:"\u7f6e\u4e2d",align_left:"\u9760\u5de6",align_bottom:"\u9760\u4e0b",align_right:"\u9760\u53f3",align_top:"\u9760\u4e0a",qt_stream_warn:"\u4e32\u6d41\u5a92\u4f53rtsp\u8d44\u6e90\u5e94\u8be5\u52a0\u5230\u300c\u9ad8\u7ea7\u300d\u4e2dQT src. \\n\u540c\u65f6\u589e\u52a0\u975e\u4e32\u6d41\u5a92\u4f53\u8d44\u6e90\u5230src.",qtsrc:"QT Src",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u7f29\u653e\u81f3\u5782\u76f4\u5bf9\u9f50",swstretchhalign:"\u7f29\u653e\u81f3\u6c34\u5e73\u5bf9\u9f50",swstretchstyle:"\u7f29\u653e\u6837\u5f0f",scriptcallbacks:"Script \u553f\u53eb",align_top_right:"\u53f3\u4e0a",uimode:"\u9762\u677f\u6a21\u5f0f",rate:"\u6bd4\u7387",playcount:"\u64ad\u653e\u6b21\u6570",defaultframe:"\u9884\u8bbe\u753b\u9762",currentposition:"\u76ee\u524d\u4f4d\u7f6e",currentmarker:"\u76ee\u524d\u6807\u8bb0",captioningid:"\u5b57\u5e55\u7f16\u53f7",baseurl:"\u57fa\u5e95 URL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u89c6\u7a97\u64ad\u653e",stretchtofit:"\u7f29\u653e\u81f3\u6700\u4f73\u5927\u5c0f",mute:"\u9759\u97f3",invokeurls:"\u5f15\u7528\u7684 URLs",fullscreen:"\u5168\u8424\u5e55",enabled:"\u53ef\u7528",autostart:"\u81ea\u52a8\u64ad\u653e",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"\u963b\u585e\u901f\u5ea6",href:"\u8d85\u8fde\u7ed3",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528 JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u9010\u683c\u64ad\u653e",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u9009\u9879",loop:"\u5faa\u73af",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",class_name:"\u7c7b\u522b",name:"\u540d\u79f0",id:"ID",type:"\u7c7b\u578b",size:"\u5927\u5c0f",preview:"\u9884\u89c8",constrain_proportions:"\u7ea6\u675f\u6bd4\u4f8b",controls:"\u63a7\u5236",numloop:"\u5faa\u73af\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash \u53d8\u91cf",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f\u8272",wmode:"\u89c6\u7a97\u6a21\u5f0f",salign:"SAlign",align:"\u5bf9\u9f50",scale:"\u7f29\u653e",quality:"\u54c1\u8d28",shuffle:"\u968f\u673a",prefetch:"\u9884\u8f7d",nojava:"No Java",maintainaspect:"\u9501\u5b9a\u6bd4\u4f8b",imagestatus:"\u56fe\u7247\u72b6\u6001",center:"\u7f6e\u4e2d",autogotourl:"\u81ea\u52a8\u8f6c\u81f3 URL",shockwave_options:"Shockwave \u9009\u9879",rmp_options:"Real Media Player \u9009\u9879",wmp_options:"Windows Media Player \u9009\u9879",qt_options:"Quick Time \u9009\u9879",flash_options:"Flash \u9009\u9879",hidden:"\u9690\u85cf",align_bottom_left:"\u5de6\u4e0b",align_bottom_right:"\u53f3\u4e0b",flv_options:"Flash\u5f71\u7247\u9009\u9879",flv_scalemode:"\u7f29\u653e\u6a21\u5f0f",flv_buffer:"\u7f13\u51b2\u533a",flv_startimage:"\u5f00\u59cb\u753b\u9762",flv_starttime:"\u5f00\u59cb\u65f6\u95f4",flv_defaultvolume:"\u9884\u8bbe\u97f3\u91cf",flv_hiddengui:"\u9690\u85cf GUI",flv_autostart:"\u81ea\u52a8\u64ad\u653e",flv_loop:"\u5faa\u73af",flv_showscalemodes:"\u663e\u793a\u7f29\u653e\u6a21\u5f0f",flv_smoothvideo:"\u5e73\u6ed1\u64ad\u653e",flv_jscallback:"Script \u553f\u53eb"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/cn_dlg.js b/js/tiny_mce/plugins/media/langs/cn_dlg.js new file mode 100755 index 000000000..4432e2e5a --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6\u4f4d\u7f6e/URL",advanced:"\u9ad8\u7ea7",general:"\u5e38\u89c4",title:"\u63d2\u5165/\u7f16\u8f91\u5d4c\u5165\u5f0f\u5a92\u4f53","align_top_left":"\u5de6\u4e0a","align_center":"\u5c45\u4e2d","align_left":"\u5c45\u5de6","align_bottom":"\u5c45\u4e0b","align_right":"\u5c45\u53f3","align_top":"\u5c45\u4e0a","qt_stream_warn":"\u6d41\u5a92\u4f53\u7684RTSP\u8d44\u6e90\u5e94\u6dfb\u52a0\u5230\u5728\u9ad8\u7ea7\u9009\u9879\u5361\u7684Qt src\u5b57\u6bb5\u3002\\ n\u60a8\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u975e\u6d41\u5a92\u4f53\u7248\u672c\u7684",qtsrc:"QuickTime\u6e90\u6587\u4ef6",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u7f29\u653e\u81f3\u5782\u76f4\u5bf9\u9f50",swstretchhalign:"\u7f29\u653e\u81f3\u6c34\u5e73\u5bf9\u9f50",swstretchstyle:"\u7f29\u653e\u6837\u5f0f",scriptcallbacks:"\u811a\u672c\u8fd4\u56de","align_top_right":"\u53f3\u4e0a",uimode:"\u9762\u677f\u6a21\u5f0f",rate:"\u6bd4\u7279\u7387",playcount:"\u64ad\u653e\u6b21\u6570",defaultframe:"\u9884\u8bbe\u753b\u9762",currentposition:"\u5f53\u524d\u4f4d\u7f6e",currentmarker:"\u5f53\u524d\u6807\u8bc6",captioningid:"\u5b57\u5e55\u6807\u8bc6",baseurl:"\u57fa\u672cURL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u89c6\u7a97\u64ad\u653e",stretchtofit:"\u7f29\u653e\u81f3\u6700\u4f73\u5927\u5c0f",mute:"\u9759\u97f3",invokeurls:"\u5f15\u7528\u7684 URLs",fullscreen:"\u5168\u5c4f",enabled:"\u53ef\u7528",autostart:"\u81ea\u52a8\u64ad\u653e",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"\u963b\u585e\u901f\u5ea6",href:"\u8d85\u94fe\u63a5",endtime:"\u5f00\u59cb\u65f6\u95f4",starttime:"\u7ed3\u675f\u65f6\u95f4",enablejavascript:"\u542f\u7528JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u9010\u5e27\u64ad\u653e",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u5668",menu:"\u663e\u793a\u83dc\u5355",loop:"\u5faa\u73af",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd","class_name":"\u7c7b\u522b",name:"\u540d\u79f0",id:"Id\u7f16\u53f7",type:"\u5a92\u4f53\u7c7b\u578b",size:"\u5c3a\u5bf8",preview:"\u9884\u89c8","constrain_proportions":"\u7ea6\u675f\u6bd4\u4f8b",controls:"\u63a7\u4ef6",numloop:"\u5faa\u73af\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"\u81ea\u52a8\u94fe\u63a5",liveconnect:"SWLiveConnect\u5c5e\u6027",flashvars:"Flash\u53c2\u6570",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f",wmode:"\u7a97\u53e3\u6a21\u5f0f",salign:"SAlign\u53c2\u6570",align:"\u5bf9\u9f50",scale:"\u7f29\u653e",quality:"\u54c1\u8d28",shuffle:"\u968f\u673a",prefetch:"\u9884\u8f7d",nojava:"\u5173\u95edjava",maintainaspect:"\u9501\u5b9a\u6bd4\u4f8b",imagestatus:"\u56fe\u7247\u72b6\u6001",center:"\u5c45\u4e2d",autogotourl:"\u81ea\u52a8\u8f6c\u81f3 URL","shockwave_options":"Shockwave\u9009\u9879","rmp_options":"Real media player\u9009\u9879","wmp_options":"Windows media player\u9009\u9879","qt_options":"Quicktime\u9009\u9879","flash_options":"Flash\u9009\u9879",hidden:"\u9690\u85cf","align_bottom_left":"\u5de6\u4e0b","align_bottom_right":"\u53f3\u4e0b","flv_options":"Flash video\u9009\u9879","flv_scalemode":"\u7f29\u653e\u6a21\u5f0f","flv_buffer":"\u7f13\u51b2\u5927\u5c0f","flv_startimage":"\u5f00\u59cb\u56fe\u7247","flv_starttime":"\u5f00\u59cb\u65f6\u95f4","flv_defaultvolume":"\u521d\u59cb\u97f3\u91cf\u5927\u5c0f","flv_hiddengui":"\u9690\u85cf\u63a7\u4ef6","flv_autostart":"\u81ea\u52a8\u5f00\u59cb","flv_loop":"\u5faa\u73af\u64ad\u653e","flv_showscalemodes":"\u663e\u793a\u7f29\u653e\u6a21\u5f0f","flv_smoothvideo":"\u5e73\u6ed1\u64ad\u653e","flv_jscallback":"JS\u8fd4\u56de","html5_video_options":"HTML5 Video\u9009\u9879",altsource1:"\u66ff\u4ee3\u6765\u6e90 1",altsource2:"\u66ff\u4ee3\u6765\u6e90 2",preload:"\u9884\u8f7d",poster:"\u6807\u8bed",source:"\u6e90\u4ee3\u7801"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/cs_dlg.js b/js/tiny_mce/plugins/media/langs/cs_dlg.js new file mode 100755 index 000000000..2527e0297 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.media_dlg',{list:"Seznam",file:"Soubor/URL",advanced:"Roz\u0161\u00ed\u0159en\u00e9",general:"Obecn\u00e9",title:"Vlo\u017eit/upravit vkl\u00e1dan\u00e1 m\u00e9dia",align_top_left:"Nahoru vlevo",align_center:"Na st\u0159ed",align_left:"Vlevo",align_bottom:"Dol\u016f",align_right:"Vpravo",align_top:"Nahoru",qt_stream_warn:"Streamovan\u00e9 rtsp zdroje mohou b\u00fdt p\u0159id\u00e1ny do pole \'Soubor/URL streamu pro QT\' na z\u00e1lo\u017ece \'Roz\u0161\u00ed\u0159en\u00e9\'.\\nYM\u016f\u017eete tak\u00e9 p\u0159idat nestreamovanou verzi do pole \'Soubor/URL\'.",qtsrc:"Soubor/URL streamu pro QT",progress:"Pr\u016fb\u011bh",sound:"Zvuk",swstretchvalign:"Zarovn\u00e1n\u00ed vert. rozta\u017een\u00ed",swstretchhalign:"Zarovn\u00e1n\u00ed horiz. rozta\u017een\u00ed",swstretchstyle:"Styl rozta\u017een\u00ed",scriptcallbacks:"Skripty zp\u011btn\u00fdch vol\u00e1n\u00ed",align_top_right:"Nahoru vpravo",uimode:"Re\u017eim ovl\u00e1dac\u00edho panelu",rate:"Relativn\u00ed rychlost",playcount:"Po\u010det p\u0159ehr\u00e1n\u00ed",defaultframe:"V\u00fdchoz\u00ed sn\u00edmek",currentposition:"Aktu\u00e1ln\u00ed pozice",currentmarker:"Aktu\u00e1ln\u00ed z\u00e1lo\u017eka",captioningid:"ID popisku m\u00e9dia",baseurl:"Z\u00e1kladn\u00ed URL",balance:"Vyv\u00e1\u017een\u00ed",windowlessvideo:"Video bez okna",stretchtofit:"Rozt\u00e1hnout do okna",mute:"Ztlumit",invokeurls:"Po\u017eadovat URL",fullscreen:"Cel\u00e1 obrazovka",enabled:"Povolit ovl\u00e1dac\u00ed panel",autostart:"Automatick\u00e9 spu\u0161t\u011bn\u00ed",volume:"Hlasitost",target:"C\u00edl",qtsrcchokespeed:"Sn\u00ed\u017een\u00ed rychlosti",href:"Odkaz",endtime:"\u010cas ukon\u010den\u00ed",starttime:"Po\u010d\u00e1te\u010dn\u00ed \u010das",enablejavascript:"Povolit Javascript",correction:"Bez korekc\u00ed",targetcache:"C\u00edlov\u00e1 mezipam\u011b\u0165",playeveryframe:"P\u0159ehr\u00e1t ka\u017ed\u00fd sn\u00edmek",kioskmode:"Zak\u00e1zat ukl\u00e1d\u00e1n\u00ed",controller:"Ovl\u00e1dac\u00ed panel",menu:"Zobrazit nab\u00eddku",loop:"Opakov\u00e1n\u00ed",play:"Automatick\u00e9 p\u0159ehr\u00e1v\u00e1n\u00ed",hspace:"Horizont\u00e1ln\u00ed odsazen\u00ed",vspace:"Vertik\u00e1ln\u00ed odsazen\u00ed",class_name:"T\u0159\u00edda",name:"N\u00e1zev",id:"ID",type:"Typ",size:"Rozm\u011bry",preview:"N\u00e1hled",constrain_proportions:"Zachovat proporce",controls:"Ovl\u00e1dac\u00ed panel",numloop:"Po\u010det opakov\u00e1n\u00ed",console:"Konzola",cache:"Mezipam\u011b\u0165",autohref:"Automatick\u00e9 na\u010dten\u00ed",liveconnect:"Spustit Javu (SWLiveConnect)",flashvars:"Parametry (Flashvars)",base:"Z\u00e1kladn\u00ed slo\u017eka",bgcolor:"Pozad\u00ed",wmode:"Re\u017eim okna",salign:"Zarovn\u00e1n\u00ed okna",align:"Zarovn\u00e1n\u00ed",scale:"Pom\u011br",quality:"Kvalita",shuffle:"N\u00e1hodn\u011b",prefetch:"P\u0159edna\u010dten\u00ed",nojava:"Nespout\u011bt Javu",maintainaspect:"Zachovat pom\u011br stran",imagestatus:"Stav obrazu",center:"Na st\u0159ed",autogotourl:"Automatick\u00fd p\u0159echod na URL",shockwave_options:"Mo\u017enosti Shockwave",rmp_options:"Mo\u017enosti p\u0159ehr\u00e1va\u010de Real media",wmp_options:"Mo\u017enosti p\u0159ehr\u00e1va\u010de Windows media",qt_options:"Mo\u017enosti Quicktime",flash_options:"Mo\u017enosti Flashe",hidden:"Skr\u00fdt",align_bottom_left:"Dol\u016f vlevo",align_bottom_right:"Dol\u016f vpravo",flv_options:"Mo\u017enosti Flash video",flv_scalemode:"Zm\u011bna velikosti",flv_buffer:"Z\u00e1sobn\u00edk",flv_startimage:"Po\u010d\u00e1te\u010dn\u00ed obr\u00e1zek",flv_starttime:"Po\u010d\u00e1te\u010dn\u00ed \u010das",flv_defaultvolume:"V\u00fdchoz\u00ed hlasitost",flv_hiddengui:"Skryt\u00fd ovl\u00e1dac\u00ed panel",flv_autostart:"Automatick\u00e9 spu\u0161t\u011bn\u00ed",flv_loop:"Opakov\u00e1n\u00ed",flv_showscalemodes:"Zobrazit volby zm\u011bny velikosti",flv_smoothvideo:"Vyhlazen\u00e9 video",flv_jscallback:"Zp\u011btn\u00e9 vol\u00e1n\u00ed Javascriptu",html5_video_options:"Mo\u017enosti HTML5 video",altsource1:"Alternativn\u00ed zdroj 1",altsource2:"Alternativn\u00ed zdroj 2",preload:"P\u0159edna\u010d\u00edst",poster:"Obr\u00e1zek (zobraz\u00ed se p\u0159i nedostupnosti videa)",source:"Zdroj"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/cy_dlg.js b/js/tiny_mce/plugins/media/langs/cy_dlg.js new file mode 100755 index 000000000..b731a8adf --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.media_dlg',{list:"Rhestr",file:"Ffeil/URL",advanced:"Uwch",general:"Cyffredinol",title:"Mewnosod / golygu cyfrwng planedig",align_top_left:"Pen canol",align_center:"Canol",align_left:"Chwith",align_bottom:"Gwaelod",align_right:"De",align_top:"Pen",qt_stream_warn:"Dylai adnoddau RTSP ffrydio cael eu ychwanegu i\'r maes Fynhonell QT o dan y tab Uwch.\\n Dylai chi hefyd ychwanegu fersiwn heb-ffrydio i\'r maes Fynhonell.",qtsrc:"Fynhonell QT",progress:"Cynnydd",sound:"Sain",swstretchvalign:"Aliniad fertigol ymestyn",swstretchhalign:"Aliniad llorweddol ymestyn",swstretchstyle:"Arddull ymestyn",scriptcallbacks:"N\u00f4l-galwadau sgript",align_top_right:"Pen dde",uimode:"Modd UI",rate:"Cyfradd",playcount:"Cyfrif chwarae",defaultframe:"Ffr\u00e2m rhagosodedig",currentposition:"Lleoliad cyfredol",currentmarker:"Marciwr cyfredol",captioningid:"Id egluro",baseurl:"URL seiledig",balance:"Cydbwysedd",windowlessvideo:"Fideo heb-ffenest",stretchtofit:"Ymestun i ffitio",mute:"Mudo",invokeurls:"Defnyddio URLs",fullscreen:"Sgrin llawn",enabled:"Wedi\'i galluogi",autostart:"Awto-cychwyn",volume:"Cyfrol",target:"Targed",qtsrcchokespeed:"Tagu cyflymder",href:"Href",endtime:"Amser gorffen",starttime:"Amser dechrae",enablejavascript:"Galluogi JavaScript",correction:"Dim cywiriad",targetcache:"Storfa targed",playeveryframe:"Chwarae pob ffr\u00e2m",kioskmode:"Modd ciosk",controller:"Rheolydd",menu:"Dangos dewislen",loop:"Dolen",play:"Awto-chwarae",hspace:"Gofod llorweddol",vspace:"Gofod fertigol",class_name:"Dosbarth",name:"Enw",id:"Id",type:"Math",size:"Dimensiynau",preview:"Rhagolygu",constrain_proportions:"Cynfyngu cyfraneddau",controls:"Rheolyddion",numloop:"Nifer o dolenau",console:"Consol",cache:"Storfa",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Sail",bgcolor:"Cefndir",wmode:"Modd-W",salign:"Alinio-S",align:"Alinio",scale:"Gradd",quality:"Ansawdd",shuffle:"Cymysgu",prefetch:"Cyn-n\u00f4l",nojava:"Dim java",maintainaspect:"Cynnal agwedd",imagestatus:"Statws delwedd",center:"Canol",autogotourl:"URL awto-mynd-i",shockwave_options:"Dewisiadau Shockwave",rmp_options:"Dewisiadau Real Media Player",wmp_options:"Dewisiadau Windows Media Player",qt_options:"Dewisiadau Quicktime",flash_options:"Dewisiadau Flash",hidden:"Wedi\'i cuddio",align_bottom_left:"Gwaelod chwith",align_bottom_right:"Gwaelod dde",flv_options:"Dewisiadau fideo Flash",flv_scalemode:"Modd graddfa",flv_buffer:"Buffer",flv_startimage:"Delwedd cychwyn",flv_starttime:"Amser cychwyn",flv_defaultvolume:"Cyfrol rhagosodedig",flv_hiddengui:"GUI wedi\'i cuddio",flv_autostart:"Awto-cychwyn",flv_loop:"Doleni",flv_showscalemodes:"Dangos moddau graddfa",flv_smoothvideo:"Fideo llyfn",flv_jscallback:"N\u00f4l-galwad JS"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/da_dlg.js b/js/tiny_mce/plugins/media/langs/da_dlg.js new file mode 100755 index 000000000..471139b34 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.media_dlg',{list:"Liste",file:"Fil/URL",advanced:"Avanceret",general:"Generelt",title:"Inds\u00e6t/rediger indlejret mediefil",align_top_left:"\u00d8verste venstre hj\u00f8rne",align_center:"Centreret",align_left:"Venstre",align_bottom:"Bund",align_right:"H\u00f8jret",align_top:"Top",qt_stream_warn:"Streamede rtsp resourcer skal tilf\u00f8jes til QT Src feltet under tabben avanceret.\\nDu skal ogs\u00e5 tilf\u00f8je en ikke streamet version til Src feltet..",qtsrc:"QT Src",progress:"Fremskridt",sound:"Lyd",swstretchvalign:"Str\u00e6k V-justering",swstretchhalign:"Str\u00e6k H-justering",swstretchstyle:"Str\u00e6k stil",scriptcallbacks:"Script callbacks",align_top_right:"\u00d8verste h\u00f8jre hj\u00f8rne",uimode:"UI-tilstand",rate:"Vurder",playcount:"Afspil indhold",defaultframe:"Standard ramme",currentposition:"Aktuel position",currentmarker:"Aktuel mark\u00f8r",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Vinduesl\u00f8s video",stretchtofit:"Str\u00e6k for at tilpasse",mute:"Lydl\u00f8s",invokeurls:"Aktiver URL\'er",fullscreen:"Fulssk\u00e6rm",enabled:"Valgt",autostart:"Afspil automatisk",volume:"Lydstyrke",target:"M\u00e5l",qtsrcchokespeed:"Choke-hastighed",href:"Href",endtime:"Sluttidspunkt",starttime:"Starttidspunkt",enablejavascript:"Tillad JavaScript",correction:"Ingen korrektion",targetcache:"M\u00e5l-cache",playeveryframe:"Afsplil alle rammer",kioskmode:"Kiosk-tilstand",controller:"Controller",menu:"Vis menu",loop:"Gentag",play:"Start",hspace:"H-afstand",vspace:"V-afstand",class_name:"Klasse",name:"Navn",id:"Id",type:"Type",size:"Dimensioner",preview:"Vis udskrift",constrain_proportions:"Bevar proportioner",controls:"Kontroller",numloop:"Antal loops",console:"Konsol",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Baggrund",wmode:"WMode",salign:"SAlign",align:"Juster",scale:"Skaler",quality:"Kvalitet",shuffle:"Bland",prefetch:"Forh\u00e5ndshent",nojava:"Ingen java",maintainaspect:"Bevar aspekt",imagestatus:"Billedstatus",center:"Center",autogotourl:"Auto g\u00e5 til URL",shockwave_options:"Shockwave options",rmp_options:"Real media player egenskaber",wmp_options:"Windows media player egenskaber",qt_options:"Quicktime egenskaber",flash_options:"Flash egenskaber",hidden:"Skjul",align_bottom_left:"Nederste venstre hj\u00f8rne",align_bottom_right:"\u00d8verste h\u00f8jre hj\u00f8rne",flv_options:"Flash video egenskaber",flv_scalemode:"Skaleringstilstand",flv_buffer:"Buffer",flv_startimage:"Startbillede",flv_starttime:"Starttidspunkt",flv_defaultvolume:"Standard lydstyrke",flv_hiddengui:"Skjul sk\u00e6rmbillede",flv_autostart:"Autostart",flv_loop:"Gentag",flv_showscalemodes:"Vis skaleringstilstande",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback",html5_video_options:"HTML5 Video Indstillinger",altsource1:"Alternativ kilde 1",altsource2:"Alternativ kilde 2",preload:"Forudindl\u00e6s",poster:"Poster",source:"Kilde"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/de_dlg.js b/js/tiny_mce/plugins/media/langs/de_dlg.js new file mode 100755 index 000000000..e7d3cfde3 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.media_dlg',{list:"Liste",file:"Datei/URL",advanced:"Erweitert",general:"Allgemein",title:"Multimedia-Inhalte einf\u00fcgen/bearbeiten",align_top_left:"Oben Links",align_center:"Zentriert",align_left:"Links",align_bottom:"Unten",align_right:"Rechts",align_top:"Oben",qt_stream_warn:"In den Erweiterten Einstellungen sollten im Feld \'QT Src\' gestreamte RTSP Resourcen hinzugef\u00fcgt werden.\\nZus\u00e4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.",qtsrc:"Angabe zu QT Src",progress:"Fortschritt",sound:"Ton",swstretchvalign:"Stretch V-Ausrichtung",swstretchhalign:"Stretch H-Ausrichtung",swstretchstyle:"Stretch-Art",scriptcallbacks:"Script callbacks",align_top_right:"Oben Rechts",uimode:"UI Modus",rate:"Rate",playcount:"Z\u00e4hler",defaultframe:"Frame-Voreinstellung",currentposition:"Aktuelle Position",currentmarker:"Aktueller Marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Fensterloses Video",stretchtofit:"Anzeigefl\u00e4che an verf\u00fcgbaren Platz anpassen",mute:"Stumm",invokeurls:"Invoke URLs",fullscreen:"Vollbild",enabled:"Aktiviert",autostart:"Autostart",volume:"Lautst\u00e4rke",target:"Ziel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Endzeitpunkt",starttime:"Startzeitpunkt",enablejavascript:"JavaScript aktivieren",correction:"Ohne Korrektur",targetcache:"Ziel zwischenspeichern",playeveryframe:"Jeden Frame abspielen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Men\u00fc anzeigen",loop:"Wiederholung",play:"Automatisches Abspielen",hspace:"Horizontaler Abstand",vspace:"Vertikaler Abstand",class_name:"CSS-Klasse",name:"Name",id:"Id",type:"Typ",size:"Abmessungen",preview:"Vorschau",constrain_proportions:"Proportionen erhalten",controls:"Steuerung",numloop:"Anzahl Wiederholungen",console:"Konsole",cache:"Zwischenspeicher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvariablen",base:"Base",bgcolor:"Hintergrund",wmode:"WMode",salign:"S-Ausrichtung",align:"Ausrichtung",scale:"Skalierung",quality:"Qualit\u00e4t",shuffle:"Zuf\u00e4llige Wiedergabe",prefetch:"Prefetch",nojava:"Kein Java",maintainaspect:"Bildverh\u00e4ltnis beibehalten",imagestatus:"Bildstatus",center:"Zentriert",autogotourl:"Auto goto URL",shockwave_options:"Shockwave-Optionen",rmp_options:"Optionen f\u00fcr Real Media Player",wmp_options:"Optionen f\u00fcr Windows Media Player",qt_options:"Quicktime-Optionen",flash_options:"Flash-Optionen",hidden:"Versteckt",align_bottom_left:"Unten Links",align_bottom_right:"Unten Rechts",flv_options:"Optionen f\u00fcr Flash Video",flv_scalemode:"Skalierungsmodus",flv_buffer:"Puffer",flv_startimage:"Startbild",flv_starttime:"Startzeitpunkt",flv_defaultvolume:"Standardlautst\u00e4rke",flv_hiddengui:"Versteckte GUI",flv_autostart:"Autostart",flv_loop:"Wiederholung",flv_showscalemodes:"Skalierungsmodi anzeigen",flv_smoothvideo:"Smooth Video",flv_jscallback:"JS Callback",html5_video_options:"HTML5 Video Optionen",altsource1:"Alternative Quelle 1",altsource2:"Alternative Quelle 2",preload:"Preload",poster:"Poster",source:"Quelle"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/dv_dlg.js b/js/tiny_mce/plugins/media/langs/dv_dlg.js new file mode 100755 index 000000000..205d6ee56 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/el_dlg.js b/js/tiny_mce/plugins/media/langs/el_dlg.js new file mode 100755 index 000000000..efcf71821 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.media_dlg',{list:"\u039b\u03af\u03c3\u03c4\u03b1",file:"\u0391\u03c1\u03c7\u03b5\u03af\u03bf/URL",advanced:"\u0393\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03bf\u03c5\u03c2",general:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac",title:"\u0395\u03b9\u03c3\u03b1\u03b3\u03c9\u03b3\u03ae/\u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03b5\u03bd\u03c3\u03c9\u03bc\u03b1\u03c4\u03c9\u03bc\u03ad\u03bd\u03c9\u03bd media",align_top_left:"\u03a0\u03ac\u03bd\u03c9 \u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",align_center:"\u039a\u03ad\u03bd\u03c4\u03c1\u03bf",align_left:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",align_bottom:"\u039a\u03ac\u03c4\u03c9",align_right:"\u0394\u03b5\u03be\u03b9\u03ac",align_top:"\u03a0\u03ac\u03bd\u03c9",qt_stream_warn:"\u03a0\u03b7\u03b3\u03ad\u03c2 \u03c1\u03bf\u03ce\u03bd rtsp \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c4\u03b5\u03b8\u03bf\u03cd\u03bd \u03c3\u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf \u03a0\u03b7\u03b3\u03ae QT \u03ba\u03ac\u03c4\u03c9 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03ba\u03b1\u03c1\u03c4\u03ad\u03bb\u03b1 \u0393\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03bf\u03c5\u03c2.\\n\u0395\u03c0\u03af\u03c3\u03b7\u03c2 \u03ba\u03b1\u03bb\u03cc \u03b8\u03b1 \u03ae\u03c4\u03b1\u03bd \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03b1\u03c0\u03bb\u03ae (\u03cc\u03c7\u03b9 \u03c1\u03bf\u03ae\u03c2) \u03c0\u03b7\u03b3\u03ae..",qtsrc:"\u03a0\u03b7\u03b3\u03ae \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5",progress:"\u03a0\u03c1\u03cc\u03bf\u03b4\u03bf\u03c2",sound:"\u0389\u03c7\u03bf\u03c2",swstretchvalign:"\u039a\u03b1\u03c4\u03b1\u03ba\u03cc\u03c1\u03c5\u03c6\u03b7 \u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7",swstretchhalign:"\u039f\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1 \u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7",swstretchstyle:"\u03a3\u03c4\u03c5\u03bb \u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7\u03c2",scriptcallbacks:"Script callbacks",align_top_right:"\u03a0\u03ac\u03bd\u03c9 \u03b4\u03b5\u03be\u03b9\u03ac",uimode:"\u039b\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 UI",rate:"\u03a1\u03c5\u03b8\u03bc\u03cc\u03c2",playcount:"\u03a0\u03cc\u03c3\u03b5\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c0\u03b1\u03af\u03be\u03b5\u03b9",defaultframe:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf \u03ba\u03b1\u03c1\u03ad",currentposition:"\u03a4\u03c1\u03ad\u03c7\u03bf\u03c5\u03c3\u03b1 \u03b8\u03ad\u03c3\u03b7",currentmarker:"\u03a4\u03c1\u03ad\u03c7\u03bf\u03bd \u03c3\u03b7\u03bc\u03ac\u03b4\u03b9",captioningid:"Captioning id",baseurl:"URL \u03b2\u03ac\u03c3\u03b7\u03c2",balance:"\u0399\u03c3\u03bf\u03c1\u03c1\u03bf\u03c0\u03af\u03b1",windowlessvideo:"\u0392\u03af\u03bd\u03c4\u03b5\u03bf \u03c7\u03c9\u03c1\u03af\u03c2 \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf",stretchtofit:"\u0395\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03c7\u03c9\u03c1\u03ad\u03c3\u03b5\u03b9",mute:"\u03a3\u03af\u03b3\u03b1\u03c3\u03b7",invokeurls:"\u039a\u03bb\u03ae\u03c3\u03b7 URLs",fullscreen:"\u03a0\u03bb\u03ae\u03c1\u03b7\u03c2 \u03bf\u03b8\u03cc\u03bd\u03b7",enabled:"\u0395\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7",autostart:"\u0391\u03c5\u03c4\u03cc\u03bc\u03b1\u03c4\u03b7 \u03b5\u03ba\u03ba\u03af\u03bd\u03b7\u03c3\u03b7",volume:"\u0388\u03bd\u03c4\u03b1\u03c3\u03b7",target:"\u03a3\u03c4\u03cc\u03c7\u03bf\u03c2",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"\u03a7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03bb\u03ae\u03be\u03b7\u03c2",starttime:"\u03a7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03ad\u03bd\u03b1\u03c1\u03be\u03b7\u03c2",enablejavascript:"\u0395\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 JavaScript",correction:"\u03a7\u03c9\u03c1\u03af\u03c2 \u03b4\u03b9\u03cc\u03c1\u03b8\u03c9\u03c3\u03b7",targetcache:"\u039c\u03bd\u03ae\u03bc\u03b7 cache \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5",playeveryframe:"\u03a0\u03b1\u03af\u03be\u03b9\u03bc\u03bf \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03ba\u03b1\u03c1\u03ad",kioskmode:"\u039b\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 Kiosk",controller:"\u0395\u03bb\u03b5\u03b3\u03ba\u03c4\u03ae\u03c2",menu:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03bc\u03b5\u03bd\u03bf\u03cd",loop:"\u0395\u03c0\u03b1\u03bd\u03ac\u03bb\u03b7\u03c8\u03b7",play:"\u0391\u03c5\u03c4\u03cc\u03bc\u03b1\u03c4\u03bf \u03b5\u03ba\u03ba\u03af\u03bd\u03b7\u03c3\u03b7",hspace:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03bf\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1",vspace:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03ba\u03ac\u03b8\u03b5\u03c4\u03b7",class_name:"\u039a\u03bb\u03ac\u03c3\u03b7",name:"\u038c\u03bd\u03bf\u03bc\u03b1",id:"Id",type:"\u03a4\u03cd\u03c0\u03bf\u03c2",size:"\u0394\u03b9\u03b1\u03c3\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2",preview:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7",constrain_proportions:"\u0394\u03b9\u03b1\u03c4\u03ae\u03c1\u03b7\u03c3\u03b7 \u03b1\u03bd\u03b1\u03bb\u03bf\u03b3\u03af\u03b1\u03c2 \u03c0\u03bb. - \u03cd\u03c8\u03bf\u03c5\u03c2",controls:"\u03a7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c1\u03b9\u03b1",numloop:"\u03a0\u03cc\u03c3\u03b5\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c0\u03b1\u03af\u03be\u03b5\u03b9",console:"\u039a\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1",cache:"\u039c\u03bd\u03ae\u03bc\u03b7 cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"\u039c\u03b5\u03c4\u03b1\u03b2\u03bb\u03b7\u03c4\u03ad\u03c2 Flash",base:"\u0392\u03ac\u03c3\u03b7",bgcolor:"\u03a6\u03cc\u03bd\u03c4\u03bf",wmode:"WMode",salign:"SAlign",align:"\u03a3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7",scale:"\u039a\u03bb\u03af\u03bc\u03b1\u03ba\u03b1",quality:"\u03a0\u03bf\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1",shuffle:"\u03a4\u03c5\u03c7\u03b1\u03af\u03b1 \u03c3\u03b5\u03b9\u03c1\u03ac",prefetch:"\u03a0\u03c1\u03bf\u03c6\u03cc\u03c1\u03c4\u03c9\u03c3\u03b7",nojava:"\u03a7\u03c9\u03c1\u03af\u03c2 java",maintainaspect:"\u0394\u03b9\u03b1\u03c4\u03ae\u03c1\u03b7\u03c3\u03b7 \u03b1\u03bd\u03b1\u03bb\u03bf\u03b3\u03af\u03b1\u03c2 \u03c0\u03bb. - \u03cd\u03c8\u03bf\u03c5\u03c2",imagestatus:"\u039a\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2",center:"\u039a\u03ad\u03bd\u03c4\u03c1\u03bf",autogotourl:"\u0391\u03c5\u03c4\u03cc\u03bc\u03b1\u03c4\u03b7 \u03bc\u03b5\u03c4\u03ac\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03bf URL",shockwave_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 Shockwave",rmp_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 Real media player",wmp_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 Windows media player",qt_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 Quicktime",flash_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 Flash",hidden:"\u039a\u03c1\u03c5\u03c6\u03cc",align_bottom_left:"\u039a\u03ac\u03c4\u03c9 \u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",align_bottom_right:"\u039a\u03ac\u03c4\u03c9 \u03b4\u03b5\u03be\u03b9\u03ac",flv_options:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 \u03b2\u03af\u03bd\u03c4\u03b5\u03bf Flash",flv_scalemode:"\u039b\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03ba\u03bb\u03af\u03bc\u03b1\u03ba\u03b1\u03c2",flv_buffer:"\u0395\u03bd\u03b4\u03b9\u03ac\u03bc\u03b5\u03c3\u03b7 \u03bc\u03bd\u03ae\u03bc\u03b7",flv_startimage:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 \u03b1\u03c1\u03c7\u03ae\u03c2",flv_starttime:"\u03a7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03ad\u03bd\u03b1\u03c1\u03be\u03b7\u03c2",flv_defaultvolume:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03b7 \u03ad\u03bd\u03c4\u03b1\u03c3\u03b7",flv_hiddengui:"\u039a\u03c1\u03c5\u03bc\u03bc\u03ad\u03bd\u03bf GUI",flv_autostart:"\u0391\u03c5\u03c4\u03cc\u03bc\u03b1\u03c4\u03b7 \u03b5\u03ba\u03ba\u03af\u03bd\u03b7\u03c3\u03b7",flv_loop:"\u0395\u03c0\u03b1\u03bd\u03ac\u03bb\u03b7\u03c8\u03b7",flv_showscalemodes:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b9\u03ce\u03bd \u03ba\u03bb\u03af\u03bc\u03b1\u03ba\u03b1\u03c2",flv_smoothvideo:"\u039f\u03bc\u03b1\u03bb\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2 \u03b2\u03af\u03bd\u03c4\u03b5\u03bf",flv_jscallback:"JS Callback",html5_video_options:"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/en_dlg.js b/js/tiny_mce/plugins/media/langs/en_dlg.js new file mode 100644 index 000000000..e191cee09 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media","align_top_left":"Top left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks","align_top_right":"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL","shockwave_options":"Shockwave options","rmp_options":"Real media player options","wmp_options":"Windows media player options","qt_options":"Quicktime options","flash_options":"Flash options",hidden:"Hidden","align_bottom_left":"Bottom left","align_bottom_right":"Bottom right","flv_options":"Flash video options","flv_scalemode":"Scale mode","flv_buffer":"Buffer","flv_startimage":"Start image","flv_starttime":"Start time","flv_defaultvolume":"Default volumne","flv_hiddengui":"Hidden GUI","flv_autostart":"Auto start","flv_loop":"Loop","flv_showscalemodes":"Show scale modes","flv_smoothvideo":"Smooth video","flv_jscallback":"JS Callback","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/es_dlg.js b/js/tiny_mce/plugins/media/langs/es_dlg.js new file mode 100755 index 000000000..84edec616 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.media_dlg',{list:"Lista",file:"Archivo/URL",advanced:"Avanzado",general:"General",title:"Insertar/editar medio embebido","align_top_left":"Arriba Izda.","align_center":"Centrado","align_left":"Izquierda","align_bottom":"Debajo","align_right":"Derecha","align_top":"Arriba","qt_stream_warn":"Los recursos rtsp de Streaming deber\u00edan a\u00f1adirse en el campo QT Src de la pesta\u00f1a avanzada.\\nAdem\u00e1s deber\u00eda a\u00f1adir una versi\u00f3n no Streaming en el campo Src.",qtsrc:"QT Src",progress:"Progreso",sound:"Sonido",swstretchvalign:"Alin. V. Estiramiento",swstretchhalign:"Alin. H. Estiramiento",swstretchstyle:"Estilo estiramiento",scriptcallbacks:"Script callbacks","align_top_right":"Arriba Dcha.",uimode:"Modo UI",rate:"Ratio",playcount:"Cuantas reproducciones",defaultframe:"Frame predet.",currentposition:"Posici\u00f3n actual",currentmarker:"Marcador actual",captioningid:"Captioning id",baseurl:"URL Base",balance:"Balance",windowlessvideo:"Video sin ventana",stretchtofit:"Estirar para ajustar",mute:"Silencio",invokeurls:"Invocar URLs",fullscreen:"Pantalla Completa",enabled:"Habilitado",autostart:"Comienzo Autom\u00e1tico",volume:"Volumen",target:"Target",qtsrcchokespeed:"Vel. de choque",href:"Href",endtime:"Fin",starttime:"Inicio",enablejavascript:"Habilitar JavaScript",correction:"Sin correci\u00f3n",targetcache:"Target cache",playeveryframe:"Reproducir todo los frames",kioskmode:"Kiosk mode",controller:"Controller",menu:"Mostrar Men\u00fa",loop:"Repetitivo",play:"Comienzo Autom\u00e1tico",hspace:"H-Space",vspace:"V-Space","class_name":"Clase",name:"Nombre",id:"Id",type:"Tipo",size:"Dimensiones",preview:"Vista Previa","constrain_proportions":"Bloquear relaci\u00f3n de aspecto",controls:"Controles",numloop:"N\u00fam. repeticiones",console:"Consola",cache:"Cach\u00e9",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Fondo",wmode:"WMode",salign:"SAlign",align:"Alineaci\u00f3n",scale:"Scale",quality:"Calidad",shuffle:"Aleatorio",prefetch:"Preb\u00fasqueda",nojava:"No java",maintainaspect:"Mantener aspecto",imagestatus:"Estado de imagen",center:"Centrado",autogotourl:"Ir a URL autom\u00e1t.","shockwave_options":"Opciones Shockwave","rmp_options":"Opciones Real media player","wmp_options":"Opciones Windows media player","qt_options":"Opciones Quicktime","flash_options":"Opciones Flash",hidden:"Hidden","align_bottom_left":"Debajo Izda.","align_bottom_right":"Debajo Dcha.","flv_options":"Opciones Video Flash","flv_scalemode":"Modo escalado","flv_buffer":"Buffer","flv_startimage":"Imagen inicio","flv_starttime":"Tiempo inicio","flv_defaultvolume":"Volumen predet.","flv_hiddengui":"Ocultar GUI","flv_autostart":"Inicio auto.","flv_loop":"Repetitivo","flv_showscalemodes":"Mostrar modos escala","flv_smoothvideo":"Video suave","flv_jscallback":"JS Callback","html5_video_options":"Opciones Video HTML5",altsource1:"Fuente alternativa 1",altsource2:"Fuente alternativa 2",preload:"Precarga",poster:"P\u00f3ster",source:"Fuente"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/et_dlg.js b/js/tiny_mce/plugins/media/langs/et_dlg.js new file mode 100755 index 000000000..25e5ee1b7 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.media_dlg',{list:"Nimekiri",file:"Fail/URL",advanced:"T\u00e4psem",general:"\u00dcldine",title:"Sisesta/muuda meediat",align_top_left:"\u00dcleval vasakul",align_center:"Keskel",align_left:"Vasakul",align_bottom:"All",align_right:"Paremal",align_top:"\u00dcleval",qt_stream_warn:"Striimitav variant peaks olema lisatud.",qtsrc:"QT Src",progress:"Progress",sound:"Heli",swstretchvalign:"Venita V-joondust",swstretchhalign:"Venita H-joondust",swstretchstyle:"Venita stiili",scriptcallbacks:"Skripti tagasikutse",align_top_right:"Pleval paremal",uimode:"UI Reziim",rate:"Hinda",playcount:"M\u00e4ngukorrad",defaultframe:"Vaikimisi raam",currentposition:"Antud positioon",currentmarker:"Antud marker",captioningid:"Tiitri ID",baseurl:"Baas URL",balance:"Tasakaal",windowlessvideo:"Aknata video",stretchtofit:"Venita sobivaks",mute:"Vaigista",invokeurls:"N\u00e4ita URL\u2019e",fullscreen:"T\u00e4isekraan",enabled:"Lubatud",autostart:"Auto-start",volume:"Valjudus",target:"Sihtm\u00e4rk",qtsrcchokespeed:"Kiirus",href:"Href",endtime:"L\u00f5pu aeg",starttime:"Stardi aeg",enablejavascript:"Luba JavaScript\u2019i",correction:"Parandust ei ole",targetcache:"Sihtm\u00e4rgi vahem\u00e4lu",playeveryframe:"M\u00e4ngi igat raami",kioskmode:"Kioski reziim",controller:"Kontrollija",menu:"N\u00e4ita men\u00fc\u00fcd",loop:"Auto-kordus",play:"Auto-start",hspace:"H-vahe",vspace:"V-vahe",class_name:"Klass",name:"Nime",id:"ID",type:"T\u00fc\u00fcp",size:"M\u00f5\u00f5dud",preview:"Eelvaade",constrain_proportions:"S\u00e4ilita proportsioon",controls:"Kontrollid",numloop:"Kordused",console:"Konsool",cache:"Vahem\u00e4lu",autohref:"Auto-HREF",liveconnect:"SWLive-\u00dchendus",flashvars:"Flashiv\u00e4rk",base:"Baas",bgcolor:"Taust",wmode:"WMoodus",salign:"SJoondus",align:"Joondus",scale:"M\u00f5\u00f5tkava",quality:"Kvaliteet",shuffle:"Sega",prefetch:"Prefetch",nojava:"Ilma java\u2019ta",maintainaspect:"S\u00e4ilitamise aspekt",imagestatus:"Pildi staatus",center:"Keskel",autogotourl:"Auto-URL",shockwave_options:"Shockwave\u2019i seaded",rmp_options:"Real media player\u2019i seaded",wmp_options:"Windows media player\u2019i seaded",qt_options:"Quicktime\u2019 seaded",flash_options:"Flash\u2019i seaded",hidden:"Peidetud",align_bottom_left:"All vasakul",align_bottom_right:"All paremal",flv_options:"Flash video seaded",flv_scalemode:"Skaala reziim",flv_buffer:"Puffer",flv_startimage:"Stardi pilt",flv_starttime:"Stardi aeg",flv_defaultvolume:"Vaikimisi helitugevus",flv_hiddengui:"Peidetud GUI",flv_autostart:"Auto-start",flv_loop:"Auto.kordus",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Sujuv video",flv_jscallback:"JS tagasikutse"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/eu_dlg.js b/js/tiny_mce/plugins/media/langs/eu_dlg.js new file mode 100755 index 000000000..84ae35711 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.media_dlg',{list:"Zerrenda",file:"Fitxategia/URL",advanced:"Aurreratua",general:"Orokorra",title:"Sartu / editatu ahokatutako euskarria",align_top_left:"Goian ezkerran",align_center:"Erdian",align_left:"Ezkerrean",align_bottom:"Behean",align_right:"Eskuinean",align_top:"Goian",qt_stream_warn:"Streaming bidez ematen diren rtsp baliabideak aurreratuak fitxa n dagoen QT Src eremuan gehitu behar dira.\\n Streaming gabeko bertsio bat ere gehitu beharko zenuke.",qtsrc:"QT Src",progress:"Aurrerapena",sound:"Soinua",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Goian eskuinean",uimode:"UI Modua",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Uneko posizioa",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balanzea",windowlessvideo:"Lehiogabeko bideoa",stretchtofit:"Neurrikoa izateko zabaldu",mute:"Ixilik",invokeurls:"URLa deitu",fullscreen:"Pantaila osoa",enabled:"Gaituta",autostart:"Automatikoki hasi",volume:"Bolumena",target:"Helburua",qtsrcchokespeed:"Talka abiadura",href:"Href",endtime:"Noiz bukatu",starttime:"Noiz hasi",enablejavascript:"Gaitu JavaScript",correction:"Zuzenketarik ez",targetcache:"Helburu katxea",playeveryframe:"Marko guztiak erreproduzitu",kioskmode:"Kiosko modua",controller:"Controller",menu:"Erakutsi menua",loop:"Begizta",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Klasea",name:"Izena",id:"Id",type:"Mota",size:"Tamaina",preview:"Aurrebista",constrain_proportions:"Itxura erlazioa blokeatu",controls:"Kontrolak",numloop:"Begizta kopurua",console:"Konsola",cache:"Katxea",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Oinarria",bgcolor:"Atzea",wmode:"WMode",salign:"SAlign",align:"Lerrokatu",scale:"Eskalatu",quality:"Kalitatea",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"Java ez",maintainaspect:"Maintain aspect",imagestatus:"Irudi edoera",center:"Erdian",autogotourl:"Automatikoi joan URLra",shockwave_options:"Shockwave aukerak",rmp_options:"Real media player aukerak",wmp_options:"Windows media player aukerak",qt_options:"Quicktime aukerak",flash_options:"Flash aukerak",hidden:"Ezkutuan",align_bottom_left:"Behean ezkerrean",align_bottom_right:"Behean eskuinean",flv_options:"Flash bideo aukerak",flv_scalemode:"Eskala modua",flv_buffer:"Buffer",flv_startimage:"Hasiera irudia",flv_starttime:"Noiz hasi",flv_defaultvolume:"Bolumen lehenetsia",flv_hiddengui:"Ezkutuko GUI",flv_autostart:"Auto start",flv_loop:"Begizta",flv_showscalemodes:"Erakutsi eskala moduak",flv_smoothvideo:"Bideo leuna",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/fa_dlg.js b/js/tiny_mce/plugins/media/langs/fa_dlg.js new file mode 100755 index 000000000..bcaf3a01f --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.media_dlg',{list:"\u0644\u06cc\u0633\u062a",file:"\u0641\u0627\u06cc\u0644/URL",advanced:"\u067e\u06cc\u0634\u0631\u0641\u062a\u0647",general:"\u0639\u0645\u0648\u0645\u06cc",title:"\u062f\u0631\u062c / \u0648\u06cc\u0631\u0627\u06cc\u0634 \u0631\u0633\u0627\u0646\u0647 \u062c\u0627\u0633\u0627\u0632\u06cc \u0634\u062f\u0647 (Embeded Media)",align_top_left:"\u0628\u0627\u0644\u0627 \u0686\u067e",align_center:"\u0648\u0633\u0637",align_left:"\u0686\u067e",align_bottom:"\u067e\u0627\u06cc\u06cc\u0646",align_right:"\u0631\u0627\u0633\u062a",align_top:"\u0628\u0627\u0644\u0627",qt_stream_warn:"\u0645\u0646\u0627\u0628\u0639 Streamed rtsp \u0628\u0627\u06cc\u062f \u062f\u0631 \u0628\u0631\u06af\u0647 (Tab) \u067e\u06cc\u0634\u0631\u0641\u062a\u0647 \u062f\u0631 \u0641\u06cc\u0644\u062f \u0645\u0646\u0628\u0639 QT \u0627\u0636\u0627\u0641\u0647 \u0634\u0648\u062f.\\n\u0634\u0645\u0627 \u0628\u0627\u06cc\u062f \u0647\u0645\u0686\u0646\u06cc\u0646 \u06cc\u06a9 \u0646\u0633\u062e\u0647 \u063a\u06cc\u0631 streamed \u0631\u0627 \u062f\u0631 \u0641\u06cc\u0644\u062f \u0645\u0646\u0628\u0639 \u0627\u0636\u0627\u0641\u0647 \u0646\u0645\u0627\u0626\u06cc\u062f..",qtsrc:"\u0645\u0646\u0628\u0639 QT",progress:"\u067e\u06cc\u0634\u0631\u0641\u062a",sound:"\u0635\u062f\u0627",swstretchvalign:"\u06a9\u0634\u06cc\u062f\u0646 \u062a\u0631\u0627\u0632 \u0639\u0645\u0648\u062f\u06cc",swstretchhalign:"\u06a9\u0634\u06cc\u062f\u0646 \u062a\u0631\u0627\u0632 \u0627\u0641\u0642\u06cc",swstretchstyle:"\u06a9\u0634\u06cc\u062f\u0646 \u0627\u0633\u062a\u06cc\u0644",scriptcallbacks:"\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a Callbacks",align_top_right:"\u0628\u0627\u0644\u0627 \u0631\u0627\u0633\u062a",uimode:"\u062d\u0627\u0644\u062a UI",rate:"\u0646\u0631\u062e",playcount:"\u062a\u0639\u062f\u0627\u062f \u067e\u062e\u0634",defaultframe:"\u0641\u0631\u06cc\u0645 \u067e\u06cc\u0634\u0641\u0631\u0636",currentposition:"\u0645\u0648\u0642\u0639\u06cc\u062a \u0641\u0639\u0644\u06cc",currentmarker:"\u0646\u0634\u0627\u0646\u06af\u0631 \u0641\u0639\u0644\u06cc",captioningid:"\u0634\u0646\u0627\u0633\u0647 \u0639\u0646\u0648\u0627\u0646",baseurl:"URL \u067e\u0627\u06cc\u0647",balance:"\u062a\u0648\u0627\u0632\u0646 (Balance)",windowlessvideo:"\u0648\u06cc\u062f\u0626\u0648\u06cc \u06a9\u0645 \u067e\u0646\u062c\u0631\u0647",stretchtofit:"\u06a9\u0634\u06cc\u062f\u0646 \u062c\u0647\u062a \u06af\u0646\u062c\u0627\u0646\u062f\u0646 \u06a9\u0627\u0645\u0644",mute:"\u0628\u06cc \u0635\u062f\u0627",invokeurls:"Invoke URLs",fullscreen:"\u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647",enabled:"\u0641\u0639\u0627\u0644 \u0634\u062f\u0647",autostart:"\u0634\u0631\u0648\u0639 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9",volume:"\u0628\u0644\u0646\u062f\u06cc \u0635\u062f\u0627",target:"\u0645\u0642\u0635\u062f (Target)",qtsrcchokespeed:"\u0633\u0631\u0639\u062a Choke",href:"Href",endtime:"\u0632\u0645\u0627\u0646 \u067e\u0627\u06cc\u0627\u0646",starttime:"\u0632\u0645\u0627\u0646 \u0634\u0631\u0648\u0639",enablejavascript:"\u0641\u0639\u0627\u0644 \u0628\u0648\u062f\u0646 JavaScript",correction:"\u0628\u062f\u0648\u0646 \u062a\u0635\u062d\u06cc\u062d",targetcache:"\u06a9\u0634 \u0645\u0642\u0635\u062f (Target Cache)",playeveryframe:"\u067e\u062e\u0634 \u0647\u0631 \u0641\u0631\u06cc\u0645 (Frame)",kioskmode:"\u062d\u0627\u0644\u062a Kiosk",controller:"\u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647",menu:"\u0646\u0645\u0627\u06cc\u0634 \u0645\u0646\u0648",loop:"\u062d\u0644\u0642\u0647 (Loop)",play:"\u067e\u062e\u0634 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9",hspace:"\u0641\u0627\u0635\u0644\u0647 \u0627\u0641\u0642\u06cc",vspace:"\u0641\u0627\u0635\u0644\u0647 \u0639\u0645\u0648\u062f\u06cc",class_name:"\u06a9\u0644\u0627\u0633",name:"\u0646\u0627\u0645",id:"\u0634\u0646\u0627\u0633\u0647",type:"\u0646\u0648\u0639",size:"\u0627\u0628\u0639\u0627\u062f",preview:"\u067e\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634",constrain_proportions:"\u062d\u0641\u0638 \u062a\u0646\u0627\u0633\u0628",controls:"\u06a9\u0646\u062a\u0631\u0644 \u0647\u0627",numloop:"\u062a\u0639\u062f\u0627\u062f \u062d\u0644\u0642\u0647 \u0647\u0627",console:"\u06a9\u0646\u0633\u0648\u0644",cache:"\u06a9\u0634",autohref:"HREF \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9",liveconnect:"\u0627\u0631\u062a\u0628\u0627\u0637 SWLive",flashvars:"\u0645\u062a\u063a\u06cc\u0631\u0647\u0627\u06cc Flash",base:"\u067e\u0627\u06cc\u0647 (Base)",bgcolor:"\u0632\u0645\u06cc\u0646\u0647",wmode:"WMode",salign:"SAlign",align:"\u062a\u0631\u0627\u0632",scale:"\u0645\u0642\u06cc\u0627\u0633",quality:"\u06a9\u06cc\u0641\u06cc\u062a",shuffle:"\u062f\u0631 \u0647\u0645 \u0622\u0645\u06cc\u062e\u062a\u0646",prefetch:"\u067e\u06cc\u0634 \u0648\u0627\u06a9\u0634\u06cc",nojava:"\u0628\u062f\u0648\u0646 java",maintainaspect:"\u062d\u0641\u0638 \u062a\u0646\u0627\u0633\u0628 \u0648\u062c\u0648\u0647",imagestatus:"\u0648\u0636\u0639\u06cc\u062a \u062a\u0635\u0648\u06cc\u0631",center:"\u0648\u0633\u0637",autogotourl:"\u0631\u0641\u062a\u0646 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9 \u0628\u0647 URL",shockwave_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a Shockwave",rmp_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a Real media player",wmp_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a Windows media player",qt_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a Quicktime",flash_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0641\u0644\u0634",hidden:"\u0645\u062e\u0641\u06cc",align_bottom_left:"\u067e\u0627\u06cc\u06cc\u0646 \u0686\u067e",align_bottom_right:"\u067e\u0627\u06cc\u06cc\u0646 \u0631\u0627\u0633\u062a",flv_options:"\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0648\u06cc\u062f\u0626\u0648\u06cc \u0641\u0644\u0634",flv_scalemode:"\u062d\u0627\u0644\u062a \u0645\u0642\u06cc\u0627\u0633",flv_buffer:"\u0628\u0627\u0641\u0631 (Buffer)",flv_startimage:"\u062a\u0635\u0648\u06cc\u0631 \u0634\u0631\u0648\u0639",flv_starttime:"\u0632\u0645\u0627\u0646 \u0634\u0631\u0648\u0639",flv_defaultvolume:"\u0628\u0644\u0646\u062f\u06cc \u0635\u062f\u0627\u06cc \u067e\u06cc\u0634\u0641\u0631\u0636",flv_hiddengui:"GUI \u0645\u062e\u0641\u06cc",flv_autostart:"\u0634\u0631\u0648\u0639 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9",flv_loop:"\u062d\u0644\u0642\u0647 (Loop)",flv_showscalemodes:"\u0646\u0645\u0627\u06cc\u0634 \u062d\u0627\u0644\u062a \u0647\u0627\u06cc \u0645\u0642\u06cc\u0627\u0633",flv_smoothvideo:"\u0648\u06cc\u062f\u0626\u0648\u06cc \u0635\u0627\u0641",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/fi_dlg.js b/js/tiny_mce/plugins/media/langs/fi_dlg.js new file mode 100755 index 000000000..d950a0ceb --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.media_dlg',{list:"Lista",file:"Tiedosto/URL",advanced:"Edistyneet",general:"Yleiset",title:"Lis\u00e4\u00e4/muokkaa upotettua mediaa",align_top_left:"Yl\u00e4-vasemmalla",align_center:"Keskell\u00e4",align_left:"Vasemmalla",align_bottom:"Alhaalla",align_right:"Oikealla",align_top:"Ylh\u00e4\u00e4ll\u00e4",qt_stream_warn:"Streamatut rtsp-resurssit tulisi lis\u00e4t\u00e4 QT Src -kentt\u00e4\u00e4n edistynyt-v\u00e4lilehdelle.\\nSinun kannattaa lis\u00e4t\u00e4 my\u00f6s ei-streamattu versio Src-kentt\u00e4\u00e4n.",qtsrc:"QT Src",progress:"Eteneminen",sound:"\u00c4\u00e4ni",swstretchvalign:"Venyt\u00e4 pystysuunnassa",swstretchhalign:"Venyt\u00e4 vaakasuunnassa",swstretchstyle:"Venytystyyli",scriptcallbacks:"Skriptin takaisinkutsut",align_top_right:"Yl\u00e4-oikealla",uimode:"UI-moodi",rate:"Rate",playcount:"Toistolaskin",defaultframe:"Oletusruutu",currentposition:"T\u00e4m\u00e4nhetkinen sijainti",currentmarker:"T\u00e4m\u00e4nhetkinen merkki",captioningid:"Otsikointi-id",baseurl:"Perus URL-osoitteet",balance:"Tasapaino",windowlessvideo:"Ikkunaton video",stretchtofit:"Venyt\u00e4 sopimaan",mute:"Hiljennys",invokeurls:"Kutsu URL-osoitteet",fullscreen:"Kokoruutu",enabled:"P\u00e4\u00e4ll\u00e4",autostart:"Automaattinen aloitus",volume:"\u00c4\u00e4nen voimakkuus",target:"Kohde",qtsrcchokespeed:"Choke-nopeus",href:"Href",endtime:"Lopetusaika",starttime:"Aloitusaika",enablejavascript:"Salli JavaScript",correction:"Ei korjausta",targetcache:"Kohteen v\u00e4limuisti",playeveryframe:"Toista jokainen ruutu",kioskmode:"Kioskitila",controller:"Ohjain",menu:"N\u00e4yt\u00e4 valikko",loop:"Silmukka",play:"Automaattinen toisto",hspace:"Vaakatason tila",vspace:"Pystytason tila",class_name:"Luokka",name:"Nimi",id:"Tunniste",type:"Tyyppi",size:"Mitat",preview:"Esikatselu",constrain_proportions:"S\u00e4ilyt\u00e4 mittasuhteet",controls:"Kontrollit",numloop:"Toistojen m\u00e4\u00e4r\u00e4",console:"Konsoli",cache:"V\u00e4limuisti",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash-muuttujat",base:"Perusta",bgcolor:"Tausta",wmode:"WMode",salign:"SAlign",align:"Tasaus",scale:"Skaala",quality:"Laatu",shuffle:"Sekoita",prefetch:"Esinouda",nojava:"Ei Javaa",maintainaspect:"S\u00e4ilyt\u00e4 kuvasuhde",imagestatus:"Kuvan tila",center:"Keskit\u00e4",autogotourl:"Mene automaattisesti URL:iin",shockwave_options:"Shockwaven asetukset",rmp_options:"Real media playerin asetukset",wmp_options:"Windows media playerin asetukset",qt_options:"Quicktimen asetukset",flash_options:"Flashin asetukset",hidden:"Piilotettu",align_bottom_left:"Ala-vasemmalla",align_bottom_right:"Ala-oikealla",flv_options:"Flash videon asetukset",flv_scalemode:"Skaalausmoodi",flv_buffer:"Puskuri",flv_startimage:"Aloituskuva",flv_starttime:"Aloitusaika",flv_defaultvolume:"Oletus\u00e4\u00e4nenpaine",flv_hiddengui:"Piilotettu k\u00e4ytt\u00f6liittym\u00e4",flv_autostart:"Automaattinen aloitus",flv_loop:"Silmukka",flv_showscalemodes:"N\u00e4yt\u00e4 skaalausmoodit",flv_smoothvideo:"Smoothi video",flv_jscallback:"JS takaisinkutsu",html5_video_options:"HTML5 videoasetukset",altsource1:"Vaihtoehtoinen l\u00e4hde 1",altsource2:"Vaihtoehtoinen l\u00e4hde 2",preload:"Esilataa",poster:"Posteri",source:"L\u00e4hde"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/fr_dlg.js b/js/tiny_mce/plugins/media/langs/fr_dlg.js new file mode 100755 index 000000000..4a3f5d4a7 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.media_dlg',{list:"Liste",file:"Fichier / URL",advanced:"Avanc\u00e9",general:"G\u00e9n\u00e9ral",title:"Ins\u00e9rer / \u00e9diter un fichier m\u00e9dia",align_top_left:"En haut \u00e0 gauche",align_center:"Centr\u00e9",align_left:"Gauche",align_bottom:"Bas",align_right:"Droite",align_top:"Haut",qt_stream_warn:"Les ressources rtsp en streaming doivent \u00eatre ajout\u00e9es au champ \u00ab Source QT \u00bb dans l\'onglet avanc\u00e9.\\nVous devriez aussi ajouter une version n\'\u00e9tant pas en streaming au champ \u00ab source QT \u00bb.",qtsrc:"Source QT",progress:"Progression",sound:"Son",swstretchvalign:"Stretch vertical",swstretchhalign:"Stretch horizontal",swstretchstyle:"Stretch style",scriptcallbacks:"Callback de script",align_top_right:"En haut \u00e0 droite",uimode:"Mode UI",rate:"Taux",playcount:"Compteur",defaultframe:"Image par d\u00e9faut",currentposition:"Position actuelle",currentmarker:"Marqueur actuel",captioningid:"ID sous-titrage",baseurl:"Adresse de base",balance:"Balance",windowlessvideo:"Vid\u00e9o sans fen\u00eatre",stretchtofit:"\u00c9tendre pour adapter la taille",mute:"Muet",invokeurls:"Invoquer URLs",fullscreen:"Plein \u00e9cran",enabled:"Activ\u00e9",autostart:"Lire automatiquement",volume:"Volume",target:"Cible",qtsrcchokespeed:"D\u00e9bit maximum",href:"Href",endtime:"Fin",starttime:"D\u00e9but",enablejavascript:"Activer le JavaScript",correction:"Pas de correction",targetcache:"Cache cible",playeveryframe:"Jouer toutes les images",kioskmode:"Mode kiosque",controller:"Contr\u00f4leur",menu:"Afficher le menu",loop:"Lire en boucle",play:"Lecture automatique",hspace:"Espacement horizontal",vspace:"Espacement vertical",class_name:"Classe",name:"Nom",id:"Id",type:"Type",size:"Dimensions",preview:"Pr\u00e9visualisation",constrain_proportions:"Conserver les proportions",controls:"Contr\u00f4les",numloop:"Nombre de tours",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Variables flash",base:"Base",bgcolor:"Fond",wmode:"WMode",salign:"SAlign",align:"Alignement",scale:"\u00c9chelle",quality:"Qualit\u00e9",shuffle:"Al\u00e9atoire",prefetch:"Pr\u00e9chargement",nojava:"Pas java",maintainaspect:"Maintenir l\'aspect",imagestatus:"Statut de l\'image",center:"Centrer",autogotourl:"Aller automatiquement \u00e0 l\'URL",shockwave_options:"Options Shockwave",rmp_options:"Options Real media player",wmp_options:"Windows media player options",qt_options:"Options Quicktime",flash_options:"Options Flash",hidden:"Cach\u00e9",align_bottom_left:"En bas \u00e0 gauche",align_bottom_right:"En bas \u00e0 droite",flv_options:"Options de la vid\u00e9o Flash",flv_scalemode:"\u00c9chelle",flv_buffer:"Tampon",flv_startimage:"Image de d\u00e9marrage",flv_starttime:"Temps au d\u00e9but",flv_defaultvolume:"Volume par d\u00e9faut",flv_hiddengui:"Interface utilisateur cach\u00e9e",flv_autostart:"D\u00e9marrage automatique",flv_loop:"En boucle",flv_showscalemodes:"Montrer les diff\u00e9rentes \u00e9chelles",flv_smoothvideo:"Vid\u00e9o adoucie",flv_jscallback:"Callback JavaScript",html5_video_options:"Options Vid\u00e9o HTML 5",altsource1:"Source alternative 1",altsource2:"Source alternative 2",preload:"Pr\u00e9chargement",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/gl_dlg.js b/js/tiny_mce/plugins/media/langs/gl_dlg.js new file mode 100755 index 000000000..14a05f8b1 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.media_dlg',{list:"Lista",file:"Arquivo/URL",advanced:"Avanzado",general:"Xeral",title:"Insertar/editar medio embebido",align_top_left:"Arriba Izda.",align_center:"Centrado",align_left:"Esquerda",align_bottom:"Abaixo",align_right:"Dereita",align_top:"Arriba",qt_stream_warn:"Os recursos rtsp de Streaming deber\u00edan engadirse no campo QT Src da pesta\u00f1a avanzada.\\nAdem\u00e1is deber\u00eda engadir unha versi\u00f3n no Streaming no campo Src.",qtsrc:"QT Src",progress:"Progreso",sound:"Son",swstretchvalign:"Esturar ali\u00f1. V.",swstretchhalign:"Estirar ali\u00f1. H.",swstretchstyle:"Estilo estiramento",scriptcallbacks:"Script callbacks",align_top_right:"Arriba Dta.",uimode:"Modo UI",rate:"Relaci\u00f3n",playcount:"Cantas reproducci\u00f3ns",defaultframe:"Frame predet.",currentposition:"Posici\u00f3n actual",currentmarker:"Marcador actual",captioningid:"Id de lenda",baseurl:"URL Base",balance:"Balance",windowlessvideo:"Video sen vent\u00e1",stretchtofit:"Estirar pra axustar",mute:"Silencio",invokeurls:"Invocar URLs",fullscreen:"Pantalla Completa",enabled:"Habilitado",autostart:"Comezo Autom\u00e1tico",volume:"Volume",target:"Obxetivo",qtsrcchokespeed:"Vel. de choque",href:"Href",endtime:"Fin",starttime:"Inicio",enablejavascript:"Habilitar JavaScript",correction:"Sen correci\u00f3n",targetcache:"Obxetivo cache",playeveryframe:"Reproducir t\u00f3dolos frames",kioskmode:"Modo kiosco",controller:"Controller",menu:"Mostrar Men\u00fa",loop:"Repetitivo",play:"Comezo Autom\u00e1tico",hspace:"Espacio H.",vspace:"Espacio V.",class_name:"Clase",name:"Nome",id:"Id",type:"Tipo",size:"Tama\u00f1o",preview:"Vista Previa",constrain_proportions:"Bloquear proporci\u00f3ns",controls:"Controis",numloop:"N\u00fam. repetici\u00f3ns",console:"Consola",cache:"Cach\u00e9",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Fondo",wmode:"WMode",salign:"SAlign",align:"Ali\u00f1aci\u00f3n",scale:"Escala",quality:"Calidade",shuffle:"Aleatorio",prefetch:"PreBusca",nojava:"No java",maintainaspect:"Manter aspecto",imagestatus:"Estado de imaxe",center:"Centrado",autogotourl:"Ir a URL autom\u00e1t.",shockwave_options:"Opci\u00f3ns Shockwave",rmp_options:"Opci\u00f3ns Real media player",wmp_options:"Opci\u00f3ns Windows media player",qt_options:"Opci\u00f3ns Quicktime",flash_options:"Opci\u00f3ns Flash",hidden:"Oculto",align_bottom_left:"Abaixo Izda.",align_bottom_right:"Abaixo Dta.",flv_options:"Opci\u00f3ns Video Flash",flv_scalemode:"Modo escalado",flv_buffer:"Buffer",flv_startimage:"Imaxe inicio",flv_starttime:"Tempo inicio",flv_defaultvolume:"Volume predet.",flv_hiddengui:"Ocultar GUI",flv_autostart:"Inicio auto.",flv_loop:"Repetitivo",flv_showscalemodes:"Mostrar modos escala",flv_smoothvideo:"Video suave",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/gu_dlg.js b/js/tiny_mce/plugins/media/langs/gu_dlg.js new file mode 100755 index 000000000..c666774a4 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/he_dlg.js b/js/tiny_mce/plugins/media/langs/he_dlg.js new file mode 100755 index 000000000..15ca07ac5 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.media_dlg',{list:"\u05e8\u05e9\u05d9\u05de\u05d4",file:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d5\u05d1\u05e5",advanced:"\u05de\u05ea\u05e7\u05d3\u05dd",general:"\u05db\u05dc\u05dc\u05d9",title:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05e8\u05d8\u05d5\u05df",align_top_left:"\u05e9\u05de\u05d0\u05dc \u05dc\u05de\u05e2\u05dc\u05d4",align_center:"\u05de\u05e8\u05db\u05d6",align_left:"\u05dc\u05e9\u05de\u05d0\u05dc",align_bottom:"\u05dc\u05de\u05d8\u05d4",align_right:"\u05d9\u05de\u05d9\u05df",align_top:"\u05dc\u05de\u05e2\u05dc\u05d4",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"\u05d4\u05ea\u05e7\u05d3\u05de\u05d5\u05ea",sound:"\u05e6\u05dc\u05d9\u05dc",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"\u05d9\u05de\u05d9\u05df \u05dc\u05de\u05e2\u05dc\u05d4",uimode:"\u05de\u05e6\u05d1 \u05ea\u05e6\u05d5\u05d2\u05d4",rate:"\u05e7\u05e6\u05d1",playcount:"\u05de\u05e1\u05e4\u05e8 \u05d4\u05e9\u05de\u05e2\u05d5\u05ea",defaultframe:"Default frame",currentposition:"\u05de\u05d9\u05e7\u05d5\u05dd \u05e0\u05d5\u05db\u05d7\u05d9",currentmarker:"\u05e1\u05de\u05df \u05e0\u05d5\u05db\u05d7\u05d9",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"\u05de\u05ea\u05d7 \u05dc\u05d4\u05ea\u05d0\u05de\u05d4",mute:"\u05d4\u05e9\u05ea\u05e7",invokeurls:"Invoke URLs",fullscreen:"\u05de\u05e1\u05da \u05de\u05dc\u05d0",enabled:"\u05de\u05d5\u05e4\u05e2\u05dc",autostart:"\u05d4\u05ea\u05d7\u05dc \u05d0\u05d5\u05d8\u05d5\u05de\u05d8\u05d9\u05ea",volume:"\u05e2\u05d5\u05e6\u05de\u05d4",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"\u05d4\u05e6\u05d2\u05ea \u05ea\u05e4\u05e8\u05d9\u05d8",loop:"\u05e0\u05d2\u05d9\u05e0\u05d4 \u05de\u05d7\u05d6\u05d5\u05e8\u05d9\u05ea",play:"\u05e0\u05d2\u05d9\u05e0\u05d4 \u05d0\u05d5\u05d8\u05d5\u05de\u05d8\u05d9\u05ea \u05e2\u05dd \u05d4\u05d8\u05e2\u05d9\u05e0\u05d4",hspace:"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9",vspace:"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9",class_name:"Class",name:"Name",id:"Id",type:"\u05e1\u05d5\u05d2",size:"\u05e8\u05d5\u05d7\u05d1 \u05d5\u05d2\u05d5\u05d1\u05d4",preview:"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05d4",constrain_proportions:"\u05e9\u05de\u05d5\u05e8 \u05e2\u05dc \u05e4\u05e8\u05d5\u05e4\u05d5\u05e8\u05e6\u05d9\u05d5\u05ea",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"\u05d0\u05d9\u05db\u05d5\u05ea \u05d4\u05e1\u05e8\u05d8\u05d5\u05df",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"\u05de\u05e8\u05db\u05d6",autogotourl:"Auto goto URL",shockwave_options:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea Shockwave",rmp_options:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea \u05e0\u05d2\u05df Real Media",wmp_options:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea \u05de\u05d3\u05d9\u05d4 \u05e4\u05dc\u05d9\u05d9\u05e8",qt_options:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea Quicktime",flash_options:"\u05d0\u05e4\u05e9\u05e8\u05d5\u05d9\u05d5\u05ea \u05e4\u05dc\u05d0\u05e9",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback",html5_video_options:"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/hi_dlg.js b/js/tiny_mce/plugins/media/langs/hi_dlg.js new file mode 100755 index 000000000..21619d699 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/hr_dlg.js b/js/tiny_mce/plugins/media/langs/hr_dlg.js new file mode 100755 index 000000000..f80bcfaa9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/hu_dlg.js b/js/tiny_mce/plugins/media/langs/hu_dlg.js new file mode 100755 index 000000000..7cf8c9558 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.media_dlg',{list:"Lista",file:"F\u00e1jl/URL",advanced:"Halad\u00f3",general:"\u00c1ltal\u00e1nos",title:"Be\u00e1gyazott m\u00e9dia besz\u00far\u00e1sa/szerkeszt\u00e9se","align_top_left":"Bal-fent","align_center":"K\u00f6z\u00e9pen","align_left":"Balra","align_bottom":"Lent","align_right":"Jobbra","align_top":"Fent","qt_stream_warn":"Streamelt rtsp forr\u00e1sok a QT Src mez\u0151be val\u00f3k a halad\u00f3 lapon.\\nHozz\u00e1 kellene adnia egy nem streamelt verzi\u00f3t a Src mez\u0151ben.",qtsrc:"QT Src",progress:"Folymat",sound:"Hang",swstretchvalign:"Ny\u00fajt\u00e1s F-igaz\u00edt\u00e1s",swstretchhalign:"Ny\u00fajt\u00e1s V-igaz\u00edt\u00e1s",swstretchstyle:"Ny\u00fajt\u00e1s st\u00edlus",scriptcallbacks:"Script callbacks","align_top_right":"Jobb-fent",uimode:"UI M\u00f3d",rate:"Rate",playcount:"Lej\u00e1tsz\u00e1ssz\u00e1m",defaultframe:"Alap\u00e9rtelmezett frame",currentposition:"Aktu\u00e1lis poz\u00edci\u00f3",currentmarker:"Aktu\u00e1lis marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Ablak n\u00e9lk\u00fcli vide\u00f3",stretchtofit:"Ny\u00fajtva igaz\u00edt\u00e1s",mute:"N\u00e9ma",invokeurls:"URL-ek bevon\u00e1sa",fullscreen:"Teljes k\u00e9perny\u0151",enabled:"Enged\u00e9lyezve",autostart:"Automatikus kezd\u00e9s",volume:"Hanger\u0151",target:"C\u00e9l",qtsrcchokespeed:"Folyt\u00e1s sebess\u00e9ge",href:"Href",endtime:"Z\u00e1r\u00f3 id\u0151",starttime:"Kezd\u00e9si id\u0151",enablejavascript:"JavaScript enged\u00e9se",correction:"Nincs jav\u00edt\u00e1s",targetcache:"C\u00e9l cache",playeveryframe:"Minden kocka lej\u00e1tsz\u00e1sa",kioskmode:"Kiosk m\u00f3d",controller:"Vez\u00e9rl\u0151",menu:"Men\u00fc mutat\u00e1sa",loop:"Ism\u00e9tl\u00e9s",play:"Automatikus lej\u00e1tsz\u00e1s",hspace:"V-t\u00e1v",vspace:"F-t\u00e1v","class_name":"Oszt\u00e1ly",name:"N\u00e9v",id:"Id",type:"T\u00edpus",size:"Dimenzi\u00f3k",preview:"El\u0151n\u00e9zet","constrain_proportions":"Ar\u00e1nytart\u00e1s",controls:"Kezel\u0151k",numloop:"Ism\u00e9tl\u00e9ssz\u00e1m",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"H\u00e1tt\u00e9r",wmode:"WM\u00f3d",salign:"SElrendez\u00e9s",align:"Elrendez\u00e9s",scale:"Nagy\u00edt\u00e1s",quality:"Min\u0151s\u00e9g",shuffle:"V\u00e9letlenszer\u0171",prefetch:"El\u0151t\u00f6lt\u00e9s",nojava:"Nincs java",maintainaspect:"Ar\u00e1nytart\u00e1s",imagestatus:"K\u00e9p \u00e1llapot",center:"K\u00f6z\u00e9pre",autogotourl:"Automatikus URL-re ugr\u00e1s","shockwave_options":"Shockwave be\u00e1ll\u00edt\u00e1sai","rmp_options":"Real media player be\u00e1ll\u00edt\u00e1sai","wmp_options":"Windows media player be\u00e1ll\u00edt\u00e1sai","qt_options":"Quicktime be\u00e1ll\u00edt\u00e1sai","flash_options":"Flash be\u00e1ll\u00edt\u00e1sai",hidden:"Rejtett","align_bottom_left":"Bal-lent","align_bottom_right":"Bal-jobbra","flv_options":"Flash vide\u00f3 be\u00e1ll\u00edt\u00e1sai","flv_scalemode":"Nagy\u00edt\u00e1s m\u00f3d","flv_buffer":"Buffer","flv_startimage":"Start k\u00e9p","flv_starttime":"Start id\u0151","flv_defaultvolume":"Alap\u00e9rtelmezett hanger\u0151","flv_hiddengui":"Rejtett GUI","flv_autostart":"Aut\u00f3 start","flv_loop":"Ism\u00e9tl\u00e9s","flv_showscalemodes":"Nagy\u00edt\u00e1si m\u00f3dok mutat\u00e1sa","flv_smoothvideo":"Vide\u00f3 sim\u00edt\u00e1sa","flv_jscallback":"JS Callback","html5_video_options":"HTML5 Video be\u00e1ll\u00edt\u00e1sok",altsource1:"Alternat\u00edv forr\u00e1s 1",altsource2:"Alternat\u00edv forr\u00e1s 2",preload:"El\u0151t\u00f6lt\u00e9s",poster:"Hozz\u00e1ad\u00f3",source:"Forr\u00e1s"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/hy_dlg.js b/js/tiny_mce/plugins/media/langs/hy_dlg.js new file mode 100755 index 000000000..0d7dd886d --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.media_dlg',{list:"\u0421\u043f\u0438\u0441\u043e\u043a",file:"\u0424\u0430\u0439\u043b / URL",advanced:"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e",general:"\u041e\u0431\u0449\u0435\u0435",title:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c / \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab \\ nYou should also add a non streamed version to the Src field ..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"\u0411\u0430\u043b\u0430\u043d\u0441",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"\u0410\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442",volume:"\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u044e",loop:"\u041b\u0443\u043f",play:"\u0410\u0432\u0442\u043e\u043f\u043b\u0435\u0439",hspace:"\u0433\u043e\u0440. \u043e\u0442\u0441\u0442\u0443\u043f",vspace:"\u0432\u0435\u0440\u0442. \u043e\u0442\u0441\u0442\u0443\u043f",class_name:"\u041a\u043b\u0430\u0441\u0441",name:"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435",id:"Id",type:"\u0422\u0438\u043f",size:"\u0420\u0430\u0437\u043c\u0435\u0440\u044b",preview:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",constrain_proportions:"\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438",controls:"Controls",numloop:"Num loops",console:"Console",cache:"\u041a\u044d\u0448",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"\u0424\u043e\u043d",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ia_dlg.js b/js/tiny_mce/plugins/media/langs/ia_dlg.js new file mode 100755 index 000000000..b03a3c7d9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6/\u5730\u5740",advanced:"\u9ad8\u7ea7",general:"\u57fa\u672c",title:"\u63d2\u5165/\u7f16\u8f91 \u5a92\u4f53",align_top_left:"\u9876\u90e8\u5c45\u5de6",align_center:"\u5c45\u4e2d",align_left:"\u5c45\u5de6",align_bottom:"\u5e95\u90e8",align_right:"\u5c45\u53f3",align_top:"\u9876\u90e8",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u7f29\u653e\u81f3\u5782\u76f4\u5bf9\u9f50",swstretchhalign:"\u7f29\u653e\u81f3\u6c34\u5e73\u5bf9\u9f50",swstretchstyle:"\u7f29\u653e\u6837\u5f0f",scriptcallbacks:"\u811a\u672c\u56de\u6863",align_top_right:"\u9876\u90e8\u5c45\u53f3",uimode:"UI \u6a21\u5f0f",rate:"\u7801\u7387",playcount:"\u64ad\u653e\u6b21\u6570",defaultframe:"\u9ed8\u8ba4\u5e27",currentposition:"\u5f53\u524d\u4f4d\u7f6e",currentmarker:"\u5f53\u524d\u6807\u7b7e",captioningid:"\u5b57\u5e55 id",baseurl:"Base URL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u7a97\u53e3\u89c6\u9891",stretchtofit:"\u7f29\u653e\u81f3\u5408\u9002\u5927\u5c0f",mute:"\u9759\u97f3",invokeurls:"\u8c03\u7528\u7684URLs",fullscreen:"\u5168\u5c4f\u5e55",enabled:"\u542f\u7528",autostart:"\u81ea\u52a8\u5f00\u59cb",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528 JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u9010\u5e27\u64ad\u653e",kioskmode:"Kiosk \u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u83dc\u5355",loop:"\u5faa\u73af",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",class_name:"\u7c7b\u540d",name:"\u540d\u79f0",id:"Id",type:"\u7c7b\u578b",size:"\u5927\u5c0f",preview:"\u9884\u89c8",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",controls:"\u63a7\u5236",numloop:"\u5faa\u73af\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash\u53d8\u6570",base:"\u57fa\u7ebf",bgcolor:"\u80cc\u666f\u8272",wmode:"WMode",salign:"SAlign",align:"\u5bf9\u9f50",scale:"\u7f29\u653e",quality:"\u54c1\u8d28",shuffle:"\u968f\u673a",prefetch:"\u9884\u8bfb",nojava:"No java",maintainaspect:"\u7ef4\u62a4\u72b6\u6001",imagestatus:"\u56fe\u50cf\u72b6\u6001",center:"\u5c45\u4e2d",autogotourl:"\u81ea\u52a8\u8df3\u8f6c URL",shockwave_options:"Shockwave \u9009\u9879",rmp_options:"Real media player \u9009\u9879",wmp_options:"Windows media player \u9009\u9879",qt_options:"Quicktime \u9009\u9879",flash_options:"Flash \u9009\u9879",hidden:"\u9690\u85cf",align_bottom_left:"\u5e95\u90e8\u5c45\u5de6",align_bottom_right:"\u5e95\u90e8\u5c45\u53f3",flv_options:"Flash \u89c6\u9891\u9009\u9879",flv_scalemode:"\u7f29\u653e\u6a21\u5f0f",flv_buffer:"\u7f13\u51b2",flv_startimage:"\u5f00\u59cb\u56fe\u50cf",flv_starttime:"\u5f00\u59cb\u65f6\u95f4",flv_defaultvolume:"\u9ed8\u8ba4\u58f0\u97f3",flv_hiddengui:"\u9690\u85cfGUI",flv_autostart:"\u81ea\u52a8\u5f00\u59cb",flv_loop:"\u5faa\u73af",flv_showscalemodes:"\u663e\u793a\u7f29\u653e\u6a21\u5f0f",flv_smoothvideo:"\u5e73\u6ed1\u89c6\u9891",flv_jscallback:"JS \u56de\u6a94"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/id_dlg.js b/js/tiny_mce/plugins/media/langs/id_dlg.js new file mode 100755 index 000000000..a5781c4c0 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Atas Kiri",align_center:"Tengah",align_left:"Kiri",align_bottom:"Bawah",align_right:"Kanan",align_top:"Atas",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Atas Kanan",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bawah Kiri",align_bottom_right:"Bawah kanan",flv_options:"Opsi Flash video",flv_scalemode:"Mode Skala",flv_buffer:"Buffer",flv_startimage:"Gambar Mulai",flv_starttime:"Waktu mulai",flv_defaultvolume:"Volume suara default",flv_hiddengui:"GUI tersembunyi",flv_autostart:"Mulai otomatis",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ii_dlg.js b/js/tiny_mce/plugins/media/langs/ii_dlg.js new file mode 100755 index 000000000..6f26ec23b --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ii_dlg.js @@ -0,0 +1,103 @@ +tinyMCE.addI18n('ii.media_dlg',{ +title:"\u63D2\u5165/\u7F16\u8F91\u5D4C\u5165\u5A92\u4F53", +general:"\u4E00\u822C", +advanced:"\u9AD8\u7EA7", +file:"\u6587\u4EF6/\u7F51\u5740", +list:"\u5217\u8868", +size:"\u5C3A\u5BF8", +preview:"\u9884\u89C8", +constrain_proportions:"\u4FDD\u6301\u6BD4\u4F8B", +type:"\u7C7B\u578B", +id:"Id", +name:"\u540D\u79F0", +class_name:"\u7C7B\u578B", +vspace:"\u6C34\u51C6\u95F4\u8DDD", +hspace:"\u5782\u76F4\u95F4\u8DDD", +play:"\u81EA\u52A8\u64AD\u653E", +loop:"\u56DE\u5708\u64AD\u653E", +menu:"\u663E\u793A\u529F\u80FD\u8868", +quality:"\u54C1\u8D28", +scale:"\u6BD4\u4F8B", +align:"\u5BF9\u9F50", +salign:"SAlign", +wmode:"\u7A97\u53E3\u6A21\u5F0F", +bgcolor:"\u80CC\u666F\u8272", +base:"\u57FA\u5E95", +flashvars:"\u53C2\u6570", +liveconnect:"SWLiveConnect", +autohref:"\u81EA\u52A8HREF", +cache:"\u7F13\u5B58", +hidden:"\u9690\u85CF", +controller:"\u63A7\u5236\u53F0", +kioskmode:"Kiosk\u6A21\u5F0F", +playeveryframe:"\u64AD\u653E\u6BCF\u4E00\u5E27", +targetcache:"\u76EE\u6807\u7F13\u5B58", +correction:"\u6CA1\u6709\u4FEE\u6B63", +enablejavascript:"\u542F\u7528JavaScript", +starttime:"\u5F00\u59CB\u65F6\u95F4", +endtime:"\u7ED3\u675F\u65F6\u95F4", +href:"\u8FDE\u7ED3", +qtsrcchokespeed:"Choke speed", +target:"\u76EE\u6807", +volume:"\u97F3\u91CF", +autostart:"\u81EA\u52A8\u5F00\u59CB", +enabled:"\u542F\u7528", +fullscreen:"\u5168\u5C4F", +invokeurls:"\u76F8\u5173URLs", +mute:"\u9759\u97F3", +stretchtofit:"\u62C9\u4F38", +windowlessvideo:"\u65E0\u8FB9\u6846", +balance:"\u5E73\u8861", +baseurl:"\u57FA\u51C6URL", +captioningid:"Captioning id", +currentmarker:"\u5F53\u524D\u6807\u8BB0", +currentposition:"\u5F53\u524D\u4F4D\u7F6E", +defaultframe:"\u9ED8\u8BA4\u5E27", +playcount:"\u64AD\u653E\u8BA1\u6570", +rate:"\u5E27\u7387", +uimode:"\u9762\u677F\u6A21\u5F0F", +flash_options:"Flash\u9009\u9879", +qt_options:"Quicktime\u9009\u9879", +wmp_options:"Windows media player\u9009\u9879", +rmp_options:"Real media player\u9009\u9879", +shockwave_options:"Shockwave\u9009\u9879", +autogotourl:"\u81EA\u52A8\u8F6C\u5230URL", +center:"\u4E2D\u5FC3", +imagestatus:"\u56FE\u50CF\u72B6\u6001", +maintainaspect:"Maintain aspect", +nojava:"No java", +prefetch:"\u9884\u8BFB\u53D6", +shuffle:"Shuffle", +console:"\u63A7\u5236\u53F0", +numloop:"\u56DE\u5708\u6B21\u6570", +controls:"\u63A7\u5236\u5668", +scriptcallbacks:"\u811A\u672C\u56DE\u6863", +swstretchstyle:"\u62C9\u5347\u6A21\u5F0F", +swstretchhalign:"\u6C34\u51C6\u62C9\u5347", +swstretchvalign:"\u5782\u76F4\u62C9\u5347", +sound:"\u58F0\u97F3", +progress:"\u8FDB\u5EA6", +qtsrc:"QT Src", +qt_stream_warn:"\u6D41\u5F0Frtsp\u8D44\u6E90\u5E94\u8BE5\u6DFB\u52A0\u5230\u201C\u9AD8\u7EA7\u201D\u4E2DQT Src\u3002\n\u540C\u65F6\u6DFB\u52A0\u975E\u6D41\u5F0F\u8D44\u6E90\u5230Src\u3002", +align_top:"\u4E0A\u65B9", +align_right:"\u9760\u53F3", +align_bottom:"\u4E0B\u65B9", +align_left:"\u9760\u5DE6", +align_center:"\u4E2D\u95F4", +align_top_left:"\u5DE6\u4E0A", +align_top_right:"\u53F3\u4E0A", +align_bottom_left:"\u5DE6\u4E0B", +align_bottom_right:"\u53F3\u4E0B", +flv_options:"Flash\u89C6\u9891\u9009\u9879", +flv_scalemode:"Scale mode", +flv_buffer:"\u7F13\u51B2", +flv_startimage:"\u5F00\u59CB\u753B\u9762", +flv_starttime:"\u5F00\u59CB\u65F6\u95F4", +flv_defaultvolume:"\u9884\u8BBE\u97F3\u91CF", +flv_hiddengui:"\u9690\u85CFGUI", +flv_autostart:"\u81EA\u52A8\u64AD\u653E", +flv_loop:"\u56DE\u5708", +flv_showscalemodes:"Show scale modes", +flv_smoothvideo:"\u5E73\u6ED1\u56FE\u50CF", +flv_jscallback:"JS\u56DE\u6863" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/is_dlg.js b/js/tiny_mce/plugins/media/langs/is_dlg.js new file mode 100755 index 000000000..4d20a5cb4 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.media_dlg',{list:"Listi",file:"Skr\u00e1/Sl\u00f3\u00f0",advanced:"\u00cdtarlegt",general:"Almennt",title:"Setja inn / Breyta birtingu margmi\u00f0lunar",align_top_left:"Efst vinstri",align_center:"Mi\u00f0ja",align_left:"Vinstri",align_bottom:"Ne\u00f0st",align_right:"H\u00e6gri",align_top:"Efst",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Sta\u00f0a",sound:"Hlj\u00f3\u00f0",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Efst h\u00e6gri",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Upprunalegur rammi",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Gluggalaust myndband",stretchtofit:"Teigja til a\u00f0 passa",mute:"Dempa",invokeurls:"Virkja sl\u00f3\u00f0ir",fullscreen:"Heilskj\u00e1r",enabled:"Virkt",autostart:"Byrja sj\u00e1lfvirkt",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"S\u00fdna valmynd",loop:"Endurtaka",play:"Sj\u00e1lfvirk spilun",hspace:"L\u00e1r-bil",vspace:"L\u00f3\u00f0r-bil",class_name:"Flokkur",name:"Nafn",id:"Id",type:"Ger\u00f0",size:"V\u00edddir",preview:"Forsko\u00f0un",constrain_proportions:"Halda hlutf\u00f6llum",controls:"Stj\u00f3rn",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Bakgrunnur",wmode:"WMode",salign:"SAlign",align:"J\u00f6fnun",scale:"A\u00f0l\u00f6gun",quality:"G\u00e6\u00f0i",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"Ekkert java",maintainaspect:"Halda hlutf\u00f6llum",imagestatus:"Sta\u00f0a myndar",center:"Mi\u00f0ja",autogotourl:"Auto goto URL",shockwave_options:"Shockwave m\u00f6guleikar",rmp_options:"Real media player m\u00f6guleikar",wmp_options:"Windows media player m\u00f6guleikar",qt_options:"Quicktime m\u00f6guleikar",flash_options:"Flash m\u00f6guleikar",hidden:"Hidden",align_bottom_left:"Ne\u00f0st vinstri",align_bottom_right:"Ne\u00f0st h\u00e6gri",flv_options:"Flash m\u00f6guleikar",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/it_dlg.js b/js/tiny_mce/plugins/media/langs/it_dlg.js new file mode 100755 index 000000000..36e80448f --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.media_dlg',{list:"Lista",file:"File/URL",advanced:"Avanzate",general:"Generale",title:"Inserisci/modifica file multimediale",align_top_left:"Alto a sinistra",align_center:"Centro",align_left:"Sinistra",align_bottom:"Basso",align_right:"Destra",align_top:"Alto",qt_stream_warn:"Le risorse rstp \'streamed\' devono essere aggiunte al campo Sorgente QT nella tabella Avanzate.\\nSi dovrebbe inserire anche una versione non \'streamed\' al campo Sorgente..",qtsrc:"Sorgente QT",progress:"Avanzamento",sound:"Suono",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Alto a destra",uimode:"Modalit\u00e0 Interfaccia Utente",rate:"Qualit\u00e0",playcount:"Conteggio esecuzione",defaultframe:"frame predefinito",currentposition:"Posizione corrente",currentmarker:"Indicatore corrente",captioningid:"Didascalia dell\'Id",baseurl:"URL base",balance:"Bilanciamento",windowlessvideo:"Video senza finestra",stretchtofit:"Adatta dimensioni",mute:"Muto",invokeurls:"Invoca URLs",fullscreen:"Tutto schermo",enabled:"Abilitato",autostart:"Avvio automatico",volume:"Volume",target:"Target",qtsrcchokespeed:"Velocit\u00e0 cursore",href:"Href",endtime:"Ora fine",starttime:"Ora inizio",enablejavascript:"Abilita JavaScript",correction:"Nessuna correzione",targetcache:"Cache del target",playeveryframe:"Esegui ogni frame",kioskmode:"Modalit\u00e0 Kiosk",controller:"Controller",menu:"Mostra menu",loop:"Riproduzione ciclica",play:"Esecuzione automatica",hspace:"H-Space",vspace:"V-Space",class_name:"Classe",name:"Nome",id:"Id",type:"Tipo",size:"Dimensioni",preview:"Anteprima",constrain_proportions:"Mantieni proporzioni",controls:"Controlli",numloop:"Numero cicli",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Sfondo",wmode:"WMode",salign:"SAlign",align:"Allineamento",scale:"Scala",quality:"Qualit\u00e0",shuffle:"Shuffle",prefetch:"Precaricamento",nojava:"No java",maintainaspect:"Mantieni aspetto",imagestatus:"Stato immagine",center:"Centra",autogotourl:"Vai a URL automatico",shockwave_options:"Opzioni Shockwave",rmp_options:"Opzioni Real media player",wmp_options:"Opzioni Windows media player",qt_options:"Opzioni Quicktime",flash_options:"Opzioni Flash",hidden:"Nascosto",align_bottom_left:"Basso a sinistra",align_bottom_right:"Basso a destra",flv_options:"Opzioni video Flash",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Immagine avvio",flv_starttime:"Tempo avvio",flv_defaultvolume:"Volume predefinito",flv_hiddengui:"GUI nascosta",flv_autostart:"Avvio automatico",flv_loop:"Riproduzione ciclica",flv_showscalemodes:"Mostra scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ja_dlg.js b/js/tiny_mce/plugins/media/langs/ja_dlg.js new file mode 100755 index 000000000..5fa0f6436 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.media_dlg',{list:"\u4e00\u89a7\u304b\u3089\u9078\u3076",file:"\u30d5\u30a1\u30a4\u30eb/URL",advanced:"\u4e0a\u7d1a\u8005\u5411\u3051",general:"\u4e00\u822c",title:"\u57cb\u3081\u8fbc\u307f\u30e1\u30c7\u30a3\u30a2\u306e\u633f\u5165/\u7de8\u96c6","align_top_left":"\u5de6\u4e0a","align_center":"\u4e2d\u592e","align_left":"\u5de6","align_bottom":"\u4e0b","align_right":"\u53f3","align_top":"\u4e0a","qt_stream_warn":"rtsp\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u30ea\u30bd\u30fc\u30b9\u3092\u300c\u4e0a\u7d1a\u8005\u5411\u3051\u300d\u30bf\u30d6\u306e\u300cQT Src\u300d\u6b04\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n\u307e\u305f\u3001\u300cSrc\u300d\u6b04\u306b\u306f\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u3067\u306f\u306a\u3044\u30d0\u30fc\u30b8\u30e7\u30fc\u30f3\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",qtsrc:"QT Src",progress:"Progress",sound:"\u30b5\u30a6\u30f3\u30c9",swstretchvalign:"\u5782\u76f4\u4f4d\u7f6e",swstretchhalign:"\u6c34\u5e73\u4f4d\u7f6e",swstretchstyle:"\u4f38\u7e2e",scriptcallbacks:"\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u30a4\u30d9\u30f3\u30c8","align_top_right":"\u53f3\u4e0a",uimode:"UI\u8868\u793a\u30e2\u30fc\u30c9",rate:"\u518d\u751f\u30ec\u30fc\u30c8",playcount:"\u518d\u751f\u56de\u6570",defaultframe:"\u30c7\u30d5\u30a9\u30eb\u30c8\u30d5\u30ec\u30fc\u30e0",currentposition:"\u518d\u751f\u4f4d\u7f6e\uff08\u79d2\u5358\u4f4d\uff09",currentmarker:"\u30de\u30fc\u30ab\u30fc\u756a\u53f7",captioningid:"\u30ad\u30e3\u30d7\u30b7\u30e7\u30f3\u8868\u793a\u8981\u7d20ID",baseurl:"Base URL",balance:"\u30b9\u30c6\u30ec\u30aa\u306e\u30d0\u30e9\u30f3\u30b9",windowlessvideo:"windowless\u30e2\u30fc\u30c9",stretchtofit:"\u81ea\u52d5\u30b5\u30a4\u30ba\u5909\u66f4",mute:"\u30df\u30e5\u30fc\u30c8",invokeurls:"URL\u3092\u958b\u304f",fullscreen:"\u30d5\u30eb\u30b9\u30af\u30ea\u30fc\u30f3",enabled:"\u6709\u52b9\u306b\u3059\u308b",autostart:"\u81ea\u52d5\u518d\u751f",volume:"\u97f3\u91cf",target:"\u30bf\u30fc\u30b2\u30c3\u30c8",qtsrcchokespeed:"\u518d\u751f\u30c7\u30fc\u30bf\u30ec\u30fc\u30c8",href:"\u30ea\u30f3\u30af\u5148URL",endtime:"\u7d42\u4e86\u30d5\u30ec\u30fc\u30e0",starttime:"\u958b\u59cb\u30d5\u30ec\u30fc\u30e0",enablejavascript:"JavaScript\u3092\u6709\u52b9\u306b\u3059\u308b",correction:"No correction",targetcache:"\u30bf\u30fc\u30b2\u30c3\u30c8\u30ad\u30e3\u30c3\u30b7\u30e5",playeveryframe:"\u5168\u30d5\u30ec\u30fc\u30e0\u518d\u751f",kioskmode:"Kiosk\u30e2\u30fc\u30c9",controller:"\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u8868\u793a",menu:"\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a",loop:"\u7e70\u308a\u8fd4\u3057\u518d\u751f",play:"\u81ea\u52d5\u518d\u751f",hspace:"\u5de6\u53f3\u4f59\u767d",vspace:"\u4e0a\u4e0b\u4f59\u767d","class_name":"\u30af\u30e9\u30b9",name:"\u540d\u524d",id:"ID",type:"\u30bf\u30a4\u30d7",size:"\u30b5\u30a4\u30ba",preview:"\u30d7\u30ec\u30d3\u30e5\u30fc","constrain_proportions":"\u7e26\u6a2a\u6bd4\u3092\u4fdd\u5b58",controls:"\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u8868\u793a",numloop:"\u7e70\u308a\u8fd4\u3057\u56de\u6570",console:"\u30b3\u30f3\u30bd\u30fc\u30eb",cache:"\u30ad\u30e3\u30c3\u30b7\u30e5",autohref:"\u81ea\u52d5\u8aad\u8fbc",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"\u80cc\u666f\u8272",wmode:"WMode",salign:"SAlign",align:"\u914d\u7f6e",scale:"\u4f38\u7e2e",quality:"\u54c1\u8cea",shuffle:"\u30b7\u30e3\u30c3\u30d5\u30eb",prefetch:"\u30d7\u30ea\u30d5\u30a7\u30c3\u30c1",nojava:"Java\u3092\u7981\u6b62",maintainaspect:"\u7e26\u6a2a\u6bd4\u4fdd\u5b58",imagestatus:"\u30b9\u30c6\u30fc\u30bf\u30b9\u8868\u793a",center:"\u30bb\u30f3\u30bf\u30ea\u30f3\u30b0",autogotourl:"autogotourl","shockwave_options":"Shockwave\u30aa\u30d7\u30b7\u30e7\u30f3","rmp_options":"Real media player\u30aa\u30d7\u30b7\u30e7\u30f3","wmp_options":"Windows media player\u30aa\u30d7\u30b7\u30e7\u30f3","qt_options":"Quicktime\u30aa\u30d7\u30b7\u30e7\u30f3","flash_options":"Flash\u30aa\u30d7\u30b7\u30e7\u30f3",hidden:"\u975e\u8868\u793a","align_bottom_left":"\u5de6\u4e0b","align_bottom_right":"\u53f3\u4e0b","flv_options":"Flash video\u30aa\u30d7\u30b7\u30e7\u30f3","flv_scalemode":"\u4f38\u7e2e\u30e2\u30fc\u30c9","flv_buffer":"\u30d0\u30c3\u30d5\u30a1\u79d2\u6570","flv_startimage":"\u521d\u671f\u753b\u50cfURL","flv_starttime":"\u958b\u59cb\u30d5\u30ec\u30fc\u30e0","flv_defaultvolume":"\u97f3\u91cf","flv_hiddengui":"\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u975e\u8868\u793a","flv_autostart":"\u81ea\u52d5\u518d\u751f","flv_loop":"\u7e70\u308a\u8fd4\u3057\u518d\u751f","flv_showscalemodes":"\u4f38\u7e2e\u5207\u66ff\u30dc\u30bf\u30f3\u8868\u793a","flv_smoothvideo":"\u30b9\u30e0\u30fc\u30b8\u30f3\u30b0","flv_jscallback":"JS\u30b3\u30fc\u30eb\u30d0\u30c3\u30af","html5_video_options":"HTML5 Video \u30aa\u30d7\u30b7\u30e7\u30f3",altsource1:"\u4ee3\u66ff\u30bd\u30fc\u30b91",altsource2:"\u4ee3\u66ff\u30bd\u30fc\u30b92",preload:"preload\u5c5e\u6027",poster:"poster\u5c5e\u6027",source:"HTML"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ka_dlg.js b/js/tiny_mce/plugins/media/langs/ka_dlg.js new file mode 100755 index 000000000..09ee13cc7 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.media_dlg',{list:"\u10e9\u10d0\u10db\u10dd\u10dc\u10d0\u10d7\u10d5\u10d0\u10da\u10d8",file:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8",advanced:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7",general:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd",title:"\u10d9\u10da\u10d8\u10de\u10d8\u10e1 \u10db\u10d0\u10ee\u10d0\u10e1\u10d8\u10d0\u10d7\u10d4\u10d1\u10da\u10d4\u10d1\u10d8",align_top_left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10d4\u10dc\u10d0 \u10d6\u10d4\u10d3\u10d0 \u10d9\u10e3\u10d7\u10ee\u10d4",align_center:"\u10ea\u10d4\u10dc\u10e2\u10e0\u10d8",align_left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_bottom:"\u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_top:"\u10d6\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",qt_stream_warn:"\u10dc\u10d0\u10d9\u10d0\u10d3\u10dd\u10d5\u10d0\u10dc\u10d8 rtsp \u10e0\u10d4\u10e1\u10e3\u10e0\u10e1\u10d4\u10d1\u10d8 \u10e3\u10dc\u10d3\u10d0 \u10e9\u10d0\u10d0\u10db\u10d0\u10e2\u10dd\u10d7 QT Src \u10d5\u10d4\u10da\u10e8\u10d8, \"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7\" \u10d2\u10d5\u10d4\u10e0\u10d3\u10d6\u10d4.\n\u10ee\u10dd\u10da\u10dd \u10d0\u10e0\u10d0 \u10dc\u10d0\u10d9\u10d0\u10d3\u10dd\u10d5\u10d0\u10dc\u10d8 \u10d5\u10d4\u10e0\u10e1\u10d8\u10d0 - Src \u10d5\u10d4\u10da\u10e8\u10d8.",qtsrc:"QT Src",progress:"\u10de\u10e0\u10dd\u10d2\u10e0\u10d4\u10e1\u10d8",sound:"\u10ee\u10db\u10d0",swstretchvalign:"\u10d5\u10d4\u10e0\u10e2. \u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0 \u10d2\u10d0\u10ec\u10d4\u10da\u10d5\u10d8\u10d7",swstretchhalign:"\u10f0\u10dd\u10e0\u10d8\u10d6. \u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0 \u10d2\u10d0\u10ec\u10d4\u10da\u10d5\u10d8\u10d7",swstretchstyle:"\u10d2\u10d0\u10ec\u10d4\u10da\u10d5\u10d8\u10e1 \u10e1\u10e2\u10d8\u10da\u10d8",scriptcallbacks:"\u10e1\u10e5\u10e0\u10d8\u10de\u10e2\u10d8\u10e1 \u10db\u10ee\u10d0\u10e0\u10d3\u10d0\u10ed\u10d4\u10e0\u10d0",align_top_right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10d4\u10dc\u10d0 \u10d6\u10d4\u10d3\u10d0 \u10d9\u10e3\u10d7\u10ee\u10d4",uimode:"\u10d8\u10dc\u10e2\u10d4\u10e0\u10e4\u10d4\u10d8\u10e1\u10d8\u10e1 \u10e0\u10d4\u10df\u10d8\u10db\u10d8",rate:"\u10e0\u10d4\u10d8\u10e2\u10d8\u10dc\u10d2\u10d8",playcount:"\u10dc\u10d0\u10ee\u10d5\u10d4\u10d1\u10d8\u10e1 \u10db\u10d7\u10d5\u10da\u10d4\u10da\u10d8",defaultframe:"\u10db\u10d7\u10d0\u10d5\u10d0\u10e0\u10d8 \u10d9\u10d0\u10d3\u10e0\u10d8",currentposition:"\u10db\u10dd\u10ea\u10d4\u10db\u10e3\u10da\u10d8 \u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10d0",currentmarker:"\u10db\u10dd\u10ea\u10d4\u10db\u10e3\u10da\u10d8 \u10db\u10d0\u10e0\u10d9\u10d4\u10e0\u10d8",captioningid:"\u10e1\u10e3\u10d1\u10e2\u10d8\u10e2\u10e0\u10d4\u10d1\u10d8\u10e1 \u10e1\u10d0\u10ee\u10d4\u10da\u10d8",baseurl:"\u10e1\u10d0\u10d1\u10d0\u10d6\u10d8\u10e1\u10dd \u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8",balance:"\u10d1\u10d0\u10da\u10d0\u10dc\u10e1\u10d8",windowlessvideo:"\u10e4\u10d0\u10dc\u10ef\u10e0\u10d8\u10e1 \u10d5\u10d8\u10d3\u10d4\u10dd",stretchtofit:"\u10e4\u10d0\u10dc\u10ef\u10e0\u10d8\u10e1 \u10d6\u10dd\u10db\u10d0\u10d6\u10d4",mute:"\u10ee\u10db\u10d8\u10e1 \u10d2\u10d0\u10e0\u10d4\u10e8\u10d4",invokeurls:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10eb\u10d0\u10ee\u10d4\u10d1\u10d0",fullscreen:"\u10db\u10d7\u10d4\u10da \u10d4\u10d9\u10e0\u10d0\u10dc\u10d6\u10d4",enabled:"\u10e9\u10d0\u10e0\u10d7\u10e3\u10da\u10d8\u10d0",autostart:"\u10d0\u10d5\u10e2\u10dd\u10d2\u10d0\u10e8\u10d5\u10d4\u10d1\u10d0",volume:"\u10ee\u10db\u10d0",target:"\u10db\u10d8\u10d6\u10d0\u10dc\u10d8",qtsrcchokespeed:"\u10e1\u10d8\u10ee\u10e8\u10d8\u10e0\u10d4",href:"\u10d1\u10db\u10e3\u10da\u10d8",endtime:"\u10d3\u10d0\u10e1\u10e0\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10d3\u10e0\u10dd",starttime:"\u10d3\u10d0\u10ec\u10e7\u10d4\u10d1\u10d8\u10e1 \u10d3\u10e0\u10dd",enablejavascript:"JavaScript-\u10d8\u10e1 \u10e9\u10d0\u10e0\u10d7\u10d5\u10d0",correction:"\u10d9\u10dd\u10e0\u10d4\u10e5\u10e2\u10d8\u10e0\u10d4\u10d1\u10d8\u10e1 \u10d2\u10d0\u10e0\u10d4\u10e8\u10d4",targetcache:"\u10e5\u10d4\u10e8\u10d8",playeveryframe:"\u10e7\u10d5\u10d4\u10da\u10d0 \u10d9\u10d0\u10d3\u10e0\u10d8\u10e1 \u10d0\u10e1\u10d0\u10ee\u10d5\u10d0",kioskmode:"\u10d9\u10d8\u10dd\u10e1\u10d9\u10d8\u10e1 \u10e0\u10d4\u10df\u10d8\u10db\u10d8",controller:"\u10db\u10d0\u10e0\u10d7\u10d5\u10d0",menu:"\u10db\u10d4\u10dc\u10d8\u10e3\u10e1 \u10d2\u10d0\u10db\u10dd\u10e9\u10d4\u10dc\u10d0",loop:"\u10d2\u10d0\u10db\u10d4\u10dd\u10e0\u10d4\u10d1\u10d0",play:"\u10d0\u10d5\u10e2\u10dd\u10d2\u10d0\u10e8\u10d5\u10d4\u10d1\u10d0",hspace:"\u10f0\u10dd\u10e0\u10d8\u10d6. \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",vspace:"\u10d5\u10d4\u10e0\u10e2. \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",class_name:"\u10d9\u10da\u10d0\u10e1\u10d8",name:"\u10e1\u10d0\u10ee\u10d4\u10da\u10ec\u10dd\u10d3\u10d4\u10d1\u10d0",id:"\u10d8\u10d3\u10d4\u10dc\u10e2\u10d8\u10e4\u10d8\u10d9\u10d0\u10e2\u10dd\u10e0\u10d8",type:"\u10e2\u10d8\u10de\u10d8",size:"\u10d6\u10dd\u10db\u10d4\u10d1\u10d8",preview:"\u10ec\u10d8\u10dc\u10d0\u10e1\u10ec\u10d0\u10e0\u10d8 \u10d3\u10d0\u10d7\u10d5\u10d0\u10da\u10d8\u10d4\u10e0\u10d4\u10d1\u10d0",constrain_proportions:"\u10de\u10e0\u10dd\u10de\u10dd\u10e0\u10ea\u10d8\u10d4\u10d1\u10d8\u10e1 \u10e8\u10d4\u10dc\u10d0\u10e0\u10e9\u10e3\u10dc\u10d4\u10d1\u10d0",controls:"\u10db\u10d0\u10e0\u10d7\u10d5\u10d0",numloop:"\u10d2\u10d0\u10db\u10d4\u10dd\u10e0\u10d4\u10d1\u10d0\u10d7\u10d0 \u10e0\u10d8\u10ea\u10ee\u10d5\u10d8",console:"\u10d9\u10dd\u10dc\u10e1\u10dd\u10da\u10d8",cache:"\u10e5\u10d4\u10e8\u10d8",autohref:"\u10d0\u10d5\u10e2\u10dd \u10d1\u10db\u10e3\u10da\u10d8",liveconnect:"SWLiveConnect",flashvars:"Flas \u10d1\u10e0\u10eb\u10d0\u10dc\u10d4\u10d1\u10d4\u10d1\u10d8",base:"Base",bgcolor:"\u10e4\u10dd\u10dc\u10d8",wmode:"\u10e4\u10d0\u10dc\u10ef\u10d0\u10e0\u10d0",salign:"\u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",align:"\u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",scale:"\u10db\u10d8\u10d3\u10d0\u10db\u10dd",quality:"\u10ee\u10d0\u10e0\u10d8\u10e1\u10ee\u10d8",shuffle:"\u0412 \u0440\u0430\u0437\u0431\u0440\u043e\u0441",prefetch:"\u10d0\u10db\u10dd\u10d9\u10e0\u10d4\u10e4\u10d0",nojava:"Java-\u10e1 \u10d2\u10d0\u10e0\u10d4\u10e8\u10d4",maintainaspect:"\u10d6\u10dd\u10db\u10d8\u10e1 \u10d3\u10d0\u10db\u10d0\u10ee\u10e1\u10dd\u10d5\u10e0\u10d4\u10d1\u10d0",imagestatus:"\u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10e1\u10e2\u10d0\u10e2\u10e3\u10e1\u10d8",center:"\u10ea\u10d4\u10dc\u10e2\u10e0\u10d8",autogotourl:"\u10db\u10d8\u10e1\u10d0\u10db\u10d0\u10e0\u10d7\u10d6\u10d4 \u10d0\u10d5\u10e2\u10dd \u10d2\u10d0\u10d3\u10d0\u10e1\u10d5\u10da\u10d0",shockwave_options:"Shockwave \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",rmp_options:"Real Media \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",wmp_options:"Windows Media \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",qt_options:"Quicktime \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",flash_options:"Flash \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",hidden:"\u10d3\u10d0\u10e4\u10d0\u10e0\u10e3\u10da\u10d8",align_bottom_left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10d4\u10dc\u10d0 \u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10e3\u10d7\u10ee\u10d4",align_bottom_right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10d4\u10dc\u10d0 \u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10e3\u10d7\u10ee\u10d4",flv_options:"Flash \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",flv_scalemode:"\u10db\u10d0\u10e1\u10e8\u10e2\u10d0\u10d1\u10d8",flv_buffer:"\u10d1\u10e3\u10e4\u10d4\u10e0\u10d8",flv_startimage:"\u10e1\u10d0\u10ec\u10e7\u10d8\u10e1\u10d8 \u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d0",flv_starttime:"\u10d3\u10d0\u10ec\u10e7\u10d4\u10d1\u10d8\u10e1 \u10d3\u10e0\u10dd",flv_defaultvolume:"\u10e1\u10e2\u10d0\u10dc\u10d3\u10d0\u10e0\u10e2\u10e3\u10da\u10d8 \u10ee\u10db\u10d0",flv_hiddengui:"\u10d3\u10d0\u10e4\u10d0\u10e0\u10e3\u10da\u10d8 \u10d8\u10dc\u10e2\u10d4\u10e0\u10e4\u10d4\u10d8\u10e1\u10d8",flv_autostart:"\u10d0\u10d5\u10e2\u10dd \u10ee\u10db\u10d0",flv_loop:"\u10d2\u10d0\u10db\u10d4\u10dd\u10e0\u10d4\u10d1\u10d0",flv_showscalemodes:"\u10db\u10d0\u10e8\u10e2\u10d0\u10d1\u10d8\u10e1 \u10e0\u10d4\u10df\u10d8\u10db\u10d8",flv_smoothvideo:"\u10d7\u10d0\u10dc\u10d0\u10d5\u10d0\u10e0\u10d8 \u10d5\u10d8\u10d3\u10d4\u10dd",flv_jscallback:"JS \u10db\u10ee\u10d0\u10e0\u10d3\u10d0\u10ed\u10d4\u10e0\u10d0",html5_video_options:"HTML5-\u10d5\u10d8\u10d3\u10d4\u10dd\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",altsource1:"\u10d0\u10da\u10e2\u10d4\u10e0\u10dc\u10d0\u10e2\u10d8\u10e3\u10da\u10d8 \u10ec\u10e7\u10d0\u10e0\u10dd 1",altsource2:"\u10d0\u10da\u10e2\u10d4\u10e0\u10dc\u10d0\u10e2\u10d8\u10e3\u10da\u10d8 \u10ec\u10e7\u10d0\u10e0\u10dd 2",preload:"\u10ec\u10d8\u10dc\u10d0\u10e1\u10ec\u10d0\u10e0\u10d8 \u10e9\u10d0\u10db\u10dd\u10e2\u10d5\u10d8\u10e0\u10d7\u10d5\u10d0",poster:"\u10de\u10dd\u10e1\u10e2\u10d4\u10e0\u10d8",source:"\u10ec\u10e7\u10d0\u10e0\u10dd"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/kl_dlg.js b/js/tiny_mce/plugins/media/langs/kl_dlg.js new file mode 100755 index 000000000..8f995ec01 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/km_dlg.js b/js/tiny_mce/plugins/media/langs/km_dlg.js new file mode 100755 index 000000000..420b5f57a --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.media_dlg',{list:"\u1794\u1789\u17d2\u1787\u17b8",file:"\u17af\u1780\u179f\u17b6\u179a/\u17a2\u179f\u1799\u178a\u17d2\u178b\u17b6\u1793\u00a0URL",advanced:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",general:"\u1791\u17bc\u1791\u17c5",title:"\u1794\u1789\u17d2\u1785\u17bc\u179b / \u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u1798\u17c1\u178c\u17c0\u1794\u1784\u17d2\u1780\u1794\u17cb",align_top_left:"\u179b\u17be\u1786\u17d2\u179c\u17c1\u1784",align_center:"\u1780\u178e\u17d2\u178a\u17b6\u179b",align_left:"\u1786\u17d2\u179c\u17c1\u1784",align_bottom:"\u1794\u17b6\u178f",align_right:"\u179f\u17d2\u178a\u17b6\u17c6",align_top:"\u1780\u17c6\u1796\u17bc\u179b",qt_stream_warn:"\u1794\u17d2\u179a\u1797\u1796\u179f\u17d2\u1791\u17d2\u179a\u17b8\u1798 rtsp (\u1796\u17b7\u1792\u17b8\u1780\u17b6\u179a\u1794\u1784\u17d2\u17a0\u17bc\u179a\u1796\u17c1\u179b\u1796\u17b7\u178f)\u1782\u17bd\u179a\u178f\u17d2\u179a\u17bc\u179c\u1794\u1793\u17d2\u1790\u17c2\u1798\u1791\u17c5\u1780\u17d2\u1793\u17bb\u1784\u179c\u17b6\u179b QT Src \u1780\u17d2\u179a\u17c4\u1798\u1795\u17d2\u1791\u17b6\u17c6\u1784\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb\u00a0\u17d4n\u179f\u17d2\u179a\u1794\u1782\u17d2\u1793\u17b6\u1793\u17c1\u17c7 \u17a2\u17d2\u1793\u1780\u1782\u17bd\u179a\u1794\u1793\u17d2\u1790\u17c2\u1798\u1780\u17c6\u178e\u17c2\u1798\u17b7\u1793\u1798\u17c2\u1793\u179f\u17d2\u1791\u17d2\u179a\u17b8\u1798\u1791\u17c5\u1780\u17d2\u1793\u17bb\u1784\u179c\u17b6\u179b\u1794\u17d2\u179a\u1797\u1796 Src\u00a0\u17d4\"",qtsrc:"\u1794\u17d2\u179a\u1797\u1796 QT",progress:"\u179c\u178c\u17d2\u178d\u1793\u1797\u17b6\u1796",sound:"\u179f\u1798\u17d2\u179b\u17c1\u1784",swstretchvalign:"\u1791\u17b6\u1789\u178f\u1798\u17d2\u179a\u17b9\u1798\u1794\u1789\u17d2\u1788\u179a",swstretchhalign:"\u1791\u17b6\u1789\u178f\u1798\u17d2\u179a\u17b9\u1798\u1795\u17d2\u178a\u17c1\u1780",swstretchstyle:"\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798\u1791\u17b6\u1789\u179c\u17c2\u1784",scriptcallbacks:"\u179f\u17d2\u1782\u17d2\u179a\u17b8\u1794\u17a0\u17c5\u1798\u1780\u179c\u17b7\u1789",align_top_right:"\u179b\u17be\u179f\u17d2\u178a\u17b6\u17c6",uimode:"\u1798\u17c9\u17bc\u178a UI",rate:"\u17a2\u178f\u17d2\u179a\u17b6",playcount:"\u1785\u17c6\u1793\u17bd\u1793\u178a\u1784\u1785\u17b6\u1780\u17cb",defaultframe:"\u179f\u1793\u17d2\u179b\u17b9\u1780\u179b\u17c6\u1793\u17b6\u17c6\u178a\u17be\u1798",currentposition:"\u1791\u17b8\u178f\u17b6\u17c6\u1784\u1794\u1785\u17d2\u1785\u17bb\u1794\u17d2\u1794\u1793\u17d2\u1793",currentmarker:"\u1785\u17c6\u178e\u17b6\u17c6\u1794\u1785\u17d2\u1785\u17bb\u1794\u17d2\u1794\u1793\u17d2\u1793",captioningid:"\u179f\u179b.\u1785\u17c6\u178e\u1784\u1787\u17be\u1784\u178f\u17bc\u1785",baseurl:"URL\u00a0\u1782\u17c4\u179b",balance:"\u179f\u1798\u178f\u17bb\u179b\u17d2\u1799",windowlessvideo:"\u1797\u17b6\u1796\u1799\u1793\u17d2\u178f\u1782\u17d2\u1798\u17b6\u1793\u1794\u1784\u17d2\u17a2\u17bd\u1785",stretchtofit:"\u1791\u17b6\u1789\u17b1\u17d2\u1799\u179f\u1798",mute:"\u1794\u17b7\u1791\u179f\u1798\u17d2\u179b\u17c1\u1784",invokeurls:"\u17a0\u17c5 URLs",fullscreen:"\u1796\u17c1\u1789\u17a2\u17c1\u1780\u17d2\u179a\u1784\u17cb",enabled:"\u1794\u17b6\u1793\u1794\u17be\u1780\u1794\u17d2\u179a\u17be",autostart:"\u179f\u17d2\u179c\u17d0\u1799\u1785\u17b6\u1794\u17cb\u1795\u17d2\u178a\u17be\u1798",volume:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u179f\u1798\u17d2\u179b\u17c1\u1784",target:"\u1782\u17c4\u179b\u178a\u17c5",qtsrcchokespeed:"\u1794\u1784\u17d2\u17a2\u1793\u17cb\u179b\u17d2\u1794\u17bf\u1793",href:"\u178f\u17c6\u178e\u1781\u17d2\u1796\u179f\u17cb",endtime:"\u179c\u17c1\u179b\u17b6\u1794\u1789\u17d2\u1785\u1794\u17cb",starttime:"\u179c\u17c1\u179b\u17b6\u1785\u17b6\u1794\u17cb\u1795\u17d2\u178a\u17be\u1798",enablejavascript:"\u1794\u17be\u1780\u1794\u17d2\u179a\u17be\u00a0JavaScript",correction:"\u1782\u17d2\u1798\u17b6\u1793\u1780\u17b6\u179a\u1780\u17c2\u178f\u1798\u17d2\u179a\u17bc\u179c",targetcache:"\u1783\u17d2\u179b\u17b6\u17c6\u1784\u179f\u1798\u17d2\u1784\u17b6\u178f\u17cb\u1782\u17c4\u179b\u178a\u17c5",playeveryframe:"\u1785\u17b6\u1780\u17cb\u1782\u17d2\u179a\u1794\u17cb\u179f\u1793\u17d2\u179b\u17b9\u1780",kioskmode:"\u1798\u17c9\u17bc\u178a Kiosk",controller:"\u1794\u17d2\u179a\u178a\u17b6\u1794\u17cb\u1794\u1789\u17d2\u1787\u17b6",menu:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u1798\u17c9\u17ba\u1793\u17bb\u1799",loop:"\u179a\u1784\u17d2\u179c\u17b7\u179b\u1787\u17bb\u17c6",play:"\u1785\u17b6\u1780\u17cb\u179f\u17d2\u179c\u17d0\u1799\u1794\u17d2\u179a\u179c\u178f\u17d2\u178f\u17b7",hspace:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1795\u17d2\u178a\u17c1\u1780",vspace:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1794\u1789\u17d2\u1788\u179a",class_name:"\u1790\u17d2\u1793\u17b6\u1780\u17cb",name:"\u1788\u17d2\u1798\u17c4\u17c7",id:"\u179b\u179f.",type:"\u1794\u17d2\u179a\u1797\u17c1\u1791",size:"\u179c\u17b7\u1798\u17b6\u178f\u17d2\u179a",preview:"\u1798\u17be\u179b\u1787\u17b6\u1798\u17bb\u1793",constrain_proportions:"\u1794\u1784\u17d2\u1781\u17c6\u17b2\u17d2\u1799\u1798\u17b6\u1793\u179f\u1798\u17b6\u1798\u17b6\u178f\u17d2\u179a",controls:"\u1794\u1789\u17d2\u1787\u17b6",numloop:"\u1785\u17c6\u1793\u17bd\u1793\u179a\u1784\u17d2\u179c\u17b7\u179b\u1787\u17bb\u17c6",console:"\u1786\u17b6\u1780\u1782\u17d2\u179a\u1794\u17cb\u1782\u17d2\u179a\u1784",cache:"\u1783\u17d2\u179b\u17b6\u17c6\u1784\u179f\u1798\u17d2\u1784\u17b6\u178f\u17cb",autohref:"\u179f\u17d2\u179c\u17d0\u1799HREF",liveconnect:"SW\u1797\u17d2\u1787\u17b6\u1794\u17cb\u1795\u17d2\u1791\u17b6\u179b\u17cb",flashvars:"\u17a2\u1790\u17c1\u179a Flash",base:"\u1782\u17c4\u179b",bgcolor:"\u1795\u17d2\u1791\u17c2\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",wmode:"\u1798\u17c9\u17bc\u178a\u1794\u1784\u17d2\u17a2\u17bd\u1785",salign:"\u178f\u1798\u17d2\u179a\u17b9\u1798\u1787\u17d2\u179a\u17bb\u1784",align:"\u178f\u1798\u17d2\u179a\u17b9\u1798",scale:"\u1798\u17b6\u178f\u17d2\u179a\u178a\u17d2\u178b\u17b6\u1793",quality:"\u1782\u17bb\u178e\u1797\u17b6\u1796",shuffle:"\u1794\u1784\u17d2\u17a2\u17bc\u179f",prefetch:"\u1799\u1780\u1798\u17bb\u1793",nojava:"\u1782\u17d2\u1798\u17b6\u1793 java",maintainaspect:"\u179a\u1780\u17d2\u179f\u17b6\u179f\u1798\u17b6\u1798\u17b6\u178f\u17d2\u179a",imagestatus:"\u179f\u17d2\u1790\u17b6\u1793\u1797\u17b6\u1796\u179a\u17bc\u1794\u1797\u17b6\u1796",center:"\u1780\u178e\u17d2\u178a\u17b6\u179b",autogotourl:"\u179f\u17d2\u179c\u17d0\u1799\u1791\u17c5\u1780\u17b6\u1793\u17cb URL",shockwave_options:"\u1787\u1798\u17d2\u179a\u17be\u179f Shockwav",rmp_options:"\u1787\u1798\u17d2\u179a\u17be\u179f\u1780\u1798\u17d2\u1798\u179c\u17b7\u1792\u17b8\u1785\u17b6\u1780\u17cb Real Media",wmp_options:"\u1787\u1798\u17d2\u179a\u17be\u179f\u1780\u1798\u17d2\u1798\u179c\u17b7\u1792\u17b8\u1785\u17b6\u1780\u17cb Window Media",qt_options:"\u1787\u1798\u17d2\u179a\u17be\u179f Quicktime",flash_options:"\u1787\u1798\u17d2\u179a\u17be\u179f Flash",hidden:"\u1794\u17c6\u1796\u17bd\u1793",align_bottom_left:"\u1780\u17d2\u179a\u17c4\u1798\u1786\u17d2\u179c\u17c1\u1784",align_bottom_right:"\u1780\u17d2\u179a\u17c4\u1798\u179f\u17d2\u178a\u17b6\u17c6",flv_options:"\u1787\u1798\u17d2\u179a\u17be\u179f\u1797\u17b6\u1796\u1799\u1793\u17d2\u178f Flash",flv_scalemode:"\u1798\u17c9\u17bc\u178a\u1798\u17b6\u178f\u17d2\u179a\u178a\u17d2\u178b\u17b6\u1793",flv_buffer:"\u179f\u178f\u17b7\u1794\u178e\u17d2\u178a\u17c4\u17c7\u17a2\u17b6\u179f\u1793\u17d2\u1793",flv_startimage:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1785\u17b6\u1794\u17cb\u1795\u17d2\u178a\u17be\u1798",flv_starttime:"\u179c\u17c1\u179b\u17b6\u1785\u17b6\u1794\u17cb\u1795\u17d2\u178a\u17be\u1798",flv_defaultvolume:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u179f\u1798\u17d2\u179b\u17c1\u1784\u179b\u17c6\u1793\u17b6\u17c6\u178a\u17be\u1798",flv_hiddengui:"\u1785\u17c6\u178e\u17bb\u1785\u1794\u17d2\u179a\u1791\u17b6\u1780\u17cb\u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17be\u1780\u17d2\u179a\u17b6\u17a0\u17d2\u179c\u17b7\u1780\u1794\u17c6\u1796\u17bd\u1793",flv_autostart:"\u1785\u17b6\u1794\u17cb\u1795\u17d2\u178a\u17be\u1798\u179f\u17d2\u179c\u17d0\u1799\u1794\u17d2\u179a\u179c\u178f\u17d2\u178f\u17b7",flv_loop:"\u179a\u1784\u17d2\u179c\u17b7\u179b\u1787\u17bb\u17c6",flv_showscalemodes:"\u1794\u1784\u17d2\u17a0\u17b6\u1789\u1798\u17c9\u17bc\u178a\u1798\u17b6\u178f\u17d2\u179a\u178a\u17d2\u178b\u17b6\u1793",flv_smoothvideo:"\u179a\u179b\u17bc\u1793\u1797\u17b6\u1796\u1799\u1793\u17d2\u178f",flv_jscallback:"\u17a0\u17c5JS\u1798\u1780\u179c\u17b7\u1789",html5_video_options:"\u1787\u1798\u17d2\u179a\u17be\u179f\u1797\u17b6\u1796\u1799\u1793\u17d2\u178f HTML5",altsource1:"\u1794\u17d2\u179a\u1797\u1796\u1787\u17c6\u1793\u17bd\u179f\u17e1",altsource2:"\u1794\u17d2\u179a\u1797\u1796\u1787\u17c6\u1793\u17bd\u179f\u17e2",preload:"\u1795\u17d2\u1791\u17bb\u1780\u1787\u17b6\u1798\u17bb\u1793",poster:"\u1795\u17d2\u1791\u17b6\u17c6\u1784\u1795\u17d2\u179f\u1796\u17d2\u179c\u1795\u17d2\u179f\u17b6\u1799",source:"\u1794\u17d2\u179a\u1797\u1796"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ko_dlg.js b/js/tiny_mce/plugins/media/langs/ko_dlg.js new file mode 100755 index 000000000..878337af8 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.media_dlg',{list:"\ubaa9\ub85d",file:"\ud30c\uc77c/URL",advanced:"\uace0\uae09",general:"\uc77c\ubc18",title:"\ubbf8\ub514\uc5b4\uc758 \uc0bd\uc785/\ud3b8\uc9d1",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"JavaScript\ub97c \ud5c8\uac00",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"\uba54\ub274 \ud45c\uc2dc",loop:"\uc5f0\uc18d \uc7ac\uc0dd",play:"\uc790\ub3d9 \uc7ac\uc0dd",hspace:"\uc88c\uc6b0 \uc5ec\ubc31",vspace:"\uc0c1\ud558 \uc5ec\ubc31",class_name:"Class",name:"Name",id:"Id",type:"\ud0c0\uc785",size:"\ud06c\uae30",preview:"\ubbf8\ub9ac\ubcf4\uae30",constrain_proportions:"\uc885\ud6a1\ube44 \uc720\uc9c0",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"\uc2a4\ucf00\uc77c",quality:"\ud488\uc9c8",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/lb_dlg.js b/js/tiny_mce/plugins/media/langs/lb_dlg.js new file mode 100755 index 000000000..e3ee25947 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.media_dlg',{list:"L\u00ebscht",file:"Datei/URL",advanced:"Erweidert",general:"Allgemeng",title:"Multimedia-Inhalt abannen/beaarbechten",align_top_left:"Uewe L\u00e9nks",align_center:"Zentr\u00e9iert",align_left:"L\u00e9nks",align_bottom:"\u00cbnnen",align_right:"Riets",align_top:"Uewen",qt_stream_warn:"An den erweiderten Astellunge sollten am Feld \'QT Src\' gestreamte RTSP Ressourcen b\u00e4igesat ginn.\\nZous\u00e4tzlech sollt Dir do och eng net-gestreamte Ressource uginn.",qtsrc:"QT Src",progress:"Fortschr\u00ebtt",sound:"Toun",swstretchvalign:"Stretch V-Ausriichtung",swstretchhalign:"Stretch H-Ausriichtung",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Uewe Riets",uimode:"UI Modus",rate:"Quote",playcount:"Zieler",defaultframe:"Frame-Virastellung",currentposition:"Aktuell Positioun",currentmarker:"Aktuelle Marker",captioningid:"Beschr\u00ebftungs Id",baseurl:"Basis-URL",balance:"Balance",windowlessvideo:"F\u00ebnsterlose Video",stretchtofit:"Breet un d\u00e9i verf\u00fcgbar Plaz upassen",mute:"Stomm",invokeurls:"URLen opruffen",fullscreen:"Vollbild",enabled:"Aktiv\u00e9iert",autostart:"Autostart",volume:"Lautst\u00e4rkt",target:"Zil",qtsrcchokespeed:"Vitesse drosselen",href:"Href",endtime:"Endz\u00e4itpunkt",starttime:"Startz\u00e4itpunkt",enablejavascript:"JavaScript aktiv\u00e9ieren",correction:"Ouni Korrektur",targetcache:"Zil zw\u00ebschesp\u00e4icheren",playeveryframe:"All Frame ofspillen",kioskmode:"Kioskmodus",controller:"Kontroller",menu:"Men\u00fc uweisen",loop:"Widderhuelung",play:"Automatesch Ofspillen",hspace:"Horizontalen Ofstand",vspace:"Vertikalen Ofstand",class_name:"CSS-Klass",name:"Numm",id:"Id",type:"Typ",size:"Ofmiessungen",preview:"Virschau",constrain_proportions:"Proportiounen erhalen",controls:"Steierung",numloop:"Unzuel Widderhuelungen",console:"Konsol",cache:"Zw\u00ebschesp\u00e4icher",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash-Variablen",base:"Basis",bgcolor:"Hannergrond",wmode:"WMode",salign:"S-Ausriichtung",align:"Ausriichtung",scale:"Skal\u00e9ierung",quality:"Qualit\u00e9it",shuffle:"Zouf\u00e4lleg Widdergab",prefetch:"Prefetch",nojava:"Kee Java",maintainaspect:"Bildverh\u00e4ltnis b\u00e4ibehalen",imagestatus:"Bildstatus",center:"Zentr\u00e9iert",autogotourl:"Auto goto URL",shockwave_options:"Shockwave-Optiounen",rmp_options:"Optiounen fir Real Media Player",wmp_options:"Optiounen fir Windows Media Player",qt_options:"Quicktime-Optiounen",flash_options:"Flash-Optiounen",hidden:"Verstoppt",align_bottom_left:"\u00cbnne L\u00e9nks",align_bottom_right:"\u00cbnne Riets",flv_options:"Optiounen fir Flash Video",flv_scalemode:"Skal\u00e9ierungsmodus",flv_buffer:"Puffer",flv_startimage:"Startbild",flv_starttime:"Startz\u00e4itpunkt",flv_defaultvolume:"Standardlautst\u00e4rk",flv_hiddengui:"Verstoppte GUI",flv_autostart:"Autostart",flv_loop:"Widderhuelung",flv_showscalemodes:"Skal\u00e9ierungsmodi uweisen",flv_smoothvideo:"Smooth Video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/lt_dlg.js b/js/tiny_mce/plugins/media/langs/lt_dlg.js new file mode 100755 index 000000000..848dca958 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.media_dlg',{list:"S\u0105ra\u0161as",file:"Failas/URL",advanced:"I\u0161pl\u0117sta",general:"Bendra",title:"\u012eterpti/redaguoti integruot\u0105 daugialyp\u0119 terp\u0119",align_top_left:"Vir\u0161uje, kair\u0117je",align_center:"Centre",align_left:"Kair\u0117je",align_bottom:"Apa\u010dioje",align_right:"De\u0161in\u0117je",align_top:"Vir\u0161uje",qt_stream_warn:"Transliuojami rtsp i\u0161tekliai tur\u0117t\u0173 b\u016bti prid\u0117ti prie QT Src lauko \u201ePapildom\u0173 nustatym\u0173\u201c kortel\u0117je.\\nTaip pat reikt\u0173 prid\u0117ti ir netransliuojam\u0105j\u0105 Src lauko versij\u0105.",qtsrc:"QT Src",progress:"Progresas",sound:"Garsas",swstretchvalign:"I\u0161tempti V-lygiavim\u0105",swstretchhalign:"I\u0161tempti H-lygiavim\u0105",swstretchstyle:"I\u0161tempti stili\u0173",scriptcallbacks:"Scenarijaus atgalinis atsakas",align_top_right:"Vir\u0161uje, de\u0161in\u0117je",uimode:"UI re\u017eimas",rate:"Da\u017enis",playcount:"Grojimo kartai",defaultframe:"Numatytas kadras",currentposition:"Dabartin\u0117 pozicija",currentmarker:"Dabartinis \u017eymeklis",captioningid:"Antra\u0161t\u0117s id",baseurl:"Prad\u017eios URL adresas",balance:"Balansas",windowlessvideo:"Vaizdas be lango",stretchtofit:"I\u0161tempti iki atitikimo",mute:"Nutildyti",invokeurls:"I\u0161kviesti URL adresus",fullscreen:"Viso ekrano re\u017eimas",enabled:"\u012ejungta",autostart:"Automatinis paleidimas",volume:"Garsis",target:"Paskirtis",qtsrcchokespeed:"Dusinimo greitis",href:"Href",endtime:"Pabaigos laikas",starttime:"Prad\u017eios laikas",enablejavascript:"\u012egalinti JavaScript",correction:"Joki\u0173 korekcij\u0173",targetcache:"Paskirties laikinoji talpykla",playeveryframe:"Paleisti kiekvien\u0105 kadr\u0105",kioskmode:"Kiosko re\u017eimas",controller:"Valdiklis",menu:"Rodyti meniu",loop:"Kartoti",play:"Automatinis paleidimas",hspace:"Horizontalus tarpas",vspace:"Vertikalus tarpas",class_name:"Klas\u0117",name:"Vardas",id:"Id",type:"Tipas",size:"I\u0161matavimai",preview:"Per\u017ei\u016bra",constrain_proportions:"Priverstin\u0117s proporcijos",controls:"Valdikliai",numloop:"Cikl\u0173 kiekis",console:"Konsol\u0117",cache:"Laikinoji talpykla",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash kintamieji",base:"Baz\u0117",bgcolor:"Fono spalva",wmode:"W-re\u017eimas",salign:"S-lygiavimas",align:"Lygiavimas",scale:"Mastelis",quality:"Kokyb\u0117",shuffle:"Atsitiktinis mai\u0161ymasis",prefetch:"I\u0161ankstinis duom. i\u0161rinkimas",nojava:"Be Java",maintainaspect:"I\u0161laikyti aspekt\u0105",imagestatus:"Paveiksl\u0117lio b\u016bsena",center:"Centre",autogotourl:"Automatinis \u0117jimas URL adresu",shockwave_options:"Shockwave nustatymai",rmp_options:"Real media player nustatymai",wmp_options:"Windows media player nustatymai",qt_options:"Quicktime nustatymai",flash_options:"Flash nustatymai",hidden:"Pasl\u0117pta",align_bottom_left:"Apa\u010dioje, kair\u0117je",align_bottom_right:"Apa\u010dioje, de\u0161in\u0117je",flv_options:"Flash vaizdo nustatymai",flv_scalemode:"Mastelio re\u017eimas",flv_buffer:"Buferis",flv_startimage:"Prad\u017eios paveiksl\u0117lis",flv_starttime:"Prad\u017eios laikas",flv_defaultvolume:"Pradinis garsis",flv_hiddengui:"Pasl\u0117pta grafin\u0117 s\u0105saja",flv_autostart:"Auto grojimas",flv_loop:"Kartoti",flv_showscalemodes:"Rodyti mastelio re\u017eimus",flv_smoothvideo:"Tolygus vaizdas",flv_jscallback:"JS atgalinis atsakas"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/lv_dlg.js b/js/tiny_mce/plugins/media/langs/lv_dlg.js new file mode 100755 index 000000000..40285808c --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/mk_dlg.js b/js/tiny_mce/plugins/media/langs/mk_dlg.js new file mode 100755 index 000000000..56f0b106a --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ml_dlg.js b/js/tiny_mce/plugins/media/langs/ml_dlg.js new file mode 100755 index 000000000..6799e9d82 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/mn_dlg.js b/js/tiny_mce/plugins/media/langs/mn_dlg.js new file mode 100755 index 000000000..b3106204c --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.media_dlg',{list:"\u0416\u0430\u0433\u0441\u0430\u0430\u043b\u0442",file:"\u0424\u0430\u0439\u043b/URL",advanced:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d",general:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439",title:"\u041c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0430 \u0430\u0433\u0443\u0443\u043b\u0433\u0430 \u0431\u0443\u0443\u043b\u0433\u0430\u0445/ \u0437\u0430\u0441\u0432\u0430\u0440\u043b\u0430\u0445",align_top_left:"\u0417\u04af\u04af\u043d \u0434\u044d\u044d\u0434",align_center:"\u0413\u043e\u043b\u0434",align_left:"\u0417\u04af\u04af\u043d",align_bottom:"\u0414\u043e\u043e\u0440",align_right:"\u0411\u0430\u0440\u0443\u0443\u043d",align_top:"\u0414\u044d\u044d\u0440",qt_stream_warn:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d \u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e\u043d \u0434\u0430\u0445\u044c \'QT Src\' \u0442\u0430\u043b\u0431\u0430\u0440\u0442 \u0446\u0430\u0446\u0430\u0436 \u0431\u0443\u0439 rtsp \u043d\u04e9\u04e9\u0446\u0438\u0439\u0433 \u043e\u0440\u0443\u0443\u043b\u0436 \u04e9\u0433\u043d\u04e9.\\n\u041c\u04e9\u043d \u0442\u0430 \u0442\u044d\u043d\u0434 \u0446\u0430\u0446\u0430\u0430\u0433\u04af\u0439 \u043d\u04e9\u04e9\u0446\u0438\u0439\u0433 \u043d\u044d\u043c\u044d\u0445 \u0445\u044d\u0440\u044d\u0433\u0442\u044d\u0439.",qtsrc:"QT Src",progress:"\u042f\u0432\u0446",sound:"\u0414\u0443\u0443",swstretchvalign:"Stretch V-\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",swstretchhalign:"Stretch H-\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"\u0411\u0430\u0440\u0443\u0443\u043d \u0434\u044d\u044d\u0434",uimode:"UI \u0433\u043e\u0440\u0438\u043c",rate:"Rate",playcount:"\u0422\u043e\u043e\u043b\u0443\u0443\u0440",defaultframe:"\u0424\u0440\u044d\u0439\u043c-\u04e9\u0433\u04e9\u0433\u0434\u043c\u04e9\u043b \u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",currentposition:"\u0418\u0434\u044d\u0432\u0445\u0442\u044d\u0439 \u0431\u0430\u0439\u0440\u043b\u0430\u043b",currentmarker:"\u0418\u0434\u044d\u0432\u0445\u0442\u044d\u0439 \u0442\u044d\u043c\u0434\u044d\u0433\u043b\u044d\u0433\u0447",captioningid:"Captioning id",baseurl:"\u04ae\u043d\u0434\u0441\u044d\u043d URL",balance:"\u0422\u044d\u043d\u0446\u0432\u044d\u0440\u0436\u04af\u04af\u043b\u044d\u043b\u0442",windowlessvideo:"\u0426\u043e\u043d\u0445\u0433\u04af\u0439 \u0432\u0438\u0434\u0435\u043e",stretchtofit:"\u0425\u0430\u0440\u0443\u0443\u043b\u0430\u0445 \u043c\u0443\u0436\u0438\u0439\u0433 \u0441\u0443\u043b \u0431\u0430\u0439\u0433\u0430\u0430 \u0437\u0430\u0439\u0434 \u0442\u0430\u0430\u0440\u0443\u0443\u043b\u0430\u0445",mute:"\u0414\u0443\u0443\u0433\u04af\u0439",invokeurls:"\u0414\u0443\u0443\u0434\u0430\u0445 URLs",fullscreen:"\u0414\u044d\u043b\u0433\u044d\u0446 \u0434\u04af\u04af\u0440\u044d\u043d",enabled:"\u0418\u0434\u044d\u0432\u0445\u0442\u044d\u0439",autostart:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442 \u044d\u0445\u043b\u044d\u043b",volume:"\u0414\u0443\u0443",target:"\u0422\u043e\u0432\u043b\u043e\u0441\u043e\u043d",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"\u0422\u04e9\u0433\u0441\u04e9\u0445 \u0446\u0430\u0433",starttime:"\u042d\u0445\u043b\u044d\u0445 \u0446\u0430\u0433",enablejavascript:"JavaScript \u0438\u0434\u044d\u0432\u0445\u0436\u04af\u04af\u043b\u044d\u0445",correction:"\u0417\u0430\u0441\u0432\u0430\u0440\u0433\u04af\u0439",targetcache:"\u0417\u043e\u0440\u0438\u043b\u0433\u044b\u0433 \u0442\u04af\u0440 \u0445\u0430\u0434\u0433\u0430\u043b\u043d\u0430",playeveryframe:"\u0424\u0440\u044d\u0439\u043c \u0431\u04af\u0440\u0438\u0439\u0433 \u0442\u043e\u0433\u043b\u0443\u0443\u043b\u043d\u0430",kioskmode:"\u041a\u0438\u043e\u0441\u043a \u0433\u043e\u0440\u0438\u043c",controller:"Controller",menu:"\u0426\u044d\u0441 \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",loop:"\u0414\u0430\u0432\u0442\u0430\u043b\u0442",play:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0430\u0440 \u0442\u043e\u0433\u043b\u0443\u0443\u043b\u043d\u0430",hspace:"\u0425\u044d\u0432\u0442\u044d\u044d \u0430\u043b\u0441\u043b\u0430\u043b\u0442",vspace:"\u0411\u043e\u0441\u043e\u043e \u0430\u043b\u0441\u043b\u0430\u043b\u0442",class_name:"CSS-\u0430\u043d\u0433\u0438",name:"\u041d\u044d\u0440",id:"\u0422\u0442",type:"\u0422\u04e9\u0440\u04e9\u043b",size:"\u0425\u044d\u043c\u0436\u044d\u044d",preview:"\u041d\u044f\u0433\u0442\u043b\u0430\u0445",constrain_proportions:"\u0425\u0430\u0440\u044c\u0446\u0430\u0430\u0433 \u0431\u0430\u0440\u0438\u0445",controls:"\u0423\u0434\u0438\u0440\u0434\u043b\u0430\u0433\u0430",numloop:"\u0414\u0430\u0432\u0442\u0430\u0445 \u0442\u043e\u043e",console:"\u041a\u043e\u043d\u0441\u043e\u043b",cache:"\u0417\u0430\u0432\u0441\u0440\u044b\u043d \u0445\u0430\u0434\u0433\u0430\u043b\u0430\u0433\u0447",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"\u0424\u043b\u044d\u0439\u0448 \u0445\u0443\u0432\u044c\u0441\u0430\u0433\u0447",base:"\u0421\u0443\u0443\u0440\u044c",bgcolor:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440",wmode:"WMode",salign:"S-\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",align:"\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",scale:"\u0425\u0443\u0432\u0430\u0430\u0440\u0438\u043b\u0430\u043b\u0442",quality:"\u0427\u0430\u043d\u0430\u0440",shuffle:"\u0421\u0430\u043d\u0430\u043c\u0441\u0430\u0440\u0433\u04af\u0439\u0433\u044d\u044d\u0440 \u0442\u043e\u0433\u043b\u0443\u0443\u043b\u0430\u0445",prefetch:"Prefetch",nojava:"\u0416\u0430\u0432\u0430\u0433\u04af\u0439",maintainaspect:"\u0417\u0443\u0440\u0433\u0438\u0439\u043d \u0445\u0430\u0440\u044c\u0446\u0430\u0430\u0433 \u0445\u0430\u0434\u0433\u0430\u043b\u0430\u043d\u0430",imagestatus:"\u0417\u0443\u0440\u0433\u0438\u0439\u043d \u0442\u04e9\u043b\u04e9\u0432",center:"\u0413\u043e\u043b\u043b\u0443\u0443\u043b\u0441\u0430\u043d",autogotourl:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0430\u0440 \u043e\u0447\u0438\u0445 URL",shockwave_options:"Shockwave-\u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",rmp_options:"Real Media Player-\u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",wmp_options:"Windows Media Player-\u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",qt_options:"Quicktime-\u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",flash_options:"\u0424\u043b\u044d\u0439\u0448-\u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",hidden:"\u0414\u0430\u043b\u0434\u0430\u043b\u0441\u0430\u043d",align_bottom_left:"\u0417\u04af\u04af\u043d \u0434\u043e\u043e\u0434",align_bottom_right:"\u0411\u0430\u0440\u0443\u0443\u043d \u0434\u043e\u043e\u0434",flv_options:"\u0424\u043b\u044d\u0439\u0448 \u0432\u0438\u0434\u0435\u043e\u043d\u044b \u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",flv_scalemode:"\u0425\u0443\u0432\u0430\u0430\u0440\u044c\u0442 \u0433\u043e\u0440\u0438\u043c",flv_buffer:"\u0411\u0443\u0444\u0435\u0440",flv_startimage:"\u042d\u0445\u043b\u044d\u043b \u0437\u0443\u0440\u0430\u0433",flv_starttime:"\u042d\u0445\u043b\u044d\u0445 \u0446\u0430\u0433",flv_defaultvolume:"\u04e8\u0433\u04e9\u0433\u0434\u043c\u04e9\u043b \u0434\u0443\u0443",flv_hiddengui:"\u0414\u0430\u043b\u0434 GUI",flv_autostart:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442 \u044d\u0445\u043b\u04af\u04af\u043b\u044d\u043b\u0442",flv_loop:"\u0414\u0430\u0432\u0442\u0430\u043b\u0442",flv_showscalemodes:"\u0425\u0443\u0432\u0430\u0430\u0440\u044c\u0442 \u0433\u043e\u0440\u0438\u043c \u0445\u0430\u0440\u0443\u0443\u043b\u0430\u0445",flv_smoothvideo:"Smooth \u0412\u0438\u0434\u0435\u043e",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ms_dlg.js b/js/tiny_mce/plugins/media/langs/ms_dlg.js new file mode 100755 index 000000000..743d9cfe4 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.media_dlg',{list:"Senarai",file:"Fail/URL",advanced:"Lanjutan",general:"Am",title:"Masukkan / sunting media",align_top_left:"Kiri atas",align_center:"Tengah",align_left:"Kiri",align_bottom:"Bawah",align_right:"Kanan",align_top:"Atas",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch Selarian-Tegak",swstretchhalign:"Bentangan Selarian-Ufuk",swstretchstyle:"Gaya bentangan",scriptcallbacks:"Panggilan balik skrip",align_top_right:"Kanan atas",uimode:"Mod Grafik",rate:"Undi",playcount:"Kira",defaultframe:"Bingkai asal",currentposition:"Posisi semasa",currentmarker:"Penanda semasa",captioningid:"Tajuk id",baseurl:"URL dasar",balance:"Baki",windowlessvideo:"Tetingkap tanpa video",stretchtofit:"Bujurkan supaya sesuai",mute:"Bisu",invokeurls:"Panggil URL",fullscreen:"Skrin penuh",enabled:"Dibolehkan",autostart:"Auto mula",volume:"Ketinggian suara",target:"Sasaran",qtsrcchokespeed:"Kelajuan sumbatan",href:"Href",endtime:"Masa tamat",starttime:"Masa bermula",enablejavascript:"Bolehkan JavaScript",correction:"Tiada pembetulan",targetcache:"Sasaran tersembunyi",playeveryframe:"Main setiap bingkai",kioskmode:"Mode toko",controller:"Kendali",menu:"Tunjuk menu",loop:"Gelung",play:"Auto main",hspace:"Ruangan-Datar",vspace:"Ruangan-Tegak",class_name:"Kelas",name:"Nama",id:"Id",type:"Jenis",size:"Dimensi",preview:"Pratonton",constrain_proportions:"Kadar tahanan",controls:"Kendali",numloop:"Nombor gelungan",console:"Konsol",cache:"Tempat menyembunyikan",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Dasar",bgcolor:"Latar belakang",wmode:"WMod",salign:"SLuruskan",align:"Luruskan",scale:"Ukuran",quality:"Kualiti",shuffle:"Merangkak",prefetch:"Preambilan",nojava:"Java tidak dibenarkan",maintainaspect:"Pelihara aspek",imagestatus:"Status imej",center:"Tengah",autogotourl:"Auto pergi-ke URL",shockwave_options:"Shockwave",rmp_options:"Pemain Real media",wmp_options:"Pemain Windows media",qt_options:"Quicktime",flash_options:"Flash",hidden:"Tersorok",align_bottom_left:"Bawah kiri",align_bottom_right:"Bawah kanan",flv_options:"Alatan flash video",flv_scalemode:"Skala mod",flv_buffer:"Buffer",flv_startimage:"Start imej",flv_starttime:"Masa mula",flv_defaultvolume:"Bunyi asal",flv_hiddengui:"GUI tersorok",flv_autostart:"Auto mula",flv_loop:"Gegelung",flv_showscalemodes:"Tunjuk skala mod",flv_smoothvideo:"Perlahankan video",flv_jscallback:"JS Callback",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field.."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/my_dlg.js b/js/tiny_mce/plugins/media/langs/my_dlg.js new file mode 100755 index 000000000..675092633 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.media_dlg',{list:"\u1005\u102c\u101b\u1004\u103a\u1038",file:"\u1016\u102d\u102f\u1004\u103a/URL",advanced:"\u1021\u1011\u1030\u1038",general:"\u1021\u1031\u1011\u103d\u1031\u1011\u103d",title:"\u1019\u102e\u1012\u102e\u101a\u102c \u103c\u1019\u103e\u102f\u1015\u103a\u1011\u100a\u103a\u1037 / \u103c\u1015\u102f\u103c\u1015\u1004\u103a",align_top_left:"\u1011\u102d\u1015\u103a\u1006\u1036\u102f\u1038\u1018\u101a\u103a\u1018\u1000\u103a",align_center:"\u1021\u101c\u101a\u103a\u1017\u101f\u102d\u102f",align_left:"\u1018\u101a\u103a",align_bottom:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001",align_right:"\u100a\u102c\u1018\u1000\u103a",align_top:"\u1011\u102d\u1015\u103a\u1015\u102d\u102f\u1004\u103a\u1038",qt_stream_warn:"Streamed rtsp resources \u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u1011\u1030\u1038 tab \u1031\u1021\u102c\u1000\u103a\u101b\u103e\u102d QT Src field \u1010\u103d\u1004\u103a \u1011\u100a\u103a\u1037\u101e\u1004\u103a\u1037\u101e\u100a\u103a\u104bn non streamed version \u1000\u102d\u102f\u101c\u100a\u103a\u1038 Src field.. \u1010\u103d\u1004\u103a \u1011\u100a\u103a\u1037\u1031\u1015\u1038\u101e\u1004\u103a\u1037\u101e\u100a\u103a\u104b",qtsrc:"QT SRC",progress:"\u101c\u102f\u1015\u103a\u1031\u1006\u102c\u1004\u103a\u1019\u103e\u102f \u1021\u1031\u103c\u1001\u1021\u1031\u1014",sound:"\u1021\u101e\u1036",swstretchvalign:"V-Align \u103c\u1016\u1004\u103a\u1037 \u1006\u103d\u1032\u1006\u1014\u103a\u1037",swstretchhalign:"H-Align \u103c\u1016\u1004\u103a\u1037 \u1006\u103d\u1032\u1006\u1014\u103a\u1037",swstretchstyle:"\u1006\u103d\u1032\u1006\u1014\u103a\u1037\u1019\u103e\u102f \u1005\u1010\u102d\u102f\u1004\u103a",scriptcallbacks:"Script callbacks",align_top_right:"\u1011\u102d\u1015\u103a\u1006\u1036\u102f\u1038 \u100a\u102c\u1018\u1000\u103a",uimode:"UI \u1019\u102f(\u1012\u103a)",rate:"\u1014\u103e\u102f\u1014\u103a\u1038",playcount:"\u1016\u103d\u1004\u103a\u1037\u101c\u103e\u1005\u103a\u1019\u103e\u102f \u1021\u1031\u101b\u1021\u1010\u103d\u1000\u103a",defaultframe:"\u1019\u1030\u101c \u1016\u101b\u102d\u1019\u103a",currentposition:"\u101c\u1000\u103a\u101b\u103e\u102d \u1031\u1014\u101b\u102c",currentmarker:"\u101c\u1000\u103a\u101b\u103e\u102d \u1021\u1019\u103e\u1010\u103a\u1021\u101e\u102c\u1038",captioningid:"\u1031\u1001\u102b\u1004\u103a\u1038\u1005\u1009\u103a\u1010\u1015\u103a\u103c\u1001\u1004\u103a\u1038 id",baseurl:"\u1021\u1031\u103c\u1001\u1001\u1036 URL",balance:"\u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1019\u103e\u102f",windowlessvideo:"\u101d\u1004\u103a\u1038\u1012\u102d\u102f\u1038\u1019\u1015\u102b\u1031\u101e\u102c \u1017\u103d\u102e\u1012\u102e\u101a\u102d\u102f",stretchtofit:"\u1021\u1036\u1037\u1000\u102d\u102f\u1000\u103a\u103c\u1016\u1005\u103a\u1031\u1005\u101b\u1014\u103a \u1006\u103d\u1032\u1006\u1014\u103a\u1037",mute:"\u1021\u101e\u1036\u1015\u102d\u1010\u103a",invokeurls:"\u1031\u1016\u102c\u103a\u103c\u1015 URL \u1019\u103b\u102c\u1038",fullscreen:"\u1005\u1000\u101b\u1004\u103a \u1021\u103c\u1015\u100a\u103a\u1037",enabled:"\u1016\u103d\u1004\u103a\u1037\u1011\u102c\u1038\u1031\u101e\u102c",autostart:"\u1021\u101c\u102d\u102f\u101c\u102d\u102f \u1005\u1016\u103d\u1004\u103a\u1037",volume:"\u1021\u101e\u1036 \u1021\u1010\u102d\u102f\u1038\u1021\u1000\u103b\u101a\u103a",target:"\u101b\u100a\u103a\u1019\u103e\u1014\u103a\u1038\u1001\u103b\u1000\u103a(\u1010\u102c\u1038\u1002\u1000\u103a)",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"\u1021\u1006\u1036\u102f\u1038\u101e\u1010\u103a\u1001\u103b\u102d\u1014\u103a",starttime:"\u1021\u1005\u103c\u1015\u102f\u1001\u103b\u102d\u1014\u103a",enablejavascript:"JavaScript \u1016\u103d\u1004\u103a\u1037\u101b\u1014\u103a",correction:"\u1021\u1019\u103e\u1014\u103a\u1019\u103c\u1015\u1004\u103a\u1015\u102b",targetcache:"\u1010\u102c\u1038\u1002\u1000\u103a cache",playeveryframe:"\u1016\u101b\u102d\u1019\u103a\u1021\u102c\u1038\u101c\u1036\u102f\u1038\u1000\u102d\u102f \u1016\u103d\u1004\u103a\u1037\u1015\u102b",kioskmode:"Kiosk \u1019\u102f(\u1012\u103a)",controller:"\u1011\u102d\u1014\u103a\u1038\u1001\u103b\u102f\u1015\u103a\u1001\u101c\u102f\u1015\u103a",menu:"\u1019\u102e\u1014\u1030\u1038\u1005\u102c\u101b\u1004\u103a\u1038\u1000\u102d\u102f \u103c\u1015\u1011\u102c\u1038\u1015\u102b",loop:"\u103c\u1015\u1014\u103a\u101b\u1005\u103a\u1016\u103d\u1004\u103a\u1037\u1015\u102b",play:"\u1021\u101c\u102d\u102f\u101c\u102d\u102f\u1016\u103d\u1004\u103a\u1037",hspace:"H-\u1000\u103d\u1000\u103a\u101c\u1015\u103a",vspace:"V-\u1000\u103d\u1000\u103a\u101c\u1015\u103a",class_name:"class \u1021\u1019\u100a\u103a",name:"\u1021\u1019\u100a\u103a",id:"ID",type:"\u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038",size:"\u1021\u1010\u102d\u102f\u1004\u103a\u1038\u1021\u1011\u103d\u102c\u1019\u103b\u102c\u1038",preview:"\u1021\u1005\u1019\u103a\u1038\u103c\u1000\u100a\u103a\u1037\u101b\u1014\u103a",constrain_proportions:"\u103c\u1019\u1004\u103a\u1000\u103d\u1004\u103a\u1038\u1021\u1001\u103b\u102d\u102f\u1038\u1000\u102d\u102f \u1011\u102d\u1014\u103a\u1038\u100a\u103e\u102d\u1015\u102b",controls:"\u1011\u102d\u1014\u103a\u1038\u1001\u103b\u102f\u1015\u103a\u1019\u103e\u102f\u1019\u103b\u102c\u1038",numloop:"\u103c\u1015\u1014\u103a\u101b\u1005\u103a\u101b\u1014\u103a \u1021\u103c\u1000\u102d\u1019\u103a\u1021\u1031\u101b\u1021\u1010\u103d\u1000\u103a",console:"CONSOLE",cache:"CACHE",autohref:"\u1021\u101c\u102d\u102f\u101c\u102d\u102fHREF\u1011\u100a\u103a\u1037",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"\u1021\u1031\u103c\u1001\u1001\u1036",bgcolor:"\u1031\u1014\u102c\u1000\u103a\u1001\u1036",wmode:"WMode",salign:"SAlign",align:"Align",scale:"\u1005\u1031\u1000\u1038",quality:"\u1021\u101b\u100a\u103a\u1021\u1031\u101e\u103d\u1038",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain aspect",imagestatus:"\u101b\u102f\u1015\u103a\u1015\u1036\u102f\u1021\u1031\u103c\u1001\u1021\u1031\u1014",center:"\u1021\u101c\u101a\u103a\u1017\u101f\u102d\u102f",autogotourl:"\u1021\u101c\u102d\u102f\u101c\u102d\u102f\u101e\u103d\u102c\u1038\u101b\u1014\u103a URL",shockwave_options:"Shockwave \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",rmp_options:"Real media player \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",wmp_options:"Windows media player \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",qt_options:"Quicktime \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",flash_options:"Flash \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",hidden:"\u101d\u103e\u1000\u103a\u1011\u102c\u1038\u1031\u101e\u102c",align_bottom_left:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001\u1018\u101a\u103a",align_bottom_right:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001\u100a\u102c",flv_options:"Flash \u1017\u103d\u102e\u1012\u102e\u101a\u102d\u102f\u1006\u102d\u102f\u1004\u103a\u101b\u102c \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",flv_scalemode:"\u1005\u1031\u1000\u1038 mode",flv_buffer:"Buffer",flv_startimage:"\u1021\u1005\u101b\u102f\u1015\u103a\u1015\u1036\u102f",flv_starttime:"\u1005\u1010\u1004\u103a\u1001\u103b\u102d\u1014\u103a",flv_defaultvolume:"\u1019\u1030\u101c \u1021\u101e\u1036\u1021\u1000\u103b\u101a\u103a",flv_hiddengui:"Hidden GUI",flv_autostart:"\u1021\u101c\u102d\u102f\u101c\u102d\u102f\u1005\u1016\u103d\u1004\u103a\u1037",flv_loop:"\u103c\u1015\u1014\u103a\u1031\u1000\u103b\u102c\u1037",flv_showscalemodes:"\u1005\u1031\u1000\u1038 mode\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u103c\u1015\u1015\u102b",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback",html5_video_options:"HTML5 \u1017\u103d\u102e\u1012\u102e\u101a\u102d\u102f \u1031\u101b\u103d\u1038\u1001\u103b\u101a\u103a\u1005\u101b\u102c\u1019\u103b\u102c\u1038",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"\u1015\u102d\u102f\u1005\u1010\u102c",source:"\u101b\u1004\u103a\u1038\u103c\u1019\u1005\u103a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/nb_dlg.js b/js/tiny_mce/plugins/media/langs/nb_dlg.js new file mode 100755 index 000000000..e8fe8b692 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.media_dlg',{list:"Liste",file:"Fil/URL",advanced:"Avansert",general:"Generelt",title:"Sett inn / rediger inkludert objekt","align_top_left":"Topp venstre","align_center":"Midtstill","align_left":"Venstre","align_bottom":"Bunn","align_right":"H\u00f8yre","align_top":"Topp","qt_stream_warn":"Streamede rtsp-ressurser b\u00f8r legges til QT Src-felt i avansert-fanen.\\nDu b\u00f8r ogs\u00e5 legge til en ikke-streamet versjon i Src-felt",qtsrc:"QT Src",progress:"Framdrift",sound:"Lyd",swstretchvalign:"Strekk V-justering",swstretchhalign:"Strekk H-justering",swstretchstyle:"Strekkstil",scriptcallbacks:"Skript-referanser","align_top_right":"Topp h\u00f8yre",uimode:"UI-modus",rate:"Rate",playcount:"Teller",defaultframe:"Standardramme",currentposition:"Aktiv posisjon",currentmarker:"Aktiv mark\u00f8r",captioningid:"Fang opp id",baseurl:"Utgangsadresse (URL)",balance:"Balanse",windowlessvideo:"Video uten vindu",stretchtofit:"Strekk for \u00e5 passe inn",mute:"Demp",invokeurls:"Aktiviser URL-er",fullscreen:"Fullskjerm",enabled:"Kj\u00f8rbar",autostart:"Autostart",volume:"Volum",target:"M\u00e5l",qtsrcchokespeed:"Choke-hastighet",href:"Href",endtime:"Stopptid",starttime:"Starttid",enablejavascript:"Tillat Javaskript",correction:"Ingen korreksjon",targetcache:"M\u00e5l-mellomlagring",playeveryframe:"Spill hver ramme",kioskmode:"Kiosk-modus",controller:"Kontroller",menu:"Vis meny",loop:"L\u00f8kke",play:"Autostart",hspace:"Horisontal avstand",vspace:"Vertikal avstand","class_name":"Klasse",name:"Navn",id:"Id",type:"Type",size:"St\u00f8rrelse",preview:"Forh\u00e5ndsvisning","constrain_proportions":"Behold st\u00f8rrelsesforhold",controls:"Kontroller",numloop:"Antall gjennoml\u00f8p",console:"Konsoll",cache:"Mellomlager",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash-variabler",base:"Base",bgcolor:"Bakgrunn",wmode:"W-modus",salign:"S-justering",align:"Justering",scale:"Skalering",quality:"Kvalitet",shuffle:"Miks",prefetch:"Forh\u00e5ndsregistrer",nojava:"Ingen Java",maintainaspect:"Behold st\u00f8rrelsesforhold",imagestatus:"Bildestatus",center:"Midtstill",autogotourl:"Auto-g\u00e5-til-URL","shockwave_options":"Shockwave-innstillinger","rmp_options":"Real mediaplayer-innstillinger","wmp_options":"Windows mediaplayer-innstillinger","qt_options":"Quicktime-innstillinger","flash_options":"Flash-egenskaper",hidden:"Skjult","align_bottom_left":"Bunn venstre","align_bottom_right":"Bunn h\u00f8yre","flv_options":"Flash video-valg","flv_scalemode":"Skalering","flv_buffer":"Buffer","flv_startimage":"Startbilde","flv_starttime":"Starttid","flv_defaultvolume":"Standardvolum","flv_hiddengui":"Skjult GUI","flv_autostart":"Auto-start","flv_loop":"L\u00f8kke","flv_showscalemodes":"Vis skalering","flv_smoothvideo":"Jevn video","flv_jscallback":"JS-tilbakekall","html5_video_options":"HTML5-videovalg",altsource1:"Alternativ kilde 1",altsource2:"Alternativ kilde 2",preload:"Forh\u00e5ndsvis",poster:"Poster",source:"Kilde"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/nl_dlg.js b/js/tiny_mce/plugins/media/langs/nl_dlg.js new file mode 100755 index 000000000..22da230cd --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.media_dlg',{list:"Lijst",file:"Bestand/URL",advanced:"Geavanceerd",general:"Algemeen",title:"Media invoegen/bewerken","align_top_left":"Linksboven","align_center":"Centreren","align_left":"Links","align_bottom":"Onder","align_right":"Rechts","align_top":"Boven","qt_stream_warn":"Gestreamde RTSP bronnen dienen op het tabblad geavanceerd bij Quicktime bron te worden opgegeven.\\nDe niet-gestreamde versie kan dan bij het tabblad algemeen worden opgegeven.",qtsrc:"Quicktime bron",progress:"Voortgang",sound:"Geluid",swstretchvalign:"V-Schaal",swstretchhalign:"H-Schaal",swstretchstyle:"Schaal",scriptcallbacks:"Script callbacks","align_top_right":"Rechtsboven",uimode:"UI Modus",rate:"Snelheid",playcount:"Afspeelteller",defaultframe:"Standaard frame",currentposition:"Huidige positie",currentmarker:"Huidige markering",captioningid:"Ondertiteling id",baseurl:"Basis URL",balance:"Balans",windowlessvideo:"Video zonder venster",stretchtofit:"Passend maken",mute:"Dempen",invokeurls:"URLs laden",fullscreen:"Volledig scherm",enabled:"Ingeschakeld",autostart:"Automatisch afspelen",volume:"Volume",target:"Doel",qtsrcchokespeed:"Chokesnelheid",href:"Href",endtime:"Eindtijd",starttime:"Starttijd",enablejavascript:"JavaScript Inschakelen",correction:"Geen correctie",targetcache:"Doelcache",playeveryframe:"Elk frame afspelen",kioskmode:"Kioskmodus",controller:"Controller",menu:"Menu weergeven",loop:"Herhalen",play:"Automatisch afspelen",hspace:"H-Ruimte",vspace:"V-Ruimte","class_name":"Klasse",name:"Naam",id:"Id",type:"Type",size:"Afmetingen",preview:"Voorbeeld","constrain_proportions":"Verhouding bewaren",controls:"Bediening",numloop:"Aantal herhalingen",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Variabelen",base:"Basis",bgcolor:"Achtergrond",wmode:"WMode",salign:"Schaaluitlijning",align:"Uitlijning",scale:"Schaal",quality:"Kwaliteit",shuffle:"Willekeurige volgorde",prefetch:"Voorladen",nojava:"Geen java",maintainaspect:"Verhouding bewaren",imagestatus:"Afbeeldingstatus",center:"Centreren",autogotourl:"Automatisch naar URL","shockwave_options":"Shockwave opties","rmp_options":"Real mediaspeler opties","wmp_options":"Windows mediaspeler opties","qt_options":"Quicktime opties","flash_options":"Flash opties",hidden:"Verborgen","align_bottom_left":"Linksonder","align_bottom_right":"Rechtsonder","flv_options":"Flash video-opties","flv_scalemode":"Schaalmodus","flv_buffer":"Buffer","flv_startimage":"Startafbeelding","flv_starttime":"Starttijd","flv_defaultvolume":"Standaard volume","flv_hiddengui":"GUI verbergen","flv_autostart":"Automatisch afspelen","flv_loop":"Herhalen","flv_showscalemodes":"Schaalmodus weergeven","flv_smoothvideo":"Soepele video","flv_jscallback":"JS Callback","html5_video_options":"HTML5 Video Opties",altsource1:"Alternatieve bron 1",altsource2:"Alternatieve bron 2",preload:"Voorladen",poster:"Poster",source:"Bron"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/nn_dlg.js b/js/tiny_mce/plugins/media/langs/nn_dlg.js new file mode 100755 index 000000000..e223605dd --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.media_dlg',{list:"Liste",file:"Fil/URL",advanced:"Avansert",general:"Generelt",title:"Set inn / rediger inkludert objekt",align_top_left:"Topp venstre",align_center:"Midt",align_left:"Venstre",align_bottom:"Botn",align_right:"H\u00f8gre",align_top:"Topp",qt_stream_warn:"Streama rtsp-ressursar b\u00f8r leggsst til QT Src field i avansert-fana.\\nDu b\u00f8r ogs\u00e5 leggje til ein ikkje-streama versjon i src field",qtsrc:"QT Src",progress:"Framdrift",sound:"Lyd",swstretchvalign:"Strekk V-justering",swstretchhalign:"Strekk H-justering",swstretchstyle:"Strekkstil",scriptcallbacks:"Skript-referanser",align_top_right:"Top h\u00f8gre",uimode:"UI-modus",rate:"Rate",playcount:"Tellar",defaultframe:"Standardramme",currentposition:"Aktiv posisjon",currentmarker:"Aktiv mark\u00f8r",captioningid:"Fange opp id",baseurl:"Base URL",balance:"Balanse",windowlessvideo:"Video utan vindauge",stretchtofit:"Strekk for \u00e5 passe inn",mute:"Demp",invokeurls:"Aktiviser URL-ar",fullscreen:"Fullskjerm",enabled:"K\u00f8yrbar",autostart:"Autostart",volume:"Volum",target:"M\u00e5l",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Stopptid",starttime:"Starttid",enablejavascript:"Tillat Javaskript",correction:"Ingen korreksjon",targetcache:"M\u00e5l-cache",playeveryframe:"Spel kvar ramme",kioskmode:"Kiosk-modus",controller:"Kontroller",menu:"Vis meny",loop:"Lykkje",play:"Autostart",hspace:"Horisontal avstand",vspace:"Vertikal avstand",class_name:"Klasse",name:"Namn",id:"Id",type:"Type",size:"Storleik",preview:"Sj\u00e5 f\u00f8rebels utkast",constrain_proportions:"Behald proporsjonar",controls:"Kontroller",numloop:"Antal gjennoml\u00f8p",console:"Konsoll",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash-variablar",base:"Base",bgcolor:"Bakgrunn",wmode:"W-modus",salign:"S-justering",align:"Justering",scale:"Skalering",quality:"Kvalitet",shuffle:"Miks",prefetch:"Registrer p\u00e5 f\u00f8rehand",nojava:"Ikke Java",maintainaspect:"Behald proporsjonar",imagestatus:"Status for bilete",center:"Midtstill",autogotourl:"Auto-g\u00e5-til-URL",shockwave_options:"Shockwave-innstillinger",rmp_options:"Real mediaplayer-innstillingar",wmp_options:"Windows mediaplayer-innstillingar",qt_options:"Quicktime-innstillingar",flash_options:"Flash-eigenskapar",hidden:"Skjult",align_bottom_left:"Botn venste",align_bottom_right:"Botn h\u00f8gre",flv_options:"Flash video-val",flv_scalemode:"Skalering",flv_buffer:"Buffer",flv_startimage:"Startbilde",flv_starttime:"Starttid",flv_defaultvolume:"Standardvolum",flv_hiddengui:"Skjult GUI",flv_autostart:"Autostart",flv_loop:"L\u00f8kke",flv_showscalemodes:"Vis skalering",flv_smoothvideo:"Jamn video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/no_dlg.js b/js/tiny_mce/plugins/media/langs/no_dlg.js new file mode 100755 index 000000000..7d5c9a089 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.media_dlg',{list:"Liste",file:"Fil/URL",advanced:"Avansert",general:"Generelt",title:"Sett inn/rediger inkludert objekt","align_top_left":"Topp venstre","align_center":"Midten","align_left":"Venstre","align_bottom":"Bunn","align_right":"H\u00f8yre","align_top":"Topp","qt_stream_warn":"Streamede rtsp ressurser b\u00f8r legges til QT Src-feltet under fanen avansert.\\nDu b\u00f8r ogs\u00e5 legge til en ikke-streamet versjon i src-feltet.",qtsrc:"QT Src",progress:"Fremdrift",sound:"Lyd",swstretchvalign:"Strekk V-justering",swstretchhalign:"Strekk H-justering",swstretchstyle:"Strekk stil",scriptcallbacks:"Skript referanser","align_top_right":"Topp h\u00f8yre",uimode:"UI-modus",rate:"Rate",playcount:"Teller",defaultframe:"Standard ramme",currentposition:"Aktiv posisjon",currentmarker:"Aktiv mark\u00f8r",captioningid:"Fange opp id",baseurl:"Utgangsadresse (URL)",balance:"Balanse",windowlessvideo:"Video uten vindu",stretchtofit:"Strekk for \u00e5 passe",mute:"Dempe",invokeurls:"Aktiver URLer",fullscreen:"Fullskjerm",enabled:"Aktivert",autostart:"Autostart",volume:"Volum",target:"M\u00e5l",qtsrcchokespeed:"Choke-hastighet",href:"Href",endtime:"Stopp tid",starttime:"Start tid",enablejavascript:"Tillat Javaskript",correction:"Ingen korreksjon",targetcache:"M\u00e5l-mellomlagring",playeveryframe:"Spill hver ramme",kioskmode:"Kiosk-modus",controller:"Kontroller",menu:"Vis meny",loop:"L\u00f8kke",play:"Autostart",hspace:"H-avstand",vspace:"V-avstand","class_name":"Klasse",name:"Navn",id:"Id",type:"Type",size:"Dimmensjoner",preview:"Forh\u00e5ndsvis","constrain_proportions":"Behold proporsjoner",controls:"Kontroller",numloop:"Antall gjennomganger",console:"Konsoll",cache:"Mellomlager",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash variabler",base:"Base",bgcolor:"Bakgrunn",wmode:"W-modus",salign:"S-justering",align:"Justering",scale:"Skala",quality:"Kvalitet",shuffle:"Mikse",prefetch:"Hente p\u00e5 forh\u00e5nd",nojava:"Ingen Java",maintainaspect:"Behold st\u00f8rrelsesforhold",imagestatus:"Bildestatus",center:"Midtstill",autogotourl:"Auto g\u00e5-til URL","shockwave_options":"Shockwave egenskaper","rmp_options":"Real mediaplayer egenskaper","wmp_options":"Windows Media Player egenskaper","qt_options":"Quicktime egenskaper","flash_options":"Flash egenskaper",hidden:"Skjult","align_bottom_left":"Bunn venste","align_bottom_right":"Bunn h\u00f8gre","flv_options":"Flash video egenskaper","flv_scalemode":"Skalerings modus","flv_buffer":"Buffer","flv_startimage":"Startbilde","flv_starttime":"Starttid","flv_defaultvolume":"Standardvolum","flv_hiddengui":"Skjult GUI","flv_autostart":"Autostart","flv_loop":"L\u00f8kke","flv_showscalemodes":"Vis skalering","flv_smoothvideo":"Jevn video","flv_jscallback":"JS-tilbakekall","html5_video_options":"HTML5-videovalg",altsource1:"Alternativ kilde 1",altsource2:"Alternativ kilde 2",preload:"Forh\u00e5ndsvis",poster:"Poster",source:"Kilde"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/pl_dlg.js b/js/tiny_mce/plugins/media/langs/pl_dlg.js new file mode 100755 index 000000000..7b8695faa --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.media_dlg',{list:"Lista",file:"Plik/URL",advanced:"Zaawansowane",general:"G\u0142\u00f3wne",title:"Wstaw/Edytuj wbudowane media","align_top_left":"G\u00f3rny lewy","align_center":"\u015arodek","align_left":"Lewo","align_bottom":"D\u00f3\u0142","align_right":"Prawo","align_top":"G\u00f3ra","qt_stream_warn":"Emitowane \u017ar\u00f3d\u0142a rtsp powinny by\u0107 dodane do pola QT Src w zak\u0142adce zaawansowane.nPowiniene\u015b r\u00f3wnie\u017c doda\u0107 niestrumieniow\u0105 wersj\u0119 do pola Src.",qtsrc:"QT Src",progress:"Post\u0119p",sound:"D\u017awi\u0119k",swstretchvalign:"Wyr\u00f3wnaj w pionie",swstretchhalign:"Wyr\u00f3wnaj w poziomie",swstretchstyle:"Styl rozci\u0105gania",scriptcallbacks:"Funkcje zwrotne skryptu","align_top_right":"G\u00f3rny prawy",uimode:"Tryb UI",rate:"Tempo",playcount:"Ilo\u015b\u0107 odtworze\u0144",defaultframe:"Domy\u015blna ramka",currentposition:"Aktualna pozycja",currentmarker:"Aktualny znacznik",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balans",windowlessvideo:"Wideo bez okienka",stretchtofit:"Rozci\u0105gnij aby dopasowa\u0107",mute:"Wycisz",invokeurls:"Odwo\u0142aj si\u0119 do URLi",fullscreen:"Pe\u0142ny ekran",enabled:"Aktywny",autostart:"Auto start",volume:"G\u0142o\u015bno\u015b\u0107",target:"Cel",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Ko\u0144cowy czas",starttime:"Pocz\u0105tkowy czas",enablejavascript:"W\u0142\u0105cz JavaScript",correction:"Bez korekcji",targetcache:"Target cache",playeveryframe:"Odtwarzaj ka\u017cd\u0105 ramk\u0119",kioskmode:"Tryb kiosku",controller:"Kontroler",menu:"Poka\u017c menu",loop:"Zap\u0119tlenie",play:"Autoodtwarzanie",hspace:"H-Space",vspace:"V-Space","class_name":"Klasa",name:"Nazwa",id:"Id",type:"Typ",size:"Wymiary",preview:"Podgl\u0105d","constrain_proportions":"Zachowaj proporcje",controls:"Controls",numloop:"Liczba powt\u00f3rze\u0144",console:"Konsola",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Baza",bgcolor:"T\u0142o",wmode:"WMode",salign:"SAlign",align:"Wyr\u00f3wnaj",scale:"Skala",quality:"Jako\u015b\u0107",shuffle:"Losuj",prefetch:"Prze\u0142aduj",nojava:"Bez javy",maintainaspect:"Utrzymaj aspekt",imagestatus:"Obraz statusu",center:"Wy\u015brodkuj",autogotourl:"Automatycznie przejd\u017a pod adres","shockwave_options":"Opcje Shockwave","rmp_options":"Opcje Real media player","wmp_options":"Opcje Windows media player","qt_options":"Opcje Quicktime","flash_options":"Opcje flasha",hidden:"Ukryty","align_bottom_left":"Dolny lewy","align_bottom_right":"Dolny prawy","flv_options":"Opcje wideo flasha","flv_scalemode":"Tryb skalowania","flv_buffer":"Bufor","flv_startimage":"Obraz startowy","flv_starttime":"Czas startu","flv_defaultvolume":"Domy\u015blna g\u0142o\u015bno\u015b\u0107","flv_hiddengui":"Ukryte GUI","flv_autostart":"Autostart","flv_loop":"Zap\u0119tlaj","flv_showscalemodes":"Pokazuj tryby skali","flv_smoothvideo":"P\u0142ynne wideo","flv_jscallback":"Funkcja zwrotna JS","html5_video_options":"Opcje HTML5 Video",altsource1:"Alternatywne \u017ar\u00f3d\u0142o 1",altsource2:"Alternatywne \u017ar\u00f3d\u0142o 2",preload:"Prze\u0142aduj",poster:"Obraz",source:"\u0179r\u00f3d\u0142o"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ps_dlg.js b/js/tiny_mce/plugins/media/langs/ps_dlg.js new file mode 100755 index 000000000..f9d802ef4 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/pt_dlg.js b/js/tiny_mce/plugins/media/langs/pt_dlg.js new file mode 100755 index 000000000..0747dd04e --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.media_dlg',{list:"Lista",file:"Arquivo/URL",advanced:"Avan\u00e7ado",general:"Geral",title:"Inserir/Editar m\u00eddia incorporada",align_top_left:"Topo esquerda",align_center:"Centro",align_left:"Esquerda",align_bottom:"Abaixo",align_right:"Direita",align_top:"Topo",qt_stream_warn:"Fluxos de recursos rtsp devem ser acrescentados ao campo QT Src no Modo Avan\u00e7ado.\\Numa vers\u00e3o sem fluxo tamb\u00e9m deve ser acrescentada ao campo Src.",qtsrc:"QT Src",progress:"Progresso",sound:"Som",swstretchvalign:"For\u00e7ar V-Alinhamento",swstretchhalign:"For\u00e7ar H-Alinhamento",swstretchstyle:"For\u00e7ar Estilo",scriptcallbacks:"Retornos de script",align_top_right:"Topo direita",uimode:"Modo UI",rate:"Taxa",playcount:"Contagem de ouvintes",defaultframe:"Frame padr\u00e3o",currentposition:"Posi\u00e7\u00e3o atual",currentmarker:"Marcador atual",captioningid:"Id de legenda",baseurl:"URL Base",balance:"Stereo",windowlessvideo:"V\u00eddeo sem janela",stretchtofit:"Estender",mute:"Mudo",invokeurls:"Chamar URLs",fullscreen:"Tela inteira",enabled:"Ativado",autostart:"Execu\u00e7\u00e3o autom\u00e1tica",volume:"Volume",target:"Alvo",qtsrcchokespeed:"Diminuir Velocidade",href:"Link",endtime:"Hora do fim",starttime:"Hora de in\u00edcio",enablejavascript:"Disponibilizar javaScript",correction:"Sem correc\u00e7\u00f5es",targetcache:"Cache alvo",playeveryframe:"Executar todas as frames",kioskmode:"Modo Quiosque",controller:"Controlador",menu:"Mostrar menu",loop:"Repeti\u00e7\u00e3o autom\u00e1tica",play:"Execu\u00e7\u00e3o autom\u00e1tica",hspace:"Espa\u00e7o horizontal",vspace:"Espa\u00e7o vertical",class_name:"Classe",name:"Nome",id:"Id",type:"Tipo",size:"Dimens\u00f5es",preview:"Previs\u00e3o",constrain_proportions:"Manter propor\u00e7\u00f5es",controls:"Controles",numloop:"Repeti\u00e7\u00f5es",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Fundo",wmode:"WMode",salign:"SAlign",align:"Alinhamento",scale:"Escala",quality:"Qualidade",shuffle:"Aleat\u00f3rio",prefetch:"Pr\u00e9-buscar",nojava:"Sem java",maintainaspect:"Manter aspecto",imagestatus:"Status da imagem",center:"Centro",autogotourl:"Auto abrir URL",shockwave_options:"Op\u00e7\u00f5es Shockwave",rmp_options:"Op\u00e7\u00f5es Real Media Player",wmp_options:"Op\u00e7\u00f5es Windows Media Player",qt_options:"Op\u00e7\u00f5es Quicktime",flash_options:"Op\u00e7\u00f5es Flash",hidden:"Oculto",align_bottom_left:"Abaixo esquerda",align_bottom_right:"Abaixo direita",flv_options:"Op\u00e7\u00f5es de Flash video",flv_scalemode:"Modo escala",flv_buffer:"Buffer",flv_startimage:"Imagem inicial",flv_starttime:"Hora inicial",flv_defaultvolume:"Volume padr\u00e3o",flv_hiddengui:"GUI oculta",flv_autostart:"Execu\u00e7\u00e3o Autom\u00e1tica",flv_loop:"Repeti\u00e7\u00e3o",flv_showscalemodes:"Mostrar modos escala",flv_smoothvideo:"Suavilizar video",flv_jscallback:"Retorno de JS",html5_video_options:"Op\u00e7\u00f5es de v\u00eddeo HTML5",altsource1:"C\u00f3digo alternativo 1",altsource2:"C\u00f3digo alternativo 2",preload:"Pr\u00e9-carregar",poster:"Poster",source:"Fonte"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ro_dlg.js b/js/tiny_mce/plugins/media/langs/ro_dlg.js new file mode 100755 index 000000000..7c08c7a24 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.media_dlg',{list:"List\u0103",file:"Fi\u015fier/URL",advanced:"Avansat\u0103",general:"General",title:"Insereaz\u0103 / editeaz\u0103 media",align_top_left:"St\u00e2nga sus",align_center:"Centru",align_left:"St\u00e2nga",align_bottom:"Jos",align_right:"Dreapta",align_top:"Sus",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progres",sound:"Sunet",swstretchvalign:"Stretch V-Aliniere",swstretchhalign:"Stretch H-Aliniere",swstretchstyle:"Stil strech",scriptcallbacks:"Script callback",align_top_right:"Dreapta sus",uimode:"Mod UI",rate:"Vot",playcount:"Numar red\u0103ri",defaultframe:"Frame implicit",currentposition:"Pozi\u0163ie curent\u0103",currentmarker:"Marcator curent",captioningid:"Titlu id",baseurl:"URL baz\u0103",balance:"Balan\u0163\u0103",windowlessvideo:"Video f\u0103r\u0103 fereastr\u0103",stretchtofit:"\u00centinde pentru a se \u00eencadra",mute:"Mut",invokeurls:"Invoc\u0103 URL-uri",fullscreen:"Ecran complet",enabled:"Activat",autostart:"Pornire automat\u0103",volume:"Volum",target:"Tin\u0163a",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Timp de sf\u00e2r\u015fit",starttime:"Timp de \u00eenceput",enablejavascript:"Activeaz\u0103 JavaScript",correction:"F\u0103r\u0103 corecturi",targetcache:"Target cache",playeveryframe:"Red\u0103 fiecare frame",kioskmode:"Mod Kiosk",controller:"Controler",menu:"Arat\u0103 meniu",loop:"Repetare",play:"Redare automat\u0103",hspace:"H-Space",vspace:"V-Space",class_name:"Clas\u0103",name:"Nume",id:"Id",type:"Tip",size:"Dimensiuni",preview:"Previzualizare",constrain_proportions:"Men\u0163inere propor\u0163ii",controls:"Controale",numloop:"Num\u0103r de repet\u0103ri",console:"Consola",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Variabile Flash",base:"URL de baza",bgcolor:"Fundal",wmode:"WMode",salign:"SAlign",align:"Aliniere",scale:"Scar\u0103",quality:"Calitate",shuffle:"Aleator",prefetch:"Prefetch",nojava:"F\u0103r\u0103 java",maintainaspect:"Men\u0163ine aspect",imagestatus:"Status imagine",center:"Centru",autogotourl:"Auto goto URL",shockwave_options:"Op\u0163iuni Shockwave",rmp_options:"Op\u0163iuni Real media player",wmp_options:"Op\u0163iuni Windows media player",qt_options:"Op\u0163iuni QuickTime",flash_options:"Op\u0163iuni Flash",hidden:"Ascuns",align_bottom_left:"St\u00e2nga jos",align_bottom_right:"Dreapta jos",flv_options:"Op\u0163iuni Flash video",flv_scalemode:"Moduri scal\u0103",flv_buffer:"Buffer",flv_startimage:"Imagine start ",flv_starttime:"Timp start",flv_defaultvolume:"Volum implicit",flv_hiddengui:"GUI ascuns",flv_autostart:"Auto pornire",flv_loop:"Repetare",flv_showscalemodes:"Afi\u015fare moduri scalare",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ru_dlg.js b/js/tiny_mce/plugins/media/langs/ru_dlg.js new file mode 100755 index 000000000..8d19a3afa --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.media_dlg',{list:"\u0421\u043f\u0438\u0441\u043e\u043a",file:"\u0410\u0434\u0440\u0435\u0441",advanced:"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e",general:"\u041e\u0431\u0449\u0435\u0435",title:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043b\u0438\u043f\u0430","align_top_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_center":"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443","align_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_bottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_top":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","qt_stream_warn":"\u041f\u043e\u0442\u043e\u043a\u043e\u0432\u044b\u0435 rtsp \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 QT Src.",qtsrc:"QT Src",progress:"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441",sound:"\u0417\u0432\u0443\u043a",swstretchvalign:"\u0412\u0435\u0440. \u0432\u044b\u0440-\u0435 \u0440\u0430\u0441\u0442\u044f\u0436\u0435\u043d\u0438\u044f",swstretchhalign:"\u0413\u043e\u0440. \u0432\u044b\u0440-\u0435 \u0440\u0430\u0441\u0442\u044f\u0436\u0435\u043d\u0438\u044f",swstretchstyle:"\u0421\u0442\u0438\u043b\u044c \u0440\u0430\u0441\u0442\u044f\u0436\u0435\u043d\u0438\u0435",scriptcallbacks:"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430","align_top_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e",uimode:"\u0420\u0435\u0436\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",rate:"\u0420\u0435\u0439\u0442\u0438\u043d\u0433",playcount:"\u0429\u0435\u0442\u0447\u0438\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439",defaultframe:"\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u0430\u0434\u0440",currentposition:"\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f",currentmarker:"\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u043a\u0435\u0440",captioningid:"\u0418\u043c\u044f \u0441\u0443\u0431\u0442\u0438\u0442\u0440\u043e\u0432",baseurl:"\u0411\u0430\u0437\u043e\u0440\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441",balance:"\u0411\u0430\u043b\u0430\u043d\u0441",windowlessvideo:"\u041e\u043a\u043e\u043d\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e",stretchtofit:"\u041f\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430",mute:"\u0411\u0435\u0437 \u0437\u0432\u0443\u043a\u0430",invokeurls:"\u0412\u044b\u0437\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441",fullscreen:"\u041d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d",enabled:"\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043e",autostart:"\u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a",volume:"\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c",target:"\u0426\u0435\u043b\u044c",qtsrcchokespeed:"Choke speed",href:"\u0421\u0441\u044b\u043b\u043a\u0430",endtime:"\u0412\u0440\u0435\u043c\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f",starttime:"\u0412\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430",enablejavascript:"\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c JavaScript",correction:"\u0411\u0435\u0437 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0438",targetcache:"\u041a\u044d\u0448 \u0446\u0435\u043b\u0438",playeveryframe:"\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440",kioskmode:"\u0420\u0435\u0436\u0438\u043c \u043a\u0438\u043e\u0441\u043a",controller:"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435",menu:"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u044e",loop:"\u041f\u043e\u0432\u0442\u043e\u0440",play:"\u0410\u0432\u0442\u0437\u0430\u043f\u0443\u0441\u043a",hspace:"\u0413\u043e\u0440. \u043e\u0442\u0441\u0442\u0443\u043f",vspace:"\u0412\u0435\u0440\u0442. \u043e\u0442\u0441\u0442\u0443\u043f","class_name":"\u041a\u043b\u0430\u0441\u0441",name:"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435",id:"\u0418\u043c\u044f",type:"\u0422\u0438\u043f",size:"\u0420\u0430\u0437\u043c\u0435\u0440\u044b",preview:"\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440","constrain_proportions":"\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438",controls:"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435",numloop:"\u041f\u043e\u0432\u0442\u043e\u0440\u044b",console:"\u041a\u043e\u043d\u0441\u043e\u043b\u044c",cache:"\u041a\u044d\u0448",autohref:"\u0410\u0432\u0442\u043e-\u0441\u0441\u044b\u043b\u043a\u0430",liveconnect:"SWLiveConnect",flashvars:"Flash \u043a\u043e\u043c\u0430\u043d\u0434\u044b",base:"Base",bgcolor:"\u0424\u043e\u043d",wmode:"\u041e\u043a\u043d\u043e",salign:"\u0412\u044b\u0440-\u0435",align:"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435",scale:"\u041e\u0431\u043b\u0430\u0441\u0442\u044c",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",shuffle:"\u0412 \u0440\u0430\u0437\u0431\u0440\u043e\u0441",prefetch:"\u0423\u043f\u0440\u0435\u0436\u0434\u0430\u044e\u0449\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430",nojava:"\u0411\u0435\u0437 Java",maintainaspect:"\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440",imagestatus:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",center:"\u0426\u0435\u043d\u0442\u0440",autogotourl:"\u0410\u0432\u0442\u043e\u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441","shockwave_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Shockwave","rmp_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Real Media","wmp_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Windows Media","qt_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Quicktime","flash_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Flash",hidden:"\u0421\u043a\u0440\u044b\u0442\u044b\u0439","align_bottom_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_bottom_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","flv_options":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Flash","flv_scalemode":"\u041c\u0430\u0441\u0448\u0442\u0430\u0431","flv_buffer":"\u0411\u0443\u0444\u0435\u0440","flv_startimage":"\u0421\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","flv_starttime":"\u0421\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f","flv_defaultvolume":"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0437\u0432\u0443\u043a","flv_hiddengui":"\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441","flv_autostart":"\u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a","flv_loop":"\u041f\u043e\u0432\u0442\u043e\u0440","flv_showscalemodes":"\u0420\u0435\u0436\u0438\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430","flv_smoothvideo":"\u041f\u043b\u0430\u0432\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e","flv_jscallback":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JS","html5_video_options":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b HTML5 Video",altsource1:"\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a 1",altsource2:"\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a 2",preload:"\u041f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430",poster:"\u041f\u043e\u0441\u0442\u0435\u0440",source:"\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sc_dlg.js b/js/tiny_mce/plugins/media/langs/sc_dlg.js new file mode 100755 index 000000000..679998cf5 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6/\u7f51\u5740",advanced:"\u9ad8\u7ea7",general:"\u4e00\u822c",title:"\u63d2\u5165/\u7f16\u8f91\u5d4c\u5165\u5a92\u4f53",align_top_left:"\u5de6\u4e0a",align_center:"\u4e2d\u95f4",align_left:"\u9760\u5de6",align_bottom:"\u4e0b\u65b9",align_right:"\u9760\u53f3",align_top:"\u4e0a\u65b9",qt_stream_warn:"\u6d41\u5f0frtsp\u8d44\u6e90\u5e94\u8be5\u6dfb\u52a0\u5230\u300c\u9ad8\u7ea7\u300d\u4e2dQT Src\u3002 \\n\u540c\u65f6\u6dfb\u52a0\u975e\u6d41\u5f0f\u8d44\u6e90\u5230Src\u3002 ",qtsrc:"QT Src",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u5782\u76f4\u62c9\u5347",swstretchhalign:"\u6c34\u51c6\u62c9\u5347",swstretchstyle:"\u62c9\u5347\u6a21\u5f0f",scriptcallbacks:"\u811a\u672c\u56de\u8c03",align_top_right:"\u53f3\u4e0a",uimode:"\u5916\u89c2\u6a21\u5f0f",rate:"\u5e27\u7387",playcount:"\u64ad\u653e\u8ba1\u6570",defaultframe:"\u9ed8\u8ba4\u5e27",currentposition:"\u5f53\u524d\u4f4d\u7f6e",currentmarker:"\u5f53\u524d\u6807\u8bb0",captioningid:"Captioning id",baseurl:"\u57fa\u51c6URL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u8fb9\u6846",stretchtofit:"\u62c9\u4f38",mute:"\u9759\u97f3",invokeurls:"\u76f8\u5173URLs",fullscreen:"\u5168\u5c4f",enabled:"\u542f\u7528",autostart:"\u81ea\u52a8\u5f00\u59cb",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"Choke speed",href:"\u8fde\u7ed3",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528JavaScript",correction:"\u6ca1\u6709\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u64ad\u653e\u6bcf\u4e00\u5e27",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u529f\u80fd\u8868",loop:"\u56de\u5708\u64ad\u653e",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u5782\u76f4\u95f4\u8ddd",vspace:"\u6c34\u51c6\u95f4\u8ddd",class_name:"\u7c7b\u578b",name:"\u540d\u79f0",id:"Id",type:"\u7c7b\u578b",size:"\u5c3a\u5bf8",preview:"\u9884\u89c8",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",controls:"\u63a7\u5236\u5668",numloop:"\u56de\u5708\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"\u81ea\u52a8HREF",liveconnect:"SWLiveConnect",flashvars:"\u53c2\u6570",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f\u8272",wmode:"\u89c6\u7a97\u6a21\u5f0f",salign:"SAlign",align:"\u5bf9\u9f50",scale:"\u6bd4\u4f8b",quality:"\u54c1\u8d28",shuffle:"Shuffle",prefetch:"\u9884\u8bfb\u53d6",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"\u56fe\u50cf\u72b6\u6001",center:"\u4e2d\u5fc3",autogotourl:"\u81ea\u52a8\u8f6c\u5230URL",shockwave_options:"Shockwave\u9009\u9879",rmp_options:"Real media player\u9009\u9879",wmp_options:"Windows media player\u9009\u9879",qt_options:"Quicktime\u9009\u9879",flash_options:"Flash\u9009\u9879",hidden:"\u9690\u85cf",align_bottom_left:"\u5de6\u4e0b",align_bottom_right:"\u53f3\u4e0b",flv_options:"Flash\u89c6\u9891\u9009\u9879",flv_scalemode:"Scale mode",flv_buffer:"\u7f13\u51b2",flv_startimage:"\u5f00\u59cb\u753b\u9762",flv_starttime:"\u5f00\u59cb\u65f6\u95f4",flv_defaultvolume:"\u9ed8\u8ba4\u97f3\u91cf",flv_hiddengui:"\u9690\u85cfGUI",flv_autostart:"\u81ea\u52a8\u64ad\u653e",flv_loop:"\u56de\u5708",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"\u5e73\u6ed1\u56fe\u50cf",flv_jscallback:"JS\u56de\u8c03"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/se_dlg.js b/js/tiny_mce/plugins/media/langs/se_dlg.js new file mode 100755 index 000000000..fe1755ac3 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.media_dlg',{list:"Lista",file:"Fil/URL",advanced:"Avancerat",general:"Generellt",title:"Infoga/redigera inb\u00e4ddad media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullsk\u00e4rm",enabled:"Enabled",autostart:"Starta automatiskt",volume:"Volym",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Spela varje bildruta",kioskmode:"Kiosk mode",controller:"Controller",menu:"Visa menyn",loop:"Loopa",play:"Spela upp automatiskt",hspace:"H-Space",vspace:"V-Space",class_name:"Klass",name:"Namn",id:"Id",type:"Typ",size:"Dimensioner",preview:"F\u00f6rhandsvisning",constrain_proportions:"Bibeh\u00e5ll proportionerna",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Bakgrundsf\u00e4rg",wmode:"WMode",salign:"SAlign",align:"Justera",scale:"Skala",quality:"Kvalit\u00e9",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/si_dlg.js b/js/tiny_mce/plugins/media/langs/si_dlg.js new file mode 100755 index 000000000..6ac7ae79d --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sk_dlg.js b/js/tiny_mce/plugins/media/langs/sk_dlg.js new file mode 100755 index 000000000..176c2ebb9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.media_dlg',{list:"Zoznam",file:"S\u00fabor/URL",advanced:"Roz\u0161\u00edren\u00e9",general:"Obecn\u00e9",title:"Vlo\u017ei\u0165/upravi\u0165 vkladan\u00e9 m\u00e9di\u00e1",align_top_left:"Hore v\u013eavo",align_center:"Na stred",align_left:"V\u013eavo",align_bottom:"Dolu",align_right:"Vpravo",align_top:"Hore",qt_stream_warn:"Streamovan\u00e9 rtsp zdroje m\u00f4\u017eu by\u0165 pridan\u00e9 do polia \'S\u00fabor/URL streamu pre QT\' na z\u00e1lo\u017eke \'Roz\u0161\u00edren\u00e9\'.\\nYM\u00f4\u017ete tie\u017e prida\u0165 nie streamovan\u00fa verziu do polia \'S\u00fabor/URL\'.",qtsrc:"S\u00fabor/URL streamu pre QT",progress:"Priebeh",sound:"Zvuk",swstretchvalign:"Zarovnanie vert. roztiahnutia",swstretchhalign:"Zarovnanie horiz. roztiahnutia",swstretchstyle:"\u0160t\u00fdl roztiahnutia",scriptcallbacks:"Skripty sp\u00e4tn\u00fdch volan\u00ed",align_top_right:"Hore vpravo",uimode:"Re\u017eim ovl\u00e1dacieho panelu",rate:"Relat\u00edvna r\u00fdchlos\u0165",playcount:"Po\u010d\u00edtadlo prehrat\u00ed",defaultframe:"Predvolen\u00fd sn\u00edmok",currentposition:"Aktu\u00e1lna poz\u00edcia",currentmarker:"Aktu\u00e1lna z\u00e1lo\u017eka",captioningid:"ID popisku m\u00e9dia",baseurl:"Z\u00e1kladn\u00e1 URL",balance:"Rovnov\u00e1ha",windowlessvideo:"Video bez okna",stretchtofit:"Roztiahn\u00fa\u0165 do okna",mute:"Uml\u010da\u0165",invokeurls:"Po\u017eadova\u0165 URL",fullscreen:"Cel\u00e1 obrazovka",enabled:"Povoli\u0165 ovl\u00e1dac\u00ed panel",autostart:"Automatick\u00e9 spustenie",volume:"Hlasitos\u0165",target:"Cie\u013e",qtsrcchokespeed:"Zn\u00ed\u017eenie r\u00fdchlosti",href:"Odkaz",endtime:"Koncov\u00fd \u010das",starttime:"Po\u010diato\u010dn\u00fd \u010das",enablejavascript:"Povoli\u0165 JavaScript",correction:"Bez korekci\u00ed",targetcache:"Cie\u013eov\u00e1 medzipam\u00e4\u0165",playeveryframe:"Prehra\u0165 ka\u017ed\u00fd sn\u00edmok",kioskmode:"Zak\u00e1za\u0165 ukladanie",controller:"Ovl\u00e1dac\u00ed panel",menu:"Zobrazi\u0165 ponuku",loop:"Opakovanie",play:"Automatick\u00e9 prehr\u00e1vanie",hspace:"Horizont\u00e1lne odsadenie",vspace:"Vertik\u00e1lne odsadenie",class_name:"Trieda",name:"N\u00e1zov",id:"ID",type:"Typ",size:"Rozmery",preview:"N\u00e1h\u013ead",constrain_proportions:"Zachova\u0165 proporcie",controls:"Ovl\u00e1dac\u00ed panel",numloop:"Po\u010det opakovan\u00ed",console:"Konzola",cache:"Medzipam\u00e4\u0165",autohref:"Automatick\u00e9 na\u010d\u00edtanie",liveconnect:"Spusti\u0165 Javu (SWLiveConnect)",flashvars:"Parametre (Flashvars)",base:"Z\u00e1kladn\u00fd prie\u010dinok",bgcolor:"Pozadie",wmode:"Re\u017eim okna",salign:"Zarovnanie okna",align:"Zarovnanie",scale:"Pomer",quality:"Kvalita",shuffle:"N\u00e1hodne",prefetch:"Predna\u010d\u00edtanie",nojava:"Nesp\u00fa\u0161\u0165a\u0165 Javu",maintainaspect:"Zachova\u0165 pomer str\u00e1n",imagestatus:"Stav obrazu",center:"Na stred",autogotourl:"Automatick\u00fd prechod na URL",shockwave_options:"Mo\u017enosti Shockwave",rmp_options:"Mo\u017enosti prehr\u00e1va\u010da Real media",wmp_options:"Mo\u017enosti prehr\u00e1va\u010da Windows media",qt_options:"Mo\u017enosti Quicktime",flash_options:"Mo\u017enosti Flashu",hidden:"Skry\u0165",align_bottom_left:"Dolu v\u013eavo",align_bottom_right:"Dolu vpravo",flv_options:"Mo\u017enosti Flash video",flv_scalemode:"Zmena ve\u013ekosti",flv_buffer:"Z\u00e1sobn\u00edk",flv_startimage:"Po\u010diato\u010dn\u00fd obr\u00e1zok",flv_starttime:"Po\u010diato\u010dn\u00fd \u010das",flv_defaultvolume:"Predvolen\u00e1 hlasitos\u0165",flv_hiddengui:"Skryt\u00fd ovl\u00e1dac\u00ed panel",flv_autostart:"Automatick\u00e9 spustenie",flv_loop:"Opakovanie",flv_showscalemodes:"Zobrazi\u0165 vo\u013eby zmeny ve\u013ekosti",flv_smoothvideo:"Vyhladzovan\u00fd obraz",flv_jscallback:"Sp\u00e4tn\u00e9 volanie JavaScriptu",html5_video_options:"Mo\u017enosti HTML5 video",altsource1:"Alternat\u00edvny zdroj 1",altsource2:"Alternat\u00edvny zdroj 2",preload:"Predna\u010d\u00edtanie",poster:"Obr\u00e1zok (zobraz\u00ed sa pri nedostupnosti videa)",source:"Zdroj"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sl_dlg.js b/js/tiny_mce/plugins/media/langs/sl_dlg.js new file mode 100755 index 000000000..2c564aec0 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.media_dlg',{list:"Seznam",file:"Datoteka/URL",advanced:"Napredno",general:"Splo\u0161no",title:"Vstavi / uredi multimedijsko vsebino",align_top_left:"zgoraj levo",align_center:"sredina",align_left:"levo",align_bottom:"spodaj",align_right:"desno",align_top:"zgoraj",qt_stream_warn:"V polje \"QT vir\" pod zavihkom napredno, morajo biti dodani Preto\u010dni RTSP viri.nNepreto\u010dna razli\u010dica mora biti dodana v polje \"vir\".",qtsrc:"QT vir",progress:"Napredek",sound:"Zvok",swstretchvalign:"raztegni n-poravnano",swstretchhalign:"raztegni v-poravnano",swstretchstyle:"Slog raztegovanja",scriptcallbacks:"Povratni klici",align_top_right:"zgoraj desno",uimode:"Na\u010din uporabni\u0161kega vmesnika",rate:"Ocena",playcount:"\u0160tevilo predvajanj",defaultframe:"Privzeti okvir",currentposition:"Trenutni polo\u017eaj",currentmarker:"Trenutna oznaka",captioningid:"Oznaka podnapisov",baseurl:"Temeljni URL",balance:"Ravnovesje",windowlessvideo:"Video brez okna",stretchtofit:"Raz\u0161iri",mute:"Uti\u0161aj",invokeurls:"Naslovi URLje",fullscreen:"Cel zaslon",enabled:"Omogo\u010deno",autostart:"Samodejno predvajaj",volume:"Glasnost",target:"Cilj",qtsrcchokespeed:"Hitrost predpomnenja",href:"Povezava",endtime:"Kon\u010dni \u010das",starttime:"Za\u010detni \u010das",enablejavascript:"Omogo\u010di JavaScript",correction:"Brez popravkov",targetcache:"Ciljno predpomnjenje",playeveryframe:"Predvajaj vsak okvir",kioskmode:"Kiosk na\u010din",controller:"Nadzorni element",menu:"Prika\u017ei meni",loop:"Ponavljaj",play:"Samodejno predvajaj",hspace:"H-razmik",vspace:"V-razmik",class_name:"Razred",name:"Ime",id:"Id",type:"Tip",size:"Dimenzije",preview:"Predogled",constrain_proportions:"Obdr\u017ei razmerje",controls:"Nadzorni elementi",numloop:"\u0160t. zank",console:"Konzola",cache:"Predpomnjenje",autohref:"Avtomatska povezava",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Osnova",bgcolor:"Ozadje",wmode:"WM na\u010din",salign:"S-poravnava",align:"Poravnava",scale:"Stopnja pove\u010dave",quality:"Kakovost",shuffle:"Pome\u0161aj",prefetch:"Predpomnenje",nojava:"Brez Jave",maintainaspect:"Zakleni razmerje",imagestatus:"Slika stanja",center:"Sredina",autogotourl:"Samodejno na URL",shockwave_options:"Mo\u017enosti Shockwave",rmp_options:"Mo\u017enosti Real media player",wmp_options:"Mo\u017enosti Windows media player",qt_options:"Mo\u017enosti Quicktime",flash_options:"Mo\u017enosti Flash",hidden:"Skrito",align_bottom_left:"spodaj levo",align_bottom_right:"spodaj desno",flv_options:"Mo\u017enosti videa Flash",flv_scalemode:"Na\u010din pove\u010devanja",flv_buffer:"Medpomnjenje",flv_startimage:"Za\u010detna slika",flv_starttime:"Za\u010detni \u010das",flv_defaultvolume:"Privzeta glasnost",flv_hiddengui:"Skrit up. vmesnik",flv_autostart:"Samodejni zagon",flv_loop:"Zanka",flv_showscalemodes:"Prika\u017ei na\u010dine pove\u010dave",flv_smoothvideo:"Glajenje videa",flv_jscallback:"JS povratni klic",html5_video_options:"HTML5 video nastavitve",altsource1:"Alternativni vir 1",altsource2:"Alternativni vir 2",preload:"Predpomnenje",poster:"Poster",source:"Vir"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sq_dlg.js b/js/tiny_mce/plugins/media/langs/sq_dlg.js new file mode 100755 index 000000000..878010bc4 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.media_dlg',{list:"Lista",file:"Skedari/URL",advanced:"T\u00eb Avancuara",general:"T\u00eb P\u00ebrgjithshme",title:"Fut / edito media",align_top_left:"Krye-majtas",align_center:"Qend\u00ebr",align_left:"Majtas",align_bottom:"Fund",align_right:"Djathtas",align_top:"Krye",qt_stream_warn:"Risurset rtsp duhet t\u00eb shtohen n\u00eb fush\u00ebn QT Src n\u00eb opsionet e avancuara.\\nDuhet t\u00eb shtoni gjithashtu nj\u00eb version jo stream n\u00eb fush\u00ebn src..",qtsrc:"QT Src",progress:"Progresi",sound:"Z\u00ebri",swstretchvalign:"Zmadho Drejtim-V",swstretchhalign:"Zmadho Drejtim-H",swstretchstyle:"Stili i zmadhimit",scriptcallbacks:"Script Callbacks",align_top_right:"Krye-djathtas",uimode:"M\u00ebnyra UI",rate:"Raporti",playcount:"Numri i luajtjeve",defaultframe:"Kuadri fillestar",currentposition:"Pozicioni aktual",currentmarker:"Sh\u00ebnjuesi aktual",captioningid:"Id e titullit",baseurl:"URL baz\u00eb",balance:"Balanci",windowlessvideo:"Video pa dritare",stretchtofit:"Zmadho me p\u00ebrshtatje",mute:"Mbyll z\u00ebrin",invokeurls:"Th\u00ebrrit URL",fullscreen:"Pamje e plot\u00eb",enabled:"Aktivizuar",autostart:"Nisje automatike",volume:"Volumi",target:"Sh\u00ebnjestra",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"Koha e p\u00ebrfundimit",starttime:"Koha e nisjes",enablejavascript:"Aktivizo JavaScript",correction:"Pa rregullime",targetcache:"Cache sh\u00ebnjestr\u00ebn",playeveryframe:"Luaj \u00e7do kuader",kioskmode:"M\u00ebnyra Kiosk",controller:"Kontrollues",menu:"Shfaq menu",loop:"Lak",play:"Luaj automatikisht",hspace:"Hap\u00ebsira-H",vspace:"Hap\u00ebsira-V",class_name:"Klasa",name:"Emri",id:"Id",type:"Tipi",size:"P\u00ebrmasat",preview:"Paraqitje",constrain_proportions:"Ruaj raportet",controls:"Kontrollet",numloop:"Numri lak\u00ebve",console:"Konsola",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Baza",bgcolor:"Fusha",wmode:"WMode",salign:"Drejtimi S",align:"Drejtimi",scale:"Shkalla",quality:"Cil\u00ebsia",shuffle:"Shuffle",prefetch:"Para ngarko",nojava:"Pa Java",maintainaspect:"Ruaj raportet",imagestatus:"Statusi fotos",center:"Qend\u00ebr",autogotourl:"Shko n\u00eb URL automatikisht",shockwave_options:"Opsionet e Shockwave",rmp_options:"Opsionet e Real media player",wmp_options:"Opsionet e Windows media player",qt_options:"Opsionet e Quicktime",flash_options:"Opsionet e Flash",hidden:"Fshehur",align_bottom_left:"Fund-majtas",align_bottom_right:"Fund-djathtas",flv_options:"Opsionet e videos Flash",flv_scalemode:"M\u00ebnyra e shkall\u00ebs",flv_buffer:"Buffer",flv_startimage:"Foto fillestare",flv_starttime:"Foto p\u00ebrfundimtare",flv_defaultvolume:"Volumi fillestar",flv_hiddengui:"GUI e fshehur",flv_autostart:"Nis automatikisht",flv_loop:"Lak",flv_showscalemodes:"Trego shkall\u00ebt",flv_smoothvideo:"Video pa ngecje",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sr_dlg.js b/js/tiny_mce/plugins/media/langs/sr_dlg.js new file mode 100755 index 000000000..e65e6e2e5 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/sv_dlg.js b/js/tiny_mce/plugins/media/langs/sv_dlg.js new file mode 100755 index 000000000..0fcac5622 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.media_dlg',{list:"Lista",file:"Fil/URL",advanced:"Avancerat",general:"Generellt",title:"Infoga/redigera inb\u00e4ddad media","align_top_left":"Top left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks","align_top_right":"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullsk\u00e4rm",enabled:"Enabled",autostart:"Starta automatiskt",volume:"Volym",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Spela varje bildruta",kioskmode:"Kiosk mode",controller:"Controller",menu:"Visa menyn",loop:"Loopa",play:"Spela upp automatiskt",hspace:"H-Space",vspace:"V-Space","class_name":"Klass",name:"Namn",id:"Id",type:"Typ",size:"Dimensioner",preview:"F\u00f6rhandsvisning","constrain_proportions":"Bibeh\u00e5ll proportionerna",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Bakgrundsf\u00e4rg",wmode:"WMode",salign:"SAlign",align:"Justera",scale:"Skala",quality:"Kvalit\u00e9",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL","shockwave_options":"Shockwave options","rmp_options":"Real media player options","wmp_options":"Windows media player options","qt_options":"Quicktime options","flash_options":"Flash options",hidden:"Hidden","align_bottom_left":"Bottom left","align_bottom_right":"Bottom right","flv_options":"Flash video options","flv_scalemode":"Scale mode","flv_buffer":"Buffer","flv_startimage":"Start image","flv_starttime":"Start time","flv_defaultvolume":"Default volumne","flv_hiddengui":"Hidden GUI","flv_autostart":"Auto start","flv_loop":"Loop","flv_showscalemodes":"Show scale modes","flv_smoothvideo":"Smooth video","flv_jscallback":"JS Callback","html5_video_options":"HTML5 Filmegenskaper",altsource1:"Alternativk\u00e4lla 1",altsource2:"Alternativk\u00e4lla 2",preload:"Preload",poster:"Poster",source:"Source"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ta_dlg.js b/js/tiny_mce/plugins/media/langs/ta_dlg.js new file mode 100755 index 000000000..ee10a44ae --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/te_dlg.js b/js/tiny_mce/plugins/media/langs/te_dlg.js new file mode 100755 index 000000000..f62cf0182 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/th_dlg.js b/js/tiny_mce/plugins/media/langs/th_dlg.js new file mode 100755 index 000000000..b1eb3a92d --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.media_dlg',{list:"\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23",file:"\u0e44\u0e1f\u0e25\u0e4c/URL",advanced:"\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",general:"\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b",title:"\u0e40\u0e1e\u0e34\u0e48\u0e21 / \u0e41\u0e01\u0e49\u0e44\u0e02 \u0e21\u0e35\u0e40\u0e14\u0e35\u0e22",align_top_left:"\u0e1a\u0e19 \u0e0b\u0e49\u0e32\u0e22",align_center:"\u0e01\u0e25\u0e32\u0e07",align_left:"\u0e0b\u0e49\u0e32\u0e22",align_bottom:"\u0e25\u0e48\u0e32\u0e07",align_right:"\u0e02\u0e27\u0e32",align_top:"\u0e1a\u0e19",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"\u0e1a\u0e19 \u0e02\u0e27\u0e32",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"\u0e40\u0e25\u0e48\u0e19\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34",volume:"Volume",target:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22 cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"\u0e41\u0e1c\u0e07\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21",menu:"\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e21\u0e19\u0e39",loop:"\u0e40\u0e25\u0e48\u0e19\u0e0b\u0e49\u0e33",play:"\u0e40\u0e25\u0e48\u0e19\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34",hspace:"\u0e23\u0e30\u0e22\u0e30\u0e2b\u0e48\u0e32\u0e07\u0e41\u0e19\u0e27\u0e19\u0e2d\u0e19",vspace:"\u0e23\u0e30\u0e22\u0e30\u0e2b\u0e48\u0e32\u0e07\u0e41\u0e19\u0e27\u0e15\u0e31\u0e49\u0e07",class_name:"\u0e04\u0e25\u0e32\u0e2a",name:"\u0e0a\u0e37\u0e48\u0e2d",id:"Id",type:"\u0e0a\u0e19\u0e34\u0e14",size:"\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07",preview:"\u0e14\u0e39\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07",constrain_proportions:"\u0e04\u0e07\u0e2d\u0e31\u0e15\u0e23\u0e32\u0e2a\u0e48\u0e27\u0e19",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07",wmode:"WMode",salign:"SAlign",align:"Align",scale:"\u0e02\u0e19\u0e32\u0e14",quality:"\u0e04\u0e27\u0e32\u0e21\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"\u0e25\u0e48\u0e32\u0e07 \u0e0b\u0e49\u0e32\u0e22",align_bottom_right:"\u0e25\u0e48\u0e32\u0e07 \u0e02\u0e27\u0e32",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/tn_dlg.js b/js/tiny_mce/plugins/media/langs/tn_dlg.js new file mode 100755 index 000000000..f6f8cf0a9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/tr_dlg.js b/js/tiny_mce/plugins/media/langs/tr_dlg.js new file mode 100755 index 000000000..d36786bb3 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.media_dlg',{list:"Listele",file:"Dosya/URL",advanced:"Geli\u015fmi\u015f",general:"Genel",title:"T\u00fcmle\u015fik medya ekle / d\u00fczenle",align_top_left:"Sol \u00fcst",align_center:"Orta",align_left:"Sol",align_bottom:"Alt",align_right:"Sa\u011f",align_top:"\u00dcst",qt_stream_warn:"Ak\u0131\u015f rtsp kaynaklar\u0131 geli\u015fmi\u015f alt\u0131ndaki QT Kay. alan\u0131na girilmeli.\\nKay. alan\u0131na ayr\u0131ca ak\u0131\u015fkan olmayan eklenir.",qtsrc:"QT Kay.",progress:"\u0130lerle",sound:"Ses",swstretchvalign:"Esnetme D-Hiza",swstretchhalign:"Esnetme Y-Hiza",swstretchstyle:"Esnetme stili",scriptcallbacks:"Script \u00e7a\u011f\u0131r",align_top_right:"Sa\u011f \u00fcst",uimode:"UI Modu",rate:"Oran",playcount:"Oynatma say\u0131s\u0131",defaultframe:"Varsay\u0131lan \u00e7er\u00e7eve",currentposition:"Se\u00e7ili konum",currentmarker:"Se\u00e7ili i\u015faret\u00e7i",captioningid:"Ba\u015fl\u0131k id",baseurl:"Ge\u00e7erli URL",balance:"Denge",windowlessvideo:"Penceresiz video",stretchtofit:"S\u0131\u011facak \u015fekilde boyutland\u0131r",mute:"Sessiz",invokeurls:"Ba\u015flatma URL\'si",fullscreen:"Tam ekran",enabled:"Aktif",autostart:"Otomatik ba\u015flat",volume:"Ses d\u00fczeyi",target:"Hedef",qtsrcchokespeed:"S\u0131k\u0131\u015ft\u0131rma h\u0131z\u0131",href:"Href",endtime:"Biti\u015f zaman\u0131",starttime:"Ba\u015flang\u0131\u00e7 zaman\u0131",enablejavascript:"Javascript Aktif",correction:"D\u00fczeltme yok",targetcache:"Hedef \u00f6nbellek",playeveryframe:"Her \u00e7er\u00e7eveyi oynat",kioskmode:"Kiosk modu",controller:"Kontroller",menu:"Men\u00fcy\u00fc g\u00f6ster",loop:"D\u00f6nd\u00fcr",play:"Otomatik oynat",hspace:"Yatay bo\u015fluk",vspace:"Dikey bo\u015fluk",class_name:"S\u0131n\u0131f",name:"\u0130sim",id:"Id",type:"Tip",size:"Boyutlar",preview:"\u00d6nizleme",constrain_proportions:"Oran\u0131 s\u0131n\u0131rla",controls:"Kontroller",numloop:"D\u00f6ng\u00fc say\u0131s\u0131",console:"Konsol",cache:"\u00d6nbellek",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash de\u011fi\u015fkeni",base:"Taban",bgcolor:"Arkaplan",wmode:"WModu",salign:"SHizala",align:"Hizala",scale:"\u00d6l\u00e7ek",quality:"Kalite",shuffle:"Kar\u0131\u015ft\u0131r",prefetch:"\u00d6n belle\u011fe al",nojava:"Java yok",maintainaspect:"Orant\u0131y\u0131 koru",imagestatus:"Resim durumu",center:"Orta",autogotourl:"URL\'e otomatik git",shockwave_options:"Shockware se\u00e7enekleri",rmp_options:"Real media player se\u00e7enekleri",wmp_options:"Windows media player se\u00e7enekleri",qt_options:"Quicktime se\u00e7enekleri",flash_options:"Flash se\u00e7enekleri",hidden:"Gizli",align_bottom_left:"Sol alt",align_bottom_right:"Sa\u011f alt",flv_options:"Flash video se\u00e7enekleri",flv_scalemode:"\u00d6l\u00e7ek modu",flv_buffer:"Tampon",flv_startimage:"Resmi ba\u015flat",flv_starttime:"Ba\u015flang\u0131\u00e7 zaman\u0131",flv_defaultvolume:"Varsay\u0131lan ses d\u00fczeyi",flv_hiddengui:"Gizli GUI",flv_autostart:"Otomatik ba\u015flat",flv_loop:"D\u00f6nd\u00fcr",flv_showscalemodes:"\u00d6l\u00e7ek modunu g\u00f6ster",flv_smoothvideo:"D\u00fczg\u00fcn video",flv_jscallback:"JS \u00c7e\u011f\u0131r"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/tt_dlg.js b/js/tiny_mce/plugins/media/langs/tt_dlg.js new file mode 100755 index 000000000..e2374c94b --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6/\u5730\u5740",advanced:"\u9032\u968e",general:"\u57fa\u672c",title:"\u63d2\u5165/\u7de8\u8f2f \u5a92\u9ad4",align_top_left:"\u9802\u90e8\u5c45\u5de6",align_center:"\u7f6e\u4e2d",align_left:"\u5c45\u5de6",align_bottom:"\u5e95\u90e8",align_right:"\u5c45\u53f3",align_top:"\u9802\u90e8",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"\u9032\u5ea6",sound:"\u8072\u97f3",swstretchvalign:"\u7e2e\u653e\u81f3\u5782\u76f4\u5c0d\u9f4a",swstretchhalign:"\u7e2e\u653e\u81f3\u6c34\u5e73\u5c0d\u9f4a",swstretchstyle:"\u7e2e\u653e\u6a23\u5f0f",scriptcallbacks:"\u8173\u672c\u56de\u6a94",align_top_right:"\u9802\u90e8\u5c45\u53f3",uimode:"UI \u6a21\u5f0f",rate:"\u78bc\u7387",playcount:"\u64ad\u653e\u6b21\u6578",defaultframe:"\u9810\u8a2d\u683c",currentposition:"\u7576\u524d\u4f4d\u7f6e",currentmarker:"\u7576\u524d\u6a19\u7c64",captioningid:"\u5b57\u5e55 id",baseurl:"Base URL",balance:"\u5e73\u8861",windowlessvideo:"\u7121\u8996\u7a97\u5f71\u50cf",stretchtofit:"\u7e2e\u653e\u81f3\u5408\u9069\u5927\u5c0f",mute:"\u975c\u97f3",invokeurls:"\u8abf\u7528\u7684URLs",fullscreen:"\u5168\u87a2\u5e55",enabled:"\u5553\u7528",autostart:"\u81ea\u52d5\u958b\u59cb",volume:"\u97f3\u91cf",target:"\u76ee\u6a19",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"\u7d50\u675f\u6642\u9593",starttime:"\u958b\u59cb\u6642\u9593",enablejavascript:"\u5553\u7528 JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6a19\u66ab\u5b58",playeveryframe:"\u9010\u683c\u64ad\u653e",kioskmode:"Kiosk \u6a21\u5f0f",controller:"\u63a7\u5236\u81fa",menu:"\u986f\u793a\u529f\u80fd\u8868",loop:"\u8ff4\u5708",play:"\u81ea\u52d5\u64ad\u653e",hspace:"\u6c34\u5e73\u9593\u8ddd",vspace:"\u5782\u76f4\u9593\u8ddd",class_name:"\u985e\u540d",name:"\u540d\u7a31",id:"Id",type:"\u985e\u578b",size:"\u5927\u5c0f",preview:"\u9810\u89bd",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",controls:"\u63a7\u5236",numloop:"\u8ff4\u5708\u6b21\u6578",console:"\u63a7\u5236\u81fa",cache:"\u66ab\u5b58",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash\u8b8a\u6578",base:"\u57fa\u7dda",bgcolor:"\u80cc\u666f\u8272",wmode:"WMode",salign:"SAlign",align:"\u5c0d\u9f4a",scale:"\u7e2e\u653e",quality:"\u54c1\u8cea",shuffle:"\u96a8\u6a5f",prefetch:"\u9810\u8b80",nojava:"No java",maintainaspect:"\u7dad\u8b77\u72c0\u614b",imagestatus:"\u5716\u50cf\u72c0\u614b",center:"\u7f6e\u4e2d",autogotourl:"\u81ea\u52d5\u8df3\u8f49 URL",shockwave_options:"Shockwave \u9078\u9805",rmp_options:"Real media player \u9078\u9805",wmp_options:"Windows media player \u9078\u9805",qt_options:"Quicktime \u9078\u9805",flash_options:"Flash \u9078\u9805",hidden:"\u96b1\u85cf",align_bottom_left:"\u5e95\u90e8\u5c45\u5de6",align_bottom_right:"\u5e95\u90e8\u5c45\u53f3",flv_options:"Flash \u5f71\u50cf\u9078\u9805",flv_scalemode:"\u7e2e\u653e\u6a21\u5f0f",flv_buffer:"\u7de9\u885d",flv_startimage:"\u958b\u59cb\u5716\u50cf",flv_starttime:"\u958b\u59cb\u6642\u9593",flv_defaultvolume:"\u9810\u8a2d\u8072\u97f3",flv_hiddengui:"\u96b1\u85cfGUI",flv_autostart:"\u81ea\u52d5\u958b\u59cb",flv_loop:"\u8ff4\u5708",flv_showscalemodes:"\u986f\u793a\u7e2e\u653e\u6a21\u5f0f",flv_smoothvideo:"\u5e73\u6ed1\u5f71\u50cf",flv_jscallback:"JS \u56de\u6a94"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/tw_dlg.js b/js/tiny_mce/plugins/media/langs/tw_dlg.js new file mode 100755 index 000000000..fb448411b --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.media_dlg',{list:"\u5217\u8868",file:"\u5a92\u9ad4URL",advanced:"\u9032\u968e",general:"\u4e00\u822c",title:"\u63d2\u5165/\u7de8\u8f2f\u5a92\u9ad4",align_top_left:"\u5de6\u4e0a",align_center:"\u7f6e\u4e2d",align_left:"\u9760\u5de6",align_bottom:"\u9760\u4e0b",align_right:"\u9760\u53f3",align_top:"\u9760\u4e0a",qt_stream_warn:"\u4e32\u6d41\u5a92\u9ad4rtsp\u8cc7\u6e90\u61c9\u8a72\u52a0\u5230\u300c\u9032\u968e\u300d\u4e2dQT src\u3002 \\n\u540c\u6642\u589e\u52a0\u975e\u4e32\u6d41\u5a92\u9ad4\u8cc7\u6e90\u5230src\u3002",qtsrc:"QT Src",progress:"\u9032\u5ea6",sound:"\u8072\u97f3",swstretchvalign:"\u7e2e\u653e\u81f3\u5782\u76f4\u5c0d\u9f4a",swstretchhalign:"\u7e2e\u653e\u81f3\u6c34\u5e73\u5c0d\u9f4a",swstretchstyle:"\u7e2e\u653e\u6a23\u5f0f",scriptcallbacks:"Script \u547c\u53eb",align_top_right:"\u53f3\u4e0a",uimode:"\u5916\u89c0\u6a21\u5f0f",rate:"\u6bd4\u7387",playcount:"\u64ad\u653e\u6b21\u6578",defaultframe:"\u9810\u8a2d\u756b\u9762",currentposition:"\u76ee\u524d\u4f4d\u7f6e",currentmarker:"\u76ee\u524d\u6a19\u8a18",captioningid:"\u5b57\u5e55\u7de8\u865f",baseurl:"\u57fa\u5e95 URL",balance:"\u5e73\u8861",windowlessvideo:"\u7121\u8996\u7a97\u64ad\u653e",stretchtofit:"\u7e2e\u653e\u81f3\u9069\u5408\u5927\u5c0f",mute:"\u975c\u97f3",invokeurls:"\u5f15\u7528\u7684 URLs",fullscreen:"\u5168\u87a2\u5e55",enabled:"\u53ef\u7528",autostart:"\u81ea\u52d5\u64ad\u653e",volume:"\u97f3\u91cf",target:"\u76ee\u6a19",qtsrcchokespeed:"\u963b\u585e\u901f\u5ea6",href:"\u8d85\u9023\u7d50",endtime:"\u7d50\u675f\u6642\u9593",starttime:"\u958b\u59cb\u6642\u9593",enablejavascript:"\u555f\u7528 JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6a19\u66ab\u5b58",playeveryframe:"\u9010\u756b\u9762\u64ad\u653e",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u9762\u677f",menu:"\u986f\u793a\u9078\u9805",loop:"\u5faa\u74b0",play:"\u81ea\u52d5\u64ad\u653e",hspace:"\u6c34\u5e73\u9593\u8ddd",vspace:"\u5782\u76f4\u9593\u8ddd",class_name:"\u985e\u5225",name:"\u540d\u7a31",id:"ID",type:"\u985e\u578b",size:"\u5927\u5c0f",preview:"\u9810\u89bd",constrain_proportions:"\u9396\u5b9a\u6bd4\u4f8b",controls:"\u63a7\u5236",numloop:"\u5faa\u74b0\u6b21\u6578",console:"\u63a7\u5236\u53f0",cache:"\u66ab\u5b58",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash \u8b8a\u6578",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f\u8272",wmode:"\u8996\u7a97\u6a21\u5f0f",salign:"SAlign",align:"\u5c0d\u9f4a",scale:"\u7e2e\u653e",quality:"\u54c1\u8cea",shuffle:"\u96a8\u6a5f",prefetch:"\u9810\u5148\u8f09\u5165",nojava:"No Java",maintainaspect:"\u9396\u5b9a\u6bd4\u4f8b",imagestatus:"\u5716\u7247\u72c0\u614b",center:"\u7f6e\u4e2d",autogotourl:"\u81ea\u52d5\u8f49\u81f3 URL",shockwave_options:"Shockwave \u9078\u9805",rmp_options:"Real Media Player \u9078\u9805",wmp_options:"Windows Media Player \u9078\u9805",qt_options:"Quick Time \u9078\u9805",flash_options:"Flash \u9078\u9805",hidden:"\u96b1\u85cf",align_bottom_left:"\u5de6\u4e0b",align_bottom_right:"\u53f3\u4e0b",flv_options:"Flash\u5f71\u7247\u9078\u9805",flv_scalemode:"\u7e2e\u653e\u6a21\u5f0f",flv_buffer:"\u7de9\u885d\u5340",flv_startimage:"\u958b\u59cb\u756b\u9762",flv_starttime:"\u958b\u59cb\u6642\u9593",flv_defaultvolume:"\u9810\u8a2d\u97f3\u91cf",flv_hiddengui:"\u96b1\u85cf GUI",flv_autostart:"\u81ea\u52d5\u64ad\u653e",flv_loop:"\u5faa\u74b0",flv_showscalemodes:"\u986f\u793a\u7e2e\u653e\u6a21\u5f0f",flv_smoothvideo:"\u5e73\u6ed1\u64ad\u653e",flv_jscallback:"Script \u547c\u53eb"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/uk_dlg.js b/js/tiny_mce/plugins/media/langs/uk_dlg.js new file mode 100755 index 000000000..9379de0e9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.media_dlg',{list:"\u0421\u043f\u0438\u0441\u043e\u043a",file:"\u0424\u0430\u0439\u043b/URL",advanced:"\u0414\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e",general:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435",title:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 / \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0456 \u043c\u0435\u0434\u0456\u0430",align_top_left:"\u0417\u0432\u0435\u0440\u0445\u0443 \u0437\u043b\u0456\u0432\u0430",align_center:"\u0426\u0435\u043d\u0442\u0440",align_left:"\u041b\u0456\u0432\u043e",align_bottom:"\u041d\u0438\u0437",align_right:"\u041f\u0440\u0430\u0432\u043e",align_top:"\u0412\u0435\u0440\u0445",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"\u0414\u0436\u0435\u0440\u0435\u043b\u043e QT",progress:"\u0425\u0456\u0434",sound:"\u0417\u0432\u0443\u043a",swstretchvalign:"\u0420\u043e\u0437\u0442\u044f\u0433\u043d\u0443\u0442\u0438 \u0432\u0435\u0440\u0442. \u0432\u0438\u0440\u0456\u0432\u043d\u044e\u0430\u043d\u043d\u044f",swstretchhalign:"\u0420\u043e\u0437\u0442\u044f\u0433\u043d\u0443\u0442\u0438 \u0433\u043e\u0440\u0438\u0437. \u0432\u0438\u0440\u0456\u0432\u043d\u044e\u0430\u043d\u043d\u044f",swstretchstyle:"\u0420\u043e\u0437\u0442\u044f\u0433\u043d\u0443\u0442\u0438\u0439 \u0441\u0442\u0438\u043b\u044c",scriptcallbacks:"\u0417\u0432\u043e\u0440\u043e\u0442\u043d\u0456\u0439 \u0432\u0438\u043a\u043b\u0438\u043a \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u044e",align_top_right:"\u0417\u0432\u0435\u0440\u0445\u0443 \u0437\u043f\u0440\u0430\u0432\u0430",uimode:"\u0420\u0435\u0436\u0438\u043c \u0456\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443",rate:"\u0428\u0432\u0438\u0434\u043a\u0456\u0441\u0442\u044c",playcount:"\u041a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u0432\u0430\u043d\u044c",defaultframe:"\u041a\u0430\u0434\u0440 \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0430\u043d\u043d\u044f\u043c",currentposition:"\u041f\u043e\u0442\u043e\u0447\u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0456\u044f",currentmarker:"\u041f\u043e\u0442\u043e\u0447\u043d\u0438\u0439 \u043c\u0430\u0440\u043a\u0435\u0440",captioningid:"\u0406\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u0434\u043f\u0438\u0441\u0443",baseurl:"\u041e\u0441\u043d\u043e\u0432\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f",balance:"\u0411\u0430\u043b\u0430\u043d\u0441",windowlessvideo:"Windowless video",stretchtofit:"\u0417\u043c\u0435\u043d\u0448\u0438\u0442\u0438, \u0449\u043e\u0431 \u0432\u043c\u0456\u0441\u0442\u0438\u043b\u043e\u0441\u044c",mute:"\u0417\u0430\u0433\u043b\u0443\u0448\u0438\u0442\u0438",invokeurls:"\u0412\u0438\u043a\u043b\u0438\u043a\u0430\u0442\u0438 URLs",fullscreen:"\u041f\u043e\u0432\u043d\u0438\u0439 \u0435\u043a\u0440\u0430\u043d",enabled:"\u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439",autostart:"\u0410\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442",volume:"\u0413\u0443\u0447\u043d\u0456\u0441\u0442\u044c",target:"\u0426\u0456\u043b\u044c",qtsrcchokespeed:"\u0428\u0432\u0438\u0434\u043a\u0456\u0441\u0442\u044c \u0437\u0430\u0433\u0430\u0441\u0430\u043d\u043d\u044f",href:"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f",endtime:"\u0427\u0430\u0441 \u043a\u0456\u043d\u0446\u044f",starttime:"\u0427\u0430\u0441 \u043f\u043e\u0447\u0430\u0442\u043a\u0443",enablejavascript:"\u0414\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u0438 JavaScript",correction:"\u0411\u0435\u0437 \u043a\u043e\u0440\u0435\u043a\u0446\u0456\u0457",targetcache:"\u0426\u0456\u043b\u044c\u043e\u0432\u0438\u0439 \u043a\u0435\u0448",playeveryframe:"\u041f\u0440\u043e\u0433\u0440\u0430\u0432\u0430\u0442\u0438 \u043a\u043e\u0436\u0435\u043d \u043a\u0430\u0434\u0440",kioskmode:"\u041f\u043e\u0432\u043d\u043e\u0435\u043a\u0440\u0430\u043d\u043d\u0438\u0439 \u0440\u0435\u0436\u0438\u043c",controller:"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440",menu:"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043c\u0435\u043d\u044e",loop:"\u041f\u043e\u0432\u0442\u043e\u0440\u044e\u0432\u0430\u0442\u0438",play:"\u0410\u0432\u0442\u043e\u043f\u0440\u043e\u0433\u0440\u0430\u0432\u043d\u043d\u044f",hspace:"\u0433\u043e\u0440.\u0432\u0456\u0434\u0441\u0442\u0443\u043f",vspace:"\u0432\u0435\u0440\u0442.\u0432\u0456\u0434\u0441\u0442\u0443\u043f",class_name:"\u041a\u043b\u0430\u0441",name:"\u041d\u0430\u0437\u0432\u0430",id:"\u0406\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440",type:"\u0422\u0438\u043f",size:"\u0420\u043e\u0437\u043c\u0456\u0440\u0438",preview:"\u041f\u0435\u0440\u0435\u0433\u043b\u044f\u0434",constrain_proportions:"\u0417\u0431\u0435\u0440\u0456\u0433\u0430\u0442\u0438 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0456\u0457",controls:"\u041a\u0435\u0440\u0443\u0432\u0430\u043d\u043d\u044f",numloop:"\u041a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0446\u0438\u043a\u043b\u0456\u0432",console:"\u041a\u043e\u043d\u0441\u043e\u043b\u044c",cache:"\u041a\u0435\u0448",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438",base:"\u0411\u0430\u0437\u0430",bgcolor:"\u0424\u043e\u043d",wmode:"W-\u0440\u0435\u0436\u0438\u043c",salign:"S-\u0412\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",align:"\u0412\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",scale:"\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0443\u0432\u0430\u043d\u043d\u044f",quality:"\u042f\u043a\u0456\u0441\u0442\u044c",shuffle:"\u041f\u0435\u0440\u0435\u0442\u0430\u0441\u0443\u0432\u0430\u0442\u0438",prefetch:"\u041f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0454 \u0432\u0438\u043b\u0443\u0447\u0435\u043d\u043d\u044f",nojava:"\u0411\u0435\u0437 Java",maintainaspect:"\u0412\u0434\u0435\u0440\u0436\u0443\u0432\u0430\u0442\u0438 \u0440\u0430\u043a\u0443\u0440\u0441",imagestatus:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",center:"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443",autogotourl:"\u041f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0430\u0432\u0442\u043e\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443",shockwave_options:"\u041e\u043f\u0446\u0456\u0457 Shockwave",rmp_options:"\u041e\u043f\u0446\u0456\u0457 Real media player",wmp_options:"\u041e\u043f\u0446\u0456\u0457 Windows media player",qt_options:"\u041e\u043f\u0446\u0456\u0457 Quicktime",flash_options:"\u041e\u043f\u0446\u0456\u0457 Flash",hidden:"\u041f\u0440\u0438\u0445\u043e\u0432\u0430\u043d\u0438\u0439",align_bottom_left:"\u0417\u043d\u0438\u0437\u0443 \u0437\u043b\u0456\u0432\u0430",align_bottom_right:"\u0417\u043d\u0438\u0437\u0443 \u0437\u043f\u0440\u0430\u0432\u0430",flv_options:"\u041e\u043f\u0446\u0456\u0457 Flash video",flv_scalemode:"\u0420\u0435\u0436\u0438\u043c \u043c\u0430\u0448\u0442\u0430\u0431\u0443\u0432\u0430\u043d\u043d\u044f",flv_buffer:"\u0411\u0443\u0444\u0435\u0440",flv_startimage:"\u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",flv_starttime:"\u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439 \u0447\u0430\u0441",flv_defaultvolume:"\u0413\u0443\u0447\u043d\u0456\u0441\u0442\u044c \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0430\u043d\u043d\u044f\u043c",flv_hiddengui:"\u0421\u0445\u043e\u0432\u0430\u043d\u0438\u0439 \u0433\u0440\u0430\u0444\u0456\u0447\u043d\u0438\u0439 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u0439 \u0456\u043d\u0444\u0435\u0440\u0444\u0435\u0439\u0441",flv_autostart:"\u0410\u0432\u0442\u043e\u043f\u043e\u0447\u0430\u0442\u043e\u043a",flv_loop:"\u041f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u043d\u044f",flv_showscalemodes:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u0438 \u0440\u0435\u0436\u0438\u043c\u0438 \u043c\u0430\u0448\u0442\u0430\u0431\u0443\u0432\u0430\u043d\u043d\u044f",flv_smoothvideo:"\u041f\u043b\u0430\u0432\u043d\u0435 \u0432\u0456\u0434\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0432\u0456\u0434\u0435\u043e",flv_jscallback:"\u0417\u0432\u043e\u0440\u043e\u0442\u043d\u0456\u0439 \u0432\u0438\u043a\u043b\u0438\u043a JS"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/ur_dlg.js b/js/tiny_mce/plugins/media/langs/ur_dlg.js new file mode 100755 index 000000000..37e5eb47d --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert / edit embedded media",align_top_left:"Top left",align_center:"Center",align_left:"Left",align_bottom:"Bottom",align_right:"Right",align_top:"Top",qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\\nYou should also add a non streamed version to the Src field..",qtsrc:"QT Src",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch style",scriptcallbacks:"Script callbacks",align_top_right:"Top right",uimode:"UI Mode",rate:"Rate",playcount:"Play count",defaultframe:"Default frame",currentposition:"Current position",currentmarker:"Current marker",captioningid:"Captioning id",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless video",stretchtofit:"Stretch to fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Fullscreen",enabled:"Enabled",autostart:"Auto start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke speed",href:"Href",endtime:"End time",starttime:"Start time",enablejavascript:"Enable JavaScript",correction:"No correction",targetcache:"Target cache",playeveryframe:"Play every frame",kioskmode:"Kiosk mode",controller:"Controller",menu:"Show menu",loop:"Loop",play:"Auto play",hspace:"H-Space",vspace:"V-Space",class_name:"Class",name:"Name",id:"Id",type:"Type",size:"Dimensions",preview:"Preview",constrain_proportions:"Constrain proportions",controls:"Controls",numloop:"Num loops",console:"Console",cache:"Cache",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"Image status",center:"Center",autogotourl:"Auto goto URL",shockwave_options:"Shockwave options",rmp_options:"Real media player options",wmp_options:"Windows media player options",qt_options:"Quicktime options",flash_options:"Flash options",hidden:"Hidden",align_bottom_left:"Bottom left",align_bottom_right:"Bottom right",flv_options:"Flash video options",flv_scalemode:"Scale mode",flv_buffer:"Buffer",flv_startimage:"Start image",flv_starttime:"Start time",flv_defaultvolume:"Default volumne",flv_hiddengui:"Hidden GUI",flv_autostart:"Auto start",flv_loop:"Loop",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"Smooth video",flv_jscallback:"JS Callback"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/vi_dlg.js b/js/tiny_mce/plugins/media/langs/vi_dlg.js new file mode 100755 index 000000000..d9ecaef24 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.media_dlg',{list:"Danh s\u00e1ch",file:"T\u1eadp tin/URL",advanced:"N\u00e2ng cao",general:"Chung",title:"Ch\u00e8n / s\u1eeda ph\u01b0\u01a1ng ti\u1ec7n truy\u1ec1n th\u00f4ng nh\u00fang",align_top_left:"Tr\u00ean c\u00f9ng tr\u00e1i",align_center:"Gi\u1eefa",align_left:"Tr\u00e1i",align_bottom:"D\u01b0\u1edbi c\u00f9ng",align_right:"Ph\u1ea3i",align_top:"Tr\u00ean c\u00f9ng",qt_stream_warn:"Ngu\u1ed3n rtsp theo lu\u1ed3ng n\u00ean \u0111\u01b0\u1ee3c th\u00eam v\u00e0o tr\u01b0\u1eddng QT Src d\u01b0\u1edbi th\u1ebb n\u00e2ng cao.\\nB\u1ea1n c\u0169ng n\u00ean th\u00eam m\u1ed9t phi\u00ean b\u1ea3n kh\u00f4ng theo lu\u1ed3ng v\u00e0o tr\u01b0\u1eddng Src..",qtsrc:"QT Src",progress:"\u0110ang ti\u1ebfn tri\u1ec3n",sound:"\u00c2m thanh",swstretchvalign:"D\u00e3n theo V-Align",swstretchhalign:"D\u00e3n theo H-Align",swstretchstyle:"Ki\u1ec3u d\u00e3n",scriptcallbacks:"H\u00e0m g\u1ecdi ng\u01b0\u1ee3c Script",align_top_right:"Tr\u00ean c\u00f9ng ph\u1ea3i",uimode:"Ch\u1ebf \u0111\u1ed9 UI",rate:"T\u1ed1c \u0111\u1ed9",playcount:"\u0110\u1ebfm l\u1ea7n ph\u00e1t",defaultframe:"Khung m\u1eb7c \u0111\u1ecbnh",currentposition:"V\u1ecb tr\u00ed hi\u1ec7n th\u1eddi",currentmarker:"B\u1ed9 t\u1ea1o hi\u1ec7n th\u1eddi",captioningid:"id \u0111\u1ea7u \u0111\u1ec1",baseurl:"Base URL",balance:"C\u00e2n b\u1eb1ng",windowlessvideo:"Video kh\u00f4ng c\u1eeda s\u1ed5",stretchtofit:"D\u00e3n \u0111\u1ec3 ph\u00f9 h\u1ee3p",mute:"T\u1eaft \u00e2m thanh",invokeurls:"URL tri\u1ec7u g\u1ecdi",fullscreen:"To\u00e0n m\u00e0n h\u00ecnh",enabled:"Cho ph\u00e9p",autostart:"T\u1ef1 \u0111\u1ed9ng b\u1eaft \u0111\u1ea7u",volume:"\u00c2m l\u01b0\u1ee3ng",target:"\u0110\u00edch",qtsrcchokespeed:"T\u1ed1c \u0111\u1ed9 Choke",href:"Href",endtime:"Th\u1eddi gian k\u1ebft th\u00fac",starttime:"Th\u1eddi gian b\u1eaft \u0111\u1ea7u",enablejavascript:"Cho ph\u00e9p JavaScript",correction:"Kh\u00f4ng ch\u1ec9nh",targetcache:"B\u1ed9 nh\u1edb \u0111\u1ec7m \u0111\u00edch",playeveryframe:"Ph\u00e1t t\u1ea5t c\u1ea3 khung",kioskmode:"Ch\u1ebf \u0111\u1ed9 Kiosk",controller:"Tr\u00ecnh \u0111i\u1ec1u khi\u1ec3n",menu:"Hi\u1ec3n th\u1ecb menu",loop:"L\u1eb7p",play:"T\u1ef1 \u0111\u1ed9ng ph\u00e1t",hspace:"H-Space",vspace:"V-Space",class_name:"L\u1edbp",name:"T\u00ean",id:"Id",type:"Ki\u1ec3u",size:"K\u00edch th\u01b0\u1edbc",preview:"Xem tr\u01b0\u1edbc",constrain_proportions:"R\u00e0ng bu\u1ed9c t\u1ec9 l\u1ec7",controls:"\u0110i\u1ec1u khi\u1ec3n",numloop:"S\u1ed1 l\u1eb7p",console:"B\u00e0n \u0111i\u1ec1u khi\u1ec3n",cache:"B\u1ed9 nh\u1edb \u0111\u1ec7m",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flashvars",base:"C\u01a1 s\u1edf",bgcolor:"N\u1ec1n",wmode:"WMode",salign:"SAlign",align:"Canh l\u1ec1",scale:"T\u1ec9 l\u1ec7",quality:"Ch\u1ea5t l\u01b0\u1ee3ng",shuffle:"Kh\u00f4ng theo tr\u1eadt t\u1ef1",prefetch:"T\u00ecm n\u1ea1p tr\u01b0\u1edbc",nojava:"Kh\u00f4ng c\u00f3 java",maintainaspect:"Duy tr\u00ec c\u1ea1nh",imagestatus:"Tr\u1ea1ng th\u00e1i \u1ea3nh",center:"Gi\u1eefa",autogotourl:"T\u1ef1 \u0111\u1ed9ng nh\u1ea3y t\u1edbi URL",shockwave_options:"T\u00f9y ch\u1ecdn Shockwave",rmp_options:"T\u00f9y ch\u1ecdn tr\u00ecnh ch\u01a1i media Real",wmp_options:"T\u00f9y ch\u1ecdn tr\u00ecnh ch\u01a1i media Windows",qt_options:"T\u00f9y ch\u1ecdn Quicktime",flash_options:"T\u00f9y ch\u1ecdn Flash",hidden:"\u1ea8n",align_bottom_left:"D\u01b0\u1edbi c\u00f9ng tr\u00e1i",align_bottom_right:"D\u01b0\u1edbi c\u00f9ng ph\u1ea3i",flv_options:"T\u00f9y ch\u1ecdn video Flash",flv_scalemode:"Ch\u1ebf \u0111\u1ed9 thang",flv_buffer:"B\u1ed9 \u0111\u1ec7m",flv_startimage:"\u1ea2nh b\u1eaft \u0111\u1ea7u",flv_starttime:"Th\u1eddi gian b\u1eaft \u0111\u1ea7u",flv_defaultvolume:"\u00c2m l\u01b0\u1ee3ng m\u1eb7c \u0111\u1ecbnh",flv_hiddengui:"\u1ea8n GUI",flv_autostart:"T\u1ef1 b\u1eaft \u0111\u1ea7u",flv_loop:"L\u1eb7p",flv_showscalemodes:"Hi\u1ec3n th\u1ecb ch\u1ebf \u0111\u1ed9 thang",flv_smoothvideo:"Video m\u01b0\u1ee3t",flv_jscallback:"H\u00e0m g\u1ecdi ng\u01b0\u1ee3c JS"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/media/langs/zh-cn_dlg.js new file mode 100755 index 000000000..ee4fa6ea9 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6/URL",advanced:"\u9ad8\u7ea7",general:"\u666e\u901a",title:"\u63d2\u5165/\u7f16\u8f91 \u5d4c\u5165\u5f0f\u5a92\u4f53","align_top_left":"\u5de6\u4e0a","align_center":"\u5c45\u4e2d","align_left":"\u5c45\u5de6","align_bottom":"\u5c45\u4e0b","align_right":"\u5c45\u53f3","align_top":"\u5c45\u4e0a","qt_stream_warn":"\u6d41\u5a92\u4f53RTSP\u8d44\u6e90\u5e94\u6dfb\u52a0\u5230\u9ad8\u7ea7\u9009\u9879\u7684QT\u8d44\u6e90\u4e2d\u3002n\u540c\u65f6\uff0c\u60a8\u4e5f\u53ef\u4ee5\u5728\u8fd9\u91cc\u52a0\u5165\u4e00\u4e2a\u975e\u6d41\u5a92\u4f53\u3002",qtsrc:"QT\u8d44\u6e90",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u5782\u76f4\u62c9\u4f38",swstretchhalign:"\u6c34\u5e73\u62c9\u4f38",swstretchstyle:"\u62c9\u4f38\u65b9\u5f0f",scriptcallbacks:"\u811a\u672c\u56de\u8c03","align_top_right":"\u53f3\u4e0a",uimode:"\u5916\u89c2\u6a21\u5f0f",rate:"\u6bd4\u7387",playcount:"\u64ad\u653e\u6b21\u6570",defaultframe:"\u9ed8\u8ba4\u5e27",currentposition:"\u5f53\u524d\u4f4d\u7f6e",currentmarker:"\u5f53\u524d\u6807\u8bb0",captioningid:"\u5b57\u5e55ID",baseurl:"\u57fa\u7840\u8def\u5f84",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u8fb9\u6846",stretchtofit:"\u62c9\u4f38\u5230\u9002\u5408",mute:"\u9759\u97f3",invokeurls:"\u5f15\u7528URL",fullscreen:"\u5168\u5c4f",enabled:"\u542f\u7528",autostart:"\u81ea\u52a8\u64ad\u653e",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"\u9650\u5236\u901f\u5ea6",href:"\u8d85\u94fe\u63a5",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528JavaScript",correction:"\u65e0\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u9010\u5e27\u64ad\u653e",kioskmode:"\u5168\u5c4f\u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u83dc\u5355",loop:"\u5faa\u73af",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u6c34\u5e73\u8ddd\u79bb",vspace:"\u5782\u76f4\u8ddd\u79bb","class_name":"\u7c7b\u522b",name:"\u540d\u79f0",id:"ID",type:"\u7c7b\u578b",size:"\u5c3a\u5bf8",preview:"\u9884\u89c8","constrain_proportions":"\u4fdd\u6301\u6bd4\u4f8b",controls:"\u64ad\u653e\u63a7\u5236",numloop:"\u5faa\u73af\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"\u81ea\u52a8\u8df3\u8f6c",liveconnect:"JavaScript\u5f00\u542f",flashvars:"Flash\u53d8\u91cf",base:"\u57fa\u7840\u8def\u5f84",bgcolor:"\u80cc\u666f",wmode:"\u7a97\u4f53\u6a21\u5f0f",salign:"\u5a92\u4f53\u5bf9\u9f50",align:"\u6587\u672c\u5bf9\u9f50",scale:"\u7f29\u653e",quality:"\u753b\u8d28",shuffle:"\u968f\u673a",prefetch:"\u9884\u52a0\u8f7d",nojava:"\u65e0java",maintainaspect:"\u4fdd\u6301\u5916\u89c2",imagestatus:"\u56fe\u7247\u72b6\u6001",center:"\u5c45\u4e2d",autogotourl:"\u81ea\u52a8\u8f6c\u5230URL","shockwave_options":"Shockwave\u9009\u9879","rmp_options":"Real media player\u9009\u9879","wmp_options":"Windows media player\u9009\u9879","qt_options":"Quicktime\u9009\u9879","flash_options":"Flash\u9009\u9879",hidden:"\u9690\u85cf","align_bottom_left":"\u5de6\u4e0b","align_bottom_right":"\u53f3\u4e0b","flv_options":"FLV\u9009\u9879","flv_scalemode":"\u7f29\u653e\u6a21\u5f0f","flv_buffer":"\u7f13\u51b2","flv_startimage":"\u5f00\u59cb\u753b\u9762","flv_starttime":"\u5f00\u59cb\u65f6\u95f4","flv_defaultvolume":"\u9ed8\u8ba4\u97f3\u91cf","flv_hiddengui":"\u9690\u85cfGUI","flv_autostart":"\u81ea\u52a8\u64ad\u653e","flv_loop":"\u5faa\u73af","flv_showscalemodes":"\u663e\u793a\u7f29\u653e\u6a21\u5f0f","flv_smoothvideo":"\u6d88\u9664\u952f\u9f7f","flv_jscallback":"JS\u56de\u8c03","html5_video_options":"HTML5\u89c6\u9891\u9009\u9879",altsource1:"\u66ff\u4ee3\u8d44\u6e901",altsource2:"\u66ff\u4ee3\u8d44\u6e902",preload:"\u9884\u52a0\u8f7d",poster:"\u6d77\u62a5",source:"\u8d44\u6e90"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/zh_dlg.js b/js/tiny_mce/plugins/media/langs/zh_dlg.js new file mode 100755 index 000000000..e6700c05a --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.media_dlg',{list:"\u5217\u8868",file:"\u5a92\u4f53URL",advanced:"\u9ad8\u7ea7",general:"\u4e00\u822c",title:"\u63d2\u5165/\u7f16\u8f91\u5a92\u4f53",align_top_left:"\u5de6\u4e0a",align_center:"\u7f6e\u4e2d",align_left:"\u9760\u5de6",align_bottom:"\u9760\u4e0b",align_right:"\u9760\u53f3",align_top:"\u9760\u4e0a",qt_stream_warn:"\u4e32\u6d41\u5a92\u4f53rtsp\u8d44\u6e90\u5e94\u8be5\u52a0\u5230\u300c\u9ad8\u7ea7\u300d\u4e2dQT src\u3002 \\n\u540c\u65f6\u589e\u52a0\u975e\u4e32\u6d41\u5a92\u4f53\u8d44\u6e90\u5230src\u3002",qtsrc:"QT Src",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u7f29\u653e\u81f3\u5782\u76f4\u5bf9\u9f50",swstretchhalign:"\u7f29\u653e\u81f3\u6c34\u5e73\u5bf9\u9f50",swstretchstyle:"\u7f29\u653e\u6837\u5f0f",scriptcallbacks:"Script \u553f\u53eb",align_top_right:"\u53f3\u4e0a",uimode:"\u9762\u677f\u6a21\u5f0f",rate:"\u6bd4\u7387",playcount:"\u64ad\u653e\u6b21\u6570",defaultframe:"\u9884\u8bbe\u753b\u9762",currentposition:"\u76ee\u524d\u4f4d\u7f6e",currentmarker:"\u76ee\u524d\u6807\u8bb0",captioningid:"\u5b57\u5e55\u7f16\u53f7",baseurl:"\u57fa\u5e95 URL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u89c6\u7a97\u64ad\u653e",stretchtofit:"\u7f29\u653e\u81f3\u6700\u4f73\u5927\u5c0f",mute:"\u9759\u97f3",invokeurls:"\u5f15\u7528\u7684 URLs",fullscreen:"\u5168\u8424\u5e55",enabled:"\u53ef\u7528",autostart:"\u81ea\u52a8\u64ad\u653e",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"\u963b\u585e\u901f\u5ea6",href:"\u8d85\u8fde\u7ed3",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528 JavaScript",correction:"\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u9010\u683c\u64ad\u653e",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u9009\u9879",loop:"\u5faa\u73af",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u6c34\u5e73\u95f4\u8ddd",vspace:"\u5782\u76f4\u95f4\u8ddd",class_name:"\u7c7b\u522b",name:"\u540d\u79f0",id:"ID",type:"\u7c7b\u578b",size:"\u5927\u5c0f",preview:"\u9884\u89c8",constrain_proportions:"\u7ea6\u675f\u6bd4\u4f8b",controls:"\u63a7\u5236",numloop:"\u5faa\u73af\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"AutoHREF",liveconnect:"SWLiveConnect",flashvars:"Flash \u53d8\u91cf",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f\u8272",wmode:"\u89c6\u7a97\u6a21\u5f0f",salign:"SAlign",align:"\u5bf9\u9f50",scale:"\u7f29\u653e",quality:"\u54c1\u8d28",shuffle:"\u968f\u673a",prefetch:"\u9884\u8f7d",nojava:"No Java",maintainaspect:"\u9501\u5b9a\u6bd4\u4f8b",imagestatus:"\u56fe\u7247\u72b6\u6001",center:"\u7f6e\u4e2d",autogotourl:"\u81ea\u52a8\u8f6c\u81f3 URL",shockwave_options:"Shockwave \u9009\u9879",rmp_options:"Real Media Player \u9009\u9879",wmp_options:"Windows Media Player \u9009\u9879",qt_options:"Quick Time \u9009\u9879",flash_options:"Flash \u9009\u9879",hidden:"\u9690\u85cf",align_bottom_left:"\u5de6\u4e0b",align_bottom_right:"\u53f3\u4e0b",flv_options:"Flash\u5f71\u7247\u9009\u9879",flv_scalemode:"\u7f29\u653e\u6a21\u5f0f",flv_buffer:"\u7f13\u885d\u533a",flv_startimage:"\u5f00\u59cb\u753b\u9762",flv_starttime:"\u5f00\u59cb\u65f6\u95f4",flv_defaultvolume:"\u9884\u8bbe\u97f3\u91cf",flv_hiddengui:"\u9690\u85cf GUI",flv_autostart:"\u81ea\u52a8\u64ad\u653e",flv_loop:"\u5faa\u73af",flv_showscalemodes:"\u663e\u793a\u7f29\u653e\u6a21\u5f0f",flv_smoothvideo:"\u5e73\u6ed1\u64ad\u653e",flv_jscallback:"Script \u553f\u53eb"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/langs/zu_dlg.js b/js/tiny_mce/plugins/media/langs/zu_dlg.js new file mode 100755 index 000000000..269c54f68 --- /dev/null +++ b/js/tiny_mce/plugins/media/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.media_dlg',{list:"\u5217\u8868",file:"\u6587\u4ef6/\u7f51\u5740",advanced:"\u9ad8\u7ea7",general:"\u4e00\u822c",title:"\u63d2\u5165/\u7f16\u8f91\u5d4c\u5165\u5a92\u4f53",align_top_left:"\u5de6\u4e0a",align_center:"\u4e2d\u95f4",align_left:"\u9760\u5de6",align_bottom:"\u4e0b\u65b9",align_right:"\u9760\u53f3",align_top:"\u4e0a\u65b9",qt_stream_warn:"\u6d41\u5f0frtsp\u8d44\u6e90\u5e94\u8be5\u6dfb\u52a0\u5230\u201c\u9ad8\u7ea7\u201d\u4e2dQT Src\u3002\\n\u540c\u65f6\u6dfb\u52a0\u975e\u6d41\u5f0f\u8d44\u6e90\u5230Src\u3002",qtsrc:"QT Src",progress:"\u8fdb\u5ea6",sound:"\u58f0\u97f3",swstretchvalign:"\u5782\u76f4\u62c9\u5347",swstretchhalign:"\u6c34\u51c6\u62c9\u5347",swstretchstyle:"\u62c9\u5347\u6a21\u5f0f",scriptcallbacks:"\u811a\u672c\u56de\u6863",align_top_right:"\u53f3\u4e0a",uimode:"\u9762\u677f\u6a21\u5f0f",rate:"\u5e27\u7387",playcount:"\u64ad\u653e\u8ba1\u6570",defaultframe:"\u9ed8\u8ba4\u5e27",currentposition:"\u5f53\u524d\u4f4d\u7f6e",currentmarker:"\u5f53\u524d\u6807\u8bb0",captioningid:"Captioning id",baseurl:"\u57fa\u51c6URL",balance:"\u5e73\u8861",windowlessvideo:"\u65e0\u8fb9\u6846",stretchtofit:"\u62c9\u4f38",mute:"\u9759\u97f3",invokeurls:"\u76f8\u5173URLs",fullscreen:"\u5168\u5c4f",enabled:"\u542f\u7528",autostart:"\u81ea\u52a8\u5f00\u59cb",volume:"\u97f3\u91cf",target:"\u76ee\u6807",qtsrcchokespeed:"Choke speed",href:"\u8fde\u7ed3",endtime:"\u7ed3\u675f\u65f6\u95f4",starttime:"\u5f00\u59cb\u65f6\u95f4",enablejavascript:"\u542f\u7528JavaScript",correction:"\u6ca1\u6709\u4fee\u6b63",targetcache:"\u76ee\u6807\u7f13\u5b58",playeveryframe:"\u64ad\u653e\u6bcf\u4e00\u5e27",kioskmode:"Kiosk\u6a21\u5f0f",controller:"\u63a7\u5236\u53f0",menu:"\u663e\u793a\u529f\u80fd\u8868",loop:"\u56de\u5708\u64ad\u653e",play:"\u81ea\u52a8\u64ad\u653e",hspace:"\u5782\u76f4\u95f4\u8ddd",vspace:"\u6c34\u51c6\u95f4\u8ddd",class_name:"\u7c7b\u578b",name:"\u540d\u79f0",id:"Id",type:"\u7c7b\u578b",size:"\u5c3a\u5bf8",preview:"\u9884\u89c8",constrain_proportions:"\u4fdd\u6301\u6bd4\u4f8b",controls:"\u63a7\u5236\u5668",numloop:"\u56de\u5708\u6b21\u6570",console:"\u63a7\u5236\u53f0",cache:"\u7f13\u5b58",autohref:"\u81ea\u52a8HREF",liveconnect:"SWLiveConnect",flashvars:"\u53c2\u6570",base:"\u57fa\u5e95",bgcolor:"\u80cc\u666f\u8272",wmode:"\u89c6\u7a97\u6a21\u5f0f",salign:"SAlign",align:"\u5bf9\u9f50",scale:"\u6bd4\u4f8b",quality:"\u54c1\u8d28",shuffle:"Shuffle",prefetch:"\u9884\u8bfb\u53d6",nojava:"No java",maintainaspect:"Maintain aspect",imagestatus:"\u56fe\u50cf\u72b6\u6001",center:"\u4e2d\u5fc3",autogotourl:"\u81ea\u52a8\u8f6c\u5230URL",shockwave_options:"Shockwave\u9009\u9879",rmp_options:"Real media player\u9009\u9879",wmp_options:"Windows media player\u9009\u9879",qt_options:"Quicktime\u9009\u9879",flash_options:"Flash\u9009\u9879",hidden:"\u9690\u85cf",align_bottom_left:"\u5de6\u4e0b",align_bottom_right:"\u53f3\u4e0b",flv_options:"Flash\u89c6\u9891\u9009\u9879",flv_scalemode:"Scale mode",flv_buffer:"\u7f13\u51b2",flv_startimage:"\u5f00\u59cb\u753b\u9762",flv_starttime:"\u5f00\u59cb\u65f6\u95f4",flv_defaultvolume:"\u9884\u8bbe\u97f3\u91cf",flv_hiddengui:"\u9690\u85cfGUI",flv_autostart:"\u81ea\u52a8\u64ad\u653e",flv_loop:"\u56de\u5708",flv_showscalemodes:"Show scale modes",flv_smoothvideo:"\u5e73\u6ed1\u56fe\u50cf",flv_jscallback:"JS\u56de\u6863"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/media/media.htm b/js/tiny_mce/plugins/media/media.htm new file mode 100644 index 000000000..807a537dc --- /dev/null +++ b/js/tiny_mce/plugins/media/media.htm @@ -0,0 +1,812 @@ + + + + {#media_dlg.title} + + + + + + + + + +
        + + +
        +
        +
        + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
        + +
        + + + + + +
         
        +
        + + + + + + +
        x   
        +
        +
        + +
        + {#media_dlg.preview} + +
        +
        + +
        +
        + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + +
         
        +
        +
        + +
        + {#media_dlg.html5_video_options} + + + + + + + + + + + + + + + + +
        + + + + + +
         
        +
        + + + + + +
         
        +
        + + + + + +
         
        +
        + + + + + + + + + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        +
        + +
        + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + + + + + + + +
        +
        + +
        + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        +  
        + + + + + +
         
        +
        +
        + +
        + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        +
        + +
        + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        +   +
        +
        + +
        + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + + + +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        + + + + + +
        +
        +
        +
        + +
        +
        + {#media_dlg.source} + +
        +
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/media/moxieplayer.swf b/js/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 000000000..2a040358d Binary files /dev/null and b/js/tiny_mce/plugins/media/moxieplayer.swf differ diff --git a/js/tiny_mce/plugins/pagebreak/editor_plugin.js b/js/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100644 index 000000000..35085e8ad --- /dev/null +++ b/js/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100644 index 000000000..a094c1916 --- /dev/null +++ b/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -0,0 +1,74 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.PageBreakPlugin', { + init : function(ed, url) { + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + + pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); + + // Register commands + ed.addCommand('mcePageBreak', function() { + ed.execCommand('mceInsertContent', 0, pb); + }); + + // Register buttons + ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); + + ed.onInit.add(function() { + if (ed.theme.onResolveName) { + ed.theme.onResolveName.add(function(th, o) { + if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) + o.name = 'pagebreak'; + }); + } + }); + + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) + ed.selection.select(e); + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(pbRE, pb); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mcePageBreak') !== -1) + im = sep; + + return im; + }); + }); + }, + + getInfo : function() { + return { + longname : 'PageBreak', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/editor_plugin.js b/js/tiny_mce/plugins/paste/editor_plugin.js new file mode 100644 index 000000000..769f6cff1 --- /dev/null +++ b/js/tiny_mce/plugins/paste/editor_plugin.js @@ -0,0 +1 @@ +(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=false;function h(m,k){var l=d.dom,i,j;f.onPreProcess.dispatch(f,m);m.node=l.create("div",0,m.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){j=l.select("p,h1,h2,h3,h4,h5,h6,pre",m.node);if(j.length==1&&m.content.indexOf("__MCE_ITEM__")===-1){l.remove(j.reverse(),true)}}}f.onPostProcess.dispatch(f,m);m.content=d.serializer.serialize(m.node,{getInner:1});if((!k)&&(d.pasteAsPlainText)){f._insertPlainText(d,l,m.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(m.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:r.replace(/\r?\n/g,"
        ")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},'\uFEFF\uFEFF
        ');if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort().y}o.setStyles(l,{position:"absolute",left:-10000,top:i,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,1);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="
        "+o.encode(r).replace(/\r?\n/g,"
        ")+"
        "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}if(b(d,"paste_block_drop")){d.onInit.add(function(){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})})}f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
         [\s\r\n]+|
        )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
         [\s\r\n]+|
        )*/g,"$1"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

        ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

        $1

        ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

        "],[/<\/h[1-6][^>]*>/gi,"

        "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(d){c(d,function(h){if(h.constructor==RegExp){v=v.replace(h,"")}else{v=v.replace(h[0],h[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.decode(tinymce.html.Entities.encodeRaw(v));if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"
        "]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"

        "],[/\n/g,"
        "]])}}if((l=v.indexOf("

        "))!=-1){k=v.lastIndexOf("

        ");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+' ');window.setTimeout(function(){var d=x.get("_plain_text_marker"),A,h,w,i;s.select(d,false);z.execCommand("Delete",false,null);d=null;A=s.getStart();h=x.getViewPort(n);w=x.getPos(A).y;i=A.clientHeight;if((wh.y+h.h)){z.body.scrollTop=w

        ' + dom.encode(textContent).replace(/\r?\n/g, '
        ') + '
        '; + } + + // Remove the nodes + each(dom.select('div.mcePaste'), function(n) { + dom.remove(n); + }); + + // Restore the old selection + if (or) + sel.setRng(or); + + process({content : h}); + + // Unblock events ones we got the contents + dom.unbind(ed.getDoc(), 'mousedown', block); + dom.unbind(ed.getDoc(), 'keydown', block); + }, 0); + } + } + + // Check if we should use the new auto process method + if (getParam(ed, "paste_auto_cleanup_on_paste")) { + // Is it's Opera or older FF use key handler + if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { + ed.onKeyDown.addToTop(function(ed, e) { + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + grabContent(e); + }); + } else { + // Grab contents on paste event on Gecko and WebKit + ed.onPaste.addToTop(function(ed, e) { + return grabContent(e); + }); + } + } + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { + ed.onInit.add(function() { + ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { + e.preventDefault(); + e.stopPropagation(); + + return false; + }); + }); + } + + // Add legacy support + t._legacySupport(); + }, + + getInfo : function() { + return { + longname : 'Paste text/word', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _preProcess : function(pl, o) { + var ed = this.editor, + h = o.content, + grep = tinymce.grep, + explode = tinymce.explode, + trim = tinymce.trim, + len, stripClass; + + //console.log('Before preprocess:' + o.content); + + function process(items) { + each(items, function(v) { + // Remove or replace + if (v.constructor == RegExp) + h = h.replace(v, ''); + else + h = h.replace(v[0], v[1]); + }); + } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9) + process([[/(?:
         [\s\r\n]+|
        )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
         [\s\r\n]+|
        )*/g, '$1']]); + + // Detect Word content and process it more aggressive + if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { + o.wordContent = true; // Mark the pasted contents as word specific content + //console.log('Word contents detected.'); + + // Process away some basic content + process([ + /^\s*( )+/gi, //   entities at the start of contents + /( |]*>)+\s*$/gi //   entities at the end of contents + ]); + + if (getParam(ed, "paste_convert_headers_to_strong")) { + h = h.replace(/

        ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

        $1

        "); + } + + if (getParam(ed, "paste_convert_middot_lists")) { + process([ + [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) + ]); + } + + process([ + // Word comments like conditional comments etc + //gi, + + // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + + // Convert into for line-though + [/<(\/?)s>/gi, "<$1strike>"], + + // Replace nsbp entites to char since it's easier to handle + [/ /gi, "\u00a0"] + ]); + + // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. + // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. + do { + len = h.length; + h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); + } while (len != h.length); + + // Remove all spans if no styles is to be retained + if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } else { + // We're keeping styles, so at least clean them up. + // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx + + process([ + // Convert ___ to string of alternating breaking/non-breaking spaces of same length + [/([\s\u00a0]*)<\/span>/gi, + function(str, spaces) { + return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; + } + ], + + // Examine all styles: delete junk, transform some, and keep the rest + [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, + function(str, tag, style) { + var n = [], + i = 0, + s = explode(trim(style).replace(/"/gi, "'"), ";"); + + // Examine each style definition within the tag's style attribute + each(s, function(v) { + var name, value, + parts = explode(v, ":"); + + function ensureUnits(v) { + return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; + } + + if (parts.length == 2) { + name = parts[0].toLowerCase(); + value = parts[1].toLowerCase(); + + // Translate certain MS Office styles into their CSS equivalents + switch (name) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); + return; + + case "horiz-align": + n[i++] = "text-align:" + value; + return; + + case "vert-align": + n[i++] = "vertical-align:" + value; + return; + + case "font-color": + case "mso-foreground": + n[i++] = "color:" + value; + return; + + case "mso-background": + case "mso-highlight": + n[i++] = "background:" + value; + return; + + case "mso-default-height": + n[i++] = "min-height:" + ensureUnits(value); + return; + + case "mso-default-width": + n[i++] = "min-width:" + ensureUnits(value); + return; + + case "mso-padding-between-alt": + n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); + return; + + case "text-line-through": + if ((value == "single") || (value == "double")) { + n[i++] = "text-decoration:line-through"; + } + return; + + case "mso-zero-height": + if (value == "yes") { + n[i++] = "display:none"; + } + return; + } + + // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name + if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { + return; + } + + // If it reached this point, it must be a valid CSS style + n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case + } + }); + + // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. + if (i > 0) { + return tag + ' style="' + n.join(';') + '"'; + } else { + return tag; + } + } + ] + ]); + } + } + + // Replace headers with + if (getParam(ed, "paste_convert_headers_to_strong")) { + process([ + [/]*>/gi, "

        "], + [/<\/h[1-6][^>]*>/gi, "

        "] + ]); + } + + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). + // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. + stripClass = getParam(ed, "paste_strip_class_attributes"); + + if (stripClass !== "none") { + function removeClasses(match, g1) { + if (stripClass === "all") + return ''; + + var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), + function(v) { + return (/^(?!mso)/i.test(v)); + } + ); + + return cls.length ? ' class="' + cls.join(" ") + '"' : ''; + }; + + h = h.replace(/ class="([^"]+)"/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); + } + + // Remove spans option + if (getParam(ed, "paste_remove_spans")) { + h = h.replace(/<\/?span[^>]*>/gi, ""); + } + + //console.log('After preprocess:' + h); + + o.content = h; + }, + + /** + * Various post process items. + */ + _postProcess : function(pl, o) { + var t = this, ed = t.editor, dom = ed.dom, styleProps; + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + if (o.wordContent) { + // Remove named anchors or TOC links + each(dom.select('a', o.node), function(a) { + if (!a.href || a.href.indexOf('#_Toc') != -1) + dom.remove(a, 1); + }); + + if (getParam(ed, "paste_convert_middot_lists")) { + t._convertLists(pl, o); + } + + // Process styles + styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties + + // Process only if a string was specified and not equal to "all" or "*" + if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { + styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); + + // Retains some style properties + each(dom.select('*', o.node), function(el) { + var newStyle = {}, npc = 0, i, sp, sv; + + // Store a subset of the existing styles + if (styleProps) { + for (i = 0; i < styleProps.length; i++) { + sp = styleProps[i]; + sv = dom.getStyle(el, sp); + + if (sv) { + newStyle[sp] = sv; + npc++; + } + } + } + + // Remove all of the existing styles + dom.setAttrib(el, 'style', ''); + + if (styleProps && npc > 0) + dom.setStyles(el, newStyle); // Add back the stored subset of styles + else // Remove empty span tags that do not have class attributes + if (el.nodeName == 'SPAN' && !el.className) + dom.remove(el, true); + }); + } + } + + // Remove all style information or only specifically on WebKit to avoid the style bug on that browser + if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { + each(dom.select('*[style]', o.node), function(el) { + el.removeAttribute('style'); + el.removeAttribute('data-mce-style'); + }); + } else { + if (tinymce.isWebKit) { + // We need to compress the styles on WebKit since if you paste it will become + // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles + each(dom.select('*', o.node), function(el) { + el.removeAttribute('data-mce-style'); + }); + } + } + }, + + /** + * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. + */ + _convertLists : function(pl, o) { + var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; + + // Convert middot lists into real semantic lists + each(dom.select('p', o.node), function(p) { + var sib, val = '', type, html, idx, parents; + + // Get text node value at beginning of paragraph + for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) + val += sib.nodeValue; + + val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); + + // Detect unordered lists look for bullets + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) + type = 'ul'; + + // Detect ordered lists 1., a. or ixv. + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) + type = 'ol'; + + // Check if node value matches the list pattern: o   + if (type) { + margin = parseFloat(p.style.marginLeft || 0); + + if (margin > lastMargin) + levels.push(margin); + + if (!listElm || type != lastType) { + listElm = dom.create(type); + dom.insertAfter(listElm, p); + } else { + // Nested list element + if (margin > lastMargin) { + listElm = li.appendChild(dom.create(type)); + } else if (margin < lastMargin) { + // Find parent level based on margin value + idx = tinymce.inArray(levels, margin); + parents = dom.getParents(listElm.parentNode, type); + listElm = parents[parents.length - 1 - idx] || listElm; + } + } + + // Remove middot or number spans if they exists + each(dom.select('span', p), function(span) { + var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); + + // Remove span with the middot or the number + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) + dom.remove(span); + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + dom.remove(span); + }); + + html = p.innerHTML; + + // Remove middot/list items + if (type == 'ul') + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); + else + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); + + // Create li and add paragraph data into the new li + li = listElm.appendChild(dom.create('li', 0, html)); + dom.remove(p); + + lastMargin = margin; + lastType = type; + } else + listElm = lastMargin = 0; // End list element + }); + + // Remove any left over makers + html = o.node.innerHTML; + if (html.indexOf('__MCE_ITEM__') != -1) + o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); + }, + + /** + * Inserts the specified contents at the caret position. + */ + _insert : function(h, skip_undo) { + var ed = this.editor, r = ed.selection.getRng(); + + // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. + if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) + ed.getDoc().execCommand('Delete', false, null); + + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); + }, + + /** + * Instead of the old plain text method which tried to re-create a paste operation, the + * new approach adds a plain text mode toggle switch that changes the behavior of paste. + * This function is passed the same input that the regular paste plugin produces. + * It performs additional scrubbing and produces (and inserts) the plain text. + * This approach leverages all of the great existing functionality in the paste + * plugin, and requires minimal changes to add the new functionality. + * Speednet - June 2009 + */ + _insertPlainText : function(ed, dom, h) { + var i, len, pos, rpos, node, breakElms, before, after, + w = ed.getWin(), + d = ed.getDoc(), + sel = ed.selection, + is = tinymce.is, + inArray = tinymce.inArray, + linebr = getParam(ed, "paste_text_linebreaktype"), + rl = getParam(ed, "paste_text_replacements"); + + function process(items) { + each(items, function(v) { + if (v.constructor == RegExp) + h = h.replace(v, ""); + else + h = h.replace(v[0], v[1]); + }); + }; + + if ((typeof(h) === "string") && (h.length > 0)) { + // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) { + process([ + /[\n\r]+/g + ]); + } else { + // Otherwise just get rid of carriage returns (only need linefeeds) + process([ + /\r+/g + ]); + } + + process([ + [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them + [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
        tags and table rows + [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them + /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags + [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars. + [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks + /^\s+|\s+$/g // Trim the front & back + ]); + + h = dom.decode(tinymce.html.Entities.encodeRaw(h)); + + // Delete any highlighted text before pasting + if (!sel.isCollapsed()) { + d.execCommand("Delete", false, null); + } + + // Perform default or custom replacements + if (is(rl, "array") || (is(rl, "array"))) { + process(rl); + } + else if (is(rl, "string")) { + process(new RegExp(rl, "gi")); + } + + // Treat paragraphs as specified in the config + if (linebr == "none") { + process([ + [/\n+/g, " "] + ]); + } + else if (linebr == "br") { + process([ + [/\n/g, "
        "] + ]); + } + else { + process([ + /^\s+|\s+$/g, + [/\n\n/g, "

        "], + [/\n/g, "
        "] + ]); + } + + // This next piece of code handles the situation where we're pasting more than one paragraph of plain + // text, and we are pasting the content into the middle of a block node in the editor. The block + // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining). + // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the + // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between + // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and + // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the + // plain text take the same style as the existing paragraph.) + if ((pos = h.indexOf("

        ")) != -1) { + rpos = h.lastIndexOf("

        "); + node = sel.getNode(); + breakElms = []; // Get list of elements to break + + do { + if (node.nodeType == 1) { + // Don't break tables and break at body + if (node.nodeName == "TD" || node.nodeName == "BODY") { + break; + } + + breakElms[breakElms.length] = node; + } + } while (node = node.parentNode); + + // Are we in the middle of a block node? + if (breakElms.length > 0) { + before = h.substring(0, pos); + after = ""; + + for (i=0, len=breakElms.length; i"; + after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">"; + } + + if (pos == rpos) { + h = before + after + h.substring(pos+7); + } + else { + h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7); + } + } + } + + // Insert content at the caret, plus add a marker for repositioning the caret + ed.execCommand("mceInsertRawHTML", false, h + ' '); + + // Reposition the caret to the marker, which was placed immediately after the inserted content. + // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers. + // The second part of the code scrolls the content up if the caret is positioned off-screen. + // This is only necessary for WebKit browsers, but it doesn't hurt to use for all. + window.setTimeout(function() { + var marker = dom.get('_plain_text_marker'), + elm, vp, y, elmHeight; + + sel.select(marker, false); + d.execCommand("Delete", false, null); + marker = null; + + // Get element, position and height + elm = sel.getStart(); + vp = dom.getViewPort(w); + y = dom.getPos(elm).y; + elmHeight = elm.clientHeight; + + // Is element within viewport if not then scroll it into view + if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) { + d.body.scrollTop = y < vp.y ? y : y - vp.h + 25; + } + }, 0); + } + }, + + /** + * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. + */ + _legacySupport : function() { + var t = this, ed = t.editor; + + // Register command(s) for backwards compatibility + ed.addCommand("mcePasteWord", function() { + ed.windowManager.open({ + file: t.url + "/pasteword.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline: 1 + }); + }); + + if (getParam(ed, "paste_text_use_dialog")) { + ed.addCommand("mcePasteText", function() { + ed.windowManager.open({ + file : t.url + "/pastetext.htm", + width: parseInt(getParam(ed, "paste_dialog_width")), + height: parseInt(getParam(ed, "paste_dialog_height")), + inline : 1 + }); + }); + } + + // Register button for backwards compatibility + ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); + } + }); + + // Register plugin + tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); +})(); diff --git a/js/tiny_mce/plugins/paste/js/pastetext.js b/js/tiny_mce/plugins/paste/js/pastetext.js new file mode 100644 index 000000000..c524f9eb0 --- /dev/null +++ b/js/tiny_mce/plugins/paste/js/pastetext.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

        ' + row + '

        '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/js/tiny_mce/plugins/paste/js/pasteword.js b/js/tiny_mce/plugins/paste/js/pasteword.js new file mode 100644 index 000000000..a52731c36 --- /dev/null +++ b/js/tiny_mce/plugins/paste/js/pasteword.js @@ -0,0 +1,51 @@ +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/js/tiny_mce/plugins/paste/langs/ar_dlg.js b/js/tiny_mce/plugins/paste/langs/ar_dlg.js new file mode 100755 index 000000000..a5d0c9ed5 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.paste_dlg',{word_title:"\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0639\u0644\u0649 \u0644\u0648\u062d\u0629 \u0627\u0644\u0645\u0641\u0627\u062a\u064a\u062d \u0644\u0644\u0635\u0642 \u0627\u0644\u0646\u0635 \u0641\u064a \u0627\u0644\u0625\u0637\u0627\u0631.( CTRL+V )",text_linebreaks:"\u0627\u062d\u062a\u0641\u0638 \u0628\u0641\u0648\u0627\u0635\u0644 \u0627\u0644\u0623\u0633\u0637\u0631",text_title:"\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0639\u0644\u0649 \u0644\u0648\u062d\u0629 \u0627\u0644\u0645\u0641\u0627\u062a\u064a\u062d \u0644\u0644\u0635\u0642 \u0627\u0644\u0646\u0635 \u0641\u064a \u0627\u0644\u0625\u0637\u0627\u0631.( CTRL+V )"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/az_dlg.js b/js/tiny_mce/plugins/paste/langs/az_dlg.js new file mode 100755 index 000000000..8371ae1e0 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.paste_dlg',{word_title:"P\u0259nc\u0259r\u0259y\u0259 s\u00f6z \u0259lav\u0259 etm\u0259k \u00fc\u00e7\u00fcn CTRL+V klavi\u015f birl\u0259\u015fm\u0259sini istifad\u0259 edin.",text_linebreaks:"S\u0259tr s\u0131nmalar\u0131n\u0131 saxla",text_title:"P\u0259nc\u0259r\u0259y\u0259 m\u0259tn \u0259lav\u0259 etm\u0259k \u00fc\u00e7\u00fcn CTRL+V klavi\u015f birl\u0259\u015fm\u0259sini istifad\u0259 edin."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/be_dlg.js b/js/tiny_mce/plugins/paste/langs/be_dlg.js new file mode 100755 index 000000000..63d134b09 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.paste_dlg',{word_title:"\u0412\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u0430\u0439\u0446\u0435 \u0441\u043f\u0430\u043b\u0443\u0447\u044d\u043d\u043d\u0435 \u043a\u043b\u0430\u0432\u0456\u0448 CTRL+V \u043a\u0430\u0431 \u0443\u0441\u0442\u0430\u0432\u0456\u0446\u044c \u0442\u044d\u043a\u0441\u0442 \u0443 \u0430\u043a\u043d\u043e.",text_linebreaks:"\u0417\u0430\u0445\u043e\u045e\u0432\u0430\u0446\u044c \u043f\u0430\u0440\u044b\u0432\u044b \u0440\u0430\u0434\u043a\u043e\u045e",text_title:"\u0412\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u0430\u0439\u0446\u0435 \u0441\u043f\u0430\u043b\u0443\u0447\u044d\u043d\u043d\u0435 \u043a\u043b\u0430\u0432\u0456\u0448 CTRL+V \u043a\u0430\u0431 \u0443\u0441\u0442\u0430\u0432\u0456\u0446\u044c \u0442\u044d\u043a\u0441\u0442 \u0443 \u0430\u043a\u043d\u043e."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/bg_dlg.js b/js/tiny_mce/plugins/paste/langs/bg_dlg.js new file mode 100755 index 000000000..2761efa81 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.paste_dlg',{word_title:"\u0418\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0439\u0442\u0435 CTRL+V \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430\u0442\u0430 \u0437\u0430 \u0434\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446\u0430.",text_linebreaks:"\u0417\u0430\u043f\u0430\u0437\u0438 \u043d\u043e\u0432\u0438\u0442\u0435 \u0440\u0435\u0434\u043e\u0432\u0435",text_title:"\u0418\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0439\u0442\u0435 CTRL+V \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430\u0442\u0430 \u0437\u0430 \u0434\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043f\u0440\u043e\u0437\u043e\u0440\u0435\u0446\u0430."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/bn_dlg.js b/js/tiny_mce/plugins/paste/langs/bn_dlg.js new file mode 100755 index 000000000..592080db9 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.paste_dlg',{"word_title":"Use CTRL+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep linebreaks","text_title":"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/br_dlg.js b/js/tiny_mce/plugins/paste/langs/br_dlg.js new file mode 100755 index 000000000..679cd6c52 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.paste_dlg',{word_title:"Use CTRL+V para colar o texto na janela.",text_linebreaks:"Manter quebras de linha",text_title:"Use CTRL+V para colar o texto na janela."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/bs_dlg.js b/js/tiny_mce/plugins/paste/langs/bs_dlg.js new file mode 100755 index 000000000..51ae381f2 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.paste_dlg',{word_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor.",text_linebreaks:"Zadr\u017ei prijelome",text_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ca_dlg.js b/js/tiny_mce/plugins/paste/langs/ca_dlg.js new file mode 100755 index 000000000..ac180fb11 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.paste_dlg',{"word_title":"Amb el teclat utilitzeu CTRL+V per a enganxar el text dins la finestra.","text_linebreaks":"Conserva els salts de l\u00ednia","text_title":"Amb el teclat utilitzeu CTRL+V per a enganxar el text dins la finestra."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ch_dlg.js b/js/tiny_mce/plugins/paste/langs/ch_dlg.js new file mode 100755 index 000000000..1762781c0 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.paste_dlg',{word_title:"\u7528 Ctrl+V \u5c06\u5185\u5bb9\u8d34\u4e0a\u3002",text_linebreaks:"\u4fdd\u7559\u5206\u884c\u7b26\u53f7",text_title:"\u7528 Ctrl+V \u5c06\u5185\u5bb9\u8d34\u4e0a\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/cn_dlg.js b/js/tiny_mce/plugins/paste/langs/cn_dlg.js new file mode 100755 index 000000000..274905a94 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.paste_dlg',{"word_title":"\u4f7f\u7528CTRL V\u7c98\u8d34\u5185\u5bb9","text_linebreaks":"\u4fdd\u7559\u5206\u884c\u7b26\u53f7","text_title":"\u4f7f\u7528CTRL V\u7c98\u8d34\u5185\u5bb9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/cs_dlg.js b/js/tiny_mce/plugins/paste/langs/cs_dlg.js new file mode 100755 index 000000000..104458b93 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.paste_dlg',{word_title:"Pou\u017eijte CTRL+V pro vlo\u017een\u00ed textu do okna.",text_linebreaks:"Zachovat zalamov\u00e1n\u00ed \u0159\u00e1dk\u016f",text_title:"Pou\u017eijte CTRL+V pro vlo\u017een\u00ed textu do okna."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/cy_dlg.js b/js/tiny_mce/plugins/paste/langs/cy_dlg.js new file mode 100755 index 000000000..c7b6ac74f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.paste_dlg',{word_title:"Defnyddiwch CTRL+V ar eich bysellfwrdd i ludo\'r testun i fewn i\'r ffenest.",text_linebreaks:"Cadw toriadau llinell",text_title:"Defnyddiwch CTRL+V ar eich bysellfwrdd i ludo\'r testun i fewn i\'r ffenest."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/da_dlg.js b/js/tiny_mce/plugins/paste/langs/da_dlg.js new file mode 100755 index 000000000..e5c175d30 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.paste_dlg',{word_title:"Anvend CTRL+V p\u00e5 tastaturet for at inds\u00e6tte teksten.",text_linebreaks:"Bevar linieskift",text_title:"Anvend CTRL+V p\u00e5 tastaturet for at inds\u00e6tte teksten."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/de_dlg.js b/js/tiny_mce/plugins/paste/langs/de_dlg.js new file mode 100755 index 000000000..316384588 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.paste_dlg',{word_title:"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen.",text_linebreaks:"Zeilenumbr\u00fcche beibehalten",text_title:"Dr\u00fccken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00fcgen."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/dv_dlg.js b/js/tiny_mce/plugins/paste/langs/dv_dlg.js new file mode 100755 index 000000000..250d9b953 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/el_dlg.js b/js/tiny_mce/plugins/paste/langs/el_dlg.js new file mode 100755 index 000000000..0ca1903b0 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.paste_dlg',{word_title:"\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 CTRL+V \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03b5\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7 \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03c4\u03bf \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf.",text_linebreaks:"\u039d\u03b1 \u03ba\u03c1\u03b1\u03c4\u03b7\u03b8\u03bf\u03cd\u03bd \u03c4\u03b1 linebreaks",text_title:"\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 CTRL+V \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03b5\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7 \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03c4\u03bf \u03c0\u03b1\u03c1\u03ac\u03b8\u03c5\u03c1\u03bf."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/en_dlg.js b/js/tiny_mce/plugins/paste/langs/en_dlg.js new file mode 100644 index 000000000..ad41eb95b --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use CTRL+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep linebreaks","text_title":"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/es_dlg.js b/js/tiny_mce/plugins/paste/langs/es_dlg.js new file mode 100755 index 000000000..82d8dc278 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.paste_dlg',{"word_title":"Use CTRL+V en su teclado para pegar el texto en la ventana.","text_linebreaks":"Keep linebreaks","text_title":"Use CTRL+V en su teclado para pegar el texto en la ventana."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/et_dlg.js b/js/tiny_mce/plugins/paste/langs/et_dlg.js new file mode 100755 index 000000000..c9a4fa90e --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.paste_dlg',{word_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks.",text_linebreaks:"J\u00e4ta reavahetused",text_title:"Vajuta CTRL+V oma klaviatuuril teksti aknasse kleepimiseks."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/eu_dlg.js b/js/tiny_mce/plugins/paste/langs/eu_dlg.js new file mode 100755 index 000000000..cd54c8d0a --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.paste_dlg',{word_title:"Erabili CTRL+V testua lehioan itsasteko.",text_linebreaks:"Mantendu lerro-jauziak",text_title:"Erabili CTRL+V testua lehioan itsasteko."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/fa_dlg.js b/js/tiny_mce/plugins/paste/langs/fa_dlg.js new file mode 100755 index 000000000..c555ac8ea --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.paste_dlg',{word_title:"\u062c\u0647\u062a \u0686\u0633\u0628\u0627\u0646\u062f\u0646 \u0645\u062a\u0646 \u062f\u0631 \u067e\u0646\u062c\u0631\u0647 \u0627\u0632 CTRL+V \u0628\u0631 \u0631\u0648\u06cc \u0635\u0641\u062d\u0647 \u06a9\u0644\u06cc\u062f \u062e\u0648\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0645\u0627\u0626\u06cc\u062f.",text_linebreaks:"\u062d\u0641\u0638 \u0642\u0637\u0639 \u062e\u0637\u0648\u0637",text_title:"\u062c\u0647\u062a \u0686\u0633\u0628\u0627\u0646\u062f\u0646 \u0645\u062a\u0646 \u062f\u0631 \u067e\u0646\u062c\u0631\u0647 \u0627\u0632 CTRL+V \u0628\u0631 \u0631\u0648\u06cc \u0635\u0641\u062d\u0647 \u06a9\u0644\u06cc\u062f \u062e\u0648\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0645\u0627\u0626\u06cc\u062f."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/fi_dlg.js b/js/tiny_mce/plugins/paste/langs/fi_dlg.js new file mode 100755 index 000000000..d4e2b284f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.paste_dlg',{word_title:"Paina Ctrl+V liitt\u00e4\u00e4ksesi sis\u00e4ll\u00f6n ikkunaan.",text_linebreaks:"S\u00e4ilyt\u00e4 rivinvaihdot",text_title:"Paina Ctrl+V liitt\u00e4\u00e4ksesi sis\u00e4ll\u00f6n ikkunaan."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/fr_dlg.js b/js/tiny_mce/plugins/paste/langs/fr_dlg.js new file mode 100755 index 000000000..1431de182 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.paste_dlg',{word_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre.",text_linebreaks:"Conserver les retours \u00e0 la ligne",text_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/gl_dlg.js b/js/tiny_mce/plugins/paste/langs/gl_dlg.js new file mode 100755 index 000000000..4c4bcb61d --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.paste_dlg',{word_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00e1.",text_linebreaks:"Manter salto de li\u00f1as",text_title:"Use CTRL+V no teclado pra pega-lo texto na vent\u00e1."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/gu_dlg.js b/js/tiny_mce/plugins/paste/langs/gu_dlg.js new file mode 100755 index 000000000..c8a537d0d --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/he_dlg.js b/js/tiny_mce/plugins/paste/langs/he_dlg.js new file mode 100755 index 000000000..e69c41565 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.paste_dlg',{word_title:"\u05d4\u05d3\u05d1\u05d9\u05e7\u05d5 \u05d1\u05d7\u05dc\u05d5\u05df \u05d6\u05d4 \u05d0\u05ea \u05d4\u05d8\u05e7\u05e1\u05d8 \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4\u05de\u05e7\u05e9\u05d9\u05dd CTRL+V.",text_linebreaks:"\u05d4\u05e9\u05d0\u05e8 \u05d0\u05ea \u05e9\u05d5\u05e8\u05d5\u05ea \u05d4\u05e8\u05d5\u05d5\u05d7",text_title:"\u05d4\u05d3\u05d1\u05d9\u05e7\u05d5 \u05d1\u05d7\u05dc\u05d5\u05df \u05d6\u05d4 \u05d0\u05ea \u05d4\u05d8\u05e7\u05e1\u05d8 \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4\u05de\u05e7\u05e9\u05d9\u05dd CTRL+V."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/hi_dlg.js b/js/tiny_mce/plugins/paste/langs/hi_dlg.js new file mode 100755 index 000000000..6a6a903f2 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/hr_dlg.js b/js/tiny_mce/plugins/paste/langs/hr_dlg.js new file mode 100755 index 000000000..a1dbefe79 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.paste_dlg',{word_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor.",text_linebreaks:"Zadr\u017ei prijelome",text_title:"Koristite CTRL+V na tipkovnici da zalijepite tekst u prozor."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/hu_dlg.js b/js/tiny_mce/plugins/paste/langs/hu_dlg.js new file mode 100755 index 000000000..7f4fb7e7b --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.paste_dlg',{"word_title":"Haszn\u00e1lja a Ctrl+V-t a billenty\u0171zet\u00e9n a beilleszt\u00e9shez.","text_linebreaks":"Sort\u00f6r\u00e9sek megtart\u00e1sa","text_title":"Haszn\u00e1lja a Ctrl+V-t a billenty\u0171zet\u00e9n a beilleszt\u00e9shez."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/hy_dlg.js b/js/tiny_mce/plugins/paste/langs/hy_dlg.js new file mode 100755 index 000000000..7bfd0adb2 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.paste_dlg',{word_title:"\u0555\u0563\u057f\u0561\u0563\u0578\u0580\u056e\u0565\u0584 CTRL + V \u057a\u0561\u057f\u0573\u0565\u0576\u057e\u0561\u056e \u057f\u0565\u0584\u057d\u057f\u056b \u057f\u0565\u0572\u0561\u0564\u0580\u0574\u0561\u0576 \u0570\u0561\u0574\u0561\u0580",text_linebreaks:"\u054a\u0561\u0570\u057a\u0561\u0576\u0565\u056c \u057f\u0578\u0572\u0561\u0564\u0561\u0580\u0571\u0565\u0580\u0568",text_title:"\u0555\u0563\u057f\u0561\u0563\u0578\u0580\u056e\u0565\u0584 CTRL + V \u057a\u0561\u057f\u0573\u0565\u0576\u057e\u0561\u056e \u057f\u0565\u0584\u057d\u057f\u056b \u057f\u0565\u0572\u0561\u0564\u0580\u0574\u0561\u0576 \u0570\u0561\u0574\u0561\u0580"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ia_dlg.js b/js/tiny_mce/plugins/paste/langs/ia_dlg.js new file mode 100755 index 000000000..b7906e916 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.paste_dlg',{word_title:"\u5c06\u590d\u5236(CTRL + C)\u7684\u5185\u5bb9\u7c98\u8d34(CTRL + V)\u5230\u7a97\u53e3\u3002",text_linebreaks:"\u4fdd\u7559\u5206\u884c\u7b26\u53f7\u53f7",text_title:"\u5c06\u590d\u5236(CTRL + C)\u7684\u5185\u5bb9\u7c98\u8d34(CTRL + V)\u5230\u7a97\u53e3\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/id_dlg.js b/js/tiny_mce/plugins/paste/langs/id_dlg.js new file mode 100755 index 000000000..316ad15cc --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.paste_dlg',{word_title:"Gunakan CTRL+V pada keyboard untuk paste.",text_linebreaks:"Keep linebreaks",text_title:"Gunakan CTRL+V pada keyboard untuk paste."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ii_dlg.js b/js/tiny_mce/plugins/paste/langs/ii_dlg.js new file mode 100755 index 000000000..4a2d0983a --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ii_dlg.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('ii.paste_dlg',{ +text_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002", +text_linebreaks:"\u4FDD\u7559\u5206\u884C\u7B26\u53F7\u53F7", +word_title:"\u5728\u952E\u76D8\u4E0A\u540C\u65F6\u6309\u4E0BCTRL\u548CV\u952E\uFF0C\u4EE5\u7C98\u8D34\u6587\u5B57\u5230\u6B64\u7A97\u53E3\u3002" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/is_dlg.js b/js/tiny_mce/plugins/paste/langs/is_dlg.js new file mode 100755 index 000000000..a0e80907f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.paste_dlg',{word_title:"Nota\u00f0u CTRL+V \u00e1 lyklabo\u00f0rinu til a\u00f0 l\u00edma textanum \u00ed ritilinn.",text_linebreaks:"Halda endingu l\u00edna",text_title:"Nota\u00f0u CTRL+V \u00e1 lyklabor\u00f0inu til a\u00f0 l\u00edma textanum \u00ed ritilinn."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/it_dlg.js b/js/tiny_mce/plugins/paste/langs/it_dlg.js new file mode 100755 index 000000000..70da57811 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.paste_dlg',{word_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra.",text_linebreaks:"Mantieni interruzioni di riga",text_title:"Premere CTRL+V sulla tastiera per incollare il testo nella finestra."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ja_dlg.js b/js/tiny_mce/plugins/paste/langs/ja_dlg.js new file mode 100755 index 000000000..77ec5302c --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.paste_dlg',{"word_title":"Ctrl+V(\u30ad\u30fc\u30dc\u30fc\u30c9)\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002","text_linebreaks":"\u6539\u884c\u3092\u4fdd\u6301\u3059\u308b","text_title":"Ctrl+V(\u30ad\u30fc\u30dc\u30fc\u30c9)\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ka_dlg.js b/js/tiny_mce/plugins/paste/langs/ka_dlg.js new file mode 100755 index 000000000..d0a6b0383 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.paste_dlg',{word_title:"\u0418\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10e9\u10d0\u10e1\u10d0\u10e1\u10db\u10d4\u10da\u10d0\u10d3 \u10d2\u10d0\u10db\u10dd\u10d8\u10e7\u10d4\u10dc\u10d4\u10d7 \u10d9\u10da\u10d0\u10d5\u10d8\u10d0\u10e2\u10e3\u10e0\u10e3\u10da\u10d8 \u10d9\u10dd\u10db\u10d1\u10d8\u10dc\u10d0\u10ea\u10d8\u10d0 CTRL+V.",text_linebreaks:"\u10d2\u10d0\u10d3\u10d0\u10e2\u10d0\u10dc\u10d8\u10da\u10d8 \u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8\u10e1 \u10e8\u10d4\u10dc\u10d0\u10ee\u10d5\u10d0",text_title:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10e9\u10d0\u10e1\u10d0\u10e1\u10db\u10d4\u10da\u10d0\u10d3 \u10d2\u10d0\u10db\u10dd\u10d8\u10e7\u10d4\u10dc\u10d4\u10d7 \u10d9\u10da\u10d0\u10d5\u10d8\u10d0\u10e2\u10e3\u10e0\u10e3\u10da\u10d8 \u10d9\u10dd\u10db\u10d1\u10d8\u10dc\u10d0\u10ea\u10d8\u10d0 CTRL+V."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/kl_dlg.js b/js/tiny_mce/plugins/paste/langs/kl_dlg.js new file mode 100755 index 000000000..94c8b5c80 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/km_dlg.js b/js/tiny_mce/plugins/paste/langs/km_dlg.js new file mode 100755 index 000000000..8c3c36c8e --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.paste_dlg',{word_title:"\u1794\u17d2\u179a\u17be CTRL V \u1793\u17c5\u179b\u17be\u1780\u17d2\u178a\u17b6\u179a\u1785\u17bb\u1785\u178a\u17be\u1798\u17d2\u1794\u17b8\u1794\u17b7\u1791\u1797\u17d2\u1787\u17b6\u1794\u17cb\u17a2\u178f\u17d2\u1790\u1794\u1791\u1791\u17c5\u1793\u17b9\u1784\u1794\u1784\u17d2\u17a2\u17bd\u1785\u1793\u17c1\u17c7\u00a0\u17d4",text_linebreaks:"\u179a\u1780\u17d2\u179f\u17b6\u179f\u1789\u17d2\u1789\u17b6\u1785\u17bb\u17c7\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb",text_title:"\u1794\u17d2\u179a\u17be CTRL V \u1793\u17c5\u179b\u17be\u1780\u17d2\u178a\u17b6\u179a\u1785\u17bb\u1785\u178a\u17be\u1798\u17d2\u1794\u17b8\u1794\u17b7\u1791\u1797\u17d2\u1787\u17b6\u1794\u17cb\u17a2\u178f\u17d2\u1790\u1794\u1791\u1791\u17c5\u1793\u17b9\u1784\u1794\u1784\u17d2\u17a2\u17bd\u1785\u1793\u17c1\u17c7\u00a0\u17d4"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ko_dlg.js b/js/tiny_mce/plugins/paste/langs/ko_dlg.js new file mode 100755 index 000000000..4c009fe66 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.paste_dlg',{word_title:"\uc708\ub3c4\uc6b0\uc5d0 \ud14d\uc2a4\ud2b8\ub97c \ubd99\uc774\ub824\uba74 \ud0a4\ubcf4\ub4dc\ub85cCtrl+V\ub97c \uc785\ub825\ud574 \uc8fc\uc138\uc694.",text_linebreaks:"\uac1c\ud589\uc744 \ubcf4\uad00 \uc720\uc9c0",text_title:"\uc708\ub3c4\uc6b0\uc5d0 \ud14d\uc2a4\ud2b8\ub97c \ubd99\uc774\ub824\uba74 \ud0a4\ubcf4\ub4dc\ub85c Ctrl+V\ub97c \uc785\ub825\ud574 \uc8fc\uc138\uc694."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/lb_dlg.js b/js/tiny_mce/plugins/paste/langs/lb_dlg.js new file mode 100755 index 000000000..381de1072 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.paste_dlg',{word_title:"Dr\u00e9ckt op \u00c4rer Tastatur Ctrl+V, um den Text an ze f\u00fcgen.",text_linebreaks:"Zeilen\u00ebmbr\u00ebch b\u00e4ibehalen",text_title:"Dr\u00e9ckt op \u00c4rer Tastatur Ctrl+V, fir den Text an ze f\u00fcgen."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/lt_dlg.js b/js/tiny_mce/plugins/paste/langs/lt_dlg.js new file mode 100755 index 000000000..d1eac566b --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.paste_dlg',{word_title:"Naudokite CTRL+V tekstui \u012fd\u0117ti \u012f \u0161\u012f lang\u0105.",text_linebreaks:"Palikti eilu\u010di\u0173 l\u016b\u017eius",text_title:"Naudokite CTRL+V tekstui \u012fd\u0117ti \u012f \u0161\u012f lang\u0105."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/lv_dlg.js b/js/tiny_mce/plugins/paste/langs/lv_dlg.js new file mode 100755 index 000000000..b9f8ef963 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.paste_dlg',{word_title:"Izmantojiet CTRL+V uz j\u016bsu tastat\u016bras lai iekop\u0113t tekstu log\u0101.",text_linebreaks:"Sagl\u0101b\u0101t l\u012bniju sadal\u012bt\u0101jus",text_title:"Izmantojiet CTRL+V uz j\u016bsu tastat\u016bras lai iekop\u0113t tekstu log\u0101."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/mk_dlg.js b/js/tiny_mce/plugins/paste/langs/mk_dlg.js new file mode 100755 index 000000000..dffbe0d85 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.paste_dlg',{word_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor.",text_linebreaks:"Zadr\u017ei prelome",text_title:"Koristite CTRL+V na tipkovnici da zalepite tekst u prozor."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ml_dlg.js b/js/tiny_mce/plugins/paste/langs/ml_dlg.js new file mode 100755 index 000000000..e22058716 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/mn_dlg.js b/js/tiny_mce/plugins/paste/langs/mn_dlg.js new file mode 100755 index 000000000..76f212ddc --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.paste_dlg',{word_title:"\u0422\u0430 \u0431\u0438\u0447\u0432\u044d\u0440 \u043e\u0440\u0443\u0443\u043b\u0430\u0445\u044b\u0433 \u0445\u04af\u0441\u0432\u044d\u043b Ctrl+V \u0434\u044d\u044d\u0440 \u0434\u0430\u0440\u043d\u0430 \u0443\u0443.",text_linebreaks:"\u041c\u04e9\u0440 \u0442\u0430\u0441\u043b\u0430\u043b\u0442\u044b\u0433 \u04af\u043b\u0434\u044d\u044d\u043d\u044d",text_title:"\u0422\u0430 \u0431\u0438\u0447\u0432\u044d\u0440 \u043e\u0440\u0443\u0443\u043b\u0430\u0445\u044b\u0433 \u0445\u04af\u0441\u0432\u044d\u043b Ctrl+V \u0434\u044d\u044d\u0440 \u0434\u0430\u0440\u043d\u0430 \u0443\u0443."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ms_dlg.js b/js/tiny_mce/plugins/paste/langs/ms_dlg.js new file mode 100755 index 000000000..46b55d666 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.paste_dlg',{word_title:"Guna CTRL+V pada papan kekunci anda untuk teks ke dalam tetingkap.",text_linebreaks:"Biarkan garisan pemisah",text_title:"Guna CTRL+V pada papan kekunci anda untuk Tempel teks ke dalam tetingkap."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/my_dlg.js b/js/tiny_mce/plugins/paste/langs/my_dlg.js new file mode 100755 index 000000000..5b598ca0e --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.paste_dlg',{word_title:"\u101d\u1004\u103a\u1038\u1012\u102d\u102f\u1038\u1011\u1032\u101e\u102d\u102f\u1037 \u1005\u102c\u101e\u102c\u1038\u1000\u102d\u102f \u1000\u1030\u1038\u103c\u1016\u100a\u103a\u1037\u101b\u1014\u103a \u101e\u1004\u103a\u1037 \u1000\u102e\u1038\u1018\u102f\u1010\u103a\u101c\u1000\u103a\u1000\u103d\u1000\u103a\u101b\u103e\u102d CTRL V \u1000\u102d\u102f \u101e\u1036\u102f\u1038\u1015\u102b",text_linebreaks:"\u1005\u102c\u1031\u103c\u1000\u102c\u1004\u103a\u1038\u1001\u103d\u1032\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1001\u103d\u1032\u101c\u103b\u103e\u1000\u103a\u1011\u102c\u1038\u1015\u102b",text_title:"\u101d\u1004\u103a\u1038\u1012\u102d\u102f\u1038\u1011\u1032\u101e\u102d\u102f\u1037 \u1005\u102c\u101e\u102c\u1038\u1000\u102d\u102f \u1000\u1030\u1038\u103c\u1016\u100a\u103a\u1037\u101b\u1014\u103a \u101e\u1004\u103a\u1037 \u1000\u102e\u1038\u1018\u102f\u1010\u103a\u101c\u1000\u103a\u1000\u103d\u1000\u103a\u101b\u103e\u102d CTRL V \u1000\u102d\u102f \u101e\u1036\u102f\u1038\u1015\u102b"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/nb_dlg.js b/js/tiny_mce/plugins/paste/langs/nb_dlg.js new file mode 100755 index 000000000..bfb2266f8 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.paste_dlg',{"word_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn i dette vinduet.","text_linebreaks":"Behold tekstbryting","text_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn i dette vinduet."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/nl_dlg.js b/js/tiny_mce/plugins/paste/langs/nl_dlg.js new file mode 100755 index 000000000..bac8ac046 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.paste_dlg',{"word_title":"Gebruik Ctrl+V om tekst in het venster te plakken.","text_linebreaks":"Regelafbreking bewaren","text_title":"Gebruik Ctrl+V om tekst in het venster te plakken."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/nn_dlg.js b/js/tiny_mce/plugins/paste/langs/nn_dlg.js new file mode 100755 index 000000000..0f421ae7f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.paste_dlg',{word_title:"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn i dette vindauget.",text_linebreaks:"Behald tekstbryting",text_title:"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn i dette vindauget."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/no_dlg.js b/js/tiny_mce/plugins/paste/langs/no_dlg.js new file mode 100755 index 000000000..3f8e333d0 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.paste_dlg',{"word_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn teksten i dette vinduet.","text_linebreaks":"Behold tekstbryting","text_title":"Bruk CTRL+V p\u00e5 tastaturet for \u00e5 lime inn teksten i dette vinduet."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/pl_dlg.js b/js/tiny_mce/plugins/paste/langs/pl_dlg.js new file mode 100755 index 000000000..54fd41c37 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.paste_dlg',{"word_title":"U\u017cyj CTRL+V na swojej klawiaturze \u017ceby wklei\u0107 tekst do okna.","text_linebreaks":"Zachowaj ko\u0144ce linii.","text_title":"U\u017cyj CTRL+V na swojej klawiaturze \u017ceby wklei\u0107 tekst do okna."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ps_dlg.js b/js/tiny_mce/plugins/paste/langs/ps_dlg.js new file mode 100755 index 000000000..721f1010a --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/pt_dlg.js b/js/tiny_mce/plugins/paste/langs/pt_dlg.js new file mode 100755 index 000000000..f49d5dd4b --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.paste_dlg',{word_title:"Use CTRL+V para colar o texto na janela.",text_linebreaks:"Manter quebras de linha",text_title:"Use CTRL+V para colar o texto na janela."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ro_dlg.js b/js/tiny_mce/plugins/paste/langs/ro_dlg.js new file mode 100755 index 000000000..91a8d2140 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.paste_dlg',{word_title:"Folosi\u0163i CTRL+V pentru a lipi \u00een aceast\u0103 zon\u0103.",text_linebreaks:"P\u0103streaz\u0103 separatoarele de linii.",text_title:"Folosi\u0163i CTRL+V pentru a lipi \u00een aceast\u0103 zon\u0103."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ru_dlg.js b/js/tiny_mce/plugins/paste/langs/ru_dlg.js new file mode 100755 index 000000000..b360b075d --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.paste_dlg',{"word_title":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043e\u043a\u043d\u043e.","text_linebreaks":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a","text_title":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u043e\u043a\u043d\u043e."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sc_dlg.js b/js/tiny_mce/plugins/paste/langs/sc_dlg.js new file mode 100755 index 000000000..5bc79d234 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.paste_dlg',{word_title:"\u5728\u952e\u76d8\u4e0a\u540c\u65f6\u6309\u4e0bCTRL\u548cV\u952e\uff0c\u4ee5\u8d34\u4e0a\u6587\u5b57\u5230\u6b64\u89c6\u7a97\u3002 ",text_linebreaks:"\u4fdd\u7559\u6362\u884c\u7b26\u53f7",text_title:"\u5728\u952e\u76d8\u4e0a\u540c\u65f6\u6309\u4e0bCTRL\u548cV\u952e\uff0c\u4ee5\u8d34\u4e0a\u6587\u5b57\u5230\u6b64\u89c6\u7a97\u3002 "}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/se_dlg.js b/js/tiny_mce/plugins/paste/langs/se_dlg.js new file mode 100755 index 000000000..8c7e86bfb --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.paste_dlg',{word_title:"Anv\u00e4nd ctrl-v p\u00e5 ditt tangentbord f\u00f6r att klistra in i detta f\u00f6nster.",text_linebreaks:"Spara radbrytningar",text_title:"Anv\u00e4nd ctrl-v p\u00e5 ditt tangentbord f\u00f6r att klistra in i detta f\u00f6nster."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/si_dlg.js b/js/tiny_mce/plugins/paste/langs/si_dlg.js new file mode 100755 index 000000000..058c014fa --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sk_dlg.js b/js/tiny_mce/plugins/paste/langs/sk_dlg.js new file mode 100755 index 000000000..eb3b2dba7 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.paste_dlg',{word_title:"Pou\u017eite CTRL+V pre vlo\u017eenie textu do okna.",text_linebreaks:"Zachova\u0165 zalamovanie riadkov",text_title:"Pou\u017eite CTRL+V pre vlo\u017eenie textu do okna."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sl_dlg.js b/js/tiny_mce/plugins/paste/langs/sl_dlg.js new file mode 100755 index 000000000..1757bcd43 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.paste_dlg',{word_title:"Uporabite kombinacijo tipk CTRL+V, da prilepite vsebino v okno.",text_linebreaks:"Obdr\u017ei prelome vrstic",text_title:"Uporabite kombinacijo tipk CTRL+V, da prilepite vsebino v okno."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sq_dlg.js b/js/tiny_mce/plugins/paste/langs/sq_dlg.js new file mode 100755 index 000000000..7e763e4d3 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.paste_dlg',{word_title:"P\u00ebrdor CTRL+V p\u00ebr t\u00eb ngjitur tekstin.",text_linebreaks:"Ruaj linjat e reja",text_title:"P\u00ebrdor CTRL+V p\u00ebr t\u00eb ngjitur tekstin."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sr_dlg.js b/js/tiny_mce/plugins/paste/langs/sr_dlg.js new file mode 100755 index 000000000..841442a11 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.paste_dlg',{word_title:"Koristite CTRL+V na tastaturi da zalepite tekst u prozor.",text_linebreaks:"Zadr\u017ei prelome",text_title:"Koristite CTRL+V na tastaturi da zalepite tekst u prozor."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/sv_dlg.js b/js/tiny_mce/plugins/paste/langs/sv_dlg.js new file mode 100755 index 000000000..1c99e2b1b --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.paste_dlg',{"word_title":"Anv\u00e4nd ctrl-v p\u00e5 ditt tangentbord f\u00f6r att klistra in i detta f\u00f6nster.","text_linebreaks":"Spara radbrytningar","text_title":"Anv\u00e4nd ctrl-v p\u00e5 ditt tangentbord f\u00f6r att klistra in i detta f\u00f6nster."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ta_dlg.js b/js/tiny_mce/plugins/paste/langs/ta_dlg.js new file mode 100755 index 000000000..0865a582c --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/te_dlg.js b/js/tiny_mce/plugins/paste/langs/te_dlg.js new file mode 100755 index 000000000..f7117790c --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/th_dlg.js b/js/tiny_mce/plugins/paste/langs/th_dlg.js new file mode 100755 index 000000000..646a460fe --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/tn_dlg.js b/js/tiny_mce/plugins/paste/langs/tn_dlg.js new file mode 100755 index 000000000..2c5c22db7 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/tr_dlg.js b/js/tiny_mce/plugins/paste/langs/tr_dlg.js new file mode 100755 index 000000000..99e1b73da --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.paste_dlg',{word_title:"Pencereye metin yap\u0131\u015ft\u0131rmak i\u00e7in klavyeden CTRL+V i kullan\u0131n.",text_linebreaks:"Sat\u0131r kesmelerini tut",text_title:"Pencereye metin yap\u0131\u015ft\u0131rmak i\u00e7in klavyeden CTRL+V i kullan\u0131n."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/tt_dlg.js b/js/tiny_mce/plugins/paste/langs/tt_dlg.js new file mode 100755 index 000000000..4eea8875f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.paste_dlg',{word_title:"\u5c07\u8907\u88fd(CTRL + C)\u7684\u5167\u5bb9\u8cbc\u4e0a(CTRL + V)\u5230\u8996\u7a97\u3002",text_linebreaks:"\u4fdd\u7559\u5206\u884c\u7b26\u865f\u865f",text_title:"\u5c07\u8907\u88fd(CTRL + C)\u7684\u5167\u5bb9\u8cbc\u4e0a(CTRL + V)\u5230\u8996\u7a97\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/tw_dlg.js b/js/tiny_mce/plugins/paste/langs/tw_dlg.js new file mode 100755 index 000000000..ae63d51a4 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.paste_dlg',{word_title:"\u7528 Ctrl+V \u5c07\u5167\u5bb9\u8cbc\u4e0a\u3002",text_linebreaks:"\u4fdd\u7559\u63db\u884c\u7b26\u865f",text_title:"\u7528 Ctrl+V \u5c07\u5167\u5bb9\u8cbc\u4e0a\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/uk_dlg.js b/js/tiny_mce/plugins/paste/langs/uk_dlg.js new file mode 100755 index 000000000..7a1f28ac1 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.paste_dlg',{word_title:"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443 \u0443 \u0432\u0456\u043a\u043d\u043e.",text_linebreaks:"\u0417\u0431\u0435\u0440\u0456\u0433\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438 \u0440\u044f\u0434\u043a\u0456\u0432",text_title:"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 CTRL+V \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443 \u0443 \u0432\u0456\u043a\u043d\u043e."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/ur_dlg.js b/js/tiny_mce/plugins/paste/langs/ur_dlg.js new file mode 100755 index 000000000..94ac588e8 --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.paste_dlg',{word_title:"Use CTRL+V on your keyboard to paste the text into the window.",text_linebreaks:"Keep linebreaks",text_title:"Use CTRL+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/vi_dlg.js b/js/tiny_mce/plugins/paste/langs/vi_dlg.js new file mode 100755 index 000000000..63a74d27f --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.paste_dlg',{word_title:"S\u1eed d\u1ee5ng CTRL+V tr\u00ean b\u00e0n ph\u00edm \u0111\u1ec3 d\u00e1n v\u0103n b\u1ea3n v\u00e0o c\u1eeda s\u1ed5.",text_linebreaks:"Gi\u1eef ng\u1eaft d\u00f2ng",text_title:"S\u1eed d\u1ee5ng CTRL+V tr\u00ean b\u00e0n ph\u00edm \u0111\u1ec3 d\u00e1n v\u0103n b\u1ea3n v\u00e0o c\u1eeda s\u1ed5."}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/paste/langs/zh-cn_dlg.js new file mode 100755 index 000000000..4abd1a96c --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.paste_dlg',{"word_title":"\u4f7f\u7528CTRL V\u7c98\u8d34\u6587\u672c\u5230\u7a97\u53e3\u4e2d\u3002","text_linebreaks":"\u4fdd\u7559\u65ad\u884c","text_title":"\u4f7f\u7528CTRL V\u7c98\u8d34\u6587\u672c\u5230\u7a97\u53e3\u4e2d\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/zh_dlg.js b/js/tiny_mce/plugins/paste/langs/zh_dlg.js new file mode 100755 index 000000000..94fb061eb --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.paste_dlg',{word_title:"\u7528 Ctrl+V \u5c06\u5185\u5bb9\u8d34\u4e0a\u3002",text_linebreaks:"\u4fdd\u7559\u5206\u884c\u7b26\u53f7",text_title:"\u7528 Ctrl+V \u5c06\u5185\u5bb9\u8d34\u4e0a\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/langs/zu_dlg.js b/js/tiny_mce/plugins/paste/langs/zu_dlg.js new file mode 100755 index 000000000..c977b26ad --- /dev/null +++ b/js/tiny_mce/plugins/paste/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.paste_dlg',{word_title:"\u5728\u952e\u76d8\u4e0a\u540c\u65f6\u6309\u4e0bCTRL\u548cV\u952e\uff0c\u4ee5\u8d34\u4e0a\u6587\u5b57\u5230\u6b64\u89c6\u7a97\u3002",text_linebreaks:"\u4fdd\u7559\u5206\u884c\u7b26\u53f7\u53f7",text_title:"\u5728\u952e\u76d8\u4e0a\u540c\u65f6\u6309\u4e0bCTRL\u548cV\u952e\uff0c\u4ee5\u8d34\u4e0a\u6587\u5b57\u5230\u6b64\u89c6\u7a97\u3002"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/pastetext.htm b/js/tiny_mce/plugins/paste/pastetext.htm new file mode 100644 index 000000000..b65594547 --- /dev/null +++ b/js/tiny_mce/plugins/paste/pastetext.htm @@ -0,0 +1,27 @@ + + + {#paste.paste_text_desc} + + + + +
        +
        {#paste.paste_text_desc}
        + +
        + +
        + +
        + +
        {#paste_dlg.text_title}
        + + + +
        + + +
        +
        + + \ No newline at end of file diff --git a/js/tiny_mce/plugins/paste/pasteword.htm b/js/tiny_mce/plugins/paste/pasteword.htm new file mode 100644 index 000000000..0f6bb4121 --- /dev/null +++ b/js/tiny_mce/plugins/paste/pasteword.htm @@ -0,0 +1,21 @@ + + + {#paste.paste_word_desc} + + + + +
        +
        {#paste.paste_word_desc}
        + +
        {#paste_dlg.word_title}
        + +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/preview/editor_plugin.js b/js/tiny_mce/plugins/preview/editor_plugin.js new file mode 100644 index 000000000..507909c5f --- /dev/null +++ b/js/tiny_mce/plugins/preview/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/preview/editor_plugin_src.js b/js/tiny_mce/plugins/preview/editor_plugin_src.js new file mode 100644 index 000000000..80f00f0d9 --- /dev/null +++ b/js/tiny_mce/plugins/preview/editor_plugin_src.js @@ -0,0 +1,53 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Preview', { + init : function(ed, url) { + var t = this, css = tinymce.explode(ed.settings.content_css); + + t.editor = ed; + + // Force absolute CSS urls + tinymce.each(css, function(u, k) { + css[k] = ed.documentBaseURI.toAbsolute(u); + }); + + ed.addCommand('mcePreview', function() { + ed.windowManager.open({ + file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), + width : parseInt(ed.getParam("plugin_preview_width", "550")), + height : parseInt(ed.getParam("plugin_preview_height", "600")), + resizable : "yes", + scrollbars : "yes", + popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), + inline : ed.getParam("plugin_preview_inline", 1) + }, { + base : ed.documentBaseURI.getURI() + }); + }); + + ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); + }, + + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('preview', tinymce.plugins.Preview); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/preview/example.html b/js/tiny_mce/plugins/preview/example.html new file mode 100644 index 000000000..b2c3d90ce --- /dev/null +++ b/js/tiny_mce/plugins/preview/example.html @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
        +
        + +
        + + + diff --git a/js/tiny_mce/plugins/preview/jscripts/embed.js b/js/tiny_mce/plugins/preview/jscripts/embed.js new file mode 100644 index 000000000..f8dc81052 --- /dev/null +++ b/js/tiny_mce/plugins/preview/jscripts/embed.js @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ' + + + + + +{#preview.preview_desc} + + + + + diff --git a/js/tiny_mce/plugins/searchreplace/langs/ar_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ar_dlg.js new file mode 100755 index 000000000..dc74b5dcf --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ar_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ar.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/az_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/az_dlg.js new file mode 100755 index 000000000..47210e43c --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/az_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('az.searchreplace_dlg',{ +searchnext_desc:"S\u00F6zl\u0259ri axtar", +notfound:"Axtar\u0131\u015F bitdi. S\u0259tr tap\u0131lmad\u0131.", +search_title:"Axtar", +replace_title:"Axtar/D\u0259yi\u015F", +allreplaced:"B\u00FCt\u00FCn qar\u015F\u0131la\u015Fm\u0131\u015F s\u0259trl\u0259r d\u0259yi\u015Fdirildi.", +findwhat:"N\u0259 axtar\u0131ls\u0131n", +replacewith:"N\u0259y\u0259 d\u0259yi\u015Filsin", +direction:"\u0130stiqam\u0259tl\u0259ndirm\u0259", +up:"Yuxar\u0131", +down:"A\u015Fa\u011F\u0131", +mcase:"Registr\u0131 n\u0259z\u0259r\u0259 al", +findnext:"Sonrak\u0131n\u0131 axtar", +replace:"D\u0259yi\u015F", +replaceall:"Ham\u0131s\u0131n\u0131 d\u0259yi\u015F" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/be_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/be_dlg.js new file mode 100755 index 000000000..387eefc0a --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/be_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('be.searchreplace_dlg',{ +searchnext_desc:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456 \u0437\u043D\u043E\u045E", +notfound:"\u041F\u043E\u0448\u0443\u043A \u0441\u043A\u043E\u043D\u0447\u0430\u043D\u044B. \u0420\u0430\u0434\u043E\u043A \u043D\u0435 \u0437\u043D\u043E\u0439\u0434\u0437\u0435\u043D\u0430\u044F.", +search_title:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456", +replace_title:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456/\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C", +allreplaced:"\u0423\u0441\u0435 \u0441\u0443\u0441\u0442\u0440\u0430\u043A\u0430\u0435\u043C\u044B\u044F \u0440\u0430\u0434\u043A\u0456 \u0431\u044B\u043B\u0456 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u044B\u044F.", +findwhat:"\u0428\u0442\u043E \u0437\u043D\u0430\u0439\u0441\u0446\u0456", +replacewith:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C \u043D\u0430", +direction:"\u041A\u0456\u0440\u0443\u043D\u0430\u043A", +up:"\u0423\u0432\u0435\u0440\u0445", +down:"\u0423\u043D\u0456\u0437", +mcase:"\u0423\u043B\u0456\u0447\u0432\u0430\u0446\u044C \u0440\u044D\u0433\u0456\u0441\u0442\u0440", +findnext:"\u0417\u043D\u0430\u0439\u0441\u0446\u0456 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0443\u044E", +replace:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C", +replaceall:"\u0417\u0430\u043C\u044F\u043D\u0456\u0446\u044C \u0443\u0441\u0451" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/bg_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/bg_dlg.js new file mode 100755 index 000000000..7347d3340 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/bg_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('bg.searchreplace_dlg',{ +searchnext_desc:"\u0422\u044A\u0440\u0441\u0438 \u043E\u0442\u043D\u043E\u0432\u043E", +notfound:"\u0422\u044A\u0440\u0441\u0435\u043D\u0435\u0442\u043E \u0437\u0430\u0432\u044A\u0440\u0448\u0438. \u0422\u044A\u0440\u0441\u0435\u043D\u0438\u0442\u0435 \u0434\u0443\u043C\u0438 \u043D\u0435 \u0431\u044F\u0445\u0430 \u043E\u0442\u043A\u0440\u0438\u0442\u0438.", +search_title:"\u0422\u044A\u0440\u0441\u0438", +replace_title:"\u0422\u044A\u0440\u0441\u0438/\u0417\u0430\u043C\u0435\u0441\u0442\u0438", +allreplaced:"\u0412\u0441\u0438\u0447\u043A\u0438 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u0438 \u0434\u0443\u043C\u0438 \u0431\u044F\u0445\u0430 \u0437\u0430\u043C\u0435\u0441\u0442\u0435\u043D\u0438.", +findwhat:"\u0422\u044A\u0440\u0441\u0438", +replacewith:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438 \u0441", +direction:"\u041F\u043E\u0441\u043E\u043A\u0430", +up:"\u041D\u0430\u0433\u043E\u0440\u0435", +down:"\u041D\u0430\u0434\u043E\u043B\u0443", +mcase:"\u0421\u044A\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0435 \u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u044A\u0440\u0430", +findnext:"\u0422\u044A\u0440\u0441\u0438 \u0441\u043B\u0435\u0434\u0432\u0430\u0449\u0438", +replace:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438", +replaceall:"\u0417\u0430\u043C\u0435\u0441\u0442\u0438 \u0432\u0441\u0438\u0447\u043A\u0438" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/bn_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/bn_dlg.js new file mode 100755 index 000000000..4fe802094 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/bn_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('bn.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/br_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/br_dlg.js new file mode 100755 index 000000000..22b8d322c --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/br_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('br.searchreplace_dlg',{ +searchnext_desc:"Localizar novamente", +notfound:"A pesquisa foi conclu\u00EDda sem resultados.", +search_title:"Localizar", +replace_title:"Localizar/substituir", +allreplaced:"Todas as substitui\u00E7\u00F5es foram efetuadas.", +findwhat:"Localizar", +replacewith:"Substituir com", +direction:"Dire\u00E7\u00E3o", +up:"Acima", +down:"Abaixo", +mcase:"Diferenciar mai\u00FAsculas/min\u00FAsculas", +findnext:"Localizar pr\u00F3ximo", +replace:"Substituir", +replaceall:"Substituir todos" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/bs_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/bs_dlg.js new file mode 100755 index 000000000..72f08cf95 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/bs_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('bs.searchreplace_dlg',{ +searchnext_desc:"Prona\u0111i opet", +notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", +search_title:"Prona\u0111i", +replace_title:"Prona\u0111i/Zamijeni", +allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamijenjena.", +findwhat:"Prona\u0111i tekst", +replacewith:"Zamijeni sa", +direction:"Smjer", +up:"Gore", +down:"Dolje", +mcase:"Match case", +findnext:"Prona\u0111i sljede\u0107e", +replace:"Zamijeni", +replaceall:"Zamijeni sve" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ca_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ca_dlg.js new file mode 100755 index 000000000..e634ccd08 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ca_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ca.searchreplace_dlg',{ +searchnext_desc:"Cerca de nou", +notfound:"S\'ha completat la cerca. No s\'ha trobat la cadena cercada.", +search_title:"Cerca", +replace_title:"Cerca/Reempla\u00E7a", +allreplaced:"S\'han reempla\u00E7at totes les ocurr\u00E8ncies de la cadena cercada.", +findwhat:"Cerca", +replacewith:"Reempla\u00E7a amb", +direction:"Direcci\u00F3", +up:"Amunt", +down:"Avall", +mcase:"Distingeix maj\u00FAscules/min\u00FAscules", +findnext:"Seg\u00FCent", +replace:"Reempla\u00E7a", +replaceall:"Reempla\u00E7a-ho tot" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ch_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ch_dlg.js new file mode 100755 index 000000000..089d18783 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ch_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ch.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u67E5\u627E", +notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002", +search_title:"\u67E5\u627E", +replace_title:"\u67E5\u627E/\u66FF\u6362", +allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", +findwhat:"\u67E5\u627E\u76EE\u6807", +replacewith:"\u66FF\u6362\u4E3A", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5927\u5C0F\u5199\u5339\u914D", +findnext:"\u4E0B\u4E00\u4E2A", +replace:"\u66FF\u6362", +replaceall:"\u66FF\u6362\u5168\u90E8" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/cs_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/cs_dlg.js new file mode 100755 index 000000000..a1928789a --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/cs_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('cs.searchreplace_dlg',{ +searchnext_desc:"Naj\u00EDt dal\u0161\u00ED", +notfound:"Hled\u00E1n\u00ED bylo dokon\u010Deno. Hledan\u00FD text nebyl nalezen.", +search_title:"Naj\u00EDt", +replace_title:"Naj\u00EDt/nahradit", +allreplaced:"V\u0161echny v\u00FDskyty byly nahrazeny.", +findwhat:"Co hledat", +replacewith:"\u010C\u00EDm nahradit", +direction:"Sm\u011Br", +up:"Nahoru", +down:"Dol\u016F", +mcase:"Rozli\u0161ovat velikost", +findnext:"Naj\u00EDt dal\u0161\u00ED", +replace:"Nahradit", +replaceall:"Nahradit v\u0161e" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/cy_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/cy_dlg.js new file mode 100755 index 000000000..fe959246e --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/cy_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('cy.searchreplace_dlg',{ +searchnext_desc:"Canfod eto", +notfound:"Mae'r chwiliad wedi cwblhau. Methu canfod y llinyn chwiliad.", +search_title:"Canfod", +replace_title:"Canfod/Amnewid", +allreplaced:"Amnewidwyd pob digwyddiad o'r llinyn chwiliad.", +findwhat:"Canfod beth", +replacewith:"Adnewid gyda", +direction:"Cyfeiriad", +up:"I fyny", +down:"I lawr", +mcase:"Cydweddu priflythrennedd", +findnext:"Canfod nesaf", +replace:"Amnewid", +replaceall:"Amnewid pob un" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/da_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/da_dlg.js new file mode 100755 index 000000000..9c49354df --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/da_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('da.searchreplace_dlg',{ +searchnext_desc:"S\u00F8g igen", +notfound:"S\u00F8gningen gav intet resultat.", +search_title:"S\u00F8g", +replace_title:"S\u00F8g / erstat", +allreplaced:"Alle forekomster af s\u00F8gestrengen er erstattet.", +findwhat:"S\u00F8g efter", +replacewith:"Erstat med", +direction:"Retning", +up:"Op", +down:"Ned", +mcase:"Forskel p\u00E5 store og sm\u00E5 bogstaver", +findnext:"Find n\u00E6ste", +replace:"Erstat", +replaceall:"Erstat alle" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/de_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/de_dlg.js new file mode 100755 index 000000000..52c0b0625 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{ +searchnext_desc:"Weitersuchen", +notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.", +search_title:"Suchen", +replace_title:"Suchen/Ersetzen", +allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.", +findwhat:"Zu suchender Text", +replacewith:"Ersetzen durch", +direction:"Suchrichtung", +up:"Aufw\u00E4rts", +down:"Abw\u00E4rts", +mcase:"Gro\u00DF-/Kleinschreibung beachten", +findnext:"Weitersuchen", +replace:"Ersetzen", +replaceall:"Alle ersetzen" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/dv_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/dv_dlg.js new file mode 100755 index 000000000..4c88a5458 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/dv_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('dv.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/el_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/el_dlg.js new file mode 100755 index 000000000..6ece85fcc --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/el_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('el.searchreplace_dlg',{ +searchnext_desc:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7 \u03BE\u03B1\u03BD\u03AC", +notfound:"\u0397 \u03B1\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7 \u03C4\u03B5\u03BB\u03B5\u03AF\u03C9\u03C3\u03B5. \u03A4\u03BF \u03B6\u03B7\u03C4\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF \u03BA\u03B5\u03AF\u03BC\u03B5\u03BD\u03BF \u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5.", +search_title:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7", +replace_title:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7/\u0391\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7", +allreplaced:"\u038C\u03BB\u03B5\u03C2 \u03BF\u03B9 \u03B5\u03BC\u03C6\u03B1\u03BD\u03AF\u03C3\u03B5\u03B9\u03C2 \u03C4\u03BF\u03C5 \u03B6\u03B7\u03C4\u03BF\u03CD\u03BC\u03B5\u03BD\u03BF\u03C5 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 \u03B1\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03B1\u03C3\u03C4\u03AC\u03B8\u03B7\u03BA\u03B1\u03BD.", +findwhat:"\u0395\u03CD\u03C1\u03B5\u03C3\u03B7 \u03C4\u03BF\u03C5", +replacewith:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7 \u03BC\u03B5", +direction:"\u039A\u03B1\u03C4\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7", +up:"\u03A0\u03AC\u03BD\u03C9", +down:"\u039A\u03AC\u03C4\u03C9", +mcase:"\u03A4\u03B1\u03AF\u03C1\u03B9\u03B1\u03C3\u03BC\u03B1 \u03BA\u03B5\u03C6\u03B1\u03BB\u03B1\u03AF\u03B1/\u03BC\u03B9\u03BA\u03C1\u03AC", +findnext:"\u0392\u03C1\u03B5\u03C2 \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03BF", +replace:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4\u03AC\u03C3\u03C4\u03B1\u03C3\u03B7", +replaceall:"\u0391\u03BD\u03C4\u03B9\u03BA\u03B1\u03C4. \u03CC\u03BB\u03C9\u03BD" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100755 index 000000000..370959afa --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/es_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/es_dlg.js new file mode 100755 index 000000000..b54c74bb2 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/es_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('es.searchreplace_dlg',{ +searchnext_desc:"Buscar de nuevo", +notfound:"La b\u00FAsqueda se ha completado. No se encontr\u00F3 el texto introducido.", +search_title:"Buscar", +replace_title:"Buscar/Reemplazar", +allreplaced:"Se ha reemplazado el texto.", +findwhat:"Qu\u00E9 buscar", +replacewith:"Reemplazar por", +direction:"Direcci\u00F3n", +up:"Arriba", +down:"Abajo", +mcase:"Min\u00FAs./May\u00FAs.", +findnext:"Buscar siguiente", +replace:"Reemplazar", +replaceall:"Reemplazar todo" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/et_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/et_dlg.js new file mode 100755 index 000000000..fcafedd78 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/et_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('et.searchreplace_dlg',{ +searchnext_desc:"Otsi uuesti", +notfound:"Otsing on l\u00F5petatud. Otsis\u00F5na ei leitud.", +search_title:"Otsi", +replace_title:"Otsi/Asenda", +allreplaced:"K\u00F5ik otsis\u00F5na ilmingud on asendatud.", +findwhat:"Otsi mida", +replacewith:"Asenda millega", +direction:"Suund", +up:"\u00DCles", +down:"Alla", +mcase:"Vasta suurusele", +findnext:"Otsi j\u00E4rgmine", +replace:"Asenda", +replaceall:"Asenda k\u00F5ik" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/eu_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/eu_dlg.js new file mode 100755 index 000000000..769f5f8de --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/eu_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('eu.searchreplace_dlg',{ +searchnext_desc:"Berriz bilatu", +notfound:"Bilaketa bukatu da. Bilatutakoa ez da aurkitu.", +search_title:"Bilatu", +replace_title:"Bilatu/Ordezkatu", +allreplaced:"Bilatutakoaren agerpen guztiak ordezkatu dira.", +findwhat:"Zer bilatu", +replacewith:"Zerekin ordezkatu", +direction:"Norabidea", +up:"Gorantz", +down:"Beherantz", +mcase:"Maiuskulak eta minuskulak kontuan hartu", +findnext:"Hurrengoa", +replace:"Ordezkatu", +replaceall:"Ordezkatu guztiak" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/fa_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/fa_dlg.js new file mode 100755 index 000000000..cc0ea9abb --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/fa_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('fa.searchreplace_dlg',{ +searchnext_desc:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0645\u062C\u062F\u062F", +notfound:"\u062C\u0633\u062A\u062C\u0648 \u06A9\u0627\u0645\u0644 \u0634\u062F. \u06A9\u0644\u0645\u0647 \u062C\u0633\u062A\u062C\u0648 \u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F", +search_title:"\u062C\u0633\u062A\u062C\u0648", +replace_title:"\u062C\u0633\u062A\u062C\u0648/\u062A\u0639\u0648\u06CC\u0636", +allreplaced:"\u062A\u0645\u0627\u0645\u06CC \u06A9\u0644\u0645\u0627\u062A \u06CC\u0627\u0641\u062A \u0634\u062F\u0647 \u062A\u063A\u06CC\u06CC\u0631 \u06CC\u0627\u0641\u062A\u0646\u062F", +findwhat:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0686\u0647 \u0686\u06CC\u0632\u06CC", +replacewith:"\u062A\u0639\u0648\u06CC\u0636 \u0628\u0627", +direction:"\u062C\u0647\u062A", +up:"\u0628\u0627\u0644\u0627", +down:"\u067E\u0627\u06CC\u06CC\u0646", +mcase:"\u0647\u0645\u0633\u0627\u0646 \u0628\u0648\u062F\u0646 \u062D\u0631\u0648\u0641", +findnext:"\u062C\u0633\u062A\u062C\u0648\u06CC \u0628\u0639\u062F\u06CC", +replace:"\u062A\u0639\u0648\u06CC\u0636", +replaceall:"\u062A\u0639\u0648\u06CC\u0636 \u0647\u0645\u0647" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/fi_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/fi_dlg.js new file mode 100755 index 000000000..370125048 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/fi_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('fi.searchreplace_dlg',{ +searchnext_desc:"Etsi uudestaan", +notfound:"Haku on valmis. Haettua teksti\u00E4 ei l\u00F6ytynyt.", +search_title:"Haku", +replace_title:"Etsi ja korvaa", +allreplaced:"Kaikki l\u00F6ydetyt merkkijonot korvattiin.", +findwhat:"Etsit\u00E4\u00E4n", +replacewith:"Korvataan", +direction:"Suunta", +up:"Yl\u00F6s", +down:"Alas", +mcase:"Huomioi isot ja pienet kirjaimet", +findnext:"Etsi seuraavaa", +replace:"Korvaa", +replaceall:"Korvaa kaikki" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/fr_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/fr_dlg.js new file mode 100755 index 000000000..a151c6c39 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/fr_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('fr.searchreplace_dlg',{ +searchnext_desc:"Suivant", +notfound:"La recherche est termin\u00E9e. La cha\u00EEne recherch\u00E9e n'a pas \u00E9t\u00E9 trouv\u00E9e.", +search_title:"Rechercher", +replace_title:"Rechercher / remplacer", +allreplaced:"Toutes les occurrences de la cha\u00EEne recherch\u00E9e ont \u00E9t\u00E9 remplac\u00E9es.", +findwhat:"Rechercher ceci", +replacewith:"Remplacer par", +direction:"Direction", +up:"Vers le haut", +down:"Vers le bas", +mcase:"Sensible \u00E0 la casse", +findnext:"Rechercher le suivant", +replace:"Remplacer", +replaceall:"Tout remplacer" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/gl_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/gl_dlg.js new file mode 100755 index 000000000..fefcd0802 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/gl_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('gl.searchreplace_dlg',{ +searchnext_desc:"Buscar outra vez", +notfound:"A busca rematou. No se atopou o texto buscado.", +search_title:"Buscar", +replace_title:"Buscar/Reemplazar", +allreplaced:"T\u00F3da-las coincidencias do texto buscado foron reemplazadas.", +findwhat:"Localizar", +replacewith:"Reemplazar por", +direction:"Direcci\u00F3n", +up:"Arriba", +down:"Abaixo", +mcase:"Min\u00FAs./Mai\u00FAs.", +findnext:"Buscar seginte", +replace:"Reemplazar", +replaceall:"Reemplazar todo" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/gu_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/gu_dlg.js new file mode 100755 index 000000000..cdbeed131 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/gu_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('gu.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/he_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/he_dlg.js new file mode 100755 index 000000000..475ee8483 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/he_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('he.searchreplace_dlg',{ +searchnext_desc:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05D1\u05D0", +notfound:"\u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05E1\u05EA\u05D9\u05D9\u05DD. \u05E4\u05E8\u05D9\u05D8 \u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0.", +search_title:"\u05D7\u05D9\u05E4\u05D5\u05E9", +replace_title:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D5\u05D4\u05D7\u05DC\u05E4\u05D4", +allreplaced:"\u05DB\u05DC \u05E4\u05E8\u05D9\u05D8\u05D9 \u05D4\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D4\u05D5\u05D7\u05DC\u05E4\u05D5", +findwhat:"\u05DC\u05D7\u05E4\u05E9 \u05D0\u05EA", +replacewith:"\u05DC\u05D4\u05D7\u05DC\u05D9\u05E3 \u05D1", +direction:"\u05DB\u05D9\u05D5\u05D5\u05DF", +up:"\u05DC\u05DE\u05E2\u05DC\u05D4", +down:"\u05DC\u05DE\u05D8\u05D4", +mcase:"\u05D4\u05EA\u05D0\u05DD \u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05E8\u05D9\u05E9\u05D9\u05D5\u05EA", +findnext:"\u05D7\u05E4\u05E9 \u05D0\u05EA \u05D4\u05D1\u05D0", +replace:"\u05D4\u05D7\u05DC\u05E4\u05D4", +replaceall:"\u05D4\u05D7\u05DC\u05E4\u05EA \u05D4\u05DB\u05DC" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/hi_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/hi_dlg.js new file mode 100755 index 000000000..c5687c2b2 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/hi_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('hi.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/hr_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/hr_dlg.js new file mode 100755 index 000000000..ad95bfc67 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/hr_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('hr.searchreplace_dlg',{ +searchnext_desc:"Prona\u0111i opet", +notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", +search_title:"Prona\u0111i", +replace_title:"Prona\u0111i/Zamijeni", +allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamijenjena.", +findwhat:"Prona\u0111i tekst", +replacewith:"Zamijeni sa", +direction:"Smjer", +up:"Gore", +down:"Dolje", +mcase:"Match case", +findnext:"Prona\u0111i sljede\u0107e", +replace:"Zamijeni", +replaceall:"Zamijeni sve" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/hu_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/hu_dlg.js new file mode 100755 index 000000000..7c6dee711 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/hu_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('hu.searchreplace_dlg',{ +searchnext_desc:"Keres\u00E9s megint", +notfound:"A keres\u00E9s v\u00E9get \u00E9rt. A keresett sz\u00F6vegr\u00E9sz nem tal\u00E1lhat\u00F3.", +search_title:"Keres\u00E9s", +replace_title:"Keres\u00E9s/Csere", +allreplaced:"A keresett r\u00E9szsz\u00F6veg minden el\u0151fordul\u00E1sa cser\u00E9lve lett.", +findwhat:"Mit cser\u00E9l", +replacewith:"Mire cser\u00E9l", +direction:"Ir\u00E1ny", +up:"Fel", +down:"Le", +mcase:"Kis- \u00E9s nagybet\u0171k megk\u00FCl\u00F6nb\u00F6ztet\u00E9se", +findnext:"Keres\u00E9s", +replace:"Csere", +replaceall:"Minden tal\u00E1lat cser\u00E9je" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/hy_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/hy_dlg.js new file mode 100755 index 000000000..6dd8034f3 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/hy_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('hy.searchreplace_dlg',{ +searchnext_desc:"\u0546\u0578\u0580\u056B\u0581 \u0578\u0580\u0578\u0576\u0565\u056C", +notfound:"\u0548\u0580\u0578\u0576\u0578\u0582\u0574\u0568 \u0561\u057E\u0561\u0580\u057F\u057E\u0565\u0581\u0589 \u0548\u0579\u056B\u0576\u0579 \u0579\u056B \u0563\u057F\u0576\u057E\u0565\u056C", +search_title:"\u0548\u0580\u0578\u0576\u0565\u056C", +replace_title:"\u0548\u0580\u0578\u0576\u0565\u056C / \u0553\u0578\u0583\u0578\u056D\u0565\u056C", +allreplaced:"\u0532\u0578\u056C\u0578\u0580 \u0563\u057F\u0576\u057E\u0561\u056E\u0576\u0565\u0580\u0568 \u0583\u0578\u0583\u0578\u056D\u057E\u0565\u0581\u056B\u0576", +findwhat:"\u0548\u0580\u0578\u0576\u0565\u056C", +replacewith:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C", +direction:"\u0548\u0582\u0572\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576", +up:"\u054E\u0565\u0580\u0587 ", +down:"\u0546\u0565\u0580\u0584\u0587", +mcase:"\u0540\u0561\u0577\u057E\u056B \u0561\u057C\u0576\u0565\u056C \u057C\u0565\u0563\u056B\u057D\u057F\u0578\u0580\u0568", +findnext:"\u0533\u057F\u0576\u0565\u056C \u0570\u0561\u057B\u0578\u0580\u0564\u0568", +replace:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C", +replaceall:"\u0553\u0578\u0583\u0578\u056D\u0565\u056C \u0562\u0561\u056C\u0578\u0580\u0568" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ia_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ia_dlg.js new file mode 100755 index 000000000..4a9bad642 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ia_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ia.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u67E5\u627E", +notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210 ! \u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002 ", +search_title:"\u67E5\u627E", +replace_title:"\u67E5\u627E/\u66FF\u6362", +allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u5B57\u7B26\u4E32.", +findwhat:"\u67E5\u627E\u76EE\u6807", +replacewith:"\u66FF\u6362\u4E3A", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u533A\u5206\u5927\u5C0F\u5199", +findnext:"\u67E5\u627E\u4E0B\u4E00\u4E2A", +replace:"\u66FF\u6362", +replaceall:"\u5168\u90E8\u66FF\u6362" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/id_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/id_dlg.js new file mode 100755 index 000000000..cd4de4296 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/id_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('id.searchreplace_dlg',{ +searchnext_desc:"Cari Lagi", +notfound:"Pencarian selesai. Hasil tidak ditemukan.", +search_title:"Cari", +replace_title:"Cari/Ganti", +allreplaced:"Seluruh kata dari string pencarian telah digantikan", +findwhat:"Cari apa...", +replacewith:"Ganti dengan...", +direction:"Arah", +up:"Atas", +down:"Bawah", +mcase:"Match case", +findnext:"Cari selanjutnya", +replace:"Ganti", +replaceall:"Ganti semua" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ii_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ii_dlg.js new file mode 100755 index 000000000..ccc66243d --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ii_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ii.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u67E5\u627E", +notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002", +search_title:"\u67E5\u627E", +replace_title:"\u67E5\u627E/\u66FF\u6362", +allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", +findwhat:"\u67E5\u627E\u76EE\u6807", +replacewith:"\u66FF\u6362\u4E3A", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5927\u5C0F\u5199\u5339\u914D", +findnext:"\u4E0B\u4E00\u4E2A", +replace:"\u66FF\u6362", +replaceall:"\u66FF\u6362\u5168\u90E8" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/is_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/is_dlg.js new file mode 100755 index 000000000..70a527d89 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/is_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('is.searchreplace_dlg',{ +searchnext_desc:"Finna aftur", +notfound:"Leitinni er loki\u00F0. Leitarstrengurinn fannst ekki.", +search_title:"Finna", +replace_title:"Finna/Skipta \u00FAt", +allreplaced:"\u00D6llum ni\u00F0urst\u00F6\u00F0um leitar var skipt \u00FAt.", +findwhat:"Finna hva\u00F0", +replacewith:"Skipta \u00FAt me\u00F0", +direction:"\u00C1tt", +up:"Upp", +down:"Ni\u00F0ur", +mcase:"Match case", +findnext:"Finna n\u00E6sta", +replace:"Skipta \u00FAt", +replaceall:"Skipta \u00FAt \u00F6llu" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/it_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/it_dlg.js new file mode 100755 index 000000000..cbaf13ab2 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/it_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('it.searchreplace_dlg',{ +searchnext_desc:"Trova successivo", +notfound:"Ricerca completata. Nessun risultato trovato.", +search_title:"Trova", +replace_title:"Trova/Sostituisci", +allreplaced:"Tutte le occorrenze del criterio di ricerca sono state sostituite.", +findwhat:"Trova:", +replacewith:"Sostituisci con:", +direction:"Direzione", +up:"Avanti", +down:"Indietro", +mcase:"Maiuscole/minuscole", +findnext:"Trova succ.", +replace:"Sostituisci", +replaceall:"Sost. tutto" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ja_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ja_dlg.js new file mode 100755 index 000000000..926a6766b --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ja_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ja.searchreplace_dlg',{ +searchnext_desc:"\u518D\u691C\u7D22", +notfound:"\u6700\u5F8C\u307E\u3067\u691C\u7D22\u3057\u307E\u3057\u305F\u304C\u3001\u691C\u7D22\u6587\u5B57\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002", +search_title:"\u691C\u7D22", +replace_title:"\u691C\u7D22/\u7F6E\u63DB", +allreplaced:"\u5168\u3066\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\u3002", +findwhat:"\u691C\u7D22\u6587\u5B57\u5217", +replacewith:"\u7F6E\u63DB\u6587\u5B57\u5217", +direction:"\u65B9\u5411", +up:"\u4E0A\u3078", +down:"\u4E0B\u3078", +mcase:"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57\u3092\u533A\u5225\u3059\u308B", +findnext:"\u6B21\u3078", +replace:"\u7F6E\u63DB", +replaceall:"\u5168\u3066\u7F6E\u63DB" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ka_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ka_dlg.js new file mode 100755 index 000000000..d4b7db3a6 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ka_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ka.searchreplace_dlg',{ +searchnext_desc:"\u10D3\u10D0\u10DB\u10D0\u10E2\u10D4\u10D1\u10D8\u10D7 \u10DE\u10DD\u10D5\u10DC\u10D0", +notfound:"\u10EB\u10D4\u10D1\u10DC\u10D0 \u10D3\u10D0\u10E1\u10E0\u10E3\u10DA\u10D4\u10D1\u10E3\u10DA\u10D8\u10D0. \u10E8\u10D4\u10E1\u10D0\u10E2\u10E7\u10D5\u10D8\u10E1\u10D1\u10D8 \u10D0\u10E0 \u10D0\u10E0\u10D8\u10E1 \u10DC\u10D0\u10DE\u10DD\u10D5\u10DC\u10D8.", +search_title:"\u10EB\u10D8\u10D4\u10D1\u10D0", +replace_title:"\u10DB\u10DD\u10EB\u10D4\u10D1\u10DC\u10D0 \u10D3\u10D0 \u10E8\u10D4\u10EA\u10D5\u10DA\u10D0", +allreplaced:"\u10E7\u10D5\u10D4\u10DA\u10D0 \u10DB\u10DC\u10D8\u10E8\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 \u10E8\u10D4\u10EA\u10D5\u10DA\u10D8\u10DA\u10D8\u10D0.", +findwhat:"\u10EB\u10D4\u10D5\u10DC\u10D0", +replacewith:"\u10E8\u10D4\u10EA\u10D5\u10DA\u10D0 ..", +direction:"\u10DB\u10D8\u10DB\u10D0\u10E0\u10D7\u10E3\u10DA\u10D4\u10D1\u10D0", +up:"\u10D6\u10D4\u10DB\u10DD\u10D7 ", +down:"\u10E5\u10D5\u10D4\u10DB\u10DD\u10D7", +mcase:"\u10E0\u10D4\u10D2\u10D8\u10E1\u10E2\u10E0\u10D8\u10E1 \u10D2\u10D0\u10D7\u10D5\u10D0\u10DA\u10D8\u10E1\u10EC\u10D8\u10DC\u10D4\u10D1\u10D0", +findnext:"\u10D8\u10DE\u10DD\u10D5\u10DC\u10D4 \u10E8\u10D4\u10DB\u10D3\u10D4\u10D2", +replace:"\u10E8\u10D4\u10EA\u10D5\u10DA\u10D0", +replaceall:"\u10E7\u10D5\u10D4\u10DA\u10D0\u10E4\u10D4\u10E0\u10D8\u10E1 \u10E8\u10D4\u10EA\u10D5\u10DA\u10D0" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/kl_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/kl_dlg.js new file mode 100755 index 000000000..50268b318 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/kl_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('kl.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ko_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ko_dlg.js new file mode 100755 index 000000000..d559f6bd3 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ko_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ko.searchreplace_dlg',{ +searchnext_desc:"\uC7AC\uAC80\uC0C9", +notfound:"\uAC80\uC0C9\uC774 \uC644\uB8CC\uD588\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9 \uBB38\uC790\uC5F4\uC740 \uBC1C\uACAC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.", +search_title:"\uAC80\uC0C9", +replace_title:"\uAC80\uC0C9/\uCE58\uD658", +allreplaced:"\uBAA8\uB450 \uCE58\uD658\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", +findwhat:"\uAC80\uC0C9 \uBB38\uC790\uC5F4", +replacewith:"\uCE58\uD658 \uBB38\uC790\uC5F4", +direction:"\uBC29\uD5A5", +up:"\uC704\uC5D0", +down:"\uC544\uB798\uC5D0", +mcase:"\uB300\uBB38\uC790/\uC18C\uBB38\uC790\uB97C \uAD6C\uBCC4", +findnext:"\uAC80\uC0C9", +replace:"\uCE58\uD658", +replaceall:"\uBAA8\uB450 \uCE58\uD658" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/lb_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/lb_dlg.js new file mode 100755 index 000000000..0267ceae4 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/lb_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('lb.searchreplace_dlg',{ +searchnext_desc:"Weidersichen", +notfound:"D'Sich ass um Enn ukomm. D'Zeechekette konnt net fonnt ginn.", +search_title:"Sichen", +replace_title:"Sichen/Ersetzen", +allreplaced:"All d'Virkomme vun der Zeechekette goufen ersat.", +findwhat:"Ze sichenden Text", +replacewith:"Ersetzen duerch", +direction:"Sichrichtung", +up:"No uewen", +down:"No \u00EBnnen", +mcase:"Grouss-/Klengschreiwung beuechten", +findnext:"Weidersichen", +replace:"Ersetzen", +replaceall:"All ersetzen" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/lt_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/lt_dlg.js new file mode 100755 index 000000000..88a807e57 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/lt_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('lt.searchreplace_dlg',{ +searchnext_desc:"Ie\u0161koti dar kart\u0105", +notfound:"Paie\u0161ka baigta. Paie\u0161kos fraz\u0117 nerasta.", +search_title:"Ie\u0161koti", +replace_title:"Ie\u0161koti/Pakeisti", +allreplaced:"Visi paie\u0161kos fraz\u0117s pasikartojimai pakeisti.", +findwhat:"Ko ie\u0161koti", +replacewith:"Kuo pakeisti", +direction:"Kryptis", +up:"\u012E vir\u0161\u0173", +down:"\u012E apa\u010Di\u0105", +mcase:"Visi\u0161kas atitikimas", +findnext:"Ie\u0161koti sek.", +replace:"Pakeisti", +replaceall:"Pakeisti visus" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/lv_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/lv_dlg.js new file mode 100755 index 000000000..e947d21a0 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/lv_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('lv.searchreplace_dlg',{ +searchnext_desc:"Mekl\u0113t v\u0113lreiz", +notfound:"Mekl\u0113\u0161ana pabeigta. Mekl\u0113t\u0101 fr\u0101ze/v\u0101rds netika atrasta.", +search_title:"Mekl\u0113t", +replace_title:"Mekl\u0113t/Aizvietot", +allreplaced:"Visas fr\u0101zes/v\u0101rdi tika veiksm\u012Bgi aizvietoti.", +findwhat:"Ko atrast", +replacewith:"Aizvietot ar", +direction:"Virziens", +up:"Uz aug\u0161u", +down:"Uz leju", +mcase:"Re\u0123istrj\u016Bt\u012Bgs", +findnext:"Mekl\u0113t n\u0101kamo", +replace:"Aizvietot", +replaceall:"Aizvietot visu" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/mk_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/mk_dlg.js new file mode 100755 index 000000000..d7d531fda --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/mk_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('mk.searchreplace_dlg',{ +searchnext_desc:"Prona\u0111i opet", +notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", +search_title:"Prona\u0111i", +replace_title:"Prona\u0111i/Zameni", +allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamenjena.", +findwhat:"Prona\u0111i tekst", +replacewith:"Zameni sa", +direction:"Smjer", +up:"Gore", +down:"Dolje", +mcase:"Match case", +findnext:"Prona\u0111i sljede\u0107e", +replace:"Zameni", +replaceall:"Zameni sve" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ml_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ml_dlg.js new file mode 100755 index 000000000..6960ae981 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ml_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ml.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/mn_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/mn_dlg.js new file mode 100755 index 000000000..07b8fc39d --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/mn_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('mn.searchreplace_dlg',{ +searchnext_desc:"\u0426\u0430\u0430\u0448 \u0445\u0430\u0439\u0445", +notfound:"\u0425\u0430\u0439\u043B\u0442 \u0442\u04E9\u0433\u0441\u0433\u04E9\u043B\u0434 \u0445\u04AF\u0440\u044D\u0432. \u0422\u044D\u043C\u0434\u044D\u0433\u0442 \u043C\u04E9\u0440 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.", +search_title:"\u0425\u0430\u0439\u0445", +replace_title:"\u0425\u0430\u0439\u0445/\u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0445", +allreplaced:"\u0422\u044D\u043C\u0434\u044D\u0433\u0442 \u043C\u04E9\u0440\u0438\u0439\u043D \u0431\u04AF\u0445 \u0442\u043E\u0445\u0438\u043E\u043B\u0434\u043B\u0443\u0443\u0434 \u043E\u0440\u043B\u0443\u0443\u043B\u0430\u0433\u0434\u0441\u0430\u043D.", +findwhat:"\u0425\u0430\u0439\u0445 \u0431\u0438\u0447\u0432\u044D\u0440", +replacewith:"\u041E\u0440\u043B\u0443\u0443\u043B\u0430\u0433\u0430", +direction:"\u0425\u0430\u0439\u0445 \u0447\u0438\u0433\u043B\u044D\u043B", +up:"\u0413\u044D\u0434\u0440\u044D\u0433", +down:"\u0426\u0430\u0430\u0448", +mcase:"\u0422\u043E\u043C/\u0416\u0438\u0436\u0438\u0433 \u0431\u0438\u0447\u0438\u043B\u0442 \u044F\u043B\u0433\u0430\u0445", +findnext:"\u0426\u0430\u0430\u0448 \u0445\u0430\u0439\u0445", +replace:"\u041E\u0440\u043B\u0443\u0443\u043B", +replaceall:"\u0411\u04AF\u0433\u0434\u0438\u0439\u0433 \u043E\u0440\u043B\u0443\u0443\u043B" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ms_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ms_dlg.js new file mode 100755 index 000000000..bd52c34ed --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ms_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ms.searchreplace_dlg',{ +searchnext_desc:"Cari lagi", +notfound:"Carian tamat. Perkataan yang dicari tiada.", +search_title:"Cari", +replace_title:"Cari/Ganti", +allreplaced:"Kesemua perkataan telah digantikan.", +findwhat:"Cari apa", +replacewith:"Ganti dengan", +direction:"Arah", +up:"Atas", +down:"Bawah", +mcase:"Samakan kes", +findnext:"Carian seterusnya", +replace:"Ganti", +replaceall:"Ganti kesemuanya" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/nb_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/nb_dlg.js new file mode 100755 index 000000000..670df521d --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/nb_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('nb.searchreplace_dlg',{ +searchnext_desc:"S\u00F8k igjen", +notfound:"S\u00F8ket er avsluttet. Fant ikke s\u00F8kestrengen.", +search_title:"S\u00F8k", +replace_title:"S\u00F8k/Erstatt", +allreplaced:"Alle forekomster av s\u00F8kestrengen er erstattet.", +findwhat:"Finn hva", +replacewith:"Erstatt med", +direction:"Retning", +up:"Oppover", +down:"Nedover", +mcase:"Skill mellom store og sm\u00E5 tegn", +findnext:"Finn neste", +replace:"Erstatt", +replaceall:"Erstatt alt" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/nl_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/nl_dlg.js new file mode 100755 index 000000000..6ad59dbfe --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/nl_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('nl.searchreplace_dlg',{ +searchnext_desc:"Opnieuw zoeken", +notfound:"Het doorzoeken is voltooid. De zoekterm kon niet meer worden gevonden.", +search_title:"Zoeken", +replace_title:"Zoeken/Vervangen", +allreplaced:"Alle instanties van de zoekterm zijn vervangen.", +findwhat:"Zoeken naar", +replacewith:"Vervangen door", +direction:"Richting", +up:"Omhoog", +down:"Omlaag", +mcase:"Identieke hoofdletters/kleine letters", +findnext:"Zoeken", +replace:"Vervangen", +replaceall:"Alles verv." +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/nn_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/nn_dlg.js new file mode 100755 index 000000000..3bb232d3f --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/nn_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('nn.searchreplace_dlg',{ +searchnext_desc:"S\u00F8k igjen", +notfound:"S\u00F8ket avslutta. Fann ikkje s\u00F8kjestrengen.", +search_title:"S\u00F8k", +replace_title:"S\u00F8k/Erstatt", +allreplaced:"Alle f\u00F8rekomstar av s\u00F8kjestrengen er erstatta.", +findwhat:"Finn kva", +replacewith:"Erstatt med", +direction:"Retning", +up:"Oppover", +down:"Nedover", +mcase:"Skill mellom store og sm\u00E5 teikn", +findnext:"Finn neste", +replace:"Erstatt", +replaceall:"Erstatt alt" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/no_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/no_dlg.js new file mode 100755 index 000000000..c958a3370 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/no_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('no.searchreplace_dlg',{ +searchnext_desc:"S\u00F8k igjen", +notfound:"S\u00F8ket avsluttet. Fant ikke s\u00F8kestrengen.", +search_title:"S\u00F8k", +replace_title:"S\u00F8k/Erstatt", +allreplaced:"Alle forekomster av s\u00F8kestrengen er erstattet.", +findwhat:"Finn hva", +replacewith:"Erstatt med", +direction:"Retning", +up:"Oppover", +down:"Nedover", +mcase:"Skille mellom store og sm\u00E5 bokstaver", +findnext:"Finn neste", +replace:"Erstatt", +replaceall:"Erstatt alle" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/pl_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/pl_dlg.js new file mode 100755 index 000000000..f220fc221 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/pl_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('pl.searchreplace_dlg',{ +searchnext_desc:"Znajd\u017A ponownie", +notfound:"Wyszukiwanie zako\u0144czone. Poszukiwany fragment nie zosta\u0142 znaleziony.", +search_title:"Znajd\u017A", +replace_title:"Znajd\u017A/Zamie\u0144", +allreplaced:"Wszystkie wyst\u0105pienia szukanego fragmentu zosta\u0142y zast\u0105pione.", +findwhat:"Znajd\u017A...", +replacewith:"Zamie\u0144 z...", +direction:"Kierunek", +up:"W g\u00F3r\u0119", +down:"W d\u00F3\u0142", +mcase:"Dopasuj wielko\u015B\u0107 liter", +findnext:"Znajd\u017A nast\u0119pny", +replace:"Zamie\u0144", +replaceall:"Zamien wszystko" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ps_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ps_dlg.js new file mode 100755 index 000000000..1895f4cef --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ps_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ps.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/pt_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/pt_dlg.js new file mode 100755 index 000000000..df9c0297a --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/pt_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('pt.searchreplace_dlg',{ +searchnext_desc:"Localizar novamente", +notfound:"A pesquisa foi conclu\u00EDda sem resultados.", +search_title:"Localizar", +replace_title:"Localizar/substituir", +allreplaced:"Todas as substitui\u00E7\u00F5es foram efetuadas.", +findwhat:"Localizar", +replacewith:"Substituir com", +direction:"Dire\u00E7\u00E3o", +up:"Acima", +down:"Abaixo", +mcase:"Diferenciar mai\u00FAsculas", +findnext:"Localizar pr\u00F3ximo", +replace:"Substituir", +replaceall:"Substituir todos" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ro_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ro_dlg.js new file mode 100755 index 000000000..b159afa2c --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ro_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ro.searchreplace_dlg',{ +searchnext_desc:"Caut\u0103 din nou", +notfound:"C\u0103utarea a fost terminat\u0103. Nu am g\u0103sit termenul c\u0103utat.", +search_title:"Caut\u0103", +replace_title:"Caut\u0103/\u00EEnlocuie\u015Fte", +allreplaced:"Toate instan\u0163ele termenului c\u0103utat au fost \u00EEnlocuite.", +findwhat:"Termen c\u0103utat:", +replacewith:"\u00CEnlocuie\u015Fte cu:", +direction:"Direc\u0163ia", +up:"\u00CEn sus", +down:"\u00CEn jos", +mcase:"Conteaz\u0103 litere mici/mari?", +findnext:"Caut\u0103 urm\u0103torul", +replace:"\u00CEnlocuie\u015Fte", +replaceall:"\u00CEnlocuie\u015Fte toate" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ru_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ru_dlg.js new file mode 100755 index 000000000..b2ec4402c --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ru_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ru.searchreplace_dlg',{ +searchnext_desc:"\u041D\u0430\u0439\u0442\u0438 \u0435\u0449\u0435", +notfound:"\u041F\u043E\u0438\u0441\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D. \u0421\u043E\u043E\u0442\u0432\u0435\u0441\u0442\u0432\u0438\u0439 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E.", +search_title:"\u041F\u043E\u0438\u0441\u043A", +replace_title:"\u041F\u043E\u0438\u0441\u043A \u0438 \u0437\u0430\u043C\u0435\u043D\u0430", +allreplaced:"\u0412\u0441\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u0431\u044B\u043B\u0438 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u044B.", +findwhat:"\u041F\u043E\u0438\u0441\u043A", +replacewith:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u043D\u0430", +direction:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", +up:"\u0412\u0432\u0435\u0440\u0445 ", +down:"\u0412\u043D\u0438\u0437", +mcase:"\u0423\u0447\u0438\u0442\u044B\u0432\u0430\u0442\u044C \u0440\u0435\u0433\u0438\u0441\u0442\u0440", +findnext:"\u041D\u0430\u0439\u0442\u0438 \u0434\u0430\u043B\u0435\u0435", +replace:"\u0417\u0430\u043C\u0435\u043D\u0430", +replaceall:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sc_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sc_dlg.js new file mode 100755 index 000000000..2c1a86975 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sc_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sc.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u67E5\u627E", +notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002 ", +search_title:"\u67E5\u627E", +replace_title:"\u67E5\u627E/\u66FF\u6362", +allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", +findwhat:"\u67E5\u627E\u76EE\u6807", +replacewith:"\u66FF\u6362\u4E3A", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5927\u5C0F\u5199\u5339\u914D", +findnext:"\u4E0B\u4E00\u4E2A", +replace:"\u66FF\u6362", +replaceall:"\u66FF\u6362\u5168\u90E8" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/se_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/se_dlg.js new file mode 100755 index 000000000..71c695b10 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/se_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('se.searchreplace_dlg',{ +searchnext_desc:"S\u00F6k igen", +notfound:"S\u00F6kningen har slutf\u00F6rts. S\u00F6kstr\u00E4ngen kunde inte hittas.", +search_title:"S\u00F6k", +replace_title:"S\u00F6k/ers\u00E4tt", +allreplaced:"Alla st\u00E4llen d\u00E4r s\u00F6kstr\u00E4ngen kunde hittas har ersatts.", +findwhat:"Hitta vad", +replacewith:"Ers\u00E4tt med", +direction:"Riktning", +up:"Upp\u00E5t", +down:"Ner\u00E5t", +mcase:"Matcha gemener/versaler", +findnext:"Hitta n\u00E4sta", +replace:"Ers\u00E4tt", +replaceall:"Ers\u00E4tt alla" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/si_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/si_dlg.js new file mode 100755 index 000000000..ecdf51afd --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/si_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('si.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sk_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sk_dlg.js new file mode 100755 index 000000000..eba8a3010 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sk_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sk.searchreplace_dlg',{ +searchnext_desc:"H\u013Eada\u0165 \u010Falej", +notfound:"H\u013Eadanie bolo dokon\u010Den\u00E9. H\u013Eadan\u00FD text nebol n\u00E1jden\u00FD.", +search_title:"H\u013Eada\u0165", +replace_title:"H\u013Eada\u0165 a nahradi\u0165", +allreplaced:"V\u0161etky v\u00FDskyty boli nahraden\u00E9.", +findwhat:"H\u013Eada\u0165 \u010Do", +replacewith:"Nahradi\u0165 \u010D\u00EDm", +direction:"Smer", +up:"Nahor", +down:"Nadol", +mcase:"Rozli\u0161ova\u0165 mal\u00E9 a VE\u013DK\u00C9 p\u00EDsmen\u00E1", +findnext:"H\u013Eada\u0165 dalej", +replace:"Nahradi\u0165", +replaceall:"Nahradi\u0165 v\u0161etko" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sl_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sl_dlg.js new file mode 100755 index 000000000..67abcc695 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sl_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sl.searchreplace_dlg',{ +searchnext_desc:"Najdi znova", +notfound:"Preiskovanje zaklju\u010Deno. Iskanega besedila nisem na\u0161el.", +search_title:"Najdi", +replace_title:"Najdi/zamenjaj", +allreplaced:"Vse pojavitve iskanega besedila so bile zamenjane.", +findwhat:"I\u0161\u010Dem za", +replacewith:"Zamenjam z", +direction:"Smer", +up:"navzgor", +down:"navzdol", +mcase:"ujemanje velikosti", +findnext:"Najdi nasled.", +replace:"Zamenjaj", +replaceall:"Zamenjaj vse" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sq_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sq_dlg.js new file mode 100755 index 000000000..7287d211e --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sq_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sq.searchreplace_dlg',{ +searchnext_desc:"K\u00EBrko p\u00EBrs\u00EBri", +notfound:"K\u00EBrkimi p\u00EBrfundoi dhe nuk ktheu asnj\u00EB rezultat.", +search_title:"K\u00EBrko", +replace_title:"K\u00EBrko/Z\u00EBvend\u00EBso", +allreplaced:"T\u00EB gjitha tekstet e gjetura u z\u00EBvend\u00EBsuan.", +findwhat:"K\u00EBrko p\u00EBr", +replacewith:"Z\u00EBvend\u00EBso me", +direction:"Drejtimi", +up:"Lart", +down:"Posht\u00EB", +mcase:"P\u00EBrshtat madh\u00EBsin\u00EB e g\u00EBrm\u00EBs", +findnext:"K\u00EBrko tjetr\u00EBn", +replace:"Z\u00EBvend\u00EBso", +replaceall:"Z\u00EBv. t\u00EB gjitha" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sr_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sr_dlg.js new file mode 100755 index 000000000..e36325195 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sr_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sr.searchreplace_dlg',{ +searchnext_desc:"Prona\u0111i opet", +notfound:"Pretra\u017Eivanje je zavr\u0161eno. Tra\u017Eeni tekst nije prona\u0111en.", +search_title:"Prona\u0111i", +replace_title:"Prona\u0111i/Zameni", +allreplaced:"Sva pojavljivanja tra\u017Eenog teksta su zamenjena.", +findwhat:"Prona\u0111i tekst", +replacewith:"Zameni sa", +direction:"Smjer", +up:"Gore", +down:"Dolje", +mcase:"Match case", +findnext:"Prona\u0111i sljede\u0107e", +replace:"Zameni", +replaceall:"Zameni sve" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/sv_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/sv_dlg.js new file mode 100755 index 000000000..a3f6f196a --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/sv_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('sv.searchreplace_dlg',{ +searchnext_desc:"S\u00F6k igen", +notfound:"S\u00F6kningen har slutf\u00F6rts. S\u00F6kstr\u00E4ngen kunde inte hittas.", +search_title:"S\u00F6k", +replace_title:"S\u00F6k/ers\u00E4tt", +allreplaced:"Alla st\u00E4llen d\u00E4r s\u00F6kstr\u00E4ngen kunde hittas har ersatts.", +findwhat:"Hitta vad", +replacewith:"Ers\u00E4tt med", +direction:"Riktning", +up:"Upp\u00E5t", +down:"Ner\u00E5t", +mcase:"Matcha gemener/versaler", +findnext:"Hitta n\u00E4sta", +replace:"Ers\u00E4tt", +replaceall:"Ers\u00E4tt alla" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ta_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ta_dlg.js new file mode 100755 index 000000000..6dbae4537 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ta_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ta.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/te_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/te_dlg.js new file mode 100755 index 000000000..5f7e35f3a --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/te_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('te.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/th_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/th_dlg.js new file mode 100755 index 000000000..53b4eb802 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/th_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('th.searchreplace_dlg',{ +searchnext_desc:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07", +notfound:"\u0E01\u0E32\u0E23\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14 \u0E40\u0E23\u0E32\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E2D\u0E30\u0E44\u0E23\u0E40\u0E25\u0E22", +search_title:"\u0E04\u0E49\u0E19\u0E2B\u0E32", +replace_title:"\u0E04\u0E49\u0E19\u0E2B\u0E32/\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48", +allreplaced:"\u0E17\u0E38\u0E01\u0E04\u0E33\u0E17\u0E35\u0E48\u0E43\u0E2A\u0E48\u0E16\u0E39\u0E01\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27", +findwhat:"\u0E04\u0E49\u0E19\u0E2B\u0E32", +replacewith:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E14\u0E49\u0E27\u0E22", +direction:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07", +up:"\u0E1A\u0E19", +down:"\u0E25\u0E48\u0E32\u0E07", +mcase:"\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E17\u0E38\u0E01\u0E2D\u0E22\u0E48\u0E32\u0E07", +findnext:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E15\u0E48\u0E2D\u0E44\u0E1B", +replace:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48", +replaceall:"\u0E41\u0E17\u0E19\u0E17\u0E35\u0E48\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/tr_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/tr_dlg.js new file mode 100755 index 000000000..eaedc798c --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/tr_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('tr.searchreplace_dlg',{ +searchnext_desc:"Tekrar ara", +notfound:"Arama tamamland\u0131. Aranan metin bulunamad\u0131.", +search_title:"Bul", +replace_title:"Bul/De\u011Fi\u015Ftir", +allreplaced:"Aranan metin bulundu\u011Fu yerlede de\u011Fi\u015Ftirildi.", +findwhat:"Aranan", +replacewith:"Yeni de\u011Fer", +direction:"Y\u00F6n", +up:"Yukar\u0131", +down:"A\u015Fa\u011F\u0131", +mcase:"B\u00FCy\u00FCk/k\u00FC\u00E7\u00FCk duyarl\u0131", +findnext:"Sonrakini bul", +replace:"De\u011Fi\u015Ftir", +replaceall:"T\u00FCm\u00FCn\u00FC de\u011Fi\u015Ftir" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/tt_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/tt_dlg.js new file mode 100755 index 000000000..62f741c83 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/tt_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('tt.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u641C\u5C0B", +notfound:"\u641C\u5C0B\u5DF2\u5B8C\u6210 ! \u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6A19\u3002 ", +search_title:"\u641C\u5C0B", +replace_title:"\u641C\u5C0B/\u53D6\u4EE3", +allreplaced:"\u5DF2\u53D6\u4EE3\u6240\u6709\u5339\u914D\u7684\u5B57\u4E32.", +findwhat:"\u641C\u5C0B\u76EE\u6A19", +replacewith:"\u53D6\u4EE3\u7232", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5340\u5206\u5927\u5C0F\u5BEB", +findnext:"\u641C\u5C0B\u4E0B\u4E00\u500B", +replace:"\u53D6\u4EE3", +replaceall:"\u5168\u90E8\u53D6\u4EE3" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/tw_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/tw_dlg.js new file mode 100755 index 000000000..88b308b35 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/tw_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('tw.searchreplace_dlg',{ +searchnext_desc:"\u7E7C\u7E8C\u641C\u5C0B", +notfound:"\u641C\u5C0B\u5B8C\u7562\uFF0C\u6C92\u6709\u627E\u5230\u7B26\u5408\u7684\u5B57\u4E32\u3002", +search_title:"\u641C\u5C0B", +replace_title:"\u641C\u5C0B/\u66FF\u63DB", +allreplaced:"\u6240\u6709\u7B26\u5408\u7684\u5B57\u4E32\u5747\u5DF2\u66FF\u63DB\u3002", +findwhat:"\u641C\u5C0B\u76EE\u6A19", +replacewith:"\u66FF\u63DB\u70BA", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5340\u5206\u5927\u5C0F\u5BEB", +findnext:"\u641C\u5C0B\u4E0B\u4E00\u500B", +replace:"\u66FF\u63DB", +replaceall:"\u5168\u90E8\u66FF\u63DB" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/uk_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/uk_dlg.js new file mode 100755 index 000000000..6ff203cb1 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/uk_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('uk.searchreplace_dlg',{ +searchnext_desc:"\u0417\u043D\u0430\u0439\u0442\u0438 \u0449\u0435", +notfound:"\u041F\u043E\u0448\u0443\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E. \u041F\u043E\u0448\u0443\u043A\u043E\u0432\u0438\u0439 \u0440\u044F\u0434\u043E\u043A \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E.", +search_title:"\u0428\u0443\u043A\u0430\u0442\u0438", +replace_title:"\u0428\u0443\u043A\u0430\u0442\u0438/\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438", +allreplaced:"\u0412\u0441\u0456 \u0432\u0445\u043E\u0434\u0436\u0435\u043D\u043D\u044F \u0440\u044F\u0434\u043A\u0430 \u0431\u0443\u043B\u0438 \u0437\u0430\u043C\u0456\u043D\u0435\u043D\u0456.", +findwhat:"\u0417\u043D\u0430\u0439\u0442\u0438", +replacewith:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u043D\u0430", +direction:"\u041D\u0430\u043F\u0440\u044F\u043C\u043E\u043A \u043F\u043E\u0448\u0443\u043A\u0443", +up:"\u0412\u0433\u043E\u0440\u0443", +down:"\u0412\u043D\u0438\u0437", +mcase:"\u0412\u0440\u0430\u0445\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0440\u0435\u0454\u0441\u0442\u0440", +findnext:"\u0417\u043D\u0430\u0439\u0442\u0438 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0435", +replace:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438", +replaceall:"\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u0432\u0441\u0435" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/ur_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/ur_dlg.js new file mode 100755 index 000000000..adfff9840 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/ur_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('ur.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/vi_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/vi_dlg.js new file mode 100755 index 000000000..2ac3ca964 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/vi_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('vi.searchreplace_dlg',{ +searchnext_desc:"T\u00ECm l\u1EA1i", +notfound:"Vi\u1EC7c t\u00ECm ki\u1EBFm \u0111\u00E3 ho\u00E0n th\u00E0nh. Chu\u1ED7i t\u00ECm ki\u1EBFm kh\u00F4ng \u0111\u01B0\u1EE3c t\u00ECm th\u1EA5y.", +search_title:"T\u00ECm ki\u1EBFm", +replace_title:"T\u00ECm/Thay th\u1EBF", +allreplaced:"T\u1EA5t c\u1EA3 c\u00E1c l\u1EA7n xu\u1EA5t hi\u1EC7n c\u1EE7a c\u00E1c chu\u1ED7i t\u00ECm ki\u1EBFm \u0111\u01B0\u1EE3c thay th\u1EBF.", +findwhat:"T\u00ECm ki\u1EBFm g\u00EC", +replacewith:"Thay th\u1EBF v\u1EDBi", +direction:"H\u01B0\u1EDBng", +up:"L\u00EAn", +down:"Xu\u1ED1ng", +mcase:"Theo c\u1EA3 ch\u1EEF hoa", +findnext:"T\u00ECm k\u1EBF ti\u1EBFp", +replace:"Thay th\u1EBF", +replaceall:"Thay th\u1EBF t\u1EA5t" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/zh_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/zh_dlg.js new file mode 100755 index 000000000..9a4ddfcfe --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/zh_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('zh.searchreplace_dlg',{ +searchnext_desc:"\u7E7C\u7E8C\u641C\u5C0B", +notfound:"\u641C\u5C0B\u5B8C\u7562\uFF0C\u6C92\u6709\u627E\u5230\u7B26\u5408\u7684\u5B57\u7B26\u4E32\u3002", +search_title:"\u641C\u5C0B", +replace_title:"\u641C\u5C0B/\u53D6\u4EE3", +allreplaced:"\u6240\u6709\u7B26\u5408\u7684\u5B57\u7B26\u4E32\u5747\u5DF2\u53D6\u4EE3\u3002", +findwhat:"\u641C\u5C0B\u76EE\u6A19", +replacewith:"\u53D6\u4EE3\u70BA", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5340\u5206\u5927\u5C0F\u5BEB", +findnext:"\u5C0B\u627E\u4E0B\u4E00\u500B", +replace:"\u53D6\u4EE3", +replaceall:"\u5168\u90E8\u53D6\u4EE3" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/searchreplace/langs/zu_dlg.js b/js/tiny_mce/plugins/searchreplace/langs/zu_dlg.js new file mode 100755 index 000000000..489266023 --- /dev/null +++ b/js/tiny_mce/plugins/searchreplace/langs/zu_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('zu.searchreplace_dlg',{ +searchnext_desc:"\u518D\u6B21\u67E5\u627E", +notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210!\u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002", +search_title:"\u67E5\u627E", +replace_title:"\u67E5\u627E/\u66FF\u6362", +allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u7B26\u4E32.", +findwhat:"\u67E5\u627E\u76EE\u6807", +replacewith:"\u66FF\u6362\u4E3A", +direction:"\u65B9\u5411", +up:"\u5411\u4E0A", +down:"\u5411\u4E0B", +mcase:"\u5927\u5C0F\u5199\u5339\u914D", +findnext:"\u4E0B\u4E00\u4E2A", +replace:"\u66FF\u6362", +replaceall:"\u66FF\u6362\u5168\u90E8" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/css/props.css b/js/tiny_mce/plugins/style/css/props.css new file mode 100644 index 000000000..eb1f26496 --- /dev/null +++ b/js/tiny_mce/plugins/style/css/props.css @@ -0,0 +1,13 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/js/tiny_mce/plugins/style/editor_plugin.js b/js/tiny_mce/plugins/style/editor_plugin.js new file mode 100644 index 000000000..cab2153c4 --- /dev/null +++ b/js/tiny_mce/plugins/style/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/editor_plugin_src.js b/js/tiny_mce/plugins/style/editor_plugin_src.js new file mode 100644 index 000000000..5f7755f18 --- /dev/null +++ b/js/tiny_mce/plugins/style/editor_plugin_src.js @@ -0,0 +1,55 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 320 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + style_text : ed.selection.getNode().style.cssText + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/js/props.js b/js/tiny_mce/plugins/style/js/props.js new file mode 100644 index 000000000..c8e160424 --- /dev/null +++ b/js/tiny_mce/plugins/style/js/props.js @@ -0,0 +1,635 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'), h; + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/style/langs/ar_dlg.js b/js/tiny_mce/plugins/style/langs/ar_dlg.js new file mode 100755 index 000000000..448d4401a --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"\u064a\u0633\u0627\u0631",bottom:"\u0627\u0633\u0641\u0644",right:"\u064a\u0645\u064a\u0646",top:"\u0627\u0644\u0627\u0639\u0644\u0649",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/az_dlg.js b/js/tiny_mce/plugins/style/langs/az_dlg.js new file mode 100755 index 000000000..5d52d9b9f --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.style_dlg',{text_lineheight:"S\u0259tr h\u00fcnd\u00fcrl\u00fcy\u00fc",text_variant:"Variant",text_style:"Stil",text_weight:"\u00c7\u0259kisi",text_size:"\u00d6l\u00e7\u00fcs\u00fc",text_font:"\u015erift",text_props:"M\u0259tn",positioning_tab:"M\u00f6vqe",list_tab:"Siyah\u0131",border_tab:"S\u0259rh\u0259d",box_tab:"Konteyner",block_tab:"Blok",background_tab:"Fon",text_tab:"M\u0259tn",apply:"T\u0259tbiq et",title:"CSS stili redakt\u0259 et",clip:"K\u0259sm\u0259k",placement:"Yerl\u0259\u015fdirm\u0259",overflow:"Axma",zindex:"Z-indeks",visibility:"G\u00f6r\u00fcn\u00fc\u015f",positioning_type:"N\u00f6v",position:"M\u00f6vqe",bullet_image:"Marker \u015f\u0259kli",list_type:"N\u00f6v",color:"R\u0259ng",height:"H\u00fcnd\u00fcrl\u00fck",width:"En",style:"Stil",margin:"Sah\u0259l\u0259r",left:"Soldan",bottom:"A\u015fa\u011f\u0131dan",right:"Sa\u011fdan",top:"Yuxar\u0131dan",same:"Ham\u0131s\u0131 \u00fc\u00e7\u00fcn eyni",padding:"Doldurma",box_clear:"T\u0259mizl\u0259",box_float:"\u00dcz\u0259n",box_height:"Uzunlu\u011fu",box_width:"Eni",block_display:"N\u00fcmayis",block_whitespace:"Bo\u015fluq",block_text_indent:"M\u0259tn bo\u015flu\u011fu",block_text_align:"M\u0259tn tara\u015fla\u015fd\u0131r\u0131lmas\u0131",block_vertical_alignment:"\u015eaquli tarazla\u015fd\u0131r\u0131lma",block_letterspacing:"Simvol aras\u0131 bo\u015fluqlar",block_wordspacing:"S\u00f6zaras\u0131 bo\u015fluqlar",background_vpos:"\u015eaquli m\u00f6vqe",background_hpos:"\u00dcf\u00fcqi m\u00f6vqe",background_attachment:"B\u0259rkitm\u0259k",background_repeat:"T\u0259krar",background_image:"fon \u015f\u0259kli",background_color:"Fon r\u0259ngi",text_none:"he\u00e7 biri",text_blink:"Yan\u0131b-s\u00f6n\u0259n",text_case:"Registr",text_striketrough:"\u00fcst\u00fcnd\u0259n x\u0259tt",text_underline:"alt\u0131ndan x\u0259tt",text_overline:"\u00fcz\u0259rind\u0259n x\u0259tt",text_decoration:"B\u0259z\u0259k",text_color:"\u015e\u0259kil"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/be_dlg.js b/js/tiny_mce/plugins/style/langs/be_dlg.js new file mode 100755 index 000000000..d497669e6 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.style_dlg',{text_lineheight:"\u0412\u044b\u0448\u044b\u043d\u044f \u0440\u0430\u0434\u043a\u0430",text_variant:"\u041d\u0430\u043f\u0456\u0441\u0430\u043d\u043d\u0435",text_style:"\u0421\u0442\u044b\u043b\u044c",text_weight:"\u0412\u0430\u0433\u0430",text_size:"\u041f\u0430\u043c\u0435\u0440",text_font:"\u0428\u0440\u044b\u0444\u0442",text_props:"\u0422\u044d\u043a\u0441\u0442",positioning_tab:"\u041f\u0430\u0437\u0456\u0446\u044b\u044f\u043d\u0430\u0432\u0430\u043d\u043d\u0435",list_tab:"\u0421\u043f\u0456\u0441",border_tab:"\u041c\u044f\u0436\u0430",box_tab:"\u041a\u0430\u043d\u0442\u044d\u0439\u043d\u0435\u0440",block_tab:"\u0411\u043b\u043e\u043a",background_tab:"\u0424\u043e\u043d",text_tab:"\u0422\u044d\u043a\u0441\u0442",apply:"\u0423\u0436\u044b\u0446\u044c",title:"\u0420\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044c \u0441\u0442\u044b\u043b\u044c CSS",clip:"\u0410\u0431\u0440\u0430\u0437\u0430\u043d\u043d\u0435",placement:"\u0420\u0430\u0437\u043c\u044f\u0448\u0447\u044d\u043d\u043d\u0435",overflow:"\u0410\u0431\u0446\u044f\u0447\u044d\u043d\u043d\u0435",zindex:"Z-\u0430\u0437\u043d\u0430\u0447\u043d\u0456\u043a",visibility:"\u0411\u0430\u0447\u043d\u0430\u0441\u0446\u044c",positioning_type:"\u0422\u044b\u043f",position:"\u041f\u0430\u0437\u0456\u0446\u044b\u044f",bullet_image:"\u041c\u0430\u043b\u044e\u043d\u0430\u043a \u043c\u0430\u0440\u043a\u0435\u0440\u0430",list_type:"\u0422\u044b\u043f",color:"\u041a\u043e\u043b\u0435\u0440",height:"\u0412\u044b\u0448\u044b\u043d\u044f",width:"\u0428\u044b\u0440\u044b\u043d\u044f",style:"\u0421\u0442\u044b\u043b\u044c",margin:"\u041f\u0430\u043b\u0456",left:"\u0417\u043b\u0435\u0432\u0430",bottom:"\u0417\u043d\u0456\u0437\u0443",right:"\u0421\u043f\u0440\u0430\u0432\u0430",top:"\u0417\u0432\u0435\u0440\u0445\u0443",same:"\u0410\u0434\u043d\u043e\u043b\u044c\u043a\u0430\u0432\u0430 \u0434\u043b\u044f \u045e\u0441\u0456\u0445",padding:"\u041d\u0430\u0431\u0456\u0432\u0430\u043d\u043d\u0435",box_clear:"\u0410\u0447\u044b\u0441\u0446\u0456\u0446\u044c",box_float:"\u042f\u043a\u043e\u0435 \u043f\u043b\u0430\u0432\u0430\u0435",box_height:"\u0412\u044b\u0448\u044b\u043d\u044f",box_width:"\u0428\u044b\u0440\u044b\u043d\u044f",block_display:"\u0410\u0434\u043b\u044e\u0441\u0442\u0440\u0430\u0432\u0430\u043d\u043d\u0435",block_whitespace:"\u041f\u0440\u0430\u0431\u0435\u043b",block_text_indent:"\u0412\u043e\u0434\u0441\u0442\u0443\u043f \u0442\u044d\u043a\u0441\u0442\u0443",block_text_align:"\u0412\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435 \u0442\u044d\u043a\u0441\u0442\u0443",block_vertical_alignment:"\u0412\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u0430\u0435 \u0432\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435",block_letterspacing:"\u041f\u0440\u0430\u043c\u0435\u0436\u043a\u0456 \u043f\u0430\u043c\u0456\u0436 \u0437\u043d\u0430\u043a\u0430\u043c\u0456",block_wordspacing:"\u041f\u0440\u0430\u043c\u0435\u0436\u043a\u0456 \u043f\u0430\u043c\u0456\u0436 \u0441\u043b\u043e\u0432\u0430\u043c\u0456",background_vpos:"\u0412\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u0437\u0456\u0446\u044b\u044f",background_hpos:"\u0413\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u0437\u0456\u0446\u044b\u044f",background_attachment:"\u041f\u0440\u044b\u043c\u0430\u0446\u0430\u0432\u0430\u043d\u043d\u0435",background_repeat:"\u041f\u0430\u045e\u0442\u043e\u0440",background_image:"\u0424\u043e\u043d\u0430\u0432\u044b \u043c\u0430\u043b\u044e\u043d\u0430\u043a",background_color:"\u041a\u043e\u043b\u0435\u0440 \u0444\u043e\u043d\u0443",text_none:"\u043d\u0456\u044f\u043a\u0430\u0433\u0430",text_blink:"\u044f\u043a\u0456 \u043c\u0456\u0433\u0446\u0456\u0446\u044c",text_case:"\u0420\u044d\u0433\u0456\u0441\u0442\u0440",text_striketrough:"\u043f\u0435\u0440\u0430\u043a\u0440\u044d\u0441\u043b\u0435\u043d\u044b",text_underline:"\u043f\u0430\u0434\u043a\u0440\u044d\u0441\u043b\u0435\u043d\u044b",text_overline:"\u043d\u0430\u0434\u043a\u0440\u044d\u0441\u043b\u0435\u043d\u044b",text_decoration:"\u0423\u043f\u0440\u044b\u0433\u043e\u0436\u0432\u0430\u043d\u043d\u0435",text_color:"\u041a\u043e\u043b\u0435\u0440"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/bg_dlg.js b/js/tiny_mce/plugins/style/langs/bg_dlg.js new file mode 100755 index 000000000..e12c15d2f --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.style_dlg',{text_lineheight:"\u0412\u0438\u0441\u043e\u0447\u0438\u043d\u0430 \u043d\u0430 \u0440\u0435\u0434\u0430",text_variant:"\u041f\u0440\u043e\u043c\u0435\u043d\u043b\u0438\u0432",text_style:"\u0421\u0442\u0438\u043b",text_weight:"\u0422\u0435\u0433\u043b\u043e",text_size:"\u0420\u0430\u0437\u043c\u0435\u0440",text_font:"\u0428\u0440\u0438\u0444\u0442",text_props:"\u0422\u0435\u043a\u0441\u0442",positioning_tab:"\u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0430\u043d\u0435",list_tab:"\u0421\u043f\u0438\u0441\u044a\u043a",border_tab:"\u0420\u0430\u043c\u043a\u0430",box_tab:"\u041a\u0443\u0442\u0438\u044f",block_tab:"\u0411\u043b\u043e\u043a",background_tab:"\u0424\u043e\u043d",text_tab:"\u0422\u0435\u043a\u0441\u0442",apply:"\u041f\u043e\u0442\u0432\u044a\u0440\u0434\u0438",title:"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u0439 CSS \u0441\u0442\u0438\u043b",clip:"\u041e\u0442\u0440\u0435\u0436\u0438",placement:"\u0420\u0430\u0437\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435",overflow:"Overflow",zindex:"Z-index",visibility:"\u0412\u0438\u0434\u0438\u043c\u043e\u0441\u0442",positioning_type:"\u0422\u0438\u043f",position:"\u041f\u043e\u0437\u0438\u0446\u0438\u044f",bullet_image:"\u0413\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 \u0432\u043e\u0434\u0430\u0447\u0438\u0442\u0435",list_type:"\u0422\u0438\u043f",color:"\u0426\u0432\u044f\u0442",height:"\u0412\u0438\u0441\u043e\u0447\u0438\u043d\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",style:"\u0421\u0442\u0438\u043b",margin:"Margin",left:"\u041b\u044f\u0432\u043e",bottom:"\u0414\u043e\u043b\u0443",right:"\u0414\u044f\u0441\u043d\u043e",top:"\u0413\u043e\u0440\u0435",same:"\u0417\u0430 \u0432\u0441\u0438\u0447\u043a\u0438",padding:"Padding",box_clear:"\u0418\u0437\u0447\u0438\u0441\u0442\u0438",box_float:"Float",box_height:"\u0412\u0438\u0441\u043e\u0447\u0438\u043d\u0430",box_width:"\u0428\u0438\u0440\u0438\u043d\u0430",block_display:"\u041f\u043e\u043a\u0430\u0437\u0432\u0430\u043d\u0435",block_whitespace:"\u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b",block_text_indent:"\u041e\u0442\u0441\u0442\u044a\u043f \u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u0430",block_text_align:"\u041f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435 \u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u0430",block_vertical_alignment:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u043d\u043e \u043f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435",block_letterspacing:"\u0420\u0430\u0437\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0431\u0443\u043a\u0432\u0438\u0442\u0435",block_wordspacing:"\u0420\u0430\u0437\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0443\u043c\u0438\u0442\u0435",background_vpos:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f",background_hpos:"\u0425\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f",background_attachment:"\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438",background_repeat:"\u041f\u043e\u0432\u0442\u043e\u0440\u0438",background_image:"\u0424\u043e\u043d\u043e\u0432\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",background_color:"\u0424\u043e\u043d\u0438\u0432 \u0446\u0432\u044f\u0442",text_none:"\u043d\u0438\u0449\u043e",text_blink:"\u043c\u0438\u0433\u0430",text_case:"\u0420\u0435\u0433\u0438\u0441\u0442\u044a\u0440",text_striketrough:"\u0437\u0430\u0447\u0435\u0440\u0442\u0430\u043d",text_underline:"\u043f\u043e\u0434\u0447\u0435\u0440\u0442\u0430\u043d",text_overline:"\u043d\u0430\u0434\u0447\u0435\u0440\u0442\u0430\u043d",text_decoration:"\u0414\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u044f",text_color:"\u0426\u0432\u044f\u0442"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/bn_dlg.js b/js/tiny_mce/plugins/style/langs/bn_dlg.js new file mode 100755 index 000000000..b8eb00c27 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.style_dlg',{"text_lineheight":"Line height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text indent","block_text_align":"Text align","block_vertical_alignment":"Vertical alignment","block_letterspacing":"Letter spacing","block_wordspacing":"Word spacing","background_vpos":"Vertical position","background_hpos":"Horizontal position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background image","background_color":"Background color","text_none":"none","text_blink":"blink","text_case":"Case","text_striketrough":"strikethrough","text_underline":"underline","text_overline":"overline","text_decoration":"Decoration","text_color":"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/br_dlg.js b/js/tiny_mce/plugins/style/langs/br_dlg.js new file mode 100755 index 000000000..c18da7133 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.style_dlg',{text_lineheight:"Altura da linha",text_variant:"Variante",text_style:"Estilo",text_weight:"Peso",text_size:"Tamanho",text_font:"Fonte",text_props:"Texto",positioning_tab:"Posicionamento",list_tab:"Lista",border_tab:"Limites",box_tab:"Caixa",block_tab:"Bloco",background_tab:"Fundo",text_tab:"Texto",apply:"Aplicar",title:"Editar CSS",clip:"Clip",placement:"Posicionamento",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidade",positioning_type:"Tipo",position:"Posi\u00e7\u00e3o",bullet_image:"Imagem de lista",list_type:"Tipo",color:"Cor",height:"Altura",width:"Largura",style:"Estilo",margin:"Margem",left:"Esquerda",bottom:"Abaixo",right:"Direita",top:"Topo",same:"O mesmo para todos",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Altura",box_width:"Largura",block_display:"Display",block_whitespace:"Espa\u00e7o",block_text_indent:"Indent",block_text_align:"Alinhamento de texto",block_vertical_alignment:"Alinhamento vertical",block_letterspacing:"Espa\u00e7amento de letras",block_wordspacing:"Espa\u00e7amento de palavras",background_vpos:"Posi\u00e7\u00e3o vertical",background_hpos:"Posi\u00e7\u00e3o horizontal",background_attachment:"Fixar",background_repeat:"Repetir",background_image:"Imagem de fundo",background_color:"Cor de fundo",text_none:"nenhum",text_blink:"Piscar",text_case:"Mai\u00fascula/min\u00fascula",text_striketrough:"Riscado",text_underline:"Sublinhado",text_overline:"Sobrelinha",text_decoration:"Decora\u00e7\u00e3o",text_color:"Cor"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/bs_dlg.js b/js/tiny_mce/plugins/style/langs/bs_dlg.js new file mode 100755 index 000000000..51d2e1610 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ca_dlg.js b/js/tiny_mce/plugins/style/langs/ca_dlg.js new file mode 100755 index 000000000..a6b25e476 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.style_dlg',{"text_lineheight":"Al\u00e7ada de l\u00ednia","text_variant":"Variant","text_style":"Estil","text_weight":"Pes","text_size":"Mida","text_font":"Font","text_props":"Text","positioning_tab":"Posicionament","list_tab":"Llista","border_tab":"Contorn","box_tab":"Quadre","block_tab":"Bloc","background_tab":"Fons","text_tab":"Text",apply:"Aplica",title:"Edita l\'estil CSS",clip:"Retall",placement:"Empla\u00e7ament",overflow:"Desbordament",zindex:"\u00cdndex Z",visibility:"Visibilitat","positioning_type":"Tipus",position:"Posici\u00f3","bullet_image":"Imatge pic","list_type":"Tipus",color:"Color",height:"Al\u00e7ada",width:"Amplada",style:"Estil",margin:"Marge",left:"Esquerra",bottom:"Avall",right:"Dreta",top:"Dalt",same:"Igual per a tot",padding:"Separaci\u00f3","box_clear":"Buida","box_float":"Flota","box_height":"Al\u00e7ada","box_width":"Amplada","block_display":"Visualitzaci\u00f3","block_whitespace":"Espai en blanc","block_text_indent":"Sagna el text","block_text_align":"Alinea el text","block_vertical_alignment":"Alineaci\u00f3 vertical","block_letterspacing":"Espaiat entre lletres","block_wordspacing":"Espaiat entre paraules","background_vpos":"Posici\u00f3 vertical","background_hpos":"Posici\u00f3 horitzontal","background_attachment":"Adjunt","background_repeat":"Repeteix","background_image":"Imatge de fons","background_color":"Color de fons","text_none":"cap","text_blink":"parpelleig","text_case":"Cas","text_striketrough":"barrat","text_underline":"subratllat","text_overline":"sobreratllat","text_decoration":"Decoraci\u00f3","text_color":"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ch_dlg.js b/js/tiny_mce/plugins/style/langs/ch_dlg.js new file mode 100755 index 000000000..e99e154e2 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u53d8\u91cf",text_style:"\u6837\u5f0f",text_weight:"\u5b57\u91cd",text_size:"\u6587\u5b57\u5927\u5c0f",text_font:"\u5b57\u4f53",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u8fb9\u6846",box_tab:"\u65b9\u5757",block_tab:"\u533a\u5757",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5957\u7528",title:"\u7f16\u8f91 CSS \u6837\u5f0f\u8868",clip:"\u526a\u8f91",placement:"\u653e\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z-\u5750\u6807",visibility:"\u53ef\u89c1",positioning_type:"\u7c7b\u578b",position:"\u4f4d\u7f6e",bullet_image:"\u56fe\u7247\u9879\u76ee\u7b26\u53f7",list_type:"\u7c7b\u8868\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8",width:"\u5bbd",style:"\u6837\u5f0f",margin:"\u5916\u8fb9\u8ddd",left:"\u5de6\u4fa7",bottom:"\u9760\u4e0b",right:"\u53f3\u4fa7",top:"\u5b9a\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5185\u8fb9\u8ddd",box_clear:"\u6e05\u9664\u6d6e\u52a8",box_float:"\u6d6e\u52a8",box_height:"\u9ad8",box_width:"\u5bbd",block_display:"\u663e\u793a",block_whitespace:"\u7a7a\u683c",block_text_indent:"\u6587\u5b57\u7f29\u6392",block_text_align:"\u6587\u5b57\u5bf9\u9f50",block_vertical_alignment:"\u5782\u76f4\u5bf9\u9f50",block_letterspacing:"\u5b57\u6bcd\u95f4\u8ddd",block_wordspacing:"\u95f4\u8ddd",background_vpos:"\u5782\u76f4\u4f4d\u7f6e",background_hpos:"\u6c34\u5e73\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u590d",background_image:"\u80cc\u666f\u56fe\u7247",background_color:"\u80cc\u666f\u989c\u8272",text_none:"\u65e0",text_blink:"\u95ea\u70c1",text_case:"\u5b57\u578b",text_striketrough:"\u5220\u9664\u7ebf",text_underline:"\u5e95\u7ebf",text_overline:"\u4e0a\u5212\u7ebf",text_decoration:"\u88c5\u9970",text_color:"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/cn_dlg.js b/js/tiny_mce/plugins/style/langs/cn_dlg.js new file mode 100755 index 000000000..1fad24fe0 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.style_dlg',{"text_lineheight":"\u884c\u9ad8","text_variant":"\u6587\u672c\u53d8\u91cf\uff08\u4e2d\u6587\u65e0\u6548\uff09","text_style":"\u6837\u5f0f","text_weight":"\u9ad8\u5ea6","text_size":"\u5b57\u4f53\u5927\u5c0f","text_font":"\u5b57\u4f53","text_props":"\u6587\u672c","positioning_tab":"\u653e\u7f6e","list_tab":"\u5217\u8868","border_tab":"\u8fb9\u6846","box_tab":"\u65b9\u5757","block_tab":"\u533a\u5757","background_tab":"\u80cc\u666f","text_tab":"\u6587\u672c",apply:"\u5e94\u7528",title:"\u7f16\u8f91CSS\u6837\u5f0f",clip:"\u526a\u8f91",placement:"\u653e\u7f6e",overflow:"\u6ea2\u51fa",zindex:"\u5143\u7d20\u5806\u53e0\u987a\u5e8f\uff08Z-index)",visibility:"\u53ef\u89c1","positioning_type":"\u7c7b\u578b",position:"\u4f4d\u7f6e","bullet_image":"\u56fe\u7247\u9879\u76ee\u7b26\u53f7","list_type":"\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",style:"\u6837\u5f0f",margin:"\u5916\u8fb9\u6846",left:"\u5de6\u4fa7",bottom:"\u5e95\u90e8",right:"\u53f3\u4fa7",top:"\u9876\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5185\u8fb9\u6846","box_clear":"\u6e05\u9664\u6d6e\u52a8","box_float":"\u6d6e\u52a8","box_height":"\u9ad8\u5ea6","box_width":"\u5bbd\u5ea6","block_display":"\u663e\u793a\u65b9\u5f0f","block_whitespace":"\u7a7a\u683c","block_text_indent":"\u6587\u672c\u7f29\u8fdb","block_text_align":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f","block_vertical_alignment":"\u5782\u76f4\u5bf9\u9f50","block_letterspacing":"\u5b57\u6bcd\u95f4\u8ddd","block_wordspacing":"\u95f4\u8ddd","background_vpos":"\u5782\u76f4\u4f4d\u7f6e","background_hpos":"\u6c34\u5e73\u4f4d\u7f6e","background_attachment":"\u9644\u4ef6","background_repeat":"\u91cd\u590d","background_image":"\u80cc\u666f\u56fe\u7247","background_color":"\u80cc\u666f\u989c\u8272","text_none":"\u65e0","text_blink":"\u95ea\u70c1","text_case":"\u5b57\u578b","text_striketrough":"\u5220\u9664\u7ebf","text_underline":"\u4e0b\u5212\u7ebf","text_overline":"\u4e0a\u5212\u7ebf","text_decoration":"\u88c5\u9970","text_color":"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/cs_dlg.js b/js/tiny_mce/plugins/style/langs/cs_dlg.js new file mode 100755 index 000000000..bac01dcba --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.style_dlg',{text_lineheight:"V\u00fd\u0161ka \u0159\u00e1dku",text_variant:"Varianta",text_style:"Styl textu",text_weight:"Tu\u010dnost p\u00edsma",text_size:"Velikost",text_font:"P\u00edsmo",text_props:"Text",positioning_tab:"Um\u00edst\u011bn\u00ed",list_tab:"Seznam",border_tab:"Ohrani\u010den\u00ed",box_tab:"Box",block_tab:"Blok",background_tab:"Pozad\u00ed",text_tab:"Text",apply:"Pou\u017e\u00edt",title:"Upravit CSS styl",clip:"O\u0159ez\u00e1n\u00ed (clip)",placement:"Um\u00edst\u011bni",overflow:"P\u0159ete\u010den\u00ed (overflow)",zindex:"Z-index",visibility:"Viditelnost",positioning_type:"Typ",position:"Um\u00edst\u011bn\u00ed",bullet_image:"Styl odr\u00e1\u017eek",list_type:"Typ",color:"Barva",height:"V\u00fd\u0161ka",width:"\u0160\u00ed\u0159ka",style:"Styl",margin:"Okraje (margin)",left:"Vlevo",bottom:"Dole",right:"Vpravo",top:"Naho\u0159e",same:"Stejn\u00e9 pro v\u0161echny",padding:"Odsazen\u00ed (padding)",box_clear:"Vy\u010distit",box_float:"Plovouc\u00ed",box_height:"V\u00fd\u0161ka",box_width:"\u0160\u00ed\u0159ka",block_display:"Blokov\u00e9 zobrazen\u00ed",block_whitespace:"Zalamov\u00e1n\u00ed textu",block_text_indent:"Odsazen\u00ed textu",block_text_align:"Zarovn\u00e1n\u00ed textu",block_vertical_alignment:"Vertik\u00e1ln\u00ed zarovn\u00e1n\u00ed",block_letterspacing:"Rozestup znak\u016f",block_wordspacing:"Rozestup slov",background_vpos:"Vertik\u00e1ln\u00ed um\u00edst\u011bn\u00ed",background_hpos:"Horizont\u00e1ln\u00ed um\u00edst\u011bn\u00ed",background_attachment:"Rolov\u00e1n\u00ed",background_repeat:"Opakov\u00e1n\u00ed",background_image:"Obr\u00e1zek pozad\u00ed",background_color:"Barva pozad\u00ed",text_none:"\u017e\u00e1dn\u00e1",text_blink:"blik\u00e1n\u00ed",text_case:"Velk\u00e1 p\u00edsmena",text_striketrough:"p\u0159e\u0161krtnut\u00ed",text_underline:"podtr\u017een\u00ed",text_overline:"nadtr\u017een\u00ed",text_decoration:"Dekorace",text_color:"Barva"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/cy_dlg.js b/js/tiny_mce/plugins/style/langs/cy_dlg.js new file mode 100755 index 000000000..1c0b5bcf1 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.style_dlg',{text_lineheight:"Uchder llinell",text_variant:"Amrywiad",text_style:"Arddull",text_weight:"Pwysau",text_size:"Maint",text_font:"Ffont",text_props:"Testun",positioning_tab:"Lleoli",list_tab:"Rhestr",border_tab:"Border",box_tab:"Blwch",block_tab:"Bloc",background_tab:"Cefndir",text_tab:"Testun",apply:"Gosod",title:"Golygu Arddull CSS",clip:"Clip",placement:"Gosodiad",overflow:"Gorlif",zindex:"Mynegai-Z",visibility:"Gwelededd",positioning_type:"Math",position:"Lleoliad",bullet_image:"Delwedd bwled",list_type:"Math",color:"Lliw",height:"Uchder",width:"Lled",style:"Arddull",margin:"Ymyl",left:"Chwith",bottom:"Gwaelod",right:"De",top:"Pen",same:"Yr un ar gyfer pob un",padding:"Padio",box_clear:"Clirio",box_float:"Arnofio",box_height:"Uchder",box_width:"Lled",block_display:"Arddangos",block_whitespace:"Whitespace",block_text_indent:"Mewnoli tetun",block_text_align:"Alinio testun",block_vertical_alignment:"Aliniad fertigol",block_letterspacing:"Bylchiad lythyren",block_wordspacing:"Bylchiad gair",background_vpos:"Lleoliad fertigol",background_hpos:"Lleoliad llorweddol",background_attachment:"Atodiad",background_repeat:"Ailadrodd",background_image:"Delwedd cefndir",background_color:"Lliw cefndir",text_none:"Dim un",text_blink:"Blincio",text_case:"Llythrennau bach/mawr",text_striketrough:"Taro drwodd",text_underline:"Llinell o dan",text_overline:"Llinell drosodd",text_decoration:"Addurniadau",text_color:"Lliw"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/da_dlg.js b/js/tiny_mce/plugins/style/langs/da_dlg.js new file mode 100755 index 000000000..0edb86878 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.style_dlg',{text_lineheight:"Linieh\u00f8jde",text_variant:"Variant",text_style:"Stil",text_weight:"V\u00e6gt",text_size:"St\u00f8rrelse",text_font:"Skrifttype",text_props:"Tekst",positioning_tab:"Positionering",list_tab:"Liste",border_tab:"Kant",box_tab:"Boks",block_tab:"Blok",background_tab:"Baggrund",text_tab:"Tekst",apply:"Anvend",title:"Rediger CSS stil",clip:"Klip",placement:"Placering",overflow:"Overl\u00f8b",zindex:"Z-index",visibility:"Synlighed",positioning_type:"Type",position:"Position",bullet_image:"Punktopstillings-billede",list_type:"Type",color:"Farve",height:"H\u00f8jde",width:"Bredde",style:"Style",margin:"Margin",left:"Venstre",bottom:"Bund",right:"H\u00f8jre",top:"Top",same:"Ens for alle",padding:"Afstand til indhold",box_clear:"Ryd",box_float:"Flydende",box_height:"H\u00f8jde",box_width:"Bredde",block_display:"Vis",block_whitespace:"Mellemrum",block_text_indent:"Tekstindrykning",block_text_align:"Tekstjustering",block_vertical_alignment:"Vertikal justering",block_letterspacing:"Afstand mellem bogstaver",block_wordspacing:"Afstand mellem ord",background_vpos:"Vertikal position",background_hpos:"Horisontal position",background_attachment:"Vedh\u00e6ftede fil",background_repeat:"Gentag",background_image:"Baggrundsbillede",background_color:"Baggrundsfarve",text_none:"ingen",text_blink:"blink",text_case:"Vesaltilstand",text_striketrough:"gennemstreget",text_underline:"understreget",text_overline:"overstreget",text_decoration:"Dekoration",text_color:"Farve"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/de_dlg.js b/js/tiny_mce/plugins/style/langs/de_dlg.js new file mode 100755 index 000000000..65e3497b0 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.style_dlg',{text_lineheight:"Zeilenh\u00f6he",text_variant:"Variante",text_style:"Stil",text_weight:"Dicke",text_size:"Gr\u00f6\u00dfe",text_font:"Schriftart",text_props:"Text",positioning_tab:"Positionierung",list_tab:"Liste",border_tab:"Rahmen",box_tab:"Box",block_tab:"Block",background_tab:"Hintergrund",text_tab:"Text",apply:"\u00dcbernehmen",title:"CSS-Styles bearbeiten",clip:"Ausschnitt",placement:"Platzierung",overflow:"Verhalten bei \u00dcbergr\u00f6\u00dfe",zindex:"Z-Wert",visibility:"Sichtbar",positioning_type:"Art der Positionierung",position:"Positionierung",bullet_image:"Listenpunkt-Grafik",list_type:"Listenpunkt-Art",color:"Textfarbe",height:"H\u00f6he",width:"Breite",style:"Format",margin:"\u00c4u\u00dferer Abstand",left:"Links",bottom:"Unten",right:"Rechts",top:"Oben",same:"Alle gleich",padding:"Innerer Abstand",box_clear:"Umflie\u00dfung verhindern",box_float:"Umflie\u00dfung",box_height:"H\u00f6he",box_width:"Breite",block_display:"Umbruchverhalten",block_whitespace:"Automatischer Umbruch",block_text_indent:"Einr\u00fcckung",block_text_align:"Ausrichtung",block_vertical_alignment:"Vertikale Ausrichtung",block_letterspacing:"Buchstabenabstand",block_wordspacing:"Wortabstand",background_vpos:"Position Y",background_hpos:"Position X",background_attachment:"Wasserzeicheneffekt",background_repeat:"Wiederholung",background_image:"Hintergrundbild",background_color:"Hintergrundfarbe",text_none:"keine",text_blink:"blinkend",text_case:"Schreibung",text_striketrough:"durchgestrichen",text_underline:"unterstrichen",text_overline:"\u00fcberstrichen",text_decoration:"Gestaltung",text_color:"Farbe"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/dv_dlg.js b/js/tiny_mce/plugins/style/langs/dv_dlg.js new file mode 100755 index 000000000..0c4efa4bb --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/el_dlg.js b/js/tiny_mce/plugins/style/langs/el_dlg.js new file mode 100755 index 000000000..586a8a16d --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.style_dlg',{text_lineheight:"\u038e\u03c8\u03bf\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2",text_variant:"\u03a0\u03b1\u03c1\u03b1\u03bb\u03bb\u03b1\u03b3\u03ae",text_style:"\u03a3\u03c4\u03c5\u03bb",text_weight:"\u0392\u03ac\u03c1\u03bf\u03c2",text_size:"\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ac\u03c4\u03c9\u03bd",text_font:"\u0393\u03c1\u03b1\u03bc\u03bc\u03b1\u03c4\u03bf\u03c3\u03b5\u03b9\u03c1\u03ac",text_props:"\u039a\u03b5\u03af\u03bc\u03b5\u03bd\u03bf",positioning_tab:"\u03a4\u03bf\u03c0\u03bf\u03b8\u03ad\u03c4\u03b7\u03c3\u03b7",list_tab:"\u039b\u03af\u03c3\u03c4\u03b1",border_tab:"\u03a0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf",box_tab:"\u039a\u03bf\u03c5\u03c4\u03af",block_tab:"\u039c\u03c0\u03bb\u03bf\u03ba",background_tab:"\u03a6\u03cc\u03bd\u03c4\u03bf",text_tab:"\u039a\u03b5\u03af\u03bc\u03b5\u03bd\u03bf",apply:"\u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae",title:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03a3\u03c4\u03c5\u03bb CSS",clip:"Clip",placement:"\u03a4\u03bf\u03c0\u03bf\u03b8\u03ad\u03c4\u03b7\u03c3\u03b7",overflow:"\u03a5\u03c0\u03b5\u03c1\u03c7\u03b5\u03af\u03bb\u03b9\u03c3\u03b7",zindex:"Z-index",visibility:"\u039f\u03c1\u03b1\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1",positioning_type:"\u03a4\u03cd\u03c0\u03bf\u03c2",position:"\u0398\u03ad\u03c3\u03b7",bullet_image:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c4\u03b5\u03bb\u03b5\u03af\u03b1\u03c2",list_type:"\u03a4\u03cd\u03c0\u03bf\u03c2",color:"\u03a7\u03c1\u03ce\u03bc\u03b1",height:"\u038e\u03c8\u03bf\u03c2",width:"\u03a0\u03bb\u03ac\u03c4\u03bf\u03c2",style:"\u03a3\u03c4\u03c5\u03bb",margin:"\u03a0\u03b5\u03c1\u03b9\u03b8\u03ce\u03c1\u03b9\u03bf",left:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",bottom:"\u039a\u03ac\u03c4\u03c9",right:"\u0394\u03b5\u03be\u03b9\u03ac",top:"\u03a0\u03ac\u03bd\u03c9",same:"\u038a\u03b4\u03b9\u03bf \u03b3\u03b9\u03b1 \u03cc\u03bb\u03b1",padding:"\u0393\u03ad\u03bc\u03b9\u03c3\u03bc\u03b1",box_clear:"Clear",box_float:"Float",box_height:"\u038e\u03c8\u03bf\u03c2",box_width:"\u03a0\u03bb\u03ac\u03c4\u03bf\u03c2",block_display:"\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7",block_whitespace:"\u039a\u03b5\u03bd\u03cc\u03c2 \u03c7\u03ce\u03c1\u03bf\u03c2",block_text_indent:"\u0395\u03c3\u03bf\u03c7\u03ae \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5",block_text_align:"\u03a3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7 \u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5",block_vertical_alignment:"\u039a\u03b1\u03c4\u03b1\u03ba\u03cc\u03c1\u03c5\u03c6\u03b7 \u03c3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7",block_letterspacing:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03c9\u03bd",block_wordspacing:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03bb\u03ad\u03be\u03b5\u03c9\u03bd",background_vpos:"\u039a\u03b1\u03c4\u03b1\u03ba\u03cc\u03c1\u03c5\u03c6\u03b7 \u03b8\u03ad\u03c3\u03b7",background_hpos:"\u039f\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1 \u03b8\u03ad\u03c3\u03b7",background_attachment:"\u03a0\u03c1\u03bf\u03c3\u03ac\u03c1\u03c4\u03b7\u03bc\u03b1",background_repeat:"\u0395\u03c0\u03b1\u03bd\u03ac\u03bb\u03b7\u03c8\u03b7",background_image:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c6\u03cc\u03bd\u03c4\u03bf\u03c5",background_color:"\u03a7\u03c1\u03ce\u03bc\u03b1 \u03c6\u03cc\u03bd\u03c4\u03bf\u03c5",text_none:"\u039a\u03b1\u03bc\u03af\u03b1",text_blink:"\u039d\u03b1 \u03b1\u03bd\u03b1\u03b2\u03bf\u03c3\u03b2\u03ae\u03bd\u03b5\u03b9",text_case:"\u039a\u03b5\u03c6./\u039c\u03b9\u03ba\u03c1\u03ac",text_striketrough:"\u0394\u03b9\u03b1\u03b3\u03c1\u03ac\u03bc\u03bc\u03b9\u03c3\u03b7",text_underline:"\u03a5\u03c0\u03bf\u03b3\u03c1\u03ac\u03bc\u03bc\u03b9\u03c3\u03b7",text_overline:"\u03a5\u03c0\u03b5\u03c1\u03b3\u03c1\u03ac\u03bc\u03bc\u03b9\u03c3\u03b7",text_decoration:"\u0394\u03b9\u03b1\u03ba\u03cc\u03c3\u03bc\u03b7\u03c3\u03b7",text_color:"\u03a7\u03c1\u03ce\u03bc\u03b1"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/en_dlg.js b/js/tiny_mce/plugins/style/langs/en_dlg.js new file mode 100644 index 000000000..0bd435eee --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text indent","block_text_align":"Text align","block_vertical_alignment":"Vertical alignment","block_letterspacing":"Letter spacing","block_wordspacing":"Word spacing","background_vpos":"Vertical position","background_hpos":"Horizontal position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background image","background_color":"Background color","text_none":"none","text_blink":"blink","text_case":"Case","text_striketrough":"strikethrough","text_underline":"underline","text_overline":"overline","text_decoration":"Decoration","text_color":"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/es_dlg.js b/js/tiny_mce/plugins/style/langs/es_dlg.js new file mode 100755 index 000000000..b37cce32c --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.style_dlg',{"text_lineheight":"Ancho de la fila","text_variant":"Variante","text_style":"Estilo","text_weight":"Peso","text_size":"Tama\u00f1o","text_font":"Fuente","text_props":"Texto","positioning_tab":"Posici\u00f3n","list_tab":"Lista","border_tab":"Borde","box_tab":"Caja","block_tab":"Bloque","background_tab":"Fondo","text_tab":"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidad","positioning_type":"Tipo",position:"Posici\u00f3n","bullet_image":"Imagen de la vi\u00f1eta","list_type":"Tipo",color:"Color",height:"Alto",width:"Ancho",style:"Estilo",margin:"Margen",left:"Izquierda",bottom:"Debajo",right:"Derecha",top:"Arriba",same:"Lo mismo en todos",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Alto","box_width":"Ancho","block_display":"Display","block_whitespace":"Espacio en blanco","block_text_indent":"Sangr\u00eda","block_text_align":"Alineaci\u00f3n del texto","block_vertical_alignment":"Alineaci\u00f3n vertical","block_letterspacing":"Espacio entre letra","block_wordspacing":"Espacio entre palabra","background_vpos":"Posici\u00f3n vertical","background_hpos":"Posici\u00f3n horizontal","background_attachment":"Adjunto","background_repeat":"Repetici\u00f3n","background_image":"Imagen de fondo","background_color":"Color de fondo","text_none":"Ninguno","text_blink":"Parpadeo","text_case":"Min\u00fas./May\u00fas.","text_striketrough":"Tachado","text_underline":"Subrayado","text_overline":"Subrayado superior","text_decoration":"Decorativos","text_color":"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/et_dlg.js b/js/tiny_mce/plugins/style/langs/et_dlg.js new file mode 100755 index 000000000..8940e8e0c --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.style_dlg',{text_lineheight:"Joone k\u00f5rgus",text_variant:"Variant",text_style:"Stiil",text_weight:"Raskus",text_size:"Suurus",text_font:"Font",text_props:"Tekst",positioning_tab:"Positsioneerimine",list_tab:"Nimekiri",border_tab:"Raam",box_tab:"Kast",block_tab:"Plokk",background_tab:"Taust",text_tab:"Tekst",apply:"Rakenda",title:"Muuda CSS stiili",clip:"Klipp",placement:"Asetus",overflow:"\u00dclevool",zindex:"Z-viit",visibility:"N\u00e4htavus",positioning_type:"T\u00fc\u00fcp",position:"Positsioon",bullet_image:"Punkt pilt",list_type:"T\u00fc\u00fcp",color:"V\u00e4rv",height:"K\u00f5rgus",width:"Laius",style:"Stiil",margin:"Serv",left:"Vasakul",bottom:"All",right:"Paremal",top:"\u00dcleval",same:"Sama k\u00f5igile",padding:"T\u00e4idis",box_clear:"Puhas",box_float:"H\u00f5ljuv",box_height:"K\u00f5rgus",box_width:"Laius",block_display:"Kuva",block_whitespace:"T\u00fchimik",block_text_indent:"Teksti taandus",block_text_align:"Teksti joondus",block_vertical_alignment:"Vertikaalne joondus",block_letterspacing:"T\u00e4he avardamine",block_wordspacing:"S\u00f5nade avardamine",background_vpos:"Vertikaalne asend",background_hpos:"Horisontaalne asend",background_attachment:"Manus",background_repeat:"Kordus",background_image:"Tausta pilt",background_color:"Tausta v\u00e4rv",text_none:"mitte \u00fckski",text_blink:"vilgutus",text_case:"Kast",text_striketrough:"l\u00e4bikriipsutus",text_underline:"alajoon",text_overline:"\u00fclejoon",text_decoration:"Dekoratioon",text_color:"V\u00e4rv"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/eu_dlg.js b/js/tiny_mce/plugins/style/langs/eu_dlg.js new file mode 100755 index 000000000..06aa6e0ce --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.style_dlg',{text_lineheight:"Lerro garaiera",text_variant:"Aldaera",text_style:"Estiloa",text_weight:"Weight",text_size:"Tamaina",text_font:"Letra-tipoa",text_props:"Testua",positioning_tab:"Kokapena",list_tab:"Zerrenda",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Atzea",text_tab:"Testua",apply:"Apikatu",title:"Aldatu CSS estiloa",clip:"Klip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Ikusgarritasuna",positioning_type:"Mora",position:"Kokapena",bullet_image:"Bulet-irudia",list_type:"Mota",color:"Kolorea",height:"Altuera",width:"Zabalera",style:"Estiloa",margin:"Margina",left:"Ezkerra",bottom:"Behera",right:"Eskuina",top:"Gora",same:"Guztientzat berdina",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Altuera",box_width:"Zabalera",block_display:"Erakutsi",block_whitespace:"Zuriunea",block_text_indent:"Koska",block_text_align:"Testu lerrokatzea",block_vertical_alignment:"Lerrokatze bertikala",block_letterspacing:"Letra banaketa",block_wordspacing:"Hitz banaketa",background_vpos:"Posizio bertikala",background_hpos:"Posizio horizontala",background_attachment:"Eranskina",background_repeat:"Errepikatu",background_image:"Atzeko irudia",background_color:"Atzeko kolorea",text_none:"Bat ere ez",text_blink:"Keinada",text_case:"Minus./Maius.",text_striketrough:"Marratua",text_underline:"Azpimarra",text_overline:"Goimarra",text_decoration:"Apaingarriak",text_color:"Kolorea"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/fa_dlg.js b/js/tiny_mce/plugins/style/langs/fa_dlg.js new file mode 100755 index 000000000..5a8bfdd3c --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.style_dlg',{text_lineheight:"\u0628\u0644\u0646\u062f\u06cc \u062e\u0637",text_variant:"\u0646\u0648\u0639 \u062a\u063a\u06cc\u06cc\u0631",text_style:"\u0627\u0633\u062a\u06cc\u0644",text_weight:"\u062d\u0627\u0644\u062a",text_size:"\u0627\u0646\u062f\u0627\u0632\u0647",text_font:"\u0642\u0644\u0645",text_props:"\u0645\u062a\u0646",positioning_tab:"\u0645\u0648\u0642\u0639\u06cc\u062a",list_tab:"\u0644\u06cc\u0633\u062a",border_tab:"\u062d\u0627\u0634\u06cc\u0647",box_tab:"\u062c\u0639\u0628\u0647",block_tab:"\u0628\u0644\u0648\u06a9",background_tab:"\u0632\u0645\u06cc\u0646\u0647",text_tab:"\u0645\u062a\u0646",apply:"\u0628\u06a9\u0627\u0631\u06af\u06cc\u0631\u06cc",title:"\u0648\u06cc\u0631\u0627\u06cc\u0634 \u0627\u0633\u062a\u06cc\u0644 CSS",clip:"\u0628\u0631\u0634 (Clip)",placement:"\u0645\u0648\u0642\u0639\u06cc\u062a \u0645\u06a9\u0627\u0646\u06cc",overflow:"\u0633\u0631 \u0631\u06cc\u0632",zindex:"\u0645\u062d\u0648\u0631 Z",visibility:"\u0642\u0627\u0628\u0644\u06cc\u062a \u0631\u0648\u06cc\u062a",positioning_type:"\u0646\u0648\u0639",position:"\u0645\u0648\u0642\u0639\u06cc\u062a",bullet_image:"\u062a\u0635\u0648\u06cc\u0631 \u06af\u0644\u0648\u0644\u0647",list_type:"\u0646\u0648\u0639",color:"\u0631\u0646\u06af",height:"\u0627\u0631\u062a\u0641\u0627\u0639",width:"\u067e\u0647\u0646\u0627",style:"\u0627\u0633\u062a\u06cc\u0644",margin:"\u062d\u0627\u0634\u06cc\u0647",left:"\u0686\u067e",bottom:"\u067e\u0627\u06cc\u06cc\u0646",right:"\u0631\u0627\u0633\u062a",top:"\u0628\u0627\u0644\u0627",same:"\u0647\u0645\u0633\u0627\u0646 \u0628\u0631\u0627\u06cc \u0647\u0645\u0647",padding:"\u0644\u0627\u06cc\u0647 \u06af\u0630\u0627\u0631\u06cc",box_clear:"\u067e\u0627\u06a9 \u0633\u0627\u0632\u06cc",box_float:"\u0634\u0646\u0627\u0648\u0631",box_height:"\u0627\u0631\u062a\u0641\u0627\u0639",box_width:"\u067e\u0647\u0646\u0627",block_display:"\u0646\u0645\u0627\u06cc\u0634",block_whitespace:"\u0641\u0627\u0635\u0644\u0647 \u0633\u0641\u06cc\u062f",block_text_indent:"\u062a\u0648\u0631\u0641\u062a\u06af\u06cc \u0645\u062a\u0646",block_text_align:"\u062a\u0631\u0627\u0632 \u0645\u062a\u0646",block_vertical_alignment:"\u062a\u0631\u0627\u0632 \u0639\u0645\u0648\u062f\u06cc",block_letterspacing:"\u0641\u0627\u0635\u0644\u0647 \u062d\u0631\u0648\u0641",block_wordspacing:"\u0641\u0627\u0635\u0644\u0647 \u06a9\u0644\u0645\u0627\u062a",background_vpos:"\u0645\u0648\u0642\u0639\u06cc\u062a \u0639\u0645\u0648\u062f\u06cc",background_hpos:"\u0645\u0648\u0642\u0639\u06cc\u062a \u0627\u0641\u0642\u06cc",background_attachment:"\u0632\u0645\u06cc\u0645\u0647",background_repeat:"\u062a\u06a9\u0631\u0627\u0631",background_image:"\u062a\u0635\u0648\u06cc\u0631 \u0632\u0645\u06cc\u0646\u0647",background_color:"\u0631\u0646\u06af \u0632\u0645\u06cc\u0646\u0647",text_none:"\u0647\u06cc\u0686 \u06a9\u062f\u0627\u0645",text_blink:"\u0686\u0634\u0645\u06a9 \u0632\u0646",text_case:"\u062d\u0627\u0644\u062a",text_striketrough:"\u062e\u0637 \u0648\u0633\u0637",text_underline:"\u0632\u06cc\u0631 \u062e\u0637",text_overline:"\u0628\u0627\u0644\u0627 \u062e\u0637",text_decoration:"\u0622\u0631\u0627\u06cc\u0634",text_color:"\u0631\u0646\u06af"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/fi_dlg.js b/js/tiny_mce/plugins/style/langs/fi_dlg.js new file mode 100755 index 000000000..02289edc3 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.style_dlg',{text_lineheight:"Rivin korkeus",text_variant:"Variantti",text_style:"Tyyli",text_weight:"Paino",text_size:"Koko",text_font:"Kirjasin",text_props:"Teksti",positioning_tab:"Sijainti",list_tab:"Lista",border_tab:"Kehys",box_tab:"Laatikko",block_tab:"Palkki",background_tab:"Tausta",text_tab:"Teksti",apply:"K\u00e4yt\u00e4",title:"Muokkaa CSS-tyyli\u00e4",clip:"Leike",placement:"Sijoittelu",overflow:"Ylivuoto",zindex:"Z-indeksi",visibility:"N\u00e4kyvyys",positioning_type:"Tyyppi",position:"Sijainti",bullet_image:"Listauskuva",list_type:"Tyyppi",color:"V\u00e4ri",height:"Korkeus",width:"Leveys",style:"Tyyli",margin:"Marginaali",left:"Vasemmalla",bottom:"Alhaalla",right:"Oikealla",top:"Ylh\u00e4\u00e4ll\u00e4",same:"Sama kaikille",padding:"Tyhj\u00e4 tila",box_clear:"Nollaus",box_float:"Kellunta",box_height:"Korkeus",box_width:"Leveys",block_display:"N\u00e4ytt\u00f6",block_whitespace:"Tyhj\u00e4 tila",block_text_indent:"Tekstin sisennys",block_text_align:"Tekstin asettelu",block_vertical_alignment:"Pystyasettelu",block_letterspacing:"Kirjainten v\u00e4listys",block_wordspacing:"Sanojen v\u00e4listys",background_vpos:"Pystyasettelu",background_hpos:"Vaaka-asettelu",background_attachment:"Liite",background_repeat:"Toistuvuus",background_image:"Taustakuva",background_color:"Taustav\u00e4ri",text_none:"ei mit\u00e4\u00e4n",text_blink:"V\u00e4l\u00e4hdys",text_case:"Isot/pienet kirjaimet",text_striketrough:"Yliviivattu",text_underline:"Alleviivattu (Ctrl+U)",text_overline:"Yliviivattu",text_decoration:"Koristelu",text_color:"V\u00e4ri"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/fr_dlg.js b/js/tiny_mce/plugins/style/langs/fr_dlg.js new file mode 100755 index 000000000..16710c6fe --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.style_dlg',{text_lineheight:"Hauteur de ligne",text_variant:"Variante",text_style:"Style",text_weight:"Gras",text_size:"Taille",text_font:"Police",text_props:"Texte",positioning_tab:"Positionnement",list_tab:"Liste",border_tab:"Bordure",box_tab:"Bo\u00eete",block_tab:"Bloc",background_tab:"Fond",text_tab:"Texte",apply:"Appliquer",title:"\u00c9diter la feuille de style",clip:"Clip",placement:"Placement",overflow:"D\u00e9bordement",zindex:"Z-index",visibility:"Visibilit\u00e9",positioning_type:"Type",position:"Position",bullet_image:"Image de puce",list_type:"Type",color:"Couleur",height:"Hauteur",width:"Largeur",style:"Style",margin:"Marge",left:"Gauche",bottom:"Bas",right:"Droit",top:"Haut",same:"Identique pour tous",padding:"Espacement",box_clear:"Vider",box_float:"Flottant",box_height:"Hauteur",box_width:"Largeur",block_display:"Affichage",block_whitespace:"Fin de ligne",block_text_indent:"Indentation du texte",block_text_align:"Alignement du texte",block_vertical_alignment:"Alignement vertical",block_letterspacing:"Espacement des lettres",block_wordspacing:"Espacement des mots ",background_vpos:"Position verticale",background_hpos:"Position horizontale",background_attachment:"Attachement",background_repeat:"R\u00e9p\u00e9ter",background_image:"Image de fond",background_color:"Couleur de fond",text_none:"aucun",text_blink:"clignotant",text_case:"Casse",text_striketrough:"barr\u00e9",text_underline:"soulign\u00e9",text_overline:"ligne au-dessus",text_decoration:"D\u00e9coration",text_color:"Couleur"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/gl_dlg.js b/js/tiny_mce/plugins/style/langs/gl_dlg.js new file mode 100755 index 000000000..0b37ea4e1 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.style_dlg',{text_lineheight:"Ancho da fila",text_variant:"Variante",text_style:"Estilo",text_weight:"Peso",text_size:"Tama\u00f1o",text_font:"Fonte",text_props:"Texto",positioning_tab:"Posici\u00f3n",list_tab:"Lista",border_tab:"Borde",box_tab:"Caixa",block_tab:"Bloque",background_tab:"Fondo",text_tab:"Texto",apply:"Aplicar",title:"Editar Estilo CSS",clip:"Clip",placement:"Colocaci\u00f3n",overflow:"Desbodramento",zindex:"\u00cdndize Z",visibility:"Visibilidade",positioning_type:"Tipo",position:"Posici\u00f3n",bullet_image:"Imaxe da vi\u00f1eta",list_type:"Tipo",color:"Cor",height:"Alto",width:"Ancho",style:"Estilo",margin:"Marxe",left:"Esquerda",bottom:"Abaixo",right:"Dereita",top:"Arriba",same:"O mesmo en todos",padding:"Recheo",box_clear:"Limpar",box_float:"Float",box_height:"Alto",box_width:"Ancho",block_display:"Display",block_whitespace:"Espacio en branco",block_text_indent:"Sangr\u00eda",block_text_align:"Ali\u00f1aci\u00f3n do texto",block_vertical_alignment:"Ali\u00f1aci\u00f3n vertical",block_letterspacing:"Espacio entre letras",block_wordspacing:"Espacio entre verbas",background_vpos:"Posici\u00f3n vertical",background_hpos:"Posici\u00f3n horizontal",background_attachment:"Adxunto",background_repeat:"Repetir",background_image:"Imaxe de fondo",background_color:"Cor de fondo",text_none:"Neng\u00fan",text_blink:"Parpadeo",text_case:"Min\u00fas./May\u00fas.",text_striketrough:"Tachado",text_underline:"Suli\u00f1ado",text_overline:"Li\u00f1a superior",text_decoration:"Decorativos",text_color:"Cor"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/gu_dlg.js b/js/tiny_mce/plugins/style/langs/gu_dlg.js new file mode 100755 index 000000000..0cd6116a7 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/he_dlg.js b/js/tiny_mce/plugins/style/langs/he_dlg.js new file mode 100755 index 000000000..a29c03358 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.style_dlg',{text_lineheight:"\u05d2\u05d5\u05d1\u05d4 \u05e9\u05d5\u05e8\u05d4",text_variant:"Variant",text_style:"\u05e1\u05d2\u05e0\u05d5\u05df",text_weight:"\u05e2\u05d5\u05d1\u05d9",text_size:"\u05d2\u05d5\u05d3\u05dc",text_font:"\u05e4\u05d5\u05e0\u05d8",text_props:"\u05d8\u05e7\u05e1\u05d8",positioning_tab:"\u05de\u05d9\u05e7\u05d5\u05dd",list_tab:"\u05e8\u05e9\u05d9\u05de\u05d4",border_tab:"\u05d2\u05d1\u05d5\u05dc",box_tab:"\u05e7\u05d5\u05e4\u05e1\u05d0",block_tab:"\u05d7\u05e1\u05d5\u05dd",background_tab:"\u05e8\u05e7\u05e2",text_tab:"\u05d8\u05e7\u05e1\u05d8",apply:"\u05d4\u05d7\u05dc",title:"\u05e2\u05d3\u05db\u05d5\u05df \u05d4\u05d2\u05d3\u05e8\u05d5\u05ea CSS",clip:"\u05e7\u05dc\u05d9\u05e4",placement:"\u05de\u05d9\u05e7\u05d5\u05dd",overflow:"\u05d2\u05dc\u05d9\u05e9\u05d4",zindex:"Z-index",visibility:"\u05e8\u05d0\u05d5\u05ea",positioning_type:"\u05e1\u05d5\u05d2",position:"\u05de\u05d9\u05e7\u05d5\u05dd",bullet_image:"Bullet image",list_type:"\u05e1\u05d5\u05d2",color:"\u05e6\u05d1\u05e2",height:"\u05d2\u05d5\u05d1\u05d4",width:"\u05e8\u05d5\u05d7\u05d1",style:"\u05e1\u05d2\u05e0\u05d5\u05df",margin:"\u05e9\u05d5\u05dc\u05d9\u05d9\u05dd",left:"\u05e9\u05de\u05d0\u05dc",bottom:"\u05ea\u05d7\u05ea\u05d9\u05ea",right:"\u05d9\u05de\u05d9\u05df",top:"\u05e2\u05dc\u05d9\u05d5\u05df",same:"\u05d0\u05d5\u05ea\u05d5 \u05d3\u05d1\u05e8 \u05e2\u05d1\u05d5\u05e8 \u05db\u05d5\u05dc\u05dd",padding:"\u05e8\u05d9\u05e4\u05d5\u05d3",box_clear:"\u05e0\u05e7\u05d4",box_float:"\u05d4\u05e6\u05e4\u05d4",box_height:"\u05d2\u05d5\u05d1\u05d4",box_width:"\u05e8\u05d5\u05d7\u05d1",block_display:"\u05d4\u05e6\u05d2",block_whitespace:"\u05e8\u05d5\u05d5\u05d7",block_text_indent:"\u05d4\u05d6\u05d7\u05d4",block_text_align:"\u05de\u05d9\u05e7\u05d5\u05dd \u05d8\u05e7\u05e1\u05d8",block_vertical_alignment:"Vertical alignment",block_letterspacing:"\u05de\u05e8\u05d7\u05e7 \u05d1\u05d9\u05df \u05d0\u05d5\u05ea\u05d9\u05d5\u05ea",block_wordspacing:"\u05de\u05e8\u05d7\u05e7 \u05d1\u05d9\u05df \u05de\u05d9\u05dc\u05d9\u05dd",background_vpos:"\u05de\u05d9\u05e7\u05d5\u05dd \u05e8\u05d5\u05d7\u05d1\u05d9",background_hpos:"\u05de\u05d9\u05e7\u05d5\u05dd \u05d0\u05d5\u05e4\u05e7\u05d9",background_attachment:"\u05e7\u05d1\u05e6\u05d9\u05dd \u05de\u05e6\u05d5\u05e8\u05e4\u05d9\u05dd",background_repeat:"\u05d7\u05d6\u05d5\u05e8",background_image:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2",background_color:"\u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",text_none:"\u05dc\u05dc\u05d0",text_blink:"\u05d4\u05d1\u05d4\u05d5\u05d1",text_case:"Case",text_striketrough:"\u05e7\u05d5 \u05d7\u05d5\u05e6\u05d4",text_underline:"\u05e9\u05d5\u05e8\u05d4 \u05de\u05ea\u05d7\u05ea",text_overline:"\u05e9\u05d5\u05e8\u05d4 \u05de\u05e2\u05dc",text_decoration:"\u05e2\u05d9\u05e6\u05d5\u05d1",text_color:"\u05e6\u05d1\u05e2"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/hi_dlg.js b/js/tiny_mce/plugins/style/langs/hi_dlg.js new file mode 100755 index 000000000..de82f9238 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/hr_dlg.js b/js/tiny_mce/plugins/style/langs/hr_dlg.js new file mode 100755 index 000000000..4fe1faea4 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/hu_dlg.js b/js/tiny_mce/plugins/style/langs/hu_dlg.js new file mode 100755 index 000000000..1915c45e9 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.style_dlg',{"text_lineheight":"Sormagass\u00e1g","text_variant":"V\u00e1ltozat","text_style":"St\u00edlus","text_weight":"Sz\u00e9less\u00e9g","text_size":"M\u00e9ret","text_font":"Bet\u0171t\u00edpus","text_props":"Sz\u00f6veg","positioning_tab":"Poz\u00edci\u00f3","list_tab":"Lista","border_tab":"Keret","box_tab":"Doboz","block_tab":"Blokk","background_tab":"H\u00e1tt\u00e9r","text_tab":"Sz\u00f6veg",apply:"Alkalmaz",title:"CSS st\u00edlus szerkest\u00e9se",clip:"Lev\u00e1g\u00e1s",placement:"Elhelyez\u00e9s",overflow:"Kifut\u00e1s",zindex:"Z-index",visibility:"L\u00e1that\u00f3s\u00e1g","positioning_type":"T\u00edpus",position:"Poz\u00edci\u00f3","bullet_image":"Elemk\u00e9p","list_type":"T\u00edpus",color:"Sz\u00edn",height:"Magass\u00e1g",width:"Sz\u00e9less\u00e9g",style:"St\u00edlus",margin:"Marg\u00f3",left:"Balra",bottom:"Lent",right:"Jobbra",top:"Fel\u00fcl",same:"Mindenhol ugyanaz",padding:"Bels\u0151 marg\u00f3","box_clear":"Lebeg\u00e9s (float) t\u00f6rl\u00e9se","box_float":"Lebeg\u00e9s (float)","box_height":"Magass\u00e1g","box_width":"Sz\u00e9less\u00e9g","block_display":"Megjelen\u00edt\u00e9s","block_whitespace":"\u00dcres helyek","block_text_indent":"Sz\u00f6veg beh\u00faz\u00e1sa","block_text_align":"Sz\u00f6veg igaz\u00edt\u00e1sa","block_vertical_alignment":"F\u00fcgg\u0151leges igaz\u00edt\u00e1s","block_letterspacing":"Bet\u0171t\u00e1vols\u00e1g","block_wordspacing":"Sz\u00f3t\u00e1vols\u00e1g","background_vpos":"F\u00fcgg\u0151leges hely","background_hpos":"V\u00edzszintes hely","background_attachment":"Csatolm\u00e1ny","background_repeat":"Ism\u00e9tl\u00e9s","background_image":"H\u00e1tt\u00e9rk\u00e9p","background_color":"H\u00e1tt\u00e9rsz\u00edn","text_none":"egyik sem","text_blink":"villog\u00e1s","text_case":"eset","text_striketrough":"\u00e1th\u00faz\u00e1s","text_underline":"alulh\u00faz\u00e1s","text_overline":"fel\u00fclh\u00faz\u00e1s","text_decoration":"dekor\u00e1ci\u00f3","text_color":"sz\u00edn"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/hy_dlg.js b/js/tiny_mce/plugins/style/langs/hy_dlg.js new file mode 100755 index 000000000..8e5f689be --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.style_dlg',{text_lineheight:"\u054f\u0578\u0572\u056b \u0562\u0561\u0580\u0571\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576",text_variant:"Variant",text_style:"\u0548\u0573",text_weight:"\u0540\u0561\u057d\u057f\u0578\u0582\u0569\u0575\u0578\u0582\u0576",text_size:"\u0549\u0561\u0583\u057d",text_font:"\u054f\u0561\u057c\u0561\u057f\u0565\u057d\u0561\u056f",text_props:"\u054f\u0565\u0584\u057d\u057f",positioning_tab:"\u054f\u0565\u0572\u0561\u056f\u0561\u0575\u0578\u0582\u0574",list_tab:"\u0551\u0578\u0582\u0581\u0561\u056f",border_tab:"\u0535\u0566\u0580",box_tab:"Box",block_tab:"\u0532\u056c\u0578\u056f",background_tab:"\u0556\u0578\u0576",text_tab:"\u054f\u0565\u0584\u057d\u057f",apply:"\u0540\u0561\u057d\u057f\u0561\u057f\u0565\u056c",title:"CSS \u0578\u0573\u0565\u0580\u056b \u056d\u0574\u0562\u0561\u0563\u0580\u0578\u0582\u0574",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"\u054f\u0565\u057d\u0561\u0576\u0565\u056c\u056b\u0578\u0582\u0569\u0575\u0578\u0582\u0576",positioning_type:"\u054f\u0565\u057d\u0561\u056f",position:"\u0534\u056b\u0580\u0584",bullet_image:"Bullet image",list_type:"\u054f\u0565\u057d\u0561\u056f",color:"\u0533\u0578\u0582\u0575\u0576",height:"\u0532\u0561\u0580\u0571\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576",width:"\u053c\u0561\u0575\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576",style:"\u0548\u0573",margin:"Margin",left:"\u0541\u0561\u056d\u056b\u0581",bottom:"\u0546\u0565\u0580\u0584\u0587\u056b\u0581",right:"\u0531\u057b\u056b\u0581",top:"\u054e\u0565\u0580\u0587\u056b\u0581",same:"\u0544\u056b\u0587\u0576\u0578\u0582\u0575\u0576 \u0561\u0574\u0565\u0576 \u056b\u0576\u0579\u056b \u0570\u0561\u0574\u0561\u0580",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"\u0532\u0561\u0580\u0571\u0580\u0578\u0582\u0569\u0575\u0578\u0582\u0576",box_width:"\u053c\u0561\u0575\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"\u054f\u0565\u0584\u057d\u057f\u056b \u0570\u0561\u057e\u0561\u057d\u0561\u0580\u0565\u0581\u0578\u0582\u0574",block_vertical_alignment:"\u0548\u0582\u0572\u0572\u0561\u0570\u0561\u0575\u0561\u0581 \u0570\u0561\u057e\u0561\u057d\u0561\u0580\u0565\u0581\u0578\u0582\u0574",block_letterspacing:"\u0532\u0561\u0581\u0561\u0580\u056f\u0576\u0565\u0580 \u057f\u0561\u057c\u0565\u0580\u056b \u0574\u056b\u057b\u0587",block_wordspacing:"\u0532\u0561\u0581\u0561\u0580\u056f\u0576\u0565\u0580 \u0562\u0561\u057c\u0565\u0580\u056b \u0574\u056b\u057b\u0587",background_vpos:"\u0548\u0582\u0572\u0572\u0561\u0570\u0561\u0575\u0561\u0581 \u057f\u0565\u0572\u0561\u056f\u0561\u0575\u0578\u0582\u0574",background_hpos:"\u0540\u0578\u0580\u056b\u0566\u0578\u0576\u0561\u056f\u0561\u0576 \u057f\u0565\u0572\u0561\u056f\u0561\u0575\u0578\u0582\u0574",background_attachment:"Attachment",background_repeat:"\u053f\u0580\u056f\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576",background_image:"\u0556\u0578\u0576\u0561\u0575\u056b\u0576 \u0576\u056f\u0561\u0580",background_color:"\u0556\u0578\u0576\u056b \u0563\u0578\u0582\u0575\u0576",text_none:"\u0578\u0579\u056b\u0576\u0579",text_blink:"\u0569\u0561\u0580\u0569\u0578\u0582\u0574\u0576\u0565\u0580",text_case:"Case",text_striketrough:"\u0561\u0580\u057f\u0561\u0563\u056e\u057e\u0561\u056e",text_underline:"\u057d\u057f\u0578\u0580\u056b\u0576 \u0563\u056b\u056e",text_overline:"\u057e\u0565\u0580\u056b\u0576 \u0563\u056b\u056e",text_decoration:"\u0541\u0587\u0561\u057e\u0578\u0580\u0578\u0582\u0574",text_color:"\u0533\u0578\u0582\u0575\u0576"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ia_dlg.js b/js/tiny_mce/plugins/style/langs/ia_dlg.js new file mode 100755 index 000000000..2edb17560 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u53d8\u4f53",text_style:"\u6837\u5f0f",text_weight:"\u5bbd\u5ea6",text_size:"\u5927\u5c0f",text_font:"\u5b57\u4f53",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u8fb9\u6846",box_tab:"\u76d2\u6a21\u578b",block_tab:"\u533a\u5757",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5e94\u7528",title:"\u7f16\u8f91 CSS \u6837\u5f0f\u8868",clip:"\u526a\u8f91",placement:"\u5e03\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z\u5750\u6807",visibility:"\u662f\u5426\u53ef\u89c1",positioning_type:"\u4f4d\u7f6e\u7c7b\u578b",position:"\u56fe\u7247\u4f4d\u7f6e",bullet_image:"\u6e05\u5355\u56fe\u7247",list_type:"\u5217\u8868\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",style:"\u6837\u5f0f",margin:"\u8fb9\u8ddd",left:"\u5de6\u4fa7",bottom:"\u5e95\u90e8",right:"\u53f3\u4fa7",top:"\u9876\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5185\u8fb9\u8ddd",box_clear:"\u6e05\u9664",box_float:"\u6d6e\u52a8",box_height:"\u9ad8\u5ea6",box_width:"\u5bbd\u5ea6",block_display:"\u663e\u793a\u65b9\u5f0f",block_whitespace:"\u7a7a\u683c",block_text_indent:"\u6587\u5b57\u7f29\u8fdb",block_text_align:"\u6587\u5b57\u5bf9\u9f50",block_vertical_alignment:"\u5782\u76f4\u5bf9\u9f50\u65b9\u5f0f",block_letterspacing:"\u5b57\u6bcd\u95f4\u8ddd",block_wordspacing:"\u8bcd\u95f4\u8ddd",background_vpos:"\u5782\u76f4\u4f4d\u7f6e",background_hpos:"\u6c34\u5e73\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u590d",background_image:"\u80cc\u666f\u56fe\u7247",background_color:"\u80cc\u666f\u989c\u8272",text_none:"\u65e0",text_blink:"\u95ea\u70c1",text_case:"\u5b57\u4f53",text_striketrough:"\u4e2d\u5212\u7ebf",text_underline:"\u5e95\u7ebf",text_overline:"\u4e0a\u5212\u7ebf",text_decoration:"\u88c5\u9970",text_color:"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/id_dlg.js b/js/tiny_mce/plugins/style/langs/id_dlg.js new file mode 100755 index 000000000..326756fb9 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ii_dlg.js b/js/tiny_mce/plugins/style/langs/ii_dlg.js new file mode 100755 index 000000000..d6d940cfb --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ii_dlg.js @@ -0,0 +1,63 @@ +tinyMCE.addI18n('ii.style_dlg',{ +title:"\u7F16\u8F91CSS\u6837\u5F0F\u8868", +apply:"\u5E94\u7528", +text_tab:"\u6587\u5B57", +background_tab:"\u80CC\u666F", +block_tab:"\u5757", +box_tab:"\u7BB1\u578B", +border_tab:"\u8FB9\u6846", +list_tab:"\u5217\u8868", +positioning_tab:"\u4F4D\u7F6E", +text_props:"\u6587\u5B57", +text_font:"\u5B57\u4F53", +text_size:"\u5C3A\u5BF8", +text_weight:"\u5BBD\u5EA6", +text_style:"\u6837\u5F0F", +text_variant:"\u53D8\u4F53", +text_lineheight:"\u884C\u9AD8", +text_case:"\u5B57\u4F53", +text_color:"\u989C\u8272", +text_decoration:"\u4FEE\u9970", +text_overline:"\u4E0A\u5212\u7EBF", +text_underline:"\u5E95\u7EBF", +text_striketrough:"\u5220\u9664\u7EBF", +text_blink:"\u95EA\u70C1", +text_none:"\u65E0", +background_color:"\u80CC\u666F\u989C\u8272", +background_image:"\u80CC\u666F\u56FE\u7247", +background_repeat:"\u91CD\u590D", +background_attachment:"\u9644\u4EF6", +background_hpos:"\u5782\u76F4\u4F4D\u7F6E", +background_vpos:"\u6C34\u51C6\u4F4D\u7F6E", +block_wordspacing:"\u5355\u5B57\u95F4\u8DDD", +block_letterspacing:"\u5B57\u5143\u95F4\u8DDD", +block_vertical_alignment:"\u6C34\u51C6\u5BF9\u9F50\u65B9\u5F0F", +block_text_align:"\u6587\u5B57\u5BF9\u9F50", +block_text_indent:"\u6587\u5B57\u7F29\u6392", +block_whitespace:"\u7A7A\u767D", +block_display:"\u663E\u793A\u65B9\u5F0F", +box_width:"\u5BBD\u5EA6", +box_height:"\u9AD8\u5EA6", +box_float:"\u6D6E\u52A8", +box_clear:"\u6E05\u9664", +padding:"\u7559\u767D", +same:"\u5168\u90E8\u4E00\u6837", +top:"\u4E0A\u65B9", +right:"\u9760\u53F3", +bottom:"\u4E0B\u65B9", +left:"\u9760\u5DE6", +margin:"\u8FB9\u754C", +style:"\u6837\u5F0F", +width:"\u5BBD\u5EA6", +height:"\u9AD8\u5EA6", +color:"\u989C\u8272", +list_type:"\u7C7B\u578B", +bullet_image:"\u9879\u76EE\u56FE\u793A", +position:"\u56FE\u793A\u4F4D\u7F6E", +positioning_type:"\u7C7B\u578B", +visibility:"\u53EF\u89C1\u6027", +zindex:"Z\u8F74\u6DF1\u5EA6", +overflow:"\u6EA2\u51FA", +placement:"\u5E03\u7F6E", +clip:"\u526A\u8F91" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/is_dlg.js b/js/tiny_mce/plugins/style/langs/is_dlg.js new file mode 100755 index 000000000..54b974ba9 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/it_dlg.js b/js/tiny_mce/plugins/style/langs/it_dlg.js new file mode 100755 index 000000000..45109f854 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.style_dlg',{text_lineheight:"Altezza linea",text_variant:"Variante",text_style:"Stile",text_weight:"Spessore",text_size:"Dimensione",text_font:"Carattere",text_props:"Testo",positioning_tab:"Posizionamento",list_tab:"Liste",border_tab:"Bordi",box_tab:"Contenitore",block_tab:"Blocco",background_tab:"Sfondo",text_tab:"Testo",apply:"Applica",title:"Modifica stile CSS",clip:"Clip",placement:"Piazzamento",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilit\u00e0",positioning_type:"Tipo",position:"Posizione",bullet_image:"Immagine Punto",list_type:"Tipo",color:"Colore",height:"Altezza",width:"Larghezza",style:"Stile",margin:"Margine",left:"Sinistro",bottom:"Inferiore",right:"Destro",top:"Superiore",same:"Uguale per tutti",padding:"Spazio dal bordo",box_clear:"Pulito",box_float:"Fluttuante",box_height:"Altezza",box_width:"Larghezza",block_display:"Visualizzazione",block_whitespace:"Whitespace",block_text_indent:"Indentazione testo",block_text_align:"Allineamento testo",block_vertical_alignment:"Allineamento verticale",block_letterspacing:"Spaziatura caratteri",block_wordspacing:"Spaziatura parole",background_vpos:"Posizione verticale",background_hpos:"Posizione orizzontale",background_attachment:"Allegato",background_repeat:"Repetizione",background_image:"Immagine sfondo",background_color:"Colore sfondo",text_none:"nessuna",text_blink:"lampeggiante",text_case:"Tipo",text_striketrough:"barrato",text_underline:"sottolineato",text_overline:"sopralineato",text_decoration:"Decorazione",text_color:"Colore"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ja_dlg.js b/js/tiny_mce/plugins/style/langs/ja_dlg.js new file mode 100755 index 000000000..700f19489 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.style_dlg',{"text_lineheight":"\u884c\u9ad8\u3055","text_variant":"\u5909\u5f62","text_style":"\u30b9\u30bf\u30a4\u30eb","text_weight":"\u592a\u3055","text_size":"\u30b5\u30a4\u30ba","text_font":"\u30d5\u30a9\u30f3\u30c8","text_props":"Text","positioning_tab":"\u30dd\u30b8\u30b7\u30e7\u30f3","list_tab":"\u30ea\u30b9\u30c8","border_tab":"\u67a0\u7dda","box_tab":"\u30dc\u30c3\u30af\u30b9","block_tab":"\u30d6\u30ed\u30c3\u30af","background_tab":"\u80cc\u666f","text_tab":"\u6587\u5b57",apply:"\u9069\u7528",title:"CSS\u7de8\u96c6",clip:"\u5207\u308a\u629c\u304d",placement:"\u4f4d\u7f6e",overflow:"\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc",zindex:"Z-Index",visibility:"\u8868\u793a","positioning_type":"\u914d\u7f6e\u65b9\u6cd5",position:"\u30de\u30fc\u30ab\u30fc\u8868\u793a\u4f4d\u7f6e","bullet_image":"\u30de\u30fc\u30ab\u30fc\u753b\u50cf","list_type":"\u30de\u30fc\u30ab\u30fc\u7a2e\u985e",color:"\u8272",height:"\u9ad8\u3055",width:"\u5e45",style:"\u30b9\u30bf\u30a4\u30eb",margin:"\u30de\u30fc\u30b8\u30f3",left:"\u5de6",bottom:"\u4e0b",right:"\u53f3",top:"\u4e0a",same:"\u5168\u3066\u540c\u3058\u306b\u3059\u308b",padding:"\u30d1\u30c7\u30a3\u30f3\u30b0","box_clear":"\u56de\u308a\u8fbc\u307f\u89e3\u9664","box_float":"\u56de\u308a\u8fbc\u307f","box_height":"\u9ad8\u3055","box_width":"\u5e45","block_display":"\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4","block_whitespace":"\u7a7a\u767d\u6587\u5b57","block_text_indent":"\u30a4\u30f3\u30c7\u30f3\u30c8","block_text_align":"\u6c34\u5e73\u914d\u7f6e","block_vertical_alignment":"\u5782\u76f4\u914d\u7f6e","block_letterspacing":"\u6587\u5b57\u9593\u9694","block_wordspacing":"\u5358\u8a9e\u611f\u899a","background_vpos":"\u5782\u76f4\u4f4d\u7f6e","background_hpos":"\u6c34\u5e73\u4f4d\u7f6e","background_attachment":"Attachment","background_repeat":"\u7e70\u308a\u8fd4\u3057","background_image":"\u80cc\u666f\u753b\u50cf","background_color":"\u80cc\u666f\u8272","text_none":"\u306a\u3057","text_blink":"\u70b9\u6ec5","text_case":"\u5927\u6587\u5b57/\u5c0f\u6587\u5b57","text_striketrough":"\u6253\u6d88\u3057\u7dda","text_underline":"\u4e0b\u7dda","text_overline":"\u4e0a\u7dda","text_decoration":"\u88c5\u98fe","text_color":"\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ka_dlg.js b/js/tiny_mce/plugins/style/langs/ka_dlg.js new file mode 100755 index 000000000..6d2acf423 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.style_dlg',{text_lineheight:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d8\u10e1 \u10e1\u10d8\u10db\u10d0\u10e6\u10da\u10d4",text_variant:"\u10d5\u10d0\u10e0\u10d8\u10d0\u10dc\u10e2\u10d8",text_style:"\u10e1\u10e2\u10d8\u10da\u10d8",text_weight:"\u10e1\u10d8\u10e1\u10e5\u10d4",text_size:"\u10d6\u10dd\u10db\u10d0",text_font:"\u10e8\u10e0\u10d8\u10e4\u10e2\u10d8",text_props:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8",positioning_tab:"\u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10dd\u10dc\u10d8\u10e0\u10d4\u10d1\u10d0",list_tab:"\u10e1\u10d8\u10d0",border_tab:"\u10e1\u10d0\u10d6\u10e6\u10d5\u10d0\u10e0\u10d8",box_tab:"\u10d9\u10d8\u10d3\u10d4\u10d4\u10d1\u10d8",block_tab:"\u10d1\u10da\u10dd\u10d9\u10d8",background_tab:"\u10e4\u10dd\u10dc\u10d8",text_tab:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8",apply:"\u10d2\u10d0\u10db\u10dd\u10d5\u10d8\u10e7\u10d4\u10dc\u10dd\u10d7",title:"CSS \u10e1\u10e2\u10d8\u10da\u10d8\u10e1 \u10e0\u10d4\u10d3\u10d0\u10e5\u10e2\u10dd\u10e0\u10d8",clip:"\u10db\u10dd\u10d9\u10d5\u10d4\u10d7\u10d0",placement:"\u10d2\u10d0\u10dc\u10d7\u10d0\u10d5\u10e1\u10d4\u10d1\u10d0",overflow:"\u10d2\u10d0\u10d3\u10d0\u10d5\u10e1\u10d4\u10d1\u10d0",zindex:"Z-\u10d8\u10dc\u10d3\u10d4\u10e5\u10e1\u10d8",visibility:"\u10ee\u10d8\u10da\u10d5\u10d0\u10d3\u10dd\u10d1\u10d0",positioning_type:"\u10e2\u10d8\u10de\u10d8",position:"\u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10d0",bullet_image:"\u10db\u10d0\u10e0\u10d9\u10d4\u10e0\u10d8",list_type:"\u10e2\u10d8\u10de\u10d8",color:"\u10e4\u10d4\u10e0\u10d8",height:"\u10e1\u10d8\u10db\u10d0\u10e6\u10da\u10d4",width:"\u10e1\u10d8\u10d2\u10d0\u10dc\u10d4",style:"\u10e1\u10e2\u10d8\u10da\u10d8",margin:"\u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d5",bottom:"\u10e5\u10d5\u10d4\u10db\u10dd\u10d7",right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d5",top:"\u10d6\u10d4\u10db\u10dd\u10d7",same:"\u10e7\u10d5\u10d4\u10da\u10d0\u10e1\u10d7\u10d5\u10d8\u10e1 \u10d4\u10e0\u10d7\u10dc\u10d0\u10d4\u10e0\u10d0\u10d3",padding:"\u10db\u10d8\u10dc\u10d3\u10d5\u10e0\u10d4\u10d1\u10d8",box_clear:"\u10db\u10dd\u10e1\u10e3\u10e4\u10d7\u10d0\u10d5\u10d4\u10d1\u10d0",box_float:"\u10db\u10dd\u10ea\u10e3\u10e0\u10d0\u10d5\u10d4",box_height:"\u10e1\u10d8\u10db\u10d0\u10e6\u10da\u10d4",box_width:"\u10e1\u10d8\u10d2\u10d0\u10dc\u10d4",block_display:"\u10d0\u10e1\u10d0\u10ee\u10d5\u10d0",block_whitespace:"\u10e1\u10d8\u10d5\u10e0\u10ea\u10d4",block_text_indent:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",block_text_align:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",block_vertical_alignment:"\u10d5\u10d4\u10e0\u10e2\u10d8\u10d9\u10d0\u10da\u10e3\u10e0\u10d8 \u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",block_letterspacing:"\u10d0\u10e1\u10dd\u10d4\u10d1\u10e1 \u10e8\u10dd\u10e0\u10d8\u10e1 \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",block_wordspacing:"\u10e1\u10d8\u10e2\u10e7\u10d5\u10d4\u10d1\u10e1 \u10e8\u10dd\u10e0\u10d8\u10e1 \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",background_vpos:"\u10d5\u10d4\u10e0\u10e2\u10d8\u10d9\u10d0\u10da\u10e3\u10e0\u10d8 \u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10d0",background_hpos:"\u10f0\u10dd\u10e0\u10d8\u10d6\u10dd\u10dc\u10e2\u10d0\u10da\u10e3\u10e0\u10d8 \u10de\u10dd\u10d6\u10d8\u10ea\u10d8\u10d0",background_attachment:"\u10db\u10d8\u10d1\u10db\u10d0",background_repeat:"\u10d2\u10d0\u10db\u10d4\u10dd\u10e0\u10d4\u10d1\u10d0",background_image:"\u10e4\u10dd\u10dc\u10d8\u10e1 \u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d4\u10d1\u10d0",background_color:"\u10e4\u10dd\u10dc\u10d8\u10e1 \u10e4\u10d4\u10e0\u10d8",text_none:"\u10e7\u10d5\u10d4\u10da\u10d0\u10e4\u10e0\u10d8\u10e1 \u10d2\u10d0\u10e0\u10d4\u10e8\u10d4",text_blink:"\u10db\u10dd\u10ea\u10d8\u10db\u10ea\u10d8\u10db\u10d4",text_case:"\u10e0\u10d4\u10d2\u10d8\u10e1\u10e2\u10e0\u10d8",text_striketrough:"\u10d2\u10d0\u10d3\u10d0\u10ee\u10d0\u10d6\u10e3\u10da\u10d8",text_underline:"\u10db\u10dd\u10ee\u10d0\u10d6\u10e3\u10da\u10d8",text_overline:"\u10d6\u10d4\u10d3\u10d0 \u10ee\u10d0\u10d6\u10d8\u10d7",text_decoration:"\u10d2\u10d0\u10e4\u10dd\u10e0\u10db\u10d4\u10d1\u10d0",text_color:"\u10e4\u10d4\u10e0\u10d8"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/kl_dlg.js b/js/tiny_mce/plugins/style/langs/kl_dlg.js new file mode 100755 index 000000000..eef4f01c3 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/km_dlg.js b/js/tiny_mce/plugins/style/langs/km_dlg.js new file mode 100755 index 000000000..479a159fe --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.style_dlg',{text_lineheight:"\u1780\u1798\u17d2\u1796\u179f\u17cb\u1787\u17bd\u179a",text_variant:"\u1780\u17c6\u179b\u17b6\u1799",text_style:"\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798",text_weight:"\u1780\u1798\u17d2\u179a\u17b6\u179f\u17cb",text_size:"\u1791\u17c6\u17a0\u17c6",text_font:"\u1796\u17bb\u1798\u17d2\u1796\u17a2\u1780\u17d2\u179f\u179a",text_props:"\u17a2\u178f\u17d2\u1790\u1794\u1791",positioning_tab:"\u1780\u17b6\u179a\u1780\u17c6\u178e\u178f\u17cb\u1791\u17b8\u178f\u17b6\u17c6\u1784",list_tab:"\u1794\u1789\u17d2\u1787\u17b8",border_tab:"\u179f\u17ca\u17bb\u1798",box_tab:"\u1794\u17d2\u179a\u17a2\u1794\u17cb",block_tab:"\u1794\u17d2\u179b\u17bb\u1780",background_tab:"\u1795\u17d2\u1791\u17c2\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",text_tab:"\u17a2\u178f\u17d2\u1790\u1794\u1791",apply:"\u17a2\u1793\u17bb\u179c\u178f\u17d2\u178f",title:"\u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798 CSS",clip:"\u178f\u1798\u17d2\u1794\u17c0\u178f\u1781\u17d2\u1791\u17b6\u179f\u17cb",placement:"\u1780\u17b6\u179a\u178a\u17b6\u1780\u17cb",overflow:"\u179b\u17be\u179f\u1785\u17c6\u178e\u17bb\u17c7",zindex:"\u17a2\u17d0\u1780\u17d2\u179f Z",visibility:"\u1797\u17b6\u1796\u17a2\u17b6\u1785\u1798\u17be\u179b\u1783\u17be\u1789",positioning_type:"\u1794\u17d2\u179a\u1797\u17c1\u1791",position:"\u1791\u17b8\u178f\u17b6\u17c6\u1784",bullet_image:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1785\u17c6\u178e\u17bb\u1785",list_type:"\u1794\u17d2\u179a\u1797\u17c1\u1791",color:"\u1796\u178e\u17cc",height:"\u1780\u1798\u17d2\u1796\u179f\u17cb",width:"\u1791\u1791\u17b9\u1784",style:"\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798",margin:"\u179a\u17b9\u1798",left:"\u1786\u17d2\u179c\u17c1\u1784",bottom:"\u1794\u17b6\u178f",right:"\u179f\u17d2\u178a\u17b6\u17c6",top:"\u1780\u17c6\u1796\u17bc\u179b",same:"\u178f\u17bc\u1785\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb",padding:"\u1785\u1793\u17d2\u179b\u17c4\u17c7",box_clear:"\u179f\u17c6\u17a2\u17b6\u178f",box_float:"\u17a2\u178e\u17d2\u178a\u17c2\u178f",box_height:"\u1780\u1798\u17d2\u1796\u179f\u17cb",box_width:"\u1791\u1791\u17b9\u1784",block_display:"\u1794\u1784\u17d2\u17a0\u17b6\u1789",block_whitespace:"\u1791\u1791\u17c1\u179f\u17d2\u17a2\u17b6\u178f",block_text_indent:"\u1785\u17bc\u179b\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u17a2\u178f\u17d2\u1790\u1794\u1791",block_text_align:"\u178f\u1798\u17d2\u179a\u17b9\u1798\u17a2\u178f\u17d2\u1790\u1794\u1791",block_vertical_alignment:"\u178f\u1798\u17d2\u179a\u17b9\u1798\u1794\u1789\u17d2\u1788\u179a",block_letterspacing:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u17a2\u1780\u17d2\u179f\u179a",block_wordspacing:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1796\u17b6\u1780\u17d2\u1799",background_vpos:"\u1791\u17b8\u178f\u17b6\u17c6\u1784\u1794\u1789\u17d2\u1788\u179a",background_hpos:"\u1791\u17b8\u178f\u17b6\u17c6\u1784\u1795\u17d2\u178a\u17c1\u1780",background_attachment:"\u17af\u1780\u179f\u17b6\u179a\u1797\u17d2\u1787\u17b6\u1794\u17cb",background_repeat:"\u1792\u17d2\u179c\u17be\u1798\u17d2\u178a\u1784\u1791\u17c0\u178f",background_image:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1795\u17d2\u1791\u17c3\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",background_color:"\u1796\u178e\u17cc\u1795\u17d2\u1791\u17c3\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",text_none:"\u1782\u17d2\u1798\u17b6\u1793",text_blink:"\u1797\u17d2\u179b\u17b9\u1794\u1797\u17d2\u179b\u17c2\u178f",text_case:"\u1780\u179a\u178e\u17b8",text_striketrough:"\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u1786\u17bc\u178f",text_underline:"\u1782\u17bc\u179f\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u1780\u17d2\u179a\u17c4\u1798",text_overline:"\u1782\u17bc\u179f\u1794\u1793\u17d2\u1791\u17b6\u178f\u17cb\u179b\u17be",text_decoration:"\u1780\u17b6\u179a\u178f\u17bb\u1794\u178f\u17c2\u1784",text_color:"\u1796\u178e\u17cc"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ko_dlg.js b/js/tiny_mce/plugins/style/langs/ko_dlg.js new file mode 100755 index 000000000..05cd8362e --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.style_dlg',{text_lineheight:"\ud589 \ub192\uc774",text_variant:"Variant",text_style:"\uc2a4\ud0c0\uc77c",text_weight:"\uad75\uae30",text_size:"\ud06c\uae30",text_font:"\ud3f0\ud2b8",text_props:"\ud14d\uc2a4\ud2b8",positioning_tab:"\uc704\uce58",list_tab:"\ub9ac\uc2a4\ud2b8",border_tab:"\ud14c\ub450\ub9ac\uc120",box_tab:"\ubc15\uc2a4",block_tab:"\ube14\ub85d",background_tab:"\ubc30\uacbd",text_tab:"\ud14d\uc2a4\ud2b8",apply:"\uc801\uc6a9",title:"CSS\ud3b8\uc9d1",clip:"Clip",placement:"\uc704\uce58(placement)",overflow:"\uc624\ubc84\ud50c\ub85c\uc6b0",zindex:"Z-index",visibility:"\uac00\uc2dc\uc131",positioning_type:"\ud0c0\uc785",position:"\uc704\uce58",bullet_image:"\ube14\ub9bf \uc774\ubbf8\uc9c0",list_type:"\ubaa9\ub85d\uc885\ub958",color:"\uc0c9",height:"\ub192\uc774",width:"\ud3ed",style:"\uc2a4\ud0c0\uc77c",margin:"\ub9c8\uc9c4",left:"\uc88c",bottom:"\ud558",right:"\uc6b0",top:"\uc0c1",same:"\ubaa8\ub450 \ub611\uac19\uc774",padding:"padding",box_clear:"Clear",box_float:"float",box_height:"\ub192\uc774",box_width:"\ud3ed",block_display:"\ud45c\uc2dc",block_whitespace:"\uacf5\ubc31 \ubb38\uc790",block_text_indent:"\ub4e4\uc5ec\uc4f0\uae30",block_text_align:"\ud14d\uc2a4\ud2b8 \uc815\ub82c",block_vertical_alignment:"\uc218\uc9c1 \uc704\uce58",block_letterspacing:"\ubb38\uc790 \uac04\uaca9",block_wordspacing:"\ub2e8\uc5b4 \uac04\uaca9",background_vpos:"\uc218\uc9c1 \uc704\uce58",background_hpos:"\uc218\ud3c9 \uc704\uce58",background_attachment:"\ucca8\ubd80",background_repeat:"\ubc18\ubcf5",background_image:"\ubc30\uacbd \uc774\ubbf8\uc9c0",background_color:"\ubc30\uacbd\uc0c9",text_none:"\uc5c6\uc74c",text_blink:"\uc810\uba78",text_case:"\ub300/\uc18c\ubb38\uc790",text_striketrough:"\ucde8\uc18c\uc120",text_underline:"\ubc11\uc904",text_overline:"\uc717\uc904",text_decoration:"\uc7a5\uc2dd",text_color:"\uc0c9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/lb_dlg.js b/js/tiny_mce/plugins/style/langs/lb_dlg.js new file mode 100755 index 000000000..56009130c --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.style_dlg',{text_lineheight:"Zeilenh\u00e9icht",text_variant:"Variant",text_style:"Stil",text_weight:"D\u00e9ckt",text_size:"Gr\u00e9isst",text_font:"Schr\u00ebftaart",text_props:"Text",positioning_tab:"Position\u00e9ierung",list_tab:"L\u00ebscht",border_tab:"Rumm",box_tab:"Box",block_tab:"Block",background_tab:"Hannergrond",text_tab:"Text",apply:"Iwwerhuelen",title:"CSS-Styles beaarbechten",clip:"Ausschn\u00ebtt",placement:"Plaz\u00e9ierung",overflow:"Verhale bei Iwwergr\u00e9isst",zindex:"Z-W\u00e4ert",visibility:"Siichtbar",positioning_type:"Aart vun der Position\u00e9ierung",position:"Position\u00e9ierung",bullet_image:"L\u00ebschtepunkt-Grafik",list_type:"L\u00ebschtepunkt-Aart",color:"Textfuerf",height:"H\u00e9icht",width:"Breet",style:"Format",margin:"Baussechten Ofstand",left:"L\u00e9nks",bottom:"\u00cbnnen",right:"Riets",top:"Uewen",same:"All selwecht",padding:"Banneschten Ofstand",box_clear:"\u00cbmfl\u00e9issung verh\u00ebnneren",box_float:"\u00cbmfl\u00e9issung",box_height:"H\u00e9icht",box_width:"Breet",block_display:"\u00cbmbrochverhalen",block_whitespace:"Automateschen \u00cbmbroch",block_text_indent:"Ar\u00e9ckung",block_text_align:"Ausriichtung",block_vertical_alignment:"Vertikal Ausriichtung",block_letterspacing:"Buschtawenofstand",block_wordspacing:"Wuertofstand",background_vpos:"Positioun Y",background_hpos:"Positioun X",background_attachment:"Waasserzeecheneffekt",background_repeat:"Widderhuelung",background_image:"Hannergrondbild",background_color:"Hannergrondfuerf",text_none:"keng",text_blink:"bl\u00ebnkend",text_case:"Schreiwung",text_striketrough:"duerchgestrach",text_underline:"\u00ebnnerstrach",text_overline:"iwwerstrach",text_decoration:"Gestaltung",text_color:"Fuerf"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/lt_dlg.js b/js/tiny_mce/plugins/style/langs/lt_dlg.js new file mode 100755 index 000000000..06cb8500e --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.style_dlg',{text_lineheight:"Eilut\u0117s auk\u0161tis",text_variant:"Variantas",text_style:"Stilius",text_weight:"Storis",text_size:"Dydis",text_font:"\u0160riftas",text_props:"Tekstas",positioning_tab:"Pozicionavimas",list_tab:"S\u0105ra\u0161as",border_tab:"R\u0117melis",box_tab:"D\u0117\u017eut\u0117",block_tab:"Blokas",background_tab:"Fonas",text_tab:"Tekstas",apply:"Taikyti",title:"Redaguoti CSS stili\u0173",clip:"\u012era\u0161as",placement:"Talpinimas",overflow:"Perpildymas",zindex:"Z-indeksas",visibility:"Matomumas",positioning_type:"Tipas",position:"Pozicija",bullet_image:"\u017denklelio paveiksl\u0117lis",list_type:"Tipas",color:"Spalva",height:"Auk\u0161tis",width:"Ilgis",style:"Stilius",margin:"Para\u0161t\u0117",left:"Kair\u0117je",bottom:"Apa\u010dioje",right:"De\u0161in\u0117je",top:"Vir\u0161uje",same:"Tas pats visiems",padding:"U\u017epildymas",box_clear:"I\u0161valyti",box_float:"Slankus",box_height:"Auk\u0161tis",box_width:"Ilgis",block_display:"Rodymas",block_whitespace:"Tarpai",block_text_indent:"Teksto atitraukimas",block_text_align:"Teksto lygiavimas",block_vertical_alignment:"Vertikalus lygiavimas",block_letterspacing:"Tarpai tarp raid\u017ei\u0173",block_wordspacing:"Tarpai tarp \u017eod\u017ei\u0173",background_vpos:"Vertikali pozicija",background_hpos:"Horizontali pozicija",background_attachment:"Priedas",background_repeat:"Kartoti",background_image:"Fono paveiksl\u0117lis",background_color:"Fono spalva",text_none:"joks",text_blink:"mirks\u0117jimas",text_case:"Ma\u017eosios/did\u017eiosios raid\u0117s",text_striketrough:"perbraukta",text_underline:"pabraukta apa\u010dioje",text_overline:"pabraukta vir\u0161uje",text_decoration:"Dekoracija",text_color:"Spalva"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/lv_dlg.js b/js/tiny_mce/plugins/style/langs/lv_dlg.js new file mode 100755 index 000000000..c3a3b5c0c --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Klips",placement:"Izvietojums",overflow:"P\u0101rm\u0113rs",zindex:"Z-index",visibility:"Redzam\u012bba",positioning_type:"Tips",position:"Poz\u012bcija",bullet_image:"Bullet bilde",list_type:"Tips",color:"Kr\u0101sa",height:"Augstums",width:"Platums",style:"St\u012bls",margin:"Mala",left:"Pa kreisi",bottom:"Apak\u0161a",right:"Pa labi",top:"Aug\u0161a",same:"Same for all",padding:"Atstarpe",box_clear:"Clear",box_float:"Float",box_height:"Augstums",box_width:"Platums",block_display:"Display",block_whitespace:"Tuk\u0161ais laukums",block_text_indent:"\u00c9crit indent",block_text_align:"Teksta izl\u012bdzin\u0101jums",block_vertical_alignment:"Vertik\u0101lais izl\u012bdzin\u0101jums",block_letterspacing:"Burtu atstarpe",block_wordspacing:"V\u0101rdu atstarpe",background_vpos:"Vertik\u0101l\u0101 poz\u012bcija",background_hpos:"Horizont\u0101l\u0101 poz\u012bcija",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/mk_dlg.js b/js/tiny_mce/plugins/style/langs/mk_dlg.js new file mode 100755 index 000000000..00b5428fa --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ml_dlg.js b/js/tiny_mce/plugins/style/langs/ml_dlg.js new file mode 100755 index 000000000..c56213510 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/mn_dlg.js b/js/tiny_mce/plugins/style/langs/mn_dlg.js new file mode 100755 index 000000000..3ac2a8cc7 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.style_dlg',{text_lineheight:"\u041c\u04e9\u0440\u043d\u0438\u0439 \u04e9\u043d\u0434\u04e9\u0440",text_variant:"\u0412\u0430\u0440\u0438\u0430\u043d\u0442",text_style:"\u0425\u044d\u043b\u0431\u044d\u0440",text_weight:"\u04e8\u0440\u0433\u04e9\u043d \u043d\u0430\u0440\u0438\u0439\u043d",text_size:"\u0425\u044d\u043c\u0436\u044d\u044d",text_font:"\u0424\u043e\u043d\u0442",text_props:"\u0411\u0438\u0447\u0432\u044d\u0440",positioning_tab:"\u0411\u0430\u0439\u0440\u0448\u0438\u043b",list_tab:"\u0416\u0430\u0433\u0441\u0430\u0430\u043b\u0442",border_tab:"\u0425\u04af\u0440\u044d\u044d",box_tab:"\u0425\u0430\u0439\u0440\u0446\u0430\u0433",block_tab:"\u0411\u043b\u043e\u043a",background_tab:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440",text_tab:"\u0411\u0438\u0447\u0432\u044d\u0440",apply:"\u0425\u044d\u0440\u044d\u0433\u043b\u044d\u0445",title:"CSS-Styles \u0437\u0430\u0441\u0432\u0430\u0440\u043b\u0430\u0445",clip:"\u0422\u0430\u0439\u0440\u0434\u0430\u0441",placement:"\u0411\u0430\u0439\u0440\u0448\u0438\u043b",overflow:"\u0425\u044d\u0442\u044d\u0440\u0441\u044d\u043d \u0445\u044d\u043c\u0436\u044d\u044d\u043d\u0438\u0439 \u0445\u0430\u0440\u044c\u0446\u0430\u0430",zindex:"Z \u0443\u0442\u0433\u0430",visibility:"\u0425\u0430\u0440\u0430\u0433\u0434\u0430\u0445\u0443\u0439\u0446",positioning_type:"\u0411\u0430\u0439\u0440\u0448\u043b\u044b\u043d \u0442\u04e9\u0440\u04e9\u043b",position:"\u0411\u0430\u0439\u0440\u0448\u0438\u043b",bullet_image:"\u0413\u0440\u0430\u0444\u0438\u043a \u0442\u043e\u043e\u0447\u0438\u043b\u0442\u044b\u043d \u0446\u044d\u0433",list_type:"\u0422\u043e\u043e\u0447\u0438\u043b\u0442\u044b\u043d \u0446\u044d\u0433\u0438\u0439\u043d \u0445\u044d\u043b\u0431\u044d\u0440",color:"\u0411\u0438\u0447\u0432\u044d\u0440\u0438\u0439\u043d \u04e9\u043d\u0433\u04e9",height:"\u04e8\u043d\u0434\u04e9\u0440",width:"\u04e8\u0440\u0433\u04e9\u043d",style:"\u0424\u043e\u0440\u043c\u0430\u0442",margin:"\u0413\u0430\u0434\u0430\u0430\u0434 \u0437\u0430\u0439",left:"\u0417\u04af\u04af\u043d",bottom:"\u0414\u043e\u043e\u0440",right:"\u0411\u0430\u0440\u0443\u0443\u043d",top:"\u0414\u044d\u044d\u0440",same:"\u0411\u04af\u0433\u0434 \u0438\u0436\u0438\u043b",padding:"\u0414\u043e\u0442\u043e\u043e\u0434 \u0437\u0430\u0439",box_clear:"\u0413\u04af\u0439\u043b\u0433\u044d\u043b\u0442 \u0445\u0430\u0430\u0445",box_float:"\u0413\u04af\u0439\u043b\u0433\u044d\u043b\u0442",box_height:"\u04e8\u043d\u0434\u04e9\u0440",box_width:"\u04e8\u0440\u0433\u04e9\u043d",block_display:"\u041e\u0440\u043e\u043e\u0445 \u0445\u044d\u043b\u0431\u044d\u0440",block_whitespace:"\u0410\u0432\u0442\u043e\u043c\u0430\u0442 \u043c\u04e9\u0440 \u043e\u0440\u043e\u043e\u043b\u0442",block_text_indent:"\u0414\u043e\u0433\u043e\u043b \u043c\u04e9\u0440",block_text_align:"\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",block_vertical_alignment:"\u0411\u043e\u0441\u043e\u043e \u0436\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",block_letterspacing:"\u04ae\u0441\u044d\u0433 \u0445\u043e\u043e\u0440\u043e\u043d\u0434\u044b\u043d \u0437\u0430\u0439",block_wordspacing:"\u04ae\u0433 \u0445\u043e\u043e\u0440\u043e\u043d\u0434\u044b\u043d \u0437\u0430\u0439",background_vpos:"\u0411\u0430\u0439\u0440\u043b\u0430\u043b Y",background_hpos:"\u0411\u0430\u0439\u0440\u043b\u0430\u043b X",background_attachment:"\u0423\u0441\u0430\u043d \u0442\u044d\u043c\u0434\u0433\u0438\u0439\u043d \u044d\u0444\u0444\u0435\u043a\u0442",background_repeat:"\u0414\u0430\u0432\u0442\u0430\u043b\u0442",background_image:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440 \u0437\u0443\u0440\u0430\u0433",background_color:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440 \u04e9\u043d\u0433\u04e9",text_none:"\u0431\u0430\u0439\u0445\u0433\u04af\u0439",text_blink:"\u0430\u043d\u0438\u0432\u0447\u0438\u043b\u0442",text_case:"\u0411\u0438\u0447\u0432\u044d\u0440",text_striketrough:"\u0434\u0430\u0440\u0441\u0430\u043d",text_underline:"\u0434\u043e\u043e\u0433\u0443\u0443\u0440 \u043d\u044c \u0437\u0443\u0440\u0441\u0430\u043d",text_overline:"\u0434\u044d\u044d\u0433\u04af\u04af\u0440 \u043d\u044c \u0437\u0443\u0440\u0441\u0430\u043d",text_decoration:"\u0427\u0438\u043c\u044d\u0433\u043b\u044d\u043b",text_color:"\u04e8\u043d\u0433\u04e9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ms_dlg.js b/js/tiny_mce/plugins/style/langs/ms_dlg.js new file mode 100755 index 000000000..deea226cd --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.style_dlg',{text_lineheight:"Tinggi garisan",text_variant:"Varian",text_style:"Gaya",text_weight:"Beban",text_size:"Saiz",text_font:"Huruf",text_props:"Teks",positioning_tab:"Kedudukan",list_tab:"Senarai",border_tab:"Sempadan",box_tab:"Kotak",block_tab:"Landasan",background_tab:"Latar belakang",text_tab:"Teks",apply:"Guna",title:"Sunting Gaya CSS",clip:"Klip",placement:"Penempatan",overflow:"Limpahan",zindex:"Indeks-Z",visibility:"Kelihatan",positioning_type:"Jenis",position:"Posisi",bullet_image:"Imej peluru",list_type:"Jenis",color:"Warna",height:"Tinggi",width:"Lebar",style:"Gaya",margin:"Ruangan tepi",left:"Kiri",bottom:"Bawah",right:"Kanan",top:"Atas",same:"Samakan kesemuanya",padding:"Lapisan",box_clear:"Ruangan jelas",box_float:"Apungan",box_height:"Tinggi",box_width:"Lebar",block_display:"Pamer",block_whitespace:"Ruangan putih",block_text_indent:"Takukan teks",block_text_align:"Penjajaran teks",block_vertical_alignment:"Penjajaran tegak",block_letterspacing:"Jarak huruf",block_wordspacing:"Jarak perkataan",background_vpos:"Posisi tegak",background_hpos:"Posisi mengufuk",background_attachment:"Sisipan",background_repeat:"Ulangan",background_image:"Imej Latar",background_color:"Warna Latar",text_none:"tiada",text_blink:"kelip",text_case:"Kes",text_striketrough:"garis tengah",text_underline:"garis bawah",text_overline:"garis atas",text_decoration:"Dekorasi",text_color:"Warna"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/my_dlg.js b/js/tiny_mce/plugins/style/langs/my_dlg.js new file mode 100755 index 000000000..06ff3d272 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.style_dlg',{text_lineheight:"\u1005\u102c\u1031\u103c\u1000\u102c\u1004\u103a\u1038 \u1021\u103c\u1019\u1004\u103a\u1037",text_variant:"\u1015\u1036\u102f\u1005\u1036\u1000\u103d\u1032",text_style:"\u1005\u102c\u101c\u1036\u102f\u1038 \u1005\u1010\u102d\u102f\u1004\u103a",text_weight:"\u1005\u102c\u101c\u1036\u102f\u1038 \u1021\u1011\u1030\u1021\u1015\u102b\u1038",text_size:"\u1005\u102c\u101c\u1036\u102f\u1038 \u1021\u101b\u103d\u101a\u103a",text_font:"\u1005\u102c\u101c\u1036\u102f\u1038 \u1031\u1016\u102c\u1004\u103a\u1037",text_props:"\u1005\u102c\u101e\u102c\u1038",positioning_tab:"\u1010\u100a\u103a\u1031\u1014\u101b\u102c",list_tab:"\u1005\u102c\u101b\u1004\u103a\u1038",border_tab:"\u1014\u101a\u103a\u1005\u100a\u103a\u1038",box_tab:"\u1015\u1036\u102f\u1038",block_tab:"\u1021\u1000\u103d\u1000\u103a",background_tab:"\u1031\u1014\u102c\u1000\u103a\u1001",text_tab:"\u1005\u102c\u101e\u102c\u1038",apply:"\u1021\u101e\u1036\u102f\u1038\u103c\u1015\u102f\u1019\u100a\u103a",title:"CSS \u1005\u1010\u102d\u102f\u1004\u103a \u103c\u1015\u102f\u103c\u1015\u1004\u103a\u101b\u1014\u103a",clip:"\u1000\u101c\u1005\u103a",placement:"\u1031\u1014\u101b\u102c\u1021\u1011\u102c\u1038\u1021\u101e\u102d\u102f",overflow:"\u101c\u103b\u103e\u1036\u1011\u103d\u1000\u103a\u1019\u103e\u102f",zindex:"Z-Index",visibility:"\u103c\u1019\u1004\u103a\u1014\u102d\u102f\u1004\u103a\u1005\u103d\u1019\u103a\u1038",positioning_type:"\u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038",position:"\u1010\u100a\u103a\u1031\u1014\u101b\u102c",bullet_image:"\u1021\u1019\u103e\u1010\u103a\u1021\u101e\u102c\u1038 \u101b\u102f\u1015\u103a\u1015\u1036\u102f",list_type:"\u1021\u1019\u102d\u103b\u102f\u1038\u1021\u1005\u102c\u1038",color:"\u1021\u1031\u101b\u102c\u1004\u103a",height:"\u1021\u103c\u1019\u1004\u103a\u1037",width:"\u1021\u1000\u103b\u101a\u103a",style:"\u1005\u1010\u102d\u102f\u1004\u103a",margin:"\u1031\u1018\u1038\u1019\u103b\u1009\u103a\u1038",left:"\u1018\u101a\u103a",bottom:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001",right:"\u100a\u102c",top:"\u1021\u1011\u1000\u103a",same:"\u1021\u102c\u1038\u101c\u1036\u102f\u1038\u1021\u1010\u1030\u1010\u1030",padding:"\u1031\u1018\u1038\u1021\u1000\u102c\u1000\u103d\u1000\u103a\u101c\u1015\u103a",box_clear:"\u1015\u101a\u103a\u101b\u103e\u1004\u103a\u1038",box_float:"\u1031\u1019\u103b\u102c\u101c\u103d\u1004\u103a\u1037",box_height:"\u1021\u103c\u1019\u1004\u103a\u1037",box_width:"\u1021\u1000\u103b\u101a\u103a",block_display:"\u103c\u1015\u101e\u1015\u1036\u102f \u103c\u1019\u1004\u103a\u1000\u103d\u1004\u103a\u1038",block_whitespace:"\u1021\u103c\u1016\u1030\u1031\u101b\u102c\u1004\u103a\u1000\u103d\u1000\u103a\u101c\u1015\u103a",block_text_indent:"\u1005\u102c\u101e\u102c\u1038 Indent",block_text_align:"\u1005\u102c\u101e\u102c\u1038 \u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1015\u1036\u102f",block_vertical_alignment:"\u1031\u1012\u102b\u1004\u103a\u101c\u102d\u102f\u1000\u103a \u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1019\u103e\u102f",block_letterspacing:"\u1005\u102c\u101c\u1036\u102f\u1038 \u1021\u1000\u103d\u102c\u1021\u1031\u101d\u1038",block_wordspacing:"\u1005\u1000\u102c\u1038\u101c\u1036\u102f\u1038 \u1021\u1000\u103d\u102c\u1021\u1031\u101d\u1038",background_vpos:"\u1031\u1012\u102b\u1004\u103a\u101c\u102d\u102f\u1000\u103a \u1010\u100a\u103a\u1031\u1014\u101b\u102c",background_hpos:"\u1021\u101c\u103b\u102c\u1038\u101c\u102d\u102f\u1000\u103a \u1010\u100a\u103a\u1031\u1014\u101b\u102c",background_attachment:"\u1010\u103d\u1032\u1001\u103b\u102d\u1010\u103a\u1019\u103e\u102f",background_repeat:"\u103c\u1015\u1014\u103a\u1031\u1000\u103b\u102c\u1037",background_image:"\u1031\u1014\u102c\u1000\u103a\u1001\u1036 \u101b\u102f\u1015\u103a\u1015\u1036\u102f",background_color:"\u1031\u1014\u102c\u1000\u103a\u1001\u1036 \u1021\u1031\u101b\u102c\u1004\u103a",text_none:"\u1010\u1005\u103a\u1001\u102f\u1019\u103b\u103e\u1019\u101f\u102f\u1010\u103a",text_blink:"\u1019\u103e\u102d\u1010\u103a\u1010\u102f\u1010\u103a\u1019\u103e\u102d\u1010\u103a\u1010\u102f\u1010\u103a",text_case:"\u1031\u1000\u1037\u1005\u103a(\u1005\u102c\u101c\u1036\u102f\u1038\u1021\u103c\u1000\u102e\u1038\u1021\u1031\u101e\u1038)",text_striketrough:"\u103c\u1016\u1010\u103a\u1019\u103b\u1009\u103a\u1038",text_underline:"\u1031\u1021\u102c\u1000\u103a\u1019\u103b\u1009\u103a\u1038",text_overline:"\u1021\u1031\u1015\u102b\u103a\u1019\u103b\u1009\u103a\u1038",text_decoration:"\u1021\u101c\u103e\u1021\u1015\u1021\u103c\u1015\u1004\u103a\u1021\u1006\u1004\u103a",text_color:"\u1021\u1031\u101b\u102c\u1004\u103a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/nb_dlg.js b/js/tiny_mce/plugins/style/langs/nb_dlg.js new file mode 100755 index 000000000..485802e87 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.style_dlg',{"text_lineheight":"Linjeh\u00f8yde","text_variant":"Variant","text_style":"Skriftstil","text_weight":"Skriftvekt","text_size":"Skriftst\u00f8rrelse","text_font":"Skrifttype","text_props":"Skriftegenskaper","positioning_tab":"Posisjon","list_tab":"Liste","border_tab":"Ramme","box_tab":"Boks","block_tab":"Blokk","background_tab":"Bakgrunn","text_tab":"Tekst",apply:"Legg til",title:"Rediger CSS-stil",clip:"Klipp",placement:"Plassering",overflow:"Overfyll",zindex:"Z-indeks",visibility:"Synlighet","positioning_type":"Type",position:"Posisjon","bullet_image":"Punktbilde","list_type":"Type",color:"Farge",height:"H\u00f8yde",width:"Bredde",style:"Stil",margin:"Marg",left:"Venstre",bottom:"Bunn",right:"H\u00f8yre",top:"Topp",same:"Lik i alle",padding:"Utfylling","box_clear":"Slett","box_float":"Flyt","box_height":"H\u00f8yde","box_width":"Bredde","block_display":"Framvising","block_whitespace":"Mellomrom","block_text_indent":"Innrykk","block_text_align":"Justering","block_vertical_alignment":"Vertikal justering","block_letterspacing":"Bokstavmellomrom","block_wordspacing":"Ordmellomrom","background_vpos":"Vertikal posisjon","background_hpos":"Horisontal posisjon","background_attachment":"Vedlegg","background_repeat":"Gjenta","background_image":"Bakgrunnsbilde","background_color":"Bakgrunnsfarge","text_none":"Ingen","text_blink":"Blink","text_case":"Store / sm\u00e5 bokstaver","text_striketrough":"Gjennomstreking","text_underline":"Senke skrift","text_overline":"Heve skrift","text_decoration":"Dekorasjon","text_color":"Farge"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/nl_dlg.js b/js/tiny_mce/plugins/style/langs/nl_dlg.js new file mode 100755 index 000000000..5bcc2c5a1 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.style_dlg',{"text_lineheight":"Lijnhoogte","text_variant":"Variant","text_style":"Stijl","text_weight":"Gewicht","text_size":"Tekengrootte","text_font":"Lettertype","text_props":"Tekst","positioning_tab":"Positionering","list_tab":"Lijst","border_tab":"Rand","box_tab":"Box","block_tab":"Blok","background_tab":"Achtergrond","text_tab":"Tekst",apply:"Toepassen",title:"CSS Stijl bewerken",clip:"Clip",placement:"Plaatsing",overflow:"Overvloeien",zindex:"Z-index",visibility:"Zichtbaarheid","positioning_type":"Type",position:"Positie","bullet_image":"Opsommingsteken","list_type":"Type",color:"Kleur",height:"Hoogte",width:"Breedte",style:"Stijl",margin:"Marge",left:"Links",bottom:"Onder",right:"Rechts",top:"Boven",same:"Alles hetzelfde",padding:"Opening","box_clear":"Vrijhouden","box_float":"Zweven","box_height":"Hoogte","box_width":"Breedte","block_display":"Weergave","block_whitespace":"Witruimte","block_text_indent":"Inspringen","block_text_align":"Tekstuitlijning","block_vertical_alignment":"Verticale uitlijning","block_letterspacing":"Letterruimte","block_wordspacing":"Woordruimte","background_vpos":"Verticale positie","background_hpos":"Horizontale positie","background_attachment":"Bijlage","background_repeat":"Herhalen","background_image":"Achtergrondafbeelding","background_color":"Achtergrondkleur","text_none":"Niets","text_blink":"Knipperen","text_case":"Hoofdlettergebruik","text_striketrough":"Doorhalen","text_underline":"Onderstrepen","text_overline":"Overhalen","text_decoration":"Decoratie","text_color":"Kleur"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/nn_dlg.js b/js/tiny_mce/plugins/style/langs/nn_dlg.js new file mode 100755 index 000000000..563b80bdb --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.style_dlg',{text_lineheight:"Linjeh\u00f8gd",text_variant:"Variant",text_style:"Skriftstil",text_weight:"Skriftvekt",text_size:"Skriftstorleik",text_font:"Skrifttype",text_props:"Eigenskapar for skrift",positioning_tab:"Posisjon",list_tab:"Liste",border_tab:"Ramme",box_tab:"Boks",block_tab:"Blokk",background_tab:"Bakgrunn",text_tab:"Tekst",apply:"Legg til",title:"Rediger CSS-stil",clip:"Klipp",placement:"Plassering",overflow:"Overfylt",zindex:"Z-indeks",visibility:"Synlegheit",positioning_type:"Type",position:"Posisjon",bullet_image:"Kulepunktbilete",list_type:"Type",color:"Farge",height:"H\u00f8gd",width:"Breidd",style:"Stil",margin:"Marg",left:"Venstre",bottom:"Bunn",right:"H\u00f8gre",top:"Topp",same:"Likt i alle",padding:"Utfylling",box_clear:"Slett",box_float:"Flyt",box_height:"H\u00f8gd",box_width:"Breidd",block_display:"Framsyning",block_whitespace:"Mellomrom",block_text_indent:"Innrykk",block_text_align:"Justering",block_vertical_alignment:"Vertikal justering",block_letterspacing:"Bokstavmellomrom",block_wordspacing:"Ordmellomrom",background_vpos:"Vertikal posisjon",background_hpos:"Horisontal posisjon",background_attachment:"Vedlegg",background_repeat:"Gjenta",background_image:"Bakgrunnsbilete",background_color:"Bakgrunnsfarge",text_none:"Ingen",text_blink:"Blink",text_case:"Kapitelar/minusklar",text_striketrough:"Gjennomstreking",text_underline:"Senka skrift",text_overline:"Heva skrift",text_decoration:"Dekorasjon",text_color:"Farge"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/no_dlg.js b/js/tiny_mce/plugins/style/langs/no_dlg.js new file mode 100755 index 000000000..db721c185 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.style_dlg',{"text_lineheight":"Linjeh\u00f8yde","text_variant":"Variant","text_style":"Skriftstil","text_weight":"Skriftvekt","text_size":"Skriftst\u00f8rrelse","text_font":"Skrifttype","text_props":"Tekst","positioning_tab":"Posisjon","list_tab":"Liste","border_tab":"Ramme","box_tab":"Boks","block_tab":"Blokk","background_tab":"Bakgrunn","text_tab":"Tekst",apply:"Bruk",title:"Rediger CSS-stil",clip:"Klipp",placement:"Plassering",overflow:"Overfylt",zindex:"Z-indeks",visibility:"Synlighet","positioning_type":"Type",position:"Posisjon","bullet_image":"Punkt bilde","list_type":"Type",color:"Farge",height:"H\u00f8yde",width:"Bredde",style:"Stil",margin:"Marg",left:"Venstre",bottom:"Bunn",right:"H\u00f8yre",top:"Topp",same:"Likt for alle",padding:"Utfylling","box_clear":"Slette","box_float":"Flytende","box_height":"H\u00f8yde","box_width":"Bredde","block_display":"Visning","block_whitespace":"Mellomrom","block_text_indent":"Innrykk","block_text_align":"Justering","block_vertical_alignment":"Vertikal justering","block_letterspacing":"Bokstav mellomrom","block_wordspacing":"Mellomrom","background_vpos":"Vertikal posisjon","background_hpos":"Horisontal posisjon","background_attachment":"Vedlegg","background_repeat":"Repetere","background_image":"Bakgrunnsbilde","background_color":"Bakgrunnsfarge","text_none":"Ingen","text_blink":"Blinke","text_case":"Store/sm\u00e5 bokstaver","text_striketrough":"Gjennomstreke","text_underline":"Senke skrift","text_overline":"Heve skrift","text_decoration":"Dekorasjon","text_color":"Farge"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/pl_dlg.js b/js/tiny_mce/plugins/style/langs/pl_dlg.js new file mode 100755 index 000000000..a015749f9 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.style_dlg',{"text_lineheight":"Wysoko\u015b\u0107 linii","text_variant":"Wariant","text_style":"Styl","text_weight":"Waga","text_size":"Rozmiar","text_font":"Wz\u00f3r czcionki","text_props":"Tekst","positioning_tab":"Pozycjonowanie","list_tab":"Lista","border_tab":"Obramowanie","box_tab":"Boks","block_tab":"Blok","background_tab":"T\u0142o","text_tab":"Text",apply:"Zastosuj",title:"Edytuj style CSS",clip:"Klip",placement:"Umieszczenie",overflow:"Przepe\u0142niony",zindex:"Z-index",visibility:"Widoczno\u015b\u0107","positioning_type":"Typ",position:"Pozycja","bullet_image":"Obrazek listy","list_type":"Typ",color:"Kolor",height:"Wysoko\u015b\u0107",width:"Szeroko\u015b\u0107",style:"Styl",margin:"Margines",left:"Lewy",bottom:"D\u00f3\u0142",right:"Prawy",top:"G\u00f3ra",same:"To samo dla wszystkich",padding:"Odst\u0119py","box_clear":"Op\u0142ywanie (Clear)","box_float":"Op\u0142ywanie (Float)","box_height":"Wysoko\u015b\u0107","box_width":"Szeroko\u015b\u0107","block_display":"Spos\u00f3b wy\u015bwietlania","block_whitespace":"Bia\u0142e znaki","block_text_indent":"Przesuni\u0119cie tekstu","block_text_align":"Wyr\u00f3wnanie tekstu","block_vertical_alignment":"Pionowe wyr\u00f3wnanie","block_letterspacing":"Odst\u0119p mi\u0119dzy literami","block_wordspacing":"Odst\u0119p mi\u0119dzy wyrazami","background_vpos":"Pozycja pionowa","background_hpos":"Pozycja pozioma","background_attachment":"Za\u0142\u0105cznik","background_repeat":"Powt\u00f3rz","background_image":"Obrazek t\u0142a","background_color":"Kolor t\u0142a","text_none":"\u017caden","text_blink":"miganie","text_case":"Znaki","text_striketrough":"przekre\u015blenie","text_underline":"podkre\u015blenie","text_overline":"nadkre\u015blenie","text_decoration":"Dekoracja","text_color":"Kolor"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ps_dlg.js b/js/tiny_mce/plugins/style/langs/ps_dlg.js new file mode 100755 index 000000000..82735a531 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/pt_dlg.js b/js/tiny_mce/plugins/style/langs/pt_dlg.js new file mode 100755 index 000000000..d9c174715 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.style_dlg',{text_lineheight:"Altura da linha",text_variant:"Variante",text_style:"Estilo",text_weight:"Peso",text_size:"Tamanho",text_font:"Fonte",text_props:"Texto",positioning_tab:"Posicionamento",list_tab:"Lista",border_tab:"Limites",box_tab:"Caixa",block_tab:"Bloco",background_tab:"Fundo",text_tab:"Texto",apply:"Aplicar",title:"Editar CSS",clip:"Clip",placement:"Posicionamento",overflow:"Overflow",zindex:"Z-index",visibility:"Visibilidade",positioning_type:"Tipo",position:"Posi\u00e7\u00e3o",bullet_image:"Imagem de lista",list_type:"Tipo",color:"Cor",height:"Altura",width:"Largura",style:"Estilo",margin:"Margem",left:"Esquerda",bottom:"Abaixo",right:"Direita",top:"Topo",same:"O mesmo para todos",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Altura",box_width:"Largura",block_display:"Display",block_whitespace:"Espa\u00e7o",block_text_indent:"Indent",block_text_align:"Alinhamento de texto",block_vertical_alignment:"Alinhamento vertical",block_letterspacing:"Espa\u00e7amento de letras",block_wordspacing:"Espa\u00e7amento de palavras",background_vpos:"Posi\u00e7\u00e3o vertical",background_hpos:"Posi\u00e7\u00e3o horizontal",background_attachment:"Fixar",background_repeat:"Repetir",background_image:"Imagem de fundo",background_color:"Cor de fundo",text_none:"nenhum",text_blink:"Piscar",text_case:"Mai\u00fascula",text_striketrough:"Riscado",text_underline:"Sublinhado",text_overline:"Sobrelinha",text_decoration:"Decora\u00e7\u00e3o",text_color:"Cor"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ro_dlg.js b/js/tiny_mce/plugins/style/langs/ro_dlg.js new file mode 100755 index 000000000..89792a51d --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.style_dlg',{text_lineheight:"\u00cen\u0103l\u0163ime linie",text_variant:"Variant\u0103",text_style:"Stil",text_weight:"Greutate",text_size:"M\u0103rime",text_font:"Font",text_props:"Text",positioning_tab:"Pozi\u0163ionare",list_tab:"List\u0103",border_tab:"Bordur\u0103",box_tab:"Box",block_tab:"Block",background_tab:"Fundal",text_tab:"Text",apply:"Aplic\u0103",title:"Editare CSS",clip:"Clip",placement:"Plasament",overflow:"Overflow",zindex:"Z-index",visibility:"Vizibilitate",positioning_type:"Tip",position:"Pozi\u0163ionare",bullet_image:"Imagine",list_type:"Tip",color:"Culoare",height:"\u00cen\u0103l\u0163ime",width:"L\u0103\u0163ime",style:"Stil",margin:"Margini",left:"St\u00e2nga",bottom:"Jos",right:"Dreapta",top:"Sus",same:"La fel pentru toate",padding:"Margini interne",box_clear:"Normal\u0103",box_float:"Plutitoare",box_height:"\u00cen\u0103l\u0163ime",box_width:"L\u0103\u0163ime",block_display:"Afi\u015fare",block_whitespace:"Spa\u0163iu alb",block_text_indent:"Indentare text",block_text_align:"Aliniere text",block_vertical_alignment:"Aliniere vertical\u0103",block_letterspacing:"Spa\u0163iere litere",block_wordspacing:"Spa\u0163iere cuvinte",background_vpos:"Pozi\u0163ionare vertical\u0103",background_hpos:"Pozi\u0163ionare orizontal\u0103",background_attachment:"Ata\u015fament",background_repeat:"Repet\u0103",background_image:"Imagine fundal",background_color:"Culoare fundal",text_none:"Nici unul",text_blink:"Clipire",text_case:"Caz",text_striketrough:"T\u0103iere",text_underline:"Sub linie",text_overline:"Peste linie",text_decoration:"Decora\u0163ii",text_color:"Culoare"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ru_dlg.js b/js/tiny_mce/plugins/style/langs/ru_dlg.js new file mode 100755 index 000000000..c7acb88d8 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.style_dlg',{"text_lineheight":"\u0412\u044b\u0441\u043e\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0438","text_variant":"\u0412\u0430\u0440\u0438\u0430\u043d\u0442","text_style":"\u0421\u0442\u0438\u043b\u044c","text_weight":"\u0422\u043e\u043b\u0449\u0438\u043d\u0430","text_size":"\u0420\u0430\u0437\u043c\u0435\u0440","text_font":"\u0428\u0440\u0438\u0444\u0442","text_props":"\u0422\u0435\u043a\u0441\u0442","positioning_tab":"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435","list_tab":"\u0421\u043f\u0438\u0441\u043e\u043a","border_tab":"\u0413\u0440\u0430\u043d\u0438\u0446\u0430","box_tab":"\u041a\u0440\u0430\u044f","block_tab":"\u0411\u043b\u043e\u043a","background_tab":"\u0424\u043e\u043d","text_tab":"\u0422\u0435\u043a\u0441\u0442",apply:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c",title:"\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 CSS \u0441\u0442\u0438\u043b\u044f",clip:"\u041e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435",placement:"\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435",overflow:"\u041f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435",zindex:"Z-\u0438\u043d\u0434\u0435\u043a\u0441",visibility:"\u0412\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c","positioning_type":"\u0422\u0438\u043f",position:"\u041f\u043e\u0437\u0438\u0446\u0438\u044f","bullet_image":"\u041c\u0430\u0440\u043a\u0435\u0440","list_type":"\u0422\u0438\u043f",color:"\u0426\u0432\u0435\u0442",height:"\u0412\u044b\u0441\u043e\u0442\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",style:"\u0421\u0442\u0438\u043b\u044c",margin:"\u041e\u0442\u0441\u0442\u0443\u043f",left:"\u0421\u043b\u0435\u0432\u0430",bottom:"\u0421\u043d\u0438\u0437\u0443",right:"\u0421\u043f\u0440\u0430\u0432\u0430",top:"\u0412\u0432\u0435\u0440\u0445",same:"\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445",padding:"\u041f\u043e\u043b\u044f","box_clear":"\u042f\u0432\u043d\u044b\u0439","box_float":"\u041f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439","box_height":"\u0412\u044b\u0441\u043e\u0442\u0430","box_width":"\u0428\u0438\u0440\u0438\u043d\u0430","block_display":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","block_whitespace":"\u041f\u0440\u043e\u0431\u0435\u043b","block_text_indent":"\u041e\u0442\u0441\u0442\u0443\u043f \u0442\u0435\u043a\u0441\u0442\u0430","block_text_align":"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","block_vertical_alignment":"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435","block_letterspacing":"\u041e\u0442\u0441\u0442\u0443\u043f\u044b \u043c\u0435\u0436\u0434\u0443 \u0431\u0443\u043a\u0432\u0430\u043c\u0438","block_wordspacing":"\u041e\u0442\u0441\u0442\u0443\u043f\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0432\u0430\u043c\u0438","background_vpos":"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f","background_hpos":"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f","background_attachment":"\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430","background_repeat":"\u041f\u043e\u0432\u0442\u043e\u0440","background_image":"\u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","background_color":"\u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430","text_none":"\u0411\u0435\u0437 \u0432\u0441\u0435\u0433\u043e","text_blink":"\u041c\u0435\u0440\u0446\u0430\u044e\u0449\u0438\u0439","text_case":"\u0420\u0435\u0433\u0438\u0441\u0442\u0440","text_striketrough":"\u0417\u0430\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439","text_underline":"\u041f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439","text_overline":"\u0421 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0435\u0440\u0442\u043e\u0439","text_decoration":"\u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435","text_color":"\u0426\u0432\u0435\u0442"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sc_dlg.js b/js/tiny_mce/plugins/style/langs/sc_dlg.js new file mode 100755 index 000000000..9b473d702 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u53d8\u4f53",text_style:"\u6837\u5f0f",text_weight:"\u5bbd\u5ea6",text_size:"\u5c3a\u5bf8",text_font:"\u5b57\u4f53",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u8fb9\u6846",box_tab:"\u7bb1\u578b",block_tab:"\u5757",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5e94\u7528",title:"\u7f16\u8f91CSS\u6837\u5f0f\u8868\u5355",clip:"\u526a\u8f91",placement:"\u5e03\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z\u8f74\u6df1\u5ea6",visibility:"\u53ef\u89c1\u6027",positioning_type:"\u7c7b\u578b",position:"\u56fe\u793a\u4f4d\u7f6e",bullet_image:"\u4e13\u6848\u56fe\u793a",list_type:"\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",style:"\u6837\u5f0f",margin:"\u8fb9\u754c",left:"\u9760\u5de6",bottom:"\u4e0b\u65b9",right:"\u9760\u53f3",top:"\u4e0a\u65b9",same:"\u5168\u90e8\u4e00\u6837",padding:"\u7559\u767d",box_clear:"\u6e05\u9664",box_float:"\u6d6e\u52a8",box_height:"\u9ad8\u5ea6",box_width:"\u5bbd\u5ea6",block_display:"\u663e\u793a\u65b9\u5f0f",block_whitespace:"\u7a7a\u767d",block_text_indent:"\u6587\u5b57\u7f29\u6392",block_text_align:"\u6587\u5b57\u5bf9\u9f50",block_vertical_alignment:"\u6c34\u51c6\u5bf9\u9f50\u65b9\u5f0f",block_letterspacing:"\u5b57\u5143\u95f4\u8ddd",block_wordspacing:"\u5355\u5b57\u95f4\u8ddd",background_vpos:"\u6c34\u51c6\u4f4d\u7f6e",background_hpos:"\u5782\u76f4\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u590d",background_image:"\u80cc\u666f\u56fe\u7247",background_color:"\u80cc\u666f\u989c\u8272",text_none:"\u65e0",text_blink:"\u95ea\u70c1",text_case:"\u5b57\u4f53",text_striketrough:"\u5220\u9664\u7ebf",text_underline:"\u5e95\u7ebf",text_overline:"\u4e0a\u5212\u7ebf",text_decoration:"\u4fee\u9970",text_color:"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/se_dlg.js b/js/tiny_mce/plugins/style/langs/se_dlg.js new file mode 100755 index 000000000..f650e8d76 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.style_dlg',{text_lineheight:"Radh\u00f6jd",text_variant:"Variant",text_style:"Stil",text_weight:"Tjocklek",text_size:"Storlek",text_font:"Typsnitt",text_props:"Text",positioning_tab:"Positionering",list_tab:"Listor",border_tab:"Ramar",box_tab:"Box",block_tab:"Block",background_tab:"Bakgrund",text_tab:"Text",apply:"Applicera",title:"Redigera inline CSS",clip:"Besk\u00e4rning",placement:"Placering",overflow:"\u00d6verfl\u00f6de",zindex:"Z-index",visibility:"Synlighet",positioning_type:"Positionstyp",position:"Position",bullet_image:"Punktbild",list_type:"Listtyp",color:"F\u00e4rg",height:"H\u00f6jd",width:"Bredd",style:"Stil",margin:"Marginal",left:"V\u00e4nster",bottom:"Botten",right:"H\u00f6ger",top:"Toppen",same:"Samma f\u00f6r alla",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"H\u00f6jd",box_width:"Bredd",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Textindrag",block_text_align:"Textjustering",block_vertical_alignment:"Vertikal justering",block_letterspacing:"Teckenmellanrum",block_wordspacing:"Ordavbrytning",background_vpos:"Vertikal position",background_hpos:"Horisontell position",background_attachment:"F\u00e4stpunkt",background_repeat:"Upprepning",background_image:"Bakgrundsbild",background_color:"Bakgrundsf\u00e4rg",text_none:"Inget",text_blink:"Blinka",text_case:"Sm\u00e5/stora",text_striketrough:"Genomstruken",text_underline:"Understruken",text_overline:"\u00d6verstruken",text_decoration:"Dekoration",text_color:"F\u00e4rg"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/si_dlg.js b/js/tiny_mce/plugins/style/langs/si_dlg.js new file mode 100755 index 000000000..00edbb357 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sk_dlg.js b/js/tiny_mce/plugins/style/langs/sk_dlg.js new file mode 100755 index 000000000..72ba466c7 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.style_dlg',{text_lineheight:"V\u00fd\u0161ka riadkov",text_variant:"Varianta",text_style:"\u0160t\u00fdl textu",text_weight:"Tu\u010dnos\u0165 p\u00edsma",text_size:"Ve\u013ekos\u0165",text_font:"P\u00edsmo",text_props:"Text",positioning_tab:"Umiesnenie",list_tab:"Zoznam",border_tab:"Or\u00e1movanie",box_tab:"Box",block_tab:"Blok",background_tab:"Pozadie",text_tab:"Text",apply:"Pou\u017ei\u0165",title:"Upravi\u0165 CSS \u0161t\u00fdl",clip:"Orezanie (clip)",placement:"Umiestnenie",overflow:"Prete\u010denie (overflow)",zindex:"Z-index",visibility:"Vidite\u013enos\u0165",positioning_type:"Typ",position:"Umiestnenie",bullet_image:"\u0160t\u00fdl odr\u00e1\u017eok",list_type:"Typ",color:"Farba",height:"V\u00fd\u0161ka",width:"\u0160\u00edrka",style:"\u0160t\u00fdl",margin:"Okraje (margin)",left:"V\u013eavo",bottom:"Dole",right:"Vpravo",top:"Hore",same:"Rovnak\u00e9 pre v\u0161etky",padding:"Odsadenie (padding)",box_clear:"Vy\u010disti\u0165",box_float:"Pl\u00e1vaj\u00faci",box_height:"V\u00fd\u0161ka",box_width:"\u0160\u00edrka",block_display:"Blokov\u00e9 zobrazenie",block_whitespace:"Zalamovanie textu",block_text_indent:"Odsadenie textu",block_text_align:"Zarovnanie textu",block_vertical_alignment:"Vertik\u00e1lne zarovnanie",block_letterspacing:"Rozstup znakov",block_wordspacing:"Rozstup slov",background_vpos:"Vertik\u00e1lne umiestnenie",background_hpos:"Horizont\u00e1lne umiestnenie",background_attachment:"Rolovanie",background_repeat:"Opakovanie",background_image:"Obr\u00e1zok pozadia",background_color:"Farba pozadia",text_none:"\u017eiadna",text_blink:"blikanie",text_case:"Ve\u013ek\u00e9 p\u00edsmen\u00e1",text_striketrough:"pre\u010diarknutie",text_underline:"pod\u010diarknutie",text_overline:"nad\u010diarknutie",text_decoration:"Dekor\u00e1cia",text_color:"Farba"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sl_dlg.js b/js/tiny_mce/plugins/style/langs/sl_dlg.js new file mode 100755 index 000000000..047979577 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.style_dlg',{text_lineheight:"Vi\u0161ina vrstice",text_variant:"Razli\u010dica",text_style:"Slog",text_weight:"Ute\u017e",text_size:"Velikost",text_font:"Pisava",text_props:"Besedilo",positioning_tab:"Polo\u017eaj",list_tab:"Seznam",border_tab:"Obroba",box_tab:"Okvir",block_tab:"Blok",background_tab:"Ozadje",text_tab:"Besedilo",apply:"Uporabi",title:"Uredi sloge CSS",clip:"Obre\u017ei",placement:"Polo\u017eaj",overflow:"Prelivanje",zindex:"Z-indeks",visibility:"Vidnost",positioning_type:"Vrsta",position:"Polo\u017eaj",bullet_image:"Slika alineje",list_type:"Vrsta",color:"Barva",height:"Vi\u0161ina",width:"\u0160irina",style:"Slog",margin:"Rob",left:"Levo",bottom:"Spodaj",right:"Desno",top:"Zgoraj",same:"Enako za vse",padding:"Podlaganje",box_clear:"\u010cisto",box_float:"Plavojo\u010de",box_height:"Vi\u0161ina",box_width:"\u0160irina",block_display:"Prikaz",block_whitespace:"Beli prostor",block_text_indent:"Zamik besedila",block_text_align:"Poravnava besedila",block_vertical_alignment:"Navpi\u010dna poravnava",block_letterspacing:"Razmik znakov",block_wordspacing:"Razmik besed",background_vpos:"Navpi\u010dni polo\u017eaj",background_hpos:"Vodoravni polo\u017eaj",background_attachment:"Priponka",background_repeat:"Ponavljaj",background_image:"Slika ozadja",background_color:"Barva ozadja",text_none:"brez",text_blink:"utripajo\u010de",text_case:"Velikost",text_striketrough:"pre\u010drtano",text_underline:"pod\u010drtano",text_overline:"nad\u010drtano",text_decoration:"Okras",text_color:"Barva"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sq_dlg.js b/js/tiny_mce/plugins/style/langs/sq_dlg.js new file mode 100755 index 000000000..7d5942b84 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.style_dlg',{text_lineheight:"Gjat\u00ebsia e linj\u00ebs",text_variant:"Varianti",text_style:"Stili",text_weight:"Pesha",text_size:"Madh\u00ebsia",text_font:"Teksti",text_props:"Teksti",positioning_tab:"Pozicionimi",list_tab:"Lista",border_tab:"Korniza",box_tab:"Kuti",block_tab:"Bllok",background_tab:"Fusha",text_tab:"Teksti",apply:"Apliko",title:"Edito t\u00eb gjitha stilet",clip:"Prerja",placement:"Vendosja",overflow:"Mbivendosja",zindex:"Indeksi Z",visibility:"Shikueshm\u00ebria",positioning_type:"Tipi",position:"Pozicioni",bullet_image:"Foto ndar\u00ebse",list_type:"Tipi",color:"Ngjyra",height:"Gjat\u00ebsia",width:"Gjer\u00ebsia",style:"Stili",margin:"Hap\u00ebsira",left:"Majtas",bottom:"Fund",right:"Djathtas",top:"Krye",same:"E nj\u00ebjt\u00eb p\u00ebr t\u00eb gjitha",padding:"Hap\u00ebsira e br\u00ebndshme",box_clear:"Pastro",box_float:"Pluskimi",box_height:"Gjat\u00ebsia",box_width:"Gjer\u00ebsia",block_display:"Shfaqja",block_whitespace:"Hap\u00ebsira bosh",block_text_indent:"Kryerradha",block_text_align:"Drejtimi i tekstit",block_vertical_alignment:"Drejtimi vertikal",block_letterspacing:"Hap\u00ebsira e g\u00ebrmave",block_wordspacing:"Hap\u00ebsira e fjal\u00ebve",background_vpos:"Pozicionimi vertikal",background_hpos:"Pozicionimi horizontal",background_attachment:"Bashk\u00ebngjitja",background_repeat:"P\u00ebrs\u00ebritja",background_image:"Foto e fush\u00ebs",background_color:"Ngjyra e fush\u00ebs",text_none:"asnj\u00eb",text_blink:"fik-ndiz",text_case:"Madh\u00ebsia e g\u00ebrm\u00ebs",text_striketrough:"n\u00eb mes",text_underline:"n\u00ebn linj\u00eb",text_overline:"mbi linj\u00eb",text_decoration:"Zbukurimi",text_color:"Ngjyra"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sr_dlg.js b/js/tiny_mce/plugins/style/langs/sr_dlg.js new file mode 100755 index 000000000..8a8d022c6 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/sv_dlg.js b/js/tiny_mce/plugins/style/langs/sv_dlg.js new file mode 100755 index 000000000..6a8d3e459 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.style_dlg',{"text_lineheight":"Radh\u00f6jd","text_variant":"Variant","text_style":"Stil","text_weight":"Tjocklek","text_size":"Storlek","text_font":"Typsnitt","text_props":"Text","positioning_tab":"Positionering","list_tab":"Listor","border_tab":"Ramar","box_tab":"Box","block_tab":"Block","background_tab":"Bakgrund","text_tab":"Text",apply:"Applicera",title:"Redigera inline CSS",clip:"Besk\u00e4rning",placement:"Placering",overflow:"\u00d6\u0096verfl\u00f6de",zindex:"Z-index",visibility:"Synlighet","positioning_type":"Positionstyp",position:"Position","bullet_image":"Punktbild","list_type":"Listtyp",color:"F\u00e4rg",height:"H\u00f6jd",width:"Bredd",style:"Stil",margin:"Marginal",left:"V\u00e4nster",bottom:"Botten",right:"H\u00f6ger",top:"Toppen",same:"Samma f\u00f6r alla",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"H\u00f6jd","box_width":"Bredd","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Textindrag","block_text_align":"Textjustering","block_vertical_alignment":"Vertikal justering","block_letterspacing":"Teckenmellanrum","block_wordspacing":"Ordavbrytning","background_vpos":"Vertikal position","background_hpos":"Horisontell position","background_attachment":"F\u00e4stpunkt","background_repeat":"Upprepning","background_image":"Bakgrundsbild","background_color":"Bakgrundsf\u00e4rg","text_none":"Inget","text_blink":"Blinka","text_case":"Sm\u00e5/stora","text_striketrough":"Genomstruken","text_underline":"Understruken","text_overline":"\u00d6verstruken","text_decoration":"Dekoration","text_color":"F\u00e4rg"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ta_dlg.js b/js/tiny_mce/plugins/style/langs/ta_dlg.js new file mode 100755 index 000000000..a8fd368d5 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/te_dlg.js b/js/tiny_mce/plugins/style/langs/te_dlg.js new file mode 100755 index 000000000..29e896cb7 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/th_dlg.js b/js/tiny_mce/plugins/style/langs/th_dlg.js new file mode 100755 index 000000000..984aeee58 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.style_dlg',{text_lineheight:"\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e39\u0e07\u0e02\u0e2d\u0e07\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14",text_variant:"Variant",text_style:"\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a",text_weight:"\u0e19\u0e49\u0e33\u0e2b\u0e19\u0e31\u0e01",text_size:"\u0e02\u0e19\u0e32\u0e14",text_font:"\u0e15\u0e31\u0e27\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d",text_props:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21",positioning_tab:"Positioning",list_tab:"List",border_tab:"\u0e01\u0e23\u0e2d\u0e1a",box_tab:"Box",block_tab:"Block",background_tab:"\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07",text_tab:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21",apply:"\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19",title:"\u0e41\u0e01\u0e49\u0e44\u0e02 CSS",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"\u0e2a\u0e35",height:"\u0e2a\u0e39\u0e07",width:"\u0e01\u0e27\u0e49\u0e32\u0e07",style:"\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a",margin:"Margin",left:"\u0e0b\u0e49\u0e32\u0e22",bottom:"\u0e25\u0e48\u0e32\u0e07",right:"\u0e02\u0e27\u0e32",top:"\u0e1a\u0e19",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21 indent",block_text_align:"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21 align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"\u0e23\u0e39\u0e1b\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07",background_color:"\u0e2a\u0e35\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"\u0e2a\u0e35"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/tn_dlg.js b/js/tiny_mce/plugins/style/langs/tn_dlg.js new file mode 100755 index 000000000..5124240dd --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/tr_dlg.js b/js/tiny_mce/plugins/style/langs/tr_dlg.js new file mode 100755 index 000000000..8e6591bbd --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.style_dlg',{text_lineheight:"\u00c7izgi y\u00fcksekli\u011fi",text_variant:"De\u011fi\u015fken",text_style:"Stil",text_weight:"Kal\u0131nl\u0131k",text_size:"Boyut",text_font:"Yaz\u0131 tipi",text_props:"Metin",positioning_tab:"Konumland\u0131rma",list_tab:"Listele",border_tab:"Kenarl\u0131k",box_tab:"Kutu",block_tab:"Blok",background_tab:"Arkaplan",text_tab:"Metin",apply:"Uygula",title:"CSS Stilini D\u00fczenle",clip:"K\u0131rp",placement:"Yerle\u015ftir",overflow:"Ta\u015fma",zindex:"Z-indeksi",visibility:"G\u00f6r\u00fcn\u00fcrl\u00fck",positioning_type:"Tip",position:"Konum",bullet_image:"Madde imi resmi",list_type:"Tip",color:"Renk",height:"Y\u00fckseklik",width:"Geni\u015flik",style:"Stil",margin:"Kenar bo\u015flu\u011fu",left:"Sol",bottom:"Alt",right:"Sa\u011f",top:"\u00dcst",same:"T\u00fcm\u00fc i\u00e7in",padding:"Dolgu",box_clear:"Serbest",box_float:"Kayan",box_height:"Y\u00fckseklik",box_width:"Geni\u015flik",block_display:"G\u00f6r\u00fcnt\u00fcle",block_whitespace:"Bo\u015fluk",block_text_indent:"Metnin girintisini art\u0131r",block_text_align:"Metin hizala",block_vertical_alignment:"Dikey hizalama",block_letterspacing:"harf bo\u015flu\u011fu",block_wordspacing:"Kelime bo\u015flu\u011fu",background_vpos:"Dikey konum",background_hpos:"Yatay konum",background_attachment:"Eklenti",background_repeat:"Tekrarla",background_image:"Arkaplan resmi",background_color:"Arkaplan rengi",text_none:"hi\u00e7biri",text_blink:"yan\u0131p s\u00f6nen",text_case:"Ko\u015ful",text_striketrough:"\u00fcst\u00fc \u00e7izgili",text_underline:"alt \u00e7izgi",text_overline:"\u00fcst \u00e7izgi",text_decoration:"Dekorasyon",text_color:"Renk"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/tt_dlg.js b/js/tiny_mce/plugins/style/langs/tt_dlg.js new file mode 100755 index 000000000..cdd6b191f --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u8b8a\u9ad4",text_style:"\u6a23\u5f0f",text_weight:"\u5bec\u5ea6",text_size:"\u5927\u5c0f",text_font:"\u5b57\u9ad4",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u908a\u6846",box_tab:"\u76d2\u6a21\u578b",block_tab:"\u5340\u584a",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u61c9\u7528",title:"\u7de8\u8f2f CSS \u6a23\u5f0f\u8868",clip:"\u526a\u8f2f",placement:"\u4f48\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z\u5ea7\u6a19",visibility:"\u662f\u5426\u53ef\u898b",positioning_type:"\u4f4d\u7f6e\u985e\u578b",position:"\u5716\u7247\u4f4d\u7f6e",bullet_image:"\u6e05\u55ae\u5716\u7247",list_type:"\u5217\u8868\u985e\u578b",color:"\u9854\u8272",height:"\u9ad8\u5ea6",width:"\u5bec\u5ea6",style:"\u6a23\u5f0f",margin:"\u908a\u8ddd",left:"\u5de6\u5074",bottom:"\u5e95\u90e8",right:"\u53f3\u5074",top:"\u9802\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5167\u908a\u8ddd",box_clear:"\u6e05\u9664",box_float:"\u6d6e\u52d5",box_height:"\u9ad8\u5ea6",box_width:"\u5bec\u5ea6",block_display:"\u986f\u793a\u65b9\u5f0f",block_whitespace:"\u7a7a\u683c",block_text_indent:"\u6587\u5b57\u7e2e\u6392",block_text_align:"\u6587\u5b57\u5c0d\u9f4a",block_vertical_alignment:"\u5782\u76f4\u5c0d\u9f4a\u65b9\u5f0f",block_letterspacing:"\u5b57\u6bcd\u9593\u8ddd",block_wordspacing:"\u8a5e\u9593\u8ddd",background_vpos:"\u5782\u76f4\u4f4d\u7f6e",background_hpos:"\u6c34\u5e73\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u5fa9",background_image:"\u80cc\u666f\u5716\u7247",background_color:"\u80cc\u666f\u9854\u8272",text_none:"\u7121",text_blink:"\u9583\u720d",text_case:"\u5b57\u9ad4",text_striketrough:"\u4e2d\u5283\u7dda",text_underline:"\u5e95\u7dda",text_overline:"\u4e0a\u5283\u7dda",text_decoration:"\u88dd\u98fe",text_color:"\u9854\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/tw_dlg.js b/js/tiny_mce/plugins/style/langs/tw_dlg.js new file mode 100755 index 000000000..d7a4ae160 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u8b8a\u9ad4",text_style:"\u6a23\u5f0f",text_weight:"\u5b57\u5bec",text_size:"\u5b57\u578b\u5927\u5c0f",text_font:"\u5b57\u9ad4",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u908a\u6846",box_tab:"\u65b9\u584a",block_tab:"\u5340\u584a",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5957\u7528",title:"\u7de8\u8f2f CSS \u6a23\u5f0f\u8868",clip:"\u526a\u8f2f",placement:"\u4f48\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z-\u5750\u6a19",visibility:"\u53ef\u898b",positioning_type:"\u985e\u578b",position:"\u4f4d\u7f6e",bullet_image:"\u5716\u7247\u9805\u76ee\u7b26\u865f",list_type:"\u985e\u578b\u5217\u8868",color:"\u984f\u8272",height:"\u9ad8",width:"\u5bec",style:"\u6a23\u5f0f",margin:"\u5916\u908a\u8ddd",left:"\u5de6\u5074",bottom:"\u9760\u4e0b",right:"\u53f3\u5074",top:"\u9802\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5167\u908a\u8ddd",box_clear:"\u6e05\u9664\u6d6e\u52d5",box_float:"\u6d6e\u52d5",box_height:"\u9ad8",box_width:"\u5bec",block_display:"\u986f\u793a",block_whitespace:"\u7a7a\u683c",block_text_indent:"\u6587\u5b57\u7e2e\u6392",block_text_align:"\u6587\u5b57\u5c0d\u9f4a",block_vertical_alignment:"\u5782\u76f4\u5c0d\u9f4a",block_letterspacing:"\u5b57\u6bcd\u9593\u8ddd",block_wordspacing:"\u8a5e\u9593\u8ddd",background_vpos:"\u5782\u76f4\u4f4d\u7f6e",background_hpos:"\u6c34\u5e73\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u8907",background_image:"\u80cc\u666f\u5716\u7247",background_color:"\u80cc\u666f\u984f\u8272",text_none:"\u7121",text_blink:"\u9583\u720d",text_case:"\u5b57\u578b",text_striketrough:"\u522a\u9664\u7dda",text_underline:"\u5e95\u7dda",text_overline:"\u4e0a\u5283\u7dda",text_decoration:"\u88dd\u98fe",text_color:"\u984f\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/uk_dlg.js b/js/tiny_mce/plugins/style/langs/uk_dlg.js new file mode 100755 index 000000000..f323e392a --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.style_dlg',{text_lineheight:"\u0412\u0438\u0441\u043e\u0442\u0430 \u0440\u044f\u0434\u043a\u0443",text_variant:"\u0412\u0430\u0440\u0456\u0430\u043d\u0442",text_style:"\u0421\u0442\u0438\u043b\u044c",text_weight:"\u0422\u043e\u0432\u0449\u0438\u043d\u0430",text_size:"\u0420\u043e\u0437\u043c\u0456\u0440",text_font:"\u0428\u0440\u0438\u0444\u0442",text_props:"\u0422\u0435\u043a\u0441\u0442",positioning_tab:"\u041f\u043e\u0437\u0438\u0446\u0456\u043e\u043d\u0443\u0432\u0430\u043d\u043d\u044f",list_tab:"\u0421\u043f\u0438\u0441\u043e\u043a",border_tab:"\u0420\u0430\u043c\u043a\u0430",box_tab:"\u042f\u0449\u0438\u043a(box)",block_tab:"\u0411\u043b\u043e\u043a",background_tab:"\u0424\u043e\u043d",text_tab:"\u0422\u0435\u043a\u0441\u0442",apply:"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u0442\u0438",title:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f CSS \u0441\u0442\u0438\u043b\u044e",clip:"\u0421\u043a\u0440\u0456\u043f\u043b\u0435\u043d\u043d\u044f",placement:"\u0420\u043e\u0437\u043c\u0456\u0449\u0435\u043d\u043d\u044f",overflow:"\u041f\u0435\u0440\u0435\u043f\u043e\u0432\u043d\u0435\u043d\u043d\u044f",zindex:"Z-\u0456\u043d\u0434\u0435\u043a\u0441",visibility:"\u0412\u0438\u0434\u0438\u043c\u0456\u0441\u0442\u044c",positioning_type:"\u0422\u0438\u043f",position:"\u041f\u043e\u0437\u0438\u0446\u0456\u044f",bullet_image:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043d\u0430\u0447\u043a\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0443",list_type:"\u0422\u0438\u043f",color:"\u041a\u043e\u043b\u0456\u0440",height:"\u0412\u0438\u0441\u043e\u0442\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",style:"\u0421\u0442\u0438\u043b\u044c",margin:"Margin",left:"\u041b\u0456\u0432\u043e\u0440\u0443\u0447",bottom:"\u0417\u043d\u0438\u0437\u0443",right:"\u041f\u0440\u0430\u0432\u043e\u0440\u0443\u0447",top:"\u0412\u0433\u043e\u0440\u0443",same:"\u041e\u0434\u043d\u0430\u043a\u043e\u0435 \u0434\u043b\u044f \u0432\u0441\u0456\u0445",padding:"\u0412\u043d\u0443\u0442\u0440\u0456\u0448\u043d\u0456\u0439 \u0432\u0456\u0434\u0441\u0442\u0443\u043f",box_clear:"\u041e\u0447\u0438\u0441\u0442\u043a\u0430",box_float:"\u041f\u043b\u0430\u0432\u0430\u043d\u043d\u044f",box_height:"\u0412\u0438\u0441\u043e\u0442\u0430",box_width:"\u0428\u0438\u0440\u0438\u043d\u0430",block_display:"\u0412\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u0438",block_whitespace:"\u041f\u0440\u043e\u0431\u0456\u043b",block_text_indent:"\u0412\u0456\u0434\u0441\u0442\u0443\u043f",block_text_align:"\u0412\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f \u0442\u0435\u043a\u0441\u0442\u0443",block_vertical_alignment:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0435 \u0432\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",block_letterspacing:"\u0412\u0456\u0434\u0441\u0442\u0443\u043f\u0438 \u043c\u0456\u0436 \u043b\u0456\u0442\u0435\u0440\u0430\u043c\u0438",block_wordspacing:"\u0412\u0456\u0434\u0441\u0442\u0443\u043f\u0438 \u043c\u0456\u0436 \u0441\u043b\u043e\u0432\u0430\u043c\u0438",background_vpos:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0456\u044f",background_hpos:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0456\u044f",background_attachment:"\u0412\u043a\u043b\u0430\u0434\u0435\u043d\u043d\u044f",background_repeat:"\u041f\u043e\u0432\u0442\u043e\u0440",background_image:"\u0424\u043e\u043d\u043e\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",background_color:"\u041a\u043e\u043b\u0456\u0440 \u0444\u043e\u043d\u0443",text_none:"\u041d\u0456\u0447\u043e\u0433\u043e",text_blink:"\u041c\u0435\u0440\u0435\u0445\u0442\u0456\u043d\u043d\u044f",text_case:"\u0420\u0435\u0433\u0456\u0441\u0442\u0440",text_striketrough:"\u0417\u0430\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u0438\u0439",text_underline:"\u041f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u0438\u0439",text_overline:"\u041d\u0430\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u0438\u0439",text_decoration:"\u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u044f",text_color:"\u041a\u043e\u043b\u0456\u0440"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/ur_dlg.js b/js/tiny_mce/plugins/style/langs/ur_dlg.js new file mode 100755 index 000000000..c52148f24 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.style_dlg',{text_lineheight:"Line height",text_variant:"Variant",text_style:"Style",text_weight:"Weight",text_size:"Size",text_font:"Font",text_props:"Text",positioning_tab:"Positioning",list_tab:"List",border_tab:"Border",box_tab:"Box",block_tab:"Block",background_tab:"Background",text_tab:"Text",apply:"Apply",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility",positioning_type:"Type",position:"Position",bullet_image:"Bullet image",list_type:"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for all",padding:"Padding",box_clear:"Clear",box_float:"Float",box_height:"Height",box_width:"Width",block_display:"Display",block_whitespace:"Whitespace",block_text_indent:"Text indent",block_text_align:"Text align",block_vertical_alignment:"Vertical alignment",block_letterspacing:"Letter spacing",block_wordspacing:"Word spacing",background_vpos:"Vertical position",background_hpos:"Horizontal position",background_attachment:"Attachment",background_repeat:"Repeat",background_image:"Background image",background_color:"Background color",text_none:"none",text_blink:"blink",text_case:"Case",text_striketrough:"strikethrough",text_underline:"underline",text_overline:"overline",text_decoration:"Decoration",text_color:"Color"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/vi_dlg.js b/js/tiny_mce/plugins/style/langs/vi_dlg.js new file mode 100755 index 000000000..43c54aefd --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.style_dlg',{text_lineheight:"Chi\u1ec1u cao \u0111\u01b0\u1eddng",text_variant:"Bi\u1ebfn \u0111\u1ed5i",text_style:"Ki\u1ec3u d\u00e1ng",text_weight:"Tr\u1ecdng l\u01b0\u1ee3ng",text_size:"K\u00edch c\u1ee1",text_font:"Ph\u00f4ng",text_props:"V\u0103n b\u1ea3n",positioning_tab:"V\u1ecb tr\u00ed",list_tab:"Danh s\u00e1ch",border_tab:"Vi\u1ec1n",box_tab:"H\u1ed9p",block_tab:"Kh\u1ed1i",background_tab:"N\u1ec1n",text_tab:"V\u0103n b\u1ea3n",apply:"\u00c1p d\u1ee5ng",title:"S\u1eeda ki\u1ec3u d\u00e1ng CSS",clip:"Ghim",placement:"S\u1eafp \u0111\u1eb7t",overflow:"Tr\u00e0n",zindex:"Ch\u1ec9 m\u1ee5c Z",visibility:"Nh\u00ecn th\u1ea5y",positioning_type:"Ki\u1ec3u",position:"V\u1ecb tr\u00ed",bullet_image:"\u1ea2nh Bullet",list_type:"Ki\u1ec3u",color:"M\u00e0u",height:"Chi\u1ec1u cao",width:"Chi\u1ec1u r\u1ed9ng",style:"Ki\u1ec3u",margin:"Bi\u00ean",left:"Tr\u00e1i",bottom:"D\u01b0\u1edbi",right:"Ph\u1ea3i",top:"Tr\u00ean",same:"\u00c1p d\u1ee5ng cho t\u1ea5t c\u1ea3",padding:"\u0110\u1ec7m l\u00f3t",box_clear:"L\u00e0m s\u1ea1ch",box_float:"N\u1ed5i",box_height:"Chi\u1ec1u cao",box_width:"Chi\u1ec1u r\u1ed9ng",block_display:"Hi\u1ec3n th\u1ecb",block_whitespace:"Kho\u1ea3ng tr\u1eafng",block_text_indent:"Th\u1ee5t d\u00f2ng v\u0103n b\u1ea3n",block_text_align:"Canh l\u1ec1 v\u0103n b\u1ea3n",block_vertical_alignment:"Canh l\u1ec1 d\u1ecdc",block_letterspacing:"Kho\u1ea3ng c\u00e1c k\u00fd t\u1ef1",block_wordspacing:"Kho\u1ea3ng c\u00e1c t\u1eeb",background_vpos:"V\u1ecb tr\u00ed d\u1ecdc",background_hpos:"V\u1ecb tr\u00ed ngang",background_attachment:"\u0110\u00ednh k\u00e8m",background_repeat:"L\u1eb7p l\u1ea1i",background_image:"\u1ea2nh n\u1ec1n",background_color:"M\u00e0u n\u1ec1n",text_none:"kh\u00f4ng",text_blink:"nh\u1ea5p nh\u00e1y",text_case:"Bo\u0323c",text_striketrough:"g\u1ea1ch xuy\u00ean",text_underline:"g\u1ea1ch d\u01b0\u1edbi",text_overline:"g\u1ea1ch tr\u00ean",text_decoration:"Trang tr\u00ed",text_color:"M\u00e0u"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/style/langs/zh-cn_dlg.js new file mode 100755 index 000000000..ac56b1418 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.style_dlg',{"text_lineheight":"\u884c\u9ad8","text_variant":"\u53d8\u5f62","text_style":"\u6837\u5f0f","text_weight":"\u7c97\u7ec6","text_size":"\u5927\u5c0f","text_font":"\u5b57\u4f53","text_props":"\u6587\u672c","positioning_tab":"\u4f4d\u7f6e","list_tab":"\u5217\u8868","border_tab":"\u8fb9\u6846","box_tab":"Box","block_tab":"\u533a\u5757","background_tab":"\u80cc\u666f","text_tab":"\u6587\u672c",apply:"\u5e94\u7528",title:"\u7f16\u8f91CSS\u6837\u5f0f",clip:"\u526a\u8f91",placement:"\u653e\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z-Index",visibility:"\u53ef\u89c1","positioning_type":"\u7c7b\u578b",position:"\u4f4d\u7f6e","bullet_image":"\u56fe\u7247\u9879\u76ee\u7b26\u53f7","list_type":"\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",style:"\u6837\u5f0f",margin:"\u5916\u8fb9\u8ddd",left:"\u5de6",bottom:"\u4e0b",right:"\u53f3",top:"\u4e0a",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5185\u8fb9\u8ddd","box_clear":"\u6e05\u9664\u6d6e\u52a8","box_float":"\u6d6e\u52a8","box_height":"\u9ad8\u5ea6","box_width":"\u5bbd\u5ea6","block_display":"\u663e\u793a","block_whitespace":"\u7a7a\u683c","block_text_indent":"\u6587\u5b57\u7f29\u6392","block_text_align":"\u6587\u5b57\u5bf9\u9f50","block_vertical_alignment":"\u5782\u76f4\u5bf9\u9f50","block_letterspacing":"\u5b57\u95f4\u8ddd","block_wordspacing":"\u8bcd\u95f4\u8ddd","background_vpos":"\u5782\u76f4\u4f4d\u7f6e","background_hpos":"\u6c34\u5e73\u4f4d\u7f6e","background_attachment":"\u9644\u4ef6","background_repeat":"\u91cd\u590d","background_image":"\u80cc\u666f\u56fe\u7247","background_color":"\u80cc\u666f\u989c\u8272","text_none":"\u65e0","text_blink":"\u95ea\u70c1","text_case":"\u5b57\u4f53\u5f62\u5f0f","text_striketrough":"\u5220\u9664\u7ebf","text_underline":"\u4e0b\u5212\u7ebf","text_overline":"\u4e0a\u5212\u7ebf","text_decoration":"\u5b57\u4f53\u88c5\u9970","text_color":"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/zh_dlg.js b/js/tiny_mce/plugins/style/langs/zh_dlg.js new file mode 100755 index 000000000..2f5dc0216 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u53d8\u91cf",text_style:"\u6837\u5f0f",text_weight:"\u5b57\u91cd",text_size:"\u6587\u5b57\u5927\u5c0f",text_font:"\u5b57\u4f53",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u8fb9\u6846",box_tab:"\u65b9\u5757",block_tab:"\u533a\u5757",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5957\u7528",title:"\u7f16\u8f91 CSS \u6837\u5f0f\u8868",clip:"\u526a\u8f91",placement:"\u653e\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z-\u5750\u6807",visibility:"\u53ef\u89c1",positioning_type:"\u7c7b\u578b",position:"\u4f4d\u7f6e",bullet_image:"\u56fe\u7247\u9879\u76ee\u7b26\u53f7",list_type:"\u7c7b\u8868\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8",width:"\u5bbd",style:"\u6837\u5f0f",margin:"\u5916\u8fb9\u8ddd",left:"\u5de6\u4fa7",bottom:"\u9760\u4e0b",right:"\u53f3\u4fa7",top:"\u5b9a\u90e8",same:"\u5168\u90e8\u76f8\u540c",padding:"\u5185\u8fb9\u8ddd",box_clear:"\u6e05\u9664\u6d6e\u52a8",box_float:"\u6d6e\u52a8",box_height:"\u9ad8",box_width:"\u5bbd",block_display:"\u663e\u793a",block_whitespace:"\u7a7a\u683c",block_text_indent:"\u6587\u5b57\u7f29\u6392",block_text_align:"\u6587\u5b57\u5bf9\u9f50",block_vertical_alignment:"\u5782\u76f4\u5bf9\u9f50",block_letterspacing:"\u5b57\u6bcd\u95f4\u8ddd",block_wordspacing:"\u95f4\u8ddd",background_vpos:"\u5782\u76f4\u4f4d\u7f6e",background_hpos:"\u6c34\u5e73\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u590d",background_image:"\u80cc\u666f\u56fe\u7247",background_color:"\u80cc\u666f\u989c\u8272",text_none:"\u65e0",text_blink:"\u95ea\u70c1",text_case:"\u5b57\u578b",text_striketrough:"\u5220\u9664\u7ebf",text_underline:"\u5e95\u7ebf",text_overline:"\u4e0a\u5212\u7ebf",text_decoration:"\u88c5\u9970",text_color:"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/langs/zu_dlg.js b/js/tiny_mce/plugins/style/langs/zu_dlg.js new file mode 100755 index 000000000..8ef113491 --- /dev/null +++ b/js/tiny_mce/plugins/style/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.style_dlg',{text_lineheight:"\u884c\u9ad8",text_variant:"\u53d8\u4f53",text_style:"\u6837\u5f0f",text_weight:"\u5bbd\u5ea6",text_size:"\u5c3a\u5bf8",text_font:"\u5b57\u4f53",text_props:"\u6587\u5b57",positioning_tab:"\u4f4d\u7f6e",list_tab:"\u5217\u8868",border_tab:"\u8fb9\u6846",box_tab:"\u7bb1\u578b",block_tab:"\u5757",background_tab:"\u80cc\u666f",text_tab:"\u6587\u5b57",apply:"\u5e94\u7528",title:"\u7f16\u8f91CSS\u6837\u5f0f\u8868",clip:"\u526a\u8f91",placement:"\u5e03\u7f6e",overflow:"\u6ea2\u51fa",zindex:"Z\u8f74\u6df1\u5ea6",visibility:"\u53ef\u89c1\u6027",positioning_type:"\u7c7b\u578b",position:"\u56fe\u793a\u4f4d\u7f6e",bullet_image:"\u9879\u76ee\u56fe\u793a",list_type:"\u7c7b\u578b",color:"\u989c\u8272",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",style:"\u6837\u5f0f",margin:"\u8fb9\u754c",left:"\u9760\u5de6",bottom:"\u4e0b\u65b9",right:"\u9760\u53f3",top:"\u4e0a\u65b9",same:"\u5168\u90e8\u4e00\u6837",padding:"\u7559\u767d",box_clear:"\u6e05\u9664",box_float:"\u6d6e\u52a8",box_height:"\u9ad8\u5ea6",box_width:"\u5bbd\u5ea6",block_display:"\u663e\u793a\u65b9\u5f0f",block_whitespace:"\u7a7a\u767d",block_text_indent:"\u6587\u5b57\u7f29\u6392",block_text_align:"\u6587\u5b57\u5bf9\u9f50",block_vertical_alignment:"\u6c34\u51c6\u5bf9\u9f50\u65b9\u5f0f",block_letterspacing:"\u5b57\u5143\u95f4\u8ddd",block_wordspacing:"\u5355\u5b57\u95f4\u8ddd",background_vpos:"\u6c34\u51c6\u4f4d\u7f6e",background_hpos:"\u5782\u76f4\u4f4d\u7f6e",background_attachment:"\u9644\u4ef6",background_repeat:"\u91cd\u590d",background_image:"\u80cc\u666f\u56fe\u7247",background_color:"\u80cc\u666f\u989c\u8272",text_none:"\u65e0",text_blink:"\u95ea\u70c1",text_case:"\u5b57\u4f53",text_striketrough:"\u5220\u9664\u7ebf",text_underline:"\u5e95\u7ebf",text_overline:"\u4e0a\u5212\u7ebf",text_decoration:"\u4fee\u9970",text_color:"\u989c\u8272"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/style/props.htm b/js/tiny_mce/plugins/style/props.htm new file mode 100644 index 000000000..b5a3d15d9 --- /dev/null +++ b/js/tiny_mce/plugins/style/props.htm @@ -0,0 +1,838 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
        + + +
        +
        +
        + {#style_dlg.text} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + + + + + + +
          + + +
        +
        + +
        + + + +
        + + + + + + +
        + +   + + +
        +
        + +
        + + + + + +
         
        +
        {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        +
        + +
        +
        + {#style_dlg.background} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +
         
        +
        + + + + +
         
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        +
        +
        + +
        +
        + {#style_dlg.block} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + + +
        +
        +
        +
        + +
        +
        + {#style_dlg.box} + + + + + + + + + + + + + + +
        + + + + + + +
          + + +
        +
           
        + + + + + + +
          + + +
        +
           
        +
        +
        + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
         
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        +
        +
        + +
        +
        + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
         
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        + + + + + + +
          + + +
        +
        +
        +
        +
        +
        + +
        +
        + {#style_dlg.border} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
              
        {#style_dlg.top}   + + + + + + +
          + + +
        +
          + + + + + +
         
        +
        {#style_dlg.right}   + + + + + + +
          + + +
        +
          + + + + + +
         
        +
        {#style_dlg.bottom}   + + + + + + +
          + + +
        +
          + + + + + +
         
        +
        {#style_dlg.left}   + + + + + + +
          + + +
        +
          + + + + + +
         
        +
        +
        +
        + +
        +
        + {#style_dlg.list} + + + + + + + + + + + + + + + +
        +
        +
        + +
        +
        + {#style_dlg.position} + + + + + + + + + + + + + + + + + + + + + +
           
        + + + + + + +
          + + +
        +
           
        + + + + + + +
          + + +
        +
           
        + +
        +
        + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
         
        {#style_dlg.top} + + + + + + +
          + + +
        +
        {#style_dlg.right} + + + + + + +
          + + +
        +
        {#style_dlg.bottom} + + + + + + +
          + + +
        +
        {#style_dlg.left} + + + + + + +
          + + +
        +
        +
        +
        + +
        +
        + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
         
        {#style_dlg.top} + + + + + + +
          + + +
        +
        {#style_dlg.right} + + + + + + +
          + + +
        +
        {#style_dlg.bottom} + + + + + + +
          + + +
        +
        {#style_dlg.left} + + + + + + +
          + + +
        +
        +
        +
        +
        +
        + +
        + +
        + + + +
        +
        + +
        +
        +
        + + + diff --git a/js/tiny_mce/plugins/table/cell.htm b/js/tiny_mce/plugins/table/cell.htm new file mode 100644 index 000000000..4afb6afa3 --- /dev/null +++ b/js/tiny_mce/plugins/table/cell.htm @@ -0,0 +1,178 @@ + + + + {#table_dlg.cell_title} + + + + + + + + +
        + + +
        +
        +
        + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + +
        +
        +
        + +
        +
        + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + + + + + +
         
        +
        + + + + + +
         
        +
        + + + + + +
         
        +
        +
        +
        +
        + +
        +
        + +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/table/css/cell.css b/js/tiny_mce/plugins/table/css/cell.css new file mode 100644 index 000000000..a067ecdfe --- /dev/null +++ b/js/tiny_mce/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/css/row.css b/js/tiny_mce/plugins/table/css/row.css new file mode 100644 index 000000000..1f7755daf --- /dev/null +++ b/js/tiny_mce/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/js/tiny_mce/plugins/table/css/table.css b/js/tiny_mce/plugins/table/css/table.css new file mode 100644 index 000000000..d11c3f69c --- /dev/null +++ b/js/tiny_mce/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/js/tiny_mce/plugins/table/editor_plugin.js b/js/tiny_mce/plugins/table/editor_plugin.js new file mode 100644 index 000000000..67b8cc859 --- /dev/null +++ b/js/tiny_mce/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +(function(c){var d=c.each;function b(f,g){var h=g.ownerDocument,e=h.createRange(),j;e.setStartBefore(g);e.setEnd(f.endContainer,f.endOffset);j=h.createElement("body");j.appendChild(e.cloneContents());return j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(H,G,K){var f,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;f=[];d(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);d(O,function(P,Q){Q+=M;d(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(f[Q]){while(f[Q][R]){R++}}U=h(W,"rowspan");V=h(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowspan",1);s(M,"colspan",1);if(N){M.appendChild(N)}else{if(!c.isIE){M.innerHTML='
        '}}return M}function q(){var M=G.createRng();d(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}d(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=f[Math.min(f.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=f[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=f[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(e(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(e(P.cells[0]),P.cells[0])}}}}}function C(){d(f,function(M,N){d(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=h(P,"colspan");R=h(P,"rowspan");if(S>1||R>1){s(P,"rowspan",1);s(P,"colspan",1);for(Q=0;Q1){s(S,"rowspan",O+1);continue}}else{if(M>0&&f[M-1][R]){V=f[M-1][R].elm;O=h(V,"rowspan");if(O>1){s(V,"rowspan",O+1);continue}}}N=e(S);s(N,"colspan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function g(N){var O,M;d(f,function(P,Q){d(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});d(f,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=h(P,"colspan");Q=h(P,"rowspan");if(R==1){if(!N){G.insertAfter(e(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(e(P),P);u(O,T,Q-1,R)}}else{s(P,"colspan",P.colSpan+1)}M=P}})}function n(){var M=[];d(f,function(N,O){d(N,function(Q,P){if(j(Q)&&c.inArray(M,P)===-1){d(f,function(T){var R=T[P].elm,S;S=h(R,"colspan");if(S>1){s(R,"colspan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");d(Q.cells,function(S){var T=h(S,"rowspan");if(T>1){s(S,"rowspan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);d(f[R.y],function(S){var T;S=S.elm;if(S!=O){T=h(S,"rowspan");if(T<=1){G.remove(S)}else{s(S,"rowspan",T-1)}O=S}})}N=k();d(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();d(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;d(f,function(S){var R;Q=0;d(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}d(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=f[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(f[y][x]){G.addClass(f[y][x].elm,"mceSelected")}}}}}c.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:g,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}c.create("tinymce.plugins.TablePlugin",{init:function(f,g){var e,k;function j(n){var m=f.selection,l=f.dom.getParent(n||m.getNode(),"table");if(l){return new a(l,f.dom,m)}}function h(){f.getBody().style.webkitUserSelect="";f.dom.removeClass(f.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}d([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(l){f.addButton(l[0],{title:l[1],cmd:l[2],ui:l[3]})});if(!c.isIE){f.onClick.add(function(l,m){m=m.target;if(m.nodeName==="TABLE"){l.selection.select(m);l.nodeChanged()}})}f.onPreProcess.add(function(m,n){var l,o,p,r=m.dom,q;l=r.select("table",n.node);o=l.length;while(o--){p=l[o];r.setAttrib(p,"data-mce-style","");if((q=r.getAttrib(p,"width"))){r.setStyle(p,"width",q);r.setAttrib(p,"width","")}if((q=r.getAttrib(p,"height"))){r.setStyle(p,"height",q);r.setAttrib(p,"height","")}}});f.onNodeChange.add(function(m,l,q){var o;q=m.selection.getStart();o=m.dom.getParent(q,"td,th,caption");l.setActive("table",q.nodeName==="TABLE"||!!o);if(o&&o.nodeName==="CAPTION"){o=0}l.setDisabled("delete_table",!o);l.setDisabled("delete_col",!o);l.setDisabled("delete_table",!o);l.setDisabled("delete_row",!o);l.setDisabled("col_after",!o);l.setDisabled("col_before",!o);l.setDisabled("row_after",!o);l.setDisabled("row_before",!o);l.setDisabled("row_props",!o);l.setDisabled("cell_props",!o);l.setDisabled("split_cells",!o);l.setDisabled("merge_cells",!o)});f.onInit.add(function(m){var l,p,q=m.dom,n;e=m.windowManager;m.onMouseDown.add(function(r,s){if(s.button!=2){h();p=q.getParent(s.target,"td,th");l=q.getParent(p,"table")}});q.bind(m.getDoc(),"mouseover",function(u){var s,r,t=u.target;if(p&&(n||t!=p)&&(t.nodeName=="TD"||t.nodeName=="TH")){r=q.getParent(t,"table");if(r==l){if(!n){n=j(r);n.setStartCell(p);m.getBody().style.webkitUserSelect="none"}n.setEndCell(t)}s=m.selection.getSel();if(s.removeAllRanges){s.removeAllRanges()}else{s.empty()}u.preventDefault()}});m.onMouseUp.add(function(A,B){var s,u=A.selection,C,D=u.getSel(),r,v,t,z;if(p){if(n){A.getBody().style.webkitUserSelect=""}function w(E,G){var F=new c.dom.TreeWalker(E,E);do{if(E.nodeType==3&&c.trim(E.nodeValue).length!=0){if(G){s.setStart(E,0)}else{s.setEnd(E,E.nodeValue.length)}return}if(E.nodeName=="BR"){if(G){s.setStartBefore(E)}else{s.setEndBefore(E)}return}}while(E=(G?F.next():F.prev()))}C=q.select("td.mceSelected,th.mceSelected");if(C.length>0){s=q.createRng();v=C[0];z=C[C.length-1];w(v,1);r=new c.dom.TreeWalker(v,q.getParent(C[0],"table"));do{if(v.nodeName=="TD"||v.nodeName=="TH"){if(!q.hasClass(v,"mceSelected")){break}t=v}}while(v=r.next());w(t);u.setRng(s)}A.nodeChanged();p=n=l=null}});m.onKeyUp.add(function(r,s){h()});if(m&&m.plugins.contextmenu){m.plugins.contextmenu.onContextMenu.add(function(t,r,v){var w,u=m.selection,s=u.getNode()||m.getBody();if(m.dom.getParent(v,"td")||m.dom.getParent(v,"th")||m.dom.select("td.mceSelected,th.mceSelected").length){r.removeAll();if(s.nodeName=="A"&&!m.dom.getAttrib(s,"name")){r.add({title:"advanced.link_desc",icon:"link",cmd:m.plugins.advlink?"mceAdvLink":"mceLink",ui:true});r.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});r.addSeparator()}if(s.nodeName=="IMG"&&s.className.indexOf("mceItem")==-1){r.add({title:"advanced.image_desc",icon:"image",cmd:m.plugins.advimage?"mceAdvImage":"mceImage",ui:true});r.addSeparator()}r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});r.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});r.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});r.addSeparator();w=r.addMenu({title:"table.cell"});w.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});w.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});w.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});w=r.addMenu({title:"table.row"});w.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});w.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});w.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});w.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});w.addSeparator();w.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});w.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});w.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!k);w.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!k);w=r.addMenu({title:"table.col"});w.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});w.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});w.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{r.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!c.isIE){function o(){var r;for(r=m.getBody().lastChild;r&&r.nodeType==3&&!r.nodeValue.length;r=r.previousSibling){}if(r&&r.nodeName=="TABLE"){m.dom.add(m.getBody(),"p",null,'
        ')}}if(c.isGecko){m.onKeyDown.add(function(s,u){var r,t,v=s.dom;if(u.keyCode==37||u.keyCode==38){r=s.selection.getRng();t=v.getParent(r.startContainer,"table");if(t&&s.getBody().firstChild==t){if(b(r,t)){r=v.createRng();r.setStartBefore(t);r.setEndBefore(t);s.selection.setRng(r);u.preventDefault()}}}})}m.onKeyUp.add(o);m.onSetContent.add(o);m.onVisualAid.add(o);m.onPreProcess.add(function(r,t){var s=t.node.lastChild;if(s&&s.childNodes.length==1&&s.firstChild.nodeName=="BR"){r.dom.remove(s)}});o()}});d({mceTableSplitCells:function(l){l.split()},mceTableMergeCells:function(m){var n,o,l;l=f.dom.getParent(f.selection.getNode(),"th,td");if(l){n=l.rowSpan;o=l.colSpan}if(!f.dom.select("td.mceSelected,th.mceSelected").length){e.open({url:g+"/merge_cells.htm",width:240+parseInt(f.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(f.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:n,cols:o,onaction:function(p){m.merge(l,p.cols,p.rows)},plugin_url:g})}else{m.merge()}},mceTableInsertRowBefore:function(l){l.insertRow(true)},mceTableInsertRowAfter:function(l){l.insertRow()},mceTableInsertColBefore:function(l){l.insertCol(true)},mceTableInsertColAfter:function(l){l.insertCol()},mceTableDeleteCol:function(l){l.deleteCols()},mceTableDeleteRow:function(l){l.deleteRows()},mceTableCutRow:function(l){k=l.cutRows()},mceTableCopyRow:function(l){k=l.copyRows()},mceTablePasteRowBefore:function(l){l.pasteRows(k,true)},mceTablePasteRowAfter:function(l){l.pasteRows(k)},mceTableDelete:function(l){l.deleteTable()}},function(m,l){f.addCommand(l,function(){var n=j();if(n){m(n);f.execCommand("mceRepaint");h()}})});d({mceInsertTable:function(l){e.open({url:g+"/table.htm",width:400+parseInt(f.getLang("table.table_delta_width",0)),height:320+parseInt(f.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:l?l.action:0})},mceTableRowProps:function(){e.open({url:g+"/row.htm",width:400+parseInt(f.getLang("table.rowprops_delta_width",0)),height:295+parseInt(f.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})},mceTableCellProps:function(){e.open({url:g+"/cell.htm",width:400+parseInt(f.getLang("table.cellprops_delta_width",0)),height:295+parseInt(f.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}},function(m,l){f.addCommand(l,function(n,o){m(o)})})}});c.PluginManager.add("table",c.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/editor_plugin_src.js b/js/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100644 index 000000000..7bfe2735c --- /dev/null +++ b/js/tiny_mce/plugins/table/editor_plugin_src.js @@ -0,0 +1,1198 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
        '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowspan', 1); + setSpanVal(cell, 'colspan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
        '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowspan', 1); + setSpanVal(cell, 'colspan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colspan', (endX - startX) + 1); + setSpanVal(startCell, 'rowspan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowspan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowspan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colspan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colspan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colspan'); + + if (colSpan > 1) + setSpanVal(cell, 'colspan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowspan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowspan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowspan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowspan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colspan', 1); + setSpanVal(cell, 'rowspan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows; + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + } + + // Remove current selection + sel = ed.selection.getSel(); + + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + }; + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + if (!tinymce.isIE) { + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') + ed.dom.add(ed.getBody(), 'p', null, '
        '); + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') + ed.dom.remove(last); + }); + + fixTableCaretPos(); + } + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/js/cell.js b/js/tiny_mce/plugins/table/js/cell.js new file mode 100644 index 000000000..45e6061fd --- /dev/null +++ b/js/tiny_mce/plugins/table/js/cell.js @@ -0,0 +1,284 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + if (!ed.dom.hasClass(tdElm, 'mceSelected')) { + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + } else + tinyMCEPopup.dom.hide('action'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getStart(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + // Cell is selected + if (ed.dom.hasClass(tdElm, 'mceSelected')) { + // Update all selected sells + tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { + updateCell(td); + }); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + dom.setAttrib(elm, 'border', border); + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
        '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var td = dom.select('td', node); + + try { + // IE9 might fail to do this selection + inst.selection.select(td[0], true); + inst.selection.collapse(); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel'); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/table/langs/ar_dlg.js b/js/tiny_mce/plugins/table/langs/ar_dlg.js new file mode 100755 index 000000000..4870568cc --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ar_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ar.table_dlg',{rules_border:"\u0627\u0644\u062d\u062f\u0648\u062f",rules_box:"\u0635\u0646\u062f\u0648\u0642",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u0623\u062f\u0646\u0627\u0647",rules_above:"\u0623\u0639\u0644\u0649",rules_void:"\u0623\u0644\u063a\u0649",rules:"\u0642\u0648\u0627\u0639\u062f",frame_all:"\u0643\u0627\u0641\u0629",frame_cols:"\u0623\u0639\u0645\u062f\u0629",frame_rows:"\u0627\u0644\u0635\u0641\u0648\u0641",frame_groups:"\u0627\u0644\u0645\u062c\u0645\u0648\u0639\u0627\u062a",frame_none:"\u0644\u0627 \u0634\u064a\u0621",frame:"\u0627\u0644\u0625\u0637\u0627\u0631",caption:"\u0627\u0644\u062c\u062f\u0648\u0644 \u0627\u0644\u062a\u0648\u0636\u064a\u062d\u064a\u0629",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"\u0644\u0642\u062f \u062a\u062c\u0627\u0648\u0632\u062a \u0627\u0644\u062d\u062f \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062f\u062f \u0645\u0646 \u0627\u0644\u062e\u0644\u0627\u064a\u0627 {$cells}.",row_limit:"\u0644\u0642\u062f \u062a\u062c\u0627\u0648\u0632\u062a \u0627\u0644\u062d\u062f \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062f\u062f \u0627\u0644\u0635\u0641\u0648\u0641 {$rows}.",col_limit:"\u0644\u0642\u062f \u062a\u062c\u0627\u0648\u0632\u062a \u0627\u0644\u062d\u062f \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062f\u062f \u0623\u0639\u0645\u062f\u0629 {$cols}.",colgroup:"\u0645\u062c\u0645\u0648\u0639\u0629 \u0623\u0639\u0645\u062f\u0629 ",rowgroup:" \u0645\u062c\u0645\u0648\u0639\u0629 \u0635\u0641",scope:"\u0646\u0637\u0627\u0642",tfoot:"\u0627\u0644\u062c\u062f\u0648\u0644 \u0627\u0644\u0642\u062f\u0645",tbody:" \u0627\u0644\u062c\u062f\u0648\u0644 \u062c\u0633\u062f",thead:"\u0627\u0644\u062c\u062f\u0648\u0644 \u0631\u0626\u064a\u0633",row_all:"\u062a\u062d\u062f\u064a\u062b \u0643\u0627\u0641\u0629 \u0627\u0644\u0635\u0641\u0648\u0641 \u0641\u064a \u0627\u0644\u062c\u062f\u0648\u0644",row_even:" \u062a\u062d\u062f\u064a\u062b \u0627\u0644\u0635\u0641\u0648\u0641 \u0641\u064a \u0627\u0644\u062c\u062f\u0648\u0644 \u0632\u0648\u062c\u0649 \u0639\u062f\u062f",row_odd:"\u062a\u062d\u062f\u064a\u062b \u0627\u0644\u0635\u0641\u0648\u0641 \u0641\u064a \u0627\u0644\u062c\u062f\u0648\u0644 \u0645\u0641\u0631\u062f",row_row:"\u062a\u062d\u062f\u064a\u062b \u0627\u0644\u0635\u0641 \u0627\u0644\u062d\u0627\u0644\u064a",cell_all:"\u062d\u062f\u064a\u062b \u0643\u0627\u0641\u0629 \u0627\u0644\u062e\u0644\u0627\u064a\u0627 \u0641\u064a \u0627\u0644\u062c\u062f\u0648\u0644",cell_row:"\u062a\u062d\u062f\u064a\u062b \u0643\u0627\u0641\u0629 \u0627\u0644\u062e\u0644\u0627\u064a\u0627 \u0641\u064a \u0627\u0644\u0635\u0641",cell_cell:"\u062a\u062d\u062f\u064a\u062b \u0627\u0644\u062e\u0644\u064a\u0629 \u0627\u0644\u062d\u0627\u0644\u064a\u0629",th:"\u0631\u0623\u0633",td:"\u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a",summary:"\u0645\u0644\u062e\u0635",bgimage:"\u0635\u0648\u0631\u0629 \u0627\u0644\u062e\u0644\u0641\u064a\u0629",rtl:"\u0645\u0646 \u0627\u0644\u064a\u0645\u064a\u0646 \u0625\u0644\u0649 \u0627\u0644\u064a\u0633\u0627\u0631",ltr:"\u0645\u0646 \u0627\u0644\u064a\u0633\u0627\u0631 \u0625\u0644\u0649 \u0627\u0644\u064a\u0645\u064a\u0646",mime:"\u0627\u0644\u0647\u062f\u0641 \u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641",langcode:"\u0631\u0645\u0632 \u0627\u0644\u0644\u063a\u0629",langdir:"\u0627\u062a\u062c\u0627\u0647 \u0644\u063a\u0629",style:"\u0634\u0643\u0644",id:"Id",merge_cells_title:"\u062f\u0645\u062c \u0627\u0644\u062e\u0644\u0627\u064a\u0627",bgcolor:"\u0644\u0648\u0646 \u0627\u0644\u062e\u0644\u0641\u064a\u0629",bordercolor:"\u0644\u0648\u0646 \u0627\u0644\u062d\u062f\u0648\u062f",align_bottom:"\u0627\u0633\u0641\u0644",align_top:"\u0627\u0644\u0627\u0639\u0644\u0649",valign:"\u0627\u0644\u0645\u062d\u0627\u0630\u0627\u0629 \u0627\u0644\u0639\u0645\u0648\u062f\u064a\u0629",cell_type:"\u0646\u0648\u0639 \u0627\u0644\u062e\u0644\u064a\u0629",cell_title:"\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u062c\u062f\u0648\u0644 \u0627\u0644\u062e\u0644\u064a\u0629",row_title:"\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u062c\u062f\u0648\u0644 \u0627\u0644\u0635\u0641",align_middle:"\u0648\u0633\u0637",align_right:"\u064a\u0645\u064a\u0646",align_left:"\u064a\u0633\u0627\u0631",align_default:"\u0627\u0644\u0627\u0641\u062a\u0631\u0627\u0636\u064a",align:"\u0627\u0644\u0645\u062d\u0627\u0630\u0627\u0629",border:"\u0627\u0644\u062d\u062f\u0648\u062f",cellpadding:"\u0628\u0637\u0627\u0646\u0629 \u0627\u0644\u062e\u0644\u0627\u064a\u0627",cellspacing:"\u0628\u062a\u0628\u0627\u0639\u062f \u0627\u0644\u062e\u0644\u0627\u064a\u0627 ",rows:"\u0627\u0644\u0635\u0641\u0648\u0641",cols:"\u0623\u0639\u0645\u062f\u0629",height:"\u0637\u0648\u0644",width:"\u0639\u0631\u0636",title:"\u0625\u062f\u0631\u0627\u062c \u062c\u062f\u0648\u0644 / \u062a\u0639\u062f\u064a\u0644",rowtype:"\u0635\u0641 \u0641\u064a \u062c\u0632\u0621 \u0627\u0644\u062c\u062f\u0648\u0644",advanced_props:"\u0627\u0644\u062e\u0635\u0627\u0626\u0635 \u0627\u0644\u0639\u0627\u0645\u0629",general_props:"General properties",advanced_tab:"\u0645\u062a\u0642\u062f\u0645",general_tab:"\u0639\u0627\u0645"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/az_dlg.js b/js/tiny_mce/plugins/table/langs/az_dlg.js new file mode 100755 index 000000000..ba254dc96 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/az_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('az.table_dlg',{rules_border:"s\u0259rh\u0259d",rules_box:"konteyner",rules_vsides:"\u015faquli t\u0259r\u0259fl\u0259r",rules_rhs:"sa\u011f \u00fcf\u00fcqi t\u0259r\u0259fl\u0259r",rules_lhs:"sol \u00fcf\u00fcqi t\u0259r\u0259fl\u0259r",rules_hsides:"\u00fcf\u00fcqi t\u0259r\u0259fl\u0259r",rules_below:"a\u015fa\u011f\u0131dan",rules_above:"yuxar\u0131dan",rules_void:"he\u00e7 n\u0259",rules:"X\u0259ttl\u0259r",frame_all:"ham\u0131s\u0131",frame_cols:"s\u00fctunlar",frame_rows:"s\u0259trl\u0259r",frame_groups:"qruplar",frame_none:"he\u00e7n\u0259",frame:"\u00c7\u0259r\u00e7iv\u0259",caption:"C\u0259dv\u0259l ba\u015fl\u0131\u011f\u0131",missing_scope:"\u018fminsiniz ki, ba\u015fl\u0131q \u00f6z\u0259yinin h\u0259ddini g\u00f6st\u0259rm\u0259d\u0259n davam etm\u0259k ist\u0259yirsiniz? Bunsuz b\u0259zi i\u015f qabiliyy\u0259ti a\u015fa\u011f\u0131 olan istifad\u0259\u00e7il\u0259r\u0259 c\u0259dv\u0259lin m\u0259lumatlar\u0131 v\u0259 t\u0259rkibini anlamaq \u00e7\u0259tin olacaq.",cell_limit:"Siz \u00f6z\u0259kl\u0259rd\u0259 {$cells} maksimum say\u0131 a\u015fd\u0131n\u0131z.",row_limit:"Siz s\u0259trl\u0259rd\u0259 {$rows} maksimum say\u0131 a\u015fd\u0131n\u0131z.",col_limit:"Siz s\u00fctunlarda {$cols} maksimum say\u0131 a\u015fd\u0131n\u0131z.",colgroup:"S\u00fctun qrupu",rowgroup:"S\u0259tr qrupu",scope:"H\u0259dd",tfoot:"C\u0259dv\u0259lin a\u015fa\u011f\u0131 hiss\u0259si",tbody:"C\u0259dv\u0259lin \u0259sas hiss\u0259si",thead:"C\u0259dv\u0259lin yuxar\u0131 hiss\u0259si",row_all:"C\u0259dv\u0259ld\u0259ki b\u00fct\u00fcn s\u0259trl\u0259ri yenil\u0259",row_even:"C\u0259dv\u0259ld\u0259ki c\u00fct (\u0259d\u0259d) s\u0259trl\u0259ri yenil\u0259",row_odd:"C\u0259d\u0259ld\u0259ki t\u0259k (\u0259d\u0259d) s\u0259trl\u0259ri yenil\u0259",row_row:"Haz\u0131rki s\u0259tri yenil\u0259",cell_all:"C\u0259dv\u0259ld\u0259ki b\u00fct\u00fcn \u00f6z\u0259kl\u0259ri yenil\u0259",cell_row:"S\u0259trd\u0259ki b\u00fct\u00fcn \u00f6z\u0259kl\u0259ri yenil\u0259",cell_cell:"Haz\u0131rki \u00f6z\u0259yi yenil\u0259",th:"Ba\u015fl\u0131q",td:"Veril\u0259nl\u0259r",summary:"X\u00fclas\u0259",bgimage:"Fon \u015f\u0259kli",rtl:"Sa\u011fda-sola",ltr:"Solda-sa\u011fa",mime:"H\u0259d\u0259fli MIME-n\u00f6v",langcode:"Dil kodu",langdir:"Dil istiqam\u0259ti",style:"Stil",id:"\u0130dentifikator",merge_cells_title:"\u00d6z\u0259k stili",bgcolor:"Fon r\u0259ngi",bordercolor:"S\u0259rh\u0259d r\u0259ngi",align_bottom:"A\u015fa\u011f\u0131 il\u0259",align_top:"Yuxar\u0131 il\u0259",valign:"\u015eaquli tarazla\u015fma",cell_type:"\u00d6z\u0259k n\u00f6v\u00fc",cell_title:"\u00d6z\u0259k x\u00fcsusiyy\u0259ti",row_title:"S\u0259tr x\u00fcsusiyy\u0259ti",align_middle:"M\u0259rk\u0259z il\u0259",align_right:"Sa\u011fa",align_left:"Sola",align_default:"Default",align:"Tarazla\u015fd\u0131rma",border:"S\u0259rh\u0259d",cellpadding:"\u00d6z\u0259kl\u0259rd\u0259 doldurma",cellspacing:"\u00d6z\u0259kl\u0259r aras\u0131ndak\u0131 m\u0259saf\u0259",rows:"S\u0259trl\u0259r",cols:"S\u00fctunlar",height:"H\u00fcnd\u00fcrl\u00fcy\u00fc",width:"Eni",title:"C\u0259dv\u0259li \u0259lav\u0259 et/d\u0259yi\u015fdir",rowtype:"C\u0259dv\u0259l hiss\u0259sind\u0259ki s\u0259tr",advanced_props:"\u018flav\u0259 x\u00fcsusiyy\u0259tl\u0259r",general_props:"\u00dcmumi x\u00fcsusiyy\u0259tl\u0259r",advanced_tab:"\u018flav\u0259l\u0259r",general_tab:"\u00dcmumi"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/be_dlg.js b/js/tiny_mce/plugins/table/langs/be_dlg.js new file mode 100755 index 000000000..ee49c0d1e --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/be_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('be.table_dlg',{rules_border:"\u043c\u044f\u0436\u0430",rules_box:"\u043a\u0430\u043d\u0442\u044d\u0439\u043d\u0435\u0440",rules_vsides:"\u0432\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u044f \u0431\u0430\u043a\u0456",rules_rhs:"\u043f\u0440\u0430\u0432\u044b\u044f \u0433\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u044f \u0431\u0430\u043a\u0456",rules_lhs:"\u043b\u0435\u0432\u044b\u044f \u0433\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u044f \u0431\u0430\u043a\u0456",rules_hsides:"\u0433\u0430\u0440\u044b\u0437\u0430\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u044f \u0431\u0430\u043a\u0456",rules_below:"\u0437\u043d\u0456\u0437\u0443",rules_above:"\u0437\u0432\u0435\u0440\u0445\u0443",rules_void:"\u043d\u0456\u0448\u0442\u043e",rules:"\u041b\u0456\u043d\u0435\u0439\u043a\u0456",frame_all:"\u0443\u0441\u0451",frame_cols:"\u0441\u043b\u0443\u043f\u043a\u0456",frame_rows:"\u0440\u0430\u0434\u043a\u0456",frame_groups:"\u0433\u0440\u0443\u043f\u044b",frame_none:"\u043d\u0456\u0447\u043e\u0433\u0430",frame:"\u0420\u0430\u043c\u043a\u0430",caption:"\u0417\u0430\u0433\u0430\u043b\u043e\u0432\u0430\u043a \u0442\u0430\u0431\u043b\u0456\u0446\u044b",missing_scope:"\u0412\u044b \u0441\u0430\u043f\u0440\u0430\u045e\u0434\u044b \u0436\u0430\u0434\u0430\u0435\u0446\u0435 \u043f\u0440\u0430\u0446\u044f\u0433\u043d\u0443\u0446\u044c \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044f \u043c\u0435\u0436 \u0433\u044d\u0442\u0430\u0433\u0430 \u0432\u043e\u0447\u043a\u0430 \u0437\u0430\u0433\u0430\u043b\u043e\u045e\u043a\u0430? \u0411\u0435\u0437 \u0433\u044d\u0442\u0430\u0433\u0430 \u043d\u0435\u043a\u0430\u0442\u043e\u0440\u044b\u043c \u043a\u0430\u0440\u044b\u0441\u0442\u0430\u0447\u0430\u043c \u0437 \u0430\u0431\u043c\u0435\u0436\u0430\u0432\u0430\u043d\u0430\u0439 \u043f\u0440\u0430\u0446\u0430\u0437\u0434\u043e\u043b\u044c\u043d\u0430\u0441\u0446\u044e \u043c\u043e\u0436\u0430 \u0431\u044b\u0446\u044c \u0446\u044f\u0436\u043a\u0430 \u0437\u0440\u0430\u0437\u0443\u043c\u0435\u0446\u044c \u0443\u0442\u0440\u044b\u043c\u0430\u043d\u043d\u0435 \u0430\u0431\u043e \u0434\u0430\u0434\u0437\u0435\u043d\u044b\u044f \u0442\u0430\u0431\u043b\u0456\u0446\u044b.",cell_limit:"\u0412\u044b \u043f\u0435\u0440\u0430\u0432\u044b\u0441\u0456\u043b\u0456 \u043c\u0430\u043a\u0441\u0456\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u044c\u043a\u0430\u0441\u0446\u044c \u0443 {$cells} \u0432\u043e\u0447\u0430\u043a.",row_limit:"\u0412\u044b \u043f\u0435\u0440\u0430\u0432\u044b\u0441\u0456\u043b\u0456 \u043c\u0430\u043a\u0441\u0456\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u044c\u043a\u0430\u0441\u0446\u044c \u0443 {$rows} \u0440\u0430\u0434\u043a\u043e\u045e.",col_limit:"\u0412\u044b \u043f\u0435\u0440\u0430\u0432\u044b\u0441\u0456\u043b\u0456 \u043c\u0430\u043a\u0441\u0456\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u044c\u043a\u0430\u0441\u0446\u044c \u0443 {$cols} \u0441\u043b\u0443\u043f\u043a\u043e\u045e.",colgroup:"\u0413\u0440\u0443\u043f\u0430 \u0441\u043b\u0443\u043f\u043a\u043e\u045e",rowgroup:"\u0413\u0440\u0443\u043f\u0430 \u0440\u0430\u0434\u043a\u043e\u045e",scope:"\u041c\u0435\u0436\u044b",tfoot:"\u041d\u0456\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0456\u0446\u044b",tbody:"\u0410\u0441\u043d\u043e\u045e\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0456\u0446\u044b",thead:"\u0412\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0456\u0446\u044b",row_all:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0443\u0441\u0435 \u0440\u0430\u0434\u043a\u0456 \u045e \u0442\u0430\u0431\u043b\u0456\u0446\u044b",row_even:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0446\u043e\u0442\u043d\u044b\u044f \u0440\u0430\u0434\u043a\u0456 \u045e \u0442\u0430\u0431\u043b\u0456\u0446\u044b",row_odd:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u043d\u044f\u0446\u043e\u0442\u043d\u044b\u044f \u0440\u0430\u0434\u043a\u0456 \u045e \u0442\u0430\u0431\u043b\u0456\u0446\u044b",row_row:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0431\u044f\u0433\u0443\u0447\u044b \u0440\u0430\u0434\u043e\u043a",cell_all:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0443\u0441\u0435 \u0432\u043e\u0447\u043a\u0456 \u045e \u0442\u0430\u0431\u043b\u0456\u0446\u044b",cell_row:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0443\u0441\u0435 \u0432\u043e\u0447\u043a\u0456 \u045e \u0440\u0430\u0434\u043a\u0443",cell_cell:"\u0410\u0431\u043d\u0430\u0432\u0456\u0446\u044c \u0431\u044f\u0433\u0443\u0447\u0430\u0435 \u0432\u043e\u0447\u043a\u0430",th:"\u0417\u0430\u0433\u0430\u043b\u043e\u0432\u0430\u043a",td:"\u0414\u0430\u0434\u0437\u0435\u043d\u044b\u044f",summary:"\u0417\u0432\u043e\u0434\u043a\u0430",bgimage:"\u0424\u043e\u043d\u0430\u0432\u044b \u043c\u0430\u043b\u044e\u043d\u0430\u043a",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u0430",ltr:"\u0417\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u0430",mime:"\u041c\u044d\u0442\u0430\u0432\u044b MIME-\u0442\u044b\u043f",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u044b",langdir:"\u041a\u0456\u0440\u0443\u043d\u0430\u043a \u043c\u043e\u0432\u044b",style:"\u0421\u0442\u044b\u043b\u044c",id:"\u0406\u0434\u044d\u043d\u0442\u044b\u0444\u0456\u043a\u0430\u0442\u0430\u0440",merge_cells_title:"\u0417\u043b\u0456\u0446\u044c \u0432\u043e\u0447\u043a\u0456",bgcolor:"\u041a\u043e\u043b\u0435\u0440 \u0444\u043e\u043d\u0443",bordercolor:"\u041a\u043e\u043b\u0435\u0440 \u043c\u044f\u0436\u044b",align_bottom:"\u041f\u0430 \u043d\u0456\u0437\u0435",align_top:"\u041f\u0430 \u0432\u0435\u0440\u0441\u0435",valign:"\u0412\u0435\u0440\u0442\u044b\u043a\u0430\u043b\u044c\u043d\u0430\u0435 \u0432\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435",cell_type:"\u0422\u044b\u043f \u0432\u043e\u0447\u043a\u0430",cell_title:"\u0423\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0432\u043e\u0447\u043a\u0430",row_title:"\u0423\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456 \u0440\u0430\u0434\u043a\u0430",align_middle:"\u041f\u0430 \u0446\u044d\u043d\u0442\u0440\u044b",align_right:"\u041d\u0430\u043f\u0440\u0430\u0432\u0430",align_left:"\u041d\u0430\u043b\u0435\u0432\u0430",align_default:"\u041f\u0430 \u0437\u043c\u0430\u045e\u0447\u0430\u043d\u043d\u0456",align:"\u0412\u044b\u0440\u0430\u045e\u043d\u043e\u045e\u0432\u0430\u043d\u043d\u0435",border:"\u041c\u044f\u0436\u0430",cellpadding:"\u041d\u0430\u0431\u0456\u0432\u0430\u043d\u043d\u0435 \u045e \u0432\u043e\u0447\u043a\u0430\u0445",cellspacing:"\u0410\u0434\u043b\u0435\u0433\u043b\u0430\u0441\u0446\u044c \u043f\u0430\u043c\u0456\u0436 \u0432\u043e\u0447\u043a\u0430\u043c\u0456",rows:"\u0420\u0430\u0434\u043a\u0456",cols:"\u0421\u043b\u0443\u043f\u043a\u0456",height:"\u0412\u044b\u0448\u044b\u043d\u044f",width:"\u0428\u044b\u0440\u044b\u043d\u044f",title:"\u0423\u0441\u0442\u0430\u0432\u0456\u0446\u044c/\u0437\u043c\u044f\u043d\u0456\u0446\u044c \u0442\u0430\u0431\u043b\u0456\u0446\u0443",rowtype:"\u0420\u0430\u0434\u043e\u043a \u0443 \u0447\u0430\u0441\u0442\u043a\u0456 \u0442\u0430\u0431\u043b\u0456\u0446\u044b",advanced_props:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f \u045e\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456",general_props:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f \u045e\u043b\u0430\u0441\u0446\u0456\u0432\u0430\u0441\u0446\u0456",advanced_tab:"\u0414\u0430\u0434\u0430\u0442\u043a\u043e\u0432\u044b\u044f",general_tab:"\u0410\u0433\u0443\u043b\u044c\u043d\u044b\u044f"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/bg_dlg.js b/js/tiny_mce/plugins/table/langs/bg_dlg.js new file mode 100755 index 000000000..e04585109 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/bg_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bg.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"\u041f\u0440\u0430\u0432\u0438\u043b\u0430",frame_all:"\u0432\u0441\u0438\u0447\u043a\u0438",frame_cols:"\u043a\u043e\u043b\u043e\u043d\u0438",frame_rows:"\u0440\u0435\u0434\u043e\u0432\u0435",frame_groups:"\u0433\u0440\u0443\u043f\u0438",frame_none:"\u0431\u0435\u0437",frame:"\u0424\u0440\u0435\u0439\u043c",caption:"\u0417\u0430\u0433\u043b\u0430\u0432\u0438\u0435 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",missing_scope:"\u0421\u0438\u0433\u0443\u0440\u0435\u043d \u043b\u0438 \u0441\u0442\u0435 \u0447\u0435 \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0434\u0430 \u043f\u0440\u043e\u0434\u044a\u043b\u0436\u0438\u0442\u0435 \u0431\u0435\u0437 \u0434\u0430 \u0441\u043b\u043e\u0436\u0438\u0442\u0435 \u043e\u0431\u0445\u0432\u0430\u0442 \u043d\u0430 \u0433\u043b\u0430\u0432\u0430\u0442\u0430 \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430\u0442\u0430. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e, \u043d\u044f\u043a\u043e\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 \u0441 \u043d\u0435\u0434\u044a\u0437\u0438 \u043c\u043e\u0433\u0430\u0442 \u0434\u0430 \u0438\u043c\u0430\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0434\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0430\u0442 \u0434\u0430\u043d\u043d\u0438\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430.",cell_limit:"\u041f\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u043d\u0430\u0442\u0430 \u0431\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0435\u0442\u043a\u0438: {$cells}.",row_limit:"\u041f\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u043d\u0430\u0442\u0430 \u0431\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u0434\u043e\u0432\u0435: {$rows}.",col_limit:"\u041f\u0440\u0435\u0432\u0438\u0448\u0438\u0445\u0442\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u043d\u0430\u0442\u0430 \u0431\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043b\u043e\u043d\u0438: {$cols}.",colgroup:"\u0413\u0440\u0443\u043f\u0430 \u043a\u043e\u043b\u043e\u043d\u0438",rowgroup:"\u0413\u0440\u0443\u043f\u0430 \u0440\u0435\u0434\u043e\u0432\u0435",scope:"\u041e\u0431\u0445\u0432\u0430\u0442",tfoot:"\u0414\u044a\u043d\u043e \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",tbody:"\u0422\u044f\u043b\u043e \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",thead:"\u0413\u043b\u0430\u0432\u0430 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",row_all:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0432\u0441\u0438\u0447\u043a\u0438 \u0440\u0435\u0434\u043e\u0432\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",row_even:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0447\u0435\u0442\u043d\u0438\u0442\u0435 \u0440\u0435\u0434\u043e\u0432\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",row_odd:"\u041e\u0431\u043d\u043e\u0432\u0438 \u043d\u0435\u0447\u0435\u0442\u043d\u0438\u0442\u0435 \u0440\u0435\u0434\u043e\u0432\u0435 \u0432 \u0442\u0430\u043b\u0438\u0446\u0430\u0442\u0430",row_row:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u044f \u0440\u0435\u0434",cell_all:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0432\u0441\u0438\u0447\u043a\u0438 \u043a\u043b\u0435\u0442\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430",cell_row:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0432\u0441\u0438\u0447\u043a\u0438 \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430 \u0440\u0435\u0434\u0430",cell_cell:"\u041e\u0431\u043d\u043e\u0432\u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u0442\u0430 \u043a\u043b\u0435\u0442\u043a\u0430Update current cell",th:"\u0413\u043b\u0430\u0432\u0430",td:"\u0414\u0430\u043d\u0438\u043d",summary:"\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0435",bgimage:"\u0424\u043e\u043d\u043e\u0432\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430",rtl:"\u041e\u0442\u0434\u044f\u0441\u043d\u043e \u043d\u0430 \u043b\u044f\u0432\u043e",ltr:"\u041e\u0442\u043b\u044f\u0432\u043e \u043d\u0430 \u0434\u044f\u0441\u043d\u043e",mime:"MIME \u0442\u0438\u043f",langcode:"\u041a\u043e\u0434 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",langdir:"\u041f\u043e\u0441\u043e\u043a\u0430 \u043d\u0430 \u0435\u0437\u0438\u043a\u0430",style:"\u0421\u0442\u0438\u043b",id:"Id",merge_cells_title:"\u0421\u043b\u0435\u0439 \u043a\u043b\u0435\u0442\u043a\u0438\u0442\u0435",bgcolor:"\u0426\u0432\u044f\u0442 \u043d\u0430 \u0444\u043e\u043d\u0430",bordercolor:"\u0426\u0432\u044f\u0442 \u043d\u0430 \u0440\u0430\u043c\u043a\u0430\u0442\u0430",align_bottom:"\u0414\u043e\u043b\u0443",align_top:"\u0413\u043e\u0440\u0435",valign:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u043d\u043e \u043f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435",cell_type:"\u0422\u0438\u043f \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430\u0442\u0430",cell_title:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430\u0442\u0430",row_title:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u0440\u0435\u0434\u0430",align_middle:"\u0426\u0435\u043d\u0442\u044a\u0440",align_right:"\u0414\u044f\u0441\u043d\u043e",align_left:"\u041b\u044f\u0432\u043e",align_default:"\u041f\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043d\u0435",align:"\u041f\u043e\u0434\u0440\u0430\u0432\u043d\u044f\u0432\u0430\u043d\u0435",border:"\u0420\u0430\u043c\u043a\u0430",cellpadding:"Padding \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0438\u0442\u0435",cellspacing:"\u0420\u0430\u0437\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u044a\u0436\u0434\u0443 \u043a\u043b\u0435\u0442\u043a\u0438\u0442\u0435",rows:"\u0420\u0435\u0434\u043e\u0432\u0435",cols:"\u041a\u043e\u043b\u043e\u043d\u0438",height:"\u0412\u0438\u0441\u043e\u0447\u0438\u043d\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",title:"\u0412\u043c\u044a\u043a\u043d\u0438/\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0430",rowtype:"\u0420\u043e\u043b\u044f \u043d\u0430 \u0440\u0435\u0434\u0430",advanced_props:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",general_props:"\u041e\u0431\u0449\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",advanced_tab:"\u0417\u0430 \u043d\u0430\u043f\u0440\u0435\u0434\u043d\u0430\u043b\u0438",general_tab:"\u041e\u0431\u0449\u0438"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/bn_dlg.js b/js/tiny_mce/plugins/table/langs/bn_dlg.js new file mode 100755 index 000000000..9912fbe20 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/bn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bn.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head","row_all":"Update all rows in table","row_even":"Update even rows in table","row_odd":"Update odd rows in table","row_row":"Update current row","cell_all":"Update all cells in table","cell_row":"Update all cells in row","cell_cell":"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id","merge_cells_title":"Merge table cells",bgcolor:"Background color",bordercolor:"Border color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical alignment","cell_type":"Cell type","cell_title":"Table cell properties","row_title":"Table row properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part","advanced_props":"Advanced properties","general_props":"General properties","advanced_tab":"Advanced","general_tab":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/br_dlg.js b/js/tiny_mce/plugins/table/langs/br_dlg.js new file mode 100755 index 000000000..97847f467 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/br_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('br.table_dlg',{rules_border:"Limites",rules_box:"Box",rules_vsides:"Vsides",rules_rhs:"Rhs",rules_lhs:"Lhs",rules_hsides:"Hsides",rules_below:"abaixo",rules_above:"acima",rules_void:"void",rules:"Regras",frame_all:"Todos",frame_cols:"colunas",frame_rows:"Linhas",frame_groups:"Grupos",frame_none:"Nenhum",frame:"Frame",caption:"T\u00edtulo da tabela",missing_scope:"Tem certeza de que quer continuar sem especificar um escopo para esta c\u00e9lula? (Isso poder\u00e1 causar dificuldades a usu\u00e1rios deficientes)",cell_limit:"Excedeu o n\u00famero m\u00e1ximo de c\u00e9lulas de {$cells}.",row_limit:"Excedeu o n\u00famero m\u00e1ximo de linhas de {$rows}.",col_limit:"Excedeu o n\u00famero m\u00e1ximo de colunas de {$cols}.",colgroup:"Grupo colunas",rowgroup:"Grupo linhas",scope:"Alcance",tfoot:"Rodap\u00e9 da tabela",tbody:"Corpo da tabela",thead:"Topo da tabela",row_all:"Atualizar todas as linhas",row_even:"Atualizar linhas pares",row_odd:"Atualizar linhas \u00edmpares",row_row:"Atcualizar esta linha",cell_all:"Atualizar todas as c\u00e9lulas na tabela",cell_row:"Atualizar todas as c\u00e9lulas na linha",cell_cell:"Atualizar esta c\u00e9lula",th:"Campo",td:"Dados",summary:"Sum\u00e1rio",bgimage:"Imagem de fundo",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",mime:"MIME alvo",langcode:"C\u00f3digo da linguagem",langdir:"Dire\u00e7\u00e3o do texto",style:"Estilo",id:"Id",merge_cells_title:"Unir c\u00e9lulas",bgcolor:"Cor de fundo",bordercolor:"Cor dos limites",align_bottom:"Abaixo",align_top:"Topo",valign:"Alinhamento vertical",cell_type:"Tipo de c\u00e9lula",cell_title:"Propriedades de c\u00e9lulas",row_title:"Propriedades de linhas",align_middle:"Centro",align_right:"Direita",align_left:"Esquerda",align_default:"Padr\u00e3o",align:"Alinhamento",border:"Limites",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Linhas",cols:"Colunas",height:"Altura",width:"Largura",title:"Inserir/modificar tabela",rowtype:"Linha na parte da tabela",advanced_props:"Propriedades avan\u00e7adas",general_props:"Propriedades gerais",advanced_tab:"Avan\u00e7ado",general_tab:"Geral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/bs_dlg.js b/js/tiny_mce/plugins/table/langs/bs_dlg.js new file mode 100755 index 000000000..b1926862c --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/bs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('bs.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Opis tablice",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).",row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).",col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).",colgroup:"Grupa stupaca",rowgroup:"Grupa redaka",scope:"Domet",tfoot:"Podno\u017eje tablice",tbody:"Tijelo tablice",thead:"Zaglavlje tablice",row_all:"Primjeni na sve retke u tablici",row_even:"Primjeni na parne retke u tablici",row_odd:"Primjeni na neparne retke u tablici",row_row:"Primjeni na odabrani redak",cell_all:"Primjeni na sve \u0107elije u tablici",cell_row:"Primjeni na sve \u0107elije u retku",cell_cell:"Primjeni na odabranu \u0107eliju",th:"Zaglavlje",td:"Podatkovna",summary:"Sa\u017eetak",bgimage:"Slika pozadine",rtl:"S desna na lijevo",ltr:"S lijeva na desno",mime:"MIME tip",langcode:"Kod jezika",langdir:"Smjer jezika",style:"Stil",id:"Id",merge_cells_title:"Spoji \u0107elije",bgcolor:"Background color",bordercolor:"Boja obruba",align_bottom:"Dno",align_top:"Vrh",valign:"Okomito poravnavanje",cell_type:"Tip \u0107elije",cell_title:"Svojstva \u0107elije",row_title:"Svojstva retka",align_middle:"Sredina",align_right:"Desno",align_left:"Lijevo",align_default:"Zadano",align:"Poravnavanje",border:"Obrub",cellpadding:"Dopuna \u0107elije",cellspacing:"Razmak \u0107elija",rows:"Redaka",cols:"Stupaca",height:"Visina",width:"\u0160irina",title:"Umetni/uredi tablicu",rowtype:"Row in table part",advanced_props:"Napredna svojstva",general_props:"Osnovna svojstva",advanced_tab:"Napredno",general_tab:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ca_dlg.js b/js/tiny_mce/plugins/table/langs/ca_dlg.js new file mode 100755 index 000000000..60736026f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ca_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ca.table_dlg',{"rules_border":"vora","rules_box":"quadre","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"per sota de","rules_above":"per damunt de","rules_void":"buit",rules:"Regles","frame_all":"tot","frame_cols":"columnes","frame_rows":"files","frame_groups":"grups","frame_none":"cap",frame:"Marc",caption:"T\u00edtol de la taula","missing_scope":"Esteu segur que voleu continuar sense indicar un abast per a aquesta cel\u00b7la de cap\u00e7alera. Pot ser dif\u00edcil per a alguns usuaris amb discapacitats entendre el contingut o les dades mostrades a la taula.","cell_limit":"Heu superat el nombre m\u00e0xim de cel\u00b7les de {$cells}..","row_limit":"Heu superat el nombre m\u00e0xim de files de {$rows}.","col_limit":"Heu superat el nombre m\u00e0xim de columnes de {$cols}.",colgroup:"Grup de columnes",rowgroup:"Grup de files",scope:"Abast",tfoot:"Peu de la taula",tbody:"Cos de la taula",thead:"Cap\u00e7alera de la taula","row_all":"Actualitza totes les files","row_even":"Actualitza les files parells","row_odd":"Actualitza les files senars","row_row":"Actualitza la fila","cell_all":"Actualitza totes les cel\u00b7les de la taula","cell_row":"Actualitza totes les cel\u00b7les de la fila","cell_cell":"Actualitza la cel\u00b7la",th:"Cap\u00e7alera",td:"Dades",summary:"Resum",bgimage:"Imatge de fons",rtl:"De dreta a esquerra",ltr:"D\'esquerra a dreta",mime:"Tipus MIME",langcode:"Codi de l\'idioma",langdir:"Direcci\u00f3 de l\'idioma",style:"Estil",id:"Id","merge_cells_title":"Fusiona cel\u00b7les",bgcolor:"Color de fons",bordercolor:"Color de vora","align_bottom":"A baix","align_top":"A dalt",valign:"Alineaci\u00f3 vertical","cell_type":"Tipus de cel\u00b7la","cell_title":"Propietats de cel\u00b7la","row_title":"Propietats de fila","align_middle":"Centre","align_right":"Dreta","align_left":"Esquerra","align_default":"Per defecte",align:"Alineaci\u00f3",border:"Vora",cellpadding:"Separaci\u00f3 de cel\u00b7la",cellspacing:"Espaiat de cel\u00b7la",rows:"Files",cols:"Columnes",height:"Al\u00e7ada",width:"Amplada",title:"Insereix/Modifica taula",rowtype:"Fila","advanced_props":"Propietats avan\u00e7ades","general_props":"Propietats generals","advanced_tab":"Avan\u00e7at","general_tab":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ch_dlg.js b/js/tiny_mce/plugins/table/langs/ch_dlg.js new file mode 100755 index 000000000..3fcb9e288 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ch_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ch.table_dlg',{rules_border:"\u5916\u6846",rules_box:"\u76d2\u578b",rules_vsides:"\u5782\u76f4",rules_rhs:"\u53f3\u8fb9",rules_lhs:"\u5de6\u8fb9",rules_hsides:"\u6c34\u5e73",rules_below:"\u4e0b",rules_above:"\u4e0a",rules_void:"\u7a7a",rules:"\u89c4\u5219",frame_all:"\u5168\u90e8",frame_cols:"\u680f",frame_rows:"\u884c",frame_groups:"\u7fa4\u7ec4",frame_none:"\u65e0",frame:"\u6846\u67b6",caption:"\u8868\u683c\u6807\u9898",missing_scope:"\u4f60\u786e\u5b9a\u4e0d\u6307\u5b9a\u8868\u683c\u5934\u90e8\u50a8\u5b58\u683c\u4e00\u4e2a\u8303\u56f4\u5417\uff1f\u6ca1\u6709\u5b83\uff0c\u6216\u8bb8\u5bf9\u90a3\u4e9b\u6709\u969c\u788d\u7684\u7528\u6237\u7406\u89e3\u8868\u683c\u5c55\u793a\u7684\u5185\u5bb9\u6216\u6570\u636e\u66f4\u52a0\u7684\u56f0\u96be\u3002",cell_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u50a8\u5b58\u683c\u9650\u5236{$cells} \u50a8\u5b58\u683c\u3002",row_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u884c\u6570\u9650\u5236 {$rows} \u5217\u3002",col_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u680f\u6570\u9650\u5236 {$cols} \u680f\u3002",colgroup:"\u680f\u7fa4\u7ec4",rowgroup:"\u884c\u7fa4\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u683c\u4e3b\u4f53",thead:"\u8868\u5934",row_all:"\u66f4\u65b0\u8868\u683c\u7684\u6240\u6709\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6570\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6570\u884c",row_row:"\u66f4\u65b0\u76ee\u524d\u884c",cell_all:"\u66f4\u65b0\u6240\u6709\u50a8\u5b58\u683c",cell_row:"\u66f4\u65b0\u76ee\u524d\u884c\u7684\u50a8\u5b58\u683c",cell_cell:"\u66f4\u65b0\u76ee\u524d\u50a8\u5b58\u683c",th:"\u8868\u5934",td:"\u5185\u5bb9",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",mime:"MIME \u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"ID",merge_cells_title:"\u5408\u5e76\u50a8\u5b58\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272",align_bottom:"\u9760\u4e0b",align_top:"\u9760\u4e0a",valign:"\u5782\u76f4\u5bf9\u9f50",cell_type:"\u50a8\u5b58\u683c\u7c7b\u578b",cell_title:"\u50a8\u5b58\u683c\u6807\u9898",row_title:"\u884c\u5c5e\u6027",align_middle:"\u7f6e\u4e2d\u5bf9\u9f50",align_right:"\u9760\u53f3\u5bf9\u9f50",align_left:"\u9760\u5de6\u5bf9\u9f50",align_default:"\u9ed8\u8ba4",align:"\u5bf9\u9f50\u65b9\u5f0f",border:"\u8fb9\u6846",cellpadding:"\u50a8\u5b58\u683c\u8fb9\u8ddd",cellspacing:"\u50a8\u5b58\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u680f\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",general_tab:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/cn_dlg.js b/js/tiny_mce/plugins/table/langs/cn_dlg.js new file mode 100755 index 000000000..889880d7f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cn.table_dlg',{"rules_border":"\u8868\u683c\u8fb9\u6846","rules_box":"\u65b9\u5757","rules_vsides":"\u5782\u76f4","rules_rhs":"\u53f3\u8fb9","rules_lhs":"\u5de6\u8fb9","rules_hsides":"\u6c34\u5e73","rules_below":"\u4e0b","rules_above":"\u4e0a","rules_void":"\u7a7a",rules:"\u89c4\u5219","frame_all":"\u5168\u90e8","frame_cols":"\u5217","frame_rows":"\u884c","frame_groups":"\u7ec4","frame_none":"\u65e0",frame:"\u6846\u67b6",caption:"\u8868\u683c\u6807\u9898","missing_scope":"\u4f60\u786e\u5b9a\u4e0d\u6307\u5b9a\u8868\u683c\u5934\u90e8\u50a8\u5b58\u683c\u4e00\u4e2a\u8303\u56f4\u5417\uff1f\u6ca1\u6709\u5b83\uff0c\u6216\u8bb8\u5bf9\u90a3\u4e9b\u6709\u969c\u788d\u7684\u7528\u6237\u7406\u89e3\u8868\u683c\u5c55\u793a\u7684\u5185\u5bb9\u6216\u6570\u636e\u66f4\u52a0\u7684\u56f0\u96be\u3002","cell_limit":"\u5df2\u8d85\u8fc7\u6700\u5927\u50a8\u5b58\u683c\u9650\u5236{$cells} \u50a8\u5b58\u683c\u3002","row_limit":"\u5df2\u8d85\u8fc7\u6700\u5927\u884c\u6570\u9650\u5236 {$rows} \u884c","col_limit":"\u5df2\u8d85\u8fc7\u6700\u5927\u884c\u6570\u9650\u5236 {$cols} \u5217",colgroup:"\u5217\u7ec4",rowgroup:"\u884c\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u683c\u4e3b\u4f53",thead:"\u8868\u5934","row_all":"\u66f4\u65b0\u8868\u683c\u7684\u6240\u6709\u884c","row_even":"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6570\u884c","row_odd":"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6570\u884c","row_row":"\u66f4\u65b0\u76ee\u524d\u884c","cell_all":"\u66f4\u65b0\u6240\u6709\u50a8\u5b58\u683c","cell_row":"\u66f4\u65b0\u76ee\u524d\u884c\u7684\u50a8\u5b58\u683c","cell_cell":"\u66f4\u65b0\u76ee\u524d\u50a8\u5b58\u683c",th:"\u8868\u5934",td:"\u5185\u5bb9",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",mime:"MIME \u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"Id\u7f16\u53f7","merge_cells_title":"\u5408\u4f75\u50a8\u5b58\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272","align_bottom":"\u5c45\u4e0b","align_top":"\u5c45\u4e0a",valign:"\u5782\u76f4\u5bf9\u9f50","cell_type":"\u50a8\u5b58\u683c\u7c7b\u578b","cell_title":"\u50a8\u5b58\u683c\u5c5e\u6027","row_title":"\u884c\u5c5e\u6027","align_middle":"\u5c45\u4e2d","align_right":"\u5c45\u53f3","align_left":"\u5c45\u5de6","align_default":"\u9ed8\u8ba4",align:"\u5bf9\u9f50",border:"\u8fb9\u6846",cellpadding:"\u8868\u683c\u8fb9\u8ddd",cellspacing:"\u8868\u683c\u95f4\u8ddd",rows:"\u884c",cols:"\u5217",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u4fee\u6539\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e","advanced_props":"\u9ad8\u7ea7\u9009\u9879","general_props":"\u5e38\u89c4\u9009\u9879","advanced_tab":"\u9ad8\u7ea7","general_tab":"\u5e38\u89c4"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/cs_dlg.js b/js/tiny_mce/plugins/table/langs/cs_dlg.js new file mode 100755 index 000000000..58acd350a --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/cs_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cs.table_dlg',{rules_border:"r\u00e1me\u010dek okolo",rules_box:"box okolo",rules_vsides:"vlevo a vpravo",rules_rhs:"vpravo",rules_lhs:"vlevo",rules_hsides:"naho\u0159e a dole",rules_below:"dole",rules_above:"naho\u0159e",rules_void:"\u017e\u00e1dn\u00fd",rules:"Vykreslen\u00ed m\u0159\u00ed\u017eky",frame_all:"v\u0161e",frame_cols:"sloupce",frame_rows:"\u0159\u00e1dky",frame_groups:"oblasti a skupiny sloupc\u016f",frame_none:"\u017e\u00e1dn\u00e1",frame:"R\u00e1me\u010dek tabulky",caption:"Nadpis tabulky",missing_scope:"Skute\u010dn\u011b chcete pokra\u010dovat bez ur\u010den\u00ed oblasti hlavi\u010dky t\u00e9to tabulky? Bez n\u00ed m\u016f\u017ee u n\u011bkter\u00fdch u\u017eivatel\u016f doch\u00e1zet k ur\u010dit\u00fdm probl\u00e9m\u016fm p\u0159i interpretaci a zobrazov\u00e1n\u00ed dat v tabulce.",cell_limit:"P\u0159ekro\u010dili jste maxim\u00e1ln\u00ed po\u010det bun\u011bk {$cells}.",row_limit:"P\u0159ekro\u010dili jste maxim\u00e1ln\u00ed po\u010det \u0159\u00e1dk\u016f {$rows}.",col_limit:"P\u0159ekro\u010dili jste maxim\u00e1ln\u00ed po\u010det sloupc\u016f {$cols}.",colgroup:"Skupina sloupc\u016f",rowgroup:"Skupina \u0159\u00e1dk\u016f",scope:"Hlavi\u010dka pro",tfoot:"Pata tabulky",tbody:"T\u011blo tabulky",thead:"Hlavi\u010dka tabulky",row_all:"Aktualizovat v\u0161echny \u0159\u00e1dky tabulky",row_even:"Aktualizovat sud\u00e9 \u0159\u00e1dky tabulky",row_odd:"Aktualizovat lich\u00e9 \u0159\u00e1dky tabulky",row_row:"Aktualizovat zvolen\u00fd \u0159\u00e1dek",cell_all:"Aktualizovat v\u0161echny bu\u0148ky v tabulce",cell_row:"Aktualizovat v\u0161echny bu\u0148ky v \u0159\u00e1dku",cell_cell:"Aktualizovat zvolenou bu\u0148ku",th:"Z\u00e1hlav\u00ed",td:"Data",summary:"Shrnut\u00ed obsahu",bgimage:"Obr\u00e1zek pozad\u00ed",rtl:"Zprava doleva",ltr:"Zleva doprava",mime:"MIME typ c\u00edle",langcode:"K\u00f3d jazyka",langdir:"Sm\u011br textu",style:"Styl",id:"ID",merge_cells_title:"Spojit bu\u0148ky",bgcolor:"Barva pozad\u00ed",bordercolor:"Barva r\u00e1me\u010dku",align_bottom:"Dol\u016f",align_top:"Nahoru",valign:"Vertik\u00e1ln\u00ed zarovn\u00e1n\u00ed",cell_type:"Typ bu\u0148ky",cell_title:"Vlastnosti bu\u0148ky",row_title:"Vlastnosti \u0159\u00e1dku",align_middle:"Na st\u0159ed",align_right:"Vpravo",align_left:"Vlevo",align_default:"V\u00fdchoz\u00ed",align:"Zarovn\u00e1n\u00ed",border:"R\u00e1me\u010dek",cellpadding:"Odsazen\u00ed obsahu",cellspacing:"Rozestup bun\u011bk",rows:"\u0158\u00e1dky",cols:"Sloupce",height:"V\u00fd\u0161ka",width:"\u0160\u00ed\u0159ka",title:"Vlo\u017eit/upravit tabulku",rowtype:"Typ \u0159\u00e1dku",advanced_props:"Roz\u0161\u00ed\u0159en\u00e9 parametry",general_props:"Obecn\u00e9 parametry",advanced_tab:"Roz\u0161\u00ed\u0159en\u00e9",general_tab:"Obecn\u00e9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/cy_dlg.js b/js/tiny_mce/plugins/table/langs/cy_dlg.js new file mode 100755 index 000000000..e4628528f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/cy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('cy.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"o dan",rules_above:"above",rules_void:"void",rules:"Rheolau",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Ffr\u00e2m",caption:"Egluryn tabl",missing_scope:"A ydych chi\'n si\u0175r eich bod eisiau parhau heb penodi cwmpas i\'r cell pennyn yma? Hebddo fo, efallai fydd o\'n anodd i rhai ddefnyddwyr gyda anableddau i ddeallt y cynnwys neu\'r data yn y tabl.",cell_limit:"Rydych wedi mynd tu twnt i\'r nifer uchafswm {$cells} o celloedd.",row_limit:"Rydych wedi mynd tu twnt i\'r nifer uchafswm {$rows} o rhesi.",col_limit:"Rydych wedi mynd tu twnt i\'r nifer uchafswm {$cols} o golofnau.",colgroup:"Gr\u0175p Colofnau",rowgroup:"Gr\u0175p Rhesi",scope:"Cwmpas",tfoot:"Troed Tabl",tbody:"Corff Tabl",thead:"Pen Tabl",row_all:"Diweddaru pob rhes yn y tabl",row_even:"Diweddaru rhesi eilrif yn y tabl",row_odd:"Diweddaru rhesi odrif yn y tabl",row_row:"Diweddaru rhes cyfredol",cell_all:"Diweddaru pob cell yn y tabl",cell_row:"Diweddaru pob cell yn y rhes",cell_cell:"Diweddaru cell cyfredol",th:"Pennyn",td:"Data",summary:"Crynodeb",bgimage:"Delwedd cefndir",rtl:"De i\'r chwith",ltr:"Chwith i\'r dde",mime:"Math MIME targed",langcode:"Cod iaith",langdir:"Cyfeiriad iaith",style:"Arddull",id:"Id",merge_cells_title:"Cyfuno celloedd tabl",bgcolor:"Lliw cefndir",bordercolor:"Lliw border",align_bottom:"Gwaelod",align_top:"Pen",valign:"Aliniad ferigol",cell_type:"Math cell",cell_title:"Priodweddau cell tabl",row_title:"Priodweddau rhes tabl",align_middle:"Canol",align_right:"De",align_left:"Chwith",align_default:"Rhagosodedig",align:"Aliniad",border:"Border",cellpadding:"Padio celloedd",cellspacing:"Bylchiad celloedd",rows:"Rhesi",cols:"Colofnau",height:"Uchder",width:"Lled",title:"Mewnosod/Golygu tabl",rowtype:"Rhes mewn rhan tabl",advanced_props:"Priodweddau uwch",general_props:"Priodweddau cyffredinol",advanced_tab:"Uwch",general_tab:"Cyffredinol"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/da_dlg.js b/js/tiny_mce/plugins/table/langs/da_dlg.js new file mode 100755 index 000000000..04c34b848 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/da_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('da.table_dlg',{rules_border:"kant",rules_box:"boks",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"under",rules_above:"over",rules_void:"void",rules:"Regler",frame_all:"alle",frame_cols:"kolonner",frame_rows:"r\u00e6kker",frame_groups:"grupper",frame_none:"ingen",frame:"Ramme",caption:"Tabeloverskrift",missing_scope:"Er du sikker p\u00e5, du vil forts\u00e6tte uden at angive forklaring for denne overskriftscelle? Uden forklaring vil v\u00e6re sv\u00e6rt for f.ek.s blinde at l\u00e6se og forst\u00e5 indholdet i tabellen.",cell_limit:"Du har overskredet antallet af tilladte celler p\u00e5 {$cells}.",row_limit:"Du har overskredet antallet af tilladte r\u00e6kker p\u00e5 {$rows}.",col_limit:"Du har overskredet antallet af tilladte kolonner p\u00e5 {$cols}.",colgroup:"Kolonnegruppe",rowgroup:"R\u00e6kkegruppe",scope:"Forklaring",tfoot:"Tabelfod",tbody:"Tabelkrop",thead:"Tabelhoved",row_all:"Opdater alle r\u00e6kker",row_even:"Opdater lige r\u00e6kker",row_odd:"Opdater ulige r\u00e6kker",row_row:"Opdater aktuelle celle",cell_all:"Opdater alle celler i tabellen",cell_row:"Opdater alle celler i r\u00e6kken",cell_cell:"Opdater aktuelle celle",th:"Hoved",td:"Data",summary:"Beskrivelse",bgimage:"Baggrundsbillede",rtl:"H\u00f8jre mod venstre",ltr:"Venstre mod h\u00f8jre",mime:"Destinations-MIME-type",langcode:"Sprogkode",langdir:"Sprogretning",style:"Style",id:"Id",merge_cells_title:"Flet celler",bgcolor:"Baggrundsfarve",bordercolor:"Kantfarve",align_bottom:"Bund",align_top:"Top",valign:"Vertikal justering",cell_type:"Celletype",cell_title:"Celleegenskaber",row_title:"R\u00e6kkeegenskaber",align_middle:"Centreret",align_right:"H\u00f8jre",align_left:"Venstre",align_default:"Standard",align:"Justering",border:"Kant",cellpadding:"Afstand til celleindhold",cellspacing:"Afstand mellem celler",rows:"R\u00e6kker",cols:"Kolonner",height:"H\u00f8jde",width:"Bredde",title:"Inds\u00e6t/rediger tabel",rowtype:"Row in table part",advanced_props:"Avancerede egenskaber",general_props:"Generelle egenskaber",advanced_tab:"Avanceret",general_tab:"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/de_dlg.js b/js/tiny_mce/plugins/table/langs/de_dlg.js new file mode 100755 index 000000000..8e34ae724 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/de_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('de.table_dlg',{rules_border:"alle 4 Seiten (Border)",rules_box:"alle 4 Seiten (Box)",rules_vsides:"links und rechts",rules_rhs:"nur rechts",rules_lhs:"nur links",rules_hsides:"oben und unten",rules_below:"nur unten",rules_above:"nur oben",rules_void:"keins",rules:"Gitter",frame_all:"zwischen allen Zellen",frame_cols:"zwischen Spalten",frame_rows:"zwischen Zeilen",frame_groups:"zwischen Gruppen",frame_none:"keine",frame:"Rahmen",caption:"Beschriftung der Tabelle",missing_scope:"Wollen Sie wirklich keine Beziehung f\u00fcr diese \u00dcberschrift angeben? Benutzer mit k\u00f6rperlichen Einschr\u00e4nkungen k\u00f6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.",cell_limit:"Sie haben die maximale Zellenzahl von {$cells} \u00fcberschritten.",row_limit:"Sie haben die maximale Zeilenzahl von {$rows} \u00fcberschritten.",col_limit:"Sie haben die maximale Spaltenzahl von {$cols} \u00fcberschritten.",colgroup:"Horizontal gruppieren",rowgroup:"Vertikal gruppieren",scope:"Bezug",tfoot:"Tabellenfu\u00df",tbody:"Tabelleninhalt",thead:"Tabellenkopf",row_all:"Alle Zeilen ver\u00e4ndern",row_even:"Gerade Zeilen ver\u00e4ndern",row_odd:"Ungerade Zeilen ver\u00e4ndern",row_row:"Diese Zeile ver\u00e4ndern",cell_all:"Alle Zellen der Tabelle ver\u00e4ndern",cell_row:"Alle Zellen in dieser Zeile ver\u00e4ndern",cell_cell:"Diese Zelle ver\u00e4ndern",th:"\u00dcberschrift",td:"Textzelle",summary:"Zusammenfassung",bgimage:"Hintergrundbild",rtl:"Rechts nach links",ltr:"Links nach rechts",mime:"MIME-Type des Inhalts",langcode:"Sprachcode",langdir:"Schriftrichtung",style:"Format",id:"ID",merge_cells_title:"Zellen vereinen",bgcolor:"Hintergrundfarbe",bordercolor:"Rahmenfarbe",align_bottom:"Unten",align_top:"Oben",valign:"Vertikale Ausrichtung",cell_type:"Zellentyp",cell_title:"Eigenschaften der Zelle",row_title:"Eigenschaften der Zeile",align_middle:"Mittig",align_right:"Rechts",align_left:"Links",align_default:"Standard",align:"Ausrichtung",border:"Rahmen",cellpadding:"Abstand innerhalb der Zellen",cellspacing:"Zellenabstand",rows:"Zeilen",cols:"Spalten",height:"H\u00f6he",width:"Breite",title:"Tabelle einf\u00fcgen/bearbeiten",rowtype:"Gruppierung",advanced_props:"Erweiterte Einstellungen",general_props:"Allgemeine Einstellungen",advanced_tab:"Erweitert",general_tab:"Allgemein"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/dv_dlg.js b/js/tiny_mce/plugins/table/langs/dv_dlg.js new file mode 100755 index 000000000..20816e3a7 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/dv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('dv.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/el_dlg.js b/js/tiny_mce/plugins/table/langs/el_dlg.js new file mode 100755 index 000000000..3810efe9c --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/el_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('el.table_dlg',{rules_border:"\u03c0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf",rules_box:"\u03ba\u03bf\u03c5\u03c4\u03af",rules_vsides:"\u03ba\u03ac\u03b8\u03b5\u03c4\u03b5\u03c2 \u03c0\u03bb\u03b5\u03c5\u03c1\u03ad\u03c2",rules_rhs:"\u03b4\u03b5\u03be\u03b9\u03ac \u03bf\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1 \u03c0\u03bb\u03b5\u03c5\u03c1\u03ac",rules_lhs:"\u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ae \u03bf\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b1 \u03c0\u03bb\u03b5\u03c5\u03c1\u03ac",rules_hsides:"\u03bf\u03c1\u03b9\u03b6\u03cc\u03bd\u03c4\u03b9\u03b5\u03c2 \u03c0\u03bb\u03b5\u03c5\u03c1\u03ad\u03c2",rules_below:"\u03b1\u03c0\u03cc \u03ba\u03ac\u03c4\u03c9",rules_above:"\u03b1\u03c0\u03cc \u03c0\u03ac\u03bd\u03c9",rules_void:"\u03ba\u03b5\u03bd\u03cc",rules:"\u039a\u03b1\u03bd\u03cc\u03bd\u03b5\u03c2",frame_all:"\u03cc\u03bb\u03b1",frame_cols:"\u03c3\u03c4\u03ae\u03bb\u03b5\u03c2",frame_rows:"\u03b3\u03c1\u03b1\u03bc\u03bc\u03ad\u03c2",frame_groups:"\u03bf\u03bc\u03ac\u03b4\u03b5\u03c2",frame_none:"\u03ba\u03b1\u03bd\u03ad\u03bd\u03b1",frame:"Frame",caption:"\u0395\u03c0\u03b9\u03ba\u03b5\u03c6\u03b1\u03bb\u03af\u03b4\u03b1 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",missing_scope:"\u03a3\u03af\u03b3\u03bf\u03c5\u03c1\u03b1 \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bd\u03b5\u03c7\u03af\u03c3\u03b5\u03c4\u03b5 \u03c7\u03c9\u03c1\u03af\u03c2 \u03bd\u03b1 \u03ad\u03c7\u03b5\u03c4\u03b5 \u03ba\u03b1\u03b8\u03bf\u03c1\u03af\u03c3\u03b5\u03b9 \u03c4\u03b7\u03bd \u03b5\u03bc\u03b2\u03ad\u03bb\u03b5\u03b9\u03b1 \u03c4\u03bf\u03c5 \u03ba\u03b5\u03bb\u03b9\u03bf\u03cd \u03c4\u03b7\u03c2 \u03ba\u03bf\u03c1\u03c5\u03c6\u03ae\u03c2 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1. \u03a7\u03c9\u03c1\u03af\u03c2 \u03b1\u03c5\u03c4\u03ae, \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03cd\u03c3\u03ba\u03bf\u03bb\u03bf \u03b3\u03b9\u03b1 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03c5\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b5\u03c2 \u03bc\u03b5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03b1 \u03bd\u03b1 \u03ba\u03b1\u03c4\u03b1\u03bb\u03ac\u03b2\u03bf\u03c5\u03bd \u03c4\u03bf \u03c0\u03b5\u03c1\u03b9\u03b5\u03c7\u03cc\u03bc\u03b5\u03bd\u03bf \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1.",cell_limit:"\u0388\u03c7\u03b5\u03c4\u03b5 \u03be\u03b5\u03c0\u03b5\u03c1\u03ac\u03c3\u03b5\u03b9 \u03c4\u03bf \u03cc\u03c1\u03b9\u03bf \u03c4\u03c9\u03bd \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 {$cells}.",row_limit:"\u0388\u03c7\u03b5\u03c4\u03b5 \u03be\u03b5\u03c0\u03b5\u03c1\u03ac\u03c3\u03b5\u03b9 \u03c4\u03bf \u03cc\u03c1\u03b9\u03bf \u03c4\u03c9\u03bd \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 {$rows}.",col_limit:"\u0388\u03c7\u03b5\u03c4\u03b5 \u03be\u03b5\u03c0\u03b5\u03c1\u03ac\u03c3\u03b5\u03b9 \u03c4\u03bf \u03cc\u03c1\u03b9\u03bf \u03c4\u03c9\u03bd \u03c3\u03c4\u03b7\u03bb\u03c9\u03bd \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 {$cols}.",colgroup:"\u039f\u03bc\u03ac\u03b4\u03b1 \u03c3\u03c4\u03b7\u03bb\u03ce\u03bd",rowgroup:"\u039f\u03bc\u03ac\u03b4\u03b1 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd",scope:"\u0395\u03bc\u03b2\u03ad\u03bb\u03b5\u03b9\u03b1",tfoot:"\u0392\u03ac\u03c3\u03b7 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",tbody:"\u03a3\u03ce\u03bc\u03b1 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",thead:"\u039a\u03bf\u03c1\u03c5\u03c6\u03ae \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",row_all:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",row_even:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03b6\u03c5\u03b3\u03ce\u03bd \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",row_odd:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03bc\u03bf\u03bd\u03ce\u03bd \u03b3\u03c1\u03b1\u03bc\u03bc\u03ce\u03bd \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",row_row:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03b7\u03c2 \u03c4\u03c1\u03ad\u03c7\u03bf\u03c5\u03c3\u03b1\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2",cell_all:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd \u03c4\u03bf\u03c5 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",cell_row:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd \u03c4\u03b7\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2",cell_cell:"\u0395\u03bd\u03b7\u03bc\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03c1\u03ad\u03c7\u03bf\u03bd\u03c4\u03bf\u03c2 \u03ba\u03b5\u03bb\u03b9\u03bf\u03cd",th:"\u0395\u03c0\u03b9\u03ba\u03b5\u03c6\u03b1\u03bb\u03af\u03b4\u03b1",td:"\u0394\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1",summary:"\u03a0\u03b5\u03c1\u03af\u03bb\u03b7\u03c8\u03b7",bgimage:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c6\u03cc\u03bd\u03c4\u03bf\u03c5",rtl:"\u0394\u03b5\u03be\u03b9\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b1\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",ltr:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac \u03c0\u03c1\u03bf\u03c2 \u03b4\u03b5\u03be\u03b9\u03ac",mime:"\u03a4\u03cd\u03c0\u03bf\u03c2 MIME \u03c3\u03c4\u03cc\u03c7\u03bf\u03c5",langcode:"\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",langdir:"\u039a\u03b1\u03c4\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1\u03c2",style:"\u03a3\u03c4\u03c5\u03bb",id:"Id",merge_cells_title:"\u03a3\u03c5\u03b3\u03c7\u03ce\u03bd\u03b5\u03c5\u03c3\u03b7 \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",bgcolor:"\u03a7\u03c1\u03ce\u03bc\u03b1 \u03c6\u03cc\u03bd\u03c4\u03bf\u03c5",bordercolor:"\u03a7\u03c1\u03ce\u03bc\u03b1 \u03c0\u03bb\u03b1\u03b9\u03c3\u03af\u03bf\u03c5",align_bottom:"\u039a\u03ac\u03c4\u03c9",align_top:"\u03a0\u03ac\u03bd\u03c9",valign:"\u039a\u03b1\u03c4\u03b1\u03ba\u03cc\u03c1\u03c5\u03c6\u03b7 \u03c3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7",cell_type:"\u03a4\u03cd\u03c0\u03bf\u03c2 \u03ba\u03b5\u03bb\u03b9\u03bf\u03cd",cell_title:"\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 \u03ba\u03b5\u03bb\u03b9\u03bf\u03cd \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",row_title:"\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",align_middle:"\u039a\u03ad\u03bd\u03c4\u03c1\u03bf",align_right:"\u0394\u03b5\u03be\u03b9\u03ac",align_left:"\u0391\u03c1\u03b9\u03c3\u03c4\u03b5\u03c1\u03ac",align_default:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03b7",align:"\u03a3\u03c4\u03bf\u03af\u03c7\u03b9\u03c3\u03b7",border:"\u03a0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf",cellpadding:"\u0393\u03ad\u03bc\u03b9\u03c3\u03bc\u03b1 \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd",cellspacing:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7 \u03ba\u03b5\u03bb\u03b9\u03ce\u03bd",rows:"\u0393\u03c1\u03b1\u03bc\u03bc\u03ad\u03c2",cols:"\u03a3\u03c4\u03ae\u03bb\u03b5\u03c2",height:"\u038e\u03c8\u03bf\u03c2",width:"\u03a0\u03bb\u03ac\u03c4\u03bf\u03c2",title:"\u0395\u03b9\u03c3\u03b1\u03b3\u03c9\u03b3\u03ae/\u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",rowtype:"\u0393\u03c1\u03b1\u03bc\u03bc\u03ae \u03c3\u03b5 \u03bc\u03ad\u03c1\u03bf\u03c2 \u03c0\u03af\u03bd\u03b1\u03ba\u03b1",advanced_props:"\u03a0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03b5\u03c2 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2",general_props:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ad\u03c2 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b5\u03c2",advanced_tab:"\u0393\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03b7\u03bc\u03ad\u03bd\u03bf\u03c5\u03c2",general_tab:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/en_dlg.js b/js/tiny_mce/plugins/table/langs/en_dlg.js new file mode 100644 index 000000000..deee0f15f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head","row_all":"Update all rows in table","row_even":"Update even rows in table","row_odd":"Update odd rows in table","row_row":"Update current row","cell_all":"Update all cells in table","cell_row":"Update all cells in row","cell_cell":"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id","merge_cells_title":"Merge table cells",bgcolor:"Background color",bordercolor:"Border color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical alignment","cell_type":"Cell type","cell_title":"Table cell properties","row_title":"Table row properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part","advanced_props":"Advanced properties","general_props":"General properties","advanced_tab":"Advanced","general_tab":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/es_dlg.js b/js/tiny_mce/plugins/table/langs/es_dlg.js new file mode 100755 index 000000000..1e41db657 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"debajo","rules_above":"encima","rules_void":"vac\u00edo",rules:"Reglas","frame_all":"todos","frame_cols":"cols","frame_rows":"filas","frame_groups":"grupos","frame_none":"ninguno",frame:"Recuadro",caption:"Subt\u00edtulo de la tabla","missing_scope":" \u00bfEst\u00e1 seguro que desea continuar sin especificar el alcance del encabezado de celda? Sin \u00e9l podr\u00eda ser dificultoso para algunos usuarios entender el contenido o los datos mostrados en la tabla.","cell_limit":"Ha superado el n\u00famero m\u00e1ximo de celdas: {$cells}.","row_limit":"Ha superado el n\u00famero m\u00e1ximo de filas: {$rows}.","col_limit":"Ha superado el n\u00famero m\u00e1ximo de columnas: {$cols}.",colgroup:"Grupo de columnas",rowgroup:"Grupo de filas",scope:"Alcance",tfoot:"Pie de la tabla",tbody:"Cuerpo de la tabla",thead:"Encabezado de la tabla","row_all":"Actualizar todas las filas","row_even":"Actualizar filas pares","row_odd":"Actualizar filas impares","row_row":"Actualizar fila actual","cell_all":"Actualizar todas las celdas en la tabla","cell_row":"Actualizar todas las celdas en la fila","cell_cell":"Actualizar celda actual",th:"Encabezado",td:"Datos",summary:"Resumen",bgimage:"Imagen de fondo",rtl:"Derecha a izquierda",ltr:"Izquierda a derecha",mime:"Tipo MIME",langcode:"C\u00f3digo del lenguaje",langdir:"Direcci\u00f3n del lenguaje",style:"Estilo",id:"Id","merge_cells_title":"Vincular celdas",bgcolor:"Color de fondo",bordercolor:"Color del borde","align_bottom":"Debajo","align_top":"Arriba",valign:"Alineaci\u00f3n vertical","cell_type":"Tipo de celda","cell_title":"Propiedades de la celda","row_title":"Propiedades de la fila","align_middle":"Centrado","align_right":"Derecha","align_left":"Izquierda","align_default":"Predet.",align:"Alineaci\u00f3n",border:"Borde",cellpadding:"Relleno de celda",cellspacing:"Espaciado de celda",rows:"Filas",cols:"Cols",height:"Alto",width:"Ancho",title:"Insertar/Modificar tabla",rowtype:"Tipo de fila","advanced_props":"Propiedades avanzadas","general_props":"Propiedades generales","advanced_tab":"Avanzado","general_tab":"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/et_dlg.js b/js/tiny_mce/plugins/table/langs/et_dlg.js new file mode 100755 index 000000000..504e54537 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.table_dlg',{rules_border:"raam",rules_box:"kast",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"all",rules_above:"\u00fcleval",rules_void:"t\u00fchi",rules:"Reeglid",frame_all:"k\u00f5ik",frame_cols:"veerud",frame_rows:"read",frame_groups:"grupid",frame_none:"mitte \u00fckski",frame:"Raam",caption:"Tabeli seletus",missing_scope:"Oled kindel, et soovid j\u00e4tkata t\u00e4psustamata antud tabeli p\u00e4ise nime?",cell_limit:"Oled j\u00f5udnud maksimaalse arvu elementideni",row_limit:"Oled j\u00f5udnud maksimaalse arvu ridadeni",col_limit:"Oled j\u00f5udnud maksemaalse arvu veegudeni.",colgroup:"Veeru grupp",rowgroup:"Rea grupp",scope:"Ulatus",tfoot:"Tabeli jalus",tbody:"Tabeli sisu",thead:"Tabeli p\u00e4is",row_all:"Uuenda k\u00f5iki ridu tabelis",row_even:"Uuenda paaris ridu tabelis",row_odd:"Uuenda paarituid ridu tabelis",row_row:"Uuenda antud rida",cell_all:"Uuenda k\u00f5iki lahtreid tabelis",cell_row:"Uuenda k\u00f5iki lahtreid reas",cell_cell:"Uuenda antud lahtrit",th:"P\u00e4is",td:"Info",summary:"Kokkuv\u00f5te",bgimage:"Tausta pilt",rtl:"Paremalt vasakule",ltr:"Vasakult paremale",mime:"M\u00e4rgista MIME t\u00fc\u00fcp",langcode:"Keele kood",langdir:"Keele suund",style:"Stiil",id:"ID",merge_cells_title:"\u00dchenda lahtrid",bgcolor:"Tausta v\u00e4rv",bordercolor:"Raami v\u00e4rv",align_bottom:"All",align_top:"\u00dcleval",valign:"Vertikaalne joondus",cell_type:"Veeru t\u00fc\u00fcp",cell_title:"Tabeli veeru seaded",row_title:"Tabeli rea seaded",align_middle:"Keskel",align_right:"Parem",align_left:"Vasak",align_default:"Vaikimisi",align:"Joondus",border:"Raam",cellpadding:"Veeru t\u00e4ide",cellspacing:"Veeru laius",rows:"Ridu",cols:"Veerge",height:"K\u00f5rgus",width:"Laius",title:"Sisesta/muuda tabelit",rowtype:"Rida rea osas",advanced_props:"T\u00e4psustatud seaded",general_props:"\u00dcldised seaded",advanced_tab:"T\u00e4psustatud",general_tab:"\u00dcldine"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/eu_dlg.js b/js/tiny_mce/plugins/table/langs/eu_dlg.js new file mode 100755 index 000000000..4e78d7541 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/eu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('eu.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"azpian",rules_above:"gainean",rules_void:"hutsa",rules:"Erregelak",frame_all:"guztiak",frame_cols:"zutabeak",frame_rows:"lerroak",frame_groups:"taldeak",frame_none:"Bat ere ez",frame:"Markoa",caption:"Taularen azpititulua",missing_scope:"Taularen goiburukoari eremu bat zehaztu gabe jarritu nahi duzula ziur zaude? Eremu hori gabe, ezintasunak dituzten erabiltzaileentzat zaila izango da taularen datuak ulertzea.",cell_limit:"Gelaxka kopuru maximoa ({$cells}) gainditu duzu..",row_limit:"Lerro kopuru maximoa ({$rows}) gainditu duzu.",col_limit:"Zutabe kopuru maximoa ({$cols}) gainditu duzu.",colgroup:"Zutabe Taldea",rowgroup:"Lerro Taldea",scope:"Eremua",tfoot:"Taularen Oina",tbody:"Taularen Gorputza",thead:"Taularen Goiburukoa",row_all:"Eguneratu lerro guztiak",row_even:"Eguneratu lerro bakoitiak",row_odd:"Eguneratu lerro bikoitiak",row_row:"Eguneratu uneko lerroa",cell_all:"Eguneratu gelaxka guztiak",cell_row:"Eguneratu lerroko gelaxka guztiak",cell_cell:"Eguneratu uneko gelaxka",th:"Goiburua",td:"Datuak",summary:"Laburpena",bgimage:"Atzeko irudia",rtl:"Eskuinetik ezkerrera",ltr:"Ezkerretik eskuinera",mime:"Helburuareb MIME mota",langcode:"Hizkuntza kodea",langdir:"Hizkuntza norabidea",style:"Estiloa",id:"Id",merge_cells_title:"Bateratu gelaxkak",bgcolor:"Atzeko kolorea",bordercolor:"Ertz kolorea",align_bottom:"Behean",align_top:"Goian",valign:"Lerrokatze bertikala",cell_type:"Gelaxka mota",cell_title:"Gelaxka ezaugarriak",row_title:"Lerro ezaugarriak",align_middle:"Erdian",align_right:"Eskuinera",align_left:"Ezkerrera",align_default:"Lehenetsia",align:"Lerrokatzea",border:"Ertza",cellpadding:"Gelaxkaren betegarria",cellspacing:"Gelaxkaren tartea",rows:"Lerroak",cols:"Zutabeak",height:"Altuera",width:"Zabalera",title:"Txertatu/Aldatu taula",rowtype:"Lerro mota",advanced_props:"Ezaugarri aurreratuak",general_props:"Ezaugarri orokorrak",advanced_tab:"Aurreratua",general_tab:"Orokorra"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/fa_dlg.js b/js/tiny_mce/plugins/table/langs/fa_dlg.js new file mode 100755 index 000000000..3ef675054 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/fa_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fa.table_dlg',{rules_border:"\u062d\u0627\u0634\u06cc\u0647",rules_box:"\u062c\u0639\u0628\u0647",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u067e\u0627\u06cc\u06cc\u0646",rules_above:"\u0628\u0627\u0644\u0627",rules_void:"\u062e\u0627\u0644\u06cc",rules:"\u062e\u0637 \u0647\u0627",frame_all:"\u0647\u0645\u0647",frame_cols:"\u0633\u062a\u0648\u0646 \u0647\u0627",frame_rows:"\u0633\u0637\u0631\u0647\u0627",frame_groups:"\u06af\u0631\u0648\u0647 \u0647\u0627",frame_none:"\u0647\u06cc\u0686 \u06a9\u062f\u0627\u0645",frame:"\u0642\u0627\u0628 (Frame)",caption:"\u0639\u0646\u0648\u0627\u0646 \u062c\u062f\u0648\u0644",missing_scope:"\u0622\u06cc\u0627 \u0628\u062f\u0648\u0646 \u062a\u0639\u06cc\u06cc\u0646 \u0645\u062d\u062f\u0648\u062f\u0647 \u0628\u0631\u0627\u06cc \u0633\u0644\u0648\u0644 \u0639\u0646\u0648\u0627\u0646 \u062c\u062f\u0648\u0644\u060c \u0627\u062f\u0627\u0645\u0647 \u0645\u06cc \u062f\u0647\u06cc\u062f\u061f. \u0628\u062f\u0648\u0646 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u062f\u0631\u06a9 \u0645\u062d\u062a\u0648\u0627 \u06cc\u0627 \u062f\u0627\u062f\u0647 \u0647\u0627 \u0628\u0631\u0627\u06cc \u0628\u0639\u0636\u06cc \u0627\u0632 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0645\u0634\u06a9\u0644 \u0628\u0627\u0634\u062f.",cell_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062a\u0639\u062f\u0627\u062f \u062d\u062f\u0627\u06a9\u062b\u0631 {$cells} \u0633\u0644\u0648\u0644 \u062a\u062c\u0627\u0648\u0632 \u06a9\u0631\u062f\u06cc\u062f.",row_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062a\u0639\u062f\u0627\u062f \u062d\u062f\u0627\u06a9\u062b\u0631 {$rows} \u0633\u0637\u0631 \u062a\u062c\u0627\u0648\u0632 \u06a9\u0631\u062f\u06cc\u062f.",col_limit:"\u0634\u0645\u0627 \u0627\u0632 \u062a\u0639\u062f\u0627\u062f \u062d\u062f\u0627\u06a9\u062b\u0631 {$cols} \u0633\u062a\u0648\u0646 \u062a\u062c\u0627\u0648\u0632 \u06a9\u0631\u062f\u06cc\u062f.",colgroup:"\u06af\u0631\u0648\u0647 \u0633\u062a\u0648\u0646",rowgroup:"\u06af\u0631\u0648\u0647 \u0633\u0637\u0631",scope:"\u0645\u062d\u062f\u0648\u062f\u0647",tfoot:"\u067e\u0627\u06cc\u06cc\u0646 \u062c\u062f\u0648\u0644",tbody:"\u0628\u062f\u0646\u0647 \u062c\u062f\u0648\u0644",thead:"\u0628\u0627\u0644\u0627\u06cc \u062c\u062f\u0648\u0644",row_all:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u062a\u0645\u0627\u0645\u06cc \u0633\u0637\u0631\u0647\u0627 \u062f\u0631 \u062c\u062f\u0648\u0644",row_even:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0633\u0637\u0631\u0647\u0627\u06cc \u0632\u0648\u062c \u062f\u0631 \u062c\u062f\u0648\u0644",row_odd:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0633\u0637\u0631\u0647\u0627\u06cc \u0641\u0631\u062f \u062f\u0631 \u062c\u062f\u0648\u0644",row_row:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0633\u0637\u0631 \u0641\u0639\u0644\u06cc",cell_all:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u062a\u0645\u0627\u0645\u06cc \u0633\u0644\u0648\u0644 \u0647\u0627\u06cc \u062c\u062f\u0648\u0644",cell_row:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u062a\u0645\u0627\u0645\u06cc \u0633\u0644\u0648\u0644 \u0647\u0627\u06cc \u0633\u0637\u0631",cell_cell:"\u0628\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0633\u0644\u0648\u0644 \u0641\u0639\u0644\u06cc",th:"\u0633\u0631 \u062c\u062f\u0648\u0644",td:"\u062f\u0627\u062f\u0647",summary:"\u062e\u0644\u0627\u0635\u0647",bgimage:"\u062a\u0635\u0648\u06cc\u0631 \u0632\u0645\u06cc\u0646\u0647",rtl:"\u0631\u0627\u0633\u062a \u0628\u0647 \u0686\u067e",ltr:"\u0686\u067e \u0628\u0647 \u0631\u0627\u0633\u062a",mime:"\u0646\u0648\u0639 MIME \u0645\u0642\u0635\u062f (Target)",langcode:"\u06a9\u062f \u0632\u0628\u0627\u0646",langdir:"\u062c\u0647\u062a \u0632\u0628\u0627\u0646",style:"\u0627\u0633\u062a\u06cc\u0644",id:"\u0634\u0646\u0627\u0633\u0647",merge_cells_title:"\u0627\u062f\u063a\u0627\u0645 \u0633\u0644\u0648\u0644 \u0647\u0627\u06cc \u062c\u062f\u0648\u0644",bgcolor:"\u0631\u0646\u06af \u0632\u0645\u06cc\u0646\u0647",bordercolor:"\u0631\u0646\u06af \u062d\u0627\u0634\u06cc\u0647",align_bottom:"\u067e\u0627\u06cc\u06cc\u0646",align_top:"\u0628\u0627\u0644\u0627",valign:"\u062a\u0631\u0627\u0632 \u0639\u0645\u0648\u062f\u06cc",cell_type:"\u0646\u0648\u0639 \u0633\u0644\u0648\u0644",cell_title:"\u0645\u0634\u062e\u0635\u0627\u062a \u0633\u0644\u0648\u0644 \u062c\u062f\u0648\u0644",row_title:"\u0645\u0634\u062e\u0635\u0627\u062a \u0633\u0637\u0631 \u062c\u062f\u0648\u0644",align_middle:"\u0648\u0633\u0637",align_right:"\u0631\u0627\u0633\u062a",align_left:"\u0686\u067e",align_default:"\u067e\u06cc\u0634\u0641\u0631\u0636",align:"\u062a\u0631\u0627\u0632",border:"\u062d\u0627\u0634\u06cc\u0647",cellpadding:"\u0644\u0627\u06cc\u0647 \u06af\u0630\u0627\u0631\u06cc \u0633\u0644\u0648\u0644 \u0647\u0627",cellspacing:"\u0641\u0627\u0635\u0644\u0647 \u0633\u0644\u0648\u0644 \u0647\u0627",rows:"\u0633\u0637\u0631\u0647\u0627",cols:"\u0633\u062a\u0648\u0646 \u0647\u0627",height:"\u0627\u0631\u062a\u0641\u0627\u0639",width:"\u067e\u0647\u0646\u0627",title:"\u062f\u0631\u062c/\u0627\u0635\u0644\u0627\u062d \u062c\u062f\u0648\u0644",rowtype:"\u0633\u0637\u0631 \u062f\u0631 \u0628\u062e\u0634 \u062c\u062f\u0648\u0644",advanced_props:"\u0645\u0634\u062e\u0635\u0627\u062a \u067e\u06cc\u0634\u0631\u0641\u062a\u0647",general_props:"\u0645\u0634\u062e\u0635\u0627\u062a \u0639\u0645\u0648\u0645\u06cc",advanced_tab:"\u067e\u06cc\u0634\u0631\u0641\u062a\u0647",general_tab:"\u0639\u0645\u0648\u0645\u06cc"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/fi_dlg.js b/js/tiny_mce/plugins/table/langs/fi_dlg.js new file mode 100755 index 000000000..78a1129db --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.table_dlg',{rules_border:"kehys",rules_box:"laatikko",rules_vsides:"pystysuorat reunat",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"vaakasuorat reunat",rules_below:"alapuoli",rules_above:"yl\u00e4puoli",rules_void:"tyhj\u00e4",rules:"S\u00e4\u00e4nn\u00f6t",frame_all:"kaikki",frame_cols:"sarakkeet",frame_rows:"rivit",frame_groups:"ryhm\u00e4t",frame_none:"ei mit\u00e4\u00e4n",frame:"kehys",caption:"Taulukon seloste",missing_scope:"Haluatko varmasti jatkaa m\u00e4\u00e4ritt\u00e4m\u00e4tt\u00e4 tilaa t\u00e4lle taulukon otsakesolulle? Ilman sit\u00e4 joidenkin k\u00e4ytt\u00e4jien voi olla vaikea ymm\u00e4rt\u00e4\u00e4 taulukon sis\u00e4lt\u00e4m\u00e4\u00e4 informaatiota.",cell_limit:"Olet ylitt\u00e4nyt suurimman sallitun m\u00e4\u00e4r\u00e4n soluja {$cells}.",row_limit:"Olet ylitt\u00e4nyt suurimman sallitun m\u00e4\u00e4r\u00e4n rivej\u00e4 {$rows}.",col_limit:"Olet ylitt\u00e4nyt suurimman sallitun m\u00e4\u00e4r\u00e4n sarakkeita {$cols}.",colgroup:"Sarake ryhm\u00e4",rowgroup:"Rivi ryhm\u00e4",scope:"Tila",tfoot:"Taulukon alaosa",tbody:"Taulukon runko",thead:"Taulukon otsake",row_all:"P\u00e4ivit\u00e4 kaikki taulukon rivit",row_even:"P\u00e4ivit\u00e4 taulukon parilliset rivit",row_odd:"P\u00e4ivit\u00e4 taulukon parittomat rivit",row_row:"P\u00e4ivit\u00e4 rivi",cell_all:"P\u00e4ivit\u00e4 kaikki taulukon solut",cell_row:"P\u00e4ivit\u00e4 kaikki rivin solut",cell_cell:"P\u00e4ivit\u00e4 solu",th:"Otsake",td:"Tietue",summary:"Yhteenveto",bgimage:"Taustakuva",rtl:"Oikealta vasemmalle",ltr:"Vasemmalta oikealle",mime:"Kohteen MIME-tyyppi",langcode:"Kielen koodi",langdir:"Kielen suunta",style:"Tyyli",id:"Id",merge_cells_title:"Yhdist\u00e4 taulukon solut",bgcolor:"Taustan v\u00e4ri",bordercolor:"Kehyksen v\u00e4ri",align_bottom:"Alas",align_top:"Yl\u00f6s",valign:"Pystysuunnan tasaus",cell_type:"Solun tyyppi",cell_title:"Taulukon solun asetukset",row_title:"Taulukon rivin asetukset",align_middle:"Keskitetty",align_right:"Oikea",align_left:"Vasen",align_default:"Oletus",align:"Tasaus",border:"Kehys",cellpadding:"Solun tyhj\u00e4 tila",cellspacing:"Solun v\u00e4li",rows:"Rivit",cols:"Sarakkeet",height:"Korkeus",width:"Leveys",title:"Lis\u00e4\u00e4/muokkaa taulukkoa",rowtype:"Rivi taulukon osassa",advanced_props:"Edistyneet asetukset",general_props:"Yleiset asetukset",advanced_tab:"Edistynyt",general_tab:"Yleiset"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/fr_dlg.js b/js/tiny_mce/plugins/table/langs/fr_dlg.js new file mode 100755 index 000000000..cc69de577 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.table_dlg',{rules_border:"bordure",rules_box:"bo\u00eete",rules_vsides:"verticales",rules_rhs:"\u00e0 droite",rules_lhs:"\u00e0 gauche",rules_hsides:"horizontales",rules_below:"au-dessous",rules_above:"au-dessus",rules_void:"aucune",rules:"R\u00e8gles",frame_all:"tous",frame_cols:"colonnes",frame_rows:"lignes",frame_groups:"groupe",frame_none:"aucun",frame:"Cadre",caption:"Afficher la l\u00e9gende du tableau",missing_scope:"\u00cates-vous s\u00fbr de vouloir continuer sans sp\u00e9cifier de port\u00e9e pour cette cellule de titre ? Sans port\u00e9e, cela peut \u00eatre difficile pour certains utilisateurs de comprendre le contenu ou les donn\u00e9es affich\u00e9es dans le tableau.",cell_limit:"Vous avez d\u00e9pass\u00e9 le nombre maximum de cellules ({$cells}).",row_limit:"Vous avez d\u00e9pass\u00e9 le nombre maximum de lignes ({$rows}).",col_limit:"Vous avez d\u00e9pass\u00e9 le nombre maximum de colonnes ({$cols}).",colgroup:"Groupe de colonnes",rowgroup:"Groupe de lignes",scope:"Port\u00e9e",tfoot:"Pied de tableau",tbody:"Corps de tableau",thead:"En-t\u00eates de tableau",row_all:"Mettre \u00e0 jour toutes les lignes du tableau",row_even:"Mettre \u00e0 jour les lignes paires",row_odd:"Mettre \u00e0 jour les lignes impaires",row_row:"Mettre \u00e0 jour la ligne courante",cell_all:"Mettre \u00e0 jour toutes les cellules du tableau",cell_row:"Mettre \u00e0 jour toutes les cellules de la ligne",cell_cell:"Mettre \u00e0 jour la cellule courante",th:"Titre",td:"Donn\u00e9es",summary:"R\u00e9sum\u00e9",bgimage:"Image de fond",rtl:"de droite \u00e0 gauche",ltr:"De gauche \u00e0 droite",mime:"Type MIME de la cible",langcode:"Code de la langue",langdir:"Sens de lecture",style:"Style",id:"Id",merge_cells_title:"Fusionner les cellules",bgcolor:"Couleur du fond",bordercolor:"Couleur de la bordure",align_bottom:"Bas",align_top:"Haut",valign:"Alignement vertical",cell_type:"Type de cellule",cell_title:"Propri\u00e9t\u00e9s de la cellule",row_title:"Propri\u00e9t\u00e9s de la ligne",align_middle:"Centr\u00e9",align_right:"Droite",align_left:"Gauche",align_default:"Par d\u00e9faut",align:"Alignement",border:"Bordure",cellpadding:"Espacement dans les cellules",cellspacing:"Espacement entre les cellules",rows:"Lignes",cols:"Colonnes",height:"Hauteur",width:"Largeur",title:"Ins\u00e9rer / modifier un tableau",rowtype:"Type de ligne",advanced_props:"Propri\u00e9t\u00e9s avanc\u00e9es",general_props:"Propri\u00e9t\u00e9s g\u00e9n\u00e9rales",advanced_tab:"Avanc\u00e9",general_tab:"G\u00e9n\u00e9ral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/gl_dlg.js b/js/tiny_mce/plugins/table/langs/gl_dlg.js new file mode 100755 index 000000000..2075f2900 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.table_dlg',{rules_border:"borde",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"debaixo",rules_above:"encima",rules_void:"vac\u00edo",rules:"Regras",frame_all:"todos",frame_cols:"columnas",frame_rows:"filas",frame_groups:"grupos",frame_none:"ning\u00fan",frame:"Recadro",caption:"Subt\u00edtulo da t\u00e1boa",missing_scope:"\u00bfEst\u00e1 seguro que desexa continuar sen especifica-lo \u00e1mbito do encabezado de celda? Sen \u00e9l podr\u00eda ser dificultoso pra algunos usuarios entende-lo contido ou os datos mostrados na t\u00e1boa.",cell_limit:"Super\u00f3u o n\u00famero m\u00e1ximo de celdas: {$cells}.",row_limit:"Super\u00f3u o n\u00famero m\u00e1ximo de filas: {$rows}.",col_limit:"Super\u00f3u o n\u00famero m\u00e1ximo de columnas: {$cols}.",colgroup:"Grupo de columnas",rowgroup:"Grupo de filas",scope:"\u00c1mbito",tfoot:"Pe da t\u00e1boa",tbody:"Corpo da t\u00e1boa",thead:"Encabezamento da t\u00e1boa",row_all:"Actualizar todalas filas",row_even:"Actualizar filas pares",row_odd:"Actualizar filas impares",row_row:"Actualizar fila actual",cell_all:"Actualizar todalas celdas na t\u00e1boa",cell_row:"Actualizar todalas celdas na fila",cell_cell:"Actualizar celda actual",th:"Encabezamento",td:"Datos",summary:"Resumen",bgimage:"Imaxe de fondo",rtl:"Dereita a esquerda",ltr:"Esquerda a dereita",mime:"Tipo MIME",langcode:"C\u00f3digo da lenguaxe",langdir:"Direcci\u00f3n da lenguaxe",style:"Estilo",id:"Id",merge_cells_title:"Unir celdas",bgcolor:"Cor de fondo",bordercolor:"Cor do borde",align_bottom:"Abaixo",align_top:"Arriba",valign:"Ali\u00f1aci\u00f3n vertical",cell_type:"Tipo de celda",cell_title:"Propiedades da celda",row_title:"Propiedades da fila",align_middle:"Centrado",align_right:"Dereita",align_left:"Esquerda",align_default:"Predet.",align:"Ali\u00f1aci\u00f3n",border:"Borde",cellpadding:"Relleno de celda",cellspacing:"Espaciado de celda",rows:"Filas",cols:"Cols",height:"Alto",width:"Ancho",title:"Insertar/Modificar t\u00e1boa",rowtype:"Tipo de fila",advanced_props:"Propiedades avanzadas",general_props:"Propiedades xerales",advanced_tab:"Avanzado",general_tab:"Xeral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/gu_dlg.js b/js/tiny_mce/plugins/table/langs/gu_dlg.js new file mode 100755 index 000000000..68b75a0cc --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/gu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gu.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/he_dlg.js b/js/tiny_mce/plugins/table/langs/he_dlg.js new file mode 100755 index 000000000..156611443 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.table_dlg',{rules_border:"\u05d2\u05d1\u05d5\u05dc",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u05de\u05ea\u05d7\u05ea",rules_above:"\u05de\u05e2\u05dc",rules_void:"void",rules:"\u05d7\u05d5\u05e7\u05d9\u05dd",frame_all:"\u05d4\u05db\u05d5\u05dc",frame_cols:"\u05e2\u05de\u05d5\u05d3\u05d5\u05ea",frame_rows:"\u05e9\u05d5\u05e8\u05d5\u05ea",frame_groups:"\u05e7\u05d1\u05d5\u05e6\u05d5\u05ea",frame_none:"\u05dc\u05dc\u05d0",frame:"Frame",caption:"\u05db\u05d5\u05ea\u05e8\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"\u05d7\u05e8\u05d9\u05d2\u05d4 \u05de\u05de\u05e1\u05e4\u05e8 \u05d4\u05de\u05e7\u05e1\u05d9\u05de\u05d0\u05dc\u05d9 \u05e9\u05dc \u05d4\u05ea\u05d0\u05d9\u05dd \u05d1\u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc {$cells}.",row_limit:"\u05d7\u05e8\u05d9\u05d2\u05d4 \u05de\u05de\u05e1\u05e4\u05e8 \u05d4\u05de\u05e7\u05e1\u05d9\u05de\u05d0\u05dc\u05d9 \u05e9\u05dc \u05d4\u05e9\u05d5\u05e8\u05d5\u05ea \u05e9\u05dc {$rows}.",col_limit:"\u05d7\u05e8\u05d9\u05d2\u05d4 \u05de\u05de\u05e1\u05e4\u05e8 \u05d4\u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05d4\u05de\u05e7\u05e1\u05d9\u05de\u05d0\u05dc\u05d9 \u05e9\u05dc {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"\u05e9\u05d5\u05e8\u05d4 \u05ea\u05d7\u05ea\u05d9\u05ea",tbody:"\u05e9\u05d5\u05e8\u05d4 \u05e8\u05d2\u05d9\u05dc\u05d4",thead:"\u05e9\u05d5\u05e8\u05ea \u05db\u05d5\u05ea\u05e8\u05ea",row_all:"\u05e2\u05d3\u05db\u05d5\u05df\u05db\u05dc \u05d4\u05e9\u05d5\u05e8\u05d5\u05ea \u05d1\u05d8\u05d1\u05dc\u05d4",row_even:"\u05e2\u05d3\u05db\u05d5\u05df \u05e9\u05d5\u05e8\u05d5\u05ea \u05d6\u05d5\u05d2\u05d9\u05d5\u05ea \u05d1\u05d8\u05d1\u05dc\u05d4",row_odd:"\u05e2\u05d3\u05db\u05d5\u05df \u05e9\u05d5\u05e8\u05d5\u05ea \u05d0\u05d9-\u05d6\u05d5\u05d2\u05d9\u05d5\u05ea \u05d1\u05d8\u05d1\u05dc\u05d4",row_row:"\u05e2\u05d3\u05db\u05d5\u05df \u05e9\u05d5\u05e8\u05d4 \u05e0\u05d5\u05db\u05d7\u05d9\u05ea",cell_all:"\u05e2\u05d3\u05db\u05d5\u05df \u05db\u05dc \u05ea\u05d0\u05d9 \u05d4\u05d8\u05d1\u05dc\u05d4",cell_row:"\u05e2\u05d3\u05db\u05d5\u05df \u05db\u05dc \u05ea\u05d0\u05d9 \u05d4\u05e9\u05d5\u05e8\u05d4",cell_cell:"\u05e2\u05d3\u05db\u05d5\u05df \u05ea\u05d0 \u05e0\u05d5\u05db\u05d7\u05d9",th:"\u05db\u05d5\u05ea\u05e8\u05ea",td:"\u05ea\u05d0 \u05de\u05d9\u05d3\u05e2",summary:"\u05ea\u05de\u05e6\u05d9\u05ea",bgimage:"\u05ea\u05de\u05d5\u05e0\u05ea \u05e8\u05e7\u05e2",rtl:"\u05de\u05d9\u05de\u05d9\u05df \u05dc\u05e9\u05de\u05d0\u05dc",ltr:"\u05de\u05e9\u05de\u05d0\u05dc \u05dc\u05d9\u05de\u05d9\u05df",mime:"Target MIME type",langcode:"\u05e7\u05d5\u05d3 \u05d4\u05e9\u05e4\u05d4",langdir:"\u05db\u05d9\u05d5\u05d5\u05df \u05d4\u05e9\u05e4\u05d4",style:"\u05e2\u05d9\u05e6\u05d5\u05d1",id:"Id",merge_cells_title:"\u05d0\u05d7\u05d3 \u05ea\u05d0\u05d9\u05dd \u05d1\u05d8\u05d1\u05dc\u05d4",bgcolor:"\u05e6\u05d1\u05e2 \u05d4\u05e8\u05e7\u05e2",bordercolor:"\u05e6\u05d1\u05e2 \u05d4\u05d2\u05d1\u05d5\u05dc",align_bottom:"\u05ea\u05d7\u05ea\u05d9\u05ea",align_top:"\u05e2\u05dc\u05d9\u05d5\u05df",valign:"\u05d9\u05e9\u05d5\u05e8 \u05d0\u05e0\u05db\u05d9",cell_type:"\u05e1\u05d2\u05e0\u05d5\u05df \u05d4\u05ea\u05d0",cell_title:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05ea\u05d0 \u05d1\u05d8\u05d1\u05dc\u05d4",row_title:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4",align_middle:"\u05d0\u05de\u05e6\u05e2",align_right:"\u05dc\u05d9\u05de\u05d9\u05df",align_left:"\u05dc\u05e9\u05de\u05d0\u05dc",align_default:"Default",align:"\u05d9\u05e9\u05d5\u05e8 \u05d0\u05d5\u05e4\u05e7\u05d9",border:"\u05d2\u05d1\u05d5\u05dc",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"\u05e9\u05d5\u05e8\u05d5\u05ea",cols:"\u05e2\u05de\u05d5\u05d3\u05d5\u05ea",height:"\u05d2\u05d5\u05d1\u05d4",width:"\u05e8\u05d5\u05d7\u05d1",title:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05d8\u05d1\u05dc\u05d4",rowtype:"\u05e1\u05d5\u05d2 \u05d4\u05e9\u05d5\u05e8\u05d4 \u05d1\u05d8\u05d1\u05dc\u05d4",advanced_props:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05de\u05ea\u05e7\u05d3\u05de\u05d5\u05ea",general_props:"\u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05db\u05dc\u05dc\u05d9\u05d5\u05ea",advanced_tab:"\u05de\u05ea\u05e7\u05d3\u05dd",general_tab:"\u05db\u05dc\u05dc\u05d9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/hi_dlg.js b/js/tiny_mce/plugins/table/langs/hi_dlg.js new file mode 100755 index 000000000..563089b94 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/hi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hi.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/hr_dlg.js b/js/tiny_mce/plugins/table/langs/hr_dlg.js new file mode 100755 index 000000000..511eb922e --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/hr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hr.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Opis tablice",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).",row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).",col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).",colgroup:"Grupa stupaca",rowgroup:"Grupa redaka",scope:"Domet",tfoot:"Podno\u017eje tablice",tbody:"Tijelo tablice",thead:"Zaglavlje tablice",row_all:"Primjeni na sve retke u tablici",row_even:"Primjeni na parne retke u tablici",row_odd:"Primjeni na neparne retke u tablici",row_row:"Primjeni na odabrani redak",cell_all:"Primjeni na sve \u0107elije u tablici",cell_row:"Primjeni na sve \u0107elije u retku",cell_cell:"Primjeni na odabranu \u0107eliju",th:"Zaglavlje",td:"Podatkovna",summary:"Sa\u017eetak",bgimage:"Slika pozadine",rtl:"S desna na lijevo",ltr:"S lijeva na desno",mime:"MIME tip",langcode:"Kod jezika",langdir:"Smjer jezika",style:"Stil",id:"Id",merge_cells_title:"Spoji \u0107elije",bgcolor:"Background color",bordercolor:"Boja obruba",align_bottom:"Dno",align_top:"Vrh",valign:"Okomito poravnavanje",cell_type:"Tip \u0107elije",cell_title:"Svojstva \u0107elije",row_title:"Svojstva retka",align_middle:"Sredina",align_right:"Desno",align_left:"Lijevo",align_default:"Zadano",align:"Poravnavanje",border:"Obrub",cellpadding:"Dopuna \u0107elije",cellspacing:"Razmak \u0107elija",rows:"Redaka",cols:"Stupaca",height:"Visina",width:"\u0160irina",title:"Umetni/uredi tablicu",rowtype:"Row in table part",advanced_props:"Napredna svojstva",general_props:"Osnovna svojstva",advanced_tab:"Napredno",general_tab:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/hu_dlg.js b/js/tiny_mce/plugins/table/langs/hu_dlg.js new file mode 100755 index 000000000..0a2b8c167 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.table_dlg',{"rules_border":"keret","rules_box":"doboz","rules_vsides":"f. oldalak","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"v. oldalak","rules_below":"alatta","rules_above":"f\u00f6l\u00f6tte","rules_void":"sehol",rules:"Vonalak","frame_all":"mind","frame_cols":"oszlopok","frame_rows":"sorok","frame_groups":"csoportok","frame_none":"nincs",frame:"Keret",caption:"C\u00edmsor","missing_scope":"Biztosan folytatni akarja an\u00e9lk\u00fcl, hogy hat\u00f3k\u00f6rt adna ennek a fejl\u00e9ccell\u00e1nak? Korl\u00e1toz\u00e1sokkal \u00e9l\u0151k sz\u00e1m\u00e1ra neh\u00e9z lesz meg\u00e9rteni a t\u00e1bl\u00e1zat tartalm\u00e1t.","cell_limit":"T\u00fall\u00e9pte a maxim\u00e1lis cellasz\u00e1mot, ami {$cells}.","row_limit":"T\u00fall\u00e9pte a maxim\u00e1lis sorsz\u00e1mot, ami {$rows}.","col_limit":"T\u00fall\u00e9pte a maxim\u00e1lis oszlopsz\u00e1mot, ami {$cols}.",colgroup:"Oszlop csoport",rowgroup:"Sor csoport",scope:"Hat\u00f3k\u00f6r",tfoot:"T\u00e1bl\u00e1zat l\u00e1b",tbody:"T\u00e1bl\u00e1zat test",thead:"T\u00e1bl\u00e1zat fej","row_all":"Minden sor friss\u00edt\u00e9se","row_even":"P\u00e1ros sorok friss\u00edt\u00e9se","row_odd":"P\u00e1ratlan sorok friss\u00edt\u00e9se","row_row":"Sor friss\u00edt\u00e9se","cell_all":"T\u00e1bl\u00e1zat \u00f6sszes cell\u00e1j\u00e1nak friss\u00edt\u00e9se","cell_row":"Sor \u00f6sszes cell\u00e1j\u00e1nak friss\u00edt\u00e9se","cell_cell":"Cella friss\u00edt\u00e9se",th:"Fejl\u00e9c",td:"Adat",summary:"\u00d6sszegz\u00e9s",bgimage:"H\u00e1tt\u00e9rk\u00e9p",rtl:"Jobbr\u00f3l balra",ltr:"Balr\u00f3l jobbra",mime:"C\u00e9l MIME t\u00edpus",langcode:"Nyelvk\u00f3d",langdir:"\u00cdr\u00e1s ir\u00e1ny",style:"St\u00edlus",id:"Id","merge_cells_title":"Cell\u00e1k \u00f6sszevon\u00e1sa",bgcolor:"H\u00e1tt\u00e9rsz\u00edn",bordercolor:"Keretsz\u00edn","align_bottom":"Le","align_top":"Fel",valign:"F\u00fcgg\u0151leges igaz\u00edt\u00e1s","cell_type":"Cellat\u00edpus","cell_title":"Cella tulajdons\u00e1gai","row_title":"Sor tulajdons\u00e1gai","align_middle":"K\u00f6z\u00e9pre","align_right":"Jobbra","align_left":"Balra","align_default":"Alap\u00e9rtelmezett",align:"Igaz\u00edt\u00e1s",border:"Keret",cellpadding:"Cella bels\u0151k\u00f6z",cellspacing:"Cellak\u00f6z",rows:"Sorok",cols:"Oszlopok",height:"Magass\u00e1g",width:"Sz\u00e9less\u00e9g",title:"T\u00e1bl\u00e1zat besz\u00far\u00e1sa/szerkeszt\u00e9se",rowtype:"Sor a t\u00e1bl\u00e1ban","advanced_props":"Halad\u00f3 tulajdons\u00e1gok","general_props":"\u00c1ltal\u00e1nos tulajdons\u00e1gok","advanced_tab":"Halad\u00f3","general_tab":"\u00c1ltal\u00e1nos"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/hy_dlg.js b/js/tiny_mce/plugins/table/langs/hy_dlg.js new file mode 100755 index 000000000..3f1805a26 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/hy_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hy.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"\u0424\u0440\u0435\u0439\u043c",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table",cell_limit:"You\'ve exceeded the maximum number of cells of ($ cells)",row_limit:"You\'ve exceeded the maximum number of rows of ($ rows)",col_limit:"You\'ve exceeded the maximum number of columns of ($ cols)",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"\u041d\u0438\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u0441\u0438\u043d\u0430",tbody:"\u0422\u0435\u043b\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b",thead:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u044b",row_all:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435",row_even:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435",row_odd:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435",row_row:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443",cell_all:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435",cell_row:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435",cell_cell:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443",th:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",td:"\u0414\u0430\u043d\u043d\u044b\u0435",summary:"\u041e\u0431\u0449\u0435\u0435",bgimage:"\u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e",ltr:"\u0421\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e",mime:"Target MIME-\u0442\u0438\u043f",langcode:"\u041a\u043e\u0434 \u044f\u0437\u044b\u043a\u0430",langdir:"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430",style:"\u0421\u0442\u0438\u043b\u044c",id:"Id",merge_cells_title:"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438",bgcolor:"\u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430",bordercolor:"\u0446\u0432\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b",align_bottom:"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e",align_top:"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e",valign:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435",cell_type:"\u0422\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438",cell_title:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b",row_title:"\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b",align_middle:"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443",align_right:"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_left:"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_default:"\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",align:"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435",border:"\u0413\u0440\u0430\u043d\u0438\u0446\u0430",cellpadding:"\u041e\u0442\u0441\u0442\u0443\u043f\u044b \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445",cellspacing:"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438",rows:"\u0421\u0440\u043e\u043a\u0438",cols:"\u0421\u0442\u043e\u043b\u0431\u0446\u044b",height:"\u0412\u044b\u0441\u043e\u0442\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",title:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 / \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b",rowtype:"Row in table part",advanced_props:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430",general_props:"\u041e\u0431\u0449\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430",advanced_tab:"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e",general_tab:"\u041e\u0431\u0449\u0435\u0435"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ia_dlg.js b/js/tiny_mce/plugins/table/langs/ia_dlg.js new file mode 100755 index 000000000..3b8f5feaf --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ia_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ia.table_dlg',{rules_border:"\u8fb9\u6846",rules_box:"\u76d2",rules_vsides:"\u5782\u76f4\u5927\u5c0f",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"\u6c34\u5e73\u5927\u5c0f",rules_below:"\u4e4b\u4e0b",rules_above:"\u4e4b\u4e0a",rules_void:"\u7a7a",rules:"\u6807\u5c3a",frame_all:"\u5168\u90e8",frame_cols:"\u5217",frame_rows:"\u884c",frame_groups:"\u7ec4",frame_none:"\u65e0",frame:"\u8fb9\u6846",caption:"\u8868\u683c\u6807\u9898",missing_scope:"\u60a8\u786e\u5b9a\u4e0d\u6307\u5b9a\u8868\u5934\u50a8\u5b58\u683c\u7684\u8303\u56f4\u5417\uff1f\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u90e8\u5206\u4f7f\u7528\u8005\u5c06\u5f88\u96be\u67e5\u770b\u8868\u683c\u5185\u5bb9",cell_limit:"\u5df2\u8d85\u8fc7\u9650\u5236\uff0c\u6700\u591a\u4e3a{$cells} \u50a8\u5b58\u683c\u3002",row_limit:"\u5df2\u8d85\u8fc7\u9650\u5236\uff0c\u6700\u591a\u4e3a {$rows} \u884c\u3002",col_limit:"\u5df2\u8d85\u8fc7\u9650\u5236\uff0c\u6700\u591a\u4e3a {$cols} \u5217\u3002",colgroup:"\u5217\u7ec4",rowgroup:"\u884c\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u811a",tbody:"\u8868\u4f53",thead:"\u8868\u5934",row_all:"\u66f4\u65b0\u8868\u683c\u7684\u5168\u90e8\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6570\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6570\u884c",row_row:"\u66f4\u65b0\u6240\u5728\u884c",cell_all:"\u66f4\u65b0\u5168\u90e8\u50a8\u5b58\u683c",cell_row:"\u66f4\u65b0\u5f53\u524d\u884c\u7684\u50a8\u5b58\u683c",cell_cell:"\u66f4\u65b0\u76ee\u524d\u7684\u50a8\u5b58\u683c",th:"\u8868\u5934",td:"\u8868\u683c",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",mime:"\u76ee\u6807 MIME \u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"Id",merge_cells_title:"\u5408\u5e76\u50a8\u5b58\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272",align_bottom:"\u5e95\u90e8",align_top:"\u9876\u90e8",valign:"\u5782\u76f4\u5bf9\u9f50\u65b9\u5f0f",cell_type:"\u50a8\u5b58\u683c \u7c7b\u522b",cell_title:"\u50a8\u5b58\u683c \u5c5e\u6027",row_title:"\u884c \u5c5e\u6027",align_middle:"\u5c45\u4e2d",align_right:"\u5c45\u53f3",align_left:"\u5c45\u5de6",align_default:"\u9ed8\u8ba4",align:"\u5bf9\u9f50\u65b9\u5f0f",border:"\u8fb9\u6846",cellpadding:"\u50a8\u5b58\u683c\u5185\u8ddd",cellspacing:"\u50a8\u5b58\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u5217\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91 \u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",general_props:"\u57fa\u672c \u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",general_tab:"\u57fa\u672c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/id_dlg.js b/js/tiny_mce/plugins/table/langs/id_dlg.js new file mode 100755 index 000000000..d14fd155b --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Yakin ingin melanjutkan tanpa menetapkan cakupan sel header tabel ini. Tanpa itu, mungkin sulit bagi beberapa pengguna yang memiliki keterbatasan untuk memahami isi atau data yang ditampilkan dari tabel.",cell_limit:"Anda telah melebihi jumlah maksimum cell {$cells}.",row_limit:"Anda telah melebihi jumlah maksimum row {$rows}.",col_limit:"Anda telah melebihi jumlah maksimum kolom {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Gambar Background",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",mime:"Target MIME type",langcode:"Kode Bahasa",langdir:"Bahasa",style:"Style",id:"Id",merge_cells_title:"Merge cell tabel",bgcolor:"Warna Background",bordercolor:"Warna Border",align_bottom:"Bawah",align_top:"Atas",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Properti cell tabel",row_title:"Properti row tabel",align_middle:"Tengah",align_right:"Kanan",align_left:"Kiri",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Tinggi",width:"Lebar",title:"Sisipkan/Ubah Tabel",rowtype:"Row in table part",advanced_props:"Properti Advanced",general_props:"Properti Umum",advanced_tab:"Advanced",general_tab:"Umum"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ii_dlg.js b/js/tiny_mce/plugins/table/langs/ii_dlg.js new file mode 100755 index 000000000..b931c3e8e --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ii_dlg.js @@ -0,0 +1,74 @@ +tinyMCE.addI18n('ii.table_dlg',{ +general_tab:"\u4E00\u822C", +advanced_tab:"\u9AD8\u7EA7", +general_props:"\u4E00\u822C\u5C5E\u6027", +advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", +rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", +title:"\u63D2\u5165/\u7F16\u8F91\u8868\u683C", +width:"\u5BBD\u5EA6", +height:"\u9AD8\u5EA6", +cols:"\u5217\u6570", +rows:"\u884C\u6570", +cellspacing:"\u50A8\u5B58\u683C\u95F4\u8DDD", +cellpadding:"\u50A8\u5B58\u683C\u7559\u767D", +border:"\u8FB9\u6846", +align:"\u5BF9\u9F50\u65B9\u5F0F", +align_default:"\u9884\u8BBE", +align_left:"\u9760\u5DE6", +align_right:"\u9760\u53F3", +align_middle:"\u5C45\u4E2D", +row_title:"\u884C\u5C5E\u6027", +cell_title:"\u50A8\u5B58\u683C\u5C5E\u6027", +cell_type:"\u50A8\u5B58\u683C\u522B", +valign:"\u6C34\u51C6\u5BF9\u9F50\u65B9\u5F0F", +align_top:"\u4E0A\u65B9", +align_bottom:"\u4E0B\u65B9", +bordercolor:"\u8FB9\u6846\u989C\u8272", +bgcolor:"\u80CC\u666F\u989C\u8272", +merge_cells_title:"\u5408\u5E76\u50A8\u5B58\u683C", +id:"Id", +style:"\u6837\u5F0F", +langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", +langcode:"\u8BED\u8A00\u7F16\u7801", +mime:"\u76EE\u6807MIME\u7C7B\u578B", +ltr:"\u7531\u5DE6\u5230\u53F3", +rtl:"\u7531\u53F3\u5230\u5DE6", +bgimage:"\u80CC\u666F\u56FE\u7247", +summary:"\u6982\u8981", +td:"\u6570\u636E", +th:"\u8868\u5934", +cell_cell:"\u66F4\u65B0\u6240\u7684\u50A8\u5B58\u683C", +cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u50A8\u5B58\u683C", +cell_all:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5168\u90E8\u50A8\u5B58\u683C", +row_row:"\u66F4\u65B0\u6240\u5728\u884C", +row_odd:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5947\u6570\u884C", +row_even:"\u66F4\u65B0\u8868\u683C\u5185\u7684\u5076\u6570\u884C", +row_all:"\u66F4\u65B0\u8868\u683C\u5185\u5168\u90E8\u884C", +thead:"\u8868\u5934", +tbody:"\u8868\u8EAB", +tfoot:"\u8868\u5C3E", +scope:"\u8303\u56F4", +rowgroup:"\u884C\u7FA4\u7EC4", +colgroup:"\u5217\u7FA4\u7EC4", +col_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u5217\u6570\u4E3A{$cols}\u5217\u3002", +row_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u884C\u6570\u4E3A{$rows}\u884C\u3002", +cell_limit:"\u5DF2\u8D85\u8FC7\u53EF\u7528\u6570\uFF0C\u6700\u9AD8\u7684\u50A8\u5B58\u683C\u6570\u4E3A{$cells}\u683C\u3002", +missing_scope:"\u6807\u9898\u884C\u7F3A\u5931\uFF01", +caption:"\u8868\u683C\u6807\u9898", +frame:"\u8FB9\u6846", +frame_none:"\u65E0", +frame_groups:"\u7FA4\u7EC4", +frame_rows:"\u884C", +frame_cols:"\u5217", +frame_all:"\u5168\u90E8", +rules:"\u7EBF\u6761", +rules_void:"\u7A7A", +rules_above:"\u4E0A", +rules_below:"\u4E0B", +rules_hsides:"\u6C34\u51C6\u8FB9", +rules_lhs:"\u5DE6\u8FB9", +rules_rhs:"\u53F3\u8FB9", +rules_vsides:"\u5782\u76F4\u8FB9", +rules_box:"\u76D2\u578B", +rules_border:"\u5916\u6846" +}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/is_dlg.js b/js/tiny_mce/plugins/table/langs/is_dlg.js new file mode 100755 index 000000000..b2fb158ad --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/is_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('is.table_dlg',{rules_border:"rammi",rules_box:"box",rules_vsides:"vsides",rules_rhs:"hhl",rules_lhs:"vhl",rules_hsides:"hli\u00f0ar",rules_below:"ne\u00f0an",rules_above:"ofan",rules_void:"\u00f3gilt",rules:"Rules",frame_all:"allt",frame_cols:"d\u00e1lkar",frame_rows:"ra\u00f0ir",frame_groups:"h\u00f3par",frame_none:"ekkert",frame:"rammi",caption:"T\u00f6fluval",missing_scope:"Ertu viss um a\u00f0 \u00fe\u00fa viljir halda \u00e1fram \u00e1n \u00feess a\u00f0 skilgreina innihaldi\u00f0 fyrir \u00feessa t\u00f6flu fyrirs\u00f6gn. \u00c1n hennar getur veri\u00f0 erfitt fyrir suma notendur me\u00f0 h\u00f6mlun a\u00f0 skilja innihaldi\u00f0 e\u00f0a \u00fea\u00f0 efni sem er til sta\u00f0ar \u00ed t\u00f6flunni.",cell_limit:"\u00de\u00fa ert komin yfir leyfilegan fj\u00f6lda reita {$cells}.",row_limit:"\u00de\u00fa ert komin yfir leyfilegna fj\u00f6lda ra\u00f0a {$rows}.",col_limit:"\u00de\u00fa ert komin yfir leyfilegan fj\u00f6lda d\u00e1lka {$cols}.",colgroup:"D\u00e1lkah\u00f3pur",rowgroup:"Ra\u00f0arh\u00f3pur",scope:"Umfang",tfoot:"T\u00f6fluf\u00f3tur",tbody:"T\u00f6flusv\u00e6\u00f0i",thead:"Fyrirs\u00f6gn t\u00f6flu",row_all:"Uppf\u00e6ra allar ra\u00f0ir \u00ed t\u00f6flunni",row_even:"Uppf\u00e6ra sl\u00e9ttra\u00f0ir",row_odd:"Uppf\u00e6ra oodara\u00f0ir",row_row:"Uppf\u00e6ra n\u00faverandi r\u00f6\u00f0",cell_all:"Uppf\u00e6ra alla reiti i t\u00f6flunni",cell_row:"Uppf\u00e6ra alla reiti \u00ed r\u00f6\u00f0inni",cell_cell:"Uppf\u00e6ra n\u00faverandi reit",th:"Fyrirs\u00f6gn",td:"G\u00f6gn",summary:"Yfirlit",bgimage:"Bakgrunnsmynd",rtl:"Fr\u00e1 h\u00e6gri til vinstri",ltr:"Fr\u00e1 vinstri til h\u00e6gri",mime:"Velja MIME tegund",langcode:"Tungum\u00e1la k\u00f3\u00f0i",langdir:"Tungum\u00e1la \u00e1tt",style:"St\u00edll",id:"id",merge_cells_title:"Sameina reiti",bgcolor:"Bakgrunnslitur",bordercolor:"Rammalitur",align_bottom:"Ne\u00f0st",align_top:"Efst",valign:"L\u00f3\u00f0r\u00e9tt j\u00f6fnun",cell_type:"Reitartegund",cell_title:"Eiginleikar reits",row_title:"Eiginleikar ra\u00f0ar",align_middle:"Mi\u00f0ja",align_right:"H\u00e6gri",align_left:"Vinstri",align_default:"St\u00f6\u00f0lu\u00f0",align:"J\u00f6fnun",border:"Rammi",cellpadding:"Reita \u00f6ndun",cellspacing:"Reitabil",rows:"Ra\u00f0ir",cols:"Cols",height:"H\u00e6\u00f0",width:"Breidd",title:"Setja inn/Breyta t\u00f6flu",rowtype:"R\u00f6\u00f0 \u00ed t\u00f6fluhluta",advanced_props:"Frekari eiginleikar",general_props:"Almennir eiginleikar",advanced_tab:"N\u00e1nar",general_tab:"Almennt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/it_dlg.js b/js/tiny_mce/plugins/table/langs/it_dlg.js new file mode 100755 index 000000000..35bc2d95f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.table_dlg',{rules_border:"bordo",rules_box:"box",rules_vsides:"lato vert.",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"lato orizz.",rules_below:"sotto",rules_above:"sopra",rules_void:"vuoto",rules:"Regole",frame_all:"tutte",frame_cols:"colonne",frame_rows:"righe",frame_groups:"gruppi",frame_none:"nessuna",frame:"Cornice",caption:"Table caption",missing_scope:"Sicuro di proseguire senza aver specificato uno scope per l\'intestazione di questa tabella? Senza di esso, potrebbe essere difficoltoso per alcuni utenti con disabilit\u00e0 capire il contenuto o i dati mostrati nella tabella.",cell_limit:"Superato il numero massimo di celle di {$cells}.",row_limit:"Superato il numero massimo di righe di {$rows}.",col_limit:"Superato il numero massimo di colonne di {$cols}.",colgroup:"Gruppo colonna",rowgroup:"Gruppo riga",scope:"Scope",tfoot:"Pedice tabella",tbody:"Corpo tabella",thead:"Intestazione tabella",row_all:"Update tutte le righe della tabella",row_even:"Aggiorna righe pari della tabella",row_odd:"Aggiorna righe dispari della tabella",row_row:"Aggiorna riga corrente",cell_all:"Aggiorna tutte le celle della tabella",cell_row:"Aggiorna tutte le celle della riga",cell_cell:"Aggiorna cella corrente",th:"Intestazione",td:"Data",summary:"Sommario",bgimage:"Immagine sfondo",rtl:"Destra verso sinistra",ltr:"Sinistra verso destra",mime:"Tipo MIME del target",langcode:"Lingua",langdir:"Direzione testo",style:"Stile",id:"Id",merge_cells_title:"Unisci celle",bgcolor:"Colore sfondo",bordercolor:"Colore bordo",align_bottom:"In basso",align_top:"In alto",valign:"Allineamento verticale",cell_type:"Tipo cella",cell_title:"Propriet\u00e0 cella",row_title:"Propriet\u00e0 riga",align_middle:"Centra",align_right:"A destra",align_left:"A sinistra",align_default:"Predefinito",align:"Allineamento",border:"Bordo",cellpadding:"Padding celle",cellspacing:"Spaziatura celle",rows:"Righe",cols:"Colonne",height:"Altezza",width:"Larghezza",title:"Inserisci/Modifica tabella",rowtype:"Riga in una parte di tabella",advanced_props:"Propriet\u00e0 avanzate",general_props:"Propriet\u00e0 generali",advanced_tab:"Avanzate",general_tab:"Generale"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ja_dlg.js b/js/tiny_mce/plugins/table/langs/ja_dlg.js new file mode 100755 index 000000000..b79166a01 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ja_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ja.table_dlg',{"rules_border":"\u4e0a\u4e0b\u5de6\u53f3(border)","rules_box":"\u4e0a\u4e0b\u5de6\u53f3(box)","rules_vsides":"\u5de6\u53f3","rules_rhs":"\u53f3","rules_lhs":"\u5de6","rules_hsides":"\u4e0a\u4e0b","rules_below":"\u4e0b","rules_above":"\u4e0a","rules_void":"\u306a\u3057",rules:"\u8868\u306e\u5916\u67a0","frame_all":"\u5168\u3066","frame_cols":"\u5217","frame_rows":"\u884c","frame_groups":"\u30b0\u30eb\u30fc\u30d7\u6bce","frame_none":"\u306a\u3057",frame:"\u30bb\u30eb\u67a0\u7dda",caption:"\u8868\u306b\u898b\u51fa\u3057\u3092\u4ed8\u3051\u308b","missing_scope":"\u8868\u306e\u30b9\u30b3\u30fc\u30d7\u5c5e\u6027\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f","cell_limit":"\u30bb\u30eb\u306e\u6700\u5927\u6570\u3092\u8d85\u3048\u307e\u3057\u305f\u3002","row_limit":"\u884c\u306e\u6700\u5927\u6570\u3092\u8d85\u3048\u307e\u3057\u305f\u3002","col_limit":"\u5217\u306e\u6700\u5927\u6570\u3092\u8d85\u3048\u307e\u3057\u305f\u3002",colgroup:"\u5217\u30b0\u30eb\u30fc\u30d7",rowgroup:"\u884c\u30b0\u30eb\u30fc\u30d7",scope:"\u30b9\u30b3\u30fc\u30d7",tfoot:"\u8868\u30d5\u30c3\u30bf",tbody:"\u8868\u30dc\u30c7\u30a3",thead:"\u8868\u30d8\u30c3\u30c0","row_all":"\u5168\u3066\u306e\u884c\u306e\u66f4\u65b0","row_even":"\u5076\u6570\u884c\u306e\u66f4\u65b0","row_odd":"\u5947\u6570\u884c\u306e\u66f4\u65b0","row_row":"\u9078\u629e\u884c\u306e\u66f4\u65b0","cell_all":"\u5168\u3066\u306e\u30bb\u30eb\u306e\u66f4\u65b0","cell_row":"\u884c\u5185\u306e\u30bb\u30eb\u306e\u66f4\u65b0","cell_cell":"\u9078\u629e\u30bb\u30eb\u306e\u66f4\u65b0",th:"\u30d8\u30c3\u30c0",td:"\u30c7\u30fc\u30bf",summary:"\u30b5\u30de\u30ea\u30fc",bgimage:"\u80cc\u666f\u753b\u50cf",rtl:"\u53f3\u304b\u3089\u5de6",ltr:"\u5de6\u304b\u3089\u53f3",mime:"\u30bf\u30fc\u30b2\u30c3\u30c8\u306eMIME\u30bf\u30a4\u30d7",langcode:"\u8a00\u8a9e\u30b3\u30fc\u30c9",langdir:"\u6587\u7ae0\u306e\u65b9\u5411",style:"\u30b9\u30bf\u30a4\u30eb",id:"ID","merge_cells_title":"\u30bb\u30eb\u306e\u7d50\u5408",bgcolor:"\u80cc\u666f\u8272",bordercolor:"\u67a0\u7dda\u306e\u8272","align_bottom":"\u4e0b\u63c3\u3048","align_top":"\u4e0a\u63c3\u3048",valign:"\u5782\u76f4\u65b9\u5411\u306e\u914d\u7f6e","cell_type":"\u30bb\u30eb\u7a2e\u5225","cell_title":"\u30bb\u30eb\u306e\u30d7\u30ed\u30d1\u30c6\u30a3","row_title":"\u884c\u306e\u30d7\u30ed\u30d1\u30c6\u30a3","align_middle":"\u4e2d\u592e\u63c3\u3048","align_right":"\u53f3\u63c3\u3048","align_left":"\u5de6\u63c3\u3048","align_default":"\u30c7\u30d5\u30a9\u30eb\u30c8",align:"\u914d\u7f6e",border:"\u67a0\u7dda",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"\u884c",cols:"\u5217",height:"\u9ad8\u3055",width:"\u5e45",title:"\u8868\u306e\u633f\u5165/\u7de8\u96c6",rowtype:"\u884c","advanced_props":"\u4e0a\u7d1a\u8005\u5411\u3051","general_props":"\u4e00\u822c","advanced_tab":"\u4e0a\u7d1a\u8005\u5411\u3051","general_tab":"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ka_dlg.js b/js/tiny_mce/plugins/table/langs/ka_dlg.js new file mode 100755 index 000000000..757007531 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ka_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ka.table_dlg',{rules_border:"\u10e1\u10d0\u10d6\u10e6\u10d5\u10d0\u10e0\u10d8",rules_box:"\u10d9\u10dd\u10da\u10dd\u10e4\u10d8",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"wesebi",frame_all:"\u10e7\u10d5\u10d4\u10da\u10d0",frame_cols:"\u10e1\u10d5\u10d4\u10e2\u10d4\u10d1\u10d8",frame_rows:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8",frame_groups:"\u10ef\u10d2\u10e3\u10e4\u10d4\u10d1\u10d8",frame_none:"none",frame:"\u10d9\u10d0\u10d3\u10e0\u10d8",caption:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",missing_scope:"\u10d7\u10e3 \u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8 \u10d0\u10e0 \u10d8\u10e5\u10dc\u10d4\u10d1\u10d0 \u10db\u10d8\u10d7\u10d8\u10d7\u10d4\u10d1\u10e3\u10da\u10d8, \u10e8\u10d4\u10d8\u10eb\u10da\u10d4\u10d1\u10d0 \u10e7\u10d5\u10d4\u10da\u10d0\u10db \u10d5\u10d4\u10e0 \u10dc\u10d0\u10ee\u10dd\u10e1 \u10d8\u10dc\u10e4\u10dd\u10e0\u10db\u10d0\u10ea\u10d8\u10d0.",cell_limit:"\u10db\u10d8\u10e6\u10ec\u10d4\u10e3\u10da\u10d8\u10d0 \u10db\u10d0\u10e5\u10e1\u10d8\u10db\u10d0\u10da\u10e3\u10e0\u10d8 \u10d6\u10e6\u10d5\u10d0\u10e0\u10d8, $ \u10e3\u10ef\u10e0\u10d0.",row_limit:"\u10db\u10d8\u10e6\u10ec\u10d4\u10e3\u10da\u10d8\u10d0 \u10db\u10d0\u10e5\u10e1\u10d8\u10db\u10d0\u10da\u10e3\u10e0\u10d8 \u10d6\u10e6\u10d5\u10d0\u10e0\u10d8, $ \u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d8.",col_limit:"\u10db\u10d8\u10e6\u10ec\u10d4\u10e3\u10da\u10d8\u10d0 \u10db\u10d0\u10e5\u10e1\u10d8\u10db\u10d0\u10da\u10e3\u10e0\u10d8 \u10d6\u10e6\u10d5\u10d0\u10e0\u10d8, $ \u10e1\u10d5\u10d4\u10e2\u10d8.",colgroup:"\u10e1\u10d5\u10d4\u10e2\u10d4\u10d1\u10d8\u10e1 \u10ef\u10d2\u10e3\u10e4\u10d8",rowgroup:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8\u10e1 \u10ef\u10d2\u10e3\u10e4\u10d8",scope:"\u10db\u10d8\u10d3\u10d0\u10db\u10dd",tfoot:"\u10d3\u10d0\u10e1\u10e0\u10e3\u10da\u10d4\u10d1\u10d0",tbody:"\u10e1\u10ee\u10d4\u10e3\u10da\u10d8",thead:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",row_all:"\u10ea\u10ee\u10e0\u10d8\u10da\u10e1\u10d8 \u10e7\u10d5\u10d4\u10da\u10d0 \u10e3\u10ef\u10e0\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",row_even:"\u10ea\u10ee\u10e0\u10d8\u10da\u10e8\u10d8 \u10da\u10e3\u10ec\u10d8\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",row_odd:"\u10ea\u10ee\u10e0\u10e3\u10da\u10e1\u10d8 \u10d9\u10d4\u10dc\u10e2\u10d8 \u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",row_row:"\u10db\u10dd\u10ea\u10d4\u10db\u10e3\u10da\u10d8 \u10e1\u10e2\u10d8\u10e0\u10e5\u10dd\u10dc\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",cell_all:"\u10ea\u10ee\u10e0\u10d8\u10da\u10e1\u10d8 \u10e7\u10d5\u10d4\u10da\u10d0 \u10e3\u10ef\u10e0\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",cell_row:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10e8\u10d8 \u10e7\u10d5\u10d4\u10da\u10d0 \u10e3\u10ef\u10e0\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",cell_cell:"\u10db\u10dd\u10ea\u10d4\u10db\u10e3\u10da\u10d8 \u10e3\u10ef\u10e0\u10d8\u10e1 \u10d2\u10d0\u10dc\u10d0\u10ee\u10da\u10d4\u10d1\u10d0",th:"\u10e1\u10d0\u10d7\u10d0\u10e3\u10e0\u10d8",td:"\u10db\u10dd\u10dc\u10d0\u10ea\u10d4\u10db\u10d4\u10d1\u10d8",summary:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd",bgimage:"\u10e4\u10dd\u10dc\u10e3\u10e0\u10d8 \u10d2\u10d0\u10db\u10dd\u10e1\u10d0\u10ee\u10e3\u10da\u10d1\u10d0",rtl:"\u10db\u10d0\u10e0\u10d5\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d5",ltr:"\u10db\u10d0\u10e0\u10ea\u10ee\u10dc\u10d8\u10d3\u10d0\u10dc \u10db\u10d0\u10e0\u10ef\u10d5\u10dc\u10d8\u10d5",mime:"MIME \u10db\u10d8\u10d6\u10dc\u10d8\u10e1 \u10e2\u10d8\u10de\u10d8",langcode:"\u10d4\u10dc\u10d8\u10e1 \u10d9\u10dd\u10d3\u10d8",langdir:"\u10e2\u10d4\u10e5\u10e1\u10e2\u10d8\u10e1 \u10db\u10d8\u10db\u10d0\u10e0\u10d7\u10e3\u10da\u10d4\u10d1\u10d0",style:"\u10e1\u10e2\u10d8\u10da\u10d8",id:"\u10e1\u10d0\u10ee\u10d4\u10da\u10d8",merge_cells_title:"\u10e3\u10ef\u10e0\u10d4\u10d1\u10d8\u10e1 \u10d2\u10d0\u10d4\u10e0\u10d7\u10d8\u10d0\u10dc\u10d4\u10d1\u10d0",bgcolor:"\u10e8\u10d4\u10d5\u10e1\u10d4\u10d1\u10d8\u10e1 \u10e4\u10d4\u10e0\u10d8",bordercolor:"\u10e1\u10d0\u10d6\u10e6\u10d5\u10e0\u10d4\u10d1\u10d8\u10e1 \u10e4\u10d4\u10e0\u10d8",align_bottom:"\u10e5\u10d5\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_top:"\u10d6\u10d4\u10d3\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",valign:"\u10d5\u10d4\u10e0\u10e2\u10d8\u10d9\u10d0\u10da\u10e3\u10e0\u10d8 \u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",cell_type:"\u10e2\u10d8\u10de\u10d8",cell_title:"\u10e3\u10ef\u10e0\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",row_title:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",align_middle:"\u10ea\u10d4\u10dc\u10e2\u10e0\u10d6\u10d4",align_right:"\u10db\u10d0\u10e0\u10ef\u10d5\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_left:"\u10db\u10d0\u10e0\u10ea\u10ee\u10d4\u10dc\u10d0 \u10d9\u10d8\u10d3\u10d4\u10d6\u10d4",align_default:"\u10e1\u10d0\u10ec\u10d8\u10e1\u10d0\u10d3",align:"\u10d2\u10d0\u10e1\u10ec\u10dd\u10e0\u10d4\u10d1\u10d0",border:"\u10e1\u10d0\u10d6\u10e6\u10d5\u10d0\u10e0\u10d8",cellpadding:"\u10e3\u10ef\u10e0\u10d4\u10d1\u10e1 \u10e8\u10dd\u10e0\u10d8\u10e1 \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",cellspacing:"\u10e3\u10ef\u10e0\u10d4\u10d1\u10e1 \u10e8\u10dd\u10e0\u10d8\u10e1 \u10d3\u10d0\u10e8\u10dd\u10e0\u10d4\u10d1\u10d0",rows:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d4\u10d1\u10d8",cols:"\u10e1\u10d5\u10d4\u10e2\u10d4\u10d1\u10d8",height:"\u10e1\u10d8\u10db\u10d0\u10e6\u10da\u10d4",width:"\u10e1\u10d8\u10d2\u10d0\u10dc\u10d4",title:"\u10ea\u10ee\u10e0\u10d8\u10da\u10d8\u10e1 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",rowtype:"\u10e1\u10e2\u10e0\u10d8\u10e5\u10dd\u10dc\u10d8\u10e1 \u10e0\u10d8\u10de\u10d8",advanced_props:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7\u10d8 \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",general_props:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd \u10de\u10d0\u10e0\u10d0\u10db\u10d4\u10e2\u10e0\u10d4\u10d1\u10d8",advanced_tab:"\u10d3\u10d0\u10db\u10d0\u10e2\u10d4\u10d1\u10d8\u10d7",general_tab:"\u10e1\u10d0\u10d4\u10e0\u10d7\u10dd"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/kl_dlg.js b/js/tiny_mce/plugins/table/langs/kl_dlg.js new file mode 100755 index 000000000..0370cd248 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/kl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('kl.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/km_dlg.js b/js/tiny_mce/plugins/table/langs/km_dlg.js new file mode 100755 index 000000000..3f6c38952 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/km_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('km.table_dlg',{rules_border:"\u179f\u17ca\u17bb\u1798",rules_box:"\u1794\u17d2\u179a\u17a2\u1794\u17cb",rules_vsides:"\u1782\u17c2\u1798\u1794\u1789\u17d2\u1788\u179a",rules_rhs:"\u1782\u17c2\u1798\u179f\u17d2\u178a\u17b6\u17c6",rules_lhs:"\u1782\u17c2\u1798\u1786\u17d2\u179c\u17c1\u1784",rules_hsides:"\u1782\u17c2\u1798\u1795\u17d2\u178a\u17c1\u1780",rules_below:"\u1780\u17d2\u179a\u17c4\u1798",rules_above:"\u179b\u17be",rules_void:"\u1791\u17b8\u1785\u17c6\u17a0",rules:"\u1785\u17d2\u1794\u17b6\u1794\u17cb",frame_all:"\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb",frame_cols:"\u1785\u17c6\u1793\u17bd\u1793\u1787\u17bd\u179a\u1788\u179a",frame_rows:"\u1785\u17c6\u1793\u17bd\u1793\u1787\u17bd\u179a\u1795\u17d2\u178a\u17c1\u1780",frame_groups:"\u1780\u17d2\u179a\u17bb\u1798",frame_none:"\u1782\u17d2\u1798\u17b6\u1793",frame:"\u179f\u1793\u17d2\u179b\u17b9\u1780",caption:"\u1785\u17c6\u178e\u1784\u1787\u17be\u1784\u178f\u17bc\u1785\u178f\u17b6\u179a\u17b6\u1784",missing_scope:"\u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17b6\u1780\u178a\u1787\u17b6\u1785\u1784\u17cb\u1794\u1793\u17d2\u178f\u178a\u17c4\u1799\u1798\u17b7\u1793\u1794\u17b6\u1793\u1780\u17c6\u178e\u178f\u17cb\u179c\u17b7\u179f\u17b6\u179b\u1797\u17b6\u1796\u179f\u1798\u17d2\u179a\u17b6\u1794\u17cb\u1780\u17d2\u179a\u17a1\u17b6\u1780\u17d2\u1794\u17b6\u179b\u17ac? \u1794\u17be\u1782\u17d2\u1798\u17b6\u1793\u179c\u17b6 \u1782\u17ba\u17a2\u17b6\u1785\u1787\u17b6\u1780\u17b6\u179a\u179b\u17c6\u1794\u17b6\u1780\u179f\u1798\u17d2\u179a\u17b6\u1794\u17cb\u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17be\u1794\u17d2\u179a\u17b6\u179f\u17cb\u17a2\u179f\u1798\u178f\u17d2\u1790\u1797\u17b6\u1796\u1798\u17bd\u1799\u1785\u17c6\u1793\u17bd\u1793\u1780\u17d2\u1793\u17bb\u1784\u1780\u17b6\u179a\u1799\u179b\u17cb\u17a2\u178f\u17d2\u1790\u1793\u17d0\u1799 \u17ac\u1791\u17b7\u1793\u17d2\u1793\u1793\u17d0\u1799\u178a\u17c2\u179b\u1794\u1784\u17d2\u17a0\u17b6\u1789\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784\u1798\u17bd\u1799\u1793\u17c1\u17c7 \u17d4",cell_limit:"\u17a2\u17d2\u1793\u1780\u1794\u17b6\u1793\u1792\u17d2\u179c\u17be\u179b\u17be\u179f\u1785\u17c6\u1793\u17bd\u1793\u17a2\u178f\u17b7\u1794\u179a\u1798\u17b6{$cells}\u1793\u17c3\u1780\u17d2\u179a\u17a1\u17b6\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb\u00a0\u17d4",row_limit:"\u17a2\u17d2\u1793\u1780\u1794\u17b6\u1793\u1792\u17d2\u179c\u17be\u179b\u17be\u179f\u1785\u17c6\u1793\u17bd\u1793\u17a2\u178f\u17b7\u1794\u179a\u1798\u17b6{$rows}\u1793\u17c3\u1787\u17bd\u179a\u178a\u17c1\u1780\u00a0\u17d4",col_limit:"\u17a2\u17d2\u1793\u1780\u1794\u17b6\u1793\u1792\u17d2\u179c\u17be\u179b\u17be\u179f\u1785\u17c6\u1793\u17bd\u1793\u17a2\u178f\u17b7\u1794\u179a\u1798\u17b6{$cols}\u1793\u17c3\u1787\u17bd\u179a\u1788\u179a\u00a0\u17d4",colgroup:"\u1780\u17d2\u179a\u17bb\u1798\u1787\u17bd\u179a\u1788\u179a",rowgroup:"\u1780\u17d2\u179a\u17bb\u1798\u1787\u17bd\u179a\u178a\u17c1\u1780",scope:"\u179c\u17b7\u179f\u17b6\u179b\u1797\u17b6\u1796",tfoot:"\u1787\u17be\u1784\u178f\u17b6\u179a\u17b6\u1784",tbody:"\u178f\u17bd\u178f\u17b6\u179a\u17b6\u1784",thead:"\u1780\u17d2\u1794\u17b6\u179b\u178f\u17b6\u179a\u17b6\u1784",row_all:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1787\u17bd\u179a\u178a\u17c1\u1780\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784",row_even:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1787\u17bd\u179a\u178a\u17c1\u1780\u1782\u17bc\u179a\u1791\u17b6\u17c6\u1784\u17a1\u17b6\u1799\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784",row_odd:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1787\u17bd\u179a\u178a\u17c1\u1780\u179f\u17c1\u179f\u1791\u17b6\u17c6\u1784\u17a1\u17b6\u1799\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784",row_row:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1787\u17bd\u179a\u178a\u17c1\u1780\u1794\u1785\u17d2\u1785\u17bb\u1794\u17d2\u1794\u1793\u17d2\u1793",cell_all:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1780\u17d2\u179a\u17a1\u17b6\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784",cell_row:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1780\u17d2\u179a\u17a1\u17b6\u1791\u17b6\u17c6\u1784\u17a2\u179f\u17cb\u1780\u17d2\u1793\u17bb\u1784\u1787\u17bd\u179a\u178a\u17c1\u1780",cell_cell:"\u1794\u1793\u17d2\u1791\u17b6\u1793\u17cb\u179f\u1798\u17d0\u1799\u1780\u17d2\u179a\u17a1\u17b6\u1794\u1785\u17d2\u1785\u17bb\u1794\u17d2\u1794\u1793\u17d2\u1793",th:"\u1780\u17d2\u1794\u17b6\u179b\u178f\u17b6\u179a\u17b6\u1784",td:"\u1791\u17b7\u1793\u17d2\u1793\u1793\u17d0\u1799",summary:"\u179f\u1784\u17d2\u1781\u17c1\u1794",bgimage:"\u179a\u17bc\u1794\u1797\u17b6\u1796\u1795\u17d2\u1791\u17c3\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",rtl:"\u1796\u17b8\u179f\u17d2\u178f\u17b6\u17c6\u1791\u17c5\u1786\u17d2\u179c\u17c1\u1784",ltr:"\u1796\u17b8\u1786\u17d2\u179c\u17c1\u1784\u1791\u17c5\u179f\u17d2\u178a\u17b6\u17c6",mime:"\u1794\u17d2\u179a\u1797\u17c1\u1791\u1782\u17c4\u179b\u178a\u17c5 MIME",langcode:"\u1780\u17bc\u178a\u1797\u17b6\u179f\u17b6",langdir:"\u1791\u17b7\u179f\u178a\u17c5\u1797\u17b6\u179f\u17b6",style:"\u179a\u1785\u1793\u17b6\u1794\u17d0\u1791\u17d2\u1798",id:"\u179b\u179f.",merge_cells_title:"\u179a\u17c6\u179b\u17b6\u1799\u1780\u17d2\u179a\u17a1\u17b6\u178f\u17b6\u179a\u17b6\u1784\u1794\u1789\u17d2\u1785\u17bc\u179b\u1782\u17d2\u1793\u17b6",bgcolor:"\u1796\u178e\u17cc\u1795\u17d2\u1791\u17c3\u1781\u17b6\u1784\u1780\u17d2\u179a\u17c4\u1799",bordercolor:"\u1796\u178e\u17cc\u179f\u17ca\u17bb\u1798",align_bottom:"\u1794\u17b6\u178f",align_top:"\u1780\u17c6\u1796\u17bc\u179b",valign:"\u1780\u17b6\u179a\u178f\u1798\u17d2\u179a\u17b9\u1798\u1794\u1789\u17d2\u1788\u179a",cell_type:"\u1794\u17d2\u179a\u1797\u17c1\u1791\u1780\u17d2\u179a\u17a1\u17b6",cell_title:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1780\u17d2\u179a\u17a1\u17b6\u178f\u17b6\u179a\u17b6\u1784",row_title:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1787\u17bd\u179a\u178a\u17c1\u1780\u178f\u17b6\u179a\u17b6\u1784",align_middle:"\u1780\u178e\u17d2\u178a\u17b6\u179b",align_right:"\u179f\u17d2\u178a\u17b6\u17c6",align_left:"\u1786\u17d2\u179c\u17c1\u1784",align_default:"\u179b\u17c6\u1793\u17b6\u17c6\u178a\u17be\u1798",align:"\u1780\u17b6\u179a\u178f\u1798\u17d2\u179a\u17b9\u1798",border:"\u179f\u17ca\u17bb\u1798",cellpadding:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1780\u17d2\u179a\u17a1\u17b6",cellspacing:"\u1782\u1798\u17d2\u179b\u17b6\u178f\u1780\u17d2\u1793\u17bb\u1784\u1780\u17d2\u179a\u17a1\u17b6",rows:"\u1785\u17c6\u1793\u17bd\u1793\u1787\u17bd\u179a\u178a\u17c1\u1780",cols:"\u1785\u17c6\u1793\u17bd\u1793\u1787\u17bd\u179a\u1788\u179a",height:"\u1780\u1798\u17d2\u1796\u179f\u17cb",width:"\u1791\u1791\u17b9\u1784",title:"\u1794\u1789\u17d2\u1785\u17bc\u179b/\u1780\u17c2\u179f\u1798\u17d2\u179a\u17bd\u179b\u178f\u17b6\u179a\u17b6\u1784",rowtype:"\u1791\u17b8\u178f\u17b6\u17c6\u1784\u1787\u17bd\u179a\u178a\u17c1\u1780\u1780\u17d2\u1793\u17bb\u1784\u178f\u17b6\u179a\u17b6\u1784",advanced_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",general_props:"\u179b\u1780\u17d2\u1781\u178e\u17c8\u179f\u1798\u17d2\u1794\u178f\u17d2\u178f\u17b7\u1791\u17bc\u1791\u17c5",advanced_tab:"\u1780\u1798\u17d2\u179a\u17b7\u178f\u1781\u17d2\u1796\u179f\u17cb",general_tab:"\u1791\u17bc\u1791\u17c5"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ko_dlg.js b/js/tiny_mce/plugins/table/langs/ko_dlg.js new file mode 100755 index 000000000..348608a58 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ko_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ko.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"\uc88c\uc6b0\ubc94\uc704\ub9cc",rules_rhs:"\uc6b0\uce21 \ubc94\uc704\ub9cc",rules_lhs:"\uc88c\uce21 \ubc94\uc704\ub9cc",rules_hsides:"\uc0c1\ud558\ubc94\uc704\ub9cc",rules_below:"\uc544\ub798",rules_above:"\uc704",rules_void:"Void",rules:"Rules",frame_all:"\ubaa8\ub450",frame_cols:"\uc5f4",frame_rows:"\ud589",frame_groups:"\uadf8\ub8f9",frame_none:"\uc5c6\uc74c",frame:"Frame",caption:"\ud45c\uc81c",missing_scope:"\uc774 \ud45c \ud5e4\ub354\uc140\uc5d0 scope\uc18d\uc131\uc744 \uc9c0\uc815\ud558\uc9c0\uc54a\uc544\ub3c4 \uad1c\ucc2e\uc2b5\ub2c8\uae4c? \uc9c0\uc815\ud558\uc9c0 \uc54a\ub294 \uacbd\uc6b0, \uc2dc\uac04\uc801\uc73c\ub85c \ud14c\uc774\ube14\uc758 \uad6c\uc870\ub97c \ud30c\uc545\ud558\ub294 \uac83\uc774 \uc5b4\ub824\uc6b4 \ubd84\uc758 \uc811\uadfc\uc131\uc774 \uc800\ud558\ud569\ub2c8\ub2e4.",cell_limit:"\uc140\uc218\uc758 \uc0c1\ud55c{$cells}\ub97c \ub118\uc5c8\uc2b5\ub2c8\ub2e4.",row_limit:"\ud589\uc218\uc758 \uc0c1\ud55c{$rows}\ub97c \ub118\uc5c8\uc2b5\ub2c8\ub2e4.",col_limit:"\ub82c\uc218\uc758 \uc0c1\ud55c{$cols}\ub97c \ub118\uc5c8\uc2b5\ub2c8\ub2e4.",colgroup:"\uc5f4\uadf8\ub8f9",rowgroup:"\ud589\uadf8\ub8f9",scope:"Scope",tfoot:"\ud14c\uc774\ube14 \ud48b\ud130",tbody:"Table Body",thead:"Table Head",row_all:"\uc804\ud589\uc744 \uac31\uc2e0",row_even:"\uc9dd\uc218\ud589\uc744 \uac31\uc2e0",row_odd:"\ud640\uc218\ud589\uc744 \uac31\uc2e0",row_row:"\ud604\uc7ac\uc758 \ud589\uc744 \uac31\uc2e0",cell_all:"\ud14c\uc774\ube14\uc758 \ubaa8\ub4e0 \uc140\uc744 \uac31\uc2e0",cell_row:"\ud589\uc758 \uc804\uc140\uc744 \uac31\uc2e0",cell_cell:"\ud604\uc7ac\uc758 \uc140\uc744 \uac31\uc2e0",th:"Header",td:"Data",summary:"\uc694\uc57d",bgimage:"\ubc30\uacbd \uc774\ubbf8\uc9c0",rtl:"\uc624\ub978\ucabd\uc5d0\uc11c \uc67c\ucabd",ltr:"\uc67c\ucabd\uc5d0\uc11c \uc624\ub978\ucabd",mime:"Target MIME \ud0c0\uc785",langcode:"\uc5b8\uc5b4 \ucf54\ub4dc",langdir:"\ubb38\uc790 \ubc29\ud5a5",style:"\uc2a4\ud0c0\uc77c",id:"Id",merge_cells_title:"\uc140 \uacb0\ud569",bgcolor:"\ubc30\uacbd\uc0c9",bordercolor:"\ud14c\ub450\ub9ac\uc120\uc0c9",align_bottom:"\ud558",align_top:"\uc0c1",valign:"\uc218\uc9c1 \uc704\uce58",cell_type:"\uc140 \uc885\ub958",cell_title:"\uc140 \uc124\uc815",row_title:"\ud589 \uc124\uc815",align_middle:"\uac00\uc6b4\ub370 \ub9de\ucda4",align_right:"\uc624\ub978\ucabd \ub9de\ucda4",align_left:"\uc67c\ucabd \ub9de\ucda4",align_default:"\uae30\ubcf8\uac12",align:"\uc815\ub82c",border:"\ud14c\ub450\ub9ac\uc120",cellpadding:"\uc140\ub0b4 \uc5ec\ubc31",cellspacing:"\uc140 \uac04\uaca9",rows:"\ud589",cols:"\ub82c",height:"\ub192\uc774",width:"\ud3ed",title:"\ud14c\uc774\ube14\uc758 \uc0bd\uc785/\ud3b8\uc9d1",rowtype:"\ud589",advanced_props:"\uace0\uae09 \uc124\uc815",general_props:"\uc77c\ubc18 \uc124\uc815",advanced_tab:"\uace0\uae09",general_tab:"\uc77c\ubc18"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/lb_dlg.js b/js/tiny_mce/plugins/table/langs/lb_dlg.js new file mode 100755 index 000000000..cbcef1e52 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/lb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lb.table_dlg',{rules_border:"all 4 S\u00e4iten (Bord)",rules_box:"all 4 S\u00e4iten (Box)",rules_vsides:"l\u00e9nks a riets",rules_rhs:"n\u00ebmmen riets",rules_lhs:"n\u00ebmmen l\u00e9nks",rules_hsides:"uewen an \u00ebnnen",rules_below:"n\u00ebmmen \u00ebnnen",rules_above:"n\u00ebmmen uewen",rules_void:"keen",rules:"Gitter",frame_all:"zw\u00ebschen allen Zellen",frame_cols:"zw\u00ebschen Spalten",frame_rows:"zw\u00ebschen Zeilen",frame_groups:"zw\u00ebschen Gruppen",frame_none:"keng",frame:"Rumm",caption:"Beschr\u00ebftung vun der Tabelle",missing_scope:"W\u00ebllt Dir wierklech keng Bez\u00e9iung fir d\u00ebs Iwwerschr\u00ebft uginn? Benotzer mat kierperlechen Aschr\u00e4nkungen k\u00ebnne Schwieregkeeten hunn, den Inhalt vun der Tabelle ze verstoen.",cell_limit:"Dir hutt d\u00e9i maximal Zellenzuel vun {$cells} iwwerschratt.",row_limit:"Dir hutt d\u00e9i maximal Zeilenzuel vun {$rows} iwwerschratt.",col_limit:"Dir hutt d\u00e9i maximal Spaltenzuel vun {$cols} iwwerschratt.",colgroup:"Horizontal grupp\u00e9ieren",rowgroup:"Vertikal grupp\u00e9ieren",scope:"Bezuch",tfoot:"Tabellefouss",tbody:"Tabelleninhalt",thead:"Tabellekapp",row_all:"All d\'Zeilen ver\u00e4nneren",row_even:"Grued Zeilen ver\u00e4nneren",row_odd:"Ongrued Zeilen ver\u00e4nneren",row_row:"D\u00ebs Zeil ver\u00e4nneren",cell_all:"All Zellen der Tabelle ver\u00e4nneren",cell_row:"All Zellen an d\u00ebser Zeil ver\u00e4nneren",cell_cell:"D\u00ebs Zell ver\u00e4nneren",th:"Iwwerschr\u00ebft",td:"Textzell",summary:"Zesummefaassung",bgimage:"Hannergrondbild",rtl:"Riets no l\u00e9nks",ltr:"L\u00e9nks no riets",mime:"MIME-Typ vum Inhalt",langcode:"Sproochecode",langdir:"Schr\u00ebftrichtung",style:"Format",id:"ID",merge_cells_title:"Zelle vereenen",bgcolor:"Hannergrondfuerf",bordercolor:"Fuerf vun der Rumm",align_bottom:"\u00cbnnen",align_top:"Uewen",valign:"Vertikal Ausriichtung",cell_type:"Zellentyp",cell_title:"Eegeschafte vun der Zell",row_title:"Eegeschafte vun der Zeil",align_middle:"M\u00ebtteg",align_right:"Riets",align_left:"L\u00e9nks",align_default:"Standard",align:"Ausriichtung",border:"Rumm",cellpadding:"Ofstand innerhalb vun den Zellen",cellspacing:"Zellenofstand",rows:"Zeilen",cols:"Spalten",height:"H\u00e9icht",width:"Breet",title:"Tabelle af\u00fcgen/beaarbechten",rowtype:"Grupp\u00e9ierung",advanced_props:"Erweidert Astellungen",general_props:"Allgemeng Astellungen",advanced_tab:"Erweidert",general_tab:"Allgemeng"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/lt_dlg.js b/js/tiny_mce/plugins/table/langs/lt_dlg.js new file mode 100755 index 000000000..4cecfd142 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.table_dlg',{rules_border:"r\u0117melis",rules_box:"d\u0117\u017eut\u0117",rules_vsides:"vert. pus\u0117s",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hor. pus\u0117s",rules_below:"apatinis",rules_above:"vir\u0161utinis",rules_void:"negaliojantis",rules:"Taisykl\u0117s",frame_all:"visi",frame_cols:"stulpeliai",frame_rows:"eilut\u0117s",frame_groups:"grup\u0117s",frame_none:"joks",frame:"R\u0117melis",caption:"Lentel\u0117s antra\u0161t\u0117",missing_scope:"Ar norite t\u0119sti nenurod\u0119 galiojimo srities \u0161iam lentel\u0117s vir\u0161utiniam langeliui. Be nurodymo, kai kuriems naudotojams su negalia gali b\u016bti sunku suprasti lentel\u0117je atvaizduojam\u0173 duomen\u0173 turin\u012f.",cell_limit:"Vir\u0161ijote did\u017eiausi\u0105 ({$cells}) langeli\u0173 kiek\u012f.",row_limit:"Vir\u0161ijote did\u017eiausi\u0105 ({$rows}) eilu\u010di\u0173 kiek\u012f.",col_limit:"Vir\u0161ijote did\u017eiausi\u0105 ({$cols}) stulpeli\u0173 kiek\u012f.",colgroup:"Stulpeli\u0173 grup\u0117",rowgroup:"Eilu\u010di\u0173 grup\u0117",scope:"Galiojimo sritis",tfoot:"Lentel\u0117s apa\u010dia",tbody:"Lentel\u0117s vidus",thead:"Lentel\u0117s vir\u0161us",row_all:"Atnaujinti visas lentel\u0117s eilutes",row_even:"Atnaujinti lygines lentel\u0117s eilutes",row_odd:"Atnaujinti nelygines lentel\u0117s eilutes",row_row:"Atnaujinti dabartin\u0119 eilut\u0119",cell_all:"Atnaujinti visus lentel\u0117s langelius",cell_row:"Atnaujinti visus eilut\u0117s langelius",cell_cell:"Atnaujinti dabartin\u012f langel\u012f",th:"Antra\u0161t\u0117",td:"Duomenys",summary:"Apibendrinimas",bgimage:"Fono paveiksl\u0117lis",rtl:"I\u0161 de\u0161in\u0117s \u012f kair\u0119",ltr:"I\u0161 kair\u0117s \u012f de\u0161in\u0119",mime:"Paskirties MIME tipas",langcode:"Kalbos kodas",langdir:"Kalbos kryptis",style:"Stilius",id:"Id",merge_cells_title:"Sujungti lentel\u0117s langelius",bgcolor:"Fono spalva",bordercolor:"R\u0117melio spalva",align_bottom:"Apa\u010dioje",align_top:"Vir\u0161uje",valign:"Vertikalus lygiavimas",cell_type:"Langelio tipas",cell_title:"Lentel\u0117s langeli\u0173 nustatymai",row_title:"Lentel\u0117s eilut\u0117s nustatymai",align_middle:"Centruoti",align_right:"Lygiuoti de\u0161in\u0117je",align_left:"Lygiuoti kair\u0117je",align_default:"Standartinis",align:"Lygiavimas",border:"R\u0117melis",cellpadding:"Tarpas langelio viduje",cellspacing:"Tarpas tarp langeli\u0173",rows:"Eilut\u0117s",cols:"Stulpeliai",height:"Auk\u0161tis",width:"Ilgis",title:"\u012eterpti/modifikuoti lentel\u0119",rowtype:"Eilut\u0117 lentel\u0117s dalyje",advanced_props:"I\u0161pl\u0117stiniai nustatymai",general_props:"Bendri nustatymai",advanced_tab:"I\u0161pl\u0117sta",general_tab:"Bendra"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/lv_dlg.js b/js/tiny_mce/plugins/table/langs/lv_dlg.js new file mode 100755 index 000000000..7e9ff1c75 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/mk_dlg.js b/js/tiny_mce/plugins/table/langs/mk_dlg.js new file mode 100755 index 000000000..168ba3863 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/mk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mk.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Opis tablice",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).",row_limit:"Prema\u0161ili ste maksimalni broj redaka ({$rows}).",col_limit:"Prema\u0161ili ste maksimalni broj stupaca ({$cols}).",colgroup:"Grupa stupaca",rowgroup:"Grupa redaka",scope:"Domet",tfoot:"Podno\u017eje tablice",tbody:"Telo tablice",thead:"Zaglavlje tablice",row_all:"Primjeni na sve retke u tablici",row_even:"Primjeni na parne retke u tablici",row_odd:"Primjeni na neparne retke u tablici",row_row:"Primjeni na odabrani redak",cell_all:"Primjeni na sve \u0107elije u tablici",cell_row:"Primjeni na sve \u0107elije u retku",cell_cell:"Primjeni na odabranu \u0107eliju",th:"Zaglavlje",td:"Podatkovna",summary:"Sa\u017eetak",bgimage:"Slika pozadine",rtl:"S desna na levo",ltr:"S leva na desno",mime:"MIME tip",langcode:"Kod jezika",langdir:"Smjer jezika",style:"Stil",id:"Id",merge_cells_title:"Spoji \u0107elije",bgcolor:"Background color",bordercolor:"Boja obruba",align_bottom:"Dno",align_top:"Vrh",valign:"Okomito poravnavanje",cell_type:"Tip \u0107elije",cell_title:"Svojstva \u0107elije",row_title:"Svojstva retka",align_middle:"Sredina",align_right:"Desno",align_left:"Levo",align_default:"Zadano",align:"Poravnavanje",border:"Obrub",cellpadding:"Dopuna \u0107elije",cellspacing:"Razmak \u0107elija",rows:"Redaka",cols:"Stupaca",height:"Visina",width:"\u0160irina",title:"\u0412\u043c\u0435\u0442\u043d\u0438/uredi tablicu",rowtype:"Row in table part",advanced_props:"Napredna svojstva",general_props:"Osnovna svojstva",advanced_tab:"Napredno",general_tab:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ml_dlg.js b/js/tiny_mce/plugins/table/langs/ml_dlg.js new file mode 100755 index 000000000..824cd03f2 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ml_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ml.table_dlg',{rules_border:"\u0d05\u0d24\u0d3f\u0d30\u0d41\u0d4d",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u0d24\u0d3e\u0d34\u0d46",rules_above:"\u0d2e\u0d41\u0d15\u0d33\u0d3f\u0d32\u0d4d\u200d",rules_void:"void",rules:"Rules",frame_all:"\u0d0e\u0d32\u0d4d\u0d32\u0d3e\u0d02",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/mn_dlg.js b/js/tiny_mce/plugins/table/langs/mn_dlg.js new file mode 100755 index 000000000..95c3a531d --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/mn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('mn.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u0434\u043e\u043e\u0440",rules_above:"\u0434\u044d\u044d\u0440",rules_void:"void",rules:"\u0428\u0443\u0433\u0430\u043c",frame_all:"\u0431\u04af\u0445",frame_cols:"\u0411\u0430\u0433\u0430\u043d\u0430",frame_rows:"\u041c\u04e9\u0440",frame_groups:"\u0411\u04af\u043b\u044d\u0433",frame_none:"\u0431\u0430\u0439\u0445\u0433\u04af\u0439",frame:"\u0424\u0440\u044d\u0439\u043c",caption:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0442\u0430\u0439\u043b\u0431\u0430\u0440",missing_scope:"\u0422\u0430 \u044d\u043d\u044d \u0433\u0430\u0440\u0447\u0433\u0438\u0439\u043d \u0445\u0443\u0432\u044c\u0434 \u04af\u043d\u044d\u0445\u044d\u044d\u0440 \u0442\u0430\u0439\u043b\u0431\u0430\u0440 \u0445\u0438\u0439\u0445\u0433\u04af\u0439 \u0431\u0430\u0439\u0445\u044b\u0433 \u0445\u04af\u0441\u044d\u0436 \u0431\u0430\u0439\u043d\u0430 \u0443\u0443? \u0417\u0430\u0440\u0438\u043c \u0445\u04e9\u0433\u0436\u043b\u0438\u0439\u043d \u0431\u044d\u0440\u0445\u0448\u044d\u044d\u043b\u0442\u044d\u0439 \u0445\u04af\u043c\u04af\u04af\u0441 \u0445\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0430\u0433\u0443\u0443\u043b\u0433\u044b\u0433 \u043e\u0439\u043b\u0433\u043e\u0445\u043e\u0434 \u0445\u04af\u043d\u0434\u0440\u044d\u043b\u0442\u044d\u0439 \u0431\u0430\u0439\u0445 \u0431\u043e\u043b\u043d\u043e.",cell_limit:"\u041d\u04af\u0434\u043d\u0438\u0439 \u0442\u043e\u043e\u043d\u044b \u0445\u044f\u0437\u0433\u0430\u0430\u0440 {$cells}-\u0441 \u0445\u044d\u0442\u044d\u0440\u043b\u044d\u044d.",row_limit:"\u041c\u04e9\u0440\u0438\u0439\u043d \u0442\u043e\u043e\u043d\u044b \u0445\u044f\u0437\u0433\u0430\u0430\u0440 {$rows}-\u0441 \u0445\u044d\u0442\u044d\u0440\u043b\u044d\u044d.",col_limit:"\u0411\u0430\u0433\u0430\u043d\u044b\u043d \u0442\u043e\u043e\u043d\u044b \u0445\u044f\u0437\u0433\u0430\u0430\u0440 {$cols}-\u0441 \u0445\u044d\u0442\u044d\u0440\u043b\u044d\u044d.",colgroup:"\u0425\u044d\u0432\u0442\u044d\u044d \u0431\u04af\u043b\u044d\u0433\u043b\u044d\u0445",rowgroup:"\u0411\u043e\u0441\u043e\u043e \u0431\u04af\u043b\u044d\u0433\u043b\u044d\u0445",scope:"\u0423\u044f\u043b\u0434\u0430\u0430",tfoot:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0445\u04e9\u043b",tbody:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0430\u0433\u0443\u0443\u043b\u0433\u0430",thead:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0442\u043e\u043b\u0433\u043e\u0439",row_all:"\u0411\u04af\u0445 \u043c\u04e9\u0440\u0438\u0439\u043d \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",row_even:"\u0422\u044d\u0433\u0448 \u043c\u04e9\u0440\u04af\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",row_odd:"\u0421\u043e\u043d\u0434\u0433\u043e\u0439 \u043c\u04e9\u0440\u04af\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",row_row:"\u042d\u043d\u044d \u043c\u04e9\u0440\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",cell_all:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442\u0438\u0439\u043d \u0431\u04af\u0445 \u043d\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",cell_row:"\u042d\u043d\u044d \u043c\u04e9\u0440\u04e9\u043d \u0434\u04e9\u0445 \u0431\u04af\u0445 \u043d\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",cell_cell:"\u042d\u043d\u044d \u043d\u04af\u0434\u0438\u0439\u0433 \u04e9\u04e9\u0440\u0447\u043b\u04e9\u0445",th:"\u0413\u0430\u0440\u0447\u0438\u0433",td:"\u0411\u0438\u0447\u0432\u044d\u0440 \u043d\u04af\u0434",summary:"\u0414\u04af\u0433\u043d\u044d\u043b\u0442",bgimage:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440 \u0437\u0443\u0440\u0430\u0433",rtl:"\u0411\u0430\u0440\u0443\u0443\u043d\u0430\u0430\u0441 \u0437\u04af\u04af\u043d",ltr:"\u0417\u04af\u04af\u043d\u044d\u044d\u0441 \u0431\u0430\u0440\u0443\u0443\u043d",mime:"\u0410\u0433\u0443\u0443\u043b\u0433\u044b\u043d MIME-\u0442\u04e9\u0440\u04e9\u043b",langcode:"\u0425\u044d\u043b\u043d\u0438\u0439 \u043a\u043e\u0434",langdir:"\u0411\u0438\u0447\u0433\u0438\u0439\u043d \u0447\u0438\u0433\u043b\u044d\u043b",style:"\u0425\u044d\u043b\u0431\u044d\u0440\u0436\u04af\u04af\u043b\u044d\u043b\u0442",id:"\u0422\u0422",merge_cells_title:"\u041d\u04af\u0434 \u043d\u044d\u0433\u0442\u0433\u044d\u0445",bgcolor:"\u0414\u044d\u0432\u0441\u0433\u044d\u0440 \u04e9\u043d\u0433\u04e9",bordercolor:"\u0425\u04af\u0440\u044d\u044d\u043d\u0438\u0439 \u04e9\u043d\u0433\u04e9",align_bottom:"\u0414\u043e\u043e\u0440",align_top:"\u0414\u044d\u044d\u0440",valign:"\u0411\u043e\u0441\u043e\u043e \u0436\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",cell_type:"\u041d\u04af\u0434\u043d\u0438\u0439 \u0442\u04e9\u0440\u04e9\u043b",cell_title:"\u041d\u04af\u0434\u043d\u0438\u0439 \u0448\u0438\u043d\u0436",row_title:"\u041c\u04e9\u0440\u0438\u0439\u043d \u0448\u0438\u043d\u0436",align_middle:"\u0413\u043e\u043b\u0434",align_right:"\u0411\u0430\u0440\u0443\u0443\u043d",align_left:"\u0417\u04af\u04af\u043d",align_default:"\u04e8\u0433\u04e9\u0433\u0434\u043c\u04e9\u043b",align:"\u0416\u0438\u0433\u0434\u0440\u04af\u04af\u043b\u044d\u043b\u0442",border:"\u0425\u04af\u0440\u044d\u044d",cellpadding:"\u041d\u04af\u0434\u043d\u0438\u0439 \u0434\u043e\u0442\u043e\u043e\u0434 \u0430\u043b\u0441\u043b\u0430\u043b\u0442",cellspacing:"\u041d\u04af\u0434\u043d\u0438\u0439 \u0430\u043b\u0441\u043b\u0430\u043b\u0442",rows:"\u041c\u04e9\u0440",cols:"\u0411\u0430\u0433\u0430\u043d\u0430",height:"\u04e8\u043d\u0434\u04e9\u0440",width:"\u04e8\u0440\u0433\u04e9\u043d",title:"\u0425\u04af\u0441\u043d\u044d\u0433\u0442 \u043e\u0440\u0443\u0443\u043b\u0430\u0445/\u0437\u0430\u0441\u0430\u0445",rowtype:"\u041c\u04e9\u0440\u0438\u0439\u043d \u0442\u04e9\u0440\u04e9\u043b",advanced_props:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d \u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",general_props:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439 \u0442\u043e\u0445\u0438\u0440\u0433\u043e\u043e",advanced_tab:"\u04e8\u0440\u0433\u04e9\u0442\u0433\u04e9\u0441\u04e9\u043d",general_tab:"\u0415\u0440\u04e9\u043d\u0445\u0438\u0439"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ms_dlg.js b/js/tiny_mce/plugins/table/langs/ms_dlg.js new file mode 100755 index 000000000..019e26558 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ms_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ms.table_dlg',{rules_border:"sempadan",rules_box:"kotak",rules_vsides:"tepian tegak",rules_rhs:"hs-kanan",rules_lhs:"hs-kiri",rules_hsides:"tepian datar",rules_below:"bawah",rules_above:"atas",rules_void:"batal",rules:"Peraturan",frame_all:"semua",frame_cols:"kol",frame_rows:"row",frame_groups:"kumpulan",frame_none:"tiada",frame:"Bingkai",caption:"Tajuk jadual",missing_scope:"Adakah anda pasti terhadap skop sel jadual ini. Ia mungkin memberi kesan kepada OKU memahami isi jadual.",cell_limit:"Anda telah melebihi maxima sel dibenarkan iaitu {$cells}.",row_limit:"Anda telah melebihi maxima row dibenarkan iaitu {$rows}.",col_limit:"Anda telah melebihi maxima kolum dibenarkan iaitu {$cols}.",colgroup:"Kumpulan kol",rowgroup:"Kumpulan row",scope:"Skop",tfoot:"Penutup jadual Foot",tbody:"Isi jadual",thead:"Pembuka jadual",row_all:"Baharui semua row dalam jadual",row_even:"Baharui row genap dalam jadual",row_odd:"Baharui row ganjil dalam jadual",row_row:"Baharui row semasa",cell_all:"Baharui semua sel dalam jadual",cell_row:"Baharui semua sel dalam row",cell_cell:"Baharui sel ini",th:"Kepala",td:"Data",summary:"Kesimpulan",bgimage:"Imej latar",rtl:"Kanan ke kiri",ltr:"Kiri ke kanan",mime:"Sasaran jenis MIME",langcode:"Kod bahasa",langdir:"Arah bahasa",style:"Gaya",id:"Id",merge_cells_title:"Gabung sel jadual",bgcolor:"Warna latar",bordercolor:"Warna sempadan",align_bottom:"Bawah",align_top:"Atas",valign:"Penjajaran tegak",cell_type:"Jenis sel",cell_title:"Alatan sel jadual",row_title:"Alatan row jadual",align_middle:"Tengah",align_right:"Kanan",align_left:"Kiri",align_default:"Asal",align:"Penyelarian",border:"Sempadan",cellpadding:"Lapisan sel",cellspacing:"Ruang sel",rows:"Row",cols:"Kol",height:"Tinggi",width:"Lebar",title:"Masuk/Ubah jadual",rowtype:"Row dalam jadual",advanced_props:"Alatan lanjutan",general_props:"Alatan am",advanced_tab:"Lanjutan",general_tab:"Am"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/my_dlg.js b/js/tiny_mce/plugins/table/langs/my_dlg.js new file mode 100755 index 000000000..bea78df83 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/my_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('my.table_dlg',{rules_border:"\u1014\u101a\u103a\u1005\u100a\u103a\u1038",rules_box:"\u1015\u1036\u102f\u1038",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"\u1031\u1021\u102c\u1000\u103a\u1010\u103d\u1004\u103a",rules_above:"\u1021\u1011\u1000\u103a\u1010\u103d\u1004\u103a",rules_void:"void",rules:"\u1005\u100a\u103a\u1038\u1019\u103b\u1009\u103a\u1038\u1019\u103b\u102c\u1038",frame_all:"\u1021\u102c\u1038\u101c\u1036\u102f\u1038",frame_cols:"\u1031\u1000\u102c\u103a\u101c\u1036\u1019\u103b\u102c\u1038",frame_rows:"\u1021\u1010\u1014\u103a\u1038\u1019\u103b\u102c\u1038",frame_groups:"\u1021\u102f\u1015\u103a\u1005\u102f\u1019\u103b\u102c\u1038",frame_none:"\u1010\u1005\u103a\u1001\u102f\u1019\u103b\u103e\u1019\u101f\u102f\u1010\u103a",frame:"\u1016\u101b\u102d\u1019\u103a",caption:"\u1007\u101a\u102c\u1038\u1000\u103d\u1000\u103a \u1031\u1001\u102b\u1004\u103a\u1038\u1005\u1009\u103a",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You",row_limit:"You",col_limit:"You",colgroup:"\u1031\u1000\u102c\u103a\u101c\u1036 \u1021\u102f\u1015\u103a\u1005\u102f",rowgroup:"\u1021\u1010\u1014\u103a\u1038 \u1021\u102f\u1015\u103a\u1005\u102f",scope:"Scope",tfoot:"\u1007\u101a\u102c\u1038 \u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001",tbody:"\u1007\u101a\u102c\u1038 \u1000\u102d\u102f\u101a\u103a\u1011\u100a\u103a",thead:"\u1007\u101a\u102c\u1038 \u1014\u1016\u1030\u1038\u1005\u100a\u103a\u1038",row_all:"\u1007\u101a\u102c\u1038\u1011\u1032\u1019\u103e \u1021\u1010\u1014\u103a\u1038\u1021\u102c\u1038\u101c\u1036\u102f\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",row_even:"\u1007\u101a\u102c\u1038\u1011\u1032\u1019\u103e \u1005\u1036\u102f \u1021\u1010\u1014\u103a\u1038\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",row_odd:"\u1007\u101a\u102c\u1038\u1011\u1032\u1019\u103e \u1019 \u1021\u1010\u1014\u103a\u1038\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",row_row:"\u101c\u1000\u103a\u101b\u103e\u102d \u1021\u1010\u1014\u103a\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",cell_all:"\u1007\u101a\u102c\u1038\u1011\u1032\u1019\u103e \u1021\u1000\u103d\u1000\u103a\u1021\u102c\u1038\u101c\u1036\u102f\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",cell_row:"\u1021\u1010\u1014\u103a\u1038\u1011\u1032\u1019\u103e \u1021\u1000\u103d\u1000\u103a\u1021\u102c\u1038\u101c\u1036\u102f\u1038\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",cell_cell:"\u101c\u1000\u103a\u101b\u103e\u102d \u1021\u1000\u103d\u1000\u103a\u1000\u102d\u102f \u1021\u101e\u1005\u103a\u103c\u1016\u100a\u103a\u1037\u1005\u103d\u1000\u103a\u1015\u102b",th:"\u1031\u1001\u102b\u1004\u103a\u1038\u1005\u102e\u1038\u1015\u102d\u102f\u1004\u103a\u1038",td:"\u1021\u1001\u103b\u1000\u103a\u1021\u101c\u1000\u103a",summary:"\u1021\u1014\u103e\u1005\u103a\u1001\u103b\u102f\u1015\u103a",bgimage:"\u1031\u1014\u102c\u1000\u103a\u1001\u1036 \u101b\u102f\u1015\u103a\u1015\u1036\u102f",rtl:"\u100a\u102c\u1019\u103e \u1018\u101a\u103a",ltr:"\u1018\u101a\u103a\u1019\u103e \u100a\u102c",mime:"Target MIME type",langcode:"\u1018\u102c\u101e\u102c\u1005\u1000\u102c\u1038 \u1000\u102f\u1010\u103a",langdir:"\u1005\u102c\u1031\u101b\u1038\u101e\u102c\u1038\u1019\u103e\u102f \u1025\u102e\u1038\u1010\u100a\u103a\u1001\u103b\u1000\u103a",style:"\u1005\u1010\u102d\u102f\u1004\u103a",id:"ID",merge_cells_title:"\u1007\u101a\u102c\u1038\u1000\u103d\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1031\u1015\u102b\u1004\u103a\u1038\u1015\u102b",bgcolor:"\u1031\u1014\u102c\u1000\u103a\u1001\u1036 \u1021\u1031\u101b\u102c\u1004\u103a",bordercolor:"\u1014\u101a\u103a\u1005\u100a\u103a\u1038 \u1021\u1031\u101b\u102c\u1004\u103a",align_bottom:"\u1031\u1021\u102c\u1000\u103a\u1031\u103c\u1001",align_top:"\u1011\u102d\u1015\u103a",valign:"\u1031\u1012\u102b\u1004\u103a\u101c\u102d\u102f\u1000\u103a \u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1019\u103e\u102f",cell_type:"\u1021\u1000\u103d\u1000\u103a \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038",cell_title:"\u1007\u101a\u102c\u1038\u1000\u103d\u1000\u103a \u101d\u102d\u1031\u101e\u101e \u101c\u1000\u1039\u1001\u100f\u102c\u1019\u103b\u102c\u1038",row_title:"\u1007\u101a\u102c\u1038 \u1021\u1010\u1014\u103a\u1038 \u101d\u102d\u1031\u101e\u101e \u101c\u1000\u1039\u1001\u100f\u102c\u1019\u103b\u102c\u1038",align_middle:"\u1017\u101f\u102d\u102f",align_right:"\u100a\u102c",align_left:"\u1018\u101a\u103a",align_default:"\u1019\u1030\u101c",align:"\u1001\u103b\u102d\u1014\u103a\u100a\u102d\u103e\u1019\u103e\u102f",border:"\u1014\u101a\u103a\u1005\u1015\u103a\u1005\u100a\u103a\u1038",cellpadding:"\u1000\u103d\u1000\u103a\u1031\u1018\u1038\u1031\u1014\u101b\u102c\u101c\u103d\u1010\u103a",cellspacing:"\u1000\u103d\u1000\u103a\u103c\u1000\u102c\u1038\u101c\u1015\u103a",rows:"\u1021\u1010\u1014\u103a\u1038",cols:"\u1031\u1000\u102c\u103a\u101c\u1036",height:"\u1021\u103c\u1019\u1004\u103a\u1037",width:"\u1021\u1000\u103b\u101a\u103a",title:"\u1007\u101a\u102c\u1038 \u1011\u100a\u103a\u1037/\u103c\u1015\u102f\u103c\u1015\u1004\u103a",rowtype:"\u1021\u1010\u1014\u103a\u1038\u101b\u103e\u102d\u1019\u100a\u103a\u1037 \u1007\u101a\u102c\u1038 \u1021\u1015\u102d\u102f\u1004\u103a\u1038",advanced_props:"\u1021\u1011\u1030\u1038 \u101d\u102d\u1031\u101e\u101e\u101c\u1000\u1039\u1001\u100f\u102c\u1019\u103b\u102c\u1038",general_props:"\u1021\u1031\u1011\u103d\u1031\u1011\u103d \u101d\u102d\u1031\u101e\u101e\u101c\u1000\u1039\u1001\u100f\u102c\u1019\u103b\u102c\u1038",advanced_tab:"\u1021\u1011\u1030\u1038",general_tab:"\u1021\u1031\u1011\u103d\u1031\u1011\u103d"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/nb_dlg.js b/js/tiny_mce/plugins/table/langs/nb_dlg.js new file mode 100755 index 000000000..f8a9ea849 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/nb_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nb.table_dlg',{"rules_border":"ramme","rules_box":"boks","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsider","rules_below":"under","rules_above":"over","rules_void":"ingen",rules:"Streker","frame_all":"alle","frame_cols":"kolonner","frame_rows":"rader","frame_groups":"grupper","frame_none":"ingen",frame:"Ramme",caption:"Tabelloverskrift","missing_scope":"Er du sikker p\u00e5 at du vil fortsette uten \u00e5 angi et omr\u00e5de for denne overskrifscellen? Uten dette kan det bli vanskelig for enkelte funksjonshemmede brukere \u00e5 forst\u00e5 innholdet eller dataene som blir presentert i tabellen.","cell_limit":"Du har overskredet maksimalt antall celler p\u00e5 {$cells}.","row_limit":"Du har overskredet maksimalt antall rader p\u00e5 {$rows}.","col_limit":"Du har overskredet maksimalt antall kolonner p\u00e5 {$cols}.",colgroup:"Kolonnegruppe",rowgroup:"Radgruppe",scope:"Omr\u00e5de",tfoot:"Tabellfot",tbody:"Tabellkropp",thead:"Tabellhode","row_all":"Oppdater alle rader","row_even":"Oppdater partallsrader","row_odd":"Oppdater oddetallsrader","row_row":"Oppdater aktuell rad","cell_all":"Oppdater alle celler i tabellen","cell_row":"Oppdater alle celler i raden","cell_cell":"Oppdater aktuell celle",th:"Overskrift",td:"Data",summary:"Sammendrag",bgimage:"Bakgrunnsbilde",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",mime:"M\u00e5lets MIME-type",langcode:"Spr\u00e5kkode",langdir:"Skriftretning",style:"Stil",id:"Id","merge_cells_title":"Sl\u00e5 sammen celler",bgcolor:"Bakgrunn",bordercolor:"Rammefarge","align_bottom":"Bunn","align_top":"Topp",valign:"Vertikal justering","cell_type":"Celletype","cell_title":"Celleegenskaper","row_title":"Radegenskaper","align_middle":"Midtstilt","align_right":"H\u00f8yre","align_left":"Venstre","align_default":"Standard",align:"Justering",border:"Ramme",cellpadding:"Cellefylling",cellspacing:"Celleavstand",rows:"Rader",cols:"Kolonner",height:"H\u00f8yde",width:"Bredde",title:"Sett inn / rediger tabell",rowtype:"Rad i tabell","advanced_props":"Generelle egenskaper","general_props":"Generelt","advanced_tab":"Avansert","general_tab":"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/nl_dlg.js b/js/tiny_mce/plugins/table/langs/nl_dlg.js new file mode 100755 index 000000000..fa7f2225f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.table_dlg',{"rules_border":"Rand","rules_box":"Box","rules_vsides":"Verticale zijden","rules_rhs":"Rechterzijkant","rules_lhs":"Linkerzijkant","rules_hsides":"Horizontale zijden","rules_below":"Onder","rules_above":"Boven","rules_void":"Geen",rules:"Hulplijnen","frame_all":"Alles","frame_cols":"Kolommen","frame_rows":"Rijen","frame_groups":"Groepen","frame_none":"Geen",frame:"Frame",caption:"Tabelbeschrijving","missing_scope":"Weet u zeker dat u door wilt gaan met het toewijzen van een kop zonder een bereik op te geven? Mensen met een visuele handicap kunnen hierdoor waarschijnlijk slecht bij de gegevens.","cell_limit":"U heeft het maximale aantal cellen van {$cells} overschreden.","row_limit":"U heeft hebt het maximale aantal rijen van {$rows} overschreden.","col_limit":"U heeft het maximale aantal kolommen van {$cols} overschreden.",colgroup:"Kolomgroep",rowgroup:"Rijgroep",scope:"Bereik",tfoot:"Tabelvoet",tbody:"Tabellichaam",thead:"Tabelkop","row_all":"Alle rijen bijwerken","row_even":"Even rijen bijwerken","row_odd":"Oneven rijen bijwerken","row_row":"Huidige rij bijwerken","cell_all":"Alle cellen in tabel bijwerken","cell_row":"Alle cellen in rij bijwerken","cell_cell":"Huidige cel bijwerken",th:"Kop",td:"Gegevens",summary:"Samenvatting",bgimage:"Achtergrondafbeelding",rtl:"Van rechts naar links",ltr:"Van links naar rechts",mime:"Doel MIME type",langcode:"Taalcode",langdir:"Taalrichting",style:"Stijl",id:"Id","merge_cells_title":"Cellen samenvoegen",bgcolor:"Achtergrondkleur",bordercolor:"Randkleur","align_bottom":"Onder","align_top":"Boven",valign:"Verticale uitlijning","cell_type":"Celtype","cell_title":"Celeigenschappen","row_title":"Rij-eigenschappen","align_middle":"Centreren","align_right":"Rechts","align_left":"Links","align_default":"Standaard",align:"Uitlijning",border:"Rand",cellpadding:"Ruimte in cel",cellspacing:"Ruimte om cel",rows:"Rijen",cols:"Kolommen",height:"Hoogte",width:"Breedte",title:"Tabel invoegen/bewerken",rowtype:"Rijtype","advanced_props":"Geavanceerde eigenschappen","general_props":"Algemene eigenschappen","advanced_tab":"Geavanceerd","general_tab":"Algemeen"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/nn_dlg.js b/js/tiny_mce/plugins/table/langs/nn_dlg.js new file mode 100755 index 000000000..5e145db2f --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/nn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nn.table_dlg',{rules_border:"ramme",rules_box:"boks",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"under",rules_above:"over",rules_void:"ingen",rules:"Strekar",frame_all:"alle",frame_cols:"kolonnar",frame_rows:"rader",frame_groups:"grupper",frame_none:"ingen",frame:"Ramme",caption:"Tabelloverskrift",missing_scope:"Er du sikker p\u00e5 at du vil fortsetje utan \u00e5 angi eit omr\u00e5de for denne overskrifscella? Utan dette kan det bli vanskeleg for enkelte funksjonshemma brukarar \u00e5 forst\u00e5 innhaldet eller dataane som blir presenterte i tabellen.",cell_limit:"Du har fleire enn maksimalt tal celler p\u00e5 {$cells}.",row_limit:"Du har fleire enn maksimalt tal rader p\u00e5 {$rows}.",col_limit:"Du har fleire enn maksimalt tal kolonner p\u00e5 {$cols}.",colgroup:"Kolonnegruppe",rowgroup:"Radgruppe",scope:"Omr\u00e5de",tfoot:"Tabellfot",tbody:"Tabellkropp",thead:"Tabellhovud",row_all:"Oppdater alle rader",row_even:"Oppdater partallrader",row_odd:"Oppdater oddetallrader",row_row:"Oppdater aktuell rad",cell_all:"Oppdater alle celler i tabellen",cell_row:"Oppdater alle celler i rada",cell_cell:"Oppdater aktuell celle",th:"Overskrift",td:"Data",summary:"Samandrag",bgimage:"Bakgrunnsbilete",rtl:"H\u00f8gre mot venstre",ltr:"Venstre mot h\u00f8gre",mime:"M\u00e5let sin MIME-type",langcode:"Spr\u00e5kkode",langdir:"Skriftretning",style:"Stil",id:"Id",merge_cells_title:"Sl\u00e5 saman celler",bgcolor:"Bakgrunn",bordercolor:"Rammefarge",align_bottom:"Botn",align_top:"Topp",valign:"Vertikal justering",cell_type:"Celletype",cell_title:"Celleeigenskapar",row_title:"Radeigenskapar",align_middle:"Midtstilt",align_right:"H\u00f8gre",align_left:"Venstre",align_default:"Standard",align:"Justering",border:"Ramme",cellpadding:"Cellefylling",cellspacing:"Celleavstand",rows:"Rader",cols:"Kolonner",height:"H\u00f8gd",width:"Breidd",title:"Set inn / rediger tabell",rowtype:"Rad i tabell",advanced_props:"Generelle eigenskapar",general_props:"Generelt",advanced_tab:"Avansert",general_tab:"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/no_dlg.js b/js/tiny_mce/plugins/table/langs/no_dlg.js new file mode 100755 index 000000000..ec7c0af45 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.table_dlg',{"rules_border":"ramme","rules_box":"boks","rules_vsides":"vside","rules_rhs":"hs","rules_lhs":"vs","rules_hsides":"hside","rules_below":"under","rules_above":"over","rules_void":"tom",rules:"Streker","frame_all":"alle","frame_cols":"kolonner","frame_rows":"rader","frame_groups":"grupper","frame_none":"ingen",frame:"Ramme",caption:"Tabell tittel","missing_scope":"Er du sikker du vil fortsette uten \u00e5 angi tittel for denne overskrifscellen? Uten denne kan det bli vanskelig for enkelte funksjonshemmede brukere \u00e5 forst\u00e5 innhold eller data som presenteres i tabellen.","cell_limit":"Du har overg\u00e5tt maksimalt antall tillatt celler p\u00e5 {$cells}.","row_limit":"Du har overg\u00e5tt maksimalt antall tillatte rader p\u00e5 {$rows}.","col_limit":"Du har overg\u00e5tt maksimalt antall tillatte kolonner p\u00e5 {$cols}.",colgroup:"Kolonne gruppe",rowgroup:"Rad gruppe",scope:"Tittel",tfoot:"Tabell foot",tbody:"Tabell body",thead:"Tabell head","row_all":"Oppdater alle rader","row_even":"Oppdater rader med partall","row_odd":"Oppdater rader med oddetall","row_row":"Oppdater aktuell rad","cell_all":"Oppdater alle celler i tabellen","cell_row":"Oppdater alle celler i raden","cell_cell":"Oppdater aktuell celle",th:"Overskrift",td:"Data",summary:"Sammendrag",bgimage:"Bakgrunnsbilde",rtl:"H\u00f8yre mot venstre",ltr:"Venstre mot h\u00f8yre",mime:"M\u00e5lets MIME-type",langcode:"Spr\u00e5k kode",langdir:"Skriftretning",style:"Stil",id:"Id","merge_cells_title":"Sl\u00e5 sammen celler",bgcolor:"Bakgrunnsfarge",bordercolor:"Rammefarge","align_bottom":"Bunn","align_top":"Topp",valign:"Vertikal justering","cell_type":"Celle type","cell_title":"Celle egenskaper","row_title":"Rad egenskaper","align_middle":"Midtstilt","align_right":"H\u00f8yre","align_left":"Venstre","align_default":"Standard",align:"Justering",border:"Ramme",cellpadding:"Cellefylling",cellspacing:"Celleavstand",rows:"Rader",cols:"Kolonner",height:"H\u00f8yde",width:"Bredde",title:"Sett inn/editer tabell",rowtype:"Rad i tabell","advanced_props":"Avanserte egenskaper","general_props":"Generelle egenskaper","advanced_tab":"Avansert","general_tab":"Generelt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/pl_dlg.js b/js/tiny_mce/plugins/table/langs/pl_dlg.js new file mode 100755 index 000000000..7e78c474d --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"pod","rules_above":"nad","rules_void":"void",rules:"Prowadnice","frame_all":"wszystkie","frame_cols":"kolumny","frame_rows":"wiersze","frame_groups":"grupy","frame_none":"brak",frame:"Ramka",caption:"Nag\u0142\u00f3wek tabeli","missing_scope":"Jeste\u015b pewny \u017ce chcesz kontynuowa\u0107 bez definiowania zasi\u0119gu dla kom\u00f3rki tabeli. Bez niej, mo\u017ce by\u0107 trudne dla niekt\u00f3rych u\u017cytkownik\u00f3w zrozuminie zawarto\u015bci albo danych wy\u015bwietlanych poza tabel\u0105.","cell_limit":"Przekroczy\u0142e\u015b maksymaln\u0105 liczb\u0119 kom\u00f3rek kt\u00f3ra wynosi {$cells}.","row_limit":"Przekroczy\u0142e\u015b maksymaln\u0105 liczb\u0119 wierszy kt\u00f3ra wynosi {$rows}.","col_limit":"Przekroczy\u0142e\u015b maksymaln\u0105 liczb\u0119 kolumn kt\u00f3ra wynosi {$cols}.",colgroup:"Grupa kolumn",rowgroup:"Grupa wierszy",scope:"Zakres",tfoot:"Stopka tabeli",tbody:"Cia\u0142o tabeli",thead:"Nag\u0142\u00f3wek tabeli","row_all":"Zmie\u0144 wszystkie wiersze","row_even":"Zmie\u0144 parzyste wiersze","row_odd":"Zmie\u0144 nieparzyste wiersze","row_row":"Zmie\u0144 aktualny wiersz","cell_all":"Zmie\u0144 wszytkie kom\u00f3rki w tabeli","cell_row":"Zmie\u0144 wszytkie kom\u00f3rki w wierszu","cell_cell":"Zmie\u0144 aktualn\u0105 kom\u00f3rk\u0119",th:"Nag\u0142owek",td:"Dane",summary:"Podsumowanie",bgimage:"Obrazek t\u0142a",rtl:"Kierunek z prawej do lewej",ltr:"Kierunek z lewej do prawej",mime:"Docelowy typ MIME",langcode:"Kod j\u0119zyka",langdir:"Kierunek czytania tekstu",style:"Styl",id:"Id","merge_cells_title":"Po\u0142\u0105cz kom\u00f3rki",bgcolor:"Kolor t\u0142a",bordercolor:"Kolor ramki","align_bottom":"D\u00f3\u0142","align_top":"G\u00f3ra",valign:"Pionowe wyr\u00f3wnanie","cell_type":"Typ kom\u00f3rki","cell_title":"W\u0142a\u015bciwo\u015bci kom\u00f3rki","row_title":"W\u0142a\u015bciwo\u015bci wiersza","align_middle":"\u015arodek","align_right":"Prawy","align_left":"Lewy","align_default":"Domy\u015blnie",align:"Wyr\u00f3wnanie",border:"Ramka",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Wiersze",cols:"Kolumny",height:"Wysoko\u015b\u0107",width:"Szeroko\u015b\u0107",title:"Wklej/Zmie\u0144 tabel\u0119",rowtype:"Wiersz w cz\u0119\u015bci tabeli","advanced_props":"Zaawansowane w\u0142a\u015bciwo\u015bci","general_props":"G\u0142\u00f3wne w\u0142a\u015bciwo\u015bci","advanced_tab":"Zaawansowane","general_tab":"G\u0142\u00f3wne"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ps_dlg.js b/js/tiny_mce/plugins/table/langs/ps_dlg.js new file mode 100755 index 000000000..686211c8b --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ps_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ps.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/pt_dlg.js b/js/tiny_mce/plugins/table/langs/pt_dlg.js new file mode 100755 index 000000000..7534c5cd9 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.table_dlg',{rules_border:"Limites",rules_box:"Box",rules_vsides:"Vsides",rules_rhs:"Rhs",rules_lhs:"Lhs",rules_hsides:"Hsides",rules_below:"abaixo",rules_above:"acima",rules_void:"void",rules:"Regras",frame_all:"Todos",frame_cols:"colunas",frame_rows:"Linhas",frame_groups:"Grupos",frame_none:"Nenhum",frame:"Frame",caption:"T\u00edtulo da tabela",missing_scope:"Tem certeza de que quer continuar sem especificar um escopo para esta c\u00e9lula? (Isso poder\u00e1 causar dificuldades a usu\u00e1rios deficientes)",cell_limit:"Excedeu o n\u00famero m\u00e1ximo de c\u00e9lulas de {$cells}.",row_limit:"Excedeu o n\u00famero m\u00e1ximo de linhas de {$rows}.",col_limit:"Excedeu o n\u00famero m\u00e1ximo de colunas de {$cols}.",colgroup:"Grupo colunas",rowgroup:"Grupo linhas",scope:"Alcance",tfoot:"Rodap\u00e9 da tabela",tbody:"Corpo da tabela",thead:"Topo da tabela",row_all:"Atualizar todas as linhas",row_even:"Atualizar linhas pares",row_odd:"Atualizar linhas \u00edmpares",row_row:"Atualizar esta linha",cell_all:"Atualizar todas as c\u00e9lulas na tabela",cell_row:"Atualizar todas as c\u00e9lulas na linha",cell_cell:"Atualizar esta c\u00e9lula",th:"Campo",td:"Dados",summary:"Sum\u00e1rio",bgimage:"Imagem de fundo",rtl:"Da direita para a esquerda",ltr:"Da esquerda para a direita",mime:"MIME alvo",langcode:"C\u00f3digo do idioma",langdir:"Dire\u00e7\u00e3o do texto",style:"Estilo",id:"Id",merge_cells_title:"Unir c\u00e9lulas",bgcolor:"Cor de fundo",bordercolor:"Cor dos limites",align_bottom:"Abaixo",align_top:"Topo",valign:"Alinha. vert.",cell_type:"Tipo c\u00e9l.",cell_title:"Propriedades de c\u00e9lulas",row_title:"Propriedades de linhas",align_middle:"Centro",align_right:"Direita",align_left:"Esquerda",align_default:"Padr\u00e3o",align:"Alinha.",border:"Limites",cellpadding:"Enchimento da C\u00e9lula",cellspacing:"Espa\u00e7amento da C\u00e9lula",rows:"Linhas",cols:"Colunas",height:"Altura",width:"Largura",title:"Inserir/modificar tabela",rowtype:"Linha na parte da tabela",advanced_props:"Propriedades avan\u00e7adas",general_props:"Propriedades gerais",advanced_tab:"Avan\u00e7ado",general_tab:"Geral"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ro_dlg.js b/js/tiny_mce/plugins/table/langs/ro_dlg.js new file mode 100755 index 000000000..5e4a11880 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"dedesubt",rules_above:"deasupra",rules_void:"gol",rules:"Reguli",frame_all:"toate",frame_cols:"coloane",frame_rows:"r\u00e2nduri",frame_groups:"grupuri",frame_none:"niciuna",frame:"Frame",caption:"Titlu tabel",missing_scope:"Sigur dori\u0163i s\u0103 l\u0103sa\u0163i scopul necompletat? ",cell_limit:"A\u0163i dep\u0103\u015fit num\u0103rul maxim de celule: {$cells}.",row_limit:"A\u0163i dep\u0103\u015fit num\u0103rul maxim de r\u00e2nduri: {$rows}.",col_limit:"A\u0163i dep\u0103\u015fit num\u0103rul maxim de coloane: {$cols}.",colgroup:"Grupeaz\u0103 celule",rowgroup:"Grupeaz\u0103 r\u00e2nduri",scope:"Scop",tfoot:"Subsol tabel",tbody:"Corp tabel",thead:"Antet tabel",row_all:"Actualizeaz\u0103 toate r\u00e2ndurile",row_even:"Actualizeaz\u0103 r\u00e2ndurile pare",row_odd:"Actualizeaz\u0103 r\u00e2ndurile impare",row_row:"Actualizeaz\u0103 r\u00e2nd curent",cell_all:"Actualizeaz\u0103 toate celulele din tabel",cell_row:"Actualizeaz\u0103 toate celulele din r\u00e2nd",cell_cell:"Actualizeaz\u0103 celula curent\u0103",th:"Antet",td:"Date",summary:"Sumar",bgimage:"Imagine de fundal",rtl:"De la dreapta la st\u00e2nga",ltr:"De la st\u00e2nga la dreapta",mime:"MIME type \u0163int\u0103",langcode:"Cod limb\u0103",langdir:"Direc\u0163ie limb\u0103",style:"Stil",id:"Id",merge_cells_title:"Uni\u0163i celulele",bgcolor:"Culoare fundal",bordercolor:"Culoare bordur\u0103",align_bottom:"Jos",align_top:"Sus",valign:"Aliniere vertical\u0103",cell_type:"Tip celul\u0103",cell_title:"Propriet\u0103\u0163i celul\u0103",row_title:"Propriet\u0103\u0163i r\u00e2nd",align_middle:"Centru",align_right:"Dreapta",align_left:"St\u00e2nga",align_default:"Implicit\u0103",align:"Aliniere",border:"Bordur\u0103",cellpadding:"Spa\u0163iu \u00een celule",cellspacing:"Spa\u0163iu \u00eentre celule",rows:"R\u00e2nduri",cols:"Coloane",height:"\u00cen\u0103l\u0163ime",width:"L\u0103\u0163ime",title:"Inserare/modificare tabel",rowtype:"R\u0103nd \u00een tabel",advanced_props:"Propriet\u0103\u0163i avansate",general_props:"Propriet\u0103\u0163i generale",advanced_tab:"Avansat",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ru_dlg.js b/js/tiny_mce/plugins/table/langs/ru_dlg.js new file mode 100755 index 000000000..0721ef80c --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"\u041f\u0440\u0430\u0432\u0438\u043b\u0430","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"\u041a\u0430\u0434\u0440",caption:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a","missing_scope":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0431\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0437\u0430\u0433\u043b\u043e\u043b\u0432\u043a\u0430? \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c.","cell_limit":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0432\u0439 \u043f\u0440\u0435\u0434\u0435\u043b, \u0432 $ \u044f\u0447\u0435\u0435\u043a.","row_limit":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0432\u0439 \u043f\u0440\u0435\u0434\u0435\u043b, \u0432 $ \u0441\u0442\u0440\u043e\u043a.","col_limit":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0432\u0439 \u043f\u0440\u0435\u0434\u0435\u043b, \u0432 $ \u043a\u043e\u043b\u043e\u043d\u043e\u043a.",colgroup:"\u0413\u0440\u0443\u043f\u043f\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432",rowgroup:"\u0413\u0440\u0443\u043f\u043f\u0430 \u0441\u0442\u0440\u043e\u043a",scope:"\u041e\u0431\u043b\u0430\u0441\u0442\u044c",tfoot:"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435",tbody:"\u0422\u0435\u043b\u043e",thead:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a","row_all":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435","row_even":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435","row_odd":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435","row_row":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443","cell_all":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435","cell_row":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435","cell_cell":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443",th:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",td:"\u0414\u0430\u043d\u043d\u044b\u0435",summary:"\u041e\u0431\u0449\u0435\u0435",bgimage:"\u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e",ltr:"\u0421\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e",mime:"MIME \u0442\u0438\u043f \u0446\u0435\u043b\u0438",langcode:"\u041a\u043e\u0434 \u044f\u0437\u044b\u043a\u0430",langdir:"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430",style:"\u0421\u0442\u0438\u043b\u044c",id:"\u0418\u043c\u044f","merge_cells_title":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438",bgcolor:"\u0426\u0432\u0435\u0442 \u0437\u0430\u043b\u0438\u0432\u043a\u0438",bordercolor:"\u0426\u0432\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b","align_bottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","align_top":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e",valign:"\u0412\u0435\u0440\u0442. \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435","cell_type":"\u0422\u0438\u043f","cell_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044f\u0447\u0435\u0439\u043a\u0438","row_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0442\u0440\u043e\u043a\u0438","align_middle":"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443","align_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","align_default":"\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",align:"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435",border:"\u0413\u0440\u0430\u043d\u0438\u0446\u0430",cellpadding:"\u041e\u0442\u0441\u0442\u0443\u043f\u044b \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445",cellspacing:"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438",rows:"\u0421\u0442\u0440\u043e\u043a\u0438",cols:"\u0421\u0442\u043e\u043b\u0431\u0446\u044b",height:"\u0412\u044b\u0441\u043e\u0442\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",title:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b",rowtype:"\u0422\u0438\u043f \u0441\u0442\u0440\u043e\u043a\u0438","advanced_props":"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b","general_props":"\u041e\u0431\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b","advanced_tab":"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e","general_tab":"\u041e\u0431\u0449\u0435\u0435"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sc_dlg.js b/js/tiny_mce/plugins/table/langs/sc_dlg.js new file mode 100755 index 000000000..863e499f0 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sc_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sc.table_dlg',{rules_border:"\u5916\u6846",rules_box:"\u76d2\u578b",rules_vsides:"\u5782\u76f4\u8fb9",rules_rhs:"\u53f3\u8fb9",rules_lhs:"\u5de6\u8fb9",rules_hsides:"\u6c34\u51c6\u8fb9",rules_below:"\u4e0b",rules_above:"\u4e0a",rules_void:"\u7a7a",rules:"\u7ebf\u6761",frame_all:"\u5168\u90e8",frame_cols:"\u5217",frame_rows:"\u884c",frame_groups:"\u7fa4\u7ec4",frame_none:"\u65e0",frame:"\u8fb9\u6846",caption:"\u8868\u683c\u6807\u9898",missing_scope:"\u6807\u9898\u884c\u7f3a\u5931\uff01 ",cell_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u5355\u683c\u6570\u4e3a{$cells}\u683c\u3002 ",row_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u884c\u6570\u4e3a{$rows}\u884c\u3002 ",col_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u5217\u6570\u4e3a{$cols}\u5217\u3002 ",colgroup:"\u5217\u7fa4\u7ec4",rowgroup:"\u884c\u7fa4\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u8eab",thead:"\u8868\u5934",row_all:"\u66f4\u65b0\u8868\u683c\u5185\u5168\u90e8\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5076\u6570\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5947\u6570\u884c",row_row:"\u66f4\u65b0\u6240\u5728\u884c",cell_all:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5168\u90e8\u5355\u683c",cell_row:"\u66f4\u65b0\u6240\u5728\u884c\u7684\u5168\u90e8\u5355\u683c",cell_cell:"\u66f4\u65b0\u6240\u7684\u5355\u683c",th:"\u8868\u5934",td:"\u6570\u636e",summary:"\u6982\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",mime:"\u76ee\u6807MIME\u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"Id",merge_cells_title:"\u5408\u5e76\u5355\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272",align_bottom:"\u4e0b\u65b9",align_top:"\u4e0a\u65b9",valign:"\u6c34\u51c6\u5bf9\u9f50\u65b9\u5f0f",cell_type:"\u5355\u683c\u522b",cell_title:"\u5355\u683c\u5c5e\u6027",row_title:"\u884c\u5c5e\u6027",align_middle:"\u5c45\u4e2d",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_default:"\u9884\u8bbe",align:"\u5bf9\u9f50\u65b9\u5f0f",border:"\u8fb9\u6846",cellpadding:"\u5355\u683c\u7559\u767d",cellspacing:"\u5355\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u5217\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",general_tab:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/se_dlg.js b/js/tiny_mce/plugins/table/langs/se_dlg.js new file mode 100755 index 000000000..de5c4b7e6 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/se_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('se.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Regler",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Ram",caption:"\u00d6verskrift",missing_scope:"\u00c4r du s\u00e4ker p\u00e5 att du vill forts\u00e4tta utan att ange en omfattning, denna underl\u00e4ttar f\u00f6r icke-grafiska webbl\u00e4sare.",cell_limit:"Du kan inte skapa en tabell med fler \u00e4n {$cells} celler.",row_limit:"Du kan inte ange fler \u00e4n {$rows} rader.",col_limit:"Du kan inte ange fler \u00e4n {$cols} kolumner.",colgroup:"Kolumngrupp",rowgroup:"Radgrupp",scope:"Omfattning",tfoot:"tabellfot",tbody:"tabellkropp",thead:"tabellhuvud",row_all:"Uppdatera alla rader i tabellen",row_even:"Uppdatera j\u00e4mna rader i tabellen",row_odd:"Uppdatera udda rader i tabellen",row_row:"Uppdatera nuvarande rad",cell_all:"Uppdatera alla celler i tabellen",cell_row:"Uppdatera alla celler i raden",cell_cell:"Uppdatera nuvarande cell",th:"Huvud",td:"Data",summary:"Sammanfattning",bgimage:"Bakgrundsbild",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",langcode:"Spr\u00e5kkod",langdir:"Skriftriktning",style:"Stil",id:"Id",merge_cells_title:"Sammanfoga celler",bgcolor:"Bakgrundsf\u00e4rg",bordercolor:"Ramf\u00e4rg",align_bottom:"Botten",align_top:"Toppen",valign:"Vertikal justering",cell_type:"Celltyp",cell_title:"Tabellcellsinst\u00e4llningar",row_title:"Tabellradsinst\u00e4llningar",align_middle:"Mitten",align_right:"H\u00f6ger",align_left:"V\u00e4nster",align_default:"Ingen",align:"Justering",border:"Ram",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rader",cols:"Kolumner",height:"H\u00f6jd",width:"Bredd",title:"Infoga/redigera ny tabell",rowtype:"Radtyp",advanced_props:"Avancerade inst\u00e4llningar",general_props:"Generella inst\u00e4llningar",advanced_tab:"Avancerat",general_tab:"Generellt",mime:"Target MIME type"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/si_dlg.js b/js/tiny_mce/plugins/table/langs/si_dlg.js new file mode 100755 index 000000000..abd3e9d66 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/si_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('si.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sk_dlg.js b/js/tiny_mce/plugins/table/langs/sk_dlg.js new file mode 100755 index 000000000..f232c30d4 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sk.table_dlg',{rules_border:"or\u00e1movanie okolo",rules_box:"box okolo",rules_vsides:"v\u013eavo a vpravo",rules_rhs:"vpravo",rules_lhs:"v\u013eavo",rules_hsides:"hore a dole",rules_below:"dole",rules_above:"hore",rules_void:"\u017eiadne",rules:"Vykreslenie mrie\u017eky",frame_all:"v\u0161etko",frame_cols:"st\u013apce",frame_rows:"riadky",frame_groups:"oblasti a skupiny st\u013apcov",frame_none:"\u017eiadna",frame:"Or\u00e1movanie tabu\u013eky",caption:"Nadpis tabu\u013eky",missing_scope:"Skuto\u010dne chcete pokra\u010dova\u0165 bez ur\u010denia oblasti hlavi\u010dky tejto tabu\u013eky? Bez nej m\u00f4\u017ee u niektor\u00fdch u\u017e\u00edvate\u013eov doch\u00e1dza\u0165 k ur\u010dit\u00fdm probl\u00e9mom pri intepret\u00e1cii a zobrazovan\u00ed d\u00e1t v tabu\u013eke.",cell_limit:"Prekro\u010dili ste maxim\u00e1lny po\u010det buniek {$cells}.",row_limit:"Prekro\u010dili ste maxim\u00e1lny po\u010det riadkov {$rows}.",col_limit:"Prekro\u010dili ste maxim\u00e1lny po\u010det st\u013apcov {$cols}.",colgroup:"Skupina st\u013apcov",rowgroup:"Skupina riadkov",scope:"Hlavi\u010dka pre",tfoot:"P\u00e4ta tabu\u013eky",tbody:"Telo tabu\u013eky",thead:"Hlavi\u010dka tabu\u013eky",row_all:"Aktualizova\u0165 v\u0161etky riadky tabu\u013eky",row_even:"Aktualizova\u0165 p\u00e1rne riadky tabu\u013eky",row_odd:"Aktualizova\u0165 nep\u00e1rne riadky tabu\u013eky",row_row:"Aktualizova\u0165 aktu\u00e1lny riadok",cell_all:"Aktualizova\u0165 v\u0161etky bunky v tabu\u013eke",cell_row:"Aktualizova\u0165 v\u0161etky bunky v riadku",cell_cell:"Aktualizova\u0165 aktu\u00e1lnu bunku",th:"Hlavi\u010dka",td:"D\u00e1ta",summary:"Obsah tabu\u013eky",bgimage:"Obr\u00e1zok pozadia",rtl:"Sprava do\u013eava",ltr:"Z\u013eava doprava",mime:"MIME typ cie\u013ea",langcode:"K\u00f3d jazyka",langdir:"Smer textu",style:"\u0160t\u00fdl",id:"ID",merge_cells_title:"Zl\u00fa\u010di\u0165 bunky",bgcolor:"Farba pozadia",bordercolor:"Farba or\u00e1movania",align_bottom:"Dolu",align_top:"Hore",valign:"Vertik\u00e1lne zarovnanie",cell_type:"Typ bunky",cell_title:"Vlastnosti bunky",row_title:"Vlastnosti riadkov",align_middle:"Na stred",align_right:"Vpravo",align_left:"V\u013eavo",align_default:"Predvolen\u00e9",align:"Zarovnanie",border:"Or\u00e1movanie",cellpadding:"Odsadenie obsahu",cellspacing:"Rozstup buniek",rows:"Riadky",cols:"St\u013apce",height:"V\u00fd\u0161ka",width:"\u0160\u00edrka",title:"Vlo\u017ei\u0165/Upravi\u0165 tabu\u013eku",rowtype:"Typ riadku",advanced_props:"Roz\u0161\u00edren\u00e9 parametre",general_props:"Obecn\u00e9 parametre",advanced_tab:"Roz\u0161\u00edren\u00e9",general_tab:"Obecn\u00e9"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sl_dlg.js b/js/tiny_mce/plugins/table/langs/sl_dlg.js new file mode 100755 index 000000000..f5e9464c0 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sl.table_dlg',{rules_border:"obroba",rules_box:"\u0161katla",rules_vsides:"n-strani",rules_rhs:"d-strani",rules_lhs:"l-strani",rules_hsides:"v-strani",rules_below:"pod",rules_above:"nad",rules_void:"prazno",rules:"Pravila",frame_all:"vse",frame_cols:"stolpci",frame_rows:"vrstice",frame_groups:"skupine",frame_none:"brez",frame:"Okvir",caption:"Opis tabele",missing_scope:"Ste prepri\u010dani, da \u017eelite nadaljevati brez dolo\u010denega dosega? Brez dosega je razumevanje tabele lahko ote\u017eeno ljudem s slab\u0161o zaznavo!",cell_limit:"Presegli ste dovoljeno \u0161tevilo celic: {$cells}.",row_limit:"Presegli ste dovoljeno \u0161tevilo vrstic: {$rows}.",col_limit:"Presegli ste dovoljeno \u0161tevilo stolpcev: {$cols}.",colgroup:"Skup. stolp.",rowgroup:"Skup. vrst.",scope:"Doseg",tfoot:"Noga tabele",tbody:"Telo tabele",thead:"Glava tabele",row_all:"Posodobi vse vrstice",row_even:"Posodobi sode vrstice",row_odd:"Posodobi lihe vrstice",row_row:"Posodobi trenutno vrstico",cell_all:"Posodobi vse celice tabele",cell_row:"Posodobi vse celice vrstice",cell_cell:"Posodobi trenutno celico",th:"Glava",td:"Podatek",summary:"Povzetek",bgimage:"Slika ozadja",rtl:"Od desne proti levi",ltr:"Od leve proti desni",mime:"Ciljni tip MIME",langcode:"Koda jezika",langdir:"Smer pisave",style:"Slog",id:"Oznaka",merge_cells_title:"Spoji celice",bgcolor:"Barva ozadja",bordercolor:"Barva obrobe",align_bottom:"Dno",align_top:"Vrh",valign:"Navpi\u010dna poravnava",cell_type:"Tip celice",cell_title:"Lastnosti celice",row_title:"Lastnosti vrstice",align_middle:"Sredina",align_right:"Desno",align_left:"Levo",align_default:"Privzeto",align:"Poravnava",border:"Obroba",cellpadding:"Podlaganje celic",cellspacing:"Razmik celic",rows:"Vrstic",cols:"Stolpcev",height:"Vi\u0161ina",width:"\u0160irina",title:"Vstavi/posodobi tabelo",rowtype:"Vrstica v tabeli",advanced_props:"Napredne lastnosti",general_props:"Splo\u0161ne lastnosti",advanced_tab:"Napredno",general_tab:"Splo\u0161no"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sq_dlg.js b/js/tiny_mce/plugins/table/langs/sq_dlg.js new file mode 100755 index 000000000..15aa4531c --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sq_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sq.table_dlg',{rules_border:"korniz\u00eb",rules_box:"kuti",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"posht\u00eb",rules_above:"sip\u00ebr",rules_void:"zbrazur",rules:"Rregullat",frame_all:"t\u00eb gjitha",frame_cols:"kolona",frame_rows:"rreshta",frame_groups:"grupe",frame_none:"asnj\u00eb",frame:"Korniza",caption:"Krijo hap\u00ebsir\u00eb p\u00ebr titull",missing_scope:"Jeni t\u00eb sigurt q\u00eb nuk doni t\u00eb vendosni objektiv p\u00ebr k\u00ebt\u00eb qeliz\u00eb t\u00eb kok\u00ebs. Pa t\u00eb mund t\u00eb jet\u00eb e v\u00ebshtir\u00eb p\u00ebr disa p\u00ebrdorues me aft\u00ebsi t\u00eb kufizuara t\u00eb lexojn\u00eb p\u00ebrmbajtjen e tabel\u00ebs.",cell_limit:"Keni kaluar numrin maksimal t\u00eb qelizave {$cells}.",row_limit:"Keni kaluar numrin maksimal t\u00eb rreshtave: {$rows}.",col_limit:"Keni kaluar numrin maksimal t\u00eb kolonave: {$cols}.",colgroup:"Grup Kolonash",rowgroup:"Grup Rreshtash",scope:"Objektivi",tfoot:"K\u00ebmb\u00ebt e Tabel\u00ebs",tbody:"Trupin e Tabel\u00ebs",thead:"Kok\u00ebn e Tabel\u00ebs",row_all:"Rifresko t\u00eb gjitha rreshtat n\u00eb tabel\u00eb",row_even:"Rifresko rreshtat \u00e7ift",row_odd:"Rifresko rreshtat tek",row_row:"Rifresko rreshtin aktual",cell_all:"Rifresko t\u00eb gjitha qelizat",cell_row:"Rifresko t\u00eb gjitha qelizat n\u00eb rresht",cell_cell:"Rifresko qeliz\u00ebn aktuale",th:"Kok\u00eb",td:"T\u00eb dh\u00ebna",summary:"P\u00ebrmbledhja",bgimage:"Foto e fush\u00ebs",rtl:"Djathtas-Majtas",ltr:"Majtas-Djathtas",mime:"Tipi MIME i sh\u00ebnjestr\u00ebs",langcode:"Kodi i gjuh\u00ebs",langdir:"Drejtimi i gjuh\u00ebs",style:"Stili",id:"Id",merge_cells_title:"Bashko qelizat",bgcolor:"Ngjyra e fush\u00ebs",bordercolor:"Ngjyra e korniz\u00ebs",align_bottom:"Fund",align_top:"Krye",valign:"Drejtimi vertikal",cell_type:"Tipi i qeliz\u00ebs",cell_title:"Tiparet e qeliz\u00ebs",row_title:"Tiparet e rreshtit",align_middle:"Qend\u00ebr",align_right:"Djathtas",align_left:"Majtas",align_default:"Paracaktuar",align:"Drejtimi",border:"Korniza",cellpadding:"Hap\u00ebsira e br\u00ebndshme",cellspacing:"Hap\u00ebsira midis qelizave",rows:"Rreshta",cols:"Kolona",height:"Gjat\u00ebsia",width:"Gjer\u00ebsia",title:"Fut/Edito tabel\u00eb",rowtype:"Rresht n\u00eb",advanced_props:"Tipare t\u00eb avancuara",general_props:"Tipare t\u00eb p\u00ebrgjithshme",advanced_tab:"T\u00eb avancuara",general_tab:"T\u00eb p\u00ebrgjithshme"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sr_dlg.js b/js/tiny_mce/plugins/table/langs/sr_dlg.js new file mode 100755 index 000000000..49e051f80 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sr.table_dlg',{rules_border:"sve ivice",rules_box:"sve strane",rules_vsides:"levo i desno",rules_rhs:"samo desno",rules_lhs:"samo levo",rules_hsides:"gornja i donja",rules_below:"ispod",rules_above:"iznad",rules_void:"prazno",rules:"Linije",frame_all:"sve",frame_cols:"kolone",frame_rows:"redovi",frame_groups:"grupe",frame_none:"bez rama",frame:"ram",caption:"Opis tabele",missing_scope:"Da li ste sigurni da \u017eelite da nastavite a da niste definisali obim \u0107elije zaglavlja tabele. Kada nije definisan, korisnicima sa smetnjama u razvoju mo\u017eda ne\u0107e biti razumljiv njihov sadr\u017eaj.",cell_limit:"Prema\u0161ili ste maksimalni broj \u0107elija ({$cells}).",row_limit:"Prema\u0161ili ste maksimalni broj redova ({$rows}).",col_limit:"Prema\u0161ili ste maksimalni broj kolona ({$cols}).",colgroup:"Grupa kolona",rowgroup:"Grupa redova",scope:"Obim",tfoot:"Podno\u017eje tabele",tbody:"Sadr\u017eaj tabele",thead:"Zaglavlje tabele",row_all:"Primeni na sve redove u tabeli",row_even:"Primeni na parne redove u tabeli",row_odd:"Primeni na neparne redove u tabeli",row_row:"Primeni na izabrani red",cell_all:"Primeni na sve \u0107elije u tabeli",cell_row:"Primeni na sve \u0107elije u redu",cell_cell:"Primeni na izabranu \u0107eliju",th:"Zaglavlje",td:"Podaci",summary:"Prikaz",bgimage:"Slika pozadine",rtl:"S desna na levo",ltr:"S leva na desno",mime:"MIME tip",langcode:"Kod jezika",langdir:"Smer jezika",style:"Stil",id:"Id",merge_cells_title:"Spoji \u0107elije",bgcolor:"Boja pozadine",bordercolor:"Boja ivice",align_bottom:"Dno",align_top:"Vrh",valign:"Vertikalno poravnavanje",cell_type:"Tip \u0107elije",cell_title:"Svojstva \u0107elije",row_title:"Svojstva reda",align_middle:"Sredina",align_right:"Desno",align_left:"Levo",align_default:"Zadato",align:"Poravnavanje",border:"Ivica",cellpadding:"Dopuna \u0107elije",cellspacing:"Razmak \u0107elija",rows:"Redova",cols:"Kolona",height:"Visina",width:"\u0160irina",title:"Ubaci/uredi tabelu",rowtype:"Red u tabeli",advanced_props:"Napredna svojstva",general_props:"Osnovna svojstva",advanced_tab:"Napredno",general_tab:"Osnovno"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/sv_dlg.js b/js/tiny_mce/plugins/table/langs/sv_dlg.js new file mode 100755 index 000000000..687daa4d3 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/sv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('sv.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Regler","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Ram",caption:"\u00d6verskrift","missing_scope":"\u00d6\u0084r du s\u00e4ker p\u00e5 att du vill forts\u00e4tta utan att ange en omfattning, denna underl\u00e4ttar f\u00f6r icke-grafiska webbl\u00e4sare.","cell_limit":"Du kan inte skapa en tabell med fler \u00e4n {$cells} celler.","row_limit":"Du kan inte ange fler \u00e4n {$rows} rader.","col_limit":"Du kan inte ange fler \u00e4n {$cols} kolumner.",colgroup:"Kolumngrupp",rowgroup:"Radgrupp",scope:"Omfattning",tfoot:"tabellfot",tbody:"tabellkropp",thead:"tabellhuvud","row_all":"Uppdatera alla rader i tabellen","row_even":"Uppdatera j\u00e4mna rader i tabellen","row_odd":"Uppdatera udda rader i tabellen","row_row":"Uppdatera nuvarande rad","cell_all":"Uppdatera alla celler i tabellen","cell_row":"Uppdatera alla celler i raden","cell_cell":"Uppdatera nuvarande cell",th:"Huvud",td:"Data",summary:"Sammanfattning",bgimage:"Bakgrundsbild",rtl:"H\u00f6ger till v\u00e4nster",ltr:"V\u00e4nster till h\u00f6ger",mime:"Target MIME type",langcode:"Spr\u00e5kkod",langdir:"Skriftriktning",style:"Stil",id:"Id","merge_cells_title":"Sammanfoga celler",bgcolor:"Bakgrundsf\u00e4rg",bordercolor:"Ramf\u00e4rg","align_bottom":"Botten","align_top":"Toppen",valign:"Vertikal justering","cell_type":"Celltyp","cell_title":"Tabellcellsinst\u00e4llningar","row_title":"Tabellradsinst\u00e4llningar","align_middle":"Mitten","align_right":"H\u00f6ger","align_left":"V\u00e4nster","align_default":"Ingen",align:"Justering",border:"Ram",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rader",cols:"Kolumner",height:"H\u00f6jd",width:"Bredd",title:"Infoga/redigera ny tabell",rowtype:"Radtyp","advanced_props":"Avancerade inst\u00e4llningar","general_props":"Generella inst\u00e4llningar","advanced_tab":"Avancerat","general_tab":"Generellt"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ta_dlg.js b/js/tiny_mce/plugins/table/langs/ta_dlg.js new file mode 100755 index 000000000..3d60f8959 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ta_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ta.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/te_dlg.js b/js/tiny_mce/plugins/table/langs/te_dlg.js new file mode 100755 index 000000000..6ce7b3c14 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/te_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('te.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/th_dlg.js b/js/tiny_mce/plugins/table/langs/th_dlg.js new file mode 100755 index 000000000..cd8f8ab4d --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/th_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('th.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07 image",rtl:"\u0e02\u0e27\u0e32\u0e44\u0e1b\u0e0b\u0e49\u0e32\u0e22",ltr:"\u0e0b\u0e49\u0e32\u0e22\u0e44\u0e1b\u0e02\u0e27\u0e32",mime:"\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22 MIME type",langcode:"\u0e42\u0e04\u0e4a\u0e14\u0e20\u0e32\u0e29\u0e32",langdir:"\u0e17\u0e34\u0e28\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e48\u0e32\u0e19",style:"\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"\u0e2a\u0e35\u0e1e\u0e37\u0e49\u0e19\u0e2b\u0e25\u0e31\u0e07",bordercolor:"\u0e2a\u0e35\u0e01\u0e23\u0e2d\u0e1a",align_bottom:"\u0e25\u0e48\u0e32\u0e07",align_top:"\u0e1a\u0e19",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e40\u0e0b\u0e25\u0e25\u0e4c\u0e43\u0e19\u0e32\u0e23\u0e32\u0e07",row_title:"\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e41\u0e16\u0e27\u0e43\u0e19\u0e15\u0e32\u0e23\u0e32\u0e07",align_middle:"\u0e01\u0e25\u0e32\u0e07",align_right:"\u0e02\u0e27\u0e32",align_left:"\u0e0b\u0e49\u0e32\u0e22",align_default:"\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19",align:"\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e08\u0e31\u0e14\u0e27\u0e32\u0e07",border:"\u0e01\u0e23\u0e2d\u0e1a",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"\u0e41\u0e16\u0e27",cols:"\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e1e\u0e4c",height:"\u0e2a\u0e39\u0e07",width:"\u0e01\u0e27\u0e49\u0e32\u0e07",title:"\u0e40\u0e1e\u0e34\u0e48\u0e21/\u0e41\u0e01\u0e49\u0e44\u0e02 \u0e15\u0e32\u0e23\u0e32\u0e07",rowtype:"Row in table part",advanced_props:"\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",general_props:"\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b",advanced_tab:"\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e39\u0e07",general_tab:"\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/tn_dlg.js b/js/tiny_mce/plugins/table/langs/tn_dlg.js new file mode 100755 index 000000000..d342f79fd --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/tn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tn.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/tr_dlg.js b/js/tiny_mce/plugins/table/langs/tr_dlg.js new file mode 100755 index 000000000..3ce108fd6 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/tr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tr.table_dlg',{rules_border:"kenarl\u0131k",rules_box:"kutu",rules_vsides:"dikey kenarlar",rules_rhs:"sa\u011f yatay kenarlar",rules_lhs:"sol yatay kenarlar",rules_hsides:"yatay kenarlar",rules_below:"alt\u0131nda",rules_above:"\u00fcst\u00fcnde",rules_void:"yok",rules:"\u00c7izgiler",frame_all:"t\u00fcm\u00fc",frame_cols:"s\u00fctunlar",frame_rows:"sat\u0131rlar",frame_groups:"gruplar",frame_none:"hi\u00e7biri",frame:"\u00c7er\u00e7eve",caption:"Tablo ba\u015fl\u0131\u011f\u0131",missing_scope:"Tablo ba\u015fl\u0131k h\u00fccresi i\u00e7in bir kapsam belirlemeden devam etmek istedi\u011finize emin misiniz? Bu de\u011fer olmadan, engelli kullan\u0131c\u0131lar tabloda g\u00f6sterilen verileri ve i\u00e7eri\u011fi anlamas\u0131 zordur.",cell_limit:"Maksimum h\u00fccre say\u0131s\u0131 ($cells) a\u015f\u0131ld\u0131.",row_limit:"Maksimum sat\u0131r say\u0131s\u0131 ($rows) a\u015f\u0131ld\u0131.",col_limit:"Maksimum s\u00fctun say\u0131s\u0131 ($cols) a\u015f\u0131ld\u0131.",colgroup:"S\u00fctun Grubu",rowgroup:"Sat\u0131r Grubu",scope:"Kapsam",tfoot:"Tablo Alt\u0131",tbody:"Tablo G\u00f6vdesi",thead:"Tablo Ba\u015fl\u0131\u011f\u0131",row_all:"Tablodaki t\u00fcm sat\u0131rlar\u0131 g\u00fcncelle",row_even:"Tablodaki \u00e7ift nolu sat\u0131rlar\u0131 g\u00fcncelle",row_odd:"Tablodaki tek nolu sat\u0131rlar\u0131 g\u00fcncelle",row_row:"Se\u00e7ili sat\u0131r\u0131 g\u00fcncelle",cell_all:"Tablodaki t\u00fcm h\u00fccreleri g\u00fcncelle",cell_row:"Sat\u0131rdaki t\u00fcm h\u00fccreleri g\u00fcncelle",cell_cell:"Se\u00e7ili h\u00fccreleri g\u00fcncelle",th:"Ba\u015fl\u0131k",td:"Veri",summary:"\u00d6zet",bgimage:"Arkaplan resmi",rtl:"Soldan sa\u011fa",ltr:"Sa\u011fdan sola",mime:"Hedef MIME tipi",langcode:"Dil kodu",langdir:"Dil y\u00f6n\u00fc",style:"Stil",id:"Id",merge_cells_title:"Tablo h\u00fccrelerini birle\u015ftir",bgcolor:"Arkaplan rengi",bordercolor:"Kenarl\u0131k rengi",align_bottom:"Alt",align_top:"\u00dcst",valign:"Dikey hizalama",cell_type:"H\u00fccre tipi",cell_title:"Tablo h\u00fccre \u00f6zellikleri",row_title:"Tablo sat\u0131r \u00f6zellikleri",align_middle:"Orta",align_right:"Sa\u011f",align_left:"Sol",align_default:"Varsay\u0131lan",align:"Hizalama",border:"Kenarl\u0131k",cellpadding:"H\u00fccre d\u0131\u015f\u0131 bo\u015flu\u011fu",cellspacing:"H\u00fccre i\u00e7i bo\u015flu\u011fu",rows:"Sat\u0131rlar",cols:"S\u00fctunlar",height:"Y\u00fckseklik",width:"Geni\u015flik",title:"Tablo Ekle/D\u00fczenle",rowtype:"Tablo b\u00f6l\u00fcm\u00fcndeki sat\u0131r",advanced_props:"Geli\u015fmi\u015f \u00f6zellikler",general_props:"Genel \u00f6zellikler",advanced_tab:"Geli\u015fmi\u015f",general_tab:"Genel"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/tt_dlg.js b/js/tiny_mce/plugins/table/langs/tt_dlg.js new file mode 100755 index 000000000..638e8a920 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/tt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tt.table_dlg',{rules_border:"\u908a\u6846",rules_box:"\u76d2",rules_vsides:"\u5782\u76f4\u5927\u5c0f",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"\u6c34\u5e73\u5927\u5c0f",rules_below:"\u4e4b\u4e0b",rules_above:"\u4e4b\u4e0a",rules_void:"\u7a7a",rules:"\u5c3a\u898f",frame_all:"\u5168\u90e8",frame_cols:"\u5217",frame_rows:"\u884c",frame_groups:"\u7d44",frame_none:"\u7121",frame:"\u908a\u6846",caption:"\u8868\u683c\u6a19\u984c",missing_scope:"\u60a8\u78ba\u5b9a\u4e0d\u6307\u5b9a\u8868\u982d\u5132\u5b58\u683c\u7684\u7bc4\u570d\u55ce\uff1f\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u90e8\u5206\u4f7f\u7528\u8005\u5c07\u5f88\u96e3\u67e5\u770b\u8868\u683c\u5167\u5bb9",cell_limit:"\u5df2\u8d85\u904e\u9650\u5236\uff0c\u6700\u591a\u7232{$cells} \u5132\u5b58\u683c\u3002",row_limit:"\u5df2\u8d85\u904e\u9650\u5236\uff0c\u6700\u591a\u7232 {$rows} \u884c\u3002",col_limit:"\u5df2\u8d85\u904e\u9650\u5236\uff0c\u6700\u591a\u7232 {$cols} \u5217\u3002",colgroup:"\u5217\u7d44",rowgroup:"\u884c\u7d44",scope:"\u7bc4\u570d",tfoot:"\u8868\u8173",tbody:"\u8868\u9ad4",thead:"\u8868\u982d",row_all:"\u66f4\u65b0\u8868\u683c\u7684\u5168\u90e8\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6578\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6578\u884c",row_row:"\u66f4\u65b0\u6240\u5728\u884c",cell_all:"\u66f4\u65b0\u5168\u90e8\u5132\u5b58\u683c",cell_row:"\u66f4\u65b0\u7576\u524d\u884c\u7684\u5132\u5b58\u683c",cell_cell:"\u66f4\u65b0\u76ee\u524d\u7684\u5132\u5b58\u683c",th:"\u8868\u982d",td:"\u8868\u683c",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u5716\u7247",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",mime:"\u76ee\u6a19 MIME \u985e\u578b",langcode:"\u8a9e\u8a00\u7de8\u78bc",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",style:"\u6a23\u5f0f",id:"Id",merge_cells_title:"\u5408\u4f75\u5132\u5b58\u683c",bgcolor:"\u80cc\u666f\u9854\u8272",bordercolor:"\u908a\u6846\u9854\u8272",align_bottom:"\u5e95\u90e8",align_top:"\u9802\u90e8",valign:"\u5782\u76f4\u5c0d\u9f4a\u65b9\u5f0f",cell_type:"\u5132\u5b58\u683c \u985e\u5225",cell_title:"\u5132\u5b58\u683c \u5c6c\u6027",row_title:"\u884c \u5c6c\u6027",align_middle:"\u7f6e\u4e2d",align_right:"\u5c45\u53f3",align_left:"\u5c45\u5de6",align_default:"\u9810\u8a2d",align:"\u5c0d\u9f4a\u65b9\u5f0f",border:"\u908a\u6846",cellpadding:"\u5132\u5b58\u683c\u5167\u8ddd",cellspacing:"\u5132\u5b58\u683c\u9593\u8ddd",rows:"\u884c\u6578",cols:"\u5217\u6578",height:"\u9ad8\u5ea6",width:"\u5bec\u5ea6",title:"\u63d2\u5165/\u7de8\u8f2f \u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9032\u968e\u5c6c\u6027",general_props:"\u57fa\u672c \u5c6c\u6027",advanced_tab:"\u9032\u968e",general_tab:"\u57fa\u672c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/tw_dlg.js b/js/tiny_mce/plugins/table/langs/tw_dlg.js new file mode 100755 index 000000000..6cd369e74 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/tw_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('tw.table_dlg',{rules_border:"\u5916\u6846",rules_box:"\u76d2\u578b",rules_vsides:"\u5782\u76f4",rules_rhs:"\u53f3\u908a",rules_lhs:"\u5de6\u908a",rules_hsides:"\u6c34\u5e73",rules_below:"\u4e0b",rules_above:"\u4e0a",rules_void:"\u7a7a",rules:"\u898f\u5247",frame_all:"\u5168\u90e8",frame_cols:"\u6b04",frame_rows:"\u884c",frame_groups:"\u7fa4\u7d44",frame_none:"\u7121",frame:"\u6846\u67b6",caption:"\u8868\u683c\u6a19\u984c",missing_scope:"\u60a8\u78ba\u5b9a\u4e0d\u6307\u5b9a\u8868\u683c\u982d\u90e8\u5132\u5b58\u683c\u4e00\u500b\u7bc4\u570d\u55ce\uff1f\u6c92\u6709\u5b83\uff0c\u6216\u8a31\u5c0d\u90a3\u4e9b\u6709\u969c\u7919\u7684\u4f7f\u7528\u8005\u7406\u89e3\u8868\u683c\u5c55\u793a\u7684\u5167\u5bb9\u6216\u6578\u64da\u66f4\u52a0\u7684\u56f0\u96e3\u3002",cell_limit:"\u5df2\u8d85\u904e\u6700\u5927\u5132\u5b58\u683c\u9650\u5236{$cells} \u5132\u5b58\u683c\u3002",row_limit:"\u5df2\u8d85\u904e\u6700\u5927\u884c\u6578\u9650\u5236 {$rows} \u5217\u3002",col_limit:"\u5df2\u8d85\u904e\u6700\u5927\u6b04\u6578\u9650\u5236 {$cols} \u6b04\u3002",colgroup:"\u6b04\u7fa4\u7d44",rowgroup:"\u884c\u7fa4\u7d44",scope:"\u7bc4\u570d",tfoot:"\u8868\u5c3e",tbody:"\u8868\u683c\u4e3b\u9ad4",thead:"\u8868\u982d",row_all:"\u66f4\u65b0\u8868\u683c\u7684\u6240\u6709\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6578\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6578\u884c",row_row:"\u66f4\u65b0\u76ee\u524d\u884c",cell_all:"\u66f4\u65b0\u6240\u6709\u5132\u5b58\u683c",cell_row:"\u66f4\u65b0\u76ee\u524d\u884c\u7684\u5132\u5b58\u683c",cell_cell:"\u66f4\u65b0\u76ee\u524d\u5132\u5b58\u683c",th:"\u8868\u982d",td:"\u8cc7\u6599",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u5716\u7247",rtl:"\u5f9e\u53f3\u5230\u5de6",ltr:"\u5f9e\u5de6\u5230\u53f3",mime:"MIME \u985e\u578b",langcode:"\u8a9e\u8a00\u7de8\u78bc",langdir:"\u8a9e\u8a00\u66f8\u5beb\u65b9\u5411",style:"\u6a23\u5f0f",id:"ID",merge_cells_title:"\u5408\u4f75\u5132\u5b58\u683c",bgcolor:"\u80cc\u666f\u984f\u8272",bordercolor:"\u908a\u6846\u984f\u8272",align_bottom:"\u9760\u4e0b",align_top:"\u9760\u4e0a",valign:"\u5782\u76f4\u5c0d\u9f4a",cell_type:"\u5132\u5b58\u683c\u985e\u578b",cell_title:"\u5132\u5b58\u683c\u6a19\u984c",row_title:"\u884c\u5c6c\u6027",align_middle:"\u7f6e\u4e2d\u5c0d\u9f4a",align_right:"\u9760\u53f3\u5c0d\u9f4a",align_left:"\u9760\u5de6\u5c0d\u9f4a",align_default:"\u9810\u8a2d",align:"\u5c0d\u9f4a\u65b9\u5f0f",border:"\u908a\u6846",cellpadding:"\u5132\u5b58\u683c\u908a\u8ddd",cellspacing:"\u5132\u5b58\u683c\u9593\u8ddd",rows:"\u884c\u6578",cols:"\u6b04\u6578",height:"\u9ad8\u5ea6",width:"\u5bec\u5ea6",title:"\u63d2\u5165/\u7de8\u8f2f\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9032\u968e\u5c6c\u6027",general_props:"\u4e00\u822c\u5c6c\u6027",advanced_tab:"\u9032\u968e",general_tab:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/uk_dlg.js b/js/tiny_mce/plugins/table/langs/uk_dlg.js new file mode 100755 index 000000000..e3ae70236 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/uk_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('uk.table_dlg',{rules_border:"\u0440\u0430\u043c\u043a\u0430",rules_box:"\u0431\u043e\u043a\u0441",rules_vsides:"v-\u0441\u0442\u043e\u0440\u043e\u043d\u0438",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"h-\u0441\u0442\u043e\u0440\u043e\u043d\u0438",rules_below:"\u0437\u043d\u0438\u0437\u0443",rules_above:"\u0437\u0432\u0435\u0440\u0445\u0443",rules_void:"\u043f\u0443\u0441\u0442\u043e",rules:"\u041f\u0440\u0430\u0432\u0438\u043b\u0430",frame_all:"\u0432\u0441\u0456",frame_cols:"\u0441\u0442\u043e\u0432\u043f\u0446\u0456",frame_rows:"\u0440\u044f\u0434\u043a\u0438",frame_groups:"\u0433\u0440\u0443\u043f\u0438",frame_none:"\u043d\u0456\u044f\u043a\u0438\u0439",frame:"\u0424\u0440\u0435\u0439\u043c",caption:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0456",missing_scope:"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0431\u0430\u0436\u0430\u0454\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0438\u0442\u0438 \u043d\u0435 \u0432\u043a\u0430\u0437\u0430\u0432\u0448\u0438 \u043c\u0435\u0436\u0456 \u0434\u043b\u044f \u0446\u0456\u0454\u0457 \u043a\u043e\u043c\u0456\u0440\u043a\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443. \u0411\u0435\u0437 \u0446\u044c\u043e\u0433\u043e \u0434\u0435\u044f\u043a\u0438\u043c \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430\u043c \u0431\u0443\u0434\u0435 \u0432\u0430\u0436\u043a\u043e \u0437\u0440\u043e\u0437\u0443\u043c\u0456\u0442\u0438 \u0437\u043c\u0456\u0441\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0456.",cell_limit:"\u0412\u0438 \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u043a\u043e\u043c\u0456\u0440\u043e\u043a: {$cells}.",row_limit:"\u0412\u0438 \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0440\u044f\u0434\u043a\u0456\u0432: {$rows}.",col_limit:"\u0412\u0438 \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0441\u0442\u043e\u0432\u043f\u0446\u0456\u0432: {$cols}.",colgroup:"\u0413\u0440\u0443\u043f\u0430 \u0441\u0442\u043e\u0432\u043f\u0446\u0456\u0432",rowgroup:"\u0413\u0440\u0443\u043f\u0430 \u043a\u043e\u043c\u0456\u0440\u043e\u043a",scope:"\u0420\u043e\u0437\u043c\u0430\u0445",tfoot:"\u041d\u0438\u0436\u043d\u044f \u0447\u0430\u0441\u0442\u0438\u043d\u0430",tbody:"\u0422\u0456\u043b\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0456",thead:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0456",row_all:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u0440\u044f\u0434\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",row_even:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u043f\u0430\u0440\u043d\u0456 \u0440\u044f\u0434\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",row_odd:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u043d\u0435\u043f\u0430\u0440\u043d\u0456 \u0440\u044f\u0434\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446",row_row:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u043f\u043e\u0442\u043e\u0447\u043d\u0438\u0439 \u0440\u044f\u0434\u043e\u043a",cell_all:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u043a\u043e\u043c\u0456\u0440\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",cell_row:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0441\u0456 \u043a\u043e\u043c\u0456\u0440\u043a\u0438 \u0432 \u0440\u044f\u0434\u043a\u0443",cell_cell:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u043f\u043e\u0442\u043e\u0447\u043d\u0443 \u043a\u043e\u043c\u0456\u0440\u043a\u0443",th:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",td:"\u0414\u0430\u043d\u043d\u0456",summary:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435",bgimage:"\u0424\u043e\u043d\u043e\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",rtl:"\u0421\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0456\u0432\u043e",ltr:"\u0417\u043b\u0456\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e",mime:"MIME-\u0442\u0438\u043f \u0446\u0456\u043b\u0456",langcode:"\u041a\u043e\u0434 \u043c\u043e\u0432\u0438",langdir:"\u041d\u0430\u043f\u0440\u044f\u043c \u043c\u043e\u0432\u0438",style:"\u0421\u0442\u0438\u043b\u044c",id:"\u0406\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440",merge_cells_title:"\u041e\u0431\'\u0454\u0434\u043d\u0430\u0442\u0438 \u043a\u043e\u043c\u0456\u0440\u043a\u0438",bgcolor:"\u041a\u043e\u043b\u0456\u0440 \u0444\u043e\u043d\u0443",bordercolor:"\u041a\u043e\u043b\u0456\u0440 \u0433\u0440\u0430\u043d\u0438\u0446\u0456",align_bottom:"\u041f\u043e \u043d\u0438\u0436\u043d\u044c\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_top:"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e",valign:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0435 \u0432\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",cell_type:"\u0422\u0438\u043f \u043a\u043e\u043c\u0456\u0440\u043a\u0438",cell_title:"\u0412\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u043a\u043e\u043c\u0456\u0440\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",row_title:"\u0412\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u0440\u044f\u0434\u043a\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",align_middle:"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443",align_right:"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_left:"\u041f\u043e \u043b\u0456\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e",align_default:"\u0417\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0430\u043d\u043d\u044f\u043c",align:"\u0412\u0438\u0440\u0456\u0432\u043d\u044e\u0432\u0430\u043d\u043d\u044f",border:"\u0420\u0430\u043c\u043a\u0430",cellpadding:"\u0412\u0456\u0434\u0441\u0442\u0443\u043f\u0438 \u0443 \u043a\u043e\u043c\u0456\u0440\u043a\u0430\u0445",cellspacing:"\u0412\u0456\u0434\u0441\u0442\u0430\u043d\u044c \u043c\u0456\u0436 \u043a\u043e\u043c\u0456\u0440\u043a\u0430\u043c\u0438",rows:"\u0420\u044f\u0434\u043a\u0438",cols:"\u0421\u0442\u043e\u0432\u043f\u0446\u0456",height:"\u0412\u0438\u0441\u043e\u0442\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",title:"\u0414\u043e\u0434\u0430\u0442\u0438/\u0417\u043c\u0456\u043d\u0438\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044e",rowtype:"\u0420\u044f\u0434\u043e\u043a \u0432 \u0447\u0430\u0441\u0442\u0438\u043d\u0456 \u0442\u0430\u0431\u043b\u0438\u0446\u0456",advanced_props:"\u0420\u043e\u0437\u0448\u0438\u0440\u0435\u043d\u0456 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",general_props:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0456 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456",advanced_tab:"\u0414\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u043e",general_tab:"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0435"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/ur_dlg.js b/js/tiny_mce/plugins/table/langs/ur_dlg.js new file mode 100755 index 000000000..7232648b1 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/ur_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ur.table_dlg',{rules_border:"border",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"below",rules_above:"above",rules_void:"void",rules:"Rules",frame_all:"all",frame_cols:"cols",frame_rows:"rows",frame_groups:"groups",frame_none:"none",frame:"Frame",caption:"Table caption",missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",cell_limit:"You\'ve exceeded the maximum number of cells of {$cells}.",row_limit:"You\'ve exceeded the maximum number of rows of {$rows}.",col_limit:"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Table Foot",tbody:"Table Body",thead:"Table Head",row_all:"Update all rows in table",row_even:"Update even rows in table",row_odd:"Update odd rows in table",row_row:"Update current row",cell_all:"Update all cells in table",cell_row:"Update all cells in row",cell_cell:"Update current cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background image",rtl:"Right to left",ltr:"Left to right",mime:"Target MIME type",langcode:"Language code",langdir:"Language direction",style:"Style",id:"Id",merge_cells_title:"Merge table cells",bgcolor:"Background color",bordercolor:"Border color",align_bottom:"Bottom",align_top:"Top",valign:"Vertical alignment",cell_type:"Cell type",cell_title:"Table cell properties",row_title:"Table row properties",align_middle:"Center",align_right:"Right",align_left:"Left",align_default:"Default",align:"Alignment",border:"Border",cellpadding:"Cellpadding",cellspacing:"Cellspacing",rows:"Rows",cols:"Cols",height:"Height",width:"Width",title:"Insert/Modify table",rowtype:"Row in table part",advanced_props:"Advanced properties",general_props:"General properties",advanced_tab:"Advanced",general_tab:"General"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/vi_dlg.js b/js/tiny_mce/plugins/table/langs/vi_dlg.js new file mode 100755 index 000000000..a182b002a --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/vi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('vi.table_dlg',{rules_border:"vi\u1ec1n",rules_box:"box",rules_vsides:"vsides",rules_rhs:"rhs",rules_lhs:"lhs",rules_hsides:"hsides",rules_below:"d\u01b0\u1edbi",rules_above:"tr\u00ean",rules_void:"tr\u1ed1ng kh\u00f4ng",rules:"Th\u01b0\u1edbc",frame_all:"t\u1ea5t",frame_cols:"c\u1ed9t",frame_rows:"h\u00e0ng",frame_groups:"nh\u00f3m",frame_none:"kh\u00f4ng",frame:"Khung",caption:"Ch\u00fa t\u00edch b\u1ea3ng",missing_scope:"Ti\u1ebfp t\u1ee5c v\u1edbi \u0111\u01b0\u1eddng d\u1eabn kh\u00f4ng t\u1ed3n t\u1ea1i ?",cell_limit:"B\u1ea1n \u0111\u00e3 v\u01b0\u1ee3t qu\u00e1 s\u1ed1 t\u1ed1i \u0111a \u00f4 c\u1ee7a {$cells}.",row_limit:"B\u1ea1n \u0111\u00e3 v\u01b0\u1ee3t qu\u00e1 s\u1ed1 t\u1ed1i \u0111a h\u00e0ng c\u1ee7a {$rows}.",col_limit:"B\u1ea1n \u0111\u00e3 v\u01b0\u1ee3t qu\u00e1 s\u1ed1 t\u1ed1i \u0111a c\u1ed9t c\u1ee7a {$cols}.",colgroup:"Nh\u00f3m c\u1ed9t",rowgroup:"Nh\u00f3m h\u00e0ng",scope:"Ph\u1ea1m vi",tfoot:"Ch\u00e2n b\u1ea3ng",tbody:"Th\u00e2n b\u1ea3n",thead:"\u0110\u1ea7u b\u1ea3ng",row_all:"C\u1eadp nh\u1eadt t\u1ea5t h\u00e0ng trong b\u1ea3ng",row_even:"C\u1eadp nh\u1eadt h\u00e0ng ch\u1eb5n trong b\u1ea3ng",row_odd:"C\u1eadp nh\u1eadt h\u00e0ng l\u1ebb trong b\u1ea3ng",row_row:"C\u1eadp nh\u1eadt h\u00e0ng hi\u1ec7n th\u1eddi",cell_all:"C\u1eadp nh\u1ea5t t\u1ea5t c\u00e1c \u00f4 trong b\u1ea3ng",cell_row:"C\u1eadp nh\u1ea5t t\u1ea5t c\u00e1c \u00f4 trong h\u00e0ng",cell_cell:"C\u1eadp nh\u1eadt \u00f4 hi\u1ec7n th\u1eddi",th:"\u0110\u1ea7u \u0111\u1ec1",td:"D\u1eef li\u1ec7u",summary:"T\u00f3m l\u01b0\u1ee3c",bgimage:"\u1ea2nh n\u1ec1n",rtl:"Ph\u1ea3i qua tr\u00e1i",ltr:"Tr\u00e1i qua ph\u1ea3i",mime:"Ki\u1ec3u MIME \u0111\u00edch",langcode:"M\u00e3 ng\u00f4n ng\u1eef",langdir:"H\u01b0\u1edbng ng\u00f4n ng\u1eef",style:"Ki\u1ec3u d\u00e1ng",id:"Id",merge_cells_title:"K\u1ebft h\u1ee3p c\u00e1c \u00f4 c\u1ee7a b\u1ea3ng",bgcolor:"M\u00e0u n\u1ec1n",bordercolor:"M\u00e0u vi\u1ec1n",align_bottom:"D\u01b0\u1edbi",align_top:"Tr\u00ean",valign:"Canh l\u1ec1 d\u1ecdc",cell_type:"Lo\u1ea1i \u00f4",cell_title:"Thu\u1ed9c t\u00ednh \u00f4",row_title:"Thu\u1ed9c t\u00ednh h\u00e0ng",align_middle:"Gi\u1eefa",align_right:"Ph\u1ea3i",align_left:"Tr\u00e1i",align_default:"M\u1eb7c \u0111\u1ecbnh",align:"Canh l\u1ec1",border:"Vi\u1ec1n",cellpadding:"Kho\u1ea3ng l\u00f3t \u00f4",cellspacing:"Kho\u1ea3ng c\u00e1ch \u00f4",rows:"H\u00e0ng",cols:"C\u1ed9t",height:"Chi\u1ec1u cao",width:"Chi\u1ec1u r\u1ed9ng",title:"Ch\u00e8n/S\u1eeda b\u1ea3ng",rowtype:"H\u00e0ng trong t\u1eebng ph\u1ea7n b\u1ea3ng",advanced_props:"Thu\u1ed9c t\u00ednh n\u00e2ng cao",general_props:"Thu\u1ed9c t\u00ednh chung",advanced_tab:"N\u00e2ng cao",general_tab:"Chung"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/zh-cn_dlg.js b/js/tiny_mce/plugins/table/langs/zh-cn_dlg.js new file mode 100755 index 000000000..bfcad0871 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/zh-cn_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh-cn.table_dlg',{"rules_border":"\u8fb9\u6846","rules_box":"\u6846","rules_vsides":"\u5782\u76f4","rules_rhs":"\u53f3\u8fb9","rules_lhs":"\u5de6\u8fb9","rules_hsides":"\u6c34\u5e73","rules_below":"\u4e0b","rules_above":"\u4e0a","rules_void":"\u7a7a",rules:"\u89c4\u5219","frame_all":"\u5168\u90e8","frame_cols":"\u5217","frame_rows":"\u884c","frame_groups":"\u5206\u7ec4","frame_none":"\u65e0",frame:"\u6846\u67b6",caption:"\u683c\u6807\u9898","missing_scope":"\u60a8\u6ca1\u6709\u6307\u5b9a\u8868\u683c\u7684\u6807\u9898\u5355\u5143\uff0c\u5982\u679c\u4e0d\u8bbe\u7f6e\uff0c\u53ef\u80fd\u4f1a\u4f7f\u7528\u6237\u96be\u4ee5\u7406\u89e3\u60a8\u7684\u8868\u683c\u7684\u5185\u5bb9\u3002\u60a8\u8981\u7ee7\u7eed\u5417\uff1f","cell_limit":"\u5df2\u7ecf\u8d85\u51fa\u6700\u5927\u5355\u5143\u683c\u6570{$cells}\u3002","row_limit":"\u5df2\u7ecf\u8d85\u51fa\u6700\u5927\u884c\u6570{$rows}\u3002","col_limit":"\u5df2\u7ecf\u8d85\u51fa\u6700\u5927\u5217\u6570{$cols}\u3002",colgroup:"\u5217\u5206\u7ec4",rowgroup:"\u884c\u5206\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u683c\u4e3b\u4f53",thead:"\u8868\u5934","row_all":"\u66f4\u65b0\u8868\u683c\u7684\u6240\u6709\u884c","row_even":"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6570\u884c","row_odd":"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6570\u884c","row_row":"\u66f4\u65b0\u5f53\u524d\u884c","cell_all":"\u66f4\u65b0\u6240\u6709\u5355\u5143\u683c","cell_row":"\u66f4\u65b0\u5f53\u524d\u884c\u7684\u5355\u5143\u683c","cell_cell":"\u66f4\u65b0\u5f53\u524d\u5355\u5143\u683c",th:"\u8868\u5934",td:"\u5185\u5bb9",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",mime:"\u76ee\u6807MIME\u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"ID","merge_cells_title":"\u5408\u5e76\u5355\u5143\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272","align_bottom":"\u9760\u4e0b","align_top":"\u9760\u4e0a",valign:"\u5782\u76f4\u5bf9\u9f50","cell_type":"\u5355\u5143\u683c\u7c7b\u578b","cell_title":"\u5355\u5143\u683c\u5c5e\u6027","row_title":"\u884c\u5c5e\u6027","align_middle":"\u5c45\u4e2d","align_right":"\u53f3\u5bf9\u9f50","align_left":"\u5de6\u5bf9\u9f50","align_default":"\u9ed8\u8ba4",align:"\u5bf9\u9f50",border:"\u8fb9\u6846",cellpadding:"\u5355\u5143\u683c\u8fb9\u8ddd",cellspacing:"\u5355\u5143\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u5217\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91 \u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e","advanced_props":"\u9ad8\u7ea7\u5c5e\u6027","general_props":"\u666e\u901a\u5c5e\u6027","advanced_tab":"\u9ad8\u7ea7","general_tab":"\u666e\u901a"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/zh_dlg.js b/js/tiny_mce/plugins/table/langs/zh_dlg.js new file mode 100755 index 000000000..496c27eff --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/zh_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zh.table_dlg',{rules_border:"\u5916\u6846",rules_box:"\u76d2\u578b",rules_vsides:"\u5782\u76f4",rules_rhs:"\u53f3\u8fb9",rules_lhs:"\u5de6\u8fb9",rules_hsides:"\u6c34\u5e73",rules_below:"\u4e0b",rules_above:"\u4e0a",rules_void:"\u7a7a",rules:"\u89c4\u5219",frame_all:"\u5168\u90e8",frame_cols:"\u680f",frame_rows:"\u884c",frame_groups:"\u7fa4\u7ec4",frame_none:"\u65e0",frame:"\u6846\u67b6",caption:"\u8868\u683c\u6807\u9898",missing_scope:"\u4f60\u786e\u5b9a\u4e0d\u6307\u5b9a\u8868\u683c\u5934\u90e8\u50a8\u5b58\u683c\u4e00\u4e2a\u8303\u56f4\u5417\uff1f\u6ca1\u6709\u5b83\uff0c\u6216\u8bb8\u5bf9\u90a3\u4e9b\u6709\u969c\u788d\u7684\u7528\u6237\u7406\u89e3\u8868\u683c\u5c55\u793a\u7684\u5185\u5bb9\u6216\u6570\u636e\u66f4\u52a0\u7684\u56f0\u96be\u3002",cell_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u50a8\u5b58\u683c\u9650\u5236{$cells} \u50a8\u5b58\u683c\u3002",row_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u884c\u6570\u9650\u5236 {$rows} \u5217\u3002",col_limit:"\u5df2\u8d85\u8fc7\u6700\u5927\u680f\u6570\u9650\u5236 {$cols} \u680f\u3002",colgroup:"\u680f\u7fa4\u7ec4",rowgroup:"\u884c\u7fa4\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u683c\u4e3b\u4f53",thead:"\u8868\u5934",row_all:"\u66f4\u65b0\u8868\u683c\u7684\u6240\u6709\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u7684\u5076\u6570\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u7684\u5947\u6570\u884c",row_row:"\u66f4\u65b0\u76ee\u524d\u884c",cell_all:"\u66f4\u65b0\u6240\u6709\u50a8\u5b58\u683c",cell_row:"\u66f4\u65b0\u76ee\u524d\u884c\u7684\u50a8\u5b58\u683c",cell_cell:"\u66f4\u65b0\u76ee\u524d\u50a8\u5b58\u683c",th:"\u8868\u5934",td:"\u5185\u5bb9",summary:"\u6458\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u4ece\u53f3\u5230\u5de6",ltr:"\u4ece\u5de6\u5230\u53f3",mime:"MIME \u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"ID",merge_cells_title:"\u5408\u4f75\u50a8\u5b58\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272",align_bottom:"\u9760\u4e0b",align_top:"\u9760\u4e0a",valign:"\u5782\u76f4\u5bf9\u9f50",cell_type:"\u50a8\u5b58\u683c\u7c7b\u578b",cell_title:"\u50a8\u5b58\u683c\u6807\u9898",row_title:"\u884c\u5c5e\u6027",align_middle:"\u7f6e\u4e2d\u5bf9\u9f50",align_right:"\u9760\u53f3\u5bf9\u9f50",align_left:"\u9760\u5de6\u5bf9\u9f50",align_default:"\u9ed8\u8ba4",align:"\u5bf9\u9f50\u65b9\u5f0f",border:"\u8fb9\u6846",cellpadding:"\u50a8\u5b58\u683c\u8fb9\u8ddd",cellspacing:"\u50a8\u5b58\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u680f\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",general_tab:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/langs/zu_dlg.js b/js/tiny_mce/plugins/table/langs/zu_dlg.js new file mode 100755 index 000000000..4ac0335d3 --- /dev/null +++ b/js/tiny_mce/plugins/table/langs/zu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('zu.table_dlg',{rules_border:"\u5916\u6846",rules_box:"\u76d2\u578b",rules_vsides:"\u5782\u76f4\u8fb9",rules_rhs:"\u53f3\u8fb9",rules_lhs:"\u5de6\u8fb9",rules_hsides:"\u6c34\u51c6\u8fb9",rules_below:"\u4e0b",rules_above:"\u4e0a",rules_void:"\u7a7a",rules:"\u7ebf\u6761",frame_all:"\u5168\u90e8",frame_cols:"\u5217",frame_rows:"\u884c",frame_groups:"\u7fa4\u7ec4",frame_none:"\u65e0",frame:"\u8fb9\u6846",caption:"\u8868\u683c\u6807\u9898",missing_scope:"\u6807\u9898\u884c\u7f3a\u5931\uff01",cell_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u50a8\u5b58\u683c\u6570\u4e3a{$cells}\u683c\u3002",row_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u884c\u6570\u4e3a{$rows}\u884c\u3002",col_limit:"\u5df2\u8d85\u8fc7\u53ef\u7528\u6570\uff0c\u6700\u9ad8\u7684\u5217\u6570\u4e3a{$cols}\u5217\u3002",colgroup:"\u5217\u7fa4\u7ec4",rowgroup:"\u884c\u7fa4\u7ec4",scope:"\u8303\u56f4",tfoot:"\u8868\u5c3e",tbody:"\u8868\u8eab",thead:"\u8868\u5934",row_all:"\u66f4\u65b0\u8868\u683c\u5185\u5168\u90e8\u884c",row_even:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5076\u6570\u884c",row_odd:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5947\u6570\u884c",row_row:"\u66f4\u65b0\u6240\u5728\u884c",cell_all:"\u66f4\u65b0\u8868\u683c\u5185\u7684\u5168\u90e8\u50a8\u5b58\u683c",cell_row:"\u66f4\u65b0\u6240\u5728\u884c\u7684\u5168\u90e8\u50a8\u5b58\u683c",cell_cell:"\u66f4\u65b0\u6240\u7684\u50a8\u5b58\u683c",th:"\u8868\u5934",td:"\u6570\u636e",summary:"\u6982\u8981",bgimage:"\u80cc\u666f\u56fe\u7247",rtl:"\u7531\u53f3\u5230\u5de6",ltr:"\u7531\u5de6\u5230\u53f3",mime:"\u76ee\u6807MIME\u7c7b\u578b",langcode:"\u8bed\u8a00\u7f16\u7801",langdir:"\u8bed\u8a00\u4e66\u5199\u65b9\u5411",style:"\u6837\u5f0f",id:"Id",merge_cells_title:"\u5408\u5e76\u50a8\u5b58\u683c",bgcolor:"\u80cc\u666f\u989c\u8272",bordercolor:"\u8fb9\u6846\u989c\u8272",align_bottom:"\u4e0b\u65b9",align_top:"\u4e0a\u65b9",valign:"\u6c34\u51c6\u5bf9\u9f50\u65b9\u5f0f",cell_type:"\u50a8\u5b58\u683c\u522b",cell_title:"\u50a8\u5b58\u683c\u5c5e\u6027",row_title:"\u884c\u5c5e\u6027",align_middle:"\u5c45\u4e2d",align_right:"\u9760\u53f3",align_left:"\u9760\u5de6",align_default:"\u9884\u8bbe",align:"\u5bf9\u9f50\u65b9\u5f0f",border:"\u8fb9\u6846",cellpadding:"\u50a8\u5b58\u683c\u7559\u767d",cellspacing:"\u50a8\u5b58\u683c\u95f4\u8ddd",rows:"\u884c\u6570",cols:"\u5217\u6570",height:"\u9ad8\u5ea6",width:"\u5bbd\u5ea6",title:"\u63d2\u5165/\u7f16\u8f91\u8868\u683c",rowtype:"\u884c\u6240\u5728\u7684\u8868\u683c\u4f4d\u7f6e",advanced_props:"\u9ad8\u7ea7\u5c5e\u6027",general_props:"\u4e00\u822c\u5c5e\u6027",advanced_tab:"\u9ad8\u7ea7",general_tab:"\u4e00\u822c"}); \ No newline at end of file diff --git a/js/tiny_mce/plugins/table/merge_cells.htm b/js/tiny_mce/plugins/table/merge_cells.htm new file mode 100644 index 000000000..d231090e7 --- /dev/null +++ b/js/tiny_mce/plugins/table/merge_cells.htm @@ -0,0 +1,32 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + +
        +
        + {#table_dlg.merge_cells_title} + + + + + + + + + +
        :
        :
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/table/row.htm b/js/tiny_mce/plugins/table/row.htm new file mode 100644 index 000000000..c197ff6c7 --- /dev/null +++ b/js/tiny_mce/plugins/table/row.htm @@ -0,0 +1,157 @@ + + + + {#table_dlg.row_title} + + + + + + + + +
        + + +
        +
        +
        + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + +
        + +
        +
        +
        + +
        +
        + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + + + + + +
         
        +
        + + + + + + +
         
        +
        +
        +
        +
        +
        + +
        +
        + +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/table/table.htm b/js/tiny_mce/plugins/table/table.htm new file mode 100644 index 000000000..4a873b0a6 --- /dev/null +++ b/js/tiny_mce/plugins/table/table.htm @@ -0,0 +1,188 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
        + + +
        +
        +
        + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        +
        + +
        +
        + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        + + + + + +
         
        +
        + +
        + +
        + +
        + + + + + +
         
        +
        + + + + + +
         
        +
        +
        +
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/abbr.htm b/js/tiny_mce/plugins/xhtmlxtras/abbr.htm new file mode 100644 index 000000000..30a894f7c --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        : + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/acronym.htm b/js/tiny_mce/plugins/xhtmlxtras/acronym.htm new file mode 100644 index 000000000..c10934592 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        : + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/attributes.htm b/js/tiny_mce/plugins/xhtmlxtras/attributes.htm new file mode 100644 index 000000000..e8d606a34 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/cite.htm b/js/tiny_mce/plugins/xhtmlxtras/cite.htm new file mode 100644 index 000000000..0ac6bdb66 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -0,0 +1,142 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        : + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/js/tiny_mce/plugins/xhtmlxtras/css/attributes.css new file mode 100644 index 000000000..9a6a235c3 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/css/attributes.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/js/tiny_mce/plugins/xhtmlxtras/css/popup.css b/js/tiny_mce/plugins/xhtmlxtras/css/popup.css new file mode 100644 index 000000000..e67114dba --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/css/popup.css @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/js/tiny_mce/plugins/xhtmlxtras/del.htm b/js/tiny_mce/plugins/xhtmlxtras/del.htm new file mode 100644 index 000000000..5f667510f --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/del.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
        : + + + + + +
        +
        :
        +
        +
        + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        : + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js new file mode 100644 index 000000000..a9393ad6d --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100644 index 000000000..5f9d9bd50 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -0,0 +1,132 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380, + height : 370, + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/js/tiny_mce/plugins/xhtmlxtras/ins.htm b/js/tiny_mce/plugins/xhtmlxtras/ins.htm new file mode 100644 index 000000000..d001ac7c4 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -0,0 +1,162 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
        + + +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
        : + + + + + +
        +
        :
        +
        +
        + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        : + +
        :
        : + +
        : + +
        +
        +
        +
        +
        + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        :
        +
        +
        +
        +
        + + + +
        +
        + + diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/js/tiny_mce/plugins/xhtmlxtras/js/abbr.js new file mode 100644 index 000000000..4b51a2572 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/abbr.js @@ -0,0 +1,28 @@ +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/js/tiny_mce/plugins/xhtmlxtras/js/acronym.js new file mode 100644 index 000000000..6ec2f8871 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/acronym.js @@ -0,0 +1,28 @@ +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js new file mode 100644 index 000000000..9de9c29c9 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -0,0 +1,125 @@ +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value != "") { + dom.setAttrib(elm, attrib.toLowerCase(), value); + + if (attrib == "style") + attrib = "style.cssText"; + + if (attrib.substring(0, 2) == 'on') + value = 'return true;' + value; + + if (attrib == "class") + attrib = "className"; + + elm[attrib]=value; + } else + elm.removeAttribute(attrib); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + 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 insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/cite.js b/js/tiny_mce/plugins/xhtmlxtras/js/cite.js new file mode 100644 index 000000000..009b71546 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/cite.js @@ -0,0 +1,28 @@ +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/del.js b/js/tiny_mce/plugins/xhtmlxtras/js/del.js new file mode 100644 index 000000000..1f957dc78 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -0,0 +1,53 @@ +/** + * del.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('del'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertDel() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/ins.js b/js/tiny_mce/plugins/xhtmlxtras/js/ins.js new file mode 100644 index 000000000..c4addfb01 --- /dev/null +++ b/js/tiny_mce/plugins/xhtmlxtras/js/ins.js @@ -0,0 +1,53 @@ +/** + * ins.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i + + + {#advanced_dlg.about_title} + + + + + + + +
        +
        +

        {#advanced_dlg.about_title}

        +

        Version: ()

        +

        TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

        +

        Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

        +

        For more information about this software visit the TinyMCE website.

        + +
        + Got Moxie? +
        +
        + +
        +
        +

        {#advanced_dlg.about_loaded}

        + +
        +
        + +

         

        +
        +
        + +
        +
        +
        +
        + +
        + +
        + + diff --git a/js/tiny_mce/themes/advanced/anchor.htm b/js/tiny_mce/themes/advanced/anchor.htm new file mode 100644 index 000000000..75c93b799 --- /dev/null +++ b/js/tiny_mce/themes/advanced/anchor.htm @@ -0,0 +1,26 @@ + + + + {#advanced_dlg.anchor_title} + + + + +
        + + + + + + + + +
        {#advanced_dlg.anchor_title}
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/themes/advanced/charmap.htm b/js/tiny_mce/themes/advanced/charmap.htm new file mode 100644 index 000000000..2c3b3f27b --- /dev/null +++ b/js/tiny_mce/themes/advanced/charmap.htm @@ -0,0 +1,51 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + +
        + + + + + + + + + +
         
         
        +
        + + + + + + + + + + + + + + + + +
         
         
         
        +
        + + diff --git a/js/tiny_mce/themes/advanced/color_picker.htm b/js/tiny_mce/themes/advanced/color_picker.htm new file mode 100644 index 000000000..ad1bb0f6c --- /dev/null +++ b/js/tiny_mce/themes/advanced/color_picker.htm @@ -0,0 +1,74 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
        + + +
        +
        +
        + {#advanced_dlg.colorpicker_picker_title} +
        + + +
        + +
        + +
        +
        +
        +
        + +
        +
        + {#advanced_dlg.colorpicker_palette_title} +
        + +
        + +
        +
        +
        + +
        +
        + {#advanced_dlg.colorpicker_named_title} +
        + +
        + +
        + +
        + {#advanced_dlg.colorpicker_name} +
        +
        +
        +
        + +
        + + +
        + +
        + +
        +
        +
        + + diff --git a/js/tiny_mce/themes/advanced/editor_template.js b/js/tiny_mce/themes/advanced/editor_template.js new file mode 100644 index 000000000..4b5b754e3 --- /dev/null +++ b/js/tiny_mce/themes/advanced/editor_template.js @@ -0,0 +1 @@ +(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{}," ")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager;i.setDisabled("undo",!j.undoManager.hasUndo()&&!j.typing);i.setDisabled("redo",!j.undoManager.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/editor_template_src.js b/js/tiny_mce/themes/advanced/editor_template_src.js new file mode 100644 index 000000000..2ab0b5482 --- /dev/null +++ b/js/tiny_mce/themes/advanced/editor_template_src.js @@ -0,0 +1,1360 @@ +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'bottom', + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "center", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx; + + ed.formatter.register(name, { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }); + + ctrl.add(o['class'], name); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = []; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format + matches = ed.formatter.matchAll(formatNames); + if (!name || matches[0] == name) { + if (matches[0]) + ed.formatter.remove(matches[0]); + } else + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name; + + if (val) { + name = 'style_' + (counter++); + + ed.formatter.register(name, { + inline : 'span', + classes : val, + selector : '*' + }); + + ctrl.add(t.editor.translate(key), name); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + + return Event.cancel(e); + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (v.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager; + + cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); + cm.setDisabled('redo', !ed.undoManager.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && p.name); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + } + + if (c = cm.get('formatselect')) { + p = getParent(DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + if (n.getAttribute('data-mce-bogus')) + return; + + // Ignore non element and hidden elements + if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') + + if (v) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/js/tiny_mce/themes/advanced/image.htm b/js/tiny_mce/themes/advanced/image.htm new file mode 100644 index 000000000..b8ba729f6 --- /dev/null +++ b/js/tiny_mce/themes/advanced/image.htm @@ -0,0 +1,80 @@ + + + + {#advanced_dlg.image_title} + + + + + + +
        + + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + +
         
        + x +
        +
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/themes/advanced/img/colorpicker.jpg b/js/tiny_mce/themes/advanced/img/colorpicker.jpg new file mode 100644 index 000000000..b4c542d10 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/colorpicker.jpg differ diff --git a/js/tiny_mce/themes/advanced/img/flash.gif b/js/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 000000000..cb192e6ce Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/flash.gif differ diff --git a/js/tiny_mce/themes/advanced/img/icons.gif b/js/tiny_mce/themes/advanced/img/icons.gif new file mode 100644 index 000000000..e46de5333 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/icons.gif differ diff --git a/js/tiny_mce/themes/advanced/img/iframe.gif b/js/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 000000000..410c7ad08 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/iframe.gif differ diff --git a/js/tiny_mce/themes/advanced/img/pagebreak.gif b/js/tiny_mce/themes/advanced/img/pagebreak.gif new file mode 100644 index 000000000..acdf4085f Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/pagebreak.gif differ diff --git a/js/tiny_mce/themes/advanced/img/quicktime.gif b/js/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 000000000..3b0499145 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/quicktime.gif differ diff --git a/js/tiny_mce/themes/advanced/img/realmedia.gif b/js/tiny_mce/themes/advanced/img/realmedia.gif new file mode 100644 index 000000000..fdfe0b9ac Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/realmedia.gif differ diff --git a/js/tiny_mce/themes/advanced/img/shockwave.gif b/js/tiny_mce/themes/advanced/img/shockwave.gif new file mode 100644 index 000000000..5f235dfc7 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/shockwave.gif differ diff --git a/js/tiny_mce/themes/advanced/img/trans.gif b/js/tiny_mce/themes/advanced/img/trans.gif new file mode 100644 index 000000000..388486517 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/trans.gif differ diff --git a/js/tiny_mce/themes/advanced/img/video.gif b/js/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 000000000..357010407 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/video.gif differ diff --git a/js/tiny_mce/themes/advanced/img/windowsmedia.gif b/js/tiny_mce/themes/advanced/img/windowsmedia.gif new file mode 100644 index 000000000..ab50f2d88 Binary files /dev/null and b/js/tiny_mce/themes/advanced/img/windowsmedia.gif differ diff --git a/js/tiny_mce/themes/advanced/js/about.js b/js/tiny_mce/themes/advanced/js/about.js new file mode 100644 index 000000000..5b3584576 --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/about.js @@ -0,0 +1,73 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
        ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
        ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
        '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/js/tiny_mce/themes/advanced/js/anchor.js b/js/tiny_mce/themes/advanced/js/anchor.js new file mode 100644 index 000000000..e528e4f42 --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/anchor.js @@ -0,0 +1,42 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) + elm.name = name; + else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/js/tiny_mce/themes/advanced/js/charmap.js b/js/tiny_mce/themes/advanced/js/charmap.js new file mode 100644 index 000000000..1cead6dfe --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/charmap.js @@ -0,0 +1,355 @@ +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
        '+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
        '; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/js/tiny_mce/themes/advanced/js/color_picker.js b/js/tiny_mce/themes/advanced/js/color_picker.js new file mode 100644 index 000000000..7decac5b4 --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/color_picker.js @@ -0,0 +1,329 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', + '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', + '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', + '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', + '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', + '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', + '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', + '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', + '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', + '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', + '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', + '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', + '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', + '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' +}; + +var namedLookup = {}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + generateWebColors(); + generateNamedColors(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } + + for (key in named) { + value = named[key]; + namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); + } +} + +function toHexColor(color) { + var matches, red, green, blue, toInt = parseInt; + + function hex(value) { + value = parseInt(value).toString(16); + + return value.length > 1 ? value : '0' + value; // Padd with leading zero + }; + + color = color.replace(/[\s#]+/g, '').toLowerCase(); + color = namedLookup[color] || color; + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); + + if (matches) { + if (matches[1]) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else if (matches[4]) { + red = toInt(matches[4], 16); + green = toInt(matches[5], 16); + blue = toInt(matches[6], 16); + } else if (matches[7]) { + red = toInt(matches[7] + matches[7], 16); + green = toInt(matches[8] + matches[8], 16); + blue = toInt(matches[9] + matches[9], 16); + } + + return '#' + hex(red) + hex(green) + hex(blue); + } + + return ''; +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + tinyMCEPopup.restoreSelection(); + + if (f) + f(toHexColor(color)); + + tinyMCEPopup.close(); +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
        '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
        ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
        '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', 'tinyMCEImageList'); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/js/tiny_mce/themes/advanced/js/link.js b/js/tiny_mce/themes/advanced/js/link.js new file mode 100644 index 000000000..53ff409e7 --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/link.js @@ -0,0 +1,153 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/js/tiny_mce/themes/advanced/js/source_editor.js b/js/tiny_mce/themes/advanced/js/source_editor.js new file mode 100644 index 000000000..84546ad52 --- /dev/null +++ b/js/tiny_mce/themes/advanced/js/source_editor.js @@ -0,0 +1,56 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/js/tiny_mce/themes/advanced/langs/en.js b/js/tiny_mce/themes/advanced/langs/en.js new file mode 100755 index 000000000..0668596df --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/en.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition description",dt:"Definition term ",samp:"Code sample",code:"Code",blockquote:"Blockquote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"Div",paragraph:"Paragraph",block:"Format",fontdefault:"Font family","font_size":"Font size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More colors","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Blockquote","help_desc":"Help","newdocument_desc":"New document","image_props_desc":"Image properties","paste_desc":"Paste","copy_desc":"Copy","cut_desc":"Cut","anchor_desc":"Insert/edit anchor","visualaid_desc":"Toggle guidelines/invisible elements","charmap_desc":"Insert custom character","backcolor_desc":"Select background color","forecolor_desc":"Select text color","custom1_desc":"Your custom description here","removeformat_desc":"Remove formatting","hr_desc":"Insert horizontal ruler","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup messy code","image_desc":"Insert/edit image","unlink_desc":"Unlink","link_desc":"Insert/edit link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Indent","outdent_desc":"Outdent","numlist_desc":"Ordered list","bullist_desc":"Unordered list","justifyfull_desc":"Align full","justifyright_desc":"Align right","justifycenter_desc":"Align center","justifyleft_desc":"Align left","striketrough_desc":"Strikethrough"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/en_dlg.js b/js/tiny_mce/themes/advanced/langs/en_dlg.js new file mode 100755 index 000000000..a9e999a96 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/en_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('en.advanced_dlg',{"link_list":"Link list","link_is_external":"The URL you entered seems to external link, do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open link in a new window","link_target_same":"Open link in the same window","link_target":"Target","link_url":"Link URL","link_title":"Insert/edit link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text bottom","image_align_texttop":"Text top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal space","image_vspace":"Vertical space","image_dimensions":"Dimensions","image_alt":"Image description","image_list":"Image list","image_border":"Border","image_src":"Image URL","image_title":"Insert/edit image","charmap_title":"Select custom character","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a color","code_wordwrap":"Word wrap","code_title":"HTML Source Editor","anchor_name":"Anchor name","anchor_title":"Insert/edit anchor","about_loaded":"Loaded plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/es.js b/js/tiny_mce/themes/advanced/langs/es.js new file mode 100755 index 000000000..b96da6028 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/es.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.advanced',{"underline_desc":"Subrayado (Ctrl+U)","italic_desc":"Cursiva (Ctrl+I)","bold_desc":"Negrita (Ctrl+B)",dd:"Descripci\u00f3n de definici\u00f3n",dt:"T\u00e9rmino de definici\u00f3n",samp:"Ejemplo de c\u00f3digo",code:"C\u00f3digo",blockquote:"Cita",h6:"Encabezado 6",h5:"Encabezado 5",h4:"Encabezado 4",h3:"Encabezado 3",h2:"Encabezado 2",h1:"Encabezado 1",pre:"Preformateado",address:"Direcci\u00f3n",div:"Div",paragraph:"P\u00e1rrafo",block:"Formato",fontdefault:"Fuente","font_size":"Tama\u00f1o","style_select":"Estilos","more_colors":"M\u00e1s colores","toolbar_focus":"Ir a los botones de herramientas - Alt+Q, Ir al editor - Alt-Z, Ir a la ruta del elemento - Alt-X",newdocument:" \u00bfSeguro que desea limpiar todo el contenido?",path:"Ruta","clipboard_msg":"Copiar/Cortar/Pegar no se encuentra disponible en Mozilla y Firefox.\\n \u00bfQuiere m\u00e1s informaci\u00f3n sobre este tema?","blockquote_desc":"Cita","help_desc":"Ayuda","newdocument_desc":"Nuevo documento","image_props_desc":"Propiedades de imagen","paste_desc":"Pegar","copy_desc":"Copiar","cut_desc":"Cortar","anchor_desc":"Insertar/editar ancla","visualaid_desc":"Mostrar/ocultar l\u00ednea de gu\u00eda/elementos invisibles","charmap_desc":"Insertar caracteres personalizados","backcolor_desc":"Elegir color de fondo","forecolor_desc":"Elegir color del texto","custom1_desc":"Su descripci\u00f3n personal aqu\u00ed","removeformat_desc":"Limpiar formato","hr_desc":"Insertar regla horizontal","sup_desc":"Super\u00edndice","sub_desc":"Sub\u00edndice","code_desc":"Editar c\u00f3digo HTML","cleanup_desc":"Limpiar c\u00f3digo basura","image_desc":"Insertar/editar imagen","unlink_desc":"Quitar hiperv\u00ednculo","link_desc":"Insertar/editar hiperv\u00ednculo","redo_desc":"Rehacer (Ctrl+Y)","undo_desc":"Deshacer (Ctrl+Z)","indent_desc":"Aumentar sangr\u00eda","outdent_desc":"Reducir sangr\u00eda","numlist_desc":"Lista ordenada","bullist_desc":"Lista desordenada","justifyfull_desc":"Justificar","justifyright_desc":"Alinear a la derecha","justifycenter_desc":"Alinear al centro","justifyleft_desc":"Alinear a la izquierda","striketrough_desc":"Tachado","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/es_dlg.js b/js/tiny_mce/themes/advanced/langs/es_dlg.js new file mode 100755 index 000000000..b7979317f --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/es_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('es.advanced_dlg',{"link_list":"Lista de hiperv\u00ednculos","link_is_external":"La URL que introdujo parece ser un v\u00ednculo externo, \u00bfdesea agregar el prefijo http:// necesario?","link_is_email":"La URL que introdujo parece ser una direcci\u00f3n de email, \u00bfdesea agregar el prefijo mailto: necesario?","link_titlefield":"T\u00edtulo","link_target_blank":"Abrir v\u00ednculo en una ventana nueva","link_target_same":"Abrir v\u00ednculo en la misma ventana","link_target":"Destino","link_url":"URL del hiperv\u00ednculo","link_title":"Insertar/editar hiperv\u00ednculo","image_align_right":"Derecha","image_align_left":"Izquierda","image_align_textbottom":"Texto debajo","image_align_texttop":"Texto arriba","image_align_bottom":"Debajo","image_align_middle":"Medio","image_align_top":"Arriba","image_align_baseline":"L\u00ednea base","image_align":"Alineaci\u00f3n","image_hspace":"Espacio horizontal","image_vspace":"Espacio vertical","image_dimensions":"Dimensi\u00f3n","image_alt":"Descripci\u00f3n de la Imagen","image_list":"Lista de la Imagen","image_border":"Borde","image_src":"URL de la Imagen","image_title":"Insertar/editar imagen","charmap_title":"Elegir caracter personalizado","colorpicker_name":"Nombre:","colorpicker_color":"Color:","colorpicker_named_title":"Colores nombrados","colorpicker_named_tab":"Nombrados","colorpicker_palette_title":"Paleta de colores","colorpicker_palette_tab":"Paleta","colorpicker_picker_title":"Paleta de color","colorpicker_picker_tab":"Selector","colorpicker_title":"Elegir color","code_wordwrap":"Ajustar al margen","code_title":"Editor del c\u00f3digo fuente HTML","anchor_name":"Nombre del ancla","anchor_title":"Insertar/editar ancla","about_loaded":"Complementos cargados","about_version":"Versi\u00f3n","about_author":"Autor","about_plugin":"Complemento","about_plugins":"Complementos","about_license":"Licencia","about_help":"Ayuda","about_general":"Acerca de ","about_title":"Acerca de TinyMCE","anchor_invalid":"Especifique un nombre v\u00e1lido para liga"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/et.js b/js/tiny_mce/themes/advanced/langs/et.js new file mode 100755 index 000000000..205df1575 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/et.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.advanced',{underline_desc:"Allajoonitud (Ctrl+U)",italic_desc:"Kursiiv (Ctrl+I)",bold_desc:"Rasvane (Ctrl+B)",dd:"Defineeringu kirjeldus",dt:"Defineeringu tingimus",samp:"Koodi n\u00e4ide",code:"Kood",blockquote:"Plokkviide",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Eelformeeritud",address:"Aadress",div:"Div",paragraph:"Paragraaf",block:"Formaat",fontdefault:"Font",font_size:"Fondi suurus",style_select:"Stiilid",more_colors:"Rohkem v\u00e4rve",toolbar_focus:"H\u00fcppa t\u00f6\u00f6riista nuppudele - Alt+Q, H\u00fcppa redigeerijale - Alt-Z, H\u00fcppa elemendi teele - Alt-X",newdocument:"Oled sa kindel, et tahad kustutada k\u00f5ik sisud?",path:"Tee",clipboard_msg:"Kopeeri/L\u00f5ika/Kleebi ei ole Mozillas ja Firefoxis saadaval. Kas soovid rohkem infot selle probleemi kohta?",blockquote_desc:"Plokkviide",help_desc:"Abi",newdocument_desc:"Uus dokument",image_props_desc:"Pildi kirjeldus",paste_desc:"Kleebi",copy_desc:"Kopeeri",cut_desc:"L\u00f5ika",anchor_desc:"Sisesta/redigeeri ankur",visualaid_desc:"L\u00fclita \u00fcmber juhtjooned/n\u00e4htamatud elemendid",charmap_desc:"Sisesta kohandatud kirjam\u00e4rk",backcolor_desc:"Vali tausta v\u00e4rv",forecolor_desc:"Vali teksti v\u00e4rv",custom1_desc:"Teie kohandatud kirjeldus siia",removeformat_desc:"Eemalda vormindus",hr_desc:"Sisesta horisontaalne joonlaud",sup_desc:"\u00dclaindeks",sub_desc:"Alaindeks",code_desc:"Redigeeri HTML l\u00e4htekoodi",cleanup_desc:"Puhasta segane kood",image_desc:"Sisesta/redigeeri pilt",unlink_desc:"Eemalda link",link_desc:"Sisesta/redigeeri link",redo_desc:"Tee uuesti (Ctrl+Y)",undo_desc:"V\u00f5ta tagasi (Ctrl+Z)",indent_desc:"Taanda sisse",outdent_desc:"Taanda v\u00e4lja",numlist_desc:"Korrap\u00e4rane loetelu",bullist_desc:"Ebakorrap\u00e4rane loetelu",justifyfull_desc:"T\u00e4isjoondus",justifyright_desc:"Parem joondus",justifycenter_desc:"Keskjoondus",justifyleft_desc:"Vasak joondus",striketrough_desc:"L\u00e4bijoonitud",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/et_dlg.js b/js/tiny_mce/themes/advanced/langs/et_dlg.js new file mode 100755 index 000000000..329f29b6b --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/et_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('et.advanced_dlg',{link_list:"Lingi loetelu",link_is_external:"URL, mille sisestasite, tundub olevat v\u00e4line link, kas soovite, et lisataks http:// eesliite?",link_is_email:"URL, mille te sisestasite, tundub olevat emaili aadress, kas soovite, et lisataks mailto: eesliite?",link_titlefield:"Tiitel",link_target_blank:"Ava link uues aknas",link_target_same:"Ava link samas aknas",link_target:"Sihtala",link_url:"Link URL",link_title:"Sisesta/redigeeri link",image_align_right:"Parem",image_align_left:"Vasak",image_align_textbottom:"Teksti p\u00f5hi",image_align_texttop:"Teksti tipp",image_align_bottom:"Alumine",image_align_middle:"Keskmine",image_align_top:"\u00dclemine",image_align_baseline:"Kirjajoondus",image_align:"Reastus",image_hspace:"Horisontaalne vahe",image_vspace:"Vertikaalne vahe",image_dimensions:"Dimensioonid",image_alt:"Pildi kirjeldus",image_list:"Pildi loend",image_border:"Raam",image_src:"Pildi URL",image_title:"Sisestal/redigeeri pilt",charmap_title:"Vali kohandatud t\u00e4hem\u00e4rk",colorpicker_name:"Nimi:",colorpicker_color:"V\u00e4rv:",colorpicker_named_title:"Nimetatud v\u00e4rvid",colorpicker_named_tab:"Nimetatud",colorpicker_palette_title:"Palett v\u00e4rvid",colorpicker_palette_tab:"Palett",colorpicker_picker_title:"V\u00e4rvi korjaja",colorpicker_picker_tab:"Korjaja",colorpicker_title:"Vali v\u00e4rv",code_wordwrap:"S\u00f5na pakkimine",code_title:"HTML koodi redaktor",anchor_name:"Ankru nimi",anchor_title:"Sisesta/redigeeri ankur",about_loaded:"Laetud lisad",about_version:"Versioon",about_author:"Autor",about_plugin:"Lisa",about_plugins:"Lisad",about_license:"Litsents",about_help:"Abi",about_general:"Teave",about_title:"Teave TinyMCE kohta"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/fi.js b/js/tiny_mce/themes/advanced/langs/fi.js new file mode 100755 index 000000000..6eb796710 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/fi.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.advanced',{underline_desc:"Alleviivattu (Ctrl+U)",italic_desc:"Kursivoitu (Ctrl+I)",bold_desc:"Lihavoitu (Ctrl+B)",dd:"M\u00e4\u00e4rittelyn kuvaus",dt:"M\u00e4\u00e4rittelyn ehto ",samp:"Koodiesimerkki",code:"Koodi",blockquote:"Pitk\u00e4 lainaus",h6:"Otsikko 6",h5:"Otsikko 5",h4:"Otsikko 4",h3:"Otsikko 3",h2:"Otsikko 2",h1:"Otsikko 1",pre:"Esimuotoiltu (pre)",address:"Osoite",div:"Div",paragraph:"Kappale",block:"Muotoilu",fontdefault:"Kirjasin",font_size:"Kirjasinkoko",style_select:"Tyylit",more_colors:"Enemm\u00e4n v\u00e4rej\u00e4",toolbar_focus:"Siirry ty\u00f6kaluihin - Alt+Q, Siirry tekstieditoriin - Alt-Z, Siirry elementin polkuun - Alt-X",newdocument:"Haluatko varmasti tyhjent\u00e4\u00e4 kaiken sis\u00e4ll\u00f6n?",path:"Polku",clipboard_msg:"Kopioi/Leikkaa/Liit\u00e4 -painikkeet eiv\u00e4t toimi Mozilla ja Firefox -selaimilla. Voit kuitenkin k\u00e4ytt\u00e4\u00e4 n\u00e4pp\u00e4inyhdistelmi\u00e4 kopioimiseen (Ctrl+C), leikkaamiseen (Ctrl+X) ja liitt\u00e4miseen (Ctrl+V). Haluatko lis\u00e4\u00e4 tietoa?",blockquote_desc:"Pitk\u00e4 lainaus",help_desc:"Ohje",newdocument_desc:"Uusi tiedosto",image_props_desc:"Kuvan ominaisuudet",paste_desc:"Liit\u00e4",copy_desc:"Kopioi",cut_desc:"Leikkaa",anchor_desc:"Lis\u00e4\u00e4/Muokkaa ankkuri",visualaid_desc:"Suuntaviivat/N\u00e4kym\u00e4tt\u00f6m\u00e4t elementit",charmap_desc:"Lis\u00e4\u00e4 erikoismerkki",backcolor_desc:"Valitse taustan v\u00e4ri",forecolor_desc:"Valitse tekstin v\u00e4ri",custom1_desc:"Oma kuvauksesi t\u00e4h\u00e4n",removeformat_desc:"Poista muotoilu",hr_desc:"Lis\u00e4\u00e4 vaakasuora viivain",sup_desc:"Yl\u00e4indeksi",sub_desc:"Alaindeksi",code_desc:"Muokkaa HTML-koodia",cleanup_desc:"Siisti sekainen koodi",image_desc:"Lis\u00e4\u00e4/muuta kuva",unlink_desc:"Poista linkki",link_desc:"Lis\u00e4\u00e4/muuta linkki",redo_desc:"Tee uudelleen (Ctrl+Y)",undo_desc:"Peru (Ctrl+Z)",indent_desc:"Sisenn\u00e4",outdent_desc:"Loitonna",numlist_desc:"J\u00e4rjestetty lista",bullist_desc:"J\u00e4rjest\u00e4m\u00e4t\u00f6n lista",justifyfull_desc:"Tasattu",justifyright_desc:"Tasaus oikealle",justifycenter_desc:"Keskitetty",justifyleft_desc:"Tasaus vasemmalle",striketrough_desc:"Yliviivattu",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/fi_dlg.js b/js/tiny_mce/themes/advanced/langs/fi_dlg.js new file mode 100755 index 000000000..3a065f4e9 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/fi_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fi.advanced_dlg',{link_list:"Linkkilista",link_is_external:"Antamasi osoite n\u00e4ytt\u00e4\u00e4 johtavan ulkopuoliselle sivustolle. Haluatko lis\u00e4t\u00e4 linkin eteen http://-etuliitteen? (suositus)",link_is_email:"Antamasi osoite n\u00e4ytt\u00e4\u00e4 olevan s\u00e4hk\u00f6postiosoite. Haluatko lis\u00e4t\u00e4 siihen mailto:-etuliitteen?",link_titlefield:"Otsikko",link_target_blank:"Avaa linkki uuteen ikkunaan",link_target_same:"Avaa linkki samassa ikkunassa",link_target:"Kohde",link_url:"Linkin osoite",link_title:"Lis\u00e4\u00e4/muuta linkki",image_align_right:"Oikealle",image_align_left:"Vasemmalle",image_align_textbottom:"Tekstin alaosaan",image_align_texttop:"Tekstin yl\u00e4osaan",image_align_bottom:"Alas",image_align_middle:"Keskelle",image_align_top:"Yl\u00f6s",image_align_baseline:"Tekstin tasossa",image_align:"Tasaus",image_hspace:"Vaakasuuntainen tila",image_vspace:"Pystysuuntainen tila",image_dimensions:"Mitat",image_alt:"Kuvan kuvaus",image_list:"Kuvalista",image_border:"Reunus",image_src:"Kuvan osoite",image_title:"Lis\u00e4\u00e4/muokkaa kuvaa",charmap_title:"Valitse erikoismerkki",colorpicker_name:"Nimi:",colorpicker_color:"V\u00e4ri:",colorpicker_named_title:"Nimetyt v\u00e4rit",colorpicker_named_tab:"Nimetty",colorpicker_palette_title:"V\u00e4ripaletti",colorpicker_palette_tab:"Paletti",colorpicker_picker_title:"V\u00e4rin valitsin",colorpicker_picker_tab:"Valitsin",colorpicker_title:"Valitse v\u00e4ri",code_wordwrap:"Automaattinen rivinvaihto",code_title:"HTML-koodin muokkaus",anchor_name:"Ankkurin nimi",anchor_title:"Liit\u00e4/muokkaa ankkuria",about_loaded:"Ladatut lis\u00e4osat",about_version:"Versio",about_author:"Kirjoittaja",about_plugin:"Lis\u00e4osa",about_plugins:"Lis\u00e4osat",about_license:"Lisenssi",about_help:"Ohje",about_general:"Tietoja",about_title:"Tietoja TinyMCE:st\u00e4",anchor_invalid:"Ole hyv\u00e4 ja anna hyv\u00e4ksytty ankkurin nimi."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/fr.js b/js/tiny_mce/themes/advanced/langs/fr.js new file mode 100755 index 000000000..23e6e4087 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/fr.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.advanced',{underline_desc:"Soulign\u00e9 (Ctrl+U)",italic_desc:"Italique (Ctrl+I)",bold_desc:"Gras (Ctrl+B)",dd:"D\u00e9finition du terme",dt:"Terme \u00e0 d\u00e9finir",samp:"Exemple de code",code:"Code",blockquote:"Bloc de citation",h6:"Titre 6",h5:"Titre 5",h4:"Titre 4",h3:"Titre 3",h2:"Titre 2",h1:"Titre 1",pre:"Pr\u00e9format\u00e9",address:"Adresse",div:"Div",paragraph:"Paragraphe",block:"Format",fontdefault:"Police",font_size:"Taille police",style_select:"Styles",more_colors:"Plus de couleurs",toolbar_focus:"Atteindre les boutons de l\'\u00e9diteur - Alt+Q, Aller \u00e0 l\'\u00e9diteur - Alt-Z, Aller au chemin de l\'\u00e9l\u00e9ment - Alt-X",newdocument:"\u00cates-vous s\u00fbr de vouloir effacer l\'int\u00e9gralit\u00e9 du document ?",path:"Chemin",clipboard_msg:"Les fonctions Copier/Couper/Coller ne sont pas valables sur Mozilla et Firefox.\\nSouhaitez-vous avoir plus d\'informations sur ce sujet ?",blockquote_desc:"Citation",help_desc:"Aide",newdocument_desc:"Nouveau document",image_props_desc:"Propri\u00e9t\u00e9s de l\'image",paste_desc:"Coller",copy_desc:"Copier",cut_desc:"Couper",anchor_desc:"Ins\u00e9rer / \u00e9diter une ancre",visualaid_desc:"Activer / d\u00e9sactiver les guides et les \u00e9l\u00e9ments invisibles",charmap_desc:"Ins\u00e9rer des caract\u00e8res sp\u00e9ciaux",backcolor_desc:"Choisir la couleur de surlignage",forecolor_desc:"Choisir la couleur du texte",custom1_desc:"Votre description personnalis\u00e9e ici",removeformat_desc:"Supprimer le formatage",hr_desc:"Ins\u00e9rer un trait horizontal",sup_desc:"Exposant",sub_desc:"Indice",code_desc:"\u00c9diter le code source HTML",cleanup_desc:"Nettoyer le code",image_desc:"Ins\u00e9rer / \u00e9diter l\'image",unlink_desc:"Supprimer le lien",link_desc:"Ins\u00e9rer / \u00e9diter le lien",redo_desc:"R\u00e9tablir (Ctrl+Y)",undo_desc:"Annuler (Ctrl+Z)",indent_desc:"Indenter",outdent_desc:"Retirer l\'indentation",numlist_desc:"Liste num\u00e9rot\u00e9e",bullist_desc:"Liste \u00e0 puces",justifyfull_desc:"Justifi\u00e9",justifyright_desc:"Align\u00e9 \u00e0 droite",justifycenter_desc:"Centr\u00e9",justifyleft_desc:"Align\u00e9 \u00e0 gauche",striketrough_desc:"Barr\u00e9",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/fr_dlg.js b/js/tiny_mce/themes/advanced/langs/fr_dlg.js new file mode 100755 index 000000000..6116a5120 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/fr_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('fr.advanced_dlg',{link_list:"Liste de liens",link_is_external:"L\'URL que vous avez saisie semble \u00eatre une adresse web externe. Souhaitez-vous ajouter le pr\u00e9fixe \u00ab http:// \u00bb ?",link_is_email:"L\'URL que vous avez saisie semble \u00eatre une adresse e-mail, souhaitez-vous ajouter le pr\u00e9fixe \u00ab mailto: \u00bb ?",link_titlefield:"Titre",link_target_blank:"Ouvrir dans une nouvelle fen\u00eatre",link_target_same:"Ouvrir dans la m\u00eame fen\u00eatre",link_target:"Cible",link_url:"URL du lien",link_title:"Ins\u00e9rer / \u00e9diter un lien",image_align_right:"Droite (flottant)",image_align_left:"Gauche (flottant)",image_align_textbottom:"Texte en bas",image_align_texttop:"Texte en haut",image_align_bottom:"En bas",image_align_middle:"Au milieu",image_align_top:"En haut",image_align_baseline:"Normal",image_align:"Alignement",image_hspace:"Espacement horizontal",image_vspace:"Espacement vertical",image_dimensions:"Dimensions",image_alt:"Description de l\'image",image_list:"Liste d\'images",image_border:"Bordure",image_src:"URL de l\'image",image_title:"Ins\u00e9rer / \u00e9diter une image",charmap_title:"Choisir le caract\u00e8re \u00e0 ins\u00e9rer",colorpicker_name:"Nom :",colorpicker_color:"Couleur :",colorpicker_named_title:"Couleurs nomm\u00e9es",colorpicker_named_tab:"Noms",colorpicker_palette_title:"Couleurs de la palette",colorpicker_palette_tab:"Palette",colorpicker_picker_title:"Nuancier",colorpicker_picker_tab:"Nuancier",colorpicker_title:"Choisir une couleur",code_wordwrap:"Retour \u00e0 la ligne",code_title:"\u00c9diteur de source HTML",anchor_name:"Nom de l\'ancre",anchor_title:"Ins\u00e9rer / \u00e9diter une ancre",about_loaded:"Plugins charg\u00e9s",about_version:"Version",about_author:"Auteur",about_plugin:"Plugin",about_plugins:"Plugins",about_license:"Licence",about_help:"Aide",about_general:"\u00c0 propos",about_title:"\u00c0 propos de TinyMCE",anchor_invalid:"Veuillez sp\u00e9cifier un nom d\'ancre valide."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/gl.js b/js/tiny_mce/themes/advanced/langs/gl.js new file mode 100755 index 000000000..91d68b40d --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/gl.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.advanced',{underline_desc:"Subli\u00f1ado (Ctrl+U)",italic_desc:"Cursiva (Ctrl+I)",bold_desc:"Negrita (Ctrl+B)",dd:"Descripci\u00f3n de definici\u00f3n",dt:"Termo de definici\u00f3n",samp:"Mostra de c\u00f3digo",code:"C\u00f3digo",blockquote:"Bloque de cita",h6:"Encabezamento 6",h5:"Encabezamento 5",h4:"Encabezamento 4",h3:"Encabezamento 3",h2:"Encabezamento 2",h1:"Encabezamento 1",pre:"Pre-formateado",address:"Enderezo",div:"Div",paragraph:"P\u00e1rrafo",block:"Formato",fontdefault:"Fonte",font_size:"Tama\u00f1o",style_select:"Estilos",more_colors:"M\u00e1is cores",toolbar_focus:"Ir \u00f3s bot\u00f3ns de ferramentas - Alt+Q, Ir \u00f3 editor - Alt-Z, Ir \u00e1 ruta do elemento - Alt-X",newdocument:"\u00bfSeguro que desexa limpar todo o contido?",path:"Ruta",clipboard_msg:"Copiar/Cortar/Pegar non est\u00e1 disponible en Mozilla e Firefox.\n\u00bfDesexa obter mais informaci\u00f3n sobre de este asunto?",blockquote_desc:"Cita",help_desc:"Axuda",newdocument_desc:"Novo documento",image_props_desc:"Propiedades de imaxe",paste_desc:"Pegar",copy_desc:"Copiar",cut_desc:"Cortar",anchor_desc:"Insertar/editar \u00e1ncora",visualaid_desc:"Mostrar/ocultar li\u00f1a de gu\u00eda/elementos invisibres",charmap_desc:"Insertar caracteres persoalizados",backcolor_desc:"Seleccionar cor do fondo",forecolor_desc:"Seleccionar cor do texto",custom1_desc:"A s\u00faa descripci\u00f3n persoal aqu\u00ed",removeformat_desc:"quitar formato",hr_desc:"Insertar regra horizontal",sup_desc:"Super\u00edndice",sub_desc:"Sub\u00edndice",code_desc:"Editar c\u00f3digo HTML",cleanup_desc:"Limpiar lixo no c\u00f3digo",image_desc:"Insertar/editar imaxe",unlink_desc:"Quitar hiperv\u00ednculo",link_desc:"Insertar/editar hiperv\u00ednculo",redo_desc:"Re-facer (Ctrl+Y)",undo_desc:"Desfacer (Ctrl+Z)",indent_desc:"Aumentar sangr\u00eda",outdent_desc:"Reducir sangr\u00eda",numlist_desc:"Lista ordenada",bullist_desc:"Lista desordenada",justifyfull_desc:"Xustificar",justifyright_desc:"Ali\u00f1ar \u00e1 dereita",justifycenter_desc:"Ali\u00f1ar \u00f3 centro",justifyleft_desc:"Ali\u00f1ar \u00e1 esquerda",striketrough_desc:"Tachado",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/gl_dlg.js b/js/tiny_mce/themes/advanced/langs/gl_dlg.js new file mode 100755 index 000000000..4496cdc98 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/gl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('gl.advanced_dlg',{link_list:"Lista de hiperv\u00ednculos",link_is_external:"A URL introducida semella ser un v\u00ednculo externo, \u00bfDesexa engadi-lo prefixo necesario http://?",link_is_email:"A URL introducida semella ser un enderezo de e-mail, \u00bfDesexa engadi-lo prefixo necesario mailto:?",link_titlefield:"T\u00edtulo",link_target_blank:"Abrir v\u00ednculo nunha vent\u00e1 nova",link_target_same:"Abrir v\u00ednculo na mesma vent\u00e1",link_target:"Obxetivo",link_url:"URL do enlace",link_title:"Insertar/editar enlace",image_align_right:"Dereita",image_align_left:"Esquerda",image_align_textbottom:"Texto abaixo",image_align_texttop:"Texto arriba",image_align_bottom:"Abaixo",image_align_middle:"Medio",image_align_top:"Arriba",image_align_baseline:"Li\u00f1a base",image_align:"Ali\u00f1aci\u00f3n",image_hspace:"Espacio horizontal",image_vspace:"Espacio vertical",image_dimensions:"Dimensi\u00f3n",image_alt:"Descripci\u00f3n da imaxe",image_list:"Lista de Imaxes",image_border:"Borde",image_src:"URL da imaxe",image_title:"Insertar/editar imaxe",charmap_title:"Seleccionar caracter personalizado",colorpicker_name:"Nome:",colorpicker_color:"Cor:",colorpicker_named_title:"Cores nomeados",colorpicker_named_tab:"Nomeados",colorpicker_palette_title:"Paleta de cores",colorpicker_palette_tab:"Paleta",colorpicker_picker_title:"Selector de cores",colorpicker_picker_tab:"Selector",colorpicker_title:"Seleccionar cor",code_wordwrap:"Cortar li\u00f1as autom\u00e1ticamente",code_title:"Editor HTML",anchor_name:"Nome da \u00e1ncora",anchor_title:"Insertar/editar \u00e1ncora",about_loaded:"Comprementos cargados",about_version:"Versi\u00f3n",about_author:"Autor",about_plugin:"Compremento",about_plugins:"Comprementos",about_license:"Licencia",about_help:"Axuda",about_general:"Sobre",about_title:"Sobre TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/he.js b/js/tiny_mce/themes/advanced/langs/he.js new file mode 100755 index 000000000..a8ed68c02 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/he.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.advanced',{underline_desc:"\u05e7\u05d5 \u05ea\u05d7\u05ea\u05d5\u05df (Ctrl+U)",italic_desc:"\u05e0\u05d8\u05d5\u05d9 (Ctrl+I)",bold_desc:"\u05de\u05d5\u05d3\u05d2\u05e9 (Ctrl+B)",dd:"\u05d4\u05d2\u05d3\u05e8\u05ea \u05d4\u05de\u05d5\u05e9\u05d2",dt:"\u05de\u05d5\u05e9\u05d2",samp:"\u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3",code:"\u05e7\u05d5\u05d3",blockquote:"\u05e6\u05d9\u05d8\u05d5\u05d8 \u05e7\u05d8\u05e2",h6:"\u05db\u05d5\u05ea\u05e8\u05ea 6",h5:"\u05db\u05d5\u05ea\u05e8\u05ea 5",h4:"\u05db\u05d5\u05ea\u05e8\u05ea 4",h3:"\u05db\u05d5\u05ea\u05e8\u05ea 3",h2:"\u05db\u05d5\u05ea\u05e8\u05ea 2",h1:"\u05db\u05d5\u05ea\u05e8\u05ea 1",pre:"Preformatted",address:"\u05db\u05ea\u05d5\u05d1\u05ea",div:"Div",paragraph:"\u05e4\u05e1\u05e7\u05d4",block:"\u05e2\u05d9\u05e6\u05d5\u05d1",fontdefault:"\u05d2\u05d5\u05e4\u05df",font_size:"\u05d2\u05d5\u05d3\u05dc \u05d2\u05d5\u05e4\u05df",style_select:"\u05e1\u05d2\u05e0\u05d5\u05e0\u05d5\u05ea",more_colors:"\u05e2\u05d5\u05d3 \u05e6\u05d1\u05e2\u05d9\u05dd",toolbar_focus:"\u05d4\u05e2\u05d1\u05e8\u05d4 \u05dc\u05e1\u05e8\u05d2\u05dc \u05d4\u05db\u05dc\u05d9\u05dd - Alt+Q, \u05d4\u05e2\u05d1\u05e8\u05d4 \u05dc\u05de\u05e2\u05d1\u05d3 \u05ea\u05de\u05dc\u05d9\u05dc\u05d9\u05dd - Alt-Z, \u05d4\u05e2\u05d1\u05e8\u05d4 \u05dc\u05e0\u05ea\u05d9\u05d1 \u05d4\u05d0\u05dc\u05de\u05d8\u05d9\u05dd - Alt-X",newdocument:"\u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05de\u05d7\u05d5\u05e7 \u05d0\u05ea \u05db\u05dc \u05d4\u05ea\u05d5\u05db\u05df?",path:"path",clipboard_msg:"\u05d4\u05e2\u05ea\u05e7/\u05d2\u05d6\u05d5\u05e8/\u05d4\u05d3\u05d1\u05e7 \u05dc\u05d0 \u05d6\u05de\u05d9\u05e0\u05d9\u05dd \u05d1 Mozilla \u05d5\u05d1-Firefox.\n \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05e7\u05d1\u05dc \u05de\u05d9\u05d3\u05e2 \u05e0\u05d5\u05e1\u05e3 \u05e2\u05dc \u05d4\u05e0\u05d5\u05e9\u05d0?",blockquote_desc:"\u05e6\u05d9\u05d8\u05d5\u05d8",help_desc:"\u05e2\u05d6\u05e8\u05d4",newdocument_desc:"\u05de\u05e1\u05de\u05da \u05d7\u05d3\u05e9",image_props_desc:"\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9 \u05d4\u05ea\u05de\u05d5\u05e0\u05d4",paste_desc:"\u05d4\u05d3\u05d1\u05e7\u05d4",copy_desc:"\u05d4\u05e2\u05ea\u05e7\u05d4",cut_desc:"\u05d2\u05d6\u05d9\u05e8\u05d4",anchor_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4",visualaid_desc:"\u05d4\u05e6\u05d2\u05d4 \u05d0\u05d5 \u05d4\u05e1\u05ea\u05e8\u05d4 \u05e9\u05dc \u05e1\u05d9\u05de\u05d5\u05e0\u05d9 \u05e2\u05d9\u05e6\u05d5\u05d1",charmap_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05e1\u05d9\u05de\u05df",backcolor_desc:"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2 \u05e8\u05e7\u05e2",forecolor_desc:"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2 \u05d2\u05d5\u05e4\u05df",custom1_desc:"\u05d4\u05ea\u05d0\u05d5\u05e8 \u05e9\u05dc\u05da \u05db\u05d0\u05d5",removeformat_desc:"\u05d4\u05e1\u05e8\u05ea \u05e2\u05d9\u05e6\u05d5\u05d1",hr_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea \u05e7\u05d5 \u05de\u05e4\u05e8\u05d9\u05d3",sup_desc:"\u05db\u05ea\u05d1 \u05ea\u05d7\u05ea\u05d9",sub_desc:"\u05db\u05ea\u05d1 \u05e2\u05d9\u05dc\u05d9",code_desc:"\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d5\u05d3 HTML",cleanup_desc:"\u05e0\u05d9\u05e7\u05d5\u05d9 \u05e7\u05d5\u05d3",image_desc:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05d3\u05e3 \u05ea\u05de\u05d5\u05e0\u05d4",unlink_desc:"\u05d4\u05e1\u05e8\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",link_desc:"\u05d4\u05d5\u05e1\u05e4\u05ea/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",redo_desc:"\u05d7\u05d6\u05e8\u05d4 \u05e2\u05dc \u05e4\u05e2\u05d5\u05dc\u05d4 (Ctrl+Y)",undo_desc:"\u05d1\u05d9\u05d8\u05d5\u05dc \u05e4\u05e2\u05d5\u05dc\u05d4 (Ctrl+Z)",indent_desc:"\u05d4\u05e7\u05d8\u05e0\u05ea \u05db\u05e0\u05d9\u05e1\u05d4",outdent_desc:"\u05d4\u05d2\u05d3\u05dc\u05ea \u05db\u05e0\u05d9\u05e1\u05d4",numlist_desc:"\u05de\u05e1\u05e4\u05d5\u05e8",bullist_desc:"\u05ea\u05d1\u05dc\u05d9\u05d8\u05d9\u05dd",justifyfull_desc:"\u05d9\u05d9\u05e9\u05d5\u05e8 \u05dc\u05e9\u05e0\u05d9 \u05d4\u05e6\u05d3\u05d3\u05d9\u05dd",justifyright_desc:"\u05d9\u05d9\u05e9\u05d5\u05e8 \u05d8\u05e7\u05e1\u05d8 \u05dc\u05d9\u05de\u05d9\u05df",justifycenter_desc:"\u05de\u05d9\u05e8\u05db\u05d5\u05d6 \u05d8\u05e7\u05e1\u05d8",justifyleft_desc:"\u05d9\u05d9\u05e9\u05d5\u05e8 \u05d8\u05e7\u05e1\u05d8 \u05dc\u05e9\u05de\u05d0\u05dc",striketrough_desc:"\u05e7\u05d5 \u05d7\u05d5\u05e6\u05d4",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/he_dlg.js b/js/tiny_mce/themes/advanced/langs/he_dlg.js new file mode 100755 index 000000000..13dbc3562 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/he_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('he.advanced_dlg',{link_list:"\u05e8\u05e9\u05d9\u05de\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd",link_is_external:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d7\u05d9\u05e6\u05d5\u05e0\u05d9 \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea http:// \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?",link_is_email:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4-URL \u05e9\u05d4\u05d5\u05db\u05e0\u05e1\u05d4 \u05d4\u05d9\u05d0 \u05db\u05db\u05dc \u05d4\u05e0\u05e8\u05d0\u05d4 \u05db\u05ea\u05d5\u05d1\u05ea \u05de\u05d9\u05d9\u05dc \u05d4\u05d0\u05dd \u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05d4\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4\u05e7\u05d9\u05d3\u05d5\u05de\u05ea MAILTO \u05d4\u05e0\u05d3\u05e8\u05e9\u05ea?",link_titlefield:"\u05db\u05d5\u05ea\u05e8\u05ea",link_target_blank:"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d7\u05dc\u05d5\u05df \u05d7\u05d3\u05e9",link_target_same:"\u05e4\u05ea\u05d7 \u05e7\u05d9\u05e9\u05d5\u05e8 \u05d1\u05d0\u05d5\u05ea\u05d5 \u05d7\u05dc\u05d5\u05df",link_target:"\u05d9\u05e2\u05d3",link_url:"\u05db\u05ea\u05d5\u05d1\u05ea \u05d4\u05e7\u05d9\u05e9\u05d5\u05e8",link_title:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e7\u05d9\u05e9\u05d5\u05e8",image_align_right:"\u05d9\u05de\u05d9\u05df",image_align_left:"\u05e9\u05de\u05d0\u05dc",image_align_textbottom:"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8",image_align_texttop:"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df \u05e9\u05dc \u05d4\u05d8\u05e7\u05e1\u05d8",image_align_bottom:"\u05e7\u05e6\u05d4 \u05d4\u05ea\u05d7\u05ea\u05d5\u05df",image_align_middle:"\u05d0\u05de\u05e6\u05e2",image_align_top:"\u05e7\u05e6\u05d4 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df",image_align_baseline:"\u05e7\u05d5 \u05d4\u05d4\u05ea\u05d7\u05dc\u05d4",image_align:"\u05d9\u05d9\u05e9\u05d5\u05e8",image_hspace:"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05d5\u05e4\u05e7\u05d9",image_vspace:"\u05e8\u05d5\u05d5\u05d7 \u05d0\u05e0\u05db\u05d9",image_dimensions:"\u05d2\u05d5\u05d3\u05dc",image_alt:"\u05ea\u05d9\u05d0\u05d5\u05e8",image_list:"\u05e8\u05e9\u05d9\u05de\u05d4",image_border:"\u05d2\u05d1\u05d5\u05dc",image_src:"\u05db\u05ea\u05d5\u05d1\u05ea:",image_title:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05ea\u05de\u05d5\u05e0\u05d4",charmap_title:"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e1\u05d9\u05de\u05df",colorpicker_name:"\u05e9\u05dd:",colorpicker_color:"\u05e6\u05d1\u05e2:",colorpicker_named_title:"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea",colorpicker_named_tab:"\u05e6\u05d1\u05e2\u05d9\u05dd \u05d1\u05e2\u05dc\u05d9 \u05e9\u05de\u05d5\u05ea",colorpicker_palette_title:"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd",colorpicker_palette_tab:"\u05dc\u05d5\u05d7 \u05e6\u05d1\u05e2\u05d9\u05dd",colorpicker_picker_title:"\u05d1\u05d5\u05e8\u05e8 \u05d4\u05e6\u05d1\u05e2\u05d9\u05dd",colorpicker_picker_tab:"\u05d1\u05d5\u05e8\u05e8",colorpicker_title:"\u05d1\u05d7\u05d9\u05e8\u05ea \u05e6\u05d1\u05e2",code_wordwrap:"\u05d2\u05dc\u05d9\u05e9\u05ea \u05d8\u05e7\u05e1\u05d8",code_title:"\u05e2\u05d5\u05e8\u05da \u05d4-HTML",anchor_name:"\u05e9\u05dd \u05d4\u05e1\u05d9\u05de\u05e0\u05d9\u05d4",anchor_title:"\u05d4\u05d5\u05e1\u05e4\u05d4/\u05e2\u05e8\u05d9\u05db\u05ea \u05e1\u05d9\u05de\u05e0\u05d9\u05d4",about_loaded:"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea",about_version:"\u05d2\u05d9\u05e8\u05e1\u05d4",about_author:"\u05d9\u05d5\u05e6\u05e8",about_plugin:"\u05ea\u05d5\u05e1\u05e4\u05ea",about_plugins:"\u05ea\u05d5\u05e1\u05e4\u05d5\u05ea",about_license:"\u05e8\u05e9\u05d9\u05d5\u05df",about_help:"\u05e2\u05d6\u05e8\u05d4",about_general:"\u05d0\u05d5\u05d3\u05d5\u05ea",about_title:"\u05d0\u05d5\u05d3\u05d5\u05ea TinyMCE",anchor_invalid:"\u05e0\u05d0 \u05dc\u05e6\u05d9\u05d9\u05df \u05e9\u05dd \u05d7\u05d5\u05e7\u05d9"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/hu.js b/js/tiny_mce/themes/advanced/langs/hu.js new file mode 100755 index 000000000..9d731b6ce --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/hu.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.advanced',{"underline_desc":"Al\u00e1h\u00fazott (Ctrl+U)","italic_desc":"D\u0151lt (Ctrl+I)","bold_desc":"F\u00e9lk\u00f6v\u00e9r (Ctrl+B)",dd:"Defin\u00edci\u00f3 a defin\u00edci\u00f3s list\u00e1ban",dt:"Defini\u00e1lt kifejez\u00e9s a defin\u00edci\u00f3s list\u00e1ban",samp:"K\u00f3d minta",code:"K\u00f3d",blockquote:"Id\u00e9zet",h6:"C\u00edmsor 6",h5:"C\u00edmsor 5",h4:"C\u00edmsor 4",h3:"C\u00edmsor 3",h2:"C\u00edmsor 2",h1:"C\u00edmsor 1",pre:"El\u0151form\u00e1zott",address:"C\u00edm",div:"Div",paragraph:"Bekezd\u00e9s",block:"Form\u00e1tum",fontdefault:"Bet\u0171t\u00edpus","font_size":"Bet\u0171m\u00e9ret","style_select":"St\u00edlusok","more_colors":"T\u00f6bb sz\u00edn","toolbar_focus":"Eszk\u00f6zgombokra ugr\u00e1s - Alt+Q, Szerkeszt\u0151h\u00f6z ugr\u00e1s - Alt-Z, Elem\u00fatvonalhoz ugr\u00e1s - Alt-X",newdocument:"Biztosan t\u00f6rli az eddigi tartalmat?",path:"\u00datvonal","clipboard_msg":"A M\u00e1sol\u00e1s/Kiv\u00e1g\u00e1s/Besz\u00far\u00e1s funkci\u00f3k nem \u00e9rhet\u0151ek el Mozilla \u00e9s Firefox alatt. K\u00edv\u00e1n t\u00f6bbet tudni err\u0151l a t\u00e9m\u00e1r\u00f3l?","blockquote_desc":"Id\u00e9zet","help_desc":"Seg\u00edts\u00e9g","newdocument_desc":"\u00daj dokumentum","image_props_desc":"K\u00e9p tulajdons\u00e1gai","paste_desc":"Besz\u00far\u00e1s","copy_desc":"M\u00e1sol\u00e1s","cut_desc":"Kiv\u00e1g\u00e1s","anchor_desc":"Horgony besz\u00far\u00e1sa/szerkeszt\u00e9se","visualaid_desc":"Vezet\u0151vonalak/nem l\u00e1that\u00f3 elemek ki-/bekapcsol\u00e1sa","charmap_desc":"Speci\u00e1lis karakter besz\u00far\u00e1sa","backcolor_desc":"H\u00e1tt\u00e9rsz\u00edn v\u00e1laszt\u00e1sa","forecolor_desc":"Sz\u00f6vegsz\u00edn v\u00e1laszt\u00e1sa","custom1_desc":"Az \u00f6n egyedi le\u00edr\u00e1sa","removeformat_desc":"Form\u00e1z\u00e1s elt\u00e1vol\u00edt\u00e1sa","hr_desc":"V\u00edzszintes elv\u00e1laszt\u00f3 besz\u00far\u00e1sa","sup_desc":"Fels\u0151 index","sub_desc":"Als\u00f3 index","code_desc":"HTML forr\u00e1s szerkeszt\u00e9se","cleanup_desc":"Rendetlen k\u00f3d takar\u00edt\u00e1sa","image_desc":"K\u00e9p besz\u00far\u00e1sa/szerkeszt\u00e9se","unlink_desc":"Link megsz\u00fcntet\u00e9se","link_desc":"Link besz\u00far\u00e1sa/szerkeszt\u00e9se","redo_desc":"M\u00e9gis v\u00e9grehajt (Ctrl+Y)","undo_desc":"Visszavon\u00e1s (Ctrl+Z)","indent_desc":"Beh\u00faz\u00e1s n\u00f6vel\u00e9se","outdent_desc":"Beh\u00faz\u00e1s cs\u00f6kkent\u00e9se","numlist_desc":"Rendezett lista","bullist_desc":"Rendezetlen lista","justifyfull_desc":"Sorkiz\u00e1rt","justifyright_desc":"Jobbra z\u00e1rt","justifycenter_desc":"K\u00f6z\u00e9pre z\u00e1rt","justifyleft_desc":"Balra z\u00e1rt","striketrough_desc":"\u00c1th\u00fazott","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/hu_dlg.js b/js/tiny_mce/themes/advanced/langs/hu_dlg.js new file mode 100755 index 000000000..3da818a0d --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/hu_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('hu.advanced_dlg',{"link_list":"Link lista","link_is_external":"A be\u00edrt URL k\u00fcls\u0151 hivatkoz\u00e1snak t\u0171nik, k\u00edv\u00e1nja a sz\u00fcks\u00e9ges http://-vel kieg\u00e9sz\u00edteni?","link_is_email":"A be\u00edrt URL e-mail c\u00edmnek t\u0171nik, k\u00edv\u00e1nja a sz\u00fcks\u00e9ges mailto:-val kieg\u00e9sz\u00edteni?","link_titlefield":"C\u00edm","link_target_blank":"Link \u00faj ablakba nyit\u00e1sa","link_target_same":"Link azonos ablakba nyit\u00e1sa","link_target":"Target","link_url":"Link URL","link_title":"Link besz\u00far\u00e1sa/szerkeszt\u00e9se","image_align_right":"Jobbra","image_align_left":"Balra","image_align_textbottom":"Sz\u00f6veg alj\u00e1hoz","image_align_texttop":"Sz\u00f6veg tetej\u00e9hez","image_align_bottom":"Lentre","image_align_middle":"K\u00f6z\u00e9pre","image_align_top":"Fentre","image_align_baseline":"Alapvonalhoz","image_align":"Igaz\u00edt\u00e1s","image_hspace":"V\u00edzszintes t\u00e1v","image_vspace":"F\u00fcgg\u0151leges t\u00e1v","image_dimensions":"M\u00e9retek","image_alt":"K\u00e9p le\u00edr\u00e1s","image_list":"K\u00e9p lista","image_border":"Keret","image_src":"K\u00e9p URL","image_title":"K\u00e9p besz\u00far\u00e1sa/szerkeszt\u00e9se","charmap_title":"Egyedi karakter v\u00e1laszt\u00e1sa","colorpicker_name":"N\u00e9v:","colorpicker_color":"Sz\u00edn:","colorpicker_named_title":"Elnevezett sz\u00ednek","colorpicker_named_tab":"Elnevezettek","colorpicker_palette_title":"Paletta sz\u00ednek","colorpicker_palette_tab":"Paletta","colorpicker_picker_title":"Sz\u00ednv\u00e1laszt\u00f3","colorpicker_picker_tab":"V\u00e1laszt\u00f3","colorpicker_title":"Sz\u00ednv\u00e1laszt\u00e1s","code_wordwrap":"Sz\u00f6veg t\u00f6rdel\u00e9se","code_title":"HTML forr\u00e1s szerkeszt\u00e9se","anchor_name":"Horgonyn\u00e9v","anchor_title":"Horgony besz\u00far\u00e1sa/szerkeszt\u00e9se","about_loaded":"Bet\u00f6lt\u00f6tt pluginok","about_version":"Verzi\u00f3","about_author":"Szerz\u0151","about_plugin":"Plugin","about_plugins":"Pluginok","about_license":"Licenc","about_help":"Seg\u00edts\u00e9g","about_general":"R\u00f3lunk","about_title":"A TinyMCE-r\u0151l","anchor_invalid":"Adjon meg egy helyes horgony nevet."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/id.js b/js/tiny_mce/themes/advanced/langs/id.js new file mode 100755 index 000000000..f91c64106 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/id.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.advanced',{underline_desc:"Underline (Ctrl+U)",italic_desc:"Italic (Ctrl+I)",bold_desc:"Bold (Ctrl+B)",dd:"Definition description",dt:"Definition term ",samp:"Code sample",code:"Code",blockquote:"Blockquote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"Div",paragraph:"Paragraph",block:"Format",fontdefault:"Font family",font_size:"Font size",style_select:"Styles",more_colors:"More colors",toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Yakin untuk menghapus semua konten?",path:"Path",clipboard_msg:"Copy/Cut/Paste tidak tersedia pada Mozilla dan Firefox.\\nButuh info selengkapnya?",blockquote_desc:"Blockquote",help_desc:"Help",newdocument_desc:"New document",image_props_desc:"Image properties",paste_desc:"Paste",copy_desc:"Copy",cut_desc:"Cut",anchor_desc:"Insert/edit anchor",visualaid_desc:"Toggle guidelines/invisible elements",charmap_desc:"Insert custom character",backcolor_desc:"Pilih background color",forecolor_desc:"Pilih text color",custom1_desc:"Deskripsi disini",removeformat_desc:"Remove formatting",hr_desc:"Insert horizontal ruler",sup_desc:"Superscript",sub_desc:"Subscript",code_desc:"Edit HTML Source",cleanup_desc:"Cleanup messy code",image_desc:"Insert/edit image",unlink_desc:"Unlink",link_desc:"Insert/edit link",redo_desc:"Redo (Ctrl+Y)",undo_desc:"Undo (Ctrl+Z)",indent_desc:"Indent",outdent_desc:"Outdent",numlist_desc:"Ordered list",bullist_desc:"Unordered list",justifyfull_desc:"Align full",justifyright_desc:"Align right",justifycenter_desc:"Align center",justifyleft_desc:"Align left",striketrough_desc:"Strikethrough",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/id_dlg.js b/js/tiny_mce/themes/advanced/langs/id_dlg.js new file mode 100755 index 000000000..5cb66e397 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/id_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('id.advanced_dlg',{link_list:"Daftar Link",link_is_external:"URL yang Anda sisipkan tampaknya link eksternal, Anda ingin menambahkan awalan \'http://\'?",link_is_email:"URL yang Anda sisipkan tampaknya e-mail, Anda ingin menambahkan awalan \'mailto:\'?",link_titlefield:"Judul",link_target_blank:"Buka link pada window baru",link_target_same:"Buka link pada window yang sama",link_target:"Target",link_url:"Link URL",link_title:"Insert/edit link",image_align_right:"Right",image_align_left:"Left",image_align_textbottom:"Text bottom",image_align_texttop:"Text top",image_align_bottom:"Bottom",image_align_middle:"Middle",image_align_top:"Top",image_align_baseline:"Baseline",image_align:"Alignment",image_hspace:"Horizontal space",image_vspace:"Vertical space",image_dimensions:"Dimensions",image_alt:"Image description",image_list:"Image list",image_border:"Border",image_src:"Image URL",image_title:"Insert/edit image",charmap_title:"Pilih custom character",colorpicker_name:"Name:",colorpicker_color:"Color:",colorpicker_named_title:"Named colors",colorpicker_named_tab:"Named",colorpicker_palette_title:"Palette colors",colorpicker_palette_tab:"Palette",colorpicker_picker_title:"Color picker",colorpicker_picker_tab:"Picker",colorpicker_title:"Select a color",code_wordwrap:"Word wrap",code_title:"HTML Source Editor",anchor_name:"Anchor name",anchor_title:"Insert/edit anchor",about_loaded:"Loaded plugins",about_version:"Versi",about_author:"Penulis",about_plugin:"Plugin",about_plugins:"Plugins",about_license:"Lisensi",about_help:"Bantuan",about_general:"Tentang",about_title:"Tentang TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/it.js b/js/tiny_mce/themes/advanced/langs/it.js new file mode 100755 index 000000000..d77ffb117 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/it.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.advanced',{underline_desc:"Sottolineato (Ctrl+U)",italic_desc:"Corsivo (Ctrl+I)",bold_desc:"Grassetto (Ctrl+B)",dd:"Descrizione definizione",dt:"Termine definizione",samp:"Esempio codice",code:"Codice",blockquote:"Testo quotato",h6:"Intestazione 6",h5:"Intestazione 5",h4:"Intestazione 4",h3:"Intestazione 3",h2:"Intestazione 2",h1:"Intestazione 1",pre:"Preformattato",address:"Indirizzo",div:"Div",paragraph:"Paragrafo",block:"Formato",fontdefault:"Famiglia carattere",font_size:"Grandezza carattere",style_select:"Stili",more_colors:"Colori aggiuntivi",toolbar_focus:"Vai ai pulsanti strumento - Alt+Q, Vai all\'editor - Alt-Z, Vai al percorso dell\'elemento - Alt-X",newdocument:"Sei sicuro di voler cancellare tutti i contenuti?",path:"Percorso",clipboard_msg:"Copia/Taglia/Incolla non \u00e8 disponibile in Mozilla e Firefox..\nSi desidera avere maggiori informazioni su questo problema?",blockquote_desc:"Testo quotato",help_desc:"Aiuto",newdocument_desc:"Nuovo documento",image_props_desc:"Propriet\u00e0 immagine",paste_desc:"Incolla",copy_desc:"Copia",cut_desc:"Taglia",anchor_desc:"Inserisci/modifica ancora",visualaid_desc:"Mostra/nascondi linee guida/elementi invisibili",charmap_desc:"Inserisci carattere speciale",backcolor_desc:"Seleziona colore sfondo",forecolor_desc:"Seleziona colore testo",custom1_desc:"La tua descrizione personalizzata qui",removeformat_desc:"Rimuovi formattazione",hr_desc:"Inserisci riga orizzontale",sup_desc:"Apice",sub_desc:"Pedice",code_desc:"Modifica sorgente HTML",cleanup_desc:"Pulisci codice disordinato",image_desc:"Inserisci/modifica immagine",unlink_desc:"Togli collegamento",link_desc:"Inserisci/modifica collegamento",redo_desc:"Ripristina (Ctrl+Y)",undo_desc:"Annulla (Ctrl+Z)",indent_desc:"Sposta verso interno",outdent_desc:"Sposta verso esterno",numlist_desc:"Lista ordinata",bullist_desc:"Lista non ordinata",justifyfull_desc:"Giustifica",justifyright_desc:"Allinea a destra",justifycenter_desc:"Centra",justifyleft_desc:"Allinea a sinistra",striketrough_desc:"Barrato",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/it_dlg.js b/js/tiny_mce/themes/advanced/langs/it_dlg.js new file mode 100755 index 000000000..1d3f96710 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/it_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('it.advanced_dlg',{link_list:"Lista link",link_is_external:"L\'URL inserito sembra essere un link esterno. Aggiungere il necessario prefisso http:// ?",link_is_email:"L\'URL inserito sembra essere un indirizzo email. Aggiungere il necessario prefisso mailto: ?",link_titlefield:"Titolo",link_target_blank:"Apri link in una nuova finestra",link_target_same:"Apri link nella stessa finestra",link_target:"Target",link_url:"URL link",link_title:"Inserisci/modifica collegamento",image_align_right:"A destra",image_align_left:"A sinistra",image_align_textbottom:"In basso al testo",image_align_texttop:"In alto al testo",image_align_bottom:"In basso",image_align_middle:"In mezzo",image_align_top:"In alto",image_align_baseline:"Alla base",image_align:"Allineamentot",image_hspace:"Spaziatura orizz.",image_vspace:"Spaziatura vert.",image_dimensions:"Dimensioni",image_alt:"Descrizione",image_list:"Lista immagini",image_border:"Bordo",image_src:"URL immagine",image_title:"Inserisci/modifica immagine",charmap_title:"Seleziona carattere speciale",colorpicker_name:"Nome:",colorpicker_color:"Colore:",colorpicker_named_title:"Colori per nome",colorpicker_named_tab:"Per nome",colorpicker_palette_title:"Tavolozza dei colori",colorpicker_palette_tab:"Tavolozza",colorpicker_picker_title:"Selettore colori",colorpicker_picker_tab:"Selettore",colorpicker_title:"Seleziona un colore",code_wordwrap:"A capo automatico",code_title:"Editor sorgente HTML",anchor_name:"Nome ancora",anchor_title:"Inserisci/modifica ancora",about_loaded:"Plugin caricati",about_version:"Versione",about_author:"Autore",about_plugin:"Plugin",about_plugins:"Plugins",about_license:"Licenza",about_help:"Aiuto",about_general:"Informazioni",about_title:"Informazioni su TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/lt.js b/js/tiny_mce/themes/advanced/langs/lt.js new file mode 100755 index 000000000..dcaaefdec --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/lt.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.advanced',{underline_desc:"Pabrauktas (Ctrl+U)",italic_desc:"Kursyvas (Ctrl+I)",bold_desc:"Pusjuodis (Ctrl+B)",dd:"Apibr\u0117\u017eimo apra\u0161as",dt:"Apibr\u0117\u017eimo terminas",samp:"Kodo pavyzdys",code:"Kodas",blockquote:"Citatos blokas",h6:"Antra\u0161t\u0117 6",h5:"Antra\u0161t\u0117 5",h4:"Antra\u0161t\u0117 4",h3:"Antra\u0161t\u0117 3",h2:"Antra\u0161t\u0117 2",h1:"Antra\u0161t\u0117 1",pre:"I\u0161 anksto formatuotas",address:"Adresas",div:"Div \u017eym\u0117",paragraph:"Paragrafas",block:"Formatas",fontdefault:"\u0160rifto \u0161eima",font_size:"\u0160rifto dydis",style_select:"Stiliai",link_delta_width:"70",more_colors:"Daugiau spalv\u0173",toolbar_focus:"Per\u0161okimas prie \u012franki\u0173 juostos mygtuk\u0173 - Alt+Q, Per\u0161okimas prie redaktoriaus - Alt-Z, Per\u0161okimas prie element\u0173 kelio - Alt-X",newdocument:"Ar tikrai norite i\u0161valyti vis\u0105 turin\u012f?",path:"Kelias",clipboard_msg:"Kopijavimas/I\u0161kirpimas/\u012ed\u0117jimas negalimas Mozilla ir Firefox nar\u0161ykl\u0117se.\nAr norite daugiau informacijos apie \u0161i\u0105 problem\u0105?",blockquote_desc:"Citatos blokas",help_desc:"Pagalba",newdocument_desc:"Naujas dokumentas",image_props_desc:"Paveiksl\u0117lio nustatymai",paste_desc:"\u012ed\u0117ti",copy_desc:"Kopijuoti",cut_desc:"I\u0161kirpti",anchor_desc:"\u012eterpti/redaguoti prierai\u0161\u0105",visualaid_desc:"Kaitalioti gaires/nematom\u0173 element\u0173 rodym\u0105",charmap_desc:"\u012eterpti nestandartin\u012f simbol\u012f",backcolor_desc:"Parinkti fono spalv\u0105",forecolor_desc:"Parinkti teksto spalv\u0105",custom1_desc:"J\u016bs\u0173 apra\u0161as \u010dia",removeformat_desc:"Pa\u0161alinti formatavim\u0105",hr_desc:"\u012eterpti horizontali\u0105 linij\u0105",sup_desc:"Vir\u0161utinis indeksas",sub_desc:"Apatinis indeksas",code_desc:"Redaguoti HTML i\u0161eities kod\u0105",cleanup_desc:"I\u0161valyti netvarking\u0105 kod\u0105",image_desc:"\u012eterpti/redaguoti paveiksl\u0117l\u012f",unlink_desc:"Pa\u0161alinti nuorod\u0105",link_desc:"\u012eterpti/redaguoti nuorod\u0105",redo_desc:"Gr\u0105\u017einti (Ctrl+Y)",undo_desc:"At\u0161aukti (Ctrl+Z)",indent_desc:"\u012etrauka",outdent_desc:"Atvirk\u0161tin\u0117 \u012ftrauka",numlist_desc:"Sunumeruotas s\u0105ra\u0161as",bullist_desc:"Nesunumeruotas s\u0105ra\u0161as",justifyfull_desc:"Lygiuoti pagal abu kra\u0161tus",justifyright_desc:"Lygiuoti pagal de\u0161in\u0119",justifycenter_desc:"Centruoti",justifyleft_desc:"Lygiuoti pagal kair\u0119",striketrough_desc:"Perbrauktas",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/lt_dlg.js b/js/tiny_mce/themes/advanced/langs/lt_dlg.js new file mode 100755 index 000000000..6535e503c --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/lt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lt.advanced_dlg',{link_list:"Nuorod\u0173 s\u0105ra\u0161as",link_is_external:"URL adresas, kur\u012f \u012fved\u0117te yra i\u0161orin\u0117 nuoroda, ar norite prid\u0117ti reikaling\u0105 http:// prefiks\u0105?",link_is_email:"URL adresas, kur\u012f \u012fved\u0117te yra el. pa\u0161to adresas, ar norite prid\u0117ti reikaling\u0105 mailto: prefiks\u0105?",link_titlefield:"Pavadinimas",link_target_blank:"Atverti naujame lange",link_target_same:"Atverti tame pa\u010diame lange",link_target:"Paskirtis",link_url:"Nuorodos URL adresas",link_title:"\u012eterpti/redaguoti nuorod\u0105",image_align_right:"De\u0161in\u0117je",image_align_left:"Kair\u0117je",image_align_textbottom:"Teksto apa\u010dioje",image_align_texttop:"Teksto vir\u0161uje",image_align_bottom:"Apa\u010dioje",image_align_middle:"Viduryje",image_align_top:"Vir\u0161uje",image_align_baseline:"Pradiniame ta\u0161ke",image_align:"Lygiavimas",image_hspace:"Horizontalus tarpas",image_vspace:"Vertikalus tarpas",image_dimensions:"I\u0161matavimai",image_alt:"Paveiksl\u0117lio apra\u0161as",image_list:"Paveiksl\u0117li\u0173 s\u0105ra\u0161as",image_border:"R\u0117melis",image_src:"Paveiksl\u0117lio URL adresas",image_title:"\u012eterpti/redaguoti paveiksl\u0117l\u012f",charmap_title:"Pasirinkti nestandartin\u012f simbol\u012f",colorpicker_name:"Pavadinimas:",colorpicker_color:"Spalva:",colorpicker_named_title:"\u012evardintosios spalvos",colorpicker_named_tab:"\u012evardintosios",colorpicker_palette_title:"Palet\u0117s spalvos",colorpicker_palette_tab:"Palet\u0117",colorpicker_picker_title:"Spalvos parinkiklis",colorpicker_picker_tab:"Parinkiklis",colorpicker_title:"Pasirinkti spalv\u0105",code_wordwrap:"Skaidyti tekst\u0105",code_title:"HTML i\u0161eities kodo redaktorius",anchor_name:"Prierai\u0161o vardas",anchor_title:"\u012eterpti/redaguoti prierai\u0161\u0105",about_loaded:"\u012ekelti papildiniai",about_version:"Versija",about_author:"Autorius",about_plugin:"Papildinys",about_plugins:"Papildiniai",about_license:"Licencija",about_help:"Pagalba",about_general:"Apie",about_title:"Apie TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/lv.js b/js/tiny_mce/themes/advanced/langs/lv.js new file mode 100755 index 000000000..04557b628 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/lv.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.advanced',{underline_desc:"Pasv\u012btrojums (Ctrl+U)",italic_desc:"Sl\u012bpraksts (Ctrl+I)",bold_desc:"Treknraksts (Ctrl+B)",dd:"Defin\u012bcijas apraksts",dt:"Defin\u012bcijas termins ",samp:"Koda piem\u0113rs",code:"Kods",blockquote:"Cit\u0101ts",h6:"Virsraksts 6",h5:"Virsraksts 5",h4:"Virsraksts 4",h3:"Virsraksts 3",h2:"Virsraksts 2",h1:"Virsraksts 1",pre:"Priek\u0161format\u0113ts",address:"Adrese",div:"Div\u012bzija",paragraph:"Rindkopa",block:"Form\u0101ts",fontdefault:"Fonta veids",font_size:"Fonta lielums",style_select:"Stili",more_colors:"Vair\u0101k kr\u0101su",toolbar_focus:"Iet uz r\u012bkpog\u0101m - Alt+Q, Iet uz redaktoru - Alt-Z, Iet uz elementa atra\u0161an\u0101s vietu - Alt-X",newdocument:"Vai J\u016bs esat p\u0101rliecin\u0101ti, ka v\u0113laties izdz\u0113st visu saturu?",path:"Atra\u0161an\u0101s vieta",clipboard_msg:"Iesp\u0113ja Kop\u0113t/Izgriezt/Iekop\u0113t nav pieejama p\u0101rl\u016bkiem Mozilla and Firefox.\nVai J\u016bs v\u0113laties uzzin\u0101t vair\u0101k par \u0161o probl\u0113mu?",blockquote_desc:"Cit\u0101ts",help_desc:"Pal\u012bdz\u012bba",newdocument_desc:"Jauns dokuments",image_props_desc:"Bildes iestat\u012bjumi",paste_desc:"Iekop\u0113t",copy_desc:"Kop\u0113t",cut_desc:"Izgriezt",anchor_desc:"Ievietot/Redi\u0123\u0113t enkursaiti",visualaid_desc:"Uzlikt/Nov\u0101kt pal\u012bgsv\u012btras/neredzamos elementus",charmap_desc:"Ievietot simbolu",backcolor_desc:"Uzst\u0101d\u012bt fona kr\u0101su",forecolor_desc:"Uzst\u0101d\u012bt teksta kr\u0101su",custom1_desc:"Tevis izdom\u0101ts apraksts \u0161eit",removeformat_desc:"Izdz\u0113st format\u0113to",hr_desc:"Ievietot horizont\u0101lu sv\u012btru",sup_desc:"Aug\u0161raksts",sub_desc:"Apak\u0161raksts",code_desc:"Redi\u0123\u0113t HTML kodu",cleanup_desc:"Izt\u012br\u012bt nek\u0101rt\u012bgu kodu",image_desc:"Ievietot/Redi\u0123\u0113t att\u0113lu",unlink_desc:"Atsait\u0113t",link_desc:"Ievietot/Redi\u0123\u0113t saiti",redo_desc:"Atatsaukt (Ctrl+Y)",undo_desc:"Atsaukt (Ctrl+Z)",indent_desc:"Atk\u0101pe",outdent_desc:"Uzk\u0101pe",numlist_desc:"Numur\u0113ts saraksts",bullist_desc:"Nenumur\u0113ts saraksts",justifyfull_desc:"Nol\u012bdzin\u0101t malas",justifyright_desc:"Novietot pa labi",justifycenter_desc:"Centr\u0113t",justifyleft_desc:"Novietot pa kreisi",striketrough_desc:"P\u0101rsv\u012btrojums",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/lv_dlg.js b/js/tiny_mce/themes/advanced/langs/lv_dlg.js new file mode 100755 index 000000000..1ee3b86c8 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/lv_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('lv.advanced_dlg',{link_list:"Sai\u0161u saraksts",link_is_external:"Ievad\u012btais URL \u0161\u0137iet ir \u0101r\u0113j\u0101 saite, vai tu v\u0113lies pirms t\u0101s pievienot http:// pried\u0113kli?",link_is_email:"Ievad\u012btais URL \u0161\u0137iet ir e-pasta adrese, vai tu v\u0113lies pirms t\u0101s pievienot mailto: pried\u0113kli? ",link_titlefield:"Nosaukums",link_target_blank:"Atv\u0113rt saiti jaun\u0101 log\u0101",link_target_same:"Atv\u0113rt saiti \u0161ai pa\u0161\u0101 log\u0101",link_target:"M\u0113r\u0137is",link_url:"Saites URL",link_title:"Ievietot/Redi\u0123\u0113t saiti",image_align_right:"Pa labi",image_align_left:"Pa kreisi",image_align_textbottom:"Teksta apak\u0161a",image_align_texttop:"Teksta aug\u0161a",image_align_bottom:"Apak\u0161a",image_align_middle:"Vidus",image_align_top:"Aug\u0161a",image_align_baseline:"Pati apak\u0161a",image_align:"Novietojums",image_hspace:"Horizont\u0101l\u0101 atstarpe",image_vspace:"Vertik\u0101l\u0101 atstarpe",image_dimensions:"Izm\u0113ri",image_alt:"Att\u0113la apraksts",image_list:"Att\u0113lu saraksts",image_border:"Apmale",image_src:"Att\u0113la URL",image_title:"Ievietot/Redi\u0123\u0113t att\u0113lu",charmap_title:"Izv\u0113lies simbolu",colorpicker_name:"Nosaukums:",colorpicker_color:"Kr\u0101sa:",colorpicker_named_title:"Nosaukt\u0101s kr\u0101sas",colorpicker_named_tab:"Nosaukts",colorpicker_palette_title:"Kr\u0101su palete",colorpicker_palette_tab:"Palete",colorpicker_picker_title:"Kr\u0101su izv\u0113lnis",colorpicker_picker_tab:"Izv\u0113lnis",colorpicker_title:"Izv\u0113l\u0113ties kr\u0101su",code_wordwrap:"V\u0101rdu p\u0101rne\u0161ana jaun\u0101 rind\u0101",code_title:"HTML koda redaktors",anchor_name:"Enkursaites nosaukums",anchor_title:"Ievietot/Redi\u0123\u0113t enkursaiti",about_loaded:"Iestat\u012btie papildmodu\u013ci",about_version:"Versija",about_author:"Autors",about_plugin:"Papildmodulis",about_plugins:"Papildmodu\u013ci",about_license:"Licence",about_help:"Pal\u012bdz\u012bba",about_general:"Par",about_title:"Par TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/nl.js b/js/tiny_mce/themes/advanced/langs/nl.js new file mode 100755 index 000000000..fb1712af2 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/nl.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.advanced',{"underline_desc":"Onderstrepen (Ctrl+U)","italic_desc":"Cursief (Ctrl+I)","bold_desc":"Vet (Ctrl+B)",dd:"Definitiebeschrijving",dt:"Definitieterm",samp:"Codevoorbeeld",code:"Code",blockquote:"Citaat",h6:"Kop 6",h5:"Kop 5",h4:"Kop 4",h3:"Kop 3",h2:"Kop 2",h1:"Kop 1",pre:"Vaste opmaak",address:"Adres",div:"Div",paragraph:"Alinea",block:"Opmaak",fontdefault:"Lettertype","font_size":"Tekengrootte","style_select":"Stijlen","more_colors":"Meer kleuren","toolbar_focus":"Spring naar werkbalk - Alt+Q, Spring naar tekst - Alt-Z, Spring naar elementpad - Alt-X",newdocument:"Weet u zeker dat u alle inhoud wilt wissen?",path:"Pad","clipboard_msg":"Kopi\u00ebren/knippen/plakken is niet beschikbaar in Mozilla en Firefox.\\nWilt u meer informatie over deze beperking?","blockquote_desc":"Citaat","help_desc":"Help","newdocument_desc":"Nieuw document","image_props_desc":"Afbeeldingseigenschappen","paste_desc":"Plakken","copy_desc":"Kopi\u00ebren","cut_desc":"Knippen","anchor_desc":"Anker invoegen/bewerken","visualaid_desc":"Hulplijnen weergeven","charmap_desc":"Symbool invoegen","backcolor_desc":"Tekstmarkeringskleur","forecolor_desc":"Tekstkleur","custom1_desc":"Uw eigen beschrijving hier","removeformat_desc":"Opmaak verwijderen","hr_desc":"Scheidingslijn invoegen","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"HTML bron bewerken","cleanup_desc":"Code opruimen","image_desc":"Afbeelding invoegen/bewerken","unlink_desc":"Link verwijderen","link_desc":"Link invoegen/bewerken","redo_desc":"Herhalen (Ctrl+Y)","undo_desc":"Ongedaan maken (Ctrl+Z)","indent_desc":"Inspringing vergroten","outdent_desc":"Inspringing verkleinen","numlist_desc":"Nummering","bullist_desc":"Opsommingstekens","justifyfull_desc":"Uitvullen","justifyright_desc":"Rechts uitlijnen","justifycenter_desc":"Centreren","justifyleft_desc":"Links uitlijnen","striketrough_desc":"Doorhalen","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/nl_dlg.js b/js/tiny_mce/themes/advanced/langs/nl_dlg.js new file mode 100755 index 000000000..e63a26e4d --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/nl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('nl.advanced_dlg',{"link_list":"Link lijst","link_is_external":"De ingevoerde URL lijkt op een externe link. Wilt u de vereiste http:// tekst voorvoegen?","link_is_email":"De ingevoerde URL lijkt op een e-mailadres. Wilt u de vereiste mailto: tekst voorvoegen?","link_titlefield":"Titel","link_target_blank":"Link in een nieuw venster openen","link_target_same":"Link in hetzelfde venster openen","link_target":"Doel","link_url":"Link URL","link_title":"Link invoegen/bewerken","image_align_right":"Rechts","image_align_left":"Links","image_align_textbottom":"Onderkant tekst","image_align_texttop":"Bovenkant tekst","image_align_bottom":"Onder","image_align_middle":"Midden","image_align_top":"Boven","image_align_baseline":"Basislijn","image_align":"Uitlijning","image_hspace":"Horizontale ruimte","image_vspace":"Verticale ruimte","image_dimensions":"Afmetingen","image_alt":"Beschrijving","image_list":"Lijst","image_border":"Rand","image_src":"Bestand/URL","image_title":"Afbeelding invoegen/bewerken","charmap_title":"Symbolen","colorpicker_name":"Naam:","colorpicker_color":"Kleur:","colorpicker_named_title":"Benoemde kleuren","colorpicker_named_tab":"Benoemd","colorpicker_palette_title":"Paletkleuren","colorpicker_palette_tab":"Palet","colorpicker_picker_title":"Alle kleuren","colorpicker_picker_tab":"Alle kleuren","colorpicker_title":"Kleuren","code_wordwrap":"Automatische terugloop","code_title":"HTML Bron","anchor_name":"Ankernaam","anchor_title":"Anker invoegen/bewerken","about_loaded":"Geladen Invoegtoepassingen","about_version":"Versie","about_author":"Auteur","about_plugin":"Invoegtoepassing","about_plugins":"Invoegtoepassingen","about_license":"Licentie","about_help":"Help","about_general":"Info","about_title":"Over TinyMCE","anchor_invalid":"Geef een geldige ankernaam."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/no.js b/js/tiny_mce/themes/advanced/langs/no.js new file mode 100755 index 000000000..4f9119327 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/no.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.advanced',{"underline_desc":"Understrek (Ctrl+U)","italic_desc":"Kursiv (Ctrl+I)","bold_desc":"Fet (Ctrl+B)",dd:"Definisjonsbeskrivelse",dt:"Definisjonsuttrykk",samp:"Kodeeksempel",code:"Kode",blockquote:"Innrykk",h6:"Overskrift 6",h5:"Overskrift 5",h4:"Overskrift 4",h3:"Overskrift 3",h2:"Overskrift 2",h1:"Overskrift 1",pre:"Pre-formatert",address:"Adresse",div:"Div",paragraph:"Avsnitt",block:"Format",fontdefault:"Skriftfamilie","font_size":"Skriftst\u00f8rrelse","style_select":"Stiler","more_colors":"Flere farger","toolbar_focus":"Skift til verkt\u00f8yknapper - Alt+Q, Skift til editor - Alt-Z, Skift til elementsti - Alt-",newdocument:"Er du sikker p\u00e5 at du vil slette alt innhold?",path:"Sti","clipboard_msg":"Klipp ut/Kopier/Lim er ikke tilgjengelig i Mozilla og Firefox. \n Vil du vite mer om dette?","blockquote_desc":"Innrykk","help_desc":"Hjelp","newdocument_desc":"Nytt dokument","image_props_desc":"Egenskaper for bilde","paste_desc":"Lim inn","copy_desc":"Kopier","cut_desc":"Klipp ut","anchor_desc":"Sett inn/editer anker","visualaid_desc":"Sl\u00e5 av/p\u00e5 usynlige elementer","charmap_desc":"Sett inn spesialtegn","backcolor_desc":"Velg bakgrunnsfarge","forecolor_desc":"Velg skriftfarge","custom1_desc":"Din egen beskriveles her","removeformat_desc":"Fjern formatering","hr_desc":"Sett inn horisontal linje","sup_desc":"Hev skrift","sub_desc":"Senk skrift","code_desc":"Rediger HTML kildekode","cleanup_desc":"Rense grisete kode","image_desc":"Sett inn / endre bilde","unlink_desc":"Fjerne lenke","link_desc":"Sett inn/editer lenke","redo_desc":"Gj\u00f8r om (Ctrl+Y)","undo_desc":"Angre (Ctrl+Z)","indent_desc":"\u00d8k innrykk","outdent_desc":"Reduser innrykk","numlist_desc":"Nummerliste","bullist_desc":"Punktliste","justifyfull_desc":"Blokkjustert","justifyright_desc":"H\u00f8yrejustert","justifycenter_desc":"Midtstilt","justifyleft_desc":"Venstrejustert","striketrough_desc":"Gjennomstreke","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/no_dlg.js b/js/tiny_mce/themes/advanced/langs/no_dlg.js new file mode 100755 index 000000000..bc7ea8b53 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/no_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('no.advanced_dlg',{"link_list":"Liste over lenker","link_is_external":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en ekstern nettadresse. \u00d8nsker du \u00e5 legge til obligatorisk http://-prefiks?","link_is_email":"Nettadressen du skrev inn ser ut til \u00e5 v\u00e6re en Epost adresse. \u00d8nsker du \u00e5 legge til obligatorisk mailto:-prefiks?","link_titlefield":"Tittel","link_target_blank":"\u00c5pne i nytt vindu","link_target_same":"\u00c5pne i dette vindu","link_target":"M\u00e5lvindu","link_url":"Lenke URL","link_title":"Sett inn/editer lenke","image_align_right":"H\u00f8yre","image_align_left":"Venstre","image_align_textbottom":"Tekst bunn","image_align_texttop":"Tekst topp","image_align_bottom":"Bunn","image_align_middle":"Midtstilt","image_align_top":"Topp","image_align_baseline":"Bunnlinje","image_align":"Justering","image_hspace":"Horisontal avstand","image_vspace":"Vertikal avstand","image_dimensions":"Dimensjoner","image_alt":"Bildebeskrivelse","image_list":"Liste med bilder","image_border":"Ramme","image_src":"Bilde URL","image_title":"Sett inn/editer bilde","charmap_title":"Velg spesialtegn","colorpicker_name":"Navn:","colorpicker_color":"Farge:","colorpicker_named_title":"Fargenavn","colorpicker_named_tab":"Navnevalg","colorpicker_palette_title":"Palettfarger","colorpicker_palette_tab":"Palett","colorpicker_picker_title":"Fargevalg","colorpicker_picker_tab":"Fargevelger","colorpicker_title":"Velg farge","code_wordwrap":"Tekstbryting","code_title":"HTML kildeeditor","anchor_name":"Ankernavn","anchor_title":"Sett inn/editer anker","about_loaded":"Innlastede programtillegg","about_version":"Versjon","about_author":"Forfatter","about_plugin":"Programtillegg","about_plugins":"Programtillegg","about_license":"Lisens","about_help":"Hjelp","about_general":"Om","about_title":"Om TinyMCE","anchor_invalid":"Du m\u00e5 angi et gyldig ankernavn."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/pl.js b/js/tiny_mce/themes/advanced/langs/pl.js new file mode 100755 index 000000000..38f445997 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/pl.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.advanced',{"underline_desc":"Podkre\u015blenie (Ctrl+U)","italic_desc":"Kursywa (Ctrl+I)","bold_desc":"Pogrubienie (Ctrl+B)",dd:"Opis terminu",dt:"Definicja terminu ",samp:"Pr\u00f3bka kodu",code:"Kod",blockquote:"Wydzielony blok",h6:"Nag\u0142\u00f3wek 6",h5:"Nag\u0142\u00f3wek 5",h4:"Nag\u0142\u00f3wek 4",h3:"Nag\u0142\u00f3wek 3",h2:"Nag\u0142\u00f3wek 2",h1:"Nag\u0142\u00f3wek 1",pre:"Czcionka o sta\u0142ej szeroko\u015bci",address:"Adres",div:"Div",paragraph:"Akapit",block:"Format",fontdefault:"Rodzaj czcionki","font_size":"Rozmiar czcionki","style_select":"Styl","more_colors":"Wi\u0119cej kolor\u00f3w","toolbar_focus":"Przeskocz do przycisk\u00f3w narz\u0119dzi - Alt+Q, Przeskocz do edytora - Alt-Z, Przeskocz do elementu \u015bcie\u017cki - Alt-X",newdocument:"Czy jeste\u015b pewnien, ze chcesz wyczy\u015bci\u0107 ca\u0142\u0105 zawarto\u015b\u0107?",path:"\u015acie\u017cka","clipboard_msg":"Akcje Kopiuj/Wytnij/Wklej nie s\u0105 dost\u0119pne w Mozilli i Firefox.\\nCzy chcesz wi\u0119cej informacji o tym problemie?","blockquote_desc":"Blok cytatu","help_desc":"Pomoc","newdocument_desc":"Nowy dokument","image_props_desc":"W\u0142a\u015bciwo\u015bci obrazka","paste_desc":"Wklej","copy_desc":"Kopiuj","cut_desc":"Wytnij","anchor_desc":"Wstaw/edytuj kotwic\u0119","visualaid_desc":"Prze\u0142\u0105cz widoczno\u015b\u0107 wska\u017anik\u00f3w i niewidocznych element\u00f3w","charmap_desc":"Wstaw znak specjalny","backcolor_desc":"Wybierz kolor t\u0142a","forecolor_desc":"Wybierz kolor tekstu","custom1_desc":"Tw\u00f3j niestandardowy opis tutaj","removeformat_desc":"Usu\u0144 formatowanie","hr_desc":"Wstaw poziom\u0105 lini\u0119","sup_desc":"Indeks g\u00f3rny","sub_desc":"Indeks dolny","code_desc":"Edytuj \u017ar\u00f3d\u0142o HTML","cleanup_desc":"Wyczy\u015b\u0107 nieuporz\u0105dkowany kod","image_desc":"Wstaw/edytuj obraz","unlink_desc":"Usu\u0144 link","link_desc":"Wstaw/edytuj link","redo_desc":"Pon\u00f3w (Ctrl+Y)","undo_desc":"Cofnij (Ctrl+Z)","indent_desc":"Wci\u0119cie","outdent_desc":"Cofnij wci\u0119cie","numlist_desc":"Lista numerowana","bullist_desc":"Lista nienumerowana","justifyfull_desc":"R\u00f3wnanie do prawej i lewej","justifyright_desc":"Wyr\u00f3wnaj do prawej","justifycenter_desc":"Wycentruj","justifyleft_desc":"Wyr\u00f3wnaj do lewej","striketrough_desc":"Przekre\u015blenie","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/pl_dlg.js b/js/tiny_mce/themes/advanced/langs/pl_dlg.js new file mode 100755 index 000000000..6142361ad --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/pl_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pl.advanced_dlg',{"link_list":"Lista link\u00f3w","link_is_external":"URL kt\u00f3ry otworzy\u0142e\u015b wydaje si\u0119 by\u0107 zewn\u0119trznym linkiem, czy chcesz doda\u0107 wymagany prefiks http:// ?","link_is_email":"URL kt\u00f3ry otworzy\u0142e\u015b wydaje si\u0119 by\u0107 adresem mailowym, czy chcesz doda\u0107 odpowiedni prefiks mailto:?","link_titlefield":"Tytu\u0142","link_target_blank":"Otw\u00f3rz link w nowym oknie","link_target_same":"Otw\u00f3rz link w tym samym oknie","link_target":"Cel","link_url":"URL linka","link_title":"Wstaw/edytuj link","image_align_right":"Prawy","image_align_left":"Lewy","image_align_textbottom":"Dolny tekst","image_align_texttop":"G\u00f3rny tekst","image_align_bottom":"D\u00f3\u0142","image_align_middle":"\u015arodek","image_align_top":"G\u00f3ra","image_align_baseline":"Linia bazowa","image_align":"Wyr\u00f3wnanie","image_hspace":"Odst\u0119p poziomy","image_vspace":"Odst\u0119p pionowy","image_dimensions":"Rozmiary","image_alt":"Opis obrazka","image_list":"Lista obrazk\u00f3w","image_border":"Obramowanie","image_src":"URL obrazka","image_title":"Wstaw/edytuj obraz","charmap_title":"Wybierz niestandardowy znak","colorpicker_name":"Nazwa:","colorpicker_color":"Kolor:","colorpicker_named_title":"Nazwane kolory","colorpicker_named_tab":"Nazwane","colorpicker_palette_title":"Paleta kolor\u00f3w","colorpicker_palette_tab":"Paleta","colorpicker_picker_title":"Wybieranie kolor\u00f3w","colorpicker_picker_tab":"Wybieranie","colorpicker_title":"Wybierz kolor","code_wordwrap":"Zawijanie s\u0142\u00f3w","code_title":"Edytor \u017ar\u00f3d\u0142a HTML","anchor_name":"Nazwa zakotwiczenia","anchor_title":"Wstaw/Edytuj zakotwiczenie","about_loaded":"Za\u0142adowane wtyczki","about_version":"Wersja","about_author":"Autor","about_plugin":"Wtyczka","about_plugins":"Wtyczki","about_license":"Licencja","about_help":"Pomoc","about_general":"O TinyMCE","about_title":"O TinyMCE","anchor_invalid":"Prosz\u0119 poda\u0107 w\u0142a\u015bciw\u0105 nazw\u0119 zakotwiczenia."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/pt.js b/js/tiny_mce/themes/advanced/langs/pt.js new file mode 100755 index 000000000..9d86b4178 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/pt.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.advanced',{underline_desc:"Sublinhado (Ctrl+U)",italic_desc:"It\u00e1lico (Ctrl+I)",bold_desc:"Negrito (Ctrl+B)",dd:"Descri\u00e7\u00e3o da defini\u00e7\u00e3o",dt:"Termo da defini\u00e7\u00e3o",samp:"Amostra de c\u00f3digo",code:"C\u00f3digo",blockquote:"Cita\u00e7\u00e3o em bloco",h6:"T\u00edtulo 6",h5:"T\u00edtulo 5",h4:"T\u00edtulo 4",h3:"T\u00edtulo 3",h2:"T\u00edtulo 2",h1:"T\u00edtulo 1",pre:"Pr\u00e9-formatado",address:"Endere\u00e7o",div:"Div",paragraph:"Par\u00e1grafo",block:"Formata\u00e7\u00e3o",fontdefault:"Tipo de fonte",font_size:"Tamanho",style_select:"Estilos",more_colors:"Mais cores",toolbar_focus:"Ir para as ferramentas - Alt+Q, Ir para o editor - Alt-Z, Ir para o endere\u00e7o do elemento - Alt-X",newdocument:"Tem a certeza que deseja apagar tudo?",path:"Endere\u00e7o",clipboard_msg:"Copiar/recortar/colar n\u00e3o est\u00e1 dispon\u00edvel no Mozilla e Firefox. Deseja mais informa\u00e7\u00f5es sobre este problema?",blockquote_desc:"Cita\u00e7\u00e3o em bloco",help_desc:"Ajuda",newdocument_desc:"Novo documento",image_props_desc:"Propriedades da imagem",paste_desc:"Colar",copy_desc:"Copiar",cut_desc:"Recortar",anchor_desc:"Inserir/editar \u00e2ncora",visualaid_desc:"Alternar guias/elementos invis\u00edveis",charmap_desc:"Inserir caracteres especiais",backcolor_desc:"Selecionar a cor de fundo",forecolor_desc:"Selecionar a cor do texto",custom1_desc:"Insira aqui a sua descri\u00e7\u00e3o personalizada",removeformat_desc:"Remover formata\u00e7\u00e3o",hr_desc:"Inserir separador horizontal",sup_desc:"Superior \u00e0 linha",sub_desc:"Inferior \u00e0 linha",code_desc:"Editar c\u00f3digo fonte",cleanup_desc:"Limpar c\u00f3digo incorreto",image_desc:"Inserir/editar imagem",unlink_desc:"Remover hyperlink",link_desc:"Inserir/editar hyperlink",redo_desc:"Refazer (Ctrl+Y)",undo_desc:"Desfazer (Ctrl+Z)",indent_desc:"Aumentar recuo",outdent_desc:"Diminuir recuo",numlist_desc:"Numera\u00e7\u00e3o",bullist_desc:"Marcadores",justifyfull_desc:"Justificar",justifyright_desc:"Alinhar \u00e0 direita",justifycenter_desc:"Centralizar",justifyleft_desc:"Alinhar \u00e0 esquerda",striketrough_desc:"Riscado",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/pt_dlg.js b/js/tiny_mce/themes/advanced/langs/pt_dlg.js new file mode 100755 index 000000000..ad34611ae --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/pt_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('pt.advanced_dlg',{link_list:"Lista de Links",link_is_external:"A URL digitada parece conduzir a um link externo. Deseja acrescentar o prefixo necess\u00e1rio http://?",link_is_email:"A URL digitada parece ser um endere\u00e7o de e-mail. Deseja acrescentar o prefixo necess\u00e1rio mailto:?",link_titlefield:"T\u00edtulo",link_target_blank:"Abrir hyperlink em nova janela",link_target_same:"Abrir hyperlink na mesma janela",link_target:"Alvo",link_url:"URL do hyperink",link_title:"Inserir/editar hyperlink",image_align_right:"Direita",image_align_left:"Esquerda",image_align_textbottom:"Base do texto",image_align_texttop:"Topo do texto",image_align_bottom:"Abaixo",image_align_middle:"Meio",image_align_top:"Topo",image_align_baseline:"Sobre a linha de texto",image_align:"Alinhamento",image_hspace:"Espa\u00e7o Horizontal",image_vspace:"Espa\u00e7o Vertical",image_dimensions:"Dimens\u00f5es",image_alt:"Descri\u00e7\u00e3o da imagem",image_list:"Lista de imagens",image_border:"Limites",image_src:"Endere\u00e7o da imagem",image_title:"Inserir/editar imagem",charmap_title:"Selecionar caracteres personalizados",colorpicker_name:"Nome:",colorpicker_color:"Cor:",colorpicker_named_title:"Cores Personalizadas",colorpicker_named_tab:"Personalizadas",colorpicker_palette_title:"Paleta de Cores",colorpicker_palette_tab:"Paleta",colorpicker_picker_title:"Editor de Cores",colorpicker_picker_tab:"Editor",colorpicker_title:"Selecione uma cor",code_wordwrap:"Quebra autom\u00e1tica de linha",code_title:"Editor HTML",anchor_name:"Nome da \u00e2ncora",anchor_title:"Inserir/editar \u00e2ncora",about_loaded:"Plugins Instalados",about_version:"Vers\u00e3o",about_author:"Autor",about_plugin:"Plugin",about_plugins:"Plugins",about_license:"Licen\u00e7a",about_help:"Ajuda",about_general:"Sobre",about_title:"Sobre o TinyMCE",anchor_invalid:"Por favor, especifique um nome v\u00e1lido de \u00e2ncora."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/ro.js b/js/tiny_mce/themes/advanced/langs/ro.js new file mode 100755 index 000000000..ae6adcb52 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/ro.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.advanced',{underline_desc:"Subliniat (Ctrl+U)",italic_desc:"Italic (Ctrl+I)",bold_desc:"\u00cengro\u015fat (Ctrl+B)",dd:"Defini\u0163ie",dt:"Termen definit ",samp:"Mostr\u0103 de cod",code:"Cod",blockquote:"Citat",h6:"Titlu 6",h5:"Titlu 5",h4:"Titlu 4",h3:"Titlu 3",h2:"Titlu 2",h1:"Titlu 1",pre:"Preformatat",address:"Adres\u0103",div:"Div",paragraph:"Paragraf",block:"Format",fontdefault:"Font",font_size:"M\u0103rime font",style_select:"Stiluri",more_colors:"Mai multe culori",toolbar_focus:"S\u0103ri\u0163i la instrumente - Alt+Q, S\u0103ri\u0163i la editor - Alt-Z, S\u0103ri\u0163i la cale - Alt-X",newdocument:"Sigur dori\u0163i s\u0103 \u015fterge\u0163i tot?",path:"Cale",clipboard_msg:"Copierea/T\u0103ierea/Lipirea nu sunt disponibile \u00een Mozilla \u015fi Firefox.\\nDori\u0163i mai multe informa\u0163ii despre aceast\u0103 problem\u0103?",blockquote_desc:"Citat",help_desc:"Autor",newdocument_desc:"Document nou",image_props_desc:"Detalii imagine",paste_desc:"Lipe\u015fte",copy_desc:"Copiaz\u0103",cut_desc:"Taie",anchor_desc:"Inserare/editare ancor\u0103",visualaid_desc:"Comut\u0103 ghidajele/elementele invizibile",charmap_desc:"Inserare caracter special",backcolor_desc:"Culoare fundal",forecolor_desc:"Culoare text",custom1_desc:"Descriere ...",removeformat_desc:"Anuleaz\u0103 formatarea",hr_desc:"Insereaz\u0103 linie orizontal\u0103",sup_desc:"Superscript",sub_desc:"Subscript",code_desc:"Editare surs\u0103 HTML",cleanup_desc:"Cur\u0103\u0163are cod",image_desc:"Inserare/editare imagine",unlink_desc:"\u015eterge leg\u0103tura",link_desc:"Inserare/editare leg\u0103tur\u0103",redo_desc:"Ref\u0103 (Ctrl+Y)",undo_desc:"Undo (Ctrl+Z)",indent_desc:"Indenteaz\u0103",outdent_desc:"De-indenteaz\u0103",numlist_desc:"List\u0103 ordonat\u0103",bullist_desc:"List\u0103 neordonat\u0103",justifyfull_desc:"Aliniere pe toat\u0103 l\u0103\u0163imea",justifyright_desc:"Aliniere la dreapta",justifycenter_desc:"Centrare",justifyleft_desc:"Aliniere la st\u00e2nga",striketrough_desc:"T\u0103iat",anchor_delta_height:"",anchor_delta_width:"",charmap_delta_height:"",charmap_delta_width:"",colorpicker_delta_height:"",colorpicker_delta_width:"",link_delta_height:"",link_delta_width:"",image_delta_height:"",image_delta_width:""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/ro_dlg.js b/js/tiny_mce/themes/advanced/langs/ro_dlg.js new file mode 100755 index 000000000..87ce7e90b --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/ro_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ro.advanced_dlg',{link_list:"Lista de leg\u0103turi",link_is_external:"URL-ul pe care l-a\u0163i introdus pare a fi o leg\u0103tur\u0103 extern\u0103. Dori\u0163i s\u0103 adaug \u015fi prefixul http:// necesar?",link_is_email:"URL-ul pe care l-a\u0163i introdus pare a fi o adres\u0103 de e-mail. Dori\u0163i s\u0103 adaug \u015fi prefixul mailto: necesar?",link_titlefield:"Titlu",link_target_blank:"Deschide leg\u0103tura \u00eentr-o fereastr\u0103 nou\u0103",link_target_same:"Deschide leg\u0103tura \u00een aceea\u015fi fereastr\u0103",link_target:"\u0162int\u0103",link_url:"URL leg\u0103tur\u0103",link_title:"Inserare/editare leg\u0103tur\u0103",image_align_right:"Dreapta",image_align_left:"St\u00e2nga",image_align_textbottom:"Textul la mijloc",image_align_texttop:"Textul sus",image_align_bottom:"Jos",image_align_middle:"La mijloc",image_align_top:"Sus",image_align_baseline:"Baseline",image_align:"Aliniere",image_hspace:"Spa\u0163iu orizontal",image_vspace:"Spa\u0163iu vertical",image_dimensions:"Dimensiuni",image_alt:"Descriere imagine",image_list:"List\u0103 de imagini",image_border:"Bordur\u0103",image_src:"URL imagine",image_title:"Insereaz\u0103/editeaz\u0103 o imagine",charmap_title:"Alege\u0163i un caracter special",colorpicker_name:"Nume:",colorpicker_color:"Culoare:",colorpicker_named_title:"Culori denumite",colorpicker_named_tab:"Denumite",colorpicker_palette_title:"Palet\u0103 de culori",colorpicker_palette_tab:"Palet\u0103",colorpicker_picker_title:"Pipet\u0103 de culori",colorpicker_picker_tab:"Pipet\u0103",colorpicker_title:"Alege\u0163i o culoare",code_wordwrap:"Word wrap",code_title:"Editor surs\u0103 HTML",anchor_name:"Nume ancor\u0103",anchor_title:"Inserare/editare ancor\u0103",about_loaded:"Module \u00eenc\u0103rcate",about_version:"Versiune",about_author:"Autor",about_plugin:"Modul",about_plugins:"Module",about_license:"Licen\u0163\u0103",about_help:"Ajutor",about_general:"Despre",about_title:"Despre TinyMCE"}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/ru.js b/js/tiny_mce/themes/advanced/langs/ru.js new file mode 100755 index 000000000..3ab4e6972 --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/ru.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.advanced',{"underline_desc":"\u041f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439 (Ctrl+U)","italic_desc":"\u041a\u0443\u0440\u0441\u0438\u0432 (Ctrl+I)","bold_desc":"\u041f\u043e\u043b\u0443\u0436\u0438\u0440\u043d\u044b\u0439 (Ctrl+B)",dd:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430",dt:"\u0422\u0435\u0440\u043c\u0438\u043d \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430",samp:"\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430",code:"\u041a\u043e\u0434",blockquote:"\u0426\u0438\u0442\u0430\u0442\u0430",h6:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 6",h5:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 5",h4:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 4",h3:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 3",h2:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 2",h1:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 1",pre:"\u041f\u0440\u0435\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439",address:"\u0410\u0434\u0440\u0435\u0441",div:"Div",paragraph:"\u0410\u0431\u0437\u0430\u0446",block:"\u0424\u043e\u0440\u043c\u0430\u0442",fontdefault:"\u0428\u0440\u0438\u0444\u0442","font_size":"\u0420\u0430\u0437\u043c\u0435\u0440","style_select":"\u0421\u0442\u0438\u043b\u044c","more_colors":"\u0414\u0440\u0443\u0433\u0438\u0435 \u0446\u0432\u0435\u0442\u0430...","toolbar_focus":"\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u043a\u043d\u043e\u043f\u043e\u043a (Alt+Q). \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0443 (Alt+Z). \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043f\u0443\u0442\u0438 (Alt+X).",newdocument:"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0441\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c?",path:"\u0422\u0435\u0433\u0438","clipboard_msg":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u044b\u0440\u0435\u0437\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Firefox.\\r\\n\u0425\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e?","blockquote_desc":"\u0426\u0438\u0442\u0430\u0442\u0430","help_desc":"\u041f\u043e\u043c\u043e\u0449\u044c","newdocument_desc":"\u041d\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442","image_props_desc":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","paste_desc":"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c","copy_desc":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c","cut_desc":"\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c","anchor_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044f\u043a\u043e\u0440\u044c","visualaid_desc":"\u0412\u0441\u0435 \u0437\u043d\u0430\u043a\u0438","charmap_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b","backcolor_desc":"\u0426\u0432\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430","forecolor_desc":"\u0426\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430","custom1_desc":"\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435","removeformat_desc":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442","hr_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0442\u0443","sup_desc":"\u041d\u0430\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439","sub_desc":"\u041f\u043e\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439","code_desc":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c HTML \u043a\u043e\u0434","cleanup_desc":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434","image_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","unlink_desc":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443","link_desc":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443","redo_desc":"\u0412\u0435\u0440\u043d\u0443\u0442\u044c (Ctrl+Y)","undo_desc":"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c (Ctrl+Z)","indent_desc":"\u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f","outdent_desc":"\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f","numlist_desc":"\u041d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a","bullist_desc":"\u041c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a","justifyfull_desc":"\u041f\u043e \u0448\u0438\u0440\u0438\u043d\u0435","justifyright_desc":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","justifycenter_desc":"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443","justifyleft_desc":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","striketrough_desc":"\u0417\u0430\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":""}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/langs/ru_dlg.js b/js/tiny_mce/themes/advanced/langs/ru_dlg.js new file mode 100755 index 000000000..a1ad580bb --- /dev/null +++ b/js/tiny_mce/themes/advanced/langs/ru_dlg.js @@ -0,0 +1 @@ +tinyMCE.addI18n('ru.advanced_dlg',{"link_list":"\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a","link_is_external":"\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 http://?","link_is_email":"\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 mailto:?","link_titlefield":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a","link_target_blank":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435","link_target_same":"\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043e\u043a\u043d\u0435","link_target":"\u0426\u0435\u043b\u044c","link_url":"\u0410\u0434\u0440\u0435\u0441","link_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0441\u044b\u043b\u043a\u0438","image_align_right":"\u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","image_align_left":"\u041f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e","image_align_textbottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0430","image_align_texttop":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e \u0442\u0435\u043a\u0441\u0442\u0430","image_align_bottom":"\u041f\u043e \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","image_align_middle":"\u041f\u043e \u0446\u0435\u043d\u0442\u0440\u0443","image_align_top":"\u041f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u043a\u0440\u0430\u044e","image_align_baseline":"\u041f\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043b\u0438\u043d\u0438\u0438","image_align":"\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435","image_hspace":"\u0413\u043e\u0440\u0438\u0437. \u043e\u0442\u0441\u0442\u0443\u043f","image_vspace":"\u0412\u0435\u0440\u0442. \u043e\u0442\u0441\u0442\u0443\u043f","image_dimensions":"\u0420\u0430\u0437\u043c\u0435\u0440","image_alt":"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435","image_list":"\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a","image_border":"\u0413\u0440\u0430\u043d\u0438\u0446\u0430","image_src":"\u0410\u0434\u0440\u0435\u0441","image_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","charmap_title":"\u0412\u044b\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u0430","colorpicker_name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435:","colorpicker_color":"\u041a\u043e\u0434:","colorpicker_named_title":"\u0426\u0432\u0435\u0442\u0430","colorpicker_named_tab":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f","colorpicker_palette_title":"\u0426\u0432\u0435\u0442\u0430","colorpicker_palette_tab":"\u041f\u0430\u043b\u0438\u0442\u0440\u0430","colorpicker_picker_title":"\u0426\u0432\u0435\u0442\u0430","colorpicker_picker_tab":"\u0421\u043f\u0435\u043a\u0442\u0440","colorpicker_title":"\u0426\u0432\u0435\u0442\u0430","code_wordwrap":"\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0442\u0440\u043e\u043a","code_title":"\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 HTML \u043a\u043e\u0434\u0430","anchor_name":"\u0418\u043c\u044f \u044f\u043a\u043e\u0440\u044f","anchor_title":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044f\u043a\u043e\u0440\u044f","about_loaded":"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b","about_version":"\u0412\u0435\u0440\u0441\u0438\u044f","about_author":"\u0410\u0432\u0442\u043e\u0440","about_plugin":"\u041f\u043b\u0430\u0433\u0438\u043d","about_plugins":"\u041f\u043b\u0430\u0433\u0438\u043d\u044b","about_license":"\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f","about_help":"\u041f\u043e\u043c\u043e\u0449\u044c","about_general":"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435","about_title":"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 TinyMCE","anchor_invalid":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u044f\u043a\u043e\u0440\u044f."}); \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/link.htm b/js/tiny_mce/themes/advanced/link.htm new file mode 100644 index 000000000..5d9dea9b8 --- /dev/null +++ b/js/tiny_mce/themes/advanced/link.htm @@ -0,0 +1,57 @@ + + + + {#advanced_dlg.link_title} + + + + + + + +
        + + +
        +
        + + + + + + + + + + + + + + + + + + + + + +
        + + + + +
         
        +
        +
        + +
        + + +
        +
        + + diff --git a/js/tiny_mce/themes/advanced/shortcuts.htm b/js/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 000000000..20ec2f5a3 --- /dev/null +++ b/js/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

        {#advanced_dlg.accessibility_usage_title}

        +

        Toolbars

        +

        Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

        + +

        Status Bar

        +

        To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

        + +

        Context Menu

        +

        Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

        + +

        Keyboard Shortcuts

        + + + + + + + + + + + + + + + + + + + + + +
        KeystrokeFunction
        Control-BBold
        Control-IItalic
        Control-ZUndo
        Control-YRedo
        + + diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/content.css b/js/tiny_mce/themes/advanced/skins/cirkuit/content.css new file mode 100755 index 000000000..9d15a99d9 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/cirkuit/content.css @@ -0,0 +1,66 @@ +/*body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important}*/ +body, td, pre {color:#000; font: 12px/1.5em "Lucida Grande", Helvetica, Arial, sans-serif; margin:8px;} +html,body {padding: 0 !important; margin: 0 !important; background:#fff !important;} +body {height: 94% !important; padding: 0 !important;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/dialog.css b/js/tiny_mce/themes/advanced/skins/cirkuit/dialog.css new file mode 100755 index 000000000..bde95fe47 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/cirkuit/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#f1f1f1; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#f1f1f1;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #dfdfdf; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #dfdfdf;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #dfdfdf;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, #apply, .mceActionPanel .button, input.mceButton, .updateButton { + border: 1px solid #bbb; + margin:0; + padding:0 0 1px; + font-weight:bold; + font-size: 11px; + width:94px; + height:24px; + background:url(img/fade-butt.png) 0 0; + color:#000; + cursor:pointer; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +#insert:hover, #cancel:hover, input.mceButton:hover, .updateButton:hover, +#insert:focus, #cancel:focus, input.mceButton:focus, .updateButton:focus { + border: 1px solid #555; +} + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor, a.browse {text-decoration:none} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} +#charmap #charmapView {background-color:#fff;} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/butt2.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/butt2.png new file mode 100755 index 000000000..3baae5e6d Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/butt2.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/button-bg.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/button-bg.png new file mode 100755 index 000000000..0c2c5f8a0 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/button-bg.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/buttons.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/buttons.png new file mode 100755 index 000000000..7dd58418b Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/buttons.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/down_arrow.gif b/js/tiny_mce/themes/advanced/skins/cirkuit/img/down_arrow.gif new file mode 100755 index 000000000..687b241ee Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/down_arrow.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/fade-butt.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/fade-butt.png new file mode 100755 index 000000000..42f08b799 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/fade-butt.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/icons.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/icons.png new file mode 100755 index 000000000..7525d9d3f Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/icons.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/items.gif b/js/tiny_mce/themes/advanced/skins/cirkuit/img/items.gif new file mode 100755 index 000000000..2eafd7954 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/items.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-arrow.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-arrow.png new file mode 100755 index 000000000..bdfe5098e Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-arrow.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-check.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-check.png new file mode 100755 index 000000000..92a5edb8b Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/menu-check.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/progress.gif b/js/tiny_mce/themes/advanced/skins/cirkuit/img/progress.gif new file mode 100755 index 000000000..5bb90fd6a Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/progress.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/tabs.gif b/js/tiny_mce/themes/advanced/skins/cirkuit/img/tabs.gif new file mode 100755 index 000000000..ce4be6355 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/tabs.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/toolbarbg.png b/js/tiny_mce/themes/advanced/skins/cirkuit/img/toolbarbg.png new file mode 100755 index 000000000..f29510640 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/cirkuit/img/toolbarbg.png differ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/ui.css b/js/tiny_mce/themes/advanced/skins/cirkuit/ui.css new file mode 100755 index 000000000..e2bbe6f60 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/cirkuit/ui.css @@ -0,0 +1,988 @@ +/* Reset */ +.cirkuitSkin table, .cirkuitSkin tbody, .cirkuitSkin a, .cirkuitSkin img, .cirkuitSkin tr, .cirkuitSkin div, .cirkuitSkin td, .cirkuitSkin iframe, .cirkuitSkin span, .cirkuitSkin *, .cirkuitSkin .mceText { + border: 0; + margin: 0; + padding: 0; + background: transparent; + white-space: nowrap; + text-decoration: none; + font-weight: normal; + cursor: default; + color: #000; + vertical-align: baseline; + width: auto; + border-collapse: separate; + text-align: left +} + +.cirkuitSkin a:hover, .cirkuitSkin a:link, .cirkuitSkin a:visited, .cirkuitSkin a:active { + text-decoration: none; + font-weight: normal; + cursor: default; + color: #000 +} + +.cirkuitSkin table td { + vertical-align: middle +} + +/* Containers */ +.cirkuitSkin table { + direction:ltr; +} +.cirkuitSkin iframe { + display: block; + background: #FFF; +} + +.cirkuitSkin .mceToolbar { + height: 26px +} + +.cirkuitSkin .mceLeft { + text-align: left +} + +.cirkuitSkin .mceRight { + text-align: right +} + +/* External */ +.cirkuitSkin .mceExternalToolbar { + position: absolute; + border: 1px solid #CCC; + border-bottom: 0; + display: none; +} + +.cirkuitSkin .mceExternalToolbar td.mceToolbar { + padding-right: 13px; +} + +.cirkuitSkin .mceExternalClose { + position: absolute; + top: 3px; + right: 3px; + width: 7px; + height: 7px; + background: url('img/icons.png') -820px 0 +} + +/* Layout */ +.cirkuitSkin table.mceLayout { + border: 0; + border-left: 1px solid #CCC; + border-right: 1px solid #CCC +} + +.cirkuitSkin table.mceLayout tr.mceFirst td { + border-top: 1px solid #CCC +} + +.cirkuitSkin table.mceLayout tr.mceLast td { + border-bottom: 1px solid #CCC; + background: url('img/toolbarbg.png') center repeat-x; +} + +.cirkuitSkin table.mceToolbar, .cirkuitSkin tr.mceFirst .mceToolbar tr td, .cirkuitSkin tr.mceLast .mceToolbar tr td { + border: 0; + margin: 0; + padding: 0; +} + +.cirkuitSkin td.mceToolbar { + padding-top: 1px; + vertical-align: top; + background-color: #DFDFDF; +} + +.cirkuitSkin .mceIframeContainer { + border-top: 1px solid #CCC; + border-bottom: 1px solid #CCC; + /*height: 100%; 5/22/2010 - Joe Rozzi - taken out comparing to default theme ui.css */ +} + +.cirkuitSkin .mceStatusbar { + font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; + font-size: 9pt; + line-height: 16px; + overflow: visible; + color: #666; + display: block; + height: 20px +} + +.cirkuitSkin .mceStatusbar div { + float: left; + /*margin: 3px 0 0 4px;*/ + margin:2px; + color: #666; +} + +.cirkuitSkin .mceStatusbar a.mceResize { + display: block; + float: right; + background: url('img/icons.png') -801px -2px; + width: 20px; + height: 20px; + cursor: se-resize; + outline:0; +} + +.cirkuitSkin .mceStatusbar a:hover { + text-decoration: underline +} + +.cirkuitSkin table.mceToolbar { + margin-left: 3px +} + +.cirkuitSkin span.mceIcon, .cirkuitSkin img.mceIcon { + display: block; + width: 20px; + height: 20px +} + +.cirkuitSkin .mceIcon { + background: url('img/icons.png') no-repeat 20px 20px +} + +.cirkuitSkin td.mceCenter { + text-align: center; +} + +.cirkuitSkin td.mceCenter table { + margin: 0 auto; + text-align: left; +} + +.cirkuitSkin td.mceRight table { + margin: 0 0 0 auto; +} + +/* Button */ +.cirkuitSkin .mceButton { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; + background-image: url("img/butt2.png"); + background-position: left top; + background-repeat: repeat-x; + cursor: default; + display: block; + height: 20px; + margin: 1px; + padding: 1px 2px; + width: 20px; + background-color: #E9E8E8; + border-color: #B2B2B2; +} + +.cirkuitSkin a.mceButtonEnabled:hover { + background-position: 0 -10px; + border-color: #777; +} + +.cirkuitSkin a.mceButtonActive, .cirkuitSkin a.mceButtonSelected { + background-image: inherit; + border-color: #333; + background: #bcd0f5 !important; +} + +.cirkuitSkin .mceButtonDisabled .mceIcon { + opacity: 0.3; + -ms-filter: 'alpha(opacity=30)'; + filter: alpha(opacity = 30); +} + +.cirkuitSkin .mceButtonLabeled { + width: auto; +} + +.cirkuitSkin .mceButtonLabeled span.mceIcon { + float: left; +} + +.cirkuitSkin span.mceButtonLabel { + display: block; + font-size: 10px; + padding: 4px 6px 0 22px; + font-family: Tahoma, Verdana, Arial, Helvetica; +} + +.cirkuitSkin .mceButtonDisabled .mceButtonLabel { + color: #888; +} + +/* Separator */ +.cirkuitSkin .mceSeparator { + background: none repeat scroll 0 0 transparent; + display: block; + height: 24px; + margin: 0 2px; + overflow: hidden; + width: 1px; +} + +/* ListBox */ +.cirkuitSkin .mceListBox { + direction: ltr; + margin: 1px; +} + +.cirkuitSkin .mceListBox, .cirkuitSkin .mceListBox a { + display: block +} + +.cirkuitSkin .mceListBox .mceText { + padding: 1px 2px 1px 5px; + text-align: left; + text-decoration: none !important; + width: 70px; + background-image: url(img/butt2.png); + background-position: left top; + background-repeat: repeat-x; + font-family: Tahoma, Verdana, Arial, Helvetica; + font-size: 11px; + height: 20px; + line-height: 20px; + overflow: hidden; +} + +.cirkuitSkin .mceListBox .mceText, .cirkuitSkin .mceListBox .mceOpen { + background-color: #D5D5D5; + border-color: #B2B2B2; +} + +.cirkuitSkin table.mceListBoxEnabled:hover .mceOpen, .cirkuitSkin .mceListBoxHover .mceOpen, .cirkuitSkin .mceListBoxSelected .mceOpen, .cirkuitSkin .mceListBoxSelected .mceText { + border-color: #777 !important; + background-color: #d5d5d5 !important; +} + +.cirkuitSkin table.mceListBoxEnabled:hover .mceText, .cirkuitSkin .mceListBoxHover .mceText { + border-color: #777 !important; +} + +.cirkuitSkin table.mceListBoxEnabled:hover .mceText, .cirkuitSkin .mceListBoxHover .mceText, .cirkuitSkin .mceListBoxSelected .mceText, .cirkuitSkin table.mceListBoxEnabled:hover .mceOpen, .cirkuitSkin .mceListBoxHover .mceOpen, .cirkuitSkin .mceListBoxSelected .mceOpen { + background-image: none; +} + +.cirkuitSkin .mceListBoxDisabled a.mceText { + color: gray; + background-color: transparent; +} + +.cirkuitSkin .mceListBoxMenu { + overflow: auto; + overflow-x: hidden +} + +.cirkuitSkin .mceOldBoxModel .mceListBox .mceText { + height: 22px +} + +.cirkuitSkin .mceOldBoxModel .mceListBox .mceOpen { + width: 11px; + height: 22px; +} + +.cirkuitSkin select.mceNativeListBox { + font: 11px 'Lucida Grande', Helvetica, Arial, sans-serif; + background: #F0F0EE; + border: 1px solid gray; + margin-right: 2px; +} + +.cirkuitSkin .mceListBox .mceOpen { + width: 14px; + height: 20px; + border-collapse: separate; + background-image: url(img/butt2.png); + background-position: left top; + background-repeat: repeat-x; + padding: 1px; + border-left: 0 none !important; +} + +.cirkuitSkin .mceListBox .mceOpen span { + display: block; + width: 14px; + height: 20px; + background-image: url(img/down_arrow.gif); + background-position: 2px 1px; + background-repeat: no-repeat; +} + +/* SplitButton */ +.cirkuitSkin .mceSplitButton { + width: 32px; + height: 20px; + direction: ltr +} + +.cirkuitSkin .mceSplitButton a, .cirkuitSkin .mceSplitButton span { + height: 20px; +} + +.cirkuitSkin .mceSplitButton a { + display: block; +} + +.cirkuitSkin .mceSplitButton a.mceAction { + height: 20px; + width: 20px; + padding: 1px 2px; + display: block; +} + +.cirkuitSkin .mceSplitButton span.mceAction { + width: 20px; + background: url('img/icons.png') 20px 20px; + display: block; +} + +.cirkuitSkin .mceSplitButton a.mceOpen { + width: 10px; + height: 20px; + background-image: url(img/down_arrow.gif); + background-position: 1px 2px; + background-repeat: no-repeat; + padding: 1px; + border-left: 0 none !important; +} + +.cirkuitSkin .mceSplitButtonDisabled .mceAction, .cirkuitSkin .mceSplitButtonDisabled span.mceOpen { + opacity: 0.3; + filter: alpha(opacity = 30); +} + +.cirkuitSkin .mceSplitButtonActive a.mceAction { + border: 1px solid #0A246A; + background-color: #C2CBE0; +} + +.cirkuitSkin table.mceSplitButton td { + background-image: url(img/butt2.png); + background-position: left top; + background-repeat: repeat-x; +} + +.cirkuitSkin .mceSplitButton a.mceAction, .cirkuitSkin .mceSplitButton a.mceOpen { + border-color: #B2B2B2; +} + +.cirkuitSkin .mceListBox a.mceText, .cirkuitSkin .mceSplitButton a.mceAction { + -moz-border-radius-bottomleft: 3px; + -webkit-border-bottom-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -moz-border-radius-topleft: 3px; + -webkit-border-top-left-radius: 3px; + -khtml-border-top-left-radius: 3px; + border-top-left-radius: 3px; +} + +.cirkuitSkin .mceSplitButton a.mceOpen, .cirkuitSkin .mceListBox a.mceOpen { + -moz-border-radius-bottomright: 3px; + -webkit-border-bottom-right-radius: 3px; + -khtml-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -webkit-border-top-right-radius: 3px; + -khtml-border-top-right-radius: 3px; + border-top-right-radius: 3px; +} + +.cirkuitSkin .mceSplitButton a.mceOpen:hover, .cirkuitSkin .mceSplitButtonSelected a.mceOpen, .cirkuitSkin table.mceSplitButtonEnabled:hover a.mceAction, .cirkuitSkin .mceSplitButton a.mceAction:hover { + background-color: #d5d5d5; + border-color: #777 !important; +} + +/* ColorSplitButton */ +.cirkuitSkin div.mceColorSplitMenu table { + background: #FFF; + border: 1px solid gray +} + +.cirkuitSkin .mceColorSplitMenu td { + padding: 2px +} + +.cirkuitSkin .mceColorSplitMenu a { + display: block; + width: 9px; + height: 9px; + overflow: hidden; + border: 1px solid #808080 +} + +.cirkuitSkin .mceColorSplitMenu td.mceMoreColors { + padding: 1px 3px 1px 1px +} + +.cirkuitSkin .mceColorSplitMenu a.mceMoreColors { + width: 100%; + height: auto; + text-align: center; + font-family: Tahoma, Verdana, Arial, Helvetica; + font-size: 11px; + line-height: 20px; + border: 1px solid #FFF +} + +.cirkuitSkin .mceColorSplitMenu a.mceMoreColors:hover { + border: 1px solid #0A246A; + background-color: #B6BDD2 +} + +.cirkuitSkin a.mceMoreColors:hover { + border: 1px solid #0A246A +} + +.cirkuitSkin .mceColorPreview { + margin-left: 2px; + width: 16px; + height: 3px; + overflow: hidden; + background: #9a9b9a +} + +.cirkuitSkin .mce_forecolor span.mceAction, .cirkuitSkin .mce_backcolor span.mceAction { + overflow: hidden; + height: 16px +} + +/* Menu */ +.cirkuitSkin .mceMenu { + position: absolute; + left: 0; + top: 0; + z-index: 1000; + border: 1px solid #D4D0C8 +} + +.cirkuitSkin .mceNoIcons span.mceIcon { + width: 0; +} + +.cirkuitSkin .mceNoIcons a .mceText { + padding-left: 10px +} + +.cirkuitSkin .mceMenu table { + background: #FFF +} + +.cirkuitSkin .mceMenu a, .cirkuitSkin .mceMenu span, .cirkuitSkin .mceMenu { + display: block +} + +.cirkuitSkin .mceMenu td { + height: 20px +} + +.cirkuitSkin .mceMenu a { + position: relative; + padding: 3px 0 4px 0 +} + +.cirkuitSkin .mceMenu .mceText { + position: relative; + display: block; + font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; + color: #000; + cursor: default; + margin: 0; + padding: 0 25px 0 25px; + display: block +} + +.cirkuitSkin .mceMenu span.mceText, .cirkuitSkin .mceMenu .mcePreview { + font-size: 11px +} + +.cirkuitSkin .mceMenu pre.mceText { + font-family: Monospace +} + +.cirkuitSkin .mceMenu .mceIcon { + position: absolute; + top: 0; + left: 0; + width: 22px; +} + +.cirkuitSkin .mceMenu .mceMenuItemEnabled a:hover, .cirkuitSkin .mceMenu .mceMenuItemActive { + background-color: #dbecf3 +} + +.cirkuitSkin td.mceMenuItemSeparator { + background: #DDD; + height: 1px +} + +.cirkuitSkin .mceMenuItemTitle a { + border: 0; + background: #EEE; + border-bottom: 1px solid #DDD +} + +.cirkuitSkin .mceMenuItemTitle span.mceText { + color: #000; + font-weight: bold; + padding-left: 4px +} + +.cirkuitSkin .mceMenuItemDisabled .mceText { + color: #888 +} + +.cirkuitSkin .mceMenuItemSelected .mceIcon { + background: url('img/menu-check.png') +} + +.cirkuitSkin .mceNoIcons .mceMenuItemSelected a { + background: url('img/menu-arrow.png') no-repeat -6px center +} + +.cirkuitSkin .mceMenu span.mceMenuLine { + display: none +} + +.cirkuitSkin .mceMenuItemSub a { + background: url('img/menu-arrow.png') no-repeat top right; +} + +/* Progress,Resize */ +.cirkuitSkin .mceBlocker { + position: absolute; + left: 0; + top: 0; + z-index: 1000; + opacity: 0.5; + -ms-filter: 'alpha(opacity=50)'; + filter: alpha(opacity = 50); + background: #FFF +} + +.cirkuitSkin .mceProgress { + position: absolute; + left: 0; + top: 0; + z-index: 1001; + background: url('img/progress.gif') no-repeat; + width: 32px; + height: 32px; + margin: -16px 0 0 -16px +} + +.cirkuitSkin .mcePlaceHolder { + border: 1px dotted gray +} + +/* Formats */ +.cirkuitSkin .mce_formatPreview a { + font-size: 10px +} + +.cirkuitSkin .mce_p span.mceText { +} + +.cirkuitSkin .mce_address span.mceText { + font-style: italic +} + +.cirkuitSkin .mce_pre span.mceText { + font-family: monospace +} + +.cirkuitSkin .mce_h1 span.mceText { + font-weight: bolder; + font-size: 2em +} + +.cirkuitSkin .mce_h2 span.mceText { + font-weight: bolder; + font-size: 1.5em +} + +.cirkuitSkin .mce_h3 span.mceText { + font-weight: bolder; + font-size: 1.17em +} + +.cirkuitSkin .mce_h4 span.mceText { + font-weight: bolder; + font-size: 1em +} + +.cirkuitSkin .mce_h5 span.mceText { + font-weight: bolder; + font-size: .83em +} + +.cirkuitSkin .mce_h6 span.mceText { + font-weight: bolder; + font-size: .75em +} + +/* border */ +.cirkuitSkin .mceExternalToolbar, .cirkuitSkin .mceButton, .cirkuitSkin a.mceButtonEnabled:hover, .cirkuitSkin a.mceButtonActive, .cirkuitSkin a.mceButtonSelected, .cirkuitSkin .mceListBox .mceText, .cirkuitSkin .mceListBox .mceOpen, .cirkuitSkin table.mceListBoxEnabled:hover .mceText, .cirkuitSkin .mceListBoxHover .mceText, .cirkuitSkin .mceListBoxSelected .mceText, .cirkuitSkin table.mceListBoxEnabled:hover .mceOpen, .cirkuitSkin .mceListBoxHover .mceOpen, .cirkuitSkin .mceListBoxSelected .mceOpen, .cirkuitSkin select.mceListBox, .cirkuitSkin .mceSplitButton a.mceAction, .cirkuitSkin .mceSplitButton a.mceOpen, .cirkuitSkin .mceSplitButton a.mceOpen:hover, .cirkuitSkin .mceSplitButtonSelected a.mceOpen, .cirkuitSkin table.mceSplitButtonEnabled:hover a.mceAction, .cirkuitSkin .mceSplitButton a.mceAction:hover, .cirkuitSkin div.mceColorSplitMenu table, .cirkuitSkin .mceColorSplitMenu a, .cirkuitSkin .mceColorSplitMenu a.mceMoreColors, .cirkuitSkin .mceColorSplitMenu a.mceMoreColors:hover, .cirkuitSkin a.mceMoreColors:hover, .cirkuitSkin .mceMenu { + border-style: solid; + border-width: 1px; +} + +/* Theme */ +.cirkuitSkin span.mce_bold { + background-position: 0 0 !important; +} + +.cirkuitSkin span.mce_italic { + background-position: -60px 0 !important; +} + +.cirkuitSkin span.mce_underline { + background-position: -140px 0 !important; +} + +.cirkuitSkin span.mce_strikethrough { + background-position: -120px 0 !important; +} + +.cirkuitSkin span.mce_undo { + background-position: -160px 0 !important; +} + +.cirkuitSkin span.mce_redo { + background-position: -100px 0 !important; +} + +.cirkuitSkin span.mce_cleanup { + background-position: -40px 0 !important; +} + +.cirkuitSkin span.mce_bullist { + background-position: -20px 0 !important; +} + +.cirkuitSkin span.mce_numlist { + background-position: -80px 0 !important; +} + +.cirkuitSkin span.mce_justifyleft { + background-position: -460px 0 !important; +} + +.cirkuitSkin span.mce_justifyright { + background-position: -480px 0 !important; +} + +.cirkuitSkin span.mce_justifycenter { + background-position: -420px 0 !important; +} + +.cirkuitSkin span.mce_justifyfull { + background-position: -440px 0 !important; +} + +.cirkuitSkin span.mce_anchor { + background-position: -200px 0 !important; +} + +.cirkuitSkin span.mce_indent { + background-position: -400px 0 !important; +} + +.cirkuitSkin span.mce_outdent { + background-position: -540px 0 !important; +} + +.cirkuitSkin span.mce_link { + background-position: -500px 0 !important; +} + +.cirkuitSkin span.mce_unlink { + background-position: -640px 0 !important; +} + +.cirkuitSkin span.mce_sub { + background-position: -600px 0 !important; +} + +.cirkuitSkin span.mce_sup { + background-position: -620px 0 !important; +} + +.cirkuitSkin span.mce_removeformat { + background-position: -580px 0 !important; +} + +.cirkuitSkin span.mce_newdocument { + background-position: -520px 0 !important; +} + +.cirkuitSkin span.mce_image { + background-position: -380px 0 !important; +} + +.cirkuitSkin span.mce_help { + background-position: -340px 0 !important; +} + +.cirkuitSkin span.mce_code { + background-position: -260px 0 !important; +} + +.cirkuitSkin span.mce_hr { + background-position: -360px 0 !important; +} + +.cirkuitSkin span.mce_visualaid { + background-position: -660px 0 !important; +} + +.cirkuitSkin span.mce_charmap { + background-position: -240px 0 !important; +} + +.cirkuitSkin span.mce_paste { + background-position: -560px 0 !important; +} + +.cirkuitSkin span.mce_copy { + background-position: -700px 0 !important; +} + +.cirkuitSkin span.mce_cut { + background-position: -680px 0 !important; +} + +.cirkuitSkin span.mce_blockquote { + background-position: -220px 0 !important; +} + +.cirkuitSkin .mce_forecolor span.mceAction { + background-position: -720px 0 !important; +} + +.cirkuitSkin .mce_backcolor span.mceAction { + background-position: -760px 0 !important; +} + +.cirkuitSkin span.mce_forecolorpicker { + background-position: -720px 0 !important; +} + +.cirkuitSkin span.mce_backcolorpicker { + background-position: -760px 0 !important; +} + +/* Plugins */ +.cirkuitSkin span.mce_advhr { + background-position: -0px -20px !important; +} + +.cirkuitSkin span.mce_ltr { + background-position: -20px -20px !important; +} + +.cirkuitSkin span.mce_rtl { + background-position: -40px -20px !important; +} + +.cirkuitSkin span.mce_emotions { + background-position: -60px -20px !important; +} + +.cirkuitSkin span.mce_fullpage { + background-position: -80px -20px !important; +} + +.cirkuitSkin span.mce_fullscreen { + background-position: -100px -20px !important; +} + +.cirkuitSkin span.mce_iespell { + background-position: -120px -20px !important; +} + +.cirkuitSkin span.mce_insertdate { + background-position: -140px -20px !important; +} + +.cirkuitSkin span.mce_inserttime { + background-position: -160px -20px !important; +} + +.cirkuitSkin span.mce_absolute { + background-position: -180px -20px !important; +} + +.cirkuitSkin span.mce_backward { + background-position: -200px -20px !important; +} + +.cirkuitSkin span.mce_forward { + background-position: -220px -20px !important; +} + +.cirkuitSkin span.mce_insert_layer { + background-position: -240px -20px !important; +} + +.cirkuitSkin span.mce_insertlayer { + background-position: -260px -20px !important; +} + +.cirkuitSkin span.mce_movebackward { + background-position: -280px -20px !important; +} + +.cirkuitSkin span.mce_moveforward { + background-position: -300px -20px !important; +} + +.cirkuitSkin span.mce_media { + background-position: -320px -20px !important; +} + +.cirkuitSkin span.mce_nonbreaking { + background-position: -340px -20px !important; +} + +.cirkuitSkin span.mce_pastetext { + background-position: -360px -20px !important; +} + +.cirkuitSkin span.mce_pasteword { + background-position: -380px -20px !important; +} + +.cirkuitSkin span.mce_selectall { + background-position: -400px -20px !important; +} + +.cirkuitSkin span.mce_preview { + background-position: -420px -20px !important; +} + +.cirkuitSkin span.mce_print { + background-position: -440px -20px !important; +} + +.cirkuitSkin span.mce_cancel { + background-position: -460px -20px !important; +} + +.cirkuitSkin span.mce_save { + background-position: -480px -20px !important; +} + +.cirkuitSkin span.mce_replace { + background-position: -500px -20px !important; +} + +.cirkuitSkin span.mce_search { + background-position: -520px -20px !important; +} + +.cirkuitSkin span.mce_styleprops { + background-position: -560px -20px !important; +} + +.cirkuitSkin span.mce_table { + background-position: -580px -20px !important; +} + +.cirkuitSkin span.mce_cell_props { + background-position: -600px -20px !important; +} + +.cirkuitSkin span.mce_delete_table { + background-position: -620px -20px !important; +} + +.cirkuitSkin span.mce_delete_col { + background-position: -640px -20px !important; +} + +.cirkuitSkin span.mce_delete_row { + background-position: -660px -20px !important; +} + +.cirkuitSkin span.mce_col_after { + background-position: -680px -20px !important; +} + +.cirkuitSkin span.mce_col_before { + background-position: -700px -20px !important; +} + +.cirkuitSkin span.mce_row_after { + background-position: -720px -20px !important; +} + +.cirkuitSkin span.mce_row_before { + background-position: -740px -20px !important; +} + +.cirkuitSkin span.mce_merge_cells { + background-position: -760px -20px !important; +} + +.cirkuitSkin span.mce_table_props { + background-position: -980px -20px !important; +} + +.cirkuitSkin span.mce_row_props { + background-position: -780px -20px !important; +} + +.cirkuitSkin span.mce_split_cells { + background-position: -800px -20px !important; +} + +.cirkuitSkin span.mce_template { + background-position: -820px -20px !important; +} + +.cirkuitSkin span.mce_visualchars { + background-position: -840px -20px !important; +} + +.cirkuitSkin span.mce_abbr { + background-position: -860px -20px !important; +} + +.cirkuitSkin span.mce_acronym { + background-position: -880px -20px !important; +} + +.cirkuitSkin span.mce_attribs { + background-position: -900px -20px !important; +} + +.cirkuitSkin span.mce_cite { + background-position: -920px -20px !important; +} + +.cirkuitSkin span.mce_del { + background-position: -940px -20px !important; +} + +.cirkuitSkin span.mce_ins { + background-position: -960px -20px !important; +} + +.cirkuitSkin span.mce_pagebreak { + background-position: 0 -40px !important; +} + +.cirkuitSkin .mce_spellchecker span.mceAction { + background-position: -540px -20px !important; +} + +.cirkuitSkin span.mce_restoredraft { + background-position: -20px -40px !important; +} diff --git a/js/tiny_mce/themes/advanced/skins/default/content.css b/js/tiny_mce/themes/advanced/skins/default/content.css new file mode 100644 index 000000000..03634668e --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/default/content.css @@ -0,0 +1,47 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/js/tiny_mce/themes/advanced/skins/default/dialog.css b/js/tiny_mce/themes/advanced/skins/default/dialog.css new file mode 100644 index 000000000..f01222650 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/default/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/js/tiny_mce/themes/advanced/skins/default/img/buttons.png b/js/tiny_mce/themes/advanced/skins/default/img/buttons.png new file mode 100644 index 000000000..7dd58418b Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/buttons.png differ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/items.gif b/js/tiny_mce/themes/advanced/skins/default/img/items.gif new file mode 100644 index 000000000..2eafd7954 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/items.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/js/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100644 index 000000000..85e31dfb2 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/js/tiny_mce/themes/advanced/skins/default/img/menu_check.gif new file mode 100644 index 000000000..adfdddccd Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/menu_check.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/progress.gif b/js/tiny_mce/themes/advanced/skins/default/img/progress.gif new file mode 100644 index 000000000..5bb90fd6a Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/progress.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/js/tiny_mce/themes/advanced/skins/default/img/tabs.gif new file mode 100644 index 000000000..ce4be6355 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/default/img/tabs.gif differ diff --git a/js/tiny_mce/themes/advanced/skins/default/ui.css b/js/tiny_mce/themes/advanced/skins/default/ui.css new file mode 100644 index 000000000..556b51071 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/default/ui.css @@ -0,0 +1,213 @@ +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/js/tiny_mce/themes/advanced/skins/highcontrast/content.css b/js/tiny_mce/themes/advanced/skins/highcontrast/content.css new file mode 100644 index 000000000..c2e30c7a2 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -0,0 +1,23 @@ +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} diff --git a/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css new file mode 100644 index 000000000..b2ed097cd --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -0,0 +1,105 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +background:#F0F0EE; +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css new file mode 100644 index 000000000..901446e2b --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -0,0 +1,101 @@ +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/content.css b/js/tiny_mce/themes/advanced/skins/o2k7/content.css new file mode 100644 index 000000000..4ac4e4dfb --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -0,0 +1,46 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css new file mode 100644 index 000000000..ec0877224 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100644 index 000000000..12cfb419b Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png differ diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100644 index 000000000..8996c7493 Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png differ diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100644 index 000000000..bd5d2550c Binary files /dev/null and b/js/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png differ diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui.css new file mode 100644 index 000000000..df596bf78 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -0,0 +1,216 @@ +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css new file mode 100644 index 000000000..50c9b76a2 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -0,0 +1,8 @@ +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css new file mode 100644 index 000000000..960a8e475 --- /dev/null +++ b/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -0,0 +1,5 @@ +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/js/tiny_mce/themes/advanced/source_editor.htm b/js/tiny_mce/themes/advanced/source_editor.htm new file mode 100644 index 000000000..3c6d65808 --- /dev/null +++ b/js/tiny_mce/themes/advanced/source_editor.htm @@ -0,0 +1,25 @@ + + + {#advanced_dlg.code_title} + + + + +
        +
        + +
        + +
        + +
        + + + +
        + + +
        +
        + + diff --git a/js/tiny_mce/tiny_mce.js b/js/tiny_mce/tiny_mce.js new file mode 100644 index 000000000..10bca2226 --- /dev/null +++ b/js/tiny_mce/tiny_mce.js @@ -0,0 +1,12834 @@ +(function(d) { + var a = /^\s*|\s*$/g, + e, c = "B".replace(/A(.)|B/, "$1") === "$1"; + var b = { + majorVersion: "3", + minorVersion: "4.1", + releaseDate: "2011-03-24", + _init: function() { + var s = this, + q = document, + o = navigator, + g = o.userAgent, + m, f, l, k, j, r; + s.isOpera = d.opera && opera.buildNumber; + s.isWebKit = /WebKit/.test(g); + s.isIE = !s.isWebKit && !s.isOpera && (/MSIE/gi).test(g) && (/Explorer/gi).test(o.appName); + s.isIE6 = s.isIE && /MSIE [56]/.test(g); + s.isGecko = !s.isWebKit && /Gecko/.test(g); + s.isMac = g.indexOf("Mac") != -1; + s.isAir = /adobeair/i.test(g); + s.isIDevice = /(iPad|iPhone)/.test(g); + if (d.tinyMCEPreInit) { + s.suffix = tinyMCEPreInit.suffix; + s.baseURL = tinyMCEPreInit.base; + s.query = tinyMCEPreInit.query; + return + } + s.suffix = ""; + f = q.getElementsByTagName("base"); + for (m = 0; m < f.length; m++) { + if (r = f[m].href) { + if (/^https?:\/\/[^\/]+$/.test(r)) { + r += "/" + } + k = r ? r.match(/.*\//)[0] : "" + } + } + function h(i) { + if (i.src && /tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)) { + if (/_(src|dev)\.js/g.test(i.src)) { + s.suffix = "_src" + } + if ((j = i.src.indexOf("?")) != -1) { + s.query = i.src.substring(j + 1) + } + s.baseURL = i.src.substring(0, i.src.lastIndexOf("/")); + if (k && s.baseURL.indexOf("://") == -1 && s.baseURL.indexOf("/") !== 0) { + s.baseURL = k + s.baseURL + } + return s.baseURL + } + return null + } + f = q.getElementsByTagName("script"); + for (m = 0; m < f.length; m++) { + if (h(f[m])) { + return + } + } + l = q.getElementsByTagName("head")[0]; + if (l) { + f = l.getElementsByTagName("script"); + for (m = 0; m < f.length; m++) { + if (h(f[m])) { + return + } + } + } + return + }, + is: function(g, f) { + if (!f) { + return g !== e + } + if (f == "array" && (g.hasOwnProperty && g instanceof Array)) { + return true + } + return typeof(g) == f + }, + makeMap: function(f, j, h) { + var g; + f = f || []; + j = j || ","; + if (typeof(f) == "string") { + f = f.split(j) + } + h = h || {}; + g = f.length; + while (g--) { + h[f[g]] = {} + } + return h + }, + each: function(i, f, h) { + var j, g; + if (!i) { + return 0 + } + h = h || i; + if (i.length !== e) { + for (j = 0, g = i.length; j < g; j++) { + if (f.call(h, i[j], j, i) === false) { + return 0 + } + } + } else { + for (j in i) { + if (i.hasOwnProperty(j)) { + if (f.call(h, i[j], j, i) === false) { + return 0 + } + } + } + } + return 1 + }, + map: function(g, h) { + var i = []; + b.each(g, function(f) { + i.push(h(f)) + }); + return i + }, + grep: function(g, h) { + var i = []; + b.each(g, function(f) { + if (!h || h(f)) { + i.push(f) + } + }); + return i + }, + inArray: function(g, h) { + var j, f; + if (g) { + for (j = 0, f = g.length; j < f; j++) { + if (g[j] === h) { + return j + } + } + } + return -1 + }, + extend: function(k, j) { + var h, g, f = arguments; + for (h = 1, g = f.length; h < g; h++) { + j = f[h]; + b.each(j, function(i, l) { + if (i !== e) { + k[l] = i + } + }) + } + return k + }, + trim: function(f) { + return (f ? "" + f : "").replace(a, "") + }, + create: function(o, f, j) { + var n = this, + g, i, k, l, h, m = 0; + o = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(o); + k = o[3].match(/(^|\.)(\w+)$/i)[2]; + i = n.createNS(o[3].replace(/\.\w+$/, ""), j); + if (i[k]) { + return + } + if (o[2] == "static") { + i[k] = f; + if (this.onCreate) { + this.onCreate(o[2], o[3], i[k]) + } + return + } + if (!f[k]) { + f[k] = function() {}; + m = 1 + } + i[k] = f[k]; + n.extend(i[k].prototype, f); + if (o[5]) { + g = n.resolve(o[5]).prototype; + l = o[5].match(/\.(\w+)$/i)[1]; + h = i[k]; + if (m) { + i[k] = function() { + return g[l].apply(this, arguments) + } + } else { + i[k] = function() { + this.parent = g[l]; + return h.apply(this, arguments) + } + } + i[k].prototype[k] = i[k]; + n.each(g, function(p, q) { + i[k].prototype[q] = g[q] + }); + n.each(f, function(p, q) { + if (g[q]) { + i[k].prototype[q] = function() { + this.parent = g[q]; + return p.apply(this, arguments) + } + } else { + if (q != k) { + i[k].prototype[q] = p + } + } + }) + } + n.each(f["static"], function(p, q) { + i[k][q] = p + }); + if (this.onCreate) { + this.onCreate(o[2], o[3], i[k].prototype) + } + }, + walk: function(i, h, j, g) { + g = g || this; + if (i) { + if (j) { + i = i[j] + } + b.each(i, function(k, f) { + if (h.call(g, k, f, j) === false) { + return false + } + b.walk(k, h, j, g) + }) + } + }, + createNS: function(j, h) { + var g, f; + h = h || d; + j = j.split("."); + for (g = 0; g < j.length; g++) { + f = j[g]; + if (!h[f]) { + h[f] = {} + } + h = h[f] + } + return h + }, + resolve: function(j, h) { + var g, f; + h = h || d; + j = j.split("."); + for (g = 0, f = j.length; g < f; g++) { + h = h[j[g]]; + if (!h) { + break + } + } + return h + }, + addUnload: function(j, i) { + var h = this; + j = { + func: j, + scope: i || this + }; + if (!h.unloads) { + function g() { + var f = h.unloads, + l, m; + if (f) { + for (m in f) { + l = f[m]; + if (l && l.func) { + l.func.call(l.scope, 1) + } + } + if (d.detachEvent) { + d.detachEvent("onbeforeunload", k); + d.detachEvent("onunload", g) + } else { + if (d.removeEventListener) { + d.removeEventListener("unload", g, false) + } + } + h.unloads = l = f = w = g = 0; + if (d.CollectGarbage) { + CollectGarbage() + } + } + } + function k() { + var l = document; + if (l.readyState == "interactive") { + function f() { + l.detachEvent("onstop", f); + if (g) { + g() + } + l = 0 + } + if (l) { + l.attachEvent("onstop", f) + } + d.setTimeout(function() { + if (l) { + l.detachEvent("onstop", f) + } + }, 0) + } + } + if (d.attachEvent) { + d.attachEvent("onunload", g); + d.attachEvent("onbeforeunload", k) + } else { + if (d.addEventListener) { + d.addEventListener("unload", g, false) + } + } + h.unloads = [j] + } else { + h.unloads.push(j) + } + return j + }, + removeUnload: function(i) { + var g = this.unloads, + h = null; + b.each(g, function(j, f) { + if (j && j.func == i) { + g.splice(f, 1); + h = i; + return false + } + }); + return h + }, + explode: function(f, g) { + return f ? b.map(f.split(g || ","), b.trim) : f + }, + _addVer: function(g) { + var f; + if (!this.query) { + return g + } + f = (g.indexOf("?") == -1 ? "?" : "&") + this.query; + if (g.indexOf("#") == -1) { + return g + f + } + return g.replace("#", f + "#") + }, + _replace: function(h, f, g) { + if (c) { + return g.replace(h, function() { + var l = f, + j = arguments, + k; + for (k = 0; k < j.length - 2; k++) { + if (j[k] === e) { + l = l.replace(new RegExp("\\$" + k, "g"), "") + } else { + l = l.replace(new RegExp("\\$" + k, "g"), j[k]) + } + } + return l + }) + } + return g.replace(h, f) + } + }; + b._init(); + d.tinymce = d.tinyMCE = b +})(window); +tinymce.create("tinymce.util.Dispatcher", { + scope: null, + listeners: null, + Dispatcher: function(a) { + this.scope = a || this; + this.listeners = [] + }, + add: function(a, b) { + this.listeners.push({ + cb: a, + scope: b || this.scope + }); + return a + }, + addToTop: function(a, b) { + this.listeners.unshift({ + cb: a, + scope: b || this.scope + }); + return a + }, + remove: function(a) { + var b = this.listeners, + c = null; + tinymce.each(b, function(e, d) { + if (a == e.cb) { + c = a; + b.splice(d, 1); + return false + } + }); + return c + }, + dispatch: function() { + var f, d = arguments, + e, b = this.listeners, + g; + for (e = 0; e < b.length; e++) { + g = b[e]; + f = g.cb.apply(g.scope, d); + if (f === false) { + break + } + } + return f + } +}); +(function() { + var a = tinymce.each; + tinymce.create("tinymce.util.URI", { + URI: function(e, g) { + var f = this, + h, d, c; + e = tinymce.trim(e); + g = f.settings = g || {}; + if (/^(mailto|tel|news|javascript|about|data):/i.test(e) || /^\s*#/.test(e)) { + f.source = e; + return + } + if (e.indexOf("/") === 0 && e.indexOf("//") !== 0) { + e = (g.base_uri ? g.base_uri.protocol || "http" : "http") + "://mce_host" + e + } + if (!/^\w*:?\/\//.test(e)) { + e = (g.base_uri.protocol || "http") + "://mce_host" + f.toAbsPath(g.base_uri.path, e) + } + e = e.replace(/@@/g, "(mce_at)"); + e = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e); + a(["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], function(b, j) { + var k = e[j]; + if (k) { + k = k.replace(/\(mce_at\)/g, "@@") + } + f[b] = k + }); + if (c = g.base_uri) { + if (!f.protocol) { + f.protocol = c.protocol + } + if (!f.userInfo) { + f.userInfo = c.userInfo + } + if (!f.port && f.host == "mce_host") { + f.port = c.port + } + if (!f.host || f.host == "mce_host") { + f.host = c.host + } + f.source = "" + } + }, + setPath: function(c) { + var b = this; + c = /^(.*?)\/?(\w+)?$/.exec(c); + b.path = c[0]; + b.directory = c[1]; + b.file = c[2]; + b.source = ""; + b.getURI() + }, + toRelative: function(b) { + var c = this, + d; + if (b === "./") { + return b + } + b = new tinymce.util.URI(b, { + base_uri: c + }); + if ((b.host != "mce_host" && c.host != b.host && b.host) || c.port != b.port || c.protocol != b.protocol) { + return b.getURI() + } + d = c.toRelPath(c.path, b.path); + if (b.query) { + d += "?" + b.query + } + if (b.anchor) { + d += "#" + b.anchor + } + return d + }, + toAbsolute: function(b, c) { + var b = new tinymce.util.URI(b, { + base_uri: this + }); + return b.getURI(this.host == b.host && this.protocol == b.protocol ? c : 0) + }, + toRelPath: function(g, h) { + var c, f = 0, + d = "", + e, b; + g = g.substring(0, g.lastIndexOf("/")); + g = g.split("/"); + c = h.split("/"); + if (g.length >= c.length) { + for (e = 0, b = g.length; e < b; e++) { + if (e >= c.length || g[e] != c[e]) { + f = e + 1; + break + } + } + } + if (g.length < c.length) { + for (e = 0, b = c.length; e < b; e++) { + if (e >= g.length || g[e] != c[e]) { + f = e + 1; + break + } + } + } + if (f == 1) { + return h + } + for (e = 0, b = g.length - (f - 1); e < b; e++) { + d += "../" + } + for (e = f - 1, b = c.length; e < b; e++) { + if (e != f - 1) { + d += "/" + c[e] + } else { + d += c[e] + } + } + return d + }, + toAbsPath: function(e, f) { + var c, b = 0, + h = [], + d, g; + d = /\/$/.test(f) ? "/" : ""; + e = e.split("/"); + f = f.split("/"); + a(e, function(i) { + if (i) { + h.push(i) + } + }); + e = h; + for (c = f.length - 1, h = []; c >= 0; c--) { + if (f[c].length == 0 || f[c] == ".") { + continue + } + if (f[c] == "..") { + b++; + continue + } + if (b > 0) { + b--; + continue + } + h.push(f[c]) + } + c = e.length - b; + if (c <= 0) { + g = h.reverse().join("/") + } else { + g = e.slice(0, c).join("/") + "/" + h.reverse().join("/") + } + if (g.indexOf("/") !== 0) { + g = "/" + g + } + if (d && g.lastIndexOf("/") !== g.length - 1) { + g += d + } + return g + }, + getURI: function(d) { + var c, b = this; + if (!b.source || d) { + c = ""; + if (!d) { + if (b.protocol) { + c += b.protocol + "://" + } + if (b.userInfo) { + c += b.userInfo + "@" + } + if (b.host) { + c += b.host + } + if (b.port) { + c += ":" + b.port + } + } + if (b.path) { + c += b.path + } + if (b.query) { + c += "?" + b.query + } + if (b.anchor) { + c += "#" + b.anchor + } + b.source = c + } + return b.source + } + }) +})(); +(function() { + var a = tinymce.each; + tinymce.create("static tinymce.util.Cookie", { + getHash: function(d) { + var b = this.get(d), + c; + if (b) { + a(b.split("&"), function(e) { + e = e.split("="); + c = c || {}; + c[unescape(e[0])] = unescape(e[1]) + }) + } + return c + }, + setHash: function(j, b, g, f, i, c) { + var h = ""; + a(b, function(e, d) { + h += (!h ? "" : "&") + escape(d) + "=" + escape(e) + }); + this.set(j, h, g, f, i, c) + }, + get: function(i) { + var h = document.cookie, + g, f = i + "=", + d; + if (!h) { + return + } + d = h.indexOf("; " + f); + if (d == -1) { + d = h.indexOf(f); + if (d != 0) { + return null + } + } else { + d += 2 + } + g = h.indexOf(";", d); + if (g == -1) { + g = h.length + } + return unescape(h.substring(d + f.length, g)) + }, + set: function(i, b, g, f, h, c) { + document.cookie = i + "=" + escape(b) + ((g) ? "; expires=" + g.toGMTString() : "") + ((f) ? "; path=" + escape(f) : "") + ((h) ? "; domain=" + h : "") + ((c) ? "; secure" : "") + }, + remove: function(e, b) { + var c = new Date(); + c.setTime(c.getTime() - 1000); + this.set(e, "", c, b, c) + } + }) +})(); +(function() { + function serialize(o, quote) { + var i, v, t; + quote = quote || '"'; + if (o == null) { + return "null" + } + t = typeof o; + if (t == "string") { + v = "\bb\tt\nn\ff\rr\"\"''\\\\"; + return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { + if (quote === '"' && a === "'") { + return a + } + i = v.indexOf(b); + if (i + 1) { + return "\\" + v.charAt(i + 1) + } + a = b.charCodeAt().toString(16); + return "\\u" + "0000".substring(a.length) + a + }) + quote + } + if (t == "object") { + if (o.hasOwnProperty && o instanceof Array) { + for (i = 0, v = "["; i < o.length; i++) { + v += (i > 0 ? "," : "") + serialize(o[i], quote) + } + return v + "]" + } + v = "{"; + for (i in o) { + v += typeof o[i] != "function" ? (v.length > 1 ? "," + quote : quote) + i + quote + ":" + serialize(o[i], quote) : "" + } + return v + "}" + } + return "" + o + } + tinymce.util.JSON = { + serialize: serialize, + parse: function(s) { + try { + return eval("(" + s + ")") + } catch (ex) {} + } + } +})(); +tinymce.create("static tinymce.util.XHR", { + send: function(g) { + var a, e, b = window, + h = 0; + g.scope = g.scope || this; + g.success_scope = g.success_scope || g.scope; + g.error_scope = g.error_scope || g.scope; + g.async = g.async === false ? false : true; + g.data = g.data || ""; + + function d(i) { + a = 0; + try { + a = new ActiveXObject(i) + } catch (c) {} + return a + } + a = b.XMLHttpRequest ? new XMLHttpRequest() : d("Microsoft.XMLHTTP") || d("Msxml2.XMLHTTP"); + if (a) { + if (a.overrideMimeType) { + a.overrideMimeType(g.content_type) + } + a.open(g.type || (g.data ? "POST" : "GET"), g.url, g.async); + if (g.content_type) { + a.setRequestHeader("Content-Type", g.content_type) + } + a.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + a.send(g.data); + + function f() { + if (!g.async || a.readyState == 4 || h++ > 10000) { + if (g.success && h < 10000 && a.status == 200) { + g.success.call(g.success_scope, "" + a.responseText, a, g) + } else { + if (g.error) { + g.error.call(g.error_scope, h > 10000 ? "TIMED_OUT" : "GENERAL", a, g) + } + } + a = null + } else { + b.setTimeout(f, 10) + } + } + if (!g.async) { + return f() + } + e = b.setTimeout(f, 10) + } + } +}); +(function() { + var c = tinymce.extend, + b = tinymce.util.JSON, + a = tinymce.util.XHR; + tinymce.create("tinymce.util.JSONRequest", { + JSONRequest: function(d) { + this.settings = c({}, d); + this.count = 0 + }, + send: function(f) { + var e = f.error, + d = f.success; + f = c(this.settings, f); + f.success = function(h, g) { + h = b.parse(h); + if (typeof(h) == "undefined") { + h = { + error: "JSON Parse error." + } + } + if (h.error) { + e.call(f.error_scope || f.scope, h.error, g) + } else { + d.call(f.success_scope || f.scope, h.result) + } + }; + f.error = function(h, g) { + if (e) { + e.call(f.error_scope || f.scope, h, g) + } + }; + f.data = b.serialize({ + id: f.id || "c" + (this.count++), + method: f.method, + params: f.params + }); + f.content_type = "application/json"; + a.send(f) + }, + "static": { + sendRPC: function(d) { + return new tinymce.util.JSONRequest().send(d) + } + } + }) +}()); +(function(j) { + var a, g, d, k = /[&\"\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + b = /[<>&\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + f = /[<>&\"\']/g, + c = /&(#)?([\w]+);/g, + i = { + 128: "\u20AC", + 130: "\u201A", + 131: "\u0192", + 132: "\u201E", + 133: "\u2026", + 134: "\u2020", + 135: "\u2021", + 136: "\u02C6", + 137: "\u2030", + 138: "\u0160", + 139: "\u2039", + 140: "\u0152", + 142: "\u017D", + 145: "\u2018", + 146: "\u2019", + 147: "\u201C", + 148: "\u201D", + 149: "\u2022", + 150: "\u2013", + 151: "\u2014", + 152: "\u02DC", + 153: "\u2122", + 154: "\u0161", + 155: "\u203A", + 156: "\u0153", + 158: "\u017E", + 159: "\u0178" + }; + g = { + '"': """, + "'": "'", + "<": "<", + ">": ">", + "&": "&" + }; + d = { + "<": "<", + ">": ">", + "&": "&", + """: '"', + "'": "'" + }; + + function h(l) { + var m; + m = document.createElement("div"); + m.innerHTML = l; + return m.textContent || m.innerText || l + } + function e(m, p) { + var n, o, l, q = {}; + if (m) { + m = m.split(","); + p = p || 10; + for (n = 0; n < m.length; n += 2) { + o = String.fromCharCode(parseInt(m[n], p)); + if (!g[o]) { + l = "&" + m[n + 1] + ";"; + q[o] = l; + q[l] = o + } + } + return q + } + } + a = e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro", 32); + j.html = j.html || {}; + j.html.Entities = { + encodeRaw: function(m, l) { + return m.replace(l ? k : b, function(n) { + return g[n] || n + }) + }, + encodeAllRaw: function(l) { + return ("" + l).replace(f, function(m) { + return g[m] || m + }) + }, + encodeNumeric: function(m, l) { + return m.replace(l ? k : b, function(n) { + if (n.length > 1) { + return "&#" + (((n.charCodeAt(0) - 55296) * 1024) + (n.charCodeAt(1) - 56320) + 65536) + ";" + } + return g[n] || "&#" + n.charCodeAt(0) + ";" + }) + }, + encodeNamed: function(n, l, m) { + m = m || a; + return n.replace(l ? k : b, function(o) { + return g[o] || m[o] || o + }) + }, + getEncodeFunc: function(l, o) { + var p = j.html.Entities; + o = e(o) || a; + + function m(r, q) { + return r.replace(q ? k : b, function(s) { + return g[s] || o[s] || "&#" + s.charCodeAt(0) + ";" || s + }) + } + function n(r, q) { + return p.encodeNamed(r, q, o) + } + l = j.makeMap(l.replace(/\+/g, ",")); + if (l.named && l.numeric) { + return m + } + if (l.named) { + if (o) { + return n + } + return p.encodeNamed + } + if (l.numeric) { + return p.encodeNumeric + } + return p.encodeRaw + }, + decode: function(l) { + return l.replace(c, function(n, m, o) { + if (m) { + o = parseInt(o); + if (o > 65535) { + o -= 65536; + return String.fromCharCode(55296 + (o >> 10), 56320 + (o & 1023)) + } else { + return i[o] || String.fromCharCode(o) + } + } + return d[n] || a[n] || h(n) + }) + } + } +})(tinymce); +tinymce.html.Styles = function(d, f) { + var k = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, + h = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, + b = /\s*([^:]+):\s*([^;]+);?/g, + l = /\s+$/, + m = /rgb/, + e, g, a = {}, + j; + d = d || {}; + j = "\\\" \\' \\; \\: ; : _".split(" "); + for (g = 0; g < j.length; g++) { + a[j[g]] = "_" + g; + a["_" + g] = j[g] + } + function c(n, q, p, i) { + function o(r) { + r = parseInt(r).toString(16); + return r.length > 1 ? r : "0" + r + } + return "#" + o(q) + o(p) + o(i) + } + return { + toHex: function(i) { + return i.replace(k, c) + }, + parse: function(r) { + var y = {}, + p, n, v, q, u = d.url_converter, + x = d.url_converter_scope || this; + + function o(C, F) { + var E, B, A, D; + E = y[C + "-top" + F]; + if (!E) { + return + } + B = y[C + "-right" + F]; + if (E != B) { + return + } + A = y[C + "-bottom" + F]; + if (B != A) { + return + } + D = y[C + "-left" + F]; + if (A != D) { + return + } + y[C + F] = D; + delete y[C + "-top" + F]; + delete y[C + "-right" + F]; + delete y[C + "-bottom" + F]; + delete y[C + "-left" + F] + } + function t(B) { + var C = y[B], + A; + if (!C || C.indexOf(" ") < 0) { + return + } + C = C.split(" "); + A = C.length; + while (A--) { + if (C[A] !== C[0]) { + return false + } + } + y[B] = C[0]; + return true + } + function z(C, B, A, D) { + if (!t(B)) { + return + } + if (!t(A)) { + return + } + if (!t(D)) { + return + } + y[C] = y[B] + " " + y[A] + " " + y[D]; + delete y[B]; + delete y[A]; + delete y[D] + } + function s(A) { + q = true; + return a[A] + } + function i(B, A) { + if (q) { + B = B.replace(/_[0-9]/g, function(C) { + return a[C] + }) + } + if (!A) { + B = B.replace(/\\([\'\";:])/g, "$1") + } + return B + } + if (r) { + r = r.replace(/\\[\"\';:_]/g, s).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(A) { + return A.replace(/[;:]/g, s) + }); + while (p = b.exec(r)) { + n = p[1].replace(l, "").toLowerCase(); + v = p[2].replace(l, ""); + if (n && v.length > 0) { + if (n === "font-weight" && v === "700") { + v = "bold" + } else { + if (n === "color" || n === "background-color") { + v = v.toLowerCase() + } + } + v = v.replace(k, c); + v = v.replace(h, function(B, A, E, D, F, C) { + F = F || C; + if (F) { + F = i(F); + return "'" + F.replace(/\'/g, "\\'") + "'" + } + A = i(A || E || D); + if (u) { + A = u.call(x, A, "style") + } + return "url('" + A.replace(/\'/g, "\\'") + "')" + }); + y[n] = q ? i(v, true) : v + } + b.lastIndex = p.index + p[0].length + } + o("border", ""); + o("border", "-width"); + o("border", "-color"); + o("border", "-style"); + o("padding", ""); + o("margin", ""); + z("border", "border-width", "border-style", "border-color"); + if (y.border === "medium none") { + delete y.border + } + } + return y + }, + serialize: function(p, r) { + var o = "", + n, q; + + function i(t) { + var x, u, s, t, v; + x = f.styles[t]; + if (x) { + for (u = 0, s = x.length; u < s; u++) { + t = x[u]; + v = p[t]; + if (v !== e) { + o += (o.length > 0 ? " " : "") + t + ": " + v + ";" + } + } + } + } + if (r && f && f.styles) { + i("*"); + i(n) + } else { + for (n in p) { + q = p[n]; + if (q !== e) { + o += (o.length > 0 ? " " : "") + n + ": " + q + ";" + } + } + } + return o + } + } +}; +(function(l) { + var g = {}, + i, k, f, d, b, e, c = l.makeMap, + j = l.each; + + function h(n, m) { + return n.split(m || ",") + } + function a(q, p) { + var n, o = {}; + + function m(r) { + return r.replace(/[A-Z]+/g, function(s) { + return m(q[s]) + }) + } + for (n in q) { + if (q.hasOwnProperty(n)) { + q[n] = m(q[n]) + } + } + m(p).replace(/#/g, "#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(u, s, r, t) { + r = h(r, "|"); + o[s] = { + attributes: c(r), + attributesOrder: r, + children: c(t, "|", { + "#comment": {} + }) + } + }); + return o + } + k = "h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup"; + k = c(k, ",", c(k.toUpperCase())); + g = a({ + Z: "H|K|N|O|P", + Y: "X|form|R|Q", + ZG: "E|span|width|align|char|charoff|valign", + X: "p|T|div|U|W|isindex|fieldset|table", + ZF: "E|align|char|charoff|valign", + W: "pre|hr|blockquote|address|center|noframes", + ZE: "abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height", + ZD: "[E][S]", + U: "ul|ol|dl|menu|dir", + ZC: "p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q", + T: "h1|h2|h3|h4|h5|h6", + ZB: "X|S|Q", + S: "R|P", + ZA: "a|G|J|M|O|P", + R: "a|H|K|N|O", + Q: "noscript|P", + P: "ins|del|script", + O: "input|select|textarea|label|button", + N: "M|L", + M: "em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym", + L: "sub|sup", + K: "J|I", + J: "tt|i|b|u|s|strike", + I: "big|small|font|basefont", + H: "G|F", + G: "br|span|bdo", + F: "object|applet|img|map|iframe", + E: "A|B|C", + D: "accesskey|tabindex|onfocus|onblur", + C: "onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup", + B: "lang|xml:lang|dir", + A: "id|class|style|title" + }, "script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]"); + i = c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls"); + f = c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source"); + d = l.extend(c("td,th,iframe,video,object"), f); + b = c("pre,script,style"); + e = c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); + l.html.Schema = function(p) { + var x = this, + m = {}, + n = {}, + u = [], + o; + p = p || {}; + if (p.verify_html === false) { + p.valid_elements = "*[*]" + } + if (p.valid_styles) { + o = {}; + j(p.valid_styles, function(z, y) { + o[y] = l.explode(z) + }) + } + function v(y) { + return new RegExp("^" + y.replace(/([?+*])/g, ".$1") + "$") + } + function r(F) { + var E, A, T, P, U, z, C, O, R, K, S, W, I, D, Q, y, M, B, V, X, J, N, H = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, + L = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, + G = /[*?+]/; + if (F) { + F = h(F); + if (m["@"]) { + M = m["@"].attributes; + B = m["@"].attributesOrder + } + for (E = 0, A = F.length; E < A; E++) { + z = H.exec(F[E]); + if (z) { + Q = z[1]; + K = z[2]; + y = z[3]; + R = z[4]; + I = {}; + D = []; + C = { + attributes: I, + attributesOrder: D + }; + if (Q === "#") { + C.paddEmpty = true + } + if (Q === "-") { + C.removeEmpty = true + } + if (M) { + for (X in M) { + I[X] = M[X] + } + D.push.apply(D, B) + } + if (R) { + R = h(R, "|"); + for (T = 0, P = R.length; T < P; T++) { + z = L.exec(R[T]); + if (z) { + O = {}; + W = z[1]; + S = z[2].replace(/::/g, ":"); + Q = z[3]; + N = z[4]; + if (W === "!") { + C.attributesRequired = C.attributesRequired || []; + C.attributesRequired.push(S); + O.required = true + } + if (W === "-") { + delete I[S]; + D.splice(l.inArray(D, S), 1); + continue + } + if (Q) { + if (Q === "=") { + C.attributesDefault = C.attributesDefault || []; + C.attributesDefault.push({ + name: S, + value: N + }); + O.defaultValue = N + } + if (Q === ":") { + C.attributesForced = C.attributesForced || []; + C.attributesForced.push({ + name: S, + value: N + }); + O.forcedValue = N + } + if (Q === "<") { + O.validValues = c(N, "?") + } + } + if (G.test(S)) { + C.attributePatterns = C.attributePatterns || []; + O.pattern = v(S); + C.attributePatterns.push(O) + } else { + if (!I[S]) { + D.push(S) + } + I[S] = O + } + } + } + } + if (!M && K == "@") { + M = I; + B = D + } + if (y) { + C.outputName = K; + m[y] = C + } + if (G.test(K)) { + C.pattern = v(K); + u.push(C) + } else { + m[K] = C + } + } + } + } + } + function t(y) { + m = {}; + u = []; + r(y); + j(g, function(A, z) { + n[z] = A.children + }) + } + function q(z) { + var y = /^(~)?(.+)$/; + if (z) { + j(h(z), function(C) { + var B = y.exec(C), + D = B[1] === "~" ? "span" : "div", + A = B[2]; + n[A] = n[D]; + j(n, function(E, F) { + if (E[D]) { + E[A] = E[D] + } + }) + }) + } + } + function s(z) { + var y = /^([+\-]?)(\w+)\[([^\]]+)\]$/; + if (z) { + j(h(z), function(D) { + var C = y.exec(D), + A, B; + if (C) { + B = C[1]; + if (B) { + A = n[C[2]] + } else { + A = n[C[2]] = { + "#comment": {} + } + } + A = n[C[2]]; + j(h(C[3], "|"), function(E) { + if (B === "-") { + delete A[E] + } else { + A[E] = {} + } + }) + } + }) + } + } + if (!p.valid_elements) { + j(g, function(z, y) { + m[y] = { + attributes: z.attributes, + attributesOrder: z.attributesOrder + }; + n[y] = z.children + }); + j(h("strong/b,em/i"), function(y) { + y = h(y, "/"); + m[y[1]].outputName = y[0] + }); + m.img.attributesDefault = [{ + name: "alt", + value: "" + }]; + j(h("ol,ul,li,sub,sup,blockquote,tr,div,span,font,a,table,tbody"), function(y) { + m[y].removeEmpty = true + }); + j(h("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"), function(y) { + m[y].paddEmpty = true + }) + } else { + t(p.valid_elements) + } + q(p.custom_elements); + s(p.valid_children); + r(p.extended_valid_elements); + s("+ol[ul|ol],+ul[ul|ol]"); + if (p.invalid_elements) { + l.each(l.explode(p.invalid_elements), function(y) { + if (m[y]) { + delete m[y] + } + }) + } + x.children = n; + x.styles = o; + x.getBoolAttrs = function() { + return i + }; + x.getBlockElements = function() { + return k + }; + x.getShortEndedElements = function() { + return f + }; + x.getSelfClosingElements = function() { + return e + }; + x.getNonEmptyElements = function() { + return d + }; + x.getWhiteSpaceElements = function() { + return b + }; + x.isValidChild = function(y, A) { + var z = n[y]; + return !!(z && z[A]) + }; + x.getElementRule = function(y) { + var A = m[y], + z; + if (A) { + return A + } + z = u.length; + while (z--) { + A = u[z]; + if (A.pattern.test(y)) { + return A + } + } + }; + x.addValidElements = r; + x.setValidElements = t; + x.addCustomElements = q; + x.addValidChildren = s + }; + l.html.Schema.boolAttrMap = i; + l.html.Schema.blockElementsMap = k +})(tinymce); +(function(a) { + a.html.SaxParser = function(c, e) { + var b = this, + d = function() {}; + c = c || {}; + b.schema = e = e || new a.html.Schema(); + if (c.fix_self_closing !== false) { + c.fix_self_closing = true + } + a.each("comment cdata text start end pi doctype".split(" "), function(f) { + if (f) { + b[f] = c[f] || d + } + }); + b.parse = function(q) { + var A = this, + f, m = 0, + G, j, l = [], + B, K, t, N, F, k, p, x, I, r, E, o, J, n, H, M, L, z, D, h, g, u, s = 0, + v = a.html.Entities.decode, + y; + + function C(O) { + var Q, P; + Q = l.length; + while (Q--) { + if (l[Q].name === O) { + break + } + } + if (Q >= 0) { + for (P = l.length - 1; P >= Q; P--) { + O = l[P]; + if (O.valid) { + A.end(O.name) + } + } + l.length = Q + } + } + D = new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)\\s*((?:[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*)>))", "g"); + h = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; + g = { + script: /<\/script[^>]*>/gi, + style: /<\/style[^>]*>/gi, + noscript: /<\/noscript[^>]*>/gi + }; + F = e.getShortEndedElements(); + z = e.getSelfClosingElements(); + k = e.getBoolAttrs(); + x = c.validate; + y = c.fix_self_closing; + while (f = D.exec(q)) { + if (m < f.index) { + A.text(v(q.substr(m, f.index - m))) + } + if (G = f[6]) { + C(G.toLowerCase()) + } else { + if (G = f[7]) { + G = G.toLowerCase(); + p = G in F; + if (y && z[G] && l.length > 0 && l[l.length - 1].name === G) { + C(G) + } + if (!x || (I = e.getElementRule(G))) { + r = true; + if (x) { + J = I.attributes; + n = I.attributePatterns + } + if (o = f[8]) { + B = []; + B.map = {}; + o.replace(h, function(P, O, T, S, R) { + var U, Q; + O = O.toLowerCase(); + T = O in k ? O : v(T || S || R || ""); + if (x && O.indexOf("data-") !== 0) { + U = J[O]; + if (!U && n) { + Q = n.length; + while (Q--) { + U = n[Q]; + if (U.pattern.test(O)) { + break + } + } + if (Q === -1) { + U = null + } + } + if (!U) { + return + } + if (U.validValues && !(T in U.validValues)) { + return + } + } + B.map[O] = T; + B.push({ + name: O, + value: T + }) + }) + } else { + B = []; + B.map = {} + } + if (x) { + H = I.attributesRequired; + M = I.attributesDefault; + L = I.attributesForced; + if (L) { + K = L.length; + while (K--) { + E = L[K]; + N = E.name; + u = E.value; + if (u === "{$uid}") { + u = "mce_" + s++ + } + B.map[N] = u; + B.push({ + name: N, + value: u + }) + } + } + if (M) { + K = M.length; + while (K--) { + E = M[K]; + N = E.name; + if (!(N in B.map)) { + u = E.value; + if (u === "{$uid}") { + u = "mce_" + s++ + } + B.map[N] = u; + B.push({ + name: N, + value: u + }) + } + } + } + if (H) { + K = H.length; + while (K--) { + if (H[K] in B.map) { + break + } + } + if (K === -1) { + r = false + } + } + if (B.map["data-mce-bogus"]) { + r = false + } + } + if (r) { + A.start(G, B, p) + } + } else { + r = false + } + if (j = g[G]) { + j.lastIndex = m = f.index + f[0].length; + if (f = j.exec(q)) { + if (r) { + t = q.substr(m, f.index - m) + } + m = f.index + f[0].length + } else { + t = q.substr(m); + m = q.length + } + if (r && t.length > 0) { + A.text(t, true) + } + if (r) { + A.end(G) + } + D.lastIndex = m; + continue + } + if (!p) { + if (!o || o.indexOf("/") != o.length - 1) { + l.push({ + name: G, + valid: r + }) + } else { + if (r) { + A.end(G) + } + } + } + } else { + if (G = f[1]) { + A.comment(G) + } else { + if (G = f[2]) { + A.cdata(G) + } else { + if (G = f[3]) { + A.doctype(G) + } else { + if (G = f[4]) { + A.pi(G, f[5]) + } + } + } + } + } + } + m = f.index + f[0].length + } + if (m < q.length) { + A.text(v(q.substr(m))) + } + for (K = l.length - 1; K >= 0; K--) { + G = l[K]; + if (G.valid) { + A.end(G.name) + } + } + } + } +})(tinymce); +(function(d) { + var c = /^[ \t\r\n]*$/, + e = { + "#text": 3, + "#comment": 8, + "#cdata": 4, + "#pi": 7, + "#doctype": 10, + "#document-fragment": 11 + }; + + function a(k, l, j) { + var i, h, f = j ? "lastChild" : "firstChild", + g = j ? "prev" : "next"; + if (k[f]) { + return k[f] + } + if (k !== l) { + i = k[g]; + if (i) { + return i + } + for (h = k.parent; h && h !== l; h = h.parent) { + i = h[g]; + if (i) { + return i + } + } + } + } + function b(f, g) { + this.name = f; + this.type = g; + if (g === 1) { + this.attributes = []; + this.attributes.map = {} + } + } + d.extend(b.prototype, { + replace: function(g) { + var f = this; + if (g.parent) { + g.remove() + } + f.insert(g, f); + f.remove(); + return f + }, + attr: function(h, l) { + var f = this, + g, j, k; + if (typeof h !== "string") { + for (j in h) { + f.attr(j, h[j]) + } + return f + } + if (g = f.attributes) { + if (l !== k) { + if (l === null) { + if (h in g.map) { + delete g.map[h]; + j = g.length; + while (j--) { + if (g[j].name === h) { + g = g.splice(j, 1); + return f + } + } + } + return f + } + if (h in g.map) { + j = g.length; + while (j--) { + if (g[j].name === h) { + g[j].value = l; + break + } + } + } else { + g.push({ + name: h, + value: l + }) + } + g.map[h] = l; + return f + } else { + return g.map[h] + } + } + }, + clone: function() { + var g = this, + n = new b(g.name, g.type), + h, f, m, j, k; + if (m = g.attributes) { + k = []; + k.map = {}; + for (h = 0, f = m.length; h < f; h++) { + j = m[h]; + if (j.name !== "id") { + k[k.length] = { + name: j.name, + value: j.value + }; + k.map[j.name] = j.value + } + } + n.attributes = k + } + n.value = g.value; + n.shortEnded = g.shortEnded; + return n + }, + wrap: function(g) { + var f = this; + f.parent.insert(g, f); + g.append(f); + return f + }, + unwrap: function() { + var f = this, + h, g; + for (h = f.firstChild; h;) { + g = h.next; + f.insert(h, f, true); + h = g + } + f.remove() + }, + remove: function() { + var f = this, + h = f.parent, + g = f.next, + i = f.prev; + if (h) { + if (h.firstChild === f) { + h.firstChild = g; + if (g) { + g.prev = null + } + } else { + i.next = g + } + if (h.lastChild === f) { + h.lastChild = i; + if (i) { + i.next = null + } + } else { + g.prev = i + } + f.parent = f.next = f.prev = null + } + return f + }, + append: function(h) { + var f = this, + g; + if (h.parent) { + h.remove() + } + g = f.lastChild; + if (g) { + g.next = h; + h.prev = g; + f.lastChild = h + } else { + f.lastChild = f.firstChild = h + } + h.parent = f; + return h + }, + insert: function(h, f, i) { + var g; + if (h.parent) { + h.remove() + } + g = f.parent || this; + if (i) { + if (f === g.firstChild) { + g.firstChild = h + } else { + f.prev.next = h + } + h.prev = f.prev; + h.next = f; + f.prev = h + } else { + if (f === g.lastChild) { + g.lastChild = h + } else { + f.next.prev = h + } + h.next = f.next; + h.prev = f; + f.next = h + } + h.parent = g; + return h + }, + getAll: function(g) { + var f = this, + h, i = []; + for (h = f.firstChild; h; h = a(h, f)) { + if (h.name === g) { + i.push(h) + } + } + return i + }, + empty: function() { + var g = this, + f, h, j; + if (g.firstChild) { + f = []; + for (j = g.firstChild; j; j = a(j, g)) { + f.push(j) + } + h = f.length; + while (h--) { + j = f[h]; + j.parent = j.firstChild = j.lastChild = j.next = j.prev = null + } + } + g.firstChild = g.lastChild = null; + return g + }, + isEmpty: function(j) { + var f = this, + h = f.firstChild, + g; + if (h) { + do { + if (h.type === 1) { + if (h.attributes.map["data-mce-bogus"]) { + continue + } + if (j[h.name]) { + return false + } + g = h.attributes.length; + while (g--) { + if (h.attributes[g].name.indexOf("data-") === 0) { + return false + } + } + } + if ((h.type === 3 && !c.test(h.value))) { + return false + } + } while (h = a(h, f)) + } + return true + } + }); + d.extend(b, { + create: function(g, f) { + var i, h; + i = new b(g, e[g] || 1); + if (f) { + for (h in f) { + i.attr(h, f[h]) + } + } + return i + } + }); + d.html.Node = b +})(tinymce); +(function(b) { + var a = b.html.Node; + b.html.DomParser = function(g, h) { + var f = this, + e = {}, + d = [], + i = {}, + c = {}; + g = g || {}; + g.root_name = g.root_name || "body"; + f.schema = h = h || new b.html.Schema(); + + function j(m) { + var o, p, x, v, z, n, q, l, t, u, k, s, y, r; + s = b.makeMap("tr,td,th,tbody,thead,tfoot,table"); + k = h.getNonEmptyElements(); + for (o = 0; o < m.length; o++) { + p = m[o]; + if (!p.parent) { + continue + } + v = [p]; + for (x = p.parent; x && !h.isValidChild(x.name, p.name) && !s[x.name]; x = x.parent) { + v.push(x) + } + if (x && v.length > 1) { + v.reverse(); + z = n = f.filterNode(v[0].clone()); + for (t = 0; t < v.length - 1; t++) { + if (h.isValidChild(n.name, v[t].name)) { + q = f.filterNode(v[t].clone()); + n.append(q) + } else { + q = n + } + for (l = v[t].firstChild; l && l != v[t + 1];) { + r = l.next; + q.append(l); + l = r + } + n = q + } + if (!z.isEmpty(k)) { + x.insert(z, v[0], true); + x.insert(p, z) + } else { + x.insert(p, v[0], true) + } + x = v[0]; + if (x.isEmpty(k) || x.firstChild === x.lastChild && x.firstChild.name === "br") { + x.empty().remove() + } + } else { + if (p.parent) { + if (p.name === "li") { + y = p.prev; + if (y && (y.name === "ul" || y.name === "ul")) { + y.append(p); + continue + } + y = p.next; + if (y && (y.name === "ul" || y.name === "ul")) { + y.insert(p, y.firstChild, true); + continue + } + p.wrap(f.filterNode(new a("ul", 1))); + continue + } + if (h.isValidChild(p.parent.name, "div") && h.isValidChild("div", p.name)) { + p.wrap(f.filterNode(new a("div", 1))) + } else { + if (p.name === "style" || p.name === "script") { + p.empty().remove() + } else { + p.unwrap() + } + } + } + } + } + } + f.filterNode = function(m) { + var l, k, n; + if (k in e) { + n = i[k]; + if (n) { + n.push(m) + } else { + i[k] = [m] + } + } + l = d.length; + while (l--) { + k = d[l].name; + if (k in m.attributes.map) { + n = c[k]; + if (n) { + n.push(m) + } else { + c[k] = [m] + } + } + } + return m + }; + f.addNodeFilter = function(k, l) { + b.each(b.explode(k), function(m) { + var n = e[m]; + if (!n) { + e[m] = n = [] + } + n.push(l) + }) + }; + f.addAttributeFilter = function(k, l) { + b.each(b.explode(k), function(m) { + var n; + for (n = 0; n < d.length; n++) { + if (d[n].name === m) { + d[n].callbacks.push(l); + return + } + } + d.push({ + name: m, + callbacks: [l] + }) + }) + }; + f.parse = function(u, m) { + var n, D, y, x, A, z, v, q, C, G, o, B, F = [], + s, k, r, p, t; + m = m || {}; + i = {}; + c = {}; + o = b.extend(b.makeMap("script,style,head,title,meta,param"), h.getBlockElements()); + t = h.getNonEmptyElements(); + p = h.children; + r = h.getWhiteSpaceElements(); + B = /^[ \t\r\n]+/; + s = /[ \t\r\n]+$/; + k = /[ \t\r\n]+/g; + + function E(l, H) { + var I = new a(l, H), + J; + if (l in e) { + J = i[l]; + if (J) { + J.push(I) + } else { + i[l] = [I] + } + } + return I + } + n = new b.html.SaxParser({ + validate: g.validate, + fix_self_closing: false, + cdata: function(l) { + y.append(E("#cdata", 4)).value = l + }, + text: function(I, l) { + var H; + if (!r[y.name]) { + I = I.replace(k, " "); + if (y.lastChild && o[y.lastChild.name]) { + I = I.replace(B, "") + } + } + if (I.length !== 0) { + H = E("#text", 3); + H.raw = !! l; + y.append(H).value = I + } + }, + comment: function(l) { + y.append(E("#comment", 8)).value = l + }, + pi: function(l, H) { + y.append(E(l, 7)).value = H + }, + doctype: function(l) { + y.append(E("#doctype", 10)).value = l + }, + start: function(l, P, I) { + var N, K, J, H, L, Q, O, M; + J = h.getElementRule(l); + if (J) { + N = E(J.outputName || l, 1); + N.attributes = P; + N.shortEnded = I; + y.append(N); + M = p[y.name]; + if (M && p[N.name] && !M[N.name]) { + F.push(N) + } + K = d.length; + while (K--) { + L = d[K].name; + if (L in P.map) { + C = c[L]; + if (C) { + C.push(N) + } else { + c[L] = [N] + } + } + } + if (o[l]) { + for (H = N.prev; H && H.type === 3;) { + Q = H.value.replace(s, ""); + if (Q.length > 0) { + H.value = Q; + H = H.prev + } else { + O = H.prev; + H.remove(); + H = O + } + } + } + if (!I) { + y = N + } + } + }, + end: function(l) { + var L, I, K, H, J; + I = h.getElementRule(l); + if (I) { + if (o[l]) { + if (!r[y.name]) { + for (L = y.firstChild; L && L.type === 3;) { + K = L.value.replace(B, ""); + if (K.length > 0) { + L.value = K; + L = L.next + } else { + H = L.next; + L.remove(); + L = H + } + } + for (L = y.lastChild; L && L.type === 3;) { + K = L.value.replace(s, ""); + if (K.length > 0) { + L.value = K; + L = L.prev + } else { + H = L.prev; + L.remove(); + L = H + } + } + } + L = y.prev; + if (L && L.type === 3) { + K = L.value.replace(B, ""); + if (K.length > 0) { + L.value = K + } else { + L.remove() + } + } + } + if (I.removeEmpty || I.paddEmpty) { + if (y.isEmpty(t)) { + if (I.paddEmpty) { + y.empty().append(new a("#text", "3")).value = "\u00a0" + } else { + if (!y.attributes.map.name) { + J = y.parent; + y.empty().remove(); + y = J; + return + } + } + } + } + y = y.parent + } + } + }, h); + D = y = new a(g.root_name, 11); + n.parse(u); + j(F); + for (G in i) { + C = e[G]; + x = i[G]; + v = x.length; + while (v--) { + if (!x[v].parent) { + x.splice(v, 1) + } + } + for (A = 0, z = C.length; A < z; A++) { + C[A](x, G, m) + } + } + for (A = 0, z = d.length; A < z; A++) { + C = d[A]; + if (C.name in c) { + x = c[C.name]; + v = x.length; + while (v--) { + if (!x[v].parent) { + x.splice(v, 1) + } + } + for (v = 0, q = C.callbacks.length; v < q; v++) { + C.callbacks[v](x, C.name, m) + } + } + } + return D + }; + if (g.remove_trailing_brs) { + f.addNodeFilter("br", function(n, m) { + var r, q = n.length, + o, u = h.getBlockElements(), + k = h.getNonEmptyElements(), + s, p, t; + for (r = 0; r < q; r++) { + o = n[r]; + s = o.parent; + if (u[o.parent.name] && o === s.lastChild) { + p = o.prev; + while (p) { + t = p.name; + if (t !== "span" || p.attr("data-mce-type") !== "bookmark") { + if (t !== "br") { + break + } + if (t === "br") { + o = null; + break + } + } + p = p.prev + } + if (o) { + o.remove(); + if (s.isEmpty(k)) { + elementRule = h.getElementRule(s.name); + if (elementRule.removeEmpty) { + s.remove() + } else { + if (elementRule.paddEmpty) { + s.empty().append(new b.html.Node("#text", 3)).value = "\u00a0" + } + } + } + } + } + } + }) + } + } +})(tinymce); +tinymce.html.Writer = function(e) { + var c = [], + a, b, d, f, g; + e = e || {}; + a = e.indent; + b = tinymce.makeMap(e.indent_before || ""); + d = tinymce.makeMap(e.indent_after || ""); + f = tinymce.html.Entities.getEncodeFunc(e.entity_encoding || "raw", e.entities); + g = e.element_format == "html"; + return { + start: function(m, k, p) { + var n, j, h, o; + if (a && b[m] && c.length > 0) { + o = c[c.length - 1]; + if (o.length > 0 && o !== "\n") { + c.push("\n") + } + } + c.push("<", m); + if (k) { + for (n = 0, j = k.length; n < j; n++) { + h = k[n]; + c.push(" ", h.name, '="', f(h.value, true), '"') + } + } + if (!p || g) { + c[c.length] = ">" + } else { + c[c.length] = " />" + } + }, + end: function(h) { + var i; + c.push(""); + if (a && d[h] && c.length > 0) { + i = c[c.length - 1]; + if (i.length > 0 && i !== "\n") { + c.push("\n") + } + } + }, + text: function(i, h) { + if (i.length > 0) { + c[c.length] = h ? i : f(i) + } + }, + cdata: function(h) { + c.push("") + }, + comment: function(h) { + c.push("") + }, + pi: function(h, i) { + if (i) { + c.push("") + } else { + c.push("") + } + }, + doctype: function(h) { + c.push("") + }, + reset: function() { + c.length = 0 + }, + getContent: function() { + return c.join("").replace(/\n$/, "") + } + } +}; +(function(a) { + a.html.Serializer = function(c, d) { + var b = this, + e = new a.html.Writer(c); + c = c || {}; + c.validate = "validate" in c ? c.validate : true; + b.schema = d = d || new a.html.Schema(); + b.writer = e; + b.serialize = function(h) { + var g, i; + i = c.validate; + g = { + 3: function(k, j) { + e.text(k.value, k.raw) + }, + 8: function(j) { + e.comment(j.value) + }, + 7: function(j) { + e.pi(j.name, j.value) + }, + 10: function(j) { + e.doctype(j.value) + }, + 4: function(j) { + e.cdata(j.value) + }, + 11: function(j) { + if ((j = j.firstChild)) { + do { + f(j) + } while (j = j.next) + } + } + }; + e.reset(); + + function f(k) { + var t = g[k.type], + j, o, s, r, p, u, n, m, q; + if (!t) { + j = k.name; + o = k.shortEnded; + s = k.attributes; + if (i && s && s.length > 1) { + u = []; + u.map = {}; + q = d.getElementRule(k.name); + for (n = 0, m = q.attributesOrder.length; n < m; n++) { + r = q.attributesOrder[n]; + if (r in s.map) { + p = s.map[r]; + u.map[r] = p; + u.push({ + name: r, + value: p + }) + } + } + for (n = 0, m = s.length; n < m; n++) { + r = s[n].name; + if (!(r in u.map)) { + p = s.map[r]; + u.map[r] = p; + u.push({ + name: r, + value: p + }) + } + } + s = u + } + e.start(k.name, s, o); + if (!o) { + if ((k = k.firstChild)) { + do { + f(k) + } while (k = k.next) + } + e.end(j) + } + } else { + t(k) + } + } + if (h.type == 1 && !c.inner) { + f(h) + } else { + g[11](h) + } + return e.getContent() + } + } +})(tinymce); +(function(d) { + var f = d.each, + c = d.is, + e = d.isWebKit, + a = d.isIE, + h = d.html.Entities, + b = /^([a-z0-9],?)+$/i, + g = d.html.Schema.blockElementsMap; + d.create("tinymce.dom.DOMUtils", { + doc: null, + root: null, + files: null, + pixelStyles: /^(top|left|bottom|right|width|height|borderWidth)$/, + props: { + "for": "htmlFor", + "class": "className", + className: "className", + checked: "checked", + disabled: "disabled", + maxlength: "maxLength", + readonly: "readOnly", + selected: "selected", + value: "value", + id: "id", + name: "name", + type: "type" + }, + DOMUtils: function(m, k) { + var j = this, + i; + j.doc = m; + j.win = window; + j.files = {}; + j.cssFlicker = false; + j.counter = 0; + j.stdMode = !d.isIE || m.documentMode >= 8; + j.boxModel = !d.isIE || m.compatMode == "CSS1Compat" || j.stdMode; + j.hasOuterHTML = "outerHTML" in m.createElement("a"); + j.settings = k = d.extend({ + keep_values: false, + hex_colors: 1 + }, k); + j.styles = new d.html.Styles({ + url_converter: k.url_converter, + url_converter_scope: k.url_converter_scope + }, k.schema); + if (d.isIE6) { + try { + m.execCommand("BackgroundImageCache", false, true) + } catch (l) { + j.cssFlicker = true + } + } + if (a) { + ("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g, function(n) { + m.createElement(n) + }) + } + d.addUnload(j.destroy, j) + }, + getRoot: function() { + var i = this, + j = i.settings; + return (j && i.get(j.root_element)) || i.doc.body + }, + getViewPort: function(j) { + var k, i; + j = !j ? this.win : j; + k = j.document; + i = this.boxModel ? k.documentElement : k.body; + return { + x: j.pageXOffset || i.scrollLeft, + y: j.pageYOffset || i.scrollTop, + w: j.innerWidth || i.clientWidth, + h: j.innerHeight || i.clientHeight + } + }, + getRect: function(l) { + var k, i = this, + j; + l = i.get(l); + k = i.getPos(l); + j = i.getSize(l); + return { + x: k.x, + y: k.y, + w: j.w, + h: j.h + } + }, + getSize: function(l) { + var j = this, + i, k; + l = j.get(l); + i = j.getStyle(l, "width"); + k = j.getStyle(l, "height"); + if (i.indexOf("px") === -1) { + i = 0 + } + if (k.indexOf("px") === -1) { + k = 0 + } + return { + w: parseInt(i) || l.offsetWidth || l.clientWidth, + h: parseInt(k) || l.offsetHeight || l.clientHeight + } + }, + getParent: function(k, j, i) { + return this.getParents(k, j, i, false) + }, + getParents: function(s, m, k, q) { + var j = this, + i, l = j.settings, + p = []; + s = j.get(s); + q = q === undefined; + if (l.strict_root) { + k = k || j.getRoot() + } + if (c(m, "string")) { + i = m; + if (m === "*") { + m = function(o) { + return o.nodeType == 1 + } + } else { + m = function(o) { + return j.is(o, i) + } + } + } + while (s) { + if (s == k || !s.nodeType || s.nodeType === 9) { + break + } + if (!m || m(s)) { + if (q) { + p.push(s) + } else { + return s + } + } + s = s.parentNode + } + return q ? p : null + }, + get: function(i) { + var j; + if (i && this.doc && typeof(i) == "string") { + j = i; + i = this.doc.getElementById(i); + if (i && i.id !== j) { + return this.doc.getElementsByName(j)[1] + } + } + return i + }, + getNext: function(j, i) { + return this._findSib(j, i, "nextSibling") + }, + getPrev: function(j, i) { + return this._findSib(j, i, "previousSibling") + }, + select: function(k, j) { + var i = this; + return d.dom.Sizzle(k, i.get(j) || i.get(i.settings.root_element) || i.doc, []) + }, + is: function(l, j) { + var k; + if (l.length === undefined) { + if (j === "*") { + return l.nodeType == 1 + } + if (b.test(j)) { + j = j.toLowerCase().split(/,/); + l = l.nodeName.toLowerCase(); + for (k = j.length - 1; k >= 0; k--) { + if (j[k] == l) { + return true + } + } + return false + } + } + return d.dom.Sizzle.matches(j, l.nodeType ? [l] : l).length > 0 + }, + add: function(l, o, i, k, m) { + var j = this; + return this.run(l, function(r) { + var q, n; + q = c(o, "string") ? j.doc.createElement(o) : o; + j.setAttribs(q, i); + if (k) { + if (k.nodeType) { + q.appendChild(k) + } else { + j.setHTML(q, k) + } + } + return !m ? r.appendChild(q) : q + }) + }, + create: function(k, i, j) { + return this.add(this.doc.createElement(k), k, i, j, 1) + }, + createHTML: function(q, i, m) { + var p = "", + l = this, + j; + p += "<" + q; + for (j in i) { + if (i.hasOwnProperty(j)) { + p += " " + j + '="' + l.encode(i[j]) + '"' + } + } + if (typeof(m) != "undefined") { + return p + ">" + m + "" + } + return p + " />" + }, + remove: function(i, j) { + return this.run(i, function(l) { + var k, m; + k = l.parentNode; + if (!k) { + return null + } + if (j) { + while (m = l.firstChild) { + if (!d.isIE || m.nodeType !== 3 || m.nodeValue) { + k.insertBefore(m, l) + } else { + l.removeChild(m) + } + } + } + return k.removeChild(l) + }) + }, + setStyle: function(l, i, j) { + var k = this; + return k.run(l, function(o) { + var n, m; + n = o.style; + i = i.replace(/-(\D)/g, function(q, p) { + return p.toUpperCase() + }); + if (k.pixelStyles.test(i) && (d.is(j, "number") || /^[\-0-9\.]+$/.test(j))) { + j += "px" + } + switch (i) { + case "opacity": + if (a) { + n.filter = j === "" ? "" : "alpha(opacity=" + (j * 100) + ")"; + if (!l.currentStyle || !l.currentStyle.hasLayout) { + n.display = "inline-block" + } + } + n[i] = n["-moz-opacity"] = n["-khtml-opacity"] = j || ""; + break; + case "float": + a ? n.styleFloat = j : n.cssFloat = j; + break; + default: + n[i] = j || "" + } + if (k.settings.update_styles) { + k.setAttrib(o, "data-mce-style") + } + }) + }, + getStyle: function(l, i, k) { + l = this.get(l); + if (!l) { + return false + } + if (this.doc.defaultView && k) { + i = i.replace(/[A-Z]/g, function(m) { + return "-" + m + }); + try { + return this.doc.defaultView.getComputedStyle(l, null).getPropertyValue(i) + } catch (j) { + return null + } + } + i = i.replace(/-(\D)/g, function(n, m) { + return m.toUpperCase() + }); + if (i == "float") { + i = a ? "styleFloat" : "cssFloat" + } + if (l.currentStyle && k) { + return l.currentStyle[i] + } + return l.style[i] + }, + setStyles: function(l, m) { + var j = this, + k = j.settings, + i; + i = k.update_styles; + k.update_styles = 0; + f(m, function(o, p) { + j.setStyle(l, p, o) + }); + k.update_styles = i; + if (k.update_styles) { + j.setAttrib(l, k.cssText) + } + }, + removeAllAttribs: function(i) { + return this.run(i, function(l) { + var j = l.attributes; + for (var k = j.length - 1; k >= 0; k--) { + l.removeAttributeNode(j.item(k)) + } + }) + }, + setAttrib: function(k, l, i) { + var j = this; + if (!k || !l) { + return + } + if (j.settings.strict) { + l = l.toLowerCase() + } + return this.run(k, function(n) { + var m = j.settings; + switch (l) { + case "style": + if (!c(i, "string")) { + f(i, function(o, p) { + j.setStyle(n, p, o) + }); + return + } + if (m.keep_values) { + if (i && !j._isRes(i)) { + n.setAttribute("data-mce-style", i, 2) + } else { + n.removeAttribute("data-mce-style", 2) + } + } + n.style.cssText = i; + break; + case "class": + n.className = i || ""; + break; + case "src": + case "href": + if (m.keep_values) { + if (m.url_converter) { + i = m.url_converter.call(m.url_converter_scope || j, i, l, n) + } + j.setAttrib(n, "data-mce-" + l, i, 2) + } + break; + case "shape": + n.setAttribute("data-mce-style", i); + break + } + if (c(i) && i !== null && i.length !== 0) { + n.setAttribute(l, "" + i, 2) + } else { + n.removeAttribute(l, 2) + } + }) + }, + setAttribs: function(j, k) { + var i = this; + return this.run(j, function(l) { + f(k, function(m, o) { + i.setAttrib(l, o, m) + }) + }) + }, + getAttrib: function(l, m, k) { + var i, j = this; + l = j.get(l); + if (!l || l.nodeType !== 1) { + return false + } + if (!c(k)) { + k = "" + } + if (/^(src|href|style|coords|shape)$/.test(m)) { + i = l.getAttribute("data-mce-" + m); + if (i) { + return i + } + } + if (a && j.props[m]) { + i = l[j.props[m]]; + i = i && i.nodeValue ? i.nodeValue : i + } + if (!i) { + i = l.getAttribute(m, 2) + } + if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(m)) { + if (l[j.props[m]] === true && i === "") { + return m + } + return i ? m : "" + } + if (l.nodeName === "FORM" && l.getAttributeNode(m)) { + return l.getAttributeNode(m).nodeValue + } + if (m === "style") { + i = i || l.style.cssText; + if (i) { + i = j.serializeStyle(j.parseStyle(i), l.nodeName); + if (j.settings.keep_values && !j._isRes(i)) { + l.setAttribute("data-mce-style", i) + } + } + } + if (e && m === "class" && i) { + i = i.replace(/(apple|webkit)\-[a-z\-]+/gi, "") + } + if (a) { + switch (m) { + case "rowspan": + case "colspan": + if (i === 1) { + i = "" + } + break; + case "size": + if (i === "+0" || i === 20 || i === 0) { + i = "" + } + break; + case "width": + case "height": + case "vspace": + case "checked": + case "disabled": + case "readonly": + if (i === 0) { + i = "" + } + break; + case "hspace": + if (i === -1) { + i = "" + } + break; + case "maxlength": + case "tabindex": + if (i === 32768 || i === 2147483647 || i === "32768") { + i = "" + } + break; + case "multiple": + case "compact": + case "noshade": + case "nowrap": + if (i === 65535) { + return m + } + return k; + case "shape": + i = i.toLowerCase(); + break; + default: + if (m.indexOf("on") === 0 && i) { + i = d._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, "$1", "" + i) + } + } + } + return (i !== undefined && i !== null && i !== "") ? "" + i : k + }, + getPos: function(q, l) { + var j = this, + i = 0, + p = 0, + m, o = j.doc, + k; + q = j.get(q); + l = l || o.body; + if (q) { + if (a && !j.stdMode) { + q = q.getBoundingClientRect(); + m = j.boxModel ? o.documentElement : o.body; + i = j.getStyle(j.select("html")[0], "borderWidth"); + i = (i == "medium" || j.boxModel && !j.isIE6) && 2 || i; + return { + x: q.left + m.scrollLeft - i, + y: q.top + m.scrollTop - i + } + } + k = q; + while (k && k != l && k.nodeType) { + i += k.offsetLeft || 0; + p += k.offsetTop || 0; + k = k.offsetParent + } + k = q.parentNode; + while (k && k != l && k.nodeType) { + i -= k.scrollLeft || 0; + p -= k.scrollTop || 0; + k = k.parentNode + } + } + return { + x: i, + y: p + } + }, + parseStyle: function(i) { + return this.styles.parse(i) + }, + serializeStyle: function(j, i) { + return this.styles.serialize(j, i) + }, + loadCSS: function(i) { + var k = this, + l = k.doc, + j; + if (!i) { + i = "" + } + j = k.select("head")[0]; + f(i.split(","), function(m) { + var n; + if (k.files[m]) { + return + } + k.files[m] = true; + n = k.create("link", { + rel: "stylesheet", + href: d._addVer(m) + }); + if (a && l.documentMode && l.recalc) { + n.onload = function() { + if (l.recalc) { + l.recalc() + } + n.onload = null + } + } + j.appendChild(n) + }) + }, + addClass: function(i, j) { + return this.run(i, function(k) { + var l; + if (!j) { + return 0 + } + if (this.hasClass(k, j)) { + return k.className + } + l = this.removeClass(k, j); + return k.className = (l != "" ? (l + " ") : "") + j + }) + }, + removeClass: function(k, l) { + var i = this, + j; + return i.run(k, function(n) { + var m; + if (i.hasClass(n, l)) { + if (!j) { + j = new RegExp("(^|\\s+)" + l + "(\\s+|$)", "g") + } + m = n.className.replace(j, " "); + m = d.trim(m != " " ? m : ""); + n.className = m; + if (!m) { + n.removeAttribute("class"); + n.removeAttribute("className") + } + return m + } + return n.className + }) + }, + hasClass: function(j, i) { + j = this.get(j); + if (!j || !i) { + return false + } + return (" " + j.className + " ").indexOf(" " + i + " ") !== -1 + }, + show: function(i) { + return this.setStyle(i, "display", "block") + }, + hide: function(i) { + return this.setStyle(i, "display", "none") + }, + isHidden: function(i) { + i = this.get(i); + return !i || i.style.display == "none" || this.getStyle(i, "display") == "none" + }, + uniqueId: function(i) { + return (!i ? "mce_" : i) + (this.counter++) + }, + setHTML: function(k, j) { + var i = this; + return i.run(k, function(m) { + if (a) { + while (m.firstChild) { + m.removeChild(m.firstChild) + } + try { + m.innerHTML = "
        " + j; + m.removeChild(m.firstChild) + } catch (l) { + m = i.create("div"); + m.innerHTML = "
        " + j; + f(m.childNodes, function(o, n) { + if (n) { + m.appendChild(o) + } + }) + } + } else { + m.innerHTML = j + } + return j + }) + }, + getOuterHTML: function(k) { + var j, i = this; + k = i.get(k); + if (!k) { + return null + } + if (k.nodeType === 1 && i.hasOuterHTML) { + return k.outerHTML + } + j = (k.ownerDocument || i.doc).createElement("body"); + j.appendChild(k.cloneNode(true)); + return j.innerHTML + }, + setOuterHTML: function(l, j, m) { + var i = this; + + function k(p, o, r) { + var s, q; + q = r.createElement("body"); + q.innerHTML = o; + s = q.lastChild; + while (s) { + i.insertAfter(s.cloneNode(true), p); + s = s.previousSibling + } + i.remove(p) + } + return this.run(l, function(o) { + o = i.get(o); + if (o.nodeType == 1) { + m = m || o.ownerDocument || i.doc; + if (a) { + try { + if (a && o.nodeType == 1) { + o.outerHTML = j + } else { + k(o, j, m) + } + } catch (n) { + k(o, j, m) + } + } else { + k(o, j, m) + } + } + }) + }, + decode: h.decode, + encode: h.encodeAllRaw, + insertAfter: function(i, j) { + j = this.get(j); + return this.run(i, function(l) { + var k, m; + k = j.parentNode; + m = j.nextSibling; + if (m) { + k.insertBefore(l, m) + } else { + k.appendChild(l) + } + return l + }) + }, + isBlock: function(j) { + var i = j.nodeType; + if (i) { + return !!(i === 1 && g[j.nodeName]) + } + return !!g[j] + }, + replace: function(m, l, i) { + var j = this; + if (c(l, "array")) { + m = m.cloneNode(true) + } + return j.run(l, function(k) { + if (i) { + f(d.grep(k.childNodes), function(n) { + m.appendChild(n) + }) + } + return k.parentNode.replaceChild(m, k) + }) + }, + rename: function(l, i) { + var k = this, + j; + if (l.nodeName != i.toUpperCase()) { + j = k.create(i); + f(k.getAttribs(l), function(m) { + k.setAttrib(j, m.nodeName, k.getAttrib(l, m.nodeName)) + }); + k.replace(j, l, 1) + } + return j || l + }, + findCommonAncestor: function(k, i) { + var l = k, + j; + while (l) { + j = i; + while (j && l != j) { + j = j.parentNode + } + if (l == j) { + break + } + l = l.parentNode + } + if (!l && k.ownerDocument) { + return k.ownerDocument.documentElement + } + return l + }, + toHex: function(i) { + var k = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i); + + function j(l) { + l = parseInt(l).toString(16); + return l.length > 1 ? l : "0" + l + } + if (k) { + i = "#" + j(k[1]) + j(k[2]) + j(k[3]); + return i + } + return i + }, + getClasses: function() { + var n = this, + j = [], + m, o = {}, + p = n.settings.class_filter, + l; + if (n.classes) { + return n.classes + } + function q(i) { + f(i.imports, function(s) { + q(s) + }); + f(i.cssRules || i.rules, function(s) { + switch (s.type || 1) { + case 1: + if (s.selectorText) { + f(s.selectorText.split(","), function(r) { + r = r.replace(/^\s*|\s*$|^\s\./g, ""); + if (/\.mce/.test(r) || !/\.[\w\-]+$/.test(r)) { + return + } + l = r; + r = d._replace(/.*\.([a-z0-9_\-]+).*/i, "$1", r); + if (p && !(r = p(r, l))) { + return + } + if (!o[r]) { + j.push({ + "class": r + }); + o[r] = 1 + } + }) + } + break; + case 3: + q(s.styleSheet); + break + } + }) + } + try { + f(n.doc.styleSheets, q) + } catch (k) {} + if (j.length > 0) { + n.classes = j + } + return j + }, + run: function(l, k, j) { + var i = this, + m; + if (i.doc && typeof(l) === "string") { + l = i.get(l) + } + if (!l) { + return false + } + j = j || this; + if (!l.nodeType && (l.length || l.length === 0)) { + m = []; + f(l, function(o, n) { + if (o) { + if (typeof(o) == "string") { + o = i.doc.getElementById(o) + } + m.push(k.call(j, o, n)) + } + }); + return m + } + return k.call(j, l) + }, + getAttribs: function(j) { + var i; + j = this.get(j); + if (!j) { + return [] + } + if (a) { + i = []; + if (j.nodeName == "OBJECT") { + return j.attributes + } + if (j.nodeName === "OPTION" && this.getAttrib(j, "selected")) { + i.push({ + specified: 1, + nodeName: "selected" + }) + } + j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, "").replace(/[\w:\-]+/gi, function(k) { + i.push({ + specified: 1, + nodeName: k + }) + }); + return i + } + return j.attributes + }, + destroy: function(j) { + var i = this; + if (i.events) { + i.events.destroy() + } + i.win = i.doc = i.root = i.events = null; + if (!j) { + d.removeUnload(i.destroy) + } + }, + createRng: function() { + var i = this.doc; + return i.createRange ? i.createRange() : new d.dom.Range(this) + }, + nodeIndex: function(n, o) { + var i = 0, + l, m, k, j; + if (n) { + for (l = n.nodeType, n = n.previousSibling, m = n; n; n = n.previousSibling) { + k = n.nodeType; + if (o && k == 3) { + j = false; + try { + j = n.nodeValue.length + } catch (p) {} + if (k == l || !j) { + continue + } + } + i++; + l = k + } + } + return i + }, + split: function(m, l, p) { + var q = this, + i = q.createRng(), + n, k, o; + + function j(t) { + var s, r = t.childNodes; + if (t.nodeType == 1 && t.getAttribute("data-mce-type") == "bookmark") { + return + } + for (s = r.length - 1; s >= 0; s--) { + j(r[s]) + } + if (t.nodeType != 9) { + if (t.nodeType == 3 && t.nodeValue.length > 0) { + if (!q.isBlock(t.parentNode) || d.trim(t.nodeValue).length > 0) { + return + } + } + if (t.nodeType == 1) { + r = t.childNodes; + if (r.length == 1 && r[0] && r[0].nodeType == 1 && r[0].getAttribute("data-mce-type") == "bookmark") { + t.parentNode.insertBefore(r[0], t) + } + if (r.length || /^(br|hr|input|img)$/i.test(t.nodeName)) { + return + } + } + q.remove(t) + } + return t + } + if (m && l) { + i.setStart(m.parentNode, q.nodeIndex(m)); + i.setEnd(l.parentNode, q.nodeIndex(l)); + n = i.extractContents(); + i = q.createRng(); + i.setStart(l.parentNode, q.nodeIndex(l) + 1); + i.setEnd(m.parentNode, q.nodeIndex(m) + 1); + k = i.extractContents(); + o = m.parentNode; + o.insertBefore(j(n), m); + if (p) { + o.replaceChild(p, l) + } else { + o.insertBefore(l, m) + } + o.insertBefore(j(k), m); + q.remove(m); + return p || l + } + }, + bind: function(m, i, l, k) { + var j = this; + if (!j.events) { + j.events = new d.dom.EventUtils() + } + return j.events.add(m, i, l, k || this) + }, + unbind: function(l, i, k) { + var j = this; + if (!j.events) { + j.events = new d.dom.EventUtils() + } + return j.events.remove(l, i, k) + }, + _findSib: function(l, i, j) { + var k = this, + m = i; + if (l) { + if (c(m, "string")) { + m = function(n) { + return k.is(n, i) + } + } + for (l = l[j]; l; l = l[j]) { + if (m(l)) { + return l + } + } + } + return null + }, + _isRes: function(i) { + return /^(top|left|bottom|right|width|height)/i.test(i) || /;\s*(top|left|bottom|right|width|height)/i.test(i) + } + }); + d.DOM = new d.dom.DOMUtils(document, { + process_html: 0 + }) +})(tinymce); +(function(a) { + function b(c) { + var N = this, + e = c.doc, + S = 0, + E = 1, + j = 2, + D = true, + R = false, + U = "startOffset", + h = "startContainer", + P = "endContainer", + z = "endOffset", + k = tinymce.extend, + n = c.nodeIndex; + k(N, { + startContainer: e, + startOffset: 0, + endContainer: e, + endOffset: 0, + collapsed: D, + commonAncestorContainer: e, + START_TO_START: 0, + START_TO_END: 1, + END_TO_END: 2, + END_TO_START: 3, + setStart: q, + setEnd: s, + setStartBefore: g, + setStartAfter: I, + setEndBefore: J, + setEndAfter: u, + collapse: A, + selectNode: x, + selectNodeContents: F, + compareBoundaryPoints: v, + deleteContents: p, + extractContents: H, + cloneContents: d, + insertNode: C, + surroundContents: M, + cloneRange: K + }); + + function q(V, t) { + B(D, V, t) + } + function s(V, t) { + B(R, V, t) + } + function g(t) { + q(t.parentNode, n(t)) + } + function I(t) { + q(t.parentNode, n(t) + 1) + } + function J(t) { + s(t.parentNode, n(t)) + } + function u(t) { + s(t.parentNode, n(t) + 1) + } + function A(t) { + if (t) { + N[P] = N[h]; + N[z] = N[U] + } else { + N[h] = N[P]; + N[U] = N[z] + } + N.collapsed = D + } + function x(t) { + g(t); + u(t) + } + function F(t) { + q(t, 0); + s(t, t.nodeType === 1 ? t.childNodes.length : t.nodeValue.length) + } + function v(Y, t) { + var ab = N[h], + W = N[U], + aa = N[P], + V = N[z], + Z = t.startContainer, + ad = t.startOffset, + X = t.endContainer, + ac = t.endOffset; + if (Y === 0) { + return G(ab, W, Z, ad) + } + if (Y === 1) { + return G(aa, V, Z, ad) + } + if (Y === 2) { + return G(aa, V, X, ac) + } + if (Y === 3) { + return G(ab, W, X, ac) + } + } + function p() { + m(j) + } + function H() { + return m(S) + } + function d() { + return m(E) + } + function C(Y) { + var V = this[h], + t = this[U], + X, W; + if ((V.nodeType === 3 || V.nodeType === 4) && V.nodeValue) { + if (!t) { + V.parentNode.insertBefore(Y, V) + } else { + if (t >= V.nodeValue.length) { + c.insertAfter(Y, V) + } else { + X = V.splitText(t); + V.parentNode.insertBefore(Y, X) + } + } + } else { + if (V.childNodes.length > 0) { + W = V.childNodes[t] + } + if (W) { + V.insertBefore(Y, W) + } else { + V.appendChild(Y) + } + } + } + function M(V) { + var t = N.extractContents(); + N.insertNode(V); + V.appendChild(t); + N.selectNode(V) + } + function K() { + return k(new b(c), { + startContainer: N[h], + startOffset: N[U], + endContainer: N[P], + endOffset: N[z], + collapsed: N.collapsed, + commonAncestorContainer: N.commonAncestorContainer + }) + } + function O(t, V) { + var W; + if (t.nodeType == 3) { + return t + } + if (V < 0) { + return t + } + W = t.firstChild; + while (W && V > 0) { + --V; + W = W.nextSibling + } + if (W) { + return W + } + return t + } + function l() { + return (N[h] == N[P] && N[U] == N[z]) + } + function G(X, Z, V, Y) { + var aa, W, t, ab, ad, ac; + if (X == V) { + if (Z == Y) { + return 0 + } + if (Z < Y) { + return -1 + } + return 1 + } + aa = V; + while (aa && aa.parentNode != X) { + aa = aa.parentNode + } + if (aa) { + W = 0; + t = X.firstChild; + while (t != aa && W < Z) { + W++; + t = t.nextSibling + } + if (Z <= W) { + return -1 + } + return 1 + } + aa = X; + while (aa && aa.parentNode != V) { + aa = aa.parentNode + } + if (aa) { + W = 0; + t = V.firstChild; + while (t != aa && W < Y) { + W++; + t = t.nextSibling + } + if (W < Y) { + return -1 + } + return 1 + } + ab = c.findCommonAncestor(X, V); + ad = X; + while (ad && ad.parentNode != ab) { + ad = ad.parentNode + } + if (!ad) { + ad = ab + } + ac = V; + while (ac && ac.parentNode != ab) { + ac = ac.parentNode + } + if (!ac) { + ac = ab + } + if (ad == ac) { + return 0 + } + t = ab.firstChild; + while (t) { + if (t == ad) { + return -1 + } + if (t == ac) { + return 1 + } + t = t.nextSibling + } + } + function B(V, Y, X) { + var t, W; + if (V) { + N[h] = Y; + N[U] = X + } else { + N[P] = Y; + N[z] = X + } + t = N[P]; + while (t.parentNode) { + t = t.parentNode + } + W = N[h]; + while (W.parentNode) { + W = W.parentNode + } + if (W == t) { + if (G(N[h], N[U], N[P], N[z]) > 0) { + N.collapse(V) + } + } else { + N.collapse(V) + } + N.collapsed = l(); + N.commonAncestorContainer = c.findCommonAncestor(N[h], N[P]) + } + function m(ab) { + var aa, X = 0, + ad = 0, + V, Z, W, Y, t, ac; + if (N[h] == N[P]) { + return f(ab) + } + for (aa = N[P], V = aa.parentNode; V; aa = V, V = V.parentNode) { + if (V == N[h]) { + return r(aa, ab) + }++X + } + for (aa = N[h], V = aa.parentNode; V; aa = V, V = V.parentNode) { + if (V == N[P]) { + return T(aa, ab) + }++ad + } + Z = ad - X; + W = N[h]; + while (Z > 0) { + W = W.parentNode; + Z-- + } + Y = N[P]; + while (Z < 0) { + Y = Y.parentNode; + Z++ + } + for (t = W.parentNode, ac = Y.parentNode; t != ac; t = t.parentNode, ac = ac.parentNode) { + W = t; + Y = ac + } + return o(W, Y, ab) + } + function f(Z) { + var ab, Y, X, aa, t, W, V; + if (Z != j) { + ab = e.createDocumentFragment() + } + if (N[U] == N[z]) { + return ab + } + if (N[h].nodeType == 3) { + Y = N[h].nodeValue; + X = Y.substring(N[U], N[z]); + if (Z != E) { + N[h].deleteData(N[U], N[z] - N[U]); + N.collapse(D) + } + if (Z == j) { + return + } + ab.appendChild(e.createTextNode(X)); + return ab + } + aa = O(N[h], N[U]); + t = N[z] - N[U]; + while (t > 0) { + W = aa.nextSibling; + V = y(aa, Z); + if (ab) { + ab.appendChild(V) + }--t; + aa = W + } + if (Z != E) { + N.collapse(D) + } + return ab + } + function r(ab, Y) { + var aa, Z, V, t, X, W; + if (Y != j) { + aa = e.createDocumentFragment() + } + Z = i(ab, Y); + if (aa) { + aa.appendChild(Z) + } + V = n(ab); + t = V - N[U]; + if (t <= 0) { + if (Y != E) { + N.setEndBefore(ab); + N.collapse(R) + } + return aa + } + Z = ab.previousSibling; + while (t > 0) { + X = Z.previousSibling; + W = y(Z, Y); + if (aa) { + aa.insertBefore(W, aa.firstChild) + }--t; + Z = X + } + if (Y != E) { + N.setEndBefore(ab); + N.collapse(R) + } + return aa + } + function T(Z, Y) { + var ab, V, aa, t, X, W; + if (Y != j) { + ab = e.createDocumentFragment() + } + aa = Q(Z, Y); + if (ab) { + ab.appendChild(aa) + } + V = n(Z); + ++V; + t = N[z] - V; + aa = Z.nextSibling; + while (t > 0) { + X = aa.nextSibling; + W = y(aa, Y); + if (ab) { + ab.appendChild(W) + }--t; + aa = X + } + if (Y != E) { + N.setStartAfter(Z); + N.collapse(D) + } + return ab + } + function o(Z, t, ac) { + var W, ae, Y, aa, ab, V, ad, X; + if (ac != j) { + ae = e.createDocumentFragment() + } + W = Q(Z, ac); + if (ae) { + ae.appendChild(W) + } + Y = Z.parentNode; + aa = n(Z); + ab = n(t); + ++aa; + V = ab - aa; + ad = Z.nextSibling; + while (V > 0) { + X = ad.nextSibling; + W = y(ad, ac); + if (ae) { + ae.appendChild(W) + } + ad = X; + --V + } + W = i(t, ac); + if (ae) { + ae.appendChild(W) + } + if (ac != E) { + N.setStartAfter(Z); + N.collapse(D) + } + return ae + } + function i(aa, ab) { + var W = O(N[P], N[z] - 1), + ac, Z, Y, t, V, X = W != N[P]; + if (W == aa) { + return L(W, X, R, ab) + } + ac = W.parentNode; + Z = L(ac, R, R, ab); + while (ac) { + while (W) { + Y = W.previousSibling; + t = L(W, X, R, ab); + if (ab != j) { + Z.insertBefore(t, Z.firstChild) + } + X = D; + W = Y + } + if (ac == aa) { + return Z + } + W = ac.previousSibling; + ac = ac.parentNode; + V = L(ac, R, R, ab); + if (ab != j) { + V.appendChild(Z) + } + Z = V + } + } + function Q(aa, ab) { + var X = O(N[h], N[U]), + Y = X != N[h], + ac, Z, W, t, V; + if (X == aa) { + return L(X, Y, D, ab) + } + ac = X.parentNode; + Z = L(ac, R, D, ab); + while (ac) { + while (X) { + W = X.nextSibling; + t = L(X, Y, D, ab); + if (ab != j) { + Z.appendChild(t) + } + Y = D; + X = W + } + if (ac == aa) { + return Z + } + X = ac.nextSibling; + ac = ac.parentNode; + V = L(ac, R, D, ab); + if (ab != j) { + V.appendChild(Z) + } + Z = V + } + } + function L(t, Y, ab, ac) { + var X, W, Z, V, aa; + if (Y) { + return y(t, ac) + } + if (t.nodeType == 3) { + X = t.nodeValue; + if (ab) { + V = N[U]; + W = X.substring(V); + Z = X.substring(0, V) + } else { + V = N[z]; + W = X.substring(0, V); + Z = X.substring(V) + } + if (ac != E) { + t.nodeValue = Z + } + if (ac == j) { + return + } + aa = t.cloneNode(R); + aa.nodeValue = W; + return aa + } + if (ac == j) { + return + } + return t.cloneNode(R) + } + function y(V, t) { + if (t != j) { + return t == E ? V.cloneNode(D) : V + } + V.parentNode.removeChild(V) + } + } + a.Range = b +})(tinymce.dom); +(function() { + function a(g) { + var i = this, + j = "\uFEFF", + e, h, d = g.dom, + c = true, + f = false; + + function b() { + var n = g.getRng(), + k = d.createRng(), + m, o; + m = n.item ? n.item(0) : n.parentElement(); + if (m.ownerDocument != d.doc) { + return k + } + o = g.isCollapsed(); + if (n.item || !m.hasChildNodes()) { + if (o) { + k.setStart(m, 0); + k.setEnd(m, 0) + } else { + k.setStart(m.parentNode, d.nodeIndex(m)); + k.setEnd(k.startContainer, k.startOffset + 1) + } + return k + } + function l(s) { + var u, q, t, p, A = 0, + x, y, z, r, v; + r = n.duplicate(); + r.collapse(s); + u = d.create("a"); + z = r.parentElement(); + if (!z.hasChildNodes()) { + k[s ? "setStart" : "setEnd"](z, 0); + return + } + z.appendChild(u); + r.moveToElementText(u); + v = n.compareEndPoints(s ? "StartToStart" : "EndToEnd", r); + if (v > 0) { + k[s ? "setStartAfter" : "setEndAfter"](z); + d.remove(u); + return + } + p = tinymce.grep(z.childNodes); + x = p.length - 1; + while (A <= x) { + y = Math.floor((A + x) / 2); + z.insertBefore(u, p[y]); + r.moveToElementText(u); + v = n.compareEndPoints(s ? "StartToStart" : "EndToEnd", r); + if (v > 0) { + A = y + 1 + } else { + if (v < 0) { + x = y - 1 + } else { + found = true; + break + } + } + } + q = v > 0 || y == 0 ? u.nextSibling : u.previousSibling; + if (q.nodeType == 1) { + d.remove(u); + t = d.nodeIndex(q); + q = q.parentNode; + if (!s || y > 0) { + t++ + } + } else { + if (v > 0 || y == 0) { + r.setEndPoint(s ? "StartToStart" : "EndToEnd", n); + t = r.text.length + } else { + r.setEndPoint(s ? "StartToStart" : "EndToEnd", n); + t = q.nodeValue.length - r.text.length + } + d.remove(u) + } + k[s ? "setStart" : "setEnd"](q, t) + } + l(true); + if (!o) { + l() + } + return k + } + this.addRange = function(k) { + var p, n, m, r, u, s, t = g.dom.doc, + o = t.body; + + function l(B) { + var x, A, v, z, y; + v = d.create("a"); + x = B ? m : u; + A = B ? r : s; + z = p.duplicate(); + if (x == t || x == t.documentElement) { + x = o; + A = 0 + } + if (x.nodeType == 3) { + x.parentNode.insertBefore(v, x); + z.moveToElementText(v); + z.moveStart("character", A); + d.remove(v); + p.setEndPoint(B ? "StartToStart" : "EndToEnd", z) + } else { + y = x.childNodes; + if (y.length) { + if (A >= y.length) { + d.insertAfter(v, y[y.length - 1]) + } else { + x.insertBefore(v, y[A]) + } + z.moveToElementText(v) + } else { + v = t.createTextNode(j); + x.appendChild(v); + z.moveToElementText(v.parentNode); + z.collapse(c) + } + p.setEndPoint(B ? "StartToStart" : "EndToEnd", z); + d.remove(v) + } + } + this.destroy(); + m = k.startContainer; + r = k.startOffset; + u = k.endContainer; + s = k.endOffset; + p = o.createTextRange(); + if (m == u && m.nodeType == 1 && r == s - 1) { + if (r == s - 1) { + try { + n = o.createControlRange(); + n.addElement(m.childNodes[r]); + n.select(); + return + } catch (q) {} + } + } + l(true); + l(); + p.select() + }; + this.getRangeAt = function() { + if (!e || !tinymce.dom.RangeUtils.compareRanges(h, g.getRng())) { + e = b(); + h = g.getRng() + } + try { + e.startContainer.nextSibling + } catch (k) { + e = b(); + h = null + } + return e + }; + this.destroy = function() { + h = e = null + } + } + tinymce.dom.TridentSelection = a +})(); +(function() { + var p = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + j = 0, + d = Object.prototype.toString, + o = false, + i = true; + [0, 0].sort(function() { + i = false; + return 0 + }); + var b = function(v, e, z, A) { + z = z || []; + e = e || document; + var C = e; + if (e.nodeType !== 1 && e.nodeType !== 9) { + return [] + } + if (!v || typeof v !== "string") { + return z + } + var x = [], + s, E, H, r, u = true, + t = b.isXML(e), + B = v, + D, G, F, y; + do { + p.exec(""); + s = p.exec(B); + if (s) { + B = s[3]; + x.push(s[1]); + if (s[2]) { + r = s[3]; + break + } + } + } while (s); + if (x.length > 1 && k.exec(v)) { + if (x.length === 2 && f.relative[x[0]]) { + E = h(x[0] + x[1], e) + } else { + E = f.relative[x[0]] ? [e] : b(x.shift(), e); + while (x.length) { + v = x.shift(); + if (f.relative[v]) { + v += x.shift() + } + E = h(v, E) + } + } + } else { + if (!A && x.length > 1 && e.nodeType === 9 && !t && f.match.ID.test(x[0]) && !f.match.ID.test(x[x.length - 1])) { + D = b.find(x.shift(), e, t); + e = D.expr ? b.filter(D.expr, D.set)[0] : D.set[0] + } + if (e) { + D = A ? { + expr: x.pop(), + set: a(A) + } : b.find(x.pop(), x.length === 1 && (x[0] === "~" || x[0] === "+") && e.parentNode ? e.parentNode : e, t); + E = D.expr ? b.filter(D.expr, D.set) : D.set; + if (x.length > 0) { + H = a(E) + } else { + u = false + } + while (x.length) { + G = x.pop(); + F = G; + if (!f.relative[G]) { + G = "" + } else { + F = x.pop() + } + if (F == null) { + F = e + } + f.relative[G](H, F, t) + } + } else { + H = x = [] + } + } + if (!H) { + H = E + } + if (!H) { + b.error(G || v) + } + if (d.call(H) === "[object Array]") { + if (!u) { + z.push.apply(z, H) + } else { + if (e && e.nodeType === 1) { + for (y = 0; H[y] != null; y++) { + if (H[y] && (H[y] === true || H[y].nodeType === 1 && b.contains(e, H[y]))) { + z.push(E[y]) + } + } + } else { + for (y = 0; H[y] != null; y++) { + if (H[y] && H[y].nodeType === 1) { + z.push(E[y]) + } + } + } + } + } else { + a(H, z) + } + if (r) { + b(r, C, z, A); + b.uniqueSort(z) + } + return z + }; + b.uniqueSort = function(r) { + if (c) { + o = i; + r.sort(c); + if (o) { + for (var e = 1; e < r.length; e++) { + if (r[e] === r[e - 1]) { + r.splice(e--, 1) + } + } + } + } + return r + }; + b.matches = function(e, r) { + return b(e, null, null, r) + }; + b.find = function(y, e, z) { + var x; + if (!y) { + return [] + } + for (var t = 0, s = f.order.length; t < s; t++) { + var v = f.order[t], + u; + if ((u = f.leftMatch[v].exec(y))) { + var r = u[1]; + u.splice(1, 1); + if (r.substr(r.length - 1) !== "\\") { + u[1] = (u[1] || "").replace(/\\/g, ""); + x = f.find[v](u, e, z); + if (x != null) { + y = y.replace(f.match[v], ""); + break + } + } + } + } + if (!x) { + x = e.getElementsByTagName("*") + } + return { + set: x, + expr: y + } + }; + b.filter = function(C, B, F, u) { + var s = C, + H = [], + z = B, + x, e, y = B && B[0] && b.isXML(B[0]); + while (C && B.length) { + for (var A in f.filter) { + if ((x = f.leftMatch[A].exec(C)) != null && x[2]) { + var r = f.filter[A], + G, E, t = x[1]; + e = false; + x.splice(1, 1); + if (t.substr(t.length - 1) === "\\") { + continue + } + if (z === H) { + H = [] + } + if (f.preFilter[A]) { + x = f.preFilter[A](x, z, F, H, u, y); + if (!x) { + e = G = true + } else { + if (x === true) { + continue + } + } + } + if (x) { + for (var v = 0; + (E = z[v]) != null; v++) { + if (E) { + G = r(E, x, v, z); + var D = u ^ !! G; + if (F && G != null) { + if (D) { + e = true + } else { + z[v] = false + } + } else { + if (D) { + H.push(E); + e = true + } + } + } + } + } + if (G !== undefined) { + if (!F) { + z = H + } + C = C.replace(f.match[A], ""); + if (!e) { + return [] + } + break + } + } + } + if (C === s) { + if (e == null) { + b.error(C) + } else { + break + } + } + s = C + } + return z + }; + b.error = function(e) { + throw "Syntax error, unrecognized expression: " + e + }; + var f = b.selectors = { + order: ["ID", "NAME", "TAG"], + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(e) { + return e.getAttribute("href") + } + }, + relative: { + "+": function(x, r) { + var t = typeof r === "string", + v = t && !/\W/.test(r), + y = t && !v; + if (v) { + r = r.toLowerCase() + } + for (var s = 0, e = x.length, u; s < e; s++) { + if ((u = x[s])) { + while ((u = u.previousSibling) && u.nodeType !== 1) {} + x[s] = y || u && u.nodeName.toLowerCase() === r ? u || false : u === r + } + } + if (y) { + b.filter(r, x, true) + } + }, + ">": function(x, r) { + var u = typeof r === "string", + v, s = 0, + e = x.length; + if (u && !/\W/.test(r)) { + r = r.toLowerCase(); + for (; s < e; s++) { + v = x[s]; + if (v) { + var t = v.parentNode; + x[s] = t.nodeName.toLowerCase() === r ? t : false + } + } + } else { + for (; s < e; s++) { + v = x[s]; + if (v) { + x[s] = u ? v.parentNode : v.parentNode === r + } + } + if (u) { + b.filter(r, x, true) + } + } + }, + "": function(t, r, v) { + var s = j++, + e = q, + u; + if (typeof r === "string" && !/\W/.test(r)) { + r = r.toLowerCase(); + u = r; + e = n + } + e("parentNode", r, s, t, u, v) + }, + "~": function(t, r, v) { + var s = j++, + e = q, + u; + if (typeof r === "string" && !/\W/.test(r)) { + r = r.toLowerCase(); + u = r; + e = n + } + e("previousSibling", r, s, t, u, v) + } + }, + find: { + ID: function(r, s, t) { + if (typeof s.getElementById !== "undefined" && !t) { + var e = s.getElementById(r[1]); + return e ? [e] : [] + } + }, + NAME: function(s, v) { + if (typeof v.getElementsByName !== "undefined") { + var r = [], + u = v.getElementsByName(s[1]); + for (var t = 0, e = u.length; t < e; t++) { + if (u[t].getAttribute("name") === s[1]) { + r.push(u[t]) + } + } + return r.length === 0 ? null : r + } + }, + TAG: function(e, r) { + return r.getElementsByTagName(e[1]) + } + }, + preFilter: { + CLASS: function(t, r, s, e, x, y) { + t = " " + t[1].replace(/\\/g, "") + " "; + if (y) { + return t + } + for (var u = 0, v; + (v = r[u]) != null; u++) { + if (v) { + if (x ^ (v.className && (" " + v.className + " ").replace(/[\t\n]/g, " ").indexOf(t) >= 0)) { + if (!s) { + e.push(v) + } + } else { + if (s) { + r[u] = false + } + } + } + } + return false + }, + ID: function(e) { + return e[1].replace(/\\/g, "") + }, + TAG: function(r, e) { + return r[1].toLowerCase() + }, + CHILD: function(e) { + if (e[1] === "nth") { + var r = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2] === "even" && "2n" || e[2] === "odd" && "2n+1" || !/\D/.test(e[2]) && "0n+" + e[2] || e[2]); + e[2] = (r[1] + (r[2] || 1)) - 0; + e[3] = r[3] - 0 + } + e[0] = j++; + return e + }, + ATTR: function(u, r, s, e, v, x) { + var t = u[1].replace(/\\/g, ""); + if (!x && f.attrMap[t]) { + u[1] = f.attrMap[t] + } + if (u[2] === "~=") { + u[4] = " " + u[4] + " " + } + return u + }, + PSEUDO: function(u, r, s, e, v) { + if (u[1] === "not") { + if ((p.exec(u[3]) || "").length > 1 || /^\w/.test(u[3])) { + u[3] = b(u[3], null, null, r) + } else { + var t = b.filter(u[3], r, s, true ^ v); + if (!s) { + e.push.apply(e, t) + } + return false + } + } else { + if (f.match.POS.test(u[0]) || f.match.CHILD.test(u[0])) { + return true + } + } + return u + }, + POS: function(e) { + e.unshift(true); + return e + } + }, + filters: { + enabled: function(e) { + return e.disabled === false && e.type !== "hidden" + }, + disabled: function(e) { + return e.disabled === true + }, + checked: function(e) { + return e.checked === true + }, + selected: function(e) { + e.parentNode.selectedIndex; + return e.selected === true + }, + parent: function(e) { + return !!e.firstChild + }, + empty: function(e) { + return !e.firstChild + }, + has: function(s, r, e) { + return !!b(e[3], s).length + }, + header: function(e) { + return (/h\d/i).test(e.nodeName) + }, + text: function(e) { + return "text" === e.type + }, + radio: function(e) { + return "radio" === e.type + }, + checkbox: function(e) { + return "checkbox" === e.type + }, + file: function(e) { + return "file" === e.type + }, + password: function(e) { + return "password" === e.type + }, + submit: function(e) { + return "submit" === e.type + }, + image: function(e) { + return "image" === e.type + }, + reset: function(e) { + return "reset" === e.type + }, + button: function(e) { + return "button" === e.type || e.nodeName.toLowerCase() === "button" + }, + input: function(e) { + return (/input|select|textarea|button/i).test(e.nodeName) + } + }, + setFilters: { + first: function(r, e) { + return e === 0 + }, + last: function(s, r, e, t) { + return r === t.length - 1 + }, + even: function(r, e) { + return e % 2 === 0 + }, + odd: function(r, e) { + return e % 2 === 1 + }, + lt: function(s, r, e) { + return r < e[3] - 0 + }, + gt: function(s, r, e) { + return r > e[3] - 0 + }, + nth: function(s, r, e) { + return e[3] - 0 === r + }, + eq: function(s, r, e) { + return e[3] - 0 === r + } + }, + filter: { + PSEUDO: function(s, y, x, z) { + var e = y[1], + r = f.filters[e]; + if (r) { + return r(s, x, y, z) + } else { + if (e === "contains") { + return (s.textContent || s.innerText || b.getText([s]) || "").indexOf(y[3]) >= 0 + } else { + if (e === "not") { + var t = y[3]; + for (var v = 0, u = t.length; v < u; v++) { + if (t[v] === s) { + return false + } + } + return true + } else { + b.error("Syntax error, unrecognized expression: " + e) + } + } + } + }, + CHILD: function(e, t) { + var x = t[1], + r = e; + switch (x) { + case "only": + case "first": + while ((r = r.previousSibling)) { + if (r.nodeType === 1) { + return false + } + } + if (x === "first") { + return true + } + r = e; + case "last": + while ((r = r.nextSibling)) { + if (r.nodeType === 1) { + return false + } + } + return true; + case "nth": + var s = t[2], + A = t[3]; + if (s === 1 && A === 0) { + return true + } + var v = t[0], + z = e.parentNode; + if (z && (z.sizcache !== v || !e.nodeIndex)) { + var u = 0; + for (r = z.firstChild; r; r = r.nextSibling) { + if (r.nodeType === 1) { + r.nodeIndex = ++u + } + } + z.sizcache = v + } + var y = e.nodeIndex - A; + if (s === 0) { + return y === 0 + } else { + return (y % s === 0 && y / s >= 0) + } + } + }, + ID: function(r, e) { + return r.nodeType === 1 && r.getAttribute("id") === e + }, + TAG: function(r, e) { + return (e === "*" && r.nodeType === 1) || r.nodeName.toLowerCase() === e + }, + CLASS: function(r, e) { + return (" " + (r.className || r.getAttribute("class")) + " ").indexOf(e) > -1 + }, + ATTR: function(v, t) { + var s = t[1], + e = f.attrHandle[s] ? f.attrHandle[s](v) : v[s] != null ? v[s] : v.getAttribute(s), + x = e + "", + u = t[2], + r = t[4]; + return e == null ? u === "!=" : u === "=" ? x === r : u === "*=" ? x.indexOf(r) >= 0 : u === "~=" ? (" " + x + " ").indexOf(r) >= 0 : !r ? x && e !== false : u === "!=" ? x !== r : u === "^=" ? x.indexOf(r) === 0 : u === "$=" ? x.substr(x.length - r.length) === r : u === "|=" ? x === r || x.substr(0, r.length + 1) === r + "-" : false + }, + POS: function(u, r, s, v) { + var e = r[2], + t = f.setFilters[e]; + if (t) { + return t(u, s, r, v) + } + } + } + }; + var k = f.match.POS, + g = function(r, e) { + return "\\" + (e - 0 + 1) + }; + for (var m in f.match) { + f.match[m] = new RegExp(f.match[m].source + (/(?![^\[]*\])(?![^\(]*\))/.source)); + f.leftMatch[m] = new RegExp(/(^(?:.|\r|\n)*?)/.source + f.match[m].source.replace(/\\(\d+)/g, g)) + } + var a = function(r, e) { + r = Array.prototype.slice.call(r, 0); + if (e) { + e.push.apply(e, r); + return e + } + return r + }; + try { + Array.prototype.slice.call(document.documentElement.childNodes, 0)[0].nodeType + } catch (l) { + a = function(u, t) { + var r = t || [], + s = 0; + if (d.call(u) === "[object Array]") { + Array.prototype.push.apply(r, u) + } else { + if (typeof u.length === "number") { + for (var e = u.length; s < e; s++) { + r.push(u[s]) + } + } else { + for (; u[s]; s++) { + r.push(u[s]) + } + } + } + return r + } + } + var c; + if (document.documentElement.compareDocumentPosition) { + c = function(r, e) { + if (!r.compareDocumentPosition || !e.compareDocumentPosition) { + if (r == e) { + o = true + } + return r.compareDocumentPosition ? -1 : 1 + } + var s = r.compareDocumentPosition(e) & 4 ? -1 : r === e ? 0 : 1; + if (s === 0) { + o = true + } + return s + } + } else { + if ("sourceIndex" in document.documentElement) { + c = function(r, e) { + if (!r.sourceIndex || !e.sourceIndex) { + if (r == e) { + o = true + } + return r.sourceIndex ? -1 : 1 + } + var s = r.sourceIndex - e.sourceIndex; + if (s === 0) { + o = true + } + return s + } + } else { + if (document.createRange) { + c = function(t, r) { + if (!t.ownerDocument || !r.ownerDocument) { + if (t == r) { + o = true + } + return t.ownerDocument ? -1 : 1 + } + var s = t.ownerDocument.createRange(), + e = r.ownerDocument.createRange(); + s.setStart(t, 0); + s.setEnd(t, 0); + e.setStart(r, 0); + e.setEnd(r, 0); + var u = s.compareBoundaryPoints(Range.START_TO_END, e); + if (u === 0) { + o = true + } + return u + } + } + } + } + b.getText = function(e) { + var r = "", + t; + for (var s = 0; e[s]; s++) { + t = e[s]; + if (t.nodeType === 3 || t.nodeType === 4) { + r += t.nodeValue + } else { + if (t.nodeType !== 8) { + r += b.getText(t.childNodes) + } + } + } + return r + }; + (function() { + var r = document.createElement("div"), + s = "script" + (new Date()).getTime(); + r.innerHTML = ""; + var e = document.documentElement; + e.insertBefore(r, e.firstChild); + if (document.getElementById(s)) { + f.find.ID = function(u, v, x) { + if (typeof v.getElementById !== "undefined" && !x) { + var t = v.getElementById(u[1]); + return t ? t.id === u[1] || typeof t.getAttributeNode !== "undefined" && t.getAttributeNode("id").nodeValue === u[1] ? [t] : undefined : [] + } + }; + f.filter.ID = function(v, t) { + var u = typeof v.getAttributeNode !== "undefined" && v.getAttributeNode("id"); + return v.nodeType === 1 && u && u.nodeValue === t + } + } + e.removeChild(r); + e = r = null + })(); + (function() { + var e = document.createElement("div"); + e.appendChild(document.createComment("")); + if (e.getElementsByTagName("*").length > 0) { + f.find.TAG = function(r, v) { + var u = v.getElementsByTagName(r[1]); + if (r[1] === "*") { + var t = []; + for (var s = 0; u[s]; s++) { + if (u[s].nodeType === 1) { + t.push(u[s]) + } + } + u = t + } + return u + } + } + e.innerHTML = ""; + if (e.firstChild && typeof e.firstChild.getAttribute !== "undefined" && e.firstChild.getAttribute("href") !== "#") { + f.attrHandle.href = function(r) { + return r.getAttribute("href", 2) + } + } + e = null + })(); + if (document.querySelectorAll) { + (function() { + var e = b, + s = document.createElement("div"); + s.innerHTML = "

        "; + if (s.querySelectorAll && s.querySelectorAll(".TEST").length === 0) { + return + } + b = function(x, v, t, u) { + v = v || document; + if (!u && v.nodeType === 9 && !b.isXML(v)) { + try { + return a(v.querySelectorAll(x), t) + } catch (y) {} + } + return e(x, v, t, u) + }; + for (var r in e) { + b[r] = e[r] + } + s = null + })() + }(function() { + var e = document.createElement("div"); + e.innerHTML = "
        "; + if (!e.getElementsByClassName || e.getElementsByClassName("e").length === 0) { + return + } + e.lastChild.className = "e"; + if (e.getElementsByClassName("e").length === 1) { + return + } + f.order.splice(1, 0, "CLASS"); + f.find.CLASS = function(r, s, t) { + if (typeof s.getElementsByClassName !== "undefined" && !t) { + return s.getElementsByClassName(r[1]) + } + }; + e = null + })(); + + function n(r, x, v, A, y, z) { + for (var t = 0, s = A.length; t < s; t++) { + var e = A[t]; + if (e) { + e = e[r]; + var u = false; + while (e) { + if (e.sizcache === v) { + u = A[e.sizset]; + break + } + if (e.nodeType === 1 && !z) { + e.sizcache = v; + e.sizset = t + } + if (e.nodeName.toLowerCase() === x) { + u = e; + break + } + e = e[r] + } + A[t] = u + } + } + } + function q(r, x, v, A, y, z) { + for (var t = 0, s = A.length; t < s; t++) { + var e = A[t]; + if (e) { + e = e[r]; + var u = false; + while (e) { + if (e.sizcache === v) { + u = A[e.sizset]; + break + } + if (e.nodeType === 1) { + if (!z) { + e.sizcache = v; + e.sizset = t + } + if (typeof x !== "string") { + if (e === x) { + u = true; + break + } + } else { + if (b.filter(x, [e]).length > 0) { + u = e; + break + } + } + } + e = e[r] + } + A[t] = u + } + } + } + b.contains = document.compareDocumentPosition ? + function(r, e) { + return !!(r.compareDocumentPosition(e) & 16) + } : function(r, e) { + return r !== e && (r.contains ? r.contains(e) : true) + }; + b.isXML = function(e) { + var r = (e ? e.ownerDocument || e : 0).documentElement; + return r ? r.nodeName !== "HTML" : false + }; + var h = function(e, y) { + var t = [], + u = "", + v, s = y.nodeType ? [y] : y; + while ((v = f.match.PSEUDO.exec(e))) { + u += v[0]; + e = e.replace(f.match.PSEUDO, "") + } + e = f.relative[e] ? e + "*" : e; + for (var x = 0, r = s.length; x < r; x++) { + b(e, s[x], t) + } + return b.filter(u, t) + }; + window.tinymce.dom.Sizzle = b +})(); +(function(d) { + var f = d.each, + c = d.DOM, + b = d.isIE, + e = d.isWebKit, + a; + d.create("tinymce.dom.EventUtils", { + EventUtils: function() { + this.inits = []; + this.events = [] + }, + add: function(m, p, l, j) { + var g, h = this, + i = h.events, + k; + if (p instanceof Array) { + k = []; + f(p, function(o) { + k.push(h.add(m, o, l, j)) + }); + return k + } + if (m && m.hasOwnProperty && m instanceof Array) { + k = []; + f(m, function(n) { + n = c.get(n); + k.push(h.add(n, p, l, j)) + }); + return k + } + m = c.get(m); + if (!m) { + return + } + g = function(n) { + if (h.disabled) { + return + } + n = n || window.event; + if (n && b) { + if (!n.target) { + n.target = n.srcElement + } + d.extend(n, h._stoppers) + } + if (!j) { + return l(n) + } + return l.call(j, n) + }; + if (p == "unload") { + d.unloads.unshift({ + func: g + }); + return g + } + if (p == "init") { + if (h.domLoaded) { + g() + } else { + h.inits.push(g) + } + return g + } + i.push({ + obj: m, + name: p, + func: l, + cfunc: g, + scope: j + }); + h._add(m, p, g); + return l + }, + remove: function(l, m, k) { + var h = this, + g = h.events, + i = false, + j; + if (l && l.hasOwnProperty && l instanceof Array) { + j = []; + f(l, function(n) { + n = c.get(n); + j.push(h.remove(n, m, k)) + }); + return j + } + l = c.get(l); + f(g, function(o, n) { + if (o.obj == l && o.name == m && (!k || (o.func == k || o.cfunc == k))) { + g.splice(n, 1); + h._remove(l, m, o.cfunc); + i = true; + return false + } + }); + return i + }, + clear: function(l) { + var j = this, + g = j.events, + h, k; + if (l) { + l = c.get(l); + for (h = g.length - 1; h >= 0; h--) { + k = g[h]; + if (k.obj === l) { + j._remove(k.obj, k.name, k.cfunc); + k.obj = k.cfunc = null; + g.splice(h, 1) + } + } + } + }, + cancel: function(g) { + if (!g) { + return false + } + this.stop(g); + return this.prevent(g) + }, + stop: function(g) { + if (g.stopPropagation) { + g.stopPropagation() + } else { + g.cancelBubble = true + } + return false + }, + prevent: function(g) { + if (g.preventDefault) { + g.preventDefault() + } else { + g.returnValue = false + } + return false + }, + destroy: function() { + var g = this; + f(g.events, function(j, h) { + g._remove(j.obj, j.name, j.cfunc); + j.obj = j.cfunc = null + }); + g.events = []; + g = null + }, + _add: function(h, i, g) { + if (h.attachEvent) { + h.attachEvent("on" + i, g) + } else { + if (h.addEventListener) { + h.addEventListener(i, g, false) + } else { + h["on" + i] = g + } + } + }, + _remove: function(i, j, h) { + if (i) { + try { + if (i.detachEvent) { + i.detachEvent("on" + j, h) + } else { + if (i.removeEventListener) { + i.removeEventListener(j, h, false) + } else { + i["on" + j] = null + } + } + } catch (g) {} + } + }, + _pageInit: function(h) { + var g = this; + if (g.domLoaded) { + return + } + g.domLoaded = true; + f(g.inits, function(i) { + i() + }); + g.inits = [] + }, + _wait: function(i) { + var g = this, + h = i.document; + if (i.tinyMCE_GZ && tinyMCE_GZ.loaded) { + g.domLoaded = 1; + return + } + if (h.attachEvent) { + h.attachEvent("onreadystatechange", function() { + if (h.readyState === "complete") { + h.detachEvent("onreadystatechange", arguments.callee); + g._pageInit(i) + } + }); + if (h.documentElement.doScroll && i == i.top) { + (function() { + if (g.domLoaded) { + return + } + try { + h.documentElement.doScroll("left") + } catch (j) { + setTimeout(arguments.callee, 0); + return + } + g._pageInit(i) + })() + } + } else { + if (h.addEventListener) { + g._add(i, "DOMContentLoaded", function() { + g._pageInit(i) + }) + } + } + g._add(i, "load", function() { + g._pageInit(i) + }) + }, + _stoppers: { + preventDefault: function() { + this.returnValue = false + }, + stopPropagation: function() { + this.cancelBubble = true + } + } + }); + a = d.dom.Event = new d.dom.EventUtils(); + a._wait(window); + d.addUnload(function() { + a.destroy() + }) +})(tinymce); +(function(a) { + a.dom.Element = function(f, d) { + var b = this, + e, c; + b.settings = d = d || {}; + b.id = f; + b.dom = e = d.dom || a.DOM; + if (!a.isIE) { + c = e.get(b.id) + } + a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/), function(g) { + b[g] = function() { + var h = [f], + j; + for (j = 0; j < arguments.length; j++) { + h.push(arguments[j]) + } + h = e[g].apply(e, h); + b.update(g); + return h + } + }); + a.extend(b, { + on: function(i, h, g) { + return a.dom.Event.add(b.id, i, h, g) + }, + getXY: function() { + return { + x: parseInt(b.getStyle("left")), + y: parseInt(b.getStyle("top")) + } + }, + getSize: function() { + var g = e.get(b.id); + return { + w: parseInt(b.getStyle("width") || g.clientWidth), + h: parseInt(b.getStyle("height") || g.clientHeight) + } + }, + moveTo: function(g, h) { + b.setStyles({ + left: g, + top: h + }) + }, + moveBy: function(g, i) { + var h = b.getXY(); + b.moveTo(h.x + g, h.y + i) + }, + resizeTo: function(g, i) { + b.setStyles({ + width: g, + height: i + }) + }, + resizeBy: function(g, j) { + var i = b.getSize(); + b.resizeTo(i.w + g, i.h + j) + }, + update: function(h) { + var g; + if (a.isIE6 && d.blocker) { + h = h || ""; + if (h.indexOf("get") === 0 || h.indexOf("has") === 0 || h.indexOf("is") === 0) { + return + } + if (h == "remove") { + e.remove(b.blocker); + return + } + if (!b.blocker) { + b.blocker = e.uniqueId(); + g = e.add(d.container || e.getRoot(), "iframe", { + id: b.blocker, + style: "position:absolute;", + frameBorder: 0, + src: 'javascript:""' + }); + e.setStyle(g, "opacity", 0) + } else { + g = e.get(b.blocker) + } + e.setStyles(g, { + left: b.getStyle("left", 1), + top: b.getStyle("top", 1), + width: b.getStyle("width", 1), + height: b.getStyle("height", 1), + display: b.getStyle("display", 1), + zIndex: parseInt(b.getStyle("zIndex", 1) || 0) - 1 + }) + } + } + }) + } +})(tinymce); +(function(c) { + function e(f) { + return f.replace(/[\n\r]+/g, "") + } + var b = c.is, + a = c.isIE, + d = c.each; + c.create("tinymce.dom.Selection", { + Selection: function(i, h, g) { + var f = this; + f.dom = i; + f.win = h; + f.serializer = g; + d(["onBeforeSetContent", "onBeforeGetContent", "onSetContent", "onGetContent"], function(j) { + f[j] = new c.util.Dispatcher(f) + }); + if (!f.win.getSelection) { + f.tridentSel = new c.dom.TridentSelection(f) + } + if (c.isIE && i.boxModel) { + this._fixIESelection() + } + c.addUnload(f.destroy, f) + }, + getContent: function(g) { + var f = this, + h = f.getRng(), + l = f.dom.create("body"), + j = f.getSel(), + i, k, m; + g = g || {}; + i = k = ""; + g.get = true; + g.format = g.format || "html"; + f.onBeforeGetContent.dispatch(f, g); + if (g.format == "text") { + return f.isCollapsed() ? "" : (h.text || (j.toString ? j.toString() : "")) + } + if (h.cloneContents) { + m = h.cloneContents(); + if (m) { + l.appendChild(m) + } + } else { + if (b(h.item) || b(h.htmlText)) { + l.innerHTML = h.item ? h.item(0).outerHTML : h.htmlText + } else { + l.innerHTML = h.toString() + } + } + if (/^\s/.test(l.innerHTML)) { + i = " " + } + if (/\s+$/.test(l.innerHTML)) { + k = " " + } + g.getInner = true; + g.content = f.isCollapsed() ? "" : i + f.serializer.serialize(l, g) + k; + f.onGetContent.dispatch(f, g); + return g.content + }, + setContent: function(k, j) { + var h = this, + f = h.getRng(), + i, l = h.win.document, + m, g; + j = j || { + format: "html" + }; + j.set = true; + k = j.content = k; + if (!j.no_events) { + h.onBeforeSetContent.dispatch(h, j) + } + k = j.content; + if (f.insertNode) { + k += '_'; + if (f.startContainer == l && f.endContainer == l) { + l.body.innerHTML = k + } else { + f.deleteContents(); + if (l.body.childNodes.length == 0) { + l.body.innerHTML = k + } else { + if (f.createContextualFragment) { + f.insertNode(f.createContextualFragment(k)) + } else { + m = l.createDocumentFragment(); + g = l.createElement("div"); + m.appendChild(g); + g.outerHTML = k; + f.insertNode(m) + } + } + } + i = h.dom.get("__caret"); + f = l.createRange(); + f.setStartBefore(i); + f.setEndBefore(i); + h.setRng(f); + h.dom.remove("__caret"); + h.setRng(f) + } else { + if (f.item) { + l.execCommand("Delete", false, null); + f = h.getRng() + } + f.pasteHTML(k) + } + if (!j.no_events) { + h.onSetContent.dispatch(h, j) + } + }, + getStart: function() { + var g = this.getRng(), + h, f, j, i; + if (g.duplicate || g.item) { + if (g.item) { + return g.item(0) + } + j = g.duplicate(); + j.collapse(1); + h = j.parentElement(); + f = i = g.parentElement(); + while (i = i.parentNode) { + if (i == h) { + h = f; + break + } + } + return h + } else { + h = g.startContainer; + if (h.nodeType == 1 && h.hasChildNodes()) { + h = h.childNodes[Math.min(h.childNodes.length - 1, g.startOffset)] + } + if (h && h.nodeType == 3) { + return h.parentNode + } + return h + } + }, + getEnd: function() { + var g = this, + h = g.getRng(), + i, f; + if (h.duplicate || h.item) { + if (h.item) { + return h.item(0) + } + h = h.duplicate(); + h.collapse(0); + i = h.parentElement(); + if (i && i.nodeName == "BODY") { + return i.lastChild || i + } + return i + } else { + i = h.endContainer; + f = h.endOffset; + if (i.nodeType == 1 && i.hasChildNodes()) { + i = i.childNodes[f > 0 ? f - 1 : f] + } + if (i && i.nodeType == 3) { + return i.parentNode + } + return i + } + }, + getBookmark: function(r, s) { + var v = this, + m = v.dom, + g, j, i, n, h, o, p, l = "\uFEFF", + u; + + function f(x, y) { + var t = 0; + d(m.select(x), function(A, z) { + if (A == y) { + t = z + } + }); + return t + } + if (r == 2) { + function k() { + var x = v.getRng(true), + t = m.getRoot(), + y = {}; + + function z(C, H) { + var B = C[H ? "startContainer" : "endContainer"], + G = C[H ? "startOffset" : "endOffset"], + A = [], + D, F, E = 0; + if (B.nodeType == 3) { + if (s) { + for (D = B.previousSibling; D && D.nodeType == 3; D = D.previousSibling) { + G += D.nodeValue.length + } + } + A.push(G) + } else { + F = B.childNodes; + if (G >= F.length && F.length) { + E = 1; + G = Math.max(0, F.length - 1) + } + A.push(v.dom.nodeIndex(F[G], s) + E) + } + for (; B && B != t; B = B.parentNode) { + A.push(v.dom.nodeIndex(B, s)) + } + return A + } + y.start = z(x, true); + if (!v.isCollapsed()) { + y.end = z(x) + } + return y + } + return k() + } + if (r) { + return { + rng: v.getRng() + } + } + g = v.getRng(); + i = m.uniqueId(); + n = tinyMCE.activeEditor.selection.isCollapsed(); + u = "overflow:hidden;line-height:0px"; + if (g.duplicate || g.item) { + if (!g.item) { + j = g.duplicate(); + try { + g.collapse(); + g.pasteHTML('' + l + ""); + if (!n) { + j.collapse(false); + g.moveToElementText(j.parentElement()); + if (g.compareEndPoints("StartToEnd", j) == 0) { + j.move("character", -1) + } + j.pasteHTML('' + l + "") + } + } catch (q) { + return null + } + } else { + o = g.item(0); + h = o.nodeName; + return { + name: h, + index: f(h, o) + } + } + } else { + o = v.getNode(); + h = o.nodeName; + if (h == "IMG") { + return { + name: h, + index: f(h, o) + } + } + j = g.cloneRange(); + if (!n) { + j.collapse(false); + j.insertNode(m.create("span", { + "data-mce-type": "bookmark", + id: i + "_end", + style: u + }, l)) + } + g.collapse(true); + g.insertNode(m.create("span", { + "data-mce-type": "bookmark", + id: i + "_start", + style: u + }, l)) + } + v.moveToBookmark({ + id: i, + keep: 1 + }); + return { + id: i + } + }, + moveToBookmark: function(n) { + var r = this, + l = r.dom, + i, h, f, q, j, s, o, p; + if (r.tridentSel) { + r.tridentSel.destroy() + } + if (n) { + if (n.start) { + f = l.createRng(); + q = l.getRoot(); + + function g(z) { + var t = n[z ? "start" : "end"], + v, x, y, u; + if (t) { + y = t[0]; + for (x = q, v = t.length - 1; v >= 1; v--) { + u = x.childNodes; + if (t[v] > u.length - 1) { + return + } + x = u[t[v]] + } + if (x.nodeType === 3) { + y = Math.min(t[0], x.nodeValue.length) + } + if (x.nodeType === 1) { + y = Math.min(t[0], x.childNodes.length) + } + if (z) { + f.setStart(x, y) + } else { + f.setEnd(x, y) + } + } + return true + } + if (g(true) && g()) { + r.setRng(f) + } + } else { + if (n.id) { + function k(A) { + var u = l.get(n.id + "_" + A), + z, t, x, y, v = n.keep; + if (u) { + z = u.parentNode; + if (A == "start") { + if (!v) { + t = l.nodeIndex(u) + } else { + z = u.firstChild; + t = 1 + } + j = s = z; + o = p = t + } else { + if (!v) { + t = l.nodeIndex(u) + } else { + z = u.firstChild; + t = 1 + } + s = z; + p = t + } + if (!v) { + y = u.previousSibling; + x = u.nextSibling; + d(c.grep(u.childNodes), function(B) { + if (B.nodeType == 3) { + B.nodeValue = B.nodeValue.replace(/\uFEFF/g, "") + } + }); + while (u = l.get(n.id + "_" + A)) { + l.remove(u, 1) + } + if (y && x && y.nodeType == x.nodeType && y.nodeType == 3 && !c.isOpera) { + t = y.nodeValue.length; + y.appendData(x.nodeValue); + l.remove(x); + if (A == "start") { + j = s = y; + o = p = t + } else { + s = y; + p = t + } + } + } + } + } + function m(t) { + if (l.isBlock(t) && !t.innerHTML) { + t.innerHTML = !a ? '
        ' : " " + } + return t + } + k("start"); + k("end"); + if (j) { + f = l.createRng(); + f.setStart(m(j), o); + f.setEnd(m(s), p); + r.setRng(f) + } + } else { + if (n.name) { + r.select(l.select(n.name)[n.index]) + } else { + if (n.rng) { + r.setRng(n.rng) + } + } + } + } + } + }, + select: function(k, j) { + var i = this, + l = i.dom, + g = l.createRng(), + f; + if (k) { + f = l.nodeIndex(k); + g.setStart(k.parentNode, f); + g.setEnd(k.parentNode, f + 1); + if (j) { + function h(m, o) { + var n = new c.dom.TreeWalker(m, m); + do { + if (m.nodeType == 3 && c.trim(m.nodeValue).length != 0) { + if (o) { + g.setStart(m, 0) + } else { + g.setEnd(m, m.nodeValue.length) + } + return + } + if (m.nodeName == "BR") { + if (o) { + g.setStartBefore(m) + } else { + g.setEndBefore(m) + } + return + } + } while (m = (o ? n.next() : n.prev())) + } + h(k, 1); + h(k) + } + i.setRng(g) + } + return k + }, + isCollapsed: function() { + var f = this, + h = f.getRng(), + g = f.getSel(); + if (!h || h.item) { + return false + } + if (h.compareEndPoints) { + return h.compareEndPoints("StartToEnd", h) === 0 + } + return !g || h.collapsed + }, + collapse: function(f) { + var h = this, + g = h.getRng(), + i; + if (g.item) { + i = g.item(0); + g = h.win.document.body.createTextRange(); + g.moveToElementText(i) + } + g.collapse( !! f); + h.setRng(g) + }, + getSel: function() { + var g = this, + f = this.win; + return f.getSelection ? f.getSelection() : f.document.selection + }, + getRng: function(l) { + var g = this, + h, i, k, j = g.win.document; + if (l && g.tridentSel) { + return g.tridentSel.getRangeAt(0) + } + try { + if (h = g.getSel()) { + i = h.rangeCount > 0 ? h.getRangeAt(0) : (h.createRange ? h.createRange() : j.createRange()) + } + } catch (f) {} + if (c.isIE && i && i.setStart && j.selection.createRange().item) { + k = j.selection.createRange().item(0); + i = j.createRange(); + i.setStartBefore(k); + i.setEndAfter(k) + } + if (!i) { + i = j.createRange ? j.createRange() : j.body.createTextRange() + } + if (g.selectedRange && g.explicitRange) { + if (i.compareBoundaryPoints(i.START_TO_START, g.selectedRange) === 0 && i.compareBoundaryPoints(i.END_TO_END, g.selectedRange) === 0) { + i = g.explicitRange + } else { + g.selectedRange = null; + g.explicitRange = null + } + } + return i + }, + setRng: function(i) { + var h, g = this; + if (!g.tridentSel) { + h = g.getSel(); + if (h) { + g.explicitRange = i; + h.removeAllRanges(); + h.addRange(i); + g.selectedRange = h.getRangeAt(0) + } + } else { + if (i.cloneRange) { + g.tridentSel.addRange(i); + return + } + try { + i.select() + } catch (f) {} + } + }, + setNode: function(g) { + var f = this; + f.setContent(f.dom.getOuterHTML(g)); + return g + }, + getNode: function() { + var h = this, + g = h.getRng(), + i = h.getSel(), + l, k = g.startContainer, + f = g.endContainer; + if (!g) { + return h.dom.getRoot() + } + if (g.setStart) { + l = g.commonAncestorContainer; + if (!g.collapsed) { + if (g.startContainer == g.endContainer) { + if (g.endOffset - g.startOffset < 2) { + if (g.startContainer.hasChildNodes()) { + l = g.startContainer.childNodes[g.startOffset] + } + } + } + if (k.nodeType === 3 && f.nodeType === 3) { + function j(p, m) { + var o = p; + while (p && p.nodeType === 3 && p.length === 0) { + p = m ? p.nextSibling : p.previousSibling + } + return p || o + } + if (k.length === g.startOffset) { + k = j(k.nextSibling, true) + } else { + k = k.parentNode + } + if (g.endOffset === 0) { + f = j(f.previousSibling, false) + } else { + f = f.parentNode + } + if (k && k === f) { + return k + } + } + } + if (l && l.nodeType == 3) { + return l.parentNode + } + return l + } + return g.item ? g.item(0) : g.parentElement() + }, + getSelectedBlocks: function(g, f) { + var i = this, + j = i.dom, + m, h, l, k = []; + m = j.getParent(g || i.getStart(), j.isBlock); + h = j.getParent(f || i.getEnd(), j.isBlock); + if (m) { + k.push(m) + } + if (m && h && m != h) { + l = m; + while ((l = l.nextSibling) && l != h) { + if (j.isBlock(l)) { + k.push(l) + } + } + } + if (h && m != h) { + k.push(h) + } + return k + }, + destroy: function(g) { + var f = this; + f.win = null; + if (f.tridentSel) { + f.tridentSel.destroy() + } + if (!g) { + c.removeUnload(f.destroy) + } + }, + _fixIESelection: function() { + var g = this.dom, + m = g.doc, + h = m.body, + j, n, f; + m.documentElement.unselectable = true; + + function i(o, r) { + var p = h.createTextRange(); + try { + p.moveToPoint(o, r) + } catch (q) { + p = null + } + return p + } + function l(p) { + var o; + if (p.button) { + o = i(p.x, p.y); + if (o) { + if (o.compareEndPoints("StartToStart", n) > 0) { + o.setEndPoint("StartToStart", n) + } else { + o.setEndPoint("EndToEnd", n) + } + o.select() + } + } else { + k() + } + } + function k() { + var o = m.selection.createRange(); + if (n && !o.item && o.compareEndPoints("StartToEnd", o) === 0) { + n.select() + } + g.unbind(m, "mouseup", k); + g.unbind(m, "mousemove", l); + n = j = 0 + } + g.bind(m, ["mousedown", "contextmenu"], function(o) { + if (o.target.nodeName === "HTML") { + if (j) { + k() + } + f = m.documentElement; + if (f.scrollHeight > f.clientHeight) { + return + } + j = 1; + n = i(o.x, o.y); + if (n) { + g.bind(m, "mouseup", k); + g.bind(m, "mousemove", l); + g.win.focus(); + n.select() + } + } + }) + } + }) +})(tinymce); +(function(a) { + a.dom.Serializer = function(e, i, f) { + var h, b, d = a.isIE, + g = a.each, + c; + if (!e.apply_source_formatting) { + e.indent = false + } + e.remove_trailing_brs = true; + i = i || a.DOM; + f = f || new a.html.Schema(e); + e.entity_encoding = e.entity_encoding || "named"; + h = new a.util.Dispatcher(self); + b = new a.util.Dispatcher(self); + c = new a.html.DomParser(e, f); + c.addAttributeFilter("src,href,style", function(k, j) { + var o = k.length, + l, q, n = "data-mce-" + j, + p = e.url_converter, + r = e.url_converter_scope, + m; + while (o--) { + l = k[o]; + q = l.attributes.map[n]; + if (q !== m) { + l.attr(j, q.length > 0 ? q : null); + l.attr(n, null) + } else { + q = l.attributes.map[j]; + if (j === "style") { + q = i.serializeStyle(i.parseStyle(q), l.name) + } else { + if (p) { + q = p.call(r, q, j, l.name) + } + } + l.attr(j, q.length > 0 ? q : null) + } + } + }); + c.addAttributeFilter("class", function(j, k) { + var l = j.length, + m, n; + while (l--) { + m = j[l]; + n = m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g, ""); + m.attr("class", n.length > 0 ? n : null) + } + }); + c.addAttributeFilter("data-mce-type", function(j, l, k) { + var m = j.length, + n; + while (m--) { + n = j[m]; + if (n.attributes.map["data-mce-type"] === "bookmark" && !k.cleanup) { + n.remove() + } + } + }); + c.addNodeFilter("script,style", function(k, l) { + var m = k.length, + n, o; + + function j(p) { + return p.replace(/()/g, "\n").replace(/^[\r\n]*|[\r\n]*$/g, "").replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, "") + } + while (m--) { + n = k[m]; + o = n.firstChild ? n.firstChild.value : ""; + if (l === "script") { + n.attr("type", (n.attr("type") || "text/javascript").replace(/^mce\-/, "")); + if (o.length > 0) { + n.firstChild.value = "// " + } + } else { + if (o.length > 0) { + n.firstChild.value = "" + } + } + } + }); + c.addNodeFilter("#comment", function(j, k) { + var l = j.length, + m; + while (l--) { + m = j[l]; + if (m.value.indexOf("[CDATA[") === 0) { + m.name = "#cdata"; + m.type = 4; + m.value = m.value.replace(/^\[CDATA\[|\]\]$/g, "") + } else { + if (m.value.indexOf("mce:protected ") === 0) { + m.name = "#text"; + m.type = 3; + m.raw = true; + m.value = unescape(m.value).substr(14) + } + } + } + }); + c.addNodeFilter("xml:namespace,input", function(j, k) { + var l = j.length, + m; + while (l--) { + m = j[l]; + if (m.type === 7) { + m.remove() + } else { + if (m.type === 1) { + if (k === "input" && !("type" in m.attributes.map)) { + m.attr("type", "text") + } + } + } + } + }); + if (e.fix_list_elements) { + c.addNodeFilter("ul,ol", function(k, l) { + var m = k.length, + n, j; + while (m--) { + n = k[m]; + j = n.parent; + if (j.name === "ul" || j.name === "ol") { + if (n.prev && n.prev.name === "li") { + n.prev.append(n) + } + } + } + }) + } + c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style", function(j, k) { + var l = j.length; + while (l--) { + j[l].attr(k, null) + } + }); + return { + schema: f, + addNodeFilter: c.addNodeFilter, + addAttributeFilter: c.addAttributeFilter, + onPreProcess: h, + onPostProcess: b, + serialize: function(o, m) { + var l, p, k, j, n; + if (d && i.select("script,style,select").length > 0) { + n = o.innerHTML; + o = o.cloneNode(false); + i.setHTML(o, n) + } else { + o = o.cloneNode(true) + } + l = o.ownerDocument.implementation; + if (l.createHTMLDocument) { + p = l.createHTMLDocument(""); + g(o.nodeName == "BODY" ? o.childNodes : [o], function(q) { + p.body.appendChild(p.importNode(q, true)) + }); + if (o.nodeName != "BODY") { + o = p.body.firstChild + } else { + o = p.body + } + k = i.doc; + i.doc = p + } + m = m || {}; + m.format = m.format || "html"; + if (!m.no_events) { + m.node = o; + h.dispatch(self, m) + } + j = new a.html.Serializer(e, f); + m.content = j.serialize(c.parse(m.getInner ? o.innerHTML : a.trim(i.getOuterHTML(o), m), m)); + if (!m.no_events) { + b.dispatch(self, m) + } + if (k) { + i.doc = k + } + m.node = null; + return m.content + }, + addRules: function(j) { + f.addValidElements(j) + }, + setRules: function(j) { + f.setValidElements(j) + } + } + } +})(tinymce); +(function(a) { + a.dom.ScriptLoader = function(h) { + var c = 0, + k = 1, + i = 2, + l = {}, + j = [], + f = {}, + d = [], + g = 0, + e; + + function b(m, v) { + var x = this, + q = a.DOM, + s, o, r, n; + + function p() { + q.remove(n); + if (s) { + s.onreadystatechange = s.onload = s = null + } + v() + } + function u() { + if (typeof(console) !== "undefined" && console.log) { + console.log("Failed to load: " + m) + } + } + n = q.uniqueId(); + if (a.isIE6) { + o = new a.util.URI(m); + r = location; + if (o.host == r.hostname && o.port == r.port && (o.protocol + ":") == r.protocol && o.protocol.toLowerCase() != "file") { + a.util.XHR.send({ + url: a._addVer(o.getURI()), + success: function(y) { + var t = q.create("script", { + type: "text/javascript" + }); + t.text = y; + document.getElementsByTagName("head")[0].appendChild(t); + q.remove(t); + p() + }, + error: u + }); + return + } + } + s = q.create("script", { + id: n, + type: "text/javascript", + src: a._addVer(m) + }); + if (!a.isIE) { + s.onload = p + } + s.onerror = u; + if (!a.isOpera) { + s.onreadystatechange = function() { + var t = s.readyState; + if (t == "complete" || t == "loaded") { + p() + } + } + }(document.getElementsByTagName("head")[0] || document.body).appendChild(s) + } + this.isDone = function(m) { + return l[m] == i + }; + this.markDone = function(m) { + l[m] = i + }; + this.add = this.load = function(m, q, n) { + var o, p = l[m]; + if (p == e) { + j.push(m); + l[m] = c + } + if (q) { + if (!f[m]) { + f[m] = [] + } + f[m].push({ + func: q, + scope: n || this + }) + } + }; + this.loadQueue = function(n, m) { + this.loadScripts(j, n, m) + }; + this.loadScripts = function(m, q, p) { + var o; + + function n(r) { + a.each(f[r], function(s) { + s.func.call(s.scope) + }); + f[r] = e + } + d.push({ + func: q, + scope: p || this + }); + o = function() { + var r = a.grep(m); + m.length = 0; + a.each(r, function(s) { + if (l[s] == i) { + n(s); + return + } + if (l[s] != k) { + l[s] = k; + g++; + b(s, function() { + l[s] = i; + g--; + n(s); + o() + }) + } + }); + if (!g) { + a.each(d, function(s) { + s.func.call(s.scope) + }); + d.length = 0 + } + }; + o() + } + }; + a.ScriptLoader = new a.dom.ScriptLoader() +})(tinymce); +tinymce.dom.TreeWalker = function(a, c) { + var b = a; + + function d(i, f, e, j) { + var h, g; + if (i) { + if (!j && i[f]) { + return i[f] + } + if (i != c) { + h = i[e]; + if (h) { + return h + } + for (g = i.parentNode; g && g != c; g = g.parentNode) { + h = g[e]; + if (h) { + return h + } + } + } + } + } + this.current = function() { + return b + }; + this.next = function(e) { + return (b = d(b, "firstChild", "nextSibling", e)) + }; + this.prev = function(e) { + return (b = d(b, "lastChild", "previousSibling", e)) + } +}; +(function(a) { + a.dom.RangeUtils = function(c) { + var b = "\uFEFF"; + this.walk = function(d, r) { + var h = d.startContainer, + k = d.startOffset, + s = d.endContainer, + l = d.endOffset, + i, f, n, g, q, p, e; + e = c.select("td.mceSelected,th.mceSelected"); + if (e.length > 0) { + a.each(e, function(t) { + r([t]) + }); + return + } + function o(v, u, t) { + var x = []; + for (; v && v != t; v = v[u]) { + x.push(v) + } + return x + } + function m(u, t) { + do { + if (u.parentNode == t) { + return u + } + u = u.parentNode + } while (u) + } + function j(v, u, x) { + var t = x ? "nextSibling" : "previousSibling"; + for (g = v, q = g.parentNode; g && g != u; g = q) { + q = g.parentNode; + p = o(g == v ? g : g[t], t); + if (p.length) { + if (!x) { + p.reverse() + } + r(p) + } + } + } + if (h.nodeType == 1 && h.hasChildNodes()) { + h = h.childNodes[k] + } + if (s.nodeType == 1 && s.hasChildNodes()) { + s = s.childNodes[Math.min(l - 1, s.childNodes.length - 1)] + } + i = c.findCommonAncestor(h, s); + if (h == s) { + return r([h]) + } + for (g = h; g; g = g.parentNode) { + if (g == s) { + return j(h, i, true) + } + if (g == i) { + break + } + } + for (g = s; g; g = g.parentNode) { + if (g == h) { + return j(s, i) + } + if (g == i) { + break + } + } + f = m(h, i) || h; + n = m(s, i) || s; + j(h, f, true); + p = o(f == h ? f : f.nextSibling, "nextSibling", n == s ? n.nextSibling : n); + if (p.length) { + r(p) + } + j(s, n) + } + }; + a.dom.RangeUtils.compareRanges = function(c, b) { + if (c && b) { + if (c.item || c.duplicate) { + if (c.item && b.item && c.item(0) === b.item(0)) { + return true + } + if (c.isEqual && b.isEqual && b.isEqual(c)) { + return true + } + } else { + return c.startContainer == b.startContainer && c.startOffset == b.startOffset + } + } + return false + } +})(tinymce); +(function(b) { + var a = b.dom.Event, + c = b.each; + b.create("tinymce.ui.KeyboardNavigation", { + KeyboardNavigation: function(e, f) { + var p = this, + m = e.root, + l = e.items, + n = e.enableUpDown, + i = e.enableLeftRight || !e.enableUpDown, + k = e.excludeFromTabOrder, + j, h, o, d, g; + f = f || b.DOM; + j = function(q) { + g = q.target.id + }; + h = function(q) { + f.setAttrib(q.target.id, "tabindex", "-1") + }; + d = function(q) { + var r = f.get(g); + f.setAttrib(r, "tabindex", "0"); + r.focus() + }; + p.focus = function() { + f.get(g).focus() + }; + p.destroy = function() { + c(l, function(q) { + f.unbind(f.get(q.id), "focus", j); + f.unbind(f.get(q.id), "blur", h) + }); + f.unbind(f.get(m), "focus", d); + f.unbind(f.get(m), "keydown", o); + l = f = m = p.focus = j = h = o = d = null; + p.destroy = function() {} + }; + p.moveFocus = function(u, r) { + var q = -1, + t = p.controls, + s; + if (!g) { + return + } + c(l, function(x, v) { + if (x.id === g) { + q = v; + return false + } + }); + q += u; + if (q < 0) { + q = l.length - 1 + } else { + if (q >= l.length) { + q = 0 + } + } + s = l[q]; + f.setAttrib(g, "tabindex", "-1"); + f.setAttrib(s.id, "tabindex", "0"); + f.get(s.id).focus(); + if (e.actOnFocus) { + e.onAction(s.id) + } + if (r) { + a.cancel(r) + } + }; + o = function(y) { + var u = 37, + t = 39, + x = 38, + z = 40, + q = 27, + s = 14, + r = 13, + v = 32; + switch (y.keyCode) { + case u: + if (i) { + p.moveFocus(-1) + } + break; + case t: + if (i) { + p.moveFocus(1) + } + break; + case x: + if (n) { + p.moveFocus(-1) + } + break; + case z: + if (n) { + p.moveFocus(1) + } + break; + case q: + if (e.onCancel) { + e.onCancel(); + a.cancel(y) + } + break; + case s: + case r: + case v: + if (e.onAction) { + e.onAction(g); + a.cancel(y) + } + break + } + }; + c(l, function(s, q) { + var r; + if (!s.id) { + s.id = f.uniqueId("_mce_item_") + } + if (k) { + f.bind(s.id, "blur", h); + r = "-1" + } else { + r = (q === 0 ? "0" : "-1") + } + f.setAttrib(s.id, "tabindex", r); + f.bind(f.get(s.id), "focus", j) + }); + if (l[0]) { + g = l[0].id + } + f.setAttrib(m, "tabindex", "-1"); + f.bind(f.get(m), "focus", d); + f.bind(f.get(m), "keydown", o) + } + }) +})(tinymce); +(function(c) { + var b = c.DOM, + a = c.is; + c.create("tinymce.ui.Control", { + Control: function(f, e, d) { + this.id = f; + this.settings = e = e || {}; + this.rendered = false; + this.onRender = new c.util.Dispatcher(this); + this.classPrefix = ""; + this.scope = e.scope || this; + this.disabled = 0; + this.active = 0; + this.editor = d + }, + setAriaProperty: function(f, e) { + var d = b.get(this.id + "_aria") || b.get(this.id); + if (d) { + b.setAttrib(d, "aria-" + f, !! e) + } + }, + focus: function() { + b.get(this.id).focus() + }, + setDisabled: function(d) { + if (d != this.disabled) { + this.setAriaProperty("disabled", d); + this.setState("Disabled", d); + this.setState("Enabled", !d); + this.disabled = d + } + }, + isDisabled: function() { + return this.disabled + }, + setActive: function(d) { + if (d != this.active) { + this.setState("Active", d); + this.active = d; + this.setAriaProperty("pressed", d) + } + }, + isActive: function() { + return this.active + }, + setState: function(f, d) { + var e = b.get(this.id); + f = this.classPrefix + f; + if (d) { + b.addClass(e, f) + } else { + b.removeClass(e, f) + } + }, + isRendered: function() { + return this.rendered + }, + renderHTML: function() {}, + renderTo: function(d) { + b.setHTML(d, this.renderHTML()) + }, + postRender: function() { + var e = this, + d; + if (a(e.disabled)) { + d = e.disabled; + e.disabled = -1; + e.setDisabled(d) + } + if (a(e.active)) { + d = e.active; + e.active = -1; + e.setActive(d) + } + }, + remove: function() { + b.remove(this.id); + this.destroy() + }, + destroy: function() { + c.dom.Event.clear(this.id) + } + }) +})(tinymce); +tinymce.create("tinymce.ui.Container:tinymce.ui.Control", { + Container: function(c, b, a) { + this.parent(c, b, a); + this.controls = []; + this.lookup = {} + }, + add: function(a) { + this.lookup[a.id] = a; + this.controls.push(a); + return a + }, + get: function(a) { + return this.lookup[a] + } +}); +tinymce.create("tinymce.ui.Separator:tinymce.ui.Control", { + Separator: function(b, a) { + this.parent(b, a); + this.classPrefix = "mceSeparator"; + this.setDisabled(true) + }, + renderHTML: function() { + return tinymce.DOM.createHTML("span", { + "class": this.classPrefix, + role: "separator", + "aria-orientation": "vertical", + tabindex: "-1" + }) + } +}); +(function(d) { + var c = d.is, + b = d.DOM, + e = d.each, + a = d.walk; + d.create("tinymce.ui.MenuItem:tinymce.ui.Control", { + MenuItem: function(g, f) { + this.parent(g, f); + this.classPrefix = "mceMenuItem" + }, + setSelected: function(f) { + this.setState("Selected", f); + this.setAriaProperty("checked", !! f); + this.selected = f + }, + isSelected: function() { + return this.selected + }, + postRender: function() { + var f = this; + f.parent(); + if (c(f.selected)) { + f.setSelected(f.selected) + } + } + }) +})(tinymce); +(function(d) { + var c = d.is, + b = d.DOM, + e = d.each, + a = d.walk; + d.create("tinymce.ui.Menu:tinymce.ui.MenuItem", { + Menu: function(h, g) { + var f = this; + f.parent(h, g); + f.items = {}; + f.collapsed = false; + f.menuCount = 0; + f.onAddItem = new d.util.Dispatcher(this) + }, + expand: function(g) { + var f = this; + if (g) { + a(f, function(h) { + if (h.expand) { + h.expand() + } + }, "items", f) + } + f.collapsed = false + }, + collapse: function(g) { + var f = this; + if (g) { + a(f, function(h) { + if (h.collapse) { + h.collapse() + } + }, "items", f) + } + f.collapsed = true + }, + isCollapsed: function() { + return this.collapsed + }, + add: function(f) { + if (!f.settings) { + f = new d.ui.MenuItem(f.id || b.uniqueId(), f) + } + this.onAddItem.dispatch(this, f); + return this.items[f.id] = f + }, + addSeparator: function() { + return this.add({ + separator: true + }) + }, + addMenu: function(f) { + if (!f.collapse) { + f = this.createMenu(f) + } + this.menuCount++; + return this.add(f) + }, + hasMenus: function() { + return this.menuCount !== 0 + }, + remove: function(f) { + delete this.items[f.id] + }, + removeAll: function() { + var f = this; + a(f, function(g) { + if (g.removeAll) { + g.removeAll() + } else { + g.remove() + } + g.destroy() + }, "items", f); + f.items = {} + }, + createMenu: function(g) { + var f = new d.ui.Menu(g.id || b.uniqueId(), g); + f.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); + return f + } + }) +})(tinymce); +(function(e) { + var d = e.is, + c = e.DOM, + f = e.each, + a = e.dom.Event, + b = e.dom.Element; + e.create("tinymce.ui.DropMenu:tinymce.ui.Menu", { + DropMenu: function(h, g) { + g = g || {}; + g.container = g.container || c.doc.body; + g.offset_x = g.offset_x || 0; + g.offset_y = g.offset_y || 0; + g.vp_offset_x = g.vp_offset_x || 0; + g.vp_offset_y = g.vp_offset_y || 0; + if (d(g.icons) && !g.icons) { + g["class"] += " mceNoIcons" + } + this.parent(h, g); + this.onShowMenu = new e.util.Dispatcher(this); + this.onHideMenu = new e.util.Dispatcher(this); + this.classPrefix = "mceMenu" + }, + createMenu: function(j) { + var h = this, + i = h.settings, + g; + j.container = j.container || i.container; + j.parent = h; + j.constrain = j.constrain || i.constrain; + j["class"] = j["class"] || i["class"]; + j.vp_offset_x = j.vp_offset_x || i.vp_offset_x; + j.vp_offset_y = j.vp_offset_y || i.vp_offset_y; + j.keyboard_focus = i.keyboard_focus; + g = new e.ui.DropMenu(j.id || c.uniqueId(), j); + g.onAddItem.add(h.onAddItem.dispatch, h.onAddItem); + return g + }, + focus: function() { + var g = this; + if (g.keyboardNav) { + g.keyboardNav.focus() + } + }, + update: function() { + var i = this, + j = i.settings, + g = c.get("menu_" + i.id + "_tbl"), + l = c.get("menu_" + i.id + "_co"), + h, k; + h = j.max_width ? Math.min(g.clientWidth, j.max_width) : g.clientWidth; + k = j.max_height ? Math.min(g.clientHeight, j.max_height) : g.clientHeight; + if (!c.boxModel) { + i.element.setStyles({ + width: h + 2, + height: k + 2 + }) + } else { + i.element.setStyles({ + width: h, + height: k + }) + } + if (j.max_width) { + c.setStyle(l, "width", h) + } + if (j.max_height) { + c.setStyle(l, "height", k); + if (g.clientHeight < j.max_height) { + c.setStyle(l, "overflow", "hidden") + } + } + }, + showMenu: function(p, n, r) { + var z = this, + A = z.settings, + o, g = c.getViewPort(), + u, l, v, q, i = 2, + k, j, m = z.classPrefix; + z.collapse(1); + if (z.isMenuVisible) { + return + } + if (!z.rendered) { + o = c.add(z.settings.container, z.renderNode()); + f(z.items, function(h) { + h.postRender() + }); + z.element = new b("menu_" + z.id, { + blocker: 1, + container: A.container + }) + } else { + o = c.get("menu_" + z.id) + } + if (!e.isOpera) { + c.setStyles(o, { + left: -65535, + top: -65535 + }) + } + c.show(o); + z.update(); + p += A.offset_x || 0; + n += A.offset_y || 0; + g.w -= 4; + g.h -= 4; + if (A.constrain) { + u = o.clientWidth - i; + l = o.clientHeight - i; + v = g.x + g.w; + q = g.y + g.h; + if ((p + A.vp_offset_x + u) > v) { + p = r ? r - u : Math.max(0, (v - A.vp_offset_x) - u) + } + if ((n + A.vp_offset_y + l) > q) { + n = Math.max(0, (q - A.vp_offset_y) - l) + } + } + c.setStyles(o, { + left: p, + top: n + }); + z.element.update(); + z.isMenuVisible = 1; + z.mouseClickFunc = a.add(o, "click", function(s) { + var h; + s = s.target; + if (s && (s = c.getParent(s, "tr")) && !c.hasClass(s, m + "ItemSub")) { + h = z.items[s.id]; + if (h.isDisabled()) { + return + } + k = z; + while (k) { + if (k.hideMenu) { + k.hideMenu() + } + k = k.settings.parent + } + if (h.settings.onclick) { + h.settings.onclick(s) + } + return a.cancel(s) + } + }); + if (z.hasMenus()) { + z.mouseOverFunc = a.add(o, "mouseover", function(x) { + var h, t, s; + x = x.target; + if (x && (x = c.getParent(x, "tr"))) { + h = z.items[x.id]; + if (z.lastMenu) { + z.lastMenu.collapse(1) + } + if (h.isDisabled()) { + return + } + if (x && c.hasClass(x, m + "ItemSub")) { + t = c.getRect(x); + h.showMenu((t.x + t.w - i), t.y - i, t.x); + z.lastMenu = h; + c.addClass(c.get(h.id).firstChild, m + "ItemActive") + } + } + }) + } + a.add(o, "keydown", z._keyHandler, z); + z.onShowMenu.dispatch(z); + if (A.keyboard_focus) { + z._setupKeyboardNav() + } + }, + hideMenu: function(j) { + var g = this, + i = c.get("menu_" + g.id), + h; + if (!g.isMenuVisible) { + return + } + if (g.keyboardNav) { + g.keyboardNav.destroy() + } + a.remove(i, "mouseover", g.mouseOverFunc); + a.remove(i, "click", g.mouseClickFunc); + a.remove(i, "keydown", g._keyHandler); + c.hide(i); + g.isMenuVisible = 0; + if (!j) { + g.collapse(1) + } + if (g.element) { + g.element.hide() + } + if (h = c.get(g.id)) { + c.removeClass(h.firstChild, g.classPrefix + "ItemActive") + } + g.onHideMenu.dispatch(g) + }, + add: function(i) { + var g = this, + h; + i = g.parent(i); + if (g.isRendered && (h = c.get("menu_" + g.id))) { + g._add(c.select("tbody", h)[0], i) + } + return i + }, + collapse: function(g) { + this.parent(g); + this.hideMenu(1) + }, + remove: function(g) { + c.remove(g.id); + this.destroy(); + return this.parent(g) + }, + destroy: function() { + var g = this, + h = c.get("menu_" + g.id); + if (g.keyboardNav) { + g.keyboardNav.destroy() + } + a.remove(h, "mouseover", g.mouseOverFunc); + a.remove(c.select("a", h), "focus", g.mouseOverFunc); + a.remove(h, "click", g.mouseClickFunc); + a.remove(h, "keydown", g._keyHandler); + if (g.element) { + g.element.remove() + } + c.remove(h) + }, + renderNode: function() { + var i = this, + j = i.settings, + l, h, k, g; + g = c.create("div", { + role: "listbox", + id: "menu_" + i.id, + "class": j["class"], + style: "position:absolute;left:0;top:0;z-index:200000;outline:0" + }); + if (i.settings.parent) { + c.setAttrib(g, "aria-parent", "menu_" + i.settings.parent.id) + } + k = c.add(g, "div", { + role: "presentation", + id: "menu_" + i.id + "_co", + "class": i.classPrefix + (j["class"] ? " " + j["class"] : "") + }); + i.element = new b("menu_" + i.id, { + blocker: 1, + container: j.container + }); + if (j.menu_line) { + c.add(k, "span", { + "class": i.classPrefix + "Line" + }) + } + l = c.add(k, "table", { + role: "presentation", + id: "menu_" + i.id + "_tbl", + border: 0, + cellPadding: 0, + cellSpacing: 0 + }); + h = c.add(l, "tbody"); + f(i.items, function(m) { + i._add(h, m) + }); + i.rendered = true; + return g + }, + _setupKeyboardNav: function() { + var i, h, g = this; + i = c.select("#menu_" + g.id)[0]; + h = c.select("a[role=option]", "menu_" + g.id); + h.splice(0, 0, i); + g.keyboardNav = new e.ui.KeyboardNavigation({ + root: "menu_" + g.id, + items: h, + onCancel: function() { + g.hideMenu() + }, + enableUpDown: true + }); + i.focus() + }, + _keyHandler: function(g) { + var h = this, + i; + switch (g.keyCode) { + case 37: + if (h.settings.parent) { + h.hideMenu(); + h.settings.parent.focus(); + a.cancel(g) + } + break; + case 39: + if (h.mouseOverFunc) { + h.mouseOverFunc(g) + } + break + } + }, + _add: function(j, h) { + var i, q = h.settings, + p, l, k, m = this.classPrefix, + g; + if (q.separator) { + l = c.add(j, "tr", { + id: h.id, + "class": m + "ItemSeparator" + }); + c.add(l, "td", { + "class": m + "ItemSeparator" + }); + if (i = l.previousSibling) { + c.addClass(i, "mceLast") + } + return + } + i = l = c.add(j, "tr", { + id: h.id, + "class": m + "Item " + m + "ItemEnabled" + }); + i = k = c.add(i, q.titleItem ? "th" : "td"); + i = p = c.add(i, "a", { + id: h.id + "_aria", + role: q.titleItem ? "presentation" : "option", + href: "javascript:;", + onclick: "return false;", + onmousedown: "return false;" + }); + if (q.parent) { + c.setAttrib(p, "aria-haspopup", "true"); + c.setAttrib(p, "aria-owns", "menu_" + h.id) + } + c.addClass(k, q["class"]); + g = c.add(i, "span", { + "class": "mceIcon" + (q.icon ? " mce_" + q.icon : "") + }); + if (q.icon_src) { + c.add(g, "img", { + src: q.icon_src + }) + } + i = c.add(i, q.element || "span", { + "class": "mceText", + title: h.settings.title + }, h.settings.title); + if (h.settings.style) { + c.setAttrib(i, "style", h.settings.style) + } + if (j.childNodes.length == 1) { + c.addClass(l, "mceFirst") + } + if ((i = l.previousSibling) && c.hasClass(i, m + "ItemSeparator")) { + c.addClass(l, "mceFirst") + } + if (h.collapse) { + c.addClass(l, m + "ItemSub") + } + if (i = l.previousSibling) { + c.removeClass(i, "mceLast") + } + c.addClass(l, "mceLast") + } + }) +})(tinymce); +(function(b) { + var a = b.DOM; + b.create("tinymce.ui.Button:tinymce.ui.Control", { + Button: function(e, d, c) { + this.parent(e, d, c); + this.classPrefix = "mceButton" + }, + renderHTML: function() { + var f = this.classPrefix, + e = this.settings, + d, c; + c = a.encode(e.label || ""); + d = ''; + if (e.image) { + d += '' + a.encode(e.title) + '' + c + } else { + d += '' + (c ? '' + c + "" : "") + } + d += '"; + d += ""; + return d + }, + postRender: function() { + var c = this, + d = c.settings; + b.dom.Event.add(c.id, "click", function(f) { + if (!c.isDisabled()) { + return d.onclick.call(d.scope, f) + } + }) + } + }) +})(tinymce); +(function(d) { + var c = d.DOM, + b = d.dom.Event, + e = d.each, + a = d.util.Dispatcher; + d.create("tinymce.ui.ListBox:tinymce.ui.Control", { + ListBox: function(i, h, f) { + var g = this; + g.parent(i, h, f); + g.items = []; + g.onChange = new a(g); + g.onPostRender = new a(g); + g.onAdd = new a(g); + g.onRenderMenu = new d.util.Dispatcher(this); + g.classPrefix = "mceListBox" + }, + select: function(h) { + var g = this, + j, i; + if (h == undefined) { + return g.selectByIndex(-1) + } + if (h && h.call) { + i = h + } else { + i = function(f) { + return f == h + } + } + if (h != g.selectedValue) { + e(g.items, function(k, f) { + if (i(k.value)) { + j = 1; + g.selectByIndex(f); + return false + } + }); + if (!j) { + g.selectByIndex(-1) + } + } + }, + selectByIndex: function(f) { + var g = this, + h, i; + if (f != g.selectedIndex) { + h = c.get(g.id + "_text"); + i = g.items[f]; + if (i) { + g.selectedValue = i.value; + g.selectedIndex = f; + c.setHTML(h, c.encode(i.title)); + c.removeClass(h, "mceTitle"); + c.setAttrib(g.id, "aria-valuenow", i.title) + } else { + c.setHTML(h, c.encode(g.settings.title)); + c.addClass(h, "mceTitle"); + g.selectedValue = g.selectedIndex = null; + c.setAttrib(g.id, "aria-valuenow", g.settings.title) + } + h = 0 + } + }, + add: function(i, f, h) { + var g = this; + h = h || {}; + h = d.extend(h, { + title: i, + value: f + }); + g.items.push(h); + g.onAdd.dispatch(g, h) + }, + getLength: function() { + return this.items.length + }, + renderHTML: function() { + var i = "", + f = this, + g = f.settings, + j = f.classPrefix; + i = ''; + i += ""; + i += ""; + i += ""; + return i + }, + showMenu: function() { + var g = this, + j, i, h = c.get(this.id), + f; + if (g.isDisabled() || g.items.length == 0) { + return + } + if (g.menu && g.menu.isMenuVisible) { + return g.hideMenu() + } + if (!g.isMenuRendered) { + g.renderMenu(); + g.isMenuRendered = true + } + j = c.getPos(this.settings.menu_container); + i = c.getPos(h); + f = g.menu; + f.settings.offset_x = i.x; + f.settings.offset_y = i.y; + f.settings.keyboard_focus = !d.isOpera; + if (g.oldID) { + f.items[g.oldID].setSelected(0) + } + e(g.items, function(k) { + if (k.value === g.selectedValue) { + f.items[k.id].setSelected(1); + g.oldID = k.id + } + }); + f.showMenu(0, h.clientHeight); + b.add(c.doc, "mousedown", g.hideMenu, g); + c.addClass(g.id, g.classPrefix + "Selected") + }, + hideMenu: function(g) { + var f = this; + if (f.menu && f.menu.isMenuVisible) { + c.removeClass(f.id, f.classPrefix + "Selected"); + if (g && g.type == "mousedown" && (g.target.id == f.id + "_text" || g.target.id == f.id + "_open")) { + return + } + if (!g || !c.getParent(g.target, ".mceMenu")) { + c.removeClass(f.id, f.classPrefix + "Selected"); + b.remove(c.doc, "mousedown", f.hideMenu, f); + f.menu.hideMenu() + } + } + }, + renderMenu: function() { + var g = this, + f; + f = g.settings.control_manager.createDropMenu(g.id + "_menu", { + menu_line: 1, + "class": g.classPrefix + "Menu mceNoIcons", + max_width: 150, + max_height: 150 + }); + f.onHideMenu.add(function() { + g.hideMenu(); + g.focus() + }); + f.add({ + title: g.settings.title, + "class": "mceMenuItemTitle", + onclick: function() { + if (g.settings.onselect("") !== false) { + g.select("") + } + } + }); + e(g.items, function(h) { + if (h.value === undefined) { + f.add({ + title: h.title, + "class": "mceMenuItemTitle", + onclick: function() { + if (g.settings.onselect("") !== false) { + g.select("") + } + } + }) + } else { + h.id = c.uniqueId(); + h.onclick = function() { + if (g.settings.onselect(h.value) !== false) { + g.select(h.value) + } + }; + f.add(h) + } + }); + g.onRenderMenu.dispatch(g, f); + g.menu = f + }, + postRender: function() { + var f = this, + g = f.classPrefix; + b.add(f.id, "click", f.showMenu, f); + b.add(f.id, "keydown", function(h) { + if (h.keyCode == 32) { + f.showMenu(h); + b.cancel(h) + } + }); + b.add(f.id, "focus", function() { + if (!f._focused) { + f.keyDownHandler = b.add(f.id, "keydown", function(h) { + if (h.keyCode == 40) { + f.showMenu(); + b.cancel(h) + } + }); + f.keyPressHandler = b.add(f.id, "keypress", function(i) { + var h; + if (i.keyCode == 13) { + h = f.selectedValue; + f.selectedValue = null; + b.cancel(i); + f.settings.onselect(h) + } + }) + } + f._focused = 1 + }); + b.add(f.id, "blur", function() { + b.remove(f.id, "keydown", f.keyDownHandler); + b.remove(f.id, "keypress", f.keyPressHandler); + f._focused = 0 + }); + if (d.isIE6 || !c.boxModel) { + b.add(f.id, "mouseover", function() { + if (!c.hasClass(f.id, g + "Disabled")) { + c.addClass(f.id, g + "Hover") + } + }); + b.add(f.id, "mouseout", function() { + if (!c.hasClass(f.id, g + "Disabled")) { + c.removeClass(f.id, g + "Hover") + } + }) + } + f.onPostRender.dispatch(f, c.get(f.id)) + }, + destroy: function() { + this.parent(); + b.clear(this.id + "_text"); + b.clear(this.id + "_open") + } + }) +})(tinymce); +(function(d) { + var c = d.DOM, + b = d.dom.Event, + e = d.each, + a = d.util.Dispatcher; + d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox", { + NativeListBox: function(g, f) { + this.parent(g, f); + this.classPrefix = "mceNativeListBox" + }, + setDisabled: function(f) { + c.get(this.id).disabled = f; + this.setAriaProperty("disabled", f) + }, + isDisabled: function() { + return c.get(this.id).disabled + }, + select: function(h) { + var g = this, + j, i; + if (h == undefined) { + return g.selectByIndex(-1) + } + if (h && h.call) { + i = h + } else { + i = function(f) { + return f == h + } + } + if (h != g.selectedValue) { + e(g.items, function(k, f) { + if (i(k.value)) { + j = 1; + g.selectByIndex(f); + return false + } + }); + if (!j) { + g.selectByIndex(-1) + } + } + }, + selectByIndex: function(f) { + c.get(this.id).selectedIndex = f + 1; + this.selectedValue = this.items[f] ? this.items[f].value : null + }, + add: function(j, g, f) { + var i, h = this; + f = f || {}; + f.value = g; + if (h.isRendered()) { + c.add(c.get(this.id), "option", f, j) + } + i = { + title: j, + value: g, + attribs: f + }; + h.items.push(i); + h.onAdd.dispatch(h, i) + }, + getLength: function() { + return this.items.length + }, + renderHTML: function() { + var g, f = this; + g = c.createHTML("option", { + value: "" + }, "-- " + f.settings.title + " --"); + e(f.items, function(h) { + g += c.createHTML("option", { + value: h.value + }, h.title) + }); + g = c.createHTML("select", { + id: f.id, + "class": "mceNativeListBox", + "aria-labelledby": f.id + "_aria" + }, g); + g += c.createHTML("span", { + id: f.id + "_aria", + style: "display: none" + }, f.settings.title); + return g + }, + postRender: function() { + var g = this, + h, i = true; + g.rendered = true; + + function f(k) { + var j = g.items[k.target.selectedIndex - 1]; + if (j && (j = j.value)) { + g.onChange.dispatch(g, j); + if (g.settings.onselect) { + g.settings.onselect(j) + } + } + } + b.add(g.id, "change", f); + b.add(g.id, "keydown", function(k) { + var j; + b.remove(g.id, "change", h); + i = false; + j = b.add(g.id, "blur", function() { + if (i) { + return + } + i = true; + b.add(g.id, "change", f); + b.remove(g.id, "blur", j) + }); + if (k.keyCode == 13 || k.keyCode == 32) { + f(k); + return b.cancel(k) + } + }); + g.onPostRender.dispatch(g, c.get(g.id)) + } + }) +})(tinymce); +(function(c) { + var b = c.DOM, + a = c.dom.Event, + d = c.each; + c.create("tinymce.ui.MenuButton:tinymce.ui.Button", { + MenuButton: function(g, f, e) { + this.parent(g, f, e); + this.onRenderMenu = new c.util.Dispatcher(this); + f.menu_container = f.menu_container || b.doc.body + }, + showMenu: function() { + var g = this, + j, i, h = b.get(g.id), + f; + if (g.isDisabled()) { + return + } + if (!g.isMenuRendered) { + g.renderMenu(); + g.isMenuRendered = true + } + if (g.isMenuVisible) { + return g.hideMenu() + } + j = b.getPos(g.settings.menu_container); + i = b.getPos(h); + f = g.menu; + f.settings.offset_x = i.x; + f.settings.offset_y = i.y; + f.settings.vp_offset_x = i.x; + f.settings.vp_offset_y = i.y; + f.settings.keyboard_focus = g._focused; + f.showMenu(0, h.clientHeight); + a.add(b.doc, "mousedown", g.hideMenu, g); + g.setState("Selected", 1); + g.isMenuVisible = 1 + }, + renderMenu: function() { + var f = this, + e; + e = f.settings.control_manager.createDropMenu(f.id + "_menu", { + menu_line: 1, + "class": this.classPrefix + "Menu", + icons: f.settings.icons + }); + e.onHideMenu.add(function() { + f.hideMenu(); + f.focus() + }); + f.onRenderMenu.dispatch(f, e); + f.menu = e + }, + hideMenu: function(g) { + var f = this; + if (g && g.type == "mousedown" && b.getParent(g.target, function(h) { + return h.id === f.id || h.id === f.id + "_open" + })) { + return + } + if (!g || !b.getParent(g.target, ".mceMenu")) { + f.setState("Selected", 0); + a.remove(b.doc, "mousedown", f.hideMenu, f); + if (f.menu) { + f.menu.hideMenu() + } + } + f.isMenuVisible = 0 + }, + postRender: function() { + var e = this, + f = e.settings; + a.add(e.id, "click", function() { + if (!e.isDisabled()) { + if (f.onclick) { + f.onclick(e.value) + } + e.showMenu() + } + }) + } + }) +})(tinymce); +(function(c) { + var b = c.DOM, + a = c.dom.Event, + d = c.each; + c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton", { + SplitButton: function(g, f, e) { + this.parent(g, f, e); + this.classPrefix = "mceSplitButton" + }, + renderHTML: function() { + var i, f = this, + g = f.settings, + e; + i = ""; + if (g.image) { + e = b.createHTML("img ", { + src: g.image, + role: "presentation", + "class": "mceAction " + g["class"] + }) + } else { + e = b.createHTML("span", { + "class": "mceAction " + g["class"] + }, "") + } + e += b.createHTML("span", { + "class": "mceVoiceLabel mceIconOnly", + id: f.id + "_voice", + style: "display:none;" + }, g.title); + i += "" + b.createHTML("a", { + role: "button", + id: f.id + "_action", + tabindex: "-1", + href: "javascript:;", + "class": "mceAction " + g["class"], + onclick: "return false;", + onmousedown: "return false;", + title: g.title + }, e) + ""; + e = b.createHTML("span", { + "class": "mceOpen " + g["class"] + }, ''); + i += "" + b.createHTML("a", { + role: "button", + id: f.id + "_open", + tabindex: "-1", + href: "javascript:;", + "class": "mceOpen " + g["class"], + onclick: "return false;", + onmousedown: "return false;", + title: g.title + }, e) + ""; + i += ""; + i = b.createHTML("table", { + id: f.id, + role: "presentation", + tabindex: "0", + "class": "mceSplitButton mceSplitButtonEnabled " + g["class"], + cellpadding: "0", + cellspacing: "0", + title: g.title + }, i); + return b.createHTML("span", { + role: "button", + "aria-labelledby": f.id + "_voice", + "aria-haspopup": "true" + }, i) + }, + postRender: function() { + var e = this, + g = e.settings, + f; + if (g.onclick) { + f = function(h) { + if (!e.isDisabled()) { + g.onclick(e.value); + a.cancel(h) + } + }; + a.add(e.id + "_action", "click", f); + a.add(e.id, ["click", "keydown"], function(h) { + var k = 32, + m = 14, + i = 13, + j = 38, + l = 40; + if ((h.keyCode === 32 || h.keyCode === 13 || h.keyCode === 14) && !h.altKey && !h.ctrlKey && !h.metaKey) { + f(); + a.cancel(h) + } else { + if (h.type === "click" || h.keyCode === l) { + e.showMenu(); + a.cancel(h) + } + } + }) + } + a.add(e.id + "_open", "click", function(h) { + e.showMenu(); + a.cancel(h) + }); + a.add([e.id, e.id + "_open"], "focus", function() { + e._focused = 1 + }); + a.add([e.id, e.id + "_open"], "blur", function() { + e._focused = 0 + }); + if (c.isIE6 || !b.boxModel) { + a.add(e.id, "mouseover", function() { + if (!b.hasClass(e.id, "mceSplitButtonDisabled")) { + b.addClass(e.id, "mceSplitButtonHover") + } + }); + a.add(e.id, "mouseout", function() { + if (!b.hasClass(e.id, "mceSplitButtonDisabled")) { + b.removeClass(e.id, "mceSplitButtonHover") + } + }) + } + }, + destroy: function() { + this.parent(); + a.clear(this.id + "_action"); + a.clear(this.id + "_open"); + a.clear(this.id) + } + }) +})(tinymce); +(function(d) { + var c = d.DOM, + a = d.dom.Event, + b = d.is, + e = d.each; + d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton", { + ColorSplitButton: function(i, h, f) { + var g = this; + g.parent(i, h, f); + g.settings = h = d.extend({ + colors: "000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF", + grid_width: 8, + default_color: "#888888" + }, g.settings); + g.onShowMenu = new d.util.Dispatcher(g); + g.onHideMenu = new d.util.Dispatcher(g); + g.value = h.default_color + }, + showMenu: function() { + var f = this, + g, j, i, h; + if (f.isDisabled()) { + return + } + if (!f.isMenuRendered) { + f.renderMenu(); + f.isMenuRendered = true + } + if (f.isMenuVisible) { + return f.hideMenu() + } + i = c.get(f.id); + c.show(f.id + "_menu"); + c.addClass(i, "mceSplitButtonSelected"); + h = c.getPos(i); + c.setStyles(f.id + "_menu", { + left: h.x, + top: h.y + i.clientHeight, + zIndex: 200000 + }); + i = 0; + a.add(c.doc, "mousedown", f.hideMenu, f); + f.onShowMenu.dispatch(f); + if (f._focused) { + f._keyHandler = a.add(f.id + "_menu", "keydown", function(k) { + if (k.keyCode == 27) { + f.hideMenu() + } + }); + c.select("a", f.id + "_menu")[0].focus() + } + f.isMenuVisible = 1 + }, + hideMenu: function(g) { + var f = this; + if (g && g.type == "mousedown" && c.getParent(g.target, function(h) { + return h.id === f.id + "_open" + })) { + return + } + if (!g || !c.getParent(g.target, ".mceSplitButtonMenu")) { + c.removeClass(f.id, "mceSplitButtonSelected"); + a.remove(c.doc, "mousedown", f.hideMenu, f); + a.remove(f.id + "_menu", "keydown", f._keyHandler); + c.hide(f.id + "_menu") + } + f.onHideMenu.dispatch(f); + f.isMenuVisible = 0; + f.editor.focus() + }, + renderMenu: function() { + var p = this, + h, k = 0, + q = p.settings, + g, j, l, o, f; + o = c.add(q.menu_container, "div", { + role: "listbox", + id: p.id + "_menu", + "class": q.menu_class + " " + q["class"], + style: "position:absolute;left:0;top:-1000px;" + }); + h = c.add(o, "div", { + "class": q["class"] + " mceSplitButtonMenu" + }); + c.add(h, "span", { + "class": "mceMenuLine" + }); + g = c.add(h, "table", { + role: "presentation", + "class": "mceColorSplitMenu" + }); + j = c.add(g, "tbody"); + k = 0; + e(b(q.colors, "array") ? q.colors : q.colors.split(","), function(i) { + i = i.replace(/^#/, ""); + if (!k--) { + l = c.add(j, "tr"); + k = q.grid_width - 1 + } + g = c.add(l, "td"); + g = c.add(g, "a", { + role: "option", + href: "javascript:;", + style: { + backgroundColor: "#" + i + }, + title: p.editor.getLang("colors." + i, i), + "data-mce-color": "#" + i + }); + if (p.editor.forcedHighContrastMode) { + g = c.add(g, "canvas", { + width: 16, + height: 16, + "aria-hidden": "true" + }); + if (g.getContext && (f = g.getContext("2d"))) { + f.fillStyle = "#" + i; + f.fillRect(0, 0, 16, 16) + } else { + c.remove(g) + } + } + }); + if (q.more_colors_func) { + g = c.add(j, "tr"); + g = c.add(g, "td", { + colspan: q.grid_width, + "class": "mceMoreColors" + }); + g = c.add(g, "a", { + role: "option", + id: p.id + "_more", + href: "javascript:;", + onclick: "return false;", + "class": "mceMoreColors" + }, q.more_colors_title); + a.add(g, "click", function(i) { + q.more_colors_func.call(q.more_colors_scope || this); + return a.cancel(i) + }) + } + c.addClass(h, "mceColorSplitMenu"); + new d.ui.KeyboardNavigation({ + root: p.id + "_menu", + items: c.select("a", p.id + "_menu"), + onCancel: function() { + p.hideMenu(); + p.focus() + } + }); + a.add(p.id + "_menu", "mousedown", function(i) { + return a.cancel(i) + }); + a.add(p.id + "_menu", "click", function(i) { + var m; + i = c.getParent(i.target, "a", j); + if (i && i.nodeName.toLowerCase() == "a" && (m = i.getAttribute("data-mce-color"))) { + p.setColor(m) + } + return a.cancel(i) + }); + return o + }, + setColor: function(f) { + this.displayColor(f); + this.hideMenu(); + this.settings.onselect(f) + }, + displayColor: function(g) { + var f = this; + c.setStyle(f.id + "_preview", "backgroundColor", g); + f.value = g + }, + postRender: function() { + var f = this, + g = f.id; + f.parent(); + c.add(g + "_action", "div", { + id: g + "_preview", + "class": "mceColorPreview" + }); + c.setStyle(f.id + "_preview", "backgroundColor", f.value) + }, + destroy: function() { + this.parent(); + a.clear(this.id + "_menu"); + a.clear(this.id + "_more"); + c.remove(this.id + "_menu") + } + }) +})(tinymce); +(function(b) { + var d = b.DOM, + c = b.each, + a = b.dom.Event; + b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container", { + renderHTML: function() { + var f = this, + i = [], + e = f.controls, + j = b.each, + g = f.settings; + i.push('
        '); + i.push(""); + i.push('"); + j(e, function(h) { + i.push(h.renderHTML()) + }); + i.push(""); + i.push("
        "); + return i.join("") + }, + focus: function() { + this.keyNav.focus() + }, + postRender: function() { + var f = this, + e = []; + c(f.controls, function(g) { + c(g.controls, function(h) { + if (h.id) { + e.push(h) + } + }) + }); + f.keyNav = new b.ui.KeyboardNavigation({ + root: f.id, + items: e, + onCancel: function() { + f.editor.focus() + }, + excludeFromTabOrder: !f.settings.tab_focus_toolbar + }) + }, + destroy: function() { + var e = this; + e.parent(); + e.keyNav.destroy(); + a.clear(e.id) + } + }) +})(tinymce); +(function(a) { + var c = a.DOM, + b = a.each; + a.create("tinymce.ui.Toolbar:tinymce.ui.Container", { + renderHTML: function() { + var m = this, + f = "", + j, k, n = m.settings, + e, d, g, l; + l = m.controls; + for (e = 0; e < l.length; e++) { + k = l[e]; + d = l[e - 1]; + g = l[e + 1]; + if (e === 0) { + j = "mceToolbarStart"; + if (k.Button) { + j += " mceToolbarStartButton" + } else { + if (k.SplitButton) { + j += " mceToolbarStartSplitButton" + } else { + if (k.ListBox) { + j += " mceToolbarStartListBox" + } + } + } + f += c.createHTML("td", { + "class": j + }, c.createHTML("span", null, "")) + } + if (d && k.ListBox) { + if (d.Button || d.SplitButton) { + f += c.createHTML("td", { + "class": "mceToolbarEnd" + }, c.createHTML("span", null, "")) + } + } + if (c.stdMode) { + f += '' + k.renderHTML() + "" + } else { + f += "" + k.renderHTML() + "" + } + if (g && k.ListBox) { + if (g.Button || g.SplitButton) { + f += c.createHTML("td", { + "class": "mceToolbarStart" + }, c.createHTML("span", null, "")) + } + } + } + j = "mceToolbarEnd"; + if (k.Button) { + j += " mceToolbarEndButton" + } else { + if (k.SplitButton) { + j += " mceToolbarEndSplitButton" + } else { + if (k.ListBox) { + j += " mceToolbarEndListBox" + } + } + } + f += c.createHTML("td", { + "class": j + }, c.createHTML("span", null, "")); + return c.createHTML("table", { + id: m.id, + "class": "mceToolbar" + (n["class"] ? " " + n["class"] : ""), + cellpadding: "0", + cellspacing: "0", + align: m.settings.align || "", + role: "presentation", + tabindex: "-1" + }, "" + f + "") + } + }) +})(tinymce); +(function(b) { + var a = b.util.Dispatcher, + c = b.each; + b.create("tinymce.AddOnManager", { + AddOnManager: function() { + var d = this; + d.items = []; + d.urls = {}; + d.lookup = {}; + d.onAdd = new a(d) + }, + get: function(d) { + return this.lookup[d] + }, + requireLangPack: function(e) { + var d = b.settings; + if (d && d.language && d.language_load !== false) { + b.ScriptLoader.add(this.urls[e] + "/langs/" + d.language + ".js") + } + }, + add: function(e, d) { + this.items.push(d); + this.lookup[e] = d; + this.onAdd.dispatch(this, e, d); + return d + }, + load: function(h, e, d, g) { + var f = this; + if (f.urls[h]) { + return + } + if (e.indexOf("/") != 0 && e.indexOf("://") == -1) { + e = b.baseURL + "/" + e + } + f.urls[h] = e.substring(0, e.lastIndexOf("/")); + if (!f.lookup[h]) { + b.ScriptLoader.add(e, d, g) + } + } + }); + b.PluginManager = new b.AddOnManager(); + b.ThemeManager = new b.AddOnManager() +}(tinymce)); +(function(j) { + var g = j.each, + d = j.extend, + k = j.DOM, + i = j.dom.Event, + f = j.ThemeManager, + b = j.PluginManager, + e = j.explode, + h = j.util.Dispatcher, + a, c = 0; + j.documentBaseURL = window.location.href.replace(/[\?#].*$/, "").replace(/[\/\\][^\/]+$/, ""); + if (!/[\/\\]$/.test(j.documentBaseURL)) { + j.documentBaseURL += "/" + } + j.baseURL = new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL); + j.baseURI = new j.util.URI(j.baseURL); + j.onBeforeUnload = new h(j); + i.add(window, "beforeunload", function(l) { + j.onBeforeUnload.dispatch(j, l) + }); + j.onAddEditor = new h(j); + j.onRemoveEditor = new h(j); + j.EditorManager = d(j, { + editors: [], + i18n: {}, + activeEditor: null, + init: function(q) { + var n = this, + p, l = j.ScriptLoader, + u, o = [], + m; + + function r(x, y, t) { + var v = x[y]; + if (!v) { + return + } + if (j.is(v, "string")) { + t = v.replace(/\.\w+$/, ""); + t = t ? j.resolve(t) : 0; + v = j.resolve(v) + } + return v.apply(t || this, Array.prototype.slice.call(arguments, 2)) + } + q = d({ + theme: "simple", + language: "en" + }, q); + n.settings = q; + i.add(document, "init", function() { + var s, v; + r(q, "onpageload"); + switch (q.mode) { + case "exact": + s = q.elements || ""; + if (s.length > 0) { + g(e(s), function(x) { + if (k.get(x)) { + m = new j.Editor(x, q); + o.push(m); + m.render(1) + } else { + g(document.forms, function(y) { + g(y.elements, function(z) { + if (z.name === x) { + x = "mce_editor_" + c++; + k.setAttrib(z, "id", x); + m = new j.Editor(x, q); + o.push(m); + m.render(1) + } + }) + }) + } + }) + } + break; + case "textareas": + case "specific_textareas": + + + function t(y, x) { + return x.constructor === RegExp ? x.test(y.className) : k.hasClass(y, x) + } + g(k.select("textarea"), function(x) { + if (q.editor_deselector && t(x, q.editor_deselector)) { + return + } + if (!q.editor_selector || t(x, q.editor_selector)) { + u = k.get(x.name); + if (!x.id && !u) { + x.id = x.name + } + if (!x.id || n.get(x.id)) { + x.id = k.uniqueId() + } + m = new j.Editor(x.id, q); + o.push(m); + m.render(1) + } + }); + break + } + if (q.oninit) { + s = v = 0; + g(o, function(x) { + v++; + if (!x.initialized) { + x.onInit.add(function() { + s++; + if (s == v) { + r(q, "oninit") + } + }) + } else { + s++ + } + if (s == v) { + r(q, "oninit") + } + }) + } + }) + }, + get: function(l) { + if (l === a) { + return this.editors + } + return this.editors[l] + }, + getInstanceById: function(l) { + return this.get(l) + }, + add: function(m) { + var l = this, + n = l.editors; + n[m.id] = m; + n.push(m); + l._setActive(m); + l.onAddEditor.dispatch(l, m); + return m + }, + remove: function(n) { + var m = this, + l, o = m.editors; + if (!o[n.id]) { + return null + } + delete o[n.id]; + for (l = 0; l < o.length; l++) { + if (o[l] == n) { + o.splice(l, 1); + break + } + } + if (m.activeEditor == n) { + m._setActive(o[0]) + } + n.destroy(); + m.onRemoveEditor.dispatch(m, n); + return n + }, + execCommand: function(r, p, o) { + var q = this, + n = q.get(o), + l; + switch (r) { + case "mceFocus": + n.focus(); + return true; + case "mceAddEditor": + case "mceAddControl": + if (!q.get(o)) { + new j.Editor(o, q.settings).render() + } + return true; + case "mceAddFrameControl": + l = o.window; + l.tinyMCE = tinyMCE; + l.tinymce = j; + j.DOM.doc = l.document; + j.DOM.win = l; + n = new j.Editor(o.element_id, o); + n.render(); + if (j.isIE) { + function m() { + n.destroy(); + l.detachEvent("onunload", m); + l = l.tinyMCE = l.tinymce = null + } + l.attachEvent("onunload", m) + } + o.page_window = null; + return true; + case "mceRemoveEditor": + case "mceRemoveControl": + if (n) { + n.remove() + } + return true; + case "mceToggleEditor": + if (!n) { + q.execCommand("mceAddControl", 0, o); + return true + } + if (n.isHidden()) { + n.show() + } else { + n.hide() + } + return true + } + if (q.activeEditor) { + return q.activeEditor.execCommand(r, p, o) + } + return false + }, + execInstanceCommand: function(p, o, n, m) { + var l = this.get(p); + if (l) { + return l.execCommand(o, n, m) + } + return false + }, + triggerSave: function() { + g(this.editors, function(l) { + l.save() + }) + }, + addI18n: function(n, q) { + var l, m = this.i18n; + if (!j.is(n, "string")) { + g(n, function(r, p) { + g(r, function(t, s) { + g(t, function(v, u) { + if (s === "common") { + m[p + "." + u] = v + } else { + m[p + "." + s + "." + u] = v + } + }) + }) + }) + } else { + g(q, function(r, p) { + m[n + "." + p] = r + }) + } + }, + _setActive: function(l) { + this.selectedInstance = this.activeEditor = l + } + }) +})(tinymce); +(function(m) { + var n = m.DOM, + j = m.dom.Event, + f = m.extend, + k = m.util.Dispatcher, + i = m.each, + a = m.isGecko, + b = m.isIE, + e = m.isWebKit, + d = m.is, + h = m.ThemeManager, + c = m.PluginManager, + o = m.inArray, + l = m.grep, + g = m.explode; + m.create("tinymce.Editor", { + Editor: function(r, q) { + var p = this; + p.id = p.editorId = r; + p.execCommands = {}; + p.queryStateCommands = {}; + p.queryValueCommands = {}; + p.isNotDirty = false; + p.plugins = {}; + i(["onPreInit", "onBeforeRenderUI", "onPostRender", "onInit", "onRemove", "onActivate", "onDeactivate", "onClick", "onEvent", "onMouseUp", "onMouseDown", "onDblClick", "onKeyDown", "onKeyUp", "onKeyPress", "onContextMenu", "onSubmit", "onReset", "onPaste", "onPreProcess", "onPostProcess", "onBeforeSetContent", "onBeforeGetContent", "onSetContent", "onGetContent", "onLoadContent", "onSaveContent", "onNodeChange", "onChange", "onBeforeExecCommand", "onExecCommand", "onUndo", "onRedo", "onVisualAid", "onSetProgressState"], function(s) { + p[s] = new k(p) + }); + p.settings = q = f({ + id: r, + language: "en", + docs_language: "en", + theme: "simple", + skin: "default", + delta_width: 0, + delta_height: 0, + popup_css: "", + plugins: "", + document_base_url: m.documentBaseURL, + add_form_submit_trigger: 1, + submit_patch: 1, + add_unload_trigger: 1, + convert_urls: 1, + relative_urls: 1, + remove_script_host: 1, + table_inline_editing: 0, + object_resizing: 1, + cleanup: 1, + accessibility_focus: 1, + custom_shortcuts: 1, + custom_undo_redo_keyboard_shortcuts: 1, + custom_undo_redo_restore_selection: 1, + custom_undo_redo: 1, + doctype: m.isIE6 ? '' : "", + visual_table_class: "mceItemTable", + visual: 1, + font_size_style_values: "xx-small,x-small,small,medium,large,x-large,xx-large", + apply_source_formatting: 1, + directionality: "ltr", + forced_root_block: "p", + hidden_input: 1, + padd_empty_editor: 1, + render_ui: 1, + init_theme: 1, + force_p_newlines: 1, + indentation: "30px", + keep_styles: 1, + fix_table_elements: 1, + inline_styles: 1, + convert_fonts_to_spans: true, + indent: "simple", + indent_before: "p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr", + indent_after: "p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr", + validate: true, + entity_encoding: "named", + url_converter: p.convertURL, + url_converter_scope: p, + ie7_compat: true + }, q); + p.documentBaseURI = new m.util.URI(q.document_base_url || m.documentBaseURL, { + base_uri: tinyMCE.baseURI + }); + p.baseURI = m.baseURI; + p.contentCSS = []; + p.execCallback("setup", p) + }, + render: function(r) { + var u = this, + v = u.settings, + x = u.id, + p = m.ScriptLoader; + if (!j.domLoaded) { + j.add(document, "init", function() { + u.render() + }); + return + } + tinyMCE.settings = v; + if (!u.getElement()) { + return + } + if (m.isIDevice) { + return + } + if (!/TEXTAREA|INPUT/i.test(u.getElement().nodeName) && v.hidden_input && n.getParent(x, "form")) { + n.insertAfter(n.create("input", { + type: "hidden", + name: x + }), x) + } + if (m.WindowManager) { + u.windowManager = new m.WindowManager(u) + } + if (v.encoding == "xml") { + u.onGetContent.add(function(s, t) { + if (t.save) { + t.content = n.encode(t.content) + } + }) + } + if (v.add_form_submit_trigger) { + u.onSubmit.addToTop(function() { + if (u.initialized) { + u.save(); + u.isNotDirty = 1 + } + }) + } + if (v.add_unload_trigger) { + u._beforeUnload = tinyMCE.onBeforeUnload.add(function() { + if (u.initialized && !u.destroyed && !u.isHidden()) { + u.save({ + format: "raw", + no_events: true + }) + } + }) + } + m.addUnload(u.destroy, u); + if (v.submit_patch) { + u.onBeforeRenderUI.add(function() { + var s = u.getElement().form; + if (!s) { + return + } + if (s._mceOldSubmit) { + return + } + if (!s.submit.nodeType && !s.submit.length) { + u.formElement = s; + s._mceOldSubmit = s.submit; + s.submit = function() { + m.triggerSave(); + u.isNotDirty = 1; + return u.formElement._mceOldSubmit(u.formElement) + } + } + s = null + }) + } + function q() { + if (v.language && v.language_load !== false) { + p.add(m.baseURL + "/langs/" + v.language + ".js") + } + if (v.theme && v.theme.charAt(0) != "-" && !h.urls[v.theme]) { + h.load(v.theme, "themes/" + v.theme + "/editor_template" + m.suffix + ".js") + } + i(g(v.plugins), function(s) { + if (s && s.charAt(0) != "-" && !c.urls[s]) { + if (s == "safari") { + return + } + c.load(s, "plugins/" + s + "/editor_plugin" + m.suffix + ".js") + } + }); + p.loadQueue(function() { + if (!u.removed) { + u.init() + } + }) + } + q() + }, + init: function() { + var r, F = this, + G = F.settings, + C, z, B = F.getElement(), + q, p, D, x, A, E, y; + m.add(F); + G.aria_label = G.aria_label || n.getAttrib(B, "aria-label", F.getLang("aria.rich_text_area")); + if (G.theme) { + G.theme = G.theme.replace(/-/, ""); + q = h.get(G.theme); + F.theme = new q(); + if (F.theme.init && G.init_theme) { + F.theme.init(F, h.urls[G.theme] || m.documentBaseURL.replace(/\/$/, "")) + } + } + i(g(G.plugins.replace(/\-/g, "")), function(H) { + var I = c.get(H), + t = c.urls[H] || m.documentBaseURL.replace(/\/$/, ""), + s; + if (I) { + s = new I(F, t); + F.plugins[H] = s; + if (s.init) { + s.init(F, t) + } + } + }); + if (G.popup_css !== false) { + if (G.popup_css) { + G.popup_css = F.documentBaseURI.toAbsolute(G.popup_css) + } else { + G.popup_css = F.baseURI.toAbsolute("themes/" + G.theme + "/skins/" + G.skin + "/dialog.css") + } + } + if (G.popup_css_add) { + G.popup_css += "," + F.documentBaseURI.toAbsolute(G.popup_css_add) + } + F.controlManager = new m.ControlManager(F); + if (G.custom_undo_redo) { + F.onBeforeExecCommand.add(function(t, H, u, I, s) { + if (H != "Undo" && H != "Redo" && H != "mceRepaint" && (!s || !s.skip_undo)) { + F.undoManager.beforeChange() + } + }); + F.onExecCommand.add(function(t, H, u, I, s) { + if (H != "Undo" && H != "Redo" && H != "mceRepaint" && (!s || !s.skip_undo)) { + F.undoManager.add() + } + }) + } + F.onExecCommand.add(function(s, t) { + if (!/^(FontName|FontSize)$/.test(t)) { + F.nodeChanged() + } + }); + if (a) { + function v(s, t) { + if (!t || !t.initial) { + F.execCommand("mceRepaint") + } + } + F.onUndo.add(v); + F.onRedo.add(v); + F.onSetContent.add(v) + } + F.onBeforeRenderUI.dispatch(F, F.controlManager); + if (G.render_ui) { + C = G.width || B.style.width || B.offsetWidth; + z = G.height || B.style.height || B.offsetHeight; + F.orgDisplay = B.style.display; + E = /^[0-9\.]+(|px)$/i; + if (E.test("" + C)) { + C = Math.max(parseInt(C) + (q.deltaWidth || 0), 100) + } + if (E.test("" + z)) { + z = Math.max(parseInt(z) + (q.deltaHeight || 0), 100) + } + q = F.theme.renderUI({ + targetNode: B, + width: C, + height: z, + deltaWidth: G.delta_width, + deltaHeight: G.delta_height + }); + F.editorContainer = q.editorContainer + } + if (document.domain && location.hostname != document.domain) { + m.relaxedDomain = document.domain + } + n.setStyles(q.sizeContainer || q.editorContainer, { + width: C, + height: z + }); + if (G.content_css) { + m.each(g(G.content_css), function(s) { + F.contentCSS.push(F.documentBaseURI.toAbsolute(s)) + }) + } + z = (q.iframeHeight || z) + (typeof(z) == "number" ? (q.deltaHeight || 0) : ""); + if (z < 100) { + z = 100 + } + F.iframeHTML = G.doctype + ''; + if (G.document_base_url != m.documentBaseURL) { + F.iframeHTML += '' + } + if (G.ie7_compat) { + F.iframeHTML += '' + } else { + F.iframeHTML += '' + } + F.iframeHTML += ''; + if (!a || !/Firefox\/2/.test(navigator.userAgent)) { + for (y = 0; y < F.contentCSS.length; y++) { + F.iframeHTML += '' + } + F.contentCSS = [] + } + x = G.body_id || "tinymce"; + if (x.indexOf("=") != -1) { + x = F.getParam("body_id", "", "hash"); + x = x[F.id] || x + } + A = G.body_class || ""; + if (A.indexOf("=") != -1) { + A = F.getParam("body_class", "", "hash"); + A = A[F.id] || "" + } + F.iframeHTML += ''; + if (m.relaxedDomain && (b || (m.isOpera && parseFloat(opera.version()) < 11))) { + D = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + F.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()' + } + r = n.add(q.iframeContainer, "iframe", { + id: F.id + "_ifr", + src: D || 'javascript:""', + frameBorder: "0", + title: G.aria_label, + style: { + width: "100%", + height: z + } + }); + F.contentAreaContainer = q.iframeContainer; + n.get(q.editorContainer).style.display = F.orgDisplay; + n.get(F.id).style.display = "none"; + n.setAttrib(F.id, "aria-hidden", true); + if (!m.relaxedDomain || !D) { + F.setupIframe() + } + B = r = q = null + }, + setupIframe: function() { + var r = this, + x = r.settings, + y = n.get(r.id), + z = r.getDoc(), + v, p; + if (!b || !m.relaxedDomain) { + z.open(); + z.write(r.iframeHTML); + z.close(); + if (m.relaxedDomain) { + z.domain = m.relaxedDomain + } + } + if (!b) { + try { + if (!x.readonly) { + z.designMode = "On" + } + } catch (q) {} + } + if (b) { + p = r.getBody(); + n.hide(p); + if (!x.readonly) { + p.contentEditable = true + } + n.show(p) + } + r.schema = new m.html.Schema(x); + r.dom = new m.dom.DOMUtils(r.getDoc(), { + keep_values: true, + url_converter: r.convertURL, + url_converter_scope: r, + hex_colors: x.force_hex_style_colors, + class_filter: x.class_filter, + update_styles: 1, + fix_ie_paragraphs: 1, + schema: r.schema + }); + r.parser = new m.html.DomParser(x, r.schema); + r.parser.addAttributeFilter("name", function(s, t) { + var B = s.length, + D, A, C, E; + while (B--) { + E = s[B]; + if (E.name === "a" && E.firstChild) { + C = E.parent; + D = E.lastChild; + do { + A = D.prev; + C.insert(D, E); + D = A + } while (D) + } + } + }); + r.parser.addAttributeFilter("src,href,style", function(s, t) { + var A = s.length, + B, D = r.dom, + C; + while (A--) { + B = s[A]; + C = B.attr(t); + if (t === "style") { + B.attr("data-mce-style", D.serializeStyle(D.parseStyle(C), B.name)) + } else { + B.attr("data-mce-" + t, r.convertURL(C, t, B.name)) + } + } + }); + r.parser.addNodeFilter("script", function(s, t) { + var A = s.length; + while (A--) { + s[A].attr("type", "mce-text/javascript") + } + }); + r.parser.addNodeFilter("#cdata", function(s, t) { + var A = s.length, + B; + while (A--) { + B = s[A]; + B.type = 8; + B.name = "#comment"; + B.value = "[CDATA[" + B.value + "]]" + } + }); + r.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div", function(t, A) { + var B = t.length, + C, s = r.schema.getNonEmptyElements(); + while (B--) { + C = t[B]; + if (C.isEmpty(s)) { + C.empty().append(new m.html.Node("br", 1)).shortEnded = true + } + } + }); + r.serializer = new m.dom.Serializer(x, r.dom, r.schema); + r.selection = new m.dom.Selection(r.dom, r.getWin(), r.serializer); + r.formatter = new m.Formatter(this); + r.formatter.register({ + alignleft: [{ + selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", + styles: { + textAlign: "left" + } + }, + { + selector: "img,table", + collapsed: false, + styles: { + "float": "left" + } + }], + aligncenter: [{ + selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", + styles: { + textAlign: "center" + } + }, + { + selector: "img", + collapsed: false, + styles: { + display: "block", + marginLeft: "auto", + marginRight: "auto" + } + }, + { + selector: "table", + collapsed: false, + styles: { + marginLeft: "auto", + marginRight: "auto" + } + }], + alignright: [{ + selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", + styles: { + textAlign: "right" + } + }, + { + selector: "img,table", + collapsed: false, + styles: { + "float": "right" + } + }], + alignfull: [{ + selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", + styles: { + textAlign: "justify" + } + }], + bold: [{ + inline: "strong", + remove: "all" + }, + { + inline: "span", + styles: { + fontWeight: "bold" + } + }, + { + inline: "b", + remove: "all" + }], + italic: [{ + inline: "em", + remove: "all" + }, + { + inline: "span", + styles: { + fontStyle: "italic" + } + }, + { + inline: "i", + remove: "all" + }], + underline: [{ + inline: "span", + styles: { + textDecoration: "underline" + }, + exact: true + }, + { + inline: "u", + remove: "all" + }], + strikethrough: [{ + inline: "span", + styles: { + textDecoration: "line-through" + }, + exact: true + }, + { + inline: "strike", + remove: "all" + }], + forecolor: { + inline: "span", + styles: { + color: "%value" + }, + wrap_links: false + }, + hilitecolor: { + inline: "span", + styles: { + backgroundColor: "%value" + }, + wrap_links: false + }, + fontname: { + inline: "span", + styles: { + fontFamily: "%value" + } + }, + fontsize: { + inline: "span", + styles: { + fontSize: "%value" + } + }, + fontsize_class: { + inline: "span", + attributes: { + "class": "%value" + } + }, + blockquote: { + block: "blockquote", + wrapper: 1, + remove: "all" + }, + subscript: { + inline: "sub" + }, + superscript: { + inline: "sup" + }, + removeformat: [{ + selector: "b,strong,em,i,font,u,strike", + remove: "all", + split: true, + expand: false, + block_expand: true, + deep: true + }, + { + selector: "span", + attributes: ["style", "class"], + remove: "empty", + split: true, + expand: false, + deep: true + }, + { + selector: "*", + attributes: ["style", "class"], + split: false, + expand: false, + deep: true + }] + }); + i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/), function(s) { + r.formatter.register(s, { + block: s, + remove: "all" + }) + }); + r.formatter.register(r.settings.formats); + r.undoManager = new m.UndoManager(r); + r.undoManager.onAdd.add(function(t, s) { + if (t.hasUndo()) { + return r.onChange.dispatch(r, s, t) + } + }); + r.undoManager.onUndo.add(function(t, s) { + return r.onUndo.dispatch(r, s, t) + }); + r.undoManager.onRedo.add(function(t, s) { + return r.onRedo.dispatch(r, s, t) + }); + r.forceBlocks = new m.ForceBlocks(r, { + forced_root_block: x.forced_root_block + }); + r.editorCommands = new m.EditorCommands(r); + r.serializer.onPreProcess.add(function(s, t) { + return r.onPreProcess.dispatch(r, t, s) + }); + r.serializer.onPostProcess.add(function(s, t) { + return r.onPostProcess.dispatch(r, t, s) + }); + r.onPreInit.dispatch(r); + if (!x.gecko_spellcheck) { + r.getBody().spellcheck = 0 + } + if (!x.readonly) { + r._addEvents() + } + r.controlManager.onPostRender.dispatch(r, r.controlManager); + r.onPostRender.dispatch(r); + if (x.directionality) { + r.getBody().dir = x.directionality + } + if (x.nowrap) { + r.getBody().style.whiteSpace = "nowrap" + } + if (x.handle_node_change_callback) { + r.onNodeChange.add(function(t, s, A) { + r.execCallback("handle_node_change_callback", r.id, A, -1, -1, true, r.selection.isCollapsed()) + }) + } + if (x.save_callback) { + r.onSaveContent.add(function(s, A) { + var t = r.execCallback("save_callback", r.id, A.content, r.getBody()); + if (t) { + A.content = t + } + }) + } + if (x.onchange_callback) { + r.onChange.add(function(t, s) { + r.execCallback("onchange_callback", r, s) + }) + } + if (x.protect) { + r.onBeforeSetContent.add(function(s, t) { + if (x.protect) { + i(x.protect, function(A) { + t.content = t.content.replace(A, function(B) { + return "" + }) + }) + } + }) + } + if (x.convert_newlines_to_brs) { + r.onBeforeSetContent.add(function(s, t) { + if (t.initial) { + t.content = t.content.replace(/\r?\n/g, "
        ") + } + }) + } + if (x.preformatted) { + r.onPostProcess.add(function(s, t) { + t.content = t.content.replace(/^\s*/, ""); + t.content = t.content.replace(/<\/pre>\s*$/, ""); + if (t.set) { + t.content = '
        ' + t.content + "
        " + } + }) + } + if (x.verify_css_classes) { + r.serializer.attribValueFilter = function(C, A) { + var B, t; + if (C == "class") { + if (!r.classesRE) { + t = r.dom.getClasses(); + if (t.length > 0) { + B = ""; + i(t, function(s) { + B += (B ? "|" : "") + s["class"] + }); + r.classesRE = new RegExp("(" + B + ")", "gi") + } + } + return !r.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A) || r.classesRE.test(A) ? A : "" + } + return A + } + } + if (x.cleanup_callback) { + r.onBeforeSetContent.add(function(s, t) { + t.content = r.execCallback("cleanup_callback", "insert_to_editor", t.content, t) + }); + r.onPreProcess.add(function(s, t) { + if (t.set) { + r.execCallback("cleanup_callback", "insert_to_editor_dom", t.node, t) + } + if (t.get) { + r.execCallback("cleanup_callback", "get_from_editor_dom", t.node, t) + } + }); + r.onPostProcess.add(function(s, t) { + if (t.set) { + t.content = r.execCallback("cleanup_callback", "insert_to_editor", t.content, t) + } + if (t.get) { + t.content = r.execCallback("cleanup_callback", "get_from_editor", t.content, t) + } + }) + } + if (x.save_callback) { + r.onGetContent.add(function(s, t) { + if (t.save) { + t.content = r.execCallback("save_callback", r.id, t.content, r.getBody()) + } + }) + } + if (x.handle_event_callback) { + r.onEvent.add(function(s, t, A) { + if (r.execCallback("handle_event_callback", t, s, A) === false) { + j.cancel(t) + } + }) + } + r.onSetContent.add(function() { + r.addVisual(r.getBody()) + }); + if (x.padd_empty_editor) { + r.onPostProcess.add(function(s, t) { + t.content = t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
        [\r\n]*)$/, "") + }) + } + if (a) { + function u(s, t) { + i(s.dom.select("a"), function(B) { + var A = B.parentNode; + if (s.dom.isBlock(A) && A.lastChild === B) { + s.dom.add(A, "br", { + "data-mce-bogus": 1 + }) + } + }) + } + r.onExecCommand.add(function(s, t) { + if (t === "CreateLink") { + u(s) + } + }); + r.onSetContent.add(r.selection.onSetContent.add(u)); + if (!x.readonly) { + try { + z.designMode = "Off"; + z.designMode = "On" + } catch (q) {} + } + } + setTimeout(function() { + if (r.removed) { + return + } + r.load({ + initial: true, + format: "html" + }); + r.startContent = r.getContent({ + format: "raw" + }); + r.undoManager.add(); + r.initialized = true; + r.onInit.dispatch(r); + r.execCallback("setupcontent_callback", r.id, r.getBody(), r.getDoc()); + r.execCallback("init_instance_callback", r); + r.focus(true); + r.nodeChanged({ + initial: 1 + }); + i(r.contentCSS, function(s) { + r.dom.loadCSS(s) + }); + if (x.auto_focus) { + setTimeout(function() { + var s = m.get(x.auto_focus); + s.selection.select(s.getBody(), 1); + s.selection.collapse(1); + s.getWin().focus() + }, 100) + } + }, 1); + y = null + }, + focus: function(s) { + var x, q = this, + v = q.settings.content_editable, + r, p, u = q.getDoc(); + if (!s) { + r = q.selection.getRng(); + if (r.item) { + p = r.item(0) + } + if (!v) { + q.getWin().focus() + } + if (p && p.ownerDocument == u) { + r = u.body.createControlRange(); + r.addElement(p); + r.select() + } + } + if (m.activeEditor != q) { + if ((x = m.activeEditor) != null) { + x.onDeactivate.dispatch(x, q) + } + q.onActivate.dispatch(q, x) + } + m._setActive(q) + }, + execCallback: function(u) { + var p = this, + r = p.settings[u], q; + if (!r) { + return + } + if (p.callbackLookup && (q = p.callbackLookup[u])) { + r = q.func; + console.log(r); + q = q.scope + } + if (d(r, "string")) { + q = r.replace(/\.\w+$/, ""); + q = q ? m.resolve(q) : 0; + r = m.resolve(r); + p.callbackLookup = p.callbackLookup || {}; + p.callbackLookup[u] = { + func: r, + scope: q + } + } + return r.apply(q || p, Array.prototype.slice.call(arguments, 1)) + }, + translate: function(p) { + var r = this.settings.language || "en", + q = m.i18n; + if (!p) { + return "" + } + return q[r + "." + p] || p.replace(/{\#([^}]+)\}/g, function(t, s) { + return q[r + "." + s] || "{#" + s + "}" + }) + }, + getLang: function(q, p) { + return m.i18n[(this.settings.language || "en") + "." + q] || (d(p) ? p : "{#" + q + "}") + }, + getParam: function(u, r, p) { + var s = m.trim, + q = d(this.settings[u]) ? this.settings[u] : r, + t; + if (p === "hash") { + t = {}; + if (d(q, "string")) { + i(q.indexOf("=") > 0 ? q.split(/[;,](?![^=;,]*(?:[;,]|$))/) : q.split(","), function(x) { + x = x.split("="); + if (x.length > 1) { + t[s(x[0])] = s(x[1]) + } else { + t[s(x[0])] = s(x) + } + }) + } else { + t = q + } + return t + } + return q + }, + nodeChanged: function(r) { + var p = this, + q = p.selection, + u = q.getStart() || p.getBody(); + if (p.initialized) { + r = r || {}; + u = b && u.ownerDocument != p.getDoc() ? p.getBody() : u; + r.parents = []; + p.dom.getParent(u, function(s) { + if (s.nodeName == "BODY") { + return true + } + r.parents.push(s) + }); + p.onNodeChange.dispatch(p, r ? r.controlManager || p.controlManager : p.controlManager, u, q.isCollapsed(), r) + } + }, + addButton: function(r, q) { + var p = this; + p.buttons = p.buttons || {}; + p.buttons[r] = q + }, + addCommand: function(p, r, q) { + this.execCommands[p] = { + func: r, + scope: q || this + } + }, + addQueryStateHandler: function(p, r, q) { + this.queryStateCommands[p] = { + func: r, + scope: q || this + } + }, + addQueryValueHandler: function(p, r, q) { + this.queryValueCommands[p] = { + func: r, + scope: q || this + } + }, + addShortcut: function(r, u, p, s) { + var q = this, + v; + if (!q.settings.custom_shortcuts) { + return false + } + q.shortcuts = q.shortcuts || {}; + if (d(p, "string")) { + v = p; + p = function() { + q.execCommand(v, false, null) + } + } + if (d(p, "object")) { + v = p; + p = function() { + q.execCommand(v[0], v[1], v[2]) + } + } + i(g(r), function(t) { + var x = { + func: p, + scope: s || this, + desc: u, + alt: false, + ctrl: false, + shift: false + }; + i(g(t, "+"), function(y) { + switch (y) { + case "alt": + case "ctrl": + case "shift": + x[y] = true; + break; + default: + x.charCode = y.charCodeAt(0); + x.keyCode = y.toUpperCase().charCodeAt(0) + } + }); + q.shortcuts[(x.ctrl ? "ctrl" : "") + "," + (x.alt ? "alt" : "") + "," + (x.shift ? "shift" : "") + "," + x.keyCode] = x + }); + return true + }, + execCommand: function(x, v, z, p) { + var r = this, + u = 0, + y, q; + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x) && (!p || !p.skip_focus)) { + r.focus() + } + y = {}; + r.onBeforeExecCommand.dispatch(r, x, v, z, y); + if (y.terminate) { + return false + } + if (r.execCallback("execcommand_callback", r.id, r.selection.getNode(), x, v, z)) { + r.onExecCommand.dispatch(r, x, v, z, p); + return true + } + if (y = r.execCommands[x]) { + q = y.func.call(y.scope, v, z); + if (q !== true) { + r.onExecCommand.dispatch(r, x, v, z, p); + return q + } + } + i(r.plugins, function(s) { + if (s.execCommand && s.execCommand(x, v, z)) { + r.onExecCommand.dispatch(r, x, v, z, p); + u = 1; + return false + } + }); + if (u) { + return true + } + if (r.theme && r.theme.execCommand && r.theme.execCommand(x, v, z)) { + r.onExecCommand.dispatch(r, x, v, z, p); + return true + } + if (r.editorCommands.execCommand(x, v, z)) { + r.onExecCommand.dispatch(r, x, v, z, p); + return true + } + r.getDoc().execCommand(x, v, z); + r.onExecCommand.dispatch(r, x, v, z, p) + }, + queryCommandState: function(u) { + var q = this, + v, r; + if (q._isHidden()) { + return + } + if (v = q.queryStateCommands[u]) { + r = v.func.call(v.scope); + if (r !== true) { + return r + } + } + v = q.editorCommands.queryCommandState(u); + if (v !== -1) { + return v + } + try { + return this.getDoc().queryCommandState(u) + } catch (p) {} + }, + queryCommandValue: function(v) { + var q = this, + u, r; + if (q._isHidden()) { + return + } + if (u = q.queryValueCommands[v]) { + r = u.func.call(u.scope); + if (r !== true) { + return r + } + } + u = q.editorCommands.queryCommandValue(v); + if (d(u)) { + return u + } + try { + return this.getDoc().queryCommandValue(v) + } catch (p) {} + }, + show: function() { + var p = this; + n.show(p.getContainer()); + n.hide(p.id); + p.load() + }, + hide: function() { + var p = this, + q = p.getDoc(); + if (b && q) { + q.execCommand("SelectAll") + } + p.save(); + n.hide(p.getContainer()); + n.setStyle(p.id, "display", p.orgDisplay) + }, + isHidden: function() { + return !n.isHidden(this.id) + }, + setProgressState: function(p, q, r) { + this.onSetProgressState.dispatch(this, p, q, r); + return p + }, + load: function(s) { + var p = this, + r = p.getElement(), + q; + if (r) { + s = s || {}; + s.load = true; + q = p.setContent(d(r.value) ? r.value : r.innerHTML, s); + s.element = r; + if (!s.no_events) { + p.onLoadContent.dispatch(p, s) + } + s.element = r = null; + return q + } + }, + save: function(u) { + var p = this, + s = p.getElement(), + q, r; + if (!s || !p.initialized) { + return + } + u = u || {}; + u.save = true; + if (!u.no_events) { + p.undoManager.typing = false; + p.undoManager.add() + } + u.element = s; + q = u.content = p.getContent(u); + if (!u.no_events) { + p.onSaveContent.dispatch(p, u) + } + q = u.content; + if (!/TEXTAREA|INPUT/i.test(s.nodeName)) { + s.innerHTML = q; + if (r = n.getParent(p.id, "form")) { + i(r.elements, function(t) { + if (t.name == p.id) { + t.value = q; + return false + } + }) + } + } else { + s.value = q + } + u.element = s = null; + return q + }, + setContent: function(t, s) { + var r = this, + q, p = r.getBody(); + s = s || {}; + s.format = s.format || "html"; + s.set = true; + s.content = t; + if (!s.no_events) { + r.onBeforeSetContent.dispatch(r, s) + } + t = s.content; + if (!m.isIE && (t.length === 0 || /^\s+$/.test(t))) { + p.innerHTML = '
        '; + return + } + if (s.format !== "raw") { + t = new m.html.Serializer({}, r.schema).serialize(r.parser.parse(t)) + } + s.content = m.trim(t); + r.dom.setHTML(p, s.content); + if (!s.no_events) { + r.onSetContent.dispatch(r, s) + } + return s.content + }, + getContent: function(q) { + var p = this, + r; + q = q || {}; + q.format = q.format || "html"; + q.get = true; + if (!q.no_events) { + p.onBeforeGetContent.dispatch(p, q) + } + if (q.format == "raw") { + r = p.getBody().innerHTML + } else { + r = p.serializer.serialize(p.getBody(), q) + } + q.content = m.trim(r); + if (!q.no_events) { + p.onGetContent.dispatch(p, q) + } + return q.content + }, + isDirty: function() { + var p = this; + return m.trim(p.startContent) != m.trim(p.getContent({ + format: "raw", + no_events: 1 + })) && !p.isNotDirty + }, + getContainer: function() { + var p = this; + if (!p.container) { + p.container = n.get(p.editorContainer || p.id + "_parent") + } + return p.container + }, + getContentAreaContainer: function() { + return this.contentAreaContainer + }, + getElement: function() { + return n.get(this.settings.content_element || this.id) + }, + getWin: function() { + var p = this, + q; + if (!p.contentWindow) { + q = n.get(p.id + "_ifr"); + if (q) { + p.contentWindow = q.contentWindow + } + } + return p.contentWindow + }, + getDoc: function() { + var q = this, + p; + if (!q.contentDocument) { + p = q.getWin(); + if (p) { + q.contentDocument = p.document + } + } + return q.contentDocument + }, + getBody: function() { + return this.bodyElement || this.getDoc().body + }, + convertURL: function(p, x, v) { + var q = this, + r = q.settings; + if (r.urlconverter_callback) { + return q.execCallback("urlconverter_callback", p, v, true, x) + } + if (!r.convert_urls || (v && v.nodeName == "LINK") || p.indexOf("file:") === 0) { + return p + } + if (r.relative_urls) { + return q.documentBaseURI.toRelative(p) + } + p = q.documentBaseURI.toAbsolute(p, r.remove_script_host); + return p + }, + addVisual: function(r) { + var p = this, + q = p.settings; + r = r || p.getBody(); + if (!d(p.hasVisual)) { + p.hasVisual = q.visual + } + i(p.dom.select("table,a", r), function(t) { + var s; + switch (t.nodeName) { + case "TABLE": + s = p.dom.getAttrib(t, "border"); + if (!s || s == "0") { + if (p.hasVisual) { + p.dom.addClass(t, q.visual_table_class) + } else { + p.dom.removeClass(t, q.visual_table_class) + } + } + return; + case "A": + s = p.dom.getAttrib(t, "name"); + if (s) { + if (p.hasVisual) { + p.dom.addClass(t, "mceItemAnchor") + } else { + p.dom.removeClass(t, "mceItemAnchor") + } + } + return + } + }); + p.onVisualAid.dispatch(p, r, p.hasVisual) + }, + remove: function() { + var p = this, + q = p.getContainer(); + p.removed = 1; + p.hide(); + p.execCallback("remove_instance_callback", p); + p.onRemove.dispatch(p); + p.onExecCommand.listeners = []; + m.remove(p); + n.remove(q) + }, + destroy: function(q) { + var p = this; + if (p.destroyed) { + return + } + if (!q) { + m.removeUnload(p.destroy); + tinyMCE.onBeforeUnload.remove(p._beforeUnload); + if (p.theme && p.theme.destroy) { + p.theme.destroy() + } + p.controlManager.destroy(); + p.selection.destroy(); + p.dom.destroy(); + if (!p.settings.content_editable) { + j.clear(p.getWin()); + j.clear(p.getDoc()) + } + j.clear(p.getBody()); + j.clear(p.formElement) + } + if (p.formElement) { + p.formElement.submit = p.formElement._mceOldSubmit; + p.formElement._mceOldSubmit = null + } + p.contentAreaContainer = p.formElement = p.container = p.settings.content_element = p.bodyElement = p.contentDocument = p.contentWindow = null; + if (p.selection) { + p.selection = p.selection.win = p.selection.dom = p.selection.dom.doc = null + } + p.destroyed = 1 + }, + _addEvents: function() { + var B = this, + r, C = B.settings, + q = B.dom, + x = { + mouseup: "onMouseUp", + mousedown: "onMouseDown", + click: "onClick", + keyup: "onKeyUp", + keydown: "onKeyDown", + keypress: "onKeyPress", + submit: "onSubmit", + reset: "onReset", + contextmenu: "onContextMenu", + dblclick: "onDblClick", + paste: "onPaste" + }; + + function p(t, D) { + var s = t.type; + if (B.removed) { + return + } + if (B.onEvent.dispatch(B, t, D) !== false) { + B[x[t.fakeType || t.type]].dispatch(B, t, D) + } + } + i(x, function(t, s) { + switch (s) { + case "contextmenu": + q.bind(B.getDoc(), s, p); + break; + case "paste": + q.bind(B.getBody(), s, function(D) { + p(D) + }); + break; + case "submit": + case "reset": + q.bind(B.getElement().form || n.getParent(B.id, "form"), s, p); + break; + default: + q.bind(C.content_editable ? B.getBody() : B.getDoc(), s, p) + } + }); + q.bind(C.content_editable ? B.getBody() : (a ? B.getDoc() : B.getWin()), "focus", function(s) { + B.focus(true) + }); + if (m.isGecko) { + q.bind(B.getDoc(), "DOMNodeInserted", function(t) { + var s; + t = t.target; + if (t.nodeType === 1 && t.nodeName === "IMG" && (s = t.getAttribute("data-mce-src"))) { + t.src = B.documentBaseURI.toAbsolute(s) + } + }) + } + if (a) { + function u() { + var E = this, + G = E.getDoc(), + F = E.settings; + if (a && !F.readonly) { + if (E._isHidden()) { + try { + if (!F.content_editable) { + G.designMode = "On" + } + } catch (D) {} + } + try { + G.execCommand("styleWithCSS", 0, false) + } catch (D) { + if (!E._isHidden()) { + try { + G.execCommand("useCSS", 0, true) + } catch (D) {} + } + } + if (!F.table_inline_editing) { + try { + G.execCommand("enableInlineTableEditing", false, false) + } catch (D) {} + } + if (!F.object_resizing) { + try { + G.execCommand("enableObjectResizing", false, false) + } catch (D) {} + } + } + } + B.onBeforeExecCommand.add(u); + B.onMouseDown.add(u) + } + if (m.isWebKit) { + B.onClick.add(function(s, t) { + t = t.target; + if (t.nodeName == "IMG" || (t.nodeName == "A" && q.hasClass(t, "mceItemAnchor"))) { + B.selection.getSel().setBaseAndExtent(t, 0, t, 1); + B.nodeChanged() + } + }) + } + B.onMouseUp.add(B.nodeChanged); + B.onKeyUp.add(function(s, t) { + var D = t.keyCode; + if ((D >= 33 && D <= 36) || (D >= 37 && D <= 40) || D == 13 || D == 45 || D == 46 || D == 8 || (m.isMac && (D == 91 || D == 93)) || t.ctrlKey) { + B.nodeChanged() + } + }); + B.onReset.add(function() { + B.setContent(B.startContent, { + format: "raw" + }) + }); + if (C.custom_shortcuts) { + if (C.custom_undo_redo_keyboard_shortcuts) { + B.addShortcut("ctrl+z", B.getLang("undo_desc"), "Undo"); + B.addShortcut("ctrl+y", B.getLang("redo_desc"), "Redo") + } + B.addShortcut("ctrl+b", B.getLang("bold_desc"), "Bold"); + B.addShortcut("ctrl+i", B.getLang("italic_desc"), "Italic"); + B.addShortcut("ctrl+u", B.getLang("underline_desc"), "Underline"); + for (r = 1; r <= 6; r++) { + B.addShortcut("ctrl+" + r, "", ["FormatBlock", false, "h" + r]) + } + B.addShortcut("ctrl+7", "", ["FormatBlock", false, "

        "]); + B.addShortcut("ctrl+8", "", ["FormatBlock", false, "

        "]); + B.addShortcut("ctrl+9", "", ["FormatBlock", false, "
        "]); + + function v(t) { + var s = null; + if (!t.altKey && !t.ctrlKey && !t.metaKey) { + return s + } + i(B.shortcuts, function(D) { + if (m.isMac && D.ctrl != t.metaKey) { + return + } else { + if (!m.isMac && D.ctrl != t.ctrlKey) { + return + } + } + if (D.alt != t.altKey) { + return + } + if (D.shift != t.shiftKey) { + return + } + if (t.keyCode == D.keyCode || (t.charCode && t.charCode == D.charCode)) { + s = D; + return false + } + }); + return s + } + B.onKeyUp.add(function(s, t) { + var D = v(t); + if (D) { + return j.cancel(t) + } + }); + B.onKeyPress.add(function(s, t) { + var D = v(t); + if (D) { + return j.cancel(t) + } + }); + B.onKeyDown.add(function(s, t) { + var D = v(t); + if (D) { + D.func.call(D.scope); + return j.cancel(t) + } + }) + } + if (m.isIE) { + q.bind(B.getDoc(), "controlselect", function(D) { + var t = B.resizeInfo, + s; + D = D.target; + if (D.nodeName !== "IMG") { + return + } + if (t) { + q.unbind(t.node, t.ev, t.cb) + } + if (!q.hasClass(D, "mceItemNoResize")) { + ev = "resizeend"; + s = q.bind(D, ev, function(F) { + var E; + F = F.target; + if (E = q.getStyle(F, "width")) { + q.setAttrib(F, "width", E.replace(/[^0-9%]+/g, "")); + q.setStyle(F, "width", "") + } + if (E = q.getStyle(F, "height")) { + q.setAttrib(F, "height", E.replace(/[^0-9%]+/g, "")); + q.setStyle(F, "height", "") + } + }) + } else { + ev = "resizestart"; + s = q.bind(D, "resizestart", j.cancel, j) + } + t = B.resizeInfo = { + node: D, + ev: ev, + cb: s + } + }); + B.onKeyDown.add(function(s, D) { + var t; + switch (D.keyCode) { + case 8: + t = B.getDoc().selection; + if (t.createRange && t.createRange().item) { + s.dom.remove(t.createRange().item(0)); + return j.cancel(D) + } + } + }) + } + if (m.isOpera) { + B.onClick.add(function(s, t) { + j.prevent(t) + }) + } + if (C.custom_undo_redo) { + function y() { + B.undoManager.typing = false; + B.undoManager.add() + } + q.bind(B.getDoc(), "focusout", function(s) { + if (!B.removed && B.undoManager.typing) { + y() + } + }); + B.dom.bind(B.dom.getRoot(), "dragend", function(s) { + y() + }); + B.onKeyUp.add(function(t, F) { + var s, E, D; + if (b && F.keyCode == 8) { + s = B.selection.getRng(); + if (s.parentElement) { + E = s.parentElement(); + D = B.selection.getBookmark(); + E.innerHTML = E.innerHTML; + B.selection.moveToBookmark(D) + } + } + if ((F.keyCode >= 33 && F.keyCode <= 36) || (F.keyCode >= 37 && F.keyCode <= 40) || F.keyCode == 13 || F.keyCode == 45 || F.ctrlKey) { + y() + } + }); + B.onKeyDown.add(function(t, H) { + var s, F, E, G = H.keyCode; + if (b && G == 46) { + s = B.selection.getRng(); + if (s.parentElement) { + F = s.parentElement(); + if (!B.undoManager.typing) { + B.undoManager.beforeChange(); + B.undoManager.typing = true; + B.undoManager.add() + } + if (H.ctrlKey) { + s.moveEnd("word", 1); + s.select() + } + B.selection.getSel().clear(); + if (s.parentElement() == F) { + E = B.selection.getBookmark(); + try { + F.innerHTML = F.innerHTML + } catch (D) {} + B.selection.moveToBookmark(E) + } + H.preventDefault(); + return + } + } + if ((G >= 33 && G <= 36) || (G >= 37 && G <= 40) || G == 13 || G == 45) { + if (m.isIE && G == 13) { + B.undoManager.beforeChange() + } + if (B.undoManager.typing) { + y() + } + return + } + if ((G < 16 || G > 20) && G != 224 && G != 91 && !B.undoManager.typing) { + B.undoManager.beforeChange(); + B.undoManager.add(); + B.undoManager.typing = true + } + }); + B.onMouseDown.add(function() { + if (B.undoManager.typing) { + y() + } + }) + } + if (m.isGecko) { + function A() { + var s = B.dom.getAttribs(B.selection.getStart().cloneNode(false)); + return function() { + var t = B.selection.getStart(); + B.dom.removeAllAttribs(t); + i(s, function(D) { + t.setAttributeNode(D.cloneNode(true)) + }) + } + } + function z() { + var t = B.selection; + return !t.isCollapsed() && t.getStart() != t.getEnd() + } + B.onKeyPress.add(function(s, D) { + var t; + if ((D.keyCode == 8 || D.keyCode == 46) && z()) { + t = A(); + B.getDoc().execCommand("delete", false, null); + t(); + return j.cancel(D) + } + }); + B.dom.bind(B.getDoc(), "cut", function(t) { + var s; + if (z()) { + s = A(); + B.onKeyUp.addToTop(j.cancel, j); + setTimeout(function() { + s(); + B.onKeyUp.remove(j.cancel, j) + }, 0) + } + }) + } + }, + _isHidden: function() { + var p; + if (!a) { + return 0 + } + p = this.selection.getSel(); + return (!p || !p.rangeCount || p.rangeCount == 0) + } + }) +})(tinymce); +(function(c) { + var d = c.each, + e, a = true, + b = false; + c.EditorCommands = function(n) { + var l = n.dom, + p = n.selection, + j = { + state: {}, + exec: {}, + value: {} + }, + k = n.settings, + o; + + function q(y, x, v) { + var u; + y = y.toLowerCase(); + if (u = j.exec[y]) { + u(y, x, v); + return a + } + return b + } + function m(v) { + var u; + v = v.toLowerCase(); + if (u = j.state[v]) { + return u(v) + } + return -1 + } + function h(v) { + var u; + v = v.toLowerCase(); + if (u = j.value[v]) { + return u(v) + } + return b + } + function t(u, v) { + v = v || "exec"; + d(u, function(y, x) { + d(x.toLowerCase().split(","), function(z) { + j[v][z] = y + }) + }) + } + c.extend(this, { + execCommand: q, + queryCommandState: m, + queryCommandValue: h, + addCommands: t + }); + + function f(x, v, u) { + if (v === e) { + v = b + } + if (u === e) { + u = null + } + return n.getDoc().execCommand(x, v, u) + } + function s(u) { + return n.formatter.match(u) + } + function r(u, v) { + n.formatter.toggle(u, v ? { + value: v + } : e) + } + function i(u) { + o = p.getBookmark(u) + } + function g() { + p.moveToBookmark(o) + } + t({ + "mceResetDesignMode,mceBeginUndoLevel": function() {}, + "mceEndUndoLevel,mceAddUndoLevel": function() { + n.undoManager.add() + }, + "Cut,Copy,Paste": function(y) { + var x = n.getDoc(), + u; + try { + f(y) + } catch (v) { + u = a + } + if (u || !x.queryCommandSupported(y)) { + if (c.isGecko) { + n.windowManager.confirm(n.getLang("clipboard_msg"), function(z) { + if (z) { + open("http://www.mozilla.org/editor/midasdemo/securityprefs.html", "_blank") + } + }) + } else { + n.windowManager.alert(n.getLang("clipboard_no_support")) + } + } + }, + unlink: function(u) { + if (p.isCollapsed()) { + p.select(p.getNode()) + } + f(u); + p.collapse(b) + }, + "JustifyLeft,JustifyCenter,JustifyRight,JustifyFull": function(u) { + var v = u.substring(7); + d("left,center,right,full".split(","), function(x) { + if (v != x) { + n.formatter.remove("align" + x) + } + }); + r("align" + v); + q("mceRepaint") + }, + "InsertUnorderedList,InsertOrderedList": function(x) { + var u, v; + f(x); + u = l.getParent(p.getNode(), "ol,ul"); + if (u) { + v = u.parentNode; + if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)) { + i(); + l.split(v, u); + g() + } + } + }, + "Bold,Italic,Underline,Strikethrough,Superscript,Subscript": function(u) { + r(u) + }, + "ForeColor,HiliteColor,FontName": function(x, v, u) { + r(x, u) + }, + FontSize: function(y, x, v) { + var u, z; + if (v >= 1 && v <= 7) { + z = c.explode(k.font_size_style_values); + u = c.explode(k.font_size_classes); + if (u) { + v = u[v - 1] || v + } else { + v = z[v - 1] || v + } + } + r(y, v) + }, + RemoveFormat: function(u) { + n.formatter.remove(u) + }, + mceBlockQuote: function(u) { + r("blockquote") + }, + FormatBlock: function(x, v, u) { + return r(u || "p") + }, + mceCleanup: function() { + var u = p.getBookmark(); + n.setContent(n.getContent({ + cleanup: a + }), { + cleanup: a + }); + p.moveToBookmark(u) + }, + mceRemoveNode: function(y, x, v) { + var u = v || p.getNode(); + if (u != n.getBody()) { + i(); + n.dom.remove(u, a); + g() + } + }, + mceSelectNodeDepth: function(y, x, v) { + var u = 0; + l.getParent(p.getNode(), function(z) { + if (z.nodeType == 1 && u++ == v) { + p.select(z); + return b + } + }, n.getBody()) + }, + mceSelectNode: function(x, v, u) { + p.select(u) + }, + mceInsertContent: function(z, D, E) { + var C, u, x, F, y, u, A, G, B; + + function v(H, J) { + var I, K = new c.dom.TreeWalker(H, J); + while ((I = K.current())) { + if ((I.nodeType == 3 && c.trim(I.nodeValue).length) || I.nodeName == "BR" || I.nodeName == "IMG") { + return I + } + K.prev() + } + } + B = { + content: E, + format: "html" + }; + p.onBeforeSetContent.dispatch(p, B); + E = B.content; + if (E.indexOf("{$caret}") == -1) { + E += "{$caret}" + } + p.setContent('\uFEFF', { + no_events: false + }); + l.setOuterHTML("__mce", E.replace(/\{\$caret\}/, '\uFEFF')); + C = l.select("#__mce")[0]; + x = l.getRoot(); + if (C.previousSibling && l.isBlock(C.previousSibling) || C.parentNode == x) { + y = v(C.previousSibling, x); + if (y) { + if (y.nodeName == "BR") { + y.parentNode.insertBefore(C, y) + } else { + l.insertAfter(C, y) + } + } + } + while (C) { + if (C === x) { + l.setOuterHTML(F, new c.html.Serializer({}, n.schema).serialize(new c.html.DomParser({ + remove_trailing_brs: true + }, n.schema).parse(l.getOuterHTML(F)))); + break + } + F = C; + C = C.parentNode + } + C = l.select("#__mce")[0]; + if (C) { + y = v(C.previousSibling, x); + l.remove(C); + if (y) { + u = l.createRng(); + if (y.nodeType == 3) { + u.setStart(y, y.length); + u.setEnd(y, y.length) + } else { + if (y.nodeName == "BR") { + u.setStartBefore(y); + u.setEndBefore(y) + } else { + u.setStartAfter(y); + u.setEndAfter(y) + } + } + p.setRng(u); + if (!c.isIE) { + y = l.create("span", null, "\u00a0"); + u.insertNode(y); + A = l.getRect(y); + G = l.getViewPort(n.getWin()); + if ((A.y > G.y + G.h || A.y < G.y) || (A.x > G.x + G.w || A.x < G.x)) { + n.getBody().scrollLeft = A.x; + n.getBody().scrollTop = A.y + } + l.remove(y) + } + p.collapse(true) + } + } + p.onSetContent.dispatch(p, B); + n.addVisual() + }, + mceInsertRawHTML: function(x, v, u) { + p.setContent("tiny_mce_marker"); + n.setContent(n.getContent().replace(/tiny_mce_marker/g, function() { + return u + })) + }, + mceSetContent: function(x, v, u) { + n.setContent(u) + }, + "Indent,Outdent": function(y) { + var v, u, x; + v = k.indentation; + u = /[a-z%]+$/i.exec(v); + v = parseInt(v); + if (!m("InsertUnorderedList") && !m("InsertOrderedList")) { + d(p.getSelectedBlocks(), function(z) { + if (y == "outdent") { + x = Math.max(0, parseInt(z.style.paddingLeft || 0) - v); + l.setStyle(z, "paddingLeft", x ? x + u : "") + } else { + l.setStyle(z, "paddingLeft", (parseInt(z.style.paddingLeft || 0) + v) + u) + } + }) + } else { + f(y) + } + }, + mceRepaint: function() { + var v; + if (c.isGecko) { + try { + i(a); + if (p.getSel()) { + p.getSel().selectAllChildren(n.getBody()) + } + p.collapse(a); + g() + } catch (u) {} + } + }, + mceToggleFormat: function(x, v, u) { + n.formatter.toggle(u) + }, + InsertHorizontalRule: function() { + n.execCommand("mceInsertContent", false, "
        ") + }, + mceToggleVisualAid: function() { + n.hasVisual = !n.hasVisual; + n.addVisual() + }, + mceReplaceContent: function(x, v, u) { + n.execCommand("mceInsertContent", false, p.setContent(u.replace(/\{\$selection\}/g, p.getContent({ + format: "text" + })))) + }, + mceInsertLink: function(A, z, y) { + var x = l.getParent(p.getNode(), "a"), + v, u; + if (c.is(y, "string")) { + y = { + href: y + } + } + y.href = y.href.replace(" ", "%20"); + if (!x) { + if (c.isWebKit) { + v = l.getParent(p.getNode(), "img"); + if (v) { + u = v.style.cssFloat; + v.style.cssFloat = null + } + } + f("CreateLink", b, "javascript:mctmp(0);"); + if (u) { + v.style.cssFloat = u + } + d(l.select("a[href='javascript:mctmp(0);']"), function(B) { + l.setAttribs(B, y) + }) + } else { + if (y.href) { + l.setAttribs(x, y) + } else { + n.dom.remove(x, a) + } + } + }, + selectAll: function() { + var v = l.getRoot(), + u = l.createRng(); + u.setStart(v, 0); + u.setEnd(v, v.childNodes.length); + n.selection.setRng(u) + } + }); + t({ + "JustifyLeft,JustifyCenter,JustifyRight,JustifyFull": function(u) { + return s("align" + u.substring(7)) + }, + "Bold,Italic,Underline,Strikethrough,Superscript,Subscript": function(u) { + return s(u) + }, + mceBlockQuote: function() { + return s("blockquote") + }, + Outdent: function() { + var u; + if (k.inline_styles) { + if ((u = l.getParent(p.getStart(), l.isBlock)) && parseInt(u.style.paddingLeft) > 0) { + return a + } + if ((u = l.getParent(p.getEnd(), l.isBlock)) && parseInt(u.style.paddingLeft) > 0) { + return a + } + } + return m("InsertUnorderedList") || m("InsertOrderedList") || (!k.inline_styles && !! l.getParent(p.getNode(), "BLOCKQUOTE")) + }, + "InsertUnorderedList,InsertOrderedList": function(u) { + return l.getParent(p.getNode(), u == "insertunorderedlist" ? "UL" : "OL") + } + }, "state"); + t({ + "FontSize,FontName": function(x) { + var v = 0, + u; + if (u = l.getParent(p.getNode(), "span")) { + if (x == "fontsize") { + v = u.style.fontSize + } else { + v = u.style.fontFamily.replace(/, /g, ",").replace(/[\'\"]/g, "").toLowerCase() + } + } + return v + } + }, "value"); + if (k.custom_undo_redo) { + t({ + Undo: function() { + n.undoManager.undo() + }, + Redo: function() { + n.undoManager.redo() + } + }) + } + } +})(tinymce); +(function(b) { + var a = b.util.Dispatcher; + b.UndoManager = function(e) { + var c, d = 0, + g = []; + + function f() { + return b.trim(e.getContent({ + format: "raw", + no_events: 1 + })) + } + return c = { + typing: false, + onAdd: new a(c), + onUndo: new a(c), + onRedo: new a(c), + beforeChange: function() { + if (g[d]) { + g[d].beforeBookmark = e.selection.getBookmark(2, true) + } + }, + add: function(l) { + var h, j = e.settings, + k; + l = l || {}; + l.content = f(); + k = g[d]; + if (k && k.content == l.content) { + return null + } + if (j.custom_undo_redo_levels) { + if (g.length > j.custom_undo_redo_levels) { + for (h = 0; h < g.length - 1; h++) { + g[h] = g[h + 1] + } + g.length--; + d = g.length + } + } + l.bookmark = e.selection.getBookmark(2, true); + if (d < g.length - 1) { + g.length = d + 1 + } + g.push(l); + d = g.length - 1; + c.onAdd.dispatch(c, l); + e.isNotDirty = 0; + return l + }, + undo: function() { + var j, h; + if (c.typing) { + c.add(); + c.typing = false + } + if (d > 0) { + j = g[--d]; + e.setContent(j.content, { + format: "raw" + }); + e.selection.moveToBookmark(j.beforeBookmark); + c.onUndo.dispatch(c, j) + } + return j + }, + redo: function() { + var h; + if (d < g.length - 1) { + h = g[++d]; + e.setContent(h.content, { + format: "raw" + }); + e.selection.moveToBookmark(h.bookmark); + c.onRedo.dispatch(c, h) + } + return h + }, + clear: function() { + g = []; + d = 0; + c.typing = false + }, + hasUndo: function() { + return d > 0 || this.typing + }, + hasRedo: function() { + return d < g.length - 1 && !this.typing + } + } + } +})(tinymce); +(function(m) { + var k = m.dom.Event, + c = m.isIE, + a = m.isGecko, + b = m.isOpera, + j = m.each, + i = m.extend, + d = true, + h = false; + + function l(p) { + var q, o, n; + do { + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(p.nodeName)) { + if (q) { + o = p.cloneNode(false); + o.appendChild(q); + q = o + } else { + q = n = p.cloneNode(false) + } + q.removeAttribute("id") + } + } while (p = p.parentNode); + if (q) { + return { + wrapper: q, + inner: n + } + } + } + function g(o, p) { + var n = p.ownerDocument.createRange(); + n.setStart(o.endContainer, o.endOffset); + n.setEndAfter(p); + return n.cloneContents().textContent.length == 0 + } + function f(o) { + o = o.innerHTML; + o = o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, "-"); + o = o.replace(/<[^>]+>/g, ""); + return o.replace(/[ \u00a0\t\r\n]+/g, "") == "" + } + function e(p, r, n) { + var o, q; + if (f(n)) { + o = r.getParent(n, "ul,ol"); + if (!r.getParent(o.parentNode, "ul,ol")) { + r.split(o, n); + q = r.create("p", 0, '
        '); + r.replace(q, n); + p.select(q, 1) + } + return h + } + return d + } + m.create("tinymce.ForceBlocks", { + ForceBlocks: function(n) { + var o = this, + p = n.settings, + q; + o.editor = n; + o.dom = n.dom; + q = (p.forced_root_block || "p").toLowerCase(); + p.element = q.toUpperCase(); + n.onPreInit.add(o.setup, o); + if (p.forced_root_block) { + n.onInit.add(o.forceRoots, o); + n.onSetContent.add(o.forceRoots, o); + n.onBeforeGetContent.add(o.forceRoots, o); + n.onExecCommand.add(function(r, s) { + if (s == "mceInsertContent") { + o.forceRoots(); + r.nodeChanged() + } + }) + } + }, + setup: function() { + var o = this, + n = o.editor, + q = n.settings, + u = n.dom, + p = n.selection; + if (q.forced_root_block) { + n.onBeforeExecCommand.add(o.forceRoots, o); + n.onKeyUp.add(o.forceRoots, o); + n.onPreProcess.add(o.forceRoots, o) + } + if (q.force_br_newlines) { + if (c) { + n.onKeyPress.add(function(s, t) { + var v; + if (t.keyCode == 13 && p.getNode().nodeName != "LI") { + p.setContent('
        ', { + format: "raw" + }); + v = u.get("__"); + v.removeAttribute("id"); + p.select(v); + p.collapse(); + return k.cancel(t) + } + }) + } + } + if (q.force_p_newlines) { + if (!c) { + n.onKeyPress.add(function(s, t) { + if (t.keyCode == 13 && !t.shiftKey && !o.insertPara(t)) { + k.cancel(t) + } + }) + } else { + m.addUnload(function() { + o._previousFormats = 0 + }); + n.onKeyPress.add(function(s, t) { + o._previousFormats = 0; + if (t.keyCode == 13 && !t.shiftKey && s.selection.isCollapsed() && q.keep_styles) { + o._previousFormats = l(s.selection.getStart()) + } + }); + n.onKeyUp.add(function(t, x) { + if (x.keyCode == 13 && !x.shiftKey) { + var v = t.selection.getStart(), + s = o._previousFormats; + if (!v.hasChildNodes() && s) { + v = u.getParent(v, u.isBlock); + if (v && v.nodeName != "LI") { + v.innerHTML = ""; + if (o._previousFormats) { + v.appendChild(s.wrapper); + s.inner.innerHTML = "\uFEFF" + } else { + v.innerHTML = "\uFEFF" + } + p.select(v, 1); + p.collapse(true); + t.getDoc().execCommand("Delete", false, null); + o._previousFormats = 0 + } + } + } + }) + } + if (a) { + n.onKeyDown.add(function(s, t) { + if ((t.keyCode == 8 || t.keyCode == 46) && !t.shiftKey) { + o.backspaceDelete(t, t.keyCode == 8) + } + }) + } + } + if (m.isWebKit) { + function r(t) { + var s = p.getRng(), + v, z = u.create("div", null, " "), + y, x = u.getViewPort(t.getWin()).h; + s.insertNode(v = u.create("br")); + s.setStartAfter(v); + s.setEndAfter(v); + p.setRng(s); + if (p.getSel().focusNode == v.previousSibling) { + p.select(u.insertAfter(u.doc.createTextNode("\u00a0"), v)); + p.collapse(d) + } + u.insertAfter(z, v); + y = u.getPos(z).y; + u.remove(z); + if (y > x) { + t.getWin().scrollTo(0, y) + } + } + n.onKeyPress.add(function(s, t) { + if (t.keyCode == 13 && (t.shiftKey || (q.force_br_newlines && !u.getParent(p.getNode(), "h1,h2,h3,h4,h5,h6,ol,ul")))) { + r(s); + k.cancel(t) + } + }) + } + if (c) { + if (q.element != "P") { + n.onKeyPress.add(function(s, t) { + o.lastElm = p.getNode().nodeName + }); + n.onKeyUp.add(function(t, v) { + var y, x = p.getNode(), + s = t.getBody(); + if (s.childNodes.length === 1 && x.nodeName == "P") { + x = u.rename(x, q.element); + p.select(x); + p.collapse(); + t.nodeChanged() + } else { + if (v.keyCode == 13 && !v.shiftKey && o.lastElm != "P") { + y = u.getParent(x, "p"); + if (y) { + u.rename(y, q.element); + t.nodeChanged() + } + } + } + }) + } + } + }, + find: function(v, q, r) { + var p = this.editor, + o = p.getDoc().createTreeWalker(v, 4, null, h), + u = -1; + while (v = o.nextNode()) { + u++; + if (q == 0 && v == r) { + return u + } + if (q == 1 && u == r) { + return v + } + } + return -1 + }, + forceRoots: function(x, I) { + var z = this, + x = z.editor, + M = x.getBody(), + J = x.getDoc(), + P = x.selection, + A = P.getSel(), + B = P.getRng(), + N = -2, + v, G, o, p, K = -16777215; + var L, q, O, F, C, u = M.childNodes, + E, D, y; + for (E = u.length - 1; E >= 0; E--) { + L = u[E]; + if (L.nodeType === 1 && L.getAttribute("data-mce-type")) { + q = null; + continue + } + if (L.nodeType === 3 || (!z.dom.isBlock(L) && L.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(L.nodeName))) { + if (!q) { + if (L.nodeType != 3 || /[^\s]/g.test(L.nodeValue)) { + if (N == -2 && B) { + if (!c || B.setStart) { + if (B.startContainer.nodeType == 1 && (D = B.startContainer.childNodes[B.startOffset]) && D.nodeType == 1) { + y = D.getAttribute("id"); + D.setAttribute("id", "__mce") + } else { + if (x.dom.getParent(B.startContainer, function(n) { + return n === M + })) { + G = B.startOffset; + o = B.endOffset; + N = z.find(M, 0, B.startContainer); + v = z.find(M, 0, B.endContainer) + } + } + } else { + if (B.item) { + p = J.body.createTextRange(); + p.moveToElementText(B.item(0)); + B = p + } + p = J.body.createTextRange(); + p.moveToElementText(M); + p.collapse(1); + O = p.move("character", K) * -1; + p = B.duplicate(); + p.collapse(1); + F = p.move("character", K) * -1; + p = B.duplicate(); + p.collapse(0); + C = (p.move("character", K) * -1) - F; + N = F - O; + v = C + } + } + q = x.dom.create(x.settings.forced_root_block); + L.parentNode.replaceChild(q, L); + q.appendChild(L) + } + } else { + if (q.hasChildNodes()) { + q.insertBefore(L, q.firstChild) + } else { + q.appendChild(L) + } + } + } else { + q = null + } + } + if (N != -2) { + if (!c || B.setStart) { + q = M.getElementsByTagName(x.settings.element)[0]; + B = J.createRange(); + if (N != -1) { + B.setStart(z.find(M, 1, N), G) + } else { + B.setStart(q, 0) + } + if (v != -1) { + B.setEnd(z.find(M, 1, v), o) + } else { + B.setEnd(q, 0) + } + if (A) { + A.removeAllRanges(); + A.addRange(B) + } + } else { + try { + B = A.createRange(); + B.moveToElementText(M); + B.collapse(1); + B.moveStart("character", N); + B.moveEnd("character", v); + B.select() + } catch (H) {} + } + } else { + if ((!c || B.setStart) && (D = x.dom.get("__mce"))) { + if (y) { + D.setAttribute("id", y) + } else { + D.removeAttribute("id") + } + B = J.createRange(); + B.setStartBefore(D); + B.setEndBefore(D); + P.setRng(B) + } + } + }, + getParentBlock: function(p) { + var o = this.dom; + return o.getParent(p, o.isBlock) + }, + insertPara: function(S) { + var G = this, + x = G.editor, + O = x.dom, + T = x.getDoc(), + X = x.settings, + H = x.selection.getSel(), + I = H.getRangeAt(0), + W = T.body; + var L, M, J, Q, P, u, p, v, A, o, E, V, q, z, K, N = O.getViewPort(x.getWin()), + D, F, C; + x.undoManager.beforeChange(); + L = T.createRange(); + L.setStart(H.anchorNode, H.anchorOffset); + L.collapse(d); + M = T.createRange(); + M.setStart(H.focusNode, H.focusOffset); + M.collapse(d); + J = L.compareBoundaryPoints(L.START_TO_END, M) < 0; + Q = J ? H.anchorNode : H.focusNode; + P = J ? H.anchorOffset : H.focusOffset; + u = J ? H.focusNode : H.anchorNode; + p = J ? H.focusOffset : H.anchorOffset; + if (Q === u && /^(TD|TH)$/.test(Q.nodeName)) { + if (Q.firstChild.nodeName == "BR") { + O.remove(Q.firstChild) + } + if (Q.childNodes.length == 0) { + x.dom.add(Q, X.element, null, "
        "); + V = x.dom.add(Q, X.element, null, "
        ") + } else { + K = Q.innerHTML; + Q.innerHTML = ""; + x.dom.add(Q, X.element, null, K); + V = x.dom.add(Q, X.element, null, "
        ") + } + I = T.createRange(); + I.selectNodeContents(V); + I.collapse(1); + x.selection.setRng(I); + return h + } + if (Q == W && u == W && W.firstChild && x.dom.isBlock(W.firstChild)) { + Q = u = Q.firstChild; + P = p = 0; + L = T.createRange(); + L.setStart(Q, 0); + M = T.createRange(); + M.setStart(u, 0) + } + Q = Q.nodeName == "HTML" ? T.body : Q; + Q = Q.nodeName == "BODY" ? Q.firstChild : Q; + u = u.nodeName == "HTML" ? T.body : u; + u = u.nodeName == "BODY" ? u.firstChild : u; + v = G.getParentBlock(Q); + A = G.getParentBlock(u); + o = v ? v.nodeName : X.element; + if (K = G.dom.getParent(v, "li,pre")) { + if (K.nodeName == "LI") { + return e(x.selection, G.dom, K) + } + return d + } + if (v && (v.nodeName == "CAPTION" || /absolute|relative|fixed/gi.test(O.getStyle(v, "position", 1)))) { + o = X.element; + v = null + } + if (A && (A.nodeName == "CAPTION" || /absolute|relative|fixed/gi.test(O.getStyle(v, "position", 1)))) { + o = X.element; + A = null + } + if (/(TD|TABLE|TH|CAPTION)/.test(o) || (v && o == "DIV" && /left|right/gi.test(O.getStyle(v, "float", 1)))) { + o = X.element; + v = A = null + } + E = (v && v.nodeName == o) ? v.cloneNode(0) : x.dom.create(o); + V = (A && A.nodeName == o) ? A.cloneNode(0) : x.dom.create(o); + V.removeAttribute("id"); + if (/^(H[1-6])$/.test(o) && g(I, v)) { + V = x.dom.create(X.element) + } + K = q = Q; + do { + if (K == W || K.nodeType == 9 || G.dom.isBlock(K) || /(TD|TABLE|TH|CAPTION)/.test(K.nodeName)) { + break + } + q = K + } while ((K = K.previousSibling ? K.previousSibling : K.parentNode)); + K = z = u; + do { + if (K == W || K.nodeType == 9 || G.dom.isBlock(K) || /(TD|TABLE|TH|CAPTION)/.test(K.nodeName)) { + break + } + z = K + } while ((K = K.nextSibling ? K.nextSibling : K.parentNode)); + if (q.nodeName == o) { + L.setStart(q, 0) + } else { + L.setStartBefore(q) + } + L.setEnd(Q, P); + E.appendChild(L.cloneContents() || T.createTextNode("")); + try { + M.setEndAfter(z) + } catch (R) {} + M.setStart(u, p); + V.appendChild(M.cloneContents() || T.createTextNode("")); + I = T.createRange(); + if (!q.previousSibling && q.parentNode.nodeName == o) { + I.setStartBefore(q.parentNode) + } else { + if (L.startContainer.nodeName == o && L.startOffset == 0) { + I.setStartBefore(L.startContainer) + } else { + I.setStart(L.startContainer, L.startOffset) + } + } + if (!z.nextSibling && z.parentNode.nodeName == o) { + I.setEndAfter(z.parentNode) + } else { + I.setEnd(M.endContainer, M.endOffset) + } + I.deleteContents(); + if (b) { + x.getWin().scrollTo(0, N.y) + } + if (E.firstChild && E.firstChild.nodeName == o) { + E.innerHTML = E.firstChild.innerHTML + } + if (V.firstChild && V.firstChild.nodeName == o) { + V.innerHTML = V.firstChild.innerHTML + } + if (f(E)) { + E.innerHTML = "
        " + } + function U(y, s) { + var r = [], + Z, Y, t; + y.innerHTML = ""; + if (X.keep_styles) { + Y = s; + do { + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)) { + Z = Y.cloneNode(h); + O.setAttrib(Z, "id", ""); + r.push(Z) + } + } while (Y = Y.parentNode) + } + if (r.length > 0) { + for (t = r.length - 1, Z = y; t >= 0; t--) { + Z = Z.appendChild(r[t]) + } + r[0].innerHTML = b ? "\u00a0" : "
        "; + return r[0] + } else { + y.innerHTML = b ? "\u00a0" : "
        " + } + } + if (f(V)) { + C = U(V, u) + } + if (b && parseFloat(opera.version()) < 9.5) { + I.insertNode(E); + I.insertNode(V) + } else { + I.insertNode(V); + I.insertNode(E) + } + V.normalize(); + E.normalize(); + + function B(r) { + return T.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, h).nextNode() || r + } + I = T.createRange(); + I.selectNodeContents(a ? B(C || V) : C || V); + I.collapse(1); + H.removeAllRanges(); + H.addRange(I); + D = x.dom.getPos(V).y; + if (D < N.y || D + 25 > N.y + N.h) { + x.getWin().scrollTo(0, D < N.y ? D : D - N.h + 25) + } + x.undoManager.add(); + return h + }, + backspaceDelete: function(v, C) { + var D = this, + u = D.editor, + z = u.getBody(), + s = u.dom, + q, x = u.selection, + p = x.getRng(), + y = p.startContainer, + q, A, B, o; + if (!C && p.collapsed && y.nodeType == 1 && p.startOffset == y.childNodes.length) { + o = new m.dom.TreeWalker(y.lastChild, y); + for (q = y.lastChild; q; q = o.prev()) { + if (q.nodeType == 3) { + p.setStart(q, q.nodeValue.length); + p.collapse(true); + x.setRng(p); + return + } + } + } + if (y && u.dom.isBlock(y) && !/^(TD|TH)$/.test(y.nodeName) && C) { + if (y.childNodes.length == 0 || (y.childNodes.length == 1 && y.firstChild.nodeName == "BR")) { + q = y; + while ((q = q.previousSibling) && !u.dom.isBlock(q)) {} + if (q) { + if (y != z.firstChild) { + A = u.dom.doc.createTreeWalker(q, NodeFilter.SHOW_TEXT, null, h); + while (B = A.nextNode()) { + q = B + } + p = u.getDoc().createRange(); + p.setStart(q, q.nodeValue ? q.nodeValue.length : 0); + p.setEnd(q, q.nodeValue ? q.nodeValue.length : 0); + x.setRng(p); + u.dom.remove(y) + } + return k.cancel(v) + } + } + } + } + }) +})(tinymce); +(function(c) { + var b = c.DOM, + a = c.dom.Event, + d = c.each, + e = c.extend; + c.create("tinymce.ControlManager", { + ControlManager: function(f, j) { + var h = this, + g; + j = j || {}; + h.editor = f; + h.controls = {}; + h.onAdd = new c.util.Dispatcher(h); + h.onPostRender = new c.util.Dispatcher(h); + h.prefix = j.prefix || f.id + "_"; + h._cls = {}; + h.onPostRender.add(function() { + d(h.controls, function(i) { + i.postRender() + }) + }) + }, + get: function(f) { + return this.controls[this.prefix + f] || this.controls[f] + }, + setActive: function(h, f) { + var g = null; + if (g = this.get(h)) { + g.setActive(f) + } + return g + }, + setDisabled: function(h, f) { + var g = null; + if (g = this.get(h)) { + g.setDisabled(f) + } + return g + }, + add: function(g) { + var f = this; + if (g) { + f.controls[g.id] = g; + f.onAdd.dispatch(g, f) + } + return g + }, + createControl: function(i) { + var h, g = this, + f = g.editor; + d(f.plugins, function(j) { + if (j.createControl) { + h = j.createControl(i, g); + if (h) { + return false + } + } + }); + switch (i) { + case "|": + case "separator": + return g.createSeparator() + } + if (!h && f.buttons && (h = f.buttons[i])) { + return g.createButton(i, h) + } + return g.add(h) + }, + createDropMenu: function(f, n, h) { + var m = this, + i = m.editor, + j, g, k, l; + n = e({ + "class": "mceDropDown", + constrain: i.settings.constrain_menus + }, n); + n["class"] = n["class"] + " " + i.getParam("skin") + "Skin"; + if (k = i.getParam("skin_variant")) { + n["class"] += " " + i.getParam("skin") + "Skin" + k.substring(0, 1).toUpperCase() + k.substring(1) + } + f = m.prefix + f; + l = h || m._cls.dropmenu || c.ui.DropMenu; + j = m.controls[f] = new l(f, n); + j.onAddItem.add(function(r, q) { + var p = q.settings; + p.title = i.getLang(p.title, p.title); + if (!p.onclick) { + p.onclick = function(o) { + if (p.cmd) { + i.execCommand(p.cmd, p.ui || false, p.value) + } + } + } + }); + i.onRemove.add(function() { + j.destroy() + }); + if (c.isIE) { + j.onShowMenu.add(function() { + i.focus(); + g = i.selection.getBookmark(1) + }); + j.onHideMenu.add(function() { + if (g) { + i.selection.moveToBookmark(g); + g = 0 + } + }) + } + return m.add(j) + }, + createListBox: function(m, i, l) { + var h = this, + g = h.editor, + j, k, f; + if (h.get(m)) { + return null + } + i.title = g.translate(i.title); + i.scope = i.scope || g; + if (!i.onselect) { + i.onselect = function(n) { + g.execCommand(i.cmd, i.ui || false, n || i.value) + } + } + i = e({ + title: i.title, + "class": "mce_" + m, + scope: i.scope, + control_manager: h + }, i); + m = h.prefix + m; + if (g.settings.use_native_selects) { + k = new c.ui.NativeListBox(m, i) + } else { + f = l || h._cls.listbox || c.ui.ListBox; + k = new f(m, i, g) + } + h.controls[m] = k; + if (c.isWebKit) { + k.onPostRender.add(function(p, o) { + a.add(o, "mousedown", function() { + g.bookmark = g.selection.getBookmark(1) + }); + a.add(o, "focus", function() { + g.selection.moveToBookmark(g.bookmark); + g.bookmark = null + }) + }) + } + if (k.hideMenu) { + g.onMouseDown.add(k.hideMenu, k) + } + return h.add(k) + }, + createButton: function(m, i, l) { + var h = this, + g = h.editor, + j, k, f; + if (h.get(m)) { + return null + } + i.title = g.translate(i.title); + i.label = g.translate(i.label); + i.scope = i.scope || g; + if (!i.onclick && !i.menu_button) { + i.onclick = function() { + g.execCommand(i.cmd, i.ui || false, i.value) + } + } + i = e({ + title: i.title, + "class": "mce_" + m, + unavailable_prefix: g.getLang("unavailable", ""), + scope: i.scope, + control_manager: h + }, i); + m = h.prefix + m; + if (i.menu_button) { + f = l || h._cls.menubutton || c.ui.MenuButton; + k = new f(m, i, g); + g.onMouseDown.add(k.hideMenu, k) + } else { + f = h._cls.button || c.ui.Button; + k = new f(m, i) + } + return h.add(k) + }, + createMenuButton: function(h, f, g) { + f = f || {}; + f.menu_button = 1; + return this.createButton(h, f, g) + }, + createSplitButton: function(m, i, l) { + var h = this, + g = h.editor, + j, k, f; + if (h.get(m)) { + return null + } + i.title = g.translate(i.title); + i.scope = i.scope || g; + if (!i.onclick) { + i.onclick = function(n) { + g.execCommand(i.cmd, i.ui || false, n || i.value) + } + } + if (!i.onselect) { + i.onselect = function(n) { + g.execCommand(i.cmd, i.ui || false, n || i.value) + } + } + i = e({ + title: i.title, + "class": "mce_" + m, + scope: i.scope, + control_manager: h + }, i); + m = h.prefix + m; + f = l || h._cls.splitbutton || c.ui.SplitButton; + k = h.add(new f(m, i, g)); + g.onMouseDown.add(k.hideMenu, k); + return k + }, + createColorSplitButton: function(f, n, h) { + var l = this, + j = l.editor, + i, k, m, g; + if (l.get(f)) { + return null + } + n.title = j.translate(n.title); + n.scope = n.scope || j; + if (!n.onclick) { + n.onclick = function(o) { + if (c.isIE) { + g = j.selection.getBookmark(1) + } + j.execCommand(n.cmd, n.ui || false, o || n.value) + } + } + if (!n.onselect) { + n.onselect = function(o) { + j.execCommand(n.cmd, n.ui || false, o || n.value) + } + } + n = e({ + title: n.title, + "class": "mce_" + f, + menu_class: j.getParam("skin") + "Skin", + scope: n.scope, + more_colors_title: j.getLang("more_colors") + }, n); + f = l.prefix + f; + m = h || l._cls.colorsplitbutton || c.ui.ColorSplitButton; + k = new m(f, n, j); + j.onMouseDown.add(k.hideMenu, k); + j.onRemove.add(function() { + k.destroy() + }); + if (c.isIE) { + k.onShowMenu.add(function() { + j.focus(); + g = j.selection.getBookmark(1) + }); + k.onHideMenu.add(function() { + if (g) { + j.selection.moveToBookmark(g); + g = 0 + } + }) + } + return l.add(k) + }, + createToolbar: function(k, h, j) { + var i, g = this, + f; + k = g.prefix + k; + f = j || g._cls.toolbar || c.ui.Toolbar; + i = new f(k, h, g.editor); + if (g.get(k)) { + return null + } + return g.add(i) + }, + createToolbarGroup: function(k, h, j) { + var i, g = this, + f; + k = g.prefix + k; + f = j || this._cls.toolbarGroup || c.ui.ToolbarGroup; + i = new f(k, h, g.editor); + if (g.get(k)) { + return null + } + return g.add(i) + }, + createSeparator: function(g) { + var f = g || this._cls.separator || c.ui.Separator; + return new f() + }, + setControlType: function(g, f) { + return this._cls[g.toLowerCase()] = f + }, + destroy: function() { + d(this.controls, function(f) { + f.destroy() + }); + this.controls = null + } + }) +})(tinymce); +(function(d) { + var a = d.util.Dispatcher, + e = d.each, + c = d.isIE, + b = d.isOpera; + d.create("tinymce.WindowManager", { + WindowManager: function(f) { + var g = this; + g.editor = f; + g.onOpen = new a(g); + g.onClose = new a(g); + g.params = {}; + g.features = {} + }, + open: function(z, h) { + var v = this, + k = "", + n, m, i = v.editor.settings.dialog_type == "modal", + q, o, j, g = d.DOM.getViewPort(), + r; + z = z || {}; + h = h || {}; + o = b ? g.w : screen.width; + j = b ? g.h : screen.height; + z.name = z.name || "mc_" + new Date().getTime(); + z.width = parseInt(z.width || 320); + z.height = parseInt(z.height || 240); + z.resizable = true; + z.left = z.left || parseInt(o / 2) - (z.width / 2); + z.top = z.top || parseInt(j / 2) - (z.height / 2); + h.inline = false; + h.mce_width = z.width; + h.mce_height = z.height; + h.mce_auto_focus = z.auto_focus; + if (i) { + if (c) { + z.center = true; + z.help = false; + z.dialogWidth = z.width + "px"; + z.dialogHeight = z.height + "px"; + z.scroll = z.scrollbars || false + } + } + e(z, function(p, f) { + if (d.is(p, "boolean")) { + p = p ? "yes" : "no" + } + if (!/^(name|url)$/.test(f)) { + if (c && i) { + k += (k ? ";" : "") + f + ":" + p + } else { + k += (k ? "," : "") + f + "=" + p + } + } + }); + v.features = z; + v.params = h; + v.onOpen.dispatch(v, z, h); + r = z.url || z.file; + r = d._addVer(r); + try { + if (c && i) { + q = 1; + window.showModalDialog(r, window, k) + } else { + q = window.open(r, z.name, k) + } + } catch (l) {} + if (!q) { + alert(v.editor.getLang("popup_blocked")) + } + }, + close: function(f) { + f.close(); + this.onClose.dispatch(this) + }, + createInstance: function(i, h, g, m, l, k) { + var j = d.resolve(i); + return new j(h, g, m, l, k) + }, + confirm: function(h, f, i, g) { + g = g || window; + f.call(i || this, g.confirm(this._decode(this.editor.getLang(h, h)))) + }, + alert: function(h, f, j, g) { + var i = this; + g = g || window; + g.alert(i._decode(i.editor.getLang(h, h))); + if (f) { + f.call(j || i) + } + }, + resizeBy: function(f, g, h) { + h.resizeBy(f, g) + }, + _decode: function(f) { + return d.DOM.decode(f).replace(/\\n/g, "\n") + } + }) +}(tinymce)); +(function(a) { + a.Formatter = function(V) { + var M = {}, + O = a.each, + c = V.dom, + q = V.selection, + t = a.dom.TreeWalker, + K = new a.dom.RangeUtils(c), + d = V.schema.isValidChild, + F = c.isBlock, + l = V.settings.forced_root_block, + s = c.nodeIndex, + E = "\uFEFF", + e = /^(src|href|style)$/, + S = false, + B = true, + p, P = { + apply: [], + remove: [] + }; + + function z(W) { + return W instanceof Array + } + function m(X, W) { + return c.getParents(X, W, c.getRoot()) + } + function b(W) { + return W.nodeType === 1 && (W.face === "mceinline" || W.style.fontFamily === "mceinline") + } + function R(W) { + return W ? M[W] : M + } + function k(W, X) { + if (W) { + if (typeof(W) !== "string") { + O(W, function(Z, Y) { + k(Y, Z) + }) + } else { + X = X.length ? X : [X]; + O(X, function(Y) { + if (Y.deep === p) { + Y.deep = !Y.selector + } + if (Y.split === p) { + Y.split = !Y.selector || Y.inline + } + if (Y.remove === p && Y.selector && !Y.inline) { + Y.remove = "none" + } + if (Y.selector && Y.inline) { + Y.mixed = true; + Y.block_expand = true + } + if (typeof(Y.classes) === "string") { + Y.classes = Y.classes.split(/\s+/) + } + }); + M[W] = X + } + } + } + var i = function(X) { + var W; + V.dom.getParent(X, function(Y) { + W = V.dom.getStyle(Y, "text-decoration"); + return W && W !== "none" + }); + return W + }; + var I = function(W) { + var X; + if (W.nodeType === 1 && W.parentNode && W.parentNode.nodeType === 1) { + X = i(W.parentNode); + if (V.dom.getStyle(W, "color") && X) { + V.dom.setStyle(W, "text-decoration", X) + } else { + if (V.dom.getStyle(W, "textdecoration") === X) { + V.dom.setStyle(W, "text-decoration", null) + } + } + } + }; + + function T(Y, af, aa) { + var ab = R(Y), + ag = ab[0], + ae, X, ad, ac = q.isCollapsed(); + + function Z(ak) { + var aj = ak.startContainer, + an = ak.startOffset, + am, al; + if (aj.nodeType == 1 || aj.nodeValue === "") { + aj = aj.nodeType == 1 ? aj.childNodes[an] : aj; + if (aj) { + am = new t(aj, aj.parentNode); + for (al = am.current(); al; al = am.next()) { + if (al.nodeType == 3 && !f(al)) { + ak.setStart(al, 0); + break + } + } + } + } + return ak + } + function W(ak, aj) { + aj = aj || ag; + if (ak) { + O(aj.styles, function(am, al) { + c.setStyle(ak, al, r(am, af)) + }); + O(aj.attributes, function(am, al) { + c.setAttrib(ak, al, r(am, af)) + }); + O(aj.classes, function(al) { + al = r(al, af); + if (!c.hasClass(ak, al)) { + c.addClass(ak, al) + } + }) + } + } + function ah(ak) { + var aj = [], + am, al; + am = ag.inline || ag.block; + al = c.create(am); + W(al); + K.walk(ak, function(an) { + var ao; + + function ap(aq) { + var au = aq.nodeName.toLowerCase(), + at = aq.parentNode.nodeName.toLowerCase(), + ar; + if (g(au, "br")) { + ao = 0; + if (ag.block) { + c.remove(aq) + } + return + } + if (ag.wrapper && x(aq, Y, af)) { + ao = 0; + return + } + if (ag.block && !ag.wrapper && G(au)) { + aq = c.rename(aq, am); + W(aq); + aj.push(aq); + ao = 0; + return + } + if (ag.selector) { + O(ab, function(av) { + if ("collapsed" in av && av.collapsed !== ac) { + return + } + if (c.is(aq, av.selector) && !b(aq)) { + W(aq, av); + ar = true + } + }); + if (!ag.inline || ar) { + ao = 0; + return + } + } + if (d(am, au) && d(at, am) && !(aq.nodeType === 3 && aq.nodeValue.length === 1 && aq.nodeValue.charCodeAt(0) === 65279)) { + if (!ao) { + ao = al.cloneNode(S); + aq.parentNode.insertBefore(ao, aq); + aj.push(ao) + } + ao.appendChild(aq) + } else { + ao = 0; + O(a.grep(aq.childNodes), ap); + ao = 0 + } + } + O(an, ap) + }); + if (ag.wrap_links === false) { + O(aj, function(an) { + function ao(at) { + var ar, aq, ap; + if (at.nodeName === "A") { + aq = al.cloneNode(S); + aj.push(aq); + ap = a.grep(at.childNodes); + for (ar = 0; ar < ap.length; ar++) { + aq.appendChild(ap[ar]) + } + at.appendChild(aq) + } + O(a.grep(at.childNodes), ao) + } + ao(an) + }) + } + O(aj, function(ap) { + var an; + + function aq(at) { + var ar = 0; + O(at.childNodes, function(au) { + if (!f(au) && !H(au)) { + ar++ + } + }); + return ar + } + function ao(ar) { + var au, at; + O(ar.childNodes, function(av) { + if (av.nodeType == 1 && !H(av) && !b(av)) { + au = av; + return S + } + }); + if (au && h(au, ag)) { + at = au.cloneNode(S); + W(at); + c.replace(at, ar, B); + c.remove(au, 1) + } + return at || ar + } + an = aq(ap); + if ((aj.length > 1 || !F(ap)) && an === 0) { + c.remove(ap, 1); + return + } + if (ag.inline || ag.wrapper) { + if (!ag.exact && an === 1) { + ap = ao(ap) + } + O(ab, function(ar) { + O(c.select(ar.inline, ap), function(au) { + var at; + if (ar.wrap_links === false) { + at = au.parentNode; + do { + if (at.nodeName === "A") { + return + } + } while (at = at.parentNode) + } + U(ar, af, au, ar.exact ? au : null) + }) + }); + if (x(ap.parentNode, Y, af)) { + c.remove(ap, 1); + ap = 0; + return B + } + if (ag.merge_with_parents) { + c.getParent(ap.parentNode, function(ar) { + if (x(ar, Y, af)) { + c.remove(ap, 1); + ap = 0; + return B + } + }) + } + if (ap) { + ap = u(C(ap), ap); + ap = u(ap, C(ap, B)) + } + } + }) + } + if (ag) { + if (aa) { + X = c.createRng(); + X.setStartBefore(aa); + X.setEndAfter(aa); + ah(o(X, ab)) + } else { + if (!ac || !ag.inline || c.select("td.mceSelected,th.mceSelected").length) { + var ai = V.selection.getNode(); + ae = q.getBookmark(); + ah(o(q.getRng(B), ab)); + if (ag.styles && (ag.styles.color || ag.styles.textDecoration)) { + a.walk(ai, I, "childNodes"); + I(ai) + } + q.moveToBookmark(ae); + q.setRng(Z(q.getRng(B))); + V.nodeChanged() + } else { + Q("apply", Y, af) + } + } + } + } + function A(Y, ah, ab) { + var ac = R(Y), + aj = ac[0], + ag, af, X; + + function aa(am) { + var al = am.startContainer, + ar = am.startOffset, + aq, ap, an, ao; + if (al.nodeType == 3 && ar >= al.nodeValue.length - 1) { + al = al.parentNode; + ar = s(al) + 1 + } + if (al.nodeType == 1) { + an = al.childNodes; + al = an[Math.min(ar, an.length - 1)]; + aq = new t(al); + if (ar > an.length - 1) { + aq.next() + } + for (ap = aq.current(); ap; ap = aq.next()) { + if (ap.nodeType == 3 && !f(ap)) { + ao = c.create("a", null, E); + ap.parentNode.insertBefore(ao, ap); + am.setStart(ap, 0); + q.setRng(am); + c.remove(ao); + return + } + } + } + } + function Z(ao) { + var an, am, al; + an = a.grep(ao.childNodes); + for (am = 0, al = ac.length; am < al; am++) { + if (U(ac[am], ah, ao, ao)) { + break + } + } + if (aj.deep) { + for (am = 0, al = an.length; am < al; am++) { + Z(an[am]) + } + } + } + function ad(al) { + var am; + O(m(al.parentNode).reverse(), function(an) { + var ao; + if (!am && an.id != "_start" && an.id != "_end") { + ao = x(an, Y, ah); + if (ao && ao.split !== false) { + am = an + } + } + }); + return am + } + function W(ao, al, aq, au) { + var av, at, ar, an, ap, am; + if (ao) { + am = ao.parentNode; + for (av = al.parentNode; av && av != am; av = av.parentNode) { + at = av.cloneNode(S); + for (ap = 0; ap < ac.length; ap++) { + if (U(ac[ap], ah, at, at)) { + at = 0; + break + } + } + if (at) { + if (ar) { + at.appendChild(ar) + } + if (!an) { + an = at + } + ar = at + } + } + if (au && (!aj.mixed || !F(ao))) { + al = c.split(ao, al) + } + if (ar) { + aq.parentNode.insertBefore(ar, aq); + an.appendChild(aq) + } + } + return al + } + function ai(al) { + return W(ad(al), al, al, true) + } + function ae(an) { + var am = c.get(an ? "_start" : "_end"), + al = am[an ? "firstChild" : "lastChild"]; + if (H(al)) { + al = al[an ? "firstChild" : "lastChild"] + } + c.remove(am, true); + return al + } + function ak(al) { + var am, an; + al = o(al, ac, B); + if (aj.split) { + am = J(al, B); + an = J(al); + if (am != an) { + am = N(am, "span", { + id: "_start", + "data-mce-type": "bookmark" + }); + an = N(an, "span", { + id: "_end", + "data-mce-type": "bookmark" + }); + ai(am); + ai(an); + am = ae(B); + an = ae() + } else { + am = an = ai(am) + } + al.startContainer = am.parentNode; + al.startOffset = s(am); + al.endContainer = an.parentNode; + al.endOffset = s(an) + 1 + } + K.walk(al, function(ao) { + O(ao, function(ap) { + Z(ap); + if (ap.nodeType === 1 && V.dom.getStyle(ap, "text-decoration") === "underline" && ap.parentNode && i(ap.parentNode) === "underline") { + U({ + deep: false, + exact: true, + inline: "span", + styles: { + textDecoration: "underline" + } + }, null, ap) + } + }) + }) + } + if (ab) { + X = c.createRng(); + X.setStartBefore(ab); + X.setEndAfter(ab); + ak(X); + return + } + if (!q.isCollapsed() || !aj.inline || c.select("td.mceSelected,th.mceSelected").length) { + ag = q.getBookmark(); + ak(q.getRng(B)); + q.moveToBookmark(ag); + if (j(Y, ah, q.getStart())) { + aa(q.getRng(true)) + } + V.nodeChanged() + } else { + Q("remove", Y, ah) + } + } + function D(X, Z, Y) { + var W = R(X); + if (j(X, Z, Y) && (!("toggle" in W[0]) || W[0]["toggle"])) { + A(X, Z, Y) + } else { + T(X, Z, Y) + } + } + function x(X, W, ac, aa) { + var Y = R(W), + ad, ab, Z; + + function ae(ai, ak, al) { + var ah, aj, af = ak[al], + ag; + if (af) { + if (af.length === p) { + for (ah in af) { + if (af.hasOwnProperty(ah)) { + if (al === "attributes") { + aj = c.getAttrib(ai, ah) + } else { + aj = L(ai, ah) + } + if (aa && !aj && !ak.exact) { + return + } + if ((!aa || ak.exact) && !g(aj, r(af[ah], ac))) { + return + } + } + } + } else { + for (ag = 0; ag < af.length; ag++) { + if (al === "attributes" ? c.getAttrib(ai, af[ag]) : L(ai, af[ag])) { + return ak + } + } + } + } + return ak + } + if (Y && X) { + for (ab = 0; ab < Y.length; ab++) { + ad = Y[ab]; + if (h(X, ad) && ae(X, ad, "attributes") && ae(X, ad, "styles")) { + if (Z = ad.classes) { + for (ab = 0; ab < Z.length; ab++) { + if (!c.hasClass(X, Z[ab])) { + return + } + } + } + return ad + } + } + } + } + function j(Y, ab, aa) { + var X, Z; + + function W(ac) { + ac = c.getParent(ac, function(ad) { + return !!x(ad, Y, ab, true) + }); + return x(ac, Y, ab) + } + if (aa) { + return W(aa) + } + if (q.isCollapsed()) { + for (Z = P.apply.length - 1; Z >= 0; Z--) { + if (P.apply[Z].name == Y) { + return true + } + } + for (Z = P.remove.length - 1; Z >= 0; Z--) { + if (P.remove[Z].name == Y) { + return false + } + } + return W(q.getNode()) + } + aa = q.getNode(); + if (W(aa)) { + return B + } + X = q.getStart(); + if (X != aa) { + if (W(X)) { + return B + } + } + return S + } + function v(ad, ac) { + var aa, ab = [], + Z = {}, + Y, X, W; + if (q.isCollapsed()) { + for (X = 0; X < ad.length; X++) { + for (Y = P.remove.length - 1; Y >= 0; Y--) { + W = ad[X]; + if (P.remove[Y].name == W) { + Z[W] = true; + break + } + } + } + for (Y = P.apply.length - 1; Y >= 0; Y--) { + for (X = 0; X < ad.length; X++) { + W = ad[X]; + if (!Z[W] && P.apply[Y].name == W) { + Z[W] = true; + ab.push(W) + } + } + } + } + aa = q.getStart(); + c.getParent(aa, function(ag) { + var af, ae; + for (af = 0; af < ad.length; af++) { + ae = ad[af]; + if (!Z[ae] && x(ag, ae, ac)) { + Z[ae] = true; + ab.push(ae) + } + } + }); + return ab + } + function y(aa) { + var ac = R(aa), + Z, Y, ab, X, W; + if (ac) { + Z = q.getStart(); + Y = m(Z); + for (X = ac.length - 1; X >= 0; X--) { + W = ac[X].selector; + if (!W) { + return B + } + for (ab = Y.length - 1; ab >= 0; ab--) { + if (c.is(Y[ab], W)) { + return B + } + } + } + } + return S + } + a.extend(this, { + get: R, + register: k, + apply: T, + remove: A, + toggle: D, + match: j, + matchAll: v, + matchNode: x, + canApply: y + }); + + function h(W, X) { + if (g(W, X.inline)) { + return B + } + if (g(W, X.block)) { + return B + } + if (X.selector) { + return c.is(W, X.selector) + } + } + function g(X, W) { + X = X || ""; + W = W || ""; + X = "" + (X.nodeName || X); + W = "" + (W.nodeName || W); + return X.toLowerCase() == W.toLowerCase() + } + function L(X, W) { + var Y = c.getStyle(X, W); + if (W == "color" || W == "backgroundColor") { + Y = c.toHex(Y) + } + if (W == "fontWeight" && Y == 700) { + Y = "bold" + } + return "" + Y + } + function r(W, X) { + if (typeof(W) != "string") { + W = W(X) + } else { + if (X) { + W = W.replace(/%(\w+)/g, function(Z, Y) { + return X[Y] || Z + }) + } + } + return W + } + function f(W) { + return W && W.nodeType === 3 && /^([\s\r\n]+|)$/.test(W.nodeValue) + } + function N(Y, X, W) { + var Z = c.create(X, W); + Y.parentNode.insertBefore(Z, Y); + Z.appendChild(Y); + return Z + } + function o(W, ag, Z) { + var Y = W.startContainer, + ad = W.startOffset, + aj = W.endContainer, + ae = W.endOffset, + ai, af, ac; + + function ah(am, an, ak, al) { + var ao, ap; + al = al || c.getRoot(); + for (;;) { + ao = am.parentNode; + if (ao == al || (!ag[0].block_expand && F(ao))) { + return am + } + for (ai = ao[an]; ai && ai != am; ai = ai[ak]) { + if (ai.nodeType == 1 && !H(ai)) { + return am + } + if (ai.nodeType == 3 && !f(ai)) { + return am + } + } + am = am.parentNode + } + return am + } + function ab(ak, al) { + if (al === p) { + al = ak.nodeType === 3 ? ak.length : ak.childNodes.length + } + while (ak && ak.hasChildNodes()) { + ak = ak.childNodes[al]; + if (ak) { + al = ak.nodeType === 3 ? ak.length : ak.childNodes.length + } + } + return { + node: ak, + offset: al + } + } + if (Y.nodeType == 1 && Y.hasChildNodes()) { + af = Y.childNodes.length - 1; + Y = Y.childNodes[ad > af ? af : ad]; + if (Y.nodeType == 3) { + ad = 0 + } + } + if (aj.nodeType == 1 && aj.hasChildNodes()) { + af = aj.childNodes.length - 1; + aj = aj.childNodes[ae > af ? af : ae - 1]; + if (aj.nodeType == 3) { + ae = aj.nodeValue.length + } + } + if (H(Y.parentNode)) { + Y = Y.parentNode + } + if (H(Y)) { + Y = Y.nextSibling || Y + } + if (H(aj.parentNode)) { + ae = c.nodeIndex(aj); + aj = aj.parentNode + } + if (H(aj) && aj.previousSibling) { + aj = aj.previousSibling; + ae = aj.length + } + if (ag[0].inline) { + ac = ab(aj, ae); + if (ac.node) { + while (ac.node && ac.offset === 0 && ac.node.previousSibling) { + ac = ab(ac.node.previousSibling) + } + if (ac.node && ac.offset > 0 && ac.node.nodeType === 3 && ac.node.nodeValue.charAt(ac.offset - 1) === " ") { + if (ac.offset > 1) { + aj = ac.node; + aj.splitText(ac.offset - 1) + } else { + if (ac.node.previousSibling) { + aj = ac.node.previousSibling + } + } + } + } + } + if (ag[0].inline || ag[0].block_expand) { + Y = ah(Y, "firstChild", "nextSibling"); + aj = ah(aj, "lastChild", "previousSibling") + } + if (ag[0].selector && ag[0].expand !== S && !ag[0].inline) { + function aa(al, ak) { + var am, an, ap, ao; + if (al.nodeType == 3 && al.nodeValue.length == 0 && al[ak]) { + al = al[ak] + } + am = m(al); + for (an = 0; an < am.length; an++) { + for (ap = 0; ap < ag.length; ap++) { + ao = ag[ap]; + if ("collapsed" in ao && ao.collapsed !== W.collapsed) { + continue + } + if (c.is(am[an], ao.selector)) { + return am[an] + } + } + } + return al + } + Y = aa(Y, "previousSibling"); + aj = aa(aj, "nextSibling") + } + if (ag[0].block || ag[0].selector) { + function X(al, ak, an) { + var am; + if (!ag[0].wrapper) { + am = c.getParent(al, ag[0].block) + } + if (!am) { + am = c.getParent(al.nodeType == 3 ? al.parentNode : al, F) + } + if (am && ag[0].wrapper) { + am = m(am, "ul,ol").reverse()[0] || am + } + if (!am) { + am = al; + while (am[ak] && !F(am[ak])) { + am = am[ak]; + if (g(am, "br")) { + break + } + } + } + return am || al + } + Y = X(Y, "previousSibling"); + aj = X(aj, "nextSibling"); + if (ag[0].block) { + if (!F(Y)) { + Y = ah(Y, "firstChild", "nextSibling") + } + if (!F(aj)) { + aj = ah(aj, "lastChild", "previousSibling") + } + } + } + if (Y.nodeType == 1) { + ad = s(Y); + Y = Y.parentNode + } + if (aj.nodeType == 1) { + ae = s(aj) + 1; + aj = aj.parentNode + } + return { + startContainer: Y, + startOffset: ad, + endContainer: aj, + endOffset: ae + } + } + function U(ac, ab, Z, W) { + var Y, X, aa; + if (!h(Z, ac)) { + return S + } + if (ac.remove != "all") { + O(ac.styles, function(ae, ad) { + ae = r(ae, ab); + if (typeof(ad) === "number") { + ad = ae; + W = 0 + } + if (!W || g(L(W, ad), ae)) { + c.setStyle(Z, ad, "") + } + aa = 1 + }); + if (aa && c.getAttrib(Z, "style") == "") { + Z.removeAttribute("style"); + Z.removeAttribute("data-mce-style") + } + O(ac.attributes, function(af, ad) { + var ae; + af = r(af, ab); + if (typeof(ad) === "number") { + ad = af; + W = 0 + } + if (!W || g(c.getAttrib(W, ad), af)) { + if (ad == "class") { + af = c.getAttrib(Z, ad); + if (af) { + ae = ""; + O(af.split(/\s+/), function(ag) { + if (/mce\w+/.test(ag)) { + ae += (ae ? " " : "") + ag + } + }); + if (ae) { + c.setAttrib(Z, ad, ae); + return + } + } + } + if (ad == "class") { + Z.removeAttribute("className") + } + if (e.test(ad)) { + Z.removeAttribute("data-mce-" + ad) + } + Z.removeAttribute(ad) + } + }); + O(ac.classes, function(ad) { + ad = r(ad, ab); + if (!W || c.hasClass(W, ad)) { + c.removeClass(Z, ad) + } + }); + X = c.getAttribs(Z); + for (Y = 0; Y < X.length; Y++) { + if (X[Y].nodeName.indexOf("_") !== 0) { + return S + } + } + } + if (ac.remove != "none") { + n(Z, ac); + return B + } + } + function n(Y, Z) { + var W = Y.parentNode, + X; + if (Z.block) { + if (!l) { + function aa(ac, ab, ad) { + ac = C(ac, ab, ad); + return !ac || (ac.nodeName == "BR" || F(ac)) + } + if (F(Y) && !F(W)) { + if (!aa(Y, S) && !aa(Y.firstChild, B, 1)) { + Y.insertBefore(c.create("br"), Y.firstChild) + } + if (!aa(Y, B) && !aa(Y.lastChild, S, 1)) { + Y.appendChild(c.create("br")) + } + } + } else { + if (W == c.getRoot()) { + if (!Z.list_block || !g(Y, Z.list_block)) { + O(a.grep(Y.childNodes), function(ab) { + if (d(l, ab.nodeName.toLowerCase())) { + if (!X) { + X = N(ab, l) + } else { + X.appendChild(ab) + } + } else { + X = 0 + } + }) + } + } + } + } + if (Z.selector && Z.inline && !g(Z.inline, Y)) { + return + } + c.remove(Y, 1) + } + function C(X, W, Y) { + if (X) { + W = W ? "nextSibling" : "previousSibling"; + for (X = Y ? X : X[W]; X; X = X[W]) { + if (X.nodeType == 1 || !f(X)) { + return X + } + } + } + } + function H(W) { + return W && W.nodeType == 1 && W.getAttribute("data-mce-type") == "bookmark" + } + function u(aa, Z) { + var W, Y, X; + + function ac(af, ae) { + if (af.nodeName != ae.nodeName) { + return S + } + function ad(ah) { + var ai = {}; + O(c.getAttribs(ah), function(aj) { + var ak = aj.nodeName.toLowerCase(); + if (ak.indexOf("_") !== 0 && ak !== "style") { + ai[ak] = c.getAttrib(ah, ak) + } + }); + return ai + } + function ag(ak, aj) { + var ai, ah; + for (ah in ak) { + if (ak.hasOwnProperty(ah)) { + ai = aj[ah]; + if (ai === p) { + return S + } + if (ak[ah] != ai) { + return S + } + delete aj[ah] + } + } + for (ah in aj) { + if (aj.hasOwnProperty(ah)) { + return S + } + } + return B + } + if (!ag(ad(af), ad(ae))) { + return S + } + if (!ag(c.parseStyle(c.getAttrib(af, "style")), c.parseStyle(c.getAttrib(ae, "style")))) { + return S + } + return B + } + if (aa && Z) { + function ab(ae, ad) { + for (Y = ae; Y; Y = Y[ad]) { + if (Y.nodeType == 3 && Y.nodeValue.length !== 0) { + return ae + } + if (Y.nodeType == 1 && !H(Y)) { + return Y + } + } + return ae + } + aa = ab(aa, "previousSibling"); + Z = ab(Z, "nextSibling"); + if (ac(aa, Z)) { + for (Y = aa.nextSibling; Y && Y != Z;) { + X = Y; + Y = Y.nextSibling; + aa.appendChild(X) + } + c.remove(Z); + O(a.grep(Z.childNodes), function(ad) { + aa.appendChild(ad) + }); + return aa + } + } + return Z + } + function G(W) { + return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(W) + } + function J(X, aa) { + var W, Z, Y; + W = X[aa ? "startContainer" : "endContainer"]; + Z = X[aa ? "startOffset" : "endOffset"]; + if (W.nodeType == 1) { + Y = W.childNodes.length - 1; + if (!aa && Z) { + Z-- + } + W = W.childNodes[Z > Y ? Y : Z] + } + return W + } + function Q(ab, X, aa) { + var Y, W = P[ab], + ac = P[ab == "apply" ? "remove" : "apply"]; + + function ad() { + return P.apply.length || P.remove.length + } + function Z() { + P.apply = []; + P.remove = [] + } + function ae(af) { + O(P.apply.reverse(), function(ag) { + T(ag.name, ag.vars, af); + if (ag.name === "forecolor" && ag.vars.value) { + I(af.parentNode) + } + }); + O(P.remove.reverse(), function(ag) { + A(ag.name, ag.vars, af) + }); + c.remove(af, 1); + Z() + } + for (Y = W.length - 1; Y >= 0; Y--) { + if (W[Y].name == X) { + return + } + } + W.push({ + name: X, + vars: aa + }); + for (Y = ac.length - 1; Y >= 0; Y--) { + if (ac[Y].name == X) { + ac.splice(Y, 1) + } + } + if (ad()) { + V.getDoc().execCommand("FontName", false, "mceinline"); + P.lastRng = q.getRng(); + O(c.select("font,span"), function(ag) { + var af; + if (b(ag)) { + af = q.getBookmark(); + ae(ag); + q.moveToBookmark(af); + V.nodeChanged() + } + }); + if (!P.isListening && ad()) { + P.isListening = true; + O("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","), function(af) { + V[af].addToTop(function(ag, ah) { + if (ad() && !a.dom.RangeUtils.compareRanges(P.lastRng, q.getRng())) { + O(c.select("font,span"), function(aj) { + var ak, ai; + if (b(aj)) { + ak = aj.firstChild; + if (ak) { + ae(aj); + ai = c.createRng(); + ai.setStart(ak, ak.nodeValue.length); + ai.setEnd(ak, ak.nodeValue.length); + q.setRng(ai); + ag.nodeChanged() + } else { + c.remove(aj) + } + } + }); + if (ah.type == "keyup" || ah.type == "mouseup") { + Z() + } + } + }) + }) + } + } + } + } +})(tinymce); +tinymce.onAddEditor.add(function(e, a) { + var d, h, g, c = a.settings; + if (c.inline_styles) { + h = e.explode(c.font_size_style_values); + + function b(j, i) { + e.each(i, function(l, k) { + if (l) { + g.setStyle(j, k, l) + } + }); + g.rename(j, "span") + } + d = { + font: function(j, i) { + b(i, { + backgroundColor: i.style.backgroundColor, + color: i.color, + fontFamily: i.face, + fontSize: h[parseInt(i.size) - 1] + }) + }, + u: function(j, i) { + b(i, { + textDecoration: "underline" + }) + }, + strike: function(j, i) { + b(i, { + textDecoration: "line-through" + }) + } + }; + + function f(i, j) { + g = i.dom; + if (c.convert_fonts_to_spans) { + e.each(g.select("font,u,strike", j.node), function(k) { + d[k.nodeName.toLowerCase()](a.dom, k) + }) + } + } + a.onPreProcess.add(f); + a.onSetContent.add(f); + a.onInit.add(function() { + a.selection.onSetContent.add(f) + }) + } +}); diff --git a/js/tiny_mce/tiny_mce_popup.js b/js/tiny_mce/tiny_mce_popup.js new file mode 100644 index 000000000..f859d24e6 --- /dev/null +++ b/js/tiny_mce/tiny_mce_popup.js @@ -0,0 +1,5 @@ + +// Uncomment and change this document.domain value if you are loading the script cross subdomains +// document.domain = 'moxiecode.com'; + +var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write(' diff --git a/modules/authorizeaim/cards/ax.gif b/modules/authorizeaim/cards/ax.gif new file mode 100755 index 000000000..b39ff9cd7 Binary files /dev/null and b/modules/authorizeaim/cards/ax.gif differ diff --git a/modules/authorizeaim/cards/discover.gif b/modules/authorizeaim/cards/discover.gif new file mode 100755 index 000000000..b42b05cc9 Binary files /dev/null and b/modules/authorizeaim/cards/discover.gif differ diff --git a/modules/authorizeaim/cards/mastercard.gif b/modules/authorizeaim/cards/mastercard.gif new file mode 100755 index 000000000..2a869a1fc Binary files /dev/null and b/modules/authorizeaim/cards/mastercard.gif differ diff --git a/modules/authorizeaim/cards/visa.gif b/modules/authorizeaim/cards/visa.gif new file mode 100755 index 000000000..6f367c56a Binary files /dev/null and b/modules/authorizeaim/cards/visa.gif differ diff --git a/modules/authorizeaim/config.xml b/modules/authorizeaim/config.xml new file mode 100755 index 000000000..49a46920b --- /dev/null +++ b/modules/authorizeaim/config.xml @@ -0,0 +1,11 @@ + + + authorizeaim + Authorize.net AIM (Advanced Integration Method) + 1.0 + Receive payment with Authorize.net + + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/authorizeaim/cvv.png b/modules/authorizeaim/cvv.png new file mode 100644 index 000000000..5d4282c22 Binary files /dev/null and b/modules/authorizeaim/cvv.png differ diff --git a/modules/authorizeaim/de.php b/modules/authorizeaim/de.php new file mode 100755 index 000000000..a287c3c4c --- /dev/null +++ b/modules/authorizeaim/de.php @@ -0,0 +1,39 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Zahlung mit Authorize.net erhalten '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'In Ihrem PrestaShop Admin-Panel'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Füllen Sie das Login-ID-Feld mit der von Authorize.net vorgesehenen Kennung aus'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Füllen Sie das Schlüsselfeld mit dem Transaktionsschlüssel von Authorize.net aus'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cc225ca755efbef37b3003b7d9a8c2ba'] = 'Achtung: Ihre Webseite muss über ein SSL-Zertifikat verfügen, um das Authorize.net AIM Zahlungssystem nutzen zu können. Sie sind verantwortlich für die Sicherheit Ihrer Kundenbankdaten. PrestaShop kann nicht für Sicherheitsmängel auf Ihrer Webseite verantwortlich gemacht werden.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login-ID'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Schlüssel'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produktion'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Karten:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_4d605dabdeb09735219dac8ac7efa059'] = 'Fehler, überprüfen Sie bitte die Karteninformationen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Bezahlen Sie mit authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'Visa-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'MasterCard-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'Discover-Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'American Express Logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Sichere Kreditkartenzahlung mit Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Vollständiger Name'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Kartennummer'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Verfallsdatum'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_ce58a97a2e53c26ca877754187d48b34'] = 'die 3 letzten Ziffern auf der Rückseite Ihrer Kreditkarte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Bestellung bestätigen'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9286982d71addb45ad3a9472282f2c69'] = 'Ihre Kartennummer ist falsch'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = ' ist abgeschlossen.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben ein Problem bei Ihrer Bestellung festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; diff --git a/modules/authorizeaim/en.php b/modules/authorizeaim/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/authorizeaim/en.php @@ -0,0 +1,4 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recibir pagos con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'En su panel de PrestaShop admin'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Rellene el ID de campo con el proporcionado por Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Rellene el campo clave con la clave de operación facilitada por Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cc225ca755efbef37b3003b7d9a8c2ba'] = 'Atención: Su sitio web debe poseer un certificado SSL para utilizar el módulo Authorize.net AIM. Usted es responsable de la seguridad de los datos bancarios de sus clientes. PrestaShop no podrá ser responsable en caso de problemas de seguridad en su sitio web.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Nombre de usuario'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clave'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modo:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Prueba'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Tarjetas:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar la configuración'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_4d605dabdeb09735219dac8ac7efa059'] = 'Error, por favor compruebe sus datos bancarios'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Pagar con authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'visa logo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logotipo de MasterCard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'descubrir logotipo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'Logo American Express '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pago seguro con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nombre y apellidos'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Número de tarjeta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Fecha de caducidad'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_ce58a97a2e53c26ca877754187d48b34'] = 'los 3 últimos dígitos de la parte posterior de su tarjeta de crédito'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Validar el pedido'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9286982d71addb45ad3a9472282f2c69'] = 'Su número de tarjeta es erróneo'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido de'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'se ha completado.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Su pedido será enviado tan pronto como sea posible.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier duda o para más información, póngase en contacto con nuestro servicio de'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'atención al cliente'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos constatado un problema con su pedido. Si usted piensa que esto es un error, puede contactar con nuestro'; diff --git a/modules/authorizeaim/fr.php b/modules/authorizeaim/fr.php new file mode 100644 index 000000000..f96133644 --- /dev/null +++ b/modules/authorizeaim/fr.php @@ -0,0 +1,39 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Recevoir des paiments avec Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise a jour'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Dans votre panneau d\'aministration PrestaShop'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Indiquez le login avec celui fourni par Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Indiquez la clé avec la clé de transaction indiquée par Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cc225ca755efbef37b3003b7d9a8c2ba'] = 'Attention: votre site doit posséder un certificat SSL pour utiliser le module Authorize.net AIM. Vous êtes responsable de la sécurité des informations bancaires de vos clients. PrestaShop ne peut être tenu responsable en cas de problème de sécurité sur votre site.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Parametres'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'Login'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Clé'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Mode'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Cartes'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre a jour la configuration'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_4d605dabdeb09735219dac8ac7efa059'] = 'Erreur, veuillez verifier vos informations bancaires'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Payer avec AuthorizeAIM'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'logo visa'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logo mastercard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'logo discover'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'logo american express'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Paiement sécurisé avec Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nom'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numero de CB'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Date d\'expiration'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'Code CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_ce58a97a2e53c26ca877754187d48b34'] = 'les 3 derniers chifres au dos de votre carte'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Confirmer la commande'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9286982d71addb45ad3a9472282f2c69'] = 'Votre numero de CB est erroné'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'Est reussie'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Votre commende vous sera expedié le plus rapidement possible'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question, contactez nous'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Service client'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons remarqué une erreur avec votre commande. Si vous pensez que c\'est une erreur, vous pouvez contacter notre'; diff --git a/modules/authorizeaim/help.png b/modules/authorizeaim/help.png new file mode 100644 index 000000000..87f94c8f8 Binary files /dev/null and b/modules/authorizeaim/help.png differ diff --git a/modules/authorizeaim/hookorderconfirmation.tpl b/modules/authorizeaim/hookorderconfirmation.tpl new file mode 100755 index 000000000..bfc038f8e --- /dev/null +++ b/modules/authorizeaim/hookorderconfirmation.tpl @@ -0,0 +1,11 @@ +{if $status == 'ok'} +

        {l s='Your order on' mod='authorizeaim'} {$shop_name} {l s='is complete.' mod='authorizeaim'} +

        {l s='Your order will be sent as soon as possible.' mod='authorizeaim'} +

        {l s='For any questions or for further information, please contact our' mod='authorizeaim'} {l s='customer support' mod='authorizeaim'}. +

        +{else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='authorizeaim'} + {l s='customer support' mod='authorizeaim'}. +

        +{/if} \ No newline at end of file diff --git a/modules/authorizeaim/it.php b/modules/authorizeaim/it.php new file mode 100755 index 000000000..b80e8ceab --- /dev/null +++ b/modules/authorizeaim/it.php @@ -0,0 +1,39 @@ +authorizeaim_cb313e911b15b21b57f4fc7b53058e4f'] = 'Ricevi il pagamento con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_11a4b229c0e206b831f729572618553f'] = 'Nel tuo pannello admin PrestaShop'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_bc6781f2b59d4e973bd0075baab62a40'] = 'Riempi il campo ID Login con quello fornito da Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_95eb440b753d6505aad5c3f72b50eec9'] = 'Riempire il campo chiave con la chiave di transazione fornita da Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_cc225ca755efbef37b3003b7d9a8c2ba'] = 'Avvertenza: Il tuo sito web deve possedere un certificato SSL per utilizzare il sistema di pagamento AIM Authorize.net. Sei responsabile della sicurezza dei dati bancari dei tuoi clienti. PrestaShop non può essere ritenuto responsabile in caso di mancanza di sicurezza sul tuo sito.'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f3ef34226d51e9ca88eaa2f20d7ffb91'] = 'ID Login '; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_897356954c2cd3d41b221e3f24f99bba'] = 'Chiave'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_291cdb0a8abb42484f5d44dc20540ce6'] = 'Carte di credito:'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_4d605dabdeb09735219dac8ac7efa059'] = 'Errore, si prega di verificare le informazioni della carta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1814fc250eea61e13aa95e81b61bf72a'] = 'Paga con authorizeaim'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_442155d68aea78b4ef707796d76ca48c'] = 'logo visa'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f65943f43529e119969e533dc6f691f9'] = 'logo mastercard'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_2937b5dab08029b1055b37c98a98d740'] = 'logo discover'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_3b8a6fa58a71e7448c264c9dc61e6904'] = 'logo american express'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_1edaf23879c3b52a8df80069d2af3cef'] = 'Pagamento sicuro con carta di credito con Authorize.net'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_f11b368cddfe37c47af9b9d91c6ba4f0'] = 'Nome completo'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_a44217022190f5734b2f72ba1e4f8a79'] = 'Numero di carta'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_8c1279db4db86553e4b9682f78cf500e'] = 'Data di scadenza'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_60a104dc50579d60cbc90158fada1dcf'] = 'CVV'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_ce58a97a2e53c26ca877754187d48b34'] = 'le ultime 3 cifre sul retro della carta di credito'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_40566b26dcc126bce704f2c1d622a6a3'] = 'Convalida ordine'; +$_MODULE['<{authorizeaim}prestashop>authorizeaim_9286982d71addb45ad3a9472282f2c69'] = 'Il tuo numero di carta è falso'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{authorizeaim}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che questo sia un errore, contatta la nostra'; diff --git a/modules/authorizeaim/logo.gif b/modules/authorizeaim/logo.gif new file mode 100755 index 000000000..fcf31ce4a Binary files /dev/null and b/modules/authorizeaim/logo.gif differ diff --git a/modules/authorizeaim/logo_authorize.png b/modules/authorizeaim/logo_authorize.png new file mode 100755 index 000000000..d6f2b65f1 Binary files /dev/null and b/modules/authorizeaim/logo_authorize.png differ diff --git a/modules/authorizeaim/logoa.gif b/modules/authorizeaim/logoa.gif new file mode 100644 index 000000000..b5fc45290 Binary files /dev/null and b/modules/authorizeaim/logoa.gif differ diff --git a/modules/authorizeaim/secure.png b/modules/authorizeaim/secure.png new file mode 100755 index 000000000..206a133be Binary files /dev/null and b/modules/authorizeaim/secure.png differ diff --git a/modules/authorizeaim/validation.php b/modules/authorizeaim/validation.php new file mode 100755 index 000000000..23e93219b --- /dev/null +++ b/modules/authorizeaim/validation.php @@ -0,0 +1,87 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__). '/../../config/config.inc.php'); +include(dirname(__FILE__). '/../../init.php'); +include(dirname(__FILE__). '/authorizeaim.php'); + +/* Transform the POST from the template to a GET for the CURL */ +if (isset($_POST['x_exp_date']) && isset($_POST['x_exp_date_m']) && isset($_POST['x_exp_date_y']) && isset($_POST['x_exp_date_y']) && isset($_POST['name'])) +{ + $_POST['x_exp_date'] = $_POST['x_exp_date_m'].$_POST['x_exp_date_y']; + unset($_POST['x_exp_date_m']); + unset($_POST['x_exp_date_y']); + unset($_POST['name']); +} +$postString = ''; +foreach ($_POST AS $key => $value) + if ($key != "x_exp_date_m" OR $key != "x_exp_date_m") + $postString .= $key.'='.urlencode($value).'&'; +$postString .= 'x_exp_date='.str_pad($_POST["x_exp_date_m"], 2, "0",STR_PAD_LEFT).$_POST["x_exp_date_y"]; + +/* Do the CURL request ro Authorize.net */ +$request = curl_init( +Tools::getValue('x_test_request') ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll'); +curl_setopt($request, CURLOPT_HEADER, 0); +curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); +curl_setopt($request, CURLOPT_POSTFIELDS, $postString); +curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); +$postResponse = curl_exec($request); +curl_close($request); + +$response = explode('|', $postResponse); +if (!isset($response[7]) OR !isset($response[3]) OR !isset($response[9])) +{ + Logger::addLog('Authorize.net returned a malformed response for cart '.$response[7], 4); + die('Authorize.net returned a malformed response, aborted.'); +} + +if ($response[0] == 3) + Tools::redirect('order.php?step=3&aimerror=1'); +else +{ + /* Does the cart exist and is valid? */ + $cart = new Cart((int)$response[7]); + if (!Validate::isLoadedObject($cart)) + { + Logger::addLog('Cart loading failed for cart '.$response[7], 4); + exit; + } + + $customer = new Customer((int)$cart->id_customer); + + /* Loading the object */ + $authorizeaim = new authorizeaim(); + $message = $response[3]; + + if ($response[0] == 1) + $authorizeaim->validateOrder((int)$cart->id, _PS_OS_PAYMENT_, (float)$response[9], $authorizeaim->displayName, $message); + else + $authorizeaim->validateOrder((int)$cart->id, _PS_OS_ERROR_, (float)$response[9], $authorizeaim->displayName, $message); + + Tools::redirect('order-confirmation.php?id_module='.(int)$authorizeaim->id.'&id_cart='.(int)$cart->id.'&key='.$customer->secure_key); +} + diff --git a/modules/bankwire/bankwire.jpg b/modules/bankwire/bankwire.jpg new file mode 100644 index 000000000..8d11f391a Binary files /dev/null and b/modules/bankwire/bankwire.jpg differ diff --git a/modules/bankwire/bankwire.php b/modules/bankwire/bankwire.php new file mode 100644 index 000000000..b005ee010 --- /dev/null +++ b/modules/bankwire/bankwire.php @@ -0,0 +1,234 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BankWire extends PaymentModule +{ + private $_html = ''; + private $_postErrors = array(); + + public $details; + public $owner; + public $address; + + public function __construct() + { + $this->name = 'bankwire'; + $this->tab = 'payments_gateways'; + $this->version = '0.5'; + $this->author = 'PrestaShop'; + + $this->currencies = true; + $this->currencies_mode = 'checkbox'; + + $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS')); + if (isset($config['BANK_WIRE_OWNER'])) + $this->owner = $config['BANK_WIRE_OWNER']; + if (isset($config['BANK_WIRE_DETAILS'])) + $this->details = $config['BANK_WIRE_DETAILS']; + if (isset($config['BANK_WIRE_ADDRESS'])) + $this->address = $config['BANK_WIRE_ADDRESS']; + + parent::__construct(); + + $this->displayName = $this->l('Bank Wire'); + $this->description = $this->l('Accept payments by bank wire.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details?'); + if (!isset($this->owner) OR !isset($this->details) OR !isset($this->address)) + $this->warning = $this->l('Account owner and details must be configured in order to use this module correctly.'); + if (!sizeof(Currency::checkPaymentCurrencies($this->id))) + $this->warning = $this->l('No currency set for this module'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) + return false; + return true; + } + + public function uninstall() + { + if (!Configuration::deleteByName('BANK_WIRE_DETAILS') + OR !Configuration::deleteByName('BANK_WIRE_OWNER') + OR !Configuration::deleteByName('BANK_WIRE_ADDRESS') + OR !parent::uninstall()) + return false; + return true; + } + + private function _postValidation() + { + if (isset($_POST['btnSubmit'])) + { + if (empty($_POST['details'])) + $this->_postErrors[] = $this->l('Account details are required.'); + elseif (empty($_POST['owner'])) + $this->_postErrors[] = $this->l('Account owner is required.'); + } + } + + private function _postProcess() + { + if (isset($_POST['btnSubmit'])) + { + Configuration::updateValue('BANK_WIRE_DETAILS', $_POST['details']); + Configuration::updateValue('BANK_WIRE_OWNER', $_POST['owner']); + Configuration::updateValue('BANK_WIRE_ADDRESS', $_POST['address']); + } + $this->_html .= '
        '.$this->l('ok').' '.$this->l('Settings updated').'
        '; + } + + private function _displayBankWire() + { + $this->_html .= ''.$this->l('This module allows you to accept payments by bank wire.').'

        + '.$this->l('If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.').'
        + '.$this->l('Therefore, you must manually confirm the order as soon as you receive the wire.').'


        '; + } + + private function _displayForm() + { + $this->_html .= + '
        +
        + '.$this->l('Contact details').' + + + + + + + + + + + + +
        '.$this->l('Please specify the bank wire account details for customers').'.

        '.$this->l('Account owner').'
        '.$this->l('Details').' + +

        '.$this->l('Such as bank branch, IBAN number, BIC, etc.').'

        +
        '.$this->l('Bank address').' + +
        +
        +
        '; + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        '; + + if (!empty($_POST)) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= '
        '. $err .'
        '; + } + else + $this->_html .= '
        '; + + $this->_displayBankWire(); + $this->_displayForm(); + + return $this->_html; + } + + public function execPayment($cart) + { + if (!$this->active) + return ; + if (!$this->_checkCurrency($cart)) + Tools::redirectLink(__PS_BASE_URI__.'order.php'); + + global $cookie, $smarty; + + $smarty->assign(array( + 'nbProducts' => $cart->nbProducts(), + 'cust_currency' => $cart->id_currency, + 'currencies' => $this->getCurrency((int)$cart->id_currency), + 'total' => $cart->getOrderTotal(true, Cart::BOTH), + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + + return $this->display(__FILE__, 'payment_execution.tpl'); + } + + public function hookPayment($params) + { + if (!$this->active) + return ; + if (!$this->_checkCurrency($params['cart'])) + return ; + + global $smarty; + + $smarty->assign(array( + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + return $this->display(__FILE__, 'payment.tpl'); + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + global $smarty; + $state = $params['objOrder']->getCurrentState(); + if ($state == _PS_OS_BANKWIRE_ OR $state == _PS_OS_OUTOFSTOCK_) + $smarty->assign(array( + 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false), + 'bankwireDetails' => nl2br2($this->details), + 'bankwireAddress' => nl2br2($this->address), + 'bankwireOwner' => $this->owner, + 'status' => 'ok', + 'id_order' => $params['objOrder']->id + )); + else + $smarty->assign('status', 'failed'); + return $this->display(__FILE__, 'payment_return.tpl'); + } + + private function _checkCurrency($cart) + { + $currency_order = new Currency((int)($cart->id_currency)); + $currencies_module = $this->getCurrency((int)$cart->id_currency); + $currency_default = Configuration::get('PS_CURRENCY_DEFAULT'); + + if (is_array($currencies_module)) + foreach ($currencies_module AS $currency_module) + if ($currency_order->id == $currency_module['id_currency']) + return true; + } +} diff --git a/modules/bankwire/config.xml b/modules/bankwire/config.xml new file mode 100755 index 000000000..d81881265 --- /dev/null +++ b/modules/bankwire/config.xml @@ -0,0 +1,12 @@ + + + bankwire + Bank Wire + 0.5 + Accept payments by bank wire. + PrestaShop + payments_gateways + Are you sure you want to delete your details? + 1 + 1 + \ No newline at end of file diff --git a/modules/bankwire/de.php b/modules/bankwire/de.php new file mode 100644 index 000000000..cda0c6313 --- /dev/null +++ b/modules/bankwire/de.php @@ -0,0 +1,54 @@ +bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Banküberweisung'; +$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Zahlungen per Banküberweisung annehmen'; +$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sind Sie sicher, dass Sie Ihre Details löschen möchten?'; +$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Kontoinhaber und Details müssen konfiguriert werden, um dieses Modul korrekt zu nutzen'; +$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Keine Währung für dieses Modul eingestellt'; +$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Konto-Details erforderlich.'; +$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Kontoinhaber erforderlich.'; +$_MODULE['<{bankwire}prestashop>bankwire_444bcb3a3fcf8389296c49467f27e1d6'] = 'ok'; +$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Dieses Modul ermöglicht Ihnen Zahlungen per Banküberweisung.'; +$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Wenn der Kunde diese Zahlungsmethode wählt, wird der Bestellstatus auf \"Wartet auf Zahlung\" umgestellt. '; +$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Aus diesem Grund müssen Sie die Bestellung manuell bestätigen, sobald Sie die Überweisung erhalten.'; +$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Kontaktdetails'; +$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Bitte spezifizieren Sie die Bankverbindungsdetails für Kunden.'; +$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Kontoinhaber'; +$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Details'; +$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'wie Zweigstelle, IBAN-Nummer, BIC, etc.'; +$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Bankadresse'; +$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen'; +$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Zahlung per Banküberweisung'; +$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Zahlung per Banküberweisung (längerer Bestellvorgang)'; +$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Zahlung per Banküberweisung'; +$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Bestellübersicht'; +$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Ihr Warenkorb ist leer.'; +$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'Banküberweisung'; +$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Sie möchten per Banküberweisung zahlen.'; +$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Hier ist eine kurze Übersicht über Ihre Bestellung.'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; +$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(inkl. Steuern)'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Wir nehmen bestimmte Währungen per Banküberweisung an.'; +$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Bitte wählen Sie eine aus:'; +$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Wir nehmen folgende Währung per Banküberweisung an:'; +$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Die Kontoinformationen zur Banküberweisung stehen auf der folgenden Seite.'; +$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung, indem Sie auf \"Ich bestätige meine Bestellung\" klicken'; +$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; +$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; +$_MODULE['<{bankwire}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{bankwire}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist vollständig.'; +$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Bitte senden Sie uns folgenden Betrag per Banküberweisung:'; +$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'Betrag'; +$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'an den Kontoinhaber von'; +$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'mit dieser Bankverbindung'; +$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'an diese Bank'; +$_MODULE['<{bankwire}prestashop>payment_return_4fac1f51a5f4b3dd634800fe3d408a45'] = 'Bitte denken Sie daran, Ihre Bestellnummer einzugeben '; +$_MODULE['<{bankwire}prestashop>payment_return_4460fcb45ad7a6a61c95293eb611da12'] = 'in den Betreff Ihrer Banküberweisung'; +$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Sie haben eine E-Mail mit diesen Informationen erhalten.'; +$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Ihre Bestellung wird abgesendet, sobald wir Ihre Überweisung erhalten haben.'; +$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oderfür weitere Informationen kontaktieren Sie bitte unseren'; +$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kundendienst'; +$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Bei Ihrer Bestellung ist ein Problem aufgetreten. Wenn Sie denken, dass dies ein Fehler ist, können Sie unseren kontaktieren'; diff --git a/modules/bankwire/en.php b/modules/bankwire/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/bankwire/en.php @@ -0,0 +1,4 @@ +bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Trasferencia bancaria'; +$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Se aceptan pagos por trasferencia bancaria'; +$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = '¿Está seguro de querer borrar los detalles?'; +$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'El propietario y detalles de la cuenta deben configurarse para usar el módulo correctamente'; +$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'No hay moneda asignada a este módulo'; +$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'se necesitan los detalles de la cuenta.'; +$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Se necesita el propietario de la cuenta.'; +$_MODULE['<{bankwire}prestashop>bankwire_444bcb3a3fcf8389296c49467f27e1d6'] = 'ok'; +$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'configuración actualizada'; +$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Este módulo permite aceptar pagos por trasferencia bancaria.'; +$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'si el cliente elije este modo de pago, el pedido cambiará su estado a \"pendiente de pago\".'; +$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Por lo tanto, deberá confirmar el pedido en cuanto reciba la trasferencia.'; +$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Detalles contacto'; +$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Por favor, especifique los detalles de la cuenta para sus clientes'; +$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Propietario de la cuenta'; +$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Detalles'; +$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'tales como: sucursal bancaria, código IBAN, BIC, etc.'; +$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Dirección agencia bancaria'; +$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar configuración'; +$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Pago por transferencia bancaria'; +$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Pago por transferencia bancaria (el proceso llevará más tiempo)'; +$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Pago por transferencia bancaria'; +$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Resumen del pedido'; +$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Su carrito está vacío.'; +$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'Transferencia bancaria'; +$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Ha elegido pagar por transferencia bancaria'; +$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Aquí tiene un resumen de su pedido:'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es'; +$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'IVA incluído'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Aceptamos diferentes monedas para la transferencia bancaria.'; +$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'elija una de las siguientes:'; +$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Aceptamos las siguientes monedas para las transferencias bancarias:'; +$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'La información para realizar la trasferencia bancaria aparecerá en la página siguiente.'; +$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Por favor, acepte su pedido haciendo clic en \'confirmo mi pedido\''; +$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Otros modos de pago'; +$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confirmo mi pedido'; +$_MODULE['<{bankwire}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido'; +$_MODULE['<{bankwire}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'está completo.'; +$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'por favor, háganos una transferencia por:'; +$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un importe de'; +$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'al propietario de la cuenta'; +$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'con los siguientes datos'; +$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'a este banco'; +$_MODULE['<{bankwire}prestashop>payment_return_4fac1f51a5f4b3dd634800fe3d408a45'] = 'No se olvide añadir su pedido #'; +$_MODULE['<{bankwire}prestashop>payment_return_4460fcb45ad7a6a61c95293eb611da12'] = 'en el objeto de su transferencia'; +$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Le hemos enviado un email con esta información.'; +$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Su pedido será enviado próximamente, en cuanto recibamos su pago.'; +$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier duda, por favor contacte con nosotros'; +$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'atención al cliente'; +$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos detectado un problema con su pedido. Si considera que hay un error, por favor, contacte con nosotros'; diff --git a/modules/bankwire/fr.php b/modules/bankwire/fr.php new file mode 100644 index 000000000..c44bb2bb1 --- /dev/null +++ b/modules/bankwire/fr.php @@ -0,0 +1,54 @@ +bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Virement Bancaire'; +$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Accepter les paiements par virement'; +$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Êtes-vous certain de vouloir effacer vos données ?'; +$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Le titulaire du compte et les informations bancaires doivent être configurés'; +$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Aucune devise disponible pour ce module'; +$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Les détails du compte sont requis'; +$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Le titulaire du compte est requis.'; +$_MODULE['<{bankwire}prestashop>bankwire_444bcb3a3fcf8389296c49467f27e1d6'] = 'ok'; +$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie'; +$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Ce module vous permet d\'accepter les paiements par virement bancaire.'; +$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Si le client choisit ce mode de paiement, la commande sera en statut \"Paiement en attente\"'; +$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Par conséquent, vous devez confirmer manuellement la commande dès que vous recevrez le virement.'; +$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Coordonnées'; +$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Merci de spécifier les détails du compte en banque pour les clients'; +$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Titulaire'; +$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; +$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Comme le code banque, l\'IBAN ou encore le BIC'; +$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Adresse de la banque'; +$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; +$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Payer par virement bancaire'; +$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Payer par virement bancaire (traitement plus long)'; +$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Paiement par virement bancaire'; +$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande'; +$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.'; +$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'virement bancaire'; +$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Vous avez choisi de régler par virement bancaire.'; +$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un bref récapitulatif de votre commande :'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; +$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Nous acceptons plusieurs devises pour votre virement.'; +$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Merci de choisir parmi les suivantes :'; +$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Nous acceptons la devise suivante pour votre paiement :'; +$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Nos coordonnées bancaires seront affichées sur la page suivante.'; +$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; +$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; +$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; +$_MODULE['<{bankwire}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{bankwire}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'a bien été enregistrée.'; +$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Merci de nous envoyer un virement bancaire avec :'; +$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un montant de'; +$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'à l\'ordre de'; +$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'suivant ces détails'; +$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'à cette banque'; +$_MODULE['<{bankwire}prestashop>payment_return_4fac1f51a5f4b3dd634800fe3d408a45'] = 'N\'oubliez pas d\'indiquer votre numéro de commande'; +$_MODULE['<{bankwire}prestashop>payment_return_4460fcb45ad7a6a61c95293eb611da12'] = 'dans le sujet de votre virement'; +$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Un email contenant ces informations vous a été envoyé.'; +$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Votre commande sera expédiée dès réception de votre virement.'; +$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire merci de contacter notre'; +$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client'; +$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons rencontré un problème avec votre commande. Merci de prendre contact avec notre support client'; diff --git a/modules/bankwire/it.php b/modules/bankwire/it.php new file mode 100644 index 000000000..0f1fa4e88 --- /dev/null +++ b/modules/bankwire/it.php @@ -0,0 +1,54 @@ +bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Bonifico Bancario'; +$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Accetto pagamenti tramite bonifico bancario'; +$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Il proprietario dell\'account e i dati devono essere configurati per usare questo modulo correttamente'; +$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nessuna valuta impostata per questo modulo'; +$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = ' i dati dell\'account sono obbligatori.'; +$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Il proprietario dell\'account è obbligatorio.'; +$_MODULE['<{bankwire}prestashop>bankwire_444bcb3a3fcf8389296c49467f27e1d6'] = 'ok'; +$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Questo modulo ti permette di accettare pagamenti tramite bonifico bancario.'; +$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Se il cliente sceglie questa modalità di pagamento, l\'ordine cambierà il proprio status in \'attesa di pagamento\'.'; +$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Pertanto, dovrai confermare l\'ordine non appena ricevi il bonifico'; +$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Dati di contatto'; +$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Specifica i dati del bonifico bancario per i clienti'; +$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Intestatario del conto'; +$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Dati'; +$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Come filiale della banca, codice IBAN, BIC, ecc'; +$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Indirizzo della banca'; +$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; +$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Paga con bonifico bancario'; +$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Paga con bonifico bancario (l\'elaborazione dell\'ordine sarà più lunga)'; +$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Pagamento bonifico bancario'; +$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Sintesi dell\'ordine'; +$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Il carrello è vuoto.'; +$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'bonifico bancario'; +$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Hai scelto di pagare con bonifico bancario.'; +$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Ecco un breve riepilogo del tuo ordine:'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; +$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Si accettano le valute diverse da inviare tramite bonifico bancario.'; +$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Scegli una delle seguenti:'; +$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Accettiamo le seguente valute da inviare tramite bonifico bancario:'; +$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Le informazioni sul conto corrente saranno visualizzate nella pagina successiva.'; +$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Conferma l\'ordine cliccando su \'confermo il mio ordine\''; +$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; +$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; +$_MODULE['<{bankwire}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine sul'; +$_MODULE['<{bankwire}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completa.'; +$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Inviaci un bonifico bancario con:'; +$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un importo di'; +$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'al proprietario del conto'; +$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'con questi dati'; +$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'a questa banca'; +$_MODULE['<{bankwire}prestashop>payment_return_4fac1f51a5f4b3dd634800fe3d408a45'] = 'Ricorda di inserire il tuo n. di ordine '; +$_MODULE['<{bankwire}prestashop>payment_return_4460fcb45ad7a6a61c95293eb611da12'] = 'nella causale del tuo bonifico bancario'; +$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Ti è stata inviata una e-mail con queste informazioni.'; +$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Il tuo ordine verrà inviato non appena avremo ricevuto la tua transazione.'; +$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, puoi contattare il nostro'; diff --git a/modules/bankwire/logo.gif b/modules/bankwire/logo.gif new file mode 100644 index 000000000..2cd6cec1b Binary files /dev/null and b/modules/bankwire/logo.gif differ diff --git a/modules/bankwire/payment.php b/modules/bankwire/payment.php new file mode 100644 index 000000000..fefc3279a --- /dev/null +++ b/modules/bankwire/payment.php @@ -0,0 +1,41 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/bankwire.php'); + +if (!$cookie->isLogged(true)) + Tools::redirect('authentication.php?back=order.php'); +$bankwire = new BankWire(); +echo $bankwire->execPayment($cart); + +include_once(dirname(__FILE__).'/../../footer.php'); + diff --git a/modules/bankwire/payment.tpl b/modules/bankwire/payment.tpl new file mode 100644 index 000000000..a13f435ea --- /dev/null +++ b/modules/bankwire/payment.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay by bank wire' mod='bankwire'} + {l s='Pay by bank wire (order process will be longer)' mod='bankwire'} + +

        \ No newline at end of file diff --git a/modules/bankwire/payment_execution.tpl b/modules/bankwire/payment_execution.tpl new file mode 100644 index 000000000..b506447cc --- /dev/null +++ b/modules/bankwire/payment_execution.tpl @@ -0,0 +1,80 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Bank wire payment' mod='bankwire'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Order summary' mod='bankwire'}

        + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +{if $nbProducts <= 0} +

        {l s='Your shopping cart is empty.'}

        +{else} + +

        {l s='Bank wire payment' mod='bankwire'}

        +
        +

        + {l s='bank wire' mod='bankwire'} + {l s='You have chosen to pay by bank wire.' mod='bankwire'} +

        + {l s='Here is a short summary of your order:' mod='bankwire'} +

        +

        + - {l s='The total amount of your order is' mod='bankwire'} + {displayPrice price=$total} + {if $use_taxes == 1} + {l s='(tax incl.)' mod='bankwire'} + {/if} +

        +

        + - + {if $currencies|@count > 1} + {l s='We accept several currencies to be sent by bank wire.' mod='bankwire'} +

        + {l s='Choose one of the following:' mod='bankwire'} + + {else} + {l s='We accept the following currency to be sent by bank wire:' mod='bankwire'} {$currencies.0.name} + + {/if} +

        +

        + {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'} +

        + {l s='Please confirm your order by clicking \'I confirm my order\'' mod='bankwire'}. +

        +

        + {l s='Other payment methods' mod='bankwire'} + +

        +
        +{/if} diff --git a/modules/bankwire/payment_return.tpl b/modules/bankwire/payment_return.tpl new file mode 100644 index 000000000..322c8d9f9 --- /dev/null +++ b/modules/bankwire/payment_return.tpl @@ -0,0 +1,45 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $status == 'ok'} +

        {l s='Your order on' mod='bankwire'} {$shop_name} {l s='is complete.' mod='bankwire'} +

        + {l s='Please send us a bank wire with:' mod='bankwire'} +

        - {l s='an amount of' mod='bankwire'} {$total_to_pay} +

        - {l s='to the account owner of' mod='bankwire'} {if $bankwireOwner}{$bankwireOwner}{else}___________{/if} +

        - {l s='with these details' mod='bankwire'} {if $bankwireDetails}{$bankwireDetails}{else}___________{/if} +

        - {l s='to this bank' mod='bankwire'} {if $bankwireAddress}{$bankwireAddress}{else}___________{/if} +

        - {l s='Do not forget to insert your order #' mod='bankwire'} {$id_order} {l s='in the subject of your bank wire' mod='bankwire'} +

        {l s='An e-mail has been sent to you with this information.' mod='bankwire'} +

        {l s='Your order will be sent as soon as we receive your settlement.' mod='bankwire'} +

        {l s='For any questions or for further information, please contact our' mod='bankwire'} {l s='customer support' mod='bankwire'}. +

        +{else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='bankwire'} + {l s='customer support' mod='bankwire'}. +

        +{/if} diff --git a/modules/bankwire/validation.php b/modules/bankwire/validation.php new file mode 100644 index 000000000..1ca4705c0 --- /dev/null +++ b/modules/bankwire/validation.php @@ -0,0 +1,52 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/bankwire.php'); + +$bankwire = new BankWire(); + +if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$customer = new Customer((int)$cart->id_customer); + +if (!Validate::isLoadedObject($customer)) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$currency = new Currency((int)(isset($_POST['currency_payement']) ? $_POST['currency_payement'] : $cookie->id_currency)); +$total = (float)($cart->getOrderTotal(true, Cart::BOTH)); +$mailVars = array( + '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), + '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), + '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) +); + +$bankwire->validateOrder($cart->id, _PS_OS_BANKWIRE_, $total, $bankwire->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key); +$order = new Order($bankwire->currentOrder); +Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key); diff --git a/modules/birthdaypresent/birthdaypresent.php b/modules/birthdaypresent/birthdaypresent.php new file mode 100644 index 000000000..56d65ba32 --- /dev/null +++ b/modules/birthdaypresent/birthdaypresent.php @@ -0,0 +1,146 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BirthdayPresent extends Module +{ + private $_html = ''; + + function __construct() + { + $this->name = 'birthdaypresent'; + $this->tab = 'pricing_promotion'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Birthday Present'); + $this->description = $this->l('Offer your clients birthday presents automatically'); + } + + public function getContent() + { + global $cookie, $currentIndex; + + if (Tools::isSubmit('submitBirthday')) + { + Configuration::updateValue('BIRTHDAY_ACTIVE', (int)(Tools::getValue('bp_active'))); + Configuration::updateValue('BIRTHDAY_DISCOUNT_TYPE', (int)(Tools::getValue('id_discount_type'))); + Configuration::updateValue('BIRTHDAY_DISCOUNT_VALUE', (float)(Tools::getValue('discount_value'))); + Configuration::updateValue('BIRTHDAY_MINIMAL_ORDER', (float)(Tools::getValue('minimal_order'))); + Tools::redirectAdmin($currentIndex.'&configure=birthdaypresent&token='.Tools::getValue('token').'&conf=4'); + } + + $this->_html = ' +
        '.$this->displayName.' +

        '.$this->l('Create a voucher for customers celebrating their birthday and having at least one valid order').'

        +
        + +
        + + +

        '.$this->l('Additionally, you have to set a CRON rule which calls the file').'
        '.Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/birthdaypresent/cron.php '.$this->l('every day').'

        +
        + +
        + +
        + +
        + +

        '.$this->l('Either the monetary amount or the %, depending on Type selected above').'

        +
        + +
        + +

        '.$this->l('The minimum order amount needed to use the voucher').'

        +
        +
        + +
        +
        * '.$this->l('Required field').'
        +
        +

        +
        '.$this->l('Guide').' +

        '.$this->l('Develop clients\' loyalty').'

        +

        '.$this->l('Offering a present to a client is a means of securing their loyalty.').'

        +

        '.$this->l('What should you do?').'

        +

        + '.$this->l('Keeping a client is more profitable than capturing a new one. Thus, it is necessary to develop their loyalty, in other words to make them want to come back to your webshop.').'
        + '.$this->l('Word of mouth is also a means to get new satisfied clients; a dissatisfied one won\'t attract new clients.').'
        + '.$this->l('In order to achieve this goal you can organize: ').' +

          +
        • '.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback...).').'
        • +
        • '.$this->l('Sustainable operations: loyalty or points cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).').'
        • +
        + '.$this->l('These operations encourage clients to buy and also to come back to your webshop regularly.').'
        +

        +
        '; + return $this->_html; + } + + public function createTodaysVouchers() + { + $users = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT c.id_customer, firstname, lastname, email + FROM '._DB_PREFIX_.'customer c + LEFT JOIN '._DB_PREFIX_.'orders o ON (c.id_customer = o.id_customer) + WHERE o.valid = 1 + AND c.birthday LIKE \'%'.date('-m-d').'\''); + + foreach ($users as $user) + { + $voucher = new Discount(); + $voucher->id_customer = (int)($user['id_customer']); + $voucher->id_discount_type = (int)(Configuration::get('BIRTHDAY_DISCOUNT_TYPE')); + $voucher->name = 'BIRTHDAY-'.(int)($voucher->id_customer).'-'.date('Y'); + $voucher->description[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Your birthday present !'); + $voucher->value = Configuration::get('BIRTHDAY_DISCOUNT_VALUE'); + $voucher->quantity = 1; + $voucher->quantity_per_user = 1; + $voucher->cumulable = 1; + $voucher->cumulable_reduction = 1; + $voucher->date_from = date('Y-m-d'); + $voucher->date_to = strftime('%Y-%m-%d', strtotime('+1 month')); + $voucher->minimal = Configuration::get('BIRTHDAY_MINIMAL_ORDER'); + $voucher->active = true; + if ($voucher->add()) + Mail::Send((int)(Configuration::get('PS_LANG_DEFAULT')), 'birthday', Mail::l('Happy birthday!'), array('{firstname}' => $user['firstname'], '{lastname}' => $user['lastname']), $user['email'], NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + else + echo Db::getInstance()->getMsgError(); + } + } +} + diff --git a/modules/birthdaypresent/comment.gif b/modules/birthdaypresent/comment.gif new file mode 100644 index 000000000..7bc9233ea Binary files /dev/null and b/modules/birthdaypresent/comment.gif differ diff --git a/modules/birthdaypresent/config.xml b/modules/birthdaypresent/config.xml new file mode 100755 index 000000000..4b9fbadce --- /dev/null +++ b/modules/birthdaypresent/config.xml @@ -0,0 +1,11 @@ + + + birthdaypresent + Birthday Present + 1 + Offer your clients birthday presents automatically + PrestaShop + pricing_promotion + 1 + 1 + \ No newline at end of file diff --git a/modules/birthdaypresent/cron.php b/modules/birthdaypresent/cron.php new file mode 100644 index 000000000..7a48e4b70 --- /dev/null +++ b/modules/birthdaypresent/cron.php @@ -0,0 +1,40 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/birthdaypresent.php'); + +if (!Configuration::get('BIRTHDAY_ACTIVE')) + die ('Birthday present not active'); +if (Configuration::get('BIRTHDAY_DATE_UPD') == date('Y-m-d')) + die ('Birthday already wished'); +Configuration::updateValue('BIRTHDAY_DATE_UPD', date('Y-m-d')); +$module = new BirthdayPresent(); +$module->createTodaysVouchers(); +die ('OK'); + diff --git a/modules/birthdaypresent/de.php b/modules/birthdaypresent/de.php new file mode 100644 index 000000000..e811f1d5d --- /dev/null +++ b/modules/birthdaypresent/de.php @@ -0,0 +1,25 @@ +birthdaypresent_c2796655c25e1b0b8582716036aece08'] = 'Geburtstagsgeschenk'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d1f5899bf2af57ed816390d9d740daf6'] = 'Senden Sie Ihren Kunden automatisch ein Geburtstagsgeschenk'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_52292d2f9c39936bc72fbd47a3060df3'] = 'Sie müssen zusätzlich eine cron-Regel einstellen, die die Datei aufruft'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f7e78e04cba74c610354e91e622cc105'] = 'jeden Tag'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Typ'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_689202409e48743b914713f96d93947c'] = 'Wert'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_998d08a9606f9656e8d1fcab8b762155'] = 'Entweder den Geldbetrag oder den Prozentsatz, je nach oben ausgewähltem Typ'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_1f0084a1581c05622120bd827305f173'] = 'Mindestbestellung'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_783d0f2960c7c628177f740ce38ec3e7'] = 'Mindestbestellwert, um den Gutschein nutzen zu können'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38fb7d24e0d60a048f540ecb18e13376'] = 'Speichern'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_19f823c6453c2b1ffd09cb715214813d'] = 'Pflichtfeld'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_6602bbeb2956c035fb4cb5e844a4861b'] = 'Führer'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_cb21e843b037359d0fb5b793fccf964f'] = 'Kundenbindung ausbauen'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d725bab433ae44aee759eb82a24b09de'] = 'Kundengeschenke sind ein Mittel zur Kundenbindung.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_0dc42f38b35e45090e1a1c94755c2d43'] = 'Was müssen Sie tun?'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a3729d34db57cdeabe59a1fe78644458'] = 'Einen Kunden zu behalten ist rentabler als einen Neukunden zu akquirieren. Dazyu ist es notwendig, ihre Loyalität auszubauen, oder anders gesagt, sie dazu zu bringen, dass sie zu Ihrem Webshop zurückkehren möchten.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_7b6ac3f2cdb42a4462ff7ca3c4358f71'] = 'Ein guter Ruf ist ebenso ein Mittel, zufriedene Kunden zu bekommen; ein unzufriedener Kunde zieht keine Neukunden an.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_410008089d5bb723438103a84d48a59c'] = 'Um dieses Ziel zu erreichen, können Sie Folgendes organisieren:'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_3e788301a1b0ce341aa5ce15bc520545'] = 'Punktuelle Aktionen: kommerzielle Vergünstigungen (persönliche Sonderangebote, Gratis-Produkte oder -Services), nicht-kommerzielle Vergütungen (bevorzugte Behandlung einer Bestellung oder eines Produkts), geldliche Vergünstigungen (Gutscheine, Ermäßigungsgutscheine, PayBack...)'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f299b58558601a85c98a2d1d7867d523'] = 'Nachhaltige Aktionen: Treue- oder Kundenkarte, die nicht nur der Kommunikation zwischen Händler und Kunden dient, sondern Kunden auch Vorteile bietet (Persönliche Angebote, Ermäßigungen).'; diff --git a/modules/birthdaypresent/en.php b/modules/birthdaypresent/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/birthdaypresent/en.php @@ -0,0 +1,4 @@ +birthdaypresent_c2796655c25e1b0b8582716036aece08'] = 'Regalo de cumpleaños'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d1f5899bf2af57ed816390d9d740daf6'] = 'Haga a sus clientes regalos de cumpleaños automáticamente'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_42f95f1b218dda65c23c52fcb205f1ed'] = 'Cree un vale descuento para los clientes que celebren su cumpleaños y que pueda usarse una sola vez'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_52292d2f9c39936bc72fbd47a3060df3'] = 'Adicionalemente, debe establecer una regla CRON que pida el archivo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f7e78e04cba74c610354e91e622cc105'] = 'todos los días'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_689202409e48743b914713f96d93947c'] = 'Valor'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_998d08a9606f9656e8d1fcab8b762155'] = 'cantidad monetaria o porcentaje dependiendo del tipo seleccionado anteriormente'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_1f0084a1581c05622120bd827305f173'] = 'Pedido mínimo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_783d0f2960c7c628177f740ce38ec3e7'] = 'Cantidad de pedido mínimo para utilizar el vale'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38fb7d24e0d60a048f540ecb18e13376'] = 'Guardar'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_19f823c6453c2b1ffd09cb715214813d'] = 'Archivo necesario'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_cb21e843b037359d0fb5b793fccf964f'] = 'Desarrolle la fidelización de sus clientes'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d725bab433ae44aee759eb82a24b09de'] = 'Haciendo regalos a sus clientes está seguro de fidelizarlos.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_0dc42f38b35e45090e1a1c94755c2d43'] = '¿Cómo hacer?'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a3729d34db57cdeabe59a1fe78644458'] = 'Conservar un cliente es más ventajoso que captar uno nuevo. Así, es necesario desarrollar su lealtad, es decir hacer todo lo posible para que vuelva a su tienda.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_7b6ac3f2cdb42a4462ff7ca3c4358f71'] = 'El boca a boca es uno de los mejores métodos para conseguir nuevos clientes satisfechos; un cliente contento atraerá otros nuevos clientes.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_410008089d5bb723438103a84d48a59c'] = 'Para alcanzar este objetivo usted puede organizar:'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_3e788301a1b0ce341aa5ce15bc520545'] = 'Operaciones puntuales: recompensas comerciales (ofertas especiales personalizadas, producto o servicios ofrecidos), recompensas no comerciales (prioridad en el envío de un pedido o de un producto), recompensas pecuniarias (enlaces, cupones del descuento, prioridad en el reembolso...).'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f299b58558601a85c98a2d1d7867d523'] = 'Operaciones sostenibles: las tarjetas de fidelidad o de puntos, que no sólo justifican la comunicación entre el comerciante y el cliente, pero también ofrecen ventajas a los clientes (ofertas, descuentos privados).'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Estas operaciones animan a los clientes a comprar y también a volver a la tienda virtual regularmente.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38241c5ab16ef8f1ba73460ecd0469e8'] = '¡Su regalo de cumpleaños!'; diff --git a/modules/birthdaypresent/fr.php b/modules/birthdaypresent/fr.php new file mode 100644 index 000000000..33811254b --- /dev/null +++ b/modules/birthdaypresent/fr.php @@ -0,0 +1,25 @@ +birthdaypresent_c2796655c25e1b0b8582716036aece08'] = 'Cadeau d\'anniversaire'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d1f5899bf2af57ed816390d9d740daf6'] = 'Offrez automatiquement à vos clients des cadeaux d\'anniversaire'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Actif'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_52292d2f9c39936bc72fbd47a3060df3'] = 'De plus, vous devez installer une règle CRON qui appellera le fichier'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f7e78e04cba74c610354e91e622cc105'] = 'chaque jour'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Type'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_689202409e48743b914713f96d93947c'] = 'Valeur'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_998d08a9606f9656e8d1fcab8b762155'] = 'Soit le montant soit le pourcentage selon votre choix précédent'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_1f0084a1581c05622120bd827305f173'] = 'Commande minimum'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_783d0f2960c7c628177f740ce38ec3e7'] = 'Montant minimum de la commande pour que le bon soit utilisable'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38fb7d24e0d60a048f540ecb18e13376'] = 'Sauvegarder'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_19f823c6453c2b1ffd09cb715214813d'] = 'Champ requis'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_cb21e843b037359d0fb5b793fccf964f'] = 'Fidéliser le client'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d725bab433ae44aee759eb82a24b09de'] = 'Offrir un cadeau d\'anniversaire à un client est une manière comme une autre d\'agir sur sa fidélité.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_0dc42f38b35e45090e1a1c94755c2d43'] = 'Que faire ?'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a3729d34db57cdeabe59a1fe78644458'] = 'Garder un client est plus rentable que d’en conquérir un nouveau. Il est donc impératif de le fidéliser, c\'est-à-dire de le faire revenir sur votre boutique. '; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_7b6ac3f2cdb42a4462ff7ca3c4358f71'] = 'Le bouche à oreille est également un moyen d\'avoir de nouveaux clients satisfaits ; car un client non satisfait n\'en attirera pas de nouveaux. '; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_410008089d5bb723438103a84d48a59c'] = 'Pour y parvenir, plusieurs moyens existent :'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_3e788301a1b0ce341aa5ce15bc520545'] = 'Les opérations ponctuelles : les récompenses marchandes (offres promotionnelles ciblées et personnalisées, cadeaux -produit ou service offert-), les récompenses non marchandes (traitement prioritaire d\'une commande ou d\'un produit), les récompenses pécuniaires (bons d\'achat, de réduction, de remboursement). '; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f299b58558601a85c98a2d1d7867d523'] = 'Les opérations pérennes : (carte de fidélité, points de fidélité) qui non seulement justifient la communication marchand-clients, et aussi offre des avantages aux clients (offres privatives, réductions).'; diff --git a/modules/birthdaypresent/it.php b/modules/birthdaypresent/it.php new file mode 100644 index 000000000..8a18f4b64 --- /dev/null +++ b/modules/birthdaypresent/it.php @@ -0,0 +1,28 @@ +birthdaypresent_c2796655c25e1b0b8582716036aece08'] = 'Regalo di compleanno'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d1f5899bf2af57ed816390d9d740daf6'] = 'Offri automaticamente ai tuoi clienti dei regali di compleanno '; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_42f95f1b218dda65c23c52fcb205f1ed'] = 'Crea un voucher per i clienti che festeggiano il loro compleanno e che abbiano almeno un ordine valido'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_52292d2f9c39936bc72fbd47a3060df3'] = 'Inoltre, devi impostare una regola CRON che chiama il file'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f7e78e04cba74c610354e91e622cc105'] = 'tutti i giorni'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_689202409e48743b914713f96d93947c'] = 'Valore'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_998d08a9606f9656e8d1fcab8b762155'] = 'L\'importo o la %, a seconda del tipo selezionato sopra'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_1f0084a1581c05622120bd827305f173'] = 'Ordine minimo'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_783d0f2960c7c628177f740ce38ec3e7'] = 'Importo minimo di ordine necessario per utilizzare il voucher'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38fb7d24e0d60a048f540ecb18e13376'] = 'Salva'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_19f823c6453c2b1ffd09cb715214813d'] = 'Campi obbligatori'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_cb21e843b037359d0fb5b793fccf964f'] = 'Sviluppa la fedeltà dei clienti '; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_d725bab433ae44aee759eb82a24b09de'] = 'Offrire un regalo a un cliente è un mezzo per ottenere la sua fedeltà.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_0dc42f38b35e45090e1a1c94755c2d43'] = 'Cosa devo fare?'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_a3729d34db57cdeabe59a1fe78644458'] = 'Mantenere un cliente è più redditizio di conquistarne uno nuovo. Pertanto, è importante svilupparne la fedeltà, in altre parole, cercare di farlo tornare al tuo negozio online.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_7b6ac3f2cdb42a4462ff7ca3c4358f71'] = 'Il passaparola è anche un mezzo per ottenere nuovi clienti soddisfatti; un cliente insoddisfatto non attira nuovi clienti.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_410008089d5bb723438103a84d48a59c'] = 'Per raggiungere questo obiettivo è possibile organizzare:'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_3e788301a1b0ce341aa5ce15bc520545'] = 'Operazioni regolari: premi commerciali (offerte speciali personalizzate, prodotto o servizio offerto), premi non commerciale (gestione prioritaria di un ordine o di un prodotto), premi pecuniari (obbligazioni, buoni sconto, reinvestimenti ...).'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_f299b58558601a85c98a2d1d7867d523'] = 'Operazioni sostenibili: carte fedeltà o punti, che non solo giustificano la comunicazione tra commerciante e cliente, ma offre anche vantaggi ai clienti (offerte private, sconti).'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Queste operazioni incoraggiano i clienti a comprare e anche a tornare regolarmente al tuo negozio online.'; +$_MODULE['<{birthdaypresent}prestashop>birthdaypresent_38241c5ab16ef8f1ba73460ecd0469e8'] = 'Il tuo regalo di compleanno!'; diff --git a/modules/birthdaypresent/logo.gif b/modules/birthdaypresent/logo.gif new file mode 100644 index 000000000..4ef151aee Binary files /dev/null and b/modules/birthdaypresent/logo.gif differ diff --git a/modules/birthdaypresent/mails/de/birthday.html b/modules/birthdaypresent/mails/de/birthday.html new file mode 100644 index 000000000..ac79adaf6 --- /dev/null +++ b/modules/birthdaypresent/mails/de/birthday.html @@ -0,0 +1,42 @@ + + + + + Alles Gute zum Geburtstag von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        {shop_name} wünscht Ihnen alles Gute zum Geburtstag und möcht Ihnen ein Geschenk machen.
         
        +

        Es wartet eine Überraschung auf Sie... melden Sie sich jetzt bei Ihrem Konto an, um Ihren Ermäßigungsgutschein zu sehen!
        Und viel Spaß beim Einlösen!

        +

         
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/birthdaypresent/mails/de/birthday.txt b/modules/birthdaypresent/mails/de/birthday.txt new file mode 100644 index 000000000..e2545fead --- /dev/null +++ b/modules/birthdaypresent/mails/de/birthday.txt @@ -0,0 +1,5 @@ +Hallo {firstname} {lastname}, + +{shop_name} wünscht Ihnen alles Gute zum Geburtstag und möcht Ihnen ein Geschenk machen. Es wartet eine Überraschung auf Sie... melden Sie sich jetzt bei Ihrem Konto an, um Ihren Ermäßigungsgutschein zu sehen! + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/birthdaypresent/mails/en/birthday.html b/modules/birthdaypresent/mails/en/birthday.html new file mode 100644 index 000000000..ea53ece7e --- /dev/null +++ b/modules/birthdaypresent/mails/en/birthday.html @@ -0,0 +1,38 @@ + + + + + Happy Birthday! from {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        {shop_name} wants to wish you a Happy Birthday and offers you a present.
         
        +

        A surprise is waiting for you... log now on your account to see your discount voucher!
        + And put it to good use!

        +

        +
         
        + {shop_name} powered by PrestaShop™ +
        + + diff --git a/modules/birthdaypresent/mails/en/birthday.txt b/modules/birthdaypresent/mails/en/birthday.txt new file mode 100644 index 000000000..fd1c40c03 --- /dev/null +++ b/modules/birthdaypresent/mails/en/birthday.txt @@ -0,0 +1,7 @@ +Hi {firstname} {lastname}, + +{shop_name} wants to wish you a Happy Birthday and offers you a present. +A surprise is waiting for you... log now on your account to see your discount voucher. And put it to good use! + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/birthdaypresent/mails/es/birthday.html b/modules/birthdaypresent/mails/es/birthday.html new file mode 100644 index 000000000..bdf61947f --- /dev/null +++ b/modules/birthdaypresent/mails/es/birthday.html @@ -0,0 +1,43 @@ + + + + + ¡Feliz cumpleaños! desde {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        {shop_name} les desea un feliz cumpleaños y le ofrece un regalo.
         
        +

        Una sorpresa le espera ... Registrarse ahora en su cuenta para ver su bono de descuento!
        Y ponerlo a buen uso!

        +

         
        {shop_name} powered by PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/birthdaypresent/mails/es/birthday.txt b/modules/birthdaypresent/mails/es/birthday.txt new file mode 100644 index 000000000..16c6cdea5 --- /dev/null +++ b/modules/birthdaypresent/mails/es/birthday.txt @@ -0,0 +1,6 @@ +Hola {firstname} {lastname}, + +{shop_name} les desea un feliz cumpleaños y le ofrece un regalo. +Una sorpresa le espera ... Registrarse ahora en su cuenta para ver su bono de descuento. Y ponerlo a buen uso! + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/birthdaypresent/mails/fr/birthday.html b/modules/birthdaypresent/mails/fr/birthday.html new file mode 100644 index 000000000..79a008dc7 --- /dev/null +++ b/modules/birthdaypresent/mails/fr/birthday.html @@ -0,0 +1,38 @@ + + + + + {shop_name} vous souhaite un bon anniversaire ! + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        {shop_name} vous souhaite un très bon anniversaire et vous offre un cadeau.
         
        +

        Une surprise vous attend... Connectez-vous dès maintenant sur votre compte pour accéder à votre bon de réduction.
        + Faites-en bon usage!

        +

        +
         
        + {shop_name} réalisé par PrestaShop™ +
        + + diff --git a/modules/birthdaypresent/mails/fr/birthday.txt b/modules/birthdaypresent/mails/fr/birthday.txt new file mode 100644 index 000000000..a31a72ada --- /dev/null +++ b/modules/birthdaypresent/mails/fr/birthday.txt @@ -0,0 +1,7 @@ +Bonjour {firstname} {lastname}, + +{shop_name} vous souhaite un très bon anniversaire et vous offre un cadeau. +Une surprise vous attend... Connectez-vous dès maintenant sur votre compte pour accéder à votre bon de réduction. Faites-en bon usage! + + +{shop_url} Réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/birthdaypresent/mails/it/birthday.html b/modules/birthdaypresent/mails/it/birthday.html new file mode 100644 index 000000000..3f60df77e --- /dev/null +++ b/modules/birthdaypresent/mails/it/birthday.html @@ -0,0 +1,42 @@ + + + + + Buon Compleanno! da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        {shop_name} ti augura Buon Compleanno e vuole farti un regalo.
        +

        Ti aspetta una sorpresa... collegati subito al tuo account per vedere il tuo buono sconto!
        E approfittane subito!

        +

        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/birthdaypresent/mails/it/birthday.txt b/modules/birthdaypresent/mails/it/birthday.txt new file mode 100644 index 000000000..6769f7093 --- /dev/null +++ b/modules/birthdaypresent/mails/it/birthday.txt @@ -0,0 +1,7 @@ +Salve {firstname} {lastname}, + +{shop_name} ti augura Buon Compleanno e vuole farti un regalo. +Ti aspetta una sorpresa... collegati subito al tuo account per vedere il tuo buono sconto! + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blockadvertising/advertising.jpg b/modules/blockadvertising/advertising.jpg new file mode 100644 index 000000000..56ce3427a Binary files /dev/null and b/modules/blockadvertising/advertising.jpg differ diff --git a/modules/blockadvertising/blockadvertising.php b/modules/blockadvertising/blockadvertising.php new file mode 100644 index 000000000..38d9efac6 --- /dev/null +++ b/modules/blockadvertising/blockadvertising.php @@ -0,0 +1,203 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockAdvertising extends Module +{ + public $adv_link; + /** + * adv_img contains url to the image to display. + * + * @var mixed + */ + public $adv_img; + + /** + * adv_imgname is the filename of the image to display + * @TODO make it configurable for SEO, but need a function to clean filename + * @var string + */ + public $adv_imgname = 'advertising_custom'; + + public function __construct() + { + $this->name = 'blockadvertising'; + $this->tab = 'advertising_marketing'; + $this->version = 0.2; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Block advertising'); + $this->description = $this->l('Adds a block to display an advertisement.'); + + $current_dir = defined('__DIR__')?__DIR__:dirname(__FILE__); + if (!file_exists($current_dir.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) + $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/advertising.jpg'; + else + $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'); + $this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8'); + } + + + public function install() + { + Configuration::updateValue('BLOCKADVERT_LINK', 'http://www.prestashop.com'); + if (!parent::install()) + return false; + if (!$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn')) + return false; + return true; + } + + /** + * _deleteCurrentImg delete current image, (so this will use default image) + * + * @return void + */ + private function _deleteCurrentImg() + { + // can work before 5.3 + $current_dir=defined(__DIR__)?__DIR__:dirname(__FILE__); + + if(file_exists($current_dir.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) + unlink($current_dir.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT')); + } + /** + * postProcess update configuration + * @TODO adding alt and title attributes for and + * @var string + * @return void + */ + public function postProcess() + { + global $currentIndex; + + $errors = ''; + if (Tools::isSubmit('submitDeleteImgConf')) + $this->_deleteCurrentImg(); + + if (Tools::isSubmit('submitAdvConf')) + { + $file = false; + if (isset($_FILES['adv_img']) AND isset($_FILES['adv_img']['tmp_name']) AND !empty($_FILES['adv_img']['tmp_name'])) + { + if ($error = checkImage($_FILES['adv_img'], 4000000)) + $errors .= $error; + elseif ($dot_pos = strrpos($_FILES['adv_img']['name'],'.')) + { + // __DIR__ exists since php 5.3 + $current_dir = defined(__DIR__)?__DIR__:dirname(__FILE__); + // as checkImage tell us it's a good image, we'll just copy the extension + $ext=substr($_FILES['adv_img']['name'], $dot_pos+1); + $newname=$this->adv_imgname.'.'.$ext; + + $this->_deleteCurrentImg(); + + if (!move_uploaded_file($_FILES['adv_img']['tmp_name'], $current_dir.'/'.$newname)) + $errors .= $this->l('Error move uploaded file'); + + Configuration::updateValue('BLOCKADVERT_IMG_EXT',$ext); + $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'); + } + } + + if ($link = Tools::getValue('adv_link')) + { + Configuration::updateValue('BLOCKADVERT_LINK', $link); + $this->adv_link = htmlentities($link, ENT_QUOTES, 'UTF-8'); + } + } + if ($errors) + echo $this->displayError($errors); + } + + /** + * getContent used to display admin module form + * + * @return void + */ + public function getContent() + { + global $protocol_content; + + $this->postProcess(); + $output = ''; + $output .= ' +
        +
        '.$this->l('Advertising block configuration').' +'; + if ($this->adv_img) + $output .= ''.$this->l('Advertising image').''; + else + $output .= $this->l('no image'); + $output .= ''; + if ($this->adv_img) + $output .= ''; + $output .= '
        +
        + +( '.$this->l('Image will be displayed as 155x163').' ) +
        +
        + +
        +
        + +
        +
        +'; + return $output; + } + + /** + * Returns module content + * + * @param array $params Parameters + * @return string Content + */ + function hookRightColumn($params) + { + global $smarty, $protocol_content; + + Tools::addCSS(($this->_path).'blockadvertising.css', 'all'); + $smarty->assign('image', $protocol_content.$this->adv_img); + $smarty->assign('adv_link', $this->adv_link); + + return $this->display(__FILE__, 'blockadvertising.tpl'); + } + + function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + +} + + diff --git a/modules/blockadvertising/blockadvertising.tpl b/modules/blockadvertising/blockadvertising.tpl new file mode 100644 index 000000000..ae9d34046 --- /dev/null +++ b/modules/blockadvertising/blockadvertising.tpl @@ -0,0 +1,31 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        + {l s='Advertising' mod='blockadvertising'} +
        + diff --git a/modules/blockadvertising/config.xml b/modules/blockadvertising/config.xml new file mode 100755 index 000000000..04fa979c4 --- /dev/null +++ b/modules/blockadvertising/config.xml @@ -0,0 +1,11 @@ + + + blockadvertising + Block advertising + 0.2 + Adds a block to display an advertisement. + PrestaShop + advertising_marketing + 1 + 1 + \ No newline at end of file diff --git a/modules/blockadvertising/de.php b/modules/blockadvertising/de.php new file mode 100644 index 000000000..6b6a196ea --- /dev/null +++ b/modules/blockadvertising/de.php @@ -0,0 +1,16 @@ +blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Werbeblock'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Fügt einen block für Werbeanzeigen hinzu'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Fehler bewegt hochgeladene Datei'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Werbeblock-Konfiguration'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_2ce5fc289845ce826261032b9c6749ea'] = 'Werbung'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_93d5113a3d56b880522391fd049128f6'] = 'Werbebild'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'kein Bild'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'Bild löschen'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Bild ändern'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_56d9dfa26d7848a3fbcd2ae3091d38d9'] = 'Bild wird mit 155x163 gezeigt'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Bild-Link'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_f9ab05454998236921a6b0e281fae632'] = 'bestätigen'; diff --git a/modules/blockadvertising/en.php b/modules/blockadvertising/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockadvertising/en.php @@ -0,0 +1,4 @@ +blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Bloque de publicidad'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Añadir un bloque para mostrar la publicidad'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'error al desplazar el fichero uploado'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Configuración del bloque de publicidad'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_2ce5fc289845ce826261032b9c6749ea'] = 'Publicidad'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_93d5113a3d56b880522391fd049128f6'] = 'Imagen de la publicidad'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'Ninguna imagen'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'Eliminar la imagen'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Cambiar la imagen'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_56d9dfa26d7848a3fbcd2ae3091d38d9'] = 'La imagen se mostrará como 155x163'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Enlace de la imagen'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_f9ab05454998236921a6b0e281fae632'] = 'Validar'; diff --git a/modules/blockadvertising/fr.php b/modules/blockadvertising/fr.php new file mode 100644 index 000000000..c199a64ee --- /dev/null +++ b/modules/blockadvertising/fr.php @@ -0,0 +1,16 @@ +blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Bloc publicité'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Ajoute un bloc affichant une publicité'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Erreur de deplacement du fichier uploadé'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Configuration du bloc de publicité'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_2ce5fc289845ce826261032b9c6749ea'] = 'Publicité'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_93d5113a3d56b880522391fd049128f6'] = 'Image de la publicité'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'Pas d\'image'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'supprimer l\'image'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Changer l\'image'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_56d9dfa26d7848a3fbcd2ae3091d38d9'] = 'l\'image sera affiché en 155x163'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Lien de l\'image'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_f9ab05454998236921a6b0e281fae632'] = 'valider'; diff --git a/modules/blockadvertising/it.php b/modules/blockadvertising/it.php new file mode 100644 index 000000000..92c2d187f --- /dev/null +++ b/modules/blockadvertising/it.php @@ -0,0 +1,16 @@ +blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Blocco pubblicità'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Aggiunge un blocco per visualizzare un messaggio pubblicitario'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Errore sposta il file caricato'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Pubblicità blocco di configurazione'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_2ce5fc289845ce826261032b9c6749ea'] = 'Pubblicità'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_93d5113a3d56b880522391fd049128f6'] = 'Pubblicità immagine'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'nessuna immagine'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'elimina l\'immagine'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Cambia immagine'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_56d9dfa26d7848a3fbcd2ae3091d38d9'] = 'immagine verrà visualizzata come 155x163'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Immagine Link'; +$_MODULE['<{blockadvertising}prestashop>blockadvertising_f9ab05454998236921a6b0e281fae632'] = 'convalidare'; diff --git a/modules/blockadvertising/logo.gif b/modules/blockadvertising/logo.gif new file mode 100644 index 000000000..a49608392 Binary files /dev/null and b/modules/blockadvertising/logo.gif differ diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php new file mode 100644 index 000000000..b3210ac02 --- /dev/null +++ b/modules/blockbestsellers/blockbestsellers.php @@ -0,0 +1,126 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockBestSellers extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + public function __construct() + { + $this->name = 'blockbestsellers'; + $this->tab = 'front_office_features'; + $this->version = '1.1'; + $this->author = 'PrestaShop'; + parent::__construct(); + + $this->displayName = $this->l('Top seller block'); + $this->description = $this->l('Add a block displaying the shop\'s top sellers.'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('rightColumn') OR + !$this->registerHook('header') OR + !$this->registerHook('updateOrderStatus') OR + !ProductSale::fillProductSales()) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBestSellers')) + { + Configuration::updateValue('PS_BLOCK_BESTSELLERS_DISPLAY', (int)(Tools::getValue('always_display'))); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + return ' +
        +
        + '.$this->l('Settings').' + +
        + + + + +

        '.$this->l('Show the block even if no product is available.').'

        +
        +
        +
        +
        '; + } + + public function hookRightColumn($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + + global $smarty; + $currency = new Currency((int)($params['cookie']->id_currency)); + $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5); + if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) + return; + $best_sellers = array(); + foreach ($bestsellers AS $bestseller) + { + $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency); + $best_sellers[] = $bestseller; + } + $smarty->assign(array( + 'best_sellers' => $best_sellers, + 'mediumSize' => Image::getSize('medium'))); + return $this->display(__FILE__, 'blockbestsellers.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + + public function hookHeader($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + Tools::addCSS(($this->_path).'blockbestsellers.css', 'all'); + } + +} + + diff --git a/modules/blockbestsellers/blockbestsellers.tpl b/modules/blockbestsellers/blockbestsellers.tpl new file mode 100644 index 000000000..74aff46b1 --- /dev/null +++ b/modules/blockbestsellers/blockbestsellers.tpl @@ -0,0 +1,47 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Top sellers' mod='blockbestsellers'}

        +
        + {if $best_sellers|@count > 0} +
          +
        • {$best_sellers.0.legend|escape:'htmlall':'UTF-8'}
        • + {if $best_sellers|@count > 1}
        • {$best_sellers.1.legend|escape:'htmlall':'UTF-8'}
        • {/if} +
        +
        + {foreach from=$best_sellers item=product name=myLoop} +
        {$product.name|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}
        + {/foreach} +
        +

        {l s='All best sellers' mod='blockbestsellers'}

        + {else} +

        {l s='No best sellers at this time' mod='blockbestsellers'}

        + {/if} +
        +
        + diff --git a/modules/blockbestsellers/config.xml b/modules/blockbestsellers/config.xml new file mode 100755 index 000000000..c4d019a96 --- /dev/null +++ b/modules/blockbestsellers/config.xml @@ -0,0 +1,11 @@ + + + blockbestsellers + Top seller block + 1.1 + Add a block displaying the shop\'s top sellers. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockbestsellers/de.php b/modules/blockbestsellers/de.php new file mode 100644 index 000000000..bd38eaf20 --- /dev/null +++ b/modules/blockbestsellers/de.php @@ -0,0 +1,17 @@ +blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Block Verkaufshits'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Block mit Verkaufshits des Shops hinzufügen'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Aktualisierte Einstellungen'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Block immer anzeigen'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Block anzeigen, auch wenn kein Produkt verfügbar ist.'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Verkaufshits'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Alle Verkaufshits'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Momentan keine Verkaufshits'; diff --git a/modules/blockbestsellers/en.php b/modules/blockbestsellers/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockbestsellers/en.php @@ -0,0 +1,4 @@ +blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Bloque de mejores ventas'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Añadir un bloque para mostrar las mejores ventas de la tienda'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Actualización parámetros'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Mostrar siempre este bloque'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostrar este bloque aunque no haya ningún producto disponible'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = '¡Lo más vendido!'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Los productos más vendidos'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'No hay productos más vendidos en este momento'; diff --git a/modules/blockbestsellers/fr.php b/modules/blockbestsellers/fr.php new file mode 100644 index 000000000..5388db49a --- /dev/null +++ b/modules/blockbestsellers/fr.php @@ -0,0 +1,17 @@ +blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Bloc meilleures ventes'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Ajoute un bloc qui affiche les meilleures ventes de la boutique'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Toujours afficher ce bloc'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Afficher ce bloc même si aucun produit disponible'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Toutes les meilleures ventes'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Pas encore de meilleure vente'; diff --git a/modules/blockbestsellers/img/logo.gif b/modules/blockbestsellers/img/logo.gif new file mode 100644 index 000000000..86b4e900d Binary files /dev/null and b/modules/blockbestsellers/img/logo.gif differ diff --git a/modules/blockbestsellers/it.php b/modules/blockbestsellers/it.php new file mode 100644 index 000000000..5488fa431 --- /dev/null +++ b/modules/blockbestsellers/it.php @@ -0,0 +1,17 @@ +blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Blocco migliori vendite'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Aggiungi un blocco che mostra le migliori vendite del negozio'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Visualizza sempre blocco'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostra il blocco anche se nessun prodotto è disponibile.'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Migliori vendite'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Tutte le migliori vendite'; +$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Non ci sono migliori vendite in questo momento'; diff --git a/modules/blockbestsellers/logo.gif b/modules/blockbestsellers/logo.gif new file mode 100644 index 000000000..86b4e900d Binary files /dev/null and b/modules/blockbestsellers/logo.gif differ diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js new file mode 100644 index 000000000..1dee85d5c --- /dev/null +++ b/modules/blockcart/ajax-cart.js @@ -0,0 +1,613 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +//JS Object : update the cart by ajax actions +var ajaxCart = { + + //override every button in the page in relation to the cart + overrideButtonsInThePage : function(){ + //for every 'add' buttons... + $('.ajax_add_to_cart_button').unbind('click').click(function(){ + var idProduct = $(this).attr('rel').replace('ajax_id_product_', ''); + if ($(this).attr('disabled') != 'disabled') + ajaxCart.add(idProduct, null, false, this); + return false; + }); + //for product page 'add' button... + $('body#product p#add_to_cart input').unbind('click').click(function(){ + ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); + return false; + }); + + //for 'delete' buttons in the cart block... + $('#cart_block_list .ajax_cart_block_remove_link').unbind('click').click(function(){ + // Customized product management + var customizationId = 0; + var productId = 0; + var productAttributeId = 0; + if ($($(this).parent().parent()).attr('name') == 'customization') + // Reverse two levels: a >> div >> li + var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]"); + else + var customizableProductDiv = $($(this).parent()).find("div[id^=deleteCustomizableProduct_]"); + if (customizableProductDiv && $(customizableProductDiv).length) + { + $(customizableProductDiv).each(function(){ + var ids = $(this).attr('id').split('_'); + if (typeof(ids[1]) != 'undefined') + { + customizationId = parseInt(ids[1]); + productId = parseInt(ids[2]); + if (typeof(ids[3]) != 'undefined') + productAttributeId = parseInt(ids[3]); + return false; + } + }); + } + + // Common product management + if (!customizationId) + { + //retrieve idProduct and idCombination from the displayed product in the block cart + var firstCut = $(this).parent().parent().attr('id').replace('cart_block_product_', ''); + firstCut = firstCut.replace('deleteCustomizableProduct_', ''); + ids = firstCut.split('_'); + productId = parseInt(ids[0]); + if (typeof(ids[1]) != 'undefined') + productAttributeId = parseInt(ids[1]); + } + + // Removing product from the cart + ajaxCart.remove(productId, productAttributeId, customizationId); + return false; + }); + }, + + // try to expand the cart + expand : function(){ + if ($('#cart_block #cart_block_list').hasClass('collapsed')) + { + $('#cart_block #cart_block_summary').slideUp(200, function(){ + $(this).addClass('collapsed').removeClass('expanded'); + $('#cart_block #cart_block_list').slideDown({ + duration: 600, + complete: function(){$(this).addClass('expanded').removeClass('collapsed');} + }); + }); + // toogle the button expand/collapse button + $('#cart_block h4 span#block_cart_expand').fadeOut('slow', function(){ + $('#cart_block h4 span#block_cart_collapse').fadeIn('fast'); + }); + + // save the expand statut in the user cookie + $.ajax({ + type: 'GET', + url: baseDir + 'modules/blockcart/blockcart-set-collapse.php', + async: true, + data: 'ajax_blockcart_display=expand' + '&rand=' + new Date().getTime() + }); + + + } + }, + // cart to fix display when using back and previous browsers buttons + refresh : function(){ + //send the ajax request to the server + $.ajax({ + type: 'GET', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&token=' + static_token, + success: function(jsonData) + { + ajaxCart.updateCart(jsonData); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + //alert("TECHNICAL ERROR: unable to refresh the cart.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); + } + }); + }, + + // try to collapse the cart + collapse : function(){ + + if ($('#cart_block #cart_block_list').hasClass('expanded')) + { + $('#cart_block #cart_block_list').slideUp('slow', function(){ + $(this).addClass('collapsed').removeClass('expanded'); + $('#cart_block #cart_block_summary').slideDown(700, function(){ + $(this).addClass('expanded').removeClass('collapsed'); + }); + }); + $('#cart_block h4 span#block_cart_collapse').fadeOut('slow', function(){ + $('#cart_block h4 span#block_cart_expand').fadeIn('fast'); + }); + + // save the expand statut in the user cookie + $.ajax({ + type: 'GET', + url: baseDir + 'modules/blockcart/blockcart-set-collapse.php', + async: true, + data: 'ajax_blockcart_display=collapse' + '&rand=' + new Date().getTime() + }); + } + }, + + // add a product in the cart via ajax + add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){ + if (addedFromProductPage && !checkCustomizations()) + { + alert(fieldRequired); + return ; + } + //disabled the button when adding to do not double add if user double click + if (addedFromProductPage) + { + $('body#product p#add_to_cart input').attr('disabled', 'disabled').removeClass('exclusive').addClass('exclusive_disabled'); + $('.filled').removeClass('filled'); + } + else + $('.ajax_add_to_cart_button').attr('disabled', 'disabled'); + + if ($('#cart_block #cart_block_list').hasClass('collapsed')) + this.expand(); + //send the ajax request to the server + $.ajax({ + type: 'POST', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType : "json", + data: 'add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''), + success: function(jsonData,textStatus,jqXHR) + { + // add appliance to whishlist module + if (whishlist && !jsonData.errors) + WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]); + + // add the picture to the cart + var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img'); + if (!$element.length) + $element = $('#bigpic'); + var $picture = $element.clone(); + var pictureOffsetOriginal = $element.offset(); + $picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left}); + var pictureOffset = $picture.offset(); + var cartBlockOffset = $('#cart_block').offset(); + + $picture.appendTo('body'); + $picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left') }) + .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) + .fadeOut(100, function() { + ajaxCart.updateCart(jsonData); + //reactive the button when adding has finished + if (addedFromProductPage) + $('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); + else + $('.ajax_add_to_cart_button').removeAttr('disabled'); + }); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); + //reactive the button when adding has finished + if (addedFromProductPage) + $('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); + else + $('.ajax_add_to_cart_button').removeAttr('disabled'); + } + }); + }, + + //remove a product from the cart via ajax + remove : function(idProduct, idCombination, customizationId){ + //send the ajax request to the server + $.ajax({ + type: 'POST', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType : "json", + data: 'delete=1&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&token=' + static_token + '&ajax=true', + success: function(jsonData) { + ajaxCart.updateCart(jsonData); + if ($('body').attr('id') == 'order' || $('body').attr('id') == 'order-opc') + deletProductFromSummary(idProduct+'_'+idCombination); + }, + error: function() {alert('ERROR: unable to delete the product');} + }); + }, + + //hide the products displayed in the page but no more in the json data + hideOldProducts : function(jsonData) { + //delete an eventually removed product of the displayed cart (only if cart is not empty!) + if($('#cart_block #cart_block_list dl.products').length > 0) + { + var removedProductId = null; + var removedProductData = null; + var removedProductDomId = null; + //look for a product to delete... + $('#cart_block_list dl.products dt').each(function(){ + //retrieve idProduct and idCombination from the displayed product in the block cart + var domIdProduct = $(this).attr('id'); + var firstCut = domIdProduct.replace('cart_block_product_', ''); + var ids = firstCut.split('_'); + + //try to know if the current product is still in the new list + var stayInTheCart = false; + for (aProduct in jsonData.products) + { + //we've called the variable aProduct because IE6 bug if this variable is called product + //if product has attributes + if (jsonData.products[aProduct]['id'] == ids[0] && (!ids[1] || jsonData.products[aProduct]['idCombination'] == ids[1])) + { + stayInTheCart = true; + // update the product customization display (when the product is still in the cart) + ajaxCart.hideOldProductCustomizations(jsonData.products[aProduct], domIdProduct); + } + } + //remove product if it's no more in the cart + if(!stayInTheCart) + { + removedProductId = $(this).attr('id'); + //return false; // Regarding that the customer can only remove products one by one, we break the loop + } + }); + + //if there is a removed product, delete it from the displayed block cart + if (removedProductId != null) + { + var firstCut = removedProductId.replace('cart_block_product_', ''); + var ids = firstCut.split('_'); + + $('#'+removedProductId).addClass('strike').fadeTo('slow', 0, function(){ + $(this).slideUp('slow', function(){ + $(this).remove(); + //if the cart is now empty, show the 'no product in the cart' message + if($('#cart_block dl.products dt').length == 0) + { + $('p#cart_block_no_products:hidden').slideDown('fast'); + $('div#cart_block dl.products').remove(); + } + }); + }); + $('dd#cart_block_combination_of_' + ids[0] + (ids[1] ? '_'+ids[1] : '') ).fadeTo('fast', 0, function(){ + $(this).slideUp('fast', function(){ + $(this).remove(); + }); + }); + } + + } + }, + + hideOldProductCustomizations : function (product, domIdProduct) + { + var customizationList = $('#cart_block #cart_block_list ul#customization_' + product['id'] + '_' + product['idCombination']); + if(customizationList.length > 0) + { + $(customizationList).find("li").each(function(){ + $(this).find("div").each(function() { + var customizationDiv = $(this).attr('id'); + var tmp = customizationDiv.replace('deleteCustomizableProduct_', ''); + var ids = tmp.split('_'); + if ((parseInt(product.idCombination) == parseInt(ids[2])) && !ajaxCart.doesCustomizationStillExist(product, ids[0])) + $('#' + customizationDiv).parent().addClass('strike').fadeTo('slow', 0, function(){ + $(this).slideUp('slow'); + $(this).remove(); + }); + }); + }); + } + var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link'); + if (!product.hasCustomizedDatas && !removeLinks.length) + $('#' + domIdProduct + ' span.remove_link').html(' '); + }, + + doesCustomizationStillExist : function (product, customizationId) + { + var exists = false; + + $(product.customizedDatas).each(function() { + if (this.customizationId == customizationId) + { + exists = true; + // This return does not mean that we found nothing but simply break the loop + return false; + } + }); + return (exists); + }, + + //refresh display of vouchers (needed for vouchers in % of the total) + refreshVouchers : function (jsonData) { + if (jsonData.discounts.length == 0) + $('#vouchers').remove(); + else + { + $('.bloc_cart_voucher').each(function(){ + var idElmt = $(this).attr('id').replace('bloc_cart_voucher_',''); + var toDelete = true; + for (i=0;i'); + + //if product is not in the displayed cart, add a new product's line + var domIdProduct = this.id + (this.idCombination ? '_' + this.idCombination : ''); + var domIdProductAttribute = this.id + '_' + (this.idCombination ? this.idCombination : '0'); + if($('#cart_block dt#cart_block_product_'+ domIdProduct ).length == 0) + { + var productId = parseInt(this.id); + var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0); + var content = ''; + if (this.hasAttributes) + content += ''; + + $('#cart_block dl.products').append(content); + } + //else update the product's line + else{ + var jsonProduct = this; + if($('dt#cart_block_product_' + domIdProduct + ' .quantity').text() != jsonProduct.quantity || $('dt#cart_block_product_' + domIdProduct + ' .price').text() != jsonProduct.priceByLine) + { + // Usual product + $('dt#cart_block_product_' + domIdProduct + ' .price').text(jsonProduct.priceByLine); + ajaxCart.updateProductQuantity(jsonProduct, jsonProduct.quantity); + + // Customized product + if (jsonProduct.hasCustomizedDatas) + { + customizationFormatedDatas = ajaxCart.displayNewCustomizedDatas(jsonProduct); + if (!$('#cart_block ul#customization_' + domIdProductAttribute).length) + { + if (jsonProduct.hasAttributes) + $('#cart_block dd#cart_block_combination_of_' + domIdProduct).append(customizationFormatedDatas); + else + $('#cart_block dl.products').append(customizationFormatedDatas); + } + else + $('#cart_block ul#customization_' + domIdProductAttribute).append(customizationFormatedDatas); + } + } + } + $('#cart_block dl.products .hidden').slideDown('slow').removeClass('hidden'); + + var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link'); + if (this.hasCustomizedDatas && removeLinks.length) + $(removeLinks).each(function() { + $(this).remove(); + }); + } + }); + }, + + displayNewCustomizedDatas : function(product) + { + var content = ''; + var productId = parseInt(product.id); + var productAttributeId = typeof(product.idCombination) == 'undefined' ? 0 : parseInt(product.idCombination); + var hasAlreadyCustomizations = $('#cart_block ul#customization_' + productId + '_' + productAttributeId).length; + + if (!hasAlreadyCustomizations) + { + if (!product.hasAttributes) content += ''; + } + return (content); + }, + + + //genarally update the display of the cart + updateCart : function(jsonData) { + //user errors display + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + else + { + ajaxCart.updateCartEverywhere(jsonData); + ajaxCart.hideOldProducts(jsonData); + ajaxCart.displayNewProducts(jsonData); + ajaxCart.refreshVouchers(jsonData); + + //update 'first' and 'last' item classes + $('#cart_block dl.products dt').removeClass('first_item').removeClass('last_item').removeClass('item'); + $('#cart_block dl.products dt:first').addClass('first_item'); + $('#cart_block dl.products dt:not(:first,:last)').addClass('item'); + $('#cart_block dl.products dt:last').addClass('last_item'); + + //reset the onlick events in relation to the cart block (it allow to bind the onclick event to the new 'delete' buttons added) + ajaxCart.overrideButtonsInThePage(); + } + }, + + //update general cart informations everywhere in the page + updateCartEverywhere : function(jsonData) { + $('.ajax_cart_total').text(jsonData.productTotal); + $('.ajax_cart_shipping_cost').text(jsonData.shippingCost); + $('.ajax_cart_tax_cost').text(jsonData.taxCost); + $('.cart_block_wrapping_cost').text(jsonData.wrappingCost); + $('.ajax_block_cart_total').text(jsonData.total); + if(parseInt(jsonData.nbTotalProducts) > 0) + { + $('.ajax_cart_no_product').hide(); + $('.ajax_cart_quantity').text(jsonData.nbTotalProducts); + $('.ajax_cart_quantity').fadeIn('slow'); + $('.ajax_cart_total').fadeIn('slow'); + + if(parseInt(jsonData.nbTotalProducts) > 1) + { + $('.ajax_cart_product_txt').each( function () { + $(this).hide (); + }); + + $('.ajax_cart_product_txt_s').each( function () { + $(this).show(); + }); + + } + else + { + $('.ajax_cart_product_txt').each( function () { + $(this).show(); + }); + + $('.ajax_cart_product_txt_s').each( function () { + $(this).hide(); + }); + } + } + else + { + $('.ajax_cart_quantity, .ajax_cart_product_txt_s, .ajax_cart_product_txt, .ajax_cart_total').each( function () { + $(this).hide(); + }); + $('.ajax_cart_no_product').show('slow'); + } + } +}; + +//when document is loaded... +$(document).ready(function(){ + + // expand/collapse management + $('#block_cart_collapse').click(function(){ + ajaxCart.collapse(); + }); + $('#block_cart_expand').click(function(){ + ajaxCart.expand(); + }); + ajaxCart.overrideButtonsInThePage(); + ajaxCart.refresh(); +}); + diff --git a/modules/blockcart/blockcart-ajax.php b/modules/blockcart/blockcart-ajax.php new file mode 100644 index 000000000..ceea663ac --- /dev/null +++ b/modules/blockcart/blockcart-ajax.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +global $cookie; + +include(dirname(__FILE__).'/blockcart.php'); + +$cart = new Cart((int)($cookie->id_cart)); +$cart->id_lang = (int)($cookie->id_lang); + +$blockCart = new BlockCart(); +echo $blockCart->hookAjaxCall(array('cookie' => $cookie, 'cart' => $cart)); \ No newline at end of file diff --git a/modules/blockcart/blockcart-json.tpl b/modules/blockcart/blockcart-json.tpl new file mode 100644 index 000000000..39e206616 --- /dev/null +++ b/modules/blockcart/blockcart-json.tpl @@ -0,0 +1,117 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{ldelim} +"products": [ +{if $products} +{foreach from=$products item=product name='products'} +{assign var='productId' value=$product.id_product} +{assign var='productAttributeId' value=$product.id_product_attribute} + {ldelim} + "id": {$product.id_product}, + "link": "{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)|addslashes}", + "quantity": {$product.cart_quantity}, + "priceByLine": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}", + "name": "{$product.name|html_entity_decode:2:'UTF-8'|escape|truncate:15:'...':true}", + "price": "{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total}{else}{displayWtPrice|html_entity_decode:2:'UTF-8' p=$product.total_wt}{/if}", + "idCombination": {if isset($product.attributes_small)}{$productAttributeId}{else}0{/if}, +{if isset($product.attributes_small)} + "hasAttributes": true, + "attributes": "{$product.attributes_small|addslashes}", +{else} + "hasAttributes": false, +{/if} + "hasCustomizedDatas": {if isset($customizedDatas.$productId.$productAttributeId)}true{else}false{/if}, + + "customizedDatas":[ + {if isset($customizedDatas.$productId.$productAttributeId)} + {foreach from=$customizedDatas.$productId.$productAttributeId key='id_customization' item='customization' name='customizedDatas'}{ldelim} +{* This empty line was made in purpose (product addition debug), please leave it here *} + + "customizationId": {$id_customization}, + "quantity": "{$customization.quantity}", + "datas": [ + {foreach from=$customization.datas key='type' item='datas' name='customization'} + {ldelim} + "type": "{$type}", + "datas": + [ + {foreach from=$datas key='index' item='data' name='datas'} + {ldelim} + "index": {$index}, + "value": "{$data.value|addslashes}", + "truncatedValue": "{$data.value|truncate:28:'...'|addslashes}" + {rdelim}{if !$smarty.foreach.datas.last},{/if} + {/foreach}] + {rdelim}{if !$smarty.foreach.customization.last},{/if} + {/foreach} + ] + {rdelim}{if !$smarty.foreach.customizedDatas.last},{/if} + {/foreach} + {/if} + ] + + + {rdelim}{if !$smarty.foreach.products.last},{/if} +{/foreach}{/if} +], + +"discounts": [ +{if $discounts}{foreach from=$discounts item=discount name='discounts'} + {ldelim} + "id": "{$discount.id_discount}", + "name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes}", + "description": "{$discount.description|addslashes}", + "nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'}", + "link": "{$link->getPageLink('order.php', true)}?deleteDiscount={$discount.id_discount}", + "price": "-{if $discount.value_real != '!'}{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}{/if}" + {rdelim} + {if !$smarty.foreach.discounts.last},{/if} +{/foreach}{/if} +], + +"shippingCost": "{$shipping_cost|html_entity_decode:2:'UTF-8'}", +{if isset($tax_cost)} +"taxCost": "{$tax_cost|html_entity_decode:2:'UTF-8'}", +{/if} +"wrappingCost": "{$wrapping_cost|html_entity_decode:2:'UTF-8'}", +"nbTotalProducts": "{$nb_total_products}", +"total": "{$total|html_entity_decode:2:'UTF-8'}", +"productTotal": "{$product_total|html_entity_decode:2:'UTF-8'}", + +{if isset($errors) && $errors} +"hasError" : true, +"errors" : [ +{foreach from=$errors key=k item=error name='errors'} + "{$error|addslashes|html_entity_decode:2:'UTF-8'}" + {if !$smarty.foreach.errors.last},{/if} +{/foreach} +] +{else} +"hasError" : false +{/if} + +{rdelim} diff --git a/modules/blockcart/blockcart-set-collapse.php b/modules/blockcart/blockcart-set-collapse.php new file mode 100644 index 000000000..5463f9513 --- /dev/null +++ b/modules/blockcart/blockcart-set-collapse.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +if ( isset($_POST['ajax_blockcart_display']) || isset($_GET['ajax_blockcart_display'])) +{ + if (Tools::getValue('ajax_blockcart_display') == 'collapse') + { + $cookie->ajax_blockcart_display = 'collapsed'; + die ('collapse status of the blockcart module updated in the cookie'); + } + if (Tools::getValue('ajax_blockcart_display') == 'expand') + { + $cookie->ajax_blockcart_display = 'expanded'; + die ('expand status of the blockcart module updated in the cookie'); + } + die ('ERROR : bad status setted. Only collapse or expand status of the blockcart module are available.'); +} +else die('ERROR : No status setted.'); + diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php new file mode 100644 index 000000000..d8bab8caa --- /dev/null +++ b/modules/blockcart/blockcart.php @@ -0,0 +1,193 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockCart extends Module +{ + public function __construct() + { + $this->name = 'blockcart'; + $this->tab = 'front_office_features'; + $this->version = '1.2'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Cart block'); + $this->description = $this->l('Adds a block containing the customer\'s shopping cart.'); + } + + public function smartyAssigns(&$smarty, &$params) + { + global $errors, $cookie; + + // Set currency + if (!(int)($params['cart']->id_currency)) + $currency = new Currency((int)$params['cookie']->id_currency); + else + $currency = new Currency((int)$params['cart']->id_currency); + if (!Validate::isLoadedObject($currency)) + $currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + + if ($params['cart']->id_customer) + { + $customer = new Customer((int)$params['cart']->id_customer); + $taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group); + } + else + $taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); + + $useTax = !($taxCalculationMethod == PS_TAX_EXC); + + $products = $params['cart']->getProducts(true); + $nbTotalProducts = 0; + foreach ($products AS $product) + $nbTotalProducts += (int)$product['cart_quantity']; + + $wrappingCost = (float)($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING)); + $totalToPay = $params['cart']->getOrderTotal($useTax); + + if ($useTax AND Configuration::get('PS_TAX_DISPLAY') == 1) + { + $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false); + $smarty->assign('tax_cost', Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency)); + } + + $smarty->assign(array( + 'products' => $products, + 'customizedDatas' => Product::getAllCustomizedDatas((int)($params['cart']->id)), + 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, + 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, + 'discounts' => $params['cart']->getDiscounts(false, Tools::isSubmit('id_product')), + 'nb_total_products' => (int)($nbTotalProducts), + 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING), $currency), + 'show_wrapping' => $wrappingCost > 0 ? true : false, + 'show_tax' => (int)(Configuration::get('PS_TAX_DISPLAY')) == 1 ? true : false, + 'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency), + 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING), $currency), + 'total' => Tools::displayPrice($totalToPay, $currency), + 'id_carrier' => (int)($params['cart']->id_carrier), + 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order', + 'ajax_allowed' => (int)(Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false + )); + if (sizeof($errors)) + $smarty->assign('errors', $errors); + if(isset($cookie->ajax_blockcart_display)) + $smarty->assign('colapseExpandStatus', $cookie->ajax_blockcart_display); + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockCart')) + { + $ajax = Tools::getValue('ajax'); + if ($ajax != 0 AND $ajax != 1) + $output .= '
        '.$this->l('Ajax : Invalid choice.').'
        '; + else + { + Configuration::updateValue('PS_BLOCK_CART_AJAX', (int)($ajax)); + } + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + return ' +
        +
        + '.$this->l('Settings').' + + +
        + + + + +

        '.$this->l('Activate AJAX mode for cart (compatible with the default theme)').'

        +
        + +
        +
        +
        '; + } + + public function install() + { + if + ( + parent::install() == false + OR $this->registerHook('rightColumn') == false + OR $this->registerHook('header') == false + OR Configuration::updateValue('PS_BLOCK_CART_AJAX', 1) == false + ) + return false; + return true; + } + + public function hookRightColumn($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return; + + global $smarty; + $smarty->assign('order_page', strpos($_SERVER['PHP_SELF'], 'order') !== false); + $this->smartyAssigns($smarty, $params); + + return $this->display(__FILE__, 'blockcart.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookAjaxCall($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return; + + global $smarty; + $this->smartyAssigns($smarty, $params); + $res = $this->display(__FILE__, 'blockcart-json.tpl'); + return $res; + } + + public function hookHeader() + { + if (Configuration::get('PS_CATALOG_MODE')) + return; + + Tools::addCSS(($this->_path).'blockcart.css', 'all'); + if ((int)(Configuration::get('PS_BLOCK_CART_AJAX'))) + Tools::addJS(($this->_path).'ajax-cart.js'); + } +} diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl new file mode 100644 index 000000000..c2c70f46f --- /dev/null +++ b/modules/blockcart/blockcart.tpl @@ -0,0 +1,149 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{*************************************************************************************************************************************} +{* IMPORTANT : If you change some data here, you have to report these changes in the ./blockcart-json.js (to let ajaxCart available) *} +{*************************************************************************************************************************************} +{if $ajax_allowed} + +{/if} + + +
        +

        + {l s='Cart' mod='blockcart'} + {if $ajax_allowed} +   +   + {/if} +

        +
        + +
        + {$cart_qties} + {l s='products' mod='blockcart'} + 1}style="display:none"{/if}>{l s='product' mod='blockcart'} + {if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false)}{else}{convertPrice price=$cart->getOrderTotal(true)}{/if} + {l s='(empty)' mod='blockcart'} +
        + +
        + {if $products} +
        + {foreach from=$products item='product' name='myLoop'} + {assign var='productId' value=$product.id_product} + {assign var='productAttributeId' value=$product.id_product_attribute} +
        + {$product.cart_quantity}x + {t text=$product.name length='10' encode='true'} + {if !isset($customizedDatas.$productId.$productAttributeId)} {/if} + {if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if} +
        + {if isset($product.attributes_small)} +
        + {$product.attributes_small} + {/if} + + + {if isset($customizedDatas.$productId.$productAttributeId)} + {if !isset($product.attributes_small)}
        {/if} +
          + {foreach from=$customizedDatas.$productId.$productAttributeId key='id_customization' item='customization' name='customizations'} +
        • + + {$customization.quantity}x{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}{t text=$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"
          ":" " length='28' encode='true'} + {else} + {l s='Customization #' mod='blockcart'}{$id_customization|intval}{l s=':' mod='blockcart'} + {/if} +
        • + {/foreach} +
        + {if !isset($product.attributes_small)}
        {/if} + {/if} + + {if isset($product.attributes_small)}{/if} + + {/foreach} +
        + {/if} +

        {l s='No products' mod='blockcart'}

        + + {if $discounts|@count > 0} + + {foreach from=$discounts item=discount} + + + + + + {/foreach} + +
        {$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}-{if $discount.value_real != '!'}{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}{/if}{l s='Delete'}
        + {/if} + +

        + {l s='Shipping' mod='blockcart'} + {$shipping_cost} +
        + {if $show_wrapping} + {assign var='blockcart_cart_flag' value='Cart::ONLY_WRAPPING'|constant} + {l s='Wrapping' mod='blockcart'} + {if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $blockcart_cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $blockcart_cart_flag)}{/if} +
        + {/if} + {if $show_tax && isset($tax_cost)} + {l s='Tax' mod='blockcart'} + {$tax_cost} +
        + {/if} + {l s='Total' mod='blockcart'} + {$total} +

        + {if $use_taxes} + {if $priceDisplay == 0} +

        + {l s='Prices are tax included' mod='blockcart'} +

        + {/if} + {if $priceDisplay == 1} +

        + {l s='Prices are tax excluded' mod='blockcart'} +

        + {/if} + {/if} +

        + {if $order_process == 'order'}{l s='Cart' mod='blockcart'}{/if} + {l s='Check out' mod='blockcart'} +

        +
        +
        +
        + + diff --git a/modules/blockcart/config.xml b/modules/blockcart/config.xml new file mode 100755 index 000000000..369dd3946 --- /dev/null +++ b/modules/blockcart/config.xml @@ -0,0 +1,11 @@ + + + blockcart + Cart block + 1.2 + Adds a block containing the customer\'s shopping cart. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockcart/de.php b/modules/blockcart/de.php new file mode 100644 index 000000000..90f78e29e --- /dev/null +++ b/modules/blockcart/de.php @@ -0,0 +1,32 @@ +blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Block Warenkorb'; +$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Fügt einen Block mit dem Warenkorb des Kunden hinzu'; +$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: ungültige Wahl.'; +$_MODULE['<{blockcart}prestashop>blockcart_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Ajax-Warenkorb'; +$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Ajax-Modus für Warenkorb aktivieren (kompatibel mit Standardthema)'; +$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Benutzereinstellung Nr.'; +$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'dieses Produkt aus meinem Warenkorb entfernen'; +$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb'; +$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'Produkte'; +$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'Produkt'; +$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(leer)'; +$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produktdetail'; +$_MODULE['<{blockcart}prestashop>blockcart_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; +$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand'; +$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Verpackung'; +$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Steuer'; +$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Gesamt'; +$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Preise inklusive Steuer'; +$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Preise ohne Steuer'; +$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Sich abmelden'; diff --git a/modules/blockcart/en.php b/modules/blockcart/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockcart/en.php @@ -0,0 +1,4 @@ +blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Carrito'; +$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Añadir un bloque que contenga el carrito de compra del cliente'; +$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: opción incorrecta.'; +$_MODULE['<{blockcart}prestashop>blockcart_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Carrito Ajax'; +$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Modo AJAX para el carrito (compatible con el tema por defecto)'; +$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personalización n°'; +$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'eliminar este producto de mi carrito'; +$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrito'; +$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'productos'; +$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'producto'; +$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vacío)'; +$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalle del producto'; +$_MODULE['<{blockcart}prestashop>blockcart_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Sin producto'; +$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Transporte'; +$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Embalaje'; +$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Impuestos'; +$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Estos precios se entienden IVA incluído'; +$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Estos precios se entienden sin IVA'; +$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Confirmar'; diff --git a/modules/blockcart/fr.php b/modules/blockcart/fr.php new file mode 100644 index 000000000..d9e8a7051 --- /dev/null +++ b/modules/blockcart/fr.php @@ -0,0 +1,32 @@ +blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Bloc panier'; +$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Ajoute un bloc avec le contenu du panier du client'; +$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax : choix invalide.'; +$_MODULE['<{blockcart}prestashop>blockcart_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Panier AJAX'; +$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Activer le mode AJAX du panier (compatible avec le thème par défaut)'; +$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personnalisation '; +$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'supprimer cet article du panier'; +$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; +$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'articles'; +$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'article'; +$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vide)'; +$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détails de l\'article'; +$_MODULE['<{blockcart}prestashop>blockcart_853ae90f0351324bd73ea615e6487517'] = ' :'; +$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit'; +$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Expédition'; +$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Emballage'; +$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Taxes'; +$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Les prix sont TTC'; +$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Les prix sont HT'; +$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Commander'; diff --git a/modules/blockcart/img/icon/basket.png b/modules/blockcart/img/icon/basket.png new file mode 100644 index 000000000..b0686d787 Binary files /dev/null and b/modules/blockcart/img/icon/basket.png differ diff --git a/modules/blockcart/img/icon/basket_go.png b/modules/blockcart/img/icon/basket_go.png new file mode 100644 index 000000000..ed8b9a576 Binary files /dev/null and b/modules/blockcart/img/icon/basket_go.png differ diff --git a/modules/blockcart/img/icon/checkout.png b/modules/blockcart/img/icon/checkout.png new file mode 100644 index 000000000..ed8b9a576 Binary files /dev/null and b/modules/blockcart/img/icon/checkout.png differ diff --git a/modules/blockcart/img/icon/delete.gif b/modules/blockcart/img/icon/delete.gif new file mode 100644 index 000000000..348537e13 Binary files /dev/null and b/modules/blockcart/img/icon/delete.gif differ diff --git a/modules/blockcart/it.php b/modules/blockcart/it.php new file mode 100644 index 000000000..b38ab6785 --- /dev/null +++ b/modules/blockcart/it.php @@ -0,0 +1,32 @@ +blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Blocco carrello'; +$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Aggiunge un blocco contenente il carrello del cliente'; +$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: scelta non valida.'; +$_MODULE['<{blockcart}prestashop>blockcart_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Carrello Ajax '; +$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Attivare la modalità di AJAX per il carrello (compatibile con il tema di default)'; +$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personalizzazione n.'; +$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'rimuovi questo prodotto dal mio carrello'; +$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello'; +$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'prodotti'; +$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'prodotto'; +$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vuoto)'; +$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Dettaglio prodotto'; +$_MODULE['<{blockcart}prestashop>blockcart_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; +$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; +$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Imballaggio'; +$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Tasse'; +$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Totale'; +$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'I prezzi sono IVA inclusa'; +$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'I prezzi sono IVA esclusa'; +$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Check out'; diff --git a/modules/blockcart/logo.gif b/modules/blockcart/logo.gif new file mode 100644 index 000000000..913d24725 Binary files /dev/null and b/modules/blockcart/logo.gif differ diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php new file mode 100644 index 000000000..b7330ab64 --- /dev/null +++ b/modules/blockcategories/blockcategories.php @@ -0,0 +1,244 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockCategories extends Module +{ + public function __construct() + { + $this->name = 'blockcategories'; + $this->tab = 'front_office_features'; + $this->version = '2.0'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Categories block'); + $this->description = $this->l('Adds a block featuring product categories.'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('leftColumn') OR + !$this->registerHook('header') OR + // Temporary hooks. Do NOT hook any module on it. Some CRUD hook will replace them as soon as possible. + !$this->registerHook('categoryAddition') OR + !$this->registerHook('categoryUpdate') OR + !$this->registerHook('categoryDeletion') OR + !$this->registerHook('afterCreateHtaccess') OR + !$this->registerHook('afterSaveAdminMeta') OR + !Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 3) OR + !Configuration::updateValue('BLOCK_CATEG_DHTML', 1)) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall() OR + !Configuration::deleteByName('BLOCK_CATEG_MAX_DEPTH') OR + !Configuration::deleteByName('BLOCK_CATEG_DHTML')) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockCategories')) + { + $maxDepth = (int)(Tools::getValue('maxDepth')); + $dhtml = Tools::getValue('dhtml'); + if ($maxDepth < 0) + $output .= '
        '.$this->l('Maximum depth: Invalid number.').'
        '; + elseif ($dhtml != 0 AND $dhtml != 1) + $output .= '
        '.$this->l('Dynamic HTML: Invalid choice.').'
        '; + else + { + Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', (int)($maxDepth)); + Configuration::updateValue('BLOCK_CATEG_DHTML', (int)($dhtml)); + $this->_clearBlockcategoriesCache(); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + return ' +
        +
        + '.$this->l('Settings').' + +
        + +

        '.$this->l('Set the maximum depth of sublevels displayed in this block (0 = infinite)').'

        +
        + + +
        + + + + +

        '.$this->l('Activate dynamic (animated) mode for sublevels').'

        +
        +
        +
        +
        '; + } + + public function getTree($resultParents, $resultIds, $maxDepth, $id_category = 1, $currentDepth = 0) + { + global $link; + + $children = array(); + if (isset($resultParents[$id_category]) AND sizeof($resultParents[$id_category]) AND ($maxDepth == 0 OR $currentDepth < $maxDepth)) + foreach ($resultParents[$id_category] as $subcat) + $children[] = $this->getTree($resultParents, $resultIds, $maxDepth, $subcat['id_category'], $currentDepth + 1); + if (!isset($resultIds[$id_category])) + return false; + return array('id' => $id_category, 'link' => $link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']), + 'name' => $resultIds[$id_category]['name'], 'desc'=> $resultIds[$id_category]['description'], + 'children' => $children); + } + + public function hookLeftColumn($params) + { + global $smarty, $cookie; + + $id_customer = (int)($params['cookie']->id_customer); + $id_group = $id_customer ? Customer::getDefaultGroupId($id_customer) : _PS_DEFAULT_CUSTOMER_GROUP_; + $id_product = (int)(Tools::getValue('id_product', 0)); + $id_category = (int)(Tools::getValue('id_category', 0)); + $id_lang = (int)($params['cookie']->id_lang); + $smartyCacheId = 'blockcategories|'.$id_group.'_'.$id_lang.'_'.$id_product.'_'.$id_category; + + Tools::enableCache(); + if (!$this->isCached('blockcategories.tpl', $smartyCacheId)) + { + $maxdepth = Configuration::get('BLOCK_CATEG_MAX_DEPTH'); + + if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) + WHERE (c.`active` = 1 OR c.`id_category` = 1) + '.((int)($maxdepth) != 0 ? ' AND `level_depth` <= '.(int)($maxdepth) : '').' + AND cg.`id_group` = '.$id_group.' + ORDER BY `level_depth` ASC, c.`position` ASC') + ) + return; + $resultParents = array(); + $resultIds = array(); + + foreach ($result as &$row) + { + $resultParents[$row['id_parent']][] = &$row; + $resultIds[$row['id_category']] = &$row; + } + $blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH')); + unset($resultParents); + unset($resultIds); + $isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false); + + if (Tools::isSubmit('id_category')) + { + $cookie->last_visited_category = $id_category; + $smarty->assign('currentCategoryId', $cookie->last_visited_category); + } + if (Tools::isSubmit('id_product')) + { + if (!isset($cookie->last_visited_category) OR !Product::idIsOnCategoryId($id_product, array('0' => array('id_category' => $cookie->last_visited_category)))) + { + $product = new Product($id_product); + if (isset($product) AND Validate::isLoadedObject($product)) + $cookie->last_visited_category = (int)($product->id_category_default); + } + $smarty->assign('currentCategoryId', (int)($cookie->last_visited_category)); + } + $smarty->assign('blockCategTree', $blockCategTree); + + if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories.tpl')) + $smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl'); + else + $smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl'); + $smarty->assign('isDhtml', $isDhtml); + } + $smarty->cache_lifetime = 31536000; // 1 Year + $display = $this->display(__FILE__, 'blockcategories.tpl', $smartyCacheId); + Tools::restoreCacheSettings(); + return $display; + } + + public function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + public function hookHeader() + { + Tools::addJS(_THEME_JS_DIR_.'tools/treeManagement.js'); + Tools::addCSS(($this->_path).'blockcategories.css', 'all'); + } + + private function _clearBlockcategoriesCache() + { + $this->_clearCache('blockcategories.tpl'); + Tools::restoreCacheSettings(); + } + + public function hookCategoryAddition($params) + { + $this->_clearBlockcategoriesCache(); + } + + public function hookCategoryUpdate($params) + { + $this->_clearBlockcategoriesCache(); + } + + public function hookCategoryDeletion($params) + { + $this->_clearBlockcategoriesCache(); + } + + public function hookAfterCreateHtaccess($params) + { + $this->_clearBlockcategoriesCache(); + } + + public function hookAfterSaveAdminMeta($params) + { + $this->_clearBlockcategoriesCache(); + } +} \ No newline at end of file diff --git a/modules/blockcategories/blockcategories.tpl b/modules/blockcategories/blockcategories.tpl new file mode 100644 index 000000000..a2caeed84 --- /dev/null +++ b/modules/blockcategories/blockcategories.tpl @@ -0,0 +1,49 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Categories' mod='blockcategories'}

        +
        +
          + {* Javascript moved here to fix bug #PSCFI-151 *} + + {foreach from=$blockCategTree.children item=child name=blockCategTree} + {if $smarty.foreach.blockCategTree.last} + {include file="$branche_tpl_path" node=$child last='true'} + {else} + {include file="$branche_tpl_path" node=$child} + {/if} + {/foreach} +
        +
        +
        + diff --git a/modules/blockcategories/category-tree-branch.tpl b/modules/blockcategories/category-tree-branch.tpl new file mode 100644 index 000000000..dd52dd034 --- /dev/null +++ b/modules/blockcategories/category-tree-branch.tpl @@ -0,0 +1,40 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
      • + {$node.name|escape:html:'UTF-8'} + {if $node.children|@count > 0} +
          + {foreach from=$node.children item=child name=categoryTreeBranch} + {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} + {include file="$branche_tpl_path" node=$child last='true'} + {else} + {include file="$branche_tpl_path" node=$child last='false'} + {/if} + {/foreach} +
        + {/if} +
      • diff --git a/modules/blockcategories/config.xml b/modules/blockcategories/config.xml new file mode 100755 index 000000000..fede2ca93 --- /dev/null +++ b/modules/blockcategories/config.xml @@ -0,0 +1,12 @@ + + + blockcategories + Categories block + 2.0 + Adds a block featuring product categories. + PrestaShop + front_office_features + 1 + 1 + + \ No newline at end of file diff --git a/modules/blockcategories/de.php b/modules/blockcategories/de.php new file mode 100644 index 000000000..1b7c45ce8 --- /dev/null +++ b/modules/blockcategories/de.php @@ -0,0 +1,19 @@ +blockcategories_8f0ed7c57fca428f7e3f8e64d2f00918'] = 'Blockkategorien'; +$_MODULE['<{blockcategories}prestashop>blockcategories_15a6f5841d9e4d7e62bec3319b4b7036'] = 'Fügt einen Block mit Produktkategorien hinzu'; +$_MODULE['<{blockcategories}prestashop>blockcategories_23e0d4ecc25de9b2777fdaca3e2f3193'] = 'Maximale Tiefe: Ungültige Zahl.'; +$_MODULE['<{blockcategories}prestashop>blockcategories_0cf328636f0d607ac24a5c435866b94b'] = 'Dynamisches HTML: Ungültige Wahl'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockcategories}prestashop>blockcategories_19561e33450d1d3dfe6af08df5710dd0'] = 'Maximale Tiefe'; +$_MODULE['<{blockcategories}prestashop>blockcategories_ef35cd8f1058f29151991e9ca94b36fb'] = 'Einstellung der maximalen Tiefe der Unterkategorien, die in diesem Block angezeigt werden (0 = unendlich)'; +$_MODULE['<{blockcategories}prestashop>blockcategories_971fd8cc345d8bd9f92e9f7d88fdf20c'] = 'Dynamisch'; +$_MODULE['<{blockcategories}prestashop>blockcategories_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blockcategories}prestashop>blockcategories_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blockcategories}prestashop>blockcategories_2c1199ee18b344152f35ec237acb5796'] = 'Dynamischen Modus für Unterkategorien aktivieren'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Kategorien'; diff --git a/modules/blockcategories/en.php b/modules/blockcategories/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockcategories/en.php @@ -0,0 +1,4 @@ +blockcategories_8f0ed7c57fca428f7e3f8e64d2f00918'] = 'Bloque de categorías '; +$_MODULE['<{blockcategories}prestashop>blockcategories_15a6f5841d9e4d7e62bec3319b4b7036'] = 'Añdir un bloque que ofrezca categorías de productos'; +$_MODULE['<{blockcategories}prestashop>blockcategories_23e0d4ecc25de9b2777fdaca3e2f3193'] = 'Nivel máximo: Número incorrecto'; +$_MODULE['<{blockcategories}prestashop>blockcategories_0cf328636f0d607ac24a5c435866b94b'] = 'HTML dinámico: opción no válida'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blockcategories}prestashop>blockcategories_19561e33450d1d3dfe6af08df5710dd0'] = 'Nivel máximo'; +$_MODULE['<{blockcategories}prestashop>blockcategories_ef35cd8f1058f29151991e9ca94b36fb'] = 'Seleccione el nivel máximo de subniveles a mostrar en este bloque (0=infinito)'; +$_MODULE['<{blockcategories}prestashop>blockcategories_971fd8cc345d8bd9f92e9f7d88fdf20c'] = 'Dinámico'; +$_MODULE['<{blockcategories}prestashop>blockcategories_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blockcategories}prestashop>blockcategories_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blockcategories}prestashop>blockcategories_2c1199ee18b344152f35ec237acb5796'] = 'Modo dinámico activado (animado) para los subniveles'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorías'; diff --git a/modules/blockcategories/fr.php b/modules/blockcategories/fr.php new file mode 100644 index 000000000..af7e6a655 --- /dev/null +++ b/modules/blockcategories/fr.php @@ -0,0 +1,19 @@ +blockcategories_8f0ed7c57fca428f7e3f8e64d2f00918'] = 'Bloc catégories'; +$_MODULE['<{blockcategories}prestashop>blockcategories_15a6f5841d9e4d7e62bec3319b4b7036'] = 'Ajoute un bloc proposant une navigation au sein de vos catégories de produits'; +$_MODULE['<{blockcategories}prestashop>blockcategories_23e0d4ecc25de9b2777fdaca3e2f3193'] = 'Profondeur maximum : nombre invalide'; +$_MODULE['<{blockcategories}prestashop>blockcategories_0cf328636f0d607ac24a5c435866b94b'] = 'Dynamic HTML : choix invalide'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockcategories}prestashop>blockcategories_19561e33450d1d3dfe6af08df5710dd0'] = 'profondeur maximum'; +$_MODULE['<{blockcategories}prestashop>blockcategories_ef35cd8f1058f29151991e9ca94b36fb'] = 'Détermine la profondeur maximale affichée (0 = infinie)'; +$_MODULE['<{blockcategories}prestashop>blockcategories_971fd8cc345d8bd9f92e9f7d88fdf20c'] = 'Dynamique'; +$_MODULE['<{blockcategories}prestashop>blockcategories_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blockcategories}prestashop>blockcategories_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivé'; +$_MODULE['<{blockcategories}prestashop>blockcategories_2c1199ee18b344152f35ec237acb5796'] = 'Activer l\'arbre dynamique (animé)'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories'; diff --git a/modules/blockcategories/it.php b/modules/blockcategories/it.php new file mode 100644 index 000000000..03e1d2b19 --- /dev/null +++ b/modules/blockcategories/it.php @@ -0,0 +1,19 @@ +blockcategories_8f0ed7c57fca428f7e3f8e64d2f00918'] = 'Blocco categorie'; +$_MODULE['<{blockcategories}prestashop>blockcategories_15a6f5841d9e4d7e62bec3319b4b7036'] = 'Aggiunge un blocco con le categorie di prodotto'; +$_MODULE['<{blockcategories}prestashop>blockcategories_23e0d4ecc25de9b2777fdaca3e2f3193'] = 'Profondità massima: numero non valido.'; +$_MODULE['<{blockcategories}prestashop>blockcategories_0cf328636f0d607ac24a5c435866b94b'] = 'HTML dinamico: scelta non valida.'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockcategories}prestashop>blockcategories_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockcategories}prestashop>blockcategories_19561e33450d1d3dfe6af08df5710dd0'] = 'Profondità massima'; +$_MODULE['<{blockcategories}prestashop>blockcategories_ef35cd8f1058f29151991e9ca94b36fb'] = 'Imposta la profondità massima di sottolivelli visualizzati in questo blocco (0 = infinito)'; +$_MODULE['<{blockcategories}prestashop>blockcategories_971fd8cc345d8bd9f92e9f7d88fdf20c'] = 'Dinamico'; +$_MODULE['<{blockcategories}prestashop>blockcategories_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blockcategories}prestashop>blockcategories_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blockcategories}prestashop>blockcategories_2c1199ee18b344152f35ec237acb5796'] = 'Attiva modalità dinamica (animato) per sottolivelli'; +$_MODULE['<{blockcategories}prestashop>blockcategories_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockcategories}prestashop>blockcategories_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorie'; diff --git a/modules/blockcategories/logo.gif b/modules/blockcategories/logo.gif new file mode 100644 index 000000000..779ad58ef Binary files /dev/null and b/modules/blockcategories/logo.gif differ diff --git a/modules/blockcms/ajax_blockcms.php b/modules/blockcms/ajax_blockcms.php new file mode 100755 index 000000000..9958df19c --- /dev/null +++ b/modules/blockcms/ajax_blockcms.php @@ -0,0 +1,112 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once('../../config/config.inc.php'); +include_once('../../init.php'); +include_once('blockcms.php'); + +$blockcms = new BlockCms(); +if (!Tools::isSubmit('secure_key') OR Tools::getValue('secure_key') != $blockcms->secure_key OR !Tools::isSubmit('action')) + die(1); + +if (Tools::getValue('action') == 'getCms') +{ + if (!Validate::isInt(Tools::getValue('id_cms_category')) OR !Tools::getValue('id_cms_category')) + die(1); + + $cms_categories = Db::getInstance()->ExecuteS(' + SELECT * FROM `'._DB_PREFIX_.'cms_category` c + JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category`) + WHERE c.`id_parent` = '.(int)(Tools::getValue('id_cms_category')).' + AND cl.`id_lang` = '.(int)($cookie->id_lang).' + ORDER BY c.`id_cms_category`'); + $cms_pages = Db::getInstance()->ExecuteS(' + SELECT cl.`meta_title`, c.`id_cms` FROM `'._DB_PREFIX_.'cms` c + JOIN `'._DB_PREFIX_.'cms_lang` cl ON (c.`id_cms` = cl.`id_cms`) + WHERE c.`id_cms_category` = '.(int)(Tools::getValue('id_cms_category')).' + AND c.`active` = 1 + AND cl.`id_lang` = '.(int)($cookie->id_lang).' + ORDER BY c.`id_cms`'); + if (Tools::getValue('id_cms_block')) + $cms_selected = Db::getInstance()->ExecuteS(' + SELECT `is_category`, `id_cms` FROM `'._DB_PREFIX_.'cms_block_page` + WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block'))); + $html = ''; + + if (sizeof($cms_categories) OR sizeof($cms_pages)) + { + $html .= ' + + + + + + + + + '; + foreach ($cms_categories as $cms_category) + { + $html .= ' + + + + + '; + } + foreach ($cms_pages as $cms_page) + { + $html .= ' + + + + + '; + } + } + else + { + $html .= $blockcms->getL('There is nothing to display in this CMS category'); + } + + echo $html; +} +elseif (Tools::getValue('action') == 'dnd') +{ + if ($table = Tools::getValue('table_right') OR $table = Tools::getValue('table_left')); + { + $pos = 0; + foreach ($table as $key =>$row) + { + $ids = explode('_', $row); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cms_block` SET `position` = '.(int)($pos).' WHERE `id_cms_block` = '.(int)($ids[2])); + $pos++; + } + } +} + + diff --git a/modules/blockcms/blockcms.js b/modules/blockcms/blockcms.js new file mode 100755 index 000000000..f40d72a4f --- /dev/null +++ b/modules/blockcms/blockcms.js @@ -0,0 +1,144 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function CMSCategory_js(value, secure_key) +{ + $.ajax({ + type: "POST", + url: '../modules/blockcms/ajax_blockcms.php', + data: 'id_cms_category='+value+'&id_cms_block='+$('#id_cms_block').val()+'&action=getCms&secure_key='+secure_key, + async : false, + success: function(msg) + { + $('#cms_subcategories').html(msg); + } + }); +} + +function checkallCMSBoxes(checked) +{ + if (checked) + $('.cmsBox').attr('checked', "checked"); + else + $('.cmsBox').attr('checked', ""); +} + +function CMSBlocksDnD(secure_key) +{ + $(document).ready(function() + { + $("#table_right").tableDnD({ + onDragStart: function(table, row) { + originalOrder = $.tableDnD.serialize(); + reOrder = ':even'; + if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row')) + reOrder = ':odd'; + }, + dragHandle: 'dragHandle', + onDragClass: 'myDragClass', + onDrop: function(table, row) { + if (originalOrder != $.tableDnD.serialize()) + { + var tableDrag = $('#' + table.id); + $.ajax({ + type: 'POST', + async: false, + url: '../modules/blockcms/ajax_blockcms.php?' + $.tableDnD.serialize(), + data: 'action=dnd&secure_key='+secure_key, + success: function(data) { + tableDrag.find('tbody tr').removeClass('alt_row'); + tableDrag.find('tbody tr' + reOrder).addClass('alt_row'); + tableDrag.find('tbody td.positions').each(function(i) { + $(this).html(i+1); + }); + tableDrag.find('tbody td.dragHandle a:hidden').show(); + tableDrag.find('tbody td.dragHandle:last a:even').hide(); + tableDrag.find('tbody td.dragHandle:first a:odd').hide(); + var reg = /_[0-9]$/g; + tableDrag.find('tbody tr').each(function(i) { + $(this).attr('id', $(this).attr('id').replace(reg, '_' + i)); + + // Update link position + var up_reg = new RegExp('position=[-]?[0-9]+&'); + + // Up links + $(this).find('td.dragHandle a:odd').attr('href', $(this).find('td.dragHandle a:odd').attr('href').replace(up_reg, 'position='+ (i - 1) +'&')); + + // Down links + $(this).find('td.dragHandle a:even').attr('href', $(this).find('td.dragHandle a:even').attr('href').replace(up_reg, 'position='+ (i + 1) +'&')); + }); + } + }); + } + } + }); + $("#table_left").tableDnD({ + onDragStart: function(table, row) { + originalOrder = $.tableDnD.serialize(); + reOrder = ':even'; + if (table.tBodies[0].rows[1] && $('#' + table.tBodies[0].rows[1].id).hasClass('alt_row')) + reOrder = ':odd'; + }, + dragHandle: 'dragHandle', + onDragClass: 'myDragClass', + onDrop: function(table, row) { + if (originalOrder != $.tableDnD.serialize()) + { + var tableDrag = $('#' + table.id); + $.ajax({ + type: 'POST', + async: false, + url: '../modules/blockcms/ajax_blockcms.php?' + $.tableDnD.serialize(), + data: 'action=dnd&secure_key='+secure_key, + success: function(data) { + tableDrag.find('tbody tr').removeClass('alt_row'); + tableDrag.find('tbody tr' + reOrder).addClass('alt_row'); + tableDrag.find('tbody td.positions').each(function(i) { + $(this).html(i+1); + }); + tableDrag.find('tbody td.dragHandle a:hidden').show(); + tableDrag.find('tbody td.dragHandle:last a:even').hide(); + tableDrag.find('tbody td.dragHandle:first a:odd').hide(); + var reg = /_[0-9]$/g; + tableDrag.find('tbody tr').each(function(i) { + $(this).attr('id', $(this).attr('id').replace(reg, '_' + i)); + + // Update link position + var up_reg = new RegExp('position=[-]?[0-9]+&'); + + // Up links + $(this).find('td.dragHandle a:odd').attr('href', $(this).find('td.dragHandle a:odd').attr('href').replace(up_reg, 'position='+ (i - 1) +'&')); + + // Down links + $(this).find('td.dragHandle a:even').attr('href', $(this).find('td.dragHandle a:even').attr('href').replace(up_reg, 'position='+ (i + 1) +'&')); + }); + } + }); + } + } + }); + }); +} diff --git a/modules/blockcms/blockcms.php b/modules/blockcms/blockcms.php new file mode 100755 index 000000000..74f64e883 --- /dev/null +++ b/modules/blockcms/blockcms.php @@ -0,0 +1,720 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class BlockCms extends Module +{ + private $_html; + + public function __construct() + { + $this->name = 'blockcms'; + $this->tab = 'front_office_features'; + $this->version = 1.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('CMS Block'); + $this->description = $this->l('Adds a block with several CMS links.'); + $this->secure_key = Tools::encrypt($this->name); + } + + public function install() + { + $languages = Language::getLanguages(false); + $queryLang = 'INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`) VALUES'; + foreach ($languages AS $language) + $queryLang .= '(1, '.(int)($language['id_lang']).'),'; + + if (!parent::install() OR !$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn') OR !$this->registerHook('footer') OR !$this->registerHook('header') OR + !Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block`( + `id_cms_block` int(10) unsigned NOT NULL auto_increment, + `id_cms_category` int(10) unsigned NOT NULL, + `location` tinyint(1) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL default \'0\', + `display_store` tinyint(1) unsigned NOT NULL default \'1\', + PRIMARY KEY (`id_cms_block`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR + !Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `location`, `position`) VALUES(1, 0, 0)') OR + !Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_lang`( + `id_cms_block` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(40) NOT NULL default \'\', + PRIMARY KEY (`id_cms_block`, `id_lang`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR + !Db::getInstance()->Execute(rtrim($queryLang, ',')) OR + !Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_page`( + `id_cms_block_page` int(10) unsigned NOT NULL auto_increment, + `id_cms_block` int(10) unsigned NOT NULL, + `id_cms` int(10) unsigned NOT NULL, + `is_category` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`id_cms_block_page`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR + !Configuration::updateValue('FOOTER_CMS', '') OR + !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1)) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall() OR + !Configuration::deleteByName('FOOTER_CMS') OR + !Configuration::deleteByName('FOOTER_BLOCK_ACTIVATION') OR + !Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'cms_block` , `'._DB_PREFIX_.'cms_block_page`, `'._DB_PREFIX_.'cms_block_lang`')) + return false; + return true; + } + + public function getBlockCMS($id_cms_block) + { + $cmsBlocks = Db::getInstance()->ExecuteS(' + SELECT cb.`id_cms_category`, cb.`location`, cb.`display_store`, cbl.id_lang, cbl.name + FROM `'._DB_PREFIX_.'cms_block` cb + LEFT JOIN `'._DB_PREFIX_.'cms_block_lang` cbl ON (cbl.`id_cms_block` = cb.`id_cms_block`) + WHERE cb.`id_cms_block` = '.(int)($id_cms_block)); + + foreach ($cmsBlocks AS $cmsBlock) + $cmsBlocks['name'][(int)$cmsBlock['id_lang']] = $cmsBlock['name']; + return $cmsBlocks; + } + + private function getBlocksCMS($location) + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT bc.`id_cms_block`, bcl.`name` block_name, ccl.`name` category_name, bc.`position`, bc.`id_cms_category`, bc.`display_store` + FROM `'._DB_PREFIX_.'cms_block` bc + INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`) + INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`) + WHERE ccl.`id_lang` = '.(int)($cookie->id_lang).' AND bc.`location` = '.(int)($location).' AND bcl.`id_lang` = '.(int)($cookie->id_lang).' + ORDER BY bc.`position`'); + } + + public function getAllBlocksCMS() + { + return array_merge($this->getBlocksCMS(0), $this->getBlocksCMS(1)); + } + + static public function getCMStitlesFooter() + { + global $cookie; + + $footerCms = Configuration::get('FOOTER_CMS'); + if (empty($footerCms)) + return array(); + $cmsCategories = explode('|', $footerCms); + $content = array(); + $link = new Link(); + foreach ($cmsCategories AS $cmsCategory) + { + $ids = explode('_', $cmsCategory); + if ($ids[0] == 1) + { + $query = Db::getInstance()->getRow(' + SELECT cl.`name`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_category_lang` cl + INNER JOIN `'._DB_PREFIX_.'cms_category` c ON (cl.`id_cms_category` = c.`id_cms_category`) + WHERE cl.`id_cms_category` = '.(int)($ids[1]).' AND (c.`active` = 1 OR c.`id_cms_category` = 1) + AND cl.`id_lang` = '.(int)($cookie->id_lang)); + + $content[$cmsCategory]['link'] = $link->getCMSCategoryLink((int)$ids[1], $query['link_rewrite']); + $content[$cmsCategory]['meta_title'] = $query['name']; + } + elseif (!$ids[0]) + { + $query = Db::getInstance()->getRow(' + SELECT cl.`meta_title`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_lang` cl + INNER JOIN `'._DB_PREFIX_.'cms` c ON (cl.`id_cms` = c.`id_cms`) + WHERE cl.`id_cms` = '.(int)($ids[1]).' AND c.`active` = 1 + AND cl.`id_lang` = '.(int)($cookie->id_lang)); + + $content[$cmsCategory]['link'] = $link->getCMSLink((int)$ids[1], $query['link_rewrite']); + $content[$cmsCategory]['meta_title'] = $query['meta_title']; + } + } + + return $content; + } + + static public function getCMStitles($location) + { + global $cookie; + + $cmsCategories = Db::getInstance()->ExecuteS(' + SELECT bc.`id_cms_block`, bc.`id_cms_category`, bc.`display_store`, ccl.`link_rewrite`, ccl.`name` category_name, bcl.`name` block_name + FROM `'._DB_PREFIX_.'cms_block` bc + INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`) + INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`) + WHERE bc.`location` = '.(int)($location).' AND ccl.`id_lang` = '.(int)($cookie->id_lang).' AND bcl.`id_lang` = '.(int)($cookie->id_lang).' + ORDER BY `position`'); + + $content = array(); + $link = new Link(); + if (is_array($cmsCategories) AND sizeof($cmsCategories)) + foreach ($cmsCategories AS $cmsCategory) + { + $key = (int)$cmsCategory['id_cms_block']; + $content[$key]['display_store'] = $cmsCategory['display_store']; + + $content[$key]['cms'] = Db::getInstance()->ExecuteS(' + SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_block_page` bcp + INNER JOIN `'._DB_PREFIX_.'cms_lang` cl ON (bcp.`id_cms` = cl.`id_cms`) + INNER JOIN `'._DB_PREFIX_.'cms` c ON (bcp.`id_cms` = c.`id_cms`) + WHERE bcp.`id_cms_block` = '.(int)($cmsCategory['id_cms_block']).' AND cl.`id_lang` = '.(int)($cookie->id_lang).' AND bcp.`is_category` = 0 AND c.`active` = 1 + ORDER BY `position`'); + + $links = array(); + if (sizeof($content[$key]['cms'])) + foreach ($content[$key]['cms'] AS $row) + { + $row['link'] = $link->getCMSLink((int)($row['id_cms']), $row['link_rewrite']); + $links[] = $row; + } + + $content[$key]['cms'] = $links; + + $content[$key]['categories'] = Db::getInstance()->ExecuteS(' + SELECT bcp.`id_cms`, cl.`name`, cl.`link_rewrite` + FROM `'._DB_PREFIX_.'cms_block_page` bcp + INNER JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (bcp.`id_cms` = cl.`id_cms_category`) + WHERE bcp.`id_cms_block` = '.(int)($cmsCategory['id_cms_block']).' + AND cl.`id_lang` = '.(int)($cookie->id_lang).' + AND bcp.`is_category` = 1'); + + $links = array(); + if (sizeof($content[$key]['categories'])) + foreach ($content[$key]['categories'] as $row) + { + $row['link'] = $link->getCMSCategoryLink((int)($row['id_cms']), $row['link_rewrite']); + $links[] = $row; + } + + $content[$key]['categories'] = $links; + $content[$key]['name'] = $cmsCategory['block_name']; + $content[$key]['category_link'] = $link->getCMSCategoryLink((int)($cmsCategory['id_cms_category']), $cmsCategory['link_rewrite']); + $content[$key]['category_name'] = $cmsCategory['category_name']; + } + + return $content; + } + + public function getAllCMSTitles() + { + $titles = array(); + foreach(self::getCMStitles(0) AS $key => $title) + { + unset($title['categories']); + unset($title['name']); + unset($title['category_link']); + unset($title['category_name']); + $titles[$key] = $title; + } + foreach(self::getCMStitles(1) AS $key => $title) + { + unset($title['categories']); + unset($title['name']); + unset($title['category_link']); + unset($title['category_name']); + $titles[$key] = $title; + } + return $titles; + } + + private function displayRecurseCheckboxes($categories, $selected, $has_suite = array()) + { + static $irow = 0; + + $img = $categories['level_depth'] == 0 ? 'lv1.gif' : 'lv'.($categories['level_depth'] + 1).'_'.((sizeof($categories['cms']) OR isset($categories['children'])) ? 'b' : 'f').'.gif'; + + $this->_html .= ' + + + + + '; + if (isset($categories['children'])) + foreach ($categories['children'] as $key => $category) + { + $has_suite[$categories['level_depth']] = 1; + if (sizeof($categories['children']) == $key + 1 AND !sizeof($categories['cms'])) + $has_suite[$categories['level_depth']] = 0; + $this->displayRecurseCheckboxes($category, $selected, $has_suite, 0); + } + + $cpt = 0; + foreach ($categories['cms'] as $cms) + { + $this->_html .= ' + + + + + '; + } + } + + private function _displayForm() + { + global $currentIndex, $cookie; + + $cms_blocks_left = $this->getBlocksCMS(0); + $cms_blocks_right = $this->getBlocksCMS(1); + + $this->_html .= ' + + + +
        + '.$this->l('CMS block configuration').' + +

        '.$this->l('Add a new CMS block').'

        '; + + $this->_html .= '

        '.$this->l('List of Left CMS blocks').'

        '; + if (sizeof($cms_blocks_left)) + { + $this->_html .= '
        '.$blockcms->getL('ID').''.$blockcms->getL('Name').'
        $cms_category['id_cms_category'], 'is_category' => 1), $cms_selected) ? 'checked="checked"' : '').'>'.$cms_category['id_cms_category'].''.$cms_category['name'].'
        $cms_page['id_cms'], 'is_category' => 0), $cms_selected) ? 'checked="checked"' : '').'>'.$cms_page['id_cms'].''.$cms_page['meta_title'].'
        '.$categories['id_cms_category'].''; + for ($i = 1; $i < $categories['level_depth']; $i++) + $this->_html .= ''; + $this->_html .= '   +
        '.$cms['id_cms'].''; + for ($i = 0; $i < $categories['level_depth']; $i++) + $this->_html .= ''; + $this->_html .= '   +
        + + + + + + + + + + + '; + $irow = 0; + foreach ($cms_blocks_left as $cms_block) + { + $this->_html .= ' + + + + + + + '; + } + $this->_html .= ' + +
        '.$this->l('ID').''.$this->l('Name of block').''.$this->l('Category Name').''.$this->l('Position').''.$this->l('Actions').'
        '.$cms_block['id_cms_block'].''.(empty($cms_block['block_name']) ? $cms_block['category_name'] : $cms_block['block_name']).''.$cms_block['category_name'].' + + '.$this->l('Down').' + + '.$this->l('Up').' + + + +
        '; + } + else + $this->_html .= '

        '.$this->l('There is no CMS block set').'

        '; + $this->_html .= '
        '; + + $this->_html .= '

        '.$this->l('List of Right CMS blocks').'

        '; + if (sizeof($cms_blocks_right)) + { + $this->_html .= ' + + + + + + + + + + + '; + $irow = 0; + foreach ($cms_blocks_right as $cms_block) + { + $this->_html .= ' + + + + + + + '; + } + $this->_html .= ' + +
        '.$this->l('ID').''.$this->l('Name of block').''.$this->l('Category Name').''.$this->l('Position').''.$this->l('Actions').'
        '.$cms_block['id_cms_block'].''.(empty($cms_block['block_name']) ? $cms_block['category_name'] : $cms_block['block_name']).''.$cms_block['category_name'].' + + '.$this->l('Down').' + + '.$this->l('Up').' + + + +
        '; + } + else + $this->_html .= '

        '.$this->l('There is no CMS block set').'

        '; + $this->_html .= '
        +
        +
        +
        +
        + '.$this->l('Footer\'s various links Configuration').' +

        + + + + + + '; + $this->displayRecurseCheckboxes(CMSCategory::getRecurseCategory($cookie->id_lang), explode('|', Configuration::get('FOOTER_CMS'))); + $this->_html .= ' +
        '.$this->l('ID').''.$this->l('Name').'
        +

        +
        +
        '; + } + + private function _displayAddForm() + { + global $currentIndex, $cookie; + + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $divLangName = 'name'; + + $cmsBlock = NULL; + if (Tools::isSubmit('editBlockCMS') AND Tools::getValue('id_cms_block')) + $cmsBlock = $this->getBlockCMS((int)(Tools::getValue('id_cms_block'))); + + $this->_html .= ' + + +
        + '; + if (Tools::getValue('id_cms_block')) + $this->_html .= ''; + $this->_html .= ' +
        '; + + if (Tools::isSubmit('addBlockCMS')) + $this->_html .= ' '.$this->l('New CMS block').''; + elseif (Tools::isSubmit('editBlockCMS')) + $this->_html .= ' '.$this->l('Edit CMS block').''; + + $this->_html .= ' + +
        '; + + foreach ($languages as $language) + $this->_html .= ' +
        + +
        '; + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'name', true); + $this->_html .= '

        '.$this->l('If you leave this field empty, the block name will use the category name').'

        +

        + +
        + +

        + + +
        + +
        '; + $this->_html .= ' + +
        + Yes + + + No + +
        ' + .$this->l('Display "our stores" at the end of the block') + .'
        '; + $this->_html .= '
        +

        + + '.$this->l('Cancel').' +

        '; + + $this->_html .= ' +
        +
        + '; + } + + private function _postValidation() + { + $errors = array(); + if (Tools::isSubmit('submitBlockCMS')) + { + $languages = Language::getLanguages(false); + $cmsBoxes = Tools::getValue('cmsBox'); + if (!Validate::isInt(Tools::getValue('PS_STORES_DISPLAY_CMS')) OR (Tools::getValue('PS_STORES_DISPLAY_CMS') != 0 AND Tools::getValue('PS_STORES_DISPLAY_CMS') != 1)) + $errors[] = $this->l('Invalid store display'); + if (!Validate::isInt(Tools::getValue('block_location')) OR (Tools::getValue('block_location') != 0 AND Tools::getValue('block_location') != 1)) + $errors[] = $this->l('Invalid block location'); + if (!is_array($cmsBoxes)) + $errors[] = $this->l('You must choose at least one page or subcategory to create a CMS block.'); + else + foreach ($cmsBoxes as $cmsBox) + if (!preg_match("#^[01]_[0-9]+$#", $cmsBox)) + $errors[] = $this->l('Invalid CMS page or category'); + foreach ($languages as $language) + if (strlen(Tools::getValue('block_name_'.$language['id_lang'])) > 40) + $errors[] = $this->l('Block name is too long'); + } + elseif (Tools::isSubmit('deleteBlockCMS') AND !Validate::isInt(Tools::getValue('id_cms_block'))) + $errors[] = $this->l('Invalid id_cms_block'); + elseif (Tools::isSubmit('submitFooterCMS')) + { + if (Tools::getValue('footerBox')) + foreach (Tools::getValue('footerBox') as $cmsBox) + if (!preg_match("#^[01]_[0-9]+$#", $cmsBox)) + $errors[] = $this->l('Invalid CMS page or category'); + if (Tools::getValue('footer_active') != 0 AND Tools::getValue('footer_active') != 1) + $errors[] = $this->l('Invalid activation footer'); + } + if (sizeof($errors)) + { + $this->_html .= $this->displayError(implode('
        ', $errors)); + return false; + } + return true; + } + + private function changePosition() + { + $this->_html .= 'pos change!'; + if (Tools::getValue('way') == 0) + { + if (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block` + SET `position` = '.((int)(Tools::getValue('position')) + 1).' + WHERE `position` = '.((int)(Tools::getValue('position'))).' + AND `location` = '.(int)(Tools::getValue('location')))) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block` + SET `position` = '.((int)(Tools::getValue('position'))).' + WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block'))); + } + elseif (Tools::getValue('way') == 1) + { + if(Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block` + SET `position` = '.((int)(Tools::getValue('position')) - 1).' + WHERE `position` = '.((int)(Tools::getValue('position'))).' + AND `location` = '.(int)(Tools::getValue('location')))) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block` + SET `position` = '.((int)(Tools::getValue('position'))).' + WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block'))); + } + Tools::redirectAdmin($currentIndex.'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules')); + } + + private function _postProcess() + { + global $currentIndex; + + if (Tools::isSubmit('submitBlockCMS')) + { + $position = Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'cms_block` WHERE location = '.(int)(Tools::getValue('block_location'))); + $languages = Language::getLanguages(false); + if (Tools::isSubmit('addBlockCMS')) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `location`, `position`, `display_store`) VALUES('.(int)(Tools::getValue('id_category')).', '.(int)(Tools::getValue('block_location')).', '.(int)($position).', '.(int)(Tools::getValue('PS_STORES_DISPLAY_CMS')).')'); + $id_cms_block = Db::getInstance()->Insert_ID(); + foreach ($languages as $language) + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES('.(int)($id_cms_block).', '.(int)($language['id_lang']).', "'.pSQL(Tools::getValue('block_name_'.$language['id_lang'])).'")'); + } + elseif (Tools::isSubmit('editBlockCMS')) + { + $id_cms_block = Tools::getvalue('id_cms_block'); + $old_block = Db::getInstance()->ExecuteS('SELECT `location`, `position` FROM `'._DB_PREFIX_.'cms_block` WHERE `id_cms_block` = '.(int)($id_cms_block)); + $location_change = ($old_block[0]['location'] != (int)(Tools::getvalue('block_location'))); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cms_block_page` WHERE `id_cms_block` = '.(int)($id_cms_block)); + if ($location_change == true) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cms_block` SET `position` = (`position` - 1) WHERE `position` > '.(int)($old_block[0]['position']).' AND `location` = '.(int)($old_block[0]['location'])); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block` + SET `location` = '.(int)(Tools::getvalue('block_location')).', + `id_cms_category` = '.(int)(Tools::getvalue('id_category')).' + '.($location_change == true ? ', + `position` = '.(int)($position) : '').', + `display_store` = '.(int)(Tools::getValue('PS_STORES_DISPLAY_CMS')).' + WHERE `id_cms_block` = '.(int)($id_cms_block)); + + foreach ($languages as $language) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cms_block_lang` SET `name` = "'.pSQL(Tools::getValue('block_name_'.$language['id_lang'])).'" WHERE `id_cms_block` = '.(int)($id_cms_block).' AND `id_lang`= '.(int)($language['id_lang'])); + } + $cmsBoxes = Tools::getValue('cmsBox'); + if (sizeof($cmsBoxes)) + foreach ($cmsBoxes as $cmsBox) + { + $cms_properties = explode('_', $cmsBox); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`) + VALUES('.(int)($id_cms_block).', '.(int)($cms_properties[1]).', '.(int)($cms_properties[0]).')'); + } + if (Tools::isSubmit('addBlockCMS')) + Tools::redirectAdmin($currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addBlockCMSConfirmation'); + elseif (Tools::isSubmit('editBlockCMS')) + Tools::redirectAdmin($currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMSConfirmation'); + } + elseif (Tools::isSubmit('deleteBlockCMS') AND Tools::getValue('id_cms_block')) + { + $old_block = Db::getInstance()->ExecuteS('SELECT `location`, `position` FROM `'._DB_PREFIX_.'cms_block` WHERE `id_cms_block` = '.Tools::getvalue('id_cms_block')); + if (sizeof($old_block)) + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'cms_block` SET `position` = (`position` - 1) WHERE `position` > '.$old_block[0]['position'].' AND `location` = '.$old_block[0]['location']); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cms_block` WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block'))); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cms_block_page` WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block'))); + Tools::redirectAdmin($currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMSConfirmation'); + } + else + $this->_html .= $this->displayError($this->l('Error: you are trying to delete a non-existent block cms')); + } + elseif (Tools::isSubmit('submitFooterCMS')) + { + $footer = ''; + if (Tools::getValue('footerBox')) + foreach (Tools::getValue('footerBox') as $box) + $footer .= $box.'|'; + Configuration::updateValue('FOOTER_CMS', rtrim($footer, '|')); + Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', Tools::getValue('footer_active')); + $this->_html = $this->displayConfirmation($this->l('Footer\'s CMS updated')); + } + elseif (Tools::isSubmit('addBlockCMSConfirmation')) + $this->_html = $this->displayConfirmation($this->l('Block CMS added')); + elseif (Tools::isSubmit('editBlockCMSConfirmation')) + $this->_html = $this->displayConfirmation($this->l('Block CMS edited')); + elseif (Tools::isSubmit('deleteBlockCMSConfirmation')) + $this->_html .= $this->displayConfirmation($this->l('Deletion succesfull')); + elseif (Tools::isSubmit('id_cms_block') AND Tools::isSubmit('way') AND Tools::isSubmit('position') AND Tools::isSubmit('location')) + $this->changePosition(); + } + + public function getContent() + { + $this->_html = ''; + if ($this->_postValidation()) + $this->_postProcess(); + $this->_html .= '

        '.$this->l('CMS Block configuration').'

        '; + if (Tools::isSubmit('addBlockCMS') OR Tools::isSubmit('editBlockCMS')) + $this->_displayAddForm(); + else + $this->_displayForm(); + return $this->_html; + } + + public function hookLeftColumn() + { + global $smarty; + + $cms_titles = self::getCMStitles(0); + $smarty->assign(array( + 'block' => 1, + 'cms_titles' => $cms_titles, + 'theme_dir' => _PS_THEME_DIR_ + )); + return $this->display(__FILE__, 'blockcms.tpl'); + } + + public function hookRightColumn() + { + global $smarty; + + $cms_titles = self::getCMStitles(1); + $smarty->assign(array( + 'block' => 1, + 'cms_titles' => $cms_titles, + 'theme_dir' => _PS_THEME_DIR_ + )); + return $this->display(__FILE__, 'blockcms.tpl'); + } + + public function hookFooter() + { + global $smarty; + + if (Configuration::get('FOOTER_BLOCK_ACTIVATION')) + { + $cms_titles = self::getCMStitlesFooter(); + $smarty->assign(array( + 'block' => 0, + 'cmslinks' => $cms_titles, + 'theme_dir' => _PS_THEME_DIR_, + 'display_stores_footer' => Configuration::get('PS_STORES_DISPLAY_FOOTER') + )); + return $this->display(__FILE__, 'blockcms.tpl'); + } + return ''; + } + + public function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockcms.css', 'all'); + } + + public function getL($key) + { + $trad = array( + 'ID' => $this->l('ID'), + 'Name' => $this->l('Name'), + 'There is nothing to display in this CMS category' => $this->l('There is nothing to display in this CMS category') + ); + return $trad[$key]; + } +} diff --git a/modules/blockcms/blockcms.tpl b/modules/blockcms/blockcms.tpl new file mode 100755 index 000000000..813e8330e --- /dev/null +++ b/modules/blockcms/blockcms.tpl @@ -0,0 +1,62 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $block == 1} + + {foreach from=$cms_titles key=cms_key item=cms_title} +
        +

        {if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}

        + +
        + {/foreach} + +{else} + + + +{/if} diff --git a/modules/blockcms/config.xml b/modules/blockcms/config.xml new file mode 100755 index 000000000..b4ab76480 --- /dev/null +++ b/modules/blockcms/config.xml @@ -0,0 +1,12 @@ + + + blockcms + CMS Block + 1.1 + Adds a block with several CMS links. + PrestaShop + front_office_features + 1 + 1 + + \ No newline at end of file diff --git a/modules/blockcms/de.php b/modules/blockcms/de.php new file mode 100644 index 000000000..8a8a67a52 --- /dev/null +++ b/modules/blockcms/de.php @@ -0,0 +1,57 @@ +blockcms_cd275312651aebf8cbbb8d3bb1c086ae'] = 'CMS-Block'; +$_MODULE['<{blockcms}prestashop>blockcms_cdca12007979fc49008fd125cdb775fc'] = 'Fügt einen Block mit mehreren CMS-Links hinzu'; +$_MODULE['<{blockcms}prestashop>blockcms_97390dd0b5ba7867120aee2ff22bfa38'] = 'CMS-Block-Konfiguration'; +$_MODULE['<{blockcms}prestashop>blockcms_1cd127158cfd245511751206f4b3c6f0'] = 'Einen neuen CMS-Block hinzufügen'; +$_MODULE['<{blockcms}prestashop>blockcms_6e1ea63625a85f6d2d9ecbfb79586351'] = 'Liste der übrigen CMS-Blocks'; +$_MODULE['<{blockcms}prestashop>blockcms_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blockcms}prestashop>blockcms_aae551ce0c29dfe39b0ff20139abdef3'] = 'Blockname'; +$_MODULE['<{blockcms}prestashop>blockcms_99121ab27aaa7472cfada9071c5ba434'] = 'Kategorienname'; +$_MODULE['<{blockcms}prestashop>blockcms_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position'; +$_MODULE['<{blockcms}prestashop>blockcms_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen'; +$_MODULE['<{blockcms}prestashop>blockcms_08a38277b0309070706f6652eeae9a53'] = 'Ab'; +$_MODULE['<{blockcms}prestashop>blockcms_258f49887ef8d14ac268c92b02503aaa'] = 'Auf'; +$_MODULE['<{blockcms}prestashop>blockcms_7dce122004969d56ae2e0245cb754d35'] = 'Bearbeiten'; +$_MODULE['<{blockcms}prestashop>blockcms_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockcms}prestashop>blockcms_8f08c1af47e3e9611289c1882befc3a8'] = 'Es wurde keine CMS-Block-Einstellung vorgenommen'; +$_MODULE['<{blockcms}prestashop>blockcms_0a40c06f34e5c794a7f0d3085d17d63a'] = 'Liste rechter CMS-Blocks'; +$_MODULE['<{blockcms}prestashop>blockcms_965be994da393e5aa15bd3a2444c6ccf'] = 'Konfiguration verschiedener Links in der Fußzeile'; +$_MODULE['<{blockcms}prestashop>blockcms_fab8ca8250236ed20b96f9750e1eacc7'] = 'Anzeige der verschiedenen Links in der Fußzeile'; +$_MODULE['<{blockcms}prestashop>blockcms_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Neuer CMS-Block'; +$_MODULE['<{blockcms}prestashop>blockcms_e83c1afa1d3dbe19fa9becebb5ca8480'] = 'CMS-Block bearbeiten'; +$_MODULE['<{blockcms}prestashop>blockcms_7d9a9a0187e212cb7fd126afb8704bd1'] = 'Blockname'; +$_MODULE['<{blockcms}prestashop>blockcms_bdbaef442c586e1bbecb44eba1ba7e2d'] = 'Wenn Sie dieses Feld leer lassen, übernimmt der Blockname den Kategorienamen'; +$_MODULE['<{blockcms}prestashop>blockcms_7310626b183e1bcfcc61b844e8ea3c5c'] = 'Wählen Sie eine CMS-Kategorie:'; +$_MODULE['<{blockcms}prestashop>blockcms_be9469719aa6efa2fc3bd5768bc406d7'] = 'Position:'; +$_MODULE['<{blockcms}prestashop>blockcms_945d5e233cf7d6240f6b783b36a374ff'] = 'Links'; +$_MODULE['<{blockcms}prestashop>blockcms_92b09c7c48c520c3c55e497875da437c'] = 'Rechts'; +$_MODULE['<{blockcms}prestashop>blockcms_1acef6bfa7dc3360eed6bf44851fa6a4'] = 'Shops anzeigen'; +$_MODULE['<{blockcms}prestashop>blockcms_93cba07454f06a4a960172bbd6e2a435'] = 'Ja '; +$_MODULE['<{blockcms}prestashop>blockcms_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{blockcms}prestashop>blockcms_08f3899ad165f85f8596199966b8c673'] = '\"Unsere Shops\" anzeigen am Ende des Blocks'; +$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{blockcms}prestashop>blockcms_f7df0009efd65cec8e54cf4ef30abf5e'] = 'Ungültige Shop-Anzeige'; +$_MODULE['<{blockcms}prestashop>blockcms_903d12e7aa8c380c290b78c1898e01b7'] = 'Ungültige Block-Position'; +$_MODULE['<{blockcms}prestashop>blockcms_92fc29650a0f9dd3fca4e5de1845f78b'] = 'Sie müssen mindestens eine Seite oder Unterkategorie wählen, um einen CMS-Block zu erstellen'; +$_MODULE['<{blockcms}prestashop>blockcms_5e75cbfbfd02a7b2fab0ed21505e811b'] = 'Ungültige CMS-Seite oder Kategorie'; +$_MODULE['<{blockcms}prestashop>blockcms_420d575844f77db5299065080d9c237f'] = 'Blockname ist zu lang'; +$_MODULE['<{blockcms}prestashop>blockcms_c12d11dfdaf316576221cf4319fbd7fc'] = 'Ungültig_id_Block_CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_05b51791a83d3cef29ad68b70d48d131'] = 'Ungültige Aktivierung Fußzeile'; +$_MODULE['<{blockcms}prestashop>blockcms_5dab5acc3c6a2a7e87e8d8926a2c763e'] = 'Versucht einen nicht vorhandenen CMS-Block zu löschen'; +$_MODULE['<{blockcms}prestashop>blockcms_138218281781fd0d938a140892d7386c'] = 'Fußzeilen-CMS erfolgreich aktualisiert'; +$_MODULE['<{blockcms}prestashop>blockcms_ddd7d8a072783afaf23e5e6843398fc9'] = 'CMS-Block erfolgreich hinzugefügt'; +$_MODULE['<{blockcms}prestashop>blockcms_31a22821c66edf7e3aa33ef1c8109f4c'] = 'CMS-Block erfolgreich bearbeitet'; +$_MODULE['<{blockcms}prestashop>blockcms_10432af9a9d55d5aa8b0f380194af673'] = 'Löschung erfolgreich'; +$_MODULE['<{blockcms}prestashop>blockcms_be58fccb15fb119b8c3d485e3a8561c4'] = 'CMS-Block-Konfiguration'; +$_MODULE['<{blockcms}prestashop>blockcms_78edb384f1a71576034e00ed6844bcc2'] = 'In dieser CMS-Kategorie gibt es nichts anzuzeigen'; +$_MODULE['<{blockcms}prestashop>blockcms_34c869c542dee932ef8cd96d2f91cae6'] = 'Unsere Shops'; +$_MODULE['<{blockcms}prestashop>blockcms_d1aa22a3126f04664e0fe3f598994014'] = 'Specials'; +$_MODULE['<{blockcms}prestashop>blockcms_9ff0635f5737513b1a6f559ac2bff745'] = 'Neue Produkte'; +$_MODULE['<{blockcms}prestashop>blockcms_3cb29f0ccc5fd220a97df89dafe46290'] = 'Verkaufshits'; +$_MODULE['<{blockcms}prestashop>blockcms_02d4482d332e1aef3437cd61c9bcc624'] = 'Kontaktieren Sie uns'; +$_MODULE['<{blockcms}prestashop>blockcms_7a52e36bf4a1caa031c75a742fb9927a'] = 'Powered by'; diff --git a/modules/blockcms/es.php b/modules/blockcms/es.php new file mode 100755 index 000000000..ceb467527 --- /dev/null +++ b/modules/blockcms/es.php @@ -0,0 +1,57 @@ +blockcms_cd275312651aebf8cbbb8d3bb1c086ae'] = 'Bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_cdca12007979fc49008fd125cdb775fc'] = 'Añadir un bloque con varios links hacia sus CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_97390dd0b5ba7867120aee2ff22bfa38'] = 'Configuración de los bloques CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_1cd127158cfd245511751206f4b3c6f0'] = 'Añadir un nuevo bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_6e1ea63625a85f6d2d9ecbfb79586351'] = 'Lista de los bloques CMS de izquierda'; +$_MODULE['<{blockcms}prestashop>blockcms_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blockcms}prestashop>blockcms_aae551ce0c29dfe39b0ff20139abdef3'] = 'Nombre del bloque'; +$_MODULE['<{blockcms}prestashop>blockcms_99121ab27aaa7472cfada9071c5ba434'] = 'Nombre de la categoría CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Posición'; +$_MODULE['<{blockcms}prestashop>blockcms_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones '; +$_MODULE['<{blockcms}prestashop>blockcms_08a38277b0309070706f6652eeae9a53'] = 'Bajar'; +$_MODULE['<{blockcms}prestashop>blockcms_258f49887ef8d14ac268c92b02503aaa'] = 'Subir'; +$_MODULE['<{blockcms}prestashop>blockcms_7dce122004969d56ae2e0245cb754d35'] = 'Editar'; +$_MODULE['<{blockcms}prestashop>blockcms_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{blockcms}prestashop>blockcms_8f08c1af47e3e9611289c1882befc3a8'] = 'No existe ningún bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_0a40c06f34e5c794a7f0d3085d17d63a'] = 'Lista de los bloques CMS de la derecha'; +$_MODULE['<{blockcms}prestashop>blockcms_965be994da393e5aa15bd3a2444c6ccf'] = 'Configuración de los links CMS a pie de página'; +$_MODULE['<{blockcms}prestashop>blockcms_fab8ca8250236ed20b96f9750e1eacc7'] = 'Mostrar links a pie de página'; +$_MODULE['<{blockcms}prestashop>blockcms_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Nuevo bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_e83c1afa1d3dbe19fa9becebb5ca8480'] = 'Editar el bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_7d9a9a0187e212cb7fd126afb8704bd1'] = 'Nombre del bloque:'; +$_MODULE['<{blockcms}prestashop>blockcms_bdbaef442c586e1bbecb44eba1ba7e2d'] = 'Si deja el campo vacío, el nombre será el mismo que el de la categoría'; +$_MODULE['<{blockcms}prestashop>blockcms_7310626b183e1bcfcc61b844e8ea3c5c'] = 'Elija una categoría CMS:'; +$_MODULE['<{blockcms}prestashop>blockcms_be9469719aa6efa2fc3bd5768bc406d7'] = 'Ubicación'; +$_MODULE['<{blockcms}prestashop>blockcms_945d5e233cf7d6240f6b783b36a374ff'] = 'Izquierda'; +$_MODULE['<{blockcms}prestashop>blockcms_92b09c7c48c520c3c55e497875da437c'] = 'Derecha'; +$_MODULE['<{blockcms}prestashop>blockcms_1acef6bfa7dc3360eed6bf44851fa6a4'] = 'Mostrar tiendas:'; +$_MODULE['<{blockcms}prestashop>blockcms_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{blockcms}prestashop>blockcms_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{blockcms}prestashop>blockcms_08f3899ad165f85f8596199966b8c673'] = 'Mostrar \"nuestras tiendas\" al final del bloque'; +$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Volver'; +$_MODULE['<{blockcms}prestashop>blockcms_f7df0009efd65cec8e54cf4ef30abf5e'] = 'Campo \"Mostrar la tienda\" no válido'; +$_MODULE['<{blockcms}prestashop>blockcms_903d12e7aa8c380c290b78c1898e01b7'] = 'Ubicación no válida'; +$_MODULE['<{blockcms}prestashop>blockcms_92fc29650a0f9dd3fca4e5de1845f78b'] = 'Debe elegir al menos una página o subcategoría para crear un bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_5e75cbfbfd02a7b2fab0ed21505e811b'] = 'Página CMS o subcategoría no válidos'; +$_MODULE['<{blockcms}prestashop>blockcms_420d575844f77db5299065080d9c237f'] = 'Nombre del bloque demasiado largo'; +$_MODULE['<{blockcms}prestashop>blockcms_c12d11dfdaf316576221cf4319fbd7fc'] = 'id del bloque cms no válida'; +$_MODULE['<{blockcms}prestashop>blockcms_05b51791a83d3cef29ad68b70d48d131'] = 'Activación footer no válida'; +$_MODULE['<{blockcms}prestashop>blockcms_5dab5acc3c6a2a7e87e8d8926a2c763e'] = 'Está tratando de suprimir un bloque cms que no existe'; +$_MODULE['<{blockcms}prestashop>blockcms_138218281781fd0d938a140892d7386c'] = 'Edición de links CMS a pie de página con éxito'; +$_MODULE['<{blockcms}prestashop>blockcms_ddd7d8a072783afaf23e5e6843398fc9'] = 'El bloque CMS se ha editado con éxito'; +$_MODULE['<{blockcms}prestashop>blockcms_31a22821c66edf7e3aa33ef1c8109f4c'] = 'Se ha editado con éxito'; +$_MODULE['<{blockcms}prestashop>blockcms_10432af9a9d55d5aa8b0f380194af673'] = 'Se ha suprimido con éxito'; +$_MODULE['<{blockcms}prestashop>blockcms_be58fccb15fb119b8c3d485e3a8561c4'] = 'Configuración del bloque CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_78edb384f1a71576034e00ed6844bcc2'] = 'No hay ningún CMS en esta categoría CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_34c869c542dee932ef8cd96d2f91cae6'] = 'Nuestras tiendas'; +$_MODULE['<{blockcms}prestashop>blockcms_d1aa22a3126f04664e0fe3f598994014'] = 'Descuentos'; +$_MODULE['<{blockcms}prestashop>blockcms_9ff0635f5737513b1a6f559ac2bff745'] = 'Nuevos productos'; +$_MODULE['<{blockcms}prestashop>blockcms_3cb29f0ccc5fd220a97df89dafe46290'] = 'Mejores ventas'; +$_MODULE['<{blockcms}prestashop>blockcms_02d4482d332e1aef3437cd61c9bcc624'] = 'Contacte con nosotros'; +$_MODULE['<{blockcms}prestashop>blockcms_7a52e36bf4a1caa031c75a742fb9927a'] = 'Creado por'; diff --git a/modules/blockcms/fr.php b/modules/blockcms/fr.php new file mode 100755 index 000000000..9b6bf43a3 --- /dev/null +++ b/modules/blockcms/fr.php @@ -0,0 +1,57 @@ +blockcms_cd275312651aebf8cbbb8d3bb1c086ae'] = 'Bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_cdca12007979fc49008fd125cdb775fc'] = 'Ajoute un bloc contenant plusieurs lien vers vos CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_97390dd0b5ba7867120aee2ff22bfa38'] = 'Configuration des blocs CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_1cd127158cfd245511751206f4b3c6f0'] = 'Ajouter un nouveau bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_6e1ea63625a85f6d2d9ecbfb79586351'] = 'Liste des blocs CMS de gauche'; +$_MODULE['<{blockcms}prestashop>blockcms_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blockcms}prestashop>blockcms_aae551ce0c29dfe39b0ff20139abdef3'] = 'Nom du bloc'; +$_MODULE['<{blockcms}prestashop>blockcms_99121ab27aaa7472cfada9071c5ba434'] = 'Nom de la catégorie CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position'; +$_MODULE['<{blockcms}prestashop>blockcms_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; +$_MODULE['<{blockcms}prestashop>blockcms_08a38277b0309070706f6652eeae9a53'] = 'Bas'; +$_MODULE['<{blockcms}prestashop>blockcms_258f49887ef8d14ac268c92b02503aaa'] = 'Haut'; +$_MODULE['<{blockcms}prestashop>blockcms_7dce122004969d56ae2e0245cb754d35'] = 'Éditer'; +$_MODULE['<{blockcms}prestashop>blockcms_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockcms}prestashop>blockcms_8f08c1af47e3e9611289c1882befc3a8'] = 'Il n\'existe aucun bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_0a40c06f34e5c794a7f0d3085d17d63a'] = 'Liste des blocs CMS de droite'; +$_MODULE['<{blockcms}prestashop>blockcms_965be994da393e5aa15bd3a2444c6ccf'] = 'Configuration des liens CMS en pied de page'; +$_MODULE['<{blockcms}prestashop>blockcms_fab8ca8250236ed20b96f9750e1eacc7'] = 'Afficher les liens de bas de page'; +$_MODULE['<{blockcms}prestashop>blockcms_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Nouveau bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_e83c1afa1d3dbe19fa9becebb5ca8480'] = 'Édition du bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_7d9a9a0187e212cb7fd126afb8704bd1'] = 'Nom du bloc :'; +$_MODULE['<{blockcms}prestashop>blockcms_bdbaef442c586e1bbecb44eba1ba7e2d'] = 'Si vous laissez ce champ vide, le nom du block sera le nom de la catégorie'; +$_MODULE['<{blockcms}prestashop>blockcms_7310626b183e1bcfcc61b844e8ea3c5c'] = 'Choisissez une catégorie CMS :'; +$_MODULE['<{blockcms}prestashop>blockcms_be9469719aa6efa2fc3bd5768bc406d7'] = 'Emplacement'; +$_MODULE['<{blockcms}prestashop>blockcms_945d5e233cf7d6240f6b783b36a374ff'] = 'Gauche'; +$_MODULE['<{blockcms}prestashop>blockcms_92b09c7c48c520c3c55e497875da437c'] = 'Droite'; +$_MODULE['<{blockcms}prestashop>blockcms_1acef6bfa7dc3360eed6bf44851fa6a4'] = 'Afficher les boutiques :'; +$_MODULE['<{blockcms}prestashop>blockcms_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{blockcms}prestashop>blockcms_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{blockcms}prestashop>blockcms_08f3899ad165f85f8596199966b8c673'] = 'Afficher \"Nos Boutiques\" en bas du block'; +$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Retour'; +$_MODULE['<{blockcms}prestashop>blockcms_f7df0009efd65cec8e54cf4ef30abf5e'] = 'Champ \"afficher la boutique\" invalide'; +$_MODULE['<{blockcms}prestashop>blockcms_903d12e7aa8c380c290b78c1898e01b7'] = 'Emplacement invalide'; +$_MODULE['<{blockcms}prestashop>blockcms_92fc29650a0f9dd3fca4e5de1845f78b'] = 'Vous devez choisir au moins une page ou sous-catégorie pour créer un bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_5e75cbfbfd02a7b2fab0ed21505e811b'] = 'Page CMS ou sous-catégorie invalide'; +$_MODULE['<{blockcms}prestashop>blockcms_420d575844f77db5299065080d9c237f'] = 'Nom du bloc trop long'; +$_MODULE['<{blockcms}prestashop>blockcms_c12d11dfdaf316576221cf4319fbd7fc'] = 'id_block_cms invalide'; +$_MODULE['<{blockcms}prestashop>blockcms_05b51791a83d3cef29ad68b70d48d131'] = 'Footer activation invalide'; +$_MODULE['<{blockcms}prestashop>blockcms_5dab5acc3c6a2a7e87e8d8926a2c763e'] = 'Vous essayez de supprimer un block cms inexistant'; +$_MODULE['<{blockcms}prestashop>blockcms_138218281781fd0d938a140892d7386c'] = 'Édition des liens CMS en pied de page réussie'; +$_MODULE['<{blockcms}prestashop>blockcms_ddd7d8a072783afaf23e5e6843398fc9'] = 'Ajout du bloc CMS réussi'; +$_MODULE['<{blockcms}prestashop>blockcms_31a22821c66edf7e3aa33ef1c8109f4c'] = 'Édition du bloc CMS réussie'; +$_MODULE['<{blockcms}prestashop>blockcms_10432af9a9d55d5aa8b0f380194af673'] = 'Suppression réussie'; +$_MODULE['<{blockcms}prestashop>blockcms_be58fccb15fb119b8c3d485e3a8561c4'] = 'Configuration du bloc CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_78edb384f1a71576034e00ed6844bcc2'] = 'Il n\'y a aucun CMS dans cette catégorie CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_34c869c542dee932ef8cd96d2f91cae6'] = 'Nos magasins'; +$_MODULE['<{blockcms}prestashop>blockcms_d1aa22a3126f04664e0fe3f598994014'] = 'Promotions'; +$_MODULE['<{blockcms}prestashop>blockcms_9ff0635f5737513b1a6f559ac2bff745'] = 'Nouveaux produits'; +$_MODULE['<{blockcms}prestashop>blockcms_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes'; +$_MODULE['<{blockcms}prestashop>blockcms_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous'; +$_MODULE['<{blockcms}prestashop>blockcms_7a52e36bf4a1caa031c75a742fb9927a'] = 'Propulsé par'; diff --git a/modules/blockcms/it.php b/modules/blockcms/it.php new file mode 100644 index 000000000..e9a33cbdc --- /dev/null +++ b/modules/blockcms/it.php @@ -0,0 +1,57 @@ +blockcms_cd275312651aebf8cbbb8d3bb1c086ae'] = 'Blocco CMS '; +$_MODULE['<{blockcms}prestashop>blockcms_cdca12007979fc49008fd125cdb775fc'] = 'Aggiungi un blocco con diversi link CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_97390dd0b5ba7867120aee2ff22bfa38'] = 'Blocchi di configurazione CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_1cd127158cfd245511751206f4b3c6f0'] = 'Aggiungi un nuovo blocco cms'; +$_MODULE['<{blockcms}prestashop>blockcms_6e1ea63625a85f6d2d9ecbfb79586351'] = 'Elenco di blocchi CMS di sinistra'; +$_MODULE['<{blockcms}prestashop>blockcms_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blockcms}prestashop>blockcms_aae551ce0c29dfe39b0ff20139abdef3'] = 'Nome Blocco'; +$_MODULE['<{blockcms}prestashop>blockcms_99121ab27aaa7472cfada9071c5ba434'] = 'Nome categoria'; +$_MODULE['<{blockcms}prestashop>blockcms_52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Posizione'; +$_MODULE['<{blockcms}prestashop>blockcms_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni'; +$_MODULE['<{blockcms}prestashop>blockcms_08a38277b0309070706f6652eeae9a53'] = 'Giù'; +$_MODULE['<{blockcms}prestashop>blockcms_258f49887ef8d14ac268c92b02503aaa'] = 'Su'; +$_MODULE['<{blockcms}prestashop>blockcms_7dce122004969d56ae2e0245cb754d35'] = 'Modifica'; +$_MODULE['<{blockcms}prestashop>blockcms_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockcms}prestashop>blockcms_8f08c1af47e3e9611289c1882befc3a8'] = 'Non vi è alcuna blocco CMS impostato'; +$_MODULE['<{blockcms}prestashop>blockcms_0a40c06f34e5c794a7f0d3085d17d63a'] = 'Elenco di blocchi CMS di destra'; +$_MODULE['<{blockcms}prestashop>blockcms_965be994da393e5aa15bd3a2444c6ccf'] = 'Configurazione dei link a piè di pagina'; +$_MODULE['<{blockcms}prestashop>blockcms_fab8ca8250236ed20b96f9750e1eacc7'] = 'Visualizzare i vari link a piè di pagina '; +$_MODULE['<{blockcms}prestashop>blockcms_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{blockcms}prestashop>blockcms_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockcms}prestashop>blockcms_5aa1602194579edb6f91d7dd53eadb32'] = 'Nuovo blocco CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_e83c1afa1d3dbe19fa9becebb5ca8480'] = 'Modifica blocco CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_7d9a9a0187e212cb7fd126afb8704bd1'] = 'Nome del blocco:'; +$_MODULE['<{blockcms}prestashop>blockcms_bdbaef442c586e1bbecb44eba1ba7e2d'] = 'Se lasci questo campo vuoto, il nome del blocco sarà il nome della categoria'; +$_MODULE['<{blockcms}prestashop>blockcms_7310626b183e1bcfcc61b844e8ea3c5c'] = 'Scegli una categoria CMS:'; +$_MODULE['<{blockcms}prestashop>blockcms_be9469719aa6efa2fc3bd5768bc406d7'] = 'Posizione:'; +$_MODULE['<{blockcms}prestashop>blockcms_945d5e233cf7d6240f6b783b36a374ff'] = 'Sinistra'; +$_MODULE['<{blockcms}prestashop>blockcms_92b09c7c48c520c3c55e497875da437c'] = 'Destra'; +$_MODULE['<{blockcms}prestashop>blockcms_1acef6bfa7dc3360eed6bf44851fa6a4'] = 'Mostra Negozi:'; +$_MODULE['<{blockcms}prestashop>blockcms_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{blockcms}prestashop>blockcms_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{blockcms}prestashop>blockcms_08f3899ad165f85f8596199966b8c673'] = 'Mostra \"i nostri negozi\" alla fine del blocco'; +$_MODULE['<{blockcms}prestashop>blockcms_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{blockcms}prestashop>blockcms_f7df0009efd65cec8e54cf4ef30abf5e'] = 'Visualizzazione negozio non valida'; +$_MODULE['<{blockcms}prestashop>blockcms_903d12e7aa8c380c290b78c1898e01b7'] = 'Posizione blocco non valida'; +$_MODULE['<{blockcms}prestashop>blockcms_92fc29650a0f9dd3fca4e5de1845f78b'] = 'Devi scegliere almeno una pagina o una sottocategoria per creare un blocco CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_5e75cbfbfd02a7b2fab0ed21505e811b'] = 'Pagina o categoria CMS non valida'; +$_MODULE['<{blockcms}prestashop>blockcms_420d575844f77db5299065080d9c237f'] = 'Nome del blocco troppo lungo'; +$_MODULE['<{blockcms}prestashop>blockcms_c12d11dfdaf316576221cf4319fbd7fc'] = 'id_block_cms invalido'; +$_MODULE['<{blockcms}prestashop>blockcms_05b51791a83d3cef29ad68b70d48d131'] = 'Attivazione piè di pagina non valido'; +$_MODULE['<{blockcms}prestashop>blockcms_5dab5acc3c6a2a7e87e8d8926a2c763e'] = 'Stai cercando di eliminare un blocco cms inesistente'; +$_MODULE['<{blockcms}prestashop>blockcms_138218281781fd0d938a140892d7386c'] = 'Piè di pagine CMS aggiornato con successo'; +$_MODULE['<{blockcms}prestashop>blockcms_ddd7d8a072783afaf23e5e6843398fc9'] = 'Aggiunta del blocco CMS riuscito '; +$_MODULE['<{blockcms}prestashop>blockcms_31a22821c66edf7e3aa33ef1c8109f4c'] = 'Modifica del blocco CMS riuscito'; +$_MODULE['<{blockcms}prestashop>blockcms_10432af9a9d55d5aa8b0f380194af673'] = 'Soppressione riuscita'; +$_MODULE['<{blockcms}prestashop>blockcms_be58fccb15fb119b8c3d485e3a8561c4'] = 'Configurazione del blocco CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_78edb384f1a71576034e00ed6844bcc2'] = 'Non c\'è nulla da visualizzare in questa categoria CMS'; +$_MODULE['<{blockcms}prestashop>blockcms_34c869c542dee932ef8cd96d2f91cae6'] = 'I nostri negozi'; +$_MODULE['<{blockcms}prestashop>blockcms_d1aa22a3126f04664e0fe3f598994014'] = 'Speciali'; +$_MODULE['<{blockcms}prestashop>blockcms_9ff0635f5737513b1a6f559ac2bff745'] = 'Nuovi prodotti'; +$_MODULE['<{blockcms}prestashop>blockcms_3cb29f0ccc5fd220a97df89dafe46290'] = 'Vendite migliori'; +$_MODULE['<{blockcms}prestashop>blockcms_02d4482d332e1aef3437cd61c9bcc624'] = 'Contattaci'; +$_MODULE['<{blockcms}prestashop>blockcms_7a52e36bf4a1caa031c75a742fb9927a'] = 'Powered by'; diff --git a/modules/blockcms/logo.gif b/modules/blockcms/logo.gif new file mode 100755 index 000000000..12cd1aef9 Binary files /dev/null and b/modules/blockcms/logo.gif differ diff --git a/modules/blockcurrencies/blockcurrencies.php b/modules/blockcurrencies/blockcurrencies.php new file mode 100644 index 000000000..fd2a6b13f --- /dev/null +++ b/modules/blockcurrencies/blockcurrencies.php @@ -0,0 +1,78 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockCurrencies extends Module +{ + public function __construct() + { + $this->name = 'blockcurrencies'; + $this->tab = 'front_office_features'; + $this->version = 0.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Currency block'); + $this->description = $this->l('Adds a block for selecting a currency.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); + } + + /** + * Returns module content for header + * + * @param array $params Parameters + * @return string Content + */ + public function hookTop($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + + global $smarty; + $currencies = Currency::getCurrencies(); + if (!sizeof($currencies)) + return ''; + $smarty->assign('currencies', $currencies); + return $this->display(__FILE__, 'blockcurrencies.tpl'); + } + + public function hookHeader($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + Tools::addCSS(($this->_path).'blockcurrencies.css', 'all'); + } +} + + diff --git a/modules/blockcurrencies/blockcurrencies.tpl b/modules/blockcurrencies/blockcurrencies.tpl new file mode 100644 index 000000000..d13f977c4 --- /dev/null +++ b/modules/blockcurrencies/blockcurrencies.tpl @@ -0,0 +1,44 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +
        +
          + {foreach from=$currencies key=k item=f_currency} +
        • id_currency == $f_currency.id_currency}class="selected"{/if}> + {$f_currency.sign} +
        • + {/foreach} +
        +

        + + + {l s='Currency' mod='blockcurrencies'} +

        +
        +
        + \ No newline at end of file diff --git a/modules/blockcurrencies/config.xml b/modules/blockcurrencies/config.xml new file mode 100755 index 000000000..b0bd95580 --- /dev/null +++ b/modules/blockcurrencies/config.xml @@ -0,0 +1,11 @@ + + + blockcurrencies + Currency block + 0.1 + Adds a block for selecting a currency. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/blockcurrencies/de.php b/modules/blockcurrencies/de.php new file mode 100644 index 000000000..11647250e --- /dev/null +++ b/modules/blockcurrencies/de.php @@ -0,0 +1,7 @@ +blockcurrencies_f7a31ae8f776597d4282bd3b1013f08b'] = 'Währungsblock'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_d06c31fa4b0b56c2a61aa4dd7b632767'] = 'Fügt einen Block zur Auswahl der Währung hinzu'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_386c339d37e737a436499d423a77df0c'] = 'Währung'; diff --git a/modules/blockcurrencies/en.php b/modules/blockcurrencies/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockcurrencies/en.php @@ -0,0 +1,4 @@ +blockcurrencies_f7a31ae8f776597d4282bd3b1013f08b'] = 'Bloque de moneda'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_d06c31fa4b0b56c2a61aa4dd7b632767'] = 'Añadir bloque para selección de moneda'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_386c339d37e737a436499d423a77df0c'] = 'Moneda'; diff --git a/modules/blockcurrencies/fr.php b/modules/blockcurrencies/fr.php new file mode 100644 index 000000000..f8716a31c --- /dev/null +++ b/modules/blockcurrencies/fr.php @@ -0,0 +1,7 @@ +blockcurrencies_f7a31ae8f776597d4282bd3b1013f08b'] = 'Bloc devises'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_d06c31fa4b0b56c2a61aa4dd7b632767'] = 'Ajoute un bloc permettant au client de choisir sa devise'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_386c339d37e737a436499d423a77df0c'] = 'Devises'; diff --git a/modules/blockcurrencies/it.php b/modules/blockcurrencies/it.php new file mode 100644 index 000000000..5d82845dc --- /dev/null +++ b/modules/blockcurrencies/it.php @@ -0,0 +1,7 @@ +blockcurrencies_f7a31ae8f776597d4282bd3b1013f08b'] = 'Blocco valuta'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_d06c31fa4b0b56c2a61aa4dd7b632767'] = 'Aggiunge un blocco per la selezione di una valuta'; +$_MODULE['<{blockcurrencies}prestashop>blockcurrencies_386c339d37e737a436499d423a77df0c'] = 'Valuta'; diff --git a/modules/blockcurrencies/logo.gif b/modules/blockcurrencies/logo.gif new file mode 100644 index 000000000..b91777ebb Binary files /dev/null and b/modules/blockcurrencies/logo.gif differ diff --git a/modules/blocklanguages/blocklanguages.php b/modules/blocklanguages/blocklanguages.php new file mode 100644 index 000000000..82f9325a0 --- /dev/null +++ b/modules/blocklanguages/blocklanguages.php @@ -0,0 +1,73 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockLanguages extends Module +{ + function __construct() + { + $this->name = 'blocklanguages'; + $this->tab = 'front_office_features'; + $this->version = 0.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Language block'); + $this->description = $this->l('Adds a block for selecting a language.'); + } + + function install() + { + return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); + } + + /** + * Returns module content for header + * + * @param array $params Parameters + * @return string Content + */ + function hookTop($params) + { + global $smarty; + $languages = Language::getLanguages(); + if (!sizeof($languages)) + return ''; + $smarty->assign('languages', $languages); + return $this->display(__FILE__, 'blocklanguages.tpl'); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blocklanguages.css', 'all'); + } +} + + diff --git a/modules/blocklanguages/blocklanguages.tpl b/modules/blocklanguages/blocklanguages.tpl new file mode 100644 index 000000000..63b4dec0a --- /dev/null +++ b/modules/blocklanguages/blocklanguages.tpl @@ -0,0 +1,58 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        + +
        + + + diff --git a/modules/blocklanguages/config.xml b/modules/blocklanguages/config.xml new file mode 100755 index 000000000..588c2c32a --- /dev/null +++ b/modules/blocklanguages/config.xml @@ -0,0 +1,11 @@ + + + blocklanguages + Language block + 0.1 + Adds a block for selecting a language. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/blocklanguages/de.php b/modules/blocklanguages/de.php new file mode 100644 index 000000000..06d62bfdd --- /dev/null +++ b/modules/blocklanguages/de.php @@ -0,0 +1,6 @@ +blocklanguages_d5988791c07fedc0e2fc77683b4e61f6'] = 'Sprachblock'; +$_MODULE['<{blocklanguages}prestashop>blocklanguages_2575f2a453fd18a4e74e430a80eb3540'] = 'Fügt einen Block zur Auswahl der Sprache hinzu'; diff --git a/modules/blocklanguages/en.php b/modules/blocklanguages/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocklanguages/en.php @@ -0,0 +1,4 @@ +blocklanguages_d5988791c07fedc0e2fc77683b4e61f6'] = 'Bloque de idiomas'; +$_MODULE['<{blocklanguages}prestashop>blocklanguages_2575f2a453fd18a4e74e430a80eb3540'] = 'Añadir un bloque para seleccionar idioma'; diff --git a/modules/blocklanguages/fr.php b/modules/blocklanguages/fr.php new file mode 100644 index 000000000..311e76c9a --- /dev/null +++ b/modules/blocklanguages/fr.php @@ -0,0 +1,6 @@ +blocklanguages_d5988791c07fedc0e2fc77683b4e61f6'] = 'Bloc langues'; +$_MODULE['<{blocklanguages}prestashop>blocklanguages_2575f2a453fd18a4e74e430a80eb3540'] = 'Ajoute un bloc permettant au client de choisir sa langue'; diff --git a/modules/blocklanguages/it.php b/modules/blocklanguages/it.php new file mode 100644 index 000000000..1c01f6b10 --- /dev/null +++ b/modules/blocklanguages/it.php @@ -0,0 +1,6 @@ +blocklanguages_d5988791c07fedc0e2fc77683b4e61f6'] = 'Blocco lingua '; +$_MODULE['<{blocklanguages}prestashop>blocklanguages_2575f2a453fd18a4e74e430a80eb3540'] = 'Aggiunge un blocco selezionare una lingua'; diff --git a/modules/blocklanguages/logo.gif b/modules/blocklanguages/logo.gif new file mode 100644 index 000000000..7f11ef593 Binary files /dev/null and b/modules/blocklanguages/logo.gif differ diff --git a/modules/blocklayered/blocklayered-ajax.php b/modules/blocklayered/blocklayered-ajax.php new file mode 100644 index 000000000..47cb6bf71 --- /dev/null +++ b/modules/blocklayered/blocklayered-ajax.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*/ + +global $cookie; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/blocklayered.php'); + +$blockLayered = new BlockLayered(); +echo $blockLayered->ajaxCall(); \ No newline at end of file diff --git a/modules/blocklayered/blocklayered.css b/modules/blocklayered/blocklayered.css new file mode 100644 index 000000000..ea38ad9d3 --- /dev/null +++ b/modules/blocklayered/blocklayered.css @@ -0,0 +1,75 @@ +#layered_block_left div.block_content { + padding: 6px; +} + +#layered_block_left ul { + padding-left: 0; +} + +#layered_block_left ul li { + margin-left: 15px; + padding-left: 2px; + list-style-type: none; +} + +#layered_block_left #enabled_filters { + font-size: 10px; + padding-bottom: 10px; + margin-bottom: 5px; + border-bottom: 1px dotted #CCC; +} + +#layered_block_left #enabled_filters ul li { + margin-left: 0; + padding-left: 0; +} + +#layered_block_left #enabled_filters ul li:hover { + background: inherit; + color: inherit; +} + +#layered_block_left #enabled_filters a { + text-decoration: none; + color: red; +} + +#layered_block_left ul li:hover { + background: #71BF47; + color: #FFF; +} + +#layered_block_left ul li label { + cursor: pointer; +} + +#layered_block_left ul li.nomargin { + margin-left: 0; +} + +#layered_block_left span.layered_subtitle { + float: left; + font-weight: bold; + font-size: 12px; + display: block; + margin-bottom: 4px; +} + +#layered_block_left span.layered_close a { text-decoration: none; } + +#layered_block_left span.layered_close { + float: right; + font-weight: bold; + font-size: 12px; + display: block; + margin-bottom: 4px; +} + +#layered_block_left ul li input.checkbox { + vertical-align: middle; + margin-left: 2px; +} + +#layered_block_left ul li .disabled { + color: #666; +} \ No newline at end of file diff --git a/modules/blocklayered/blocklayered.js b/modules/blocklayered/blocklayered.js new file mode 100644 index 000000000..2c5cff54e --- /dev/null +++ b/modules/blocklayered/blocklayered.js @@ -0,0 +1,102 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*/ + +var ajaxQueries = new Array(); +var ajaxLoaderOn = 0; + +$(document).ready(function() +{ + cancelFilter(); + openCloseFilter(); + + $('#layered_form input[type=button], #layered_form label.layered_color').live('click', function() + { + $('').attr('type', 'hidden').attr('name', $(this).attr('name')).val($(this).attr('rel')).appendTo('#layered_form'); + reloadContent(); + }); + + $('#layered_form input[type=checkbox]').live('click', function() + { + reloadContent(); + }); +}); + +function cancelFilter() +{ + $('#enabled_filters a').live('click', function() + { + $('#'+$(this).attr('rel')).attr('checked', false); + $('#layered_form input[name='+$(this).attr('rel')+']').remove(); + reloadContent(); + }); +} + +function openCloseFilter() +{ + $('#layered_form span.layered_close a').live('click', function() + { + if ($(this).html() == '<') + { + $('#'+$(this).attr('rel')).show(); + $(this).html('v'); + } + else + { + $('#'+$(this).attr('rel')).hide(); + $(this).html('<'); + } + }); +} + +function reloadContent() +{ + for(i = 0; i < ajaxQueries.length; i++) + ajaxQueries[i].abort(); + ajaxQueries = new Array(); + + if (!ajaxLoaderOn) + { + $('#product_list').prepend($('#layered_ajax_loader').html()); + $('#product_list').css('opacity', '0.7'); + ajaxLoaderOn = 1; + } + + ajaxQuery = $.ajax( + { + type: 'GET', + url: baseDir + 'modules/blocklayered/blocklayered-ajax.php', + data: $('#layered_form').serialize(), + success: function(result) + { + $('#layered_block_left').after($(result)[0]).remove(); + $('#product_list').html($(result)[1]); + $('#product_list').css('opacity', '1'); + ajaxLoaderOn = 0; + } + }); + + ajaxQueries.push(ajaxQuery); +} \ No newline at end of file diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php new file mode 100644 index 000000000..da141cb7c --- /dev/null +++ b/modules/blocklayered/blocklayered.php @@ -0,0 +1,873 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockLayered extends Module +{ + public function __construct() + { + $this->name = 'blocklayered'; + $this->tab = 'front_office_features'; + $this->version = 1.3; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Layered navigation block'); + $this->description = $this->l('Displays a block with layered navigation filters.'); + } + + public function install() + { + if ($result = parent::install() AND $this->registerHook('leftColumn') AND $this->registerHook('header') + AND $this->registerHook('addProduct') AND $this->registerHook('updateProduct') AND $this->registerHook('deleteProduct') + AND $this->registerHook('categoryAddition') AND $this->registerHook('categoryUpdate') AND $this->registerHook('categoryDeletion')) + { + Configuration::updateValue('PS_LAYERED_NAVIGATION_CHECKBOXES', 1); + $this->rebuildLayeredStructure(); + } + + return $result; + } + + public function uninstall() + { + /* Delete all configurations */ + Configuration::deleteByName('PS_LAYERED_NAVIGATION_CHECKBOXES'); + + return parent::uninstall(); + } + + public function hookLeftColumn($params) + { + return $this->generateFilters(); + } + + public function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + public function hookHeader($params) + { + Tools::addJS(($this->_path).'blocklayered.js'); + Tools::addCSS(($this->_path).'blocklayered.css', 'all'); + } + + public function hookAddProduct($params) + { + $this->rebuildLayeredCache(array((int)$params['product']->id)); + } + + public function hookUpdateProduct($params) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_cache WHERE id_product = '.(int)$params['product']->id.' LIMIT 1'); + $this->rebuildLayeredCache(array((int)$params['product']->id)); + } + + public function hookDeleteProduct($params) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_cache WHERE id_product = '.(int)$params['product']->id.' LIMIT 1'); + } + + public function hookCategoryAddition($params) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'layered_cache` ADD `c'.(int)$params['category']->id.'` TINYINT UNSIGNED NOT NULL DEFAULT \'0\''); + Configuration::updateValue('PS_LAYERED_COLUMNS', Configuration::get('PS_LAYERED_COLUMNS').',c'.(int)$params['category']->id); + $this->rebuildLayeredCache(array(), array((int)$params['category']->id)); + } + + public function hookCategoryUpdate($params) + { + /* The category status might (active, inactive) have changed, we have to update the layered cache table structure */ + if (!$params['category']->active) + $this->hookCategoryDeletion($params); + else + { + $oneRow = Db::getInstance()->getRow('SELECT c'.(int)$params['category']->id.' FROM `'._DB_PREFIX_.'layered_cache`'); + if (!isset($oneRow['c'.(int)$params['category']->id])) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'layered_cache` ADD `c'.(int)$params['category']->id.'` TINYINT UNSIGNED NOT NULL DEFAULT \'0\''); + Configuration::updateValue('PS_LAYERED_COLUMNS', Configuration::get('PS_LAYERED_COLUMNS').',c'.(int)$params['category']->id); + } + if (!Db::getInstance()->getRow('SELECT id_layered_category FROM `'._DB_PREFIX_.'layered_category` WHERE id_category = '.(int)$params['category']->id)) + $this->rebuildLayeredCache(array(), array((int)$params['category']->id)); + } + } + + public function hookCategoryDeletion($params) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_category WHERE id_category = '.(int)$params['category']->id); + $oneRow = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'layered_cache`'); + if (isset($oneRow['c'.(int)$params['category']->id])) + { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'layered_cache` DROP `c'.(int)$params['category']->id.'`'); + Configuration::updateValue('PS_LAYERED_COLUMNS', str_replace(',c'.(int)$params['category']->id, '', Configuration::get('PS_LAYERED_COLUMNS'))); + } + } + + public function getContent() + { + if (Tools::isSubmit('submitLayeredCache')) + { + $this->rebuildLayeredStructure(); + $this->rebuildLayeredCache(); + + echo ' +
        + + '.$this->l('Layered navigation database was initialized successfully').' +
        '; + } + elseif (Tools::isSubmit('submitLayeredSettings')) + { + echo ' +
        + + '.$this->l('Settings saved successfully').' +
        '; + } + + echo ' +

        '.$this->l('Layered navigation').'

        + +

        '.$this->l('This module is in beta version and will be improved in PrestaShop v1.4.1').'


        +
        + '.$this->l('10 upcoming improvements in PrestaShop v1.4.1').' +
          +
        1. '.$this->l('Real-time refresh of the cache table').'
        2. +
        3. '.$this->l('Additional filters (prices, weight)').'
        4. +
        5. '.$this->l('Ability to manage filters by category in the module configuration').'
        6. +
        7. '.$this->l('Ability to hide filter groups with no values and filter values with 0 products').'
        8. +
        9. '.$this->l('Statistics and analysis').'
        10. +
        11. '.$this->l('Manage products sort & pagination').'
        12. +
        13. '.$this->l('Add a check on the category_group table').'
        14. +
        15. '.$this->l('SEO links & real time URL building (ability to give the URL to someone)').'
        16. +
        17. '.$this->l('Add more options in the module configuration').'
        18. +
        19. '.$this->l('Performances improvements').'
        20. +
        +

        + +
        + '.$this->l('Cache initialization').' +
        +
        +

        '.$this->l('When do you have to initialize the cache?').'

        +
          +
        • '.$this->l('Before using this module for the first time').'
        • +
        • '.$this->l('You add/update/delete').' '.$this->l('a feature or a feature value').'
        • +
        • '.$this->l('You add/update/delete').' '.$this->l('an attribute group or an attribute value').'
        • +
        • '.$this->l('You update one or more feature values for a product').'
        • +
        +

        '.$this->l('Warning: This could take several minutes.').'

        + '.$this->l('If you do not, this cache table might become larger and larger (less efficient), and all the new choices (attributes, features) will not be offered to your visitors.').'

        +
        +

        +
        +
        '; + } + + public function generateFilters($selectedFilters = array()) + { + ini_set('display_errors', 'On'); + + global $smarty, $link, $cookie; + + /* If the current category isn't defined of if it's homepage, we have nothing to display */ + $id_parent = (int)Tools::getValue('id_category', Tools::getValue('id_category_layered', 1)); + if ($id_parent == 1) + return; + + /* First we need to get all subcategories of current category */ + $category = new Category((int)$id_parent); + + $subCategories = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_category, c.id_parent + FROM '._DB_PREFIX_.'category c + WHERE c.nleft > '.(int)$category->nleft.' and c.nright <= '.(int)$category->nright.' AND c.active = 1 + ORDER BY c.position ASC'); + + $oneRow = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'layered_cache'); + if (!$oneRow) + return; + + $whereC = ' AND (c'.(int)$id_parent.' = 1 OR '; + $queryProduct = ', c'.(int)$id_parent; + foreach ($subCategories AS $subcategory) + if (isset($oneRow['c'.(int)$subcategory['id_category']])) + { + $whereC .= ' c'.(int)$subcategory['id_category'].' = 1 OR '; + $queryProduct .= ', c'.(int)$subcategory['id_category']; + $selectedFilters['category'][] = (int)$subcategory['id_category']; + } + $whereC = rtrim($whereC, 'OR ').')'; + + /* Get the filters for the current category */ + $filters = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM '._DB_PREFIX_.'layered_category WHERE id_category = '.(int)$id_parent); + $filterBlocks = $f = $a = array(); + foreach ($filters AS $filter) + { + $filterBlocks[(int)$filter['position']]['type_lite'] = $filter['type']; + $filterBlocks[(int)$filter['position']]['type'] = $filter['type'].($filter['id_value'] ? '_'.(int)$filter['id_value'] : ''); + $filterBlocks[(int)$filter['position']]['id_key'] = (int)$filter['id_value']; + switch ($filter['type']) + { + case 'id_feature': + $f[] = (int)$filter['id_value']; + + $filterBlocks[(int)$filter['position']]['SQLvalues'] = Db::getInstance()->ExecuteS(' + SELECT fvl.id_feature_value, fvl.value + FROM '._DB_PREFIX_.'feature_value fv + LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = fv.id_feature_value) + WHERE (fv.custom IS NULL OR fv.custom = 0) AND fv.id_feature = '.(int)$filterBlocks[(int)$filter['position']]['id_key'].' AND fvl.id_lang = '.(int)$cookie->id_lang); + + foreach ($filterBlocks[(int)$filter['position']]['SQLvalues'] AS $key => $value) + if (isset($oneRow['f'.(int)$value['id_feature_value']])) + $queryProduct .= ', f'.(int)$value['id_feature_value']; + + break; + + case 'id_attribute_group': + $a[] = (int)$filter['id_value']; + + $filterBlocks[(int)$filter['position']]['SQLvalues'] = Db::getInstance()->ExecuteS(' + SELECT al.id_attribute, al.name, a.color + FROM '._DB_PREFIX_.'attribute a + LEFT JOIN '._DB_PREFIX_.'attribute_lang al ON (al.id_attribute = a.id_attribute) + WHERE a.id_attribute_group = '.(int)$filterBlocks[(int)$filter['position']]['id_key'].' AND al.id_lang = '.(int)$cookie->id_lang); + + foreach ($filterBlocks[(int)$filter['position']]['SQLvalues'] AS $value) + if (isset($oneRow['a'.(int)$value['id_attribute']])) + $queryProduct .= ', a'.(int)$value['id_attribute']; + + break; + } + } + + $productsSQL = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT lc.id_product, p.condition, p.id_manufacturer, p.quantity'.$queryProduct.' + FROM '._DB_PREFIX_.'layered_cache lc + INNER JOIN '._DB_PREFIX_.'product p ON (p.id_product = lc.id_product) + WHERE 1 '.$whereC, false); + + $products = array(); + $db = Db::getInstance(); + while ($product = $db->nextRow($productsSQL)) + { + $row = array(); + foreach ($product AS $key => $value) + if ($value == 1) + $row[$key] = true; + $row['id_manufacturer'] = (int)$product['id_manufacturer']; + $row['quantity'] = (bool)$product['quantity']; + $row['condition'] = $product['condition']; + $products[(int)$product['id_product']] = $row; + } + + /* Get the feature block names & values */ + if (sizeof($f)) + { + $fNames = Db::getInstance()->ExecuteS(' + SELECT id_feature, name + FROM '._DB_PREFIX_.'feature_lang + WHERE id_lang = '.(int)$cookie->id_lang.' AND id_feature IN ('.implode(',', $f).')'); + + $fNameByID = array(); + foreach ($fNames AS $fName) + $fNameByID[(int)$fName['id_feature']] = $fName['name']; + } + + /* Get the feature block names & values */ + if (sizeof($a)) + { + $aNames = Db::getInstance()->ExecuteS(' + SELECT ag.id_attribute_group, agl.public_name, ag.is_color_group + FROM '._DB_PREFIX_.'attribute_group ag + LEFT JOIN '._DB_PREFIX_.'attribute_group_lang agl ON (agl.id_attribute_group = ag.id_attribute_group) + WHERE agl.id_lang = '.(int)$cookie->id_lang.' AND ag.id_attribute_group IN ('.implode(',', $a).')'); + + $aNameByID = $colorGroups = array(); + foreach ($aNames AS $aName) + { + $aNameByID[(int)$aName['id_attribute_group']] = $aName['public_name']; + if ($aName['is_color_group']) + $colorGroups[(int)$aName['id_attribute_group']] = true; + } + } + + foreach ($filterBlocks AS &$filterBlock) + { + if ($filterBlock['type_lite'] == 'category') + { + $filterBlock['name'] = $this->l('Categories'); + + $productCat = $this->filterProducts($products, $selectedFilters, 'category'); + + $filterCategories = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_category, c.id_parent, cl.name, + (SELECT GROUP_CONCAT(c2.id_category) FROM '._DB_PREFIX_.'category c2 WHERE c2.active = 1 AND c2.nleft > c.nleft and c2.nright < c.nright) subcategories + FROM '._DB_PREFIX_.'category c + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category) + WHERE c.active = 1 AND c.id_parent = '.(int)$category->id.' AND cl.id_lang = '.(int)$cookie->id_lang.' + ORDER BY c.position ASC'); + + foreach ($filterCategories AS $filterCategory) + { + $filterBlock['values'][(int)$filterCategory['id_category']]['name'] = method_exists('Category', 'hideCategoryPosition') ? Category::hideCategoryPosition($filterCategory['name']) : $filterCategory['name']; + if (!isset($filterBlock['values'][(int)$filterCategory['id_category']]['n'])) + $filterBlock['values'][(int)$filterCategory['id_category']]['n'] = 0; + if (isset($selectedFilters['category']) AND in_array($filterCategory['id_category'], $selectedFilters['category'])) + $filterBlock['values'][(int)$filterCategory['id_category']]['checked'] = true; + + foreach ($productCat AS $product) + { + $tmpTab = explode(',', $filterCategory['subcategories']); + $tmpTab[] = (int)$filterCategory['id_category']; + foreach ($tmpTab AS $idSubCategory) + if (isset($product['c'.(int)$idSubCategory])) + $filterBlock['values'][(int)$filterCategory['id_category']]['n']++; + } + } + } + elseif ($filterBlock['type_lite'] == 'id_feature') + { + $filterBlock['name'] = $fNameByID[(int)$filterBlock['id_key']]; + $filterBlock['values'] = array(); + + $productFeat = $this->filterProducts($products, $selectedFilters, 'id_feature_'.(int)$filterBlock['id_key']); + + foreach ($filterBlock['SQLvalues'] AS $value) + { + foreach ($productFeat AS $product) + if (isset($product['f'.$value['id_feature_value']])) + { + $filterBlock['values'][(int)$value['id_feature_value']]['name'] = $value['value']; + if (!isset($filterBlock['values'][(int)$value['id_feature_value']]['n'])) + $filterBlock['values'][(int)$value['id_feature_value']]['n'] = 0; + $filterBlock['values'][(int)$value['id_feature_value']]['n']++; + } + foreach ($products AS $product) + if (isset($product['f'.$value['id_feature_value']]) AND !isset($filterBlock['values'][(int)$value['id_feature_value']])) + { + $filterBlock['values'][(int)$value['id_feature_value']]['name'] = $value['value']; + $filterBlock['values'][(int)$value['id_feature_value']]['n'] = 0; + } + if (isset($selectedFilters['id_feature_'.(int)$filterBlock['id_key']]) AND in_array((int)$value['id_feature_value'].'_'.(int)$filterBlock['id_key'], $selectedFilters['id_feature_'.(int)$filterBlock['id_key']])) + $filterBlock['values'][(int)$value['id_feature_value']]['checked'] = true; + } + + unset($filterBlock['SQLvalues']); + } + elseif ($filterBlock['type_lite'] == 'id_attribute_group') + { + $filterBlock['name'] = $aNameByID[(int)$filterBlock['id_key']]; + $filterBlock['is_color_group'] = isset($colorGroups[(int)$filterBlock['id_key']]); + $filterBlock['values'] = array(); + + $productsAttr = $this->filterProducts($products, $selectedFilters, 'id_attribute_group_'.(int)$filterBlock['id_key']); + + foreach ($filterBlock['SQLvalues'] AS $value) + { + foreach ($productsAttr AS $product) + if (isset($product['a'.$value['id_attribute']])) + { + $filterBlock['values'][(int)$value['id_attribute']]['name'] = $value['name']; + $filterBlock['values'][(int)$value['id_attribute']]['color'] = $value['color']; + if (!isset($filterBlock['values'][(int)$value['id_attribute']]['n'])) + $filterBlock['values'][(int)$value['id_attribute']]['n'] = 0; + $filterBlock['values'][(int)$value['id_attribute']]['n']++; + } + foreach ($products AS $product) + if (isset($product['a'.$value['id_attribute']]) AND !isset($filterBlock['values'][(int)$value['id_attribute']])) + { + $filterBlock['values'][(int)$value['id_attribute']]['name'] = $value['name']; + $filterBlock['values'][(int)$value['id_attribute']]['n'] = 0; + } + if (isset($selectedFilters['id_attribute_group_'.(int)$filterBlock['id_key']]) AND in_array((int)$value['id_attribute'].'_'.(int)$filterBlock['id_key'], $selectedFilters['id_attribute_group_'.(int)$filterBlock['id_key']])) + $filterBlock['values'][(int)$value['id_attribute']]['checked'] = true; + } + unset($filterBlock['SQLvalues']); + } + elseif ($filterBlock['type_lite'] == 'condition') + { + $filterBlock['name'] = $this->l('Condition'); + $filterBlock['values'] = array( + 'new' => array('name' => $this->l('New'), 'n' => 0), + 'used' => array('name' => $this->l('Used'), 'n' => 0), + 'refurbished' => array('name' => $this->l('Refurbished'), 'n' => 0)); + + $productCond = $this->filterProducts($products, $selectedFilters, 'condition'); + foreach ($filterBlock['values'] AS $conditionKey => &$condition) + { + foreach ($productCond AS $product) + if ($product['condition'] == $conditionKey) + $condition['n']++; + if (isset($selectedFilters['condition']) AND in_array($conditionKey, $selectedFilters['condition'])) + $condition['checked'] = true; + } + } + elseif ($filterBlock['type_lite'] == 'quantity') + { + $filterBlock['name'] = $this->l('Availability'); + $filterBlock['values'] = array( + '1' => array('name' => $this->l('In stock'), 'n' => 0), + '0' => array('name' => $this->l('Not available'), 'n' => 0)); + $productQuant = $this->filterProducts($products, $selectedFilters, 'quantity'); + foreach ($filterBlock['values'] AS $quantKey => &$quantity) + { + foreach ($productQuant AS $product) + if ($product['quantity'] == $quantKey) + $quantity['n']++; + if (isset($selectedFilters['quantity']) AND in_array($quantKey, $selectedFilters['quantity'])) + $quantity['checked'] = true; + } + } + elseif ($filterBlock['type_lite'] == 'manufacturer') + { + $filterBlock['name'] = $this->l('Manufacturer'); + + $productsManuf = $this->filterProducts($products, $selectedFilters, 'manufacturer'); + + $man = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT(p.id_manufacturer), m.name + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + WHERE p.id_product IN ('.implode(',', array_keys($products)).') AND p.id_manufacturer != 0'); + + foreach ($man AS $manufacturer) + { + $filterBlock['values'][(int)$manufacturer['id_manufacturer']]['name'] = $manufacturer['name']; + if (!isset($filterBlock['values'][(int)$manufacturer['id_manufacturer']]['n'])) + $filterBlock['values'][(int)$manufacturer['id_manufacturer']]['n'] = 0; + foreach ($productsManuf AS $product) + if ($product['id_manufacturer'] == $manufacturer['id_manufacturer']) + $filterBlock['values'][(int)$manufacturer['id_manufacturer']]['n']++; + if (isset($selectedFilters['manufacturer']) AND in_array($manufacturer['id_manufacturer'], $selectedFilters['manufacturer'])) + $filterBlock['values'][(int)$manufacturer['id_manufacturer']]['checked'] = true; + } + } + } + + $nFilters = 0; + foreach ($selectedFilters AS $filters) + $nFilters += sizeof($filters); + + $smarty->assign(array( + 'layered_use_checkboxes' => (int)Configuration::get('PS_LAYERED_NAVIGATION_CHECKBOXES'), + 'id_category_layered' => (int)$id_parent, + 'selected_filters' => $selectedFilters, + 'n_filters' => (int)$nFilters, + 'filters' => $filterBlocks)); + + return $smarty->fetch(_PS_MODULE_DIR_.$this->name.'/blocklayered.tpl'); + } + + public function ajaxCall() + { + global $smarty, $cookie; + + /* Analyze all the filters selected by the user and store them into a tab */ + $filters = array('category' => array(), 'manufacturer' => array(), 'quantity' => array(), 'condition' => array()); + foreach ($_GET AS $key => $value) + if (substr($key, 0, 8) == 'layered_') + { + preg_match('/^(.*)_[0-9|new|used|refurbished]+$/', substr($key, 8, strlen($key) - 8), $res); + if (isset($res[1])) + { + $tmpTab = explode('_', $value); + $value = $tmpTab[0]; + $id_key = false; + if (isset($tmpTab[1])) + $id_key = $tmpTab[1]; + if ($res[1] == 'condition' AND in_array($value, array('new', 'used', 'refurbished'))) + $filters['condition'][] = $value; + elseif ($res[1] == 'quantity' AND (!$value OR $value == 1)) + $filters['quantity'][] = $value; + elseif (in_array($res[1], array('id_attribute_group', 'category', 'id_feature', 'manufacturer'))) + { + if (!isset($filters[$res[1].($id_key ? '_'.$id_key : '')])) + $filters[$res[1].($id_key ? '_'.$id_key : '')] = array(); + $filters[$res[1].($id_key ? '_'.$id_key : '')][] = (int)$value; + } + } + } + + $queryFilters = ''; + foreach ($filters AS $key => $filterValues) + { + if (!sizeof($filterValues)) + continue; + + preg_match('/^(.*[^_0-9])/', $key, $res); + $key = $res[1]; + + switch ($key) + { + case 'id_feature': + $queryFilters .= ' AND ('; + foreach ($filterValues AS $filterValue) + $queryFilters .= 'lc.f'.(int)$filterValue.' = 1 OR '; + $queryFilters = rtrim($queryFilters, 'OR ').')'; + break; + + case 'id_attribute_group': + $queryFilters .= ' AND ('; + foreach ($filterValues AS $filterValue) + $queryFilters .= 'lc.a'.(int)$filterValue.' = 1 OR '; + $queryFilters = rtrim($queryFilters, 'OR ').')'; + break; + + case 'category': + $queryFilters .= ' AND (lc.c'.(int)Tools::getValue('id_category_layered').' = 1 OR '; + foreach ($filters['category'] AS $id_category) + { + $category = new Category((int)$id_category); + if (Validate::isLoadedObject($category)) + { + $subCategories = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_category, c.id_parent + FROM '._DB_PREFIX_.'category c + WHERE c.nleft >= '.(int)$category->nleft.' and c.nright <= '.(int)$category->nright.' AND c.active = 1 + ORDER BY c.position ASC'); + + foreach ($subCategories AS $subCategory) + $queryFilters .= 'lc.c'.(int)$subCategory['id_category'].' = 1 OR '; + } + } + $queryFilters = rtrim($queryFilters, 'OR ').')'; + break; + + case 'quantity': + if (sizeof($filters['quantity']) == 2) + break; + $queryFilters .= ' AND p.quantity '.(!$filters['quantity'][0] ? '=' : '>').' 0'; + break; + + case 'manufacturer': + $queryFilters .= ' AND p.id_manufacturer IN ('.implode($filters['manufacturer'], ',').')'; + break; + + case 'condition': + if (sizeof($filters['condition']) == 3) + break; + $queryFilters .= ' AND p.condition IN ('; + foreach ($filters['condition'] AS $cond) + $queryFilters .= '\''.$cond.'\','; + $queryFilters = rtrim($queryFilters, ',').')'; + break; + } + } + + if (!sizeof($filters['category'])) + $queryFilters .= ' AND (lc.c'.(int)Tools::getValue('id_category_layered').' = 1)'; + $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.id_product, p.out_of_stock, p.available_for_order, p.quantity, p.id_category_default, p.customizable, p.show_price, + p.ean13, pl.available_later, pl.description_short, pl.link_rewrite, pl.name, i.id_image, il.legend, m.name manufacturer_name, + DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new + FROM '._DB_PREFIX_.'layered_cache lc + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = lc.id_product) + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1) + LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image AND il.id_lang = '.(int)($cookie->id_lang).') + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + WHERE pl.id_lang = '.(int)$cookie->id_lang.$queryFilters); + + $products = Product::getProductsProperties((int)$cookie->id_lang, $products); + + $smarty->assign('products', $products); + + /* We are sending an array in jSon to the .js controller, it will update both the filters and the products zones */ + return '
        '.$this->generateFilters($filters).'
        '.$smarty->fetch(_PS_THEME_DIR_.'product-list.tpl').'
        '; + } + + public function rebuildLayeredStructure() + { + @set_time_limit(0); + @ini_set('memory_limit', '64M'); + + /* Delete and re-create the products cache table */ + Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_cache'); + $createTable = 'CREATE TABLE `'._DB_PREFIX_.'layered_cache` (`id_product` INT UNSIGNED NOT NULL,'; + $confValue = 'id_product,'; + + /* Add the missing feature values columns */ + $featureValues = Db::getInstance()->ExecuteS(' + SELECT fv.id_feature_value + FROM '._DB_PREFIX_.'feature_product fp + LEFT JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature_value = fp.id_feature_value) + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = fp.id_product) + WHERE (fv.custom IS NULL OR fv.custom = 0) AND p.active = 1 + GROUP BY fv.id_feature_value'); + + /* Add the missing attribute values columns */ + $attributeValues = Db::getInstance()->ExecuteS(' + SELECT pac.id_attribute + FROM '._DB_PREFIX_.'product_attribute_combination pac + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product_attribute = pac.id_product_attribute) + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = pa.id_product) + WHERE p.active = 1 + GROUP BY pac.id_attribute'); + + /* Add the missing categories columns */ + $categories = Db::getInstance()->ExecuteS(' + SELECT cp.id_category + FROM '._DB_PREFIX_.'category_product cp + LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category) + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = cp.id_product) + WHERE p.active = 1 AND c.active = 1 + GROUP BY cp.id_category'); + + foreach ($featureValues AS $featureValue) + { + $createTable .= '`f'.(int)$featureValue['id_feature_value'].'` TINYINT(1) UNSIGNED NOT NULL DEFAULT \'0\','; + $confValue .= 'f'.(int)$featureValue['id_feature_value'].','; + } + + foreach ($attributeValues AS $attributeValue) + { + $createTable .= '`a'.(int)$attributeValue['id_attribute'].'` TINYINT(1) UNSIGNED NOT NULL DEFAULT \'0\','; + $confValue .= 'a'.(int)$attributeValue['id_attribute'].','; + } + + foreach ($categories AS $category) + { + $createTable .= '`c'.(int)$category['id_category'].'` TINYINT(1) UNSIGNED NOT NULL DEFAULT \'0\','; + $confValue .= 'c'.(int)$category['id_category'].','; + } + + Configuration::updateValue('PS_LAYERED_COLUMNS', rtrim($confValue, ',')); + Db::getInstance()->Execute($createTable.' PRIMARY KEY (`id_product`)) ENGINE=MyISAM CHARSET=latin1'); + + /* Delete and re-create the layered categories table */ + Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_category'); + Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'layered_category` ( + `id_layered_category` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `id_category` INT(10) UNSIGNED NOT NULL, + `id_value` INT(10) UNSIGNED NOT NULL DEFAULT \'0\', + `type` ENUM(\'category\',\'id_feature\',\'id_attribute_group\',\'quantity\',\'condition\',\'manufacturer\') NOT NULL, + `position` INT(10) UNSIGNED NOT NULL, + PRIMARY KEY (`id_layered_category`), + KEY `id_category` (`id_category`,`type`) + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;'); + } + + public function rebuildLayeredCache($productsIds = array(), $categoriesIds = array()) + { + @set_time_limit(0); + @ini_set('memory_limit', '64M'); + $db = Db::getInstance(); + $nCategories = array(); + $doneCategories = array(); + + $attributeGroups = Db::getInstance()->ExecuteS(' + SELECT a.id_attribute, a.id_attribute_group + FROM '._DB_PREFIX_.'attribute a + LEFT JOIN '._DB_PREFIX_.'product_attribute_combination pac ON (pac.id_attribute = a.id_attribute) + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product_attribute = pac.id_product_attribute) + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = pa.id_product) + LEFT JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category) + WHERE c.active = 1'.(sizeof($categoriesIds) ? ' AND cp.id_category IN ('.implode(',', $categoriesIds).')' : '').' AND p.active = 1'.(sizeof($productsIds) ? ' AND p.id_product IN ('.implode(',', $productsIds).')' : ''), false); + + $attributeGroupsById = array(); + while ($row = $db->nextRow($attributeGroups)) + $attributeGroupsById[(int)$row['id_attribute']] = (int)$row['id_attribute_group']; + + $features = Db::getInstance()->ExecuteS(' + SELECT fv.id_feature_value, fv.id_feature + FROM '._DB_PREFIX_.'feature_value fv + LEFT JOIN '._DB_PREFIX_.'feature_product fp ON (fp.id_feature_value = fv.id_feature_value) + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = fp.id_product) + LEFT JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category) + WHERE (fv.custom IS NULL OR fv.custom = 0) AND c.active = 1'.(sizeof($categoriesIds) ? ' AND cp.id_category IN ('.implode(',', $categoriesIds).')' : '').' AND p.active = 1'.(sizeof($productsIds) ? ' AND p.id_product IN ('.implode(',', $productsIds).')' : ''), false); + + $featuresById = array(); + while ($row = $db->nextRow($features)) + $featuresById[(int)$row['id_feature_value']] = (int)$row['id_feature']; + + $result = $db->ExecuteS(' + SELECT p.id_product, GROUP_CONCAT(DISTINCT fv.id_feature_value) features, GROUP_CONCAT(DISTINCT cp.id_category) categories, GROUP_CONCAT(DISTINCT pac.id_attribute) attributes + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category) + LEFT JOIN '._DB_PREFIX_.'feature_product fp ON (fp.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature_value = fp.id_feature_value) + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'product_attribute_combination pac ON (pac.id_product_attribute = pa.id_product_attribute) + WHERE c.active = 1'.(sizeof($categoriesIds) ? ' AND cp.id_category IN ('.implode(',', $categoriesIds).')' : '').' AND p.active = 1'.(sizeof($productsIds) ? ' AND p.id_product IN ('.implode(',', $productsIds).')' : '').' AND (fv.custom IS NULL OR fv.custom = 0) + GROUP BY p.id_product', false); + + /* Get all the columns to fill */ + $columns = explode(',', Configuration::get('PS_LAYERED_COLUMNS')); + + /* We do not need to build the query for products when we are just updating the layered_category table */ + if (!sizeof($categoriesIds)) + { + $query = 'INSERT INTO `'._DB_PREFIX_.'layered_cache` VALUES '; + $values = ''; + } + while ($product = $db->nextRow($result)) + { + $a = $c = $f = array(); + if (!empty($product['attributes'])) + $a = array_flip(explode(',', $product['attributes'])); + if (!empty($product['categories'])) + $c = array_flip(explode(',', $product['categories'])); + if (!empty($product['features'])) + $f = array_flip(explode(',', $product['features'])); + + /* We do not need to build the query for products when we are just updating the layered_category table */ + if (!sizeof($categoriesIds)) + { + $values .= '('; + $n = 0; + foreach ($columns AS $column) + { + if (!$n) + $values .= (int)$product['id_product'].','; + else + { + if (isset(${$column{0}}[ltrim($column, $column{0})])) + $values .= '1,'; + else + $values .= '0,'; + } + $n++; + } + $values = rtrim($values, ',').'),'; + } + + $queryCategory = 'INSERT INTO '._DB_PREFIX_.'layered_category (id_category, id_value, type, position) VALUES '; + $toInsert = false; + foreach ($c AS $id_category => $category) + { + if (!isset($nCategories[(int)$id_category])) + $nCategories[(int)$id_category] = 1; + if (!isset($doneCategories[(int)$id_category]['cat'])) + { + $doneCategories[(int)$id_category]['cat'] = true; + $queryCategory .= '('.(int)$id_category.',NULL,\'category\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + foreach ($a AS $kAttribute => $attribute) + if (!isset($doneCategories[(int)$id_category]['a'.(int)$attributeGroupsById[(int)$kAttribute]])) + { + $doneCategories[(int)$id_category]['a'.(int)$attributeGroupsById[(int)$kAttribute]] = true; + $queryCategory .= '('.(int)$id_category.','.(int)$attributeGroupsById[(int)$kAttribute].',\'id_attribute_group\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + foreach ($f AS $kFeature => $feature) + if (!isset($doneCategories[(int)$id_category]['f'.(int)$featuresById[(int)$kFeature]])) + { + $doneCategories[(int)$id_category]['f'.(int)$featuresById[(int)$kFeature]] = true; + $queryCategory .= '('.(int)$id_category.','.(int)$featuresById[(int)$kFeature].',\'id_feature\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + if (!isset($doneCategories[(int)$id_category]['q'])) + { + $doneCategories[(int)$id_category]['q'] = true; + $queryCategory .= '('.(int)$id_category.',NULL,\'quantity\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + if (!isset($doneCategories[(int)$id_category]['m'])) + { + $doneCategories[(int)$id_category]['m'] = true; + $queryCategory .= '('.(int)$id_category.',NULL,\'manufacturer\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + if (!isset($doneCategories[(int)$id_category]['c'])) + { + $doneCategories[(int)$id_category]['c'] = true; + $queryCategory .= '('.(int)$id_category.',NULL,\'condition\','.(int)$nCategories[(int)$id_category]++.'),'; + $toInsert = true; + } + } + if ($toInsert) + Db::getInstance()->Execute(rtrim($queryCategory, ',')); + } + + /* We do not need to build the query for products when we are just updating the layered_category table */ + if (!sizeof($categoriesIds)) + $db->Execute($query.rtrim($values, ',')); + } + + function filterProducts($products, $selectedFilters, $excludeType = false) + { + $productsToKeep = array(); + $filterByLetter = array('id_attribute_group' => 'a', 'id_feature' => 'f', 'category' => 'c', 'manufacturer' => 'id_manufacturer', 'quantity' => 'quantity', 'condition' => 'condition'); + foreach ($selectedFilters AS $type => $filters) + { + if ($type == $excludeType OR !sizeof($filters)) + continue; + else + { + $type = preg_match('/^(.*[^_0-9])/', $type, $res); + $type = $res[1]; + + switch ($type) + { + case 'id_attribute_group': + case 'id_feature': + case 'category': + foreach ($products AS $k => $product) + foreach ($filters AS $filter) + if (isset($product[$filterByLetter[$type].(int)$filter])) + $productsToKeep[] = (int)$k; + break; + + case 'manufacturer': + case 'condition': + case 'quantity': + foreach ($products AS $k => $product) + foreach ($filters AS $filter) + if ($product[$filterByLetter[$type]] == $filter) + $productsToKeep[] = (int)$k; + break; + } + + foreach ($products AS $k => $product) + if (!in_array($k, $productsToKeep)) + unset($products[(int)$k]); + $productsToKeep = array(); + } + } + + return $products; + } +} \ No newline at end of file diff --git a/modules/blocklayered/blocklayered.tpl b/modules/blocklayered/blocklayered.tpl new file mode 100644 index 000000000..b1e868b82 --- /dev/null +++ b/modules/blocklayered/blocklayered.tpl @@ -0,0 +1,92 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Catalog' mod='blocklayered'}

        +
        +
        +
        + {if isset($selected_filters) && $n_filters > 0} +
        + {l s='Enabled filters:' mod='blocklayered'} +
          + {foreach from=$selected_filters key=filter_type item=filter_values} + {foreach from=$filter_values item=filter_value} + {foreach from=$filters item=filter} + {if $filter.type == $filter_type && isset($filter.values)} + {foreach from=$filter.values key=id_value item=value} + {if $id_value == $filter_value} +
        • x {$filter.name|escape:html:'UTF-8'}{l s=':'} {$value.name|escape:html:'UTF-8'}
        • + {/if} + {/foreach} + {/if} + {/foreach} + {/foreach} + {/foreach} +
        +
        + {/if} + {foreach from=$filters item=filter} + {if isset($filter.values)} +
        + {$filter.name|escape:html:'UTF-8'} + v +
        +
          + {foreach from=$filter.values key=id_value item=value} + + {if isset($filter.is_color_group) && $filter.is_color_group} + + {if isset($value.checked) && $value.checked}{/if} + {else} + {if $layered_use_checkboxes} {/if} + {/if} + + + {/foreach} +
        +
        + {/if} + {/foreach} +
        + + {foreach from=$filters item=filter} + {if $filter.type_lite == 'id_attribute_group' && isset($filter.is_color_group) && $filter.is_color_group} + {foreach from=$filter.values key=id_value item=value} + {if isset($value.checked)} + + {/if} + {/foreach} + {/if} + {/foreach} +
        +
        + +
        + \ No newline at end of file diff --git a/modules/blocklayered/config.xml b/modules/blocklayered/config.xml new file mode 100644 index 000000000..033afe08e --- /dev/null +++ b/modules/blocklayered/config.xml @@ -0,0 +1,11 @@ + + + blocklayered + Layered navigation block + 1.3 + Displays a block with layered navigation filters. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blocklayered/de.php b/modules/blocklayered/de.php new file mode 100644 index 000000000..b87129ef2 --- /dev/null +++ b/modules/blocklayered/de.php @@ -0,0 +1,47 @@ +blocklayered_84241e458cdd5162745500a59a3680f3'] = 'Layered Navigation-Block'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d08fa8e157fe3f1875402cbd98aee1b'] = 'Zeigt einen Block mit Layered Navigation-Filter an'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7ad3f384bcf30d783b5a6f6c810b4762'] = 'Layered Navigation Datanbank wurde erfolgreich initialisiert'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fe016d3b990c2a9dd72ab6b45892f2ae'] = 'Einstellungen erfolgreich gespeichert'; +$_MODULE['<{blocklayered}prestashop>blocklayered_09da2b6f1217055bb22caa6ea08d9b80'] = 'Layered Navigation'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6b50913da72479e39aae61ec4739b09a'] = 'Dies ist die Beta-Version dieses Moduls, es wird in PrestaShop v1.4.1 verbessert werden'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f6fc27f63284329ab1391e19ec7d873a'] = '10 bevorstehende Verbesserungen in PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b77ae7b3f227f97fdbfbaee819c048d6'] = 'Echtzeit-Aktualisierung der Cache-Tabelle'; +$_MODULE['<{blocklayered}prestashop>blocklayered_3cd881c5805a5564b080022968081652'] = 'Zusätzliche Filter (Preise, Gewicht)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f67587ba40eff59a15796352c9037ddf'] = 'Fähigkeit, Filter nach Kategorie in der Modulkonfiguration zu verwalten '; +$_MODULE['<{blocklayered}prestashop>blocklayered_559175435fec02f846564385b20b98e2'] = 'Fähigkeit, Filtergruppen zu verbergen, die keine Werte und Filter-Werte mit 0 Produkten haben'; +$_MODULE['<{blocklayered}prestashop>blocklayered_abb461f7d4d8271a12ceead064d13cd0'] = 'Statistik und Analyse'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6af4dd46928a781eda42b940d3394ca6'] = 'Produktsortierung & Paginierung verwalten '; +$_MODULE['<{blocklayered}prestashop>blocklayered_b4ecb2bd1ea5153550669329db53277d'] = 'Kontrolle zur Kategorie-Gruppentabelle hinzufügen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_d99bf479cc40101e28f1f0ba1bfb6150'] = 'SEO Links & Echtzeit URL einrichten (Fähigkeit, die URL jemandem zu geben)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_27c7b93d882068a1137a9350c7f1a132'] = 'Weitere Optionen zur Modul-Konfiguration hinzufügen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fb8082696a8d7a40fa62ea0e89b18c32'] = 'Leistungsverbesserungen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7263de0a10ad25dfdadc44791c44fb1f'] = 'Cache-Initialisierung'; +$_MODULE['<{blocklayered}prestashop>blocklayered_590af1487ee6c10871628c4e2a968f67'] = 'Wann müssen Sie den Cache initialisieren?'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f3ac6d10ce5508b543141ae9bce6294c'] = 'Bevor Sie dieses Modul zum ersten Mal benutzen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32735b7ba755d545ef36c5e5cd1f17e'] = 'Sie fügen hinzu / aktualisieren / löschen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_97e3d87f9cedf66eea7514ffe2f8d56c'] = 'eine Funktion oder einen Funktionswert'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7a5d52e91cda4e97b3776b23a9356918'] = 'eine Attribut-Gruppe oder einen Attribut-Wert'; +$_MODULE['<{blocklayered}prestashop>blocklayered_5a1e99c9ae45729844784683d8c02379'] = 'Sie aktualisieren einen oder mehrere Funktionswerte für ein Produkt'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2875534393f5ef32e42d92c30e9dfda5'] = 'Achtung: Dies kann mehrere Minuten dauern.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_15aa842a19af51c2cf1ec631cdf8337a'] = 'Wenn Sie dies nicht tun, könnte dies Cache-Tabelle immer größer werden (d.h. weniger effizient), und all die neuen Möglichkeiten (Attribute, Funktionen) können Ihren Besuchern nicht angeboten werden.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c64a069750ff8924b029b2206cabf3b2'] = 'Initialisieren Sie die Layered Navigation Datenbank'; +$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Kategorien'; +$_MODULE['<{blocklayered}prestashop>blocklayered_9e2941b3c81256fac10392aaca4ccfde'] = 'Zustand'; +$_MODULE['<{blocklayered}prestashop>blocklayered_03c2e7e41ffc181a4e84080b4710e81e'] = 'Neu'; +$_MODULE['<{blocklayered}prestashop>blocklayered_019d1ca7d50cc54b995f60d456435e87'] = 'Gebraucht'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6da03a74721a0554b7143254225cc08a'] = 'Überholt'; +$_MODULE['<{blocklayered}prestashop>blocklayered_faeaec9eda6bc4c8cb6e1a9156a858be'] = 'Verfügbarkeit'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fcebe56087b9373f15514831184fa572'] = 'Auf Lager'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d25c72c1b18e562f6654fff8e11711e'] = 'Nicht verfügbar'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Hersteller'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32516babc5b6c47eb8ce1bfc223253c'] = 'Katalog'; +$_MODULE['<{blocklayered}prestashop>blocklayered_1262d1b9fbffb3a8e85ac9e4b449e989'] = 'Aktivierte Filter:'; +$_MODULE['<{blocklayered}prestashop>blocklayered_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blocklayered}prestashop>blocklayered_8524de963f07201e5c086830d370797f'] = 'Lädt...'; diff --git a/modules/blocklayered/es.php b/modules/blocklayered/es.php new file mode 100644 index 000000000..2c3483d5c --- /dev/null +++ b/modules/blocklayered/es.php @@ -0,0 +1,47 @@ +blocklayered_84241e458cdd5162745500a59a3680f3'] = 'Bloque navegación por facetas'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d08fa8e157fe3f1875402cbd98aee1b'] = 'Muestra un bloque con los filtros de la navegación por facetas'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7ad3f384bcf30d783b5a6f6c810b4762'] = 'La base de datos por niveles de navegación se ha iniciado con éxito'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fe016d3b990c2a9dd72ab6b45892f2ae'] = 'Configuración guardada con éxito'; +$_MODULE['<{blocklayered}prestashop>blocklayered_09da2b6f1217055bb22caa6ea08d9b80'] = 'Capas de navegación'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6b50913da72479e39aae61ec4739b09a'] = 'Este módulo se encuentra en versión beta y se mejorará en PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f6fc27f63284329ab1391e19ec7d873a'] = '10 mejoras futuras en PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b77ae7b3f227f97fdbfbaee819c048d6'] = 'Actualizar en tiempo real de la tabla de caché'; +$_MODULE['<{blocklayered}prestashop>blocklayered_3cd881c5805a5564b080022968081652'] = 'Filtros adicionales (precios, peso)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f67587ba40eff59a15796352c9037ddf'] = 'Capacidad de gestión de filtros por categoría en la configuración del módulo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_559175435fec02f846564385b20b98e2'] = 'Capacidad de ocultar los grupos de filtro sin valores y los valores con 0 productos'; +$_MODULE['<{blocklayered}prestashop>blocklayered_abb461f7d4d8271a12ceead064d13cd0'] = 'Estadísticas y análisis'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6af4dd46928a781eda42b940d3394ca6'] = 'Administrar tipo de productos y paginación'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b4ecb2bd1ea5153550669329db53277d'] = 'Añadir un cheque a la tabla categoría_grupo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_d99bf479cc40101e28f1f0ba1bfb6150'] = 'Los links SEO y la construcción de URL en tiempo real (capacidad de dar la dirección a alguien)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_27c7b93d882068a1137a9350c7f1a132'] = 'Añadir más opciones en la configuración del módulo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fb8082696a8d7a40fa62ea0e89b18c32'] = 'Ejecución mejoras'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b17f3f4dcf653a5776792498a9b44d6a'] = 'Configuración actualizada'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7263de0a10ad25dfdadc44791c44fb1f'] = 'Inicialización de caché'; +$_MODULE['<{blocklayered}prestashop>blocklayered_590af1487ee6c10871628c4e2a968f67'] = '¿Cuándo tiene que inicializar el caché?'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f3ac6d10ce5508b543141ae9bce6294c'] = 'Antes de usar este módulo por primera vez'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32735b7ba755d545ef36c5e5cd1f17e'] = 'Puede agregar, actualizar o suprimir'; +$_MODULE['<{blocklayered}prestashop>blocklayered_97e3d87f9cedf66eea7514ffe2f8d56c'] = 'una característica o un valor de la característica'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7a5d52e91cda4e97b3776b23a9356918'] = 'un atributo o grupo de un valor de atributo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_5a1e99c9ae45729844784683d8c02379'] = 'Actualizar uno o más valores de la característica de un producto'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2875534393f5ef32e42d92c30e9dfda5'] = 'Advertencia: Esto puede tardar varios minutos.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_15aa842a19af51c2cf1ec631cdf8337a'] = 'Si no lo hace, esta tabla caché podría ser cada vez más grande ( y ser menos eficaz), y sus visitantes no tendrán acceso a todas las nuevas opciones (atributos, características).'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c64a069750ff8924b029b2206cabf3b2'] = 'Inicializar la base de datos de navegación por capas'; +$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorías'; +$_MODULE['<{blocklayered}prestashop>blocklayered_9e2941b3c81256fac10392aaca4ccfde'] = 'Estado'; +$_MODULE['<{blocklayered}prestashop>blocklayered_03c2e7e41ffc181a4e84080b4710e81e'] = 'Nuevo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_019d1ca7d50cc54b995f60d456435e87'] = 'Usado'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6da03a74721a0554b7143254225cc08a'] = 'Restaurado'; +$_MODULE['<{blocklayered}prestashop>blocklayered_faeaec9eda6bc4c8cb6e1a9156a858be'] = 'Disponibilidad'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fcebe56087b9373f15514831184fa572'] = 'En stock'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d25c72c1b18e562f6654fff8e11711e'] = 'No disponible'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabricante'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32516babc5b6c47eb8ce1bfc223253c'] = 'Catálogo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_1262d1b9fbffb3a8e85ac9e4b449e989'] = 'filtros habilitados:'; +$_MODULE['<{blocklayered}prestashop>blocklayered_ea4788705e6873b424c65e91c2846b19'] = 'Cancelar'; +$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blocklayered}prestashop>blocklayered_8524de963f07201e5c086830d370797f'] = 'Cargando ...'; diff --git a/modules/blocklayered/fr.php b/modules/blocklayered/fr.php new file mode 100644 index 000000000..13bc5ce66 --- /dev/null +++ b/modules/blocklayered/fr.php @@ -0,0 +1,47 @@ +blocklayered_84241e458cdd5162745500a59a3680f3'] = 'Bloc navigation à facettes'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d08fa8e157fe3f1875402cbd98aee1b'] = 'Affiche un bloc avec les filtres de la navigation à facettes'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7ad3f384bcf30d783b5a6f6c810b4762'] = 'La base de données de la navigation à facettes à été initialisée avec succès'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fe016d3b990c2a9dd72ab6b45892f2ae'] = 'Paramètres enregistrés avec succès'; +$_MODULE['<{blocklayered}prestashop>blocklayered_09da2b6f1217055bb22caa6ea08d9b80'] = 'Navigation à facettes'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6b50913da72479e39aae61ec4739b09a'] = 'Ce module est en version beta et sera amélioré dans PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f6fc27f63284329ab1391e19ec7d873a'] = '10 améliorations à venir dans PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b77ae7b3f227f97fdbfbaee819c048d6'] = 'Rafraîchissement en temps réel de la table de cache'; +$_MODULE['<{blocklayered}prestashop>blocklayered_3cd881c5805a5564b080022968081652'] = 'Filtres supplémentaires (par prix, par poids)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f67587ba40eff59a15796352c9037ddf'] = 'Possibilité de gérer les filtres catégorie par catégorie dans la configuration du module'; +$_MODULE['<{blocklayered}prestashop>blocklayered_559175435fec02f846564385b20b98e2'] = 'Possibilité de masquer les groupes sans valeurs, ou les valeurs correspondant à 0 produits'; +$_MODULE['<{blocklayered}prestashop>blocklayered_abb461f7d4d8271a12ceead064d13cd0'] = 'Statistiques et analyses'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6af4dd46928a781eda42b940d3394ca6'] = 'Gestion du tri des produits et de la pagination'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b4ecb2bd1ea5153550669329db53277d'] = 'Ajout d\'une vérification sur la table category_group table'; +$_MODULE['<{blocklayered}prestashop>blocklayered_d99bf479cc40101e28f1f0ba1bfb6150'] = 'Lien ré-écrits et construction de l\'URL en temps réel (possibilité de la transmettre à quelqu\'un)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_27c7b93d882068a1137a9350c7f1a132'] = 'Ajout d\'options de configuration'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fb8082696a8d7a40fa62ea0e89b18c32'] = 'Amélioration des performance'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les paramètres'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7263de0a10ad25dfdadc44791c44fb1f'] = 'Initialisation du cache'; +$_MODULE['<{blocklayered}prestashop>blocklayered_590af1487ee6c10871628c4e2a968f67'] = 'Quand devez-vous initialiser le cache ?'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f3ac6d10ce5508b543141ae9bce6294c'] = 'Avant d\'utiliser ce module pour la première fois'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32735b7ba755d545ef36c5e5cd1f17e'] = 'Vous ajoutez/modifiez/supprimez'; +$_MODULE['<{blocklayered}prestashop>blocklayered_97e3d87f9cedf66eea7514ffe2f8d56c'] = 'une caractéristique ou une valeur de caractéristique'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7a5d52e91cda4e97b3776b23a9356918'] = 'un groupe d\'attributs ou une valeur pour un attribut'; +$_MODULE['<{blocklayered}prestashop>blocklayered_5a1e99c9ae45729844784683d8c02379'] = 'Vous mettez à jour une ou plusieurs valeurs de caractéristiques pour un produit'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2875534393f5ef32e42d92c30e9dfda5'] = 'Attention : cela peut prendre plusieurs minutes.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_15aa842a19af51c2cf1ec631cdf8337a'] = 'Si vous ne le faites pas, cette table de cache risque de grossir rapidement (et d\'être moins performante), et les nouveaux choix (attributs, caractéristiques) ne seront pas présentés à vos visiteurs.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c64a069750ff8924b029b2206cabf3b2'] = 'Initialiser la base de données de la navigation à facettes'; +$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories'; +$_MODULE['<{blocklayered}prestashop>blocklayered_9e2941b3c81256fac10392aaca4ccfde'] = 'Etat'; +$_MODULE['<{blocklayered}prestashop>blocklayered_03c2e7e41ffc181a4e84080b4710e81e'] = 'Neuf'; +$_MODULE['<{blocklayered}prestashop>blocklayered_019d1ca7d50cc54b995f60d456435e87'] = 'Occasion'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6da03a74721a0554b7143254225cc08a'] = 'Reconditionné'; +$_MODULE['<{blocklayered}prestashop>blocklayered_faeaec9eda6bc4c8cb6e1a9156a858be'] = 'Disponibilité'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fcebe56087b9373f15514831184fa572'] = 'En stock'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponible'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabricant'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32516babc5b6c47eb8ce1bfc223253c'] = 'Catalogue'; +$_MODULE['<{blocklayered}prestashop>blocklayered_1262d1b9fbffb3a8e85ac9e4b449e989'] = 'Filtres actifs :'; +$_MODULE['<{blocklayered}prestashop>blocklayered_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ' :'; +$_MODULE['<{blocklayered}prestashop>blocklayered_8524de963f07201e5c086830d370797f'] = 'Chargement...'; diff --git a/modules/blocklayered/it.php b/modules/blocklayered/it.php new file mode 100644 index 000000000..c6b1c60da --- /dev/null +++ b/modules/blocklayered/it.php @@ -0,0 +1,47 @@ +blocklayered_84241e458cdd5162745500a59a3680f3'] = 'Blocco di navigazione a strati'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d08fa8e157fe3f1875402cbd98aee1b'] = 'Visualizza un blocco con i filtri di navigazione a strati'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7ad3f384bcf30d783b5a6f6c810b4762'] = 'Il database di navigazione a strati è stato inizializzato con successo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fe016d3b990c2a9dd72ab6b45892f2ae'] = 'Configurazione salvata con successo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_09da2b6f1217055bb22caa6ea08d9b80'] = 'Navigazione a strati'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6b50913da72479e39aae61ec4739b09a'] = 'Questo modulo è in versione beta e sarà migliorato in PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f6fc27f63284329ab1391e19ec7d873a'] = '10 miglioramenti imminenti in PrestaShop v1.4.1'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b77ae7b3f227f97fdbfbaee819c048d6'] = 'Aggiornamento in tempo reale della tabella cache'; +$_MODULE['<{blocklayered}prestashop>blocklayered_3cd881c5805a5564b080022968081652'] = 'Filtri aggiuntivi (prezzi, peso)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f67587ba40eff59a15796352c9037ddf'] = 'Possibilità di gestire i filtri in base alla categoria nella configurazione del modulo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_559175435fec02f846564385b20b98e2'] = 'Possibilità di nascondere gruppi filtro senza valori e valori di filtro con 0 prodotti'; +$_MODULE['<{blocklayered}prestashop>blocklayered_abb461f7d4d8271a12ceead064d13cd0'] = 'Statistiche e analisi'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6af4dd46928a781eda42b940d3394ca6'] = 'Gestione della selezione prodotti e impaginazione'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b4ecb2bd1ea5153550669329db53277d'] = 'Aggiungere un controllo sulla tabella category_group'; +$_MODULE['<{blocklayered}prestashop>blocklayered_d99bf479cc40101e28f1f0ba1bfb6150'] = 'Link SEO e costruzione URL in tempo reale (possibilità di inviare l\'URL a qualcuno)'; +$_MODULE['<{blocklayered}prestashop>blocklayered_27c7b93d882068a1137a9350c7f1a132'] = 'Aggiunta di ulteriori opzioni nella configurazione del modulo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fb8082696a8d7a40fa62ea0e89b18c32'] = 'Miglioramenti prestazioni'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocklayered}prestashop>blocklayered_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7263de0a10ad25dfdadc44791c44fb1f'] = 'Inizializzazione cache'; +$_MODULE['<{blocklayered}prestashop>blocklayered_590af1487ee6c10871628c4e2a968f67'] = 'Quando si deve inizializzare la cache?'; +$_MODULE['<{blocklayered}prestashop>blocklayered_f3ac6d10ce5508b543141ae9bce6294c'] = 'Prima di usare questo modulo per la prima volta'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32735b7ba755d545ef36c5e5cd1f17e'] = 'È possibile aggiungere / aggiornare / eliminare'; +$_MODULE['<{blocklayered}prestashop>blocklayered_97e3d87f9cedf66eea7514ffe2f8d56c'] = 'una funzione o un valore funzione'; +$_MODULE['<{blocklayered}prestashop>blocklayered_7a5d52e91cda4e97b3776b23a9356918'] = 'un gruppo di attributi o un valore di attributo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_5a1e99c9ae45729844784683d8c02379'] = 'Aggiorna uno o più valori di funzionalità di un prodotto'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2875534393f5ef32e42d92c30e9dfda5'] = 'Attenzione: Questo potrebbe richiedere alcuni minuti.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_15aa842a19af51c2cf1ec631cdf8337a'] = 'Se non lo fai, questa tabella cache potrebbe diventare sempre più granda (meno efficiente), e tutte le nuove scelte (attributi, caratteristiche) non saranno offerte ai visitatori.'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c64a069750ff8924b029b2206cabf3b2'] = 'Inizializzare il database di navigazione a strati'; +$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorie'; +$_MODULE['<{blocklayered}prestashop>blocklayered_9e2941b3c81256fac10392aaca4ccfde'] = 'Condizione'; +$_MODULE['<{blocklayered}prestashop>blocklayered_03c2e7e41ffc181a4e84080b4710e81e'] = 'Nuovo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_019d1ca7d50cc54b995f60d456435e87'] = 'Usato'; +$_MODULE['<{blocklayered}prestashop>blocklayered_6da03a74721a0554b7143254225cc08a'] = 'Rinnovato'; +$_MODULE['<{blocklayered}prestashop>blocklayered_faeaec9eda6bc4c8cb6e1a9156a858be'] = 'Disponibilità'; +$_MODULE['<{blocklayered}prestashop>blocklayered_fcebe56087b9373f15514831184fa572'] = 'In magazzino'; +$_MODULE['<{blocklayered}prestashop>blocklayered_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponibile'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Produttore'; +$_MODULE['<{blocklayered}prestashop>blocklayered_c32516babc5b6c47eb8ce1bfc223253c'] = 'Catalogo'; +$_MODULE['<{blocklayered}prestashop>blocklayered_1262d1b9fbffb3a8e85ac9e4b449e989'] = 'Filtri abilitati:'; +$_MODULE['<{blocklayered}prestashop>blocklayered_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{blocklayered}prestashop>blocklayered_853ae90f0351324bd73ea615e6487517'] = ':'; +$_MODULE['<{blocklayered}prestashop>blocklayered_8524de963f07201e5c086830d370797f'] = 'Caricamento in corso ...'; diff --git a/modules/blocklayered/logo.gif b/modules/blocklayered/logo.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/modules/blocklayered/logo.gif differ diff --git a/modules/blocklink/add.png b/modules/blocklink/add.png new file mode 100644 index 000000000..00be352c5 Binary files /dev/null and b/modules/blocklink/add.png differ diff --git a/modules/blocklink/blocklink.js b/modules/blocklink/blocklink.js new file mode 100644 index 000000000..a343405c4 --- /dev/null +++ b/modules/blocklink/blocklink.js @@ -0,0 +1,44 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function linkEdition(linkId) +{ + getE('id').value = linkId; + getE('url').value = links[linkId][0]; + getE('newWindow').checked = links[linkId][1]; + var beg = parseInt(getE('languageFirst').value); + for (var i = 0; i <= parseInt(getE('languageNb').value - 1); i++) + getE('textInput_'+ (beg + i)).value = links[linkId][i + 2]; + getE('submitLinkUpdate').disabled = ''; + getE('submitLinkUpdate').setAttribute('class', 'button'); + /* ##### IE */ + getE('submitLinkUpdate').setAttribute('className', 'button'); +} + +function linkDeletion(linkId) +{ + document.location.replace(currentUrl+'&id='+linkId+'&token='+token); +} \ No newline at end of file diff --git a/modules/blocklink/blocklink.php b/modules/blocklink/blocklink.php new file mode 100644 index 000000000..a06ef5a6c --- /dev/null +++ b/modules/blocklink/blocklink.php @@ -0,0 +1,386 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockLink extends Module +{ + /* @var boolean error */ + protected $error = false; + + public function __construct() + { + $this->name = 'blocklink'; + $this->tab = 'front_office_features'; + $this->version = '1.4'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Link block'); + $this->description = $this->l('Adds a block with additional links.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete all your links ?'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('leftColumn') OR + !Db::getInstance()->Execute(' + CREATE TABLE '._DB_PREFIX_.'blocklink ( + `id_link` int(2) NOT NULL AUTO_INCREMENT, + `url` varchar(255) NOT NULL, + `new_window` TINYINT(1) NOT NULL, + PRIMARY KEY(`id_link`)) + ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR + !Db::getInstance()->Execute(' + CREATE TABLE '._DB_PREFIX_.'blocklink_lang ( + `id_link` int(2) NOT NULL, + `id_lang` int(2) NOT NULL, + `text` varchar(64) NOT NULL, + PRIMARY KEY(`id_link`, `id_lang`)) + ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR + !Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien'))) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall() OR + !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink') OR + !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink_lang') OR + !Configuration::deleteByName('PS_BLOCKLINK_TITLE') OR + !Configuration::deleteByName('PS_BLOCKLINK_URL')) + return false; + return true; + } + + public function hookLeftColumn($params) + { + global $cookie, $smarty; + $links = $this->getLinks(); + + $smarty->assign(array( + 'blocklink_links' => $links, + 'title' => Configuration::get('PS_BLOCKLINK_TITLE', $cookie->id_lang), + 'url' => Configuration::get('PS_BLOCKLINK_URL'), + 'lang' => 'text_'.$cookie->id_lang + )); + if (!$links) + return false; + return $this->display(__FILE__, 'blocklink.tpl'); + } + + public function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + public function getLinks() + { + $result = array(); + /* Get id and url */ + if (!$links = Db::getInstance()->ExecuteS('SELECT `id_link`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_link` DESC' : ''))) + return false; + $i = 0; + foreach ($links AS $link) + { + $result[$i]['id'] = $link['id_link']; + $result[$i]['url'] = $link['url']; + $result[$i]['newWindow'] = $link['new_window']; + /* Get multilingual text */ + if (!$texts = Db::getInstance()->ExecuteS('SELECT `id_lang`, `text` FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_link`='.(int)($link['id_link']))) + return false; + foreach ($texts AS $text) + $result[$i]['text_'.$text['id_lang']] = $text['text']; + $i++; + } + return $result; + } + + public function addLink() + { + /* Url registration */ + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = mysql_insert_id()) + return false; + /* Multilingual text */ + $languages = Language::getLanguages(); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + if (!$languages) + return false; + foreach ($languages AS $language) + if (!empty($_POST['text_'.$language['id_lang']])) + { + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) + return false; + } + else + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')')) + return false; + return true; + } + + public function updateLink() + { + /* Url registration */ + if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_link`='.(int)($_POST['id']))) + return false; + /* Multilingual text */ + $languages = Language::getLanguages(); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + if (!$languages) + return false; + if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_link` = '.(int)($_POST['id']))) + return false ; + foreach ($languages AS $language) + if (!empty($_POST['text_'.$language['id_lang']])) + { + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) + return false; + } + else + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.$language['id_lang'].', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')')) + return false; + return true; + } + + public function deleteLink() + { + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_link`='.(int)($_GET['id'])); + } + + public function updateTitle() + { + $languages = Language::getLanguages(); + $result = array(); + foreach ($languages AS $language) + $result[$language['id_lang']] = $_POST['title_'.$language['id_lang']]; + if (!Configuration::updateValue('PS_BLOCKLINK_TITLE', $result)) + return false; + return Configuration::updateValue('PS_BLOCKLINK_URL', $_POST['title_url']); + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        + '; + + /* Add a link */ + if (isset($_POST['submitLinkAdd'])) + { + if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) + $this->_html .= $this->displayError($this->l('You must fill in all fields')); + elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) + $this->_html .= $this->displayError($this->l('Bad URL')); + else + if ($this->addLink()) + $this->_html .= $this->displayConfirmation($this->l('The link has been added.')); + else + $this->_html .= $this->displayError($this->l('An error occurred during link creation.')); + } + /* Update a link */ + elseif (isset($_POST['submitLinkUpdate'])) + { + if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) + $this->_html .= $this->displayError($this->l('You must fill in all fields')); + elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) + $this->_html .= $this->displayError($this->l('Bad URL')); + else + if (empty($_POST['id']) OR !is_numeric($_POST['id']) OR !$this->updateLink()) + $this->_html .= $this->displayError($this->l('An error occurred during link updating.')); + else + $this->_html .= $this->displayConfirmation($this->l('The link has been updated.')); + } + /* Update the block title */ + elseif (isset($_POST['submitTitle'])) + { + if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) + $this->_html .= $this->displayError($this->l('"title" field cannot be empty.')); + elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url']))) + $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); + elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) + $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); + elseif (!$this->updateTitle()) + $this->_html .= $this->displayError($this->l('An error occurred during title updating.')); + else + $this->_html .= $this->displayConfirmation($this->l('The block title has been updated.')); + } + /* Delete a link*/ + elseif (isset($_GET['id'])) + { + if (!is_numeric($_GET['id']) OR !$this->deleteLink()) + $this->_html .= $this->displayError($this->l('An error occurred during link deletion.')); + else + $this->_html .= $this->displayConfirmation($this->l('The link has been deleted.')); + } + if (isset($_POST['submitOrderWay'])) + { + if (Configuration::updateValue('PS_BLOCKLINK_ORDERWAY', (int)(Tools::getValue('orderWay')))) + $this->_html .= $this->displayConfirmation($this->l('Sort order updated')); + else + $this->_html .= $this->displayError($this->l('An error occurred during sort order set-up.')); + } + + $this->_displayForm(); + $this->_list(); + + return $this->_html; + } + + private function _displayForm() + { + global $cookie; + /* Language */ + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $divLangName = 'text¤title'; + /* Title */ + $title_url = Configuration::get('PS_BLOCKLINK_URL'); + + $this->_html .= ' + +
        + '.$this->l('Add a new link').' +
        + +
        '; + foreach ($languages as $language) + $this->_html .= ' +
        + * +
        '; + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'text', true); + $this->_html .= ' +
        +
        + +
        + +
        error AND isset($_POST['newWindow'])) ? 'checked="checked"' : '').' />
        +
        + + + +
        +
        +
        +
        + '.$this->l('Block title').' +
        + +
        '; + foreach ($languages as $language) + $this->_html .= ' +
        + * +
        '; + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'title', true); + $this->_html .= ' +
        +
        + +
        +
        +
        +
        +
        + '.$this->l('Settings').' +
        + +
        + +
        +
        +
        +
        '; + } + + private function _list() + { + $links = $this->getLinks(); + + global $currentIndex, $cookie, $adminObj; + $languages = Language::getLanguages(); + if ($links) + { + $this->_html .= ' + '; + } + $this->_html .= ' +

        '.$this->l('Link list').'

        + + + + + + + '; + + if (!$links) + $this->_html .= ' + + + '; + else + foreach ($links AS $link) + $this->_html .= ' + + + + + + '; + $this->_html .= ' +
        '.$this->l('ID').''.$this->l('Text').''.$this->l('URL').''.$this->l('Actions').'
        '.$this->l('There are no links.').'
        '.$link['id'].''.$link['text_'.$cookie->id_lang].''.$link['url'].' + + +
        + + '; + } +} diff --git a/modules/blocklink/blocklink.tpl b/modules/blocklink/blocklink.tpl new file mode 100644 index 000000000..da67b3c8b --- /dev/null +++ b/modules/blocklink/blocklink.tpl @@ -0,0 +1,42 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + diff --git a/modules/blocklink/config.xml b/modules/blocklink/config.xml new file mode 100755 index 000000000..6e8751f0c --- /dev/null +++ b/modules/blocklink/config.xml @@ -0,0 +1,12 @@ + + + blocklink + Link block + 1.4 + Adds a block with additional links. + PrestaShop + front_office_features + Are you sure you want to delete all your links ? + 1 + 1 + \ No newline at end of file diff --git a/modules/blocklink/de.php b/modules/blocklink/de.php new file mode 100644 index 000000000..682d9f2f1 --- /dev/null +++ b/modules/blocklink/de.php @@ -0,0 +1,41 @@ +blocklink_fc738410141e4ec0c0319a81255a1431'] = 'Linkblock'; +$_MODULE['<{blocklink}prestashop>blocklink_baa2ae9622a47c3217d725d1537e5187'] = 'Fügt einen Block mit weiteren Links hinzu'; +$_MODULE['<{blocklink}prestashop>blocklink_d98d5daaf408b77b05a2eeb6ae88d6df'] = 'Sind Sie sicher, dass Sie alle Ihre Links löschen wollen?'; +$_MODULE['<{blocklink}prestashop>blocklink_fe3f38c46c80813d94b6775299e59f13'] = 'Sie müssen alle Felder ausfüllen'; +$_MODULE['<{blocklink}prestashop>blocklink_9394bb34611399534ffac4f0ece96b7f'] = 'Falsche URL'; +$_MODULE['<{blocklink}prestashop>blocklink_3da9d5745155a430aac6d7de3b6de0c8'] = 'Der Link ist erfolgreich hinzugefügt worden'; +$_MODULE['<{blocklink}prestashop>blocklink_898536ebd630aa3a9844e9cd9d1ebb9b'] = 'Ein Fehler ist bei der Link-Erstellung aufgetreten'; +$_MODULE['<{blocklink}prestashop>blocklink_ce9beec1b47458523d46274adfd2acee'] = 'Ein Fehler ist bei der Link-Aktualisierung aufgetreten'; +$_MODULE['<{blocklink}prestashop>blocklink_7a7e3a8d8aefcb1d31b4fdfa1bdf9ee4'] = 'Der Link ist erfolgreich aktualisiert worden'; +$_MODULE['<{blocklink}prestashop>blocklink_b18032737875f7947443c98824103a1f'] = 'Das Feld \"Titel\" darf nicht leer bleiben'; +$_MODULE['<{blocklink}prestashop>blocklink_43b38b9a2fe65059bed320bd284047e3'] = 'Das Feld \"Titel\" ist ungültig'; +$_MODULE['<{blocklink}prestashop>blocklink_eb74914f2759760be5c0a48f699f8541'] = 'Ein Fehler ist bei der Titel-Aktualisierung aufgetreten'; +$_MODULE['<{blocklink}prestashop>blocklink_5c0f7e2db8843204f422a369f2030b37'] = 'Der Blocktitel ist erfolgreich aktualisiert worden'; +$_MODULE['<{blocklink}prestashop>blocklink_5d73d4c0bcb035a1405e066eb0cdf832'] = 'Ein Fehler ist beim Löschen des Links aufgetreten'; +$_MODULE['<{blocklink}prestashop>blocklink_9bbcafcc85be214aaff76dffb8b72ce9'] = 'Der Link ist erfolgreich gelöscht worden'; +$_MODULE['<{blocklink}prestashop>blocklink_7e5748d8c44f33c9cde08ac2805e5621'] = 'Bestellungssortierung erfolgreich aktualisiert'; +$_MODULE['<{blocklink}prestashop>blocklink_46cff2568b00bc09d66844849d0b1309'] = 'Ein Fehler ist bei der Einstellung der Bestellungssortierung aufgetreten'; +$_MODULE['<{blocklink}prestashop>blocklink_58e9b25bb2e2699986a3abe2c92fc82e'] = 'Neuen Link hinzufügen'; +$_MODULE['<{blocklink}prestashop>blocklink_ed2fc2838f7edb7607dd1cd19f3a82e0'] = 'Text:'; +$_MODULE['<{blocklink}prestashop>blocklink_3b3d06023f6353f8fd05f859b298573e'] = 'URL:'; +$_MODULE['<{blocklink}prestashop>blocklink_1f3674ab0d54a38327e8e4a0d97788d4'] = 'In neuem Fenster öffnen:'; +$_MODULE['<{blocklink}prestashop>blocklink_7f3ee1818e42cfd668e361d89b8595fb'] = 'Diesen Link hinzufügen'; +$_MODULE['<{blocklink}prestashop>blocklink_27a5ff9957ea16466ef085b53381e26a'] = 'Diesen Link bearbeiten'; +$_MODULE['<{blocklink}prestashop>blocklink_b22c8f9ad7db023c548c3b8e846cb169'] = 'Blocktitel'; +$_MODULE['<{blocklink}prestashop>blocklink_2c906769e7f8b03cc1fedce4e24a20c2'] = 'Blocktitel:'; +$_MODULE['<{blocklink}prestashop>blocklink_67c94c1cba852f2d13eed115c938baf6'] = 'Block-URL:'; +$_MODULE['<{blocklink}prestashop>blocklink_06933067aafd48425d67bcb01bba5cb6'] = 'Aktualisierung'; +$_MODULE['<{blocklink}prestashop>blocklink_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocklink}prestashop>blocklink_53db43446b84dd2e9ddac626fc02ead3'] = 'Bestellliste:'; +$_MODULE['<{blocklink}prestashop>blocklink_d36e9f57ea37903f81d28f7a189b9649'] = 'nach neuesten Links'; +$_MODULE['<{blocklink}prestashop>blocklink_6ccdff04699ffe6956a6b1465907414a'] = 'nach ältesten Links'; +$_MODULE['<{blocklink}prestashop>blocklink_387a8014f530f080bf2f3be723f8c164'] = 'Link-Liste'; +$_MODULE['<{blocklink}prestashop>blocklink_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blocklink}prestashop>blocklink_9dffbf69ffba8bc38bc4e01abf4b1675'] = 'Text'; +$_MODULE['<{blocklink}prestashop>blocklink_e6b391a8d2c4d45902a23a8b6585703d'] = 'URL'; +$_MODULE['<{blocklink}prestashop>blocklink_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen'; +$_MODULE['<{blocklink}prestashop>blocklink_cad0a4e92b29bcb1ff1fc4f8524cfdc2'] = 'Es sind noch keine Links vorhanden'; diff --git a/modules/blocklink/en.php b/modules/blocklink/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocklink/en.php @@ -0,0 +1,4 @@ +blocklink_fc738410141e4ec0c0319a81255a1431'] = 'Bloque de enlaces'; +$_MODULE['<{blocklink}prestashop>blocklink_baa2ae9622a47c3217d725d1537e5187'] = 'Añadir un bloque con enlaces adicionales'; +$_MODULE['<{blocklink}prestashop>blocklink_d98d5daaf408b77b05a2eeb6ae88d6df'] = '¿Está seguro de querer borrar todos sus enlaces?'; +$_MODULE['<{blocklink}prestashop>blocklink_fe3f38c46c80813d94b6775299e59f13'] = 'Debe rellenar todos los campos'; +$_MODULE['<{blocklink}prestashop>blocklink_9394bb34611399534ffac4f0ece96b7f'] = 'URL incorrecta'; +$_MODULE['<{blocklink}prestashop>blocklink_3da9d5745155a430aac6d7de3b6de0c8'] = 'En enlace se ha añadido con éxito'; +$_MODULE['<{blocklink}prestashop>blocklink_898536ebd630aa3a9844e9cd9d1ebb9b'] = 'Se ha producido un error durante el proceso de creación del enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_ce9beec1b47458523d46274adfd2acee'] = 'Se ha producido un error durante el proceso de actualización del enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_7a7e3a8d8aefcb1d31b4fdfa1bdf9ee4'] = 'El enlace se ha actualizado con éxito'; +$_MODULE['<{blocklink}prestashop>blocklink_b18032737875f7947443c98824103a1f'] = 'El campo \"título\" no puede estar vacío'; +$_MODULE['<{blocklink}prestashop>blocklink_43b38b9a2fe65059bed320bd284047e3'] = 'El campo \"título\" es incorrecto'; +$_MODULE['<{blocklink}prestashop>blocklink_eb74914f2759760be5c0a48f699f8541'] = 'Se ha producido un error durante la actualización del título'; +$_MODULE['<{blocklink}prestashop>blocklink_5c0f7e2db8843204f422a369f2030b37'] = 'El título del bloque se ha actualizado con éxito'; +$_MODULE['<{blocklink}prestashop>blocklink_5d73d4c0bcb035a1405e066eb0cdf832'] = 'Se ha producido un error mientras se borraba el enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_9bbcafcc85be214aaff76dffb8b72ce9'] = 'El enlace se ha eliminado correctamente'; +$_MODULE['<{blocklink}prestashop>blocklink_7e5748d8c44f33c9cde08ac2805e5621'] = 'Actualización correcta de la reordenación'; +$_MODULE['<{blocklink}prestashop>blocklink_46cff2568b00bc09d66844849d0b1309'] = 'Se ha producido un error durante el proceso de configuración de la reordenación'; +$_MODULE['<{blocklink}prestashop>blocklink_58e9b25bb2e2699986a3abe2c92fc82e'] = 'Añadir un nuevo enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_ed2fc2838f7edb7607dd1cd19f3a82e0'] = 'Texto:'; +$_MODULE['<{blocklink}prestashop>blocklink_3b3d06023f6353f8fd05f859b298573e'] = 'URL:'; +$_MODULE['<{blocklink}prestashop>blocklink_1f3674ab0d54a38327e8e4a0d97788d4'] = 'Abrir en una nueva ventana:'; +$_MODULE['<{blocklink}prestashop>blocklink_7f3ee1818e42cfd668e361d89b8595fb'] = 'A~ãdir este enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_27a5ff9957ea16466ef085b53381e26a'] = 'Editar este enlace'; +$_MODULE['<{blocklink}prestashop>blocklink_b22c8f9ad7db023c548c3b8e846cb169'] = 'Título del bloque'; +$_MODULE['<{blocklink}prestashop>blocklink_2c906769e7f8b03cc1fedce4e24a20c2'] = 'Título del bloque:'; +$_MODULE['<{blocklink}prestashop>blocklink_67c94c1cba852f2d13eed115c938baf6'] = 'URL del bloque:'; +$_MODULE['<{blocklink}prestashop>blocklink_06933067aafd48425d67bcb01bba5cb6'] = 'Actualizar'; +$_MODULE['<{blocklink}prestashop>blocklink_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blocklink}prestashop>blocklink_53db43446b84dd2e9ddac626fc02ead3'] = 'Orden:'; +$_MODULE['<{blocklink}prestashop>blocklink_d36e9f57ea37903f81d28f7a189b9649'] = 'por enlaces más recientes'; +$_MODULE['<{blocklink}prestashop>blocklink_6ccdff04699ffe6956a6b1465907414a'] = 'por enlaces más antiguos'; +$_MODULE['<{blocklink}prestashop>blocklink_387a8014f530f080bf2f3be723f8c164'] = 'Lista de enlaces'; +$_MODULE['<{blocklink}prestashop>blocklink_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blocklink}prestashop>blocklink_9dffbf69ffba8bc38bc4e01abf4b1675'] = 'Texto'; +$_MODULE['<{blocklink}prestashop>blocklink_e6b391a8d2c4d45902a23a8b6585703d'] = 'URL'; +$_MODULE['<{blocklink}prestashop>blocklink_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones'; +$_MODULE['<{blocklink}prestashop>blocklink_cad0a4e92b29bcb1ff1fc4f8524cfdc2'] = 'Aún no hay enlaces'; diff --git a/modules/blocklink/fr.php b/modules/blocklink/fr.php new file mode 100644 index 000000000..4fbd37b7a --- /dev/null +++ b/modules/blocklink/fr.php @@ -0,0 +1,41 @@ +blocklink_fc738410141e4ec0c0319a81255a1431'] = 'Bloc liens'; +$_MODULE['<{blocklink}prestashop>blocklink_baa2ae9622a47c3217d725d1537e5187'] = 'Ajoute un bloc avec des liens additionels'; +$_MODULE['<{blocklink}prestashop>blocklink_d98d5daaf408b77b05a2eeb6ae88d6df'] = 'Etes-vous sûr de vouloir supprimer tous vos liens ?'; +$_MODULE['<{blocklink}prestashop>blocklink_fe3f38c46c80813d94b6775299e59f13'] = 'Vous devez remplir l\'ensemble des champs'; +$_MODULE['<{blocklink}prestashop>blocklink_9394bb34611399534ffac4f0ece96b7f'] = 'Mauvaise URL'; +$_MODULE['<{blocklink}prestashop>blocklink_3da9d5745155a430aac6d7de3b6de0c8'] = 'Le lien a été ajouté avec succès'; +$_MODULE['<{blocklink}prestashop>blocklink_898536ebd630aa3a9844e9cd9d1ebb9b'] = 'Une erreur est survenue lors de la création du lien'; +$_MODULE['<{blocklink}prestashop>blocklink_ce9beec1b47458523d46274adfd2acee'] = 'Une erreur est survenue lors de la mise à jour du lien'; +$_MODULE['<{blocklink}prestashop>blocklink_7a7e3a8d8aefcb1d31b4fdfa1bdf9ee4'] = 'Le lien a été mis à jour avec succès'; +$_MODULE['<{blocklink}prestashop>blocklink_b18032737875f7947443c98824103a1f'] = 'Le champ \"titre\" ne peut être laissé vide.'; +$_MODULE['<{blocklink}prestashop>blocklink_43b38b9a2fe65059bed320bd284047e3'] = 'Le titre est invalide'; +$_MODULE['<{blocklink}prestashop>blocklink_eb74914f2759760be5c0a48f699f8541'] = 'Une erreur est survenue lors de la mise à jour du titre'; +$_MODULE['<{blocklink}prestashop>blocklink_5c0f7e2db8843204f422a369f2030b37'] = 'Le titre du bloc a été mis à jour avec succès'; +$_MODULE['<{blocklink}prestashop>blocklink_5d73d4c0bcb035a1405e066eb0cdf832'] = 'Une erreur est survenue lors de la suppression du lien'; +$_MODULE['<{blocklink}prestashop>blocklink_9bbcafcc85be214aaff76dffb8b72ce9'] = 'Le lien a été supprimé avec succès'; +$_MODULE['<{blocklink}prestashop>blocklink_7e5748d8c44f33c9cde08ac2805e5621'] = 'Ordre de tri mis à jour avec succès'; +$_MODULE['<{blocklink}prestashop>blocklink_46cff2568b00bc09d66844849d0b1309'] = 'Une erreur est survenue lors du changement de l\'ordre de tri'; +$_MODULE['<{blocklink}prestashop>blocklink_58e9b25bb2e2699986a3abe2c92fc82e'] = 'Ajouter un nouveau lien'; +$_MODULE['<{blocklink}prestashop>blocklink_ed2fc2838f7edb7607dd1cd19f3a82e0'] = 'Texte :'; +$_MODULE['<{blocklink}prestashop>blocklink_3b3d06023f6353f8fd05f859b298573e'] = 'URL :'; +$_MODULE['<{blocklink}prestashop>blocklink_1f3674ab0d54a38327e8e4a0d97788d4'] = 'Ouvrir nouvelle fenêtre :'; +$_MODULE['<{blocklink}prestashop>blocklink_7f3ee1818e42cfd668e361d89b8595fb'] = 'Ajouter ce lien'; +$_MODULE['<{blocklink}prestashop>blocklink_27a5ff9957ea16466ef085b53381e26a'] = 'Editer ce lien'; +$_MODULE['<{blocklink}prestashop>blocklink_b22c8f9ad7db023c548c3b8e846cb169'] = 'Titre du bloc'; +$_MODULE['<{blocklink}prestashop>blocklink_2c906769e7f8b03cc1fedce4e24a20c2'] = 'Titre du bloc :'; +$_MODULE['<{blocklink}prestashop>blocklink_67c94c1cba852f2d13eed115c938baf6'] = 'URL du bloc :'; +$_MODULE['<{blocklink}prestashop>blocklink_06933067aafd48425d67bcb01bba5cb6'] = 'Mettre à jour'; +$_MODULE['<{blocklink}prestashop>blocklink_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{blocklink}prestashop>blocklink_53db43446b84dd2e9ddac626fc02ead3'] = 'Trier la liste :'; +$_MODULE['<{blocklink}prestashop>blocklink_d36e9f57ea37903f81d28f7a189b9649'] = 'par liens les plus récents'; +$_MODULE['<{blocklink}prestashop>blocklink_6ccdff04699ffe6956a6b1465907414a'] = 'les premiers liens entrés'; +$_MODULE['<{blocklink}prestashop>blocklink_387a8014f530f080bf2f3be723f8c164'] = 'Liste de liens'; +$_MODULE['<{blocklink}prestashop>blocklink_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blocklink}prestashop>blocklink_9dffbf69ffba8bc38bc4e01abf4b1675'] = 'Texte'; +$_MODULE['<{blocklink}prestashop>blocklink_e6b391a8d2c4d45902a23a8b6585703d'] = 'URL'; +$_MODULE['<{blocklink}prestashop>blocklink_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; +$_MODULE['<{blocklink}prestashop>blocklink_cad0a4e92b29bcb1ff1fc4f8524cfdc2'] = 'Il n\'y a pas encore de liens'; diff --git a/modules/blocklink/it.php b/modules/blocklink/it.php new file mode 100644 index 000000000..e74ad0b71 --- /dev/null +++ b/modules/blocklink/it.php @@ -0,0 +1,41 @@ +blocklink_fc738410141e4ec0c0319a81255a1431'] = 'Blocco link '; +$_MODULE['<{blocklink}prestashop>blocklink_baa2ae9622a47c3217d725d1537e5187'] = 'Aggiunge un blocco con ulteriori link'; +$_MODULE['<{blocklink}prestashop>blocklink_d98d5daaf408b77b05a2eeb6ae88d6df'] = 'Sei sicuro di voler eliminare tutti i link?'; +$_MODULE['<{blocklink}prestashop>blocklink_fe3f38c46c80813d94b6775299e59f13'] = 'Devi compilare tutti i campi'; +$_MODULE['<{blocklink}prestashop>blocklink_9394bb34611399534ffac4f0ece96b7f'] = 'Cattivo URL '; +$_MODULE['<{blocklink}prestashop>blocklink_3da9d5745155a430aac6d7de3b6de0c8'] = 'Il link è stato aggiunto con successo'; +$_MODULE['<{blocklink}prestashop>blocklink_898536ebd630aa3a9844e9cd9d1ebb9b'] = 'Si è verificato un errore durante la creazione del link'; +$_MODULE['<{blocklink}prestashop>blocklink_ce9beec1b47458523d46274adfd2acee'] = 'È verificato un errore durante l\'aggiornamento del link'; +$_MODULE['<{blocklink}prestashop>blocklink_7a7e3a8d8aefcb1d31b4fdfa1bdf9ee4'] = 'Il link è stato aggiornato con successo'; +$_MODULE['<{blocklink}prestashop>blocklink_b18032737875f7947443c98824103a1f'] = 'Il campo \"titolo\" non può essere vuoto'; +$_MODULE['<{blocklink}prestashop>blocklink_43b38b9a2fe65059bed320bd284047e3'] = 'Il campo \'titolo\' non è valido'; +$_MODULE['<{blocklink}prestashop>blocklink_eb74914f2759760be5c0a48f699f8541'] = 'Si è verificato un errore durante l\'aggiornamento del titolo'; +$_MODULE['<{blocklink}prestashop>blocklink_5c0f7e2db8843204f422a369f2030b37'] = 'Il titolo del blocco è stato aggiornato con successo'; +$_MODULE['<{blocklink}prestashop>blocklink_5d73d4c0bcb035a1405e066eb0cdf832'] = 'Si è verificato un errore durante la cancellazione link'; +$_MODULE['<{blocklink}prestashop>blocklink_9bbcafcc85be214aaff76dffb8b72ce9'] = 'Il link è stato cancellato con successo'; +$_MODULE['<{blocklink}prestashop>blocklink_7e5748d8c44f33c9cde08ac2805e5621'] = 'Ordine di selezione aggiornato con successo'; +$_MODULE['<{blocklink}prestashop>blocklink_46cff2568b00bc09d66844849d0b1309'] = 'Si è verificato un errore durante l\'impostazione dell\'ordine di selezione'; +$_MODULE['<{blocklink}prestashop>blocklink_58e9b25bb2e2699986a3abe2c92fc82e'] = 'Aggiungi un nuovo link'; +$_MODULE['<{blocklink}prestashop>blocklink_ed2fc2838f7edb7607dd1cd19f3a82e0'] = 'Testo:'; +$_MODULE['<{blocklink}prestashop>blocklink_3b3d06023f6353f8fd05f859b298573e'] = 'URL:'; +$_MODULE['<{blocklink}prestashop>blocklink_1f3674ab0d54a38327e8e4a0d97788d4'] = 'Apri in una nuova finestra:'; +$_MODULE['<{blocklink}prestashop>blocklink_7f3ee1818e42cfd668e361d89b8595fb'] = 'Aggiungi questo link'; +$_MODULE['<{blocklink}prestashop>blocklink_27a5ff9957ea16466ef085b53381e26a'] = 'Modifica questo link'; +$_MODULE['<{blocklink}prestashop>blocklink_b22c8f9ad7db023c548c3b8e846cb169'] = 'Titolo del blocco'; +$_MODULE['<{blocklink}prestashop>blocklink_2c906769e7f8b03cc1fedce4e24a20c2'] = 'Titolo del blocco:'; +$_MODULE['<{blocklink}prestashop>blocklink_67c94c1cba852f2d13eed115c938baf6'] = 'URL del blocco:'; +$_MODULE['<{blocklink}prestashop>blocklink_06933067aafd48425d67bcb01bba5cb6'] = 'Aggiornamento'; +$_MODULE['<{blocklink}prestashop>blocklink_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocklink}prestashop>blocklink_53db43446b84dd2e9ddac626fc02ead3'] = 'Ordinare l\'elenco:'; +$_MODULE['<{blocklink}prestashop>blocklink_d36e9f57ea37903f81d28f7a189b9649'] = 'per link più recenti'; +$_MODULE['<{blocklink}prestashop>blocklink_6ccdff04699ffe6956a6b1465907414a'] = 'per link più vecchi'; +$_MODULE['<{blocklink}prestashop>blocklink_387a8014f530f080bf2f3be723f8c164'] = 'Elenco link'; +$_MODULE['<{blocklink}prestashop>blocklink_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{blocklink}prestashop>blocklink_9dffbf69ffba8bc38bc4e01abf4b1675'] = 'Testo'; +$_MODULE['<{blocklink}prestashop>blocklink_e6b391a8d2c4d45902a23a8b6585703d'] = 'URL'; +$_MODULE['<{blocklink}prestashop>blocklink_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni'; +$_MODULE['<{blocklink}prestashop>blocklink_cad0a4e92b29bcb1ff1fc4f8524cfdc2'] = 'Non ci sono ancora link'; diff --git a/modules/blocklink/logo.gif b/modules/blocklink/logo.gif new file mode 100644 index 000000000..9ea90ffbe Binary files /dev/null and b/modules/blocklink/logo.gif differ diff --git a/modules/blocklink/prefs.gif b/modules/blocklink/prefs.gif new file mode 100644 index 000000000..1a1f43562 Binary files /dev/null and b/modules/blocklink/prefs.gif differ diff --git a/modules/blockmanufacturer/blockmanufacturer.php b/modules/blockmanufacturer/blockmanufacturer.php new file mode 100644 index 000000000..646e24b96 --- /dev/null +++ b/modules/blockmanufacturer/blockmanufacturer.php @@ -0,0 +1,132 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockManufacturer extends Module +{ + function __construct() + { + $this->name = 'blockmanufacturer'; + $this->tab = 'front_office_features'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Manufacturers block'); + $this->description = $this->l('Displays a block of manufacturers/brands'); + } + + function install() + { + Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', true); + Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', 5); + Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true); + return (parent::install() AND $this->registerHook('leftColumn') AND $this->registerHook('header')); + } + + function hookLeftColumn($params) + { + global $smarty, $link; + + $smarty->assign(array( + 'manufacturers' => Manufacturer::getManufacturers(), + 'link' => $link, + 'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'), + 'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'), + 'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'), + 'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS'), + )); + return $this->display(__FILE__, 'blockmanufacturer.tpl'); + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockManufacturers')) + { + $text_list = (int)(Tools::getValue('text_list')); + $text_nb = (int)(Tools::getValue('text_nb')); + $form_list = (int)(Tools::getValue('form_list')); + if ($text_list AND !Validate::isUnsignedInt($text_nb)) + $errors[] = $this->l('Invalid number of elements'); + elseif (!$text_list AND !$form_list) + $errors[] = $this->l('Please activate at least one system list'); + else + { + Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list); + Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb); + Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list); + } + if (isset($errors) AND sizeof($errors)) + $output .= $this->displayError(implode('
        ', $errors)); + else + $output .= $this->displayConfirmation($this->l('Settings updated')); + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + + + + +    '.$this->l('Display').' '.$this->l('elements').' +

        '.$this->l('To display manufacturers in a plain-text list').'

        +
        + +
        + + + + +

        '.$this->l('To display manufacturers in a drop-down list').'

        +
        +
        +
        +
        '; + return $output; + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockmanufacturer.css', 'all'); + } +} diff --git a/modules/blockmanufacturer/blockmanufacturer.tpl b/modules/blockmanufacturer/blockmanufacturer.tpl new file mode 100644 index 000000000..155faa82c --- /dev/null +++ b/modules/blockmanufacturer/blockmanufacturer.tpl @@ -0,0 +1,58 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {if $display_link_manufacturer}{/if}{l s='Manufacturers' mod='blockmanufacturer'}{if $display_link_manufacturer}{/if}

        +
        +{if $manufacturers} + {if $text_list} + + {/if} + {if $form_list} +
        +

        + +

        +
        + {/if} +{else} +

        {l s='No manufacturer' mod='blockmanufacturer'}

        +{/if} +
        +
        + diff --git a/modules/blockmanufacturer/config.xml b/modules/blockmanufacturer/config.xml new file mode 100755 index 000000000..d033a0983 --- /dev/null +++ b/modules/blockmanufacturer/config.xml @@ -0,0 +1,11 @@ + + + blockmanufacturer + Manufacturers block + 1 + Displays a block of manufacturers/brands + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockmanufacturer/de.php b/modules/blockmanufacturer/de.php new file mode 100644 index 000000000..9d1e16d42 --- /dev/null +++ b/modules/blockmanufacturer/de.php @@ -0,0 +1,23 @@ +blockmanufacturer_bc3e73cfa718a3237fb1d7e1da491395'] = 'Herstellerblock'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_9859921e6d3733788e09599adb681dcd'] = 'Zeigt einen Hersteller-/ Markenblock an'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Ungültige Elementezahl'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bb30aac3161f999a357af767ce2fd7ec'] = 'Bitte aktivieren Sie mindestens eine Systemliste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c888438d14855d7d96a2724ee9c306bd'] = 'Aktualisierte Einstellungen'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bfdff752293014f11f17122c92909ad5'] = 'Benutzen Sie eine Nur-Text-Liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Anzeige'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_6a7f245843454cf4f28ad7c5e2572aa2'] = 'Elemente'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2e5acd674f7f821a81e99ed01d5305d1'] = 'So zeigen Hersteller in einer Nur-Text-Liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b0fa976774d2acf72f9c62e9ab73de38'] = 'Verwenden Sie eine Dropdown-Liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f68d82d608d94a571e0984a0288595e0'] = 'So zeigen Sie Hersteller in einem Dropdown-Liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2377be3c2ad9b435ba277a73f0f1ca76'] = 'Hersteller'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_49fa2426b7903b3d4c89e2c1874d9346'] = 'Mehr darüber'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bf24faeb13210b5a703f3ccef792b000'] = 'Alle Hersteller'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_1c407c118b89fa6feaae6b0af5fc0970'] = 'Kein Hersteller'; diff --git a/modules/blockmanufacturer/en.php b/modules/blockmanufacturer/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockmanufacturer/en.php @@ -0,0 +1,4 @@ +blockmanufacturer_bc3e73cfa718a3237fb1d7e1da491395'] = 'Bloque de marcas'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_9859921e6d3733788e09599adb681dcd'] = 'Mostrar bloque de marcas'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Número de elementos incorrecto'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bb30aac3161f999a357af767ce2fd7ec'] = 'Por favor, active al menos uno de la lista'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bfdff752293014f11f17122c92909ad5'] = 'Use una lista de texto plano'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Mostrar'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_6a7f245843454cf4f28ad7c5e2572aa2'] = 'elementos'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2e5acd674f7f821a81e99ed01d5305d1'] = 'Para mostrar marcas en une lista de texto plano'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b0fa976774d2acf72f9c62e9ab73de38'] = 'use un cuadro combinado'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f68d82d608d94a571e0984a0288595e0'] = 'Para mostrar las marcas dentro de un cuadro combinado'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2377be3c2ad9b435ba277a73f0f1ca76'] = 'Marcas'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_49fa2426b7903b3d4c89e2c1874d9346'] = 'más sobre'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bf24faeb13210b5a703f3ccef792b000'] = 'Todas las marcas'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_1c407c118b89fa6feaae6b0af5fc0970'] = 'Sin marcas'; diff --git a/modules/blockmanufacturer/fr.php b/modules/blockmanufacturer/fr.php new file mode 100644 index 000000000..b95e243cd --- /dev/null +++ b/modules/blockmanufacturer/fr.php @@ -0,0 +1,23 @@ +blockmanufacturer_bc3e73cfa718a3237fb1d7e1da491395'] = 'Bloc fabricant'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_9859921e6d3733788e09599adb681dcd'] = 'Ajoute un bloc avec les fabricants'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Nombre d\'éléments invalide'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bb30aac3161f999a357af767ce2fd7ec'] = 'Merci d\'activer au moins un affichage de liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bfdff752293014f11f17122c92909ad5'] = 'Utiliser une liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Afficher'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_6a7f245843454cf4f28ad7c5e2572aa2'] = 'éléments'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2e5acd674f7f821a81e99ed01d5305d1'] = 'Affiche les fabricants sous forme de liste'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b0fa976774d2acf72f9c62e9ab73de38'] = 'Utiliser un menu déroulant'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f68d82d608d94a571e0984a0288595e0'] = 'Affiche les fabricants dans un menu déroulant'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2377be3c2ad9b435ba277a73f0f1ca76'] = 'Fabricants'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_49fa2426b7903b3d4c89e2c1874d9346'] = 'En savoir plus à propos de'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bf24faeb13210b5a703f3ccef792b000'] = 'Tous les fabricants'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_1c407c118b89fa6feaae6b0af5fc0970'] = 'Aucun fabricant'; diff --git a/modules/blockmanufacturer/it.php b/modules/blockmanufacturer/it.php new file mode 100644 index 000000000..30eaef43b --- /dev/null +++ b/modules/blockmanufacturer/it.php @@ -0,0 +1,23 @@ +blockmanufacturer_bc3e73cfa718a3237fb1d7e1da491395'] = 'Blocco produttori '; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_9859921e6d3733788e09599adb681dcd'] = 'Visualizza un blocco di produttori / marche'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Numero di elementi non valido'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bb30aac3161f999a357af767ce2fd7ec'] = 'Attiva almeno un elenco di sistema'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bfdff752293014f11f17122c92909ad5'] = 'Utilizzare un elenco'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Visualizza'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_6a7f245843454cf4f28ad7c5e2572aa2'] = 'elementi'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2e5acd674f7f821a81e99ed01d5305d1'] = 'Per visualizzare i produttori in un elenco '; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_b0fa976774d2acf72f9c62e9ab73de38'] = 'Utilizza un elenco a cascata'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_f68d82d608d94a571e0984a0288595e0'] = 'Per visualizzare i produttori in un elenco a cascata'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_2377be3c2ad9b435ba277a73f0f1ca76'] = 'Produttori'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_49fa2426b7903b3d4c89e2c1874d9346'] = 'Maggiori informazioni su'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_bf24faeb13210b5a703f3ccef792b000'] = 'Tutti i produttori'; +$_MODULE['<{blockmanufacturer}prestashop>blockmanufacturer_1c407c118b89fa6feaae6b0af5fc0970'] = 'Nessun produttore'; diff --git a/modules/blockmanufacturer/logo.gif b/modules/blockmanufacturer/logo.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/modules/blockmanufacturer/logo.gif differ diff --git a/modules/blockmyaccount/blockmyaccount.php b/modules/blockmyaccount/blockmyaccount.php new file mode 100644 index 000000000..492ea7835 --- /dev/null +++ b/modules/blockmyaccount/blockmyaccount.php @@ -0,0 +1,92 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockMyAccount extends Module +{ + public function __construct() + { + $this->name = 'blockmyaccount'; + $this->tab = 'front_office_features'; + $this->version = '1.2'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('My Account block'); + $this->description = $this->l('Displays a block with links relative to user account.'); + } + + public function install() + { + if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('leftColumn') OR !$this->registerHook('header')) + return false; + return true; + } + + public function uninstall() + { + return (parent::uninstall() AND $this->removeMyAccountBlockHook()); + } + + public function hookLeftColumn($params) + { + global $smarty; + + if (!$params['cookie']->isLogged()) + return false; + $smarty->assign(array( + 'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')), + 'returnAllowed' => (int)(Configuration::get('PS_ORDER_RETURN')), + 'HOOK_BLOCK_MY_ACCOUNT' => Module::hookExec('myAccountBlock') + )); + return $this->display(__FILE__, $this->name.'.tpl'); + } + + public function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + private function addMyAccountBlockHook() + { + return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'hook` (`name`, `title`, `description`, `position`) VALUES (\'myAccountBlock\', \'My account block\', \'Display extra informations inside the "my account" block\', 1)'); + } + + private function removeMyAccountBlockHook() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'myAccountBlock\''); + } + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockmyaccount.css', 'all'); + } +} + + diff --git a/modules/blockmyaccount/blockmyaccount.tpl b/modules/blockmyaccount/blockmyaccount.tpl new file mode 100644 index 000000000..51af54a80 --- /dev/null +++ b/modules/blockmyaccount/blockmyaccount.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + \ No newline at end of file diff --git a/modules/blockmyaccount/config.xml b/modules/blockmyaccount/config.xml new file mode 100755 index 000000000..6a4874528 --- /dev/null +++ b/modules/blockmyaccount/config.xml @@ -0,0 +1,11 @@ + + + blockmyaccount + My Account block + 1.2 + Displays a block with links relative to user account. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/blockmyaccount/de.php b/modules/blockmyaccount/de.php new file mode 100644 index 000000000..1d2b6d1a3 --- /dev/null +++ b/modules/blockmyaccount/de.php @@ -0,0 +1,14 @@ +blockmyaccount_ecf3e4f8f34a293099620cc25d5b4d93'] = 'Mein Kontoblock'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_0b9bc7f3bb601ef8959509352aea493b'] = 'Zeigt ein Block mit Links bezüglich des Benutzerkontos an'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mein Konto'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_74ecd9234b2a42ca13e775193f391833'] = 'Meine Bestellungen'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_89080f0eedbd5491a93157930f1e45fc'] = 'Meine Warenrücksendungen'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Meine Gutscheine'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_e45be0a0d4a0b62b15694c1a631e6e62'] = 'Meine Adressen'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_63b1ba91576576e6cf2da6fab7617e58'] = 'Meine persönlichen Daten'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'Meine Gutscheine'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_c87aacf5673fada1108c9f809d354311'] = 'Abmelden'; diff --git a/modules/blockmyaccount/en.php b/modules/blockmyaccount/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockmyaccount/en.php @@ -0,0 +1,4 @@ +blockmyaccount_ecf3e4f8f34a293099620cc25d5b4d93'] = 'Bloque Mi cuenta'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_0b9bc7f3bb601ef8959509352aea493b'] = 'Mostrar un bloque con enlaces a la cuenta del usuario'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_74ecd9234b2a42ca13e775193f391833'] = 'Mis pedidos'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_89080f0eedbd5491a93157930f1e45fc'] = 'Mi mercancía devuelta'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Mis vales descuento'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_e45be0a0d4a0b62b15694c1a631e6e62'] = 'Mis direcciones'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_63b1ba91576576e6cf2da6fab7617e58'] = 'Mis datos personales'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'Mis vales'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_c87aacf5673fada1108c9f809d354311'] = 'Cerrar sesión'; diff --git a/modules/blockmyaccount/fr.php b/modules/blockmyaccount/fr.php new file mode 100644 index 000000000..335b7ef05 --- /dev/null +++ b/modules/blockmyaccount/fr.php @@ -0,0 +1,14 @@ +blockmyaccount_ecf3e4f8f34a293099620cc25d5b4d93'] = 'Bloc Mon compte'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_0b9bc7f3bb601ef8959509352aea493b'] = 'Ajoute un bloc proposant des liens vers le compte du client'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_74ecd9234b2a42ca13e775193f391833'] = 'Mes commandes'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_89080f0eedbd5491a93157930f1e45fc'] = 'Mes retours produits'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Mes avoirs'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_e45be0a0d4a0b62b15694c1a631e6e62'] = 'Mes adresses'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_63b1ba91576576e6cf2da6fab7617e58'] = 'Mes données personnelles'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'Mes bons de réductions'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_c87aacf5673fada1108c9f809d354311'] = 'Déconnexion'; diff --git a/modules/blockmyaccount/it.php b/modules/blockmyaccount/it.php new file mode 100644 index 000000000..3a3475e39 --- /dev/null +++ b/modules/blockmyaccount/it.php @@ -0,0 +1,14 @@ +blockmyaccount_ecf3e4f8f34a293099620cc25d5b4d93'] = 'Blocco del mio account '; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_0b9bc7f3bb601ef8959509352aea493b'] = 'Visualizza un blocco con i link relativi all\'account utente'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Il mio account'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_74ecd9234b2a42ca13e775193f391833'] = 'I miei ordini'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_89080f0eedbd5491a93157930f1e45fc'] = 'I miei resi di merce '; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Le mie note di credito'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_e45be0a0d4a0b62b15694c1a631e6e62'] = 'I miei indirizzi'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_63b1ba91576576e6cf2da6fab7617e58'] = 'Le mie informazioni personali'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'I miei buoni'; +$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_c87aacf5673fada1108c9f809d354311'] = 'Esci'; diff --git a/modules/blockmyaccount/logo.gif b/modules/blockmyaccount/logo.gif new file mode 100644 index 000000000..bd22d009b Binary files /dev/null and b/modules/blockmyaccount/logo.gif differ diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php new file mode 100644 index 000000000..823c7dc36 --- /dev/null +++ b/modules/blocknewproducts/blocknewproducts.php @@ -0,0 +1,120 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockNewProducts extends Module +{ + public function __construct() + { + $this->name = 'blocknewproducts'; + $this->tab = 'front_office_features'; + $this->version = 0.9; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('New products block'); + $this->description = $this->l('Displays a block featuring newly added products.'); + } + + public function install() + { + if (parent::install() == false OR $this->registerHook('rightColumn') == false OR $this->registerHook('header') == false OR Configuration::updateValue('NEW_PRODUCTS_NBR', 5) == false) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockNewProducts')) + { + if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr)) + $output .= '
        '.$this->l('Please fill in the "products displayed" field.').'
        '; + elseif ((int)($productNbr) == 0) + $output .= '
        '.$this->l('Invalid number.').'
        '; + else + { + Configuration::updateValue('PS_BLOCK_NEWPRODUCTS_DISPLAY', (int)(Tools::getValue('always_display'))); + Configuration::updateValue('NEW_PRODUCTS_NBR', (int)($productNbr)); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + +

        '.$this->l('Set the number of products to be displayed in this block').'

        +
        + +
        + + + + +

        '.$this->l('Show the block even if no products are available.').'

        +
        +
        +
        +
        '; + return $output; + } + + public function hookRightColumn($params) + { + global $smarty; + + $newProducts = Product::getNewProducts((int)($params['cookie']->id_lang), 0, (int)(Configuration::get('NEW_PRODUCTS_NBR'))); + if (!$newProducts AND !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY')) + return; + $smarty->assign(array('new_products' => $newProducts, 'mediumSize' => Image::getSize('medium'))); + + return $this->display(__FILE__, 'blocknewproducts.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookHeader($params) + { + Tools::addCSS(($this->_path).'blocknewproducts.css', 'all'); + } + +} + + diff --git a/modules/blocknewproducts/blocknewproducts.tpl b/modules/blocknewproducts/blocknewproducts.tpl new file mode 100644 index 000000000..8731c855e --- /dev/null +++ b/modules/blocknewproducts/blocknewproducts.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='New products' mod='blocknewproducts'}

        +
        + {if $new_products !== false} +
          + {foreach from=$new_products item='product' name='newProducts'} + {if $smarty.foreach.newProducts.index < 2} + {$product.legend|escape:html:'UTF-8'} + {/if} + {/foreach} +
        +
        + {foreach from=$new_products item=newproduct name=myLoop} +
        {$newproduct.name|strip_tags|escape:html:'UTF-8'}
        + {if $newproduct.description_short}
        {$newproduct.description_short|strip_tags:'UTF-8'|truncate:50:'...'} >>
        {/if} + {/foreach} +
        +

        {l s='All new products' mod='blocknewproducts'}

        + {else} +

        {l s='No new products at this time' mod='blocknewproducts'}

        + {/if} +
        +
        + \ No newline at end of file diff --git a/modules/blocknewproducts/config.xml b/modules/blocknewproducts/config.xml new file mode 100755 index 000000000..828ce5e1f --- /dev/null +++ b/modules/blocknewproducts/config.xml @@ -0,0 +1,11 @@ + + + blocknewproducts + New products block + 0.9 + Displays a block featuring newly added products. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blocknewproducts/de.php b/modules/blocknewproducts/de.php new file mode 100644 index 000000000..644f9a9f9 --- /dev/null +++ b/modules/blocknewproducts/de.php @@ -0,0 +1,21 @@ +blocknewproducts_f7c34fc4a48bc683445c1e7bbc245508'] = 'Neue Produktblöcke'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc68052332d758d991b64087c6e4352e'] = 'Zeigt einen Block mit neu hinzugefügten Produkten an'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_57af4b7e82ba04c42eb3ac111310a505'] = 'Sie müssen das Feld \"Angezeigte Produkte\" ausfüllen'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_73293a024e644165e9bf48f270af63a0'] = 'Ungültige Anzahl.'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_e451e6943bb539d1bd804d2ede6474b5'] = 'angezeigte Produkte'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc4bbebd6a8d2fb633a1dd8ceda3fc8d'] = 'Anzahl der Produkte einstellen, die in diesem Block angezeigt werden sollen'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_530c88f8210e022b39128e3f0409bbcf'] = 'Block immer anzeigen'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_53d61d1ac0507b1bd8cd99db8d64fb19'] = 'Block anzeigen, auch wenn kein Produkt verfügbar ist.'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_9ff0635f5737513b1a6f559ac2bff745'] = 'Neue Produkte'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_60efcc704ef1456678f77eb9ee20847b'] = 'Alle neuen Produkte'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_2bc4c1efe10bba9f03fac3c59b4d2ae9'] = 'Keine neuen Produkte zu diesem Zeitpunkt'; diff --git a/modules/blocknewproducts/en.php b/modules/blocknewproducts/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocknewproducts/en.php @@ -0,0 +1,4 @@ +blocknewproducts_f7c34fc4a48bc683445c1e7bbc245508'] = 'Bloque de novedades'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc68052332d758d991b64087c6e4352e'] = 'Mostrar el bloque con los nuevos productos añadidos'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_57af4b7e82ba04c42eb3ac111310a505'] = 'Debe rellenar el campo \"productos mostrados\"'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_73293a024e644165e9bf48f270af63a0'] = 'Número incorrecto'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_e451e6943bb539d1bd804d2ede6474b5'] = 'Productos mostrados'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc4bbebd6a8d2fb633a1dd8ceda3fc8d'] = 'Seleccione el número de productos a mostrar en este bloque'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_530c88f8210e022b39128e3f0409bbcf'] = 'Mostrar siempre este bloque'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_53d61d1ac0507b1bd8cd99db8d64fb19'] = 'Mostrar este bloque aunque no haya productos disponibles'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_9ff0635f5737513b1a6f559ac2bff745'] = 'Novedades'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_60efcc704ef1456678f77eb9ee20847b'] = 'Todas las novedades'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_2bc4c1efe10bba9f03fac3c59b4d2ae9'] = 'no hay nuevos productos en este momento'; diff --git a/modules/blocknewproducts/fr.php b/modules/blocknewproducts/fr.php new file mode 100644 index 000000000..91978fc06 --- /dev/null +++ b/modules/blocknewproducts/fr.php @@ -0,0 +1,21 @@ +blocknewproducts_f7c34fc4a48bc683445c1e7bbc245508'] = 'Bloc nouveaux produits'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc68052332d758d991b64087c6e4352e'] = 'Ajoute un bloc proposant les derniers produits ajoutés'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_57af4b7e82ba04c42eb3ac111310a505'] = 'Vous devez remplir le champ \"produit affiché\"'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_73293a024e644165e9bf48f270af63a0'] = 'Nombre invalide.'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour effectuée'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_e451e6943bb539d1bd804d2ede6474b5'] = 'Nombre de produits affichés'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc4bbebd6a8d2fb633a1dd8ceda3fc8d'] = 'Détermine le nombre de produits à afficher dans ce bloc'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_530c88f8210e022b39128e3f0409bbcf'] = 'Toujours afficher ce bloc'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_53d61d1ac0507b1bd8cd99db8d64fb19'] = 'Afficher le bloc même si aucun produit n\'est disponible'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_9ff0635f5737513b1a6f559ac2bff745'] = 'Nouveaux produits'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_60efcc704ef1456678f77eb9ee20847b'] = 'Tous les nouveaux produits'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_2bc4c1efe10bba9f03fac3c59b4d2ae9'] = 'Aucun nouveau produit à l\'heure actuelle'; diff --git a/modules/blocknewproducts/it.php b/modules/blocknewproducts/it.php new file mode 100644 index 000000000..c0424a634 --- /dev/null +++ b/modules/blocknewproducts/it.php @@ -0,0 +1,21 @@ +blocknewproducts_f7c34fc4a48bc683445c1e7bbc245508'] = 'Blocco nuovi prodotti'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc68052332d758d991b64087c6e4352e'] = 'Visualizza un blocco con i prodotti appena aggiunti'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_57af4b7e82ba04c42eb3ac111310a505'] = 'Devi compilare il campo \"prodotti esposti\"'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_73293a024e644165e9bf48f270af63a0'] = 'Numero non valido.'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_e451e6943bb539d1bd804d2ede6474b5'] = 'Prodotti esposti'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_cc4bbebd6a8d2fb633a1dd8ceda3fc8d'] = 'Imposta il numero di prodotti da esporre in questo blocco'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_530c88f8210e022b39128e3f0409bbcf'] = 'Visualizza sempre blocco'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_53d61d1ac0507b1bd8cd99db8d64fb19'] = 'Mostra il blocco anche se nessun prodotto è disponibile.'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_9ff0635f5737513b1a6f559ac2bff745'] = 'Nuovi prodotti'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_60efcc704ef1456678f77eb9ee20847b'] = 'Tutti i nuovi prodotti'; +$_MODULE['<{blocknewproducts}prestashop>blocknewproducts_2bc4c1efe10bba9f03fac3c59b4d2ae9'] = 'Nessun nuovo prodotto in questo momento'; diff --git a/modules/blocknewproducts/logo.gif b/modules/blocknewproducts/logo.gif new file mode 100644 index 000000000..f310c6b40 Binary files /dev/null and b/modules/blocknewproducts/logo.gif differ diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php new file mode 100644 index 000000000..2134afe52 --- /dev/null +++ b/modules/blocknewsletter/blocknewsletter.php @@ -0,0 +1,256 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Blocknewsletter extends Module +{ + public function __construct() + { + $this->name = 'blocknewsletter'; + $this->tab = 'front_office_features'; + + parent::__construct(); + + $this->displayName = $this->l('Newsletter block'); + $this->description = $this->l('Adds a block for newsletter subscription.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete all your contacts ?'); + + $this->version = '1.4'; + $this->author = 'PrestaShop'; + $this->error = false; + $this->valid = false; + $this->_files = array( + 'name' => array('newsletter_conf', 'newsletter_voucher'), + 'ext' => array( + 0 => 'html', + 1 => 'txt' + ) + ); + } + + public function install() + { + if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('header') == false) + return false; + return Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'newsletter ( + `id` int(6) NOT NULL AUTO_INCREMENT, + `email` varchar(255) NOT NULL, + `newsletter_date_add` DATETIME NULL, + `ip_registration_newsletter` varchar(15) NOT NULL, + `http_referer` VARCHAR(255) NULL, + PRIMARY KEY(`id`) + ) ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8'); + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + return Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'newsletter'); + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        '; + + if (Tools::isSubmit('submitUpdate')) + { + if (isset($_POST['new_page']) AND Validate::isBool((int)($_POST['new_page']))) + Configuration::updateValue('NW_CONFIRMATION_NEW_PAGE', $_POST['new_page']); + if (isset($_POST['conf_email']) AND VAlidate::isBool((int)($_POST['conf_email']))) + Configuration::updateValue('NW_CONFIRMATION_EMAIL', pSQL($_POST['conf_email'])); + if (!empty($_POST['voucher']) AND !Validate::isDiscountName($_POST['voucher'])) + $this->_html .= '
        '.$this->l('Voucher code is invalid').'
        '; + else + { + Configuration::updateValue('NW_VOUCHER_CODE', pSQL($_POST['voucher'])); + $this->_html .= '
        '.$this->l('Updated').'
        '; + } + } + return $this->_displayForm(); + } + + private function _displayForm() + { + $this->_html .= ' +
        +
        + '.$this->l('Settings').' + +
        + '.$this->l('yes').' + '.$this->l('no').' +
        +
        + +
        + '.$this->l('yes').' + '.$this->l('no').' +
        +
        + +
        + +

        '.$this->l('Leave blank for disabling').'

        +
        +
        +
        +
        '; + + return $this->_html; + } + + private function isNewsletterRegistered($customerEmail) + { + if (Db::getInstance()->getRow('SELECT `email` FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($customerEmail).'\'')) + return 1; + if (!$registered = Db::getInstance()->getRow('SELECT `newsletter` FROM '._DB_PREFIX_.'customer WHERE `email` = \''.pSQL($customerEmail).'\'')) + return -1; + if ($registered['newsletter'] == '1') + return 2; + return 0; + } + + private function newsletterRegistration() + { + if (empty($_POST['email']) OR !Validate::isEmail(pSQL($_POST['email']))) + return $this->error = $this->l('Invalid e-mail address'); + /* Unsubscription */ + elseif ($_POST['action'] == '1') + { + $registerStatus = $this->isNewsletterRegistered(pSQL($_POST['email'])); + if ($registerStatus < 1) + return $this->error = $this->l('E-mail address not registered'); + /* If the user ins't a customer */ + elseif ($registerStatus == 1) + { + if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($_POST['email']).'\'')) + return $this->error = $this->l('Error during unsubscription'); + return $this->valid = $this->l('Unsubscription successful'); + } + /* If the user is a customer */ + elseif ($registerStatus == 2) + { + if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 0 WHERE `email` = \''.pSQL($_POST['email']).'\'')) + return $this->error = $this->l('Error during unsubscription'); + return $this->valid = $this->l('Unsubscription successful'); + } + } + /* Subscription */ + elseif ($_POST['action'] == '0') + { + $registerStatus = $this->isNewsletterRegistered(pSQL($_POST['email'])); + if ($registerStatus > 0) + return $this->error = $this->l('E-mail address already registered'); + /* If the user ins't a customer */ + elseif ($registerStatus == -1) + { + global $cookie; + + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'newsletter (email, newsletter_date_add, ip_registration_newsletter, http_referer) VALUES (\''.pSQL($_POST['email']).'\', NOW(), \''.pSQL(Tools::getRemoteAddr()).'\', + (SELECT c.http_referer FROM '._DB_PREFIX_.'connections c WHERE c.id_guest = '.(int)($cookie->id_guest).' ORDER BY c.date_add DESC LIMIT 1))')) + return $this->error = $this->l('Error during subscription'); + $this->sendVoucher(pSQL($_POST['email'])); + + return $this->valid = $this->l('Subscription successful'); + } + /* If the user is a customer */ + elseif ($registerStatus == 0) + { + if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 1, newsletter_date_add = NOW(), `ip_registration_newsletter` = \''.pSQL(Tools::getRemoteAddr()).'\' WHERE `email` = \''.pSQL($_POST['email']).'\'')) + return $this->error = $this->l('Error during subscription'); + $this->sendVoucher(pSQL($_POST['email'])); + + return $this->valid = $this->l('Subscription successful'); + } + } + } + + private function sendVoucher($email) + { + global $cookie; + + if ($discount = Configuration::get('NW_VOUCHER_CODE')) + return Mail::Send((int)($cookie->id_lang), 'newsletter_voucher', Mail::l('Newsletter voucher'), array('{discount}' => $discount), $email, NULL, NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + return false; + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function hookLeftColumn($params) + { + global $smarty; + + if (Tools::isSubmit('submitNewsletter')) + { + $this->newsletterRegistration(); + if ($this->error) + { + $smarty->assign(array('color' => 'red', + 'msg' => $this->error, + 'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false, + 'nw_error' => true, + 'action' => $_POST['action'])); + } + elseif ($this->valid) + { + if (Configuration::get('NW_CONFIRMATION_EMAIL') AND isset($_POST['action']) AND (int)($_POST['action']) == 0) + Mail::Send((int)($params['cookie']->id_lang), 'newsletter_conf', Mail::l('Newsletter confirmation'), array(), pSQL($_POST['email']), NULL, NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + $smarty->assign(array('color' => 'green', + 'msg' => $this->valid, + 'nw_error' => false)); + } + } + $smarty->assign('this_path', $this->_path); + return $this->display(__FILE__, 'blocknewsletter.tpl'); + } + + public function confirmation() + { + global $smarty; + + return $this->display(__FILE__, 'newsletter.tpl'); + } + + public function externalNewsletter(/*$params*/) + { + return $this->hookLeftColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blocknewsletter.css', 'all'); + } +} + + diff --git a/modules/blocknewsletter/blocknewsletter.tpl b/modules/blocknewsletter/blocknewsletter.tpl new file mode 100644 index 000000000..d86d1358b --- /dev/null +++ b/modules/blocknewsletter/blocknewsletter.tpl @@ -0,0 +1,48 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +
        +

        {l s='Newsletter' mod='blocknewsletter'}

        +
        + {if isset($msg) && $msg} +

        {$msg}

        + {/if} +
        +

        +

        + + +

        +
        +
        +
        + + diff --git a/modules/blocknewsletter/config.xml b/modules/blocknewsletter/config.xml new file mode 100755 index 000000000..916c31795 --- /dev/null +++ b/modules/blocknewsletter/config.xml @@ -0,0 +1,12 @@ + + + blocknewsletter + Newsletter block + 1.4 + Adds a block for newsletter subscription. + PrestaShop + front_office_features + Are you sure you want to delete all your contacts ? + 1 + 1 + \ No newline at end of file diff --git a/modules/blocknewsletter/de.php b/modules/blocknewsletter/de.php new file mode 100644 index 000000000..f27b69380 --- /dev/null +++ b/modules/blocknewsletter/de.php @@ -0,0 +1,28 @@ +blocknewsletter_9e31b08a00c1ed653bcaa517dee84714'] = 'Newsletter Block'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ba457fab18d697d978befb95e827eb91'] = 'Fügt einen Block für Newsletter-Abos hinzu'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_179bbcbd2e1104cdf9dcecd91264a961'] = 'Sie sind sicher, dass Sie alle Ihre Kontakte löschen wollen?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f0e9c1e3969d351170373b5cec2131c2'] = 'Gutschein-Code ist ungültig'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ff0a3b7f3daef040faf89a88fdac01b7'] = 'Aktualisierung erfolgreich'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a3399c10bd24eba0b78fbd595c51f81a'] = 'Konfiguration auf einer neuen Seite anzeigen?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a6105c0a611b41b08f1209506350279e'] = 'ja'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_7fa3b767c460b54a2be4d49030b349c7'] = 'nein'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b68ae6efae2fca059754c27ff94494cd'] = 'Bestätigungsmail nach Abonnement senden?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_506e58042922bff5bd753dc612e84f5b'] = 'Willkommensgutschein-Code'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_de3bd7faad12c79178b1b22bf6119e35'] = 'Zur Deaktivierung leer lassen '; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_06933067aafd48425d67bcb01bba5cb6'] = 'Aktualisierung'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_6e659c47c94d1e1dc7121859f43fb2b0'] = 'Ungültige E-Mail-Adresse'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_9e6df6e72be5be5b8ff962ee3406907e'] = 'E-Mail-Adresse nicht registriert'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_29003419c075963848f1907174bdc224'] = 'Fehler bei der Abo-Abmeldung'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f7dc297e2a139ab4f5a771825b46df43'] = 'Abo-Abmeldung erfolgreich'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_8dc3b88902df97bb96930282e56ed381'] = 'E-Mail-Adresse bereits registriert'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b7d9eb38dd2e375648ab08e224e22e43'] = 'Fehler bei der Abonnierung'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ed3cd7b3cc134222fa70602921ec27e1'] = 'Abonnement erfolgreich'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_416f61a2ce16586f8289d41117a2554e'] = 'Ihre E-Mail'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b26917587d98330d93f87808fc9d7267'] = 'Abonnieren'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_4182c8f19d40c7ca236a5f4f83faeb6b'] = 'Abmelden'; diff --git a/modules/blocknewsletter/en.php b/modules/blocknewsletter/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocknewsletter/en.php @@ -0,0 +1,4 @@ +blocknewsletter_9e31b08a00c1ed653bcaa517dee84714'] = 'Bloque newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ba457fab18d697d978befb95e827eb91'] = 'Añadir un bloque para suscribirse a la newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_179bbcbd2e1104cdf9dcecd91264a961'] = '¿Está seguro de querer eliminar todos sus contactos?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f0e9c1e3969d351170373b5cec2131c2'] = 'Êl código de descuento no es válido'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ff0a3b7f3daef040faf89a88fdac01b7'] = 'Actualización correcta'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a3399c10bd24eba0b78fbd595c51f81a'] = '¿Mostrar la configuración en una nueva página?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a6105c0a611b41b08f1209506350279e'] = 'sí'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_7fa3b767c460b54a2be4d49030b349c7'] = 'no'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b68ae6efae2fca059754c27ff94494cd'] = '¿Enviar confirmación por email después de la suscripción?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_506e58042922bff5bd753dc612e84f5b'] = 'El código de descuento es válido'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_de3bd7faad12c79178b1b22bf6119e35'] = 'Dejar en blanco para inhabilitar'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_06933067aafd48425d67bcb01bba5cb6'] = 'Actualizar'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_6e659c47c94d1e1dc7121859f43fb2b0'] = 'email incorrecto'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_9e6df6e72be5be5b8ff962ee3406907e'] = 'Email no registrado'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_29003419c075963848f1907174bdc224'] = 'Error al borrarse '; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f7dc297e2a139ab4f5a771825b46df43'] = 'Se ha borrado con éxito'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_8dc3b88902df97bb96930282e56ed381'] = 'Email ya registrado'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b7d9eb38dd2e375648ab08e224e22e43'] = 'Error durante la suscripción'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ed3cd7b3cc134222fa70602921ec27e1'] = 'Suscripción correcta'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_416f61a2ce16586f8289d41117a2554e'] = 'su email'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b26917587d98330d93f87808fc9d7267'] = 'suscribirse'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_4182c8f19d40c7ca236a5f4f83faeb6b'] = 'Borrarse'; diff --git a/modules/blocknewsletter/fr.php b/modules/blocknewsletter/fr.php new file mode 100644 index 000000000..531236aae --- /dev/null +++ b/modules/blocknewsletter/fr.php @@ -0,0 +1,28 @@ +blocknewsletter_9e31b08a00c1ed653bcaa517dee84714'] = 'Bloc newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ba457fab18d697d978befb95e827eb91'] = 'Ajoute un bloc newsletter pour vos clients'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_179bbcbd2e1104cdf9dcecd91264a961'] = 'Etes-vous sûr de vouloir supprimer tous vos contacts ?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f0e9c1e3969d351170373b5cec2131c2'] = 'Code de réduction invalide'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ff0a3b7f3daef040faf89a88fdac01b7'] = 'Mise à jour terminée.'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a3399c10bd24eba0b78fbd595c51f81a'] = 'Afficher la configuration dans une nouvelle page ?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a6105c0a611b41b08f1209506350279e'] = 'Oui'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_7fa3b767c460b54a2be4d49030b349c7'] = 'Non'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b68ae6efae2fca059754c27ff94494cd'] = 'Envoyer un mail de confirmation après inscription ?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_506e58042922bff5bd753dc612e84f5b'] = 'Code de réduction offert'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_de3bd7faad12c79178b1b22bf6119e35'] = 'Laissez vide pour désactiver'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_06933067aafd48425d67bcb01bba5cb6'] = 'Mise à jour'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_6e659c47c94d1e1dc7121859f43fb2b0'] = 'Adresse e-mail invalide'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_9e6df6e72be5be5b8ff962ee3406907e'] = 'Adresse e-mail introuvable'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_29003419c075963848f1907174bdc224'] = 'Erreur lors de la désinscription'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f7dc297e2a139ab4f5a771825b46df43'] = 'Votre désinscription est effective'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_8dc3b88902df97bb96930282e56ed381'] = 'Adresse e-mail déjà inscrite'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b7d9eb38dd2e375648ab08e224e22e43'] = 'Une erreur est survenue lors de votre inscription'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ed3cd7b3cc134222fa70602921ec27e1'] = 'Votre inscription est effective'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_416f61a2ce16586f8289d41117a2554e'] = 'votre e-mail'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b26917587d98330d93f87808fc9d7267'] = 'Inscription'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_4182c8f19d40c7ca236a5f4f83faeb6b'] = 'Désinscription'; diff --git a/modules/blocknewsletter/it.php b/modules/blocknewsletter/it.php new file mode 100644 index 000000000..8b3a857c9 --- /dev/null +++ b/modules/blocknewsletter/it.php @@ -0,0 +1,28 @@ +blocknewsletter_9e31b08a00c1ed653bcaa517dee84714'] = 'Blocco newsletter '; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ba457fab18d697d978befb95e827eb91'] = 'Aggiunge un blocco per l\'iscrizione alla newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_179bbcbd2e1104cdf9dcecd91264a961'] = 'Sei sicuro di voler eliminare tutti i tuoi contatti?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f0e9c1e3969d351170373b5cec2131c2'] = 'Codice del buono non valido'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ff0a3b7f3daef040faf89a88fdac01b7'] = 'Aggiornato con successo'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a3399c10bd24eba0b78fbd595c51f81a'] = 'Visualizzazione di configurazione in una nuova pagina?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_a6105c0a611b41b08f1209506350279e'] = 'sì'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_7fa3b767c460b54a2be4d49030b349c7'] = 'no'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b68ae6efae2fca059754c27ff94494cd'] = 'Invio di e-mail di conferma dopo l\'iscrizione?'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_506e58042922bff5bd753dc612e84f5b'] = 'Codice buono di benvenuto '; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_de3bd7faad12c79178b1b22bf6119e35'] = 'Lascia vuoto per disattivare'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_06933067aafd48425d67bcb01bba5cb6'] = 'Aggiorna'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_6e659c47c94d1e1dc7121859f43fb2b0'] = 'Indirizzo e-mail non valido'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_9e6df6e72be5be5b8ff962ee3406907e'] = 'Indirizzo e-mail non registrato'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_29003419c075963848f1907174bdc224'] = 'Errore durante la cancellazione dell\'iscrizione'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_f7dc297e2a139ab4f5a771825b46df43'] = 'Cancellazione dell\'iscrizione riuscita'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_8dc3b88902df97bb96930282e56ed381'] = 'Indirizzo e-mail già registrato'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b7d9eb38dd2e375648ab08e224e22e43'] = 'Errore durante l\'iscrizione'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ed3cd7b3cc134222fa70602921ec27e1'] = 'Iscrizione riuscita'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_416f61a2ce16586f8289d41117a2554e'] = 'la tua e-mail'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_b26917587d98330d93f87808fc9d7267'] = 'Iscriviti'; +$_MODULE['<{blocknewsletter}prestashop>blocknewsletter_4182c8f19d40c7ca236a5f4f83faeb6b'] = 'Cancellati'; diff --git a/modules/blocknewsletter/logo.gif b/modules/blocknewsletter/logo.gif new file mode 100644 index 000000000..06dd879da Binary files /dev/null and b/modules/blocknewsletter/logo.gif differ diff --git a/modules/blocknewsletter/mails/de/newsletter_conf.html b/modules/blocknewsletter/mails/de/newsletter_conf.html new file mode 100644 index 000000000..5ae99b7a8 --- /dev/null +++ b/modules/blocknewsletter/mails/de/newsletter_conf.html @@ -0,0 +1,14 @@ + + + + + Nachricht von {shop_name} + + +
        {shop_name}

        Hallo +

        DANKE FÜR IHRE ANMELDUNG ZU UNSEREM NEWSLETTER

        + +
        {shop_name} powered by PrestaShop
        +
        + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/de/newsletter_conf.txt b/modules/blocknewsletter/mails/de/newsletter_conf.txt new file mode 100644 index 000000000..39d48aeb3 --- /dev/null +++ b/modules/blocknewsletter/mails/de/newsletter_conf.txt @@ -0,0 +1,7 @@ +Hallo + +Danke für Ihre Anmeldung zu unserem Newsletter. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/de/newsletter_voucher.html b/modules/blocknewsletter/mails/de/newsletter_voucher.html new file mode 100644 index 000000000..c634c7ef3 --- /dev/null +++ b/modules/blocknewsletter/mails/de/newsletter_voucher.html @@ -0,0 +1,40 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo,
         
        Newsletter-Anmeldung
         
        Sie haben unseren Newsletter abonniert, wir freuen uns, Ihnen den folgenden Gutschein zu schenken: {discount}
         
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/de/newsletter_voucher.txt b/modules/blocknewsletter/mails/de/newsletter_voucher.txt new file mode 100644 index 000000000..0c7f4392a --- /dev/null +++ b/modules/blocknewsletter/mails/de/newsletter_voucher.txt @@ -0,0 +1,9 @@ +Hallo + +Sie haben unseren Newsletter abonniert, wir freuen uns, Ihnen den folgenden Gutschein zu schenken: {discount} + +{shop_name} - {shop_url} + + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/en/newsletter_conf.html b/modules/blocknewsletter/mails/en/newsletter_conf.html new file mode 100644 index 000000000..2f2b82740 --- /dev/null +++ b/modules/blocknewsletter/mails/en/newsletter_conf.html @@ -0,0 +1,21 @@ + + + + + Message from {shop_name} + + + +
        + {shop_name}

        + + Hi + +

        Thank you for subscribing to our newsletter

        + + + +
        {shop_name} powered by PrestaShop
        +
        + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/en/newsletter_conf.txt b/modules/blocknewsletter/mails/en/newsletter_conf.txt new file mode 100644 index 000000000..a39bb9c56 --- /dev/null +++ b/modules/blocknewsletter/mails/en/newsletter_conf.txt @@ -0,0 +1,7 @@ +Hi + +Thank you for subscribing to our newsletter. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/en/newsletter_voucher.html b/modules/blocknewsletter/mails/en/newsletter_voucher.html new file mode 100644 index 000000000..6a600d50f --- /dev/null +++ b/modules/blocknewsletter/mails/en/newsletter_voucher.html @@ -0,0 +1,36 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi,
         
        Newsletter subscription
         
        + Regarding your newsletter subscription, we have the pleasure to offer you the following voucher: {discount} +
         
        + {shop_name} powered by PrestaShop™ +
        + + diff --git a/modules/blocknewsletter/mails/en/newsletter_voucher.txt b/modules/blocknewsletter/mails/en/newsletter_voucher.txt new file mode 100644 index 000000000..a9dc09a60 --- /dev/null +++ b/modules/blocknewsletter/mails/en/newsletter_voucher.txt @@ -0,0 +1,9 @@ +Hi + +Regarding your newsletter subscription, we have the pleasure to offer you the following voucher: {discount} + +{shop_name} - {shop_url} + + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/es/newsletter_conf.html b/modules/blocknewsletter/mails/es/newsletter_conf.html new file mode 100755 index 000000000..20784b8da --- /dev/null +++ b/modules/blocknewsletter/mails/es/newsletter_conf.html @@ -0,0 +1,15 @@ + + + + + Mensaje de {shop_name} + + +
        {shop_name}

        Hola, +

        Gracias por tu suscripción a nuestro boletín.

        + +
        {shop_name} dirigida por PrestaShop
        +
        + + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/es/newsletter_conf.txt b/modules/blocknewsletter/mails/es/newsletter_conf.txt new file mode 100755 index 000000000..3ab1026f5 --- /dev/null +++ b/modules/blocknewsletter/mails/es/newsletter_conf.txt @@ -0,0 +1,7 @@ +Hola, + +Gracias por tu suscripción a nuestro boletín. + + + +{shop_url} dirigida por PrestaShop™ diff --git a/modules/blocknewsletter/mails/es/newsletter_voucher.html b/modules/blocknewsletter/mails/es/newsletter_voucher.html new file mode 100755 index 000000000..10c778359 --- /dev/null +++ b/modules/blocknewsletter/mails/es/newsletter_voucher.html @@ -0,0 +1,41 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola,
         
        Inscription à la newsletter
         
        Después de su suscripción a nuestro boletín, nos complace ofrecerle el siguiente cupón: {discount}
         
        {shop_name} dirigida por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/es/newsletter_voucher.txt b/modules/blocknewsletter/mails/es/newsletter_voucher.txt new file mode 100755 index 000000000..76780ea5b --- /dev/null +++ b/modules/blocknewsletter/mails/es/newsletter_voucher.txt @@ -0,0 +1,9 @@ +Hola + +Después de su suscripción a nuestro boletín, nos complace ofrecerle el siguiente cupón: {discount} + +{shop_name} - {shop_url} + + + +{shop_url} dirigida por PrestaShop™ diff --git a/modules/blocknewsletter/mails/fr/newsletter_conf.html b/modules/blocknewsletter/mails/fr/newsletter_conf.html new file mode 100644 index 000000000..383146c5b --- /dev/null +++ b/modules/blocknewsletter/mails/fr/newsletter_conf.html @@ -0,0 +1,21 @@ + + + + + Message de {shop_name} + + + +
        + {shop_name}

        + + Bonjour, + +

        Merci de votre inscription à notre newsletter

        + + + +
        {shop_name} réalisé par PrestaShop
        +
        + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/fr/newsletter_conf.txt b/modules/blocknewsletter/mails/fr/newsletter_conf.txt new file mode 100644 index 000000000..521a9b2b6 --- /dev/null +++ b/modules/blocknewsletter/mails/fr/newsletter_conf.txt @@ -0,0 +1,7 @@ +Bonjour, + +Merci de votre inscription à notre newsletter + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/fr/newsletter_voucher.html b/modules/blocknewsletter/mails/fr/newsletter_voucher.html new file mode 100644 index 000000000..f84c75105 --- /dev/null +++ b/modules/blocknewsletter/mails/fr/newsletter_voucher.html @@ -0,0 +1,36 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour,
         
        Inscription à la newsletter
         
        + Suite à votre inscription à notre newsletter, nous avons le plaisir de vous offrir le bon de réduction suivant : {discount} +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + diff --git a/modules/blocknewsletter/mails/fr/newsletter_voucher.txt b/modules/blocknewsletter/mails/fr/newsletter_voucher.txt new file mode 100644 index 000000000..0986d9707 --- /dev/null +++ b/modules/blocknewsletter/mails/fr/newsletter_voucher.txt @@ -0,0 +1,9 @@ +Bonjour + +Suite à votre inscription à notre newsletter, nous avons le plaisir de vous offrir le bon de réduction suivant : {discount} + +{shop_name} - {shop_url} + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/blocknewsletter/mails/it/newsletter_conf.html b/modules/blocknewsletter/mails/it/newsletter_conf.html new file mode 100755 index 000000000..d3b732a1d --- /dev/null +++ b/modules/blocknewsletter/mails/it/newsletter_conf.html @@ -0,0 +1,10 @@ + + + + + Messaggio da {shop_name} + + + + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/it/newsletter_conf.txt b/modules/blocknewsletter/mails/it/newsletter_conf.txt new file mode 100755 index 000000000..e69de29bb diff --git a/modules/blocknewsletter/mails/it/newsletter_voucher.html b/modules/blocknewsletter/mails/it/newsletter_voucher.html new file mode 100755 index 000000000..fd0b1e448 --- /dev/null +++ b/modules/blocknewsletter/mails/it/newsletter_voucher.html @@ -0,0 +1,10 @@ + + + + + Messaggio da {shop_name} + + + + + \ No newline at end of file diff --git a/modules/blocknewsletter/mails/it/newsletter_voucher.txt b/modules/blocknewsletter/mails/it/newsletter_voucher.txt new file mode 100755 index 000000000..e69de29bb diff --git a/modules/blockpaymentlogo/blockpaymentlogo.php b/modules/blockpaymentlogo/blockpaymentlogo.php new file mode 100644 index 000000000..945c1c18c --- /dev/null +++ b/modules/blockpaymentlogo/blockpaymentlogo.php @@ -0,0 +1,144 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockPaymentLogo extends Module +{ + public function __construct() + { + $this->name = 'blockpaymentlogo'; + $this->tab = 'front_office_features'; + $this->version = 0.2; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Block payment logo'); + $this->description = $this->l('Adds a block to display all payment logos.'); + } + + public function install() + { + Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', 0); + if (!parent::install()) + return false; + if (!$this->registerHook('leftColumn')) + return false; + if (!$this->registerHook('header')) + return false; + return true; + } + + public function uninstall() + { + Configuration::deleteByName('PS_PAYMENT_LOGO_CMS_ID'); + return parent::uninstall(); + } + + public function getContent() + { + global $cookie; + + $html = ' +

        '.$this->l('Payment logo').'

        + '; + + if (Tools::isSubmit('submitConfiguration')) + if (Validate::isUnsignedInt(Tools::getValue('id_cms'))) + { + Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', (int)(Tools::getValue('id_cms'))); + $html .= $this->displayConfirmation($this->l('Settings are updated')); + } + + $cmss = CMS::listCms((int)($cookie->id_lang)); + + if (!sizeof($cmss)) + $html .= $this->displayError($this->l('No CMS page is available')); + else + { + $html .= ' +
        +
        + '.$this->l('Configure').' + +
        + +
        +

        +
        +
        + '; + } + return $html; + } + + /** + * Returns module content + * + * @param array $params Parameters + * @return string Content + */ + public function hookLeftColumn($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + + global $smarty, $cookie; + + if (!Configuration::get('PS_PAYMENT_LOGO_CMS_ID')) + return; + $cms = new CMS((int)(Configuration::get('PS_PAYMENT_LOGO_CMS_ID')), (int)($cookie->id_lang)); + if (!Validate::isLoadedObject($cms)) + return; + $smarty->assign('cms_payement_logo', $cms); + return $this->display(__FILE__, 'blockpaymentlogo.tpl'); + } + + public function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + public function hookFooter($params) + { + return $this->hookLeftColumn($params); + } + public function hookHeader($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + Tools::addCSS(($this->_path).'blockpaymentlogo.css', 'all'); + } + +} + + diff --git a/modules/blockpaymentlogo/blockpaymentlogo.tpl b/modules/blockpaymentlogo/blockpaymentlogo.tpl new file mode 100644 index 000000000..427c79353 --- /dev/null +++ b/modules/blockpaymentlogo/blockpaymentlogo.tpl @@ -0,0 +1,35 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + \ No newline at end of file diff --git a/modules/blockpaymentlogo/config.xml b/modules/blockpaymentlogo/config.xml new file mode 100755 index 000000000..83b0b9d89 --- /dev/null +++ b/modules/blockpaymentlogo/config.xml @@ -0,0 +1,11 @@ + + + blockpaymentlogo + Block payment logo + 0.2 + Adds a block to display all payment logos. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockpaymentlogo/de.php b/modules/blockpaymentlogo/de.php new file mode 100644 index 000000000..e3244c488 --- /dev/null +++ b/modules/blockpaymentlogo/de.php @@ -0,0 +1,13 @@ +blockpaymentlogo_1bd130f5640104712b3c7dec66b7b0a1'] = 'Block Zahlungslogo '; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8e27bf58ec687eea4b244d563dcbd8ac'] = 'Fügt einen Block mit allen Zahlungslogos hinzu'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8fc87743f34723d06ebff41629d2fdb5'] = 'Zahlungslogo'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_7ccf58c950043c9fbfed668df13ce608'] = 'Einstellungen werden aktualisiert'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d16dbbe71a327e22461456cfc5e7dfb2'] = 'Kein CMS Seite verfügbar'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_f1206f9fadc5ce41694f69129aecac26'] = 'Konfigurieren'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_4b3c34d991275b9fdb0facfcea561be9'] = ' CMS-Seite für Link'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_01bb71b3e70e9e5057c9678a903d47ac'] = 'wählen Sie eine Seite'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d4dccb8ca2dac4e53c01bd9954755332'] = 'Speichern Sie die Einstellungen'; diff --git a/modules/blockpaymentlogo/en.php b/modules/blockpaymentlogo/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockpaymentlogo/en.php @@ -0,0 +1,4 @@ +blockpaymentlogo_1bd130f5640104712b3c7dec66b7b0a1'] = 'Bloque de logos de pago'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8e27bf58ec687eea4b244d563dcbd8ac'] = 'Añadir un bloque para mostrar todos los logos de modos de pago'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8fc87743f34723d06ebff41629d2fdb5'] = 'Logos de pago'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_7ccf58c950043c9fbfed668df13ce608'] = 'Actualización correcta'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d16dbbe71a327e22461456cfc5e7dfb2'] = 'Página CMS no disponible'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_f1206f9fadc5ce41694f69129aecac26'] = 'Configure'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_4b3c34d991275b9fdb0facfcea561be9'] = 'Página CMS para enlaces'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_01bb71b3e70e9e5057c9678a903d47ac'] = 'Seleccionar una página'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d4dccb8ca2dac4e53c01bd9954755332'] = 'Guardar los parámetros'; diff --git a/modules/blockpaymentlogo/fr.php b/modules/blockpaymentlogo/fr.php new file mode 100644 index 000000000..edec44f3f --- /dev/null +++ b/modules/blockpaymentlogo/fr.php @@ -0,0 +1,13 @@ +blockpaymentlogo_1bd130f5640104712b3c7dec66b7b0a1'] = 'Bloc logo de paiement'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8e27bf58ec687eea4b244d563dcbd8ac'] = 'Ajoute un bloc affichant tous les logos des modes de paiement'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8fc87743f34723d06ebff41629d2fdb5'] = 'Logo de paiement'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d16dbbe71a327e22461456cfc5e7dfb2'] = 'Aucune page CMS est disponible'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_f1206f9fadc5ce41694f69129aecac26'] = 'Configurer'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_4b3c34d991275b9fdb0facfcea561be9'] = 'Page CMS pour le lien'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_01bb71b3e70e9e5057c9678a903d47ac'] = 'Choisir une page'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d4dccb8ca2dac4e53c01bd9954755332'] = 'Enregistrer'; diff --git a/modules/blockpaymentlogo/it.php b/modules/blockpaymentlogo/it.php new file mode 100644 index 000000000..62d944280 --- /dev/null +++ b/modules/blockpaymentlogo/it.php @@ -0,0 +1,13 @@ +blockpaymentlogo_1bd130f5640104712b3c7dec66b7b0a1'] = 'Blocco logo di pagamento '; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8e27bf58ec687eea4b244d563dcbd8ac'] = 'Aggiunge un blocco per visualizzare tutti i loghi pagamento'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_8fc87743f34723d06ebff41629d2fdb5'] = 'Logo di pagamento '; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_7ccf58c950043c9fbfed668df13ce608'] = 'Le impostazioni sono aggiornate'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d16dbbe71a327e22461456cfc5e7dfb2'] = 'Nessuna pagina CMS è disponibile'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_f1206f9fadc5ce41694f69129aecac26'] = 'Configura'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_4b3c34d991275b9fdb0facfcea561be9'] = 'Pagina CMS per link'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_01bb71b3e70e9e5057c9678a903d47ac'] = 'seleziona una pagina'; +$_MODULE['<{blockpaymentlogo}prestashop>blockpaymentlogo_d4dccb8ca2dac4e53c01bd9954755332'] = 'Salva impostazioni'; diff --git a/modules/blockpaymentlogo/logo.gif b/modules/blockpaymentlogo/logo.gif new file mode 100644 index 000000000..22c8df5a8 Binary files /dev/null and b/modules/blockpaymentlogo/logo.gif differ diff --git a/modules/blockpermanentlinks/blockpermanentlinks-header.tpl b/modules/blockpermanentlinks/blockpermanentlinks-header.tpl new file mode 100644 index 000000000..d1e0e9e44 --- /dev/null +++ b/modules/blockpermanentlinks/blockpermanentlinks-header.tpl @@ -0,0 +1,36 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + diff --git a/modules/blockpermanentlinks/blockpermanentlinks.php b/modules/blockpermanentlinks/blockpermanentlinks.php new file mode 100644 index 000000000..e381b6e19 --- /dev/null +++ b/modules/blockpermanentlinks/blockpermanentlinks.php @@ -0,0 +1,84 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockPermanentLinks extends Module +{ + function __construct() + { + $this->name = 'blockpermanentlinks'; + $this->tab = 'front_office_features'; + $this->version = 0.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Permanent links block'); + $this->description = $this->l('Adds a block that displays permanent links such as sitemap, contact, etc.'); + } + + function install() + { + return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); + } + + /** + * Returns module content for header + * + * @param array $params Parameters + * @return string Content + */ + function hookTop($params) + { + return $this->display(__FILE__, 'blockpermanentlinks-header.tpl'); + } + + /** + * Returns module content for left column + * + * @param array $params Parameters + * @return string Content + */ + function hookLeftColumn($params) + { + return $this->display(__FILE__, 'blockpermanentlinks.tpl'); + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockpermanentlinks.css', 'all'); + } +} + + diff --git a/modules/blockpermanentlinks/blockpermanentlinks.tpl b/modules/blockpermanentlinks/blockpermanentlinks.tpl new file mode 100644 index 000000000..595379860 --- /dev/null +++ b/modules/blockpermanentlinks/blockpermanentlinks.tpl @@ -0,0 +1,45 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + diff --git a/modules/blockpermanentlinks/config.xml b/modules/blockpermanentlinks/config.xml new file mode 100755 index 000000000..1e894fef4 --- /dev/null +++ b/modules/blockpermanentlinks/config.xml @@ -0,0 +1,11 @@ + + + blockpermanentlinks + Permanent links block + 0.1 + Adds a block that displays permanent links such as sitemap, contact, etc. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/blockpermanentlinks/de.php b/modules/blockpermanentlinks/de.php new file mode 100644 index 000000000..cd44f0c13 --- /dev/null +++ b/modules/blockpermanentlinks/de.php @@ -0,0 +1,12 @@ +blockpermanentlinks-header_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'Kontakt'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_e1da49db34b0bdfdddaba2ad6552f848'] = 'Sitemap'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_fad9383ed4698856ed467fd49ecf4820'] = 'Bookmark'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_39355c36cfd8f1d048a1f84803963534'] = 'Permanent Link-Block'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_3a3bf29ed9ddeb6210a731d2b1454df2'] = 'Fügt einen Block hinzu, der permanente Links anzeigt wie Sitemap, Kontakt, etc.'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_e1da49db34b0bdfdddaba2ad6552f848'] = 'Sitemap'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'Kontakt'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_05eb51862bc90ef24d04f3f1d8be5274'] = 'Bookmark auf diese Seite'; diff --git a/modules/blockpermanentlinks/en.php b/modules/blockpermanentlinks/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockpermanentlinks/en.php @@ -0,0 +1,4 @@ +blockpermanentlinks-header_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'Contacto'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_e1da49db34b0bdfdddaba2ad6552f848'] = 'Mapa del sitio'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_fad9383ed4698856ed467fd49ecf4820'] = 'Favoritos'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_39355c36cfd8f1d048a1f84803963534'] = 'Bloque de enlaces permanentes'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_3a3bf29ed9ddeb6210a731d2b1454df2'] = 'Añadir un bloque que muestre los enlaces permanentes como mapa del sitio, contacto, etc.'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_e1da49db34b0bdfdddaba2ad6552f848'] = 'mapa del sitio'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contacto'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_05eb51862bc90ef24d04f3f1d8be5274'] = 'añada esta página a favoritos'; diff --git a/modules/blockpermanentlinks/fr.php b/modules/blockpermanentlinks/fr.php new file mode 100644 index 000000000..bd23c2317 --- /dev/null +++ b/modules/blockpermanentlinks/fr.php @@ -0,0 +1,12 @@ +blockpermanentlinks-header_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contact'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_e1da49db34b0bdfdddaba2ad6552f848'] = 'plan du site'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_fad9383ed4698856ed467fd49ecf4820'] = 'favoris'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_39355c36cfd8f1d048a1f84803963534'] = 'Bloc liens permanents'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_3a3bf29ed9ddeb6210a731d2b1454df2'] = 'Ajoute un bloc qui affiche des liens permanents (contact, plan du site...)'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_e1da49db34b0bdfdddaba2ad6552f848'] = 'plan du site'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contact'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_05eb51862bc90ef24d04f3f1d8be5274'] = 'ajouter aux favoris'; diff --git a/modules/blockpermanentlinks/it.php b/modules/blockpermanentlinks/it.php new file mode 100644 index 000000000..2f1959b0f --- /dev/null +++ b/modules/blockpermanentlinks/it.php @@ -0,0 +1,12 @@ +blockpermanentlinks-header_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contatto'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_e1da49db34b0bdfdddaba2ad6552f848'] = 'Mappa del sito'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks-header_fad9383ed4698856ed467fd49ecf4820'] = 'segnalibro'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_39355c36cfd8f1d048a1f84803963534'] = 'Blocco link permanenti'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_3a3bf29ed9ddeb6210a731d2b1454df2'] = 'Aggiunge un blocco che visualizza i link permanenti come mappa del sito, contatti, ecc'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_e1da49db34b0bdfdddaba2ad6552f848'] = 'Mappa del sito'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_2f8a6bf31f3bd67bd2d9720c58b19c9a'] = 'contatto'; +$_MODULE['<{blockpermanentlinks}prestashop>blockpermanentlinks_05eb51862bc90ef24d04f3f1d8be5274'] = 'Segna questa pagina'; diff --git a/modules/blockpermanentlinks/logo.gif b/modules/blockpermanentlinks/logo.gif new file mode 100644 index 000000000..d1e8373fc Binary files /dev/null and b/modules/blockpermanentlinks/logo.gif differ diff --git a/modules/blockrss/blockrss.php b/modules/blockrss/blockrss.php new file mode 100644 index 000000000..86621704b --- /dev/null +++ b/modules/blockrss/blockrss.php @@ -0,0 +1,166 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +include_once(_PS_CLASS_DIR_.'../tools/pear/PEAR.php'); +include_once(_PS_PEAR_XML_PARSER_PATH_.'Parser.php'); + +class Blockrss extends Module +{ + function __construct() + { + $this->name = 'blockrss'; + $this->tab = 'front_office_features'; + + parent::__construct(); + + $this->displayName = $this->l('RSS feed block'); + $this->description = $this->l('Adds a block displaying an RSS feed.'); + + $this->version = '1.0'; + $this->author = 'PrestaShop'; + $this->error = false; + $this->valid = false; + } + + function install() + { + Configuration::updateValue('RSS_FEED_TITLE', $this->l('RSS feed')); + Configuration::updateValue('RSS_FEED_NBR', 5); + if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('header') == false) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + + if (Tools::isSubmit('submitBlockRss')) + { + $urlfeed = strval(Tools::getValue('urlfeed')); + $title = strval(Tools::getValue('title')); + $nbr = (int)(Tools::getValue('nbr')); + if ($urlfeed AND !Validate::isUrl($urlfeed)) + $errors[] = $this->l('Invalid feed URL'); + elseif (!$title OR empty($title) OR !Validate::isGenericName($title)) + $errors[] = $this->l('Invalid title'); + elseif (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) + $errors[] = $this->l('Invalid number of feeds'); + else + { + if (stristr($urlfeed, $_SERVER['HTTP_HOST'].__PS_BASE_URI__)) + $errors[] = $this->l('Error: You have selected a feed URL on your own website. Please choose another URL (eg. http://news.google.com/?output=rss).'); + + Configuration::updateValue('RSS_FEED_URL', $urlfeed); + Configuration::updateValue('RSS_FEED_TITLE', $title); + Configuration::updateValue('RSS_FEED_NBR', $nbr); + } + if (isset($errors) AND sizeof($errors)) + $output .= $this->displayError(implode('
        ', $errors)); + else + $output .= $this->displayConfirmation($this->l('Settings updated')); + } + else + { + $errors = array(); + if (stristr(Configuration::get('RSS_FEED_URL'), $_SERVER['HTTP_HOST'].__PS_BASE_URI__)) + $errors[] = $this->l('Error: You have selected a feed URL on your own website. Please choose another URL (eg. http://news.google.com/?output=rss).'); + + if (sizeof($errors)) + $output .= $this->displayError(implode('
        ', $errors)); + } + + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + +

        '.$this->l('Create a title for the block (default: \'RSS feed\')').'

        + +
        + +
        + +

        '.$this->l('Add the URL of the feed you want to use').'

        + +
        + +
        + +

        '.$this->l('Number of threads displayed by the block (default value: 5)').'

        + +
        +
        +
        +
        '; + return $output; + } + + function hookLeftColumn($params) + { + global $smarty; + + // Conf + $title = strval(Configuration::get('RSS_FEED_TITLE')); + $url = strval(Configuration::get('RSS_FEED_URL')); + $nb = (int)(Configuration::get('RSS_FEED_NBR')); + + // Getting data + $rss_links = array(); + if ($url && ($contents = @file_get_contents($url))) + if (@$src = new XML_Feed_Parser($contents)) + for ($i = 0; $i < ($nb ? $nb : 5); $i++) + if (@$item = $src->getEntryByOffset($i)) + $rss_links[] = array('title' => $item->title, 'url' => $item->link); + + // Display smarty + $smarty->assign(array('title' => ($title ? $title : $this->l('RSS feed')), 'rss_links' => $rss_links)); + + return $this->display(__FILE__, 'blockrss.tpl'); + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockrss.css', 'all'); + } +} + + diff --git a/modules/blockrss/blockrss.tpl b/modules/blockrss/blockrss.tpl new file mode 100644 index 000000000..bd696ce39 --- /dev/null +++ b/modules/blockrss/blockrss.tpl @@ -0,0 +1,42 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {$title}

        +
        + {if $rss_links} + + {else} + {l s='No RSS feed added' mod='blockrss'} + {/if} +
        +
        + diff --git a/modules/blockrss/config.xml b/modules/blockrss/config.xml new file mode 100755 index 000000000..cdd3c0ddb --- /dev/null +++ b/modules/blockrss/config.xml @@ -0,0 +1,11 @@ + + + blockrss + RSS feed block + 1.0 + Adds a block displaying an RSS feed. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockrss/de.php b/modules/blockrss/de.php new file mode 100644 index 000000000..3d7ff8aa8 --- /dev/null +++ b/modules/blockrss/de.php @@ -0,0 +1,21 @@ +blockrss_2516c13a12d3dbaf4efa88d9fce2e7da'] = 'RSS-Feed-Block'; +$_MODULE['<{blockrss}prestashop>blockrss_04396664ce529aa4204b0f7ad753fad1'] = 'Fügt einen Block hinzu, der ein RSS-Feed anzeigt'; +$_MODULE['<{blockrss}prestashop>blockrss_9680162225162baf2a085dfdc2814deb'] = 'RSS-Feed'; +$_MODULE['<{blockrss}prestashop>blockrss_6706b6d8ba45cc4f0eda0506ba1dc3c8'] = 'Ungültige Feed-URL'; +$_MODULE['<{blockrss}prestashop>blockrss_36ed65ce17306e812fd68d9f634c0c57'] = 'Ungültiger Titel'; +$_MODULE['<{blockrss}prestashop>blockrss_1b3d34e25aef32a3c8daddfff856577f'] = 'Ungültige Anzahl von RSS-Feeds'; +$_MODULE['<{blockrss}prestashop>blockrss_606a95aefd4296583b685aa039f01681'] = 'Sie haben eine Feed-URL auf Ihrer eigenen Website ausgewählt, dies ist wahrscheinlich ein Fehler! Wählen Sie eine andere URL (zB http://news.google.com/?output=rss), bis Sie wissen, was Sie wünschen'; +$_MODULE['<{blockrss}prestashop>blockrss_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockrss}prestashop>blockrss_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockrss}prestashop>blockrss_b22c8f9ad7db023c548c3b8e846cb169'] = 'Block Titel'; +$_MODULE['<{blockrss}prestashop>blockrss_2343a40bdffd8c7a6317b6d98c2b1042'] = 'Erstellen Sie einen Titel für den Block (Standard: \'RSS-Feed\')'; +$_MODULE['<{blockrss}prestashop>blockrss_402d00ca8e4f0fff26fc24ee9ab8e82b'] = 'Fügen Sie einen Feed-URL hinzu'; +$_MODULE['<{blockrss}prestashop>blockrss_eb26a56cc4c9ae20bc55c887773bddfd'] = 'Fügen Sie die URL des Feeds hinzu, die Sie verwenden möchten'; +$_MODULE['<{blockrss}prestashop>blockrss_ff9aa540e20285875ac8b190a3cb7ccf'] = 'Anzahl der angezeigten Threads'; +$_MODULE['<{blockrss}prestashop>blockrss_f33725e23a017705ad35897e849a4db4'] = 'Anzahl der im Block angezeigten Threads (Standardwert: 5)'; +$_MODULE['<{blockrss}prestashop>blockrss_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockrss}prestashop>blockrss_10fd25dcd3353c0ba3731d4a23657f2e'] = 'Kein RSS Feed hinzugefügt'; diff --git a/modules/blockrss/en.php b/modules/blockrss/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockrss/en.php @@ -0,0 +1,4 @@ +blockrss_2516c13a12d3dbaf4efa88d9fce2e7da'] = 'Bloque fuentes RSS'; +$_MODULE['<{blockrss}prestashop>blockrss_04396664ce529aa4204b0f7ad753fad1'] = 'Añadir o bloquear con un campo de búsqueda rápida'; +$_MODULE['<{blockrss}prestashop>blockrss_9680162225162baf2a085dfdc2814deb'] = 'fuentes RSS'; +$_MODULE['<{blockrss}prestashop>blockrss_6706b6d8ba45cc4f0eda0506ba1dc3c8'] = 'URL de fuente incorrecta'; +$_MODULE['<{blockrss}prestashop>blockrss_36ed65ce17306e812fd68d9f634c0c57'] = 'Título incorrecto'; +$_MODULE['<{blockrss}prestashop>blockrss_1b3d34e25aef32a3c8daddfff856577f'] = 'Número de fuentes incorrecto'; +$_MODULE['<{blockrss}prestashop>blockrss_606a95aefd4296583b685aa039f01681'] = 'Ha seleccionado un flujo RSS de su propio sitio Web, sin duda se trata de un error. Elija otro URL (ej: http://news.google.com/?output=rss) excepto si está seguro de su acción.'; +$_MODULE['<{blockrss}prestashop>blockrss_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockrss}prestashop>blockrss_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blockrss}prestashop>blockrss_b22c8f9ad7db023c548c3b8e846cb169'] = 'Título del bloque'; +$_MODULE['<{blockrss}prestashop>blockrss_2343a40bdffd8c7a6317b6d98c2b1042'] = 'Cree un título para el bloque (por defecto\'RSS feed\')'; +$_MODULE['<{blockrss}prestashop>blockrss_402d00ca8e4f0fff26fc24ee9ab8e82b'] = 'Añadir URL de la fuente '; +$_MODULE['<{blockrss}prestashop>blockrss_eb26a56cc4c9ae20bc55c887773bddfd'] = 'Añadir URL de la fuente que no desea usar'; +$_MODULE['<{blockrss}prestashop>blockrss_ff9aa540e20285875ac8b190a3cb7ccf'] = 'Número de hilos mostrados'; +$_MODULE['<{blockrss}prestashop>blockrss_f33725e23a017705ad35897e849a4db4'] = 'Número de hilos mostrados en cada bloque (por defecto 5)'; +$_MODULE['<{blockrss}prestashop>blockrss_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockrss}prestashop>blockrss_10fd25dcd3353c0ba3731d4a23657f2e'] = 'No se han añadido fuentes RSS'; diff --git a/modules/blockrss/fr.php b/modules/blockrss/fr.php new file mode 100644 index 000000000..a4d2712eb --- /dev/null +++ b/modules/blockrss/fr.php @@ -0,0 +1,21 @@ +blockrss_2516c13a12d3dbaf4efa88d9fce2e7da'] = 'Bloc flux RSS'; +$_MODULE['<{blockrss}prestashop>blockrss_04396664ce529aa4204b0f7ad753fad1'] = 'Ajoute un bloc avec les messages d\'un flux RSS'; +$_MODULE['<{blockrss}prestashop>blockrss_9680162225162baf2a085dfdc2814deb'] = 'Flux RSS'; +$_MODULE['<{blockrss}prestashop>blockrss_6706b6d8ba45cc4f0eda0506ba1dc3c8'] = 'URL du flux invalide'; +$_MODULE['<{blockrss}prestashop>blockrss_36ed65ce17306e812fd68d9f634c0c57'] = 'Titre invalide'; +$_MODULE['<{blockrss}prestashop>blockrss_1b3d34e25aef32a3c8daddfff856577f'] = 'Nombre de flux invalide'; +$_MODULE['<{blockrss}prestashop>blockrss_606a95aefd4296583b685aa039f01681'] = 'Vous avez sélectionné une flux RSS de votre propre site, il s\'agit très probablement d\'une erreur ! Choisissez une autre URL (ex : http://news.google.com/?output=rss) sauf si vous êtes sûr de votre action'; +$_MODULE['<{blockrss}prestashop>blockrss_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockrss}prestashop>blockrss_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockrss}prestashop>blockrss_b22c8f9ad7db023c548c3b8e846cb169'] = 'Titre du bloc'; +$_MODULE['<{blockrss}prestashop>blockrss_2343a40bdffd8c7a6317b6d98c2b1042'] = 'Créez un titre pour le block (par défaut : \'Flux RSS\')'; +$_MODULE['<{blockrss}prestashop>blockrss_402d00ca8e4f0fff26fc24ee9ab8e82b'] = 'Ajouter une URL'; +$_MODULE['<{blockrss}prestashop>blockrss_eb26a56cc4c9ae20bc55c887773bddfd'] = 'Ajouter l\'url du flux que vous souhaitez utiliser'; +$_MODULE['<{blockrss}prestashop>blockrss_ff9aa540e20285875ac8b190a3cb7ccf'] = 'Nombre de messages affichés'; +$_MODULE['<{blockrss}prestashop>blockrss_f33725e23a017705ad35897e849a4db4'] = 'Nombre de messages affichés par le bloc (défaut : 5)'; +$_MODULE['<{blockrss}prestashop>blockrss_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{blockrss}prestashop>blockrss_10fd25dcd3353c0ba3731d4a23657f2e'] = 'Aucun flux RSS ajouté'; diff --git a/modules/blockrss/it.php b/modules/blockrss/it.php new file mode 100644 index 000000000..db0c0acf1 --- /dev/null +++ b/modules/blockrss/it.php @@ -0,0 +1,21 @@ +blockrss_2516c13a12d3dbaf4efa88d9fce2e7da'] = 'Blocco RSS feed '; +$_MODULE['<{blockrss}prestashop>blockrss_04396664ce529aa4204b0f7ad753fad1'] = 'Aggiunge un blocco che visualizza un RSS feed '; +$_MODULE['<{blockrss}prestashop>blockrss_9680162225162baf2a085dfdc2814deb'] = 'RSS feed'; +$_MODULE['<{blockrss}prestashop>blockrss_6706b6d8ba45cc4f0eda0506ba1dc3c8'] = 'URL del feed non valido'; +$_MODULE['<{blockrss}prestashop>blockrss_36ed65ce17306e812fd68d9f634c0c57'] = 'Titolo non valido '; +$_MODULE['<{blockrss}prestashop>blockrss_1b3d34e25aef32a3c8daddfff856577f'] = 'Numero non valido di feed'; +$_MODULE['<{blockrss}prestashop>blockrss_606a95aefd4296583b685aa039f01681'] = 'Hai scelto un URL del feed sul tuo sito web, questo è probabilmente un errore! Scegli un altro URL (es. http://news.google.com/?output=rss) finché non sai cosa fare'; +$_MODULE['<{blockrss}prestashop>blockrss_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockrss}prestashop>blockrss_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockrss}prestashop>blockrss_b22c8f9ad7db023c548c3b8e846cb169'] = 'Titolo blocco'; +$_MODULE['<{blockrss}prestashop>blockrss_2343a40bdffd8c7a6317b6d98c2b1042'] = 'Crea un titolo per il blocco (default: \'RSS\')'; +$_MODULE['<{blockrss}prestashop>blockrss_402d00ca8e4f0fff26fc24ee9ab8e82b'] = 'Aggiungi un URL del feed'; +$_MODULE['<{blockrss}prestashop>blockrss_eb26a56cc4c9ae20bc55c887773bddfd'] = 'Aggiungi l\'URL del feed che vuoi utilizzare'; +$_MODULE['<{blockrss}prestashop>blockrss_ff9aa540e20285875ac8b190a3cb7ccf'] = 'Numero di thread visualizzati'; +$_MODULE['<{blockrss}prestashop>blockrss_f33725e23a017705ad35897e849a4db4'] = 'Il numero di thread visualizzati dal blocco (valore di default: 5)'; +$_MODULE['<{blockrss}prestashop>blockrss_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockrss}prestashop>blockrss_10fd25dcd3353c0ba3731d4a23657f2e'] = 'Nessun RSS feed aggiunto'; diff --git a/modules/blockrss/logo.gif b/modules/blockrss/logo.gif new file mode 100644 index 000000000..7a5e0099f Binary files /dev/null and b/modules/blockrss/logo.gif differ diff --git a/modules/blocksearch/blocksearch-top.tpl b/modules/blocksearch/blocksearch-top.tpl new file mode 100644 index 000000000..ac5568ba5 --- /dev/null +++ b/modules/blocksearch/blocksearch-top.tpl @@ -0,0 +1,132 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        + + +
        +{if $instantsearch} + +{/if} + +{if $ajaxsearch} + +{/if} + \ No newline at end of file diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php new file mode 100644 index 000000000..d3084d26e --- /dev/null +++ b/modules/blocksearch/blocksearch.php @@ -0,0 +1,100 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockSearch extends Module +{ + public function __construct() + { + $this->name = 'blocksearch'; + $this->tab = 'search_filter'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Quick Search block'); + $this->description = $this->l('Adds a block with a quick search field.'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('top') + OR !$this->registerHook('leftColumn') + OR !$this->registerHook('rightColumn') + ) + return false; + return true; + } + + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookRightColumn($params) + { + $this->_hookCommon($params); + return $this->display(__FILE__, 'blocksearch.tpl'); + } + + public function hookTop($params) + { + $this->_hookCommon($params); + return $this->display(__FILE__, 'blocksearch-top.tpl'); + } + + /** + * _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication. + * + * @param mixed $params + * @return void + */ + private function _hookCommon($params) + { + global $smarty; + $smarty->assign('ENT_QUOTES', ENT_QUOTES); + $smarty->assign('search_ssl', (int)(isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')); + + $ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX')); + $smarty->assign('ajaxsearch', $ajaxSearch); + + $instantSearch = (int)(Configuration::get('PS_INSTANT_SEARCH')); + $smarty->assign('instantsearch', $instantSearch); + if ($ajaxSearch) + { + Tools::addCSS(_PS_CSS_DIR_.'jquery.autocomplete.css'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery.autocomplete.js'); + } + Tools::addCSS(_THEME_CSS_DIR_.'product_list.css'); + Tools::addCSS(($this->_path).'blocksearch.css', 'all'); + return true; + } +} diff --git a/modules/blocksearch/blocksearch.tpl b/modules/blocksearch/blocksearch.tpl new file mode 100644 index 000000000..c35057cf0 --- /dev/null +++ b/modules/blocksearch/blocksearch.tpl @@ -0,0 +1,132 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Search' mod='blocksearch'}

        + +
        +{if $instantsearch} + +{/if} + +{if $ajaxsearch} + +{/if} + diff --git a/modules/blocksearch/config.xml b/modules/blocksearch/config.xml new file mode 100755 index 000000000..fd3711f9f --- /dev/null +++ b/modules/blocksearch/config.xml @@ -0,0 +1,11 @@ + + + blocksearch + Quick Search block + 1 + Adds a block with a quick search field. + PrestaShop + search_filter + 0 + 1 + \ No newline at end of file diff --git a/modules/blocksearch/de.php b/modules/blocksearch/de.php new file mode 100644 index 000000000..b9ec343f9 --- /dev/null +++ b/modules/blocksearch/de.php @@ -0,0 +1,10 @@ +blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Suche'; +$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Quick Search Block'; +$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Fügt einen Block mit einem Quick Search Feld hinzu'; +$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Suche'; +$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Geben Sie einen Produktnamen ein'; +$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'los'; diff --git a/modules/blocksearch/en.php b/modules/blocksearch/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocksearch/en.php @@ -0,0 +1,4 @@ +blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Buscar'; +$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Bloque de búsqueda rápida'; +$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Añada u bloque con un campo de búsqueda rápida'; +$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Buscar'; +$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Introduzca el nombre del producto'; +$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'buscar'; diff --git a/modules/blocksearch/fr.php b/modules/blocksearch/fr.php new file mode 100644 index 000000000..39c775ffd --- /dev/null +++ b/modules/blocksearch/fr.php @@ -0,0 +1,10 @@ +blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher'; +$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Bloc recherche rapide'; +$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Ajoute un bloc avec un champ de recherche rapide'; +$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher'; +$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Entrez un nom de produit'; +$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'ok'; diff --git a/modules/blocksearch/it.php b/modules/blocksearch/it.php new file mode 100644 index 000000000..2bab09fd5 --- /dev/null +++ b/modules/blocksearch/it.php @@ -0,0 +1,10 @@ +blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Cerca'; +$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Blocco ricerca rapida '; +$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Aggiunge un blocco con un campo di ricerca rapida'; +$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Cerca'; +$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Inserisci il nome di un prodotto'; +$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'Vai'; diff --git a/modules/blocksearch/logo.gif b/modules/blocksearch/logo.gif new file mode 100644 index 000000000..cf3d97f75 Binary files /dev/null and b/modules/blocksearch/logo.gif differ diff --git a/modules/blockspecials/blockspecials.php b/modules/blockspecials/blockspecials.php new file mode 100644 index 000000000..108515ed2 --- /dev/null +++ b/modules/blockspecials/blockspecials.php @@ -0,0 +1,111 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class BlockSpecials extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + function __construct() + { + $this->name = 'blockspecials'; + $this->tab = 'pricing_promotion'; + $this->version = 0.8; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Specials block'); + $this->description = $this->l('Adds a block with current product specials.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('rightColumn') AND $this->registerHook('header')); + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitSpecials')) + { + Configuration::updateValue('PS_BLOCK_SPECIALS_DISPLAY', (int)(Tools::getValue('always_display'))); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + return ' +
        +
        + '.$this->l('Settings').' + +
        + + + + +

        '.$this->l('Show the block even if no product is available.').'

        +
        +
        +
        +
        '; + } + + public function hookRightColumn($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + + global $smarty; + if (!$special = Product::getRandomSpecial((int)($params['cookie']->id_lang)) AND !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) + return; + $smarty->assign(array( + 'special' => $special, + 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'] / (1 + (int)$special['rate'] / 100), 2), + 'mediumSize' => Image::getSize('medium') + )); + + return $this->display(__FILE__, 'blockspecials.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookHeader($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return ; + Tools::addCSS(($this->_path).'blockspecials.css', 'all'); + } +} + + diff --git a/modules/blockspecials/blockspecials.tpl b/modules/blockspecials/blockspecials.tpl new file mode 100644 index 000000000..17f622bb7 --- /dev/null +++ b/modules/blockspecials/blockspecials.tpl @@ -0,0 +1,58 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Specials' mod='blockspecials'}

        +
        + +{if $special} +
          +
        • + {$special.legend|escape:html:'UTF-8'} +
        • +
        • + +
          {$special.name|escape:html:'UTF-8'}
          + {if !$priceDisplay}{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if} + {if $special.specific_prices} + {assign var='specific_prices' value=$special.specific_prices} + {if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))} + (-{$specific_prices.reduction * 100|floatval}%) + {/if} + {/if} + {if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if} +
        • +
        +

        + {l s='All specials' mod='blockspecials'} +

        +{else} +

        {l s='No specials at this time' mod='blockspecials'}

        +{/if} +
        +
        + \ No newline at end of file diff --git a/modules/blockspecials/config.xml b/modules/blockspecials/config.xml new file mode 100755 index 000000000..b064b8f7f --- /dev/null +++ b/modules/blockspecials/config.xml @@ -0,0 +1,12 @@ + + + blockspecials + Specials block + 0.8 + Adds a block with current product specials. + PrestaShop + pricing_promotion + 1 + 1 + + \ No newline at end of file diff --git a/modules/blockspecials/de.php b/modules/blockspecials/de.php new file mode 100644 index 000000000..7bb8f382d --- /dev/null +++ b/modules/blockspecials/de.php @@ -0,0 +1,17 @@ +blockspecials_c19ed4ea98cbf319735f6d09bde6c757'] = 'Specials Block'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c2fb79a6eca86e519f938a1ef15c3e69'] = 'Fügt einen Block mit aktuellen Produkt-Specials hinzu'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockspecials}prestashop>blockspecials_530c88f8210e022b39128e3f0409bbcf'] = 'Block immer anzeigen'; +$_MODULE['<{blockspecials}prestashop>blockspecials_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blockspecials}prestashop>blockspecials_a8a670d89a6d2f3fa59942fc591011ef'] = 'Block anzeigen, auch wenn kein Produkt verfügbar ist.'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockspecials}prestashop>blockspecials_d1aa22a3126f04664e0fe3f598994014'] = 'Specials'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b4f95c1ea534936cc60c6368c225f480'] = 'Alle Specials'; +$_MODULE['<{blockspecials}prestashop>blockspecials_fd21fcc9fc4c1d5202d6fc11597b3fca'] = 'Keine Specials zu diesem Zeitpunkt'; diff --git a/modules/blockspecials/en.php b/modules/blockspecials/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockspecials/en.php @@ -0,0 +1,4 @@ +blockspecials_c19ed4ea98cbf319735f6d09bde6c757'] = 'Bloque promociones especiales'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c2fb79a6eca86e519f938a1ef15c3e69'] = 'Añadir un bloque con promociones especiales'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c888438d14855d7d96a2724ee9c306bd'] = 'Parámetros actualizados'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros '; +$_MODULE['<{blockspecials}prestashop>blockspecials_530c88f8210e022b39128e3f0409bbcf'] = 'Mostrar este bloque siempre'; +$_MODULE['<{blockspecials}prestashop>blockspecials_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blockspecials}prestashop>blockspecials_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostrar este bloque aunque no haya productos disponibles'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockspecials}prestashop>blockspecials_d1aa22a3126f04664e0fe3f598994014'] = 'Promociones especiales'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b4f95c1ea534936cc60c6368c225f480'] = 'Todas los promociones especiales'; +$_MODULE['<{blockspecials}prestashop>blockspecials_fd21fcc9fc4c1d5202d6fc11597b3fca'] = 'No hay promociones especiales en este momento'; diff --git a/modules/blockspecials/fr.php b/modules/blockspecials/fr.php new file mode 100644 index 000000000..b6489dc3e --- /dev/null +++ b/modules/blockspecials/fr.php @@ -0,0 +1,17 @@ +blockspecials_c19ed4ea98cbf319735f6d09bde6c757'] = 'Bloc promotions'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c2fb79a6eca86e519f938a1ef15c3e69'] = 'Ajoute un bloc proposant les produits en promotion actuellement'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blockspecials}prestashop>blockspecials_530c88f8210e022b39128e3f0409bbcf'] = 'Toujours afficher ce bloc'; +$_MODULE['<{blockspecials}prestashop>blockspecials_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blockspecials}prestashop>blockspecials_a8a670d89a6d2f3fa59942fc591011ef'] = 'Afficher le bloc même si aucun produit n\'est disponible'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockspecials}prestashop>blockspecials_d1aa22a3126f04664e0fe3f598994014'] = 'Réductions'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b4f95c1ea534936cc60c6368c225f480'] = 'Toutes les promos'; +$_MODULE['<{blockspecials}prestashop>blockspecials_fd21fcc9fc4c1d5202d6fc11597b3fca'] = 'Pas de promotion actuellement'; diff --git a/modules/blockspecials/it.php b/modules/blockspecials/it.php new file mode 100644 index 000000000..d1c696dbe --- /dev/null +++ b/modules/blockspecials/it.php @@ -0,0 +1,17 @@ +blockspecials_c19ed4ea98cbf319735f6d09bde6c757'] = 'Blocco offerte speciali '; +$_MODULE['<{blockspecials}prestashop>blockspecials_c2fb79a6eca86e519f938a1ef15c3e69'] = 'Aggiunge un blocco con le offerte speciali del momento'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockspecials}prestashop>blockspecials_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockspecials}prestashop>blockspecials_530c88f8210e022b39128e3f0409bbcf'] = 'Visualizza sempre il blocco'; +$_MODULE['<{blockspecials}prestashop>blockspecials_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blockspecials}prestashop>blockspecials_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostra il blocco anche se nessun prodotto è disponibile.'; +$_MODULE['<{blockspecials}prestashop>blockspecials_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockspecials}prestashop>blockspecials_d1aa22a3126f04664e0fe3f598994014'] = 'Speciali'; +$_MODULE['<{blockspecials}prestashop>blockspecials_b4f95c1ea534936cc60c6368c225f480'] = 'Tutte le offerte speciali'; +$_MODULE['<{blockspecials}prestashop>blockspecials_fd21fcc9fc4c1d5202d6fc11597b3fca'] = 'Non ci sono offerte speciali in questo momento'; diff --git a/modules/blockspecials/logo.gif b/modules/blockspecials/logo.gif new file mode 100644 index 000000000..f375119e0 Binary files /dev/null and b/modules/blockspecials/logo.gif differ diff --git a/modules/blockstore/blockstore.css b/modules/blockstore/blockstore.css new file mode 100644 index 000000000..cc8a81ad5 --- /dev/null +++ b/modules/blockstore/blockstore.css @@ -0,0 +1,3 @@ +/* Block store */ +.blockstore img { margin: 10px 0 0 0; } +.blockstore p { text-align: center; font-weight: 10px; } \ No newline at end of file diff --git a/modules/blockstore/blockstore.php b/modules/blockstore/blockstore.php new file mode 100644 index 000000000..3a25123e7 --- /dev/null +++ b/modules/blockstore/blockstore.php @@ -0,0 +1,124 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockStore extends Module +{ + function __construct() + { + $this->name = 'blockstore'; + $this->tab = 'front_office_features'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Stores block'); + $this->description = $this->l('Displays a block with a link to the store locator.'); + } + + function install() + { + Configuration::updateValue('BLOCKSTORE_IMG', 'store.jpg'); + return (parent::install() AND $this->registerHook('rightColumn') AND $this->registerHook('header')); + } + + public function uninstall() + { + Configuration::deleteByName('BLOCKSTORE_IMG'); + return parent::uninstall(); + } + + function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + function hookRightColumn($params) + { + global $smarty; + + $smarty->assign('store_img', Configuration::get('BLOCKSTORE_IMG')); + return $this->display(__FILE__, 'blockstore.tpl'); + } + + function hookHeader($params) + { + Tools::addCSS(_THEME_CSS_DIR_.'modules/'.$this->name.'/blockstore.css', 'all'); + } + + public function postProcess() + { + if (Tools::isSubmit('submitStoreConf')) + { + if (isset($_FILES['store_img']) AND isset($_FILES['store_img']['tmp_name']) AND !empty($_FILES['store_img']['tmp_name'])) + { + if ($error = checkImage($_FILES['store_img'], 4000000)) + return $this->displayError($this->l('invalid image')); + else + { + if (!move_uploaded_file($_FILES['store_img']['tmp_name'], dirname(__FILE__).'/'.$_FILES['store_img']['name'])) + return $this->displayError($this->l('an error occured on uploading file')); + else + { + if (Configuration::get('BLOCKSTORE_IMG') != $_FILES['store_img']['name']) + @unlink(dirname(__FILE__).'/'.Configuration::get('BLOCKSTORE_IMG')); + Configuration::updateValue('BLOCKSTORE_IMG', $_FILES['store_img']['name']); + return $this->displayConfirmation($this->l('Settings are updated')); + } + } + } + } + return ''; + } + + public function getContent() + { + $output = $this->postProcess().' +
        +
        + '.$this->l('Store block configuration').''; + if (Configuration::get('BLOCKSTORE_IMG')) + $output .= '
        '.$this->l('Store image').'
        '; + $output .= ' + +
        + ( '.$this->l('image will be displayed as 174x115').' ) +
        + +

        + +

        +
        +
        + '; + return $output; + } +} + diff --git a/modules/blockstore/blockstore.tpl b/modules/blockstore/blockstore.tpl new file mode 100644 index 000000000..5df070316 --- /dev/null +++ b/modules/blockstore/blockstore.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + diff --git a/modules/blockstore/config.xml b/modules/blockstore/config.xml new file mode 100755 index 000000000..8459dc3db --- /dev/null +++ b/modules/blockstore/config.xml @@ -0,0 +1,11 @@ + + + blockstore + Stores block + 1 + Displays a block with a link to the store locator. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockstore/de.php b/modules/blockstore/de.php new file mode 100644 index 000000000..1b704d446 --- /dev/null +++ b/modules/blockstore/de.php @@ -0,0 +1,16 @@ +blockstore_50d335623ef166aeea8da2a3c2c63a3e'] = 'Shop-Block'; +$_MODULE['<{blockstore}prestashop>blockstore_7118171dfc2981fd3d7f3aab97fb572d'] = 'Zeigt ein Block mit einem Link zu der Händlersuche'; +$_MODULE['<{blockstore}prestashop>blockstore_f32a6c9e15dd20152ee8b14c7f94b040'] = 'Bild ungültig'; +$_MODULE['<{blockstore}prestashop>blockstore_4dd95964f5b02106aeaa2dbf3e9d3c5e'] = 'ein Fehler ist beim Hochladen der Datei aufgetreten '; +$_MODULE['<{blockstore}prestashop>blockstore_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{blockstore}prestashop>blockstore_dbd41b964013caae2d73220618b5ae90'] = 'Shop-Block-Konfiguration'; +$_MODULE['<{blockstore}prestashop>blockstore_2dd1d28275cdb8b78ebd17f6e25aac0d'] = 'Shop-Bild'; +$_MODULE['<{blockstore}prestashop>blockstore_8c38cf08a0d0a01bd44c682479432350'] = 'Bild ändern'; +$_MODULE['<{blockstore}prestashop>blockstore_f6f1e75fd6d515138c3c802459aa384d'] = 'Bild wird als 174x115 angezeigt '; +$_MODULE['<{blockstore}prestashop>blockstore_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockstore}prestashop>blockstore_34c869c542dee932ef8cd96d2f91cae6'] = 'Unsere Shops'; +$_MODULE['<{blockstore}prestashop>blockstore_61d5070a61ce6eb6ad2a212fdf967d92'] = 'Entdecken Sie unsere Shops'; diff --git a/modules/blockstore/es.php b/modules/blockstore/es.php new file mode 100644 index 000000000..db1004aac --- /dev/null +++ b/modules/blockstore/es.php @@ -0,0 +1,16 @@ +blockstore_50d335623ef166aeea8da2a3c2c63a3e'] = 'Bloque tiendas'; +$_MODULE['<{blockstore}prestashop>blockstore_7118171dfc2981fd3d7f3aab97fb572d'] = 'Mostrar un bloque con un link hacia la lista de tiendas'; +$_MODULE['<{blockstore}prestashop>blockstore_f32a6c9e15dd20152ee8b14c7f94b040'] = 'imagen no válida'; +$_MODULE['<{blockstore}prestashop>blockstore_4dd95964f5b02106aeaa2dbf3e9d3c5e'] = 'se ha producido un error durante el envío'; +$_MODULE['<{blockstore}prestashop>blockstore_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados'; +$_MODULE['<{blockstore}prestashop>blockstore_dbd41b964013caae2d73220618b5ae90'] = 'Configuració del bloque tiendas'; +$_MODULE['<{blockstore}prestashop>blockstore_2dd1d28275cdb8b78ebd17f6e25aac0d'] = 'Imagen del bloque'; +$_MODULE['<{blockstore}prestashop>blockstore_8c38cf08a0d0a01bd44c682479432350'] = 'Cambiar de imagen:'; +$_MODULE['<{blockstore}prestashop>blockstore_f6f1e75fd6d515138c3c802459aa384d'] = 'la imagen se mostrará en formato 174x115'; +$_MODULE['<{blockstore}prestashop>blockstore_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockstore}prestashop>blockstore_34c869c542dee932ef8cd96d2f91cae6'] = 'Nuestras tiendas'; +$_MODULE['<{blockstore}prestashop>blockstore_61d5070a61ce6eb6ad2a212fdf967d92'] = 'Descubra nuestras tiendas'; diff --git a/modules/blockstore/fr.php b/modules/blockstore/fr.php new file mode 100644 index 000000000..90ddf7eaf --- /dev/null +++ b/modules/blockstore/fr.php @@ -0,0 +1,16 @@ +blockstore_50d335623ef166aeea8da2a3c2c63a3e'] = 'Bloc magasins'; +$_MODULE['<{blockstore}prestashop>blockstore_7118171dfc2981fd3d7f3aab97fb572d'] = 'Affiche un bloc avec un lien vers la liste des magasins'; +$_MODULE['<{blockstore}prestashop>blockstore_f32a6c9e15dd20152ee8b14c7f94b040'] = 'image invalide'; +$_MODULE['<{blockstore}prestashop>blockstore_4dd95964f5b02106aeaa2dbf3e9d3c5e'] = 'une erreur s\'est produite lors de l\'envoi'; +$_MODULE['<{blockstore}prestashop>blockstore_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{blockstore}prestashop>blockstore_dbd41b964013caae2d73220618b5ae90'] = 'Configuration du block magasins'; +$_MODULE['<{blockstore}prestashop>blockstore_2dd1d28275cdb8b78ebd17f6e25aac0d'] = 'Image du block'; +$_MODULE['<{blockstore}prestashop>blockstore_8c38cf08a0d0a01bd44c682479432350'] = 'Changer l\'image:'; +$_MODULE['<{blockstore}prestashop>blockstore_f6f1e75fd6d515138c3c802459aa384d'] = 'l\'image sera affiché au format 174x115'; +$_MODULE['<{blockstore}prestashop>blockstore_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockstore}prestashop>blockstore_34c869c542dee932ef8cd96d2f91cae6'] = 'Nos magasins'; +$_MODULE['<{blockstore}prestashop>blockstore_61d5070a61ce6eb6ad2a212fdf967d92'] = 'Découvrez nos magasins'; diff --git a/modules/blockstore/it.php b/modules/blockstore/it.php new file mode 100644 index 000000000..973b2f11e --- /dev/null +++ b/modules/blockstore/it.php @@ -0,0 +1,16 @@ +blockstore_50d335623ef166aeea8da2a3c2c63a3e'] = 'Blocco negozi '; +$_MODULE['<{blockstore}prestashop>blockstore_7118171dfc2981fd3d7f3aab97fb572d'] = 'Visualizza un blocco con un link per il localizzatore del negozio'; +$_MODULE['<{blockstore}prestashop>blockstore_f32a6c9e15dd20152ee8b14c7f94b040'] = 'immagine non valida'; +$_MODULE['<{blockstore}prestashop>blockstore_4dd95964f5b02106aeaa2dbf3e9d3c5e'] = 'errore nel caricamento del file'; +$_MODULE['<{blockstore}prestashop>blockstore_7ccf58c950043c9fbfed668df13ce608'] = 'Le impostazioni sono aggiornate'; +$_MODULE['<{blockstore}prestashop>blockstore_dbd41b964013caae2d73220618b5ae90'] = 'Configurazione blocco negozio'; +$_MODULE['<{blockstore}prestashop>blockstore_2dd1d28275cdb8b78ebd17f6e25aac0d'] = 'Immagine blocco'; +$_MODULE['<{blockstore}prestashop>blockstore_8c38cf08a0d0a01bd44c682479432350'] = 'Cambia immagine'; +$_MODULE['<{blockstore}prestashop>blockstore_f6f1e75fd6d515138c3c802459aa384d'] = 'immagine verrà visualizzata come 174x115'; +$_MODULE['<{blockstore}prestashop>blockstore_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockstore}prestashop>blockstore_34c869c542dee932ef8cd96d2f91cae6'] = 'I nostri negozi'; +$_MODULE['<{blockstore}prestashop>blockstore_61d5070a61ce6eb6ad2a212fdf967d92'] = 'Scopri i nostri negozi'; diff --git a/modules/blockstore/logo.gif b/modules/blockstore/logo.gif new file mode 100644 index 000000000..659aace81 Binary files /dev/null and b/modules/blockstore/logo.gif differ diff --git a/modules/blockstore/store.jpg b/modules/blockstore/store.jpg new file mode 100644 index 000000000..91f73f257 Binary files /dev/null and b/modules/blockstore/store.jpg differ diff --git a/modules/blocksupplier/blocksupplier.php b/modules/blocksupplier/blocksupplier.php new file mode 100644 index 000000000..39fae69df --- /dev/null +++ b/modules/blocksupplier/blocksupplier.php @@ -0,0 +1,139 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockSupplier extends Module +{ + function __construct() + { + $this->name = 'blocksupplier'; + $this->tab = 'front_office_features'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Suppliers block'); + $this->description = $this->l('Adds a block displaying suppliers.'); + } + + function install() + { + if (!parent::install()) + return false; + if (!$this->registerHook('leftColumn')) + return false; + if (!$this->registerHook('header')) + return false; + Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', true); + Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', 5); + Configuration::updateValue('SUPPLIER_DISPLAY_FORM', true); + return true; + } + + function hookLeftColumn($params) + { + global $smarty, $link; + $smarty->assign(array( + 'suppliers' => Supplier::getSuppliers(false), + 'link' => $link, + 'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'), + 'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'), + 'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'), + 'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS') + )); + return $this->display(__FILE__, 'blocksupplier.tpl'); + } + + function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockSuppliers')) + { + $text_list = (int)(Tools::getValue('text_list')); + $text_nb = (int)(Tools::getValue('text_nb')); + $form_list = (int)(Tools::getValue('form_list')); + if ($text_list AND !Validate::isUnsignedInt($text_nb)) + $errors[] = $this->l('Invalid number of elements'); + elseif (!$text_list AND !$form_list) + $errors[] = $this->l('Please activate at least one system list.'); + else + { + Configuration::updateValue('SUPPLIER_DISPLAY_TEXT', $text_list); + Configuration::updateValue('SUPPLIER_DISPLAY_TEXT_NB', $text_nb); + Configuration::updateValue('SUPPLIER_DISPLAY_FORM', $form_list); + } + if (isset($errors) AND sizeof($errors)) + $output .= $this->displayError(implode('
        ', $errors)); + else + $output .= $this->displayConfirmation($this->l('Settings updated')); + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + + + + +    '.$this->l('Display').' '.$this->l('elements').' +

        '.$this->l('To display suppliers as a plain-text list').'

        +
        + +
        + + + + +

        '.$this->l('To display suppliers as a drop-down list').'

        +
        +
        +
        +
        '; + return $output; + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blocksupplier.css', 'all'); + } +} + + diff --git a/modules/blocksupplier/blocksupplier.tpl b/modules/blocksupplier/blocksupplier.tpl new file mode 100644 index 000000000..090285990 --- /dev/null +++ b/modules/blocksupplier/blocksupplier.tpl @@ -0,0 +1,60 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {if $display_link_supplier}{/if}{l s='Suppliers' mod='blocksupplier'}{if $display_link_supplier}{/if}

        +
        +{if $suppliers} + {if $text_list} + + {/if} + {if $form_list} +
        +

        + +

        +
        + {/if} +{else} +

        {l s='No supplier' mod='blocksupplier'}

        +{/if} +
        +
        + diff --git a/modules/blocksupplier/config.xml b/modules/blocksupplier/config.xml new file mode 100755 index 000000000..b7ec1ec8c --- /dev/null +++ b/modules/blocksupplier/config.xml @@ -0,0 +1,11 @@ + + + blocksupplier + Suppliers block + 1 + Adds a block displaying suppliers. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blocksupplier/de.php b/modules/blocksupplier/de.php new file mode 100644 index 000000000..e25df040a --- /dev/null +++ b/modules/blocksupplier/de.php @@ -0,0 +1,23 @@ +blocksupplier_9ae42413e3cb9596efe3857f75bad3df'] = 'Zulieferer-Block'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_efc027d2b1bb88bea7bd7eff273ca4c0'] = 'Fügt einen Block hinzu, der die Zulieferer anzeigt'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Ungültige Anzahl von Elementen'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_5b2e13ff6fa0da895d14bd56f2cb2d2d'] = 'Bitte aktivieren Sie mindestens eine Systemliste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_bfdff752293014f11f17122c92909ad5'] = 'Verwenden Sie eine Nur-Text-Liste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Anzeige'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_6a7f245843454cf4f28ad7c5e2572aa2'] = 'Elemente'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_e7968f07cac2995b0dd917475a04b8be'] = 'Zulieferer als Nur-Text-Liste anzeigen'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b0fa976774d2acf72f9c62e9ab73de38'] = 'Verwenden Sie eine Dropdown-Liste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_9df3ff87bf49ec39ccd11ae9aaaa593e'] = 'Zulieferer in einer Dropdownliste anzeigen'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_1814d65a76028fdfbadab64a5a8076df'] = 'Zulieferer'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_49fa2426b7903b3d4c89e2c1874d9346'] = 'Mehr darüber'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_ecf253735ac0cba84a9d2eeff1f1b87c'] = 'Alle Zulieferer'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_496689fbd342f80d30f1f266d060415a'] = 'Kein Zulieferer'; diff --git a/modules/blocksupplier/en.php b/modules/blocksupplier/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocksupplier/en.php @@ -0,0 +1,4 @@ +blocksupplier_9ae42413e3cb9596efe3857f75bad3df'] = 'Bloque proveedor'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_efc027d2b1bb88bea7bd7eff273ca4c0'] = 'Añadir un bloque para mostrar los proveedores'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'número de elementos no válido'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_5b2e13ff6fa0da895d14bd56f2cb2d2d'] = 'Por favor, elija al menos uno de la lista'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_bfdff752293014f11f17122c92909ad5'] = 'Usar una lista de texto plano'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Mostrar'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_6a7f245843454cf4f28ad7c5e2572aa2'] = 'elementos'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_e7968f07cac2995b0dd917475a04b8be'] = 'Para mostrar los proveedores en lista de texto plano'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b0fa976774d2acf72f9c62e9ab73de38'] = 'Usar un cuadro combinado'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_9df3ff87bf49ec39ccd11ae9aaaa593e'] = 'Para mostrar los proveedores dentro de un cuadro combinado'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_1814d65a76028fdfbadab64a5a8076df'] = 'Proveedores'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_49fa2426b7903b3d4c89e2c1874d9346'] = 'Más sobre'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_ecf253735ac0cba84a9d2eeff1f1b87c'] = 'Todos los proveedores'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_496689fbd342f80d30f1f266d060415a'] = 'No hay proveedores'; diff --git a/modules/blocksupplier/fr.php b/modules/blocksupplier/fr.php new file mode 100644 index 000000000..6006b52be --- /dev/null +++ b/modules/blocksupplier/fr.php @@ -0,0 +1,23 @@ +blocksupplier_9ae42413e3cb9596efe3857f75bad3df'] = 'Bloc fournisseurs'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_efc027d2b1bb88bea7bd7eff273ca4c0'] = 'Ajoute un bloc proposant les fournisseurs'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'Nombre d\'éléments invalide'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_5b2e13ff6fa0da895d14bd56f2cb2d2d'] = 'Merci d\'activer au moins un affichage de liste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_bfdff752293014f11f17122c92909ad5'] = 'Utiliser une liste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Afficher'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_6a7f245843454cf4f28ad7c5e2572aa2'] = 'éléments'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_e7968f07cac2995b0dd917475a04b8be'] = 'Afficher les fournisseurs sous forme de liste'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b0fa976774d2acf72f9c62e9ab73de38'] = 'Utiliser un menu déroulant'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_9df3ff87bf49ec39ccd11ae9aaaa593e'] = 'Afficher les fournisseurs avec un menu déroulant'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_1814d65a76028fdfbadab64a5a8076df'] = 'Fournisseurs'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_49fa2426b7903b3d4c89e2c1874d9346'] = 'En savoir plus à propos de'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_ecf253735ac0cba84a9d2eeff1f1b87c'] = 'Tous les fournisseurs'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_496689fbd342f80d30f1f266d060415a'] = 'Aucun fournisseur'; diff --git a/modules/blocksupplier/it.php b/modules/blocksupplier/it.php new file mode 100644 index 000000000..f70321883 --- /dev/null +++ b/modules/blocksupplier/it.php @@ -0,0 +1,23 @@ +blocksupplier_9ae42413e3cb9596efe3857f75bad3df'] = 'Blocco fornitori'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_efc027d2b1bb88bea7bd7eff273ca4c0'] = 'Aggiungi un blocco che mostra i fornitori'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_cf64d2d0bc5de5ce3d309d0e899d36fb'] = 'numero di elementi non valido'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_5b2e13ff6fa0da895d14bd56f2cb2d2d'] = 'Attiva almeno un elenco di sistema'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_bfdff752293014f11f17122c92909ad5'] = 'Utilizzare un elenco '; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b9987a246a537f4fe86f1f2e3d10dbdb'] = 'Visualizza'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_6a7f245843454cf4f28ad7c5e2572aa2'] = 'elementi'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_e7968f07cac2995b0dd917475a04b8be'] = 'Per visualizzare i fornitori come un elenco di testo'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_b0fa976774d2acf72f9c62e9ab73de38'] = 'Utilizza un elenco a cascata'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_9df3ff87bf49ec39ccd11ae9aaaa593e'] = 'Per visualizzare i fornitori come un elenco a cascata'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_1814d65a76028fdfbadab64a5a8076df'] = 'Fornitori'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_49fa2426b7903b3d4c89e2c1874d9346'] = 'Maggiori informazioni su'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_ecf253735ac0cba84a9d2eeff1f1b87c'] = 'Tutti i fornitori'; +$_MODULE['<{blocksupplier}prestashop>blocksupplier_496689fbd342f80d30f1f266d060415a'] = 'Nessun fornitore'; diff --git a/modules/blocksupplier/logo.gif b/modules/blocksupplier/logo.gif new file mode 100644 index 000000000..e5cb1f263 Binary files /dev/null and b/modules/blocksupplier/logo.gif differ diff --git a/modules/blocktags/blocktags.php b/modules/blocktags/blocktags.php new file mode 100644 index 000000000..6366514b7 --- /dev/null +++ b/modules/blocktags/blocktags.php @@ -0,0 +1,124 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +define('BLOCKTAGS_MAX_LEVEL', 3); + +class BlockTags extends Module +{ + function __construct() + { + $this->name = 'blocktags'; + $this->tab = 'front_office_features'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Tags block'); + $this->description = $this->l('Adds a block containing a tag cloud.'); + } + + function install() + { + if (parent::install() == false + OR $this->registerHook('leftColumn') == false + OR $this->registerHook('header') == false + OR Configuration::updateValue('BLOCKTAGS_NBR', 10) == false) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockTags')) + { + if (!$tagsNbr = Tools::getValue('tagsNbr') OR empty($tagsNbr)) + $output .= '
        '.$this->l('Please fill in the "tags displayed" field.').'
        '; + elseif ((int)($tagsNbr) == 0) + $output .= '
        '.$this->l('Invalid number.').'
        '; + else + { + Configuration::updateValue('BLOCKTAGS_NBR', (int)($tagsNbr)); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + +

        '.$this->l('Set the number of tags to be displayed in this block').'

        +
        +
        +
        +
        '; + return $output; + } + + /** + * Returns module content for left column + * + * @param array $params Parameters + * @return string Content + * + * @todo Links on tags (dedicated page or search ?) + */ + function hookLeftColumn($params) + { + global $smarty; + + $tags = Tag::getMainTags((int)($params['cookie']->id_lang), (int)(Configuration::get('BLOCKTAGS_NBR'))); + if (!sizeof($tags)) + return false; + foreach ($tags AS &$tag) + $tag['class'] = 'tag_level'.($tag['times'] > BLOCKTAGS_MAX_LEVEL ? BLOCKTAGS_MAX_LEVEL : $tag['times']); + $smarty->assign('tags', $tags); + + return $this->display(__FILE__, 'blocktags.tpl'); + } + + function hookRightColumn($params) + { + return $this->hookLeftColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blocktags.css', 'all'); + } + +} diff --git a/modules/blocktags/blocktags.tpl b/modules/blocktags/blocktags.tpl new file mode 100644 index 000000000..641cf522b --- /dev/null +++ b/modules/blocktags/blocktags.tpl @@ -0,0 +1,40 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Tags' mod='blocktags'}

        +

        +{if $tags} + {foreach from=$tags item=tag name=myLoop} + {$tag.name|escape:html:'UTF-8'} + {/foreach} +{else} + {l s='No tags specified yet' mod='blocktags'} +{/if} +

        +
        + diff --git a/modules/blocktags/config.xml b/modules/blocktags/config.xml new file mode 100755 index 000000000..3da43038f --- /dev/null +++ b/modules/blocktags/config.xml @@ -0,0 +1,11 @@ + + + blocktags + Tags block + 1 + Adds a block containing a tag cloud. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blocktags/de.php b/modules/blocktags/de.php new file mode 100644 index 000000000..67dc28a38 --- /dev/null +++ b/modules/blocktags/de.php @@ -0,0 +1,17 @@ +blocktags_f2568a62d4ac8d1d5b532556379772ba'] = 'Tags Block'; +$_MODULE['<{blocktags}prestashop>blocktags_a332910d45d955dad6c84817fe478e95'] = 'Fügt einen Block mit einer Tag-Cloud hinzu'; +$_MODULE['<{blocktags}prestashop>blocktags_4c1ef2cab0e711084a14f3d367a13c54'] = 'Sie müssen das Feld \"angezeigte Tags\" ausfüllen'; +$_MODULE['<{blocktags}prestashop>blocktags_73293a024e644165e9bf48f270af63a0'] = 'Ungültige Anzahl.'; +$_MODULE['<{blocktags}prestashop>blocktags_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blocktags}prestashop>blocktags_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blocktags}prestashop>blocktags_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blocktags}prestashop>blocktags_a2701a006c71c9097d80ea1ddaea8fa9'] = 'Angezeigte Tags'; +$_MODULE['<{blocktags}prestashop>blocktags_ba1ebc23c8fd03e9b97da2f856f70765'] = 'Stellen Sie die Anzahl der Tags ein, die in diesem Block angezeigt werden sollen'; +$_MODULE['<{blocktags}prestashop>blocktags_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blocktags}prestashop>blocktags_189f63f277cd73395561651753563065'] = 'Tags'; +$_MODULE['<{blocktags}prestashop>blocktags_49fa2426b7903b3d4c89e2c1874d9346'] = 'Mehr darüber'; +$_MODULE['<{blocktags}prestashop>blocktags_70d5e9f2bb7bcb17339709134ba3a2c6'] = 'noch keine Tags angegeben '; diff --git a/modules/blocktags/en.php b/modules/blocktags/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blocktags/en.php @@ -0,0 +1,4 @@ +blocktags_f2568a62d4ac8d1d5b532556379772ba'] = 'Bloque etiquetas'; +$_MODULE['<{blocktags}prestashop>blocktags_a332910d45d955dad6c84817fe478e95'] = 'Añadir un bloque que contenga una nube de etiquetas'; +$_MODULE['<{blocktags}prestashop>blocktags_4c1ef2cab0e711084a14f3d367a13c54'] = 'Debe completar el campo \"tags mostrados\"'; +$_MODULE['<{blocktags}prestashop>blocktags_73293a024e644165e9bf48f270af63a0'] = 'Número no válido'; +$_MODULE['<{blocktags}prestashop>blocktags_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmar'; +$_MODULE['<{blocktags}prestashop>blocktags_c888438d14855d7d96a2724ee9c306bd'] = 'Parámetros actualizados'; +$_MODULE['<{blocktags}prestashop>blocktags_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{blocktags}prestashop>blocktags_a2701a006c71c9097d80ea1ddaea8fa9'] = 'Etiquetas mostradas'; +$_MODULE['<{blocktags}prestashop>blocktags_ba1ebc23c8fd03e9b97da2f856f70765'] = 'Número de etiquetas mostradas en el bloque'; +$_MODULE['<{blocktags}prestashop>blocktags_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blocktags}prestashop>blocktags_189f63f277cd73395561651753563065'] = 'Etiquetas'; +$_MODULE['<{blocktags}prestashop>blocktags_49fa2426b7903b3d4c89e2c1874d9346'] = 'Más sobre'; +$_MODULE['<{blocktags}prestashop>blocktags_70d5e9f2bb7bcb17339709134ba3a2c6'] = 'Aún no hay etiquetas'; diff --git a/modules/blocktags/fr.php b/modules/blocktags/fr.php new file mode 100644 index 000000000..8f2de1583 --- /dev/null +++ b/modules/blocktags/fr.php @@ -0,0 +1,17 @@ +blocktags_f2568a62d4ac8d1d5b532556379772ba'] = 'Bloc tags'; +$_MODULE['<{blocktags}prestashop>blocktags_a332910d45d955dad6c84817fe478e95'] = 'Ajoute un bloc contenant les tags et un lien vers la recherche correspondante'; +$_MODULE['<{blocktags}prestashop>blocktags_4c1ef2cab0e711084a14f3d367a13c54'] = 'Vous devez remplir le champs \"tags affichés\"'; +$_MODULE['<{blocktags}prestashop>blocktags_73293a024e644165e9bf48f270af63a0'] = 'Nombre invalide.'; +$_MODULE['<{blocktags}prestashop>blocktags_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmer'; +$_MODULE['<{blocktags}prestashop>blocktags_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{blocktags}prestashop>blocktags_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{blocktags}prestashop>blocktags_a2701a006c71c9097d80ea1ddaea8fa9'] = 'Tags affichés'; +$_MODULE['<{blocktags}prestashop>blocktags_ba1ebc23c8fd03e9b97da2f856f70765'] = 'Nombre de tags affichés dans le bloc'; +$_MODULE['<{blocktags}prestashop>blocktags_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blocktags}prestashop>blocktags_189f63f277cd73395561651753563065'] = 'Tags'; +$_MODULE['<{blocktags}prestashop>blocktags_49fa2426b7903b3d4c89e2c1874d9346'] = 'En savoir plus à propos de'; +$_MODULE['<{blocktags}prestashop>blocktags_70d5e9f2bb7bcb17339709134ba3a2c6'] = 'Aucun tag spécifié pour le moment'; diff --git a/modules/blocktags/it.php b/modules/blocktags/it.php new file mode 100644 index 000000000..8d5e94d27 --- /dev/null +++ b/modules/blocktags/it.php @@ -0,0 +1,17 @@ +blocktags_f2568a62d4ac8d1d5b532556379772ba'] = 'Blocco tags'; +$_MODULE['<{blocktags}prestashop>blocktags_a332910d45d955dad6c84817fe478e95'] = 'Aggiunge un blocco contenente una nuvola di tag '; +$_MODULE['<{blocktags}prestashop>blocktags_4c1ef2cab0e711084a14f3d367a13c54'] = 'È necessario compilare il campo \"tag visualizzati\"'; +$_MODULE['<{blocktags}prestashop>blocktags_73293a024e644165e9bf48f270af63a0'] = 'Numero non valido.'; +$_MODULE['<{blocktags}prestashop>blocktags_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blocktags}prestashop>blocktags_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blocktags}prestashop>blocktags_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blocktags}prestashop>blocktags_a2701a006c71c9097d80ea1ddaea8fa9'] = 'Tag visualizzati'; +$_MODULE['<{blocktags}prestashop>blocktags_ba1ebc23c8fd03e9b97da2f856f70765'] = 'Imposta il numero di tag da visualizzare in questo blocco'; +$_MODULE['<{blocktags}prestashop>blocktags_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blocktags}prestashop>blocktags_189f63f277cd73395561651753563065'] = 'Tag'; +$_MODULE['<{blocktags}prestashop>blocktags_49fa2426b7903b3d4c89e2c1874d9346'] = 'Maggiori informazioni su'; +$_MODULE['<{blocktags}prestashop>blocktags_70d5e9f2bb7bcb17339709134ba3a2c6'] = 'Nessun tag ancora specificato '; diff --git a/modules/blocktags/logo.gif b/modules/blocktags/logo.gif new file mode 100644 index 000000000..291bfc764 Binary files /dev/null and b/modules/blocktags/logo.gif differ diff --git a/modules/blockuserinfo/blockuserinfo.php b/modules/blockuserinfo/blockuserinfo.php new file mode 100644 index 000000000..8659c6223 --- /dev/null +++ b/modules/blockuserinfo/blockuserinfo.php @@ -0,0 +1,80 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockUserInfo extends Module +{ + public function __construct() + { + $this->name = 'blockuserinfo'; + $this->tab = 'front_office_features'; + $this->version = 0.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('User info block'); + $this->description = $this->l('Adds a block that displays information about the customer.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); + } + + /** + * Returns module content for header + * + * @param array $params Parameters + * @return string Content + */ + public function hookTop($params) + { + if (!$this->active) + return; + global $smarty, $cookie, $cart; + $smarty->assign(array( + 'cart' => $cart, + 'cart_qties' => $cart->nbProducts(), + 'logged' => $cookie->isLogged(), + 'customerName' => ($cookie->logged ? $cookie->customer_firstname.' '.$cookie->customer_lastname : false), + 'firstName' => ($cookie->logged ? $cookie->customer_firstname : false), + 'lastName' => ($cookie->logged ? $cookie->customer_lastname : false), + 'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order' + )); + return $this->display(__FILE__, 'blockuserinfo.tpl'); + } + + public function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockuserinfo.css', 'all'); + } +} + + diff --git a/modules/blockuserinfo/blockuserinfo.tpl b/modules/blockuserinfo/blockuserinfo.tpl new file mode 100644 index 000000000..bbda8698b --- /dev/null +++ b/modules/blockuserinfo/blockuserinfo.tpl @@ -0,0 +1,62 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        + {l s='Welcome' mod='blockuserinfo'}, + {if $cookie->isLogged()} + {$cookie->customer_firstname} {$cookie->customer_lastname} + ({l s='Log out' mod='blockuserinfo'}) + {else} + {l s='Log in' mod='blockuserinfo'} + {/if} +

        +
          + {if !$PS_CATALOG_MODE} +
        • + {l s='Cart:' mod='blockuserinfo'} + {$cart_qties} + {l s='product' mod='blockuserinfo'} + {l s='products' mod='blockuserinfo'} + {if $cart_qties >= 0} + + {if $priceDisplay == 1} + {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} + {convertPrice price=$cart->getOrderTotal(false, $blockuser_cart_flag)} + {else} + {assign var='blockuser_cart_flag' value='Cart::BOTH_WITHOUT_SHIPPING'|constant} + {convertPrice price=$cart->getOrderTotal(true, $blockuser_cart_flag)} + {/if} + + {/if} + {l s='(empty)' mod='blockuserinfo'} +
        • + {/if} +
        • {l s='Your Account' mod='blockuserinfo'}
        • +
        +
        + diff --git a/modules/blockuserinfo/config.xml b/modules/blockuserinfo/config.xml new file mode 100755 index 000000000..55536b9f3 --- /dev/null +++ b/modules/blockuserinfo/config.xml @@ -0,0 +1,11 @@ + + + blockuserinfo + User info block + 0.1 + Adds a block that displays information about the customer. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/blockuserinfo/de.php b/modules/blockuserinfo/de.php new file mode 100644 index 000000000..3a4ef582f --- /dev/null +++ b/modules/blockuserinfo/de.php @@ -0,0 +1,16 @@ +blockuserinfo_a2e9cd952cda8ba167e62b25a496c6c1'] = 'Benutzerinfo-Block'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_970a31aa19d205f92ccfd1913ca04dc0'] = 'Fügt einen Block hinzu, der Informationen über den Kunden anzeigt'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_83218ac34c1834c26781fe4bde918ee4'] = 'Willkommen'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4b877ba8588b19f1b278510bf2b57ebb'] = 'Abmelden'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4394c8d8e63c470de62ced3ae85de5ae'] = 'Abmelden'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_bffe9a3c9a7e00ba00a11749e022d911'] = 'Anmelden'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_12641546686fe11aaeb3b3c43a18c1b3'] = 'Ihr Warenkorb'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_7fc68677a16caa0f02826182468617e6'] = 'Warenkorb:'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_f5bf48aa40cad7891eb709fcf1fde128'] = 'Produkt'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_86024cad1e83101d97359d7351051156'] = 'Produkte'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(Leer)'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_a0623b78a5f2cfe415d9dbbd4428ea40'] = 'Ihr Konto'; diff --git a/modules/blockuserinfo/en.php b/modules/blockuserinfo/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockuserinfo/en.php @@ -0,0 +1,4 @@ +blockuserinfo_a2e9cd952cda8ba167e62b25a496c6c1'] = 'Bloque de información personal'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_970a31aa19d205f92ccfd1913ca04dc0'] = 'Añadir un bloque para mostrar información acerca del cliente'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_83218ac34c1834c26781fe4bde918ee4'] = 'Bienvenido'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4b877ba8588b19f1b278510bf2b57ebb'] = 'Cerrer sesión'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4394c8d8e63c470de62ced3ae85de5ae'] = 'Salir'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_bffe9a3c9a7e00ba00a11749e022d911'] = 'Entrar'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_12641546686fe11aaeb3b3c43a18c1b3'] = 'Su carrito de la compra'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_7fc68677a16caa0f02826182468617e6'] = 'Carrito:'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_f5bf48aa40cad7891eb709fcf1fde128'] = 'producto'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_86024cad1e83101d97359d7351051156'] = 'productos'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_9e65b51e82f2a9b9f72ebe3e083582bb'] = 'vacío'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_a0623b78a5f2cfe415d9dbbd4428ea40'] = 'Su cuenta'; diff --git a/modules/blockuserinfo/fr.php b/modules/blockuserinfo/fr.php new file mode 100644 index 000000000..b5cf3171d --- /dev/null +++ b/modules/blockuserinfo/fr.php @@ -0,0 +1,16 @@ +blockuserinfo_a2e9cd952cda8ba167e62b25a496c6c1'] = 'Bloc informations clients'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_970a31aa19d205f92ccfd1913ca04dc0'] = 'Ajoute un bloc avec des liens utiles pour le client (login, déconnexion...)'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_83218ac34c1834c26781fe4bde918ee4'] = 'Bienvenue'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4b877ba8588b19f1b278510bf2b57ebb'] = 'Me déconnecter'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4394c8d8e63c470de62ced3ae85de5ae'] = 'déconnexion'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_bffe9a3c9a7e00ba00a11749e022d911'] = 'identifiez-vous'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_12641546686fe11aaeb3b3c43a18c1b3'] = 'Votre panier d\'achat'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_7fc68677a16caa0f02826182468617e6'] = 'Panier :'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_f5bf48aa40cad7891eb709fcf1fde128'] = 'produit'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_86024cad1e83101d97359d7351051156'] = 'produits'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vide)'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_a0623b78a5f2cfe415d9dbbd4428ea40'] = 'Votre compte'; diff --git a/modules/blockuserinfo/it.php b/modules/blockuserinfo/it.php new file mode 100644 index 000000000..48eb7d1ea --- /dev/null +++ b/modules/blockuserinfo/it.php @@ -0,0 +1,16 @@ +blockuserinfo_a2e9cd952cda8ba167e62b25a496c6c1'] = 'Blocco info utente '; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_970a31aa19d205f92ccfd1913ca04dc0'] = 'Aggiungi un blocco che visualizza le informazioni sul cliente'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_83218ac34c1834c26781fe4bde918ee4'] = 'Benvenuti'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4b877ba8588b19f1b278510bf2b57ebb'] = 'Fammi uscire'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_4394c8d8e63c470de62ced3ae85de5ae'] = 'Esci'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_bffe9a3c9a7e00ba00a11749e022d911'] = 'Entra'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_12641546686fe11aaeb3b3c43a18c1b3'] = 'Il tuo carrello'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_7fc68677a16caa0f02826182468617e6'] = 'Carrello:'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_f5bf48aa40cad7891eb709fcf1fde128'] = 'prodotto'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_86024cad1e83101d97359d7351051156'] = 'prodotti'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vuoto)'; +$_MODULE['<{blockuserinfo}prestashop>blockuserinfo_a0623b78a5f2cfe415d9dbbd4428ea40'] = 'Il tuo account'; diff --git a/modules/blockuserinfo/logo.gif b/modules/blockuserinfo/logo.gif new file mode 100644 index 000000000..d38b9c5b9 Binary files /dev/null and b/modules/blockuserinfo/logo.gif differ diff --git a/modules/blockviewed/blockviewed.php b/modules/blockviewed/blockviewed.php new file mode 100644 index 000000000..66fab5d28 --- /dev/null +++ b/modules/blockviewed/blockviewed.php @@ -0,0 +1,190 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockViewed extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + function __construct() + { + $this->name = 'blockviewed'; + $this->tab = 'front_office_features'; + $this->version = 0.9; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Viewed products block'); + $this->description = $this->l('Adds a block displaying last-viewed products.'); + } + + function install() + { + if (!parent::install() + OR !$this->registerHook('leftColumn') + OR !$this->registerHook('header') + OR !Configuration::updateValue('PRODUCTS_VIEWED_NBR', 2)) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitBlockViewed')) + { + if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr)) + $output .= '
        '.$this->l('You must fill in the \'Products displayed\' field.').'
        '; + elseif ((int)($productNbr) == 0) + $output .= '
        '.$this->l('Invalid number.').'
        '; + else + { + Configuration::updateValue('PRODUCTS_VIEWED_NBR', (int)($productNbr)); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + +

        '.$this->l('Define the number of products displayed in this block').'

        +
        +
        +
        +
        '; + return $output; + } + + function hookRightColumn($params) + { + global $link, $smarty, $cookie; + + $id_product = (int)(Tools::getValue('id_product')); + $productsViewed = (isset($params['cookie']->viewed) AND !empty($params['cookie']->viewed)) ? array_slice(explode(',', $params['cookie']->viewed), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); + + if (sizeof($productsViewed)) + { + $defaultCover = Language::getIsoById($params['cookie']->id_lang).'-default'; + + $productIds = implode(',', $productsViewed); + $productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT i.id_image, p.id_product, il.legend, p.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1) + LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image) + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = p.id_category_default) + WHERE p.id_product IN ('.$productIds.') + AND pl.id_lang = '.(int)($params['cookie']->id_lang).' + AND cl.id_lang = '.(int)($params['cookie']->id_lang) + ); + + $productsImagesArray = array(); + foreach ($productsImages AS $pi) + $productsImagesArray[$pi['id_product']] = $pi; + + $productsViewedObj = array(); + foreach ($productsViewed AS $productViewed) + { + $obj = (object)'Product'; + if (!isset($productsImagesArray[$productViewed]) || (!$obj->active = $productsImagesArray[$productViewed]['active'])) + continue; + else + { + $obj->id = (int)($productsImagesArray[$productViewed]['id_product']); + $obj->cover = (int)($productsImagesArray[$productViewed]['id_product']).'-'.(int)($productsImagesArray[$productViewed]['id_image']); + $obj->legend = $productsImagesArray[$productViewed]['legend']; + $obj->name = $productsImagesArray[$productViewed]['name']; + $obj->description_short = $productsImagesArray[$productViewed]['description_short']; + $obj->link_rewrite = $productsImagesArray[$productViewed]['link_rewrite']; + $obj->category_rewrite = $productsImagesArray[$productViewed]['category_rewrite']; + + if (!isset($obj->cover) || !$productsImagesArray[$productViewed]['id_image']) + { + $obj->cover = $defaultCover; + $obj->legend = ''; + } + $productsViewedObj[] = $obj; + } + } + + if ($id_product AND !in_array($id_product, $productsViewed)) + { + // Check if the user to the right of access to this product + $result = Db::getInstance()->getRow(' + SELECT COUNT(cug.`id_customer`) AS total + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`) + LEFT JOIN `'._DB_PREFIX_.'customer_group` cug ON (cug.`id_group` = cg.`id_group`) + WHERE p.`id_product` = '.(int)($id_product).' + '.($cookie->id_customer ? 'AND cug.`id_customer` = '.(int)($cookie->id_customer) : + 'AND cg.`id_group` = 1') + ); + if ($result['total']) + array_unshift($productsViewed, $id_product); + } + $viewed = ''; + foreach ($productsViewed AS $id_product_viewed) + $viewed .= (int)($id_product_viewed).','; + $params['cookie']->viewed = rtrim($viewed, ','); + + if (!sizeof($productsViewedObj)) + return ; + + $smarty->assign(array( + 'productsViewedObj' => $productsViewedObj, + 'mediumSize' => Image::getSize('medium'))); + + return $this->display(__FILE__, 'blockviewed.tpl'); + } + elseif ($id_product) + $params['cookie']->viewed = (int)($id_product); + return ; + } + + function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockviewed.css', 'all'); + } +} diff --git a/modules/blockviewed/blockviewed.tpl b/modules/blockviewed/blockviewed.tpl new file mode 100644 index 000000000..dee4247fb --- /dev/null +++ b/modules/blockviewed/blockviewed.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        +

        {l s='Viewed products' mod='blockviewed'}

        +
        + +
        +
        \ No newline at end of file diff --git a/modules/blockviewed/config.xml b/modules/blockviewed/config.xml new file mode 100755 index 000000000..2e4bd2683 --- /dev/null +++ b/modules/blockviewed/config.xml @@ -0,0 +1,11 @@ + + + blockviewed + Viewed products block + 0.9 + Adds a block displaying last-viewed products. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockviewed/de.php b/modules/blockviewed/de.php new file mode 100644 index 000000000..ca8b1c3f7 --- /dev/null +++ b/modules/blockviewed/de.php @@ -0,0 +1,16 @@ +blockviewed_859e85774d372c6084d62d02324a1cc3'] = 'Angesehene Produkte-Block'; +$_MODULE['<{blockviewed}prestashop>blockviewed_fad87bb9a90d9e42854af13633aac252'] = 'Fügt einen Block hinzu, der die zuletzt angesehenen Produkte anzeigt'; +$_MODULE['<{blockviewed}prestashop>blockviewed_2e57399079951d84b435700493b8a8c1'] = 'Sie müssen das Feld \"Angezeigte Produkte\" ausfüllen'; +$_MODULE['<{blockviewed}prestashop>blockviewed_73293a024e644165e9bf48f270af63a0'] = 'Ungültige Anzahl.'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{blockviewed}prestashop>blockviewed_e451e6943bb539d1bd804d2ede6474b5'] = 'Angezeigte Produkte'; +$_MODULE['<{blockviewed}prestashop>blockviewed_8ce2b5b3ffa27a8a66220a49357a1582'] = 'Definieren Sie die Anzahl der Produkte, die in diesem Block angezeigt werden'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockviewed}prestashop>blockviewed_43560641f91e63dc83682bc598892fa1'] = 'Angesehene Produkte'; +$_MODULE['<{blockviewed}prestashop>blockviewed_49fa2426b7903b3d4c89e2c1874d9346'] = 'Mehr darüber'; diff --git a/modules/blockviewed/en.php b/modules/blockviewed/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockviewed/en.php @@ -0,0 +1,4 @@ +blockviewed_859e85774d372c6084d62d02324a1cc3'] = 'Bloque de productos vistos'; +$_MODULE['<{blockviewed}prestashop>blockviewed_fad87bb9a90d9e42854af13633aac252'] = 'Añadir un bloque para mostrar los últimos productos vistos'; +$_MODULE['<{blockviewed}prestashop>blockviewed_2e57399079951d84b435700493b8a8c1'] = 'Debe rellenar el campo\'Productos mostrados'; +$_MODULE['<{blockviewed}prestashop>blockviewed_73293a024e644165e9bf48f270af63a0'] = 'Número no válido.'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{blockviewed}prestashop>blockviewed_e451e6943bb539d1bd804d2ede6474b5'] = 'Productos mostrados'; +$_MODULE['<{blockviewed}prestashop>blockviewed_8ce2b5b3ffa27a8a66220a49357a1582'] = 'Definir el número de productos mostrados en cada bloque'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockviewed}prestashop>blockviewed_43560641f91e63dc83682bc598892fa1'] = 'Productos más vistos'; +$_MODULE['<{blockviewed}prestashop>blockviewed_49fa2426b7903b3d4c89e2c1874d9346'] = 'Más sobre'; diff --git a/modules/blockviewed/fr.php b/modules/blockviewed/fr.php new file mode 100644 index 000000000..73feb519a --- /dev/null +++ b/modules/blockviewed/fr.php @@ -0,0 +1,16 @@ +blockviewed_859e85774d372c6084d62d02324a1cc3'] = 'Bloc produits déjà vus'; +$_MODULE['<{blockviewed}prestashop>blockviewed_fad87bb9a90d9e42854af13633aac252'] = 'Ajoute un bloc proposant les derniers produits vus par le client'; +$_MODULE['<{blockviewed}prestashop>blockviewed_2e57399079951d84b435700493b8a8c1'] = 'Champ \"Produits vus\" obligatoire'; +$_MODULE['<{blockviewed}prestashop>blockviewed_73293a024e644165e9bf48f270af63a0'] = 'Nombre invalide.'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{blockviewed}prestashop>blockviewed_e451e6943bb539d1bd804d2ede6474b5'] = 'Nombre de produits affichés'; +$_MODULE['<{blockviewed}prestashop>blockviewed_8ce2b5b3ffa27a8a66220a49357a1582'] = 'Détermine le nombre de produits affichés dans ce bloc'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{blockviewed}prestashop>blockviewed_43560641f91e63dc83682bc598892fa1'] = 'Déjà vus'; +$_MODULE['<{blockviewed}prestashop>blockviewed_49fa2426b7903b3d4c89e2c1874d9346'] = 'En savoir plus à propos de'; diff --git a/modules/blockviewed/it.php b/modules/blockviewed/it.php new file mode 100644 index 000000000..86a148f9d --- /dev/null +++ b/modules/blockviewed/it.php @@ -0,0 +1,16 @@ +blockviewed_859e85774d372c6084d62d02324a1cc3'] = 'Blocco prodotti visti'; +$_MODULE['<{blockviewed}prestashop>blockviewed_fad87bb9a90d9e42854af13633aac252'] = 'Aggiunge un blocco che visualizza i prodotti visti recentemente'; +$_MODULE['<{blockviewed}prestashop>blockviewed_2e57399079951d84b435700493b8a8c1'] = 'È necessario compilare il campo \"prodotti esposti\"'; +$_MODULE['<{blockviewed}prestashop>blockviewed_73293a024e644165e9bf48f270af63a0'] = 'Numero non valido.'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockviewed}prestashop>blockviewed_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{blockviewed}prestashop>blockviewed_e451e6943bb539d1bd804d2ede6474b5'] = 'Prodotti esposti'; +$_MODULE['<{blockviewed}prestashop>blockviewed_8ce2b5b3ffa27a8a66220a49357a1582'] = 'Definisci il numero di prodotti esposti in questo blocco'; +$_MODULE['<{blockviewed}prestashop>blockviewed_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockviewed}prestashop>blockviewed_43560641f91e63dc83682bc598892fa1'] = 'Prodotti visti'; +$_MODULE['<{blockviewed}prestashop>blockviewed_49fa2426b7903b3d4c89e2c1874d9346'] = 'Maggiori informazioni su'; diff --git a/modules/blockviewed/logo.gif b/modules/blockviewed/logo.gif new file mode 100644 index 000000000..d1258171c Binary files /dev/null and b/modules/blockviewed/logo.gif differ diff --git a/modules/blockwishlist/WishList.php b/modules/blockwishlist/WishList.php new file mode 100644 index 000000000..69a8fe34a --- /dev/null +++ b/modules/blockwishlist/WishList.php @@ -0,0 +1,517 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class WishList extends ObjectModel +{ + /** @var integer Wishlist ID */ + public $id; + + /** @var integer Customer ID */ + public $id_customer; + + /** @var integer Token */ + public $token; + + /** @var integer Name */ + public $name; + + /** @var string Object creation date */ + public $date_add; + + /** @var string Object last modification date */ + public $date_upd; + + protected $fieldsSize = array('name' => 64, 'token' => 64); + protected $fieldsRequired = array('id_customer', 'name', 'token'); + protected $fieldsValidate = array('id_customer' => 'isUnsignedId', 'name' => 'isMessage', + 'token' => 'isMessage'); + protected $table = 'wishlist'; + protected $identifier = 'id_wishlist'; + + public function getFields() + { + parent::validateFields(); + $fields['id_customer'] = (int)($this->id_customer); + $fields['token'] = pSQL($this->token); + $fields['name'] = pSQL($this->name); + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return ($fields); + } + + public function delete() + { + global $cookie; + + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'wishlist_email` WHERE `id_wishlist` = '.(int)($this->id)); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'wishlist_product` WHERE `id_wishlist` = '.(int)($this->id)); + if (isset($cookie->id_wishlist)) + unset($cookie->id_wishlist); + + return (parent::delete()); + } + + /** + * Increment counter + * + * @return boolean succeed + */ + static public function incCounter($id_wishlist) + { + if (!Validate::isUnsignedId($id_wishlist)) + die (Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT `counter` + FROM `'._DB_PREFIX_.'wishlist` + WHERE `id_wishlist` = '.(int)($id_wishlist)); + if ($result == false OR !sizeof($result) OR empty($result) === true) + return (false); + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist` SET + `counter` = '.(int)($result['counter'] + 1).' + WHERE `id_wishlist` = '.(int)($id_wishlist))); + } + + + static public function isExistsByNameForUser($name) + { + global $cookie; + + return Db::getInstance()->getValue(' + SELECT COUNT(*) AS total + FROM `'._DB_PREFIX_.'wishlist` + WHERE `name` = \''.pSQL($name).'\' + AND `id_customer` = '.(int)($cookie->id_customer) + ); + } + + /** + * Return true if wishlist exists else false + * + * @return boolean exists + */ + static public function exists($id_wishlist, $id_customer, $return = false) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_customer)) + die (Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT `id_wishlist`, `name`, `token` + FROM `'._DB_PREFIX_.'wishlist` + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_customer` = '.(int)($id_customer)); + if (empty($result) === false AND $result != false AND sizeof($result)) + { + if ($return === false) + return (true); + else + return ($result); + } + return (false); + } + + /** + * Get ID wishlist by Token + * + * @return array Results + */ + static public function getByToken($token) + { + if (!Validate::isMessage($token)) + die (Tools::displayError()); + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT w.`id_wishlist`, w.`name`, w.`id_customer`, c.`firstname`, c.`lastname` + FROM `'._DB_PREFIX_.'wishlist` w + INNER JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = w.`id_customer` + WHERE `token` = \''.pSQL($token).'\'')); + } + + /** + * Get Wishlists by Customer ID + * + * @return array Results + */ + static public function getByIdCustomer($id_customer) + { + if (!Validate::isUnsignedId($id_customer)) + die (Tools::displayError()); + return (Db::getInstance()->ExecuteS(' + SELECT w.`id_wishlist`, w.`name`, w.`token`, w.`date_add`, w.`date_upd`, w.`counter` + FROM `'._DB_PREFIX_.'wishlist` w + WHERE `id_customer` = '.(int)($id_customer).' + ORDER BY w.`name` ASC')); + } + + static public function refreshWishList($id_wishlist) + { + $old_carts = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT wp.id_product, wp.id_product_attribute, wpc.id_cart, UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(wpc.date_add) AS timecart + FROM `'._DB_PREFIX_.'wishlist_product_cart` wpc + JOIN `'._DB_PREFIX_.'wishlist_product` wp ON (wp.id_wishlist_product = wpc.id_wishlist_product) + JOIN `'._DB_PREFIX_.'cart` c ON (c.id_cart = wpc.id_cart) + JOIN `'._DB_PREFIX_.'cart_product` cp ON (wpc.id_cart = cp.id_cart) + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.id_cart = c.id_cart) + WHERE (wp.id_wishlist='.(int)($id_wishlist).' AND o.id_cart IS NULL) + HAVING timecart >= 3600*6'); + + if(isset($old_carts) AND $old_carts != false) + foreach ($old_carts AS $old_cart) + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'cart_product` + WHERE id_cart='.(int)($old_cart['id_cart']).' AND id_product='.(int)($old_cart['id_product']).' AND id_product_attribute='.(int)($old_cart['id_product_attribute']) + ); + + $freshwish = Db::getInstance()->ExecuteS(' + SELECT wpc.id_cart, wpc.id_wishlist_product + FROM `'._DB_PREFIX_.'wishlist_product_cart` wpc + JOIN `'._DB_PREFIX_.'wishlist_product` wp ON (wpc.id_wishlist_product = wp.id_wishlist_product) + JOIN `'._DB_PREFIX_.'cart` c ON (c.id_cart = wpc.id_cart) + LEFT JOIN `'._DB_PREFIX_.'cart_product` cp ON (cp.id_cart = wpc.id_cart AND cp.id_product = wp.id_product AND cp.id_product_attribute = wp.id_product_attribute) + WHERE (wp.id_wishlist = '.(int)($id_wishlist).' AND ((cp.id_product IS NULL AND cp.id_product_attribute IS NULL))) + '); + $res = Db::getInstance()->ExecuteS(' + SELECT wp.id_wishlist_product, cp.quantity AS cart_quantity, wpc.quantity AS wish_quantity, wpc.id_cart + FROM `'._DB_PREFIX_.'wishlist_product_cart` wpc + JOIN `'._DB_PREFIX_.'wishlist_product` wp ON (wp.id_wishlist_product = wpc.id_wishlist_product) + JOIN `'._DB_PREFIX_.'cart` c ON (c.id_cart = wpc.id_cart) + JOIN `'._DB_PREFIX_.'cart_product` cp ON (cp.id_cart = wpc.id_cart AND cp.id_product = wp.id_product AND cp.id_product_attribute = wp.id_product_attribute) + WHERE wp.id_wishlist='.(int)($id_wishlist) + ); + + if(isset($res) AND $res != false) + foreach ($res AS $refresh) + if($refresh['wish_quantity'] > $refresh['cart_quantity']) + { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product` + SET `quantity`= `quantity` + '.((int)($refresh['wish_quantity']) - (int)($refresh['cart_quantity'])).' + WHERE id_wishlist_product='.(int)($refresh['id_wishlist_product']) + ); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product_cart` + SET `quantity`='.(int)($refresh['cart_quantity']).' + WHERE id_wishlist_product='.(int)($refresh['id_wishlist_product']).' AND id_cart='.(int)($refresh['id_cart']) + ); + } + if(isset($freshwish) AND $freshwish != false) + foreach ($freshwish AS $prodcustomer) + { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product` SET `quantity`=`quantity` + + ( + SELECT `quantity` FROM `'._DB_PREFIX_.'wishlist_product_cart` + WHERE `id_wishlist_product`='.(int)($prodcustomer['id_wishlist_product']).' AND `id_cart`='.(int)($prodcustomer['id_cart']).' + ) + WHERE `id_wishlist_product`='.(int)($prodcustomer['id_wishlist_product']).' AND `id_wishlist`='.(int)($id_wishlist) + ); + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'wishlist_product_cart` + WHERE `id_wishlist_product`='.(int)($prodcustomer['id_wishlist_product']).' AND `id_cart`='.(int)($prodcustomer['id_cart']) + ); + } + } + + /** + * Get Wishlist products by Customer ID + * + * @return array Results + */ + static public function getProductByIdCustomer($id_wishlist, $id_customer, $id_lang, $id_product = null, $quantity = false) + { + if (!Validate::isUnsignedId($id_customer) OR + !Validate::isUnsignedId($id_lang) OR + !Validate::isUnsignedId($id_wishlist)) + die (Tools::displayError()); + $products = Db::getInstance()->ExecuteS(' + SELECT wp.`id_product`, wp.`quantity`, p.`quantity` AS product_quantity, pl.`name`, wp.`id_product_attribute`, wp.`priority`, pl.link_rewrite, cl.link_rewrite AS category_rewrite + FROM `'._DB_PREFIX_.'wishlist_product` wp + JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = wp.`id_product` + JOIN `'._DB_PREFIX_.'product_lang` pl ON pl.`id_product` = wp.`id_product` + JOIN `'._DB_PREFIX_.'wishlist` w ON w.`id_wishlist` = wp.`id_wishlist` + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = p.`id_category_default` AND cl.id_lang='.(int)$id_lang.' + WHERE w.`id_customer` = '.(int)($id_customer).' + AND pl.`id_lang` = '.(int)($id_lang).' + AND wp.`id_wishlist` = '.(int)($id_wishlist). + (empty($id_product) === false ? ' AND wp.`id_product` = '.(int)($id_product) : ''). + ($quantity == true ? ' AND wp.`quantity` != 0': '')); + if (empty($products) === true OR !sizeof($products)) + return array(); + for ($i = 0; $i < sizeof($products); ++$i) + { + if (isset($products[$i]['id_product_attribute']) AND + Validate::isUnsignedInt($products[$i]['id_product_attribute'])) + { + $result = Db::getInstance()->ExecuteS(' + SELECT al.`name` AS attribute_name, pa.`quantity` AS "attribute_quantity" + FROM `'._DB_PREFIX_.'product_attribute_combination` pac + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON (a.`id_attribute` = pac.`id_attribute`) + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON (ag.`id_attribute_group` = a.`id_attribute_group`) + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pac.`id_product_attribute` = pa.`id_product_attribute`) + WHERE pac.`id_product_attribute` = '.(int)($products[$i]['id_product_attribute'])); + $products[$i]['attributes_small'] = ''; + if ($result) + foreach ($result AS $k => $row) + $products[$i]['attributes_small'] .= $row['attribute_name'].', '; + $products[$i]['attributes_small'] = rtrim($products[$i]['attributes_small'], ', '); + if (isset($result[0])) + $products[$i]['attribute_quantity'] = $result[0]['attribute_quantity']; + } + else + $products[$i]['attribute_quantity'] = $products[$i]['product_quantity']; + } + return ($products); + } + + /** + * Get Wishlists number products by Customer ID + * + * @return array Results + */ + static public function getInfosByIdCustomer($id_customer) + { + if (!Validate::isUnsignedId($id_customer)) + die (Tools::displayError()); + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT SUM(wp.`quantity`) AS nbProducts, wp.`id_wishlist` + FROM `'._DB_PREFIX_.'wishlist_product` wp + INNER JOIN `'._DB_PREFIX_.'wishlist` w ON (w.`id_wishlist` = wp.`id_wishlist`) + WHERE w.`id_customer` = '.(int)($id_customer).' + GROUP BY w.`id_wishlist` + ORDER BY w.`name` ASC')); + } + + /** + * Add product to ID wishlist + * + * @return boolean succeed + */ + static public function addProduct($id_wishlist, $id_customer, $id_product, $id_product_attribute, $quantity) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_customer) OR + !Validate::isUnsignedId($id_product) OR + !Validate::isUnsignedId($quantity)) + die (Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT wp.`quantity` + FROM `'._DB_PREFIX_.'wishlist_product` wp + JOIN `'._DB_PREFIX_.'wishlist` w ON (w.`id_wishlist` = wp.`id_wishlist`) + WHERE wp.`id_wishlist` = '.(int)($id_wishlist).' + AND w.`id_customer` = '.(int)($id_customer).' + AND wp.`id_product` = '.(int)($id_product).' + AND wp.`id_product_attribute` = '.(int)($id_product_attribute)); + if (empty($result) === false AND sizeof($result)) + { + if (($result['quantity'] + $quantity) <= 0) + return (WishList::removeProduct($id_wishlist, $id_customer, $id_product, $id_product_attribute)); + else + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product` SET + `quantity` = '.(int)($quantity + $result['quantity']).' + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute))); + } + else + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'wishlist_product` (`id_wishlist`, `id_product`, `id_product_attribute`, `quantity`, `priority`) VALUES( + '.(int)($id_wishlist).', + '.(int)($id_product).', + '.(int)($id_product_attribute).', + '.(int)($quantity).', 1)')); + + } + + /** + * Update product to wishlist + * + * @return boolean succeed + */ + static public function updateProduct($id_wishlist, $id_product, $id_product_attribute, $priority, $quantity) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_product) OR + !Validate::isUnsignedId($quantity) OR + $priority < 0 OR $priority > 2) + die (Tools::displayError()); + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product` SET + `priority` = '.(int)($priority).', + `quantity` = '.(int)($quantity).' + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute))); + } + + /** + * Remove product from wishlist + * + * @return boolean succeed + */ + static public function removeProduct($id_wishlist, $id_customer, $id_product, $id_product_attribute) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_customer) OR + !Validate::isUnsignedId($id_product)) + die (Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT w.`id_wishlist`, wp.`id_wishlist_product` + FROM `'._DB_PREFIX_.'wishlist` w + LEFT JOIN `'._DB_PREFIX_.'wishlist_product` wp ON (wp.`id_wishlist` = w.`id_wishlist`) + WHERE `id_customer` = '.(int)($id_customer).' + AND w.`id_wishlist` = '.(int)($id_wishlist)); + if (empty($result) === true OR + $result === false OR + !sizeof($result) OR + $result['id_wishlist'] != $id_wishlist) + return (false); + // Delete product in wishlist_product_cart + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'wishlist_product_cart` + WHERE `id_wishlist_product` = '.(int)($result['id_wishlist_product']) + ); + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'wishlist_product` + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute) + ); + } + + /** + * Return bought product by ID wishlist + * + * @return Array results + */ + static public function getBoughtProduct($id_wishlist) + { + + if (!Validate::isUnsignedId($id_wishlist)) + die (Tools::displayError()); + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT wp.`id_product`, wp.`id_product_attribute`, wpc.`quantity`, wpc.`date_add`, cu.`lastname`, cu.`firstname` + FROM `'._DB_PREFIX_.'wishlist_product_cart` wpc + JOIN `'._DB_PREFIX_.'wishlist_product` wp ON (wp.id_wishlist_product = wpc.id_wishlist_product) + JOIN `'._DB_PREFIX_.'cart` ca ON (ca.id_cart = wpc.id_cart) + JOIN `'._DB_PREFIX_.'customer` cu ON (cu.`id_customer` = ca.`id_customer`) + WHERE wp.`id_wishlist` = '.(int)($id_wishlist))); + } + + /** + * Add bought product + * + * @return boolean succeed + */ + static public function addBoughtProduct($id_wishlist, $id_product, $id_product_attribute, $id_cart, $quantity) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_product) OR + !Validate::isUnsignedId($quantity)) + die (Tools::displayError()); + $result = Db::getInstance()->getRow(' + SELECT `quantity`, `id_wishlist_product` + FROM `'._DB_PREFIX_.'wishlist_product` wp + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute)); + + if (!sizeof($result) OR + ($result['quantity'] - $quantity) < 0 OR + $quantity > $result['quantity']) + return (false); + + Db::getInstance()->Execute(' + SELECT * + FROM `'._DB_PREFIX_.'wishlist_product_cart` + WHERE `id_wishlist_product`='.(int)($result['id_wishlist_product']).' AND `id_cart`='.(int)($id_cart) + ); + + if (Db::getInstance()->NumRows() > 0) + $result2= Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product_cart` + SET `quantity`=`quantity` + '.(int)($quantity).' + WHERE `id_wishlist_product`='.(int)($result['id_wishlist_product']).' AND `id_cart`='.(int)($id_cart) + ); + + else + $result2 = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'wishlist_product_cart` + (`id_wishlist_product`, `id_cart`, `quantity`, `date_add`) VALUES( + '.(int)($result['id_wishlist_product']).', + '.(int)($id_cart).', + '.(int)($quantity).', + \''.pSQL(date('Y-m-d H:i:s')).'\')'); + + if ($result2 === false) + return (false); + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'wishlist_product` SET + `quantity` = '.(int)($result['quantity'] - $quantity).' + WHERE `id_wishlist` = '.(int)($id_wishlist).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute))); + } + + /** + * Add email to wishlist + * + * @return boolean succeed + */ + static public function addEmail($id_wishlist, $email) + { + if (!Validate::isUnsignedId($id_wishlist) OR empty($email) OR !Validate::isEmail($email)) + return false; + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'wishlist_email` (`id_wishlist`, `email`, `date_add`) VALUES( + '.(int)($id_wishlist).', + \''.pSQL($email).'\', + \''.pSQL(date('Y-m-d H:i:s')).'\')')); + } + + /** + * Get email from wishlist + * + * @return Array results + */ + static public function getEmail($id_wishlist, $id_customer) + { + if (!Validate::isUnsignedId($id_wishlist) OR + !Validate::isUnsignedId($id_customer)) + die (Tools::displayError()); + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT we.`email`, we.`date_add` + FROM `'._DB_PREFIX_.'wishlist_email` we + INNER JOIN `'._DB_PREFIX_.'wishlist` w ON w.`id_wishlist` = we.`id_wishlist` + WHERE we.`id_wishlist` = '.(int)($id_wishlist).' + AND w.`id_customer` = '.(int)($id_customer))); + } +}; diff --git a/modules/blockwishlist/blockwishlist-ajax.tpl b/modules/blockwishlist/blockwishlist-ajax.tpl new file mode 100644 index 000000000..9fedfa82f --- /dev/null +++ b/modules/blockwishlist/blockwishlist-ajax.tpl @@ -0,0 +1,50 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $products} +
        + {foreach from=$products item=product name=i} +
        + {$product.quantity|intval}x + {$product.name|truncate:13:'...'|escape:'htmlall':'UTF-8'} + {l s='Delete'} +
        + {if isset($product.attributes_small)} +
        + {$product.attributes_small|escape:'htmlall':'UTF-8'} +
        + {/if} + {/foreach} +
        +{else} +
        + {if isset($error) && $error} +
        {l s='You must create a wishlist before adding products' mod='blockwishlist'}
        + {else} +
        {l s='No products' mod='blockwishlist'}
        + {/if} +
        +{/if} diff --git a/modules/blockwishlist/blockwishlist-extra.tpl b/modules/blockwishlist/blockwishlist-extra.tpl new file mode 100644 index 000000000..fb502a6b9 --- /dev/null +++ b/modules/blockwishlist/blockwishlist-extra.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Add to my wishlist' mod='blockwishlist'}

        \ No newline at end of file diff --git a/modules/blockwishlist/blockwishlist-header.tpl b/modules/blockwishlist/blockwishlist-header.tpl new file mode 100644 index 000000000..755953b43 --- /dev/null +++ b/modules/blockwishlist/blockwishlist-header.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + \ No newline at end of file diff --git a/modules/blockwishlist/blockwishlist.php b/modules/blockwishlist/blockwishlist.php new file mode 100644 index 000000000..7a7b5efb9 --- /dev/null +++ b/modules/blockwishlist/blockwishlist.php @@ -0,0 +1,338 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class BlockWishList extends Module +{ + const INSTALL_SQL_FILE = 'install.sql'; + + private $_html = ''; + private $_postErrors = array(); + + public function __construct() + { + $this->name = 'blockwishlist'; + $this->tab = 'front_office_features'; + $this->version = 0.2; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Wishlist block'); + $this->description = $this->l('Adds a block containing the customer\'s wishlists.'); + } + + public function install() + { + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return (false); + else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return (false); + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach ($sql AS $query) + if($query) + if(!Db::getInstance()->Execute(trim($query))) + return false; + if (!parent::install() OR + !$this->registerHook('rightColumn') OR + !$this->registerHook('productActions') OR + !$this->registerHook('cart') OR + !$this->registerHook('customerAccount') OR + !$this->registerHook('header') OR + !$this->registerHook('adminCustomers') + ) + return false; + /* This hook is optional */ + $this->registerHook('myAccountBlock'); + return true; + } + + public function uninstall() + { + return ( + Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'wishlist') AND + Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'wishlist_email') AND + Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'wishlist_product') AND + Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'wishlist_product_cart') AND + parent::uninstall() + ); + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitSettings')) + { + $activated = Tools::getValue('activated'); + if ($activated != 0 AND $activated != 1) + $this->_html .= '
        '.$this->l('Activate module : Invalid choice.').'
        '; + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + $this->_displayForm(); + return ($this->_html); + } + + private function _displayForm() + { + $this->_displayFormView(); + } + + private function _displayFormView() + { + global $cookie; + + $customers = Customer::getCustomers(); + if (!sizeof($customers)) + return; + $id_customer = (int)(Tools::getValue('id_customer')); + if (!$id_customer) + $id_customer = $customers[0]['id_customer']; + $this->_html .= '
        +
        +
        + '.$this->l('Listing').' + + +
        + +
        '; + require_once(dirname(__FILE__).'/WishList.php'); + $wishlists = WishList::getByIdCustomer($id_customer); + if (!sizeof($wishlists)) + return ($this->_html .= '
        '); + $id_wishlist = false; + foreach ($wishlists AS $row) + if ($row['id_wishlist'] == Tools::getValue('id_wishlist')) + { + $id_wishlist = (int)(Tools::getValue('id_wishlist')); + break; + } + if (!$id_wishlist) + $id_wishlist = $wishlists[0]['id_wishlist']; + $this->_html .= ' + +
        + +
        '; + $this->_displayProducts((int)($id_wishlist)); + $this->_html .= ' + '; + } + + public function hookHeader($params) + { + Tools::addCSS(($this->_path).'blockwishlist.css', 'all'); + return $this->display(__FILE__, 'blockwishlist-header.tpl'); + } + + public function hookRightColumn($params) + { + global $smarty, $errors; + + require_once(dirname(__FILE__).'/WishList.php'); + if ($params['cookie']->isLogged()) + { + $wishlists = Wishlist::getByIdCustomer($params['cookie']->id_customer); + if (empty($params['cookie']->id_wishlist) === true || + WishList::exists($params['cookie']->id_wishlist, $params['cookie']->id_customer) === false) + { + if (!sizeof($wishlists)) + $id_wishlist = false; + else + { + $id_wishlist = (int)($wishlists[0]['id_wishlist']); + $params['cookie']->id_wishlist = (int)($id_wishlist); + } + } + else + $id_wishlist = $params['cookie']->id_wishlist; + $smarty->assign(array( + 'id_wishlist' => $id_wishlist, + 'isLogged' => true, + 'wishlist_products' => ($id_wishlist == false ? false : WishList::getProductByIdCustomer($id_wishlist, $params['cookie']->id_customer, $params['cookie']->id_lang, null, true)), + 'wishlists' => $wishlists, + 'ptoken' => Tools::getToken(false))); + } + else + $smarty->assign(array('wishlist_products' => false, 'wishlists' => false)); + return ($this->display(__FILE__, 'blockwishlist.tpl')); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookProductActions($params) + { + global $smarty; + + $smarty->assign('id_product', (int)(Tools::getValue('id_product'))); + return ($this->display(__FILE__, 'blockwishlist-extra.tpl')); + } + + public function hookCustomerAccount($params) + { + global $smarty; + return $this->display(__FILE__, 'my-account.tpl'); + } + + public function hookMyAccountBlock($params) + { + return $this->hookCustomerAccount($params); + } + + private function _displayProducts($id_wishlist) + { + global $cookie; + include_once(dirname(__FILE__).'/WishList.php'); + + $wishlist = new WishList((int)($id_wishlist)); + $products = WishList::getProductByIdCustomer((int)($id_wishlist), (int)($wishlist->id_customer), (int)($cookie->id_lang)); + for ($i = 0; $i < sizeof($products); ++$i) + { + $obj = new Product((int)($products[$i]['id_product']), false, (int)($cookie->id_lang)); + if (!Validate::isLoadedObject($obj)) + continue; + else + { + $images = $obj->getImages((int)($cookie->id_lang)); + foreach ($images AS $k => $image) + { + if ($image['cover']) + { + $products[$i]['cover'] = $obj->id.'-'.$image['id_image']; + break; + } + } + if (!isset($products[$i]['cover'])) + $products[$i]['cover'] = Language::getIsoById((int)($cookie->id_lang)).'-default'; + } + } + $this->_html .= ' + + + + + + + + + '; + $priority = array($this->l('High'), $this->l('Medium'), $this->l('Low')); + foreach ($products as $product) + { + $this->_html .= ' + + + + + '; + } + $this->_html .= '
        '.$this->l('Product').''.$this->l('Quantity').''.$this->l('Priority').'
        + '.htmlentities($product['name'], ENT_COMPAT, 'UTF-8').' + '.$product['name']; + if (isset($product['attributes_small'])) + $this->_html .= '
        '.htmlentities($product['attributes_small'], ENT_COMPAT, 'UTF-8').''; + $this->_html .= ' +
        '.(int)($product['quantity']).''.$priority[(int)($product['priority']) % 3].'
        '; + } + + public function hookAdminCustomers($params) + { + require_once(dirname(__FILE__).'/WishList.php'); + + $customer = new Customer((int)($params['id_customer'])); + if (!Validate::isLoadedObject($customer)) + die (Tools::displayError()); + + $this->_html = '

        '.$this->l('Wishlists').'

        '; + + $wishlists = WishList::getByIdCustomer((int)($customer->id)); + if (!sizeof($wishlists)) + $this->_html .= $customer->lastname.' '.$customer->firstname.' '.$this->l('No wishlist.'); + else + { + $this->_html .= '
        '; + + $id_wishlist = (int)(Tools::getValue('id_wishlist')); + if (!$id_wishlist) + $id_wishlist = $wishlists[0]['id_wishlist']; + + $this->_html .= ''.$this->l('Wishlist').': '; + + $this->_displayProducts((int)($id_wishlist)); + + $this->_html .= '

        '; + + return $this->_html; + } + } + /* + * Display Error from controler + */ + public function errorLogged() + { + return $this->l('You must be logged in to manage your wishlists.'); + } +} + diff --git a/modules/blockwishlist/blockwishlist.tpl b/modules/blockwishlist/blockwishlist.tpl new file mode 100644 index 000000000..b7b4918d2 --- /dev/null +++ b/modules/blockwishlist/blockwishlist.tpl @@ -0,0 +1,66 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + diff --git a/modules/blockwishlist/buywishlistproduct.php b/modules/blockwishlist/buywishlistproduct.php new file mode 100644 index 000000000..9f6f7cc07 --- /dev/null +++ b/modules/blockwishlist/buywishlistproduct.php @@ -0,0 +1,54 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); +require_once(dirname(__FILE__).'/WishList.php'); + + $error = ''; + +$token = Tools::getValue('token'); +$id_product = (int)(Tools::getValue('id_product')); +$id_product_attribute = (int)(Tools::getValue('id_product_attribute')); +if (Configuration::get('PS_TOKEN_ENABLE') == 1 && +strcmp(Tools::getToken(false), Tools::getValue('static_token'))) + $error = Tools::displayError('Invalid token'); + +if (!strlen($error) && + empty($token) === false && + empty($id_product) === false) +{ + $wishlist = WishList::getByToken($token); + if ($wishlist !== false) + WishList::addBoughtProduct($wishlist['id_wishlist'], $id_product, $id_product_attribute, $cart->id, 1); +} +else + $error = Tools::displayError('You must log in'); + +if (empty($error) === false) + echo $error; + diff --git a/modules/blockwishlist/cart.php b/modules/blockwishlist/cart.php new file mode 100644 index 000000000..d8965cd05 --- /dev/null +++ b/modules/blockwishlist/cart.php @@ -0,0 +1,85 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); +require_once(dirname(__FILE__).'/WishList.php'); + +$errors = array(); + +$action = Tools::getValue('action'); +$add = (!strcmp($action, 'add') ? 1 : 0); +$delete = (!strcmp($action, 'delete') ? 1 : 0); +$id_wishlist = (int)(Tools::getValue('id_wishlist')); +$id_product = (int)(Tools::getValue('id_product')); +$quantity = (int)(Tools::getValue('quantity')); +$id_product_attribute = (int)(Tools::getValue('id_product_attribute')); +if (Configuration::get('PS_TOKEN_ENABLE') == 1 AND + strcmp(Tools::getToken(false), Tools::getValue('token')) AND + $cookie->isLogged() === true) + $errors[] = Tools::displayError('Invalid token'); +if ($cookie->isLogged()) +{ + if ($id_wishlist AND WishList::exists($id_wishlist, $cookie->id_customer) === true) + $cookie->id_wishlist = (int)($id_wishlist); + if (empty($cookie->id_wishlist) === true OR $cookie->id_wishlist == false) + $smarty->assign('error', true); + if (($add OR $delete) AND empty($id_product) === false) + { + if(!isset($cookie->id_wishlist) OR $cookie->id_wishlist == '') + { + $wishlist = new WishList(); + $wishlist->name = 'My WishList'; + $wishlist->id_customer = (int)($cookie->id_customer); + list($us, $s) = explode(' ', microtime()); + srand($s * $us); + $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$cookie->id_customer), 0, 16)); + $wishlist->add(); + $cookie->id_wishlist = (int)($wishlist->id); + } + if ($add AND $quantity) + WishList::addProduct($cookie->id_wishlist, $cookie->id_customer, $id_product, $id_product_attribute, $quantity); + else if ($delete) + WishList::removeProduct($cookie->id_wishlist, $cookie->id_customer, $id_product, $id_product_attribute); + } + $smarty->assign('products', WishList::getProductByIdCustomer($cookie->id_wishlist, $cookie->id_customer, $cookie->id_lang, null, true)); + + if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/blockwishlist-ajax.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/blockwishlist-ajax.tpl'); + elseif (Tools::file_exists_cache(dirname(__FILE__).'/blockwishlist-ajax.tpl')) + $smarty->display(dirname(__FILE__).'/blockwishlist-ajax.tpl'); + else + echo Tools::displayError('No template found'); +} +else + $errors[] = Tools::displayError('You must be logged in to manage your wishlist.'); + +if (sizeof($errors)) +{ + $smarty->assign('errors', $errors); + $smarty->display(_PS_THEME_DIR_.'errors.tpl'); +} diff --git a/modules/blockwishlist/config.xml b/modules/blockwishlist/config.xml new file mode 100755 index 000000000..acb5039e9 --- /dev/null +++ b/modules/blockwishlist/config.xml @@ -0,0 +1,11 @@ + + + blockwishlist + Wishlist block + 0.2 + Adds a block containing the customer\'s wishlists. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/blockwishlist/de.php b/modules/blockwishlist/de.php new file mode 100644 index 000000000..a3b624560 --- /dev/null +++ b/modules/blockwishlist/de.php @@ -0,0 +1,81 @@ +blockwishlist-ajax_4a84e5921e203aede886d04fc41a414b'] = 'Dieses Produkt von meiner Wunschliste nehmen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produkt-Detail'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_d037160cfb1fa5520563302d3a32630a'] = 'Sie müssen eine Wunschliste erstellen, bevor Sie Produkte hinzufügen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Zu meiner Wunschliste hinzufügen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Wunschlistenblock'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Fügt einen Block hinzu mit der Kundenwunschliste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Modul Aktivieren: Ungültige Auswahl.'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_56ee3495a32081ccb6d2376eab391bfa'] = 'Listing'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Kunden'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e0fd9b310aba555f96e76738ff192ac3'] = 'Wunschlisten'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_deb10517653c255364175796ace3553f'] = 'Produkt'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Menge'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorität'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_655d20c1ca69519ca647684edbb2db35'] = 'Hoch'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Mittel'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Niedrig'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_862af8838fba380d3b30e63546a394e5'] = 'hatte keine Wunschliste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_641254d77e7a473aa5910574f3f9453c'] = 'Wunschliste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_88b589bbf6282a2e02f50ebe90aae6f1'] = 'Sie müssen eingeloggt sein, um Ihre Wunschlisten zu verwalten'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4a84e5921e203aede886d04fc41a414b'] = 'Dieses Produkt von meiner Wunschliste nehmen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produkt-Detail'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Meine Wunschlisten'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0ac1aeb2429db494dd42ad2dc219ca7e'] = 'Produkte verstecken '; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0de9d09a36e820f9da7e87ab3678dd12'] = 'Produkte anzeigen'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0bb3e067c0514f5ff2d5a8e45fc0f4be'] = 'Informationen über gekaufte Produkte verstecken'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_6fe88f5681da397d46fefe19b3020a6a'] = 'Informationen über gekaufte Produkte anzeigen'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_30820a1bf6a285e45cda2beda3d7738d'] = 'Diese Wunschliste absenden'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_65a26fd603de62416ed333c7a8928713'] = 'Schliessen Diese Wunschliste absenden'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produkt-Detail'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Menge'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorität'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_655d20c1ca69519ca647684edbb2db35'] = 'Hoch'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Mittel'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Niedrig'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_94966d90747b97d1f0f206c98a8b1ac3'] = 'Senden'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_19f823c6453c2b1ffd09cb715214813d'] = 'Pflichtfeld'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_deb10517653c255364175796ace3553f'] = 'Produkt'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_3384622e86410fd01fa318fedc6a98ce'] = 'Angeboten von'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; +$_MODULE['<{blockwishlist}prestashop>my-account_7ec9cceb94985909c6994e95c31c1aa8'] = 'Meine Wunschliste'; +$_MODULE['<{blockwishlist}prestashop>my-account_723edf7c24638ed18d2fa831e647a5cc'] = 'Wunschliste'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mein Konto'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Meine Wunschlisten'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_06c335f27f292a096a9bf39e3a58e97b'] = 'Neue Wunschlisten'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_03ab340b3f99e03cff9e84314ead38c0'] = 'Anz'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_5e729042e30967c9d6f65c6eab73e2fe'] = 'Gesehen'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Erstellt'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_45284ef16392f85ff424b2ef36ab5948'] = 'Direkter Link'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d025259319054206be54336a00defe89'] = 'Wollen Sie diese Wunschliste wirklich löschen?'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0b3db27bc15f682e92ff250ebb167d4b'] = 'Zurück zu Ihrem Konto'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{blockwishlist}prestashop>view_641254d77e7a473aa5910574f3f9453c'] = 'Wunschliste'; +$_MODULE['<{blockwishlist}prestashop>view_9862d189193590487b2686b1c9043714'] = 'Andere Wunschlisten von'; +$_MODULE['<{blockwishlist}prestashop>view_3d01e7d8174b6a9b088b44870714cf07'] = 'Willkommen zur Wunschliste von'; +$_MODULE['<{blockwishlist}prestashop>view_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{blockwishlist}prestashop>view_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produkt-Detail'; +$_MODULE['<{blockwishlist}prestashop>view_3d0d1f906e27800531e054a3b6787b7c'] = 'Menge:'; +$_MODULE['<{blockwishlist}prestashop>view_05f32f85cccc8308d09a81e7bad3f80e'] = 'Priorität:'; +$_MODULE['<{blockwishlist}prestashop>view_655d20c1ca69519ca647684edbb2db35'] = 'Hoch'; +$_MODULE['<{blockwishlist}prestashop>view_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Mittel'; +$_MODULE['<{blockwishlist}prestashop>view_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Niedrig'; +$_MODULE['<{blockwishlist}prestashop>view_2d0f6b8300be19cf35e89e66f0677f95'] = 'In den Einkaufswagen'; +$_MODULE['<{blockwishlist}prestashop>view_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; diff --git a/modules/blockwishlist/en.php b/modules/blockwishlist/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/blockwishlist/en.php @@ -0,0 +1,4 @@ +blockwishlist-ajax_4a84e5921e203aede886d04fc41a414b'] = 'Borrar este producto de mi lista'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalle del producto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_d037160cfb1fa5520563302d3a32630a'] = 'Debe crear su wishlist antes de añadir productos'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dded030076d'] = 'Ningún producto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Añadir a mi wihlist'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Bloque de wishlist'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Añadir un bloque que contenga la wishlist de los clientes'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Módulo activado: opción no válida'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_56ee3495a32081ccb6d2376eab391bfa'] = 'Listado'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clientes'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e0fd9b310aba555f96e76738ff192ac3'] = 'Wishlist'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_deb10517653c255364175796ace3553f'] = 'Producto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Cantidad'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Prioridad'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Baja'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_862af8838fba380d3b30e63546a394e5'] = 'no hay lista de regalos'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_641254d77e7a473aa5910574f3f9453c'] = 'lista de regalos'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_88b589bbf6282a2e02f50ebe90aae6f1'] = 'Necesita acceder a su cuenta para administrar su lista de deseos.'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4a84e5921e203aede886d04fc41a414b'] = 'retirar este producto de mi lista'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalles producto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_09dc02ecbb078868a3a86dded030076d'] = 'Ningún producto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mis listas de regalo'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0ac1aeb2429db494dd42ad2dc219ca7e'] = 'Ocultar productos'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0de9d09a36e820f9da7e87ab3678dd12'] = 'Mostrar productos'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0bb3e067c0514f5ff2d5a8e45fc0f4be'] = 'Ocultar la información sobre los productos comprados'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_6fe88f5681da397d46fefe19b3020a6a'] = 'Mostrar la información sobre los productos comprados'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_30820a1bf6a285e45cda2beda3d7738d'] = 'Enviar esta lista'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_65a26fd603de62416ed333c7a8928713'] = 'Cerrar en envío de la lista'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalle producto'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Cantidad'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Prioridad'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Baja'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_c9cc8cce247e49bae79f15173ce97354'] = 'guardar'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_94966d90747b97d1f0f206c98a8b1ac3'] = 'Enviar'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_19f823c6453c2b1ffd09cb715214813d'] = 'Campo requerido'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_deb10517653c255364175796ace3553f'] = 'Productos'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_3384622e86410fd01fa318fedc6a98ce'] = 'regalo de '; +$_MODULE['<{blockwishlist}prestashop>managewishlist_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_09dc02ecbb078868a3a86dded030076d'] = 'ningún producto'; +$_MODULE['<{blockwishlist}prestashop>my-account_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mi lista de regalos'; +$_MODULE['<{blockwishlist}prestashop>my-account_723edf7c24638ed18d2fa831e647a5cc'] = 'lista de regalos'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mi lista de regalo'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_06c335f27f292a096a9bf39e3a58e97b'] = 'Nueva lista de regalo'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_49ee3087348e8d44e1feda1917443987'] = 'Nombre '; +$_MODULE['<{blockwishlist}prestashop>mywishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_03ab340b3f99e03cff9e84314ead38c0'] = 'Cantidad'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_5e729042e30967c9d6f65c6eab73e2fe'] = 'Vistos'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Creado'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_45284ef16392f85ff424b2ef36ab5948'] = 'Enlace directo'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Eliminar'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_4351cfebe4b61d8aa5efa1d020710005'] = 'Ver'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d025259319054206be54336a00defe89'] = '¿Desea realamente eliminar esta lista?'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0b3db27bc15f682e92ff250ebb167d4b'] = 'Volver a su cuenta'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{blockwishlist}prestashop>view_641254d77e7a473aa5910574f3f9453c'] = 'Lista de regalo'; +$_MODULE['<{blockwishlist}prestashop>view_9862d189193590487b2686b1c9043714'] = 'Otras listas de regalo'; +$_MODULE['<{blockwishlist}prestashop>view_3d01e7d8174b6a9b088b44870714cf07'] = 'Bienvenido a la lista de regalos'; +$_MODULE['<{blockwishlist}prestashop>view_4351cfebe4b61d8aa5efa1d020710005'] = 'Vista'; +$_MODULE['<{blockwishlist}prestashop>view_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalle producto'; +$_MODULE['<{blockwishlist}prestashop>view_3d0d1f906e27800531e054a3b6787b7c'] = 'Cantidad'; +$_MODULE['<{blockwishlist}prestashop>view_05f32f85cccc8308d09a81e7bad3f80e'] = 'Prioridad'; +$_MODULE['<{blockwishlist}prestashop>view_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>view_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>view_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Baja'; +$_MODULE['<{blockwishlist}prestashop>view_2d0f6b8300be19cf35e89e66f0677f95'] = 'Añadir al carrito'; +$_MODULE['<{blockwishlist}prestashop>view_09dc02ecbb078868a3a86dded030076d'] = 'No hay productos'; diff --git a/modules/blockwishlist/fr.php b/modules/blockwishlist/fr.php new file mode 100644 index 000000000..5673c537c --- /dev/null +++ b/modules/blockwishlist/fr.php @@ -0,0 +1,81 @@ +blockwishlist-ajax_4a84e5921e203aede886d04fc41a414b'] = 'Supprimer ce produit de ma liste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détail du produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_d037160cfb1fa5520563302d3a32630a'] = 'Vous devez créer une liste avant d\'ajouter un produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Ajouter à ma liste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Bloc liste de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Ajoute un bloc gérant les listes de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Choix invalide pour l\'activation du module'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres enregistrés'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_56ee3495a32081ccb6d2376eab391bfa'] = 'Liste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clients'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e0fd9b310aba555f96e76738ff192ac3'] = 'Listes de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorité'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_655d20c1ca69519ca647684edbb2db35'] = 'Haute'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Moyenne'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Basse'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_862af8838fba380d3b30e63546a394e5'] = 'n\'a pas de liste cadeaux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_641254d77e7a473aa5910574f3f9453c'] = 'Liste de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_88b589bbf6282a2e02f50ebe90aae6f1'] = 'Vous devez être identifié pour gérer vos liste voeux'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4a84e5921e203aede886d04fc41a414b'] = 'Enlever ce produit de ma liste'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détails produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mes listes'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0ac1aeb2429db494dd42ad2dc219ca7e'] = 'Cacher les produits'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0de9d09a36e820f9da7e87ab3678dd12'] = 'Afficher les produits'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0bb3e067c0514f5ff2d5a8e45fc0f4be'] = 'Cacher les informations des produits achetés'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_6fe88f5681da397d46fefe19b3020a6a'] = 'Afficher les informations des produits achetés'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_30820a1bf6a285e45cda2beda3d7738d'] = 'Envoyer cette liste'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_65a26fd603de62416ed333c7a8928713'] = 'Fermer'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détails produit'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorité'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_655d20c1ca69519ca647684edbb2db35'] = 'Haute'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Moyenne'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Basse'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_19f823c6453c2b1ffd09cb715214813d'] = 'Champ requis'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_3384622e86410fd01fa318fedc6a98ce'] = 'Offert par'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produits'; +$_MODULE['<{blockwishlist}prestashop>my-account_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mes listes de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>my-account_723edf7c24638ed18d2fa831e647a5cc'] = 'listecadeaux'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Mes listes'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_06c335f27f292a096a9bf39e3a58e97b'] = 'Nouvelle liste'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_03ab340b3f99e03cff9e84314ead38c0'] = 'Qté'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_5e729042e30967c9d6f65c6eab73e2fe'] = 'Vues'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Créée'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_45284ef16392f85ff424b2ef36ab5948'] = 'Lien direct'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d025259319054206be54336a00defe89'] = 'Souhaitez-vous réellement supprimer cette liste ?'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{blockwishlist}prestashop>view_641254d77e7a473aa5910574f3f9453c'] = 'Liste de cadeaux'; +$_MODULE['<{blockwishlist}prestashop>view_9862d189193590487b2686b1c9043714'] = 'Autres listes de'; +$_MODULE['<{blockwishlist}prestashop>view_3d01e7d8174b6a9b088b44870714cf07'] = 'Bienvenue sur la liste de '; +$_MODULE['<{blockwishlist}prestashop>view_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{blockwishlist}prestashop>view_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détail produit'; +$_MODULE['<{blockwishlist}prestashop>view_3d0d1f906e27800531e054a3b6787b7c'] = 'Quantité :'; +$_MODULE['<{blockwishlist}prestashop>view_05f32f85cccc8308d09a81e7bad3f80e'] = 'Priorité :'; +$_MODULE['<{blockwishlist}prestashop>view_655d20c1ca69519ca647684edbb2db35'] = 'Haute'; +$_MODULE['<{blockwishlist}prestashop>view_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Moyenne'; +$_MODULE['<{blockwishlist}prestashop>view_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Basse'; +$_MODULE['<{blockwishlist}prestashop>view_2d0f6b8300be19cf35e89e66f0677f95'] = 'Ajouter au panier'; +$_MODULE['<{blockwishlist}prestashop>view_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit'; diff --git a/modules/blockwishlist/img/delete.gif b/modules/blockwishlist/img/delete.gif new file mode 100644 index 000000000..43c6ca876 Binary files /dev/null and b/modules/blockwishlist/img/delete.gif differ diff --git a/modules/blockwishlist/img/icon/delete.png b/modules/blockwishlist/img/icon/delete.png new file mode 100644 index 000000000..08f249365 Binary files /dev/null and b/modules/blockwishlist/img/icon/delete.png differ diff --git a/modules/blockwishlist/img/icon/package.png b/modules/blockwishlist/img/icon/package.png new file mode 100644 index 000000000..da3c2a2d7 Binary files /dev/null and b/modules/blockwishlist/img/icon/package.png differ diff --git a/modules/blockwishlist/img/icon/package_go.png b/modules/blockwishlist/img/icon/package_go.png new file mode 100644 index 000000000..aace63ad6 Binary files /dev/null and b/modules/blockwishlist/img/icon/package_go.png differ diff --git a/modules/blockwishlist/img/star.gif b/modules/blockwishlist/img/star.gif new file mode 100644 index 000000000..d0948a708 Binary files /dev/null and b/modules/blockwishlist/img/star.gif differ diff --git a/modules/blockwishlist/install.sql b/modules/blockwishlist/install.sql new file mode 100644 index 000000000..ba9407d91 --- /dev/null +++ b/modules/blockwishlist/install.sql @@ -0,0 +1,33 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_wishlist` ( + `id_wishlist` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `token` varchar(64) character set utf8 NOT NULL, + `name` varchar(64) character set utf8 NOT NULL, + `counter` int(10) unsigned NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_wishlist`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_email` ( + `id_wishlist` int(10) unsigned NOT NULL, + `email` varchar(128) character set utf8 NOT NULL, + `date_add` datetime NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product` ( + `id_wishlist_product` int(10) NOT NULL auto_increment, + `id_wishlist` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL, + `priority` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_wishlist_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product_cart` ( + `id_wishlist_product` int(10) unsigned NOT NULL, + `id_cart` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/modules/blockwishlist/it.php b/modules/blockwishlist/it.php new file mode 100644 index 000000000..fc8a40d7d --- /dev/null +++ b/modules/blockwishlist/it.php @@ -0,0 +1,81 @@ +blockwishlist-ajax_4a84e5921e203aede886d04fc41a414b'] = 'rimuovi questo prodotto dalla mia lista dei desideri'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Descrizione del prodotto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_d037160cfb1fa5520563302d3a32630a'] = 'È necessario creare una wishlist prima di aggiungere i prodotti'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Aggiungi alla mia lista dei desideri'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Blocco lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Aggiunge un blocco contenente lista dei desideri del cliente'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Attiva il modulo: scelta non valida.'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_56ee3495a32081ccb6d2376eab391bfa'] = 'Elenco'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clienti'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_e0fd9b310aba555f96e76738ff192ac3'] = 'Liste dei desideri '; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_deb10517653c255364175796ace3553f'] = 'Prodotto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantità'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorità'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Bassa'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_862af8838fba380d3b30e63546a394e5'] = 'non ha avuto lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_641254d77e7a473aa5910574f3f9453c'] = 'Lista dei Desideri'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_88b589bbf6282a2e02f50ebe90aae6f1'] = 'Devi essere registrato per gestire la tua lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4a84e5921e203aede886d04fc41a414b'] = 'Rimuovi questo prodotto dalla mia lista dei desideri'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Descrizione del prodotto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; +$_MODULE['<{blockwishlist}prestashop>blockwishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Le mie liste dei desideri '; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0ac1aeb2429db494dd42ad2dc219ca7e'] = 'Nascondi i prodotti'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0de9d09a36e820f9da7e87ab3678dd12'] = 'Mostra prodotti'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_0bb3e067c0514f5ff2d5a8e45fc0f4be'] = 'Nascondi info prodotto acquistato'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_6fe88f5681da397d46fefe19b3020a6a'] = 'Mostra info prodotto acquistato'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_30820a1bf6a285e45cda2beda3d7738d'] = 'Invia questa lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>managewishlist_65a26fd603de62416ed333c7a8928713'] = 'Chiudi \"invia questa lista dei desideri\"'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Descrizione del prodotto'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantità'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_502996d9790340c5fd7b86a5b93b1c9f'] = 'Priorità'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Bassa'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_94966d90747b97d1f0f206c98a8b1ac3'] = 'Invia'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_19f823c6453c2b1ffd09cb715214813d'] = 'Campi obbligatori'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_deb10517653c255364175796ace3553f'] = 'Prodotto'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_3384622e86410fd01fa318fedc6a98ce'] = 'Offerto da'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{blockwishlist}prestashop>managewishlist_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; +$_MODULE['<{blockwishlist}prestashop>my-account_7ec9cceb94985909c6994e95c31c1aa8'] = 'Le mie liste di desideri'; +$_MODULE['<{blockwishlist}prestashop>my-account_723edf7c24638ed18d2fa831e647a5cc'] = 'lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Il mio account'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_7ec9cceb94985909c6994e95c31c1aa8'] = 'Le mie liste dei desideri'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_06c335f27f292a096a9bf39e3a58e97b'] = 'Nuova lista dei desideri '; +$_MODULE['<{blockwishlist}prestashop>mywishlist_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_03ab340b3f99e03cff9e84314ead38c0'] = 'Qtà'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_5e729042e30967c9d6f65c6eab73e2fe'] = 'Visto'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Creato'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_45284ef16392f85ff424b2ef36ab5948'] = 'Link diretto'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_d025259319054206be54336a00defe89'] = 'Sei sicuro di voler cancellare questa lista dei desideri?'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_0b3db27bc15f682e92ff250ebb167d4b'] = 'Torna al tuo account'; +$_MODULE['<{blockwishlist}prestashop>mywishlist_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{blockwishlist}prestashop>view_641254d77e7a473aa5910574f3f9453c'] = 'Lista dei desideri'; +$_MODULE['<{blockwishlist}prestashop>view_9862d189193590487b2686b1c9043714'] = 'Altre liste dei desideri di'; +$_MODULE['<{blockwishlist}prestashop>view_3d01e7d8174b6a9b088b44870714cf07'] = 'Benvenuti nella lista dei desideri di'; +$_MODULE['<{blockwishlist}prestashop>view_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{blockwishlist}prestashop>view_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Descrizione del prodotto'; +$_MODULE['<{blockwishlist}prestashop>view_3d0d1f906e27800531e054a3b6787b7c'] = 'Quantità:'; +$_MODULE['<{blockwishlist}prestashop>view_05f32f85cccc8308d09a81e7bad3f80e'] = 'Priorità:'; +$_MODULE['<{blockwishlist}prestashop>view_655d20c1ca69519ca647684edbb2db35'] = 'Alta'; +$_MODULE['<{blockwishlist}prestashop>view_87f8a6ab85c9ced3702b4ea641ad4bb5'] = 'Media'; +$_MODULE['<{blockwishlist}prestashop>view_28d0edd045e05cf5af64e35ae0c4c6ef'] = 'Bassa'; +$_MODULE['<{blockwishlist}prestashop>view_2d0f6b8300be19cf35e89e66f0677f95'] = 'Aggiungi al carrello'; +$_MODULE['<{blockwishlist}prestashop>view_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; diff --git a/modules/blockwishlist/js/ajax-wishlist.js b/modules/blockwishlist/js/ajax-wishlist.js new file mode 100644 index 000000000..9defc2e44 --- /dev/null +++ b/modules/blockwishlist/js/ajax-wishlist.js @@ -0,0 +1,254 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Update WishList Cart by adding, deleting, updating objects + * + * @return void + */ +function WishlistCart(id, action, id_product, id_product_attribute, quantity) +{ + $.ajax({ + type: 'GET', + url: baseDir + 'modules/blockwishlist/cart.php', + async: true, + cache: false, + data: 'action=' + action + '&id_product=' + id_product + '&quantity=' + quantity + '&token=' + static_token + '&id_product_attribute=' + id_product_attribute, + success: function(data) + { + if (action == 'add') + { + var $element = $('#bigpic'); + if (!$element.length) + var $element = $('#wishlist_button'); + var $picture = $element.clone(); + var pictureOffsetOriginal = $element.offset(); + $picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left}); + var pictureOffset = $picture.offset(); + var wishlistBlockOffset = $('#wishlist_block').offset(); + + $picture.appendTo('body'); + $picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left') }) + .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': wishlistBlockOffset.top + 30, 'left': wishlistBlockOffset.left + 15 }, 1000) + .fadeOut(800); + } + + if($('#' + id).length != 0) + { + $('#' + id).slideUp('normal'); + document.getElementById(id).innerHTML = data; + $('#' + id).slideDown('normal'); + } + } + }); +} + +/** + * Change customer default wishlist + * + * @return void + */ +function WishlistChangeDefault(id, id_wishlist) +{ + $.ajax({ + type: 'GET', + url: baseDir + 'modules/blockwishlist/cart.php', + async: true, + data: 'id_wishlist=' + id_wishlist + '&token=' + static_token, + cache: false, + success: function(data) + { + $('#' + id).slideUp('normal'); + document.getElementById(id).innerHTML = data; + $('#' + id).slideDown('normal'); + } + }); +} + +/** + * Buy Product + * + * @return void + */ +function WishlistBuyProduct(token, id_product, id_product_attribute, id_quantity, button, ajax) +{ + if(ajax) + ajaxCart.add(id_product, id_product_attribute, false, button, 1, [token, id_quantity]); + else + { + $('#' + id_quantity).val(0); + WishlistAddProductCart(token, id_product, id_product_attribute, id_quantity) + document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].method='POST'; + document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].action=baseDir + 'cart.php'; + document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].elements['token'].value = static_token; + document.forms['addtocart' + '_' + id_product + '_' + id_product_attribute].submit(); + } + return (true); +} + +function WishlistAddProductCart(token, id_product, id_product_attribute, id_quantity) +{ + if ($('#' + id_quantity).val() <= 0) + return (false); + $.ajax({ + type: 'GET', + url: baseDir + 'modules/blockwishlist/buywishlistproduct.php', + data: 'token=' + token + '&static_token=' + static_token + '&id_product=' + id_product + '&id_product_attribute=' + id_product_attribute, + async: true, + cache: false, + success: function(data) + { + if (data) + alert(data); + else + { + $('#' + id_quantity).val($('#' + id_quantity).val() - 1); + } + } + }); + return (true); +} + +/** + * Show wishlist managment page + * + * @return void + */ +function WishlistManage(id, id_wishlist) +{ + $.ajax({ + type: 'GET', + async: true, + url: baseDir + 'modules/blockwishlist/managewishlist.php', + data: 'id_wishlist=' + id_wishlist + '&refresh=' + false, + cache: false, + success: function(data) + { + $('#' + id).hide(); + document.getElementById(id).innerHTML = data; + $('#' + id).fadeIn('slow'); + } + }); +} + +/** + * Show wishlist product managment page + * + * @return void + */ +function WishlistProductManage(id, action, id_wishlist, id_product, id_product_attribute, quantity, priority) +{ + $.ajax({ + type: 'GET', + async: true, + url: baseDir + 'modules/blockwishlist/managewishlist.php', + data: 'action=' + action + '&id_wishlist=' + id_wishlist + '&id_product=' + id_product + '&id_product_attribute=' + id_product_attribute + '&quantity=' + quantity + '&priority=' + priority + '&refresh=' + true, + cache: false, + success: function(data) + { + if (action == 'delete') + $('#wlp_' + id_product + '_' + id_product_attribute).fadeOut('fast'); + else if (action == 'update') + { + $('#wlp_' + id_product + '_' + id_product_attribute).fadeOut('fast'); + $('#wlp_' + id_product + '_' + id_product_attribute).fadeIn('fast'); + } + } + }); +} + +/** + * Delete wishlist + * + * @return boolean succeed + */ +function WishlistDelete(id, id_wishlist, msg) +{ + var res = confirm(msg); + if (res == false) + return (false); + $.ajax({ + type: 'GET', + async: true, + url: baseDir + 'modules/blockwishlist/mywishlist.php', + cache: false, + data: 'deleted&id_wishlist=' + id_wishlist, + success: function(data) + { + $('#' + id).fadeOut('slow'); + } + }); +} + +/** + * Hide/Show bought product + * + * @return void + */ +function WishlistVisibility(bought_class, id_button) +{ + if ($('#hide' + id_button).css('display') == 'none') + { + $('.' + bought_class).slideDown('fast'); + $('#show' + id_button).hide(); + $('#hide' + id_button).fadeIn('fast'); + } + else + { + $('.' + bought_class).slideUp('fast'); + $('#hide' + id_button).hide(); + $('#show' + id_button).fadeIn('fast'); + } +} + +/** + * Send wishlist by email + * + * @return void + */ +function WishlistSend(id, id_wishlist, id_email) +{ + $.post(baseDir + 'modules/blockwishlist/sendwishlist.php', + { token: static_token, + id_wishlist: id_wishlist, + email1: $('#' + id_email + '1').val(), + email2: $('#' + id_email + '2').val(), + email3: $('#' + id_email + '3').val(), + email4: $('#' + id_email + '4').val(), + email5: $('#' + id_email + '5').val(), + email6: $('#' + id_email + '6').val(), + email7: $('#' + id_email + '7').val(), + email8: $('#' + id_email + '8').val(), + email9: $('#' + id_email + '9').val(), + email10: $('#' + id_email + '10').val() }, + function(data) + { + if (data) + alert(data); + else + WishlistVisibility(id, 'hideSendWishlist'); + }); +} diff --git a/modules/blockwishlist/logo.gif b/modules/blockwishlist/logo.gif new file mode 100644 index 000000000..da3c2a2d7 Binary files /dev/null and b/modules/blockwishlist/logo.gif differ diff --git a/modules/blockwishlist/mails/de/wishlink.html b/modules/blockwishlist/mails/de/wishlink.html new file mode 100644 index 000000000..cc921d21b --- /dev/null +++ b/modules/blockwishlist/mails/de/wishlink.html @@ -0,0 +1,40 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo,
         
        Nachricht von {shop_name}
         
        {shop_name} bietet Ihnen an, diesen Link an Ihre Freunde zu senden, damit diese Ihre Wunschliste sehen können {wishlist} :

        {message}
         
        {shop_name} realisiert mit PrestaShop™
        + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/de/wishlink.txt b/modules/blockwishlist/mails/de/wishlink.txt new file mode 100644 index 000000000..6d4e5dff1 --- /dev/null +++ b/modules/blockwishlist/mails/de/wishlink.txt @@ -0,0 +1,7 @@ +Hallo, + +{shop_name} bietet Ihnen an, diesen Link an Ihre Freunde zu senden, damit diese Ihre Wunschliste sehen können {wishlist} : + +{message} + +{shop_url} realisiert mit PrestaShop™ diff --git a/modules/blockwishlist/mails/de/wishlist.html b/modules/blockwishlist/mails/de/wishlist.html new file mode 100644 index 000000000..da29aaae7 --- /dev/null +++ b/modules/blockwishlist/mails/de/wishlist.html @@ -0,0 +1,40 @@ + + + + + Nachricht von einem Kunden bei {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo,
         
        Nachricht von {shop_name}
         
        {firstname} {lastname} hat angegeben, dass Sie seine/ ihr Wunschliste sehen möchten {wishlist} :

        {wishlist}
         
        {shop_name} Powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/de/wishlist.txt b/modules/blockwishlist/mails/de/wishlist.txt new file mode 100644 index 000000000..3f824a3c0 --- /dev/null +++ b/modules/blockwishlist/mails/de/wishlist.txt @@ -0,0 +1,8 @@ +Hallo, + +{firstname} {lastname} hat angegeben, dass Sie seine/ ihr Wunschliste sehen möchten {wishlist} : +{message} + + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blockwishlist/mails/en/wishlink.html b/modules/blockwishlist/mails/en/wishlink.html new file mode 100644 index 000000000..15642da01 --- /dev/null +++ b/modules/blockwishlist/mails/en/wishlink.html @@ -0,0 +1,38 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi,
         
        Message from {shop_name}
         
        + {shop_name} invites you to send this link to your friends, so they can see your wishlist {wishlist} : +

        + {message} +
         
        + {shop_name} realised with PrestaShop™ +
        + + diff --git a/modules/blockwishlist/mails/en/wishlink.txt b/modules/blockwishlist/mails/en/wishlink.txt new file mode 100644 index 000000000..584a563c8 --- /dev/null +++ b/modules/blockwishlist/mails/en/wishlink.txt @@ -0,0 +1,7 @@ +Hi, + +{shop_name} invites you to send this link to your friends, so they can see your wishlist {wishlist} : + +{message} + +{shop_url} realised by PrestaShop™ diff --git a/modules/blockwishlist/mails/en/wishlist.html b/modules/blockwishlist/mails/en/wishlist.html new file mode 100644 index 000000000..c81c385d3 --- /dev/null +++ b/modules/blockwishlist/mails/en/wishlist.html @@ -0,0 +1,38 @@ + + + + + Message from a customer of {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi,
         
        Message from {shop_name}
         
        + {firstname} {lastname} indicated you may want to see his/her wishlist {wishlist} : +

        + {wishlist} +
         
        + {shop_name} Powered by PrestaShop™ +
        + + diff --git a/modules/blockwishlist/mails/en/wishlist.txt b/modules/blockwishlist/mails/en/wishlist.txt new file mode 100644 index 000000000..bcfb62042 --- /dev/null +++ b/modules/blockwishlist/mails/en/wishlist.txt @@ -0,0 +1,8 @@ +Hi, + +{firstname} {lastname} indicated you may want to see his/her wishlist {wishlist} : +{message} + + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blockwishlist/mails/es/wishlink.html b/modules/blockwishlist/mails/es/wishlink.html new file mode 100755 index 000000000..101b3f141 --- /dev/null +++ b/modules/blockwishlist/mails/es/wishlink.html @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/es/wishlink.txt b/modules/blockwishlist/mails/es/wishlink.txt new file mode 100755 index 000000000..c9c7b63c2 --- /dev/null +++ b/modules/blockwishlist/mails/es/wishlink.txt @@ -0,0 +1 @@ +La página solicitada ya no existe \ No newline at end of file diff --git a/modules/blockwishlist/mails/es/wishlist.html b/modules/blockwishlist/mails/es/wishlist.html new file mode 100644 index 000000000..adbfecadf --- /dev/null +++ b/modules/blockwishlist/mails/es/wishlist.html @@ -0,0 +1,41 @@ + + + + + Mensaje de un cliente de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola,
         
        Mensaje de {shop_name}
         
        {firstname} {lastname} le sugiere a ver su lista de deseos {wishlist}:

        {wishlist}
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/es/wishlist.txt b/modules/blockwishlist/mails/es/wishlist.txt new file mode 100644 index 000000000..a8b163c66 --- /dev/null +++ b/modules/blockwishlist/mails/es/wishlist.txt @@ -0,0 +1,8 @@ +Hola, + +{firstname} {lastname} le sugiere a ver su lista de deseos {wishlist}: +{message} + + + +{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/modules/blockwishlist/mails/fr/wishlink.html b/modules/blockwishlist/mails/fr/wishlink.html new file mode 100644 index 000000000..c95950400 --- /dev/null +++ b/modules/blockwishlist/mails/fr/wishlink.html @@ -0,0 +1,38 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour,
         
        Message de {shop_name}
         
        + {shop_name} vous invite à envoyer ce lien à vos amis qui pourront alors consulter votre liste de cadeaux {wishlist} : +

        + {message} +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + diff --git a/modules/blockwishlist/mails/fr/wishlink.txt b/modules/blockwishlist/mails/fr/wishlink.txt new file mode 100644 index 000000000..d804993a3 --- /dev/null +++ b/modules/blockwishlist/mails/fr/wishlink.txt @@ -0,0 +1,7 @@ +Bonjour, + +{shop_name} vous invite à envoyer ce lien à vos amis qui pourront alors consulter votre liste de cadeaux {wishlist} : + +{message} + +{shop_url} réalisé par PrestaShop™ diff --git a/modules/blockwishlist/mails/fr/wishlist.html b/modules/blockwishlist/mails/fr/wishlist.html new file mode 100644 index 000000000..c80c12ba9 --- /dev/null +++ b/modules/blockwishlist/mails/fr/wishlist.html @@ -0,0 +1,38 @@ + + + + + Message d'un client de {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour,
         
        Message de {shop_name}
         
        + {firstname} {lastname} vous invite à visiter sa liste de cadeaux {wishlist} : +

        + {wishlist} +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + diff --git a/modules/blockwishlist/mails/fr/wishlist.txt b/modules/blockwishlist/mails/fr/wishlist.txt new file mode 100644 index 000000000..1884cd685 --- /dev/null +++ b/modules/blockwishlist/mails/fr/wishlist.txt @@ -0,0 +1,8 @@ +Bonjour, + +{firstname} {lastname} vous invite à visiter sa liste de cadeaux {wishlist} : +{message} + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/blockwishlist/mails/it/wishlink.html b/modules/blockwishlist/mails/it/wishlink.html new file mode 100644 index 000000000..ff67f1d06 --- /dev/null +++ b/modules/blockwishlist/mails/it/wishlink.html @@ -0,0 +1,40 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve,
        Messaggio da {shop_name}
        {shop_name} ti invita ad inviare questo link ai tuoi amici, così che possano vedere la tua lista dei desideri {wishlist}:

        {message}
        {shop_name} realised with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/it/wishlink.txt b/modules/blockwishlist/mails/it/wishlink.txt new file mode 100644 index 000000000..f9bd8ee40 --- /dev/null +++ b/modules/blockwishlist/mails/it/wishlink.txt @@ -0,0 +1,7 @@ +Salve, + +{shop_name} ti invita a inviare questo link ai tuoi amici, così che possano vedere la tua lista dei desideri {wishlist} : + +{message} + +{shop_url} realised by PrestaShop™ diff --git a/modules/blockwishlist/mails/it/wishlist.html b/modules/blockwishlist/mails/it/wishlist.html new file mode 100644 index 000000000..6957691ea --- /dev/null +++ b/modules/blockwishlist/mails/it/wishlist.html @@ -0,0 +1,40 @@ + + + + + Messaggio da un cliente di {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve,
        Messaggio da {shop_name}
        {firstname} {lastname} ha detto che potresto voler vedere la sua lista dei desideri {wishlist}:

        {wishlist}
        {shop_name} Powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/blockwishlist/mails/it/wishlist.txt b/modules/blockwishlist/mails/it/wishlist.txt new file mode 100644 index 000000000..a46f3ffa3 --- /dev/null +++ b/modules/blockwishlist/mails/it/wishlist.txt @@ -0,0 +1,8 @@ +Salve, + +{firstname} {lastname} ha detto che potresti voler vedere la sua lista dei desideri {wishlist} : +{message} + + + +{shop_url} Powered by PrestaShop™ \ No newline at end of file diff --git a/modules/blockwishlist/managewishlist.php b/modules/blockwishlist/managewishlist.php new file mode 100644 index 000000000..382f9f082 --- /dev/null +++ b/modules/blockwishlist/managewishlist.php @@ -0,0 +1,115 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); +require_once(dirname(__FILE__).'/WishList.php'); + +if ($cookie->isLogged()) +{ + $action = Tools::getValue('action'); + $id_wishlist = Tools::getValue('id_wishlist'); + $id_product = Tools::getValue('id_product'); + $id_product_attribute = Tools::getValue('id_product_attribute'); + $quantity = Tools::getValue('quantity'); + $priority = Tools::getValue('priority'); + $wishlist = new WishList((int)($id_wishlist)); + $refresh = (($_GET['refresh'] == 'true') ? 1 : 0); + if (empty($id_wishlist) === false) + { + if (!strcmp($action, 'update')) + { + WishList::updateProduct($id_wishlist, $id_product, $id_product_attribute, $priority, $quantity); + } + else + { + if (!strcmp($action, 'delete')) + WishList::removeProduct($id_wishlist, (int)($cookie->id_customer), $id_product, $id_product_attribute); + + $products = WishList::getProductByIdCustomer($id_wishlist, $cookie->id_customer, $cookie->id_lang); + $bought = WishList::getBoughtProduct($id_wishlist); + + for ($i = 0; $i < sizeof($products); ++$i) + { + $obj = new Product((int)($products[$i]['id_product']), false, (int)($cookie->id_lang)); + if (!Validate::isLoadedObject($obj)) + continue; + else + { + if ($products[$i]['id_product_attribute'] != 0) + { + $combination_imgs = $obj->getCombinationImages((int)($cookie->id_lang)); + $products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image']; + } + else + { + $images = $obj->getImages((int)($cookie->id_lang)); + foreach ($images AS $k => $image) + if ($image['cover']) + { + $products[$i]['cover'] = $obj->id.'-'.$image['id_image']; + break; + } + } + if (!isset($products[$i]['cover'])) + $products[$i]['cover'] = Language::getIsoById($cookie->id_lang).'-default'; + } + $products[$i]['bought'] = false; + for ($j = 0, $k = 0; $j < sizeof($bought); ++$j) + { + if ($bought[$j]['id_product'] == $products[$i]['id_product'] AND + $bought[$j]['id_product_attribute'] == $products[$i]['id_product_attribute']) + $products[$i]['bought'][$k++] = $bought[$j]; + } + } + + $productBoughts = array(); + + foreach ($products as $product) + if (sizeof($product['bought'])) + $productBoughts[] = $product; + $smarty->assign(array( + 'products' => $products, + 'productsBoughts' => $productBoughts, + 'id_wishlist' => $id_wishlist, + 'refresh' => $refresh, + 'token_wish' => $wishlist->token + )); + + if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/managewishlist.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/managewishlist.tpl'); + elseif (Tools::file_exists_cache(dirname(__FILE__).'/managewishlist.tpl')) + $smarty->display(dirname(__FILE__).'/managewishlist.tpl'); + else + echo Tools::displayError('No template found'); + } + } +} + diff --git a/modules/blockwishlist/managewishlist.tpl b/modules/blockwishlist/managewishlist.tpl new file mode 100644 index 000000000..bb2ebeaec --- /dev/null +++ b/modules/blockwishlist/managewishlist.tpl @@ -0,0 +1,127 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $products} +{if !$refresh} +
        + + + {if count($productsBoughts)} + + + {/if} + + + +
        + Permalink :
        +{/if} +
        + {foreach from=$products item=product name=i} + + {/foreach} +
        +
        +
        + {if !$refresh} + + {if count($productsBoughts)} + + + + + + + {foreach from=$productsBoughts item=product name=i} + {foreach from=$product.bought item=bought name=j} + {if $bought.quantity > 0} + + + + + + + {/if} + {/foreach} + {/foreach} + + + {/if} + {/if} +{else} + {l s='No products' mod='blockwishlist'} +{/if} diff --git a/modules/blockwishlist/my-account.tpl b/modules/blockwishlist/my-account.tpl new file mode 100644 index 000000000..45593a068 --- /dev/null +++ b/modules/blockwishlist/my-account.tpl @@ -0,0 +1,31 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
      • +{l s='wishlist' mod='blockwishlist'}{l s='My wishlists' mod='blockwishlist'} +
      • + \ No newline at end of file diff --git a/modules/blockwishlist/mywishlist.php b/modules/blockwishlist/mywishlist.php new file mode 100644 index 000000000..52e32bf9e --- /dev/null +++ b/modules/blockwishlist/mywishlist.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include_once(dirname(__FILE__).'/WishList.php'); + +$errors = array(); + +if ($cookie->isLogged()) +{ + $add = Tools::getIsset('add'); + $add = (empty($add) === false ? 1 : 0); + $delete = Tools::getIsset('deleted'); + $delete = (empty($delete) === false ? 1 : 0); + $id_wishlist = Tools::getValue('id_wishlist'); + if (Tools::isSubmit('submitWishlist')) + { + if (Configuration::get('PS_TOKEN_ACTIVATED') == 1 AND + strcmp(Tools::getToken(), Tools::getValue('token'))) + $errors[] = Tools::displayError('Invalid token'); + if (!sizeof($errors)) + { + $name = Tools::getValue('name'); + if (empty($name)) + $errors[] = Tools::displayError('You must specify a name.'); + if (WishList::isExistsByNameForUser($name)) + $errors[] = Tools::displayError('This name is already used by another list.'); + + if(!sizeof($errors)) + { + $wishlist = new WishList(); + $wishlist->name = $name; + $wishlist->id_customer = $cookie->id_customer; + list($us, $s) = explode(' ', microtime()); + srand($s * $us); + $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$cookie->id_customer), 0, 16)); + $wishlist->add(); + Mail::Send((int)($cookie->id_lang), 'wishlink', Mail::l('Your wishlist\'s link'), + array( + '{wishlist}' => $wishlist->name, + '{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token), + $cookie->email, $cookie->firstname.' '.$cookie->lastname, NULL, strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + } + } + } + else if ($add) + WishList::addCardToWishlist((int)($cookie->id_customer), (int)(Tools::getValue('id_wishlist')), (int)($cookie->id_lang)); + else if ($delete AND empty($id_wishlist) === false) + { + $wishlist = new WishList((int)($id_wishlist)); + if (Validate::isLoadedObject($wishlist)) + $wishlist->delete(); + else + $errors[] = Tools::displayError('Cannot delete this wishlist'); + } + $smarty->assign('wishlists', WishList::getByIdCustomer((int)($cookie->id_customer))); + $smarty->assign('nbProducts', WishList::getInfosByIdCustomer((int)($cookie->id_customer))); +} +else +{ + Tools::redirect('authentication.php?back=modules/blockwishlist/mywishlist.php'); +} + +$smarty->assign(array( + 'id_customer' => (int)($cookie->id_customer), + 'errors' => $errors +)); + +if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/mywishlist.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/mywishlist.tpl'); +elseif (Tools::file_exists_cache(dirname(__FILE__).'/mywishlist.tpl')) + $smarty->display(dirname(__FILE__).'/mywishlist.tpl'); +else + echo Tools::displayError('No template found'); + +include(dirname(__FILE__).'/../../footer.php'); + + diff --git a/modules/blockwishlist/mywishlist.tpl b/modules/blockwishlist/mywishlist.tpl new file mode 100644 index 000000000..466810317 --- /dev/null +++ b/modules/blockwishlist/mywishlist.tpl @@ -0,0 +1,100 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +
        + {capture name=path}{l s='My account' mod='blockwishlist'}{$navigationPipe}{l s='My wishlists' mod='blockwishlist'}{/capture} + {include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='My wishlists' mod='blockwishlist'}

        + + {include file="$tpl_dir./errors.tpl"} + + {if $id_customer|intval neq 0} +
        +
        +

        {l s='New wishlist' mod='blockwishlist'}

        + + + + +
        +
        + {if $wishlists} +
        + + + + + + + + + + + + + {section name=i loop=$wishlists} + + + + + + + + + {/section} + +
        {l s='Name' mod='blockwishlist'}{l s='Qty' mod='blockwishlist'}{l s='Viewed' mod='blockwishlist'}{l s='Created' mod='blockwishlist'}{l s='Direct Link' mod='blockwishlist'}{l s='Delete' mod='blockwishlist'}
        {$wishlists[i].name|truncate:30:'...'|escape:'htmlall':'UTF-8'} + {assign var=n value=0} + {foreach from=$nbProducts item=nb name=i} + {if $nb.id_wishlist eq $wishlists[i].id_wishlist} + {assign var=n value=$nb.nbProducts|intval} + {/if} + {/foreach} + {if $n} + {$n|intval} + {else} + 0 + {/if} + {$wishlists[i].counter|intval}{$wishlists[i].date_add|date_format:"%Y-%m-%d"}{l s='View' mod='blockwishlist'} + {l s='Delete' mod='blockwishlist'} +
        +
        +
         
        + {/if} + {/if} + + +
        diff --git a/modules/blockwishlist/sendwishlist.php b/modules/blockwishlist/sendwishlist.php new file mode 100644 index 000000000..6a5dc2def --- /dev/null +++ b/modules/blockwishlist/sendwishlist.php @@ -0,0 +1,61 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); +require_once(dirname(__FILE__).'/WishList.php'); + +if (Configuration::get('PS_TOKEN_ENABLE') == 1 AND + strcmp(Tools::getToken(false), Tools::getValue('token')) AND + $cookie->isLogged() === true) + exit(Tools::displayError('invalid token',false)); + +if ($cookie->isLogged()) +{ + $id_wishlist = (int)(Tools::getValue('id_wishlist')); + if (empty($id_wishlist) === true) + exit(Tools::displayError('Invalid wishlist',false)); + for ($i = 1; empty($_POST['email'.strval($i)]) === false; ++$i) + { + $to = Tools::getValue('email'.$i); + $wishlist = WishList::exists($id_wishlist, $cookie->id_customer, true); + if ($wishlist === false) + exit(Tools::displayError('Invalid wishlist',false)); + if (WishList::addEmail($id_wishlist, $to) === false) + exit(Tools::displayError('Wishlist send error',false)); + $toName = strval(Configuration::get('PS_SHOP_NAME')); + $customer = new Customer((int)($cookie->id_customer)); + if (Validate::isLoadedObject($customer)) + Mail::Send((int)($cookie->id_lang), 'wishlist', Mail::l('Message from ').$customer->lastname.' '.$customer->firstname, + array( + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{wishlist}' => $wishlist['name'], + '{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist['token']), + $to, $toName, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, dirname(__FILE__).'/mails/'); + } +} diff --git a/modules/blockwishlist/view.php b/modules/blockwishlist/view.php new file mode 100644 index 000000000..a87413dd0 --- /dev/null +++ b/modules/blockwishlist/view.php @@ -0,0 +1,88 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../header.php'); +require_once(dirname(__FILE__).'/WishList.php'); + +$token = Tools::getValue('token'); +if (empty($token) === false) +{ + $wishlist = WishList::getByToken($token); + if (empty($result) === true || $result === false) + $errors[] = Tools::displayError('Invalid wishlist token'); + WishList::refreshWishList($wishlist['id_wishlist']); + $products = WishList::getProductByIdCustomer((int)($wishlist['id_wishlist']), (int)($wishlist['id_customer']), (int)($cookie->id_lang), null, true); + for ($i = 0; $i < sizeof($products); ++$i) + { + $obj = new Product((int)($products[$i]['id_product']), false, (int)($cookie->id_lang)); + if (!Validate::isLoadedObject($obj)) + continue; + else + { + if ($products[$i]['id_product_attribute'] != 0) + { + $combination_imgs = $obj->getCombinationImages((int)($cookie->id_lang)); + $products[$i]['cover'] = $obj->id.'-'.$combination_imgs[$products[$i]['id_product_attribute']][0]['id_image']; + } + else + { + $images = $obj->getImages((int)($cookie->id_lang)); + foreach ($images AS $k => $image) + { + if ($image['cover']) + { + $products[$i]['cover'] = $obj->id.'-'.$image['id_image']; + break; + } + } + if (!isset($products[$i]['cover'])) + $products[$i]['cover'] = Language::getIsoById((int)($cookie->id_lang)).'-default'; + } + } + } + WishList::incCounter((int)($wishlist['id_wishlist'])); + $ajax = Configuration::get('PS_BLOCK_CART_AJAX'); + $smarty->assign(array ( + 'current_wishlist' => $wishlist, + 'token' => $token, + 'ajax' => ((isset($ajax) AND (int)($ajax) == 1) ? '1' : '0'), + 'wishlists' => WishList::getByIdCustomer((int)($wishlist['id_customer'])), + 'products' => $products)); +} + +if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/blockwishlist/view.tpl'); +elseif (Tools::file_exists_cache(dirname(__FILE__).'/view.tpl')) + $smarty->display(dirname(__FILE__).'/view.tpl'); +else + echo Tools::displayError('No template found'); + +require(dirname(__FILE__).'/../../footer.php'); diff --git a/modules/blockwishlist/view.tpl b/modules/blockwishlist/view.tpl new file mode 100644 index 000000000..a827c99c1 --- /dev/null +++ b/modules/blockwishlist/view.tpl @@ -0,0 +1,96 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +

        {l s='Wishlist' mod='blockwishlist'}

        +{if $wishlists} +

        + {l s='Other wishlists of' mod='blockwishlist'} {$current_wishlist.firstname} {$current_wishlist.lastname}: + {foreach from=$wishlists item=wishlist name=i} + {if $wishlist.id_wishlist != $current_wishlist.id_wishlist} + {$wishlist.name} + {if !$smarty.foreach.i.last} + / + {/if} + {/if} + {/foreach} +

        +{/if} +{if $products} + +{else} + {l s='No products' mod='blockwishlist'} +{/if} +
        diff --git a/modules/cashondelivery/cashondelivery.gif b/modules/cashondelivery/cashondelivery.gif new file mode 100644 index 000000000..926ce1d7c Binary files /dev/null and b/modules/cashondelivery/cashondelivery.gif differ diff --git a/modules/cashondelivery/cashondelivery.jpg b/modules/cashondelivery/cashondelivery.jpg new file mode 100644 index 000000000..cb9c6a523 Binary files /dev/null and b/modules/cashondelivery/cashondelivery.jpg differ diff --git a/modules/cashondelivery/cashondelivery.php b/modules/cashondelivery/cashondelivery.php new file mode 100644 index 000000000..8df67e006 --- /dev/null +++ b/modules/cashondelivery/cashondelivery.php @@ -0,0 +1,84 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class CashOnDelivery extends PaymentModule +{ + public function __construct() + { + $this->name = 'cashondelivery'; + $this->tab = 'payments_gateways'; + $this->version = '0.3'; + $this->author = 'PrestaShop'; + + $this->currencies = false; + + parent::__construct(); + + $this->displayName = $this->l('Cash on delivery (COD)'); + $this->description = $this->l('Accept cash on delivery payments'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) + return false; + return true; + } + + public function hookPayment($params) + { + if (!$this->active) + return ; + + global $smarty; + + // Check if cart has product download + foreach ($params['cart']->getProducts() AS $product) + { + $pd = ProductDownload::getIdFromIdProduct((int)($product['id_product'])); + if ($pd AND Validate::isUnsignedInt($pd)) + return false; + } + + $smarty->assign(array( + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + return $this->display(__FILE__, 'payment.tpl'); + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + return $this->display(__FILE__, 'confirmation.tpl'); + } +} diff --git a/modules/cashondelivery/config.xml b/modules/cashondelivery/config.xml new file mode 100755 index 000000000..f979105b0 --- /dev/null +++ b/modules/cashondelivery/config.xml @@ -0,0 +1,11 @@ + + + cashondelivery + Cash on delivery (COD) + 0.3 + Accept cash on delivery payments + PrestaShop + payments_gateways + 0 + 1 + \ No newline at end of file diff --git a/modules/cashondelivery/confirmation.tpl b/modules/cashondelivery/confirmation.tpl new file mode 100644 index 000000000..7bf97d034 --- /dev/null +++ b/modules/cashondelivery/confirmation.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Your order on' mod='cashondelivery'} {$shop_name} {l s='is complete.' mod='cashondelivery'} +

        + {l s='You have chosen the cash on delivery method.' mod='cashondelivery'} +

        {l s='Your order will be sent very soon.' mod='cashondelivery'} +

        {l s='For any questions or for further information, please contact our' mod='cashondelivery'} {l s='customer support' mod='cashondelivery'}. +

        diff --git a/modules/cashondelivery/de.php b/modules/cashondelivery/de.php new file mode 100644 index 000000000..183fb919c --- /dev/null +++ b/modules/cashondelivery/de.php @@ -0,0 +1,23 @@ +cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Nachnahme (COD)'; +$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Zahlungen per Nachnahme akzeptieren '; +$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung von'; +$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Sie haben die Nachnahme-Methode gewählt.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Ihre Bestellung wird sehr bald geschickt werden.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Zahlung per Nachnahme (COD)'; +$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Sie bezahlen die Ware bei der Lieferung'; +$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand'; +$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Bestellsumme'; +$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Nachnahme-Zahlung (COD)'; +$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Sie haben die Nachnahme-Methode gewählt.'; +$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; +$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. St.)'; +$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \"Ich bestätige meine Bestellung\"'; +$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; +$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; diff --git a/modules/cashondelivery/en.php b/modules/cashondelivery/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/cashondelivery/en.php @@ -0,0 +1,4 @@ +cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Pago contra reembolso'; +$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Aceptar pagos contra reembolso'; +$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ha sido registrado.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Ha elegido pagar en el momento de la entrega.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Le enviaremos su pedido en breve plazo.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta, póngase en contacto con nuestro'; +$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio clientela'; +$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Pagra contra reembolso'; +$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Usted paga la mercancía a la entrega'; +$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'transporte'; +$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Suma del pedido'; +$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Pago contra reembolso'; +$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Ha elegido el pago contra reembolso'; +$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es'; +$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(tasas incluídas)'; +$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Por favor acepte su pedido pulsando en \'confirmo mi pedido\''; +$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Otros modos de pago'; +$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Confirmo mi pedido'; diff --git a/modules/cashondelivery/fr.php b/modules/cashondelivery/fr.php new file mode 100644 index 000000000..dd8ec91a9 --- /dev/null +++ b/modules/cashondelivery/fr.php @@ -0,0 +1,23 @@ +cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Comptant à la livraison'; +$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Accepte le paiement lors de la livraison'; +$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est bien enregistrée.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Vous avez choisi le paiement lors de la livraison.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Votre commande vous sera envoyée très prochainement.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire merci de contacter notre'; +$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client'; +$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Payer comptant à la livraison'; +$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Vous payez lors de la livraison de votre commande'; +$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Frais d\'expédition'; +$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Récapitulatif de commande'; +$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Paiement comptant à la livraison'; +$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Vous avez choisi de régler comptant lors de la livraison de la commande.'; +$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; +$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; +$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; +$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; diff --git a/modules/cashondelivery/it.php b/modules/cashondelivery/it.php new file mode 100644 index 000000000..d2c4ccaf1 --- /dev/null +++ b/modules/cashondelivery/it.php @@ -0,0 +1,23 @@ +cashondelivery_1f9497d3e8bac9b50151416f04119cec'] = 'Pagamento alla consegna (COD)'; +$_MODULE['<{cashondelivery}prestashop>cashondelivery_7a3ef27eb0b1895ebf263ad7dd949fb6'] = 'Accetta pagamenti COD (alla consegna)'; +$_MODULE['<{cashondelivery}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine sul'; +$_MODULE['<{cashondelivery}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completa.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Hai scelto la modalità di pagamento alla consegna.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{cashondelivery}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{cashondelivery}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{cashondelivery}prestashop>payment_b7ada96a0da7ee7fb5371cca0b036d5c'] = 'Paga in contanti alla consegna (COD)'; +$_MODULE['<{cashondelivery}prestashop>payment_536dc7424180872c8c2488ae0286fb53'] = 'Si paga per la merce al momento della consegna'; +$_MODULE['<{cashondelivery}prestashop>validation_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; +$_MODULE['<{cashondelivery}prestashop>validation_0c25b529b4d690c39b0831840d0ed01c'] = 'Riepilogo ordine'; +$_MODULE['<{cashondelivery}prestashop>validation_d538c5b86e9a71455ba27412f4e9ab51'] = 'Pagamento in contanti alla consegna (COD)'; +$_MODULE['<{cashondelivery}prestashop>validation_8861c5d3fa54b330d1f60ba50fcc4aab'] = 'Hai scelto la modalità pagamento alla consegna.'; +$_MODULE['<{cashondelivery}prestashop>validation_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; +$_MODULE['<{cashondelivery}prestashop>validation_1f87346a16cf80c372065de3c54c86d9'] = '(Tasse incl.)'; +$_MODULE['<{cashondelivery}prestashop>validation_0881a11f7af33bc1b43e437391129d66'] = 'Si prega di confermare l\'ordine cliccando su \'confermo il mio ordine\''; +$_MODULE['<{cashondelivery}prestashop>validation_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; +$_MODULE['<{cashondelivery}prestashop>validation_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; diff --git a/modules/cashondelivery/logo.gif b/modules/cashondelivery/logo.gif new file mode 100644 index 000000000..a08249944 Binary files /dev/null and b/modules/cashondelivery/logo.gif differ diff --git a/modules/cashondelivery/payment.tpl b/modules/cashondelivery/payment.tpl new file mode 100644 index 000000000..10917ac05 --- /dev/null +++ b/modules/cashondelivery/payment.tpl @@ -0,0 +1,34 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay with cash on delivery (COD)' mod='cashondelivery'} +
        {l s='Pay with cash on delivery (COD)' mod='cashondelivery'} +
        {l s='You pay for the merchandise upon delivery' mod='cashondelivery'} +
        +
        +

        \ No newline at end of file diff --git a/modules/cashondelivery/validation.php b/modules/cashondelivery/validation.php new file mode 100644 index 000000000..c3e9ff35e --- /dev/null +++ b/modules/cashondelivery/validation.php @@ -0,0 +1,64 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/cashondelivery.php'); + +$cashOnDelivery = new CashOnDelivery(); +if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$cashOnDelivery->active) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$customer = new Customer((int)$cart->id_customer); + +if (!Validate::isLoadedObject($customer)) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + + +/* Validate order */ +if (Tools::getValue('confirm')) +{ + $customer = new Customer((int)($cart->id_customer)); + $total = $cart->getOrderTotal(true, Cart::BOTH); + $cashOnDelivery->validateOrder((int)($cart->id), _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName, NULL, array(), NULL, false,$customer->secure_key); + $order = new Order((int)($cashOnDelivery->currentOrder)); + Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)($cart->id).'&id_module='.(int)($cashOnDelivery->id).'&id_order='.(int)($cashOnDelivery->currentOrder)); +} +else +{ + /* or ask for confirmation */ + $smarty->assign(array( + 'total' => $cart->getOrderTotal(true, Cart::BOTH), + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/cashondelivery/' + )); + + $smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondelivery/'); + $template = 'validation.tpl'; + echo Module::display('cashondelivery', $template); +} + +include(dirname(__FILE__).'/../../footer.php'); \ No newline at end of file diff --git a/modules/cashondelivery/validation.tpl b/modules/cashondelivery/validation.tpl new file mode 100644 index 000000000..a6a2a8c2c --- /dev/null +++ b/modules/cashondelivery/validation.tpl @@ -0,0 +1,58 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Shipping' mod='cashondelivery'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Order summation' mod='cashondelivery'}

        + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +

        {l s='Cash on delivery (COD) payment' mod='cashondelivery'}

        + +
        + +

        + {l s='Cash on delivery (COD) payment' mod='cashondelivery'} + {l s='You have chosen the cash on delivery method.' mod='cashondelivery'} +

        + {l s='The total amount of your order is' mod='cashondelivery'} + {convertPrice price=$total} + {if $use_taxes == 1} + {l s='(tax incl.)' mod='cashondelivery'} + {/if} +

        +

        +

        +

        + {l s='Please confirm your order by clicking \'I confirm my order\'' mod='cashondelivery'}. +

        +

        + {l s='Other payment methods' mod='cashondelivery'} + +

        +
        diff --git a/modules/cashticket/Disposition.php b/modules/cashticket/Disposition.php new file mode 100644 index 000000000..bf0dd2ced --- /dev/null +++ b/modules/cashticket/Disposition.php @@ -0,0 +1,82 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Disposition +{ + const TABLE_NAME = 'disposition'; + + public static function create($id_cart, $mtid, $amount, $currency) + { + return Db::getInstance()->Execute( + 'INSERT INTO `'._DB_PREFIX_.self::TABLE_NAME.'` (`id_cart`, `mtid`, `amount`, `currency`) + VALUES ('.(int)($id_cart).',\''.pSQL($mtid).'\','.(float)($amount).',\''.pSQL($currency).'\')'); + } + + public static function delete($id) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_disposition` = '.(int)($id)); + } + + public static function deleteByCartId($id_cart) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_cart` = '.(int)($id_cart)); + } + + public static function getByCartId($id_cart) + { + return Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_cart` = '.(int)($id_cart)); + } + + public static function createTable() + { + return Db::getInstance()->Execute( + 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'` ( + `id_disposition` int(11) NOT NULL AUTO_INCREMENT, + `id_cart` int(11) NOT NULL, + `mtid` varchar(20) NOT NULL, + `amount` float NOT NULL, + `currency` varchar(3) NOT NULL, + PRIMARY KEY (`id_disposition`), + UNIQUE KEY `id_cart` (`id_cart`) + ) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + } + + public static function dropTable() + { + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } + + public static function updateAmount($id_disposition, $amount) + { + return Db::getInstance()->Execute( + 'UPDATE `'._DB_PREFIX_.self::TABLE_NAME.'` SET `amount` = `amount` - '.(float)($amount).' WHERE `id_disposition` = '.(int)($id_disposition)); + } + + +} + + diff --git a/modules/cashticket/PrepaidServices.php b/modules/cashticket/PrepaidServices.php new file mode 100644 index 000000000..5466076fb --- /dev/null +++ b/modules/cashticket/PrepaidServices.php @@ -0,0 +1,663 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +$module_name = 'cashticket'; + +include(_PS_MODULE_DIR_.'/'.$module_name.'/Disposition.php'); +include(_PS_MODULE_DIR_.'/'.$module_name.'/PrepaidServicesAPI.php'); + +abstract class PrepaidServices extends PaymentModule +{ + protected $max_amount = 1000; + protected $max_amount_currency = 'EUR'; + protected $default_language = 'en'; + + protected $prefix = ''; + + protected $environments = array('P' => 'Production', + 'T' => 'Test'); + + protected $business_types = array('I' => 'Intangible', + 'T' => 'Tangible'); + + // abstract + protected $supported_languages; + protected $allowed_currencies; + protected $supported_currencies; + protected $payment_url; + protected $prepaid_api_configuration; + protected $register_url; + + public function __construct() + { + parent::__construct(); + + if ($this->active AND !extension_loaded('curl')) + $this->warning = $this->getL('curl_required'); + } + + public function install() + { + $ps_ct_immediat_payment = Configuration::get($this->prefix.'IMMEDIAT_PAYMENT') ? Configuration::get($this->prefix.'IMMEDIAT_PAYMENT') : '1'; + $ps_ct_salt = Configuration::get($this->prefix.'SALT') ? Configuration::get($this->prefix.'SALT') : strtoupper(Tools::passwdGen(8)); + $ps_ct_business_type = Configuration::get($this->prefix.'BUSINESS_TYPE') ? Configuration::get($this->prefix.'BUSINESS_TYPE') : 'I'; + $ps_ct_environment = Configuration::get($this->prefix.'ENVIRONMENT') ? Configuration::get($this->prefix.'ENVIRONMENT') : 'T'; + + return parent::install() AND Disposition::createTable() AND $this->_createOrderState() AND + $this->registerHook('payment') AND $this->registerHook('paymentReturn') AND $this->registerHook('adminOrder') + AND Configuration::updateValue($this->prefix.'IMMEDIAT_PAYMENT', $ps_ct_immediat_payment) + AND Configuration::updateValue($this->prefix.'SALT', $ps_ct_salt) + AND Configuration::updateValue($this->prefix.'BUSINESS_TYPE', $ps_ct_business_type) + AND Configuration::updateValue($this->prefix.'ENVIRONMENT', $ps_ct_environment); + } + + private function _createOrderState() + { + + if (Configuration::get($this->prefix.'ORDER_STATE_ID') && Configuration::get($this->prefix.'ORDER_STATE_PART_ID')) return true; + + // Awaiting payment + $os = new OrderState(); + $os->name = array('1' => 'Awaiting '.$this->displayName.' payment', + '2' => 'En attente du paiement par '.$this->displayName, + '3' => 'En espera de pago por '.$this->displayName); + + $os->invoice = false; + $os->color = 'lightblue'; + $os->logable = true; + + if ($os->save()) + { + Configuration::updateValue($this->prefix.'ORDER_STATE_ID', $os->id); + + copy(_PS_MODULE_DIR_.$this->name.'/logo.gif',_PS_IMG_DIR_.'os/'.$os->id.'.gif'); + } else + return false; + + // Partially paid + $os1 = new OrderState(); + $os1->name = array('1' => 'Partially paid by '.$this->displayName, + '2' => 'Payé partiellement via '.$this->displayName, + '3' => 'Pagado parcialmente con '.$this->displayName); + + $os1->invoice = false; + $os1->color = 'lightblue'; + $os1->logable = true; + + if ($os1->save()) + { + Configuration::updateValue($this->prefix.'ORDER_STATE_PART_ID', $os1->id); + copy(_PS_MODULE_DIR_.$this->name.'/logo.gif',_PS_IMG_DIR_.'os/'.$os1->id.'.gif'); + return true; + } + + return false; + } + + private function _deleteOrderState() + { + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_ID'))); + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state_lang` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_ID'))); + + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_PART_ID'))); + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state_lang` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_PART_ID'))); + + return true; + } + + public function getPaymentUrlBase() + { + return $this->payment_url[Configuration::get($this->prefix.'ENVIRONMENT')]; + } + + private function _getSupportedLanguageIsoById($id_lang) + { + $lang = Language::getIsoById((int)($id_lang)); + + return in_array($lang, $this->supported_languages) ? $lang : $this->default_language; + } + + private function _getRegisterLink($id_lang) + { + $lang = Language::getIsoById((int)($id_lang)); + return array_key_exists($lang, $this->register_url) ? $this->register_url[$lang] : $this->register_url[$this->default_language]; + } + + private function _getAllowedCurrencies() + { + if (empty($this->allowed_currencies)) + $this->allowed_currencies = DB::getInstance()->ExecuteS( + 'SELECT c.id_currency, c.iso_code, c.name, c.sign + FROM '._DB_PREFIX_.'currency c + WHERE c.deleted = 0 + AND iso_code IN (\''.implode('\',\'', $this->supported_currencies).'\')'); + + return $this->allowed_currencies; + } + + public function isCurrencyActive($currency_iso_code) + { + $mid = Configuration::get($this->prefix.'MERCHANT_ID_'.$currency_iso_code); + return ($mid && file_exists($this->certificat_dir.$mid.'.pem') && Configuration::get($this->prefix.'KEYRING_PW_'.$currency_iso_code)); + } + + public function createDisposition($cart) + { + global $cookie; + + $currency = new Currency((int)($cart->id_currency)); + $language = $this->_getSupportedLanguageIsoById((int)($cookie->id_lang)); + $mid = Configuration::get($this->prefix.'MERCHANT_ID_'.$currency->iso_code); + $mtid = $cart->id.'-'.time(); + $amount = number_format((float)($cart->getOrderTotal(true, Cart::BOTH)), 2, '.',''); + $currency_iso = $currency->iso_code; + $business_type = Configuration::get($this->prefix.'BUSINESS_TYPE'); + $reporting_criteria = ''; + + $hash = md5(Configuration::get($this->prefix.'SALT') + $amount + $currency_iso); + + $ok_url = Tools::getShopDomainSsl(true, true)._MODULE_DIR_.$this->name.'/payment.php?hash='.$hash; + $nok_url = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'/order.php?step=3'; + + list($return_code, $error_code, $message) = PrepaidServicesAPI::createDisposition($this->getAPIConfiguration($currency_iso), $mid, $mtid, $amount, $currency_iso, $ok_url, $nok_url, $business_type, $reporting_criteria); + + if ($return_code == 0) + { + Disposition::deleteByCartId((int)($cart->id)); // Avoid duplicate disposition (canceled orders in CT for example) + Disposition::create((int)($cart->id), $mtid, $amount, $currency_iso); + $message = $this->getPaymentUrlBase().'?currency='.$currency->iso_code.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&language='.$language; + } + + return array('return_code' => $return_code, 'message' => $message); + } + + public function getDispositionState($id_cart) + { + $disposition = Disposition::getByCartId((int)($id_cart)); + + if (!array_key_exists('id_disposition', $disposition)) + die(Tools::displayError()); + + return PrepaidServicesAPI::getSerialNumbers($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], $disposition['currency']); + } + + public function executeDebit($id_cart, $amount = NULL, $close_flag = 1) + { + $disposition = Disposition::getByCartId((int)($id_cart)); + if (!array_key_exists('id_disposition', $disposition)) + die(Tools::displayError()); + + if (!isset($amount) || $amount === '') + $amount = $disposition['amount']; + + $result = PrepaidServicesAPI::executeDebit($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], number_format($amount, 2, '.', ''), $disposition['currency'], $close_flag); + + if ($result[0] == 0) + { + if ($amount == $disposition['amount'] || $close_flag) + Disposition::delete((int)($disposition['id_disposition'])); + else + Disposition::updateAmount((int)($disposition['id_disposition']), (float)($amount)); + } + + return $result; + } + + + public function getContent() + { + $out = '

        '.$this->displayName.'

        '; + $err_req = false; + + // check requirements + if (!extension_loaded('curl')) + { + $out .= $this->displayError($this->getL('curl_required')); + $err_req = true; + } + + + if (!is_writable($this->certificat_dir)) + { + $out .= $this->displayError($this->certificat_dir.' '.$this->getL('not_writable')); + $err_req = true; + } + + $id_currency = Currency::getIdByIsoCode($this->max_amount_currency); + if (empty($id_currency)) + { + $out .= $this->displayError($this->getL('currency_required').'['.$this->max_amount_currency.']'); + $err_req = true; + } + + if (!$err_req && Tools::isSubmit('submitCtConfiguration')) + { + $errors = $this->_validateForm(); + + if (empty($errors)) + $out .= $this->_postProcess(); + else + $out .= $errors; + } + + $out .= $this->_displayStyleAndJS(); + $out .= $this->_displayInfos(); + $out .= $this->_displayForm(); + + return $out; + } + + private function _displayStyleAndJS() + { + return ' + '; + } + + private function _displayForm() + { + $business_type_options = ''; + foreach ($this->business_types AS $key => $value) + $business_type_options .= ''; + + $currencies_configuration = '

        '.$this->getL('configure_currency').'

        +

        '.$this->getL('payment_not_displayed').'

        + '; + + $environment_radio = ''; + foreach ($this->environments AS $key => $value) + $environment_radio .= 'prefix.'ENVIRONMENT') == $key ? 'checked' : '').'>'. $value. '
        '; + + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $currencies_configuration .= ' + + + + '; + } + $currencies_configuration .= '
        '.$this->getL('configuration_in').' '.$currency['name'].' '.$currency['sign'].' + +
        + +
        +
        + +
        + +
        + +
        + +
        +
        '; + + return '
        +
        + '.$this->getL('configuration').' + +
        + '.$environment_radio.' +
        +
        + +
        + +
        +
        + +
        + prefix.'IMMEDIAT_PAYMENT') ? 'checked' : '').' /> +
        +
        +
        + '.$currencies_configuration.' +
        +
        + +
        + +
        +
        '; + } + + private function _displayInfos() + { + global $cookie; + + return '
        + '.$this->displayName.' +
        + '.$this->getL('introduction').' +

        + '.$this->getL('register').' +
        +

        '; + } + + private function _validateForm() + { + $errors = ''; + + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $mid = trim(Tools::getValue('ct_merchant_id_'.$currency['iso_code'])); + + if (preg_match('/^[0-9]{10}$/', $mid)) + { + $mid_certificat = $_FILES['ct_keyring_certificate_'.$currency['iso_code']]; + + if (!$mid_certificat || $mid_certificat['error'] == 4 || $mid_certificat['error'] == 3) + { + if (!file_exists($this->certificat_dir.$mid.'.pem')) + $errors .= $this->displayError($this->getL('certificate_required').' ['.$currency['iso_code'].']'); + } + else + { + if ($mid_certificat['error']) + { + switch ($mid_certificat['error']) + { + case 3: // UPLOAD_ERR_PARTIAL + $errors .= $this->displayError($this->getL('file_partialy_uploaded')); + break; + + case 4: // UPLOAD_ERR_NO_FILE + $errors .= $this->displayError($this->getL('file_empty')); + break; + } + } + + if (substr($mid_certificat['name'], -4) != '.pem') + $errors .= $this->displayError($this->getL('invalid_file').' ['.$currency['iso_code'].']'); + } + } + elseif (!empty($mid)) + { + $errors .= $this->displayError($this->getL('invalid_merchant_id').' ['.$currency['iso_code'].']'); + } + } + + if (!array_key_exists(Tools::getValue('ct_business_type'), $this->business_types)) + $errors .= $this->getL('invalid_business_type'); + + if (!array_key_exists(Tools::getValue('ct_environment'), $this->environments)) + $errors .= $this->getL('invalid_environment'); + + return $errors; + } + + private function _acceptPayment($order, $disposition, $currency_sign, $amount = NULL) + { + $isCorrect = true; + if (!$disposition) + die(Tools::displayError()); + + if (!isset($amount) || $amount === '') + $amount = $disposition['amount']; + + $amount = number_format($amount, 2, '.', ''); + $close_flag = (int)($amount == $disposition['amount']); + + list($resultcode, $errorcode, $errormessage) = $this->executeDebit($disposition['id_cart'], $amount, $close_flag); + + $param = ''; + if ($resultcode != 0) + { + $message = $this->getL('payment_error').' '.$errormessage; + $isCorrect = false; + } + else + $message = $this->getL('payment_accepted') .'('.$amount.' '.$currency_sign.') '.($close_flag ? $this->getL('disposition_consumed') : '') ; + + $msg = new Message(); + $msg->message = $message; + $msg->id_order = (int)($order->id); + $msg->private = 1; + $msg->add(); + + if ($isCorrect) + { + if ($order->total_paid == $order->total_paid_real) + $order->total_paid_real = $amount; + else + $order->total_paid_real += $amount; + + $os = _PS_OS_PAYMENT_; + if ($order->total_paid != $order->total_paid_real) + $os = Configuration::get($this->prefix.'ORDER_STATE_PART_ID'); + + $history = new OrderHistory(); + $history->id_order = (int)($order->id); + $history->changeIdOrderState($os, (int)($order->id)); + $history->save(); + + $order->save(); + } + + return $isCorrect; + } + + public function _releasePayment($order, $disposition) + { + if (!$disposition) + die(Tools::displayError()); + + list($resultcode, $errorcode, $errormessage) = $this->executeDebit($disposition['id_cart'], 0, 1); + + $param = ''; + if ($resultcode != 0) + { + $message = $this->getL('release_error').' '.$errormessage; + $isCorrect = false; + } + else + $message = $this->getL('payment_released'); + + $msg = new Message(); + $msg->message = $message; + $msg->id_order = (int)($order->id); + $msg->private = 1; + $msg->add(); + + return $errorcode; + } + + private function _postProcess() + { + Configuration::updateValue($this->prefix.'BUSINESS_TYPE', Tools::getValue('ct_business_type')); + Configuration::updateValue($this->prefix.'ENVIRONMENT', Tools::getValue('ct_environment')); + + $immediat_payment = Tools::getValue('ct_immediat_payment'); + if (Configuration::get($this->prefix.'BUSINESS_TYPE') == 'I') + $immediat_payment = 1; + + Configuration::updateValue($this->prefix.'IMMEDIAT_PAYMENT', $immediat_payment); + + $params = ''; + $dataSync = ''; + $delim = '?'; + $key = 1; + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $mid = trim(Tools::getValue('ct_merchant_id_'.$currency['iso_code'])); + + Configuration::updateValue($this->prefix.'MERCHANT_ID_'.$currency['iso_code'], $mid); + Configuration::updateValue($this->prefix.'KEYRING_PW_'.$currency['iso_code'], Tools::getValue('ct_keyring_pw_'.$currency['iso_code'])); + + if (isset($_FILES['ct_keyring_certificate_'.$currency['iso_code']])) + move_uploaded_file($_FILES['ct_keyring_certificate_'.$currency['iso_code']]['tmp_name'], $this->certificat_dir.$mid.'.pem'); + + if ($mid) + { + $params .= $delim.'mid'.$key.'='.urlencode($mid).'¤cy'.$key.'='.urlencode($currency['iso_code']); + $delim = '&'; + $key++; + } + } + + if (!empty($params)) + $dataSync = ''; + + return $this->displayConfirmation($this->getL('settings_updated').$dataSync); + } + + public function hookPayment($params) + { + global $smarty; + + // check currency + $currency = new Currency((int)($params['cart']->id_currency)); + + if (!$this->isCurrencyActive($currency->iso_code)) + return false; + + // check max amount + $amount = (float)($params['cart']->getOrderTotal(true, Cart::BOTH)); + $id_currency_max = Currency::getIdByIsoCode($this->max_amount_currency); + + if ($currency->id != $id_currency_max) + { + $amount = $amount / $currency->conversion_rate; + $amount = Tools::convertPrice($amount, new Currency((int)($id_currency_max))); + } + + if ($amount > $this->max_amount) + return false; + + $smarty->assign(array('pic_url' => _MODULE_DIR_.'/'.$this->name.'/img/payment-logo.png', + 'payment_name' => $this->displayName, + 'module_name' => $this->name)); + + return $this->display(__FILE__, 'payment.tpl'); + } + + + public function hookPaymentReturn($params) + { + global $smarty, $cookie; + + if ($params['objOrder']->module != $this->name) + return; + + $smarty->assign('payment_name', $this->displayName); + return $this->display(__FILE__, $this->name.'-confirmation.tpl'); + } + + + public function hookAdminOrder($params) + { + global $smarty, $cookie; + $error = 0; + $order = new Order((int)($params['id_order'])); + + if (!Validate::isLoadedObject($order)) + die(Tools::displayError()); + + if ($order->module != $this->name) + return false; + + $disposition = Disposition::getByCartId((int)($order->id_cart)); + if (!$disposition) // No disposition = Order paid + return false; + + // check disposition state + $res = PrepaidServicesAPI::getSerialNumbers($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], $disposition['currency']); + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + + // if the disposition is not "active" + if ($res[5] != PrepaidServicesAPI::DISPOSITION_DISPOSED && $res[5] != PrepaidServicesAPI::DISPOSITION_DEBITED) + { + $smarty->assign(array('disposition_state' => $res[5], 'payment_name' => $order->payment)); + return $this->display($this->module_dir.'/'.$this->name, 'disposition-error.tpl'); + } + + if (Tools::isSubmit('acceptPayment')) + { + $amount = Tools::getValue('ps_amount'); + if (isset($amount) && !empty($amount) && $amount <= $res[3] && $amount > 0) + { + if (!$this->_acceptPayment($order, $disposition, $currency->getSign('right'), $amount)) + $error = 1; + } + else + $error = 2; + + $query_string = $error ? self::changeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error', (int)($error)) : self::removeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error'); + Tools::redirectAdmin(Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$query_string); + } else if (Tools::isSubmit('releasePayment')) { + if (!$this->_releasePayment($order, $disposition)) + $error = 1; + + $query_string = $error ? self::changeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error', (int)($error)) : $_SERVER['QUERY_STRING']; + Tools::redirectAdmin(Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$query_string); + } + + $error_msg = ''; + if (Tools::getIsset('pp_error')) + $error_msg = $this->_getErrorMsgFromErrorCode(Tools::getValue('pp_error')); + + $smarty->assign(array('action' => Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'], + 'payment_name' => $order->payment, + 'error' => $error_msg, + 'currency' => $currency->getSign('right'), + 'amount' => $res[3] + )); + + return $this->display($this->module_dir.'/'.$this->name, $this->name.'-accept-payment.tpl'); + } + + public function getAPIConfiguration($iso_currency) + { + return array('keyring_file' => $this->certificat_dir.Configuration::get($this->prefix.'MERCHANT_ID_'.strtoupper($iso_currency)).'.pem', + 'keyring_pw' => Configuration::get($this->prefix.'KEYRING_PW_'.strtoupper($iso_currency)), + 'keyring_prepaid' => $this->certificat_dir.'paysafecard-CA.pem', + 'env' => Configuration::get($this->prefix.'ENVIRONMENT')); + } + + public static function changeQueryStringParameter($query_string, $param, $value) + { + parse_str($query_string, $output); + $output[$param] = $value; + return http_build_query($output); + } + + public static function removeQueryStringParameter($query_string, $param) + { + parse_str($query_string, $output); + unset($output[$param]); + return http_build_query($output); + } + +} + diff --git a/modules/cashticket/PrepaidServicesAPI.php b/modules/cashticket/PrepaidServicesAPI.php new file mode 100644 index 000000000..d520f77dd --- /dev/null +++ b/modules/cashticket/PrepaidServicesAPI.php @@ -0,0 +1,190 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PrepaidServicesAPI +{ + const DISPOSITION_CREATED = 'R'; + const DISPOSITION_DISPOSED = 'S'; + const DISPOSITION_DEBITED = 'E'; + const DISPOSITION_CONSUMED = 'O'; + const DISPOSITION_CANCELLED = 'L'; + const DISPOSITION_INVALID = 'I'; + const DISPOSITION_EXPIRED = 'X'; + + // Test & Production environment (shared between CT & PSC) + private static $base_url = array('T' => array('create_disposition_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/CreateDispositionServlet', + 'get_disposition_state_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/GetDispositionStateServlet', + 'execute_debit_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/DebitServlet', + 'get_serial_number_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/GetSerialNumbersServlet' + ), + 'P' => array('create_disposition_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/CreateDispositionServlet', + 'get_disposition_state_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/GetDispositionStateServlet', + 'execute_debit_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/DebitServlet', + 'get_serial_number_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/GetSerialNumbersServlet' + )); + + public static function getBaseUrl($key, $env) + { + $base_url = self::$base_url[$env]; + + if (array_key_exists($key, $base_url)) + return $base_url[$key]; + + return ''; + } + + public static function createDisposition($configuration, $mid, $mtid, $amount, $currency, $okurl, $nokurl, $businesstype, $reportingcriteria) + { + $language = 'en'; + $params = 'currency='.$currency.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&businesstype='.$businesstype. + '&reportingcriteria='.$reportingcriteria.'&okurl='.$okurl.'&nokurl='.$nokurl.'&language='.$language; + + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('create_disposition_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $data_array = explode("\n", $data,7); + $resultcode = trim($data_array[0]); + $errorcode = trim($data_array[1]); + $errormessage = trim($data_array[2]); + + return array($resultcode, $errorcode, $errormessage); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array($resultcode,$errorcode,$errormessage); + } + } + + public static function getDispositionState($configuration, $mid, $mtid, $currency_iso_code) + { + $language = 'en'; + $params = 'mid='.$mid.'&mtid='.$mtid.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('get_disposition_state_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $dataarray = explode("\n", $data,7); + $resultcode = trim($dataarray[0]); + $errorcode = trim($dataarray[1]); + $errormessage = trim($dataarray[2]); + $amount = trim($dataarray[3]); + $currency = trim($dataarray[4]); + $state = trim($dataarray[5]); + + return array($resultcode, $errorcode, $errormessage, $amount, $currency, $state); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array($resultcode, $errorcode, $errormessage); + } + } + + public static function getSerialNumbers($configuration, $mid, $mtid, $currency_iso_code) + { + $language = 'en'; + $params = 'mid='.$mid.'&mtid='.$mtid.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('get_serial_number_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + if ($rc == 0) { + /* read and return data from paysafecard server */ + $dataarray = explode("\n", $data,7); + $resultcode = trim($dataarray[0]); + $errorcode = trim($dataarray[1]); + $errormessage = trim($dataarray[2]); + $amount = trim($dataarray[3]); + $currency = trim($dataarray[4]); + $state = trim($dataarray[5]); + $snamount = trim($dataarray[6]); + return array ($resultcode, $errorcode, $errormessage, $amount, $currency, $state, $snamount); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array ($resultcode, $errorcode, $errormessage); + } + } + + public static function executeDebit($configuration, $mid, $mtid, $amount, $currency, $close_flag = 1) + { + $language = 'en'; + $params = 'currency='.$currency.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&close='.$close_flag.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('execute_debit_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $dataarray=explode("\n", $data,7); + $resultcode=trim($dataarray[0]); + $errorcode=trim($dataarray[1]); + $errormessage=trim($dataarray[2]); + + return array ($resultcode, $errorcode, $errormessage); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array ($resultcode, $errorcode, $errormessage); + } + } + + private static function _doHttpRequest($url, $urlparam, $keyringfile, $keyringpw, $cakeyringfile) + { + /* some prerquisites for the connection */ + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_POST, 1); // a non-zero parameter tells the library to do a regular HTTP post. + curl_setopt($ch, CURLOPT_POSTFIELDS, $urlparam); // add POST fields + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); // don't allow redirects + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable + curl_setopt($ch, CURLOPT_TIMEOUT, 240); // maximum time, in seconds, that you'll allow the CURL functions to take + curl_setopt($ch, CURLOPT_SSLCERT, $keyringfile); // filename of PEM formatted certificate + curl_setopt($ch, CURLOPT_SSLCERTTYPE, "PEM"); // format of certificate, "PEM" or "DER" + curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $keyringpw); // password required to use the CURLOPT_SSLCERT certificate + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); // verify the peer's certificate + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // verify the Common name from the peer certificate + curl_setopt($ch, CURLOPT_CAINFO, $cakeyringfile); // file holding one or more certificates to verify the peer with + + $data = curl_exec($ch); + $errno = curl_errno($ch); + $errmsg = curl_error($ch); + + /* bug fix for PHP 4.1.0/4.1.2 (curl_errno() returns high negative + * value in case of successful termination) */ + if ($errno < 0) $errno = 0; + + curl_close($ch); + + return array ($errno,$errmsg,$data); + } +} + + diff --git a/modules/cashticket/cashticket-accept-payment.tpl b/modules/cashticket/cashticket-accept-payment.tpl new file mode 100644 index 000000000..52e1413f6 --- /dev/null +++ b/modules/cashticket/cashticket-accept-payment.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +
        + {$payment_name} + {if $error} + {$error} + {/if} + +

        {l s='Payment has not been accepted yet:' mod='cashticket'}

        +

        +

        + {$currency} + + +
        +

        +
        + diff --git a/modules/cashticket/cashticket-confirmation.tpl b/modules/cashticket/cashticket-confirmation.tpl new file mode 100644 index 000000000..8232b3d69 --- /dev/null +++ b/modules/cashticket/cashticket-confirmation.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Your order on' mod='cashticket'} {$shop_name} {l s='is complete.' mod='cashticket'} +

        + {l s='You have chosen the' mod='cashticket'} {$payment_name} {l s='method.' mod='cashticket'} +

        {l s='Your order will be sent very soon.' mod='cashticket'} +

        {l s='For any questions or for further information, please contact our' mod='cashticket'} {l s='customer support' mod='cashticket'}. +

        diff --git a/modules/cashticket/cashticket.php b/modules/cashticket/cashticket.php new file mode 100644 index 000000000..318a6b82f --- /dev/null +++ b/modules/cashticket/cashticket.php @@ -0,0 +1,115 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +if (!in_array('PrepaidServices', get_declared_classes())) include_once(_PS_MODULE_DIR_.'/cashticket/PrepaidServices.php'); + +class CashTicket extends PrepaidServices +{ + public $prefix = 'PS_CT_'; + protected $supported_languages = array('de', 'en', 'gr', 'el', 'es', 'it', 'fr', 'nl', 'pl', 'pt', 'si', 'sk', 'tr'); + protected $allowed_currencies = array(); + + protected $environments = array('P' => 'Production', + 'T' => 'Test'); + + protected $business_types = array('I' => 'Intangible', + 'T' => 'Tangible'); + + protected $payment_url = array('T' => 'https://customer.test.at.cash-ticket.com/ctcustomer/GetCustomerPanelServlet', + 'P' => 'https://customer.cc.at.cash-ticket.com/ctcustomer/GetCustomerPanelServlet'); + + protected $supported_currencies = array('CHF', 'DKK', 'SEK', 'PLN', 'GBP', 'EUR', 'USD', 'CZK'); + + protected $certificat_dir; + + protected $register_url = array('en' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/uk', + 'fr' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/fr', + 'es' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/es'); + + public function __construct() + { + $this->name = 'cashticket'; + $this->tab = 'payments_gateways'; + $this->version = 1.2; + $this->module_dir = dirname(__FILE__); + $this->certificat_dir = dirname(__FILE__).'/keyring/'; + + parent::__construct(); + + $this->displayName = $this->l('CashTicket'); + $this->description = $this->l('Accepts payments by CashTicket'); + } + + + public function getL($key) + { + $translations = array( + 'disposition_created' => $this->l('Disposition created. Waiting for debit.'), + 'disposition_invalid' => $this->l('Invalid disposition state:'), + 'payment_error' => $this->l('An error has occurred during payment:'), + 'payment_accepted' => $this->l('Payment accepted.'), + 'curl_required' => $this->l('This module requires the curl PHP extension to function properly.'), + 'not_writable' => $this->l('is not writable!'), + 'currency_required' => $this->l('This module requires the currency: '), + 'configure_currency' => $this->l('Configure each currency individually:'), + 'payment_not_displayed' => $this->l('(The payment module won\'t be displayed for customers using non configured currency.)'), + 'configuration_in' => $this->l('Configuration in '), + 'merchant_id' => $this->l('Merchant ID'), + 'keyring_certificate' => $this->l('Keyring Certificate'), + 'keyring_pw' => $this->l('Keyring PW'), + 'configuration' => $this->l('Configuration'), + 'environment' => $this->l('Environment'), + 'business_type' => $this->l('Business Type'), + 'immediat_payment' => $this->l('Immediate Payment'), + 'update_configuration' => $this->l('Update configuration'), + 'certificate_required' => $this->l('You must provide a certificate for MERCHANT ID'), + 'invalid_file' => $this->l('Invalid file'), + 'invalid_merchant_id' => $this->l('Invalid Merchant ID'), + 'invalid_business_type' => $this->displayError('Invalid business type'), + 'invalid_environment' => $this->displayError('Invalid environment'), + 'settings_updated' => $this->l('Settings updated'), + 'file_partialy_uploaded' => $this->l('The file was partially uploaded'), + 'file_empty' => $this->l('The file is empty'), + 'cant_create_dispo' => $this->l('Transaction could not be initiated due to connection problems. If the problem persists, please contact our support.'), + 'disposition_consumed' => $this->l('Disposition consumed'), + 'payment_released' => $this->l('Disposition released'), + 'release_error' => $this->l('An error has occurred during the release.'), + 'introduction' => $this->l('Accept prepaid payments in your webshop. All that is required is the Cash-Ticket’s 16 digit pin code. This way, consumers can make online payments without a credit card or a bank account.'), + 'register' => $this->l('Learn more') + ); + + return $translations[$key]; + } + + protected function _getErrorMsgFromErrorCode($error_code) + { + $error_msg = array(1 => $this->l('An error has occurred, check Messages for more info.'), + 2 => $this->l('Invalid amount')); + + return $error_msg[$error_code]; + } +} + diff --git a/modules/cashticket/config.xml b/modules/cashticket/config.xml new file mode 100755 index 000000000..86f62e3ab --- /dev/null +++ b/modules/cashticket/config.xml @@ -0,0 +1,11 @@ + + + cashticket + CashTicket + 1.2 + Accepts payments by CashTicket + + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/cashticket/de.php b/modules/cashticket/de.php new file mode 100644 index 000000000..7424c8622 --- /dev/null +++ b/modules/cashticket/de.php @@ -0,0 +1,51 @@ +cashticket-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Die Zahlung wurde noch nicht akzeptiert:'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Zahlung akzeptieren '; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Zu zahlender Betrag'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Sie haben die '; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = 'Methode gewählt.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Ihre Bestellung wird sehr bald geschickt werden.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unser'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{cashticket}prestashop>cashticket_4512bbd48918c03027387a6c8e911342'] = 'CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_21d3d890383dc93343ce57c221ce5b3d'] = 'Akzeptiert Zahlungen per CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposition erstellt. Wartet auf Abbuchung.'; +$_MODULE['<{cashticket}prestashop>cashticket_894f0316a71ef67255369c82bf8a0e5b'] = 'Ungültiger Dispositionsstatus:'; +$_MODULE['<{cashticket}prestashop>cashticket_c1c25198721552ea8ddd963c7278d4ab'] = 'Ein Fehler ist bei der Zahlung aufgetreten:'; +$_MODULE['<{cashticket}prestashop>cashticket_36ec50c0e914dd2fb48a1b27540512ce'] = 'Zahlung akzeptiert.'; +$_MODULE['<{cashticket}prestashop>cashticket_d6ca44369efe062cec0c09f392465f55'] = 'Dieses Modul erfordert die Locke PHP-Erweiterung, um ordnungsgemäß zu funktionieren.'; +$_MODULE['<{cashticket}prestashop>cashticket_fe9da2c5e2e153d2415b4cd5d91166a4'] = 'ist nicht beschreibbar!'; +$_MODULE['<{cashticket}prestashop>cashticket_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Dieses Modul erfordert die Währung:'; +$_MODULE['<{cashticket}prestashop>cashticket_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Konfigurieren Sie jede Währung einzeln:'; +$_MODULE['<{cashticket}prestashop>cashticket_69a530f77bb82f704b9ff5e18bbdea6f'] = '(Dias Zahlungsmodul wird Kunden, die eine nicht konfigurierte Währung nutzen, nicht angezeigt.)'; +$_MODULE['<{cashticket}prestashop>cashticket_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Konfiguration im'; +$_MODULE['<{cashticket}prestashop>cashticket_229a7ec501323b94db7ff3157a7623c9'] = 'Händler-ID'; +$_MODULE['<{cashticket}prestashop>cashticket_845314022daaa8b665e718c4b51738aa'] = 'Keyring-Zertifikat'; +$_MODULE['<{cashticket}prestashop>cashticket_a01813de717585e9ac9458bbfc54485a'] = 'ing-PW'; +$_MODULE['<{cashticket}prestashop>cashticket_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{cashticket}prestashop>cashticket_0ba29c6a1afacf586b03a26162c72274'] = 'Umgebung'; +$_MODULE['<{cashticket}prestashop>cashticket_1d5ad3d37f236c9eebda547690373bba'] = 'Geschäftsart'; +$_MODULE['<{cashticket}prestashop>cashticket_b024248d9fecf8c34f629e89a9fb93b4'] = 'Sofortige Zahlung'; +$_MODULE['<{cashticket}prestashop>cashticket_c80a51a60c5ee43553c3881459b8f431'] = 'Konfiguration aktualisieren'; +$_MODULE['<{cashticket}prestashop>cashticket_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Sie müssen ein Zertifikat für die HÄNDLER-ID vorweisen'; +$_MODULE['<{cashticket}prestashop>cashticket_bbced877c13c763f0141ff906c8ed0e5'] = 'Ungültige Datei'; +$_MODULE['<{cashticket}prestashop>cashticket_97e5793f511c7930ab295997cb28553a'] = 'Ungültige Verkäufer-ID'; +$_MODULE['<{cashticket}prestashop>cashticket_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{cashticket}prestashop>cashticket_a98658e7f6aa80803873db3a3e982f4d'] = 'Die Datei wurde teilweise hochgeladen'; +$_MODULE['<{cashticket}prestashop>cashticket_d2bbf245e9591814fe994df3cae95964'] = 'Die Datei ist leer'; +$_MODULE['<{cashticket}prestashop>cashticket_ebbe99d835c79ead89db1b2b9e4fe70f'] = 'Transaktion konnte nicht initiiert werden aufgrund von Problemen mit der Verbindung. Wenn das Problem weiterhin besteht, wenden Sie sich bitte an unseren Support.'; +$_MODULE['<{cashticket}prestashop>cashticket_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposition verbraucht'; +$_MODULE['<{cashticket}prestashop>cashticket_c3e260f43a99b6fd907538953fe700d0'] = 'Disposition freigegeben'; +$_MODULE['<{cashticket}prestashop>cashticket_12879ec2c367483dd59ef7442178d124'] = 'Ein Fehler ist aufgetreten während der Freigabe'; +$_MODULE['<{cashticket}prestashop>cashticket_d929c5e5e5643c622400e837914206da'] = 'Akzeptieren Sie Prepaid-Zahlungen in Ihrem Webshop. Alles, was man benötigt, um in einem Web-Shop zu bezahlen, ist der 16-stellige PIN-Code von Cash-Ticket . Auf diese Weise können die Verbraucher Online-Zahlungen ohne Kreditkarte oder Bankkonto vornehmen.'; +$_MODULE['<{cashticket}prestashop>cashticket_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr'; +$_MODULE['<{cashticket}prestashop>cashticket_930320ced1b8c376237844049b570a7f'] = 'Ein Fehler ist aufgetreten, überprüfen Sie die Nachrichten für mehr Infos'; +$_MODULE['<{cashticket}prestashop>cashticket_a9ced76f2dd6907220fa95b3a136b04a'] = 'Ungültiger Betrag'; +$_MODULE['<{cashticket}prestashop>disposition-error_393988def796f78c4b673b90548f3afa'] = 'Der Dispositionsstauts ist ungültig'; +$_MODULE['<{cashticket}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Sie sind nicht berechtigt, die Zahlung durchzuführen.'; +$_MODULE['<{cashticket}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Bezahlen Sie mit'; diff --git a/modules/cashticket/disposition-error.tpl b/modules/cashticket/disposition-error.tpl new file mode 100644 index 000000000..951a63ff5 --- /dev/null +++ b/modules/cashticket/disposition-error.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +
        + {$payment_name} + +

        + {l s='The disposition state is invalid' mod='cahsticket'} ({$disposition_state}) + {l s='. You are not allowed to perform the payment.' mod='cashticket'} + +

        +
        + diff --git a/modules/cashticket/es.php b/modules/cashticket/es.php new file mode 100755 index 000000000..e3f653868 --- /dev/null +++ b/modules/cashticket/es.php @@ -0,0 +1,51 @@ +cashticket-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'El pago aún no ha sido aceptado'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Aceptar el pago'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Rechazar el pago'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ha sido registrado.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Ha elegido pagar con'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = 'modo'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Le enviaremos su pedido rápidamente'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta, póngase en contacto con '; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'el servicio clientela'; +$_MODULE['<{cashticket}prestashop>cashticket_4512bbd48918c03027387a6c8e911342'] = 'CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_21d3d890383dc93343ce57c221ce5b3d'] = 'Aceptar los pagos a través de CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposición creada. En espera del débito'; +$_MODULE['<{cashticket}prestashop>cashticket_894f0316a71ef67255369c82bf8a0e5b'] = 'El estado de la disposición no es válido:'; +$_MODULE['<{cashticket}prestashop>cashticket_c1c25198721552ea8ddd963c7278d4ab'] = 'Se ha producido un error durante el pago:'; +$_MODULE['<{cashticket}prestashop>cashticket_36ec50c0e914dd2fb48a1b27540512ce'] = 'Pago aceptado.'; +$_MODULE['<{cashticket}prestashop>cashticket_d6ca44369efe062cec0c09f392465f55'] = 'Este módulo requiere la librería PHP cURL para funcionar correctamente.'; +$_MODULE['<{cashticket}prestashop>cashticket_fe9da2c5e2e153d2415b4cd5d91166a4'] = 'No tiene derechos de escritura.'; +$_MODULE['<{cashticket}prestashop>cashticket_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Para funcionar correctamente, este módulo necesita la divisa:'; +$_MODULE['<{cashticket}prestashop>cashticket_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configurar cada divisa independientemente:'; +$_MODULE['<{cashticket}prestashop>cashticket_69a530f77bb82f704b9ff5e18bbdea6f'] = '(El módulo de pago no se mostrará a los clientes que utilicen una divisa no configurada'; +$_MODULE['<{cashticket}prestashop>cashticket_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configuración en'; +$_MODULE['<{cashticket}prestashop>cashticket_229a7ec501323b94db7ff3157a7623c9'] = 'ID vendedor'; +$_MODULE['<{cashticket}prestashop>cashticket_845314022daaa8b665e718c4b51738aa'] = 'Certificado Keyring'; +$_MODULE['<{cashticket}prestashop>cashticket_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{cashticket}prestashop>cashticket_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{cashticket}prestashop>cashticket_0ba29c6a1afacf586b03a26162c72274'] = 'Entorno'; +$_MODULE['<{cashticket}prestashop>cashticket_1d5ad3d37f236c9eebda547690373bba'] = 'Tipo de negocio'; +$_MODULE['<{cashticket}prestashop>cashticket_b024248d9fecf8c34f629e89a9fb93b4'] = 'Pago inmediato'; +$_MODULE['<{cashticket}prestashop>cashticket_c80a51a60c5ee43553c3881459b8f431'] = 'Actualizar la configuración'; +$_MODULE['<{cashticket}prestashop>cashticket_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Debe disponer de un certificado para el ID vendedor'; +$_MODULE['<{cashticket}prestashop>cashticket_bbced877c13c763f0141ff906c8ed0e5'] = 'Archivo no válido'; +$_MODULE['<{cashticket}prestashop>cashticket_97e5793f511c7930ab295997cb28553a'] = 'ID vendedor no válida'; +$_MODULE['<{cashticket}prestashop>cashticket_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{cashticket}prestashop>cashticket_a98658e7f6aa80803873db3a3e982f4d'] = 'El archivo no se ha descargado correctamente'; +$_MODULE['<{cashticket}prestashop>cashticket_d2bbf245e9591814fe994df3cae95964'] = 'El archivo está vacío'; +$_MODULE['<{cashticket}prestashop>cashticket_ebbe99d835c79ead89db1b2b9e4fe70f'] = 'La transacción no ha podido inicializarse debido a problemas de conexión. Si el problema persiste, contáctenos.'; +$_MODULE['<{cashticket}prestashop>cashticket_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposición consumida'; +$_MODULE['<{cashticket}prestashop>cashticket_c3e260f43a99b6fd907538953fe700d0'] = 'Disposición abandonada'; +$_MODULE['<{cashticket}prestashop>cashticket_12879ec2c367483dd59ef7442178d124'] = 'Se ha producido un error en el momento de abandonar.'; +$_MODULE['<{cashticket}prestashop>cashticket_d929c5e5e5643c622400e837914206da'] = 'Acepte los pagos con prepago en su tienda en línea. Cash-Ticket es un método de pago seguro y sencillo para Internet. Cash-Ticket permite pagos sin tarjeta de crédito ni datos bancarios personales. Lo único que se necesita para pagar en una tienda en línea es un código PIN de 16 cifras. Así, los consumidores pueden realizar pagos en línea sin tarjeta de crédito ni cuenta bancaria. '; +$_MODULE['<{cashticket}prestashop>cashticket_d59048f21fd887ad520398ce677be586'] = 'Más información'; +$_MODULE['<{cashticket}prestashop>cashticket_930320ced1b8c376237844049b570a7f'] = 'Se ha producido un error. Consulte el apartado \"Mensajes\" para más información'; +$_MODULE['<{cashticket}prestashop>cashticket_a9ced76f2dd6907220fa95b3a136b04a'] = 'Importe incorrecto'; +$_MODULE['<{cashticket}prestashop>disposition-error_393988def796f78c4b673b90548f3afa'] = 'La disposición se encuentra en un estado no válido'; +$_MODULE['<{cashticket}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = 'No tiene autorización para recuperar el pago.'; +$_MODULE['<{cashticket}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Pagar con'; diff --git a/modules/cashticket/fr.php b/modules/cashticket/fr.php new file mode 100755 index 000000000..c3641498c --- /dev/null +++ b/modules/cashticket/fr.php @@ -0,0 +1,51 @@ +cashticket-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Le paiement n\'a pas encore été accepté : '; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Accepter le paiement'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Relacher le paiement'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur '; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'a bien été enregistrée.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Vous avez choisi de payer avec '; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = ' '; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Votre commande va être expediée rapidement.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toutes questions ou informations complémentaires, contactez notre'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'service client'; +$_MODULE['<{cashticket}prestashop>cashticket_4512bbd48918c03027387a6c8e911342'] = 'CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_21d3d890383dc93343ce57c221ce5b3d'] = 'Accepter les paiements via CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposition crée. En attente du débit.'; +$_MODULE['<{cashticket}prestashop>cashticket_894f0316a71ef67255369c82bf8a0e5b'] = 'L\'état de la disposition est invalide :'; +$_MODULE['<{cashticket}prestashop>cashticket_c1c25198721552ea8ddd963c7278d4ab'] = 'Une erreur est survenue pendant le paiement :'; +$_MODULE['<{cashticket}prestashop>cashticket_36ec50c0e914dd2fb48a1b27540512ce'] = 'Paiement accepté.'; +$_MODULE['<{cashticket}prestashop>cashticket_d6ca44369efe062cec0c09f392465f55'] = 'Ce module requiert la librairie PHP cURL pour fonctionner correctement.'; +$_MODULE['<{cashticket}prestashop>cashticket_fe9da2c5e2e153d2415b4cd5d91166a4'] = 'n\'a pas les droits en écriture.'; +$_MODULE['<{cashticket}prestashop>cashticket_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Ce module pour fonctionner correctement requiert la devise :'; +$_MODULE['<{cashticket}prestashop>cashticket_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configurer chaque devise indépendament :'; +$_MODULE['<{cashticket}prestashop>cashticket_69a530f77bb82f704b9ff5e18bbdea6f'] = '(Le module de paiement ne sera pas affiché pour les clients qui utilisent une devise non configurée)'; +$_MODULE['<{cashticket}prestashop>cashticket_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configuration en'; +$_MODULE['<{cashticket}prestashop>cashticket_229a7ec501323b94db7ff3157a7623c9'] = 'ID Marchand'; +$_MODULE['<{cashticket}prestashop>cashticket_845314022daaa8b665e718c4b51738aa'] = 'Keyring Certificat'; +$_MODULE['<{cashticket}prestashop>cashticket_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{cashticket}prestashop>cashticket_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{cashticket}prestashop>cashticket_0ba29c6a1afacf586b03a26162c72274'] = 'Environement'; +$_MODULE['<{cashticket}prestashop>cashticket_1d5ad3d37f236c9eebda547690373bba'] = 'Business Type'; +$_MODULE['<{cashticket}prestashop>cashticket_b024248d9fecf8c34f629e89a9fb93b4'] = 'Paiement immédiat'; +$_MODULE['<{cashticket}prestashop>cashticket_c80a51a60c5ee43553c3881459b8f431'] = 'Mettre à jour la configuration'; +$_MODULE['<{cashticket}prestashop>cashticket_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Vous devez fournir un certificat pour l\'ID marchand'; +$_MODULE['<{cashticket}prestashop>cashticket_bbced877c13c763f0141ff906c8ed0e5'] = 'Fichier invalide'; +$_MODULE['<{cashticket}prestashop>cashticket_97e5793f511c7930ab295997cb28553a'] = 'ID marchand invalide'; +$_MODULE['<{cashticket}prestashop>cashticket_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{cashticket}prestashop>cashticket_a98658e7f6aa80803873db3a3e982f4d'] = 'Le fichier n\'a pas été téléchargé correctement'; +$_MODULE['<{cashticket}prestashop>cashticket_d2bbf245e9591814fe994df3cae95964'] = 'Le fichier est vide'; +$_MODULE['<{cashticket}prestashop>cashticket_ebbe99d835c79ead89db1b2b9e4fe70f'] = 'La transaction n\'a pu être initialisée du à des problèmes de connexions. Si le problème persiste, merci de nous contacter.'; +$_MODULE['<{cashticket}prestashop>cashticket_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposition consommée'; +$_MODULE['<{cashticket}prestashop>cashticket_c3e260f43a99b6fd907538953fe700d0'] = 'Disposition relachée'; +$_MODULE['<{cashticket}prestashop>cashticket_12879ec2c367483dd59ef7442178d124'] = 'Une erreur est survenue au moment de la relache.'; +$_MODULE['<{cashticket}prestashop>cashticket_d929c5e5e5643c622400e837914206da'] = 'Acceptez les paiements prépayés dans votre boutique en ligne. Cash-Ticket est une méthode de paiement simple et sécurisée pour l’internet. Cash-Ticket permet des paiements sans carte bancaires ni coordonnées bancaires personnelles. Tout ce qui est nécessaire pour payer dans une boutique en ligne est un code PIN de 16 chiffres. De cette façon les consommateurs peuvent réaliser des paiements en ligne sans carte de crédit ni même compte bancaire.'; +$_MODULE['<{cashticket}prestashop>cashticket_d59048f21fd887ad520398ce677be586'] = 'En savoir plus'; +$_MODULE['<{cashticket}prestashop>cashticket_930320ced1b8c376237844049b570a7f'] = 'Une erreur est survenue. Consulter la partie \"Messages\" ci-dessous pour plus d\'informations'; +$_MODULE['<{cashticket}prestashop>cashticket_a9ced76f2dd6907220fa95b3a136b04a'] = 'Montant incorrect'; +$_MODULE['<{cashticket}prestashop>disposition-error_393988def796f78c4b673b90548f3afa'] = 'La disposition est dans un état invalide'; +$_MODULE['<{cashticket}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Vous n\'êtes pas authorisé à récupérer le paiement.'; +$_MODULE['<{cashticket}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Payer avec'; diff --git a/modules/cashticket/img/payment-logo.png b/modules/cashticket/img/payment-logo.png new file mode 100644 index 000000000..a8c542c37 Binary files /dev/null and b/modules/cashticket/img/payment-logo.png differ diff --git a/modules/cashticket/img/payment-small.png b/modules/cashticket/img/payment-small.png new file mode 100644 index 000000000..33ea4e928 Binary files /dev/null and b/modules/cashticket/img/payment-small.png differ diff --git a/modules/cashticket/img/payment.png b/modules/cashticket/img/payment.png new file mode 100644 index 000000000..a8c542c37 Binary files /dev/null and b/modules/cashticket/img/payment.png differ diff --git a/modules/cashticket/it.php b/modules/cashticket/it.php new file mode 100644 index 000000000..c7b57c903 --- /dev/null +++ b/modules/cashticket/it.php @@ -0,0 +1,51 @@ +cashticket-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Il pagamento non è stato ancora accettato:'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Accetta il pagamento'; +$_MODULE['<{cashticket}prestashop>cashticket-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Emetti il pagamento'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine sul'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Hai scelto il'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = 'metodo.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{cashticket}prestashop>cashticket-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{cashticket}prestashop>cashticket_4512bbd48918c03027387a6c8e911342'] = 'CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_21d3d890383dc93343ce57c221ce5b3d'] = 'Si accettano pagamenti tramite CashTicket'; +$_MODULE['<{cashticket}prestashop>cashticket_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposizione creata. In attesa di addebito.'; +$_MODULE['<{cashticket}prestashop>cashticket_894f0316a71ef67255369c82bf8a0e5b'] = 'Stato della disposizione non valido:'; +$_MODULE['<{cashticket}prestashop>cashticket_c1c25198721552ea8ddd963c7278d4ab'] = 'Si è verificato un errore durante il pagamento:'; +$_MODULE['<{cashticket}prestashop>cashticket_36ec50c0e914dd2fb48a1b27540512ce'] = 'Pagamento accettato.'; +$_MODULE['<{cashticket}prestashop>cashticket_d6ca44369efe062cec0c09f392465f55'] = 'Questo modulo richiede che l\'estensione curl di PHP funzioni correttamente.'; +$_MODULE['<{cashticket}prestashop>cashticket_fe9da2c5e2e153d2415b4cd5d91166a4'] = 'non è scrivibile!'; +$_MODULE['<{cashticket}prestashop>cashticket_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Questo modulo richiede la valuta:'; +$_MODULE['<{cashticket}prestashop>cashticket_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configura ogni valuta singolarmente:'; +$_MODULE['<{cashticket}prestashop>cashticket_69a530f77bb82f704b9ff5e18bbdea6f'] = '(Il modulo di pagamento non sarà visualizzato per i clienti che utilizzano una valuta non configurata.)'; +$_MODULE['<{cashticket}prestashop>cashticket_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configurazione in'; +$_MODULE['<{cashticket}prestashop>cashticket_229a7ec501323b94db7ff3157a7623c9'] = 'ID commerciante'; +$_MODULE['<{cashticket}prestashop>cashticket_845314022daaa8b665e718c4b51738aa'] = 'Certificato keyring'; +$_MODULE['<{cashticket}prestashop>cashticket_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{cashticket}prestashop>cashticket_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{cashticket}prestashop>cashticket_0ba29c6a1afacf586b03a26162c72274'] = 'Ambiente'; +$_MODULE['<{cashticket}prestashop>cashticket_1d5ad3d37f236c9eebda547690373bba'] = 'Tipo di business'; +$_MODULE['<{cashticket}prestashop>cashticket_b024248d9fecf8c34f629e89a9fb93b4'] = 'Pagamento immediato'; +$_MODULE['<{cashticket}prestashop>cashticket_c80a51a60c5ee43553c3881459b8f431'] = 'Aggiorna la configurazione'; +$_MODULE['<{cashticket}prestashop>cashticket_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Devi fornire un certificato per ID COMMERCIANTE'; +$_MODULE['<{cashticket}prestashop>cashticket_bbced877c13c763f0141ff906c8ed0e5'] = 'File non valido'; +$_MODULE['<{cashticket}prestashop>cashticket_97e5793f511c7930ab295997cb28553a'] = 'ID commerciante non valido'; +$_MODULE['<{cashticket}prestashop>cashticket_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{cashticket}prestashop>cashticket_a98658e7f6aa80803873db3a3e982f4d'] = 'Il file è stato parzialmente caricato'; +$_MODULE['<{cashticket}prestashop>cashticket_d2bbf245e9591814fe994df3cae95964'] = 'Il file è vuoto'; +$_MODULE['<{cashticket}prestashop>cashticket_ebbe99d835c79ead89db1b2b9e4fe70f'] = 'Operazione non avviata a causa di problemi di connessione. Se il problema persiste, si prega di contattare il nostro supporto.'; +$_MODULE['<{cashticket}prestashop>cashticket_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposizione consumata'; +$_MODULE['<{cashticket}prestashop>cashticket_c3e260f43a99b6fd907538953fe700d0'] = 'Disposizione emessa'; +$_MODULE['<{cashticket}prestashop>cashticket_12879ec2c367483dd59ef7442178d124'] = 'Si è verificato un errore durante l\'emissione'; +$_MODULE['<{cashticket}prestashop>cashticket_d929c5e5e5643c622400e837914206da'] = 'Accetta pagamenti prepagati nel tuo shop online. Tutto ciò che è richiesto per pagare in un negozio web è codice PIN a 16 cifre di Cash-Ticket. In questo modo, i consumatori possono effettuare pagamenti online senza carta di credito o un conto bancario.'; +$_MODULE['<{cashticket}prestashop>cashticket_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più'; +$_MODULE['<{cashticket}prestashop>cashticket_930320ced1b8c376237844049b570a7f'] = 'Si verificato un errore, controlla i messaggi per maggiori informazioni'; +$_MODULE['<{cashticket}prestashop>cashticket_a9ced76f2dd6907220fa95b3a136b04a'] = 'Importo non valido'; +$_MODULE['<{cashticket}prestashop>disposition-error_393988def796f78c4b673b90548f3afa'] = 'Stato della disposizione non valido'; +$_MODULE['<{cashticket}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Non sei autorizzato ad effettuare il pagamento.'; +$_MODULE['<{cashticket}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Paga con'; diff --git a/modules/cashticket/keyring/.htaccess b/modules/cashticket/keyring/.htaccess new file mode 100755 index 000000000..3a4288278 --- /dev/null +++ b/modules/cashticket/keyring/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/modules/cashticket/keyring/paysafecard-CA.pem b/modules/cashticket/keyring/paysafecard-CA.pem new file mode 100644 index 000000000..2df56c61d --- /dev/null +++ b/modules/cashticket/keyring/paysafecard-CA.pem @@ -0,0 +1,227 @@ +-----BEGIN CERTIFICATE----- +MIIFszCCBJugAwIBAgIBADANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3DQEJ +ARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll +bm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJvb3Qg +Q0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUGA1UE +AxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQMB4XDTAyMDExMDE2NDU0 +M1oXDTM4MDExMDE2NDU0M1owge8xITAfBgkqhkiG9w0BCQEWEmNhQHBheXNhZmVj +YXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMG +Vmllbm5hMRwwGgYDVQQLExNwYXlzYWZlY2FyZCBSb290IENBMSwwKgYDVQQLEyNw +YXlzYWZlY2FyZCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEmMCQGA1UEChMdcGF5 +c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNVBAMTHnBheXNhZmVjYXJk +IFJvb3QgQ0EgLSBTeXN0ZW0gUDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALRAMIFNZR16P4ggPR6hlyXGSONVOklx7U3Xg9zihKA4vmzVMwXUJPP+lHCU +OKiYUSU+cQ+BMfTJCJPvJlqOHH36+ugyGQLI2M9Lq7ILxkGJ3+iQJx4ON1Yf3lJh +uyPLMjvRVCOoN29fUOROfdBxlAGNG33kKYNEh+VJ+ibxX5DmZApsMu6lJJ7LUZvs +2Rho6r9wKQVZaPNeWzJb+7dgLlW7XLIQIv6Fp/bMhZDPhCrX4rN0iiR7I9o5DZiJ +OXwRmWhroRUEo9pPf44XMfdEyaWDK6tbnIsEa7gTOPY3Zt5SMFeSYw1E0OjkUyFo +WL0NoAT7beVqJar+zzwvOjVaeMUCAwEAAaOCAVYwggFSMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFCgXaDOdI1dXvmnxpQ1ZM3M/BK07MIIBHgYDVR0jBIIBFTCC +ARGAFCgXaDOdI1dXvmnxpQ1ZM3M/BK07oYH1pIHyMIHvMSEwHwYJKoZIhvcNAQkB +FhJjYUBwYXlzYWZlY2FyZC5jb20xCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVu +bmExDzANBgNVBAcTBlZpZW5uYTEcMBoGA1UECxMTcGF5c2FmZWNhcmQgUm9vdCBD +QTEsMCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +JjAkBgNVBAoTHXBheXNhZmVjYXJkLmNvbSBXZXJ0a2FydGVuIEFHMScwJQYDVQQD +Ex5wYXlzYWZlY2FyZCBSb290IENBIC0gU3lzdGVtIFCCAQAwDQYJKoZIhvcNAQEE +BQADggEBAEkGu19kW0cROxNmEIhlF2LMFA8Jj9Y5aPPDwM1tMIoZtFWCH1g1g0Zl +PDrp9+ihDFimiXfhIosGvnrclbQ5yIJnxoNmDptkCKTAB+4rPoHSIz8rjCHHTOU2 +rJMVdFvS8hcVkallN1g9o8g7ryA2vRltum5NZUBwAFq986Cur4l2koRzz1UyOkrT +0G0i8cQIR9trGuCaUbhIFTBe/QvSNkIEqDWRDPLfBQnYnBFSwObH5uXiToUXlTnM +/aOuY+p2D8Oh6MneD6nh8turvFTMkLqLS7DzjQAYmF7HWGkRFPsHi2EtLFVIwM9q +FioR7mWBcKh2lZr18AtzGIkKQSQWQkI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCBKKgAwIBAgIEIAAABjANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3 +DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMG +Vmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJv +b3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUG +A1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQMB4XDTAyMDExNjEy +MTUxN1oXDTM0MDExNjEyMTUxN1owgfMxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZW +aWVubmExDzANBgNVBAcTBlZpZW5uYTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29t +IFdlcnRrYXJ0ZW4gQUcxHjAcBgNVBAsTFXBheXNhZmVjYXJkIFNlcnZlciBDQTEs +MCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxKTAn +BgNVBAMTIHBheXNhZmVjYXJkIFNlcnZlciBDQSAtIFN5c3RlbSBQMSEwHwYJKoZI +hvcNAQkBFhJjYUBwYXlzYWZlY2FyZC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDGbD6yVmszQYpuUX0zVyam8DdqPXfY5c8OSQK7u8I7mPoEw0SG +lxSbHy7Aywlx5rhSr6j1k0HgmnOsO6j6bup5CXGvGBWkiahN1TrUN8qAZvIdorUz ++YrZyg/EkddrOqkgZpaqyEEJ2wGdM3Lhbg8oBWufVh/TX0sA9K0NCSrl3UzKLw0n +mEVbUnBxRUGbctnOkmLiIWqX7o8jmupvE7lIvRPLHUyFKGp0Wn2oKosr3fhCQxEU +4dQdH9Uwf53kPt0Ct0MML1p1u8OAN4e6bYL1T86YA/bnaaPFI5D4cVP66X1gcamM ++ro//XJOee2d1FM7lWoyA03ypt54SRB1N6aVAgMBAAGjggFWMIIBUjAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBSB6bcBOjQU0y5+rr8pbTyHYFxKbjCCAR4GA1Ud +IwSCARUwggERgBQoF2gznSNXV75p8aUNWTNzPwStO6GB9aSB8jCB7zEhMB8GCSqG +SIb3DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UE +CBMGVmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJk +IFJvb3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEn +MCUGA1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQggEAMA0GCSqG +SIb3DQEBBAUAA4IBAQAwuR+OYbQh8+2A8Ya48pGbEbggbYfJYZAcfZlTxVeilkXb +jhinDfG4mBuvsW8RG7CW1fnHYlytyN9AVJFHchB57SkfDDxhPYI6WBsJTnDaxROa +QzW0r6Pi3e5XAtqC221vKYYC5OoMBq+S+LWUc9kSYX7PAm3ObCEPNBirJMDDwSLm +iovY3UHByFeJ8dYM5u7wKM+WRBzIEi4dMk5VWWx7KO7fieGTxqVCPa1Bd1GQV3yq +Z5P0lzduqD2M1oUr1BCwiivxpHO4aMYo9lVz7ZMFhbyDLiiQqcR3unVKpSpN4oAq +TW3iZ32LXHkLFSCEFinOO43/uWk8+RzNR0N+XZ1F +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFszCCBJugAwIBAgIBADANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3DQEJ +ARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll +bm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJvb3Qg +Q0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUGA1UE +AxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNMB4XDTAyMDExMDE1MDUx +M1oXDTM4MDExMDE1MDUxM1owge8xITAfBgkqhkiG9w0BCQEWEmNhQHBheXNhZmVj +YXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMG +Vmllbm5hMRwwGgYDVQQLExNwYXlzYWZlY2FyZCBSb290IENBMSwwKgYDVQQLEyNw +YXlzYWZlY2FyZCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEmMCQGA1UEChMdcGF5 +c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNVBAMTHnBheXNhZmVjYXJk +IFJvb3QgQ0EgLSBTeXN0ZW0gTTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALtYbwxejm8ZTdZmvLG1TtVHMGyIVnTFeyIbt7SUP4GjycrFs0GiWCJzYHAX +gEtwzIX3ibt3bIR62/itJ4ra/pkIUBDd1ARNM1F9R/MyE3Ci1SGmp1IyaFK2tQRX +dxHqIBZtH6hUSK750mxE9Ln+YjHjbkEnvXB49qIyJsvgQSPrvzldj+bBDpNyCppf +H16U55azIpq7gWvyqsFe/NeAp8iW8quhgZQWqXhPFMA/dypcwBwSTJSW/jVqfqhd +iRhEfZEeV6pBPtaZeeUUvWBgBccr39sQd3FUADH7d7AepxsiIxTDm971wn9bNiOM +YwCdfQlEYLlAhEc3XMRv5Mifnp8CAwEAAaOCAVYwggFSMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFEdDEuV3HVe81QNu5wgYE/h2K14EMIIBHgYDVR0jBIIBFTCC +ARGAFEdDEuV3HVe81QNu5wgYE/h2K14EoYH1pIHyMIHvMSEwHwYJKoZIhvcNAQkB +FhJjYUBwYXlzYWZlY2FyZC5jb20xCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVu +bmExDzANBgNVBAcTBlZpZW5uYTEcMBoGA1UECxMTcGF5c2FmZWNhcmQgUm9vdCBD +QTEsMCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +JjAkBgNVBAoTHXBheXNhZmVjYXJkLmNvbSBXZXJ0a2FydGVuIEFHMScwJQYDVQQD +Ex5wYXlzYWZlY2FyZCBSb290IENBIC0gU3lzdGVtIE2CAQAwDQYJKoZIhvcNAQEE +BQADggEBACJ9nG6+DmSxJKoqyCDaBUTCeVWk1jpBAvxR1Nwq68L25VYqWp8M0x74 +/Wd/rcut532BaStABiba+P5V4/VpV4cYlExPb2CCr1E3BWd9nMaJEqjFOdNfy2Aq +OZhTeKqKZ0oALhk61AdX7OmimW2DGe7jwEbZxtjcUBUMo+olSAqDD/oVmOLooQOE +oCHQ7U/+PFHtzO9Im7Jlq0fJESJSRheSbjItZSJxl18neu3xN58Ku9Pnu4pInyM+ +ObX4TJxmBbyRXlBkWfDWljih9MANqE/XkwOE3BlAt2haymRs/GSYiIWqNwTd2Rbx +NwdV0sBoOmFmSMNt7/NhXIT6GO3hFK4= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCBKKgAwIBAgIEEAAAAzANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3 +DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMG +Vmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJv +b3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUG +A1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNMB4XDTAyMDExMDE1 +MjE1OVoXDTM0MDExMDE1MjE1OVowgfMxITAfBgkqhkiG9w0BCQEWEmNhQHBheXNh +ZmVjYXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UE +BxMGVmllbm5hMR4wHAYDVQQLExVwYXlzYWZlY2FyZCBTZXJ2ZXIgQ0ExLDAqBgNV +BAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSYwJAYDVQQK +Ex1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEpMCcGA1UEAxMgcGF5c2Fm +ZWNhcmQgU2VydmVyIENBIC0gU3lzdGVtIE0wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQCySPf9dV1J73WgihZzq6PuFZw8G+5YgCG7KVvmm/unkabEHzQ7 +PKfHT0awGRfZgfsRzbLxnohaXDHE8e2whWjV5ZROXKpeYb7MhFcmPdPAuxx6lPD9 +jocbEA530vTonL3WrAPY9P4v48Upd8xTKy+HmdruBn80tOwnvJeSH+2Itm2Qo6cU +JslOxJYqmIu76aNbh/Is37rZV37zegkNr7RVpE82tUZR8CRnY46f+FrYEJYpZRVc +hg9NOM6fmswG7BAP4oLXOjOERR79Rom/ACZZNcz1PSBJRIarm2eXLUptlTfTR1lb +92wX+KGtYvcLFnr/2RkHDT2Wdcb8s3pI7bhxAgMBAAGjggFWMIIBUjAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBTNjfh4N1yNw7Bo/E0sMOrdcZbJ8TCCAR4GA1Ud +IwSCARUwggERgBRHQxLldx1XvNUDbucIGBP4diteBKGB9aSB8jCB7zEhMB8GCSqG +SIb3DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UE +CBMGVmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJk +IFJvb3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEn +MCUGA1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNggEAMA0GCSqG +SIb3DQEBBAUAA4IBAQAZ7naLoETGD8TW6lAbuZ7ntd9zNqutizAtPzC5bJRq2sL3 +AyIsSDO6jQnJgvHsW3XiBfYP0R8MGbMg5cLvgcyKHjnpkzcGEXFuvOeeh50oWSTl +aJ9VNTvvGK6nY4rQ710I6qCollj+pqlSq4sak/zYJ87lKc8TXEzvzyncYAfrRp3G +XIA5zG3TniBIYC/cuiXjBupmWelFCKRK8/Uhm0vbg71wAWrouJKcBkSMYgZCdEC6 +3g0EBmD94j9FBEiW7q4sUgqYxGTjeOv1Wb4EsHJhq2eBzOKLp+NHYbPzI++50nQU +AjKavlzdAr9PVC8BBS74M567rtIooeIgEDqqi/7J +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfjCCAuegAwIBAgIQAdAC7XDZlmGZ84pH2aljUjANBgkqhkiG9w0BAQUFADCB +zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ +Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE +CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh +d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl +cnZlckB0aGF3dGUuY29tMB4XDTA2MTAyNTAwMDAwMFoXDTA4MTAyNDIzNTk1OVow +gYIxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVubmExDzANBgNVBAcTBlZpZW5u +YTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxKTAnBgNV +BAMTIGN1c3RvbWVyLnRlc3QuYXQucGF5c2FmZWNhcmQuY29tMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQDgay0tcil7faWjhcRYg4HvOt9DA6llt87cxZtkGalY +Fvxr+tKLg2U031cbmQjRpCEXIWeZjIqOreZLK3PNYfQJi7C3m7bU2D8owt6xijt4 +reOsNH5nTy4NNt9J+tUVaRO0YCWG7O2v1T1L4QMwdHjHcsvpoO9NnFM/Sqmo8tSz +EwIDAQABo4GmMIGjMAwGA1UdEwEB/wQCMAAwQAYDVR0fBDkwNzA1oDOgMYYvaHR0 +cDovL2NybC50aGF3dGUuY29tL1RoYXd0ZVNlcnZlclByZW1pdW1DQS5jcmwwHQYD +VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMDIGCCsGAQUFBwEBBCYwJDAiBggr +BgEFBQcwAYYWaHR0cDovL29jc3AudGhhd3RlLmNvbTANBgkqhkiG9w0BAQUFAAOB +gQBzovJPMRON4GSrPeAZ93nDYHHfZMV2yUY0+8Kfi+5smLfV3VaurPjL8WSYA2mY +F1vI2tkNhAbELQwm/6RqrU7AG1wKnoyljzZ9V0Uk7Mfcw3Wg/uCTEtes9NNz6KbW +RM9X8CWd8gJGwTODZy4JU0qMWiETqPvbvzXTX0oihp2nEQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfDCCAuWgAwIBAgIQWAYuIHYD1tplIr6DdfOxoDANBgkqhkiG9w0BAQUFADCB +zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ +Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE +CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh +d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl +cnZlckB0aGF3dGUuY29tMB4XDTA2MTAyNTAwMDAwMFoXDTA4MTAyNDIzNTk1OVow +gYAxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVubmExDzANBgNVBAcTBlZpZW5u +YTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNV +BAMTHmN1c3RvbWVyLmNjLmF0LnBheXNhZmVjYXJkLmNvbTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAs1G3ieyBRUxgDLUAlqipvBtnlsb7W0TqcXYY9MF/XOyp +1KoS6xKcH6dV1PYGUi8roITcEPB2VBnR2lCpqjUwhmeJcXf2sJLIInf0J0ld05qE +G8I6tHh8DOylkN+G9NdbdWsHyQLxiqQ1TkLIAX28ioJziLVSJ0AU/Vw5MSj3x+UC +AwEAAaOBpjCBozAMBgNVHRMBAf8EAjAAMEAGA1UdHwQ5MDcwNaAzoDGGL2h0dHA6 +Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVTZXJ2ZXJQcmVtaXVtQ0EuY3JsMB0GA1Ud +JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAyBggrBgEFBQcBAQQmMCQwIgYIKwYB +BQUHMAGGFmh0dHA6Ly9vY3NwLnRoYXd0ZS5jb20wDQYJKoZIhvcNAQEFBQADgYEA +dLrNu1On6Vp5JWdeFmA0wZjrvbVSXmH3fGuuY5pw+RDDq5AVZ0ug5AoNO90DkAn5 +7s1zOelLs1imjS1MpPKOs7jgC+kbzW/PRFfY1oYSHZdSQGfmTjdz3PtT3XVWMmne +z4cv4RYpEiZrkrxL/fdd36E/Lo0GctmhlXBT7SiNM0g= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDhjCCAu+gAwIBAgIQeO5I3hhbIHHJycO1HXvdwTANBgkqhkiG9w0BAQUFADBfMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsTLkNsYXNzIDMgUHVi +bGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNOTcwNDE3MDAwMDAwWhcN +MTExMDI0MjM1OTU5WjCBujEfMB0GA1UEChMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEXMBUG +A1UECxMOVmVyaVNpZ24sIEluYy4xMzAxBgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwg +U2VydmVyIENBIC0gQ2xhc3MgMzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMgSW5j +b3JwLmJ5IFJlZi4gTElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEA2IKA6NYZAn0fhRg5JaJlK+G/1AXTvOY2O6rwTGxbtueqPHNFVbLx +veqXQu2aNAoV1Klc9UAl3dkHwTKydWzEyruj/lYncUOqY/UwPpMo5frxCTvzt01OOfdcSVq4 +wR3Tsor+cDCVQsv+K1GLWjw6+SJPkLICp1OcTzTnqwSye28CAwEAAaOB5jCB4zAPBgNVHRME +CDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHAQEwKjAoBggrBgEFBQcCARYcaHR0 +cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQUzA0BgNVHR8ELTArMCmgJ6AlhiNodHRwOi8vY3Js +LnZlcmlzaWduLmNvbS9wY2EzLWcyLmNybDA0BgNVHSUELTArBggrBgEFBQcDAQYIKwYBBQUH +AwIGCWCGSAGG+EIEAQYKYIZIAYb4RQEIATALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4GBACNd7qYkBf1202oa1rpGBqpqDwOQZrKwpsKeyR6jVVOv +PkX93Iwn3VM4Cbt8Syu6lUr+cE4badY8908HxfIXWkyij6wLigbbudRrxR1Y2hdS4yHx0tda +1eWrWXsheoZq1P4XETpTDZxgoErZXuQdDCmqEwdlhh+/tMmCU5wsAo8j +-----END CERTIFICATE----- + diff --git a/modules/cashticket/logo.gif b/modules/cashticket/logo.gif new file mode 100644 index 000000000..6153db471 Binary files /dev/null and b/modules/cashticket/logo.gif differ diff --git a/modules/cashticket/payment.php b/modules/cashticket/payment.php new file mode 100644 index 000000000..88e037a26 --- /dev/null +++ b/modules/cashticket/payment.php @@ -0,0 +1,105 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/cashticket.php'); + +$module = new CashTicket(); + +if (!$cart->id OR $cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$module->active) + Tools::redirect('order.php?step=3'); + +$currency = new Currency($cart->id_currency); +if (!$module->isCurrencyActive($currency->iso_code)) + Tools::redirect('order.php?step=3'); + +$amount = number_format((float)($cart->getOrderTotal(true, Cart::BOTH)), 2, '.',''); +if (Tools::getValue('hash') != md5(Configuration::get($module->prefix.'SALT') + $amount + $currency->iso_code)) + die(Tools::displayError()); + + + +$result = $module->getDispositionState((int)($cart->id)); +$state = _PS_OS_ERROR_; + +$disposition = Disposition::getByCartId((int)($cart->id)); + +$message = 'Transaction ID #'.$disposition['mtid'].': '.$disposition['amount'].$disposition['currency'].'
        '. date('Y-m-d').' '; +if ($result[0] == 0) +{ + list ($rc, $errorcode, $error_message, $amount, $used_currency, $state) = $result; + + if ($state == PrepaidServicesAPI::DISPOSITION_DISPOSED || $state == PrepaidServicesAPI::DISPOSITION_DEBITED) + { + $state = _PS_OS_PAYMENT_; + $message .= $module->getL('disposition_created'); + } else { + $message .= $module->getL('disposition_invalid').' '.$state; + } +} else { + $message .= 'payment_error'.' '.$result[2]; +} + +if ($state != _PS_OS_ERROR_) +{ + $state = (int)(Configuration::get($module->prefix.'ORDER_STATE_ID')); + + if (Configuration::get($module->prefix.'IMMEDIAT_PAYMENT')) + { + $message .= '
        '.date('Y-m-d').' '; + $result = $module->executeDebit((int)($cart->id)); + + if ($result[0] != 0) + { + $message .= $module->getL('payment_error').' '.$result[2]; + $state = _PS_OS_ERROR_; + } + else + { + $message .= $module->getL('payment_accepted'); + $state = _PS_OS_PAYMENT_; + } + } +} + + +$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key); + +if ($state == _PS_OS_ERROR_) +{ + include(dirname(__FILE__).'/../../header.php'); + echo $message; + include(dirname(__FILE__).'/../../footer.php'); +} +else +{ + $order = new Order($module->currentOrder); + Tools::redirect('order-confirmation.php?id_cart='.(int)($cart->id).'&id_module='.(int)($module->id).'&id_order='.(int)($module->currentOrder).'&key='.$order->secure_key); +} + + + diff --git a/modules/cashticket/payment.tpl b/modules/cashticket/payment.tpl new file mode 100644 index 000000000..155d61e50 --- /dev/null +++ b/modules/cashticket/payment.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + + {l s='Pay with' mod='cashticket'} {$payment_name} + +

        diff --git a/modules/cashticket/prepaidservices.js b/modules/cashticket/prepaidservices.js new file mode 100644 index 000000000..80bdf4926 --- /dev/null +++ b/modules/cashticket/prepaidservices.js @@ -0,0 +1,38 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function toggleImediatPayment() +{ + if ($('#ct_business_type').val() == 'I') + $('#imediat_payment').hide(); + else + $('#imediat_payment').show(); +} + +$(document).ready(function() { + toggleImediatPayment(); +}); + diff --git a/modules/cashticket/redirect.php b/modules/cashticket/redirect.php new file mode 100644 index 000000000..ca03e7dc9 --- /dev/null +++ b/modules/cashticket/redirect.php @@ -0,0 +1,50 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/cashticket.php'); + +$module = new CashTicket(); + +if (!$cart->id OR $cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$module->active) + Tools::redirect('order.php?step=3'); + +$currency = new Currency($cart->id_currency); +if (!$module->isCurrencyActive($currency->iso_code)) + Tools::redirect('order.php?step=3'); + +$result = $module->createDisposition($cart); + +if ($result['return_code'] != 0) +{ + include(dirname(__FILE__).'/../../header.php'); + echo $module->getL('cant_create_dispo'); + include(dirname(__FILE__).'/../../footer.php'); +} +else + Tools::redirectLink($result['message']); + diff --git a/modules/cheque/cheque.jpg b/modules/cheque/cheque.jpg new file mode 100644 index 000000000..555f1f31c Binary files /dev/null and b/modules/cheque/cheque.jpg differ diff --git a/modules/cheque/cheque.php b/modules/cheque/cheque.php new file mode 100644 index 000000000..ca25549c8 --- /dev/null +++ b/modules/cheque/cheque.php @@ -0,0 +1,222 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Cheque extends PaymentModule +{ + private $_html = ''; + private $_postErrors = array(); + + public $chequeName; + public $address; + + public function __construct() + { + $this->name = 'cheque'; + $this->tab = 'payments_gateways'; + $this->version = '2.3'; + $this->author = 'PrestaShop'; + + $this->currencies = true; + $this->currencies_mode = 'checkbox'; + + $config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS')); + if (isset($config['CHEQUE_NAME'])) + $this->chequeName = $config['CHEQUE_NAME']; + if (isset($config['CHEQUE_ADDRESS'])) + $this->address = $config['CHEQUE_ADDRESS']; + + parent::__construct(); + + $this->displayName = $this->l('Check'); + $this->description = $this->l('Module for accepting payments by check.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); + + if (!isset($this->chequeName) OR !isset($this->address)) + $this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly.'); + if (!sizeof(Currency::checkPaymentCurrencies($this->id))) + $this->warning = $this->l('No currency set for this module'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) + return false; + return true; + } + + public function uninstall() + { + if (!Configuration::deleteByName('CHEQUE_NAME') OR !Configuration::deleteByName('CHEQUE_ADDRESS') OR !parent::uninstall()) + return false; + return true; + } + + private function _postValidation() + { + if (isset($_POST['btnSubmit'])) + { + if (empty($_POST['name'])) + $this->_postErrors[] = $this->l('\'To the order of\' field is required.'); + elseif (empty($_POST['address'])) + $this->_postErrors[] = $this->l('Address is required.'); + } + } + + private function _postProcess() + { + if (isset($_POST['btnSubmit'])) + { + Configuration::updateValue('CHEQUE_NAME', $_POST['name']); + Configuration::updateValue('CHEQUE_ADDRESS', $_POST['address']); + } + $this->_html .= '
        '.$this->l('OK').' '.$this->l('Settings updated').'
        '; + } + + private function _displayCheque() + { + $this->_html .= ''.$this->l('This module allows you to accept payments by check.').'

        + '.$this->l('If the client chooses this payment mode, the order status will change to \'Waiting for payment\'.').'
        + '.$this->l('Therefore, you will need to manually confirm the order as soon as you receive a check.').'


        '; + } + + private function _displayForm() + { + $this->_html .= + '
        +
        + '.$this->l('Contact details').' + + + + + + + + +
        '.$this->l('Please specify the name and address to which customers must send their check.').'.

        '.$this->l('To the order of').'
        '.$this->l('Address').'

        +
        +
        '; + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        '; + + if (!empty($_POST)) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= '
        '. $err .'
        '; + } + else + $this->_html .= '
        '; + + $this->_displayCheque(); + $this->_displayForm(); + + return $this->_html; + } + + public function execPayment($cart) + { + if (!$this->active) + return ; + + if (!$this->_checkCurrency($cart)) + Tools::redirectLink(__PS_BASE_URI__.'order.php'); + + global $cookie, $smarty; + + $smarty->assign(array( + 'nbProducts' => $cart->nbProducts(), + 'cust_currency' => $cart->id_currency, + 'currencies' => $this->getCurrency((int)$cart->id_currency), + 'total' => $cart->getOrderTotal(true, Cart::BOTH), + 'isoCode' => Language::getIsoById((int)($cookie->id_lang)), + 'chequeName' => $this->chequeName, + 'chequeAddress' => nl2br2($this->address), + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + + return $this->display(__FILE__, 'payment_execution.tpl'); + } + + public function hookPayment($params) + { + if (!$this->active) + return ; + if (!$this->_checkCurrency($params['cart'])) + return ; + + global $smarty; + + $smarty->assign(array( + 'this_path' => $this->_path, + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' + )); + return $this->display(__FILE__, 'payment.tpl'); + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + global $smarty; + $state = $params['objOrder']->getCurrentState(); + if ($state == _PS_OS_CHEQUE_ OR $state == _PS_OS_OUTOFSTOCK_) + $smarty->assign(array( + 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false, false), + 'chequeName' => $this->chequeName, + 'chequeAddress' => nl2br2($this->address), + 'status' => 'ok', + 'id_order' => $params['objOrder']->id + )); + else + $smarty->assign('status', 'failed'); + return $this->display(__FILE__, 'payment_return.tpl'); + } + + private function _checkCurrency($cart) + { + $currency_order = new Currency((int)($cart->id_currency)); + $currencies_module = $this->getCurrency((int)$cart->id_currency); + $currency_default = Configuration::get('PS_CURRENCY_DEFAULT'); + + if (is_array($currencies_module)) + foreach ($currencies_module AS $currency_module) + if ($currency_order->id == $currency_module['id_currency']) + return true; + } +} diff --git a/modules/cheque/config.xml b/modules/cheque/config.xml new file mode 100755 index 000000000..0932a2a62 --- /dev/null +++ b/modules/cheque/config.xml @@ -0,0 +1,12 @@ + + + cheque + Check + 2.3 + Module for accepting payments by check. + PrestaShop + payments_gateways + Are you sure you want to delete your details ? + 1 + 1 + \ No newline at end of file diff --git a/modules/cheque/de.php b/modules/cheque/de.php new file mode 100644 index 000000000..20bafd3b9 --- /dev/null +++ b/modules/cheque/de.php @@ -0,0 +1,49 @@ +cheque_060bf2d587991d8f090a1309b285291c'] = 'Scheck'; +$_MODULE['<{cheque}prestashop>cheque_44cd16893a0a7731735c02999cc81adc'] = 'Modul für die Annahme von Zahlungen per Scheck'; +$_MODULE['<{cheque}prestashop>cheque_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Details löschen wollen?'; +$_MODULE['<{cheque}prestashop>cheque_1fddeba3cee2a70b37a20889e124948a'] = '\'Zahlbar an\' und Adresse müssen konfiguriert werden, um dieses Modul richtig zu benutzen'; +$_MODULE['<{cheque}prestashop>cheque_4402acab1c8f90dcf4a31dc96833bd86'] = 'Keine Währung für dieses Modul eingestellte'; +$_MODULE['<{cheque}prestashop>cheque_a0048063a9be52816b7fa7f17aa3a2b7'] = '\'Zahlbar an\'-Feld ist ein Pflichtfeld.'; +$_MODULE['<{cheque}prestashop>cheque_4b5e20a521d31cc44b9690bd35eaacfc'] = 'Adresse ist ein Pflichtfeld.'; +$_MODULE['<{cheque}prestashop>cheque_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{cheque}prestashop>cheque_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{cheque}prestashop>cheque_14e41f4cfd99b10766cc15676d8cda66'] = 'Dieses Modul ermöglicht es Ihnen, Zahlungen per Scheck zu akzeptieren.'; +$_MODULE['<{cheque}prestashop>cheque_3b39b241f115e5823eeca07df2949a35'] = 'Wählt der Kunde diesen Zahlungsmodus, geht der Auftragsstatus in \"Warten auf Zahlung\" über.'; +$_MODULE['<{cheque}prestashop>cheque_4d96735a584217fd2d8a4edec43935d6'] = 'Daher müssen Sie die Bestellung manuell bestätigen, sobald Sie einen Scheck erhalten.'; +$_MODULE['<{cheque}prestashop>cheque_5dd532f0a63d89c5af0243b74732f63c'] = 'Kontaktangaben'; +$_MODULE['<{cheque}prestashop>cheque_d75e7b0f61c58d5d1cef7b56322c8b21'] = 'Bitte geben Sie den Namen und die Anschrift an, an die Kunden ihren Scheck schicken müssen '; +$_MODULE['<{cheque}prestashop>cheque_75475839e69bef6ed57a8200a5a71d37'] = 'Zahlbar an'; +$_MODULE['<{cheque}prestashop>cheque_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{cheque}prestashop>cheque_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen'; +$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Zahlung per Scheck'; +$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Zahlung per Scheck (Bestellungvorgang dauert länger)'; +$_MODULE['<{cheque}prestashop>payment_execution_83aa0e5744c86bf2d9d006319db14839'] = 'Scheckzahlung'; +$_MODULE['<{cheque}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Bestellsumme'; +$_MODULE['<{cheque}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Ihr Warenkorb ist leer.'; +$_MODULE['<{cheque}prestashop>payment_execution_c42b053ef8c36f950ff37a0897d3a963'] = 'Scheck'; +$_MODULE['<{cheque}prestashop>payment_execution_6b3ef039e038a131d05bcd208a1b9799'] = 'Sie haben sich entschieden, per Scheck zu bezahlen.'; +$_MODULE['<{cheque}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Hier ist eine kurze Zusammenfassung Ihrer Bestellung:'; +$_MODULE['<{cheque}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; +$_MODULE['<{cheque}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{cheque}prestashop>payment_execution_2f1585fcd1150d6a7d6edbe3468a63f8'] = 'Wir akzeptieren mehrere Währungen bei Scheckzahlungen.'; +$_MODULE['<{cheque}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Wählen Sie eine der folgenden Möglichkeiten:'; +$_MODULE['<{cheque}prestashop>payment_execution_c4309902a6192747d56f3539941acc49'] = 'Wir akzeptieren die folgende Währung per Scheck:'; +$_MODULE['<{cheque}prestashop>payment_execution_504be670f962fa7630863857a0085632'] = 'Scheckinhaber und Adressinformationen werden auf der nächsten Seite angezeigt.'; +$_MODULE['<{cheque}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \"Ich bestätige meine Bestellung\"'; +$_MODULE['<{cheque}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; +$_MODULE['<{cheque}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; +$_MODULE['<{cheque}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{cheque}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{cheque}prestashop>payment_return_e4ee6e0eac588fe2611cc6fd195828af'] = 'Bitte senden Sie uns einen Scheck über:'; +$_MODULE['<{cheque}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'folgenden Betrag'; +$_MODULE['<{cheque}prestashop>payment_return_84cca8efe379645790938f55b701a1a4'] = 'zahlbar an '; +$_MODULE['<{cheque}prestashop>payment_return_c5a6826dd3b059e32a3fa1ae029179de'] = 'E-Mail an'; +$_MODULE['<{cheque}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Eine E-Mail wurde Ihnen mit diesen Informationen gesendet.'; +$_MODULE['<{cheque}prestashop>payment_return_ffd2478830ca2f519f7fe7ee259d4b96'] = 'Ihre Bestellung wird gesendet werden, sobald wir Ihre Zahlung erhalten.'; +$_MODULE['<{cheque}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{cheque}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{cheque}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben bei Ihrer Bestellung ein Problem festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; diff --git a/modules/cheque/en.php b/modules/cheque/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/cheque/en.php @@ -0,0 +1,4 @@ +cheque_060bf2d587991d8f090a1309b285291c'] = 'Cheque'; +$_MODULE['<{cheque}prestashop>cheque_44cd16893a0a7731735c02999cc81adc'] = 'Módulo para aceptar pagos con cheques'; +$_MODULE['<{cheque}prestashop>cheque_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de querer eliminar todos sus datos?'; +$_MODULE['<{cheque}prestashop>cheque_1fddeba3cee2a70b37a20889e124948a'] = '\'A nombre de\' y \'dirección\', deben configurarse en el pedido para usar el módulo correctamente'; +$_MODULE['<{cheque}prestashop>cheque_4402acab1c8f90dcf4a31dc96833bd86'] = 'No hay moneda establcida para este módulo'; +$_MODULE['<{cheque}prestashop>cheque_a0048063a9be52816b7fa7f17aa3a2b7'] = 'El campo \'a nombre de\' es obligatorio.rnrn'; +$_MODULE['<{cheque}prestashop>cheque_4b5e20a521d31cc44b9690bd35eaacfc'] = 'La dirección es obligatoria.'; +$_MODULE['<{cheque}prestashop>cheque_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{cheque}prestashop>cheque_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{cheque}prestashop>cheque_14e41f4cfd99b10766cc15676d8cda66'] = 'Este módulo permite aceptar pagos con cheques.'; +$_MODULE['<{cheque}prestashop>cheque_3b39b241f115e5823eeca07df2949a35'] = 'Si el cliente selecciona este modo de pago, el pedido cambiará al estado de \'en espera de pago\'.'; +$_MODULE['<{cheque}prestashop>cheque_4d96735a584217fd2d8a4edec43935d6'] = 'Por lo tanto, necesitarás confirmarlo manualmente cuando recibas el cheque.'; +$_MODULE['<{cheque}prestashop>cheque_5dd532f0a63d89c5af0243b74732f63c'] = 'Detalles del contacto'; +$_MODULE['<{cheque}prestashop>cheque_d75e7b0f61c58d5d1cef7b56322c8b21'] = 'Por favor, especifique el nombre y la dirección a la que los clientes deben enviar el cheque'; +$_MODULE['<{cheque}prestashop>cheque_75475839e69bef6ed57a8200a5a71d37'] = 'A nombre de '; +$_MODULE['<{cheque}prestashop>cheque_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección'; +$_MODULE['<{cheque}prestashop>cheque_b17f3f4dcf653a5776792498a9b44d6a'] = 'Configuración actualizada'; +$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Pago con cheque'; +$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Pago con cheque (el proceso llevará más tiempo)'; +$_MODULE['<{cheque}prestashop>payment_execution_83aa0e5744c86bf2d9d006319db14839'] = 'Pago con cheque'; +$_MODULE['<{cheque}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Resumen del pedido'; +$_MODULE['<{cheque}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Su carrito está vacío.'; +$_MODULE['<{cheque}prestashop>payment_execution_c42b053ef8c36f950ff37a0897d3a963'] = 'cheque'; +$_MODULE['<{cheque}prestashop>payment_execution_6b3ef039e038a131d05bcd208a1b9799'] = 'Ha elegido pagar por cheque.'; +$_MODULE['<{cheque}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Este es el resumen de su pedido:'; +$_MODULE['<{cheque}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es'; +$_MODULE['<{cheque}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'IVA incluído'; +$_MODULE['<{cheque}prestashop>payment_execution_2f1585fcd1150d6a7d6edbe3468a63f8'] = 'Aceptamos las siguientes divisas para los cheques:'; +$_MODULE['<{cheque}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Elija una de las siguientes:'; +$_MODULE['<{cheque}prestashop>payment_execution_c4309902a6192747d56f3539941acc49'] = 'Aceptamos las siguientes divisas para los envíos de cheques:'; +$_MODULE['<{cheque}prestashop>payment_execution_504be670f962fa7630863857a0085632'] = 'El propietario y la dirección a la que debe enviar el cheque aparecerá en la siguiente página.'; +$_MODULE['<{cheque}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Por favor, acepte su pedido haciendo clic en \'confirmo mi pedido\''; +$_MODULE['<{cheque}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Otros modos de pago'; +$_MODULE['<{cheque}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confirmo mi pedido'; +$_MODULE['<{cheque}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido'; +$_MODULE['<{cheque}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'está completo.'; +$_MODULE['<{cheque}prestashop>payment_return_e4ee6e0eac588fe2611cc6fd195828af'] = 'Por favor, envíenos un cheque con:'; +$_MODULE['<{cheque}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un importe de '; +$_MODULE['<{cheque}prestashop>payment_return_84cca8efe379645790938f55b701a1a4'] = 'pagar a la orden de '; +$_MODULE['<{cheque}prestashop>payment_return_c5a6826dd3b059e32a3fa1ae029179de'] = 'email para'; +$_MODULE['<{cheque}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Se le ha enviado un email con esta información.'; +$_MODULE['<{cheque}prestashop>payment_return_ffd2478830ca2f519f7fe7ee259d4b96'] = 'Le enviaremos su pedido en cuanto recibamos su pago.'; +$_MODULE['<{cheque}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta o información, póngase en contacto con nosotros'; +$_MODULE['<{cheque}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'atención al cliente'; +$_MODULE['<{cheque}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos detectado un problema con su pedido. Si considera que hay un error, por favor póngase en contact con nosotros'; diff --git a/modules/cheque/fr.php b/modules/cheque/fr.php new file mode 100644 index 000000000..d06550d60 --- /dev/null +++ b/modules/cheque/fr.php @@ -0,0 +1,49 @@ +cheque_060bf2d587991d8f090a1309b285291c'] = 'Chèque'; +$_MODULE['<{cheque}prestashop>cheque_44cd16893a0a7731735c02999cc81adc'] = 'Accepter les paiements par chèque'; +$_MODULE['<{cheque}prestashop>cheque_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?'; +$_MODULE['<{cheque}prestashop>cheque_1fddeba3cee2a70b37a20889e124948a'] = 'L\'ordre du chèque et l\'adresse doivent être renseignés'; +$_MODULE['<{cheque}prestashop>cheque_4402acab1c8f90dcf4a31dc96833bd86'] = 'Aucune devise disponible pour ce module'; +$_MODULE['<{cheque}prestashop>cheque_a0048063a9be52816b7fa7f17aa3a2b7'] = 'L\'ordre du chèque est requis.'; +$_MODULE['<{cheque}prestashop>cheque_4b5e20a521d31cc44b9690bd35eaacfc'] = 'L\'adresse est requise.'; +$_MODULE['<{cheque}prestashop>cheque_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{cheque}prestashop>cheque_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie'; +$_MODULE['<{cheque}prestashop>cheque_14e41f4cfd99b10766cc15676d8cda66'] = 'Ce module vous permet d\'accepter des paiements par chèque'; +$_MODULE['<{cheque}prestashop>cheque_3b39b241f115e5823eeca07df2949a35'] = 'Si le client choisit ce mode de paiement, la commande prendra le statut \"Paiement en attente\".'; +$_MODULE['<{cheque}prestashop>cheque_4d96735a584217fd2d8a4edec43935d6'] = 'Par conséquent, vous devez valider manuellement la commande dès réception du chèque.'; +$_MODULE['<{cheque}prestashop>cheque_5dd532f0a63d89c5af0243b74732f63c'] = 'Coordonnées'; +$_MODULE['<{cheque}prestashop>cheque_d75e7b0f61c58d5d1cef7b56322c8b21'] = 'Merci de spécifier l\'ordre du chèque et l\'adresse pour vos clients'; +$_MODULE['<{cheque}prestashop>cheque_75475839e69bef6ed57a8200a5a71d37'] = 'A l\'ordre de'; +$_MODULE['<{cheque}prestashop>cheque_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{cheque}prestashop>cheque_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; +$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Payer par chèque'; +$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Payer par chèque (traitement plus long)'; +$_MODULE['<{cheque}prestashop>payment_execution_83aa0e5744c86bf2d9d006319db14839'] = 'Paiement par chèque'; +$_MODULE['<{cheque}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande'; +$_MODULE['<{cheque}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.'; +$_MODULE['<{cheque}prestashop>payment_execution_c42b053ef8c36f950ff37a0897d3a963'] = 'chèque'; +$_MODULE['<{cheque}prestashop>payment_execution_6b3ef039e038a131d05bcd208a1b9799'] = 'Vous avez choisi de régler par chèque.'; +$_MODULE['<{cheque}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un bref récapitulatif de votre commande :'; +$_MODULE['<{cheque}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; +$_MODULE['<{cheque}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{cheque}prestashop>payment_execution_2f1585fcd1150d6a7d6edbe3468a63f8'] = 'Nous acceptons plusieurs devises pour les chèques.'; +$_MODULE['<{cheque}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Merci de choisir parmi les suivantes :'; +$_MODULE['<{cheque}prestashop>payment_execution_c4309902a6192747d56f3539941acc49'] = 'Nous acceptons la devise suivante pour votre paiement :'; +$_MODULE['<{cheque}prestashop>payment_execution_504be670f962fa7630863857a0085632'] = 'L\'ordre et l\'adresse du chèque seront affichés sur la page suivante.'; +$_MODULE['<{cheque}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; +$_MODULE['<{cheque}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; +$_MODULE['<{cheque}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; +$_MODULE['<{cheque}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{cheque}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'est bien enregistrée.'; +$_MODULE['<{cheque}prestashop>payment_return_e4ee6e0eac588fe2611cc6fd195828af'] = 'Merci de nous envoyer un chèque :'; +$_MODULE['<{cheque}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'd\'un total de'; +$_MODULE['<{cheque}prestashop>payment_return_84cca8efe379645790938f55b701a1a4'] = 'à l\'ordre de'; +$_MODULE['<{cheque}prestashop>payment_return_c5a6826dd3b059e32a3fa1ae029179de'] = 'à envoyer à'; +$_MODULE['<{cheque}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Un email contenant ces informations vous a été envoyé.'; +$_MODULE['<{cheque}prestashop>payment_return_ffd2478830ca2f519f7fe7ee259d4b96'] = 'Votre commande vous sera envoyée dès réception du paiement.'; +$_MODULE['<{cheque}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire merci de contacter notre'; +$_MODULE['<{cheque}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client'; +$_MODULE['<{cheque}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons rencontré un problème avec votre commande, merci de contacter notre support client'; diff --git a/modules/cheque/it.php b/modules/cheque/it.php new file mode 100644 index 000000000..ac58da501 --- /dev/null +++ b/modules/cheque/it.php @@ -0,0 +1,49 @@ +cheque_060bf2d587991d8f090a1309b285291c'] = 'Assegno'; +$_MODULE['<{cheque}prestashop>cheque_44cd16893a0a7731735c02999cc81adc'] = 'Modulo per accettare pagamenti con assegno'; +$_MODULE['<{cheque}prestashop>cheque_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{cheque}prestashop>cheque_1fddeba3cee2a70b37a20889e124948a'] = '\'All\'ordine di\' e l\'indirizzo devono essere configurati per poter utilizzare questo modulo correttamente'; +$_MODULE['<{cheque}prestashop>cheque_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nessuna valuta impostata per questo modulo'; +$_MODULE['<{cheque}prestashop>cheque_a0048063a9be52816b7fa7f17aa3a2b7'] = 'Il campo \"all\'ordine di\" è obbligatorio.'; +$_MODULE['<{cheque}prestashop>cheque_4b5e20a521d31cc44b9690bd35eaacfc'] = 'Indirizzo obbligatorio.'; +$_MODULE['<{cheque}prestashop>cheque_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{cheque}prestashop>cheque_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{cheque}prestashop>cheque_14e41f4cfd99b10766cc15676d8cda66'] = 'Questo modulo permette di accettare pagamenti tramite assegno.'; +$_MODULE['<{cheque}prestashop>cheque_3b39b241f115e5823eeca07df2949a35'] = 'Se il cliente sceglie questa modalità di pagamento, l\'ordine cambierà il proprio status in \"attesa di pagamento\".'; +$_MODULE['<{cheque}prestashop>cheque_4d96735a584217fd2d8a4edec43935d6'] = 'Pertanto, sarà necessario confermare l\'ordine non appena si riceve un assegno.'; +$_MODULE['<{cheque}prestashop>cheque_5dd532f0a63d89c5af0243b74732f63c'] = 'Dettagli di contatto'; +$_MODULE['<{cheque}prestashop>cheque_d75e7b0f61c58d5d1cef7b56322c8b21'] = 'Si prega di specificare il nome e l\'indirizzo a cui i clienti dovranno inviare il loro assegno'; +$_MODULE['<{cheque}prestashop>cheque_75475839e69bef6ed57a8200a5a71d37'] = 'All\'ordine di'; +$_MODULE['<{cheque}prestashop>cheque_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{cheque}prestashop>cheque_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Paga con assegno'; +$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Paga con assegno (l\'elaborazione dell\'ordine sarà più lungo)'; +$_MODULE['<{cheque}prestashop>payment_execution_83aa0e5744c86bf2d9d006319db14839'] = 'Pagamento con assegno'; +$_MODULE['<{cheque}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Riepilogo dell\'ordine'; +$_MODULE['<{cheque}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Il carrello è vuoto.'; +$_MODULE['<{cheque}prestashop>payment_execution_c42b053ef8c36f950ff37a0897d3a963'] = 'assegno'; +$_MODULE['<{cheque}prestashop>payment_execution_6b3ef039e038a131d05bcd208a1b9799'] = 'Hai scelto di pagare con assegno.'; +$_MODULE['<{cheque}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Ecco un breve riepilogo del tuo ordine:'; +$_MODULE['<{cheque}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; +$_MODULE['<{cheque}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{cheque}prestashop>payment_execution_2f1585fcd1150d6a7d6edbe3468a63f8'] = 'Si accettano più valute per gli assegni.'; +$_MODULE['<{cheque}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Scegli una delle seguenti:'; +$_MODULE['<{cheque}prestashop>payment_execution_c4309902a6192747d56f3539941acc49'] = 'Accettiamo le seguente valuta da inviare tramite assegno:'; +$_MODULE['<{cheque}prestashop>payment_execution_504be670f962fa7630863857a0085632'] = 'Le informazioni sul titolare dell\'assegno e l\'indirizzo verranno visualizzate nella pagina successiva.'; +$_MODULE['<{cheque}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Conferma l\'ordine cliccando su \'confermo il mio ordine\''; +$_MODULE['<{cheque}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; +$_MODULE['<{cheque}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; +$_MODULE['<{cheque}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine sul'; +$_MODULE['<{cheque}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{cheque}prestashop>payment_return_e4ee6e0eac588fe2611cc6fd195828af'] = 'Vi preghiamo di inviarci un assegno con:'; +$_MODULE['<{cheque}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un importo di'; +$_MODULE['<{cheque}prestashop>payment_return_84cca8efe379645790938f55b701a1a4'] = 'pagabile all\'ordine di '; +$_MODULE['<{cheque}prestashop>payment_return_c5a6826dd3b059e32a3fa1ae029179de'] = 'mail a'; +$_MODULE['<{cheque}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Ti è stata inviata una e-mail con queste informazioni.'; +$_MODULE['<{cheque}prestashop>payment_return_ffd2478830ca2f519f7fe7ee259d4b96'] = 'Il tuo ordine verrà inviato non appena avremo ricevuto il pagamento.'; +$_MODULE['<{cheque}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{cheque}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{cheque}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che questo sia un errore, contatta la nostra'; diff --git a/modules/cheque/logo.gif b/modules/cheque/logo.gif new file mode 100644 index 000000000..2491fb8ba Binary files /dev/null and b/modules/cheque/logo.gif differ diff --git a/modules/cheque/payment.php b/modules/cheque/payment.php new file mode 100644 index 000000000..7e2028f5a --- /dev/null +++ b/modules/cheque/payment.php @@ -0,0 +1,43 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/cheque.php'); + +if (!$cookie->isLogged(true)) + Tools::redirect('authentication.php?back=order.php'); + +$cheque = new Cheque(); +echo $cheque->execPayment($cart); + +include_once(dirname(__FILE__).'/../../footer.php'); + + diff --git a/modules/cheque/payment.tpl b/modules/cheque/payment.tpl new file mode 100644 index 000000000..c1d9f81d0 --- /dev/null +++ b/modules/cheque/payment.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay by cheque' mod='cheque'} + {l s='Pay by cheque (order process will be longer)' mod='cheque'} + +

        \ No newline at end of file diff --git a/modules/cheque/payment_execution.tpl b/modules/cheque/payment_execution.tpl new file mode 100644 index 000000000..5a9ba018e --- /dev/null +++ b/modules/cheque/payment_execution.tpl @@ -0,0 +1,80 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Cheque payment' mod='cheque'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Order summary' mod='cheque'}

        + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +{if isset($nbProducts) && $nbProducts <= 0} +

        {l s='Your shopping cart is empty.'}

        +{else} + +

        {l s='Cheque payment' mod='cheque'}

        +
        +

        + {l s='cheque' mod='cheque'} + {l s='You have chosen to pay by cheque.' mod='cheque'} +

        + {l s='Here is a short summary of your order:' mod='cheque'} +

        +

        + - {l s='The total amount of your order is' mod='cheque'} + {displayPrice price=$total} + {if $use_taxes == 1} + {l s='(tax incl.)' mod='cheque'} + {/if} +

        +

        + - + {if isset($currencies) && $currencies|@count > 1} + {l s='We accept several currencies for cheques.' mod='cheque'} +

        + {l s='Choose one of the following:' mod='cheque'} + + {else} + {l s='We accept the following currency to be sent by cheque:' mod='cheque'} {$currencies.0.name} + + {/if} +

        +

        + {l s='Cheque owner and address information will be displayed on the next page.' mod='cheque'} +

        + {l s='Please confirm your order by clicking \'I confirm my order\'' mod='cheque'}. +

        +

        + {l s='Other payment methods' mod='cheque'} + +

        +
        +{/if} diff --git a/modules/cheque/payment_return.tpl b/modules/cheque/payment_return.tpl new file mode 100644 index 000000000..a02ace82f --- /dev/null +++ b/modules/cheque/payment_return.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $status == 'ok'} +

        {l s='Your order on' mod='cheque'} {$shop_name} {l s='is complete.' mod='cheque'} +

        + {l s='Please send us a cheque with:' mod='cheque'} +

        - {l s='an amount of' mod='cheque'} {$total_to_pay} +

        - {l s='payable to the order of' mod='cheque'} {if $chequeName}{$chequeName}{else}___________{/if} +

        - {l s='mail to' mod='cheque'} {if $chequeAddress}{$chequeAddress}{else}___________{/if} +

        {l s='An e-mail has been sent to you with this information.' mod='cheque'} +

        {l s='Your order will be sent as soon as we receive your payment.' mod='cheque'} +

        {l s='For any questions or for further information, please contact our' mod='cheque'} {l s='customer support' mod='cheque'}. +

        +{else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='cheque'} + {l s='customer support' mod='cheque'}. +

        +{/if} diff --git a/modules/cheque/validation.php b/modules/cheque/validation.php new file mode 100644 index 000000000..aee6b2340 --- /dev/null +++ b/modules/cheque/validation.php @@ -0,0 +1,53 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/cheque.php'); + +$cheque = new Cheque(); + +if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$cheque->active) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$customer = new Customer((int)$cart->id_customer); + +if (!Validate::isLoadedObject($customer)) + Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1'); + +$currency = new Currency((int)(isset($_POST['currency_payement']) ? $_POST['currency_payement'] : $cookie->id_currency)); +$total = (float)($cart->getOrderTotal(true, Cart::BOTH)); + +$mailVars = array( + '{cheque_name}' => Configuration::get('CHEQUE_NAME'), + '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), + '{cheque_address_html}' => str_replace("\n", '
        ', Configuration::get('CHEQUE_ADDRESS'))); + +$cheque->validateOrder((int)($cart->id), _PS_OS_CHEQUE_, $total, $cheque->displayName, NULL, $mailVars, (int)($currency->id), false, $customer->secure_key); + +Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)($cart->id).'&id_module='.(int)($cheque->id).'&id_order='.$cheque->currentOrder.'&key='.$customer->secure_key); + diff --git a/modules/criteo/config.xml b/modules/criteo/config.xml new file mode 100755 index 000000000..cc3f1de0c --- /dev/null +++ b/modules/criteo/config.xml @@ -0,0 +1,11 @@ + + + criteo + Criteo + 1.0 + Criteo product export and tag display. + + advertising_marketing + 1 + 1 + \ No newline at end of file diff --git a/modules/criteo/criteo.php b/modules/criteo/criteo.php new file mode 100755 index 000000000..50706ab62 --- /dev/null +++ b/modules/criteo/criteo.php @@ -0,0 +1,363 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Criteo extends Module +{ + public function __construct() + { + $this->name = 'criteo'; + $this->tab = 'advertising_marketing'; + $this->version = '1.0'; + + parent::__construct(); + + $this->displayName = $this->l('Criteo'); + $this->description = $this->l('Criteo product export and tag display.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('header') + AND $this->registerHook('productfooter') + AND $this->registerHook('home') + AND $this->registerHook('shoppingCartExtra') + AND $this->registerHook('orderConfirmation')); + } + + public function uninstall() + { + return parent::uninstall(); + } + + private function _postProcess() + { + $isUpdated = false; + if (Tools::getValue('id_criteo_conversion')) + { + Configuration::updateValue('CRITEO_ID_CONVERSION', pSQL(Tools::getValue('id_criteo_conversion'))); + $isUpdated = true; + } + if (Tools::getValue('id_criteo_normal')) + { + Configuration::updateValue('CRITEO_ID_NORMAL', pSQL(Tools::getValue('id_criteo_normal'))); + $isUpdated = true; + } + if (Tools::getValue('url_widget_criteo')) + { + Configuration::updateValue('CRITEO_URL_WIDGET', pSQL(Tools::getValue('url_widget_criteo'))); + $isUpdated = true; + } + if ($isUpdated) + return true; + return false; + } + + public function getContent() + { + return ' +
        + '.($this->_postProcess() ? $this->displayConfirmation($this->l('Settings are updated').'') : '').' + '.$this->l('Criteo Export').' +
        + +

        + +

        + +

        +
        +
        + '.$this->l('URL to communicate to Criteo:').' + '.Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/'.$this->name.'/export_csv.php
        + '.$this->l('URL to communicate to Criteo:').' + '.Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/'.$this->name.'/export_xml.php +
        '; + } + + private static function getAllSubCats(&$all_cats, $id_cat, $id_lang) + { + $category = new Category(intval($id_cat)); + + $sub_cats = $category->getSubcategories($id_lang); + if(count($sub_cats) > 0) + foreach ($sub_cats AS $sub_cat) + { + $all_cats[] = $sub_cat['id_category']; + self::getAllSubCats($all_cats, $sub_cat['id_category'], $id_lang); + } + } + + public static function buildCSV() + { + global $cookie, $country_infos; + $cookie = new Cookie('ps'); + $country_infos = array('id_group' => 0, 'id_tax' => 1); + $html = ''; + /* First line, columns */ + $columns = array('id', 'name', 'smallimage', 'bigimage', 'producturl', 'description', 'price', 'retailprice', 'discount', 'recommendable', 'instock'); + + foreach ($columns AS $column) + $html .= $column.'|'; + $html = rtrim($html, '|')."\n"; + + /* Setting parameters */ + $conf = Configuration::getMultiple(array( + 'PS_REWRITING_SETTINGS', + 'PS_LANG_DEFAULT', + 'PS_SHIPPING_FREE_PRICE', + 'PS_SHIPPING_HANDLING', + 'PS_SHIPPING_METHOD', + 'PS_SHIPPING_FREE_WEIGHT', + 'PS_COUNTRY_DEFAULT', + 'PS_SHOP_NAME', + 'PS_CURRENCY_DEFAULT', + 'PS_CARRIER_DEFAULT')); + /* Language */ + $language = new Language(intval($conf['PS_LANG_DEFAULT'])); + + /* Link instance for products links */ + $link = new Link(); + $result = Db::getInstance()->ExecuteS(' + SELECT DISTINCT p.`id_product`, i.`id_image` + FROM `'._DB_PREFIX_.'product` p + JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.id_product = p.id_product) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.id_product = p.id_product) + WHERE p.`active` = 1 AND i.id_image IS NOT NULL + GROUP BY p.id_product'); + foreach ($result AS $k => $row) + { + if (Pack::isPack(intval($row['id_product']))) + continue; + $product = new Product(intval($row['id_product']), true); + + if (Validate::isLoadedObject($product)) + { + $line = array(); + $line[] = $product->id; + $line[] = $product->manufacturer_name.' - '.$product->name[intval($conf['PS_LANG_DEFAULT'])]; + $line[] = Tools::getProtocol().$_SERVER['HTTP_HOST']._THEME_PROD_DIR_.intval($product->id).'-'.$row['id_image'].'-small.jpg'; + $line[] = Tools::getProtocol().$_SERVER['HTTP_HOST']._THEME_PROD_DIR_.intval($product->id).'-'.$row['id_image'].'-thickbox.jpg'; + $line[] = $link->getProductLink(intval($product->id), $product->link_rewrite[intval($conf['PS_LANG_DEFAULT'])], $product->ean13).'&utm_source=criteo&aff=criteo'; + $line[] = str_replace(array("\n", "\r", "\t", '|'), '', strip_tags(html_entity_decode($product->description_short[intval($conf['PS_LANG_DEFAULT'])], ENT_COMPAT, 'UTF-8'))); + + $price = $product->getPrice(true, intval(Product::getDefaultAttribute($product->id))); + + $line[] = number_format($price, 2, '.', ''); + $line[] = number_format($product->getPrice(true, intval(Product::getDefaultAttribute(intval($product->id))), 6, NULL, false, false), 2, '.', ''); + $line[] = $product->getPrice(true, NULL, 2, NULL, true); + $line[] = '1'; + $line[] = '1'; + + foreach ($line AS $column) + $html .= trim($column).'|'; + $html = rtrim($html, '|')."\n"; + } + } + echo $html; + } + + public static function buildXML() + { + global $cookie, $country_infos; + + $cookie = new Cookie('ps'); + $country_infos = array('id_group' => 0, 'id_tax' => 1); + $html = ''."\n"; + /* First line, columns */ + $columns = array('id', 'name', 'smallimage', 'bigimage', 'producturl', 'description', 'price', 'retailprice', 'discount', 'recommendable', 'instock'); + + /* Setting parameters */ + $conf = Configuration::getMultiple(array( + 'PS_REWRITING_SETTINGS', + 'PS_LANG_DEFAULT', + 'PS_SHIPPING_FREE_PRICE', + 'PS_SHIPPING_HANDLING', + 'PS_SHIPPING_METHOD', + 'PS_SHIPPING_FREE_WEIGHT', + 'PS_COUNTRY_DEFAULT', + 'PS_SHOP_NAME', + 'PS_CURRENCY_DEFAULT', + 'PS_CARRIER_DEFAULT')); + /* Language */ + $language = new Language(intval($conf['PS_LANG_DEFAULT'])); + + /* Link instance for products links */ + $link = new Link(); + + /* Searching for products */ + $result = Db::getInstance()->ExecuteS(' + SELECT DISTINCT p.`id_product`, i.`id_image` + FROM `'._DB_PREFIX_.'product` p + JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.id_product = p.id_product) + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.id_product = p.id_product) + WHERE p.`active` = 1 AND i.id_image IS NOT NULL + GROUP BY p.id_product'); + + foreach ($result AS $k => $row) + { + if (Pack::isPack(intval($row['id_product']))) + continue; + $product = new Product(intval($row['id_product']), true); + + if (Validate::isLoadedObject($product)) + { + $line = array(); + $line[] = $product->manufacturer_name.' - '.$product->name[intval($conf['PS_LANG_DEFAULT'])]; + + $line[] = Tools::getProtocol().$_SERVER['HTTP_HOST']._THEME_PROD_DIR_.intval($product->id).'-'.$row['id_image'].'-small.jpg'; + $line[] = Tools::getProtocol().$_SERVER['HTTP_HOST']._THEME_PROD_DIR_.intval($product->id).'-'.$row['id_image'].'-thickbox.jpg'; + $line[] = $link->getProductLink(intval($product->id), $product->link_rewrite[intval($conf['PS_LANG_DEFAULT'])], $product->ean13).'&utm_source=criteo&aff=criteo'; + $line[] = str_replace(array("\n", "\r", "\t", '|'), '', strip_tags(html_entity_decode($product->description_short[intval($conf['PS_LANG_DEFAULT'])], ENT_COMPAT, 'UTF-8'))); + + $price = $product->getPrice(true, intval(Product::getDefaultAttribute($product->id))); + + $line[] = number_format($price, 2, '.', ''); + $line[] = number_format($product->getPrice(true, intval(Product::getDefaultAttribute(intval($product->id))), 6, NULL, false, false), 2, '.', ''); + $line[] = $product->getPrice(true, NULL, 2, NULL, true); + $line[] = '1'; + $line[] = '1'; + + $cptXML = 1; + $html .= "\t".''."\n"; + foreach ($line AS $column) + { + $html .= "\t\t".'<'.$columns[$cptXML].'>'.$column.''."\n"; + $cptXML++; + } + $html .= "\t".''."\n"; + } + } + $html .= ''."\n"; + echo $html; + } + + public function hookProductFooter($params) + { + return ''; + } + + public function hookProductList($params) + { + $i = 0; + $strproducts = ''; + + if (!isset($params['products']) OR !$params['products']) + return ''; + + foreach ($params['products'] AS $product) + { + if ($i > 2) + break; + + $strproducts .= 'i'.++$i.'='.$product['id_product'].'&'; + } + return ''; + + } + + public function hookShoppingCartExtra($params) + { + foreach ($params['products'] AS $product) + $strproducts .= 'i'.++$i.'='.$product['id_product'].'&p'.$i.'='.$product['price'].'&q'.$i.'='.$product['quantity'].'&'; + + $strproducts = substr($strproducts, 0, -1); + + return ''; + } + + public function hookOrderConfirmation($params) + { + global $cookie, $country_infos; + $cookie = new Cookie('ps'); + $country_infos = array('id_group' => 0, + 'id_tax' => 1); + $cart = new Cart(intval($params['objOrder']->id_cart)); + $products = $cart->getProducts(); + $strproducts = ''; + $i = 0; + foreach ($products AS $product) + $strproducts .= 'i'.++$i.'='.$product['id_product'].'&p'.$i.'='.$product['price'].'&q'.$i.'='.$product['quantity'].'&'; + + $strproducts = substr($strproducts, 0, -1); + + return ''; + } + + public function hookHeader($params) + { + return ''; + } + + public function hookHome($params) + { + return ''; + } +} + diff --git a/modules/criteo/de.php b/modules/criteo/de.php new file mode 100644 index 000000000..66c7c021e --- /dev/null +++ b/modules/criteo/de.php @@ -0,0 +1,13 @@ +criteo_0c90fc1c188056486dbb210f25023b8a'] = 'Criteo'; +$_MODULE['<{criteo}prestashop>criteo_dfa5d522cd54e1ef0f94ec2ed4a61419'] = 'Criteo Produkt Export-und Tag-Anzeige'; +$_MODULE['<{criteo}prestashop>criteo_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{criteo}prestashop>criteo_2667504f82250eacbd377f121b5c57e0'] = 'Criteo Export'; +$_MODULE['<{criteo}prestashop>criteo_96814c8ba0e8753f60d3ded7799ac5f8'] = 'Criteo normale Kennung'; +$_MODULE['<{criteo}prestashop>criteo_e60d35bcd2d65206757417532f509366'] = 'Criteo Konversionskennung'; +$_MODULE['<{criteo}prestashop>criteo_2a0b3f9396d21be5b3eb7e3bed1ed495'] = 'URL Widget'; +$_MODULE['<{criteo}prestashop>criteo_a4d3b161ce1309df1c4e25df28694b7b'] = 'Senden'; +$_MODULE['<{criteo}prestashop>criteo_c452f9f8ae244baf28588108f83e0a8a'] = 'Ihre URL, für die Kommunikation mit Criteo:'; diff --git a/modules/criteo/en.php b/modules/criteo/en.php new file mode 100755 index 000000000..601358d4f --- /dev/null +++ b/modules/criteo/en.php @@ -0,0 +1,4 @@ +criteo_0c90fc1c188056486dbb210f25023b8a'] = 'Criteo'; +$_MODULE['<{criteo}prestashop>criteo_dfa5d522cd54e1ef0f94ec2ed4a61419'] = 'Exportación de productos para Criteo e indicación de tags en Front-Office'; +$_MODULE['<{criteo}prestashop>criteo_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados'; +$_MODULE['<{criteo}prestashop>criteo_2667504f82250eacbd377f121b5c57e0'] = 'Exportación Criteo'; +$_MODULE['<{criteo}prestashop>criteo_96814c8ba0e8753f60d3ded7799ac5f8'] = 'Login Criteo normal'; +$_MODULE['<{criteo}prestashop>criteo_e60d35bcd2d65206757417532f509366'] = 'Login Criteo conversión'; +$_MODULE['<{criteo}prestashop>criteo_2a0b3f9396d21be5b3eb7e3bed1ed495'] = 'URL de widget'; +$_MODULE['<{criteo}prestashop>criteo_a4d3b161ce1309df1c4e25df28694b7b'] = 'Enviar'; +$_MODULE['<{criteo}prestashop>criteo_c452f9f8ae244baf28588108f83e0a8a'] = 'URL para comunicar a Criteo:'; diff --git a/modules/criteo/export_csv.php b/modules/criteo/export_csv.php new file mode 100755 index 000000000..a1016e206 --- /dev/null +++ b/modules/criteo/export_csv.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/../../init.php'); +include_once(dirname(__FILE__).'/criteo.php'); + +Criteo::buildCSV(); + +?> diff --git a/modules/criteo/export_xml.php b/modules/criteo/export_xml.php new file mode 100755 index 000000000..27c87fc1c --- /dev/null +++ b/modules/criteo/export_xml.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/../../init.php'); +include_once(dirname(__FILE__).'/criteo.php'); + +Criteo::buildXML(); + +?> diff --git a/modules/criteo/fr.php b/modules/criteo/fr.php new file mode 100755 index 000000000..aad78784f --- /dev/null +++ b/modules/criteo/fr.php @@ -0,0 +1,13 @@ +criteo_0c90fc1c188056486dbb210f25023b8a'] = 'Criteo'; +$_MODULE['<{criteo}prestashop>criteo_dfa5d522cd54e1ef0f94ec2ed4a61419'] = 'Export de produit pour Criteo et l\'affichage des tags en Front Office'; +$_MODULE['<{criteo}prestashop>criteo_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{criteo}prestashop>criteo_2667504f82250eacbd377f121b5c57e0'] = 'Export Criteo'; +$_MODULE['<{criteo}prestashop>criteo_96814c8ba0e8753f60d3ded7799ac5f8'] = 'Identifiant Criteo normal'; +$_MODULE['<{criteo}prestashop>criteo_e60d35bcd2d65206757417532f509366'] = 'Identifiant Criteo conversion'; +$_MODULE['<{criteo}prestashop>criteo_2a0b3f9396d21be5b3eb7e3bed1ed495'] = 'URL du widget'; +$_MODULE['<{criteo}prestashop>criteo_a4d3b161ce1309df1c4e25df28694b7b'] = 'Envoyer'; +$_MODULE['<{criteo}prestashop>criteo_c452f9f8ae244baf28588108f83e0a8a'] = 'URL à communiquer à Criteo:'; diff --git a/modules/criteo/it.php b/modules/criteo/it.php new file mode 100755 index 000000000..f250548e2 --- /dev/null +++ b/modules/criteo/it.php @@ -0,0 +1,13 @@ +criteo_0c90fc1c188056486dbb210f25023b8a'] = 'Criteo'; +$_MODULE['<{criteo}prestashop>criteo_dfa5d522cd54e1ef0f94ec2ed4a61419'] = 'Esportazione di prodotti Criteo e visualizzazione tag'; +$_MODULE['<{criteo}prestashop>criteo_7ccf58c950043c9fbfed668df13ce608'] = 'Impostazioni aggiornate'; +$_MODULE['<{criteo}prestashop>criteo_2667504f82250eacbd377f121b5c57e0'] = 'Export Criteo '; +$_MODULE['<{criteo}prestashop>criteo_96814c8ba0e8753f60d3ded7799ac5f8'] = 'Identificante Criteo normale'; +$_MODULE['<{criteo}prestashop>criteo_e60d35bcd2d65206757417532f509366'] = 'Identificante Criteo conversione '; +$_MODULE['<{criteo}prestashop>criteo_2a0b3f9396d21be5b3eb7e3bed1ed495'] = 'URL Widget'; +$_MODULE['<{criteo}prestashop>criteo_a4d3b161ce1309df1c4e25df28694b7b'] = 'Invia'; +$_MODULE['<{criteo}prestashop>criteo_c452f9f8ae244baf28588108f83e0a8a'] = 'URL da comunicare a Criteo:'; diff --git a/modules/criteo/logo.gif b/modules/criteo/logo.gif new file mode 100755 index 000000000..e0a82e824 Binary files /dev/null and b/modules/criteo/logo.gif differ diff --git a/modules/crossselling/config.xml b/modules/crossselling/config.xml new file mode 100755 index 000000000..4582d15c2 --- /dev/null +++ b/modules/crossselling/config.xml @@ -0,0 +1,11 @@ + + + crossselling + Cross Selling + 0.1 + Customers who bought this product also bought: + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/crossselling/crossselling.php b/modules/crossselling/crossselling.php new file mode 100755 index 000000000..0631773dc --- /dev/null +++ b/modules/crossselling/crossselling.php @@ -0,0 +1,146 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class CrossSelling extends Module +{ + private $_html; + + public function __construct() + { + $this->name = 'crossselling'; + $this->tab = 'front_office_features'; + $this->version = 0.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Cross Selling'); + $this->description = $this->l('Customers who bought this product also bought:'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('productFooter') OR + !$this->registerHook('header') OR + !Configuration::updateValue('CROSSSELLING_DISPLAY_PRICE', 0)) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall() OR + !Configuration::deleteByName('CROSSSELLING_DISPLAY_PRICE')) + return false; + return true; + } + + public function getContent() + { + $this->_html = ''; + if (Tools::isSubmit('submitCross') AND Tools::getValue('displayPrice') != 0 AND Tools::getValue('displayPrice') != 1) + $this->_html .= $this->displayError('Invalid displayPrice'); + elseif (Tools::isSubmit('submitCross')) + { + Configuration::updateValue('CROSSSELLING_DISPLAY_PRICE', Tools::getValue('displayPrice')); + $this->_html .= $this->displayConfirmation($this->l('Settings updated succesfully')); + } + $this->_html .= ' +
        +
        '.$this->l('Settings').' + +
        + + + + +

        '.$this->l('Show the price on the products in the block.').'

        +
        +
        +
        +
        '; + return $this->_html; + } + + public function hookHeader() + { + Tools::addCSS(($this->_path).'crossselling.css', 'all'); + } + + /** + * Returns module content for left column + */ + public function hookProductFooter($params) + { + global $smarty, $cookie, $link; + + $orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT o.id_order + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_detail od ON (od.id_order = o.id_order) + WHERE o.valid = 1 AND od.product_id = '.(int)$params['product']->id); + + if (sizeof($orders)) + { + $list = ''; + foreach ($orders AS $order) + $list .= (int)$order['id_order'].','; + $list = rtrim($list, ','); + + $orderProducts = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT od.product_id, pl.name, pl.link_rewrite, p.reference, i.id_image, p.show_price, cl.link_rewrite category, p.ean13 + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id) + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = od.product_id) + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = p.id_category_default) + LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = od.product_id) + WHERE od.id_order IN ('.$list.') AND pl.id_lang = '.(int)($cookie->id_lang).' AND cl.id_lang = '.(int)($cookie->id_lang).' + AND od.product_id != '.(int)$params['product']->id.' AND i.cover = 1 AND p.active = 1 + ORDER BY RAND() + LIMIT 10'); + + $taxCalc = Product::getTaxCalculationMethod(); + foreach ($orderProducts AS &$orderProduct) + { + $orderProduct['image'] = $link->getImageLink($orderProduct['link_rewrite'], (int)$orderProduct['product_id'].'-'.(int)$orderProduct['id_image'], 'medium'); + $orderProduct['link'] = $link->getProductLink((int)$orderProduct['product_id'], $orderProduct['link_rewrite'], $orderProduct['category'], $orderProduct['ean13']); + if (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND ($taxCalc == 0 OR $taxCalc == 2)) + $orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], true, NULL); + elseif (Configuration::get('CROSSSELLING_DISPLAY_PRICE') AND $taxCalc == 1) + $orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], false, NULL); + } + + $smarty->assign(array('orderProducts' => $orderProducts, 'middlePosition_crossselling' => round(sizeof($orderProducts) / 2, 0), + 'crossDisplayPrice' => Configuration::get('CROSSSELLING_DISPLAY_PRICE'))); + } + return $this->display(__FILE__, 'crossselling.tpl'); + } +} \ No newline at end of file diff --git a/modules/crossselling/crossselling.tpl b/modules/crossselling/crossselling.tpl new file mode 100755 index 000000000..341688ad8 --- /dev/null +++ b/modules/crossselling/crossselling.tpl @@ -0,0 +1,59 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if isset($orderProducts) && count($orderProducts)} +
        + + +

        {l s='Customers who bought this product also bought:' mod='crossselling'}

        +
        + {if count($orderProducts) > 5}{l s='Previous' mod='crossselling'}{/if} +
        + +
        + {if count($orderProducts) > 5}{l s='Next' mod='crossselling'}{/if} +
        +
        +{/if} diff --git a/modules/crossselling/de.php b/modules/crossselling/de.php new file mode 100644 index 000000000..503e535b7 --- /dev/null +++ b/modules/crossselling/de.php @@ -0,0 +1,16 @@ +crossselling_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Cross-Selling'; +$_MODULE['<{crossselling}prestashop>crossselling_ef2b66b0b65479e08ff0cce29e19d006'] = 'Kunden, die dieses Produkt gekauft haben, kauften auch ...'; +$_MODULE['<{crossselling}prestashop>crossselling_e316b4398212d473f7f53c7728fe1c37'] = 'Einstellungen erfolgreich aktualisiert'; +$_MODULE['<{crossselling}prestashop>crossselling_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{crossselling}prestashop>crossselling_b6bf131edd323320bac67303a3f4de8a'] = 'Preis auf Produkten anzeigen '; +$_MODULE['<{crossselling}prestashop>crossselling_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{crossselling}prestashop>crossselling_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{crossselling}prestashop>crossselling_70f9a895dc3273d34a7f6d14642708ec'] = 'Preise auf den Produkten im Block anzeigen.'; +$_MODULE['<{crossselling}prestashop>crossselling_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{crossselling}prestashop>crossselling_dd1f775e443ff3b9a89270713580a51b'] = 'Kunden, die dieses Produkt gekauft haben, kauften auch:'; +$_MODULE['<{crossselling}prestashop>crossselling_4351cfebe4b61d8aa5efa1d020710005'] = 'Zurück'; +$_MODULE['<{crossselling}prestashop>crossselling_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Weiter'; diff --git a/modules/crossselling/en.php b/modules/crossselling/en.php new file mode 100755 index 000000000..41097ebdc --- /dev/null +++ b/modules/crossselling/en.php @@ -0,0 +1,5 @@ +crossselling_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Ventas cruzadas'; +$_MODULE['<{crossselling}prestashop>crossselling_ef2b66b0b65479e08ff0cce29e19d006'] = 'Los clientes que compraron este producto también han comprado...'; +$_MODULE['<{crossselling}prestashop>crossselling_e316b4398212d473f7f53c7728fe1c37'] = 'Actualización de los parámetros'; +$_MODULE['<{crossselling}prestashop>crossselling_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{crossselling}prestashop>crossselling_b6bf131edd323320bac67303a3f4de8a'] = 'Mostrar el precio del producto'; +$_MODULE['<{crossselling}prestashop>crossselling_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{crossselling}prestashop>crossselling_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{crossselling}prestashop>crossselling_70f9a895dc3273d34a7f6d14642708ec'] = 'Mostrar el precio del producto en el bloque'; +$_MODULE['<{crossselling}prestashop>crossselling_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{crossselling}prestashop>crossselling_dd1f775e443ff3b9a89270713580a51b'] = 'Los clientes que compraron este producto también han comprado:'; +$_MODULE['<{crossselling}prestashop>crossselling_4351cfebe4b61d8aa5efa1d020710005'] = 'Anterior'; +$_MODULE['<{crossselling}prestashop>crossselling_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Siguiente'; diff --git a/modules/crossselling/fr.php b/modules/crossselling/fr.php new file mode 100755 index 000000000..47f18fe16 --- /dev/null +++ b/modules/crossselling/fr.php @@ -0,0 +1,16 @@ +crossselling_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Ventes croisées'; +$_MODULE['<{crossselling}prestashop>crossselling_ef2b66b0b65479e08ff0cce29e19d006'] = 'Les clients qui ont acheté ce produit ont également acheté...'; +$_MODULE['<{crossselling}prestashop>crossselling_e316b4398212d473f7f53c7728fe1c37'] = 'Paramètres mis à jour'; +$_MODULE['<{crossselling}prestashop>crossselling_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{crossselling}prestashop>crossselling_b6bf131edd323320bac67303a3f4de8a'] = 'Afficher le prix du produit'; +$_MODULE['<{crossselling}prestashop>crossselling_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{crossselling}prestashop>crossselling_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{crossselling}prestashop>crossselling_70f9a895dc3273d34a7f6d14642708ec'] = 'Afficher le prix du produit dans le block'; +$_MODULE['<{crossselling}prestashop>crossselling_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{crossselling}prestashop>crossselling_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent'; +$_MODULE['<{crossselling}prestashop>crossselling_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{crossselling}prestashop>crossselling_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant'; diff --git a/modules/crossselling/it.php b/modules/crossselling/it.php new file mode 100644 index 000000000..086770234 --- /dev/null +++ b/modules/crossselling/it.php @@ -0,0 +1,16 @@ +crossselling_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Vendita incrociata'; +$_MODULE['<{crossselling}prestashop>crossselling_ef2b66b0b65479e08ff0cce29e19d006'] = 'I clienti che hanno acquistato questo prodotto hanno anche comprato ...'; +$_MODULE['<{crossselling}prestashop>crossselling_e316b4398212d473f7f53c7728fe1c37'] = 'Impostazioni aggiornate con successo'; +$_MODULE['<{crossselling}prestashop>crossselling_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{crossselling}prestashop>crossselling_b6bf131edd323320bac67303a3f4de8a'] = 'Mostra prezzo sui prodotti'; +$_MODULE['<{crossselling}prestashop>crossselling_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{crossselling}prestashop>crossselling_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{crossselling}prestashop>crossselling_70f9a895dc3273d34a7f6d14642708ec'] = 'Mostra il prezzo sui prodotti nel blocco.'; +$_MODULE['<{crossselling}prestashop>crossselling_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{crossselling}prestashop>crossselling_dd1f775e443ff3b9a89270713580a51b'] = 'I clienti che hanno acquistato questo prodotto hanno acquistato anche:'; +$_MODULE['<{crossselling}prestashop>crossselling_4351cfebe4b61d8aa5efa1d020710005'] = 'Precedente'; +$_MODULE['<{crossselling}prestashop>crossselling_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Successivo'; diff --git a/modules/crossselling/js/crossselling.js b/modules/crossselling/js/crossselling.js new file mode 100755 index 000000000..232ac322c --- /dev/null +++ b/modules/crossselling/js/crossselling.js @@ -0,0 +1,65 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +var cs_serialScrollNbImagesDisplayed; +var cs_serialScrollNbImages; +var cs_serialScrollActualImagesIndex; + +function cs_serialScrollFixLock(event, targeted, scrolled, items, position) +{ + serialScrollNbImages = $('#crossselling_list li:visible').length; + serialScrollNbImagesDisplayed = 5; + + var leftArrow = position == 0 ? true : false; + var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false; + + $('a#crossselling_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1); + $('a#crossselling_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block'); + return true; +} + +$(document).ready(function(){ +//init the serialScroll for thumbs + cs_serialScrollNbImages = $('#crossselling_list li').length; + cs_serialScrollNbImagesDisplayed = 5; + cs_serialScrollActualImagesIndex = 0; + $('#crossselling_list').serialScroll({ + items:'li', + prev:'a#crossselling_scroll_left', + next:'a#crossselling_scroll_right', + axis:'x', + offset:0, + stop:true, + onBefore:cs_serialScrollFixLock, + duration:300, + step: 1, + lazy:true, + lock: false, + force:false, + cycle:false + }); + $('#crossselling_list').trigger( 'goto', [middle-3] ); +}); diff --git a/modules/crossselling/logo.gif b/modules/crossselling/logo.gif new file mode 100755 index 000000000..291bfc764 Binary files /dev/null and b/modules/crossselling/logo.gif differ diff --git a/modules/dateofdelivery/beforeCarrier.tpl b/modules/dateofdelivery/beforeCarrier.tpl new file mode 100644 index 000000000..216728b1f --- /dev/null +++ b/modules/dateofdelivery/beforeCarrier.tpl @@ -0,0 +1,65 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $datesDelivery|count} + + +
        +

        {l s='Approximate date of delivery with this carrier is between' mod='dateofdelivery'} {l s='and' mod='dateofdelivery'} *

        +

        * {l s='with direct payment methods (e.g: credit card)' mod='dateofdelivery'}

        +{/if} \ No newline at end of file diff --git a/modules/dateofdelivery/config.xml b/modules/dateofdelivery/config.xml new file mode 100755 index 000000000..1574a855d --- /dev/null +++ b/modules/dateofdelivery/config.xml @@ -0,0 +1,11 @@ + + + dateofdelivery + Date of delivery + 1.0 + Displays an approximate date of delivery + PrestaShop + shipping_logistics + 1 + 1 + \ No newline at end of file diff --git a/modules/dateofdelivery/dateofdelivery.php b/modules/dateofdelivery/dateofdelivery.php new file mode 100644 index 000000000..2c4fe8725 --- /dev/null +++ b/modules/dateofdelivery/dateofdelivery.php @@ -0,0 +1,511 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class DateOfDelivery extends Module +{ + private $_html = ''; + + public function __construct() + { + $this->name = 'dateofdelivery'; + $this->tab = 'shipping_logistics'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Date of delivery'); + $this->description = $this->l('Displays an approximate date of delivery'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('beforeCarrier') OR !$this->registerHook('orderDetailDisplayed')) + return false; + + if (!Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'dateofdelivery_carrier_rule` ( + `id_carrier_rule` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + `id_carrier` INT NOT NULL, + `minimal_time` INT NOT NULL, + `maximal_time` INT NOT NULL, + `delivery_saturday` TINYINT(1) NOT NULL, + `delivery_sunday` TINYINT(1) NOT NULL + ) ENGINE ='._MYSQL_ENGINE_.'; + ')) + + Configuration::updateValue('DOD_EXTRA_TIME_PRODUCT_OOS', 0); + Configuration::updateValue('DOD_EXTRA_TIME_PREPARATION', 1); + Configuration::updateValue('DOD_PREPARATION_SATURDAY', 1); + Configuration::updateValue('DOD_PREPARATION_SUNDAY', 1); + Configuration::updateValue('DOD_DATE_FORMAT', 'l j F Y'); + + return true; + } + + public function uninstall() + { + Configuration::deleteByName('DOD_EXTRA_TIME_PRODUCT_OOS'); + Configuration::deleteByName('DOD_EXTRA_TIME_PREPARATION'); + Configuration::deleteByName('DOD_PREPARATION_SATURDAY'); + Configuration::deleteByName('DOD_PREPARATION_SUNDAY'); + Configuration::deleteByName('DOD_DATE_FORMAT'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'dateofdelivery_carrier_rule`'); + return parent::uninstall(); + } + + public function getContent() + { + + $this->_html .= '

        '.$this->l('Date of delivery configuration').'

        '; + + $this->_postProcess(); + if (Tools::isSubmit('addCarrierRule') OR (Tools::isSubmit('editCarrierRule') AND Tools::isSubmit('id_carrier_rule'))) + $this->_setCarrierRuleForm(); + else + $this->_setConfigurationForm(); + + return $this->_html; + } + + public function hookBeforeCarrier($params) + { + global $smarty; + + if (!sizeof($params['carriers'])) + return false; + + $oos = false; // For out of stock management + foreach ($params['cart']->getProducts() as $product) + if ($product['quantity'] <= 0 OR ($product['quantity_attribute'] <= 0 AND $product['id_product_attribute'])) + $oos = true; + + $datesDelivery = array(); + foreach ($params['carriers'] as $carrier) + $datesDelivery[(int)($carrier['id_carrier'])] = $this->_getDatesOfDelivery((int)($carrier['id_carrier']), $oos); + $smarty->assign(array( + 'datesDelivery' => $datesDelivery, + 'id_carrier' => ($params['cart']->id_carrier ? (int)($params['cart']->id_carrier) : (int)(Configuration::get('PS_CARRIER_DEFAULT'))) + )); + return $this->display(__FILE__, 'beforeCarrier.tpl'); + } + + public function hookOrderDetailDisplayed($params) + { + global $smarty; + + $oos = false; // For out of stock management + foreach ($params['order']->getProducts() as $product) + if ($product['product_quantity_in_stock'] < 1) + $oos = true; + $datesDelivery = $this->_getDatesOfDelivery((int)($params['order']->id_carrier), $oos, $params['order']->date_add); + if (!is_array($datesDelivery) OR !sizeof($datesDelivery)) + return ; + $smarty->assign('datesDelivery', $datesDelivery); + return $this->display(__FILE__, 'orderDetail.tpl'); + } + + private function _postProcess() + { + global $currentIndex; + + $errors = array(); + if (Tools::isSubmit('submitMoreOptions')) + { + if (Tools::getValue('date_format') == '' OR !Validate::isCleanHtml(Tools::getValue('date_format'))) + $errors[] = $this->l('Date format is invalid'); + + if (!sizeof($errors)) + { + Configuration::updateValue('DOD_EXTRA_TIME_PRODUCT_OOS', (int)(Tools::getValue('extra_time_product_oos'))); + Configuration::updateValue('DOD_EXTRA_TIME_PREPARATION', (int)(Tools::getValue('extra_time_preparation'))); + Configuration::updateValue('DOD_PREPARATION_SATURDAY', (int)(Tools::isSubmit('preparation_saturday'))); + Configuration::updateValue('DOD_PREPARATION_SUNDAY', (int)(Tools::isSubmit('preparation_sunday'))); + Configuration::updateValue('DOD_DATE_FORMAT', Tools::getValue('date_format')); + $this->_html .= $this->displayConfirmation($this->l('Settings are updated')); + } + else + $this->_html .= $this->displayError(implode('
        ', $errors)); + } + + if (Tools::isSubmit('submitCarrierRule')) + { + if (!Validate::isUnsignedInt(Tools::getValue('minimal_time'))) + $errors[] = $this->l('Minimum time is invalid'); + if (!Validate::isUnsignedInt(Tools::getValue('maximal_time'))) + $errors[] = $this->l('Maximum time is invalid'); + if (($carrier = new Carrier((int)(Tools::getValue('id_carrier')))) AND !Validate::isLoadedObject($carrier)) + $errors[] = $this->l('Carrier is invalid'); + if ($this->_isAlreadyDefinedForCarrier((int)($carrier->id), (int)(Tools::getValue('id_carrier_rule', 0)))) + $errors[] = $this->l('You cannot use this carrier, a rule has already been saved.'); + + if(!sizeof($errors)) + { + if (Tools::isSubmit('addCarrierRule')) + { + if (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'dateofdelivery_carrier_rule`(`id_carrier`, `minimal_time`, `maximal_time`, `delivery_saturday`, `delivery_sunday`) + VALUES ('.(int)($carrier->id).', '.(int)(Tools::getValue('minimal_time')).', '.(int)(Tools::getValue('maximal_time')).', '.(int)(Tools::isSubmit('delivery_saturday')).', '.(int)(Tools::isSubmit('delivery_sunday')).') + ')) + Tools::redirectAdmin($currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmAddCarrierRule'); + else + $this->_html .= $this->displayError($this->l('An error occurred on adding of carrier rule.')); + } + else + { + if (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + SET `id_carrier` = '.(int)($carrier->id).', `minimal_time` = '.(int)(Tools::getValue('minimal_time')).', `maximal_time` = '.(int)(Tools::getValue('maximal_time')).', `delivery_saturday` = '.(int)(Tools::isSubmit('delivery_saturday')).', `delivery_sunday` = '.(int)(Tools::isSubmit('delivery_sunday')).' + WHERE `id_carrier_rule` = '.(int)(Tools::getValue('id_carrier_rule')) + )) + Tools::redirectAdmin($currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmEditCarrierRule'); + else + $this->_html .= $this->displayError($this->l('An error occurred on updating of carrier rule.')); + } + + } + else + $this->_html .= $this->displayError(implode('
        ', $errors)); + } + + if (Tools::isSubmit('deleteCarrierRule') AND Tools::isSubmit('id_carrier_rule') AND (int)(Tools::getValue('id_carrier_rule')) AND $this->_isCarrierRuleExists((int)(Tools::getValue('id_carrier_rule')))) + { + $this->_deleteByIdCarrierRule((int)(Tools::getValue('id_carrier_rule'))); + $this->_html .= $this->displayConfirmation($this->l('Carrier rule deleted successfully')); + } + + if (Tools::isSubmit('confirmAddCarrierRule')) + $this->_html = $this->displayConfirmation($this->l('Carrier rule added successfully')); + + if (Tools::isSubmit('confirmEditCarrierRule')) + $this->_html = $this->displayConfirmation($this->l('Carrier rule updated successfully')); + } + + private function _setConfigurationForm() + { + global $currentIndex; + + $this->_html .= ' +
        + '.$this->l('Carrier configuration').' + +

        '.$this->l('Add a new carrier rule').'

        + +

        '.$this->l('List of carrier rules').'

        '; + $carrier_rules = $this->_getCarrierRulesWithCarrierName(); + if (sizeof($carrier_rules)) + { + $this->_html .= ' + + + + + + + + + + + '; + foreach ($carrier_rules as $rule) + { + $this->_html .= ' + + + + + + + '; + } + $this->_html .= ' + +
        '.$this->l('Name of carrier').''.$this->l('Delivery between').''.$this->l('Saturday delivery').''.$this->l('Sunday delivery').''.$this->l('Actions').'
        '.(!preg_match('/^0$/Ui', $rule['name']) ? htmlentities($rule['name'], ENT_QUOTES, 'UTF-8') : Configuration::get('PS_SHOP_NAME')).''.(int)($rule['minimal_time']).' '.$this->l('day(s) and').' '.(int)($rule['maximal_time']).' '.$this->l('day(s)').''; + if ($rule['delivery_saturday']) + $this->_html .= ''.$this->l('Yes').''; + else + $this->_html .= ''.$this->l('No').''; + $this->_html .=' + '; + if ($rule['delivery_sunday']) + $this->_html .= ''.$this->l('Yes').''; + else + $this->_html .= ''.$this->l('No').''; + $this->_html .= ' + + + +
        '; + } + else + $this->_html .= '

        No carrier rule

        '; + $this->_html .= ' +
        +
        +
        +
        + '.$this->l('More options').' + + +
        + '.$this->l('day(s)').' +
        +
        + +
        + '.$this->l('day(s)').' +
        +
        + +
        +
          +
        • +
        • +
        +
        + +
        + +

        You can see all parameters available at: http://www.php.net/manual/en/function.date.php

        +
        +

        +
        +
        + '; + } + + private function _setCarrierRuleForm() + { + global $currentIndex, $cookie; + + $carriers = Carrier::getCarriers((int)($cookie->id_lang), true); + if (Tools::isSubmit('editCarrierRule') AND $this->_isCarrierRuleExists((int)(Tools::getValue('id_carrier_rule')))) + $carrier_rule = $this->_getCarrierRule((int)(Tools::getValue('id_carrier_rule'))); + + $this->_html .= ' +
        + '; + if (isset($carrier_rule) AND $carrier_rule['id_carrier_rule']) + $this->_html .= ''; + $this->_html .= ' +
        + '; + + if (Tools::isSubmit('addCarrierRule')) + $this->_html .= ' '.$this->l('New carrier rule').''; + elseif (Tools::isSubmit('editCarrierRule')) + $this->_html .= ' '.$this->l('Edit carrier rule').''; + + $this->_html .= ' + +
        + +
        + + +
        + '.$this->l('day(s) and').' + '.$this->l('day(s)').' +
        + + +
        +
          +
        • +
        • +
        +
        + +

        +

        '.$this->l('Cancel').' +

        + '; + + $this->_html .= ' +
        +
        + '; + } + + private function _getCarrierRulesWithCarrierName() + { + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` dcr + LEFT JOIN `'._DB_PREFIX_.'carrier` c ON (c.`id_carrier` = dcr.`id_carrier`) + '); + } + + private function _getCarrierRule($id_carrier_rule) + { + if (!(int)($id_carrier_rule)) + return false; + return Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + WHERE `id_carrier_rule` = '.(int)($id_carrier_rule) + ); + } + + private function _getCarrierRuleWithIdCarrier($id_carrier) + { + if (!(int)($id_carrier)) + return false; + return Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + WHERE `id_carrier` = '.(int)($id_carrier) + ); + } + + private function _isCarrierRuleExists($id_carrier_rule) + { + if (!(int)($id_carrier_rule)) + return false; + return (bool)Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + WHERE `id_carrier_rule` = '.(int)($id_carrier_rule) + ); + } + + private function _deleteByIdCarrierRule($id_carrier_rule) + { + if (!(int)($id_carrier_rule)) + return false; + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + WHERE `id_carrier_rule` = '.(int)($id_carrier_rule) + ); + } + + private function _isAlreadyDefinedForCarrier($id_carrier, $id_carrier_rule = 0) + { + if (!(int)($id_carrier)) + return false; + return (bool)Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'dateofdelivery_carrier_rule` + WHERE `id_carrier` = '.(int)($id_carrier).' + '.($id_carrier_rule != 0 ? 'AND `id_carrier_rule` != '.(int)($id_carrier_rule) : '')); + } + + private function _getDatesOfDelivery($id_carrier, $product_oos = false, $date = null) + { + if (!(int)($id_carrier)) + return false; + $carrier_rule = $this->_getCarrierRuleWithIdCarrier((int)($id_carrier)); + if (empty($carrier_rule)) + return false; + + if ($date != null AND Validate::isDate($date)) + $date_now = strtotime($date); + else + $date_now = time(); // Date on timestamp format + if ($product_oos) + $date_now += Configuration::get('DOD_EXTRA_TIME_PRODUCT_OOS') * 24 * 3600; + if (!Configuration::get('DOD_PREPARATION_SATURDAY') AND date('l', $date_now) == 'Saturday') + $date_now += 24 * 3600; + if (!Configuration::get('DOD_PREPARATION_SUNDAY') AND date('l', $date_now) == 'Sunday') + $date_now += 24 * 3600; + + $date_minimal_time = $date_now + ($carrier_rule['minimal_time'] * 24 * 3600) + (Configuration::get('DOD_EXTRA_TIME_PREPARATION') * 24 * 3600); + $date_maximal_time = $date_now + ($carrier_rule['maximal_time'] * 24 * 3600) + (Configuration::get('DOD_EXTRA_TIME_PREPARATION') * 24 * 3600); + + if (!$carrier_rule['delivery_saturday'] AND date('l', $date_minimal_time) == 'Saturday') + { + $date_minimal_time += 24 * 3600; + $date_maximal_time += 24 * 3600; + } + if (!$carrier_rule['delivery_saturday'] AND date('l', $date_maximal_time) == 'Saturday') + $date_maximal_time += 24 * 3600; + + if (!$carrier_rule['delivery_sunday'] AND date('l', $date_minimal_time) == 'Sunday') + { + $date_minimal_time += 24 * 3600; + $date_maximal_time += 24 * 3600; + } + if (!$carrier_rule['delivery_sunday'] AND date('l', $date_maximal_time) == 'Sunday') + $date_maximal_time += 24 * 3600; + + /* + $this->l('Sunday'); + $this->l('Monday'); + $this->l('Tuesday'); + $this->l('Wednesday'); + $this->l('Thursday'); + $this->l('Friday'); + $this->l('Saturday'); + + $this->l('January'); + $this->l('February'); + $this->l('March'); + $this->l('April'); + $this->l('May'); + $this->l('June'); + $this->l('July'); + $this->l('August'); + $this->l('September'); + $this->l('October'); + $this->l('November'); + $this->l('December'); + */ + + $date_minimal_string = ''; + $date_maximal_string = ''; + $date_format = preg_split('/([a-z])/Ui', Configuration::get('DOD_DATE_FORMAT'), NULL, PREG_SPLIT_DELIM_CAPTURE); + foreach ($date_format as $elmt) + { + if ($elmt == 'l' OR $elmt == 'F') + { + $date_minimal_string .= $this->l(date($elmt, $date_minimal_time)); + $date_maximal_string .= $this->l(date($elmt, $date_maximal_time)); + } + elseif (preg_match('/[a-z]/Ui', $elmt)) + { + $date_minimal_string .= date($elmt, $date_minimal_time); + $date_maximal_string .= date($elmt, $date_maximal_time); + } + else + { + $date_minimal_string .= $elmt; + $date_maximal_string .= $elmt; + } + } + return array( + $date_minimal_string, + $date_maximal_string + ); + } + +} + diff --git a/modules/dateofdelivery/de.php b/modules/dateofdelivery/de.php new file mode 100644 index 000000000..92c6804f0 --- /dev/null +++ b/modules/dateofdelivery/de.php @@ -0,0 +1,71 @@ +beforecarrier_75261aaef97717dda0ca98743b24f8f3'] = 'Voraussichtliche Lieferung mit diesem Lieferanten ist zwischen'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_be5d5d37542d75f93a87094459f76678'] = 'und'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_b7ab10d227790bd29e51c1845153f126'] = 'mit direkten Zahlungsmitteln (z.B.: Kreditkarte)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b0f76e26cffaf27784d901a64f39593e'] = 'Liefertermin'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_98110868b266d63c3bacdac4430169cf'] = 'Zeigt den voraussichtlichen Liefertermin an'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_a39df5444246aeb081729db7e17f51bc'] = 'Konfiguration des Liefertermins'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0ea55758c7a68c0309b915e4b718d6b8'] = 'ungültiges Datenformat'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ecfe3ba0ff66a97029088e8e90a3f051'] = 'Minimale Dauer ist ungültig'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0245cd1cce5ecea8eb23b043be00d80a'] = 'Maximale Dauer ist ungültig'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6843321c8b0edea8cf333519316ed7b'] = 'Lieferant ist ungültig'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_17673c1595a3722522f581c854b8edc5'] = 'Sie können diesen Lieferanten nicht nutzen, eine Regel wurde bereits gespeichert'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_50e1f1030812a9a8fd66dfff17099fcd'] = 'ein Fehler ist beim Hinzufügen einer Lieferanten-Regel aufgetreten'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_240276f48ff2e0e5fe620ff311e677b5'] = 'ein Fehler ist beim Aktualisieren einer Lieferanten-Regel aufgetreten'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b9e3eda70ccb175c96a56bd79b89bd8b'] = 'Lieferanten-Regel erfolgreich gelöscht'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_25e775663057cfc945da15827d972699'] = 'Lieferanten-Regel erfolgreich hinzugefügt'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c20585756aa4f1b448a11ce77a054e32'] = 'Lieferanten-Regel erfolgreich aktualisiert'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_2b5bf8ae8e565a30e2f05c856f5f5f8b'] = 'Lieferanten-Konfiguration'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6ff622b31d0cd1c32c775d1e1f20831'] = 'Neue Lieferanten-Regel hinzufügen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b2995b648d396416ae8648d719e1a20'] = 'Liste der Lieferanten-Regeln'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_aeae9747bcdc4f7c25aa95c2a6765952'] = 'Name des Lieferanten'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b9f5204ddf0881dc9f3a7bf65d4ac15'] = 'Lieferung zwischen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_52f253c711cff509bd5e4df2b18b697a'] = 'Samstagslieferung'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fcddbca356dee064438a399fc0c4c84e'] = 'Sonntagslieferung'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7b367091d009d1a4be71a6a72494894f'] = 'Tag (e) UND'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_225e75c29d32392d311f5dc94c792384'] = 'Tag (e)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7dce122004969d56ae2e0245cb754d35'] = 'Bearbeiten'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_4dab36ac83853282fc0d7bae20c19e90'] = 'Weitere Optionen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0008e84621e5c9f21f8a55387a28692f'] = 'Zusätzliche Zeit, wenn ein Produkt nicht vorrätig ist'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_521d02cf307201053a46e0b9c5b5170c'] = 'Zusätzliche Zeit zur Vorbereitung einer Bestellung'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cec31ec82e3bdee482baaa9f5b11eeed'] = 'Vorbereitungsoption'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_15b4020fafe2bcadf41fbdb2e7fa137a'] = 'Vorbereitung am Samstag '; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9685cbc6ac9090137fb087d4f48d0561'] = 'Vorbereitung am Sonntag '; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_104f1a7d59077b514d4105fcee0e42ff'] = 'Format des Datums'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_168ee9f4820976c4f4055cd817965df4'] = 'Neue Lieferanten-Regel'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8c5961161cc9ce6db81bf3be77091136'] = 'Lieferanten-Regel bearbeiten'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f8617a92ba0a0a4eabee724eab7c9f48'] = 'Lieferant:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_961f2247a2070bedff9f9cd8d64e2650'] = 'Wählen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_d3e0fc43c22a6bb8e2d271a29b2f06fd'] = 'Liefermöglichkeiten:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_796c163589f295373e171842f37265d5'] = 'Mittwoch'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_86f5978d9b80124f509bdb71786e929e'] = 'Januar'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_659e59f062c75f81259d22786d6c44aa'] = 'Februar'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'März'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_3fcf026bbfffb63fb24b8de9d0446949'] = 'April'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_195fbb57ffe7449796d23466085ce6d8'] = 'Mai'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Juni'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b539f6f34e8503c97f6d3421346b63c'] = 'Juli'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_41ba70891fb6f39327d8ccb9b1dafb84'] = 'August'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cc5d90569e1c8313c2b1c2aab1401174'] = 'September'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Oktober'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7e823b37564da492ca1629b4732289a8'] = 'November'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_82331503174acbae012b2004f6431fa5'] = 'Dezember'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_8e8fe67c419e34287373a91cc6cab1de'] = 'Voraussichtliche Lieferung zwischen'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_be5d5d37542d75f93a87094459f76678'] = 'und'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_b7ab10d227790bd29e51c1845153f126'] = 'mit direkten Zahlungsmitteln (z.B.: Kreditkarte)'; diff --git a/modules/dateofdelivery/es.php b/modules/dateofdelivery/es.php new file mode 100644 index 000000000..5ba88f443 --- /dev/null +++ b/modules/dateofdelivery/es.php @@ -0,0 +1,71 @@ +beforecarrier_75261aaef97717dda0ca98743b24f8f3'] = 'Fecha aproximada de entraga con este transportista entre'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_be5d5d37542d75f93a87094459f76678'] = 'y'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_b7ab10d227790bd29e51c1845153f126'] = 'con los modos de pago directos (ejemplo: tarjeta de crédito)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b0f76e26cffaf27784d901a64f39593e'] = 'Fecha de entraga'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_98110868b266d63c3bacdac4430169cf'] = 'Mostrar una fecha aproximada de entraga'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_a39df5444246aeb081729db7e17f51bc'] = 'Configuración de la fecha de entraga'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0ea55758c7a68c0309b915e4b718d6b8'] = 'El formato de la fecha no es válido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ecfe3ba0ff66a97029088e8e90a3f051'] = 'Plazo mínimo incorrecto'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0245cd1cce5ecea8eb23b043be00d80a'] = 'Plazo máximo incorrecto'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6843321c8b0edea8cf333519316ed7b'] = 'Transportista no válido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_17673c1595a3722522f581c854b8edc5'] = 'No puede utilizar ningún transportista, ya se ha registrado una regla.'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_50e1f1030812a9a8fd66dfff17099fcd'] = 'Se ha producido un error al añadir la regla'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_240276f48ff2e0e5fe620ff311e677b5'] = 'Se ha producido un error al configurar la regla'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b9e3eda70ccb175c96a56bd79b89bd8b'] = 'La regla de transportista se ha suprimido con éxito'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_25e775663057cfc945da15827d972699'] = 'La regla de transportista se ha añadido con éxito'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c20585756aa4f1b448a11ce77a054e32'] = 'La regla de transportista ha sido actualizada correctamente'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_2b5bf8ae8e565a30e2f05c856f5f5f8b'] = 'Configuración del transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6ff622b31d0cd1c32c775d1e1f20831'] = 'Añadir una nueva regla de transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b2995b648d396416ae8648d719e1a20'] = 'Lista de las reglas de transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_aeae9747bcdc4f7c25aa95c2a6765952'] = 'Nombre del transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b9f5204ddf0881dc9f3a7bf65d4ac15'] = 'Entrega prevista entre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_52f253c711cff509bd5e4df2b18b697a'] = 'Entrega los sábados'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fcddbca356dee064438a399fc0c4c84e'] = 'Entrega los domingos'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7b367091d009d1a4be71a6a72494894f'] = 'día(s) y'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_225e75c29d32392d311f5dc94c792384'] = 'día(s)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7dce122004969d56ae2e0245cb754d35'] = 'Modificar'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_4dab36ac83853282fc0d7bae20c19e90'] = 'Más opciones'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0008e84621e5c9f21f8a55387a28692f'] = 'Tiempo suplementario cuando un producto no está disponible'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_521d02cf307201053a46e0b9c5b5170c'] = 'Tiempo suplementario para la preparación del pedido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cec31ec82e3bdee482baaa9f5b11eeed'] = 'Opción para la preparación'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_15b4020fafe2bcadf41fbdb2e7fa137a'] = 'Preparación el sábado'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9685cbc6ac9090137fb087d4f48d0561'] = 'Preparación el domingo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_104f1a7d59077b514d4105fcee0e42ff'] = 'Formato de la fecha:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_168ee9f4820976c4f4055cd817965df4'] = 'Nueva regla de transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8c5961161cc9ce6db81bf3be77091136'] = 'Modificar una regla de transportista'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f8617a92ba0a0a4eabee724eab7c9f48'] = 'Transportista:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_961f2247a2070bedff9f9cd8d64e2650'] = 'Elegir'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_d3e0fc43c22a6bb8e2d271a29b2f06fd'] = 'Opciones de entraga:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ea4788705e6873b424c65e91c2846b19'] = 'Anular'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_5792315f09a5d54fb7e3d066672b507f'] = 'Martes'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_796c163589f295373e171842f37265d5'] = 'Miércoles'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_78ae6f0cd191d25147e252dc54768238'] = 'Jueves'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sábado'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_86f5978d9b80124f509bdb71786e929e'] = 'Enero'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_659e59f062c75f81259d22786d6c44aa'] = 'Febrero'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Marzo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_3fcf026bbfffb63fb24b8de9d0446949'] = 'Abril'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_195fbb57ffe7449796d23466085ce6d8'] = 'Mayo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Junio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b539f6f34e8503c97f6d3421346b63c'] = 'Julio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Agosto'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cc5d90569e1c8313c2b1c2aab1401174'] = 'Septiembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Octubre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7e823b37564da492ca1629b4732289a8'] = 'Noviembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_82331503174acbae012b2004f6431fa5'] = 'Diciembre'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_8e8fe67c419e34287373a91cc6cab1de'] = 'Fecha aproximada de entrega entre'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_be5d5d37542d75f93a87094459f76678'] = 'y'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_b7ab10d227790bd29e51c1845153f126'] = 'con los modos de pago directo (ejemplo: tarjeta de crédito)'; diff --git a/modules/dateofdelivery/fr.php b/modules/dateofdelivery/fr.php new file mode 100644 index 000000000..a79a14b8a --- /dev/null +++ b/modules/dateofdelivery/fr.php @@ -0,0 +1,71 @@ +beforecarrier_75261aaef97717dda0ca98743b24f8f3'] = 'Date approximative de livraison avec ce transporteur est entre le'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_b7ab10d227790bd29e51c1845153f126'] = 'avec un moyen de paiement direct (ex.: carte bancaire)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b0f76e26cffaf27784d901a64f39593e'] = 'Date de livraison'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_98110868b266d63c3bacdac4430169cf'] = 'Afficher une date approximative de livraison'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_a39df5444246aeb081729db7e17f51bc'] = 'Configuration: Date de livraison'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0ea55758c7a68c0309b915e4b718d6b8'] = 'Le format de la date est invalide'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ecfe3ba0ff66a97029088e8e90a3f051'] = 'Délais minimum incorrect'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0245cd1cce5ecea8eb23b043be00d80a'] = 'Délais maximum incorrect'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6843321c8b0edea8cf333519316ed7b'] = 'Transporteur invalide'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_17673c1595a3722522f581c854b8edc5'] = 'vous ne pouvez pas utiliser de transporteur, une régle a déjà été enregistrée'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_50e1f1030812a9a8fd66dfff17099fcd'] = 'une erreur s\'est produite lors de l\'ajout de la régle'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_240276f48ff2e0e5fe620ff311e677b5'] = 'une erreur s\'est produite lors de la mise à jour de la régle'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b9e3eda70ccb175c96a56bd79b89bd8b'] = 'Régle de transporteur a été supprimée avec succés'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_25e775663057cfc945da15827d972699'] = 'Régle de transporteur a été ajoutée avec succés'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c20585756aa4f1b448a11ce77a054e32'] = 'Régle de transporteur a été mise à jour avec succés'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_2b5bf8ae8e565a30e2f05c856f5f5f8b'] = 'Configuration de transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6ff622b31d0cd1c32c775d1e1f20831'] = 'Ajouter une nouvelle règle de transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b2995b648d396416ae8648d719e1a20'] = 'Liste des règles de transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_aeae9747bcdc4f7c25aa95c2a6765952'] = 'Nom du transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b9f5204ddf0881dc9f3a7bf65d4ac15'] = 'Livraison entre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_52f253c711cff509bd5e4df2b18b697a'] = 'livraison le Samedi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fcddbca356dee064438a399fc0c4c84e'] = 'livraison le Dimanche'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7b367091d009d1a4be71a6a72494894f'] = 'jour(s) et'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_225e75c29d32392d311f5dc94c792384'] = 'jour(s)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_4dab36ac83853282fc0d7bae20c19e90'] = 'Plus d\'options'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0008e84621e5c9f21f8a55387a28692f'] = 'Temps supplémentaire lorsqu\'un produit est hors stock'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_521d02cf307201053a46e0b9c5b5170c'] = 'Temps supplémentaire pour la préparation des commandes'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cec31ec82e3bdee482baaa9f5b11eeed'] = 'Option pour la préparation'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_15b4020fafe2bcadf41fbdb2e7fa137a'] = 'préparation le Samedi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9685cbc6ac9090137fb087d4f48d0561'] = 'préparation le Dimanche'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_104f1a7d59077b514d4105fcee0e42ff'] = 'Format de la date :'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_168ee9f4820976c4f4055cd817965df4'] = 'Nouvelle règle de transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8c5961161cc9ce6db81bf3be77091136'] = 'Modification d\'une règle de transporteur'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f8617a92ba0a0a4eabee724eab7c9f48'] = 'Transporteur :'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_961f2247a2070bedff9f9cd8d64e2650'] = 'Choisissez'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_d3e0fc43c22a6bb8e2d271a29b2f06fd'] = 'Option de livraison :'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_86f5978d9b80124f509bdb71786e929e'] = 'Janvier'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_659e59f062c75f81259d22786d6c44aa'] = 'Février'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Mars'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_3fcf026bbfffb63fb24b8de9d0446949'] = 'Avril'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_195fbb57ffe7449796d23466085ce6d8'] = 'Mai'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Juin'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b539f6f34e8503c97f6d3421346b63c'] = 'Juillet'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Août'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cc5d90569e1c8313c2b1c2aab1401174'] = 'Septembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Octobre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7e823b37564da492ca1629b4732289a8'] = 'Novembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_82331503174acbae012b2004f6431fa5'] = 'Décembre'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_8e8fe67c419e34287373a91cc6cab1de'] = 'Date approximative de livraison est entre le'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_b7ab10d227790bd29e51c1845153f126'] = 'avec un moyen de paiement direct (ex.: carte bancaire)'; diff --git a/modules/dateofdelivery/img/cross.png b/modules/dateofdelivery/img/cross.png new file mode 100755 index 000000000..1514d51a3 Binary files /dev/null and b/modules/dateofdelivery/img/cross.png differ diff --git a/modules/dateofdelivery/img/tick.png b/modules/dateofdelivery/img/tick.png new file mode 100755 index 000000000..a9925a06a Binary files /dev/null and b/modules/dateofdelivery/img/tick.png differ diff --git a/modules/dateofdelivery/img/time.png b/modules/dateofdelivery/img/time.png new file mode 100755 index 000000000..911da3f1d Binary files /dev/null and b/modules/dateofdelivery/img/time.png differ diff --git a/modules/dateofdelivery/img/time_add.png b/modules/dateofdelivery/img/time_add.png new file mode 100755 index 000000000..dcc45cb22 Binary files /dev/null and b/modules/dateofdelivery/img/time_add.png differ diff --git a/modules/dateofdelivery/img/time_delete.png b/modules/dateofdelivery/img/time_delete.png new file mode 100755 index 000000000..5bf8313c6 Binary files /dev/null and b/modules/dateofdelivery/img/time_delete.png differ diff --git a/modules/dateofdelivery/it.php b/modules/dateofdelivery/it.php new file mode 100644 index 000000000..020a9b413 --- /dev/null +++ b/modules/dateofdelivery/it.php @@ -0,0 +1,71 @@ +beforecarrier_75261aaef97717dda0ca98743b24f8f3'] = 'Data approssimativa di consegna con questo corriere è tra'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_be5d5d37542d75f93a87094459f76678'] = 'e'; +$_MODULE['<{dateofdelivery}prestashop>beforecarrier_b7ab10d227790bd29e51c1845153f126'] = 'con i metodi di pagamento diretto (es.: carta di credito)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b0f76e26cffaf27784d901a64f39593e'] = 'Data di consegna'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_98110868b266d63c3bacdac4430169cf'] = 'Visualizza una data approssimativa di consegna'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_a39df5444246aeb081729db7e17f51bc'] = 'Configurazione data di consegna'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0ea55758c7a68c0309b915e4b718d6b8'] = 'Il formato della data non è valido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7ccf58c950043c9fbfed668df13ce608'] = 'Impostazioni aggiornate'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ecfe3ba0ff66a97029088e8e90a3f051'] = 'Tempo minimo non valido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0245cd1cce5ecea8eb23b043be00d80a'] = 'Tempo massimo non valido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6843321c8b0edea8cf333519316ed7b'] = 'Corriere non valido'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_17673c1595a3722522f581c854b8edc5'] = 'Non puoi utilizzare questo corriere, una regola è stata già salvata'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_50e1f1030812a9a8fd66dfff17099fcd'] = 'si è verificato un errore durante l\'aggiunta della regola corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_240276f48ff2e0e5fe620ff311e677b5'] = 'si è verificato un errore durante l\'aggiornamento della regola corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_b9e3eda70ccb175c96a56bd79b89bd8b'] = 'Regola corriere eliminata con successo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_25e775663057cfc945da15827d972699'] = 'Regola corriere aggiunta con successo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c20585756aa4f1b448a11ce77a054e32'] = 'Regola corriere aggiornata con successo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_2b5bf8ae8e565a30e2f05c856f5f5f8b'] = 'Configurazione corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_e6ff622b31d0cd1c32c775d1e1f20831'] = 'Aggiungi una nuova regola corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b2995b648d396416ae8648d719e1a20'] = 'Elenco di regole corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_aeae9747bcdc4f7c25aa95c2a6765952'] = 'Nome del corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b9f5204ddf0881dc9f3a7bf65d4ac15'] = 'Consegna tra'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_52f253c711cff509bd5e4df2b18b697a'] = 'Consegna sabato'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fcddbca356dee064438a399fc0c4c84e'] = 'Consegna domenica'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7b367091d009d1a4be71a6a72494894f'] = 'giorno(i) E'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_225e75c29d32392d311f5dc94c792384'] = 'giorno(i)'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7dce122004969d56ae2e0245cb754d35'] = 'Modifica'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_4dab36ac83853282fc0d7bae20c19e90'] = 'Altre opzioni'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_0008e84621e5c9f21f8a55387a28692f'] = 'Tempo supplementare quando un prodotto è esaurito'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_521d02cf307201053a46e0b9c5b5170c'] = 'Tempo supplementare per la preparazione dell\'ordine'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cec31ec82e3bdee482baaa9f5b11eeed'] = 'Opzione di preparazione '; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_15b4020fafe2bcadf41fbdb2e7fa137a'] = 'Preparazione sabato'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9685cbc6ac9090137fb087d4f48d0561'] = 'Preparazione domenica'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_104f1a7d59077b514d4105fcee0e42ff'] = 'Formato della data:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_168ee9f4820976c4f4055cd817965df4'] = 'Nuova regola corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8c5961161cc9ce6db81bf3be77091136'] = 'Modifica regola corriere'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_f8617a92ba0a0a4eabee724eab7c9f48'] = 'Corriere:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_961f2247a2070bedff9f9cd8d64e2650'] = 'Scegli'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_d3e0fc43c22a6bb8e2d271a29b2f06fd'] = 'Opzioni consegna:'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domenica'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunedi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_5792315f09a5d54fb7e3d066672b507f'] = 'Martedì'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_796c163589f295373e171842f37265d5'] = 'Mercoledì'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_78ae6f0cd191d25147e252dc54768238'] = 'Giovedi'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_c33b138a163847cdb6caeeb7c9a126b4'] = 'Venerdì'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabato'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_86f5978d9b80124f509bdb71786e929e'] = 'Gennaio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_659e59f062c75f81259d22786d6c44aa'] = 'Febbraio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Marzo'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_3fcf026bbfffb63fb24b8de9d0446949'] = 'Aprile'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_195fbb57ffe7449796d23466085ce6d8'] = 'Maggio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Giugno'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_1b539f6f34e8503c97f6d3421346b63c'] = 'Luglio'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Agosto'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_cc5d90569e1c8313c2b1c2aab1401174'] = 'Settembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Ottobre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_7e823b37564da492ca1629b4732289a8'] = 'Novembre'; +$_MODULE['<{dateofdelivery}prestashop>dateofdelivery_82331503174acbae012b2004f6431fa5'] = 'Dicembre'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_8e8fe67c419e34287373a91cc6cab1de'] = 'Data approssimativa di consegna compresa tra'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_be5d5d37542d75f93a87094459f76678'] = 'e'; +$_MODULE['<{dateofdelivery}prestashop>orderdetail_b7ab10d227790bd29e51c1845153f126'] = 'con i metodi di pagamento diretto (es.: carta di credito)'; diff --git a/modules/dateofdelivery/logo.gif b/modules/dateofdelivery/logo.gif new file mode 100644 index 000000000..321c583ad Binary files /dev/null and b/modules/dateofdelivery/logo.gif differ diff --git a/modules/dateofdelivery/orderDetail.tpl b/modules/dateofdelivery/orderDetail.tpl new file mode 100644 index 000000000..9e89fb84f --- /dev/null +++ b/modules/dateofdelivery/orderDetail.tpl @@ -0,0 +1,30 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $datesDelivery|count} +

        {l s='Approximate date of delivery is between' mod='dateofdelivery'} {$datesDelivery.0} {l s='and' mod='dateofdelivery'} {$datesDelivery.1} *

        +

        * {l s='with direct payment methods (e.g: credit card)' mod='dateofdelivery'}

        +{/if} \ No newline at end of file diff --git a/modules/dejala/MyLogUtils.php b/modules/dejala/MyLogUtils.php new file mode 100644 index 000000000..51e8b6c20 --- /dev/null +++ b/modules/dejala/MyLogUtils.php @@ -0,0 +1,49 @@ +$avalue) { + $buffer=$buffer . $indent . "\t" . $akey ."=>". MyLogUtils::logValue($avalue,$lvl+1) . "\r\n"; + } + $buffer=$buffer.$indent."}"; + return ($buffer); + } + else if (is_object($mvalue)) + { + $indent=""; + for ($i=0; $i < $lvl; $i++) + $indent = $indent."\t"; + $buffer = "?" . "=" . get_class($mvalue) . "{\r\n"; + foreach ($mvalue as $akey=>$avalue) { + $buffer=$buffer . $indent . "\t" . $akey ."=". MyLogUtils::logValue($avalue,$lvl+1) . "\r\n"; + } + $buffer=$buffer.$indent."}"; + return($buffer); + } + else + return ($mvalue); + } +} + diff --git a/modules/dejala/calendarutils.php b/modules/dejala/calendarutils.php new file mode 100644 index 000000000..d85c1853d --- /dev/null +++ b/modules/dejala/calendarutils.php @@ -0,0 +1,131 @@ + 0) { + $currentHour = $currentHour + 1; + $dateUtc = mktime($currentHour, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } + // si on est avant l'heure de départ, on se met à l'heure de départ + if ($currentHour < $startHour) { + $dateUtc = mktime($startHour, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } + return ($dateUtc); + } + + /** + * Ajout un délai à la date dateUtc : 0.5 jour ou 1*nb de jours + * Prend en compte le calendrier & les exceptions + **/ + public function addDelay($dateUtc, $delay, $calendar, $exceptions) { + // on se base sur la prochaine date dispo + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + if (!$dateUtc) + return (null); + + if ($delay == '0.5') { + $hour = (int)(date('H', $dateUtc)); + if ($hour < 12) { + $dateUtc = mktime('14', 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + } else { + $dateUtc = $this->skipOneDay($dateUtc) ; + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + } + return ($dateUtc); + } + + $deliveryDelay = (int)($delay); + while ($deliveryDelay--) + { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + $dateUtc = $this->getNextDateAvailable($dateUtc, $calendar, $exceptions); + } + return ($dateUtc); + } + + public function skipOneDay($dateUtc) { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + // on remet sur 00h00 pr livrer au début du jour + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + + return $dateUtc ; + } + public function skipCurDay($dateUtc) { + $currentDayZero = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); + $dateUtcZero = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + if ($currentDayZero == $dateUtcZero) { + $dateUtc = $this->skipOneDay($dateUtc) ; + } + return $dateUtc ; + } + /** + * Renvoie la prochaine journée disponible (soit $dateUtc, soit la prochaine à 00h00) + * Si aucune ds les 15j, renvoie NULL + **/ + public function getNextDateAvailable($dateUtc, $calendar, $exceptions) + { + // si dateUtc est dispo, retourne $dateUtc + if ($this->isDateAvailable($dateUtc, $calendar, $exceptions)) + return ($dateUtc); + + $loopcount = 0; + // on positionne au début de journée + $dateUtc = mktime(0, 0, 0, date('m', $dateUtc), date('d', $dateUtc), date('Y', $dateUtc)); + // on boucle pour trouver une journée dispo (si ds les 15j, y a pas : on laisse tomber + do + { + $dateUtc = strtotime(date("Y-m-d", $dateUtc) . " +1 day"); + $isDateFree = $this->isDateAvailable($dateUtc, $calendar, $exceptions); + $loopcount++; + } + while (!$isDateFree && ($loopcount < 15) ); + if ($isDateFree) + return ($dateUtc); + return (NULL); + } + + /** + * Returns if $dateUtc is available (orderable date) + **/ + public function isDateAvailable($dateUtc, $calendar, $exceptions) + { + // jour ferié ? + $mCalDate = date("d/m/Y", $dateUtc); + if (in_array($mCalDate, $exceptions)) + return (false); + // jour fermé ? + $wd = date('w', $dateUtc); + if (!isset($calendar[$wd])) + return (false); + + // on arrondit à l'heure suivante & on regarde si on est avant la fermeture + $stopHour = (int)($calendar[$wd]['stop_hour']); + $currentHour = (int)(date('H', $dateUtc)); + $currentMin = (int)(date('i', $dateUtc)); + if ($currentMin > 0) + $currentHour = $currentHour + 1; + // avant l'heure de fermeture ? + if ($currentHour <= $stopHour) + return (true); + else + return (false); + } + +} + diff --git a/modules/dejala/config.xml b/modules/dejala/config.xml new file mode 100755 index 000000000..3efee01ee --- /dev/null +++ b/modules/dejala/config.xml @@ -0,0 +1,12 @@ + + + dejala + Dejala.com : Courier delivery + 1.4 + Lets Dejala.com handle your deliveries by courier + + shipping_logistics + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/dejala/de.php b/modules/dejala/de.php new file mode 100644 index 000000000..10cdec71d --- /dev/null +++ b/modules/dejala/de.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mittwoch'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: Lieferung per Kurier'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Lassen Sie Dejala.com Ihre Lieferungen per Kurier übernehmen'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Das Dejala-Modul benötigt die PHP-Erweiterung cURL, um ordnungsgemäß zu funktionieren. Bitte installieren Sie diePHP-Erweiterung \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'Login ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'Kennwort ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'Land ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'Das Login muss eine gültige E-Mail-Adresse sein.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Shop Name ist erforderlich.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'ist keine gültige Marge.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Ein Fehler trat während der Authentifizierung Ihres Kontos auf Dejala.com auf. Ihre Zugangsdaten wurden nicht erkannt'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Unmöglich, die Handlung durchzuführen'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Bitte wählen Sie ein anderes Login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Dejala Server ist von Ihrem Prestashop Server nicht erreichbar. Dies ist sicherlich auf eine Begrenzung von Ihrem Hosting-Provider zurückzuführen. Bitte kontaktieren Sie seinen technischen Support und fragen Sie, ob Ihr Server autorisiert ist, ausgehende HTTP-Verbindungen zu initiieren'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Fehler beim Aktualisieren des Standorts'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Fehler beim Aktualisieren der Kontakte'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Fehler beim Aktualisieren der Prozesse'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Fehler beim Aktualisieren der Produkte'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Sie müssen mindestens eine E-Mail-Adresse angeben, um Dejalas Sichtbarkeit zu begrenzen'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Dieses Modul benötigt die PHP-Erweiterung cURL, um ordnungsgemäß zu funktionieren. Bitte installieren Sie zuerst die PHP-Erweiterung \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Ein Fehler trat während der Authentifizierung Ihres Kontos auf Dejala.com auf. Dies kann an einem vorübergehenden Netzwerk- oder Plattform-Problem liegen. Bitte versuchen Sie es später noch einmal oder kontaktieren Sie Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Ein Fehler ist beim Laden aufgetreten, bitte versuchen Sie es später noch einmal oder kontaktieren Sie Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Wenn Sie es wünschen... Kradmelder'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Ich wähle mein Lieferdatum, wenn mein Produkt verfügbar ist'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Lieferdatum ausgewählt'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'ab'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Lieferdatum noch nicht vom Kunden gewählt'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Bestellen'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Bestellung an Dejala gesandt'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(zzgl. MwSt.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Kostenlos!'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(zzgl. MwSt.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Kostenlos!'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Shop-Besitzer'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Name:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Vorname:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Telefon:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'mobil:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Kontakt Lagerkontrolle'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Kontakt Verwaltung'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Konakt Webseitenwartung'; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Ihr Guthaben'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Ihr virtuelles Guthaben (zu Testzwecken)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'Euro'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Stocken Sie Ihr Konto auf'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Liste der letzten Lieferungen'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = 'Nr.'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Erstellung'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'Bestell-ID'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'Tracking_Nummer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Label'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Preis'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'von'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'an'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'CSV-Export'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'Von'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'An'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'OK'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Erstell_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'Bestell-ID'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'Tracking_Nummer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'short_label'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Preis'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Versand_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Zeitlimit'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Versand_start'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'Versand-ende'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Versand_datum'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Versand_Zeit'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Lieferpräferenzen'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Versand vorschlagen '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'sofort'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'einen halben Tag'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'einen Tag'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'Tage'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'nach Bestellung'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Anzeige'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'Termine'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'Tage in der Benutzerroberfläche für die Zeitspanne'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Dejala aktiv halten, wenn Warenkorb nicht auf Lager'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Ermöglicht Kunden Dejala zu wählen, auch wenn ein Produkt nicht auf Lager ist (Der Kunde wählt den Liefertermin, wenn die Bestellung zur Verfügung steht)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Versenden Sie Ihre Bestellungen per Kurier mit'; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Neu auf Dejala.fr?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Ihr Shop-Name:'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Wählen Sie Ihr Land:'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankreich'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Spanien'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Wählen Sie Ihr Login:'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Wählen Sie Ihr Kennwort:'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrieren'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ich habe bereits ein Konto für meinen Shop:'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Anmeldung:'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Kennwort:'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Log-in'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'Dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Zur Erinnerung:'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Der Name Ihres Shops ist'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Ihr Login ist'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Sie sind auf der'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'Testplattform'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'Betriebsplattform'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Zum Test-Modus wechseln '; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Zum Betriebsmodus wechseln '; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Ihre Bitte um Echtzeitbetrieb wird bearbeitet: Dejala.fr wird Sie kontaktieren, um Ihre Registrierung abzuschließen.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Echtzeitbetrieb: bitten Sie Dejala um Erstellung Ihres Betriebskontos'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Ihr Guthaben'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Ihr virtuelles Guthaben (zu Testzwecken)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'Euro'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Stocken Sie Ihr Konto auf'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala IST FÜR KEINEN Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala IST FÜR ALLE Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala IST NUR für folgende Nutzer sichtbar'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Z.B.: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Aktualisieren Sie die Sichtbarkeit von Dejala '; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Bitte geben Sie die Adresse Ihres Lagers an'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(Readonly)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Suchen'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Postleitzahl'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Stadt'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefon'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'mobil'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Ort'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Kontakte'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Prozesse'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Lieferoptionen'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Preise'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Abrechnung'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Technische Optionen'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Lager ist geöffnet'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'Von'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'Bis'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Bitte geben Sie die Prozesse für eine ordnungsgemäße Handhabung der Lieferung an'; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'Sie können die Standardprozesse frei an Ihre Geschäftsprozesse anpassen'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Falsche Adresse'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Empfänger abwesend'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Lieferung abgelehnt'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Liefer-Verpackung'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Bitte stellen Sie Ihre Liefermarge ein '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Kaufpreis'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Marge inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Kundenpreis'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Kaufen zzgl. MwSt. '; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Kaufen inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Verkaufen zzgl. MwSt. '; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Verkaufen inkl. MwSt.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Triggerstatusliste'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Liste der Status, die dejala.fr triggern'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren '; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Wählen Sie Ihren Liefertag'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Wählen Sie Ihre Lieferzeitspanne'; diff --git a/modules/dejala/dejala.php b/modules/dejala/dejala.php new file mode 100644 index 000000000..5f6ecc579 --- /dev/null +++ b/modules/dejala/dejala.php @@ -0,0 +1,1320 @@ +limited_countries = array('fr'); + $this->name = 'dejala'; + $this->tab = 'shipping_logistics'; + $this->version = 1.4; + $this->internal_version = '1.3'; + $this->id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)(Configuration::get('PS_LANG_DEFAULT')) : (int)($cookie->id_lang); + $this->wday_labels = array($this->l('Sunday'), $this->l('Monday'), $this->l('Tuesday'), $this->l('Wednesday'), $this->l('Thursday'), $this->l('Friday'), $this->l('Saturday')); + + parent::__construct(); + + // The parent construct is required for translations + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Dejala.com : Courier delivery'); + $this->description = $this->l('Lets Dejala.com handle your deliveries by courier'); + + // load configuration only if installed + if ($this->id) + { + if (true !== extension_loaded('curl')) { + $this->warning = $this->l('The Dejala module requires php extension cURL to function properly. Please install the php extension "cURL"'); + } + + $this->dejalaConfig = new DejalaConfig(); + $this->dejalaConfig->loadConfig(); + + // Update table schema + if (!isset($this->dejalaConfig->internal_version) || $this->dejalaConfig->internal_version < $this->internal_version) { + $this->unregisterHook('cart') ; + $res = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'dejala_cart` LIMIT 1') ; + if ($res) { + if (!array_key_exists('cart_date_upd', $res[0])) { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'dejala_cart` ADD COLUMN cart_date_upd DATETIME DEFAULT 0;'); + } + if (!array_key_exists('delivery_price', $res[0])) { + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'dejala_cart` ADD COLUMN delivery_price FLOAT DEFAULT NULL;'); + } + } + $this->dejalaConfig->internal_version = $this->internal_version ; + $this->dejalaConfig->saveConfig() ; + } + } + } + + + /** + * install dejala module + */ + public function install() + { + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) { + return (false); + } + elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) { + return (false); + } + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/",$sql); + foreach ($sql as $query) { + if (!empty($query)) { + if (!Db::getInstance()->Execute(trim($query))) + return (false); + } + } + + if (parent::install() == false + OR $this->registerHook('updateOrderStatus') == false + OR $this->registerHook('extraCarrier') == false + OR $this->registerHook('processCarrier') == false) { + return (false); + } + + $this->dejalaConfig = new DejalaConfig(); + if (!$this->dejalaConfig->saveConfig()) { + return (false); + } + DejalaCarrierUtils::createDejalaCarrier($this->dejalaConfig) ; + return (true); + } + + public function uninstall() + { + + // If Dejala is default carrier, try to set another one as default + $djlCarrier = DejalaCarrierUtils::getCarrierByName($this->name) ; + if (Configuration::get('PS_CARRIER_DEFAULT') == (int)($djlCarrier->id)) + { + $carriers = Carrier::getCarriers($cookie->id_lang, true, false, false, NULL, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); + foreach($carriers as $carrier) { + if ($carrier['active'] AND !$carrier['deleted'] AND ($carrier['external_module_name'] != $this->name)) { + Configuration::updateValue('PS_CARRIER_DEFAULT', $carrier['id_carrier']); + break ; + } + } + } + $djlCarrier->deleted = 1; + if (!$djlCarrier->update()) return false; + + $this->dejalaConfig->uninstall(); + if (!parent::uninstall() OR + !$this->unregisterHook('updateOrderStatus') OR + !$this->unregisterHook('extraCarrier') OR + !$this->unregisterHook('processCarrier')) { + return false; + } + + return true; + } + + + /** + * Data validation for module configuration + **/ + public function _postValidation() + { + $errors = array(); + + $method = Tools::getValue('method'); + if ($method == 'signin') { + if (empty($_POST['login'])) + $errors[] = $this->l('login is required.'); + if (empty($_POST['password'])) + $errors[] = $this->l('password is required.'); + if (empty($_POST['country'])) + $errors[] = $this->l('country is required.'); + } + else if ($method == 'register') + { + if (empty($_POST['login'])) + $errors[] = $this->l('login is required.'); + if (empty($_POST['login']) OR !Validate::isEmail($_POST['login'])) + $errors[] = $this->l('login must be a valid e-mail address.'); + if (empty($_POST['password'])) + $errors[] = $this->l('password is required.'); + if (empty($_POST['store_name'])) + $errors[] = $this->l('Shop name is required.'); + if (empty($_POST['country'])) + $errors[] = $this->l('country is required.'); + } + else if ($method == 'products') { + $products = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreProducts($this->dejalaConfig, $products); + if ('200' != $responseArray['status']) + $products = array(); + foreach ($_POST as $key=>$value) + { + if (0 === strpos($key, 'margin_')) + { + $this->mylog( "key=" . substr($key, 7) ); + $productID = (int)(substr($key, 7)); + if ( is_null($_POST[$key]) || (0 == strlen($_POST[$key])) ) + $_POST[$key] = 0; + $_POST[$key] = str_replace(',', '.', $_POST[$key]); + $_POST[$key] = str_replace(' ', '', $_POST[$key]); + + if (!Validate::isFloat($_POST[$key])) + { + $errors[] = $value . ' ' . $this->l('is not a valid margin.'); + } + $margin = (float)($_POST[$key]); + foreach ($products as $l_product){ + if ($l_product['id'] == $productID) + { + $product = $l_product; + break; + } + } + if ($product) { + $vat_factor = (1+ ($product['vat'] / 100)); + $public_price = round($product['price']*$vat_factor, 2); + $public_price = round($public_price + $margin, 2); + if ($public_price < 0) { + $errors[] = $value . ' ' . $this->l('is not a valid margin.'); + } + } + } + } + } + return ($errors); + } + + /** + * Module configuration request processing + **/ + public function _postProcess() + { + global $smarty; + + $errors = array(); + $method = Tools::getValue('method'); + if ($method == 'signin') + { + $djlUtil = new DejalaUtils(); + $this->dejalaConfig->mode = 'TEST'; + $this->dejalaConfig->login = Tools::getValue('login'); + $this->dejalaConfig->password = Tools::getValue('password'); + $this->dejalaConfig->country = Tools::getValue('country'); + $this->dejalaConfig->serviceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->serviceURL); + $this->dejalaConfig->sandboxServiceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->sandboxServiceURL); + $storeAttr = array(); + $response = $djlUtil->ping($this->dejalaConfig, 'TEST'); + if ($response['status'] == 200) + { + $this->dejalaConfig->saveConfig(); + } + else { + if ($response['status'] == 401) { + $errors[] = $this->l('An error occurred while authenticating your account on Dejala.com. Your credentials were not recognized.'); + } + else { + $errors[] = $this->l('Unable to process the action.') . '(' . $response['status'] . ')'; + } + $this->dejalaConfig->login = null; + $this->dejalaConfig->password = null; + } + } + else if ($method == 'register') + { + $djlUtil = new DejalaUtils(); + $this->dejalaConfig->mode = 'TEST'; + $this->dejalaConfig->login = Tools::getValue('login'); + $this->dejalaConfig->password = Tools::getValue('password'); + $this->dejalaConfig->country = Tools::getValue('country'); + $this->dejalaConfig->serviceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->serviceURL); + $this->dejalaConfig->sandboxServiceURL = str_replace('.fr', '.'.$this->dejalaConfig->country, $this->dejalaConfig->sandboxServiceURL); + $this->dejalaConfig->storeUrl = Dejala::getHttpHost(true, true) ; + $response = $djlUtil->createInstantStore($this->dejalaConfig, Tools::getValue('store_name')); + if ($response['status'] == 201) + { + $this->dejalaConfig->saveConfig(); + } + elseif ($response['status'] == 409) + { + $errors[] = $this->l('Please choose another login'); + } + elseif ($response['status'] == 403) + { + $errors[] = $this->l('Dejala Server cannot be reached by your Prestashop server. This is most likely due to a limit set by your hosting provider. Please contact their technical support and ask if your server is authorized to initiate outbound HTTP connections.'); + } + else { + $errors[] = $this->l('Unable to process the action.') . '(' . $response['status'] . ')'; + } + $this->dejalaConfig->loadConfig(); + } + else if ($method == 'location') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreLocation($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating location'); + } + else if ($method == 'contact') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreContacts($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating contacts'); + } + else if ($method == 'processes') + { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreProcesses($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating processes'); + } + else if ($method == 'products') { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreProducts($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + } + else if ($method == 'technical_options') { + $maxSatuses = $_POST['status_max']; + if ($maxSatuses > 30) + $maxSatuses = 30; + $selectedTriggers=array(); + for ($i = 0; $i < $maxSatuses; $i++) { + $l_val = Tools::getValue('status_'.$i); + if ($l_val) { + $selectedTriggers[] = $l_val; + } + } + $trigerringStatuses = implode(',', $selectedTriggers); + $this->dejalaConfig->trigerringStatuses = htmlentities($trigerringStatuses, ENT_COMPAT, 'UTF-8'); + $this->dejalaConfig->saveConfig(); + $this->dejalaConfig->loadConfig(); + } + else if ($method == 'delivery_options') { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->setStoreCalendar($this->dejalaConfig, $_POST); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + + $m_attributes['nb_days_displayed'] = htmlentities(Tools::getValue('nb_days'), ENT_COMPAT, 'UTF-8'); + $m_attributes['delivery_delay'] = htmlentities(Tools::getValue('delivery_delay'), ENT_COMPAT, 'UTF-8'); + $m_attributes['delivery_partial'] = htmlentities(Tools::getValue('delivery_partial'), ENT_COMPAT, 'UTF-8'); + + $response = $djlUtil->setStoreAttributes($this->dejalaConfig, $m_attributes); + if ($response['status'] != 200) + $errors[] = $this->l('An error occurred while updating products'); + + } else if ($method == 'golive') { + $djlUtil = new DejalaUtils(); + $response = $djlUtil->goLive($this->dejalaConfig, $_POST); + } else if ($method == 'switchMode') { + $l_mode = Tools::getValue('mode'); + if ( ('PROD' == $l_mode) || ('TEST' == $l_mode) ) { + $this->dejalaConfig->mode = $l_mode; + $this->dejalaConfig->saveConfig(); + } + } else if ($method == 'switchActive') { + + $l_active = Tools::getValue('visibility_status'); + + if (($l_active == "visible") || ($l_active == "invisible")) { + $this->dejalaConfig->visibility_status = $l_active; + $this->dejalaConfig->saveConfig(); + } + if ($l_active == "visible_limited") { + $l_active_list = Tools::getValue('visible_users_list'); + if ($l_active_list == "") { + $this->dejalaConfig->visible_users_list = ""; + $this->dejalaConfig->saveConfig(); + + $errors[] = $this->l('You must provide at least one email address to restrict Dejala\'s visibility.'); + } + else { + $this->dejalaConfig->visibility_status = $l_active; + $this->dejalaConfig->visible_users_list = $l_active_list; + $this->dejalaConfig->saveConfig(); + } + } + } + else { + $errors[] = $this->l('Unable to process the action.'); + } + return ($errors); + } + + public function getContent() + { + global $smarty; + + $smarty->assign('country', $this->dejalaConfig->country); + $output = $this->display(__FILE__, 'dejala_header.tpl'); + if (!empty($_POST)) + { + $errors = $this->_postValidation(); + if (!count($errors)) + $errors = $this->_postProcess(); + if (count($errors)) + foreach ($errors AS $err) + $output .= '
        '. $err .'
        '; + else + { + $method = Tools::getValue('method'); + $output .= '
        + + '.$this->l('Settings updated').(($method == 'signin' OR $method == 'register' OR $method == 'golive') ? '' : '').' +
        '; + } + } + $output = $output . $this->displayForm(); + return ($output); + } + + + public function displayForm() + { + global $smarty, $cookie; + + $errors = array(); + $outputMain = ''; + $smarty->assign("djl_mode", $this->dejalaConfig->mode); + $smarty->assign("disabled", ''); + if ($this->dejalaConfig->mode == 'PROD') + $smarty->assign("disabled", 'disabled="disabled"'); + if (true !== extension_loaded('curl')) { + $errors[] = $this->l('This module requires php extension cURL to function properly. Please install the php extension "cURL" first.'); + $smarty->assign("disabled", 'disabled="disabled"'); + } + + $registered = TRUE; + if ((0 == strlen($this->dejalaConfig->login)) || (0 == strlen($this->dejalaConfig->password))) { + $registered= FALSE; + } + if ($registered) { + $djlUtil = new DejalaUtils(); + $responsePing = $djlUtil->ping($this->dejalaConfig, $this->dejalaConfig->mode); + if (200 != $responsePing['status']) { + if (401 == $responsePing['status']) + $errors[] = $this->l('An error occurred while authenticating your account on Dejala.com. Your credentials were not recognized.'); + else + $errors[] = $this->l('An error occurred while authenticating your account on Dejala.com. This may be due to a temporary network or platform problem. Please try again later or contact Dejala.com'); + unset($_GET['cat']); + $registered= FALSE; + } + } + + $smarty->assign("registered", $registered?"1":"0"); + + + if (!isset($_GET['cat']) || ($_GET['cat']==='home') || ($_GET['cat']==='')) + $currentTab="home"; + else + $currentTab=$_GET['cat']; + $smarty->assign("currentTab", $currentTab); + $smarty->assign("moduleConfigURL", 'index.php?tab=AdminModules&configure=dejala&token='.$_GET['token']); + $smarty->assign("formAction", $_SERVER['REQUEST_URI']); + $outputMenu = $this->display(__FILE__, 'dejala_menu.tpl'); + + if ($currentTab==='home') { + $smarty->assign("login", html_entity_decode(Configuration::get('PS_SHOP_EMAIL'), ENT_COMPAT, 'UTF-8')); + if ($registered) + { + $smarty->assign("visibility_status", $this->dejalaConfig->visibility_status); + $smarty->assign("visible_users_list", $this->dejalaConfig->visible_users_list); + $smarty->assign("store_login", html_entity_decode($this->dejalaConfig->login, ENT_COMPAT, 'UTF-8')); + $smartifyErrors = $this->smartyfyStoreAttributes(); + if (isset($smartifyErrors) && count($smartifyErrors)) + $errors = $smartifyErrors; + } + else + { + $shopName = Configuration::get('PS_SHOP_NAME'); + if (strlen($shopName) >= 15) + $shopName = substr($shopName, 0, 15); + $smarty->assign("store_name", html_entity_decode($shopName, ENT_COMPAT, 'UTF-8')); + } + $outputMain = $this->display(__FILE__, 'dejala_home.tpl'); + } + else if ($currentTab==='contacts') { + $contacts = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreContacts($this->dejalaConfig, $contacts); + if ('200' == $responseArray['status']) + { + foreach ($contacts as $contactName=>$contactData) { + foreach ($contactData as $key=>$value) { + $smarty->assign($contactName.'_'.$key, $value); + } + } + } + $outputMain = $this->display(__FILE__, 'dejala_contacts.tpl'); + } + else if ($currentTab==='location') + { + $location = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreLocation($this->dejalaConfig, $location); + if ('200' == $responseArray['status']) + { + foreach ($location as $key=>$value) { + $smarty->assign($key, $value); + } + $outputMain = $this->display(__FILE__, 'dejala_location.tpl'); + } + } + else if ($currentTab==='processes') + { + $processes = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreProcesses($this->dejalaConfig, $processes); + if ('200' == $responseArray['status']) + { + foreach ($processes as $key=>$value) { + $smarty->assign($key, $value); + } + $outputMain = $this->display(__FILE__, 'dejala_processes.tpl'); + } + } + else if ($currentTab==='prices') { + $products = array(); + $djlUtil = new DejalaUtils(); + $responseArray = $djlUtil->getStoreProducts($this->dejalaConfig, $products); + if ('200' == $responseArray['status']) + { + //price = price_HT*(inv_vat) + foreach ($products as &$product) { + $vat_factor = (1+ ($product['vat'] / 100)); + $product['price_notax'] = number_format($product['price'], 2, '.', ''); + $product['price'] = number_format(round($product['price']*$vat_factor, 2), 2, '.', ''); + $product['public_price'] = number_format(round($product['price'] + $product['margin'], 2), 2, '.', ''); + $product['public_price_notax'] = number_format(round($product['public_price']/$vat_factor, 2), 2, '.', ''); + } + $smarty->assign('products', $products); + $outputMain = $this->display(__FILE__, 'dejala_products.tpl'); + } + } + else if ($currentTab==='accounting') { + $smartifyErrors = $this->smartyfyStoreAttributes(); + if (isset($smartifyErrors) && count($smartifyErrors)) + $errors = $smartifyErrors; + + $djlUtil = new DejalaUtils(); + $deliveries = array(); + $responseArray = $djlUtil->getStoreDeliveries($this->dejalaConfig, $deliveries); + if ('200'==$responseArray['status']) + { + foreach ($deliveries as &$delivery) { + $delivery['creation_date'] = date('d/m/Y', $delivery['creation_utc']); + $delivery['creation_time'] = date('H\hi', $delivery['creation_utc']); + if (isset($delivery['shipping_start_utc'])) { + $delivery['shipping_date'] = date('d/m/Y', $delivery['shipping_start_utc']); + $delivery['shipping_start'] = date('H\hi', $delivery['shipping_start_utc']); + $delivery['shipping_stop'] = date('H\hi', (int)($delivery['shipping_start_utc']) + 3600*(int)($delivery['timelimit']) ); + } + else { + $delivery['shipping_date'] = ''; + $delivery['shipping_start'] = ''; + $delivery['shipping_stop'] = ''; + } + + if (isset($delivery['delivery_utc'])) + { + $delivery['delivery_date'] = date('d/m/Y', $delivery['delivery_utc']); + $delivery['delivery_time'] = date('H\hi', $delivery['delivery_utc']); + } + } + $smarty->assign('formAction', __PS_BASE_URI__ . 'modules/' . $this->name . '/deliveries_csv.php'); + $smarty->assign('defaultDateFrom', date('01/m/Y')); + $smarty->assign('defaultDateTo', date('d/m/Y')); + $smarty->assign('deliveries', $deliveries); + $outputMain = $this->display(__FILE__, 'dejala_deliveries.tpl'); + } + } + else if ($currentTab==='delivery_options') { + $outputMain = $this->displayDeliveryOptions(); + } + else if ($_GET['cat']==='technical_options') { + $states = $this->getOrderStates(); + $triggers = explode(',', $this->dejalaConfig->trigerringStatuses); + $orderStatuses = array(); + foreach ($states as $status){ + $m_status['id'] = $status['id_order_state']; + $m_status['label'] = $status['name']; + if (in_array($status['id_order_state'], $triggers)) + $m_status['checked'] = '1'; + else + $m_status['checked'] = '0'; + $orderStatuses[] = $m_status; + } + $smarty->assign('statuses', $orderStatuses); + + $smarty->assign('trigerringStatuses', $this->dejalaConfig->trigerringStatuses); + $outputMain = $this->display(__FILE__, 'dejala_technical_options.tpl'); + } + + $outputErr = ''; + if (count($errors)) + foreach ($errors AS $err) + $outputErr .= '
        '. $err .'
        '; + + $output = $outputErr; + $output = $output . $outputMenu; + $output = $output . $outputMain; + $output = $output . $this->display(__FILE__, 'dejala_footer.tpl'); + return $output; + } + + + // put in smarty context store attributes + function smartyfyStoreAttributes() + { + global $smarty; + + $errors = array(); + $djlUtil = new DejalaUtils(); + $storeAttrs = array(); + $response = $djlUtil->getStoreAttributes($this->dejalaConfig, $storeAttrs); + if (200 != $response['status']) + $errors[] = $this->l('An error occurred while getting store, please try again later or contact Dejala.com'); + else + { + $smarty->assign("account_balance", $storeAttrs['account_balance']); + $smarty->assign("store_name", $storeAttrs['name']); + + // Check if account exists in production + $responsePing = $djlUtil->ping($this->dejalaConfig, 'PROD'); + if ('200' == $responsePing['status']) + $smarty->assign('isLiveReady', '1'); + else + { + $smarty->assign('isLiveReady', '0'); + if (isset($storeAttrs['attributes']) && isset($storeAttrs['attributes']['request_live']) && ($storeAttrs['attributes']['request_live']=='true')) + $smarty->assign('isLiveRequested', '1'); + else + $smarty->assign('isLiveRequested', '0'); + } + } + return ($errors); + } + + + function getOrderStates(){ + global $cookie; + + $states = OrderState::getOrderStates($this->id_lang); + return ($states); + } + + function displayDeliveryOptions(){ + global $smarty; + + /* + Au moment du choix du créneau + Pour déterminer le créneau de départ proposé : + - Aller sur le prochain créneau libre + - Ajouter le délai de traitement de la commande + - Aller sur le prochain créneau libre + + - Le marchand configure l ouverture de sa boutique en weedkay (hStart-hStop) + exception (date fermeture) tous produits confondus + On fait le min au moment de l afichage des creneaux dispo + => trouver une slideBar avec deux curseurs + */ + $output = ''; + $djlUtil = new DejalaUtils(); + $response = $djlUtil->getStoreAttributes($this->dejalaConfig, $store); + if ($response['status'] == 200) { + $smarty->assign('nb_days', $store['attributes']['nb_days_displayed']); + $smarty->assign('delivery_delay', $store['attributes']['delivery_delay']); + if (isset($store['attributes']['delivery_partial'])) + $smarty->assign('delivery_partial', $store['attributes']['delivery_partial']); + } + + $wday_selected = array(1, 1, 1, 1, 1, 1, 1); + + $smarty->assign('timetable_css', _MODULE_DIR_.$this->name.'/timetable.css'); + $smarty->assign("timetable_js", _MODULE_DIR_.$this->name.'/timetable.js'); + $smarty->assign("weekdayLabels", $this->wday_labels); + $smarty->assign("weekdaySelected", $wday_selected); + + + $calendar = array(); + $response = $djlUtil->getStoreCalendar($this->dejalaConfig, $calendar); + if ($response['status'] == 200) { + $smarty->assign("calendar", $calendar); + $smarty->assign("timetableTpl", dirname(__FILE__)."/dejala_picking_timetable.tpl"); + } + $output = $output . $this->display(__FILE__, 'dejala_delivery_options.tpl'); + + return ($output); + } + + /** + * Retourne FALSE si un des produits du cart n'est pas en stock, retourne FALSE sinon + **/ + function isCartOutOfStock($cart) { + $products = $cart->getProducts(); + foreach ($products as $product) + { + $this->mylog('product:'); + $this->mylog($this->logValue($product, 1)); + + $orderedQuantity = (_PS_VERSION_ < "1.3.0.1" ? (int)($product['quantity']) : (int)($product['cart_quantity'])); + $productQuantity = (int)($product['stock_quantity']); + if ( ($productQuantity < $orderedQuantity) || ($productQuantity <= 0) ) + return (TRUE); + } + return (FALSE); + } + + + /** + ** Affiche le transporteur Dejala.com dans la liste des transporteurs sur le Front Office + */ + public function hookExtraCarrier($params) { + global $smarty, $defaultCountry; + + $cart = $params['cart']; + $cookie = $params['cookie']; + + $this->hooklog("ExtraCarrier", $params); + + // Check if Dejala should be visible + if ($this->dejalaConfig->visibility_status == "invisible") { + return ; + } + if (($this->dejalaConfig->visibility_status == "visible_limited") && ((int)($cookie->id_customer) > 0)) { + $customer = new Customer((int)($cookie->id_customer)); + if (!in_array($customer->email, preg_split("/[\s,]+/", $this->dejalaConfig->visible_users_list))) { + return ; + } + } + + $djlUtil = new DejalaUtils(); + $responseGetStore = $djlUtil->getStoreAttributes($this->dejalaConfig, $store); + if ($responseGetStore['status']!='200') + return ; + + $isCartOutOfStock = '0'; + if ($this->isCartOutOfStock($cart)) + $isCartOutOfStock = '1'; + $this->mylog('isCartOutOfStock=' . $isCartOutOfStock . ''); + + $acceptPartial = true; + if (!isset($store['attributes']) || !isset($store['attributes']['delivery_partial']) || ($store['attributes']['delivery_partial'] != '1')) + $acceptPartial = false; + if ( ($isCartOutOfStock == '1') && !$acceptPartial) { + return ; + } + + $electedProduct = $this->getDejalaProduct($cart) ; + // Get id zone + if (isset($cart->id_address_delivery) AND $cart->id_address_delivery) + $id_zone = Address::getZoneById((int)($cart->id_address_delivery)); + else + $id_zone = (int)($defaultCountry->id_zone); + + $djlCarrier = DejalaCarrierUtils::getCarrierByName($this->name) ; + + $this->mylog("electedCarrier=" . $this->logValue($djlCarrier,1)); + + if ($djlCarrier == null) { + return null ; + } + + // Calcul des dates dispo + $productCalendar = $electedProduct['calendar']['entries']; + // MFR090831 - add picking time : the store is open to (stop_hour - picking time), it is more natural to merchants to set opening hours instead of dejala delivery time + if ($electedProduct['pickingtime']) + $pickingtime = (int)($electedProduct['pickingtime']); + else + $pickingtime = $electedProduct['timelimit']; + $djlUtil = new DejalaUtils(); + $storeCalendar = array(); + $calendar = array(); + $response = $djlUtil->getStoreCalendar($this->dejalaConfig, $storeCalendar); + $this->mylog("productCalendar=" . $this->logValue($productCalendar,1)); + $this->mylog("storeCalendar=" . $this->logValue($storeCalendar,1)); + $this->mylog("response['status']=" . $response['status']); + if ($response['status'] == 200) { + foreach ($storeCalendar['entries'] as $weekday=>$calEntry) { + if (isset($productCalendar[$weekday])) { + $calendar[$weekday]["weekday"] = $weekday; + $calendar[$weekday]["start_hour"] = max((int)($productCalendar[$weekday]["start_hour"]), (int)($calEntry["start_hour"])); + // MFR090831 - manage picking time : the store is open to (stop_hour - picking time) + $calendar[$weekday]["stop_hour"] = min((int)($productCalendar[$weekday]["stop_hour"]-1), (int)($calEntry["stop_hour"] - $pickingtime)); + if ($calendar[$weekday]["stop_hour"] < $calendar[$weekday]["start_hour"]) { + unset($calendar[$weekday]); + } + } + } + } + + // Calcul de la date de démarrage pour les créneaux : + // Avancement jusque jour dispo & ouvert + // Ajout du temps de préparation : 0.5 jour ou 1 nb de jours + // Ajustement de l'heure sur l'ouverture ou l'heure suivante xxh00 + $deliveryDelay = $store['attributes']['delivery_delay']; + $skipCurDay = false ; + $calUtils = new CalendarUtils(); + $all_exceptions = array_merge($storeCalendar['exceptions'], $electedProduct['calendar']['exceptions']); + $dateUtc = $calUtils->getNextDateAvailable(time(), $calendar, $all_exceptions); +// echo "First date : " . $dateUtc . " " . date("d/m/Y - H:i:s", $dateUtc) . "
        " ; + if ($dateUtc == NULL) + return ; + if ($deliveryDelay > 0) { + if ($skipCurDay) { + $dateUtc = $calUtils->skipCurDay($dateUtc); + } + $dateUtc = $calUtils->addDelay($dateUtc, $deliveryDelay, $calendar, $all_exceptions); + } +// echo "After delay : " . date("d/m/Y - H:i:s", $dateUtc) . "
        " ; + if ($dateUtc == NULL) + return ; + $dateUtc = $calUtils->adjustHour($dateUtc, $calendar); + $this->mylog("calendar=" . $this->logValue($calendar,1)); + $this->mylog("starting date=" . $this->logValue(date("d/m/Y - H:i:s", $dateUtc),1)); + /** + Dates[0] = { + [label]=lundi + [value]=23/04/2009 + [start_hour]=9 + [stop_hour]=17 + } + **/ + $today = getDate(); + $ctime = time(); + $nbDeliveryDates = $deliveryDelay = $store['attributes']['nb_days_displayed']; + $iDate = 0; + $dates = array(); + $balladUtc = $dateUtc; + + do { + $wd = date("w", $balladUtc); + if ((int)($calendar[$wd]['stop_hour']) < (int)($calendar[$wd]['start_hour'])) continue ; +// echo "Adding : " . date("d/m/Y - H:i:s", $balladUtc) . "
        " ; + $dates[$iDate]['value'] = date("Y/m/d", $balladUtc); + $dates[$iDate]['ts'] = $balladUtc ; + $dates[$iDate]['label'] = $this->wday_labels[$wd] . " " . date("j", $balladUtc); + $dates[$iDate]['start_hour'] = (int)($calendar[$wd]['start_hour']); + $dates[$iDate]['stop_hour'] = (int)($calendar[$wd]['stop_hour']); + $balladUtc = strtotime(date("Y-m-d", $balladUtc) . " +1 day"); + $balladUtc = mktime(0, 0, 0, date('m', $balladUtc), date('d', $balladUtc), date('Y', $balladUtc)); + $balladUtc = $calUtils->getNextDateAvailable($balladUtc, $calendar, $all_exceptions); + $iDate++; + } while (($iDate < $nbDeliveryDates) && ($balladUtc)); + // impossibilité de trouver un jour dispo + if (!isset($dates[0])) + return ; + + $now = (int)(date("H", $ctime)) ; + if ((int)($dates[0]['stop_hour']) > $now && (int)($dates[0]['start_hour']) < $now) { + $dates[0]['start_hour'] = $now ; + } + elseif ((int)($dates[0]['ts']) == $now && (int)($dates[0]['stop_hour']) < $now) { + array_shift($dates) ; + } + + $this->mylog("date$=" . $this->logValue($dates,1)); + $smarty->assign('nb_days', $nbDeliveryDates); + $smarty->assign('dates', $dates); + for ($i=0; $i < 24; $i++) { + $endHour = (($i+$electedProduct['timelimit'])%24); + if ($endHour == 0) + $endHour = 24; + $hourLabels[] = $i . 'h-' . $endHour . 'h'; + } + $smarty->assign('hourLabels', $hourLabels); + + $smarty->assign('timetable_css', _MODULE_DIR_.$this->name.'/timetable.css'); + $smarty->assign("timetable_js", _MODULE_DIR_.$this->name.'/timetable.js'); + + $this->mylog("electedCarrier->id=" . $this->logValue($djlCarrier->id)); + $mCarrier = $djlCarrier; + $row['id_carrier'] = (int)($djlCarrier->id); + $row['name'] = $this->l('Dejala.com'); + $row['delay'] = $this->l('When you want... Dispatch rider') . ', ' . $electedProduct['timelimit'].'H' ; + $row['price'] = $cart->getOrderShippingCost($djlCarrier->id); + $row['price_tax_exc'] = $cart->getOrderShippingCost($djlCarrier->id, false); + $row['img'] = _MODULE_DIR_.$this->name.'/dejala_carrier.gif'; + + $resultsArray[] = $row; + + $smarty->assign('carriers', $resultsArray); + $smarty->assign('my_carrier_selected', (isset($cart->id_carrier) && $cart->id_carrier == $djlCarrier->id)) ; + $smarty->assign('product', $electedProduct); + + + $djlCart = new DejalaCart($cart->id); + $setDefaultDate = TRUE; + if ($djlCart && isset($djlCart->shipping_date) && !empty($djlCart->shipping_date)) + { + $mShippingDate = $djlCart->shipping_date; + $this->mylog("shipping_date=" . $this->logValue($mShippingDate)); + $m_day = date("d", $mShippingDate); + $m_hour = date("H", $mShippingDate); + $deliveryDateSelected = date("Y/m/d", $mShippingDate); + $this->mylog("shipping_date=" . $this->logValue($deliveryDateSelected)); + foreach ($dates as $l_key=>$l_date) { + if ($l_date['value'] == $deliveryDateSelected) { + $smarty->assign("deliveryDateIndexSelected", $l_key); + $smarty->assign("deliveryDateSelected", $deliveryDateSelected); + $smarty->assign("deliveryHourSelected", $m_hour); + $setDefaultDate = FALSE; + } + } + } + if ($setDefaultDate) { + $smarty->assign("deliveryDateIndexSelected", 0); + $smarty->assign("deliveryDateSelected", date("Y/m/d", $dateUtc)); + $smarty->assign("deliveryHourSelected", (int)(date("H", $dateUtc))); + } + + $smarty->assign("isCartOutOfStock", $isCartOutOfStock); + if (!$isCartOutOfStock) { + $buffer = $this->display(__FILE__, 'dejala_carrier.tpl'); + $buffer = $buffer . $this->display(__FILE__, 'dejala_timetable.tpl'); + } + else + { + $smarty->assign('nostock_info', $this->l('I will select my shipping date when my product is available.')); + $buffer = $this->display(__FILE__, 'dejala_carrier_nostock.tpl'); + } + return $buffer; + + } + + public function displayInfoByCart($id_cart) + { + $this->hooklog("displayInfoByCart", $id_cart); + $this->myLog("POST=" . $this->logValue($_POST)); + + $this->myLog('dejala_action=' . Tools::getValue('dejala_action') ); + if (Tools::getValue('dejala_action')=='order') { + $this->myLog('inside - id_cart=' . $id_cart); + $mOrderId = Order::getOrderByCartId($id_cart); + $mOrder = new Order($mOrderId); + $this->placeOrder($mOrder); + } + $djlCart = new DejalaCart($id_cart); + if ($djlCart && isset($djlCart->id_dejala_product) && isset($djlCart->shipping_date)) + { + $mDejalaProductID = $djlCart->id_dejala_product; + $mShippingDate = $djlCart->shipping_date; + echo '

        '; + if ($djlCart->mode !== 'PROD') { + echo 'MODE : TEST
        '; + } + if (!empty($mShippingDate) && ($mShippingDate != 0)) + { + echo $this->l('Shipping date selected') . ' : ' .date('d/m/Y',$mShippingDate). ', ' . $this->l('starting at') . ' : ' .date('H\hi', $mShippingDate) .'
        '; + } + else + { + echo $this->l('Shipping date not yet selected by the customer') .'
        '; + } + if ( ($djlCart->id_delivery) && Validate::isUnsignedId($djlCart->id_delivery) ) + { + $l_delivery = array(); + $l_delivery['id'] = $djlCart->id_delivery; + $djlUtil = new DejalaUtils(); + $response = $djlUtil->getDelivery($this->dejalaConfig, $l_delivery, $djlCart->mode); + if ($response['status'] == 200) + { + if ($l_delivery && $l_delivery['status'] && $l_delivery['status']['labels'] && $l_delivery['status']['labels'][Language::getIsoById($this->id_lang)]) + echo $this->l('Order') . ' ' . $l_delivery['status']['labels'][Language::getIsoById($this->id_lang)].'
        '; + else + echo $this->l('Order sent to Dejala') . '
        '; + } + } else + { + $_html = ''; + $_html .= '
        '; + $_html .= ''; + $_html .= ''; + $_html .= '

        '; + echo $_html . ''; + } + + echo '

        '; + + } + } + + static public function wtf($var, $arrayOfObjectsToHide=null, $fontSize=11) + { + $text = print_r($var, true); + + if (is_array($arrayOfObjectsToHide)) { + + foreach ($arrayOfObjectsToHide as $objectName) { + + $searchPattern = '#('.$objectName.' Object\n(\s+)\().*?\n\2\)\n#s'; + $replace = "$1--> HIDDEN - courtesy of wtf() <--)"; + $text = preg_replace($searchPattern, $replace, $text); + } + } + + // color code objects + $text = preg_replace('#(\w+)(\s+Object\s+\()#s', '$1$2', $text); + // color code object properties + $text = preg_replace('#\[(\w+)\:(public|private|protected)\]#', '[$1:$2]', $text); + + echo '
        '.$text.'
        '; + } + + public function hookProcessCarrier($params) + { + // FO: Temporary. Necessary to go around the product's cart re-instanciation bug. + global $cart ; + + $cartParams = $params['cart']; + $this->hooklog("processCarrier", $params) ; + // Process the cart for storage in dejala_cart. + $errors = array(); + $dejalaCarrierID = Tools::getValue('dejala_id_carrier'); + $carrierID = Tools::getValue('id_carrier'); + $dejalaProductID = Tools::getValue('dejala_id_product'); + + if ( !empty($dejalaCarrierID) && !empty($carrierID) && ((int)($dejalaCarrierID) == (int)($carrierID)) ) + { + $id_cart = (int)($cartParams->id); + + $product = $this->getDejalaProduct($cartParams, $dejalaProductID) ; + + $timelimit = 10; + if (isset($product['timelimit'])) + $timelimit = (int)($product['timelimit']); + + /* manage shipping preferences */ + $date_shipping = 'NULL'; + if ( isset($_POST['shipping_day']) AND !empty($_POST['shipping_day']) AND (10 <= strlen($_POST['shipping_day'])) ) + { + $shippingHour = (int)($_POST['shipping_hour']); + $shipping_day = $_POST['shipping_day']; + $ship_year = (int)(substr($shipping_day, 0, 4)); + $ship_month = (int)(substr($shipping_day, 5, 2)); + $ship_day = (int)(substr($shipping_day, 8, 2)); + $shippingTime = mktime($shippingHour, 0, 0, $ship_month, $ship_day, $ship_year); + // check that delivery date is in the future (5 min delay) + if ($shippingTime > time() - 5 * 60) + $date_shipping = $shippingTime; + } + + $djlCart = $this->getDejalaCart($cartParams->id) ; + $djlCart->shipping_date = $date_shipping; + $djlCart->id_dejala_product = $dejalaProductID; + $djlCart->id_delivery = NULL; + $djlCart->mode = $this->dejalaConfig->mode; + + // Dirty cheat as the cart updates itself right after this. + // This saves one full round trip to the server. + $djlCart->cart_date_upd = date('Y-m-d H:i:s') ; + $djlCart->save() ; + } + + // FO: VERY DIRTY HACK.... Re-assign the global cart to what it was before. + $cart = $cartParams ; + } + + /** + * Keep as a precaution if a hook is still registered + */ + public function hookCart($param) { + return ; + } + + + /** + * Appelé après la modification d'une commande + **/ + public function hookUpdateOrderStatus($params) + { + $this->hooklog("hookUpdateOrderStatus", $params); + // class OrderState + $newOrderStatus = $params["newOrderStatus"]; + $currentOrderStatusID = $newOrderStatus->id; + $this->mylog("newOrderStatus=" . $this->logValue($newOrderStatus)); + $this->mylog("found currentOrderStatusID=" . $currentOrderStatusID); + + $triggeringStatusList = html_entity_decode(Configuration::get('DJL_TRIGERRING_STATUSES'), ENT_COMPAT, 'UTF-8'); + $this->mylog("triggeringStatusList=" . $triggeringStatusList); + $triggeringStatuses = explode(",", $triggeringStatusList); + $orderID = $params["id_order"]; + if ((NULL !== $orderID) && (TRUE === in_array($currentOrderStatusID, $triggeringStatuses))) + { + $mOrder = new Order($orderID); + $this->placeOrder($mOrder); + } + } + + + public function placeOrder($mOrder) { + $orderID = $mOrder->id; + $this->myLog("placeOrder()"); + $this->myLog("mOrder->id_carrier=".$mOrder->id_carrier); + $mCarrier = new Carrier($mOrder->id_carrier); + $this->myLog("mCarrier->name=".$mCarrier->name); + if ($mCarrier->name != $this->name) + return ; + $this->myLog("placeOrder()"); + + $cartId = $mOrder->id_cart; + $djlCart = $this->getDejalaCart($cartId); + $this->myLog("djlCart->id_delivery=" . $djlCart->id_delivery); + + if (!$djlCart->id_delivery) + { + $this->myLog("id_delivery is not filled"); + $delivery = array(); + $this->getInfoFromOrder($orderID, $delivery); + $this->mylog("Sending delivery=" . $this->logValue($delivery)); + $djlUtil = new DejalaUtils(); + $response = $djlUtil->orderDelivery($this->dejalaConfig, $delivery, $djlCart->mode); + $statusCode = $response['status']; + + $this->mylog("send orderID=" . $orderID); + $this->mylog("sendOrder status_code=" . $statusCode); + $this->mylog("sendOrder response=" . $response['response']); + $this->mylog("sendOrder delivery=" . $this->logValue($delivery, 1)); + // update status after sending... + if ("201" === $statusCode) + { + $this->mylog("updating dejala cart cart_id=" . $cartId); + if (Validate::isUnsignedId($delivery['id'])) { + $this->mylog("updating dejala cart id_delivery=" . $delivery['id']); + $djlCart->id_delivery = $delivery['id']; + $djlCart->update(); + } + if (is_null($mOrder->shipping_number) || (0 === strlen($mOrder->shipping_number))) + { + $this->myLog('setting Order->shipping_number to ' . $delivery['tracking_number']); + $mOrder->shipping_number = $delivery['tracking_number']; + $mOrder->save(); + } + $this->myLog("OK - Order sent to dejala.com"); + } + else + { + // Do nothing : Keep previous status + $this->myLog("NOK - Problem sending Order to dejala.com"); + } + } + } + + public function getInfoFromOrder($orderID, &$delivery) + { + $mOrder = new Order($orderID); + if (NULL !== $mOrder) { + $mDeliveryAddress = new Address($mOrder->id_address_delivery); + if (NULL !== $mDeliveryAddress) + { + // receiver address information + $delivery["receiver_firstname"]=$mDeliveryAddress->firstname; + $delivery["receiver_name"]=$mDeliveryAddress->lastname; + if ($mDeliveryAddress->company) + $delivery["receiver_company"]=$mDeliveryAddress->company; + $delivery["receiver_address"]=$mDeliveryAddress->address1; + if ($mDeliveryAddress->address2) + $delivery["receiver_address2"]=$mDeliveryAddress->address2; + $delivery["receiver_zipcode"]=$mDeliveryAddress->postcode; + $delivery["receiver_city"]=$mDeliveryAddress->city; + if ($mDeliveryAddress->phone_mobile) + $delivery["receiver_cellphone"]=$mDeliveryAddress->phone_mobile; + if ($mDeliveryAddress->phone) + $delivery["receiver_phone"]=$mDeliveryAddress->phone; + if ($mDeliveryAddress->other) + $delivery["receiver_comments"]=$mDeliveryAddress->other; + } + $delivery["packet_reference"]=$mOrder->id; + + + $id_cart = $mOrder->id_cart; + /* set weight */ + $cart = new Cart($id_cart); + $delivery['weight'] = (float)($cart->getTotalWeight()); + + /* set dejalaProductID and sender_availability = shipping date */ + $djlCart = new DejalaCart($id_cart); + if (!is_null($djlCart) && !is_null($djlCart->id)) + { + $mDejalaProductID = $djlCart->id_dejala_product; + $delivery["product_id"] = (int)($mDejalaProductID); + $mShippingDate = $djlCart->shipping_date; + if ( is_null($mShippingDate) || empty($mShippingDate) ) { + $mShippingDate = 0; + } + $delivery["shipping_start_utc"]=$mShippingDate; + } + } + return ($delivery); + } + + + public function getOrderShippingCostExternal($cart) + { + return $this->getOrderShippingCost($cart, 0); + } + + public function getOrderShippingCost($cart, $shipping_cost) { + return $this->getDejalaProductPrice($cart) ; + } + + + private function getDejalaCart($cartId) { + return DejalaCart::getInstance($cartId) ; + } + + private function getDejalaProductPrice($cart) { + $djlCart = $this->getDejalaCart($cart->id) ; + if (isset($djlCart->delivery_price) && $cart->date_upd <= $djlCart->cart_date_upd) { + return $djlCart->delivery_price ; + } + $product = $this->getDejalaProduct($cart) ; + return $product["price"] ; + } + + private function getDejalaProduct($cart, $productId = -1) { + // echo "Date : " . $cart->date_upd . "
        " ; + $djlCart = $this->getDejalaCart($cart->id) ; + + if (isset($djlCart->delivery_price) && $cart->date_upd <= $djlCart->cart_date_upd && isset($djlCart->product)) { + if ($productId >= 0 && $djlCart->product["id"] == $productId) { + return $djlCart->product ; + } + } + + $djlUtil = new DejalaUtils(); + $responseGetStore = $djlUtil->getStoreAttributes($this->dejalaConfig, $store); + if ($responseGetStore['status']!='200') return ; + + $isCartOutOfStock = '0'; + if ($this->isCartOutOfStock($cart)) + $isCartOutOfStock = '1'; + $this->mylog('isCartOutOfStock=' . $isCartOutOfStock . ''); + + $acceptPartial = true; + if (!isset($store['attributes']) || !isset($store['attributes']['delivery_partial']) || ($store['attributes']['delivery_partial'] != '1')) + $acceptPartial = false; + if ( ($isCartOutOfStock == '1') && !$acceptPartial) { + return ; + } + + $address = new Address($cart->id_address_delivery) ; + + // ask dejala.com for a quotation + $quotation["receiver_name"] = $address->lastname; + $quotation["receiver_firstname"] = $address->firstname; + $quotation["receiver_company"] = $address->company; + $quotation["receiver_address"] = $address->address1; + $quotation["receiver_address2"] = $address->address2; + $quotation["receiver_zipcode"] = $address->postcode; + $quotation["receiver_city"] = $address->city; + $quotation["receiver_phone"] = $address->phone; + $quotation["receiver_phone_mobile"] = $address->phone_mobile; + $quotation["receiver_comments"] = $address->other; + $quotation["timelimit"] = 10; + $quotation["weight"] = (float)($cart->getTotalWeight()); + $quotation["price"] = $cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING) ; + $quotation["module_version"] = $this->internal_version ; + $quotation["platform"] = "PS " . _PS_VERSION_ ; + + $this->mylog("asking for quotation=" . $this->logValue($quotation,1)); + + $products = array(); + $responseArray = $djlUtil->getStoreQuotation($this->dejalaConfig, $quotation, $products); + if ($responseArray['status']!='200') + return $shipping_cost; + $this->mylog("found quotation=" . $this->logValue($responseArray['response'],1)); + + $electedProduct = NULL; + foreach ($products as $key=>$product) { + if ( is_null($electedProduct) || ((int)($electedProduct['priority']) > (int)($key)) ) { + $electedProduct = $product; + } + } + if (is_null($electedProduct)) { + return $shipping_cost; + } + + $djlCart->id_dejala_product = $electedProduct["id"]; + $djlCart->id_delivery = NULL; + $djlCart->mode = $this->dejalaConfig->mode; + + $vat_factor = (1+ ($electedProduct['vat'] / 100)); + $priceTTC = round(($electedProduct['price']*$vat_factor) + $electedProduct['margin'], 2); + $priceHT = round($priceTTC/$vat_factor, 2); + + $djlCart->delivery_price = $priceHT ; + $djlCart->cart_date_upd = $cart->date_upd ; + $djlCart->product = $electedProduct ; + + $djlCart->save() ; + + return $electedProduct ; + + } + + public function mylog($msg) { + if ($this->DEJALA_DEBUG) { + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + $myFile = dirname(__FILE__) . "/logFile.txt"; + MyLogUtils::myLog($myFile, $msg); + } + } + + // get a string of a value for Log purposes + public function logValue($mvalue, $lvl=0) { + if (!$this->DEJALA_DEBUG) + return (""); + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + return (MyLogUtils::logValue($mvalue, $lvl)); + } + + + public function hooklog($hookname, $params) { + $this->mylog($hookname); + $this->mylog("\r\nparams" . $this->logValue($params), 1); + } + + // Stolen from PS 1.3 for backwards compatibility in PS 1.2.5 + static public function getHttpHost($http = false, $entities = false) + { + $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); + if ($entities) + $host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8'); + if ($http) + $host = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$host; + return $host; + } +} + diff --git a/modules/dejala/dejala_carrier.gif b/modules/dejala/dejala_carrier.gif new file mode 100644 index 000000000..bde9893f6 Binary files /dev/null and b/modules/dejala/dejala_carrier.gif differ diff --git a/modules/dejala/dejala_carrier.tpl b/modules/dejala/dejala_carrier.tpl new file mode 100644 index 000000000..cf9eca624 --- /dev/null +++ b/modules/dejala/dejala_carrier.tpl @@ -0,0 +1,65 @@ + + + + + {literal} + + {/literal} + + {* + switchDay(deliveryDateSelected); + switchHours(deliveryHourSelected); + toggleShipping(); + *} + + {foreach from=$carriers item=carrier name=myLoop} + + + + + + + + + + {$carrier.delay|escape:'htmlall':'UTF-8'} + + {if $carrier.price} + + {if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if} + + {if $priceDisplay == 1} {l s='(tax excl.)' mod='dejala'}{else} {l s='(tax incl.)' mod='dejala'}{/if} + {else} + {l s='Free!' mod='dejala'} + {/if} + + + {/foreach} \ No newline at end of file diff --git a/modules/dejala/dejala_carrier_nostock.tpl b/modules/dejala/dejala_carrier_nostock.tpl new file mode 100644 index 000000000..831bc51d0 --- /dev/null +++ b/modules/dejala/dejala_carrier_nostock.tpl @@ -0,0 +1,23 @@ + {foreach from=$carriers item=carrier name=myLoop} + + + + + + + + + + {$nostock_info} + {if $carrier.price} + + {if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if} + + {if $priceDisplay == 1} {l s='(tax excl.)' mod='dejala'}{else} {l s='(tax incl.)' mod='dejala'}{/if} + {else}{l s='Free!'} + {/if} + + + {/foreach} \ No newline at end of file diff --git a/modules/dejala/dejala_contacts.tpl b/modules/dejala/dejala_contacts.tpl new file mode 100644 index 000000000..4aafefb58 --- /dev/null +++ b/modules/dejala/dejala_contacts.tpl @@ -0,0 +1,46 @@ +
        +
        + +
        + {l s='Shop owner' mod='dejala'} +

        {l s='Name:' mod='dejala'}

        +

        {l s='Firstname:' mod='dejala'}

        +

        {l s='Phone:' mod='dejala'}

        +

        {l s='Cellphone:' mod='dejala'}

        +

        {l s='E-Mail:' mod='dejala'}

        +
        + +
        + {l s='Stock Control Contact' mod='dejala'} +

        {l s='Name:' mod='dejala'}

        +

        {l s='Firstname:' mod='dejala'}

        +

        {l s='Phone:' mod='dejala'}

        +

        {l s='Cellphone:' mod='dejala'}

        +

        {l s='E-Mail:' mod='dejala'}

        +
        +
        +
        +
        + {l s='Administration Contact' mod='dejala'} +

        {l s='Name:' mod='dejala'}

        +

        {l s='Firstname:' mod='dejala'}

        +

        {l s='Phone:' mod='dejala'}

        +

        {l s='Cellphone:' mod='dejala'}

        +

        {l s='E-Mail:' mod='dejala'}

        +
        + +
        + {l s='Website Maintenance Contact' mod='dejala'} +

        {l s='Name:' mod='dejala'}

        +

        {l s='Firstname:' mod='dejala'}

        +

        {l s='Phone:' mod='dejala'}

        +

        {l s='Cellphone:' mod='dejala'}

        +

        {l s='E-Mail:' mod='dejala'}

        +
        +
        +
        +
        + + +
        + diff --git a/modules/dejala/dejala_deliveries.tpl b/modules/dejala/dejala_deliveries.tpl new file mode 100644 index 000000000..288ac7977 --- /dev/null +++ b/modules/dejala/dejala_deliveries.tpl @@ -0,0 +1,74 @@ +
        + {if ($djl_mode == 'PROD')}{l s='Your credit' mod='dejala'}{else if ($djl_mode == 'TEST')}{l s='Your virtual credit (in order to test)' mod='dejala'}{/if} : {$account_balance} {l s='euros' mod='dejala'}
        + {if ($djl_mode == 'PROD')}{l s='Credit your account' mod='dejala'}
        {/if} + +

        {l s='List of last deliveries' mod='dejala'}:

        + + + + + + + + + + + + + + + + {foreach from=$deliveries item=delivery name=deliveryLoop} + + {if $delivery.status.picto_id} + + {else} + + {/if} + + + + + + + + + + {/foreach} +
        {l s='#' mod='dejala'}{l s='Creation' mod='dejala'}{l s='Order ID' mod='dejala'}{l s='Tracking_number' mod='dejala'}{l s='Label' mod='dejala'}{l s='Price' mod='dejala'}{l s='Status' mod='dejala'}{l s='Shipping' mod='dejala'}{l s='Description' mod='dejala'}
        {$delivery.creation_date}{$delivery.packet_reference}{if $delivery.tracking_number}{$delivery.tracking_number}{/if}{$delivery.short_label}{$delivery.price}{$delivery.status.labels.fr}{$delivery.shipping_date}{l s='In ' mod='dejala'}{$delivery.timelimit}{l s='h' mod='dejala'} - {l s='from' mod='dejala'} {$delivery.shipping_start} {l s='to' mod='dejala'} {$delivery.shipping_stop}
        +
        +
        +
        +
        + {l s='Csv Export' mod='dejala'}: + +
        + +
        + + + {literal} + + {/literal} + +{l s='From' mod='dejala'}: +{l s='To' mod='dejala'}: + + +
        +
        +
        + \ No newline at end of file diff --git a/modules/dejala/dejala_deliveries_csv.tpl b/modules/dejala/dejala_deliveries_csv.tpl new file mode 100644 index 000000000..68b139130 --- /dev/null +++ b/modules/dejala/dejala_deliveries_csv.tpl @@ -0,0 +1,4 @@ +{l s='creation_date' mod='dejala'};{l s='Order ID' mod='dejala'};{l s='Tracking_number' mod='dejala'};{l s='short_label' mod='dejala'};{l s='price' mod='dejala'};{l s='status' mod='dejala'};{l s='shipping_date' mod='dejala'};{l s='timelimit' mod='dejala'};{l s='shipping_start' mod='dejala'};{l s='shipping_stop' mod='dejala'};{l s='delivery_date' mod='dejala'};{l s='delivery_time' mod='dejala'} +{foreach from=$deliveries item=delivery name=deliveryLoop} +"{$delivery.creation_date}";"{$delivery.packet_reference}";"{$delivery.tracking_number}";"{$delivery.short_label}";"{$delivery.price}";"{$delivery.status.labels.fr}";"{$delivery.shipping_date}";"{$delivery.timelimit}";"{$delivery.shipping_start}";"{$delivery.shipping_stop}";"{$delivery.delivery_date}";"{$delivery.delivery_time}" +{/foreach} \ No newline at end of file diff --git a/modules/dejala/dejala_delivery_options.tpl b/modules/dejala/dejala_delivery_options.tpl new file mode 100644 index 000000000..f02de3c65 --- /dev/null +++ b/modules/dejala/dejala_delivery_options.tpl @@ -0,0 +1,43 @@ +
        +
        + + +

        {l s='Shipping preferences' mod='dejala'}

        + + {include file="$timetableTpl"} + +

        {l s='Propose shipping ' mod='dejala'}:

        +
        + + {l s=' after ordering' mod='dejala'} +
        + +

        {l s='Display ' mod='dejala'}:

        +
        + + {l s=' days in the timerange selection interface' mod='dejala'} +
        + + +
        + + {l s='Enable customers to choose Dejala even if a product is out of stock (The customer will choose the date of the delivery when their order will be ready)' mod='dejala'} +
        + +
        + +
        +
        diff --git a/modules/dejala/dejala_footer.tpl b/modules/dejala/dejala_footer.tpl new file mode 100644 index 000000000..07b9b4fe3 --- /dev/null +++ b/modules/dejala/dejala_footer.tpl @@ -0,0 +1,26 @@ +{if (isset($registered) AND $registered != 0)} + {if ($currentTab != 'home')} + {assign var='page_include' value=$currentTab} + {else} + {if ($djl_mode=='TEST')} + {if ($isLiveRequested=='1')} + {assign var='page_include' value='home_ready'} + {else} + {assign var='page_include' value='home_testing'} + {/if} + {else} + {assign var='page_include' value='home_active'} + {/if} + + {/if} +{else} + {assign var='page_include' value='home_new'} +{/if} + + +
        + +
        + +
        + diff --git a/modules/dejala/dejala_header.tpl b/modules/dejala/dejala_header.tpl new file mode 100644 index 000000000..5af8910f0 --- /dev/null +++ b/modules/dejala/dejala_header.tpl @@ -0,0 +1,9 @@ +
        +
        +
        +
        +

        {l s='Ship your orders by courier with ' mod='dejala'}{l s='DEJALA ' mod='dejala'}

        +
        +
        +
        +
        diff --git a/modules/dejala/dejala_home.tpl b/modules/dejala/dejala_home.tpl new file mode 100644 index 000000000..ec4362c9e --- /dev/null +++ b/modules/dejala/dejala_home.tpl @@ -0,0 +1,166 @@ +{literal} + +{/literal} + + {if (isset($registered) AND $registered == 0)} + +
        +
        +
        +
        + +
        + {l s='New to Dejala.fr ?' mod='dejala'} +
        + {l s='Your shop name:' mod='dejala'} +
        +
        + {l s='Select your country:' mod='dejala'} + +
        +
        + {l s='Choose your login:' mod='dejala'} +
        +
        + {l s='Choose your password:' mod='dejala'} +
        +
        + +
        +
        +
        + +
        +
        + +
        + {l s='I already have an account for my shop:' mod='dejala'} +
        {l s='Login:' mod='dejala'}
        +
        + {l s='Select your country:' mod='dejala'} + +
        +
        {l s='Password:' mod='dejala'}
        +
        + +
        +
        +
        +
        +
        + + {else} +
        +
        + +
        +
        + {l s='Dejala.fr' mod='dejala'} + {l s='As a reminder' mod='dejala'} :
        + {l s='Your store name is' mod='dejala'} : {$store_name}
        + {l s='Your login is' mod='dejala'} : {if isset($store_login)}{$store_login}{/if}

        + {l s='Your are running on the' mod='dejala'} : {if ($djl_mode=='TEST')}{l s='test platform' mod='dejala'}{else}{l s='production platform' mod='dejala'}{/if}
        + + {* Switch mode button : switch between test/prod modes *} + {if ($djl_mode=='PROD')} +
        + + + +
        + {else} + {if (isset($isLiveReady) AND $isLiveReady=='1')} +
        + + + +
        + {else} + {if (isset($isLiveReady) AND $isLiveRequested=='1')} + {l s='Your request to go live is under process : Dejala.fr will contact you to finalize your registration.' mod='dejala'} + {else} + {* Demande de passage en prod *} +
        + + +
        + {/if} + {/if} + {/if} + +

        + {if ($djl_mode == 'PROD')}{l s='Your credit' mod='dejala'} :{else if ($djl_mode == 'TEST')}{l s='Your virtual credit (in order to test)' mod='dejala'} :{/if} {$account_balance} {l s='euros' mod='dejala'}
        + {if ($djl_mode == 'PROD')}{l s='Credit your account' mod='dejala'}
        {/if} + +

        +
        +
        + {l s='Dejala IS NOT visible for any users' mod='dejala'} +
        +
        + {l s='Dejala IS visible for all users' mod='dejala'} +
        +
        + {l s='Dejala IS visible ONLY for the following users' mod='dejala'} : +
        +
        + {l s='(e.g. : a@foo.com, b@bar.com)' mod='dejala'} +
        + +
        + +
        +
        + + +
        + {/if} + diff --git a/modules/dejala/dejala_location.tpl b/modules/dejala/dejala_location.tpl new file mode 100644 index 000000000..122517fac --- /dev/null +++ b/modules/dejala/dejala_location.tpl @@ -0,0 +1,26 @@ +
        + +
        +

        {l s='Please specify the address of your stock' mod='dejala'} {if ($djl_mode=='PROD')}{l s='(readonly)' mod='dejala'}{/if}: + {if (isset($address) && isset($zipcode) && isset($city))}{l s='Locate' mod='dejala'}{/if} +

        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        +
        +
        +
        + \ No newline at end of file diff --git a/modules/dejala/dejala_logo.gif b/modules/dejala/dejala_logo.gif new file mode 100644 index 000000000..8444607ab Binary files /dev/null and b/modules/dejala/dejala_logo.gif differ diff --git a/modules/dejala/dejala_menu.tpl b/modules/dejala/dejala_menu.tpl new file mode 100644 index 000000000..70cbe3d85 --- /dev/null +++ b/modules/dejala/dejala_menu.tpl @@ -0,0 +1,37 @@ +{if (isset($registered) AND $registered != 0)} + +
        +{/if} +
        +
        + diff --git a/modules/dejala/dejala_picking_timetable.tpl b/modules/dejala/dejala_picking_timetable.tpl new file mode 100644 index 000000000..d382a3b0d --- /dev/null +++ b/modules/dejala/dejala_picking_timetable.tpl @@ -0,0 +1,31 @@ +

        {l s='Stock is open' mod='dejala'}

        +{foreach from=$weekdayLabels item=weekday name=weekdayLoop} + {assign var='curWeekdayIdx' value=$smarty.foreach.weekdayLoop.index} +
        + + {$weekday}: {l s='De' mod='dejala'} + + {l s='A' mod='dejala'} + + +
        + +{/foreach} \ No newline at end of file diff --git a/modules/dejala/dejala_processes.tpl b/modules/dejala/dejala_processes.tpl new file mode 100644 index 000000000..f2f451de3 --- /dev/null +++ b/modules/dejala/dejala_processes.tpl @@ -0,0 +1,23 @@ +
        + +
        +

        {l s='Please specify the processes to properly handle deliveries' mod='dejala'}:

        + {l s='Feel free to adapt the default processes to your own business processes' mod='dejala'}
        +
        + + +
        + + +
        + + +
        + + +
        + +
        +
        +
        + \ No newline at end of file diff --git a/modules/dejala/dejala_products.tpl b/modules/dejala/dejala_products.tpl new file mode 100644 index 000000000..4f4b9e85a --- /dev/null +++ b/modules/dejala/dejala_products.tpl @@ -0,0 +1,40 @@ +
        + +
        +

        {l s='Please set you margin for deliveries' mod='dejala'}:

        + + + + + + + + + + + + + + + + + + + + {foreach from=$products item=product name=productLoop} + + + + + + + + + + {/foreach} +
        {l s='Name' mod='dejala'}{l s='Buy price' mod='dejala'}{l s='Margin TTC' mod='dejala'}{l s='Customer price' mod='dejala'}{l s='Description' mod='dejala'}
        {l s='Buy HT' mod='dejala'}{l s='Buy TTC' mod='dejala'}{l s='Sell HT' mod='dejala'}{l s='Sell TTC' mod='dejala'}
        {$product.code}{$product.price_notax}{$product.price}{$product.public_price_notax}{$product.public_price}{$product.description}
        {l s='In' mod='dejala'} {$product.timelimit}{l s='h' mod='dejala'}
        +
        +
        +
        +
        +
        \ No newline at end of file diff --git a/modules/dejala/dejala_technical_options.tpl b/modules/dejala/dejala_technical_options.tpl new file mode 100644 index 000000000..320215992 --- /dev/null +++ b/modules/dejala/dejala_technical_options.tpl @@ -0,0 +1,20 @@ +
        + +
        + +

        {l s='List of triggering status' mod='dejala'}:

        +
        + {**} + + {foreach from=$statuses item=status name=statusLoop} + {assign var='curIdxStatus' value=$smarty.foreach.statusLoop.index} +
        + {$status.label} +
        + {/foreach} + +

        {l s='List of statuses that trigger dejala.fr' mod='dejala'}

        +
        +
        +
        +
        diff --git a/modules/dejala/dejala_timetable.tpl b/modules/dejala/dejala_timetable.tpl new file mode 100644 index 000000000..cc7eec3d1 --- /dev/null +++ b/modules/dejala/dejala_timetable.tpl @@ -0,0 +1,27 @@ +{* MFR081028 - information de shipping *} + + + +
        +
        +
        +
        + {foreach from=$dates item=dateItem name=dateLabelLoop} + {assign var='curIdxDate' value=$smarty.foreach.dateLabelLoop.index} +
        + {/foreach} +
        +
        +
        + {section name=hour start=0 loop=24 step=1} + {assign var='curIdxhour' value=$smarty.section.hour.index} +
        + {/section} +
        +
        +
        +
        + + + +{* MFR081028 - information de shipping *} diff --git a/modules/dejala/dejalacarrierutils.php b/modules/dejala/dejalacarrierutils.php new file mode 100644 index 000000000..10b7f29bf --- /dev/null +++ b/modules/dejala/dejalacarrierutils.php @@ -0,0 +1,101 @@ +country); + $countryID = Country::getByIso($moduleCountryIsoCode); + if ((int)($countryID)) + $id_zone = Country::getIdZone($countryID); + + //TODO Will have to review this and apply proper code. + $trg_id = 1 ; +// $vatRate = "19.6"; +// // MFR091130 - get or create the tax & attach it to our zone if needed +// $id_tax = Tax::getTaxIdByRate((float)$vatRate); +// $trg_id = 0; +// if (!$id_tax) +// { +// $tax = new Tax(); +// $tax->rate = $vatRate; +// $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); +// $tax->name[$defaultLanguage] = $tax->rate . '%'; +// $tax->add(); +// $id_tax = $tax->id; +// +// $trg = new TaxRulesGroup(); +// $trg->name = 'Dejala '.$tax->name[$defaultLanguage]; +// $trg->active = 1; +// if ($trg->save()) +// { +// $trg_id = $trg->id; +// +// $tr = new TaxRule(); +// $tr->id_tax_rules_group = $trg_id; +// $tr->id_country = (int) $countryID; +// $tr->id_state = 0; +// $tr->id_tax = (int)$tax->id; +// $tr->state_behavior = 0; +// $tr->save(); +// } +// } + + $carrier = new Carrier(); + $carrier->name = 'dejala'; + $carrier->id_tax_rules_group = $trg_id; + $carrier->url = 'http://tracking.dejala.' . $dejalaConfig->country . '/tracker/@'; + $carrier->active = true; + $carrier->deleted = 0; + $carrier->shipping_handling = false; + $carrier->range_behavior = 0; + $carrier->is_module = 1; + $carrier->external_module_name = 'dejala' ; + $carrier->shipping_external = 1 ; + $carrier->need_range = 0 ; + + $languages = Language::getLanguages(true); + foreach ($languages as $language) { + $carrier->delay[$language['id_lang']] = 'Dejala' ; + } + $carrier->add(); + + $carrier->addZone($id_zone) ; +// $sql = 'INSERT INTO `'._DB_PREFIX_.'carrier_zone` (`id_carrier` , `id_zone`) VALUES ('.(int)($carrier->id).', ' . (int)($id_zone) . ')'; +// Db::getInstance()->Execute($sql); + +// $rangeW = new RangeWeight(); +// $rangeW->id_carrier = $carrier->id; +// $rangeW->delimiter1 = 0; +// $rangeW->delimiter2 = $dejalaProduct['max_weight']; +// $rangeW->add(); +// $vat_factor = (1+ ($dejalaProduct['vat'] / 100)); +// $priceTTC = round(($dejalaProduct['price']*$vat_factor) + $dejalaProduct['margin'], 2); +// $priceHT = round($priceTTC/$vat_factor, 2); +// $priceList = '(NULL'.','.$rangeW->id.','.$carrier->id.','.$id_zone.','.$priceHT.')'; +// $carrier->addDeliveryPrice($priceList); + + return true; + } + + public static function getCarrierByName($name) { + global $cookie ; + + $carriers = Carrier::getCarriers($cookie->id_lang, true, false, false, NULL, ALL_CARRIERS); + foreach($carriers as $carrier) { + if (!$carrier['deleted'] AND $carrier['external_module_name'] == $name) { + return new Carrier($carrier['id_carrier']) ; + } + } + } + +} + diff --git a/modules/dejala/dejalacart.php b/modules/dejala/dejalacart.php new file mode 100644 index 000000000..f9a66f44d --- /dev/null +++ b/modules/dejala/dejalacart.php @@ -0,0 +1,71 @@ +wanted_cart_id = $id ; + } + parent::__construct($id, $id_lang) ; + if (isset($this->id) && $this->id == $this->wanted_cart_id) { + unset($this->wanted_cart_id) ; + } + } + + public function getFields() + { + parent::validateFields(); + $fields['id_dejala_product'] = (int)($this->id_dejala_product); + $fields['shipping_date'] = pSQL($this->shipping_date); + $fields['id_delivery'] = (int)($this->id_delivery); + $fields['mode'] = pSQL($this->mode); + $fields['cart_date_upd'] = pSQL($this->cart_date_upd); + $fields['delivery_price'] = pSQL($this->delivery_price); + if (!isset($id_cart) && isset($original_cart_id)) $id_cart = $original_cart_id ; + return $fields; + } + + public function save($nullValues = false, $autodate = true) { + parent::save($nullValues, $autodate) ; + if (isset($this->wanted_cart_id)) { + Db::getInstance()->Execute('UPDATE ' . _DB_PREFIX_ . $this->table . ' SET ' . $this->identifier . ' = ' . (int)$this->wanted_cart_id . ' WHERE ' . $this->identifier . ' = ' . (int)$this->id); + $this->id = $this->wanted_cart_id ; + unset($this->wanted_cart_id) ; + } + } + +} + + diff --git a/modules/dejala/dejalaconfig.php b/modules/dejala/dejalaconfig.php new file mode 100644 index 000000000..aa8f1875b --- /dev/null +++ b/modules/dejala/dejalaconfig.php @@ -0,0 +1,118 @@ +serviceURL) == false + OR Configuration::updateValue('DJL_SANDBOX_SERVICE_URL', $this->sandboxServiceURL) == false + OR Configuration::updateValue('DJL_USE_SSL', $this->useSSL) == false + OR Configuration::updateValue('DJL_MODE', $this->mode) == false + OR Configuration::updateValue('DJL_LOGIN', $this->login) == false + OR Configuration::updateValue('DJL_PASSWORD', $this->password) == false + OR Configuration::updateValue('DJL_INSTALLED', $this->installed) == false + OR Configuration::updateValue('DJL_TRIGERRING_STATUSES', $this->trigerringStatuses) == false + OR Configuration::updateValue('DJL_COUNTRY', $this->country) == false + OR Configuration::updateValue('DJL_VISIBILITY_STATUS', $this->visibility_status) == false + OR Configuration::updateValue('DJL_VISIBLE_USERS_LIST', $this->visible_users_list) == false + OR Configuration::updateValue('DJL_VERSION', $this->internal_version) == false + ) { + return (false); + } + + // Backward compatibility. Garbage collect + Configuration::deleteByName('DJL_ACTIVE'); + return (true); + } + + public function uninstall() { + Configuration::deleteByName('DJL_SERVICE_URL'); + Configuration::deleteByName('DJL_SANDBOX_SERVICE_URL'); + Configuration::deleteByName('DJL_USE_SSL'); + Configuration::deleteByName('DJL_MODE'); + Configuration::deleteByName('DJL_LOGIN'); + Configuration::deleteByName('DJL_PASSWORD'); + Configuration::deleteByName('DJL_INSTALLED'); + Configuration::deleteByName('DJL_TRIGERRING_STATUSES'); + Configuration::deleteByName('DJL_COUNTRY'); + Configuration::deleteByName('DJL_ACTIVE'); + Configuration::deleteByName('DJL_VISIBILITY_STATUS'); + Configuration::deleteByName('DJL_VISIBLE_USERS_LIST'); + // DO NOT DELETE DJL_VERSION AS WE LEAVE THE TABLE IN THE DB. + } + + // load configuration + public function loadConfig() + { + $this->installed = html_entity_decode(Configuration::get('DJL_INSTALLED'), ENT_COMPAT, 'UTF-8'); + $this->useSSL = (int)(html_entity_decode(Configuration::get('DJL_USE_SSL'), ENT_COMPAT, 'UTF-8')); + $this->serviceURL = html_entity_decode(Configuration::get('DJL_SERVICE_URL'), ENT_COMPAT, 'UTF-8'); + $this->sandboxServiceURL = html_entity_decode(Configuration::get('DJL_SANDBOX_SERVICE_URL'), ENT_COMPAT, 'UTF-8'); + $this->mode = html_entity_decode(Configuration::get('DJL_MODE'), ENT_COMPAT, 'UTF-8'); + $this->login = html_entity_decode(Configuration::get('DJL_LOGIN'), ENT_COMPAT, 'UTF-8'); + $this->password = html_entity_decode(Configuration::get('DJL_PASSWORD'), ENT_COMPAT, 'UTF-8'); + $this->trigerringStatuses = html_entity_decode(Configuration::get('DJL_TRIGERRING_STATUSES'), ENT_COMPAT, 'UTF-8'); + + $this->shippingPrefix = html_entity_decode(Configuration::get('DJL_SHIPPING_PREFIX'), ENT_COMPAT, 'UTF-8'); + $this->country = html_entity_decode(Configuration::get('DJL_COUNTRY'), ENT_COMPAT, 'UTF-8'); + if (strlen($this->country) == 0) + $this->country = 'fr'; + $this->visibility_status = html_entity_decode(Configuration::get('DJL_VISIBILITY_STATUS'), ENT_COMPAT, 'UTF-8'); + $this->visible_users_list = html_entity_decode(Configuration::get('DJL_VISIBLE_USERS_LIST'), ENT_COMPAT, 'UTF-8'); + $this->internal_version = Configuration::get('DJL_VERSION') ; + + // Backward compatibility + $activeVal = html_entity_decode(Configuration::get('DJL_ACTIVE'), ENT_COMPAT, 'UTF-8') ; + if ($activeVal != "") { + $this->active = (int)($activeVal); + $this->visibility_status = ($this->active == 0 ? "invisible" : "visible") ; + } + if ($this->visibility_status == "") { + $this->visibility_status = "invisible" ; + } + } + + /** + * Renvoie l'URI de base à utiliser + * $forceMode TEST/PROD pour forcer l'utilisation d'une des 2 plateformes + **/ + public function getRootServiceURI($forceMode = NULL) + { + $l_serviceURL = NULL; + $useMode = $this->mode; + // mode forcé ? + if ($forceMode && ($forceMode == 'PROD')) + $useMode = 'PROD'; + else if ($forceMode) + $useMode = 'TEST'; + + if ($useMode === 'PROD') + $l_serviceURL = $this->serviceURL; + else + $l_serviceURL = $this->sandboxServiceURL; + if ($this->useSSL !== 0) { + if (0 === strpos($l_serviceURL, 'http:')) + $l_serviceURL = 'https'.substr($l_serviceURL, 4); + } + return ($l_serviceURL); + } +} diff --git a/modules/dejala/dejalatest.php b/modules/dejala/dejalatest.php new file mode 100644 index 000000000..65841b654 --- /dev/null +++ b/modules/dejala/dejalatest.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/modules/dejala/dejalautils.php b/modules/dejala/dejalautils.php new file mode 100644 index 000000000..ab5948c34 --- /dev/null +++ b/modules/dejala/dejalautils.php @@ -0,0 +1,506 @@ +getRootServiceURI('TEST') . '/mystore/delivery'; + else + $serviceURL = $dejalaConfig->getRootServiceURI('PROD') . '/mystore/delivery'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $delivery, 'POST', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $nodeList = $doc->getElementsByTagName('delivery'); + if ($nodeList->length > 0) + $this->getNodeValue($nodeList->item(0), $delivery); + } + return ($responseArray); + } + + /** + * Quick creates a store account at dejala.fr + * only works on Dejala test platform + * @returns the HTTP status code of the request + **/ + public function createInstantStore($dejalaConfig, $storeName) + { + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/instantstore'; + $postargs['login']=$dejalaConfig->login; + $postargs['password']=$dejalaConfig->password; + $postargs['store_url']=$dejalaConfig->storeUrl; + $postargs['store_name'] = $storeName; + $postargs['platform'] = 'prestashop'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'POST', FALSE); + return ($responseArray); + } + static public function wtf($var, $arrayOfObjectsToHide=null, $fontSize=11) + { + $text = print_r($var, true); + + if (is_array($arrayOfObjectsToHide)) { + + foreach ($arrayOfObjectsToHide as $objectName) { + + $searchPattern = '#('.$objectName.' Object\n(\s+)\().*?\n\2\)\n#s'; + $replace = "$1--> HIDDEN - courtesy of wtf() <--)"; + $text = preg_replace($searchPattern, $replace, $text); + } + } + + // color code objects + $text = preg_replace('#(\w+)(\s+Object\s+\()#s', '$1$2', $text); + // color code object properties + $text = preg_replace('#\[(\w+)\:(public|private|protected)\]#', '[$1:$2]', $text); + + echo '
        '.$text.'
        '; + } + + public function getStoreLocation($dejalaConfig, &$location) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $locationNodes=$doc->getElementsByTagName('location'); + if ($locationNodes->length > 0) + { + $locationNode = $locationNodes->item(0); + $nodeList = $locationNode->childNodes; + foreach ($nodeList as $element){ + $location[$element->nodeName] = $element->textContent; + } + } + } + return ($responseArray); + } + + public function getStoreCalendar($dejalaConfig, &$calendar) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/calendar/'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $nodeList = $doc->getElementsByTagName('entry'); + if ($nodeList->length > 0) { + foreach ($nodeList as $element) { + $calendarNode = $this->getNodeValue($element); + $calendar['entries'][(int)($calendarNode['weekday'])] = $calendarNode; + } + } + $nodeList = $doc->getElementsByTagName('exception'); + $calendar['exceptions'] = array(); + if ($nodeList->length > 0) { + foreach ($nodeList as $element) { + $calendar['exceptions'][] = $this->getNodeValue($element); + } + } + } + return ($responseArray); + } + + public function getStoreContacts($dejalaConfig, &$contacts) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $contactsNodeList = $doc->getElementsByTagName('contacts'); + if ($contactsNodeList->length > 0) + { + $contactNodes = $contactsNodeList->item(0)->childNodes; + if ($contactNodes) + foreach ($contactNodes as $contactNode) + { + $name = $contactNode->nodeName; + $nodeList = $contactNode->childNodes; + $currentContactNode = array(); + if ($nodeList) + foreach ($nodeList as $element) { + $currentContactNode[$element->nodeName] = $element->textContent; + } + $contacts[$name] = $currentContactNode; + } + } + } + return ($responseArray); + } + + public function getStoreProducts($dejalaConfig, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + foreach ($productsNodeList as $productNode) + { + $currentProduct = array(); + $nodeList = $productNode->childNodes; + foreach ($nodeList as $element) { + $currentProduct[$element->nodeName] = $element->textContent; + } + if (count($currentProduct)) + $products[] = $currentProduct; + } + } + + usort($products, array("DejalaUtils", "cmpProducts")); + return ($responseArray); + } + + private static function cmpProducts($a, $b) + { + if ($a['priority'] == $b['priority']) { + if (($a['price'] == $b['price'])) { + return ($a['id'] < $b['id']) ? -1 : 1 ; + } + return ($a['price'] < $b['price']) ? -1 : 1 ; + } + return ($a['priority'] < $b['priority']) ? -1 : 1; + } + + public function getStoreQuotation($dejalaConfig, $quotationElements, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/quotation'; + $postargs = $quotationElements; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + foreach ($productsNodeList as $productNode) + { + $currentProduct = $this->getNodeValue($productNode); + unset($currentProduct['calendar']['entries']['entry']); + $calendarNodeList = $doc->getElementsByTagName('entry'); + foreach ($calendarNodeList as $calendarNode) { + $calendarEntry = $this->getNodeValue($calendarNode); + $currentProduct['calendar']['entries'][$calendarEntry['weekday']] = $calendarEntry; + } + $exceptionNodeList = $doc->getElementsByTagName('exception'); + $currentProduct['calendar']['exceptions'] = array(); + foreach ($exceptionNodeList as $exceptionNode) { + $currentProduct['calendar']['exceptions'][] = $this->getNodeValue($exceptionNode); + } + /*$currentProduct = array(); + $nodeList = $productNode->childNodes; + foreach ($nodeList as $element) { + $currentProduct[$element->nodeName] = $element->textContent; + } + */ + if (count($currentProduct)) + $products[] = $currentProduct; + } + } + usort($products, array("DejalaUtils", "cmpProducts")); + return ($responseArray); + } + + public function getStoreAttributes($dejalaConfig, &$store) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $fatherNodeList = $doc->getElementsByTagName('store'); + if ($fatherNodeList->length > 0) + { + $childNodes = $fatherNodeList->item(0)->childNodes; + foreach ($childNodes as $childNode) + { + $store[$childNode->nodeName] = $childNode->textContent; + } + } + $nodeList = $doc->getElementsByTagName('attributes'); + $store['attributes'] = array(); + if ($nodeList->length > 0) { + $store['attributes'] = $this->getNodeValue($nodeList->item(0)); + } + } + return ($responseArray); + } + + public function getStoreProcesses($dejalaConfig, &$processes) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore'; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $fatherNodeList = $doc->getElementsByTagName('processes'); + if ($fatherNodeList->length > 0) + { + $childNodes = $fatherNodeList->item(0)->childNodes; + foreach ($childNodes as $childNode) + { + $processes[$childNode->nodeName] = $childNode->textContent; + } + } + } + return ($responseArray); + } + + public function getStoreProductByID($dejalaConfig, $productID, &$product) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products/' . $productID; + $postargs = array(); + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $postargs, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $productsNodeList = $doc->getElementsByTagName('product'); + if ($productsNodeList->length > 0) + { + $nodeList = $productsNodeList->item(0)->childNodes; + foreach ($nodeList as $element) { + $product[$element->nodeName] = $element->textContent; + } + } + } + return ($responseArray); + } + + public function getDelivery($dejalaConfig, &$delivery, $mode) + { + if ($mode !== 'PROD') + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/delivery/' . $delivery['id']; + else + $serviceURL = $dejalaConfig->getRootServiceURI('PROD') . '/mystore/delivery/' . $delivery['id']; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + //echo 'xml='.$xml.'
        '; + $nodeList = $doc->getElementsByTagName('delivery'); + if ($nodeList->length > 0) + $this->getNodeValue($nodeList->item(0), $delivery); + } + return ($responseArray); + } + + /** + * Transforms and returns node into tree structure, use $value array if not null + **/ + function getNodeValue($node, &$value=NULL) + { + if ($node instanceof DOMElement) + { + $childNodes = $node->childNodes; + $onlyText = TRUE; + $text = ''; + foreach ($childNodes as $childNode) + { + if ($childNode instanceof DOMElement) + { + $onlyText = FALSE; + $value[$childNode->nodeName] = $this->getNodeValue($childNode); + } + } + if ($onlyText) { + return ($value=$node->textContent); + } + } + return ($value); + } + + public function getStoreDeliveries($dejalaConfig, &$deliveries, $args = array()) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/deliveries'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $args, 'GET', TRUE); + if (!($xml = strstr($responseArray['response'], 'loadXML($xml); + $childNodes = $doc->getElementsByTagName('delivery'); + foreach ($childNodes as $childNode) { + $deliveries[] = $this->getNodeValue($childNode); + } + } + return ($responseArray); + } + + public function setStoreContacts($dejalaConfig, &$contacts) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/contacts'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $contacts, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreLocation($dejalaConfig, &$location) + { + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/location'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $location, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreProcesses($dejalaConfig, &$processes) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/processes'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $processes, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreProducts($dejalaConfig, &$products) + { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/products'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $products, 'PUT', TRUE); + return ($responseArray); + } + public function setStoreCalendar($dejalaConfig, &$calendar) { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/calendar'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $calendar, 'POST', TRUE); + return ($responseArray); + } + + public function setStoreAttributes($dejalaConfig, &$attributes) { + $serviceURL = $dejalaConfig->getRootServiceURI() . '/mystore/attributes'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, $attributes, 'PUT', TRUE); + return ($responseArray); + } + + /** + * Ask Dejala.fr to create an account for the store on the production platform + **/ + public function goLive($dejalaConfig) { + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/mystore/golive'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'PUT', TRUE); + return ($responseArray); + } + /** + * teste la connexion sur le service Dejala dans le mode (TEST/PROD) + * */ + public function ping($dejalaConfig, $mode) { + if ($mode !== 'PROD') + $serviceURL = $dejalaConfig->getRootServiceURI('TEST') . '/ping'; + else + $serviceURL = $dejalaConfig->getRootServiceURI('PROD') . '/ping'; + $responseArray = $this->makeRequest($dejalaConfig, $serviceURL, array(), 'GET', TRUE); + return ($responseArray); + } + + public function makeRequest($dejalaConfig, $serviceURL, $args, $method='POST', $needAuth=TRUE) { + $session = curl_init($serviceURL); + $requestArgs = ""; + foreach ($args as $key => $value) { + $requestArgs = $requestArgs . '&' . $key . '=' . urlencode($value); + } + if ($method == 'GET') + { + if (strlen($requestArgs) > 0) + $requestArgs = '?' . $requestArgs; + $session = curl_init($serviceURL . $requestArgs); + } + else if ($method == 'POST') + { + $session = curl_init($serviceURL); + curl_setopt($session, CURLOPT_POST, true); + curl_setopt($session, CURLOPT_POSTFIELDS, $requestArgs); + } + else if ($method == 'PUT') + { + curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($session, CURLOPT_POSTFIELDS, $requestArgs); + } + // manage authenth + if ($needAuth) + { + curl_setopt($session, CURLOPT_USERPWD, $dejalaConfig->login.':'.$dejalaConfig->password); + curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + } + // SSL option + if ($dejalaConfig->useSSL === 1) { + curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($session, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($session, CURLOPT_PORT, 443); + } + curl_setopt($session, CURLOPT_HEADER, true); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + // Do the POST and then close the session + $response = curl_exec($session); + curl_close($session); + // Get HTTP Status code from the response + $status_code = array(); + preg_match('/\d\d\d/', $response, $status_code); + $responseArray['status']=$status_code[0]; + $responseArray['response']=$response; + return ($responseArray); + } + + + public function mylog($msg) { + + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + $myFile = dirname(__FILE__) . "/logFile.txt"; + MyLogUtils::myLog($myFile, $msg); + + } + + // get a string of a value for Log purposes + public function logValue($mvalue, $lvl=0) { + require_once(dirname(__FILE__) . "/MyLogUtils.php"); + return (MyLogUtils::logValue($mvalue, $lvl)); + } + + +} + diff --git a/modules/dejala/deliveries_csv.php b/modules/dejala/deliveries_csv.php new file mode 100644 index 000000000..94217cf83 --- /dev/null +++ b/modules/dejala/deliveries_csv.php @@ -0,0 +1,67 @@ +$val) { + if (is_array($val)) + $l_array[$key] = doubleQuoteArray($val); + else + $l_array[$key] = ereg_replace('"', '""', $val); + } + return ($l_array); + } + + global $smarty; + $dejalaConfig = new DejalaConfig(); + $dejalaConfig->loadConfig(); + + $from = Tools::getValue('datepickerFrom'); + $to = Tools::getValue('datepickerTo'); + if (!is_null($from) && !is_null($to) && (strlen($from) == 10) && (strlen($to) == 10) ) + { + $dateFrom = mktime(0, 0, 1, (int)(substr($from, 3, 2)), (int)(substr($from, 0, 2)), (int)(substr($from, 6, 4))); + $dateTo = mktime(23, 59, 59, (int)(substr($to, 3, 2)), (int)(substr($to, 0, 2)), (int)(substr($to, 6, 4))); + if ($dateFrom > $dateTo) { + $tmp = $dateTo; + $dateTo = $dateFrom; + $dateFrom = $tmp; + } + + $djlUtil = new DejalaUtils(); + $deliveries = array(); + $responseArray = $djlUtil->getStoreDeliveries($dejalaConfig, $deliveries, array('from_utc'=>$dateFrom, 'to_utc'=>$dateTo)); + if ($responseArray['status']='200') + { + $l_deliveries = array(); + header("Content-type: text/csv"); + header("Content-disposition: attachment; filename=\"deliveries.csv\""); + + foreach ($deliveries as $key=>$delivery) { + $l_delivery = doubleQuoteArray($delivery); + $l_delivery['price']=ereg_replace('\.', ',', $l_delivery['price']); + $l_delivery['creation_date'] = date('d/m/Y', $delivery['creation_utc']); + $l_delivery['creation_time'] = date('H\hi', $delivery['creation_utc']); + if (isset($delivery['shipping_start_utc'])) { + $l_delivery['shipping_date'] = date('d/m/Y', $delivery['shipping_start_utc']); + $l_delivery['shipping_start'] = date('H\hi', $delivery['shipping_start_utc']); + $l_delivery['shipping_stop'] = date('H\hi', (int)($delivery['shipping_start_utc']) + 3600*(int)($delivery['timelimit']) ); + } + else { + $delivery['shipping_date'] = ''; + $delivery['shipping_start'] = ''; + $delivery['shipping_stop'] = ''; + } + if (isset($l_delivery['delivery_utc'])) + { + $l_delivery['delivery_date'] = date('d/m/Y', $delivery['delivery_utc']); + $l_delivery['delivery_time'] = date('H\hi', $delivery['delivery_utc']); + } + $l_deliveries[$key] = $l_delivery; + } + $smarty->assign('deliveries', $l_deliveries); + $smarty->display(dirname(__FILE__).'/dejala_deliveries_csv.tpl'); + } + } diff --git a/modules/dejala/es.php b/modules/dejala/es.php new file mode 100644 index 000000000..1e3a92b58 --- /dev/null +++ b/modules/dejala/es.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Martes'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Miércoles'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Jueves'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sábado'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: transporte por mensajero'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Envia los pedidos de entrega a dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'El módulo necesita la extensión php Dejala cURL para funcionar'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'login requerido.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'contraseña requerida.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'país requerido.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'el login debe ser una dirección de correo electrónico válida.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Nombre de tienda requerido.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'no es un margen valido.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Se ha producido un error durante la autentificación de su cuenta en Dejala.com. Sus datos de autentificacón no se han reconocido.'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Imposible procesar la acción'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Por favor escoja otro login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'El servidor Dejala es inaccesible desde su servidor prestashop. Esto se debe posiblemente a un límite impuesto por su hosting. Contacte con el soporte técnico para preguntarle si su servidor se encuentra en medida de efectuar conexxiones HTTP de salida.'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Se ha producido un error al actualizar la localización'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Se ha producido un error al actualizar los contactos'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Se ha producido un error al actualizar los procesos'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Se ha producido un error al actualizar los productos'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Debe dar al menos una dirección email válida para restringir la visivilidad del módulo Dejala en su tienda'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Parámetros actualizados'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Este módulo requiere la extensión php cURL para funcionar corectamente. Por favor instale antes la extensión php \"cURL\".'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Se ha producido un error durante la autentificación de su cuenta en Dejala.com. Esto puede ser debido a un error de red o a un problema de plataforma. Inténtelo más tarde o contacte con Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Se ha producido un error al recuperar los datos. Inténtelo más tarde o contacte con Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Cuando quiera... Por mensajero'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Elegiré la hora de entrega cuando mi pedido esté listo.'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Entrega preferible el'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'a partir de '; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Entrega cuya fecha debe establecerse con el cliente.'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Pedido'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Pedido enviado a Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(IVA inc.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = '¡ Gratis !'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(IVA inc.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = '¡ Gratis !'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Dueño de la tienda'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Apellido:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Nombre:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Teléfono:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Teléfono móvil:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contacto de control de stock'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contacto con la Administración'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contacto con Mantenimiento del Sitio web '; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Su crédito'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Su crédito virtual (para simulación)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'euros'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Acreditar su cuenta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Lista de las ultimas entregas '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = '#'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Creación'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID de Pedido'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'N° de Tracking'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Etiqueta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Precio pagado (sin IVA)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Fecha de toma en cargo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'En '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'de'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Exportación Csv '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'Ok'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Fecha de creación'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'N° de Pedido'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'N° de Tracking'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'Descripción rapida'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Pecio pagado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Estado'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Fecha de Salida'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Plazo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Hora de Inicio'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'Hora máxima de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Fecha de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Hora de Entrega'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Preferencias de envío'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Su plazo de preparación de pedidos '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'inmediato ( < 20 mn )'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'medio dia'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'un dia'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'dias'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'DEJALA propondrá la entrega al cabo del plazo de preparación'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Proponer a sus clientes franjas horarias sobre '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'dias'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'Franja en dias dentro de la cual su cliente podrá elejir ser entregado. De forma general, DEJALA vendrá recojer el pedido el dia de la entrega.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Activar si fuera de stock'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Permite a los clientes elegir Dejala, incluso si un producto está agotadok (El cliente elegirá la fecha de la entrega cuando su pedido esté listo)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Entregue sus pedidos por mensajero con '; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = '¿ Nuevo ?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Su nombre de tienda :'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Escoja su País :'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'España'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Elija su login :'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Elija su contraseña :'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrarse'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ya dispongo de una cuenta para mi tienda :'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Login :'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Contraseña :'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Apúntarse'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Para recordar'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'El nombre de su tienda en'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Su login es'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Está en modo'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'SIMULACIÓN en la plataforma de Test'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'PRODUCCIÓN en la plataforma real'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Bascular al modo SIMULACIÓN'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Bascular al modo PRODUCCIÓN'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Su péticion para bascular al modo real se está procesando: DEJALA entrará en contacto con usted para finalizar el trámite.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Solicitar DEJALA para crear mi cuenta en producción'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Su crédito'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Su crédito virtual (para pruebas en modo simulación)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'euros'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Acreditar su cuenta'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala NO es visible por los usuarios'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala NO es visible por todos los usuarios'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala es visible únicamente por los sigueintes usuarios:'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = 'Por ej: a@foof.com, b@bar.com'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Actualizar la visibilidad'; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Indique la dirección del PUNTO DE SALIDA de las mercancias'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(sólo lectura en producción)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Localizar'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Empresa'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección (1)'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Dirección (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Código postal'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Ciudad'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Teléfono'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Teléfono móvil'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Stock'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contactos'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Casos de entrega'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Opciones de entrega'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Precios'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Historial de entregas'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Parámetros técnicos'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'El stock está abierto :'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Cómo actuar y con quien contactar en los casos siguientes '; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'No dude en modificar los procedimientos siguientes según sus imperativos comerciales y/o logísticos !'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Dirección del cliente erronea o no encontrada'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Cliente ausente al momento de la entrega'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Entrega denegada por el cliente'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Precauciones especiales con sus paquetes (fragilidad, embalaje, etc)'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Puede ajustar sur margen (ganar sobre el envio o tomar en cargo todo o parte del costo de envio) '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Destino del envio'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Precio que DEJALA le factura por el envio'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Su margen sobre el envio (IVA_incluido)'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Costo final del envio (añadido a la carrito)'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción de la prestación'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Compra sin IVA'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Compra IVA inc.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Venta sin IVA'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Venta IVA inc.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'En'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Estados que generan automaticamente un pedido de entrega por DEJALA '; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Cuando un pedido de entrega se valida, se le carga el coste a su cuenta DEJALA.'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Elegir el día de entrega'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Elegir la hora de entrega'; diff --git a/modules/dejala/fr.php b/modules/dejala/fr.php new file mode 100644 index 000000000..d1b7ef545 --- /dev/null +++ b/modules/dejala/fr.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'dejala.com : le transport par coursier'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Envoie les demandes de livraisons vers dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Le module nécessite l\'extension php Dejala cURL pour fonctionner correctement. Merci d\'installer l\'extension php \"curl \"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'Entrez votre nom d\'utilisateur'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'Entrez votre mot de passe'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'Merci de bien vouloir sélectionner un pays'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'Le nom d\'utilisateur doit être une adresse email valide'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Entrez le nom de votre boutique'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'n\'est pas une marge acceptée'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Une erreur est survenue lors de l\'authentification de votre compte sur Dejala.com. Vos informations d\'authentification n\'ont pas été reconnues.'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Impossible de réaliser cette action'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Ce login n\'est pas disponible. Merci de choisir un autre login.'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Serveur Dejala inaccessible depuis votre serveur Prestashop. Ceci est certainement dû à une limite imposée par votre hébergeur. Contactez le support technique de ce dernier pour lui demander si votre serveur est autorisé à effectuer des connexions HTTP sortantes.'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Une erreur est survenue lors de la mise à jour de l\'adresse'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Une erreur est survenue lors de la mise à jour des contacts'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Une erreur est survenue lors de la mise à jour des imprévus'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Une erreur est survenue lors de la mise à jour des produits'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Vous devez fournir au moins une adresse email pour restreindre la visibilité du module Dejala sur votre boutique'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Modifications prises en compte'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Ce module a besoin de l\'extension php \"cURL\" pour fonctionner correctement. Merci de bien vouloir installer l\'extension php \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Une erreur est survenue lors de l\'authentification de votre compte sur Dejala.com. Ceci peut être du à une erreur réseau ou à un problème de plate-forme. Réessayez plus tard ou contactez Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Une erreur est survenue lors de la récupération des informations. Réessayez plus tard ou contactez Dejala.com.'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quand vous voulez... Par coursier'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Je choisirai mon heure de livraison quand mon colis sera prêt.'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Livraison souhaitée le'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'à partir de'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Livraison dont la date doit être fixée avec le client.'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Commande envoyée à Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = 'HT'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = 'HT'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Gérant de la Boutique (signataire)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Nom'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Prénom'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Tél'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Mobile'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contact du Stock (point de départ)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contact Administratif et Financier'; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contact Expédition (suivi des livraisons)'; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Votre solde'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Votre solde fictif (pour la simulation)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'Euros (€)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Rechargez votre compte'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Liste des dernières commandes'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = '#'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Date de la commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID de la commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'N° de suivi Dejala'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Libellé'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix payé HT'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Etat '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Date prise en charge'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'En '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'de'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'à'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Exportation en CSV'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'A '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'OK'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'Date de création'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'ID commande'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'N° de suivi Dejala'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'description courte'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'Prix payé'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'Etat'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'Date de départ'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'Délai'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'Heure Début'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'heure max de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'Date de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'Heure de Livraison'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Préférences de livraison'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Votre temps de préparation de commande'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'immédiat (< 20 mn)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'une demi-journée'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'une journée'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'journées'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'Dejala proposera une livraison à l\'issue du temps de préparation'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Proposer à votre client des créneaux sur '; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'jours'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'C\'est le nombre de jours parmi lesquels votre client pourra choisir d\'être livré. D\'une manière générale, Dejala viendra chercher la commande le jour de la livraison.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Actif en hors stock'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Ceci permettra à vos clients de commander un coursier quand un produit est hors stock. Votre client choisira son créneau de livraison quand sa commande sera prête.'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Livrez vos clients par coursier avec '; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Nouveau ? '; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Nom de votre site'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Dans quel pays est votre entrepôt'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'France'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Espagne'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'votre login (votre E-Mail)'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Choisissez un mot de passe sur Dejala'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 's\'inscrire'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'je suis déjà inscrit sur DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'login'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'mot de passe Dejala'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 's\'identifier'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Pour mémoire'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Le nom de votre magasin est'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Votre login (E-Mail) est'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Vous êtes en mode'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'SIMULATION sur la plateforme de TEST'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'passer en mode SIMULATION'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'passer en mode PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'Votre demande de passage en production est en cours de traitement. DEJALA va vous contacter prochainement pour valider votre activation.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'je souhaite passer en PRODUCTION'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Votre solde'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Votre solde fictif (pour la simulation)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'Euros (€)'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Rechargez votre compte'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala n\'est PAS visible par vos utilisateurs'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala EST visible par tous vos utilisateurs'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala EST visible UNIQUEMENT par les utilisateurs suivants :'; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Par ex: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Mettre à jour la visibilité'; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Informations relatives au POINT DE DÉPART des marchandises'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(lecture seule)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Localiser'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Enseigne'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse (suite)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'Code Postal'; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Ville'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tél'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Mobile'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaire '; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer les modifications'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Stock'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contacts'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Gestion des imprévus'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Options de livraison'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Tarifs'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Historique de livraison'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Paramètres techniques'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Le stock est ouvert :'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Conduite à tenir et personnes à prévenir dans les cas suivants '; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'N\'hésitez pas à modifier les procédures ci-dessous en fonction de vos impératifs commerciaux ou logistiques.'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'L\'adresse de votre client est erronnée ou introuvable'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Votre client est absent au moment de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Votre client refuse la livraison'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Précautions particulières à prendre avec vos colis (fragilité, packaging, etc)'; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer ces modifications'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Vous pouvez ajuster votre marge (gagner sur la livraison ou prendre en charge tout ou partie du coût de livraison) '; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Destination de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Prix d\'achat de la livraison à DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Votre marge TTC sur la livraison'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Frais d\'expédition (ajoutés au panier)'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description de la prestation'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'achat HT'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'achat TTC'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'vente HT'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'vente TTC'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'Créneau de '; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer les modifications'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Liste des statuts qui valident automatiquement la commande de la course à DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Lorsqu\'une commande de course est validée, votre compte DEJALA est débité du montant de la course.'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mise à jour des statuts'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Choisissez le jour de la livraison'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Choisissez l\'heure de la livraison'; diff --git a/modules/dejala/google.gif b/modules/dejala/google.gif new file mode 100644 index 000000000..d24a14a90 Binary files /dev/null and b/modules/dejala/google.gif differ diff --git a/modules/dejala/install.sql b/modules/dejala/install.sql new file mode 100644 index 000000000..a8241a497 --- /dev/null +++ b/modules/dejala/install.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_dejala_cart` ( + `id_cart` int(10) unsigned NOT NULL, + `id_dejala_product` int(10) unsigned NOT NULL, + `shipping_date` int(11) NULL DEFAULT NULL, + `id_delivery` int(11) NULL DEFAULT NULL, + `mode` varchar(5) NULL DEFAULT 'TEST', + `cart_date_upd` datetime DEFAULT '0000-00-00 00:00:00', + `delivery_price` float DEFAULT NULL, + PRIMARY KEY (`id_cart`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/modules/dejala/it.php b/modules/dejala/it.php new file mode 100644 index 000000000..ada900a69 --- /dev/null +++ b/modules/dejala/it.php @@ -0,0 +1,187 @@ +dejala_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domenica'; +$_MODULE['<{dejala}prestashop>dejala_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunedi'; +$_MODULE['<{dejala}prestashop>dejala_5792315f09a5d54fb7e3d066672b507f'] = 'Martedì'; +$_MODULE['<{dejala}prestashop>dejala_796c163589f295373e171842f37265d5'] = 'Mercoledì'; +$_MODULE['<{dejala}prestashop>dejala_78ae6f0cd191d25147e252dc54768238'] = 'Giovedi'; +$_MODULE['<{dejala}prestashop>dejala_c33b138a163847cdb6caeeb7c9a126b4'] = 'Venerdì'; +$_MODULE['<{dejala}prestashop>dejala_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabato'; +$_MODULE['<{dejala}prestashop>dejala_9902522831a16af239ba868918f984c6'] = 'Dejala.com: consegna del corriere'; +$_MODULE['<{dejala}prestashop>dejala_69a226fe54256a93edb693bc97a7bcb5'] = 'Consente di gestire le consegne Dejala.com tramite corriere'; +$_MODULE['<{dejala}prestashop>dejala_f66e08578735b3cde28a2d8215b68a52'] = 'Il modulo Dejala richiede l\'estensione php cURL per funzionare correttamente. Si prega di installare l\'estensione php \"cURL\"'; +$_MODULE['<{dejala}prestashop>dejala_0e334c81db8c621e16d82618aaf746ab'] = 'login richiesto.'; +$_MODULE['<{dejala}prestashop>dejala_2a04cf556c49e32d4b4c46fd9b8bade5'] = 'è richiesta la password.'; +$_MODULE['<{dejala}prestashop>dejala_483cf1f6e275faa3c29ff20ba6e4407f'] = 'nazione richiesta.'; +$_MODULE['<{dejala}prestashop>dejala_2485b5c3212614c367f862a8e46f4d11'] = 'login deve essere un indirizzo e-mail valido.'; +$_MODULE['<{dejala}prestashop>dejala_dd189cdaa73e88a19f495a0d6c49a61b'] = 'Nome del negozio è obbligatorio.'; +$_MODULE['<{dejala}prestashop>dejala_4876f72a0b3d7f46de2b201ab02cd0a7'] = 'non è un margine valido.'; +$_MODULE['<{dejala}prestashop>dejala_ad5ee5e5c2989c1e72c586a9f8121716'] = 'Errore durante l\'autenticazione del tuo account su Dejala.com. Le tue credenziali non sono state riconosciute'; +$_MODULE['<{dejala}prestashop>dejala_23e0f5b7cc6e26112230c098b893944a'] = 'Impossibile elaborare l\'azione'; +$_MODULE['<{dejala}prestashop>dejala_6bd82dd0c6115429b03dd84828d6ccb2'] = 'Scegli un altro login'; +$_MODULE['<{dejala}prestashop>dejala_0aec12d0e7c8784012ee74606648d625'] = 'Dejala Server non raggiungibile dal tuo server Prestashop. Questo è certamente dovuto ad un limite impostato dal tuo hosting. Contatta il loro supporto tecnico e chiedi se il tuo server è autorizzato ad avviare le connessioni HTTP in uscita'; +$_MODULE['<{dejala}prestashop>dejala_f46fe05842135a72df96c3409cf00683'] = 'Errore durante l\'aggiornamento posizione'; +$_MODULE['<{dejala}prestashop>dejala_2f63af6e20f182573774b785515ccb95'] = 'Errore durante l\'aggiornamento dei contatti'; +$_MODULE['<{dejala}prestashop>dejala_3a29c6eb6abefd3d629290756168d892'] = 'Errore durante l\'aggiornamento dei processi'; +$_MODULE['<{dejala}prestashop>dejala_5f010efe1c8e6cb195205cbf864044aa'] = 'Errore durante l\'aggiornamento dei prodotti'; +$_MODULE['<{dejala}prestashop>dejala_004ac360e91b3dcf50a19a0fd09e3826'] = 'Devi fornire almeno un indirizzo email per limitare la visibilità di Dejala'; +$_MODULE['<{dejala}prestashop>dejala_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{dejala}prestashop>dejala_dfa53d8241c9f6908e669371b50e95f3'] = 'Questo modulo richiede l\'estensione PHP cURL per funzionare correttamente. Si prega di installare l\'estensione PHP \"cURL\" prima'; +$_MODULE['<{dejala}prestashop>dejala_4c7d16a1e83bcbfd9b33e95f8e90a625'] = 'Errore durante l\'autenticazione del tuo account su Dejala.com. Questo può essere dovuto a un problema temporaneo della rete o di piattaforma. Riprova più tardi o contatta Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_94939d114a8c65173b70b6e01aad11c0'] = 'Errore durante il recupero negozio, riprova più tardi o contatta Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_41d211dd68bf0f87cf3181b0c8dac6e7'] = 'Dejala.com'; +$_MODULE['<{dejala}prestashop>dejala_3d8764621d6076807b0d60cfcadb7213'] = 'Quando vuoi.... corriere'; +$_MODULE['<{dejala}prestashop>dejala_627db4c965627fb7f03682dbbc43a4a1'] = 'Seleziono la mia data di spedizione quando il mio prodotto è disponibile'; +$_MODULE['<{dejala}prestashop>dejala_07e9ea0147aee652244a280da00efb5a'] = 'Data di spedizione selezionata'; +$_MODULE['<{dejala}prestashop>dejala_47a4dfe5ab79feb7884fa57786ea587c'] = 'a partire da'; +$_MODULE['<{dejala}prestashop>dejala_ba93cc89ba75ee6e74699a49a69c0600'] = 'Data di spedizione non ancora selezionata dal cliente'; +$_MODULE['<{dejala}prestashop>dejala_a240fa27925a635b08dc28c9e4f9216d'] = 'Ordine'; +$_MODULE['<{dejala}prestashop>dejala_296a91ebe13e861efa9bd0f74a927353'] = 'Ordine inviato a Dejala'; +$_MODULE['<{dejala}prestashop>dejala_carrier_21034ae6d01a83e702839a72ba8a77b0'] = '(tasse escl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_21034ae6d01a83e702839a72ba8a77b0'] = '(tasse escl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; +$_MODULE['<{dejala}prestashop>dejala_carrier_nostock_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; +$_MODULE['<{dejala}prestashop>dejala_contacts_a766dcf63862aaaa1625a45169aeb37a'] = 'Proprietario negozio'; +$_MODULE['<{dejala}prestashop>dejala_contacts_4e140ba723a03baa6948340bf90e2ef6'] = 'Nome:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_d2cacc542d8dd31bd89f8defed1b55ad'] = 'Nome:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_673ae02fffb72f0fe68a66f096a01347'] = 'Telefono:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7a31464d87d555a1d5a7d2afdeb64d4e'] = 'Cellulare:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{dejala}prestashop>dejala_contacts_7e2121a0b71ccc33c5eeaf11999fdbcd'] = 'Contatto controllo magazzino'; +$_MODULE['<{dejala}prestashop>dejala_contacts_23e44d356bfc0d17f904cb743b4d247c'] = 'Contatto Amministrazione '; +$_MODULE['<{dejala}prestashop>dejala_contacts_527a0a71d5684695421ec3375ec6dba8'] = 'Contatto Manutenzione del sito web '; +$_MODULE['<{dejala}prestashop>dejala_contacts_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_9c8a7900448628ee2978be9a3945d148'] = 'Il tuo credito'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b0ee4c529eda15bdecda8bf189a3c813'] = 'Il tuo credito virtuale (come test)'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_defcb35db6f9bdac29b888bfc07e6386'] = 'euro'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Accredita il tuo account'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_642c4a47922246182590d4f3c8304f35'] = 'Elenco delle ultime consegne'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01abfc750a0c942167651c40d088531d'] = 'n.'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_67d5168b4f2b5424a3d118ea9ef99372'] = 'Creazione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2a033d36697bb24bfc7ece05545d268e'] = 'n. controllo ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b021df6aac4654c454f46c77646e745f'] = 'Etichetta'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_3601146c4e948c32b6424d2c0a7f0118'] = 'Prezzo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2ca8d70baf21b18878843c02a086e46c'] = 'In'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_d98a07f84921b24ee30f86fd8cd85c3c'] = 'da'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_01b6e20344b68835c5ed1ddedf20d531'] = 'a'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_427c7fb2385f610d26ea90fff86f9a84'] = 'Esportazione in Csv '; +$_MODULE['<{dejala}prestashop>dejala_deliveries_5da618e8e4b89c66fe86e32cdafde142'] = 'Da'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Per'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_a60852f204ed8028c1c58808b746d115'] = 'Ok'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8424d087ffe39bb2ee8db173c7e07ba5'] = 'data creazione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_2a033d36697bb24bfc7ece05545d268e'] = 'n. controllo ordine'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ac27812104f966f43d3a60f37a869338'] = 'descrizione breve'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_78a5eb43deef9a7b5b9ce157b9d52ac4'] = 'prezzo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_9acb44549b41563697bb490144ec6258'] = 'stato'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_1e6e6626b6e59276b14112ebc34c5d49'] = 'data consegna'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_c20456384feb648b4692b700ec570d42'] = 'limite tempo'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_5c5c8fc67b523e638e0a904d61651f2d'] = 'inizio spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_8e659923776b8706dbf4636c408e987c'] = 'fine spedizione'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_ba402b48292a61e4d82f85eeaa0904dc'] = 'data consegna'; +$_MODULE['<{dejala}prestashop>dejala_deliveries_csv_7c7f9f48d29519e8cb47ac606a431a65'] = 'ora consegna'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_617283f39e91b6ead659cef3c722cabc'] = 'Preferenze spedizione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_11d783488db0c358bd9077a2e1a250e7'] = 'Proponi spedizione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_ffe181130430aff6386df37df36347f8'] = 'immediatamente'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_a3cb1f2ebeda6fa36b27598f1d096f60'] = 'mezza giornata'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_849490640e65410418220e5c179a1477'] = 'un giorno'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44fdec47036f482b68b748f9d786801b'] = 'giorni'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_6749e3e07aeb12081dc32e581ffcf463'] = 'dopo l\'ordinazione'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_48b4a9d141bcbb3911caa5caf4b750b2'] = 'Visualizza'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_7877adcb96eb8221c075f0008093bbf7'] = 'date'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_b4f86cbc11cb9565374c08c61372f3ad'] = 'giorni nell\'interfaccia di selezione della fascia oraria'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_44a33a70398318da91b789b33152dafa'] = 'Mantenere Dejala attivo quando il carrello è non disponibile'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_767cd99c2f2b9fb9e5aa531c37b45f87'] = 'Abilitare i clienti a scegliere Dejala anche se un prodotto è esaurito (il cliente sceglierà la data della consegna quando l\'ordine sarà pronto)'; +$_MODULE['<{dejala}prestashop>dejala_delivery_options_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{dejala}prestashop>dejala_header_c45abd6f2b5f3b3a954c97f008ccb52c'] = 'Spedisci i tuoi ordini tramite corriere con'; +$_MODULE['<{dejala}prestashop>dejala_header_20e846b603a0b7f1c00b1fc457308fb7'] = 'DEJALA'; +$_MODULE['<{dejala}prestashop>dejala_home_21e71170be5450c6380d7a9fc0ba51c3'] = 'Sei nuovo su Dejala.fr?'; +$_MODULE['<{dejala}prestashop>dejala_home_07965cce4ec6247bd57783dff0af1657'] = 'Il nome del tuo negozio:'; +$_MODULE['<{dejala}prestashop>dejala_home_558f162b01a3d6d31865a1ca91a03d57'] = 'Seleziona il tuo paese:'; +$_MODULE['<{dejala}prestashop>dejala_home_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{dejala}prestashop>dejala_home_907eba32d950bfab68227fd7ea22999b'] = 'Spagna'; +$_MODULE['<{dejala}prestashop>dejala_home_a999205c014634072764fe3fadc4f4ca'] = 'Scegli il tuo login:'; +$_MODULE['<{dejala}prestashop>dejala_home_a7e4228de9b12575b0cd88c4cf0f54f9'] = 'Scegli la tua password:'; +$_MODULE['<{dejala}prestashop>dejala_home_0ba7583639a274c434bbe6ef797115a4'] = 'Registrati'; +$_MODULE['<{dejala}prestashop>dejala_home_72429bbc9acf8e6fcf6132ac1fa20d57'] = 'Ho già un account per il mio negozio:'; +$_MODULE['<{dejala}prestashop>dejala_home_051672911a3f1f05efba78a553ef6fe2'] = 'Login:'; +$_MODULE['<{dejala}prestashop>dejala_home_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; +$_MODULE['<{dejala}prestashop>dejala_home_e5b47edd743751a81819b7f421639303'] = 'Identificati'; +$_MODULE['<{dejala}prestashop>dejala_home_853fe2c3719fab6d1dde555eb536f649'] = 'Dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_home_02d222897fd57cbc8154be7b2c41e2ff'] = 'Come promemoria'; +$_MODULE['<{dejala}prestashop>dejala_home_3a40880c274dd353056ce584940d1ca8'] = 'Il tuo nome negozio è'; +$_MODULE['<{dejala}prestashop>dejala_home_55724d105b50b04063a21fba83236de6'] = 'Il tuo login è'; +$_MODULE['<{dejala}prestashop>dejala_home_bbb658f348426b60b3395d5357225112'] = 'Sei nella modalità'; +$_MODULE['<{dejala}prestashop>dejala_home_c8ab370eeab3cf4011e25fa953031e77'] = 'piattaforma di test'; +$_MODULE['<{dejala}prestashop>dejala_home_68279960d4eaab19115d276486e1e1d7'] = 'piattaforma di produzione'; +$_MODULE['<{dejala}prestashop>dejala_home_64baa4dba37ddc4207a777ac53565f06'] = 'Passa alla modalità di test'; +$_MODULE['<{dejala}prestashop>dejala_home_a0802ed7a4e243cc01699e44e0b0b33b'] = 'Passa alla modalità di produzione'; +$_MODULE['<{dejala}prestashop>dejala_home_104cdbe9fcaa62064ecc718b647c2929'] = 'La tua richiesta di modalità live è in fase di elaborazione: Dejala.fr ti contatterà per completare la registrazione.'; +$_MODULE['<{dejala}prestashop>dejala_home_1ccd621bb658777957a0c0ae95b97fc6'] = 'Andare live: chiedi a Dejala.fr di creare account in produzione.'; +$_MODULE['<{dejala}prestashop>dejala_home_9c8a7900448628ee2978be9a3945d148'] = 'Il tuo credito'; +$_MODULE['<{dejala}prestashop>dejala_home_b0ee4c529eda15bdecda8bf189a3c813'] = 'Il tuo credito virtuale (come test)'; +$_MODULE['<{dejala}prestashop>dejala_home_defcb35db6f9bdac29b888bfc07e6386'] = 'euro'; +$_MODULE['<{dejala}prestashop>dejala_home_c2b55c1a6a9880bf1d7cba1914a6da56'] = 'Accredita il tuo account'; +$_MODULE['<{dejala}prestashop>dejala_home_d33b3ef83df48e14035b6927a27a6824'] = 'Dejala NON è visibile a nessun utente'; +$_MODULE['<{dejala}prestashop>dejala_home_8ce5717d0efdee714d5c44eb72559943'] = 'Dejala E\' visibile a tutti gli utenti'; +$_MODULE['<{dejala}prestashop>dejala_home_97f9bae265c399ce4781878d46a5a733'] = 'Dejala E\' visibile SOLO per i seguenti utenti '; +$_MODULE['<{dejala}prestashop>dejala_home_66495952bdab30f6bdc92e318d4f36a6'] = '(Es: a@foo.com, b@bar.com)'; +$_MODULE['<{dejala}prestashop>dejala_home_e49df857f0f92d5dd2f73b9fa54d7308'] = 'Aggiorna la visibilità di Dejala '; +$_MODULE['<{dejala}prestashop>dejala_location_ce9142ea2df85cf8ea4dfda7164e7dcf'] = 'Si prega di specificare l\'indirizzo del tuo magazzino'; +$_MODULE['<{dejala}prestashop>dejala_location_c58b3ccfae7d8991a1bdf33f275d6007'] = '(solo lettura)'; +$_MODULE['<{dejala}prestashop>dejala_location_20dfc4f904ba3c650a578c41f87e7053'] = 'Individua'; +$_MODULE['<{dejala}prestashop>dejala_location_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Società'; +$_MODULE['<{dejala}prestashop>dejala_location_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{dejala}prestashop>dejala_location_783cb853aae6984e51583b3bb80c09d2'] = 'Indirizzo (2)'; +$_MODULE['<{dejala}prestashop>dejala_location_9b514b51d03075005814a33edc74c958'] = 'CAP '; +$_MODULE['<{dejala}prestashop>dejala_location_57d056ed0984166336b7879c2af3657f'] = 'Città'; +$_MODULE['<{dejala}prestashop>dejala_location_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefono'; +$_MODULE['<{dejala}prestashop>dejala_location_4e186c431f7c016c761c722debb9768e'] = 'Cellulare'; +$_MODULE['<{dejala}prestashop>dejala_location_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti'; +$_MODULE['<{dejala}prestashop>dejala_location_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_menu_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{dejala}prestashop>dejala_menu_ce5bf551379459c1c61d2a204061c455'] = 'Posizione'; +$_MODULE['<{dejala}prestashop>dejala_menu_9aa698f602b1e5694855cee73a683488'] = 'Contatti'; +$_MODULE['<{dejala}prestashop>dejala_menu_77ea79b4b2638f146bf02ea6dc076006'] = 'Processi'; +$_MODULE['<{dejala}prestashop>dejala_menu_3eb0f1d14d6ec438d91fcfdab94fc1ca'] = 'Opzioni di consegna'; +$_MODULE['<{dejala}prestashop>dejala_menu_e16dd6e118732c5d1586d6aba0b62f3a'] = 'Prezzi'; +$_MODULE['<{dejala}prestashop>dejala_menu_9bbd45bad55cfc620803907f2d8a0217'] = 'Contabilità'; +$_MODULE['<{dejala}prestashop>dejala_menu_36d5423bb12a6d74d1d0f0ba09ef47cb'] = 'Opzioni tecniche'; +$_MODULE['<{dejala}prestashop>dejala_menu_35cf95ca41b6d074cfaeac16b0e0906c'] = 'DEJALA PRO'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_845398bc903ec28114a5f9874d83936b'] = 'Magazzino aperto'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_2084c04f7a380a68b653e5fc82d352f0'] = 'De'; +$_MODULE['<{dejala}prestashop>dejala_picking_timetable_7fc56270e7a70fa81a5935b72eacbe29'] = 'A'; +$_MODULE['<{dejala}prestashop>dejala_processes_237527ad3e0c9d87f072f2ac3a873dc8'] = 'Specifica le procedure per gestire correttamente le consegne'; +$_MODULE['<{dejala}prestashop>dejala_processes_0f516eb68a85aae932001976c51dee2f'] = 'Sentiti libero di adattare le procedure di default per le procedure dei tuoi affari'; +$_MODULE['<{dejala}prestashop>dejala_processes_dbfdb39c2251ff72f42f7078ab347611'] = 'Indirizzo errato'; +$_MODULE['<{dejala}prestashop>dejala_processes_b1da17cfc7c9a051fe4ce45bf1dd1ace'] = 'Destinatario assente'; +$_MODULE['<{dejala}prestashop>dejala_processes_3ab0370c6e7c3d0ea1cd540e7afacc9a'] = 'Consegna respinta'; +$_MODULE['<{dejala}prestashop>dejala_processes_138a10902b1fec08bcf2d9f5a6f4b02b'] = 'Precauzioni per la consegna '; +$_MODULE['<{dejala}prestashop>dejala_processes_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_products_aa83582f6ce84345c97815de714e6ebd'] = 'Imposta i margini per le consegne'; +$_MODULE['<{dejala}prestashop>dejala_products_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{dejala}prestashop>dejala_products_26160d42b371fb091c142cb8cfa09c34'] = 'Prezzo di acquisto'; +$_MODULE['<{dejala}prestashop>dejala_products_f8ca05a1d72f37501747657deecdd15c'] = 'Margine tasse incluse'; +$_MODULE['<{dejala}prestashop>dejala_products_e6f254c2f6e55725e99e1e6dfd6d9caa'] = 'Prezzo cliente'; +$_MODULE['<{dejala}prestashop>dejala_products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{dejala}prestashop>dejala_products_1cdad1a5f8e5d09be270415e44c0f039'] = 'Acquista tasse escl.'; +$_MODULE['<{dejala}prestashop>dejala_products_ecef91ba37ffc5f5294ea50efee7c6a2'] = 'Acquista tasse incl.'; +$_MODULE['<{dejala}prestashop>dejala_products_765a24c102d9a0b03eb03c77e90a9144'] = 'Vendi tasse escl.'; +$_MODULE['<{dejala}prestashop>dejala_products_8588719c33b27bd80ae45cc533117c00'] = 'Vendi tasse incl.'; +$_MODULE['<{dejala}prestashop>dejala_products_efeb369cccbd560588a756610865664c'] = 'tra'; +$_MODULE['<{dejala}prestashop>dejala_products_2510c39011c5be704182423e3a695e91'] = 'h'; +$_MODULE['<{dejala}prestashop>dejala_products_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b44c4d973c20b84bad66d243b215ef37'] = 'Elenco di status che convalidano l\'ordine'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_a296002220093a4833752a3cf94f07d0'] = 'Elenco di status che attivano dejala.fr'; +$_MODULE['<{dejala}prestashop>dejala_technical_options_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dejala}prestashop>dejala_timetable_193993f964d2d4df4b1484227c1626b6'] = 'Scegli il tuo giorno di consegna'; +$_MODULE['<{dejala}prestashop>dejala_timetable_26903e0f192163f4a0957c0b185edf71'] = 'Scegli lai fascia oraria di consegna'; diff --git a/modules/dejala/logo.gif b/modules/dejala/logo.gif new file mode 100644 index 000000000..72db5e1a5 Binary files /dev/null and b/modules/dejala/logo.gif differ diff --git a/modules/dejala/picto_0.gif b/modules/dejala/picto_0.gif new file mode 100644 index 000000000..47feaa28f Binary files /dev/null and b/modules/dejala/picto_0.gif differ diff --git a/modules/dejala/picto_1.gif b/modules/dejala/picto_1.gif new file mode 100644 index 000000000..41827736c Binary files /dev/null and b/modules/dejala/picto_1.gif differ diff --git a/modules/dejala/picto_2.gif b/modules/dejala/picto_2.gif new file mode 100644 index 000000000..b018d159d Binary files /dev/null and b/modules/dejala/picto_2.gif differ diff --git a/modules/dejala/picto_3.gif b/modules/dejala/picto_3.gif new file mode 100644 index 000000000..2df2d0fd0 Binary files /dev/null and b/modules/dejala/picto_3.gif differ diff --git a/modules/dejala/picto_4.gif b/modules/dejala/picto_4.gif new file mode 100644 index 000000000..3853644d2 Binary files /dev/null and b/modules/dejala/picto_4.gif differ diff --git a/modules/dejala/picto_5.gif b/modules/dejala/picto_5.gif new file mode 100644 index 000000000..6eb0ee74b Binary files /dev/null and b/modules/dejala/picto_5.gif differ diff --git a/modules/dejala/picto_6.gif b/modules/dejala/picto_6.gif new file mode 100644 index 000000000..e3fdc0a08 Binary files /dev/null and b/modules/dejala/picto_6.gif differ diff --git a/modules/dejala/picto_7.gif b/modules/dejala/picto_7.gif new file mode 100644 index 000000000..932628548 Binary files /dev/null and b/modules/dejala/picto_7.gif differ diff --git a/modules/dejala/picto_8.gif b/modules/dejala/picto_8.gif new file mode 100644 index 000000000..f75ea966e Binary files /dev/null and b/modules/dejala/picto_8.gif differ diff --git a/modules/dejala/submenu-bg.gif b/modules/dejala/submenu-bg.gif new file mode 100644 index 000000000..c3de2cfc5 Binary files /dev/null and b/modules/dejala/submenu-bg.gif differ diff --git a/modules/dejala/timetable.css b/modules/dejala/timetable.css new file mode 100644 index 000000000..e34f693f2 --- /dev/null +++ b/modules/dejala/timetable.css @@ -0,0 +1,49 @@ +/* MFR081108 - Shipping Preferences */ +#shipping_now { + width:99%; + height:25px; + border:1px solid lightgrey; + margin-top:5; + padding-top:10px; +} + +#shipping_div { + width:100%; +} + +#shipping_dates { + width:100%; + float:left; + border:1px solid lightgrey; +} + +#shipping_dates div { + height:25px; + width:24.9%; + margin-top:5px; + float:left; + padding-top:10px; +} + +#shipping_hours { + float:left; + width:100%; + border:1px solid lightgrey; + margin-top:5px; +} + +#shipping_hours div { + height:31px; + width:19.9%; + float:left; + padding-top:10px; +} + +.title { + margin:5px; + font-size:1.1em; + font-weight:bold; + color:#993300; +} + +#shipping_pref input {border:none;} diff --git a/modules/dejala/timetable.js b/modules/dejala/timetable.js new file mode 100644 index 000000000..587f6a1a0 --- /dev/null +++ b/modules/dejala/timetable.js @@ -0,0 +1,104 @@ +/* Cache les heures non dispo pour le jour dayIndex */ +function hideUnusedHours(dayIndex){ + var i = 0; + var t_obj = document.getElementById('divhr0'); + + while (t_obj) + { + var cal = djl_calendar[dayIndex]; + var calStart = 0; + var calStop = 0; + if (cal) { + if (cal[2]) + calStart = djl_calendar[dayIndex][2]; + if (cal[3]) + calStop = djl_calendar[dayIndex][3]; + } + + if ( (i >= calStart) && (i <= calStop) ) { + t_obj.style.display = ''; + } else { + t_obj.style.display = 'none'; + } + i++; + t_obj = document.getElementById('divhr' + i); + } +} + +/* Sélectionne un des jours par son index */ +function selectDay(dayIndex) +{ + var i = 0; + var t_obj = document.getElementById('shipd0'); + var currentShipd = document.getElementById('shipd'+deliveryDateSelected); + if (currentShipd) { + currentShipd.parentNode.style.fontWeight=''; + currentShipd.parentNode.style.color = ''; + } + while (t_obj) + { + t_obj.checked = false; + if (i == dayIndex) + t_obj.checked = true; + i++; + t_obj = document.getElementById('shipd' + i); + } + deliveryDateSelected = dayIndex; + currentShipd = document.getElementById('shipd'+deliveryDateSelected); + if (currentShipd) { + currentShipd.parentNode.style.fontWeight='bold'; + currentShipd.parentNode.style.color = '#993300'; + } + hideUnusedHours(dayIndex); + + var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (!currentShipHr || currentShipHr.parentNode.parentNode.style.display == 'none') { + var cal = djl_calendar[dayIndex]; + var calStart = 9; + if (cal) { + if (cal[2]) + calStart = djl_calendar[dayIndex][2]; + selectHour(calStart); + } + } +} + + +function selectHour(hourIndex) +{ + var i = 0; + var t_obj = document.getElementById('shiphr0'); + var currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (currentShipHr) { + currentShipHr.parentNode.style.fontWeight=''; + currentShipHr.parentNode.style.color = ''; + } + while (t_obj) + { + t_obj.checked = false; + if (i == hourIndex) + t_obj.checked = true; + i++; + t_obj = document.getElementById('shiphr' + i); + } + deliveryHourSelected = hourIndex; + currentShipHr = document.getElementById('shiphr' + deliveryHourSelected); + if (currentShipHr) { + currentShipHr.parentNode.style.fontWeight='bold'; + currentShipHr.parentNode.style.color = '#993300'; + } +} + +/** + toggle element visibility : make it visible if to_which is 1 and element is not visible, otherwise make it invisible +**/ +function toggle_visibility(eltId, to_which) +{ + var elt = $('div#' + eltId) ; + if (to_which == 1 && elt.get(0).style.display == 'none') { + elt.slideDown(); + } + else if (to_which == 0 && elt.get(0).style.display != 'none') { + elt.slideUp(); + } +} diff --git a/modules/dibs/config.xml b/modules/dibs/config.xml new file mode 100644 index 000000000..82c382d81 --- /dev/null +++ b/modules/dibs/config.xml @@ -0,0 +1,11 @@ + + + dibs + DIBS + 1.0 + DIBS payment API + + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/dibs/de.php b/modules/dibs/de.php new file mode 100644 index 000000000..a03e28e3d --- /dev/null +++ b/modules/dibs/de.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS Zahlung API'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Aus Sicherheitsgründen müssen Sie die Schlüssel Nr. 1 und 2, die von der MD5-Kontrolle von DIBS API verwendet werden, einstellen.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Sie müssen Ihre Händler-ID einstellen, um DIBS API nutzen zu können.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Ein DIBS-Konto erhalten'; +$_MODULE['<{dibs}prestashop>dibs_2981c3142099b5653c220ac6ed2620c4'] = 'Bitte klicken Sie auf den folgenden Link, um aus dem DIBS-Anmeldeformular zuzugreifen:'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{dibs}prestashop>dibs_9a6126fa59acab742993a80fa0ca9340'] = 'Je nach Ihren Sprache und Länder-Regeln, kanndie Formular-Anmeldung unterschiedlich sein.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Bitte klicken Sie auf die entsprechende Flagge:'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Logo-Farbe'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'Die Grundfarbe des Logos, das auf der Zahlungsseite angezeigt wird.'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'Händler-ID'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Die von DIBS geschickte E-Mail sehen'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Sicherheitsschlüssel Nr. 1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Sicherheitsschlüssel Nr. 2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Diese Schlüssel werden für eine Verbesserung der Sicherheit eingesetzt.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Um diese Schlüssel zu erhalten, gehen auf die DIBS-Administrationsoberfläche zu Integration > MD5 Schlüsselmenü . Bitte stellen Sie sicher, dass die MD5-Kontrolle aktiviert ist, sonst funktioniert das Modul nicht .'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Verwenden Sie das DIBS-Testmodul'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Sobald dieses Feld mitgeteilt ist, wird die Transaktion nicht zum Karteninhaber weitergeleitet, sondern wird anstattdessen vom DIBS-Testmodul bearbeitet.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Siehe auch Schritt 5 der 10 Schritt-Anleitung für weitere Informationen.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Während Ihrer ersten Integration mit DIBS ist es nicht nötig, diese Einstellung einzugeben, da sämtliche Standardtransaktionen zunächst auf das DIBS-Testsystem treffen, bis DIBS die Integration genehmigt hat. Falls das Testsystem zu einem späteren Zeitpunkt verwendet wird, wird dies bei DIBS aktiviert (kontaktieren Sie den DIBS-Support, um das Testmodul Ihres Shops zu reaktivieren).'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Flexwin-Farbe'; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'Die Grundfarbe von FlexWin.'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Akzeptierte URL'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'Die URL der Seite, die angezeigt werden soll, wenn der Kauf genehmigt ist.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Gelöschte URL'; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'Die URL der Seite, die angezeigt werden soll, wenn der Kunde den Zahlungsvorgang abbricht.'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Mit dibs zahlen'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'dibs Logo'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Bezahlen Sie sicher und schnell mit dibs.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben bei Ihrer Bestellung ein Problem festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; diff --git a/modules/dibs/dibs.jpg b/modules/dibs/dibs.jpg new file mode 100644 index 000000000..31d9db63f Binary files /dev/null and b/modules/dibs/dibs.jpg differ diff --git a/modules/dibs/dibs.php b/modules/dibs/dibs.php new file mode 100644 index 000000000..82f4c6472 --- /dev/null +++ b/modules/dibs/dibs.php @@ -0,0 +1,392 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class dibs extends PaymentModule +{ + /** + * @var string set the merchant id sent by DIBS e-mail after subscription + * @staticvar + */ + public static $ID_MERCHANT; + + /** + * The URL of the page to be displayed if the purchase is approved. + * @var string + * @staticvar + */ + private static $ACCEPTED_URL = ''; + + /** + * The URL of the page to be displayed if the customer cancels the payment. + * @var string + * @staticvar + */ + private static $CANCELLED_URL = ''; + + /** + * Set the testing mode. + * @var string + */ + private static $TESTING; + + /** + * define more settings values, set for new version which probably. + * @var array + */ + public static $MORE_SETTINGS; + + /** + * @var string + * @staticvar + */ + private static $site_url; + /** + * Set the smarty object + * @var Smarty + */ + private $smarty; + + /** + * Only this langs array are allowed in DIBS API + * @var array + */ + private static $accepted_lang = array('da','en','es','fi','fo','fr','it','nl','no','pl','sv'); + + /** + * Formular link to DIBS subscription + * @var array + */ + public static $dibs_subscription_link = array( + 'en' => 'http://www.dibspayment.com/order/uk_request/', + 'da' => 'http://www.dibs.dk/bestil/step1/?productid=234&producttype=240', + 'sv' => 'http://www.dibs.se/bestall/step1/?productid=339&producttype=340', + 'no' => 'http://www.dibs.no/bestill/step1/?productid=349&producttype=350', + ); + public function __construct() + { + global $smarty; + $this->smarty = $smarty; + $this->name = 'dibs'; + $this->tab = 'payments_gateways'; + $this->version = '1.0'; + + parent::__construct(); + + $this->displayName = $this->l('DIBS'); + $this->description = $this->l('DIBS payment API'); + + if (self::$site_url === NULL) + self::$site_url = Tools::htmlentitiesutf8(Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__); + + self::$ID_MERCHANT = Configuration::get('DIBS_ID_MERCHANT'); + self::$ACCEPTED_URL = Configuration::get('DIBS_ACCEPTED_URL'); + self::$CANCELLED_URL = Configuration::get('DIBS_CANCELLED_URL'); + self::$TESTING = (int)Configuration::get('DIBS_TESTING'); + self::$MORE_SETTINGS = Configuration::get('DIBS_MORE_SETTINGS') != '' ? unserialize(Tools::htmlentitiesDecodeUTF8(Configuration::get('DIBS_MORE_SETTINGS'))) : array(); + + if (!isset(self::$MORE_SETTINGS['k1']) + OR (isset(self::$MORE_SETTINGS['k1']) AND (self::$MORE_SETTINGS['k1'] === '' OR self::$MORE_SETTINGS['k2'] === '') )) + $this->warning = $this->l('For security reasons, you must set key #1 and key #2 used by MD5 control of DIBS API.'); + if (!self::$ID_MERCHANT OR self::$ID_MERCHANT === '') + $this->warning = $this->l('You have to set your merchant ID to use DIBS API.'); + } + + public function install() + { + return (parent::install() + AND $this->registerHook('orderConfirmation') + AND $this->registerHook('payment') + AND Configuration::updateValue('DIBS_ACCEPTED_URL', self::$site_url.(substr(trim(self::$site_url), -1, 1) === '/' ? '' : '/').'order-confirmation.php') + AND Configuration::updateValue('DIBS_CANCELLED_URL', self::$site_url) + AND Configuration::updateValue('DIBS_TESTING', 1) + AND Configuration::updateValue('DIBS_MORE_SETTINGS', Tools::htmlentitiesUTF8(serialize(array('flexwin_color' => 'blue', 'logo_color' => 'black', 'k1' => '', 'k2' => ''))), true)); + } + + public function uninstall() + { + return (parent::uninstall() + AND Configuration::deleteByName('DIBS_ACCEPTED_URL') + AND Configuration::deleteByName('DIBS_ID_MERCHANT') + AND Configuration::deleteByName('DIBS_CANCELLED_URL') + AND Configuration::deleteByName('DIBS_TESTING') + AND Configuration::deleteByName('DIBS_MORE_SETTINGS')); + } + + public function hookOrderConfirmation($params) + { + if (!$this->active) + return; + if ($params['objOrder']->module != $this->name) + return; + + if ($params['objOrder']->valid) + $this->smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id)); + else + $this->smarty->assign('status', 'failed'); + return $this->display(__FILE__, 'hookorderconfirmation.tpl'); + } + + private function preProcess() + { + if (Tools::isSubmit('submitModule')) + { + self::$ID_MERCHANT = (Tools::getValue('idMerchant') !== '' ? Tools::getValue('idMerchant') : self::$ID_MERCHANT); + self::$ACCEPTED_URL = ((Validate::isUrl(Tools::getValue('acceptedUrl'))) ? Tools::getValue('acceptedUrl') : self::$ACCEPTED_URL); + self::$CANCELLED_URL = ((Validate::isUrl(Tools::getValue('cancelledUrl'))) ? Tools::getValue('cancelledUrl') : self::$CANCELLED_URL); + self::$TESTING = (int)isset($_POST['testing']); + self::$MORE_SETTINGS['flexwin_color'] = Tools::getValue('flexwin_color'); + self::$MORE_SETTINGS['logo_color'] = Tools::getValue('logo_color'); + self::$MORE_SETTINGS['k1'] = Tools::getValue('k1'); + self::$MORE_SETTINGS['k2'] = Tools::getValue('k2'); + + Configuration::updateValue('DIBS_ID_MERCHANT', self::$ID_MERCHANT); + Configuration::updateValue('DIBS_ACCEPTED_URL', self::$ACCEPTED_URL); + Configuration::updateValue('DIBS_CANCELLED_URL', self::$CANCELLED_URL); + Configuration::updateValue('DIBS_TESTING', self::$TESTING); + Configuration::updateValue('DIBS_MORE_SETTINGS', Tools::htmlentitiesUTF8(serialize(self::$MORE_SETTINGS))); + + $data_sync = ''; + if(self::$ID_MERCHANT !== '' AND self::$TESTING !== 1 AND self::$MORE_SETTINGS['k1'] !== '' AND self::$MORE_SETTINGS['k2'] !== '') + $data_sync = ''; + + echo '
        '.$this->l('Configuration updated').$data_sync.'
        '; + } + } + private function _displayPresentation() + { + $href = ''; + if (isset(dibs::$dibs_subscription_link[Configuration::get('PS_LANG_DEFAULT')])) + $href = dibs::$dibs_subscription_link[Configuration::get('PS_LANG_DEFAULT')]; + else + $href = dibs::$dibs_subscription_link['en']; + $out = ' +
        + '.$this->l('Get a DIBS account').' +

        + '.$this->l('Please click on the following link to access of DIBS formular subscription:') + .' » '.$this->l('Link').' « +

        +

        ' + .$this->l('Depending on language and country rules, formular subscription may be different.').'
        ' + .$this->l('Please click on the appropriate flags:').' '; + foreach (dibs::$dibs_subscription_link as $lang=>$url) + { + $out .= ''; + } + $out .= ' +

        +
        '; + return $out; + } + public function getContent() + { + $this->preProcess(); + + $flexwin_colors = array('sand', 'grey', 'blue'); + $logo_colors = array('yellow', 'grey', 'blue', 'black', 'purple', 'green'); + $str = '

        '.$this->displayName.'

        ' + .$this->_displayPresentation() + .'
        +
        +
        + '.$this->l('Settings').' + +
        '; + foreach ($logo_colors as $logo_color) + $str .= ' '.$logo_color.'
        '; + $str .= '

        '.$this->l('The basic color of the logo which appears on the payment page.').'

        +
        + +
        + +

        '.$this->l('See the e-mail sent by DIBS.').'

        +
        + +
        + +
        + +
        + +

        '.$this->l('These keys are used for security improvement.').'
        '.$this->l('To obtain these keys, go to the DIBS administration interface and under \'Integration\', select the MD5 Keys menu. Please ensure the MD5 control is activated, otherwise the module will not work.').'

        +
        + +
        + +

        '.$this->l('When this field is declared, the transaction is not dispatched to the card issuer, but is instead handled by the DIBS test module.') + .$this->l('See also Step 5 of the 10 Step Guide for more information.') + .' > '.$this->l('Link').'
        ' + .$this->l('During the initial integration with DIBS, there is no need to insert this parameter, since all default transactions will reach the DIBS test system until DIBS has approved integration. Should the test system be used at a later date, this will be activated at DIBS (contact DIBS support for reactivating the test mode of your shop).').'

        +
        + +
        '; + foreach ($flexwin_colors as $flexwin_color) + $str .= ' '.$flexwin_color.'
        '; + $str .= '

        '.$this->l('The basic color theme of FlexWin.').'

        +
        + +
        + +

        '.$this->l('URL of the page to be displayed if the purchase is approved.').'

        +
        + +
        + +

        '.$this->l('URL of the page to be displayed if the customer cancels the payment.').'

        +
        +
        +
        +
        '; + return $str; + } + public function hookPayment($params) + { + if ((self::$ID_MERCHANT === false || self::$ID_MERCHANT === '' || self::$ID_MERCHANT === NULL) + || (self::$ACCEPTED_URL === false || self::$ACCEPTED_URL === '' || self::$ACCEPTED_URL === NULL)) + return ''; + + $currency = new Currency(intval($params['cart']->id_currency)); + $lang = new Language(intval($params['cart']->id_lang)); + $customer = new Customer(intval($params['cart']->id_customer)); + $address = new Address(intval($params['cart']->id_address_invoice)); + $country = new Country(intval($address->id_country), intval($params['cart']->id_lang)); + $products = $params['cart']->getProducts(); + + $dibsParams = array(); + + // Required + $dibsParams['merchant'] = self::$ID_MERCHANT; // id merchant send from DIBS e-mail + + // don't cast to int !! It has strange behaviour (really strange) + // for example : When calculate a total amount of 557.05, the result is 55704 after casting !! + $dibsParams['amount'] = $params['cart']->getOrderTotal(true, Cart::BOTH) * 100; // The smallest unit of an amount, cent for EUR + $dibsParams['accepturl'] = self::$ACCEPTED_URL.'?id_cart='.(int)($params['cart']->id).'&id_module='.(int)($this->id).'&key='.$customer->secure_key; // The URL of the page to be displayed if the purchase is approved. + $dibsParams['orderid'] = $params['cart']->id.'_'.date('YmdHis'); // The shop's order number for this particular puchase. It can be seen later when payment is captured, and will in some instances appear on the customer's bank statement (max. 50 characters, both numerals and letters may be used). + $currency_num = 0; + + // for 1.3 compatibility + if(!isset($currency->iso_code_num) OR $currency->iso_code_num == '') + { + $array_currency_iso_num = array( + 'DKK' => 208, + 'EUR' => 978, + 'USD' => 840, + 'GBP' => 826, + 'SEK' => 752, + 'AUD' => 036, + 'CAD' => 124, + 'ISK' => 352, + 'JPY' => 392, + 'NZD' => 554, + 'NOK' => 578, + 'CHF' => 756, + 'TRY' => 949, + ); + $currency_num = $array_currency_iso_num[$currency->iso_code]; + } + else + $currency_num = $currency->iso_code_num; + $dibsParams['currency'] = (int)$currency_num; // Currency specification as indicated in ISO4217 where the EUR is no. 978 + + // optional + $dibsParams['test'] = (self::$TESTING === 1) ? 'yes' : 'no'; // optional - This field is used when tests are being conducted on the shop (e.g. test=yes). When this field is declared, the transaction is not dispatched to the card issuer, but is instead handled by the DIBS test module. See also Step 5 of the 10 Step Guide for more information. During your initial integration with DIBS, there is no need to insert this parameter, since all default transactions will hit the DIBS test system until DIBS has approved integration. Should the test system be used at a later date, this will be activated at DIBS (contact DIBS support for reactivating the test mode of your shop). + $dibsParams['lang'] = in_array(strtolower($lang->iso_code), self::$accepted_lang) ? $lang->iso_code : ''; // optional - This parameter determines the language in which the page will be opened. The following values are accepted: da=Danish en=English es=Spanish fi=Finnish fo=Faroese fr=French it=Italian nl=Dutch no=Norwegian pl=Polish (simplified) sv=Swedish Default language is Danish. + $dibsParams['color'] = self::$MORE_SETTINGS['flexwin_color']; // optional - The basic color theme of FlexWin. There is currently a choice of "sand", "grey" and "blue". The default value is "blue". + $dibsParams['cancelurl'] = self::$CANCELLED_URL; // optional - The URL of the page to be displayed if the customer cancels the payment. + $dibsParams['uniqueoid'] = (int)($params['cart']->id).'_'.date('YmdHis').'_'.$params['cart']->secure_key; // optional - If this field exists, the orderid-field must be unique, i.e. there is no existing transaction with DIBS with the same order number. If such a transaction already exists, payment will be rejected with reason=7. Unless you are unable to generate unique order numbers, we strongly urge you to utilize this field.Note: Order numbers can be composed of a maximum of 50 characters (DIBS automatically removes surplus characters) and that uniqueoid is therefore unable to work as intended if order numbers consisting of more than 50 characters are used. + $dibsParams['callbackurl'] = self::$site_url.'modules/'.$this->name.'/validation.php'; // optional - An optional �server-to-server� call which tells the shop�s server that payment was a success. Can be used for many purposes, the most important of these being the ability to register the order in your own system without depending on the customer�s browser hitting a specific page of the shop. See also HTTP_COOKIE. + $dibsParams['HTTP_COOKIE'] = urlencode((string)serialize($params['cookie'])); // optional - Cookies/sessions which are to be sent to callbackurl. Must be sent along if you are using callbackurl and depend on cookies/sessions for keeping track of the user. Read how this is carried out in the description of automatic call-back further down this page. + $md5_params = 'merchant='.self::$ID_MERCHANT.'&orderid='.$dibsParams['orderid'].'¤cy='.$dibsParams['currency'].'&amount='.$dibsParams['amount']; + $dibsParams['md5key'] = md5(self::$MORE_SETTINGS['k2'].md5(self::$MORE_SETTINGS['k1'].$md5_params)); // optional - This variable enables a MD5 key control of the values received by DIBS. This control confirms that the values sent to DIBS has not been tampered with during the transfer. The MD5 key is calculated as: MD5(key2 + MD5(key1 + "merchant=&orderid=&transact=")) Where key1 and key2 are shop specific keys available through the DIBS administration interface, and + is the concatenation operator. NB! MD5 key check must also be enabled through the DIBS administration interface in order to work. Further details on MD5-key control. + + // @todo need more infos. + $dibsParams['account'] = ''; // optional - If multiple departments utilize the company's acquirer agreement with PBS, it may prove practical to keep the transactions separate at DIBS. An "account number" may be inserted in this field, so as to separate transactions at DIBS. + $dibsParams['calcfee'] = ''; // optional - If this parameter is set (e.g. calcfee=foo), the charge due to the transaction will automatically be calculated and affixed, i.e., the charge payable to the acquirer (e.g. PBS) + $dibsParams['capturenow'] = ''; // optional - If this field exists, an "instant capture" is carried out, i.e. the amount is immediately transferred from the customer's account to the shop's account. This function can only be utilized in the event that there is no actual physical delivery of any items. Contact DIBS when using this function. (Note that instant capture requires unique order numbers - also see the description of uniqueoid above). + $dibsParams['ip'] = ''; // optional - DIBS retains the IP-number from which a card transaction is carried out. The IP-number is used for �fraud control�, etc. Some implementations may send the IP number of the shop to DIBS rather than that of the customer's machine. In order to provide the same services to shops which utilize such a program for their DIBS hookup, we offer the option of sending the "ip" parameter. + $dibsParams['paytype'] = ''; // optional - Regarding the start-up of the DIBS FlexWin, the user can be limited to the use of just one particular payment form. This is accomplished by using the parameter "paytype". This function can be used if you wish for example to use integration method 3 for payment cards and method 1 for eDankort. Furthermore, this function can be used if you wish to control the user's selections of method of payment from your own website. You can also specify a list of payment methods that will be shown in the Flexwin. This list should be a comma separated with no spaces in between. Example: See our list of possible paytypes. + $dibsParams['maketicket'] = ''; // optional - This parameter is intended for FlexWin, and actually performs two transactions. First it performs a regular authorisation. If, and only if, it is accepted, it is followed by a ticket registration. Both a transaction and a ticket value are returned to "accepturl" if it is specified. If "callbackurl" is specified, DIBS will perform two separate calls, corresponding to performing two transactions - one call to the regular authorisation, and another to the ticket registration. Both cases return a "transact" parameter value (e.g. transact="78901234"). In calls to "callbackurl" containing "preauth", the ticket value is composed of the "transact" parameter value. "maketicket" implicitly sets the "preauth" parameter - however, you should avoid to explicitly specify any "preauth" parameter. You cannot use "uniqueoid", "capturenow" or "md5key" along with "maketicket". Currently "maketicket" does not work with 3Dsecure. + $dibsParams['postype'] = ''; // optional - "postype" (one 't') is used when one wishes to register the transaction origin. For normal internet transaction it is not required to include "postype", as it is automatically set to SSL. Possible values are: ssl = internet transactions, magnetic = magnetic stripe read, and signature is available, magnosig = magnetic stripe read, and no signature is available, mail = mail order, manual = manually entered, phone = phone order, signature = card and signature available, manually entered. + $dibsParams['ticketrule'] = ''; // optional - Set the value of this parameter to the same as defined by you in DIBS Admin. + $dibsParams['preauth'] = ''; // optional - When preauth=true is sent as part of the request to auth.cgi the DIBS server identifies the authorisation as a ticket authorisation rather than a normal transaction. Please note that the pre-authorised transaction is NOT available among the transactions in the DIBS administration interface. When using MD5 the Authkey must be calculated from the string transact=12345678&preauth=true¤cy=123 + + // @todo Since Prestashop manage vouchers, ask if necessary to use this params + $dibsParams['voucher'] = ''; // optional - If set to "yes", then the list of payment types on the first page of FlexWin will contain vouchers, too. If FlexWin is called with a paytype, which would lead directly to the payment form, the customer is given the choice of entering a voucher code first. + $dibsParams['split'] = ''; // optional - "split" is used for splitting up a transaction into two or more sub-transactions. This enables part of an order to be paid for when shipped in part. It requires that the amount and currency of the part payments are known at the time of the order, and are posted to the DIBS server as: split=2&amount1=&amount2= + + // to erase optional params which are not filled + $dibsParams = array_filter($dibsParams); + + /* Order Information as "complex model" : + * -------------------------------------- */ + + // delivery params + $dibsParams['delivery1.Name'] = $address->firstname.' '.$address->lastname; + $dibsParams['delivery2.Address'] = $address->address1; + $dibsParams['delivery3.Address2'] = $address->address2; + $dibsParams['delivery4.Postcode'] = $address->postcode; + $dibsParams['delivery5.City'] = $address->city; + $dibsParams['delivery6.Comment'] = $address->other; + $dibsParams['delivery7.Phone'] = $address->phone; + $dibsParams['delivery8.Company'] = $address->company; + + // order line (product list) + $dibsParams['ordline0-1'] = 'Product ref / Product Id'; + $dibsParams['ordline0-2'] = 'Name'; + $dibsParams['ordline0-3'] = 'Description'; + $dibsParams['ordline0-4'] = 'Unit price with tax'; + $dibsParams['ordline0-5'] = 'Total price with tax'; + $dibsParams['ordline0-6'] = 'Quantity'; + $dibsParams['ordline0-7'] = 'Weight'; + $dibsParams['ordline0-8'] = 'ecotax'; + + $count_products = 1; + foreach ($products as $key => $product) + { + $dibsParams['ordline'.$count_products.'-1'] = 'ref.'.($product['reference'] != '' ? $product['reference'] : 'NC' ).'/id.'.$product['id_product']; + $dibsParams['ordline'.$count_products.'-2'] = $product['name']; + $dibsParams['ordline'.$count_products.'-3'] = strip_tags($product['description_short']); + $dibsParams['ordline'.$count_products.'-4'] = $product['price_wt']; + $dibsParams['ordline'.$count_products.'-5'] = $product['total_wt']; + $dibsParams['ordline'.$count_products.'-6'] = $product['cart_quantity']; + $dibsParams['ordline'.$count_products.'-7'] = $product['weight']; + $dibsParams['ordline'.$count_products.'-8'] = $product['ecotax']; + $count_products++; + } + + // Price info + $dibsParams['priceinfo1.Deliverycosts'] = $params['cart']->getOrderTotal(true, Cart::ONLY_SHIPPING); + $dibsParams['priceinfo2.ProductsAmount'] = $params['cart']->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING); + $dibsParams['priceinfo3.AmountWithoutTax'] = $params['cart']->getOrderTotal(false, Cart::BOTH); + $dibsParams['priceinfo4.AmountTotalTax'] = (float)($params['cart']->getOrderTotal(true, Cart::BOTH) - $params['cart']->getOrderTotal(false, Cart::BOTH)); + $this->smarty->assign('p', $dibsParams); + $this->smarty->assign('logo_color', self::$MORE_SETTINGS['logo_color']); + return $this->display(__FILE__, 'dibs.tpl'); + } +} diff --git a/modules/dibs/dibs.tpl b/modules/dibs/dibs.tpl new file mode 100644 index 000000000..ddc262414 --- /dev/null +++ b/modules/dibs/dibs.tpl @@ -0,0 +1,13 @@ +

        + + {l s='dibs logo' mod='dibs'} + {l s='Pay with dibs' mod='dibs'}
        {l s='Pay safely and quickly with dibs.' mod='dibs'}
        +

        + +
         
        +

        +
        +{foreach from=$p key=k item=v} + +{/foreach} +
        \ No newline at end of file diff --git a/modules/dibs/es.php b/modules/dibs/es.php new file mode 100644 index 000000000..9a6156dc9 --- /dev/null +++ b/modules/dibs/es.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS API de pago'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Por razones de seguridad, debe grabar las claves 1 y 2 utilizadas por el control MD de el API de DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Debe registrar su ID vendedor para utilizar el API de DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración modificada'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Obtenir una cuenta DIBS'; +$_MODULE['<{dibs}prestashop>dibs_2981c3142099b5653c220ac6ed2620c4'] = 'Pulse en el siguiente link para acceder al formulario de inscripción DIBS:'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{dibs}prestashop>dibs_9a6126fa59acab742993a80fa0ca9340'] = 'Según su idioma y la legislación de su país, el formulario de inscripción puede ser diferente.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Pulse en la bandera correspondiente:'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuraciones'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Color del logo'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'El color básico del logo que aparece en la página de pago'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'id del vendedor'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Mirar el email enviado por DIBS'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Clave de seguridad n°1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Clave de seguridad n°2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Estas claves se utilizan para mejorar la seguridad.Estas claves se utilizan para mejorar la seguridad.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Para obtener estas claves ir a la interfaz de administración DIBS y a Integración > Menú de claves MD5. Por favor, asegúrese de que el control MD5 esté activo, de lo contrario el módulo no funcionará.'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Utilizar el módulo de test de DIBS'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Cuando este campo está declarado, la transacción no se envía al remitente de la carta sino al módulo de test de Twenga.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Mirar también la etapa 5 de la guía en 10 etapas para más información.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Durante su primera integración con DIBS, no necesita utilizar dicho parámetro, ya que todas las transacciones por defecto van a utilizar el sistema de test hasta que la integración del sitio no haya sido aprobada por DIBS. Si el sistema de test debe utilizarse posteriormente, puede activarse en DIBS (contacte con el soporte DIBS para reactivar el modo de test en su tienda)'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Color de Flexwin'; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'El color del tema de Flexwi'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Url de aceptación'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'La URL de la página que aparece si el pago es aceptado.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Anular la URL'; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'La URL de la página que aparecerá si el usuario anula el pago'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Modificar las configuraciones'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Pagar con DIBS'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'Logo de DIBS'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Pagar rápidamente de manera segura con DIBS'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'está terminado.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Le enviaremos su pedido cuanto antes.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta o para más información, póngase en contacto con nuestro'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio clientela'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos observado un problema con su pedido. Si piensa que se trata de un error, puede ponerse en contacto con nuestro'; diff --git a/modules/dibs/fr.php b/modules/dibs/fr.php new file mode 100644 index 000000000..14e662da6 --- /dev/null +++ b/modules/dibs/fr.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS API de paiement'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Pour des raisons de sécurité, vous devez enregistrer les clefs numéro 1 et 2 utilisées par le controle MD de l\'API DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Vous devez enregistrer votre ID marchand pour utiliser l\'API de DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration modifié'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Obtenir un compte DIBS'; +$_MODULE['<{dibs}prestashop>dibs_2981c3142099b5653c220ac6ed2620c4'] = 'Veuillez cliquer sur le lien suivant pour accéder au formulaire de souscription DIBS :'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Lien'; +$_MODULE['<{dibs}prestashop>dibs_9a6126fa59acab742993a80fa0ca9340'] = 'Selon votre langage et les lois de votre pays, le formulaire de souscription pourrait être différent.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Veuillez cliquer sur le drapeau approprié :'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Configurations'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Couleur du logo'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'La couleur basique du logo qui apparait sur la page de paiement'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'id du Marchand'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Regarder l\'e-mail envoyé par DIBS'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Clé de sécurité n°1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Clé de sécurité n°2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Ces clefs sont utilisées pour améliorer la sécurité.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Afin de récupérer ces clefs, rendez-vous sur l\'interface d\'administration de DIBS, dans le menu \"Integration\" > \"MD5 keys\". N\'oubliez pas de vérifier si le contrôle MD5 est activé, auquel cas le module ne sera pas opérationnel.'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Utiliser le module de test de DIBS'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Quand ce champ est déclaré, la transaction n\'est pas envoyée à l\'émetteur de la carte, mais est envoyé au module de test de DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Regarder aussi l\'étape 5 du guide en 10 étapes pour plus d\'informations.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Lors de votre première intégration avec DIBS, vous n\'avez pas besoin d\'utiliser ce paramètre, puisque toute les transactions par défaut vont utiliser le système de test tant que l\'intégration du site n\'a pas été approuvée par DIBS. Si le système de test doit être utilisé plus tard, il peut être activé chez DIBS (contactez le support DIBS pour réactiver le mode de test sur votre boutique)'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Couleur de Flexwin'; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'La couleur du thême de Flexwin'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Url d\'acceptation'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'L\'url de la page qui sera appelé une fois le paiement accepté.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Url d\'annulation'; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'L\'url de la page qui sera appelé si l\'utilisateur annule le paiement'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Modifier les configurations'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Payer avec DIBS'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'Logo de DIBS'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Payer rapidement et de manière sécurisé avec DIBS'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est terminée. '; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Votre commande vous sera envoyée dès que possible. '; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou pour de plus amples renseignements, merci de communiquer avec notre '; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'service client'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons remarqué un problème avec votre commande. Si vous pensez que c\'est une erreur, vous pouvez contacter notre'; diff --git a/modules/dibs/hookorderconfirmation.tpl b/modules/dibs/hookorderconfirmation.tpl new file mode 100644 index 000000000..2e4b6a636 --- /dev/null +++ b/modules/dibs/hookorderconfirmation.tpl @@ -0,0 +1,11 @@ +{if $status == 'ok'} +

        {l s='Your order on' mod='dibs'} {$shop_name} {l s='is complete.' mod='dibs'} +

        {l s='Your order will be sent as soon as possible.' mod='dibs'} +

        {l s='For any questions or for further information, please contact our' mod='dibs'} {l s='customer support' mod='dibs'}. +

        +{else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='dibs'} + {l s='customer support' mod='dibs'}. +

        +{/if} \ No newline at end of file diff --git a/modules/dibs/img/da.jpg b/modules/dibs/img/da.jpg new file mode 100644 index 000000000..add78c626 Binary files /dev/null and b/modules/dibs/img/da.jpg differ diff --git a/modules/dibs/img/en.jpg b/modules/dibs/img/en.jpg new file mode 100644 index 000000000..72b962fa6 Binary files /dev/null and b/modules/dibs/img/en.jpg differ diff --git a/modules/dibs/img/no.jpg b/modules/dibs/img/no.jpg new file mode 100644 index 000000000..82311e5ae Binary files /dev/null and b/modules/dibs/img/no.jpg differ diff --git a/modules/dibs/img/sv.jpg b/modules/dibs/img/sv.jpg new file mode 100644 index 000000000..28f0b03ef Binary files /dev/null and b/modules/dibs/img/sv.jpg differ diff --git a/modules/dibs/it.php b/modules/dibs/it.php new file mode 100644 index 000000000..195107780 --- /dev/null +++ b/modules/dibs/it.php @@ -0,0 +1,43 @@ +dibs_b508edd89d96e13df300b298143998d3'] = 'DIBS'; +$_MODULE['<{dibs}prestashop>dibs_ef3a95ad5c00ef1b4d1d73d2b50bf54c'] = 'DIBS pagamento API'; +$_MODULE['<{dibs}prestashop>dibs_f146cc67c82721f372d15664a9e4a0d6'] = 'Per ragioni di sicurezza devi impostare la chiave n. 1 e n. 2 utilizzate dal controllo MD5 di DIBS API.'; +$_MODULE['<{dibs}prestashop>dibs_94c824556baeddc9d8a31710c38fb045'] = 'Devi impostare il tuo ID commerciante per utilizzare DIBS API.'; +$_MODULE['<{dibs}prestashop>dibs_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{dibs}prestashop>dibs_323d72a644340f9f2152febe46a52259'] = 'Ottieni un account DIBS'; +$_MODULE['<{dibs}prestashop>dibs_2981c3142099b5653c220ac6ed2620c4'] = 'Clicca sul link seguente per accedere al modulo di abbonamento DIBS :'; +$_MODULE['<{dibs}prestashop>dibs_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{dibs}prestashop>dibs_9a6126fa59acab742993a80fa0ca9340'] = 'A seconda della lingua e delle regole del tuo paese, il modulo di sottoscrizione potrebbe essere diverso.'; +$_MODULE['<{dibs}prestashop>dibs_d076f6d79396f176263a61ad3a1fe945'] = 'Clicca sulle bandiere corrette:'; +$_MODULE['<{dibs}prestashop>dibs_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{dibs}prestashop>dibs_794b8837b6ee6ddc4301f557915f9486'] = 'Colore logo'; +$_MODULE['<{dibs}prestashop>dibs_44e1ec6255a91754e4911b16b9fc4d22'] = 'Il colore di base del logo che appare sulla pagina di pagamento.'; +$_MODULE['<{dibs}prestashop>dibs_229a7ec501323b94db7ff3157a7623c9'] = 'ID commerciante'; +$_MODULE['<{dibs}prestashop>dibs_b305acae66879c527cda4c4ded662585'] = 'Vedi l\'e-mail inviata da DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_310fc01b7a8c167aa514ccccc9e46e99'] = 'Chiave di sicurezza n. 1'; +$_MODULE['<{dibs}prestashop>dibs_247cc6885be1cb649d05acf81242cc35'] = 'Chiave di sicurezza n. 2'; +$_MODULE['<{dibs}prestashop>dibs_c7138fc31d63f966e368147a0cd4e55d'] = 'Queste chiavi sono usate per migliorare la sicurezza.'; +$_MODULE['<{dibs}prestashop>dibs_b89642757f7199e37e74dd6a9a333733'] = 'Per ottenere queste chiavi vai all\'interfaccia di amministrazione DIBS e nel menu Integrazione > chiavi MD5 . Assicurati che il controllo MD5 sia attivato, altrimenti il modulo non funzionerà.'; +$_MODULE['<{dibs}prestashop>dibs_f9986472f2190b1ec04c52dd1eca1af4'] = 'Usa il modulo di test DIBS'; +$_MODULE['<{dibs}prestashop>dibs_313ada9ae4162978238c99d505bb6870'] = 'Quando questo campo è dichiarato, la transazione non viene inviata all\'emittente della carta, ma è invece gestita dal modulo di prova DIBS.'; +$_MODULE['<{dibs}prestashop>dibs_41f538d798be040c3710e4e128105ad2'] = 'Per ulteriori informazioni vedi anche la Fase 5 della Guida in 10 Fasi.'; +$_MODULE['<{dibs}prestashop>dibs_9d0ac8297882a62456cd41249c36d9af'] = 'Durante la tua prima integrazione con DIBS, non vi è alcuna necessità di inserire questo parametro, dal momento che tutte le operazioni di default riguarderanno il sistema di test DIBS fino a che DIBS ha approvato l\'integrazione. Qualora il sistema di test fosse utilizzato in un secondo momento, questo sarà attivato a DIBS (contatta il supporto DIBS per riattivare la modalità di prova del tuo negozio) .'; +$_MODULE['<{dibs}prestashop>dibs_58768109d694bef3c059544892118901'] = 'Colore Flexwin '; +$_MODULE['<{dibs}prestashop>dibs_37b0d284e5d29973b385ca537272ec38'] = 'Il tema colore base di FlexWin.'; +$_MODULE['<{dibs}prestashop>dibs_2e2b79996d4fb73bff9b97725ddfbab8'] = 'Url accettato'; +$_MODULE['<{dibs}prestashop>dibs_0e260f9297ec338abbf671829d53c4ae'] = 'L\'URL della pagina da visualizzare se l\'acquisto è approvato.'; +$_MODULE['<{dibs}prestashop>dibs_fcb9c3f1b9731de08442d81583782db7'] = 'Url annullato '; +$_MODULE['<{dibs}prestashop>dibs_491f74497aaca60ae31a327d12d52925'] = 'L\'URL della pagina da visualizzare se il cliente annulla il pagamento.'; +$_MODULE['<{dibs}prestashop>dibs_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{dibs}prestashop>dibs_b64af11b4f643164b0b418c716a6f7a0'] = 'Paga con dibs'; +$_MODULE['<{dibs}prestashop>dibs_fda89beb6740540db1053016d96624c3'] = 'logo dibs'; +$_MODULE['<{dibs}prestashop>dibs_eeaf35c1eb180cc38a77b892a96d7ed3'] = 'Paga in modo sicuro e veloce con dibs.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine '; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{dibs}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, contatta la nostra'; diff --git a/modules/dibs/logo.gif b/modules/dibs/logo.gif new file mode 100644 index 000000000..f658014e3 Binary files /dev/null and b/modules/dibs/logo.gif differ diff --git a/modules/dibs/logos/dibs_black.jpg b/modules/dibs/logos/dibs_black.jpg new file mode 100644 index 000000000..3b3159dab Binary files /dev/null and b/modules/dibs/logos/dibs_black.jpg differ diff --git a/modules/dibs/logos/dibs_blue.jpg b/modules/dibs/logos/dibs_blue.jpg new file mode 100644 index 000000000..cb55d111d Binary files /dev/null and b/modules/dibs/logos/dibs_blue.jpg differ diff --git a/modules/dibs/logos/dibs_green.jpg b/modules/dibs/logos/dibs_green.jpg new file mode 100644 index 000000000..14a812d82 Binary files /dev/null and b/modules/dibs/logos/dibs_green.jpg differ diff --git a/modules/dibs/logos/dibs_grey.jpg b/modules/dibs/logos/dibs_grey.jpg new file mode 100644 index 000000000..a8263d9b3 Binary files /dev/null and b/modules/dibs/logos/dibs_grey.jpg differ diff --git a/modules/dibs/logos/dibs_purple.jpg b/modules/dibs/logos/dibs_purple.jpg new file mode 100644 index 000000000..6e312b8b1 Binary files /dev/null and b/modules/dibs/logos/dibs_purple.jpg differ diff --git a/modules/dibs/logos/dibs_yellow.jpg b/modules/dibs/logos/dibs_yellow.jpg new file mode 100644 index 000000000..93de6e205 Binary files /dev/null and b/modules/dibs/logos/dibs_yellow.jpg differ diff --git a/modules/dibs/validation.php b/modules/dibs/validation.php new file mode 100644 index 000000000..577e9262a --- /dev/null +++ b/modules/dibs/validation.php @@ -0,0 +1,53 @@ +id_cart != ($posted_values['orderid'] || $secure_cart[0])) + $errors[] = Tools::displayErrors('The order you want to validate is not Allow.'); + if (!$posted_values['cookie']->isLogged()) + $errors[] = Tools::displayError('Your login account does not allow'); + if ((string)$posted_values['merchant'] !== (string)dibs::$ID_MERCHANT) + $errors[] = Tools::displayError('You did not use the correct merchant ID.'); + + $md5_key = md5(dibs::$MORE_SETTINGS['k2'].md5(dibs::$MORE_SETTINGS['k1'].'transact='.$posted_values['transact'].'&amount='.$posted_values['amount'].'¤cy='.$posted_values['currency'])); + if((string)$posted_values['authkey'] !== $md5_key) + $errors[] = Tools::displayError('Your are not allowed to validate the command for security reasons.'); + + $message = ''; + foreach ($posted_values AS $key => $value) + if (is_string($value) AND in_array($key, $required_fields) AND $key !== 'HTTP_COOKIE') + $message .= $key.': '.$value."\n"; + if (sizeof($errors)) + { + $message .= sizeof($errors).' error(s):'."\n"; + $valid_order = false; + } + + foreach ($errors AS $error) + $message .= $error."\n"; + $message = nl2br(strip_tags($message)); + if ($valid_order === true) + $obj_dibs->validateOrder((int)$posted_values['orderid'], _PS_OS_PAYMENT_, (float)((int)$posted_values['amount'] / 100), $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]); + if ($valid_order === false) + $obj_dibs->validateOrder((int)$posted_values['orderid'], _PS_OS_ERROR_, 0, $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]); +} diff --git a/modules/editorial/EditorialClass.php b/modules/editorial/EditorialClass.php new file mode 100755 index 000000000..2c92a0da3 --- /dev/null +++ b/modules/editorial/EditorialClass.php @@ -0,0 +1,115 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class EditorialClass extends ObjectModel +{ + /** @var integer editorial id*/ + public $id = 1; + + /** @var string body_title*/ + public $body_home_logo_link; + + /** @var string body_title*/ + public $body_title; + + /** @var string body_title*/ + public $body_subheading; + + /** @var string body_title*/ + public $body_paragraph; + + /** @var string body_title*/ + public $body_logo_subheading; + + protected $table = 'editorial'; + protected $identifier = 'id_editorial'; + + protected $fieldsValidate = array('body_home_logo_link' => 'isUrl'); + protected $fieldsValidateLang = array( + 'body_title' => 'isGenericName', + 'body_subheading' => 'isGenericName', + 'body_paragraph' => 'isCleanHtml', + 'body_logo_subheading' => 'isGenericName'); + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + + $fieldsArray = array('body_title', 'body_subheading', 'body_paragraph', 'body_logo_subheading'); + $fields = array(); + $languages = Language::getLanguages(false); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = (int)($language['id_lang']); + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + foreach ($fieldsArray as $field) + { + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']], true); + elseif (in_array($field, $this->fieldsRequiredLang)) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage], true); + else + $fields[$language['id_lang']][$field] = ''; + } + } + return $fields; + } + + public function copyFromPost() + { + /* Classical fields */ + foreach ($_POST AS $key => $value) + if (key_exists($key, $this) AND $key != 'id_'.$this->table) + $this->{$key} = $value; + + /* Multilingual fields */ + if (sizeof($this->fieldsValidateLang)) + { + $languages = Language::getLanguages(false); + foreach ($languages AS $language) + foreach ($this->fieldsValidateLang AS $field => $validation) + if (isset($_POST[$field.'_'.(int)($language['id_lang'])])) + $this->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])]; + } + } + + public function getFields() + { + parent::validateFields(); + $fields['id_editorial'] = (int)($this->id); + $fields['body_home_logo_link'] = pSQL($this->body_home_logo_link); + return $fields; + } +} diff --git a/modules/editorial/config.xml b/modules/editorial/config.xml new file mode 100755 index 000000000..b34bef21d --- /dev/null +++ b/modules/editorial/config.xml @@ -0,0 +1,12 @@ + + + editorial + Home text editor + 1.6 + A text editor module for your homepage. + PrestaShop + front_office_features + 1 + 1 + + \ No newline at end of file diff --git a/modules/editorial/de.php b/modules/editorial/de.php new file mode 100644 index 000000000..2e8b3f44b --- /dev/null +++ b/modules/editorial/de.php @@ -0,0 +1,23 @@ +editorial_a46dcd3561c3feeb53903dfc0f796a35'] = 'Startseiten-Text-Editor'; +$_MODULE['<{editorial}prestashop>editorial_d02076897ed05399e22a0597404924ad'] = 'Ein Texteditor-Modul für Ihre Startseite'; +$_MODULE['<{editorial}prestashop>editorial_7fc8b5e7597368c070f5bc87c719dcc1'] = 'Sie können diese Handlung nicht ausführen'; +$_MODULE['<{editorial}prestashop>editorial_07b8c09e490f7afbdcfa9cd5bfcfd4a9'] = 'Ein Fehler trat beim Hochladen des Bilds auf.'; +$_MODULE['<{editorial}prestashop>editorial_462390017ab0938911d2d4e964c0cab7'] = 'Einstellungen erfolgreich aktualisiert'; +$_MODULE['<{editorial}prestashop>editorial_0245625ee10f9c6c0ed7f50eb1838856'] = 'Haupttitel'; +$_MODULE['<{editorial}prestashop>editorial_7496c27605d7ac3462a5dab8ecf1b569'] = 'Erscheint oben auf der Startseite'; +$_MODULE['<{editorial}prestashop>editorial_e1f46be647e598f00eeb0ab62561d695'] = 'Untertitel'; +$_MODULE['<{editorial}prestashop>editorial_bf75f228011d1443c4ea7aca23c3cff2'] = 'Einleitungstext'; +$_MODULE['<{editorial}prestashop>editorial_930919b6f854a62e62401e3e76377cc1'] = 'Text Ihrer Wahl, zum Beispiel erläutern Sie Ihre Mission, heben ein neues Produkt hervor oder beschreiben ein aktuelles Ereignis'; +$_MODULE['<{editorial}prestashop>editorial_78587f196180054fcb797d40f4a86f10'] = 'Logo der Startseite'; +$_MODULE['<{editorial}prestashop>editorial_b18c29b8470190a02813415a04a2191f'] = 'Dateigröße'; +$_MODULE['<{editorial}prestashop>editorial_729a51874fe901b092899e9e8b31c97a'] = 'Sind Sie sicher?'; +$_MODULE['<{editorial}prestashop>editorial_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{editorial}prestashop>editorial_f85e125f2a9ebcd47f420c94b535f50a'] = 'Erscheint neben dem einleitenden Text oben'; +$_MODULE['<{editorial}prestashop>editorial_28d74ee805e3a162047d8f917b74dcb3'] = 'Startseitenlogo-Link'; +$_MODULE['<{editorial}prestashop>editorial_62f6077d6d15a35ff4929a225205892f'] = 'Auf dem 2. Logo verwendeter Link '; +$_MODULE['<{editorial}prestashop>editorial_98039e8f2a0d93fc0fff503f9166f59b'] = 'Startseitenlogo Untertitel'; +$_MODULE['<{editorial}prestashop>editorial_c260ede55f0be17068302e7f842802f3'] = 'Aktualisieren Sie den Editor'; diff --git a/modules/editorial/editorial.php b/modules/editorial/editorial.php new file mode 100644 index 000000000..602d64aae --- /dev/null +++ b/modules/editorial/editorial.php @@ -0,0 +1,313 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Editorial extends Module +{ + /** @var max image size */ + protected $maxImageSize = 307200; + + public function __construct() + { + $this->name = 'editorial'; + $this->tab = 'front_office_features'; + $this->version = '1.6'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Home text editor'); + $this->description = $this->l('A text editor module for your homepage.'); + $path = dirname(__FILE__); + if (strpos(__FILE__, 'Module.php') !== false) + $path .= '/../modules/'.$this->name; + include_once($path.'/EditorialClass.php'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('home') OR !$this->registerHook('header')) + return false; + + if (!Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'editorial` ( + `id_editorial` int(10) unsigned NOT NULL auto_increment, + `body_home_logo_link` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`)) + ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) + return false; + + if (!Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'editorial_lang` ( + `id_editorial` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `body_title` varchar(255) NOT NULL, + `body_subheading` varchar(255) NOT NULL, + `body_paragraph` text NOT NULL, + `body_logo_subheading` varchar(255) NOT NULL, + PRIMARY KEY (`id_editorial`, `id_lang`)) + ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) + return false; + + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'editorial`(`id_editorial`, `body_home_logo_link`) + VALUES(1, "http://www.prestashop.com")')) + return false; + + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'editorial_lang`(`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`) + VALUES(1, 1, "Lorem ipsum dolor sit amet", "Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua", "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>", "Excepteur sint prestashop cupidatat non proident")')) + return false; + + if (!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'editorial_lang`(`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`) + VALUES(1, 2, "Lorem ipsum dolor sit amet", "Excepteur sint occaecat cupidatat non proident", "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>", "Lorem ipsum presta shop amet")')) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + return (Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'editorial`') AND + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'editorial_lang`')); + } + + public function putContent($xml_data, $key, $field, $forbidden, $section) + { + foreach ($forbidden AS $line) + if ($key == $line) + return 0; + if (!preg_match('/^'.$section.'_/i', $key)) + return 0; + $key = preg_replace('/^'.$section.'_/i', '', $key); + $field = htmlspecialchars($field); + if (!$field) + return 0; + return ("\n".' <'.$key.'>'.$field.''); + } + + public function getContent() + { + global $cookie; + + /* display the module name */ + $this->_html = '

        '.$this->displayName.'

        '; + $errors = ''; + + // Delete logo image + if (Tools::isSubmit('deleteImage')) + { + if (!file_exists(dirname(__FILE__).'/homepage_logo.jpg')) + $errors .= $this->displayError($this->l('This action cannot be taken.')); + else + { + unlink(dirname(__FILE__).'/homepage_logo.jpg'); + Tools::redirectAdmin('index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)($cookie->id_employee))); + } + $this->_html .= $errors; + } + + /* update the editorial xml */ + if (Tools::isSubmit('submitUpdate')) + { + // Forbidden key + $forbidden = array('submitUpdate'); + + $editorial = new EditorialClass(1); + $editorial->copyFromPost(); + $editorial->update(); + + /* upload the image */ + if (isset($_FILES['body_homepage_logo']) AND isset($_FILES['body_homepage_logo']['tmp_name']) AND !empty($_FILES['body_homepage_logo']['tmp_name'])) + { + Configuration::set('PS_IMAGE_GENERATION_METHOD', 1); + if ($error = checkImage($_FILES['body_homepage_logo'], $this->maxImageSize)) + $errors .= $error; + elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['body_homepage_logo']['tmp_name'], $tmpName)) + return false; + elseif (!imageResize($tmpName, dirname(__FILE__).'/homepage_logo.jpg')) + $errors .= $this->displayError($this->l('An error occurred during the image upload.')); + if (isset($tmpName)) + unlink($tmpName); + } + $this->_html .= $errors == '' ? $this->displayConfirmation($this->l('Settings updated successfully')) : $errors; + if (file_exists(dirname(__FILE__).'/homepage_logo.jpg')) + { + list($width, $height, $type, $attr) = getimagesize(dirname(__FILE__).'/homepage_logo.jpg'); + Configuration::updateValue('EDITORIAL_IMAGE_WIDTH', (int)round($width)); + Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height)); + } + } + + /* display the editorial's form */ + $this->_displayForm(); + + return $this->_html; + } + + private function _displayForm() + { + global $cookie; + /* Languages preliminaries */ + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $iso = Language::getIsoById((int)($cookie->id_lang)); + $divLangName = 'title¤subheading¤cpara¤logo_subheading'; + + $editorial = new EditorialClass(1); + // TinyMCE + global $cookie; + $iso = Language::getIsoById((int)($cookie->id_lang)); + $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); + $ad = dirname($_SERVER["PHP_SELF"]); + $this->_html .= ' + + + '; + $this->_html .= ' + +
        +
        + '.$this->displayName.' + +
        '; + + foreach ($languages as $language) + { + $this->_html .= ' +
        + +
        '; + } + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'title', true); + + + $this->_html .= ' +

        '.$this->l('Appears along top of homepage').'

        +
        + +
        '; + + foreach ($languages as $language) + { + $this->_html .= ' +
        + +
        '; + } + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'subheading', true); + + $this->_html .= ' +
        +
        + +
        '; + + foreach ($languages as $language) + { + $this->_html .= ' +
        + +
        '; + } + + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'cpara', true); + + $this->_html .= ' +

        '.$this->l('Text of your choice; for example, explain your mission, highlight a new product, or describe a recent event.').'

        +
        + +
        '; + if (file_exists(dirname(__FILE__).'/homepage_logo.jpg')) + $this->_html .= '
        + +

        '.$this->l('Filesize').' '.(filesize(dirname(__FILE__).'/homepage_logo.jpg') / 1000).'kb

        + + '.$this->l('Delete').' '.$this->l('Delete').' +
        '; + + $this->_html .= ' +

        '.$this->l('Will appear next to the Introductory Text above').'

        + +
        + +
        + +

        '.$this->l('Link used on the 2nd logo').'

        +
        + +
        '; + + foreach ($languages as $language) + { + $this->_html .= ' +
        + +
        '; + } + + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'logo_subheading', true); + + $this->_html .= ' +
        +
        +
        +
        +
        +
        '; + } + + public function hookHome($params) + { + global $cookie, $smarty; + + $editorial = new EditorialClass(1, (int)$cookie->id_lang); + $smarty->assign(array( + 'editorial' => $editorial, + 'default_lang' => (int)$cookie->id_lang, + 'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'), + 'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'), + 'id_lang' => $cookie->id_lang, + 'homepage_logo' => file_exists('modules/editorial/homepage_logo.jpg'), + 'image_path' => $this->_path.'homepage_logo.jpg' + )); + return $this->display(__FILE__, 'editorial.tpl'); + } + + public function hookHeader() + { + Tools::addCSS(($this->_path).'editorial.css', 'all'); + } +} diff --git a/modules/editorial/editorial.tpl b/modules/editorial/editorial.tpl new file mode 100644 index 000000000..91482c64d --- /dev/null +++ b/modules/editorial/editorial.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
        + {if $editorial->body_home_logo_link}{/if} + {if $homepage_logo}{$editorial->body_title|escape:'htmlall':'UTF-8'|stripslashes}{/if} + {if $editorial->body_home_logo_link}{/if} + {if $editorial->body_logo_subheading}

        {$editorial->body_logo_subheading|stripslashes}

        + {elseif $editorial->body_logo_subheading}

        {$editorial->body_logo_subheading}

        {/if} + {if $editorial->body_title}

        {$editorial->body_title|stripslashes}

        + {elseif $editorial->body_title}

        {$editorial->body_title|stripslashes}

        {/if} + {if $editorial->body_subheading}

        {$editorial->body_subheading|stripslashes}

        + {elseif $editorial->body_subheading}

        {$editorial->body_subheading|stripslashes}

        {/if} + {if $editorial->body_paragraph}
        {$editorial->body_paragraph|stripslashes}
        + {elseif $editorial->body_paragraph}
        {$editorial->body_paragraph|stripslashes}
        {/if} +
        + \ No newline at end of file diff --git a/modules/editorial/editorial.xml b/modules/editorial/editorial.xml new file mode 100644 index 000000000..b6921e686 --- /dev/null +++ b/modules/editorial/editorial.xml @@ -0,0 +1,16 @@ + + +
        +
        + + Lorem ipsum dolor sit amet + Lorem ipsum dolor sit amet + Excepteur sint occaecat cupidatat non proident + Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p> + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> + http://www.prestashop.com + Excepteur sint prestashop cupidatat non proident + Lorem ipsum presta shop amet + +
        diff --git a/modules/editorial/en.php b/modules/editorial/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/editorial/en.php @@ -0,0 +1,4 @@ +editorial_a46dcd3561c3feeb53903dfc0f796a35'] = 'Editor de textos página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_d02076897ed05399e22a0597404924ad'] = 'Un módulo de editor de texto para su página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_7fc8b5e7597368c070f5bc87c719dcc1'] = 'No puede efectuar esta acción'; +$_MODULE['<{editorial}prestashop>editorial_07b8c09e490f7afbdcfa9cd5bfcfd4a9'] = 'Se ha producido un error mientras se subía la imagen.'; +$_MODULE['<{editorial}prestashop>editorial_462390017ab0938911d2d4e964c0cab7'] = 'Parámetros actualizados con éxito'; +$_MODULE['<{editorial}prestashop>editorial_0245625ee10f9c6c0ed7f50eb1838856'] = 'Título principal'; +$_MODULE['<{editorial}prestashop>editorial_7496c27605d7ac3462a5dab8ecf1b569'] = 'Aparece a lo largo de la parte superior de la página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_e1f46be647e598f00eeb0ab62561d695'] = 'Subtítulo'; +$_MODULE['<{editorial}prestashop>editorial_bf75f228011d1443c4ea7aca23c3cff2'] = 'Texto de introducción'; +$_MODULE['<{editorial}prestashop>editorial_930919b6f854a62e62401e3e76377cc1'] = 'Su texto; por ejm: explique su objetivo, destaque un nuevo producto, describa un evento..'; +$_MODULE['<{editorial}prestashop>editorial_78587f196180054fcb797d40f4a86f10'] = 'Imagen de página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_b18c29b8470190a02813415a04a2191f'] = 'Tamaño de la imagen'; +$_MODULE['<{editorial}prestashop>editorial_729a51874fe901b092899e9e8b31c97a'] = '¿Está seguro?'; +$_MODULE['<{editorial}prestashop>editorial_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{editorial}prestashop>editorial_f85e125f2a9ebcd47f420c94b535f50a'] = 'Aparecerá arriba, junto al texto de introducción'; +$_MODULE['<{editorial}prestashop>editorial_28d74ee805e3a162047d8f917b74dcb3'] = 'Enlace del logo de página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_62f6077d6d15a35ff4929a225205892f'] = 'Enlace usado en el segundo logo'; +$_MODULE['<{editorial}prestashop>editorial_98039e8f2a0d93fc0fff503f9166f59b'] = 'Subtítulo del logo de página de inicio'; +$_MODULE['<{editorial}prestashop>editorial_c260ede55f0be17068302e7f842802f3'] = 'Actualizar el editor'; diff --git a/modules/editorial/fr.php b/modules/editorial/fr.php new file mode 100644 index 000000000..6c0638c94 --- /dev/null +++ b/modules/editorial/fr.php @@ -0,0 +1,23 @@ +editorial_a46dcd3561c3feeb53903dfc0f796a35'] = 'Editeur de page d\'accueil'; +$_MODULE['<{editorial}prestashop>editorial_d02076897ed05399e22a0597404924ad'] = 'Un éditeur de texte pour votre page d\'accueil'; +$_MODULE['<{editorial}prestashop>editorial_7fc8b5e7597368c070f5bc87c719dcc1'] = 'Vous ne pouvez pas effectuer cette action'; +$_MODULE['<{editorial}prestashop>editorial_07b8c09e490f7afbdcfa9cd5bfcfd4a9'] = 'Une erreur est survenue lors de l\'upload de l\'image'; +$_MODULE['<{editorial}prestashop>editorial_462390017ab0938911d2d4e964c0cab7'] = 'Paramètres mis à jour avec succès'; +$_MODULE['<{editorial}prestashop>editorial_0245625ee10f9c6c0ed7f50eb1838856'] = 'Titre principal'; +$_MODULE['<{editorial}prestashop>editorial_7496c27605d7ac3462a5dab8ecf1b569'] = 'Apparaît en haut de la page d\'accueil'; +$_MODULE['<{editorial}prestashop>editorial_e1f46be647e598f00eeb0ab62561d695'] = 'Pré-en-tête'; +$_MODULE['<{editorial}prestashop>editorial_bf75f228011d1443c4ea7aca23c3cff2'] = 'Texte d\'introduction'; +$_MODULE['<{editorial}prestashop>editorial_930919b6f854a62e62401e3e76377cc1'] = 'Texte d\'introduction de votre choix ; par exemple expliquez ce que vous vendez ou mettez en avant un produit'; +$_MODULE['<{editorial}prestashop>editorial_78587f196180054fcb797d40f4a86f10'] = 'Logo de la page d\'accueil'; +$_MODULE['<{editorial}prestashop>editorial_b18c29b8470190a02813415a04a2191f'] = 'Taille de l\'image'; +$_MODULE['<{editorial}prestashop>editorial_729a51874fe901b092899e9e8b31c97a'] = 'Êtes-vous sûr ?'; +$_MODULE['<{editorial}prestashop>editorial_f2a6c498fb90ee345d997f888fce3b18'] = 'Effacer'; +$_MODULE['<{editorial}prestashop>editorial_f85e125f2a9ebcd47f420c94b535f50a'] = 'Apparaîtra à côté du texte d\'introduction'; +$_MODULE['<{editorial}prestashop>editorial_28d74ee805e3a162047d8f917b74dcb3'] = 'Lien de l\'image'; +$_MODULE['<{editorial}prestashop>editorial_62f6077d6d15a35ff4929a225205892f'] = 'Lien utilisé sur le second logo'; +$_MODULE['<{editorial}prestashop>editorial_98039e8f2a0d93fc0fff503f9166f59b'] = 'Sous-titre de l\'image'; +$_MODULE['<{editorial}prestashop>editorial_c260ede55f0be17068302e7f842802f3'] = 'Mettre à jour'; diff --git a/modules/editorial/homepage_logo.jpg b/modules/editorial/homepage_logo.jpg new file mode 100644 index 000000000..38a7b65e1 Binary files /dev/null and b/modules/editorial/homepage_logo.jpg differ diff --git a/modules/editorial/it.php b/modules/editorial/it.php new file mode 100644 index 000000000..f8b9709ee --- /dev/null +++ b/modules/editorial/it.php @@ -0,0 +1,23 @@ +editorial_a46dcd3561c3feeb53903dfc0f796a35'] = 'Editor della home page'; +$_MODULE['<{editorial}prestashop>editorial_d02076897ed05399e22a0597404924ad'] = 'Un modulo editor di testo per la tua home page'; +$_MODULE['<{editorial}prestashop>editorial_7fc8b5e7597368c070f5bc87c719dcc1'] = 'Non è possibile effettuare questa azione'; +$_MODULE['<{editorial}prestashop>editorial_07b8c09e490f7afbdcfa9cd5bfcfd4a9'] = 'Errore durante il caricamento delle immagini.'; +$_MODULE['<{editorial}prestashop>editorial_462390017ab0938911d2d4e964c0cab7'] = 'Impostazioni aggiornate con successo'; +$_MODULE['<{editorial}prestashop>editorial_0245625ee10f9c6c0ed7f50eb1838856'] = 'Titolo principale'; +$_MODULE['<{editorial}prestashop>editorial_7496c27605d7ac3462a5dab8ecf1b569'] = 'Appare nella parte superiore della home page'; +$_MODULE['<{editorial}prestashop>editorial_e1f46be647e598f00eeb0ab62561d695'] = 'Sottotitolo'; +$_MODULE['<{editorial}prestashop>editorial_bf75f228011d1443c4ea7aca23c3cff2'] = 'Testo introduttivo'; +$_MODULE['<{editorial}prestashop>editorial_930919b6f854a62e62401e3e76377cc1'] = 'Testo a tua scelta; ad esempio, spiega la tua missione, evidenzia un nuovo prodotto, o descrivi un evento recente'; +$_MODULE['<{editorial}prestashop>editorial_78587f196180054fcb797d40f4a86f10'] = 'Logo della home page '; +$_MODULE['<{editorial}prestashop>editorial_b18c29b8470190a02813415a04a2191f'] = 'Dimensioni file'; +$_MODULE['<{editorial}prestashop>editorial_729a51874fe901b092899e9e8b31c97a'] = 'Sei sicuro?'; +$_MODULE['<{editorial}prestashop>editorial_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{editorial}prestashop>editorial_f85e125f2a9ebcd47f420c94b535f50a'] = 'Apparirà accanto al testo introduttivo sopra'; +$_MODULE['<{editorial}prestashop>editorial_28d74ee805e3a162047d8f917b74dcb3'] = 'Link logo home page'; +$_MODULE['<{editorial}prestashop>editorial_62f6077d6d15a35ff4929a225205892f'] = 'Link utilizzato sul secondo logo'; +$_MODULE['<{editorial}prestashop>editorial_98039e8f2a0d93fc0fff503f9166f59b'] = 'Sottotitolo logo home page '; +$_MODULE['<{editorial}prestashop>editorial_c260ede55f0be17068302e7f842802f3'] = 'Aggiorna l\'editor'; diff --git a/modules/editorial/logo.gif b/modules/editorial/logo.gif new file mode 100644 index 000000000..fa26b20b5 Binary files /dev/null and b/modules/editorial/logo.gif differ diff --git a/modules/ekomi/config.xml b/modules/ekomi/config.xml new file mode 100644 index 000000000..9df9cf8ea --- /dev/null +++ b/modules/ekomi/config.xml @@ -0,0 +1,11 @@ + + + ekomi + eKomi + 0.8 + Adds a eKomi block + + advertising_marketing + 1 + 1 + \ No newline at end of file diff --git a/modules/ekomi/de.php b/modules/ekomi/de.php new file mode 100644 index 000000000..d5d3f81d7 --- /dev/null +++ b/modules/ekomi/de.php @@ -0,0 +1,14 @@ +ekomi_c0858307dfd3d91768c79ec116820b60'] = 'eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_22fd514382c5b7b345e8e61bfc34803f'] = 'Fügt einen eKomi-Block hinzu'; +$_MODULE['<{ekomi}prestashop>ekomi_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{ekomi}prestashop>ekomi_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{ekomi}prestashop>ekomi_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{ekomi}prestashop>ekomi_597b9cfa17df5ac4e2a4b1f4b6de347a'] = 'eKomi-Konfiguration'; +$_MODULE['<{ekomi}prestashop>ekomi_c4fda5e26d4854b8718850c90694a54c'] = 'eKomi E-Mail'; +$_MODULE['<{ekomi}prestashop>ekomi_c48c140af813696592daafbabe6d8b9f'] = 'eKomi-Skript'; +$_MODULE['<{ekomi}prestashop>ekomi_0767b05248fcba405524f792944858ef'] = 'Bitte füllen Sie das Formular mit den Daten aus, die Sie von eKomi bekommen.'; +$_MODULE['<{ekomi}prestashop>ekomi_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; diff --git a/modules/ekomi/ekomi.php b/modules/ekomi/ekomi.php new file mode 100755 index 000000000..e885091f0 --- /dev/null +++ b/modules/ekomi/ekomi.php @@ -0,0 +1,131 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Ekomi extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + function __construct() + { + $this->name = 'ekomi'; + $this->tab = 'advertising_marketing'; + $this->version = 0.8; + + parent::__construct(); + + $this->displayName = $this->l('eKomi'); + $this->description = $this->l('Adds a eKomi block'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('rightColumn') AND $this->registerHook('newOrder')); + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitEkomi')) + { + $email = Tools::getValue('ekomi_email'); + Configuration::updateValue('PS_EKOMI_DISPLAY', Tools::getValue('ekomi_display')); + Configuration::updateValue('PS_EKOMI_SCRIPT', htmlentities(str_replace(array("\r\n", "\n"), '', Tools::getValue('ekomi_script')))); + if (!empty($email) && !Validate::isEmail($email)) + Configuration::updateValue('PS_EKOMI_EMAIL', ''); + else + Configuration::updateValue('PS_EKOMI_EMAIL', Tools::getValue('ekomi_email')); + $output .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + return ' +
        +
        + '.$this->l('Settings').' + +
        +
        + +

        + +

        + +
        + + + + +

        '.$this->l('Show or don\'t show the block (orders will be sent to eKomi either you choose to hide or display the block).').'

        +
        +

        '.$this->l('Please, fill the form with the datas that eKomi gives you.').'

        +
        +
        +
        +
        '; + } + + public function hookRightColumn($params) + { + if (!Configuration::get('PS_EKOMI_SCRIPT')) + return ; + if (!Configuration::get('PS_EKOMI_DISPLAY')) + return ; + return stripslashes(html_entity_decode(Configuration::get('PS_EKOMI_SCRIPT'))).'

        '; + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookNewOrder($params) + { + global $cookie; + if (!Configuration::get('PS_EKOMI_EMAIL')) + return false; + + /* Email generation */ + $subject = '[Ekomi-Prestashop] '.Configuration::get('PS_SHOP_NAME'); + $templateVars = array( + '{firstname}' => $params['customer']->firstname, + '{lastname}' => $params['customer']->lastname, + '{email}' => $params['customer']->email, + '{id_order}' => $params['order']->id + ); + + /* Email sending */ + if (!Mail::Send((int)($cookie->id_lang), 'ekomi', $subject, $templateVars, Configuration::get('PS_EKOMI_EMAIL'), NULL, $params['customer']->email, Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/')) + return false; + return true; + } +} + + diff --git a/modules/ekomi/es.php b/modules/ekomi/es.php new file mode 100644 index 000000000..65dd79b50 --- /dev/null +++ b/modules/ekomi/es.php @@ -0,0 +1,14 @@ +ekomi_c0858307dfd3d91768c79ec116820b60'] = 'eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_22fd514382c5b7b345e8e61bfc34803f'] = 'Añadir un bloque eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{ekomi}prestashop>ekomi_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{ekomi}prestashop>ekomi_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{ekomi}prestashop>ekomi_597b9cfa17df5ac4e2a4b1f4b6de347a'] = 'configuración eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c48c140af813696592daafbabe6d8b9f'] = 'script eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c4fda5e26d4854b8718850c90694a54c'] = 'eKomi por e-mail'; +$_MODULE['<{ekomi}prestashop>ekomi_0767b05248fcba405524f792944858ef'] = 'Por favor, rellene el formulario con los datos básicos que eKomi le da.'; +$_MODULE['<{ekomi}prestashop>ekomi_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; diff --git a/modules/ekomi/fr.php b/modules/ekomi/fr.php new file mode 100644 index 000000000..0dc3b1af7 --- /dev/null +++ b/modules/ekomi/fr.php @@ -0,0 +1,17 @@ +ekomi_c0858307dfd3d91768c79ec116820b60'] = 'eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_22fd514382c5b7b345e8e61bfc34803f'] = 'Ajouter un bloc eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{ekomi}prestashop>ekomi_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{ekomi}prestashop>ekomi_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{ekomi}prestashop>ekomi_597b9cfa17df5ac4e2a4b1f4b6de347a'] = 'Configuration eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c4fda5e26d4854b8718850c90694a54c'] = 'E-mail eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c48c140af813696592daafbabe6d8b9f'] = 'Script eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Afficher'; +$_MODULE['<{ekomi}prestashop>ekomi_b9f5c797ebbf55adccdd8539a65a0241'] = 'Cacher'; +$_MODULE['<{ekomi}prestashop>ekomi_ccf7919cbd0248b0f86a8c39f74da5d0'] = 'Afficher ou cacher le bloc (les commandes seront envoyés à eKomi que vous choississiez d\'afficher ou de cacher le bloc).'; +$_MODULE['<{ekomi}prestashop>ekomi_0767b05248fcba405524f792944858ef'] = 'Veuillez remplir le formulaire avec les informations fournis par eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; diff --git a/modules/ekomi/it.php b/modules/ekomi/it.php new file mode 100644 index 000000000..7e89b8358 --- /dev/null +++ b/modules/ekomi/it.php @@ -0,0 +1,14 @@ +ekomi_c0858307dfd3d91768c79ec116820b60'] = 'eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_22fd514382c5b7b345e8e61bfc34803f'] = 'Aggiunge un blocco eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{ekomi}prestashop>ekomi_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{ekomi}prestashop>ekomi_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{ekomi}prestashop>ekomi_597b9cfa17df5ac4e2a4b1f4b6de347a'] = 'configurazione eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c48c140af813696592daafbabe6d8b9f'] = 'script eKomi'; +$_MODULE['<{ekomi}prestashop>ekomi_c4fda5e26d4854b8718850c90694a54c'] = 'e-mail eKomi '; +$_MODULE['<{ekomi}prestashop>ekomi_0767b05248fcba405524f792944858ef'] = 'Per favore, compila il modulo con i dati che eKomi ti dà.'; +$_MODULE['<{ekomi}prestashop>ekomi_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; diff --git a/modules/ekomi/logo.gif b/modules/ekomi/logo.gif new file mode 100755 index 000000000..176cc078c Binary files /dev/null and b/modules/ekomi/logo.gif differ diff --git a/modules/ekomi/mails/de/ekomi.html b/modules/ekomi/mails/de/ekomi.html new file mode 100755 index 000000000..891cabb5b --- /dev/null +++ b/modules/ekomi/mails/de/ekomi.html @@ -0,0 +1,10 @@ + + + + + + + +

        {firstname} {lastname} {email} {id_order}

        + + \ No newline at end of file diff --git a/modules/ekomi/mails/de/ekomi.txt b/modules/ekomi/mails/de/ekomi.txt new file mode 100755 index 000000000..bed3e2c7b --- /dev/null +++ b/modules/ekomi/mails/de/ekomi.txt @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/en/ekomi.html b/modules/ekomi/mails/en/ekomi.html new file mode 100755 index 000000000..a7d94c885 --- /dev/null +++ b/modules/ekomi/mails/en/ekomi.html @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/en/ekomi.txt b/modules/ekomi/mails/en/ekomi.txt new file mode 100755 index 000000000..bed3e2c7b --- /dev/null +++ b/modules/ekomi/mails/en/ekomi.txt @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/es/ekomi.html b/modules/ekomi/mails/es/ekomi.html new file mode 100755 index 000000000..b3a281c22 --- /dev/null +++ b/modules/ekomi/mails/es/ekomi.html @@ -0,0 +1,11 @@ + + + + + + + +

        {firstname} {lastname} {email} {id_order}

        + + + \ No newline at end of file diff --git a/modules/ekomi/mails/es/ekomi.txt b/modules/ekomi/mails/es/ekomi.txt new file mode 100755 index 000000000..bed3e2c7b --- /dev/null +++ b/modules/ekomi/mails/es/ekomi.txt @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/fr/ekomi.html b/modules/ekomi/mails/fr/ekomi.html new file mode 100755 index 000000000..a7d94c885 --- /dev/null +++ b/modules/ekomi/mails/fr/ekomi.html @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/fr/ekomi.txt b/modules/ekomi/mails/fr/ekomi.txt new file mode 100755 index 000000000..bed3e2c7b --- /dev/null +++ b/modules/ekomi/mails/fr/ekomi.txt @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/ekomi/mails/it/ekomi.html b/modules/ekomi/mails/it/ekomi.html new file mode 100755 index 000000000..255bf2475 --- /dev/null +++ b/modules/ekomi/mails/it/ekomi.html @@ -0,0 +1,10 @@ + + + + + titolo + + +

        {firstname} {lastname} {email} {id_order}

        + + \ No newline at end of file diff --git a/modules/ekomi/mails/it/ekomi.txt b/modules/ekomi/mails/it/ekomi.txt new file mode 100755 index 000000000..bed3e2c7b --- /dev/null +++ b/modules/ekomi/mails/it/ekomi.txt @@ -0,0 +1,4 @@ +{firstname} {lastname} +{email} +{id_order} + diff --git a/modules/envoimoinscher/AdminEnvoiMoinsCher.gif b/modules/envoimoinscher/AdminEnvoiMoinsCher.gif new file mode 100755 index 000000000..5528809a7 Binary files /dev/null and b/modules/envoimoinscher/AdminEnvoiMoinsCher.gif differ diff --git a/modules/envoimoinscher/AdminEnvoiMoinsCher.php b/modules/envoimoinscher/AdminEnvoiMoinsCher.php new file mode 100755 index 000000000..96de6776a --- /dev/null +++ b/modules/envoimoinscher/AdminEnvoiMoinsCher.php @@ -0,0 +1,314 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once('envoimoinscher.php'); + +class AdminEnvoiMoinsCher extends AdminTab +{ + public $packaging = array('Pli' => 'Pli', 'Colis' => 'Colis', 'Encombrant' => 'Objet lourd', 'Palette' => 'Palette'); + public function __construct() + { + parent::__construct(); + } + + public function display() + { + global $cookie; + $emc = new Envoimoinscher(); + echo '

        '.$emc->lang('List of orders to export').'

        '; + if (Tools::isSubmit('submitExport')) + { + $orderToExport = array(); + $idsOrdersToExport = Tools::getValue('ordersBox'); + if (!empty($idsOrdersToExport)) + { + foreach($idsOrdersToExport as $id) + { + $orderToExport[] = self::getOrderDetails((int)($id)); + } + echo '
        + + + '; + self::inputMaker($orderToExport); + + echo '
        + '; + } + else echo '
        + nok + '.$emc->lang('No order to export').'
        +

        Retour

        '; + } + else + { + if (Configuration::get('EMC_ORDER_STATE') AND Configuration::get('EMC_CARRIER') AND Configuration::get('EMC_FIRST_NAME') AND Configuration::get('EMC_LAST_NAME') + AND Configuration::get('EMC_ADDRESS') AND Configuration::get('EMC_ZIP_CODE') AND Configuration::get('EMC_CITY') AND Configuration::get('EMC_COUNTRY') + AND Configuration::get('EMC_PHONE') AND Configuration::get('EMC_EMAIL') AND Configuration::get('EMC_LOGIN')) + { + echo '
        '; + $orders = self::getOrders(); + self::displayOrders($orders); + echo '

        +
        '; + } + else + echo '

        '.$emc->lang('Please configure this module in order').'

        '; + } + echo '

        + ' . $emc->lang('Change configuration') . '

        '; + } + + private function getOrders() + { + $id_order_state = (int)(Configuration::get('EMC_ORDER_STATE')); + $id_carrier = (int)(Configuration::get('EMC_CARRIER')); + + $sql = ' + SELECT o.id_order as id_order, o.`id_customer` as id_customer, + CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + o.total_paid_real as total, o.total_shipping as shipping, + o.date_add as date, o.id_currency as id_currency, o.id_lang as id_lang, + SUM(od.product_weight * od.product_quantity) as weight + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (o.`id_order` = od.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = o.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = o.`id_lang`) + WHERE (SELECT moh.`id_order_state` FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = o.`id_order` ORDER BY moh.date_add DESC LIMIT 1) = '.$id_order_state.' + AND o.id_carrier = '.pSQL($id_carrier).' + GROUP BY o.`id_order`, od.`id_order` + ORDER BY o.`date_add` ASC'; + return Db::getInstance()->ExecuteS($sql); + } + + private function displayOrders($orders) + { + global $cookie; + echo ' + + + + + + + + + + + '; + if (!empty($orders)) + { + foreach($orders as $order) + { + $customer = new Customer((int)($order['id_customer'])); + echo ' + + + + + + + + + + '; + } + } + else + echo ''; + + echo '
        '.$emc->lang('ID').''.$emc->lang('Name').''.$emc->lang('Total Cost').''.$emc->lang('Total shipment').''.$emc->lang('Date').''.$emc->lang('Packaging').''.$emc->lang('Nature of contents').''.$emc->lang('Detail').'
        + + '.(int)($order['id_order']).''.htmlentities($customer->lastname, ENT_COMPAT, 'UTF-8').' '.htmlentities($customer->firstname, ENT_COMPAT, 'UTF-8').''.Tools::displayPrice($order['total'], new Currency((int)($order['id_currency']))).''.Tools::displayPrice($order['shipping'], new Currency((int)($order['id_currency']))).''.Tools::displayDate($order['date'], (int)($order['id_lang'])).' + + '.envoimoinscher::selectNature(Configuration::get('EMC_CONTENT'),(int)($order['id_order'])).' + '.$emc->lang('View').'
        '.$emc->lang('No order to export').'
        '; + } + + private function getOrderDetails($id_order) + { + global $cookie; + $confs = Configuration::getMultiple(array('EMC_LOGIN', 'PS_SHOP_NAME', 'EMC_GENDER', 'EMC_FIRST_NAME', 'EMC_LAST_NAME', 'EMC_ADDRESS', + 'EMC_ZIP_CODE', 'EMC_CITY', 'EMC_COUNTRY', 'EMC_PHONE', 'EMC_EMAIL', 'EMC_EMAILS')); + $orderDetails = array(); + $order = new Order((int)($id_order)); + $customer = new Customer((int)($order->id_customer)); + $adresseDelivery = new Address((int)($order->id_address_delivery)); + + $genderTab = array(1 => 'M.', 2 => 'Mme', 9 => ''); + $orderDetails['url_suivi'] = Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/envoimoinscher/tracking.php?token='.$customer->secure_key; + $orderDetails['infoexterne'] = str_replace('.','_',str_replace('www.','',$_SERVER['HTTP_HOST'])).'_'.(int)($id_order); + $orderDetails['packaging'] = Tools::getValue('packaging_'.(int)($id_order)); + $orderDetails['type_objet'] = Tools::getValue('type_objet_'.(int)($id_order)); + $orderDetails['envoi_emailsconf'] = (int)($confs['EMC_EMAILS']); + + //products infos + $productsDetails = $order->getProductsDetail(); + $tabDetails = array(); + foreach($productsDetails as $details) + { + $features = self::getFeatures((int)($details['product_id'])); + $tabDetailsProduct = array(); + $tabDetailsProduct['id'] = (int)($details['product_id']); + $tabDetailsProduct['nb'] = (int)($details['product_quantity']); + $tabDetailsProduct['poids'] = (float)($details['product_weight']); + $tabDetailsProduct['description'] = htmlspecialchars($details['product_name'], ENT_COMPAT, 'UTF-8'); + foreach($features as $key => $value) + $tabDetailsProduct[$key] = $value; + $tabDetails[] = $tabDetailsProduct; + } + $orderDetails['products'] = $tabDetails; + + //sending infos + $orderExpediteur['civilite'] = htmlspecialchars($genderTab[$confs['EMC_GENDER']], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['collecte_type'] = 'entreprise'; + $orderExpediteur['societe'] = htmlspecialchars($confs['PS_SHOP_NAME'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['nom'] = htmlspecialchars($confs['EMC_LAST_NAME'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['prenom'] = htmlspecialchars($confs['EMC_FIRST_NAME'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['adresse'] = htmlspecialchars($confs['EMC_ADDRESS'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['codepostal'] = htmlspecialchars($confs['EMC_ZIP_CODE'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['ville'] = htmlspecialchars($confs['EMC_CITY'], ENT_COMPAT, 'UTF-8'); + + $orderExpediteur['pz_id'] = htmlspecialchars($confs['EMC_COUNTRY'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['tel'] = htmlspecialchars($confs['EMC_PHONE'], ENT_COMPAT, 'UTF-8'); + $orderExpediteur['email'] = htmlspecialchars($confs['EMC_EMAIL'], ENT_COMPAT, 'UTF-8'); + $orderDetails['expediteur'] = $orderExpediteur; + + //delivery infos + $orderDelivery['civilite'] = $genderTab[(int)($customer->id_gender)]; + if (isset($adresseDelivery->company)) + $orderDelivery['collecte_type'] = 'particulier'; + $orderDelivery['societe'] = htmlspecialchars($adresseDelivery->company, ENT_COMPAT, 'UTF-8'); + $orderDelivery['prenom'] = htmlspecialchars($adresseDelivery->firstname, ENT_COMPAT, 'UTF-8'); + $orderDelivery['nom'] = htmlspecialchars($adresseDelivery->lastname, ENT_COMPAT, 'UTF-8'); + $orderDelivery['adresse'] = htmlspecialchars($adresseDelivery->address1, ENT_COMPAT, 'UTF-8'); + $orderDelivery['codepostal'] = htmlspecialchars($adresseDelivery->postcode, ENT_COMPAT, 'UTF-8'); + $orderDelivery['ville'] = htmlspecialchars($adresseDelivery->city, ENT_COMPAT, 'UTF-8'); + $orderDelivery['pz_id'] = Country::getIsoById(Country::getIdByName((int)($cookie->id_lang),$adresseDelivery->country)); + if (isset($adresseDelivery->phone)) + $orderDelivery['tel'] = htmlspecialchars($adresseDelivery->phone, ENT_COMPAT, 'UTF-8'); + else + $orderDelivery['tel'] = htmlspecialchars($adresseDelivery->phone_mobile, ENT_COMPAT, 'UTF-8'); + $orderDelivery['email'] = htmlspecialchars($customer->email, ENT_COMPAT, 'UTF-8'); + + $orderDetails['destinataire'] = $orderDelivery; + //d($orderDetails); + return $orderDetails; + } + + private function getFeatures($id) + { + global $cookie; + $featuresTab = array(); + $confs = Configuration::getMultiple(array('EMC_WIDTH', 'EMC_HEIGHT', 'EMC_DEPTH')); + $features = Product::getFeaturesStatic((int)$id); + foreach($features as $feature) + { + switch ($feature['id_feature']) + { + case $confs['EMC_WIDTH'] : + $featureValue = new FeatureValue((int)($feature['id_feature_value'])); + $featuresTab['largeur'] = $featureValue->value[(int)($cookie->id_lang)]; + break; + case $confs['EMC_HEIGHT'] : + $featureValue = new FeatureValue((int)($feature['id_feature_value'])); + $featuresTab['hauteur'] = $featureValue->value[(int)($cookie->id_lang)]; + break; + case $confs['EMC_DEPTH'] : + $featureValue = new FeatureValue((int)($feature['id_feature_value'])); + $featuresTab['longueur'] = $featureValue->value[(int)($cookie->id_lang)]; + break; + } + } + return $featuresTab; + } + + private function inputMaker($orderDetails) + { + $nbrOrder = count($orderDetails)-1; + foreach($orderDetails as $details) + { + foreach($details as $detail => $values) + { + if ($detail == 'products') + { + if (count($values) > 1) + { + $weight = 0; + foreach($values as $key => $features) + { + $weight += (float)($features['poids']*$features['nb']); + } + echo ''; + } + elseif($values[0]['nb'] > 1) + { + echo ''; + echo ''; + } + else + { + echo ''; + echo ''; + echo ''; + echo ''; echo ''; + } + } + elseif ($detail == 'packaging') + echo ''; + elseif ($detail == 'infoexterne') + echo ''; + elseif ($detail == 'url_suivi') + echo ''; + elseif ($detail == 'infoexterne') + echo ''; + elseif ($detail == 'envoi_emailsconf') + echo ''; + elseif ($detail == 'type_objet') + echo ''; + else + { + foreach($values as $key => $value) + echo ''; + } + } + $nbrOrder -=1 ; + } + } +} + + diff --git a/modules/envoimoinscher/config.xml b/modules/envoimoinscher/config.xml new file mode 100755 index 000000000..fd21d5572 --- /dev/null +++ b/modules/envoimoinscher/config.xml @@ -0,0 +1,12 @@ + + + envoimoinscher + Envoimoinscher + 1.0 + Find the best price for your shipment. Compare and order carriers offers at negotiated rates. + + shipping_logistics + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/envoimoinscher/de.php b/modules/envoimoinscher/de.php new file mode 100644 index 000000000..620b1d1a9 --- /dev/null +++ b/modules/envoimoinscher/de.php @@ -0,0 +1,117 @@ +envoimoinscher_e0b8a2c577580cb773bda0486acc4bf8'] = 'Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bbd983fbdc5928ce36d6edce53639718'] = 'Finden Sie den günstigsten Versand. Vergleichen und fordern Sie Angebote von Lieferanten sowie ausgehandelte Preise an.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cc89336eed19f4c3bef8ae484eb43109'] = '\'Breite\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fab811cb477e7794389f16624ac9aff9'] = '\'Höhe\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7854da902d5f2ad746fe1b6f950da08e'] = '\'Tiefe\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_63a0a494ef3c3c22829660ef6081dce4'] = '\'Bestellstatus\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_786b7b25dcd85d7e972a377f56facb5a'] = '\'Lieferant\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1a3ade81b4ddac3ff0fe9f98f93ad843'] = '\'Status Bestellung vorbei\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_070d4ccfe53bdbc791cbd6119b872f34'] = '\'Status Bestellung senden\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c98d7be3b0acc53f7d2142cc3a3ab444'] = '\'Status Bestellung geliefert\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4d470fde8487e755a50e9235e3dc13ab'] = 'muss konfiguriert sein, um dieses Modul richtig zu nutzen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9d766be2c89b5af0010ac0c11dcddae7'] = 'Bitte manuell kopieren'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6357d3551190ec7e79371a8570121d3a'] = 'Es sind'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ce81305b7edb043d0a7a5c75cab17d0'] = 'Es ist'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_07213a0161f52846ab198be103b5ab43'] = 'Fehler'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Fehler'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_667f01ead42da9ba606aaee5632f1cd0'] = 'Konto erstellen bei Envoimoinscher:'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8fc0ba19a15eeb50ab4ad8db449b0c74'] = 'Um Ihr Konto bei Envoimoinscher zu erstellen, klicken Sie auf das Bild unten. Damit gehen Sie zu einem speziellen persönlichen Bereich, wo Sie sämtliche Tools für eine einfache Versandverwaltung finden.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_82b213c84c7cf648a3cc9e718bb0f1c5'] = 'Dieses Modul ermöglicht es Ihnen, Lieferanten-Angebote und Online-Bestellungsservices mit ausgehandelten Lieferkosten zu vergleichen.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b843f182d32b5571e48879444311c38b'] = 'Sie müssen Ihren Envoimoinscher-Benutzernamen unten eingeben. Wenn Sie noch kein Kunde bei Envoimoinscher sind, können Sie ganz einfach ein Konto erstellen, indem Sie'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c92285fa6d3e827b198d120ea3ac674'] = 'hier klicken'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d64b03d7cc357f2ac9c63f8c88b49a0'] = 'Dokumentation downloaden '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_32954654ac8fe66a1d09be19001de2d4'] = 'Breite'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_af7bb0f5eddd2287cf3f6b880d189e19'] = 'Wählen Sie eine Funktion ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_31f12b07ff0701df3b6000412952f9c7'] = 'Wählen Sie die Breite in der Liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eec6c4bdbd339edf8cbea68becb85244'] = 'Höhe'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_97fd502c6a75bfb727fbb5a93d3bc60b'] = 'Wählen Sie die Höhe in der Liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_675056ad1441b6375b2c5abd48c27ef1'] = 'Tiefe'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ccccb5efc77dfc62afb2c5ad4223916d'] = 'Wählen Sie die Tiefe in der Liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a669003ea35aa39ca280b83bd259a032'] = 'Verpackung'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_86a0b81400546aa3bbfe94b796ed6c31'] = 'Wählen Sie eine Verpackung ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16ef6ec0f179beeae1a68c4ebef97254'] = 'Wählen Sie die Standard-Verpackung.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f0c28b9363b60ed0a4579291ca510544'] = 'Art der Inhalte'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_55303dad425107852ebecc47601f73e2'] = 'Wählen Sie die standardmäßige Art der Inhalte.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e74b7618bb3f99b8a7c00ef765c727eb'] = 'Bestellstatus zum Export'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_509d517463244dcd1ec09c4c5fa266ac'] = 'Wählen Sie einen Status ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bb4b4f2503c57254aaed1f1a07bb71da'] = 'Wählen Sie den Bestellstatus zum Export an Envoi Moins Cher.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_914419aa32f04011357d3b604a86d7eb'] = 'Lieferant'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6f2a31a74727092b14a9f25fa0761f4'] = 'Wählen Sie einen Lieferanten...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a22d9830367fdf0f6b2601e7484b387'] = 'Wählen Sie einen Lieferanten auf der Liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2aad255fde4750af3f559d078e1cb420'] = 'Bestellstatus \"Bestellung abgeschlossen\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd77298d81e440f5379f48dccf993a8b'] = 'Wählen Sie den Bestellstatus abgeschlossen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8532ff05a8576bdc04f8a9b8b1dbbfbc'] = 'Bestellstatus Absenden'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5af6d17d6837ce556286d019e06e4e0'] = 'Wählen Sie den Bestellstatus Absenden'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d2392c7501c4041d990cc0d372cde50a'] = 'Bestellstatus Geliefert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b06087cef2468e82e0e07499fdba5c30'] = 'Wählen Sie den Bestellstatus Geliefert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1e884e3078d9978e216a027ecd57fb34'] = 'E-Mail'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9e839460f2871eb777da1b74f3fab03e'] = 'Aktiviert oder deaktiviert das Senden von Mails aus EMC'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a995d9073f999ae5713f6994092b57e'] = 'bis es den Empfänger standardmäßig informiert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7a16e0022af67a71b8d1521f746f41b3'] = 'EMC Login'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6ef6eed8e2c2d13d6823cbff8f139bad'] = 'Stellen Sie Ihr EMC Login ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a861c864b470344da673354f996ce0a7'] = 'Absenderinformationen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_019ec3132cdf8ee0f2e2a75cf5d3e459'] = 'Geschlecht'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5f33341287efce675cacf0b3ed818e70'] = 'Wählen Sie das Geschlecht des Absenders'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d3f5eff9c40ee315d452392bed5309b'] = 'Nachname'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8cf6db4af977baa86b7691da80601bd0'] = 'Stellen Sie den Nachnamen des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20db0bfeecd8fe60533206a2b5e9891a'] = 'Vorname'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49a768ce02314f39d386a66b77ae1858'] = 'Stellen Sie den Vornamen des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a56f1882e859d6ce5b0fbc96c544100'] = 'Stellen Sie die Adresse des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_642d3ba5db8b57e006584b544e490ec7'] = 'Postleitzahl'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16e65be7ad7680a7148b8ddf0b5b4171'] = 'Stellen Sie die Postleitzahl des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_57d056ed0984166336b7879c2af3657f'] = 'Stadt'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e73af174484a98a10a852ab5bdb701bf'] = 'Stellen Sie die Stadt des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_59716c97497eb9694541f7c3d37b1a4d'] = 'Land'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_255529f7845194a47b4c2e28374cdb1f'] = 'Wählen Sie ein Land ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c820bc5f65e6258a648c3621b7b761e'] = 'Wählen Sie das Land des Absenders in der Liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefon'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6770d2600f6b45aa0b18dd9a6e39b2f8'] = 'Stellen Sie die Telefonnummer des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43cdf4833105e72eb951833a030ad4d5'] = 'Stellen Sie die E-Mail des Absenders ein'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1fa598730b02d78aa07d07337c81c720'] = 'Breite nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c5ac8560e3b92c7941286fa8c2b3a1ed'] = 'Höhe nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_0eed429f3ae1e71de73b94e13f786893'] = 'Tiefe nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5d50fc169bba225de3df710ff98188c6'] = 'Bestellstatus nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_340ffdfdc019d0b001a4753b57aa398a'] = 'Lieferant nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ecdf47576d5d0d024f30199900c1761'] = 'Bestellstatus \"Bestellung abgeschlossen\" genicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6a9265e0dcf5d7a7f331055b9b93609'] = 'Bestellstatus Senden nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9f3440922590dae1ebc28c40555c6203'] = 'Bestellstatus Lieferung nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43b89b46dcf9440d5f852548ac5341a3'] = 'Nachname nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9a6dfbad73e6a8a852d4b1a266e941d2'] = 'Vorname nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fdda31acf2551d1edde59d64144975b8'] = 'Adresse nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_01fc0f14742ba00423886a14e31964de'] = 'PLZ nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2814eaaff876f0a3f29d87b23ceaa041'] = 'Stadt nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ae21c3189ecc1e32d10e8f3b264af190'] = 'Land nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_829d5874145d3477d778cdff96671448'] = 'Telefonnummer nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a3b23591400c94a94583a94c0ab1f19f'] = 'E-Mail nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_18f54b7a823f3349d841804a9fbc5aa3'] = 'Login nicht angegeben'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9284bff13acffdd879ef4ac7fca5234'] = 'Einstellungen fehlgeschlagen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1b67f24ea45fdf2e11ad8f6e777e8c8b'] = 'Versandinformationen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fad2b83dc128dfb793fa8ee944dd9931'] = 'Versandverfolgung'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d668e43f1d8b0584ed4f896de031d921'] = 'Keine Versandnummer'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bee4b55285d16e5fe85fc3474e343c51'] = 'Lieferscheine drucken'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_10f0b7273755ee4117c1517010e18c23'] = 'Keine Lieferscheinnummer'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9ab3e83b1071d09ca62e4cd258686f6b'] = 'Keine Bestellung zum Exportieren'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8c193493d8e4a97dc6da02d9809be530'] = 'Bitte konfigurieren Sie dieses Modul in der Bestellung'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2345e28c9b93f368968be4781ed70f5c'] = 'Konfiguration ändern'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_50e91dab2a063bc8c1dbc383b0c8e71c'] = 'Gesamtkosten'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5e8ff31378107b80ae8a9e7cd93eb1bc'] = 'Gesamt Versand'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_403ddddf1f3eecc1a2566b3d81e12993'] = 'Art der Inhalte'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a254c25adc7d10d7e9c4889484f875a5'] = 'Detail'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_94966d90747b97d1f0f206c98a8b1ac3'] = 'Senden'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eae21050d83c239d047c9eb0d3bc930e'] = 'Liste der Bestellungen zum Exportieren'; diff --git a/modules/envoimoinscher/envoimoinscher.php b/modules/envoimoinscher/envoimoinscher.php new file mode 100755 index 000000000..29091c9ac --- /dev/null +++ b/modules/envoimoinscher/envoimoinscher.php @@ -0,0 +1,592 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Envoimoinscher extends Module +{ + private $_html = ''; + private $_postErrors = array(); + public $_errors = array(); + public $packaging = array('Pli' => 'Pli', 'Colis' => 'Colis', 'Encombrant' => 'Objet lourd', 'Palette' => 'Palette'); + const INSTALL_SQL_FILE = 'install.sql'; + function __construct() + { + global $cookie; + + $this->name = 'envoimoinscher'; + $this->tab = 'shipping_logistics'; + $this->version = '1.0'; + $this->limited_countries = array('fr'); + $this->needRange = true; + + parent::__construct (); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Envoimoinscher'); + $this->description = $this->l('Find the best price for your shipment. Compare and order carriers offers at negotiated rates.'); + + if (self::isInstalled($this->name)) + { + $warning = array(); + //Check config and display warning + if (!Configuration::get('EMC_WIDTH')) + $warning[] .= $this->l('\'Width\'').' '; + if (!Configuration::get('EMC_HEIGHT')) + $warning[] .= $this->l('\'Height\'').' '; + if (!Configuration::get('EMC_DEPTH')) + $warning[] .= $this->l('\'Depth\'').' '; + if (!Configuration::get('EMC_ORDER_STATE')) + $warning[] .= $this->l('\'Order state\'').' '; + if (!Configuration::get('EMC_CARRIER')) + $warning[] .= $this->l('\'Carrier\'').' '; + if (!Configuration::get('EMC_ORDER_PAST_STATE')) + $warning[] .= $this->l('\'Order past state\'').' '; + if (!Configuration::get('EMC_SEND_STATE')) + $warning[] .= $this->l('\'Send order state\'').' '; + if (!Configuration::get('EMC_DELIVERY_STATE')) + $warning[] .= $this->l('\'Delivered order state\'').' '; + + if (count($warning)) + $this->warning .= implode(' , ',$warning).$this->l('must be configured to use this module correctly').' '; + } + } + + public function install() + { + global $cookie; + + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach ($sql AS $query) + if ($query AND sizeof($query) AND !Db::getInstance()->Execute(trim($query))) + return false; + if (substr(_PS_VERSION_, 2, 3) <= 3.1) + { + if (!@copy(dirname(__FILE__).'/AdminEnvoiMoinsCher.gif', _PS_IMG_DIR_.'/t/AdminEnvoiMoinsCher.gif')) + $this->_errors[] = $this->l('Please manually copy ') .dirname(__FILE__).'/AdminEnvoiMoinsCher.gif'.' in the '._PS_IMG_DIR_.'/t/AdminEnvoiMoinsCher.gif folder located in your admin directory.'; + } + if (!parent::install() OR !Configuration::updateValue('EMC_EMAILS', 1) OR !$this->registerHook('AdminOrder') OR !self::adminInstall() + OR !Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'envoimoinscher` (`id_order` int(10) unsigned NOT NULL, `shipping_number` varchar(30) NOT NULL ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=latin1;')) + return false; + return true; + } + + private function adminInstall() + { + $tab = new Tab(); + $tab->class_name = 'AdminEnvoiMoinsCher'; + $tab->id_parent = 3; + $tab->module = 'envoimoinscher'; + $tab->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Envoimoinscher'); + return $tab->add(); + } + + public function uninstall() + { + global $cookie; + + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'envoimoinscher_contenu`'); + + $tab = new Tab(Tab::getIdFromClassName('AdminEnvoiMoinsCher')); + if (!parent::uninstall() OR !$tab->delete() OR !$this->unregisterHook('AdminOrder')) + return false; + return true; + } + + public function getContent() + { + $this->_html .= '

        ' . $this->l('Envoimoinscher').'

        '; + + if (!empty($_POST) AND Tools::isSubmit('submitSave')) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + { + $nbErrors = sizeof($this->_postErrors); + $this->_html .= '
        +

        '.($nbErrors > 1 ? $this->l('There are') : $this->l('There is')).' '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'

        +
          '; + foreach ($this->_postErrors AS $err) + $this->_html .= '
        1. - '.$err.'
        2. '; + $this->_html .= '
        '; + } + } + $this->_displayForm(); + return $this->_html; + } + + + private function _displayForm() + { + global $cookie; + $genderTab = array(1 => 'M.', 2 => 'Mme', 9 => '', 0 => ''); + $features = Feature::getFeatures($cookie->id_lang); + $order_states = OrderState::getOrderStates($cookie->id_lang); + $carriers = Carrier::getCarriers($cookie->id_lang); + $countries = Country::getCountries($cookie->id_lang); + $confs = Configuration::getMultiple(array('PS_SHOP_NAME', 'EMC_LOGIN', 'EMC_GENDER', 'EMC_LAST_NAME', 'EMC_FIRST_NAME', 'EMC_ADDRESS', 'EMC_ZIP_CODE', 'EMC_CITY', 'EMC_COUNTRY', + 'EMC_PHONE', 'EMC_EMAIL')); + $link = ''; + + + $this->_html .= '
        + +
        '.$this->l('Description').' +

        '.$this->l('This module allows you to compare carrier offers and online ordering services\' negotiated delivery rates.').'

        +

        '.$this->l('Please enter your Envoimoinscher username below. If you are not a customer Envoimoinscher, you can easily create an account by clicking').$link.' + '.$this->l('here').'.


        +

        '.$this->l('Download Documentation').'

        +
        +
         
        + +
        '.$this->l('Settings').' + +
        + + * +

        ' . $this->l('Choose width in the list') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Choose Height in the list') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Choose Depth in the list') . '

        +
        +
         
        + + +
        + +

        '. $this->l('Choose the packaging by default.').'

        +
        +
         
        + + +
        '. + self::selectNature(Tools::getValue('type_objet', Configuration::get('EMC_CONTENT'))). + '

        '. $this->l('Choose the Nature of content by default.').'

        +
        +
         
        + + +
        + + * +

        '. $this->l('Choose the order state to export to Envoi Moins Cher.').'

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Choose a carrier in the list') . '

        +
        +
         
        + + +
        + + * +

        '. $this->l('Choose the order state past.').'

        +
        +
         
        + + +
        + + * +

        '. $this->l('Choose the order state send.').'

        +
        +
         
        '; + + //objet livré (pas géré actuellement) + $this->_html .= ' +
        + + * +

        '. $this->l('Choose the order state delivered.').'

        +
        +
         
        '; + + $this->_html .= ' + +
        + + + + +

        '.$this->l('Enables or disables sending mail from EMC');//.', '.$this->l('unless it informs the recipient that it is sent by default.').'

        + $this->_html .= '
        +
         
        + + +
        + + * +

        ' . $this->l('Set your EMC login') . '

        +
        +
         
        + +

        ----------------------------------------------------------------------------------------

        +

        '.$this->l('Sender Information').' :

        + +
        + M. + Mme +

        ' . $this->l('Select gender of sender') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the Last Name of sender') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the First name of sender') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the Address of sender') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the zip code of sender') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the city of sender') . '

        +
        +
         
        + + +
        + * +

        ' . $this->l('Select the country of sender in the list') . '

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the Phone of sender').'

        +
        +
         
        + + +
        + + * +

        ' . $this->l('Set the e-mail of sender').'

        +
        +
         
        + +
        + +
        +
        +
         
        '; + + } + + private function _postValidation() + { + if (Tools::getValue('EMC_WIDTH') == 0) + $this->_postErrors[] = $this->l('Width not specified'); + if (Tools::getValue('EMC_HEIGHT') == 0) + $this->_postErrors[] = $this->l('Height not specified'); + if (Tools::getValue('EMC_DEPTH') == 0) + $this->_postErrors[] = $this->l('Depth not specified'); + if (Tools::getValue('EMC_ORDER_STATE') == 0) + $this->_postErrors[] = $this->l('Order state not specified'); + if (Tools::getValue('EMC_CARRIER') == 0) + $this->_postErrors[] = $this->l('Carrier not specified'); + if (Tools::getValue('EMC_ORDER_PAST_STATE') == 0) + $this->_postErrors[] = $this->l('Order state "order past" not specified'); + if (Tools::getValue('EMC_SEND_STATE') == 0) + $this->_postErrors[] = $this->l('Order state send not specified'); + if (Tools::getValue('EMC_DELIVERY_STATE') == 0) + $this->_postErrors[] = $this->l('Order state delivery not specified'); + if (Tools::getValue('EMC_LAST_NAME') == '') + $this->_postErrors[] = $this->l('Last name not specified'); + if (Tools::getValue('EMC_FIRST_NAME') == '') + $this->_postErrors[] = $this->l('First name not specified'); + if (Tools::getValue('EMC_ADDRESS') == '') + $this->_postErrors[] = $this->l('Address not specified'); + if (Tools::getValue('EMC_ZIP_CODE') == '') + $this->_postErrors[] = $this->l('Zip Code not specified'); + if (Tools::getValue('EMC_CITY') == '') + $this->_postErrors[] = $this->l('City not specified'); + if (Tools::getValue('EMC_COUNTRY') == '') + $this->_postErrors[] = $this->l('Country not specified'); + if (Tools::getValue('EMC_PHONE') == '') + $this->_postErrors[] = $this->l('Phone not specified'); + if (Tools::getValue('EMC_EMAIL') == '') + $this->_postErrors[] = $this->l('E-mail not specified'); + if (Tools::getValue('EMC_LOGIN') == '') + $this->_postErrors[] = $this->l('Login not specified'); + } + + private function _postProcess() + { + if (Configuration::updateValue('EMC_WIDTH', (int)(Tools::getValue('EMC_WIDTH'))) AND Configuration::updateValue('EMC_HEIGHT', (int)(Tools::getValue('EMC_HEIGHT'))) AND + Configuration::updateValue('EMC_DEPTH', (int)(Tools::getValue('EMC_DEPTH'))) AND Configuration::updateValue('EMC_ORDER_STATE', (int)(Tools::getValue('EMC_ORDER_STATE'))) AND + Configuration::updateValue('EMC_CARRIER', (int)(Tools::getValue('EMC_CARRIER'))) AND Configuration::updateValue('EMC_PACKAGING_DEFAULT', Tools::getValue('EMC_PACKAGING_DEFAULT')) + AND Configuration::updateValue('EMC_GENDER', Tools::getValue('EMC_GENDER')) AND Configuration::updateValue('EMC_LAST_NAME', Tools::getValue('EMC_LAST_NAME')) + AND Configuration::updateValue('EMC_FIRST_NAME', Tools::getValue('EMC_FIRST_NAME')) AND Configuration::updateValue('EMC_ADDRESS', Tools::getValue('EMC_ADDRESS')) + AND Configuration::updateValue('EMC_ZIP_CODE', Tools::getValue('EMC_ZIP_CODE')) AND Configuration::updateValue('EMC_CITY', Tools::getValue('EMC_CITY')) + AND Configuration::updateValue('EMC_COUNTRY', Tools::getValue('EMC_COUNTRY')) AND Configuration::updateValue('EMC_PHONE', Tools::getValue('EMC_PHONE')) + AND Configuration::updateValue('EMC_EMAIL', Tools::getValue('EMC_EMAIL')) AND Configuration::updateValue('EMC_ORDER_PAST_STATE', Tools::getValue('EMC_ORDER_PAST_STATE')) + AND Configuration::updateValue('EMC_SEND_STATE', Tools::getValue('EMC_SEND_STATE')) AND Configuration::updateValue('EMC_EMAILS', Tools::getValue('EMC_EMAILS')) + AND Configuration::updateValue('EMC_LOGIN', Tools::getValue('EMC_LOGIN')) AND Configuration::updateValue('EMC_CONTENT', Tools::getValue('type_objet_')) + AND Configuration::updateValue('EMC_DELIVERY_STATE', Tools::getValue('EMC_DELIVERY_STATE'))) + { + $dataSync = (($emc_login = Configuration::get('EMC_LOGIN')) + ? '' : ''); + $this->_html .= $this->displayConfirmation($this->l('Configuration updated').$dataSync); + } + else + $this->_html .= '
        nok '.$this->l('Settings failed').'
        '; + } + + static function selectNature($selected = '', $id = '') + { + $select = ''; + return $select; + } + + public function hookAdminOrder($params) + { + + $order = new Order($params['id_order']); + if ($order->id_carrier == Configuration::get('EMC_CARRIER')) + { + $return = Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'envoimoinscher WHERE id_order = \''.(int)($order->id).'\' LIMIT 1'); + if (isset($return[0]['shipping_number'])) + { + $html = '

        '.$this->l('Envoimoinscher').''; + $html .= ''.$this->l('Delivery Information').' :
        + '.(isset($return[0]['shipping_number']) ? '

        --> + '.$this->l('Follow shipping').'' : '

        '.$this->l('No shipping number')).'

        ' + .(isset($return[0]['shipping_number']) ?'

        --> + '.$this->l('Print delivery slips').'' : '

        '.$this->l('No delivery slips number')).'

        +
        '; + return $html; + } + } + } + + public function lang($str) + { + switch($str) + { + case 'No order to export': + return $this->l('No order to export'); + break; + case 'Please configure this module in order': + return $this->l('Please configure this module in order'); + break; + case 'Change configuration': + return $this->l('Change configuration'); + break; + case 'ID': + return $this->l('ID'); + break; + case 'Name': + return $this->l('Name'); + break; + case 'Total Cost': + return $this->l('Total Cost'); + break; + case 'Total shipment': + return $this->l('Total shipment'); + break; + case 'Date': + return $this->l('Date'); + break; + case 'Packaging': + return $this->l('Packaging'); + break; + case 'Nature of contents': + return $this->l('Nature of contents'); + break; + case 'Detail': + return $this->l('Detail'); + break; + case 'View': + return $this->l('View'); + break; + case 'Send': + return $this->l('Send'); + break; + case 'List of orders to export': + return $this->l('List of orders to export'); + break; + } + } +} + diff --git a/modules/envoimoinscher/es.php b/modules/envoimoinscher/es.php new file mode 100644 index 000000000..ef80267cc --- /dev/null +++ b/modules/envoimoinscher/es.php @@ -0,0 +1,117 @@ +envoimoinscher_e0b8a2c577580cb773bda0486acc4bf8'] = 'Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bbd983fbdc5928ce36d6edce53639718'] = 'Encuentre el mejor precio para su envío. Compare y pida ofertas a transportistas, a precios negociados. '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cc89336eed19f4c3bef8ae484eb43109'] = '\'Ancho\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fab811cb477e7794389f16624ac9aff9'] = '\'Alto\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7854da902d5f2ad746fe1b6f950da08e'] = '\'Profundo\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_63a0a494ef3c3c22829660ef6081dce4'] = '\'Estados\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_786b7b25dcd85d7e972a377f56facb5a'] = '\'Transportista\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1a3ade81b4ddac3ff0fe9f98f93ad843'] = 'Estado pedido efectuado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_070d4ccfe53bdbc791cbd6119b872f34'] = 'Estado pedido enviada'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c98d7be3b0acc53f7d2142cc3a3ab444'] = 'Estado pedido entragado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4d470fde8487e755a50e9235e3dc13ab'] = 'debe estar configurado para utilizar este módulo correctamente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9d766be2c89b5af0010ac0c11dcddae7'] = 'Por favor, copie a mano'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6357d3551190ec7e79371a8570121d3a'] = 'Hay'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ce81305b7edb043d0a7a5c75cab17d0'] = 'Hay'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_07213a0161f52846ab198be103b5ab43'] = 'Errores'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Error'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_667f01ead42da9ba606aaee5632f1cd0'] = 'Crear su cuenta Enviemoinscher:'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8fc0ba19a15eeb50ab4ad8db449b0c74'] = 'Para crear su cuenta Envoimoinscher pulse en la imagen? Accederá a un espacio personal en el que encontrará todas las herramientas que permiten una gestión sencilla y rápida de sus envíos. '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_82b213c84c7cf648a3cc9e718bb0f1c5'] = 'Este módulo le permite comparar ofertas de transporte y tarifas de entrega negociadas para servicios de pedidos en línea . '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b843f182d32b5571e48879444311c38b'] = 'Debe introducir su nombre de usuario Envoimoinscher más abajo. Si todavía no es cliente de Envoimoinscher, puede crear fácilmente una cuenta haciendo clic'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c92285fa6d3e827b198d120ea3ac674'] = 'aquí'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d64b03d7cc357f2ac9c63f8c88b49a0'] = 'Bajar la documentación'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f4f70727dc34561dfde1a3c529b6205c'] = 'Confuguración'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_32954654ac8fe66a1d09be19001de2d4'] = 'Ancho'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_af7bb0f5eddd2287cf3f6b880d189e19'] = 'Elegir una característica...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_31f12b07ff0701df3b6000412952f9c7'] = 'Elegir la característica \"ancho\" en la lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eec6c4bdbd339edf8cbea68becb85244'] = 'Alto'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_97fd502c6a75bfb727fbb5a93d3bc60b'] = 'Elegir la característica \"alto\" en la lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_675056ad1441b6375b2c5abd48c27ef1'] = 'Profundo'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ccccb5efc77dfc62afb2c5ad4223916d'] = 'Elegir la característica \"profundo\" en la lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a669003ea35aa39ca280b83bd259a032'] = 'Embalaje'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_86a0b81400546aa3bbfe94b796ed6c31'] = 'Elegir un embalaje...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16ef6ec0f179beeae1a68c4ebef97254'] = 'Elegir un embalaje por defecto'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f0c28b9363b60ed0a4579291ca510544'] = 'Naturaleza delo contenido'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_55303dad425107852ebecc47601f73e2'] = 'Elegir la naturaleza de los contenidos de forma predeterminada.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e74b7618bb3f99b8a7c00ef765c727eb'] = 'Estado de pedidos a enviar'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_509d517463244dcd1ec09c4c5fa266ac'] = 'Elegir un estado de pedido...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bb4b4f2503c57254aaed1f1a07bb71da'] = 'Elegir un estado de pedido en la lista a exportar hacia Enviemoinscher.com'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_914419aa32f04011357d3b604a86d7eb'] = 'Transportista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6f2a31a74727092b14a9f25fa0761f4'] = 'Elegir un transportista...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a22d9830367fdf0f6b2601e7484b387'] = 'Elegir un transportista en la lista a exportar hacia Enviemoinscher.com'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2aad255fde4750af3f559d078e1cb420'] = 'Estado pedido realizado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd77298d81e440f5379f48dccf993a8b'] = 'Elegir un estado de pedido en la lista \"Pedido realizado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8532ff05a8576bdc04f8a9b8b1dbbfbc'] = 'Estado de pedido enviado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5af6d17d6837ce556286d019e06e4e0'] = 'Elegir un estado de pedido en la lista \"Pedido enviado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d2392c7501c4041d990cc0d372cde50a'] = 'Estado de pedido entregado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b06087cef2468e82e0e07499fdba5c30'] = 'Elegir un estado de pedido en la lista \"Pedido entregado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1e884e3078d9978e216a027ecd57fb34'] = 'Correo electrónico'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9e839460f2871eb777da1b74f3fab03e'] = 'Activar o desactivar el envío de emails de parte de Enviemoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a995d9073f999ae5713f6994092b57e'] = 'excepto la notificación al destinatario que es enviada por defecto'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7a16e0022af67a71b8d1521f746f41b3'] = 'Login Enviemoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6ef6eed8e2c2d13d6823cbff8f139bad'] = 'Introduzca su login Enviemoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a861c864b470344da673354f996ce0a7'] = 'Información del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_019ec3132cdf8ee0f2e2a75cf5d3e459'] = 'Sexo'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5f33341287efce675cacf0b3ed818e70'] = 'Elegir el sexo del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d3f5eff9c40ee315d452392bed5309b'] = 'Apellido'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8cf6db4af977baa86b7691da80601bd0'] = 'Introducir el apellido del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nombre'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49a768ce02314f39d386a66b77ae1858'] = 'Introducir el nombre del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a56f1882e859d6ce5b0fbc96c544100'] = 'Introducir la dirección del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_642d3ba5db8b57e006584b544e490ec7'] = 'Código postal'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16e65be7ad7680a7148b8ddf0b5b4171'] = 'Introducir el código del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_57d056ed0984166336b7879c2af3657f'] = 'Ciudad'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e73af174484a98a10a852ab5bdb701bf'] = 'Introducir la ciudad del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_59716c97497eb9694541f7c3d37b1a4d'] = 'País'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_255529f7845194a47b4c2e28374cdb1f'] = 'Elegir un país'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c820bc5f65e6258a648c3621b7b761e'] = 'Introducir el país del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bcc254b55c4a1babdf1dcb82c207506b'] = 'Teléfono'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6770d2600f6b45aa0b18dd9a6e39b2f8'] = 'Introducir el teléfono del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43cdf4833105e72eb951833a030ad4d5'] = 'Introducir el email del remitente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1fa598730b02d78aa07d07337c81c720'] = 'Falta información \"alto\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c5ac8560e3b92c7941286fa8c2b3a1ed'] = 'Falta información \"ancho\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_0eed429f3ae1e71de73b94e13f786893'] = 'Falta información \"profundo\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5d50fc169bba225de3df710ff98188c6'] = 'Falta información \"estado de pedido\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_340ffdfdc019d0b001a4753b57aa398a'] = 'Falta información \"transportista\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ecdf47576d5d0d024f30199900c1761'] = 'Falta información estado \"pedido realizado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6a9265e0dcf5d7a7f331055b9b93609'] = 'Falta información estado \"pedido enviado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9f3440922590dae1ebc28c40555c6203'] = 'Falta información estado \"pedido entregado\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43b89b46dcf9440d5f852548ac5341a3'] = 'Falta apellido'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9a6dfbad73e6a8a852d4b1a266e941d2'] = 'Falta nombre'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fdda31acf2551d1edde59d64144975b8'] = 'Falta dirección'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_01fc0f14742ba00423886a14e31964de'] = 'Falta código postal'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2814eaaff876f0a3f29d87b23ceaa041'] = 'Falta ciudad'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ae21c3189ecc1e32d10e8f3b264af190'] = 'Falta país'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_829d5874145d3477d778cdff96671448'] = 'Falta teléfono'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a3b23591400c94a94583a94c0ab1f19f'] = 'Falta email'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_18f54b7a823f3349d841804a9fbc5aa3'] = 'Login Enviemoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9284bff13acffdd879ef4ac7fca5234'] = 'Fallaron los ajustes'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1b67f24ea45fdf2e11ad8f6e777e8c8b'] = 'Información de entrega'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fad2b83dc128dfb793fa8ee944dd9931'] = 'Seguimiento del paquete'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d668e43f1d8b0584ed4f896de031d921'] = 'No hay número de seguimiento'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bee4b55285d16e5fe85fc3474e343c51'] = 'Imprimir el albarán de expedición'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_10f0b7273755ee4117c1517010e18c23'] = 'No hay número de expedición'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9ab3e83b1071d09ca62e4cd258686f6b'] = 'Ningún pedido para exportar'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8c193493d8e4a97dc6da02d9809be530'] = 'Por favor, configure este módulo '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2345e28c9b93f368968be4781ed70f5c'] = 'Modificación de la configuración'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_50e91dab2a063bc8c1dbc383b0c8e71c'] = 'Coste Total'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5e8ff31378107b80ae8a9e7cd93eb1bc'] = 'total del envío'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_403ddddf1f3eecc1a2566b3d81e12993'] = 'Naturaleza del contenido'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a254c25adc7d10d7e9c4889484f875a5'] = 'Detalle'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4351cfebe4b61d8aa5efa1d020710005'] = 'Ver'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_94966d90747b97d1f0f206c98a8b1ac3'] = 'Enviar'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eae21050d83c239d047c9eb0d3bc930e'] = 'Lista de pedidos para exportar'; diff --git a/modules/envoimoinscher/fr.php b/modules/envoimoinscher/fr.php new file mode 100755 index 000000000..1085244a2 --- /dev/null +++ b/modules/envoimoinscher/fr.php @@ -0,0 +1,117 @@ +envoimoinscher_e0b8a2c577580cb773bda0486acc4bf8'] = 'Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bbd983fbdc5928ce36d6edce53639718'] = 'Trouvez le meilleur prix pour votre envoi. Comparez et commandez les offres des transporteurs, à des tarifs négociés.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cc89336eed19f4c3bef8ae484eb43109'] = '\'Largeur\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fab811cb477e7794389f16624ac9aff9'] = '\'Hauteur\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7854da902d5f2ad746fe1b6f950da08e'] = '\'Profondeur\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_63a0a494ef3c3c22829660ef6081dce4'] = '\'Statuts\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_786b7b25dcd85d7e972a377f56facb5a'] = '\'Transporteur\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1a3ade81b4ddac3ff0fe9f98f93ad843'] = 'Statut commande passée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_070d4ccfe53bdbc791cbd6119b872f34'] = 'Statut commande envoyée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c98d7be3b0acc53f7d2142cc3a3ab444'] = 'Statut commande livrée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4d470fde8487e755a50e9235e3dc13ab'] = 'doit être configuré pour utiliser ce module correctement'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9d766be2c89b5af0010ac0c11dcddae7'] = 'S\'il vous plaît copier manuellement'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6357d3551190ec7e79371a8570121d3a'] = 'Il y a'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ce81305b7edb043d0a7a5c75cab17d0'] = 'Il y a'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_07213a0161f52846ab198be103b5ab43'] = 'Erreurs'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Erreur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_667f01ead42da9ba606aaee5632f1cd0'] = 'Créer son compte Envoimoinscher :'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8fc0ba19a15eeb50ab4ad8db449b0c74'] = 'Pour créer votre compte Envoimoinscher cliquez sur l\'image ci-dessous. Vous allez accéder à un espace personnel dédié sur lequel vous retrouverez tous les outils permettant une gestion facile et rapide de vos envois.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_82b213c84c7cf648a3cc9e718bb0f1c5'] = 'Ce module vous permet de comparer les offres des transporteurs et de commander en ligne des prestations de livraison à des tarifs négociés.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b843f182d32b5571e48879444311c38b'] = 'Vous devrez renseigner votre identifiant Envoimoinscher ci-dessous. Si vous n\'êtes pas encore client Envoimoinscher, vous pouvez créer un compte très facilement en cliquant'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c92285fa6d3e827b198d120ea3ac674'] = 'ici'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d64b03d7cc357f2ac9c63f8c88b49a0'] = 'Télécharger la documentation'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_32954654ac8fe66a1d09be19001de2d4'] = 'Largeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_af7bb0f5eddd2287cf3f6b880d189e19'] = 'Choisir une caractéristique ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_31f12b07ff0701df3b6000412952f9c7'] = 'Choisir la caractéristique \"largeur\" dans la liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eec6c4bdbd339edf8cbea68becb85244'] = 'Hauteur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_97fd502c6a75bfb727fbb5a93d3bc60b'] = 'Choisir la caractéristique \"hauteur\" dans la liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_675056ad1441b6375b2c5abd48c27ef1'] = 'Profondeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ccccb5efc77dfc62afb2c5ad4223916d'] = 'Choisir la caractéristique \"profondeur\" dans la liste'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a669003ea35aa39ca280b83bd259a032'] = 'Conditionnement'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_86a0b81400546aa3bbfe94b796ed6c31'] = 'Choisir un conditionnement ... '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16ef6ec0f179beeae1a68c4ebef97254'] = 'Choisir un conditionnement par défaut'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f0c28b9363b60ed0a4579291ca510544'] = 'Contenu'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_55303dad425107852ebecc47601f73e2'] = 'Choisir le contenu par défaut'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e74b7618bb3f99b8a7c00ef765c727eb'] = 'Statut de commandes à envoyer'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_509d517463244dcd1ec09c4c5fa266ac'] = 'Choisir un statut de commande ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bb4b4f2503c57254aaed1f1a07bb71da'] = 'Choisir un statut de commande dans la liste à exporter vers Envoimoinscher.com'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6f2a31a74727092b14a9f25fa0761f4'] = 'Choisir un transporteur ... '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a22d9830367fdf0f6b2601e7484b387'] = 'Choisir un transporteur dans la liste à exporter vers Envoimoinscher.com'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2aad255fde4750af3f559d078e1cb420'] = 'Statut commande passée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd77298d81e440f5379f48dccf993a8b'] = 'Choisir un statut de commande dans la liste \"Commande passée\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8532ff05a8576bdc04f8a9b8b1dbbfbc'] = 'Statut commande envoyée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5af6d17d6837ce556286d019e06e4e0'] = 'Choisir un statut de commande dans la liste \"Commande envoyée\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d2392c7501c4041d990cc0d372cde50a'] = 'Statut commande livrée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b06087cef2468e82e0e07499fdba5c30'] = 'Choisir un statut de commande dans la liste \"Commande livrée\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1e884e3078d9978e216a027ecd57fb34'] = 'Mails'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9e839460f2871eb777da1b74f3fab03e'] = 'Active ou désactive l\'envoi de mails de la part de Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a995d9073f999ae5713f6994092b57e'] = 'sauf la notification au destinataire qui est envoyée par défaut'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7a16e0022af67a71b8d1521f746f41b3'] = 'Identifiant Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6ef6eed8e2c2d13d6823cbff8f139bad'] = 'Saisir votre Identifiant Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a861c864b470344da673354f996ce0a7'] = 'Informations sur l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_019ec3132cdf8ee0f2e2a75cf5d3e459'] = 'Sexe'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5f33341287efce675cacf0b3ed818e70'] = 'Choisir le sexe de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d3f5eff9c40ee315d452392bed5309b'] = 'Nom de famille'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8cf6db4af977baa86b7691da80601bd0'] = 'Saisir le nom de famille de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20db0bfeecd8fe60533206a2b5e9891a'] = 'Prénom'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49a768ce02314f39d386a66b77ae1858'] = 'Saisir le prénom de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a56f1882e859d6ce5b0fbc96c544100'] = 'Saisir l\'adresse de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_642d3ba5db8b57e006584b544e490ec7'] = 'Code postal'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16e65be7ad7680a7148b8ddf0b5b4171'] = 'Saisir le code postal de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_57d056ed0984166336b7879c2af3657f'] = 'Ville'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e73af174484a98a10a852ab5bdb701bf'] = 'Saisir la ville de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_255529f7845194a47b4c2e28374cdb1f'] = 'Choisir un pays'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c820bc5f65e6258a648c3621b7b761e'] = 'Saisir le pays de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bcc254b55c4a1babdf1dcb82c207506b'] = 'Téléphone'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6770d2600f6b45aa0b18dd9a6e39b2f8'] = 'Saisir le téléphone de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43cdf4833105e72eb951833a030ad4d5'] = 'Saisir l\'email de l\'expéditeur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1fa598730b02d78aa07d07337c81c720'] = 'Largeur non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c5ac8560e3b92c7941286fa8c2b3a1ed'] = 'Hauteur non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_0eed429f3ae1e71de73b94e13f786893'] = 'Profondeur non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5d50fc169bba225de3df710ff98188c6'] = 'Statut de commande non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_340ffdfdc019d0b001a4753b57aa398a'] = 'Transporteur non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ecdf47576d5d0d024f30199900c1761'] = 'Statut \"commande passée\" non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6a9265e0dcf5d7a7f331055b9b93609'] = 'Statut \"commande envoyée\" non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9f3440922590dae1ebc28c40555c6203'] = 'Statut \"commande livrée\" non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43b89b46dcf9440d5f852548ac5341a3'] = 'Nom de famille non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9a6dfbad73e6a8a852d4b1a266e941d2'] = 'Prénom non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fdda31acf2551d1edde59d64144975b8'] = 'Adresse non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_01fc0f14742ba00423886a14e31964de'] = 'Code postal non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2814eaaff876f0a3f29d87b23ceaa041'] = 'Ville non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ae21c3189ecc1e32d10e8f3b264af190'] = 'Pays non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_829d5874145d3477d778cdff96671448'] = 'Téléphone non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a3b23591400c94a94583a94c0ab1f19f'] = 'Email non renseignée'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_18f54b7a823f3349d841804a9fbc5aa3'] = 'Login Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9284bff13acffdd879ef4ac7fca5234'] = 'Configuration échoué'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1b67f24ea45fdf2e11ad8f6e777e8c8b'] = 'Informations de transporteur'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fad2b83dc128dfb793fa8ee944dd9931'] = 'Suivre le colis'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d668e43f1d8b0584ed4f896de031d921'] = 'Pas de numéro de suivi'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bee4b55285d16e5fe85fc3474e343c51'] = 'Imprimer le bordereau d\'expédition'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_10f0b7273755ee4117c1517010e18c23'] = 'Pas de numéro d\'expédition'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9ab3e83b1071d09ca62e4cd258686f6b'] = 'Aucune commande pour l\'export'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8c193493d8e4a97dc6da02d9809be530'] = 'Merci de configurer ce module'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2345e28c9b93f368968be4781ed70f5c'] = 'Modification de la configuration'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_50e91dab2a063bc8c1dbc383b0c8e71c'] = 'Coût total'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5e8ff31378107b80ae8a9e7cd93eb1bc'] = 'Total expédition '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_403ddddf1f3eecc1a2566b3d81e12993'] = 'Nature du contenu'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a254c25adc7d10d7e9c4889484f875a5'] = 'Détails'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eae21050d83c239d047c9eb0d3bc930e'] = 'Liste des commandes à exporter'; diff --git a/modules/envoimoinscher/install.sql b/modules/envoimoinscher/install.sql new file mode 100755 index 000000000..e608afdf3 --- /dev/null +++ b/modules/envoimoinscher/install.sql @@ -0,0 +1,84 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_envoimoinscher_contenu` ( + `id` int(6) NOT NULL, + `abrv` varchar(10) character set utf8 NOT NULL, + `libelle` text character set utf8 NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +INSERT INTO `PREFIX_envoimoinscher_contenu` (`id`, `abrv`, `libelle`) VALUES +(50450, 'outi', 'Outillage, outils, bricolage'), +(50430, 'moto', 'Motos, scooters'), +(50420, 'motr', 'Moteurs'), +(50170, 'horl', 'Montres, horlogerie (hors bijoux)'), +(50100, 'med', 'Matériel médical'), +(50395, 'elec', 'Matériel électrique, transfo., câbles'), +(50390, 'labo', 'Matériel de labo, optique, de mesure'), +(50380, 'chff', 'Matériel de chauffage, chaudronnerie'), +(50360, 'musi', 'Instruments de musique et accessoires'), +(50110, 'info', 'Informatique, High tech, téléphonie fixe'), +(50400, 'fbur', 'Fournitures de bureau, papeterie, recharges'), +(50120, 'div', 'Autres appareils et matériels'), +(50350, 'spor', 'Articles de sport (hors vêtement)'), +(50330, 'camp', 'Articles de camping, de pêche'), +(40120, 'usag', 'Vêtements usagés'), +(40110, 'tiss', 'Tissus, vêtements neufs'), +(40130, 'cuir', 'Cuirs, peaux, maroquinerie'), +(40100, 'chau', 'Chaussures'), +(50160, 'bij', 'Bijoux, objets précieux'), +(40150, 'bijf', 'Bijoux fantaisie'), +(40125, 'vest', 'Accessoires vestimentaires, de mode'), +(50190, 'tab', 'Tabac'), +(30200, 'pharm', 'Pharmacie, médicaments'), +(50200, 'parf', 'Parfums'), +(30100, 'cosm', 'Cosmétiques, bien-être'), +(30300, 'chim', 'Chimie, droguerie, produits d''entretien'), +(20105, 'surg', 'Produits surgelés'), +(20103, 'refr', 'Produits réfrigérés'), +(20102, 'frai', 'Produits frais et périssables'), +(20130, 'plant', 'Plantes, fleurs, semences'), +(20100, 'alim', 'Denrées alimentaires non périssables'), +(20110, 'nalc', 'Boissons non alcoolisées'), +(20120, 'alc', 'Boissons alcoolisées'), +(10180, 'radio', 'Radiographies'), +(10210, 'prop', 'Propositions commerciales'), +(10250, 'plan', 'Plans, dessins'), +(10190, 'photo', 'Photographies'), +(10280, 'patr', 'Patrons'), +(10160, 'pass', 'Passeports'), +(10140, 'tech', 'Manuels techniques'), +(10130, 'mag', 'Magazines, revues'), +(10150, 'livr', 'Livres'), +(10240, 'list', 'Listings informatiques'), +(10120, 'journ', 'Journaux'), +(10290, 'etiq', 'Etiquettes, autocollants'), +(10100, 'ssval', 'Documents sans valeur commerciale'), +(10220, 'pub', 'Documents publicitaires'), +(10260, 'impr', 'Documents d''impression'), +(10300, 'apof', 'Documents d''appels d''offres'), +(10200, 'courr', 'Courrier interne d''entreprise'), +(10230, 'rapp', 'Catalogues, rapports annuels'), +(10170, 'bill', 'Billets d''avion'), +(50140, 'auto', 'Pièces de rechange et accessoires (auto)'), +(50150, 'rech', 'Pièces de rechange et accessoires (autres)'), +(50490, 'plom', 'Plomberie, sanitaire, tubes plastiques'), +(50500, 'quin', 'Quincaillerie, robinetterie, serrurerie'), +(50130, 'num', 'Supports numériques, CD, DVD'), +(50113, 'cell', 'Téléphonie mobile et accessoires'), +(50114, 'tvec', 'Téléviseurs, écrans d''ordinateur'), +(50440, 'velo', 'Vélos, cycles sans moteur'), +(60122, 'miro', 'Autres objets d''art et tableaux'), +(60130, 'frag', 'Autres objets fragiles'), +(60129, 'cera', 'Céramique, verres, cristallerie'), +(60110, 'emgr', 'Electroménager '), +(60124, 'lamp', 'Lampes, luminaire'), +(60108, 'moba', 'Mobilier ancien (antiquité)'), +(60100, 'mob', 'Mobilier d''habitation'), +(60102, 'mobb', 'Mobilier de bureau'), +(60105, 'mobn', 'Mobilier démonté sous emballage'), +(60120, 'antiq', 'Objets et tableaux cotés, miroirs, vitres'), +(60112, 'pelc', 'Petit électroménager, petits appareils ménagers'), +(60126, 'tapi', 'Tapis'), +(60128, 'toil', 'Toiles, rideaux, draps'), +(70100, 'baga', 'Bagages, valises, malles'), +(50180, 'cad', 'Cadeaux, cadeaux entreprise'), +(70200, 'carto', 'Cartons de déménagement, effets personnels'); \ No newline at end of file diff --git a/modules/envoimoinscher/it.php b/modules/envoimoinscher/it.php new file mode 100644 index 000000000..465d5c818 --- /dev/null +++ b/modules/envoimoinscher/it.php @@ -0,0 +1,117 @@ +envoimoinscher_e0b8a2c577580cb773bda0486acc4bf8'] = 'Envoimoinscher'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bbd983fbdc5928ce36d6edce53639718'] = 'Trova la tariffa migliore per la tua spedizione. Confronta e metti in ordine le offerte di corrieri, a tariffe negoziate.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cc89336eed19f4c3bef8ae484eb43109'] = '\'Larghezza\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fab811cb477e7794389f16624ac9aff9'] = '\'Altezza\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7854da902d5f2ad746fe1b6f950da08e'] = '\'Profondità\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_63a0a494ef3c3c22829660ef6081dce4'] = '\'Stato Ordine\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_786b7b25dcd85d7e972a377f56facb5a'] = '\'Corriere\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1a3ade81b4ddac3ff0fe9f98f93ad843'] = '\'Stato ordine passato\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_070d4ccfe53bdbc791cbd6119b872f34'] = '\'Stato ordine Inviato\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c98d7be3b0acc53f7d2142cc3a3ab444'] = '\'Stato ordine consegnato\''; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4d470fde8487e755a50e9235e3dc13ab'] = 'deve essere configurato per utilizzare questo modulo correttamente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9d766be2c89b5af0010ac0c11dcddae7'] = 'Copia manualmente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6357d3551190ec7e79371a8570121d3a'] = 'Ci sono'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ce81305b7edb043d0a7a5c75cab17d0'] = 'C\'è'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_07213a0161f52846ab198be103b5ab43'] = 'errori'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_cb5e100e5a9a3e7f6d1fd97512215282'] = 'errore'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_667f01ead42da9ba606aaee5632f1cd0'] = 'Crea un account Envoimoinscher:'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8fc0ba19a15eeb50ab4ad8db449b0c74'] = 'Per creare il tuo account Envoimoinscher clicca sull\'immagine qui sotto. Sarai indirizzato ad uno spazio dedicato personale, dove trovi tutti gli strumenti per una facile gestione delle tue spedizioni.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_82b213c84c7cf648a3cc9e718bb0f1c5'] = 'Questo modulo permette di confrontare le offerte dei corrieri e servizi di ordine online a tariffe di consegna. negoziate'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b843f182d32b5571e48879444311c38b'] = 'Devi inserire il tuo nome utente Envoimoinscher qui di seguito. Se non sei ancora un cliente Envoimoinscher, puoi facilmente creare un account cliccando'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c92285fa6d3e827b198d120ea3ac674'] = 'qui'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d64b03d7cc357f2ac9c63f8c88b49a0'] = 'Download Documentazione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_32954654ac8fe66a1d09be19001de2d4'] = 'Larghezza'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_af7bb0f5eddd2287cf3f6b880d189e19'] = 'Scegli una funzione ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_31f12b07ff0701df3b6000412952f9c7'] = 'Scegli la larghezza della lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eec6c4bdbd339edf8cbea68becb85244'] = 'Altezza'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_97fd502c6a75bfb727fbb5a93d3bc60b'] = 'Scegli Altezza nella lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_675056ad1441b6375b2c5abd48c27ef1'] = 'Profondità'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ccccb5efc77dfc62afb2c5ad4223916d'] = 'Scegli profondità nella lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a669003ea35aa39ca280b83bd259a032'] = 'Confezione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_86a0b81400546aa3bbfe94b796ed6c31'] = 'Scegli una confezione...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16ef6ec0f179beeae1a68c4ebef97254'] = 'Scegli la confezione di default.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_f0c28b9363b60ed0a4579291ca510544'] = 'Natura dei contenuti'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_55303dad425107852ebecc47601f73e2'] = 'Scegli la natura dei contenuti di default.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e74b7618bb3f99b8a7c00ef765c727eb'] = 'Stato dell\'ordine da esportare'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_509d517463244dcd1ec09c4c5fa266ac'] = 'Scegli uno stato ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bb4b4f2503c57254aaed1f1a07bb71da'] = 'Scegliere lo stato di ordine per esportare a Envoi Moins Cher.'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_914419aa32f04011357d3b604a86d7eb'] = 'Corriere'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6f2a31a74727092b14a9f25fa0761f4'] = 'Scegli un corriere...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a22d9830367fdf0f6b2601e7484b387'] = 'Scegli un corriere nella lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2aad255fde4750af3f559d078e1cb420'] = 'Stato dell\'ordine \"Ordine passato\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd77298d81e440f5379f48dccf993a8b'] = 'Scegli l\'ordine \"Ordine passato\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8532ff05a8576bdc04f8a9b8b1dbbfbc'] = 'Stato dell\'ordine inviato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b5af6d17d6837ce556286d019e06e4e0'] = 'Scegli l\'ordine \"Ordine inviato\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d2392c7501c4041d990cc0d372cde50a'] = 'Stato dell\'ordine consegnato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b06087cef2468e82e0e07499fdba5c30'] = 'Scegli l\'ordine \"Ordine consegnato\"'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9e839460f2871eb777da1b74f3fab03e'] = 'Attiva o disattiva l\'invio di posta da EMC'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a995d9073f999ae5713f6994092b57e'] = 'a meno che non informi il destinatario che viene inviato per default'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_7a16e0022af67a71b8d1521f746f41b3'] = 'Login EMC'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6ef6eed8e2c2d13d6823cbff8f139bad'] = 'Imposta il tuo login EMC'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a861c864b470344da673354f996ce0a7'] = 'Informazioni mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_019ec3132cdf8ee0f2e2a75cf5d3e459'] = 'Sesso'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5f33341287efce675cacf0b3ed818e70'] = 'Seleziona sesso del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8d3f5eff9c40ee315d452392bed5309b'] = 'Cognome'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8cf6db4af977baa86b7691da80601bd0'] = 'Imposta il Cognome del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nome'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49a768ce02314f39d386a66b77ae1858'] = 'Imposta il nome del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4a56f1882e859d6ce5b0fbc96c544100'] = 'Imposta l\'indirizzo del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_642d3ba5db8b57e006584b544e490ec7'] = 'CAP'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_16e65be7ad7680a7148b8ddf0b5b4171'] = 'Impostare il CAP del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_57d056ed0984166336b7879c2af3657f'] = 'City'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_e73af174484a98a10a852ab5bdb701bf'] = 'Imposta il nome della città del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_59716c97497eb9694541f7c3d37b1a4d'] = 'Paese'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_255529f7845194a47b4c2e28374cdb1f'] = 'Scegli un paese ...'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6c820bc5f65e6258a648c3621b7b761e'] = 'Seleziona il paese del mittente nella lista'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bcc254b55c4a1babdf1dcb82c207506b'] = 'Telefono'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_6770d2600f6b45aa0b18dd9a6e39b2f8'] = 'Imposta il telefono del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43cdf4833105e72eb951833a030ad4d5'] = 'Imposta la mail del mittente'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1fa598730b02d78aa07d07337c81c720'] = 'Larghezza non specificata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c5ac8560e3b92c7941286fa8c2b3a1ed'] = 'Altezza non specificata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_0eed429f3ae1e71de73b94e13f786893'] = 'Profondità non specificata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5d50fc169bba225de3df710ff98188c6'] = 'Stato dell\'ordine non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_340ffdfdc019d0b001a4753b57aa398a'] = 'Corriere non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4ecdf47576d5d0d024f30199900c1761'] = 'Stato dell\'ordine \"ordine passato\" non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_c6a9265e0dcf5d7a7f331055b9b93609'] = 'Stato dell\'ordine \"inviato\" non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9f3440922590dae1ebc28c40555c6203'] = 'Stato dell\'ordine \"consegna\" non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_43b89b46dcf9440d5f852548ac5341a3'] = 'Cognome non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9a6dfbad73e6a8a852d4b1a266e941d2'] = 'Nome non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fdda31acf2551d1edde59d64144975b8'] = 'Indirizzo non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_01fc0f14742ba00423886a14e31964de'] = 'CAP non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2814eaaff876f0a3f29d87b23ceaa041'] = 'Città non specificata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_ae21c3189ecc1e32d10e8f3b264af190'] = 'Paese non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_829d5874145d3477d778cdff96671448'] = 'Telefono non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a3b23591400c94a94583a94c0ab1f19f'] = 'E-mail non specificata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_18f54b7a823f3349d841804a9fbc5aa3'] = 'Login non specificato'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b9284bff13acffdd879ef4ac7fca5234'] = 'Impostazioni non riuscite'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_1b67f24ea45fdf2e11ad8f6e777e8c8b'] = 'Informazioni sulla consegna'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_fad2b83dc128dfb793fa8ee944dd9931'] = 'Segui la spedizione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_d668e43f1d8b0584ed4f896de031d921'] = 'Nessun numero di spedizione '; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_bee4b55285d16e5fe85fc3474e343c51'] = 'Stampa note di consegna'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_10f0b7273755ee4117c1517010e18c23'] = 'Nessun numero di note di consegna'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_9ab3e83b1071d09ca62e4cd258686f6b'] = 'Nessun ordine da esportare'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_8c193493d8e4a97dc6da02d9809be530'] = 'Si prega di configurare questo modulo, al fine'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_2345e28c9b93f368968be4781ed70f5c'] = 'Modifica la configurazione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_50e91dab2a063bc8c1dbc383b0c8e71c'] = 'Costo totale'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_5e8ff31378107b80ae8a9e7cd93eb1bc'] = 'totale della spedizione'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_403ddddf1f3eecc1a2566b3d81e12993'] = 'Natura del contenuto'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_a254c25adc7d10d7e9c4889484f875a5'] = 'Dettaglio'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_94966d90747b97d1f0f206c98a8b1ac3'] = 'Invia'; +$_MODULE['<{envoimoinscher}prestashop>envoimoinscher_eae21050d83c239d047c9eb0d3bc930e'] = 'Elenco degli ordini per l\'esportazione'; diff --git a/modules/envoimoinscher/logo.gif b/modules/envoimoinscher/logo.gif new file mode 100755 index 000000000..5528809a7 Binary files /dev/null and b/modules/envoimoinscher/logo.gif differ diff --git a/modules/envoimoinscher/logocarre.png b/modules/envoimoinscher/logocarre.png new file mode 100755 index 000000000..2d1a97835 Binary files /dev/null and b/modules/envoimoinscher/logocarre.png differ diff --git a/modules/envoimoinscher/ps_emc.png b/modules/envoimoinscher/ps_emc.png new file mode 100755 index 000000000..4828ce724 Binary files /dev/null and b/modules/envoimoinscher/ps_emc.png differ diff --git a/modules/envoimoinscher/tracking.php b/modules/envoimoinscher/tracking.php new file mode 100755 index 000000000..8b751622c --- /dev/null +++ b/modules/envoimoinscher/tracking.php @@ -0,0 +1,109 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include('../../config/config.inc.php'); +include('../../init.php'); + +global $cookie; + +$validReturn = array('infoexterne','token','etat','envoi'); + +$return = array(); +foreach ($_GET AS $key => $val) + if (in_array(strtolower($key),$validReturn)) + $return[strtolower($key)] = utf8_encode(urldecode(stripslashes($val))); + +if (isset($return['infoexterne']) AND isset($return['token']) AND isset($return['etat'])) +{ + $id_order = str_replace(str_replace('.','_',str_replace('www.','',$_SERVER['HTTP_HOST'])).'_','',$return['infoexterne']); + + $order = new Order((int)($id_order)); + $customer = new Customer((int)($order->id_customer)); + $confs = Configuration::getMultiple(array('EMC_SEND_STATE', 'EMC_ORDER_PAST_STATE', 'EMC_DELIVERY_STATE')); + + if ($customer->secure_key != $return['token']) + d(Tools::displayError('Hack attempt')); + else + { + switch($return['etat']) + { + //commande pass�e + case 'CMD' : + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState((int)($confs['EMC_ORDER_PAST_STATE']), (int)($history->id_order)); + $history->id_employee = (int)($cookie->id_employee); + $history->addWithemail(); + + $db = Db::getInstance(); + $db->ExecuteS('SELECT * FROM '._DB_PREFIX_.'envoimoinscher WHERE id_order = '.(int)($id_order)); + $numRows = (int)($db->NumRows()); + if ($numRows == 0) + { + if (Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'envoimoinscher VALUES (\''.(int)($id_order).'\', \''.$return['envoi'].'\');')); + } + else + { + if (Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'envoimoinscher SET shipping_number=\''.$return['envoi'].'\' WHERE id_order=\''.(int)($id_order).'\' ')); + } + + break; + //colis (ou autre objet) envoy� + case 'ENV' : + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState((int)($confs['EMC_SEND_STATE']), (int)($history->id_order)); + $history->id_employee = (int)($cookie->id_employee); + $history->addWithemail(); + break; + //envoi annul� + case 'ANN' : + $message = new Message(); + $texte = 'Envoi Moins cher : envoi annul�'; + $message->message = htmlentities($texte, ENT_COMPAT, 'UTF-8'); + $message->id_order = (int)($id_order); + $message->private = 1; + $message->add(); + break; + //objet livr� (pas g�r� actuellement) + case 'LIV' : + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState((int)($confs['EMC_DELIVERY_STATE']), (int)($history->id_order)); + $history->id_employee = (int)($cookie->id_employee); + $history->addWithemail(); + break; + + + } + + + } +} +else +d(Tools::displayError('Hack attempt')); + diff --git a/modules/fedexcarrier/RateService_v9.wsdl b/modules/fedexcarrier/RateService_v9.wsdl new file mode 100644 index 000000000..1cffc40e6 --- /dev/null +++ b/modules/fedexcarrier/RateService_v9.wsdl @@ -0,0 +1,4756 @@ + + + + + + + + + Specifies additional labels to be produced. All required labels for shipments will be produced without the need to request additional labels. These are only available as thermal labels. + + + + + The type of additional labels to return. + + + + + The number of this type label to return + + + + + + + Identifies the type of additional labels. + + + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address is residential (as opposed to commercial). + + + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + + + + + + Identification of the type of barcode (symbology) used on FedEx documents and labels. + + + + + + + + + + + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...) + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + + + Specifies the type of brokerage to be applied to a shipment. + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating. + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + Indicates the region from which the transaction is submitted. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + Identifies what freight charges should be added to the COD collect amount. + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Identifies if freight charges are to be added to the COD amount. This element determines which freight charges should be added to the COD collect amount. See CodAddTransportationChargesType for a list of valid enumerated values. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through the FedEx Systems. Customers are responsible for printing their own Commercial Invoice.If you would likeFedEx to generate a Commercial Invoice and transmit it to Customs. for clearance purposes, you need to specify that in the ShippingDocumentSpecification element. If you would like a copy of the Commercial Invoice that FedEx generated returned to you in reply it needs to be specified in the ETDDetail/RequestedDocumentCopies element. Commercial Invoice support consists of maximum of 99 commodity line items. + + + + + Any comments that need to be communicated about this shipment. + + + + + Any freight charges that are associated with this shipment. + + + + + Any taxes or miscellaneous charges(other than Freight charges or Insurance charges) that are associated with this shipment. + + + + + Any packing costs that are associated with this shipment. + + + + + Any handling costs that are associated with this shipment. + + + + + Free-form text. + + + + + Free-form text. + + + + + Free-form text. + + + + + The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice. + + + + + Descriptive text for the purpose of the shipment. + + + + + Customer assigned invoice number. + + + + + Name of the International Expert that completed the Commercial Invoice different from Sender. + + + + + Required for dutiable international Express or Ground shipment. This field is not applicable to an international PIB(document) or a non-document which does not require a Commercial Invoice. + + + + + + + The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced. + + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + + + Information about the transit time and delivery commitment date and time. + + + + + The Commodity applicable to this commitment. + + + + + The FedEx service type applicable to this commitment. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + THe delivery commitment date/time. Express Only. + + + + + The delivery commitment day of the week. + + + + + The number of transit days; applies to Ground and LTL Freight; indicates minimum transit time for SmartPost. + + + + + Maximum number of transit days, for SmartPost shipments. + + + + + The service area code for the destination of this shipment. Express only. + + + + + The address of the broker to be used for this shipment. + + + + + The FedEx location identifier for the broker. + + + + + The delivery commitment date/time the shipment will arrive at the border. + + + + + The delivery commitment day of the week the shipment will arrive at the border. + + + + + The number of days it will take for the shipment to make it from broker to destination + + + + + The delivery commitment date for shipment served by GSP (Global Service Provider) + + + + + The delivery commitment day of the week for the shipment served by GSP (Global Service Provider) + + + + + Messages concerning the ability to provide an accurate delivery commitment on an International commit quote. These could be messages providing information about why a commitment could not be returned or a successful message such as "REQUEST COMPLETED" + + + + + Messages concerning the delivery commitment on an International commit quote such as "0:00 A.M. IF NO CUSTOMS DELAY" + + + + + Information about why a shipment delivery is delayed and at what level (country/service etc.). + + + + + + Required documentation for this shipment. + + + + + Freight origin and destination city center information and total distance between origin and destination city centers. + + + + + + + The type of delay this shipment will encounter. + + + + + + + + + + + + + + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. + If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + + total number of pieces of this commodity + + + + + total number of pieces of this commodity + + + + + Complete and accurate description of this commodity. + + 450 + + + + + + Country code where commodity contents were produced or manufactured in their final form. + + 2 + + + + + + + Unique alpha/numeric representing commodity item. + At least one occurrence is required for US Export shipments if the Customs Value is greater than $2500 or if a valid US Export license is required. + + + 14 + + + + + + Total weight of this commodity. 1 explicit decimal position. Max length 11 including decimal. + + + + + Number of units of a commodity in total number of pieces for this line item. Max length is 9 + + + + + Unit of measure used to express the quantity of this commodity line item. + + 3 + + + + + + Contains only additional quantitative information other than weight and quantity to calculate duties and taxes. + + + + + Value of each unit in Quantity. Six explicit decimal positions, Max length 18 including decimal. + + + + + + Total customs value for this line item. + It should equal the commodity unit quantity times commodity unit value. + Six explicit decimal positions, max length 18 including decimal. + + + + + + Defines additional characteristic of commodity used to calculate duties and taxes + + + + + Applicable to US export shipping only. + + 12 + + + + + + + + An identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment. + + + 15 + + + + + + All data required for this commodity in NAFTA Certificate of Origin. + + + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + 1 of 12 possible zones to position data. + + + + + The identifiying text for the data in this zone. + + + + + A reference to a field in either the request or reply to print in this zone following the header. + + + + + A literal value to print after the header in this zone. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + 120 + 35 + + + + + + + + + + + + + + + + + + + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + The currency code for the original (converted FROM) currency. + + + + + The currency code for the final (converted INTO) currency. + + + + + Multiplier used to convert fromCurrency units to intoCurrency units. + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + Data required to produce a custom-specified document, either at shipment or package level. + + + + + Common information controlling document production. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Identifies the formatting specification used to construct this custom document. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified barcode symbology. + + + + + + + + + Width of thinnest bar/space element in the barcode. + + + + + + + + Solid (filled) rectangular area on label. + + + + + + + + + + + + + + + + + + + + + + + + Image to be included from printer's memory, or from a local file for offline clients. + + + + + + Printer-specific index of graphic image to be printed. + + + + + Fully-qualified path and file name for graphic image to be printed. + + + + + + + + + Horizontal position, relative to left edge of custom area. + + + + + Vertical position, relative to top edge of custom area. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified printer font (for thermal labels) or generic font/size (for plain paper labels). + + + + + + + + Printer-specific font name for use with thermal printer labels. + + + + + Generic font name for use with plain paper labels. + + + + + Generic font size for use with plain paper labels. + + + + + + + + + + + + + + + + + + + Reference information to be associated with this package. + + + + + + + + + + + + + + + + + + + + + + + Allows customer-specified control of label content. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + Defines any custom content to print on the label. + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + Controls which data/sections will be suppressed. + + + + + The language to use when printing the terms and conditions on the label. + + + + + Controls the number of additional copies of supplemental labels. + + + + + This value reduces the default quantity of destination/consignee air waybill labels. A value of zero indicates no change to default. A minimum of one copy will always be produced. + + + + + + + + + + Descriptive data identifying the Broker responsible for the shipmet. + Required if BROKER_SELECT_OPTION is requested in Special Services. + + + + + + Interacts both with properties of the shipment and contractual relationship with the shipper. + + + + + + Applicable only for Commercial Invoice. If the consignee and importer are not the same, the Following importer fields are required. + Importer/Contact/PersonName + Importer/Contact/CompanyName + Importer/Contact/PhoneNumber + Importer/Address/StreetLine[0] + Importer/Address/City + Importer/Address/StateOrProvinceCode - if Importer Country Code is US or CA + Importer/Address/PostalCode - if Importer Country Code is US or CA + Importer/Address/CountryCode + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Indicates how payment of duties for the shipment will be made. + + + + + Indicates whether this shipment contains documents only or non-documents. + + + + + The total customs value for the shipment. This total will rrepresent th esum of the values of all commodities, and may include freight, miscellaneous, and insurance charges. Must contain 2 explicit decimal positions with a max length of 17 including the decimal. For Express International MPS, the Total Customs Value is in the master transaction and all child transactions + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + Documents amount paid to third party for coverage of shipment content. + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through FedEx System. Customers are responsible for printing their own Commercial Invoice. Commercial Invoice support consists of a maximum of 20 commodity line items. + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. + If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + + Country specific details of an International shipment. + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin. + + + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + + + + + The descriptive data required for a FedEx shipment containing dangerous goods (hazardous materials). + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + Shipment is packaged/documented for movement ONLY on cargo aircraft. + + + + + Indicates which kinds of hazardous content are in the current package. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package. + + + + + Description of the packaging of this commodity, suitable for use on OP-900 and OP-950 forms. + + + + + Telephone number to use for contact in the event of an emergency. + + + + + + + + + + + + + + + + + + + + + + + + + + Information about why a shipment delivery is delayed and at what level( country/service etc.). + + + + + The date of the delay + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + The point where the delay is occurring (e.g. Origin, Destination, Broker location) + + + + + The reason for the delay (e.g. holiday, weekend, etc.). + + + + + The name of the holiday in that country that is causing the delay. + + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + + + + + + + + + + The point where the delay is occurring ( e.g. Origin, Destination, Broker location). + + + + + + + + + + + + Data required to complete the Destionation Control Statement for US exports. + + + + + + Comma-separated list of up to four country codes, required for DEPARTMENT_OF_STATE statement. + + + + + Name of end user, required for DEPARTMENT_OF_STATE statement. + + + + + + + Used to indicate whether the Destination Control Statement is of type Department of Commerce, Department of State or both. + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + + + + + + + + + + + + + Driving or other transportation distances, distinct from dimension measurements. + + + + + Identifies the distance quantity. + + + + + Identifies the unit of measure for the distance value. + + + + + + + + + + + + + + + The DocTabContentType options available. + + + + + The DocTabContentType should be set to ZONE001 to specify additional Zone details. + + + + + The DocTabContentType should be set to BARCODED to specify additional BarCoded details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone number can be between 1 and 12. + + + + + Header value on this zone. + + + + + Reference path to the element in the request/reply whose value should be printed on this zone. + + + + + Free form-text to be printed in this zone. + + + + + Justification for the text printed on this zone. + + + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. + + + + + + + + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + Email address to send the URL to. + + + + + A message to be inserted into the email. + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + A message that will be included in the email notifications + + 120 + + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + The format of the email. + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + 120 + 35 + + + + + + + Notify the email recipient when this shipment has been shipped. + + + + + Notify the email recipient if this shipment encounters a problem while in route + + + + + Notify the email recipient when this shipment has been delivered. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + + + + + + + Customer-declared value, with data type and legal values depending on excise condition, used in defining the taxable value of the item. + + + + + + + Specifies the types of Estimated Duties and Taxes to be included in a rate quotation for an international shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + Currently not supported. + + + + + + + + Country specific details of an International shipment. + + + + + + Specifies which filing option is being exercised by the customer. + Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + Required only if B13AFilingOption is one of the following: + FILED_ELECTRONICALLY + MANUALLY_ATTACHED + SUMMARY_REPORTING + If B13AFilingOption = NOT_REQUIRED, this field should contain a valid B13A Exception Number. + + + 50 + + + + + + This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters allowed. + + 10 + + + + + + Department of Commerce/Department of State information about this shipment. + + + + + + + Details specific to an Express freight shipment. + + + + + Indicates whether or nor a packing list is enclosed. + + + + + + Total shipment pieces. + ie. 3 boxes and 3 pallets of 100 pieces each = Shippers Load and Count of 303. + Applicable to International Priority Freight and International Economy Freight. + Values must be in the range of 1 - 99999 + + + + + + Required for International Freight shipping. Values must be 8- 12 characters in length. + + 12 + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + + Currently not supported. Delivery contact information for an Express freight shipment. + + + + + + + + + Indicates a FedEx Express operating region. + + + + + + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + Specifies the optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + + + + + + + + + + + + + + + + Individual charge which contributes to the total base charge for the shipment. + + + + + Freight class for this line item. + + + + + Effective freight class used for rating this line item. + + + + + NMFC Code for commodity. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + Rate or factor applied to this line item. + + + + + Identifies the manner in which the chargeRate for this line item was applied. + + + + + The net or extended charge for this line item. + + + + + + + + + + + + + + + + + + + + These values represent the industry-standard freight classes used for FedEx Freight and FedEx National Freight shipment description. (Note: The alphabetic prefixes are required to distinguish these values from decimal numbers on some client platforms.) + + + + + + + + + + + + + + + + + + + + + + + + + Information about the Freight Service Centers associated with this shipment. + + + + + Information about the origin Freight Service Center. + + + + + Information about the destination Freight Service Center. + + + + + The distance between the origin and destination FreightService Centers + + + + + + + + + + Date for all Freight guarantee types. + + + + + Time for GUARANTEED_TIME only. + + + + + + + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + + + + + Rate data specific to FedEx Freight or FedEx National Freight services. + + + + + A unique identifier for a specific rate quotation. + + + + + Specifies the way in which base charges for a Freight shipment are calculated. + + + + + Freight charges which accumulate to the total base charge for the shipment. + + + + + Human-readable descriptions of additional information on this shipment rating. + + + + + + + Additional non-monetary data returned with Freight rates. + + + + + Unique identifier for notation. + + + + + Human-readable explanation of notation. + + + + + + + This class describes the relationship between a customer-specified address and the FedEx Freight / FedEx National Freight Service Center that supports that address. + + + + + Freight Industry standard non-FedEx carrier identification + + + + + The name of the Interline carrier. + + + + + Additional time it might take at the origin or destination to pickup or deliver the freight. This is usually due to the remoteness of the location. This time is included in the total transit time. + + + + + Service branding which may be used for local pickup or delivery, distinct from service used for line-haul of customer's shipment. + + + + + Distance between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Time to travel between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Specifies when/how the customer can arrange for pickup or delivery. + + + + + Specifies days of operation if localServiceScheduling is LIMITED. + + + + + Freight service center that is a gateway on the border of Canada or Mexico. + + + + + Alphabetical code identifying a Freight Service Center + + + + + Freight service center Contact and Address + + + + + + + Specifies the type of service scheduling offered from a Freight or National Freight Service Center to a customer-supplied address. + + + + + + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Account number used with FEDEX_FREIGHT service. + + + + + Used for validating FedEx Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Account number used with FEDEX_NATIONAL_FREIGHT service. + + + + + Used for validating FedEx National Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Indicates the role of the party submitting the transaction. + + + + + Designates which of the requester's tariffs will be used for rating. + + + + + Identifies the declared value for the shipment + + + + + Identifies the declared value units corresponding to the above defined declared value + + + + + + Identifiers for promotional discounts offered to customers. + + + + + Total number of individual handling units in the entire shipment (for unit pricing). + + + + + Estimated discount rate provided by client for unsecured rate quote. + + + + + Total weight of pallets used in shipment. + + + + + Overall shipment dimensions. + + + + + Description for the shipment. + + + + + Specifies which party will pay surcharges for any special services which support split billing. + + + + + Details of the commodities in the shipment. + + + + + + + Description of an individual commodity or class of content in a shipment. + + + + + Freight class for this line item. + + + + + Specification of handling-unit packaging for this commodity or class line. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + FED EX INTERNAL USE ONLY - Individual line item dimensions. + + + + + Volume (cubic measure) for this commodity or class line. + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Specifies which party will be responsible for payment of any surcharges for Freight special services for which split billing is allowed. + + + + + Identifies the special service. + + + + + Indicates who will pay for the special service. + + + + + + + Data required to produce a General Agency Agreement document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + + + + + + + Specifies how the commodity is to be labeled. + + + + + + + + + + Customer-provided specifications for handling individual commodities. + + + + + Specifies how the customer wishes the label text to be handled for this commodity in this package. + + + + + Text used in labeling the commodity under control of the labelTextOption field. + + + + + + + Indicates which kind of hazardous content (as defined by DOT) is being reported. + + + + + + + + + + + + Identifies number and type of packaging units for hazardous commodities. + + + + + Number of units of the type below. + + + + + Units in which the hazardous commodity is packaged. + + + + + + + Identifies DOT packing group for a hazardous commodity. + + + + + + + + + + Identifies amount and units for quantity of hazardous commodities. + + + + + Number of units of the type below. + + + + + Units by which the hazardous commodity is measured. + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + 15 + + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + Location identification (for facilities identified by an alphanumeric location code). + + + + + Location identification (for facilities identified by an numeric location code). + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + + + + + + + + + + + + + + + + + The type of International shipment. + + + + + + + + + Specifies the type of label to be returned. + + + + + + + + + + + + Names for data elements / areas which may be suppressed from printing on labels. + + + + + + + + + + + + + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + + + + + Relative to normal orientation for the printer. RIGHT=90 degrees clockwise, UPSIDE_DOWN=180 degrees, LEFT=90 degrees counterclockwise. + + + + + + + + + + + Description of shipping label to be returned in the reply + + + + + Specify type of label to be returned + + + + + + The type of image or printer commands the label is to be formatted in. + DPL = Unimark thermal printer language + EPL2 = Eltron thermal printer language + PDF = a label returned as a pdf image + PNG = a label returned as a png image + ZPLII = Zebra thermal printer language + + + + + + For thermal printer lables this indicates the size of the label and the location of the doc tab if present. + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + Relative to normal orientation for the printer. RIGHT=90 degrees clockwise, UPSIDE_DOWN=180 degrees, LEFT=90 degrees counterclockwise. + + + + + If present, this contact and address information will replace the return address information on the label. + + + + + Allows customer-specified control of label content. + + + + + + + For thermal printer labels this indicates the size of the label and the location of the doc tab if present. + + + + + + + + + + + + + + + + + + + + + + Identifies the Liability Coverage Amount. For Jan 2010 this value represents coverage amount per pound + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + + + + + + + Internal FedEx use only. + + + + + + + + + + + + + + + + + + Data required to produce a Certificate of Origin document. + + + + + + + Indicates which Party (if any) from the shipment is to be used as the source of importer data on the NAFTA COO form. + + + + + Contact information for "Authorized Signature" area of form. + + + + + + + + + + + + Defined by NAFTA regulations. + + + + + Defined by NAFTA regulations. + + + + + Identification of which producer is associated with this commodity (if multiple producers are used in a single shipment). + + + + + + Date range over which RVC net cost was calculated. + + + + + + + + + + + + + + + + Net cost method used. + + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + 8 + + + + + + Human-readable text that explains this notification. + + 255 + + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The instructions indicating how to print the OP-900 form for hazardous materials packages. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Identifies which reference type (from the package's customer references) is to be used as the source for the reference on this OP-900. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + The Oversize classification for a package. + + + + + + + + + + Data for a package's rates, as calculated per a specific rate type. + + + + + Type used for this specific set of rate data. + + + + + Indicates which weight was used. + + + + + Internal FedEx use only. + + + + + The weight that was used to calculate the rate. + + + + + The dimensional weight of this package (if greater than actual). + + + + + The oversize weight of this package (if the package is oversize). + + + + + The transportation charge only (prior to any discounts applied) for this package. + + + + + The sum of all discounts on this package. + + + + + This package's baseCharge - totalFreightDiscounts. + + + + + The sum of all surcharges on this package. + + + + + This package's netFreight + totalSurcharges (not including totalTaxes). + + + + + The sum of all taxes on this package. + + + + + This package's netFreight + totalSurcharges + totalTaxes. + + + + + The total sum of all rebates applied to this package. + + + + + All rate discounts that apply to this package. + + + + + All rebates that apply to this package. + + + + + All surcharges that apply to this package (either because of characteristics of the package itself, or because it is carrying per-shipment surcharges for the shipment of which it is a part). + + + + + All taxes applicable (or distributed to) this package. + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + + + Identifies the collection of special services offered by FedEx. + + + + + + + + + + + + + + These special services are available at the package level for some or all service types. If the shipper is requesting a special service which requires additional data, the package special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment or package. + + + + + For use with FedEx Ground services only; COD must be present in shipment's special services. + + + + + Descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType.DANGEROUS_GOODS or HAZARDOUS_MATERIAL is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment containing dry ice. This element is required when SpecialServiceType.DRY_ICE is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx signature services. This element is required when SpecialServiceType.SIGNATURE_OPTION is present in the SpecialServiceTypes collection. + + + + + To be filled. + + + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + + + + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + Descriptive data for taxpayer identification information. + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Identifies the method of payment for a service. + + + + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + + + + + + + This information describes the kind of pending shipment being requested. + + + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class describes the pickup characteristics of a shipment (e.g. for use in a tag request). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Currently not supported. + + + + + + + + + + + + + + + + + + Identifies the type of dim divisor that was applied. + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + Identifies the type of discount applied to the shipment. + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + + + The response to a RateRequest. The Notifications indicate whether the request was successful or not. + + + + + This indicates the highest level of severity of all the notifications returned in this reply. + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Contains the CustomerTransactionId that was sent in the request. + + + + + The version of this reply. + + + + + Each element contains all rate data for a single service. If service was specified in the request, there will be a single entry in this array; if service was omitted in the request, there will be a separate entry in this array for each service being compared. + + + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + + + + + Identification of an airport, using standard three-letter abbreviations. + + + + + Indicates whether or not this shipment is eligible for a money back guarantee. + + + + + Commitment code for the origin. + + + + + Commitment code for the destination. + + + + + Time in transit from pickup to delivery. + + + + + Maximum expected transit time. + + + + + The signature option for this package. + + + + + The actual rate type of the charges for this package. + + + + + Each element contains all rate data for a single rate type. + + + + + + + Descriptive data sent to FedEx by a customer in order to rate a package/shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Allows the caller to specify that the transit time and commit data are to be returned in the reply. + + + + + Candidate carriers for rate-shopping use case. This field is only considered if requestedShipment/serviceType is omitted. + + + + + Contains zero or more service options whose combinations are to be considered when replying with available services. + + + + + The shipment for which a rate quote (or rate-shopping comparison) is desired. + + + + + + + Indicates the type of rates to be returned. + + + + + + + + + If requesting rates using the PackageDetails element (one package at a time) in the request, the rates for each package will be returned in this element. Currently total piece total weight rates are also retuned in this element. + + + + + Echoed from the corresponding package in the rate request (if provided). + + + + + Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item. + + + + + The difference between "list" and "account" net charge. + + + + + Ground COD is package level. + + + + + + Rate data that are tied to a specific package and rate type combination. + + + + + + + This class groups the shipment and package rating data for a specific rate type for use in a rating reply, which groups result data by rate type. + + + + + The difference between "list" and "account" total net charge. + + + + + Ground COD is package level. + + + + + The shipment-level totals for this rate type. + + + + + The package-level data for this rate type. + + + + + + + The method used to calculate the weight to be used in rating the package.. + + + + + + + + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Specifies the kind of identification being used. + + + + + Contains the actual ID value, of the type specified above. + + + + + + + Type of Brazilian taxpayer identifier provided in Recipient/TaxPayerIdentification/Number. For shipments bound for Brazil this overrides the value in Recipient/TaxPayerIdentification/TinType + + + + + + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin + + + + + + + + + + + + + + + + + This class rationalizes RequestedPackage and RequestedPackageSummary from previous interfaces. The way in which it is uses within a RequestedShipment depends on the RequestedPackageDetailType value specified for that shipment. + + + + + Used only with INDIVIDUAL_PACKAGE, as a unique identifier of each requested package. + + + + + Used only with PACKAGE_GROUPS, as a unique identifier of each group of identical packages. + + + + + Used only with PACKAGE_GROUPS, as a count of packages within a group of identical packages. + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalInsuredValue and packageCount on the shipment will be used to determine this value. + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalweight and packageCount on the shipment will be used to determine this value. + + + + + + Provides additional detail on how the customer has physically packaged this item. As of June 2009, required for packages moving under international and SmartPost services. + + + + + Human-readable text describing the package. + + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. + + + + + + + The descriptive data for the shipment being tendered to FedEx. + + + + + Identifies the date and time the package is tendered to FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the shipment based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). There is also a UTC offset component indicating the number of hours/mainutes from UTC (e.g 2006-06-26T17:00:00-0400 is defined form June 26, 2006 5:00 pm Eastern Time). + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. See DropoffType for list of valid enumerated values. + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Identifies the total weight of the shipment being conveyed to FedEx.This is only applicable to International shipments and should only be used on the first package of a mutiple piece shipment.This value contains 1 explicit decimal position + + + + + Total insured amount. + + + + + Descriptive data identifying the party responsible for shipping the package. Shipper and Origin should have the same address. + + + + + Descriptive data identifying the party receiving the package. + + + + + A unique identifier for a recipient location + + 10 + + + + + + Physical starting address for the shipment, if different from shipper's address. + + + + + Descriptive data indicating the method and means of payment to FedEx for providing shipping services. + + + + + Descriptive data regarding special services requested by the shipper for this shipment. If the shipper is requesting a special service which requires additional data (e.g. COD), the special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object. For example, to request COD, "COD" must be included in the SpecialServiceTypes collection and the CodDetail object must contain the required data. + + + + + Details specific to an Express freight shipment. + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Used with Ground Home Delivery and Freight. + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Customs clearance data, used for both international and intra-country shipping. + + + + + For use in "process tag" transaction. + + + + + + If true, only the shipper/payor will have visibility of this shipment. + + + + + Details about the image format and printer type the label is to returned in. + + + + + Details such as shipping document types, NAFTA information, CI information, and GAA information. + + + + + Specifies whether and what kind of rates the customer wishes to have quoted on this shipment. The reply will also be constrained by other data on the shipment and customer. + + + + + Specifies whether the customer wishes to have Estimated Duties and Taxes provided with the rate quotation on this shipment. Only applies with shipments moving under international services. + + + + + For a multiple piece shipment this is the total number of packages in the shipment. + + + + + Specifies whether packages are described individually, in groups, or summarized in a single description for total-piece-total-weight. This field controls which fields of the RequestedPackageLineItem will be used, and how many occurrences are expected. + + + + + One or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics all packages in the shipment. + + + + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. At present the only type of retrun shipment that is supported is PRINT_RETURN_LABEL. With this option you can print a return label to insert into the box of an outbound shipment. This option can not be used to print an outbound label. + + + + + Return Merchant Authorization + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + The "PAYOR..." rates are expressed in the currency identified in the payor's rate table(s). The "RATED..." rates are expressed in the currency of the origin country. + + + + + + + + + + + + + + + Return Merchant Authorization + + + + + Return Merchant Authorization Number + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + These values control the optional features of service that may be combined in a commitment/rate comparision transaction. + + + + + + + + + + + Supporting detail for applied options identified in a rate quote. + + + + + Identifies the type of Freight Guarantee applied, if FREIGHT_GUARANTEE is applied to the rate quote. + + + + + Identifies the smartPostHubId used during rate quote, if SMART_POST_HUB_ID is a variable option on the rate request. + + + + + Identifies the indicia used during rate quote, if SMART_POST_ALLOWED_INDICIA is a variable option on the rate request. + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + + + + + + + + + + + + + + + + + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Data for a shipment's total/summary rates, as calculated per a specific rate type. The "total..." fields may differ from the sum of corresponding package data for Multiweight or Express MPS. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + 5 + + + + + + Indicates the rate zone used (based on origin and destination). + + 1 + + + + + + Indicates the type of pricing used for this shipment. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + The value used to calculate the weight based on the dimensions. + + + + + Identifies the type of dim divisor that was applied. + + + + + + The weight used to calculate these rates. + + + + + Sum of dimensional weights for all packages. + + + + + + The total discounts used in the rate calculation. + + + + + The freight charge minus discounts. + + + + + The total amount of all surcharges applied to this shipment. + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + The net charge after applying all discounts and surcharges. + + + + + The total sum of all rebates applied to this shipment. + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + Identifies the collection of special service offered by FedEx. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + The number of packages with dry ice and the total weight of the dry ice. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + + + Electronic Trade document references. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Contains all data required for additional (non-label) shipping documents to be produced in conjunction with a specific shipment. + + + + + Indicates the types of shipping documents requested by the shipper. + + + + + + + Specifies the production of each package-level custom document (the same specification is used for all packages). + + + + + Specifies the production of a shipment-level custom document. + + + + + Details pertaining to the GAA. + + + + + Details pertaining to NAFTA COO. + + + + + Specifies the production of the OP-900 document for hazardous materials packages. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + The descriptive data required for FedEx delivery signature services. + + + + + Identifies the delivery signature services option selected by the customer for this shipment. See OptionType for the list of valid values. + + + + + Identifies the delivery signature release authorization number. + + 10 + + + + + + + + Identifies the delivery signature services options offered by FedEx. + + + + + + + + + + + + These values are mutually exclusive; at most one of them can be attached to a SmartPost shipment. + + + + + + + + + + + + + + + + + + + + + Data required for shipments handled under the SMART_POST and GROUND_SMART_POST service types. + + + + + + + + + + + Indicates which special rating cases applied to this shipment. + + + + + + + + + Identifies each surcharge applied to the shipment. + + + + + The type of surcharge applied to the shipment. + + + + + + + The amount of the surcharge applied to the shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies each tax applied to the shipment. + + + + + + + + + + + + + + + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 18 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + + Required for dutiable international express or ground shipment. This field is not applicable to an international PIB (document) or a non-document which does not require a commercial invoice express shipment. + CFR_OR_CPT (Cost and Freight/Carriage Paid TO) + CIF_OR_CIP (Cost Insurance and Freight/Carraige Insurance Paid) + DDP (Delivered Duty Paid) + DDU (Delivered Duty Unpaid) + EXW (Ex Works) + FOB_OR_FCA (Free On Board/Free Carrier) + + + + + + + + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + 40 + + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Time in transit from pickup to delivery. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + The type of handling charge to be calculated and returned in the reply. + + + + + Used with Variable handling charge type of FIXED_VALUE. Contains the amount to be added to the freight charge. Contains 2 explicit decimal positions with a total max length of 10 including the decimal. + + + + + Used with Variable handling charge types PERCENTAGE_OF_BASE, PERCENTAGE_OF_NET or PERCETAGE_OF_NET_EXCL_TAXES. Used to calculate the amount to be added to the freight charge. Contains 2 explicit decimal positions. + + + + + + + The type of handling charge to be calculated and returned in the reply. + + + + + + + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + The variable handling charge amount calculated based on the requested variable handling charge detail. + + + + + The calculated varibale handling charge plus the net charge. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + + + Three-dimensional volume/cubic measurement. + + + + + + + + + Units of three-dimensional volume/cubic measure. + + + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + 16 + + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + 25 + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. See WeightUnits for the list of valid enumerated values. + + + + + Identifies the weight value of the package/shipment. Contains 1 explicit decimal position + + + + + + + Identifies the unit of measure associated with a weight value. See WeightUnits for the list of valid enumerated values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/fedexcarrier/carrier.jpg b/modules/fedexcarrier/carrier.jpg new file mode 100644 index 000000000..8d29e008e Binary files /dev/null and b/modules/fedexcarrier/carrier.jpg differ diff --git a/modules/fedexcarrier/config.xml b/modules/fedexcarrier/config.xml new file mode 100755 index 000000000..d95d60f1b --- /dev/null +++ b/modules/fedexcarrier/config.xml @@ -0,0 +1,12 @@ + + + fedexcarrier + Fedex Carrier + 0.9c + Offer your customers, different delivery methods with Fedex + PrestaShop + shipping_logistics + 1 + 1 + us + \ No newline at end of file diff --git a/modules/fedexcarrier/de.php b/modules/fedexcarrier/de.php new file mode 100644 index 000000000..38052bd7f --- /dev/null +++ b/modules/fedexcarrier/de.php @@ -0,0 +1,145 @@ +fedexcarrier_c0d00fcb670ada42dad4698b865f40cd'] = 'Fedex Carrier'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0aad1e954489f441f8824e1f990d4774'] = 'Bieten Sie Ihren Kunden unterschiedliche Liefermethoden mit Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff86cba2f7fe4a2dec854d107a4d99d2'] = 'SOAP-Klasse'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_883fa0069f4b0454e2277dd567ab3991'] = '\'Gewichtseinheit (LB oder KG).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5a3ceec65d417f5d92c26dbf0dccc00d'] = '\'Längeneinheit (CM oder IN).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4d470fde8487e755a50e9235e3dc13ab'] = 'muss konfiguriert sein, um dieses Modul richtig nutzen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a1d8be175eff378884736e1b44da526e'] = 'Fedex Konto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c481cd53864462a87dcb89c33589ff8e'] = 'Fedex Zähler'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_918356c887962073f010ee06e1395713'] = 'Fedex Kennwort'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c2b826b79539fa093a6db05ca5ec9e0'] = 'Fedex API Schlüssel'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3ef2f9d666a37f95d963a84c46bae646'] = 'Fedex Standard-Abholungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_72f18dde0a5c9f75dd487adeacb92b56'] = 'Fedex Standard-Verpackungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bb8a37c6acccadf3e28a704d59f1f8a'] = 'Business Service Center'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c0b3132d2759b40e8525f2466c477d1c'] = 'Drop Box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_22db7528d7c5df8e310bf19af75e61d3'] = 'Regelmäßige Abholung'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7e8eb99ef29d93f494ebdc27b59444f5'] = 'Kurier anfordern'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_394a844cc3d6d99eb45b4e71afde2c99'] = 'Station'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_57185ccd597e58ad9e4944f4356222b6'] = 'Fedex 10Kg Box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8ccd685b767c927bca8501ae80d954'] = 'Fedex 25kg Box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_38f14cc3e27cc856e61e3a7f555148d2'] = 'Fedex Box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_36aba1bfaa5062695e71a6524008dd8a'] = 'Fedex Umschlag'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0e6a558b4ce274905600856b20b471e'] = 'FedEx Pak'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b2953c3343913eee2398c1fe2651be7'] = 'Fedex Röhrenpackung'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_451400926783d7a47cd31025717bc97f'] = 'Ihre Verpackung'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46f58e2a308b68cae9d5f5dd8a5d4ad6'] = 'Europe first international Priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0fd6265588d27073ef45ed36d5c00c75'] = 'Fedex Freight 1 Geschäftstag'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dfa184d2bf6a5d6ee8ffebfbaa25394c'] = 'Fedex 2 Geschäftstage'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2c0f88b63bfbe05955db90f1dcccab2e'] = 'Fedex Freight 2 Geschäftstage'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_03aac4b90886eabd480cee819e24d09e'] = 'Fedex Freight 3 Geschäftstage'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_687009f2bc600c25a005b26f4cb4ab02'] = 'Fedex Express Saver'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6e8cf654ec68d7391f5d673331e2c212'] = 'FedEx Freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1497c5bee4dd896e0b84c442be1e8760'] = 'FedEx Ground Bodenversand'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_23044a6996eda8ad80874f5bdd72a0bc'] = 'Fedex national freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4cee621e07c270fb1031f231e592a8cd'] = 'First overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e1416870eb1cf36849393bf6ef6f6966'] = 'Hauszustellung per Bodenversand'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_124dd98ba09563af1900c14885e97d6e'] = 'International economy'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2751413ff6e957a3b6894929b008b123'] = 'Internationale economy freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cebbbe47be59307e1751e2febe44fdc6'] = 'International first'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f3f9ee160906e71040b437410459ec79'] = 'International ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_759d99c1c032d4171c2f142af4f79436'] = 'International priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a8c786474d046ba2b2b90b78a7b498cf'] = 'International priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec25bbf3daf58ec08920a781e25a3f3d'] = 'Priority overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e889962a8517669ba4ac839afa6384df'] = 'smart post'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0a7bd01967a1874144b1b4fab2ee6a6f'] = 'Strandard overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d999f792aee7c730cdc95f6aff4aa436'] = 'FEDEX Carrier'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_99e509958c21ac35438651547a7bb035'] = 'Fedex Modulstatus'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d23a9177c3c7256ede85643a19335afb'] = 'FEDEX Carrier ist richtig konfiguriert und online!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bc95bc43c48a735773d4182dcf526fb'] = 'FEDEX Carrier ist noch nicht konfiguriert, Sie müssen:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e203b9a16f360b88d90bba6eb61ce61'] = 'Das \"Allgemeine Einstellungen\"-Formular ausfüllen '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c0987b9315003df7dae7f130e3cf58e'] = 'Ihren verfügbaren Zustelldienst wählen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e20f6d6f13fe70e78f6e2ab488493ccf'] = 'Webservice Testverbindung'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_807b063fceafae2c51dc6afb45612389'] = 'SOAP ist aktiviert'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_52f4393e1b52ba63e27310ca92ba098c'] = 'Allgemeine Einstellungen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_277d63a9b24a09697e3c64092eaf4353'] = 'Einstellungen der Kategorien '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_098eec2cabe2c39c6dec3fc522b6571a'] = 'Einstellungen der Produkte '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d2126da975d5b9a5b846efaf57d3fd53'] = 'Allgemeine Konfiguration'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a50bb127f9b307757cf52ab86d70adac'] = 'Ihr FedEx Konto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8b0ebd10992bd1576eccf605a84175'] = 'Ihre FedEx Zählernummer'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c36a272a8778a2e85de52a01675fd521'] = 'Ihr FedEx Kennwort'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e2cd475470bc7b47bef8d4ecdae2a67'] = 'Ihr FedEx API Schlüssel'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cdfa1b01c330bf745f776f6c6c8afffd'] = 'Bitte klicken Sie hier, um Ihren Fedex API Schlüssel zu erhalten.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_83ad4fdaf06650e6d9d7ca18f82fb975'] = 'Konfiguration der Lokalisierung '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f489118ea95c746d648d36bb50c226f0'] = 'Gewichtseinheit'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_659c95668841b7d6602ead454b28d4ba'] = 'Die Gewichtseinheit Ihres Shops (z.B. kg oder lbs)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cc13d156306185fd42a860da3049567c'] = 'Maßeinheit'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f804c2bdebc117d9cde3cddad3b49845'] = 'Die Maßeinheit Ihres Shops (z.B. cm oder in)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2481447d04ae756836d32e3ade240ff4'] = 'Adresskonfiguration'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b179e75d464a04d8a04111131b3a3ca'] = 'Ihre Adresszeile 1'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_281b2def1a9737b33f88013c94fdfeb8'] = 'Ihre Adresszeile 2'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d30f507473129e70c4b962ceccf175cf'] = 'Postleitzahl'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0585aac6bb77bb49423b2effca0e067'] = 'Ihre Stadt'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_59716c97497eb9694541f7c3d37b1a4d'] = 'Land'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f8f5a972333ee726fbe5bb52409c0ed0'] = 'Wählen Sie ein Land ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4e9863cf5326e6714388045321665d07'] = 'Wählen Sie ein Land aus der Liste.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46a2a41cc6e552044816a2d04634545d'] = 'Staat'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cf1580798f7aba85d519afadf1ffd886'] = 'Wählen Sie einen Staat ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_02546d525ab356bd43c91e6b07447496'] = 'Es gibt keine Konfiguration des Staats für dieses Land'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ddc2a5660f7d095fff34d6b93077c80'] = 'Service-Konfiguration'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f405714368454e1f9c932432693aea42'] = 'Standard-Abholungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ce135482b30deedcc0046df41c12de79'] = 'Wählen Sie eine Standard-Abholungsart ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a361a1f786db3dfe07aae42752d3446'] = 'Standard-Verpackungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4664d1ae1832bed2246e8a6850365075'] = 'Wählen Sie eine Standard-Verpackungsart ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Liefer-Service'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_78945de8de090e90045d299651a68a9b'] = 'Verfügbar'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'Nicht verfügbar'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d63e135774e62574e2a1921267dad142'] = 'Wählen Sie den Lieferservice, der für die Kunden verfügbar ist.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9b8c4a7116e8c44e4ebc955fafd47586'] = 'Ihr FedEx Konto ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9cc1a101547b3ece6d946dbbe3469d7'] = 'Ihr FedEx Zähler ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ce0f66588bbbbbb3ef0634e5ea7da69'] = 'Ihre FedEx Kennwort ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7988c0adb770f0f945814c0fb2b5800b'] = 'Ihre FedEx API Schlüssel ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5d5ae09e7b6041d3449ef2cbfc39f560'] = 'Ihre Abholungsart ist nicht angegeben '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e794e452ed4d2cfa13083693a2c8810e'] = 'Ihre Verpackungsart ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_805353d2862ea0e658c9ddda871540fa'] = 'Ihre PLZ ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ef9bd955e165dfb0207877e9fe180aeb'] = 'Ihre Stadt ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ecc7697a320f93f3ee8fb4048dbd64c'] = 'Ihr Land ist nicht angegeben'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_729d4f7143a3de7b0ed18de667fdf4d5'] = 'Prestashop konnte keine Verbindung zu den FedEx Webservices herstellen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9d1b485edd50e6fbd288b340b386b07d'] = 'Kein Fehlerbeschreibung gefunden'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9284bff13acffdd879ef4ac7fca5234'] = 'Einstellungen fehlgeschlagen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_67e19ffdaa0a11e69349810403a9727e'] = 'Sie müssen die \"allgemeinen Einstellungen\" konfigurieren, bevor Sie diesen Tab benutzen.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a37b48e8684078c0620a997b3baeee9f'] = 'In diesem Tab können Sie eine spezielle Konfiguration für jede Kategorie einstellen.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f421827ff72ef9a61fb27aa0de62f1e4'] = 'ID Config'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ca2fb7f67355c05d2ffa963fac6e91e1'] = 'Abholungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d9bc28a26253438f5b16cea5eb35681a'] = 'Verpackungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20cde117cbc92b9ec1fb4e5bc4a7b9bd'] = 'Zusätzliche Gebühren'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Dienstleistungen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4f8e00c5ae41d97ab62a947b8e806d55'] = 'Es gibt keine spezifische FEDEX-Konfiguration für Kategorien an dieser Stelle.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f1c611f93510bbee05663c82f6d439e2'] = 'Sind Sie sicher, dass Sie diese spezifische FEDEX Konfiguration für diese Kategorie löschen wollen?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e0cb9fd22b124c0839302fef54762d7'] = ' Regel aktualisieren'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dd593f8a542ab628cbba98c709255e60'] = ' Regel hinzufügen'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1debf905ac528b3f0615cd379ced0d38'] = 'Abholungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b03dfe92d8c5b6a15d3f139998580563'] = 'Wählen Sie eine Abholungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_da42caf26ef85de3d7e48e16ca60b891'] = 'Verpackungsart'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8d2ee0603dfce09b57d60db628cde269'] = 'Wählen Sie eine Verpackungsart ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7fcafa7c47e984693fcb8a92c0fd1beb'] = 'Wählen Sie eine Kategorie ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d725c0166e978cc30853996c70440873'] = 'Sie müssen eine Kategorie auswählen.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff63f917e2a947d454bce41b104cfbd2'] = 'Diese Kategorie hat bereits eine bestimmte FEDEX Konfiguration.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_fd0119c2a5fc18aa64887b5b7ab41c19'] = 'Ein Fehler ist aufgetreten, bitte versuchen Sie es erneut.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20f40087c53c662adfb4e780500eaa15'] = 'In diesem Tab können Sie eine spezielle Konfiguration für jedes Produkt einstellen.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_deb10517653c255364175796ace3553f'] = 'Produkt'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cef3da9171b7ac6d7a6e206e68a2a246'] = 'Es gibt keine spezifische FEDEX-Konfiguration für Produkte an dieser Stelle.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ceb0ede9c02d159aa2360a3d0694d9ed'] = 'Sind Sie sicher, dass Sie diese spezifische FEDEX Konfiguration für dieses Produkt löschen wollen?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3c4d710b56f4318dae775cff80619f84'] = 'Wählen Sie ein Produkt ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c07640370e4681bf98638d0c458cd2e'] = 'Sie müssen ein Produkt auswählen.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8fc3abc76f5a163f81962a52fc5a3703'] = 'Dieses Produkt hat bereits eine bestimmte FEDEX Konfiguration.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c3eacca576fbfc5dca21b50d9f6ef8f'] = 'Willkommen im PrestaShop FEDEX Modul-Konfigurator!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_92640c80a67da1782a18304336405dac'] = 'Dieser Abschnitt wird Ihnen helfen zu verstehen, wie dieses Modul richtig konfiguriert wird.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec0e6948e8f34818d80f27c309f46661'] = 'Siehe unten für die Beschreibung der einzelnen Felder:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b12c6f84e131ed2192e9d9c6c531f239'] = 'Ihr FedEx Konto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ea2cd644fcacb9e8fe1d4c9c89a677b'] = 'Sie Mûssen sich auf der FEDEX Website unter folgender Adresse anmelden'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_35ba940948fa0ea163fd01281de10e2f'] = 'Dieses Feld muss die Postleitzahl Ihres Paketabsendeorts sein.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_81822348ace1ceabad5e9f8992ce9ea4'] = 'Dieses Feld muss das Land Ihres Paketabsendeorts sein.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_74395432668d0313b593712dfc40479a'] = 'Dieses Feld entspricht der Standard-Abholungsart (wenn keine spezielle Konfiguration für das Produkt oder die Produktkategorie vorhanden ist).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9bba478eb4348e49e672e944b072b68'] = 'Diese Kontrollkästchen entsprechen den Zustelldiensten, die verfügbar sein sollen (wenn es keine spezielle Konfiguration für das Produkt oder die Produktkategorie vorhanden ist).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_71ffd676000b4ec8ea95f4096adc3d3c'] = 'Dieser Abschnitt ermöglicht es Ihnen, eine bestimmte FEDEX Konfiguration für jede Produktkategorie (z.B. Verpackungsart und Zusatzkosten) zu definieren.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_89a9eabc8fc9335d484dcb1eb7ef4ac5'] = 'Dieser Abschnitt ermöglicht es Ihnen, eine bestimmte FEDEX Konfiguration für jedes Produkt (z. B. Verpackungsart und Zusatzkosten) zu definieren.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Fehler'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e303843029d99ced59415005037969d'] = 'Fedex Webservice scheint abgeschaltet zu sein, warten Sie bitte ein paar Minuten und versuchen es dann erneut'; diff --git a/modules/fedexcarrier/es.php b/modules/fedexcarrier/es.php new file mode 100644 index 000000000..c5acd85e5 --- /dev/null +++ b/modules/fedexcarrier/es.php @@ -0,0 +1,145 @@ +fedexcarrier_c0d00fcb670ada42dad4698b865f40cd'] = 'Transportista Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0aad1e954489f441f8824e1f990d4774'] = 'Proponer sus clientes el transportista Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff86cba2f7fe4a2dec854d107a4d99d2'] = 'Clase SOAP '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_883fa0069f4b0454e2277dd567ab3991'] = '\'Unidad de peso (lb o kg).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5a3ceec65d417f5d92c26dbf0dccc00d'] = '\'Unidad del tamaño (CM o pulgadas).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4d470fde8487e755a50e9235e3dc13ab'] = 'deben configurarse correctamente para poder utilizar este módulo'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a1d8be175eff378884736e1b44da526e'] = 'Cuenta de FedEx '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c481cd53864462a87dcb89c33589ff8e'] = 'Meter de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_918356c887962073f010ee06e1395713'] = 'Contraseña de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c2b826b79539fa093a6db05ca5ec9e0'] = 'Clave API de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3ef2f9d666a37f95d963a84c46bae646'] = 'Tipo de recogida predeterminado de Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_72f18dde0a5c9f75dd487adeacb92b56'] = 'Tipo de embalaje predeterminado de Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bb8a37c6acccadf3e28a704d59f1f8a'] = 'Business service center'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c0b3132d2759b40e8525f2466c477d1c'] = 'Buzón de depósito'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_22db7528d7c5df8e310bf19af75e61d3'] = 'Recogida regular'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7e8eb99ef29d93f494ebdc27b59444f5'] = 'Solicitud de mensajería'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_394a844cc3d6d99eb45b4e71afde2c99'] = 'Estación'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_57185ccd597e58ad9e4944f4356222b6'] = 'Caja de 10 Kg de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8ccd685b767c927bca8501ae80d954'] = 'Caja de 25 Kg de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_38f14cc3e27cc856e61e3a7f555148d2'] = 'Caja de Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_36aba1bfaa5062695e71a6524008dd8a'] = 'Sobre de Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0e6a558b4ce274905600856b20b471e'] = 'Pak de Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b2953c3343913eee2398c1fe2651be7'] = 'Tubo de Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_451400926783d7a47cd31025717bc97f'] = 'Su embalaje'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46f58e2a308b68cae9d5f5dd8a5d4ad6'] = 'Europe first international priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0fd6265588d27073ef45ed36d5c00c75'] = 'Fedex 1 día flete'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dfa184d2bf6a5d6ee8ffebfbaa25394c'] = 'Fedex 2 días'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2c0f88b63bfbe05955db90f1dcccab2e'] = 'Fedex 2 días flete'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_03aac4b90886eabd480cee819e24d09e'] = 'Fedex 3 días flete'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_687009f2bc600c25a005b26f4cb4ab02'] = 'Fedex express saver'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6e8cf654ec68d7391f5d673331e2c212'] = 'Fedex flete'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1497c5bee4dd896e0b84c442be1e8760'] = 'Fedex ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_23044a6996eda8ad80874f5bdd72a0bc'] = 'Fedex flete nacional'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4cee621e07c270fb1031f231e592a8cd'] = 'First overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e1416870eb1cf36849393bf6ef6f6966'] = 'Ground home delivery'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_124dd98ba09563af1900c14885e97d6e'] = 'International economy'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2751413ff6e957a3b6894929b008b123'] = 'International economy freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cebbbe47be59307e1751e2febe44fdc6'] = 'International first'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f3f9ee160906e71040b437410459ec79'] = 'International ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_759d99c1c032d4171c2f142af4f79436'] = 'International priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a8c786474d046ba2b2b90b78a7b498cf'] = 'International priority freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec25bbf3daf58ec08920a781e25a3f3d'] = 'Priority overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e889962a8517669ba4ac839afa6384df'] = 'Smart post'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0a7bd01967a1874144b1b4fab2ee6a6f'] = 'Standard overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d999f792aee7c730cdc95f6aff4aa436'] = 'Transportista FEDEX '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_99e509958c21ac35438651547a7bb035'] = 'Módulo de estado Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d23a9177c3c7256ede85643a19335afb'] = '¡Transportista FEDEX está bien configurado y en línea!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bc95bc43c48a735773d4182dcf526fb'] = 'Transportista FEDEX no está configurado todavía, usted tiene que:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e203b9a16f360b88d90bba6eb61ce61'] = 'Cumplimentar el impreso \"Configuración general\"'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c0987b9315003df7dae7f130e3cf58e'] = 'Seleccione el servicio de entrega disponible que desee'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e20f6d6f13fe70e78f6e2ab488493ccf'] = 'Conexión de prueba al servicio web'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_807b063fceafae2c51dc6afb45612389'] = 'SOAP está habilitado'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_52f4393e1b52ba63e27310ca92ba098c'] = 'Configuración general'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_277d63a9b24a09697e3c64092eaf4353'] = 'Configuración de las categorías'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_098eec2cabe2c39c6dec3fc522b6571a'] = 'Configuración de los productos'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d2126da975d5b9a5b846efaf57d3fd53'] = 'Configuración general'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a50bb127f9b307757cf52ab86d70adac'] = 'Su cuenta Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8b0ebd10992bd1576eccf605a84175'] = 'Su Fedex Mater Lumber'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c36a272a8778a2e85de52a01675fd521'] = 'Su contraseña fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e2cd475470bc7b47bef8d4ecdae2a67'] = 'Su Fedex Key API'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cdfa1b01c330bf745f776f6c6c8afffd'] = 'Pulse aquí para obtener su Fedex Key API'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_83ad4fdaf06650e6d9d7ca18f82fb975'] = 'Configuración de localización '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f489118ea95c746d648d36bb50c226f0'] = 'Unidad de peso'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_659c95668841b7d6602ead454b28d4ba'] = 'La unidad de peso para su tienda (kg o libras)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cc13d156306185fd42a860da3049567c'] = 'Unidad de dimensión'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f804c2bdebc117d9cde3cddad3b49845'] = 'La unidad de dimensión de su tienda (cm o pulgadas)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2481447d04ae756836d32e3ade240ff4'] = 'Dirección de configuración'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b179e75d464a04d8a04111131b3a3ca'] = 'Su dirección la línea 1'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_281b2def1a9737b33f88013c94fdfeb8'] = 'Su dirección la línea 2'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d30f507473129e70c4b962ceccf175cf'] = 'Código Postal'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0585aac6bb77bb49423b2effca0e067'] = 'Su ciudad'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_59716c97497eb9694541f7c3d37b1a4d'] = 'País'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f8f5a972333ee726fbe5bb52409c0ed0'] = 'Seleccione un país ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4e9863cf5326e6714388045321665d07'] = 'Seleccione el país desde dentro de la lista.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46a2a41cc6e552044816a2d04634545d'] = 'Estado'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cf1580798f7aba85d519afadf1ffd886'] = 'Seleccione un estado ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_02546d525ab356bd43c91e6b07447496'] = 'No hay configuración por Estado para este país'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ddc2a5660f7d095fff34d6b93077c80'] = 'Configuración del servicio'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f405714368454e1f9c932432693aea42'] = 'Tipo de recogida por defecto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ce135482b30deedcc0046df41c12de79'] = 'Elija su método de recogida por defecto…'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a361a1f786db3dfe07aae42752d3446'] = 'Tipo de embalaje por defecto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4664d1ae1832bed2246e8a6850365075'] = 'Seleccione un tipo de embalaje por defecto...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Servicio de entrega'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_78945de8de090e90045d299651a68a9b'] = 'Disponible'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'No disponible'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d63e135774e62574e2a1921267dad142'] = 'Elija el servicio de entrega que estará disponible para los clientes.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9b8c4a7116e8c44e4ebc955fafd47586'] = 'No se ha especificado su cuenta Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9cc1a101547b3ece6d946dbbe3469d7'] = 'No se ha especificado su Fedex meter Lumber'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ce0f66588bbbbbb3ef0634e5ea7da69'] = 'No se ha especificado su contraseña Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7988c0adb770f0f945814c0fb2b5800b'] = 'No se ha especificado su Fedex API Key'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5d5ae09e7b6041d3449ef2cbfc39f560'] = 'No se ha especificado su método de recogida'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e794e452ed4d2cfa13083693a2c8810e'] = 'No se ha especificado su tipo de embalaje'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_805353d2862ea0e658c9ddda871540fa'] = 'No se ha especificado su Código postal'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ef9bd955e165dfb0207877e9fe180aeb'] = 'No se ha especificado su ciudad '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ecc7697a320f93f3ee8fb4048dbd64c'] = 'No se ha especificado su país'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_729d4f7143a3de7b0ed18de667fdf4d5'] = 'Prestashop no se pudo conectar con los servicios web de FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9d1b485edd50e6fbd288b340b386b07d'] = 'No se encuentra descripción del error'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9284bff13acffdd879ef4ac7fca5234'] = 'Configuración no actualizada'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_67e19ffdaa0a11e69349810403a9727e'] = 'Usted tiene que configurar \"General Settings\" antes de utilizar esta ficha.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a37b48e8684078c0620a997b3baeee9f'] = 'En esta ficha, puede establecer una configuración específica para cada categoría.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f421827ff72ef9a61fb27aa0de62f1e4'] = 'Id. de configuración'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ca2fb7f67355c05d2ffa963fac6e91e1'] = 'Tipo de recogida'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d9bc28a26253438f5b16cea5eb35681a'] = 'Tipo de embalaje'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20cde117cbc92b9ec1fb4e5bc4a7b9bd'] = 'Gastos adicionales'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Servicios'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4f8e00c5ae41d97ab62a947b8e806d55'] = 'No hay ninguna configuración específica de FEDEX para las categorías en este momento.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f1c611f93510bbee05663c82f6d439e2'] = '¿Está seguro que desea eliminar esta configuración específica de FEDEX para esta categoría?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e0cb9fd22b124c0839302fef54762d7'] = 'Actualizar una norma'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dd593f8a542ab628cbba98c709255e60'] = 'Agregar una regla'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1debf905ac528b3f0615cd379ced0d38'] = 'Tipo de recogida'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b03dfe92d8c5b6a15d3f139998580563'] = 'Seleccione un tipo de recogida ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_da42caf26ef85de3d7e48e16ca60b891'] = 'Tipo de Embalaje'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8d2ee0603dfce09b57d60db628cde269'] = 'Seleccione un tipo de embalaje ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7fcafa7c47e984693fcb8a92c0fd1beb'] = 'Seleccione una categoría ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d725c0166e978cc30853996c70440873'] = 'Tiene que seleccionar una categoría.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff63f917e2a947d454bce41b104cfbd2'] = 'Esta categoría ya tiene una configuración específica de FEDEX.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_fd0119c2a5fc18aa64887b5b7ab41c19'] = 'Se ha producido un error, inténtelo más tarde.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20f40087c53c662adfb4e780500eaa15'] = 'En esta ficha, puede establecer una configuración específica para cada producto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_deb10517653c255364175796ace3553f'] = 'Producto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cef3da9171b7ac6d7a6e206e68a2a246'] = 'No hay ninguna configuración específica para los productos de Federal Express en este momento.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ceb0ede9c02d159aa2360a3d0694d9ed'] = '¿Está seguro que desea eliminar esta configuración específica de FEDEX para este producto?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3c4d710b56f4318dae775cff80619f84'] = 'Seleccione un producto ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c07640370e4681bf98638d0c458cd2e'] = 'Usted tiene que seleccionar un producto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8fc3abc76f5a163f81962a52fc5a3703'] = 'Este producto ya tiene una configuración específica de FEDEX.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c3eacca576fbfc5dca21b50d9f6ef8f'] = '¡Bienvenido al configurador del módulo FEDEX para PrestaShop!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_92640c80a67da1782a18304336405dac'] = 'Esta sección le ayudará a entender cómo configurar este módulo correctamente.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec0e6948e8f34818d80f27c309f46661'] = 'Vea a continuación la descripción de cada campo:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b12c6f84e131ed2192e9d9c6c531f239'] = 'Su cuenta de FedEx'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ea2cd644fcacb9e8fe1d4c9c89a677b'] = 'Tendrá que inscribirse en el sitio web de FedEx en esta dirección'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_35ba940948fa0ea163fd01281de10e2f'] = 'Este campo debe ser el Código postal del punto de partida de su paquete.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_81822348ace1ceabad5e9f8992ce9ea4'] = 'Este campo debe ser el país punto de partida de su paquete.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_74395432668d0313b593712dfc40479a'] = 'Este campo corresponde al tipo de recogida por defecto (cuando no hay ninguna configuración específica para el producto o la categoría de productos).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9bba478eb4348e49e672e944b072b68'] = 'Estas casillas corresponden a los servicios de entrega que desea que estén disponibles (cuando no hay ninguna configuración específica para el producto o la categoría de productos).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_71ffd676000b4ec8ea95f4096adc3d3c'] = 'Esta sección le permite definir una configuración específica de FEDEX para cada categoría de productos (tales como tipo de embalaje y gastos adicionales).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_89a9eabc8fc9335d484dcb1eb7ef4ac5'] = 'Esta sección le permite definir una configuración específica de FEDEX para cada producto (tales como tipo de embalaje y gastos adicionales).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Error'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e303843029d99ced59415005037969d'] = 'El servicio web de Fedex parece estar fuera de servicio, por favor, espere unos minutos y vuelva a intentarlo'; diff --git a/modules/fedexcarrier/fedexcarrier.php b/modules/fedexcarrier/fedexcarrier.php new file mode 100644 index 000000000..9339c1644 --- /dev/null +++ b/modules/fedexcarrier/fedexcarrier.php @@ -0,0 +1,1704 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +class FedexCarrier extends CarrierModule +{ + public $id_carrier; + + private $_html = ''; + private $_postErrors = array(); + private $_webserviceTestResult = ''; + private $_webserviceError = ''; + private $_fieldsList = array(); + private $_pickupTypeList = array(); + private $_packagingTypeList = array(); + private $_serviceTypeList = array(); + private $_dimensionUnit = ''; + private $_weightUnit = ''; + private $_dimensionUnitList = array('CM' => 'CM', 'IN' => 'IN', 'CMS' => 'CM', 'INC' => 'IN'); + private $_weightUnitList = array('KG' => 'KGS', 'KGS' => 'KGS', 'LBS' => 'LBS', 'LB' => 'LBS'); + private $_moduleName = 'fedexcarrier'; + + public function __construct() + { + global $cookie; + + $this->name = 'fedexcarrier'; + $this->tab = 'shipping_logistics'; + $this->version = '0.9c'; + $this->author = 'PrestaShop'; + $this->limited_countries = array('us'); + + parent::__construct (); + + $this->displayName = $this->l('Fedex Carrier'); + $this->description = $this->l('Offer your customers, different delivery methods with Fedex'); + + if (self::isInstalled($this->name)) + { + // Loading Var + $warning = array(); + $this->loadingVar(); + + // Check Class Soap availibility + if (!extension_loaded('soap')) + $warning[] = "'".$this->l('Class Soap')."', "; + + // Check Configuration Values + foreach ($this->_fieldsList as $keyConfiguration => $name) + if (!Configuration::get($keyConfiguration) && !empty($name)) + $warning[] = '\''.$name.'\' '; + + // Checking Unit + $this->_dimensionUnit = $this->_dimensionUnitList[strtoupper(Configuration::get('PS_DIMENSION_UNIT'))]; + $this->_weightUnit = $this->_weightUnitList[strtoupper(Configuration::get('PS_WEIGHT_UNIT'))]; + if (!$this->_weightUnit || !$this->_weightUnitList[$this->_weightUnit]) + $warning[] = $this->l('\'Weight Unit (LB or KG).\'').' '; + if (!$this->_dimensionUnit || !$this->_dimensionUnitList[$this->_dimensionUnit]) + $warning[] = $this->l('\'Dimension Unit (CM or IN).\'').' '; + + // Generate Warnings + if (count($warning)) + $this->warning .= implode(' , ',$warning).$this->l('must be configured to use this module correctly').' '; + } + } + + public function loadingVar() + { + // Loading Fields List + $this->_fieldsList = array( + 'FEDEX_CARRIER_ACCOUNT' => $this->l('Fedex account'), + 'FEDEX_CARRIER_METER' => $this->l('Fedex meter'), + 'FEDEX_CARRIER_PASSWORD' => $this->l('Fedex password'), + 'FEDEX_CARRIER_API_KEY' => $this->l('Fedex API Key'), + 'FEDEX_CARRIER_PICKUP_TYPE' => $this->l('Fedex default pickup type'), + 'FEDEX_CARRIER_PACKAGING_TYPE' => $this->l('Fedex default packaging type'), + 'FEDEX_CARRIER_ADDRESS1' => '', + 'FEDEX_CARRIER_ADDRESS2' => '', + 'FEDEX_CARRIER_POSTAL_CODE' => '', + 'FEDEX_CARRIER_CITY' => '', + 'FEDEX_CARRIER_STATE' => '', + 'FEDEX_CARRIER_COUNTRY' => '', + ); + + // Loading pickup type list + $this->_pickupTypeList = array( + 'BUSINESS_SERVICE_CENTER' => $this->l('Business service center'), + 'DROP_BOX' => $this->l('Drop box'), + 'REGULAR_PICKUP' => $this->l('Regular pickup'), + 'REQUEST_COURIER' => $this->l('Request courier'), + 'STATION' => $this->l('Station') + ); + + // Loading packaging type list + $this->_packagingTypeList = array( + 'FEDEX_10KG_BOX' => $this->l('Fedex 10Kg Box'), + 'FEDEX_25KG_BOX' => $this->l('Fedex 25Kg Box'), + 'FEDEX_BOX' => $this->l('Fedex Box'), + 'FEDEX_ENVELOPE' => $this->l('Fedex Envelope'), + 'FEDEX_PAK' => $this->l('Fedex Pak'), + 'FEDEX_TUBE' => $this->l('Fedex Tube'), + 'YOUR_PACKAGING' => $this->l('Your Packaging'), + ); + + // Loading service type list + $this->_serviceTypeList = array( + 'EUROPE_FIRST_INTERNATIONAL_PRIORITY' => $this->l('Europe first international priority'), + 'FEDEX_1_DAY_FREIGHT' => $this->l('Fedex 1 day freight'), + 'FEDEX_2_DAY' => $this->l('Fedex 2 day'), + 'FEDEX_2_DAY_FREIGHT' => $this->l('Fedex 2 day freight'), + 'FEDEX_3_DAY_FREIGHT' => $this->l('Fedex 3 day freight'), + 'FEDEX_EXPRESS_SAVER' => $this->l('Fedex express saver'), + 'FEDEX_FREIGHT' => $this->l('Fedex freight'), + 'FEDEX_GROUND' => $this->l('Fedex ground'), + 'FEDEX_NATIONAL_FREIGHT' => $this->l('Fedex national freight'), + 'FIRST_OVERNIGHT' => $this->l('First overnight'), + 'GROUND_HOME_DELIVERY' => $this->l('Ground home delivery'), + 'INTERNATIONAL_ECONOMY' => $this->l('International economy'), + 'INTERNATIONAL_ECONOMY_FREIGHT' => $this->l('International economy freight'), + 'INTERNATIONAL_FIRST' => $this->l('International first'), + 'INTERNATIONAL_GROUND' => $this->l('International ground'), + 'INTERNATIONAL_PRIORITY' => $this->l('International priority'), + 'INTERNATIONAL_PRIORITY_FREIGHT' => $this->l('International priority freight'), + 'PRIORITY_OVERNIGHT' => $this->l('Priority overnight'), + 'SMART_POST' => $this->l('Smart post'), + 'STANDARD_OVERNIGHT' => $this->l('Standard overnight') + ); + } + + + + /* + ** Install / Uninstall Methods + ** + */ + + public function install() + { + global $cookie; + + // Install SQL + include(dirname(__FILE__).'/sql-install.php'); + foreach ($sql as $s) + if (!Db::getInstance()->Execute($s)) + return false; + + // Install Carriers + $this->installCarriers(); + + // Install Module + if (!parent::install() OR !$this->registerHook('updateCarrier')) + return false; + + return true; + } + + public function uninstall() + { + global $cookie; + + // Uninstall Carriers + Db::getInstance()->autoExecute(_DB_PREFIX_.'carrier', array('deleted' => 1), 'UPDATE', '`external_module_name` = \'fedexcarrier\' OR `id_carrier` IN (SELECT DISTINCT(`id_carrier`) FROM `'._DB_PREFIX_.'fedex_rate_service_code`)'); + + // Uninstall Config + foreach ($this->_fieldsList as $keyConfiguration => $name) + if (!Configuration::deleteByName($keyConfiguration)) + return false; + + // Uninstall SQL + include(dirname(__FILE__).'/sql-uninstall.php'); + foreach ($sql as $s) + if (!Db::getInstance()->Execute($s)) + return false; + + // Uninstall Module + if (!parent::uninstall() OR !$this->unregisterHook('updateCarrier')) + return false; + + return true; + } + + public function installCarriers() + { + // Unactive all FEDEX Carriers + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_service_code', array('active' => 0), 'UPDATE'); + + // Get all services availables + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach ($rateServiceList as $rateService) + if (!$rateService['id_carrier']) + { + $config = array( + 'name' => $rateService['service'], + 'id_tax_rules_group' => 0, + 'active' => true, + 'deleted' => 0, + 'shipping_handling' => false, + 'range_behavior' => 0, + 'delay' => array('fr' => $rateService['service'], 'en' => $rateService['service']), + 'id_zone' => 1, + 'is_module' => true, + 'shipping_external' => true, + 'external_module_name' => $this->_moduleName, + 'need_range' => true + ); + $id_carrier = $this->installExternalCarrier($config); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_service_code', array('id_carrier' => (int)($id_carrier), 'id_carrier_history' => (int)($id_carrier)), 'UPDATE', '`id_fedex_rate_service_code` = '.(int)($rateService['id_fedex_rate_service_code'])); + } + } + + public static function installExternalCarrier($config) + { + $carrier = new Carrier(); + $carrier->name = $config['name']; + $carrier->id_tax_rules_group = $config['id_tax_rules_group']; + $carrier->id_zone = $config['id_zone']; + $carrier->active = $config['active']; + $carrier->deleted = $config['deleted']; + $carrier->delay = $config['delay']; + $carrier->shipping_handling = $config['shipping_handling']; + $carrier->range_behavior = $config['range_behavior']; + $carrier->is_module = $config['is_module']; + $carrier->shipping_external = $config['shipping_external']; + $carrier->external_module_name = $config['external_module_name']; + $carrier->need_range = $config['need_range']; + + $languages = Language::getLanguages(true); + foreach ($languages as $language) + { + if ($language['iso_code'] == 'fr') + $carrier->delay[(int)$language['id_lang']] = $config['delay'][$language['iso_code']]; + if ($language['iso_code'] == 'en') + $carrier->delay[(int)$language['id_lang']] = $config['delay'][$language['iso_code']]; + } + + if ($carrier->add()) + { + $groups = Group::getGroups(true); + foreach ($groups as $group) + Db::getInstance()->autoExecute(_DB_PREFIX_.'carrier_group', array('id_carrier' => (int)($carrier->id), 'id_group' => (int)($group['id_group'])), 'INSERT'); + + $rangePrice = new RangePrice(); + $rangePrice->id_carrier = $carrier->id; + $rangePrice->delimiter1 = '0'; + $rangePrice->delimiter2 = '10000'; + $rangePrice->add(); + + $rangeWeight = new RangeWeight(); + $rangeWeight->id_carrier = $carrier->id; + $rangeWeight->delimiter1 = '0'; + $rangeWeight->delimiter2 = '10000'; + $rangeWeight->add(); + + $zones = Zone::getZones(true); + foreach ($zones as $zone) + { + Db::getInstance()->autoExecute(_DB_PREFIX_.'carrier_zone', array('id_carrier' => (int)($carrier->id), 'id_zone' => (int)($zone['id_zone'])), 'INSERT'); + Db::getInstance()->autoExecuteWithNullValues(_DB_PREFIX_.'delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => (int)($rangePrice->id), 'id_range_weight' => NULL, 'id_zone' => (int)($zone['id_zone']), 'price' => '0'), 'INSERT'); + Db::getInstance()->autoExecuteWithNullValues(_DB_PREFIX_.'delivery', array('id_carrier' => (int)($carrier->id), 'id_range_price' => NULL, 'id_range_weight' => (int)($rangeWeight->id), 'id_zone' => (int)($zone['id_zone']), 'price' => '0'), 'INSERT'); + } + + // Copy Logo + if (!copy(dirname(__FILE__).'/carrier.jpg', _PS_SHIP_IMG_DIR_.'/'.(int)$carrier->id.'.jpg')) + return false; + + // Return ID Carrier + return (int)($carrier->id); + } + + return false; + } + + + + /* + ** Global Form Config Methods + ** + */ + + public function getContent() + { + $this->_html .= '

        ' . $this->l('FEDEX Carrier').'

        '; + if (!empty($_POST) AND Tools::isSubmit('submitSave')) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= '
        nok '.$err.'
        '; + } + $this->_displayForm(); + return $this->_html; + } + + private function _displayForm() + { + $this->_html .= '
        + '.$this->l('Fedex Module Status').''; + + $alert = array(); + $this->_webserviceTestResult = $this->webserviceTest(); + if (!Configuration::get('FEDEX_CARRIER_ACCOUNT')) + $alert['generalSettings'] = 1; + if (Db::getInstance()->getValue('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `active` = 1') < 1) + $alert['deliveryServices'] = 1; + if (!$this->_webserviceTestResult) + $alert['webserviceTest'] = 1; + if (!extension_loaded('soap')) + $alert['soap'] = 1; + + + if (!count($alert)) + $this->_html .= ''.$this->l('FEDEX Carrier is configured and online!').''; + else + { + $this->_html .= ''.$this->l('FEDEX Carrier is not configured yet, you must:').''; + $this->_html .= '
        '.(isset($alert['generalSettings']) ? '' : '').' 1) '.$this->l('Fill the "General Settings" form'); + $this->_html .= '
        '.(isset($alert['deliveryServices']) ? '' : '').' 2) '.$this->l('Select your available delivery service'); + $this->_html .= '
        '.(isset($alert['webserviceTest']) ? '' : '').' 3) '.$this->l('Webservice test connection').($this->_webserviceError ? ' : '.$this->_webserviceError : ''); + $this->_html .= '
        '.(isset($alert['soap']) ? '' : '').' 4) '.$this->l('Soap is enabled'); + } + + + $this->_html .= '
         
        '; + $this->_html .= $this->_displayFormConfig(); + } + + private function _postValidation() + { + if (Tools::getValue('section') == 'general') + $this->_postValidationGeneral(); + elseif (Tools::getValue('section') == 'category') + $this->_postValidationCategory(); + elseif (Tools::getValue('section') == 'product') + $this->_postValidationProduct(); + } + + private function _postProcess() + { + if (Tools::getValue('section') == 'general') + $this->_postProcessGeneral(); + elseif (Tools::getValue('section') == 'category') + $this->_postProcessCategory(); + elseif (Tools::getValue('section') == 'product') + $this->_postProcessProduct(); + } + + + + + /* + ** General Form Config Methods + ** + */ + + private function _displayFormConfig() + { + $html = ' + +
        + + + + +
        +
        +
        + + + '; + if (isset($_GET['id_tab'])) + $html .= ''; + return $html; + } + + private function _displayFormGeneral() + { + global $cookie; + + $html = ' + + + +
        + +
        +

        '.$this->l('General configuration').' :

        + +
        + +
        + +
        + + +
        + +
        +

        '.$this->l('Localization configuration').' :

        + +
        + +

        '.$this->l('The weight unit of your shop (eg. kg or lbs)').'

        +
        + +
        + +

        '.$this->l('The dimension unit of your shop (eg. cm or in)').'

        +
        +
        + +
        +

        '.$this->l('Address configuration').' :

        + +
        + +
        + +

        + +
        + +
        + +

        ' . $this->l('Select country from within the list.') . '

        +
        + +
        '; + $id_country_current = 0; + $statesList = Db::getInstance()->ExecuteS(' + SELECT `id_state`, `id_country`, `name` + FROM `'._DB_PREFIX_.'state` WHERE `active` = 1 + ORDER BY `id_country`, `name` ASC'); + foreach ($statesList as $v) + { + if ($id_country_current != $v['id_country']) + { + if ($id_country_current != 0) + $html .= ''; + $html .= '
        '.$this->l('There is no state configuration for this country').'
        + +
        +
        + +
        +

        '.$this->l('Service configuration').' :

        + +
        + +
        + +
        + +
        + +
        '; + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach($rateServiceList as $rateService) + $html .= ' '.$rateService['service'].' '.($this->webserviceTest($rateService['code']) ? '('.$this->l('Available').')' : '('.$this->l('Not available').')').'
        '; + $html .= ' +

        ' . $this->l('Choose the delivery service which will be available for customers.') . '

        +
        +
        + +
        +
        + + '; + return $html; + } + + private function _postValidationGeneral() + { + // Check configuration values + if (Tools::getValue('fedex_carrier_account') == NULL) + $this->_postErrors[] = $this->l('Your Fedex account is not specified'); + elseif (Tools::getValue('fedex_carrier_meter') == NULL) + $this->_postErrors[] = $this->l('Your Fedex meter is not specified'); + elseif (Tools::getValue('fedex_carrier_password') == NULL) + $this->_postErrors[] = $this->l('Your Fedex password is not specified'); + elseif (Tools::getValue('fedex_carrier_api_key') == NULL) + $this->_postErrors[] = $this->l('Your Fedex API Key is not specified'); + elseif (Tools::getValue('fedex_carrier_pickup_type') == NULL OR Tools::getValue('fedex_carrier_pickup_type') == '0') + $this->_postErrors[] = $this->l('Your pickup type is not specified'); + elseif (Tools::getValue('fedex_carrier_packaging_type') == NULL OR Tools::getValue('fedex_carrier_packaging_type') == '0') + $this->_postErrors[] = $this->l('Your packaging type is not specified'); + elseif (Tools::getValue('fedex_carrier_postal_code') == NULL) + $this->_postErrors[] = $this->l('Your Zip / Postal code is not specified'); + elseif (Tools::getValue('fedex_carrier_city') == NULL) + $this->_postErrors[] = $this->l('Your city is not specified'); + elseif (Tools::getValue('fedex_carrier_country') == NULL OR Tools::getValue('fedex_carrier_country') == 0) + $this->_postErrors[] = $this->l('Your country is not specified'); + + + + // Check fedex webservice availibity + if (!$this->_postErrors) + { + // Unactive all FEDEX Carriers + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_service_code', array('active' => 0), 'UPDATE'); + + // If no errors appear, the carrier is being activated, else, the carrier is being deactivated + if (!$this->_postErrors) + { + // Get available services + $serviceSelected = Tools::getValue('service'); + + // Active available carrier + if ($serviceSelected) + foreach ($serviceSelected as $ss) + { + $id_carrier = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `id_fedex_rate_service_code` = '.(int)($ss)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_service_code', array('active' => 1), 'UPDATE', '`id_fedex_rate_service_code` = '.(int)($ss)); + } + } + + // All new configurations values are saved to be sure to test webservices with it + Configuration::updateValue('FEDEX_CARRIER_ACCOUNT', Tools::getValue('fedex_carrier_account')); + Configuration::updateValue('FEDEX_CARRIER_METER', Tools::getValue('fedex_carrier_meter')); + Configuration::updateValue('FEDEX_CARRIER_PASSWORD', Tools::getValue('fedex_carrier_password')); + Configuration::updateValue('FEDEX_CARRIER_API_KEY', Tools::getValue('fedex_carrier_api_key')); + Configuration::updateValue('FEDEX_CARRIER_PICKUP_TYPE', Tools::getValue('fedex_carrier_pickup_type')); + Configuration::updateValue('FEDEX_CARRIER_PACKAGING_TYPE', Tools::getValue('fedex_carrier_packaging_type')); + Configuration::updateValue('FEDEX_CARRIER_ADDRESS1', Tools::getValue('fedex_carrier_address1')); + Configuration::updateValue('FEDEX_CARRIER_ADDRESS2', Tools::getValue('fedex_carrier_address2')); + Configuration::updateValue('FEDEX_CARRIER_POSTAL_CODE', Tools::getValue('fedex_carrier_postal_code')); + Configuration::updateValue('FEDEX_CARRIER_CITY', Tools::getValue('fedex_carrier_city')); + Configuration::updateValue('FEDEX_CARRIER_STATE', Tools::getValue('fedex_carrier_state')); + Configuration::updateValue('FEDEX_CARRIER_COUNTRY', Tools::getValue('fedex_carrier_country')); + Configuration::updateValue('PS_WEIGHT_UNIT', $this->_weightUnitList[strtoupper(Tools::getValue('ps_weight_unit'))]); + Configuration::updateValue('PS_DIMENSION_UNIT', $this->_dimensionUnitList[strtoupper(Tools::getValue('ps_dimension_unit'))]); + if (isset($this->_weightUnitList[strtoupper(Tools::getValue('ps_weight_unit'))])) + $this->_weightUnit = $this->_weightUnitList[strtoupper(Tools::getValue('ps_weight_unit'))]; + if (isset($this->_dimensionUnitList[strtoupper(Tools::getValue('ps_dimension_unit'))])) + $this->_dimensionUnit = $this->_dimensionUnitList[strtoupper(Tools::getValue('ps_dimension_unit'))]; + if (!$this->webserviceTest()) + $this->_postErrors[] = $this->l('Prestashop could not connect to FEDEX webservices').' :
        '.($this->_webserviceError ? $this->_webserviceError : $this->l('No error description found')); + } + } + + private function _postProcessGeneral() + { + // Saving new configurations + if (Configuration::updateValue('FEDEX_CARRIER_ACCOUNT', Tools::getValue('fedex_carrier_account')) AND + Configuration::updateValue('FEDEX_CARRIER_METER', Tools::getValue('fedex_carrier_meter')) AND + Configuration::updateValue('FEDEX_CARRIER_PASSWORD', Tools::getValue('fedex_carrier_password')) AND + Configuration::updateValue('FEDEX_CARRIER_API_KEY', Tools::getValue('fedex_carrier_api_key')) AND + Configuration::updateValue('FEDEX_CARRIER_PICKUP_TYPE', Tools::getValue('fedex_carrier_pickup_type')) AND + Configuration::updateValue('FEDEX_CARRIER_PACKAGING_TYPE', Tools::getValue('fedex_carrier_packaging_type')) AND + Configuration::updateValue('FEDEX_CARRIER_POSTAL_CODE', Tools::getValue('fedex_carrier_postal_code')) AND + Configuration::updateValue('FEDEX_CARRIER_CITY', Tools::getValue('fedex_carrier_city')) AND + Configuration::updateValue('FEDEX_CARRIER_STATE', Tools::getValue('fedex_carrier_state')) AND + Configuration::updateValue('FEDEX_CARRIER_COUNTRY', Tools::getValue('fedex_carrier_country')) AND + Configuration::updateValue('PS_WEIGHT_UNIT', $this->_weightUnitList[strtoupper(Tools::getValue('ps_weight_unit'))]) AND + Configuration::updateValue('PS_DIMENSION_UNIT', $this->_dimensionUnitList[strtoupper(Tools::getValue('ps_dimension_unit'))])) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + + + /* + ** Category Form Config Methods + ** + */ + + private function _getPathInTab($id_category) + { + global $cookie; + + $category = Db::getInstance()->getRow(' + SELECT id_category, level_depth, nleft, nright + FROM '._DB_PREFIX_.'category + WHERE id_category = '.(int)$id_category); + + if (isset($category['id_category'])) + { + $categories = Db::getInstance()->ExecuteS(' + SELECT c.id_category, cl.name, cl.link_rewrite + FROM '._DB_PREFIX_.'category c + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category) + WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).' + ORDER BY c.level_depth ASC + LIMIT '.(int)($category['level_depth'] + 1)); + + $n = 1; + $pathTab = array(); + $nCategories = (int)sizeof($categories); + foreach ($categories AS $category) + $pathTab[] = htmlentities($category['name'], ENT_NOQUOTES, 'UTF-8'); + + return $pathTab; + } + } + + private function _getChildCategories($categories, $id, $path = array(), $pathAdd = '') + { + $html = ''; + if ($pathAdd != '') + $path[] = $pathAdd; + if (isset($categories[$id])) + foreach ($categories[$id] as $idc => $cc) + { + $html .= ''; + $html .= $this->_getChildCategories($categories, $idc, $path, $cc['infos']['name']); + } + return $html; + } + + private function _isPostCheck($id_fedex_rate_service_code) + { + $services = Tools::getValue('service'); + if ($services) + foreach ($services as $s) + if ($s == $id_fedex_rate_service_code) + return 1; + return 0; + } + + private function _displayFormCategory() + { + global $cookie; + + // Check if the module is configured + if (!$this->_webserviceTestResult) + return '

        '.$this->l('You have to configure "General Settings" tab before using this tab.').'


        '; + + // Display header + $html = '

        '.$this->l('In this tab, you can set a specific configuration for each category.').'


        + + + + + + + + + + + + + '; + + // Loading config list + $configCategoryList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_category` > 0'); + if (!$configCategoryList) + $html .= ''; + foreach ($configCategoryList as $k => $c) + { + // Category Path + $path = ''; + $pathTab = $this->_getPathInTab($c['id_category']); + foreach ($pathTab as $p) + { + if (!empty($path)) { $path .= ' > '; } + $path .= $p; + } + + // Loading config currency + $configCurrency = new Currency($c['id_currency']); + + // Loading services attached to this config + $services = ''; + $servicesTab = Db::getInstance()->ExecuteS(' + SELECT ursc.`service` + FROM `'._DB_PREFIX_.'fedex_rate_config_service` urcs + LEFT JOIN `'._DB_PREFIX_.'fedex_rate_service_code` ursc ON (ursc.`id_fedex_rate_service_code` = urcs.`id_fedex_rate_service_code`) + WHERE urcs.`id_fedex_rate_config` = '.(int)$c['id_fedex_rate_config']); + foreach ($servicesTab as $s) + $services .= $s['service'].'
        '; + + // Display line + $alt = 0; + if ($k % 2 != 0) + $alt = ' class="alt_row"'; + $html .= ' + + + + + + + + + '; + } + + $html .= ' + +
        '.$this->l('ID Config').''.$this->l('Category').''.$this->l('Pickup type').''.$this->l('Packaging type').''.$this->l('Additional charges').''.$this->l('Services').''.$this->l('Actions').'
        '.$this->l('There is no specific FEDEX configuration for categories at this point.').'
        '.$c['id_fedex_rate_config'].''.$path.''.(isset($this->_pickupTypeList[$c['pickup_type_code']]) ? $this->_pickupTypeList[$c['pickup_type_code']] : '-').''.(isset($this->_packagingTypeList[$c['packaging_type_code']]) ? $this->_packagingTypeList[$c['packaging_type_code']] : '-').''.$c['additional_charges'].' '.$configCurrency->sign.''.$services.' + + + +
        + +
        +


        '; + + // Add or Edit Category Configuration + if (Tools::getValue('action') == 'edit' && Tools::getValue('section') == 'category') + { + // Loading config + $configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config'))); + + // Category Path + $path = ''; + $pathTab = $this->_getPathInTab($configSelected['id_category']); + foreach ($pathTab as $p) + { + if (!empty($path)) { $path .= ' > '; } + $path .= $p; + } + + $html .= '

        '.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)

        +
        + +
        '.$path.'

        + +
        + +
        + +
        + +
        + +

        + +
        '; + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach($rateServiceList as $rateService) + { + $configServiceSelected = Db::getInstance()->getValue('SELECT `id_fedex_rate_service_code` FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config')).' AND `id_fedex_rate_service_code` = '.(int)($rateService['id_fedex_rate_service_code'])); + $html .= '_isPostCheck($rateService['id_fedex_rate_service_code']) == 1 || $configServiceSelected > 0) ? 'checked="checked"' : '').' /> '.$rateService['service'].'
        '; + } + $html .= ' +

        ' . $this->l('Choose the delivery service which will be available for customers.') . '

        +
        +
        +
        '; + } + else + { + $html .= '

        '.$this->l('Add a rule').'

        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +

        + +
        '; + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach($rateServiceList as $rateService) + $html .= '_isPostCheck($rateService['id_fedex_rate_service_code']) == 1) ? 'checked="checked"' : '').' /> '.$rateService['service'].'
        '; + $html .= ' +

        ' . $this->l('Choose the delivery service which will be available for customers.') . '

        +
        +
        +
        '; + } + + return $html; + } + + private function _postValidationCategory() + { + // Check post values + if (Tools::getValue('id_category') == NULL) + $this->_postErrors[] = $this->l('You have to select a category.'); + + if (!$this->_postErrors) + { + $id_fedex_rate_config = Db::getInstance()->getValue('SELECT `id_fedex_rate_config` FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_category` = '.(int)Tools::getValue('id_category')); + + // Check if a config does not exist in Add case + if ($id_fedex_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This category already has a specific FEDEX configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_fedex_rate_config) || $id_fedex_rate_config != Tools::getValue('id_fedex_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_fedex_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessCategory() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => 0, + 'id_category' => (int)(Tools::getValue('id_category')), + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $addTab, 'INSERT'); + $id_fedex_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)$id_fedex_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_fedex_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_fedex_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $updTab, 'UPDATE', '`id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)Tools::getValue('id_fedex_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_fedex_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Product Form Config Methods + ** + */ + + private function _displayFormProduct() + { + global $cookie; + + // Check if the module is configured + if (!$this->_webserviceTestResult) + return '

        '.$this->l('You have to configure "General Settings" tab before using this tab.').'


        '; + + // Display header + $html = '

        '.$this->l('In this tab, you can set a specific configuration for each product.').'


        + + + + + + + + + + + + + '; + + // Loading config list + $configProductList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_product` > 0'); + if (!$configProductList) + $html .= ''; + foreach ($configProductList as $k => $c) + { + // Loading Product + $product = new Product((int)$c['id_product'], false, (int)$cookie->id_lang); + + // Loading config currency + $configCurrency = new Currency($c['id_currency']); + + // Loading services attached to this config + $services = ''; + $servicesTab = Db::getInstance()->ExecuteS(' + SELECT ursc.`service` + FROM `'._DB_PREFIX_.'fedex_rate_config_service` urcs + LEFT JOIN `'._DB_PREFIX_.'fedex_rate_service_code` ursc ON (ursc.`id_fedex_rate_service_code` = urcs.`id_fedex_rate_service_code`) + WHERE urcs.`id_fedex_rate_config` = '.(int)$c['id_fedex_rate_config']); + foreach ($servicesTab as $s) + $services .= $s['service'].'
        '; + + // Display line + $alt = 0; + if ($k % 2 != 0) + $alt = ' class="alt_row"'; + $html .= ' + + + + + + + + + '; + } + + $html .= ' + +
        '.$this->l('ID Config').''.$this->l('Product').''.$this->l('Pickup type').''.$this->l('Packaging type').''.$this->l('Additional charges').''.$this->l('Services').''.$this->l('Actions').'
        '.$this->l('There is no specific FEDEX configuration for products at this point.').'
        '.$c['id_fedex_rate_config'].''.$product->name.''.(isset($this->_pickupTypeList[$c['pickup_type_code']]) ? $this->_pickupTypeList[$c['pickup_type_code']] : '-').''.(isset($this->_packagingTypeList[$c['packaging_type_code']]) ? $this->_packagingTypeList[$c['packaging_type_code']] : '-').''.$c['additional_charges'].' '.$configCurrency->sign.''.$services.' + + + +
        + +
        +


        '; + + // Add or Edit Product Configuration + if (Tools::getValue('action') == 'edit' && Tools::getValue('section') == 'product') + { + // Loading config + $configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config'))); + $product = new Product((int)$configSelected['id_product'], false, (int)$cookie->id_lang); + + $html .= '

        '.$this->l('Update a rule').' ('.$this->l('Add a rule').' ?)

        +
        + +
        '.$product->name.'

        + +
        + +
        + +
        + +
        + +

        + +
        '; + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach($rateServiceList as $rateService) + { + $configServiceSelected = Db::getInstance()->getValue('SELECT `id_fedex_rate_service_code` FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config')).' AND `id_fedex_rate_service_code` = '.(int)($rateService['id_fedex_rate_service_code'])); + $html .= '_isPostCheck($rateService['id_fedex_rate_service_code']) == 1 || $configServiceSelected > 0) ? 'checked="checked"' : '').' /> '.$rateService['service'].'
        '; + } + $html .= ' +

        ' . $this->l('Choose the delivery service which will be available for customers.') . '

        +
        +
        +
        '; + } + else + { + $html .= '

        '.$this->l('Add a rule').'

        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +

        + +
        '; + $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + foreach($rateServiceList as $rateService) + $html .= '_isPostCheck($rateService['id_fedex_rate_service_code']) == 1) ? 'checked="checked"' : '').' /> '.$rateService['service'].'
        '; + $html .= ' +

        ' . $this->l('Choose the delivery service which will be available for customers.') . '

        +
        +
        +
        '; + } + + return $html; + } + + private function _postValidationProduct() + { + // Check post values + if (Tools::getValue('id_product') == NULL) + $this->_postErrors[] = $this->l('You have to select a product.'); + + if (!$this->_postErrors) + { + $id_fedex_rate_config = Db::getInstance()->getValue('SELECT `id_fedex_rate_config` FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_product` = '.(int)Tools::getValue('id_product')); + + // Check if a config does not exist in Add case + if ($id_fedex_rate_config > 0 && Tools::getValue('action') == 'add') + $this->_postErrors[] = $this->l('This product already has a specific FEDEX configuration.'); + + // Check if a config exists and if the IDs config correspond in Upd case + if (Tools::getValue('action') == 'edit' && (!isset($id_fedex_rate_config) || $id_fedex_rate_config != Tools::getValue('id_fedex_rate_config'))) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + + // Check if a config exists in Delete case + if (Tools::getValue('action') == 'delete' && !isset($id_fedex_rate_config)) + $this->_postErrors[] = $this->l('An error occurred, please try again.'); + } + } + + private function _postProcessProduct() + { + // Init Var + $date = date('Y-m-d H:i:s'); + $services = Tools::getValue('service'); + + // Add Script + if (Tools::getValue('action') == 'add') + { + $addTab = array( + 'id_product' => (int)(Tools::getValue('id_product')), + 'id_category' => 0, + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $addTab, 'INSERT'); + $id_fedex_rate_config = Db::getInstance()->Insert_ID(); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)$id_fedex_rate_config, 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($id_fedex_rate_config > 0) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Update Script + if (Tools::getValue('action') == 'edit' && Tools::getValue('id_fedex_rate_config')) + { + $updTab = array( + 'id_currency' => (int)(Configuration::get('PS_CURRENCY_DEFAULT')), + 'pickup_type_code' => pSQL(Tools::getValue('pickup_type_code')), + 'packaging_type_code' => pSQL(Tools::getValue('packaging_type_code')), + 'additional_charges' => pSQL(Tools::getValue('additional_charges')), + 'date_upd' => pSQL($date) + ); + $result = Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config', $updTab, 'UPDATE', '`id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + foreach ($services as $s) + { + $addTab = array('id_fedex_rate_service_code' => pSQL($s), 'id_fedex_rate_config' => (int)Tools::getValue('id_fedex_rate_config'), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_config_service', $addTab, 'INSERT'); + } + + // Display Results + if ($result) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + + // Delete Script + if (Tools::getValue('action') == 'delete' && Tools::getValue('id_fedex_rate_config')) + { + $result1 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + $result2 = Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)Tools::getValue('id_fedex_rate_config')); + + // Display Results + if ($result1) + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + else + $this->_html .= $this->displayErrors($this->l('Settings failed')); + } + } + + + + /* + ** Help Config Methods + ** + */ + + private function _displayHelp() + { + return '

        '.$this->l('Welcome to the PrestaShop FEDEX Module configurator.').'

        +

        '.$this->l('This section will help you to understand how to configure this module correctly.').'

        +
        +

        1. '.$this->l('General Settings').'

        +

        '.$this->l('See below for the description of each field :').'

        +

        '.$this->l('Your FEDEX Account').' : '.$this->l('You must subscribe to FEDEX website at this address').' http://www.fedex.com/webtools/

        +

        '.$this->l('Zip / Postal Code').' : '.$this->l('This field must be the Zip / Postal code of your package starting point.').'

        +

        '.$this->l('Country').' : '.$this->l('This field must be the country of your package starting point.').'

        +

        '.$this->l('Pickup Type').' : '.$this->l('This field corresponds to the default pickup type (when there is no specific configuration for the product or the category product).').'

        +

        '.$this->l('Delivery Service').' : '.$this->l('These checkboxes correspond to the delivery services you want to be available (when there is no specific configuration for the product or the category product).').'

        +
        +

        2. '.$this->l('Categories Settings').'

        +

        '.$this->l('This section allows you to define a specific FEDEX configuration for each product category (such as Packaging Type and Additional charges).').'

        +
        +

        3. '.$this->l('Products Settings').'

        +

        '.$this->l('This section allows you to define a specific FEDEX configuration for each product (such as Packaging Type and Additional charges).').'

        +
        + '; + } + + public function hookupdateCarrier($params) + { + if ((int)($params['id_carrier']) != (int)($params['carrier']->id)) + { + $serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `id_carrier` = '.(int)$params['id_carrier']); + $update = array('id_carrier' => (int)($params['carrier']->id), 'id_carrier_history' => pSQL($serviceSelected['id_carrier_history'].'|'.(int)($params['carrier']->id))); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_rate_service_code', $update, 'UPDATE', '`id_carrier` = '.(int)$params['id_carrier']); + } + } + + public function displayInfoByCart() + { + } + + + + /* + ** Front Methods + ** + */ + + public function getCookieCurrencyRate($id_currency_origin) + { + global $cookie; + $conversionRate = 1; + if ($cookie->id_currency != $id_currency_origin) + { + $currencyOrigin = new Currency((int)$id_currency_origin); + $conversionRate /= $currencyOrigin->conversion_rate; + $currencySelect = new Currency((int)$cookie->id_currency); + $conversionRate *= $currencySelect->conversion_rate; + } + return $conversionRate; + } + + public function getOrderShippingCostHash($wsParams) + { + $paramHash = ''; + $productHash = ''; + foreach ($wsParams['products'] as $product) + { + if (!empty($productHash)) + $productHash .= '|'; + $productHash .= $product['id_product'].':'.$product['id_product_attribute'].':'.$product['cart_quantity']; + } + foreach ($wsParams as $k => $v) + if ($k != 'products') + $paramHash .= '/'.$v; + return md5($productHash.$paramHash); + } + + public function getOrderShippingCostCache($wsParams) + { + // Get Cache + $row = Db::getInstance()->getRow(" + SELECT * FROM `"._DB_PREFIX_."fedex_cache` + WHERE `id_cart` = ".(int)($wsParams['id_cart'])." + AND `id_carrier` = ".(int)($this->id_carrier)." + AND `hash` = '".pSQL($wsParams['hash'])."'"); + + if ($row['id_currency']) + { + // Check Currency Rate And Calcul + $conversionRate = $this->getCookieCurrencyRate($row['id_currency']); + $row['total_charges'] = $row['total_charges'] * $conversionRate; + + // Return Cache + return $row; + } + + return false; + } + + public function saveOrderShippingCostCache($wsParams, $wscost) + { + global $cookie; + $is_available = 1; + if (!$wscost) + $is_available = 0; + $date = date('Y-m-d H:i:s'); + $insert = array( + 'id_cart' => (int)($wsParams['id_cart']), + 'id_carrier' => (int)($this->id_carrier), + 'hash' => pSQL($wsParams['hash']), + 'id_currency' => (int)($cookie->id_currency), + 'total_charges' => pSQL($wscost), + 'is_available' => (int)($is_available), + 'date_add' => pSQL($date), + 'date_upd' => pSQL($date) + ); + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_cache', $insert, 'INSERT'); + } + + public function loadShippingCostConfig($product) + { + // Init var + $config = array(); + + // Check if there is a specific product configuration + if ($product['id_product'] > 0) + { + $productConfiguration = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_product` = '.(int)($product['id_product'])); + if ($productConfiguration['id_fedex_rate_config']) + { + $servicesConfiguration = Db::getInstance()->ExecuteS(' + SELECT urcs.*, ursc.`id_carrier` + FROM `'._DB_PREFIX_.'fedex_rate_config_service` urcs + LEFT JOIN `'._DB_PREFIX_.'fedex_rate_service_code` ursc ON (ursc.`id_fedex_rate_service_code` = urcs.`id_fedex_rate_service_code`) + WHERE `id_fedex_rate_config` = '.(int)($productConfiguration['id_fedex_rate_config'])); + foreach ($servicesConfiguration as $service) + $productConfiguration['services'][$service['id_fedex_rate_service_code']] = $service; + return $productConfiguration; + } + } + + // Check if there is a specific category configuration + if ($product['id_category_default'] > 0) + { + $categoryConfiguration = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_category` = '.(int)($product['id_category_default'])); + if ($categoryConfiguration['id_fedex_rate_config']) + { + $servicesConfiguration = Db::getInstance()->ExecuteS(' + SELECT urcs.*, ursc.`id_carrier` + FROM `'._DB_PREFIX_.'fedex_rate_config_service` urcs + LEFT JOIN `'._DB_PREFIX_.'fedex_rate_service_code` ursc ON (ursc.`id_fedex_rate_service_code` = urcs.`id_fedex_rate_service_code`) + WHERE `id_fedex_rate_config` = '.(int)($categoryConfiguration['id_fedex_rate_config'])); + foreach ($servicesConfiguration as $service) + $categoryConfiguration['services'][$service['id_fedex_rate_service_code']] = $service; + return $categoryConfiguration; + } + } + + // Return general config + $config['pickup_type_code'] = Configuration::get('FEDEX_CARRIER_PICKUP_TYPE'); + $servicesConfiguration = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `active` = 1'); + foreach ($servicesConfiguration as $service) + $config['services'][$service['id_fedex_rate_service_code']] = $service; + return $config; + } + + public function getWebserviceShippingCost($wsParams) + { + // Init var + $cost = 0; + + // Getting shipping cost for each product + foreach ($wsParams['products'] as $product) + { + // Load specific configuration + $config = $this->loadShippingCostConfig($product); + + // Get service in adequation with carrier and check if available + $serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `id_carrier` = '.(int)($this->id_carrier)); + if (!isset($config['services'][$serviceSelected['id_fedex_rate_service_code']])) + return false; + + // Load param product + $wsParams['service'] = $serviceSelected['code']; + for ($qty = 0; $qty < $product['quantity']; $qty++) + $wsParams['package_list'][] = array( + 'width' => ($product['width'] ? $product['width'] : 1), + 'height' => ($product['height'] ? $product['height'] : 1), + 'depth' => ($product['depth'] ? $product['depth'] : 1), + 'weight' => ($product['weight'] ? $product['weight'] : 1), + 'pickup_type' => (isset($config['pickup_type_code']) ? $config['pickup_type_code'] : Configuration::get('FEDEX_CARRIER_PICKUP_TYPE')), + ); + + // If Additional charges + if (isset($config['id_currency']) && isset($config['additional_charges'])) + { + $conversionRate = 1; + $conversionRate = $this->getCookieCurrencyRate((int)($config['id_currency'])); + $cost += ($config['additional_charges'] * $conversionRate); + } + } + + + // If webservice return a cost, we add it, else, we return the original shipping cost + $result = $this->getFedexShippingCost($wsParams); + if ($result['connect'] && $result['cost'] > 0) + return ($cost + $result['cost']); + return false; + } + + public function getOrderShippingCost($params, $shipping_cost) + { + // Init var + $address = new Address($params->id_address_delivery); + $recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country)); + $recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state)); + $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('FEDEX_CARRIER_COUNTRY'))); + $shipper_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)(Configuration::get('FEDEX_CARRIER_STATE'))); + $products = $params->getProducts(); + + // Webservices Params + $wsParams = array( + 'id_cart' => $params->id, + 'id_address_delivery' => $params->id_address_delivery, + 'recipient_address1' => $address->address1, + 'recipient_address2' => $address->address2, + 'recipient_postalcode' => $address->postcode, + 'recipient_city' => $address->city, + 'recipient_country_iso' => $recipient_country['iso_code'], + 'recipient_state_iso' => $recipient_state['iso_code'], + 'shipper_address1' => Configuration::get('FEDEX_CARRIER_ADDRESS1'), + 'shipper_address2' => Configuration::get('FEDEX_CARRIER_ADDRESS2'), + 'shipper_postalcode' => Configuration::get('FEDEX_CARRIER_POSTAL_CODE'), + 'shipper_city' => Configuration::get('FEDEX_CARRIER_CITY'), + 'shipper_country_iso' => $shipper_country['iso_code'], + 'shipper_state_iso' => $shipper_state['iso_code'], + 'products' => $params->getProducts() + ); + $wsParams['hash'] = $this->getOrderShippingCostHash($wsParams); + + // Check cache + $cache = $this->getOrderShippingCostCache($wsParams); + if ($cache['id_fedex_cache'] > 0) + { + if ($cache['is_available'] == 0) + return false; + if ($cache['total_charges']) + return $cache['total_charges']; + } + + // Get Webservices Cost and Cache it + $wscost = $this->getWebserviceShippingCost($wsParams); + $this->saveOrderShippingCostCache($wsParams, $wscost); + + if ($wscost > 0) + return $wscost + $shipping_cost; + return false; + } + + public function getOrderShippingCostExternal($params) + { + return $this->getOrderShippingCost($params, 23); + } + + + + /* + ** Webservices Methods + ** + */ + + public function webserviceTest($service = '') + { + // Check config + if (!Configuration::get('FEDEX_CARRIER_API_KEY')) + return false; + + // Check if class Soap is available + if (!extension_loaded('soap')) + return false; + + // Getting module directory + $dir = dirname(__FILE__); + if (preg_match('/classes/i', $dir)) + $dir .= '/../modules/fedexcarrier/'; + + // Enable Php Soap + ini_set("soap.wsdl_cache_enabled", "0"); + $client = new SoapClient($dir.'/RateService_v9.wsdl', array('trace' => 1)); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information + + // Country / State + $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('FEDEX_CARRIER_COUNTRY'))); + $shipper_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)(Configuration::get('FEDEX_CARRIER_STATE'))); + + // Generating soap request + $request['WebAuthenticationDetail']['UserCredential'] = array('Key' => Configuration::get('FEDEX_CARRIER_API_KEY'), 'Password' => Configuration::get('FEDEX_CARRIER_PASSWORD')); + $request['ClientDetail'] = array('AccountNumber' => Configuration::get('FEDEX_CARRIER_ACCOUNT'), 'MeterNumber' => Configuration::get('FEDEX_CARRIER_METER')); + $request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Available Services Request v9 using PHP ***'); + $request['Version'] = array('ServiceId' => 'crs', 'Major' => '9', 'Intermediate' => '0', 'Minor' => '0'); + $request['ReturnTransitAndCommit'] = true; + $request['RequestedShipment']['DropoffType'] = Configuration::get('FEDEX_CARRIER_PICKUP_TYPE'); // valid values REGULAR_PICKUP, REQUEST_COURIER, ... + $request['RequestedShipment']['ShipTimestamp'] = date('c'); + //$request['RequestedShipment']['ServiceType'] = 'PRIORITY_OVERNIGHT'; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... + $request['RequestedShipment']['PackagingType'] = Configuration::get('FEDEX_CARRIER_PACKAGING_TYPE'); // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... + + // Service Type and Packaging Type are not passed in the request + $request['RequestedShipment']['Shipper']['Address'] = array('StreetLines' => Configuration::get('FEDEX_CARRIER_ADDRESS1'), 'City' => Configuration::get('FEDEX_CARRIER_CITY'), 'StateOrProvinceCode' => $shipper_state['iso_code'], 'PostalCode' => Configuration::get('FEDEX_CARRIER_POSTAL_CODE'), 'CountryCode' => $shipper_country['iso_code']); + $request['RequestedShipment']['Recipient']['Address'] = array('StreetLines' => Configuration::get('FEDEX_CARRIER_ADDRESS1'), 'City' => Configuration::get('FEDEX_CARRIER_CITY'), 'StateOrProvinceCode' => $shipper_state['iso_code'], 'PostalCode' => Configuration::get('FEDEX_CARRIER_POSTAL_CODE'), 'CountryCode' => $shipper_country['iso_code']); + $request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER', 'Payor' => array('AccountNumber' => Configuration::get('FEDEX_CARRIER_ACCOUNT'), 'CountryCode' => 'US')); + $request['RequestedShipment']['RateRequestTypes'] = 'ACCOUNT'; + $request['RequestedShipment']['RateRequestTypes'] = 'LIST'; + $request['RequestedShipment']['PackageCount'] = '2'; + $request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES'; + $request['RequestedShipment']['RequestedPackageLineItems'] = array('0' => array('Weight' => array('Value' => 2.0, 'Units' => 'LB'), 'Dimensions' => array('Length' => 10, 'Width' => 10, 'Height' => 3, 'Units' => 'IN'))); + + + // Unit or Large Test + if (!empty($service)) + $servicesList = array(array('code' => $service)); + else + $servicesList = Db::getInstance()->ExecuteS('SELECT `code` FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); + + + // Testing Service + foreach ($servicesList as $service) + { + // Sending Request + $request['RequestedShipment']['ServiceType'] = $service['code']; + $requestHash = $request; + $requestHash['RequestedShipment']['ShipTimestamp'] = 'none'; + + $resultTabTmp = Db::getInstance()->getValue('SELECT `result` FROM `'._DB_PREFIX_.'fedex_cache_test` WHERE `hash` = \''.pSQL(md5(var_export($requestHash, true))).'\''); + if ($resultTabTmp) + $resultTab = unserialize($resultTabTmp); + else + $resultTab = $client->getRates($request); + + // Cache test result + if (empty($resultTabTmp) && isset($resultTab->HighestSeverity) && ($resultTab->HighestSeverity == 'SUCCESS' OR $resultTab->HighestSeverity == 'ERROR')) + Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_cache_test', array('hash' => pSQL(md5(var_export($requestHash, true))), 'result' => pSQL(serialize($resultTab)), 'date_add' => pSQL(date('Y-m-d H:i:s')), 'date_upd' => pSQL(date('Y-m-d H:i:s'))), 'INSERT'); + + // Return results + if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'SUCCESS') + return true; + + if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR') + $this->_webserviceError = $this->l('Error').' '.(isset($resultTab->Notifications->Code) ? $resultTab->Notifications->Code : '').' : '.(isset($resultTab->Notifications->Message) ? $resultTab->Notifications->Message : ''); + else + { + $this->_webserviceError = $this->l('Fedex Webservice seems to be down, please wait a few minutes and try again.'); + return false; + } + } + + return false; + } + + public function getFedexShippingCost($wsParams) + { + // Check config + if (!Configuration::get('FEDEX_CARRIER_API_KEY')) + return array('connect' => false, 'cost' => 0); + + // Check if class Soap is available + if (!extension_loaded('soap')) + return array('connect' => false, 'cost' => 0); + + // Getting module directory + $dir = dirname(__FILE__); + if (preg_match('/classes/i', $dir)) + $dir .= '/../modules/fedexcarrier/'; + + // Enable Php Soap + ini_set("soap.wsdl_cache_enabled", "0"); + $client = new SoapClient($dir.'/RateService_v9.wsdl', array('trace' => 1)); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information + + // Country / State + $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('FEDEX_CARRIER_COUNTRY'))); + $shipper_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)(Configuration::get('FEDEX_CARRIER_STATE'))); + + // Generating soap request + $request['WebAuthenticationDetail']['UserCredential'] = array('Key' => Configuration::get('FEDEX_CARRIER_API_KEY'), 'Password' => Configuration::get('FEDEX_CARRIER_PASSWORD')); + $request['ClientDetail'] = array('AccountNumber' => Configuration::get('FEDEX_CARRIER_ACCOUNT'), 'MeterNumber' => Configuration::get('FEDEX_CARRIER_METER')); + $request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Available Services Request v9 using PHP ***'); + $request['Version'] = array('ServiceId' => 'crs', 'Major' => '9', 'Intermediate' => '0', 'Minor' => '0'); + $request['ReturnTransitAndCommit'] = true; + $request['RequestedShipment']['DropoffType'] = Configuration::get('FEDEX_CARRIER_PICKUP_TYPE'); // valid values REGULAR_PICKUP, REQUEST_COURIER, ... + $request['RequestedShipment']['ShipTimestamp'] = date('c'); + $request['RequestedShipment']['ServiceType'] = $wsParams['service']; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... + $request['RequestedShipment']['PackagingType'] = Configuration::get('FEDEX_CARRIER_PACKAGING_TYPE'); // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... + + // Service Type and Packaging Type are not passed in the request + $request['RequestedShipment']['Shipper']['Address'] = array('StreetLines' => $wsParams['shipper_address1'], 'City' => $wsParams['shipper_city'], 'StateOrProvinceCode' => $wsParams['shipper_state_iso'], 'PostalCode' => $wsParams['shipper_postalcode'], 'CountryCode' => $wsParams['shipper_country_iso']); + $request['RequestedShipment']['Recipient']['Address'] = array('StreetLines' => $wsParams['recipient_address1'], 'City' => $wsParams['recipient_city'], 'StateOrProvinceCode' => $wsParams['recipient_state_iso'], 'PostalCode' => $wsParams['recipient_postalcode'], 'CountryCode' => $wsParams['recipient_country_iso']); + $request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER', 'Payor' => array('AccountNumber' => Configuration::get('FEDEX_CARRIER_ACCOUNT'), 'CountryCode' => 'US')); + $request['RequestedShipment']['RateRequestTypes'] = 'ACCOUNT'; + $request['RequestedShipment']['RateRequestTypes'] = 'LIST'; + $request['RequestedShipment']['PackageCount'] = '2'; + $request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES'; + foreach ($wsParams['package_list'] as $p) + $request['RequestedShipment']['RequestedPackageLineItems'][] = array('Weight' => array('Value' => $p['weight'], 'Units' => substr($this->_weightUnit, 0, 2)), 'Dimensions' => array('Length' => $p['depth'], 'Width' => $p['width'], 'Height' => $p['height'], 'Units' => $this->_dimensionUnit)); + + + // Get Rates + $resultTab = $client->getRates($request); + + + // Check currency + $conversionRate = 1; + if (isset($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Currency)) + { + $id_currency_return = Db::getInstance()->getValue('SELECT `id_currency` FROM `'._DB_PREFIX_.'currency` WHERE `iso_code` = \''.pSQL($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Currency).'\''); + $conversionRate = $this->getCookieCurrencyRate($id_currency_return); + } + + // Return results + if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'SUCCESS') + return array('connect' => true, 'cost' => number_format($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount,2,'.',',') * $conversionRate); + + if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR') + $this->_webserviceError = $this->l('Error').' '.(isset($resultTab->Notifications->Code) ? $resultTab->Notifications->Code : '').' : '.(isset($resultTab->Notifications->Message) ? $resultTab->Notifications->Message : ''); + else + $this->_webserviceError = $this->l('Fedex Webservice seems to be down, please wait a few minutes and try again.'); + + return array('connect' => false, 'cost' => 0); + } + +} + +?> diff --git a/modules/fedexcarrier/fr.php b/modules/fedexcarrier/fr.php new file mode 100644 index 000000000..abb58074c --- /dev/null +++ b/modules/fedexcarrier/fr.php @@ -0,0 +1,145 @@ +fedexcarrier_c0d00fcb670ada42dad4698b865f40cd'] = 'Transporteur Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0aad1e954489f441f8824e1f990d4774'] = 'Propose à vos clients le transporteur Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff86cba2f7fe4a2dec854d107a4d99d2'] = 'Class Soap'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_883fa0069f4b0454e2277dd567ab3991'] = '\'Unité de poids (LB ou KG)\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5a3ceec65d417f5d92c26dbf0dccc00d'] = '\'Unité de mesure (CM ou IN)\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4d470fde8487e755a50e9235e3dc13ab'] = 'doivent être configurés correctement pour utiliser ce module'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a1d8be175eff378884736e1b44da526e'] = 'Votre compte Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c481cd53864462a87dcb89c33589ff8e'] = 'Votre Fedex meter number'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_918356c887962073f010ee06e1395713'] = 'Votre mot de passe Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c2b826b79539fa093a6db05ca5ec9e0'] = 'Votre API Key Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3ef2f9d666a37f95d963a84c46bae646'] = 'Ramassage par défaut'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_72f18dde0a5c9f75dd487adeacb92b56'] = 'Type de colis par défaut'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bb8a37c6acccadf3e28a704d59f1f8a'] = 'Business service center'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c0b3132d2759b40e8525f2466c477d1c'] = 'Drop box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_22db7528d7c5df8e310bf19af75e61d3'] = 'Regular pickup'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7e8eb99ef29d93f494ebdc27b59444f5'] = 'Request courier'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_394a844cc3d6d99eb45b4e71afde2c99'] = 'Station'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_57185ccd597e58ad9e4944f4356222b6'] = '10Kg Box Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8ccd685b767c927bca8501ae80d954'] = '25Kg Box Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_38f14cc3e27cc856e61e3a7f555148d2'] = 'Box Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_36aba1bfaa5062695e71a6524008dd8a'] = 'Enveloppe Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0e6a558b4ce274905600856b20b471e'] = 'Pak Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b2953c3343913eee2398c1fe2651be7'] = 'Tube Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_451400926783d7a47cd31025717bc97f'] = 'Votre type de colis'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46f58e2a308b68cae9d5f5dd8a5d4ad6'] = 'Europe first international priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0fd6265588d27073ef45ed36d5c00c75'] = 'Fedex 1 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dfa184d2bf6a5d6ee8ffebfbaa25394c'] = 'Fedex 2 day'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2c0f88b63bfbe05955db90f1dcccab2e'] = 'Fedex 2 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_03aac4b90886eabd480cee819e24d09e'] = 'Fedex 3 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_687009f2bc600c25a005b26f4cb4ab02'] = 'Fedex express saver'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6e8cf654ec68d7391f5d673331e2c212'] = 'Fedex freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1497c5bee4dd896e0b84c442be1e8760'] = 'Fedex ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_23044a6996eda8ad80874f5bdd72a0bc'] = 'Fedex national freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4cee621e07c270fb1031f231e592a8cd'] = 'First overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e1416870eb1cf36849393bf6ef6f6966'] = 'Ground home delivery'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_124dd98ba09563af1900c14885e97d6e'] = 'International economy'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2751413ff6e957a3b6894929b008b123'] = 'International economy freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cebbbe47be59307e1751e2febe44fdc6'] = 'International first'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f3f9ee160906e71040b437410459ec79'] = 'International ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_759d99c1c032d4171c2f142af4f79436'] = 'International priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a8c786474d046ba2b2b90b78a7b498cf'] = 'International priority freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec25bbf3daf58ec08920a781e25a3f3d'] = 'International priority freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e889962a8517669ba4ac839afa6384df'] = 'Smart post'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0a7bd01967a1874144b1b4fab2ee6a6f'] = 'Standard overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d999f792aee7c730cdc95f6aff4aa436'] = 'Transporteur FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_99e509958c21ac35438651547a7bb035'] = 'Statut du module FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d23a9177c3c7256ede85643a19335afb'] = 'Le transporteur FEDEX est fonctionnel !'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bc95bc43c48a735773d4182dcf526fb'] = 'Le transporteur FEDEX n\'est pas encore complètement configuré.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e203b9a16f360b88d90bba6eb61ce61'] = 'Veuillez remplir le formulaire \"Configuration Générale\"'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c0987b9315003df7dae7f130e3cf58e'] = 'Choississez vos services de livraison disponibles'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e20f6d6f13fe70e78f6e2ab488493ccf'] = 'Test de connection webservice'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_807b063fceafae2c51dc6afb45612389'] = 'Extension Soap activée'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_52f4393e1b52ba63e27310ca92ba098c'] = 'Configuration générale'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_277d63a9b24a09697e3c64092eaf4353'] = 'Configuration des catégories'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_098eec2cabe2c39c6dec3fc522b6571a'] = 'Configuration des produits'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d2126da975d5b9a5b846efaf57d3fd53'] = 'Configuration générale'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a50bb127f9b307757cf52ab86d70adac'] = 'Votre compte Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8b0ebd10992bd1576eccf605a84175'] = 'Votre Fedex meter number'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c36a272a8778a2e85de52a01675fd521'] = 'Votre mot de passe Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e2cd475470bc7b47bef8d4ecdae2a67'] = 'Votre Fedex Key API'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cdfa1b01c330bf745f776f6c6c8afffd'] = 'Veuillez cliquer ici pour obtenir votre Fedex Key API'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_83ad4fdaf06650e6d9d7ca18f82fb975'] = 'Configuration de localisation'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f489118ea95c746d648d36bb50c226f0'] = 'Unité de poids'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_659c95668841b7d6602ead454b28d4ba'] = 'L\'unité de poids de votre magasin (ex: kg ou lb)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cc13d156306185fd42a860da3049567c'] = 'Unité de mesure'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f804c2bdebc117d9cde3cddad3b49845'] = 'L\'unité de mesure de votre magasin (ex: cm ou in)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2481447d04ae756836d32e3ade240ff4'] = 'Configuration de l\'adresse'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b179e75d464a04d8a04111131b3a3ca'] = 'Adresse (ligne 1)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_281b2def1a9737b33f88013c94fdfeb8'] = 'Adresse (ligne 2)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d30f507473129e70c4b962ceccf175cf'] = 'Code postal'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0585aac6bb77bb49423b2effca0e067'] = 'Ville'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f8f5a972333ee726fbe5bb52409c0ed0'] = 'Choississez un pays ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4e9863cf5326e6714388045321665d07'] = 'Choississez un pays dans la liste'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46a2a41cc6e552044816a2d04634545d'] = 'Etat'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cf1580798f7aba85d519afadf1ffd886'] = 'Choississez un état ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_02546d525ab356bd43c91e6b07447496'] = 'Il n\'y a pas de configuration d\'état pour ce pays'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ddc2a5660f7d095fff34d6b93077c80'] = 'Configuration de service'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f405714368454e1f9c932432693aea42'] = 'Type de livraison par défault'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ce135482b30deedcc0046df41c12de79'] = 'Choisissez votre méthode de livraison par défault...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a361a1f786db3dfe07aae42752d3446'] = 'Type de colis par défaut'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4664d1ae1832bed2246e8a6850365075'] = 'Choississez un type de colis par défaut'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Services de livraison'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_78945de8de090e90045d299651a68a9b'] = 'Disponible'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponible'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d63e135774e62574e2a1921267dad142'] = 'Choissisez les services de livraison qui seront disponibles pour vos clients'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9b8c4a7116e8c44e4ebc955fafd47586'] = 'Votre compte fedex n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9cc1a101547b3ece6d946dbbe3469d7'] = 'Votre Fedex meter number n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ce0f66588bbbbbb3ef0634e5ea7da69'] = 'Votre mot de passe Fedex n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7988c0adb770f0f945814c0fb2b5800b'] = 'Votre Fedex API Key n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5d5ae09e7b6041d3449ef2cbfc39f560'] = 'Votre méthode livraison n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e794e452ed4d2cfa13083693a2c8810e'] = 'Votre type de colis n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_805353d2862ea0e658c9ddda871540fa'] = 'Votre code postal n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ef9bd955e165dfb0207877e9fe180aeb'] = 'Votre ville n\'est pas spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ecc7697a320f93f3ee8fb4048dbd64c'] = 'Votre pays n\'est spécifié'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_729d4f7143a3de7b0ed18de667fdf4d5'] = 'Prestashop n\'a pas pu se connecter aux webservices FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9d1b485edd50e6fbd288b340b386b07d'] = 'Aucune description d\'erreur correspondante'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9284bff13acffdd879ef4ac7fca5234'] = 'Configuration non mise à jour'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_67e19ffdaa0a11e69349810403a9727e'] = 'Vous devez configurer l\'onglet \"Configuration Générale\" avant d\'utiliser cet onglet'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a37b48e8684078c0620a997b3baeee9f'] = 'Vous devez configurer l\'onglet \"Configuration Générale\" avant d\'utiliser cet onglet'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f421827ff72ef9a61fb27aa0de62f1e4'] = 'Configuration ID'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ca2fb7f67355c05d2ffa963fac6e91e1'] = 'Type de ramassage'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d9bc28a26253438f5b16cea5eb35681a'] = 'Type de colis'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20cde117cbc92b9ec1fb4e5bc4a7b9bd'] = 'Frais additionnels'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Services'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4f8e00c5ae41d97ab62a947b8e806d55'] = 'Il n\'y pas de configuration FEDEX spécifiques pour les catégories pour le moment.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f1c611f93510bbee05663c82f6d439e2'] = 'Êtes vous sûr de vouloir effacer cette configuration FEDEX spécifiques pour cette catégorie ?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e0cb9fd22b124c0839302fef54762d7'] = 'Mise à jour d\'une régle'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dd593f8a542ab628cbba98c709255e60'] = 'Ajouter une régle'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1debf905ac528b3f0615cd379ced0d38'] = 'Type de ramassage'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b03dfe92d8c5b6a15d3f139998580563'] = 'Choississez un type de ramassage ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_da42caf26ef85de3d7e48e16ca60b891'] = 'Type de colis'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8d2ee0603dfce09b57d60db628cde269'] = 'Choississez un type de colis ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7fcafa7c47e984693fcb8a92c0fd1beb'] = 'Choississez une catégorie ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d725c0166e978cc30853996c70440873'] = 'Vous devez choisir une catégorie'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff63f917e2a947d454bce41b104cfbd2'] = 'Cette catégorie a déjà une configuration FEDEX spécifique.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_fd0119c2a5fc18aa64887b5b7ab41c19'] = 'Une erreur est survenue, veuillez retenter ultérieurement.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20f40087c53c662adfb4e780500eaa15'] = 'Dans cet onglet, vous pouvez enregistrer une configuration spécifique pour chaque produit.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cef3da9171b7ac6d7a6e206e68a2a246'] = 'Il n\'y pas de configuration FEDEX spécifiques pour les produits pour le moment.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ceb0ede9c02d159aa2360a3d0694d9ed'] = 'Êtes vous sûr de vouloir effacer cette configuration FEDEX spécifiques pour ce produit ?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3c4d710b56f4318dae775cff80619f84'] = 'Choississez un produit ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c07640370e4681bf98638d0c458cd2e'] = 'Vous devez choisir un produit.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8fc3abc76f5a163f81962a52fc5a3703'] = 'Ce produit a déjà une configuration FEDEX spécifique'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c3eacca576fbfc5dca21b50d9f6ef8f'] = 'Bienvenue dans le configurateur du module FEDEX pour PrestaShop'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_92640c80a67da1782a18304336405dac'] = 'Cette section vous aidera à comprendre comment configurer chaque module correctement.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec0e6948e8f34818d80f27c309f46661'] = 'Ci-dessous, la description de chaque champs :'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b12c6f84e131ed2192e9d9c6c531f239'] = 'Votre compte FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ea2cd644fcacb9e8fe1d4c9c89a677b'] = 'Vous devez vous inscrire sur le site de FEDEX à cette adresse'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_35ba940948fa0ea163fd01281de10e2f'] = 'Ce champ doit être le code postal du lieu de départ de vos colis.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_81822348ace1ceabad5e9f8992ce9ea4'] = 'Ce champ doit être le pays de départ de vos colis'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_74395432668d0313b593712dfc40479a'] = 'Ce champ correspond au ramassage par défaut (quand il n\'y a pas de configuration spécifique pour le produit ou la catégorie)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9bba478eb4348e49e672e944b072b68'] = 'Ces champs correspondent aux services de livraison disponibles (quand il n\'y a pas de configuration spécifique pour le produit ou la catégorie)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_71ffd676000b4ec8ea95f4096adc3d3c'] = 'Cette section vous permet de définir des configurations FEDEX spécifiques pour chaque catégorie de produit (tel que le type de colis et les frais additionnels)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_89a9eabc8fc9335d484dcb1eb7ef4ac5'] = 'Cette section vous permet de définir des configurations FEDEX spécifiques pour chaque produit (tel que le type de colis et les frais additionnels)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Erreur'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e303843029d99ced59415005037969d'] = 'Les webservices Fedex sont injoignables, veuillez patienter quelques minutes et réessayer.'; diff --git a/modules/fedexcarrier/it.php b/modules/fedexcarrier/it.php new file mode 100644 index 000000000..ab1b8d66a --- /dev/null +++ b/modules/fedexcarrier/it.php @@ -0,0 +1,145 @@ +fedexcarrier_c0d00fcb670ada42dad4698b865f40cd'] = 'Corriere Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0aad1e954489f441f8824e1f990d4774'] = 'Offri ai tuoi clienti modalità di consegna differenti con Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff86cba2f7fe4a2dec854d107a4d99d2'] = 'Class Soap'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_883fa0069f4b0454e2277dd567ab3991'] = 'Unita \'di peso (LB o KG).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5a3ceec65d417f5d92c26dbf0dccc00d'] = '\'Unità di Dimensione (CM o IN).\''; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4d470fde8487e755a50e9235e3dc13ab'] = 'deve essere configurato per utilizzare questo modulo correttamente'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a1d8be175eff378884736e1b44da526e'] = 'Account Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c481cd53864462a87dcb89c33589ff8e'] = 'Fedex meter'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_918356c887962073f010ee06e1395713'] = 'Password Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c2b826b79539fa093a6db05ca5ec9e0'] = 'Chiave API Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3ef2f9d666a37f95d963a84c46bae646'] = 'Tipo di ritiro Fedex di default'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_72f18dde0a5c9f75dd487adeacb92b56'] = 'Tipo di confezione Fedex di default'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bb8a37c6acccadf3e28a704d59f1f8a'] = 'Centro servizi Business'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c0b3132d2759b40e8525f2466c477d1c'] = 'Drop box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_22db7528d7c5df8e310bf19af75e61d3'] = 'Ritiro regolare'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7e8eb99ef29d93f494ebdc27b59444f5'] = 'Corriere richiesto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_394a844cc3d6d99eb45b4e71afde2c99'] = 'Stazione'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_57185ccd597e58ad9e4944f4356222b6'] = 'FedEx Box 10 kg'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8ccd685b767c927bca8501ae80d954'] = 'FedEx Box 25 kg'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_38f14cc3e27cc856e61e3a7f555148d2'] = 'Fedex Box'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_36aba1bfaa5062695e71a6524008dd8a'] = 'Busta Fedex '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0e6a558b4ce274905600856b20b471e'] = 'Pak Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b2953c3343913eee2398c1fe2651be7'] = 'Tubo Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_451400926783d7a47cd31025717bc97f'] = 'La tua confezione'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46f58e2a308b68cae9d5f5dd8a5d4ad6'] = 'Prima priorità internazionale in Europa'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0fd6265588d27073ef45ed36d5c00c75'] = 'Fedex 1 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dfa184d2bf6a5d6ee8ffebfbaa25394c'] = 'Fedex 2 day'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2c0f88b63bfbe05955db90f1dcccab2e'] = 'Fedex 2 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_03aac4b90886eabd480cee819e24d09e'] = 'Fedex 3 day freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_687009f2bc600c25a005b26f4cb4ab02'] = 'Fedex express saver'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6e8cf654ec68d7391f5d673331e2c212'] = 'Fedex freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1497c5bee4dd896e0b84c442be1e8760'] = 'Fedex ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_23044a6996eda8ad80874f5bdd72a0bc'] = 'Fedex national freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4cee621e07c270fb1031f231e592a8cd'] = 'First overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e1416870eb1cf36849393bf6ef6f6966'] = 'Ground home delivery'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_124dd98ba09563af1900c14885e97d6e'] = 'International economy'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2751413ff6e957a3b6894929b008b123'] = 'International economy freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cebbbe47be59307e1751e2febe44fdc6'] = 'International first'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f3f9ee160906e71040b437410459ec79'] = 'International ground'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_759d99c1c032d4171c2f142af4f79436'] = 'International priority'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a8c786474d046ba2b2b90b78a7b498cf'] = 'International priority freight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec25bbf3daf58ec08920a781e25a3f3d'] = 'Priority overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e889962a8517669ba4ac839afa6384df'] = 'Smart post'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0a7bd01967a1874144b1b4fab2ee6a6f'] = 'Standard overnight'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d999f792aee7c730cdc95f6aff4aa436'] = 'Corriere FEDEX '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_99e509958c21ac35438651547a7bb035'] = 'Status modulo Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d23a9177c3c7256ede85643a19335afb'] = 'Corriere FEDEX è ben configurato e online!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5bc95bc43c48a735773d4182dcf526fb'] = 'Corriere FEDEX non è ancora configurato, è necessario:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e203b9a16f360b88d90bba6eb61ce61'] = 'Riempi il modulo \"Impostazioni generali\"'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8c0987b9315003df7dae7f130e3cf58e'] = 'Seleziona il tuo servizio di consegna disponibile'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e20f6d6f13fe70e78f6e2ab488493ccf'] = 'Test di connessione webservice'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_807b063fceafae2c51dc6afb45612389'] = 'Soap attivato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_52f4393e1b52ba63e27310ca92ba098c'] = 'Impostazioni generali'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_277d63a9b24a09697e3c64092eaf4353'] = 'Impostazioni categorie'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_098eec2cabe2c39c6dec3fc522b6571a'] = 'Impostazioni prodotti'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d2126da975d5b9a5b846efaf57d3fd53'] = 'Configurazione generale'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a50bb127f9b307757cf52ab86d70adac'] = 'Il tuo account Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a8b0ebd10992bd1576eccf605a84175'] = 'Il tuo numero di Fedex meter'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c36a272a8778a2e85de52a01675fd521'] = 'La tua password Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e2cd475470bc7b47bef8d4ecdae2a67'] = 'La tua API Key Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cdfa1b01c330bf745f776f6c6c8afffd'] = 'Fare clic qui per ottenere il tuo API Key Fedex'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_83ad4fdaf06650e6d9d7ca18f82fb975'] = 'Configurazione di localizzazione '; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f489118ea95c746d648d36bb50c226f0'] = 'Unità di peso'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_659c95668841b7d6602ead454b28d4ba'] = 'Unità di peso del tuo negozio (es. kg o lb)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cc13d156306185fd42a860da3049567c'] = 'Unità di misura'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f804c2bdebc117d9cde3cddad3b49845'] = 'Unità di misura del tuo negozio (es. cm o in)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2481447d04ae756836d32e3ade240ff4'] = 'Configurazione indirizzo'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5b179e75d464a04d8a04111131b3a3ca'] = 'Indirizzo (linea 1)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_281b2def1a9737b33f88013c94fdfeb8'] = 'Indirizzo (linea 2)'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d30f507473129e70c4b962ceccf175cf'] = 'CAP'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d0585aac6bb77bb49423b2effca0e067'] = 'La tua città'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_59716c97497eb9694541f7c3d37b1a4d'] = 'Paese'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f8f5a972333ee726fbe5bb52409c0ed0'] = 'Scegliere un paese ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4e9863cf5326e6714388045321665d07'] = 'Seleziona il paese all\'interno della lista.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_46a2a41cc6e552044816a2d04634545d'] = 'Stato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cf1580798f7aba85d519afadf1ffd886'] = 'Seleziona uno stato ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_02546d525ab356bd43c91e6b07447496'] = 'Non vi è nessuna configurazione di stato per questo paese'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ddc2a5660f7d095fff34d6b93077c80'] = 'Configurazione servizio'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f405714368454e1f9c932432693aea42'] = 'Tipo ritiro default'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ce135482b30deedcc0046df41c12de79'] = 'Seleziona un tipo di ritiro di default ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9a361a1f786db3dfe07aae42752d3446'] = 'Tipo di confezione di default'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4664d1ae1832bed2246e8a6850365075'] = 'Seleziona un tipo di confezione di default ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5cdd307ba6e260beb4801c0c10e22a3a'] = 'Servizio di consegna'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_78945de8de090e90045d299651a68a9b'] = 'Disponibile'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_2d25c72c1b18e562f6654fff8e11711e'] = 'Non disponibile'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d63e135774e62574e2a1921267dad142'] = 'Scegli il servizio di consegna che sarà disponibile per i clienti.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9b8c4a7116e8c44e4ebc955fafd47586'] = 'Il tuo account Fedex non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9cc1a101547b3ece6d946dbbe3469d7'] = 'Il tuo Fedex meter non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ce0f66588bbbbbb3ef0634e5ea7da69'] = 'La tua password Fedex non è specificata'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7988c0adb770f0f945814c0fb2b5800b'] = 'La tua Fedex API Key non è specificata'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5d5ae09e7b6041d3449ef2cbfc39f560'] = 'Il tuo tipo di ritiro non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_e794e452ed4d2cfa13083693a2c8810e'] = 'Il tuo tipo di confezione non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_805353d2862ea0e658c9ddda871540fa'] = 'Il tuo CAP non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ef9bd955e165dfb0207877e9fe180aeb'] = 'La tua città non è specificata'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5ecc7697a320f93f3ee8fb4048dbd64c'] = 'Il tuo paese non è specificato'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_729d4f7143a3de7b0ed18de667fdf4d5'] = 'Prestashop non può connettersi al webservices FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9d1b485edd50e6fbd288b340b386b07d'] = 'Nessuna descrizione dell\'errore trovata'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9284bff13acffdd879ef4ac7fca5234'] = 'Impostazioni non riuscite'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_67e19ffdaa0a11e69349810403a9727e'] = 'È necessario configurare il tab \"Impostazioni generali\" prima di utilizzare questo tab.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_a37b48e8684078c0620a997b3baeee9f'] = 'In questo tab è possibile impostare una configurazione specifica per ogni categoria.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f421827ff72ef9a61fb27aa0de62f1e4'] = 'Config ID'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ca2fb7f67355c05d2ffa963fac6e91e1'] = 'Tipo di ritiro'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d9bc28a26253438f5b16cea5eb35681a'] = 'Tipo di confezione'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20cde117cbc92b9ec1fb4e5bc4a7b9bd'] = 'Spese aggiuntive'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Servizi'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_4f8e00c5ae41d97ab62a947b8e806d55'] = 'Non vi è alcuna configurazione specifica FEDEX per le categorie a questo punto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_f1c611f93510bbee05663c82f6d439e2'] = 'Sei sicuro di voler cancellare questa specifica configurazione FEDEX per questa categoria?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3e0cb9fd22b124c0839302fef54762d7'] = 'Aggiorna di una regola'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_dd593f8a542ab628cbba98c709255e60'] = 'Aggiungi una regola'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_1debf905ac528b3f0615cd379ced0d38'] = 'Tipo ritiro'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b03dfe92d8c5b6a15d3f139998580563'] = 'Seleziona un tipo di ritiro ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_da42caf26ef85de3d7e48e16ca60b891'] = 'Tipo di confezione'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8d2ee0603dfce09b57d60db628cde269'] = 'Seleziona un tipo di confezione...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_7fcafa7c47e984693fcb8a92c0fd1beb'] = 'Seleziona una categoria ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_d725c0166e978cc30853996c70440873'] = 'Devi selezionare una categoria.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ff63f917e2a947d454bce41b104cfbd2'] = 'Questa categoria ha già una configurazione specifica FEDEX.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_fd0119c2a5fc18aa64887b5b7ab41c19'] = 'Si è verificato un errore, per favore riprova.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_20f40087c53c662adfb4e780500eaa15'] = 'In questo tab è possibile impostare una configurazione specifica per ogni prodotto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_deb10517653c255364175796ace3553f'] = 'Prodotto'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_cef3da9171b7ac6d7a6e206e68a2a246'] = 'Non vi è alcuna configurazione specifica FEDEX per i prodotti a questo punto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ceb0ede9c02d159aa2360a3d0694d9ed'] = 'Sei sicuro di voler cancellare questa specifica configurazione FEDEX per questo prodotto?'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_3c4d710b56f4318dae775cff80619f84'] = 'Scegli un prodotto ...'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c07640370e4681bf98638d0c458cd2e'] = 'Devi selezionare un prodotto.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_8fc3abc76f5a163f81962a52fc5a3703'] = 'Questo prodotto ha già una configurazione specifica FEDEX.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_9c3eacca576fbfc5dca21b50d9f6ef8f'] = 'Benvenuti nel configuratore di modulo PrestaShop FEDEX!'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_92640c80a67da1782a18304336405dac'] = 'Questa sezione ti aiuterà a capire come configurare questo modulo correttamente.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_ec0e6948e8f34818d80f27c309f46661'] = 'Vedi sotto per la descrizione di ogni campo:'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b12c6f84e131ed2192e9d9c6c531f239'] = 'Il tuo account FEDEX'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_0ea2cd644fcacb9e8fe1d4c9c89a677b'] = 'È necessario iscriversi sul sito web FEDEX a questo indirizzo'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_35ba940948fa0ea163fd01281de10e2f'] = 'Questo campo deve essere il CAP del punto di partenza del tuo pacco.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_81822348ace1ceabad5e9f8992ce9ea4'] = 'Questo campo deve essere il paese del punto di partenza del tuo pacco.'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_74395432668d0313b593712dfc40479a'] = 'Questo campo corrisponde al tipo di ritiro di default (quando non c\'è alcuna configurazione specifica per il prodotto o la categoria di prodotto).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_b9bba478eb4348e49e672e944b072b68'] = 'Queste caselle corrispondono ai servizi di consegna che vuoi mettere a disposizione (quando non c\'è alcuna configurazione specifica per il prodotto o la categoria di prodotto).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_71ffd676000b4ec8ea95f4096adc3d3c'] = 'Questa sezione ti permette di definire una configurazione specifica FEDEX per ogni categoria di prodotti (come il tipo di confezione e le spese supplementari).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_89a9eabc8fc9335d484dcb1eb7ef4ac5'] = 'Questa sezione ti permette di definire una configurazione specifica FEDEX per ogni prodotto (come il tipo di confezione e le spese supplementari).'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Errore'; +$_MODULE['<{fedexcarrier}prestashop>fedexcarrier_5e303843029d99ced59415005037969d'] = 'Fedex Webservice sembra non funzionare, attendi qualche minuto e riprova'; diff --git a/modules/fedexcarrier/logo.gif b/modules/fedexcarrier/logo.gif new file mode 100644 index 000000000..bcd02eb85 Binary files /dev/null and b/modules/fedexcarrier/logo.gif differ diff --git a/modules/fedexcarrier/sql-install.php b/modules/fedexcarrier/sql-install.php new file mode 100755 index 000000000..77f87925d --- /dev/null +++ b/modules/fedexcarrier/sql-install.php @@ -0,0 +1,89 @@ + diff --git a/modules/fedexcarrier/sql-uninstall.php b/modules/fedexcarrier/sql-uninstall.php new file mode 100755 index 000000000..e2d37ab64 --- /dev/null +++ b/modules/fedexcarrier/sql-uninstall.php @@ -0,0 +1,11 @@ + diff --git a/modules/feeder/config.xml b/modules/feeder/config.xml new file mode 100755 index 000000000..c537e90ea --- /dev/null +++ b/modules/feeder/config.xml @@ -0,0 +1,11 @@ + + + feeder + RSS products feed + 0.2 + Generate a RSS products feed + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/feeder/de.php b/modules/feeder/de.php new file mode 100644 index 000000000..4e912d203 --- /dev/null +++ b/modules/feeder/de.php @@ -0,0 +1,6 @@ +feeder_4dce2f12546b229088d3cc214c3c2f7d'] = 'RSS-Feeds Produkte'; +$_MODULE['<{feeder}prestashop>feeder_d70a880c7153de483014eababfa65f11'] = 'Generieren Sie einen RSS-Feed Produkte'; diff --git a/modules/feeder/en.php b/modules/feeder/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/feeder/en.php @@ -0,0 +1,4 @@ +feeder_4dce2f12546b229088d3cc214c3c2f7d'] = 'Fuente de productos RSS'; +$_MODULE['<{feeder}prestashop>feeder_d70a880c7153de483014eababfa65f11'] = 'Generar fuente de productos RSS'; diff --git a/modules/feeder/feeder.php b/modules/feeder/feeder.php new file mode 100644 index 000000000..606798de1 --- /dev/null +++ b/modules/feeder/feeder.php @@ -0,0 +1,92 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Feeder extends Module +{ + private $_postErrors = array(); + + public function __construct() + { + $this->name = 'feeder'; + $this->tab = 'front_office_features'; + $this->version = 0.2; + $this->author = 'PrestaShop'; + + $this->_directory = dirname(__FILE__).'/../../'; + parent::__construct(); + + $this->displayName = $this->l('RSS products feed'); + $this->description = $this->l('Generate a RSS products feed'); + } + + function install() + { + if (!parent::install()) + return false; + if (!$this->registerHook('header')) + return false; + return true; + } + + function hookHeader($params) + { + global $smarty, $cookie; + + $id_category = (int)(Tools::getValue('id_category')); + if (!$id_category) + { + if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html')) + { + if (isset($regs[2]) AND is_numeric($regs[2])) + $id_category = (int)($regs[2]); + elseif (isset($regs[5]) AND is_numeric($regs[5])) + $id_category = (int)($regs[5]); + } + elseif ($id_product = (int)(Tools::getValue('id_product'))) + { + $product = new Product($id_product); + $id_category = $product->id_category_default; + } + } + $category = new Category($id_category); + $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); + $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); + $orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); + $orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); + if (!in_array($orderBy, $orderByValues)) + $orderBy = $orderByValues[0]; + if (!in_array($orderWay, $orderWayValues)) + $orderWay = $orderWayValues[0]; + $smarty->assign(array( + 'feedUrl' => Tools::getShopDomain(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/rss.php?id_category='.$id_category.'&orderby='.$orderBy.'&orderway='.$orderWay, + )); + return $this->display(__FILE__, 'feederHeader.tpl'); + } +} diff --git a/modules/feeder/feederHeader.tpl b/modules/feeder/feederHeader.tpl new file mode 100644 index 000000000..f4fc66eff --- /dev/null +++ b/modules/feeder/feederHeader.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + \ No newline at end of file diff --git a/modules/feeder/fr.php b/modules/feeder/fr.php new file mode 100644 index 000000000..845a6986c --- /dev/null +++ b/modules/feeder/fr.php @@ -0,0 +1,6 @@ +feeder_4dce2f12546b229088d3cc214c3c2f7d'] = 'Flux RSS de produits'; +$_MODULE['<{feeder}prestashop>feeder_d70a880c7153de483014eababfa65f11'] = 'Générer un Flux RSS de produits'; diff --git a/modules/feeder/it.php b/modules/feeder/it.php new file mode 100644 index 000000000..5381a4a06 --- /dev/null +++ b/modules/feeder/it.php @@ -0,0 +1,6 @@ +feeder_4dce2f12546b229088d3cc214c3c2f7d'] = 'Feed RSS prodotti'; +$_MODULE['<{feeder}prestashop>feeder_d70a880c7153de483014eababfa65f11'] = 'Crea un Feed RSS prodotti'; diff --git a/modules/feeder/logo.gif b/modules/feeder/logo.gif new file mode 100644 index 000000000..7a5e0099f Binary files /dev/null and b/modules/feeder/logo.gif differ diff --git a/modules/feeder/rss.php b/modules/feeder/rss.php new file mode 100644 index 000000000..c1dc9f730 --- /dev/null +++ b/modules/feeder/rss.php @@ -0,0 +1,83 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +// Get data +$number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10); +$orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); +$orderWayValues = array(0 => 'ASC', 1 => 'DESC'); +$orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); +$orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); +if (!in_array($orderBy, $orderByValues)) + $orderBy = $orderByValues[0]; +if (!in_array($orderWay, $orderWayValues)) + $orderWay = $orderWayValues[0]; +$id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : 1); +$products = Product::getProducts((int)($cookie->id_lang), 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); +$currency = new Currency((int)($cookie->id_currency)); +$affiliate = (Tools::getValue('ac') ? '?ac='.(int)(Tools::getValue('ac')) : ''); + +// Send feed +header("Content-Type:text/xml; charset=utf-8"); +echo ''."\n"; +?> + + + <![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]> + + + PrestaShop + id_lang)); ?> + + <![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]> + + + +id_lang), $product['id_product']); + echo "\t\t\n"; + echo "\t\t\t<![CDATA[".$product['name']." - ".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')." ]]>\n"; + echo "\t\t\t"; + $cdata = true; + if (is_array($image) AND sizeof($image)) + { + echo ""; + $cdata = false; + } + if ($cdata) + echo "\n"; + + echo "\t\t\tgetproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang))).$affiliate."]]>\n"; + echo "\t\t\n"; + } +?> + + \ No newline at end of file diff --git a/modules/fianetfraud/config.xml b/modules/fianetfraud/config.xml new file mode 100755 index 000000000..1bb6a5c13 --- /dev/null +++ b/modules/fianetfraud/config.xml @@ -0,0 +1,12 @@ + + + fianetfraud + FIA-NET - Système d\'Analyse des Commandes + 1.1 + Protégez vous contre la fraude à la carte bancaire sans perturber l\'acte d\'achat + + payment_security + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/fianetfraud/cron_reevaluate.php b/modules/fianetfraud/cron_reevaluate.php new file mode 100644 index 000000000..13a145d5e --- /dev/null +++ b/modules/fianetfraud/cron_reevaluate.php @@ -0,0 +1,31 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/fianetfraud.php'); + +FianetFraud::reEvaluateOrder(); + diff --git a/modules/fianetfraud/cron_waiting.php b/modules/fianetfraud/cron_waiting.php new file mode 100644 index 000000000..0e153bf11 --- /dev/null +++ b/modules/fianetfraud/cron_waiting.php @@ -0,0 +1,33 @@ +#!/usr/bin/php + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/fianetfraud.php'); + +FianetFraud::checkWaitingOrders(); + diff --git a/modules/fianetfraud/de.php b/modules/fianetfraud/de.php new file mode 100644 index 000000000..180ae1a56 --- /dev/null +++ b/modules/fianetfraud/de.php @@ -0,0 +1,36 @@ +fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Ungültige Lieferanten-Code'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Um sich anzumelden, melden Sie sich ab:'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Fia-Net Website'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Login'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'Seiten-ID'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Betriebsmodus'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Standard-Produkttyp'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '- Wählen Sie -'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Kategorie Details'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Kategorie Typ'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Wählen Sie eine Kategorie ...'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Lieferanten-Konfiguration'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Lieferant Detail'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Lieferant'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Lieferantenart'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Wählen Sie eine Lieferantenart ...'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Standard-Lieferantenart'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Zahlungskonfiguration'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Zahlungsdetails'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Zahlungs-Modul'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Zahlungsart'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Herr'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Frau'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Fianet Bestätigung'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Detailansicht'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Eval'; diff --git a/modules/fianetfraud/es.php b/modules/fianetfraud/es.php new file mode 100644 index 000000000..d1cc7540a --- /dev/null +++ b/modules/fianetfraud/es.php @@ -0,0 +1,36 @@ +fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Código transportista no válido'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados con éxito'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Para conectarse, visita:'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Web de FIA-net'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Usuario'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sitio Web'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Modo producción'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Tipo por defecto'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '--Elija--'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Detalle'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Tipo'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Elegir la categoría'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configurar el transportista'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Detalle'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Transportista'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo de transportista'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Elegir tipo de transportista'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Tipo de transportista por defecto'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Confuguración del pago'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Detalle del pago'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Módulo de pago'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo de pago'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Sr.'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Sra.'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Validación Fia-Net'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Ver detalle'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Evaluación'; diff --git a/modules/fianetfraud/fianet/classes/fianet_key_32bits.php b/modules/fianetfraud/fianet/classes/fianet_key_32bits.php new file mode 100644 index 000000000..9ea7935aa --- /dev/null +++ b/modules/fianetfraud/fianet/classes/fianet_key_32bits.php @@ -0,0 +1,274 @@ +a = -279229019; + $this->b = -1875190530; + $this->c = 1737040641; + $this->d = 315143286; + + $this->Save_a = $this->a; + $this->Save_b = $this->b; + $this->Save_c = $this->c; + $this->Save_d = $this->d; + } + + function FlushKey($k0, $k1, $k2, $k3) { + $this->a = $k0; + $this->b = $k1; + $this->c = $k2; + $this->d = $k3; + + $this->Save_a = $this->a; + $this->Save_b = $this->b; + $this->Save_c = $this->c; + $this->Save_d = $this->d; + } + + function Init() { + $this->a = $this->Save_a; + $this->b = $this->Save_b; + $this->c = $this->Save_c; + $this->d = $this->Save_d; + } + + function rhex($num) { + $hex_chr = "0123456789abcdef"; + $str = ""; + for($j = 0; $j <= 3; $j++) + $str .= substr($hex_chr, ($num >> ($j * 8 + 4)) & 0x0F, 1) . substr($hex_chr, ($num >> ($j * 8)) & 0x0F, 1); + return $str; + } + + function str2blks_MD5($str) { + $nblk = ((strlen($str) + 8) >> 6) + 1; + for($i = 0; $i < $nblk * 16; $i++) $blks[$i] = 0; + for($i = 0; $i < strlen($str); $i++) + $blks[$i >> 2] |= ord(substr($str, $i, 1)) << (($i % 4) * 8); + $blks[$i >> 2] |= 0x80 << (($i % 4) * 8); + $blks[$nblk * 16 - 2] = strlen($str) * 8; + return $blks; + } + + function add($x, $y) { + $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); + $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); + return ($msw << 16) | ($lsw & 0xFFFF); + } + + function rol($num, $cnt) { + return ($num << $cnt) | $this->zeroFill($num, 32 - $cnt); + } + + function zeroFill($a, $b) { + $bin = decbin($a); + if (strlen($bin) < $b) $bin = 0; + else $bin = substr($bin, 0, strlen($bin) - $b); + for ($i=0; $i < $b; $i++) { + $bin = "0".$bin; + } + return bindec($bin); + } + + function cmn($q, $a, $b, $x, $s, $t) { + return $this->add($this->rol($this->add($this->add($a, $q), $this->add($x, $t)), $s), $b); + } + + function ff($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn(($b & $c) | ((~$b) & $d), $a, $b, $x, $s, $t); + } + + function gg($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn(($b & $d) | ($c & (~$d)), $a, $b, $x, $s, $t); + } + + function hh($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn($b ^ $c ^ $d, $a, $b, $x, $s, $t); + } + + function ii($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn($c ^ ($b | (~$d)), $a, $b, $x, $s, $t); + } + + function hash($str) { + $x = $this->str2blks_MD5($str); + + $this->Init(); + + for($i = 0; $i < sizeof($x); $i += 16) { + $olda = $this->a; + $oldb = $this->b; + $oldc = $this->c; + $oldd = $this->d; + + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 7 , -680876936); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 1], 12, -389564586); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 17, 606105819); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 3], 22, -1044525330); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 7 , -176418897); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 5], 12, 1200080426); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 17, -1473231341); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 7], 22, -45705983); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 7 , 1770035416); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 9], 12, -1958414417); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+10], 17, -42063); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+11], 22, -1990404162); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+12], 7 , 1804603682); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+13], 12, -40341101); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+14], 17, -1502002290); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+15], 22, 1236535329); + + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 5 , -165796510); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 6], 9 , -1069501632); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+11], 14, 643717713); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 0], 20, -373897302); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 5 , -701558691); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+10], 9 , 38016083); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+15], 14, -660478335); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 4], 20, -405537848); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 5 , 568446438); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+14], 9 , -1019803690); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 14, -187363961); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 8], 20, 1163531501); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+13], 5 , -1444681467); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 2], 9 , -51403784); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 14, 1735328473); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+12], 20, -1926607734); + + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 4 , -378558); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 8], 11, -2022574463); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+11], 16, 1839030562); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+14], 23, -35309556); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 4 , -1530992060); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 4], 11, 1272893353); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 16, -155497632); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+10], 23, -1094730640); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+13], 4 , 681279174); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 0], 11, -358537222); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 16, -722521979); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 6], 23, 76029189); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 4 , -640364487); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+12], 11, -421815835); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+15], 16, 530742520); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 2], 23, -995338651); + + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 6 , -198630844); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 7], 10, 1126891415); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+14], 15, -1416354905); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 5], 21, -57434055); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+12], 6 , 1700485571); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 3], 10, -1894986606); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+10], 15, -1051523); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 1], 21, -2054922799); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 6 , 1873313359); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+15], 10, -30611744); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 15, -1560198380); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+13], 21, 1309151649); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 6 , -145523070); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+11], 10, -1120210379); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 15, 718787259); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 9], 21, -343485551); + + $this->a = $this->add($this->a, $olda); + $this->b = $this->add($this->b, $oldb); + $this->c = $this->add($this->c, $oldc); + $this->d = $this->add($this->d, $oldd); + } + return $this->rhex($this->a) . $this->rhex($this->b) . $this->rhex($this->c) . $this->rhex($this->d); + } +} +Class EncodingKey { + var $clMD5; + + function EncodingKey() { + $this->clMD5 = new HashMD5(); + } + + function giveHashCode($pkey, $second, $email, $refid, $montant, $nom) { + + $modulo = $second % 4; + + switch($modulo) { + case 0: + $select = $montant; + break; + case 1: + $select = $email; + break; + case 2: + $select = $refid; + break; + case 3: + $select = $nom; + break; + default: + break; + } + + return $this->clMD5->hash($pkey.$refid.$select); + + } + + function giveHashCode2($pkey, $second, $email, $refid, $montant, $nom) { + $modulo = $second % 4; + +$montant = sprintf("%01.2f",$montant); + + switch($modulo) { + case 0: + $select = $montant; + break; + case 1: + $select = $email; + break; + case 2: + $select = $refid; + break; + case 3: + $select = $nom; + break; + default: + break; + } +/* + $fp = fopen('/var/www/fianet/test_greg.txt','ab'); + fwrite($fp,"second=".$second."\n"); + fwrite($fp,"montant=".$montant."\n"); + fwrite($fp,"email=".$email."\n"); + fwrite($fp,"refid=".$refid."\n"); + fwrite($fp,"nom=".$nom."\n"); + fclose($fp); +*/ + + return $this->clMD5->hash($pkey.$refid.$montant.$email.$select); + + } +} diff --git a/modules/fianetfraud/fianet/classes/fianet_key_64bits.php b/modules/fianetfraud/fianet/classes/fianet_key_64bits.php new file mode 100644 index 000000000..49021d6ba --- /dev/null +++ b/modules/fianetfraud/fianet/classes/fianet_key_64bits.php @@ -0,0 +1,279 @@ +a = -279229019; + $this->b = -1875190530; + $this->c = 1737040641; + $this->d = 315143286; + + $this->Save_a = $this->a; + $this->Save_b = $this->b; + $this->Save_c = $this->c; + $this->Save_d = $this->d; + } + + function FlushKey($k0, $k1, $k2, $k3) { + $this->a = $k0; + $this->b = $k1; + $this->c = $k2; + $this->d = $k3; + + $this->Save_a = $this->a; + $this->Save_b = $this->b; + $this->Save_c = $this->c; + $this->Save_d = $this->d; + } + + function Init() { + $this->a = $this->Save_a; + $this->b = $this->Save_b; + $this->c = $this->Save_c; + $this->d = $this->Save_d; + } + + function rhex($num) { + $hex_chr = "0123456789abcdef"; + $str = ""; + for($j = 0; $j <= 3; $j++) + $str .= substr($hex_chr, ($num >> ($j * 8 + 4)) & 0x0F, 1) . substr($hex_chr, ($num >> ($j * 8)) & 0x0F, 1); + return $str; + } + + function str2blks_MD5($str) { + $nblk = ((strlen($str) + 8) >> 6) + 1; + for($i = 0; $i < $nblk * 16; $i++) $blks[$i] = 0; + for($i = 0; $i < strlen($str); $i++) + $blks[$i >> 2] |= ord(substr($str, $i, 1)) << (($i % 4) * 8); + $blks[$i >> 2] |= 0x80 << (($i % 4) * 8); + $blks[$nblk * 16 - 2] = strlen($str) * 8; + return $blks; + } + + function parse_unsigned_int($s) { + $x = (float)$s; + if($x > (float)2147483647) + $x -= (float)"4294967296"; + if($x < (float)-2147483648) + $x += (float)"4294967296"; + return (int)$x; + } + + function add($x, $y) { + $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); + $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); + return $this->parse_unsigned_int(($msw << 16) | ($lsw & 0xFFFF)); + } + + function rol($num, $cnt) { + $num = $num & 0xFFFFFFFF; + return $this->parse_unsigned_int(($num << $cnt) & 0xFFFFFFFF | $this->zeroFill($num, 32 - $cnt)); + } + + function zeroFill($a, $b) { + $bin = decbin($a); + if (strlen($bin) < $b) $bin = 0; + else $bin = substr($bin, 0, strlen($bin) - $b); + for ($i=0; $i < $b; $i++) { + $bin = "0".$bin; + } + return bindec($bin); + } + + function cmn($q, $a, $b, $x, $s, $t) { + return $this->add($this->rol($this->add($this->add($a, $q), $this->add($x, $t)), $s), $b); + } + + function ff($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn(($b & $c) | ((~$b) & $d), $a, $b, $x, $s, $t); + } + + function gg($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn(($b & $d) | ($c & (~$d)), $a, $b, $x, $s, $t); + } + + function hh($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn($b ^ $c ^ $d, $a, $b, $x, $s, $t); + } + + function ii($a, $b, $c, $d, $x, $s, $t) { + return $this->cmn($c ^ ($b | (~$d)), $a, $b, $x, $s, $t); + } + + function hash($str) { + + $x = $this->str2blks_MD5($str); + $this->Init(); + + for($i = 0; $i < sizeof($x); $i += 16) { + $olda = $this->a; + $oldb = $this->b; + $oldc = $this->c; + $oldd = $this->d; + + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 7 , -680876936); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 1], 12, -389564586); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 17, 606105819); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 3], 22, -1044525330); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 7 , -176418897); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 5], 12, 1200080426); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 17, -1473231341); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+ 7], 22, -45705983); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 7 , 1770035416); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+ 9], 12, -1958414417); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+10], 17, -42063); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+11], 22, -1990404162); + $this->a = $this->ff($this->a, $this->b, $this->c, $this->d, $x[$i+12], 7 , 1804603682); + $this->d = $this->ff($this->d, $this->a, $this->b, $this->c, $x[$i+13], 12, -40341101); + $this->c = $this->ff($this->c, $this->d, $this->a, $this->b, $x[$i+14], 17, -1502002290); + $this->b = $this->ff($this->b, $this->c, $this->d, $this->a, $x[$i+15], 22, 1236535329); + + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 5 , -165796510); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 6], 9 , -1069501632); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+11], 14, 643717713); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 0], 20, -373897302); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 5 , -701558691); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+10], 9 , 38016083); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+15], 14, -660478335); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 4], 20, -405537848); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 5 , 568446438); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+14], 9 , -1019803690); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 14, -187363961); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+ 8], 20, 1163531501); + $this->a = $this->gg($this->a, $this->b, $this->c, $this->d, $x[$i+13], 5 , -1444681467); + $this->d = $this->gg($this->d, $this->a, $this->b, $this->c, $x[$i+ 2], 9 , -51403784); + $this->c = $this->gg($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 14, 1735328473); + $this->b = $this->gg($this->b, $this->c, $this->d, $this->a, $x[$i+12], 20, -1926607734); + + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 5], 4 , -378558); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 8], 11, -2022574463); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+11], 16, 1839030562); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+14], 23, -35309556); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 1], 4 , -1530992060); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 4], 11, 1272893353); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 7], 16, -155497632); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+10], 23, -1094730640); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+13], 4 , 681279174); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+ 0], 11, -358537222); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+ 3], 16, -722521979); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 6], 23, 76029189); + $this->a = $this->hh($this->a, $this->b, $this->c, $this->d, $x[$i+ 9], 4 , -640364487); + $this->d = $this->hh($this->d, $this->a, $this->b, $this->c, $x[$i+12], 11, -421815835); + $this->c = $this->hh($this->c, $this->d, $this->a, $this->b, $x[$i+15], 16, 530742520); + $this->b = $this->hh($this->b, $this->c, $this->d, $this->a, $x[$i+ 2], 23, -995338651); + + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 0], 6 , -198630844); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 7], 10, 1126891415); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+14], 15, -1416354905); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 5], 21, -57434055); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+12], 6 , 1700485571); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+ 3], 10, -1894986606); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+10], 15, -1051523); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 1], 21, -2054922799); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 8], 6 , 1873313359); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+15], 10, -30611744); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 6], 15, -1560198380); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+13], 21, 1309151649); + $this->a = $this->ii($this->a, $this->b, $this->c, $this->d, $x[$i+ 4], 6 , -145523070); + $this->d = $this->ii($this->d, $this->a, $this->b, $this->c, $x[$i+11], 10, -1120210379); + $this->c = $this->ii($this->c, $this->d, $this->a, $this->b, $x[$i+ 2], 15, 718787259); + $this->b = $this->ii($this->b, $this->c, $this->d, $this->a, $x[$i+ 9], 21, -343485551); + + $this->a = $this->add($this->a, $olda); + $this->b = $this->add($this->b, $oldb); + $this->c = $this->add($this->c, $oldc); + $this->d = $this->add($this->d, $oldd); + } + + return $this->rhex($this->a) . $this->rhex($this->b) . $this->rhex($this->c) . $this->rhex($this->d); + } +} + +Class EncodingKey { + var $clMD5; + + function EncodingKey() { + $this->clMD5 = new HashMD5(); + } + + function giveHashCode($pkey, $second, $email, $refid, $montant, $nom) { + + $modulo = $second % 4; + + switch($modulo) { + case 0: + $select = $montant; + break; + case 1: + $select = $email; + break; + case 2: + $select = $refid; + break; + case 3: + $select = $nom; + break; + default: + break; + } + + return $this->clMD5->hash($pkey.$refid.$select); + } + + function giveHashCode2($pkey, $second, $email, $refid, $montant, $nom) { + $modulo = $second % 4; + + switch($modulo) { + case 0: + $select = $montant; + break; + case 1: + $select = $email; + break; + case 2: + $select = $refid; + break; + case 3: + $select = $nom; + break; + default: + break; + } + //echo "String PHP : ".$pkey.$refid.$montant.$email.$select."
        "; + + return $this->clMD5->hash($pkey.$refid.$montant.$email.$select); + + } +} +?> diff --git a/modules/fianetfraud/fianet/classes/fianet_sender.php b/modules/fianetfraud/fianet/classes/fianet_sender.php new file mode 100644 index 000000000..a7f4575e7 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/fianet_sender.php @@ -0,0 +1,473 @@ +orders[] = $order; + } + } + else + { + foreach ($order as $o) + { + if (var_is_object_of_class($o, 'fianet_order_xml')) + { + $this->orders[] = $o; + } + } + } + } + + //Envoie toutes les commandes une par une + function send_orders_singet() + { + if (!count($this->orders) > 0) + { + fianet_insert_log("fianet_sender.php - send_orders_singet()
        \nNo order to send."); + return; + } + if (!$this->check_order_data()) + { + fianet_insert_log("fianet_sender.php - send_orders_singet()
        \nOrders list is not valid."); + return; + } + + foreach ($this->orders as $order) + { + $xml = '' . "\n"; + $xml .= $order->get_xml(); + $data['siteid'] = $order->info_commande->siteid; + $data['controlcallback'] = clean_xml($xml); + $this->send_fsock_singet($data); + } + } + + //Envoie les commandes par lot de 25 + function send_orders_stacking() + { + if (!count($this->orders) > 0) + { + fianet_insert_log("fianet_sender.php - send_orders_stackfast()
        \nNo order to send."); + return; + } + if (!$this->check_order_data()) + { + fianet_insert_log("fianet_sender.php - send_orders_stackfast()
        \nOrders list is not valid."); + return; + } + $stack = array(); + $count = 0; + $results = array(); + foreach ($this->orders as $order) + { + if ($count < 25) + { + $count++; + $stack[] = $order; + } + elseif ($count == 25) + { + + $results = array_merge($results, $this->process_stack($stack)); + $stack = array(); + $stack[] = $order; + $count = 1; + } + } + $results = array_merge($results, $this->process_stack($stack)); + return ($results); + } + + //Recupre une liste d'valuations + function get_evaluation($order_list, $Separ = ',') + { + $evaluations = array(); + if (count($order_list) > 0) + { + $order_list_by_stack = array_chunk($order_list, 50, true); + foreach ($order_list_by_stack as $stack) + { + $evaluations = array_merge($this->get_evaluation_by_stack($stack, $Separ), $evaluations); + } + } + return ($evaluations); + } + + + function get_evaluation_by_stack($order_list, $Separ = ',') + { + if (count($order_list) > 0) + { + if ($this->mode == 'production') + { + $url = URL_SAC_PROD; + } + else + { + $url = URL_SAC_TEST; + } + $siteid = FIANET_SAC_SITE_ID; + $pwd = FIANET_SAC_PWD; + $mode = 'mini'; + $repFT = '0'; + $listID = ''; + foreach ($order_list as $id_order) + { + if ($listID != '') + { + $listID .= $Separ . $id_order; + } + else + { + $listID .= $id_order; + } + } + $data['SiteID'] = $siteid; + $data['Pwd'] = $pwd; + $data['Mode'] = $mode; + $data['RepFT'] = $repFT; + $data['ListID'] = $listID; + $data['Separ'] = $Separ; + + $s = new fianet_socket($url, URl_SAC_GETVALIDSTACK, 'POST', $data); + $result = $s->send(); + $evaluations = array(); + if ($result === false) + { + fianet_insert_log("fianet_sender.php - get_evaluation()
        \nError when opening file :
        \n".$url); + } + else + { + $xmldata = $result['data']; + $xml_array = xml2array($xmldata); + //debug($xml_array); + $evaluations = $this->process_result($xml_array); + return ($evaluations); + } + return ($evaluations); + } + } + + /* + mthodes prives + */ + + function process_result($xml_array) + { + $evaluations = array(); + //debug($xml_array, 'xml_array'); + if (isset($xml_array['stack']['result'])) + { + if (isset($xml_array['stack']['result'][0])) + { + foreach ($xml_array['stack']['result'] as $res) + { + if (eregi("error", $res['attr']['retour'])) + { + fianet_insert_log("fianet_sender.php - process_result()
        \nErreur :
        \n".$res['attr']['message']); + } + else + { + //$index = count($evaluations); + //$evaluations[$index] = $this->process_result_array($res); + $eval = $this->process_result_array($res); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + } + } + else + { + $res = $xml_array['stack']['result']; + if (eregi("error", $res['attr']['retour'])) + { + fianet_insert_log("fianet_sender.php - process_result()
        \nErreur :
        \n".$res['attr']['message']); + } + else + { + //$index = count($evaluations); + $eval = $this->process_result_array($res); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + } + } + else if (isset($xml_array['result']['transaction'])) + { + if (isset($xml_array['result']['transaction'][0])) + { + foreach ($xml_array['result']['transaction'] as $transaction) + { + $eval = $this->process_transaction_array($transaction); + //debug($eval); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + } + else + { + $transaction = $xml_array['result']['transaction']; + $eval = $this->process_transaction_array($transaction); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + } + + return ($evaluations); + } + + function process_result_array($res) + { + //debug($res, 'Result'); + $eval['refid'] = $res['attr']['refid']; + if ( $res['attr']['retour'] == 'absente') + { + $eval['info'] = 'absente'; + } + else + { + if (isset($res['transaction'][0])) + { + $transaction = end($res['transaction']); + } + else + { + $transaction = $res['transaction']; + } + $etat = $this->process_transaction_array($transaction); + $eval['eval'] = $etat['eval']; + $eval['info'] = $etat['info']; + $eval['cid'] = $etat['cid']; + } + return ($eval); + } + + function process_transaction_array($transaction) + { + $eval = array(); + //debug($transaction); + + if ($transaction['attr']['avancement'] == 'error') + { + $eval['eval'] = 'error'; + $eval['info'] = $transaction['detail']['value']; + $eval['cid'] = ''; + $eval['refid'] = $transaction['attr']['refid']; + } + elseif ($transaction['attr']['avancement'] == 'encours') + { + $eval['eval'] = 'encours'; + $eval['info'] = $transaction['detail']['value']; + $eval['cid'] = ''; + $eval['refid'] = $transaction['attr']['refid']; + } + elseif ($transaction['attr']['avancement'] == 'traitee') + { + $eval['eval'] = $transaction['analyse']['eval']['value']; + $eval['info'] = $transaction['analyse']['eval']['attr']['info']; + $eval['cid'] = $transaction['attr']['cid']; + $eval['refid'] = $transaction['attr']['refid']; + } + + return ($eval); + } + + function process_stack($stack) + { + $xml = '' . "\n"; + $xml .= '' . "\n"; + foreach ($stack as $order) + { + $xml .= $order->get_xml(); + if (!isset($siteid)) + { + $siteid = $order->info_commande->siteid; + } + } + $xml .= ''; + $data['siteid'] = $siteid; + $data['controlcallback'] = clean_xml($xml); + $result = array(); + $result = $this->send_fsock_stacking($data); + return ($result); + } + + function process_result_stacking($xml_data) + { + $result = array(); + $xml_array = xml2array($xml_data); + //debug($xml_array); + if (isset($xml_array['validstack']['unluck'])) + { + fianet_insert_log("fianet_sender.php - process_result_stacking()
        \nError :
        \n".$xml_array['validstack']['unluck']['value']); + return ($result); + } + elseif (isset($xml_array['validstack']['result'])) + { + $xml_array = $xml_array['validstack']['result']; + //debug($xml_array); + if (isset($xml_array[0])) + { + foreach ($xml_array as $transaction_result) + { + $index = count($result); + $result[$index]['refid'] = $transaction_result['attr']['refid']; + $result[$index]['etat'] = $transaction_result['attr']['avancement']; + $result[$index]['details'] = $transaction_result['detail']['value']; + } + } + else + { + $index = count($result); + $result[$index]['refid'] = $xml_array['attr']['refid']; + $result[$index]['etat'] = $xml_array['attr']['avancement']; + $result[$index]['details'] = $xml_array['detail']['value']; + } + } + return ($result); + } + + function check_order_data() + { + $res = true; + foreach ($this->orders as $order) + { + if (!var_is_object_of_class($order, 'fianet_order_xml')) + { + $res = false; + } + } + return ($res); + } + + function send_fsock_singet($data) + { + if ($this->mode == 'production') + { + $url_action = URL_SAC_PROD; + } + else + { + $url_action = URL_SAC_TEST; + } + $path = URl_SAC_SINGET; + + $s = new fianet_socket($url_action, $path, 'GET', $data); + $res = $s->send(); + if ($res === false) + { + fianet_insert_log("fianet_sender.php - send_fsock_post()
        \nError when connecting :
        \n".$url_action . $path); + return (false); + } + return (true); + } + + function send_fsock_stacking($data) + { + if ($this->mode == 'production') + { + $url_action = URL_SAC_PROD; + } + else + { + $url_action = URL_SAC_TEST; + } + $path = URl_SAC_STACKING; + + $s = new fianet_socket($url_action, $path, 'POST', $data); + $res = $s->send(); + if ($res === false) + { + fianet_insert_log("fianet_sender.php - send_fsock_post()
        \nError when connecting :
        \n".$url_action . $path); + return (false); + } + else + { + $result = $this->process_result_stacking($res['data']); + return ($result); + } + } + + function get_reevaluated_order() + { + if ($this->mode == 'production') + { + $url_action = URL_SAC_PROD; + } + else + { + $url_action = URL_SAC_TEST; + } + $path = URl_SAC_GETALERT; + $mode = 'new'; + $output = 'mini'; + $repFT = '0'; + + $data['SiteID'] = FIANET_SAC_SITE_ID; + $data['Pwd'] = FIANET_SAC_PWD; + $data['Mode'] = $mode; + $data['Output'] = $output; + $data['RepFT'] = $repFT; + + $s = new fianet_socket($url_action, $path, "POST", $data); + $res = $s->send(); + $evaluations = array(); + if ($res === false) + { + fianet_insert_log("fianet_sender.php - get_reevaluated_order()
        \nError when opening file :
        \n".$url); + } + else + { + $xmldata = $res['data']; + //Le code comment suivant permet de tester la rception d'une revaluation + /*$xmldata = ' + + + Paiement valid + + 100 + Transactions traiter/Nouvelles/Contrle visuel + + + + Paiement valid + + 100 + Transactions traiter/Nouvelles/Contrle visuel + + + ';*/ + $xml_array = xml2array($xmldata); + if (isset($xml_array['result']['attr']['retour'])) + { + if ($xml_array['result']['attr']['retour'] == "param_error") + { + fianet_insert_log("fianet_sender.php - get_reevaluated_order()
        \nParam_error :
        \n".$xml_array['result']['attr']['message']."\n
        $url_action"); + } + } + $evaluations = $this->process_result($xml_array); + } + return ($evaluations); + } +} + diff --git a/modules/fianetfraud/fianet/classes/fianet_sender.private.inc.php b/modules/fianetfraud/fianet/classes/fianet_sender.private.inc.php new file mode 100644 index 000000000..7faceca59 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/fianet_sender.private.inc.php @@ -0,0 +1,235 @@ +\nErreur :
        \n".$res['attr']['message']); + } + else + { + $index = count($evaluations); + $evaluations[$index] = $this->process_result_array($res); + } + } + } + else + { + $res = $xml_array['stack']['result']; + if (eregi("error", $res['attr']['retour'])) + { + fianet_insert_log("fianet_sender.php - process_result()
        \nErreur :
        \n".$res['attr']['message']); + } + else + { + $index = count($evaluations); + $evaluations[$index] = $this->process_result_array($res); + } + } + return ($evaluations); +} + +function process_result_array($res) +{ + //debug($res, 'Result'); + $eval['refid'] = $res['attr']['refid']; + if ( $res['attr']['retour'] == 'absente') + { + $eval['info'] = 'absente'; + } + else + { + if (isset($res['transaction'][0])) + { + $transaction = end($res['transaction']); + } + else + { + $transaction = $res['transaction']; + } + $etat = $this->process_transaction_array($transaction); + $eval['eval'] = $etat['eval']; + $eval['info'] = $etat['info']; + $eval['cid'] = $etat['cid']; + } + return ($eval); +} + +function process_transaction_array($transaction) +{ + $eval = array(); + //debug($transaction); + + if ($transaction['attr']['avancement'] == 'error') + { + $eval['refid'] = $transaction['attr']['refid']; + $eval['eval'] = 'error'; + $eval['info'] = $transaction['detail']['value']; + $eval['cid'] = ''; + } + elseif ($transaction['attr']['avancement'] == 'encours') + { + $eval['refid'] = $transaction['attr']['refid']; + $eval['eval'] = 'encours'; + $eval['info'] = $transaction['detail']['value']; + $eval['cid'] = ''; + } + elseif ($transaction['attr']['avancement'] == 'traitee') + { + $eval['refid'] = $transaction['attr']['refid']; + $eval['eval'] = $transaction['analyse']['eval']['value']; + $eval['info'] = $transaction['analyse']['eval']['attr']['info']; + $eval['cid'] = $transaction['attr']['cid']; + } + + return ($eval); +} + +function process_stack($stack) +{ + $xml = '' . "\n"; + $xml .= '' . "\n"; + foreach ($stack as $order) + { + $xml .= $order->get_xml(); + if (!isset($siteid)) + { + $siteid = $order->info_commande->siteid; + } + } + $xml .= ''; + $data['siteid'] = $siteid; + $data['controlcallback'] = clean_xml($xml); + $this->send_fsock_stacking($data); +} + +function process_result_stacking($xml_data) +{ + $result = array(); + $xml_array = xml2array($xml_data); + //debug($xml_array); + if (isset($xml_array['validstack']['unluck'])) + { + fianet_insert_log("fianet_sender.php - process_result_stacking()
        \nError :
        \n".$xml_array['validstack']['unluck']['value']); + return ($result); + } + elseif (isset($xml_array['validstack']['result'])) + { + $xml_array = $xml_array['validstack']['result']; + //debug($xml_array); + if (isset($xml_array[0])) + { + foreach ($xml_array as $transaction_result) + { + $index = count($result); + $result[$index]['refid'] = $transaction_result['attr']['refid']; + $result[$index]['etat'] = $transaction_result['attr']['avancement']; + $result[$index]['details'] = $transaction_result['detail']['value']; + } + } + else + { + $index = count($result); + $result[$index]['refid'] = $xml_array['attr']['refid']; + $result[$index]['etat'] = $xml_array['attr']['avancement']; + $result[$index]['details'] = $xml_array['detail']['value']; + } + } + return ($result); +} + +function check_order_data() +{ + $res = true; + foreach ($this->orders as $order) + { + if (!var_is_object_of_class($order, 'fianet_order_xml')) + { + $res = false; + } + } + return ($res); +} + +function send_fsock_singet($data) +{ + if ($mode == 'production') + { + $url_action = URL_SAC_PROD; + } + else + { + $url_action = URL_SAC_TEST; + } + $path = URl_SAC_SINGET; + + $s = new fianet_socket($url_action, $path, 'GET', $data); + $res = $s->send(); + if ($res === false) + { + fianet_insert_log("fianet_sender.php - send_fsock_post()
        \nError when connecting :
        \n".$url_action . $path); + return (false); + } + return (true); +} + +function send_fsock_stacking($data) +{ + if ($this->mode == 'production') + { + $url_action = URL_SAC_PROD; + } + else + { + $url_action = URL_SAC_TEST; + } + $path = URl_SAC_STACKING; + + $s = new fianet_socket($url_action, $path, 'POST', $data); + $res = $s->send(); + if ($res === false) + { + fianet_insert_log("fianet_sender.php - send_fsock_post()
        \nError when connecting :
        \n".$url_action . $path); + return (false); + } + else + { + $result = $this->process_result_stacking($res['data']); + //debug($result); + return ($result); + } +} + +function process_result_nostack($xml_array) +{ + $evaluations = array(); + //debug($xml_array, 'xml_array'); + if (isset($xml_array['result']['transaction'][0])) + { + foreach ($xml_array['result']['transaction'] as $res) + { + $eval = $this->process_transaction_array($res); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + } + else + { + $res = $xml_array['result']['transaction']; + $eval = $this->process_transaction_array($res); + if ($eval['refid'] != null) + { + $evaluations[$eval['refid']] = $eval; + } + } + return ($evaluations); +} + diff --git a/modules/fianetfraud/fianet/classes/fianet_socket.php b/modules/fianetfraud/fianet/classes/fianet_socket.php new file mode 100644 index 000000000..6ae21f4de --- /dev/null +++ b/modules/fianetfraud/fianet/classes/fianet_socket.php @@ -0,0 +1,172 @@ +data = $data; + } + $this->parse_fianet_url($fianet_url, $fianet_file); + if (strtoupper($method) == 'GET' || strtoupper($method) == 'POST') + { + $this->method = strtoupper($method); + } + } + + function parse_fianet_url($fianet_url, $fianet_file) + { + if (ereg("^http://", $fianet_url)) + { + $this->is_ssl = false; + $this->host = eregi_replace("http://([^/]+)/.+", "\\1", $fianet_url); + $this->port = 80; + $this->path = eregi_replace("http://[^/]+/", "/", $fianet_url) . $fianet_file; + } + if (ereg("^https://", $fianet_url)) + { + $this->is_ssl = true; + $this->host = eregi_replace("https://([^/]+)/.+", "\\1", $fianet_url); + $this->port = 443; + $this->path = eregi_replace("https://[^/]+/", "/", $fianet_url) . $fianet_file; + } + //debug($this->path); + } + + function determine_boundary() + { + srand((double)microtime() * 1000000); + return ("---------------------".substr(md5(rand(0,32000)),0,10)); + } + + function build_header($boundary, $data) + { + if ($this->method == 'POST') + { + $header = "POST ".$this->path." HTTP/1.0\r\n"; + $header .= "Host: ".$this->host."\r\n"; + $header .= "Content-type: application/x-www-form-urlencoded; boundary=$boundary\r\n"; + $header .= "Content-length: " . strlen($data) . "\r\n\r\n"; + } + elseif ($this->method == 'GET') + { + if ($data != '') + { + if (strlen($this->path."?".$data) > 2048) + { + fianet_insert_log("fianet_socket.php - build_header()
        \nMaximum length in get method reached(".strlen($this->path."?".$data).") :
        \n".$this->path."?".$data); + } + $header = "GET ".$this->path."?".$data." HTTP/1.1\r\n"; + } + else + { + $header = "GET ".$this->path." HTTP/1.1\r\n"; + } + $header .= "Host: ".$this->host."\r\n"; + $header .= "Connection: close\r\n\r\n"; + } + return ($header); + } + + function build_data($boundary) + { + $data = ""; + foreach($this->data as $index => $value) + { + if ($data == '') + { + $data .= $index . '='. urlencode($value); + } + else + { + $data .= '&'.$index . '='. urlencode($value); + } + } + return ($data); + } + + function send() + { + $boundary = $this->determine_boundary(); + $data = $this->build_data($boundary); + $header = $this->build_header($boundary, $data); + + //debug($header, 'header'); + //debug(htmlentities($data), 'data'); + $response = $this->connect($header, $data); + if ($response != false) + { + $d['header'] = $response['header']; + $d['data'] = htmlentities($response['data']); + //debug($d, 'Rponse'); + } + + return ($response); + } + + function connect($header, $data) + { + $res['header'] = ""; + $res['data'] = ""; + if ($this->is_ssl) + { + $host = 'ssl://'.$this->host . ':'.$this->port; + $socket = fsockopen ('ssl://'.$this->host, $this->port); + } + else + { + $host = $this->host . ':' . $this->port; + $socket = fsockopen ($this->host, $this->port); + } + if ($socket !== false) + { + $data_reached = false; + if (@fputs($socket, $header.$data)) + { + while (!feof($socket)) + { + $line = fgets($socket); + if (!$data_reached) + { + if ($line == "\r\n") + { + $data_reached = true; + } + else + { + $res['header'] .= $line; + } + } + else + { + $res['data'] .= $line; + } + } + } + else + { + fianet_insert_log("fianet_socket.php - connect()
        \nEnvoie des donnes impossible sur :
        \n".$host); + $res = false; + } + fclose($socket); + } + else + { + fianet_insert_log("fianet_socket.php - connect()
        \nConnexion socket impossible :
        \n".$host); + $res = false; + } + return ($res); + } + } diff --git a/modules/fianetfraud/fianet/classes/order/fianet_adress_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_adress_xml.php new file mode 100644 index 000000000..345af58e9 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_adress_xml.php @@ -0,0 +1,76 @@ +type != null) + { + $xml .= "\t" . '' . "\n"; + if ($this->rue1 != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->rue1).'' . "\n"; + } + else + { + fianet_insert_log("fianet_adress_xml.php - get_xml()
        \n rue1 is undefined"); + return; + } + if ($this->rue2 != "") + { + $xml .= "\t\t" . ''.clean_invalid_char($this->rue2).'' . "\n"; + } + if ($this->cpostal != "") + { + $xml .= "\t\t" . ''.clean_invalid_char($this->cpostal).'' . "\n"; + } + else + { + fianet_insert_log("fianet_adress_xml.php - get_xml()
        \n cpostal is undefined"); + return; + } + if ($this->ville != "") + { + $xml .= "\t\t" . ''.clean_invalid_char($this->ville).'' . "\n"; + } + else + { + fianet_insert_log("fianet_adress_xml.php - get_xml()
        \n ville is undefined"); + return; + } + if ($this->pays != "") + { + $xml .= "\t\t" . ''.clean_invalid_char($this->pays).'' . "\n"; + } + else + { + fianet_insert_log("fianet_adress_xml.php - get_xml()
        \n pays is undefined"); + return; + } + if ($this->appartement != null) + { + if (var_is_object_of_class($this->appartement, 'fianet_appartment_xml')) + { + $xml .= $this->appartement->get_xml(); + } + else + { + fianet_insert_log("fianet_adress_xml.php - get_xml()
        \nAppartement is not an object of type fianet_appartment_xml"); + } + } + $xml .= "\t" . '
        ' . "\n"; + } + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_appartment_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_appartment_xml.php new file mode 100644 index 000000000..73e003ea6 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_appartment_xml.php @@ -0,0 +1,44 @@ +' . "\n"; + if ($this->digicode1 != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->digicode1).'' . "\n"; + } + if ($this->digicode2 != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->digicode2).'' . "\n"; + } + if ($this->escalier != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->escalier).'' . "\n"; + } + if ($this->etage != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->etage).'' . "\n"; + } + if ($this->nporte != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->nporte).'' . "\n"; + } + if ($this->batiment != '') + { + $xml .= "\t\t\t" . ''.clean_invalid_char($this->batiment).'' . "\n"; + } + $xml .= "\t\t" . '' . "\n"; + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_billing_adress_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_billing_adress_xml.php new file mode 100644 index 000000000..22fd7a062 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_billing_adress_xml.php @@ -0,0 +1,13 @@ +list = new fianet_product_list_xml(); + $this->transport = new fianet_transport_xml(); + $this->siteid = FIANET_SAC_SITE_ID; + } + + + function get_xml() + { + $xml = ''; + if (!($this->siteid != "" && $this->refid != "" && $this->montant > 0 && $this->devise != "")) + { + fianet_insert_log("fianet_info_order_xml.php - get_xml()
        Somes values are undefined\n"); + } + if ($this->transport == null) + { + fianet_insert_log("fianet_info_order_xml.php - get_xml()
        Transport is undefined\n"); + } + if ($this->list == null) + { + fianet_insert_log("fianet_info_order_xml.php - get_xml()
        List products is undefined\n"); + } + $xml .= "\t" . '' . "\n"; + $xml .= "\t\t" . ''.$this->siteid.'' . "\n"; + $xml .= "\t\t" . ''.$this->refid.'' . "\n"; + $xml .= "\t\t" . ''.number_format($this->montant, 2, '.', '').'' . "\n"; + if ($this->ip != null && $this->timestamp != null) + { + $xml .= "\t\t" . ''.$this->ip.'' . "\n"; + } + $xml .= $this->transport->get_xml(); + $xml .= $this->list->get_xml(); + $xml .= "\t" . '' . "\n"; + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_order_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_order_xml.php new file mode 100644 index 000000000..c6832c26a --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_order_xml.php @@ -0,0 +1,68 @@ +billing_user = new fianet_billing_user_xml(); + $this->billing_adress = new fianet_billing_adress_xml(); + $this->info_commande = new fianet_info_order_xml(); + $this->payment = new fianet_payment_xml(); + } + + function reset() + { + $this->billing_user = new fianet_billing_user_xml(); + $this->delivery_user = null; + $this->billing_adress = new fianet_billing_adress_xml(); + $this->delivery_adress = null; + $this->info_commande = new fianet_info_order_xml(); + $this->payment = new fianet_payment_xml(); + } + + function get_xml() + { + $xml = ''; + $xml .= '' . "\n"; + $xml .= $this->billing_user->get_xml(); + $xml .= $this->billing_adress->get_xml(); + if ($this->delivery_user != null) + { + if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml')) + { + $xml .= $this->delivery_user->get_xml(); + } + else + { + fianet_insert_log("fianet_order_xml.php - get_xml()
        \nDelivery user is not an object of type fianet_delivery_user_xml"); + } + } + if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5)) + { + if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml')) + { + $xml .= $this->delivery_adress->get_xml(); + } + else + { + fianet_insert_log("fianet_order_xml.php - get_xml()
        \nDelivery adress is not an object of type fianet_delivery_adress_xml"); + } + } + $xml .= $this->info_commande->get_xml(); + $xml .= $this->payment->get_xml(); + $xml .= '
        '; + + save_flux_xml($xml, $this->info_commande->refid); + return ($xml); + } + + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_paraobject_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_paraobject_xml.php new file mode 100644 index 000000000..4cc547e10 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_paraobject_xml.php @@ -0,0 +1,23 @@ +name = $name; + $this->value = $value; + } + + function get_xml() + { + $xml = "\t". '' . "\n"; + $xml .= "\t\t". ''.$this->name.'' . "\n"; + $xml .= "\t\t". ''.$this->value.'' . "\n"; + $xml .= "\t". '' . "\n"; + return ($xml); + } +} + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_payment_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_payment_xml.php new file mode 100644 index 000000000..73c4642cc --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_payment_xml.php @@ -0,0 +1,76 @@ +Cb number format is invalid, must be 00001111222233334444\n"); + } + else if (!eregi("^[0-9]{2}/[0-9]{4}$", $dateval)) + { + fianet_insert_log("fianet_payment_xml.php - set_cb_number()
        Validity date format is invalid, must be MM/YYYY\n"); + } + else + { + $crypt = new HashMD5(); + $this->numcb = $crypt->hash($cb); + $this->dateval = $crypt->hash($dateval); + } + } + + function get_xml() + { + $xml = ''; + if ($this->type != null) + { + $xml .= "\t".''."\n"; + + $xml .= "\t\t".''.$this->type.''."\n"; + if ($this->type == 'carte' || $this->type == 'paypal') + { + if ($this->numcb != null) + { + $xml .= "\t\t".''.$this->numcb.''."\n"; + } + if ($this->dateval != null) + { + $xml .= "\t\t".''.$this->dateval.''."\n"; + } + if ($this->bin != null) + { + $xml .= "\t\t".''.$this->bin.''."\n"; + } + if ($this->bin4 != null) + { + $xml .= "\t\t".''.$this->bin4.''."\n"; + } + if ($this->bin42 != null) + { + $xml .= "\t\t".''.$this->bin42.''."\n"; + } + } + $xml .= "\t".''."\n"; + } + else + { + fianet_insert_log("fianet_payment_xml.php - get_xml()
        Type is undefined\n"); + return; + } + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_product_list_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_product_list_xml.php new file mode 100644 index 000000000..014b14598 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_product_list_xml.php @@ -0,0 +1,49 @@ +products_list[] = $product; + } + else + { + fianet_insert_log("fianet_product_list_xml.php - add_product()
        Data are not a valid fianet_product_xml type\n"); + } + } + + function get_xml() + { + $xml = ''; + if (count($this->products_list) > 0) + { + + $xml .= "\t\t". '' . "\n"; + foreach ($this->products_list as $product) + { + $xml .= $product->get_xml(); + } + $xml .= "\t\t". '' . "\n"; + } + return ($xml); + } + + function count_nbproduct() + { + $n = 0; + foreach ($this->products_list as $product) + { + $n += $product->nb; + } + return ($n); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_product_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_product_xml.php new file mode 100644 index 000000000..5b42e7963 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_product_xml.php @@ -0,0 +1,59 @@ +name != null) + { + $nb = ''; + $prixunit = ''; + if ($this->type != null) + { + $type = ' type="'.$this->type.'"'; + } + else + { + fianet_insert_log("fianet_product_xml.php - get_xml()
        \nproduct type is missing"); + return; + } + if ($this->ref != null) + { + $ref = ' ref="'.clean_invalid_char($this->ref).'"'; + } + else + { + fianet_insert_log("fianet_product_xml.php - get_xml()
        \nproduct ref is missing"); + return; + } + if ($this->nb != null) + { + $nb = ' nb="'.$this->nb.'"'; + } + if ($this->prixunit != null) + { + $prixunit = ' prixunit="'.number_format($this->prixunit, 2, '.', '').'"'; + } + $xml .= "\t\t\t".clean_invalid_char($this->name)."\n"; + } + else + { + fianet_insert_log("fianet_product_xml.php - get_xml()
        \nproduct name is missing"); + return; + } + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_rnp_info_order_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_rnp_info_order_xml.php new file mode 100644 index 000000000..b46b4a54e --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_rnp_info_order_xml.php @@ -0,0 +1,36 @@ +list = new fianet_product_list_xml(); + $this->transport = new fianet_transport_xml(); + $this->siteid = FIANET_RNP_SITE_ID; + } + + function get_xml() + { + $xml = ''; + + if ($this->siteid == '' || $this->refid == '' || $this->montant <= 0 || $this->devise == '') + { + fianet_insert_log("fianet_rnp_info_order_xml.php - get_xml()
        Somes values are undefined\n"); + } + $xml .= "\t" . '' . "\n"; + $xml .= "\t\t" . ''.$this->siteid.'' . "\n"; + $xml .= "\t\t" . ''.$this->refid.'' . "\n"; + $xml .= "\t\t" . ''.number_format($this->montant, 2, '.', '').'' . "\n"; + $xml .= $this->transport->get_xml(); + $xml .= $this->list->get_xml(); + $xml .= "\t" . '' . "\n"; + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_rnp_order_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_rnp_order_xml.php new file mode 100644 index 000000000..fc212c3d2 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_rnp_order_xml.php @@ -0,0 +1,142 @@ +billing_user = new fianet_billing_user_xml(); + $this->billing_adress = new fianet_billing_adress_xml(); + $this->info_commande = new fianet_rnp_info_order_xml(); + $this->wallet = new fianet_rnp_wallet_xml(); + } + + function reset() + { + $this->billing_user = new fianet_billing_user_xml(); + $this->delivery_user = null; + $this->billing_adress = new fianet_billing_adress_xml(); + $this->delivery_adress = null; + $this->info_commande = new fianet_rnp_info_order_xml(); + $this->wallet = new fianet_rnp_wallet_xml(); + } + + function get_xml() + { + $xml = ''; + $xml .= '' . "\n"; + $xml .= '' . "\n"; + $xml .= $this->billing_user->get_xml(); + $xml .= $this->billing_adress->get_xml(); + if ($this->delivery_user != null) + { + if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml')) + { + $xml .= $this->delivery_user->get_xml(); + } + else + { + fianet_insert_log("fianet_rnp_order_xml.php - get_xml()
        \nDelivery user is not an object of type fianet_delivery_user_xml"); + } + } + if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5)) + { + if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml')) + { + $xml .= $this->delivery_adress->get_xml(); + } + else + { + fianet_insert_log("fianet_rnp_order_xml.php - get_xml()
        \nDelivery adress is not an object of type fianet_delivery_adress_xml"); + } + } + $xml .= $this->info_commande->get_xml(); + + $this->wallet->generate_wallet_crypt_data($this->info_commande->refid, $this->billing_user->nom, $this->billing_user->email, $this->info_commande->montant); + $xml .= $this->wallet->get_xml(); + + $xml .= '
        '; + + save_flux_xml($xml, $this->info_commande->refid); + return ($xml); + } + + /* + Cette fonction gnre le formulaire de redirection vers ReceiveAndPay + Elle prends des paramtres optionnels + url_call : url de retour sur le site marchand + url_sys : url de rponse des tags asynchrone pour le serveur ReceiveAndPay + ParamCallBack : tableau associatif des donnes que vous souhaitez voir retourner par le serveur ReceiveAndPay sur url_sys et url_call + typeIHM : 1 pour carte bancaire seulement, 2 pour crdit uniquement, 3 pour les deux en mme temps + enProd : mettre true pour rediriger vers ReceiveAndPay de production + auto_send : si true : gnre un javascript qui soumettra immdiatement le formulaire + */ + function get_formular($url_call = null, $url_sys = null, $ParamCallBack = array(), $typeIHM = 3, $enProd = false, $auto_send = true) + { + + $flux = $this->get_xml(); + $flux = clean_xml($flux); + $flux = str_replace('"', "'", $flux); + $flux = str_replace('&', '&amp;', $flux); + $flux = str_replace('<', '&lt;', $flux); + $flux = str_replace('>', '&gt;', $flux); + $my_hashmd5 = new HashMD5(); + //$toto = html_entity_decode($flux); + //debug($toto); + $checksum = $my_hashmd5->hash(html_entity_decode($flux)); + + if (is_array($ParamCallBack) && count($ParamCallBack) > 0) + { + $XMLParam = new fianet_xml_paracallback_builder(); + foreach ($ParamCallBack as $index => $value) + { + $XMLParam->add_param(new fianet_paraobject_xml($index, urlencode(htmlentities($value)))); + } + } + + if ($enProd) + { + $url = URL_RNP_PROD; + } + else + { + $url = URL_RNP_TEST; + } + $url .= URL_RNP_FRONTLINE; + + $form = ''; + $form .= '
        '; + $form .= '' . "\n"; + $form .= '' . "\n"; + if ($url_call != null && $url_call != '') + { + $form .= '' . "\n"; + } + if ($url_sys != null && $url_sys != '') + { + $form .= '' . "\n"; + } + if (isset($XMLParam)) + { + $form .= 'get_xml())).'">' . "\n"; + } + $form .= '' . "\n"; + $form .= '' . "\n"; + $form .= '
        '; + if ($auto_send) + { + $form .= ''; + } + + return ($form); + } + + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_rnp_wallet_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_rnp_wallet_xml.php new file mode 100644 index 000000000..851c50668 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_rnp_wallet_xml.php @@ -0,0 +1,60 @@ +datecom = "2008-05-28 14:25:31"; + $this->datecom = date("Y-m-d H:i:s"); + $this->order_date_time_seconds = substr($this->datecom, -2, 2); + } + + function generate_wallet_crypt_data($order_id, $billing_lastname, $customer_email, $total) + { + $total = number_format($total, 2, '.', ''); + $this->generate_crypt_key($order_id, $billing_lastname, $customer_email, $total); + } + + function get_xml() + { + $xml = ''; + + $xml .= "\t" . '' . "\n"; + $xml .= "\t\t" . ''.$this->datelivr.'' . "\n"; + $xml .= "\t\t" . ''.$this->datecom.'' . "\n"; + $xml .= "\t\t" . ''.$this->crypt.'' . "\n"; + $xml .= "\t" . '' . "\n"; + + return ($xml); + } + + function generate_crypt_key($order_id, $billing_lastname, $customer_email, $total) + { + if (FIANET_ENCODING == 'UTF-8') + { + $billing_lastname = utf8_decode($billing_lastname); + } + else + { + $billing_lastname = $billing_lastname; + } + $key = FIANET_RNP_KEY; + + $encodingKey = new EncodingKey(); + $this->crypt = $encodingKey->giveHashCode2( $key, + $this->order_date_time_seconds, + $customer_email, + $order_id, + $total, + $billing_lastname); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_transport_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_transport_xml.php new file mode 100644 index 000000000..7000f92a2 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_transport_xml.php @@ -0,0 +1,42 @@ +type == null) + { + fianet_insert_log("fianet_transport_xml.php - get_xml()
        \nTransport type undefined"); + return; + } + if ($this->nom == null) + { + fianet_insert_log("fianet_transport_xml.php - get_xml()
        \nTransport name undefined"); + return; + } + if ($this->rapidite == null) + { + fianet_insert_log("fianet_transport_xml.php - get_xml()
        \nTransport time undefined"); + return; + } + $xml .= "\t\t". '' . "\n"; + + $xml .= "\t\t\t". ''.$this->type.'' . "\n"; + $xml .= "\t\t\t". ''.clean_invalid_char($this->nom).'' . "\n"; + $xml .= "\t\t\t". ''.$this->rapidite.'' . "\n"; + + $xml .= "\t\t". '' . "\n"; + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_user_siteconso_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_user_siteconso_xml.php new file mode 100644 index 000000000..42aa48988 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_user_siteconso_xml.php @@ -0,0 +1,29 @@ +nb > 0) + { + $xml .= "\t\t" . '' . "\n"; + $xml .= "\t\t\t" . ''.$this->nb.'' . "\n"; + $xml .= "\t\t\t" . ''.number_format($this->ca, 2, '.', '').'' . "\n"; + $xml .= "\t\t\t" . ''.$this->datepremcmd.'' . "\n"; + $xml .= "\t\t\t" . ''.$this->datederncmd.'' . "\n"; + $xml .= "\t\t" . '' . "\n"; + } + return ($xml); + } + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_user_xml.php b/modules/fianetfraud/fianet/classes/order/fianet_user_xml.php new file mode 100644 index 000000000..35d98f702 --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_user_xml.php @@ -0,0 +1,80 @@ +qualite = 1; + } + + function set_quality_nonprofessional() + { + $this->qualite = 2; + } + + function get_xml() + { + $xml = ''; + $xml .= "\t" . '' . "\n"; + if ($this->titre != '') + { + if ($this->titre == 'f') + { + $this->titre = 'mme'; + } + $xml .= "\t\t" . ''.clean_invalid_char($this->nom).'' . "\n"; + } + else + { + $xml .= "\t\t" . ''.clean_invalid_char($this->nom).'' . "\n"; + } + $xml .= "\t\t" . ''.clean_invalid_char($this->prenom).'' . "\n"; + if ($this->societe != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->societe).'' . "\n"; + } + if ($this->telhome != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->telhome).'' . "\n"; + } + if ($this->teloffice != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->teloffice).'' . "\n"; + } + if ($this->telmobile != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->telmobile).'' . "\n"; + } + if ($this->telfax != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->telfax).'' . "\n"; + } + if ($this->email != '') + { + $xml .= "\t\t" . ''.clean_invalid_char($this->email).'' . "\n"; + } + if ($this->site_conso != null) + { + $xml .= $this->site_conso->get_xml(); + } + $xml .= "\t" . '' . "\n"; + + return ($xml); + } + + } + diff --git a/modules/fianetfraud/fianet/classes/order/fianet_xml_paracallback_builder.php b/modules/fianetfraud/fianet/classes/order/fianet_xml_paracallback_builder.php new file mode 100644 index 000000000..861dd400a --- /dev/null +++ b/modules/fianetfraud/fianet/classes/order/fianet_xml_paracallback_builder.php @@ -0,0 +1,44 @@ +param_list[] = $param; + } + else + { + fianet_insert_log("Erreur : le paramtre n'est pas un objet fianet_paraobject_xml mais un objet : ".get_class($param)."
        "); + } + } + + function get_xml() + { + $xml = ''; + + if (count($this->param_list) > 0) + { + $xml .= ' + ' . "\n"; + + foreach ($this->param_list as $param) + { + $xml .= $param->get_xml(); + } + + $xml .= '' . "\n"; + } + + return($xml); + } + } + diff --git a/modules/fianetfraud/fianet/const/fianet.php b/modules/fianetfraud/fianet/const/fianet.php new file mode 100644 index 000000000..e751370d5 --- /dev/null +++ b/modules/fianetfraud/fianet/const/fianet.php @@ -0,0 +1,4 @@ + $val) if($val === $new) $vname = $key; + $var = $old; + + echo "
        ";
        +	if($info != FALSE) echo "$info:
        "; + do_dump($var, '$'.$vname); + echo "
        "; +} + + +function do_dump(&$var, $var_name = NULL, $indent = NULL, $reference = NULL) +{ + $do_dump_indent = "|    "; + $reference = $reference.$var_name; + $keyvar = 'the_do_dump_recursion_protection_scheme'; $keyname = 'referenced_object_name'; + + if (is_array($var) && isset($var[$keyvar])) + { + $real_var = &$var[$keyvar]; + $real_name = &$var[$keyname]; + $type = ucfirst(gettype($real_var)); + echo "$indent$var_name $type = &$real_name
        "; + } + else + { + $var = array($keyvar => $var, $keyname => $reference); + $avar = &$var[$keyvar]; + + $type = ucfirst(gettype($avar)); + if($type == "String") $type_color = ""; + elseif($type == "Integer") $type_color = ""; + elseif($type == "Double"){ $type_color = ""; $type = "Float"; } + elseif($type == "Boolean") $type_color = ""; + elseif($type == "NULL") $type_color = ""; + + if(is_array($avar)) + { + $count = count($avar); + echo "$indent" . ($var_name ? "$var_name => ":"") . "$type ($count)
        $indent(
        "; + $keys = array_keys($avar); + foreach($keys as $name) + { + $value = &$avar[$name]; + do_dump($value, "['$name']", $indent.$do_dump_indent, $reference); + } + echo "$indent)
        "; + } + elseif(is_object($avar)) + { + echo "$indent$var_name $type
        $indent(
        "; + foreach($avar as $name=>$value) do_dump($value, "$name", $indent.$do_dump_indent, $reference); + echo "$indent)
        "; + } + elseif(is_int($avar)) echo "$indent$var_name = $type(".strlen($avar).") $type_color$avar

        "; + elseif(is_string($avar)) echo "$indent$var_name = $type(".strlen($avar).") $type_color\"$avar\"

        "; + elseif(is_float($avar)) echo "$indent$var_name = $type(".strlen($avar).") $type_color$avar

        "; + elseif(is_bool($avar)) echo "$indent$var_name = $type(".strlen($avar).") $type_color".($avar == 1 ? "TRUE":"FALSE")."

        "; + elseif(is_null($avar)) echo "$indent$var_name = $type(".strlen($avar).") {$type_color}NULL

        "; + else echo "$indent$var_name = $type(".strlen($avar).") $avar
        "; + + $var = $var[$keyvar]; + } +} + diff --git a/modules/fianetfraud/fianet/includes/general.php b/modules/fianetfraud/fianet/includes/general.php new file mode 100644 index 000000000..d4c5afc16 --- /dev/null +++ b/modules/fianetfraud/fianet/includes/general.php @@ -0,0 +1,71 @@ +", ">", $var); + $var = trim($var); + return ($var); +} + +function var_is_object_of_class($var, $class_name) +{ + $res = false; + if (is_object($var)) + { + $name = get_class($var); + if ($name == $class_name) + { + $res = true; + } + } + return ($res); +} + +//Calcule la date de livraison en jour ouvr partir de la date courante +function get_delivery_date($delivery_times) +{ + define('H', date("H")); + define('i', date("i")); + define('s', date("s")); + define('m', date("m")); + define('d', date("d")); + define('Y', date("Y")); + define('SUNDAY', 0); + define('SATURDAY', 6); + + $nb_days = 0; + $j = 0; + while ($nb_days < $delivery_times) + { + $j++; + $date = mktime(H, i, s, m, d + $j, Y); + $day = date("w", $date); + if ($day != SUNDAY && $day != SATURDAY) + { + $nb_days++; + } + } + if ($j > FIANET_MAX_DELIVERY_TIME) + {//si on dpasse le dlais de livraison max causes des samedi et dimanche on remet le dlais de livraison son maximum + $j = FIANET_MAX_DELIVERY_TIME; + } + $date = mktime(H, i, s, m, d + $j, Y); + return (date("Y-m-d", $date)); +} + diff --git a/modules/fianetfraud/fianet/includes/xml2array.php b/modules/fianetfraud/fianet/includes/xml2array.php new file mode 100644 index 000000000..99a784447 --- /dev/null +++ b/modules/fianetfraud/fianet/includes/xml2array.php @@ -0,0 +1,119 @@ + $val) + { + if($get_attributes == 1) $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' + /** :TODO: should we change the key name to '_attr'? Someone may use the tagname 'attr'. Same goes for 'value' too */ + } + } + } + elseif(isset($value)) + { + $result = $value; + } + + //See tag status and do the needed. + if($type == "open") + {//The starting of the tag '' + $parent[$level-1] = &$current; + if(!is_array($current) or (!in_array($tag, array_keys($current)))) + { //Insert New tag + $current[$tag] = $result; + $current = &$current[$tag]; + + } + else + { //There was another element with the same tag name + if(isset($current[$tag][0])) + { + array_push($current[$tag], $result); + } + else + { + $current[$tag] = array($current[$tag],$result); + } + $last = count($current[$tag]) - 1; + $current = &$current[$tag][$last]; + } + + } + elseif($type == "complete") + { //Tags that ends in 1 line '' + //See if the key is already taken. + if(!isset($current[$tag])) + { //New Key + $current[$tag] = $result; + //array_push($current[$tag],$result); + } + else + { //If taken, put all things inside a list(array) + if((is_array($current[$tag]) and $get_attributes == 0)//If it is already an array... + or (isset($current[$tag][0]) and is_array($current[$tag][0]) and $get_attributes == 1)) + { + array_push($current[$tag],$result); // ...push the new element into that array. + } + else + { //If it is not an array... + $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value + } + } + + } + elseif ($type == 'close') + { //End of tag '' + $current = &$parent[$level-1]; + } + } + return($xml_array); +} + + diff --git a/modules/fianetfraud/fianet/to_implement/implement.php b/modules/fianetfraud/fianet/to_implement/implement.php new file mode 100644 index 000000000..55c281c72 --- /dev/null +++ b/modules/fianetfraud/fianet/to_implement/implement.php @@ -0,0 +1,12 @@ +'; +} + +//Cette fonction est appele ds qu'une flux xml est gnr. Le premier paramtre est le flux lui-mme, le second paramtre est la rfrence de la commande +function save_flux_xml($xml, $ref_id) +{ +} + diff --git a/modules/fianetfraud/fianetfraud.php b/modules/fianetfraud/fianetfraud.php new file mode 100644 index 000000000..4c5b992ac --- /dev/null +++ b/modules/fianetfraud/fianetfraud.php @@ -0,0 +1,623 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if ((basename(__FILE__) == 'fianetfraud.php')) + require_once(dirname(__FILE__).'/fianet/fianet.php'); + +class Fianetfraud extends Module +{ + const INSTALL_SQL_FILE = 'install.sql'; + + private $_html; + private $_product_type = array( + '1' => 'Alimentation & gastronomie', + '2' => 'Auto & moto', + '3' => 'Culture & divertissements', + '4' => 'Maison & jardin', + '5' => 'Electromenager', + '6' => 'Enchers et achats groupés', + '7' => 'Fleurs & cadeaux', + '8' => 'Informatique & logiciels', + '9' => 'Santé & beauté', + '10' => 'Services aux particuliers', + '11' => 'Services aux professionnels', + '12' => 'Sport', + '13' => 'Vetements & accessoires', + '14' => 'Voyage & tourisme', + '15' => 'Hifi, photo & videos', + '16' => 'Telephonie & communication', + '17' => 'Bijoux & Métaux précieux', + '18' => 'Articles et Accessoires pour bébé', + '19' => 'Sonorisation & Lumière' + ); + + private $_carrier_type = array( + 1 => 'Retrait de la marchandise chez le marchand', + 2 => 'Utilisation d\'un réseau de points-retrait tiers (type kiala, alveol, etc.)', + 3 => 'Retrait dans un aéroport, une gare ou une agence de voyage', + 4 => 'Transporteur (La Poste, Colissimo, UPS, DHL... ou tout transporteur privé)', + 5 => 'Emission d’un billet électronique, téléchargements' + ); + + private $_payement_type = array( + 1 => 'carte', + 2 => 'cheque', + 3 => 'contre-remboursement', + 4 => 'virement', + 5 => 'cb en n fois', + 6 => 'paypal', + 7 => '1euro.com' + ); + + public function __construct() + { + $this->name = 'fianetfraud'; + $this->tab = 'payment_security'; + $this->version = '1.1'; + $this->limited_countries = array('fr'); + + parent::__construct(); + + $this->displayName = 'FIA-NET - Système d\'Analyse des Commandes'; + $this->description = "Protégez vous contre la fraude à la carte bancaire sans perturber l'acte d'achat"; + } + + public function install() + { + if (!parent::install()) + return false; + + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach ($sql AS $query) + if ($query AND sizeof($query) AND !Db::getInstance()->Execute(trim($query))) + return false; + $langs = Language::getLanguages(); + + $orderState = new OrderState(); + foreach ($langs AS $lang) + $orderState->name[$lang['id_lang']] = 'Waiting FIA-NET checking'; + $orderState->name[2] = 'Attente validation commande FIA-NET'; + $orderState->invoice = false; + $orderState->send_email = false; + $orderState->logable = false; + $orderState->color = '#FF9999'; + $orderState->hidden = true; + $orderState->save(); + Configuration::updateValue('SAC_ID_WAITING', (int)($orderState->id)); + + $orderState = new OrderState(); + foreach ($langs AS $lang) + $orderState->name[$lang['id_lang']] = 'Fraud Detected By FIA-NET'; + $orderState->name[2] = 'Fraude détectée par FIA-NET'; + $orderState->invoice = false; + $orderState->send_email = false; + $orderState->logable = false; + $orderState->color = '#FF6666'; + $orderState->hidden = true; + $orderState->save(); + Configuration::updateValue('SAC_ID_FRAUD', (int)($orderState->id)); + + if (!$this->registerHook('updateCarrier')) + return false; + if (!Configuration::updateValue('SAC_SITEID', '') OR + !Configuration::updateValue('SAC_LOGIN', '') OR + !Configuration::updateValue('SAC_PASSWORD', '') OR + !Configuration::updateValue('SAC_MINIMAL_ORDER', 0)) + return false; + + return ($this->registerHook('cart') AND + $this->registerHook('newOrder') AND + $this->registerHook('adminOrder') AND + $this->registerHook('updateOrderStatus') + ); + } + + public function uninstall() + { + $orderState = new OrderState((int)(Configuration::get('SAC_ID_FRAUD')), Configuration::get('PS_LANG_DEFAULT')); + if (!$orderState->delete()) + return false; + $orderState = new OrderState((int)(Configuration::get('SAC_ID_WAITING')), Configuration::get('PS_LANG_DEFAULT')); + if (!$orderState->delete()) + return false; + + return parent::uninstall(); + } + + private function _postProcess() + { + global $cookie; + + $error = false; + + Configuration::updateValue('SAC_PRODUCTION', ((Tools::getValue('fianetfraud_production') == 1 ) ? 1 : 0)); + Configuration::updateValue('SAC_LOGIN', Tools::getValue('fianetfraud_login')); + Configuration::updateValue('SAC_PASSWORD', Tools::getValue('fianetfraud_password')); + Configuration::updateValue('SAC_SITEID', Tools::getValue('fianetfraud_siteid')); + Configuration::updateValue('SAC_DEFAULT_PRODUCT_TYPE', Tools::getValue('fianetfraud_product_type')); + Configuration::updateValue('SAC_DEFAULT_CARRIER_TYPE', Tools::getValue('fianetfraud_default_carrier')); + Configuration::updateValue('SAC_MINIMAL_ORDER', Tools::getValue('fianetfraud_minimal_order')); + + if (isset($_POST['payementBox'])) + { + Configuration::updateValue('SAC_PAYMENT_MODULE', implode(',', $_POST['payementBox'])); + foreach ($_POST['payementBox'] as $payment) + Configuration::updateValue('SAC_PAYMENT_TYPE_'.$payment,Tools::getValue($payment)); + } + + $categories = Category::getSimpleCategories($cookie->id_lang); + foreach ($categories AS $category) + Configuration::updateValue('SAC_CATEGORY_TYPE_'.$category['id_category'],Tools::getValue('cat_'.$category['id_category'])); + + $carriers = Carrier::getCarriers($cookie->id_lang); + foreach ($carriers as $carrier) + { + if (isset($_POST['carrier_'.$carrier['id_carrier']])) + Configuration::updateValue('SAC_CARRIER_TYPE_'.$carrier['id_carrier'], $_POST['carrier_'.$carrier['id_carrier']]); + else + { + $error = true; + $this->_html .= '
        '.$this->l('Invalid carrier code').'
        '; + } + } + + if (!$error) + { + $dataSync = ((($site_id = Configuration::get('SAC_SITEID')) AND Configuration::get('SAC_PRODUCTION')) + ? '' + : '' + ); + $this->_html .= '
        '.$this->l('Settings are updated').$dataSync.'
        '; + } + + } + + public function getContent() + { + if (isset($_POST['submitSettings'])) + $this->_postProcess(); + $id_lang = Configuration::get('PS_LANG_DEFAULT'); + $categories = Category::getSimpleCategories($id_lang); + + $carriers = Carrier::getCarriers($id_lang); + $this->_html .= ' +
        FIA-NET - Système d\'Analyse des Commandes + + FIA-NET, le leader français de la lutte contre la fraude à la carte bancaire sur internet !

        + Avec son réseau mutualisé de plus de 1 700 sites marchands, et sa base de données de 14 millions de cyber-acheteurs, le Système d’Analyse des Commandes vous offre une protection complète et unique contre le risque d’impayé.

        + Le logiciel expert (SAC) score vos transactions en quasi temps réel à partir de plus de 200 critères pour valider plus de 92 % de vos transactions.
        + Le contrôle humain, prenant en charge les transactions les plus risqués, associé à l’assurance FIA-NET vous permet de valider et garantir jusqu’à 100 % de vos transactions.

        + Ne restez pas isolé face à l’explosion des réseaux de fraudeurs ! +

        '.$this->l('To sign in, check out: ').' '.$this->l('Fia-net Website').'

        +

        +
        +
        + '.$this->l('Settings').' + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        +

        +
        '.$this->l('Category Detail').' + +
        + + '; + foreach ($categories AS $category) + { + $this->_html .= ''; + } + $this->_html .= '
        '.$this->l('Category').''.$this->l('Category Type').'
        '.$category['name'].' +
        +
        +
         
        +
        '.$this->l('Carrier Configuration').' + +
        + + '; + foreach ($carriers AS $carrier) + { + $this->_html .= ''; + } + $this->_html .= '
        '.$this->l('Carrier').''.$this->l('Carrier Type').'
        '.$carrier['name'].'
        +
        +
         
        + +
        + +
        +
         
        '; + + /* Get all modules then select only payment ones*/ + $modules = Module::getModulesOnDisk(); + $modules_is_fianet = explode(',', Configuration::get('SAC_PAYMENT_MODULE')); + $this->paymentModules = array(); + foreach ($modules AS $module) + if (method_exists($module, 'hookPayment')) + { + if($module->id) + { + $module->country = array(); + $countries = DB::getInstance()->ExecuteS('SELECT id_country FROM '._DB_PREFIX_.'module_country WHERE id_module = '.(int)($module->id)); + foreach ($countries as $country) + $module->country[] = $country['id_country']; + + $module->currency = array(); + $currencies = DB::getInstance()->ExecuteS('SELECT id_currency FROM '._DB_PREFIX_.'module_currency WHERE id_module = '.(int)($module->id)); + foreach ($currencies as $currency) + $module->currency[] = $currency['id_currency']; + + $module->group = array(); + $groups = DB::getInstance()->ExecuteS('SELECT id_group FROM '._DB_PREFIX_.'module_group WHERE id_module = '.(int)($module->id)); + foreach ($groups as $group) + $module->group[] = $group['id_group']; + } + else + { + $module->country = NULL; + $module->currency = NULL; + $module->group = NULL; + } + $this->paymentModules[] = $module; + } + + $this->_html .= '
        '.$this->l('Payment Configuration').' + +
        + + + '; + + foreach ($this->paymentModules as $module) + { + $this->_html .= ''; + $this->_html .= ''; + } + + $this->_html .= '
        '.$this->l('Payment Module').''.$this->l('Payment Type').'
        name,0,15), $modules_is_fianet) ? 'checked="checked"' : '').'>'.$module->name.''.stripslashes($module->displayName).'


        +
        +
        +
         
        '; + return $this->_html; + } + + public function hookCart($params) + { + if ($_SERVER['REMOTE_ADDR'] == '0.0.0.0' OR $_SERVER['REMOTE_ADDR'] == '' OR $_SERVER['REMOTE_ADDR'] === false) + return true; + $res = Db::getInstance()->ExecuteS(' + SELECT `id_cart` + FROM '._DB_PREFIX_.'fianet_fraud + WHERE id_cart='.(int)($params['cart']->id)); + if (Db::getInstance()->NumRows() > 0) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'fianet_fraud` + SET `ip_address` = '.ip2long($_SERVER['REMOTE_ADDR']).', `date` = \''.pSQL(date('Y-m-d H:i:s')).'\' + WHERE `id_cart` = '.(int)($params['cart']->id).' LIMIT 1'); + else + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'fianet_fraud` (`id_cart`, `ip_address`, `date`) + VALUES ('.(int)($params['cart']->id).', '.ip2long($_SERVER['REMOTE_ADDR']).',\''.date('Y-m-d H:i:s').'\')'); + return true; + } + + static private function getIpByCart($id_cart = false) + { + if ($id_cart == false) + return false; + return long2ip(Db::getInstance()->getValue(' + SELECT `ip_address` + FROM '._DB_PREFIX_.'fianet_fraud + WHERE id_cart = '.(int)($id_cart))); + } + + public function hookUpdateOrderStatus($params) + { + $order_status = false; + $conf = Configuration::getMultiple(array('SAC_PRODUCTION', 'PS_SAC_ID_FRAUD', 'SAC_SITEID', 'SAC_LOGIN', 'SAC_PASSWORD')); + if ($params['newOrderStatus']->id == Configuration::get('SAC_ID_FRAUD')) + $order_status = 2; + elseif ($params['newOrderStatus']->id == _PS_OS_DELIVERED_) + $order_status = 1; + elseif ($params['newOrderStatus']->id == _PS_OS_CANCELED_) + $order_status = 2; + elseif ($params['newOrderStatus']->id == _PS_OS_REFUND_) + $order_status = 6; + if ($order_status != false) + return file_get_contents('https://secure.fia-net.com/'.($conf['SAC_PRODUCTION'] ? 'fscreener' : 'pprod').'/engine/delivery.cgi?SiteID='.$conf['SAC_SITEID'].'&Pwd='.urlencode($conf['SAC_PASSWORD']).'&RefID='.(int)$params['id_order'].'&Status='.$order_status); + else + return true; + } + + public function needCheck($id_module, $total_paid) + { + $modules = explode(',', Configuration::get('SAC_PAYMENT_MODULE')); + if (!in_array($id_module, $modules)) + return false; + if ($total_paid < Configuration::get('SAC_MINIMAL_ORDER')) + return false; + return true; + } + + public function hookNewOrder($params) + { + if ($params['order']->total_paid <= 0) + return; + + if (!$this->needCheck($params['order']->module, $params['order']->total_paid)) + return false; + + $address_delivery = new Address((int)($params['order']->id_address_delivery)); + $address_invoice = new Address((int)($params['order']->id_address_invoice)); + $customer = new Customer((int)($params['order']->id_customer)); + $orderFianet = new fianet_order_xml(); + $id_lang = Configuration::get('PS_LANG_DEFAULT'); + if($address_invoice->company == '') + $orderFianet->billing_user->set_quality_nonprofessional(); + else + $orderFianet->billing_user->set_quality_professional(); + + $orderFianet->billing_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2 ) ? $this->l('Mrs') : $this->l('Mr.'))); + $orderFianet->billing_user->nom = utf8_decode($address_invoice->lastname); + $orderFianet->billing_user->prenom = utf8_decode($address_invoice->firstname); + $orderFianet->billing_user->societe = utf8_decode($address_invoice->company); + $orderFianet->billing_user->telhome = utf8_decode($address_invoice->phone); + $orderFianet->billing_user->office = ''; + $orderFianet->billing_user->telmobile = utf8_decode($address_invoice->phone_mobile); + $orderFianet->billing_user->telfax = ''; + $orderFianet->billing_user->email = $customer->email; + + $customer_stats = $customer->getStats(); + $all_orders = Order::getCustomerOrders((int)($customer->id)); + $orderFianet->billing_user->site_conso = new fianet_user_siteconso_xml(); + $orderFianet->billing_user->site_conso->ca = $customer_stats['total_orders']; + $orderFianet->billing_user->site_conso->nb = $customer_stats['nb_orders']; + $orderFianet->billing_user->site_conso->datepremcmd = $all_orders[count($all_orders) - 1]['date_add']; + if (count($all_orders) > 1) + $orderFianet->billing_user->site_conso->datederncmd = $all_orders[1]['date_add']; + + $orderFianet->billing_adress->rue1 = utf8_decode($address_invoice->address1); + $orderFianet->billing_adress->rue2 = utf8_decode($address_invoice->address2); + $orderFianet->billing_adress->cpostal = utf8_decode($address_invoice->postcode); + $orderFianet->billing_adress->ville = utf8_decode($address_invoice->city); + $country = new Country((int)($address_invoice->id_country)); + $orderFianet->billing_adress->pays = utf8_decode($country->name[$id_lang]); + + //delivery adresse not send if carrier id is 1 or 2 + $carrier_id = array(1,2); + if (!in_array(Configuration::get('SAC_CARRIER_TYPE_'.(int)($params['cart']->id_carrier)),$carrier_id)) + { + $orderFianet->delivery_user = new fianet_delivery_user_xml(); + $orderFianet->delivery_adress = new fianet_delivery_adress_xml(); + + if ($address_delivery->company == '') + $orderFianet->delivery_user->set_quality_nonprofessional(); + else + $orderFianet->delivery_user->set_quality_professional(); + + $orderFianet->delivery_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2) ? $this->l('Mrs') : $this->l('Unknown'))); + + $orderFianet->delivery_user->nom = utf8_decode($address_delivery->lastname); + $orderFianet->delivery_user->prenom = utf8_decode($address_delivery->firstname); + $orderFianet->delivery_user->societe = utf8_decode($address_delivery->company); + $orderFianet->delivery_user->telhome = utf8_decode($address_delivery->phone); + $orderFianet->delivery_user->office = ''; + $orderFianet->delivery_user->telmobile = utf8_decode($address_delivery->phone_mobile); + $orderFianet->delivery_user->telfax = ''; + $orderFianet->delivery_user->email = $customer->email; + + $orderFianet->delivery_adress->rue1 = utf8_decode($address_delivery->address1); + $orderFianet->delivery_adress->rue2 = utf8_decode($address_delivery->address2); + $orderFianet->delivery_adress->cpostal = utf8_decode($address_delivery->postcode); + $orderFianet->delivery_adress->ville = utf8_decode($address_delivery->city); + $country = new Country((int)($address_delivery->id_country)); + $orderFianet->delivery_adress->pays = utf8_decode($country->name[$id_lang]); + } + + $orderFianet->info_commande->refid = ($params['order']->id); + $orderFianet->info_commande->montant = $params['order']->total_paid; + $currency = new Currency((int)($params['order']->id_currency)); + $orderFianet->info_commande->devise = $currency->iso_code; + $orderFianet->info_commande->ip = self::getIpByCart((int)($params['cart']->id)); + $orderFianet->info_commande->timestamp = date('Y-m-d H:i:s'); + + $products = $params['cart']->getProducts(); + $default_product_type = Configuration::get('SAC_DEFAULT_PRODUCT_TYPE'); + foreach ($products AS $product) + { + $product_categories = Product::getIndexedCategories((int)($product['id_product'])); + $have_sac_cat = false; + + $produit = new fianet_product_xml(); + + if(Configuration::get('SAC_CATEGORY_TYPE_'.$product['id_category_default'])) + { + $produit->type = Configuration::get('SAC_CATEGORY_TYPE_'.$product['id_category_default']); + } + else + $produit->type = $default_product_type; + $produit->ref = utf8_decode((((isset($product['reference']) AND !empty($product['reference'])) ? $product['reference'] : ((isset($product['ean13']) AND !empty($product['ean13'])) ? $product['ean13'] : $product['name'])))); + $produit->nb = $product['cart_quantity']; + $produit->prixunit = $product['price']; + $produit->name = utf8_decode($product['name']); + $orderFianet->info_commande->list->add_product($produit); + } + + $carrier = new Carrier((int)($params['order']->id_carrier)); + $orderFianet->info_commande->transport->type = Configuration::get('SAC_CARRIER_TYPE_'.(int)($carrier->id)); + $orderFianet->info_commande->transport->nom = $carrier->name; + $orderFianet->info_commande->transport->rapidite = self::getCarrierFastById((int)($carrier->id)); + $orderFianet->payment->type = Configuration::get('SAC_PAYMENT_TYPE_'.substr($params['order']->module,0,15)); + + $xml = $orderFianet->get_xml(); + $sender = new fianet_sender(); + if (Configuration::get('SAC_PRODUCTION')) + $sender->mode = 'production'; + else + $sender->mode = 'test'; + + $sender->add_order($orderFianet); + $res = $sender->send_orders_stacking(); + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'fianet_fraud_orders(id_order, date_add) VALUES('.(int)($params['order']->id).', \''.pSQL(date('Y-m-d H:i:s')).'\')'); + return true; + } + + static public function checkWaitingOrders() + { + $orders = Db::getInstance()->ExecuteS('SELECT id_order FROM '._DB_PREFIX_.'fianet_fraud_orders WHERE `date_add` > \''.pSQL(strtotime('+5 minute')).'\''); + foreach ($orders AS $order) + { + self::updateOrderHistory((int)($order['id_order'])); + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'fianet_fraud_orders WHERE id_order='.(int)($order['id_order'])); + } + } + + public function hookAdminOrder($params) + { + $conf = Configuration::get('SAC_PRODUCTION'); + $order = new Order((int)($params['id_order'])); + if (!self::needCheck($order->module, $order->total_paid)) + return null; + + if (isset($_POST['submitFianet'])) + $this->_postProcess(); + $html = '
        '.$this->l('Fianet Validation').''; + $html .= ''.$this->l('See Detail').'
        '; + $html .= $this->l('Evaluate').': '.self::getEval((int)($order->id)); + $html .= '
        '; + + return $html; + } + + private static function getHCarriers($field) + { + $carriers = Carrier::getCarriers(Configuration::get('PS_LANG_DEFAULT')); + $hcarrier = ''; + foreach ($carriers AS $carrier) + $hcarrier .= ''; + return $hcarrier; + } + + private static function updateOrderHistory($id_order) + { + if (self::getEval((int)($id_order)) > 0) + return true; + elseif (self::getEval((int)($id_order)) == 0) + { + $orderHistory = new OrderHistory(); + $orderHistory->id_order = (int)($id_order); + $orderHistory->id_order_state = Configuration::get('SAC_ID_FRAUD'); + $orderHistory->save(); + return true; + } + } + + private static function getEval($id_order) + { + $sender = new fianet_sender(); + if (Configuration::get('SAC_PRODUCTION')) + $sender->mode = 'production'; + $result = $sender->get_evaluation(array($id_order)); + return $result[0]['eval']; + } + + public static function reEvaluateOrder() + { + $sender = new fianet_sender(); + if (Configuration::get('SAC_PRODUCTION')) + $sender->mode = 'production'; + $result = $sender->get_reevaluated_order(); + + foreach ($result AS $row) + if ($row['eval'] > 0) + if (OrderHistory::getLastOrderState($row['refid']) == Configuration::get('SAC_ID_WAITING')) + { + $orderHistory = new OrderHistory(); + $orderHistory->id_order = (int)($row['refid']); + $orderHistory->id_order_state = _PS_OS_PAYMENT_; + $orderHistory->save(); + } + return true; + } + + private static function getCarrierFastById($id_carrier) + { + return 2; + } + + public function getSACCategories() + { + $categories = Db::getInstance()->ExecuteS('SELECT id_category, id_sac FROM '._DB_PREFIX_.'sac_categories'); + $sac_cat = array(); + if ($categories) + foreach ($categories AS $category) + $sac_cat[$category['id_category']] = $category['id_sac']; + return $sac_cat; + } +} + diff --git a/modules/fianetfraud/fr.php b/modules/fianetfraud/fr.php new file mode 100644 index 000000000..4ffb257b6 --- /dev/null +++ b/modules/fianetfraud/fr.php @@ -0,0 +1,36 @@ +fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Code transporteur invalide'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour avec succès'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Pour vous inscrire, rendez-vous sur:'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'le site internet de Fia-Net'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Utilisateur'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID Site'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Mode production'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Type par défaut'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '-- Choisissez --'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Détail'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Type'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Choix de la catégorie'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configuration du transporteur'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Détail'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Type de transporteur'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Choix du type de transporteur'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Type de transporteur par defaut'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Configuration du paiement'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Détails du paiement'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Module de paiement'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Type de paiement'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'M.'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Mme'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Validation Fia-Net'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Voir le détail'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Evaluation'; diff --git a/modules/fianetfraud/install.sql b/modules/fianetfraud/install.sql new file mode 100644 index 000000000..eb438a853 --- /dev/null +++ b/modules/fianetfraud/install.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_fianet_fraud` ( + `id_cart` int(11) unsigned NOT NULL, + `ip_address` int(11) NOT NULL, + `date` datetime NOT NULL, + KEY `id_cart_index` (`id_cart`), + KEY `ip_address_index` (`ip_address`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_fianet_fraud_orders` ( + `id_order` int(11) NOT NULL, + `date_add` datetime NOT NULL, + UNIQUE KEY `id_order` (`id_order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/modules/fianetfraud/it.php b/modules/fianetfraud/it.php new file mode 100644 index 000000000..2ec38ffba --- /dev/null +++ b/modules/fianetfraud/it.php @@ -0,0 +1,36 @@ +fianetfraud_740e53a0ed1b643f69c4aaa8ad4ae8d2'] = 'Codice corriere non valido'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7ccf58c950043c9fbfed668df13ce608'] = 'Impostazioni aggiornate'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_380b4179d36bce6ca862459a43b217b5'] = 'Per accedere, visitare:'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_592fcfe937f6d58f70d0918ef6373afa'] = 'Sito web Fia-net'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dea78007133396a7b8ed70578ac6ae'] = 'Login'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sito'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_30dbd3dffa9dbd08b062436ba8dcbad7'] = 'Modalità di Produzione'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_99dbbd4d0ac4c725f3b0d2ff29abaf63'] = 'Tipo di prodotto per default'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7bc873cba11f035df692c3549366c722'] = '-- Scegli --'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b16c6b201b9dea0dba4c5214e584d5a9'] = 'Dettagli categoria'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_32b1e872d533aced68e8fd06117c35d9'] = 'Tipo di categoria'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_bb8d6a9f57dcf8f450d8c8b6107cfabb'] = 'Scegli una categoria ...'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_5f001485711e47385cb84b10c888bbfd'] = 'Configurazione corriere'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_84a4ee79ed85180a743340dceb2f98d1'] = 'Dettagli corriere'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_914419aa32f04011357d3b604a86d7eb'] = 'Corriere'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo di corriere'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Scegli un tipo di vettorecorriere...'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_803d8f90719db3a605cf4af72ab2d8ee'] = 'Tipo di corriere di default'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_4a04490d2817c00012562df7bc43299d'] = 'Configurazione pagamento'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ff18b8d27988b97ba1dd72120dd524ea'] = 'Dettaglio di pagamento'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Modulo Pagamento'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo di pagamento'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_127469a6b4253ebb77adccc0dd48461e'] = 'Sig.'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Sig.ra'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_d13270d4831bb2a2723f0fb5b573807c'] = 'Convalida Fianet'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_e010021939a49b7cce07f0e546c1d54f'] = 'Vedi dettaglio'; +$_MODULE['<{fianetfraud}prestashop>fianetfraud_b086843368d1c92d0a86cbee76b20b6f'] = 'Valutaz.'; diff --git a/modules/fianetfraud/logo.gif b/modules/fianetfraud/logo.gif new file mode 100644 index 000000000..1d5fe1ef3 Binary files /dev/null and b/modules/fianetfraud/logo.gif differ diff --git a/modules/fianetfraud/logo.jpg b/modules/fianetfraud/logo.jpg new file mode 100644 index 000000000..cb0dee31f Binary files /dev/null and b/modules/fianetfraud/logo.jpg differ diff --git a/modules/fianetsceau/config.xml b/modules/fianetsceau/config.xml new file mode 100755 index 000000000..c3ccd6740 --- /dev/null +++ b/modules/fianetsceau/config.xml @@ -0,0 +1,12 @@ + + + fianetsceau + FIA-NET Seal of Confidence + 1.0 + Turn your visitors into buyers by creating confidence in your site. + + front_office_features + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/fianetsceau/de.php b/modules/fianetsceau/de.php new file mode 100644 index 000000000..a316f8b70 --- /dev/null +++ b/modules/fianetsceau/de.php @@ -0,0 +1,21 @@ +fianetsceau_21d574c0b27fc6bebc399be75502d84d'] = 'FIA-NET Vertrauenssiegel'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_76c3b678f626c3858c3c98baac90c7ac'] = 'Machen Sie Ihre Besucher zu Käufern durch Vertrauensbildung in Ihre Webseite'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_32c355617b8730b1603e31d144513890'] = 'Bitte füllen Sie Ihr geheimes Schlüsselfeld aus'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_59dd48942de548b075014fe901bfae1b'] = 'Bitte geben Sie Ihre Seiten-ID ein'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_380b4179d36bce6ca862459a43b217b5'] = 'Um sich anzumelden, melden Sie sich ab:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_592fcfe937f6d58f70d0918ef6373afa'] = 'Fia-Net Website'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_ee56be2890222bce04455a34055fd107'] = 'Ihre Seiten-ID'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Beispiel:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_7b00d0388fa5d48b7b00e4f71e4d71d0'] = '(Nur Zahlen)'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_d2560860c51f895a9871741f0805c39e'] = 'geheimer Schlüssel'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_15e8f5f1bb8a1c0cd63bb832412799b1'] = 'geheimer Schlüssel, den Sie von Fia-Net erhalten haben'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_650be61892bf690026089544abbd9d26'] = 'Modus'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_756d97bb256b8580d4d71ee0c547804e'] = 'Betrieb'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aktualisierungseinstellungen'; diff --git a/modules/fianetsceau/es.php b/modules/fianetsceau/es.php new file mode 100644 index 000000000..8e8d41ebe --- /dev/null +++ b/modules/fianetsceau/es.php @@ -0,0 +1,21 @@ +fianetsceau_21d574c0b27fc6bebc399be75502d84d'] = 'Sello de confianza de la FIA-NET'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_76c3b678f626c3858c3c98baac90c7ac'] = 'Convierta a sus visitantes en compradores creando confianza en su sitio web'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_32c355617b8730b1603e31d144513890'] = 'Por favor, introduzca su campo de clave privada'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_59dd48942de548b075014fe901bfae1b'] = 'Por favor, introduzca su Identificación de sitio'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Parámetros actualizados con éxito'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_380b4179d36bce6ca862459a43b217b5'] = 'Para conectarse, visite:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_592fcfe937f6d58f70d0918ef6373afa'] = 'Web de FIA-net'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_ee56be2890222bce04455a34055fd107'] = 'ID de su sitio'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Ejemplo:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_7b00d0388fa5d48b7b00e4f71e4d71d0'] = '(números solamente)'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_d2560860c51f895a9871741f0805c39e'] = 'Clave privada'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_15e8f5f1bb8a1c0cd63bb832412799b1'] = 'Clave privada comunicada por FIA-NET'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_650be61892bf690026089544abbd9d26'] = 'Modo'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar'; diff --git a/modules/fianetsceau/fianetsceau.php b/modules/fianetsceau/fianetsceau.php new file mode 100644 index 000000000..aa238995f --- /dev/null +++ b/modules/fianetsceau/fianetsceau.php @@ -0,0 +1,237 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class FianetSceau extends Module +{ + private $id_order; + + function __construct() + { + $this->name = 'fianetsceau'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + $this->limited_countries = array('fr'); + + parent::__construct(); + + $this->displayName = $this->l('FIA-NET Seal of Confidence'); + $this->description = $this->l('Turn your visitors into buyers by creating confidence in your site.'); + if (!Configuration::get('FIANET_SCEAU_PRIVATEKEY')) + $this->warning = $this->l('Please enter your Private Key field.'); + if (!Configuration::get('FIANET_SCEAU_SITEID')) + $this->warning = $this->l('Please enter your site ID.'); + } + + public function install() + { + return (parent::install() AND + $this->registerHook('rightColumn') AND + $this->registerHook('updateOrderStatus') AND + Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'fianet_seal`( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_order` int(10) unsigned NOT NULL, + `upload_success` int(10) unsigned NOT NULL, + `valid` int(10) unsigned NOT NULL, + `status` int(10) unsigned NOT NULL, + `date_upd` datetime NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id`) + )')); + } + + private function getProcess() + { + if ((int)Tools::getValue('fia_net_mode') == 1) + Configuration::updateValue('FIA_NET_SEAL_MODE', 1); + else + Configuration::updateValue('FIA_NET_SEAL_MODE', 0); + + if (!preg_match('#^[0-9]+$#', Tools::getValue('FIANET_SCEAU_SITEID'))) + return parent::displayError('Bad site id (numbers only)'); + else + Configuration::updateValue('FIANET_SCEAU_SITEID', Tools::getValue('FIANET_SCEAU_SITEID')); + Configuration::updateValue('FIANET_SCEAU_PRIVATEKEY', Tools::getValue('FIANET_SCEAU_PRIVATEKEY')); + + if ((int)Tools::getValue('fia_net_mode')) + $dataSync = (($site_id = Configuration::get('FIANET_SCEAU_SITEID')) ? '' : 'toto'); + else + $dataSync = ''; + return $this->_html .= $this->displayConfirmation($this->l('Configuration updated').$dataSync); } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (!is_callable('curl_init')) + $output .= parent::displayError('You need to enable Curl library to use this module'); + else if (Tools::isSubmit('submitFianet')) + $output .= self::getProcess(); + + $output .= ' +
        '.$this->displayName.' + +
        « Le Sceau de Confiance FIA-NET, leader de la confiance sur le web, influence la décision d’achat de 83 % des internautes (*)
        +


        + Le Sceau de Confiance FIA-NET, le plus connu en France, fait la preuve de vos performances. Il restitue les avis de vos clients grâce à l’envoi de deux questionnaires de satisfaction après l’achat et après la livraison.

        + L’extranet, un outil d’analyse de performance unique, exploite les réponses de vos clients à ces questionnaires. Une aide inestimable qui vous permet de mieux connaitre vos clients et de piloter votre politique marketing et communication.
        +
        + (*Etude FIA-NET – Novembre 2009 – 836 répondants) »

        +

        '.$this->l('To sign in, check out: ').' '.$this->l('Fia-net Website').'

        +

         

        '; + $output .= ' +
        +
        + '.$this->l('Settings').' + +
        + +

        '.$this->l('Sample:').' site_id = \'XXXXX\' '.$this->l('(numbers only)').'

        +
        + +
        + +

        '.$this->l('Private key communicated by Fia-Net').'

        +
        + +
        + + +   + + + +
        +

         

        + +
        +
        '; + + return $output; + } + + private function sendXML() + { + $SiteID = Configuration::get('FIANET_SCEAU_SITEID'); + $order = new Order($this->id_order); + $customer = new Customer($order->id_customer); + $currency = new Currency($order->id_currency); + $control = new SimpleXMLElement(''); + + $user = $control->addChild('utilisateur'); + $name = $user->addChild('nom', $customer->lastname); + if ($customer->id_gender == 1 OR $customer->id_gender == 2) + $name->addAttribute('titre', 1); + $user->addChild('prenom', $customer->firstname); + $user->addChild('email', $customer->email); + + $info = $control->addChild('infocommande'); + $info->addChild('siteid', $SiteID); + $info->addChild('refid', $order->id); + + $total = round($order->total_paid / $currency->conversion_rate, 2); + $amount = $info->addChild('montant', $total); + $amount->addAttribute('devise', 'EUR'); + + $ip = long2ip(Db::getInstance()->getValue(' + SELECT ip_address + FROM '._DB_PREFIX_.'connections a + WHERE a.id_guest = ( + SELECT id_guest FROM '._DB_PREFIX_.'guest + WHERE id_customer = '.$customer->id.' + LIMIT 1)')); + + $order_date = Db::getInstance()->getValue(' + SELECT date_add + FROM '._DB_PREFIX_.'orders + WHERE id_order = '.(int)$order->id); + $customer_ip = $info->addChild('ip', $ip); + $customer_ip->addAttribute('timestamp', $order_date); + + $cryptKey = md5(Configuration::get('FIANET_SCEAU_PRIVATEKEY').'_'.$order->id.'+'.$order_date.'='.$customer->email); + $control->addChild('crypt', $cryptKey); + + $XMLInfo = $control->asXML(); + $CheckSum = md5($XMLInfo); + + $curl = curl_init('https://www.fia-net.com/engine/'.(!Configuration::get('FIA_NET_SEAL_MODE') ? 'preprod/' : '').'sendrating.cgi'); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_HEADER, 0); + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_POSTFIELDS, 'SiteID='.$SiteID.'&XMLInfo='.$XMLInfo.'&CheckSum='.$CheckSum); + curl_setopt($curl, CURLOPT_TIMEOUT, 10); + $result = new simpleXMLelement(curl_exec($curl)); + curl_close ($curl); + + if ($result['type'] == 'OK') + return true; + return false; + } + + public function hookUpdateOrderStatus($params) + { + $this->id_order = (int)$params['id_order']; + $res = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fianet_seal` a WHERE a.id_order = '.(int)$params['id_order']); + $upload_success = false; + if (!$res) + { + if (!($order = new Order($params['id_order']))) + return; + if ($params['newOrderStatus']->logable == 1) + $upload_success = self::sendXML(); + Db::getInstance()->Execute(' + INSERT INTO '._DB_PREFIX_.'fianet_seal (id_order, upload_success, valid, status, date_upd, date_add) + VALUES ('.(int)$order->id.', 0,'.(int)$params['newOrderStatus']->logable.', '.(int)$params['newOrderStatus']->id.', NOW(), NOW())'); + } + else + { + if ($res['valid'] == 1 AND $res['upload_success'] == 1) + return; + if ($params['newOrderStatus']->logable == 1) + $upload_success = self::sendXML(); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'fianet_seal` a + SET valid = '.(int)$params['newOrderStatus']->logable.', upload_success = '.(int)$upload_success.', status = '.(int)$params['newOrderStatus']->id.', date_upd = NOW() + WHERE a.id = '.$res['id']); + } + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookRightColumn($params) + { + global $cookie; + return 'Voir la fiche marchand sur Fia-net.com'; + } +} + + diff --git a/modules/fianetsceau/fr.php b/modules/fianetsceau/fr.php new file mode 100644 index 000000000..b73ccf8db --- /dev/null +++ b/modules/fianetsceau/fr.php @@ -0,0 +1,21 @@ +fianetsceau_21d574c0b27fc6bebc399be75502d84d'] = 'FIA-NET Sceau de Confiance'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_76c3b678f626c3858c3c98baac90c7ac'] = 'Transformez vos visiteurs en acheteurs en créant la confiance sur votre site'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_32c355617b8730b1603e31d144513890'] = 'Veuillez renseigner votre clé privée'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_59dd48942de548b075014fe901bfae1b'] = 'Veuillez renseigner l\'ID de votre site'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Paramètres mis à jour avec succès'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_380b4179d36bce6ca862459a43b217b5'] = 'Pour vous inscrire, rendez-vous sur:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_592fcfe937f6d58f70d0918ef6373afa'] = 'le site internet de Fia-Net'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_ee56be2890222bce04455a34055fd107'] = 'L\'id de votre site'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Exemple :'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_7b00d0388fa5d48b7b00e4f71e4d71d0'] = '(nombres seulement)'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_d2560860c51f895a9871741f0805c39e'] = 'Clé privée'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_15e8f5f1bb8a1c0cd63bb832412799b1'] = 'Clé privée communiquée par Fia-Net'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_650be61892bf690026089544abbd9d26'] = 'Mode'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; diff --git a/modules/fianetsceau/it.php b/modules/fianetsceau/it.php new file mode 100644 index 000000000..3499fac6d --- /dev/null +++ b/modules/fianetsceau/it.php @@ -0,0 +1,21 @@ +fianetsceau_21d574c0b27fc6bebc399be75502d84d'] = 'Sigillo di fiducia FIA-NET '; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_76c3b678f626c3858c3c98baac90c7ac'] = 'Trasforma il tuo visitatori in acquirenti creando fiducia creando nel tuo sito'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_32c355617b8730b1603e31d144513890'] = 'Inserisci il tuo campo chiave privata'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_59dd48942de548b075014fe901bfae1b'] = 'Inserisci il tuo id sito '; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_380b4179d36bce6ca862459a43b217b5'] = 'Per accedere, visitare:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_592fcfe937f6d58f70d0918ef6373afa'] = 'Sito web Fia-net'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_ee56be2890222bce04455a34055fd107'] = 'ID del tuo sito'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Esempio:'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_7b00d0388fa5d48b7b00e4f71e4d71d0'] = '(solo numeri)'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_d2560860c51f895a9871741f0805c39e'] = 'Chiave Privata'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_15e8f5f1bb8a1c0cd63bb832412799b1'] = 'La chiave privata comunicata da FIA-NET'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_650be61892bf690026089544abbd9d26'] = 'Modalità'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{fianetsceau}prestashop>fianetsceau_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; diff --git a/modules/fianetsceau/logo.gif b/modules/fianetsceau/logo.gif new file mode 100644 index 000000000..c02ec1ba7 Binary files /dev/null and b/modules/fianetsceau/logo.gif differ diff --git a/modules/fianetsceau/logo.jpg b/modules/fianetsceau/logo.jpg new file mode 100644 index 000000000..1ff0ae6f9 Binary files /dev/null and b/modules/fianetsceau/logo.jpg differ diff --git a/modules/followup/config.xml b/modules/followup/config.xml new file mode 100755 index 000000000..23e3dfe61 --- /dev/null +++ b/modules/followup/config.xml @@ -0,0 +1,12 @@ + + + followup + Customer follow-up + 1.0 + Follow-up with your customers with daily customized e-mails. + PrestaShop + advertising_marketing + Are you sure you want to delete all settings and your logs? + 1 + 1 + \ No newline at end of file diff --git a/modules/followup/cron.php b/modules/followup/cron.php new file mode 100644 index 000000000..2c111ea32 --- /dev/null +++ b/modules/followup/cron.php @@ -0,0 +1,40 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/followup.php'); + +if (isset($_GET['secure_key'])) +{ + $secureKey = Configuration::get('PS_FOLLOWUP_SECURE_KEY'); + if (!empty($secureKey) AND $secureKey === $_GET['secure_key']) + { + $followup = new Followup(); + $followup->cronTask(); + } +} + diff --git a/modules/followup/de.php b/modules/followup/de.php new file mode 100644 index 000000000..73801a5c6 --- /dev/null +++ b/modules/followup/de.php @@ -0,0 +1,44 @@ +followup_9c34e90380dac7b56fdd19192a99d531'] = 'Kundenkontakt'; +$_MODULE['<{followup}prestashop>followup_57476355fcd04050bff196ae9aa4673c'] = 'Bleiben Sie dran an Ihren Kunden mit täglichen kundenspezifischen E-Mails'; +$_MODULE['<{followup}prestashop>followup_f71a41841c80c2ef0ec02a6ad5449c65'] = 'Sie sind sicher, dass Sie alle Einstellungen und Ihre Logs löschen wollen?'; +$_MODULE['<{followup}prestashop>followup_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{followup}prestashop>followup_599fac49ffe947cd0f9e934e6af89879'] = 'Vier Arten von E-Mail Alerts, um in Kontakt mit Ihren Kunden bleiben!'; +$_MODULE['<{followup}prestashop>followup_8b1aa589b33a54906ae78f5820eab42c'] = 'Definieren Sie die Einstellungen und setzen Sie diese URL in eine Crontab oder rufen Sie sie manuell täglich auf:'; +$_MODULE['<{followup}prestashop>followup_b547c073d144a57761d1d00d0b9d9f27'] = 'Gelöschte Warenkörbe'; +$_MODULE['<{followup}prestashop>followup_ea9dc62a0ddf4640f019f04a22ab9835'] = 'Generieren Sie einen Rabatt für jeden gelöschten Warenkorb (ohne Reihenfolge) und senden Sie ihn an den Kunden'; +$_MODULE['<{followup}prestashop>followup_2faec1f9f8cc7f8f40d521c4dd574f49'] = 'Aktivieren'; +$_MODULE['<{followup}prestashop>followup_b30690be173bcd4a83df0cd68f89a385'] = 'Rabattbetrag'; +$_MODULE['<{followup}prestashop>followup_2018945d252b94aeb99b0909f288717c'] = 'Rabattgültigkeit'; +$_MODULE['<{followup}prestashop>followup_225e75c29d32392d311f5dc94c792384'] = 'Tag (e)'; +$_MODULE['<{followup}prestashop>followup_79645190f574ce5b72b89f4122107b72'] = 'Der nächste Prozess sendet:'; +$_MODULE['<{followup}prestashop>followup_46e89640babbc6a0e52599a92a6c13b4'] = 'E-Mails'; +$_MODULE['<{followup}prestashop>followup_1ec5f5ec77c51a968271b2ca9862907d'] = 'E-Mail'; +$_MODULE['<{followup}prestashop>followup_a8b8dbd070a92fb8b17baab71d8d633f'] = 'Neu sortieren'; +$_MODULE['<{followup}prestashop>followup_895858cf10b8a1750a42875cb9c69092'] = 'Erzeugen einen Rabatt Für jede bestätigte Bestellung und senden Sie ihn an den Kunden'; +$_MODULE['<{followup}prestashop>followup_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Beste Kunden'; +$_MODULE['<{followup}prestashop>followup_a46ad892f7f00e051cc90050ff2e1ddf'] = 'Erzeugen Sie einen Rabatt für jeden Kunden, der eine bestimmte Schwelle erreicht, und senden Sie ihn an den Kunden'; +$_MODULE['<{followup}prestashop>followup_2a63f555989152ba866b43a1faacd680'] = 'Schwelle '; +$_MODULE['<{followup}prestashop>followup_7d75b7b0f976b3091f490864c6ffbf97'] = 'Schlechte Kunden'; +$_MODULE['<{followup}prestashop>followup_e552313de5ebebdafa8bfa0dcc703e19'] = 'Erzeugen Sie einen Rabatt und senden Sie ihn an alle Kunden, die mindestens eine Bestellung durchgeführt haben und seit einem bestimmten Zeitraum nichts mehr bestellt haben'; +$_MODULE['<{followup}prestashop>followup_d82843c16839bfb05827d1912d89c917'] = 'Seit x Tagen'; +$_MODULE['<{followup}prestashop>followup_3fb7b0bbf0c95bba3ed2ba0b147ca588'] = 'Löschen Sie veraltete Rabatte bei jedem Start, um die Datenbank zu leeren'; +$_MODULE['<{followup}prestashop>followup_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{followup}prestashop>followup_c33e404a441c6ba9648f88af3c68a1ca'] = 'Statistik'; +$_MODULE['<{followup}prestashop>followup_1deaabda093f617a57f732c07e635fac'] = 'Detaillierte Statistik der letzten 30 Tage:'; +$_MODULE['<{followup}prestashop>followup_f23b0eec6c25c49afa4b29c57e671728'] = 'S = Anzahl der gesendeten E-Mails'; +$_MODULE['<{followup}prestashop>followup_fde0b9a66bffdd6ee0886613e8031d9a'] = 'U = Anzahl der verwendeten Rabatte (nur bestätigte Bestellungen)'; +$_MODULE['<{followup}prestashop>followup_cceb59e78d00c10436ff5e777dd5d895'] = '% = Umrechnungskurs'; +$_MODULE['<{followup}prestashop>followup_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{followup}prestashop>followup_5e53dfa887dfb989f0bc3e9fb9b34a2d'] = 'Bester Kunde'; +$_MODULE['<{followup}prestashop>followup_66ff4e89c767ab0a4e5ddc0251a101bc'] = 'Schlechter Kunde'; +$_MODULE['<{followup}prestashop>followup_5dbc98dcc983a70728bd082d1a47546e'] = 'S'; +$_MODULE['<{followup}prestashop>followup_4c614360da93c0a041b22e537de151eb'] = 'U'; +$_MODULE['<{followup}prestashop>followup_85b6769250887ba6c16099596c75164d'] = 'noch keine Statistik '; +$_MODULE['<{followup}prestashop>followup_edf9feeab43a7623f6afc152d1ede515'] = 'Rabatt für Ihren abgebrochenen Warenkorb'; +$_MODULE['<{followup}prestashop>followup_a053fc9952a7dfc79282eba56ab8ad3a'] = 'Danke für Ihre Bestellung'; +$_MODULE['<{followup}prestashop>followup_7fcd592dd47028c7c1f2d0ce9168a303'] = 'Sie sind einer unserer besten Kunden'; +$_MODULE['<{followup}prestashop>followup_c2ab23672d4bb31c7664bf8e854a10f7'] = 'Wir vermissen Sie'; diff --git a/modules/followup/en.php b/modules/followup/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/followup/en.php @@ -0,0 +1,4 @@ +followup_9c34e90380dac7b56fdd19192a99d531'] = 'Retome contacto con sus clientes'; +$_MODULE['<{followup}prestashop>followup_57476355fcd04050bff196ae9aa4673c'] = 'Retome contacto con sus clientes enviando emails diariamente'; +$_MODULE['<{followup}prestashop>followup_f71a41841c80c2ef0ec02a6ad5449c65'] = '¿Está seguro de querer suprimir sus parámetros y sus estadísticas?'; +$_MODULE['<{followup}prestashop>followup_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{followup}prestashop>followup_599fac49ffe947cd0f9e934e6af89879'] = 'Existen cuatro maneras de estar en contacto con sus clientes'; +$_MODULE['<{followup}prestashop>followup_8b1aa589b33a54906ae78f5820eab42c'] = 'Efectúe sus reglages y añada esta URL a sus crontab o llámela manualmente cada día:'; +$_MODULE['<{followup}prestashop>followup_b547c073d144a57761d1d00d0b9d9f27'] = 'Carritos anulados'; +$_MODULE['<{followup}prestashop>followup_ea9dc62a0ddf4640f019f04a22ab9835'] = 'Cada carrito abandonado (sin pedido) genera un vale de compra y lo envía al cliente'; +$_MODULE['<{followup}prestashop>followup_2faec1f9f8cc7f8f40d521c4dd574f49'] = 'Activado'; +$_MODULE['<{followup}prestashop>followup_b30690be173bcd4a83df0cd68f89a385'] = 'Importe del descuento'; +$_MODULE['<{followup}prestashop>followup_2018945d252b94aeb99b0909f288717c'] = 'Duración de validez'; +$_MODULE['<{followup}prestashop>followup_225e75c29d32392d311f5dc94c792384'] = 'día(s)'; +$_MODULE['<{followup}prestashop>followup_79645190f574ce5b72b89f4122107b72'] = 'El próximo envío transmmitirá:'; +$_MODULE['<{followup}prestashop>followup_46e89640babbc6a0e52599a92a6c13b4'] = 'emails'; +$_MODULE['<{followup}prestashop>followup_1ec5f5ec77c51a968271b2ca9862907d'] = 'email'; +$_MODULE['<{followup}prestashop>followup_a8b8dbd070a92fb8b17baab71d8d633f'] = 'Pedir de nuevo'; +$_MODULE['<{followup}prestashop>followup_895858cf10b8a1750a42875cb9c69092'] = 'Para cada pedido validado, genera un vale de compra y lo envía al cliente'; +$_MODULE['<{followup}prestashop>followup_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Mejores clientes'; +$_MODULE['<{followup}prestashop>followup_a46ad892f7f00e051cc90050ff2e1ddf'] = 'Para cada cliente cuyo pedido total alcanza cierto importe en un plazo de tiempo concreto, genera un vale de compra y se lo envía'; +$_MODULE['<{followup}prestashop>followup_2a63f555989152ba866b43a1faacd680'] = 'Importe'; +$_MODULE['<{followup}prestashop>followup_7d75b7b0f976b3091f490864c6ffbf97'] = 'Malos clientes'; +$_MODULE['<{followup}prestashop>followup_e552313de5ebebdafa8bfa0dcc703e19'] = 'Para cada cliente que no haya hecho un pedido desde un cierto tiempo, genera un vale de compra y se lo envía'; +$_MODULE['<{followup}prestashop>followup_d82843c16839bfb05827d1912d89c917'] = 'Desde X días'; +$_MODULE['<{followup}prestashop>followup_3fb7b0bbf0c95bba3ed2ba0b147ca588'] = 'Suprimir los vales de compra cuya fecha de expiración está caducada para limpiar los datos'; +$_MODULE['<{followup}prestashop>followup_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{followup}prestashop>followup_c33e404a441c6ba9648f88af3c68a1ca'] = 'Estadísticas'; +$_MODULE['<{followup}prestashop>followup_1deaabda093f617a57f732c07e635fac'] = 'estadísticas detalladas de los 30 últimos días:'; +$_MODULE['<{followup}prestashop>followup_f23b0eec6c25c49afa4b29c57e671728'] = 'E= Número de emails enviados'; +$_MODULE['<{followup}prestashop>followup_fde0b9a66bffdd6ee0886613e8031d9a'] = 'U= Número de vales de compra utilizados (pedidos válidos únicamente)'; +$_MODULE['<{followup}prestashop>followup_cceb59e78d00c10436ff5e777dd5d895'] = 'ù= Tasa de transformación'; +$_MODULE['<{followup}prestashop>followup_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{followup}prestashop>followup_5e53dfa887dfb989f0bc3e9fb9b34a2d'] = 'Mejores clientes'; +$_MODULE['<{followup}prestashop>followup_66ff4e89c767ab0a4e5ddc0251a101bc'] = 'Malos clientes'; +$_MODULE['<{followup}prestashop>followup_5dbc98dcc983a70728bd082d1a47546e'] = 'E'; +$_MODULE['<{followup}prestashop>followup_4c614360da93c0a041b22e537de151eb'] = 'U'; +$_MODULE['<{followup}prestashop>followup_85b6769250887ba6c16099596c75164d'] = 'Ningún dato registrado por el momento'; +$_MODULE['<{followup}prestashop>followup_edf9feeab43a7623f6afc152d1ede515'] = 'Vale de descuento para su carrito abandonado'; +$_MODULE['<{followup}prestashop>followup_a053fc9952a7dfc79282eba56ab8ad3a'] = 'Gracias por su pedido'; +$_MODULE['<{followup}prestashop>followup_7fcd592dd47028c7c1f2d0ce9168a303'] = 'Es usted uno de nuestros mejores clientes'; +$_MODULE['<{followup}prestashop>followup_c2ab23672d4bb31c7664bf8e854a10f7'] = 'le echamos de menos'; diff --git a/modules/followup/followup.php b/modules/followup/followup.php new file mode 100644 index 000000000..2a99f038c --- /dev/null +++ b/modules/followup/followup.php @@ -0,0 +1,446 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Followup extends Module +{ + function __construct() + { + $this->name = 'followup'; + $this->tab = 'advertising_marketing'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + + $this->confKeys = array( + 'PS_FOLLOW_UP_ENABLE_1', 'PS_FOLLOW_UP_ENABLE_2', 'PS_FOLLOW_UP_ENABLE_3', 'PS_FOLLOW_UP_ENABLE_4', + 'PS_FOLLOW_UP_AMOUNT_1', 'PS_FOLLOW_UP_AMOUNT_2', 'PS_FOLLOW_UP_AMOUNT_3', 'PS_FOLLOW_UP_AMOUNT_4', + 'PS_FOLLOW_UP_DAYS_1', 'PS_FOLLOW_UP_DAYS_2', 'PS_FOLLOW_UP_DAYS_3', 'PS_FOLLOW_UP_DAYS_4', + 'PS_FOLLOW_UP_THRESHOLD_3', + 'PS_FOLLOW_UP_DAYS_THRESHOLD_4', + 'PS_FOLLOW_UP_CLEAN_DB'); + + parent::__construct(); + + $this->displayName = $this->l('Customer follow-up'); + $this->description = $this->l('Follow-up with your customers with daily customized e-mails.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete all settings and your logs?'); + } + + public function install() + { + $logEmailTable = Db::getInstance()->Execute(' + CREATE TABLE '._DB_PREFIX_.'log_email ( + `id_log_email` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , + `id_email_type` INT UNSIGNED NOT NULL , + `id_discount` INT UNSIGNED NOT NULL , + `id_customer` INT UNSIGNED NULL , + `id_cart` INT UNSIGNED NULL , + `date_add` DATETIME NOT NULL + ) ENGINE='._MYSQL_ENGINE_); + + foreach ($this->confKeys AS $key) + Configuration::updateValue($key, 0); + + Configuration::updateValue('PS_FOLLOWUP_SECURE_KEY', strtoupper(Tools::passwdGen(16))); + + return parent::install(); + } + + public function uninstall() + { + foreach ($this->confKeys AS $key) + Configuration::deleteByName($key); + + Configuration::deleteByName('PS_FOLLOWUP_SECURE_KEY'); + + Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'log_email'); + + return parent::uninstall(); + } + + public function getContent() + { + /* Save settings */ + if (Tools::isSubmit('submitFollowUp')) + foreach ($this->confKeys AS $c) + Configuration::updateValue($c, (float)(Tools::getValue($c))); + + /* Init */ + $conf = Configuration::getMultiple($this->confKeys); + foreach ($this->confKeys AS $k) + if (!isset($conf[$k])) + $conf[$k] = ''; + $currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + + $n1 = $this->cancelledCart(true); + $n2 = $this->reOrder(true); + $n3 = $this->bestCustomer(true); + $n4 = $this->badCustomer(true); + + echo ' +

        '.$this->l('Customer follow-up').'

        +
        +
        + '.$this->l('Settings').' +

        '.$this->l('Four kinds of e-mail alerts available in order to stay in touch with your customers!').'

        + '.$this->l('Define settings and place this URL in crontab or call it manually daily:').'
        + '.Tools::getShopDomain(true, true).__PS_BASE_URI__.'modules/followup/cron.php?secure_key='.Configuration::get('PS_FOLLOWUP_SECURE_KEY').'

        +
        +

        1. '.$this->l('Cancelled carts').'

        '.$this->l('For each cancelled cart (with no order), generate a discount and send it to the customer.').'

        + +
        + +
        %
        + +
        '.$this->l('day(s)').'
        +

        '.$this->l('Next process will send:').' '.(int)($n1).' '.($n1 > 1 ? $this->l('e-mails') : $this->l('e-mail')).'

        +
        +

        2. '.$this->l('Re-order').'

        '.$this->l('For each validated order, generate a discount and send it to the customer.').'

        + +
        + +
        %
        + +
        '.$this->l('day(s)').'
        +

        '.$this->l('Next process will send:').' '.(int)($n2).' '.($n2 > 1 ? $this->l('e-mails') : $this->l('e-mail')).'

        +
        +

        3. '.$this->l('Best customers').'

        '.$this->l('For each customer raising a threshold, generate a discount and send it to the customer.').'

        + +
        + +
        %
        + +
        '.($currency->format == 1 ? ' '.$currency->sign.' ' : '').' '.($currency->format == 2 ? ' '.$currency->sign : '').'
        + +
        '.$this->l('day(s)').'
        +

        '.$this->l('Next process will send:').' '.(int)($n3).' '.($n3 > 1 ? $this->l('e-mails') : $this->l('e-mail')).'

        +
        +

        4. '.$this->l('Bad customers').'

        '.$this->l('For each customer who has already passed at least one order and with no orders since a given duration, generate a discount and send it to the customer.').'

        + +
        + +
        %
        + +
        '.$this->l('day(s)').'
        + +
        '.$this->l('day(s)').'
        +

        '.$this->l('Next process will send:').' '.(int)($n4).' '.($n4 > 1 ? $this->l('e-mails') : $this->l('e-mail')).'

        +
        + '.$this->l('Delete outdated discounts during each launch to clean database.').' +
        +
        +
        + + +
        + '.$this->l('Statistics').' + '.$this->l('Detailed statistics for last 30 days:').'

        +

        + '.$this->l('S = Number of sent e-mails').'
        + '.$this->l('U = Number of discounts used (valid orders only)').'
        + '.$this->l('% = Conversion rate').' +


        + + + + + + + + '; + + $stats = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DATE_FORMAT(l.date_add, \'%Y-%m-%d\') date_stat, l.id_email_type, COUNT(l.id_log_email) nb, + (SELECT COUNT(l2.id_discount) + FROM '._DB_PREFIX_.'log_email l2 + LEFT JOIN '._DB_PREFIX_.'order_discount od ON (od.id_discount = l2.id_discount) + LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_order = od.id_order) + WHERE l2.id_email_type = l.id_email_type AND l2.date_add = l.date_add AND od.id_order IS NOT NULL AND o.valid = 1) nb_used + FROM '._DB_PREFIX_.'log_email l + WHERE l.date_add >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) + GROUP BY DATE_FORMAT(l.date_add, \'%Y-%m-%d\'), l.id_email_type'); + + $statsArray = array(); + foreach ($stats AS $stat) + { + $statsArray[$stat['date_stat']][$stat['id_email_type']]['nb'] = (int)($stat['nb']); + $statsArray[$stat['date_stat']][$stat['id_email_type']]['nb_used'] = (int)($stat['nb_used']); + } + + echo ' + + + + + + + + + + + + + + '; + + if (!sizeof($statsArray)) + echo ''; + foreach ($statsArray AS $date_stat => $array) + { + $rates = array(); + for ($i = 1; $i != 5; $i++) + if (isset($statsArray[$date_stat][$i]['nb']) AND isset($statsArray[$date_stat][$i]['nb_used']) AND $statsArray[$date_stat][$i]['nb_used'] > 0) + $rates[$i] = number_format(($statsArray[$date_stat][$i]['nb_used'] / $statsArray[$date_stat][$i]['nb'])*100, 2, '.', ''); + + echo ' + + '; + + for ($i = 1; $i != 5; $i++) + { + echo ' + + + '; + } + + echo ' + '; + } + + echo ' +
        '.$this->l('Date').''.$this->l('Cancelled carts').''.$this->l('Re-order').''.$this->l('Best cust.').''.$this->l('Bad cust.').'
        '.$this->l('S').''.$this->l('U').'%'.$this->l('S').''.$this->l('U').'%'.$this->l('S').''.$this->l('U').'%'.$this->l('S').''.$this->l('U').'%
        '.$this->l('No statistics at this time.').'
        '.$date_stat.''.(isset($statsArray[$date_stat][$i]['nb']) ? (int)($statsArray[$date_stat][$i]['nb']) : 0).''.(isset($statsArray[$date_stat][$i]['nb_used']) ? (int)($statsArray[$date_stat][$i]['nb_used']) : 0).''.(isset($rates[$i]) ? ''.$rates[$i].'' : '0.00').'
        +
        +
        +
        '; + } + + /* Log each sent e-mail */ + private function logEmail($id_email_type, $id_discount, $id_customer = NULL, $id_cart = NULL) + { + $values = array('id_email_type' => (int)($id_email_type), 'id_discount' => (int)($id_discount), 'date_add' => date('Y-m-d H:i:s')); + if (!empty($id_cart)) + $values['id_cart'] = (int)($id_cart); + if (!empty($id_customer)) + $values['id_customer'] = (int)($id_customer); + Db::getInstance()->autoExecute(_DB_PREFIX_.'log_email', $values, 'INSERT'); + } + + /* Each cart which wasn't transformed into an order */ + private function cancelledCart($count = false) + { + $emails = Db::getInstance()->ExecuteS(' + SELECT c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email + FROM '._DB_PREFIX_.'cart c + LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_cart = c.id_cart) + LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = c.id_customer) + WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= c.date_add AND cu.id_customer IS NOT NULL AND o.id_order IS NULL AND c.id_cart NOT IN + (SELECT id_cart FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 1)'); + + if ($count OR !sizeof($emails)) + return sizeof($emails); + + $conf = Configuration::getMultiple(array('PS_FOLLOW_UP_AMOUNT_1', 'PS_FOLLOW_UP_DAYS_1')); + foreach ($emails AS $email) + { + $voucher = $this->createDiscount(1, (float)($conf['PS_FOLLOW_UP_AMOUNT_1']), (int)($email['id_customer']), strftime('%Y-%m-%d', strtotime('+'.(int)($conf['PS_FOLLOW_UP_DAYS_1']).' day')), $this->l('Discount for your cancelled cart')); + if ($voucher !== false) + { + $templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_1'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_1'], '{voucher_num}' => $voucher->name); + $result = Mail::Send((int)($email['id_lang']), 'followup_1', Mail::l('Your cart and your discount'), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + $this->logEmail(1, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart'])); + } + } + } + + /* For all validated orders, a discount if re-ordering before x days */ + private function reOrder($count = false) + { + $emails = Db::getInstance()->ExecuteS(' + SELECT o.id_order, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = o.id_customer) + LEFT JOIN '._DB_PREFIX_.'cart c ON (c.id_cart = o.id_cart) + WHERE o.valid = 1 AND c.date_add >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) AND o.id_order NOT IN + (SELECT id_order FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 2)'); + + if ($count OR !sizeof($emails)) + return sizeof($emails); + + $conf = Configuration::getMultiple(array('PS_FOLLOW_UP_AMOUNT_2', 'PS_FOLLOW_UP_DAYS_2')); + foreach ($emails AS $email) + { + $voucher = $this->createDiscount(2, (float)($conf['PS_FOLLOW_UP_AMOUNT_2']), (int)($email['id_customer']), strftime('%Y-%m-%d', strtotime('+'.(int)($conf['PS_FOLLOW_UP_DAYS_2']).' day')), $this->l('Thank you for your order.')); + if ($voucher !== false) + { + $templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_2'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_2'], '{voucher_num}' => $voucher->name); + $result = Mail::Send((int)($email['id_lang']), 'followup_2', Mail::l('Thanks for your order'), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + $this->logEmail(2, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart'])); + } + } + } + + /* For all customers with more than x euros in 90 days */ + private function bestCustomer($count = false) + { + $emails = Db::getInstance()->ExecuteS(' + SELECT SUM(o.total_paid) total, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = o.id_customer) + LEFT JOIN '._DB_PREFIX_.'cart c ON (c.id_cart = o.id_cart) + WHERE o.valid = 1 AND DATE_SUB(CURDATE(),INTERVAL 90 DAY) <= o.date_add AND cu.id_customer NOT IN + (SELECT id_customer FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 3) + GROUP BY o.id_customer + HAVING total >= '.(float)(Configuration::get('PS_FOLLOW_UP_THRESHOLD_3'))); + + if ($count OR !sizeof($emails)) + return sizeof($emails); + + $conf = Configuration::getMultiple(array('PS_FOLLOW_UP_AMOUNT_3', 'PS_FOLLOW_UP_DAYS_3')); + foreach ($emails AS $email) + { + $voucher = $this->createDiscount(3, (float)($conf['PS_FOLLOW_UP_AMOUNT_3']), (int)($email['id_customer']), strftime('%Y-%m-%d', strtotime('+'.(int)($conf['PS_FOLLOW_UP_DAYS_3']).' day')), $this->l('You are one of our best customers!')); + if ($voucher !== false) + { + $templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_3'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_3'], '{voucher_num}' => $voucher->name); + $result = Mail::Send((int)($email['id_lang']), 'followup_3', Mail::l('You are one of our best customers'), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + $this->logEmail(3, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart'])); + } + } + } + + /* For all customers with no orders since more than x days */ + + /** + * badCustomer send mails to all customers with no orders since more than x days, + * with at least one valid order in history + * + * @param boolean $count if set to true, will return number of customer (default : false, will send mails, no return value) + * @return void + */ + private function badCustomer($count = false) + { + $emails = Db::getInstance()->ExecuteS(' + SELECT c.id_lang, c.id_cart, cu.id_customer, cu.firstname, cu.lastname, cu.email, (SELECT COUNT(o.id_order) FROM '._DB_PREFIX_.'orders o WHERE o.id_customer = cu.id_customer and o.valid = 1) nb_orders + FROM '._DB_PREFIX_.'customer cu + LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_customer = cu.id_customer) + LEFT JOIN '._DB_PREFIX_.'cart c ON (c.id_cart = o.id_cart) + WHERE cu.id_customer NOT IN + (SELECT o.id_customer FROM '._DB_PREFIX_.'orders o WHERE DATE_SUB(CURDATE(),INTERVAL '.(int)(Configuration::get('PS_FOLLOW_UP_DAYS_THRESHOLD_4')).' DAY) <= o.date_add) + AND cu.id_customer NOT IN + (SELECT id_customer FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 4 AND date_add >= DATE_SUB(date_add,INTERVAL '.(int)(Configuration::get('PS_FOLLOW_UP_DAYS_THRESHOLD_4')).' DAY)) + GROUP BY cu.id_customer + HAVING nb_orders >= 1'); + + if ($count OR !sizeof($emails)) + return sizeof($emails); + + $conf = Configuration::getMultiple(array('PS_FOLLOW_UP_AMOUNT_4', 'PS_FOLLOW_UP_DAYS_4')); + foreach ($emails AS $email) + { + $voucher = $this->createDiscount(4, (float)($conf['PS_FOLLOW_UP_AMOUNT_4']), (int)($email['id_customer']), strftime('%Y-%m-%d', strtotime('+'.(int)($conf['PS_FOLLOW_UP_DAYS_4']).' day')), $this->l('We miss you!')); + if ($voucher !== false) + { + $templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_4'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_4'], '{days_threshold}' => (int)(Configuration::get('PS_FOLLOW_UP_DAYS_THRESHOLD_4')), '{voucher_num}' => $voucher->name); + $result = Mail::Send((int)($email['id_lang']), 'followup_4', Mail::l('We miss you'), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); + $this->logEmail(4, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart'])); + } + } + } + + private function createDiscount($id_email_type, $amount, $id_customer, $dateValidity, $description) + { + $discount = new Discount(); + $discount->id_discount_type = 1; + $discount->value = (float)($amount); + $discount->id_customer = (int)($id_customer); + $discount->date_to = $dateValidity; + $discount->date_from = date('Y-m-d H:i:s'); + $discount->quantity = 1; + $discount->quantity_per_user = 1; + $discount->cumulable = 0; + $discount->cumulable_reduction = 1; + $discount->minimal = 0; + + $languages = Language::getLanguages(true); + foreach ($languages AS $language) + $discount->description[(int)($language['id_lang'])] = $description; + + $name = 'FLW-'.(int)($id_email_type).'-'.strtoupper(Tools::passwdGen(10)); + $discount->name = $name; + $discount->active = 1; + $result = $discount->add(); + + if (!$result) + return false; + return $discount; + } + + public function cronTask() + { + $conf = Configuration::getMultiple(array('PS_FOLLOW_UP_ENABLE_1', 'PS_FOLLOW_UP_ENABLE_2', 'PS_FOLLOW_UP_ENABLE_3', 'PS_FOLLOW_UP_ENABLE_4', 'PS_FOLLOW_UP_CLEAN_DB')); + + if ($conf['PS_FOLLOW_UP_ENABLE_1']) + $this->cancelledCart(); + if ($conf['PS_FOLLOW_UP_ENABLE_2']) + $this->reOrder(); + if ($conf['PS_FOLLOW_UP_ENABLE_3']) + $this->bestCustomer(); + if ($conf['PS_FOLLOW_UP_ENABLE_4']) + $this->badCustomer(); + + /* Clean-up database by deleting all outdated discounts */ + if ($conf['PS_FOLLOW_UP_CLEAN_DB'] == 1) + { + $outdatedDiscounts = Db::getInstance()->ExecuteS('SELECT id_discount FROM '._DB_PREFIX_.'discount WHERE date_to < NOW()'); + foreach ($outdatedDiscounts AS $outdatedDiscount) + { + $discount = new Discount((int)($outdatedDiscount['id_discount'])); + if (Validate::isLoadedObject($discount)) + $discount->delete(); + } + } + } +} + diff --git a/modules/followup/fr.php b/modules/followup/fr.php new file mode 100644 index 000000000..0604893cc --- /dev/null +++ b/modules/followup/fr.php @@ -0,0 +1,44 @@ +followup_9c34e90380dac7b56fdd19192a99d531'] = 'Relancez vos clients'; +$_MODULE['<{followup}prestashop>followup_57476355fcd04050bff196ae9aa4673c'] = 'Relancez vos clients grâce à des envoi d\'e-mails quotidiens'; +$_MODULE['<{followup}prestashop>followup_f71a41841c80c2ef0ec02a6ad5449c65'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ainsi que vos statistiques liées aux relances ?'; +$_MODULE['<{followup}prestashop>followup_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{followup}prestashop>followup_599fac49ffe947cd0f9e934e6af89879'] = 'Quatre types de relances afin de rester en contact avec vos clients !'; +$_MODULE['<{followup}prestashop>followup_8b1aa589b33a54906ae78f5820eab42c'] = 'Effectuez vos réglages et ajoutez cette URL à votre crontab ou appelez-la manuellement chaque jour :'; +$_MODULE['<{followup}prestashop>followup_b547c073d144a57761d1d00d0b9d9f27'] = 'Paniers annulés'; +$_MODULE['<{followup}prestashop>followup_ea9dc62a0ddf4640f019f04a22ab9835'] = 'Pour chaque panier abandonné (sans commande), génère un bon d\'achat et l\'envoi au client'; +$_MODULE['<{followup}prestashop>followup_2faec1f9f8cc7f8f40d521c4dd574f49'] = 'Activé'; +$_MODULE['<{followup}prestashop>followup_b30690be173bcd4a83df0cd68f89a385'] = 'Montant de la remise'; +$_MODULE['<{followup}prestashop>followup_2018945d252b94aeb99b0909f288717c'] = 'Durée de validité'; +$_MODULE['<{followup}prestashop>followup_225e75c29d32392d311f5dc94c792384'] = 'jour(s)'; +$_MODULE['<{followup}prestashop>followup_79645190f574ce5b72b89f4122107b72'] = 'Le prochain envoi transmettra :'; +$_MODULE['<{followup}prestashop>followup_46e89640babbc6a0e52599a92a6c13b4'] = 'e-mails'; +$_MODULE['<{followup}prestashop>followup_1ec5f5ec77c51a968271b2ca9862907d'] = 'e-mail'; +$_MODULE['<{followup}prestashop>followup_a8b8dbd070a92fb8b17baab71d8d633f'] = 'Re-commander'; +$_MODULE['<{followup}prestashop>followup_895858cf10b8a1750a42875cb9c69092'] = 'Pour chaque commande validée, génère un bon d\'achat et l\'envoi au client'; +$_MODULE['<{followup}prestashop>followup_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Meilleurs clients'; +$_MODULE['<{followup}prestashop>followup_a46ad892f7f00e051cc90050ff2e1ddf'] = 'Pour chaque client dont le total des commandes atteind un certain seuil, génère un bon d\'achat et l\'envoi au client'; +$_MODULE['<{followup}prestashop>followup_2a63f555989152ba866b43a1faacd680'] = 'Seuil'; +$_MODULE['<{followup}prestashop>followup_7d75b7b0f976b3091f490864c6ffbf97'] = 'Mauvais clients'; +$_MODULE['<{followup}prestashop>followup_e552313de5ebebdafa8bfa0dcc703e19'] = 'Pour chaque client ayant déjà passé commande au moins une fois et sans commande depuis une certaine durée, génère un bon d\'achat et l\'envoi au client'; +$_MODULE['<{followup}prestashop>followup_d82843c16839bfb05827d1912d89c917'] = 'Depuis x jours'; +$_MODULE['<{followup}prestashop>followup_3fb7b0bbf0c95bba3ed2ba0b147ca588'] = 'Supprimer les bons d\'achat dont la date d\'expiration est dépassée afin de nettoyer la base de données'; +$_MODULE['<{followup}prestashop>followup_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{followup}prestashop>followup_c33e404a441c6ba9648f88af3c68a1ca'] = 'Statistiques'; +$_MODULE['<{followup}prestashop>followup_1deaabda093f617a57f732c07e635fac'] = 'Statistiques détaillées sur les 30 derniers jours :'; +$_MODULE['<{followup}prestashop>followup_f23b0eec6c25c49afa4b29c57e671728'] = 'E = Nombre d\'e-mails envoyés'; +$_MODULE['<{followup}prestashop>followup_fde0b9a66bffdd6ee0886613e8031d9a'] = 'U = Nombre de bons d\'achat utilisés (commandes valides uniquement)'; +$_MODULE['<{followup}prestashop>followup_cceb59e78d00c10436ff5e777dd5d895'] = '% = Taux de transformation'; +$_MODULE['<{followup}prestashop>followup_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{followup}prestashop>followup_5e53dfa887dfb989f0bc3e9fb9b34a2d'] = 'Meilleurs clients'; +$_MODULE['<{followup}prestashop>followup_66ff4e89c767ab0a4e5ddc0251a101bc'] = 'Mauvais clients'; +$_MODULE['<{followup}prestashop>followup_5dbc98dcc983a70728bd082d1a47546e'] = 'E'; +$_MODULE['<{followup}prestashop>followup_4c614360da93c0a041b22e537de151eb'] = 'U'; +$_MODULE['<{followup}prestashop>followup_85b6769250887ba6c16099596c75164d'] = 'Aucune donnée enregistrée pour l\'instant'; +$_MODULE['<{followup}prestashop>followup_edf9feeab43a7623f6afc152d1ede515'] = 'Bon de réduction pour votre panier abandonné'; +$_MODULE['<{followup}prestashop>followup_a053fc9952a7dfc79282eba56ab8ad3a'] = 'Merci pour votre commande'; +$_MODULE['<{followup}prestashop>followup_7fcd592dd47028c7c1f2d0ce9168a303'] = 'Vous êtes l\'un de nos meilleurs clients'; +$_MODULE['<{followup}prestashop>followup_c2ab23672d4bb31c7664bf8e854a10f7'] = 'Vous nous manquez'; diff --git a/modules/followup/it.php b/modules/followup/it.php new file mode 100644 index 000000000..d6082ebfc --- /dev/null +++ b/modules/followup/it.php @@ -0,0 +1,44 @@ +followup_9c34e90380dac7b56fdd19192a99d531'] = 'Follow-up clienti'; +$_MODULE['<{followup}prestashop>followup_57476355fcd04050bff196ae9aa4673c'] = 'Segui i tuoi clienti con e-mail quotidiane personalizzate'; +$_MODULE['<{followup}prestashop>followup_f71a41841c80c2ef0ec02a6ad5449c65'] = 'Sei sicuro di voler eliminare tutte le impostazioni ed i registri?'; +$_MODULE['<{followup}prestashop>followup_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{followup}prestashop>followup_599fac49ffe947cd0f9e934e6af89879'] = 'Quattro tipi di avvisi via e-mail per rimanere in contatto con i tuoi clienti!'; +$_MODULE['<{followup}prestashop>followup_8b1aa589b33a54906ae78f5820eab42c'] = 'Definire le impostazioni e mettere questo URL nel crontab o chiamare ogni giorno:'; +$_MODULE['<{followup}prestashop>followup_b547c073d144a57761d1d00d0b9d9f27'] = 'Carrelli cancellati'; +$_MODULE['<{followup}prestashop>followup_ea9dc62a0ddf4640f019f04a22ab9835'] = 'Per ogni carrello annullato (senza ordine), genera uno sconto e invialo al cliente'; +$_MODULE['<{followup}prestashop>followup_2faec1f9f8cc7f8f40d521c4dd574f49'] = 'Attiva'; +$_MODULE['<{followup}prestashop>followup_b30690be173bcd4a83df0cd68f89a385'] = 'Importo sconto'; +$_MODULE['<{followup}prestashop>followup_2018945d252b94aeb99b0909f288717c'] = 'Validità sconto'; +$_MODULE['<{followup}prestashop>followup_225e75c29d32392d311f5dc94c792384'] = 'giorno (i)'; +$_MODULE['<{followup}prestashop>followup_79645190f574ce5b72b89f4122107b72'] = 'La prossima elaborazione invierà:'; +$_MODULE['<{followup}prestashop>followup_46e89640babbc6a0e52599a92a6c13b4'] = 'e-mail'; +$_MODULE['<{followup}prestashop>followup_1ec5f5ec77c51a968271b2ca9862907d'] = 'e-mail'; +$_MODULE['<{followup}prestashop>followup_a8b8dbd070a92fb8b17baab71d8d633f'] = 'Riordino'; +$_MODULE['<{followup}prestashop>followup_895858cf10b8a1750a42875cb9c69092'] = 'Per ogni ordine convalidato, genera uno sconto e invialo al cliente'; +$_MODULE['<{followup}prestashop>followup_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Migliori clienti'; +$_MODULE['<{followup}prestashop>followup_a46ad892f7f00e051cc90050ff2e1ddf'] = 'Per ogni cliente che aumenta una soglia, genera uno sconto e invialo al cliente'; +$_MODULE['<{followup}prestashop>followup_2a63f555989152ba866b43a1faacd680'] = 'Soglia'; +$_MODULE['<{followup}prestashop>followup_7d75b7b0f976b3091f490864c6ffbf97'] = 'Cattivi clienti'; +$_MODULE['<{followup}prestashop>followup_e552313de5ebebdafa8bfa0dcc703e19'] = 'Per ogni cliente che ha già inviato almeno un ordine e senza ordini da un periodo dato, genera uno sconto e invialo al cliente'; +$_MODULE['<{followup}prestashop>followup_d82843c16839bfb05827d1912d89c917'] = 'Da x giorni'; +$_MODULE['<{followup}prestashop>followup_3fb7b0bbf0c95bba3ed2ba0b147ca588'] = 'Elimina sconti scaduti nel corso di ogni lancio per la pulizia del database'; +$_MODULE['<{followup}prestashop>followup_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{followup}prestashop>followup_c33e404a441c6ba9648f88af3c68a1ca'] = 'Statistiche'; +$_MODULE['<{followup}prestashop>followup_1deaabda093f617a57f732c07e635fac'] = 'Statistiche dettagliate per ultimi 30 giorni:'; +$_MODULE['<{followup}prestashop>followup_f23b0eec6c25c49afa4b29c57e671728'] = 'S = numero di e-mail inviate'; +$_MODULE['<{followup}prestashop>followup_fde0b9a66bffdd6ee0886613e8031d9a'] = 'U = Numero di sconti usati (solo ordini validi)'; +$_MODULE['<{followup}prestashop>followup_cceb59e78d00c10436ff5e777dd5d895'] = '% = Tasso di conversione'; +$_MODULE['<{followup}prestashop>followup_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{followup}prestashop>followup_5e53dfa887dfb989f0bc3e9fb9b34a2d'] = 'Miglior cliente'; +$_MODULE['<{followup}prestashop>followup_66ff4e89c767ab0a4e5ddc0251a101bc'] = 'Catt. cliente'; +$_MODULE['<{followup}prestashop>followup_5dbc98dcc983a70728bd082d1a47546e'] = 'S'; +$_MODULE['<{followup}prestashop>followup_4c614360da93c0a041b22e537de151eb'] = 'U'; +$_MODULE['<{followup}prestashop>followup_85b6769250887ba6c16099596c75164d'] = 'Nessuna statistica ancora'; +$_MODULE['<{followup}prestashop>followup_edf9feeab43a7623f6afc152d1ede515'] = 'Sconto per il carrello annullato'; +$_MODULE['<{followup}prestashop>followup_a053fc9952a7dfc79282eba56ab8ad3a'] = 'Grazie per il vostro ordine'; +$_MODULE['<{followup}prestashop>followup_7fcd592dd47028c7c1f2d0ce9168a303'] = 'Sei uno dei nostri migliori clienti'; +$_MODULE['<{followup}prestashop>followup_c2ab23672d4bb31c7664bf8e854a10f7'] = 'Ci manchi'; diff --git a/modules/followup/logo-2.gif b/modules/followup/logo-2.gif new file mode 100644 index 000000000..9102f3a81 Binary files /dev/null and b/modules/followup/logo-2.gif differ diff --git a/modules/followup/logo.gif b/modules/followup/logo.gif new file mode 100644 index 000000000..2194c59db Binary files /dev/null and b/modules/followup/logo.gif differ diff --git a/modules/followup/mails/de/followup_1.html b/modules/followup/mails/de/followup_1.html new file mode 100644 index 000000000..0bb189452 --- /dev/null +++ b/modules/followup/mails/de/followup_1.html @@ -0,0 +1,46 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihr Warenkorb bei {shop_name}
         
        Uns ist aufgefallen, dass Sie bei Ihrem letzten Besuch auf {shop_name} Ihre Bestellung nicht abgeschlossen haben.

        Ihr Warenkorb wurde gespeichert, Sie können Ihre Bestellung abschließen, indem Sie auf unsere Shop-Seite gehen:

        {shop_url}

        Als Anreiz erhalten Sie einen Rabatt über {amount}% auf Ihre nächste Bestellung! Dieses Angebot gilt nur noch {days} Tage, also warten Sie nicht länger!
         
        Hier ist Ihr Gutschein: {voucher_num}

        Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten.
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/de/followup_1.txt b/modules/followup/mails/de/followup_1.txt new file mode 100644 index 000000000..119052799 --- /dev/null +++ b/modules/followup/mails/de/followup_1.txt @@ -0,0 +1,11 @@ +Uns ist aufgefallen, dass Sie bei Ihrem letzten Besuch auf {shop_name} Ihre Bestellung nicht abgeschlossen haben. + +Ihr Warenkorb wurde gespeichert, Sie können Ihre Bestellung abschließen, indem Sie auf unsere Shop-Seite gehen: + +{shop_url} + +Als Anreiz erhalten Sie einen Rabatt über {amount}% auf Ihre nächste Bestellung! Dieses Angebot gilt nur noch {days} Tage, also warten Sie nicht länger! + +Hier ist Ihr Gutschein: {voucher_num} + +Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten. \ No newline at end of file diff --git a/modules/followup/mails/de/followup_2.html b/modules/followup/mails/de/followup_2.html new file mode 100644 index 000000000..00ec40eef --- /dev/null +++ b/modules/followup/mails/de/followup_2.html @@ -0,0 +1,46 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Danke für Ihre Bestellung bei {shop_name}
         
        Als Dankeschön möchten wir Ihnen einen Rabatt über {amount}% auf Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days} Tage, also warten Sie nicht länger!

         
        Hier ist Ihr Gutschein: {voucher_num}

        Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten.
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/de/followup_2.txt b/modules/followup/mails/de/followup_2.txt new file mode 100644 index 000000000..1d49330bc --- /dev/null +++ b/modules/followup/mails/de/followup_2.txt @@ -0,0 +1,10 @@ +Hallo {firstname} {lastname}, + +Danke für Ihre Bestellung bei {shop_name} + +Als Dankeschön möchten wir Ihnen einen Rabatt über {amount}% auf Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days} Tage, also warten Sie nicht länger! + + +Hier ist Ihr Gutschein: {voucher_num} + +Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten. \ No newline at end of file diff --git a/modules/followup/mails/de/followup_3.html b/modules/followup/mails/de/followup_3.html new file mode 100644 index 000000000..29979e20c --- /dev/null +++ b/modules/followup/mails/de/followup_3.html @@ -0,0 +1,49 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Danke für Ihr Vertrauen
         
        Sie sind einer unserer besten Kunden, desshalb möchten wir Ihnen für Ihr Vertrauen danken.

        Als Anerkennung für Ihre Treue möchten wir Ihnen einen Rabatt über {amount}% für Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days}, Tage, also warten Sie nicht länger!
         
        +

        Hier ist Ihr Gutschein: {voucher_num}

        +


        Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten.

        +
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/de/followup_3.txt b/modules/followup/mails/de/followup_3.txt new file mode 100644 index 000000000..25e2bdf36 --- /dev/null +++ b/modules/followup/mails/de/followup_3.txt @@ -0,0 +1,9 @@ +Hallo {firstname} {lastname}, + +Sie sind einer unserer besten Kunden, desshalb möchten wir Ihnen für Ihr Vertrauen danken. + +Als Anerkennung für Ihre Treue möchten wir Ihnen einen Rabatt über {amount}% für Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days}, Tage, also warten Sie nicht länger! + +Hier ist Ihr Gutschein: {voucher_num} + +Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten. \ No newline at end of file diff --git a/modules/followup/mails/de/followup_4.html b/modules/followup/mails/de/followup_4.html new file mode 100644 index 000000000..ac26064a5 --- /dev/null +++ b/modules/followup/mails/de/followup_4.html @@ -0,0 +1,48 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihr Warenkorb bei {shop_name}
         
        Sie sind einer unserer besten Kunden, seit {days_threshold} Tagen haben Sie nichts mehr bestellt.

        Wir möchten Ihnen für Ihr Vertrauen danken und Ihnen einen Rabatt über {amount}% für Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days} days, Tage, also warten Sie nicht länger!
         
        Hier ist Ihr Gutschein: {voucher_num}

        +

        Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten.

        +
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/de/followup_4.txt b/modules/followup/mails/de/followup_4.txt new file mode 100644 index 000000000..662e42515 --- /dev/null +++ b/modules/followup/mails/de/followup_4.txt @@ -0,0 +1,11 @@ +Wir vermissen Sie bei {shop_name} + +Hallo {firstname} {lastname}, + +Sie sind einer unserer besten Kunden, seit {days_threshold} Tagen haben Sie nichts mehr bestellt. + +Wir möchten Ihnen für Ihr Vertrauen danken und Ihnen einen Rabatt über {amount}% für Ihre nächste Bestellung geben! Dieses Angebot gilt nur noch {days} days, Tage, also warten Sie nicht länger! + +Hier ist Ihr Gutschein: {voucher_num} + +Geben Sie diesen Code in Ihrem Warenkorb-Fenster ein, um Ihren Rabatt zu erhalten. diff --git a/modules/followup/mails/en/followup_1.html b/modules/followup/mails/en/followup_1.html new file mode 100644 index 000000000..b5d2fb98c --- /dev/null +++ b/modules/followup/mails/en/followup_1.html @@ -0,0 +1,49 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        Your cart at {shop_name}
         
        + We noticed that during your last visit on {shop_name}, you did not validate the order you had started.

        + + Your cart has been saved, you can resume your order by visiting our shop:

        + + {shop_url}

        + + As an incentive, we can give you a discount of {amount}% off your next order! This offer is valid for {days} days, so do not waste a moment! +
         
        + Here is your coupon: {voucher_num}

        + Enter this code in your shopping cart to get your discount. +
         
        + {shop_name} powered with PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/en/followup_1.txt b/modules/followup/mails/en/followup_1.txt new file mode 100644 index 000000000..b5348d858 --- /dev/null +++ b/modules/followup/mails/en/followup_1.txt @@ -0,0 +1,13 @@ +Hello {firstname} {lastname}, + +We noticed that during your last visit on {shop_name}, you did not validate the order you had started. + +Your cart has been saved, you can resume your order by visiting our shop: + +{shop_url} + +As an incentive, we can give you a discount of {amount}% off your next order! This offer is valid for {days} days, so do not waste a moment! + +Here is your coupon: {voucher_num} + +Enter this code in your shopping cart to get your discount. \ No newline at end of file diff --git a/modules/followup/mails/en/followup_2.html b/modules/followup/mails/en/followup_2.html new file mode 100644 index 000000000..3b2ba23e4 --- /dev/null +++ b/modules/followup/mails/en/followup_2.html @@ -0,0 +1,43 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        Thank you for your order at {shop_name}
         
        + By way of saying thanks, we want to give you a discount of {amount}% off your next order! This offer is valid for {days} days, so do not waste a moment!

        +
         
        + Here is your coupon: {voucher_num}

        + Enter this code in your shopping cart to get your discount. +
         
        + {shop_name} powered with PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/en/followup_2.txt b/modules/followup/mails/en/followup_2.txt new file mode 100644 index 000000000..c7d921f41 --- /dev/null +++ b/modules/followup/mails/en/followup_2.txt @@ -0,0 +1,9 @@ +Hello {firstname} {lastname}, + +Thank you for your order at {shop_name} + +By way of saying thanks, we want to give you a discount of {amount}% off your next order! This offer is valid for {days} days, so do not waste a moment! + +Here is your coupon: {voucher_num} + +Enter this code in your shopping cart to get your discount. \ No newline at end of file diff --git a/modules/followup/mails/en/followup_3.html b/modules/followup/mails/en/followup_3.html new file mode 100644 index 000000000..fb8211645 --- /dev/null +++ b/modules/followup/mails/en/followup_3.html @@ -0,0 +1,45 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        Thanks for your trust
         
        + You are one of our best customers and as such we want to thank you for the confidence you share.

        + + As appreciation for your loyalty, we want to give you a discount of {amount}% valid on your next order! This offer is valid for {days} days, so do not waste a moment! +
         
        + Here is your coupon: {voucher_num}

        + Enter this code in your shopping cart to get your discount. +
         
        + {shop_name} powered with PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/en/followup_3.txt b/modules/followup/mails/en/followup_3.txt new file mode 100644 index 000000000..97ff24261 --- /dev/null +++ b/modules/followup/mails/en/followup_3.txt @@ -0,0 +1,9 @@ +Hello {firstname} {lastname}, + +You are one of our best customers and as such we want to thank you for the confidence you share. + +As appreciation for your loyalty, we want to give you a discount of {amount}% valid on your next order! This offer is valid for {days} days, so do not waste a moment! + +Here is your coupon: {voucher_num} + +Enter this code in your shopping cart to get your discount. \ No newline at end of file diff --git a/modules/followup/mails/en/followup_4.html b/modules/followup/mails/en/followup_4.html new file mode 100644 index 000000000..96ca99706 --- /dev/null +++ b/modules/followup/mails/en/followup_4.html @@ -0,0 +1,45 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        Your cart at {shop_name}
         
        + You are one of our best customers, however you have not ordered for {days_threshold} days.

        + + We wish to thank you for the trust you have placed in us and want to give you a discount of {amount}% valid on your next order! This offer is valid for {days} days, so do not waste a moment! +
         
        + Here is your coupon: {voucher_num}

        + Enter this code in your shopping cart to get your discount. +
         
        + {shop_name} powered with PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/en/followup_4.txt b/modules/followup/mails/en/followup_4.txt new file mode 100644 index 000000000..c1fbdb160 --- /dev/null +++ b/modules/followup/mails/en/followup_4.txt @@ -0,0 +1,11 @@ +We miss you at {shop_name} + +Hello {firstname} {lastname}, + +You are one of our best customers, however you have not ordered for {days_threshold} days. + +We wish to thank you for the trust you have placed in us and want to give you a discount of {amount}% valid on your next order! This offer is valid for {days} days, so do not waste a moment! + +Here is your coupon: {voucher_num} + +Enter this code in your shopping cart to get your discount. \ No newline at end of file diff --git a/modules/followup/mails/es/followup_1.html b/modules/followup/mails/es/followup_1.html new file mode 100644 index 000000000..72419d133 --- /dev/null +++ b/modules/followup/mails/es/followup_1.html @@ -0,0 +1,47 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        Su cesta de {shop_name}
         
        Nos dimos cuenta de que durante su última visita en {shop_name}, que no ha validado la orden que había comenzado.

        Su carrito ha sido guardado, puede reanudar su solicitud por visitar nuestra tienda:

        {shop_url}

        Como excepción, le ofrecemos un descuento del {amount}% de descuento en su próximo pedido! Esta oferta es válida para {days} días, así que no pierdas un instante!
         
        Aquí está tu cupón: {voucher_num}

        Introduzca este código en tu carrito de compras para obtener el descuento.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/followup/mails/es/followup_1.txt b/modules/followup/mails/es/followup_1.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/followup/mails/es/followup_2.html b/modules/followup/mails/es/followup_2.html new file mode 100644 index 000000000..4d78de4f0 --- /dev/null +++ b/modules/followup/mails/es/followup_2.html @@ -0,0 +1,47 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        Gracias por su orden en {shop_name}
         
        Con carácter excepcional, le concedemos un descuento de {amount}% fuera de su próximo pedido! Esta oferta es válida para {days} días, así que no pierdas un instante!

         
        Aquí está tu cupón: {voucher_num}

        Introduzca este código en tu carrito de compras para obtener el descuento.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/followup/mails/es/followup_2.txt b/modules/followup/mails/es/followup_2.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/followup/mails/es/followup_3.html b/modules/followup/mails/es/followup_3.html new file mode 100644 index 000000000..4aa53ac4d --- /dev/null +++ b/modules/followup/mails/es/followup_3.html @@ -0,0 +1,47 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        Gracias por su confianza.
         
        Usted es parte de nuestros mejores clientes y, como tal, queremos darle las gracias por la confianza que comparten.

        Como excepción, le concedemos un descuento de {amount}% válido en su próximo pedido! Esta oferta es válida para {days} días, así que no pierdas un instante!
         
        Aquí está tu cupón: {voucher_num}

        Introduzca este código en tu carrito de compras para obtener el descuento.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/followup/mails/es/followup_3.txt b/modules/followup/mails/es/followup_3.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/followup/mails/es/followup_4.html b/modules/followup/mails/es/followup_4.html new file mode 100644 index 000000000..ebbad1a68 --- /dev/null +++ b/modules/followup/mails/es/followup_4.html @@ -0,0 +1,47 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        Su cesta de {shop_name}
         
        Usted es parte de nuestros mejores clientes, sin embargo, no han ordenado para {days_threshold} días.

        Queremos darle las gracias por la confianza que ustedes depositan en nosotros y nosotros le concedemos un descuento de {amount}% válido en su próximo pedido! Esta oferta es válida para {days} días, así que no pierdas un instante!
         
        Aquí está tu cupón: {voucher_num}

        Introduzca este código en tu carrito de compras para obtener el descuento.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/followup/mails/es/followup_4.txt b/modules/followup/mails/es/followup_4.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/followup/mails/fr/followup_1.html b/modules/followup/mails/fr/followup_1.html new file mode 100644 index 000000000..92286551e --- /dev/null +++ b/modules/followup/mails/fr/followup_1.html @@ -0,0 +1,49 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        Votre panier chez {shop_name}
         
        + Nous avons remarqué que lors de votre dernier passage chez {shop_name}, vous n'avez pas validé la commande que vous aviez entamée.

        + + Vous panier a été conservé, vous pouvez reprendre votre commande en vous rendant sur notre boutique :

        + + {shop_url}

        + + A titre exceptionnel, nous vous accordons également une remise de {amount}% sur votre commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! +
         
        + Voici votre bon de réduction : {voucher_num}

        + Saisissez ce code dans votre panier afin d'obtenir votre réduction. +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_1.txt b/modules/followup/mails/fr/followup_1.txt new file mode 100644 index 000000000..57706b9b1 --- /dev/null +++ b/modules/followup/mails/fr/followup_1.txt @@ -0,0 +1,9 @@ +Bonjour {firstname} {lastname}, + +Vous faites partie de nos meilleurs clients et à ce titre, nous souhaitons vous remercier pour la confiance dont vous nous faites part. + +A titre exceptionnel, nous vous accordons une remise de {amount}% valable sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! + +Voici votre bon de réduction : {voucher_num} + +Saisissez ce code dans votre panier afin d'obtenir votre réduction. \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_2.html b/modules/followup/mails/fr/followup_2.html new file mode 100644 index 000000000..6865f0765 --- /dev/null +++ b/modules/followup/mails/fr/followup_2.html @@ -0,0 +1,43 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        Merci pour votre commande chez {shop_name}
         
        + Merci pour votre commande, à titre exceptionnel, nous vous accordons une remise de {amount}% sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! +
         
        + Voici votre bon de réduction : {voucher_num}

        + Saisissez ce code dans votre panier afin d'obtenir votre réduction. +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_2.txt b/modules/followup/mails/fr/followup_2.txt new file mode 100644 index 000000000..50c3d3cf9 --- /dev/null +++ b/modules/followup/mails/fr/followup_2.txt @@ -0,0 +1,9 @@ +Bonjour {firstname} {lastname}, + +Merci pour votre commande chez {shop_name} + +Merci pour votre commande, ? titre exceptionnel, nous vous accordons une remise de {amount}% sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! + +Voici votre bon de réduction : {voucher_num} + +Saisissez ce code dans votre panier afin d'obtenir votre réduction. \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_3.html b/modules/followup/mails/fr/followup_3.html new file mode 100644 index 000000000..be167a716 --- /dev/null +++ b/modules/followup/mails/fr/followup_3.html @@ -0,0 +1,44 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        {shop_name} vous remercie pour votre confiance
         
        + Vous faites partie de nos meilleurs clients et à ce titre, nous souhaitons vous remercier pour la confiance dont vous nous faites part.

        + A titre exceptionnel, nous vous accordons une remise de {amount}% valable sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! +
         
        + Voici votre bon de réduction : {voucher_num}

        + Saisissez ce code dans votre panier afin d'obtenir votre réduction. +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_3.txt b/modules/followup/mails/fr/followup_3.txt new file mode 100644 index 000000000..57706b9b1 --- /dev/null +++ b/modules/followup/mails/fr/followup_3.txt @@ -0,0 +1,9 @@ +Bonjour {firstname} {lastname}, + +Vous faites partie de nos meilleurs clients et à ce titre, nous souhaitons vous remercier pour la confiance dont vous nous faites part. + +A titre exceptionnel, nous vous accordons une remise de {amount}% valable sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! + +Voici votre bon de réduction : {voucher_num} + +Saisissez ce code dans votre panier afin d'obtenir votre réduction. \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_4.html b/modules/followup/mails/fr/followup_4.html new file mode 100644 index 000000000..f39cb0689 --- /dev/null +++ b/modules/followup/mails/fr/followup_4.html @@ -0,0 +1,44 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        Vous nous manquez chez {shop_name}
         
        + Vous faites partie de nos meilleurs clients cependant vous n'avez pas passé de commande depuis {days_threshold} jours.

        + Nous souhaitons vous remercier pour la confiance dont vous nous faites part et à ce titre, nous vous accordons une remise de {amount}% valable sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! +
         
        + Voici votre bon de réduction : {voucher_num}

        + Saisissez ce code dans votre panier afin d'obtenir votre réduction. +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + \ No newline at end of file diff --git a/modules/followup/mails/fr/followup_4.txt b/modules/followup/mails/fr/followup_4.txt new file mode 100644 index 000000000..6125a5fc0 --- /dev/null +++ b/modules/followup/mails/fr/followup_4.txt @@ -0,0 +1,9 @@ +Bonjour {firstname} {lastname}, + +Vous faites partie de nos meilleurs clients cependant vous n'avez pas pass? de commande depuis {days_threshold} jours. + +Nous souhaitons vous remercier pour la confiance dont vous nous faites part et ? ce titre, nous vous accordons une remise de {amount}% valable sur votre prochaine commande ! Cette offre est valable {days} jours, ne perdez plus un instant ! + +Voici votre bon de réduction : {voucher_num} + +Saisissez ce code dans votre panier afin d'obtenir votre réduction. \ No newline at end of file diff --git a/modules/followup/mails/it/followup_1.html b/modules/followup/mails/it/followup_1.html new file mode 100644 index 000000000..dd062344a --- /dev/null +++ b/modules/followup/mails/it/followup_1.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        Il tuo carrello su {shop_name}
        Abbiamo notato che durante la tua ultima visita a {shop_name}, non hai convalidato un ordine che avevi iniziato.

        Il tuo carrello è stato salvato, puoi riprendere l'ordine visitando il nostro negozio:

        {shop_url}

        Come incentivo, possiamo offrirti uno sconto del {amount}% sul tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito!
        Ecco il tuo buono: {voucher_num}

        Inserisci questo codice nel tuo carrello per ottenere lo sconto.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/it/followup_1.txt b/modules/followup/mails/it/followup_1.txt new file mode 100644 index 000000000..71035a8b4 --- /dev/null +++ b/modules/followup/mails/it/followup_1.txt @@ -0,0 +1,13 @@ +Salve {firstname} {lastname}, + +Abbiamo notato che durante la tua ultima visita a {shop_name}, non hai convalidato un ordine che avevi iniziato. + +Il tuo carrello è stato salvato, puoi riprendere l'ordine visitando il nostro negozio: + +{shop_url} + +Come incentivo, possiamo offrirti uno sconto del {amount}% nel tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito! + +Ecco il tuo buono: {voucher_num} + +Inserisci questo codice nel tuo carrello per ottenere lo sconto. \ No newline at end of file diff --git a/modules/followup/mails/it/followup_2.html b/modules/followup/mails/it/followup_2.html new file mode 100644 index 000000000..be914e5a1 --- /dev/null +++ b/modules/followup/mails/it/followup_2.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        Grazie del tuo ordine su {shop_name}
        Per ringraziarti, vogliamo offrirti uno sconto del {amount}% sul tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito!

        Ecco il tuo buono: {voucher_num}

        Inserisci questo codice nel tuo carrello per ottenere lo sconto.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/it/followup_2.txt b/modules/followup/mails/it/followup_2.txt new file mode 100644 index 000000000..3d17fe89b --- /dev/null +++ b/modules/followup/mails/it/followup_2.txt @@ -0,0 +1,9 @@ +Salve {firstname} {lastname}, + +Grazie del tuo ordine su {shop_name} + +Per ringraziarti, vogliamo offrirti uno sconto del {amount}% sul tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito! + +Ecco il tuo buono: {voucher_num} + +Inserisci questo codice nel carrello per ottenere lo sconto. \ No newline at end of file diff --git a/modules/followup/mails/it/followup_3.html b/modules/followup/mails/it/followup_3.html new file mode 100644 index 000000000..df1ef16c9 --- /dev/null +++ b/modules/followup/mails/it/followup_3.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        Grazie della tua fiducia
        Sei uno dei nostro migliori clienti e per questo vogliamo ringraziarti per la fiducia che ci accordi.

        Come apprezzamento della tua fedeltà, vogliamo offrirti uno sconto del {amount}% valido per il tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito!
        Ecco il tuo buono: {voucher_num}

        Inserisci questo codice nel tuo carrello per ottenere lo sconto.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/it/followup_3.txt b/modules/followup/mails/it/followup_3.txt new file mode 100644 index 000000000..23dfb25ae --- /dev/null +++ b/modules/followup/mails/it/followup_3.txt @@ -0,0 +1,9 @@ +Salve {firstname} {lastname}, + +Sei uno dei nostri migliori clienti e per questo vogliamo ringraziarti per la fiducia che ci accordi. + +Come apprezzamento della tua fedeltà, vogliamo offrirti uno sconto del {amount}% valido per il tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito! + +Ecco il tuo buono: {voucher_num} + +Inserisci questo codice nel tuo carrello per ottenere lo sconto. \ No newline at end of file diff --git a/modules/followup/mails/it/followup_4.html b/modules/followup/mails/it/followup_4.html new file mode 100644 index 000000000..a972d2b3c --- /dev/null +++ b/modules/followup/mails/it/followup_4.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        Il tuo carrello su {shop_name}
        Sei uno dei nostri migliori clienti, però sono {days_threshold} giorni che non effettui un ordine.

        Vogliamo ringraziarti della fiducia che ci hai accordato e vogliamo offrirti uno sconto del {amount}% valido sul tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito!
        Ecco il tuo buono: {voucher_num}

        Inserisci questo codice nel tuo carrello per ottenere il tuo sconto.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/followup/mails/it/followup_4.txt b/modules/followup/mails/it/followup_4.txt new file mode 100644 index 000000000..8dddccf88 --- /dev/null +++ b/modules/followup/mails/it/followup_4.txt @@ -0,0 +1,11 @@ +Ci manchi a {shop_name} + +Salve {firstname} {lastname}, + +Sei uno dei nostri clienti migliori, però sono {days_threshold} giorni che non effettui un ordine. + +Vogliamo ringraziarti per la fiducia che ci hai accordato e vogliamo offrirti uno sconto del {amount}% valido sul tuo prossimo ordine! Questa offerta è valida per {days} giorni, quindi approfittane subito! + +Ecco il tuo buono: {voucher_num} + +Inserisci questo codice nel tuo carrello per ottenere il tuo sconto. \ No newline at end of file diff --git a/modules/gadsense/adsense_script.gif b/modules/gadsense/adsense_script.gif new file mode 100644 index 000000000..6cef11cba Binary files /dev/null and b/modules/gadsense/adsense_script.gif differ diff --git a/modules/gadsense/config.xml b/modules/gadsense/config.xml new file mode 100755 index 000000000..a1e1841f0 --- /dev/null +++ b/modules/gadsense/config.xml @@ -0,0 +1,12 @@ + + + gadsense + Google Adsense + 1.1 + Integrate Google Adsense script into your shop + PrestaShop + advertising_marketing + Are you sure you want to delete your details ? + 1 + 1 + \ No newline at end of file diff --git a/modules/gadsense/de.php b/modules/gadsense/de.php new file mode 100644 index 000000000..8f6465ff7 --- /dev/null +++ b/modules/gadsense/de.php @@ -0,0 +1,13 @@ +gadsense_8a41674922e424cde4dd47c91f9d62e8'] = 'Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_4148996483a2cfeed90c66dc539c8f1a'] = 'Sie haben Ihren Google Adsense Code noch nicht eingestellt'; +$_MODULE['<{gadsense}prestashop>gadsense_e32c2b519ed33ed45a4c0a4b1b359447'] = 'Integrieren Sie das Google Adsense Script in Ihren Shop'; +$_MODULE['<{gadsense}prestashop>gadsense_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Daten löschen wollen?'; +$_MODULE['<{gadsense}prestashop>gadsense_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{gadsense}prestashop>gadsense_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{gadsense}prestashop>gadsense_30c2b4b5e19ac71fefa1b4d688a7a98f'] = 'Ihr Code'; +$_MODULE['<{gadsense}prestashop>gadsense_81eeab9506186e2dca8faefa78d54067'] = 'Beispiel:'; +$_MODULE['<{gadsense}prestashop>gadsense_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; diff --git a/modules/gadsense/en.php b/modules/gadsense/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/gadsense/en.php @@ -0,0 +1,4 @@ +gadsense_8a41674922e424cde4dd47c91f9d62e8'] = 'Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_4148996483a2cfeed90c66dc539c8f1a'] = 'Aún no ha configurado su código de Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_e32c2b519ed33ed45a4c0a4b1b359447'] = 'Integrar el script de Google Adsense en su tienda'; +$_MODULE['<{gadsense}prestashop>gadsense_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de querer eliminar todos sus datos?'; +$_MODULE['<{gadsense}prestashop>gadsense_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{gadsense}prestashop>gadsense_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{gadsense}prestashop>gadsense_30c2b4b5e19ac71fefa1b4d688a7a98f'] = 'Su código'; +$_MODULE['<{gadsense}prestashop>gadsense_81eeab9506186e2dca8faefa78d54067'] = 'Ejemplo:'; +$_MODULE['<{gadsense}prestashop>gadsense_b17f3f4dcf653a5776792498a9b44d6a'] = 'Ajustes de actualización'; diff --git a/modules/gadsense/fr.php b/modules/gadsense/fr.php new file mode 100644 index 000000000..5039f3a81 --- /dev/null +++ b/modules/gadsense/fr.php @@ -0,0 +1,13 @@ +gadsense_8a41674922e424cde4dd47c91f9d62e8'] = 'Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_4148996483a2cfeed90c66dc539c8f1a'] = 'Vous n\'avez pas encore paramétré votre code Google Adsense.'; +$_MODULE['<{gadsense}prestashop>gadsense_e32c2b519ed33ed45a4c0a4b1b359447'] = 'Intégrer le script Google Adsense dans sa boutique'; +$_MODULE['<{gadsense}prestashop>gadsense_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?'; +$_MODULE['<{gadsense}prestashop>gadsense_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour.'; +$_MODULE['<{gadsense}prestashop>gadsense_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres.'; +$_MODULE['<{gadsense}prestashop>gadsense_30c2b4b5e19ac71fefa1b4d688a7a98f'] = 'Votre code'; +$_MODULE['<{gadsense}prestashop>gadsense_81eeab9506186e2dca8faefa78d54067'] = 'Exemple :'; +$_MODULE['<{gadsense}prestashop>gadsense_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les paramètres'; diff --git a/modules/gadsense/gadsense.php b/modules/gadsense/gadsense.php new file mode 100644 index 000000000..ab9ff3934 --- /dev/null +++ b/modules/gadsense/gadsense.php @@ -0,0 +1,116 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GAdsense extends Module +{ + function __construct() + { + $this->name = 'gadsense'; + $this->tab = 'advertising_marketing'; + $this->version = '1.1'; + $this->author = 'PrestaShop'; + $this->displayName = $this->l('Google Adsense'); + + parent::__construct(); + + if ($this->id AND !Configuration::get('GADSENSE_ID')) + $this->warning = $this->l('You have not yet set your Google Adsense code'); + $this->description = $this->l('Integrate Google Adsense script into your shop'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('home')) + return false; + return true; + } + + function uninstall() + { + if (!Configuration::deleteByName('GADSENSE_ID') OR !parent::uninstall()) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitGAdsense') AND ($gai = Tools::getValue('gadsense_id'))) + { + $gai = htmlentities($gai, ENT_COMPAT, 'UTF-8'); + Configuration::updateValue('GADSENSE_ID', $gai); + $output .= ' +
        + + '.$this->l('Settings updated').' +
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' + +
        + +

        '.$this->l('Example:').'

        +
        +
        +
        +
        '; + return $output; + } + + function hookLeftColumn($params) + { + return $this->hookHome($params); + } + + function hookRightColumn($params) + { + return $this->hookHome($params); + } + + function hookTop($params) + { + return $this->hookHome($params); + } + + function hookHome($params) + { + $output = html_entity_decode(Configuration::get('GADSENSE_ID'), ENT_COMPAT, 'UTF-8'); + return $output; + } + +} diff --git a/modules/gadsense/it.php b/modules/gadsense/it.php new file mode 100644 index 000000000..6f6b80398 --- /dev/null +++ b/modules/gadsense/it.php @@ -0,0 +1,13 @@ +gadsense_8a41674922e424cde4dd47c91f9d62e8'] = 'Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_4148996483a2cfeed90c66dc539c8f1a'] = 'Non hai ancora impostato il codice di Google Adsense'; +$_MODULE['<{gadsense}prestashop>gadsense_e32c2b519ed33ed45a4c0a4b1b359447'] = 'Integrare lo script di Google Adsense nel tuo negozio'; +$_MODULE['<{gadsense}prestashop>gadsense_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{gadsense}prestashop>gadsense_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{gadsense}prestashop>gadsense_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{gadsense}prestashop>gadsense_30c2b4b5e19ac71fefa1b4d688a7a98f'] = 'Il tuo codice'; +$_MODULE['<{gadsense}prestashop>gadsense_81eeab9506186e2dca8faefa78d54067'] = 'Esempio:'; +$_MODULE['<{gadsense}prestashop>gadsense_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; diff --git a/modules/gadsense/logo.gif b/modules/gadsense/logo.gif new file mode 100644 index 000000000..d24a14a90 Binary files /dev/null and b/modules/gadsense/logo.gif differ diff --git a/modules/ganalytics/config.xml b/modules/ganalytics/config.xml new file mode 100755 index 000000000..2f6fad3f2 --- /dev/null +++ b/modules/ganalytics/config.xml @@ -0,0 +1,12 @@ + + + ganalytics + Google Analytics + 1.3 + Integrate Google Analytics script into your shop + PrestaShop + analytics_stats + Are you sure you want to delete your details ? + 1 + 1 + \ No newline at end of file diff --git a/modules/ganalytics/de.php b/modules/ganalytics/de.php new file mode 100644 index 000000000..c53f0732c --- /dev/null +++ b/modules/ganalytics/de.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Sie haben Ihre Google Analytics-ID noch nicht eingestellt'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrieren Sie das Google Analytics-Skript in Ihren Shop'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Daten löschen wollen?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Ihr Benutzername'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Beispiel:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = ' ID aktualisieren'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'Der erste Schritt zum Erfassen von E-Commerce-Transaktionen ist, E-Commerce-Berichte für das Profil Ihrer Website zu aktivieren.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Bitte folgen Sie diesen Schritten, um die E-Commerce-Bereichte zu aktivieren:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Melden Sie sich bei Ihrem Konto an'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Klicken Sie auf Bearbeiten neben dem Profil, das Sie aktivieren möchten'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Klicken Sie auf der Seite Profileinstellungen auf Bearbeiten neben der Hauptwebseiten-Profilinformation'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Drehen Sie den Radioknopf der E-Commerce-Webseite von Nein auf Ja'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Geben Sie Ihre Ziel-Informationen ein, um Ihre Ziele einzustellen:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Zurück zu Ihrer persönlichen Startseite'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Suchen Sie das Profil, für das Sie ein Ziel erstellen möchten, klicken Sie dann auf Bearbeiten'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Wählen Sie eine der 4 verfügbaren Zielpositionen für dieses Profil und klicken dann auf \"Bearbeiten\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Geben Sie die Ziel-URL ein. Das Erreichen dieser Seite ist ein Zeichen für eine erfolgreiche Umwandlung'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Geben Sie den Zielnamen ein, wie er in Ihrem Google Analytics-Konto angezeigt werden soll'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Aktivieren Sie das Ziel'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Dann definieren Sie mit den folgenden Schritten einen Trichter:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Geben Sie die URL der ersten Seite Ihres Umwandlungstrichters ein. Dies sollte allen Nutzern vertraut sein, die auf Ihr Ziel zugehen.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Geben Sie einen Namen für diesen Schritt ein.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Wenn dieser Schritt erforderlich für die Umwandlung ist, klicken Sie das Kontrollkästchen rechts von diesem Schritt an.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Geben Sie weitere Zielschritte ein, bis Ihr Trichter vollständig definiert ist. Sie können bis zu 10 Schritte oder auch nur einen einzigen Schritt eingeben.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Konfigurieren Sie abschließend die Zusätzlichen Einstellungen durch die folgenden Schritte unten:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Wenn die oben angegebenen URLs die Groß-/Kleinschreibung berücksichtigen, markieren Sie das Kontrollkästchen.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Wählen Sie den entsprechenden Ziel-Übereinstimmungstyp. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'über Übereinstimmungstypen und wie den entsprechenden Ziel-Übereinstimmungstyp für Ihr Ziel wählen können.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Geben Sie einen Zielwert ein. Dies ist der Wert, der in den Google Analytics ROI-Berechnungen verwendet wird.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Klicken Sie auf Änderungen speichern, um dieses Ziel und diesen Trichter zu erstellen , oder Abbrechen, um ohne Speichern zu beenden.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demonstration: Der Bestellvorgang'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Nachdem Sie Ihre E-Commerce-Berichte aktiviert und das jeweilige Profil ausgewählt haben, geben Sie \'bestellung-bestätigung.php\' ein, als gewünschte URL-Seite'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Dieses Ziel benennen (zum Beispiel \'Bestellvorgang\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Aktivieren Sie das Ziel'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Fügen Sie \'product.php\' als erste Seite Ihres Umwandlungstrichters hinzu'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Benennen Sie sie (zum Beispiel \'Produktseite\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'Markieren Sie das Kontrollkästchen nicht als \"erforderlich\", denn der Kunde kann direkt von einer \"In den Warenkorb\"-Schaltfläche gekommen sein wie etwa auf dem Startseitenblock '; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Fahren Sie fort, indem Sie die folgenden URLs als Zielschritte eingeben:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Erforderlich)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Überprüfen Sie die \'Groß-/Kleinschreibung\'-Option'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Speichern Sie dieses neue Ziel'; diff --git a/modules/ganalytics/en.php b/modules/ganalytics/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/ganalytics/en.php @@ -0,0 +1,4 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Aún no ha configurado su ID de Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrar el script de Google Analytics en su tienda'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de querer eliminar todos sus datos?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Su nombre de usuario'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Ejemplo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Actualizar ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'El primer paso para seguir las transacciones de comercio electrónico es activar el informe de su tienda en su perfil.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Para activar el informe de comercio electrónico, por favor revise estos pasos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Entrar en su cuenta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Haga clic en Editar en el perfil que quiere activar'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'En la página de Configuración del Perfil, haga clic en \\\"Editar\\\" para el Perfil de Información de la Web Principal'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'seleccione sí/no en Web de comercio electrónico'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Para configurar sus objetivos, introduzca información sobre ellos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Volver a la página principal de su cuenta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Encuentra el perfil del objetivo que quieres crear, y pulsa \\\"Editar\\\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Seleccione uno de los cuatro objetivos disponibles para su perfil, después haga clic en Edit'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Introduzca la URL objetivo. Acceder a esta página generará una conversión correcta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Introduzca el nombre del objetivo tal como aparece en su cuenta Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Activar el objetivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Después, defina un redireccionamiento siguiendo estos pasos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Introduzca la URL de la primera página de su redireccionamiento de conversión. Esta página deberá ser común para todos los usuarios hacia su objetivo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Introduzca un nombre para este paso'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si este paso es necesario en el proceso de conversión, seleccione la casilla de la derecha del paso.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continue avanzando hasta completar el objetivo. Debe introducir de 1 a 10 etapas.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Para terminar, configure los parámetros complementarios para continuar los siguientes pasos: '; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si las URLs introducidas arriba distinguen entre mayúsculas y minúsculas, marque la casilla de verificación.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleccione el objetivo apropiado. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Más información'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sobre los Tipos de Partidos y sobre la manera de elegir el tipo de correspondencia adecuada a su objetivo.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Introduzca un valor objetivo. Este es el valor utilizado para los cáculos de Google Analitics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Haga clic en \\\"Salvar cambios\\\" para crear este objetivo, o cancelar para salir sin guardar cambios.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demostración: El proceso de pedido'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Después de activar sus informes sobre e-commerce y de seleccionar el perfil, introduzca \'order-confirmation.php\' como la página URL de destino'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nombre del objetivo (por ejemplo \\\"proceso del pedido\\\")'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activar el objetivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Añadir \'producto.php\' como la primera página de redireccionamiento'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dele un nombre (por ejemplo \\\"Página del producto\\\")'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'No marque \\\"obligatorio\\\" porque el cliente deberá visitar desde el botón \\\"Añadir al carrito\\\" como en el homefeatured de producto de la página de inicio.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Continúe introduciendo las siguientes URL como objetivos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(obligatorio)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Revise la opción de \\\"distinción mayúsculas-minúsculas\\\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Guardar este nuevo objetivo'; diff --git a/modules/ganalytics/fr.php b/modules/ganalytics/fr.php new file mode 100644 index 000000000..a9c594c7b --- /dev/null +++ b/modules/ganalytics/fr.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Vous n\'avez pas encore renseigné votre ID Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Intègre le script de Google Analytics à votre boutique'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Votre identifiant'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Exemple :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Enregistrer l\'identifiant'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'La première étape pour analyser les transactions e-commerce consiste à activer l\'archivage sur le profil de votre site.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Pour activer l\'option e-commerce, suivez ces étapes :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Connectez-vous à votre compte'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Cliquez sur Edit, à côté du profil que vous désirez activer'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Sur la page \"Paramètres des profils\", cliquez sur \"Modifier\" en regard de l\'option \"Informations sur le profil du site principal\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifiez le bouton radio \"E-commerce\" sur \"Oui\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Afin de définir vos objectifs, saisissez les informations de l\'objectif :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Retournez sur la page d\'accueil de votre compte'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Trouvez le profil correspondant à l\'objectif et éditez-le'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Sélectionnez un des 4 emplacements disponibles pour ce profil et cliquez sur Editer'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Entrez l\'URL de la page d\'objectif. Une conversion est enregistrée chaque fois qu\'un visiteur accède à cette page'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Entrez le nom de l\'objectif tel qu\'il doit apparaître dans votre compte Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Activez l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Ensuite, définissez un entonnoir de conversion en suivant ces étapes :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Entrez l\'URL de la première page de votre entonnoir de conversion. Cette page doit être commune à tous les internautes que vous souhaitez amener jusqu\'à votre objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Attribuez un nom à cette étape.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si cette étape est obligatoire dans l\'objectif, cochez la case à droite de cette étape.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Entrez toutes les étapes précédant l\'objectif jusqu\'à ce que vous ayez terminé de définir l\'entonnoir de conversion. Vous pouvez entrer de 1 à 10 étapes'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Pour finir, configurez les Paramètres complémentaires en procédant comme suit :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si les URL entrées ci-dessus sont sensibles à la casse, cochez la case.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Sélectionnez l\'objectif approprié. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'En savoir plus'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sur les types de correspondances et sur la façon de choisir le type de correspondance approprié à votre objectif)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Entrez un objectif. Cette valeur est utilisée par les calculs ROI de Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Cliquez sur Enregistrer les modifications pour créer cet objectif et cet entonnoir de conversion ou sur Annuler pour quitter sans enregistrer.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Démonstration : Le processus de commande'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Après avoir activé vos reports e-commerce et sélectionné les profils respectifs, entrez \'order-confirmation.php\' comme page cible.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nommez cet objectif (par exemple \'Processus de commande\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activez l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Ajoutez \'product.php\' comme la première page du cheminement de vos visiteurs'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Donnez lui un nom (par exemple \'Page produit\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'N\'activez pas la case \'requis\' parce que les clients pourraient visiter directement par un bouton \'Ajouter au panier\', tel que dans le module HomeFeatured sur la page d\'accueil.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Faites de même en entrant les urls suivantes comme étapes de l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = 'requis'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Vérifiez l\'option \'sensibilité de la casse\''; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Sauvegardez cet objectif'; diff --git a/modules/ganalytics/ganalytics.php b/modules/ganalytics/ganalytics.php new file mode 100644 index 000000000..f19e55301 --- /dev/null +++ b/modules/ganalytics/ganalytics.php @@ -0,0 +1,206 @@ +name = 'ganalytics'; + $this->tab = 'analytics_stats'; + $this->version = '1.3'; + $this->author = 'PrestaShop'; + $this->displayName = 'Google Analytics'; + + parent::__construct(); + + if ($this->id AND !Configuration::get('GANALYTICS_ID')) + $this->warning = $this->l('You have not yet set your Google Analytics ID'); + $this->description = $this->l('Integrate Google Analytics script into your shop'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('header') OR !$this->registerHook('orderConfirmation')) + return false; + return true; + } + + function uninstall() + { + if (!Configuration::deleteByName('GANALYTICS_ID') OR !parent::uninstall()) + return false; + return true; + } + + public function getContent() + { + $output = '

        Google Analytics

        '; + if (Tools::isSubmit('submitGAnalytics') AND ($gai = Tools::getValue('ganalytics_id'))) + { + Configuration::updateValue('GANALYTICS_ID', $gai); + $output .= ' +
        + + '.$this->l('Settings updated').' +
        '; + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        + '.$this->l('Settings').' + +
        + +

        '.$this->l('Example:').' UA-1234567-1

        +
        +
        +
        +
        '; + + $output .= ' +
        + '.$this->l('Help').' +

        '.$this->l('The first step of tracking e-commerce transactions is to enable e-commerce reporting for your website\'s profile.').'

        + '.$this->l('To enable e-Commerce reporting, please follow these steps:').' +
          +
        1. '.$this->l('Log in to your account').'
        2. +
        3. '.$this->l('Click Edit next to the profile you would like to enable.').'
        4. +
        5. '.$this->l('On the Profile Settings page, click Edit (next to Main Website Profile Information).').'
        6. +
        7. '.$this->l('Change the e-Commerce Website radio button from No to Yes').'
        8. +
        +

        '.$this->l('To set up your goals, enter Goal Information:').'

        +
          +
        1. '.$this->l('Return to Your Account main page').'
        2. +
        3. '.$this->l('Find the profile for which you will be creating goals, then click Edit').'
        4. +
        5. '.$this->l('Select one of the 4 goal slots available for that profile, then click Edit').'
        6. +
        7. '.$this->l('Enter the Goal URL. Reaching this page marks a successful conversion.').'
        8. +
        9. '.$this->l('Enter the Goal name as it should appear in your Google Analytics account.').'
        10. +
        11. '.$this->l('Turn on Goal.').'
        12. +
        +

        '.$this->l('Then, define a funnel by following these steps:').'

        +
          +
        1. '.$this->l('Enter the URL of the first page of your conversion funnel. This page should be a common page to all users working their way towards your Goal.').'
        2. +
        3. '.$this->l('Enter a Name for this step.').'
        4. +
        5. '.$this->l('If this step is a required step in the conversion process, mark the checkbox to the right of the step.').'
        6. +
        7. '.$this->l('Continue entering goal steps until your funnel has been completely defined. You may enter up to 10 steps, or only one step.').'
        8. +
        + '.$this->l('Finally, configure Additional settings by following the steps below:').' +
          +
        1. '.$this->l('If the URLs entered above are case sensitive, mark the checkbox.').'
        2. +
        3. '.$this->l('Select the appropriate goal Match Type. (').''.$this->l('Learn more').' '.$this->l('about Match Types and how to choose the appropriate goal Match Type for your goal.)').'
        4. +
        5. '.$this->l('Enter a Goal value. This is the value used in Google Analytics\' ROI calculations.').'
        6. +
        7. '.$this->l('Click Save Changes to create this Goal and funnel, or Cancel to exit without saving.').'
        8. +
        +

        '.$this->l('Demonstration: The order process').'

        +
          +
        1. '.$this->l('After having enabled your e-commerce reports and selected the respective profile enter \'order-confirmation.php\' as the targeted page URL.').'
        2. +
        3. '.$this->l('Name this goal (for example \'Order process\')').'
        4. +
        5. '.$this->l('Activate the goal').'
        6. +
        7. '.$this->l('Add \'product.php\' as the first page of your conversion funnel').'
        8. +
        9. '.$this->l('Give it a name (for example, \'Product page\')').'
        10. +
        11. '.$this->l('Do not mark the \'required\' checkbox because the customer could be visiting directly from an \'adding to cart\' button such as in the homefeatured block on the homepage.').'
        12. +
        13. '.$this->l('Continue by entering the following URLs as goal steps:').' +
            +
          • order/step0.html '.$this->l('(required)').'
          • +
          • authentication.php '.$this->l('(required)').'
          • +
          • order/step1.html '.$this->l('(required)').'
          • +
          • order/step2.html '.$this->l('(required)').'
          • +
          • order/step3.html '.$this->l('(required)').'
          • +
          +
        14. +
        15. '.$this->l('Check the \'Case sensitive\' option').'
        16. +
        17. '.$this->l('Save this new goal').'
        18. +
        +
        '; + + return $output; + } + + function hookHeader($params) + { + global $step, $smarty; + + // hookOrderConfirmation() already send the sats bypass this step + if (strpos($_SERVER['REQUEST_URI'], __PS_BASE_URI__.'order-confirmation.php') === 0) return ''; + + // Otherwise, create Google Analytics stats + $ganalytics_id = Configuration::get('GANALYTICS_ID'); + $pageTrack = (strpos($_SERVER['REQUEST_URI'], __PS_BASE_URI__.'order.php') === 0 ? '"/order/step'.intval($step).'.html"' : ''); + $smarty->assign('ganalytics_id', $ganalytics_id); + $smarty->assign('pageTrack', $pageTrack); + $smarty->assign('isOrder', false); + return $this->display(__FILE__, 'header.tpl'); + } + + function hookFooter($params) + { + // for retrocompatibility + if (!$this->isRegisteredInHook('header')) $this->registerHook('header'); + return ; + } + + function hookOrderConfirmation($params) + { + global $smarty; + // Setting parameters + $parameters = Configuration::getMultiple(array('PS_LANG_DEFAULT')); + + $order = $params['objOrder']; + if (Validate::isLoadedObject($order)) + { + $deliveryAddress = new Address(intval($order->id_address_delivery)); + + $conversion_rate = 1; + if ($order->id_currency != Configuration::get('PS_CURRENCY_DEFAULT')) + { + $currency = new Currency(intval($order->id_currency)); + $conversion_rate = floatval($currency->conversion_rate); + } + + // Order general information + $trans = array('id' => intval($order->id), // order ID - required + 'store' => htmlentities(Configuration::get('PS_SHOP_NAME')), // affiliation or store name + 'total' => Tools::ps_round(floatval($order->total_paid) / floatval($conversion_rate), 2), // total - required + 'tax' => '0', // tax + 'shipping' => Tools::ps_round(floatval($order->total_shipping) / floatval($conversion_rate), 2), // shipping + 'city' => addslashes($deliveryAddress->city), // city + 'state' => '', // state or province + 'country' => addslashes($deliveryAddress->country) // country + ); + + // Product information + $products = $order->getProducts(); + foreach ($products AS $product) + { + $category = Db::getInstance()->getRow(' + SELECT name FROM `'._DB_PREFIX_.'category_lang` , '._DB_PREFIX_.'product + WHERE `id_product` = '.intval($product['product_id']).' AND `id_category_default` = `id_category` + AND `id_lang` = '.intval($parameters['PS_LANG_DEFAULT'])); + + $items[] = array('OrderId' => intval($order->id), // order ID - required + 'SKU' => addslashes($product['product_id']), // SKU/code - required + 'Product' => addslashes($product['product_name']), // product name + 'Category' => addslashes($category['name']), // category or variation + 'Price' => Tools::ps_round(floatval($product['product_price_wt']) / floatval($conversion_rate), 2), // unit price - required + 'Quantity' => addslashes(intval($product['product_quantity'])) //quantity - required + ); + } + $ganalytics_id = Configuration::get('GANALYTICS_ID'); + $pageTrack = (strpos($_SERVER['REQUEST_URI'], __PS_BASE_URI__.'order.php') === 0 ? '"/order/step'.intval($step).'.html"' : ''); + $smarty->assign('items', $items); + $smarty->assign('trans', $trans); + $smarty->assign('ganalytics_id', $ganalytics_id); + $smarty->assign('pageTrack', $pageTrack); + $smarty->assign('isOrder', true); + return $this->display(__FILE__, 'header.tpl'); + } + } +} diff --git a/modules/ganalytics/header.tpl b/modules/ganalytics/header.tpl new file mode 100644 index 000000000..cb3b0f623 --- /dev/null +++ b/modules/ganalytics/header.tpl @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/modules/ganalytics/it.php b/modules/ganalytics/it.php new file mode 100644 index 000000000..0241854d0 --- /dev/null +++ b/modules/ganalytics/it.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Non hai ancora impostato l\'ID di Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integra lo script di Google Analytics nel tuo negozio'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Il tuo nome utente'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Esempio:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Aggiorna ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'La prima fase del monitoraggio delle transazioni e-commerce è quello di attivare i rapporti e-commerce per il profilo del tuo sito web.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Per attivare il rapporto dell\'e-commerce, segui queste fasi:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Accedi al tuo account'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Clicca su Modifica accanto al profilo che desideri attivare'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Nella pagina Impostazioni profilo, fai clic su modifica accanto alle informazioni profilo sito web principale'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifica il tasto radio del sito e-commerce da No a Sì.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Per impostare gli obiettivi, inserisci i dati dell\'obiettivo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Ritorna alla pagina principale dell\'account '; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Individua il profilo per il quale desideri creare gli obiettivi, quindi clicca su Modifica'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Selezionare uno dei 4 spazi adibiti agli obiettivi disponibili per il profilo, quindi clicca su Modifica'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Inserire l\'URL dell\'obiettivo. Il raggiungimento di questa pagina segna una conversione riuscita'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Inserisci il nome dell\'obiettivo come dovrebbe apparire nel tuo account Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Attiva l\'obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Quindi, definire un imbuto nel seguente modo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Inserisci l\'URL della prima pagina della canalizzazione di conversione. Questa pagina dovrebbe essere una pagina comune a tutti gli utenti che cercano di raggiungere il tuo obiettivo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Inserisci un nome per questa fase.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Se questa fase è un passaggio obbligatorio nella procedura di conversione, seleziona la casella a destra del passaggio.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continua a inserire i passaggi che conducono all\'obiettivo finché il percorso obiettivo è stato completamente definito. È possibile inserire fino a 10 passi, o anche solo un passo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Infine, configura le Impostazioni aggiuntive procedendo nel seguente modo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Se gli URL inseriti sopra sono case sensitive, segna la casella di controllo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleziona l\'obiettivo appropriato. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sui tipi di corrispondenze e su come scegliere il tipo di corrispondenza per il tuo obiettivo.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Inserire un valore obiettivo. Questo è il valore utilizzato nei calcoli ROI di Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Fai clic su Salva modifiche per creare l\'obiettivo e la canalizzazione o su Annulla per uscire senza salvare.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Dimostrazione: Il processo di ordinazione'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Dopo aver attivato i rapporti e-commerce e selezionato il profilo inserire \'order-confirmation.php\' come pagina obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nome di questo obiettivo (per esempio \'elaborazione ordine\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Attiva l\'obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Aggiungi \'Product.php\' come prima pagina della tua conversione '; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dagli un nome (ad esempio, \'pagina del prodotto\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'Non segnare la casella \'richiesta\' perché il cliente potrebbe essere visitato direttamente da un tasto \"aggiungi al carrello\', come nel blocco homefeatured sulla homepage'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Proseguire inserendo i seguenti URL come fasi:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Obbligatorio)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Spuntare l\'opIone \'case sensitive\' '; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Salva questo nuovo obiettivo'; diff --git a/modules/ganalytics/logo.gif b/modules/ganalytics/logo.gif new file mode 100644 index 000000000..22eb91371 Binary files /dev/null and b/modules/ganalytics/logo.gif differ diff --git a/modules/gcheckout/config.xml b/modules/gcheckout/config.xml new file mode 100755 index 000000000..61accaa7f --- /dev/null +++ b/modules/gcheckout/config.xml @@ -0,0 +1,11 @@ + + + gcheckout + Google Checkout + 1.1 + Google Checkout API implementation + PrestaShop + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/gcheckout/confirm.tpl b/modules/gcheckout/confirm.tpl new file mode 100644 index 000000000..e6976b218 --- /dev/null +++ b/modules/gcheckout/confirm.tpl @@ -0,0 +1,56 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Your shopping cart' mod='gcheckout'}{$navigationPipe}{l s='Google Checkout' mod='gcheckout'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Order summary' mod='gcheckout'}

        + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +

        + {l s='Google Checkout' mod='gcheckout'} +
        {l s='You have chosen to pay with Google Checkout.' mod='gcheckout'} +

        + {l s='Here is a short summary of your order:' mod='gcheckout'} +

        +

        + - {l s='The total amount of your order is' mod='gcheckout'} + {convertPriceWithCurrency price=$total currency=$currency} {if $use_taxes == 1}{l s='(tax incl.)' mod='gcheckout'}{/if} +

        +

        + - {l s='We accept the following currency to be sent by Google Checkout:' mod='gcheckout'} {$currency->name} +

        +

        + {l s='Please confirm your order by clicking \'I confirm my order\'' mod='gcheckout'}. +

        +

        + {l s='Other payment methods' mod='gcheckout'} + {l s='I confirm my order' mod='gcheckout'} +

        + +{$googleCheckoutExtraForm} \ No newline at end of file diff --git a/modules/gcheckout/de.php b/modules/gcheckout/de.php new file mode 100644 index 000000000..0613bda60 --- /dev/null +++ b/modules/gcheckout/de.php @@ -0,0 +1,42 @@ +confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Ihr Warenkorb'; +$_MODULE['<{gcheckout}prestashop>confirm_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Bestellsumme'; +$_MODULE['<{gcheckout}prestashop>confirm_3575814f89e55ba8061c55dd93214aae'] = 'Sie haben Google Checkout für Ihre Zahlung ausgewählt.'; +$_MODULE['<{gcheckout}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Hier eine kurze Zusammenfassung Ihrer Bestellung:'; +$_MODULE['<{gcheckout}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; +$_MODULE['<{gcheckout}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{gcheckout}prestashop>confirm_eecc59d9ca953545b6c5ac9bf11ded00'] = 'Wir akzeptieren die folgende Währung bei einer Zahlung mit Google Checkout:'; +$_MODULE['<{gcheckout}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \"Ich bestätige meine Bestellung\"'; +$_MODULE['<{gcheckout}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; +$_MODULE['<{gcheckout}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; +$_MODULE['<{gcheckout}prestashop>gcheckout_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_3f3c0194c5adbe6953eb571f125af16d'] = 'Google Checkout-API-Implementierung'; +$_MODULE['<{gcheckout}prestashop>gcheckout_4402acab1c8f90dcf4a31dc96833bd86'] = 'Keine Währung für dieses Modul eingestellt'; +$_MODULE['<{gcheckout}prestashop>gcheckout_82b8bb0d807e6d2e43a068f954c3559f'] = 'Händler-ID scheint falsch zu sein'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9dd37c2106ceacbf0a40778b2109c386'] = 'Händler-Schlüssel scheint falsch zu sein'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a1ffd2dc2538ea3093532029514d42ac'] = 'Nutzen Sie zuerst die Sandbox, um das Modul zu testen, dann können Sie den Echtbetrieb-Modus benutzen, wenn alles in Ordnung ist. Vergessen Sie nicht, je nach Modus Händler-Schlüssel und -ID zu ändern!'; +$_MODULE['<{gcheckout}prestashop>gcheckout_650be61892bf690026089544abbd9d26'] = 'Modus'; +$_MODULE['<{gcheckout}prestashop>gcheckout_7f80fcc452c2f1ed2bb51b39d0864df1'] = 'Echtzeit'; +$_MODULE['<{gcheckout}prestashop>gcheckout_2652eec977dcb2a5aea85f5bec235b05'] = 'Sandbox'; +$_MODULE['<{gcheckout}prestashop>gcheckout_76055653a95e0a559b734ec322d89632'] = 'Sie finden diese Schlüssel in Ihrem Google Checkout-Konto> Einstellungen> Integration. Sowohl Sandkasten als auch Echtzeit-Modus haben diese Tasten.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_229a7ec501323b94db7ff3157a7623c9'] = 'Händler-ID'; +$_MODULE['<{gcheckout}prestashop>gcheckout_795acb9a0c89791314d3032fe65eeb92'] = 'Händler-Schlüssel'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a7ba8619e32091c343b340ec5b80e541'] = 'Wenn Sie dieses Feld ankreuzen, werden die Käufer in der Lage sein, die Versandkosten zu sehen, die Sie in Google Checkout auf der Kaufseite eingerichtet haben.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_de6fa0b14f259108c4b38e5be0374f46'] = 'Google Versandkosten benutzen'; +$_MODULE['<{gcheckout}prestashop>gcheckout_74692aae1cff5dc9dfd44f8c4e0540ad'] = 'Sie können die Server-zu-Server-Kommunikation protokollieren. Die Protokolldateien sind'; +$_MODULE['<{gcheckout}prestashop>gcheckout_be5d5d37542d75f93a87094459f76678'] = 'und'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f2f19b2cbcb395e254ebb1d9bf7cccd4'] = 'Wenn Sie sie aktivieren, vergewissern Sie sich, dass Sie sie schützen, indem Sie eine .htaccess-Datei ins gleiche Verzeichnis speichern. Wenn Sie dies vergessen, werden sie von jedermann lesbar sein'; +$_MODULE['<{gcheckout}prestashop>gcheckout_b2d37ae1cedf42ff874289b721860af2'] = 'Logs'; +$_MODULE['<{gcheckout}prestashop>gcheckout_38fb7d24e0d60a048f540ecb18e13376'] = 'Speichern'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{gcheckout}prestashop>gcheckout_968913ba2d4e25f3589d4c612ecbaa8d'] = 'Um Ihr Google Checkout-Modul zu verwenden, müssen Sie in Ihr Google Checkout-Konto (Sandbox-Konto sowie Live-Konto) konfigurieren. Melden Sie sich bei Google Checkout an, gehen Sie dann auf Einstellungen> Integration. Die API-Rückruf-URL lautet:'; +$_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] = 'Die Callback-Methode muss eingestellt werden auf'; +$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Die bestellungen müssen mit der gleichen Währung wie Ihr Verkäufer-Konto eingestelltwerden. Warenkörbe in anderen Währungen werden umgerechnet, wenn der Kunde mit diesem Modul bezahlen möchte.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Bezahlen Sie mit GoogleCheckout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Verpackung'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Versandkosten'; diff --git a/modules/gcheckout/en.php b/modules/gcheckout/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/gcheckout/en.php @@ -0,0 +1,4 @@ +confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Su carrito de la compra'; +$_MODULE['<{gcheckout}prestashop>confirm_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Resumen del pedido '; +$_MODULE['<{gcheckout}prestashop>confirm_3575814f89e55ba8061c55dd93214aae'] = 'Ha elegido pagar con Google Checkout. '; +$_MODULE['<{gcheckout}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Breve resumen del pedido: '; +$_MODULE['<{gcheckout}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es de'; +$_MODULE['<{gcheckout}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(TTC)'; +$_MODULE['<{gcheckout}prestashop>confirm_eecc59d9ca953545b6c5ac9bf11ded00'] = 'Aceptamos esta divisa para el pago : '; +$_MODULE['<{gcheckout}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Confirme su pedido pulsando \"Confirmar pedido\"'; +$_MODULE['<{gcheckout}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Otras formas de pago'; +$_MODULE['<{gcheckout}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Confirmar pedido'; +$_MODULE['<{gcheckout}prestashop>gcheckout_6c132b5e262594950586ae13a7d3aa94'] = 'Google checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_3f3c0194c5adbe6953eb571f125af16d'] = 'Implementación de API de Google Checkout '; +$_MODULE['<{gcheckout}prestashop>gcheckout_4402acab1c8f90dcf4a31dc96833bd86'] = 'No hay moneda configurada para este módulo'; +$_MODULE['<{gcheckout}prestashop>gcheckout_82b8bb0d807e6d2e43a068f954c3559f'] = 'La ID del comerciante parece incorrecta'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9dd37c2106ceacbf0a40778b2109c386'] = 'La contraseña del comerciante parece incorrecta'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f4f70727dc34561dfde1a3c529b6205c'] = 'Ajustes'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a1ffd2dc2538ea3093532029514d42ac'] = 'Primero utilice el sandbox para probar el múdulo, luego podrá utilizarlo en modo real si toda la configuración se hizo correctamente. No olvide cambiar su contraseña e identificación mercantil según el modo'; +$_MODULE['<{gcheckout}prestashop>gcheckout_650be61892bf690026089544abbd9d26'] = 'Modo'; +$_MODULE['<{gcheckout}prestashop>gcheckout_7f80fcc452c2f1ed2bb51b39d0864df1'] = 'Real'; +$_MODULE['<{gcheckout}prestashop>gcheckout_2652eec977dcb2a5aea85f5bec235b05'] = 'Sandbox'; +$_MODULE['<{gcheckout}prestashop>gcheckout_76055653a95e0a559b734ec322d89632'] = 'Puede encontrar estas claves en su cuenta de comprobación de Google > Ajustes > Integración. En Sandbox y modo real tiene las mismas claves.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_229a7ec501323b94db7ff3157a7623c9'] = 'ID comerciante'; +$_MODULE['<{gcheckout}prestashop>gcheckout_795acb9a0c89791314d3032fe65eeb92'] = 'Contraseña comerciante'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a7ba8619e32091c343b340ec5b80e541'] = 'Si marca esta casilla, los compradores podrán ver en la página de compra los gastos de transporte que usted ha pagado en Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_de6fa0b14f259108c4b38e5be0374f46'] = 'Utilice los gastos de transporte Google'; +$_MODULE['<{gcheckout}prestashop>gcheckout_74692aae1cff5dc9dfd44f8c4e0540ad'] = 'Usted puede registrar la comunicación del servidor-a-servidor. Los ficheros de diario son'; +$_MODULE['<{gcheckout}prestashop>gcheckout_be5d5d37542d75f93a87094459f76678'] = 'y'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f2f19b2cbcb395e254ebb1d9bf7cccd4'] = 'Si usted lo activa, está seguro de protegerlos poniendo un archivo .htaccess en el mismo directorio. Si usted olvida hacer eso, cualquiera podrá leerlos'; +$_MODULE['<{gcheckout}prestashop>gcheckout_b2d37ae1cedf42ff874289b721860af2'] = 'Registros'; +$_MODULE['<{gcheckout}prestashop>gcheckout_38fb7d24e0d60a048f540ecb18e13376'] = 'Guardar'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Información'; +$_MODULE['<{gcheckout}prestashop>gcheckout_968913ba2d4e25f3589d4c612ecbaa8d'] = 'Para utilizar su módulo de la comprobación de Google, tiene que configurar su cuenta Google (cuenta de sandbox y su cuenta). La conexión a la comprobación de la cuenta Google > ajustes; Integración. La URL del servicio repetido del API es:'; +$_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] = 'El método de callback debe fijarse a '; +$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Los pedidos deben pasarse con la misma moneda que la cuenta del vendedor. Los carritos en otras monedas serán convertidas si el cliente elige pagar con este módulo.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Pagar con GoogleCheckout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Embalaje '; +$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Costos de envío'; diff --git a/modules/gcheckout/fr.php b/modules/gcheckout/fr.php new file mode 100644 index 000000000..af521edcc --- /dev/null +++ b/modules/gcheckout/fr.php @@ -0,0 +1,42 @@ +confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Votre panier'; +$_MODULE['<{gcheckout}prestashop>confirm_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Résumé de la commande'; +$_MODULE['<{gcheckout}prestashop>confirm_3575814f89e55ba8061c55dd93214aae'] = 'Vous avez choisi de payer avec Google Checkout'; +$_MODULE['<{gcheckout}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un court résumé de votre commande :'; +$_MODULE['<{gcheckout}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; +$_MODULE['<{gcheckout}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(TTC)'; +$_MODULE['<{gcheckout}prestashop>confirm_eecc59d9ca953545b6c5ac9bf11ded00'] = 'Nous acceptons la devise suivante pour votre paiement :'; +$_MODULE['<{gcheckout}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; +$_MODULE['<{gcheckout}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; +$_MODULE['<{gcheckout}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; +$_MODULE['<{gcheckout}prestashop>gcheckout_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_3f3c0194c5adbe6953eb571f125af16d'] = 'Implémentation de l\'API de Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_4402acab1c8f90dcf4a31dc96833bd86'] = 'Aucune devise disponible pour ce module'; +$_MODULE['<{gcheckout}prestashop>gcheckout_82b8bb0d807e6d2e43a068f954c3559f'] = 'L\'ID marchand semble incorrect'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9dd37c2106ceacbf0a40778b2109c386'] = 'La clé marchand semble incorrecte'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a1ffd2dc2538ea3093532029514d42ac'] = 'Utilisez le mode bac à sable pour tester le module avant de l\'utiliser en mode réel. N\'oubliez pas de changer vos clés et ID marchand selon le mode !'; +$_MODULE['<{gcheckout}prestashop>gcheckout_650be61892bf690026089544abbd9d26'] = 'Mode'; +$_MODULE['<{gcheckout}prestashop>gcheckout_7f80fcc452c2f1ed2bb51b39d0864df1'] = 'Réel'; +$_MODULE['<{gcheckout}prestashop>gcheckout_2652eec977dcb2a5aea85f5bec235b05'] = 'Bac à sable'; +$_MODULE['<{gcheckout}prestashop>gcheckout_76055653a95e0a559b734ec322d89632'] = 'Vous trouverez ces identifiants dans votre compte Google Checkout > Settings > Integration. Les modes réel et bac à sable ont tous les deux besoin de ces clés.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_229a7ec501323b94db7ff3157a7623c9'] = 'ID marchand'; +$_MODULE['<{gcheckout}prestashop>gcheckout_795acb9a0c89791314d3032fe65eeb92'] = 'Clé marchand'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a7ba8619e32091c343b340ec5b80e541'] = 'Si vous cochez cette case, les acheteurs pourront voir sur la page d\'achat les frais de transport que vous avez réglé dans Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_de6fa0b14f259108c4b38e5be0374f46'] = 'Utilisez les frais de transport Google'; +$_MODULE['<{gcheckout}prestashop>gcheckout_74692aae1cff5dc9dfd44f8c4e0540ad'] = 'Vous pouvez archiver les échanges de serveur à serveur. Les fichiers d\'archives sont'; +$_MODULE['<{gcheckout}prestashop>gcheckout_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f2f19b2cbcb395e254ebb1d9bf7cccd4'] = 'Si vous activez les logs, soyez certain de protéger ces fichiers en plaçant un fichier .htaccess dans le même répertoire. Si vous ne le faites pas, ils seront lisibles par tous vos clients.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_b2d37ae1cedf42ff874289b721860af2'] = 'Archivage'; +$_MODULE['<{gcheckout}prestashop>gcheckout_38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Informations'; +$_MODULE['<{gcheckout}prestashop>gcheckout_968913ba2d4e25f3589d4c612ecbaa8d'] = 'Pour utiliser votre module Google Checkout, vous devez configurer votre compte marchand (en mode bac à sable comme en mode réel). Accédez à votre compte Google Checkout puis allez dans Settings > Integration. L\'API callback URL doit être :'; +$_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] = 'La \"callback method\" doit être réglée sur'; +$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Les commandes doivent être passées en utilisant la même devise que celle indiquée dans votre compte marchand. Les paniers utilisant d\'autres devises seront convertis si l\'utilisateur décide de payer par le biais de ce module.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Payer par GoogleCheckout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Emballage'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Frais de port'; diff --git a/modules/gcheckout/gcheckout.gif b/modules/gcheckout/gcheckout.gif new file mode 100644 index 000000000..419e54547 Binary files /dev/null and b/modules/gcheckout/gcheckout.gif differ diff --git a/modules/gcheckout/gcheckout.php b/modules/gcheckout/gcheckout.php new file mode 100644 index 000000000..25e5fe11c --- /dev/null +++ b/modules/gcheckout/gcheckout.php @@ -0,0 +1,206 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GCheckout extends PaymentModule +{ + function __construct() + { + $this->name = 'gcheckout'; + $this->tab = 'payments_gateways'; + $this->version = 1.1; + $this->author = 'PrestaShop'; + + $this->currencies = true; + $this->currencies_mode = 'radio'; + + parent::__construct(); + + $this->displayName = $this->l('Google Checkout'); + $this->description = $this->l('Google Checkout API implementation'); + + if (!sizeof(Currency::checkPaymentCurrencies($this->id))) + $this->warning = $this->l('No currency set for this module'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn') OR !Configuration::updateValue('GCHECKOUT_MERCHANT_ID', '822305931131113') + OR !Configuration::updateValue('GCHECKOUT_MERCHANT_KEY', '2Lv_osMomVIocnLK0aif3A') OR !Configuration::updateValue('GCHECKOUT_LOGS', '1') OR !Configuration::updateValue('GCHECKOUT_MODE', 'real') + OR !Configuration::updateValue('GCHECKOUT_NO_SHIPPING', '0')) + return false; + return true; + } + + function uninstall() + { + return (parent::uninstall() AND Configuration::deleteByName('GCHECKOUT_MERCHANT_ID') AND Configuration::deleteByName('GCHECKOUT_MERCHANT_KEY') AND + Configuration::deleteByName('GCHECKOUT_MODE') AND Configuration::deleteByName('GCHECKOUT_LOGS') AND Configuration::deleteByName('GCHECKOUT_NO_SHIPPING')); + } + + function getContent() + { + global $currentIndex, $cookie; + + if (Tools::isSubmit('submitGoogleCheckout')) + { + $errors = array(); + if (($merchant_id = Tools::getValue('gcheckout_merchant_id')) AND preg_match('/[0-9]{15}/', $merchant_id)) + Configuration::updateValue('GCHECKOUT_MERCHANT_ID', $merchant_id); + else + $errors[] = '

        '.$this->l('Merchant ID seems to be wrong').'

        '; + if (($merchant_key = Tools::getValue('gcheckout_merchant_key')) AND preg_match('/[a-zA-Z0-9_-]{22}/', $merchant_key)) + Configuration::updateValue('GCHECKOUT_MERCHANT_KEY', $merchant_key); + else + $errors[] = '

        '.$this->l('Merchant key seems to be wrong').'

        '; + if ($mode = (Tools::getValue('gcheckout_mode') == 'real' ? 'real' : 'sandbox')) + Configuration::updateValue('GCHECKOUT_MODE', $mode); + if (Tools::getValue('gcheckout_logs')) + Configuration::updateValue('GCHECKOUT_LOGS', 1); + else + Configuration::updateValue('GCHECKOUT_LOGS', 0); + if (!sizeof($errors)) + Tools::redirectAdmin($currentIndex.'&configure=gcheckout&token='.Tools::getValue('token').'&conf=4'); + foreach ($errors as $error) + echo $error; + } + + $html = '

        '.$this->displayName.'

        +
        +
        + '.$this->l('Settings').' +

        '.$this->l('Use the sandbox to test out the module then you can use the real mode if no problems arise. Remember to change your merchant key and ID according to the mode.').'

        + +
        + +
        +

        '.$this->l('You can find these keys in your Google Checkout account > Settings > Integration. Sandbox and real mode both have these keys.').'

        + +
        + +
        + +
        + +
        +

        '.$this->l('If you click this box, buyers will be able to see the shipping fees you have setup in Google Checkout on the purchase page.').'

        + +
        + +
        +

        '.$this->l('You can log the server-to-server communication. The log files are').' '.__PS_BASE_URI__.'modules/gcheckout/googleerror.log '.$this->l('and').' '.__PS_BASE_URI__.'modules/gcheckout/googlemessage.log. '.$this->l('If activated, be sure to protect them by putting a .htaccess file in the same directory. If not, they will be readable by everyone.').'

        + +
        + +
        +
        +
        +
        +

        +
        + '.$this->l('Information').' +

        - '.$this->l('In order to use your Google Checkout module, you must configure your Google Checkout account (sandbox account as well as live account). Log in to Google Checkout then go to Settings > Integration. The API callback URL is:').'
        + '.Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/gcheckout/validation.php +

        +

        - '.$this->l('The callback method must be set to').' XML.

        +

        - '.$this->l('Orders must be placed with the same currency as your seller account. Carts in other currencies will be converted if the customer chooses to pay with this module.').'

        +

        '; + + return $html; + } + + function hookPayment($params) + { + if (!$this->active) + return; + + global $smarty; + + $smarty->assign('buttonText', $this->l('Pay with GoogleCheckout')); + return $this->display(__FILE__, 'payment.tpl'); + } + + function hookPaymentReturn($params) + { + if (!$this->active) + return; + + return $this->display(__FILE__, 'payment_return.tpl'); + } + + function preparePayment() + { + global $smarty, $cart, $cookie; + + require_once(dirname(__FILE__).'/library/googlecart.php'); + require_once(dirname(__FILE__).'/library/googleitem.php'); + require_once(dirname(__FILE__).'/library/googleshipping.php'); + + $currency = $this->getCurrency((int)$cart->id_currency); + if ($cart->id_currency != $currency->id) + { + $cart->id_currency = (int)$currency->id; + $cookie->id_currency = (int)$cart->id_currency; + $cart->update(); + Tools::redirect('modules/'.$this->name.'/payment.php'); + } + $googleCart = new GoogleCart(Configuration::get('GCHECKOUT_MERCHANT_ID'), Configuration::get('GCHECKOUT_MERCHANT_KEY'), Configuration::get('GCHECKOUT_MODE'), $currency->iso_code); + foreach ($cart->getProducts() AS $product) + $googleCart->AddItem(new GoogleItem(utf8_decode($product['name'].((isset($product['attributes']) AND !empty($product['attributes'])) ? ' - '.$product['attributes'] : '')), utf8_decode($product['description_short']), (int)$product['cart_quantity'], $product['price_wt'], strtoupper(Configuration::get('PS_WEIGHT_UNIT')), (float)$product['weight'])); + if ($wrapping = $cart->getOrderTotal(true, Cart::ONLY_WRAPPING)) + $googleCart->AddItem(new GoogleItem(utf8_decode($this->l('Wrapping')), '', 1, $wrapping)); + foreach ($cart->getDiscounts() AS $voucher) + $googleCart->AddItem(new GoogleItem(utf8_decode($voucher['name']), utf8_decode($voucher['description']), 1, '-'.$voucher['value_real'])); + + if (!Configuration::get('GCHECKOUT_NO_SHIPPING')) + $googleCart->AddShipping(new GooglePickUp($this->l('Shipping costs'), $cart->getOrderShippingCost($cart->id_carrier))); + + $googleCart->SetEditCartUrl(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php'); + $googleCart->SetContinueShoppingUrl(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order-confirmation.php'); + $googleCart->SetRequestBuyerPhone(false); + $googleCart->SetMerchantPrivateData($cart->id.'|'.$cart->secure_key); + $smarty->assign(array( + 'googleCheckoutExtraForm' => $googleCart->CheckoutButtonCode($this->l('Pay with GoogleCheckout'), 'LARGE'), + 'total' => $cart->getOrderTotal() + )); + } +} diff --git a/modules/gcheckout/it.php b/modules/gcheckout/it.php new file mode 100644 index 000000000..3300917a3 --- /dev/null +++ b/modules/gcheckout/it.php @@ -0,0 +1,42 @@ +confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Il tuo carrello'; +$_MODULE['<{gcheckout}prestashop>confirm_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Riepilogo ordine'; +$_MODULE['<{gcheckout}prestashop>confirm_3575814f89e55ba8061c55dd93214aae'] = 'Hai scelto di pagare con Google Checkout.'; +$_MODULE['<{gcheckout}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Ecco un breve riepilogo del tuo ordine:'; +$_MODULE['<{gcheckout}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; +$_MODULE['<{gcheckout}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(Tasse incl.)'; +$_MODULE['<{gcheckout}prestashop>confirm_eecc59d9ca953545b6c5ac9bf11ded00'] = 'Accettiamo le seguente valuta da inviare tramite Google Checkout:'; +$_MODULE['<{gcheckout}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Si prega di confermare l\'ordine cliccando su \'confermo il mio ordine\''; +$_MODULE['<{gcheckout}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; +$_MODULE['<{gcheckout}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; +$_MODULE['<{gcheckout}prestashop>gcheckout_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_3f3c0194c5adbe6953eb571f125af16d'] = 'Attuazione API di Google Checkout '; +$_MODULE['<{gcheckout}prestashop>gcheckout_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nessuna valuta impostata per questo modulo'; +$_MODULE['<{gcheckout}prestashop>gcheckout_82b8bb0d807e6d2e43a068f954c3559f'] = 'ID commerciante sembra essere sbagliato'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9dd37c2106ceacbf0a40778b2109c386'] = 'Chiave commerciante sembra essere sbagliata'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a1ffd2dc2538ea3093532029514d42ac'] = 'In primo luogo, utilizza la pagina per testare il modulo, poi puoi utilizzare la modalità reale se va tutto bene. Non dimenticare di cambiare la chiave e l\'ID commerciante secondo la modalità!'; +$_MODULE['<{gcheckout}prestashop>gcheckout_650be61892bf690026089544abbd9d26'] = 'Modalità'; +$_MODULE['<{gcheckout}prestashop>gcheckout_7f80fcc452c2f1ed2bb51b39d0864df1'] = 'Reale'; +$_MODULE['<{gcheckout}prestashop>gcheckout_2652eec977dcb2a5aea85f5bec235b05'] = 'Sandbox'; +$_MODULE['<{gcheckout}prestashop>gcheckout_76055653a95e0a559b734ec322d89632'] = 'È possibile trovare queste chiavi nel tuo account Google Checkout> Impostazioni> Integrazione. Sandbox e modalità reale hanno entrambe queste chiavi.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_229a7ec501323b94db7ff3157a7623c9'] = 'ID commerciante'; +$_MODULE['<{gcheckout}prestashop>gcheckout_795acb9a0c89791314d3032fe65eeb92'] = 'Chiave commerciante'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a7ba8619e32091c343b340ec5b80e541'] = 'Se si spunta questa casella, gli acquirenti saranno in grado di vedere le spese di spedizione che hai configurato in Google Checkout nella pagina di acquisto.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_de6fa0b14f259108c4b38e5be0374f46'] = 'Usa spese di spedizione Google'; +$_MODULE['<{gcheckout}prestashop>gcheckout_74692aae1cff5dc9dfd44f8c4e0540ad'] = 'È possibile registrare la comunicazione server-to-server. I file di registro sono'; +$_MODULE['<{gcheckout}prestashop>gcheckout_be5d5d37542d75f93a87094459f76678'] = 'e'; +$_MODULE['<{gcheckout}prestashop>gcheckout_f2f19b2cbcb395e254ebb1d9bf7cccd4'] = 'Se lo attivi, assicurati di proteggerli mettendo un file. Htaccess nella stessa directory. Se dimentichi di farlo, sarà leggibile da tutti'; +$_MODULE['<{gcheckout}prestashop>gcheckout_b2d37ae1cedf42ff874289b721860af2'] = 'Archivi '; +$_MODULE['<{gcheckout}prestashop>gcheckout_38fb7d24e0d60a048f540ecb18e13376'] = 'Salva'; +$_MODULE['<{gcheckout}prestashop>gcheckout_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Informazioni'; +$_MODULE['<{gcheckout}prestashop>gcheckout_968913ba2d4e25f3589d4c612ecbaa8d'] = 'Per poter utilizzare il modulo Google Checkout, è necessario configurare il tuo account Google Checkout (account sandbox così come account live). Accedi a Google Checkout poi vai su Settings > Integration. L\'URL callback API è:'; +$_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] = 'Il metodo di callback deve essere impostato su'; +$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Gli ordini devono essere posizionati con la stessa valuta del tuo account venditore. Carrelli in altre valute saranno convertiti se il cliente sceglie di pagare con questo modulo.'; +$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Paga con GoogleCheckout'; +$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Confezione'; +$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Costi di spedizione'; diff --git a/modules/gcheckout/library/googlecart.php b/modules/gcheckout/library/googlecart.php new file mode 100644 index 000000000..e61c11b92 --- /dev/null +++ b/modules/gcheckout/library/googlecart.php @@ -0,0 +1,1612 @@ + array(), + 'merchant-calculated-shipping' => array(), + 'pickup' => array(), + 'parameterized-url' => array(), + 'url-parameter' => array(), + 'item' => array(), + 'us-state-area' => array('tax-area'), + 'us-zip-area' => array('tax-area'), + 'us-country-area' => array('tax-area'), + 'postal-area' => array('tax-area'), + 'alternate-tax-table' => array(), + 'world-area' => array('tax-area'), + 'default-tax-rule' => array(), + 'alternate-tax-rule' => array(), + 'gift-certificate-adjustment' => array(), + 'coupon-adjustment' => array(), + 'coupon-result' => array(), + 'gift-certificate-result' => array(), + 'method' => array(), + 'anonymous-address' => array(), + 'result' => array(), + 'string' => array(), + ); + + var $ignore_tags = array( + 'xmlns' => true, + 'checkout-shopping-cart' => true, + // Dont know how to translate these tag yet + 'merchant-private-data' => true, + 'merchant-private-item-data' => true, + ); + + + + /** + * Has all the logic to build the cart's xml (or html) request to be + * posted to google's servers. + * + * @param string $id the merchant id + * @param string $key the merchant key + * @param string $server_type the server type of the server to be used, one + * of 'sandbox' or 'production'. + * defaults to 'sandbox' + * @param string $currency the currency of the items to be added to the cart + * , as of now values can be 'USD' or 'GBP'. + * defaults to 'USD' + */ + function GoogleCart($id, $key, $server_type="sandbox", $currency="USD") { + $this->merchant_id = $id; + $this->merchant_key = $key; + $this->currency = $currency; + + if(strtolower($server_type) == "sandbox") { + $this->server_url = "https://sandbox.google.com/checkout/"; + } else { + $this->server_url= "https://checkout.google.com/"; + } + + + $this->schema_url = "http://checkout.google.com/schema/2"; + $this->base_url = $this->server_url . "api/checkout/v2/"; + $this->checkout_url = $this->base_url . "checkout/Merchant/" . $this->merchant_id; + $this->checkoutForm_url = $this->base_url . "checkoutForm/Merchant/" . $this->merchant_id; + + //The item, shipping and tax table arrays are initialized + $this->item_arr = array(); + $this->shipping_arr = array(); + $this->alternate_tax_tables_arr = array(); + } + + /** + * Sets the cart's expiration date + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_good-until-date } + * + * @param string $cart_expire a string representing a date in the + * iso 8601 date and time format: {@link http://www.w3.org/TR/NOTE-datetime} + * + * @return void + */ + function SetCartExpiration($cart_expire) { + $this->cart_expiration = $cart_expire; + } + + /** + * Sets the merchant's private data. + * + * Google Checkout will return this data in the + * and the + * for the order. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-private-data } + * + * @param MerchantPrivateData $data an object which contains the data to be + * sent as merchant-private-data + * + * @return void + */ + function SetMerchantPrivateData($data) { + $this->merchant_private_data = $data; + } + + /** + * Sets the url where the customer can edit his cart. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_edit-cart-url } + * + * @param string $url the merchant's site edit cart url + * @return void + */ + function SetEditCartUrl($url) { + $this->edit_cart_url= $url; + } + + /** + * Sets the continue shopping url, which allows the customer to return +die(); + * to the merchant's site after confirming an order. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_continue-shopping-url } + * + * @param string $url the merchant's site continue shopping url + * @return void + */ + function SetContinueShoppingUrl($url) { + $this->continue_shopping_url = $url; + } + + /** + * Sets whether the customer must enter a phone number to complete an order. + * If set to true, the customer must enter a number, which Google Checkout + * will return in the new order notification for the order. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_request-buyer-phone-number } + * + * @param bool $req true if the customer's phone number is *required* + * to complete an order. + * defaults to false. + * @return void + */ + function SetRequestBuyerPhone($req) { + $this->request_buyer_phone = $this->_GetBooleanValue($req, "false"); + } + + /** + * Sets the information about calculations that will be performed by the + * merchant. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-calculations } + * + * @param string $url the merchant calculations callback url + * @param bool $tax_option true if the merchant has to do tax calculations. + * defaults to false. + * @param bool $coupons true if the merchant accepts discount coupons. + * defaults to false. + * @param bool $gift_cert true if the merchant accepts gift certificates. + * defaults to false. + * @return void + */ + function SetMerchantCalculations($url, $tax_option = "false", + $coupons = "false", $gift_cert = "false") { + $this->merchant_calculations_url = $url; + $this->merchant_calculated_tax = $this->_GetBooleanValue($tax_option, "false"); + $this->accept_merchant_coupons = $this->_GetBooleanValue($coupons, "false"); + $this->accept_gift_certificates = $this->_GetBooleanValue($gift_cert, "false"); + } + + /** + * Add an item to the cart. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_item } + * + * @param GoogleItem $google_item an object that represents an item + * (defined in googleitem.php) + * + * @return void + */ + function AddItem($google_item) { + $this->item_arr[] = $google_item; + } + + /** + * Add a shipping method to the cart. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_shipping-methods } + * + * @param object $ship an object that represents a shipping method, must be + * one of the methods defined in googleshipping.php + * + * @return void + */ + function AddShipping($ship) { + $this->shipping_arr[] = $ship; + } + + /** + * Add a default tax rule to the cart. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_default-tax-rule } + * + * @param GoogleDefaultTaxRule $rules an object that represents a default + * tax rule (defined in googletax.php) + * + * @return void + */ + function AddDefaultTaxRules($rules) { + $this->default_tax_table = true; + $this->default_tax_rules_arr[] = $rules; + } + + /** + * Add an alternate tax table to the cart. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_alternate-tax-table } + * + * @param GoogleAlternateTaxTable $tax an object that represents an + * alternate tax table + * (defined in googletax.php) + * + * @return void + */ + function AddAlternateTaxTables($tax) { + $this->alternate_tax_tables_arr[] = $tax; + } + + /** + * Set the policy to be used to round monetary values. + * Rounding policy explanation here: + * {@link http://code.google.com/apis/checkout/developer/Google_Checkout_Rounding_Policy.html} + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_rounding-policy } + * + * @param string $mode one of "UP", "DOWN", "CEILING", "HALF_DOWN" + * or "HALF_EVEN", described here: {@link http://java.sun.com/j2se/1.5.0/docs/api/java/math/RoundingMode.html} + * @param string $rule one of "PER_LINE", "TOTAL" + * + * @return void + */ + function AddRoundingPolicy($mode, $rule) { + switch ($mode) { + case "UP": + case "DOWN": + case "CEILING": + case "HALF_UP": + case "HALF_DOWN": + case "HALF_EVEN": + $this->rounding_mode = $mode; + break; + default: + break; + } + switch ($rule) { + case "PER_LINE": + case "TOTAL": + $this->rounding_rule = $rule; + break; + default: + break; + } + } + + /** + * Set the google analytics data. + * + * {@link http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html info on Checkout and Analytics integration} + * + * @param string $data the analytics data + * + * @return void + */ + function SetAnalyticsData($data) { + $this->analytics_data = $data; + } + + /** + * Add a google analytics tracking id. + * + * {@link http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html info on Checkout and Analytics integration} + * + * @param string $GA_id the google analytics id + * + * @return void + */ + function AddGoogleAnalyticsTracking($GA_id) { + $this->googleAnalytics_id = $GA_id; + } + + /** + * Add third-party tracking to the cart + * + * Described here: + * {@link http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html#googleCheckoutAnalyticsIntegrationAlternate} + * + * @param $tracking_attr_types attributes to be tracked, one of + * ('buyer-id', + * 'order-id', + * 'order-subtotal', + * 'order-subtotal-plus-tax', + * 'order-subtotal-plus-shipping', + * 'order-total', + * 'tax-amount', + * 'shipping-amount', + * 'coupon-amount', + * 'coupon-amount', + * 'billing-city', + * 'billing-region', + * 'billing-postal-code', + * 'billing-country-code', + * 'shipping-city', + * 'shipping-region', + * 'shipping-postal-code', + * 'shipping-country-code') + * More info http://code.google.com/apis/checkout/developer/checkout_pixel_tracking.html#googleCheckout_tag_url-parameter + */ + function AddThirdPartyTracking($url, $tracking_param_types = array()) { + $this->thirdPartyTackingUrl = $url; + $this->thirdPartyTackingParams = $tracking_param_types; + } + + /** + * Builds the cart's xml to be sent to Google Checkout. + * + * @return string the cart's xml + */ + function GetXML() { + require_once('xml-processing/gc_xmlbuilder.php'); + + $xml_data = new gc_XmlBuilder(); + + $xml_data->Push('checkout-shopping-cart', + array('xmlns' => $this->schema_url)); + $xml_data->Push('shopping-cart'); + + //Add cart expiration if set + if($this->cart_expiration != "") { + $xml_data->Push('cart-expiration'); + $xml_data->Element('good-until-date', $this->cart_expiration); + $xml_data->Pop('cart-expiration'); + } + + //Add XML data for each of the items + $xml_data->Push('items'); + foreach($this->item_arr as $item) { + $xml_data->Push('item'); + $xml_data->Element('item-name', $item->item_name); + $xml_data->Element('item-description', $item->item_description); + $xml_data->Element('unit-price', $item->unit_price, + array('currency' => $this->currency)); + $xml_data->Element('quantity', $item->quantity); + if($item->merchant_private_item_data != '') { +// echo get_class($item->merchant_private_item_data); + if(is_a($item->merchant_private_item_data, + 'merchantprivate')) { + $item->merchant_private_item_data->AddMerchantPrivateToXML($xml_data); + } + else { + $xml_data->Element('merchant-private-item-data', + $item->merchant_private_item_data); + } + } + if($item->merchant_item_id != '') + $xml_data->Element('merchant-item-id', $item->merchant_item_id); + if($item->tax_table_selector != '') + $xml_data->Element('tax-table-selector', $item->tax_table_selector); +// Carrier calculation + if($item->item_weight != '' && $item->numeric_weight !== '') { + $xml_data->EmptyElement('item-weight', array( 'unit' => $item->item_weight, + 'value' => $item->numeric_weight + )); + } +// New Digital Delivery Tags + if($item->digital_content) { + $xml_data->push('digital-content'); + if(!empty($item->digital_url)) { + $xml_data->element('description', substr($item->digital_description, + 0, MAX_DIGITAL_DESC)); + $xml_data->element('url', $item->digital_url); +// To avoid NULL key message in GC confirmation Page + if(!empty($item->digital_key)) { + $xml_data->element('key', $item->digital_key); + } + } + else { + $xml_data->element('email-delivery', + $this->_GetBooleanValue($item->email_delivery, "true")); + } + $xml_data->pop('digital-content'); + } + $xml_data->Pop('item'); + } + $xml_data->Pop('items'); + + if($this->merchant_private_data != '') { + if (is_object($this->merchant_private_data) && get_class($this->merchant_private_data) == 'merchantprivate') { + $this->merchant_private_data->AddMerchantPrivateToXML($xml_data); + } + else { + $xml_data->Element('merchant-private-data', + $this->merchant_private_data); + } + } + $xml_data->Pop('shopping-cart'); + + $xml_data->Push('checkout-flow-support'); + $xml_data->Push('merchant-checkout-flow-support'); + if($this->edit_cart_url != '') + $xml_data->Element('edit-cart-url', $this->edit_cart_url); + if($this->continue_shopping_url != '') + $xml_data->Element('continue-shopping-url', + $this->continue_shopping_url); + + if(count($this->shipping_arr) > 0) + $xml_data->Push('shipping-methods'); + + //Add the shipping methods + foreach($this->shipping_arr as $ship) { + //Pickup shipping handled in else part + if($ship->type == "flat-rate-shipping" || + $ship->type == "merchant-calculated-shipping" +// If shipping-company calc support addr-filtering and shipping restrictions as a subatag of shipping-company-calculated-shipping +// ||$ship->type == "shipping-company-calculated-shipping" + ) { + $xml_data->Push($ship->type, array('name' => $ship->name)); + $xml_data->Element('price', $ship->price, + array('currency' => $this->currency)); + + $shipping_restrictions = $ship->shipping_restrictions; + if (isset($shipping_restrictions)) { + $xml_data->Push('shipping-restrictions'); + + if ($shipping_restrictions->allow_us_po_box === true) { + $xml_data->Element('allow-us-po-box', "true"); + } else { + $xml_data->Element('allow-us-po-box', "false"); + } + + //Check if allowed restrictions specified + if($shipping_restrictions->allowed_restrictions) { + $xml_data->Push('allowed-areas'); + if($shipping_restrictions->allowed_country_area != "") + $xml_data->EmptyElement('us-country-area', + array('country-area' => + $shipping_restrictions->allowed_country_area)); + foreach($shipping_restrictions->allowed_state_areas_arr as $current) { + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + } + foreach($shipping_restrictions->allowed_zip_patterns_arr as $current) { + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + } + if($shipping_restrictions->allowed_world_area === true) { + $xml_data->EmptyElement('world-area'); + } + for($i=0; $iallowed_country_codes_arr); $i++) { + $xml_data->Push('postal-area'); + $country_code = $shipping_restrictions->allowed_country_codes_arr[$i]; + $postal_pattern = $shipping_restrictions->allowed_postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + } + $xml_data->Pop('allowed-areas'); + } + + if($shipping_restrictions->excluded_restrictions) { + if (!$shipping_restrictions->allowed_restrictions) { + $xml_data->EmptyElement('allowed-areas'); + } + $xml_data->Push('excluded-areas'); + if($shipping_restrictions->excluded_country_area != "") + $xml_data->EmptyElement('us-country-area', + array('country-area' => + $shipping_restrictions->excluded_country_area)); + foreach($shipping_restrictions->excluded_state_areas_arr as $current) { + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + } + foreach($shipping_restrictions->excluded_zip_patterns_arr as $current) { + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + } + for($i=0; $iexcluded_country_codes_arr); $i++) { + $xml_data->Push('postal-area'); + $country_code = $shipping_restrictions->excluded_country_codes_arr[$i]; + $postal_pattern = $shipping_restrictions->excluded_postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + } + $xml_data->Pop('excluded-areas'); + } + $xml_data->Pop('shipping-restrictions'); + } + + if ($ship->type == "merchant-calculated-shipping") { + $address_filters = $ship->address_filters; + if (isset($address_filters)) { + $xml_data->Push('address-filters'); + + if ($address_filters->allow_us_po_box === true) { + $xml_data->Element('allow-us-po-box', "true"); + } else { + $xml_data->Element('allow-us-po-box', "false"); + } + + //Check if allowed restrictions specified + if($address_filters->allowed_restrictions) { + $xml_data->Push('allowed-areas'); + if($address_filters->allowed_country_area != "") + $xml_data->EmptyElement('us-country-area', + array('country-area' => + $address_filters->allowed_country_area)); + foreach($address_filters->allowed_state_areas_arr as $current) { + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + } + foreach($address_filters->allowed_zip_patterns_arr as $current) { + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + } + if($address_filters->allowed_world_area === true) { + $xml_data->EmptyElement('world-area'); + } + for($i=0; $iallowed_country_codes_arr); $i++) { + $xml_data->Push('postal-area'); + $country_code = $address_filters->allowed_country_codes_arr[$i]; + $postal_pattern = $address_filters->allowed_postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + } + $xml_data->Pop('allowed-areas'); + } + + if($address_filters->excluded_restrictions) { + if (!$address_filters->allowed_restrictions) { + $xml_data->EmptyElement('allowed-areas'); + } + $xml_data->Push('excluded-areas'); + if($address_filters->excluded_country_area != "") + $xml_data->EmptyElement('us-country-area', + array('country-area' => + $address_filters->excluded_country_area)); + foreach($address_filters->excluded_state_areas_arr as $current) { + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + } + foreach($address_filters->excluded_zip_patterns_arr as $current) { + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + } + for($i=0; $iexcluded_country_codes_arr); $i++) { + $xml_data->Push('postal-area'); + $country_code = $address_filters->excluded_country_codes_arr[$i]; + $postal_pattern = $address_filters->excluded_postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + } + $xml_data->Pop('excluded-areas'); + } + $xml_data->Pop('address-filters'); + } + } + $xml_data->Pop($ship->type); + } + else if ($ship->type == "carrier-calculated-shipping"){ +// $xml_data->Push($ship->type, array('name' => $ship->name)); + $xml_data->Push($ship->type); + $xml_data->Push('carrier-calculated-shipping-options'); + $CCSoptions = $ship->CarrierCalculatedShippingOptions; + foreach($CCSoptions as $CCSoption){ + $xml_data->Push('carrier-calculated-shipping-option'); + $xml_data->Element('price', $CCSoption->price, + array('currency' => $this->currency)); + $xml_data->Element('shipping-company', $CCSoption->shipping_company); + $xml_data->Element('shipping-type', $CCSoption->shipping_type); + $xml_data->Element('carrier-pickup', $CCSoption->carrier_pickup); + if(!empty($CCSoption->additional_fixed_charge)) { + $xml_data->Element('additional-fixed-charge', + $CCSoption->additional_fixed_charge, + array('currency' => $this->currency)); + } + if(!empty($CCSoption->additional_variable_charge_percent)) { + $xml_data->Element('additional-variable-charge-percent', + $CCSoption->additional_variable_charge_percent); + } + $xml_data->Pop('carrier-calculated-shipping-option'); + } + $xml_data->Pop('carrier-calculated-shipping-options'); +// $ShippingPackage = $ship->ShippingPackage; + $xml_data->Push('shipping-packages'); + $xml_data->Push('shipping-package'); + $xml_data->Push('ship-from', array('id' => $ship->ShippingPackage->ship_from->id)); + $xml_data->Element('city', $ship->ShippingPackage->ship_from->city); + $xml_data->Element('region', $ship->ShippingPackage->ship_from->region); + $xml_data->Element('postal-code', $ship->ShippingPackage->ship_from->postal_code); + $xml_data->Element('country-code', $ship->ShippingPackage->ship_from->country_code); + $xml_data->Pop('ship-from'); + + $xml_data->EmptyElement('width', array('unit' => $ship->ShippingPackage->unit, + 'value' => $ship->ShippingPackage->width + )); + $xml_data->EmptyElement('length', array('unit' => $ship->ShippingPackage->unit, + 'value' => $ship->ShippingPackage->length + )); + $xml_data->EmptyElement('height', array('unit' => $ship->ShippingPackage->unit, + 'value' => $ship->ShippingPackage->height + )); + $xml_data->Element('delivery-address-category', + $ship->ShippingPackage->delivery_address_category); + $xml_data->Pop('shipping-package'); + $xml_data->Pop('shipping-packages'); + + $xml_data->Pop($ship->type); + } + else if ($ship->type == "pickup") { + $xml_data->Push('pickup', array('name' => $ship->name)); + $xml_data->Element('price', $ship->price, + array('currency' => $this->currency)); + $xml_data->Pop('pickup'); + } + } + if(count($this->shipping_arr) > 0) + $xml_data->Pop('shipping-methods'); + + if($this->request_buyer_phone != "") + $xml_data->Element('request-buyer-phone-number', + $this->request_buyer_phone); + + if($this->merchant_calculations_url != "") { + $xml_data->Push('merchant-calculations'); + $xml_data->Element('merchant-calculations-url', + $this->merchant_calculations_url); + if($this->accept_merchant_coupons != "") { + $xml_data->Element('accept-merchant-coupons', + $this->accept_merchant_coupons); + } + if($this->accept_gift_certificates != "") { + $xml_data->Element('accept-gift-certificates', + $this->accept_gift_certificates); + } + $xml_data->Pop('merchant-calculations'); + } + //Set Third party Tracking + if($this->thirdPartyTackingUrl) { + $xml_data->push('parameterized-urls'); + $xml_data->push('parameterized-url', + array('url' => $this->thirdPartyTackingUrl)); + if(is_array($this->thirdPartyTackingParams) + && count($this->thirdPartyTackingParams)>0) { + $xml_data->push('parameters'); + foreach($this->thirdPartyTackingParams as $tracking_param_name => + $tracking_param_type) { + $xml_data->emptyElement('url-parameter', + array('name' => $tracking_param_name, + 'type' => $tracking_param_type)); + } + $xml_data->pop('parameters'); + } + $xml_data->pop('parameterized-url'); + $xml_data->pop('parameterized-urls'); + } + + //Set Default and Alternate tax tables + if( (count($this->alternate_tax_tables_arr) != 0) + || (count($this->default_tax_rules_arr) != 0)) { + if($this->merchant_calculated_tax != "") { + $xml_data->Push('tax-tables', + array('merchant-calculated' => $this->merchant_calculated_tax)); + } + else { + $xml_data->Push('tax-tables'); + } + if(count($this->default_tax_rules_arr) != 0) { + $xml_data->Push('default-tax-table'); + $xml_data->Push('tax-rules'); + foreach($this->default_tax_rules_arr as $curr_rule) { + + if($curr_rule->country_area != "") { + $xml_data->Push('default-tax-rule'); + $xml_data->Element('shipping-taxed', $curr_rule->shipping_taxed); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->EmptyElement('us-country-area', + array('country-area' => $curr_rule->country_area)); + $xml_data->Pop('tax-area'); + $xml_data->Pop('default-tax-rule'); + } + + foreach($curr_rule->state_areas_arr as $current) { + $xml_data->Push('default-tax-rule'); + $xml_data->Element('shipping-taxed', $curr_rule->shipping_taxed); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('default-tax-rule'); + } + + foreach($curr_rule->zip_patterns_arr as $current) { + $xml_data->Push('default-tax-rule'); + $xml_data->Element('shipping-taxed', $curr_rule->shipping_taxed); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('default-tax-rule'); + } + + for($i=0; $icountry_codes_arr); $i++) { + $xml_data->Push('default-tax-rule'); + $xml_data->Element('shipping-taxed', $curr_rule->shipping_taxed); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('postal-area'); + $country_code = $curr_rule->country_codes_arr[$i]; + $postal_pattern = $curr_rule->postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('default-tax-rule'); + } + + if ($curr_rule->world_area === true) { + $xml_data->Push('default-tax-rule'); + $xml_data->Element('shipping-taxed', $curr_rule->shipping_taxed); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->EmptyElement('world-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('default-tax-rule'); + } + } + $xml_data->Pop('tax-rules'); + $xml_data->Pop('default-tax-table'); + } + + if(count($this->alternate_tax_tables_arr) != 0) { + $xml_data->Push('alternate-tax-tables'); + foreach($this->alternate_tax_tables_arr as $curr_table) { + $xml_data->Push('alternate-tax-table', + array('standalone' => $curr_table->standalone, + 'name' => $curr_table->name)); + $xml_data->Push('alternate-tax-rules'); + + foreach($curr_table->tax_rules_arr as $curr_rule) { + if($curr_rule->country_area != "") { + $xml_data->Push('alternate-tax-rule'); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->EmptyElement('us-country-area', + array('country-area' => $curr_rule->country_area)); + $xml_data->Pop('tax-area'); + $xml_data->Pop('alternate-tax-rule'); + } + + foreach($curr_rule->state_areas_arr as $current) { + $xml_data->Push('alternate-tax-rule'); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('us-state-area'); + $xml_data->Element('state', $current); + $xml_data->Pop('us-state-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('alternate-tax-rule'); + } + + foreach($curr_rule->zip_patterns_arr as $current) { + $xml_data->Push('alternate-tax-rule'); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('us-zip-area'); + $xml_data->Element('zip-pattern', $current); + $xml_data->Pop('us-zip-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('alternate-tax-rule'); + } + + for($i=0; $icountry_codes_arr); $i++) { + $xml_data->Push('alternate-tax-rule'); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->Push('postal-area'); + $country_code = $curr_rule->country_codes_arr[$i]; + $postal_pattern = $curr_rule->postal_patterns_arr[$i]; + $xml_data->Element('country-code', $country_code); + if ($postal_pattern != "") { + $xml_data->Element('postal-code-pattern', $postal_pattern); + } + $xml_data->Pop('postal-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('alternate-tax-rule'); + } + + if ($curr_rule->world_area === true) { + $xml_data->Push('alternate-tax-rule'); + $xml_data->Element('rate', $curr_rule->tax_rate); + $xml_data->Push('tax-area'); + $xml_data->EmptyElement('world-area'); + $xml_data->Pop('tax-area'); + $xml_data->Pop('alternate-tax-rule'); + } + } + $xml_data->Pop('alternate-tax-rules'); + $xml_data->Pop('alternate-tax-table'); + } + $xml_data->Pop('alternate-tax-tables'); + } + $xml_data->Pop('tax-tables'); + } + + if (($this->rounding_mode != "") && ($this->rounding_rule != "")) { + $xml_data->Push('rounding-policy'); + $xml_data->Element('mode', $this->rounding_mode); + $xml_data->Element('rule', $this->rounding_rule); + $xml_data->Pop('rounding-policy'); + } + if($this->analytics_data != ''){ + $xml_data->Element('analytics-data', $this->analytics_data); + } + + $xml_data->Pop('merchant-checkout-flow-support'); + $xml_data->Pop('checkout-flow-support'); + $xml_data->Pop('checkout-shopping-cart'); + + return $xml_data->GetXML(); + } + + /** + * Set the Google Checkout button's variant. + * {@link http://code.google.com/apis/checkout/developer/index.html#google_checkout_buttons} + * + * @param bool $variant true for an enabled button, false for a + * disabled one + * + * @return void + */ + function SetButtonVariant($variant) { + switch ($variant) { + case false: + $this->variant = "disabled"; + break; + case true: + default: + $this->variant = "text"; + break; + } + } + + /** + * Submit a server-to-server request. + * Creates a GoogleRequest object (defined in googlerequest.php) and sends + * it to the Google Checkout server. + * + * more info: + * {@link http://code.google.com/apis/checkout/developer/index.html#alternate_technique} + * + * @return array with the returned http status code (200 if OK) in index 0 + * and the redirect url returned by the server in index 1 + */ + function CheckoutServer2Server($proxy=array(), $certPath='') + { + ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'.'); + require_once('library/googlerequest.php'); + $GRequest = new GoogleRequest($this->merchant_id, + $this->merchant_key, + $this->server_url=="https://checkout.google.com/"? + "Production":"sandbox", + $this->currency); + $GRequest->SetProxy($proxy); + $GRequest->SetCertificatePath($certPath); + return $GRequest->SendServer2ServerCart($this->GetXML()); + } + + /** + * Get the Google Checkout button's html to be used in a server-to-server + * request. + * + * {@link http://code.google.com/apis/checkout/developer/index.html#google_checkout_buttons} + * + * @param string $url the merchant's site url where the form will be posted + * to + * @param string $size the size of the button, one of 'large', 'medium' or + * 'small'. + * defaults to 'large' + * @param bool $variant true for an enabled button, false for a + * disabled one. defaults to true. will be ignored if + * SetButtonVariant() was used before. + * @param string $loc the locale of the button's text, the only valid value + * is 'en_US' (used as default) + * @param bool $showtext whether to show Google Checkout text or not, + * defaults to true. + * @param string $style the background style of the button, one of 'white' + * or 'trans'. defaults to "trans" + * + * @return string the button's html + */ + function CheckoutServer2ServerButton($url, $size="large", $variant=true, + $loc="en_US",$showtext=true, $style="trans") { + + switch (strtolower($size)) { + case "medium": + $width = "168"; + $height = "44"; + break; + + case "small": + $width = "160"; + $height = "43"; + break; + case "large": + default: + $width = "180"; + $height = "46"; + break; + } + + if($this->variant == false) { + switch ($variant) { + case false: + $this->variant = "disabled"; + break; + case true: + default: + $this->variant = "text"; + break; + } + } + $data = "
        "; + if ($this->variant == "text") + { + $data .= "
        googleAnalytics_id? + " onsubmit=\"setUrchinInputCode();\"":"") . "> + server_url."buttons/checkout.gif?merchant_id=" . + $this->merchant_id."&w=".$width. "&h=".$height."&style=". + $style."&variant=".$this->variant."&loc=".$loc."\" + height=\"".$height."\" width=\"".$width. "\" />"; + + if($this->googleAnalytics_id) + { + $data .= ""; + } + $data .= "
        "; + if($this->googleAnalytics_id) + { + $data .= " + + + + "; + } + } + else + { + $data .= "
        \"Checkout\"server_url."buttons/checkout.gif?merchant_id=" . + "".$this->merchant_id."&w=".$width. "&h=".$height."&style=".$style. + "&variant=".$this->variant."&loc=".$loc."\" height=\"".$height."\"". + " width=\"".$width. "\" />
        "; + + } + $data .= "
        "; + return $data; + } + + /** + * Get the Google Checkout button's html. + * + * {@link http://code.google.com/apis/checkout/developer/index.html#google_checkout_buttons} + * + * @param string $size the size of the button, one of 'large', 'medium' or + * 'small'. + * defaults to 'large' + * @param bool $variant true for an enabled button, false for a + * disabled one. defaults to true. will be ignored if + * SetButtonVariant() was used before. + * @param string $loc the locale of the button's text, the only valid value + * is 'en_US' (used as default) + * @param bool $showtext whether to show Google Checkout text or not, + * defaults to true. + * @param string $style the background style of the button, one of 'white' + * or 'trans'. defaults to "trans" + * + * @return string the button's html + */ + function CheckoutButtonCode($size="large", $variant=true, $loc="en_US", + $showtext=true, $style="trans") { + + switch (strtolower($size)) { + case "medium": + $width = "168"; + $height = "44"; + break; + + case "small": + $width = "160"; + $height = "43"; + break; + case "large": + default: + $width = "180"; + $height = "46"; + break; + } + + if($this->variant == false) { + switch ($variant) { + case false: + $this->variant = "disabled"; + break; + case true: + default: + $this->variant = "text"; + break; + } + } + + + $data = ""; + if ($this->variant == "text") + { + $data .= " +
        checkout_url . "\"" . ($this->googleAnalytics_id? + " onsubmit=\"setUrchinInputCode();\"":"") . "> + GetXML()) ."\"> + CalcHmacSha1($this->GetXML())). "\"> + "; + + if ($this->googleAnalytics_id) + { + $data .= ""; + } + $data .= "
        "; + if ($this->googleAnalytics_id) + { + $data .= " + + + + "; + } + } + else + { + $data .= "
        \"Checkout\"server_url."buttons/checkout.gif?merchant_id=" . + "".$this->merchant_id."&w=".$width. "&h=".$height."&style=".$style. + "&variant=".$this->variant."&loc=".$loc."\" height=\"".$height."\"". + " width=\"".$width. "\" />
        "; + } + return $data; + } + //Code for generating Checkout button + //@param $variant will be ignored if SetButtonVariant() was used before + function CheckoutButtonNowCode($size="large", $variant=true, $loc="en_US", + $showtext=true, $style="trans") { + + switch (strtolower($size)) { + case "small": + $width = "121"; + $height = "44"; + break; + case "large": + default: + $width = "117"; + $height = "48"; + break; + } + + if($this->variant == false) { + switch ($variant) { + case false: + $this->variant = "disabled"; + break; + case true: + default: + $this->variant = "text"; + break; + } + } + + + + $data = "
        "; + if ($this->variant == "text") { + $data .= "
        checkout_url . "\"" . ($this->googleAnalytics_id? + " onsubmit=\"setUrchinInputCode();\"":"") . "> + GetXML()) ."//separator//" . + base64_encode($this->CalcHmacSha1($this->GetXML())) . "\"> + server_url."buttons/buy.gif?merchant_id=" . + $this->merchant_id."&w=".$width. "&h=".$height."&style=". + $style."&variant=".$this->variant."&loc=".$loc."\" + height=\"".$height."\" width=\"".$width. "\" />"; + + if($this->googleAnalytics_id) { + $data .= ""; + } + $data .= "
        "; + if($this->googleAnalytics_id) { + $data .= " + + + + "; + } +// ask for link to BuyNow disable button + } else { + $data .= "
        \"Checkout\"server_url."buttons/buy.gif?merchant_id=" . + "".$this->merchant_id."&w=".$width. "&h=".$height."&style=".$style. + "&variant=".$this->variant."&loc=".$loc."\" height=\"".$height."\"". + " width=\"".$width. "\" />
        "; + } + if($showtext) { + $data .=""; + } + $data .= "
        "; + return $data; + } + + + /** + * Get the Google Checkout button's html to be used with the html api. + * + * {@link http://code.google.com/apis/checkout/developer/index.html#google_checkout_buttons} + * + * @param string $size the size of the button, one of 'large', 'medium' or + * 'small'. + * defaults to 'large' + * @param bool $variant true for an enabled button, false for a + * disabled one. defaults to true. will be ignored if + * SetButtonVariant() was used before. + * @param string $loc the locale of the button's text, the only valid value + * is 'en_US' (used as default) + * @param bool $showtext whether to show Google Checkout text or not, + * defaults to true. + * @param string $style the background style of the button, one of 'white' + * or 'trans'. defaults to "trans" + * + * @return string the button's html + */ + function CheckoutHTMLButtonCode($size="large", $variant=true, $loc="en_US", + $showtext=true, $style="trans") { + + switch (strtolower($size)) { + case "medium": + $width = "168"; + $height = "44"; + break; + + case "small": + $width = "160"; + $height = "43"; + break; + case "large": + default: + $width = "180"; + $height = "46"; + break; + } + + if($this->variant == false) { + switch ($variant) { + case false: + $this->variant = "disabled"; + break; + case true: + default: + $this->variant = "text"; + break; + } + } + + + $data = "
        "; + if ($this->variant == "text") { + $data .= "
        checkoutForm_url . "\"" . ($this->googleAnalytics_id? + " onsubmit=\"setUrchinInputCode();\"":"") . ">"; + + $request = $this->GetXML(); + require_once('xml-processing/gc_xmlparser.php'); + $xml_parser = new gc_xmlparser($request); + $root = $xml_parser->GetRoot(); + $XMLdata = $xml_parser->GetData(); + $this->xml2html($XMLdata[$root], '', $data); + $data .= "server_url."buttons/checkout.gif?merchant_id=". + $this->merchant_id."&w=".$width. "&h=".$height."&style=". + $style."&variant=".$this->variant."&loc=".$loc."\" + height=\"".$height."\" width=\"".$width. "\" />"; + + if($this->googleAnalytics_id) { + $data .= ""; + } + $data .= "
        "; + if($this->googleAnalytics_id) { + $data .= " + + + + "; + } + } else { + $data .= "
        \"Checkout\"server_url."buttons/checkout.gif?merchant_id=" . + "".$this->merchant_id."&w=".$width. "&h=".$height."&style=".$style. + "&variant=".$this->variant."&loc=".$loc."\" height=\"".$height."\"". + " width=\"".$width. "\" />
        "; + } + if($showtext){ + $data .= ""; + } + $data .= "
        "; + + + return $data; + + } + + /** + * @access private + */ + function xml2html($data, $path = '', &$rta){ +// global $multiple_tags,$ignore_tags; + // $arr = gc_get_arr_result($data); + foreach($data as $tag_name => $tag) { + if(isset($this->ignore_tags[$tag_name])){ + continue; + } + if(is_array($tag)){ + // echo print_r($tag, true) . $tag_name . "<- tag name\n"; + if(!$this->is_associative_array($data)) { + $new_path = $path . '-' . ($tag_name +1); + } else { + if(isset($this->multiple_tags[$tag_name]) + && $this->is_associative_array($tag) + && !$this->isChildOf($path, $this->multiple_tags[$tag_name])){ + $tag_name .= '-1'; + } + $new_path = $path . (empty($path)?'':'.') . $tag_name; + } + $this->xml2html($tag, $new_path, $rta); + } + else { + $new_path = $path; + if($tag_name != 'VALUE'){ + $new_path = $path . "." . $tag_name; + } + $rta .= ''."\n"; + } + } + } + + // Returns true if a given variable represents an associative array + /** + * @access private + */ + function is_associative_array($var) { + return is_array($var) && !is_numeric(implode('', array_keys($var))); + } + + /** + * @access private + */ + function isChildOf($path='', $parents=array()){ + $intersect =array_intersect(explode('.',$path), $parents); + return !empty($intersect); + } + + /** + * Get the Google Checkout acceptance logos html + * + * {@link http://checkout.google.com/seller/acceptance_logos.html} + * + * @param integer $type the acceptance logo type, valid values: 1, 2, 3 + * + * @return string the logo's html + */ + function CheckoutAcceptanceLogo($type=1) { + switch ($type) { + case 2: + return ''; + break; + case 3: + return ''; + break; + case 1: + default: + return ''; + break; + } + } + + /** + * Calculates the cart's hmac-sha1 signature, this allows google to verify + * that the cart hasn't been tampered by a third-party. + * + * {@link http://code.google.com/apis/checkout/developer/index.html#create_signature} + * + * @param string $data the cart's xml + * @return string the cart's signature (in binary format) + */ + function CalcHmacSha1($data) { + $key = $this->merchant_key; + $blocksize = 64; + $hashfunc = 'sha1'; + if (strlen($key) > $blocksize) { + $key = pack('H*', $hashfunc($key)); + } + $key = str_pad($key, $blocksize, chr(0x00)); + $ipad = str_repeat(chr(0x36), $blocksize); + $opad = str_repeat(chr(0x5c), $blocksize); + $hmac = pack( + 'H*', $hashfunc( + ($key^$opad).pack( + 'H*', $hashfunc( + ($key^$ipad).$data + ) + ) + ) + ); + return $hmac; + } + + //Method used internally to set true/false cart variables + /** + * @access private + */ + function _GetBooleanValue($value, $default) { + switch(strtolower($value)){ + case "true": + return "true"; + break; + case "false": + return"false"; + break; + default: + return $default; + break; + } + } + //Method used internally to set true/false cart variables + // Deprecated, must NOT use eval, bug-prune function + /** + * @access private + */ + function _SetBooleanValue($string, $value, $default) { + $value = strtolower($value); + if($value == "true" || $value == "false") + eval('$this->'.$string.'="'.$value.'";'); + else + eval('$this->'.$string.'="'.$default.'";'); + } + } + + /** + * @abstract + * Abstract class that represents the merchant-private-data. + * + * See {@link MerchantPrivateData} and {@link MerchantPrivateItemData} + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-private-data } + */ + class MerchantPrivate { + var $data; + var $type = "Abstract"; + function MerchantPrivate() { + } + + function AddMerchantPrivateToXML(&$xml_data) { + if(is_array($this->data)) { + $xml_data->Push($this->type); + $this->_recursiveAdd($xml_data, $this->data); + $xml_data->Pop($this->type); + } + else { + $xml_data->Element($this->type, (string)$this->data); + } + } + + /** + * @access private + */ + function _recursiveAdd(&$xml_data, $data){ + foreach($data as $name => $value) { + if(is_array($value)) { + $xml_data->Push($name); + $this->_recursiveAdd($xml_data, $name); + $xml_data->Pop($name); + } + else { + $xml_data->Element($name, (string)$value); + } + } + } + } + + /** + * Class that represents the merchant-private-data. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-private-data } + */ + class MerchantPrivateData extends MerchantPrivate { + /** + * @param mixed $data a string with the data that will go in the + * merchant-private-data tag or an array that will + * be mapped to xml, formatted like (e.g.): + * array('my-order-id' => 34234, + * 'stuff' => array('registered' => 'yes', + * 'category' => 'hip stuff')) + * this will map to: + * + * + * yes + * hip stuff + * + * + */ + function MerchantPrivateData($data = array()) { + $this->data = $data; + $this->type = 'merchant-private-data'; + } + } + + /** + * Class that represents a merchant-private-item-data. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-private-item-data } + */ + class MerchantPrivateItemData extends MerchantPrivate { + /** + * @param mixed $data a string with the data that will go in the + * merchant-private-item-data tag or an array that will + * be mapped to xml, formatted like: + * array('my-item-id' => 34234, + * 'stuff' => array('label' => 'cool', + * 'category' => 'hip stuff')) + * this will map to: + * + * + * + * hip stuff + * + * + */ + function MerchantPrivateItemData($data = array()) { + $this->data = $data; + $this->type = 'merchant-private-item-data'; + } + } diff --git a/modules/gcheckout/library/googleitem.php b/modules/gcheckout/library/googleitem.php new file mode 100644 index 000000000..a04200173 --- /dev/null +++ b/modules/gcheckout/library/googleitem.php @@ -0,0 +1,161 @@ +} + * + * @param string $name the name of the item -- required + * @param string $desc the description of the item -- required + * @param integer $qty the number of units of this item the customer has + * in its shopping cart -- required + * @param double $price the unit price of the item -- required + * @param string $item_weight the weight unit used to specify the item's + * weight, + * one of 'LB' (pounds) or 'KG' (kilograms) + * @param double $numeric_weight the weight of the item + * + */ + function GoogleItem($name, $desc, $qty, $price, $item_weight='', $numeric_weight='') { + $this->item_name = $name; + $this->item_description= $desc; + $this->unit_price = $price; + $this->quantity = $qty; + + if($item_weight != '' && $numeric_weight !== '') { + switch(strtoupper($item_weight)){ + case 'KG': + $this->item_weight = strtoupper($item_weight); + break; + case 'LB': + default: + $this->item_weight = 'LB'; + } + $this->numeric_weight = (double)$numeric_weight; + } + } + + function SetMerchantPrivateItemData($private_data) { + $this->merchant_private_item_data = $private_data; + } + + /** + * Set the merchant item id that the merchant uses to uniquely identify an + * item. Google Checkout will include this value in the + * merchant calculation callbacks + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_merchant-item-id } + * + * @param mixed $item_id the value that identifies this item on the + * merchant's side + * + * @return void + */ + function SetMerchantItemId($item_id) { + $this->merchant_item_id = $item_id; + } + + /** + * Sets the tax table selector which identifies an alternate tax table that + * should be used to calculate tax for a particular item. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_tax-table-selector } + * + * @param string $tax_selector this value should correspond to the name + * of an alternate-tax-table. + * + * @return void + */ + function SetTaxTableSelector($tax_selector) { + $this->tax_table_selector = $tax_selector; + } + + /** + * Used when the item's content is digital, sets whether the merchant will + * send an email to the buyer explaining how to access the digital content. + * Email delivery allows the merchant to charge the buyer for an order + * before allowing the buyer to access the digital content. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_email-delivery } + * + * @param bool $email_delivery true if email_delivery applies, defaults to + * false + * + * @return void + */ + function SetEmailDigitalDelivery($email_delivery='false') { + $this->digital_url = ''; + $this->digital_key = ''; + $this->digital_description = ''; + $this->email_delivery = $email_delivery; + $this->digital_content=true; + } + + /** + * Sets the information related to the digital delivery of the item. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_digital-content } + * + * @param string $digital_url the url the customer must go to download the + * item. --optional + * @param string $digital_key the key which allows to download or unlock the + * digital content item -- optional + * @param string $digital_description instructions for downloading adigital + * content item, 1024 characters max, can + * contain xml-escaped HTML -- optional + * + * @return void + */ + function SetURLDigitalContent($digital_url, $digital_key, $digital_description) { + $this->digital_url = $digital_url; + $this->digital_key = $digital_key; + $this->digital_description = $digital_description; + $this->email_delivery = 'false'; + $this->digital_content = true; + } + } + diff --git a/modules/gcheckout/library/googlelog.php b/modules/gcheckout/library/googlelog.php new file mode 100644 index 000000000..93ea3c14c --- /dev/null +++ b/modules/gcheckout/library/googlelog.php @@ -0,0 +1,96 @@ +logLevel = $logLevel; + if($logLevel == L_OFF) { + $this->logLevel = L_OFF; + } else { + if (!$this->errorLogFile = @fopen($errorLogFile, "a")) { + header('HTTP/1.0 500 Internal Server Error'); + $log = "Cannot open " . $errorLogFile . " file.\n" . + "Logs are not writable, set them to 777"; + error_log($log, 0); + if($die) { + die($log); + }else { + echo $log; + $this->logLevel = L_OFF; + } + } + if (!$this->messageLogFile = @fopen($messageLogFile, "a")) { + fclose($this->errorLogFile); + header('HTTP/1.0 500 Internal Server Error'); + $log = "Cannot open " . $messageLogFile . " file.\n" . + "Logs are not writable, set them to 777"; + error_log($log, 0); + if($die) { + die($log); + }else { + echo $log; + $this->logLevel = L_OFF; + } + } + } + $this->logLevel = $logLevel; + } + + function LogError($log){ + if($this->logLevel & L_ERR){ + fwrite($this->errorLogFile, + sprintf("\n%s:- %s\n",date("D M j G:i:s T Y"),$log)); + return true; + } + return false; + } + + function LogRequest($log){ + if($this->logLevel & L_RQST){ + fwrite($this->messageLogFile, + sprintf("\n%s:- %s\n",date("D M j G:i:s T Y"),$log)); + return true; + } + return false; + } + + function LogResponse($log) { + if($this->logLevel & L_RESP){ + $this->LogRequest($log); + return true; + } + return false; + } +} + diff --git a/modules/gcheckout/library/googlemerchantcalculations.php b/modules/gcheckout/library/googlemerchantcalculations.php new file mode 100644 index 000000000..c5fe5c1eb --- /dev/null +++ b/modules/gcheckout/library/googlemerchantcalculations.php @@ -0,0 +1,115 @@ +results_arr = array(); + $this->currency = $currency; + } + + /** + * Add a result of a merchant calculation to the response to be sent. + * + * @param GoogleResult $results the result of a particular merchant + * calculation + * @return void + */ + function AddResult($results) { + $this->results_arr[] = $results; + } + + /** + * Builds the merchant calculation response xml to be sent to + * Google Checkout. + * + * @return string the response xml + */ + function GetXML() { + require_once('xml-processing/gc_xmlbuilder.php'); + + $xml_data = new gc_XmlBuilder(); + $xml_data->Push('merchant-calculation-results', + array('xmlns' => $this->schema_url)); + $xml_data->Push('results'); + + foreach($this->results_arr as $result) { + if($result->shipping_name != "") { + $xml_data->Push('result', array('shipping-name' => + $result->shipping_name, 'address-id' => $result->address_id)); + $xml_data->Element('shipping-rate', $result->ship_price, + array('currency' => $this->currency)); + $xml_data->Element('shippable', $result->shippable); + } else + $xml_data->Push('result', array('address-id' => $result->address_id)); + + if($result->tax_amount != "") + $xml_data->Element('total-tax', $result->tax_amount, + array('currency' => $this->currency)); + + if((count($result->coupon_arr) != 0) || + (count($result->giftcert_arr) != 0) ) { + $xml_data->Push('merchant-code-results'); + + foreach($result->coupon_arr as $curr_coupon) { + $xml_data->Push('coupon-result'); + $xml_data->Element('valid', $curr_coupon->coupon_valid); + $xml_data->Element('code', $curr_coupon->coupon_code); + $xml_data->Element('calculated-amount', $curr_coupon->coupon_amount, + array('currency'=> $this->currency)); + $xml_data->Element('message', $curr_coupon->coupon_message); + $xml_data->Pop('coupon-result'); + } + foreach($result->giftcert_arr as $curr_gift) { + $xml_data->Push('gift-result'); + $xml_data->Element('valid', $curr_gift->gift_valid); + $xml_data->Element('code', $curr_gift->gift_code); + $xml_data->Element('calculated-amount', $curr_gift->gift_amount, + array('currency'=> $this->currency)); + $xml_data->Element('message', $curr_gift->gift_message); + $xml_data->Pop('gift-result'); + } + $xml_data->Pop('merchant-code-results'); + } + $xml_data->Pop('result'); + } + $xml_data->Pop('results'); + $xml_data->Pop('merchant-calculation-results'); + return $xml_data->GetXML(); + } + } + diff --git a/modules/gcheckout/library/googlerequest.php b/modules/gcheckout/library/googlerequest.php new file mode 100644 index 000000000..3c869aaa1 --- /dev/null +++ b/modules/gcheckout/library/googlerequest.php @@ -0,0 +1,757 @@ +merchant_id = $id; + $this->merchant_key = $key; + $this->currency = $currency; + + if(strtolower($server_type) == "sandbox") { + $this->server_url = "https://sandbox.google.com/checkout/"; + } else { + $this->server_url = "https://checkout.google.com/"; + } + + + $this->schema_url = "http://checkout.google.com/schema/2"; + $this->base_url = $this->server_url . "api/checkout/v2/"; + $this->request_url = $this->base_url . "request/Merchant/" . $this->merchant_id; + $this->merchant_checkout = $this->base_url . "merchantCheckout/Merchant/" . $this->merchant_id; + + ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'.'); + require_once('googlelog.php'); + $this->log = new GoogleLog('', '', L_OFF); + + } + + function SetLogFiles($errorLogFile, $messageLogFile, $logLevel=L_ERR_RQST) { + $this->log = new GoogleLog($errorLogFile, $messageLogFile, $logLevel); + } + /** + * Submit a SetCertificatePath request. + * + * GC Accepted SSL Certs: + * {@link http://googlecheckoutapi.blogspot.com/2007/07/accepting-50-additional-ssl-root-cas.html} + * + * @param string $certPath The name of a file holding one or more certificates + * to verify the peer with + */ + + function SetCertificatePath($certPath) { + $this->certPath = $certPath; + } + + /** + * Submit a server-to-server request. + * + * more info: + * {@link http://code.google.com/apis/checkout/developer/index.html#alternate_technique} + * + * @param string $xml_cart the cart's xml + * @param bool $die whether to die() or not after performing the request, + * defaults to true + * + * @return array with the returned http status code (200 if OK) in index 0 + * and the redirect url returned by the server in index 1 + */ + public function SendServer2ServerCart($xml_cart, $die=true) { + list($status, $body) = $this->SendReq($this->merchant_checkout, + $this->GetAuthenticationHeaders(), $xml_cart); + if($status != 200 ){ + return array($status, $body); + } else { + ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'.'); + require_once('xml-processing/gc_xmlparser.php'); + + $xml_parser = new gc_xmlparser($body); + $root = $xml_parser->GetRoot(); + $data = $xml_parser->GetData(); + + $this->log->logRequest("Redirecting to: ". + $data[$root]['redirect-url']['VALUE']); + header('Location: ' . $data[$root]['redirect-url']['VALUE']); + if($die) { + die($data[$root]['redirect-url']['VALUE']); + } + else { + return array(200, $data[$root]['redirect-url']['VALUE']); + } + } + } + + /** + * Send a command to the Google Checkout server + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#charge_order_example} + * + * @param string $google_order the google id of the order + * @param double $amount the amount to be charged, if empty the whole + * amount of the order will be charged + * + * @return array the status code and body of the response + */ + function SendChargeOrder($google_order, $amount='') { + $postargs = " + schema_url. + "\" google-order-number=\"". $google_order. "\">"; + if ($amount != '') { + $postargs .= "currency . "\">" . + $amount . ""; + } + $postargs .= ""; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout server + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#refund_order_example} + * + * @param string $google_order the google id of the order + * @param double $amount the amount to be refunded, if empty the whole + * amount of the order will be refunded + * @param string $reason the reason why the refund is taking place + * @param string $comment a comment about the refund + * + * @return array the status code and body of the response + */ + function SendRefundOrder($google_order, $amount, $reason, + $comment='') { + $postargs = " + schema_url. + "\" google-order-number=\"". $google_order. "\">" . + "". $reason . ""; + if($amount!=0) { + $postargs .= "currency . "\">". + htmlentities($amount).""; + } + $postargs .= "". htmlentities($comment) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout server + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#refund_order_example} + * + * @param string $google_order the google id of the order + * @param string $reason the reason why the order is being cancelled + * @param string $comment a comment about the cancellation + * + * @return array the status code and body of the response + */ + function SendCancelOrder($google_order, $reason, $comment) { + $postargs = " + schema_url. + "\" google-order-number=\"". $google_order. "\"> + ". + (substr(htmlentities(strip_tags($reason)),0,GOOGLE_REASON_LENGTH)) . + " + ". + (substr(htmlentities(strip_tags($comment)),0,GOOGLE_REASON_LENGTH)) . + " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send an command to the Google Checkout server, which + * will associate a shipper's tracking number with an order. + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#add_tracking_data_example} + * + * @param string $google_order the google id of the order + * @param string $carrier the carrier, valid values are "DHL", "FedEx", + * "UPS", "USPS" and "Other" + * @param string $tracking_no the shipper's tracking number + * + * @return array the status code and body of the response + */ + function SendTrackingData($google_order, $carrier, + $tracking_no) { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order . "\"> + + ". htmlentities($carrier) . " + ". $tracking_no . " + + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send an command to the Google Checkout + * server, which will associate a merchant order number with an order + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#add_merchant_order_number_example} + * + * @param string $google_order the google id of the order + * @param string $merchant_order the merchant id of the order + * + * @return array the status code and body of the response + */ + function SendMerchantOrderNumber($google_order, + $merchant_order, $timeout=false) { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order . "\"> + " . $merchant_order . + " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs, $timeout); + } + + /** + * Send a command to the Google Checkout + * server, which will place a message in the customer's Google Checkout + * account + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#send_buyer_message_example} + * + * @param string $google_order the google id of the order + * @param string $message the message to be sent to the customer + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendBuyerMessage($google_order, $message, + $send_mail="true", $timeout=false) { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order . "\"> + " . + (substr(htmlentities(strip_tags($message)),0,GOOGLE_MESSAGE_LENGTH)) + . " + " . strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs, $timeout); + } + + /** + * Send a command to the Google Checkout + * server, which will update an order's fulfillment state from NEW to + * PROCESSING + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#process_order_example} + * + * @param string $google_order the google id of the order + * + * @return array the status code and body of the response + */ + function SendProcessOrder($google_order) { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order. "\"/> "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout server, which + * will update an order's fulfillment state from either NEW or PROCESSING + * to DELIVERED + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#deliver_order_example} + * + * @param string $google_order the google id of the order + * @param string $carrier the carrier, valid values are "DHL", "FedEx", + * "UPS", "USPS" and "Other" + * @param string $tracking_no the shipper's tracking number + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendDeliverOrder($google_order, $carrier="", + $tracking_no="", $send_mail = "true") { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order . "\">"; + if($carrier != "" && $tracking_no != "") { + $postargs .= " + ". htmlentities($carrier) . " + ". htmlentities($tracking_no) . " + "; + } + $postargs .= "". strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout + * server, which removes an order from the merchant's Merchant Center Inbox + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#archive_order_example} + * + * @param string $google_order the google id of the order + * + * @return array the status code and body of the response + */ + function SendArchiveOrder($google_order) { + $postargs = " + schema_url. + "\" google-order-number=\"". $google_order. "\"/>"; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout + * server, which returns a previously archived order to the merchant's + * Merchant Center Inbox + * + * info: {@link http://code.google.com/apis/checkout/developer/index.html#unarchive_order_example} + * + * @param string $google_order the google id of the order + * + * @return array the status code and body of the response + */ + function SendUnarchiveOrder($google_order) { + $postargs = " + schema_url."\" google-order-number=\"". + $google_order. "\"/>"; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + +/** + * Ship items API Commands + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html} + * + * + */ + + /** + * Send a command to the Google Checkout + * server, + * + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html#tag_ship-items} + * + * @param string $google_order the google id of the order + * @param array $items_list a list of GoogleShipItem classes. + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + + function SendShipItems($google_order, $items_list=array(), $send_mail="true") { + $postargs = " + schema_url . + "\" google-order-number=\"". $google_order . "\">" . + "\n"; + foreach($items_list as $item) { + $postargs .= " + + " . $item->merchant_item_id . " + \n"; + + if(count($item->tracking_data_list)) { + $postargs .= "\n"; + foreach($item->tracking_data_list as $tracking_data) { + $postargs .= " + ". htmlentities($tracking_data['carrier']) . " + ". $tracking_data['tracking-number'] . " + \n"; + } + $postargs .= "\n"; + } + $postargs .= "\n"; + } + $postargs .= "\n" . + "". strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + + } + + /** + * Send a command to the Google Checkout + * + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html#tag_backorder-items} + * + * @param string $google_order the google id of the order + * @param array $items_list a list of GoogleShipItem classes. + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendBackorderItems($google_order, $items_list=array(), $send_mail="true") { + $postargs = " + schema_url."\" google-order-number=\"". + $google_order. "\">"; + $postargs .= ""; + foreach($items_list as $item) { + $postargs .= " + " . $item->merchant_item_id . " + "; + } + $postargs .= ""; + $postargs .= "". strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout + * + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html#tag_cancel-items} + * + * @param string $google_order the google id of the order + * @param array $items_list a list of GoogleShipItem classes. + * @param string $reason the reason why the refund is taking place + * @param string $comment a comment about the refund + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendCancelItems($google_order, $items_list=array(), $reason, + $comment='', $send_mail="true") { + $postargs = " + schema_url."\" google-order-number=\"". + $google_order. "\">"; + $postargs .= ""; + foreach($items_list as $item) { + $postargs .= " + " . $item->merchant_item_id . " + "; + } + $postargs .= ""; + $postargs .= "". strtolower($send_mail) . " + ". + (substr(htmlentities(strip_tags($reason)),0,GOOGLE_REASON_LENGTH)) . + " + ". + (substr(htmlentities(strip_tags($comment)),0,GOOGLE_REASON_LENGTH)) . + " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout + * + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html#tag_return-items} + * + * @param string $google_order the google id of the order + * @param array $items_list a list of GoogleShipItem classes. + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendReturnItems($google_order, $items_list=array(), $send_mail="true") { + $postargs = " + schema_url."\" google-order-number=\"". + $google_order. "\">"; + $postargs .= ""; + foreach($items_list as $item) { + $postargs .= " + " . $item->merchant_item_id . " + "; + } + $postargs .= ""; + $postargs .= "". strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * Send a command to the Google Checkout + * + * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Line_Item_Shipping.html#tag_reset-items-shipping-information} + * + * @param string $google_order the google id of the order + * @param array $items_list a list of GoogleShipItem classes. + * @param string $send_email whether Google should send an email to + * the buyer, use "true" or"false", + * defaults to "true" + * + * @return array the status code and body of the response + */ + function SendResetItemsShippingInformation($google_order, $items_list=array(), $send_mail="true") { + $postargs = " + schema_url."\" google-order-number=\"". + $google_order. "\">"; + $postargs .= ""; + foreach($items_list as $item) { + $postargs .= " + " . $item->merchant_item_id . " + "; + } + $postargs .= ""; + $postargs .= "". strtolower($send_mail) . " + "; + return $this->SendReq($this->request_url, + $this->GetAuthenticationHeaders(), $postargs); + } + + /** + * @access private + */ + function GetAuthenticationHeaders() { + $headers = array(); + $headers[] = "Authorization: Basic ".base64_encode( + $this->merchant_id.':'.$this->merchant_key); + $headers[] = "Content-Type: application/xml; charset=UTF-8"; + $headers[] = "Accept: application/xml; charset=UTF-8"; + $headers[] = "User-Agent: GC-PHP-Sample_code (" . PHP_SAMPLE_CODE_VERSION . "/ropu)"; + return $headers; + } + /** + * Set the proxy to be used by the connections to the outside + * + * @param array $proxy Array('host' => 'proxy-host', 'port' => 'proxy-port') + * + */ + function SetProxy($proxy=array()) { + if(is_array($proxy) && count($proxy)) { + $this->proxy['host'] = $proxy['host']; + $this->proxy['port'] = $proxy['port']; + } + } + + /** + * @access private + */ + function SendReq($url, $header_arr, $postargs, $timeout=false) { + // Get the curl session object + $session = curl_init($url); + $this->log->LogRequest($postargs); + // Set the POST options. + curl_setopt($session, CURLOPT_POST, true); + curl_setopt($session, CURLOPT_HTTPHEADER, $header_arr); + curl_setopt($session, CURLOPT_POSTFIELDS, $postargs); + curl_setopt($session, CURLOPT_HEADER, true); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + + if(!empty($this->certPath) && file_exists($this->certPath)) { + curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($session, CURLOPT_CAINFO, $this->certPath); + } + else { + curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false); + } + + if(is_array($this->proxy) && count($this->proxy)) { + curl_setopt($session, CURLOPT_PROXY, + $this->proxy['host'] . ":" . $this->proxy['port']); + } + if($timeout != false){ + curl_setopt($session, CURLOPT_TIMEOUT, $timeout); + + } + // Do the POST and then close the session + $response = curl_exec($session); + if (curl_errno($session)) { + $this->log->LogError(curl_error($session)); + return array("CURL_ERR", curl_error($session)); + } else { + curl_close($session); + } + $heads = $this->parse_headers($response); + $body = $this->get_body_x($response); + +// // Get HTTP Status code from the response + $status_code = array(); + preg_match('/\d\d\d/', $heads[0], $status_code); + + // Check for errors + switch( $status_code[0] ) { + case 200: + // Success + $this->log->LogResponse($response); + return array(200, $body); + break; + case 503: + $this->log->LogError($response); + return array(503, htmlentities($body)); + break; + case 403: + $this->log->LogError($response); + return array(403, htmlentities($body)); + break; + case 400: + $this->log->LogError($response); + return array(400, htmlentities($body)); + break; + default: + $this->log->LogError($response); + return array("ERR", htmlentities($body)); + break; + } + } + +// Private functions +// Function to get HTTP headers, +// will also work with HTTP 200 status added by some proxy servers + /** + * @access private + */ + function parse_headers($message) { + $head_end = strpos($message, DOUBLE_ENTER); + $headers = $this->get_headers_x(substr($message,0, + $head_end + strlen(DOUBLE_ENTER))); + if(!is_array($headers) || empty($headers)){ + return null; + } + if(!preg_match('%[HTTP/\d\.\d] (\d\d\d)%', $headers[0], $status_code)) { + return null; + } + switch( $status_code[1] ) { + case '200': + $parsed = $this->parse_headers(substr($message, + $head_end + strlen(DOUBLE_ENTER))); + return is_null($parsed)?$headers:$parsed; + break; + default: + return $headers; + break; + } + } + + /** + * @access private + */ + function get_headers_x($heads, $format=0) { + $fp = explode(ENTER, $heads); + foreach($fp as $header){ + if($header == "") { + $eoheader = true; + break; + } else { + $header = trim($header); + } + + if($format == 1) { + $key = array_shift(explode(':',$header)); + if($key == $header) { + $headers[] = $header; + } else { + $headers[$key]=substr($header,strlen($key)+2); + } + unset($key); + } else { + $headers[] = $header; + } + } + return $headers; + } + + /** + * @access private + */ + function get_body_x($heads){ + $fp = explode(DOUBLE_ENTER, $heads, 2); + return $fp[1]; + } + } + +class GoogleShipItem { + var $merchant_item_id; + var $tracking_data_list; + var $tracking_no; + + function GoogleShipItem($merchant_item_id, $tracking_data_list=array()) { + $this->merchant_item_id = $merchant_item_id; + $this->tracking_data_list = $tracking_data_list; + } + + function AddTrackingData($carrier, $tracking_no) { + if($carrier != "" && $tracking_no != "") { + $this->tracking_data_list[] = array('carrier' => $carrier, + 'tracking-number' => $tracking_no); + } + } +} diff --git a/modules/gcheckout/library/googleresponse.php b/modules/gcheckout/library/googleresponse.php new file mode 100644 index 000000000..ba564d67d --- /dev/null +++ b/modules/gcheckout/library/googleresponse.php @@ -0,0 +1,221 @@ +merchant_id = $id; + $this->merchant_key = $key; + $this->schema_url = "http://checkout.google.com/schema/2"; + ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'.'); + require_once('googlelog.php'); + $this->log = new GoogleLog('', '', L_OFF); + } + + /** + * @param string $id the merchant id + * @param string $key the merchant key + */ + function SetMerchantAuthentication($id, $key){ + $this->merchant_id = $id; + $this->merchant_key = $key; + } + + function SetLogFiles($errorLogFile, $messageLogFile, $logLevel=L_ERR_RQST) { + $this->log = new GoogleLog($errorLogFile, $messageLogFile, $logLevel); + } + + /** + * Verifies that the authentication sent by Google Checkout matches the + * merchant id and key + * + * @param string $headers the headers from the request + */ + function HttpAuthentication($headers=null, $die=true) { + if(!is_null($headers)) { + $_SERVER = $headers; + } + if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { + $compare_mer_id = $_SERVER['PHP_AUTH_USER']; + $compare_mer_key = $_SERVER['PHP_AUTH_PW']; + } + // IIS Note:: For HTTP Authentication to work with IIS, + // the PHP directive cgi.rfc2616_headers must be set to 0 (the default value). + else if(isset($_SERVER['HTTP_AUTHORIZATION'])){ + list($compare_mer_id, $compare_mer_key) = explode(':', + base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], + strpos($_SERVER['HTTP_AUTHORIZATION'], " ") + 1))); + } else if(isset($_SERVER['Authorization'])) { + list($compare_mer_id, $compare_mer_key) = explode(':', + base64_decode(substr($_SERVER['Authorization'], + strpos($_SERVER['Authorization'], " ") + 1))); + } else { + $this->SendFailAuthenticationStatus( + "Failed to Get Basic Authentication Headers",$die); + return false; + } + if($compare_mer_id != $this->merchant_id + || $compare_mer_key != $this->merchant_key) { + $this->SendFailAuthenticationStatus("Invalid Merchant Id/Key Pair",$die); + return false; + } + return true; + } + + function ProcessMerchantCalculations($merchant_calc) { + $this->SendOKStatus(); + $result = $merchant_calc->GetXML(); + echo $result; + } + +// Notification API + function ProcessNewOrderNotification() { + $this->SendAck(); + } + function ProcessRiskInformationNotification() { + $this->SendAck(); + } + function ProcessOrderStateChangeNotification() { + $this->SendAck(); + } +// Amount Notifications + function ProcessChargeAmountNotification() { + $this->SendAck(); + } + function ProcessRefundAmountNotification() { + $this->SendAck(); + } + function ProcessChargebackAmountNotification() { + $this->SendAck(); + } + function ProcessAuthorizationAmountNotification() { + $this->SendAck(); + } + + function SendOKStatus() { + header('HTTP/1.0 200 OK'); + } + + /** + * Set the response header indicating an erroneous authentication from + * Google Checkout + * + * @param string $msg the message to log + */ + function SendFailAuthenticationStatus($msg="401 Unauthorized Access", + $die=true) { + $this->log->logError($msg); + header('WWW-Authenticate: Basic realm="GoogleCheckout PHPSample Code"'); + header('HTTP/1.0 401 Unauthorized'); + if($die) { + die($msg); + } else { + echo $msg; + } + } + + /** + * Set the response header indicating a malformed request from Google + * Checkout + * + * @param string $msg the message to log + */ + function SendBadRequestStatus($msg="400 Bad Request", $die=true) { + $this->log->logError($msg); + header('HTTP/1.0 400 Bad Request'); + if($die) { + die($msg); + } else { + echo $msg; + } + } + + /** + * Set the response header indicating that an internal error ocurred and + * the notification sent by Google Checkout can't be processed right now + * + * @param string $msg the message to log + */ + function SendServerErrorStatus($msg="500 Internal Server Error", + $die=true) { + $this->log->logError($msg); + header('HTTP/1.0 500 Internal Server Error'); + if($die) { + die($msg); + } else { + echo $msg; + } + } + + /** + * Send an acknowledgement in response to Google Checkout's request + */ + function SendAck($die=true) { + $this->SendOKStatus(); + $acknowledgment = "" . + "schema_url . "\"/>"; + $this->log->LogResponse($acknowledgment); + if($die) { + die($acknowledgment); + } else { + echo $acknowledgment; + } + } + + /** + * @access private + */ + function GetParsedXML($request=null){ + if(!is_null($request)) { + $this->log->LogRequest($request); + $this->response = $request; + ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.'.'); + require_once('xml-processing/gc_xmlparser.php'); + + $this->xml_parser = new gc_xmlparser($request); + $this->root = $this->xml_parser->GetRoot(); + $this->data = $this->xml_parser->GetData(); + } + return array($this->root, $this->data); + } + } diff --git a/modules/gcheckout/library/googleresult.php b/modules/gcheckout/library/googleresult.php new file mode 100644 index 000000000..2123cb1de --- /dev/null +++ b/modules/gcheckout/library/googleresult.php @@ -0,0 +1,105 @@ +} + */ + // refer to demo/responsehandlerdemo.php for usage of this code + class GoogleResult { + var $shipping_name; + var $address_id; + var $shippable; + var $ship_price; + + var $tax_amount; + + var $coupon_arr = array(); + var $giftcert_arr = array(); + + /** + * @param integer $address_id the id of the anonymous address sent by + * Google Checkout. + */ + function GoogleResult($address_id) { + $this->address_id = $address_id; + } + + function SetShippingDetails($name, $price, $shippable = "true") { + $this->shipping_name = $name; + $this->ship_price = $price; + $this->shippable = $shippable; + } + + function SetTaxDetails($amount) { + $this->tax_amount = $amount; + } + + function AddCoupons($coupon) { + $this->coupon_arr[] = $coupon; + } + + function AddGiftCertificates($gift) { + $this->giftcert_arr[] = $gift; + } + } + + /** + * This is a class used to return the results of coupons the buyer supplied in + * the order page. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_coupon-result } + */ + class GoogleCoupons { + var $coupon_valid; + var $coupon_code; + var $coupon_amount; + var $coupon_message; + + function googlecoupons($valid, $code, $amount, $message) { + $this->coupon_valid = $valid; + $this->coupon_code = $code; + $this->coupon_amount = $amount; + $this->coupon_message = $message; + } + } + + /** + * This is a class used to return the results of gift certificates + * supplied by the buyer on the place order page + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_gift-certificate-result} + */ + + class GoogleGiftcerts { + var $gift_valid; + var $gift_code; + var $gift_amount; + var $gift_message; + + function googlegiftcerts($valid, $code, $amount, $message) { + $this->gift_valid = $valid; + $this->gift_code = $code; + $this->gift_amount = $amount; + $this->gift_message = $message; + } + } + diff --git a/modules/gcheckout/library/googleshipping.php b/modules/gcheckout/library/googleshipping.php new file mode 100644 index 000000000..043c9e3a0 --- /dev/null +++ b/modules/gcheckout/library/googleshipping.php @@ -0,0 +1,532 @@ +name = $name; + $this->price = $price; + } + + /** + * Adds a restriction to this shipping. + * + * @param GoogleShippingFilters $restrictions the shipping restrictions + */ + function AddShippingRestrictions($restrictions) { + $this->shipping_restrictions = $restrictions; + } + } + + /** + * Represents a merchant calculated shipping + * + * info: + * {@link http://code.google.com/apis/checkout/developer/index.html#shipping_xsd} + * {@link http://code.google.com/apis/checkout/developer/index.html#merchant_calculations_specifying} + */ + class GoogleMerchantCalculatedShipping { + + var $price; + var $name; + var $type = "merchant-calculated-shipping"; + var $shipping_restrictions; + var $address_filters; + + /** + * @param string $name a name for the shipping + * @param double $price the default price for this shipping, used if the + * calculation can't be made for some reason. + */ + function GoogleMerchantCalculatedShipping($name, $price) { + $this->price = $price; + $this->name = $name; + } + + /** + * Adds a restriction to this shipping. + * + * @param GoogleShippingFilters $restrictions the shipping restrictions + */ + function AddShippingRestrictions($restrictions) { + $this->shipping_restrictions = $restrictions; + } + + /** + * Adds an address filter to this shipping. + * + * @param GoogleShippingFilters $filters the address filters + */ + function AddAddressFilters($filters) { + $this->address_filters = $filters; + } + } + + /** + * Represents carrier calculated shipping + */ + class GoogleCarrierCalculatedShipping { + + var $name; + var $type = "carrier-calculated-shipping"; + + var $CarrierCalculatedShippingOptions = array(); +// var $ShippingPackages = array(); + var $ShippingPackage; + + /** + * @param string $name the name of this shipping + */ + function GoogleCarrierCalculatedShipping($name) { + $this->name = $name; + } + + /** + * @param GoogleCarrierCalculatedShippingOption $option the option to be + * added to the carrier calculated shipping + */ + function addCarrierCalculatedShippingOptions($option){ + $this->CarrierCalculatedShippingOptions[] = $option; + } + + /** + * @param GoogleShippingPackage $package + */ + function addShippingPackage($package){ +// $this->ShippingPackages[] = $package; + $this->ShippingPackage = $package; + } + } + + /** + * Represents a shipping method for which Google Checkout will obtain + * shipping costs for the order. + */ + class GoogleCarrierCalculatedShippingOption { + + var $price; + var $shipping_company; + var $shipping_type; + var $carrier_pickup; + var $additional_fixed_charge; + var $additional_variable_charge_percent; +// var $shipping_restrictions; +// var $address_filters; + + /** + * @param double $price the default shipping cost to be used if Google is + * unable to obtain the shipping_company's shipping rate for + * the option + * @param string $shipping_company the name of the shipping_company + * @param string $shipping_type the shipping option, valid values are here: + * http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Carrier_Calculated_Shipping.html#tag_shipping-type + * @param double $additional_fixed_charge a handling charge that will be + * added to the total cost of the order if this shipping option is selected. + * defaults to 0 + * @param double $additional_variable_charge_percent A percentage by which + * the shipping rate will be adjusted. The value may be positive or + * negative. defaults to 0. + * @param string $carrier_pickup Specifies how the package will be + * transfered from the merchand to the shipper. Valid values are + * "REGULAR_PICKUP", "SPECIAL_PICKUP", "DROP_OFF". Defaults to "DROP_OFF". + * + */ + function GoogleCarrierCalculatedShippingOption($price, $shipping_company, + $shipping_type, $additional_fixed_charge=0, + $additional_variable_charge_percent=0, $carrier_pickup='DROP_OFF') { + $this->price = (double)$price; + $this->shipping_company = $shipping_company; + $this->shipping_type = trim($shipping_type); + switch(strtoupper($carrier_pickup)){ + case 'DROP_OFF': + case 'REGULAR_PICKUP': + case 'SPECIAL_PICKUP': + $this->carrier_pickup = $carrier_pickup; + break; + default: + $this->carrier_pickup = 'DROP_OFF'; + } + if($additional_fixed_charge){ + $this->additional_fixed_charge = (double)$additional_fixed_charge; + } + if($additional_variable_charge_percent){ + $this->additional_variable_charge_percent = (double)$additional_variable_charge_percent; + } + } + +// function AddShippingRestrictions($restrictions) { +// $this->shipping_restrictions = $restrictions; +// } +// +// function AddAddressFilters($filters) { +// $this->address_filters = $filters; +// } + } + + /** + * Represents an individual package that will be shipped to the buyer. + */ + class GoogleShippingPackage { + + var $width; + var $length; + var $height; + var $unit; + var $ship_from; + var $delivery_address_category; + + /** + * @param GoogleShipFrom $ship_from where the package ships from + * @param double $width the width of the package + * @param double $length the length of the package + * @param double $height the height of the package + * @param string $unit the unit used to measure the width/length/height + * of the package, valid values "IN", "CM" + * @param string $delivery_address_category indicates whether the shipping + * method should be applied to a residential or commercial address, valid + * values are "RESIDENTIAL", "COMMERCIAL" + */ + function GoogleShippingPackage($ship_from, $width, $length, $height, $unit, + $delivery_address_category='RESIDENTIAL') { + $this->width = (double)$width; + $this->length = (double)$length; + $this->height = (double)$height; + switch(strtoupper($unit)){ + case 'CM': + $this->unit = strtoupper($unit); + break; + case 'IN': + default: + $this->unit = 'IN'; + } + + $this->ship_from = $ship_from; + switch(strtoupper($delivery_address_category)){ + case 'COMMERCIAL': + $this->delivery_address_category = strtoupper($delivery_address_category); + break; + case 'RESIDENTIAL': + default: + $this->delivery_address_category = 'RESIDENTIAL'; + } + } + } + + /** + * Represents the location from where packages will be shipped from. + * Used with {@link GoogleShippingPackage}. + */ + class GoogleShipFrom { + var $id; + var $city; + var $country_code; + var $postal_code; + var $region; + + /** + * @param string $id an id for this address + * @param string $city the city + * @param string $country_code a 2-letter iso country code + * @param string $postal_code the zip + * @param string $region the region + */ + function GoogleShipFrom($id, $city, $country_code, + $postal_code, $region) { + $this->id = $id; + $this->city = $city; + $this->country_code = $country_code; + $this->postal_code = $postal_code; + $this->region = $region; + } + } + + /** + * + * Shipping restrictions contain information about particular areas where + * items can (or cannot) be shipped. + * + * More info: + * {@link http://code.google.com/apis/checkout/developer/index.html#tag_shipping-restrictions} + * + * Address filters identify areas where a particular merchant-calculated + * shipping method is available or unavailable. Address filters are applied + * before Google Checkout sends a to the + * merchant. Google Checkout will not ask you to calculate the cost of a + * particular shipping method for an address if the address filters in the + * Checkout API request indicate that the method is not available for the + * address. + * + * More info: + * {@link http://code.google.com/apis/checkout/developer/index.html#tag_address-filters} + */ + class GoogleShippingFilters { + + var $allow_us_po_box = true; + + var $allowed_restrictions = false; + var $excluded_restrictions = false; + + var $allowed_world_area = false; + var $allowed_country_codes_arr; + var $allowed_postal_patterns_arr; + var $allowed_country_area; + var $allowed_state_areas_arr; + var $allowed_zip_patterns_arr; + + var $excluded_country_codes_arr; + var $excluded_postal_patterns_arr; + var $excluded_country_area; + var $excluded_state_areas_arr; + var $excluded_zip_patterns_arr; + + function GoogleShippingFilters() { + $this->allowed_country_codes_arr = array(); + $this->allowed_postal_patterns_arr = array(); + $this->allowed_state_areas_arr = array(); + $this->allowed_zip_patterns_arr = array(); + + $this->excluded_country_codes_arr = array(); + $this->excluded_postal_patterns_arr = array(); + $this->excluded_state_areas_arr = array(); + $this->excluded_zip_patterns_arr = array(); + } + + /** + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_allow-us-po-box } + * + * @param bool $allow_us_po_box whether to allow delivery to PO boxes in US, + * defaults to true + */ + function SetAllowUsPoBox($allow_us_po_box = true) { + $this->allow_us_po_box = $allow_us_po_box; + } + + /** + * Set the world as allowed delivery area. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_world-area } + * + * @param bool $world_area Set worldwide allowed shipping, defaults to true + */ + function SetAllowedWorldArea($world_area = true) { + $this->allowed_restrictions = true; + $this->allowed_world_area = $world_area; + } + + // Allows + /** + * Add a postal area to be allowed for delivery. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_postal-area } + * + * @param string $country_code 2-letter iso country code + * @param string $postal_pattern Pattern that matches the postal areas to + * be allowed, as defined in {@link http://code.google.com/apis/checkout/developer/index.html#tag_postal-code-pattern} + */ + function AddAllowedPostalArea($country_code, $postal_pattern = "") { + $this->allowed_restrictions = true; + $this->allowed_country_codes_arr[] = $country_code; + $this->allowed_postal_patterns_arr[]= $postal_pattern; + } + + /** + * Add a us country area to be allowed for delivery. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_us-country-area } + * + * @param string $country_area the area to allow, one of "CONTINENTAL", + * "FULL_50_STATES" or "ALL" + * + */ + function SetAllowedCountryArea($country_area) { + switch ($country_area) { + case "CONTINENTAL_48": + case "FULL_50_STATES": + case "ALL": + $this->allowed_country_area = $country_area; + $this->allowed_restrictions = true; + break; + default: + $this->allowed_country_area = ""; + break; + } + } + + /** + * Allow shipping to areas specified by state. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_us-state-area } + * + * @param array $areas Areas to be allowed + */ + function SetAllowedStateAreas($areas) { + $this->allowed_restrictions = true; + $this->allowed_state_areas_arr = $areas; + } + + /** + * Allow shipping to areas specified by state. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_us-state-area } + * + * @param string $area Area to be allowed + */ + function AddAllowedStateArea($area) { + $this->allowed_restrictions = true; + $this->allowed_state_areas_arr[] = $area; + } + + /** + * Allow shipping to areas specified by zip patterns. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_us-zip-area } + * + * @param array $zips + */ + function SetAllowedZipPatterns($zips) { + $this->allowed_restrictions = true; + $this->allowed_zip_patterns_arr = $zips; + } + + /** + * Allow shipping to area specified by zip pattern. + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_us-zip-area } + * + * @param string + */ + function AddAllowedZipPattern($zip) { + $this->allowed_restrictions = true; + $this->allowed_zip_patterns_arr[] = $zip; + } + + /** + * Exclude postal areas from shipping. + * + * @see AddAllowedPostalArea + */ + function AddExcludedPostalArea($country_code, $postal_pattern = "") { + $this->excluded_restrictions = true; + $this->excluded_country_codes_arr[] = $country_code; + $this->excluded_postal_patterns_arr[]= $postal_pattern; + } + + /** + * Exclude state areas from shipping. + * + * @see SetAllowedStateAreas + */ + function SetExcludedStateAreas($areas) { + $this->excluded_restrictions = true; + $this->excluded_state_areas_arr = $areas; + } + + /** + * Exclude state area from shipping. + * + * @see AddAllowedStateArea + */ + function AddExcludedStateArea($area) { + $this->excluded_restrictions = true; + $this->excluded_state_areas_arr[] = $area; + } + + /** + * Exclude shipping to area specified by zip pattern. + * + * @see SetAllowedZipPatterns + */ + function SetExcludedZipPatternsStateAreas($zips) { + $this->excluded_restrictions = true; + $this->excluded_zip_patterns_arr = $zips; + } + + /** + * Exclude shipping to area specified by zip pattern. + * + * @see AddExcludedZipPattern + */ + function SetAllowedZipPatternsStateArea($zip) { + $this->excluded_restrictions = true; + $this->excluded_zip_patterns_arr[] = $zip; + } + + /** + * Exclude shipping to country area + * + * @see SetAllowedCountryArea + */ + function SetExcludedCountryArea($country_area) { + switch ($country_area) { + case "CONTINENTAL_48": + case "FULL_50_STATES": + case "ALL": + $this->excluded_country_area = $country_area; + $this->excluded_restrictions = true; + break; + + default: + $this->excluded_country_area = ""; + break; + } + } + } + + /** + * Used as a shipping option in which neither a carrier nor a ship-to + * address is specified + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_pickup} + */ + class GooglePickUp { + + var $price; + var $name; + var $type = "pickup"; + + /** + * @param string $name the name of this shipping option + * @param double $price the handling cost (if there is one) + */ + function GooglePickUp($name, $price) { + $this->price = $price; + $this->name = $name; + } + } + diff --git a/modules/gcheckout/library/googletax.php b/modules/gcheckout/library/googletax.php new file mode 100644 index 000000000..45023227d --- /dev/null +++ b/modules/gcheckout/library/googletax.php @@ -0,0 +1,146 @@ +world_area = $world_area; + } + + function AddPostalArea($country_code, $postal_pattern = "") { + $this->country_codes_arr[] = $country_code; + $this->postal_patterns_arr[]= $postal_pattern; + } + + function SetStateAreas($areas) { + if(is_array($areas)) + $this->state_areas_arr = $areas; + else + $this->state_areas_arr = array($areas); + } + + function SetZipPatterns($zips) { + if(is_array($zips)) + $this->zip_patterns_arr = $zips; + else + $this->zip_patterns_arr = array($zips); + } + + function SetCountryArea($country_area) { + switch ($country_area) { + case "CONTINENTAL_48": + case "FULL_50_STATES": + case "ALL": + $this->country_area = $country_area; + break; + default: + $this->country_area = ""; + break; + } + } + } + + /** + * Represents a default tax rule + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_default-tax-rule } + */ + class GoogleDefaultTaxRule extends GoogleTaxRule { + + var $shipping_taxed = false; + + function GoogleDefaultTaxRule($tax_rate, $shipping_taxed = "false") { + $this->tax_rate = $tax_rate; + $this->shipping_taxed= $shipping_taxed; + + $this->country_codes_arr = array(); + $this->postal_patterns_arr = array(); + $this->state_areas_arr = array(); + $this->zip_patterns_arr = array(); + } + } + + /** + * Represents an alternate tax rule + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_alternate-tax-rule } + */ + class GoogleAlternateTaxRule extends GoogleTaxRule { + + function GoogleAlternateTaxRule($tax_rate) { + $this->tax_rate = $tax_rate; + + $this->country_codes_arr = array(); + $this->postal_patterns_arr = array(); + $this->state_areas_arr = array(); + $this->zip_patterns_arr = array(); + } + + } + + + /** + * Represents an alternate tax table + * + * GC tag: {@link http://code.google.com/apis/checkout/developer/index.html#tag_alternate-tax-table } + */ + class GoogleAlternateTaxTable { + + var $name; + var $tax_rules_arr; + var $standalone; + + function GoogleAlternateTaxTable($name = "", $standalone = "false") { + if($name != "") { + $this->name = $name; + $this->tax_rules_arr = array(); + $this->standalone = $standalone; + } + } + + function AddAlternateTaxRules($rules) { + $this->tax_rules_arr[] = $rules; + } + } + + + diff --git a/modules/gcheckout/library/xml-processing/gc_xmlbuilder.php b/modules/gcheckout/library/xml-processing/gc_xmlbuilder.php new file mode 100644 index 000000000..711bd2abb --- /dev/null +++ b/modules/gcheckout/library/xml-processing/gc_xmlbuilder.php @@ -0,0 +1,94 @@ +indent = $indent; + $this->xml = ''."\n"; + } + + function _indent() { + for ($i = 0, $j = count($this->stack); $i < $j; $i++) { + $this->xml .= $this->indent; + } + } + + //Used when an element has sub-elements + // This function adds an open tag to the output + function Push($element, $attributes = array()) { + $this->_indent(); + $this->xml .= '<'.$element; + foreach ($attributes as $key => $value) { + $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; + } + $this->xml .= ">\n"; + $this->stack[] = $element; + } + + //Used when an element has no subelements. + //Data within the open and close tags are provided with the + //contents variable + function Element($element, $content, $attributes = array()) { + $this->_indent(); + $this->xml .= '<'.$element; + foreach ($attributes as $key => $value) { + $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; + } + $this->xml .= '>'.htmlentities($content).''."\n"; + } + + function EmptyElement($element, $attributes = array()) { + $this->_indent(); + $this->xml .= '<'.$element; + foreach ($attributes as $key => $value) { + $this->xml .= ' '.$key.'="'.htmlentities($value).'"'; + } + $this->xml .= " />\n"; + } + + //Used to close an open tag + function Pop($pop_element) { + $element = array_pop($this->stack); + $this->_indent(); + if($element !== $pop_element) + die('XML Error: Tag Mismatch when trying to close "'. $pop_element. '"'); + else + $this->xml .= "\n"; + } + + function GetXML() { + if(count($this->stack) != 0) + die ('XML Error: No matching closing tag found for " '. array_pop($this->stack). '"'); + else + return $this->xml; + } + } + diff --git a/modules/gcheckout/library/xml-processing/gc_xmlparser.php b/modules/gcheckout/library/xml-processing/gc_xmlparser.php new file mode 100644 index 000000000..027267e74 --- /dev/null +++ b/modules/gcheckout/library/xml-processing/gc_xmlparser.php @@ -0,0 +1,202 @@ +) + Accept multiple options in a second parameter +* +**/ + +/* This uses SAX parser to convert XML data into PHP associative arrays + * When invoking the constructor with the input data, strip out the first XML line + * + * Member field Description: + * $params: This stores the XML data. The attributes and contents of XML tags + * can be accessed as follows + * + * + * data 1 + * + * data 2 + * + * + * + * print_r($this->params) will return + Array +( + [addresses] => Array + ( + [anonymous-address] => Array + ( + [0] => Array + ( + [id] => 123 + [test] => Array + ( + [VALUE] => data 1 + ) + + ) + + [1] => Array + ( + [id] => 456 + [test] => Array + ( + [VALUE] => data 2 + ) + + ) + + ) + + ) + +) + * gc_xmlparser returns an empty params array if it encounters + * any error during parsing + */ + // XML to Array + class gc_xmlparser { + + var $params = array(); //Stores the object representation of XML data + var $root = NULL; + var $global_index = -1; + var $fold = false; + + /* Constructor for the class + * Takes in XML data as input( do not include the tag + */ + function gc_xmlparser($input, $xmlParams=array(XML_OPTION_CASE_FOLDING => 0)) { + $xmlp = xml_parser_create(); + foreach($xmlParams as $opt => $optVal) { + switch( $opt ) { + case XML_OPTION_CASE_FOLDING: + $this->fold = $optVal; + break; + default: + break; + } + xml_parser_set_option($xmlp, $opt, $optVal); + } + + if(xml_parse_into_struct($xmlp, $input, $vals, $index)) { + $this->root = $this->_foldCase($vals[0]['tag']); + $this->params = $this->xml2ary($vals); + } + xml_parser_free($xmlp); + } + + function _foldCase($arg) { + return( $this->fold ? strtoupper($arg) : $arg); + } + +/* + * Credits for the structure of this function + * http://mysrc.blogspot.com/2007/02/php-xml-to-array-and-backwards.html + * + * Adapted by Ropu - 05/23/2007 + * + */ + function xml2ary($vals) { + + $mnary=array(); + $ary=&$mnary; + foreach ($vals as $r) { + $t=$r['tag']; + if ($r['type']=='open') { + if (isset($ary[$t]) && !empty($ary[$t])) { + if (isset($ary[$t][0])){ + $ary[$t][]=array(); + } + else { + $ary[$t]=array($ary[$t], array()); + } + $cv=&$ary[$t][count($ary[$t])-1]; + } + else { + $cv=&$ary[$t]; + } + $cv=array(); + if (isset($r['attributes'])) { + foreach ($r['attributes'] as $k=>$v) { + $cv[$k]=$v; + } + } + + $cv['_p']=&$ary; + $ary=&$cv; + + } else if ($r['type']=='complete') { + if (isset($ary[$t]) && !empty($ary[$t])) { // same as open + if (isset($ary[$t][0])) { + $ary[$t][]=array(); + } + else { + $ary[$t]=array($ary[$t], array()); + } + $cv=&$ary[$t][count($ary[$t])-1]; + } + else { + $cv=&$ary[$t]; + } + if (isset($r['attributes'])) { + foreach ($r['attributes'] as $k=>$v) { + $cv[$k]=$v; + } + } + $cv['VALUE'] = (isset($r['value']) ? $r['value'] : ''); + + } elseif ($r['type']=='close') { + $ary=&$ary['_p']; + } + } + + $this->_del_p($mnary); + return $mnary; + } + + // _Internal: Remove recursion in result array + function _del_p(&$ary) { + foreach ($ary as $k=>$v) { + if ($k==='_p') { + unset($ary[$k]); + } + else if(is_array($ary[$k])) { + $this->_del_p($ary[$k]); + } + } + } + + /* Returns the root of the XML data */ + function GetRoot() { + return $this->root; + } + + /* Returns the array representing the XML data */ + function GetData() { + return $this->params; + } + } + diff --git a/modules/gcheckout/logo.gif b/modules/gcheckout/logo.gif new file mode 100644 index 000000000..d24a14a90 Binary files /dev/null and b/modules/gcheckout/logo.gif differ diff --git a/modules/gcheckout/payment.php b/modules/gcheckout/payment.php new file mode 100644 index 000000000..fd792dbe5 --- /dev/null +++ b/modules/gcheckout/payment.php @@ -0,0 +1,47 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/gcheckout.php'); + +if (!$cookie->isLogged(true)) + Tools::redirect('authentication.php?back=order.php'); +elseif (!$cart->getOrderTotal(true, Cart::BOTH)) + Tools::displayError('Error: Empty cart'); + +$gcheckout = new GCheckout(); +// Prepare payment +$gcheckout->preparePayment(); + +include(dirname(__FILE__).'/../../header.php'); +// Display +echo $gcheckout->display('gcheckout.php', 'confirm.tpl'); + +include_once(dirname(__FILE__).'/../../footer.php'); + + diff --git a/modules/gcheckout/payment.tpl b/modules/gcheckout/payment.tpl new file mode 100644 index 000000000..ed22563da --- /dev/null +++ b/modules/gcheckout/payment.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {$buttonText} + {$buttonText} + +

        \ No newline at end of file diff --git a/modules/gcheckout/payment_return.tpl b/modules/gcheckout/payment_return.tpl new file mode 100644 index 000000000..a525bd8f3 --- /dev/null +++ b/modules/gcheckout/payment_return.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +Page de retour de paiement diff --git a/modules/gcheckout/validation.php b/modules/gcheckout/validation.php new file mode 100644 index 000000000..2d2158a00 --- /dev/null +++ b/modules/gcheckout/validation.php @@ -0,0 +1,159 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/gcheckout.php'); +require_once(dirname(__FILE__).'/library/googleresponse.php'); +require_once(dirname(__FILE__).'/library/googlemerchantcalculations.php'); +require_once(dirname(__FILE__).'/library/googleresult.php'); +require_once(dirname(__FILE__).'/library/googlerequest.php'); +require_once(dirname(__FILE__).'/library/googlecart.php'); + + +$merchant_id = Configuration::get('GCHECKOUT_MERCHANT_ID'); +$merchant_key = Configuration::get('GCHECKOUT_MERCHANT_KEY'); +$server_type = Configuration::get('GCHECKOUT_MODE'); + +$Gresponse = new GoogleResponse($merchant_id, $merchant_key); +//$Grequest = new GoogleRequest($merchant_id, $merchant_key, $server_type, $currency); + +//Setup the log file +if (Configuration::get('GCHECKOUT_LOGS')) + $Gresponse->SetLogFiles('googleerror.log', 'googlemessage.log', L_ALL); + +// Retrieve the XML sent in the HTTP POST request to the ResponseHandler +$xml_response = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA:file_get_contents("php://input"); +if (get_magic_quotes_gpc()) + $xml_response = stripslashes($xml_response); + +list($root, $data) = $Gresponse->GetParsedXML($xml_response); +$Gresponse->SetMerchantAuthentication($merchant_id, $merchant_key); + +$status = $Gresponse->HttpAuthentication(); +if(!$status) + die('authentication failed'); + + /* Commands to send the various order processing APIs + * Send charge order : $Grequest->SendChargeOrder($data[$root] + * ['google-order-number']['VALUE'], ); + * Send process order : $Grequest->SendProcessOrder($data[$root] + * ['google-order-number']['VALUE']); + * Send deliver order: $Grequest->SendDeliverOrder($data[$root] + * ['google-order-number']['VALUE'], , , + * ); + * Send archive order: $Grequest->SendArchiveOrder($data[$root] + * ['google-order-number']['VALUE']); + * + */ + + switch ($root) { + case "request-received": { + break; + } + case "error": { + break; + } + case "diagnosis": { + break; + } + case "checkout-redirect": { + break; + } + case "merchant-calculation-callback": { + break; + } + case "new-order-notification": { + // secure_cart[0] => id_cart + // secure_cart[1] => secure_key + + $gcheckout = new GCheckout(); + $secure_cart = explode('|', $data[$root]['shopping-cart']['merchant-private-data']['VALUE']); + $cart = new Cart((int)$secure_cart[0]); + $currency = $gcheckout->getCurrency((int)$cart->id_currency); + unset($cart); + + $orderTotal = (float)($data[$root]['order-total']['VALUE']); + $gcheckout->validateOrder((int)$secure_cart[0], _PS_OS_PAYMENT_, (float)$orderTotal, + $gcheckout->displayName, NULL, array(), NULL, false, $secure_cart[1]); + $Gresponse->SendAck(); + break; + } + case "order-state-change-notification": { + $Gresponse->SendAck(); + break; + } + case "charge-amount-notification": { + $Gresponse->SendAck(); + break; + } + case "chargeback-amount-notification": { + $Gresponse->SendAck(); + break; + } + case "refund-amount-notification": { + $Gresponse->SendAck(); + break; + } + case "risk-information-notification": { + $Gresponse->SendAck(); + break; + } + default: + $Gresponse->SendBadRequestStatus("Invalid or not supported Message"); + break; + } + + + /* In case the XML API contains multiple open tags + with the same value, then invoke this function and + perform a foreach on the resultant array. + This takes care of cases when there is only one unique tag + or multiple tags. + Examples of this are "anonymous-address", "merchant-code-string" + from the merchant-calculations-callback API + */ + function get_arr_result($child_node) { + $result = array(); + if(isset($child_node)) { + if(is_associative_array($child_node)) { + $result[] = $child_node; + } + else { + foreach($child_node as $curr_node){ + $result[] = $curr_node; + } + } + } + return $result; + } + + /* Returns true if a given variable represents an associative array */ + function is_associative_array( $var ) { + return is_array( $var ) && !is_numeric( implode( '', array_keys( $var ) ) ); + } + + diff --git a/modules/graphartichow/artichow/AntiSpam.class.php b/modules/graphartichow/artichow/AntiSpam.class.php new file mode 100644 index 000000000..fea3cb23e --- /dev/null +++ b/modules/graphartichow/artichow/AntiSpam.class.php @@ -0,0 +1,224 @@ +string = (string)$string; + + } + + /** + * Create a random string + * + * @param int $length String length + * @return string String created + */ + public function setRand($length) { + + $length = (int)$length; + + $this->string = ''; + + $letters = 'aAbBCDeEFgGhHJKLmMnNpPqQRsStTuVwWXYZz2345679'; + $number = strlen($letters); + + for($i = 0; $i < $length; $i++) { + $this->string .= $letters{mt_rand(0, $number - 1)}; + } + + return $this->string; + + } + + /** + * Set noise on image + * + * @param int $nois Noise intensity (from 0 to 10) + */ + public function setNoise($noise) { + if($noise < 0) { + $noise = 0; + } + if($noise > 10) { + $noise = 10; + } + $this->noise = (int)$noise; + } + + /** + * Save string value in session + * You can use check() to verify the value later + * + * @param string $qName A name that identify the anti-spam image + */ + public function save($qName) { + $this->session(); + $session = 'artichow_'.(string)$qName; + $_SESSION[$session] = $this->string; + } + + /** + * Verify user entry + * + * @param string $qName A name that identify the anti-spam image + * @param string $value User-defined value + * @param bool $case TRUE for case insensitive check, FALSE for case sensitive check ? (default to TRUE) + * @return bool TRUE if the value is correct, FALSE otherwise + */ + public function check($qName, $value, $case = TRUE) { + + $this->session(); + + $session = 'artichow_'.(string)$qName; + + return ( + array_key_exists($session, $_SESSION) === TRUE and + $case ? + (strtolower($_SESSION[$session]) === strtolower((string)$value)) : + ($_SESSION[$session] === (string)$value) + ); + + } + + /** + * Draw image + */ + public function draw() { + + $fonts = array( + 'Tuffy', + 'TuffyBold', + 'TuffyItalic', + 'TuffyBoldItalic' + ); + + $sizes = array(12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 19); + + $widths = array(); + $heights = array(); + $texts = array(); + + // Set up a temporary driver to allow font size calculations... + $this->setSize(10, 10); + $driver = $this->getDriver(); + + for($i = 0; $i < strlen($this->string); $i++) { + + $fontKey = array_rand($fonts); + $sizeKey = array_rand($sizes); + + $font = new awTTFFont( + $fonts[$fontKey], $sizes[$sizeKey] + ); + + $text = new awText( + $this->string{$i}, + $font, + NULL, + mt_rand(-15, 15) + ); + + $widths[] = $driver->getTextWidth($text); + $heights[] = $driver->getTextHeight($text); + $texts[] = $text; + + } + + // ... and get rid of it. + $this->driver = NULL; + + $width = array_sum($widths); + $height = array_max($heights); + + $totalWidth = $width + 10 + count($texts) * 10; + $totalHeight = $height + 20; + + $this->setSize($totalWidth, $totalHeight); + + $this->create(); + + for($i = 0; $i < strlen($this->string); $i++) { + + $this->driver->string( + $texts[$i], + new awPoint( + 5 + array_sum(array_slice($widths, 0, $i)) + $widths[$i] / 2 + $i * 10, + 10 + ($height - $heights[$i]) / 2 + ) + ); + + } + + $this->drawNoise($totalWidth, $totalHeight); + + $this->send(); + + } + + protected function drawNoise($width, $height) { + + $points = $this->noise * 30; + $color = new awColor(0, 0, 0); + + for($i = 0; $i < $points; $i++) { + $this->driver->point( + $color, + new awPoint( + mt_rand(0, $width), + mt_rand(0, $height) + ) + ); + } + + } + + protected function session() { + + // Start session if needed + if(!session_id()) { + session_start(); + } + + } + +} + +registerClass('AntiSpam'); + diff --git a/modules/graphartichow/artichow/Artichow.cfg.php b/modules/graphartichow/artichow/Artichow.cfg.php new file mode 100644 index 000000000..3b9f71555 --- /dev/null +++ b/modules/graphartichow/artichow/Artichow.cfg.php @@ -0,0 +1,84 @@ +label = new awLabel; + + $this->barPadding = new awSide(0.08, 0.08, 0, 0); + $this->barShadow = new awShadow(awShadow::RIGHT_TOP); + $this->barBorder = new awBorder; + + $this->setValues($values); + + $this->identifier = (int)$identifier; + $this->number = (int)$number; + $this->depth = (int)$depth; + + $this->move = new awSide; + + // Hide vertical grid + $this->grid->hideVertical(TRUE); + + } + + /** + * Change bars padding + * This method is not compatible with awBarPlot::setBarPadding() + * + * @param float $left Left padding (between 0 and 1) + * @param float $right Right padding (between 0 and 1) + */ + public function setBarPadding($left = NULL, $right = NULL) { + $this->barPadding->set($left, $right); + } + + /** + * Change bars size + * This method is not compatible with awBarPlot::setBarPadding() + * + * @param int $width Bars size (between 0 and 1) + */ + public function setBarSize($size) { + $padding = (1 - $size) / 2; + $this->barPadding->set($padding, $padding); + } + + /** + * Move bars + * + * @param int $x + * @param int $y + */ + public function move($x, $y) { + $this->move->set($x, NULL, $y, NULL); + } + + /** + * Change bars space + * + * @param int $space Space in pixels + */ + public function setBarSpace($space) { + $this->barSpace = (int)$space; + } + + /** + * Change line background color + * + * @param awColor $color + */ + public function setBarColor(awColor $color) { + $this->barBackground = $color; + } + + /** + * Change line background gradient + * + * @param awGradient $gradient + */ + public function setBarGradient(awGradient $gradient) { + $this->barBackground = $gradient; + } + + /** + * Get the line thickness + * + * @return int + */ + public function getLegendLineThickness() { + } + + /** + * Get the line type + * + * @return int + */ + public function getLegendLineStyle() { + } + + /** + * Get the color of line + * + * @return Color + */ + public function getLegendLineColor() { + } + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground() { + return $this->barBackground; + } + + /** + * Get a mark object + * + * @return Mark + */ + public function getLegendMark() { + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + $count = count($this->datay); + $max = $this->getRealYMax(NULL); + $min = $this->getRealYMin(NULL); + + // Find zero for bars + if($this->xAxisZero and $min <= 0 and $max >= 0) { + $zero = 0; + } else if($max < 0) { + $zero = $max; + } else { + $zero = $min; + } + + // Get base position + $zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero)); + + // Distance between two values on the graph + $distance = $this->xAxis->getDistance(0, 1); + + // Compute paddings + $leftPadding = $this->barPadding->left * $distance; + $rightPadding = $this->barPadding->right * $distance; + + $padding = $leftPadding + $rightPadding; + $space = $this->barSpace * ($this->number - 1); + + $barSize = ($distance - $padding - $space) / $this->number; + $barPosition = $leftPadding + $barSize * ($this->identifier - 1); + + for($key = 0; $key < $count; $key++) { + + $value = $this->datay[$key]; + + if($value !== NULL) { + + $position = awAxis::toPosition( + $this->xAxis, + $this->yAxis, + new awPoint($key, $value) + ); + + $barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x; + $barStop = $barStart + $barSize; + + $t1 = min($zero->y, $position->y); + $t2 = max($zero->y, $position->y); + + if(round($t2 - $t1) == 0) { + continue; + } + + $p1 = new awPoint( + round($barStart) + $this->depth + $this->move->left, + round($t1) - $this->depth + $this->move->top + ); + + $p2 = new awPoint( + round($barStop) + $this->depth + $this->move->left, + round($t2) - $this->depth + $this->move->top + ); + + $this->drawBar($driver, $p1, $p2); + + } + + } + + // Draw labels + foreach($this->datay as $key => $value) { + + if($value !== NULL) { + + $position = awAxis::toPosition( + $this->xAxis, + $this->yAxis, + new awPoint($key, $value) + ); + + $point = new awPoint( + $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth, + $position->y - $this->depth + ); + + $this->label->draw($driver, $point, $key); + + } + + } + + } + + public function getXAxisNumber() { + return count($this->datay) + 1; + } + // ça bidouille à fond ici ! + public function getXMax() { + return array_max($this->datax) + 1; + } + + public function getXCenter() { + return TRUE; + } + + protected function drawBar(awDriver $driver, awPoint $p1, awPoint $p2) { + + // Draw shadow + $this->barShadow->draw( + $driver, + $p1, + $p2, + awShadow::OUT + ); + + if(abs($p2->y - $p1->y) > 1) { + + $this->barBorder->rectangle( + $driver, + $p1, + $p2 + ); + + if($this->barBackground !== NULL) { + + $size = $this->barBorder->visible() ? 1 : 0; + + $b1 = $p1->move($size, $size); + $b2 = $p2->move(-1 * $size, -1 * $size); + + // Draw background + $driver->filledRectangle( + $this->barBackground, + new awLine($b1, $b2) + ); + + } + + } + } + +} + +registerClass('BarPlot'); + diff --git a/modules/graphartichow/artichow/Component.class.php b/modules/graphartichow/artichow/Component.class.php new file mode 100644 index 000000000..2a683d67c --- /dev/null +++ b/modules/graphartichow/artichow/Component.class.php @@ -0,0 +1,415 @@ +components = array(); + } + + /** + * Add a component to the group + * + * @param awComponent $component A component + */ + public function add(awComponent $component) { + $this->components[] = $component; + } + +} + +registerClass('ComponentGroup', TRUE); + +abstract class awComponent { + + /** + * Component driver + * + * @var Driver + */ + protected $driver; + + /** + * Component width + * + * @var float + */ + public $width = 1.0; + + /** + * Component height + * + * @var float + */ + public $height = 1.0; + + /** + * Position X of the center the graph (from 0 to 1) + * + * @var float + */ + public $x = 0.5; + + /** + * Position Y of the center the graph (from 0 to 1) + * + * @var float + */ + public $y = 0.5; + + /** + * Component absolute width (in pixels) + * + * + * @var int + */ + public $w; + + /** + * Component absolute height (in pixels) + * + * + * @var int + */ + public $h; + + /** + * Left-top corner Y position + * + * @var float + */ + public $top; + + /** + * Left-top corner X position + * + * @var float + */ + public $left; + + /** + * Component background color + * + * @var Color + */ + protected $background; + + /** + * Component padding + * + * @var Side + */ + protected $padding; + + /** + * Component space + * + * @var Side + */ + protected $space; + + /** + * Component title + * + * @var Label + */ + public $title; + + /** + * Adjust automatically the component ? + * + * @var bool + */ + protected $auto = TRUE; + + /** + * Legend + * + * @var Legend + */ + public $legend; + + /** + * Build the component + */ + public function __construct() { + + // Component legend + $this->legend = new awLegend(); + + $this->padding = new awSide(25, 25, 25, 25); + $this->space = new awSide(0, 0, 0, 0); + + // Component title + $this->title = new awLabel( + NULL, + new awTuffy(10), + NULL, + 0 + ); + $this->title->setAlign(awLabel::CENTER, awLabel::TOP); + + } + + /** + * Adjust automatically the component ? + * + * @param bool $auto + */ + public function auto($auto) { + $this->auto = (bool)$auto; + } + + /** + * Change the size of the component + * + * @param int $width Component width (from 0 to 1) + * @param int $height Component height (from 0 to 1) + */ + public function setSize($width, $height) { + + $this->width = (float)$width; + $this->height = (float)$height; + + } + + /** + * Change the absolute size of the component + * + * @param int $w Component width (in pixels) + * @param int $h Component height (in pixels) + */ + public function setAbsSize($w, $h) { + + $this->w = (int)$w; + $this->h = (int)$h; + + } + + /** + * Change component background color + * + * @param awColor $color (can be null) + */ + public function setBackgroundColor($color) { + if($color === NULL or $color instanceof awColor) { + $this->background = $color; + } + } + + /** + * Change component background gradient + * + * @param awGradient $gradient (can be null) + */ + public function setBackgroundGradient($gradient) { + if($gradient === NULL or $gradient instanceof awGradient) { + $this->background = $gradient; + } + } + + /** + * Change component background image + * + * @param awImage $image (can be null) + */ + public function setBackgroundImage($image) { + if($image === NULL or $image instanceof awImage) { + $this->background = $image; + } + } + + /** + * Return the component background + * + * @return Color, Gradient + */ + public function getBackground() { + return $this->background; + } + + /** + * Change component padding + * + * @param int $left Padding in pixels (NULL to keep old value) + * @param int $right Padding in pixels (NULL to keep old value) + * @param int $top Padding in pixels (NULL to keep old value) + * @param int $bottom Padding in pixels (NULL to keep old value) + */ + public function setPadding($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { + $this->padding->set($left, $right, $top, $bottom); + } + + /** + * Change component space + * + * @param float $left Space in % (NULL to keep old value) + * @param float $right Space in % (NULL to keep old value) + * @param float $bottom Space in % (NULL to keep old value) + * @param float $top Space in % (NULL to keep old value) + */ + public function setSpace($left = NULL, $right = NULL, $bottom = NULL, $top = NULL) { + $this->space->set($left, $right, $bottom, $top); + } + + /** + * Change the absolute position of the component on the graph + * + * @var int $x Left-top corner X position + * @var int $y Left-top corner Y position + */ + public function setAbsPosition($left, $top) { + + $this->left = (int)$left; + $this->top = (int)$top; + + } + + /** + * Set the center of the component + * + * @param int $x Position X of the center of the component + * @param int $y Position Y of the center of the component + */ + public function setCenter($x, $y) { + + $this->x = (float)$x; + $this->y = (float)$y; + + } + + /** + * Get component coords with its padding + * + * @return array Coords of the component + */ + public function getPosition() { + + // Get component coords + $x1 = $this->padding->left; + $y1 = $this->padding->top; + $x2 = $this->w - $this->padding->right; + $y2 = $this->h - $this->padding->bottom; + + return array($x1, $y1, $x2, $y2); + + } + + /** + * Init the drawing of the component + */ + public function init(awDriver $driver) { + + // Set component background + $background = $this->getBackground(); + + if($background !== NULL) { + + $p1 = new awPoint(0, 0); + $p2 = new awPoint($this->w - 1, $this->h - 1); + + if($background instanceof awImage) { + + $driver->copyImage( + $background, + $p1, + $p2 + ); + + } else { + + $driver->filledRectangle( + $background, + new awLine($p1, $p2) + ); + + } + + } + } + + /** + * Finalize the drawing of the component + */ + public function finalize(awDriver $driver) { + + // Draw component title + $point = new awPoint( + $this->w / 2, + $this->padding->top - 8 + ); + $this->title->draw($driver, $point); + + // Draw legend + $this->legend->draw($driver); + + } + + /** + * Draw the grid around your component + * + * @param Driver A driver + * @return array Coords for the component + */ + abstract public function drawEnvelope(awDriver $driver); + + /** + * Draw the component on the graph + * Component should be drawed into specified coords + * + * @param Driver A driver + * @param int $x1 + * @param int $y1 + * @param int $x2 + * @param int $y2 + * @param bool $aliasing Use anti-aliasing to draw the component ? + */ + abstract public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing); + + /** + * Get space width in pixels + * + * @param int $width Component width + * @param int $height Component height + * @return array + */ + protected function getSpace($width, $height) { + + $left = (int)($width * $this->space->left / 100); + $right = (int)($width * $this->space->right / 100); + $top = (int)($height * $this->space->top / 100); + $bottom = (int)($height * $this->space->bottom / 100); + + return array($left, $right, $top, $bottom); + + } + +} + +registerClass('Component', TRUE); + diff --git a/modules/graphartichow/artichow/Graph.class.php b/modules/graphartichow/artichow/Graph.class.php new file mode 100644 index 000000000..bf018a518 --- /dev/null +++ b/modules/graphartichow/artichow/Graph.class.php @@ -0,0 +1,412 @@ +setSize($width, $height); + + if(ARTICHOW_CACHE) { + + $this->name = $name; + $this->timeout = $timeout; + + // Clean sometimes all the cache + if(mt_rand(0, 5000) === 0) { + awGraph::cleanCache(); + } + + // Take the graph from the cache if possible + if($this->name !== NULL) { + + $this->fileCache = ARTICHOW_CACHE_DIRECTORY."/".$this->name; + $this->fileCacheTime = $this->fileCache."-time"; + + if(is_file($this->fileCache)) { + + $type = awGraph::cleanGraphCache($this->fileCacheTime); + + if($type === NULL) { + awGraph::deleteFromCache($this->name); + } else { + header("Content-Type: image/".$type); + echo file_get_contents($this->fileCache); + exit; + } + + } + + } + + } + + $this->title = new awLabel( + NULL, + new awTuffy(16), + NULL, + 0 + ); + $this->title->setAlign(awLabel::CENTER, awLabel::BOTTOM); + + } + + /** + * Delete a graph from the cache + * + * @param string $name Graph name + * @return bool TRUE on success, FALSE on failure + */ + public static function deleteFromCache($name) { + + if(ARTICHOW_CACHE) { + + if(is_file(ARTICHOW_CACHE_DIRECTORY."/".$name."-time")) { + unlink(ARTICHOW_CACHE_DIRECTORY."/".$name.""); + unlink(ARTICHOW_CACHE_DIRECTORY."/".$name."-time"); + } + + } + + } + + /** + * Delete all graphs from the cache + */ + public static function deleteAllCache() { + + if(ARTICHOW_CACHE) { + + $dp = opendir(ARTICHOW_CACHE_DIRECTORY); + + while($file = readdir($dp)) { + if($file !== '.' and $file != '..') { + unlink(ARTICHOW_CACHE_DIRECTORY."/".$file); + } + } + + } + + } + + /** + * Clean cache + */ + public static function cleanCache() { + + if(ARTICHOW_CACHE) { + + $glob = glob(ARTICHOW_CACHE_DIRECTORY."/*-time"); + + foreach($glob as $file) { + + $type = awGraph::cleanGraphCache($file); + + if($type === NULL) { + $name = preg_replace('!.*/(.*)\-time!', "\\1", $file); + awGraph::deleteFromCache($name); + } + + } + + } + + } + + /** + * Enable/Disable Graph timing + * + * @param bool $timing + */ + public function setTiming($timing) { + $this->timing = (bool)$timing; + } + + /** + * Add a component to the graph + * + * @param awComponent $component + */ + public function add(awComponent $component) { + + $this->components[] = $component; + + } + + /** + * Add a label to the component + * + * @param awLabel $label + * @param int $x Position on X axis of the center of the text + * @param int $y Position on Y axis of the center of the text + */ + public function addLabel(awLabel $label, $x, $y) { + + $this->labels[] = array( + $label, $x, $y + ); + + } + + /** + * Add a label to the component with absolute position + * + * @param awLabel $label + * @param awPoint $point Text position + */ + public function addAbsLabel(awLabel $label, awPoint $point) { + + $this->labels[] = array( + $label, $point + ); + + } + + /** + * Build the graph and draw component on it + * + * @param string $mode Display mode (can be a file name) + */ + public function draw($mode = Graph::DRAW_DISPLAY) { + + if($this->timing) { + $time = microtimeFloat(); + } + + $this->create(); + + foreach($this->components as $component) { + + $this->drawComponent($component); + + } + + $this->drawTitle(); + $this->drawShadow(); + $this->drawLabels(); + + if($this->timing) { + $this->drawTiming(microtimeFloat() - $time); + } + + // Create graph + $data = $this->get(); + + // Put the graph in the cache if needed + $this->cache($data); + + switch($mode) { + + case Graph::DRAW_DISPLAY : + $this->sendHeaders(); + echo $data; + break; + + case Graph::DRAW_RETURN : + return $data; + + default : + if(is_string($mode)) { + file_put_contents($mode, $data); + } else { + awImage::drawError("Class Graph: Unable to draw the graph."); + } + + } + + } + + private function drawLabels() { + + $driver = $this->getDriver(); + + foreach($this->labels as $array) { + + if(count($array) === 3) { + + // Text in relative position + list($label, $x, $y) = $array; + + $point = new awPoint( + $x * $this->width, + $y * $this->height + ); + + } else { + + // Text in absolute position + list($label, $point) = $array; + + } + + $label->draw($driver, $point); + + } + + } + + private function drawTitle() { + + $driver = $this->getDriver(); + + $point = new awPoint( + $this->width / 2, + 10 + ); + + $this->title->draw($driver, $point); + + } + + private function drawTiming($time) { + + $driver = $this->getDriver(); + + $label = new awLabel; + $label->set("(".sprintf("%.3f", $time)." s)"); + $label->setAlign(awLabel::LEFT, awLabel::TOP); + $label->border->show(); + $label->setPadding(1, 0, 0, 0); + $label->setBackgroundColor(new awColor(230, 230, 230, 25)); + + $label->draw($driver, new awPoint(5, $driver->imageHeight - 5)); + + } + + private function cache($data) { + if(ARTICHOW_CACHE and $this->name !== NULL) { + + if(is_writable(ARTICHOW_CACHE_DIRECTORY) === FALSE) { + awImage::drawError("Class Graph: Cache directory is not writable."); + } + + file_put_contents($this->fileCache, $data); + file_put_contents($this->fileCacheTime, $this->timeout."\n".$this->getFormatString()); + + } + } + + private static function cleanGraphCache($file) { + + list( + $time, + $type + ) = explode("\n", file_get_contents($file)); + + $time = (int)$time; + + if($time !== 0 and $time < time()) { + return NULL; + } else { + return $type; + } + + + } + +} + +registerClass('Graph'); + +/* + * To preserve PHP 4 compatibility + */ +function microtimeFloat() { + list($usec, $sec) = explode(" ", microtime()); + return (float)$usec + (float)$sec; +} + diff --git a/modules/graphartichow/artichow/Image.class.php b/modules/graphartichow/artichow/Image.class.php new file mode 100644 index 000000000..129508e3f --- /dev/null +++ b/modules/graphartichow/artichow/Image.class.php @@ -0,0 +1,606 @@ +background = new awColor(255, 255, 255); + $this->shadow = new awShadow(awShadow::RIGHT_BOTTOM); + $this->border = new awBorder; + + } + + /** + * Get driver of the image + * + * @param int $w Driver width (from 0 to 1) (default to 1) + * @param int $h Driver height (from 0 to 1) (default to 1) + * @param float $x Position on X axis of the center of the driver (default to 0.5) + * @param float $y Position on Y axis of the center of the driver (default to 0.5) + * @return Driver + */ + public function getDriver($w = 1, $h = 1, $x = 0.5, $y = 0.5) { + $this->create(); + $this->driver->setSize($w, $h); + $this->driver->setPosition($x, $y); + return $this->driver; + } + + /** + * Sets the driver that will be used to draw the graph + * + * @param string $driverString + */ + public function setDriver($driverString) { + $this->driver = $this->selectDriver($driverString); + + $this->driver->init($this); + } + + /** + * Change the image size + * + * @var int $width Image width + * @var int $height Image height + */ + public function setSize($width, $height) { + + if($width !== NULL) { + $this->width = (int)$width; + } + if($height !== NULL) { + $this->height = (int)$height; + } + + } + + /** + * Change image background + * + * @param mixed $background + */ + public function setBackground($background) { + if($background instanceof awColor) { + $this->setBackgroundColor($background); + } elseif($background instanceof awGradient) { + $this->setBackgroundGradient($background); + } + } + + /** + * Change image background color + * + * @param awColor $color + */ + public function setBackgroundColor(awColor $color) { + $this->background = $color; + } + + /** + * Change image background gradient + * + * @param awGradient $gradient + */ + public function setBackgroundGradient(awGradient $gradient) { + $this->background = $gradient; + } + + /** + * Return image background, whether a Color or a Gradient + * + * @return mixed + */ + public function getBackground() { + return $this->background; + } + + /** + * Turn antialiasing on or off + * + * @var bool $bool + */ + public function setAntiAliasing($bool) { + $this->antiAliasing = (bool)$bool; + } + + /** + * Return the antialiasing setting + * + * @return bool + */ + public function getAntiAliasing() { + return $this->antiAliasing; + } + + /** + * Change image format + * + * @var int $format New image format + */ + public function setFormat($format) { + if($format === awImage::JPEG or $format === awImage::PNG or $format === awImage::GIF) { + $this->format = $format; + } + } + + /** + * Returns the image format as an integer + * + * @return unknown + */ + public function getFormat() { + return $this->format; + } + + /** + * Returns the image format as a string + * + * @return string + */ + public function getFormatString() { + + switch($this->format) { + case awImage::JPEG : + return 'jpeg'; + case awImage::PNG : + return 'png'; + case awImage::GIF : + return 'gif'; + } + + } + + /** + * Create a new awimage + */ + public function create() { + + if($this->driver === NULL) { + $driver = $this->selectDriver($this->driverString); + + $driver->init($this); + + $this->driver = $driver; + } + + } + + /** + * Select the correct driver + * + * @param string $driver The desired driver + * @return mixed + */ + protected function selectDriver($driver) { + $drivers = array('gd'); + $driver = strtolower((string)$driver); + + if(in_array($driver, $drivers, TRUE)) { + $string = $driver; + } else { + $string = ARTICHOW_DRIVER; + } + + switch ($string) { + case 'gd': + require_once ARTICHOW.'/inc/drivers/gd.class.php'; + $this->driverString = $string; + return new awGDDriver(); + + default: + // We should never get here, unless the wrong string is used AND the ARTICHOW_DRIVER + // global has been messed with. + awImage::drawError('Class Image: Unknown driver type (\''.$string.'\')'); + break; + } + } + + /** + * Draw a component on the image + * + * @var awComponent $component A component + */ + public function drawComponent(awComponent $component) { + + $shadow = $this->shadow->getSpace(); // Image shadow + $border = $this->border->visible() ? 1 : 0; // Image border size + + $driver = clone $this->driver; + $driver->setImageSize( + $this->width - $shadow->left - $shadow->right - $border * 2, + $this->height - $shadow->top - $shadow->bottom - $border * 2 + ); + + // No absolute size specified + if($component->w === NULL and $component->h === NULL) { + + list($width, $height) = $driver->setSize($component->width, $component->height); + + // Set component size in pixels + $component->setAbsSize($width, $height); + + } else { + + $driver->setAbsSize($component->w, $component->h); + + } + + if($component->top !== NULL and $component->left !== NULL) { + $driver->setAbsPosition( + $border + $shadow->left + $component->left, + $border + $shadow->top + $component->top + ); + } else { + $driver->setPosition($component->x, $component->y); + } + + $driver->movePosition($border + $shadow->left, $border + $shadow->top); + + list($x1, $y1, $x2, $y2) = $component->getPosition(); + + $component->init($driver); + + $component->drawComponent($driver, $x1, $y1, $x2, $y2, $this->antiAliasing); + $component->drawEnvelope($driver, $x1, $y1, $x2, $y2); + + $component->finalize($driver); + + } + + protected function drawShadow() { + + $driver = $this->getDriver(); + + $this->shadow->draw( + $driver, + new awPoint(0, 0), + new awPoint($this->width, $this->height), + awShadow::IN + ); + + } + + /** + * Send the image into a file or to the user browser + * + */ + public function send() { + $this->driver->send($this); + } + + /** + * Return the image content as binary data + * + */ + public function get() { + return $this->driver->get($this); + } + + /** + * Send the correct HTTP header according to the image type + * + */ + public function sendHeaders() { + + if(headers_sent() === FALSE) { + + switch ($this->driverString) { + case 'gd' : + header('Content-type: image/'.$this->getFormatString()); + break; + + } + + } + + } + + + private static $errorWriting = FALSE; + + + /* + * Display an error image and exit + * + * @param string $message Error message + */ + public static function drawError($message) { + + + if(self::$errorWriting) { + return; + } + + self::$errorWriting = TRUE; + + $message = wordwrap($message, 40, "\n", TRUE); + + $width = 400; + $height = max(100, 40 + 22.5 * (substr_count($message, "\n") + 1)); + + $image = new awImage(); + $image->setSize($width, $height); + $image->setDriver('gd'); + + $driver = $image->getDriver(); + $driver->init($image); + + // Display title + $driver->filledRectangle( + new awWhite, + new awLine( + new awPoint(0, 0), + new awPoint($width, $height) + ) + ); + + $driver->filledRectangle( + new awRed, + new awLine( + new awPoint(0, 0), + new awPoint(110, 25) + ) + ); + + $text = new awText( + "Artichow error", + new awFont3, + new awWhite, + 0 + ); + + $driver->string($text, new awPoint(5, 6)); + + // Display red box + $driver->rectangle( + new awRed, + new awLine( + new awPoint(0, 25), + new awPoint($width - 90, $height - 1) + ) + ); + + // Display error image + $file = ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.'error.png'; + + $imageError = new awFileImage($file); + $driver->copyImage( + $imageError, + new awPoint($width - 81, $height - 81), + new awPoint($width - 1, $height - 1) + ); + + // Draw message + $text = new awText( + strip_tags($message), + new awFont2, + new awBlack, + 0 + ); + + $driver->string($text, new awPoint(10, 40)); + + $image->send(); + + exit; + + } + + /* + * Display an error image located in a file and exit + * + * @param string $error Error name + */ + public static function drawErrorFile($error) { + + $file = ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.'errors'.DIRECTORY_SEPARATOR.$error.'.png'; + + header("Content-Type: image/png"); + readfile($file); + exit; + + } + +} + +registerClass('Image'); + + +/** + * Load an image from a file + * + * @package Artichow + */ +class awFileImage extends awImage { + + /** + * Build a new awimage + * + * @param string $file Image file name + */ + public function __construct($file) { + + $driver = $this->selectDriver($this->driverString); + + $driver->initFromFile($this, $file); + + $this->driver = $driver; + + } + +} + +registerClass('FileImage'); + + diff --git a/modules/graphartichow/artichow/LinePlot.class.php b/modules/graphartichow/artichow/LinePlot.class.php new file mode 100644 index 000000000..e2a494c39 --- /dev/null +++ b/modules/graphartichow/artichow/LinePlot.class.php @@ -0,0 +1,585 @@ +mark = new awMark; + $this->label = new awLabel; + + $this->lineMode = (int)$mode; + + $this->setValues($values); + + } + + /** + * Hide line + * + * @param bool $hide + */ + public function hideLine($hide) { + $this->lineHide = (bool)$hide; + } + + /** + * Add a filled area + * + * @param int $start Begining of the area + * @param int $end End of the area + * @param mixed $background Background color or gradient of the area + */ + public function setFilledArea($start, $stop, $background) { + + if($stop <= $start) { + awImage::drawError("Class LinePlot: End position can not be greater than begin position in setFilledArea()."); + } + + $this->areas[] = array((int)$start, (int)$stop, $background); + + } + + /** + * Change line color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->lineColor = $color; + } + + /** + * Change line style + * + * @param int $style + */ + public function setStyle($style) { + $this->lineStyle = (int)$style; + } + + /** + * Change line tickness + * + * @param int $tickness + */ + public function setThickness($tickness) { + $this->lineThickness = (int)$tickness; + } + + /** + * Change line background color + * + * @param awColor $color + */ + public function setFillColor(awColor $color) { + $this->lineBackground = $color; + } + + /** + * Change line background gradient + * + * @param awGradient $gradient + */ + public function setFillGradient(awGradient $gradient) { + $this->lineBackground = $gradient; + } + + /** + * Get the line thickness + * + * @return int + */ + public function getLegendLineThickness() { + return $this->lineThickness; + } + + /** + * Get the line type + * + * @return int + */ + public function getLegendLineStyle() { + return $this->lineStyle; + } + + /** + * Get the color of line + * + * @return Color + */ + public function getLegendLineColor() { + return $this->lineColor; + } + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground() { + return $this->lineBackground; + } + + /** + * Get a mark object + * + * @return Mark + */ + public function getLegendMark() { + return $this->mark; + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + $max = $this->getRealYMax(); + $min = $this->getRealYMin(); + + // Get start and stop values + list($start, $stop) = $this->getLimit(); + + if($this->lineMode === awLinePlot::MIDDLE) { + $inc = $this->xAxis->getDistance(0, 1) / 2; + } else { + $inc = 0; + } + + // Build the polygon + $polygon = new awPolygon; + + for($key = $start; $key <= $stop; $key++) { + + $value = $this->datay[$key]; + + if($value !== NULL) { + + $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value)); + $p = $p->move($inc, 0); + $polygon->set($key, $p); + + } + + } + + // Draw backgrounds + if($this->lineBackground instanceof awColor or $this->lineBackground instanceof awGradient) { + + $backgroundPolygon = new awPolygon; + + $p = $this->xAxisPoint($start); + $p = $p->move($inc, 0); + $backgroundPolygon->append($p); + + // Add others points + foreach($polygon->all() as $point) { + $backgroundPolygon->append(clone $point); + } + + $p = $this->xAxisPoint($stop); + $p = $p->move($inc, 0); + $backgroundPolygon->append($p); + + // Draw polygon background + $driver->filledPolygon($this->lineBackground, $backgroundPolygon); + + } + + $this->drawArea($driver, $polygon); + + // Draw line + $prev = NULL; + + // Line color + if($this->lineHide === FALSE) { + + if($this->lineColor === NULL) { + $this->lineColor = new awColor(0, 0, 0); + } + + foreach($polygon->all() as $point) { + + if($prev !== NULL) { + $driver->line( + $this->lineColor, + new awLine( + $prev, + $point, + $this->lineStyle, + $this->lineThickness + ) + ); + } + $prev = $point; + + } + + } + + // Draw marks and labels + foreach($polygon->all() as $key => $point) { + + $this->mark->draw($driver, $point); + $this->label->draw($driver, $point, $key); + + } + + } + + protected function drawArea(awDriver $driver, awPolygon $polygon) { + + $starts = array(); + foreach($this->areas as $area) { + list($start) = $area; + $starts[$start] = TRUE; + } + + // Draw filled areas + foreach($this->areas as $area) { + + list($start, $stop, $background) = $area; + + $polygonArea = new awPolygon; + + $p = $this->xAxisPoint($start); + $polygonArea->append($p); + + for($i = $start; $i <= $stop; $i++) { + $p = clone $polygon->get($i); + if($i === $stop and array_key_exists($stop, $starts)) { + $p = $p->move(-1, 0); + } + $polygonArea->append($p); + } + + $p = $this->xAxisPoint($stop); + if(array_key_exists($stop, $starts)) { + $p = $p->move(-1, 0); + } + $polygonArea->append($p); + + // Draw area + $driver->filledPolygon($background, $polygonArea); + + } + + } + + public function getXAxisNumber() { + if($this->lineMode === awLinePlot::MIDDLE) { + return count($this->datay) + 1; + } else { + return count($this->datay); + } + } + + protected function xAxisPoint($position) { + $y = $this->xAxisZero ? 0 : $this->getRealYMin(); + return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); + } + + public function getXCenter() { + return ($this->lineMode === awLinePlot::MIDDLE); + } + +} + +registerClass('LinePlot'); + + +/** + * Simple LinePlot + * Useful to draw simple horizontal lines + * + * @package Artichow + */ +class awSimpleLinePlot extends awPlot implements awLegendable { + + /** + * Line color + * + * @var Color + */ + protected $lineColor; + + /** + * Line start + * + * @var int + */ + protected $lineStart; + + /** + * Line stop + * + * @var int + */ + protected $lineStop; + + /** + * Line value + * + * @var flaot + */ + protected $lineValue; + + /** + * Line mode + * + * @var int + */ + protected $lineMode = awLinePlot::LINE; + + /** + * Line type + * + * @var int + */ + protected $lineStyle = awLine::SOLID; + + /** + * Line thickness + * + * @var int + */ + protected $lineThickness = 1; + + /** + * Line mode + * + * @var int + */ + const LINE = 0; + + /** + * Line in the middle + * + * @var int + */ + const MIDDLE = 1; + + /** + * Construct a new awLinePlot + * + * @param float $value A Y value + * @param int $start Line start index + * @param int $stop Line stop index + * @param int $mode Line mode + */ + public function __construct($value, $start, $stop, $mode = awLinePlot::LINE) { + + parent::__construct(); + + $this->lineMode = (int)$mode; + + $this->lineStart = (int)$start; + $this->lineStop = (int)$stop; + $this->lineValue = (float)$value; + + $this->lineColor = new awColor(0, 0, 0); + + } + + /** + * Change line color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->lineColor = $color; + } + + /** + * Change line style + * + * @param int $style + */ + public function setStyle($style) { + $this->lineStyle = (int)$style; + } + + /** + * Change line tickness + * + * @param int $tickness + */ + public function setThickness($tickness) { + $this->lineThickness = (int)$tickness; + } + + /** + * Get the line thickness + * + * @return int + */ + public function getLegendLineThickness() { + return $this->lineThickness; + } + + /** + * Get the line type + * + * @return int + */ + public function getLegendLineStyle() { + return $this->lineStyle; + } + + /** + * Get the color of line + * + * @return Color + */ + public function getLegendLineColor() { + return $this->lineColor; + } + + public function getLegendBackground() { + return NULL; + } + + public function getLegendMark() { + return NULL; + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + if($this->lineMode === awLinePlot::MIDDLE) { + $inc = $this->xAxis->getDistance(0, 1) / 2; + } else { + $inc = 0; + } + + $p1 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStart, $this->lineValue)); + $p2 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStop, $this->lineValue)); + + $driver->line( + $this->lineColor, + new awLine( + $p1->move($inc, 0), + $p2->move($inc, 0), + $this->lineStyle, + $this->lineThickness + ) + ); +} + + public function getXAxisNumber() { + if($this->lineMode === awLinePlot::MIDDLE) { + return count($this->datay) + 1; + } else { + return count($this->datay); + } + } + + protected function xAxisPoint($position) { + $y = $this->xAxisZero ? 0 : $this->getRealYMin(); + return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); + } + + public function getXCenter() { + return ($this->lineMode === awLinePlot::MIDDLE); + } + +} + +registerClass('SimpleLinePlot'); + diff --git a/modules/graphartichow/artichow/MathPlot.class.php b/modules/graphartichow/artichow/MathPlot.class.php new file mode 100644 index 000000000..7d318207d --- /dev/null +++ b/modules/graphartichow/artichow/MathPlot.class.php @@ -0,0 +1,438 @@ +f = (string)$f; + $this->fromX = is_null($fromX) ? NULL : (float)$fromX; + $this->toX = is_null($toX) ? NULL : (float)$toX; + + $this->line = new awLine; + $this->mark = new awMark; + $this->color = new awBlack; + + } + + /** + * Change line color + * + * @param awColor $color A new awcolor + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Get line color + * + * @return Color + */ + public function getColor() { + return $this->color; + } + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground() { + } + + /** + * Get the line thickness + * + * @return NULL + */ + public function getLegendLineThickness() { + return $this->line->getThickness(); + } + + /** + * Get the line type + * + * @return NULL + */ + public function getLegendLineStyle() { + return $this->line->getStyle(); + } + + /** + * Get the color of line + * + * @return NULL + */ + public function getLegendLineColor() { + return $this->color; + } + + /** + * Get a mark object + * + * @return NULL + */ + public function getLegendMark() { + return $this->mark; + } + +} + +registerClass('MathFunction'); + +/** + * For mathematics functions + * + * @package Artichow + */ +class awMathPlot extends awComponent { + + /** + * Functions + * + * @var array + */ + protected $functions = array(); + + /** + * Grid properties + * + * @var Grid + */ + public $grid; + + /** + * X axis + * + * @var Axis + */ + public $xAxis; + + /** + * Y axis + * + * @var Axis + */ + public $yAxis; + + /** + * Extremum + * + * @var Side + */ + private $extremum = NULL; + + /** + * Interval + * + * @var float + */ + private $interval = 1; + + /** + * Build the plot + * + * @param int $xMin Minimum X value + * @param int $xMax Maximum X value + * @param int $yMax Maximum Y value + * @param int $yMin Minimum Y value + */ + public function __construct($xMin, $xMax, $yMax, $yMin) { + + parent::__construct(); + + $this->setPadding(8, 8, 8, 8); + + $this->grid = new awGrid; + + // Hide grid by default + $this->grid->hide(TRUE); + + // Set extremum + $this->extremum = new awSide($xMin, $xMax, $yMax, $yMin); + + // Create axis + $this->xAxis = new awAxis; + $this->xAxis->setTickStyle(awTick::IN); + $this->xAxis->label->hideValue(0); + $this->initAxis($this->xAxis); + + $this->yAxis = new awAxis; + $this->yAxis->setTickStyle(awTick::IN); + $this->yAxis->label->hideValue(0); + $this->initAxis($this->yAxis); + + } + + protected function initAxis(awAxis $axis) { + + $axis->setLabelPrecision(1); + $axis->addTick('major', new awTick(0, 5)); + $axis->addTick('minor', new awTick(0, 3)); + $axis->addTick('micro', new awTick(0, 1)); + $axis->setNumberByTick('minor', 'major', 1); + $axis->setNumberByTick('micro', 'minor', 4); + $axis->label->setFont(new awTuffy(7)); + + } + + /** + * Interval to calculate values + * + * @param float $interval + */ + public function setInterval($interval) { + $this->interval = (float)$interval; + } + + /** + * Add a formula f(x) + * + * @param awMathFunction $function + * @param string $name Name for the legend (can be NULL if you don't want to set a legend) + * @param int $type Type for the legend + */ + public function add(awMathFunction $function, $name = NULL, $type = awLegend::LINE) { + + $this->functions[] = $function; + + if($name !== NULL) { + $this->legend->add($function, $name, $type); + } + + } + + public function init(awDriver $driver) { + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + $this->xAxis->line->setX($x1, $x2); + $this->xAxis->label->setAlign(NULL, awLabel::BOTTOM); + $this->xAxis->label->move(0, 3); + $this->xAxis->setRange($this->extremum->left, $this->extremum->right); + + $this->yAxis->line->setY($y2, $y1); + $this->yAxis->label->setAlign(awLabel::RIGHT); + $this->yAxis->label->move(-6, 0); + $this->yAxis->reverseTickStyle(); + $this->yAxis->setRange($this->extremum->bottom, $this->extremum->top); + + + $this->xAxis->setYCenter($this->yAxis, 0); + $this->yAxis->setXCenter($this->xAxis, 0); + + if($this->yAxis->getLabelNumber() === NULL) { + $number = $this->extremum->top - $this->extremum->bottom + 1; + $this->yAxis->setLabelNumber($number); + } + + if($this->xAxis->getLabelNumber() === NULL) { + $number = $this->extremum->right - $this->extremum->left + 1; + $this->xAxis->setLabelNumber($number); + } + + // Set ticks + + $this->xAxis->tick('major')->setNumber($this->xAxis->getLabelNumber()); + $this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber()); + + + // Set axis labels + $labels = array(); + for($i = 0, $count = $this->xAxis->getLabelNumber(); $i < $count; $i++) { + $labels[] = $i; + } + $this->xAxis->label->set($labels); + + $labels = array(); + for($i = 0, $count = $this->yAxis->getLabelNumber(); $i < $count; $i++) { + $labels[] = $i; + } + $this->yAxis->label->set($labels); + + parent::init($driver); + + // Create the grid + $this->createGrid(); + + // Draw the grid + $this->grid->draw($driver, $x1, $y1, $x2, $y2); + + } + + public function drawEnvelope(awDriver $driver) { + + // Draw axis + $this->xAxis->draw($driver); + $this->yAxis->draw($driver); + + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + foreach($this->functions as $function) { + + $f = $function->f; + $fromX = is_null($function->fromX) ? $this->extremum->left : $function->fromX; + $toX = is_null($function->toX) ? $this->extremum->right : $function->toX; + + $old = NULL; + + for($i = $fromX; $i <= $toX; $i += $this->interval) { + + $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($i, $f($i))); + + if($p->y >= $y1 and $p->y <= $y2) { + $function->mark->draw($driver, $p); + } + + if($old !== NULL) { + + $line = $function->line; + $line->setLocation($old, $p); + + if( + ($line->p1->y >= $y1 and $line->p1->y <= $y2) or + ($line->p2->y >= $y1 and $line->p2->y <= $y2) + ) { + $driver->line( + $function->getColor(), + $line + ); + } + + } + + $old = $p; + + } + + // Draw last point if needed + if($old !== NULL and $i - $this->interval != $toX) { + + $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($toX, $f($toX))); + + if($p->y >= $y1 and $p->y <= $y2) { + $function->mark->draw($driver, $p); + } + + + $line = $function->line; + $line->setLocation($old, $p); + + if( + ($line->p1->y >= $y1 and $line->p1->y <= $y2) or + ($line->p2->y >= $y1 and $line->p2->y <= $y2) + ) { + $driver->line( + $function->getColor(), + $line + ); + } + + } + + } + + } + + protected function createGrid() { + + // Horizontal lines of the grid + + $major = $this->yAxis->tick('major'); + $interval = $major->getInterval(); + $number = $this->yAxis->getLabelNumber() - 1; + + $h = array(); + if($number > 0) { + for($i = 0; $i <= $number; $i++) { + $h[] = $i / $number; + } + } + + // Vertical lines + + $major = $this->xAxis->tick('major'); + $interval = $major->getInterval(); + $number = $this->xAxis->getLabelNumber() - 1; + + $w = array(); + if($number > 0) { + for($i = 0; $i <= $number; $i++) { + if($i%$interval === 0) { + $w[] = $i / $number; + } + } + } + + $this->grid->setGrid($w, $h); + + } + +} + +registerClass('MathPlot'); diff --git a/modules/graphartichow/artichow/Pattern.class.php b/modules/graphartichow/artichow/Pattern.class.php new file mode 100644 index 000000000..0eee7e1ee --- /dev/null +++ b/modules/graphartichow/artichow/Pattern.class.php @@ -0,0 +1,96 @@ +args[$name] = $value; + } + } + + /** + * Get an argument + * + * @param string $name + * @param mixed $default Default value if the argument does not exist (default to NULL) + * @return mixed Argument value + */ + protected function getArg($name, $default = NULL) { + if(array_key_exists($name, $this->args)) { + return $this->args[$name]; + } else { + return $default; + } + } + + /** + * Change several arguments + * + * @param array $args New arguments + */ + public function setArgs($args) { + if(is_array($args)) { + foreach($args as $name => $value) { + $this->setArg($name, $value); + } + } + } + +} + +registerClass('Pattern', TRUE); diff --git a/modules/graphartichow/artichow/Pie.class.php b/modules/graphartichow/artichow/Pie.class.php new file mode 100644 index 000000000..8dec47825 --- /dev/null +++ b/modules/graphartichow/artichow/Pie.class.php @@ -0,0 +1,694 @@ +setValues($values); + + if(is_array($colors)) { + $this->colors = $colors; + } else { + + switch($colors) { + + case awPie::AQUA : + $this->colors = array( + new awColor(131, 220, 215), + new awColor(131, 190, 215), + new awColor(131, 160, 215), + new awColor(160, 140, 215), + new awColor(190, 131, 215), + new awColor(220, 131, 215) + ); + break; + + case awPie::EARTH : + $this->colors = array( + new awColor(97, 179, 110), + new awColor(130, 179, 97), + new awColor(168, 179, 97), + new awColor(179, 147, 97), + new awColor(179, 108, 97), + new awColor(99, 107, 189), + new awColor(99, 165, 189) + ); + break; + + case awPie::DARK : + $this->colors = array( + new awColor(140, 100, 170), + new awColor(130, 170, 100), + new awColor(160, 160, 120), + new awColor(150, 110, 140), + new awColor(130, 150, 160), + new awColor(90, 170, 140) + ); + break; + + default : + $this->colors = array( + new awColor(187, 213, 151), + new awColor(223, 177, 151), + new awColor(111, 186, 132), + new awColor(197, 160, 230), + new awColor(165, 169, 63), + new awColor(218, 177, 89), + new awColor(116, 205, 121), + new awColor(200, 201, 78), + new awColor(127, 205, 177), + new awColor(205, 160, 160), + new awColor(190, 190, 190) + ); + break; + + } + + } + + parent::__construct(); + + $this->label = new awLabel; + $this->label->setCallbackFunction('callbackPerCent'); + + } + + /** + * Change legend values + * + * @param array $legend An array of values for each part of the pie + */ + public function setLegend($legend) { + + $this->legendValues = (array)$legend; + + } + + /** + * Set a border all around the pie + * + * @param awColor $color A color for the border + */ + public function setBorderColor(awColor $color) { + $this->border = $color; + } + + /** + * Set a border all around the pie + * + * @param awColor $color A color for the border + */ + public function setBorder(awColor $color) { + if(ARTICHOW_DEPRECATED === TRUE) { + awImage::drawError('Class Pie: Method setBorder() has been deprecated since Artichow 1.0.9. Please use setBorderColor() instead.'); + } else { + $this->setBorderColor($color); + } + } + + /** + * Change 3D effect intensity + * + * @param int $size Effect size + */ + public function set3D($size) { + $this->size = (int)$size; + } + + /** + * Change initial angle + * + * @param int $angle New angle in degrees + */ + public function setStartAngle($angle) { + $this->angle = (int)$angle; + } + + /** + * Change label precision + * + * @param int $precision New precision + */ + public function setLabelPrecision($precision) { + $this->precision = (int)$precision; + } + + /** + * Change label position + * + * @param int $position New position in pixels + */ + public function setLabelPosition($position) { + $this->position = (int)$position; + } + + /** + * Change label number + * + * @param int $number New number + */ + public function setLabelNumber($number) { + $this->number = is_null($number) ? $number : (int)$number; + } + + /** + * Change label minimum + * + * @param int $minimum New minimum + */ + public function setLabelMinimum($minimum) { + $this->minimum = is_null($minimum) ? $minimum : (int)$minimum; + } + + /** + * Change Pie explode + * + * @param array $explode + */ + public function explode($explode) { + $this->explode = (array)$explode; + } + + public function drawEnvelope(awDriver $driver) { + + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + $count = count($this->values); + $sum = array_sum($this->values); + + $width = $x2 - $x1; + $height = $y2 - $y1; + + if($aliasing) { + $x = $width / 2; + $y = $height / 2; + } else { + $x = $width / 2 + $x1; + $y = $height / 2 + $y1; + } + + $position = $this->angle; + $values = array(); + $parts = array(); + $angles = 0; + + if($aliasing) { + $side = new awSide(0, 0, 0, 0); + } + + foreach($this->values as $key => $value) { + + $angle = ($value / $sum * 360); + + if($key === $count - 1) { + $angle = 360 - $angles; + } + + $angles += $angle; + + if(array_key_exists($key, $this->explode)) { + $middle = 360 - ($position + $angle / 2); + $posX = $this->explode[$key] * cos($middle * M_PI / 180); + $posY = $this->explode[$key] * sin($middle * M_PI / 180) * -1; + + if($aliasing) { + $explode = new awPoint( + $posX * 2, + $posY * 2 + ); + $side->set( + max($side->left, $posX * -2), + max($side->right, $posX * 2), + max($side->top, $posY * -2), + max($side->bottom, $posY * 2) + ); + } else { + $explode = new awPoint( + $posX, + $posY + ); + } + + } else { + $explode = new awPoint(0, 0); + } + + $values[$key] = array( + $position, ($position + $angle), $explode + ); + + $color = $this->colors[$key % count($this->colors)]; + $parts[$key] = new awPiePart($color); + + // Add part to the legend + $legend = array_key_exists($key, $this->legendValues) ? $this->legendValues[$key] : $key; + $this->legend->add($parts[$key], $legend, awLegend::BACKGROUND); + + $position += $angle; + + } + + if($aliasing) { + + $mainDriver = $driver; + + $x *= 2; + $y *= 2; + $width *= 2; + $height *= 2; + $this->size *= 2; + + $image = new awImage; + $image->border->hide(); + + // Adds support for antialiased pies on non-white background + $background = $this->getBackground(); + + if($background instanceof awColor) { + $image->setBackgroundColor($background); + } +// elseif($background instanceof awGradient) { +// $image->setBackgroundColor(new White(100)); +// } + + $image->setSize( + $width + $side->left + $side->right, + $height + $side->top + $side->bottom + $this->size + 1 /* bugs.php.net ! */ + ); + + $driver = $image->getDriver( + $width / $image->width, + $height / $image->height, + ($width / 2 + $side->left) / $image->width, + ($height / 2 + $side->top) / $image->height + ); + + } + + // Draw 3D effect + for($i = $this->size; $i > 0; $i--) { + + foreach($values as $key => $value) { + + $color = clone $this->colors[$key % count($this->colors)]; + $color->brightness(-50); + + list($from, $to, $explode) = $value; + + $driver->filledArc($color, $explode->move($x, $y + $i), $width, $height, $from, $to); + + unset($color); + + if($this->border instanceof awColor) { + + $point = $explode->move($x, $y); + + if($i === $this->size) { + + $driver->arc($this->border, $point->move(0, $this->size), $width, $height, $from, $to); + + } + + } + + } + + } + + foreach($values as $key => $value) { + + $color = $this->colors[$key % count($this->colors)]; + + list($from, $to, $explode) = $value; + + $driver->filledArc($color, $explode->move($x, $y), $width, $height, $from, $to); + + if($this->border instanceof awColor) { + + $point = $explode->move($x, $y); + $driver->arc($this->border, $point, $width, $height, $from, $to); + } + + } + + if($aliasing) { + + $x = $x / 2 + $x1; + $y = $y / 2 + $y1; + $width /= 2; + $height /= 2; + $this->size /= 2; + + foreach($values as $key => $value) { + $old = $values[$key][2]; + $values[$key][2] = new awPoint( + $old->x / 2, $old->y / 2 + ); + } + + $mainDriver->copyResizeImage( + $image, + new awPoint($x1 - $side->left / 2, $y1 - $side->top / 2), + new awPoint($x1 - $side->left / 2 + $image->width / 2, $y1 - $side->top / 2 + $image->height/ 2), + new awPoint(0, 0), + new awPoint($image->width, $image->height), + TRUE + ); + + $driver = $mainDriver; + + } + + // Get labels values + $pc = array(); + foreach($this->values as $key => $value) { + $pc[$key] = round($value / $sum * 100, $this->precision); + } + if($this->label->count() === 0) { // Check that there is no user defined values + $this->label->set($pc); + } + + $position = 0; + + foreach($pc as $key => $value) { + + // Limit number of labels to display + if($position === $this->number) { + break; + } + + if(is_null($this->minimum) === FALSE and $value < $this->minimum) { + continue; + } + + $position++; + + list($from, $to, $explode) = $values[$key]; + + $angle = $from + ($to - $from) / 2; + $angleRad = (360 - $angle) * M_PI / 180; + + $point = new awPoint( + $x + $explode->x + cos($angleRad) * ($width / 2 + $this->position), + $y + $explode->y - sin($angleRad) * ($height / 2 + $this->position) + ); + + $angle %= 360; + + // We don't display labels on the 3D effect + if($angle > 0 and $angle < 180) { + $point = $point->move(0, -1 * sin($angleRad) * $this->size); + } + + if($angle >= 45 and $angle < 135) { + $this->label->setAlign(awLabel::CENTER, awLabel::BOTTOM); + } else if($angle >= 135 and $angle < 225) { + $this->label->setAlign(awLabel::RIGHT, awLabel::MIDDLE); + } else if($angle >= 225 and $angle < 315) { + $this->label->setAlign(awLabel::CENTER, awLabel::TOP); + } else { + $this->label->setAlign(awLabel::LEFT, awLabel::MIDDLE); + } + + $this->label->draw( + $driver, + $point, + $key + ); + + } + + } + + /** + * Return margins around the component + * + * @return array Left, right, top and bottom margins + */ + public function getMargin() { + + // Get axis informations + + $leftAxis = $this->padding->left; + $rightAxis = $this->padding->right; + $topAxis = $this->padding->top; + $bottomAxis = $this->padding->bottom; + + return array($leftAxis, $rightAxis, $topAxis, $bottomAxis); + + } + + + /** + * Change values of Y axis + * This method ignores not numeric values + * + * @param array $values + */ + public function setValues($values) { + + $this->checkArray($values); + $this->values = $values; + + } + + + /** + * Return values of Y axis + * + * @return array + */ + public function getValues() { + return $this->values; + } + + private function checkArray(&$array) { + + if(is_array($array) === FALSE) { + awImage::drawError("Class Pie: You tried to set values that are not an array."); + } + + foreach($array as $key => $value) { + if(is_numeric($value) === FALSE) { + unset($array[$key]); + } + } + + if(count($array) < 1) { + awImage::drawError("Class Pie: Your graph must have at least 1 value."); + } + + } + +} + +registerClass('Pie'); + +/** + * Pie + * + * @package Artichow + */ +class awPiePart implements awLegendable { + + /** + * Pie part color + * + * @var Color + */ + protected $color; + + /** + * Build a new awPiePart + * + * @param awColor $color Pie part color + */ + public function __construct(awColor $color) { + + $this->color = $color; + + } + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground() { + return $this->color; + } + + /** + * Get the line thickness + * + * @return NULL + */ + public function getLegendLineThickness() { + } + + /** + * Get the line type + * + * @return NULL + */ + public function getLegendLineStyle() { + } + + /** + * Get the color of line + * + * @return NULL + */ + public function getLegendLineColor() { + } + + /** + * Get a mark object + * + * @return NULL + */ + public function getLegendMark() { + } + +} + +registerClass('PiePart'); + +function callbackPerCent($value) { + return $value.'%'; +} diff --git a/modules/graphartichow/artichow/Plot.class.php b/modules/graphartichow/artichow/Plot.class.php new file mode 100644 index 000000000..614b68efb --- /dev/null +++ b/modules/graphartichow/artichow/Plot.class.php @@ -0,0 +1,1463 @@ +grid = new awGrid; + $this->grid->setBackgroundColor(new awWhite); + + $this->padding->add(20, 0, 0, 20); + + $this->xAxis = new awAxis; + $this->xAxis->addTick('major', new awTick(0, 5)); + $this->xAxis->addTick('minor', new awTick(0, 3)); + $this->xAxis->setTickStyle(awTick::OUT); + $this->xAxis->label->setFont(new awTuffy(7)); + + $this->yAxis = new awAxis; + $this->yAxis->auto(TRUE); + $this->yAxis->addTick('major', new awTick(0, 5)); + $this->yAxis->addTick('minor', new awTick(0, 3)); + $this->yAxis->setTickStyle(awTick::OUT); + $this->yAxis->setNumberByTick('minor', 'major', 3); + $this->yAxis->label->setFont(new awTuffy(7)); + $this->yAxis->title->setAngle(90); + + } + + /** + * Get plot values + * + * @return array + */ + public function getValues() { + return $this->datay; + } + + /** + * Reduce number of values in the plot + * + * @param int $number Reduce number of values to $number + */ + public function reduce($number) { + + $count = count($this->datay); + $ratio = ceil($count / $number); + + if($ratio > 1) { + + $tmpy = $this->datay; + $datay = array(); + + $datax = array(); + $cbLabel = $this->xAxis->label->getCallbackFunction(); + + for($i = 0; $i < $count; $i += $ratio) { + + $slice = array_slice($tmpy, $i, $ratio); + $datay[] = array_sum($slice) / count($slice); + + // Reduce data on X axis if needed + if($cbLabel !== NULL) { + $datax[] = $cbLabel($i + round($ratio / 2)); + } + + } + + $this->setValues($datay); + + if($cbLabel !== NULL) { + $this->xAxis->setLabelText($datax); + } + + + } + + } + + /** + * Count values in the plot + * + * @return int + */ + public function getXAxisNumber() { + list($min, $max) = $this->xAxis->getRange(); + return ($max - $min + 1); + } + + /** + * Change X axis + * + * @param int $axis + */ + public function setXAxis($axis) { + $this->xAxisPosition = $axis; + } + + /** + * Get X axis + * + * @return int + */ + public function getXAxis() { + return $this->xAxisPosition; + } + + /** + * Set X axis on zero + * + * @param bool $zero + */ + public function setXAxisZero($zero) { + $this->xAxisZero = (bool)$zero; + } + + /** + * Set Y axis on zero + * + * @param bool $zero + */ + public function setYAxisZero($zero) { + $this->yAxisZero = (bool)$zero; + } + + /** + * Change Y axis + * + * @param int $axis + */ + public function setYAxis($axis) { + $this->yAxisPosition = $axis; + } + + /** + * Get Y axis + * + * @return int + */ + public function getYAxis() { + return $this->yAxisPosition; + } + + /** + * Change min value for Y axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setYMin($value) { + $this->yMin = $value; + $this->yAxis->auto(FALSE); + $this->updateAxis(); + } + + /** + * Change max value for Y axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setYMax($value) { + $this->yMax = $value; + $this->yAxis->auto(FALSE); + $this->updateAxis(); + } + + /** + * Change min value for X axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setXMin($value) { + $this->xMin = $value; + $this->updateAxis(); + } + + /** + * Change max value for X axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setXMax($value) { + $this->xMax = $value; + $this->updateAxis(); + } + + /** + * Get min value for Y axis + * + * @return float $value + */ + public function getYMin() { + if($this->auto) { + if(is_null($this->yMin)) { + $min = array_min($this->datay); + if($min > 0) { + return 0; + } + } + } + return is_null($this->yMin) ? array_min($this->datay) : (float)$this->yMin; + } + + /** + * Get max value for Y axis + * + * @return float $value + */ + public function getYMax() { + if($this->auto) { + if(is_null($this->yMax)) { + $max = array_max($this->datay); + if($max < 0) { + return 0; + } + } + } + return is_null($this->yMax) ? array_max($this->datay) : (float)$this->yMax; + } + + /** + * Get min value for X axis + * + * @return float $value + */ + public function getXMin() { + return floor(is_null($this->xMin) ? array_min($this->datax) : $this->xMin); + } + + /** + * Get max value for X axis + * + * @return float $value + */ + public function getXMax() { + return (ceil(is_null($this->xMax) ? array_max($this->datax) : (float)$this->xMax)) + ($this->getXCenter() ? 1 : 0); + } + + /** + * Get min value with spaces for Y axis + * + * @return float $value + */ + public function getRealYMin() { + $min = $this->getYMin(); + if($this->space->bottom !== NULL) { + $interval = ($this->getYMax() - $min) * $this->space->bottom / 100; + return $min - $interval; + } else { + return is_null($this->yMin) ? $min : (float)$this->yMin; + } + } + + /** + * Get max value with spaces for Y axis + * + * @return float $value + */ + public function getRealYMax() { + $max = $this->getYMax(); + if($this->space->top !== NULL) { + $interval = ($max - $this->getYMin()) * $this->space->top / 100; + return $max + $interval; + } else { + return is_null($this->yMax) ? $max : (float)$this->yMax; + } + } + + public function init(awDriver $driver) { + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + // Get space informations + list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); + + $this->xAxis->setPadding($leftSpace, $rightSpace); + + if($this->space->bottom > 0 or $this->space->top > 0) { + + list($min, $max) = $this->yAxis->getRange(); + $interval = $max - $min; + + $this->yAxis->setRange( + $min - $interval * $this->space->bottom / 100, + $max + $interval * $this->space->top / 100 + ); + + } + + // Auto-scaling mode + $this->yAxis->autoScale(); + + // Number of labels is not specified + if($this->yAxis->getLabelNumber() === NULL) { + $number = round(($y2 - $y1) / 75) + 2; + $this->yAxis->setLabelNumber($number); + } + + $this->xAxis->line->setX($x1, $x2); + $this->yAxis->line->setY($y2, $y1); + + // Set ticks + + $this->xAxis->tick('major')->setNumber($this->getXAxisNumber()); + $this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber()); + + + // Center X axis on zero + if($this->xAxisZero) { + $this->xAxis->setYCenter($this->yAxis, 0); + } + + // Center Y axis on zero + if($this->yAxisZero) { + $this->yAxis->setXCenter($this->xAxis, 0); + } + + // Set axis labels + $labels = array(); + + list($xMin, $xMax) = $this->xAxis->getRange(); + for($i = $xMin; $i <= $xMax; $i++) { + $labels[] = $i; + } + $this->xAxis->label->set($labels); + + parent::init($driver); + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + list($leftSpace, $rightSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); + + // Create the grid + $this->createGrid(); + + // Draw the grid + $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); + $this->grid->draw($driver, $x1, $y1, $x2, $y2); + + } + + public function drawEnvelope(awDriver $driver) { + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + if($this->getXCenter()) { + $size = $this->xAxis->getDistance(0, 1); + $this->xAxis->label->move($size / 2, 0); + $this->xAxis->label->hideLast(TRUE); + } + + // Draw top axis + if($this->xAxisPosition === awPlot::TOP or $this->xAxisPosition === awPlot::BOTH) { + $top = clone $this->xAxis; + if($this->xAxisZero === FALSE) { + $top->line->setY($y1, $y1); + } + $top->label->setAlign(NULL, awLabel::TOP); + $top->label->move(0, -3); + $top->title->move(0, -25); + $top->draw($driver); + } + + // Draw bottom axis + if($this->xAxisPosition === awPlot::BOTTOM or $this->xAxisPosition === awPlot::BOTH) { + $bottom = clone $this->xAxis; + if($this->xAxisZero === FALSE) { + $bottom->line->setY($y2, $y2); + } + $bottom->label->setAlign(NULL, awLabel::BOTTOM); + $bottom->label->move(0, 3); + $bottom->reverseTickStyle(); + $bottom->title->move(0, 25); + $bottom->draw($driver); + } + + // Draw left axis + if($this->yAxisPosition === awPlot::LEFT or $this->yAxisPosition === awPlot::BOTH) { + $left = clone $this->yAxis; + if($this->yAxisZero === FALSE) { + $left->line->setX($x1, $x1); + } + $left->label->setAlign(awLabel::RIGHT); + $left->label->move(-6, 0); + $left->title->move(-25, 0); + $left->draw($driver); + } + + // Draw right axis + if($this->yAxisPosition === awPlot::RIGHT or $this->yAxisPosition === awPlot::BOTH) { + $right = clone $this->yAxis; + if($this->yAxisZero === FALSE) { + $right->line->setX($x2, $x2); + } + $right->label->setAlign(awLabel::LEFT); + $right->label->move(6, 0); + $right->reverseTickStyle(); + $right->title->move(25, 0); + $right->draw($driver); + } + + } + + protected function createGrid() { + + $max = $this->getRealYMax(); + $min = $this->getRealYMin(); + + $number = $this->yAxis->getLabelNumber() - 1; + + if($number < 1) { + return; + } + + // Horizontal lines of the grid + + $h = array(); + for($i = 0; $i <= $number; $i++) { + $h[] = $i / $number; + } + + // Vertical lines + + $major = $this->yAxis->tick('major'); + $interval = $major->getInterval(); + $number = $this->getXAxisNumber() - 1; + + $w = array(); + + if($number > 0) { + + for($i = 0; $i <= $number; $i++) { + if($i%$interval === 0) { + $w[] = $i / $number; + } + } + + } + + $this->grid->setGrid($w, $h); + + } + + /** + * Change values of Y axis + * This method ignores not numeric values + * + * @param array $datay + * @param array $datax + */ + public function setValues($datay, $datax = NULL) { + + $this->checkArray($datay); + + foreach($datay as $key => $value) { + unset($datay[$key]); + $datay[(int)$key] = $value; + } + + if($datax === NULL) { + $datax = array(); + for($i = 0; $i < count($datay); $i++) { + $datax[] = $i; + } + } else { + foreach($datax as $key => $value) { + unset($datax[$key]); + $datax[(int)$key] = $value; + } + } + + $this->checkArray($datax); + + if(count($datay) === count($datax)) { + + // Set values + $this->datay = $datay; + $this->datax = $datax; + // Update axis with the new awvalues + $this->updateAxis(); + } else { + awImage::drawError("Class Plot: Plots must have the same number of X and Y points."); + } + + } + + /** + * Return begin and end values + * + * @return array + */ + protected function getLimit() { + + $i = 0; + while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { + $i++; + } + $start = $i; + $i = count($this->datay) - 1; + while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) { + $i--; + } + $stop = $i; + + return array($start, $stop); + + } + + /** + * Return TRUE if labels must be centered on X axis, FALSE otherwise + * + * @return bool + */ + abstract public function getXCenter(); + + private function updateAxis() { + + $this->xAxis->setRange( + $this->getXMin(), + $this->getXMax() + ); + $this->yAxis->setRange( + $this->getRealYMin(), + $this->getRealYMax() + ); + + } + + private function checkArray(&$array) { + + if(is_array($array) === FALSE) { + awImage::drawError("Class Plot: You tried to set a value that is not an array."); + } + + foreach($array as $key => $value) { + if(is_numeric($value) === FALSE and is_null($value) === FALSE) { + awImage::drawError("Class Plot: Expected numeric values for the plot."); + } + } + + if(count($array) < 1) { + awImage::drawError("Class Plot: Your plot must have at least 1 value."); + } + + } + +} + +registerClass('Plot', TRUE); + +class awPlotAxis { + + /** + * Left axis + * + * @var Axis + */ + public $left; + + /** + * Right axis + * + * @var Axis + */ + public $right; + + /** + * Top axis + * + * @var Axis + */ + public $top; + + /** + * Bottom axis + * + * @var Axis + */ + public $bottom; + + /** + * Build the group of axis + */ + public function __construct() { + + $this->left = new awAxis; + $this->left->auto(TRUE); + $this->left->label->setAlign(awLabel::RIGHT); + $this->left->label->move(-6, 0); + $this->yAxis($this->left); + $this->left->setTickStyle(awTick::OUT); + $this->left->title->move(-25, 0); + + $this->right = new awAxis; + $this->right->auto(TRUE); + $this->right->label->setAlign(awLabel::LEFT); + $this->right->label->move(6, 0); + $this->yAxis($this->right); + $this->right->setTickStyle(awTick::IN); + $this->right->title->move(25, 0); + + $this->top = new awAxis; + $this->top->label->setAlign(NULL, awLabel::TOP); + $this->top->label->move(0, -3); + $this->xAxis($this->top); + $this->top->setTickStyle(awTick::OUT); + $this->top->title->move(0, -25); + + $this->bottom = new awAxis; + $this->bottom->label->setAlign(NULL, awLabel::BOTTOM); + $this->bottom->label->move(0, 3); + $this->xAxis($this->bottom); + $this->bottom->setTickStyle(awTick::IN); + $this->bottom->title->move(0, 25); + + } + + protected function xAxis(awAxis $axis) { + + $axis->addTick('major', new awTick(0, 5)); + $axis->addTick('minor', new awTick(0, 3)); + $axis->label->setFont(new awTuffy(7)); + + } + + protected function yAxis(awAxis $axis) { + + $axis->addTick('major', new awTick(0, 5)); + $axis->addTick('minor', new awTick(0, 3)); + $axis->setNumberByTick('minor', 'major', 3); + $axis->label->setFont(new awTuffy(7)); + $axis->title->setAngle(90); + + } + +} + +registerClass('PlotAxis'); + +/** + * A graph with axis can contain some groups of components + * + * @package Artichow + */ +class awPlotGroup extends awComponentGroup { + + /** + * Grid properties + * + * @var Grid + */ + public $grid; + + /** + * Left, right, top and bottom axis + * + * @var PlotAxis + */ + public $axis; + + /** + * Set the X axis on zero + * + * @var bool + */ + protected $xAxisZero = TRUE; + + /** + * Set the Y axis on zero + * + * @var bool + */ + protected $yAxisZero = FALSE; + + /** + * Real axis used for Y axis + * + * @var string + */ + private $yRealAxis = awPlot::LEFT; + + /** + * Real axis used for X axis + * + * @var string + */ + private $xRealAxis = awPlot::BOTTOM; + + /** + * Change min value for Y axis + * + * @var mixed + */ + private $yMin = NULL; + + /** + * Change max value for Y axis + * + * @var mixed + */ + private $yMax = NULL; + + /** + * Change min value for X axis + * + * @var mixed + */ + private $xMin = NULL; + + /** + * Change max value for X axis + * + * @var mixed + */ + private $xMax = NULL; + + /** + * Build the PlotGroup + * + */ + public function __construct() { + + parent::__construct(); + + $this->grid = new awGrid; + $this->grid->setBackgroundColor(new awWhite); + + $this->axis = new awPlotAxis; + + } + + /** + * Set the X axis on zero or not + * + * @param bool $zero + */ + public function setXAxisZero($zero) { + $this->xAxisZero = (bool)$zero; + } + + /** + * Set the Y axis on zero or not + * + * @param bool $zero + */ + public function setYAxisZero($zero) { + $this->yAxisZero = (bool)$zero; + } + + /** + * Change min value for Y axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setYMin($value) { + $this->axis->left->auto(FALSE); + $this->axis->right->auto(FALSE); + $this->yMin = $value; + } + + /** + * Change max value for Y axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setYMax($value) { + $this->axis->left->auto(FALSE); + $this->axis->right->auto(FALSE); + $this->yMax = $value; + } + + /** + * Change min value for X axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setXMin($value) { + $this->xMin = $value; + } + + /** + * Change max value for X axis + * Set NULL for auto selection. + * + * @param float $value + */ + public function setXMax($value) { + $this->xMax = $value; + } + + /** + * Get min value for X axis + * + * @return float $value + */ + public function getXMin() { + + return $this->getX('min'); + + } + + /** + * Get max value for X axis + * + * @return float $value + */ + public function getXMax() { + + return $this->getX('max'); + + } + + private function getX($type) { + + switch($type) { + case 'max' : + if($this->xMax !== NULL) { + return $this->xMax; + } + break; + case 'min' : + if($this->xMin !== NULL) { + return $this->xMin; + } + break; + } + + $value = NULL; + $get = 'getX'.ucfirst($type); + + for($i = 0; $i < count($this->components); $i++) { + + $component = $this->components[$i]; + + if($value === NULL) { + $value = $component->$get(); + } else { + $value = $type($value, $component->$get()); + } + + } + + return $value; + + } + + /** + * Get min value with spaces for Y axis + * + * @param string $axis Axis name + * @return float $value + */ + public function getRealYMin($axis = NULL) { + + if($axis === NULL) { + return NULL; + } + + $min = $this->getRealY('min', $axis); + $max = $this->getRealY('max', $axis); + + if($this->space->bottom !== NULL) { + $interval = ($min - $max) * $this->space->bottom / 100; + return $min + $interval; + } else { + return $min; + } + + } + + /** + * Get max value with spaces for Y axis + * + * @param string $axis Axis name + * @return float $value + */ + public function getRealYMax($axis = NULL) { + + if($axis === NULL) { + return NULL; + } + + $min = $this->getRealY('min', $axis); + $max = $this->getRealY('max', $axis); + + if($this->space->top !== NULL) { + $interval = ($max - $min) * $this->space->top / 100; + return $max + $interval; + } else { + return $max; + } + + } + + private function getRealY($type, $axis) { + + switch($type) { + case 'max' : + if($this->yMax !== NULL) { + return $this->yMax; + } + break; + case 'min' : + if($this->yMin !== NULL) { + return $this->yMin; + } + break; + } + + $value = NULL; + $get = 'getY'.ucfirst($type); + + for($i = 0; $i < count($this->components); $i++) { + + $component = $this->components[$i]; + + switch($axis) { + + case awPlot::LEFT : + case awPlot::RIGHT : + $test = ($component->getYAxis() === $axis); + break; + default : + $test = FALSE; + + } + + if($test) { + + $auto = $component->yAxis->isAuto(); + $this->axis->{$axis}->auto($auto); + + if($value === NULL) { + $value = $component->$get(); + } else { + $value = $type($value, $component->$get()); + } + + } + + } + + return $value; + + } + + public function init(awDriver $driver) { + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + // Get PlotGroup space + list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); + + // Count values in the group + $values = $this->getXAxisNumber(); + + // Init the PlotGroup + $this->axis->top->line->setX($x1, $x2); + $this->axis->bottom->line->setX($x1, $x2); + $this->axis->left->line->setY($y2, $y1); + $this->axis->right->line->setY($y2, $y1); + + $this->axis->top->setPadding($leftSpace, $rightSpace); + $this->axis->bottom->setPadding($leftSpace, $rightSpace); + + $xMin = $this->getXMin(); + $xMax = $this->getXMax(); + + $this->axis->top->setRange($xMin, $xMax); + $this->axis->bottom->setRange($xMin, $xMax); + + for($i = 0; $i < count($this->components); $i++) { + + + $component = $this->components[$i]; + + $component->auto($this->auto); + + // Copy space to the component + + $component->setSpace($this->space->left, $this->space->right, $this->space->top, $this->space->bottom); + + $component->xAxis->setPadding($leftSpace, $rightSpace); + $component->xAxis->line->setX($x1, $x2); + + $component->yAxis->line->setY($y2, $y1); + + } + + // Set Y axis range + foreach(array('left', 'right') as $axis) { + + if($this->isAxisUsed($axis)) { + + $min = $this->getRealYMin($axis); + $max = $this->getRealYMax($axis); + + $interval = $max - $min; + + $this->axis->{$axis}->setRange( + $min - $interval * $this->space->bottom / 100, + $max + $interval * $this->space->top / 100 + ); + + // Auto-scaling mode + if($this->axis->{$axis}->isAuto()) { + $this->axis->{$axis}->autoScale(); + } + + } + + } + + if($this->axis->left->getLabelNumber() === NULL) { + $number = round(($y2 - $y1) / 75) + 2; + $this->axis->left->setLabelNumber($number); + } + + if($this->axis->right->getLabelNumber() === NULL) { + $number = round(($y2 - $y1) / 75) + 2; + $this->axis->right->setLabelNumber($number); + } + + // Center labels on X axis if needed + $test = array(awPlot::TOP => FALSE, awPlot::BOTTOM => FALSE); + + for($i = 0; $i < count($this->components); $i++) { + + + $component = $this->components[$i]; + + + if($component->getValues() !== NULL) { + + $axis = $component->getXAxis(); + + if($test[$axis] === FALSE) { + + // Center labels for bar plots + if($component->getXCenter()) { + $size = $this->axis->{$axis}->getDistance(0, 1); + $this->axis->{$axis}->label->move($size / 2, 0); + $this->axis->{$axis}->label->hideLast(TRUE); + $test[$axis] = TRUE; + } + + } + + } + + + } + + // Set axis labels + $labels = array(); + for($i = $xMin; $i <= $xMax; $i++) { + $labels[] = $i; + } + if($this->axis->top->label->count() === 0) { + $this->axis->top->label->set($labels); + } + if($this->axis->bottom->label->count() === 0) { + $this->axis->bottom->label->set($labels); + } + + // Set ticks + + $this->axis->top->tick('major')->setNumber($values); + $this->axis->bottom->tick('major')->setNumber($values); + $this->axis->left->tick('major')->setNumber($this->axis->left->getLabelNumber()); + $this->axis->right->tick('major')->setNumber($this->axis->right->getLabelNumber()); + + + // Set X axis on zero + if($this->xAxisZero) { + $axis = $this->selectYAxis(); + $this->axis->bottom->setYCenter($axis, 0); + $this->axis->top->setYCenter($axis, 0); + } + + // Set Y axis on zero + if($this->yAxisZero) { + $axis = $this->selectXAxis(); + $this->axis->left->setXCenter($axis, 1); + $this->axis->right->setXCenter($axis, 1); + } + + parent::init($driver); + + list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1); + + // Create the grid + $this->createGrid(); + + // Draw the grid + $this->grid->setSpace($leftSpace, $rightSpace, 0, 0); + $this->grid->draw($driver, $x1, $y1, $x2, $y2); + + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + $xMin = $this->getXMin(); + $xMax = $this->getXMax(); + + $maxLeft = $this->getRealYMax(awPlot::LEFT); + $maxRight = $this->getRealYMax(awPlot::RIGHT); + + $minLeft = $this->getRealYMin(awPlot::LEFT); + $minRight = $this->getRealYMin(awPlot::RIGHT); + + foreach($this->components as $component) { + + $min = $component->getYMin(); + $max = $component->getYMax(); + + // Set component minimum and maximum + if($component->getYAxis() === awPlot::LEFT) { + + list($min, $max) = $this->axis->left->getRange(); + + $component->setYMin($min); + $component->setYMax($max); + + } else { + + list($min, $max) = $this->axis->right->getRange(); + + $component->setYMin($min); + $component->setYMax($max); + + } + + $component->setXAxisZero($this->xAxisZero); + $component->setYAxisZero($this->yAxisZero); + + $component->xAxis->setRange($xMin, $xMax); + + $component->drawComponent( + $driver, + $x1, $y1, + $x2, $y2, + $aliasing + ); + + $component->setYMin($min); + $component->setYMax($max); + + } + + } + + public function drawEnvelope(awDriver $driver) { + + list($x1, $y1, $x2, $y2) = $this->getPosition(); + + // Hide unused axis + foreach(array(awPlot::LEFT, awPlot::RIGHT, awPlot::TOP, awPlot::BOTTOM) as $axis) { + if($this->isAxisUsed($axis) === FALSE) { + $this->axis->{$axis}->hide(TRUE); + } + } + + // Draw top axis + $top = $this->axis->top; + if($this->xAxisZero === FALSE) { + $top->line->setY($y1, $y1); + } + $top->draw($driver); + + // Draw bottom axis + $bottom = $this->axis->bottom; + if($this->xAxisZero === FALSE) { + $bottom->line->setY($y2, $y2); + } + $bottom->draw($driver); + + // Draw left axis + $left = $this->axis->left; + if($this->yAxisZero === FALSE) { + $left->line->setX($x1, $x1); + } + $left->draw($driver); + + // Draw right axis + $right = $this->axis->right; + if($this->yAxisZero === FALSE) { + $right->line->setX($x2, $x2); + } + $right->draw($driver); + + } + + /** + * Is the specified axis used ? + * + * @param string $axis Axis name + * @return bool + */ + protected function isAxisUsed($axis) { + + for($i = 0; $i < count($this->components); $i++) { + + $component = $this->components[$i]; + + switch($axis) { + + case awPlot::LEFT : + case awPlot::RIGHT : + if($component->getYAxis() === $axis) { + return TRUE; + } + break; + + case awPlot::TOP : + case awPlot::BOTTOM : + if($component->getXAxis() === $axis) { + return TRUE; + } + break; + + } + + } + + return FALSE; + + } + + protected function createGrid() { + + $max = $this->getRealYMax(awPlot::LEFT); + $min = $this->getRealYMin(awPlot::RIGHT); + + // Select axis (left if possible, right otherwise) + $axis = $this->selectYAxis(); + + $number = $axis->getLabelNumber() - 1; + + if($number < 1) { + return; + } + + // Horizontal lines of grid + + $h = array(); + for($i = 0; $i <= $number; $i++) { + $h[] = $i / $number; + } + + // Vertical lines + + $major = $axis->tick('major'); + $interval = $major->getInterval(); + $number = $this->getXAxisNumber() - 1; + + $w = array(); + + if($number > 0) { + + for($i = 0; $i <= $number; $i++) { + if($i%$interval === 0) { + $w[] = $i / $number; + } + } + + } + + $this->grid->setGrid($w, $h); + + } + + protected function selectYAxis(){ + + // Select axis (left if possible, right otherwise) + if($this->isAxisUsed(awPlot::LEFT)) { + $axis = $this->axis->left; + } else { + $axis = $this->axis->right; + } + + return $axis; + + } + + protected function selectXAxis(){ + + // Select axis (bottom if possible, top otherwise) + if($this->isAxisUsed(awPlot::BOTTOM)) { + $axis = $this->axis->bottom; + } else { + $axis = $this->axis->top; + } + + return $axis; + + } + + protected function getXAxisNumber() { + $offset = $this->components[0]; + $max = $offset->getXAxisNumber(); + for($i = 1; $i < count($this->components); $i++) { + $offset = $this->components[$i]; + $max = max($max, $offset->getXAxisNumber()); + } + return $max; + } + +} + +registerClass('PlotGroup'); diff --git a/modules/graphartichow/artichow/ScatterPlot.class.php b/modules/graphartichow/artichow/ScatterPlot.class.php new file mode 100644 index 000000000..7e01c1425 --- /dev/null +++ b/modules/graphartichow/artichow/ScatterPlot.class.php @@ -0,0 +1,300 @@ +mark = new awMark; + $this->mark->setType(awMark::CIRCLE); + $this->mark->setSize(7); + $this->mark->border->show(); + + $this->label = new awLabel; + + $this->setValues($datay, $datax); + $this->setColor(new awBlack); + + } + + /** + * Display plot as impulses + * + * @param awColor $impulse Impulses color (or NULL to disable impulses) + */ + public function setImpulse($color) { + $this->impulse = $color; + } + + /** + * Link scatter plot points + * + * @param bool $link + * @param awColor $color Line color (default to black) + */ + public function link($link, $color = NULL) { + $this->link = (bool)$link; + if($color instanceof awColor) { + $this->setColor($color); + } + } + + /** + * Ignore null values for Y data and continue linking + * + * @param bool $link + */ + public function linkNull($link) { + $this->linkNull = (bool)$link; + } + + /** + * Change line color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->lineColor = $color; + } + + /** + * Change line style + * + * @param int $style + */ + public function setStyle($style) { + $this->lineStyle = (int)$style; + } + + /** + * Change line tickness + * + * @param int $tickness + */ + public function setThickness($tickness) { + $this->lineThickness = (int)$tickness; + } + + /** + * Get the line thickness + * + * @return int + */ + public function getLegendLineThickness() { + return $this->lineThickness; + } + + /** + * Get the line type + * + * @return int + */ + public function getLegendLineStyle() { + return $this->lineStyle; + } + + /** + * Get the color of line + * + * @return Color + */ + public function getLegendLineColor() { + return $this->lineColor; + } + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground() { + return NULL; + } + + /** + * Get a mark object + * + * @return Mark + */ + public function getLegendMark() { + return $this->mark; + } + + public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) { + + $count = count($this->datay); + + // Get start and stop values + list($start, $stop) = $this->getLimit(); + + // Build the polygon + $polygon = new awPolygon; + + for($key = 0; $key < $count; $key++) { + + $x = $this->datax[$key]; + $y = $this->datay[$key]; + + if($y !== NULL) { + $p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($x, $y)); + $polygon->set($key, $p); + } else if($this->linkNull === FALSE) { + $polygon->set($key, NULL); + } + + } + + // Link points if needed + if($this->link) { + + $prev = NULL; + + foreach($polygon->all() as $point) { + + if($prev !== NULL and $point !== NULL) { + $driver->line( + $this->lineColor, + new awLine( + $prev, + $point, + $this->lineStyle, + $this->lineThickness + ) + ); + } + $prev = $point; + + } + } + + // Draw impulses + if($this->impulse instanceof awColor) { + + foreach($polygon->all() as $key => $point) { + + if($point !== NULL) { + + $zero = awAxis::toPosition( + $this->xAxis, + $this->yAxis, + new awPoint($key, 0) + ); + + $driver->line( + $this->impulse, + new awLine( + $zero, + $point, + awLine::SOLID, + 1 + ) + ); + + } + + } + + } + + // Draw marks and labels + foreach($polygon->all() as $key => $point) { + + $this->mark->draw($driver, $point); + $this->label->draw($driver, $point, $key); + + } + + } + + protected function xAxisPoint($position) { + $y = $this->xAxisZero ? 0 : $this->getRealYMin(); + return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y)); + } + + public function getXCenter() { + return FALSE; + } + +} + +registerClass('ScatterPlot'); + diff --git a/modules/graphartichow/artichow/cache/Abel b/modules/graphartichow/artichow/cache/Abel new file mode 100644 index 000000000..82538a612 Binary files /dev/null and b/modules/graphartichow/artichow/cache/Abel differ diff --git a/modules/graphartichow/artichow/cache/Abel-time b/modules/graphartichow/artichow/cache/Abel-time new file mode 100644 index 000000000..a730f38b1 --- /dev/null +++ b/modules/graphartichow/artichow/cache/Abel-time @@ -0,0 +1,2 @@ +1166203484 +png \ No newline at end of file diff --git a/modules/graphartichow/artichow/cache/Albert b/modules/graphartichow/artichow/cache/Albert new file mode 100644 index 000000000..a40f42441 Binary files /dev/null and b/modules/graphartichow/artichow/cache/Albert differ diff --git a/modules/graphartichow/artichow/cache/Albert-time b/modules/graphartichow/artichow/cache/Albert-time new file mode 100644 index 000000000..7e2eb85de --- /dev/null +++ b/modules/graphartichow/artichow/cache/Albert-time @@ -0,0 +1,2 @@ +1166203480 +png \ No newline at end of file diff --git a/modules/graphartichow/artichow/cache/Example-006 b/modules/graphartichow/artichow/cache/Example-006 new file mode 100644 index 000000000..a16839b7d Binary files /dev/null and b/modules/graphartichow/artichow/cache/Example-006 differ diff --git a/modules/graphartichow/artichow/cache/Example-006-time b/modules/graphartichow/artichow/cache/Example-006-time new file mode 100644 index 000000000..615edc04f --- /dev/null +++ b/modules/graphartichow/artichow/cache/Example-006-time @@ -0,0 +1,2 @@ +1204776421 +png \ No newline at end of file diff --git a/modules/graphartichow/artichow/common.php b/modules/graphartichow/artichow/common.php new file mode 100644 index 000000000..f4e6e042f --- /dev/null +++ b/modules/graphartichow/artichow/common.php @@ -0,0 +1,96 @@ + 0) { + + do { + $min = array_pop($array); + if(is_numeric($min) === FALSE) { + $min = NULL; + } + } while(count($array) > 0 and $min === NULL); + + if($min !== NULL) { + $min = (float)$min; + } + + foreach($array as $value) { + if(is_numeric($value) and (float)$value < $min) { + $min = (float)$value; + } + } + + return $min; + + } + + return NULL; + +} + +/* + * Get the maximum of an array and ignore non numeric values + */ +function array_max($array) { + + if(is_array($array) and count($array) > 0) { + + do { + $max = array_pop($array); + if(is_numeric($max) === FALSE) { + $max = NULL; + } + } while(count($array) > 0 and $max === NULL); + + if($max !== NULL) { + $max = (float)$max; + } + + foreach($array as $value) { + if(is_numeric($value) and (float)$value > $max) { + $max = (float)$value; + } + } + + return $max; + + } + + return NULL; + +} +/* + * Define file_put_contents() if needed + */ +if(function_exists('file_put_contents') === FALSE) { + + function file_put_contents($file, $content) { + $fp = fopen($file, 'w'); + if($fp) { + fwrite($fp, $content); + fclose($fp); + } + } + +} + +/* + * Change error handler + */ +set_error_handler('errorHandlerArtichow'); + +function errorHandlerArtichow($level, $message, $file, $line) { + awImage::drawError($message.' in '.$file.' on line '.$line.'.'); +} + diff --git a/modules/graphartichow/artichow/font/Tuffy.ttf b/modules/graphartichow/artichow/font/Tuffy.ttf new file mode 100644 index 000000000..8151817be Binary files /dev/null and b/modules/graphartichow/artichow/font/Tuffy.ttf differ diff --git a/modules/graphartichow/artichow/font/TuffyBold.ttf b/modules/graphartichow/artichow/font/TuffyBold.ttf new file mode 100644 index 000000000..2f45b4f17 Binary files /dev/null and b/modules/graphartichow/artichow/font/TuffyBold.ttf differ diff --git a/modules/graphartichow/artichow/font/TuffyBoldItalic.ttf b/modules/graphartichow/artichow/font/TuffyBoldItalic.ttf new file mode 100644 index 000000000..554faf202 Binary files /dev/null and b/modules/graphartichow/artichow/font/TuffyBoldItalic.ttf differ diff --git a/modules/graphartichow/artichow/font/TuffyItalic.ttf b/modules/graphartichow/artichow/font/TuffyItalic.ttf new file mode 100644 index 000000000..5f972ec08 Binary files /dev/null and b/modules/graphartichow/artichow/font/TuffyItalic.ttf differ diff --git a/modules/graphartichow/artichow/images/book.png b/modules/graphartichow/artichow/images/book.png new file mode 100644 index 000000000..da1885100 Binary files /dev/null and b/modules/graphartichow/artichow/images/book.png differ diff --git a/modules/graphartichow/artichow/images/error.png b/modules/graphartichow/artichow/images/error.png new file mode 100644 index 000000000..e5addb110 Binary files /dev/null and b/modules/graphartichow/artichow/images/error.png differ diff --git a/modules/graphartichow/artichow/images/errors/missing-anti-aliasing.png b/modules/graphartichow/artichow/images/errors/missing-anti-aliasing.png new file mode 100644 index 000000000..f020d263f Binary files /dev/null and b/modules/graphartichow/artichow/images/errors/missing-anti-aliasing.png differ diff --git a/modules/graphartichow/artichow/images/errors/missing-gd2.png b/modules/graphartichow/artichow/images/errors/missing-gd2.png new file mode 100644 index 000000000..cac144cb8 Binary files /dev/null and b/modules/graphartichow/artichow/images/errors/missing-gd2.png differ diff --git a/modules/graphartichow/artichow/images/paperclip.png b/modules/graphartichow/artichow/images/paperclip.png new file mode 100644 index 000000000..12188f90c Binary files /dev/null and b/modules/graphartichow/artichow/images/paperclip.png differ diff --git a/modules/graphartichow/artichow/images/star.png b/modules/graphartichow/artichow/images/star.png new file mode 100644 index 000000000..4acf00330 Binary files /dev/null and b/modules/graphartichow/artichow/images/star.png differ diff --git a/modules/graphartichow/artichow/inc/Axis.class.php b/modules/graphartichow/artichow/inc/Axis.class.php new file mode 100644 index 000000000..4eb4ce7d4 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Axis.class.php @@ -0,0 +1,768 @@ + 'toProportionalValue', + 'toPosition' => 'toProportionalPosition' + ); + + /** + * Build the axis + * + * @param float $min Begin of the range of the axis + * @param float $max End of the range of the axis + */ + public function __construct($min = NULL, $max = NULL) { + + $this->line = new awVector( + new awPoint(0, 0), + new awPoint(0, 0) + ); + + $this->label = new awLabel; + $this->padding = new awSide; + + $this->title = new awLabel( + NULL, + NULL, + NULL, + 0 + ); + + $this->setColor(new awBlack); + + if($min !== NULL and $max !== NULL) { + $this->setRange($min, $max); + } + + } + + /** + * Enable/disable auto-scaling mode + * + * @param bool $auto + */ + public function auto($auto) { + $this->auto = (bool)$auto; + } + + /** + * Get auto-scaling mode status + * + * @return bool + */ + public function isAuto() { + return $this->auto; + } + + /** + * Hide axis + * + * @param bool $hide + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show axis + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = !(bool)$show; + } + + /** + * Return a tick object from its name + * + * @param string $name Tick object name + * @return Tick + */ + public function tick($name) { + + return array_key_exists($name, $this->ticks) ? $this->ticks[$name] : NULL; + + } + + /** + * Add a tick object + * + * @param string $name Tick object name + * @param awTick $tick Tick object + */ + public function addTick($name, awTick $tick) { + + $this->ticks[$name] = $tick; + + } + + /** + * Delete a tick object + * + * @param string $name Tick object name + */ + public function deleteTick($name) { + if(array_key_exists($name, $this->ticks)) { + unset($this->ticks[$name]); + } + } + + /** + * Hide all ticks + * + * @param bool $hide Hide or not ? + */ + public function hideTicks($hide = TRUE) { + + foreach($this->ticks as $tick) { + $tick->hide($hide); + } + + } + + /** + * Change ticks style + * + * @param int $style Ticks style + */ + public function setTickStyle($style) { + + foreach($this->ticks as $tick) { + $tick->setStyle($style); + } + + } + + /** + * Change ticks interval + * + * @param int $interval Ticks interval + */ + public function setTickInterval($interval) { + + foreach($this->ticks as $tick) { + $tick->setInterval($interval); + } + + } + + /** + * Change number of ticks relative to others ticks + * + * @param awTick $to Change number of theses ticks + * @param awTick $from Ticks reference + * @param float $number Number of ticks by the reference + */ + public function setNumberByTick($to, $from, $number) { + $this->ticks[$to]->setNumberByTick($this->ticks[$from], $number); + } + + /** + * Reverse ticks style + */ + public function reverseTickStyle() { + + foreach($this->ticks as $tick) { + if($tick->getStyle() === awTick::IN) { + $tick->setStyle(awTick::OUT); + } else if($tick->getStyle() === awTick::OUT) { + $tick->setStyle(awTick::IN); + } + } + + } + + /** + * Change interval of labels + * + * @param int $interval Interval + */ + public function setLabelInterval($interval) { + $this->auto(FALSE); + $this->setTickInterval($interval); + $this->label->setInterval($interval); + } + + /** + * Change number of labels + * + * @param int $number Number of labels to display (can be NULL) + */ + public function setLabelNumber($number) { + $this->auto(FALSE); + $this->labelNumber = is_null($number) ? NULL : (int)$number; + } + + /** + * Get number of labels + * + * @return int + */ + public function getLabelNumber() { + return $this->labelNumber; + } + + /** + * Change precision of labels + * + * @param int $precision Precision + */ + public function setLabelPrecision($precision) { + $this->auto(FALSE); + $function = 'axis'.time().'_'.(microtime() * 1000000); + eval('function '.$function.'($value) { + return sprintf("%.'.(int)$precision.'f", $value); + }'); + $this->label->setCallbackFunction($function); + } + + /** + * Change text of labels + * + * @param array $texts Some texts + */ + public function setLabelText($texts) { + if(is_array($texts)) { + $this->auto(FALSE); + $function = 'axis'.time().'_'.(microtime() * 1000000); + eval('function '.$function.'($value) { + $texts = '.var_export($texts, TRUE).'; + return isset($texts[$value]) ? $texts[$value] : \'?\'; + }'); + $this->label->setCallbackFunction($function); + } + } + + /** + * Get the position of a point + * + * @param awAxis $xAxis X axis + * @param awAxis $yAxis Y axis + * @param awPoint $p Position of the point + * @return Point Position on the axis + */ + public static function toPosition(awAxis $xAxis, awAxis $yAxis, awPoint $p) { + + $p1 = $xAxis->getPointFromValue($p->x); + $p2 = $yAxis->getPointFromValue($p->y); + + return new awPoint( + round($p1->x), + round($p2->y) + ); + + } + + /** + * Change title alignment + * + * @param int $alignment New Alignment + */ + public function setTitleAlignment($alignment) { + + switch($alignment) { + + case awLabel::TOP : + $this->setTitlePosition(1); + $this->title->setAlign(NULL, awLabel::BOTTOM); + break; + + case awLabel::BOTTOM : + $this->setTitlePosition(0); + $this->title->setAlign(NULL, awLabel::TOP); + break; + + case awLabel::LEFT : + $this->setTitlePosition(0); + $this->title->setAlign(awLabel::LEFT); + break; + + case awLabel::RIGHT : + $this->setTitlePosition(1); + $this->title->setAlign(awLabel::RIGHT); + break; + + } + + } + + /** + * Change title position on the axis + * + * @param float $position A new awposition between 0 and 1 + */ + public function setTitlePosition($position) { + $this->titlePosition = (float)$position; + } + + /** + * Change axis and axis title color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + $this->title->setColor($color); + } + + /** + * Change axis padding + * + * @param int $left Left padding in pixels + * @param int $right Right padding in pixels + */ + public function setPadding($left, $right) { + $this->padding->set($left, $right); + } + + /** + * Get axis padding + * + * @return Side + */ + public function getPadding() { + return $this->padding; + } + + /** + * Change axis range + * + * @param float $min + * @param float $max + */ + public function setRange($min, $max) { + if($min !== NULL) { + $this->range[0] = (float)$min; + } + if($max !== NULL) { + $this->range[1] = (float)$max; + } + } + + /** + * Get axis range + * + * @return array + */ + public function getRange() { + return $this->range; + } + + /** + * Change axis range callback function + * + * @param string $toValue Transform a position between 0 and 1 to a value + * @param string $toPosition Transform a value to a position between 0 and 1 on the axis + */ + public function setRangeCallback($toValue, $toPosition) { + $this->rangeCallback = array( + 'toValue' => (string)$toValue, + 'toPosition' => (string)$toPosition + ); + } + + /** + * Center X values of the axis + * + * @param awAxis $axis An axis + * @param float $value The reference value on the axis + */ + public function setXCenter(awAxis $axis, $value) { + + // Check vector angle + if($this->line->isVertical() === FALSE) { + awImage::drawError("Class Axis: setXCenter() can only be used on vertical axes."); + } + + $p = $axis->getPointFromValue($value); + + $this->line->setX( + $p->x, + $p->x + ); + + } + + /** + * Center Y values of the axis + * + * @param awAxis $axis An axis + * @param float $value The reference value on the axis + */ + public function setYCenter(awAxis $axis, $value) { + + // Check vector angle + if($this->line->isHorizontal() === FALSE) { + awImage::drawError("Class Axis: setYCenter() can only be used on horizontal axes."); + } + + $p = $axis->getPointFromValue($value); + + $this->line->setY( + $p->y, + $p->y + ); + + } + + /** + * Get the distance between to values on the axis + * + * @param float $from The first value + * @param float $to The last value + * @return Point + */ + public function getDistance($from, $to) { + + $p1 = $this->getPointFromValue($from); + $p2 = $this->getPointFromValue($to); + + return $p1->getDistance($p2); + + } + + /** + * Get a point on the axis from a value + * + * @param float $value + * @return Point + */ + protected function getPointFromValue($value) { + + $callback = $this->rangeCallback['toPosition']; + + list($min, $max) = $this->range; + $position = $callback($value, $min, $max); + + return $this->getPointFromPosition($position); + + } + + /** + * Get a point on the axis from a position + * + * @param float $position A position between 0 and 1 + * @return Point + */ + protected function getPointFromPosition($position) { + + $vector = $this->getVector(); + + $angle = $vector->getAngle(); + $size = $vector->getSize(); + + return $vector->p1->move( + cos($angle) * $size * $position, + -1 * sin($angle) * $size * $position + ); + + } + + /** + * Draw axis + * + * @param awDriver $driver A driver + */ + public function draw(awDriver $driver) { + + if($this->hide) { + return; + } + + $vector = $this->getVector(); + + // Draw axis ticks + $this->drawTicks($driver, $vector); + + // Draw axis line + $this->line($driver); + + // Draw labels + $this->drawLabels($driver); + + // Draw axis title + $p = $this->getPointFromPosition($this->titlePosition); + $this->title->draw($driver, $p); + + } + + public function autoScale() { + + if($this->isAuto() === FALSE) { + return; + } + + list($min, $max) = $this->getRange(); + $interval = $max - $min; + + if($interval > 0) { + $partMax = $max / $interval; + $partMin = $min / $interval; + } else { + $partMax = 0; + $partMin = 0; + } + + $difference = log($interval) / log(10); + $difference = floor($difference); + + $pow = pow(10, $difference); + + if($pow > 0) { + $intervalNormalize = $interval / $pow; + } else { + $intervalNormalize = 0; + } + + if($difference <= 0) { + + $precision = $difference * -1 + 1; + + if($intervalNormalize > 2) { + $precision--; + } + + } else { + $precision = 0; + } + + if($min != 0 and $max != 0) { + $precision++; + } + + if($this->label->getCallbackFunction() === NULL) { + $this->setLabelPrecision($precision); + } + + if($intervalNormalize <= 1.5) { + $intervalReal = 1.5; + $labelNumber = 4; + } else if($intervalNormalize <= 2) { + $intervalReal = 2; + $labelNumber = 5; + } else if($intervalNormalize <= 3) { + $intervalReal = 3; + $labelNumber = 4; + } else if($intervalNormalize <= 4) { + $intervalReal = 4; + $labelNumber = 5; + } else if($intervalNormalize <= 5) { + $intervalReal = 5; + $labelNumber = 6; + } else if($intervalNormalize <= 8) { + $intervalReal = 8; + $labelNumber = 5; + } else if($intervalNormalize <= 10) { + $intervalReal = 10; + $labelNumber = 6; + } + + if($min == 0) { + + $this->setRange( + $min, + $intervalReal * $pow + ); + + } else if($max == 0) { + + $this->setRange( + $intervalReal * $pow * -1, + 0 + ); + + } + + $this->setLabelNumber($labelNumber); + + } + + protected function line(awDriver $driver) { + + $driver->line( + $this->color, + $this->line + ); + + } + + protected function drawTicks(awDriver $driver, awVector $vector) { + + foreach($this->ticks as $tick) { + $tick->setColor($this->color); + $tick->draw($driver, $vector); + } + + } + + protected function drawLabels($driver) { + + if($this->labelNumber !== NULL) { + list($min, $max) = $this->range; + $number = $this->labelNumber - 1; + if($number < 1) { + return; + } + $function = $this->rangeCallback['toValue']; + $labels = array(); + for($i = 0; $i <= $number; $i++) { + $labels[] = $function($i / $number, $min, $max); + } + $this->label->set($labels); + } + + $labels = $this->label->count(); + + for($i = 0; $i < $labels; $i++) { + + $p = $this->getPointFromValue($this->label->get($i)); + $this->label->draw($driver, $p, $i); + + } + + } + + protected function getVector() { + + $angle = $this->line->getAngle(); + + // Compute paddings + $vector = new awVector( + $this->line->p1->move( + cos($angle) * $this->padding->left, + -1 * sin($angle) * $this->padding->left + ), + $this->line->p2->move( + -1 * cos($angle) * $this->padding->right, + -1 * -1 * sin($angle) * $this->padding->right + ) + ); + + return $vector; + + } + + public function __clone() { + + $this->label = clone $this->label; + $this->line = clone $this->line; + $this->title = clone $this->title; + + foreach($this->ticks as $name => $tick) { + $this->ticks[$name] = clone $tick; + } + + } + +} + +registerClass('Axis'); + +function toProportionalValue($position, $min, $max) { + return $min + ($max - $min) * $position; +} + +function toProportionalPosition($value, $min, $max) { + if($max - $min == 0) { + return 0; + } + return ($value - $min) / ($max - $min); +} diff --git a/modules/graphartichow/artichow/inc/Border.class.php b/modules/graphartichow/artichow/inc/Border.class.php new file mode 100644 index 000000000..6e8fc41fc --- /dev/null +++ b/modules/graphartichow/artichow/inc/Border.class.php @@ -0,0 +1,197 @@ +setStyle($style); + + if($color instanceof awColor) { + $this->setColor($color); + } else { + $this->setColor(new awBlack); + } + + } + + /** + * Change border color + * This method automatically shows the border if it is hidden + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + $this->show(); + } + + /** + * Change border style + * + * @param int $style + */ + public function setStyle($style) { + $this->style = (int)$style; + } + + /** + * Hide border ? + * + * @param bool $hide + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show border ? + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = (bool)!$show; + } + + /** + * Is the border visible ? + * + * @return bool + */ + public function visible() { + return !$this->hide; + } + + /** + * Draw border as a rectangle + * + * @param awDriver $driver + * @param awPoint $p1 Top-left corner + * @param awPoint $p2 Bottom-right corner + */ + public function rectangle(awDriver $driver, awPoint $p1, awPoint $p2) { + + // Border is hidden + if($this->hide) { + return; + } + + $line = new awLine; + $line->setStyle($this->style); + $line->setLocation($p1, $p2); + + $driver->rectangle($this->color, $line); + + } + + /** + * Draw border as an ellipse + * + * @param awDriver $driver + * @param awPoint $center Ellipse center + * @param int $width Ellipse width + * @param int $height Ellipse height + */ + public function ellipse(awDriver $driver, awPoint $center, $width, $height) { + + // Border is hidden + if($this->hide) { + return; + } + + switch($this->style) { + + case awLine::SOLID : + $driver->ellipse($this->color, $center, $width, $height); + break; + + default : + awImage::drawError("Class Border: Dashed and dotted borders and not yet implemented on ellipses."); + break; + + } + + + } + + /** + * Draw border as a polygon + * + * @param awDriver $driver A Driver object + * @param awPolygon $polygon A Polygon object + */ + public function polygon(awDriver $driver, awPolygon $polygon) { + + // Border is hidden + if($this->hide) { + return; + } + + $polygon->setStyle($this->style); + $driver->polygon($this->color, $polygon); + + // In case of Line::SOLID, Driver::polygon() uses imagepolygon() + // which automatically closes the shape. In any other case, + // we have to do it manually here. + if($this->style !== Line::SOLID) { + $this->closePolygon($driver, $polygon); + } + } + + /** + * Draws the last line of a Polygon, between the first and last point + * + * @param awDriver $driver A Driver object + * @param awPolygon $polygon The polygon object to close + */ + private function closePolygon(awDriver $driver, awPolygon $polygon) { + $first = $polygon->get(0); + $last = $polygon->get($polygon->count() - 1); + + $line = new awLine($first, $last, $this->style, $polygon->getThickness()); + $driver->line($this->color, $line); + } + +} + +registerClass('Border'); diff --git a/modules/graphartichow/artichow/inc/Color.class.php b/modules/graphartichow/artichow/inc/Color.class.php new file mode 100644 index 000000000..40a7a93fb --- /dev/null +++ b/modules/graphartichow/artichow/inc/Color.class.php @@ -0,0 +1,165 @@ +red = (int)$red; + $this->green = (int)$green; + $this->blue = (int)$blue; + $this->alpha = (int)round($alpha * 127 / 100); + + } + + /** + * Get RGB and alpha values of your color + * + * @return array + */ + public function getColor() { + return $this->rgba(); + } + + /** + * Change color brightness + * + * @param int $brightness Add this intensity to the color (betweeen -255 and +255) + */ + public function brightness($brightness) { + + $brightness = (int)$brightness; + + $this->red = min(255, max(0, $this->red + $brightness)); + $this->green = min(255, max(0, $this->green + $brightness)); + $this->blue = min(255, max(0, $this->blue + $brightness)); + + } + + /** + * Get RGB and alpha values of your color + * + * @return array + */ + public function rgba() { + + return array($this->red, $this->green, $this->blue, $this->alpha); + + } + +} + +registerClass('Color'); + +$colors = array( + 'Black' => array(0, 0, 0), + 'AlmostBlack' => array(48, 48, 48), + 'VeryDarkGray' => array(88, 88, 88), + 'DarkGray' => array(128, 128, 128), + 'MidGray' => array(160, 160, 160), + 'LightGray' => array(195, 195, 195), + 'VeryLightGray' => array(220, 220, 220), + 'White' => array(255, 255, 255), + 'VeryDarkRed' => array(64, 0, 0), + 'DarkRed' => array(128, 0, 0), + 'MidRed' => array(192, 0, 0), + 'Red' => array(255, 0, 0), + 'LightRed' => array(255, 192, 192), + 'VeryDarkGreen' => array(0, 64, 0), + 'DarkGreen' => array(0, 128, 0), + 'MidGreen' => array(0, 192, 0), + 'Green' => array(0, 255, 0), + 'LightGreen' => array(192, 255, 192), + 'VeryDarkBlue' => array(0, 0, 64), + 'DarkBlue' => array(0, 0, 128), + 'MidBlue' => array(0, 0, 192), + 'Blue' => array(0, 0, 255), + 'LightBlue' => array(192, 192, 255), + 'VeryDarkYellow' => array(64, 64, 0), + 'DarkYellow' => array(128, 128, 0), + 'MidYellow' => array(192, 192, 0), + 'Yellow' => array(255, 255, 2), + 'LightYellow' => array(255, 255, 192), + 'VeryDarkCyan' => array(0, 64, 64), + 'DarkCyan' => array(0, 128, 128), + 'MidCyan' => array(0, 192, 192), + 'Cyan' => array(0, 255, 255), + 'LightCyan' => array(192, 255, 255), + 'VeryDarkMagenta' => array(64, 0, 64), + 'DarkMagenta' => array(128, 0, 128), + 'MidMagenta' => array(192, 0, 192), + 'Magenta' => array(255, 0, 255), + 'LightMagenta' => array(255, 192, 255), + 'DarkOrange' => array(192, 88, 0), + 'Orange' => array(255, 128, 0), + 'LightOrange' => array(255, 168, 88), + 'VeryLightOrange' => array(255, 220, 168), + 'DarkPink' => array(192, 0, 88), + 'Pink' => array(255, 0, 128), + 'LightPink' => array(255, 88, 168), + 'VeryLightPink' => array(255, 168, 220), + 'DarkPurple' => array(88, 0, 192), + 'Purple' => array(128, 0, 255), + 'LightPurple' => array(168, 88, 255), + 'VeryLightPurple' => array(220, 168, 255), +); + + + +$php = ''; + +foreach($colors as $name => $color) { + + list($red, $green, $blue) = $color; + + $php .= ' + class aw'.$name.' extends awColor { + + public function __construct($alpha = 0) { + parent::__construct('.$red.', '.$green.', '.$blue.', $alpha); + } + + } + '; + + if(ARTICHOW_PREFIX !== 'aw') { + $php .= ' + class '.ARTICHOW_PREFIX.$name.' extends aw'.$name.' { + + } + '; + } + +} + +eval($php); + + + + diff --git a/modules/graphartichow/artichow/inc/Driver.class.php b/modules/graphartichow/artichow/inc/Driver.class.php new file mode 100644 index 000000000..345b01698 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Driver.class.php @@ -0,0 +1,724 @@ +phpFontDriver = new awPHPFontDriver(); + $this->fileFontDriver = new awFileFontDriver(); + } + + /** + * Initialize the driver for a particular awImage object + * + * @param awImage $image + */ + abstract public function init(awImage $image); + + /** + * Initialize the Driver for a particular FileImage object + * + * @param awFileImage $fileImage The FileImage object to work on + * @param string $file Image filename + */ + abstract public function initFromFile(awFileImage $fileImage, $file); + + /** + * Change the image size + * + * @param int $width Image width + * @param int $height Image height + */ + abstract public function setImageSize($width, $height); + + /** + * Inform the driver of the position of your image + * + * @param float $x Position on X axis of the center of the component + * @param float $y Position on Y axis of the center of the component + */ + abstract public function setPosition($x, $y); + + /** + * Inform the driver of the position of your image + * This method need absolutes values + * + * @param int $x Left-top corner X position + * @param int $y Left-top corner Y position + */ + abstract public function setAbsPosition($x, $y); + + /** + * Move the position of the image + * + * @param int $x Add this value to X axis + * @param int $y Add this value to Y axis + */ + abstract public function movePosition($x, $y); + + /** + * Inform the driver of the size of your image + * Height and width must be between 0 and 1. + * + * @param int $w Image width + * @param int $h Image height + * @return array Absolute width and height of the image + */ + abstract public function setSize($w, $h); + + /** + * Inform the driver of the size of your image + * You can set absolute size with this method. + * + * @param int $w Image width + * @param int $h Image height + */ + abstract public function setAbsSize($w, $h); + + /** + * Get the size of the component handled by the driver + * + * @return array Absolute width and height of the component + */ + abstract public function getSize(); + + /** + * Turn antialiasing on or off + * + * @var bool $bool + */ + abstract public function setAntiAliasing($bool); + + /** + * When passed a Color object, returns the corresponding + * color identifier (driver dependant). + * + * @param awColor $color A Color object + * @return int $rgb A color identifier representing the color composed of the given RGB components + */ + abstract public function getColor(awColor $color); + + /** + * Draw an image here + * + * @param awImage $image Image + * @param int $p1 Image top-left point + * @param int $p2 Image bottom-right point + */ + abstract public function copyImage(awImage $image, awPoint $p1, awPoint $p2); + + /** + * Draw an image here + * + * @param awImage $image Image + * @param int $d1 Destination top-left position + * @param int $d2 Destination bottom-right position + * @param int $s1 Source top-left position + * @param int $s2 Source bottom-right position + * @param bool $resample Resample image ? (default to TRUE) + */ + abstract public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE); + + /** + * Draw a string + * + * @var awText $text Text to print + * @param awPoint $point Draw the text at this point + * @param int $width Text max width + */ + abstract public function string(awText $text, awPoint $point, $width = NULL); + + /** + * Draw a pixel + * + * @param awColor $color Pixel color + * @param awPoint $p + */ + abstract public function point(awColor $color, awPoint $p); + + /** + * Draw a colored line + * + * @param awColor $color Line color + * @param awLine $line + * @param int $thickness Line tickness + */ + abstract public function line(awColor $color, awLine $line); + + /** + * Draw a color arc + + * @param awColor $color Arc color + * @param awPoint $center Point center + * @param int $width Ellipse width + * @param int $height Ellipse height + * @param int $from Start angle + * @param int $to End angle + */ + abstract public function arc(awColor $color, awPoint $center, $width, $height, $from, $to); + + /** + * Draw an arc with a background color + * + * @param awColor $color Arc background color + * @param awPoint $center Point center + * @param int $width Ellipse width + * @param int $height Ellipse height + * @param int $from Start angle + * @param int $to End angle + */ + abstract public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to); + + /** + * Draw a colored ellipse + * + * @param awColor $color Ellipse color + * @param awPoint $center Ellipse center + * @param int $width Ellipse width + * @param int $height Ellipse height + */ + abstract public function ellipse(awColor $color, awPoint $center, $width, $height); + + /** + * Draw an ellipse with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param awPoint $center Ellipse center + * @param int $width Ellipse width + * @param int $height Ellipse height + */ + abstract public function filledEllipse($background, awPoint $center, $width, $height); + + /** + * Draw a colored rectangle + * + * @param awColor $color Rectangle color + * @param awLine $line Rectangle diagonale + * @param awPoint $p2 + */ + abstract public function rectangle(awColor $color, awLine $line); + + /** + * Draw a rectangle with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param awLine $line Rectangle diagonale + */ + abstract public function filledRectangle($background, awLine $line); + + /** + * Draw a polygon + * + * @param awColor $color Polygon color + * @param Polygon A polygon + */ + abstract public function polygon(awColor $color, awPolygon $polygon); + + /** + * Draw a polygon with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param Polygon A polygon + */ + abstract public function filledPolygon($background, awPolygon $polygon); + + /** + * Sends the image, as well as the correct HTTP headers, to the browser + * + * @param awImage $image The Image object to send + */ + abstract public function send(awImage $image); + + /** + * Get the image as binary data + * + * @param awImage $image + */ + abstract public function get(awImage $image); + + /** + * Return the width of some text + * + * @param awText $text + */ + abstract public function getTextWidth(awText $text); + + /** + * Return the height of some text + * + * @param awText $text + */ + abstract public function getTextHeight(awText $text); + + /** + * Return the string representing the type of driver + * + * @return string + */ + public function getDriverString() { + return $this->driverString; + } + + /** + * Returns whether or not the driver is compatible with the given font type + * + * @param awFont $font + * @return bool + */ + abstract protected function isCompatibleWithFont(awFont $font); + +// abstract private function drawImage(awImage $image, $return = FALSE, $header = TRUE); + +} + +registerClass('Driver', TRUE); + +/** + * Abstract class for font drivers. + * Those are used to do all the grunt work on fonts. + * + * @package Artichow + */ + +abstract class awFontDriver { + + public function __construct() { + + } + + /** + * Draw the actual text. + * + * @param awDriver $driver The Driver object to draw upon + * @param awText $text The Text object + * @param awPoint $point Where to draw the text + * @param float $width The width of the area containing the text + */ + abstract public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL); + + /** + * Calculate the width of a given Text. + * + * @param awText $text The Text object + * @param awDriver $driver The awDriver object used to draw the graph + */ + abstract public function getTextWidth(awText $text, awDriver $driver); + + /** + * Calculate the height of a given Text. + * + * @param awText $text The Text object + * @param awDriver $driver The awDriver object used to draw the graph + */ + abstract public function getTextHeight(awText $text, awDriver $driver); + +} + +registerClass('FontDriver', TRUE); + +/** + * Class to handle calculations on PHPFont objects + * + * @package Artichow + */ +class awPHPFontDriver extends awFontDriver { + + public function __construct() { + parent::__construct(); + } + + public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL) { + + switch ($driver->getDriverString()) { + case 'gd': + $this->gdString($driver, $text, $point, $width); + break; + + default: + awImage::drawError('Class PHPFontDriver: Incompatibility between driver and font - You should never see this error message: have you called awDriver::isCompatibleWithFont() properly?'); + break; + + } + } + + /** + * Draw a string onto a GDDriver object + * + * @param awGDDriver $driver The GDDriver to draw the text upon + * @param awText $text The awText object containing the string to draw + * @param awPoint $point Where to draw the text + * @param float $width The width of the text + */ + private function gdString(awGDDriver $driver, awText $text, awPoint $point, $width = NULL) { + + $angle = $text->getAngle(); + if($angle !== 90 and $angle !== 0) { + awImage::drawError("Class PHPFontDriver: You can only use 0° and 90° angles."); + } + + if($angle === 90) { + $function = 'imagestringup'; + $addAngle = $this->getGDTextHeight($text); + } else { + $function = 'imagestring'; + $addAngle = 0; + } + + $color = $text->getColor(); + $rgb = $driver->getColor($color); + + $textString = $text->getText(); + $textString = str_replace("\r", "", $textString); + + $textHeight = $this->getGDTextHeight($text); + + // Split text if needed + if($width !== NULL) { + + $characters = floor($width / ($this->getGDTextWidth($text) / strlen($textString))); + + if($characters > 0) { + $textString = wordwrap($textString, $characters, "\n", TRUE); + } + + } + + $font = $text->getFont(); + $lines = explode("\n", $textString); + + foreach($lines as $i => $line) { + + // Line position handling + if($angle === 90) { + $addX = $i * $textHeight; + $addY = 0; + } else { + $addX = 0; + $addY = $i * $textHeight; + } + + $function( + $driver->resource, + $font->font, + $driver->x + $point->x + $addX, + $driver->y + $point->y + $addY + $addAngle, + $line, + $rgb + ); + + } + } + + public function getTextWidth(awText $text, awDriver $driver) { + + switch ($driver->getDriverString()) { + case 'gd': + return $this->getGDTextWidth($text); + + default: + awImage::drawError('Class PHPFontDriver: Cannot get text width - incompatibility between driver and font'); + break; + } + + } + + public function getTextHeight(awText $text, awDriver $driver) { + + switch ($driver->getDriverString()) { + case 'gd': + return $this->getGDTextHeight($text); + + default: + awImage::drawError('Class PHPFontDriver: Cannot get text height - incompatibility between driver and font'); + break; + } + + } + + /** + * Return the width of a text for a GDDriver + * + * @param awText $text + * @return int $fontWidth + */ + private function getGDTextWidth(awText $text) { + $font = $text->getFont(); + + if($text->getAngle() === 90) { + $text->setAngle(45); + return $this->getGDTextHeight($text); + } else if($text->getAngle() === 45) { + $text->setAngle(90); + } + + $fontWidth = imagefontwidth($font->font); + + if($fontWidth === FALSE) { + awImage::drawError("Class PHPFontDriver: Unable to get font size."); + } + + return (int)$fontWidth * strlen($text->getText()); + } + + /** + * Return the height of a text for a GDDriver + * + * @param awText $text + * @return int $fontHeight + */ + private function getGDTextHeight(awText $text) { + $font = $text->getFont(); + + if($text->getAngle() === 90) { + $text->setAngle(45); + return $this->getGDTextWidth($text); + } else if($text->getAngle() === 45) { + $text->setAngle(90); + } + + $fontHeight = imagefontheight($font->font); + + if($fontHeight === FALSE) { + awImage::drawError("Class PHPFontDriver: Unable to get font size."); + } + + return (int)$fontHeight; + } +} + +registerClass('PHPFontDriver'); + +/** + * Class to handle calculations on FileFont objects + * + * @package Artichow + */ +class awFileFontDriver extends awFontDriver { + + public function __construct() { + parent::__construct(); + } + + public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL) { + + switch ($driver->getDriverString()) { + case 'gd': + $this->gdString($driver, $text, $point, $width); + break; + + default: + awImage::drawError('Class fileFontDriver: Incompatibility between driver and font - You should never see this error message: have you called awDriver::isCompatibleWithFont() properly?'); + break; + } + } + + /** + * Draw an awFileFont object on a GD ressource + * + * @param awGDDriver $driver The awGDDriver object containing the ressource to draw upon + * @param awText $text The awText object containing the string to draw + * @param awPoint $point Where to draw the string from + * @param float $width The width of the area containing the text + */ + private function gdString(awGDDriver $driver, awText $text, awPoint $point, $width = NULL) { + // Make easier font positionment + $text->setText($text->getText()." "); + + $font = $text->getFont(); + if($font instanceof awTTFFont === FALSE and $font->getExtension() === NULL) { + $font->setExtension('ttf'); + } + + $filePath = $font->getName().'.'.$font->getExtension(); + + $box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText()); + $textHeight = - $box[5]; + + $box = imagettfbbox($font->getSize(), 90, $filePath, $text->getText()); + $textWidth = abs($box[6] - $box[2]); + + // Restore old text + $text->setText(substr($text->getText(), 0, strlen($text->getText()) - 1)); + + $textString = $text->getText(); + + // Split text if needed + if($width !== NULL) { + + $characters = floor($width / $this->getGDAverageWidth($font)); + $textString = wordwrap($textString, $characters, "\n", TRUE); + + } + + $color = $text->getColor(); + $rgb = $driver->getColor($color); + + imagettftext( + $driver->resource, + $font->getSize(), + $text->getAngle(), + $driver->x + $point->x + $textWidth * sin($text->getAngle() / 180 * M_PI), + $driver->y + $point->y + $textHeight, + $rgb, + $filePath, + $textString + ); + } + + public function getTextWidth(awText $text, awDriver $driver) { + switch ($driver->getDriverString()) { + case 'gd': + return $this->getGDTextWidth($text); + + default: + awImage::drawError('Class FileFontDriver: Cannot get text width - incompatibility between driver and font'); + break; + } + } + + public function getTextHeight(awText $text, awDriver $driver) { + switch ($driver->getDriverString()) { + case 'gd': + return $this->getGDTextHeight($text); + + default: + awImage::drawError('Class FileFontDriver: Cannot get text height - incompatibility between driver and font'); + break; + } + } + + private function getGDTextWidth(awText $text) { + $font = $text->getFont(); + if($font->getExtension() === NULL) { + $font->setExtension('ttf'); + } + + $filePath = $font->getName().'.'.$font->getExtension(); + + $box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText()); + + if($box === FALSE) { + awImage::drawError("Class FileFontDriver: Unable to get font width (GD)."); + } + + list(, , $x2, , , , $x1, ) = $box; + + return abs($x2 - $x1); + } + + private function getGDTextHeight(awText $text) { + $font = $text->getFont(); + if($font->getExtension() === NULL) { + $font->setExtension('ttf'); + } + + $filePath = $font->getName().'.'.$font->getExtension(); + + $box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText()); + + if($box === FALSE) { + awImage::drawError("Class FileFontDriver: Unable to get font height (GD)."); + } + + list(, , , $y2, , , , $y1) = $box; + + return abs($y2 - $y1); + } + + private function getGDAverageWidth(awFileFont $font) { + + $text = "azertyuiopqsdfghjklmmmmmmmwxcvbbbn,;:!?."; + + $box = imagettfbbox($font->getSize(), 0, $font->getName().'.'.$font->getExtension(), $text); + + if($box === FALSE) { + awImage::drawError("Class FileFontDriver: Unable to get font average width."); + } + + list(, , $x2, $y2, , , $x1, $y1) = $box; + + return abs($x2 - $x1) / strlen($text); + + } + +} + +registerClass('FileFontDriver'); + +// Include ARTICHOW_DRIVER by default to preserve backward compatibility. +require_once dirname(__FILE__).'/drivers/'.ARTICHOW_DRIVER.'.class.php'; + diff --git a/modules/graphartichow/artichow/inc/Font.class.php b/modules/graphartichow/artichow/inc/Font.class.php new file mode 100644 index 000000000..79267bde4 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Font.class.php @@ -0,0 +1,262 @@ +string($this, $text, $point, $width); + + } + +} + +registerClass('Font', TRUE); + +/** + * Class for fonts that cannot be transformed, + * like the built-in PHP fonts for example. + * + * @package Artichow + */ +class awPHPFont extends awFont { + + /** + * The used font identifier + * + * @var int + */ + public $font; + + public function __construct($font = NULL) { + parent::__construct(); + + if($font !== NULL) { + $this->font = (int)$font; + } + } + +} + +registerClass('PHPFont'); + +/** + * Class for fonts that can be transformed (rotated, skewed, etc.), + * like TTF or FDB fonts for example. + * + * @package Artichow + */ +class awFileFont extends awFont { + + /** + * The name of the font, without the extension + * + * @var string + */ + protected $name; + + /** + * The size of the font + * + * @var int + */ + protected $size; + + /** + * The font filename extension + * + * @var string + */ + protected $extension; + + public function __construct($name, $size) { + parent::__construct(); + + $this->setName($name); + $this->setSize($size); + } + + /** + * Set the name of the font. The $name variable can contain the full path, + * or just the filename. Artichow will try to do The Right Thing, + * as well as set the extension property correctly if possible. + * + * @param string $name + */ + public function setName($name) { + $fontInfo = pathinfo((string)$name); + + if(strpos($fontInfo['dirname'], '/') !== 0) { + // Path is not absolute, use ARTICHOW_FONT + $name = ARTICHOW_FONT.DIRECTORY_SEPARATOR.$fontInfo['basename']; + $fontInfo = pathinfo($name); + } + + $this->name = $fontInfo['dirname'].DIRECTORY_SEPARATOR.$fontInfo['basename']; + + if(array_key_exists('extension', $fontInfo) and $fontInfo['extension'] !== '') { + $this->setExtension($fontInfo['extension']); + } + } + + /** + * Return the name of the font, i.e. the absolute path and the filename, without the extension. + * + * @return string + */ + public function getName() { + return $this->name; + } + + /** + * Set the size of the font, in pixels + * + * @param int $size + */ + public function setSize($size) { + $this->size = (int)$size; + } + + /** + * Return the size of the font, in pixels + * + * @return int + */ + public function getSize() { + return $this->size; + } + + /** + * Set the extension, without the dot + * + * @param string $extension + */ + public function setExtension($extension) { + $this->extension = (string)$extension; + } + + /** + * Get the filename extension for that font + * + * @return string + */ + public function getExtension() { + return $this->extension; + } + +} + +registerClass('FileFont'); + +/** + * Class representing TTF fonts + * + * @package Artichow + */ +class awTTFFont extends awFileFont { + + public function __construct($name, $size) { + parent::__construct($name, $size); + + if($this->getExtension() === NULL) { + $this->setExtension('ttf'); + } + } + +} + +registerClass('TTFFont'); + + + +$php = ''; + +for($i = 1; $i <= 5; $i++) { + + $php .= ' + class awFont'.$i.' extends awPHPFont { + + public function __construct() { + parent::__construct('.$i.'); + } + + } + '; + + if(ARTICHOW_PREFIX !== 'aw') { + $php .= ' + class '.ARTICHOW_PREFIX.'Font'.$i.' extends awFont'.$i.' { + } + '; + } + +} + +eval($php); + +$php = ''; + +foreach($fonts as $font) { + + $php .= ' + class aw'.$font.' extends awFileFont { + + public function __construct($size) { + parent::__construct(\''.$font.'\', $size); + } + + } + '; + + if(ARTICHOW_PREFIX !== 'aw') { + $php .= ' + class '.ARTICHOW_PREFIX.$font.' extends aw'.$font.' { + } + '; + } + +} + +eval($php); + + + +/* + * Environment modification for GD2 and TTF fonts + */ +if(function_exists('putenv')) { + putenv('GDFONTPATH='.ARTICHOW_FONT); +} + diff --git a/modules/graphartichow/artichow/inc/Gradient.class.php b/modules/graphartichow/artichow/inc/Gradient.class.php new file mode 100644 index 000000000..d9d95ed1d --- /dev/null +++ b/modules/graphartichow/artichow/inc/Gradient.class.php @@ -0,0 +1,135 @@ +from = $from; + $this->to = $to; + + } + +} + +registerClass('Gradient', TRUE); + + +/** + * Create a linear gradient + * + * @package Artichow + */ +class awLinearGradient extends awGradient { + + /** + * Gradient angle + * + * @var int + */ + public $angle; + + /** + * Build the linear gradient + * + * @param awColor $from From color + * @param awColor $to To color + * @param int $angle Gradient angle + */ + public function __construct($from, $to, $angle) { + + parent::__construct( + $from, $to + ); + + $this->angle = (int)$angle; + + } + +} + +registerClass('LinearGradient'); + + +/** + * Create a bilinear gradient + * + * @package Artichow + */ +class awBilinearGradient extends awLinearGradient { + + /** + * Gradient center + * + * @var float Center between 0 and 1 + */ + public $center; + + /** + * Build the bilinear gradient + * + * @param awColor $from From color + * @param awColor $to To color + * @param int $angle Gradient angle + * @param int $center Gradient center + */ + public function __construct($from, $to, $angle, $center = 0.5) { + + parent::__construct( + $from, $to, $angle + ); + + $this->center = (float)$center; + + } + +} + +registerClass('BilinearGradient'); + +/** + * Create a radial gradient + * + * @package Artichow + */ +class awRadialGradient extends awGradient { + +} + +registerClass('RadialGradient'); + diff --git a/modules/graphartichow/artichow/inc/Grid.class.php b/modules/graphartichow/artichow/inc/Grid.class.php new file mode 100644 index 000000000..2b02a53ee --- /dev/null +++ b/modules/graphartichow/artichow/inc/Grid.class.php @@ -0,0 +1,290 @@ +color = new awColor(210, 210, 210); + $this->background = new awColor(255, 255, 255, 100); + + } + + /** + * Hide grid ? + * + * @param bool $hide + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Hide horizontal lines ? + * + * @param bool $hideHorizontal + */ + public function hideHorizontal($hide = TRUE) { + $this->hideHorizontal = (bool)$hide; + } + + /** + * Hide vertical lines ? + * + * @param bool $hideVertical + */ + public function hideVertical($hide = TRUE) { + $this->hideVertical = (bool)$hide; + } + + /** + * Change grid color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Remove grid background + */ + public function setNoBackground() { + $this->background = NULL; + } + + /** + * Change grid background color + * + * @param awColor $color + */ + public function setBackgroundColor(awColor $color) { + $this->background = $color; + } + + /** + * Change line type + * + * @param int $type + */ + public function setType($type) { + $this->type = (int)$type; + } + + /** + * Change grid interval + * + * @param int $hInterval + * @param int $vInterval + */ + public function setInterval($hInterval, $vInterval) { + $this->interval = array((int)$hInterval, (int)$vInterval); + } + + /** + * Set grid space + * + * @param int $left Left space in pixels + * @param int $right Right space in pixels + * @param int $top Top space in pixels + * @param int $bottom Bottom space in pixels + */ + public function setSpace($left, $right, $top, $bottom) { + $this->space = array((int)$left, (int)$right, (int)$top, (int)$bottom); + } + + /** + * Change the current grid + * + * @param array $xgrid Vertical lines + * @param array $ygrid Horizontal lines + */ + public function setGrid($xgrid, $ygrid) { + + if(empty($this->xgrid)) { + $this->xgrid = $xgrid; + } + if(empty($this->ygrid)) { + $this->ygrid = $ygrid; + } + + } + + /** + * Draw grids + * + * @param awDriver $driver A driver object + * @param int $x1 + * @param int $y1 + * @param int $x2 + * @param int $y2 + */ + public function draw(awDriver $driver, $x1, $y1, $x2, $y2) { + + if($this->background instanceof awColor) { + + // Draw background color + $driver->filledRectangle( + $this->background, + awLine::build($x1, $y1, $x2, $y2) + ); + + } + + if($this->hide === FALSE) { + + $this->drawGrid( + $driver, + $this->color, + $this->hideVertical ? array() : $this->xgrid, + $this->hideHorizontal ? array() : $this->ygrid, + $x1, $y1, $x2, $y2, + $this->type, + $this->space, + $this->interval[0], + $this->interval[1] + ); + + } + + } + + private function drawGrid( + awDriver $driver, awColor $color, + $nx, $ny, $x1, $y1, $x2, $y2, + $type, $space, $hInterval, $vInterval + ) { + + list($left, $right, $top, $bottom) = $space; + + $width = $x2 - $x1 - $left - $right; + $height = $y2 - $y1 - $top - $bottom; + + foreach($nx as $key => $n) { + + if(($key % $vInterval) === 0) { + + $pos = (int)round($x1 + $left + $n * $width); + $driver->line( + $color, + new awLine( + new awPoint($pos, $y1), + new awPoint($pos, $y2), + $type + ) + ); + + } + + } + + foreach($ny as $key => $n) { + + if(($key % $hInterval) === 0) { + + $pos = (int)round($y1 + $top + $n * $height); + $driver->line( + $color, + new awLine( + new awPoint($x1, $pos), + new awPoint($x2, $pos), + $type + ) + ); + + } + + } + + } + +} + +registerClass('Grid'); diff --git a/modules/graphartichow/artichow/inc/Label.class.php b/modules/graphartichow/artichow/inc/Label.class.php new file mode 100644 index 000000000..43bbae5af --- /dev/null +++ b/modules/graphartichow/artichow/inc/Label.class.php @@ -0,0 +1,587 @@ +set($label); + } else if(is_string($label)) { + $this->set(array($label)); + } + + if($font === NULL) { + $font = new awFont2; + } + + $this->setFont($font); + $this->setAngle($angle); + + if($color instanceof awColor) { + $this->setColor($color); + } else { + $this->setColor(new awColor(0, 0, 0)); + } + + $this->move = new awPoint(0, 0); + + $this->border = new awBorder; + $this->border->hide(); + + } + + /** + * Get an element of the label from its key + * + * @param int $key Element key + * @return string A value + */ + public function get($key) { + return array_key_exists($key, $this->texts) ? $this->texts[$key] : NULL; + } + + /** + * Get all labels + * + * @return array + */ + public function all() { + return $this->texts; + } + + /** + * Set one or several labels + * + * @param array $labels Array of string or a string + */ + public function set($labels) { + + if(is_array($labels)) { + $this->texts = $labels; + } else { + $this->texts = array((string)$labels); + } + + } + + /** + * Count number of texts in the label + * + * @return int + */ + public function count() { + return is_array($this->texts) ? count($this->texts) : 0; + } + + /** + * Set a callback function for labels + * + * @param string $function + */ + public function setCallbackFunction($function) { + $this->function = is_null($function) ? $function : (string)$function; + } + + /** + * Return the callback function for labels + * + * @return string + */ + public function getCallbackFunction() { + return $this->function; + } + + /** + * Change labels format + * + * @param string $format New format (printf style: %.2f for example) + */ + public function setFormat($format) { + $function = 'label'.time().'_'.(microtime() * 1000000); + eval('function '.$function.'($value) { + return sprintf("'.addcslashes($format, '"').'", $value); + }'); + $this->setCallbackFunction($function); + } + + /** + * Change font for label + * + * @param awFont $font New font + * @param awColor $color Font color (can be NULL) + */ + public function setFont(awFont $font, $color = NULL) { + $this->font = $font; + if($color instanceof awColor) { + $this->setColor($color); + } + } + + /** + * Change font angle + * + * @param int $angle New angle + */ + public function setAngle($angle) { + $this->angle = (int)$angle; + } + + /** + * Change font color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Change text background + * + * @param mixed $background + */ + public function setBackground($background) { + $this->background = $background; + } + + /** + * Change text background color + * + * @param Color + */ + public function setBackgroundColor(awColor $color) { + $this->background = $color; + } + + /** + * Change text background gradient + * + * @param Gradient + */ + public function setBackgroundGradient(awGradient $gradient) { + $this->background = $gradient; + } + + /** + * Change padding + * + * @param int $left Left padding + * @param int $right Right padding + * @param int $top Top padding + * @param int $bottom Bottom padding + */ + public function setPadding($left, $right, $top, $bottom) { + $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); + } + + /** + * Hide all labels ? + * + * @param bool $hide + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show all labels ? + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = (bool)!$show; + } + + /** + * Hide a key + * + * @param int $key The key to hide + */ + public function hideKey($key) { + $this->hideKey[$key] = TRUE; + } + + /** + * Hide a value + * + * @param int $value The value to hide + */ + public function hideValue($value) { + $this->hideValue[] = $value; + } + + /** + * Hide first label + * + * @param bool $hide + */ + public function hideFirst($hide) { + $this->hideFirst = (bool)$hide; + } + + /** + * Hide last label + * + * @param bool $hide + */ + public function hideLast($hide) { + $this->hideLast = (bool)$hide; + } + + /** + * Set label interval + * + * @param int + */ + public function setInterval($interval) { + + $this->interval = (int)$interval; + + } + + /** + * Change label position + * + * @param int $x Add this interval to X coord + * @param int $y Add this interval to Y coord + */ + public function move($x, $y) { + + $this->move = $this->move->move($x, $y); + + } + + /** + * Change alignment + * + * @param int $h Horizontal alignment + * @param int $v Vertical alignment + */ + public function setAlign($h = NULL, $v = NULL) { + if($h !== NULL) { + $this->hAlign = (int)$h; + } + if($v !== NULL) { + $this->vAlign = (int)$v; + } + } + + /** + * Get a text from the labele + * + * @param mixed $key Key in the array text + * @return Text + */ + public function getText($key) { + + if(is_array($this->texts) and array_key_exists($key, $this->texts)) { + + $value = $this->texts[$key]; + + if(is_string($this->function)) { + $value = call_user_func($this->function, $value); + } + + $text = new awText($value); + $text->setFont($this->font); + $text->setAngle($this->angle); + $text->setColor($this->color); + + if($this->background instanceof awColor) { + $text->setBackgroundColor($this->background); + } else if($this->background instanceof awGradient) { + $text->setBackgroundGradient($this->background); + } + + $text->border = $this->border; + + if($this->padding !== NULL) { + call_user_func_array(array($text, 'setPadding'), $this->padding); + } + + return $text; + + } else { + return NULL; + } + + } + + /** + * Get max width of all texts + * + * @param awDriver $driver A driver + * @return int + */ + public function getMaxWidth(awDriver $driver) { + + return $this->getMax($driver, 'getTextWidth'); + + } + + /** + * Get max height of all texts + * + * @param awDriver $driver A driver + * @return int + */ + public function getMaxHeight(awDriver $driver) { + + return $this->getMax($driver, 'getTextHeight'); + + } + + /** + * Draw the label + * + * @param awDriver $driver + * @param awPoint $p Label center + * @param int $key Text position in the array of texts (default to zero) + */ + public function draw(awDriver $driver, awPoint $p, $key = 0) { + + if(($key % $this->interval) !== 0) { + return; + } + + // Hide all labels + if($this->hide) { + return; + } + + // Key is hidden + if(array_key_exists($key, $this->hideKey)) { + return; + } + + // Hide first label + if($key === 0 and $this->hideFirst) { + return; + } + + // Hide last label + if($key === count($this->texts) - 1 and $this->hideLast) { + return; + } + + $text = $this->getText($key); + + if($text !== NULL) { + + // Value must be hidden + if(in_array($text->getText(), $this->hideValue)) { + return; + } + + $x = $p->x; + $y = $p->y; + + // Get padding + list($left, $right, $top, $bottom) = $text->getPadding(); + +// $font = $text->getFont(); + $width = $driver->getTextWidth($text); + $height = $driver->getTextHeight($text); + + switch($this->hAlign) { + + case awLabel::RIGHT : + $x -= ($width + $right); + break; + + case awLabel::CENTER : + $x -= ($width - $left + $right) / 2; + break; + + case awLabel::LEFT : + $x += $left; + break; + + } + + switch($this->vAlign) { + + case awLabel::TOP : + $y -= ($height + $bottom); + break; + + case awLabel::MIDDLE : + $y -= ($height - $top + $bottom) / 2; + break; + + case awLabel::BOTTOM : + $y += $top; + break; + + } + + $driver->string($text, $this->move->move($x, $y)); + + } + + } + + protected function getMax(awDriver $driver, $function) { + + $max = NULL; + + foreach($this->texts as $key => $text) { + + $text = $this->getText($key); + $font = $text->getFont(); + + if(is_null($max)) { + $max = $font->{$function}($text); + } else { + $max = max($max, $font->{$function}($text)); + } + + } + + return $max; + + } + +} + +registerClass('Label'); diff --git a/modules/graphartichow/artichow/inc/Legend.class.php b/modules/graphartichow/artichow/inc/Legend.class.php new file mode 100644 index 000000000..bbfd64a03 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Legend.class.php @@ -0,0 +1,709 @@ +shadow = new awShadow(awShadow::LEFT_BOTTOM); + $this->border = new awBorder; + + $this->textMargin = new awSide(4); + $this->setModel($model); + + } + + /** + * Set a predefined model for the legend + * + * @param int $model + */ + public function setModel($model) { + + $this->setBackgroundColor(new awColor(255, 255, 255, 15)); + $this->setPadding(8, 8, 8, 8); + $this->setTextFont(new awFont2); + $this->shadow->setSize(3); + + switch($model) { + + case awLegend::MODEL_RIGHT : + + $this->setColumns(1); + $this->setAlign(awLegend::RIGHT, awLegend::MIDDLE); + $this->setPosition(0.96, 0.50); + + break; + + case awLegend::MODEL_BOTTOM : + + $this->setRows(1); + $this->setAlign(awLegend::CENTER, awLegend::TOP); + $this->setPosition(0.50, 0.92); + + break; + + default : + + $this->setPosition(0.5, 0.5); + + break; + + } + + } + + /** + * Hide legend ? + * + * @param bool $hide TRUE to hide legend, FALSE otherwise + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show legend ? + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = (bool)!$show; + } + + + /** + * Add a Legendable object to the legend + * + * @param awLegendable $legendable + * @param string $title Legend title + * @param int $type Legend type (default to awLegend::LINE) + */ + public function add(awLegendable $legendable, $title, $type = awLegend::LINE) { + + $legend = array($legendable, $title, $type); + + $this->legends[] = $legend; + + } + + /** + * Change legend padding + * + * @param int $left + * @param int $right + * @param int $top + * @param int $bottom + */ + public function setPadding($left, $right, $top, $bottom) { + $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); + } + + /** + * Change space between each legend + * + * @param int $space + */ + public function setSpace($space) { + $this->space = (int)$space; + } + + /** + * Change alignment + * + * @param int $h Horizontal alignment + * @param int $v Vertical alignment + */ + public function setAlign($h = NULL, $v = NULL) { + if($h !== NULL) { + $this->hAlign = (int)$h; + } + if($v !== NULL) { + $this->vAlign = (int)$v; + } + } + + /** + * Change number of columns + * + * @param int $columns + */ + public function setColumns($columns) { + $this->rows = NULL; + $this->columns = (int)$columns; + } + + /** + * Change number of rows + * + * @param int $rows + */ + public function setRows($rows) { + $this->columns = NULL; + $this->rows = (int)$rows; + } + + /** + * Change legend position + * X and Y positions must be between 0 and 1. + * + * @param float $x + * @param float $y + */ + public function setPosition($x = NULL, $y = NULL) { + $x = (is_null($x) and !is_null($this->position)) ? $this->position->x : $x; + $y = (is_null($y) and !is_null($this->position)) ? $this->position->y : $y; + + $this->position = new awPoint($x, $y); + } + + /** + * Get legend position + * + * @return Point + */ + public function getPosition() { + return $this->position; + } + + /** + * Change text font + * + * @param awFont $font + */ + public function setTextFont(awFont $font) { + $this->textFont = $font; + } + + /** + * Change text margin + * + * @param int $left + * @param int $right + */ + public function setTextMargin($left, $right) { + $this->textMargin->set($left, $right); + } + + /** + * Change text color + * + * @param awColor $color + */ + public function setTextColor(awColor $color) { + $this->textColor = $color; + } + + /** + * Change background + * + * @param mixed $background + */ + public function setBackground($background) { + $this->background = $background; + } + + /** + * Change background color + * + * @param awColor $color + */ + public function setBackgroundColor(awColor $color) { + $this->background = $color; + } + + /** + * Change background gradient + * + * @param awGradient $gradient + */ + public function setBackgroundGradient(awGradient $gradient) { + $this->background = $gradient; + } + + /** + * Count the number of Legendable objects in the legend + * + * @return int + */ + public function count() { + return count($this->legends); + } + + public function draw(awDriver $driver) { + + if($this->hide) { + return; + } + + $count = $this->count(); + + // No legend to print + if($count === 0) { + return; + } + + // Get text widths and heights of each element of the legend + $widths = array(); + $heights = array(); + $texts = array(); + for($i = 0; $i < $count; $i++) { + list(, $title, ) = $this->legends[$i]; + $text = new awText( + $title, + $this->textFont, + $this->textColor, + 0 + ); +// $font = $text->getFont(); + $widths[$i] = $driver->getTextWidth($text) + $this->textMargin->left + $this->textMargin->right; + $heights[$i] = $driver->getTextHeight($text); + $texts[$i] = $text; + } + + // Maximum height of the font used + $heightMax = array_max($heights); + + // Get number of columns + if($this->columns !== NULL) { + $columns = $this->columns; + } else if($this->rows !== NULL) { + $columns = ceil($count / $this->rows); + } else { + $columns = $count; + } + + // Number of rows + $rows = (int)ceil($count / $columns); + + // Get maximum with of each column + $widthMax = array(); + for($i = 0; $i < $count; $i++) { + // Get column width + $column = $i % $columns; + if(array_key_exists($column, $widthMax) === FALSE) { + $widthMax[$column] = $widths[$i]; + } else { + $widthMax[$column] = max($widthMax[$column], $widths[$i]); + } + } + + $width = $this->padding[0] + $this->padding[1] - $this->space; + for($i = 0; $i < $columns; $i++) { + $width += $this->space + 5 + 10 + $widthMax[$i]; + } + + $height = ($heightMax + $this->space) * $rows - $this->space + $this->padding[2] + $this->padding[3]; + + // Look for legends position + list($x, $y) = $driver->getSize(); + + $p = new awPoint( + $this->position->x * $x, + $this->position->y * $y + ); + + switch($this->hAlign) { + + case awLegend::CENTER : + $p->x -= $width / 2; + break; + + case awLegend::RIGHT : + $p->x -= $width; + break; + + } + + switch($this->vAlign) { + + case awLegend::MIDDLE : + $p->y -= $height / 2; + break; + + case awLegend::BOTTOM : + $p->y -= $height; + break; + + } + + // Draw legend shadow + $this->shadow->draw( + $driver, + $p, + $p->move($width, $height), + awShadow::OUT + ); + + // Draw legends base + $this->drawBase($driver, $p, $width, $height); + + // Draw each legend + for($i = 0; $i < $count; $i++) { + + list($component, $title, $type) = $this->legends[$i]; + + $column = $i % $columns; + $row = (int)floor($i / $columns); + + // Get width of all previous columns + $previousColumns = 0; + for($j = 0; $j < $column; $j++) { + $previousColumns += $this->space + 10 + 5 + $widthMax[$j]; + } + + // Draw legend text + $driver->string( + $texts[$i], + $p->move( + $this->padding[0] + $previousColumns + 10 + 5 + $this->textMargin->left, + $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $heights[$i] / 2 + ) + ); + + // Draw legend icon + switch($type) { + + case awLegend::LINE : + case awLegend::MARK : + case awLegend::MARKONLY : + + // Get vertical position + $x = $this->padding[0] + $previousColumns; + $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $component->getLegendLineThickness(); + + // Draw two lines + if($component->getLegendLineColor() !== NULL) { + + $color = $component->getLegendLineColor(); + + if($color instanceof awColor and $type !== awLegend::MARKONLY) { + + $driver->line( + $color, + new awLine( + $p->move( + $x, // YaPB ?? + $y + $component->getLegendLineThickness() / 2 + ), + $p->move( + $x + 10, + $y + $component->getLegendLineThickness() / 2 + ), + $component->getLegendLineStyle(), + $component->getLegendLineThickness() + ) + ); + + unset($color); + + } + + } + + if($type === awLegend::MARK or $type === awLegend::MARKONLY) { + + $mark = $component->getLegendMark(); + + if($mark !== NULL) { + $mark->draw( + $driver, + $p->move( + $x + 5.5, + $y + $component->getLegendLineThickness() / 2 + ) + ); + } + + unset($mark); + + } + + break; + + case awLegend::BACKGROUND : + + // Get vertical position + $x = $this->padding[0] + $previousColumns; + $y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - 5; + + $from = $p->move( + $x, + $y + ); + + $to = $p->move( + $x + 10, + $y + 10 + ); + + $background = $component->getLegendBackground(); + + if($background !== NULL) { + + $driver->filledRectangle( + $component->getLegendBackground(), + new awLine($from, $to) + ); + + // Draw rectangle border + $this->border->rectangle( + $driver, + $from->move(0, 0), + $to->move(0, 0) + ); + + } + + unset($background, $from, $to); + + break; + + } + + } + + } + + private function drawBase(awDriver $driver, awPoint $p, $width, $height) { + + $this->border->rectangle( + $driver, + $p, + $p->move($width, $height) + ); + + $size = $this->border->visible() ? 1 : 0; + + $driver->filledRectangle( + $this->background, + new awLine( + $p->move($size, $size), + $p->move($width - $size, $height - $size) + ) + ); + + } + +} + +registerClass('Legend'); + +/** + * You can add a legend to components which implements this interface + * + * @package Artichow + */ +interface awLegendable { + + /** + * Get the line type + * + * @return int + */ + public function getLegendLineStyle(); + + /** + * Get the line thickness + * + * @return int + */ + public function getLegendLineThickness(); + + /** + * Get the color of line + * + * @return Color + */ + public function getLegendLineColor(); + + /** + * Get the background color or gradient of an element of the component + * + * @return Color, Gradient + */ + public function getLegendBackground(); + + /** + * Get a Mark object + * + * @return Mark + */ + public function getLegendMark(); + +} + +registerInterface('Legendable'); diff --git a/modules/graphartichow/artichow/inc/Mark.class.php b/modules/graphartichow/artichow/inc/Mark.class.php new file mode 100644 index 000000000..d89437f24 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Mark.class.php @@ -0,0 +1,489 @@ +fill = new awColor(255, 0, 0, 0); + $this->border = new awBorder; + $this->border->hide(); + + $this->move = new awPoint(0, 0); + + } + + /** + * Change mark position + * + * @param int $x Add this interval to X coord + * @param int $y Add this interval to Y coord + */ + public function move($x, $y) { + + $this->move = $this->move->move($x, $y); + + } + + /** + * Hide marks ? + * + * @param bool $hide TRUE to hide marks, FALSE otherwise + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show marks ? + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = (bool)!$show; + } + + /** + * Change mark type + * + * @param int $size Size in pixels + */ + public function setSize($size) { + $this->size = (int)$size; + } + + /** + * Change mark type + * + * @param int $type New mark type + * @param int $size Mark size (can be NULL) + */ + public function setType($type, $size = NULL) { + $this->type = (int)$type; + if($size !== NULL) { + $this->setSize($size); + } + } + + /** + * Fill the mark with a color or a gradient + * + * @param mixed $fill A color or a gradient + */ + public function setFill($fill) { + if($fill instanceof awColor or $fill instanceof awGradient) { + $this->fill = $fill; + } + } + + /** + * Set an image + * Only for awMark::IMAGE type. + * + * @param Image An image + */ + public function setImage(awImage $image) { + $this->image = $image; + } + + /** + * Draw the mark + * + * @param awDriver $driver + * @param awPoint $point Mark center + */ + public function draw(awDriver $driver, awPoint $point) { + + // Hide marks ? + if($this->hide) { + return; + } + + // Check if we can print marks + if($this->type !== NULL) { + + $this->driver = $driver; + $realPoint = $this->move->move($point->x, $point->y); + + switch($this->type) { + + case awMark::CIRCLE : + $this->drawCircle($realPoint); + break; + + case awMark::SQUARE : + $this->drawSquare($realPoint); + break; + + case awMark::TRIANGLE : + $this->drawTriangle($realPoint); + break; + + case awMark::INVERTED_TRIANGLE : + $this->drawTriangle($realPoint, TRUE); + break; + + case awMark::RHOMBUS : + $this->drawRhombus($realPoint); + break; + + case awMark::CROSS : + $this->drawCross($realPoint); + break; + + case awMark::PLUS : + $this->drawCross($realPoint, TRUE); + break; + + case awMark::IMAGE : + $this->drawImage($realPoint); + break; + + case awMark::STAR : + $this->changeType('star'); + $this->draw($driver, $point); + break; + + case awMark::PAPERCLIP : + $this->changeType('paperclip'); + $this->draw($driver, $point); + break; + + case awMark::BOOK : + $this->changeType('book'); + $this->draw($driver, $point); + break; + + } + + } + + } + + protected function changeType($image) { + $this->setType(awMARK::IMAGE); + $this->setImage(new awFileImage(ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.$image.'.png')); + } + + protected function drawCircle(awPoint $point) { + + $this->driver->filledEllipse( + $this->fill, + $point, + $this->size, $this->size + ); + + $this->border->ellipse( + $this->driver, + $point, + $this->size, $this->size + ); + + } + + protected function drawSquare(awPoint $point) { + + list($x, $y) = $point->getLocation(); + + $x1 = (int)($x - $this->size / 2); + $x2 = $x1 + $this->size; + $y1 = (int)($y - $this->size / 2); + $y2 = $y1 + $this->size; + + $this->border->rectangle($this->driver, new awPoint($x1, $y1), new awPoint($x2, $y2)); + + $size = $this->border->visible() ? 1 : 0; + + $this->driver->filledRectangle( + $this->fill, + new awLine( + new awPoint($x1 + $size, $y1 + $size), + new awPoint($x2 - $size, $y2 - $size) + ) + ); + + } + + protected function drawTriangle(awPoint $point, $inverted = FALSE) { + + list($x, $y) = $point->getLocation(); + + $size = $this->size; + + $triangle = new awPolygon; + // Set default style and thickness + $triangle->setStyle(awPolygon::SOLID); + $triangle->setThickness(1); + + if($inverted === TRUE) { + // Bottom of the triangle + $triangle->append(new awPoint($x, $y + $size / sqrt(3))); + + // Upper left corner + $triangle->append(new awPoint($x - $size / 2, $y - $size / (2 * sqrt(3)))); + + // Upper right corner + $triangle->append(new awPoint($x + $size / 2, $y - $size / (2 * sqrt(3)))); + } else { + // Top of the triangle + $triangle->append(new awPoint($x, $y - $size / sqrt(3))); + + // Lower left corner + $triangle->append(new awPoint($x - $size / 2, $y + $size / (2 * sqrt(3)))); + + // Lower right corner + $triangle->append(new awPoint($x + $size / 2, $y + $size / (2 * sqrt(3)))); + } + + $this->driver->filledPolygon($this->fill, $triangle); + + if($this->border->visible()) { + $this->border->polygon($this->driver, $triangle); + } + } + + protected function drawRhombus(awPoint $point) { + + list($x, $y) = $point->getLocation(); + + $rhombus = new awPolygon; + // Set default style and thickness + $rhombus->setStyle(awPolygon::SOLID); + $rhombus->setThickness(1); + + // Top of the rhombus + $rhombus->append(new awPoint($x, $y - $this->size / 2)); + + // Right of the rhombus + $rhombus->append(new awPoint($x + $this->size / 2, $y)); + + // Bottom of the rhombus + $rhombus->append(new awPoint($x, $y + $this->size / 2)); + + // Left of the rhombus + $rhombus->append(new awPoint($x - $this->size / 2, $y)); + + $this->driver->filledPolygon($this->fill, $rhombus); + + if($this->border->visible()) { + $this->border->polygon($this->driver, $rhombus); + } + } + + protected function drawCross(awPoint $point, $upright = FALSE) { + + list($x, $y) = $point->getLocation(); + + if($upright === TRUE) { + $x11 = (int)($x); + $y11 = (int)($y - $this->size / 2); + $x12 = (int)($x); + $y12 = (int)($y + $this->size / 2); + + $y21 = (int)($y); + $y22 = (int)($y); + } else { + $x11 = (int)($x - $this->size / 2); + $y11 = (int)($y + $this->size / 2); + $x12 = (int)($x + $this->size / 2); + $y12 = (int)($y - $this->size / 2); + + $y21 = (int)($y - $this->size / 2); + $y22 = (int)($y + $this->size / 2); + } + + $x21 = (int)($x - $this->size / 2); + $x22 = (int)($x + $this->size / 2); + + $this->driver->line( + $this->fill, + new awLine( + new awPoint($x11, $y11), + new awPoint($x12, $y12) + ) + ); + + $this->driver->line( + $this->fill, + new awLine( + new awPoint($x21, $y21), + new awPoint($x22, $y22) + ) + ); + } + + protected function drawImage(awPoint $point) { + + if($this->image instanceof awImage) { + + $width = $this->image->width; + $height = $this->image->height; + + list($x, $y) = $point->getLocation(); + + $x1 = (int)($x - $width / 2); + $x2 = $x1 + $width; + $y1 = (int)($y - $width / 2); + $y2 = $y1 + $height; + + $this->border->rectangle($this->driver, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1)); + + $this->driver->copyImage($this->image, new awPoint($x1, $y1), new awPoint($x2, $y2)); + + } + + } + +} + +registerClass('Mark'); diff --git a/modules/graphartichow/artichow/inc/Math.class.php b/modules/graphartichow/artichow/inc/Math.class.php new file mode 100644 index 000000000..0f1334b00 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Math.class.php @@ -0,0 +1,831 @@ +style = (int)$style; + } + + /** + * Return shape style + * + * @return int + */ + public function getStyle() { + return $this->style; + } + + /** + * Change shape thickness + * + * @param int $thickness Shape thickness in pixels + */ + public function setThickness($thickness) { + $this->thickness = (int)$thickness; + } + + /** + * Return shape thickness + * + * @return int + */ + public function getThickness() { + return $this->thickness; + } + + /** + * Hide the shape + * + * @param bool $hide + */ + public function hide($hide) { + $this->hide = (bool)$hide; + } + + /** + * Show the shape + * + * @param bool $shape + */ + public function show($shape) { + $this->hide = (bool)!$shape; + } + + /** + * Is the line hidden ? + * + * @return bool + */ + public function isHidden() { + return $this->hide; + } + +} + +registerClass('Shape', TRUE); + +/** + * Describe a point + * + * @package Artichow + */ +class awPoint extends awShape { + + /** + * X coord + * + * @var float + */ + public $x; + + /** + * Y coord + * + * @var float + */ + public $y; + + /** + * Build a new awpoint + * + * @param float $x + * @param float $y + */ + public function __construct($x, $y) { + + $this->setLocation($x, $y); + + } + + /** + * Change X value + * + * @param float $x + */ + public function setX($x) { + $this->x = (float)$x; + } + + /** + * Change Y value + * + * @param float $y + */ + public function setY($y) { + $this->y = (float)$y; + } + + /** + * Change point location + * + * @param float $x + * @param float $y + */ + public function setLocation($x, $y) { + $this->setX($x); + $this->setY($y); + } + + /** + * Get point location + * + * @param array Point location + */ + public function getLocation() { + return array($this->x, $this->y); + } + + /** + * Get distance to another point + * + * @param awPoint $p A point + * @return float + */ + public function getDistance(awPoint $p) { + + return sqrt(pow($p->x - $this->x, 2) + pow($p->y - $this->y, 2)); + + } + + /** + * Move the point to another location + * + * @param Point A Point with the new awlocation + */ + public function move($x, $y) { + + return new awPoint( + $this->x + $x, + $this->y + $y + ); + + } + +} + +registerClass('Point'); + + +/** + * Describe a line + * + * @package Artichow + */ +class awLine extends awShape { + + /** + * Line first point + * + * @param Point + */ + public $p1; + + /** + * Line second point + * + * @param Point + */ + public $p2; + + /** + * The line slope (the m in y = mx + p) + * + * @param float + */ + private $slope; + + /** + * The y-intercept value of the line (the p in y = mx + p) + * + * @param float + */ + private $origin; + + /** + * Build a new awline + * + * @param awPoint $p1 First point + * @param awPoint $p2 Second point + * @param int $type Style of line (default to solid) + * @param int $thickness Line thickness (default to 1) + */ + public function __construct($p1 = NULL, $p2 = NULL, $type = awLine::SOLID, $thickness = 1) { + + $this->setLocation($p1, $p2); + $this->setStyle($type); + $this->setThickness($thickness); + + } + + /** + * Build a line from 4 coords + * + * @param int $x1 Left position + * @param int $y1 Top position + * @param int $x2 Right position + * @param int $y2 Bottom position + */ + public static function build($x1, $y1, $x2, $y2) { + + return new awLine( + new awPoint($x1, $y1), + new awPoint($x2, $y2) + ); + + } + + /** + * Change X values of the line + * + * @param int $x1 Begin value + * @param int $x2 End value + */ + public function setX($x1, $x2) { + $this->p1->setX($x1); + $this->p2->setX($x2); + + // Resets slope and origin values so they are + // recalculated when and if needed. + $this->slope = NULL; + $this->origin = NULL; + } + + /** + * Change Y values of the line + * + * @param int $y1 Begin value + * @param int $y2 End value + */ + public function setY($y1, $y2) { + $this->p1->setY($y1); + $this->p2->setY($y2); + + // Resets slope and origin values so they are + // recalculated when and if needed. + $this->slope = NULL; + $this->origin = NULL; + } + + /** + * Change line location + * + * @param awPoint $p1 First point + * @param awPoint $p2 Second point + */ + public function setLocation($p1, $p2) { + if(is_null($p1) or $p1 instanceof awPoint) { + $this->p1 = $p1; + } + if(is_null($p2) or $p2 instanceof awPoint) { + $this->p2 = $p2; + } + + // Resets slope and origin values so they are + // recalculated when and if needed. + $this->slope = NULL; + $this->origin = NULL; + } + + /** + * Get line location + * + * @param array Line location + */ + public function getLocation() { + return array($this->p1, $this->p2); + } + + /** + * Get the line size + * + * @return float + */ + public function getSize() { + + $square = pow($this->p2->x - $this->p1->x, 2) + pow($this->p2->y - $this->p1->y, 2); + return sqrt($square); + + } + + /** + * Calculate the line slope + * + */ + private function calculateSlope() { + if($this->isHorizontal()) { + $this->slope = 0; + } else { + $slope = ($this->p1->y - $this->p2->y) / ($this->p1->x - $this->p2->x); + + $this->slope = $slope; + } + } + + /** + * Calculate the y-intercept value of the line + * + */ + private function calculateOrigin() { + if($this->isHorizontal()) { + $this->origin = $this->p1->y; // Or p2->y + } else { + $y1 = $this->p1->y; + $y2 = $this->p2->y; + $x1 = $this->p1->x; + $x2 = $this->p2->x; + + $origin = ($y2 * $x1 - $y1 * $x2) / ($x1 - $x2); + + $this->origin = $origin; + } + } + + /** + * Calculate the slope and y-intercept value of the line + * + */ + private function calculateEquation() { + $this->calculateSlope(); + $this->calculateOrigin(); + } + + /** + * Get the line slope value + * + * @return float + */ + public function getSlope() { + if($this->isVertical()) { + return NULL; + } elseif($this->slope !== NULL) { + return $this->slope; + } else { + $this->calculateSlope(); + return $this->slope; + } + } + + /** + * Get the line y-intercept value + * + * @return float + */ + public function getOrigin() { + if($this->isVertical()) { + return NULL; + } elseif($this->origin !== NULL) { + return $this->origin; + } else { + $this->calculateOrigin(); + return $this->origin; + } + } + + /** + * Get the line equation + * + * @return array An array containing the slope and y-intercept value of the line + */ + public function getEquation() { + $slope = $this->getSlope(); + $origin = $this->getOrigin(); + + return array($slope, $origin); + } + + /** + * Return the x coordinate of a point on the line + * given its y coordinate. + * + * @param float $y The y coordinate of the Point + * @return float $x The corresponding x coordinate + */ + public function getXFrom($y) { + $x = NULL; + + if($this->isVertical()) { + list($p, ) = $this->getLocation(); + $x = $p->x; + } else { + list($slope, $origin) = $this->getEquation(); + + if($slope !== 0) { + $y = (float)$y; + $x = ($y - $origin) / $slope; + } + } + + return $x; + } + + /** + * Return the y coordinate of a point on the line + * given its x coordinate. + * + * @param float $x The x coordinate of the Point + * @return float $y The corresponding y coordinate + */ + public function getYFrom($x) { + $y = NULL; + + if($this->isHorizontal()) { + list($p, ) = $this->getLocation(); + $y = $p->y; + } else { + list($slope, $origin) = $this->getEquation(); + + if($slope !== NULL) { + $x = (float)$x; + $y = $slope * $x + $origin; + } + } + + return $y; + } + + /** + * Test if the line can be considered as a point + * + * @return bool + */ + public function isPoint() { + return ($this->p1->x === $this->p2->x and $this->p1->y === $this->p2->y); + } + + /** + * Test if the line is a vertical line + * + * @return bool + */ + public function isVertical() { + return ($this->p1->x === $this->p2->x); + } + + /** + * Test if the line is an horizontal line + * + * @return bool + */ + public function isHorizontal() { + return ($this->p1->y === $this->p2->y); + } + + /** + * Returns TRUE if the line is going all the way from the top + * to the bottom of the polygon surrounding box. + * + * @param $polygon Polygon A Polygon object + * @return bool + */ + public function isTopToBottom(awPolygon $polygon) { + list($xMin, $xMax) = $polygon->getBoxXRange(); + list($yMin, $yMax) = $polygon->getBoxYRange(); + + if($this->isHorizontal()) { + return FALSE; + } else { + if($this->p1->y < $this->p2->y) { + $top = $this->p1; + $bottom = $this->p2; + } else { + $top = $this->p2; + $bottom = $this->p1; + } + + return ( + $this->isOnBoxTopSide($top, $xMin, $xMax, $yMin) + and + $this->isOnBoxBottomSide($bottom, $xMin, $xMax, $yMax) + ); + } + } + + /** + * Returns TRUE if the line is going all the way from the left side + * to the right side of the polygon surrounding box. + * + * @param $polygon Polygon A Polygon object + * @return bool + */ + public function isLeftToRight(awPolygon $polygon) { + list($xMin, $xMax) = $polygon->getBoxXRange(); + list($yMin, $yMax) = $polygon->getBoxYRange(); + + if($this->isVertical()) { + return FALSE; + } else { + if($this->p1->x < $this->p2->x) { + $left = $this->p1; + $right = $this->p2; + } else { + $left = $this->p2; + $right = $this->p1; + } + } + + return ( + $this->isOnBoxLeftSide($left, $yMin, $yMax, $xMin) + and + $this->isOnBoxRightSide($right, $yMin, $yMax, $xMax) + ); + } + + private function isOnBoxTopSide(awPoint $point, $xMin, $xMax, $yMin) { + if( + $point->y === $yMin + and + $point->x >= $xMin + and + $point->x <= $xMax + ) { + return TRUE; + } else { + return FALSE; + } + } + + private function isOnBoxBottomSide(awPoint $point, $xMin, $xMax, $yMax) { + if( + $point->y === $yMax + and + $point->x >= $xMin + and + $point->x <= $xMax + ) { + return TRUE; + } else { + return FALSE; + } + } + + private function isOnBoxLeftSide(awPoint $point, $yMin, $yMax, $xMin) { + if( + $point->x === $xMin + and + $point->y >= $yMin + and + $point->y <= $yMax + ) { + return TRUE; + } else { + return FALSE; + } + } + + private function isOnBoxRightSide(awPoint $point, $yMin, $yMax, $xMax) { + if( + $point->x === $xMax + and + $point->y >= $yMin + and + $point->y <= $yMax + ) { + return TRUE; + } else { + return FALSE; + } + } + +} + +registerClass('Line'); + +/** + * A vector is a type of line + * The sense of the vector goes from $p1 to $p2. + * + * @package Artichow + */ +class awVector extends awLine { + + /** + * Get vector angle in radians + * + * @return float + */ + public function getAngle() { + + if($this->isPoint()) { + return 0.0; + } + + $size = $this->getSize(); + + $width = ($this->p2->x - $this->p1->x); + $height = ($this->p2->y - $this->p1->y) * -1; + + if($width >= 0 and $height >= 0) { + return acos($width / $size); + } else if($width <= 0 and $height >= 0) { + return acos($width / $size); + } else { + $height *= -1; + if($width >= 0 and $height >= 0) { + return 2 * M_PI - acos($width / $size); + } else if($width <= 0 and $height >= 0) { + return 2 * M_PI - acos($width / $size); + } + } + + } + +} + +registerClass('Vector'); + + +/** + * Describe a polygon + * + * @package Artichow + */ +class awPolygon extends awShape { + + /** + * Polygon points + * + * @var array + */ + protected $points = array(); + + /** + * Set a point in the polygon + * + * @param int $pos Point position + * @param awPoint $point + */ + public function set($pos, $point) { + if(is_null($point) or $point instanceof awPoint) { + $this->points[$pos] = $point; + } + } + + /** + * Add a point at the end of the polygon + * + * @param awPoint $point + */ + public function append($point) { + if(is_null($point) or $point instanceof awPoint) { + $this->points[] = $point; + } + } + + /** + * Get a point at a position in the polygon + * + * @param int $pos Point position + * @return Point + */ + public function get($pos) { + return $this->points[$pos]; + } + + /** + * Count number of points in the polygon + * + * @return int + */ + public function count() { + return count($this->points); + } + + /** + * Returns all points in the polygon + * + * @return array + */ + public function all() { + return $this->points; + } + + /** + * Returns the different lines formed by the polygon vertices + * + * @return array + */ + public function getLines() { + $lines = array(); + $count = $this->count(); + + for($i = 0; $i < $count - 1; $i++) { + $lines[] = new Line($this->get($i), $this->get($i + 1)); + } + + // "Close" the polygon + $lines[] = new Line($this->get($count - 1), $this->get(0)); + + return $lines; + } + + /** + * Get the upper-left and lower-right points + * of the bounding box around the polygon + * + * @return array An array of two Point objects + */ + public function getBoxPoints() { + $count = $this->count(); + $x = $y = array(); + + for($i = 0; $i < $count; $i++) { + $point = $this->get($i); + + list($x[], $y[]) = $point->getLocation(); + } + + $upperLeft = new Point(min($x), min($y)); + $lowerRight = new Point(max($x), max($y)); + + return array($upperLeft, $lowerRight); + } + + /** + * Return the range of the polygon on the y axis, + * i.e. the minimum and maximum y value of any point in the polygon + * + * @return array + */ + public function getBoxYRange() { + list($p1, $p2) = $this->getBoxPoints(); + + list(, $yMin) = $p1->getLocation(); + list(, $yMax) = $p2->getLocation(); + + return array($yMin, $yMax); + } + + /** + * Return the range of the polygon on the x axis, + * i.e. the minimum and maximum x value of any point in the polygon + * + * @return array + */ + public function getBoxXRange() { + list($p1, $p2) = $this->getBoxPoints(); + + list($xMin, ) = $p1->getLocation(); + list($xMax, ) = $p2->getLocation(); + + return array($xMin, $xMax); + } + +} + +registerClass('Polygon'); diff --git a/modules/graphartichow/artichow/inc/Shadow.class.php b/modules/graphartichow/artichow/inc/Shadow.class.php new file mode 100644 index 000000000..1d528db5c --- /dev/null +++ b/modules/graphartichow/artichow/inc/Shadow.class.php @@ -0,0 +1,405 @@ +setPosition($position); + } + + /** + * Hide shadow ? + * + * @param bool $hide + */ + public function hide($hide = TRUE) { + $this->hide = (bool)$hide; + } + + /** + * Show shadow ? + * + * @param bool $show + */ + public function show($show = TRUE) { + $this->hide = (bool)!$show; + } + + /** + * Change shadow size + * + * @param int $size + * @param bool $smooth Smooth the shadow (facultative argument) + */ + public function setSize($size, $smooth = NULL) { + $this->size = (int)$size; + if($smooth !== NULL) { + $this->smooth($smooth); + } + } + + /** + * Change shadow color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Change shadow position + * + * @param int $position + */ + public function setPosition($position) { + $this->position = (int)$position; + } + + /** + * Smooth shadow ? + * + * @param bool $smooth + */ + public function smooth($smooth) { + $this->smooth = (bool)$smooth; + } + + /** + * Get the space taken by the shadow + * + * @return Side + */ + public function getSpace() { + + return new awSide( + ($this->position === awShadow::LEFT_TOP or $this->position === awShadow::LEFT_BOTTOM) ? $this->size : 0, + ($this->position === awShadow::RIGHT_TOP or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0, + ($this->position === awShadow::LEFT_TOP or $this->position === awShadow::RIGHT_TOP) ? $this->size : 0, + ($this->position === awShadow::LEFT_BOTTOM or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0 + ); + + } + + /** + * Draw shadow + * + * @param awDriver $driver + * @param awPoint $p1 Top-left point + * @param awPoint $p2 Right-bottom point + * @param int Drawing mode + */ + public function draw(awDriver $driver, awPoint $p1, awPoint $p2, $mode) { + + if($this->hide) { + return; + } + + if($this->size <= 0) { + return; + } + + $driver = clone $driver; + + $color = ($this->color instanceof awColor) ? $this->color : new awColor(125, 125, 125); + + switch($this->position) { + + case awShadow::RIGHT_BOTTOM : + + if($mode === awShadow::OUT) { + $t1 = $p1->move(0, 0); + $t2 = $p2->move($this->size + 1, $this->size + 1); + } else { // PHP 4 compatibility + $t1 = $p1->move(0, 0); + $t2 = $p2->move(0, 0); + } + + $width = $t2->x - $t1->x; + $height = $t2->y - $t1->y; + + $driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($width - $this->size, $this->size), + new awPoint($width - 1, $height - 1) + ) + ); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($this->size, $height - $this->size), + new awPoint($width - $this->size - 1, $height - 1) + ) + ); + + $this->smoothPast($driver, $color, $width, $height); + + break; + + case awShadow::LEFT_TOP : + + if($mode === awShadow::OUT) { + $t1 = $p1->move(- $this->size, - $this->size); + $t2 = $p2->move(0, 0); + } else { // PHP 4 compatibility + $t1 = $p1->move(0, 0); + $t2 = $p2->move(0, 0); + } + + $width = $t2->x - $t1->x; + $height = $t2->y - $t1->y; + + $driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y); + + $height = max($height + 1, $this->size); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint(0, 0), + new awPoint($this->size - 1, $height - $this->size - 1) + ) + ); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($this->size, 0), + new awPoint($width - $this->size - 1, $this->size - 1) + ) + ); + + $this->smoothPast($driver, $color, $width, $height); + + break; + + case awShadow::RIGHT_TOP : + + if($mode === awShadow::OUT) { + $t1 = $p1->move(0, - $this->size); + $t2 = $p2->move($this->size + 1, 0); + } else { // PHP 4 compatibility + $t1 = $p1->move(0, 0); + $t2 = $p2->move(0, 0); + } + + $width = $t2->x - $t1->x; + $height = $t2->y - $t1->y; + + $driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y); + + $height = max($height + 1, $this->size); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($width - $this->size, 0), + new awPoint($width - 1, $height - $this->size - 1) + ) + ); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($this->size, 0), + new awPoint($width - $this->size - 1, $this->size - 1) + ) + ); + + $this->smoothFuture($driver, $color, $width, $height); + + break; + + case awShadow::LEFT_BOTTOM : + + if($mode === awShadow::OUT) { + $t1 = $p1->move(- $this->size, 0); + $t2 = $p2->move(0, $this->size + 1); + } else { // PHP 4 compatibility + $t1 = $p1->move(0, 0); + $t2 = $p2->move(0, 0); + } + + $width = $t2->x - $t1->x; + $height = $t2->y - $t1->y; + + $driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint(0, $this->size), + new awPoint($this->size - 1, $height - 1) + ) + ); + + $driver->filledRectangle( + $color, + new awLine( + new awPoint($this->size, $height - $this->size), + new awPoint($width - $this->size - 1, $height - 1) + ) + ); + + $this->smoothFuture($driver, $color, $width, $height); + + break; + + } + + } + + private function smoothPast(awDriver $driver, awColor $color, $width, $height) { + + if($this->smooth) { + + for($i = 0; $i < $this->size; $i++) { + for($j = 0; $j <= $i; $j++) { + $driver->point( + $color, + new awPoint($i, $j + $height - $this->size) + ); + } + } + + for($i = 0; $i < $this->size; $i++) { + for($j = 0; $j <= $i; $j++) { + $driver->point( + $color, + new awPoint($width - $this->size + $j, $i) + ); + } + } + + } + + } + + private function smoothFuture(awDriver $driver, awColor $color, $width, $height) { + + if($this->smooth) { + + for($i = 0; $i < $this->size; $i++) { + for($j = 0; $j <= $i; $j++) { + $driver->point( + $color, + new awPoint($i, $this->size - $j - 1) + ); + } + } + + for($i = 0; $i < $this->size; $i++) { + for($j = 0; $j <= $i; $j++) { + $driver->point( + $color, + new awPoint($width - $this->size + $j, $height - $i - 1) + ); + } + } + + } + } + +} + +registerClass('Shadow'); diff --git a/modules/graphartichow/artichow/inc/Text.class.php b/modules/graphartichow/artichow/inc/Text.class.php new file mode 100644 index 000000000..663444425 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Text.class.php @@ -0,0 +1,233 @@ +setText($text); + $this->setFont($font); + + // Set default color to black + if($color === NULL) { + $color = new awColor(0, 0, 0); + } + + $this->setColor($color); + $this->setAngle($angle); + + $this->border = new awBorder; + $this->border->hide(); + + } + + /** + * Get text + * + * @return string + */ + public function getText() { + return $this->text; + } + + /** + * Change text + * + * @param string $text New text + */ + public function setText($text) { + $this->text = (string)$text; + $this->text = str_replace("\r", "", $text); + } + + /** + * Change text font + * + * @param Font + */ + public function setFont(awFont $font) { + $this->font = $font; + } + + /** + * Get text font + * + * @return int + */ + public function getFont() { + return $this->font; + } + + /** + * Change text angle + * + * @param int + */ + public function setAngle($angle) { + $this->angle = (int)$angle; + } + + /** + * Get text angle + * + * @return int + */ + public function getAngle() { + return $this->angle; + } + + /** + * Change text color + * + * @param Color + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Get text color + * + * @return Color + */ + public function getColor() { + return $this->color; + } + + /** + * Change text background + * + * @param mixed $background + */ + public function setBackground($background) { + if($background instanceof awColor) { + $this->setBackgroundColor($background); + } elseif($background instanceof awGradient) { + $this->setBackgroundGradient($background); + } + } + + /** + * Change text background color + * + * @param awColor $color + */ + public function setBackgroundColor(awColor $color) { + $this->background = $color; + } + + /** + * Change text background gradient + * + * @param awGradient $gradient + */ + public function setBackgroundGradient(awGradient $gradient) { + $this->background = $gradient; + } + + /** + * Get text background + * + * @return Color, Gradient + */ + public function getBackground() { + return $this->background; + } + + /** + * Change padding + * + * @param int $left Left padding + * @param int $right Right padding + * @param int $top Top padding + * @param int $bottom Bottom padding + */ + public function setPadding($left, $right, $top, $bottom) { + $this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom); + } + + /** + * Get current padding + * + * @return array + */ + public function getPadding() { + return $this->padding; + } + +} + +registerClass('Text'); + diff --git a/modules/graphartichow/artichow/inc/Tick.class.php b/modules/graphartichow/artichow/inc/Tick.class.php new file mode 100644 index 000000000..4bfc46b80 --- /dev/null +++ b/modules/graphartichow/artichow/inc/Tick.class.php @@ -0,0 +1,343 @@ +setSize($size); + $this->setNumber($number); + $this->setColor(new awBlack); + $this->style = awTick::IN; + + } + + /** + * Change ticks style + * + * @param int $style + */ + public function setStyle($style) { + $this->style = (int)$style; + } + + /** + * Get ticks style + * + * @return int + */ + public function getStyle() { + return $this->style; + } + + /** + * Change ticks color + * + * @param awColor $color + */ + public function setColor(awColor $color) { + $this->color = $color; + } + + /** + * Change ticks size + * + * @param int $size + */ + public function setSize($size) { + $this->size = (int)$size; + } + + /** + * Change interval of ticks + * + * @param int $interval + */ + public function setInterval($interval) { + $this->interval = (int)$interval; + } + + /** + * Get interval between each tick + * + * @return int + */ + public function getInterval() { + return $this->interval; + } + + /** + * Change number of ticks + * + * @param int $number + */ + public function setNumber($number) { + $this->number = (int)$number; + } + + /** + * Get number of ticks + * + * @return int + */ + public function getNumber() { + return $this->number; + } + + /** + * Change number of ticks relative to others ticks + * + * @param awTick $tick Ticks reference + * @param int $number Number of ticks + */ + public function setNumberByTick(awTick $tick, $number) { + + $this->numberByTick = array($tick, (int)$number); + + } + + /** + * Hide ticks + * + * @param bool $hide + */ + public function hide($hide) { + $this->hide = (bool)$hide; + } + + /** + * Hide first tick + * + * @param bool $hide + */ + public function hideFirst($hide) { + $this->hideFirst = (bool)$hide; + } + + /** + * Hide last tick + * + * @param bool $hide + */ + public function hideLast($hide) { + $this->hideLast = (bool)$hide; + } + + /** + * Draw ticks on a vector + * + * @param awDriver $driver A driver + * @param awVector $vector A vector + */ + public function draw(awDriver $driver, awVector $vector) { + + if($this->numberByTick !== NULL) { + list($tick, $number) = $this->numberByTick; + $this->number = 1 + ($tick->getNumber() - 1) * ($number + 1); + $this->interval = $tick->getInterval(); + } + + if($this->number < 2 or $this->hide) { + return; + } + + $angle = $vector->getAngle(); + // echo "INIT:".$angle."
        "; + switch($this->style) { + + case awTick::IN : + $this->drawTicks($driver, $vector, NULL, $angle + M_PI / 2); + break; + + case awTick::OUT : + $this->drawTicks($driver, $vector, $angle + 3 * M_PI / 2, NULL); + break; + + default : + $this->drawTicks($driver, $vector, $angle + M_PI / 2, $angle + 3 * M_PI / 2); + break; + + } + + } + + protected function drawTicks(awDriver $driver, awVector $vector, $from, $to) { + + // Draw last tick + if($this->hideLast === FALSE) { + + //echo ''; + if(($this->number - 1) % $this->interval === 0) { + $this->drawTick($driver, $vector->p2, $from, $to); + } + //echo ''; + + } + + $number = $this->number - 1; + $size = $vector->getSize(); + + // Get tick increment in pixels + $inc = $size / $number; + + // Check if we must hide the first tick + $start = $this->hideFirst ? $inc : 0; + $stop = $inc * $number; + + $position = 0; + + for($i = $start; round($i, 6) < $stop; $i += $inc) { + + if($position % $this->interval === 0) { + $p = $vector->p1->move( + round($i * cos($vector->getAngle()), 6), + round($i * sin($vector->getAngle() * -1), 6) + ); + $this->drawTick($driver, $p, $from, $to); + } + + $position++; + + } + //echo '

        '; + } + + protected function drawTick(awDriver $driver, awPoint $p, $from, $to) { +// echo $this->size.':'.$angle.'|'.cos($angle).'/'; + // The round avoid some errors in the calcul + // For example, 12.00000008575245 becomes 12 + $p1 = $p; + $p2 = $p; + + if($from !== NULL) { + $p1 = $p1->move( + round($this->size * cos($from), 6), + round($this->size * sin($from) * -1, 6) + ); + } + + if($to !== NULL) { + $p2 = $p2->move( + round($this->size * cos($to), 6), + round($this->size * sin($to) * -1, 6) + ); + } + //echo $p1->x.':'.$p2->x.'('.$p1->y.':'.$p2->y.')'.'/'; + $vector = new awVector( + $p1, $p2 + ); + + $driver->line( + $this->color, + $vector + ); + + } + +} + +registerClass('Tick'); diff --git a/modules/graphartichow/artichow/inc/Tools.class.php b/modules/graphartichow/artichow/inc/Tools.class.php new file mode 100644 index 000000000..05ca3342e --- /dev/null +++ b/modules/graphartichow/artichow/inc/Tools.class.php @@ -0,0 +1,174 @@ +set($left, $right, $top, $bottom); + } + + + /** + * Change side values + * + * @param mixed $left + * @param mixed $right + * @param mixed $top + * @param mixed $bottom + */ + public function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { + + if($left !== NULL) { + $this->left = (float)$left; + } + if($right !== NULL) { + $this->right = (float)$right; + } + if($top !== NULL) { + $this->top = (float)$top; + } + if($bottom !== NULL) { + $this->bottom = (float)$bottom; + } + + } + + + /** + * Add values to each side + * + * @param mixed $left + * @param mixed $right + * @param mixed $top + * @param mixed $bottom + */ + public function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) { + + if($left !== NULL) { + $this->left += (float)$left; + } + if($right !== NULL) { + $this->right += (float)$right; + } + if($top !== NULL) { + $this->top += (float)$top; + } + if($bottom !== NULL) { + $this->bottom += (float)$bottom; + } + + } + +} + +registerClass('Side'); diff --git a/modules/graphartichow/artichow/inc/drivers/gd.class.php b/modules/graphartichow/artichow/inc/drivers/gd.class.php new file mode 100644 index 000000000..dcf2f33be --- /dev/null +++ b/modules/graphartichow/artichow/inc/drivers/gd.class.php @@ -0,0 +1,1335 @@ +driverString = 'gd'; + } + + public function init(awImage $image) { + + if($this->resource === NULL) { + + $this->setImageSize($image->width, $image->height); + + // Create image + $this->resource = imagecreatetruecolor($this->imageWidth, $this->imageHeight); + if(!$this->resource) { + awImage::drawError("Class Image: Unable to create a graph."); + } + + imagealphablending($this->resource, TRUE); + + // Antialiasing is now handled by the Driver object + $this->setAntiAliasing($image->getAntiAliasing()); + + // Original color + $this->filledRectangle( + new awWhite, + new awLine( + new awPoint(0, 0), + new awPoint($this->imageWidth, $this->imageHeight) + ) + ); + + $shadow = $image->shadow; + if($shadow !== NULL) { + $shadow = $shadow->getSpace(); + $p1 = new awPoint($shadow->left, $shadow->top); + $p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1); + + + // Draw image background + $this->filledRectangle($image->getBackground(), new awLine($p1, $p2)); + + // Draw image border + $image->border->rectangle($this, $p1, $p2); + } + + } + } + + public function initFromFile(awFileImage $fileImage, $file) { + + $image = @getimagesize((string)$file); + + if($image and in_array($image[2], array(2, 3))) { + + $fileImage->setSize($image[0], $image[1]); + + switch($image[2]) { + + case 2 : + $this->resource = imagecreatefromjpeg($file); + break; + + case 3 : + $this->resource = imagecreatefrompng($file); + break; + + } + + $this->setImageSize($fileImage->width, $fileImage->height); + } else { + awImage::drawError("Class FileImage: Artichow does not support the format of this image (must be in PNG or JPEG)"); + } + } + + public function setImageSize($width, $height) { + + $this->imageWidth = $width; + $this->imageHeight = $height; + + } + + public function setPosition($x, $y) { + + // Calculate absolute position + $this->x = round($x * $this->imageWidth - $this->w / 2); + $this->y = round($y * $this->imageHeight - $this->h / 2); + + } + + public function setAbsPosition($x, $y) { + + $this->x = $x; + $this->y = $y; + + } + + public function movePosition($x, $y) { + + $this->x += (int)$x; + $this->y += (int)$y; + + } + + public function setSize($w, $h) { + + // Calcul absolute size + $this->w = round($w * $this->imageWidth); + $this->h = round($h * $this->imageHeight); + + return $this->getSize(); + + } + + public function setAbsSize($w, $h) { + + $this->w = $w; + $this->h = $h; + + return $this->getSize(); + + } + + public function getSize() { + + return array($this->w, $this->h); + + } + + public function setAntiAliasing($bool) { + + if(function_exists('imageantialias')) { + imageantialias($this->resource, (bool)$bool); + + $this->antiAliasing = (bool)$bool; + } elseif ($bool == true) { + awImage::drawErrorFile('missing-anti-aliasing'); + } + } + + public function getColor(awColor $color) { + + if($color->alpha === 0 or function_exists('imagecolorallocatealpha') === FALSE) { + $gdColor = imagecolorallocate($this->resource, $color->red, $color->green, $color->blue); + } else { + $gdColor = imagecolorallocatealpha($this->resource, $color->red, $color->green, $color->blue, $color->alpha); + } + + return $gdColor; + } + + public function copyImage(awImage $image, awPoint $p1, awPoint $p2) { + + list($x1, $y1) = $p1->getLocation(); + list($x2, $y2) = $p2->getLocation(); + + $driver = $image->getDriver(); + imagecopy($this->resource, $driver->resource, $this->x + $x1, $this->y + $y1, 0, 0, $x2 - $x1, $y2 - $y1); + + } + + public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE) { + + if($resample) { + $function = 'imagecopyresampled'; + } else { + $function = 'imagecopyresized'; + } + + $driver = $image->getDriver(); + + $function( + $this->resource, + $driver->resource, + $this->x + $d1->x, $this->y + $d1->y, + $s1->x, $s1->y, + $d2->x - $d1->x, $d2->y - $d1->y, + $s2->x - $s1->x, $s2->y - $s1->y + ); + + } + + public function string(awText $text, awPoint $point, $width = NULL) { + + $font = $text->getFont(); + + // Can we deal with that font? + if($this->isCompatibleWithFont($font) === FALSE) { + awImage::drawError('Class GDDriver: Incompatible font type (\''.get_class($font).'\')'); + } + + // Check which FontDriver to use + if($font instanceof awPHPFont) { + $fontDriver = $this->phpFontDriver; + } else { + $fontDriver = $this->fileFontDriver; + } + + if($text->getBackground() !== NULL or $text->border->visible()) { + + list($left, $right, $top, $bottom) = $text->getPadding(); + + $textWidth = $fontDriver->getTextWidth($text, $this); + $textHeight = $fontDriver->getTextHeight($text, $this); + + $x1 = floor($point->x - $left); + $y1 = floor($point->y - $top); + $x2 = $x1 + $textWidth + $left + $right; + $y2 = $y1 + $textHeight + $top + $bottom; + + $this->filledRectangle( + $text->getBackground(), + awLine::build($x1, $y1, $x2, $y2) + ); + + $text->border->rectangle( + $this, + new awPoint($x1 - 1, $y1 - 1), + new awPoint($x2 + 1, $y2 + 1) + ); + + } + + $fontDriver->string($this, $text, $point, $width); + + } + + public function point(awColor $color, awPoint $p) { + + if($p->isHidden() === FALSE) { + $rgb = $this->getColor($color); + imagesetpixel($this->resource, $this->x + round($p->x), $this->y + round($p->y), $rgb); + } + + } + + public function line(awColor $color, awLine $line) { + + if($line->thickness > 0 and $line->isHidden() === FALSE) { + + $rgb = $this->getColor($color); + $thickness = $line->thickness; + + list($p1, $p2) = $line->getLocation(); + + $this->startThickness($thickness); + + switch($line->getStyle()) { + + case awLine::SOLID : + imageline($this->resource, $this->x + round($p1->x), $this->y + round($p1->y), $this->x + round($p2->x), $this->y + round($p2->y), $rgb); + break; + + case awLine::DOTTED : + $size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2)); + $cos = ($p2->x - $p1->x) / $size; + $sin = ($p2->y - $p1->y) / $size; + for($i = 0; $i <= $size; $i += 2) { + $p = new awPoint( + round($i * $cos + $p1->x), + round($i * $sin + $p1->y) + ); + $this->point($color, $p); + } + break; + + case awLine::DASHED : + $width = $p2->x - $p1->x; + $height = $p2->y - $p1->y; + $size = sqrt(pow($height, 2) + pow($width, 2)); + + if($size == 0) { + return; + } + + $cos = $width / $size; + $sin = $height / $size; + + $functionX = ($width > 0) ? 'min' : 'max'; + $functionY = ($height > 0) ? 'min' : 'max'; + + for($i = 0; $i <= $size; $i += 6) { + + $t1 = new awPoint( + round($i * $cos + $p1->x), + round($i * $sin + $p1->y) + ); + + $t2 = new awPoint( + round($functionX(($i + 3) * $cos, $width) + $p1->x), + round($functionY(($i + 3) * $sin, $height) + $p1->y) + ); + + $this->line($color, new awLine($t1, $t2)); + + } + break; + + } + + $this->stopThickness($thickness); + + } + + } + + public function arc(awColor $color, awPoint $center, $width, $height, $from, $to) { + + imagefilledarc( + $this->resource, + $this->x + $center->x, $this->y + $center->y, + $width, $height, + $from, $to, + $this->getColor($color), + IMG_ARC_EDGED | IMG_ARC_NOFILL + ); + + } + + public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to) { + + imagefilledarc( + $this->resource, + $this->x + $center->x, $this->y + $center->y, + $width, $height, + $from, $to, + $this->getColor($color), + IMG_ARC_PIE + ); + + } + + public function ellipse(awColor $color, awPoint $center, $width, $height) { + + list($x, $y) = $center->getLocation(); + + $rgb = $this->getColor($color); + imageellipse( + $this->resource, + $this->x + $x, + $this->y + $y, + $width, + $height, + $rgb + ); + + } + + public function filledEllipse($background, awPoint $center, $width, $height) { + + if($background instanceof awColor) { + + list($x, $y) = $center->getLocation(); + + $rgb = $this->getColor($background); + + imagefilledellipse( + $this->resource, + $this->x + $x, + $this->y + $y, + $width, + $height, + $rgb + ); + + } else if($background instanceof awGradient) { + + list($x, $y) = $center->getLocation(); + + $x1 = $x - round($width / 2); + $y1 = $y - round($height / 2); + $x2 = $x1 + $width; + $y2 = $y1 + $height; + + $gradientDriver = new awGDGradientDriver($this); + $gradientDriver->filledEllipse( + $background, + $x1, $y1, + $x2, $y2 + ); + + } + + } + + public function rectangle(awColor $color, awLine $line) { + + list($p1, $p2) = $line->getLocation(); + + switch($line->getStyle()) { + + case awLine::SOLID : + $thickness = $line->getThickness(); + $this->startThickness($thickness); + $rgb = $this->getColor($color); + imagerectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); + $this->stopThickness($thickness); + break; + + default : + + $side = clone $line; + + + + // Top side + $side->setLocation( + new awPoint($p1->x, $p1->y), + new awPoint($p2->x, $p1->y) + ); + $this->line($color, $side); + + // Right side + $side->setLocation( + new awPoint($p2->x, $p1->y), + new awPoint($p2->x, $p2->y) + ); + $this->line($color, $side); + + // Bottom side + $side->setLocation( + new awPoint($p1->x, $p2->y), + new awPoint($p2->x, $p2->y) + ); + $this->line($color, $side); + + // Left side + $side->setLocation( + new awPoint($p1->x, $p1->y), + new awPoint($p1->x, $p2->y) + ); + $this->line($color, $side); + + break; + + } + + } + + public function filledRectangle($background, awLine $line) { + + $p1 = $line->p1; + $p2 = $line->p2; + + if($background instanceof awColor) { + $rgb = $this->getColor($background); + imagefilledrectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb); + } else if($background instanceof awGradient) { + $gradientDriver = new awGDGradientDriver($this); + $gradientDriver->filledRectangle($background, $p1, $p2); + } + + } + + public function polygon(awColor $color, awPolygon $polygon) { + + switch($polygon->getStyle()) { + + case awPolygon::SOLID : + $thickness = $polygon->getThickness(); + $this->startThickness($thickness); + $points = $this->getPolygonPoints($polygon); + $rgb = $this->getColor($color); + imagepolygon($this->resource, $points, $polygon->count(), $rgb); + $this->stopThickness($thickness); + break; + + default : + + if($polygon->count() > 1) { + + $prev = $polygon->get(0); + + $line = new awLine; + $line->setStyle($polygon->getStyle()); + $line->setThickness($polygon->getThickness()); + + for($i = 1; $i < $polygon->count(); $i++) { + $current = $polygon->get($i); + $line->setLocation($prev, $current); + $this->line($color, $line); + $prev = $current; + } + + // Close the polygon + $line->setLocation($prev, $polygon->get(0)); + $this->line($color, $line); + + } + + } + + } + + public function filledPolygon($background, awPolygon $polygon) { + + if($background instanceof awColor) { + + $points = $this->getPolygonPoints($polygon); + $rgb = $this->getColor($background); + + imagefilledpolygon($this->resource, $points, $polygon->count(), $rgb); + + } else if($background instanceof awGradient) { + + $gradientDriver = new awGDGradientDriver($this); + $gradientDriver->filledPolygon($background, $polygon); + + } + + } + + public function send(awImage $image) { + + $this->drawImage($image); + + } + + public function get(awImage $image) { + + return $this->drawImage($image, TRUE, FALSE); + + } + + public function getTextWidth(awText $text) { + $font = $text->getFont(); + + if($font instanceof awPHPFont) { + $fontDriver = $this->phpFontDriver; + } else { + $fontDriver = $this->fileFontDriver; + } + + return $fontDriver->getTextWidth($text, $this); + } + + public function getTextHeight(awText $text) { + $font = $text->getFont(); + + if($font instanceof awPHPFont) { + $fontDriver = $this->phpFontDriver; + } else { + $fontDriver = $this->fileFontDriver; + } + + return $fontDriver->getTextHeight($text, $this); + } + + protected function isCompatibleWithFont(awFont $font) { + if($font instanceof awFDBFont) { + return FALSE; + } else { + return TRUE; + } + } + + private function drawImage(awImage $image, $return = FALSE, $header = TRUE) { + + $format = $image->getFormatString(); + + // Test if format is available + if((imagetypes() & $image->getFormat()) === FALSE) { + awImage::drawError("Class Image: Format '".$format."' is not available on your system. Check that your PHP has been compiled with the good libraries."); + } + + // Get some infos about this image + switch($format) { + case 'jpeg' : + $function = 'imagejpeg'; + break; + case 'png' : + $function = 'imagepng'; + break; + case 'gif' : + $function = 'imagegif'; + break; + } + + // Send headers to the browser + if($header === TRUE) { + $image->sendHeaders(); + } + + if($return) { + ob_start(); + } + + $function($this->resource); + + if($return) { + return ob_get_clean(); + } + } + + private function getPolygonPoints(awPolygon $polygon) { + + $points = array(); + + foreach($polygon->all() as $point) { + $points[] = $point->x + $this->x; + $points[] = $point->y + $this->y; + } + + return $points; + + } + + private function startThickness($thickness) { + + if($thickness > 1) { + + // Beurk :'( + if($this->antiAliasing and function_exists('imageantialias')) { + imageantialias($this->resource, FALSE); + } + imagesetthickness($this->resource, $thickness); + + } + + } + + private function stopThickness($thickness) { + + if($thickness > 1) { + + if($this->antiAliasing and function_exists('imageantialias')) { + imageantialias($this->resource, TRUE); + } + imagesetthickness($this->resource, 1); + + } + + } + + +} + +registerClass('GDDriver'); + +/** + * To your gradients + * + * @package Artichow + */ + +class awGDGradientDriver { + + /** + * A driver + * + * @var awGDDriver + */ + protected $driver; + + /** + * Build your GDGradientDriver + * + * @var awGDDriver $driver + */ + public function __construct(awGDDriver $driver) { + + $this->driver = $driver; + + } + + public function drawFilledFlatTriangle(awGradient $gradient, awPoint $a, awPoint $b, awPoint $c) { + + if($gradient->angle !== 0) { + awImage::drawError("Class GDGradientDriver: Flat triangles can only be used with 0 degree gradients."); + } + + // Look for right-angled triangle + if($a->x !== $b->x and $b->x !== $c->x) { + awImage::drawError("Class GDGradientDriver: Not right-angled flat triangles are not supported yet."); + } + + if($a->x === $b->x) { + $d = $a; + $e = $c; + } else { + $d = $c; + $e = $a; + } + + $this->init($gradient, $b->y - $d->y); + + for($i = $c->y + 1; $i < $b->y; $i++) { + + $color = $this->color($i - $d->y); + $pos = ($i - $d->y) / ($b->y - $d->y); + + $p1 = new awPoint($e->x, $i); + $p2 = new awPoint(1 + floor($e->x - $pos * ($e->x - $d->x)), $i); + + $this->driver->filledRectangle($color, new awLine($p1, $p2)); + + unset($color); + + } + + } + + protected function drawFilledTriangle(awGradient $gradient, awPolygon $polygon) { + + if($gradient->angle === 0) { + $this->drawFilledTriangleVertically($gradient, $polygon); + } elseif($gradient->angle === 90) { + $this->drawFilledTriangleHorizontally($gradient, $polygon); + } + + } + + private function drawFilledTriangleVertically(awGradient $gradient, awPolygon $polygon) { + list($yMin, $yMax) = $polygon->getBoxYRange(); + + $this->init($gradient, $yMax - $yMin); + + // Get the triangle line we will draw our lines from + $fromLine = NULL; + $lines = $polygon->getLines(); + + $count = count($lines); + + // Pick the side of the triangle going from the top + // to the bottom of the surrounding box + for($i = 0; $i < $count; $i++) { + if($lines[$i]->isTopToBottom($polygon)) { + list($fromLine) = array_splice($lines, $i, 1); + break; + } + } + + // If for some reason the three points are aligned, + // $fromLine will still be NULL + if($fromLine === NULL) { + return; + } + + $fillLine = NULL; + for($y = round($yMin); $y < round($yMax); $y++) { + + $fromX = $fromLine->getXFrom($y); + + $toX = array(); + foreach($lines as $line) { + $xValue = $line->getXFrom($y); + + if(!is_null($xValue)) { + $toX[] = $xValue; + } + } + + if(count($toX) === 1) { + $fillLine = new Line( + new Point($fromX, $y), + new Point($toX[0], $y) + ); + } else { + + $line1 = new Line( + new Point($fromX, $y), + new Point($toX[0], $y) + ); + $line2 = new Line( + new Point($fromX, $y), + new Point($toX[1], $y) + ); + + if($line1->getSize() < $line2->getSize()) { + $fillLine = $line1; + } else { + $fillLine = $line2; + } + } + + if(!$fillLine->isPoint()) { + $color = $this->color($y - $yMin); + $this->driver->line($color, $fillLine); + + unset($color); + } + } + + } + + private function drawFilledTriangleHorizontally(awGradient $gradient, awPolygon $polygon) { + list($xMin, $xMax) = $polygon->getBoxXRange(); + + $this->init($gradient, $xMax - $xMin); + + // Get the triangle line we will draw our lines from + $fromLine = NULL; + $lines = $polygon->getLines(); + + $count = count($lines); + + // Pick the side of the triangle going all the way + // from the left side to the right side of the surrounding box + for($i = 0; $i < $count; $i++) { + if($lines[$i]->isLeftToRight($polygon)) { + list($fromLine) = array_splice($lines, $i, 1); + break; + } + } + + // If for some reason the three points are aligned, + // $fromLine will still be NULL + if($fromLine === NULL) { + return; + } + + $fillLine = NULL; + for($x = round($xMin); $x < round($xMax); $x++) { + + $fromY = floor($fromLine->getYFrom($x)); + + $toY = array(); + foreach($lines as $line) { + $yValue = $line->getYFrom($x); + + if(!is_null($yValue)) { + $toY[] = floor($yValue); + } + } + + if(count($toY) === 1) { + $fillLine = new Line( + new Point($x, $fromY), + new Point($x, $toY[0]) + ); + } else { + + $line1 = new Line( + new Point($x, $fromY), + new Point($x, $toY[0]) + ); + $line2 = new Line( + new Point($x, $fromY), + new Point($x, $toY[1]) + ); + + if($line1->getSize() < $line2->getSize()) { + $fillLine = $line1; + } else { + $fillLine = $line2; + } + } + + $color = $this->color($x - $xMin); + if($fillLine->isPoint()) { + $this->driver->point($color, $fillLine->p1); + } elseif($fillLine->getSize() >= 1) { + $this->driver->line($color, $fillLine); + } + unset($color); + } + + } + + public function filledRectangle(awGradient $gradient, awPoint $p1, awPoint $p2) { + + list($x1, $y1) = $p1->getLocation(); + list($x2, $y2) = $p2->getLocation(); + + if($y1 < $y2) { + $y1 ^= $y2 ^= $y1 ^= $y2; + } + + if($x2 < $x1) { + $x1 ^= $x2 ^= $x1 ^= $x2; + } + + if($gradient instanceof awLinearGradient) { + $this->rectangleLinearGradient($gradient, new awPoint($x1, $y1), new awPoint($x2, $y2)); + } else { + awImage::drawError("Class GDGradientDriver: This gradient is not supported by rectangles."); + } + + } + + public function filledPolygon(awGradient $gradient, awPolygon $polygon) { + + if($gradient instanceof awLinearGradient) { + $this->polygonLinearGradient($gradient, $polygon); + } else { + awImage::drawError("Class GDGradientDriver: This gradient is not supported by polygons."); + } + + } + + protected function rectangleLinearGradient(awLinearGradient $gradient, awPoint $p1, awPoint $p2) { + + list($x1, $y1) = $p1->getLocation(); + list($x2, $y2) = $p2->getLocation(); + + if($y1 - $y2 > 0) { + + if($gradient->angle === 0) { + + $this->init($gradient, $y1 - $y2); + + for($i = $y2; $i <= $y1; $i++) { + + $color = $this->color($i - $y2); + + $p1 = new awPoint($x1, $i); + $p2 = new awPoint($x2, $i); + + $this->driver->filledRectangle($color, new awLine($p1, $p2)); + + unset($color); + + } + + } else if($gradient->angle === 90) { + + $this->init($gradient, $x2 - $x1); + + for($i = $x1; $i <= $x2; $i++) { + + $color = $this->color($i - $x1); + + $p1 = new awPoint($i, $y2); + $p2 = new awPoint($i, $y1); + + $this->driver->filledRectangle($color, new awLine($p1, $p2)); + + unset($color); + + } + + } + + } + + } + + public function filledEllipse(awGradient $gradient, $x1, $y1, $x2, $y2) { + + if($y1 < $y2) { + $y1 ^= $y2 ^= $y1 ^= $y2; + } + + if($x2 < $x1) { + $x1 ^= $x2 ^= $x1 ^= $x2; + } + + if($gradient instanceof awRadialGradient) { + $this->ellipseRadialGradient($gradient, $x1, $y1, $x2, $y2); + } else if($gradient instanceof awLinearGradient) { + $this->ellipseLinearGradient($gradient, $x1, $y1, $x2, $y2); + } else { + awImage::drawError("Class GDGradientDriver: This gradient is not supported by ellipses."); + } + + } + + protected function ellipseRadialGradient(awGradient $gradient, $x1, $y1, $x2, $y2) { + + if($y1 - $y2 > 0) { + + if($y1 - $y2 != $x2 - $x1) { + awImage::drawError("Class GDGradientDriver: Radial gradients are only implemented on circle, not ellipses."); + } + + $c = new awPoint($x1 + ($x2 - $x1) / 2, $y1 + ($y2 - $y1) / 2); + $r = ($x2 - $x1) / 2; + $ok = array(); + + // Init gradient + $this->init($gradient, $r); + + for($i = 0; $i <= $r; $i += 0.45) { + + $p = ceil((2 * M_PI * $i)); + + if($p > 0) { + $interval = 360 / $p; + } else { + $interval = 360; + } + + $color = $this->color($i); + + for($j = 0; $j < 360; $j += $interval) { + + $rad = ($j / 360) * (2 * M_PI); + + $x = round($i * cos($rad)); + $y = round($i * sin($rad)); + + $l = sqrt($x * $x + $y * $y); + + if($l <= $r) { + + if( + array_key_exists((int)$x, $ok) === FALSE or + array_key_exists((int)$y, $ok[$x]) === FALSE + ) { + + // Print the point + $this->driver->point($color, new awPoint($c->x + $x, $c->y + $y)); + + $ok[(int)$x][(int)$y] = TRUE; + + } + + } + + } + + unset($color); + + } + + } + + } + + protected function ellipseLinearGradient(awGradient $gradient, $x1, $y1, $x2, $y2) { + + // Gauche->droite : 90° + + if($y1 - $y2 > 0) { + + if($y1 - $y2 != $x2 - $x1) { + awImage::drawError("Class GDGradientDriver: Linear gradients are only implemented on circle, not ellipses."); + } + + $r = ($x2 - $x1) / 2; + + // Init gradient + $this->init($gradient, $x2 - $x1); + + for($i = -$r; $i <= $r; $i++) { + + $h = sin(acos($i / $r)) * $r; + + $color = $this->color($i + $r); + + if($gradient->angle === 90) { + + // Print the line + $p1 = new awPoint( + $x1 + $i + $r, + round(max($y2 + $r - $h + 1, $y2)) + ); + + $p2 = new awPoint( + $x1 + $i + $r, + round(min($y1 - $r + $h - 1, $y1)) + ); + + } else { + + // Print the line + $p1 = new awPoint( + round(max($x1 + $r - $h + 1, $x1)), + $y2 + $i + $r + ); + + $p2 = new awPoint( + round(min($x2 - $r + $h - 1, $x2)), + $y2 + $i + $r + ); + + } + + $this->driver->filledRectangle($color, new awLine($p1, $p2)); + + unset($color); + + } + + } + + } + + protected function polygonLinearGradient(awLinearGradient $gradient, awPolygon $polygon) { + + $count = $polygon->count(); + + if($count >= 4) { + + $left = $polygon->get(0); + $right = $polygon->get($count - 1); + + if($gradient->angle === 0) { + + // Get polygon maximum and minimum + $offset = $polygon->get(0); + $max = $min = $offset->y; + for($i = 1; $i < $count - 1; $i++) { + $offset = $polygon->get($i); + $max = max($max, $offset->y); + $min = min($min, $offset->y); + } + + $this->init($gradient, $max - $min); + + $prev = $polygon->get(1); + + $sum = 0; + + for($i = 2; $i < $count - 1; $i++) { + + $current = $polygon->get($i); + + $interval = 1; + + if($i !== $count - 2) { + $current->x -= $interval; + } + + if($current->x - $prev->x > 0) { + + // Draw rectangle + $x1 = $prev->x; + $x2 = $current->x; + $y1 = max($prev->y, $current->y); + $y2 = $left->y; + + $gradient = new awLinearGradient( + $this->color($max - $min - ($y2 - $y1)), + $this->color($max - $min), + 0 + ); + + if($y1 > $y2) { + $y2 = $y1; + } + + $this->driver->filledRectangle( + $gradient, + awLine::build($x1, $y1, $x2, $y2) + ); + + $top = ($prev->y < $current->y) ? $current : $prev; + $bottom = ($prev->y >= $current->y) ? $current : $prev; + + $gradient = new awLinearGradient( + $this->color($bottom->y - $min), + $this->color($max - $min - ($y2 - $y1)), + 0 + ); + + + $gradientDriver = new awGDGradientDriver($this->driver); + $gradientDriver->drawFilledFlatTriangle( + $gradient, + new awPoint($prev->x, min($prev->y, $current->y)), + $top, + new awPoint($current->x, min($prev->y, $current->y)) + ); + unset($gradientDriver); + + $sum += $current->x - $prev->x; + + } + + $prev = $current; + $prev->x += $interval; + + } + + } else if($gradient->angle === 90) { + + $width = $right->x - $left->x; + $this->init($gradient, $width); + + $pos = 1; + $next = $polygon->get($pos++); + + $this->next($polygon, $pos, $prev, $next); + + for($i = 0; $i <= $width; $i++) { + + $x = $left->x + $i; + + $y1 = round($prev->y + ($next->y - $prev->y) * (($i + $left->x - $prev->x) / ($next->x - $prev->x))); + $y2 = $left->y; + + // Draw line + $color = $this->color($i); + // YaPB : PHP does not handle alpha on lines + $this->driver->filledRectangle($color, awLine::build($x, $y1, $x, $y2)); + + unset($color); + + // Jump to next point + if($next->x == $i + $left->x) { + + $this->next($polygon, $pos, $prev, $next); + + } + + } + + } + + } else if($count === 3) { + $this->drawFilledTriangle( + $gradient, + $polygon + ); + } + + } + + private function next($polygon, &$pos, &$prev, &$next) { + + do { + $prev = $next; + $next = $polygon->get($pos++); + } + while($next->x - $prev->x == 0 and $pos < $polygon->count()); + + } + + /** + * Start colors + * + * @var int + */ + private $r1, $g1, $b1, $a1; + + /** + * Stop colors + * + * @var int + */ + private $r2, $g2, $b2, $a2; + + /** + * Gradient size in pixels + * + * @var int + */ + private $size; + + + private function init(awGradient $gradient, $size) { + + list( + $this->r1, $this->g1, $this->b1, $this->a1 + ) = $gradient->from->rgba(); + + list( + $this->r2, $this->g2, $this->b2, $this->a2 + ) = $gradient->to->rgba(); + + $this->size = $size; + } + + private function color($pos) { + + return new awColor( + $this->getRed($pos), + $this->getGreen($pos), + $this->getBlue($pos), + $this->getAlpha($pos) + ); + + } + + + private function getRed($pos) { + if((float)$this->size !== 0.0) { + return (int)round($this->r1 + ($pos / $this->size) * ($this->r2 - $this->r1)); + } else { + return 0; + } + } + + private function getGreen($pos) { + if((float)$this->size !== 0.0) { + return (int)round($this->g1 + ($pos / $this->size) * ($this->g2 - $this->g1)); + } else { + return 0; + } + } + + private function getBlue($pos) { + if((float)$this->size !== 0.0) { + return (int)round($this->b1 + ($pos / $this->size) * ($this->b2 - $this->b1)); + } else { + return 0; + } + } + + private function getAlpha($pos) { + if((float)$this->size !== 0.0) { + return (int)round(($this->a1 + ($pos / $this->size) * ($this->a2 - $this->a1)) / 127 * 100); + } else { + return 0; + } + } + +} + +registerClass('GDGradientDriver'); + +/* + * Check for GD2 + */ +if(function_exists('imagecreatetruecolor') === FALSE) { + awImage::drawErrorFile('missing-gd2'); +} + diff --git a/modules/graphartichow/artichow/inc/drivers/ming.class.php b/modules/graphartichow/artichow/inc/drivers/ming.class.php new file mode 100644 index 000000000..aee0ae7db --- /dev/null +++ b/modules/graphartichow/artichow/inc/drivers/ming.class.php @@ -0,0 +1,773 @@ +driverString = 'ming'; + + // Nice defaults + ming_setScale(20.0); + ming_useswfversion(6); + + } + + /** + * Initialize the driver for a particular awImage object + * + * @param awImage $image + */ + public function init(awImage $image) { + + if($this->movie === NULL) { + $this->setImageSize($image->width, $image->height); + + // Create movie + $this->movie = new SWFMovie(); + if(!$this->movie) { + awImage::drawError("Class Image: Unable to create a graph."); + } + + $this->movie->setDimension($image->width, $image->height); + + $this->setAntiAliasing($image->getAntiAliasing()); + + // Original color + $this->filledRectangle( + new awWhite, + new awLine( + new awPoint(0, 0), + new awPoint($this->imageWidth, $this->imageHeight) + ) + ); + + $shadow = $image->shadow; + if($shadow !== NULL) { + $shadow = $shadow->getSpace(); + $p1 = new awPoint($shadow->left, $shadow->top); + $p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1); + + // Draw image background + $this->filledRectangle($image->getBackground(), new awLine($p1, $p2)); + + // Draw image border + $image->border->rectangle($this, $p1, $p2); + } + } + } + + /** + * Initialize the Driver for a particular FileImage object + * + * @param awFileImage $fileImage The FileImage object to work on + * @param string $file Image filename + */ + public function initFromFile(awFileImage $fileImage, $file) { + + } + + /** + * Change the image size + * + * @param int $width Image width + * @param int $height Image height + */ + public function setImageSize($width, $height) { + $this->imageWidth = $width; + $this->imageHeight = $height; + } + + /** + * Inform the driver of the position of your image + * + * @param float $x Position on X axis of the center of the component + * @param float $y Position on Y axis of the center of the component + */ + public function setPosition($x, $y) { + // Calculate absolute position + $this->x = round($x * $this->imageWidth - $this->w / 2); + $this->y = round($y * $this->imageHeight - $this->h / 2); + } + + /** + * Inform the driver of the position of your image + * This method need absolutes values + * + * @param int $x Left-top corner X position + * @param int $y Left-top corner Y position + */ + public function setAbsPosition($x, $y) { + $this->x = $x; + $this->y = $y; + } + + /** + * Move the position of the image + * + * @param int $x Add this value to X axis + * @param int $y Add this value to Y axis + */ + public function movePosition($x, $y) { + $this->x += (int)$x; + $this->y += (int)$y; + } + + /** + * Inform the driver of the size of your image + * Height and width must be between 0 and 1. + * + * @param int $w Image width + * @param int $h Image height + * @return array Absolute width and height of the image + */ + public function setSize($w, $h) { + + // Calcul absolute size + $this->w = round($w * $this->imageWidth); + $this->h = round($h * $this->imageHeight); + + return $this->getSize(); + + } + + /** + * Inform the driver of the size of your image + * You can set absolute size with this method. + * + * @param int $w Image width + * @param int $h Image height + */ + public function setAbsSize($w, $h) { + $this->w = $w; + $this->h = $h; + + return $this->getSize(); + } + + /** + * Get the size of the component handled by the driver + * + * @return array Absolute width and height of the component + */ + public function getSize() { + return array($this->w, $this->h); + } + + /** + * Turn antialiasing on or off + * + * @var bool $bool + */ + public function setAntiAliasing($bool) { + if($this->movie !== NULL) { + + $actionscript = ' + _quality = "%s"; + '; + + if((bool)$bool) { + $actionscript = sprintf($actionscript, 'high'); + } else { + $actionscript = sprintf($actionscript, 'low'); + } + + $this->movie->add(new SWFAction(str_replace("\r", "", $actionscript))); + } + } + + /** + * When passed a Color object, returns the corresponding + * color identifier (driver dependant). + * + * @param awColor $color A Color object + * @return array $rgba A color identifier representing the color composed of the given RGB components + */ + public function getColor(awColor $color) { + + // Ming simply works with R, G, B and Alpha values. + list($red, $green, $blue, $alpha) = $color->rgba(); + + // However, the Ming alpha channel ranges from 255 (opaque) to 0 (transparent), + // while the awColor alpha channel ranges from 0 (opaque) to 100 (transparent). + // First, we convert from 0-100 to 0-255. + $alpha = (int)($alpha * 255 / 100); + + // Then from 0-255 to 255-0. + $alpha = abs($alpha - 255); + + return array($red, $green, $blue, $alpha); + } + + /** + * Draw an image here + * + * @param awImage $image Image + * @param int $p1 Image top-left point + * @param int $p2 Image bottom-right point + */ + public function copyImage(awImage $image, awPoint $p1, awPoint $p2) { + + } + + /** + * Draw an image here + * + * @param awImage $image Image + * @param int $d1 Destination top-left position + * @param int $d2 Destination bottom-right position + * @param int $s1 Source top-left position + * @param int $s2 Source bottom-right position + * @param bool $resample Resample image ? (default to TRUE) + */ + public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE) { + + } + + /** + * Draw a string + * + * @var awText $text Text to print + * @param awPoint $point Draw the text at this point + * @param int $width Text max width + */ + public function string(awText $text, awPoint $point, $width = NULL) { + $font = $text->getFont(); + + // Can we deal with that font? + if($this->isCompatibleWithFont($font) === FALSE) { + awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')'); + } + + // Ming can only work with awFileFont objects for now + // (i.e. awFDBFont, or awTuffy et al.) + $fontDriver = $this->fileFontDriver; + + if($text->getBackground() !== NULL or $text->border->visible()) { + + list($left, $right, $top, $bottom) = $text->getPadding(); + + $textWidth = $fontDriver->getTextWidth($text, $this); + $textHeight = $fontDriver->getTextHeight($text, $this); + + $x1 = floor($point->x - $left); + $y1 = floor($point->y - $top); + $x2 = $x1 + $textWidth + $left + $right; + $y2 = $y1 + $textHeight + $top + $bottom; + + $this->filledRectangle( + $text->getBackground(), + awLine::build($x1, $y1, $x2, $y2) + ); + + $text->border->rectangle( + $this, + new awPoint($x1 - 1, $y1 - 1), + new awPoint($x2 + 1, $y2 + 1) + ); + + } + + $fontDriver->string($this, $text, $point, $width); + } + + /** + * Draw a pixel + * + * @param awColor $color Pixel color + * @param awPoint $p + */ + public function point(awColor $color, awPoint $p) { + if($p->isHidden() === FALSE) { + list($red, $green, $blue, $alpha) = $this->getColor($color); + + $point = new SWFShape(); + $point->setLine(1, $red, $green, $blue, $alpha); + $point->movePenTo($this->x + round($p->x), $this->y + round($p->y)); + $point->drawLine(0.5, 0.5); + $point->movePen(-0.5, 0); + $point->drawLine(0.5, -0.5); + + $this->movie->add($point); + } + } + + /** + * Draw a colored line + * + * @param awColor $color Line color + * @param awLine $line + * @param int $thickness Line tickness + */ + public function line(awColor $color, awLine $line) { + if($line->getThickness() > 0 and $line->isHidden() === FALSE) { + + list($red, $green, $blue, $alpha) = $this->getColor($color); + + $mingLine = new SWFShape(); + $mingLine->setLine($line->getThickness(), $red, $green, $blue, $alpha); + + list($p1, $p2) = $line->getLocation(); + + $mingLine->movePenTo($this->x + round($p1->x), $this->y + round($p1->y)); + + switch($line->getStyle()) { + + case awLine::SOLID : + $mingLine->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y)); + $this->movie->add($mingLine); + break; + + case awLine::DOTTED : + $size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2)); + $cos = ($p2->x - $p1->x) / $size; + $sin = ($p2->y - $p1->y) / $size; + + for($i = 0; $i <= $size; $i += 2) { + $p = new awPoint( + round($i * $cos + $p1->x), + round($i * $sin + $p1->y) + ); + $this->point($color, $p); + } + + break; + + case awLine::DASHED : + $width = $p2->x - $p1->x; + $height = $p2->y - $p1->y; + $size = sqrt(pow($height, 2) + pow($width, 2)); + + if($size == 0) { + return; + } + + $cos = $width / $size; + $sin = $height / $size; + + $functionX = ($width > 0) ? 'min' : 'max'; + $functionY = ($height > 0) ? 'min' : 'max'; + + for($i = 0; $i <= $size; $i += 6) { + + $t1 = new awPoint( + round($i * $cos + $p1->x), + round($i * $sin + $p1->y) + ); + + $t2 = new awPoint( + round($functionX(($i + 3) * $cos, $width) + $p1->x), + round($functionY(($i + 3) * $sin, $height) + $p1->y) + ); + + $this->line($color, new awLine($t1, $t2)); + + } + + break; + + } + + } + + } + + /** + * Draw a color arc + + * @param awColor $color Arc color + * @param awPoint $center Point center + * @param int $width Ellipse width + * @param int $height Ellipse height + * @param int $from Start angle + * @param int $to End angle + */ + public function arc(awColor $color, awPoint $center, $width, $height, $from, $to) { + + } + + /** + * Draw an arc with a background color + * + * @param awColor $color Arc background color + * @param awPoint $center Point center + * @param int $width Ellipse width + * @param int $height Ellipse height + * @param int $from Start angle + * @param int $to End angle + */ + public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to) { + + } + + /** + * Draw a colored ellipse + * + * @param awColor $color Ellipse color + * @param awPoint $center Ellipse center + * @param int $width Ellipse width + * @param int $height Ellipse height + */ + public function ellipse(awColor $color, awPoint $center, $width, $height) { + + } + + /** + * Draw an ellipse with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param awPoint $center Ellipse center + * @param int $width Ellipse width + * @param int $height Ellipse height + */ + public function filledEllipse($background, awPoint $center, $width, $height) { + + } + + /** + * Draw a colored rectangle + * + * @param awColor $color Rectangle color + * @param awLine $line Rectangle diagonale + * @param awPoint $p2 + */ + public function rectangle(awColor $color, awLine $line) { + list($p1, $p2) = $line->getLocation(); + + // Get Red, Green, Blue and Alpha values for the line + list($r, $g, $b, $a) = $this->getColor($color); + + // Calculate the coordinates of the two other points of the rectangle + $p3 = new Point($p1->x, $p2->y); + $p4 = new Point($p2->x, $p1->y); + + + $side = clone $line; + + + + // Draw the four sides of the rectangle, clockwise + if( + ($p1->x <= $p2->x and $p1->y <= $p2->y) + or + ($p1->x >= $p2->x and $p1->y >= $p2->y) + ) { + $side->setLocation($p1, $p4); + $this->line($color, $side); + + $side->setLocation($p4, $p2); + $this->line($color, $side); + + $side->setLocation($p2, $p3); + $this->line($color, $side); + + $side->setLocation($p3, $p1); + $this->line($color, $side); + } else { + $side->setLocation($p1, $p3); + $this->line($color, $side); + + $side->setLocation($p3, $p2); + $this->line($color, $side); + + $side->setLocation($p2, $p4); + $this->line($color, $side); + + $side->setLocation($p4, $p1); + $this->line($color, $side); + } + } + + /** + * Draw a rectangle with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param awLine $line Rectangle diagonale + */ + public function filledRectangle($background, awLine $line) { + list($p1, $p2) = $line->getLocation(); + + // Common shape settings + $shape = new SWFShape(); + $shape->setLine(0); + + if($background instanceof awColor) { + + // Get the Red, Green, Blue and Alpha values + list($r, $g, $b, $a) = $this->getColor($background); + $shape->setRightFill($r, $g, $b, $a); + + } else if($background instanceof awGradient) { + + // Get the Gradient object as an SWFGradient one + list($flashGradient, $style) = $this->getGradient($background); + + $fill = $shape->addFill($flashGradient, $style); + + // Angles between Artichow and Ming don't match. + // Don't use abs() or vertical gradients get inverted. + $angle = $background->angle - 90; + $fill->rotateTo($angle); + + // Move the gradient based on the position of the rectangle we're drawing + $centerX = min($p1->x, $p2->y) + abs($p1->x - $p2->x) / 2; + $centerY = min($p1->y, $p2->y) + abs($p1->y - $p2->y) / 2; + $fill->moveTo($centerX, $centerY); + + // Ming draws its gradients on a 1600x1600 image, + // so we have to resize it. + if($angle === -90) { + $ratio = abs($p1->y - $p2->y) / 1600; + } else { + $ratio = abs($p1->x - $p2->x) / 1600; + } + $fill->scaleTo($ratio); + + $shape->setRightFill($fill); + + } + + // Set starting position + $shape->movePenTo($this->x + round($p1->x), $this->y + round($p1->y)); + + // Depending on the points' relative positions, + // we have two drawing possibilities + if( + ($p1->x <= $p2->x and $p1->y <= $p2->y) + or + ($p1->x >= $p2->x and $p1->y >= $p2->y) + ) { + $shape->drawLineTo($this->x + round($p2->x), $this->y + round($p1->y)); + $shape->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y)); + $shape->drawLineTo($this->x + round($p1->x), $this->y + round($p2->y)); + $shape->drawLineTo($this->x + round($p1->x), $this->y + round($p1->y)); + } else { + $shape->drawLineTo($this->x + round($p1->x), $this->y + round($p2->y)); + $shape->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y)); + $shape->drawLineTo($this->x + round($p2->x), $this->y + round($p1->y)); + $shape->drawLineTo($this->x + round($p1->x), $this->y + round($p1->y)); + } + + $this->movie->add($shape); + } + + /** + * Draw a polygon + * + * @param awColor $color Polygon color + * @param Polygon A polygon + */ + public function polygon(awColor $color, awPolygon $polygon) { + $points = $polygon->all(); + $count = count($points); + + if($count > 1) { + + $side = new awLine; + $side->setStyle($polygon->getStyle()); + $side->setThickness($polygon->getThickness()); + + $prev = $points[0]; + + for($i = 1; $i < $count; $i++) { + $current = $points[$i]; + $side->setLocation($prev, $current); + $this->line($color, $side); + $prev = $current; + } + + // Close the polygon + $side->setLocation($prev, $points[0]); + $this->line($color, $side); + } + } + + /** + * Draw a polygon with a background + * + * @param mixed $background Background (can be a color or a gradient) + * @param Polygon A polygon + */ + public function filledPolygon($background, awPolygon $polygon) { + $shape = new SWFShape(); + + if($background instanceof awColor) { + list($red, $green, $blue, $alpha) = $this->getColor($background); + + $shape->setRightFill($red, $green, $blue, $alpha); + } elseif($background instanceof awGradient) { + list($flashGradient, $style) = $this->getGradient($background); + + $fill = $shape->addFill($flashGradient, $style); + + list($xMin, $xMax) = $polygon->getBoxXRange(); + list($yMin, $yMax) = $polygon->getBoxYRange(); + + if($background->angle === 0) { + $fill->scaleTo(($yMax - $yMin) / 1600); + } else { + $fill->scaleTo(($xMax - $xMin) / 1600); + } + $fill->moveTo($xMin + ($xMax - $xMin) / 2, $yMin + ($yMax - $yMin) / 2); + + $shape->setRightFill($fill); + } + + $points = $polygon->all(); + $count = count($points); + + if($count > 1) { + + $prev = $points[0]; + + $shape->movePenTo($prev->x, $prev->y); + + for($i = 1; $i < $count; $i++) { + $current = $points[$i]; + $shape->drawLineTo($current->x, $current->y); + } + + // Close the polygon + $shape->drawLineTo($prev->x, $prev->y); + + $this->movie->add($shape); + + } + } + + /** + * Sends the image, as well as the correct HTTP headers, to the browser + * + * @param awImage $image The Image object to send + */ + public function send(awImage $image) { + $this->drawImage($image); + } + + /** + * Get the image as binary data + * + * @param awImage $image + */ + public function get(awImage $image) { + return $this->drawImage($image, TRUE, FALSE); + } + + public function getTextWidth(awText $text) { + $font = $text->getFont(); + if($this->isCompatibleWithFont($font) === FALSE) { + awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')'); + } + + // Ming only supports FileFont + $fontDriver = $this->fileFontDriver; + + return $fontDriver->getTextWidth($text, $this); + } + + public function getTextHeight(awText $text) { + $font = $text->getFont(); + if($this->isCompatibleWithFont($font) === FALSE) { + awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')'); + } + + // Ming only supports FileFont + $fontDriver = $this->fileFontDriver; + + return $fontDriver->getTextHeight($text, $this); + } + + protected function isCompatibleWithFont(awFont $font) { + if($font instanceof awTTFFont or $font instanceof awPHPFont) { + return FALSE; + } else { + return TRUE; + } + } + + private function drawImage(awImage $image, $return = FALSE, $header = TRUE) { + + // Send headers to the browser + if($header === TRUE) { + $image->sendHeaders(); + } + + if($return) { + ob_start(); + } + + $this->movie->output(); + + if($return) { + return ob_get_clean(); + } + } + + /** + * Convert an awGradient object to an SWFGradient one. + * Returns an object as well as the style of the Flash gradient. + * + * @param awGradient $gradient The awGradient object to convert + * @return array + */ + private function getGradient(awGradient $gradient) { + $flashGradient = new SWFGradient(); + + // Get RGBA values for the gradient boundaries + list($r1, $g1, $b1, $a1) = $this->getColor($gradient->from); + list($r2, $g2, $b2, $a2) = $this->getColor($gradient->to); + + $flashGradient->addEntry(0, $r1, $g1, $b1, $a1); + + if($gradient instanceof awBilinearGradient) { + + $flashGradient->addEntry($gradient->center, $r2, $g2, $b2, $a2); + $flashGradient->addEntry(1, $r1, $g1, $b1, $a1); + + return array($flashGradient, SWFFILL_LINEAR_GRADIENT); + } else { + + $flashGradient->addEntry(1, $r2, $g2, $b2, $a2); + + if($gradient instanceof awLinearGradient) { + return array($flashGradient, SWFFILL_LINEAR_GRADIENT); + } else { + return array($flashGradient, SWFFILL_RADIAL_GRADIENT); + } + } + } +// abstract private function getPolygonPoints(awPolygon $polygon); + +} + +registerClass('MingDriver'); + +/* + * Check for ming presence + */ +if(function_exists('ming_useswfversion') === FALSE) { + awImage::drawErrorFile('missing-ming'); +} + diff --git a/modules/graphartichow/artichow/patterns/BarDepth.php b/modules/graphartichow/artichow/patterns/BarDepth.php new file mode 100644 index 000000000..eaf822f4b --- /dev/null +++ b/modules/graphartichow/artichow/patterns/BarDepth.php @@ -0,0 +1,84 @@ +barShadow->setSize(2); + $plot->barShadow->smooth(TRUE); + $plot->barShadow->setColor(new Color(160, 160, 160, 10)); + + return $plot; + + } + + public function create() { + + $group = new PlotGroup; + $group->setSpace(2, 2, 2, 0); + $group->setPadding(30, 10, NULL, NULL); + + $group->grid->hideVertical(TRUE); + $group->grid->setType(Line::DASHED); + + $yForeground = $this->getArg('yForeground'); + $yBackground = $this->getArg('yBackground'); + + $legendForeground = $this->getArg('legendForeground'); + $legendBackground = $this->getArg('legendBackground'); + + $colorForeground = $this->getArg('colorForeground', new LightBlue(10)); + $colorBackground = $this->getArg('colorBackground', new Orange(25)); + + if($yForeground === NULL) { + awImage::drawError("Class BarDepthPattern: Argument 'yForeground' must not be NULL."); + } + + // Background + if($yBackground !== NULL) { + + $plot = $this->getPlot($yBackground, 6); + $plot->setBarColor($colorBackground); + + $group->add($plot); + if($legendBackground !== NULL) { + $group->legend->add($plot, $legendBackground, Legend::BACKGROUND); + } + + } + + // Foreground + $plot = $this->getPlot($yForeground, 0); + $plot->setBarColor($colorForeground); + + $group->add($plot); + if($legendForeground !== NULL) { + $group->legend->add($plot, $legendForeground, Legend::BACKGROUND); + } + + $group->axis->bottom->hideTicks(TRUE); + + $group->legend->shadow->setSize(0); + $group->legend->setAlign(Legend::CENTER); + $group->legend->setSpace(6); + $group->legend->setTextFont(new Tuffy(8)); + $group->legend->setPosition(0.50, 0.10); + $group->legend->setBackgroundColor(new Color(255, 255, 255, 10)); + $group->legend->setColumns(2); + + return $group; + + } + +} diff --git a/modules/graphartichow/artichow/patterns/LightLine.php b/modules/graphartichow/artichow/patterns/LightLine.php new file mode 100644 index 000000000..156d9aa66 --- /dev/null +++ b/modules/graphartichow/artichow/patterns/LightLine.php @@ -0,0 +1,49 @@ +getArg('legend'); + + $y = $this->getArg('y'); + + if($y === NULL) { + awImage::drawError("Class LightLinePattern: Argument 'y' must not be NULL."); + } + + $plot = new LinePlot($y); + $plot->setSize(0.7, 1); + $plot->setCenter(0.35, 0.5); + $plot->setPadding(35, 15, 35, 30); + $plot->setColor(new Orange()); + $plot->setFillColor(new LightOrange(80)); + + $plot->grid->setType(Line::DASHED); + + $plot->mark->setType(Mark::CIRCLE); + $plot->mark->setFill(new MidRed); + $plot->mark->setSize(6); + + $plot->legend->setPosition(1, 0.5); + $plot->legend->setAlign(Legend::LEFT); + $plot->legend->shadow->smooth(TRUE); + + if($legend !== NULL) { + $plot->legend->add($plot, $legend, Legend::MARK); + } + + return $plot; + + } + +} diff --git a/modules/graphartichow/config.xml b/modules/graphartichow/config.xml new file mode 100755 index 000000000..a1e9b38b4 --- /dev/null +++ b/modules/graphartichow/config.xml @@ -0,0 +1,11 @@ + + + graphartichow + Artichow + 1 + Artichow is a library which enables the display of simple picture-based graphs using PHP and GD. + PrestaShop + administration + 0 + 1 + \ No newline at end of file diff --git a/modules/graphartichow/de.php b/modules/graphartichow/de.php new file mode 100644 index 000000000..00371bea2 --- /dev/null +++ b/modules/graphartichow/de.php @@ -0,0 +1,6 @@ +graphartichow_6b1e6241446c46f7ab8d28ae83d53e71'] = 'Artichow'; +$_MODULE['<{graphartichow}prestashop>graphartichow_83196a03f22b50fec58a7fd9507b378a'] = 'Artichow ist eine Bibliothek, die die Anzeige von einfachen Bild-basierten Grafiken mit PHP und GD ermöglicht.'; diff --git a/modules/graphartichow/en.php b/modules/graphartichow/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/graphartichow/en.php @@ -0,0 +1,4 @@ +graphartichow_6b1e6241446c46f7ab8d28ae83d53e71'] = 'Artichow'; +$_MODULE['<{graphartichow}prestashop>graphartichow_83196a03f22b50fec58a7fd9507b378a'] = 'Artichow es una biblioteca que permite mostrar simples gráficos cuadro-base usando el PHP y GD.'; diff --git a/modules/graphartichow/fr.php b/modules/graphartichow/fr.php new file mode 100644 index 000000000..de042a075 --- /dev/null +++ b/modules/graphartichow/fr.php @@ -0,0 +1,6 @@ +graphartichow_6b1e6241446c46f7ab8d28ae83d53e71'] = 'Artichow'; +$_MODULE['<{graphartichow}prestashop>graphartichow_83196a03f22b50fec58a7fd9507b378a'] = 'Artichow est une librairie qui permet d\'afficher des graphiques simples basés sur des images utilisant PHP et GD.'; diff --git a/modules/graphartichow/graphartichow.php b/modules/graphartichow/graphartichow.php new file mode 100644 index 000000000..3e706bb00 --- /dev/null +++ b/modules/graphartichow/graphartichow.php @@ -0,0 +1,369 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GraphArtichow extends ModuleGraphEngine +{ + private $_graph; + private $_plot = array(); //for simple-layer graphics + private $_group = NULL; //for multi-layer graphics + private $_error = 0; + + function __construct($type = null) + { + if ($type != null) + { + require_once(dirname(__FILE__).'/artichow/Graph.class.php'); + $this->_graph = new Graph(); + $this->_graph->setAntiAliasing(function_exists('imageantialias')); + parent::__construct($type); + } + else + { + $this->name = 'graphartichow'; + $this->tab = 'administration'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + Module::__construct(); + + $this->displayName = $this->l('Artichow'); + $this->description = $this->l('Artichow is a library which enables the display of simple picture-based graphs using PHP and GD.'); + } + } + + function install() + { + return (parent::install() AND $this->registerHook('GraphEngine')); + } + + public static function hookGraphEngine($params, $drawer) + { + return ''; + } + + private function drawLine($values) + { + require_once(dirname(__FILE__).'/artichow/LinePlot.class.php'); + // Single layer + if (!isset($values[0]) OR !is_array($values[0])) + { + $this->_plot = new LinePlot(array_values($values)); + $this->_plot->setFillGradient(new LinearGradient(new Color(255, 246, 211, 20), new Color(240, 225, 160, 50), 90)); + $this->_plot->setColor(new Color(80, 50, 0, 0)); + } + // Multiple layers + else + { + $tabColors = array(new Color(120, 120, 30, 10), new Color(66, 127, 195, 10), new Color(195, 65, 60, 10), new Color(85, 163, 57, 10), new Color(255, 35, 152, 10)); + $tabFilledColors = array(new Color(120, 120, 30, 90), new Color(66, 127, 195, 90), new Color(195, 65, 60, 90), new Color(85, 163, 57, 90), new Color(255, 35, 152, 90)); + + $this->_group = new PlotGroup; + $i = 0; + foreach ($values as $val) + { + $this->_plot[$i] = new LinePlot(array_values($val)); + $this->_plot[$i]->setColor($tabColors[$i % 5]); + $this->_plot[$i]->setFillColor($tabFilledColors[$i % 5]); + $this->_group->add($this->_plot[$i]); + $i++; + } + } + } + + private function drawColumn($values) + { + require_once(dirname(__FILE__).'/artichow/BarPlot.class.php'); + + if (!is_array($values[0])) //simpleline + { + $this->_plot = new BarPlot(array_values($values)); + $this->_plot->label->set(array_values($values)); + $this->_plot->label->setColor(new Color(110, 110, 110)); + $this->_plot->label->move(0, -7); + $this->_plot->label->setAlign(Positionable::CENTER, NULL); + $this->_plot->setBarGradient(new LinearGradient(new Color(254, 255, 216), new Color(233, 231, 218), 90)); + $this->_plot->barBorder->setColor(new Color(115, 115, 150)); + $this->_plot->barShadow->setSize(1); + $this->_plot->barShadow->setColor(new Color(215, 215, 215)); + $this->_plot->barShadow->setPosition(Shadow::RIGHT_TOP); + $this->_plot->barShadow->smooth(TRUE); + } + else + { + $tabColors = array(new Color(120, 120, 30, 10), new Color(66, 127, 195, 10), new Color(195, 65, 60, 10), new Color(85, 163, 57, 10), new Color(255, 35, 152, 10)); + $tabFilledColors = array(new Color(120, 120, 30, 90), new Color(66, 127, 195, 90), new Color(195, 65, 60, 90), new Color(85, 163, 57, 90), new Color(255, 35, 152, 90)); + + $this->_group = new PlotGroup; + $i = 0; + foreach ($values as $val) + { + $this->_plot[$i] = new BarPlot(array_values($val)); + $this->_plot[$i]->label->set(array_values($val)); + $this->_plot[$i]->label->setColor($tabColors[$i % 5]); + $this->_plot[$i]->label->move(0, -7); + $this->_plot[$i]->label->setAlign(Positionable::CENTER, NULL); + $this->_plot[$i]->setBarColor($tabFilledColors[$i % 5]); + $this->_plot[$i]->barBorder->setColor($tabColors[$i % 5]); + $this->_plot[$i]->barShadow->setSize(1); + $this->_plot[$i]->barShadow->setColor(new Color(215, 215, 215)); + $this->_plot[$i]->barShadow->setPosition(Shadow::RIGHT_TOP); + $this->_plot[$i]->barShadow->smooth(TRUE); + $this->_group->add($this->_plot[$i]); + $i++; + } + } + } + + private function setErrorImage() + { + require_once(dirname(__FILE__).'/artichow/BarPlot.class.php'); + + $this->_plot = new BarPlot(array(0)); + $this->_type = 'column'; + $this->_plot->setSize(0, 0); + $this->_plot->setCenter(-20, -20); + } + + private function drawPie($values) + { + require_once(dirname(__FILE__).'/artichow/Pie.class.php'); + $exploder = array(); + $counter = sizeof($values); + + $this->_plot = new Pie(array_values($values), Pie::COLORED); + $this->_plot->set3D(10); + $this->_plot->setLabelPrecision(2); + $this->_plot->setLabelPosition(2); + $this->_plot->legend->shadow->setSize(1); + $this->_plot->legend->setModel(Legend::MODEL_BOTTOM); + $this->_plot->legend->setPosition(NULL, 0.87); + $this->_plot->setSize(0.90, 0.90); + for ($i = 0; $i < $counter; $i++) + $exploder[$i] = 8; + $this->_plot->explode($exploder); + } + + private function drawLineColumn($y_max) + { + if ($this->_group == NULL) + { + $this->_plot->setYMax($y_max); + $this->_plot->setSize(1, 1); + $this->_plot->setCenter(0.508, 0.53); + $this->_plot->setPadding(28, 10, NULL, 40); + } + else + { + foreach ($this->_plot as $plot) + $plot->setYMax($y_max); + $this->_group->setYMax($y_max); + $this->_group->setSize(1, 1); + $this->_group->setCenter(0.508, 0.53); + $this->_group->setPadding(28, 10, NULL, 40); + } + } + + public function createValues($values) + { + // $this->_values = array(); + // if (!isset($this->_values[0]) || !is_array($this->_values[0])) + // foreach ($values as $value) + // $this->_values[] = $value; + // else + // { + // foreach ($values as $i => $layerValue) + // { + // $this->_values[$i] = array(); + // foreach ($values[$i] as $value) + // $this->_values[$i][] = $value; + // } + // } + // $values = $this->_values; + + if (sizeof($values) == 0) + { + $this->setErrorImage(); + return; + } + switch ($this->_type) + { + case 'pie': + $this->drawPie($values); + break; + case 'line': + $this->drawLine($values); + $this->drawLineColumn($this->getYMax($values)); + break; + case 'column': + default: + $this->drawColumn($values); + $this->drawLineColumn($this->getYMax($values)); + break; + } + } + + public function setSize($width, $height) + { + if (Validate::isUnsignedInt($width) AND Validate::isUnsignedInt($height)) + $this->_graph->setSize($width, $height); + } + + public function setLegend($legend) + { + $this->_legend = array(); + if (!isset($this->_legend[0]) || !is_array($this->_legend[0])) + foreach ($legend as $label) + $this->_legend[] = $label; + else + { + foreach ($legend as $i => $layerlabel) + { + $this->_legend[$i] = array(); + foreach ($legend[$i] as $label) + $this->_legend[$i][] = $label; + } + } + $legend = $this->_legend; + + if ($this->_plot == NULL && $this->_group == NULL) + return; + foreach ($legend as $k => $val) + $legend[$k] = html_entity_decode(htmlentities(html_entity_decode($val), ENT_NOQUOTES, 'utf-8')); + switch ($this->_type) + { + case 'pie': + $this->_plot->setLegend($legend); + break; + case 'column': + default: + if ($this->_group == NULL) + { + if (isset($this->_plot->xAxis, $this->_plot->yAxis, $this->_plot->grid)) + { + $this->_plot->xAxis->setLabelText($legend); + $this->_plot->xAxis->label->setFont(new Tuffy(7)); + $this->_plot->yAxis->setLabelPrecision(0); + $this->_plot->grid->setType(Line::DASHED); + } + } + else + { + if (isset($this->_group->axis->bottom, $this->_group->axis->left, $this->_group->grid)) + { + $this->_group->axis->bottom->setLabelText($legend); + $this->_group->axis->bottom->label->setFont(new Tuffy(7)); + $this->_group->axis->left->setLabelPrecision(0); + $this->_group->grid->setType(Line::DASHED); + } + } + break; + } + } + + public function setTitles($titles) + { + if ($this->_plot == NULL && $this->_group == NULL) + return; + if (isset($titles['main'])) + { + if (is_array($titles['main']) && $this->_group != NULL) + { + $i = 0; + foreach ($titles['main'] as $key => $val) + if ($key != 0) + $this->_group->legend->add($this->_plot[$i++], $val, ($this->_type == 'line') ? Legend::LINE : Legend::BACKGROUND); + $titles['main'] = $titles['main'][0]; + } + $this->_graph->title->set($titles['main']); + $this->_graph->title->setFont(new Tuffy(10)); + $this->_graph->title->setAlign(Positionable::CENTER, Positionable::MIDDLE); + } + if (isset($titles['x'])) + { + if ($this->_plot != NULL && !is_array($this->_plot)) + { + $this->_plot->xAxis->title->set($titles['x']); + $this->_plot->xAxis->title->setFont(new Tuffy(10)); + $this->_plot->xAxis->setTitleAlignment(Label::RIGHT); + } + else + { + $this->_group->axis->bottom->title->set($titles['x']); + $this->_group->axis->bottom->title->setFont(new Tuffy(10)); + $this->_group->axis->bottom->setTitleAlignment(Label::RIGHT); + } + } + if (isset($titles['y'])) + { + if ($this->_plot != NULL && !is_array($this->_plot)) + { + $this->_plot->yAxis->title->set($titles['y']); + $this->_plot->yAxis->title->setFont(new Tuffy(10)); + $this->_plot->yAxis->setTitleAlignment(Label::TOP); + } + else + { + $this->_group->axis->left->title->set($titles['y']); + $this->_group->axis->left->title->setFont(new Tuffy(10)); + $this->_group->axis->left->setTitleAlignment(Label::TOP); + } + } + } + + public function draw() + { + if ($this->_plot != NULL && !is_array($this->_plot)) + $this->_graph->add($this->_plot); + if ($this->_group != NULL) + $this->_graph->add($this->_group); + $this->_graph->draw(); + } + + private function getYMax($values) + { + $max = 0; + if (isset($values[0]) && is_array($values[0])) + { + foreach ($values as $val) + foreach ($val as $k => $nb) + if ($nb > $max) + $max = $nb; + } + else + { + foreach ($values as $k => $val) + if ($val > $max) + $max = $val; + } + return ($max < 4) ? 4 : (round($max, 0)); + } +} + + diff --git a/modules/graphartichow/it.php b/modules/graphartichow/it.php new file mode 100644 index 000000000..66afd0225 --- /dev/null +++ b/modules/graphartichow/it.php @@ -0,0 +1,6 @@ +graphartichow_6b1e6241446c46f7ab8d28ae83d53e71'] = 'Artichow'; +$_MODULE['<{graphartichow}prestashop>graphartichow_83196a03f22b50fec58a7fd9507b378a'] = 'Artichow è una libreria che permette la visualizzazione di grafici semplici basati su immagini con PHP e GD.'; diff --git a/modules/graphartichow/logo.gif b/modules/graphartichow/logo.gif new file mode 100644 index 000000000..ed937ee8b Binary files /dev/null and b/modules/graphartichow/logo.gif differ diff --git a/modules/graphgooglechart/config.xml b/modules/graphgooglechart/config.xml new file mode 100755 index 000000000..c718a233d --- /dev/null +++ b/modules/graphgooglechart/config.xml @@ -0,0 +1,11 @@ + + + graphgooglechart + Google Chart + 1 + The Google Chart API lets you dynamically generate charts. + PrestaShop + administration + 0 + 1 + \ No newline at end of file diff --git a/modules/graphgooglechart/de.php b/modules/graphgooglechart/de.php new file mode 100644 index 000000000..544c90b1a --- /dev/null +++ b/modules/graphgooglechart/de.php @@ -0,0 +1,6 @@ +graphgooglechart_b3b8abce7e542a30dc415f612d4e0f23'] = 'Google Chart'; +$_MODULE['<{graphgooglechart}prestashop>graphgooglechart_e01118a336bd13f2f0e70bf7178c1fdc'] = 'Mit der Google Chart API können Sie dynamische Charts generieren.'; diff --git a/modules/graphgooglechart/en.php b/modules/graphgooglechart/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/graphgooglechart/en.php @@ -0,0 +1,4 @@ +graphgooglechart_b3b8abce7e542a30dc415f612d4e0f23'] = 'Carta Google '; +$_MODULE['<{graphgooglechart}prestashop>graphgooglechart_e01118a336bd13f2f0e70bf7178c1fdc'] = 'La carta API de Google le permite generar dinámicamente sus cartas.'; diff --git a/modules/graphgooglechart/fr.php b/modules/graphgooglechart/fr.php new file mode 100644 index 000000000..bbf436577 --- /dev/null +++ b/modules/graphgooglechart/fr.php @@ -0,0 +1,6 @@ +graphgooglechart_b3b8abce7e542a30dc415f612d4e0f23'] = 'Google Chart'; +$_MODULE['<{graphgooglechart}prestashop>graphgooglechart_e01118a336bd13f2f0e70bf7178c1fdc'] = 'L\'API Google Chart permet de générer dynamiquement des graphiques.'; diff --git a/modules/graphgooglechart/graphgooglechart.php b/modules/graphgooglechart/graphgooglechart.php new file mode 100644 index 000000000..2c39a0dbf --- /dev/null +++ b/modules/graphgooglechart/graphgooglechart.php @@ -0,0 +1,247 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GraphGoogleChart extends ModuleGraphEngine +{ + private $_width; + private $_height; + private $_values; + private $_legend; + private $_titles; + + function __construct($type = null) + { + if ($type != null) + { + parent::__construct($type); + } + else + { + $this->name = 'graphgooglechart'; + $this->tab = 'administration'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + Module::__construct(); + + $this->displayName = $this->l('Google Chart'); + $this->description = $this->l('The Google Chart API lets you dynamically generate charts.'); + } + } + + function install() + { + return (parent::install() AND $this->registerHook('GraphEngine')); + } + + public static function hookGraphEngine($params, $drawer) + { + return ''; + } + + + public function createValues($values) + { + $this->_values = $values; + } + + public function setSize($width, $height) + { + $this->_width = $width; + $this->_height = $height; + } + + public function setLegend($legend) + { + $this->_legend = $legend; + } + + public function setTitles($titles) + { + $this->_titles = $titles; + } + + private function getChbh($sizeof_values) + { + $chbh = 12; + + if ($sizeof_values < 25) + $chbh += 4; + if ($sizeof_values < 20) + $chbh += 4; + if ($sizeof_values < 15) + $chbh += 8; + if ($sizeof_values < 10) + $chbh += 14; + return ($chbh); + } + + private function drawColumn($max_y) + { + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + $sizeof_values = sizeof($this->_values); + else + $sizeof_values = sizeof($this->_values[0]); + $url = 'bvs&chxt=x,y&chxr=1,0,'.$max_y.'&chbh='.$this->getChbh($sizeof_values).'&chg=0,12.5&chxl=0:|'; + for ($i = 0; $i < $sizeof_values; $i++) + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + { + if (isset($this->_values[$i])) + $this->_values[$i] = ($this->_values[$i] * 100) / $max_y; + else + $this->_values[$i] = 0; + } + else + foreach ($this->_values as $k => $value) + { + if (!isset($this->_values[$k][$i])) + $this->_values[$k][$i] = 0; + $this->_values[$k][$i] = ($this->_values[$k][$i] * 100) / $max_y; + } + return ($url); + } + + private function drawLine($max_y) + { + return ('lc'./*&chxt=x,y*/'&chbh='.$this->getChbh(sizeof($this->_values)).'&chg=0,12.5&chxl=0:|'); + } + + private function drawPie() + { + return ('p3&chl='); + } + + public function draw() + { + $url = 'http://chart.apis.google.com/chart?cht='; + $legend = ''; + $values = ''; + $scale = ''; + + switch ($this->_type) + { + case 'pie': + $url .= $this->drawPie(); + break; + case 'line': + $url .= $this->drawLine($this->getYMax($this->_values)); + case 'column': + default: + $url .= $this->drawColumn($this->getYMax($this->_values)); + break; + } + + foreach ($this->_legend as $label) + $legend .= $label.'|'; + $url .= htmlentities(urlencode(html_entity_decode(rtrim($legend, '|')))); + + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + { + foreach ($this->_values as $label) + $values .= ($label ? $label : '0').','; + $url .= '&chd=t:'.urlencode(rtrim($values, ',')); + } + else + { + $i = 0; + $url .= '&chd=t:'; + foreach ($this->_values as $val) + { + $values = ''; + if ($i++ > 0) + $url .= '|'; + foreach ($val as $label) + $values .= ($label ? $label : '0').','; + $url .= urlencode(rtrim($values, ',')); + } + } + + $url .= '&chs='.(int)($this->_width).'x'.(int)($this->_height); + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + $url .= (isset($this->_titles['main'])) ? '&chtt='.urlencode($this->_titles['main']) : ''; + else + { + $url .= $this->getStringColor(sizeof($this->_values)); + $i = 0; + foreach ($this->_titles['main'] as $val) + { + if ($i == 0 && !empty($this->_titles['main'])) + $url .= '&chtt='.urlencode($this->_titles['main'][$i]); + else if ($i == 1) + $url .= '&chdl='; + else if ($i > 1) + $url .= '|'; + if ($i != 0) + $url .= urlencode($this->_titles['main'][$i]); + $i++; + } + } + header("Content-type: image/png"); + readfile($url); + } + + private function getYMax($values) + { + $max = 0; + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + { + foreach ($values as $k => $val) + if ($val > $max) + $max = $val; + } + else + { + foreach ($values as $value) + foreach ($value as $val) + if ($val > $max) + $max = $val; + } + return ($max < 4) ? 4 : (round($max, 0)); + } + + private function getStringColor($nb_colors) + { + $tabColors = array('ffb649', '427fc3', 'ff0000', '55a339', 'ff2398'); + $color = ''; + if ($nb_colors > 1) + { + $color = '&chco='; + for ($i = 0; $i < $nb_colors; $i++) + { + if ($i > 0) + $color .= ','; + $color .= $tabColors[$i % 5]; + } + } + return $color; + } +} + + diff --git a/modules/graphgooglechart/it.php b/modules/graphgooglechart/it.php new file mode 100644 index 000000000..15f629770 --- /dev/null +++ b/modules/graphgooglechart/it.php @@ -0,0 +1,6 @@ +graphgooglechart_b3b8abce7e542a30dc415f612d4e0f23'] = 'Google Chart'; +$_MODULE['<{graphgooglechart}prestashop>graphgooglechart_e01118a336bd13f2f0e70bf7178c1fdc'] = 'Google Chart API permette di generare dinamicamente grafici.'; diff --git a/modules/graphgooglechart/logo.gif b/modules/graphgooglechart/logo.gif new file mode 100644 index 000000000..4f5d64543 Binary files /dev/null and b/modules/graphgooglechart/logo.gif differ diff --git a/modules/graphvisifire/config.xml b/modules/graphvisifire/config.xml new file mode 100755 index 000000000..3c9e9ff89 --- /dev/null +++ b/modules/graphvisifire/config.xml @@ -0,0 +1,11 @@ + + + graphvisifire + Visifire + 1 + Visifire is a set of open source data visualization components - powered by Microsoft Silverlight 2 beta 2. + PrestaShop + administration + 0 + 1 + \ No newline at end of file diff --git a/modules/graphvisifire/de.php b/modules/graphvisifire/de.php new file mode 100644 index 000000000..c420086b6 --- /dev/null +++ b/modules/graphvisifire/de.php @@ -0,0 +1,6 @@ +graphvisifire_46495d329b07c973daa82a7a9c084d6b'] = 'Visifire'; +$_MODULE['<{graphvisifire}prestashop>graphvisifire_9c3adc09754ac25e4ed1da6176c0e74c'] = 'Visifire ist eine Reihe von Open-Source-Komponenten zur Datenvisualisierung - powered by Microsoft Silverlight 2 Beta 2.'; diff --git a/modules/graphvisifire/en.php b/modules/graphvisifire/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/graphvisifire/en.php @@ -0,0 +1,4 @@ +graphvisifire_46495d329b07c973daa82a7a9c084d6b'] = 'Visifire'; +$_MODULE['<{graphvisifire}prestashop>graphvisifire_9c3adc09754ac25e4ed1da6176c0e74c'] = 'Visifire es un conjunto de datos de código abierto componentes de visualización - Powered by Microsoft Silverlight 2 beta 2.'; diff --git a/modules/graphvisifire/fr.php b/modules/graphvisifire/fr.php new file mode 100644 index 000000000..0d4e40bc9 --- /dev/null +++ b/modules/graphvisifire/fr.php @@ -0,0 +1,6 @@ +graphvisifire_46495d329b07c973daa82a7a9c084d6b'] = 'Visifire'; +$_MODULE['<{graphvisifire}prestashop>graphvisifire_9c3adc09754ac25e4ed1da6176c0e74c'] = 'Visifire est un pack de composants permettant de visualiser graphiquement des données. Il utilise la technologie Microsoft Silverlight 2 beta 2.'; diff --git a/modules/graphvisifire/graphvisifire.php b/modules/graphvisifire/graphvisifire.php new file mode 100644 index 000000000..3c8ffaddf --- /dev/null +++ b/modules/graphvisifire/graphvisifire.php @@ -0,0 +1,186 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GraphVisifire extends ModuleGraphEngine +{ + private $_xml; + private $_values = NULL; + private $_legend = NULL; + private $_titles = NULL; + + function __construct($type = null) + { + if ($type != null) + { + $this->_xml = '_xml .= ' Theme="Theme1" View3D="True"'; + else + $this->_xml .= ' Theme="Theme2" ColorSet="Visifire2" UniqueColors="True"'; + $this->_xml .= '>'; + parent::__construct($type); + } + else + { + $this->name = 'graphvisifire'; + $this->tab = 'administration'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + Module::__construct(); + + $this->displayName = $this->l('Visifire'); + $this->description = $this->l('Visifire is a set of open source data visualization components - powered by Microsoft Silverlight 2 beta 2.'); + } + } + + function install() + { + return (parent::install() AND $this->registerHook('GraphEngine')); + } + + public static function hookGraphEngine($params, $drawer) + { + static $divid = 1; + return ' +
        + +
        '; + } + + public function createValues($values) + { + $this->_values = array(); + if (!is_array($values[array_rand($values)])) + foreach ($values as $value) + $this->_values[] = $value; + else + { + foreach ($values as $i => $layerValue) + { + $this->_values[$i] = array(); + foreach ($layerValue as $value) + $this->_values[$i][] = $value; + } + } + } + + public function setSize($width, $height) + { + // Unavailable + } + + public function setLegend($legend) + { + $this->_legend = array(); + if (!is_array($legend[array_rand($legend)])) + foreach ($legend as $label) + $this->_legend[] = $label; + else + { + foreach ($legend as $i => $layerlabel) + { + $this->_legend[$i] = array(); + foreach ($layerlabel as $label) + $this->_legend[$i][] = $label; + } + } + } + + public function setTitles($titles) + { + $this->_titles = $titles; + if (isset($titles['main']) && !is_array($titles['main'])) + $this->_xml .= ''; + if (is_array($titles['main']) && isset($titles['main'][0])) + $this->_xml .= ''; + if (isset($titles['x'])) + $this->_xml .= ''; + if (isset($titles['y'])) + $this->_xml .= ''; + } + + public function draw() + { + header('content-type: text/xml'); + if ($this->_values != NULL && $this->_legend != NULL) + { + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + $size = sizeof($this->_values); + else + $size = sizeof($this->_values[0]); + if ($size == sizeof($this->_legend)) + { + if (!is_array($this->_values[array_rand($this->_values)])) + { + $this->_xml .= ''; + for ($i = 0; $i < $size; $i++) + { + $this->_xml .= '_xml .= 'AxisLabel=" '.str_replace('<', '<', str_replace('>', '>', str_replace('&', '&', str_replace('"', "'", $this->_legend[$i])))).'" '; + $this->_xml .= 'YValue="'.$this->_values[$i].'"'; + if ($this->_type == 'pie') + $this->_xml .= ' ExplodeOffset="0.2"'; + $this->_xml .= '/>'; + } + $this->_xml .= ''; + } + else + { + foreach ($this->_values as $layer => $values) + { + $this->_xml .= ''; + foreach ($values as $i => $value) + { + $this->_xml .= '_xml .= 'AxisLabel=" '.str_replace('<', '<', str_replace('>', '>', str_replace('&', '&', str_replace('"', "'", $this->_legend[$i])))).'" '; + $this->_xml .= 'YValue="'.$value.'"'; + if ($this->_type == 'pie') + $this->_xml .= ' ExplodeOffset="0.2"'; + $this->_xml .= '/>'; + } + $this->_xml .= ''; + } + } + } + } + $this->_xml .= '
        '; + echo $this->_xml; + exit(1); + } +} + + diff --git a/modules/graphvisifire/it.php b/modules/graphvisifire/it.php new file mode 100644 index 000000000..a31108ffc --- /dev/null +++ b/modules/graphvisifire/it.php @@ -0,0 +1,6 @@ +graphvisifire_46495d329b07c973daa82a7a9c084d6b'] = 'Visifire'; +$_MODULE['<{graphvisifire}prestashop>graphvisifire_9c3adc09754ac25e4ed1da6176c0e74c'] = 'Visifire è un insieme di componenti di visualizzazione dei dati open source powered by Microsoft Silverlight 2 beta 2.'; diff --git a/modules/graphvisifire/logo.gif b/modules/graphvisifire/logo.gif new file mode 100644 index 000000000..df365f2d3 Binary files /dev/null and b/modules/graphvisifire/logo.gif differ diff --git a/modules/graphvisifire/visifire/Visifire.js b/modules/graphvisifire/visifire/Visifire.js new file mode 100644 index 000000000..6cf9d76c1 --- /dev/null +++ b/modules/graphvisifire/visifire/Visifire.js @@ -0,0 +1,353 @@ +/* + Copyright (C) 2008 Webyog Softworks Private Limited + + This file is a part of Visifire Charts. + + Visifire is a 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 3 of the License, or + (at your option) any later version. + + You should have received a copy of the GNU General Public License + along with Visifire Charts. If not, see . + + If GPL is not suitable for your products or company, Webyog provides Visifire + under a flexible commercial license designed to meet your specific usage and + distribution requirements. If you have already obtained a commercial license + from Webyog, you can use this file under those license terms. +*/ + +if(!window.Visifire) +{ + // Visifire class + window.Visifire = function(pXapPath, pId, pWidth, pHeight, pBackground) + { + this.id = null; + this.logLevel = 1; // Determines whether to log or not. + this.xapPath = "Visifire.xap"; // Default is taken as Visifire.xap in the same directory. + this.targetElement = null; + this.dataXml = null; + this.dataUri = null; + this.listeners = null; + this.elements = new Array("Chart", "DataPoint", "Title", "AxisX", "AxisY", "Legend"); + this.events = new Array("MouseLeftButtonDown", "MouseLeftButtonUp", "MouseMove", "MouseEnter", "MouseLeave"); + this.windowless = false; + this.width = null; + this.height = null; + this.background = null; + + // pId not present + if(Number(pId)) + { + if(pHeight) + this.background = pHeight; + + pHeight = pWidth; + pWidth = pId; + } + else // pId present + { + this.id = pId; + + if(pBackground) + this.background = pBackground; + } + + if(pXapPath) + this.xapPath = pXapPath; + + if(pWidth) + this.width = pWidth; + + if(pHeight) + this.height = pHeight; + + this._uThisObject = this; + + this.index = ++Visifire._slCount; + } + + window.Visifire._slCount = 0; + + Visifire.prototype.setWindowlessState = function(pWindowless) + { + if(pWindowless != null) + { + this.windowless = Boolean(pWindowless); + } + } + + Visifire.prototype._getSlControl = function () + { + var _uThisObject = this; + if(_uThisObject.id != null) + { + var slControl = document.getElementById(_uThisObject.id); + return slControl; + } + + return null; + } + + Visifire.prototype.isLoaded = function() + { + var slControl = this._getSlControl(); + try + { + if(slControl.Content.wrapper != null) + return true; + } + catch(ex) + { + return false; + } + } + Visifire.prototype.isDataLoaded = function() + { + var slControl = this._getSlControl(); + + return slControl.Content.wrapper.IsDataLoaded; + } + Visifire.prototype.setSize = function(pWidth,pHeight) + { + var slControl = this._getSlControl(); + if(slControl != null) + { + slControl.width = pWidth; + slControl.height = pHeight; + slControl.Content.wrapper.Resize(pWidth,pHeight); + } + else + { + this.width = pWidth; + this.height = pHeight; + } + } + + Visifire.prototype.setDataXml = function(pDataXml) + { + var slControl = this._getSlControl(); + + if(slControl != null && this.dataXml != null) + { + slControl.Content.wrapper.AddDataXML(pDataXml); + } + + this.dataXml = pDataXml; + } + + + Visifire.prototype.setDataUri = function(pDataUri) + { + var slControl = this._getSlControl(); + + if(slControl != null && this.dataUri != null) + { + slControl.Content.wrapper.AddDataUri(pDataUri); + } + + this.dataUri = pDataUri; + } + + Visifire.prototype.setLogLevel = function(level) + { + if(level != null) + { + this.logLevel = level; + } + } + + Visifire.prototype._isString = function() + { + if (typeof arguments[0] == 'string') return true; + + if (typeof arguments[0] == 'object') + { + var criterion = arguments[0].constructor.toString().match(/string/i); + return (criterion != null); + } + + return false; + } + + Visifire.prototype._validateChartElement = function(pElement) + { + if(this.logLevel != 0) + { + for(var i = 0; i < this.elements.length; i++) + if(this.elements[i] == pElement) + return; + + alert('Error occurred while attaching event.\nUnknown element "' + pElement + '".'); + } + } + + Visifire.prototype._validateEvent = function(pEvent) + { + if(this.logLevel != 0) + { + for(var i = 0; i < this.events.length; i++) + if(this.events[i] == pEvent) + return; + + alert('Error occurred while attaching event.\nUnsupported event type "' + pEvent + '".'); + } + } + + Visifire.prototype.attachEvent = function(pElement, pEvent, pCallBack) + { + var _uThisObject = this; + + _uThisObject._validateChartElement(pElement); + _uThisObject._validateEvent(pEvent); + + if(pEvent && pElement && pCallBack) + { + if(_uThisObject.listeners == null) + _uThisObject.listeners = {}; + + if(_uThisObject.listeners[pEvent] == null) + _uThisObject.listeners[pEvent] = new Array(); + + if(!window["dispatchEvent" + _uThisObject.index]) + window["dispatchEvent" + _uThisObject.index] = function(args) + { + if(_uThisObject.listeners[args.Event] != null) + { + var listener = _uThisObject.listeners[args.Event]; + if(listener.length != 0) + { + for (var i = 0; i < listener.length; i++) + { + if ((listener[i].event == args.Event) && (listener[i].element == args.Element)) + { + args.ControlId = _uThisObject.id; + + if(_uThisObject._isString(listener[i].fire)) + eval(listener[i].fire + "(args)"); + else + listener[i].fire(args); + } + } + } + } + }; + + _uThisObject.listeners[pEvent].push({element: pElement, event: pEvent, fire: pCallBack}); + } + } + + Visifire.prototype._render = function(pTargetElement) + { + var _uThisObject = this; + var width; + var height; + + _uThisObject.targerElement = (typeof(pTargetElement) == "string")?document.getElementById(pTargetElement):pTargetElement; + + if(_uThisObject.width != null) + width = _uThisObject.width; + else if(_uThisObject.targerElement.offsetWidth != 0) + width = _uThisObject.targerElement.offsetWidth; + else + width = 500; + + if(_uThisObject.height != null) + height = _uThisObject.height; + else if(_uThisObject.targerElement.offsetHeight != 0) + height = _uThisObject.targerElement.offsetHeight; + else + height = 300; + + if(!_uThisObject.id) + { + _uThisObject.id = 'VisifireControl' + _uThisObject.index; + } + + var html = ''; + + html += '' + + '' + + ''; + html += '"; + html += '' + + '' + + '' + + '' + + 'Get Microsoft Silverlight' + + '
        You need Microsoft Silverlight to view Visifire Charts.' + + '
        You can install it by clicking on this link.' + + '
        Please restart the browser after installation.' + + '
        ' + + '
        '; + + this.targerElement.innerHTML = html; + } + + Visifire.prototype._reRender = function(pSlControl) + { + pSlControl.Content.wrapper.ReRenderChart(); + } + + Visifire.prototype.render = function(pTargetElement) + { + var slControl = this._getSlControl(); + + if(slControl == null) + { + this._render(pTargetElement); + } + else + { + this._reRender(slControl); + } + } +} \ No newline at end of file diff --git a/modules/graphvisifire/visifire/Visifire.xap b/modules/graphvisifire/visifire/Visifire.xap new file mode 100644 index 000000000..5896c90db Binary files /dev/null and b/modules/graphvisifire/visifire/Visifire.xap differ diff --git a/modules/graphxmlswfcharts/config.xml b/modules/graphxmlswfcharts/config.xml new file mode 100755 index 000000000..c85b4b742 --- /dev/null +++ b/modules/graphxmlswfcharts/config.xml @@ -0,0 +1,11 @@ + + + graphxmlswfcharts + XML/SWF Charts + 1 + XML/SWF Charts is a simple, yet powerful tool using Adobe Flash to create attractive web charts and graphs from dynamic data. + PrestaShop + administration + 0 + 1 + \ No newline at end of file diff --git a/modules/graphxmlswfcharts/de.php b/modules/graphxmlswfcharts/de.php new file mode 100644 index 000000000..0d36ff442 --- /dev/null +++ b/modules/graphxmlswfcharts/de.php @@ -0,0 +1,6 @@ +graphxmlswfcharts_fd1d6df8df2837bc1690e3ca9d84f502'] = 'XML / SWF Charts'; +$_MODULE['<{graphxmlswfcharts}prestashop>graphxmlswfcharts_f0f38a8ecaa33a7db97194b325992d1b'] = 'XML / SWF Charts ist ein einfaches, aber leistungsfähiges Werkzeug mit Adobe Flash, um attraktive Web-Diagramme und Grafiken aus dynamischen Daten zu erstellen.'; diff --git a/modules/graphxmlswfcharts/en.php b/modules/graphxmlswfcharts/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/graphxmlswfcharts/en.php @@ -0,0 +1,4 @@ +graphxmlswfcharts_fd1d6df8df2837bc1690e3ca9d84f502'] = 'Cartas XML/SWF'; +$_MODULE['<{graphxmlswfcharts}prestashop>graphxmlswfcharts_f0f38a8ecaa33a7db97194b325992d1b'] = 'Las cartas de XML/SWF son unas herramientas simples, de un gran alcance, que pueden usar el flash de Adobe para crear cartas y gráficos atractivos de datos dinámicos.'; diff --git a/modules/graphxmlswfcharts/fr.php b/modules/graphxmlswfcharts/fr.php new file mode 100644 index 000000000..1340e3b31 --- /dev/null +++ b/modules/graphxmlswfcharts/fr.php @@ -0,0 +1,6 @@ +graphxmlswfcharts_fd1d6df8df2837bc1690e3ca9d84f502'] = 'XML/SWF Charts'; +$_MODULE['<{graphxmlswfcharts}prestashop>graphxmlswfcharts_f0f38a8ecaa33a7db97194b325992d1b'] = 'XML/SWF Charts est un outil simple mais puissant utilisant Adobe Flash pour créer des graphiques à partir de données dynamiques.'; diff --git a/modules/graphxmlswfcharts/graphxmlswfcharts.php b/modules/graphxmlswfcharts/graphxmlswfcharts.php new file mode 100644 index 000000000..154636cbe --- /dev/null +++ b/modules/graphxmlswfcharts/graphxmlswfcharts.php @@ -0,0 +1,258 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Statistics + * @category stats + * + * @author PrestaShop + * @copyright PrestaShop + * @license http://www.opensource.org/licenses/afl-3.0.php Open-source licence 3.0 + * @version 1.4 + */ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GraphXmlSwfCharts extends ModuleGraphEngine +{ + private $_xml; + private $_values = NULL; + private $_legend = NULL; + private $_legend_more = ''; + private $_titles = ''; + + function __construct($type = null) + { + if ($type != null) + { + $this->_xml = ''; + parent::__construct($type); + } + else + { + $this->name = 'graphxmlswfcharts'; + $this->tab = 'administration'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + Module::__construct(); + + $this->displayName = $this->l('XML/SWF Charts'); + $this->description = $this->l('XML/SWF Charts is a simple, yet powerful tool using Adobe Flash to create attractive web charts and graphs from dynamic data.'); + } + } + + function install() + { + return (parent::install() AND $this->registerHook('GraphEngine')); + } + + public static function hookGraphEngine($params, $drawer) + { + return ' + + + + + + '; + } + + private function drawColumn() + { + $this->_xml .= ' + + + + + + '; + } + + private function drawLine() + { + $this->drawColumn(); + $this->_xml .= 'A3B6DAC3413C5A6C83CA9A515B775155AA26FF2398427FC3 + '; + } + + private function drawPie($counter) + { + $this->_xml .= ' + + + 427FC3 + C3413C + 5A6C83 + CA9A51 + 5B7751 + 55AA26 + FF2398 + + '; + for ($i = 0; $i < $counter; $i++) + $this->_xml .= '9'; + $this->_xml .= ''; + $this->_legend_more = ' bullet="circle"'; + } + + public function createValues($values) + { + $this->_values = $values; + $this->_xml .= ''.$this->_type.''; + + switch ($this->_type) + { + case 'pie': + $this->drawPie(sizeof($values)); + break; + case 'line': + $this->drawLine(); + break; + case 'column': + default: + $this->drawColumn(); + $this->_xml .= 'A3B6DAC3413C5A6C83CA9A515B775155AA26FF2398427FC3'; + break; + } + } + + public function setSize($width, $height) + { + if (isset($width) && !empty($width)) + $this->_width = $width; + else + $this->_width = 550; + if (isset($height) && !empty($height)) + $this->_height = $height; + else + $this->_height = 270; + } + + public function setLegend($legend) + { + $this->_legend = $legend; + $this->_xml .= '_legend_more.' layout="horizontal" font="arial" bold="true" size="13" color="000000" alpha="85" shadow="low" transition="dissolve" delay="0.5" duration="0.25" fill_color="D4D4D4" fill_alpha="0" line_color="D4D4D4" line_alpha="0" line_thickness="0" />'; + } + + public function setTitles($titles) + { + $this->_titles = $titles; + $this->_xml .= ''; + if (isset($titles['main'])) + { + if ($this->_type == 'pie') + $this->_xml .= ''.$titles['main'].''; + } + if ($this->_type != 'pie' AND isset($titles['x']) AND isset($titles['y'])) + { + $this->_xml .= ''.$titles['x'].''; + $this->_xml .= ''.$titles['y'].''; + } + $this->_xml .= ''; + } + + public function draw() + { + header('content-type: text/xml'); + + $this->_xml .= ''; + foreach ($this->_legend as $value) + $this->_xml .= ''.$value.''; + $this->_xml .= ''; + + if (!isset($this->_values[0]) || !is_array($this->_values[0])) + { + $this->_xml .= ''.$this->_titles['main'].''; + foreach ($this->_values as $value) + $this->_xml .= ''. (($value > 0) ? $value : -$value) .''; //si jamais la valeur est n�gative... logiquement ne devrait jamais arriver + $this->_xml .= ''; + } + else + { + $i = 1; + foreach ($this->_values as $value) + { + $this->_xml .= ''; + if (isset($this->_titles['main'][$i])) + $this->_xml .= ''.$this->_titles['main'][$i].''; + foreach ($value as $val) + $this->_xml .= ''.$val.''; + $this->_xml .= ''; + $i++; + } + } + $this->_xml .= ''; + $this->_xml .= ''; + echo $this->_xml; + } +} diff --git a/modules/graphxmlswfcharts/it.php b/modules/graphxmlswfcharts/it.php new file mode 100644 index 000000000..5daf73adb --- /dev/null +++ b/modules/graphxmlswfcharts/it.php @@ -0,0 +1,6 @@ +graphxmlswfcharts_fd1d6df8df2837bc1690e3ca9d84f502'] = 'XML / SWF Charts'; +$_MODULE['<{graphxmlswfcharts}prestashop>graphxmlswfcharts_f0f38a8ecaa33a7db97194b325992d1b'] = 'XML / SWF Charts è uno strumento semplice ma potente con Adobe Flash per creare grafici web attraenti e grafici dai dati dinamici.'; diff --git a/modules/graphxmlswfcharts/logo.gif b/modules/graphxmlswfcharts/logo.gif new file mode 100644 index 000000000..98919ed13 Binary files /dev/null and b/modules/graphxmlswfcharts/logo.gif differ diff --git a/modules/graphxmlswfcharts/xml_swf_charts/AC_RunActiveContent.js b/modules/graphxmlswfcharts/xml_swf_charts/AC_RunActiveContent.js new file mode 100644 index 000000000..39c294bbd --- /dev/null +++ b/modules/graphxmlswfcharts/xml_swf_charts/AC_RunActiveContent.js @@ -0,0 +1,292 @@ +//v1.7 +// Flash Player Version Detection +// Detect Client Browser type +// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved. +var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; +var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; +var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; + +function ControlVersion() +{ + var version; + var axo; + var e; + + // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry + + try { + // version will be set for 7.X or greater players + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); + version = axo.GetVariable("$version"); + } catch (e) { + } + + if (!version) + { + try { + // version will be set for 6.X players only + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); + + // installed player is some revision of 6.0 + // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, + // so we have to be careful. + + // default to the first public version + version = "WIN 6,0,21,0"; + + // throws if AllowScripAccess does not exist (introduced in 6.0r47) + axo.AllowScriptAccess = "always"; + + // safe to call for 6.0r47 or greater + version = axo.GetVariable("$version"); + + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 4.X or 5.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); + version = axo.GetVariable("$version"); + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 3.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); + version = "WIN 3,0,18,0"; + } catch (e) { + } + } + + if (!version) + { + try { + // version will be set for 2.X player + axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + version = "WIN 2,0,0,11"; + } catch (e) { + version = -1; + } + } + + return version; +} + +// JavaScript helper required to detect Flash Player PlugIn version information +function GetSwfVer(){ + // NS/Opera version >= 3 check for Flash plugin in plugin array + var flashVer = -1; + + if (navigator.plugins != null && navigator.plugins.length > 0) { + if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { + var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; + var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; + var descArray = flashDescription.split(" "); + var tempArrayMajor = descArray[2].split("."); + var versionMajor = tempArrayMajor[0]; + var versionMinor = tempArrayMajor[1]; + var versionRevision = descArray[3]; + if (versionRevision == "") { + versionRevision = descArray[4]; + } + if (versionRevision[0] == "d") { + versionRevision = versionRevision.substring(1); + } else if (versionRevision[0] == "r") { + versionRevision = versionRevision.substring(1); + if (versionRevision.indexOf("d") > 0) { + versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); + } + } + var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; + } + } + // MSN/WebTV 2.6 supports Flash 4 + else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; + // WebTV 2.5 supports Flash 3 + else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; + // older WebTV supports Flash 2 + else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; + else if ( isIE && isWin && !isOpera ) { + flashVer = ControlVersion(); + } + return flashVer; +} + +// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available +function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) +{ + versionStr = GetSwfVer(); + if (versionStr == -1 ) { + return false; + } else if (versionStr != 0) { + if(isIE && isWin && !isOpera) { + // Given "WIN 2,0,0,11" + tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] + tempString = tempArray[1]; // "2,0,0,11" + versionArray = tempString.split(","); // ['2', '0', '0', '11'] + } else { + versionArray = versionStr.split("."); + } + var versionMajor = versionArray[0]; + var versionMinor = versionArray[1]; + var versionRevision = versionArray[2]; + + // is the major.revision >= requested major.revision AND the minor version >= requested minor + if (versionMajor > parseFloat(reqMajorVer)) { + return true; + } else if (versionMajor == parseFloat(reqMajorVer)) { + if (versionMinor > parseFloat(reqMinorVer)) + return true; + else if (versionMinor == parseFloat(reqMinorVer)) { + if (versionRevision >= parseFloat(reqRevision)) + return true; + } + } + return false; + } +} + +function AC_AddExtension(src, ext) +{ + if (src.indexOf('?') != -1) + return src.replace(/\?/, ext+'?'); + else + return src + ext; +} + +function AC_Generateobj(objAttrs, params, embedAttrs) +{ + var str = ''; + if (isIE && isWin && !isOpera) + { + str += ' '; + } + str += ''; + } + else + { + str += ' + + gridhtml + Simple HTML table display + 1 + + PrestaShop + administration + 0 + 1 + \ No newline at end of file diff --git a/modules/gridhtml/de.php b/modules/gridhtml/de.php new file mode 100644 index 000000000..e9390fea7 --- /dev/null +++ b/modules/gridhtml/de.php @@ -0,0 +1,5 @@ +gridhtml_cf6b972204ee563b4e5691b293e931b6'] = 'Einfache HTML-Tabellenanzeige'; diff --git a/modules/gridhtml/en.php b/modules/gridhtml/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/gridhtml/en.php @@ -0,0 +1,4 @@ +gridhtml_cf6b972204ee563b4e5691b293e931b6'] = 'Mostrar HTML simple'; diff --git a/modules/gridhtml/fr.php b/modules/gridhtml/fr.php new file mode 100644 index 000000000..780a9cdb7 --- /dev/null +++ b/modules/gridhtml/fr.php @@ -0,0 +1,5 @@ +gridhtml_cf6b972204ee563b4e5691b293e931b6'] = 'Affichage HTML simple'; diff --git a/modules/gridhtml/gridhtml.php b/modules/gridhtml/gridhtml.php new file mode 100644 index 000000000..c757ab2f7 --- /dev/null +++ b/modules/gridhtml/gridhtml.php @@ -0,0 +1,185 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class GridHtml extends ModuleGridEngine +{ + private $_values; + private static $_columns; + + function __construct($type = null) + { + if ($type != null) + parent::__construct($type); + else + { + $this->name = 'gridhtml'; + $this->tab = 'administration'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + Module::__construct(); + + $this->displayName = $this->l('Simple HTML table display'); + $this->description = ''; + } + } + + function install() + { + return (parent::install() AND $this->registerHook('GridEngine')); + } + + public static function hookGridEngine($params, $grider) + { + self::$_columns = $params['columns']; + if (!isset($params['emptyMsg'])) + $params['emptyMsg'] = 'Empty'; + + $html = '
        + '; + foreach ($params['columns'] as $column) + $html .= ''; + $html .= ' + + +
        + '.$column['header'].'
        + + + + + + +
        +
        + '; + return $html; + } + + public function setColumnsInfos(&$infos) + { + } + + public function setValues($values) + { + $this->_values = $values; + } + + public function setTitle($title) + { + $this->_title = $title; + } + + public function setSize($width, $height) + { + $this->_width = $width; + $this->_height = $height; + } + + public function setTotalCount($totalCount) + { + $this->_totalCount = $totalCount; + } + + public function setLimit($start, $limit) + { + $this->_start = (int)$start; + $this->_limit = (int)$limit; + } + + public function render() + { + echo Tools::jsonEncode(array( + 'total' => $this->_totalCount, + 'from' => min($this->_start + 1, $this->_totalCount), + 'to' => min($this->_start + $this->_limit, $this->_totalCount), + 'values' => $this->_values + )); + } +} + diff --git a/modules/gridhtml/it.php b/modules/gridhtml/it.php new file mode 100644 index 000000000..ae7e54f7c --- /dev/null +++ b/modules/gridhtml/it.php @@ -0,0 +1,5 @@ +gridhtml_cf6b972204ee563b4e5691b293e931b6'] = 'Semplice tabella di visualizzazione HTML'; diff --git a/modules/gridhtml/logo.gif b/modules/gridhtml/logo.gif new file mode 100644 index 000000000..e9b9215e1 Binary files /dev/null and b/modules/gridhtml/logo.gif differ diff --git a/modules/gsitemap/config.xml b/modules/gsitemap/config.xml new file mode 100755 index 000000000..a6d6f5979 --- /dev/null +++ b/modules/gsitemap/config.xml @@ -0,0 +1,11 @@ + + + gsitemap + Google sitemap + 1.6 + Generate your Google sitemap file + PrestaShop + seo + 1 + 1 + \ No newline at end of file diff --git a/modules/gsitemap/de.php b/modules/gsitemap/de.php new file mode 100644 index 000000000..95e97832f --- /dev/null +++ b/modules/gsitemap/de.php @@ -0,0 +1,24 @@ +gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Generieren Sie Ihre Google Sitemap-Datei'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Kann nicht erstellt werden'; +$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'sitemap.xml Datei.'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'Sitemap-Datei erfolgreich erzeugt'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Fehler beim Erstellen der Sitemap-Datei'; +$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Ihr Google-Sitemap-Datei ist online unter folgender Adresse:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Aktualisierung:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Dateigröße:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Indizierte Seiten:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Sitemap enthält alle Produkte'; +$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Standardeinstellung, nur Produkte in aktiven Kategorien sind auf der Sitemap enthalten'; +$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Sitemap enthält alle CMS-Seiten'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Standardeinstellung, nur CMS-Seiten auf CMS-Block sind auf der Sitemap enthalten'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Sitemap-Datei erzeugen'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Sitemap-Datei aktualisieren'; +$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Search Engine Optimization'; +$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Siehe'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'diese Seite'; +$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'für weitere Informationen'; diff --git a/modules/gsitemap/en.php b/modules/gsitemap/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/gsitemap/en.php @@ -0,0 +1,4 @@ +gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Genere su fichero de Google Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Creación imposible'; +$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'fichero sitemap.xml'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'El fichero sitemap fue generado correctamente'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Error mientras se creaba el fichero sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Su fichero de google sitemap está online en la siguiente dirección:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Actualizar:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Tamaño'; +$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Páginas Indexadas:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'El sitemap contiene todas los productos'; +$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Por defecto, sólo los productos en categorías activos se incluyen en Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'El sitemap contiene todas las páginas CMS'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Por defecto, sólo las páginas de CMS en el bloque de CMS se incluyen en Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Generar fichero Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Actualizar fichero Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Optimizar Motor de Búsqueda'; +$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Lea'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'esta página'; +$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'para más información'; diff --git a/modules/gsitemap/fr.php b/modules/gsitemap/fr.php new file mode 100644 index 000000000..df71735fa --- /dev/null +++ b/modules/gsitemap/fr.php @@ -0,0 +1,24 @@ +gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Génère votre fichier sitemap pour Google'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Impossible de créer'; +$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'sitemap.xml.'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'Fichier Sitemap généré avec succès'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Erreur durant la création du fichier Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Votre fichier Google Sitemap est en ligne à l\'adresse suivante :'; +$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Mise à jour'; +$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Taille du fichier'; +$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Nombre de pages indexées'; +$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Le sitemap doit contenir tous les produits'; +$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Par défaut, seuls les produits présents dans les catégories actives sont inclus dans le Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Le sitemap doit contenir toutes les pages CMS'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Par défaut, seulement les pages CMS présentes dans le block CMS sont incluses dans le Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Générer le fichier sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Mettre à jour le fichier sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Optimisation pour les moteurs de recherche (SEO)'; +$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Voir'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'cette page'; +$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'pour plus d\'informations'; diff --git a/modules/gsitemap/gsitemap.php b/modules/gsitemap/gsitemap.php new file mode 100644 index 000000000..2b3316a0f --- /dev/null +++ b/modules/gsitemap/gsitemap.php @@ -0,0 +1,270 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Gsitemap extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + function __construct() + { + $this->name = 'gsitemap'; + $this->tab = 'seo'; + $this->version = '1.6'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Google sitemap'); + $this->description = $this->l('Generate your Google sitemap file'); + + if (!defined('GSITEMAP_FILE')) + define('GSITEMAP_FILE', dirname(__FILE__).'/../../sitemap.xml'); + } + + function uninstall() + { + file_put_contents(GSITEMAP_FILE, ''); + return parent::uninstall(); + } + + private function _postValidation() + { + file_put_contents(GSITEMAP_FILE, ''); + if (!($fp = fopen(GSITEMAP_FILE, 'w'))) + $this->_postErrors[] = $this->l('Cannot create').' '.realpath(dirname(__FILE__.'/../..')).'/'.$this->l('sitemap.xml file.'); + else + fclose($fp); + } + + private function getUrlWith($url, $key, $value) + { + if (empty($value)) + return $url; + if (strpos($url, '?') !== false) + return $url.'&'.$key.'='.$value; + return $url.'?'.$key.'='.$value; + } + + private function _postProcess() + { + Configuration::updateValue('GSITEMAP_ALL_CMS', (int)(Tools::getValue('GSITEMAP_ALL_CMS'))); + Configuration::updateValue('GSITEMAP_ALL_PRODUCTS', (int)(Tools::getValue('GSITEMAP_ALL_PRODUCTS'))); + $link = new Link(); + $langs = Language::getLanguages(); + + $xmlString = << + + +XML; + + $xml = new SimpleXMLElement($xmlString); + + if (Configuration::get('PS_REWRITING_SETTINGS')) + foreach($langs as $lang) + $this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__.$lang['iso_code'].'/', '1.00', 'daily', date('Y-m-d')); + else + $this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__, '1.00', 'daily', date('Y-m-d')); + + if (Configuration::get('GSITEMAP_ALL_CMS') OR !Module::isInstalled('blockcms')) + $sql_cms = ' + SELECT DISTINCT cl.id_cms, cl.link_rewrite, cl.id_lang + FROM '._DB_PREFIX_.'cms_lang cl + LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang) + WHERE l.`active` = 1 + ORDER BY cl.id_cms, cl.id_lang ASC'; + elseif (Module::isInstalled('blockcms')) + $sql_cms = ' + SELECT DISTINCT cl.id_cms, cl.link_rewrite, cl.id_lang + FROM '._DB_PREFIX_.'cms_block_page b + LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (b.id_cms = cl.id_cms) + LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang) + WHERE l.`active` = 1 + ORDER BY cl.id_cms, cl.id_lang ASC'; + + $cmss = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql_cms); + foreach($cmss AS $cms) + $this->_addSitemapNode($xml, $link->getCMSLink((int)($cms['id_cms']), $cms['link_rewrite'], false, (int)($cms['id_lang'])), '0.8', 'daily'); + + $categories = Db::getInstance()->ExecuteS(' + SELECT c.id_category, c.level_depth, link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd, cl.id_lang + FROM '._DB_PREFIX_.'category c + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON c.id_category = cl.id_category + LEFT JOIN '._DB_PREFIX_.'lang l ON cl.id_lang = l.id_lang + WHERE l.`active` = 1 AND c.`active` = 1 AND c.id_category != 1 + ORDER BY cl.id_category, cl.id_lang ASC'); + foreach($categories as $category) + { + if (($priority = 0.9 - ($category['level_depth'] / 10)) < 0.1) + $priority = 0.1; + $tmpLink = $link->getCategoryLink((int)($category['id_category']), $category['link_rewrite'], (int)($category['id_lang'])); + + $this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($category['date_upd'], 0, 10)); + } + + $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.id_product, pl.link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') date_upd, pl.id_lang, cl.`link_rewrite` category, ean13, i.id_image, il.legend legend_image, ( + SELECT MIN(level_depth) + FROM '._DB_PREFIX_.'product p2 + LEFT JOIN '._DB_PREFIX_.'category_product cp2 ON p2.id_product = cp2.id_product + LEFT JOIN '._DB_PREFIX_.'category c2 ON cp2.id_category = c2.id_category + WHERE p2.id_product = p.id_product AND p2.`active` = 1 AND c2.`active` = 1) AS level_depth + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product) + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND pl.`id_lang` = cl.`id_lang`) + LEFT JOIN '._DB_PREFIX_.'image i ON p.id_product = i.id_product + LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image) + LEFT JOIN '._DB_PREFIX_.'lang l ON (pl.id_lang = l.id_lang) + WHERE l.`active` = 1 AND p.`active` = 1 + '.(Configuration::get('GSITEMAP_ALL_PRODUCTS') ? '' : 'HAVING level_depth IS NOT NULL').' + ORDER BY pl.id_product, pl.id_lang ASC'); + + foreach($products AS $product) + { + if (($priority = 0.7 - ($product['level_depth'] / 10)) < 0.1) + $priority = 0.1; + + $tmpLink = $link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang'])); + $sitemap = $this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($product['date_upd'], 0, 10)); + $sitemap = $this->_addSitemapNodeImage($sitemap, $product); + } + + /* Add classic pages (contact, best sales, new products...) */ + $pages = array( + 'authentication' => true, + 'best-sales' => false, + 'contact-form' => true, + 'discount' => false, + 'index' => false, + 'manufacturer' => false, + 'new-products' => false, + 'prices-drop' => false, + 'supplier' => false, + 'store' => false); + + foreach ($pages AS $page => $ssl) + foreach($langs as $lang) + $this->_addSitemapNode($xml, $link->getPageLink($page.'.php', $ssl, $lang['id_lang']), '0.5', 'monthly'); + + $xmlString = $xml->asXML(); + + $fp = fopen(GSITEMAP_FILE, 'w'); + fwrite($fp, $xmlString); + fclose($fp); + + $res = file_exists(GSITEMAP_FILE); + $this->_html .= '

        '; + $this->_html .= $res ? $this->l('Sitemap file generated') : $this->l('Error while creating sitemap file'); + $this->_html .= '

        '; + } + + private function _addSitemapNode($xml, $loc, $priority, $change_freq, $last_mod = NULL) + { + $sitemap = $xml->addChild('url'); + $sitemap->addChild('loc', $loc); + $sitemap->addChild('priority', $priority); + if ($last_mod) + $sitemap->addChild('lastmod', $last_mod); + $sitemap->addChild('changefreq', $change_freq); + return $sitemap; + } + + private function _addSitemapNodeImage($xml, $product) + { + $link = new Link(); + $image = $xml->addChild('image', null, 'http://www.google.com/schemas/sitemap-image/1.1'); + $image->addChild('loc', $link->getImageLink($product['link_rewrite'], (int)$product['id_product'].'-'.(int)$product['id_image']), 'http://www.google.com/schemas/sitemap-image/1.1'); + $image->addChild('caption', $product['legend_image'], 'http://www.google.com/schemas/sitemap-image/1.1'); + $image->addChild('title', $product['legend_image'], 'http://www.google.com/schemas/sitemap-image/1.1'); + } + + private function _displaySitemap() + { + if (file_exists(GSITEMAP_FILE) AND filesize(GSITEMAP_FILE)) + { + $fp = fopen(GSITEMAP_FILE, 'r'); + $fstat = fstat($fp); + fclose($fp); + $xml = simplexml_load_file(GSITEMAP_FILE); + + $nbPages = sizeof($xml->url); + + $this->_html .= '

        '.$this->l('Your Google sitemap file is online at the following address:').'
        + '.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml


        '; + + $this->_html .= $this->l('Update:').' '.utf8_encode(strftime('%A %d %B %Y %H:%M:%S',$fstat['mtime'])).'
        '; + $this->_html .= $this->l('Filesize:').' '.number_format(($fstat['size']*.000001), 3).'MB
        '; + $this->_html .= $this->l('Indexed pages:').' '.$nbPages.'

        '; + } + } + + private function _displayForm() + { + $this->_html .= + '
        +
        + +

        '.$this->l('Default: only products in active categories are included on Sitemap').'

        +
        +
        + +

        '.$this->l('Default: only CMS pages on block CMS are included on Sitemap').'

        +
        + +
        '; + } + + function getContent() + { + $this->_html .= '

        '.$this->l('Search Engine Optimization').'

        + '.$this->l('See').' + '.$this->l('this page').' '.$this->l('for more information').'

        '; + if (!empty($_POST)) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= '
        '.$err.'
        '; + } + + $this->_displaySitemap(); + $this->_displayForm(); + + return $this->_html; + } +} + + + diff --git a/modules/gsitemap/it.php b/modules/gsitemap/it.php new file mode 100644 index 000000000..7931d3c3a --- /dev/null +++ b/modules/gsitemap/it.php @@ -0,0 +1,24 @@ +gsitemap_3aaaafde6f9b2701f9e6eb9292e95521'] = 'Google sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_935a6bc13704a117d22333c3155b5dae'] = 'Genera il tuo file sitemap di Google'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5bbdad908e423585a7ecc6b61b66b313'] = 'Non è possibile creare'; +$_MODULE['<{gsitemap}prestashop>gsitemap_09fa1e865bdcf4d3215d5b0005b93154'] = 'file sitemap.xml.'; +$_MODULE['<{gsitemap}prestashop>gsitemap_5a517cec50ac8e742f6583c6c404c4e9'] = 'File Sitemap generato con successo'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0a6ee1a4f10278211d74152e633d0ed0'] = 'Errore durante la creazione del file sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_eb175747116b689caadea1b84202f513'] = 'Il tuo file sitemap di Google è online al seguente indirizzo:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_39d616ecc73e174052f1877ac2b3c853'] = 'Aggiornamento:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_b908c2f34052b5276e0bf50f0e042211'] = 'Dimensioni:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_3f69f5c6c3c90eee482f28ae77390cb9'] = 'Pagine indicizzate:'; +$_MODULE['<{gsitemap}prestashop>gsitemap_a0548d857c8e9fcfd2b3c8e08d231456'] = 'Sitemap contiene tutti i prodotti'; +$_MODULE['<{gsitemap}prestashop>gsitemap_570b9e0ce727cb56ff261113fa1c4eba'] = 'Default, solo i prodotti delle categorie attive sono inclusi nel Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_bbb0ad1beeb2e94661f89f8edfc79322'] = 'Sitemap contiene tutte le pagine CMS'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8a1b79d3b66d3234795649a69cf86410'] = 'Default, solo le pagine CMS nel blocco CMS sono inclusi nel Sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8103220a578f92ec726809c3d47adc6e'] = 'Genera file sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_0033cf1fdbd4354facfaa51f6f0de6a4'] = 'Aggiornamento file sitemap'; +$_MODULE['<{gsitemap}prestashop>gsitemap_f5a592018c8b55d2c968515ad7c58c91'] = 'Search Engine Optimization'; +$_MODULE['<{gsitemap}prestashop>gsitemap_4ff2e716a7d06ce5274b4090b39abad3'] = 'Vedi'; +$_MODULE['<{gsitemap}prestashop>gsitemap_8334797b9b3383d4f48d98178b8845ea'] = 'questa pagina'; +$_MODULE['<{gsitemap}prestashop>gsitemap_abf27597777430142de13ed6eea36d75'] = 'per maggiori informazioni'; diff --git a/modules/gsitemap/logo.gif b/modules/gsitemap/logo.gif new file mode 100644 index 000000000..d24a14a90 Binary files /dev/null and b/modules/gsitemap/logo.gif differ diff --git a/modules/hipay/1.png b/modules/hipay/1.png new file mode 100644 index 000000000..b16203589 Binary files /dev/null and b/modules/hipay/1.png differ diff --git a/modules/hipay/2.png b/modules/hipay/2.png new file mode 100644 index 000000000..1bb36bc03 Binary files /dev/null and b/modules/hipay/2.png differ diff --git a/modules/hipay/3.png b/modules/hipay/3.png new file mode 100644 index 000000000..f68967db6 Binary files /dev/null and b/modules/hipay/3.png differ diff --git a/modules/hipay/config.xml b/modules/hipay/config.xml new file mode 100755 index 000000000..6decd7eb6 --- /dev/null +++ b/modules/hipay/config.xml @@ -0,0 +1,12 @@ + + + hipay + Hipay + 1 + Secure payement Visa Mastercard and european solutions. + + payments_gateways + 1 + 1 + + \ No newline at end of file diff --git a/modules/hipay/create.jpg b/modules/hipay/create.jpg new file mode 100644 index 000000000..e4ee636dc Binary files /dev/null and b/modules/hipay/create.jpg differ diff --git a/modules/hipay/de.php b/modules/hipay/de.php new file mode 100644 index 000000000..d589320eb --- /dev/null +++ b/modules/hipay/de.php @@ -0,0 +1,46 @@ +hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay'; +$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Secure payement Visa Mastercard und europäische Lösungen.'; +$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Fehler: kann keine PaymentParams erstellen '; +$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb'; +$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Fehler: kann \"Warenkorb\" Produkt nicht erstellen'; +$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Gesamt Bestellung'; +$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Fehler: kann Bestellung nicht erstellen'; +$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Fehler:'; +$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'Sie sind nicht berechtigt, externe URLs (allow_url_fopen) zu öffnen'; +$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'cURL ist nicht aktiviert'; +$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL ist nicht aktiviert'; +$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Kann nicht auf Zahlungs-Gateway zugreifen'; +$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'überprüfen Sie Ihre Firewall'; +$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Ihr Shop ist nicht online'; +$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'Hipay Kategorien nicht für jede Seiten-ID eingestellt'; +$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Unmöglich, Hipay Kategorien abzurufen. Bitte beziehen Sie sich auf Ihr Fehlerprotokoll für weitere Details.'; +$_MODULE['<{hipay}prestashop>hipay_8f19eb452ad0295c45ca62a099f10dc6'] = 'Hipay ist eine sichere elektronische Geldbörse, die Händlern ein komplettes Service-Paket für Online-Business-Transaktionen bietet: ob für digitale Inhalte, Software, Musik, Abonnements, physische Güter ... ohne mit einer Bank zu verhandeln und ohne technische Kosten.'; +$_MODULE['<{hipay}prestashop>hipay_e5ac60a0713182096ea3f9590f101b25'] = 'Free & Easy, die Hipay-Implementierung ist ein echtes Plus für E-Commerce-Webseite, die sich in Europa ausbreiten wollen: sichere Zahlungen durch internationale Karten, Local Payment-Lösungen, Überweisungen ...'; +$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Hinweis: Wenn Sie eine Zahlung erstatten möchten, melden Sie sich auf Ihrem Hipay-Konto an, dann gehen Sie zu Merchant Management> Verkaufsmanagement.'; +$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Melden Sie sich bei Ihrem Händler-Konto an'; +$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Erstellen Sie ein hipay-Konto '; +$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Konto'; +$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'Echtzeit/ Betrieb'; +$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'Sandbox / Test'; +$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Konfiguration im'; +$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Kontonummer'; +$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Händler-Kennwort'; +$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'Seiten-ID'; +$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Test Kontonummer'; +$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Autorisierte Altersgruppe'; +$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Für alle Altersstufen'; +$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = 'Ab 12 Jahren und älter'; +$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = 'Ab 16 Jahren und älter'; +$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = 'Ab 18 Jahren und älter'; +$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Hinweis: Bitte sicherstellen, dass der Währungsmodus, den Sie im Zahlungs-Tab gewählt haben, mit Ihrem Hipay Konto (en) kompatibel ist.'; +$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Konfiguration aktualisieren'; +$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Bezahlen Sie mit Hipay'; +$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'erforderlicher Minimalbetrag , um mit Hipay bezahlen:'; +$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(Sandbox / Test-Modus)'; diff --git a/modules/hipay/es.php b/modules/hipay/es.php new file mode 100644 index 000000000..3d317fd16 --- /dev/null +++ b/modules/hipay/es.php @@ -0,0 +1,46 @@ +hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay'; +$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Asegure los pagos de Visa Mastercard y soluciones europeas.'; +$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Error: imposible crear PaymentParams'; +$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrito'; +$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Error: imposible crear el Producto \"Carrito\"'; +$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Total pedido'; +$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Error: imposible crear el pedido'; +$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Error:'; +$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'La directiva allow_url_fopen está desactivada'; +$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'La librería cURL no está activada'; +$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL no está activado'; +$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Imposible acceder al servicio de pago'; +$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'vérifiez le firewall de votre serveur pour le port 443'; +$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Su tienda no está en línea'; +$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'La categoría de productos Hipay no está configurada para cada ID del sitio web'; +$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'imposible recuperar las categorías Hipay. Vea el diario de errores para más información.'; +$_MODULE['<{hipay}prestashop>hipay_8f19eb452ad0295c45ca62a099f10dc6'] = 'Hipay es una cartera electrónica segura que le ofrece una paleta de herramientas y de aplicaciones para facturar difertentes tipos de contenidos y de servicios: contenidos numéricos, descargas, bienes físicos... sin necesidad de negociar con un banco y sin gastos técnicos. '; +$_MODULE['<{hipay}prestashop>hipay_e5ac60a0713182096ea3f9590f101b25'] = 'Simple y gratuita, la implementación de la solución Hipay constituye una ventaja para un sitio de venta en línea que desea impulsarse en Europa: pagos seguros con tarjetas internacionales, soluciones de pago locales, transferencias bancarias...'; +$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Nota : Para reenvolsar integramente una transacción, vaya al sitio www.hipay.com, en la gestión de venta Hipay/gestión de las ventas.'; +$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Acceder a su espacio de venta Hipay'; +$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Crear una cuenta Hipay'; +$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Cuenta Hipay'; +$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'real / producción'; +$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'test'; +$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configuración en'; +$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Número de cuenta'; +$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Contraseña vendedor'; +$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID del sitio web'; +$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Prueba número de cuenta'; +$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Edad mínima'; +$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Para todas las edades'; +$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = '12 años y más'; +$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = '16 años y más'; +$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = '18 años y más'; +$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Nota : Compruebe, por favor, que el modo de gestión de las divisas que ha elegido en la pestaña Pago es compatible con su/sus cuenta(s) Hipay.'; +$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Guardar las modificaciones'; +$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Pagar con Hipay'; +$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'Importe mínimo para pagar con Hipay:'; +$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = 'sandbox / modo test'; diff --git a/modules/hipay/fr.php b/modules/hipay/fr.php new file mode 100644 index 000000000..4f40bd2be --- /dev/null +++ b/modules/hipay/fr.php @@ -0,0 +1,45 @@ +hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay'; +$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Paiement sécurisé Visa Mastercard et solutions européennes.'; +$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Erreur: impossible de créer PaymentParams'; +$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; +$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Erreur : impossible de créer le produit \"panier\"'; +$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Total commande'; +$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Erreur : impossible de créer la commande'; +$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Erreur :'; +$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'La directive allow_url_fopen est désactivée'; +$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'La librairie cURL n\'est pas activée'; +$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL n\'est pas activé'; +$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Impossible d\'accéder au service de paiement'; +$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'vérifiez le firewall de votre serveur pour le port 443'; +$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Votre boutique n\'est pas en ligne'; +$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'La catégorie de produits Hipay n\'est pas configurée pour chaque ID site'; +$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Impossible de récupérer les catégories Hipay. Merci de vous référer à votre journal des erreurs pour plus de détails.'; +$_MODULE['<{hipay}prestashop>hipay_74e0ddca931daefcd88f3c118e8eb0f1'] = 'Hipay est un portefeuille électronique sécurisé et possédant l\'agrément bancaire européen. Hipay vous offre de nombreuses possibilités sans avoir besoin de négocier avec une banque. Facile et gratuite, l’implémentation de la solution Hipay constitue un véritable atout pour un site e-commerce qui souhaite se développer en Europe : paiements sécurisés par cartes internationales, solutions de paiement locales, virements bancaires...'; +$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Note : Pour rembourser intégralement une transaction, veuillez vous rendre sur le site www.hipay.com, dans la gestion marchande Hipay/gestion des ventes.'; +$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Accédez à votre espace marchand Hipay'; +$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Créez un compte Hipay'; +$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Compte Hipay'; +$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'réel / production'; +$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'test'; +$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configuration en'; +$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Numéro de compte'; +$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Mot de passe marchand'; +$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID du site'; +$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie'; +$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Numéro de compte Test'; +$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Âge minimum'; +$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Pour tous les âges'; +$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = '12 ans et plus'; +$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = '16 ans et plus'; +$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = '18 ans et plus'; +$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Note : Merci de vérifier que le mode de gestion des devises que vous avez choisi dans l\'onglet Paiement est compatible avec votre/vos compte(s) Hipay.'; +$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Enregistrer les modifications'; +$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Payer avec Hipay'; +$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'Montant minimum pour payer avec Hipay :'; +$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(bac à sable / mode test)'; diff --git a/modules/hipay/help.png b/modules/hipay/help.png new file mode 100644 index 000000000..f5abce06b Binary files /dev/null and b/modules/hipay/help.png differ diff --git a/modules/hipay/hipay.php b/modules/hipay/hipay.php new file mode 100644 index 000000000..73eb5ba35 --- /dev/null +++ b/modules/hipay/hipay.php @@ -0,0 +1,514 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Hipay extends PaymentModule +{ + private $arrayCategories; + private $prod; + + public function __construct() + { + $this->name = 'hipay'; + $this->tab = 'payments_gateways'; + $this->version = 1.0; + + $this->currencies = true; + $this->currencies_mode = 'radio'; + + parent::__construct(); + + $this->displayName = $this->l('Hipay'); + $this->description = $this->l('Secure payement Visa Mastercard and european solutions.'); + + $result = Db::getInstance()->ExecuteS(' + SELECT iso_code + FROM '._DB_PREFIX_.'country as c + LEFT JOIN '._DB_PREFIX_.'zone as z + ON z.id_zone = c.id_zone + WHERE z.id_zone = 1'); + + foreach ($result as $num => $iso) + $this->limited_countries[] = $iso['iso_code']; + + if ($this->id) + { + $this->prod = (int)Tools::getValue('HIPAY_PROD', Configuration::get('HIPAY_PROD')); + // Define extracted from mapi/mapi_defs.php + if (!defined('HIPAY_GATEWAY_URL')) + define('HIPAY_GATEWAY_URL','https://'.($this->prod ? '' : 'test.').'payment.hipay.com/order/'); + } + } + + public function install() + { + Configuration::updateValue('HIPAY_SALT', uniqid()); + // Force using Prod mod + Configuration::updateValue('HIPAY_PROD', 1); + + if (!Configuration::get('HIPAY_UNIQID')) + Configuration::updateValue('HIPAY_UNIQID', uniqid()); + if (!Configuration::get('HIPAY_RATING')) + Configuration::updateValue('HIPAY_RATING', 'ALL'); + + if (!(parent::install() AND $this->registerHook('payment'))) + return false; + // Check only the European country for the country restrictions + Db::getInstance()->Execute(' + DELETE FROM '._DB_PREFIX_.'module_country + WHERE id_module = '.$this->id.' + AND id_country NOT IN + (SELECT id_country FROM '._DB_PREFIX_.'country WHERE id_zone = 1)'); + return true; + } + + public function hookPayment($params) + { + global $smarty, $cart; + + $currency = new Currency($this->getModuleCurrency($cart)); + $hipayAccount = ($this->prod ? Configuration::get('HIPAY_ACCOUNT_'.$currency->iso_code) : Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency->iso_code)); + $hipayPassword = ($this->prod ? Configuration::get('HIPAY_PASSWORD_'.$currency->iso_code) : Configuration::get('HIPAY_PASSWORD_TEST_'.$currency->iso_code)); + $hipaySiteId = ($this->prod ? Configuration::get('HIPAY_SITEID_'.$currency->iso_code) : Configuration::get('HIPAY_SITEID_TEST_'.$currency->iso_code)); + $hipayCategory = ($this->prod ? Configuration::get('HIPAY_CATEGORY_'.$currency->iso_code) : Configuration::get('HIPAY_CATEGORY_TEST_'.$currency->iso_code)); + if ($hipayAccount AND $hipayPassword AND $hipaySiteId AND $hipayCategory AND Configuration::get('HIPAY_RATING')) + { + $smarty->assign('hipay_prod', $this->prod); + $smarty->assign(array('this_path' => $this->_path, 'this_path_ssl' => self::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/')); + return $this->display(__FILE__, 'payment.tpl'); + } + } + + private function getModuleCurrency($cart) + { + $id_currency = (int)self::MysqlGetValue('SELECT id_currency FROM `'._DB_PREFIX_.'module_currency` WHERE id_module = '.(int)$this->id); + if (!$id_currency OR $id_currency == -2) + $id_currency = Configuration::get('PS_CURRENCY_DEFAULT'); + elseif ($id_currency == -1) + $id_currency = $cart->id_currency; + return $id_currency; + } + + public function payment() + { + global $cookie, $cart; + + $id_currency = $this->getModuleCurrency($cart); + // If the currency is forced to a different one than the current one, then the cart must be updated + if ($cart->id_currency != $id_currency) + if (Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'cart SET id_currency = '.(int)$id_currency.' WHERE id_cart = '.(int)$cart->id)) + $cart->id_currency = $id_currency; + + $currency = new Currency($id_currency); + $language = new Language($cart->id_lang); + $customer = new Customer($cart->id_customer); + $carrier = new Carrier($cart->id_carrier, $cart->id_lang); + $id_zone = self::MysqlGetValue('SELECT id_zone FROM '._DB_PREFIX_.'address a INNER JOIN '._DB_PREFIX_.'country c ON a.id_country = c.id_country WHERE id_address = '.(int)$cart->id_address_delivery); + + require_once(dirname(__FILE__).'/mapi/mapi_package.php'); + + $hipayAccount = ($this->prod ? Configuration::get('HIPAY_ACCOUNT_'.$currency->iso_code) : Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency->iso_code)); + $hipayPassword = ($this->prod ? Configuration::get('HIPAY_PASSWORD_'.$currency->iso_code) : Configuration::get('HIPAY_PASSWORD_TEST_'.$currency->iso_code)); + $hipaySiteId = ($this->prod ? Configuration::get('HIPAY_SITEID_'.$currency->iso_code) : Configuration::get('HIPAY_SITEID_TEST_'.$currency->iso_code)); + $hipaycategory = ($this->prod ? Configuration::get('HIPAY_CATEGORY_'.$currency->iso_code) : Configuration::get('HIPAY_CATEGORY_TEST_'.$currency->iso_code)); + + $paymentParams = new HIPAY_MAPI_PaymentParams(); + $paymentParams->setLogin($hipayAccount, $hipayPassword); + $paymentParams->setAccounts($hipayAccount, $hipayAccount); + $paymentParams->setDefaultLang(strtolower($language->iso_code).'_'.strtoupper($language->iso_code)); + $paymentParams->setMedia('WEB'); + $paymentParams->setRating(Configuration::get('HIPAY_RATING')); + $paymentParams->setPaymentMethod(HIPAY_MAPI_METHOD_SIMPLE); + $paymentParams->setCaptureDay(HIPAY_MAPI_CAPTURE_IMMEDIATE); + $paymentParams->setCurrency(strtoupper($currency->iso_code)); + $paymentParams->setIdForMerchant($cart->id); + $paymentParams->setMerchantSiteId($hipaySiteId); + $paymentParams->setUrlCancel(self::getHttpHost(true, true).__PS_BASE_URI__.'order.php?step=3'); + $paymentParams->setUrlNok(self::getHttpHost(true, true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key); + $paymentParams->setUrlOk(self::getHttpHost(true, true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key); + $paymentParams->setUrlAck(self::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/validation.php?token='.$cart->secure_key); + $paymentParams->setBackgroundColor('#FFFFFF'); + + if (!$paymentParams->check()) + return $this->l('[Hipay] Error: cannot create PaymentParams'); + + $item = new HIPAY_MAPI_Product(); + $item->setName($this->l('Cart')); + $item->setInfo(''); + $item->setquantity(1); + $item->setRef($cart->id); + $item->setCategory($hipaycategory); + $item->setPrice($cart->getOrderTotal()); + try { + if (!$item->check()) + return $this->l('[Hipay] Error: cannot create "Cart" Product'); + } catch (Exception $e) { + return $this->l('[Hipay] Error: cannot create "Cart" Product'); + } + $items = array($item); + + $order = new HIPAY_MAPI_Order(); + $order->setOrderTitle($this->l('Order total')); + $order->setOrderCategory($hipaycategory); + + if (!$order->check()) + return $this->l('[Hipay] Error: cannot create Order'); + + try { + $commande = new HIPAY_MAPI_SimplePayment($paymentParams, $order, $items); + } catch (Exception $e) { + return $this->l('[Hipay] Error:').' '.$e->getMessage(); + } + + $xmlTx = $commande->getXML(); + //d(htmlentities($xmlTx)); + $output = HIPAY_MAPI_SEND_XML::sendXML($xmlTx); + $reply = HIPAY_MAPI_COMM_XML::analyzeResponseXML($output, $url, $err_msg, $err_keyword, $err_value, $err_code); + + if ($reply === true) + Tools::redirectLink($url); + else + { + global $smarty; + include(dirname(__FILE__).'/../../header.php'); + $smarty->assign('errors', array('[Hipay] '.strval($err_msg).' ('.$output.')')); + $_SERVER['HTTP_REFERER'] = self::getHttpHost(true, true).__PS_BASE_URI__.'order.php?step=3'; + $smarty->display(_PS_THEME_DIR_.'errors.tpl'); + include(dirname(__FILE__).'/../../footer.php'); + } + } + + public function validation() + { + if (!array_key_exists('xml', $_POST)) + return; + + if (_PS_MAGIC_QUOTES_GPC_) + $_POST['xml'] = stripslashes($_POST['xml']); + + require_once(dirname(__FILE__).'/mapi/mapi_package.php'); + + if (HIPAY_MAPI_COMM_XML::analyzeNotificationXML($_POST['xml'], $operation, $status, $date, $time, $transid, $amount, $currency, $id_cart, $data) === false) + { + file_put_contents('logs'.Configuration::get('HIPAY_UNIQID').'.txt', '['.date('Y-m-d H:i:s').'] Analysis error: '.$_POST['xml']."\n", FILE_APPEND); + return false; + } + + $cart = new Cart((int)$id_cart); + if ($cart->secure_key != Tools::getValue('token')) + file_put_contents('logs'.Configuration::get('HIPAY_UNIQID').'.txt', '['.date('Y-m-d H:i:s').'] Token error: '.$_POST['xml']."\n", FILE_APPEND); + else + { + if (trim($operation) == 'capture' AND trim(strtolower($status)) == 'ok') + { + /* Paiement capturé sur Hipay = Paiement accepté sur Prestashop */ + $orderMessage = $operation.': '.$status."\n".'date: '.$date.' '.$time."\n".'transaction: '.$transid."\n".'amount: '.(float)$amount.' '.$currency."\n".'id_cart: '.(int)$id_cart; + $this->validateOrder((int)$id_cart, _PS_OS_PAYMENT_, (float)$amount, $this->displayName, $orderMessage, array(), NULL, false, Tools::getValue('token')); + } + elseif (trim($operation) == 'refund' AND trim(strtolower($status)) == 'ok') + { + /* Paiement remboursé sur Hipay */ + if (!($id_order = Order::getOrderByCartId((int)($id_cart)))) + die(Tools::displayError()); + $order = new Order((int)($id_order)); + if (!$order->valid OR $order->getCurrentState() === _PS_OS_REFUND_) + die(Tools::displayError()); + $orderHistory = new OrderHistory(); + $orderHistory->id_order = (int)($order->id); + $orderHistory->changeIdOrderState((int)(_PS_OS_REFUND_), (int)($id_order)); + $orderHistory->addWithemail(); + } + } + } + + public function getContent() + { + global $currentIndex, $cookie; + + $currencies = DB::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT c.iso_code, c.name, c.sign FROM '._DB_PREFIX_.'currency c'); + + if (Tools::isSubmit('submitHipay')) + { + Configuration::updateValue('HIPAY_PROD', Tools::getValue('HIPAY_PROD')); + $this->prod = (int)Tools::getValue('HIPAY_PROD', Configuration::get('HIPAY_PROD')); + $accounts = array(); + foreach ($currencies as $currency) + { + if (Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) != Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'])) + Configuration::updateValue('HIPAY_CATEGORY_'.$currency['iso_code'], false); + if (Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) != Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code'])) + Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], false); + + Configuration::updateValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_PASSWORD_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_SITEID_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_CATEGORY_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_'.$currency['iso_code'])); + if ($this->prod AND Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])) + $accounts[Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])] = 1; + + Configuration::updateValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_SITEID_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code'])); + Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'])); + if (!$this->prod AND Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])) + $accounts[Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])] = 1; + + + } + $i = 1; + $dataSync = 'http://www.prestashop.com/modules/hipay.png?mode='.($this->prod ? 'prod' : 'test'); + foreach ($accounts as $account => $null) + $dataSync .= '&account'.($i++).'='.urlencode($account); + Configuration::updateValue('HIPAY_RATING', Tools::getValue('HIPAY_RATING')); + echo $this->displayConfirmation($this->l('Configuration updated').''); + } + + // Check configuration + $allow_url_fopen = ini_get('allow_url_fopen'); + $openssl = extension_loaded('openssl'); + $curl = extension_loaded('curl'); + $ping = ($allow_url_fopen AND $openssl AND $fd = fsockopen('payment.hipay.com', 443) AND fclose($fd)); + $online = (in_array(Tools::getRemoteAddr(), array('127.0.0.1', '::1')) ? false : true); + $categories = true; + $categoryRetrieval = true; + foreach ($currencies as $currency) + { + if (($hipaySiteId = Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code']) AND !count($this->getHipayCategories(true, $hipaySiteId, $hipayAccountId))) + OR ($hipaySiteIdTest = Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND $hipayAccountIdTest = Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']) AND !count($this->getHipayCategories(false, $hipaySiteIdTest, $hipayAccountIdTest)))) + $categoryRetrieval = false; + if ((Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND !Configuration::get('HIPAY_CATEGORY_'.$currency['iso_code'])) + OR (Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND !Configuration::get('HIPAY_CATEGORY_TEST_'.$currency['iso_code']))) + $categories = false; + } + if (!$allow_url_fopen OR !$openssl OR !$curl OR !$ping OR !$categories OR !$categoryRetrieval OR !$online) + { + echo ' +
        + '.($allow_url_fopen ? '' : '

        '.$this->l('You are not allowed to open external URLs').'

        ').' + '.($curl ? '' : '

        '.$this->l('cURL is not enabled').'

        ').' + '.($openssl ? '' : '

        '.$this->l('OpenSSL is not enabled').'

        ').' + '.(($allow_url_fopen AND $openssl AND !$ping) ? '

        '.$this->l('Cannot access payment gateway').' '.HIPAY_GATEWAY_URL.' ('.$this->l('check your firewall').')

        ' : '').' + '.($online ? '' : '

        '.$this->l('Your shop is not online').'

        ').' + '.($categories ? '' : '

        '.$this->l('Hipay categories not set for every Site ID').'

        ').' + '.($categoryRetrieval ? '' : '

        '.$this->l('Impossible to retrieve Hipay categories. Please refer to your error log for more details.').'

        ').' +
        '; + } + + $link = $currentIndex.'&configure='.$this->name.'&token='.Tools::getValue('token'); + $form = ' + +
        '.$this->l('Hipay').' + '.$this->l('Hipay is a secure electronic wallet which has the European Bank approval. Hipay offer you many opportunities without need to negotiate with a bank. Easy and free to use, Hipay\'s solution of the implementation is a real asset for an e-commerce website that wants to expand in Europe: secure payment by international card, local payment solutions, bank transfers...').' +
        +
        '.$this->l('Notice: if you want to refund a payment, please log in to your Hipay account then go to Merchant Management > Sales management.').' +
        +
         
        +
        '.$this->l('Configuration').' + '.$this->l('The configuration of Hipay is really easy and runs into 3 steps').'

        + + + + + + + + + + + + + +
        step 1'.(Configuration::get('HIPAY_SITEID') + ? ''.$this->l('Log in to your merchant account').'
        ' + : ''.$this->l('Create a Hipay account').'
        ').' +
        step 2'.$this->l('Active theHipay solution in you Prestashop, it\'s free !').'
        step 3'.$this->l('Enjoy preferred pricing on transactions via Prestashop by').' + ' + .$this->l('contacting our sales department').'
        +
        + + + + + '; + /* + + '; + /* + $form .= '';*/ + foreach ($currencies as $currency) + { + $form .= ' + + + + + '; + /**/ + $form .= ''; + } + $form .= '
         Compte Hipay
        '.$this->l('Account').' + prod ? 'checked="checked"' : '').' + onclick="switchHipayAccount(1);" /> + '.$this->l('real / production').' + + prod ? '' : 'checked="checked"').' + onclick="switchHipayAccount(0);" /> + '.$this->l('sandbox / test').'
        +
        '.$this->l('Configuration in').' '.$currency['name'].' '.$currency['sign'].' +
        +
        +
        +
        +
        +
        '; + if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = (int)Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code'])) + { + $form .= '
        +
        '; + } +/* $form .= '
        +
        +
        +
        +
        +
        +
        ';*/ + if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND $hipayAccountIdTest = (int)Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])) + { + $form .= '
        +
        '; + } + $form .= '
           
        +
        + +
        + +
        +
        +

        '.$this->l('Notice: please verify that the currency mode you have chosen in the payment tab is compatible with your Hipay account(s).').'

        + +
        +
        + '; + return $form; + } + + private function getHipayCategories($prod, $hipaySiteId, $hipayAccountId) + { + if (!is_array($this->arrayCategories)) + { + $this->arrayCategories = array(); + if ($xml = simplexml_load_string(file_get_contents('https://www.prestashop.com/partner/hipay/ws.php?site='.$hipaySiteId.'&accountId='.$hipayAccountId.($prod ? '&prod' : '')))) + { + foreach ($xml->children() as $categoriesList) + foreach ($categoriesList->children() as $category) + $this->arrayCategories[strval($category['id'])] = strval($category); + } + } + return $this->arrayCategories; + } + + // Retro compatibility with 1.2.5 + static private function MysqlGetValue($query) + { + $row = Db::getInstance()->getRow($query); + return array_shift($row); + } + + // Retro compatibility with 1.2.5 + static private function getHttpHost($http = false, $entities = false) + { + $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); + if ($entities) + $host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8'); + if ($http) + $host = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$host; + return $host; + } +} + + diff --git a/modules/hipay/hipay.png b/modules/hipay/hipay.png new file mode 100644 index 000000000..5d8624fe1 Binary files /dev/null and b/modules/hipay/hipay.png differ diff --git a/modules/hipay/it.php b/modules/hipay/it.php new file mode 100644 index 000000000..d7a085af1 --- /dev/null +++ b/modules/hipay/it.php @@ -0,0 +1,46 @@ +hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay'; +$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Pagamento sicuro Visa Mastercard e soluzioni europee.'; +$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Errore: non è possibile creare PaymentParams'; +$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello'; +$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Errore: non è possibile creare prodotti \"Carrello\"'; +$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Ordine totale'; +$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Errore: non può creare l\'Ordine'; +$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Errore:'; +$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'Non hai i permessi per aprire gli URL esterni (allow_url_fopen)'; +$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'cURL non è abilitato'; +$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL non è abilitato'; +$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Impossibile accedere al gateway di pagamento'; +$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'Controlla il tuo firewall'; +$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Il tuo negozio non è online'; +$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'categorie Hipay non impostate per ogni ID del sito'; +$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Impossibile recuperare categorie Hipay. Consulta il log degli errori per ulteriori dettagli.'; +$_MODULE['<{hipay}prestashop>hipay_8f19eb452ad0295c45ca62a099f10dc6'] = 'Hipay è un portafoglio elettronico sicuro che fornisce ai commercianti un pacchetto di servizi completo per le transazioni commerciali on-line: sia per i contenuti digitali, software, musica, abbonamenti, beni fisici ... senza dover negoziare con una banca e senza oneri tecnici.'; +$_MODULE['<{hipay}prestashop>hipay_e5ac60a0713182096ea3f9590f101b25'] = 'Free & Easy, l\'attuazione Hipay è un bene reale per un sito di e-commerce che vuole espandersi in Europa: pagamenti sicuri con carte internazionali, soluzioni di pagamento locali, bonifici ...'; +$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Avviso: se vuoi rimborsare un pagamento, accedi al tuo account Hipay poi vai a Merchant Management > Sales management.'; +$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Accedi al tuo account commerciante'; +$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Crea un account hipay'; +$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Account'; +$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'reale / produzione'; +$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'sandbox / test'; +$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configurazione in'; +$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Numero di account'; +$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Password commerciante'; +$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sito'; +$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Numero account di prova'; +$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Gruppo di età autorizzato'; +$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Per tutte le età'; +$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = 'Per 12 anni e oltre'; +$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = 'Per 16 anni e oltre'; +$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = 'Per 18 anni e oltre'; +$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Nota: verificare che la modalità di valuta che hai scelto nella scheda di pagamento sia compatibile con il tuo/i tuoi account Hipay.'; +$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Aggiorna la configurazione'; +$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Paga con Hipay'; +$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'importo minimo richiesto per pagare con Hipay:'; +$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(Sandbox / modalità di prova)'; diff --git a/modules/hipay/logo.gif b/modules/hipay/logo.gif new file mode 100644 index 000000000..ae91fbef7 Binary files /dev/null and b/modules/hipay/logo.gif differ diff --git a/modules/hipay/mapi/mapi_affiliate.php b/modules/hipay/mapi/mapi_affiliate.php new file mode 100644 index 000000000..0d6590abb --- /dev/null +++ b/modules/hipay/mapi/mapi_affiliate.php @@ -0,0 +1,229 @@ +0, $val est un pourcentage et $percentageTarget détermine + * sur quels montants appliquer le pourcentage + * + * @var unknown_type + */ + protected $percentageTarget; + + /** + * Montant à reversé à l'affilié + * + * @var unknown_type + */ + protected $_amount; + + /** + * Montant de base sur lequel est calculé le montant + * reversé à l'affilié + * + * @var unknown_type + */ + protected $_baseAmount; + + + /** + * Assigne le numéro de client + * + * @param int $customerId + * @return boolean + */ + public function setCustomerId($customerId) { + if ($this->_locked) + return false; + + $customerId = (int)$customerId; + if ($customerId<=0) + return false; + $this->customerId = $customerId; + return true; + } + + /** + * Retourne le numéro de client + * + * @return int + */ + public function getCustomerId() { + return $this->customerId; + } + + /** + * Assigne le numéro de compte + * + * @param int $accountId + * @return boolean + */ + public function setAccountId($accountId) { + if ($this->_locked) + return false; + + $accountId = (int)$accountId; + if ($accountId<=0) + return false; + $this->accountId = $accountId; + return true; + } + + /** + * Retourne le numéro de compte + * + * @return int + */ + public function getAccountId() { + return $this->accountId; + } + + /** + * Assigne le valeur de l'affiliation, qui est un montant fixe ou un pourcentage + * S'il s'agit d'un pourcentage, $percentageTarget représente la cible, c'est à dire sur quels + * montants est basé le montant de l'affiliation + * + * @param float $val + * @param int $percentageTarget + * @return boolean + */ + public function setValue($val,$percentageTarget=0) { + if ($this->_locked) + return false; + + $val = sprintf('%.02f',(float)$val); + $percentageTarget = (int)$percentageTarget; + if ($val<=0 || $percentageTarget<0) + return false; + if ($percentageTarget>0 && $val>100) + return false; + if ($percentageTarget>0 && $percentageTarget>HIPAY_MAPI_TTARGET_ALL) + return false; + $this->val = $val; + $this->percentageTarget = $percentageTarget; + $this->setAmount(); + return true; + } + + /** + * Retourne la valeur de l'affiliation + * + * @return float + */ + public function getValue() { + return $this->val; + } + + /** + * Retourne sur quoi s'applique le pourcentage + * + * @return int + */ + public function getPercentageTarget() { + return $this->percentageTarget; + } + + /** + * Assigne le montant sur lequel sera calculé l'affiliation + * + * @param float $baseAmount + * @return boolean + */ + public function setBaseAmount($baseAmount) { + if ($this->_locked) + return false; + + $baseAmount = sprintf('%.02f',(float)$baseAmount); + + if ($baseAmount<0) + return false; + $this->_baseAmount = $baseAmount; + $this->setAmount(); + return true; + } + + /** + * Retourne le montant sur lequel sera calculé l'affiliation + * + * @return int + */ + public function getBaseAmount() { + return $this->_baseAmount; + } + + + /** + * Retourne le montant calculé de l'affiliation + * + * @return float + */ + public function getAmount() { + return $this->_amount; + } + + /** + * Assigne le montant calculé de l'affiliation + * + */ + protected function setAmount() { + if ($this->percentageTarget>0) { + $this->_amount = sprintf('%.02f',($this->_baseAmount/100)*$this->val); + } else { + $this->_amount = sprintf('%.02f',$this->_baseAmount); + } + } + + /** + * Vérifie que l'objet est bien initialisé + * + * @return boolean + */ + public function check() { + if ($this->customerId<=0 || $this->accountId<=0 || $this->val<=0 || $this->percentageTarget<0) + throw new Exception('Numéro de client, numéro de compte, valeur ou cible incorrects'); + return true; + } + + protected function init() { + $this->customerId = 0; + $this->accountId = 0; + $this->_amount = 0; + $this->_baseAmount = 0; + $this->val = 0; + $this->percentageTarget = 0; + } + + + function __construct() { + $this->init(); + parent::__construct(); + } +} diff --git a/modules/hipay/mapi/mapi_comm_xml.php b/modules/hipay/mapi/mapi_comm_xml.php new file mode 100644 index 000000000..3b942b7f4 --- /dev/null +++ b/modules/hipay/mapi/mapi_comm_xml.php @@ -0,0 +1,122 @@ +result[0]->url)) { + $url = $obj->result[0]->url; + return true; + } + if (isset($obj->result[0]->message)) + $err_msg = $obj->result[0]->message; + if (isset($obj->result[0]->keyword)) + $err_keyword = $obj->result[0]->keyword; + if (isset($obj->result[0]->value)) + $err_value = $obj->result[0]->value; + if (isset($obj->result[0]->code)) + $err_code = $obj->result[0]->code; + return false; + + } + + /** + * Traitement du flux XML envoyé par HiPay notifiant le résultat d'une action sur une transaction + * + * @param string $xml + * @param unknown_type $status + * @param string $date + * @param string $time + * @param string $transid + * @param string $origAmount + * @param string $origCurrency + * @param string $idformerchant + * @param array $merchantdatas + * @return boolean + */ + public static function analyzeNotificationXML($xml,&$operation,&$status,&$date,&$time,&$transid,&$origAmount,&$origCurrency,&$idformerchant,&$merchantdatas) + { + $operation=''; + $status=''; + $date=''; + $time=''; + $transid=''; + $origAmount=''; + $origCurrency=''; + $idformerchant=''; + $merchantdatas=array(); + try { + $obj = new SimpleXMLElement(trim($xml)); + } catch (Exception $e) { + return false; + } + if (isset($obj->result[0]->operation)) + $operation=$obj->result[0]->operation; + else return false; + + if (isset($obj->result[0]->status)) + $status=$obj->result[0]->status; + else return false; + + if (isset($obj->result[0]->date)) + $date=$obj->result[0]->date; + else return false; + + if (isset($obj->result[0]->time)) + $time=$obj->result[0]->time; + else return false; + + if (isset($obj->result[0]->transid)) + $transid=$obj->result[0]->transid; + else return false; + + if (isset($obj->result[0]->origAmount)) + $origAmount=$obj->result[0]->origAmount; + else return false; + + if (isset($obj->result[0]->origCurrency)) + $origCurrency=$obj->result[0]->origCurrency; + else return false; + + if (isset($obj->result[0]->idForMerchant)) + $idformerchant=$obj->result[0]->idForMerchant; + else return false; + + if (isset($obj->result[0]->merchantDatas)) { + $d = $obj->result[0]->merchantDatas->children(); + foreach($d as $xml2) { + if (preg_match('#^_aKey_#i',$xml2->getName())) { + $indice = substr($xml2->getName(),6); + $xml2 = (array)$xml2; + $valeur = (string)$xml2[0]; + $merchantdatas[$indice]=$valeur; + } + } + + } + return true; + + } +} + diff --git a/modules/hipay/mapi/mapi_defs.php b/modules/hipay/mapi/mapi_defs.php new file mode 100644 index 000000000..3ac05eb8a --- /dev/null +++ b/modules/hipay/mapi/mapi_defs.php @@ -0,0 +1,86 @@ +keyword=$keyword; + $this->value=$value; + parent::__construct($msg,$code); + } + + public function getKeyword() { + return $this->keyword; + } + public function getValue() { + return $this->value; + } +} diff --git a/modules/hipay/mapi/mapi_installment.php b/modules/hipay/mapi/mapi_installment.php new file mode 100644 index 000000000..149156c2b --- /dev/null +++ b/modules/hipay/mapi/mapi_installment.php @@ -0,0 +1,208 @@ +_locked) + return false; + + $price = sprintf('%.02f',(float)$price); + if ($price<0) + return false; + $this->price=$price; + return true; + } + + /** + * Retourne le montant HT + * + * @return float + */ + public function getPrice() { + return $this->price; + } + + /** + * Défini s'il s'agit du premier paiement ou des suivants et le délai de déclenchement + * + * @param boolean $first + * @param string $paymentDelay + * @return boolean + */ + public function setFirst($first,$paymentDelay) { + if ($this->_locked) + return false; + if (!is_bool($first)) + return false; + $paymentDelay=trim($paymentDelay); + if ($first) { + if (!preg_match("#[0-9]+[HDM]#",$paymentDelay)) + { + return false; + } + } else { + if (!preg_match("#[0-9]+[DM]#",$paymentDelay)) { + return false; + } + } + $num = (int)substr($paymentDelay,0,strlen($paymentDelay)-1); + if (($num<1 && !$first) || ($num<0 && $first) || $num>365) { + return false; + } + $this->first=$first; + $this->paymentDelay=$paymentDelay; + return true; + } + + /** + * Assigne les taxes s'appliquant à ce paiement + * + * @param array $tax + * @return boolean + */ + public function setTax($tax) { + if ($this->_locked) + return false; + + if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax')) + return false; + foreach ($tax as $obj) + $this->tax[]= clone $obj; + return true; + } + + /** + * assigne le timestamp du premier paiement ou des paiements récurrents + * + */ + public function setDelayTS( $baseTS=0 ) + { + if( (int)$baseTS <= 0 ) { + $baseTS = time(); + } + + switch( substr($this->paymentDelay, -1, 1) ) { + case 'd': case 'D': $unit='day'; break; + case 'm': case 'M': $unit='month'; break; + case 'h': case 'H': + default : $unit='hour'; break; + } + + $this->_delayTS = strtotime( '+'.substr($this->paymentDelay, 0, -1).' '.$unit, $baseTS ); + } + + /** + * Retourne les taxes s'appliquant à ce paiement + * + * @return array + */ + public function getTax() { + return $this->tax; + } + + /** + * Retourne s'il s'agit du premier paiement + * + * @return boolean + */ + public function getFirst() { + return $this->first; + } + + /** + * Retourne le délai de déclenchement + * + * @return string + */ + public function getPaymentDelay() { + return $this->paymentDelay; + } + + /** + * retourne le timestamp du premier paiement + * + */ + public function getDelayTS() + { + return $this->_delayTS; + } + + /** + * Vérifie si l'objet est correctement initialisé + * + * @return float + */ + public function check() { + if ($this->price<0) + throw new Exception('Montant invalide ou pas initilisé'); + if (!HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax')) + throw new Exception('Taxes invalides ou pas initialisées'); + foreach($this->tax as $obj) { + if (!$obj->check()) + return false; + } + if (!is_bool($this->first)) + throw new Exception('Premier paiement ou suivant n\'est pas initialisé'); + return true; + } + + protected function init() + { + $this->price = -1; + $this->tax = array(); + $this->first = ''; + $this->paymentDelay = ''; + $this->_delayTS = ''; + } + + function __construct() { + $this->init(); + parent::__construct(); + } +} diff --git a/modules/hipay/mapi/mapi_item.php b/modules/hipay/mapi/mapi_item.php new file mode 100644 index 000000000..bda1d008a --- /dev/null +++ b/modules/hipay/mapi/mapi_item.php @@ -0,0 +1,36 @@ +_locked=true; + } + + function __construct() { + $this->_locked=false; + } + + +} diff --git a/modules/hipay/mapi/mapi_multiplepayment.php b/modules/hipay/mapi/mapi_multiplepayment.php new file mode 100644 index 000000000..65ea4a06d --- /dev/null +++ b/modules/hipay/mapi/mapi_multiplepayment.php @@ -0,0 +1,44 @@ +getFirst()===$nextInstallment->getFirst() || !$firstInstallment->getFirst()) { + throw new Exception('Vous devez définir un objet installment pour le premier et les paiements suivants'); + } + $firstInstallment->setDelayTS(); + $nextInstallment->setDelayTS( $firstInstallment->getDelayTS() ); + try { + parent::__construct($paymentParams,array($firstOrder,$nextOrder),array($firstInstallment,$nextInstallment)); + } catch(Exception $e) { + throw new Exception($e->getMessage()); + } + + } + + /** + * Retourne le montant total de la somme devant être + * distribuée aux affiliés + */ + protected function _getTotalAmountForAffiliates($installement_nr) { + $affiliates=$this->order[0]->getAffiliate(); + if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliates,'HIPAY_MAPI_Affiliate')) + return false; + $total_aff = 0; + foreach($affiliates as $aff) { + $total_aff+=$aff->getAmount(); + } + return $total_aff; + } + + +} diff --git a/modules/hipay/mapi/mapi_order.php b/modules/hipay/mapi/mapi_order.php new file mode 100644 index 000000000..cd832dd41 --- /dev/null +++ b/modules/hipay/mapi/mapi_order.php @@ -0,0 +1,370 @@ +_locked) + return false; + + $shippingAmount = sprintf('%.02f',(float)$shippingAmount); + if ($shippingAmount<0) { + return false; + } + if (!HIPAY_MAPI_UTILS::is_an_array_of($shippingTax,'HIPAY_MAPI_Tax')) { + return false; + } + $this->shippingAmount=$shippingAmount; + foreach ($shippingTax as $obj) + $this->shippingTax[]= clone $obj; + return true; + } + + /** + * Retourne le montant des frais d'envoi + * + * @return float + */ + public function getShippingAmount() { + return $this->shippingAmount; + } + + /** + * Retourne les taxes s'appliquants aux frais d'envoi + * + * @return array + */ + public function &getShippingTax() { + return $this->shippingTax; + } + + /** + * Défini le montant des assurances + * + * @param float $insuranceAmount + * @param array $insuranceTax + * @return boolean + */ + public function setInsurance($insuranceAmount,$insuranceTax) { + if ($this->_locked) + return false; + + $insuranceAmount = sprintf('%.02f',(float)$insuranceAmount); + if ($insuranceAmount<0) + return false; + if (!HIPAY_MAPI_UTILS::is_an_array_of($insuranceTax,'HIPAY_MAPI_Tax')) + return false; + $this->insuranceAmount=$insuranceAmount; + foreach ($insuranceTax as $obj) + $this->insuranceTax[]= clone $obj; + return true; + } + + /** + * Retourne le montant des assurances + * + * @return float + */ + public function getInsuranceAmount() { + return $this->insuranceAmount; + } + + /** + * Retourne les taxes s'appliquants aux assurances + * + * @return array + */ + public function &getInsuranceTax() { + return $this->insuranceTax; + } + + /** + * Défini le montant des coûts fixes et les taxes s'y appliquant + * + * @param float $fixedCostAmount + * @param array $fixedCostTax + * @return boolean + */ + public function setFixedCost($fixedCostAmount,$fixedCostTax) { + if ($this->_locked) + return false; + + $fixedCostAmount = sprintf('%.02f',(float)$fixedCostAmount); + if ($fixedCostAmount<0) + return false; + if (!HIPAY_MAPI_UTILS::is_an_array_of($fixedCostTax,'HIPAY_MAPI_Tax')) + return false; + $this->fixedCostAmount=$fixedCostAmount; + foreach ($fixedCostTax as $obj) + $this->fixedCostTax[]= clone $obj; + return true; + } + + /** + * Retourne le montant des coûts fixes + * + * @return float + */ + public function getFixedCostAmount() { + return $this->fixedCostAmount; + } + + /** + * Retourne les taxes s'appliquant aux coûts fixes + * + * @return array + */ + public function &getFixedCostTax() { + return $this->fixedCostTax; + } + + /** + * Défini les affiliés qui recevront une rétribution pour cette commande + * + * @param array $affiliate + * @return boolean + */ + public function setAffiliate($affiliate) { + if ($this->_locked) + return false; + + if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliate,'HIPAY_MAPI_Affiliate')) + return false; + foreach ($affiliate as $obj) + $this->affiliate[]= clone $obj; + return true; + } + + /** + * Retourne la liste des affiliés de cette commande + * + * @return array + */ + public function &getAffiliate() { + return $this->affiliate; + } + + /** + * Assigne l'intitulé de la commande + * + * @param string $orderTitle + * @return boolean + */ + public function setOrderTitle($orderTitle) { + if ($this->_locked) + return false; + + $orderTitle = HIPAY_MAPI_UTF8::forceUTF8($orderTitle); + $len=HIPAY_MAPI_UTF8::strlen_utf8($orderTitle); + if ($len<1 || $len>HIPAY_MAPI_MAX_TITLE_LENGTH) + return false; + $this->orderTitle=$orderTitle; + return true; + } + + /** + * Retourne l'intitulé de la commande + * + * @return string + */ + public function getOrderTitle() { + return $this->orderTitle; + } + + /** + * Assigne les infos sur la commande + * + * @param string $orderInfo + * @return boolean + */ + public function setOrderInfo($orderInfo) { + if ($this->_locked) + return false; + + $orderInfo = HIPAY_MAPI_UTF8::forceUTF8($orderInfo); + $len=HIPAY_MAPI_UTF8::strlen_utf8($orderInfo); + if ($len>HIPAY_MAPI_MAX_INFO_LENGTH) + return false; + $this->orderInfo=$orderInfo; + return true; + } + + /** + * Retourne les infos sur la commande + * + * @return string + */ + public function getOrderInfo() { + return $this->orderInfo; + } + + + /** + * Assigne la catégorie de la commande + * + * @param int $orderCategory + * @return boolean + */ + public function setOrderCategory($orderCategory) { + if ($this->_locked) + return false; + + $orderCategory = (int)$orderCategory; + if ($orderCategory<1) + return false; + $this->orderCategory=$orderCategory; + return true; + } + + /** + * Retourne la catégorie de la commande + * + * @return int + */ + public function getOrderCategory() { + return $this->orderCategory; + } + + + /** + * Vérifie si l'objet est correctement initialisé + * + * @return boolean + */ + public function check() { + if ($this->orderTitle=='' || $this->orderCategory<0) + throw new Exception('L\'intitulé et/ou la catégorie de la commande sont manquants'); + + foreach($this->affiliate as $obj) { + try { + $obj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + + } + foreach($this->shippingTax as $obj) { + try { + $obj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + } + foreach($this->insuranceTax as $obj) { + try { + $obj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + } + foreach($this->fixedCostTax as $obj) { + try { + $obj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + } + return true; + } + + protected function init() { + $this->shippingAmount=0; + $this->shippingTax=array(); + $this->insuranceAmount=0; + $this->insuranceTax=array(); + $this->fixedCostAmount=0; + $this->fixedCostTax=array(); + $this->affiliate=array(); + $this->orderTitle=''; + $this->orderInfo=''; + $this->orderCategory=-1; + + } + + + function __construct() { + $this->init(); + parent::__construct(); + } +} diff --git a/modules/hipay/mapi/mapi_package.php b/modules/hipay/mapi/mapi_package.php new file mode 100644 index 000000000..e26022158 --- /dev/null +++ b/modules/hipay/mapi/mapi_package.php @@ -0,0 +1,20 @@ +init($paymentParams,$order,$items); + } catch(Exception $e) { + throw new Exception($e->getMessage()); + } + } + + protected function init($paymentParams,$order,$items) { + if (!($paymentParams instanceof HIPAY_MAPI_PaymentParams) + || !HIPAY_MAPI_UTILS::is_an_array_of($order,'HIPAY_MAPI_Order') + || !HIPAY_MAPI_UTILS::is_an_array_of($items,'HIPAY_MAPI_Item') + || count($items)<1) + throw new Exception('Wrong parameters'); + + try { + $paymentParams->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + foreach($order as $orderObj) { + try { + $orderObj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + } + + foreach($items as $obj) + try { + $obj->check(); + } catch (Exception $e) { + throw new Exception($e->getMessage()); + } + + $this->paymentParams= clone $paymentParams; + $this->paymentParams->lock(); + + + foreach($order as $obj) { + $this->order[]= clone $obj; + end($this->order)->lock(); + $this->_taxItemsAmount[]=0; + $this->_taxShippingAmount[]=0; + $this->_taxInsuranceAmount[]=0; + $this->_taxFixedCostAmount[]=0; + $this->_itemsTotalAmount[]=0; + $this->_taxTotalAmount[]=0; + $this->_orderTotalAmount[]=0; + $this->_affiliateTotalAmount[]=0; + + } + foreach($items as $obj) { + $this->items[]= clone $obj; + end($this->items)->lock(); + } + try { + $this->compute(); + } catch(Exception $e) { + throw new Exception($e->getMessage()); + } + } + + /** + * Calcul les différents montants (taxes, affiliés, totaux) de la commande + * + */ + protected function compute() { + + // Mise à jour du montant total des taxes pour chaque item du tableau _taxItemsAmount + // Mise à jour du montant total des taxes de livraison pour chaque order du tableau _taxShippingAmount + // Mise à jour du montant total des taxes d'assurances pour chaque order du tableau _taxInsuranceAmount + // Mise à jour du montant total des taxes de couts fixes pour chaque order du tableau _taxFixedCostAmount + $this->computeTaxes(); + // Mise a jour du montant total HT des produits pour chaque item du tableau _itemsTotalAmount + $this->computeItemsAmount(); + // Pour chaque commande + foreach($this->order as $key=>$order) { + $this->_taxTotalAmount[$key] = $this->_taxItemsAmount[$key] + $this->_taxShippingAmount[$key] + $this->_taxInsuranceAmount[$key] + $this->_taxFixedCostAmount[$key]; + $this->_orderTotalAmountHT[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key]; + $this->_orderTotalAmount[$key] = $this->_orderTotalAmountHT[$key] + $this->_taxTotalAmount[$key]; +// $this->_orderTotalAmount[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key] + +// $this->_taxItemsAmount[$key] + +// $this->_taxShippingAmount[$key] + +// $this->_taxInsuranceAmount[$key] + +// $this->_taxFixedCostAmount[$key]; + } + try { + $this->computeAffiliates(); + } catch(Exception $e) { + throw new Exception($e->getMessage()); + } + } + + + /** + * Calcul le montant des taxes + * + */ + protected function computeTaxes() { + + // Taxes sur les produits au niveau de l'item (ligne de commande) + // @FIXME bug et confusion entre indice d'item et indice d'order ? + $cur=0; + // pour chaque ligne de commande + foreach($this->items as $item) { + // Liste des taxes de la ligne + $itemTaxes= $item->getTax(); + $tItemsAmount=0; + // pour chaque taxe appliquée sur cette ligne + foreach($itemTaxes as $tax) { + $amount=HIPAY_MAPI_UTILS::computeTax($item->getPrice(),$tax); + $tax->setTaxAmount($amount); + $tax->lock(); + // mise a jour du montant total des taxes pour cet item (ligne de commande) + $tItemsAmount+=$amount; + } + if (!isset($this->order[$cur])) + $cur=0; + if (!isset($this->_taxItemsAmount[$cur])) + $this->_taxItemsAmount[$cur]=0; + // mise a jour du montant total des taxes pour cette ligne de commande + // avec prise en compte du nombre de produits dans l'indice numLigneCommande + // du tableau _taxItemsAmount de cette commande + $this->_taxItemsAmount[$cur]+=($tItemsAmount*$item->getQuantity()); + $item->lock(); + $cur++; + } + + // Taxes sur frais d'envoi, assurances, coûts fixes + // au niveau des commandes + $cur=0; + foreach($this->order as $order) { + // Taxes sur frais d'envoi + $taxArr =& $order->getShippingTax(); + foreach($taxArr as $key=>$tax) { + $amount=HIPAY_MAPI_UTILS::computeTax($order->getShippingAmount(),$tax); + $taxArr[$key]->setTaxAmount($amount); + $taxArr[$key]->lock(); + + if (!isset($this->_taxShippingAmount[$cur])) + $this->_taxShippingAmount[$cur]=0; + $this->_taxShippingAmount[$cur]+=$amount; + } + // Taxes sur assurances + $taxArr =& $order->getInsuranceTax(); + foreach($taxArr as $key=>$tax) { + $amount=HIPAY_MAPI_UTILS::computeTax($order->getInsuranceAmount(),$tax); + $taxArr[$key]->setTaxAmount($amount); + $taxArr[$key]->lock(); + if (!isset($this->_taxInsuranceAmount[$cur])) + $this->_taxInsuranceAmount[$cur]=0; + $this->_taxInsuranceAmount[$cur]+=$amount; + } + // Taxes sur coûts fixes + $taxArr =& $order->getFixedCostTax(); + foreach($taxArr as $key=>$tax) { + $amount=HIPAY_MAPI_UTILS::computeTax($order->getFixedCostAmount(),$tax); + $taxArr[$key]->setTaxAmount($amount); + $taxArr[$key]->lock(); + if (!isset($this->_taxFixedCostAmount[$cur])) + $this->_taxFixedCostAmount[$cur]=0; + $this->_taxFixedCostAmount[$cur]+=$amount; + } + $cur++; + } + } + + /** + * Calcul le montant total HT des produits + * + */ + protected function computeItemsAmount() { + $itemsAmount=0; + $cur=0; + foreach($this->items as $item) { + $mt=sprintf("%.02f",$item->getPrice()*$item->getQuantity()); + + if (!isset($this->order[$cur])) + $cur=0; + if (!isset($this->_itemsTotalAmount[$cur])) + $this->_itemsTotalAmount[$cur]=0; + $this->_itemsTotalAmount[$cur]+=$mt; + $cur++; + } + } + + /** + * Retourne le montant total des taxes + * + * @param array $tItemsAmount + * @param array $tShippingAmount + * @param array $tInsuranceAmount + * @param array $tFixedCostAmount + */ + public function getTotalTaxes(&$tItemsAmount,&$tShippingAmount,&$tInsuranceAmount,&$tFixedCostAmount) { + $tItemsAmount=$this->getItemsTaxes(); + $tShippingAmount=$this->getShippingTaxes(); + $tInsuranceAmount=$this->getInsuranceTaxes(); + $tFixedCostAmount=$this->getFixedCostTaxes(); + } + + /** + * Retourne le montant des taxes sur les articles + * + * @return float + */ + public function getItemsTaxes() { + return $this->_taxItemsAmount; + } + + /** + * Retourne le montant des taxes sur les frais de port + * + * @return float + */ + public function getShippingTaxes() { + return $this->_taxShippingAmount; + } + + /** + * Retourne le montant des taxes sur les assurances + * + * @return float + */ + public function getInsuranceTaxes() { + return $this->_taxInsuranceAmount; + } + + /** + * Retourne le montant des taxes sur les couts fixes + * + * @return float + */ + public function getFixedCostTaxes() { + return $this->_taxFixedCostAmount; + } + + /** + * Retourne le montant total des produits + * + * @return array + */ + public function getItemsTotalAmount() { + return $this->_itemsTotalAmount; + } + + /** + * Retourne le montant total des taxes + * + * @return array + */ + public function getTaxesTotalAmount() { + return $this->_taxTotalAmount; + } + + /** + * Retourne le montant total hors taxes de la commande + * + * @return array + */ + public function getOrderTotalAmountHT() { + return $this->_orderTotalAmountHT; + } + + /** + * Retourne le montant total TTC de la commande + * + * @return array + */ + public function getOrderTotalAmount() { + return $this->_orderTotalAmount; + } + + /** + * Retourne le montant total des affiliés + * + * @return array + */ + public function getAffiliateTotalAmount() { + return $this->_affiliateTotalAmount; + } + + /** + * Retourne les objets order + * + * @return array + */ + public function getOrder() { + return $this->order; + } + + /** + * Retourne les objets items + * + * @return array + */ + public function getItems() { + return $this->items; + } + + /** + * Retourne l'objet paramètre + * + * @return HIPAY_MAPI_PaymentParams + */ + public function getPaymentParams() { + return $this->paymentParams; + } + + + /** + * Calcul les montants à redistribuer aux affiliés + * + */ + protected function computeAffiliates() { + + + foreach($this->order as $k=>$order) { + $totalAmount=0; + $tAffiliate = $order->getAffiliate(); + foreach($tAffiliate as $key=>$affiliate) { + $baseAmount=0; + $percentageTarget= $affiliate->getPercentageTarget(); + if ($percentageTarget>0) { + if ($percentageTarget & HIPAY_MAPI_TTARGET_ITEM) + $baseAmount+=$this->_itemsTotalAmount[$k]; + if ($percentageTarget & HIPAY_MAPI_TTARGET_TAX) + $baseAmount+=$this->_taxItemsAmount[$k]+$this->_taxFixedCostAmount[$k]+$this->_taxInsuranceAmount[$k]+$this->_taxShippingAmount[$k]; + if ($percentageTarget& HIPAY_MAPI_TTARGET_INSURANCE) + $baseAmount+=$order->getInsuranceAmount(); + if ($percentageTarget & HIPAY_MAPI_TTARGET_FCOST) + $baseAmount+=$order->getFixedCostAmount(); + if ($percentageTarget & HIPAY_MAPI_TTARGET_SHIPPING) + $baseAmount+=$order->getShippingAmount(); + $tAffiliate[$key]->setBaseAmount($baseAmount); + } else { + $baseAmount = $affiliate->getValue(); + $tAffiliate[$key]->setBaseAmount($baseAmount); + } + $totalAmount+=$tAffiliate[$key]->getAmount(); + $tAffiliate[$key]->lock(); + } + $this->_affiliateTotalAmount[$k]=$totalAmount; + if ($totalAmount > $this->_orderTotalAmount[$k]) { + throw new Exception('Le montant à redistribuer est supérieur au montant de la transaction ('.$totalAmount.'/'.$this->_orderTotalAmount.')'); + } + } + + } + + + +} diff --git a/modules/hipay/mapi/mapi_paymentparams.php b/modules/hipay/mapi/mapi_paymentparams.php new file mode 100644 index 000000000..9f5f56e59 --- /dev/null +++ b/modules/hipay/mapi/mapi_paymentparams.php @@ -0,0 +1,849 @@ +_locked) + return false; + $login = HIPAY_MAPI_UTF8::forceUTF8($login); + if (empty($login)) + return false; + $password = HIPAY_MAPI_UTF8::forceUTF8($password); + if (empty($password)) + return false; + $this->login=$login; + $this->password=$password; + return true; + } + + /** + * Retourne le login + * + * @return string + */ + public function getLogin() { + return $this->login; + } + + /** + * Retourne le mot de passe + * + * @return string + */ + public function getPassword() { + return $this->password; + } + + /** + * Assigne les comptes sur lesquels seront versés les différents montants + * + * @param int $itemAccount + * @param int $taxAccount + * @param int $insuranceAccount + * @param int $fixedCostAccount + * @param int $shippingCostAccount + * @return boolean + */ + public function setAccounts($itemAccount,$taxAccount=0,$insuranceAccount=0,$fixedCostAccount=0,$shippingCostAccount=0) { + if ($this->_locked) + return false; + + $itemAccount=(int)$itemAccount; + $taxAccount=(int)$taxAccount; + $insuranceAccount=(int)$insuranceAccount; + $fixedCostAccount=(int)$fixedCostAccount; + $shippingCostAccount=(int)$shippingCostAccount; + + if ($itemAccount<=0) + return false; + if ($taxAccount<=0) + $taxAccount=$itemAccount; + if ($insuranceAccount<=0) + $insuranceAccount=$itemAccount; + if ($fixedCostAccount<=0) + $fixedCostAccount=$itemAccount; + if ($shippingCostAccount<=0) + $shippingCostAccount=$itemAccount; + $this->itemAccount = $itemAccount; + $this->taxAccount = $taxAccount; + $this->insuranceAccount = $insuranceAccount; + $this->fixedCostAccount = $fixedCostAccount; + $this->shippingCostAccount = $shippingCostAccount; + return true; + } + + /** + * Retourne le numéro de compte sur lequel sera versé + * le montant de produits + * + * @return int + */ + public function getItemAccount() { + return $this->itemAccount; + } + + /** + * Retourne le numéro de compte sur lequel sera versé + * le montant des taxes + * + * @return int + */ + public function getTaxAccount() { + return $this->taxAccount; + } + + /** + * Retourne le numéro de compte sur lequel sera versé + * le montant des assurances + * + * @return int + */ + public function getInsuranceAccount() { + return $this->insuranceAccount; + } + + /** + * Retourne le numéro de compte sur lequel sera versé + * le montant des coûts fixes + * + * @return int + */ + public function getFixedCostAccount() { + return $this->fixedCostAccount; + } + + /** + * Retourne le numéro de compte sur lequel sera versé + * le montant des frais d'envoi + * + * @return int + */ + public function getShippingCostAccount() { + return $this->shippingCostAccount; + } + + /** + * Assigne la lange par défaut (AZ_az = pays_langue) + * + * @param string $defaultLang + * @return boolean + */ + public function setDefaultLang($defaultLang) { + if ($this->_locked) + return false; + + if (!preg_match('#^[A-Z]{2}_[a-z]{2}$#',$defaultLang)) + return false; + $this->defaultLang=$defaultLang; + return true; + } + + /** + * Retourne la langue par défaut + * + * @return string + */ + public function getDefaultLang() { + return $this->defaultLang; + } + + /** + * Défini le type d'interface de paiement + * + * @param string $media + * @return boolean + */ + public function setMedia($media) { + if ($this->_locked) + return false; + + if (!preg_match('#^[A-Z]+$#',$media)) + return false; + $this->media=$media; + return true; + } + + /** + * Retourne le type d'interface de paiement + * + * @return string + */ + public function getMedia() { + return $this->media; + } + + /** + * Défini le public visé + * + * @param string $rating + * @return boolean + */ + public function setRating($rating) { + if ($this->_locked) + return false; + + $rating = trim(substr($rating,0,HIPAY_MAPI_MAX_RATING_LENGTH)); + if ($rating=='') + return false; + $this->rating=$rating; + return true; + } + + /** + * Retourne le type de public visé + * + * @return string + */ + public function getRating() { + return $this->rating; + } + + /** + * Défini si le paiement est simple ou récurrent + * + * @param int $paymentMethod + * @return boolean + */ + public function setPaymentMethod($paymentMethod) { + if ($this->_locked) + { + return false; + } + + $paymentMethod = (int)$paymentMethod; + if ($paymentMethod!=HIPAY_MAPI_METHOD_SIMPLE && $paymentMethod!=HIPAY_MAPI_METHOD_MULTI) + return false; + $this->paymentMethod=$paymentMethod; + return true; + } + + /** + * Retourne le type de paiement (simple ou récurrent) + * + * @return int + */ + public function getPaymentMethod() { + return $this->paymentMethod; + } + + /** + * Défini le délai de capture + * + * @param int $captureDay + * @return boolean + */ + public function setCaptureDay($captureDay) { + if ($this->_locked) + return false; + + $captureDay = (int)$captureDay; + if (($captureDay!=HIPAY_MAPI_CAPTURE_MANUAL && $captureDay!=HIPAY_MAPI_CAPTURE_IMMEDIATE && $captureDay<=0) || $captureDay>HIPAY_MAPI_CAPTURE_MAX_DAYS) + return false; + $this->captureDay=$captureDay; + return true; + + } + + /** + * Retourne le délai de capture + * + * @return int + */ + public function getCaptureDay() { + return $this->captureDay; + } + + /** + * Défini la devise + * + * @param string $currency + * @return boolean + */ + public function setCurrency($currency) { + if ($this->_locked) + return false; + + if (!preg_match('#^[A-Z]{3}$#',$currency)) + return false; + $this->currency = $currency; + return true; + } + + /** + * Retourne la devise + * + * @return string + */ + public function getCurrency() { + return $this->currency; + } + + + + /** + * Défini l'identifiant du groupe statistique auquel appartient ce paiement + * + * @param int $statsGroupId + * @return boolean + */ + public function setStatsGroupId($statsGroupId) { + if ($this->_locked) + return false; + + $statsGroupId=(int)$statsGroupId; + if ($statsGroupId<0) + return false; + $this->statsGroupId=$statsGroupId; + return true; + } + + + /** + * Retourne l'identifiant du groupe statistique auquel appartient ce paiement + * + * @return int + */ + public function getStatsGroupId() { + return $this->statsGroupId; + } + + + /** + * Défini l'identifiant de cette vente chez le marchand + * + * @param string $idForMerchant + * @return boolean + */ + public function setIdForMerchant($idForMerchant) { + if ($this->_locked) + return false; + + $this->idForMerchant=$idForMerchant; + return true; + } + + /** + * Retourne l'identifiant de la vente pour le marchand + * + * @return string + */ + public function getIdForMerchant() { + return $this->idForMerchant; + } + + /** + * Défini l'identifiant du site marchand + * + * @param int $merchantSiteId + * @return boolean + */ + public function setMerchantSiteId($merchantSiteId) { + if ($this->_locked) + return false; + + $merchantSiteId=(int)$merchantSiteId; + if ($merchantSiteId<0) + return false; + $this->merchantSiteId=$merchantSiteId; + return true; + } + + /** + * Retourne l'identifiant du site marchand + * + * @return int + */ + public function getMerchantSiteId() { + return $this->merchantSiteId; + } + + /** + * Assigne des données marchandes + * + * @param string $merchantDatas + * @return boolean + */ + public function setMerchantDatas($key,$merchantDatas) { + if ($this->_locked) + return false; + if ($key=='') + return false; + $merchantDatas=substr($merchantDatas,0,HIPAY_MAPI_MAX_MDATAS_LENGTH); + $this->merchantDatas[$key]=$merchantDatas; + return true; + } + + /** + * Retourne les données marchandes + * + * @return array + */ + public function getMerchantDatas() { + return $this->merchantDatas; + + } + + /** + * Assigne l'url à appeller si le paiement est ok + * + * @param string $url_ok + * @return unknown + */ + public function setUrlOk($url_ok) { + if ($this->_locked) + return false; + $url_ok = trim($url_ok); + if (!HIPAY_MAPI_UTILS::checkURL($url_ok) && $url_ok!='') + return false; + $this->url_ok=$url_ok; + return true; + } + + /** + * Retourne l'url_ok + * + * @return string + */ + public function getUrlOk() { + return $this->url_ok; + + } + + /** + * Assigne l'url à appeller si le paiement n'est pas ok + * + * @param string $url_nok + * @return unknown + */ + public function setUrlNok($url_nok) { + if ($this->_locked) + return false; + $url_nok = trim($url_nok); + if (!HIPAY_MAPI_UTILS::checkURL($url_nok) && $url_nok!='') + return false; + $this->url_nok=$url_nok; + return true; + } + + /** + * Retourne l'url_nok + * + * @return string + */ + public function getUrlNok() { + return $this->url_nok; + + } + + /** + * Assigne l'url à appeller si le paiement est annulé + * + * @param string $url_cancel + * @return boolean + */ + public function setUrlCancel($url_cancel) { + if ($this->_locked) + return false; + $url_cancel = trim($url_cancel); + if (!HIPAY_MAPI_UTILS::checkURL($url_cancel) && $url_cancel!='') + return false; + $this->url_cancel=$url_cancel; + return true; + } + + /** + * Retourne l'url_cancel + * + * @return string + */ + public function getUrlCancel() { + return $this->url_cancel; + } + + + /** + * Assigne l'url à appeller pour notifier le paiement + * + * @param string $url_cancel + * @return boolean + */ + public function setUrlAck($url_ack) { + if ($this->_locked) + return false; + $url_ack = trim($url_ack); + if (!HIPAY_MAPI_UTILS::checkURL($url_ack) && $url_ack!='') + return false; + $this->url_ack=$url_ack; + return true; + } + + /** + * Retourne l'url_ack + * + * @return string + */ + public function getUrlAck() { + return $this->url_ack; + } + + + + + /** + * Assigne le mot clé d'acquittement + * + * @param string $ack_wd + * @return boolean + */ + public function setAckWd($ack_wd) { + if ($this->_locked) + return false; + $ack_wd=trim($ack_wd); + if (strlen($ack_wd)>HIPAY_MAPI_MAX_ACKWD_LENGTH) + return false; + $this->ack_wd=$ack_wd; + return true; + } + + /** + * Retourne le mot clé d'acquittement + * + * @return string + */ + public function getAckWd() { + return $this->ack_wd; + } + + /** + * Assigne l'adresse email de notification de paiement + * + * @param string $email_ack + * @return boolean + */ + public function setEmailAck($email_ack) { + if ($this->_locked) + return false; + $email_ack=trim($email_ack); + if (strlen($email_ack)>HIPAY_MAPI_MAX_ACKMAIL_LENGTH || (!HIPAY_MAPI_UTILS::checkemail($email_ack) && $email_ack!='')) + return false; + $this->email_ack=$email_ack; + return true; + } + + /** + * Retourne l'email de notification + * + * @return string + */ + public function getEmailAck() { + return $this->email_ack; + } + + /** + * Assigne la couleur de fond de l'interface (#XXXXXX) + * + * @param string $bg_color + * @return boolean + */ + public function setBackgroundColor($bg_color) { + if ($this->_locked) + return false; + $bg_color = trim($bg_color); + if (!preg_match('#^\#([0-9a-f]){6}$#i', $bg_color) && $bg_color != '') + return false; + $this->bg_color = $bg_color; + return true; + } + + /** + * Retourne la couleur de fond de l'interface + * + * @return string + */ + public function getBackgroundColor() { + return $this->bg_color; + } + + + /** + * Assigne l'url du logo du marchand + * + * @param string $logo_url + * @return boolean + */ + public function setLogoUrl($logo_url) { + if ($this->_locked) + return false; + $logo_url = trim($logo_url); + if (!HIPAY_MAPI_UTILS::checkURL($logo_url) && $logo_url!='') + return false; + $this->logo_url=$logo_url; + return true; + } + + /** + * Retourne l'url du logo du marchand + * + * @return string + */ + public function getLogoUrl() { + return $this->logo_url; + } + + + /** + * Vérifie que l'objet est correctement initialisé + * + * @return boolean + */ + public function check() { + if ($this->login=='') + throw new Exception('Nom d\'utilisateur manquant'); + if ($this->itemAccount<=0 || $this->taxAccount<=0 || $this->insuranceAccount <=0 || + $this->fixedCostAccount<=0 || $this->shippingCostAccount<=0) + throw new Exception('Numéros de compte invalides'); + if ($this->rating=='') + throw new Exception('Type de public visé invalide'); + if ($this->paymentMethod<0) + throw new Exception('Type de paiement invalide'); + if ($this->captureDay==-100) + throw new Exception('Délai de capture invalide '); + if ($this->currency=='') + throw new Exception('Devise non-définie'); + if ($this->idForMerchant<0) + throw new Exception('ID chez le marchand manquant'); + if ($this->idForMerchant>0) + if ($this->password=='') + throw new Exception('Mot de passe manquant'); + if ($this->statsGroupId<0) + throw new Exception('ID groupe est négatif'); + if ($this->merchantSiteId<0) + throw new Exception('ID du site marchand manquant'); + return true; + } + + protected function init() { + $this->login=''; + $this->password=''; + $this->itemAccount=0; + $this->taxAccount=0; + $this->insuranceAccount=0; + $this->fixedCostAccount=0; + $this->shippingCostAccount=0; + $this->defaultLang=HIPAY_MAPI_DEFLANG; + $this->media=HIPAY_MAPI_DEFMEDIA; + $this->rating=''; + $this->paymentMethod=-1; + $this->captureDay=-100; + $this->currency=''; + $this->idForMerchant=-1; + $this->statsGroupId=0; + $this->merchantSiteId=-1; + $this->merchantDatas=array(); + $this->url_ok=''; + $this->url_nok=''; + $this->url_cancel=''; + $this->url_ack=''; + $this->ack_wd=''; + $this->email_ack=''; + $this->bg_color=''; + $this->logo_url=''; + } + + function __construct() { + $this->init(); + parent::__construct(); + } +} + diff --git a/modules/hipay/mapi/mapi_product.php b/modules/hipay/mapi/mapi_product.php new file mode 100644 index 000000000..279d8f8a5 --- /dev/null +++ b/modules/hipay/mapi/mapi_product.php @@ -0,0 +1,274 @@ +_locked) + return false; + + $name = HIPAY_MAPI_UTF8::forceUTF8($name); + $len=HIPAY_MAPI_UTF8::strlen_utf8($name); + if ($len<1 || $len>HIPAY_MAPI_MAX_PRODUCT_NAME_LENGTH) + return false; + $this->name=$name; + return true; + } + + /** + * Retourne le nom du produit + * + * @return string + */ + public function getName() { + return $this->name; + } + + /** + * Assigne les informations sur le produit + * + * @param string $info + * @return boolean + */ + public function setInfo($info) { + if ($this->_locked) + return false; + + $info = HIPAY_MAPI_UTF8::forceUTF8($info); + $len=HIPAY_MAPI_UTF8::strlen_utf8($info); + if ($len>HIPAY_MAPI_MAX_PRODUCT_INFO_LENGTH) + return false; + $this->info=$info; + return true; + } + + /** + * Retourne les informations sur le produit + * + * @return string + */ + public function getInfo() { + return $this->info; + } + + /** + * Assigne la quantité de produit + * + * @param int $quantity + * @return boolean + */ + public function setQuantity($quantity) { + if ($this->_locked) + return false; + + $quantity=(int)$quantity; + if ($quantity<1) + return false; + $this->quantity=$quantity; + return true; + } + + /** + * Retourne la quantité de produit + * + * @return int + */ + public function getQuantity() { + return $this->quantity; + } + + /** + * Assigne la réference du produit + * + * @param string $ref + * @return boolean + */ + public function setRef($ref) { + if ($this->_locked) + return false; + + $ref = HIPAY_MAPI_UTF8::forceUTF8($ref); + $len=HIPAY_MAPI_UTF8::strlen_utf8($ref); + if ($len>HIPAY_MAPI_MAX_PRODUCT_REF_LENGTH) + return false; + $this->ref=$ref; + return true; + } + + /** + * Retourne la réference du produit + * + * @return string + */ + public function getRef() { + return $this->ref; + } + + + /** + * Assigne la catégorie du produit + * + * @param int $category + * @return boolean + */ + public function setCategory($category) { + if ($this->_locked) + return false; + + $category = (int)$category; + if ($category<1) + return false; + $this->category=$category; + return true; + } + + /** + * Retourne la catégorie du produit + * + * @return int + */ + public function getCategory() { + return $this->category; + } + + /** + * Assigne le montant unitaire HT du produit + * + * @param float $price + * @return boolean + */ + public function setPrice($price) { + if ($this->_locked) + return false; + + $price = sprintf('%.02f',(float)$price); + if ($price<0) + return false; + $this->price=$price; + return true; + } + + /** + * Retourne montant unitaire HT du produit + * + * @return float + */ + public function getPrice() { + return $this->price; + } + + /** + * Assigne les taxes s'appliquant à ce produit + * + * @param array $tax + * @return boolean + */ + public function setTax($tax) { + if ($this->_locked) + return false; + + if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax')) + return false; + foreach ($tax as $obj) + $this->tax[]= clone $obj; + return true; + } + + /** + * Retourne les taxes s'appliquant à ce produit + * + * @return array + */ + public function getTax() { + return $this->tax; + } + + /** + * Vérifie que l'objet est correctement initialisé + * + * @return boolean + */ + public function check() { + if ($this->name=='' || $this->quantity<0 || $this->category<0 || $this->price<0 || !HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax')) + throw new Exception('L\'objet n\'à pas été initilisé. Vous devez préciser un nom de produit, une quantité, un prix, une catégorie et des taxes'); + foreach($this->tax as $obj) { + if (!$obj->check()) + return false; + } + return true; + } + + protected function init() { + $this->name=''; + $this->info=''; + $this->quantity=-1; + $this->ref=''; + $this->category=-1; + $this->price=-1; + $this->tax=array(); + } + + function __construct() { + $this->init(); + parent::__construct(); + } + +} + diff --git a/modules/hipay/mapi/mapi_send_xml.php b/modules/hipay/mapi/mapi_send_xml.php new file mode 100644 index 000000000..5187b404d --- /dev/null +++ b/modules/hipay/mapi/mapi_send_xml.php @@ -0,0 +1,82 @@ +Network problem ? Verify your proxy configuration in mapi_defs.php'; + } + else $output = ob_get_contents(); + ob_end_clean(); + curl_close($curl); + if(HIPAY_MAPI_CURL_LOG_ON === true) + { + fclose($errorFileLog); + } + return $output; + } + + /** + * Prépare le flux XML + * + * @param string $xml + * @return string + */ + public static function prepare($xml) { + $cleanXML=''; + $xml = trim($xml); + $md5 = hash('md5',$xml); + $cleanXML="\n"; + $cleanXML.="\n"; + $cleanXML.="".MAPI_VERSION."\n"; + $cleanXML.=''.$md5."\n"; + $cleanXML.=$xml; + $cleanXML.="\n\n"; + return trim($cleanXML); + } +} diff --git a/modules/hipay/mapi/mapi_simplepayment.php b/modules/hipay/mapi/mapi_simplepayment.php new file mode 100644 index 000000000..91ad160aa --- /dev/null +++ b/modules/hipay/mapi/mapi_simplepayment.php @@ -0,0 +1,20 @@ +getMessage()); + } + } + +} diff --git a/modules/hipay/mapi/mapi_tax.php b/modules/hipay/mapi/mapi_tax.php new file mode 100644 index 000000000..c71a40082 --- /dev/null +++ b/modules/hipay/mapi/mapi_tax.php @@ -0,0 +1,168 @@ +_locked) + return false; + $taxName = HIPAY_MAPI_UTF8::forceUTF8($taxName); + $len=HIPAY_MAPI_UTF8::strlen_utf8($taxName); + if ($len<1 || $len>HIPAY_MAPI_MAX_TAX_NAME_LENGTH) + return false; + $this->taxName=$taxName; + return true; + } + + + /** + * retourne le nom de la taxe + * + * @return string nom de la taxe + */ + public function getTaxName() { + return $this->taxName; + } + + + /** + * assigne la valeur de la taxe + * + * @param float $taxVal valeur de la taxe + * @param boolean $percentage true si la valeur de la taxe est un pourcentage + * @return boolean true si l'assignation s'est bien déroulée + */ + public function setTaxVal($taxVal,$percentage=true) { + if ($this->_locked) + return false; + if (!is_bool($percentage)) + return false; + $taxVal = sprintf('%.02f',(float)$taxVal); + if ($percentage && ($taxVal<=0 || $taxVal>100)) + return false; + $this->taxVal=$taxVal; + $this->percentage=$percentage; + return true; + } + + + /** + * retourne la valeur de la taxe + * + * @return float valeur de la taxe + */ + public function getTaxVal() { + return $this->taxVal; + } + + + /** + * détermine si la valeur de la taxe est un pourcentage + * + * @return boolean true si la valeur de la taxe est un pourcentage + */ + public function isPercentage() { + return $this->percentage; + } + + + /** + * effectue une vérification des propriétés de la taxe + * + * @return boolean true si les propriétés de la taxe sont correctes + */ + public function check() { + if ($this->taxName=='' || $this->taxVal<0) + throw new Exception('Nom ou valeur de la taxe non initialisée'); + return true; + } + + + /** + * initilise les propriétés de la taxe + * + */ + protected function init() { + $this->taxVal=-1; + $this->taxName=''; + $this->percentage=false; + $this->_amount=0; + $this->_locked=false; + } + + + /** + * assigne le montant calculé de la taxe + * + * @param float $amount montant calculé + * @return boolean true si l'assignation s'est bien déroulée + */ + public function setTaxAmount($amount) { + if ($this->_locked) + return false; + + $amount=(float)$amount; + if ($amount<0) + $amount=0; + $this->_amount = sprintf("%.02f",$amount); + + return true; + } + + + /** + * retourne le montant calculé de la taxe + * + * @return float montant calculé + */ + public function getTaxAmount() { + return $this->_amount; + } + + + /** + * constructeur + * + */ + function __construct() { + $this->init(); + parent::__construct(); + } +} diff --git a/modules/hipay/mapi/mapi_utf8.php b/modules/hipay/mapi/mapi_utf8.php new file mode 100644 index 000000000..b5cad94ff --- /dev/null +++ b/modules/hipay/mapi/mapi_utf8.php @@ -0,0 +1,67 @@ += $len) + break; + + if ($chr & 0x80) + { + $chr <<= 1; + while ($chr & 0x80) + { + $i++; + $chr <<= 1; + } + } + } + return $count; + } +} diff --git a/modules/hipay/mapi/mapi_utils.php b/modules/hipay/mapi/mapi_utils.php new file mode 100644 index 000000000..b40ace5db --- /dev/null +++ b/modules/hipay/mapi/mapi_utils.php @@ -0,0 +1,73 @@ +isPercentage()) { + $taxAmount=sprintf("%.02f",($itemValue/100)*$tax->getTaxVal()); + } else { + $taxAmount+=sprintf("%.02f",$tax->getTaxVal()); + } + return (float)$taxAmount; + } + + /** + * Vérifie la validité d'une URL + * + * @param string $url + * @return boolean + */ + public static function checkURL( $url ) { + return preg_match( '#^(((http|https):\/\/){0,1})(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(.*)#i', $url ); + } + + /** + * Vérifie la validité de l'email + * + * @param string $email + * @return boolean + */ + public static function checkemail( $email ) { + return preg_match( '#^[_a-z0-9-]+(\.[_a-z0-9-]*)*@[a-z0-9-]+(\.[a-z0-9-]+)+$#i', $email ); + } + + public static function parseDelay( $delay ) + { + $array = array_fill_keys( array('H', 'I', 'S', 'M', 'D', 'Y'), 0 ); + $n = substr( $delay, 0, -1 ); + $r = substr( $delay, -1, 1 ); + $array[ strtoupper($r) ] = $n; + + return $array; + } +} diff --git a/modules/hipay/mapi/mapi_xml.php b/modules/hipay/mapi/mapi_xml.php new file mode 100644 index 000000000..213fce85b --- /dev/null +++ b/modules/hipay/mapi/mapi_xml.php @@ -0,0 +1,71 @@ +\n"; + foreach($this as $name=>$value) { + if ($noshow && substr($name,0,1)=='_') + continue; + + if (!is_array($this->$name) && !is_object($this->$name) && !is_bool($this->$name)) { + $xml.=str_repeat(chr(9),$t+1)."<$name>$value\n"; + } else if (is_bool($this->$name)) { + if ($value===true) + $xml.=str_repeat(chr(9),$t+1)."<$name>true\n"; + else + $xml.=str_repeat(chr(9),$t+1)."<$name>false\n"; + } else if (is_object($this->$name) && method_exists($this->$name,'getXML')) { + $xml.=$this->$name->getXml($t+1); + } else if (is_array($this->$name)) { + $xml.=str_repeat(chr(9),$t+1)."<$name>\n"; + $xml.=self::getXMLArray($this->$name,$t+1,$noshow); + $xml.=str_repeat(chr(9),$t+1)."\n"; + } + // else : no getXML method available + + } + $xml.=str_repeat(chr(9),$t)."\n"; + return $xml; + + } + + /** + * Cré le flux XML d'un tableau + * + * @param array $array + * @param int $t + * @return string + */ + protected function getXMLArray($array,$t=0,$noshow=true) { + $xml=''; + foreach($array as $name=>$value) { + if (substr($name,0,1)=='_') + continue; + + if (!is_array($array[$name]) && !is_object($array[$name]) && !is_bool($array[$name])) { + $xml.=str_repeat(chr(9),$t+1)."<_aKey_$name>$value\n"; + } else if (is_bool($array[$name])) { + if ($value===true) + $xml.=str_repeat(chr(9),$t+1)."<$name>true\n"; + else + $xml.=str_repeat(chr(9),$t+1)."<$name>false\n"; + } else if (is_object($array[$name]) && method_exists($array[$name],'getXML')) { + $xml.=$array[$name]->getXml($t+1); + } else if (is_array($array[$name])){ + $xml.=str_repeat(chr(9),$t+1)."<$name>\n"; + $xml.=self::getXMLArray($array[$name],$t+1,$noshow); + $xml.=str_repeat(chr(9),$t+1)."\n"; + } + } + return $xml; + } + +} diff --git a/modules/hipay/payment.tpl b/modules/hipay/payment.tpl new file mode 100644 index 000000000..d19c4616f --- /dev/null +++ b/modules/hipay/payment.tpl @@ -0,0 +1,39 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + {if $cart->getOrderTotal() < 2} + + {l s='Pay with Hipay' mod='hipay'} + {l s='Minimum amount required in order to pay with Hipay:' mod='hipay'} {convertPrice price=2} + + {else} + + {l s='Pay with Hipay' mod='hipay'} + {l s='Pay with Hipay' mod='hipay'} {if !$hipay_prod}{l s='(sandbox / test mode)' mod='hipay'}{/if} + + {/if} +

        \ No newline at end of file diff --git a/modules/hipay/redirect.php b/modules/hipay/redirect.php new file mode 100644 index 000000000..b56324096 --- /dev/null +++ b/modules/hipay/redirect.php @@ -0,0 +1,41 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/hipay.php'); + +if (!$cookie->isLogged(true)) + Tools::redirect('authentication.php?back=order.php'); + +$hipay = new HiPay(); +$hipay->payment(); + + diff --git a/modules/hipay/screenshots/accountnumber.png b/modules/hipay/screenshots/accountnumber.png new file mode 100644 index 000000000..820a42368 Binary files /dev/null and b/modules/hipay/screenshots/accountnumber.png differ diff --git a/modules/hipay/screenshots/merchantpassword.png b/modules/hipay/screenshots/merchantpassword.png new file mode 100644 index 000000000..e03742a90 Binary files /dev/null and b/modules/hipay/screenshots/merchantpassword.png differ diff --git a/modules/hipay/screenshots/siteid.png b/modules/hipay/screenshots/siteid.png new file mode 100644 index 000000000..688aded29 Binary files /dev/null and b/modules/hipay/screenshots/siteid.png differ diff --git a/modules/hipay/validation.php b/modules/hipay/validation.php new file mode 100644 index 000000000..080a95f63 --- /dev/null +++ b/modules/hipay/validation.php @@ -0,0 +1,33 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/hipay.php'); +$hipay = new HiPay(); +$hipay->validation(); + + diff --git a/modules/homefeatured/config.xml b/modules/homefeatured/config.xml new file mode 100755 index 000000000..1a4e2db7d --- /dev/null +++ b/modules/homefeatured/config.xml @@ -0,0 +1,11 @@ + + + homefeatured + Featured Products on the homepage + 0.9 + Displays Featured Products in the middle of your homepage. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/homefeatured/de.php b/modules/homefeatured/de.php new file mode 100644 index 000000000..c5b5ea2c8 --- /dev/null +++ b/modules/homefeatured/de.php @@ -0,0 +1,18 @@ +homefeatured_cd2c2dc24eaf11ba856da4a2e2a248be'] = 'Ausgewählte Produkte auf der Startseite'; +$_MODULE['<{homefeatured}prestashop>homefeatured_bedd0eb227b31705fce270fe1ec5639f'] = 'Zeigt Ausgewählte Produkte in der Mitte Ihrer Startseite an'; +$_MODULE['<{homefeatured}prestashop>homefeatured_dd0de17e8450a0fd3248b19c4a4f803b'] = 'Ungültige Anzahl von Produkten'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{homefeatured}prestashop>homefeatured_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{homefeatured}prestashop>homefeatured_6df1f9b5662398a551a2c9185b26638a'] = 'Um Produkte zu Ihrer Startseite hinzufügen, fügen Sie einfach sie zur die \"Start\"-Kategorie hinzu.'; +$_MODULE['<{homefeatured}prestashop>homefeatured_3c230497560c52be92b93c65de9defc9'] = 'Anzahl der angezeigten Produkte'; +$_MODULE['<{homefeatured}prestashop>homefeatured_5bc8290012fcc597689ef8959c2fc969'] = 'Anzahl der auf der Startseite angezeigten Produkte (Standard: 10)'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{homefeatured}prestashop>homefeatured_ca7d973c26c57b69e0857e7a0332d545'] = 'Ausgewählte Produkte'; +$_MODULE['<{homefeatured}prestashop>homefeatured_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Mehr'; +$_MODULE['<{homefeatured}prestashop>homefeatured_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{homefeatured}prestashop>homefeatured_2d0f6b8300be19cf35e89e66f0677f95'] = 'In den Warenkorb'; +$_MODULE['<{homefeatured}prestashop>homefeatured_e0e572ae0d8489f8bf969e93d469e89c'] = 'Keine ausgewählten Produkte'; diff --git a/modules/homefeatured/en.php b/modules/homefeatured/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/homefeatured/en.php @@ -0,0 +1,4 @@ +homefeatured_cd2c2dc24eaf11ba856da4a2e2a248be'] = 'Productos Destacados en la Página de inicio'; +$_MODULE['<{homefeatured}prestashop>homefeatured_bedd0eb227b31705fce270fe1ec5639f'] = 'Mostrar Productos Destacados en el centro de su página de inicio'; +$_MODULE['<{homefeatured}prestashop>homefeatured_dd0de17e8450a0fd3248b19c4a4f803b'] = 'Número de productos no válido'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{homefeatured}prestashop>homefeatured_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{homefeatured}prestashop>homefeatured_6df1f9b5662398a551a2c9185b26638a'] = 'Para añadir productos a su página de inicio, sólo tiene que añadirlas en la categoía \\\"Inicio\\\" .'; +$_MODULE['<{homefeatured}prestashop>homefeatured_3c230497560c52be92b93c65de9defc9'] = 'Número de productos mostrados'; +$_MODULE['<{homefeatured}prestashop>homefeatured_5bc8290012fcc597689ef8959c2fc969'] = 'Número de productos mostrados en la página de inicio (por defecto: 10)'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{homefeatured}prestashop>homefeatured_ca7d973c26c57b69e0857e7a0332d545'] = 'Productos destacados'; +$_MODULE['<{homefeatured}prestashop>homefeatured_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Más'; +$_MODULE['<{homefeatured}prestashop>homefeatured_4351cfebe4b61d8aa5efa1d020710005'] = 'Ver'; +$_MODULE['<{homefeatured}prestashop>homefeatured_2d0f6b8300be19cf35e89e66f0677f95'] = 'Añadir al carrito'; +$_MODULE['<{homefeatured}prestashop>homefeatured_e0e572ae0d8489f8bf969e93d469e89c'] = 'No hay productos destacados'; diff --git a/modules/homefeatured/fr.php b/modules/homefeatured/fr.php new file mode 100644 index 000000000..f212da397 --- /dev/null +++ b/modules/homefeatured/fr.php @@ -0,0 +1,18 @@ +homefeatured_cd2c2dc24eaf11ba856da4a2e2a248be'] = 'Produits phares sur la page d\'accueil'; +$_MODULE['<{homefeatured}prestashop>homefeatured_bedd0eb227b31705fce270fe1ec5639f'] = 'Affiche les produits phares au centre de votre page d\'accueil'; +$_MODULE['<{homefeatured}prestashop>homefeatured_dd0de17e8450a0fd3248b19c4a4f803b'] = 'Nombre de produit invalide'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{homefeatured}prestashop>homefeatured_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{homefeatured}prestashop>homefeatured_6df1f9b5662398a551a2c9185b26638a'] = 'Pour ajouter des produits à votre page d\'accueil, ajoutez-les simplement à la catégorie \"Accueil\" du catalogue.'; +$_MODULE['<{homefeatured}prestashop>homefeatured_3c230497560c52be92b93c65de9defc9'] = 'Nombre de produits'; +$_MODULE['<{homefeatured}prestashop>homefeatured_5bc8290012fcc597689ef8959c2fc969'] = 'Le nombre de produits affichés sur la page d\'accueil (défaut : 10)'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{homefeatured}prestashop>homefeatured_ca7d973c26c57b69e0857e7a0332d545'] = 'Produits phares'; +$_MODULE['<{homefeatured}prestashop>homefeatured_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Plus d\'infos'; +$_MODULE['<{homefeatured}prestashop>homefeatured_4351cfebe4b61d8aa5efa1d020710005'] = 'Plus d\'infos'; +$_MODULE['<{homefeatured}prestashop>homefeatured_2d0f6b8300be19cf35e89e66f0677f95'] = 'Ajouter au panier'; +$_MODULE['<{homefeatured}prestashop>homefeatured_e0e572ae0d8489f8bf969e93d469e89c'] = 'Aucun produit phare'; diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php new file mode 100644 index 000000000..a68c95f60 --- /dev/null +++ b/modules/homefeatured/homefeatured.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class HomeFeatured extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + function __construct() + { + $this->name = 'homefeatured'; + $this->tab = 'front_office_features'; + $this->version = '0.9'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Featured Products on the homepage'); + $this->description = $this->l('Displays Featured Products in the middle of your homepage.'); + } + + function install() + { + if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) OR !parent::install() OR !$this->registerHook('home')) + return false; + return true; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + if (Tools::isSubmit('submitHomeFeatured')) + { + $nbr = (int)(Tools::getValue('nbr')); + if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) + $errors[] = $this->l('Invalid number of products'); + else + Configuration::updateValue('HOME_FEATURED_NBR', (int)($nbr)); + if (isset($errors) AND sizeof($errors)) + $output .= $this->displayError(implode('
        ', $errors)); + else + $output .= $this->displayConfirmation($this->l('Settings updated')); + } + return $output.$this->displayForm(); + } + + public function displayForm() + { + $output = ' +
        +
        '.$this->l('Settings').' +

        '.$this->l('In order to add products to your homepage, just add them to the "home" category.').'


        + +
        + +

        '.$this->l('The number of products displayed on homepage (default: 10).').'

        + +
        +
        +
        +
        '; + return $output; + } + + function hookHome($params) + { + global $smarty; + + $category = new Category(1, Configuration::get('PS_LANG_DEFAULT')); + $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); + $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); + $smarty->assign(array( + 'products' => $products, + 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), + 'homeSize' => Image::getSize('home'))); + + return $this->display(__FILE__, 'homefeatured.tpl'); + } +} diff --git a/modules/homefeatured/homefeatured.tpl b/modules/homefeatured/homefeatured.tpl new file mode 100644 index 000000000..bda1f89e0 --- /dev/null +++ b/modules/homefeatured/homefeatured.tpl @@ -0,0 +1,64 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + diff --git a/modules/homefeatured/it.php b/modules/homefeatured/it.php new file mode 100644 index 000000000..11e05af26 --- /dev/null +++ b/modules/homefeatured/it.php @@ -0,0 +1,18 @@ +homefeatured_cd2c2dc24eaf11ba856da4a2e2a248be'] = 'Prodotti in vetrina sulla homepage'; +$_MODULE['<{homefeatured}prestashop>homefeatured_bedd0eb227b31705fce270fe1ec5639f'] = 'Mostra Prodotti in vetrina nel cuore della tua home page'; +$_MODULE['<{homefeatured}prestashop>homefeatured_dd0de17e8450a0fd3248b19c4a4f803b'] = 'Numero non valido di prodotti'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{homefeatured}prestashop>homefeatured_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{homefeatured}prestashop>homefeatured_6df1f9b5662398a551a2c9185b26638a'] = 'Per poter aggiungere prodotti alla tua home page, basta aggiungere alla categoria \"home\".'; +$_MODULE['<{homefeatured}prestashop>homefeatured_3c230497560c52be92b93c65de9defc9'] = 'Numero di prodotto esposto'; +$_MODULE['<{homefeatured}prestashop>homefeatured_5bc8290012fcc597689ef8959c2fc969'] = 'Il numero di prodotti esposti in homepage (default: 10)'; +$_MODULE['<{homefeatured}prestashop>homefeatured_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{homefeatured}prestashop>homefeatured_ca7d973c26c57b69e0857e7a0332d545'] = 'prodotti in vetrina'; +$_MODULE['<{homefeatured}prestashop>homefeatured_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Più'; +$_MODULE['<{homefeatured}prestashop>homefeatured_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{homefeatured}prestashop>homefeatured_2d0f6b8300be19cf35e89e66f0677f95'] = 'Aggiungi al carrello'; +$_MODULE['<{homefeatured}prestashop>homefeatured_e0e572ae0d8489f8bf969e93d469e89c'] = 'Nessun prodotto in vetrina'; diff --git a/modules/homefeatured/logo.gif b/modules/homefeatured/logo.gif new file mode 100644 index 000000000..d88478243 Binary files /dev/null and b/modules/homefeatured/logo.gif differ diff --git a/modules/iadvize/config.xml b/modules/iadvize/config.xml new file mode 100755 index 000000000..ee2b0fb14 --- /dev/null +++ b/modules/iadvize/config.xml @@ -0,0 +1,11 @@ + + + iadvize + iAdvize + 1.0 + Offer an interactive live chat to your customers + + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/iadvize/de.php b/modules/iadvize/de.php new file mode 100644 index 000000000..0a2aedb14 --- /dev/null +++ b/modules/iadvize/de.php @@ -0,0 +1,19 @@ +iadvize_439a106a26eb0e34079618cc72d3d920'] = 'Bieten Sie Ihren Kunden einen interaktiven Live-Chat'; +$_MODULE['<{iadvize}prestashop>iadvize_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{iadvize}prestashop>iadvize_162167872bb576ce8c76785ec4c4cb37'] = 'iAdvize ist ein interaktiver Live-Chat'; +$_MODULE['<{iadvize}prestashop>iadvize_895cd381041fa87a2dbfca7904de7209'] = 'mit dem Sie direkt auf Ihre Besucher reagieren und sie zu den Produkten führen können, die ihren Bedürfnissen entsprechen.'; +$_MODULE['<{iadvize}prestashop>iadvize_dfb55db021feb46384cc7215190b777a'] = 'Für weitere Informationen, klicken Sie hier'; +$_MODULE['<{iadvize}prestashop>iadvize_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{iadvize}prestashop>iadvize_f6c38837bb877b26405a7fd792d2e741'] = 'iAdvize Händler-ID:'; +$_MODULE['<{iadvize}prestashop>iadvize_d2fd5b945bd364e52b2be4cf584b1f8e'] = 'iAdvize \"Anruftaste\" ID:'; +$_MODULE['<{iadvize}prestashop>iadvize_ab4abc3ebef89969caf167af7b90bcec'] = 'Leer lassen, wenn Sie diese Funktion nicht aktivieren wollen'; +$_MODULE['<{iadvize}prestashop>iadvize_34d5d712f0fd89ca0950d5df4bf7b346'] = '\"Anruftaste\" Standort:'; +$_MODULE['<{iadvize}prestashop>iadvize_a3ab67209a2c6b0df679f22380d7e0c8'] = 'Keine Anruftaste'; +$_MODULE['<{iadvize}prestashop>iadvize_f9e4884c7654daa6581b42ed90aeaba4'] = 'Linke Spalte'; +$_MODULE['<{iadvize}prestashop>iadvize_feb6cc332459769fe15570bf332a6b50'] = 'Rechte Spalte'; +$_MODULE['<{iadvize}prestashop>iadvize_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{iadvize}prestashop>iadvize_70397c4b252a5168c5ec003931cea215'] = 'Pflichtfelder'; diff --git a/modules/iadvize/es.php b/modules/iadvize/es.php new file mode 100644 index 000000000..a9af2191f --- /dev/null +++ b/modules/iadvize/es.php @@ -0,0 +1,19 @@ +iadvize_439a106a26eb0e34079618cc72d3d920'] = 'Proponga a sus clientes un chat interactivo en directo'; +$_MODULE['<{iadvize}prestashop>iadvize_c888438d14855d7d96a2724ee9c306bd'] = 'Parámetros actualizados'; +$_MODULE['<{iadvize}prestashop>iadvize_162167872bb576ce8c76785ec4c4cb37'] = 'Advice es un chat interactivo en directo'; +$_MODULE['<{iadvize}prestashop>iadvize_895cd381041fa87a2dbfca7904de7209'] = 'que le permite responder directamente a sus visitantes y orientarlos hacia los productos que responden a sus necesidades.'; +$_MODULE['<{iadvize}prestashop>iadvize_dfb55db021feb46384cc7215190b777a'] = 'Para más información, pulse aquí'; +$_MODULE['<{iadvize}prestashop>iadvize_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{iadvize}prestashop>iadvize_f6c38837bb877b26405a7fd792d2e741'] = 'ID vendedor iAdvize:'; +$_MODULE['<{iadvize}prestashop>iadvize_d2fd5b945bd364e52b2be4cf584b1f8e'] = 'ID botón de llamada iAdvize:'; +$_MODULE['<{iadvize}prestashop>iadvize_ab4abc3ebef89969caf167af7b90bcec'] = 'Deje vacío si no desea activar esta aplicación'; +$_MODULE['<{iadvize}prestashop>iadvize_34d5d712f0fd89ca0950d5df4bf7b346'] = 'Posición del \"Botón llamar\"'; +$_MODULE['<{iadvize}prestashop>iadvize_a3ab67209a2c6b0df679f22380d7e0c8'] = 'No hay botón de llamada'; +$_MODULE['<{iadvize}prestashop>iadvize_f9e4884c7654daa6581b42ed90aeaba4'] = 'Columna de izquierda'; +$_MODULE['<{iadvize}prestashop>iadvize_feb6cc332459769fe15570bf332a6b50'] = 'Columna de derecha'; +$_MODULE['<{iadvize}prestashop>iadvize_b17f3f4dcf653a5776792498a9b44d6a'] = 'Guardar'; +$_MODULE['<{iadvize}prestashop>iadvize_70397c4b252a5168c5ec003931cea215'] = 'Campos necesarios'; diff --git a/modules/iadvize/fr.php b/modules/iadvize/fr.php new file mode 100644 index 000000000..a0590c002 --- /dev/null +++ b/modules/iadvize/fr.php @@ -0,0 +1,19 @@ +iadvize_439a106a26eb0e34079618cc72d3d920'] = 'Offrez un chat interactif en direct à vos clients'; +$_MODULE['<{iadvize}prestashop>iadvize_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{iadvize}prestashop>iadvize_162167872bb576ce8c76785ec4c4cb37'] = 'iAdvize est un chat en direct interactif'; +$_MODULE['<{iadvize}prestashop>iadvize_895cd381041fa87a2dbfca7904de7209'] = 'vous permettant de répondre directement à vos visiteurs et les orienter vers les produits qui répondent à leurs besoins.'; +$_MODULE['<{iadvize}prestashop>iadvize_dfb55db021feb46384cc7215190b777a'] = 'Pour plus d\'informations, cliquez ici'; +$_MODULE['<{iadvize}prestashop>iadvize_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{iadvize}prestashop>iadvize_f6c38837bb877b26405a7fd792d2e741'] = 'ID marchand iAdvize :'; +$_MODULE['<{iadvize}prestashop>iadvize_d2fd5b945bd364e52b2be4cf584b1f8e'] = 'ID bouton d\'appel iAdvize :'; +$_MODULE['<{iadvize}prestashop>iadvize_ab4abc3ebef89969caf167af7b90bcec'] = 'Laissez vide si vous ne souhaitez pas activer cette fonctionnalité'; +$_MODULE['<{iadvize}prestashop>iadvize_34d5d712f0fd89ca0950d5df4bf7b346'] = 'Position du \"Bouton appeler\"'; +$_MODULE['<{iadvize}prestashop>iadvize_a3ab67209a2c6b0df679f22380d7e0c8'] = 'Pas de bouton d\'appel'; +$_MODULE['<{iadvize}prestashop>iadvize_f9e4884c7654daa6581b42ed90aeaba4'] = 'Colonne de gauche'; +$_MODULE['<{iadvize}prestashop>iadvize_feb6cc332459769fe15570bf332a6b50'] = 'Colonne de droite'; +$_MODULE['<{iadvize}prestashop>iadvize_b17f3f4dcf653a5776792498a9b44d6a'] = 'Enregistrer'; +$_MODULE['<{iadvize}prestashop>iadvize_70397c4b252a5168c5ec003931cea215'] = 'Champs requis'; diff --git a/modules/iadvize/iadvize.php b/modules/iadvize/iadvize.php new file mode 100755 index 000000000..6353c9808 --- /dev/null +++ b/modules/iadvize/iadvize.php @@ -0,0 +1,158 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class iAdvize extends Module +{ + function __construct() + { + $this->name = 'iadvize'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + $this->displayName = 'iAdvize'; + + parent::__construct(); + + $this->description = $this->l('Offer an interactive live chat to your customers'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('footer') OR !$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn')) + return false; + return true; + } + + function uninstall() + { + if (!Configuration::deleteByName('IADVIZE_SID') OR !Configuration::deleteByName('IADVIZE_BID') OR !parent::uninstall()) + return false; + return true; + } + + public function getContent() + { + global $cookie; + + $lang = new Language((int)($cookie->id_lang)); + if (!in_array($lang->iso_code, array('fr', 'en', 'es'))) + $lang->iso_code = 'en'; + + $output = '

        '; + + if (Tools::isSubmit('submitiAdvize')) + { + Configuration::updateValue('IADVIZE_SID', (int)(Tools::getValue('iadvize_sid'))); + Configuration::updateValue('IADVIZE_BID', (int)(Tools::getValue('iadvize_bid'))); + Configuration::updateValue('IADVIZE_BUTTON', (int)(Tools::getValue('iadvize_button'))); + + $output .= ' +
        + + '.$this->l('Settings updated').' +
        '; + } + + $output .= ' +
        +

        + '.$this->l('iAdvize is an interactive live chat').' '.$this->l('allowing you to respond directly to your visitors and direct them towards the product that meets their needs.').' +
        + '.$this->l('For more information, click here').' +

        +
        +
        + '.$this->l('Settings').' + +
        + * +
        +
        + +
        + +

        '.$this->l('Leave empty if you do not want to enable this feature.').'

        +
        + +
        + '.$this->l('No call button').'  + '.$this->l('Left column').'  + '.$this->l('Right column').' +
        +
        +
        +
        +

        * '.$this->l('Required fields').'

        +
        +
        +
        + '.(file_exists(dirname(__FILE__).'/offer-'.$lang->iso_code.'.jpg') ? ' +

        + ' : '').' +
        +
        '; + + return $output; + } + + private function _displayCallButton() + { + return "\n".' + +
        + +
        + '."\n"; + } + + public function hookLeftColumn($params) + { + if (Configuration::get('IADVIZE_BUTTON') == 1) + return $this->_displayCallButton(); + } + + public function hookRightColumn($params) + { + if (Configuration::get('IADVIZE_BUTTON') == 2) + return $this->_displayCallButton(); + } + + public function hookFooter($params) + { + return "\n".' + + + '."\n"; + } +} \ No newline at end of file diff --git a/modules/iadvize/it.php b/modules/iadvize/it.php new file mode 100644 index 000000000..5f06082ab --- /dev/null +++ b/modules/iadvize/it.php @@ -0,0 +1,19 @@ +iadvize_439a106a26eb0e34079618cc72d3d920'] = 'Offrire una live chat interattiva per i tuoi clienti'; +$_MODULE['<{iadvize}prestashop>iadvize_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{iadvize}prestashop>iadvize_162167872bb576ce8c76785ec4c4cb37'] = 'iAdvize è una live chat interattiva'; +$_MODULE['<{iadvize}prestashop>iadvize_895cd381041fa87a2dbfca7904de7209'] = 'che consente di rispondere direttamente ai tuoi visitatori e indirizzarli verso il prodotto che soddisfi le loro esigenze.'; +$_MODULE['<{iadvize}prestashop>iadvize_dfb55db021feb46384cc7215190b777a'] = 'Per maggiori informazioni, clicca qui'; +$_MODULE['<{iadvize}prestashop>iadvize_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{iadvize}prestashop>iadvize_f6c38837bb877b26405a7fd792d2e741'] = 'ID commerciante iAdvize:'; +$_MODULE['<{iadvize}prestashop>iadvize_d2fd5b945bd364e52b2be4cf584b1f8e'] = 'ID \"Tasto di chiamata\" iAdvize'; +$_MODULE['<{iadvize}prestashop>iadvize_ab4abc3ebef89969caf167af7b90bcec'] = 'Lascia vuoto se non vuoi attivare questa funzionalità'; +$_MODULE['<{iadvize}prestashop>iadvize_34d5d712f0fd89ca0950d5df4bf7b346'] = 'Posizione \"Tasto di chiamata\"'; +$_MODULE['<{iadvize}prestashop>iadvize_a3ab67209a2c6b0df679f22380d7e0c8'] = 'Nessun tasto di chiamata'; +$_MODULE['<{iadvize}prestashop>iadvize_f9e4884c7654daa6581b42ed90aeaba4'] = 'Colonna di sinistra'; +$_MODULE['<{iadvize}prestashop>iadvize_feb6cc332459769fe15570bf332a6b50'] = 'Colonna di destra'; +$_MODULE['<{iadvize}prestashop>iadvize_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{iadvize}prestashop>iadvize_70397c4b252a5168c5ec003931cea215'] = 'I campi obbligatori'; diff --git a/modules/iadvize/logo-iadvize.gif b/modules/iadvize/logo-iadvize.gif new file mode 100755 index 000000000..82e4da3ce Binary files /dev/null and b/modules/iadvize/logo-iadvize.gif differ diff --git a/modules/iadvize/logo.gif b/modules/iadvize/logo.gif new file mode 100755 index 000000000..193edf06f Binary files /dev/null and b/modules/iadvize/logo.gif differ diff --git a/modules/iadvize/offer-fr.jpg b/modules/iadvize/offer-fr.jpg new file mode 100755 index 000000000..970d0fecc Binary files /dev/null and b/modules/iadvize/offer-fr.jpg differ diff --git a/modules/importerosc/config.xml b/modules/importerosc/config.xml new file mode 100644 index 000000000..ad85347d5 --- /dev/null +++ b/modules/importerosc/config.xml @@ -0,0 +1,11 @@ + + + importerosc + Importer osCommerce + 1.0 + This module allows you to import from osCommerce to Prestashop. + PrestaShop + migration_tools + 0 + 1 + \ No newline at end of file diff --git a/modules/importerosc/de.php b/modules/importerosc/de.php new file mode 100644 index 000000000..20f8a790c --- /dev/null +++ b/modules/importerosc/de.php @@ -0,0 +1,13 @@ +importerosc_e273168c3697c35b8c737d14b1a5fb26'] = 'Importeur osCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_f4a344f88bab7b04a73077bafc8a0187'] = 'Mit diesem Modul können Sie von osCommerce nach Prestashop importieren'; +$_MODULE['<{importerosc}prestashop>importerosc_2737b271f276b90d8a04ea4b9d18b920'] = 'Standardsprache osCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_1b473540f20c3e31ead53f84511d6c77'] = 'Standardwährung osCommerce '; +$_MODULE['<{importerosc}prestashop>importerosc_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Shop URL'; +$_MODULE['<{importerosc}prestashop>importerosc_a1831ea8716cc4375483dc42bf5fde96'] = 'Bitte wählen Sie einen Standardsprache'; +$_MODULE['<{importerosc}prestashop>importerosc_375e6e17d4bd18a5163d3a7d13b80b4b'] = 'Bitte wählen Sie eine Standardwährung'; +$_MODULE['<{importerosc}prestashop>importerosc_294f0969b5f80f1bae24a7183eb338d5'] = 'Bitte stellen Sie Ihren Shop URL ein'; +$_MODULE['<{importerosc}prestashop>importerosc_86545d77ce5790e924190d9b5a7ac1b6'] = 'Standardgruppe OS Commerce'; diff --git a/modules/importerosc/es.php b/modules/importerosc/es.php new file mode 100644 index 000000000..dc9afb8e9 --- /dev/null +++ b/modules/importerosc/es.php @@ -0,0 +1,13 @@ +importerosc_e273168c3697c35b8c737d14b1a5fb26'] = 'Importer osCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_f4a344f88bab7b04a73077bafc8a0187'] = 'Este módulo permite importar su tienda OsCommerce en PrestaShop'; +$_MODULE['<{importerosc}prestashop>importerosc_2737b271f276b90d8a04ea4b9d18b920'] = 'Idioma por defecto OsCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_1b473540f20c3e31ead53f84511d6c77'] = 'Moneda por defecto OsCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_6c61ebc45acfe2f244e91ac4cd423e81'] = 'URL de la tienda'; +$_MODULE['<{importerosc}prestashop>importerosc_a1831ea8716cc4375483dc42bf5fde96'] = 'Por favor, seleccione un idioma por defecto'; +$_MODULE['<{importerosc}prestashop>importerosc_375e6e17d4bd18a5163d3a7d13b80b4b'] = 'Por favor seleccione una moneda por defecto'; +$_MODULE['<{importerosc}prestashop>importerosc_294f0969b5f80f1bae24a7183eb338d5'] = 'Por favor, establezca la URL de su tienda'; +$_MODULE['<{importerosc}prestashop>importerosc_86545d77ce5790e924190d9b5a7ac1b6'] = 'Sistema operativo por defecto Grupo de Comercio'; diff --git a/modules/importerosc/fr.php b/modules/importerosc/fr.php new file mode 100644 index 000000000..9065d17ad --- /dev/null +++ b/modules/importerosc/fr.php @@ -0,0 +1,13 @@ +importerosc_e273168c3697c35b8c737d14b1a5fb26'] = 'Import OsCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_f4a344f88bab7b04a73077bafc8a0187'] = 'Ce module permet d\'importer votre boutique OsCommerce dans prestashop'; +$_MODULE['<{importerosc}prestashop>importerosc_2737b271f276b90d8a04ea4b9d18b920'] = 'Langue par défaut OsCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_1b473540f20c3e31ead53f84511d6c77'] = 'Devise par défaut OsCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Url de la boutique'; +$_MODULE['<{importerosc}prestashop>importerosc_a1831ea8716cc4375483dc42bf5fde96'] = 'Merci de choisir une langue par défaut'; +$_MODULE['<{importerosc}prestashop>importerosc_375e6e17d4bd18a5163d3a7d13b80b4b'] = 'Merci de choisir la devise par défaut'; +$_MODULE['<{importerosc}prestashop>importerosc_294f0969b5f80f1bae24a7183eb338d5'] = 'Merci de choisir l\'url de la boutique'; +$_MODULE['<{importerosc}prestashop>importerosc_86545d77ce5790e924190d9b5a7ac1b6'] = 'Group par défaut OsCommerce'; diff --git a/modules/importerosc/importerosc.php b/modules/importerosc/importerosc.php new file mode 100644 index 000000000..4c55f70c7 --- /dev/null +++ b/modules/importerosc/importerosc.php @@ -0,0 +1,409 @@ +name = 'importerosc'; + $this->tab = 'migration_tools'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + $this->theImporter = 1; + + parent::__construct (); + + $this->displayName = $this->l('Importer osCommerce'); + $this->description = $this->l('This module allows you to import from osCommerce to Prestashop.'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('beforeAuthentication')) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + return true; + } + + public function displaySpecificOptions() + { + $langagues = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'languages`'); + $curencies = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'currencies`'); + + $html = ' +
        +
        + +
        +
        '; + $html .= ' +
        + http:/// +
        '; + + + + return $html; + } + + + public function validateSpecificOptions() + { + $errors = array(); + if (Tools::getValue('defaultOscLang') == 0) + $errors[] = $this->l('Please select a default langue'); + if (Tools::getValue('defaultOscCurrency') == 0) + $errors[] = $this->l('Please select a default currency'); + if (Tools::getValue('shop_url') == '') + $errors[] = $this->l('Please set your shop url'); + if (!sizeof($errors)) + die('{"hasError" : false, "error" : []}'); + else + die('{"hasError" : true, "error" : '.Tools::jsonEncode($errors).'}'); + } + + + public function getDefaultIdLang () + { + return Tools::getValue('defaultOscLang'); + } + + public function getDefaultIdCurrency () + { + return Tools::getValue('defaultOscCurrency'); + } + + + public function getLangagues($limit = 0, $nrb_import = 100) + { + $identifier = 'id_lang'; + $langagues = $this->ExecuteS('SELECT languages_id as id_lang, name as name, code as iso_code, 1 as active FROM `'.addslashes($this->prefix).'languages` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($langagues, $identifier); + } + + public function getCurrencies($limit = 0, $nrb_import = 100) + { + $identifier = 'id_currency'; + $currencies = $this->ExecuteS(' + SELECT currencies_id as id_currency, title as name, code as iso_code, 0 as format, 999 as iso_code_num, 1 as decimals, + CONCAT(`symbol_left`, `symbol_right`) as sign, value as conversion_rate + FROM `'.addslashes($this->prefix).'currencies` LIMIT '.(int)($limit).' , '.(int)$nrb_import + ); + return $this->autoFormat($currencies, $identifier); + } + + public function getZones($limit = 0, $nrb_import = 100) + { + $identifier = 'id_zone'; + $zones = $this->ExecuteS('SELECT geo_zone_id as id_zone, geo_zone_name as name, 1 as active FROM `'.addslashes($this->prefix).'geo_zones` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($zones, $identifier); + } + + public function getCountries($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name'); + $keyLanguage = 'id_lang'; + $identifier = 'id_country'; + $defaultIdLang = $this->getDefaultIdLang(); + $countries = $this->ExecuteS(' + SELECT countries_id as id_country, countries_name as name, countries_iso_code_2 as iso_code, '.$defaultIdLang.' as id_lang, + 1 as id_zone, 0 as id_currency, 1 as contains_states, 1 as need_identification_number, 1 as active + FROM `'.addslashes($this->prefix).'countries` as c LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); + } + + public function getStates($limit = 0, $nrb_import = 100) + { + $identifier = 'id_state'; + $states = array( + 0 => array( + 'id_state' => 0, + 'id_country' => 0, + 'id_zone' => 0, + 'iso_code' => 999, + 'name' => 'osc', + 'active' => 0 + ) + ); + return $this->autoFormat($states, $identifier); + } + + public function getGroups() + { + $idLang = $this->getDefaultIdLang(); + return array( 1 => array( + 'id_group' => 1, + 'price_display_method' => 0, + 'name' => array($idLang => $this->l('Default osCommerce Group')) + ) + ); + } + + public function getCustomers($limit = 0, $nrb_import = 100) + { + $genderMatch = array('m' => 1,'f' => 2); + $identifier = 'id_customer'; + $customers = $this->ExecuteS(' + SELECT customers_id as id_customer, 1 as id_default_group, customers_gender as id_gender, customers_firstname as firstname, + customers_lastname as lastname, DATE(customers_dob) as birthday, customers_email_address as email, customers_password as passwd, 1 as active + FROM `'.addslashes($this->prefix).'customers` LIMIT '.(int)($limit).' , '.(int)$nrb_import + ); + + $return = array(); + $i = 0; + foreach($customers AS $customer) + { + foreach($customer AS $attr => $val) + { + switch ($attr) + { + case 'id_gender': + (array_key_exists($val, $genderMatch) ? $val = $genderMatch[$val] : $val = 9); + break; + default: + $return[$i][$attr] = $val; + } + } + $i ++; + + } + return $this->autoFormat($return, $identifier); + } + + public function getAddresses($limit = 0, $nrb_import = 100) + { + $identifier = 'id_address'; + $addresses = $this->ExecuteS(' + SELECT address_book_id as id_address, customers_id as id_customer, CONCAT(customers_id, \'_address\') as alias, entry_company as company, entry_firstname as firstname, + entry_lastname as lastname, entry_street_address as address1, entry_postcode as postcode, entry_city as city, entry_country_id as id_country, 0 as id_state + FROM `'.addslashes($this->prefix).'address_book` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($addresses, $identifier); + } + + public function getCategories($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name', 'link_rewrite'); + $keyLanguage = 'id_lang'; + $identifier = 'id_category'; + + $categories = $this->ExecuteS(' + SELECT c.categories_id as id_category, c.parent_id as id_parent, 0 as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images + FROM `'.addslashes($this->prefix).'categories` c + LEFT JOIN `'.addslashes($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id) + WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL + ORDER BY c.categories_id, cd.language_id + LIMIT '.(int)($limit).' , '.(int)$nrb_import); + foreach($categories as& $cat) + { + $cat['link_rewrite'] = Tools::link_rewrite($cat['name']); + $cat['images'] = array(Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$cat['images']); + } + return $this->autoFormat($categories, $identifier, $keyLanguage, $multiLangFields); + } + + public function getAttributesGroups($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name', 'public_name'); + $keyLanguage = 'id_lang'; + $identifier = 'id_attribute_group'; + $countries = $this->ExecuteS(' + SELECT products_options_id as id_attribute_group, products_options_name as name , products_options_name as public_name, language_id as id_lang, 0 as is_color_group + FROM `'.addslashes($this->prefix).'products_options` + LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); + } + + public function getAttributes($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name'); + $keyLanguage = 'id_lang'; + $identifier = 'id_attribute'; + $countries = $this->ExecuteS(' + SELECT p.`products_options_values_id` as id_attribute, p.`products_options_values_name` as name, p.`language_id` as id_lang , po.`products_options_id` as id_attribute_group + FROM `'.addslashes($this->prefix).'products_options_values` p + LEFT JOIN `'.addslashes($this->prefix).'products_options_values_to_products_options` po ON (po.products_options_values_id = p.products_options_values_id) + LIMIT '.(int)($limit).' , '.(int)$nrb_import); + return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); + } + + public function getProducts($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name', 'link_rewrite', 'description'); + $keyLanguage = 'id_lang'; + $identifier = 'id_product'; + $products = $this->ExecuteS(' + SELECT p.`products_id` as id_product, p.`products_quantity` as quantity, p.`products_model` as reference, p.`products_price` as price, p.`products_weight` as weight, + p.`products_status` as active, p.`manufacturers_id` as id_manufacturer, pd.language_id as id_lang, pd.products_name as name, pd.products_description as description, + CONCAT(\''.Tools::getProtocol().Tools::getValue('shop_url').'\/images/\',p.`products_image`) as images, + (SELECT ptc.categories_id FROM `'.addslashes($this->prefix).'products_to_categories` ptc WHERE ptc.`products_id` = p.`products_id` LIMIT 1) as id_category_default + FROM `'.addslashes($this->prefix).'products` p LEFT JOIN `'.addslashes($this->prefix).'products_description` pd ON (p.products_id = pd.products_id) + WHERE pd.products_name IS NOT NULL AND pd.language_id IS NOT NULL + LIMIT '.(int)($limit).' , '.(int)$nrb_import); + + $this->Execute('CREATE TABLE IF NOT EXISTS`products_images` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `products_id` int(11) NOT NULL, + `image` varchar(64) DEFAULT NULL, + `htmlcontent` text, + `sort_order` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `products_images_prodid` (`products_id`) + )'); + foreach($products as& $product) + { + $result = $this->ExecuteS('SELECT `image` FROM `'.addslashes($this->prefix).'products_images` WHERE products_id = '.(int)$product['id_product']); + $images = array(); + foreach($result as $res) + $images[] = Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$res['image']; + $product['images'] = array_merge(array($product['images']), $images); + $product['link_rewrite'] = Tools::link_rewrite($product['name']); + $product['association'] = array('category_product' => array($product['id_category_default'] => $product['id_product'])); + } + return $this->autoFormat($products, $identifier, $keyLanguage, $multiLangFields); + } + + public function getProductsCombination($limit = 0, $nrb_import = 100) + { + $identifier = 'id_product_attribute'; + $combinations = $this->ExecuteS(' + SELECT products_attributes_id as id_product_attribute, products_id as id_product, options_values_price as price, options_values_id + FROM `'.addslashes($this->prefix).'products_attributes` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + foreach($combinations as& $combination) + { + $combination['association'] = array('product_attribute_combination' => array($combination['options_values_id'] => $combination['id_product_attribute'])); + unset($combination['options_values_price']); + } + return $this->autoFormat($combinations, $identifier); + } + + public function getManufacturers($limit = 0, $nrb_import = 100) + { + $identifier = 'id_manufacturer'; + $manufacturers = $this->ExecuteS(' + SELECT manufacturers_id as id_manufacturer, manufacturers_name as name, 1 as active, manufacturers_image as images + FROM `'.addslashes($this->prefix).'manufacturers` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + foreach($manufacturers as& $manufacturer) + $manufacturer['images'] = array(Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$manufacturer['images']); + + return $this->autoFormat($manufacturers, $identifier); + } + + public function getOrdersStates($limit = 0, $nrb_import = 100) + { + $multiLangFields = array('name'); + $keyLanguage = 'id_lang'; + $identifier = 'id_order_state'; + $ordersStates = $this->ExecuteS(' + SELECT `orders_status_id` as id_order_state, `language_id` as id_lang, `orders_status_name` as name , 1 as hidden + FROM `'.addslashes($this->prefix).'orders_status` + LIMIT '.(int)($limit).' , '.(int)$nrb_import);//IF(`public_flag` = 0, 1, 0) as hidden + return $this->autoFormat($ordersStates, $identifier, $keyLanguage, $multiLangFields); + } + + public function getOrders($limit = 0, $nrb_import = 100) + { + $orders = array(); + $addresses = $this->ExecuteS('SELECT customers_id as id_customer, address_book_id as id_address FROM `'.addslashes($this->prefix).'address_book` GROUP BY customers_id'); + $matchAddresses = array(); + foreach($addresses as $address) + $matchAddresses[$address['id_customer']] = $address['id_address']; + $psCarrierDefault = (int)Configuration::get('PS_CARRIER_DEFAULT'); + $psCurrency = Currency::getCurrencies(); + + foreach($psCurrency as $key => $currency) + { + $psCurrency[$currency['iso_code']] = $currency['id_currency']; + unset($psCurrency[$key]); + } + + $orders = $this->ExecuteS(' + SELECT orders_id as id_cart, '.$psCarrierDefault.' as id_carrier, 1 as id_lang, currency as id_currency, customers_id as id_customer, payment_method as payment, 1 as valid + FROM `'.addslashes($this->prefix).'orders` LIMIT '.(int)($limit).' , '.(int)$nrb_import); + foreach($orders as $key => $order) + { + $orders[$key]['id_currency'] = (array_key_exists($order['id_currency'], $psCurrency) ? $psCurrency[$order['id_currency']] : 0); + $orders[$key]['id_address_delivery'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0); + $orders[$key]['id_address_invoice'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0); + $orders[$key]['total_paid'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\''); + $orders[$key]['total_paid_real'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\''); + $orders[$key]['total_products'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_shipping\''); + $tax = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_tax\''); + $orders[$key]['total_products_wt'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\'') - $tax; + $orders[$key]['total_shipping'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_shipping\''); + $orders[$key]['total_discounts'] = 0; + $orders[$key]['total_wrapping'] = 0; + $orders[$key]['cart_products'] = $this->ExecuteS(' + SELECT `orders_id` as id_cart, `products_id` as id_product, 0 as id_product_attribute, `products_quantity` as quantity + FROM `'.addslashes($this->prefix).'orders_products` WHERE `orders_id` = '.$order['id_cart']); + $orders[$key]['order_products'] = $this->ExecuteS(' + SELECT `orders_id` as id_order, `products_id` as product_id, 0 as product_attribute_id, `products_name` as product_name, `products_quantity` as product_quantity, + `final_price` as product_price, 0 as product_weight + FROM `'.addslashes($this->prefix).'orders_products` WHERE `orders_id` = '.$order['id_cart']); + $orders[$key]['order_history'] = $this->ExecuteS(' + SELECT `orders_status_history_id` as id_order_history, 0 as id_employee, `orders_id` as id_order, `orders_status_id` as id_order_state, `date_added` as date_add + FROM `'.addslashes($this->prefix).'orders_status_history` WHERE `orders_id` = '.$order['id_cart']); + + } + return $orders; + } + + private function autoFormat($items, $identifier, $keyLanguage = NULL, $multiLangFields = array()) + { + $array = array(); + foreach ($items AS $item) + if (sizeof($multiLangFields) && is_array($multiLangFields) && isset($array[$item[$identifier]][$multiLangFields[0]])) + foreach ($multiLangFields AS $key) + $array[$item[$identifier]][$key][$item[$keyLanguage]] = $item[$key]; + else + foreach ($item AS $key => $value) + if (sizeof($multiLangFields) AND in_array($key, $multiLangFields)) + $array[$item[$identifier]][$key] = array($item[$keyLanguage] => $value); + elseif (sizeof($multiLangFields) AND $key == $keyLanguage) + continue; + else + $array[$item[$identifier]][$key] = $value; + return $array; + } + + public function hookbeforeAuthentication($params) + { + $passwd = trim(Tools::getValue('passwd')); + $email = trim(Tools::getValue('email')); + $result = Db::getInstance()->GetRow(' + SELECT * + FROM `'._DB_PREFIX_ .'customer` + WHERE `active` = 1 AND `email` = \''.pSQL($email).'\''); + if ($result && !empty($result['passwd_'.$this->name])) + { + if (file_exists(dirname(__FILE__).'/passwordhash.php')) + { + include(dirname(__FILE__).'/passwordhash.php'); + $hasher = new PasswordHash(10, true); + if($hasher->CheckPassword($passwd, $result['passwd_'.pSQL($this->name)])) + { + $ps_passwd = md5(pSQL(_COOKIE_KEY_.$passwd)); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'customer` + SET `passwd` = \''.pSQL($ps_passwd).'\', passwd_'.pSQL($this->name).' = \'\' + WHERE `'._DB_PREFIX_.'customer`.`id_customer` ='.(int)$result['id_customer'].' LIMIT 1'); + } + } + } + } + +} + +?> diff --git a/modules/importerosc/it.php b/modules/importerosc/it.php new file mode 100644 index 000000000..36477df17 --- /dev/null +++ b/modules/importerosc/it.php @@ -0,0 +1,13 @@ +importerosc_e273168c3697c35b8c737d14b1a5fb26'] = 'Importatore osCommerce'; +$_MODULE['<{importerosc}prestashop>importerosc_f4a344f88bab7b04a73077bafc8a0187'] = 'Questo modulo consente di importare da osCommerce per Prestashop'; +$_MODULE['<{importerosc}prestashop>importerosc_2737b271f276b90d8a04ea4b9d18b920'] = 'Lingua osCommerce di default'; +$_MODULE['<{importerosc}prestashop>importerosc_1b473540f20c3e31ead53f84511d6c77'] = 'Valuta osCommerce di default'; +$_MODULE['<{importerosc}prestashop>importerosc_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Url negozio'; +$_MODULE['<{importerosc}prestashop>importerosc_a1831ea8716cc4375483dc42bf5fde96'] = 'Seleziona una lingua di default'; +$_MODULE['<{importerosc}prestashop>importerosc_375e6e17d4bd18a5163d3a7d13b80b4b'] = 'Seleziona una valuta di default'; +$_MODULE['<{importerosc}prestashop>importerosc_294f0969b5f80f1bae24a7183eb338d5'] = 'Imposta il tuo url negozio'; +$_MODULE['<{importerosc}prestashop>importerosc_86545d77ce5790e924190d9b5a7ac1b6'] = 'Gruppo di Commercio OS di default'; diff --git a/modules/importerosc/logo.gif b/modules/importerosc/logo.gif new file mode 100644 index 000000000..cabfae43e Binary files /dev/null and b/modules/importerosc/logo.gif differ diff --git a/modules/importerosc/passwordhash.php b/modules/importerosc/passwordhash.php new file mode 100755 index 000000000..55e80ceab --- /dev/null +++ b/modules/importerosc/passwordhash.php @@ -0,0 +1,254 @@ + in 2004-2006 and placed in +# the public domain. Revised in subsequent years, still public domain. +# +# There's absolutely no warranty. +# +# The homepage URL for this framework is: +# +# http://www.openwall.com/phpass/ +# +# Please be sure to update the Version line if you edit this file in any way. +# It is suggested that you leave the main version number intact, but indicate +# your project name (after the slash) and add your own revision information. +# +# Please do not change the "private" password hashing method implemented in +# here, thereby making your hashes incompatible. However, if you must, please +# change the hash type identifier (the "$P$") to something different. +# +# Obviously, since this code is in the public domain, the above are not +# requirements (there can be none), but merely suggestions. +# +class PasswordHash { + var $itoa64; + var $iteration_count_log2; + var $portable_hashes; + var $random_state; + + function PasswordHash($iteration_count_log2, $portable_hashes) + { + $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + + if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) + $iteration_count_log2 = 8; + $this->iteration_count_log2 = $iteration_count_log2; + + $this->portable_hashes = $portable_hashes; + + $this->random_state = microtime(); + if (function_exists('getmypid')) + $this->random_state .= getmypid(); + } + + function get_random_bytes($count) + { + $output = ''; + if (@is_readable('/dev/urandom') && + ($fh = @fopen('/dev/urandom', 'rb'))) { + $output = fread($fh, $count); + fclose($fh); + } + + if (strlen($output) < $count) { + $output = ''; + for ($i = 0; $i < $count; $i += 16) { + $this->random_state = + md5(microtime() . $this->random_state); + $output .= + pack('H*', md5($this->random_state)); + } + $output = substr($output, 0, $count); + } + + return $output; + } + + function encode64($input, $count) + { + $output = ''; + $i = 0; + do { + $value = ord($input[$i++]); + $output .= $this->itoa64[$value & 0x3f]; + if ($i < $count) + $value |= ord($input[$i]) << 8; + $output .= $this->itoa64[($value >> 6) & 0x3f]; + if ($i++ >= $count) + break; + if ($i < $count) + $value |= ord($input[$i]) << 16; + $output .= $this->itoa64[($value >> 12) & 0x3f]; + if ($i++ >= $count) + break; + $output .= $this->itoa64[($value >> 18) & 0x3f]; + } while ($i < $count); + + return $output; + } + + function gensalt_private($input) + { + $output = '$P$'; + $output .= $this->itoa64[min($this->iteration_count_log2 + + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; + $output .= $this->encode64($input, 6); + + return $output; + } + + function crypt_private($password, $setting) + { + $output = '*0'; + if (substr($setting, 0, 2) == $output) + $output = '*1'; + + $id = substr($setting, 0, 3); + # We use "$P$", phpBB3 uses "$H$" for the same thing + if ($id != '$P$' && $id != '$H$') + return $output; + + $count_log2 = strpos($this->itoa64, $setting[3]); + if ($count_log2 < 7 || $count_log2 > 30) + return $output; + + $count = 1 << $count_log2; + + $salt = substr($setting, 4, 8); + if (strlen($salt) != 8) + return $output; + + # We're kind of forced to use MD5 here since it's the only + # cryptographic primitive available in all versions of PHP + # currently in use. To implement our own low-level crypto + # in PHP would result in much worse performance and + # consequently in lower iteration counts and hashes that are + # quicker to crack (by non-PHP code). + if (PHP_VERSION >= '5') { + $hash = md5($salt . $password, TRUE); + do { + $hash = md5($hash . $password, TRUE); + } while (--$count); + } else { + $hash = pack('H*', md5($salt . $password)); + do { + $hash = pack('H*', md5($hash . $password)); + } while (--$count); + } + + $output = substr($setting, 0, 12); + $output .= $this->encode64($hash, 16); + + return $output; + } + + function gensalt_extended($input) + { + $count_log2 = min($this->iteration_count_log2 + 8, 24); + # This should be odd to not reveal weak DES keys, and the + # maximum valid value is (2**24 - 1) which is odd anyway. + $count = (1 << $count_log2) - 1; + + $output = '_'; + $output .= $this->itoa64[$count & 0x3f]; + $output .= $this->itoa64[($count >> 6) & 0x3f]; + $output .= $this->itoa64[($count >> 12) & 0x3f]; + $output .= $this->itoa64[($count >> 18) & 0x3f]; + + $output .= $this->encode64($input, 3); + + return $output; + } + + function gensalt_blowfish($input) + { + # This one needs to use a different order of characters and a + # different encoding scheme from the one in encode64() above. + # We care because the last character in our encoded string will + # only represent 2 bits. While two known implementations of + # bcrypt will happily accept and correct a salt string which + # has the 4 unused bits set to non-zero, we do not want to take + # chances and we also do not want to waste an additional byte + # of entropy. + $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + $output = '$2a$'; + $output .= chr(ord('0') + $this->iteration_count_log2 / 10); + $output .= chr(ord('0') + $this->iteration_count_log2 % 10); + $output .= '$'; + + $i = 0; + do { + $c1 = ord($input[$i++]); + $output .= $itoa64[$c1 >> 2]; + $c1 = ($c1 & 0x03) << 4; + if ($i >= 16) { + $output .= $itoa64[$c1]; + break; + } + + $c2 = ord($input[$i++]); + $c1 |= $c2 >> 4; + $output .= $itoa64[$c1]; + $c1 = ($c2 & 0x0f) << 2; + + $c2 = ord($input[$i++]); + $c1 |= $c2 >> 6; + $output .= $itoa64[$c1]; + $output .= $itoa64[$c2 & 0x3f]; + } while (1); + + return $output; + } + + function HashPassword($password) + { + $random = ''; + + if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) { + $random = $this->get_random_bytes(16); + $hash = + crypt($password, $this->gensalt_blowfish($random)); + if (strlen($hash) == 60) + return $hash; + } + + if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { + if (strlen($random) < 3) + $random = $this->get_random_bytes(3); + $hash = + crypt($password, $this->gensalt_extended($random)); + if (strlen($hash) == 20) + return $hash; + } + + if (strlen($random) < 6) + $random = $this->get_random_bytes(6); + $hash = + $this->crypt_private($password, + $this->gensalt_private($random)); + if (strlen($hash) == 34) + return $hash; + + # Returning '*' on error is safe here, but would _not_ be safe + # in a crypt(3)-like function used _both_ for generating new + # hashes and for validating passwords against existing hashes. + return '*'; + } + + function CheckPassword($password, $stored_hash) + { + $hash = $this->crypt_private($password, $stored_hash); + if ($hash[0] == '*') + $hash = crypt($password, $stored_hash); + + return $hash == $stored_hash; + } +} + +?> diff --git a/modules/index.php b/modules/index.php new file mode 100644 index 000000000..c2835ab3f --- /dev/null +++ b/modules/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/modules/livezilla/config.xml b/modules/livezilla/config.xml new file mode 100644 index 000000000..6a8e94ae5 --- /dev/null +++ b/modules/livezilla/config.xml @@ -0,0 +1,11 @@ + + + livezilla + LiveZilla + 1 + Live support chat + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/livezilla/de.php b/modules/livezilla/de.php new file mode 100644 index 000000000..42a7535af --- /dev/null +++ b/modules/livezilla/de.php @@ -0,0 +1,20 @@ +livezilla_2b6ffc604d5470a856c3a7bba581d1ae'] = 'Live Support Chat'; +$_MODULE['<{livezilla}prestashop>livezilla_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{livezilla}prestashop>livezilla_1445650302f377af43ee1f7738dc7b50'] = 'Anleitungen'; +$_MODULE['<{livezilla}prestashop>livezilla_3e4804ddb635637d8b873f7cfee85ed5'] = 'LiveZilla ist keine gehostete Lösung, das heißt, das LiveZilla auf Ihrem lokalen Computer (Schritt 1) und auf Ihrem Webserver (Schritt 2) installiert werden muss bedeutet.'; +$_MODULE['<{livezilla}prestashop>livezilla_f3a98489037e44119b187247b5894526'] = 'Die LiveZilla Installation auf Ihrem Webserver heißt LiveZilla Server.'; +$_MODULE['<{livezilla}prestashop>livezilla_417de17915872c0304c7d0b01887fb9f'] = 'Sobald Sie mit Schritt 1 & 2 fertig sind, müssen Sie in die URL Ihrer LiveZilla Installation unten ausfüllen oder direkt das Skript in den Textbereich kopieren. Dies integriert LiveZilla mit Ihrer Webseite (Schritt 3).'; +$_MODULE['<{livezilla}prestashop>livezilla_1965c2fd150423248634c52fc53c6e80'] = 'Die vollständige Installationsanleitung finden Sie auf'; +$_MODULE['<{livezilla}prestashop>livezilla_10827a74160be97df6c0873f7c9809b9'] = 'der offiziellen LiveZilla Webseite '; +$_MODULE['<{livezilla}prestashop>livezilla_0f7c0aba4acddebc7d72b7a91d339d46'] = 'Jetzt LiveZilla downloaden !'; +$_MODULE['<{livezilla}prestashop>livezilla_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{livezilla}prestashop>livezilla_e6e29281ee59dd8ab5c79b21737b6430'] = 'Geben Sie die URL für Ihre LiveZilla Installation ein'; +$_MODULE['<{livezilla}prestashop>livezilla_a1c537e365d5243201b00d3ea5a1ea00'] = 'Endgültige URL mit dem Schrägstrich, z.B.'; +$_MODULE['<{livezilla}prestashop>livezilla_c718af0f8ee7235462f7c70ef974b2e7'] = '- ODER -'; +$_MODULE['<{livezilla}prestashop>livezilla_66a4362239a5cf0c365bacbf13e98ee0'] = 'Kopieren das von LiveZilla erhaltene Skript '; +$_MODULE['<{livezilla}prestashop>livezilla_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{livezilla}prestashop>livezilla_2bc19baeea1dd9e939091b1d414da0f7'] = 'LiveZilla Live Help'; diff --git a/modules/livezilla/es.php b/modules/livezilla/es.php new file mode 100644 index 000000000..f7cc264a9 --- /dev/null +++ b/modules/livezilla/es.php @@ -0,0 +1,20 @@ +livezilla_2b6ffc604d5470a856c3a7bba581d1ae'] = 'Ayuda Chat en directo'; +$_MODULE['<{livezilla}prestashop>livezilla_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{livezilla}prestashop>livezilla_1445650302f377af43ee1f7738dc7b50'] = 'Cómo proceder'; +$_MODULE['<{livezilla}prestashop>livezilla_3e4804ddb635637d8b873f7cfee85ed5'] = 'LiveZilla no es una solución alojada, lo que significa que LiveZilla necesita ser instalado en su equipo local (paso 1) y también en su servidor web (paso 2).'; +$_MODULE['<{livezilla}prestashop>livezilla_f3a98489037e44119b187247b5894526'] = 'La instalación LiveZilla en su servidor web se llama servidor LiveZilla.'; +$_MODULE['<{livezilla}prestashop>livezilla_417de17915872c0304c7d0b01887fb9f'] = 'Una vez que haya terminado los pasos 1 y 2, es necesario rellenar la dirección URL de su instalación LiveZilla abajo o copiar y pegar directamente el código en el área de texto. Esto integra LiveZilla con su sitio web (paso 3).'; +$_MODULE['<{livezilla}prestashop>livezilla_1965c2fd150423248634c52fc53c6e80'] = 'La guía de instalación completa está disponible en'; +$_MODULE['<{livezilla}prestashop>livezilla_10827a74160be97df6c0873f7c9809b9'] = 'el sitio web oficial LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_0f7c0aba4acddebc7d72b7a91d339d46'] = '¡Descargue LiveZilla ahora!'; +$_MODULE['<{livezilla}prestashop>livezilla_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{livezilla}prestashop>livezilla_e6e29281ee59dd8ab5c79b21737b6430'] = 'Introduzca la dirección URL de su instalación LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_a1c537e365d5243201b00d3ea5a1ea00'] = 'URL absoluta con la barra final, por ejemplo,'; +$_MODULE['<{livezilla}prestashop>livezilla_c718af0f8ee7235462f7c70ef974b2e7'] = '- O -'; +$_MODULE['<{livezilla}prestashop>livezilla_66a4362239a5cf0c365bacbf13e98ee0'] = 'Copie / pegue el código dado por LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualice la configuración'; +$_MODULE['<{livezilla}prestashop>livezilla_2bc19baeea1dd9e939091b1d414da0f7'] = 'Ayuda en directo LiveZilla'; diff --git a/modules/livezilla/fr.php b/modules/livezilla/fr.php new file mode 100644 index 000000000..f8e743498 --- /dev/null +++ b/modules/livezilla/fr.php @@ -0,0 +1,20 @@ +livezilla_2b6ffc604d5470a856c3a7bba581d1ae'] = 'Chat intégré à votre site web'; +$_MODULE['<{livezilla}prestashop>livezilla_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{livezilla}prestashop>livezilla_1445650302f377af43ee1f7738dc7b50'] = 'Guide'; +$_MODULE['<{livezilla}prestashop>livezilla_3e4804ddb635637d8b873f7cfee85ed5'] = 'LiveZilla n\'est pas une solution hébergée, ce qui signifie que LiveZilla doit être installé sur votre poste local (étape 1) ainsi que sur votre serveur (étape 2).'; +$_MODULE['<{livezilla}prestashop>livezilla_f3a98489037e44119b187247b5894526'] = 'L\'installation de LiveZilla sur votre serveur est dénommée \"LiveZilla Server\"'; +$_MODULE['<{livezilla}prestashop>livezilla_417de17915872c0304c7d0b01887fb9f'] = 'Une fois les étapes 1 et 2 complétées, vous devez renseigner l\'URL de votre installation de LiveZilla Server ci-dessous, ou directement copier / coller le script dans le bloc prévu à cet effet. Cette manipulation intégrera LiveZilla sur votre boutique (étape 3).'; +$_MODULE['<{livezilla}prestashop>livezilla_1965c2fd150423248634c52fc53c6e80'] = 'Le guide d\'installation complet est disponible sur'; +$_MODULE['<{livezilla}prestashop>livezilla_10827a74160be97df6c0873f7c9809b9'] = 'le site officiel de LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_0f7c0aba4acddebc7d72b7a91d339d46'] = 'Téléchargez LiveZilla dès maintenant !'; +$_MODULE['<{livezilla}prestashop>livezilla_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{livezilla}prestashop>livezilla_e6e29281ee59dd8ab5c79b21737b6430'] = 'Indiquez l\'URL de LiveZilla Server'; +$_MODULE['<{livezilla}prestashop>livezilla_a1c537e365d5243201b00d3ea5a1ea00'] = 'URL absolue avec le slash de fin, ex. '; +$_MODULE['<{livezilla}prestashop>livezilla_c718af0f8ee7235462f7c70ef974b2e7'] = '-- OU --'; +$_MODULE['<{livezilla}prestashop>livezilla_66a4362239a5cf0c365bacbf13e98ee0'] = 'Copiez / Collez le script donné par LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; +$_MODULE['<{livezilla}prestashop>livezilla_2bc19baeea1dd9e939091b1d414da0f7'] = 'Aide LiveZilla'; diff --git a/modules/livezilla/it.php b/modules/livezilla/it.php new file mode 100644 index 000000000..844610b1b --- /dev/null +++ b/modules/livezilla/it.php @@ -0,0 +1,20 @@ +livezilla_2b6ffc604d5470a856c3a7bba581d1ae'] = 'Chat integrata '; +$_MODULE['<{livezilla}prestashop>livezilla_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{livezilla}prestashop>livezilla_1445650302f377af43ee1f7738dc7b50'] = 'Guida'; +$_MODULE['<{livezilla}prestashop>livezilla_3e4804ddb635637d8b873f7cfee85ed5'] = 'LiveZilla non è una soluzione in hosting, il che significa che LiveZilla ha bisogno di essere installato sul computer locale (fase 1) e anche sul tuo server (fase 2) .'; +$_MODULE['<{livezilla}prestashop>livezilla_f3a98489037e44119b187247b5894526'] = 'L\'installazione LiveZilla sul tuo server è chiamata Server LiveZilla.'; +$_MODULE['<{livezilla}prestashop>livezilla_417de17915872c0304c7d0b01887fb9f'] = 'Una volta terminate le fasi 1 & 2, è necessario compilare l\'URL della tua installazione LiveZilla qui sotto o direttamente il copia / incolla lo script nell\'area di testo. Questo integrerà LiveZilla con il tuo sito web (fase 3).'; +$_MODULE['<{livezilla}prestashop>livezilla_1965c2fd150423248634c52fc53c6e80'] = 'La guida di installazione completa è disponibile sul'; +$_MODULE['<{livezilla}prestashop>livezilla_10827a74160be97df6c0873f7c9809b9'] = 'sito ufficiale LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_0f7c0aba4acddebc7d72b7a91d339d46'] = 'Scarica ora LiveZilla!'; +$_MODULE['<{livezilla}prestashop>livezilla_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{livezilla}prestashop>livezilla_e6e29281ee59dd8ab5c79b21737b6430'] = 'Inserisci l\'URL della tua installazione LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_a1c537e365d5243201b00d3ea5a1ea00'] = 'URL assoluto con il trailing slash, ad esempio,'; +$_MODULE['<{livezilla}prestashop>livezilla_c718af0f8ee7235462f7c70ef974b2e7'] = '- OPPURE -'; +$_MODULE['<{livezilla}prestashop>livezilla_66a4362239a5cf0c365bacbf13e98ee0'] = 'Copia / incolla lo script dato da LiveZilla'; +$_MODULE['<{livezilla}prestashop>livezilla_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{livezilla}prestashop>livezilla_2bc19baeea1dd9e939091b1d414da0f7'] = 'LiveZilla Live Help'; diff --git a/modules/livezilla/livezilla.php b/modules/livezilla/livezilla.php new file mode 100644 index 000000000..d3eb4751c --- /dev/null +++ b/modules/livezilla/livezilla.php @@ -0,0 +1,123 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class LiveZilla extends Module +{ + public function __construct() + { + $this->name = 'livezilla'; + $this->tab = 'front_office_features'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = 'LiveZilla'; + $this->description = $this->l('Live support chat'); + } + + public function install() + { + if (!Configuration::get('LIVEZILLA_URL')) + Configuration::updateValue('LIVEZILLA_URL', Tools::htmlentitiesUTF8($_SERVER['HTTP_HOST']).'/LiveZilla/'); + return (parent::install() AND $this->registerHook('rightColumn')); + } + + public function getContent() + { + if (Tools::isSubmit('submitLiveZilla')) + { + Configuration::updateValue('LIVEZILLA_URL', Tools::getValue('LIVEZILLA_URL_TYPE').Tools::getValue('LIVEZILLA_URL')); + Configuration::updateValue('LIVEZILLA_SCRIPT', Tools::getValue('LIVEZILLA_SCRIPT'), true); + echo $this->displayConfirmation($this->l('Settings updated')); + } + + $html = '

        '.$this->displayName.'

        +
        '.$this->l('How-to').' + + '.$this->l('LiveZilla is not a hosted solution, which means that LiveZilla needs to be installed on your local computer (step 1) and on your webserver (step 2) as well.').' + '.$this->l('The LiveZilla installation on your webserver is called the LiveZilla Server.').' +

        + '.$this->l('Once you have finished step 1 & 2, you must fill in the URL of your LiveZilla installation below or directly copy / paste the script in the text area. This will integrates LiveZilla with your website (step 3).').' +

        + '.$this->l('The full installation guide is available on').' '.$this->l('the official LiveZilla website').'. +

        + '.$this->l('Download LiveZilla now!').' +
        +
         
        +
        +
        '.$this->l('Configuration').' + +
        + + +

        '.$this->l('Absolute URL with the trailing slash, e.g.,').' '.Tools::getProtocol().Tools::htmlentitiesUTF8($_SERVER['HTTP_HOST']).'/LiveZilla/

        +
        +
         
        +
        '.$this->l('-- OR --').'
        +
         
        + +
        + +
        +
         
        + +
        +
        '; + return $html; + } + + private function displayBlock() + { + global $smarty; + + + if ($livezilla_script = Configuration::get('LIVEZILLA_SCRIPT')) + $smarty->assign('LIVEZILLA_SCRIPT', $livezilla_script); + elseif ($livezilla_url = Configuration::get('LIVEZILLA_URL')) + $smarty->assign('LIVEZILLA_URL', $livezilla_url); + else + $smarty->assign('LIVEZILLA_UNDEFINED', 1); + return $this->display(__FILE__, 'livezilla.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->displayBlock(); + } + + public function hookRightColumn($params) + { + return $this->displayBlock(); + } +} \ No newline at end of file diff --git a/modules/livezilla/livezilla.tpl b/modules/livezilla/livezilla.tpl new file mode 100644 index 000000000..a5f38087a --- /dev/null +++ b/modules/livezilla/livezilla.tpl @@ -0,0 +1,54 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +{if isset($LIVEZILLA_SCRIPT)} + {$LIVEZILLA_SCRIPT} +{elseif isset($LIVEZILLA_URL)} + + {l s='LiveZilla Live Help'} + + + + + +{else} + LiveZilla +{/if} +
        \ No newline at end of file diff --git a/modules/livezilla/logo.gif b/modules/livezilla/logo.gif new file mode 100644 index 000000000..1102b93c6 Binary files /dev/null and b/modules/livezilla/logo.gif differ diff --git a/modules/livezilla/lz_download.gif b/modules/livezilla/lz_download.gif new file mode 100644 index 000000000..2ac921541 Binary files /dev/null and b/modules/livezilla/lz_download.gif differ diff --git a/modules/livezilla/lz_package.gif b/modules/livezilla/lz_package.gif new file mode 100644 index 000000000..93d1dc1fe Binary files /dev/null and b/modules/livezilla/lz_package.gif differ diff --git a/modules/livezilla/offline.png b/modules/livezilla/offline.png new file mode 100644 index 000000000..c18fc15d9 Binary files /dev/null and b/modules/livezilla/offline.png differ diff --git a/modules/loyalty/LoyaltyModule.php b/modules/loyalty/LoyaltyModule.php new file mode 100644 index 000000000..03d6e4a9b --- /dev/null +++ b/modules/loyalty/LoyaltyModule.php @@ -0,0 +1,247 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class LoyaltyModule extends ObjectModel +{ + public $id_loyalty_state; + public $id_customer; + public $id_order; + public $id_discount; + public $points; + public $date_add; + public $date_upd; + + protected $fieldsRequired = array('id_customer', 'points'); + protected $fieldsValidate = array('id_loyalty_state' => 'isInt', 'id_customer' => 'isInt', 'id_discount' => 'isInt', 'id_order' => 'isInt', 'points' => 'isInt'); + + protected $table = 'loyalty'; + protected $identifier = 'id_loyalty'; + + public function getFields() + { + parent::validateFields(); + $fields['id_loyalty_state'] = (int)$this->id_loyalty_state; + $fields['id_customer'] = (int)$this->id_customer; + $fields['id_order'] = (int)$this->id_order; + $fields['id_discount'] = (int)$this->id_discount; + $fields['points'] = (int)$this->points; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + public function save($nullValues = false, $autodate = true) + { + parent::save($nullValues, $autodate); + $this->historize(); + } + + static public function getByOrderId($id_order) + { + if (!Validate::isUnsignedId($id_order)) + return false; + + $result = Db::getInstance()->getRow(' + SELECT f.id_loyalty + FROM `'._DB_PREFIX_.'loyalty` f + WHERE f.id_order = '.(int)($id_order)); + + return isset($result['id_loyalty']) ? $result['id_loyalty'] : false; + } + + static public function getOrderNbPoints($order) + { + if (!Validate::isLoadedObject($order)) + return false; + return self::getCartNbPoints(new Cart((int)$order->id_cart)); + } + + static public function getCartNbPoints($cart, $newProduct = NULL) + { + $total = 0; + if (Validate::isLoadedObject($cart)) + { + $cartProducts = $cart->getProducts(); + $taxesEnabled = Product::getTaxCalculationMethod(); + if (isset($newProduct) AND !empty($newProduct)) + { + $cartProductsNew['id_product'] = (int)$newProduct->id; + if ($taxesEnabled == PS_TAX_EXC) + $cartProductsNew['price'] = number_format($newProduct->getPrice(false, (int)($newProduct->getIdProductAttributeMostExpensive())), 2, '.', ''); + else + $cartProductsNew['price_wt'] = number_format($newProduct->getPrice(true, (int)($newProduct->getIdProductAttributeMostExpensive())), 2, '.', ''); + $cartProductsNew['cart_quantity'] = 1; + $cartProducts[] = $cartProductsNew; + } + foreach ($cartProducts AS $product) + { + if (!(int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND Product::isDiscounted((int)$product['id_product'])) + { + global $smarty; + if (isset($smarty) AND is_object($newProduct) AND $product['id_product'] == $newProduct->id) + $smarty->assign('no_pts_discounted', 1); + continue; + } + $total += self::getNbPointsByPrice($taxesEnabled == PS_TAX_EXC ? $product['price'] : $product['price_wt']) * (int)($product['cart_quantity']); + } + foreach ($cart->getDiscounts(false) AS $discount) + $total -= self::getNbPointsByPrice($discount['value_real']); + } + + return $total; + } + + static public function getVoucherValue($nbPoints, $id_currency = NULL) + { + global $cookie; + + if (empty($id_currency)) + $id_currency = (int)$cookie->id_currency; + + return (int)$nbPoints * (float)Tools::convertPrice(Configuration::get('PS_LOYALTY_POINT_VALUE'), new Currency((int)$id_currency)); + } + + static public function getNbPointsByPrice($price) + { + global $cookie; + + if (Configuration::get('PS_CURRENCY_DEFAULT') != $cookie->id_currency) + { + $currency = new Currency((int)($cookie->id_currency)); + if ($currency->conversion_rate) + $price = $price / $currency->conversion_rate; + } + + /* Prevent division by zero */ + $points = 0; + if ($pointRate = (float)(Configuration::get('PS_LOYALTY_POINT_RATE'))) + $points = floor(number_format($price, 2, '.', '') / $pointRate); + + return (int)$points; + } + + static public function getPointsByCustomer($id_customer) + { + return + Db::getInstance()->getValue(' + SELECT SUM(f.points) points + FROM `'._DB_PREFIX_.'loyalty` f + WHERE f.id_customer = '.(int)($id_customer).' + AND f.id_loyalty_state IN ('.(int)(LoyaltyStateModule::getValidationId()).', '.(int)(LoyaltyStateModule::getNoneAwardId()).')') + + + Db::getInstance()->getValue(' + SELECT SUM(f.points) points + FROM `'._DB_PREFIX_.'loyalty` f + WHERE f.id_customer = '.(int)($id_customer).' + AND f.id_loyalty_state = '.(int)LoyaltyStateModule::getCancelId().' AND points < 0'); + } + + static public function getAllByIdCustomer($id_customer, $id_lang, $onlyValidate = false, $pagination = false, $nb = 10, $page = 1) + { + $query = ' + SELECT f.id_order AS id, f.date_add AS date, (o.total_paid - o.total_shipping) total_without_shipping, f.points, f.id_loyalty, f.id_loyalty_state, fsl.name state + FROM `'._DB_PREFIX_.'loyalty` f + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (f.id_order = o.id_order) + LEFT JOIN `'._DB_PREFIX_.'loyalty_state_lang` fsl ON (f.id_loyalty_state = fsl.id_loyalty_state AND fsl.id_lang = '.(int)($id_lang).') + WHERE f.id_customer = '.(int)($id_customer); + if ($onlyValidate === true) + $query .= ' AND f.id_loyalty_state = '.(int)LoyaltyStateModule::getValidationId(); + $query .= ' GROUP BY f.id_loyalty '. + ($pagination ? 'LIMIT '.(((int)($page) - 1) * (int)($nb)).', '.(int)($nb) : ''); + + return Db::getInstance()->ExecuteS($query); + } + + static public function getDiscountByIdCustomer($id_customer, $last=false) + { + $query = ' + SELECT f.id_discount AS id_discount, f.date_upd AS date_add + FROM `'._DB_PREFIX_.'loyalty` f + WHERE f.id_customer = '.(int)($id_customer).' AND id_discount > 0'; + if ($last === true) + $query.= ' ORDER BY f.id_loyalty DESC LIMIT 0,1'; + $query.= ' GROUP BY f.id_discount'; + + return Db::getInstance()->ExecuteS($query); + } + + static public function registerDiscount($discount) + { + if (!Validate::isLoadedObject($discount)) + die(Tools::displayError('Incorrect object Discount.')); + $items = self::getAllByIdCustomer((int)$discount->id_customer, NULL, true); + foreach ($items AS $item) + { + $f = new LoyaltyModule((int)$item['id_loyalty']); + + /* Check for negative points for this order */ + $negativePoints = (int)Db::getInstance()->getValue('SELECT SUM(points) points FROM '._DB_PREFIX_.'loyalty WHERE id_order = '.(int)$f->id_order.' AND id_loyalty_state = '.(int)LoyaltyStateModule::getCancelId().' AND points < 0'); + + if ($f->points + $negativePoints <= 0) + continue; + + $f->id_discount = (int)$discount->id; + $f->id_loyalty_state = (int)LoyaltyStateModule::getConvertId(); + $f->save(); + } + } + + static public function getOrdersByIdDiscount($id_discount) + { + $items = Db::getInstance()->ExecuteS(' + SELECT f.id_order AS id_order, f.points AS points, f.date_upd AS date + FROM `'._DB_PREFIX_.'loyalty` f + WHERE f.id_discount = '.(int)($id_discount).' AND f.id_loyalty_state = '.(int)(LoyaltyStateModule::getConvertId())); + + if (!empty($items) AND is_array($items)) + { + foreach ($items AS $key => $item) + { + $order = new Order((int)$item['id_order']); + $items[$key]['id_currency'] = (int)$order->id_currency; + $items[$key]['id_lang'] = (int)$order->id_lang; + $items[$key]['total_paid'] = $order->total_paid; + $items[$key]['total_shipping'] = $order->total_shipping; + } + return $items; + } + + return false; + } + + /* Register all transaction in a specific history table */ + private function historize() + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'loyalty_history` (`id_loyalty`, `id_loyalty_state`, `points`, `date_add`) + VALUES ('.(int)($this->id).', '.(int)($this->id_loyalty_state).', '.(int)($this->points).', NOW())'); + } + +} \ No newline at end of file diff --git a/modules/loyalty/LoyaltyStateModule.php b/modules/loyalty/LoyaltyStateModule.php new file mode 100644 index 000000000..308487bea --- /dev/null +++ b/modules/loyalty/LoyaltyStateModule.php @@ -0,0 +1,93 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class LoyaltyStateModule extends ObjectModel +{ + public $name; + public $id_order_state; + + protected $fieldsValidate = array('id_order_state' => 'isInt'); + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 128); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'loyalty_state'; + protected $identifier = 'id_loyalty_state'; + + public function getFields() + { + parent::validateFields(); + $fields['id_order_state'] = (int)($this->id_order_state); + return $fields; + } + + /** + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + static public function getDefaultId() { return 1; } + static public function getValidationId() { return 2; } + static public function getCancelId() { return 3; } + static public function getConvertId() { return 4; } + static public function getNoneAwardId() { return 5; } + + static public function insertDefaultData() + { + $loyaltyModule = new Loyalty(); + $languages = Language::getLanguages(); + + $defaultTranslations = array('default' => array('id_loyalty_state' => (int)LoyaltyStateModule::getDefaultId(), 'default' => $loyaltyModule->getL('Awaiting validation'), 'en' => 'Awaiting validation', 'fr' => 'En attente de validation')); + $defaultTranslations['validated'] = array('id_loyalty_state' => (int)LoyaltyStateModule::getValidationId(), 'id_order_state' => _PS_OS_DELIVERED_, 'default' => $loyaltyModule->getL('Available'), 'en' => 'Available', 'fr' => 'Disponible'); + $defaultTranslations['cancelled'] = array('id_loyalty_state' => (int)LoyaltyStateModule::getCancelId(), 'id_order_state' => _PS_OS_CANCELED_, 'default' => $loyaltyModule->getL('Cancelled'), 'en' => 'Cancelled', 'fr' => 'Annulés'); + $defaultTranslations['converted'] = array('id_loyalty_state' => (int)LoyaltyStateModule::getConvertId(), 'default' => $loyaltyModule->getL('Already converted'), 'en' => 'Already converted', 'fr' => 'Déjà convertis'); + $defaultTranslations['none_award'] = array('id_loyalty_state' => (int)LoyaltyStateModule::getNoneAwardId(), 'default' => $loyaltyModule->getL('Unavailable on discounts'), 'en' => 'Unavailable on discounts', 'fr' => 'Non disponbile sur produits remisés'); + + foreach ($defaultTranslations AS $loyaltyState) + { + $state = new LoyaltyStateModule((int)$loyaltyState['id_loyalty_state']); + if (isset($loyaltyState['id_order_state'])) + $state->id_order_state = (int)$loyaltyState['id_order_state']; + $state->name[(int)Configuration::get('PS_LANG_DEFAULT')] = $loyaltyState['default']; + foreach ($languages AS $language) + if (isset($loyaltyState[$language['iso_code']])) + $state->name[(int)$language['id_lang']] = $loyaltyState[$language['iso_code']]; + $state->save(); + } + + return true; + } +} \ No newline at end of file diff --git a/modules/loyalty/config.xml b/modules/loyalty/config.xml new file mode 100755 index 000000000..630477252 --- /dev/null +++ b/modules/loyalty/config.xml @@ -0,0 +1,12 @@ + + + loyalty + Customer loyalty and rewards + 1.8 + Provide a loyalty program to your customers. + PrestaShop + pricing_promotion + Are you sure you want to delete all loyalty points and customer history? + 1 + 1 + \ No newline at end of file diff --git a/modules/loyalty/de.php b/modules/loyalty/de.php new file mode 100644 index 000000000..a804b3701 --- /dev/null +++ b/modules/loyalty/de.php @@ -0,0 +1,99 @@ +loyalty_30146a132c2aa28808a8411ed74c12ed'] = 'Kundentreue und Belohnungen'; +$_MODULE['<{loyalty}prestashop>loyalty_f8763c754ba455aa6e8ddf0e62911eb7'] = 'Bieten Sie Ihren Kunden ein Treueprogramm'; +$_MODULE['<{loyalty}prestashop>loyalty_f0338d5a7bbd642cc188ca69c8a97b12'] = 'Dies löscht alle Treuepunkte und die Verlaufsgeschichte Ihrer Kunden, sind Sie sicher?'; +$_MODULE['<{loyalty}prestashop>loyalty_7307b68f93443d5863f1d3943c546b20'] = 'Treuebonus'; +$_MODULE['<{loyalty}prestashop>loyalty_e81b2826b5aebd9c92fb5d090f0cdc9d'] = 'Sie müssen mindestens eine Kategorie für Gutschein-Aktionen wählen'; +$_MODULE['<{loyalty}prestashop>loyalty_f38f5974cdc23279ffe6d203641a8bdf'] = 'Einstellungen aktualisiert.'; +$_MODULE['<{loyalty}prestashop>loyalty_5be9427a9169ad6e9b63b0c9c61575d9'] = 'Treueprogramm'; +$_MODULE['<{loyalty}prestashop>loyalty_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{loyalty}prestashop>loyalty_8334a158298fbcf163f4dcb4a387d150'] = 'Quote'; +$_MODULE['<{loyalty}prestashop>loyalty_315eae70bcaee168f1654c0ceeeef357'] = '1 Bonuspunkt'; +$_MODULE['<{loyalty}prestashop>loyalty_e3ff7eaa9deb31e1e91178a7216135c0'] = '1 Punkt ='; +$_MODULE['<{loyalty}prestashop>loyalty_46108358594124685e77e7d49f762b30'] = 'für den Rabatt'; +$_MODULE['<{loyalty}prestashop>loyalty_98cf9475009d3c6e795ffac5d391cec4'] = 'Gutschein-Details'; +$_MODULE['<{loyalty}prestashop>loyalty_dd98e4d652530674f61201056fdbe9b4'] = 'Minimalbetrag zur Benutzung des Gutscheins'; +$_MODULE['<{loyalty}prestashop>loyalty_51ab56dd5b46c7b5c8fdf22651ae0db6'] = 'Punkte auf herabgesetzte Produkte verteilen'; +$_MODULE['<{loyalty}prestashop>loyalty_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{loyalty}prestashop>loyalty_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{loyalty}prestashop>loyalty_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{loyalty}prestashop>loyalty_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'Punkte werden vergeben, wenn die Bestellung'; +$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'Punkte werden gelöscht, wenn die Bestellung'; +$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'Gutscheine, die vom Treue-System erstellt wurden, können in den folgenden Kategorien verwendet werden:'; +$_MODULE['<{loyalty}prestashop>loyalty_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{loyalty}prestashop>loyalty_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Markieren Sie alle Kontrollkästchen der Kategorien, in denen Treue-Gutscheine nutzbar sind'; +$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Treuepunkte-Fortschritt'; +$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Ursprünglich'; +$_MODULE['<{loyalty}prestashop>loyalty_453e6aa38d87b28ccae545967c53004f'] = 'Nicht verfügbar'; +$_MODULE['<{loyalty}prestashop>loyalty_6366c60fc5b4f4fce0e3dd146494a4f4'] = 'Eingelöst'; +$_MODULE['<{loyalty}prestashop>loyalty_13148717f8faa9037f37d28971dfc219'] = 'Bestätigung'; +$_MODULE['<{loyalty}prestashop>loyalty_a149e85a44aeec9140e92733d9ed694e'] = 'Abgebrochen'; +$_MODULE['<{loyalty}prestashop>loyalty_38fb7d24e0d60a048f540ecb18e13376'] = 'Speichern'; +$_MODULE['<{loyalty}prestashop>loyalty_f67fb9d4e53cbac558e2735a7503ce92'] = 'Treuepunkte'; +$_MODULE['<{loyalty}prestashop>loyalty_0aab81de5c4c87021772015efc184d67'] = 'Punkte'; +$_MODULE['<{loyalty}prestashop>loyalty_309cd9f5437d1bb06a7fdab1811afe1a'] = 'Dieser Kunde hat keine Punkte'; +$_MODULE['<{loyalty}prestashop>loyalty_a240fa27925a635b08dc28c9e4f9216d'] = 'Bestellung'; +$_MODULE['<{loyalty}prestashop>loyalty_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{loyalty}prestashop>loyalty_aa7f22f84f7be784055a3e7e7d22c519'] = 'Insgesamt (ohne Versandkosten)'; +$_MODULE['<{loyalty}prestashop>loyalty_75dd5f1160a3f02b6fae89c54361a1b3'] = 'Punkte'; +$_MODULE['<{loyalty}prestashop>loyalty_1026e44f047fb9da36a62c0a8846baac'] = 'Punkte-Status'; +$_MODULE['<{loyalty}prestashop>loyalty_01abfc750a0c942167651c40d088531d'] = 'Nr.'; +$_MODULE['<{loyalty}prestashop>loyalty_66c2c90ea9f6f4a12854195085781d7f'] = 'Gesamtpunktezahl zur Verfügung:'; +$_MODULE['<{loyalty}prestashop>loyalty_928666bdf20510dfa5c58393b77f1798'] = 'Gutschein-Wert:'; +$_MODULE['<{loyalty}prestashop>loyalty_a9be824aae4f2381a27b7c699b1e041e'] = 'Warten auf Bestätigung'; +$_MODULE['<{loyalty}prestashop>loyalty_78945de8de090e90045d299651a68a9b'] = 'Verfügbar'; +$_MODULE['<{loyalty}prestashop>loyalty_4cb08bf5ad3d3c7b010dde725a078b28'] = 'Bereits eingelöst'; +$_MODULE['<{loyalty}prestashop>loyalty_01371a1d58e9234c0b9dbc08cf54fa8b'] = 'Nicht für Rabatte zur Verfügung'; +$_MODULE['<{loyalty}prestashop>loyalty_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mein Konto'; +$_MODULE['<{loyalty}prestashop>loyalty_c540093e64d84440025b2d8201f04336'] = 'Meine Treuepunkte'; +$_MODULE['<{loyalty}prestashop>loyalty_5acc2ceeb883ba07cef2d02ea382f242'] = 'Sie haben keine Bestellungen vorgenommen.'; +$_MODULE['<{loyalty}prestashop>loyalty_dd1f775e443ff3b9a89270713580a51b'] = 'Zurück'; +$_MODULE['<{loyalty}prestashop>loyalty_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Weiter'; +$_MODULE['<{loyalty}prestashop>loyalty_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{loyalty}prestashop>loyalty_6c583afb157e33bfb5b7c3d4114c4dd5'] = 'Artikel:'; +$_MODULE['<{loyalty}prestashop>loyalty_c48105520852bbd0fa692e4c9fd61628'] = 'Hier generierte Gutscheine sind in den folgenden Kategorien anwendbar:'; +$_MODULE['<{loyalty}prestashop>loyalty_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{loyalty}prestashop>loyalty_5b7d558a20e8bcb6d9355a012becb1eb'] = 'Sind Sie sicher, dass Sie Ihre Punkte in Gutscheine umwandeln wollen?'; +$_MODULE['<{loyalty}prestashop>loyalty_4db04271e368fe3d4e1aa7332a18fa9d'] = 'Meine Punkte in einen Gutschein im Wert von umwandeln'; +$_MODULE['<{loyalty}prestashop>loyalty_b39cba8836db01a04888aef6ba386420'] = 'Meine Gutscheine aus Treuepunkten'; +$_MODULE['<{loyalty}prestashop>loyalty_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Erstellt'; +$_MODULE['<{loyalty}prestashop>loyalty_689202409e48743b914713f96d93947c'] = 'Wert'; +$_MODULE['<{loyalty}prestashop>loyalty_ca0dbad92a874b2f69b549293387925e'] = 'Code'; +$_MODULE['<{loyalty}prestashop>loyalty_eb902cf204f3e4dfffeb56d92a9b5c26'] = 'Gültig ab'; +$_MODULE['<{loyalty}prestashop>loyalty_b2844b8e17ecaaeae68d018fe9418af0'] = 'Gültig bis'; +$_MODULE['<{loyalty}prestashop>loyalty_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{loyalty}prestashop>loyalty_3ec365dd533ddb7ef3d1c111186ce872'] = 'Details'; +$_MODULE['<{loyalty}prestashop>loyalty_29aa46cc3d2677c7e0f216910df600ff'] = 'Kostenloser Versand'; +$_MODULE['<{loyalty}prestashop>loyalty_cec73b5ce095a59305ad92a0d47495cb'] = 'So verwenden Sie'; +$_MODULE['<{loyalty}prestashop>loyalty_019d1ca7d50cc54b995f60d456435e87'] = 'Gebraucht'; +$_MODULE['<{loyalty}prestashop>loyalty_2af3bf4c82c5b33875d532820a959799'] = 'Durch diese Befehle erstellt'; +$_MODULE['<{loyalty}prestashop>loyalty_d1228f5476d15142b1358ae4b5fa2454'] = 'Bestellung Nr.'; +$_MODULE['<{loyalty}prestashop>loyalty_d5797f3bbadc278f756576dafc6ab4b8'] = 'Punkte.'; +$_MODULE['<{loyalty}prestashop>loyalty_1f67ea7a0b26e9eacc70523bde28df0c'] = 'mehr ...'; +$_MODULE['<{loyalty}prestashop>loyalty_a16cf3ec5200cc519f4fe48e34b1df83'] = 'Die Mindestbestellmenge zur Verwendung dieser Gutscheine beträgt:'; +$_MODULE['<{loyalty}prestashop>loyalty_8e69341aca5dbf9f55c2e75a2ed5df3c'] = 'Noch keine Gutscheine.'; +$_MODULE['<{loyalty}prestashop>loyalty_00d56a5e37c19c59d521530fc8e7f337'] = 'Noch keine Bonuspunkte.'; +$_MODULE['<{loyalty}prestashop>loyalty_0b3db27bc15f682e92ff250ebb167d4b'] = 'Zurück zu Ihrem Konto'; +$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Start'; +$_MODULE['<{loyalty}prestashop>my-account_c540093e64d84440025b2d8201f04336'] = 'Meine Treuepunkte'; +$_MODULE['<{loyalty}prestashop>product_ded9088edfbcc1041c3a642b031c8f72'] = 'Treueprogramm'; +$_MODULE['<{loyalty}prestashop>product_08ef6b34ab8e7039ef0ee69378f0ac0b'] = 'Sammeln Sie mit dem Kauf dieses Produktes Sie bis zu'; +$_MODULE['<{loyalty}prestashop>product_2996152bb442bf98c80c515c6055de5f'] = 'Treuepunkte'; +$_MODULE['<{loyalty}prestashop>product_b40d5c523ee75453134b1449dd9cd13a'] = 'Treuepunkte'; +$_MODULE['<{loyalty}prestashop>product_b9cb3a85529dd593c14c838e22976cff'] = 'Ihr Warenkorb hat insgesamt'; +$_MODULE['<{loyalty}prestashop>product_0aab81de5c4c87021772015efc184d67'] = 'Punkte'; +$_MODULE['<{loyalty}prestashop>product_78ee54aa8f813885fe2fe20d232518b9'] = 'Punkt'; +$_MODULE['<{loyalty}prestashop>product_443c3e03e194c2a4cdb107808b051615'] = 'die in einen Gutschein im Wert von umgerechnet werden können'; +$_MODULE['<{loyalty}prestashop>product_054a9c66cc92b7f1bfcacee3b7c7ad54'] = 'Keine Bonuspunkte für dieses Produkt, weil es bereits herabgesetzt ist.'; +$_MODULE['<{loyalty}prestashop>product_e94d481804904a48c1a8093e7a069570'] = 'Keine Bonuspunkte für dieses Produkt.'; +$_MODULE['<{loyalty}prestashop>shopping-cart_ea2c0ea1a08add3a75273e7f32f05f7a'] = 'Treue'; +$_MODULE['<{loyalty}prestashop>shopping-cart_4cd8259257033282f11cc9bbe648dff7'] = 'Durch die Überprüfung dieses Warenkorbs können Sie bis zu'; +$_MODULE['<{loyalty}prestashop>shopping-cart_2996152bb442bf98c80c515c6055de5f'] = 'Treuepunkte'; +$_MODULE['<{loyalty}prestashop>shopping-cart_b40d5c523ee75453134b1449dd9cd13a'] = 'Treuepunkte'; +$_MODULE['<{loyalty}prestashop>shopping-cart_443c3e03e194c2a4cdb107808b051615'] = 'die in einen Gutschein im Wert von umgerechnet werden können'; +$_MODULE['<{loyalty}prestashop>shopping-cart_8cec799df06a3f5a026b31fcd95e0172'] = 'Fügen Sie einige Produkte zu Ihrem Warenkorb, um einige Treuepunkte zu sammeln.'; diff --git a/modules/loyalty/en.php b/modules/loyalty/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/loyalty/en.php @@ -0,0 +1,4 @@ +loyalty_30146a132c2aa28808a8411ed74c12ed'] = 'La fidelidad de los clientes y las recompensas'; +$_MODULE['<{loyalty}prestashop>loyalty_f8763c754ba455aa6e8ddf0e62911eb7'] = 'Propone un programa de fidelización a sus clientes'; +$_MODULE['<{loyalty}prestashop>loyalty_f0338d5a7bbd642cc188ca69c8a97b12'] = 'Esta acción suprimirá todos los puntos de fidelidad y el historial de los puntos de todos sus clientes, ¿está seguro de que desea continuar?'; +$_MODULE['<{loyalty}prestashop>loyalty_7307b68f93443d5863f1d3943c546b20'] = 'Recompensa fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_e81b2826b5aebd9c92fb5d090f0cdc9d'] = 'Debe elegir al menos una categoría para generar vales descuento'; +$_MODULE['<{loyalty}prestashop>loyalty_f38f5974cdc23279ffe6d203641a8bdf'] = 'Ajustes actualizados.'; +$_MODULE['<{loyalty}prestashop>loyalty_5be9427a9169ad6e9b63b0c9c61575d9'] = 'Programa de Fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_f4f70727dc34561dfde1a3c529b6205c'] = 'Ajustes'; +$_MODULE['<{loyalty}prestashop>loyalty_8334a158298fbcf163f4dcb4a387d150'] = 'Ratio'; +$_MODULE['<{loyalty}prestashop>loyalty_315eae70bcaee168f1654c0ceeeef357'] = '1 punto de recompensa'; +$_MODULE['<{loyalty}prestashop>loyalty_e3ff7eaa9deb31e1e91178a7216135c0'] = '1 punto ='; +$_MODULE['<{loyalty}prestashop>loyalty_46108358594124685e77e7d49f762b30'] = 'para el descuento'; +$_MODULE['<{loyalty}prestashop>loyalty_98cf9475009d3c6e795ffac5d391cec4'] = 'Detalles del vale'; +$_MODULE['<{loyalty}prestashop>loyalty_dd98e4d652530674f61201056fdbe9b4'] = 'Importe mínimo para utilizar este vale'; +$_MODULE['<{loyalty}prestashop>loyalty_51ab56dd5b46c7b5c8fdf22651ae0db6'] = 'Dar puntos por los productos en descuento'; +$_MODULE['<{loyalty}prestashop>loyalty_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{loyalty}prestashop>loyalty_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{loyalty}prestashop>loyalty_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{loyalty}prestashop>loyalty_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'Los Puntos se otorgan cuando el pedido sea'; +$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'Los puntos se cancelarán cuando la pedido sea'; +$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'Los vales descuento creados por el sistema de fidelidad pueden utilizarse en las categorías de artículos siguientes:'; +$_MODULE['<{loyalty}prestashop>loyalty_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{loyalty}prestashop>loyalty_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Marcar para qué categorías se utilizarán los vales descuento de fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Progresión de puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Inicial'; +$_MODULE['<{loyalty}prestashop>loyalty_453e6aa38d87b28ccae545967c53004f'] = 'No disponible'; +$_MODULE['<{loyalty}prestashop>loyalty_6366c60fc5b4f4fce0e3dd146494a4f4'] = 'Convertido'; +$_MODULE['<{loyalty}prestashop>loyalty_13148717f8faa9037f37d28971dfc219'] = 'Validación'; +$_MODULE['<{loyalty}prestashop>loyalty_a149e85a44aeec9140e92733d9ed694e'] = 'Cancelado'; +$_MODULE['<{loyalty}prestashop>loyalty_38fb7d24e0d60a048f540ecb18e13376'] = 'Guardar'; +$_MODULE['<{loyalty}prestashop>loyalty_f67fb9d4e53cbac558e2735a7503ce92'] = 'Puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_0aab81de5c4c87021772015efc184d67'] = 'Puntos'; +$_MODULE['<{loyalty}prestashop>loyalty_309cd9f5437d1bb06a7fdab1811afe1a'] = 'Este cliente no tiene puntos'; +$_MODULE['<{loyalty}prestashop>loyalty_a240fa27925a635b08dc28c9e4f9216d'] = 'Pedido'; +$_MODULE['<{loyalty}prestashop>loyalty_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{loyalty}prestashop>loyalty_aa7f22f84f7be784055a3e7e7d22c519'] = 'Total (sin transporte)'; +$_MODULE['<{loyalty}prestashop>loyalty_75dd5f1160a3f02b6fae89c54361a1b3'] = 'Puntos'; +$_MODULE['<{loyalty}prestashop>loyalty_1026e44f047fb9da36a62c0a8846baac'] = 'Estado de los puntos'; +$_MODULE['<{loyalty}prestashop>loyalty_01abfc750a0c942167651c40d088531d'] = '#'; +$_MODULE['<{loyalty}prestashop>loyalty_66c2c90ea9f6f4a12854195085781d7f'] = 'Total puntos disponibles:'; +$_MODULE['<{loyalty}prestashop>loyalty_928666bdf20510dfa5c58393b77f1798'] = 'Valor de bono:'; +$_MODULE['<{loyalty}prestashop>loyalty_a9be824aae4f2381a27b7c699b1e041e'] = 'En espera de validación'; +$_MODULE['<{loyalty}prestashop>loyalty_78945de8de090e90045d299651a68a9b'] = 'Disponibles'; +$_MODULE['<{loyalty}prestashop>loyalty_4cb08bf5ad3d3c7b010dde725a078b28'] = 'Convertidos'; +$_MODULE['<{loyalty}prestashop>loyalty_01371a1d58e9234c0b9dbc08cf54fa8b'] = 'No válidos en descuentos'; +$_MODULE['<{loyalty}prestashop>loyalty_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta:'; +$_MODULE['<{loyalty}prestashop>loyalty_c540093e64d84440025b2d8201f04336'] = 'Mis puntos recompensa'; +$_MODULE['<{loyalty}prestashop>loyalty_5acc2ceeb883ba07cef2d02ea382f242'] = 'Usted no ha solicitado pedidos.'; +$_MODULE['<{loyalty}prestashop>loyalty_dd1f775e443ff3b9a89270713580a51b'] = 'Anterior'; +$_MODULE['<{loyalty}prestashop>loyalty_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Siguiente'; +$_MODULE['<{loyalty}prestashop>loyalty_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{loyalty}prestashop>loyalty_6c583afb157e33bfb5b7c3d4114c4dd5'] = 'objetos:'; +$_MODULE['<{loyalty}prestashop>loyalty_c48105520852bbd0fa692e4c9fd61628'] = 'Los vales descuento generados aquí pueden utilizarse para los artículos de las siguientes categorías:'; +$_MODULE['<{loyalty}prestashop>loyalty_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todas'; +$_MODULE['<{loyalty}prestashop>loyalty_5b7d558a20e8bcb6d9355a012becb1eb'] = '¿Está seguro de querer transformar sus puntos en vales de compra?'; +$_MODULE['<{loyalty}prestashop>loyalty_4db04271e368fe3d4e1aa7332a18fa9d'] = 'Transformar mis puntos en un vale de'; +$_MODULE['<{loyalty}prestashop>loyalty_b39cba8836db01a04888aef6ba386420'] = 'Mis vales de puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>loyalty_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Creado'; +$_MODULE['<{loyalty}prestashop>loyalty_689202409e48743b914713f96d93947c'] = 'Valor'; +$_MODULE['<{loyalty}prestashop>loyalty_ca0dbad92a874b2f69b549293387925e'] = 'Código'; +$_MODULE['<{loyalty}prestashop>loyalty_eb902cf204f3e4dfffeb56d92a9b5c26'] = 'Válido del'; +$_MODULE['<{loyalty}prestashop>loyalty_b2844b8e17ecaaeae68d018fe9418af0'] = 'Válido hasta'; +$_MODULE['<{loyalty}prestashop>loyalty_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; +$_MODULE['<{loyalty}prestashop>loyalty_3ec365dd533ddb7ef3d1c111186ce872'] = 'Detalles'; +$_MODULE['<{loyalty}prestashop>loyalty_29aa46cc3d2677c7e0f216910df600ff'] = 'Transporte gratuíto'; +$_MODULE['<{loyalty}prestashop>loyalty_cec73b5ce095a59305ad92a0d47495cb'] = 'Para usar'; +$_MODULE['<{loyalty}prestashop>loyalty_019d1ca7d50cc54b995f60d456435e87'] = 'Usado'; +$_MODULE['<{loyalty}prestashop>loyalty_2af3bf4c82c5b33875d532820a959799'] = 'Generado por los siguientes pedidos'; +$_MODULE['<{loyalty}prestashop>loyalty_d1228f5476d15142b1358ae4b5fa2454'] = 'Pedido n°'; +$_MODULE['<{loyalty}prestashop>loyalty_d5797f3bbadc278f756576dafc6ab4b8'] = 'puntos.'; +$_MODULE['<{loyalty}prestashop>loyalty_1f67ea7a0b26e9eacc70523bde28df0c'] = 'más...'; +$_MODULE['<{loyalty}prestashop>loyalty_a16cf3ec5200cc519f4fe48e34b1df83'] = 'El importe mínimo requerido para utilizar estos vales es de.'; +$_MODULE['<{loyalty}prestashop>loyalty_8e69341aca5dbf9f55c2e75a2ed5df3c'] = 'Sin vales aún'; +$_MODULE['<{loyalty}prestashop>loyalty_00d56a5e37c19c59d521530fc8e7f337'] = 'Sin recompensa de puntos todavía'; +$_MODULE['<{loyalty}prestashop>loyalty_0b3db27bc15f682e92ff250ebb167d4b'] = 'Volver a su cuenta'; +$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{loyalty}prestashop>my-account_c540093e64d84440025b2d8201f04336'] = 'Mis puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>product_ded9088edfbcc1041c3a642b031c8f72'] = 'Programa de fidelización'; +$_MODULE['<{loyalty}prestashop>product_08ef6b34ab8e7039ef0ee69378f0ac0b'] = 'Al comprar este producto puede obtener hasta'; +$_MODULE['<{loyalty}prestashop>product_2996152bb442bf98c80c515c6055de5f'] = 'puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>product_b40d5c523ee75453134b1449dd9cd13a'] = 'punto de fidelidad'; +$_MODULE['<{loyalty}prestashop>product_b9cb3a85529dd593c14c838e22976cff'] = 'Su carrito totalizará'; +$_MODULE['<{loyalty}prestashop>product_0aab81de5c4c87021772015efc184d67'] = 'puntos'; +$_MODULE['<{loyalty}prestashop>product_78ee54aa8f813885fe2fe20d232518b9'] = 'punto'; +$_MODULE['<{loyalty}prestashop>product_443c3e03e194c2a4cdb107808b051615'] = 'que se puede(n) transformar en un vale de descuento de'; +$_MODULE['<{loyalty}prestashop>product_054a9c66cc92b7f1bfcacee3b7c7ad54'] = 'No hay puntos de recompensa para este producto porque ya hay un descuento'; +$_MODULE['<{loyalty}prestashop>product_e94d481804904a48c1a8093e7a069570'] = 'No hay puntos de recompensa para este producto.'; +$_MODULE['<{loyalty}prestashop>shopping-cart_ea2c0ea1a08add3a75273e7f32f05f7a'] = 'fidelidad'; +$_MODULE['<{loyalty}prestashop>shopping-cart_4cd8259257033282f11cc9bbe648dff7'] = 'Si valida su carrito, puede reunir'; +$_MODULE['<{loyalty}prestashop>shopping-cart_2996152bb442bf98c80c515c6055de5f'] = 'puntos de fidelidad'; +$_MODULE['<{loyalty}prestashop>shopping-cart_b40d5c523ee75453134b1449dd9cd13a'] = 'punto de fidelidad'; +$_MODULE['<{loyalty}prestashop>shopping-cart_443c3e03e194c2a4cdb107808b051615'] = 'que se puede(n) transformar en un vale de descuento de'; +$_MODULE['<{loyalty}prestashop>shopping-cart_8cec799df06a3f5a026b31fcd95e0172'] = 'Añadir más productos al carrito para obtener puntos de fidelidad.'; diff --git a/modules/loyalty/fr.php b/modules/loyalty/fr.php new file mode 100644 index 000000000..ad8b0c86c --- /dev/null +++ b/modules/loyalty/fr.php @@ -0,0 +1,99 @@ +loyalty_30146a132c2aa28808a8411ed74c12ed'] = 'Programme de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_f8763c754ba455aa6e8ddf0e62911eb7'] = 'Propose un programme de fidélité à vos clients'; +$_MODULE['<{loyalty}prestashop>loyalty_f0338d5a7bbd642cc188ca69c8a97b12'] = 'Cette action effacera tous les points de fidélité et l\'historique des points de tous vos clients, êtes vous sûr ?'; +$_MODULE['<{loyalty}prestashop>loyalty_7307b68f93443d5863f1d3943c546b20'] = 'Récompense fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_e81b2826b5aebd9c92fb5d090f0cdc9d'] = 'Vous devez choisir au moins une catégorie pour la génération des bons de réductions'; +$_MODULE['<{loyalty}prestashop>loyalty_f38f5974cdc23279ffe6d203641a8bdf'] = 'Configuration mise à jour.'; +$_MODULE['<{loyalty}prestashop>loyalty_5be9427a9169ad6e9b63b0c9c61575d9'] = 'Programme de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{loyalty}prestashop>loyalty_8334a158298fbcf163f4dcb4a387d150'] = 'Ratio'; +$_MODULE['<{loyalty}prestashop>loyalty_315eae70bcaee168f1654c0ceeeef357'] = '1 point de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_e3ff7eaa9deb31e1e91178a7216135c0'] = '1 point ='; +$_MODULE['<{loyalty}prestashop>loyalty_46108358594124685e77e7d49f762b30'] = 'de réduction'; +$_MODULE['<{loyalty}prestashop>loyalty_98cf9475009d3c6e795ffac5d391cec4'] = 'Détails du bon'; +$_MODULE['<{loyalty}prestashop>loyalty_dd98e4d652530674f61201056fdbe9b4'] = 'Montant minimal pour utiliser le bon'; +$_MODULE['<{loyalty}prestashop>loyalty_51ab56dd5b46c7b5c8fdf22651ae0db6'] = 'Donner des points sur les produits en promotion'; +$_MODULE['<{loyalty}prestashop>loyalty_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{loyalty}prestashop>loyalty_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{loyalty}prestashop>loyalty_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{loyalty}prestashop>loyalty_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'Points attribués au statut suivant'; +$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'Points annulés au statut suivant'; +$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'Les bons de réductions crées par le système de fidélité peuvent être utilisés dans les catégories d\'articles suivantes :'; +$_MODULE['<{loyalty}prestashop>loyalty_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{loyalty}prestashop>loyalty_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Cocher pour quelle(s) catégorie(s) seront utilisables les bons de réductions fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Statuts des points de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Initial'; +$_MODULE['<{loyalty}prestashop>loyalty_453e6aa38d87b28ccae545967c53004f'] = 'Indisponibles'; +$_MODULE['<{loyalty}prestashop>loyalty_6366c60fc5b4f4fce0e3dd146494a4f4'] = 'Convertis'; +$_MODULE['<{loyalty}prestashop>loyalty_13148717f8faa9037f37d28971dfc219'] = 'Disponibles'; +$_MODULE['<{loyalty}prestashop>loyalty_a149e85a44aeec9140e92733d9ed694e'] = 'Annulé'; +$_MODULE['<{loyalty}prestashop>loyalty_38fb7d24e0d60a048f540ecb18e13376'] = 'Sauvegarder'; +$_MODULE['<{loyalty}prestashop>loyalty_f67fb9d4e53cbac558e2735a7503ce92'] = 'Points de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_0aab81de5c4c87021772015efc184d67'] = 'points'; +$_MODULE['<{loyalty}prestashop>loyalty_309cd9f5437d1bb06a7fdab1811afe1a'] = 'Ce client n\'a pas de point'; +$_MODULE['<{loyalty}prestashop>loyalty_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{loyalty}prestashop>loyalty_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{loyalty}prestashop>loyalty_aa7f22f84f7be784055a3e7e7d22c519'] = 'Total (hors frais de ports)'; +$_MODULE['<{loyalty}prestashop>loyalty_75dd5f1160a3f02b6fae89c54361a1b3'] = 'Points'; +$_MODULE['<{loyalty}prestashop>loyalty_1026e44f047fb9da36a62c0a8846baac'] = 'Statut des points'; +$_MODULE['<{loyalty}prestashop>loyalty_01abfc750a0c942167651c40d088531d'] = 'n°'; +$_MODULE['<{loyalty}prestashop>loyalty_66c2c90ea9f6f4a12854195085781d7f'] = 'Total de points disponibles'; +$_MODULE['<{loyalty}prestashop>loyalty_928666bdf20510dfa5c58393b77f1798'] = 'Valeur du bon :'; +$_MODULE['<{loyalty}prestashop>loyalty_a9be824aae4f2381a27b7c699b1e041e'] = 'En attente de validation'; +$_MODULE['<{loyalty}prestashop>loyalty_78945de8de090e90045d299651a68a9b'] = 'Disponibles'; +$_MODULE['<{loyalty}prestashop>loyalty_4cb08bf5ad3d3c7b010dde725a078b28'] = 'Déjà convertis'; +$_MODULE['<{loyalty}prestashop>loyalty_01371a1d58e9234c0b9dbc08cf54fa8b'] = 'Non valables sur les promotions'; +$_MODULE['<{loyalty}prestashop>loyalty_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte'; +$_MODULE['<{loyalty}prestashop>loyalty_c540093e64d84440025b2d8201f04336'] = 'Mes points de fidélité'; +$_MODULE['<{loyalty}prestashop>loyalty_5acc2ceeb883ba07cef2d02ea382f242'] = 'Vous n\'avez passé aucune commande.'; +$_MODULE['<{loyalty}prestashop>loyalty_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent'; +$_MODULE['<{loyalty}prestashop>loyalty_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant'; +$_MODULE['<{loyalty}prestashop>loyalty_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{loyalty}prestashop>loyalty_6c583afb157e33bfb5b7c3d4114c4dd5'] = 'objets :'; +$_MODULE['<{loyalty}prestashop>loyalty_c48105520852bbd0fa692e4c9fd61628'] = 'Les bons de réductions générés ici peuvent être utilisés pour les articles des catégories suivantes :'; +$_MODULE['<{loyalty}prestashop>loyalty_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Toutes'; +$_MODULE['<{loyalty}prestashop>loyalty_5b7d558a20e8bcb6d9355a012becb1eb'] = 'Etes-vous sûrs de vouloir transformer vos points en bon de réduction ?'; +$_MODULE['<{loyalty}prestashop>loyalty_4db04271e368fe3d4e1aa7332a18fa9d'] = 'Transformer mes points en un bon de réduction de'; +$_MODULE['<{loyalty}prestashop>loyalty_b39cba8836db01a04888aef6ba386420'] = 'Mes bons de réductions obtenus'; +$_MODULE['<{loyalty}prestashop>loyalty_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Créé le'; +$_MODULE['<{loyalty}prestashop>loyalty_689202409e48743b914713f96d93947c'] = 'Valeur'; +$_MODULE['<{loyalty}prestashop>loyalty_ca0dbad92a874b2f69b549293387925e'] = 'Code'; +$_MODULE['<{loyalty}prestashop>loyalty_eb902cf204f3e4dfffeb56d92a9b5c26'] = 'Valide du'; +$_MODULE['<{loyalty}prestashop>loyalty_b2844b8e17ecaaeae68d018fe9418af0'] = 'Valide jusqu\'au'; +$_MODULE['<{loyalty}prestashop>loyalty_ec53a8c4f07baed5d8825072c89799be'] = 'Statut'; +$_MODULE['<{loyalty}prestashop>loyalty_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; +$_MODULE['<{loyalty}prestashop>loyalty_29aa46cc3d2677c7e0f216910df600ff'] = 'Frais de port offerts'; +$_MODULE['<{loyalty}prestashop>loyalty_cec73b5ce095a59305ad92a0d47495cb'] = 'A utiliser'; +$_MODULE['<{loyalty}prestashop>loyalty_019d1ca7d50cc54b995f60d456435e87'] = 'Utilisé'; +$_MODULE['<{loyalty}prestashop>loyalty_2af3bf4c82c5b33875d532820a959799'] = 'Généré par les commandes suivantes'; +$_MODULE['<{loyalty}prestashop>loyalty_d1228f5476d15142b1358ae4b5fa2454'] = 'Commande n°'; +$_MODULE['<{loyalty}prestashop>loyalty_d5797f3bbadc278f756576dafc6ab4b8'] = 'points.'; +$_MODULE['<{loyalty}prestashop>loyalty_1f67ea7a0b26e9eacc70523bde28df0c'] = 'plus...'; +$_MODULE['<{loyalty}prestashop>loyalty_a16cf3ec5200cc519f4fe48e34b1df83'] = 'Le montant minimum de commande afin d\'utiliser ces bons est : '; +$_MODULE['<{loyalty}prestashop>loyalty_8e69341aca5dbf9f55c2e75a2ed5df3c'] = 'Aucun bon de réduction pour le moment.'; +$_MODULE['<{loyalty}prestashop>loyalty_00d56a5e37c19c59d521530fc8e7f337'] = 'Aucun point de fidélité pour le moment.'; +$_MODULE['<{loyalty}prestashop>loyalty_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte'; +$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{loyalty}prestashop>my-account_c540093e64d84440025b2d8201f04336'] = 'Mes points de fidélité'; +$_MODULE['<{loyalty}prestashop>product_ded9088edfbcc1041c3a642b031c8f72'] = 'Programme de fidélisation'; +$_MODULE['<{loyalty}prestashop>product_08ef6b34ab8e7039ef0ee69378f0ac0b'] = 'En achetant ce produit vous pouvez gagner jusqu\'à '; +$_MODULE['<{loyalty}prestashop>product_2996152bb442bf98c80c515c6055de5f'] = 'points de fidélité'; +$_MODULE['<{loyalty}prestashop>product_b40d5c523ee75453134b1449dd9cd13a'] = 'point de fidélité'; +$_MODULE['<{loyalty}prestashop>product_b9cb3a85529dd593c14c838e22976cff'] = 'Votre panier totalisera'; +$_MODULE['<{loyalty}prestashop>product_0aab81de5c4c87021772015efc184d67'] = 'points'; +$_MODULE['<{loyalty}prestashop>product_78ee54aa8f813885fe2fe20d232518b9'] = 'point'; +$_MODULE['<{loyalty}prestashop>product_443c3e03e194c2a4cdb107808b051615'] = 'pouvant être transformé(s) en un bon de réduction de'; +$_MODULE['<{loyalty}prestashop>product_054a9c66cc92b7f1bfcacee3b7c7ad54'] = 'Aucun point de fidélité pour ce produit car il y a déjà une réduction.'; +$_MODULE['<{loyalty}prestashop>product_e94d481804904a48c1a8093e7a069570'] = 'Aucun point de fidélité pour ce produit.'; +$_MODULE['<{loyalty}prestashop>shopping-cart_ea2c0ea1a08add3a75273e7f32f05f7a'] = 'fidélité'; +$_MODULE['<{loyalty}prestashop>shopping-cart_4cd8259257033282f11cc9bbe648dff7'] = 'En validant votre panier, vous pouvez collecter'; +$_MODULE['<{loyalty}prestashop>shopping-cart_2996152bb442bf98c80c515c6055de5f'] = 'points de fidélité'; +$_MODULE['<{loyalty}prestashop>shopping-cart_b40d5c523ee75453134b1449dd9cd13a'] = 'point de fidélité'; +$_MODULE['<{loyalty}prestashop>shopping-cart_443c3e03e194c2a4cdb107808b051615'] = 'pouvant être transformé(s) en un bon de réduction de'; +$_MODULE['<{loyalty}prestashop>shopping-cart_8cec799df06a3f5a026b31fcd95e0172'] = 'Ajoutez des produits à votre panier pour gagner plus de points de fidélité.'; diff --git a/modules/loyalty/it.php b/modules/loyalty/it.php new file mode 100644 index 000000000..091f7561e --- /dev/null +++ b/modules/loyalty/it.php @@ -0,0 +1,99 @@ +loyalty_30146a132c2aa28808a8411ed74c12ed'] = 'Fidelizzazione della clientela e premi'; +$_MODULE['<{loyalty}prestashop>loyalty_f8763c754ba455aa6e8ddf0e62911eb7'] = 'Prevedi un programma di fidelizzazione per i clienti'; +$_MODULE['<{loyalty}prestashop>loyalty_f0338d5a7bbd642cc188ca69c8a97b12'] = 'Ciò eliminerà tutti i punti fedeltà e la storia dei tuoi clienti, sei sicuro?'; +$_MODULE['<{loyalty}prestashop>loyalty_7307b68f93443d5863f1d3943c546b20'] = 'Ricompensa fedeltà'; +$_MODULE['<{loyalty}prestashop>loyalty_e81b2826b5aebd9c92fb5d090f0cdc9d'] = 'È necessario scegliere almeno una categoria per la creazione di buoni'; +$_MODULE['<{loyalty}prestashop>loyalty_f38f5974cdc23279ffe6d203641a8bdf'] = 'Impostazioni aggiornate.'; +$_MODULE['<{loyalty}prestashop>loyalty_5be9427a9169ad6e9b63b0c9c61575d9'] = 'Programma di fedeltà'; +$_MODULE['<{loyalty}prestashop>loyalty_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{loyalty}prestashop>loyalty_8334a158298fbcf163f4dcb4a387d150'] = 'Rapporto'; +$_MODULE['<{loyalty}prestashop>loyalty_315eae70bcaee168f1654c0ceeeef357'] = '1 punto premio'; +$_MODULE['<{loyalty}prestashop>loyalty_e3ff7eaa9deb31e1e91178a7216135c0'] = '1 punto ='; +$_MODULE['<{loyalty}prestashop>loyalty_46108358594124685e77e7d49f762b30'] = 'per lo sconto'; +$_MODULE['<{loyalty}prestashop>loyalty_98cf9475009d3c6e795ffac5d391cec4'] = 'Dati buono sconto'; +$_MODULE['<{loyalty}prestashop>loyalty_dd98e4d652530674f61201056fdbe9b4'] = 'importo minimo per utilizzare il voucher'; +$_MODULE['<{loyalty}prestashop>loyalty_51ab56dd5b46c7b5c8fdf22651ae0db6'] = 'Dare i punti per i prodotti scontati'; +$_MODULE['<{loyalty}prestashop>loyalty_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{loyalty}prestashop>loyalty_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{loyalty}prestashop>loyalty_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{loyalty}prestashop>loyalty_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'I punti vengono assegnati quando l\'ordine è'; +$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'I punti vengono cancellati quando l\'ordine è'; +$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'I buoni creati dal sistema di fidelizzazione possono essere utilizzati nelle seguenti categorie:'; +$_MODULE['<{loyalty}prestashop>loyalty_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{loyalty}prestashop>loyalty_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Segna tutte le caselle di categorie in cui buoni fedeltà sono utilizzabili'; +$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Progressione punti fedeltà '; +$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Iniziale'; +$_MODULE['<{loyalty}prestashop>loyalty_453e6aa38d87b28ccae545967c53004f'] = 'Non disponibile'; +$_MODULE['<{loyalty}prestashop>loyalty_6366c60fc5b4f4fce0e3dd146494a4f4'] = 'Convertito'; +$_MODULE['<{loyalty}prestashop>loyalty_13148717f8faa9037f37d28971dfc219'] = 'Convalida'; +$_MODULE['<{loyalty}prestashop>loyalty_a149e85a44aeec9140e92733d9ed694e'] = 'Annullato'; +$_MODULE['<{loyalty}prestashop>loyalty_38fb7d24e0d60a048f540ecb18e13376'] = 'Salva'; +$_MODULE['<{loyalty}prestashop>loyalty_f67fb9d4e53cbac558e2735a7503ce92'] = 'Punti fedeltà'; +$_MODULE['<{loyalty}prestashop>loyalty_0aab81de5c4c87021772015efc184d67'] = 'punti'; +$_MODULE['<{loyalty}prestashop>loyalty_309cd9f5437d1bb06a7fdab1811afe1a'] = 'Il cliente non ha punti'; +$_MODULE['<{loyalty}prestashop>loyalty_a240fa27925a635b08dc28c9e4f9216d'] = 'Ordine'; +$_MODULE['<{loyalty}prestashop>loyalty_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{loyalty}prestashop>loyalty_aa7f22f84f7be784055a3e7e7d22c519'] = 'Totale (senza spese di spedizione)'; +$_MODULE['<{loyalty}prestashop>loyalty_75dd5f1160a3f02b6fae89c54361a1b3'] = 'Punti'; +$_MODULE['<{loyalty}prestashop>loyalty_1026e44f047fb9da36a62c0a8846baac'] = 'Status dei punti'; +$_MODULE['<{loyalty}prestashop>loyalty_01abfc750a0c942167651c40d088531d'] = 'n.'; +$_MODULE['<{loyalty}prestashop>loyalty_66c2c90ea9f6f4a12854195085781d7f'] = 'Totale punti disponibili:'; +$_MODULE['<{loyalty}prestashop>loyalty_928666bdf20510dfa5c58393b77f1798'] = 'Valore del buono:'; +$_MODULE['<{loyalty}prestashop>loyalty_a9be824aae4f2381a27b7c699b1e041e'] = 'In attesa di convalida'; +$_MODULE['<{loyalty}prestashop>loyalty_78945de8de090e90045d299651a68a9b'] = 'Disponibile'; +$_MODULE['<{loyalty}prestashop>loyalty_4cb08bf5ad3d3c7b010dde725a078b28'] = 'Già convertito'; +$_MODULE['<{loyalty}prestashop>loyalty_01371a1d58e9234c0b9dbc08cf54fa8b'] = 'Non disponibile sugli sconti'; +$_MODULE['<{loyalty}prestashop>loyalty_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Il mio account'; +$_MODULE['<{loyalty}prestashop>loyalty_c540093e64d84440025b2d8201f04336'] = 'I miei punti fedeltà'; +$_MODULE['<{loyalty}prestashop>loyalty_5acc2ceeb883ba07cef2d02ea382f242'] = 'Non ha effettuato ordini.'; +$_MODULE['<{loyalty}prestashop>loyalty_dd1f775e443ff3b9a89270713580a51b'] = 'Precedente'; +$_MODULE['<{loyalty}prestashop>loyalty_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Successivo'; +$_MODULE['<{loyalty}prestashop>loyalty_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; +$_MODULE['<{loyalty}prestashop>loyalty_6c583afb157e33bfb5b7c3d4114c4dd5'] = 'elementi:'; +$_MODULE['<{loyalty}prestashop>loyalty_c48105520852bbd0fa692e4c9fd61628'] = 'I buoni generati qui sono utilizzabili nelle seguenti categorie:'; +$_MODULE['<{loyalty}prestashop>loyalty_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutti'; +$_MODULE['<{loyalty}prestashop>loyalty_5b7d558a20e8bcb6d9355a012becb1eb'] = 'Sei sicuro di voler trasformare i tuoi punti in buoni?'; +$_MODULE['<{loyalty}prestashop>loyalty_4db04271e368fe3d4e1aa7332a18fa9d'] = 'Trasformare i miei punti in un buono di'; +$_MODULE['<{loyalty}prestashop>loyalty_b39cba8836db01a04888aef6ba386420'] = 'I miei buoni da punti fedeltà'; +$_MODULE['<{loyalty}prestashop>loyalty_0eceeb45861f9585dd7a97a3e36f85c6'] = 'Creato'; +$_MODULE['<{loyalty}prestashop>loyalty_689202409e48743b914713f96d93947c'] = 'Valore'; +$_MODULE['<{loyalty}prestashop>loyalty_ca0dbad92a874b2f69b549293387925e'] = 'Codice'; +$_MODULE['<{loyalty}prestashop>loyalty_eb902cf204f3e4dfffeb56d92a9b5c26'] = 'Valido dal'; +$_MODULE['<{loyalty}prestashop>loyalty_b2844b8e17ecaaeae68d018fe9418af0'] = 'Valido fino al'; +$_MODULE['<{loyalty}prestashop>loyalty_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{loyalty}prestashop>loyalty_3ec365dd533ddb7ef3d1c111186ce872'] = 'Dettagli'; +$_MODULE['<{loyalty}prestashop>loyalty_29aa46cc3d2677c7e0f216910df600ff'] = 'Spedizione gratuita'; +$_MODULE['<{loyalty}prestashop>loyalty_cec73b5ce095a59305ad92a0d47495cb'] = 'Per utilizzare'; +$_MODULE['<{loyalty}prestashop>loyalty_019d1ca7d50cc54b995f60d456435e87'] = 'Usato'; +$_MODULE['<{loyalty}prestashop>loyalty_2af3bf4c82c5b33875d532820a959799'] = 'Generato dai seguenti ordini '; +$_MODULE['<{loyalty}prestashop>loyalty_d1228f5476d15142b1358ae4b5fa2454'] = 'Ordine n.'; +$_MODULE['<{loyalty}prestashop>loyalty_d5797f3bbadc278f756576dafc6ab4b8'] = 'punti.'; +$_MODULE['<{loyalty}prestashop>loyalty_1f67ea7a0b26e9eacc70523bde28df0c'] = 'di più ...'; +$_MODULE['<{loyalty}prestashop>loyalty_a16cf3ec5200cc519f4fe48e34b1df83'] = 'L\'importo minimo di ordine al fine di utilizzare questi buoni è:'; +$_MODULE['<{loyalty}prestashop>loyalty_8e69341aca5dbf9f55c2e75a2ed5df3c'] = 'Ancora nessun buono.'; +$_MODULE['<{loyalty}prestashop>loyalty_00d56a5e37c19c59d521530fc8e7f337'] = 'Ancora nessuna ricompensa punti.'; +$_MODULE['<{loyalty}prestashop>loyalty_0b3db27bc15f682e92ff250ebb167d4b'] = 'Torna al tuo account'; +$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{loyalty}prestashop>my-account_c540093e64d84440025b2d8201f04336'] = 'I miei punti fedeltà'; +$_MODULE['<{loyalty}prestashop>product_ded9088edfbcc1041c3a642b031c8f72'] = 'Programma fedeltà'; +$_MODULE['<{loyalty}prestashop>product_08ef6b34ab8e7039ef0ee69378f0ac0b'] = 'Con l\'acquisto di questo prodotto è possibile raccogliere fino a'; +$_MODULE['<{loyalty}prestashop>product_2996152bb442bf98c80c515c6055de5f'] = 'Punti fedeltà'; +$_MODULE['<{loyalty}prestashop>product_b40d5c523ee75453134b1449dd9cd13a'] = 'Punto Fedeltà'; +$_MODULE['<{loyalty}prestashop>product_b9cb3a85529dd593c14c838e22976cff'] = 'Il totale del tuo carrello'; +$_MODULE['<{loyalty}prestashop>product_0aab81de5c4c87021772015efc184d67'] = 'punti'; +$_MODULE['<{loyalty}prestashop>product_78ee54aa8f813885fe2fe20d232518b9'] = 'punto'; +$_MODULE['<{loyalty}prestashop>product_443c3e03e194c2a4cdb107808b051615'] = 'che può essere convertito in un buono di'; +$_MODULE['<{loyalty}prestashop>product_054a9c66cc92b7f1bfcacee3b7c7ad54'] = 'Nessun punto fedeltà per questo prodotto, perché c\'è già uno sconto.'; +$_MODULE['<{loyalty}prestashop>product_e94d481804904a48c1a8093e7a069570'] = 'Nessun punto fedeltà per questo prodotto.'; +$_MODULE['<{loyalty}prestashop>shopping-cart_ea2c0ea1a08add3a75273e7f32f05f7a'] = 'fedeltà'; +$_MODULE['<{loyalty}prestashop>shopping-cart_4cd8259257033282f11cc9bbe648dff7'] = 'Con il check-out di questo carrello della spesa è possibile raccogliere fino a'; +$_MODULE['<{loyalty}prestashop>shopping-cart_2996152bb442bf98c80c515c6055de5f'] = 'punti fedeltà'; +$_MODULE['<{loyalty}prestashop>shopping-cart_b40d5c523ee75453134b1449dd9cd13a'] = 'punto fedeltà'; +$_MODULE['<{loyalty}prestashop>shopping-cart_443c3e03e194c2a4cdb107808b051615'] = 'che può essere convertito in un buono di'; +$_MODULE['<{loyalty}prestashop>shopping-cart_8cec799df06a3f5a026b31fcd95e0172'] = 'Aggiungi alcuni prodotti al carrello della spesa di raccogliere dei punti fedeltà.'; diff --git a/modules/loyalty/logo.gif b/modules/loyalty/logo.gif new file mode 100644 index 000000000..039f3fa77 Binary files /dev/null and b/modules/loyalty/logo.gif differ diff --git a/modules/loyalty/loyalty-program.php b/modules/loyalty/loyalty-program.php new file mode 100644 index 000000000..cb1d9f4e8 --- /dev/null +++ b/modules/loyalty/loyalty-program.php @@ -0,0 +1,169 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +include_once(dirname(__FILE__).'/LoyaltyModule.php'); +include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + +if (!$cookie->isLogged()) + Tools::redirect('authentication.php?back=modules/loyalty/loyalty-program.php'); + +Tools::addCSS(_PS_CSS_DIR_.'jquery.cluetip.css', 'all'); +Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.dimensions.js',_PS_JS_DIR_.'jquery/jquery.cluetip.js')); + +$customerPoints = (int)(LoyaltyModule::getPointsByCustomer((int)($cookie->id_customer))); + +/* transform point into voucher if needed */ +if (Tools::getValue('transform-points') == 'true' AND $customerPoints > 0) +{ + /* Generate a voucher code */ + $voucherCode = NULL; + do $voucherCode = 'FID'.rand(1000, 100000); + while (Discount::discountExists($voucherCode)); + + /* Voucher creation and affectation to the customer */ + $voucher = new Discount(); + $voucher->name = $voucherCode; + $voucher->id_discount_type = 2; // Discount on order (amount) + $voucher->id_customer = (int)($cookie->id_customer); + $voucher->id_currency = (int)($cookie->id_currency); + $voucher->value = LoyaltyModule::getVoucherValue((int)$customerPoints); + $voucher->quantity = 1; + $voucher->quantity_per_user = 1; + $voucher->cumulable = 1; + $voucher->cumulable_reduction = 1; + + /* If merchandise returns are allowed, the voucher musn't be usable before this max return date */ + $dateFrom = Db::getInstance()->getValue(' + SELECT UNIX_TIMESTAMP(date_add) n + FROM '._DB_PREFIX_.'loyalty + WHERE id_discount = 0 AND id_customer = '.(int)$cookie->id_customer.' + ORDER BY date_add DESC'); + + if (Configuration::get('PS_ORDER_RETURN')) + $dateFrom += 60 * 60 * 24 * (int)Configuration::get('PS_ORDER_RETURN_NB_DAYS'); + + $voucher->date_from = date('Y-m-d H:i:s', $dateFrom); + $voucher->date_to = date('Y-m-d H:i:s', $dateFrom + 31536000); // + 1 year + + $voucher->minimal = (float)Configuration::get('PS_LOYALTY_MINIMAL'); + $voucher->active = 1; + + $categories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'); + if ($categories != '' AND $categories != 0) + $categories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY')); + else + die(Tools::displayError()); + + $languages = Language::getLanguages(true); + $default_text = Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int)(Configuration::get('PS_LANG_DEFAULT'))); + + foreach ($languages AS $language) + { + $text = Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int)($language['id_lang'])); + $voucher->description[(int)($language['id_lang'])] = $text ? strval($text) : strval($default_text); + } + + if (is_array($categories) AND sizeof($categories)) + $voucher->add(true, false, $categories); + else + $voucher->add(); + + /* Register order(s) which contributed to create this voucher */ + LoyaltyModule::registerDiscount($voucher); + + Tools::redirect('modules/loyalty/loyalty-program.php'); +} + +include(dirname(__FILE__).'/../../header.php'); + +$orders = LoyaltyModule::getAllByIdCustomer((int)($cookie->id_customer), (int)($cookie->id_lang)); +$displayorders = LoyaltyModule::getAllByIdCustomer((int)($cookie->id_customer), (int)($cookie->id_lang), false, true, ((int)(Tools::getValue('n')) > 0 ? (int)(Tools::getValue('n')) : 10), ((int)(Tools::getValue('p')) > 0 ? (int)(Tools::getValue('p')) : 1)); +$smarty->assign(array( + 'orders' => $orders, + 'displayorders' => $displayorders, + 'pagination_link' => __PS_BASE_URI__.'modules/loyalty/loyalty-program.php', + 'totalPoints' => (int)$customerPoints, + 'voucher' => LoyaltyModule::getVoucherValue($customerPoints, (int)($cookie->id_currency)), + 'validation_id' => LoyaltyStateModule::getValidationId(), + 'transformation_allowed' => $customerPoints > 0, + 'page' => ((int)(Tools::getValue('p')) > 0 ? (int)(Tools::getValue('p')) : 1), + 'nbpagination' => ((int)(Tools::getValue('n') > 0) ? (int)(Tools::getValue('n')) : 10), + 'nArray' => array(10, 20, 50), + 'max_page' => floor(sizeof($orders) / ((int)(Tools::getValue('n') > 0) ? (int)(Tools::getValue('n')) : 10)) +)); + +/* Discounts */ +$nbDiscounts = 0; +$discounts = array(); +if ($ids_discount = LoyaltyModule::getDiscountByIdCustomer((int)($cookie->id_customer))) +{ + $nbDiscounts = count($ids_discount); + foreach ($ids_discount AS $key => $discount) + { + $discounts[$key] = new Discount((int)$discount['id_discount'], (int)($cookie->id_lang)); + $discounts[$key]->date_add = $discount['date_add']; + $discounts[$key]->orders = LoyaltyModule::getOrdersByIdDiscount((int)$discount['id_discount']); + } +} + +$allCategories = Category::getSimpleCategories((int)($cookie->id_lang)); +$voucherCategories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'); +if ($voucherCategories != '' AND $voucherCategories != 0) + $voucherCategories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY')); +else + die(Tools::displayError()); + +if (sizeof($voucherCategories) == sizeof($allCategories)) + $categoriesNames = null; +else +{ + $categoriesNames = ''; + foreach ($voucherCategories AS $voucherCategory) + foreach ($allCategories AS $allCategory) + if ($voucherCategory['id_category'] == $allCategory['id_category']) + { + $categoriesNames .= $allCategory['name'].', '; + break; + } + $categoriesNames = rtrim($categoriesNames, ', '); + $categoriesNames .= '.'; +} +$smarty->assign(array( + 'nbDiscounts' => (int)$nbDiscounts, + 'discounts' => $discounts, + 'minimalLoyalty' => (float)Configuration::get('PS_LOYALTY_MINIMAL'), + 'categories' => $categoriesNames)); + +echo Module::display(dirname(__FILE__).'/loyalty.php', 'loyalty.tpl'); + +include(dirname(__FILE__).'/../../footer.php'); \ No newline at end of file diff --git a/modules/loyalty/loyalty.gif b/modules/loyalty/loyalty.gif new file mode 100644 index 000000000..039f3fa77 Binary files /dev/null and b/modules/loyalty/loyalty.gif differ diff --git a/modules/loyalty/loyalty.php b/modules/loyalty/loyalty.php new file mode 100644 index 000000000..4ef01891b --- /dev/null +++ b/modules/loyalty/loyalty.php @@ -0,0 +1,673 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +/* +* TODO: +* +* - Bad behaviour when an order is cancelled after an order return +* - We shouldn't use $cookie->id_currency in all situations +*/ + +class Loyalty extends Module +{ + function __construct() + { + $this->name = 'loyalty'; + $this->tab = 'pricing_promotion'; + $this->version = '1.8'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Customer loyalty and rewards'); + $this->description = $this->l('Provide a loyalty program to your customers.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete all loyalty points and customer history?'); + } + + private function instanceDefaultStates() + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + + /* Recover default loyalty status save at module installation */ + $this->loyaltyStateDefault = new LoyaltyStateModule(LoyaltyStateModule::getDefaultId()); + $this->loyaltyStateValidation = new LoyaltyStateModule(LoyaltyStateModule::getValidationId()); + $this->loyaltyStateCancel = new LoyaltyStateModule(LoyaltyStateModule::getCancelId()); + $this->loyaltyStateConvert = new LoyaltyStateModule(LoyaltyStateModule::getConvertId()); + $this->loyaltyStateNoneAward = new LoyaltyStateModule(LoyaltyStateModule::getNoneAwardId()); + } + + function install() + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + + if (!parent::install() OR !$this->installDB() OR !$this->registerHook('extraRight') OR !$this->registerHook('updateOrderStatus') + OR !$this->registerHook('newOrder') OR !$this->registerHook('adminCustomers') OR !$this->registerHook('shoppingCart') + OR !$this->registerHook('orderReturn') OR !$this->registerHook('cancelProduct') OR !$this->registerHook('customerAccount') + OR !Configuration::updateValue('PS_LOYALTY_POINT_VALUE', '0.20') OR !Configuration::updateValue('PS_LOYALTY_MINIMAL', 0) + OR !Configuration::updateValue('PS_LOYALTY_POINT_RATE', '10') OR !Configuration::updateValue('PS_LOYALTY_NONE_AWARD', '1')) + return false; + + $defaultTranslations = array('en' => 'Loyalty reward', 'fr' => 'Récompense fidélité'); + $conf = array((int)Configuration::get('PS_LANG_DEFAULT') => $this->l('Loyalty reward')); + foreach (Language::getLanguages() AS $language) + if (isset($defaultTranslations[$language['iso_code']])) + $conf[(int)$language['id_lang']] = $defaultTranslations[$language['iso_code']]; + Configuration::updateValue('PS_LOYALTY_VOUCHER_DETAILS', $conf); + + $category_config = ''; + $categories = Category::getSimpleCategories((int)(Configuration::get('PS_LANG_DEFAULT'))); + foreach ($categories AS $category) + $category_config .= (int)$category['id_category'].','; + $category_config = rtrim($category_config, ','); + Configuration::updateValue('PS_LOYALTY_VOUCHER_CATEGORY', $category_config); + + /* This hook is optional */ + $this->registerHook('myAccountBlock'); + if (!LoyaltyStateModule::insertDefaultData()) + return false; + return true; + } + + function installDB() + { + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'loyalty` ( + `id_loyalty` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_loyalty_state` INT UNSIGNED NOT NULL DEFAULT 1, + `id_customer` INT UNSIGNED NOT NULL, + `id_order` INT UNSIGNED DEFAULT NULL, + `id_discount` INT UNSIGNED DEFAULT NULL, + `points` INT NOT NULL DEFAULT 0, + `date_add` DATETIME NOT NULL, + `date_upd` DATETIME NOT NULL, + PRIMARY KEY (`id_loyalty`), + INDEX index_loyalty_loyalty_state (`id_loyalty_state`), + INDEX index_loyalty_order (`id_order`), + INDEX index_loyalty_discount (`id_discount`), + INDEX index_loyalty_customer (`id_customer`) + ) DEFAULT CHARSET=utf8 ;'); + + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'loyalty_history` ( + `id_loyalty_history` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_loyalty` INT UNSIGNED DEFAULT NULL, + `id_loyalty_state` INT UNSIGNED NOT NULL DEFAULT 1, + `points` INT NOT NULL DEFAULT 0, + `date_add` DATETIME NOT NULL, + PRIMARY KEY (`id_loyalty_history`), + INDEX `index_loyalty_history_loyalty` (`id_loyalty`), + INDEX `index_loyalty_history_loyalty_state` (`id_loyalty_state`) + ) DEFAULT CHARSET=utf8 ;'); + + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'loyalty_state` ( + `id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_order_state` INT UNSIGNED DEFAULT NULL, + PRIMARY KEY (`id_loyalty_state`), + INDEX index_loyalty_state_order_state (`id_order_state`) + ) DEFAULT CHARSET=utf8 ;'); + + Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'loyalty_state_lang` ( + `id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_lang` INT UNSIGNED NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `index_unique_loyalty_state_lang` (`id_loyalty_state`,`id_lang`) + ) DEFAULT CHARSET=utf8 ;'); + + return true; + } + + function uninstall() + { + if (!parent::uninstall() OR !$this->uninstallDB() OR !Configuration::deleteByName('PS_LOYALTY_POINT_VALUE') OR !Configuration::deleteByName('PS_LOYALTY_POINT_RATE') + OR !Configuration::deleteByName('PS_LOYALTY_NONE_AWARD') OR !Configuration::deleteByName('PS_LOYALTY_MINIMAL') OR !Configuration::deleteByName('PS_LOYALTY_VOUCHER_CATEGORY') + OR !Configuration::deleteByName('PS_LOYALTY_VOUCHER_DETAILS')) + return false; + return true; + } + + function uninstallDB() + { + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty`;'); + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state`;'); + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state_lang`;'); + Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_history`;'); + + return true; + } + + private function _postProcess() + { + if (Tools::isSubmit('submitLoyalty')) + { + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(); + + $this->_errors = array(); + if (!is_array(Tools::getValue('categoryBox')) OR !sizeof(Tools::getValue('categoryBox'))) + $this->_errors[] = $this->l('You must choose at least one category for voucher\'s action'); + if (!sizeof($this->_errors)) + { + Configuration::updateValue('PS_LOYALTY_VOUCHER_CATEGORY', $this->voucherCategories(Tools::getValue('categoryBox'))); + Configuration::updateValue('PS_LOYALTY_POINT_VALUE', (float)(Tools::getValue('point_value'))); + Configuration::updateValue('PS_LOYALTY_POINT_RATE', (float)(Tools::getValue('point_rate'))); + Configuration::updateValue('PS_LOYALTY_NONE_AWARD', (int)(Tools::getValue('PS_LOYALTY_NONE_AWARD'))); + Configuration::updateValue('PS_LOYALTY_MINIMAL', (float)(Tools::getValue('minimal'))); + + $this->loyaltyStateValidation->id_order_state = (int)(Tools::getValue('id_order_state_validation')); + $this->loyaltyStateCancel->id_order_state = (int)(Tools::getValue('id_order_state_cancel')); + + $arrayVoucherDetails = array(); + foreach ($languages AS $language) + { + $arrayVoucherDetails[(int)($language['id_lang'])] = Tools::getValue('voucher_details_'.(int)($language['id_lang'])); + $this->loyaltyStateDefault->name[(int)($language['id_lang'])] = Tools::getValue('default_loyalty_state_'.(int)($language['id_lang'])); + $this->loyaltyStateValidation->name[(int)($language['id_lang'])] = Tools::getValue('validation_loyalty_state_'.(int)($language['id_lang'])); + $this->loyaltyStateCancel->name[(int)($language['id_lang'])] = Tools::getValue('cancel_loyalty_state_'.(int)($language['id_lang'])); + $this->loyaltyStateConvert->name[(int)($language['id_lang'])] = Tools::getValue('convert_loyalty_state_'.(int)($language['id_lang'])); + $this->loyaltyStateNoneAward->name[(int)($language['id_lang'])] = Tools::getValue('none_award_loyalty_state_'.(int)($language['id_lang'])); + } + if (empty($arrayVoucherDetails[$defaultLanguage])) + $arrayVoucherDetails[$defaultLanguage] = ' '; + Configuration::updateValue('PS_LOYALTY_VOUCHER_DETAILS', $arrayVoucherDetails); + + if (empty($this->loyaltyStateDefault->name[$defaultLanguage])) + $this->loyaltyStateDefault->name[$defaultLanguage] = ' '; + $this->loyaltyStateDefault->save(); + + if (empty($this->loyaltyStateValidation->name[$defaultLanguage])) + $this->loyaltyStateValidation->name[$defaultLanguage] = ' '; + $this->loyaltyStateValidation->save(); + + if (empty($this->loyaltyStateCancel->name[$defaultLanguage])) + $this->loyaltyStateCancel->name[$defaultLanguage] = ' '; + $this->loyaltyStateCancel->save(); + + if (empty($this->loyaltyStateConvert->name[$defaultLanguage])) + $this->loyaltyStateConvert->name[$defaultLanguage] = ' '; + $this->loyaltyStateConvert->save(); + + if (empty($this->loyaltyStateNoneAward->name[$defaultLanguage])) + $this->loyaltyStateNoneAward->name[$defaultLanguage] = ' '; + $this->loyaltyStateNoneAward->save(); + + echo $this->displayConfirmation($this->l('Settings updated.')); + } + else + { + $errors = ''; + foreach ($this->_errors AS $error) + $errors .= $error.'
        '; + echo $this->displayError($errors); + } + } + } + + private function voucherCategories($categories) + { + $cat = ''; + if ($categories) + foreach ($categories AS $category) + $cat .= $category.','; + return rtrim($cat, ','); + } + + public function getContent() + { + global $cookie; + + $this->instanceDefaultStates(); + $this->_postProcess(); + + $categories = Category::getCategories((int)($cookie->id_lang)); + $order_states = OrderState::getOrderStates($cookie->id_lang); + $currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + $languageIds = 'voucher_details¤default_loyalty_state¤none_award_loyalty_state¤convert_loyalty_state¤validation_loyalty_state¤cancel_loyalty_state'; + + $html = ' + +

        '.$this->l('Loyalty Program').'

        +
        +
        + '.$this->l('Settings').' + + +
        + '.$currency->sign.' + +
        + + '.$currency->sign.' + +
        +
        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'voucher_details', true); + $html .= '
        +
        + +
        + '.$currency->sign.' +
        +
        + +
        + + + + +
        +
        + +
        + +
        +
        + +
        + +
        +
        + '; + + $html .= ' + + + + + '; + $index = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY')); + $indexedCategories = isset($_POST['categoryBox']) ? $_POST['categoryBox'] : array(); + foreach ($indexedCategories AS $k => $row) + $index[] = (int)$row['id_category']; + + $html .= $this->recurseCategoryForInclude((int)(Tools::getValue($this->identifier)), $index, $categories, $categories[0][1], 1, NULL); + $html .= '
        '.$this->l('ID').''.$this->l('Name').'
        +

        '.$this->l('Mark the box(es) of categories in which loyalty vouchers are usable.').'

        +
        +

        '.$this->l('Loyalty points progression').'

        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'default_loyalty_state', true); + $html .= '
        +
        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'none_award_loyalty_state', true); + $html .= '
        +
        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'convert_loyalty_state', true); + $html .= '
        +
        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'validation_loyalty_state', true); + $html .= '
        +
        + +
        '; + foreach ($languages as $language) + $html .= ' +
        + +
        '; + $html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'cancel_loyalty_state', true); + $html .= '
        +
        + +
        +
        +
        '; + + return $html; + } + + public static function recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $has_suite = array()) + { + global $done; + static $irow; + $html = ''; + + if (!isset($done[$current['infos']['id_parent']])) + $done[$current['infos']['id_parent']] = 0; + $done[$current['infos']['id_parent']] += 1; + + $todo = sizeof($categories[$current['infos']['id_parent']]); + $doneC = $done[$current['infos']['id_parent']]; + + $level = $current['infos']['level_depth'] + 1; + + $html .= ' + + + + + + '.$id_category.' + + '; + for ($i = 2; $i < $level; $i++) + $html .= ''; + $html .= '   + + '; + + if ($level > 1) + $has_suite[] = ($todo == $doneC ? 0 : 1); + if (isset($categories[$id_category])) + foreach ($categories[$id_category] AS $key => $row) + if ($key != 'infos') + $html .= self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite); + return $html; + } + + /* Hook display on product detail */ + public function hookExtraRight($params) + { + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + global $smarty; + + $product = new Product((int)Tools::getValue('id_product')); + if (Validate::isLoadedObject($product)) + { + if (Validate::isLoadedObject($params['cart'])) + { + $pointsBefore = (int)(LoyaltyModule::getCartNbPoints($params['cart'])); + $pointsAfter = (int)(LoyaltyModule::getCartNbPoints($params['cart'], $product)); + $points = (int)($pointsAfter - $pointsBefore); + } + else + { + if (!(int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND Product::isDiscounted((int)$product->id)) + { + $points = 0; + $smarty->assign('no_pts_discounted', 1); + } + else + $points = (int)(LoyaltyModule::getNbPointsByPrice($product->getPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, (int)($product->getIdProductAttributeMostExpensive())))); + $pointsAfter = $points; + $pointsBefore = 0; + } + $smarty->assign(array( + 'points' => (int)($points), + 'total_points' => (int)($pointsAfter), + 'point_rate' => Configuration::get('PS_LOYALTY_POINT_RATE'), + 'point_value' => Configuration::get('PS_LOYALTY_POINT_VALUE'), + 'points_in_cart' => (int)$pointsBefore, + 'voucher' => LoyaltyModule::getVoucherValue((int)$pointsAfter))); + + return $this->display(__FILE__, 'product.tpl'); + } + + return false; + } + + /* Hook display on customer account page */ + public function hookCustomerAccount($params) + { + return $this->display(__FILE__, 'my-account.tpl'); + } + + public function hookMyAccountBlock($params) + { + return $this->hookCustomerAccount($params); + } + + /* Catch product returns and substract loyalty points */ + public function hookOrderReturn($params) + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + $totalPrice = 0; + $details = OrderReturn::getOrdersReturnDetail((int)($params['orderReturn']->id)); + foreach ($details AS $detail) + { + $price_wt = Db::getInstance()->getValue(' + SELECT product_price * (1 + (tax_rate / 100)) price + FROM '._DB_PREFIX_.'order_detail od + WHERE id_order_detail = '.(int)($detail['id_order_detail'])); + + $totalPrice += number_format($price_wt, 2, '.', '') * $detail['product_quantity']; + } + + $loyaltyNew = new LoyaltyModule(); + $loyaltyNew->points = (int)(-1 * LoyaltyModule::getNbPointsByPrice($totalPrice)); + $loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getCancelId(); + $loyaltyNew->id_order = (int)$params['orderReturn']->id_order; + $loyaltyNew->id_customer = (int)$params['orderReturn']->id_customer; + $loyaltyNew->save(); + } + + /* Hook display on shopping cart summary */ + public function hookShoppingCart($params) + { + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + global $smarty; + + if (Validate::isLoadedObject($params['cart'])) + { + $points = LoyaltyModule::getCartNbPoints($params['cart']); + $smarty->assign(array('points' => (int)$points, 'voucher' => LoyaltyModule::getVoucherValue((int)$points))); + } + + return $this->display(__FILE__, 'shopping-cart.tpl'); + } + + /* Hook called when a new order is created */ + public function hookNewOrder($params) + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + if (!Validate::isLoadedObject($params['customer']) OR !Validate::isLoadedObject($params['order'])) + die(Tools::displayError('Missing parameters')); + $loyalty = new LoyaltyModule(); + $loyalty->id_customer = (int)$params['customer']->id; + $loyalty->id_order = (int)$params['order']->id; + $loyalty->points = LoyaltyModule::getOrderNbPoints($params['order']); + if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND (int)($loyalty->points) == 0) + $loyalty->id_loyalty_state = LoyaltyStateModule::getNoneAwardId(); + else + $loyalty->id_loyalty_state = LoyaltyStateModule::getDefaultId(); + return $loyalty->save(); + } + + /* Hook called when an order change its status */ + public function hookUpdateOrderStatus($params) + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + if (!Validate::isLoadedObject($params['newOrderStatus'])) + die(Tools::displayError('Missing parameters')); + $newOrder = $params['newOrderStatus']; + $order = new Order((int)($params['id_order'])); + if ($order AND !Validate::isLoadedObject($order)) + die(Tools::displayError('Incorrect object Order.')); + $this->instanceDefaultStates(); + + if ($newOrder->id == $this->loyaltyStateValidation->id_order_state OR $newOrder->id == $this->loyaltyStateCancel->id_order_state) + { + if (!Validate::isLoadedObject($loyalty = new LoyaltyModule(LoyaltyModule::getByOrderId($order->id)))) + return false; + if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND $loyalty->id_loyalty_state == LoyaltyStateModule::getNoneAwardId()) + return true; + + if ($newOrder->id == $this->loyaltyStateValidation->id_order_state) + { + $loyalty->id_loyalty_state = LoyaltyStateModule::getValidationId(); + if ((int)($loyalty->points) < 0) + $loyalty->points = abs((int)($loyalty->points)); + } + elseif ($newOrder->id == $this->loyaltyStateCancel->id_order_state) + { + $loyalty->id_loyalty_state = LoyaltyStateModule::getCancelId(); + $loyalty->points = 0; + } + return $loyalty->save(); + } + return true; + } + + /* Hook display in tab AdminCustomers on BO */ + public function hookAdminCustomers($params) + { + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + + $customer = new Customer((int)$params['id_customer']); + if ($customer AND !Validate::isLoadedObject($customer)) + die(Tools::displayError('Incorrect object Customer.')); + + $details = LoyaltyModule::getAllByIdCustomer((int)$params['id_customer'], (int)$params['cookie']->id_lang); + $points = (int)LoyaltyModule::getPointsByCustomer((int)$params['id_customer']); + + $html = ' +

        '.$this->l('Loyalty points').' ('.(int)$points.' '.$this->l('points').')

        '; + + if (!$points) + return $html.' '.$this->l('This customer has no points'); + + $html .= ' + + + + + + + + '; + foreach ($details AS $key => $loyalty) + { + $html.= ' + + + + + + + '; + } + $html.= ' + + + + + + +
        '.$this->l('Order').''.$this->l('Date').''.$this->l('Total (without shipping)').''.$this->l('Points').''.$this->l('Points Status').'
        '.((int)$loyalty['id'] > 0 ? ''.$this->l('#').sprintf('%06d', $loyalty['id']).'' : '--').''.Tools::displayDate($loyalty['date'], (int)($params['cookie']->id_lang)).''.((int)$loyalty['id'] > 0 ? $loyalty['total_without_shipping'] : '--').''.(int)$loyalty['points'].''.$loyalty['state'].'
         '.$this->l('Total points available:').''.$points.''.$this->l('Voucher value:').' '.Tools::displayPrice(LoyaltyModule::getVoucherValue((int)$points, (int)Configuration::get('PS_CURRENCY_DEFAULT')), new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'))).'
        '; + + return $html; + } + + public function hookCancelProduct($params) + { + include_once(dirname(__FILE__).'/LoyaltyStateModule.php'); + include_once(dirname(__FILE__).'/LoyaltyModule.php'); + + if (!Validate::isLoadedObject($params['order']) OR !Validate::isLoadedObject($orderDetail = new OrderDetail((int)($params['id_order_detail']))) + OR !Validate::isLoadedObject($loyalty = new LoyaltyModule((int)(LoyaltyModule::getByOrderId((int)($params['order']->id)))))) + return false; + + $loyaltyNew = new LoyaltyModule(); + $loyaltyNew->points = -1 * LoyaltyModule::getNbPointsByPrice(number_format($orderDetail->product_price * (1 + $orderDetail->tax_rate / 100), 2, '.', '')) * $orderDetail->product_quantity; + $loyaltyNew->id_loyalty_state = (int)LoyaltyStateModule::getCancelId(); + $loyaltyNew->id_order = (int)$params['order']->id; + $loyaltyNew->id_customer = (int)$loyalty->id_customer; + $loyaltyNew->add(); + + return; + } + + public function getL($key) + { + $translations = array( + 'Awaiting validation' => $this->l('Awaiting validation'), + 'Available' => $this->l('Available'), + 'Cancelled' => $this->l('Cancelled'), + 'Already converted' => $this->l('Already converted'), + 'Unavailable on discounts' => $this->l('Unavailable on discounts'), + 'Not available on discounts.' => $this->l('Not available on discounts.')); + + return (array_key_exists($key, $translations)) ? $translations[$key] : $key; + } +} diff --git a/modules/loyalty/loyalty.tpl b/modules/loyalty/loyalty.tpl new file mode 100644 index 000000000..ce1b4dc82 --- /dev/null +++ b/modules/loyalty/loyalty.tpl @@ -0,0 +1,204 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account' mod='loyalty'}{$navigationPipe}{l s='My loyalty points' mod='loyalty'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='My loyalty points' mod='loyalty'}

        + +{if $orders} +
        + {if $orders && count($orders)} + + + + + + + + + + + + + + + + + + {foreach from=$displayorders item='order'} + + + + + + + {/foreach} + +
        {l s='Order' mod='loyalty'}{l s='Date' mod='loyalty'}{l s='Points' mod='loyalty'}{l s='Points Status' mod='loyalty'}
        {l s='Total points available:' mod='loyalty'}{$totalPoints|intval} 
        {dateFormat date=$order.date full=1}{$order.points|intval}{$order.state|escape:'htmlall':'UTF-8'}
        + + {else} +

        {l s='You have not placed any orders.'}

        + {/if} +
        + + +
        {l s='Vouchers generated here are usable in the following categories : ' mod='loyalty'} +{if $categories}{$categories}{else}{l s='All' mod='loyalty'}{/if} + +{if $transformation_allowed} +

        + {l s='Transform my points into a voucher of' mod='loyalty'} {convertPrice price=$voucher}. +

        +{/if} + +
        +

        {l s='My vouchers from loyalty points' mod='loyalty'}

        + +{if $nbDiscounts} +
        + + + + + + + + + + + + + + {foreach from=$discounts item=discount name=myLoop} + + + + + + + + + + {/foreach} + +
        {l s='Created' mod='loyalty'}{l s='Value' mod='loyalty'}{l s='Code' mod='loyalty'}{l s='Valid from' mod='loyalty'}{l s='Valid until' mod='loyalty'}{l s='Status' mod='loyalty'}{l s='Details' mod='loyalty'}
        {dateFormat date=$discount->date_add}{if $discount->id_discount_type == 1} + {$discount->value}% + {elseif $discount->id_discount_type == 2} + {displayPrice price=$discount->value currency=$discount->id_currency} + {else} + {l s='Free shipping' mod='loyalty'} + {/if}{$discount->name}{dateFormat date=$discount->date_from}{dateFormat date=$discount->date_to}{if $discount->quantity > 0}{l s='To use' mod='loyalty'}{else}{l s='Used' mod='loyalty'}{/if}{l s='more...' mod='loyalty'}
        + +
        + +{if $minimalLoyalty > 0}

        {l s='The minimum order amount in order to use these vouchers is:'} {convertPrice price=$minimalLoyalty}

        {/if} + + +{else} +

        {l s='No vouchers yet.' mod='loyalty'}

        +{/if} +{else} +

        {l s='No reward points yet.' mod='loyalty'}

        +{/if} + + diff --git a/modules/loyalty/my-account.tpl b/modules/loyalty/my-account.tpl new file mode 100644 index 000000000..1a9fbbd5e --- /dev/null +++ b/modules/loyalty/my-account.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
      • {l s='My loyalty points' mod='loyalty'}{l s='My loyalty points' mod='loyalty'}
      • + \ No newline at end of file diff --git a/modules/loyalty/product.tpl b/modules/loyalty/product.tpl new file mode 100644 index 000000000..f4b8107b8 --- /dev/null +++ b/modules/loyalty/product.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + {l s='Loyalty program' mod='loyalty'} + {if $points} + {l s='By buying this product you can collect up to' mod='loyalty'} {$points} + {if $points > 1}{l s='loyalty points' mod='loyalty'}{else}{l s='loyalty point' mod='loyalty'}{/if}. + {l s='Your cart will total' mod='loyalty'} {$total_points} + {if $total_points > 1}{l s='points' mod='loyalty'}{else}{l s='point' mod='loyalty'}{/if} {l s='that can be converted into a voucher of' mod='loyalty'} + {convertPrice price=$voucher}. + {else} + {if isset($no_pts_discounted) && $no_pts_discounted == 1} + {l s='No reward points for this product because there\'s already a discount.' mod='loyalty'} + {else} + {l s='No reward points for this product.' mod='loyalty'} + {/if} + {/if} +

        +
        \ No newline at end of file diff --git a/modules/loyalty/shopping-cart.tpl b/modules/loyalty/shopping-cart.tpl new file mode 100644 index 000000000..acbcebccd --- /dev/null +++ b/modules/loyalty/shopping-cart.tpl @@ -0,0 +1,31 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +

        + {l s='loyalty' mod='loyalty'}{if $points > 0}{l s='By checking out of this shopping cart you can collect up to' mod='loyalty'} {$points} {if $points > 1}{l s='loyalty points' mod='loyalty'}{else}{l s='loyalty point' mod='loyalty'}{/if} {l s='that can be converted into a voucher of' mod='loyalty'} {convertPrice price=$voucher}.{else}{l s='Add some products to your shopping cart to collect some loyalty points.' mod='loyalty'}{/if} +

        + \ No newline at end of file diff --git a/modules/mailalerts/config.xml b/modules/mailalerts/config.xml new file mode 100755 index 000000000..bec55fd6b --- /dev/null +++ b/modules/mailalerts/config.xml @@ -0,0 +1,12 @@ + + + mailalerts + Mail alerts + 2.2 + Sends e-mail notifications to customers and merchants. + PrestaShop + administration + Are you sure you want to delete all customer notifications? + 1 + 1 + \ No newline at end of file diff --git a/modules/mailalerts/de.php b/modules/mailalerts/de.php new file mode 100644 index 000000000..e0f6b201a --- /dev/null +++ b/modules/mailalerts/de.php @@ -0,0 +1,41 @@ +mailalerts_fd30254803e8db32521d3390131a44da'] = 'Mail-Benachrichtigungen'; +$_MODULE['<{mailalerts}prestashop>mailalerts_2d51f4a7ab8a12c4f35b507019523b8c'] = 'Sendet E-Mail-Benachrichtigungen an Kunden und Händler.'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8fd3b84964bd6dfec8095f658d200b29'] = 'Sind Sie sicher, dass alle Kundenmitteilungen löschen wollen?'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7cb9a154f101c674c945f88dad5c5e28'] = 'Keine Nachricht'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9137796c15dd92e5553c3f29574d0968'] = 'Gutschein-Code:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4c9120f1a5947445c0e9620254ceb30b'] = 'Neue Bestellung'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7a608706e248c21437882f5d1a8ece3a'] = 'Kundennachricht'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ea379dd90c33c1345f40aa0afa6688d8'] = 'Produktverfügbarkeit:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_86e8d61297942b00e9937299735df971'] = 'Gibt dem Kunden die Möglichkeit, eine Nachricht zu einem verfügbaren Produkt zu erhalten, wenn dieses vorher nicht auf Lager war'; +$_MODULE['<{mailalerts}prestashop>mailalerts_38fb7d24e0d60a048f540ecb18e13376'] = 'Speichern'; +$_MODULE['<{mailalerts}prestashop>mailalerts_d9b64868bb5b490c5c0627abe835acf6'] = 'Händlernachricht'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9204d21640382a89a95ec42f44f9051c'] = 'Neue Bestellung:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_fd5dc19a70d21e130f2e4ab5eb205e66'] = 'Eine Benachrichtigung erhalten, wenn eine neue Bestellung gemacht wird'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ebc3ccf8441dba3c1615afa6acb3282a'] = 'Nicht auf Lager:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c009546071b59092716ba006f307c6af'] = 'Eine Benachrichtigung erhalten, wenn die Menge eines Produkts unterhalb der der Alarmgrenze ist'; +$_MODULE['<{mailalerts}prestashop>mailalerts_af097c4096dc45754451f6f656dd1ee0'] = 'Alarmgrenze'; +$_MODULE['<{mailalerts}prestashop>mailalerts_65d0578157fd293e96f55f2d9228c07b'] = 'Menge, bei der ein Produkt als ausverkauft gilt'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4cf0e54bd20f173efae53b6b4d3d8d9a'] = 'An diese E-Mail-Adressen senden:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8c5b6fe38a32f46c355f025a820c804c'] = 'Eine E-Mail-Adresse pro Zeile'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f77ed609e48d550f0166dfbafc102710'] = 'z.B.,'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c1ee76f076a5b97e3b4b0c0e5703246e'] = 'Kann Einstellungen nicht aktualisieren'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ce241f25e003bafeb9fce6857d8f027f'] = 'Bitte geben Sie eine (oder mehrere) E-Mail Adressen ein'; +$_MODULE['<{mailalerts}prestashop>mailalerts_29aae9c646337554f4de7ae29050c39f'] = 'Ungültige E-Mail:'; +$_MODULE['<{mailalerts}prestashop>my-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Meine Benachrichtigungen'; +$_MODULE['<{mailalerts}prestashop>my-account_abca7cba75e5a9ff86b1490f32891f82'] = 'Benachrichtigungen'; +$_MODULE['<{mailalerts}prestashop>myalerts_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mein Konto'; +$_MODULE['<{mailalerts}prestashop>myalerts_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Meine Benachrichtigungen'; +$_MODULE['<{mailalerts}prestashop>myalerts_deb10517653c255364175796ace3553f'] = 'Produkt'; +$_MODULE['<{mailalerts}prestashop>myalerts_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{mailalerts}prestashop>myalerts_074c07016d3e5a9f011aa8e62abe4517'] = 'Sie haben keine Benachrichtigungen abonniert.'; +$_MODULE['<{mailalerts}prestashop>myalerts_0b3db27bc15f682e92ff250ebb167d4b'] = 'Zurück zu Ihrem Konto'; +$_MODULE['<{mailalerts}prestashop>myalerts_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Anfragenachricht registriert'; +$_MODULE['<{mailalerts}prestashop>product_900f8551b29793ecb604a545b2059cc1'] = 'Ihre E-Mail-Adresse ist ungültig'; +$_MODULE['<{mailalerts}prestashop>product_546e02eaa9a986c83cc347e273269f2c'] = 'Mich bei Verfügbarkeit benachrichtigen'; diff --git a/modules/mailalerts/en.php b/modules/mailalerts/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/mailalerts/en.php @@ -0,0 +1,4 @@ +mailalerts_fd30254803e8db32521d3390131a44da'] = 'Alertas por correo'; +$_MODULE['<{mailalerts}prestashop>mailalerts_2d51f4a7ab8a12c4f35b507019523b8c'] = 'Enviar correos de notificación a los clientes y comerciantes.'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8fd3b84964bd6dfec8095f658d200b29'] = '¿Está seguro de querer suprimir todas las notificaciones de los clientes?'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7cb9a154f101c674c945f88dad5c5e28'] = 'No hay mensaje'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9137796c15dd92e5553c3f29574d0968'] = 'Código del vale:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4c9120f1a5947445c0e9620254ceb30b'] = 'Nuevo pedido'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7a608706e248c21437882f5d1a8ece3a'] = 'Notificación al cliente'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ea379dd90c33c1345f40aa0afa6688d8'] = 'Disponibilidad del producto:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_86e8d61297942b00e9937299735df971'] = 'Da al cliente la posibilidad de recibir una notificación cuando un producto agotado se encuentra de nuevo disponible'; +$_MODULE['<{mailalerts}prestashop>mailalerts_38fb7d24e0d60a048f540ecb18e13376'] = 'Guardar'; +$_MODULE['<{mailalerts}prestashop>mailalerts_d9b64868bb5b490c5c0627abe835acf6'] = 'Notificación al comerciante'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9204d21640382a89a95ec42f44f9051c'] = 'Nuevo pedido:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_fd5dc19a70d21e130f2e4ab5eb205e66'] = 'Recibir una notificación si se recibe un nuevo pedido'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ebc3ccf8441dba3c1615afa6acb3282a'] = 'Fuera de stock'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c009546071b59092716ba006f307c6af'] = 'Recibir una notificación si la cantidad del producto se encuentra por debajo del umbral de alerta'; +$_MODULE['<{mailalerts}prestashop>mailalerts_af097c4096dc45754451f6f656dd1ee0'] = 'Umbral de alerta:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_65d0578157fd293e96f55f2d9228c07b'] = 'Cantidad a partir de la cual el producto se considera fuera de stock'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4cf0e54bd20f173efae53b6b4d3d8d9a'] = 'Enviar por email:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8c5b6fe38a32f46c355f025a820c804c'] = 'Una dirección email por línea'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f77ed609e48d550f0166dfbafc102710'] = 'ej:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c1ee76f076a5b97e3b4b0c0e5703246e'] = 'No se pueden actualizar los ajustes'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c888438d14855d7d96a2724ee9c306bd'] = 'Ajustes actualizados'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ce241f25e003bafeb9fce6857d8f027f'] = 'Por favor, una o máas direcciones email'; +$_MODULE['<{mailalerts}prestashop>mailalerts_29aae9c646337554f4de7ae29050c39f'] = 'Email no válido:'; +$_MODULE['<{mailalerts}prestashop>my-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mis alertas'; +$_MODULE['<{mailalerts}prestashop>my-account_abca7cba75e5a9ff86b1490f32891f82'] = 'alertas'; +$_MODULE['<{mailalerts}prestashop>myalerts_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta'; +$_MODULE['<{mailalerts}prestashop>myalerts_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mis alertas'; +$_MODULE['<{mailalerts}prestashop>myalerts_deb10517653c255364175796ace3553f'] = 'Producto'; +$_MODULE['<{mailalerts}prestashop>myalerts_f2a6c498fb90ee345d997f888fce3b18'] = 'Borrar'; +$_MODULE['<{mailalerts}prestashop>myalerts_074c07016d3e5a9f011aa8e62abe4517'] = 'No está inscrito a ninguna alerta.'; +$_MODULE['<{mailalerts}prestashop>myalerts_0b3db27bc15f682e92ff250ebb167d4b'] = 'Volver a mi cuenta'; +$_MODULE['<{mailalerts}prestashop>myalerts_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Notificación de la petición registrada'; +$_MODULE['<{mailalerts}prestashop>product_900f8551b29793ecb604a545b2059cc1'] = 'Su dirección de correo electrónico no es válida.'; +$_MODULE['<{mailalerts}prestashop>product_546e02eaa9a986c83cc347e273269f2c'] = 'Indicarme cuando esté disponible'; diff --git a/modules/mailalerts/fr.php b/modules/mailalerts/fr.php new file mode 100644 index 000000000..a2b60178d --- /dev/null +++ b/modules/mailalerts/fr.php @@ -0,0 +1,41 @@ +mailalerts_fd30254803e8db32521d3390131a44da'] = 'Alertes email'; +$_MODULE['<{mailalerts}prestashop>mailalerts_2d51f4a7ab8a12c4f35b507019523b8c'] = 'Envoit des notifications par e-mail aux clients et aux marchands.'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8fd3b84964bd6dfec8095f658d200b29'] = 'Etes-vous sûr de vouloir supprimer toutes les notifications clients ?'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7cb9a154f101c674c945f88dad5c5e28'] = 'Aucun message'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9137796c15dd92e5553c3f29574d0968'] = 'Code de réduction :'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4c9120f1a5947445c0e9620254ceb30b'] = 'Nouvelle commande'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7a608706e248c21437882f5d1a8ece3a'] = 'Notification client'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ea379dd90c33c1345f40aa0afa6688d8'] = 'Disponibilité du produit'; +$_MODULE['<{mailalerts}prestashop>mailalerts_86e8d61297942b00e9937299735df971'] = 'Donne au client la possibilité de recevoir une notification lorsqu\'un produit hors-stock est de nouveau disponible'; +$_MODULE['<{mailalerts}prestashop>mailalerts_38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; +$_MODULE['<{mailalerts}prestashop>mailalerts_d9b64868bb5b490c5c0627abe835acf6'] = 'Notification marchand'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9204d21640382a89a95ec42f44f9051c'] = 'Nouvelle commande : '; +$_MODULE['<{mailalerts}prestashop>mailalerts_fd5dc19a70d21e130f2e4ab5eb205e66'] = 'Recevoir une notification si une nouvelle commande est passée'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ebc3ccf8441dba3c1615afa6acb3282a'] = 'Hors stock : '; +$_MODULE['<{mailalerts}prestashop>mailalerts_c009546071b59092716ba006f307c6af'] = 'Recevoir une notification si la quantité du produit est en dessous du seuil d\'alerte'; +$_MODULE['<{mailalerts}prestashop>mailalerts_af097c4096dc45754451f6f656dd1ee0'] = 'Seuil d\'alerte:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_65d0578157fd293e96f55f2d9228c07b'] = 'Quantité pour laquelle le produit est considéré hors stock'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4cf0e54bd20f173efae53b6b4d3d8d9a'] = 'Envoyer aux adresses e-mail suivantes :'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8c5b6fe38a32f46c355f025a820c804c'] = 'Une adresse email par ligne'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f77ed609e48d550f0166dfbafc102710'] = 'ex :'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c1ee76f076a5b97e3b4b0c0e5703246e'] = 'Mise à jour des réglages impossible'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ce241f25e003bafeb9fce6857d8f027f'] = 'Merci d\'entrer une (ou plusieurs) addresse(s) email'; +$_MODULE['<{mailalerts}prestashop>mailalerts_29aae9c646337554f4de7ae29050c39f'] = 'E-mail invalide : '; +$_MODULE['<{mailalerts}prestashop>my-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mes alertes'; +$_MODULE['<{mailalerts}prestashop>my-account_abca7cba75e5a9ff86b1490f32891f82'] = 'alertes'; +$_MODULE['<{mailalerts}prestashop>myalerts_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte'; +$_MODULE['<{mailalerts}prestashop>myalerts_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mes alertes'; +$_MODULE['<{mailalerts}prestashop>myalerts_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{mailalerts}prestashop>myalerts_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{mailalerts}prestashop>myalerts_074c07016d3e5a9f011aa8e62abe4517'] = 'Vous n\'avez souscrit à aucune alerte.'; +$_MODULE['<{mailalerts}prestashop>myalerts_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte'; +$_MODULE['<{mailalerts}prestashop>myalerts_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Demande de notification enregistrée'; +$_MODULE['<{mailalerts}prestashop>product_900f8551b29793ecb604a545b2059cc1'] = 'Votre adresse e-mail est invalide'; +$_MODULE['<{mailalerts}prestashop>product_546e02eaa9a986c83cc347e273269f2c'] = 'Prévenez-moi lorsque le produit est disponible'; diff --git a/modules/mailalerts/img/delete.gif b/modules/mailalerts/img/delete.gif new file mode 100644 index 000000000..da95ba165 Binary files /dev/null and b/modules/mailalerts/img/delete.gif differ diff --git a/modules/mailalerts/it.php b/modules/mailalerts/it.php new file mode 100644 index 000000000..9f2ab5a5e --- /dev/null +++ b/modules/mailalerts/it.php @@ -0,0 +1,41 @@ +mailalerts_fd30254803e8db32521d3390131a44da'] = 'Mail di notifica'; +$_MODULE['<{mailalerts}prestashop>mailalerts_2d51f4a7ab8a12c4f35b507019523b8c'] = 'Invia notifiche via e-mail a clienti e commercianti.'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8fd3b84964bd6dfec8095f658d200b29'] = 'Sei sicuro di voler eliminare tutte le notifiche ai clienti?'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7cb9a154f101c674c945f88dad5c5e28'] = 'Nessun messaggio'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9137796c15dd92e5553c3f29574d0968'] = 'Codice del buono:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4c9120f1a5947445c0e9620254ceb30b'] = 'Nuovo ordine'; +$_MODULE['<{mailalerts}prestashop>mailalerts_7a608706e248c21437882f5d1a8ece3a'] = 'Notifica cliente'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ea379dd90c33c1345f40aa0afa6688d8'] = 'Disponibilità prodotto:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_86e8d61297942b00e9937299735df971'] = 'Offre al cliente la possibilità di ricevere una notifica per un prodotto disponibile se questo è fuori stock'; +$_MODULE['<{mailalerts}prestashop>mailalerts_38fb7d24e0d60a048f540ecb18e13376'] = 'Salva'; +$_MODULE['<{mailalerts}prestashop>mailalerts_d9b64868bb5b490c5c0627abe835acf6'] = 'Notifica commerciante'; +$_MODULE['<{mailalerts}prestashop>mailalerts_9204d21640382a89a95ec42f44f9051c'] = 'Nuovo ordine:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_fd5dc19a70d21e130f2e4ab5eb205e66'] = 'Ricevere una notifica se viene fatto un nuovo ordine '; +$_MODULE['<{mailalerts}prestashop>mailalerts_ebc3ccf8441dba3c1615afa6acb3282a'] = 'Esaurito:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c009546071b59092716ba006f307c6af'] = 'Ricevere una notifica se la quantità di un prodotto è al di sotto della soglia di allarme'; +$_MODULE['<{mailalerts}prestashop>mailalerts_af097c4096dc45754451f6f656dd1ee0'] = 'Soglia di allarme:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_65d0578157fd293e96f55f2d9228c07b'] = 'Quantità per la quale un prodotto è considerato esaurito'; +$_MODULE['<{mailalerts}prestashop>mailalerts_4cf0e54bd20f173efae53b6b4d3d8d9a'] = 'Invia a questi indirizzi e-mail:'; +$_MODULE['<{mailalerts}prestashop>mailalerts_8c5b6fe38a32f46c355f025a820c804c'] = 'Un indirizzo e-mail per riga'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f77ed609e48d550f0166dfbafc102710'] = 'ad esempio,'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c1ee76f076a5b97e3b4b0c0e5703246e'] = 'Impossibile aggiornare le impostazioni'; +$_MODULE['<{mailalerts}prestashop>mailalerts_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{mailalerts}prestashop>mailalerts_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{mailalerts}prestashop>mailalerts_ce241f25e003bafeb9fce6857d8f027f'] = 'Si prega di digitare uno (o più) indirizzo e-mail'; +$_MODULE['<{mailalerts}prestashop>mailalerts_29aae9c646337554f4de7ae29050c39f'] = 'e-mail non valida:'; +$_MODULE['<{mailalerts}prestashop>my-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'I miei avvisi'; +$_MODULE['<{mailalerts}prestashop>my-account_abca7cba75e5a9ff86b1490f32891f82'] = 'avvisi'; +$_MODULE['<{mailalerts}prestashop>myalerts_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Il mio account'; +$_MODULE['<{mailalerts}prestashop>myalerts_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'I miei avvisi'; +$_MODULE['<{mailalerts}prestashop>myalerts_deb10517653c255364175796ace3553f'] = 'Prodotto'; +$_MODULE['<{mailalerts}prestashop>myalerts_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{mailalerts}prestashop>myalerts_074c07016d3e5a9f011aa8e62abe4517'] = 'Non sei iscritto ad alcuna notifica.'; +$_MODULE['<{mailalerts}prestashop>myalerts_0b3db27bc15f682e92ff250ebb167d4b'] = 'Torna al tuo account'; +$_MODULE['<{mailalerts}prestashop>myalerts_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Richiesta di notifica registrata'; +$_MODULE['<{mailalerts}prestashop>product_900f8551b29793ecb604a545b2059cc1'] = 'Il tuo indirizzo e-mail non è valido'; +$_MODULE['<{mailalerts}prestashop>product_546e02eaa9a986c83cc347e273269f2c'] = 'Avvisami quando disponibile'; diff --git a/modules/mailalerts/logo.gif b/modules/mailalerts/logo.gif new file mode 100644 index 000000000..8bdd3304d Binary files /dev/null and b/modules/mailalerts/logo.gif differ diff --git a/modules/mailalerts/mailalerts-ajax_add.php b/modules/mailalerts/mailalerts-ajax_add.php new file mode 100644 index 000000000..4531f53e4 --- /dev/null +++ b/modules/mailalerts/mailalerts-ajax_add.php @@ -0,0 +1,67 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +if (!$id_product = (int)(Tools::getValue('id_product'))) + die ('0'); +$id_product_attribute = (int)(Tools::getValue('id_product_attribute')); + +if (!$cookie->isLogged()) +{ + $customer_email = trim(Tools::getValue('customer_email')); + if (empty($customer_email) OR !Validate::isEmail($customer_email)) + die ('0'); + if ($customer_email == 'your@email.com') + die ('0'); + + $id_customer = (int)Db::getInstance()->getValue('SELECT id_customer FROM '._DB_PREFIX_.'customer WHERE email=\''.pSQL($customer_email).'\' AND is_guest=0'); + // Check if already in DB + if (Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_customer` = '.(int)($id_customer).' + AND `customer_email` = \''.pSQL($customer_email).'\' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute))) + die('1'); +} +else +{ + $id_customer = (int)($cookie->id_customer); + $customer_email = 0; +} + +if (Db::getInstance()->Execute(' + REPLACE INTO `'._DB_PREFIX_.'mailalert_customer_oos` (`id_customer`, `customer_email`, `id_product` , `id_product_attribute`) + VALUES ('.(int)($id_customer).', \''.pSQL($customer_email).'\', '.(int)($id_product).', '.(int)($id_product_attribute).')')) + die ('1'); + +die ('0'); + + diff --git a/modules/mailalerts/mailalerts-ajax_check.php b/modules/mailalerts/mailalerts-ajax_check.php new file mode 100644 index 000000000..8a948d75a --- /dev/null +++ b/modules/mailalerts/mailalerts-ajax_check.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php'); + +if (!$cookie->isLogged()) + die('0'); + +$id_customer = (int)($cookie->id_customer); +if (!$id_product = (int)(Tools::getValue('id_product'))) + die ('0'); +$id_product_attribute = (int)(Tools::getValue('id_product_attribute')); + +$mA = new MailAlerts(); +if ($mA->customerHasNotification((int)($id_customer), (int)($id_product), (int)($id_product_attribute))) + die ('1'); +die('0'); + diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php new file mode 100644 index 000000000..ad0b74d97 --- /dev/null +++ b/modules/mailalerts/mailalerts.php @@ -0,0 +1,540 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class MailAlerts extends Module +{ + private $_html = ''; + private $_postErrors = array(); + + private $_merchant_mails; + private $_merchant_order; + private $_merchant_oos; + private $_customer_qty; + + const __MA_MAIL_DELIMITOR__ = ','; + + public function __construct() + { + $this->name = 'mailalerts'; + $this->tab = 'administration'; + $this->version = '2.2'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + if ($this->id) + $this->_refreshProperties(); + + $this->displayName = $this->l('Mail alerts'); + $this->description = $this->l('Sends e-mail notifications to customers and merchants.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete all customer notifications?'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('newOrder') OR + !$this->registerHook('updateQuantity') OR + !$this->registerHook('productOutOfStock') OR + !$this->registerHook('customerAccount') OR + !$this->registerHook('updateProduct') OR + !$this->registerHook('deleteProduct') OR + !$this->registerHook('deleteProductAttribute') OR + !$this->registerHook('updateProductAttribute') + ) + return false; + + Configuration::updateValue('MA_MERCHANT_ORDER', 1); + Configuration::updateValue('MA_MERCHANT_OOS', 1); + Configuration::updateValue('MA_CUSTOMER_QTY', 1); + Configuration::updateValue('MA_MERCHANT_MAILS', Configuration::get('PS_SHOP_EMAIL')); + Configuration::updateValue('MA_LAST_QTIES', Configuration::get('PS_LAST_QTIES')); + + if (!Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mailalert_customer_oos` ( + `id_customer` int(10) unsigned NOT NULL, + `customer_email` varchar(128) NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_customer`,`customer_email`,`id_product`,`id_product_attribute`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci') + ) + return false; + + /* This hook is optional */ + $this->registerHook('myAccountBlock'); + return true; + } + + public function uninstall() + { + Configuration::deleteByName('MA_MERCHANT_ORDER'); + Configuration::deleteByName('MA_MERCHANT_OOS'); + Configuration::deleteByName('MA_CUSTOMER_QTY'); + Configuration::deleteByName('MA_MERCHANT_MAILS'); + Configuration::deleteByName('MA_LAST_QTIES'); + if (!Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'mailalert_customer_oos')) + return false; + return parent::uninstall(); + } + + private function _refreshProperties() + { + $this->_merchant_mails = Configuration::get('MA_MERCHANT_MAILS'); + $this->_merchant_order = (int)Configuration::get('MA_MERCHANT_ORDER'); + $this->_merchant_oos = (int)Configuration::get('MA_MERCHANT_OOS'); + $this->_customer_qty = (int)Configuration::get('MA_CUSTOMER_QTY'); + } + + public function hookNewOrder($params) + { + if (!$this->_merchant_order OR empty($this->_merchant_mails)) + return; + + // Getting differents vars + $id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); + $currency = $params['currency']; + $configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME')); + $order = $params['order']; + $customer = $params['customer']; + $delivery = new Address((int)($order->id_address_delivery)); + $invoice = new Address((int)($order->id_address_invoice)); + $order_date_text = Tools::displayDate($order->date_add, (int)($id_lang)); + $carrier = new Carrier((int)($order->id_carrier)); + $message = $order->getFirstMessage(); + if (!$message OR empty($message)) + $message = $this->l('No message'); + + $itemsTable = ''; + foreach ($params['order']->getProducts() AS $key => $product) + { + $unit_price = $product['product_price_wt']; + $price = $product['total_price']; + $itemsTable .= + ' + '.$product['product_reference'].' + '.$product['product_name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').' + '.Tools::displayPrice($unit_price, $currency, false, false).' + '.(int)($product['product_quantity']).' + '.Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false, false).' + '; + } + foreach ($params['order']->getDiscounts() AS $discount) + { + $itemsTable .= + ' + '.$this->l('Voucher code:').' '.$discount['name'].' + -'.Tools::displayPrice($discount['value'], $currency, false, false).' + '; + } + if ($delivery->id_state) + $delivery_state = new State((int)($delivery->id_state)); + if ($invoice->id_state) + $invoice_state = new State((int)($invoice->id_state)); + + // Filling-in vars for email + $template = 'new_order'; + $subject = $this->l('New order'); + $templateVars = array( + '{firstname}' => $customer->firstname, + '{lastname}' => $customer->lastname, + '{email}' => $customer->email, + '{delivery_company}' => $delivery->company, + '{delivery_firstname}' => $delivery->firstname, + '{delivery_lastname}' => $delivery->lastname, + '{delivery_address1}' => $delivery->address1, + '{delivery_address2}' => $delivery->address2, + '{delivery_city}' => $delivery->city, + '{delivery_postal_code}' => $delivery->postcode, + '{delivery_country}' => $delivery->country, + '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '', + '{delivery_phone}' => $delivery->phone, + '{delivery_other}' => $delivery->other, + '{invoice_company}' => $invoice->company, + '{invoice_firstname}' => $invoice->firstname, + '{invoice_lastname}' => $invoice->lastname, + '{invoice_address2}' => $invoice->address2, + '{invoice_address1}' => $invoice->address1, + '{invoice_city}' => $invoice->city, + '{invoice_postal_code}' => $invoice->postcode, + '{invoice_country}' => $invoice->country, + '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', + '{invoice_phone}' => $invoice->phone, + '{invoice_other}' => $invoice->other, + '{order_name}' => sprintf("%06d", $order->id), + '{shop_name}' => Configuration::get('PS_SHOP_NAME'), + '{date}' => $order_date_text, + '{carrier}' => (($carrier->name == '0') ? Configuration::get('PS_SHOP_NAME') : $carrier->name), + '{payment}' => $order->payment, + '{items}' => $itemsTable, + '{total_paid}' => Tools::displayPrice($order->total_paid, $currency), + '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), + '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), + '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), + '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), + '{currency}' => $currency->sign, + '{message}' => $message + ); + $iso = Language::getIsoById((int)($id_lang)); + if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html')) + Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__).'/mails/'); + } + + public function hookProductOutOfStock($params) + { + global $smarty, $cookie; + + if (!$this->_customer_qty) + return ; + + $id_product = (int)($params['product']->id); + $id_product_attribute = 0; + + if (!$cookie->isLogged()) + $smarty->assign('email', 1); + else + { + $id_customer = (int)($params['cookie']->id_customer); + if ($this->customerHasNotification($id_customer, $id_product, $id_product_attribute)) + return ; + } + + $smarty->assign(array( + 'id_product' => $id_product, + 'id_product_attribute' => $id_product_attribute)); + + return $this->display(__FILE__, 'product.tpl'); + } + + public function customerHasNotification($id_customer, $id_product, $id_product_attribute) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_customer` = '.(int)($id_customer).' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute)); + return sizeof($result); + } + + public function hookUpdateQuantity($params) + { + global $cookie; + + if (is_object($params['product'])) + $params['product'] = get_object_vars($params['product']); + + if (isset($params['product']['id_product'])) + $params['product']['id'] = (int)$params['product']['id_product']; + + $qty = (int)$params['product']['stock_quantity']; + if ($qty <= (int)(Configuration::get('MA_LAST_QTIES')) AND !(!$this->_merchant_oos OR empty($this->_merchant_mails)) AND Configuration::get('PS_STOCK_MANAGEMENT')) + { + $templateVars = array( + '{qty}' => $qty, + '{last_qty}' => (int)(Configuration::get('MA_LAST_QTIES')), + '{product}' => strval($params['product']['name']).(isset($params['product']['attributes_small']) ? ' '.$params['product']['attributes_small'] : '')); + $id_lang = (is_object($cookie) AND isset($cookie->id_lang)) ? (int)$cookie->id_lang : (int)Configuration::get('PS_LANG_DEFAULT'); + $iso = Language::getIsoById((int)$id_lang); + if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.html')) + Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'productoutofstock', Mail::l('Product out of stock'), $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + } + + if ($this->_customer_qty AND $params['product']['quantity'] > 0) + $this->sendCustomerAlert((int)$params['product']['id_product'], 0); + } + + public function hookUpdateProduct($params) + { + /* We specify 0 as an id_product_attribute because this hook is called when the main product is updated */ + if ($this->_customer_qty AND $params['product']->quantity > 0) + $this->sendCustomerAlert((int)$params['product']->id, 0); + } + + public function hookUpdateProductAttribute($params) + { + $result = Db::getInstance()->getRow(' + SELECT `id_product`, `quantity` + FROM `'._DB_PREFIX_.'product_attribute` + WHERE `id_product_attribute` = '.(int)$params['id_product_attribute']); + + if ($this->_customer_qty AND $result['quantity'] > 0) + $this->sendCustomerAlert((int)$result['id_product'], (int)$params['id_product_attribute']); + } + + public function sendCustomerAlert($id_product, $id_product_attribute) + { + global $cookie, $link; + + $link = new Link(); + + $customers = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT id_customer, customer_email + FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_product` = '.(int)$id_product.' AND `id_product_attribute` = '.(int)$id_product_attribute); + + $product = new Product((int)$id_product, false, (int)$cookie->id_lang); + $templateVars = array( + '{product}' => (is_array($product->name) ? $product->name[(int)Configuration::get('PS_LANG_DEFAULT')] : $product->name), + '{product_link}' => $link->getProductLink($product) + ); + foreach ($customers AS $cust) + { + if ($cust['id_customer']) + { + $customer = new Customer((int)$cust['id_customer']); + $customer_email = $customer->email; + $customer_id = (int)$customer->id; + } + else + { + $customer_email = $cust['customer_email']; + $customer_id = 0; + } + $id_lang = (is_object($cookie) AND isset($cookie->id_lang)) ? (int)$cookie->id_lang : (int)Configuration::get('PS_LANG_DEFAULT'); + $iso = Language::getIsoById((int)$id_lang); + + if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html')) + Mail::Send((int)(Configuration::get('PS_LANG_DEFAULT')), 'customer_qty', Mail::l('Product available'), $templateVars, strval($customer_email), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + if ($customer_id) + $customer_email = 0; + self::deleteAlert((int)$customer_id, strval($customer_email), (int)$id_product, (int)$id_product_attribute); + } + } + + public function hookCustomerAccount($params) + { + return $this->_customer_qty ? $this->display(__FILE__, 'my-account.tpl') : NULL; + } + + public function hookMyAccountBlock($params) + { + return $this->hookCustomerAccount($params); + } + + public function getContent() + { + $this->_html = '

        '.$this->displayName.'

        '; + $this->_postProcess(); + $this->_displayForm(); + return $this->_html; + } + + private function _displayForm() + { + global $currentIndex; + + $tab = Tools::getValue('tab'); + $token = Tools::getValue('token'); + + $this->_html .= ' +
        +
        '.$this->l('Customer notification').' + +
        + _customer_qty) == 1 ? 'checked' : '').'> +   +
        +
        + +
        +
        +
        +
        +
        +
        '.$this->l('Merchant notification').' + +
        + _merchant_order) == 1 ? 'checked' : '').'> +   +
        + +
        + _merchant_oos) == 1 ? 'checked' : '').'> +   +
        + +
        + +

        '.$this->l('Quantity for which a product is regarded as out of stock').'

        +
        + +
        +
        + +
        +
        + '.$this->l('One e-mail address per line').'
        + '.$this->l('e.g.,').' bob@example.com +
        +
        +
         
        +
        + +
        +
        +
        '; + } + + private function _postProcess() + { + if (Tools::isSubmit('submitMACustomer')) + { + if (!Configuration::updateValue('MA_CUSTOMER_QTY', (int)(Tools::getValue('mA_customer_qty')))) + $this->_html .= '
        '.$this->l('Cannot update settings').'
        '; + else + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + elseif (Tools::isSubmit('submitMAMerchant')) + { + $emails = strval(Tools::getValue('ma_merchant_mails')); + if (!$emails OR empty($emails)) + $this->_html .= '
        '.$this->l('Please type one (or more) e-mail address').'
        '; + else + { + $emails = explode("\n", $emails); + foreach ($emails AS $k => $email) + { + $email = trim($email); + if (!empty($email) AND !Validate::isEmail($email)) + return ($this->_html .= '
        '.$this->l('Invalid e-mail:').' '.$email.'
        '); + if (!empty($email) AND sizeof($email)) + $emails[$k] = $email; + else + unset($emails[$k]); + } + $emails = implode(self::__MA_MAIL_DELIMITOR__, $emails); + if (!Configuration::updateValue('MA_MERCHANT_MAILS', strval($emails))) + $this->_html .= '
        '.$this->l('Cannot update settings').'
        '; + elseif (!Configuration::updateValue('MA_MERCHANT_ORDER', (int)(Tools::getValue('mA_merchand_order')))) + $this->_html .= '
        '.$this->l('Cannot update settings').'
        '; + elseif (!Configuration::updateValue('MA_MERCHANT_OOS', (int)(Tools::getValue('mA_merchand_oos')))) + $this->_html .= '
        '.$this->l('Cannot update settings').'
        '; + elseif (!Configuration::updateValue('MA_LAST_QTIES', (int)(Tools::getValue('MA_LAST_QTIES')))) + $this->_html .= '
        '.$this->l('Cannot update settings').'
        '; + else + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + $this->_refreshProperties(); + } + + static public function getProductsAlerts($id_customer, $id_lang) + { + if (!Validate::isUnsignedId($id_customer) OR + !Validate::isUnsignedId($id_lang) + ) + die (Tools::displayError()); + + $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute` + FROM `'._DB_PREFIX_.'mailalert_customer_oos` ma + JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ma.`id_product` + JOIN `'._DB_PREFIX_.'product_lang` pl ON pl.`id_product` = ma.`id_product` + WHERE ma.`id_customer` = '.(int)($id_customer).' + AND pl.`id_lang` = '.(int)($id_lang)); + if (empty($products) === true OR !sizeof($products)) + return array(); + for ($i = 0; $i < sizeof($products); ++$i) + { + $obj = new Product((int)($products[$i]['id_product']), false, (int)($id_lang)); + if (!Validate::isLoadedObject($obj)) + continue; + + if (isset($products[$i]['id_product_attribute']) AND + Validate::isUnsignedInt($products[$i]['id_product_attribute'])) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT al.`name` AS attribute_name + FROM `'._DB_PREFIX_.'product_attribute_combination` pac + LEFT JOIN `'._DB_PREFIX_.'attribute` a ON (a.`id_attribute` = pac.`id_attribute`) + LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON (ag.`id_attribute_group` = a.`id_attribute_group`) + LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pac.`id_product_attribute` = pa.`id_product_attribute`) + WHERE pac.`id_product_attribute` = '.(int)($products[$i]['id_product_attribute'])); + $products[$i]['attributes_small'] = ''; + if ($result) + foreach ($result AS $k => $row) + $products[$i]['attributes_small'] .= $row['attribute_name'].', '; + $products[$i]['attributes_small'] = rtrim($products[$i]['attributes_small'], ', '); + + // cover + $attrgrps = $obj->getAttributesGroups((int)($id_lang)); + foreach ($attrgrps AS $attrgrp) + if ($attrgrp['id_product_attribute'] == (int)($products[$i]['id_product_attribute']) AND $images = Product::_getAttributeImageAssociations((int)($attrgrp['id_product_attribute']))) + { + $products[$i]['cover'] = $obj->id.'-'.array_pop($images); + break; + } + } + if (!isset($products[$i]['cover']) OR !$products[$i]['cover']) + { + $images = $obj->getImages((int)($id_lang)); + foreach ($images AS $k => $image) + if ($image['cover']) + { + $products[$i]['cover'] = $obj->id.'-'.$image['id_image']; + break; + } + } + if (!isset($products[$i]['cover'])) + $products[$i]['cover'] = Language::getIsoById($id_lang).'-default'; + $products[$i]['link'] = $obj->getLink(); + } + return ($products); + } + + static public function deleteAlert($id_customer, $customer_email, $id_product, $id_product_attribute) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_customer` = '.(int)($id_customer).' + AND `customer_email` = \''.pSQL($customer_email).'\' + AND `id_product` = '.(int)($id_product).' + AND `id_product_attribute` = '.(int)($id_product_attribute)); + } + + public function hookDeleteProduct($params) + { + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'mailalert_customer_oos` WHERE `id_product` = '.(int)$params['product']->id); + } + + public function hookDeleteProductAttribute($params) + { + if ($params['deleteAllAttributes']) + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_product` = '.(int)$params['id_product']); + else + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'mailalert_customer_oos` + WHERE `id_product_attribute` = '.(int)$params['id_product_attribute'].' + AND `id_product` = '.(int)$params['id_product']); + } +} \ No newline at end of file diff --git a/modules/mailalerts/mails/de/customer_qty.html b/modules/mailalerts/mails/de/customer_qty.html new file mode 100644 index 000000000..0f91be672 --- /dev/null +++ b/modules/mailalerts/mails/de/customer_qty.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Produkt verfügbar + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        {product}ist nun verfügbar.
         
        Der Artikel ist nun wieder auf Lager.

        Gehen Sie auf die Produktseite, indem Sie auf diesen Link klicken: {product}

        Sie können ihn gleich in Ihrem Online-Shop bestellen.
         
        {shop_name} untestützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/de/customer_qty.txt b/modules/mailalerts/mails/de/customer_qty.txt new file mode 100644 index 000000000..b3887d79e --- /dev/null +++ b/modules/mailalerts/mails/de/customer_qty.txt @@ -0,0 +1,10 @@ +Hallo, + +Das Produkt {product} ist nun verfügbar. +Der Artikel ist nun wieder auf Lager. + +Gehen Sie auf die Produktseite, indem Sie auf diesen Link klicken: {product} + +Sie können ihn gleich in Ihrem Online-Shop bestellen. + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/de/new_order.html b/modules/mailalerts/mails/de/new_order.html new file mode 100644 index 000000000..4857aa87e --- /dev/null +++ b/modules/mailalerts/mails/de/new_order.html @@ -0,0 +1,116 @@ + + + + + [{shop_name}] Neue Bestellung + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Sie haben eine neue Bestellung erhalten von {firstname} {lastname}.
         
        Einzelheiten zur Bestellung
         
        Bestellung: {order_name} ausgeführt am {date}
        Zahlung: {payment}
         
        {items} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        ReferenzProduktStückpreisMengeGesamtpreis
        Produkte{total_products}
        Ermäßigungen{total_discounts}
        Geschenkverpackung{total_wrapping}
        Versand{total_shipping}
        Gesamt bezahlt{total_paid}
        +
         
        Versand
         
        Lieferer: {carrier}
         
        + + + + + + + + + + +
        LIEFERadressERECHNUNGSadressE
        {delivery_company}
        {delivery_firstname} {delivery_lastname}
        {delivery_address1}
        {delivery_address2}
        {delivery_city} {delivery_postal_code}
        {delivery_country} {delivery_state}
        {delivery_phone}
        {delivery_other}
        {invoice_company}
        {invoice_firstname} {invoice_lastname}
        {invoice_address1}
        {invoice_address2}
        {invoice_city} {invoice_postal_code}
        {invoice_country} {invoice_state}
        {invoice_phone}
        {invoice_other}
        +
         
        Kundennachricht
         
        {message}
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/de/new_order.txt b/modules/mailalerts/mails/de/new_order.txt new file mode 100644 index 000000000..512c592bb --- /dev/null +++ b/modules/mailalerts/mails/de/new_order.txt @@ -0,0 +1,41 @@ +Hallo, + +Sie haben eine neue Bestellung erhalten von {firstname} {lastname} auf {shop_name}. + +Bestellung: {order_name} +Ausgeführt am: {date} +Lieferer: {carrier} +Zahlung: {payment} +Ermäßigungen: {total_discounts} +Versand: {total_shipping} +Produkte: {total_products} +Geschenkverpackung: {total_wrapping} +Gesamt bezahlt: {total_paid} + +Lieferadresse: + +{delivery_company} +{delivery_firstname} {delivery_lastname} +{delivery_address1} +{delivery_address2} +{delivery_postal_code} {delivery_city} +{delivery_country} {delivery_state} +{delivery_other} + +Rechnungsadresse: + +{invoice_company} +{invoice_firstname} {invoice_lastname} +{invoice_address1} +{invoice_address2} +{invoice_postal_code} {invoice_city} +{invoice_country} {invoice_state} +{invoice_other} + +Kundennachricht: + +{message} + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/de/productoutofstock.html b/modules/mailalerts/mails/de/productoutofstock.html new file mode 100644 index 000000000..ec3ba24fa --- /dev/null +++ b/modules/mailalerts/mails/de/productoutofstock.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Ausverkauft + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        {product} ist fast ausverkauft.
         
        Der verbleibende Lagerbestand liegt unter der festgelegten Mindestzahl von {last_qty}.

        Verbleibender Lagerbestand: {qty}

        Wir raten Ihnen, die Produktseite im Administrator zu öffnen, um Ihren Lagerbestand aufzufüllen.
         
        {shop_name} untestützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/de/productoutofstock.txt b/modules/mailalerts/mails/de/productoutofstock.txt new file mode 100644 index 000000000..73a9904c6 --- /dev/null +++ b/modules/mailalerts/mails/de/productoutofstock.txt @@ -0,0 +1,12 @@ +Hallo, + +Das Produkt {product} ist fast ausverkauft. +The remaining stock is now less than the specified minimum of {last_qty}. +Remaining stock : {qty} + + +Verbleibender Lagerbestand: {qty} + +Wir raten Ihnen, die Produktseite im Administrator zu öffnen, um Ihren Lagerbestand aufzufüllen. + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/mailalerts/mails/en/customer_qty.html b/modules/mailalerts/mails/en/customer_qty.html new file mode 100644 index 000000000..eac4a0435 --- /dev/null +++ b/modules/mailalerts/mails/en/customer_qty.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Product available + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {product} is now available.
         
        + Indeed, the item is once again in-stock.

        + You can access the product page by clicking on the link: {product}

        + You can order it right now from our on-line shop. +
         
        + {shop_name} powered with PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/en/customer_qty.txt b/modules/mailalerts/mails/en/customer_qty.txt new file mode 100644 index 000000000..19c3d0ee4 --- /dev/null +++ b/modules/mailalerts/mails/en/customer_qty.txt @@ -0,0 +1,12 @@ +Hi, + +Product {product} is now available. +Indeed, the item is once again in-stock. + +You can access the product page on: {product_link} + +You can order it right now from our on-line shop. + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/en/new_order.html b/modules/mailalerts/mails/en/new_order.html new file mode 100644 index 000000000..6a9022cba --- /dev/null +++ b/modules/mailalerts/mails/en/new_order.html @@ -0,0 +1,125 @@ + + + + + [{shop_name}] New order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        You've a new order from {firstname} {lastname}.
         
        Order details
         
        + Order: {order_name} placed on {date} +
        Payment: {payment} +
         
        + + + + + + + + + {items} + + + + + + + + + + + + + + + + + + + + +
        ReferenceProductUnit priceQuantityTotal price
        Products{total_products}
        Discounts{total_discounts}
        Gift-wrapping{total_wrapping}
        Shipping{total_shipping}
        Total paid{total_paid}
        +
         
        Shipping
         
        + Carrier: {carrier} +
         
        + + + + + + + + + +
        Delivery addressBilling address
        + {delivery_company} +
        {delivery_firstname} {delivery_lastname} +
        {delivery_address1} +
        {delivery_address2} +
        {delivery_city} {delivery_postal_code} +
        {delivery_country} {delivery_state} +
        {delivery_phone} +
        {delivery_other} +
        + {invoice_company} +
        {invoice_firstname} {invoice_lastname} +
        {invoice_address1} +
        {invoice_address2} +
        {invoice_city} {invoice_postal_code} +
        {invoice_country} {invoice_state} +
        {invoice_phone} +
        {invoice_other} +
        +
         
        Customer message
         
        + {message} +
         
        + {shop_name} powered with PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/en/new_order.txt b/modules/mailalerts/mails/en/new_order.txt new file mode 100644 index 000000000..a49ab34b9 --- /dev/null +++ b/modules/mailalerts/mails/en/new_order.txt @@ -0,0 +1,41 @@ +Hi, + +You've a new order from {firstname} {lastname} on {shop_name}. + +Order: {order_name} +Placed on : {date} +Carrier : {carrier} +Payment: {payment} +Discounts: {total_discounts} +Shipping: {total_shipping} +Products: {total_products} +Gift-wrapping: {total_wrapping} +Total paid: {total_paid} + +Delivery address: + +{delivery_company} +{delivery_firstname} {delivery_lastname} +{delivery_address1} +{delivery_address2} +{delivery_postal_code} {delivery_city} +{delivery_country} {delivery_state} +{delivery_other} + +Billing address: + +{invoice_company} +{invoice_firstname} {invoice_lastname} +{invoice_address1} +{invoice_address2} +{invoice_postal_code} {invoice_city} +{invoice_country} {invoice_state} +{invoice_other} + +Customer message: + +{message} + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/en/productoutofstock.html b/modules/mailalerts/mails/en/productoutofstock.html new file mode 100644 index 000000000..0f4122320 --- /dev/null +++ b/modules/mailalerts/mails/en/productoutofstock.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Out of stock + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {product} is nearly out of stock.
         
        + The remaining stock is now less than the specified minimum of {last_qty}.

        + Remaining stock: {qty}

        + You are advised to open the product's admin Product Page in order to replenish your inventory. +
         
        + {shop_name} powered with PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/en/productoutofstock.txt b/modules/mailalerts/mails/en/productoutofstock.txt new file mode 100644 index 000000000..7952a5241 --- /dev/null +++ b/modules/mailalerts/mails/en/productoutofstock.txt @@ -0,0 +1,11 @@ +Hi, + +The product {product} is nearly out of stock. +The remaining stock is now less than the specified minimum of {last_qty}. +Remaining stock : {qty} + +You are advised to open the product's admin Product Page in order to replenish your inventory. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/mailalerts/mails/es/customer_qty.html b/modules/mailalerts/mails/es/customer_qty.html new file mode 100644 index 000000000..7859aad6f --- /dev/null +++ b/modules/mailalerts/mails/es/customer_qty.html @@ -0,0 +1,35 @@ + + + + + [{shop_name}] Producto disponible + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        {product} ya está disponible.
         
        De hecho, el tema es una vez más en acciones.

        Puede acceder a la página del producto haciendo clic en el enlace: {product}

        Puede solicitar ahora mismo en nuestra tienda on-line.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/mailalerts/mails/es/customer_qty.txt b/modules/mailalerts/mails/es/customer_qty.txt new file mode 100644 index 000000000..43ed2e175 --- /dev/null +++ b/modules/mailalerts/mails/es/customer_qty.txt @@ -0,0 +1,12 @@ +Hola, + +Producto {product} ya está disponible. +De hecho, el tema es una vez más en acciones. + +Puede acceder a la página del producto en este enlace: {product_link} + +Puede solicitar ahora mismo en nuestra tienda on-line. + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/es/new_order.html b/modules/mailalerts/mails/es/new_order.html new file mode 100644 index 000000000..c8070bed7 --- /dev/null +++ b/modules/mailalerts/mails/es/new_order.html @@ -0,0 +1,118 @@ + + + + + [{shop_name}] Nuevo orden + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Has un nuevo orden de {firstname} {lastname}.
         
        Detalles del orden
         
        Orden: {order_name} puesto en {date}
        De pago: {payment}
         
        + + + + + +{items} + + + + + + + + + + + + + + + + + + + + + +
        ReferenciaProductoPrecio unitarioCantidadEl precio total
        Productos{total_products}
        Descuentos{total_discounts}
        Envolver regalos{total_wrapping}
        Transporte{total_shipping}
        Total pagado{total_paid}
        +
         
        Transporte
         
        Carrier: {carrier}
         
        + + + + + + + + + + +
        Dirección de entregaDirección de facturación
        {delivery_company}
        {delivery_firstname} {delivery_lastname}
        {delivery_address1}
        {delivery_address2}
        {delivery_city} {delivery_postal_code}
        {delivery_country} {delivery_state}
        {delivery_phone}
        {delivery_other}
        {invoice_company}
        {invoice_firstname} {invoice_lastname}
        {invoice_address1}
        {invoice_address2}
        {invoice_city} {invoice_postal_code}
        {invoice_country} {invoice_state}
        {invoice_phone}
        {invoice_other}
        +
         
        Customer message
         
        {message}
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/mailalerts/mails/es/new_order.txt b/modules/mailalerts/mails/es/new_order.txt new file mode 100644 index 000000000..768ef95e8 --- /dev/null +++ b/modules/mailalerts/mails/es/new_order.txt @@ -0,0 +1,41 @@ +Hola, + +Has un nuevo orden de {firstname} {lastname} en {shop_name}. + +Orden: {order_name} +Puesto en: {date} +Carrier: {carrier} +De pago: {payment} +Descuentos: {total_discounts} +Gastos de envío: {total_shipping} +Productos: {total_products} +Envolver regalos: {total_wrapping} +Total pagado: {total_paid} + +Dirección de entrega: + +{delivery_company} +{delivery_firstname} {delivery_lastname} +{delivery_address1} +{delivery_address2} +{delivery_postal_code} {delivery_city} +{delivery_country} {delivery_state} +{delivery_other} + +Dirección de facturación: + +{invoice_company} +{invoice_firstname} {invoice_lastname} +{invoice_address1} +{invoice_address2} +{invoice_postal_code} {invoice_city} +{invoice_country} {invoice_state} +{invoice_other} + +Mensaje al cliente: + +{message} + + + +{shop_url} desarrollado por PrestaShop™ diff --git a/modules/mailalerts/mails/es/productoutofstock.html b/modules/mailalerts/mails/es/productoutofstock.html new file mode 100644 index 000000000..191786efb --- /dev/null +++ b/modules/mailalerts/mails/es/productoutofstock.html @@ -0,0 +1,35 @@ + + + + + [{shop_name}] Fuera de stock + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        {product} está fuera de stock
         
        De hecho, la ruptura de stock de {last_qty} ha sido superado.

        Existencias restantes: {qty}

        Se aconseja abrir administrador del producto Producto a fin de reponer el inventario.
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/mailalerts/mails/es/productoutofstock.txt b/modules/mailalerts/mails/es/productoutofstock.txt new file mode 100644 index 000000000..5a30d8737 --- /dev/null +++ b/modules/mailalerts/mails/es/productoutofstock.txt @@ -0,0 +1,10 @@ +Hola, + +El producto {product} es pronto fuera de stock. +De hecho, la ruptura de stock de {last_qty} ha sido superado. +Existencias restantes: {qty} + +Se aconseja abrir administrador del producto Producto a fin de reponer el inventario. + + +{shop_url} desarrollado por PrestaShop™ \ No newline at end of file diff --git a/modules/mailalerts/mails/fr/customer_qty.html b/modules/mailalerts/mails/fr/customer_qty.html new file mode 100644 index 000000000..ca454af08 --- /dev/null +++ b/modules/mailalerts/mails/fr/customer_qty.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Produit disponible + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {product} est de nouveau disponible
         
        + En effet, le stock a été réaprovisionné.

        + Vous pouvez accéder à la page produit en cliquant sur le lien suivant: {product}

        + Vous pouvez donc de nouveau commander ce produit depuis notre catalogue en ligne. +
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/fr/customer_qty.txt b/modules/mailalerts/mails/fr/customer_qty.txt new file mode 100644 index 000000000..063277704 --- /dev/null +++ b/modules/mailalerts/mails/fr/customer_qty.txt @@ -0,0 +1,10 @@ +Bonjour, + +Le produit {product} est de nouveau disponible. +En effet, le stock a été réaprovisionné. + +Vous pouvez accéder à la page produit à ce lien: {product_link} + +Vous pouvez donc de nouveau commander ce produit depuis notre catalogue en ligne. + +{shop_url} réalisé par PrestaShop™ diff --git a/modules/mailalerts/mails/fr/new_order.html b/modules/mailalerts/mails/fr/new_order.html new file mode 100644 index 000000000..eafbccb22 --- /dev/null +++ b/modules/mailalerts/mails/fr/new_order.html @@ -0,0 +1,125 @@ + + + + + [{shop_name}] Nouvelle commande + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {firstname} {lastname} vient de passer une commande.
         
        Détails
         
        + Commande {order_name} passée le {date} +
        Paiement : {payment} +
         
        + + + + + + + + + {items} + + + + + + + + + + + + + + + + + + + + +
        RéférenceArticlePrix unitaireQuantitéPrix total
        Produits{total_products}
        Réductions{total_discounts}
        Emballage cadeau{total_wrapping}
        Frais de port{total_shipping}
        Total{total_paid}
        +
         
        Transport
         
        + Transporteur : {carrier} +
         
        + + + + + + + + + +
        Adresse de livraisonAdresse de facturation
        + {delivery_company} +
        {delivery_firstname} {delivery_lastname} +
        {delivery_address1} +
        {delivery_address2} +
        {delivery_city} {delivery_postal_code} +
        {delivery_country} {delivery_state} +
        {delivery_phone} +
        {delivery_other} +
        + {invoice_company} +
        {invoice_firstname} {invoice_lastname} +
        {invoice_address1} +
        {invoice_address2} +
        {invoice_city} {invoice_postal_code} +
        {invoice_country} {invoice_state} +
        {invoice_phone} +
        {invoice_other} +
        +
         
        Message client
         
        + {message} +
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/fr/new_order.txt b/modules/mailalerts/mails/fr/new_order.txt new file mode 100644 index 000000000..e6e9868c3 --- /dev/null +++ b/modules/mailalerts/mails/fr/new_order.txt @@ -0,0 +1,39 @@ +Bonjour, + +Vous avez reçu une nouvelle commande de {firstname} {lastname} sur {shop_name}. + +Commande : {order_name} +Date : {date} +Transporteur : {carrier} +Mode de paiement : {payment} +Bons d'achat et réductions : {total_discounts} +Frais d'expédition : {total_shipping} +Total produits : {total_products} +Emballage cadeau: {total_wrapping} +Total TTC : {total_paid} + +Adresse de livraison : + +{delivery_company} +{delivery_firstname} {delivery_lastname} +{delivery_address1} +{delivery_address2} +{delivery_postal_code} {delivery_city} +{delivery_country} {delivery_state} +{delivery_other} + +Adresse de facturation : + +{invoice_company} +{invoice_firstname} {invoice_lastname} +{invoice_address1} +{invoice_address2} +{invoice_postal_code} {invoice_city} +{invoice_country} {invoice_state} +{invoice_other} + +Message client : + +{message} + +{shop_url} réalisé par PrestaShop™ diff --git a/modules/mailalerts/mails/fr/productoutofstock.html b/modules/mailalerts/mails/fr/productoutofstock.html new file mode 100644 index 000000000..6526871c8 --- /dev/null +++ b/modules/mailalerts/mails/fr/productoutofstock.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Rupture de stock + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {product} est en rupture de stock
         
        + En effet, la quantité est maintenant inférieure à {last_qty}.

        + Stock restant : {qty}

        + Nous vous conseillons de vous rendre sur la page produit du panneau d'administration afin de renouveler vos stocks. +
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/mailalerts/mails/fr/productoutofstock.txt b/modules/mailalerts/mails/fr/productoutofstock.txt new file mode 100644 index 000000000..f63b259d7 --- /dev/null +++ b/modules/mailalerts/mails/fr/productoutofstock.txt @@ -0,0 +1,9 @@ +Bonjour, + +Le produit {product} est bientôt en rupture de stock. +En effet, le seuil de rupture de stock de {last_qty} a été dépassé. +Stock restant : {qty} + +Nous vous conseillons de vous rendre sur la fiche du produit afin de renouveler vos stocks. + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/mailalerts/mails/it/customer_qty.html b/modules/mailalerts/mails/it/customer_qty.html new file mode 100644 index 000000000..12db6f7b8 --- /dev/null +++ b/modules/mailalerts/mails/it/customer_qty.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Prodotto disponibile + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        {product} è ora disponibile.
        L'articolo è di nuovo in magazzino.

        Puoi accedere alla pagina del prodotto cliccando sul link: {product}

        Puoi ordinarlo fin d'ora dal nostro negozio online.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/it/customer_qty.txt b/modules/mailalerts/mails/it/customer_qty.txt new file mode 100644 index 000000000..3e20851a8 --- /dev/null +++ b/modules/mailalerts/mails/it/customer_qty.txt @@ -0,0 +1,12 @@ +Salve, + +Il prodotto {product} è ora disponibile. +Infatti l'articolo è di nuovo in magazzino. + +Puoi accedere alla pagina del prodotto su: {product_link} + +Puoi ordinarlo fin d'ora dal nostro negozio online. + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/it/new_order.html b/modules/mailalerts/mails/it/new_order.html new file mode 100644 index 000000000..965bf90e0 --- /dev/null +++ b/modules/mailalerts/mails/it/new_order.html @@ -0,0 +1,116 @@ + + + + + [{shop_name}] Nuovo ordine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Hai un nuovo ordine da parte di {firstname} {lastname}.
        Dati dell'ordine
        Ordine: {order_name} effettuato il {date}
        Pagamento: {payment}
        {items} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Riferimento Prodotto Prezzo unitarioQuantità Prezzo totale
        Prodotti{total_products}
        Sconti{total_discounts}
        Carta regalo{total_wrapping}
        Spedizione{total_shipping}
        Totale pagato{total_paid}
        +
        Spedizione
        Mezzo di spedizione: {carrier}
        + + + + + + + + + + +
        INDIRIZZO DI CONSEGNA INDIRIZZO DI FATTURAZIONE
        {delivery_company}
        {delivery_firstname} {delivery_lastname}
        {delivery_address1}
        {delivery_address2}
        {delivery_city} {delivery_postal_code}
        {delivery_country} {delivery_state}
        {delivery_phone}
        {delivery_other}
        {invoice_company}
        {invoice_firstname} {invoice_lastname}
        {invoice_address1}
        {invoice_address2}
        {invoice_city} {invoice_postal_code}
        {invoice_country} {invoice_state}
        {invoice_phone}
        {invoice_other}
        +
        Messaggio cliente
        {message}
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/it/new_order.txt b/modules/mailalerts/mails/it/new_order.txt new file mode 100644 index 000000000..6385c06ef --- /dev/null +++ b/modules/mailalerts/mails/it/new_order.txt @@ -0,0 +1,41 @@ +Salve, + +Hai un nuovo ordine da parte di {firstname} {lastname} su {shop_name}. + +Ordine: {order_name} +Effettuato il: {date} +Mezzo di spedizione: {carrier} +Pagamento: {payment} +Sconti: {total_discounts} +Spedizione: {total_shipping} +Prodotti: {total_products} +Carta regalo: {total_wrapping} +Totale pagato: {total_paid} + +Indirizzo di consegna: + +{delivery_company} +{delivery_firstname} {delivery_lastname} +{delivery_address1} +{delivery_address2} +{delivery_postal_code} {delivery_city} +{delivery_country} {delivery_state} +{delivery_other} + +Indirizzo di fatturazione: + +{invoice_company} +{invoice_firstname} {invoice_lastname} +{invoice_address1} +{invoice_address2} +{invoice_postal_code} {invoice_city} +{invoice_country} {invoice_state} +{invoice_other} + +Messaggio del cliente: + +{message} + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/mailalerts/mails/it/productoutofstock.html b/modules/mailalerts/mails/it/productoutofstock.html new file mode 100644 index 000000000..8f3b3b9ff --- /dev/null +++ b/modules/mailalerts/mails/it/productoutofstock.html @@ -0,0 +1,34 @@ + + + + + [{shop_name}] Prodotto esaurito + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        {product} è quasi esaurito.
        La quantità rimanente è adesso inferiore al minimo previsto di {last_qty}.

        Stock rimanente: {qty}

        Ti consigliamo di aprire la Pagina Prodotto dell'admin prodotti per rifornire il tuo inventario.
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/mailalerts/mails/it/productoutofstock.txt b/modules/mailalerts/mails/it/productoutofstock.txt new file mode 100644 index 000000000..3da41f042 --- /dev/null +++ b/modules/mailalerts/mails/it/productoutofstock.txt @@ -0,0 +1,11 @@ +Salve, + +Il prodotto {product} è quasi esaurito. +La quantità rimanente è adesso inferiore del minimo previsto di {last_qty}. +Stock rimanente: {qty} + +Ti consigliamo di aprire la Pagina Prodotto dell'admin prodotti per rifornire il tuo inventorio. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/mailalerts/my-account.tpl b/modules/mailalerts/my-account.tpl new file mode 100644 index 000000000..a979d9997 --- /dev/null +++ b/modules/mailalerts/my-account.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
      • + {l s='alerts' mod='mailalerts'} + {l s='My alerts' mod='mailalerts'} +
      • + \ No newline at end of file diff --git a/modules/mailalerts/myalerts.php b/modules/mailalerts/myalerts.php new file mode 100644 index 000000000..3c5e31701 --- /dev/null +++ b/modules/mailalerts/myalerts.php @@ -0,0 +1,65 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include_once(dirname(__FILE__).'/mailalerts.php'); + +$errors = array(); + +if ($cookie->isLogged()) +{ + if (Tools::getValue('action') == 'delete') + { + $id_customer = (int)($cookie->id_customer); + if (!$id_product = (int)(Tools::getValue('id_product'))) + $errors[] = Tools::displayError('You must have a product to delete an alert.'); + $id_product_attribute = (int)(Tools::getValue('id_product_attribute')); + $customer = new Customer((int)($id_customer)); + MailAlerts::deleteAlert((int)($id_customer), 0, (int)($id_product), (int)($id_product_attribute)); + } + $smarty->assign('alerts', MailAlerts::getProductsAlerts((int)($cookie->id_customer), (int)($cookie->id_lang))); +} +else + $errors[] = Tools::displayError('You must be logged in to manage your alerts.'); + +$smarty->assign(array( + 'id_customer' => (int)($cookie->id_customer), + 'errors' => $errors +)); + +if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/mailalerts/myalerts.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/mailalerts/myalerts.tpl'); +elseif (Tools::file_exists_cache(dirname(__FILE__).'/myalerts.tpl')) + $smarty->display(dirname(__FILE__).'/myalerts.tpl'); +else + echo Tools::displayError('No template found'); + +include(dirname(__FILE__).'/../../footer.php'); diff --git a/modules/mailalerts/myalerts.tpl b/modules/mailalerts/myalerts.tpl new file mode 100644 index 000000000..e6e7c9f24 --- /dev/null +++ b/modules/mailalerts/myalerts.tpl @@ -0,0 +1,79 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +
        + {capture name=path}{l s='My account' mod='mailalerts'}{$navigationPipe}{l s='My alerts' mod='mailalerts'}{/capture} + {include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='My alerts' mod='mailalerts'}

        + + {include file="$tpl_dir./errors.tpl"} + + {if $id_customer|intval neq 0} + {if $alerts} +
        + + + + + + + + + {foreach from=$alerts item=product name=i} + + + + + + {/foreach} +
        {l s='Product' mod='mailalerts'}{l s='Delete' mod='mailalerts'}
        + {$product.name|escape:'htmlall':'UTF-8'} + {$product.name|truncate:40:'...'|escape:'htmlall':'UTF-8'} + {if isset($product.attributes_small)} +
        {$product.attributes_small|escape:'htmlall':'UTF-8'} + {/if}
        +
        + {l s='Delete' mod='mailalerts'} +
        +
        +
         
        + {else} +

        {l s='You are not subscribed to any alerts.' mod='mailalerts'}

        + {/if} + {/if} + + +
        diff --git a/modules/mailalerts/product.tpl b/modules/mailalerts/product.tpl new file mode 100644 index 000000000..7ef850cf6 --- /dev/null +++ b/modules/mailalerts/product.tpl @@ -0,0 +1,93 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{if isset($email) AND $email} +
        +{/if} +{l s='Notify me when available' mod='mailalerts'} + + diff --git a/modules/mondialrelay/AdminMondialRelay.gif b/modules/mondialrelay/AdminMondialRelay.gif new file mode 100755 index 000000000..7550096d4 Binary files /dev/null and b/modules/mondialrelay/AdminMondialRelay.gif differ diff --git a/modules/mondialrelay/AdminMondialRelay.php b/modules/mondialrelay/AdminMondialRelay.php new file mode 100755 index 000000000..20c85f515 --- /dev/null +++ b/modules/mondialrelay/AdminMondialRelay.php @@ -0,0 +1,455 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once('MondialRelayClass.php'); + +@set_time_limit(0); + +function _get($type, $host, $port = '80', $path = '/', $data = '') +{ + $d = ''; + $_err = 'lib sockets::'.__FUNCTION__.'(): '; + switch($type) + { + case 'http': $type = ''; + case 'ssl': continue; + default: die($_err.'bad $type'); + } + if(!ctype_digit($port)) + die($_err.'bad port'); + + $fp = fsockopen($host, $port, $errno, $errstr, $timeout=60); + if(!$fp) + die($_err.$errstr.$errno); + else + { + fputs($fp, "POST $path HTTP/1.1\r\n"); + fputs($fp, "Host: $host\r\n"); + fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); + fputs($fp, "Content-length: ".strlen($data)."\r\n"); + fputs($fp, "Connection: close\r\n\r\n"); + fputs($fp, $data."\r\n\r\n"); + + while(!feof($fp)) $d .= fgets($fp,4096); + fclose($fp); + } + + $ndata = explode(":THISTAG:",$d); + return $ndata[1]; +} + +function free_MR_chaine($mystring) +{ + + $mystring = strip_tags($mystring); + $mystring = htmlentities($mystring, ENT_NOQUOTES, 'utf-8'); + $mystring = preg_replace('#\&([A-za-z])(?:uml|circ|tilde|acute|grave|cedil|ring)\;#', '\1', $mystring); + $mystring = preg_replace('#\&([A-za-z]{2})(?:lig)\;#', '\1', $mystring); + $mystring = preg_replace('#\&[^;]+\;#', '', $mystring); + + + $mystring = str_replace('\'', ' ', $mystring); + $mystring = str_replace('"', ' ', $mystring); + + $OldPattern0 = array("�","�","�","�","�","�","�","�","�","�","\"","�","�", + "�","�","�","�","�","�","�","�","�","�","�","�","�", + "�","�","�","�","�"); + $mystring = str_replace($OldPattern0 , ' ',$mystring); + return $mystring; +} + +class AdminMondialRelay extends AdminTab +{ + private $displayInfos = true; + + public function __construct() + { + $this->table = 'mr_selected'; + $this->className = 'MondialRelayClass'; + + parent::__construct(); + } + + private function _delete_history() + { + unset($result); + if (isset($_POST['history'])) + foreach($_POST['history'] as $field) + if (isset($field['selected']) AND $field['selected'] == '1') + $query = Db::getInstance()->Execute("DELETE FROM `" . _DB_PREFIX_ ."mr_historique` WHERE id='".(int)($field['id'])."';"); + } + + private function _generateetiquettes() + { + unset($result); + $urla4 = ''; + $urla5 = ''; + + include_once(dirname(__FILE__).'/mondialrelay.php'); + $mondialrelay = new MondialRelay(); + + echo '

        ' . $mondialrelay->getL('List of orders recognized') . '

        '; + + $mr_Enseigne_WebService = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $mr_code_marque = Configuration::get('MR_CODE_MARQUE'); + $mr_Key_WebService = Configuration::get('MR_KEY_WEBSERVICE'); + $mr_Langage = Configuration::get('MR_LANGUAGE'); + $mr_Ad1 = Configuration::get('PS_SHOP_NAME'); + $mr_Ad2 = ''; + $mr_Ad3 = Configuration::get('PS_SHOP_ADDR1'); + $mr_Ad4 = Configuration::get('PS_SHOP_ADDR2'); + $mr_Ville = Configuration::get('PS_SHOP_CITY'); + $mr_CP = Configuration::get('PS_SHOP_CODE'); + $mr_Pays = Db::getInstance()->getValue('SELECT c.`iso_code` + FROM `'._DB_PREFIX_.'country` c + JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`) + WHERE cl.`name` = "'.pSQL(Configuration::get('PS_SHOP_COUNTRY')).'" + AND cl.`id_lang` = '.(int)(Configuration::get('PS_LANG_DEFAULT'))); + $mr_Tel1 = Configuration::get('PS_SHOP_PHONE'); + $mr_Tel2 = ''; + $mr_Mail = Configuration::get('PS_SHOP_EMAIL'); + + $concatener_id_order = ""; + $concatener_exp_num = ""; + $concatener_error = ""; + if (!empty($mr_Ad1) AND !empty($mr_Ad3) AND !empty($mr_Ville) AND !empty($mr_CP) AND !empty($mr_Pays)) + { + foreach($_POST['order'] as $field) + { + if (is_numeric($field['weight']) AND $field['weight'] > 0 AND isset($field['selected']) AND $field['selected'] == '1') + { + $customer = new Customer((int)($field['id_customer'])); + $addressliv = new Address((int)($field['id_address_delivery'])); + $country = new Country((int)($addressliv->id_country)); + $params = 'mr_Enseigne_WebService='.urlencode(free_MR_chaine($mr_Enseigne_WebService)); + $params .= '&mr_code_marque='.urlencode(free_MR_chaine($mr_code_marque)); + $params .= '&mr_Key_WebService='.urlencode(free_MR_chaine($mr_Key_WebService)); + $params .= '&ModeCol='.urlencode(free_MR_chaine($field['mr_ModeCol'])); + $params .= '&ModeLiv='.(urlencode(free_MR_chaine($field['mr_ModeLiv'])) == 'LD1' ? 'LDR' : urlencode(free_MR_chaine($field['mr_ModeLiv']))); + $params .= '&NDossier='.urlencode(free_MR_chaine($field['id'])); + $params .= '&NClient='.urlencode(free_MR_chaine($field['id_customer'])); + $params .= '&Expe_Langage='.urlencode(free_MR_chaine($mr_Langage)); + $params .= '&Expe_Ad1='.urlencode(free_MR_chaine($mr_Ad1)); + $params .= '&Expe_Ad2='.urlencode(free_MR_chaine($mr_Ad2)); + $params .= '&Expe_Ad3='.urlencode(free_MR_chaine($mr_Ad3)); + $params .= '&Expe_Ad4='.urlencode(free_MR_chaine($mr_Ad4)); + $params .= '&Expe_Ville='.urlencode(free_MR_chaine($mr_Ville)); + $params .= '&Expe_CP='.urlencode(free_MR_chaine($mr_CP)); + $params .= '&Expe_Pays='.urlencode(free_MR_chaine($mr_Pays)); + $params .= '&Expe_Tel1='.urlencode(free_MR_chaine($mr_Tel1)); + $params .= '&Expe_Tel2='.urlencode(free_MR_chaine($mr_Tel2)); + $params .= '&Expe_Mail='.urlencode(free_MR_chaine($mr_Mail)); + $params .= '&Dest_Langage='.urlencode(free_MR_chaine($country->iso_code)); + $params .= '&Dest_Ad1='.urlencode(strtoupper(substr(free_MR_chaine($addressliv->lastname).' '.free_MR_chaine($addressliv->firstname), 0, 32))); + $params .= '&Dest_Ad2='.urlencode(strtoupper(substr(free_MR_chaine($addressliv->address2), 0, 32))); + $params .= '&Dest_Ad3='.urlencode(strtoupper(substr(free_MR_chaine($addressliv->address1), 0, 32))); + $params .= '&Dest_Ad4='.urlencode(strtoupper(substr(substr(free_MR_chaine($addressliv->address1), 32), 0, 32))); + $params .= '&Dest_Ville='.urlencode(strtoupper(substr(free_MR_chaine($addressliv->city), 0, 26))); + $params .= '&Dest_CP='.urlencode(strtoupper(substr(free_MR_chaine($addressliv->postcode), 0, 5))); + $params .= '&Dest_Pays='.urlencode($country->iso_code); + $params .= '&Dest_Tel1='.urlencode(free_MR_chaine($addressliv->phone ? $addressliv->phone : '')); + $params .= '&Dest_Tel2='.urlencode(free_MR_chaine($addressliv->phone_mobile ? $addressliv->phone_mobile : '')); + $params .= '&Dest_Mail='.urlencode(free_MR_chaine(strtoupper(substr($customer->email, 0, 70)))); + while (strlen($field['weight']) < 3) + $field['weight'] = '0'.$field['weight']; + $params .= '&Poids='.urlencode(free_MR_chaine($field['weight'])); + $params .= '&Longueur='; + $params .= '&Taille='; + $params .= '&NbColis=1'; + $params .= '&CRT_Valeur=0'; + $params .= '&CRT_Devise=EUR'; + $params .= '&Exp_Valeur='; + $params .= '&Exp_Devise='; + if ($field['MR_Selected_Num'] == 'LD1' OR $field['MR_Selected_Num'] == 'LDS') + { + $params .= '&LIV_Rel_Pays='; + $params .= '&LIV_Rel='; + } + else + { + $params .= '&LIV_Rel_Pays='.$field['MR_Selected_Pays']; + $params .= '&LIV_Rel='.$field['MR_Selected_Num']; + } + $params .= '&Assurance='.urlencode(free_MR_chaine($field['mr_ModeAss'])); + $params .= '&Instructions='; + $params .= '&Texte='; + $result = _get('http', htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8'), '80', __PS_BASE_URI__ .'modules/mondialrelay/kit_mondialrelay/CreationEtiquettePointRelais_ajax.php', $params); + $result = explode('|', $result); + + if ($result[0] == 'a') + $concatener_error .= 'Order ID = '.$field['id'].'
        '.$result[1].'
        '; + elseif ($result[0] != '0') + $concatener_error .= 'Order ID = '.$field['id'].'
        Error nb '.$result[0].'
        '.$result[1].'
        '; + elseif ($result[0] == '0') + { + $mondialrelayclass = new MondialRelayClass($field['id_mr_selected']); + + $mondialrelayclass->id_order = $field['id']; + $mondialrelayclass->MR_poids = $field['weight']; + + $mondialrelayclass->exp_number = $result[1]; + $mondialrelayclass->url_etiquette = $result[2]; + $mondialrelayclass->url_suivi = $result[3]; + $mondialrelayclass->save(); + $concatener_id_order .= $field['id'].';'; + $concatener_exp_num .= $result[1].';'; + + $order = new Order((int)($field['id'])); + $order->shipping_number = $field['id_mr_selected']; + $order->update(); + + + $templateVars = array('{followup}' => $result[3]); + + $history = new OrderHistory(); + $history->id_order = (int)($field['id']); + $history->changeIdOrderState(_PS_OS_SHIPPING_, (int)($field['id'])); + $history->id_employee = (int)($cookie->id_employee); + $history->addWithemail(true, $templateVars); + + echo '
      • ' . $mondialrelay->getL('Order number') . ': ' . $field['id']; + echo ' - ' . $mondialrelay->getL('Email send to') . ': ' . $customer->email; + echo "
      • \n"; + } + unset($result); + } + } + } + else + $concatener_error .= $mondialrelay->getL('Empty adress : Are you sure you\'ve set a validate address in the Contact page?'); + + $concatener_id_order = substr($concatener_id_order, 0, -1); + $concatener_exp_num = substr($concatener_exp_num, 0, -1); + if (trim($concatener_exp_num) > 0) + { + $params = 'mr_Enseigne_WebService='.urlencode($mr_Enseigne_WebService); + $params .= '&mr_Key_WebService='.urlencode($mr_Key_WebService); + $params .= '&Langue='.urlencode($mr_Langage); + $params .= '&Expeditions='.$concatener_exp_num; + $result = _get('http', htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8'), '80', __PS_BASE_URI__ .'modules/mondialrelay/kit_mondialrelay/ImpressionEtiquettePointRelais_ajax.php', $params); + $result = explode('|',$result); + + if ($result[0] == 'a') + $concatener_error .= 'Creation url etiquettes
        '.$result[1].'
        '; + elseif ($result[0] != '0') + $concatener_error .= 'Creation url etiquettes
        Error nb '.$result[0].'
        '.$result[1].'
        '; + elseif ($result[0] == '0') + { + $urla4 = $result[1]; + $urla5 = $result[2]; + $query = "INSERT INTO " . _DB_PREFIX_ ."mr_historique (`order` ,`exp` ,`url_a4` ,`url_a5`) + VALUES ( '".pSQL($concatener_id_order)."','".pSQL($concatener_exp_num)."', '".pSQL($result[1])."', '".pSQL($result[2])."');"; + $query = Db::getInstance()->Execute($query); + } +//curl_close($ch); + } + if (trim($concatener_error) != '') + echo '
        '.$concatener_error.'
        '; + else + Tools::redirectAdmin('index.php?tab=AdminMondialRelay&updatesuccess&token='.$this->token); + return true; + } + + private function _postProcess() + { + if (Tools::isSubmit('generate')) + $this->_generateetiquettes(); + if (Tools::isSubmit('delete_h')) + $this->_delete_history(); + } + + private function displayOrdersTable() + { + global $cookie; + + include_once(dirname(__FILE__).'/mondialrelay.php'); + $mondialrelay = new MondialRelay(); + $order_state = new OrderState((int)(Configuration::get('MONDIAL_RELAY_ORDER_STATE')), $cookie->id_lang); + $mr_weight_coef = (int)(Configuration::get('MR_WEIGHT_COEF')); + + $html = ' + + '; + if (Tools::isSubmit('updatesuccess')) + $html .= '
        '.$mondialrelay->getL('Settings updated succesfull').'
        '; + + $html .= $mondialrelay->getL('To generate sticks, you must have register a correct address of your store on').' '.$mondialrelay->getL('The contact page').''; + $html .= '

        '.$mondialrelay->getL('All orders which have the state').' "'.$order_state->name.'"'; + $html .= '. ' . $mondialrelay->getL('Change configuration') . '

        '; + + $orders = MondialRelayClass::getOrders(); + if (empty($orders)) + { + $html.= '

        ' . $mondialrelay->getL('No orders with this state.') . '

        '; + } + else + { + $html.= '
        '; + $html.= "\n"; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + foreach ($orders as $order) + { + if ($order['weight'] == 0) + { + $result_weight = Db::getInstance()->getRow(' + SELECT SUM(product_weight*product_quantity) as weight + FROM '._DB_PREFIX_.'order_detail + WHERE id_order = '.(int)($order['id_order'])); + $order['weight']=round($mr_weight_coef*$result_weight['weight']); + } + + $html .= "\n"; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + + $html .= ''; + $html .= ''; + + $html .= ''; + $html .= ''; + $html .= ''; + + $html .= ''; + $html .= ''; + } + $html .= '
        ' . $mondialrelay->getL('Order ID') . '' . $mondialrelay->getL('Customer') . '' . $mondialrelay->getL('Total price') . '' . $mondialrelay->getL('Total shipping') . '' . $mondialrelay->getL('Date') . '' . $mondialrelay->getL('Put a Weight (grams)') . '' . $mondialrelay->getL('Selected') . '
        ' . $mondialrelay->getL('All') . ' + | ' . $mondialrelay->getL('None') . '
        ' . $mondialrelay->getL('MR_Selected_Num') . '' . $mondialrelay->getL('MR_Selected_Pays') . '' . $mondialrelay->getL('exp_number') . '' . $mondialrelay->getL('Detail') . '
        ' . $order['id_order'] . ' + + + + + + + + + + ' . $order['customer'] . ' + ' . Tools::displayPrice($order['total'], new Currency($order['id_currency'])) . '' . Tools::displayPrice($order['shipping'], new Currency($order['id_currency'])) . '' . Tools::displayDate($order['date'], $order['id_lang']) . '' . $order['MR_Selected_Num'] .' + ' . $order['MR_Selected_Pays'] . ' + ' . $order['exp_number'] . ' + + + '.$mondialrelay->getL('View').' +
        '; + $html .= ''; + $html .= '
        '; + } + return $html; + } + + public function displayhistoriqueForm() + { + include_once(dirname(__FILE__).'/mondialrelay.php'); + $mondialrelay = new MondialRelay(); + $_html = ''; + $query = "SELECT * FROM `" . _DB_PREFIX_ ."mr_historique` ORDER BY `id` DESC ;"; + $query = Db::getInstance()->ExecuteS($query); + + $_html.= '
        '; + $_html.= '' . $mondialrelay->getL('History of sticks creation') . ''; + $_html.= '
        '; + $_html.= '
        '; + $_html.= ''; + foreach ($query AS $k => $row) + { + $_html.= ' + + '; + } + $_html .= '
        ' . $mondialrelay->getL('Selected') . '
        ' . $mondialrelay->getL('All') . ' + | ' . $mondialrelay->getL('None') . '
        ' . $mondialrelay->getL('Orders ID') . '' . $mondialrelay->getL('Exps num') . '' . $mondialrelay->getL('Print stick A4') . '' . $mondialrelay->getL('Print stick A5') . '
        + '.str_replace(';', ', ', $row['order']) .''.str_replace(';', ', ', $row['exp']).'' . $mondialrelay->getL('Print stick A4') . '' . $mondialrelay->getL('Print stick A5') . '
        '; + $_html .= ''; + $_html .= '
        '; + $_html .= '
        '; + + return $_html; + } + + public function display() + { + $html = ''; + + if (!empty($_POST)) + $html .= $this->_postProcess(); + + if ($this->displayInfos) + { + $html .= $this->displayOrdersTable(); + $html .= '

        '; + $html .= $this->displayhistoriqueForm(); + } + echo $html; + } +} + +?> diff --git a/modules/mondialrelay/MondialRelayClass.php b/modules/mondialrelay/MondialRelayClass.php new file mode 100755 index 000000000..b9923a55d --- /dev/null +++ b/modules/mondialrelay/MondialRelayClass.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MondialRelayClass extends ObjectModel +{ + public $id_customer; + public $id_method; + public $id_cart; + public $id_order = NULL; + public $MR_poids = NULL; + public $MR_Selected_Num; + public $MR_Selected_LgAdr1; + public $MR_Selected_LgAdr2 = NULL; + public $MR_Selected_LgAdr3; + public $MR_Selected_LgAdr4 = NULL; + public $MR_Selected_CP; + public $MR_Selected_Ville; + public $MR_Selected_Pays; + public $url_suivi= NULL; + public $url_etiquette= NULL; + public $exp_number= NULL; + public $date_add; + public $date_upd; + + + protected $table = 'mr_selected'; + protected $identifier = 'id_mr_selected'; + + + public function getFields() + { + parent::validateFields(); + if (isset($this->id_mr_selected)) + $fields['id_mr_selected'] = (int)($this->id_mr_selected); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_method'] = (int)($this->id_method); + $fields['id_cart'] = (int)($this->id_cart); + $fields['id_order'] = is_null($this->id_order) ? 0 : (int)($this->id_order); + $fields['MR_Selected_Num'] = pSQL($this->MR_Selected_Num); + $fields['MR_Selected_LgAdr1'] = pSQL($this->MR_Selected_LgAdr1); + $fields['MR_Selected_LgAdr2'] = pSQL($this->MR_Selected_LgAdr2); + $fields['MR_Selected_LgAdr3'] = pSQL($this->MR_Selected_LgAdr3); + $fields['MR_Selected_LgAdr4'] = pSQL($this->MR_Selected_LgAdr4); + $fields['MR_Selected_CP'] = (int)($this->MR_Selected_CP); + $fields['MR_Selected_Ville'] = pSQL($this->MR_Selected_Ville); + $fields['MR_Selected_Pays'] = pSQL($this->MR_Selected_Pays); + $fields['url_suivi'] = is_null($this->url_suivi) ? 0 : pSQL($this->url_suivi) ; + $fields['url_etiquette'] = is_null($this->url_etiquette) ? 0 : pSQL($this->url_etiquette) ; + $fields['exp_number'] = is_null($this->exp_number) ? 0 : pSQL($this->exp_number) ; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + $fields['MR_poids'] = is_null($this->MR_poids) ? 0 : pSQL($this->MR_poids) ; + return $fields; + } + + static function getOrders() + { + $id_order_state = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); + $sql = ' + SELECT o.`id_address_delivery` as id_address_delivery, o.`id_order` as id_order, o.`id_customer` as id_customer, + o.`id_cart` as id_cart, mrs.`id_mr_selected` as id_mr_selected, + CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + o.`total_paid_real` as total, o.`total_shipping` as shipping, + o.`date_add` as date, o.`id_currency` as id_currency, o.`id_lang` as id_lang, + mrs.`MR_poids` as weight, mr.`mr_Name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, + mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number, + mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'carrier` ca ON (ca.`id_carrier` = o.`id_carrier` AND ca.`external_module_name` = "mondialrelay") + LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs ON (mrs.`id_cart` = o.`id_cart`) + LEFT JOIN `'._DB_PREFIX_.'mr_method` mr ON (mr.`id_carrier` = ca.`id_carrier`) + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + WHERE (SELECT moh.`id_order_state` FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = o.`id_order` ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).' + AND ca.`external_module_name` = "mondialrelay" + GROUP BY o.`id_order` + ORDER BY o.`date_add` ASC'; + return Db::getInstance()->ExecuteS($sql); + } + +} + +?> diff --git a/modules/mondialrelay/config.xml b/modules/mondialrelay/config.xml new file mode 100755 index 000000000..b24aad687 --- /dev/null +++ b/modules/mondialrelay/config.xml @@ -0,0 +1,12 @@ + + + mondialrelay + Mondial Relay + 1.3 + Deliver in Relay points + + shipping_logistics + 1 + 1 + + \ No newline at end of file diff --git a/modules/mondialrelay/cron.php b/modules/mondialrelay/cron.php new file mode 100755 index 000000000..3e147a3ba --- /dev/null +++ b/modules/mondialrelay/cron.php @@ -0,0 +1,76 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once('../../config/config.inc.php'); +include_once('mondialrelay.php'); + +if (Tools::getValue('secure_key') != Configuration::get('MONDIAL_RELAY_SECURE_KEY')) + exit; + +$expeditions = Db::getInstance()->ExecuteS(' +SELECT ms.`exp_number`, ms.`id_cart`, o.`id_order` +FROM `'._DB_PREFIX_.'mr_selected` ms +LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_cart` = ms.`id_cart`) +WHERE `exp_number` != 0'); + +if (empty($expeditions)) + exit; + +$params = array( +'Enseigne' => Configuration::get('MR_ENSEIGNE_WEBSERVICE'), +'Langue' => 'FR' +); + +require_once('kit_mondialrelay/tools/nusoap/lib/nusoap.php'); +$client_mr = new nusoap_client("http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL", true); +$client_mr->soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +foreach ($expeditions as $expedition) +{ + if ($expedition['id_order'] == NULL) + continue; + if (OrderHistory::getLastOrderState((int)($expedition['id_order']))->id == _PS_OS_DELIVERED_) + continue; + $params['Expedition'] = $expedition['exp_number']; + $params['Security'] = strtoupper(md5($params['Enseigne'].$params['Expedition'].'FR'.Configuration::get('MR_KEY_WEBSERVICE'))); + + $is_delivered = 0; + $result_mr = $client_mr->call('WSI2_TracingColisDetaille', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_TracingColisDetaille'); + if (isset($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'])) + foreach ($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'] as $result) + if (isset($result['Libelle']) AND $result['Libelle'] == 'COLIS LIVRÉ') + $is_delivered = 1; + + if ($is_delivered == 1) + { + $history = new OrderHistory(); + $history->id_order = (int)($expedition['id_order']); + $history->changeIdOrderState((int)(_PS_OS_DELIVERED_), (int)($expedition['id_order'])); + $history->addWithemail(); + } +} diff --git a/modules/mondialrelay/de.php b/modules/mondialrelay/de.php new file mode 100644 index 000000000..116da821f --- /dev/null +++ b/modules/mondialrelay/de.php @@ -0,0 +1,126 @@ +mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Liefern Sie in Relay-Punkten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Ungültiger Shop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Ungültiger Mark-Code'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Ungültiger Webservice Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Ungültige Sprache'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Ungültiger Gewichtskoeffizient'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Bitte konfigurieren Sie Ihre Mondial Relay-Konto-Einstellungen vor dem Erstellen eines Lieferanten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Ungültiger Lieferantennamen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Ungültiger Col-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Ungültiger Liefermodus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Ungültiger Assurance-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Sie müssen mindestens ein Zustellungsland angeben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Ungültiger Google-Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Ungültiger Bestellstatus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen erfolgreich aktualisiert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'Fehler'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Fehler'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Mondial Relay Bewertungsmodul konfigurieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'So erstellen Sie eine Mondial Relay Lieferanten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Geben Sie Ihre Mondial Relay-Konto-Einstellungen ein und speichern Sie sie'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_abfc836cd1df9d6d2bdfd2fc98e6fa93'] = 'Erstellen Sie einen Lieferanten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definieren Sie einen Preis für Ihren Lieferanten auf'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'Der Lieferanten-Seite'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Um Labels zu generieren, müssen Sie eine gültige und registrierte Adresse Ihres Shops auf Ihrer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'Kontakt-Seite haben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ddcd6a653f661fd7d219d9102528b917'] = 'Gehen Sie zum Front-Office'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL Cron Task:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Löschen erfolgreich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Fügen Sie eine Versandart hinzu'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Lieferantenname'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Sammel-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Sammeln im Shop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Liefer-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Lieferung an einen Abholpunkt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Colis Drive Lieferung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Hauslieferung RDC (1 Person)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Besondere Hauslieferung (2 Personen)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Versicherung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Keine Versicherung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Zusatzversicherung Lv1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Zusatzversicherung Lv2'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Zusatzversicherung Lv3'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Zusatzversicherung LV4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Zusatzversicherung Lv5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Zustellländer:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankreich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgien'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxemburg'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Spanien'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Erforderlich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Versandart-Liste'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Keine Versandmethoden erstellt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Versand konfigurieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Bestellstatus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Wählen Sie den Bestellstatus für Marken. Sie können die Marken auf'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'der Mondial Relay Verwaltungsseite verwalten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_235072af42d72915159f0e6c9d6a870c'] = 'Google map'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9c5c09beb32c36129b857c2a40c861b6'] = 'Anzeige einer Google-Karte auf Ihre Mondial Relay Lieferantenseite, kann das Laden der Lieferantenseite verlangsameN'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Mondial Relay Kontoeinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'mr_marke_WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'mr_code_marke:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'mr_Schlüssel_WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'mr_Sprache:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'mr_Gewicht_koef:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'Gramm = 1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Einstellungen aktualisieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nb Versand:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Label URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Follow-up-URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nb Abholpunkt:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9cdf0b8631b0d135ef44768cc424d544'] = 'Liste der Bestellungen erkannt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4049d979b8e6b7d78194e96c3208a5a5'] = 'Bestellnummer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a50294faa0cfee08fe40be721f30133'] = 'E-Mail senden an'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4fc57eaa6ec03268c66ec04f73061b1'] = 'A4 Label drucken'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00cbb0f772ad5239015b50943c0ecb58'] = 'A5 Label drucken'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e70c4df10ef0983b9c8c31bd06b2a2c3'] = 'zurück'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Alle Bestellungen mit dem Status'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Konfiguration ändern'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_37c85a61df6352af7285c307022c4413'] = 'Keine Bestellungen mit diesem Status.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d79cf3f429596f77db95c65074663a54'] = 'Bestell-ID'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Gesamtpreis'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Gesamt Versand'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cd39b9d34af50911ae8c8f9ee14efb90'] = 'Gewicht angeben (g)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Ausgewählt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6adf97f83acf6453d4a6a4b1070f3754'] = 'Keine'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d5fd1e99370b787c5eb9b85a5b321655'] = 'MR_Ausgewählt_Num'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d1ab466a78bba7ac6e114d76034bdcc9'] = 'MR_Ausgewählt_Land'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4757fb6030c29e81db89d241d4d9f12e'] = 'Versand_Nummer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Detail'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Generieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e94c1b8199a658f74a1a1bcde70ebd0b'] = 'Label Entstehungsgeschichte'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_caf49f04116e0708fd0e6de05c75da2e'] = 'Bestellungs-ID'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ac128fbba93b1642d2aebf21b4226c10'] = 'Exps num'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Löschen ausgewählter Vorgänge'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_03f4a47830f97377a35321051685071e'] = 'Geschlossen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_796c163589f295373e171842f37265d5'] = 'Mittwoch'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_621895c388c9bb22abbbc69fad001846'] = 'Diesen Abholpunkt wählen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c530987d533793b0f25fb18807b69cd'] = 'Um Label zu generieren, müssen Sie eine korrekte Adresse Ihres Shops registriert haben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_3d2da0d2e731d59465a92f13216cf82d'] = 'Die Kontaktseite'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06b3355cd8a61603396c7e453bdb1025'] = 'Leere Adresse: Sind Sie sicher, dass Sie eine gültige Adresse auf der Kontaktseite eingestellt haben?'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2f84f9d5731852c4d07d52ef0badc42e'] = 'Problem beim Lesen der Adressen aus MondialRelay Webservice: Mondial Relay-Server kann abgeschaltet sein'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_21034ae6d01a83e702839a72ba8a77b0'] = '(zzgl. MwSt.).'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e7a6ca4e744870d455a57b644f696457'] = 'Kostenlos!'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Lieferung an'; diff --git a/modules/mondialrelay/en.php b/modules/mondialrelay/en.php new file mode 100755 index 000000000..957e3610a --- /dev/null +++ b/modules/mondialrelay/en.php @@ -0,0 +1,9 @@ +mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Webservice Enseigne:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Code marque:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Webservice Key:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Etiquette\'s Language:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Weight Coefficient:'; diff --git a/modules/mondialrelay/es.php b/modules/mondialrelay/es.php new file mode 100644 index 000000000..94ea02e4d --- /dev/null +++ b/modules/mondialrelay/es.php @@ -0,0 +1,126 @@ +mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Entregue sus envíos en un punto de recogida '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Tienda no válida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Código Marca no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Clave Webservice no válida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Idioma no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coeficiente de peso no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Antes de crear un transportista, debe configurar los parámetros de su cuenta Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nombre del transportista no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Modo Col no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Modo de entrega no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Seguro no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Debe elegir al menos un país de entrega'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Clave Google no válida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Estado de pedido no válido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Se ha actualizado con éxito'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'errores'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'error'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuración del módulo Relay Rate'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Para crear un transportista Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Introduzca y guarde los parámetros de la cuenta Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_abfc836cd1df9d6d2bdfd2fc98e6fa93'] = 'Crear un transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Deafina un precio para sus transportista en'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'La página de transportistas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Para generar sus etiquetas, debe haber introducido una dirección correcta de su tienda en'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'página contacto'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ddcd6a653f661fd7d219d9102528b917'] = 'Ir a ver en el Front Office'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL del cron para lanzar la actualización de los pedidos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Borrado con éxito'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Añadir un transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Nombre del transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Modo de recogida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Recogida en la tienda'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Modo de entraga'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Entrega en Punto de recogida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Entrega Colis Drive'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Entrega a domicilio RDC (1 persona)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Entrega a domicilio especializada (2 personas)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Seguro'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Sin seguro'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Seguro complementario N1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Seguro complementario N2'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Seguro complementario N3'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Seguro complementario N4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Seguro complementario N5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Lista de países :'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Bélgica'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxemburgo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'España'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Campo obligatorio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Lista de transportistas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'No se ha creado ningún transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Configuración transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Estado de los pedidos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Elija un estado para generar etiquetas. Puede administrar sus etiquetas en'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'la página de administración de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_235072af42d72915159f0e6c9d6a870c'] = 'Google map'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9c5c09beb32c36129b857c2a40c861b6'] = 'Muestra un Google map en su transportista Mondial Relay, pero la página de selección del transportista puede ralentizarse.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Parámetros de la cuenta Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Tienda WebService '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Código marca:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Clave Webservice:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Idioma:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Coeficinte de peso:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'gramos = 1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Guardar cambios'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Número de expediciones'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL de las etiquetas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL de los seguimientos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Número de puntos recogida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9cdf0b8631b0d135ef44768cc424d544'] = 'Lista de los pedidos reconocidos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4049d979b8e6b7d78194e96c3208a5a5'] = 'Número de pedidos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a50294faa0cfee08fe40be721f30133'] = 'Email enviado a '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4fc57eaa6ec03268c66ec04f73061b1'] = 'Imprimir la etiqueta en formato A4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00cbb0f772ad5239015b50943c0ecb58'] = 'Imprimir la etiqueta en formato A5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e70c4df10ef0983b9c8c31bd06b2a2c3'] = 'Volver a la página etiquetas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Todos los pedidos que tienen el estado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Cambiar la configuración'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_37c85a61df6352af7285c307022c4413'] = 'No hay pedidos con ese estado.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d79cf3f429596f77db95c65074663a54'] = 'ID del pedido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Precio Total'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Precio del transportista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cd39b9d34af50911ae8c8f9ee14efb90'] = 'Indique un peso (gramos)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Seleccionar'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todos'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6adf97f83acf6453d4a6a4b1070f3754'] = 'Ninguno'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d5fd1e99370b787c5eb9b85a5b321655'] = 'Número seleccionado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d1ab466a78bba7ac6e114d76034bdcc9'] = 'País seleccionado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4757fb6030c29e81db89d241d4d9f12e'] = 'Número de expediciones'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Detalle'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Vista'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Generar'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e94c1b8199a658f74a1a1bcde70ebd0b'] = 'Historial de creaciones de etiquetas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_caf49f04116e0708fd0e6de05c75da2e'] = 'ID del pedido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ac128fbba93b1642d2aebf21b4226c10'] = 'Número de expedición'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Suprimir el historial seleccionado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_03f4a47830f97377a35321051685071e'] = 'Cerrado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5792315f09a5d54fb7e3d066672b507f'] = 'Martes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_796c163589f295373e171842f37265d5'] = 'Miércoles'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_78ae6f0cd191d25147e252dc54768238'] = 'Jueves'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sábado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_621895c388c9bb22abbbc69fad001846'] = 'Seleccionar este punto de recogida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c530987d533793b0f25fb18807b69cd'] = 'Para generar las etiquetas, debe tener registrada una dirección correcta de su tienda en'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_3d2da0d2e731d59465a92f13216cf82d'] = 'La página señas'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06b3355cd8a61603396c7e453bdb1025'] = 'Dirección vacía: ¿está seguro de haber introducio una dirección válida en la página Señas?'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2f84f9d5731852c4d07d52ef0badc42e'] = 'Problemas para obtener las direcciones de servicio web MondialRelay: los servidores de Mondial Relay pueden estar fuera de servicio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_21034ae6d01a83e702839a72ba8a77b0'] = '(sin IVA)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1f87346a16cf80c372065de3c54c86d9'] = '(IVA incluido)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e7a6ca4e744870d455a57b644f696457'] = '¡Gratis!'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Entregado a'; diff --git a/modules/mondialrelay/fr.php b/modules/mondialrelay/fr.php new file mode 100755 index 000000000..6df6c8d37 --- /dev/null +++ b/modules/mondialrelay/fr.php @@ -0,0 +1,128 @@ +mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Livrez vos colis en point relais'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Enseigne invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Code Marque invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Clé Webservice invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Langage invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coefficient de poids invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Configurez d\'abord vos paramètres de compte Mondial Relay avant de créer un transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nom de transporteur invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Col Mode invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Mode de livraison invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Assurance invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Vous devez choisir au moins un pays de livraison'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Clé google invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Etat de commande invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour avec succès'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'erreurs'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'erreur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuration du Module Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Pour créer un transporteur Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Remplissez et sauvegarder vos paramètres Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_abfc836cd1df9d6d2bdfd2fc98e6fa93'] = 'Créez un transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definissez un prix pour votre transporteur sur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'La page Transporteurs'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Pour générer vos étiquettes, vous devez avoir enregistré une adresse valide de votre boutique sur votre'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'page contact'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ddcd6a653f661fd7d219d9102528b917'] = 'Aller sur le Front-office'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL de la tache CRON à lancer pour la mise à jour des statuts de commandes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Suppression effectuée'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Ajouter un transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Nom du transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Mode de collecte'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Collecte à l\'enseigne'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Mode de livraison'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Livraison dans un point relais'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Livraison Colis Drive'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Livraison à domicile RDC (1 personne)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Livraison à domicile spécialisée (2 personnes)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Assurance'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Défaut, pas d\'assurance complémentaire'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Assurance complémentaire N1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Assurance complémentaire N2'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Assurance complémentaire N3'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Assurance complémentaire N4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Assurance complémentaire N5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Pays de livraison :'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Vous pouvez choisir plusieurs pays en appuyant sur Ctrl tout en sélectionnant les pays'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'France'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgique'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxembourg'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Espagne'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Champ obligatoire'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Liste des tranporteurs'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Aucun transporteur créé'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Modification de la configuration'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Etat des commandes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Choississez le statut pour la génération d\'étiquette. Vous pouvez administrer vos étiquettes sur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'la page d\'administration de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_235072af42d72915159f0e6c9d6a870c'] = 'Google map'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9c5c09beb32c36129b857c2a40c861b6'] = 'Affiche une Google map sur votre transporteur Mondial Relay, mais votre page de sélection du transporteur peut devenir plus lente.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Paramètres du compte Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Enseigne Webservice:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Code marque:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Clé Webservice:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Langage:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Coefficient de Poids:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'grammes = 1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Enregistrer les modifications'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nombre d\'expéditions'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL des étiquettes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL du suivi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nombre de Points Relais'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9cdf0b8631b0d135ef44768cc424d544'] = 'Liste des commandes reconnues'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4049d979b8e6b7d78194e96c3208a5a5'] = 'Nombre de commandes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a50294faa0cfee08fe40be721f30133'] = 'E-mail envoyé à'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4fc57eaa6ec03268c66ec04f73061b1'] = 'Imprimer l\'étiquette au format A4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00cbb0f772ad5239015b50943c0ecb58'] = 'Imprimer l\'étiquette au format A5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e70c4df10ef0983b9c8c31bd06b2a2c3'] = 'Retour à la page étiquette'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Toutes les commandes qui ont le statut'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Changer la configuration'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_37c85a61df6352af7285c307022c4413'] = 'Pas de commandes avec ce statut.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d79cf3f429596f77db95c65074663a54'] = 'ID commande'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Prix Total'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Prix du transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cd39b9d34af50911ae8c8f9ee14efb90'] = 'Mettez un poids (grammes)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Selectionner'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tous'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6adf97f83acf6453d4a6a4b1070f3754'] = 'Aucun'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d5fd1e99370b787c5eb9b85a5b321655'] = 'Numéro sélectionné'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d1ab466a78bba7ac6e114d76034bdcc9'] = 'Pays sélectionné'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4757fb6030c29e81db89d241d4d9f12e'] = 'Numéro d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Détail'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Vue'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Générer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e94c1b8199a658f74a1a1bcde70ebd0b'] = 'Historique de création des étiquettes'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_caf49f04116e0708fd0e6de05c75da2e'] = 'ID commande'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ac128fbba93b1642d2aebf21b4226c10'] = 'Numéro d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Supprimer l\'historique sélectionnée'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_03f4a47830f97377a35321051685071e'] = 'Fermé'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_621895c388c9bb22abbbc69fad001846'] = 'Selectionnez ce Point Relais'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c530987d533793b0f25fb18807b69cd'] = 'Pour générer vos étiquettes, vous devez avoir enregistrer une adresse correcte de votre boutique sur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_3d2da0d2e731d59465a92f13216cf82d'] = 'La page Coordonnées'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06b3355cd8a61603396c7e453bdb1025'] = 'Adresse vide : Êtes-vous sûr d\'avoir saisi une adresse valide sur la page coordonnées ?'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2f84f9d5731852c4d07d52ef0badc42e'] = 'Mondial Relay est inaccessible'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_016854c68c7122b18d89ff0f5e40502b'] = 'Il n\'y a pas de point relais à proximité de votre adresse, veuillez changer votre adresse ou utiliser un autre transporteur'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_21034ae6d01a83e702839a72ba8a77b0'] = 'HT'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Livraison à'; diff --git a/modules/mondialrelay/googlemap.php b/modules/mondialrelay/googlemap.php new file mode 100755 index 000000000..bb3c4c6c0 --- /dev/null +++ b/modules/mondialrelay/googlemap.php @@ -0,0 +1,111 @@ + + + + +
        + + + + recherche_MR(\'relativ_base_dir='.$_GET['relativ_base_dir'].'&Pays='.$_GET['Pays'].'&Ville='.$_GET['Ville'].'&CP='.$_GET['CP'].'&Taille=&Poids='.$_GET['Poids'].'&Action='.$_GET['Action'].'&num='.$_GET['num'].'\'); + + window.onload = function() + { + var cpt = 0; + google_map_init(); + if (json_addresses && json_addresses.addresses) + while (json_addresses.addresses[cpt]) + { + if (json_addresses.addresses[cpt].address3.length) + { + address_google = json_addresses.addresses[cpt].address3+\' \'+json_addresses.addresses[cpt].postcode+\' \'+json_addresses.addresses[cpt].city+\' \'+json_addresses.addresses[cpt].iso_country; + address = json_addresses.addresses[cpt].address1+\'
        \'+json_addresses.addresses[cpt].address2+\' \'+json_addresses.addresses[cpt].address3+\'
        \'+json_addresses.addresses[cpt].postcode+\' \'+json_addresses.addresses[cpt].city+\' \'+json_addresses.addresses[cpt].iso_country; + codeAddress(address, address_google); + } + cpt++; + } + } +'; +?> diff --git a/modules/mondialrelay/it.php b/modules/mondialrelay/it.php new file mode 100644 index 000000000..c27edc836 --- /dev/null +++ b/modules/mondialrelay/it.php @@ -0,0 +1,126 @@ +mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Consegna nei punti Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Negozio non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Codice marchio non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Chiave webservice non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Lingua non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coefficiente di peso non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Si prega di configurare le impostazioni dell\'account Mondial Relay prima di creare un corriere'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nome del corriere non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Col mode non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Modalità di consegna non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Modalità di garanzia non valida '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'È necessario scegliere almeno un paese di consegna'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Chiave Google non valida '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Stato dell\'ordine non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate con successo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'errori'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'errore'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configura del Modulo Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Per creare un corriere Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Inserisci e salva le impostazioni dell\'account Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_abfc836cd1df9d6d2bdfd2fc98e6fa93'] = 'Crea un corriere'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definisci un prezzo per il tuo corriere'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'Pagina corriere'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Per generare le etichette, è necessario disporre di un indirizzo valido e registrato per il tuo negozio sulla tua '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'pagina contatti'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ddcd6a653f661fd7d219d9102528b917'] = 'Vai al front office'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL Cron task:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Cancellazione riuscita'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Aggiungere un metodo di spedizione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'il nome del corriere'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Modalità di raccolta'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Raccolta presso il negozio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Modalità di consegna'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'La consegna a un relay point'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Consegna Colis Drive '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Consegna a domicilio RDC (1 persona)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Speciale a domicilio (2 persone)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Assicurazioni'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Nessuna assicurazione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Assicurazione complementare LV1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Assicurazione complementare LV2'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Assicurazione complementare LV3'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Assicurazione complementare LV4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Assicurazione complementare LV5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Consegna nei paesi:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Lussemburgo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Spagna'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Obbligatorio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Elenco metodo di spedizione '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Nessun metodo di spedizione creato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Config di spedizione.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Stato ordine'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Scegli lo stato dell\'ordine per le etichette. È possibile gestire le etichette'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'pagina di amministrazione Mondial Relay '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_235072af42d72915159f0e6c9d6a870c'] = 'Google map'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9c5c09beb32c36129b857c2a40c861b6'] = 'Visualizza una mappa di Google sul tuo operatore Mondial Relay, può rallentare il caricamento della pagina del corriere '; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Impostazioni account Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Insegna WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Codice marchio:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Chiave WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Lingua:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Coeff. peso:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'grammi = 1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Aggiorna impostazioni'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'N. di spedizione:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Etichetta URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Follow-up URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'N. Point Relay:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9cdf0b8631b0d135ef44768cc424d544'] = 'Elenco degli ordini riconosciuto'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4049d979b8e6b7d78194e96c3208a5a5'] = 'Numero di ordinazione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a50294faa0cfee08fe40be721f30133'] = 'Invia e-mail a'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4fc57eaa6ec03268c66ec04f73061b1'] = 'Stampa Etichetta A4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_00cbb0f772ad5239015b50943c0ecb58'] = 'Stampa Etichetta A5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e70c4df10ef0983b9c8c31bd06b2a2c3'] = 'ritorno'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Tutti gli ordini che hanno lo stato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Modificare la configurazione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_37c85a61df6352af7285c307022c4413'] = 'Nessun ordine con questo stato.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Prezzo totale'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Totale spedizione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cd39b9d34af50911ae8c8f9ee14efb90'] = 'Inserisci un peso (grammi)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Selezionato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutti'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6adf97f83acf6453d4a6a4b1070f3754'] = 'Nessuno'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d5fd1e99370b787c5eb9b85a5b321655'] = 'Num. selezionato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d1ab466a78bba7ac6e114d76034bdcc9'] = 'Paese selezionato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4757fb6030c29e81db89d241d4d9f12e'] = 'N. spedizione'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Dettaglio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Generare'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e94c1b8199a658f74a1a1bcde70ebd0b'] = 'Cronologia creazione etichetta'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_caf49f04116e0708fd0e6de05c75da2e'] = 'ID ordini'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ac128fbba93b1642d2aebf21b4226c10'] = 'N. spedizioni'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Eliminare la cronologia selezionata'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_03f4a47830f97377a35321051685071e'] = 'Chiuso'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunedi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5792315f09a5d54fb7e3d066672b507f'] = 'Martedì'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_796c163589f295373e171842f37265d5'] = 'Mercoledì'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_78ae6f0cd191d25147e252dc54768238'] = 'Giovedi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c33b138a163847cdb6caeeb7c9a126b4'] = 'Venerdì'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domenica'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_621895c388c9bb22abbbc69fad001846'] = 'Seleziona questo Relay Point'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c530987d533793b0f25fb18807b69cd'] = 'Per generare le etichette, è necessario avere registrato un indirizzo corretto del tuo negozio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_3d2da0d2e731d59465a92f13216cf82d'] = 'La pagina contatti'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06b3355cd8a61603396c7e453bdb1025'] = 'Svuotare indirizzo: Sei sicuro di aver impostato un indirizzo valido nella pagina di contatto?'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2f84f9d5731852c4d07d52ef0badc42e'] = 'Problema per ottenere gli indirizzi da MondialRelay Webservice: i server di Mondial Relay potrebbero essere inattivi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_21034ae6d01a83e702839a72ba8a77b0'] = '(Tasse escl.)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1f87346a16cf80c372065de3c54c86d9'] = '(Tasse incl.)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Consegna a'; diff --git a/modules/mondialrelay/kit_mondialrelay/CreationEtiquettePointRelais_ajax.php b/modules/mondialrelay/kit_mondialrelay/CreationEtiquettePointRelais_ajax.php new file mode 100755 index 000000000..8c125a6f7 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/CreationEtiquettePointRelais_ajax.php @@ -0,0 +1,225 @@ +soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +$params = array( +'Enseigne' => _Enseigne_webservice, +'ModeCol' => $var_ModeCol, +'ModeLiv' => $var_ModeLiv, +'NDossier' => $var_NDossier, +'NClient' => $var_NClient, +'Expe_Langage' => $var_Expe_Langage, +'Expe_Ad1' => $var_Expe_Ad1, +'Expe_Ad2' => $var_Expe_Ad2, +'Expe_Ad3' => $var_Expe_Ad3, +'Expe_Ad4' => $var_Expe_Ad4, +'Expe_Ville' => $var_Expe_Ville, +'Expe_CP' => $var_Expe_CP, +'Expe_Pays' => $var_Expe_Pays, +'Expe_Tel1' => $var_Expe_Tel1, +'Expe_Tel2' => $var_Expe_Tel2, +'Expe_Mail' => $var_Expe_Mail, +'Dest_Langage' => $var_Dest_Langage, +'Dest_Ad1' => $var_Dest_Ad1, +'Dest_Ad2' => $var_Dest_Ad2, +'Dest_Ad3' => $var_Dest_Ad3, +'Dest_Ad4' => $var_Dest_Ad4, +'Dest_Ville' => $var_Dest_Ville, +'Dest_CP' => $var_Dest_CP, +'Dest_Pays' => $var_Dest_Pays, +'Dest_Tel1' => $var_Dest_Tel1, +'Dest_Tel2' => $var_Dest_Tel2, +'Dest_Mail' => $var_Dest_Mail, +'Poids' => $var_Poids, +'Longueur' => $var_Longueur, +'Taille' => $var_Taille, +'NbColis' => $var_NbColis, +'CRT_Valeur' => $var_CRT_Valeur, +'CRT_Devise' => $var_CRT_Devise, +'Exp_Valeur' => $var_Exp_Valeur, +'Exp_Devise' => $var_Exp_Devise, +'LIV_Rel_Pays' => $var_LIV_Rel_Pays, +'LIV_Rel' => $var_LIV_Rel, +'Assurance' => $var_Assurance, +'Instructions' => $var_Instructions, +'Security' => $k_security, +'Texte' => $var_Texte, +); + + +$sortie=''; + +$result_mr = $client_mr->call('WSI2_CreationEtiquette', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_CreationEtiquette'); +if ($client_mr->fault) +{ + $sortie.='a|

        Fault (Expect - The request contains an invalid SOAP body)

        '; + $sortie.=print_r($result_mr); + $sortie.=''; +} +else +{ + $err = $client_mr->getError(); + if ($err) { $sortie.='a|

        Error

        ' . $err.' 
        '; } + else + { + $var_Expedition=$result_mr['WSI2_CreationEtiquetteResult']['ExpeditionNum']; + $k_security=strtoupper(md5('<'._Enseigne_webservice._Code_Marque.'>'.$var_Expedition.'<'._Key_webservice.'>')); + $sortie.=$result_mr['WSI2_CreationEtiquetteResult']['STAT'].'|'; + if($result_mr['WSI2_CreationEtiquetteResult']['STAT']==0) + { + $sortie.=$result_mr['WSI2_CreationEtiquetteResult']['ExpeditionNum'].'|'; + $sortie.='http://www.mondialrelay.fr'.$result_mr['WSI2_CreationEtiquetteResult']['URL_Etiquette'].'|'; + $sortie.='http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq='._Enseigne_webservice._Code_Marque.'&nexp='.$var_Expedition.'&crc='.$k_security; + } + else + $sortie.=mb_convert_encoding(error_message_MR($result_mr['WSI2_CreationEtiquetteResult']['STAT']), 'UTF-8', 'ISO-8859-15' ).'|'; + } +} +echo ':THISTAG:'.$sortie.':THISTAG:'; + +function error_message_MR($etat) +{ +if($etat=='a') {return "Rsultat vide";} +if($etat==1) {return "Enseigne invalide";} +if($etat==2) {return "Numro d'enseigne vide ou inexistant";} +if($etat==3) {return "Numro de compte enseigne invalide";} +if($etat==5) {return "Numro de dossier enseigne invalide";} +if($etat==7) {return "Numro de client enseigne invalide";} +if($etat==9) {return "Nom de ville non reconnu ou non unique";} +if($etat==10) {return "Type de collecte invalide ou incorrect (1/D > Domicile -- 3/R > Relais)";} +if($etat==11) {return "Numro de Point Relais de collecte invalide";} +if($etat==12) {return "Pays du Point Relais de collecte invalide";} +if($etat==13) {return "Type de livraison invalide ou incorrect (1/D > Domicile -- 3/R > Relais)";} +if($etat==14) {return "Numro du Point Relais de livraison invalide";} +if($etat==15) {return "Pays du Point Relais de livraison invalide";} +if($etat==16) {return "Code pays invalide";} +if($etat==17) {return "Adresse invalide";} +if($etat==18) {return "Ville invalide";} +if($etat==19) {return "Code postal invalide";} +if($etat==20) {return "Poids du colis invalide";} +if($etat==21) {return "Taille (Longueur + Hauteur) du colis invalide";} +if($etat==22) {return "Taille du Colis invalide";} +if($etat==24) {return "Numro de Colis Mondial Relay invalide";} +if($etat==28) {return "Mode de collecte invalide";} +if($etat==29) {return "Mode de livraison invalide";} +if($etat==30) {return "Adresse (L1) de l'expditeur invalide";} +if($etat==31) {return "Adresse (L2) de l'expditeur invalide";} +if($etat==33) {return "Adresse (L3) de l'expditeur invalide";} +if($etat==34) {return "Adresse (L4) de l'expditeur invalide";} +if($etat==35) {return "Ville de l'expditeur invalide";} +if($etat==36) {return "Code postal de l'expditeur invalide";} +if($etat==37) {return "Pays de l'expditeur invalide";} +if($etat==38) {return "Numro de tlphone de l'expditeur invalide";} +if($etat==39) {return "Adresse e-mail de l'expditeur invalide";} +if($etat==40) {return "Action impossible sans ville ni code postal";} +if($etat==41) {return "Mode de livraison invalide";} +if($etat==42) {return "Montant CRT invalide";} +if($etat==43) {return "Devise CRT invalide";} +if($etat==44) {return "Valeur du colis invalide";} +if($etat==45) {return "Devise de la valeur du colis invalide";} +if($etat==46) {return "Plage de numro d'expdition puise";} +if($etat==47) {return "Nombre de colis invalide";} +if($etat==48) {return "Multi-colis en Point Relais Interdit";} +if($etat==49) {return "Mode de collecte ou de livraison invalide";} +if($etat==50) {return "Adresse (L1) du destinataire invalide";} +if($etat==51) {return "Adresse (L2) du destinataire invalide";} +if($etat==53) {return "Adresse (L3) du destinataire invalide";} +if($etat==54) {return "Adresse (L4) du destinataire invalide";} +if($etat==55) {return "Ville du destinataire invalide";} +if($etat==56) {return "Code postal du destinataire invalide";} +if($etat==57) {return "Pays du destinataire invalide";} +if($etat==58) {return "Numro de tlphone du destinataire invalide";} +if($etat==59) {return "Adresse e-mail du destinataire invalide";} +if($etat==60) {return "Champ texte libre invalide";} +if($etat==61) {return "Top avisage invalide";} +if($etat==62) {return "Instruction de livraison invalide";} +if($etat==63) {return "Assurance invalide ou incorrecte";} +if($etat==64) {return "Temps de montage invalide";} +if($etat==65) {return "Top rendez-vous invalide";} +if($etat==66) {return "Top reprise invalide";} +if($etat==70) {return "Numro de Point Relais invalide";} +if($etat==72) {return "Langue expditeur invalide";} +if($etat==73) {return "Langue destinataire invalide";} +if($etat==74) {return "Langue invalide";} +if($etat==80) {return "Code tracing : Colis enregistr";} +if($etat==81) {return "Code tracing : Colis en traitement chez Mondial Relay";} +if($etat==82) {return "Code tracing : Colis livr";} +if($etat==83) {return "Code tracing : Anomalie";} +if($etat==84) {return "84 (Rserv Code Tracing)";} +if($etat==85) {return "85 (Rserv Code Tracing)";} +if($etat==86) {return "86 (Rserv Code Tracing)";} +if($etat==87) {return "87 (Rserv Code Tracing)";} +if($etat==88) {return "88 (Rserv Code Tracing)";} +if($etat==89) {return "89 (Rserv Code Tracing)";} +if($etat==90) {return "AS400 indisponible";} +if($etat==91) {return "Numro d'expdition invalide";} +if($etat==93) {return "Aucun lment retourn par le plan de tri + Si vous effectuez une collecte ou une livraison en Point Relais, vrifiez que les + Point Relais sont bien disponibles. + Si vous effectuez une livraison domicile, il est probable que le code postal que + vous avez indiquez n'existe pas.";} +if($etat==94) {return "Colis Inexistant";} +if($etat==95) {return "Compte Enseigne non activ";} +if($etat==96) {return "Type d'enseigne incorrect en Base";} +if($etat==97) {return "Cl de scurit invalide";} +if($etat==98) {return "Service Indisponible";} +if($etat==99) {return "Erreur gnrique du service + Cette erreur peut tre d autant un problme technique du service qu' des + donnes incorrectes ou inexistantes dans la Base de Donnes. Lorsque vous avez + cette erreur veuillez la notifier Mondial Relay en prcisant la date et l'heure de la + connexion ainsi que les informations envoys au WebService afin d'effectuer une + vrification.";} +}; +?> diff --git a/modules/mondialrelay/kit_mondialrelay/ImpressionEtiquettePointRelais_ajax.php b/modules/mondialrelay/kit_mondialrelay/ImpressionEtiquettePointRelais_ajax.php new file mode 100755 index 000000000..eae59fd79 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/ImpressionEtiquettePointRelais_ajax.php @@ -0,0 +1,43 @@ +soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +$params = array( +'Enseigne' => _Enseigne_webservice, +'Expeditions' => $var_Expeditions, +'Langue' => $var_Langue, +'Security' => $k_security, +); + +$sortie=''; +$result_mr = $client_mr->call('WSI2_GetEtiquettes', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_GetEtiquettes'); +if ($client_mr->fault) +{ +$sortie.='a|

        Fault (Expect - The request contains an invalid SOAP body)

        '; +$sortie.=print_r($result); +$sortie.=''; +} else +{ +$err = $client_mr->getError(); +if ($err) { $sortie.='a|

        Error

        ' . $err . '
        '; } +else +{ +$sortie.=$result_mr['WSI2_GetEtiquettesResult']['STAT'].'|'; +$sortie.='http://www.mondialrelay.fr'.$result_mr['WSI2_GetEtiquettesResult']['URL_PDF_A4'].'|'; +$sortie.='http://www.mondialrelay.fr'.$result_mr['WSI2_GetEtiquettesResult']['URL_PDF_A5'].'|'; +} +} +echo ':THISTAG:'.$sortie.':THISTAG:'; diff --git a/modules/mondialrelay/kit_mondialrelay/MR.gif b/modules/mondialrelay/kit_mondialrelay/MR.gif new file mode 100755 index 000000000..aff6ee744 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/MR.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/MR_small.gif b/modules/mondialrelay/kit_mondialrelay/MR_small.gif new file mode 100755 index 000000000..571069d57 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/MR_small.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/RechercheDetailPointRelais_ajax.php b/modules/mondialrelay/kit_mondialrelay/RechercheDetailPointRelais_ajax.php new file mode 100755 index 000000000..3ce21c0d0 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/RechercheDetailPointRelais_ajax.php @@ -0,0 +1,151 @@ +getL('Closed');} else {$p1=$o1.' - '.$f1;}; +if ($o2=='00:00' && $f2=='00:00') {$p2=$mondialrelay->getL('Closed');} else {$p2=$o2.' - '.$f2;}; +if ($p1=='Ferm' && $p2=='Ferm' ) {$p=$mondialrelay->getL('Closed');} else {$p=$p1.'  '.$p2;}; +return utf8_encode($p); +}; + + + + + +$k_security=strtoupper(md5(_Enseigne_webservice.$client_Num.$client_Pays._Key_webservice)); + +require_once('tools/nusoap/lib/nusoap.php'); +$client_mr = new nusoap_client("http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL",true); + +$client_mr->soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +$params = array( +'Enseigne' => _Enseigne_webservice, +'Num' => $client_Num, +'Pays' => $client_Pays, +'Security' => $k_security, +); + + + + +$result_mr = $client_mr->call('WSI2_DetailPointRelais', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_DetailPointRelais'); +if ($client_mr->fault) +{ +echo 'a|

        Fault (Expect - The request contains an invalid SOAP body)

        ';
        +print_r($result);
        +echo '
        |'.$num; +} else +{ +$err = $client_mr->getError(); +if ($err) { echo 'a|

        Error

        ' . $err . '
        |'.$num; } +else +{ +$sortie_titre=""; +$sortie_loc=""; +$sortie_info=""; +$sortie_photo=""; +$sortie_plan=""; +$sortie_horaires=""; +echo $result_mr['WSI2_DetailPointRelaisResult']['STAT'].'|'; + + +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Monday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Lundi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Lundi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Lundi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Lundi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Tuesday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mardi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mardi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mardi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mardi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Wednesday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mercredi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mercredi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mercredi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Mercredi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Thursday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Jeudi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Jeudi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Jeudi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Jeudi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Friday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Vendredi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Vendredi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Vendredi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Vendredi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Saturday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Samedi']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Samedi']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Samedi']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Samedi']['string'][3]).""; +$sortie_horaires.=""; +$sortie_horaires.="".$mondialrelay->getL('Sunday').""; +$sortie_horaires.="".mr_horaire_fr($result_mr['WSI2_DetailPointRelaisResult']['Horaires_Dimanche']['string'][0],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Dimanche']['string'][1],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Dimanche']['string'][2],$result_mr['WSI2_DetailPointRelaisResult']['Horaires_Dimanche']['string'][3]).""; +$sortie_horaires.=""; + +$sortie_horaires="".$sortie_horaires."
        "; + + +$sortie_titre.="".$result_mr['WSI2_DetailPointRelaisResult']['LgAdr1'].""; +if ($result_mr['WSI2_DetailPointRelaisResult']['LgAdr2']!='') {$sortie_titre.="
        ".$result_mr['WSI2_DetailPointRelaisResult']['LgAdr2'];}; +if ($result_mr['WSI2_DetailPointRelaisResult']['LgAdr3']!='') {$sortie_titre.="
        ".$result_mr['WSI2_DetailPointRelaisResult']['LgAdr3'];}; +if ($result_mr['WSI2_DetailPointRelaisResult']['LgAdr4']!='') {$sortie_titre.="
        ".$result_mr['WSI2_DetailPointRelaisResult']['LgAdr4'];}; +if ($result_mr['WSI2_DetailPointRelaisResult']['CP']!='') {$sortie_titre.="
        ".$result_mr['WSI2_DetailPointRelaisResult']['CP'];}; +if ($result_mr['WSI2_DetailPointRelaisResult']['Ville']!='') {$sortie_titre.=" ".$result_mr['WSI2_DetailPointRelaisResult']['Ville'];}; +//if ($result_mr['WSI2_DetailPointRelaisResult']['Pays']!='') {$sortie_titre.=" - ".$result_mr['WSI2_DetailPointRelaisResult']['Pays'];}; +$sortie_titre="

        ".$sortie_titre."

        "; + + +if ($result_mr['WSI2_DetailPointRelaisResult']['Localisation1']!='') {$sortie_loc.=$result_mr['WSI2_DetailPointRelaisResult']['Localisation1'];}; +if ($result_mr['WSI2_DetailPointRelaisResult']['Localisation2']!='') {$sortie_loc.="
        ".$result_mr['WSI2_DetailPointRelaisResult']['Localisation2'];}; +if ($sortie_loc!="") {$sortie_loc="

        ".$sortie_loc."

        ";} + +if ($result_mr['WSI2_DetailPointRelaisResult']['Information']!='') {$sortie_info="

        ".$result_mr['WSI2_DetailPointRelaisResult']['Information']."

        ";}; + + +if ($result_mr['WSI2_DetailPointRelaisResult']['URL_Photo']!='') {$sortie_photo="";}; +if ($result_mr['WSI2_DetailPointRelaisResult']['URL_Plan']!='') {$sortie_plan.="";}; +$fermer=""; + + +echo "
        ".$fermer."
        +
        + + + + + + + +

        Votre Point Relais

        +
        ".utf8_encode($sortie_titre.$sortie_loc.$sortie_info)."

        + ".$sortie_plan." +
        + ".$sortie_horaires."
        ".$sortie_photo." +
        +
        getL('Select this Relay Point'))."\" type=\"button\" onclick=\" + document.getElementById('MRchoixRelais".$num.'_'.$result_mr['WSI2_DetailPointRelaisResult']['Num']."').checked=true;select_PR_MR('".$result_mr['WSI2_DetailPointRelaisResult']['Num']."','".$num."');masque_recherche_MR_detail('".$num."');\">
        +
        |".$num; + + +} +} +?> diff --git a/modules/mondialrelay/kit_mondialrelay/RecherchePointRelais_ajax.php b/modules/mondialrelay/kit_mondialrelay/RecherchePointRelais_ajax.php new file mode 100755 index 000000000..c3af53865 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/RecherchePointRelais_ajax.php @@ -0,0 +1,102 @@ +getValue('SELECT `MR_Selected_Num` FROM `'._DB_PREFIX_.'mr_selected` WHERE `id_cart` = '.$cookie->id_cart); + +$mondialrelay = new MondialRelay(); + +DEFINE('_Enseigne_webservice', Configuration::get('MR_ENSEIGNE_WEBSERVICE')); +DEFINE('_Key_webservice', Configuration::get('MR_KEY_WEBSERVICE')); + +header('Content-Type: text/html; charset=utf-8'); + +$relativ_base_dir = $_POST['relativ_base_dir']; +$client_pays_iso = $_POST['Pays']; +$client_ville = $_POST['Ville']; +$client_cp = $_POST['CP']; +$card_taille = $_POST['Taille']; +$card_weight = $_POST['Poids']; +$client_type_exp = $_POST['Action']; +$num = $_POST['num']; + + +$k_security = strtoupper(md5(_Enseigne_webservice.$client_pays_iso.$client_ville.$client_cp.$card_taille.$card_weight.$client_type_exp._Key_webservice)); + +require_once('tools/nusoap/lib/nusoap.php'); +$client_mr = new nusoap_client("http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL", true); + +$client_mr->soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +$params = array( +'Enseigne' => _Enseigne_webservice, +'Pays' => $client_pays_iso, +'Ville' => $client_ville, +'CP' => $client_cp, +'Taille' => '', +'Poids' => $card_weight, +'Action' => $client_type_exp, +'Security' => $k_security, +); + +$result_mr = $client_mr->call('WSI2_RecherchePointRelais', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_RecherchePointRelais'); +if ($client_mr->fault) +{ + echo 'a|

        Fault (Expect - The request contains an invalid SOAP body)

        ';
        +	print_r($result);
        +	echo '
        |'.$num; +} +else +{ + $err = $client_mr->getError(); + if ($err) + echo '{"error" : "'.$err.'"}'; + else if (($code = $result_mr['WSI2_RecherchePointRelaisResult']['STAT']) != 0) + echo '{"statError": {"code": "'.$code.'", "msg": "'. + (array_key_exists($code, $statCode)) ? $statCode[$code] : 'Unknown error'.'}}'; + else + { + $tr = ""; + echo '{'; + for ($i = 1; $i <= 10; $i++) + { + //if ($i==1) {$checked="checked=\"checked\"" ;} else {$checked="";}; + if($i < 10) + $l = '0'.$i; + else + $l = '10'; + $numWSI2 = $result_mr['WSI2_RecherchePointRelaisResult']['PR'.$l]['Num']; + } + + echo '"base_dir" : "'.$relativ_base_dir.'", '; + echo '"addresses" : ['; + $i = 0; + $total = count($result_mr['WSI2_RecherchePointRelaisResult'] ); + + foreach ($result_mr['WSI2_RecherchePointRelaisResult'] as $key => $val) + { + if ($key != 'STAT') + { + echo '{"address1" : "'.addslashes($val['LgAdr1']).'", + "address2" : "'.addslashes($val['LgAdr2']).'", + "address3" : "'.addslashes($val['LgAdr3']).'", + "address4" : "'.addslashes($val['LgAdr4']).'", + "postcode" : "'.addslashes($val['CP']).'", + "city" : "'.addslashes($val['Ville']).'", + "iso_country" : "'.addslashes($val['Pays']).'", + "num" : "'.$val['Num'].'", + "checked" : '.($val['Num'] == $id_cart_address ? 1 : 0).'}'.(($i + 1) == $total ? '' : ', '); + } + ++$i; + } + echo ']}'; + } +} +?> diff --git a/modules/mondialrelay/kit_mondialrelay/SuiviExpedition_ajax.php b/modules/mondialrelay/kit_mondialrelay/SuiviExpedition_ajax.php new file mode 100755 index 000000000..2c1a4879f --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/SuiviExpedition_ajax.php @@ -0,0 +1,6 @@ +'.$var_Expedition.'<'._Key_webservice.'>')); +echo 'http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq='._Enseigne_webservice.'&nexp='.$var_Expedition.'&crc='.$k_security; diff --git a/modules/mondialrelay/kit_mondialrelay/close.gif b/modules/mondialrelay/kit_mondialrelay/close.gif new file mode 100755 index 000000000..02de7f792 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/close.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/js/include_MR.js b/modules/mondialrelay/kit_mondialrelay/js/include_MR.js new file mode 100755 index 000000000..de0914462 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/js/include_MR.js @@ -0,0 +1,72 @@ +function addLoadEvent_MR(func, args) +{ + var oldonload = window.onload; + if (typeof window.onload != 'function') + window.onload = func; + else + { + window.onload = function() + { + if (oldonload) + oldonload(); + func(args); + } + } +} + +var gl_base_dir; + +function set_html_MR_recherche(obj, num, base_dir, cpt) +{ +gl_base_dir = base_dir; + +var html = '\ +
        \ +
        \ + \ + \ + \ + \ + \ + \ + \ +
        '+obj.address1+' - \ +'+obj.address2+''; +if (obj.address2 != '') + html = html + ' - '; +html = html + ''+obj.address3+''; +if (obj.address3 != '') + html = html + ' - '; +html = html + ''+obj.address4+''; +if (obj.address4 != '') + html = html + ' - '; +html = html + ''+obj.postcode+' \ +'+obj.city+' - \ +'+obj.iso_country+'
        '; + $('#mondialrelay_'+num).html($('#mondialrelay_'+num).html()+html); + if (obj.checked == '1' || cpt == 0) + select_PR_MR(obj.num, num); +} + +function include_mondialrelay(num) +{ + $('#form_mondialrelay_'+num).html('\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
        \ +
        \ +
        '); +} diff --git a/modules/mondialrelay/kit_mondialrelay/js/ressources_MR.js b/modules/mondialrelay/kit_mondialrelay/js/ressources_MR.js new file mode 100755 index 000000000..3336a4cfa --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/js/ressources_MR.js @@ -0,0 +1,616 @@ +var relativ_base_dir = url_appel; +var num_mode_actif = -1; + +url_appel = url_appel+'modules/mondialrelay/kit_mondialrelay/'; + +img_loader = new Image; +img_loader.src = url_appel+'loading.gif'; + +var google_map_general = null; +var geocoder = null; +var recherche = 0; +var json_addresses = null; +//var address; + +function affiche_mydiv_mr(id_carrier, args) +{ + if ($('#id_carrier_mr' + id_carrier).attr("checked") == true) + { + if ($('#mondialrelay_' + id_carrier).css('display') == 'none') + { + $('#mondialrelay_' + id_carrier).toggle('slow'); + $('#mondialrelay_' + id_carrier).show(); + if ($('#mondialrelay_' + id_carrier).html() == '') + recherche_MR(id_carrier, args); + else + $("#all_mondialrelay_map_" + id_carrier).show(); + } + } + else + { + if ($('#mondialrelay_' + id_carrier).css('display') == 'block') + $('#mondialrelay_' + id_carrier).toggle('slow'); + $('#mondialrelay_' + id_carrier).hide(); + $("#all_mondialrelay_map_" + id_carrier).hide(); + } +} + +function trim_MR(s) +{return s.replace(/^\s+|\s+$/g,"");} + +function ltrim_MR(s) +{return s.replace(/^\s+/,"");} + +function rtrim_MR(s) +{return s.replace(/\s+$/,"");} + +function strtoupper_MR(s) +{return s.toUpperCase();} + +var oXmlhttpMR1 = null; +if (window.XMLHttpRequest) { + // If IE7, Mozilla, Safari, and so on: Use native object. + oXmlhttpMR1 = new XMLHttpRequest(); +} +else +{ + if (window.ActiveXObject) { + // ...otherwise, use the ActiveX control for IE5.x and IE6. + oXmlhttpMR1 = new ActiveXObject('MSXML2.XMLHTTP.3.0'); + } +} + +var oXmlhttpMR2 = null; +if (window.XMLHttpRequest) { + // If IE7, Mozilla, Safari, and so on: Use native object. + oXmlhttpMR2 = new XMLHttpRequest(); +} +else +{ + if (window.ActiveXObject) { + // ...otherwise, use the ActiveX control for IE5.x and IE6. + oXmlhttpMR2 = new ActiveXObject('MSXML2.XMLHTTP.3.0'); + } +} + +var oXmlhttpMR3 = null; +if (window.XMLHttpRequest) { + // If IE7, Mozilla, Safari, and so on: Use native object. + oXmlhttpMR3 = new XMLHttpRequest(); +} +else +{ + if (window.ActiveXObject) { + // ...otherwise, use the ActiveX control for IE5.x and IE6. + oXmlhttpMR3 = new ActiveXObject('MSXML2.XMLHTTP.3.0'); + } +} + +var oXmlhttpMR5 = null; +if (window.XMLHttpRequest) { + // If IE7, Mozilla, Safari, and so on: Use native object. + oXmlhttpMR5 = new XMLHttpRequest(); +} +else +{ + if (window.ActiveXObject) { + // ...otherwise, use the ActiveX control for IE5.x and IE6. + oXmlhttpMR5 = new ActiveXObject('MSXML2.XMLHTTP.3.0'); + } +} + +function Url_suivi_MR(numexp) +{ + var ok = 0; + if (numexp != '') + ok = 1; + if (ok == 1) + { + + oXmlhttpMR1.open('POST',url_appel+'SuiviExpedition_ajax.php'); + oXmlhttpMR1.onreadystatechange = function() + { + if (oXmlhttpMR1.readyState == 4 && oXmlhttpMR1.status == 200) + { + var response = oXmlhttpMR1.responseText; + document.getElementById('list_Url_suivi_MR_expediation').innerHTML=document.getElementById('list_Url_suivi_MR_expediation').innerHTML + + '
        '+response+''; + } + } + oXmlhttpMR1.setRequestHeader("Content-type", "application/x-www-form-urlencoded; "); + var data = 'Expedition='+encodeURIComponent(numexp); + oXmlhttpMR1.send(data); + } + else + { + alert('Formulaire incomplet'); + return false; + } +} + +function impression_etiquette_MR() +{ + if (document.getElementById('input_Expeditions').value != '' && is_ok_mr('Pays','input_Langue','')) + { + oXmlhttpMR2.open('POST',url_appel+'ImpressionEtiquettePointRelais_ajax.php'); + oXmlhttpMR2.onreadystatechange=function() + { + if (oXmlhttpMR2.readyState == 1) + document.getElementById('reponse_impression_etiquette_MR').innerHTML='Cration en cours...'; + if (oXmlhttpMR2.readyState == 2) + document.getElementById('reponse_impression_etiquette_MR').innerHTML='Cration en cours...'; + if (oXmlhttpMR2.readyState == 4 && oXmlhttpMR2.status == 200) + { + var response = oXmlhttpMR2.responseText || "z|"; + document.getElementById('reponse_impression_etiquette_MR').innerHTML = ''; + res=response.split('|'); + if (res[0] != 0 && res[0] != 'a' && res[0] != 'z') + message_MR(res[0]); + else if (res[0] == 'a') + document.getElementById('reponse_impression_etiquette_MR').innerHTML = res[1]; + else if (res[0] == 'z') + { + document.getElementById('reponse_impression_etiquette_MR').innerHTML = ''; + alert('Requte sans rponse.'); + } + else + { + document.getElementById('list_url_reponse_impression_etiquette_MR_A4').innerHTML=document.getElementById('list_url_reponse_impression_etiquette_MR_A4').innerHTML + + '
        ' + res[1] + ''; + document.getElementById('list_url_reponse_impression_etiquette_MR_A5').innerHTML=document.getElementById('list_url_reponse_impression_etiquette_MR_A5').innerHTML + + '
        ' + res[2] + ''; + } + } + } + oXmlhttpMR2.setRequestHeader("Content-type", "application/x-www-form-urlencoded; "); + var data = 'Expeditions=' + encodeURIComponent(document.getElementById('input_Expeditions').value) + '&Langue=' + encodeURIComponent($('#input_Langue').val()); + oXmlhttpMR2.send (data); + } + else + { + alert('Formulaire incomplet'); + return false; + } + } + + +function creation_etiquette_MR() +{ + if ( is_ok_mr('NDossier','input_NDossier','') + && is_ok_mr('NClient','input_NClient','') + && is_ok_mr('Pays','input_Expe_Langage','') + && is_ok_mr('Ad2','input_Expe_Ad2','') + && is_ok_mr('Ad3','input_Expe_Ad3','') + && is_ok_mr('Ad2','input_Expe_Ad4','') + && is_ok_mr('VilleO','input_Expe_Ville','') + && is_ok_mr('CPO','input_Expe_CP','') + && is_ok_mr('Pays','input_Expe_Pays','') + && is_ok_mr('Tel1','input_Expe_Tel1','') + && is_ok_mr('Tel2','input_Expe_Tel2','') + && is_ok_mr('Mail','input_Expe_Mail','') + && is_ok_mr('Pays','input_Dest_Langage','') + && is_ok_mr('Ad2','input_Dest_Ad2','') + && is_ok_mr('Ad3','input_Dest_Ad3','') + && is_ok_mr('Ad2','input_Dest_Ad4','') + && is_ok_mr('VilleO','input_Dest_Ville','') + && is_ok_mr('CPO','input_Dest_CP','') + && is_ok_mr('Pays','input_Dest_Pays','') + && is_ok_mr('Tel2','input_Dest_Tel1','') + && is_ok_mr('Tel2','input_Dest_Tel2','') + && is_ok_mr('MailO','input_Dest_Mail','') + && is_ok_mr('PoidsO','input_Poids','') + && is_ok_mr('Longueur','input_Longueur','') + ) + { + oXmlhttpMR3.open('POST',url_appel+'CreationEtiquettePointRelais_ajax.php'); + oXmlhttpMR3.onreadystatechange = function() + { + if (oXmlhttpMR3.readyState == 1) + document.getElementById('reponse_creation_etiquette_MR').innerHTML = 'Cration en cours...'; + if (oXmlhttpMR3.readyState == 2) + document.getElementById('reponse_creation_etiquette_MR').innerHTML = 'Cration en cours...'; + if (oXmlhttpMR3.readyState == 4 && oXmlhttpMR3.status == 200) + { + var response = oXmlhttpMR3.responseText || "z|"; + document.getElementById('reponse_creation_etiquette_MR').innerHTML = ''; + res = response.split('|'); + if (res[0] != 0 && res[0] != 'a' && res[0] != 'z') + {message_MR(res[0]);} + else if (res[0] == 'a') + document.getElementById('reponse_creation_etiquette_MR').innerHTML = res[1]; + else if (res[0] == 'z') + { + document.getElementById('reponse_creation_etiquette_MR').innerHTML = ''; + alert('Requte sans rponse.'); + } + else + { + document.getElementById('list_url_reponse_creation_etiquette_MR').innerHTML = document.getElementById('list_url_reponse_creation_etiquette_MR').innerHTML + + '
        '+res[2]+''; + Url_suivi_MR(res[1]);//ligne supprimer seulement utilise pour le test + if (document.getElementById('input_Expeditions').value != '') + document.getElementById('input_Expeditions').value = document.getElementById('input_Expeditions').value+';'+res[1]; + else + document.getElementById('input_Expeditions').value = res[1]; + } + } + } + oXmlhttpMR3.setRequestHeader("Content-type", "application/x-www-form-urlencoded; "); + var data = 'ModeCol='+encodeURIComponent(document.getElementById('input_ModeCol').value)+'&ModeLiv='+encodeURIComponent(document.getElementById('input_ModeLiv').value)+'&NDossier='+encodeURIComponent(document.getElementById('input_NDossier').value)+'&NClient='+encodeURIComponent(document.getElementById('input_NClient').value)+'&Expe_Langage='+encodeURIComponent(document.getElementById('input_Expe_Langage').value)+'&Expe_Ad1='+encodeURIComponent(document.getElementById('input_Expe_Ad1').value)+'&Expe_Ad2='+encodeURIComponent(document.getElementById('input_Expe_Ad2').value)+'&Expe_Ad3='+encodeURIComponent(document.getElementById('input_Expe_Ad3').value)+'&Expe_Ad4='+encodeURIComponent(document.getElementById('input_Expe_Ad4').value)+'&Expe_Ville='+encodeURIComponent(document.getElementById('input_Expe_Ville').value)+'&Expe_CP='+encodeURIComponent(document.getElementById('input_Expe_CP').value)+'&Expe_Pays='+encodeURIComponent(document.getElementById('input_Expe_Pays').value)+'&Expe_Tel1='+encodeURIComponent(document.getElementById('input_Expe_Tel1').value)+'&Expe_Tel2='+encodeURIComponent(document.getElementById('input_Expe_Tel2').value)+'&Expe_Mail='+encodeURIComponent(document.getElementById('input_Expe_Mail').value)+'&Dest_Langage='+encodeURIComponent(document.getElementById('input_Dest_Langage').value)+'&Dest_Ad1='+encodeURIComponent(document.getElementById('input_Dest_Ad1').value)+'&Dest_Ad2='+encodeURIComponent(document.getElementById('input_Dest_Ad2').value)+'&Dest_Ad3='+encodeURIComponent(document.getElementById('input_Dest_Ad3').value)+'&Dest_Ad4='+encodeURIComponent(document.getElementById('input_Dest_Ad4').value)+'&Dest_Ville='+encodeURIComponent(document.getElementById('input_Dest_Ville').value)+'&Dest_CP='+encodeURIComponent(document.getElementById('input_Dest_CP').value)+'&Dest_Pays='+encodeURIComponent(document.getElementById('input_Dest_Pays').value)+'&Dest_Tel1='+encodeURIComponent(document.getElementById('input_Dest_Tel1').value)+'&Dest_Tel2='+encodeURIComponent(document.getElementById('input_Dest_Tel2').value)+'&Dest_Mail='+encodeURIComponent(document.getElementById('input_Dest_Mail').value)+'&Poids='+encodeURIComponent(document.getElementById('input_Poids').value)+'&Longueur='+encodeURIComponent(document.getElementById('input_Longueur').value)+'&Taille='+encodeURIComponent(document.getElementById('input_Taille').options[document.getElementById('input_Taille').selectedIndex].value)+'&NbColis='+encodeURIComponent(document.getElementById('input_NbColis').options[document.getElementById('input_NbColis').selectedIndex].value)+'&CRT_Valeur='+encodeURIComponent(document.getElementById('input_CRT_Valeur').value)+'&CRT_Devise='+encodeURIComponent(document.getElementById('input_CRT_Devise').value)+'&Exp_Valeur='+encodeURIComponent(document.getElementById('input_Exp_Valeur').value)+'&Exp_Devise='+encodeURIComponent(document.getElementById('input_Exp_Devise').value)+'&LIV_Rel_Pays='+encodeURIComponent(document.getElementById('input_LIV_Rel_Pays').value)+'&LIV_Rel='+encodeURIComponent(document.getElementById('input_LIV_Rel').value)+'&Assurance='+encodeURIComponent(document.getElementById('input_Assurance').options[document.getElementById('input_Assurance').selectedIndex].value)+'&Instructions='+encodeURIComponent(document.getElementById('input_Instructions').value)+'&Texte='+encodeURIComponent(document.getElementById('input_Texte').value); + oXmlhttpMR3.send(data); + } + else + { + alert('Formulaire incomplet'); + return false; + } +} + +function recherche_MR(num, args) +{ + $.ajax({ + type: "POST", + url: url_appel+'RecherchePointRelais_ajax.php', + data: args , + dataType: 'json', + beforeSend : function(params) + { + $('#loading_mr').show(); + }, + success: function(obj) + { + $('#loading_mr').hide(); + $('#mondialrelay_'+num).html(''); + $("#all_mondialrelay_map_" + num).show(); + var cpt = 0; + if (obj.error) + $('#mondialrelay_'+num).html('

        '+server_error+'

        '); + else + { + while (obj.addresses[cpt]) + { + if (obj.addresses[cpt].num) + set_html_MR_recherche(obj.addresses[cpt], num, obj.base_dir, cpt); + cpt++; + } + if (!obj.addresses[0].num) + $('#mondialrelay_'+num).html('

        '+address_error+'

        '); + } + } + }); +} + + +function is_numeric(id,message) +{ + var string = trim_MR(document.getElementById(id).value); + if ((isNaN(string)) == true || string == '') + { + document.getElementById(id).focus(); + alert(message); + return false; + } + else + return true; +} + +function is_no_null_mr(id,message) +{ + var string = trim_MR(document.getElementById(id).value); + if (string != '') + return true; + else + { + document.getElementById(id).focus(); + alert(message); + return false; + } +} + +function is_ok_mr(type,id,message) + { + if (type != 'key') document.getElementById(id).value = trim_MR(strtoupper_MR(document.getElementById(id).value)); + var string = document.getElementById(id).value; + var reg = ""; + if (type == 'Enseigne' ) + reg = "^[0-9A-Z]{2}[0-9A-Z ]{6}$"; + else if (type == 'CM' ) + reg = "^[0-9]{2}$"; + else if (type == 'key' ) + reg = "^[0-9A-Za-z_\'., /\-]{2,32}$"; + else if (type == 'Longueur' && string != '') + reg = "^[0-9]{0,3}$"; + else if (type == 'MailO' ) + reg = "^[a-zA-Z0-9\-\.@_]{6,70}$"; + else if (type == 'Mail' && string != '') + reg = "^[a-zA-Z0-9\-\.@_]{0,70}$"; + else if (type == 'Tel1' ) + reg = "^(((00|[\+])33)|0)[0-9]{1}[0-9]{8}$"; + else if (type == 'Tel2' && string != '') + reg = "^(((00|[\+])33)|0)[0-9]{1}[0-9]{8}$"; + else if (type == 'Ad2' && string != '') + reg = "^[0-9A-Z_\'., /\-]{2,32}$"; + else if (type == 'Ad3') + reg = "^[0-9A-Z_\'., /\-]{2,32}$"; + else if (type == 'NDossier' && string != '') + reg = "^[0-9A-Z_ \-]{0,15}$"; + else if (type == 'NClient' && string != '') + reg = "^[0-9A-Z]{0,9}$"; + else if (type == 'Pays') + reg = "^[A-Z]{2}$"; + else if (type == 'VilleO' ) + reg = "^[A-Z_' \-]{2,25}$"; + else if (type == 'Ville' && string != '') + reg = "^[A-Z_' \-]{2,25}$"; + else if (type == 'CP' && string != '') + reg = "^[0-9]{4,5}$"; + else if (type == 'CPO' ) + reg = "^[0-9]{4,5}$"; + else if (type == 'Taille' && string != '') + reg = "^XS|S|M|L|XL|XXL|3XL$"; + else if (type == 'Poids' && string != '') + reg = "^[0-9]{1,6}$"; + else if (type == 'PoidsO') + reg = "^[0-9]{1,6}$"; + else if (type == 'Action' && string != '') + reg = "^REL|24R|ESP|DRI|LDS|LDR|LD1$"; + else if (reg!="") + { + try { + if (string != string.match(reg)[0]) + {if (message!='') {document.getElementById(id).focus();alert(message);} + return false; + } + else {return true;} + } catch(err) + { + document.getElementById(id).focus();alert(message); + return false; + } + } else {return true;} + } + + function masque_recherche_MR_detail(num) + { + document.getElementById('bg_detail_md_'+num).style.display='none'; + document.getElementById('detail_md_'+num).style.display='none'; + document.getElementById('detail_md_'+num).innerHTML='' + } + + function recherche_MR_detail(num, pays, num_mode) + { + oXmlhttpMR5.open('POST',url_appel+'RechercheDetailPointRelais_ajax.php'); + oXmlhttpMR5.onreadystatechange=function() { + if (oXmlhttpMR5.readyState==1) { + var arrayPageSize = getPageSize_MR(); + var arrayScroll = getPageScroll_MR(); + document.getElementById('bg_detail_md_'+num_mode).style.height = (arrayPageSize[1] + 'px'); + document.getElementById('bg_detail_md_'+num_mode).style.display='block'; + document.getElementById('detail_md_'+num_mode).style.top = (Math.round(arrayScroll[1]+(arrayPageSize[3]-480)/2)+ 'px'); + document.getElementById('detail_md_'+num_mode).style.left = (Math.round((arrayPageSize[2]-740)/2)+ 'px'); + document.getElementById('detail_md_'+num_mode).innerHTML="
        "; + document.getElementById('detail_md_'+num_mode).style.display='block'; + } + /*if (oXmlhttpMR5.readyState==2) { + var arrayPageSize = getPageSize_MR(); + var arrayScroll = getPageScroll_MR(); + document.getElementById('bg_detail_md').style.height = (arrayPageSize[1] + 'px'); + document.getElementById('bg_detail_md').style.display='block'; + document.getElementById('detail_md').style.top = (Math.round(arrayScroll[1]+(arrayPageSize[3]-480)/2)+ 'px'); + document.getElementById('detail_md').style.left = (Math.round((arrayPageSize[2]-740)/2)+ 'px'); + document.getElementById('detail_md').innerHTML="
        "; + document.getElementById('detail_md').style.display='block'; + }*/ + if (oXmlhttpMR5.readyState==4 && oXmlhttpMR5.status == 200) { + var response = oXmlhttpMR5.responseText || "z|"; + res=response.split('|'); + if (res[0]!=0 && res[0]!='a' && res[0]!='z') + {masque_recherche_MR_detail(num_mode); + message_MR(res[0]);} + else if (res[0]=='a') {document.getElementById('detail_md_'+res[2]).innerHTML=res[1];} + else if (res[0]=='z') {masque_recherche_MR_detail(res[2]); alert('Requte sans rponse.');} + else {document.getElementById('detail_md_'+res[2]).innerHTML=res[1];};}; + } + + oXmlhttpMR5.setRequestHeader("Content-type", "application/x-www-form-urlencoded; "); + var data = 'relativ_base_dir='+encodeURIComponent(relativ_base_dir)+'&Num='+encodeURIComponent(num)+'&Pays='+encodeURIComponent(pays)+'&num_mode='+num_mode; + oXmlhttpMR5.send (data); + + + } + +function select_PR_MR(num, id_carrier) +{ + if (num != '') + { + $('#MR_Selected_Num_'+id_carrier).val(num); + $('#MR_Selected_LgAdr1_'+id_carrier).val($('#MR_LgAdr1_'+num).html()); + $('#MR_Selected_LgAdr2_'+id_carrier).val($('#MR_LgAdr2_'+num).html()); + $('#MR_Selected_LgAdr3_'+id_carrier).val($('#MR_LgAdr3_'+num).html()); + $('#MR_Selected_LgAdr4_'+id_carrier).val($('#MR_LgAdr4_'+num).html()); + $('#MR_Selected_CP_'+id_carrier).val($('#MR_CP_'+num).html()); + $('#MR_Selected_Ville_'+id_carrier).val($('#MR_Ville_'+num).html()); + $('#MR_Selected_Pays_'+id_carrier).val($('#MR_Pays_'+num).html()); + } + else + { + $('#MR_Selected_Num_'+id_carrier).val(''); + $('#MR_Selected_LgAdr1_'+id_carrier).val(''); + $('#MR_Selected_LgAdr2_'+id_carrier).val(''); + $('#MR_Selected_LgAdr3_'+id_carrier).val(''); + $('#MR_Selected_LgAdr4_'+id_carrier).val(''); + $('#MR_Selected_CP_'+id_carrier).val(''); + $('#MR_Selected_Ville_'+id_carrier).val(''); + $('#MR_Selected_Pays_'+id_carrier).val(''); + }; + if (one_page_checkout == true) + { + $.ajax({ + type: 'POST', + url: gl_base_dir + 'modules/mondialrelay/kit_mondialrelay/mr_opc_ajax.php', + async: true, + cache: false, + data: 'Num='+$('#MR_Selected_Num_'+id_carrier).val()+'&LgAdr1='+$('#MR_Selected_LgAdr1_'+id_carrier).val()+'&LgAdr2='+$('#MR_Selected_LgAdr2_'+id_carrier).val()+'&LgAdr3='+$('#MR_Selected_LgAdr3_'+id_carrier).val()+'&LgAdr4='+$('#MR_Selected_LgAdr4_'+id_carrier).val()+'&CP='+$('#MR_Selected_CP_'+id_carrier).val()+'&Ville='+$('#MR_Selected_Ville_'+id_carrier).val()+'&Pays='+$('#MR_Selected_Pays_'+id_carrier).val() + }); + } +} + +function message_MR(etat) +{ + if (etat == 'a') {alert("Rsultat vide");} + if (etat == 1) {alert("Enseigne invalide");} + if (etat == 2) {alert("Numro d'enseigne vide ou inexistant");} + if (etat == 3) {alert("Numro de compte enseigne invalide");} + if (etat == 5) {alert("Numro de dossier enseigne invalide");} + if (etat == 7) {alert("Numro de client enseigne invalide");} + if (etat == 9) {alert("Nom de ville non reconnu ou non unique");} + if (etat == 10) {alert("Type de collecte invalide ou incorrect (1/D > Domicile -- 3/R > Relais)");} + if (etat == 11) {alert("Numro de Point Relais de collecte invalide");} + if (etat == 12) {alert("Pays du Point Relais de collecte invalide");} + if (etat == 13) {alert("Type de livraison invalide ou incorrect (1/D > Domicile -- 3/R > Relais)");} + if (etat == 14) {alert("Numro du Point Relais de livraison invalide");} + if (etat == 15) {alert("Pays du Point Relais de livraison invalide");} + if (etat == 16) {alert("Code pays invalide");} + if (etat == 17) {alert("Adresse invalide");} + if (etat == 18) {alert("Ville invalide");} + if (etat == 19) {alert("Code postal invalide");} + if (etat == 20) {alert("Poids du colis invalide");} + if (etat == 21) {alert("Taille (Longueur + Hauteur) du colis invalide");} + if (etat == 22) {alert("Taille du Colis invalide");} + if (etat == 24) {alert("Numro de Colis Mondial Relay invalide");} + if (etat == 28) {alert("Mode de collecte invalide");} + if (etat == 29) {alert("Mode de livraison invalide");} + if (etat == 30) {alert("Adresse (L1) de l'expditeur invalide");} + if (etat == 31) {alert("Adresse (L2) de l'expditeur invalide");} + if (etat == 33) {alert("Adresse (L3) de l'expditeur invalide");} + if (etat == 34) {alert("Adresse (L4) de l'expditeur invalide");} + if (etat == 35) {alert("Ville de l'expditeur invalide");} + if (etat == 36) {alert("Code postal de l'expditeur invalide");} + if (etat == 37) {alert("Pays de l'expditeur invalide");} + if (etat == 38) {alert("Numro de tlphone de l'expditeur invalide");} + if (etat == 39) {alert("Adresse e-mail de l'expditeur invalide");} + if (etat == 40) {alert("Action impossible sans ville ni code postal");} + if (etat == 41) {alert("Mode de livraison invalide");} + if (etat == 42) {alert("Montant CRT invalide");} + if (etat == 43) {alert("Devise CRT invalide");} + if (etat == 44) {alert("Valeur du colis invalide");} + if (etat == 45) {alert("Devise de la valeur du colis invalide");} + if (etat == 46) {alert("Plage de numro d'expdition epuisee");} + if (etat == 47) {alert("Nombre de colis invalide");} + if (etat == 48) {alert("Multi-colis en Point Relais Interdit");} + if (etat == 49) {alert("Mode de collecte ou de livraison invalide");} + if (etat == 50) {alert("Adresse (L1) du destinataire invalide");} + if (etat == 51) {alert("Adresse (L2) du destinataire invalide");} + if (etat == 53) {alert("Adresse (L3) du destinataire invalide");} + if (etat == 54) {alert("Adresse (L4) du destinataire invalide");} + if (etat == 55) {alert("Ville du destinataire invalide");} + if (etat == 56) {alert("Code postal du destinataire invalide");} + if (etat == 57) {alert("Pays du destinataire invalide");} + if (etat == 58) {alert("Numro de tlphone du destinataire invalide");} + if (etat == 59) {alert("Adresse e-mail du destinataire invalide");} + if (etat == 60) {alert("Champ texte libre invalide");} + if (etat == 61) {alert("Top avisage invalide");} + if (etat == 62) {alert("Instruction de livraison invalide");} + if (etat == 63) {alert("Assurance invalide ou incorrecte");} + if (etat == 64) {alert("Temps de montage invalide");} + if (etat == 65) {alert("Top rendez-vous invalide");} + if (etat == 66) {alert("Top reprise invalide");} + if (etat == 70) {alert("Numro de Point Relais invalide");} + if (etat == 72) {alert("Langue expditeur invalide");} + if (etat == 73) {alert("Langue destinataire invalide");} + if (etat == 74) {alert("Langue invalide");} + if (etat == 80) {alert("Code tracing : Colis enregistre");} + if (etat == 81) {alert("Code tracing : Colis en traitement chez Mondial Relay");} + if (etat == 82) {alert("Code tracing : Colis livre");} + if (etat == 83) {alert("Code tracing : Anomalie");} + if (etat == 84) {alert("84 (Rserv Code Tracing)");} + if (etat == 85) {alert("85 (Rserv Code Tracing)");} + if (etat == 86) {alert("86 (Rserv Code Tracing)");} + if (etat == 87) {alert("87 (Rserv Code Tracing)");} + if (etat == 88) {alert("88 (Rserv Code Tracing)");} + if (etat == 89) {alert("89 (Rserv Code Tracing)");} + if (etat == 90) {alert("AS400 indisponible");} + if (etat == 91) {alert("Numro d'expdition invalide");} + if (etat == 93) {alert("Aucun lment retourn par le plan de tri\n\ + Si vous effectuez une collecte ou une livraison en Point Relais, vrifiez que les\n\ + Point Relais sont bien disponibles.\n\ + Si vous effectuez une livraison domicile, il est probable que le code postal que\n\ + vous avez indiquez n'existe pas.");} + if (etat == 94) {alert("Colis Inexistant");} + if (etat == 95) {alert("Compte Enseigne non active");} + if (etat == 96) {alert("Type d'enseigne incorrect en Base");} + if (etat == 97) {alert("Cl de scurit invalide");} + if (etat == 98) {alert("Service Indisponible");} + if (etat == 99) {alert("Erreur gnrique du service\n\ + Cette erreur peut tre d autant un problme technique du service qu' des\n\ + donnes incorrectes ou inexistantes dans la Base de Donnes. Lorsque vous avez\n\ + cette erreur veuillez la notifier Mondial Relay en prcisant la date et l'heure de la\n\ + connexion ainsi que les informations envoys au WebService afin d'effectuer une\n\ + vrification.");} +} + + +function getPageScroll_MR() +{ + + var yScroll; + + if (self.pageYOffset) { + yScroll = self.pageYOffset; + } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict + yScroll = document.documentElement.scrollTop; + } else if (document.body) {// all other Explorers + yScroll = document.body.scrollTop; + } + + arrayPageScroll = new Array('',yScroll) + return arrayPageScroll; +} + + +function getPageSize_MR() +{ + + var xScroll, yScroll; + + if (window.innerHeight && window.scrollMaxY) { + xScroll = document.body.scrollWidth; + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari + xScroll = document.body.offsetWidth; + yScroll = document.body.offsetHeight; + } + + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + windowWidth = self.innerWidth; + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight = windowHeight; + } else { + pageHeight = yScroll; + } + + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = windowWidth; + } else { + pageWidth = xScroll; + } + + + arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) + return arrayPageSize; +} diff --git a/modules/mondialrelay/kit_mondialrelay/loading.gif b/modules/mondialrelay/kit_mondialrelay/loading.gif new file mode 100755 index 000000000..33e386eb2 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/loading.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/loupe.gif b/modules/mondialrelay/kit_mondialrelay/loupe.gif new file mode 100755 index 000000000..530a8e9d4 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/loupe.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/marker.gif b/modules/mondialrelay/kit_mondialrelay/marker.gif new file mode 100755 index 000000000..3850b2cd1 Binary files /dev/null and b/modules/mondialrelay/kit_mondialrelay/marker.gif differ diff --git a/modules/mondialrelay/kit_mondialrelay/mr_opc_ajax.php b/modules/mondialrelay/kit_mondialrelay/mr_opc_ajax.php new file mode 100644 index 000000000..2cb184a99 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/mr_opc_ajax.php @@ -0,0 +1,27 @@ +id_cart); +$result_MR = Db::getInstance()->ExecuteS("SELECT * FROM "._DB_PREFIX_."mr_method WHERE id_carrier='".(int)($cart->id_carrier)."' ;"); + +Db::getInstance()->delete(_DB_PREFIX_.'mr_selected','id_cart = "'.(int)($cart->id).'"'); +$mrselected = new MondialRelayClass(); +$mrselected->id_customer = $cart->id_customer; +$mrselected->id_method = $result_MR[0]['id_mr_method']; +$mrselected->id_cart = $cart->id; +$mrselected->MR_Selected_Num = $_POST['Num']; +$mrselected->MR_Selected_LgAdr1 = $_POST['LgAdr1']; +$mrselected->MR_Selected_LgAdr2 = $_POST['LgAdr2']; +$mrselected->MR_Selected_LgAdr3 = $_POST['LgAdr3']; +$mrselected->MR_Selected_LgAdr4 = $_POST['LgAdr4']; +$mrselected->MR_Selected_CP = $_POST['CP']; +$mrselected->MR_Selected_Ville = $_POST['Ville']; +$mrselected->MR_Selected_Pays = $_POST['Pays']; +$mrselected->save(); + + diff --git a/modules/mondialrelay/kit_mondialrelay/statCodeError.php b/modules/mondialrelay/kit_mondialrelay/statCodeError.php new file mode 100644 index 000000000..18e147d71 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/statCodeError.php @@ -0,0 +1,77 @@ + 'Enseigne invalide', + '2' => 'Numéro d\'enseigne vide ou inexistant', + '3' => 'Numéro de compte enseigne invalide', + '5' => 'Numéro de dossier enseigne invalide', + '7' => 'Numéro de client enseigne invalide', + '9' => 'Nom de ville non reconnu ou non unique', + '10' => 'Type de collecte invalide ou incorrect (1/D > Domicile -- 3/R > Relais)', + '11' => 'Numéro de Point Relais de collecte invalide', + '12' => 'Pays du Point Relais de collecte invalide', + '13' => 'Type de livraison invalide ou incorrect (1/D > Domicile -- 3/R > Relais)', + '14' => 'Numéro du Point Relais de livraison invalide', + '15' => 'Pays du Point Relais de livraison invalide', + '16' => 'Code pays invalide', + '17' => 'Adresse invalide', + '18' => 'Ville invalide', + '19' => 'Code postal invalide', + '20' => 'Poids du colis invalide', + '21' => 'Taille (Longueur + Hauteur) du colis invalide', + '22' => 'Taille du Colis invalide', + '24' => 'Numéro de Colis Mondial Relay invalide', + '29' => 'Mode de livraison invalide', + '30' => 'Adresse (L1) de l\'expéditeur invalide', + '31' => 'Adresse (L2) de l\'expéditeur invalide', + '33' => 'Adresse (L3) de l\'expéditeur invalide', + '34' => 'Adresse (L4) de l\'expéditeur invalide', + '35' => 'Ville de l\'expéditeur invalide', + '36' => 'Code postal de l\'expéditeur invalide', + '37' => 'Pays de l\'expéditeur invalide', + '38' => 'Numéro de téléphone de l\'expéditeur invalide', + '39' => 'Adresse e-mail de l\'expéditeur invalide', + '40' => 'Action impossible sans ville ni code postal', + '41' => 'Mode de livraison invalide', + '42' => 'Montant CRT invalide', + '43' => 'Devise CRT invalide', + '44' => 'Valeur du colis invalide', + '45' => 'Devise de la valeur du colis invalide', + '46' => 'Plage de numéro d\'expédition épuisée', + '47' => 'Nombre de colis invalide', + '48' => 'Multi-colis en Point Relais Interdit', + '49' => 'Mode de collecte ou de livraison invalide', + '50' => 'Adresse (L1) du destinataire invalide', + '51' => 'Adresse (L2) du destinataire invalide', + '53' => 'Adresse (L3) du destinataire invalide', + '54' => 'Adresse (L4) du destinataire invalide', + '55' => 'Ville du destinataire invalide', + '56' => 'Code postal du destinataire invalide', + '57' => 'Pays du destinataire invalide', + '58' => 'Numéro de téléphone du destinataire invalide', + '59' => 'Adresse e-mail du destinataire invalide', + '60' => 'Champ texte libre invalide', + '61' => 'Top avisage invalide', + '62' => 'Instruction de livraison invalide', + '63' => 'Assurance invalide ou incorrecte', + '64' => 'Temps de montage invalide', + '65' => 'Top rendez-vous invalide', + '66' => 'Top reprise invalide', + '70' => 'Numéro de Point Relais invalide', + '72' => 'Langue expéditeur invalide', + '73' => 'Langue destinataire invalide', + '74' => 'Langue invalide', + '80' => 'Code tracing : Colis enregistré', + '81' => 'Code tracing : Colis en traitement chez Mondial Relay', + '82' => 'Code tracing : Colis livré', + '83' => 'Code tracing : Anomalie', + '90' => 'AS400 indisponible', + '91' => 'Numéro d\'expédition invalide', + '94' => 'Colis Inexistant', + '95' => 'Compte Enseigne non activé', + '96' => 'Type d\'enseigne incorrect en Base', + '97' => 'Clé de sécurité invalide', + '98' => 'Service Indisponible', + '99' => 'Erreur générique du service. Cette erreur peut être dû autant à un problème technique du service qu\'à des données incorrectes ou inexistantes dans la Base de Données. Lorsque vous avez cette erreur veuillez la notifier à Mondial Relay en précisant la date et l\'heure de la connexion ainsi que les informations envoyés au WebService afin d\'effectuer une vérification.'); + +?> diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.nusoap_base.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.nusoap_base.php new file mode 100755 index 000000000..87a3aa18c --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.nusoap_base.php @@ -0,0 +1,995 @@ + +* @author Scott Nichol +* @version $Id: class.nusoap_base.php,v 1.56 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_base { + /** + * Identification for HTTP headers. + * + * @var string + * @access private + */ + var $title = 'NuSOAP'; + /** + * Version for HTTP headers. + * + * @var string + * @access private + */ + var $version = '0.9.5'; + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + var $revision = '$Revision: 1.56 $'; + /** + * Current error string (manipulated by getError/setError) + * + * @var string + * @access private + */ + var $error_str = ''; + /** + * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment) + * + * @var string + * @access private + */ + var $debug_str = ''; + /** + * toggles automatic encoding of special characters as entities + * (should always be true, I think) + * + * @var boolean + * @access private + */ + var $charencoding = true; + /** + * the debug level for this instance + * + * @var integer + * @access private + */ + var $debugLevel; + + /** + * set schema version + * + * @var string + * @access public + */ + var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'; + + /** + * charset encoding for outgoing messages + * + * @var string + * @access public + */ + var $soap_defencoding = 'ISO-8859-1'; + //var $soap_defencoding = 'UTF-8'; + + /** + * namespaces in an array of prefix => uri + * + * this is "seeded" by a set of constants, but it may be altered by code + * + * @var array + * @access public + */ + var $namespaces = array( + 'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/', + 'xsd' => 'http://www.w3.org/2001/XMLSchema', + 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/' + ); + + /** + * namespaces used in the current context, e.g. during serialization + * + * @var array + * @access private + */ + var $usedNamespaces = array(); + + /** + * XML Schema types in an array of uri => (array of xml type => php type) + * is this legacy yet? + * no, this is used by the nusoap_xmlschema class to verify type => namespace mappings. + * @var array + * @access public + */ + var $typemap = array( + 'http://www.w3.org/2001/XMLSchema' => array( + 'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double', + 'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'', + 'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string', + // abstract "any" types + 'anyType'=>'string','anySimpleType'=>'string', + // derived datatypes + 'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'', + 'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer', + 'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer', + 'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''), + 'http://www.w3.org/2000/10/XMLSchema' => array( + 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', + 'float'=>'double','dateTime'=>'string', + 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), + 'http://www.w3.org/1999/XMLSchema' => array( + 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', + 'float'=>'double','dateTime'=>'string', + 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), + 'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'), + 'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'), + 'http://xml.apache.org/xml-soap' => array('Map') + ); + + /** + * XML entities to convert + * + * @var array + * @access public + * @deprecated + * @see expandEntities + */ + var $xmlEntities = array('quot' => '"','amp' => '&', + 'lt' => '<','gt' => '>','apos' => "'"); + + /** + * constructor + * + * @access public + */ + function nusoap_base() { + $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; + } + + /** + * gets the global debug level, which applies to future instances + * + * @return integer Debug level 0-9, where 0 turns off + * @access public + */ + function getGlobalDebugLevel() { + return $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; + } + + /** + * sets the global debug level, which applies to future instances + * + * @param int $level Debug level 0-9, where 0 turns off + * @access public + */ + function setGlobalDebugLevel($level) { + $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'] = $level; + } + + /** + * gets the debug level for this instance + * + * @return int Debug level 0-9, where 0 turns off + * @access public + */ + function getDebugLevel() { + return $this->debugLevel; + } + + /** + * sets the debug level for this instance + * + * @param int $level Debug level 0-9, where 0 turns off + * @access public + */ + function setDebugLevel($level) { + $this->debugLevel = $level; + } + + /** + * adds debug data to the instance debug string with formatting + * + * @param string $string debug data + * @access private + */ + function debug($string){ + if ($this->debugLevel > 0) { + $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n"); + } + } + + /** + * adds debug data to the instance debug string without formatting + * + * @param string $string debug data + * @access public + */ + function appendDebug($string){ + if ($this->debugLevel > 0) { + // it would be nice to use a memory stream here to use + // memory more efficiently + $this->debug_str .= $string; + } + } + + /** + * clears the current debug data for this instance + * + * @access public + */ + function clearDebug() { + // it would be nice to use a memory stream here to use + // memory more efficiently + $this->debug_str = ''; + } + + /** + * gets the current debug data for this instance + * + * @return debug data + * @access public + */ + function &getDebug() { + // it would be nice to use a memory stream here to use + // memory more efficiently + return $this->debug_str; + } + + /** + * gets the current debug data for this instance as an XML comment + * this may change the contents of the debug data + * + * @return debug data as an XML comment + * @access public + */ + function &getDebugAsXMLComment() { + // it would be nice to use a memory stream here to use + // memory more efficiently + while (strpos($this->debug_str, '--')) { + $this->debug_str = str_replace('--', '- -', $this->debug_str); + } + $ret = ""; + return $ret; + } + + /** + * expands entities, e.g. changes '<' to '<'. + * + * @param string $val The string in which to expand entities. + * @access private + */ + function expandEntities($val) { + if ($this->charencoding) { + $val = str_replace('&', '&', $val); + $val = str_replace("'", ''', $val); + $val = str_replace('"', '"', $val); + $val = str_replace('<', '<', $val); + $val = str_replace('>', '>', $val); + } + return $val; + } + + /** + * returns error string if present + * + * @return mixed error string or false + * @access public + */ + function getError(){ + if($this->error_str != ''){ + return $this->error_str; + } + return false; + } + + /** + * sets error string + * + * @return boolean $string error string + * @access private + */ + function setError($str){ + $this->error_str = $str; + } + + /** + * detect if array is a simple array or a struct (associative array) + * + * @param mixed $val The PHP array + * @return string (arraySimple|arrayStruct) + * @access private + */ + function isArraySimpleOrStruct($val) { + $keyList = array_keys($val); + foreach ($keyList as $keyListValue) { + if (!is_int($keyListValue)) { + return 'arrayStruct'; + } + } + return 'arraySimple'; + } + + /** + * serializes PHP values in accordance w/ section 5. Type information is + * not serialized if $use == 'literal'. + * + * @param mixed $val The value to serialize + * @param string $name The name (local part) of the XML element + * @param string $type The XML schema type (local part) for the element + * @param string $name_ns The namespace for the name of the XML element + * @param string $type_ns The namespace for the type of the element + * @param array $attributes The attributes to serialize as name=>value pairs + * @param string $use The WSDL "use" (encoded|literal) + * @param boolean $soapval Whether this is called from soapval. + * @return string The serialized element, possibly with child elements + * @access public + */ + function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded',$soapval=false) { + $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval"); + $this->appendDebug('value=' . $this->varDump($val)); + $this->appendDebug('attributes=' . $this->varDump($attributes)); + + if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) { + $this->debug("serialize_val: serialize soapval"); + $xml = $val->serialize($use); + $this->appendDebug($val->getDebug()); + $val->clearDebug(); + $this->debug("serialize_val of soapval returning $xml"); + return $xml; + } + // force valid name if necessary + if (is_numeric($name)) { + $name = '__numeric_' . $name; + } elseif (! $name) { + $name = 'noname'; + } + // if name has ns, add ns prefix to name + $xmlns = ''; + if($name_ns){ + $prefix = 'nu'.rand(1000,9999); + $name = $prefix.':'.$name; + $xmlns .= " xmlns:$prefix=\"$name_ns\""; + } + // if type is prefixed, create type prefix + if($type_ns != '' && $type_ns == $this->namespaces['xsd']){ + // need to fix this. shouldn't default to xsd if no ns specified + // w/o checking against typemap + $type_prefix = 'xsd'; + } elseif($type_ns){ + $type_prefix = 'ns'.rand(1000,9999); + $xmlns .= " xmlns:$type_prefix=\"$type_ns\""; + } + // serialize attributes if present + $atts = ''; + if($attributes){ + foreach($attributes as $k => $v){ + $atts .= " $k=\"".$this->expandEntities($v).'"'; + } + } + // serialize null value + if (is_null($val)) { + $this->debug("serialize_val: serialize null"); + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$xmlns$atts/>"; + $this->debug("serialize_val returning $xml"); + return $xml; + } else { + if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + $xml = "<$name$xmlns$type_str$atts xsi:nil=\"true\"/>"; + $this->debug("serialize_val returning $xml"); + return $xml; + } + } + // serialize if an xsd built-in primitive type + if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){ + $this->debug("serialize_val: serialize xsd built-in primitive type"); + if (is_bool($val)) { + if ($type == 'boolean') { + $val = $val ? 'true' : 'false'; + } elseif (! $val) { + $val = 0; + } + } else if (is_string($val)) { + $val = $this->expandEntities($val); + } + if ($use == 'literal') { + $xml = "<$name$xmlns$atts>$val"; + $this->debug("serialize_val returning $xml"); + return $xml; + } else { + $xml = "<$name$xmlns xsi:type=\"xsd:$type\"$atts>$val"; + $this->debug("serialize_val returning $xml"); + return $xml; + } + } + // detect type and serialize + $xml = ''; + switch(true) { + case (is_bool($val) || $type == 'boolean'): + $this->debug("serialize_val: serialize boolean"); + if ($type == 'boolean') { + $val = $val ? 'true' : 'false'; + } elseif (! $val) { + $val = 0; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val"; + } + break; + case (is_int($val) || is_long($val) || $type == 'int'): + $this->debug("serialize_val: serialize int"); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val"; + } + break; + case (is_float($val)|| is_double($val) || $type == 'float'): + $this->debug("serialize_val: serialize float"); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val"; + } + break; + case (is_string($val) || $type == 'string'): + $this->debug("serialize_val: serialize string"); + $val = $this->expandEntities($val); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val"; + } + break; + case is_object($val): + $this->debug("serialize_val: serialize object"); + if (get_class($val) == 'soapval') { + $this->debug("serialize_val: serialize soapval object"); + $pXml = $val->serialize($use); + $this->appendDebug($val->getDebug()); + $val->clearDebug(); + } else { + if (! $name) { + $name = get_class($val); + $this->debug("In serialize_val, used class name $name as element name"); + } else { + $this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val)); + } + foreach(get_object_vars($val) as $k => $v){ + $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use); + } + } + if(isset($type) && isset($type_prefix)){ + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$pXml"; + } else { + $xml .= "<$name$xmlns$type_str$atts>$pXml"; + } + break; + break; + case (is_array($val) || $type): + // detect if struct or array + $valueType = $this->isArraySimpleOrStruct($val); + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){ + $this->debug("serialize_val: serialize array"); + $i = 0; + if(is_array($val) && count($val)> 0){ + foreach($val as $v){ + if(is_object($v) && get_class($v) == 'soapval'){ + $tt_ns = $v->type_ns; + $tt = $v->type; + } elseif (is_array($v)) { + $tt = $this->isArraySimpleOrStruct($v); + } else { + $tt = gettype($v); + } + $array_types[$tt] = 1; + // TODO: for literal, the name should be $name + $xml .= $this->serialize_val($v,'item',false,false,false,false,$use); + ++$i; + } + if(count($array_types) > 1){ + $array_typename = 'xsd:anyType'; + } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) { + if ($tt == 'integer') { + $tt = 'int'; + } + $array_typename = 'xsd:'.$tt; + } elseif(isset($tt) && $tt == 'arraySimple'){ + $array_typename = 'SOAP-ENC:Array'; + } elseif(isset($tt) && $tt == 'arrayStruct'){ + $array_typename = 'unnamed_struct_use_soapval'; + } else { + // if type is prefixed, create type prefix + if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ + $array_typename = 'xsd:' . $tt; + } elseif ($tt_ns) { + $tt_prefix = 'ns' . rand(1000, 9999); + $array_typename = "$tt_prefix:$tt"; + $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\""; + } else { + $array_typename = $tt; + } + } + $array_type = $i; + if ($use == 'literal') { + $type_str = ''; + } else if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\""; + } + // empty array + } else { + if ($use == 'literal') { + $type_str = ''; + } else if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\""; + } + } + // TODO: for array in literal, there is no wrapper here + $xml = "<$name$xmlns$type_str$atts>".$xml.""; + } else { + // got a struct + $this->debug("serialize_val: serialize struct"); + if(isset($type) && isset($type_prefix)){ + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>"; + } else { + $xml .= "<$name$xmlns$type_str$atts>"; + } + foreach($val as $k => $v){ + // Apache Map + if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') { + $xml .= ''; + $xml .= $this->serialize_val($k,'key',false,false,false,false,$use); + $xml .= $this->serialize_val($v,'value',false,false,false,false,$use); + $xml .= ''; + } else { + $xml .= $this->serialize_val($v,$k,false,false,false,false,$use); + } + } + $xml .= ""; + } + break; + default: + $this->debug("serialize_val: serialize unknown"); + $xml .= 'not detected, got '.gettype($val).' for '.$val; + break; + } + $this->debug("serialize_val returning $xml"); + return $xml; + } + + /** + * serializes a message + * + * @param string $body the XML of the SOAP body + * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array + * @param array $namespaces optional the namespaces used in generating the body and headers + * @param string $style optional (rpc|document) + * @param string $use optional (encoded|literal) + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @return string the message + * @access public + */ + function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){ + // TODO: add an option to automatically run utf8_encode on $body and $headers + // if $this->soap_defencoding is UTF-8. Not doing this automatically allows + // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1 + + $this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle"); + $this->debug("headers:"); + $this->appendDebug($this->varDump($headers)); + $this->debug("namespaces:"); + $this->appendDebug($this->varDump($namespaces)); + + // serialize namespaces + $ns_string = ''; + foreach(array_merge($this->namespaces,$namespaces) as $k => $v){ + $ns_string .= " xmlns:$k=\"$v\""; + } + if($encodingStyle) { + $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string"; + } + + // serialize headers + if($headers){ + if (is_array($headers)) { + $xml = ''; + foreach ($headers as $k => $v) { + if (is_object($v) && get_class($v) == 'soapval') { + $xml .= $this->serialize_val($v, false, false, false, false, false, $use); + } else { + $xml .= $this->serialize_val($v, $k, false, false, false, false, $use); + } + } + $headers = $xml; + $this->debug("In serializeEnvelope, serialized array of headers to $headers"); + } + $headers = "".$headers.""; + } + // serialize envelope + return + 'soap_defencoding .'"?'.">". + '". + $headers. + "". + $body. + "". + ""; + } + + /** + * formats a string to be inserted into an HTML stream + * + * @param string $str The string to format + * @return string The formatted string + * @access public + * @deprecated + */ + function formatDump($str){ + $str = htmlspecialchars($str); + return nl2br($str); + } + + /** + * contracts (changes namespace to prefix) a qualified name + * + * @param string $qname qname + * @return string contracted qname + * @access private + */ + function contractQname($qname){ + // get element namespace + //$this->xdebug("Contract $qname"); + if (strrpos($qname, ':')) { + // get unqualified name + $name = substr($qname, strrpos($qname, ':') + 1); + // get ns + $ns = substr($qname, 0, strrpos($qname, ':')); + $p = $this->getPrefixFromNamespace($ns); + if ($p) { + return $p . ':' . $name; + } + return $qname; + } else { + return $qname; + } + } + + /** + * expands (changes prefix to namespace) a qualified name + * + * @param string $qname qname + * @return string expanded qname + * @access private + */ + function expandQname($qname){ + // get element prefix + if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){ + // get unqualified name + $name = substr(strstr($qname,':'),1); + // get ns prefix + $prefix = substr($qname,0,strpos($qname,':')); + if(isset($this->namespaces[$prefix])){ + return $this->namespaces[$prefix].':'.$name; + } else { + return $qname; + } + } else { + return $qname; + } + } + + /** + * returns the local part of a prefixed string + * returns the original string, if not prefixed + * + * @param string $str The prefixed string + * @return string The local part + * @access public + */ + function getLocalPart($str){ + if($sstr = strrchr($str,':')){ + // get unqualified name + return substr( $sstr, 1 ); + } else { + return $str; + } + } + + /** + * returns the prefix part of a prefixed string + * returns false, if not prefixed + * + * @param string $str The prefixed string + * @return mixed The prefix or false if there is no prefix + * @access public + */ + function getPrefix($str){ + if($pos = strrpos($str,':')){ + // get prefix + return substr($str,0,$pos); + } + return false; + } + + /** + * pass it a prefix, it returns a namespace + * + * @param string $prefix The prefix + * @return mixed The namespace, false if no namespace has the specified prefix + * @access public + */ + function getNamespaceFromPrefix($prefix){ + if (isset($this->namespaces[$prefix])) { + return $this->namespaces[$prefix]; + } + //$this->setError("No namespace registered for prefix '$prefix'"); + return false; + } + + /** + * returns the prefix for a given namespace (or prefix) + * or false if no prefixes registered for the given namespace + * + * @param string $ns The namespace + * @return mixed The prefix, false if the namespace has no prefixes + * @access public + */ + function getPrefixFromNamespace($ns) { + foreach ($this->namespaces as $p => $n) { + if ($ns == $n || $ns == $p) { + $this->usedNamespaces[$p] = $n; + return $p; + } + } + return false; + } + + /** + * returns the time in ODBC canonical form with microseconds + * + * @return string The time in ODBC canonical form with microseconds + * @access public + */ + function getmicrotime() { + if (function_exists('gettimeofday')) { + $tod = gettimeofday(); + $sec = $tod['sec']; + $usec = $tod['usec']; + } else { + $sec = time(); + $usec = 0; + } + return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec); + } + + /** + * Returns a string with the output of var_dump + * + * @param mixed $data The variable to var_dump + * @return string The output of var_dump + * @access public + */ + function varDump($data) { + ob_start(); + var_dump($data); + $ret_val = ob_get_contents(); + ob_end_clean(); + return $ret_val; + } + + /** + * represents the object as a string + * + * @return string + * @access public + */ + function __toString() { + return $this->varDump($this); + } +} + +// XML Schema Datatype Helper Functions + +//xsd:dateTime helpers + +/** +* convert unix timestamp to ISO 8601 compliant date string +* +* @param int $timestamp Unix time stamp +* @param boolean $utc Whether the time stamp is UTC or local +* @return mixed ISO 8601 date string or false +* @access public +*/ +function timestamp_to_iso8601($timestamp,$utc=true){ + $datestr = date('Y-m-d\TH:i:sO',$timestamp); + $pos = strrpos($datestr, "+"); + if ($pos === FALSE) { + $pos = strrpos($datestr, "-"); + } + if ($pos !== FALSE) { + if (strlen($datestr) == $pos + 5) { + $datestr = substr($datestr, 0, $pos + 3) . ':' . substr($datestr, -2); + } + } + if($utc){ + $pattern = '/'. + '([0-9]{4})-'. // centuries & years CCYY- + '([0-9]{2})-'. // months MM- + '([0-9]{2})'. // days DD + 'T'. // separator T + '([0-9]{2}):'. // hours hh: + '([0-9]{2}):'. // minutes mm: + '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss... + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; + + if(preg_match($pattern,$datestr,$regs)){ + return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]); + } + return false; + } else { + return $datestr; + } +} + +/** +* convert ISO 8601 compliant date string to unix timestamp +* +* @param string $datestr ISO 8601 compliant date string +* @return mixed Unix timestamp (int) or false +* @access public +*/ +function iso8601_to_timestamp($datestr){ + $pattern = '/'. + '([0-9]{4})-'. // centuries & years CCYY- + '([0-9]{2})-'. // months MM- + '([0-9]{2})'. // days DD + 'T'. // separator T + '([0-9]{2}):'. // hours hh: + '([0-9]{2}):'. // minutes mm: + '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss... + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; + if(preg_match($pattern,$datestr,$regs)){ + // not utc + if($regs[8] != 'Z'){ + $op = substr($regs[8],0,1); + $h = substr($regs[8],1,2); + $m = substr($regs[8],strlen($regs[8])-2,2); + if($op == '-'){ + $regs[4] = $regs[4] + $h; + $regs[5] = $regs[5] + $m; + } elseif($op == '+'){ + $regs[4] = $regs[4] - $h; + $regs[5] = $regs[5] - $m; + } + } + return gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); +// return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z"); + } else { + return false; + } +} + +/** +* sleeps some number of microseconds +* +* @param string $usec the number of microseconds to sleep +* @access public +* @deprecated +*/ +function usleepWindows($usec) +{ + $start = gettimeofday(); + + do + { + $stop = gettimeofday(); + $timePassed = 1000000 * ($stop['sec'] - $start['sec']) + + $stop['usec'] - $start['usec']; + } + while ($timePassed < $usec); +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_fault.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_fault.php new file mode 100755 index 000000000..9229abc4a --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_fault.php @@ -0,0 +1,89 @@ + +* @version $Id: class.soap_fault.php,v 1.14 2007/04/11 15:49:47 snichol Exp $ +* @access public +*/ +class nusoap_fault extends nusoap_base { + /** + * The fault code (client|server) + * @var string + * @access private + */ + var $faultcode; + /** + * The fault actor + * @var string + * @access private + */ + var $faultactor; + /** + * The fault string, a description of the fault + * @var string + * @access private + */ + var $faultstring; + /** + * The fault detail, typically a string or array of string + * @var mixed + * @access private + */ + var $faultdetail; + + /** + * constructor + * + * @param string $faultcode (SOAP-ENV:Client | SOAP-ENV:Server) + * @param string $faultactor only used when msg routed between multiple actors + * @param string $faultstring human readable error message + * @param mixed $faultdetail detail, typically a string or array of string + */ + function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ + parent::nusoap_base(); + $this->faultcode = $faultcode; + $this->faultactor = $faultactor; + $this->faultstring = $faultstring; + $this->faultdetail = $faultdetail; + } + + /** + * serialize a fault + * + * @return string The serialization of the fault instance. + * @access public + */ + function serialize(){ + $ns_string = ''; + foreach($this->namespaces as $k => $v){ + $ns_string .= "\n xmlns:$k=\"$v\""; + } + $return_msg = + 'soap_defencoding.'"?>'. + '\n". + ''. + ''. + $this->serialize_val($this->faultcode, 'faultcode'). + $this->serialize_val($this->faultactor, 'faultactor'). + $this->serialize_val($this->faultstring, 'faultstring'). + $this->serialize_val($this->faultdetail, 'detail'). + ''. + ''. + ''; + return $return_msg; + } +} + +/** + * Backward compatibility + */ +class soap_fault extends nusoap_fault { +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_parser.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_parser.php new file mode 100755 index 000000000..4260d1367 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_parser.php @@ -0,0 +1,642 @@ + +* @author Scott Nichol +* @version $Id: class.soap_parser.php,v 1.42 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_parser extends nusoap_base { + + var $xml = ''; + var $xml_encoding = ''; + var $method = ''; + var $root_struct = ''; + var $root_struct_name = ''; + var $root_struct_namespace = ''; + var $root_header = ''; + var $document = ''; // incoming SOAP body (text) + // determines where in the message we are (envelope,header,body,method) + var $status = ''; + var $position = 0; + var $depth = 0; + var $default_namespace = ''; + var $namespaces = array(); + var $message = array(); + var $parent = ''; + var $fault = false; + var $fault_code = ''; + var $fault_str = ''; + var $fault_detail = ''; + var $depth_array = array(); + var $debug_flag = true; + var $soapresponse = NULL; // parsed SOAP Body + var $soapheader = NULL; // parsed SOAP Header + var $responseHeaders = ''; // incoming SOAP headers (text) + var $body_position = 0; + // for multiref parsing: + // array of id => pos + var $ids = array(); + // array of id => hrefs => pos + var $multirefs = array(); + // toggle for auto-decoding element content + var $decode_utf8 = true; + + /** + * constructor that actually does the parsing + * + * @param string $xml SOAP message + * @param string $encoding character encoding scheme of message + * @param string $method method for which XML is parsed (unused?) + * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 + * @access public + */ + function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ + parent::nusoap_base(); + $this->xml = $xml; + $this->xml_encoding = $encoding; + $this->method = $method; + $this->decode_utf8 = $decode_utf8; + + // Check whether content has been read. + if(!empty($xml)){ + // Check XML encoding + $pos_xml = strpos($xml, '', $pos_xml + 2) - $pos_xml + 1); + if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) { + $xml_encoding = $res[1]; + if (strtoupper($xml_encoding) != $encoding) { + $err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'"; + $this->debug($err); + if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') { + $this->setError($err); + return; + } + // when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed + } else { + $this->debug('Charset from HTTP Content-Type matches encoding from XML declaration'); + } + } else { + $this->debug('No encoding specified in XML declaration'); + } + } else { + $this->debug('No XML declaration'); + } + $this->debug('Entering nusoap_parser(), length='.strlen($xml).', encoding='.$encoding); + // Create an XML parser - why not xml_parser_create_ns? + $this->parser = xml_parser_create($this->xml_encoding); + // Set the options for parsing the XML data. + //xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding); + // Set the object for the parser. + xml_set_object($this->parser, $this); + // Set the element handlers for the parser. + xml_set_element_handler($this->parser, 'start_element','end_element'); + xml_set_character_data_handler($this->parser,'character_data'); + + // Parse the XML file. + if(!xml_parse($this->parser,$xml,true)){ + // Display an error message. + $err = sprintf('XML error parsing SOAP payload on line %d: %s', + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser))); + $this->debug($err); + $this->debug("XML payload:\n" . $xml); + $this->setError($err); + } else { + $this->debug('in nusoap_parser ctor, message:'); + $this->appendDebug($this->varDump($this->message)); + $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name); + // get final value + $this->soapresponse = $this->message[$this->root_struct]['result']; + // get header value + if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){ + $this->soapheader = $this->message[$this->root_header]['result']; + } + // resolve hrefs/ids + if(sizeof($this->multirefs) > 0){ + foreach($this->multirefs as $id => $hrefs){ + $this->debug('resolving multirefs for id: '.$id); + $idVal = $this->buildVal($this->ids[$id]); + if (is_array($idVal) && isset($idVal['!id'])) { + unset($idVal['!id']); + } + foreach($hrefs as $refPos => $ref){ + $this->debug('resolving href at pos '.$refPos); + $this->multirefs[$id][$refPos] = $idVal; + } + } + } + } + xml_parser_free($this->parser); + } else { + $this->debug('xml was empty, didn\'t parse!'); + $this->setError('xml was empty, didn\'t parse!'); + } + } + + /** + * start-element handler + * + * @param resource $parser XML parser object + * @param string $name element name + * @param array $attrs associative array of attributes + * @access private + */ + function start_element($parser, $name, $attrs) { + // position in a total number of elements, starting from 0 + // update class level pos + $pos = $this->position++; + // and set mine + $this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>''); + // depth = how many levels removed from root? + // set mine as current global depth and increment global depth value + $this->message[$pos]['depth'] = $this->depth++; + + // else add self as child to whoever the current parent is + if($pos != 0){ + $this->message[$this->parent]['children'] .= '|'.$pos; + } + // set my parent + $this->message[$pos]['parent'] = $this->parent; + // set self as current parent + $this->parent = $pos; + // set self as current value for this depth + $this->depth_array[$this->depth] = $pos; + // get element prefix + if(strpos($name,':')){ + // get ns prefix + $prefix = substr($name,0,strpos($name,':')); + // get unqualified name + $name = substr(strstr($name,':'),1); + } + // set status + if ($name == 'Envelope' && $this->status == '') { + $this->status = 'envelope'; + } elseif ($name == 'Header' && $this->status == 'envelope') { + $this->root_header = $pos; + $this->status = 'header'; + } elseif ($name == 'Body' && $this->status == 'envelope'){ + $this->status = 'body'; + $this->body_position = $pos; + // set method + } elseif($this->status == 'body' && $pos == ($this->body_position+1)) { + $this->status = 'method'; + $this->root_struct_name = $name; + $this->root_struct = $pos; + $this->message[$pos]['type'] = 'struct'; + $this->debug("found root struct $this->root_struct_name, pos $this->root_struct"); + } + // set my status + $this->message[$pos]['status'] = $this->status; + // set name + $this->message[$pos]['name'] = htmlspecialchars($name); + // set attrs + $this->message[$pos]['attrs'] = $attrs; + + // loop through atts, logging ns and type declarations + $attstr = ''; + foreach($attrs as $key => $value){ + $key_prefix = $this->getPrefix($key); + $key_localpart = $this->getLocalPart($key); + // if ns declarations, add to class level array of valid namespaces + if($key_prefix == 'xmlns'){ + if(preg_match('/^http:\/\/www.w3.org\/[0-9]{4}\/XMLSchema$/',$value)){ + $this->XMLSchemaVersion = $value; + $this->namespaces['xsd'] = $this->XMLSchemaVersion; + $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance'; + } + $this->namespaces[$key_localpart] = $value; + // set method namespace + if($name == $this->root_struct_name){ + $this->methodNamespace = $value; + } + // if it's a type declaration, set type + } elseif($key_localpart == 'type'){ + if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') { + // do nothing: already processed arrayType + } else { + $value_prefix = $this->getPrefix($value); + $value_localpart = $this->getLocalPart($value); + $this->message[$pos]['type'] = $value_localpart; + $this->message[$pos]['typePrefix'] = $value_prefix; + if(isset($this->namespaces[$value_prefix])){ + $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix]; + } else if(isset($attrs['xmlns:'.$value_prefix])) { + $this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix]; + } + // should do something here with the namespace of specified type? + } + } elseif($key_localpart == 'arrayType'){ + $this->message[$pos]['type'] = 'array'; + /* do arrayType ereg here + [1] arrayTypeValue ::= atype asize + [2] atype ::= QName rank* + [3] rank ::= '[' (',')* ']' + [4] asize ::= '[' length~ ']' + [5] length ::= nextDimension* Digit+ + [6] nextDimension ::= Digit+ ',' + */ + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/'; + if(preg_match($expr,$value,$regs)){ + $this->message[$pos]['typePrefix'] = $regs[1]; + $this->message[$pos]['arrayTypePrefix'] = $regs[1]; + if (isset($this->namespaces[$regs[1]])) { + $this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]]; + } else if (isset($attrs['xmlns:'.$regs[1]])) { + $this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]]; + } + $this->message[$pos]['arrayType'] = $regs[2]; + $this->message[$pos]['arraySize'] = $regs[3]; + $this->message[$pos]['arrayCols'] = $regs[4]; + } + // specifies nil value (or not) + } elseif ($key_localpart == 'nil'){ + $this->message[$pos]['nil'] = ($value == 'true' || $value == '1'); + // some other attribute + } elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') { + $this->message[$pos]['xattrs']['!' . $key] = $value; + } + + if ($key == 'xmlns') { + $this->default_namespace = $value; + } + // log id + if($key == 'id'){ + $this->ids[$value] = $pos; + } + // root + if($key_localpart == 'root' && $value == 1){ + $this->status = 'method'; + $this->root_struct_name = $name; + $this->root_struct = $pos; + $this->debug("found root struct $this->root_struct_name, pos $pos"); + } + // for doclit + $attstr .= " $key=\"$value\""; + } + // get namespace - must be done after namespace atts are processed + if(isset($prefix)){ + $this->message[$pos]['namespace'] = $this->namespaces[$prefix]; + $this->default_namespace = $this->namespaces[$prefix]; + } else { + $this->message[$pos]['namespace'] = $this->default_namespace; + } + if($this->status == 'header'){ + if ($this->root_header != $pos) { + $this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>"; + } + } elseif($this->root_struct_name != ''){ + $this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>"; + } + } + + /** + * end-element handler + * + * @param resource $parser XML parser object + * @param string $name element name + * @access private + */ + function end_element($parser, $name) { + // position of current element is equal to the last value left in depth_array for my depth + $pos = $this->depth_array[$this->depth--]; + + // get element prefix + if(strpos($name,':')){ + // get ns prefix + $prefix = substr($name,0,strpos($name,':')); + // get unqualified name + $name = substr(strstr($name,':'),1); + } + + // build to native type + if(isset($this->body_position) && $pos > $this->body_position){ + // deal w/ multirefs + if(isset($this->message[$pos]['attrs']['href'])){ + // get id + $id = substr($this->message[$pos]['attrs']['href'],1); + // add placeholder to href array + $this->multirefs[$id][$pos] = 'placeholder'; + // add set a reference to it as the result value + $this->message[$pos]['result'] =& $this->multirefs[$id][$pos]; + // build complexType values + } elseif($this->message[$pos]['children'] != ''){ + // if result has already been generated (struct/array) + if(!isset($this->message[$pos]['result'])){ + $this->message[$pos]['result'] = $this->buildVal($pos); + } + // build complexType values of attributes and possibly simpleContent + } elseif (isset($this->message[$pos]['xattrs'])) { + if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) { + $this->message[$pos]['xattrs']['!'] = null; + } elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') { + if (isset($this->message[$pos]['type'])) { + $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata']; + } + } + } + $this->message[$pos]['result'] = $this->message[$pos]['xattrs']; + // set value of simpleType (or nil complexType) + } else { + //$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']); + if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) { + $this->message[$pos]['xattrs']['!'] = null; + } elseif (isset($this->message[$pos]['type'])) { + $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $this->message[$pos]['result'] = $this->message[$pos]['cdata']; + } + } + + /* add value to parent's result, if parent is struct/array + $parent = $this->message[$pos]['parent']; + if($this->message[$parent]['type'] != 'map'){ + if(strtolower($this->message[$parent]['type']) == 'array'){ + $this->message[$parent]['result'][] = $this->message[$pos]['result']; + } else { + $this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result']; + } + } + */ + } + } + + // for doclit + if($this->status == 'header'){ + if ($this->root_header != $pos) { + $this->responseHeaders .= ""; + } + } elseif($pos >= $this->root_struct){ + $this->document .= ""; + } + // switch status + if ($pos == $this->root_struct){ + $this->status = 'body'; + $this->root_struct_namespace = $this->message[$pos]['namespace']; + } elseif ($pos == $this->root_header) { + $this->status = 'envelope'; + } elseif ($name == 'Body' && $this->status == 'body') { + $this->status = 'envelope'; + } elseif ($name == 'Header' && $this->status == 'header') { // will never happen + $this->status = 'envelope'; + } elseif ($name == 'Envelope' && $this->status == 'envelope') { + $this->status = ''; + } + // set parent back to my parent + $this->parent = $this->message[$pos]['parent']; + } + + /** + * element content handler + * + * @param resource $parser XML parser object + * @param string $data element content + * @access private + */ + function character_data($parser, $data){ + $pos = $this->depth_array[$this->depth]; + if ($this->xml_encoding=='UTF-8'){ + // TODO: add an option to disable this for folks who want + // raw UTF-8 that, e.g., might not map to iso-8859-1 + // TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1"); + if($this->decode_utf8){ + $data = utf8_decode($data); + } + } + $this->message[$pos]['cdata'] .= $data; + // for doclit + if($this->status == 'header'){ + $this->responseHeaders .= $data; + } else { + $this->document .= $data; + } + } + + /** + * get the parsed message (SOAP Body) + * + * @return mixed + * @access public + * @deprecated use get_soapbody instead + */ + function get_response(){ + return $this->soapresponse; + } + + /** + * get the parsed SOAP Body (NULL if there was none) + * + * @return mixed + * @access public + */ + function get_soapbody(){ + return $this->soapresponse; + } + + /** + * get the parsed SOAP Header (NULL if there was none) + * + * @return mixed + * @access public + */ + function get_soapheader(){ + return $this->soapheader; + } + + /** + * get the unparsed SOAP Header + * + * @return string XML or empty if no Header + * @access public + */ + function getHeaders(){ + return $this->responseHeaders; + } + + /** + * decodes simple types into PHP variables + * + * @param string $value value to decode + * @param string $type XML type to decode + * @param string $typens XML type namespace to decode + * @return mixed PHP value + * @access private + */ + function decodeSimple($value, $type, $typens) { + // TODO: use the namespace! + if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') { + return (string) $value; + } + if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') { + return (int) $value; + } + if ($type == 'float' || $type == 'double' || $type == 'decimal') { + return (double) $value; + } + if ($type == 'boolean') { + if (strtolower($value) == 'false' || strtolower($value) == 'f') { + return false; + } + return (boolean) $value; + } + if ($type == 'base64' || $type == 'base64Binary') { + $this->debug('Decode base64 value'); + return base64_decode($value); + } + // obscure numeric types + if ($type == 'nonPositiveInteger' || $type == 'negativeInteger' + || $type == 'nonNegativeInteger' || $type == 'positiveInteger' + || $type == 'unsignedInt' + || $type == 'unsignedShort' || $type == 'unsignedByte') { + return (int) $value; + } + // bogus: parser treats array with no elements as a simple type + if ($type == 'array') { + return array(); + } + // everything else + return (string) $value; + } + + /** + * builds response structures for compound values (arrays/structs) + * and scalars + * + * @param integer $pos position in node tree + * @return mixed PHP value + * @access private + */ + function buildVal($pos){ + if(!isset($this->message[$pos]['type'])){ + $this->message[$pos]['type'] = ''; + } + $this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']); + // if there are children... + if($this->message[$pos]['children'] != ''){ + $this->debug('in buildVal, there are children'); + $children = explode('|',$this->message[$pos]['children']); + array_shift($children); // knock off empty + // md array + if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){ + $r=0; // rowcount + $c=0; // colcount + foreach($children as $child_pos){ + $this->debug("in buildVal, got an MD array element: $r, $c"); + $params[$r][] = $this->message[$child_pos]['result']; + $c++; + if($c == $this->message[$pos]['arrayCols']){ + $c = 0; + $r++; + } + } + // array + } elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){ + $this->debug('in buildVal, adding array '.$this->message[$pos]['name']); + foreach($children as $child_pos){ + $params[] = &$this->message[$child_pos]['result']; + } + // apache Map type: java hashtable + } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){ + $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']); + foreach($children as $child_pos){ + $kv = explode("|",$this->message[$child_pos]['children']); + $params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result']; + } + // generic compound type + //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') { + } else { + // Apache Vector type: treat as an array + $this->debug('in buildVal, adding Java Vector or generic compound type '.$this->message[$pos]['name']); + if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') { + $notstruct = 1; + } else { + $notstruct = 0; + } + // + foreach($children as $child_pos){ + if($notstruct){ + $params[] = &$this->message[$child_pos]['result']; + } else { + if (isset($params[$this->message[$child_pos]['name']])) { + // de-serialize repeated element name into an array + if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) { + $params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]); + } + $params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result']; + } else { + $params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result']; + } + } + } + } + if (isset($this->message[$pos]['xattrs'])) { + $this->debug('in buildVal, handling attributes'); + foreach ($this->message[$pos]['xattrs'] as $n => $v) { + $params[$n] = $v; + } + } + // handle simpleContent + if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') { + $this->debug('in buildVal, handling simpleContent'); + if (isset($this->message[$pos]['type'])) { + $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $params['!'] = $this->message[$pos]['cdata']; + } + } + } + $ret = is_array($params) ? $params : array(); + $this->debug('in buildVal, return:'); + $this->appendDebug($this->varDump($ret)); + return $ret; + } else { + $this->debug('in buildVal, no children, building scalar'); + $cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : ''; + if (isset($this->message[$pos]['type'])) { + $ret = $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + $this->debug("in buildVal, return: $ret"); + return $ret; + } + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $ret = $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + $this->debug("in buildVal, return: $ret"); + return $ret; + } + $ret = $this->message[$pos]['cdata']; + $this->debug("in buildVal, return: $ret"); + return $ret; + } + } +} + +/** + * Backward compatibility + */ +class soap_parser extends nusoap_parser { +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_server.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_server.php new file mode 100755 index 000000000..d81b09424 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_server.php @@ -0,0 +1,1126 @@ + +* @author Scott Nichol +* @version $Id: class.soap_server.php,v 1.63 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_server extends nusoap_base { + /** + * HTTP headers of request + * @var array + * @access private + */ + var $headers = array(); + /** + * HTTP request + * @var string + * @access private + */ + var $request = ''; + /** + * SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text) + * @var string + * @access public + */ + var $requestHeaders = ''; + /** + * SOAP Headers from request (parsed) + * @var mixed + * @access public + */ + var $requestHeader = NULL; + /** + * SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text) + * @var string + * @access public + */ + var $document = ''; + /** + * SOAP payload for request (text) + * @var string + * @access public + */ + var $requestSOAP = ''; + /** + * requested method namespace URI + * @var string + * @access private + */ + var $methodURI = ''; + /** + * name of method requested + * @var string + * @access private + */ + var $methodname = ''; + /** + * method parameters from request + * @var array + * @access private + */ + var $methodparams = array(); + /** + * SOAP Action from request + * @var string + * @access private + */ + var $SOAPAction = ''; + /** + * character set encoding of incoming (request) messages + * @var string + * @access public + */ + var $xml_encoding = ''; + /** + * toggles whether the parser decodes element content w/ utf8_decode() + * @var boolean + * @access public + */ + var $decode_utf8 = true; + + /** + * HTTP headers of response + * @var array + * @access public + */ + var $outgoing_headers = array(); + /** + * HTTP response + * @var string + * @access private + */ + var $response = ''; + /** + * SOAP headers for response (text or array of soapval or associative array) + * @var mixed + * @access public + */ + var $responseHeaders = ''; + /** + * SOAP payload for response (text) + * @var string + * @access private + */ + var $responseSOAP = ''; + /** + * method return value to place in response + * @var mixed + * @access private + */ + var $methodreturn = false; + /** + * whether $methodreturn is a string of literal XML + * @var boolean + * @access public + */ + var $methodreturnisliteralxml = false; + /** + * SOAP fault for response (or false) + * @var mixed + * @access private + */ + var $fault = false; + /** + * text indication of result (for debugging) + * @var string + * @access private + */ + var $result = 'successful'; + + /** + * assoc array of operations => opData; operations are added by the register() + * method or by parsing an external WSDL definition + * @var array + * @access private + */ + var $operations = array(); + /** + * wsdl instance (if one) + * @var mixed + * @access private + */ + var $wsdl = false; + /** + * URL for WSDL (if one) + * @var mixed + * @access private + */ + var $externalWSDLURL = false; + /** + * whether to append debug to response as XML comment + * @var boolean + * @access public + */ + var $debug_flag = false; + + + /** + * constructor + * the optional parameter is a path to a WSDL file that you'd like to bind the server instance to. + * + * @param mixed $wsdl file path or URL (string), or wsdl instance (object) + * @access public + */ + function nusoap_server($wsdl=false){ + parent::nusoap_base(); + // turn on debugging? + global $debug; + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $this->debug("_SERVER is defined:"); + $this->appendDebug($this->varDump($_SERVER)); + } elseif (isset($HTTP_SERVER_VARS)) { + $this->debug("HTTP_SERVER_VARS is defined:"); + $this->appendDebug($this->varDump($HTTP_SERVER_VARS)); + } else { + $this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined."); + } + + if (isset($debug)) { + $this->debug("In nusoap_server, set debug_flag=$debug based on global flag"); + $this->debug_flag = $debug; + } elseif (isset($_SERVER['QUERY_STRING'])) { + $qs = explode('&', $_SERVER['QUERY_STRING']); + foreach ($qs as $v) { + if (substr($v, 0, 6) == 'debug=') { + $this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #1"); + $this->debug_flag = substr($v, 6); + } + } + } elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { + $qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']); + foreach ($qs as $v) { + if (substr($v, 0, 6) == 'debug=') { + $this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #2"); + $this->debug_flag = substr($v, 6); + } + } + } + + // wsdl + if($wsdl){ + $this->debug("In nusoap_server, WSDL is specified"); + if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) { + $this->wsdl = $wsdl; + $this->externalWSDLURL = $this->wsdl->wsdl; + $this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL); + } else { + $this->debug('Create wsdl from ' . $wsdl); + $this->wsdl = new wsdl($wsdl); + $this->externalWSDLURL = $wsdl; + } + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if($err = $this->wsdl->getError()){ + die('WSDL ERROR: '.$err); + } + } + } + + /** + * processes request and returns response + * + * @param string $data usually is the value of $HTTP_RAW_POST_DATA + * @access public + */ + function service($data){ + global $HTTP_SERVER_VARS; + + if (isset($_SERVER['REQUEST_METHOD'])) { + $rm = $_SERVER['REQUEST_METHOD']; + } elseif (isset($HTTP_SERVER_VARS['REQUEST_METHOD'])) { + $rm = $HTTP_SERVER_VARS['REQUEST_METHOD']; + } else { + $rm = ''; + } + + if (isset($_SERVER['QUERY_STRING'])) { + $qs = $_SERVER['QUERY_STRING']; + } elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { + $qs = $HTTP_SERVER_VARS['QUERY_STRING']; + } else { + $qs = ''; + } + $this->debug("In service, request method=$rm query string=$qs strlen(\$data)=" . strlen($data)); + + if ($rm == 'POST') { + $this->debug("In service, invoke the request"); + $this->parse_request($data); + if (! $this->fault) { + $this->invoke_method(); + } + if (! $this->fault) { + $this->serialize_return(); + } + $this->send_response(); + } elseif (preg_match('/wsdl/', $qs) ){ + $this->debug("In service, this is a request for WSDL"); + if ($this->externalWSDLURL){ + if (strpos($this->externalWSDLURL, "http://") !== false) { // assume URL + $this->debug("In service, re-direct for WSDL"); + header('Location: '.$this->externalWSDLURL); + } else { // assume file + $this->debug("In service, use file passthru for WSDL"); + header("Content-Type: text/xml\r\n"); + $pos = strpos($this->externalWSDLURL, "file://"); + if ($pos === false) { + $filename = $this->externalWSDLURL; + } else { + $filename = substr($this->externalWSDLURL, $pos + 7); + } + $fp = fopen($this->externalWSDLURL, 'r'); + fpassthru($fp); + } + } elseif ($this->wsdl) { + $this->debug("In service, serialize WSDL"); + header("Content-Type: text/xml; charset=ISO-8859-1\r\n"); + print $this->wsdl->serialize($this->debug_flag); + if ($this->debug_flag) { + $this->debug('wsdl:'); + $this->appendDebug($this->varDump($this->wsdl)); + print $this->getDebugAsXMLComment(); + } + } else { + $this->debug("In service, there is no WSDL"); + header("Content-Type: text/html; charset=ISO-8859-1\r\n"); + print "This service does not provide WSDL"; + } + } elseif ($this->wsdl) { + $this->debug("In service, return Web description"); + print $this->wsdl->webDescription(); + } else { + $this->debug("In service, no Web description"); + header("Content-Type: text/html; charset=ISO-8859-1\r\n"); + print "This service does not provide a Web description"; + } + } + + /** + * parses HTTP request headers. + * + * The following fields are set by this function (when successful) + * + * headers + * request + * xml_encoding + * SOAPAction + * + * @access private + */ + function parse_http_headers() { + global $HTTP_SERVER_VARS; + + $this->request = ''; + $this->SOAPAction = ''; + if(function_exists('getallheaders')){ + $this->debug("In parse_http_headers, use getallheaders"); + $headers = getallheaders(); + foreach($headers as $k=>$v){ + $k = strtolower($k); + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + // get SOAPAction header + if(isset($this->headers['soapaction'])){ + $this->SOAPAction = str_replace('"','',$this->headers['soapaction']); + } + // get the character encoding of the incoming request + if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ + $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } elseif(isset($_SERVER) && is_array($_SERVER)){ + $this->debug("In parse_http_headers, use _SERVER"); + foreach ($_SERVER as $k => $v) { + if (substr($k, 0, 5) == 'HTTP_') { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); + } else { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); + } + if ($k == 'soapaction') { + // get SOAPAction header + $k = 'SOAPAction'; + $v = str_replace('"', '', $v); + $v = str_replace('\\', '', $v); + $this->SOAPAction = $v; + } else if ($k == 'content-type') { + // get the character encoding of the incoming request + if (strpos($v, '=')) { + $enc = substr(strstr($v, '='), 1); + $enc = str_replace('"', '', $enc); + $enc = str_replace('\\', '', $enc); + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) { + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + } elseif (is_array($HTTP_SERVER_VARS)) { + $this->debug("In parse_http_headers, use HTTP_SERVER_VARS"); + foreach ($HTTP_SERVER_VARS as $k => $v) { + if (substr($k, 0, 5) == 'HTTP_') { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); $k = strtolower(substr($k, 5)); + } else { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); $k = strtolower($k); + } + if ($k == 'soapaction') { + // get SOAPAction header + $k = 'SOAPAction'; + $v = str_replace('"', '', $v); + $v = str_replace('\\', '', $v); + $this->SOAPAction = $v; + } else if ($k == 'content-type') { + // get the character encoding of the incoming request + if (strpos($v, '=')) { + $enc = substr(strstr($v, '='), 1); + $enc = str_replace('"', '', $enc); + $enc = str_replace('\\', '', $enc); + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) { + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + } else { + $this->debug("In parse_http_headers, HTTP headers not accessible"); + $this->setError("HTTP headers not accessible"); + } + } + + /** + * parses a request + * + * The following fields are set by this function (when successful) + * + * headers + * request + * xml_encoding + * SOAPAction + * request + * requestSOAP + * methodURI + * methodname + * methodparams + * requestHeaders + * document + * + * This sets the fault field on error + * + * @param string $data XML string + * @access private + */ + function parse_request($data='') { + $this->debug('entering parse_request()'); + $this->parse_http_headers(); + $this->debug('got character encoding: '.$this->xml_encoding); + // uncompress if necessary + if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] != '') { + $this->debug('got content encoding: ' . $this->headers['content-encoding']); + if ($this->headers['content-encoding'] == 'deflate' || $this->headers['content-encoding'] == 'gzip') { + // if decoding works, use it. else assume data wasn't gzencoded + if (function_exists('gzuncompress')) { + if ($this->headers['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) { + $data = $degzdata; + } elseif ($this->headers['content-encoding'] == 'gzip' && $degzdata = gzinflate(substr($data, 10))) { + $data = $degzdata; + } else { + $this->fault('SOAP-ENV:Client', 'Errors occurred when trying to decode the data'); + return; + } + } else { + $this->fault('SOAP-ENV:Client', 'This Server does not support compressed data'); + return; + } + } + } + $this->request .= "\r\n".$data; + $data = $this->parseRequest($this->headers, $data); + $this->requestSOAP = $data; + $this->debug('leaving parse_request'); + } + + /** + * invokes a PHP function for the requested SOAP method + * + * The following fields are set by this function (when successful) + * + * methodreturn + * + * Note that the PHP function that is called may also set the following + * fields to affect the response sent to the client + * + * responseHeaders + * outgoing_headers + * + * This sets the fault field on error + * + * @access private + */ + function invoke_method() { + $this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction); + + // + // if you are debugging in this area of the code, your service uses a class to implement methods, + // you use SOAP RPC, and the client is .NET, please be aware of the following... + // when the .NET wsdl.exe utility generates a proxy, it will remove the '.' or '..' from the + // method name. that is fine for naming the .NET methods. it is not fine for properly constructing + // the XML request and reading the XML response. you need to add the RequestElementName and + // ResponseElementName to the System.Web.Services.Protocols.SoapRpcMethodAttribute that wsdl.exe + // generates for the method. these parameters are used to specify the correct XML element names + // for .NET to use, i.e. the names with the '.' in them. + // + $orig_methodname = $this->methodname; + if ($this->wsdl) { + if ($this->opData = $this->wsdl->getOperationData($this->methodname)) { + $this->debug('in invoke_method, found WSDL operation=' . $this->methodname); + $this->appendDebug('opData=' . $this->varDump($this->opData)); + } elseif ($this->opData = $this->wsdl->getOperationDataForSoapAction($this->SOAPAction)) { + // Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element + $this->debug('in invoke_method, found WSDL soapAction=' . $this->SOAPAction . ' for operation=' . $this->opData['name']); + $this->appendDebug('opData=' . $this->varDump($this->opData)); + $this->methodname = $this->opData['name']; + } else { + $this->debug('in invoke_method, no WSDL for operation=' . $this->methodname); + $this->fault('SOAP-ENV:Client', "Operation '" . $this->methodname . "' is not defined in the WSDL for this service"); + return; + } + } else { + $this->debug('in invoke_method, no WSDL to validate method'); + } + + // if a . is present in $this->methodname, we see if there is a class in scope, + // which could be referred to. We will also distinguish between two deliminators, + // to allow methods to be called a the class or an instance + if (strpos($this->methodname, '..') > 0) { + $delim = '..'; + } else if (strpos($this->methodname, '.') > 0) { + $delim = '.'; + } else { + $delim = ''; + } + $this->debug("in invoke_method, delim=$delim"); + + $class = ''; + $method = ''; + if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1) { + $try_class = substr($this->methodname, 0, strpos($this->methodname, $delim)); + if (class_exists($try_class)) { + // get the class and method name + $class = $try_class; + $method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim)); + $this->debug("in invoke_method, class=$class method=$method delim=$delim"); + } else { + $this->debug("in invoke_method, class=$try_class not found"); + } + } else { + $try_class = ''; + $this->debug("in invoke_method, no class to try"); + } + + // does method exist? + if ($class == '') { + if (!function_exists($this->methodname)) { + $this->debug("in invoke_method, function '$this->methodname' not found!"); + $this->result = 'fault: method not found'; + $this->fault('SOAP-ENV:Client',"method '$this->methodname'('$orig_methodname') not defined in service('$try_class' '$delim')"); + return; + } + } else { + $method_to_compare = (substr(phpversion(), 0, 2) == '4.') ? strtolower($method) : $method; + if (!in_array($method_to_compare, get_class_methods($class))) { + $this->debug("in invoke_method, method '$this->methodname' not found in class '$class'!"); + $this->result = 'fault: method not found'; + $this->fault('SOAP-ENV:Client',"method '$this->methodname'/'$method_to_compare'('$orig_methodname') not defined in service/'$class'('$try_class' '$delim')"); + return; + } + } + + // evaluate message, getting back parameters + // verify that request parameters match the method's signature + if(! $this->verify_method($this->methodname,$this->methodparams)){ + // debug + $this->debug('ERROR: request not verified against method signature'); + $this->result = 'fault: request failed validation against method signature'; + // return fault + $this->fault('SOAP-ENV:Client',"Operation '$this->methodname' not defined in service."); + return; + } + + // if there are parameters to pass + $this->debug('in invoke_method, params:'); + $this->appendDebug($this->varDump($this->methodparams)); + $this->debug("in invoke_method, calling '$this->methodname'"); + if (!function_exists('call_user_func_array')) { + if ($class == '') { + $this->debug('in invoke_method, calling function using eval()'); + $funcCall = "\$this->methodreturn = $this->methodname("; + } else { + if ($delim == '..') { + $this->debug('in invoke_method, calling class method using eval()'); + $funcCall = "\$this->methodreturn = ".$class."::".$method."("; + } else { + $this->debug('in invoke_method, calling instance method using eval()'); + // generate unique instance name + $instname = "\$inst_".time(); + $funcCall = $instname." = new ".$class."(); "; + $funcCall .= "\$this->methodreturn = ".$instname."->".$method."("; + } + } + if ($this->methodparams) { + foreach ($this->methodparams as $param) { + if (is_array($param) || is_object($param)) { + $this->fault('SOAP-ENV:Client', 'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available'); + return; + } + $funcCall .= "\"$param\","; + } + $funcCall = substr($funcCall, 0, -1); + } + $funcCall .= ');'; + $this->debug('in invoke_method, function call: '.$funcCall); + @eval($funcCall); + } else { + if ($class == '') { + $this->debug('in invoke_method, calling function using call_user_func_array()'); + $call_arg = "$this->methodname"; // straight assignment changes $this->methodname to lower case after call_user_func_array() + } elseif ($delim == '..') { + $this->debug('in invoke_method, calling class method using call_user_func_array()'); + $call_arg = array ($class, $method); + } else { + $this->debug('in invoke_method, calling instance method using call_user_func_array()'); + $instance = new $class (); + $call_arg = array(&$instance, $method); + } + if (is_array($this->methodparams)) { + $this->methodreturn = call_user_func_array($call_arg, array_values($this->methodparams)); + } else { + $this->methodreturn = call_user_func_array($call_arg, array()); + } + } + $this->debug('in invoke_method, methodreturn:'); + $this->appendDebug($this->varDump($this->methodreturn)); + $this->debug("in invoke_method, called method $this->methodname, received data of type ".gettype($this->methodreturn)); + } + + /** + * serializes the return value from a PHP function into a full SOAP Envelope + * + * The following fields are set by this function (when successful) + * + * responseSOAP + * + * This sets the fault field on error + * + * @access private + */ + function serialize_return() { + $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI); + // if fault + if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) { + $this->debug('got a fault object from method'); + $this->fault = $this->methodreturn; + return; + } elseif ($this->methodreturnisliteralxml) { + $return_val = $this->methodreturn; + // returned value(s) + } else { + $this->debug('got a(n) '.gettype($this->methodreturn).' from method'); + $this->debug('serializing return value'); + if($this->wsdl){ + if (sizeof($this->opData['output']['parts']) > 1) { + $this->debug('more than one output part, so use the method return unchanged'); + $opParams = $this->methodreturn; + } elseif (sizeof($this->opData['output']['parts']) == 1) { + $this->debug('exactly one output part, so wrap the method return in a simple array'); + // TODO: verify that it is not already wrapped! + //foreach ($this->opData['output']['parts'] as $name => $type) { + // $this->debug('wrap in element named ' . $name); + //} + $opParams = array($this->methodreturn); + } + $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams); + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if($errstr = $this->wsdl->getError()){ + $this->debug('got wsdl error: '.$errstr); + $this->fault('SOAP-ENV:Server', 'unable to serialize result'); + return; + } + } else { + if (isset($this->methodreturn)) { + $return_val = $this->serialize_val($this->methodreturn, 'return'); + } else { + $return_val = ''; + $this->debug('in absence of WSDL, assume void return for backward compatibility'); + } + } + } + $this->debug('return value:'); + $this->appendDebug($this->varDump($return_val)); + + $this->debug('serializing response'); + if ($this->wsdl) { + $this->debug('have WSDL for serialization: style is ' . $this->opData['style']); + if ($this->opData['style'] == 'rpc') { + $this->debug('style is rpc for serialization: use is ' . $this->opData['output']['use']); + if ($this->opData['output']['use'] == 'literal') { + // http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace + if ($this->methodURI) { + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } else { + $payload = '<'.$this->methodname.'Response>'.$return_val.'methodname.'Response>'; + } + } else { + if ($this->methodURI) { + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } else { + $payload = '<'.$this->methodname.'Response>'.$return_val.'methodname.'Response>'; + } + } + } else { + $this->debug('style is not rpc for serialization: assume document'); + $payload = $return_val; + } + } else { + $this->debug('do not have WSDL for serialization: assume rpc/encoded'); + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } + $this->result = 'successful'; + if($this->wsdl){ + //if($this->debug_flag){ + $this->appendDebug($this->wsdl->getDebug()); + // } + if (isset($this->opData['output']['encodingStyle'])) { + $encodingStyle = $this->opData['output']['encodingStyle']; + } else { + $encodingStyle = ''; + } + // Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces. + $this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style'],$this->opData['output']['use'],$encodingStyle); + } else { + $this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders); + } + $this->debug("Leaving serialize_return"); + } + + /** + * sends an HTTP response + * + * The following fields are set by this function (when successful) + * + * outgoing_headers + * response + * + * @access private + */ + function send_response() { + $this->debug('Enter send_response'); + if ($this->fault) { + $payload = $this->fault->serialize(); + $this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error"; + $this->outgoing_headers[] = "Status: 500 Internal Server Error"; + } else { + $payload = $this->responseSOAP; + // Some combinations of PHP+Web server allow the Status + // to come through as a header. Since OK is the default + // just do nothing. + // $this->outgoing_headers[] = "HTTP/1.0 200 OK"; + // $this->outgoing_headers[] = "Status: 200 OK"; + } + // add debug data if in debug mode + if(isset($this->debug_flag) && $this->debug_flag){ + $payload .= $this->getDebugAsXMLComment(); + } + $this->outgoing_headers[] = "Server: $this->title Server v$this->version"; + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); + $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")"; + // Let the Web server decide about this + //$this->outgoing_headers[] = "Connection: Close\r\n"; + $payload = $this->getHTTPBody($payload); + $type = $this->getHTTPContentType(); + $charset = $this->getHTTPContentTypeCharset(); + $this->outgoing_headers[] = "Content-Type: $type" . ($charset ? '; charset=' . $charset : ''); + //begin code to compress payload - by John + // NOTE: there is no way to know whether the Web server will also compress + // this data. + if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { + if (strstr($this->headers['accept-encoding'], 'gzip')) { + if (function_exists('gzencode')) { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + $this->outgoing_headers[] = "Content-Encoding: gzip"; + $payload = gzencode($payload); + } else { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + } + } elseif (strstr($this->headers['accept-encoding'], 'deflate')) { + // Note: MSIE requires gzdeflate output (no Zlib header and checksum), + // instead of gzcompress output, + // which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5) + if (function_exists('gzdeflate')) { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + $this->outgoing_headers[] = "Content-Encoding: deflate"; + $payload = gzdeflate($payload); + } else { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + } + } + } + //end code + $this->outgoing_headers[] = "Content-Length: ".strlen($payload); + reset($this->outgoing_headers); + foreach($this->outgoing_headers as $hdr){ + header($hdr, false); + } + print $payload; + $this->response = join("\r\n",$this->outgoing_headers)."\r\n\r\n".$payload; + } + + /** + * takes the value that was created by parsing the request + * and compares to the method's signature, if available. + * + * @param string $operation The operation to be invoked + * @param array $request The array of parameter values + * @return boolean Whether the operation was found + * @access private + */ + function verify_method($operation,$request){ + if(isset($this->wsdl) && is_object($this->wsdl)){ + if($this->wsdl->getOperationData($operation)){ + return true; + } + } elseif(isset($this->operations[$operation])){ + return true; + } + return false; + } + + /** + * processes SOAP message received from client + * + * @param array $headers The HTTP headers + * @param string $data unprocessed request data from client + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseRequest($headers, $data) { + $this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:'); + $this->appendDebug($this->varDump($headers)); + if (!isset($headers['content-type'])) { + $this->setError('Request not of type text/xml (no content-type header)'); + return false; + } + if (!strstr($headers['content-type'], 'text/xml')) { + $this->setError('Request not of type text/xml'); + return false; + } + if (strpos($headers['content-type'], '=')) { + $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); + $this->debug('Got response encoding: ' . $enc); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser'); + // parse response, get soap parser obj + $parser = new nusoap_parser($data,$this->xml_encoding,'',$this->decode_utf8); + // parser debug + $this->debug("parser debug: \n".$parser->getDebug()); + // if fault occurred during message parsing + if($err = $parser->getError()){ + $this->result = 'fault: error in msg parsing: '.$err; + $this->fault('SOAP-ENV:Client',"error in msg parsing:\n".$err); + // else successfully parsed request into soapval object + } else { + // get/set methodname + $this->methodURI = $parser->root_struct_namespace; + $this->methodname = $parser->root_struct_name; + $this->debug('methodname: '.$this->methodname.' methodURI: '.$this->methodURI); + $this->debug('calling parser->get_soapbody()'); + $this->methodparams = $parser->get_soapbody(); + // get SOAP headers + $this->requestHeaders = $parser->getHeaders(); + // get SOAP Header + $this->requestHeader = $parser->get_soapheader(); + // add document for doclit support + $this->document = $parser->document; + } + } + + /** + * gets the HTTP body for the current response. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + return $soapmsg; + } + + /** + * gets the HTTP content type for the current response. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current response. + * @access private + */ + function getHTTPContentType() { + return 'text/xml'; + } + + /** + * gets the HTTP content type charset for the current response. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current response. + * @access private + */ + function getHTTPContentTypeCharset() { + return $this->soap_defencoding; + } + + /** + * add a method to the dispatch map (this has been replaced by the register method) + * + * @param string $methodname + * @param string $in array of input values + * @param string $out array of output values + * @access public + * @deprecated + */ + function add_to_map($methodname,$in,$out){ + $this->operations[$methodname] = array('name' => $methodname,'in' => $in,'out' => $out); + } + + /** + * register a service function with the server + * + * @param string $name the name of the PHP function, class.method or class..method + * @param array $in assoc array of input values: key = param name, value = param type + * @param array $out assoc array of output values: key = param name, value = param type + * @param mixed $namespace the element namespace for the method or false + * @param mixed $soapaction the soapaction for the method or false + * @param mixed $style optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically + * @param mixed $use optional (encoded|literal) or false + * @param string $documentation optional Description to include in WSDL + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @access public + */ + function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){ + global $HTTP_SERVER_VARS; + + if($this->externalWSDLURL){ + die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.'); + } + if (! $name) { + die('You must specify a name when you register an operation'); + } + if (!is_array($in)) { + die('You must provide an array for operation inputs'); + } + if (!is_array($out)) { + die('You must provide an array for operation outputs'); + } + if(false == $namespace) { + } + if(false == $soapaction) { + if (isset($_SERVER)) { + $SERVER_NAME = $_SERVER['SERVER_NAME']; + $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; + $HTTPS = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : (isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'); + } elseif (isset($HTTP_SERVER_VARS)) { + $SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME']; + $SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']; + $HTTPS = isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + if ($HTTPS == '1' || $HTTPS == 'on') { + $SCHEME = 'https'; + } else { + $SCHEME = 'http'; + } + $soapaction = "$SCHEME://$SERVER_NAME$SCRIPT_NAME/$name"; + } + if(false == $style) { + $style = "rpc"; + } + if(false == $use) { + $use = "encoded"; + } + if ($use == 'encoded' && $encodingStyle == '') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } + + $this->operations[$name] = array( + 'name' => $name, + 'in' => $in, + 'out' => $out, + 'namespace' => $namespace, + 'soapaction' => $soapaction, + 'style' => $style); + if($this->wsdl){ + $this->wsdl->addOperation($name,$in,$out,$namespace,$soapaction,$style,$use,$documentation,$encodingStyle); + } + return true; + } + + /** + * Specify a fault to be returned to the client. + * This also acts as a flag to the server that a fault has occurred. + * + * @param string $faultcode + * @param string $faultstring + * @param string $faultactor + * @param string $faultdetail + * @access public + */ + function fault($faultcode,$faultstring,$faultactor='',$faultdetail=''){ + if ($faultdetail == '' && $this->debug_flag) { + $faultdetail = $this->getDebug(); + } + $this->fault = new nusoap_fault($faultcode,$faultactor,$faultstring,$faultdetail); + $this->fault->soap_defencoding = $this->soap_defencoding; + } + + /** + * Sets up wsdl object. + * Acts as a flag to enable internal WSDL generation + * + * @param string $serviceName, name of the service + * @param mixed $namespace optional 'tns' service namespace or false + * @param mixed $endpoint optional URL of service endpoint or false + * @param string $style optional (rpc|document) WSDL style (also specified by operation) + * @param string $transport optional SOAP transport + * @param mixed $schemaTargetNamespace optional 'types' targetNamespace for service schema or false + */ + function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false) + { + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $SERVER_NAME = $_SERVER['SERVER_NAME']; + $SERVER_PORT = $_SERVER['SERVER_PORT']; + $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; + $HTTPS = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : (isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'); + } elseif (isset($HTTP_SERVER_VARS)) { + $SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME']; + $SERVER_PORT = $HTTP_SERVER_VARS['SERVER_PORT']; + $SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']; + $HTTPS = isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + // If server name has port number attached then strip it (else port number gets duplicated in WSDL output) (occurred using lighttpd and FastCGI) + $colon = strpos($SERVER_NAME,":"); + if ($colon) { + $SERVER_NAME = substr($SERVER_NAME, 0, $colon); + } + if ($SERVER_PORT == 80) { + $SERVER_PORT = ''; + } else { + $SERVER_PORT = ':' . $SERVER_PORT; + } + if(false == $namespace) { + $namespace = "http://$SERVER_NAME/soap/$serviceName"; + } + + if(false == $endpoint) { + if ($HTTPS == '1' || $HTTPS == 'on') { + $SCHEME = 'https'; + } else { + $SCHEME = 'http'; + } + $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME"; + } + + if(false == $schemaTargetNamespace) { + $schemaTargetNamespace = $namespace; + } + + $this->wsdl = new wsdl; + $this->wsdl->serviceName = $serviceName; + $this->wsdl->endpoint = $endpoint; + $this->wsdl->namespaces['tns'] = $namespace; + $this->wsdl->namespaces['soap'] = 'http://schemas.xmlsoap.org/wsdl/soap/'; + $this->wsdl->namespaces['wsdl'] = 'http://schemas.xmlsoap.org/wsdl/'; + if ($schemaTargetNamespace != $namespace) { + $this->wsdl->namespaces['types'] = $schemaTargetNamespace; + } + $this->wsdl->schemas[$schemaTargetNamespace][0] = new nusoap_xmlschema('', '', $this->wsdl->namespaces); + if ($style == 'document') { + $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaInfo['elementFormDefault'] = 'qualified'; + } + $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaTargetNamespace = $schemaTargetNamespace; + $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true); + $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/wsdl/'][0] = array('location' => '', 'loaded' => true); + $this->wsdl->bindings[$serviceName.'Binding'] = array( + 'name'=>$serviceName.'Binding', + 'style'=>$style, + 'transport'=>$transport, + 'portType'=>$serviceName.'PortType'); + $this->wsdl->ports[$serviceName.'Port'] = array( + 'binding'=>$serviceName.'Binding', + 'location'=>$endpoint, + 'bindingType'=>'http://schemas.xmlsoap.org/wsdl/soap/'); + } +} + +/** + * Backward compatibility + */ +class soap_server extends nusoap_server { +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_transport_http.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_transport_http.php new file mode 100755 index 000000000..75b2dc051 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_transport_http.php @@ -0,0 +1,1306 @@ + +* @author Scott Nichol +* @version $Id: class.soap_transport_http.php,v 1.68 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class soap_transport_http extends nusoap_base { + + var $url = ''; + var $uri = ''; + var $digest_uri = ''; + var $scheme = ''; + var $host = ''; + var $port = ''; + var $path = ''; + var $request_method = 'POST'; + var $protocol_version = '1.0'; + var $encoding = ''; + var $outgoing_headers = array(); + var $incoming_headers = array(); + var $incoming_cookies = array(); + var $outgoing_payload = ''; + var $incoming_payload = ''; + var $response_status_line; // HTTP response status line + var $useSOAPAction = true; + var $persistentConnection = false; + var $ch = false; // cURL handle + var $ch_options = array(); // cURL custom options + var $use_curl = false; // force cURL use + var $proxy = null; // proxy information (associative array) + var $username = ''; + var $password = ''; + var $authtype = ''; + var $digestRequest = array(); + var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional) + // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' + // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' + // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' + // passphrase: SSL key password/passphrase + // certpassword: SSL certificate password + // verifypeer: default is 1 + // verifyhost: default is 1 + + /** + * constructor + * + * @param string $url The URL to which to connect + * @param array $curl_options User-specified cURL options + * @param boolean $use_curl Whether to try to force cURL use + * @access public + */ + function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ + parent::nusoap_base(); + $this->debug("ctor url=$url use_curl=$use_curl curl_options:"); + $this->appendDebug($this->varDump($curl_options)); + $this->setURL($url); + if (is_array($curl_options)) { + $this->ch_options = $curl_options; + } + $this->use_curl = $use_curl; + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); + $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); + } + + /** + * sets a cURL option + * + * @param mixed $option The cURL option (always integer?) + * @param mixed $value The cURL option value + * @access private + */ + function setCurlOption($option, $value) { + $this->debug("setCurlOption option=$option, value="); + $this->appendDebug($this->varDump($value)); + curl_setopt($this->ch, $option, $value); + } + + /** + * sets an HTTP header + * + * @param string $name The name of the header + * @param string $value The value of the header + * @access private + */ + function setHeader($name, $value) { + $this->outgoing_headers[$name] = $value; + $this->debug("set header $name: $value"); + } + + /** + * unsets an HTTP header + * + * @param string $name The name of the header + * @access private + */ + function unsetHeader($name) { + if (isset($this->outgoing_headers[$name])) { + $this->debug("unset header $name"); + unset($this->outgoing_headers[$name]); + } + } + + /** + * sets the URL to which to connect + * + * @param string $url The URL to which to connect + * @access private + */ + function setURL($url) { + $this->url = $url; + + $u = parse_url($url); + foreach($u as $k => $v){ + $this->debug("parsed URL $k = $v"); + $this->$k = $v; + } + + // add any GET params to path + if(isset($u['query']) && $u['query'] != ''){ + $this->path .= '?' . $u['query']; + } + + // set default port + if(!isset($u['port'])){ + if($u['scheme'] == 'https'){ + $this->port = 443; + } else { + $this->port = 80; + } + } + + $this->uri = $this->path; + $this->digest_uri = $this->uri; + + // build headers + if (!isset($u['port'])) { + $this->setHeader('Host', $this->host); + } else { + $this->setHeader('Host', $this->host.':'.$this->port); + } + + if (isset($u['user']) && $u['user'] != '') { + $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); + } + } + + /** + * gets the I/O method to use + * + * @return string I/O method to use (socket|curl|unknown) + * @access private + */ + function io_method() { + if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) + return 'curl'; + if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) + return 'socket'; + return 'unknown'; + } + + /** + * establish an HTTP connection + * + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @return boolean true if connected, false if not + * @access private + */ + function connect($connection_timeout=0,$response_timeout=30){ + // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like + // "regular" socket. + // TODO: disabled for now because OpenSSL must be *compiled* in (not just + // loaded), and until PHP5 stream_get_wrappers is not available. +// if ($this->scheme == 'https') { +// if (version_compare(phpversion(), '4.3.0') >= 0) { +// if (extension_loaded('openssl')) { +// $this->scheme = 'ssl'; +// $this->debug('Using SSL over OpenSSL'); +// } +// } +// } + $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); + if ($this->io_method() == 'socket') { + if (!is_array($this->proxy)) { + $host = $this->host; + $port = $this->port; + } else { + $host = $this->proxy['host']; + $port = $this->proxy['port']; + } + + // use persistent connection + if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ + if (!feof($this->fp)) { + $this->debug('Re-use persistent connection'); + return true; + } + fclose($this->fp); + $this->debug('Closed persistent connection at EOF'); + } + + // munge host if using OpenSSL + if ($this->scheme == 'ssl') { + $host = 'ssl://' . $host; + } + $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); + + // open socket + if($connection_timeout > 0){ + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); + } else { + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); + } + + // test pointer + if(!$this->fp) { + $msg = 'Couldn\'t open socket connection to server ' . $this->url; + if ($this->errno) { + $msg .= ', Error ('.$this->errno.'): '.$this->error_str; + } else { + $msg .= ' prior to connect(). This is often a problem looking up the host name.'; + } + $this->debug($msg); + $this->setError($msg); + return false; + } + + // set response timeout + $this->debug('set response timeout to ' . $response_timeout); + socket_set_timeout( $this->fp, $response_timeout); + + $this->debug('socket connected'); + return true; + } else if ($this->io_method() == 'curl') { + if (!extension_loaded('curl')) { +// $this->setError('cURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); + $this->setError('The PHP cURL Extension is required for HTTPS or NLTM. You will need to re-build or update your PHP to include cURL or change php.ini to load the PHP cURL extension.'); + return false; + } + // Avoid warnings when PHP does not have these options + if (defined('CURLOPT_CONNECTIONTIMEOUT')) + $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; + else + $CURLOPT_CONNECTIONTIMEOUT = 78; + if (defined('CURLOPT_HTTPAUTH')) + $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; + else + $CURLOPT_HTTPAUTH = 107; + if (defined('CURLOPT_PROXYAUTH')) + $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; + else + $CURLOPT_PROXYAUTH = 111; + if (defined('CURLAUTH_BASIC')) + $CURLAUTH_BASIC = CURLAUTH_BASIC; + else + $CURLAUTH_BASIC = 1; + if (defined('CURLAUTH_DIGEST')) + $CURLAUTH_DIGEST = CURLAUTH_DIGEST; + else + $CURLAUTH_DIGEST = 2; + if (defined('CURLAUTH_NTLM')) + $CURLAUTH_NTLM = CURLAUTH_NTLM; + else + $CURLAUTH_NTLM = 8; + + $this->debug('connect using cURL'); + // init CURL + $this->ch = curl_init(); + // set url + $hostURL = ($this->port != '') ? "$this->scheme://$this->host:$this->port" : "$this->scheme://$this->host"; + // add path + $hostURL .= $this->path; + $this->setCurlOption(CURLOPT_URL, $hostURL); + // follow location headers (re-directs) + if (ini_get('safe_mode') || ini_get('open_basedir')) { + $this->debug('safe_mode or open_basedir set, so do not set CURLOPT_FOLLOWLOCATION'); + $this->debug('safe_mode = '); + $this->appendDebug($this->varDump(ini_get('safe_mode'))); + $this->debug('open_basedir = '); + $this->appendDebug($this->varDump(ini_get('open_basedir'))); + } else { + $this->setCurlOption(CURLOPT_FOLLOWLOCATION, 1); + } + // ask for headers in the response output + $this->setCurlOption(CURLOPT_HEADER, 1); + // ask for the response output as the return value + $this->setCurlOption(CURLOPT_RETURNTRANSFER, 1); + // encode + // We manage this ourselves through headers and encoding +// if(function_exists('gzuncompress')){ +// $this->setCurlOption(CURLOPT_ENCODING, 'deflate'); +// } + // persistent connection + if ($this->persistentConnection) { + // I believe the following comment is now bogus, having applied to + // the code when it used CURLOPT_CUSTOMREQUEST to send the request. + // The way we send data, we cannot use persistent connections, since + // there will be some "junk" at the end of our request. + //$this->setCurlOption(CURL_HTTP_VERSION_1_1, true); + $this->persistentConnection = false; + $this->setHeader('Connection', 'close'); + } + // set timeouts + if ($connection_timeout != 0) { + $this->setCurlOption($CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); + } + if ($response_timeout != 0) { + $this->setCurlOption(CURLOPT_TIMEOUT, $response_timeout); + } + + if ($this->scheme == 'https') { + $this->debug('set cURL SSL verify options'); + // recent versions of cURL turn on peer/host checking by default, + // while PHP binaries are not compiled with a default location for the + // CA cert bundle, so disable peer/host checking. + //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0); + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0); + + // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) + if ($this->authtype == 'certificate') { + $this->debug('set cURL certificate options'); + if (isset($this->certRequest['cainfofile'])) { + $this->setCurlOption(CURLOPT_CAINFO, $this->certRequest['cainfofile']); + } + if (isset($this->certRequest['verifypeer'])) { + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); + } else { + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 1); + } + if (isset($this->certRequest['verifyhost'])) { + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); + } else { + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 1); + } + if (isset($this->certRequest['sslcertfile'])) { + $this->setCurlOption(CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); + } + if (isset($this->certRequest['sslkeyfile'])) { + $this->setCurlOption(CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); + } + if (isset($this->certRequest['passphrase'])) { + $this->setCurlOption(CURLOPT_SSLKEYPASSWD, $this->certRequest['passphrase']); + } + if (isset($this->certRequest['certpassword'])) { + $this->setCurlOption(CURLOPT_SSLCERTPASSWD, $this->certRequest['certpassword']); + } + } + } + if ($this->authtype && ($this->authtype != 'certificate')) { + if ($this->username) { + $this->debug('set cURL username/password'); + $this->setCurlOption(CURLOPT_USERPWD, "$this->username:$this->password"); + } + if ($this->authtype == 'basic') { + $this->debug('set cURL for Basic authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_BASIC); + } + if ($this->authtype == 'digest') { + $this->debug('set cURL for digest authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_DIGEST); + } + if ($this->authtype == 'ntlm') { + $this->debug('set cURL for NTLM authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_NTLM); + } + } + if (is_array($this->proxy)) { + $this->debug('set cURL proxy options'); + if ($this->proxy['port'] != '') { + $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host'].':'.$this->proxy['port']); + } else { + $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host']); + } + if ($this->proxy['username'] || $this->proxy['password']) { + $this->debug('set cURL proxy authentication options'); + $this->setCurlOption(CURLOPT_PROXYUSERPWD, $this->proxy['username'].':'.$this->proxy['password']); + if ($this->proxy['authtype'] == 'basic') { + $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_BASIC); + } + if ($this->proxy['authtype'] == 'ntlm') { + $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_NTLM); + } + } + } + $this->debug('cURL connection set up'); + return true; + } else { + $this->setError('Unknown scheme ' . $this->scheme); + $this->debug('Unknown scheme ' . $this->scheme); + return false; + } + } + + /** + * sends the SOAP request and gets the SOAP response via HTTP[S] + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { + + $this->debug('entered send() with data of length: '.strlen($data)); + + $this->tryagain = true; + $tries = 0; + while ($this->tryagain) { + $this->tryagain = false; + if ($tries++ < 2) { + // make connnection + if (!$this->connect($timeout, $response_timeout)){ + return false; + } + + // send request + if (!$this->sendRequest($data, $cookies)){ + return false; + } + + // get response + $respdata = $this->getResponse(); + } else { + $this->setError("Too many tries to get an OK response ($this->response_status_line)"); + } + } + $this->debug('end of send()'); + return $respdata; + } + + + /** + * sends the SOAP request and gets the SOAP response via HTTPS using CURL + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + * @deprecated + */ + function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { + return $this->send($data, $timeout, $response_timeout, $cookies); + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $digestRequest (keys must be nonce, nc, realm, qop) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype digestRequest="); + $this->appendDebug($this->varDump($digestRequest)); + $this->debug("certRequest="); + $this->appendDebug($this->varDump($certRequest)); + // cf. RFC 2617 + if ($authtype == 'basic') { + $this->setHeader('Authorization', 'Basic '.base64_encode(str_replace(':','',$username).':'.$password)); + } elseif ($authtype == 'digest') { + if (isset($digestRequest['nonce'])) { + $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; + + // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) + + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd + $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; + + // H(A1) = MD5(A1) + $HA1 = md5($A1); + + // A2 = Method ":" digest-uri-value + $A2 = $this->request_method . ':' . $this->digest_uri; + + // H(A2) + $HA2 = md5($A2); + + // KD(secret, data) = H(concat(secret, ":", data)) + // if qop == auth: + // request-digest = <"> < KD ( H(A1), unq(nonce-value) + // ":" nc-value + // ":" unq(cnonce-value) + // ":" unq(qop-value) + // ":" H(A2) + // ) <"> + // if qop is missing, + // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> + + $unhashedDigest = ''; + $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; + $cnonce = $nonce; + if ($digestRequest['qop'] != '') { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; + } else { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; + } + + $hashedDigest = md5($unhashedDigest); + + $opaque = ''; + if (isset($digestRequest['opaque'])) { + $opaque = ', opaque="' . $digestRequest['opaque'] . '"'; + } + + $this->setHeader('Authorization', 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . $opaque . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'); + } + } elseif ($authtype == 'certificate') { + $this->certRequest = $certRequest; + $this->debug('Authorization header not set for certificate'); + } elseif ($authtype == 'ntlm') { + // do nothing + $this->debug('Authorization header not set for ntlm'); + } + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->digestRequest = $digestRequest; + } + + /** + * set the soapaction value + * + * @param string $soapaction + * @access public + */ + function setSOAPAction($soapaction) { + $this->setHeader('SOAPAction', '"' . $soapaction . '"'); + } + + /** + * use http encoding + * + * @param string $enc encoding style. supported values: gzip, deflate, or both + * @access public + */ + function setEncoding($enc='gzip, deflate') { + if (function_exists('gzdeflate')) { + $this->protocol_version = '1.1'; + $this->setHeader('Accept-Encoding', $enc); + if (!isset($this->outgoing_headers['Connection'])) { + $this->setHeader('Connection', 'close'); + $this->persistentConnection = false; + } + // deprecated as of PHP 5.3.0 + //set_magic_quotes_runtime(0); + $this->encoding = $enc; + } + } + + /** + * set proxy info here + * + * @param string $proxyhost use an empty string to remove proxy + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @param string $proxyauthtype (basic|ntlm) + * @access public + */ + function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '', $proxyauthtype = 'basic') { + if ($proxyhost) { + $this->proxy = array( + 'host' => $proxyhost, + 'port' => $proxyport, + 'username' => $proxyusername, + 'password' => $proxypassword, + 'authtype' => $proxyauthtype + ); + if ($proxyusername != '' && $proxypassword != '' && $proxyauthtype = 'basic') { + $this->setHeader('Proxy-Authorization', ' Basic '.base64_encode($proxyusername.':'.$proxypassword)); + } + } else { + $this->debug('remove proxy'); + $proxy = null; + unsetHeader('Proxy-Authorization'); + } + } + + + /** + * Test if the given string starts with a header that is to be skipped. + * Skippable headers result from chunked transfer and proxy requests. + * + * @param string $data The string to check. + * @returns boolean Whether a skippable header was found. + * @access private + */ + function isSkippableCurlHeader(&$data) { + $skipHeaders = array( 'HTTP/1.1 100', + 'HTTP/1.0 301', + 'HTTP/1.1 301', + 'HTTP/1.0 302', + 'HTTP/1.1 302', + 'HTTP/1.0 401', + 'HTTP/1.1 401', + 'HTTP/1.0 200 Connection established'); + foreach ($skipHeaders as $hd) { + $prefix = substr($data, 0, strlen($hd)); + if ($prefix == $hd) return true; + } + + return false; + } + + /** + * decode a string that is encoded w/ "chunked' transfer encoding + * as defined in RFC2068 19.4.6 + * + * @param string $buffer + * @param string $lb + * @returns string + * @access public + * @deprecated + */ + function decodeChunked($buffer, $lb){ + // length := 0 + $length = 0; + $new = ''; + + // read chunk-size, chunk-extension (if any) and CRLF + // get the position of the linebreak + $chunkend = strpos($buffer, $lb); + if ($chunkend == FALSE) { + $this->debug('no linebreak found in decodeChunked'); + return $new; + } + $temp = substr($buffer,0,$chunkend); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend + strlen($lb); + // while (chunk-size > 0) { + while ($chunk_size > 0) { + $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); + $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); + + // Just in case we got a broken connection + if ($chunkend == FALSE) { + $chunk = substr($buffer,$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + $length += strlen($chunk); + break; + } + + // read chunk-data and CRLF + $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + // length := length + chunk-size + $length += strlen($chunk); + // read chunk-size and CRLF + $chunkstart = $chunkend + strlen($lb); + + $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); + if ($chunkend == FALSE) { + break; //Just in case we got a broken connection + } + $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + } + return $new; + } + + /** + * Writes the payload, including HTTP headers, to $this->outgoing_payload. + * + * @param string $data HTTP body + * @param string $cookie_str data for HTTP Cookie header + * @return void + * @access private + */ + function buildPayload($data, $cookie_str = '') { + // Note: for cURL connections, $this->outgoing_payload is ignored, + // as is the Content-Length header, but these are still created as + // debugging guides. + + // add content-length header + if ($this->request_method != 'GET') { + $this->setHeader('Content-Length', strlen($data)); + } + + // start building outgoing payload: + if ($this->proxy) { + $uri = $this->url; + } else { + $uri = $this->uri; + } + $req = "$this->request_method $uri HTTP/$this->protocol_version"; + $this->debug("HTTP request: $req"); + $this->outgoing_payload = "$req\r\n"; + + // loop thru headers, serializing + foreach($this->outgoing_headers as $k => $v){ + $hdr = $k.': '.$v; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // add any cookies + if ($cookie_str != '') { + $hdr = 'Cookie: '.$cookie_str; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // header/body separator + $this->outgoing_payload .= "\r\n"; + + // add data + $this->outgoing_payload .= $data; + } + + /** + * sends the SOAP request via HTTP[S] + * + * @param string $data message data + * @param array $cookies cookies to send + * @return boolean true if OK, false if problem + * @access private + */ + function sendRequest($data, $cookies = NULL) { + // build cookie string + $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); + + // build payload + $this->buildPayload($data, $cookie_str); + + if ($this->io_method() == 'socket') { + // send payload + if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { + $this->setError('couldn\'t write message data to socket'); + $this->debug('couldn\'t write message data to socket'); + return false; + } + $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); + return true; + } else if ($this->io_method() == 'curl') { + // set payload + // cURL does say this should only be the verb, and in fact it + // turns out that the URI and HTTP version are appended to this, which + // some servers refuse to work with (so we no longer use this method!) + //$this->setCurlOption(CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); + $curl_headers = array(); + foreach($this->outgoing_headers as $k => $v){ + if ($k == 'Connection' || $k == 'Content-Length' || $k == 'Host' || $k == 'Authorization' || $k == 'Proxy-Authorization') { + $this->debug("Skip cURL header $k: $v"); + } else { + $curl_headers[] = "$k: $v"; + } + } + if ($cookie_str != '') { + $curl_headers[] = 'Cookie: ' . $cookie_str; + } + $this->setCurlOption(CURLOPT_HTTPHEADER, $curl_headers); + $this->debug('set cURL HTTP headers'); + if ($this->request_method == "POST") { + $this->setCurlOption(CURLOPT_POST, 1); + $this->setCurlOption(CURLOPT_POSTFIELDS, $data); + $this->debug('set cURL POST data'); + } else { + } + // insert custom user-set cURL options + foreach ($this->ch_options as $key => $val) { + $this->setCurlOption($key, $val); + } + + $this->debug('set cURL payload'); + return true; + } + } + + /** + * gets the SOAP response via HTTP[S] + * + * @return string the response (also sets member variables like incoming_payload) + * @access private + */ + function getResponse(){ + $this->incoming_payload = ''; + + if ($this->io_method() == 'socket') { + // loop until headers have been retrieved + $data = ''; + while (!isset($lb)){ + + // We might EOF during header read. + if(feof($this->fp)) { + $this->incoming_payload = $data; + $this->debug('found no headers before EOF after length ' . strlen($data)); + $this->debug("received before EOF:\n" . $data); + $this->setError('server failed to send headers'); + return false; + } + + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read line of $tmplen bytes: " . trim($tmp)); + + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of headers timed out after length ' . strlen($data)); + $this->debug("read before timeout: " . $data); + $this->setError('socket read of headers timed out'); + return false; + } + + $data .= $tmp; + $pos = strpos($data,"\r\n\r\n"); + if($pos > 1){ + $lb = "\r\n"; + } else { + $pos = strpos($data,"\n\n"); + if($pos > 1){ + $lb = "\n"; + } + } + // remove 100 headers + if (isset($lb) && preg_match('/^HTTP\/1.1 100/',$data)) { + unset($lb); + $data = ''; + }// + } + // store header data + $this->incoming_payload .= $data; + $this->debug('found end of headers after length ' . strlen($data)); + // process headers + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $this->incoming_headers = array(); + $this->incoming_cookies = array(); + foreach($header_array as $header_line){ + $arr = explode(':',$header_line, 2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + + // loop until msg has been received + if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { + $content_length = 2147483647; // ignore any content-length header + $chunked = true; + $this->debug("want to read chunked content"); + } elseif (isset($this->incoming_headers['content-length'])) { + $content_length = $this->incoming_headers['content-length']; + $chunked = false; + $this->debug("want to read content of length $content_length"); + } else { + $content_length = 2147483647; + $chunked = false; + $this->debug("want to read content to EOF"); + } + $data = ''; + do { + if ($chunked) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk line of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk length timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk length timed out'); + return false; + } + $content_length = hexdec(trim($tmp)); + $this->debug("chunk length $content_length"); + } + $strlen = 0; + while (($strlen < $content_length) && (!feof($this->fp))) { + $readlen = min(8192, $content_length - $strlen); + $tmp = fread($this->fp, $readlen); + $tmplen = strlen($tmp); + $this->debug("read buffer of $tmplen bytes"); + if (($tmplen == 0) && (!feof($this->fp))) { + $this->incoming_payload = $data; + $this->debug('socket read of body timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of body timed out'); + return false; + } + $strlen += $tmplen; + $data .= $tmp; + } + if ($chunked && ($content_length > 0)) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk terminator of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk terminator timed out'); + return false; + } + } + } while ($chunked && ($content_length > 0) && (!feof($this->fp))); + if (feof($this->fp)) { + $this->debug('read to EOF'); + } + $this->debug('read body of length ' . strlen($data)); + $this->incoming_payload .= $data; + $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); + + // close filepointer + if( + (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || + (! $this->persistentConnection) || feof($this->fp)){ + fclose($this->fp); + $this->fp = false; + $this->debug('closed socket'); + } + + // connection was closed unexpectedly + if($this->incoming_payload == ''){ + $this->setError('no response from server'); + return false; + } + + // decode transfer-encoding +// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ +// if(!$data = $this->decodeChunked($data, $lb)){ +// $this->setError('Decoding of chunked data failed'); +// return false; +// } + //print "
        \nde-chunked:\n---------------\n$data\n\n---------------\n
        "; + // set decoded payload +// $this->incoming_payload = $header_data.$lb.$lb.$data; +// } + + } else if ($this->io_method() == 'curl') { + // send and receive + $this->debug('send and receive with cURL'); + $this->incoming_payload = curl_exec($this->ch); + $data = $this->incoming_payload; + + $cErr = curl_error($this->ch); + if ($cErr != '') { + $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
        '; + // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE + foreach(curl_getinfo($this->ch) as $k => $v){ + $err .= "$k: $v
        "; + } + $this->debug($err); + $this->setError($err); + curl_close($this->ch); + return false; + } else { + //echo '
        ';
        +			//var_dump(curl_getinfo($this->ch));
        +			//echo '
        '; + } + // close curl + $this->debug('No cURL error, closing cURL'); + curl_close($this->ch); + + // try removing skippable headers + $savedata = $data; + while ($this->isSkippableCurlHeader($data)) { + $this->debug("Found HTTP header to skip"); + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + + if ($data == '') { + // have nothing left; just remove 100 header(s) + $data = $savedata; + while (preg_match('/^HTTP\/1.1 100/',$data)) { + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + } + + // separate content from HTTP headers + if ($pos = strpos($data,"\r\n\r\n")) { + $lb = "\r\n"; + } elseif( $pos = strpos($data,"\n\n")) { + $lb = "\n"; + } else { + $this->debug('no proper separation of headers and document'); + $this->setError('no proper separation of headers and document'); + return false; + } + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $data = ltrim(substr($data,$pos)); + $this->debug('found proper separation of headers and document'); + $this->debug('cleaned data, stringlen: '.strlen($data)); + // clean headers + foreach ($header_array as $header_line) { + $arr = explode(':',$header_line,2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + } + + $this->response_status_line = $header_array[0]; + $arr = explode(' ', $this->response_status_line, 3); + $http_version = $arr[0]; + $http_status = (int)($arr[1]); + $http_reason = count($arr) > 2 ? $arr[2] : ''; + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['location']) && ($http_status == 301 || $http_status == 302)) { + $this->debug("Got $http_status $http_reason with Location: " . $this->incoming_headers['location']); + $this->setURL($this->incoming_headers['location']); + $this->tryagain = true; + return false; + } + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { + $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); + if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { + $this->debug('Server wants digest authentication'); + // remove "Digest " from our elements + $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); + + // parse elements into array + $digestElements = explode(',', $digestString); + foreach ($digestElements as $val) { + $tempElement = explode('=', trim($val), 2); + $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); + } + + // should have (at least) qop, realm, nonce + if (isset($digestRequest['nonce'])) { + $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); + $this->tryagain = true; + return false; + } + } + $this->debug('HTTP authentication failed'); + $this->setError('HTTP authentication failed'); + return false; + } + + if ( + ($http_status >= 300 && $http_status <= 307) || + ($http_status >= 400 && $http_status <= 417) || + ($http_status >= 501 && $http_status <= 505) + ) { + $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)"); + return false; + } + + // decode content-encoding + if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ + if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate')){ + //$timer->setMarker('starting decoding of gzip/deflated content'); + // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) + // this means there are no Zlib headers, although there should be + $this->debug('The gzinflate function exists'); + $datalen = strlen($data); + if ($this->incoming_headers['content-encoding'] == 'deflate') { + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The inflated payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to inflate the payload'); + $this->setError('Error using gzinflate to inflate the payload'); + } + } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { + if ($degzdata = @gzinflate(substr($data, 10))) { // do our best + $data = $degzdata; + $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate(substr($data, 10))) { + $data = $degzdata; + $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to un-gzip the payload'); + $this->setError('Error using gzinflate to un-gzip the payload'); + } + } + //$timer->setMarker('finished decoding of gzip/deflated content'); + //print "\nde-inflated:\n---------------\n$data\n-------------\n"; + // set decoded payload + $this->incoming_payload = $header_data.$lb.$lb.$data; + } else { + $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + } + } else { + $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + } + } else { + $this->debug('No Content-Encoding header'); + } + + if(strlen($data) == 0){ + $this->debug('no data after headers!'); + $this->setError('no data present after HTTP headers'); + return false; + } + + return $data; + } + + /** + * sets the content-type for the SOAP message to be sent + * + * @param string $type the content type, MIME style + * @param mixed $charset character set used for encoding (or false) + * @access public + */ + function setContentType($type, $charset = false) { + $this->setHeader('Content-Type', $type . ($charset ? '; charset=' . $charset : '')); + } + + /** + * specifies that an HTTP persistent connection should be used + * + * @return boolean whether the request was honored by this method. + * @access public + */ + function usePersistentConnection(){ + if (isset($this->outgoing_headers['Accept-Encoding'])) { + return false; + } + $this->protocol_version = '1.1'; + $this->persistentConnection = true; + $this->setHeader('Connection', 'Keep-Alive'); + return true; + } + + /** + * parse an incoming Cookie into it's parts + * + * @param string $cookie_str content of cookie + * @return array with data of that cookie + * @access private + */ + /* + * TODO: allow a Set-Cookie string to be parsed into multiple cookies + */ + function parseCookie($cookie_str) { + $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; + $data = preg_split('/;/', $cookie_str); + $value_str = $data[0]; + + $cookie_param = 'domain='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $domain = substr($cookie_str, $start + strlen($cookie_param)); + $domain = substr($domain, 0, strpos($domain, ';')); + } else { + $domain = ''; + } + + $cookie_param = 'expires='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $expires = substr($cookie_str, $start + strlen($cookie_param)); + $expires = substr($expires, 0, strpos($expires, ';')); + } else { + $expires = ''; + } + + $cookie_param = 'path='; + $start = strpos($cookie_str, $cookie_param); + if ( $start > 0 ) { + $path = substr($cookie_str, $start + strlen($cookie_param)); + $path = substr($path, 0, strpos($path, ';')); + } else { + $path = '/'; + } + + $cookie_param = ';secure;'; + if (strpos($cookie_str, $cookie_param) !== FALSE) { + $secure = true; + } else { + $secure = false; + } + + $sep_pos = strpos($value_str, '='); + + if ($sep_pos) { + $name = substr($value_str, 0, $sep_pos); + $value = substr($value_str, $sep_pos + 1); + $cookie= array( 'name' => $name, + 'value' => $value, + 'domain' => $domain, + 'path' => $path, + 'expires' => $expires, + 'secure' => $secure + ); + return $cookie; + } + return false; + } + + /** + * sort out cookies for the current request + * + * @param array $cookies array with all cookies + * @param boolean $secure is the send-content secure or not? + * @return string for Cookie-HTTP-Header + * @access private + */ + function getCookiesForRequest($cookies, $secure=false) { + $cookie_str = ''; + if ((! is_null($cookies)) && (is_array($cookies))) { + foreach ($cookies as $cookie) { + if (! is_array($cookie)) { + continue; + } + $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) <= time()) { + $this->debug('cookie has expired'); + continue; + } + } + if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + $domain = preg_quote($cookie['domain']); + if (! preg_match("'.*$domain$'i", $this->host)) { + $this->debug('cookie has different domain'); + continue; + } + } + if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + $path = preg_quote($cookie['path']); + if (! preg_match("'^$path.*'i", $this->path)) { + $this->debug('cookie is for a different path'); + continue; + } + } + if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { + $this->debug('cookie is secure, transport is not'); + continue; + } + $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; + $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); + } + } + return $cookie_str; + } +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_val.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_val.php new file mode 100755 index 000000000..f92feb6cc --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soap_val.php @@ -0,0 +1,106 @@ + +* @version $Id: class.soap_val.php,v 1.11 2007/04/06 13:56:32 snichol Exp $ +* @access public +*/ +class soapval extends nusoap_base { + /** + * The XML element name + * + * @var string + * @access private + */ + var $name; + /** + * The XML type name (string or false) + * + * @var mixed + * @access private + */ + var $type; + /** + * The PHP value + * + * @var mixed + * @access private + */ + var $value; + /** + * The XML element namespace (string or false) + * + * @var mixed + * @access private + */ + var $element_ns; + /** + * The XML type namespace (string or false) + * + * @var mixed + * @access private + */ + var $type_ns; + /** + * The XML element attributes (array or false) + * + * @var mixed + * @access private + */ + var $attributes; + + /** + * constructor + * + * @param string $name optional name + * @param mixed $type optional type name + * @param mixed $value optional value + * @param mixed $element_ns optional namespace of value + * @param mixed $type_ns optional namespace of type + * @param mixed $attributes associative array of attributes to add to element serialization + * @access public + */ + function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { + parent::nusoap_base(); + $this->name = $name; + $this->type = $type; + $this->value = $value; + $this->element_ns = $element_ns; + $this->type_ns = $type_ns; + $this->attributes = $attributes; + } + + /** + * return serialized value + * + * @param string $use The WSDL use value (encoded|literal) + * @return string XML data + * @access public + */ + function serialize($use='encoded') { + return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true); + } + + /** + * decodes a soapval object into a PHP native type + * + * @return mixed + * @access public + */ + function decode(){ + return $this->value; + } +} + + + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soapclient.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soapclient.php new file mode 100755 index 000000000..002a9e297 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.soapclient.php @@ -0,0 +1,991 @@ +call( string methodname [ ,array parameters] ); +* +* // bye bye client +* unset($soapclient); +* +* @author Dietrich Ayala +* @author Scott Nichol +* @version $Id: class.soapclient.php,v 1.69 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_client extends nusoap_base { + + var $username = ''; // Username for HTTP authentication + var $password = ''; // Password for HTTP authentication + var $authtype = ''; // Type of HTTP authentication + var $certRequest = array(); // Certificate for HTTP SSL authentication + var $requestHeaders = false; // SOAP headers in request (text) + var $responseHeaders = ''; // SOAP headers from response (incomplete namespace resolution) (text) + var $responseHeader = NULL; // SOAP Header from response (parsed) + var $document = ''; // SOAP body response portion (incomplete namespace resolution) (text) + var $endpoint; + var $forceEndpoint = ''; // overrides WSDL endpoint + var $proxyhost = ''; + var $proxyport = ''; + var $proxyusername = ''; + var $proxypassword = ''; + var $portName = ''; // port name to use in WSDL + var $xml_encoding = ''; // character set encoding of incoming (response) messages + var $http_encoding = false; + var $timeout = 0; // HTTP connection timeout + var $response_timeout = 30; // HTTP response timeout + var $endpointType = ''; // soap|wsdl, empty for WSDL initialization error + var $persistentConnection = false; + var $defaultRpcParams = false; // This is no longer used + var $request = ''; // HTTP request + var $response = ''; // HTTP response + var $responseData = ''; // SOAP payload of response + var $cookies = array(); // Cookies from response or for request + var $decode_utf8 = true; // toggles whether the parser decodes element content w/ utf8_decode() + var $operations = array(); // WSDL operations, empty for WSDL initialization error + var $curl_options = array(); // User-specified cURL options + var $bindingType = ''; // WSDL operation binding type + var $use_curl = false; // whether to always try to use cURL + + /* + * fault related variables + */ + /** + * @var fault + * @access public + */ + var $fault; + /** + * @var faultcode + * @access public + */ + var $faultcode; + /** + * @var faultstring + * @access public + */ + var $faultstring; + /** + * @var faultdetail + * @access public + */ + var $faultdetail; + + /** + * constructor + * + * @param mixed $endpoint SOAP server or WSDL URL (string), or wsdl instance (object) + * @param mixed $wsdl optional, set to 'wsdl' or true if using WSDL + * @param string $proxyhost optional + * @param string $proxyport optional + * @param string $proxyusername optional + * @param string $proxypassword optional + * @param integer $timeout set the connection timeout + * @param integer $response_timeout set the response timeout + * @param string $portName optional portName in WSDL document + * @access public + */ + function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ + parent::nusoap_base(); + $this->endpoint = $endpoint; + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + $this->timeout = $timeout; + $this->response_timeout = $response_timeout; + $this->portName = $portName; + + $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); + $this->appendDebug('endpoint=' . $this->varDump($endpoint)); + + // make values + if($wsdl){ + if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) { + $this->wsdl = $endpoint; + $this->endpoint = $this->wsdl->wsdl; + $this->wsdlFile = $this->endpoint; + $this->debug('existing wsdl instance created from ' . $this->endpoint); + $this->checkWSDL(); + } else { + $this->wsdlFile = $this->endpoint; + $this->wsdl = null; + $this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint); + } + $this->endpointType = 'wsdl'; + } else { + $this->debug("instantiate SOAP with endpoint at $endpoint"); + $this->endpointType = 'soap'; + } + } + + /** + * calls method, returns PHP native type + * + * @param string $operation SOAP server URL or path + * @param mixed $params An array, associative or simple, of the parameters + * for the method call, or a string that is the XML + * for the call. For rpc style, this call will + * wrap the XML in a tag named after the method, as + * well as the SOAP Envelope and Body. For document + * style, this will only wrap with the Envelope and Body. + * IMPORTANT: when using an array with document style, + * in which case there + * is really one parameter, the root of the fragment + * used in the call, which encloses what programmers + * normally think of parameters. A parameter array + * *must* include the wrapper. + * @param string $namespace optional method namespace (WSDL can override) + * @param string $soapAction optional SOAPAction value (WSDL can override) + * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array + * @param boolean $rpcParams optional (no longer used) + * @param string $style optional (rpc|document) the style to use when serializing parameters (WSDL can override) + * @param string $use optional (encoded|literal) the use when serializing parameters (WSDL can override) + * @return mixed response from SOAP call, normally an associative array mirroring the structure of the XML response, false for certain fatal errors + * @access public + */ + function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAction='',$headers=false,$rpcParams=null,$style='rpc',$use='encoded'){ + $this->operation = $operation; + $this->fault = false; + $this->setError(''); + $this->request = ''; + $this->response = ''; + $this->responseData = ''; + $this->faultstring = ''; + $this->faultcode = ''; + $this->opData = array(); + + $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType"); + $this->appendDebug('params=' . $this->varDump($params)); + $this->appendDebug('headers=' . $this->varDump($headers)); + if ($headers) { + $this->requestHeaders = $headers; + } + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) + return false; + } + // serialize parameters + if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){ + // use WSDL for operation + $this->opData = $opData; + $this->debug("found operation"); + $this->appendDebug('opData=' . $this->varDump($opData)); + if (isset($opData['soapAction'])) { + $soapAction = $opData['soapAction']; + } + if (! $this->forceEndpoint) { + $this->endpoint = $opData['endpoint']; + } else { + $this->endpoint = $this->forceEndpoint; + } + $namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] : $namespace; + $style = $opData['style']; + $use = $opData['input']['use']; + // add ns to ns array + if($namespace != '' && !isset($this->wsdl->namespaces[$namespace])){ + $nsPrefix = 'ns' . rand(1000, 9999); + $this->wsdl->namespaces[$nsPrefix] = $namespace; + } + $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace); + // serialize payload + if (is_string($params)) { + $this->debug("serializing param string for WSDL operation $operation"); + $payload = $params; + } elseif (is_array($params)) { + $this->debug("serializing param array for WSDL operation $operation"); + $payload = $this->wsdl->serializeRPCParameters($operation,'input',$params,$this->bindingType); + } else { + $this->debug('params must be array or string'); + $this->setError('params must be array or string'); + return false; + } + $usedNamespaces = $this->wsdl->usedNamespaces; + if (isset($opData['input']['encodingStyle'])) { + $encodingStyle = $opData['input']['encodingStyle']; + } else { + $encodingStyle = ''; + } + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if ($errstr = $this->wsdl->getError()) { + $this->debug('got wsdl error: '.$errstr); + $this->setError('wsdl error: '.$errstr); + return false; + } + } elseif($this->endpointType == 'wsdl') { + // operation not in WSDL + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->setError('operation '.$operation.' not present in WSDL.'); + $this->debug("operation '$operation' not present in WSDL."); + return false; + } else { + // no WSDL + //$this->namespaces['ns1'] = $namespace; + $nsPrefix = 'ns' . rand(1000, 9999); + // serialize + $payload = ''; + if (is_string($params)) { + $this->debug("serializing param string for operation $operation"); + $payload = $params; + } elseif (is_array($params)) { + $this->debug("serializing param array for operation $operation"); + foreach($params as $k => $v){ + $payload .= $this->serialize_val($v,$k,false,false,false,false,$use); + } + } else { + $this->debug('params must be array or string'); + $this->setError('params must be array or string'); + return false; + } + $usedNamespaces = array(); + if ($use == 'encoded') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } else { + $encodingStyle = ''; + } + } + // wrap RPC calls with method element + if ($style == 'rpc') { + if ($use == 'literal') { + $this->debug("wrapping RPC request with literal method element"); + if ($namespace) { + // http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace + $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" . + $payload . + ""; + } else { + $payload = "<$operation>" . $payload . ""; + } + } else { + $this->debug("wrapping RPC request with encoded method element"); + if ($namespace) { + $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" . + $payload . + ""; + } else { + $payload = "<$operation>" . + $payload . + ""; + } + } + } + // serialize envelope + $soapmsg = $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle); + $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle"); + $this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000)); + // send + $return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout); + if($errstr = $this->getError()){ + $this->debug('Error: '.$errstr); + return false; + } else { + $this->return = $return; + $this->debug('sent message successfully and got a(n) '.gettype($return)); + $this->appendDebug('return=' . $this->varDump($return)); + + // fault? + if(is_array($return) && isset($return['faultcode'])){ + $this->debug('got fault'); + $this->setError($return['faultcode'].': '.$return['faultstring']); + $this->fault = true; + foreach($return as $k => $v){ + $this->$k = $v; + $this->debug("$k = $v
        "); + } + return $return; + } elseif ($style == 'document') { + // NOTE: if the response is defined to have multiple parts (i.e. unwrapped), + // we are only going to return the first part here...sorry about that + return $return; + } else { + // array of return values + if(is_array($return)){ + // multiple 'out' parameters, which we return wrapped up + // in the array + if(sizeof($return) > 1){ + return $return; + } + // single 'out' parameter (normally the return value) + $return = array_shift($return); + $this->debug('return shifted value: '); + $this->appendDebug($this->varDump($return)); + return $return; + // nothing returned (ie, echoVoid) + } else { + return ""; + } + } + } + } + + /** + * check WSDL passed as an instance or pulled from an endpoint + * + * @access private + */ + function checkWSDL() { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('checkWSDL'); + // catch errors + if ($errstr = $this->wsdl->getError()) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('got wsdl error: '.$errstr); + $this->setError('wsdl error: '.$errstr); + } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap')) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->bindingType = 'soap'; + $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType); + } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap12')) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->bindingType = 'soap12'; + $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType); + $this->debug('**************** WARNING: SOAP 1.2 BINDING *****************'); + } else { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('getOperations returned false'); + $this->setError('no operations defined in the WSDL document!'); + } + } + + /** + * instantiate wsdl object and parse wsdl file + * + * @access public + */ + function loadWSDL() { + $this->debug('instantiating wsdl class with doc: '.$this->wsdlFile); + $this->wsdl = new wsdl('',$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout,$this->curl_options,$this->use_curl); + $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest); + $this->wsdl->fetchWSDL($this->wsdlFile); + $this->checkWSDL(); + } + + /** + * get available data pertaining to an operation + * + * @param string $operation operation name + * @return array array of data pertaining to the operation + * @access public + */ + function getOperationData($operation){ + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) + return false; + } + if(isset($this->operations[$operation])){ + return $this->operations[$operation]; + } + $this->debug("No data for operation: $operation"); + } + + /** + * send the SOAP message + * + * Note: if the operation has multiple return values + * the return value of this method will be an array + * of those values. + * + * @param string $msg a SOAPx4 soapmsg object + * @param string $soapaction SOAPAction value + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @return mixed native PHP types. + * @access private + */ + function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) { + $this->checkCookies(); + // detect transport + switch(true){ + // http(s) + case preg_match('/^http/',$this->endpoint): + $this->debug('transporting via HTTP'); + if($this->persistentConnection == true && is_object($this->persistentConnection)){ + $http =& $this->persistentConnection; + } else { + $http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl); + if ($this->persistentConnection) { + $http->usePersistentConnection(); + } + } + $http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset()); + $http->setSOAPAction($soapaction); + if($this->proxyhost && $this->proxyport){ + $http->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword); + } + if($this->authtype != '') { + $http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest); + } + if($this->http_encoding != ''){ + $http->setEncoding($this->http_encoding); + } + $this->debug('sending message, length='.strlen($msg)); + if(preg_match('/^http:/',$this->endpoint)){ + //if(strpos($this->endpoint,'http:')){ + $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies); + } elseif(preg_match('/^https/',$this->endpoint)){ + //} elseif(strpos($this->endpoint,'https:')){ + //if(phpversion() == '4.3.0-dev'){ + //$response = $http->send($msg,$timeout,$response_timeout); + //$this->request = $http->outgoing_payload; + //$this->response = $http->incoming_payload; + //} else + $this->responseData = $http->sendHTTPS($msg,$timeout,$response_timeout,$this->cookies); + } else { + $this->setError('no http/s in endpoint url'); + } + $this->request = $http->outgoing_payload; + $this->response = $http->incoming_payload; + $this->appendDebug($http->getDebug()); + $this->UpdateCookies($http->incoming_cookies); + + // save transport object if using persistent connections + if ($this->persistentConnection) { + $http->clearDebug(); + if (!is_object($this->persistentConnection)) { + $this->persistentConnection = $http; + } + } + + if($err = $http->getError()){ + $this->setError('HTTP Error: '.$err); + return false; + } elseif($this->getError()){ + return false; + } else { + $this->debug('got response, length='. strlen($this->responseData).' type='.$http->incoming_headers['content-type']); + return $this->parseResponse($http->incoming_headers, $this->responseData); + } + break; + default: + $this->setError('no transport found, or selected transport is not yet supported!'); + return false; + break; + } + } + + /** + * processes SOAP message returned from server + * + * @param array $headers The HTTP headers + * @param string $data unprocessed response data from server + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseResponse($headers, $data) { + $this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:'); + $this->appendDebug($this->varDump($headers)); + if (!isset($headers['content-type'])) { + $this->setError('Response not of type text/xml (no content-type header)'); + return false; + } + if (!strstr($headers['content-type'], 'text/xml')) { + $this->setError('Response not of type text/xml: ' . $headers['content-type']); + return false; + } + if (strpos($headers['content-type'], '=')) { + $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); + $this->debug('Got response encoding: ' . $enc); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser'); + $parser = new nusoap_parser($data,$this->xml_encoding,$this->operation,$this->decode_utf8); + // add parser debug data to our debug + $this->appendDebug($parser->getDebug()); + // if parse errors + if($errstr = $parser->getError()){ + $this->setError( $errstr); + // destroy the parser object + unset($parser); + return false; + } else { + // get SOAP headers + $this->responseHeaders = $parser->getHeaders(); + // get SOAP headers + $this->responseHeader = $parser->get_soapheader(); + // get decoded message + $return = $parser->get_soapbody(); + // add document for doclit support + $this->document = $parser->document; + // destroy the parser object + unset($parser); + // return decode message + return $return; + } + } + + /** + * sets user-specified cURL options + * + * @param mixed $option The cURL option (always integer?) + * @param mixed $value The cURL option value + * @access public + */ + function setCurlOption($option, $value) { + $this->debug("setCurlOption option=$option, value="); + $this->appendDebug($this->varDump($value)); + $this->curl_options[$option] = $value; + } + + /** + * sets the SOAP endpoint, which can override WSDL + * + * @param string $endpoint The endpoint URL to use, or empty string or false to prevent override + * @access public + */ + function setEndpoint($endpoint) { + $this->debug("setEndpoint(\"$endpoint\")"); + $this->forceEndpoint = $endpoint; + } + + /** + * set the SOAP headers + * + * @param mixed $headers String of XML with SOAP header content, or array of soapval objects for SOAP headers + * @access public + */ + function setHeaders($headers){ + $this->debug("setHeaders headers="); + $this->appendDebug($this->varDump($headers)); + $this->requestHeaders = $headers; + } + + /** + * get the SOAP response headers (namespace resolution incomplete) + * + * @return string + * @access public + */ + function getHeaders(){ + return $this->responseHeaders; + } + + /** + * get the SOAP response Header (parsed) + * + * @return mixed + * @access public + */ + function getHeader(){ + return $this->responseHeader; + } + + /** + * set proxy info here + * + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @access public + */ + function setHTTPProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype certRequest="); + $this->appendDebug($this->varDump($certRequest)); + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->certRequest = $certRequest; + } + + /** + * use HTTP encoding + * + * @param string $enc HTTP encoding + * @access public + */ + function setHTTPEncoding($enc='gzip, deflate'){ + $this->debug("setHTTPEncoding(\"$enc\")"); + $this->http_encoding = $enc; + } + + /** + * Set whether to try to use cURL connections if possible + * + * @param boolean $use Whether to try to use cURL + * @access public + */ + function setUseCURL($use) { + $this->debug("setUseCURL($use)"); + $this->use_curl = $use; + } + + /** + * use HTTP persistent connections if possible + * + * @access public + */ + function useHTTPPersistentConnection(){ + $this->debug("useHTTPPersistentConnection"); + $this->persistentConnection = true; + } + + /** + * gets the default RPC parameter setting. + * If true, default is that call params are like RPC even for document style. + * Each call() can override this value. + * + * This is no longer used. + * + * @return boolean + * @access public + * @deprecated + */ + function getDefaultRpcParams() { + return $this->defaultRpcParams; + } + + /** + * sets the default RPC parameter setting. + * If true, default is that call params are like RPC even for document style + * Each call() can override this value. + * + * This is no longer used. + * + * @param boolean $rpcParams + * @access public + * @deprecated + */ + function setDefaultRpcParams($rpcParams) { + $this->defaultRpcParams = $rpcParams; + } + + /** + * dynamically creates an instance of a proxy class, + * allowing user to directly call methods from wsdl + * + * @return object soap_proxy object + * @access public + */ + function getProxy() { + $r = rand(); + $evalStr = $this->_getProxyClassCode($r); + //$this->debug("proxy class: $evalStr"); + if ($this->getError()) { + $this->debug("Error from _getProxyClassCode, so return NULL"); + return null; + } + // eval the class + eval($evalStr); + // instantiate proxy object + eval("\$proxy = new nusoap_proxy_$r('');"); + // transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice + $proxy->endpointType = 'wsdl'; + $proxy->wsdlFile = $this->wsdlFile; + $proxy->wsdl = $this->wsdl; + $proxy->operations = $this->operations; + $proxy->defaultRpcParams = $this->defaultRpcParams; + // transfer other state + $proxy->soap_defencoding = $this->soap_defencoding; + $proxy->username = $this->username; + $proxy->password = $this->password; + $proxy->authtype = $this->authtype; + $proxy->certRequest = $this->certRequest; + $proxy->requestHeaders = $this->requestHeaders; + $proxy->endpoint = $this->endpoint; + $proxy->forceEndpoint = $this->forceEndpoint; + $proxy->proxyhost = $this->proxyhost; + $proxy->proxyport = $this->proxyport; + $proxy->proxyusername = $this->proxyusername; + $proxy->proxypassword = $this->proxypassword; + $proxy->http_encoding = $this->http_encoding; + $proxy->timeout = $this->timeout; + $proxy->response_timeout = $this->response_timeout; + $proxy->persistentConnection = &$this->persistentConnection; + $proxy->decode_utf8 = $this->decode_utf8; + $proxy->curl_options = $this->curl_options; + $proxy->bindingType = $this->bindingType; + $proxy->use_curl = $this->use_curl; + return $proxy; + } + + /** + * dynamically creates proxy class code + * + * @return string PHP/NuSOAP code for the proxy class + * @access private + */ + function _getProxyClassCode($r) { + $this->debug("in getProxy endpointType=$this->endpointType"); + $this->appendDebug("wsdl=" . $this->varDump($this->wsdl)); + if ($this->endpointType != 'wsdl') { + $evalStr = 'A proxy can only be created for a WSDL client'; + $this->setError($evalStr); + $evalStr = "echo \"$evalStr\";"; + return $evalStr; + } + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) { + return "echo \"" . $this->getError() . "\";"; + } + } + $evalStr = ''; + foreach ($this->operations as $operation => $opData) { + if ($operation != '') { + // create param string and param comment string + if (sizeof($opData['input']['parts']) > 0) { + $paramStr = ''; + $paramArrayStr = ''; + $paramCommentStr = ''; + foreach ($opData['input']['parts'] as $name => $type) { + $paramStr .= "\$$name, "; + $paramArrayStr .= "'$name' => \$$name, "; + $paramCommentStr .= "$type \$$name, "; + } + $paramStr = substr($paramStr, 0, strlen($paramStr)-2); + $paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2); + $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2); + } else { + $paramStr = ''; + $paramArrayStr = ''; + $paramCommentStr = 'void'; + } + $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace']; + $evalStr .= "// $paramCommentStr + function " . str_replace('.', '__', $operation) . "($paramStr) { + \$params = array($paramArrayStr); + return \$this->call('$operation', \$params, '".$opData['namespace']."', '".(isset($opData['soapAction']) ? $opData['soapAction'] : '')."'); + } + "; + unset($paramStr); + unset($paramCommentStr); + } + } + $evalStr = 'class nusoap_proxy_'.$r.' extends nusoap_client { + '.$evalStr.' +}'; + return $evalStr; + } + + /** + * dynamically creates proxy class code + * + * @return string PHP/NuSOAP code for the proxy class + * @access public + */ + function getProxyClassCode() { + $r = rand(); + return $this->_getProxyClassCode($r); + } + + /** + * gets the HTTP body for the current request. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + return $soapmsg; + } + + /** + * gets the HTTP content type for the current request. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current request. + * @access private + */ + function getHTTPContentType() { + return 'text/xml'; + } + + /** + * gets the HTTP content type charset for the current request. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current request. + * @access private + */ + function getHTTPContentTypeCharset() { + return $this->soap_defencoding; + } + + /* + * whether or not parser should decode utf8 element content + * + * @return always returns true + * @access public + */ + function decodeUTF8($bool){ + $this->decode_utf8 = $bool; + return true; + } + + /** + * adds a new Cookie into $this->cookies array + * + * @param string $name Cookie Name + * @param string $value Cookie Value + * @return boolean if cookie-set was successful returns true, else false + * @access public + */ + function setCookie($name, $value) { + if (strlen($name) == 0) { + return false; + } + $this->cookies[] = array('name' => $name, 'value' => $value); + return true; + } + + /** + * gets all Cookies + * + * @return array with all internal cookies + * @access public + */ + function getCookies() { + return $this->cookies; + } + + /** + * checks all Cookies and delete those which are expired + * + * @return boolean always return true + * @access private + */ + function checkCookies() { + if (sizeof($this->cookies) == 0) { + return true; + } + $this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies'); + $curr_cookies = $this->cookies; + $this->cookies = array(); + foreach ($curr_cookies as $cookie) { + if (! is_array($cookie)) { + $this->debug('Remove cookie that is not an array'); + continue; + } + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) > time()) { + $this->cookies[] = $cookie; + } else { + $this->debug('Remove expired cookie ' . $cookie['name']); + } + } else { + $this->cookies[] = $cookie; + } + } + $this->debug('checkCookie: '.sizeof($this->cookies).' cookies left in array'); + return true; + } + + /** + * updates the current cookies with a new set + * + * @param array $cookies new cookies with which to update current ones + * @return boolean always return true + * @access private + */ + function UpdateCookies($cookies) { + if (sizeof($this->cookies) == 0) { + // no existing cookies: take whatever is new + if (sizeof($cookies) > 0) { + $this->debug('Setting new cookie(s)'); + $this->cookies = $cookies; + } + return true; + } + if (sizeof($cookies) == 0) { + // no new cookies: keep what we've got + return true; + } + // merge + foreach ($cookies as $newCookie) { + if (!is_array($newCookie)) { + continue; + } + if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) { + continue; + } + $newName = $newCookie['name']; + + $found = false; + for ($i = 0; $i < count($this->cookies); $i++) { + $cookie = $this->cookies[$i]; + if (!is_array($cookie)) { + continue; + } + if (!isset($cookie['name'])) { + continue; + } + if ($newName != $cookie['name']) { + continue; + } + $newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN'; + $domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN'; + if ($newDomain != $domain) { + continue; + } + $newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH'; + $path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH'; + if ($newPath != $path) { + continue; + } + $this->cookies[$i] = $newCookie; + $found = true; + $this->debug('Update cookie ' . $newName . '=' . $newCookie['value']); + break; + } + if (! $found) { + $this->debug('Add cookie ' . $newName . '=' . $newCookie['value']); + $this->cookies[] = $newCookie; + } + } + return true; + } +} + +if (!extension_loaded('soap')) { + /** + * For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded. + */ + class soapclient extends nusoap_client { + } +} +?> diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdl.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdl.php new file mode 100755 index 000000000..dc6d57724 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdl.php @@ -0,0 +1,1937 @@ + +* @author Scott Nichol +* @version $Id: class.wsdl.php,v 1.76 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class wsdl extends nusoap_base { + // URL or filename of the root of this WSDL + var $wsdl; + // define internal arrays of bindings, ports, operations, messages, etc. + var $schemas = array(); + var $currentSchema; + var $message = array(); + var $complexTypes = array(); + var $messages = array(); + var $currentMessage; + var $currentOperation; + var $portTypes = array(); + var $currentPortType; + var $bindings = array(); + var $currentBinding; + var $ports = array(); + var $currentPort; + var $opData = array(); + var $status = ''; + var $documentation = false; + var $endpoint = ''; + // array of wsdl docs to import + var $import = array(); + // parser vars + var $parser; + var $position = 0; + var $depth = 0; + var $depth_array = array(); + // for getting wsdl + var $proxyhost = ''; + var $proxyport = ''; + var $proxyusername = ''; + var $proxypassword = ''; + var $timeout = 0; + var $response_timeout = 30; + var $curl_options = array(); // User-specified cURL options + var $use_curl = false; // whether to always try to use cURL + // for HTTP authentication + var $username = ''; // Username for HTTP authentication + var $password = ''; // Password for HTTP authentication + var $authtype = ''; // Type of HTTP authentication + var $certRequest = array(); // Certificate for HTTP SSL authentication + + /** + * constructor + * + * @param string $wsdl WSDL document URL + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @param integer $timeout set the connection timeout + * @param integer $response_timeout set the response timeout + * @param array $curl_options user-specified cURL options + * @param boolean $use_curl try to use cURL + * @access public + */ + function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ + parent::nusoap_base(); + $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + $this->timeout = $timeout; + $this->response_timeout = $response_timeout; + if (is_array($curl_options)) + $this->curl_options = $curl_options; + $this->use_curl = $use_curl; + $this->fetchWSDL($wsdl); + } + + /** + * fetches the WSDL document and parses it + * + * @access public + */ + function fetchWSDL($wsdl) { + $this->debug("parse and process WSDL path=$wsdl"); + $this->wsdl = $wsdl; + // parse wsdl file + if ($this->wsdl != "") { + $this->parseWSDL($this->wsdl); + } + // imports + // TODO: handle imports more properly, grabbing them in-line and nesting them + $imported_urls = array(); + $imported = 1; + while ($imported > 0) { + $imported = 0; + // Schema imports + foreach ($this->schemas as $ns => $list) { + foreach ($list as $xs) { + $wsdlparts = parse_url($this->wsdl); // this is bogusly simple! + foreach ($xs->imports as $ns2 => $list2) { + for ($ii = 0; $ii < count($list2); $ii++) { + if (! $list2[$ii]['loaded']) { + $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true; + $url = $list2[$ii]['location']; + if ($url != '') { + $urlparts = parse_url($url); + if (!isset($urlparts['host'])) { + $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') . + substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path']; + } + if (! in_array($url, $imported_urls)) { + $this->parseWSDL($url); + $imported++; + $imported_urls[] = $url; + } + } else { + $this->debug("Unexpected scenario: empty URL for unloaded import"); + } + } + } + } + } + } + // WSDL imports + $wsdlparts = parse_url($this->wsdl); // this is bogusly simple! + foreach ($this->import as $ns => $list) { + for ($ii = 0; $ii < count($list); $ii++) { + if (! $list[$ii]['loaded']) { + $this->import[$ns][$ii]['loaded'] = true; + $url = $list[$ii]['location']; + if ($url != '') { + $urlparts = parse_url($url); + if (!isset($urlparts['host'])) { + $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') . + substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path']; + } + if (! in_array($url, $imported_urls)) { + $this->parseWSDL($url); + $imported++; + $imported_urls[] = $url; + } + } else { + $this->debug("Unexpected scenario: empty URL for unloaded import"); + } + } + } + } + } + // add new data to operation data + foreach($this->bindings as $binding => $bindingData) { + if (isset($bindingData['operations']) && is_array($bindingData['operations'])) { + foreach($bindingData['operations'] as $operation => $data) { + $this->debug('post-parse data gathering for ' . $operation); + $this->bindings[$binding]['operations'][$operation]['input'] = + isset($this->bindings[$binding]['operations'][$operation]['input']) ? + array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) : + $this->portTypes[ $bindingData['portType'] ][$operation]['input']; + $this->bindings[$binding]['operations'][$operation]['output'] = + isset($this->bindings[$binding]['operations'][$operation]['output']) ? + array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) : + $this->portTypes[ $bindingData['portType'] ][$operation]['output']; + if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){ + $this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ]; + } + if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){ + $this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ]; + } + // Set operation style if necessary, but do not override one already provided + if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) { + $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style']; + } + $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : ''; + $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : ''; + $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : ''; + } + } + } + } + + /** + * parses the wsdl document + * + * @param string $wsdl path or URL + * @access private + */ + function parseWSDL($wsdl = '') { + $this->debug("parse WSDL at path=$wsdl"); + + if ($wsdl == '') { + $this->debug('no wsdl passed to parseWSDL()!!'); + $this->setError('no wsdl passed to parseWSDL()!!'); + return false; + } + + // parse $wsdl for url format + $wsdl_props = parse_url($wsdl); + + if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) { + $this->debug('getting WSDL http(s) URL ' . $wsdl); + // get wsdl + $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl); + $tr->request_method = 'GET'; + $tr->useSOAPAction = false; + if($this->proxyhost && $this->proxyport){ + $tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword); + } + if ($this->authtype != '') { + $tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest); + } + $tr->setEncoding('gzip, deflate'); + $wsdl_string = $tr->send('', $this->timeout, $this->response_timeout); + //$this->debug("WSDL request\n" . $tr->outgoing_payload); + //$this->debug("WSDL response\n" . $tr->incoming_payload); + $this->appendDebug($tr->getDebug()); + // catch errors + if($err = $tr->getError() ){ + $errstr = 'Getting ' . $wsdl . ' - HTTP ERROR: '.$err; + $this->debug($errstr); + $this->setError($errstr); + unset($tr); + return false; + } + unset($tr); + $this->debug("got WSDL URL"); + } else { + // $wsdl is not http(s), so treat it as a file URL or plain file path + if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) { + $path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path']; + } else { + $path = $wsdl; + } + $this->debug('getting WSDL file ' . $path); + if ($fp = @fopen($path, 'r')) { + $wsdl_string = ''; + while ($data = fread($fp, 32768)) { + $wsdl_string .= $data; + } + fclose($fp); + } else { + $errstr = "Bad path to WSDL file $path"; + $this->debug($errstr); + $this->setError($errstr); + return false; + } + } + $this->debug('Parse WSDL'); + // end new code added + // Create an XML parser. + $this->parser = xml_parser_create(); + // Set the options for parsing the XML data. + // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + // Set the object for the parser. + xml_set_object($this->parser, $this); + // Set the element handlers for the parser. + xml_set_element_handler($this->parser, 'start_element', 'end_element'); + xml_set_character_data_handler($this->parser, 'character_data'); + // Parse the XML file. + if (!xml_parse($this->parser, $wsdl_string, true)) { + // Display an error message. + $errstr = sprintf( + 'XML error parsing WSDL from %s on line %d: %s', + $wsdl, + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser)) + ); + $this->debug($errstr); + $this->debug("XML payload:\n" . $wsdl_string); + $this->setError($errstr); + return false; + } + // free the parser + xml_parser_free($this->parser); + $this->debug('Parsing WSDL done'); + // catch wsdl parse errors + if($this->getError()){ + return false; + } + return true; + } + + /** + * start-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @param string $attrs associative array of attributes + * @access private + */ + function start_element($parser, $name, $attrs) + { + if ($this->status == 'schema') { + $this->currentSchema->schemaStartElement($parser, $name, $attrs); + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + } elseif (preg_match('/schema$/', $name)) { + $this->debug('Parsing WSDL schema'); + // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")"); + $this->status = 'schema'; + $this->currentSchema = new nusoap_xmlschema('', '', $this->namespaces); + $this->currentSchema->schemaStartElement($parser, $name, $attrs); + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + } else { + // position in the total number of elements, starting from 0 + $pos = $this->position++; + $depth = $this->depth++; + // set self as current value for this depth + $this->depth_array[$depth] = $pos; + $this->message[$pos] = array('cdata' => ''); + // process attributes + if (count($attrs) > 0) { + // register namespace declarations + foreach($attrs as $k => $v) { + if (preg_match('/^xmlns/',$k)) { + if ($ns_prefix = substr(strrchr($k, ':'), 1)) { + $this->namespaces[$ns_prefix] = $v; + } else { + $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v; + } + if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') { + $this->XMLSchemaVersion = $v; + $this->namespaces['xsi'] = $v . '-instance'; + } + } + } + // expand each attribute prefix to its namespace + foreach($attrs as $k => $v) { + $k = strpos($k, ':') ? $this->expandQname($k) : $k; + if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') { + $v = strpos($v, ':') ? $this->expandQname($v) : $v; + } + $eAttrs[$k] = $v; + } + $attrs = $eAttrs; + } else { + $attrs = array(); + } + // get element prefix, namespace and name + if (preg_match('/:/', $name)) { + // get ns prefix + $prefix = substr($name, 0, strpos($name, ':')); + // get ns + $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; + // get unqualified name + $name = substr(strstr($name, ':'), 1); + } + // process attributes, expanding any prefixes to namespaces + // find status, register data + switch ($this->status) { + case 'message': + if ($name == 'part') { + if (isset($attrs['type'])) { + $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs)); + $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type']; + } + if (isset($attrs['element'])) { + $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs)); + $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^'; + } + } + break; + case 'portType': + switch ($name) { + case 'operation': + $this->currentPortOperation = $attrs['name']; + $this->debug("portType $this->currentPortType operation: $this->currentPortOperation"); + if (isset($attrs['parameterOrder'])) { + $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder']; + } + break; + case 'documentation': + $this->documentation = true; + break; + // merge input/output data + default: + $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : ''; + $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m; + break; + } + break; + case 'binding': + switch ($name) { + case 'binding': + // get ns prefix + if (isset($attrs['style'])) { + $this->bindings[$this->currentBinding]['prefix'] = $prefix; + } + $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs); + break; + case 'header': + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs; + break; + case 'operation': + if (isset($attrs['soapAction'])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction']; + } + if (isset($attrs['style'])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style']; + } + if (isset($attrs['name'])) { + $this->currentOperation = $attrs['name']; + $this->debug("current binding operation: $this->currentOperation"); + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name']; + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding; + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : ''; + } + break; + case 'input': + $this->opStatus = 'input'; + break; + case 'output': + $this->opStatus = 'output'; + break; + case 'body': + if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs); + } else { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs; + } + break; + } + break; + case 'service': + switch ($name) { + case 'port': + $this->currentPort = $attrs['name']; + $this->debug('current port: ' . $this->currentPort); + $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']); + + break; + case 'address': + $this->ports[$this->currentPort]['location'] = $attrs['location']; + $this->ports[$this->currentPort]['bindingType'] = $namespace; + $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace; + $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location']; + break; + } + break; + } + // set status + switch ($name) { + case 'import': + if (isset($attrs['location'])) { + $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false); + $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')'); + } else { + $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true); + if (! $this->getPrefixFromNamespace($attrs['namespace'])) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; + } + $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')'); + } + break; + //wait for schema + //case 'types': + // $this->status = 'schema'; + // break; + case 'message': + $this->status = 'message'; + $this->messages[$attrs['name']] = array(); + $this->currentMessage = $attrs['name']; + break; + case 'portType': + $this->status = 'portType'; + $this->portTypes[$attrs['name']] = array(); + $this->currentPortType = $attrs['name']; + break; + case "binding": + if (isset($attrs['name'])) { + // get binding name + if (strpos($attrs['name'], ':')) { + $this->currentBinding = $this->getLocalPart($attrs['name']); + } else { + $this->currentBinding = $attrs['name']; + } + $this->status = 'binding'; + $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']); + $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']); + } + break; + case 'service': + $this->serviceName = $attrs['name']; + $this->status = 'service'; + $this->debug('current service: ' . $this->serviceName); + break; + case 'definitions': + foreach ($attrs as $name => $value) { + $this->wsdl_info[$name] = $value; + } + break; + } + } + } + + /** + * end-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @access private + */ + function end_element($parser, $name){ + // unset schema status + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { + $this->status = ""; + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema; + $this->debug('Parsing WSDL schema done'); + } + if ($this->status == 'schema') { + $this->currentSchema->schemaEndElement($parser, $name); + } else { + // bring depth down a notch + $this->depth--; + } + // end documentation + if ($this->documentation) { + //TODO: track the node to which documentation should be assigned; it can be a part, message, etc. + //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation; + $this->documentation = false; + } + } + + /** + * element content handler + * + * @param string $parser XML parser object + * @param string $data element content + * @access private + */ + function character_data($parser, $data) + { + $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; + if (isset($this->message[$pos]['cdata'])) { + $this->message[$pos]['cdata'] .= $data; + } + if ($this->documentation) { + $this->documentation .= $data; + } + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype certRequest="); + $this->appendDebug($this->varDump($certRequest)); + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->certRequest = $certRequest; + } + + function getBindingData($binding) + { + if (is_array($this->bindings[$binding])) { + return $this->bindings[$binding]; + } + } + + /** + * returns an assoc array of operation names => operation data + * + * @param string $portName WSDL port name + * @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported) + * @return array + * @access public + */ + function getOperations($portName = '', $bindingType = 'soap') { + $ops = array(); + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } else { + $this->debug("getOperations bindingType $bindingType may not be supported"); + } + $this->debug("getOperations for port '$portName' bindingType $bindingType"); + // loop thru ports + foreach($this->ports as $port => $portData) { + $this->debug("getOperations checking port $port bindingType " . $portData['bindingType']); + if ($portName == '' || $port == $portName) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + $this->debug("getOperations found port $port bindingType $bindingType"); + //$this->debug("port data: " . $this->varDump($portData)); + //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ])); + // merge bindings + if (isset($this->bindings[ $portData['binding'] ]['operations'])) { + $ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']); + } + } + } + } + if (count($ops) == 0) { + $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType"); + } + return $ops; + } + + /** + * returns an associative array of data necessary for calling an operation + * + * @param string $operation name of operation + * @param string $bindingType type of binding eg: soap, soap12 + * @return array + * @access public + */ + function getOperationData($operation, $bindingType = 'soap') + { + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } + // loop thru ports + foreach($this->ports as $port => $portData) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + // get binding + //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { + foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) { + // note that we could/should also check the namespace here + if ($operation == $bOperation) { + $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation]; + return $opData; + } + } + } + } + } + + /** + * returns an associative array of data necessary for calling an operation + * + * @param string $soapAction soapAction for operation + * @param string $bindingType type of binding eg: soap, soap12 + * @return array + * @access public + */ + function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') { + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } + // loop thru ports + foreach($this->ports as $port => $portData) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + // loop through operations for the binding + foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { + if ($opData['soapAction'] == $soapAction) { + return $opData; + } + } + } + } + } + + /** + * returns an array of information about a given type + * returns false if no type exists by the given name + * + * typeDef = array( + * 'elements' => array(), // refs to elements array + * 'restrictionBase' => '', + * 'phpType' => '', + * 'order' => '(sequence|all)', + * 'attrs' => array() // refs to attributes array + * ) + * + * @param string $type the type + * @param string $ns namespace (not prefix) of the type + * @return mixed + * @access public + * @see nusoap_xmlschema + */ + function getTypeDef($type, $ns) { + $this->debug("in getTypeDef: type=$type, ns=$ns"); + if ((! $ns) && isset($this->namespaces['tns'])) { + $ns = $this->namespaces['tns']; + $this->debug("in getTypeDef: type namespace forced to $ns"); + } + if (!isset($this->schemas[$ns])) { + foreach ($this->schemas as $ns0 => $schema0) { + if (strcasecmp($ns, $ns0) == 0) { + $this->debug("in getTypeDef: replacing schema namespace $ns with $ns0"); + $ns = $ns0; + break; + } + } + } + if (isset($this->schemas[$ns])) { + $this->debug("in getTypeDef: have schema for namespace $ns"); + for ($i = 0; $i < count($this->schemas[$ns]); $i++) { + $xs = &$this->schemas[$ns][$i]; + $t = $xs->getTypeDef($type); + $this->appendDebug($xs->getDebug()); + $xs->clearDebug(); + if ($t) { + $this->debug("in getTypeDef: found type $type"); + if (!isset($t['phpType'])) { + // get info for type to tack onto the element + $uqType = substr($t['type'], strrpos($t['type'], ':') + 1); + $ns = substr($t['type'], 0, strrpos($t['type'], ':')); + $etype = $this->getTypeDef($uqType, $ns); + if ($etype) { + $this->debug("found type for [element] $type:"); + $this->debug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $t['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $t['elements'] = $etype['elements']; + } + if (isset($etype['attrs'])) { + $t['attrs'] = $etype['attrs']; + } + } else { + $this->debug("did not find type for [element] $type"); + } + } + return $t; + } + } + $this->debug("in getTypeDef: did not find type $type"); + } else { + $this->debug("in getTypeDef: do not have schema for namespace $ns"); + } + return false; + } + + /** + * prints html description of services + * + * @access private + */ + function webDescription(){ + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $PHP_SELF = $_SERVER['PHP_SELF']; + } elseif (isset($HTTP_SERVER_VARS)) { + $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + + $b = ' + NuSOAP: '.$this->serviceName.' + + + + +
        +

        +
        '.$this->serviceName.'
        + +
        '; + return $b; + } + + /** + * serialize the parsed wsdl + * + * @param mixed $debug whether to put debug=1 in endpoint URL + * @return string serialization of WSDL + * @access public + */ + function serialize($debug = 0) + { + $xml = ''; + $xml .= "\nnamespaces as $k => $v) { + $xml .= " xmlns:$k=\"$v\""; + } + // 10.9.02 - add poulter fix for wsdl and tns declarations + if (isset($this->namespaces['wsdl'])) { + $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\""; + } + if (isset($this->namespaces['tns'])) { + $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\""; + } + $xml .= '>'; + // imports + if (sizeof($this->import) > 0) { + foreach($this->import as $ns => $list) { + foreach ($list as $ii) { + if ($ii['location'] != '') { + $xml .= ''; + } else { + $xml .= ''; + } + } + } + } + // types + if (count($this->schemas)>=1) { + $xml .= "\n\n"; + foreach ($this->schemas as $ns => $list) { + foreach ($list as $xs) { + $xml .= $xs->serializeSchema(); + } + } + $xml .= ''; + } + // messages + if (count($this->messages) >= 1) { + foreach($this->messages as $msgName => $msgParts) { + $xml .= "\n'; + if(is_array($msgParts)){ + foreach($msgParts as $partName => $partType) { + // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'
        '; + if (strpos($partType, ':')) { + $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType)); + } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) { + // print 'checking typemap: '.$this->XMLSchemaVersion.'
        '; + $typePrefix = 'xsd'; + } else { + foreach($this->typemap as $ns => $types) { + if (isset($types[$partType])) { + $typePrefix = $this->getPrefixFromNamespace($ns); + } + } + if (!isset($typePrefix)) { + die("$partType has no namespace!"); + } + } + $ns = $this->getNamespaceFromPrefix($typePrefix); + $localPart = $this->getLocalPart($partType); + $typeDef = $this->getTypeDef($localPart, $ns); + if ($typeDef['typeClass'] == 'element') { + $elementortype = 'element'; + if (substr($localPart, -1) == '^') { + $localPart = substr($localPart, 0, -1); + } + } else { + $elementortype = 'type'; + } + $xml .= "\n" . ' '; + } + } + $xml .= '
        '; + } + } + // bindings & porttypes + if (count($this->bindings) >= 1) { + $binding_xml = ''; + $portType_xml = ''; + foreach($this->bindings as $bindingName => $attrs) { + $binding_xml .= "\n'; + $binding_xml .= "\n" . ' '; + $portType_xml .= "\n'; + foreach($attrs['operations'] as $opName => $opParts) { + $binding_xml .= "\n" . ' '; + $binding_xml .= "\n" . ' '; + if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') { + $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"'; + } else { + $enc_style = ''; + } + $binding_xml .= "\n" . ' '; + if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') { + $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"'; + } else { + $enc_style = ''; + } + $binding_xml .= "\n" . ' '; + $binding_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' ' . htmlspecialchars($opParts['documentation']) . ''; + } + $portType_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' '; + } + $portType_xml .= "\n" . ''; + $binding_xml .= "\n" . ''; + } + $xml .= $portType_xml . $binding_xml; + } + // services + $xml .= "\nserviceName . '">'; + if (count($this->ports) >= 1) { + foreach($this->ports as $pName => $attrs) { + $xml .= "\n" . ' '; + $xml .= "\n" . ' '; + $xml .= "\n" . ' '; + } + } + $xml .= "\n" . ''; + return $xml . "\n"; + } + + /** + * determine whether a set of parameters are unwrapped + * when they are expect to be wrapped, Microsoft-style. + * + * @param string $type the type (element name) of the wrapper + * @param array $parameters the parameter values for the SOAP call + * @return boolean whether they parameters are unwrapped (and should be wrapped) + * @access private + */ + function parametersMatchWrapped($type, &$parameters) { + $this->debug("in parametersMatchWrapped type=$type, parameters="); + $this->appendDebug($this->varDump($parameters)); + + // split type into namespace:unqualified-type + if (strpos($type, ':')) { + $uqType = substr($type, strrpos($type, ':') + 1); + $ns = substr($type, 0, strrpos($type, ':')); + $this->debug("in parametersMatchWrapped: got a prefixed type: $uqType, $ns"); + if ($this->getNamespaceFromPrefix($ns)) { + $ns = $this->getNamespaceFromPrefix($ns); + $this->debug("in parametersMatchWrapped: expanded prefixed type: $uqType, $ns"); + } + } else { + // TODO: should the type be compared to types in XSD, and the namespace + // set to XSD if the type matches? + $this->debug("in parametersMatchWrapped: No namespace for type $type"); + $ns = ''; + $uqType = $type; + } + + // get the type information + if (!$typeDef = $this->getTypeDef($uqType, $ns)) { + $this->debug("in parametersMatchWrapped: $type ($uqType) is not a supported type."); + return false; + } + $this->debug("in parametersMatchWrapped: found typeDef="); + $this->appendDebug($this->varDump($typeDef)); + if (substr($uqType, -1) == '^') { + $uqType = substr($uqType, 0, -1); + } + $phpType = $typeDef['phpType']; + $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''); + $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType"); + + // we expect a complexType or element of complexType + if ($phpType != 'struct') { + $this->debug("in parametersMatchWrapped: not a struct"); + return false; + } + + // see whether the parameter names match the elements + if (isset($typeDef['elements']) && is_array($typeDef['elements'])) { + $elements = 0; + $matches = 0; + foreach ($typeDef['elements'] as $name => $attrs) { + if (isset($parameters[$name])) { + $this->debug("in parametersMatchWrapped: have parameter named $name"); + $matches++; + } else { + $this->debug("in parametersMatchWrapped: do not have parameter named $name"); + } + $elements++; + } + + $this->debug("in parametersMatchWrapped: $matches parameter names match $elements wrapped parameter names"); + if ($matches == 0) { + return false; + } + return true; + } + + // since there are no elements for the type, if the user passed no + // parameters, the parameters match wrapped. + $this->debug("in parametersMatchWrapped: no elements type $ns:$uqType"); + return count($parameters) == 0; + } + + /** + * serialize PHP values according to a WSDL message definition + * contrary to the method name, this is not limited to RPC + * + * TODO + * - multi-ref serialization + * - validate PHP values against type definitions, return errors if invalid + * + * @param string $operation operation name + * @param string $direction (input|output) + * @param mixed $parameters parameter value(s) + * @param string $bindingType (soap|soap12) + * @return mixed parameters serialized as XML or false on error (e.g. operation not found) + * @access public + */ + function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') { + $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType"); + $this->appendDebug('parameters=' . $this->varDump($parameters)); + + if ($direction != 'input' && $direction != 'output') { + $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); + $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); + return false; + } + if (!$opData = $this->getOperationData($operation, $bindingType)) { + $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); + $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); + return false; + } + $this->debug('in serializeRPCParameters: opData:'); + $this->appendDebug($this->varDump($opData)); + + // Get encoding style for output and set to current + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { + $encodingStyle = $opData['output']['encodingStyle']; + $enc_style = $encodingStyle; + } + + // set input params + $xml = ''; + if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { + $parts = &$opData[$direction]['parts']; + $part_count = sizeof($parts); + $style = $opData['style']; + $use = $opData[$direction]['use']; + $this->debug("have $part_count part(s) to serialize using $style/$use"); + if (is_array($parameters)) { + $parametersArrayType = $this->isArraySimpleOrStruct($parameters); + $parameter_count = count($parameters); + $this->debug("have $parameter_count parameter(s) provided as $parametersArrayType to serialize"); + // check for Microsoft-style wrapped parameters + if ($style == 'document' && $use == 'literal' && $part_count == 1 && isset($parts['parameters'])) { + $this->debug('check whether the caller has wrapped the parameters'); + if ($direction == 'output' && $parametersArrayType == 'arraySimple' && $parameter_count == 1) { + // TODO: consider checking here for double-wrapping, when + // service function wraps, then NuSOAP wraps again + $this->debug("change simple array to associative with 'parameters' element"); + $parameters['parameters'] = $parameters[0]; + unset($parameters[0]); + } + if (($parametersArrayType == 'arrayStruct' || $parameter_count == 0) && !isset($parameters['parameters'])) { + $this->debug('check whether caller\'s parameters match the wrapped ones'); + if ($this->parametersMatchWrapped($parts['parameters'], $parameters)) { + $this->debug('wrap the parameters for the caller'); + $parameters = array('parameters' => $parameters); + $parameter_count = 1; + } + } + } + foreach ($parts as $name => $type) { + $this->debug("serializing part $name of type $type"); + // Track encoding style + if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { + $encodingStyle = $opData[$direction]['encodingStyle']; + $enc_style = $encodingStyle; + } else { + $enc_style = false; + } + // NOTE: add error handling here + // if serializeType returns false, then catch global error and fault + if ($parametersArrayType == 'arraySimple') { + $p = array_shift($parameters); + $this->debug('calling serializeType w/indexed param'); + $xml .= $this->serializeType($name, $type, $p, $use, $enc_style); + } elseif (isset($parameters[$name])) { + $this->debug('calling serializeType w/named param'); + $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style); + } else { + // TODO: only send nillable + $this->debug('calling serializeType w/null param'); + $xml .= $this->serializeType($name, $type, null, $use, $enc_style); + } + } + } else { + $this->debug('no parameters passed.'); + } + } + $this->debug("serializeRPCParameters returning: $xml"); + return $xml; + } + + /** + * serialize a PHP value according to a WSDL message definition + * + * TODO + * - multi-ref serialization + * - validate PHP values against type definitions, return errors if invalid + * + * @param string $operation operation name + * @param string $direction (input|output) + * @param mixed $parameters parameter value(s) + * @return mixed parameters serialized as XML or false on error (e.g. operation not found) + * @access public + * @deprecated + */ + function serializeParameters($operation, $direction, $parameters) + { + $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); + $this->appendDebug('parameters=' . $this->varDump($parameters)); + + if ($direction != 'input' && $direction != 'output') { + $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); + $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); + return false; + } + if (!$opData = $this->getOperationData($operation)) { + $this->debug('Unable to retrieve WSDL data for operation: ' . $operation); + $this->setError('Unable to retrieve WSDL data for operation: ' . $operation); + return false; + } + $this->debug('opData:'); + $this->appendDebug($this->varDump($opData)); + + // Get encoding style for output and set to current + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { + $encodingStyle = $opData['output']['encodingStyle']; + $enc_style = $encodingStyle; + } + + // set input params + $xml = ''; + if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { + + $use = $opData[$direction]['use']; + $this->debug("use=$use"); + $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)'); + if (is_array($parameters)) { + $parametersArrayType = $this->isArraySimpleOrStruct($parameters); + $this->debug('have ' . $parametersArrayType . ' parameters'); + foreach($opData[$direction]['parts'] as $name => $type) { + $this->debug('serializing part "'.$name.'" of type "'.$type.'"'); + // Track encoding style + if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { + $encodingStyle = $opData[$direction]['encodingStyle']; + $enc_style = $encodingStyle; + } else { + $enc_style = false; + } + // NOTE: add error handling here + // if serializeType returns false, then catch global error and fault + if ($parametersArrayType == 'arraySimple') { + $p = array_shift($parameters); + $this->debug('calling serializeType w/indexed param'); + $xml .= $this->serializeType($name, $type, $p, $use, $enc_style); + } elseif (isset($parameters[$name])) { + $this->debug('calling serializeType w/named param'); + $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style); + } else { + // TODO: only send nillable + $this->debug('calling serializeType w/null param'); + $xml .= $this->serializeType($name, $type, null, $use, $enc_style); + } + } + } else { + $this->debug('no parameters passed.'); + } + } + $this->debug("serializeParameters returning: $xml"); + return $xml; + } + + /** + * serializes a PHP value according a given type definition + * + * @param string $name name of value (part or element) + * @param string $type XML schema type of value (type or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $use use for part (encoded|literal) + * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style) + * @param boolean $unqualified a kludge for what should be XML namespace form handling + * @return string value serialized as an XML string + * @access private + */ + function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false) + { + $this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified")); + $this->appendDebug("value=" . $this->varDump($value)); + if($use == 'encoded' && $encodingStyle) { + $encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"'; + } + + // if a soapval has been supplied, let its type override the WSDL + if (is_object($value) && get_class($value) == 'soapval') { + if ($value->type_ns) { + $type = $value->type_ns . ':' . $value->type; + $forceType = true; + $this->debug("in serializeType: soapval overrides type to $type"); + } elseif ($value->type) { + $type = $value->type; + $forceType = true; + $this->debug("in serializeType: soapval overrides type to $type"); + } else { + $forceType = false; + $this->debug("in serializeType: soapval does not override type"); + } + $attrs = $value->attributes; + $value = $value->value; + $this->debug("in serializeType: soapval overrides value to $value"); + if ($attrs) { + if (!is_array($value)) { + $value['!'] = $value; + } + foreach ($attrs as $n => $v) { + $value['!' . $n] = $v; + } + $this->debug("in serializeType: soapval provides attributes"); + } + } else { + $forceType = false; + } + + $xml = ''; + if (strpos($type, ':')) { + $uqType = substr($type, strrpos($type, ':') + 1); + $ns = substr($type, 0, strrpos($type, ':')); + $this->debug("in serializeType: got a prefixed type: $uqType, $ns"); + if ($this->getNamespaceFromPrefix($ns)) { + $ns = $this->getNamespaceFromPrefix($ns); + $this->debug("in serializeType: expanded prefixed type: $uqType, $ns"); + } + + if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){ + $this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type'); + if ($unqualified && $use == 'literal') { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$elementNS/>"; + } else { + // TODO: depends on nillable, which should be checked before calling this method + $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if ($uqType == 'Array') { + // JBoss/Axis does this sometimes + return $this->serialize_val($value, $name, false, false, false, false, $use); + } + if ($uqType == 'boolean') { + if ((is_string($value) && $value == 'false') || (! $value)) { + $value = 'false'; + } else { + $value = 'true'; + } + } + if ($uqType == 'string' && gettype($value) == 'string') { + $value = $this->expandEntities($value); + } + if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') { + $value = sprintf("%.0lf", $value); + } + // it's a scalar + // TODO: what about null/nil values? + // check type isn't a custom type extending xmlschema namespace + if (!$this->getTypeDef($uqType, $ns)) { + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value"; + } else { + $xml = "<$name$elementNS>$value"; + } + } else { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + $this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)'); + } else if ($ns == 'http://xml.apache.org/xml-soap') { + $this->debug('in serializeType: appears to be Apache SOAP type'); + if ($uqType == 'Map') { + $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap'); + if (! $tt_prefix) { + $this->debug('in serializeType: Add namespace for Apache SOAP type'); + $tt_prefix = 'ns' . rand(1000, 9999); + $this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap'; + // force this to be added to usedNamespaces + $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap'); + } + $contents = ''; + foreach($value as $k => $v) { + $this->debug("serializing map element: key $k, value $v"); + $contents .= ''; + $contents .= $this->serialize_val($k,'key',false,false,false,false,$use); + $contents .= $this->serialize_val($v,'value',false,false,false,false,$use); + $contents .= ''; + } + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents"; + } else { + $xml = "<$name>$contents"; + } + } else { + $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + $this->debug('in serializeType: Apache SOAP type, but only support Map'); + } + } else { + // TODO: should the type be compared to types in XSD, and the namespace + // set to XSD if the type matches? + $this->debug("in serializeType: No namespace for type $type"); + $ns = ''; + $uqType = $type; + } + if(!$typeDef = $this->getTypeDef($uqType, $ns)){ + $this->setError("$type ($uqType) is not a supported type."); + $this->debug("in serializeType: $type ($uqType) is not a supported type."); + return false; + } else { + $this->debug("in serializeType: found typeDef"); + $this->appendDebug('typeDef=' . $this->varDump($typeDef)); + if (substr($uqType, -1) == '^') { + $uqType = substr($uqType, 0, -1); + } + } + if (!isset($typeDef['phpType'])) { + $this->setError("$type ($uqType) has no phpType."); + $this->debug("in serializeType: $type ($uqType) has no phpType."); + return false; + } + $phpType = $typeDef['phpType']; + $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); + // if php type == struct, map value to the element names + if ($phpType == 'struct') { + if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') { + $elementName = $uqType; + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + $elementNS = " xmlns=\"\""; + } + } else { + $elementName = $name; + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs and nillable + $xml = "<$elementName$elementNS/>"; + } else { + $xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if (is_object($value)) { + $value = get_object_vars($value); + } + if (is_array($value)) { + $elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType); + if ($use == 'literal') { + if ($forceType) { + $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">"; + } else { + $xml = "<$elementName$elementNS$elementAttrs>"; + } + } else { + $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>"; + } + + if (isset($typeDef['simpleContent']) && $typeDef['simpleContent'] == 'true') { + if (isset($value['!'])) { + $xml .= $value['!']; + $this->debug("in serializeType: serialized simpleContent for type $type"); + } else { + $this->debug("in serializeType: no simpleContent to serialize for type $type"); + } + } else { + // complexContent + $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle); + } + $xml .= ""; + } else { + $this->debug("in serializeType: phpType is struct, but value is not an array"); + $this->setError("phpType is struct, but value is not an array: see debug output for details"); + $xml = ''; + } + } elseif ($phpType == 'array') { + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$elementNS/>"; + } else { + $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . + ":Array\" " . + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . + ':arrayType="' . + $this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) . + ':' . + $this->getLocalPart($typeDef['arrayType'])."[0]\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if (isset($typeDef['multidimensional'])) { + $nv = array(); + foreach($value as $v) { + $cols = ',' . sizeof($v); + $nv = array_merge($nv, $v); + } + $value = $nv; + } else { + $cols = ''; + } + if (is_array($value) && sizeof($value) >= 1) { + $rows = sizeof($value); + $contents = ''; + foreach($value as $k => $v) { + $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]"); + //if (strpos($typeDef['arrayType'], ':') ) { + if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) { + $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); + } else { + $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); + } + } + } else { + $rows = 0; + $contents = null; + } + // TODO: for now, an empty value will be serialized as a zero element + // array. Revisit this when coding the handling of null/nil values. + if ($use == 'literal') { + $xml = "<$name$elementNS>" + .$contents + .""; + } else { + $xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '. + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') + .':arrayType="' + .$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) + .":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">" + .$contents + .""; + } + } elseif ($phpType == 'scalar') { + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value"; + } else { + $xml = "<$name$elementNS>$value"; + } + } else { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value"; + } + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + + /** + * serializes the attributes for a complexType + * + * @param array $typeDef our internal representation of an XML schema type (or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $ns the namespace of the type + * @param string $uqType the local part of the type + * @return string value serialized as an XML string + * @access private + */ + function serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType) { + $this->debug("serializeComplexTypeAttributes for XML Schema type $ns:$uqType"); + $xml = ''; + if (isset($typeDef['extensionBase'])) { + $nsx = $this->getPrefix($typeDef['extensionBase']); + $uqTypex = $this->getLocalPart($typeDef['extensionBase']); + if ($this->getNamespaceFromPrefix($nsx)) { + $nsx = $this->getNamespaceFromPrefix($nsx); + } + if ($typeDefx = $this->getTypeDef($uqTypex, $nsx)) { + $this->debug("serialize attributes for extension base $nsx:$uqTypex"); + $xml .= $this->serializeComplexTypeAttributes($typeDefx, $value, $nsx, $uqTypex); + } else { + $this->debug("extension base $nsx:$uqTypex is not a supported type"); + } + } + if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) { + $this->debug("serialize attributes for XML Schema type $ns:$uqType"); + if (is_array($value)) { + $xvalue = $value; + } elseif (is_object($value)) { + $xvalue = get_object_vars($value); + } else { + $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType"); + $xvalue = array(); + } + foreach ($typeDef['attrs'] as $aName => $attrs) { + if (isset($xvalue['!' . $aName])) { + $xname = '!' . $aName; + $this->debug("value provided for attribute $aName with key $xname"); + } elseif (isset($xvalue[$aName])) { + $xname = $aName; + $this->debug("value provided for attribute $aName with key $xname"); + } elseif (isset($attrs['default'])) { + $xname = '!' . $aName; + $xvalue[$xname] = $attrs['default']; + $this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName); + } else { + $xname = ''; + $this->debug("no value provided for attribute $aName"); + } + if ($xname) { + $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\""; + } + } + } else { + $this->debug("no attributes to serialize for XML Schema type $ns:$uqType"); + } + return $xml; + } + + /** + * serializes the elements for a complexType + * + * @param array $typeDef our internal representation of an XML schema type (or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $ns the namespace of the type + * @param string $uqType the local part of the type + * @param string $use use for part (encoded|literal) + * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style) + * @return string value serialized as an XML string + * @access private + */ + function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) { + $this->debug("in serializeComplexTypeElements for XML Schema type $ns:$uqType"); + $xml = ''; + if (isset($typeDef['extensionBase'])) { + $nsx = $this->getPrefix($typeDef['extensionBase']); + $uqTypex = $this->getLocalPart($typeDef['extensionBase']); + if ($this->getNamespaceFromPrefix($nsx)) { + $nsx = $this->getNamespaceFromPrefix($nsx); + } + if ($typeDefx = $this->getTypeDef($uqTypex, $nsx)) { + $this->debug("serialize elements for extension base $nsx:$uqTypex"); + $xml .= $this->serializeComplexTypeElements($typeDefx, $value, $nsx, $uqTypex, $use, $encodingStyle); + } else { + $this->debug("extension base $nsx:$uqTypex is not a supported type"); + } + } + if (isset($typeDef['elements']) && is_array($typeDef['elements'])) { + $this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType"); + if (is_array($value)) { + $xvalue = $value; + } elseif (is_object($value)) { + $xvalue = get_object_vars($value); + } else { + $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType"); + $xvalue = array(); + } + // toggle whether all elements are present - ideally should validate against schema + if (count($typeDef['elements']) != count($xvalue)){ + $optionals = true; + } + foreach ($typeDef['elements'] as $eName => $attrs) { + if (!isset($xvalue[$eName])) { + if (isset($attrs['default'])) { + $xvalue[$eName] = $attrs['default']; + $this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName); + } + } + // if user took advantage of a minOccurs=0, then only serialize named parameters + if (isset($optionals) + && (!isset($xvalue[$eName])) + && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true') + ){ + if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') { + $this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']); + } + // do nothing + $this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing"); + } else { + // get value + if (isset($xvalue[$eName])) { + $v = $xvalue[$eName]; + } else { + $v = null; + } + if (isset($attrs['form'])) { + $unqualified = ($attrs['form'] == 'unqualified'); + } else { + $unqualified = false; + } + if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') { + $vv = $v; + foreach ($vv as $k => $v) { + if (isset($attrs['type']) || isset($attrs['ref'])) { + // serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } else { + // serialize generic type (can this ever really happen?) + $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use"); + $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use); + } + } + } else { + if (is_null($v) && isset($attrs['minOccurs']) && $attrs['minOccurs'] == '0') { + // do nothing + } elseif (is_null($v) && isset($attrs['nillable']) && $attrs['nillable'] == 'true') { + // TODO: serialize a nil correctly, but for now serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } elseif (isset($attrs['type']) || isset($attrs['ref'])) { + // serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } else { + // serialize generic type (can this ever really happen?) + $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use"); + $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use); + } + } + } + } + } else { + $this->debug("no elements to serialize for XML Schema type $ns:$uqType"); + } + return $xml; + } + + /** + * adds an XML Schema complex type to the WSDL types + * + * @param string $name + * @param string $typeClass (complexType|simpleType|attribute) + * @param string $phpType currently supported are array and struct (php assoc array) + * @param string $compositor (all|sequence|choice) + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param array $elements e.g. array ( name => array(name=>'',type=>'') ) + * @param array $attrs e.g. array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')) + * @param string $arrayType as namespace:name (xsd:string) + * @see nusoap_xmlschema + * @access public + */ + function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') { + if (count($elements) > 0) { + $eElements = array(); + foreach($elements as $n => $e){ + // expand each element + $ee = array(); + foreach ($e as $k => $v) { + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $ee[$k] = $v; + } + $eElements[$n] = $ee; + } + $elements = $eElements; + } + + if (count($attrs) > 0) { + foreach($attrs as $n => $a){ + // expand each attribute + foreach ($a as $k => $v) { + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $aa[$k] = $v; + } + $eAttrs[$n] = $aa; + } + $attrs = $eAttrs; + } + + $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase; + $arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType; + + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType); + } + + /** + * adds an XML Schema simple type to the WSDL types + * + * @param string $name + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param string $typeClass (should always be simpleType) + * @param string $phpType (should always be scalar) + * @param array $enumeration array of values + * @see nusoap_xmlschema + * @access public + */ + function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) { + $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase; + + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration); + } + + /** + * adds an element to the WSDL types + * + * @param array $attrs attributes that must include name and type + * @see nusoap_xmlschema + * @access public + */ + function addElement($attrs) { + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addElement($attrs); + } + + /** + * register an operation with the server + * + * @param string $name operation (method) name + * @param array $in assoc array of input values: key = param name, value = param type + * @param array $out assoc array of output values: key = param name, value = param type + * @param string $namespace optional The namespace for the operation + * @param string $soapaction optional The soapaction for the operation + * @param string $style (rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically + * @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now) + * @param string $documentation optional The description to include in the WSDL + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @access public + */ + function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){ + if ($use == 'encoded' && $encodingStyle == '') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } + + if ($style == 'document') { + $elements = array(); + foreach ($in as $n => $t) { + $elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified'); + } + $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements); + $this->addElement(array('name' => $name, 'type' => $name . 'RequestType')); + $in = array('parameters' => 'tns:' . $name . '^'); + + $elements = array(); + foreach ($out as $n => $t) { + $elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified'); + } + $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements); + $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified')); + $out = array('parameters' => 'tns:' . $name . 'Response' . '^'); + } + + // get binding + $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] = + array( + 'name' => $name, + 'binding' => $this->serviceName . 'Binding', + 'endpoint' => $this->endpoint, + 'soapAction' => $soapaction, + 'style' => $style, + 'input' => array( + 'use' => $use, + 'namespace' => $namespace, + 'encodingStyle' => $encodingStyle, + 'message' => $name . 'Request', + 'parts' => $in), + 'output' => array( + 'use' => $use, + 'namespace' => $namespace, + 'encodingStyle' => $encodingStyle, + 'message' => $name . 'Response', + 'parts' => $out), + 'namespace' => $namespace, + 'transport' => 'http://schemas.xmlsoap.org/soap/http', + 'documentation' => $documentation); + // add portTypes + // add messages + if($in) + { + foreach($in as $pName => $pType) + { + if(strpos($pType,':')) { + $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType); + } + $this->messages[$name.'Request'][$pName] = $pType; + } + } else { + $this->messages[$name.'Request']= '0'; + } + if($out) + { + foreach($out as $pName => $pType) + { + if(strpos($pType,':')) { + $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType); + } + $this->messages[$name.'Response'][$pName] = $pType; + } + } else { + $this->messages[$name.'Response']= '0'; + } + return true; + } +} + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdlcache.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdlcache.php new file mode 100755 index 000000000..d12882427 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.wsdlcache.php @@ -0,0 +1,209 @@ + +* @author Ingo Fischer +* @version $Id: class.wsdlcache.php,v 1.7 2007/04/17 16:34:03 snichol Exp $ +* @access public +*/ +class nusoap_wsdlcache { + /** + * @var resource + * @access private + */ + var $fplock; + /** + * @var integer + * @access private + */ + var $cache_lifetime; + /** + * @var string + * @access private + */ + var $cache_dir; + /** + * @var string + * @access public + */ + var $debug_str = ''; + + /** + * constructor + * + * @param string $cache_dir directory for cache-files + * @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited + * @access public + */ + function nusoap_wsdlcache($cache_dir='.', $cache_lifetime=0) { + $this->fplock = array(); + $this->cache_dir = $cache_dir != '' ? $cache_dir : '.'; + $this->cache_lifetime = $cache_lifetime; + } + + /** + * creates the filename used to cache a wsdl instance + * + * @param string $wsdl The URL of the wsdl instance + * @return string The filename used to cache the instance + * @access private + */ + function createFilename($wsdl) { + return $this->cache_dir.'/wsdlcache-' . md5($wsdl); + } + + /** + * adds debug data to the class level debug string + * + * @param string $string debug data + * @access private + */ + function debug($string){ + $this->debug_str .= get_class($this).": $string\n"; + } + + /** + * gets a wsdl instance from the cache + * + * @param string $wsdl The URL of the wsdl instance + * @return object wsdl The cached wsdl instance, null if the instance is not in the cache + * @access public + */ + function get($wsdl) { + $filename = $this->createFilename($wsdl); + if ($this->obtainMutex($filename, "r")) { + // check for expired WSDL that must be removed from the cache + if ($this->cache_lifetime > 0) { + if (file_exists($filename) && (time() - filemtime($filename) > $this->cache_lifetime)) { + unlink($filename); + $this->debug("Expired $wsdl ($filename) from cache"); + $this->releaseMutex($filename); + return null; + } + } + // see what there is to return + if (!file_exists($filename)) { + $this->debug("$wsdl ($filename) not in cache (1)"); + $this->releaseMutex($filename); + return null; + } + $fp = @fopen($filename, "r"); + if ($fp) { + $s = implode("", @file($filename)); + fclose($fp); + $this->debug("Got $wsdl ($filename) from cache"); + } else { + $s = null; + $this->debug("$wsdl ($filename) not in cache (2)"); + } + $this->releaseMutex($filename); + return (!is_null($s)) ? unserialize($s) : null; + } else { + $this->debug("Unable to obtain mutex for $filename in get"); + } + return null; + } + + /** + * obtains the local mutex + * + * @param string $filename The Filename of the Cache to lock + * @param string $mode The open-mode ("r" or "w") or the file - affects lock-mode + * @return boolean Lock successfully obtained ?! + * @access private + */ + function obtainMutex($filename, $mode) { + if (isset($this->fplock[md5($filename)])) { + $this->debug("Lock for $filename already exists"); + return false; + } + $this->fplock[md5($filename)] = fopen($filename.".lock", "w"); + if ($mode == "r") { + return flock($this->fplock[md5($filename)], LOCK_SH); + } else { + return flock($this->fplock[md5($filename)], LOCK_EX); + } + } + + /** + * adds a wsdl instance to the cache + * + * @param object wsdl $wsdl_instance The wsdl instance to add + * @return boolean WSDL successfully cached + * @access public + */ + function put($wsdl_instance) { + $filename = $this->createFilename($wsdl_instance->wsdl); + $s = serialize($wsdl_instance); + if ($this->obtainMutex($filename, "w")) { + $fp = fopen($filename, "w"); + if (! $fp) { + $this->debug("Cannot write $wsdl_instance->wsdl ($filename) in cache"); + $this->releaseMutex($filename); + return false; + } + fputs($fp, $s); + fclose($fp); + $this->debug("Put $wsdl_instance->wsdl ($filename) in cache"); + $this->releaseMutex($filename); + return true; + } else { + $this->debug("Unable to obtain mutex for $filename in put"); + } + return false; + } + + /** + * releases the local mutex + * + * @param string $filename The Filename of the Cache to lock + * @return boolean Lock successfully released + * @access private + */ + function releaseMutex($filename) { + $ret = flock($this->fplock[md5($filename)], LOCK_UN); + fclose($this->fplock[md5($filename)]); + unset($this->fplock[md5($filename)]); + if (! $ret) { + $this->debug("Not able to release lock for $filename"); + } + return $ret; + } + + /** + * removes a wsdl instance from the cache + * + * @param string $wsdl The URL of the wsdl instance + * @return boolean Whether there was an instance to remove + * @access public + */ + function remove($wsdl) { + $filename = $this->createFilename($wsdl); + if (!file_exists($filename)) { + $this->debug("$wsdl ($filename) not in cache to be removed"); + return false; + } + // ignore errors obtaining mutex + $this->obtainMutex($filename, "w"); + $ret = unlink($filename); + $this->debug("Removed ($ret) $wsdl ($filename) from cache"); + $this->releaseMutex($filename); + return $ret; + } +} + +/** + * For backward compatibility + */ +class wsdlcache extends nusoap_wsdlcache { +} +?> diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.xmlschema.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.xmlschema.php new file mode 100755 index 000000000..27dfadea2 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/class.xmlschema.php @@ -0,0 +1,972 @@ + +* @author Scott Nichol +* @version $Id: class.xmlschema.php,v 1.53 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_xmlschema extends nusoap_base { + + // files + var $schema = ''; + var $xml = ''; + // namespaces + var $enclosingNamespaces; + // schema info + var $schemaInfo = array(); + var $schemaTargetNamespace = ''; + // types, elements, attributes defined by the schema + var $attributes = array(); + var $complexTypes = array(); + var $complexTypeStack = array(); + var $currentComplexType = null; + var $elements = array(); + var $elementStack = array(); + var $currentElement = null; + var $simpleTypes = array(); + var $simpleTypeStack = array(); + var $currentSimpleType = null; + // imports + var $imports = array(); + // parser vars + var $parser; + var $position = 0; + var $depth = 0; + var $depth_array = array(); + var $message = array(); + var $defaultNamespace = array(); + + /** + * constructor + * + * @param string $schema schema document URI + * @param string $xml xml document URI + * @param string $namespaces namespaces defined in enclosing XML + * @access public + */ + function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ + parent::nusoap_base(); + $this->debug('nusoap_xmlschema class instantiated, inside constructor'); + // files + $this->schema = $schema; + $this->xml = $xml; + + // namespaces + $this->enclosingNamespaces = $namespaces; + $this->namespaces = array_merge($this->namespaces, $namespaces); + + // parse schema file + if($schema != ''){ + $this->debug('initial schema file: '.$schema); + $this->parseFile($schema, 'schema'); + } + + // parse xml file + if($xml != ''){ + $this->debug('initial xml file: '.$xml); + $this->parseFile($xml, 'xml'); + } + + } + + /** + * parse an XML file + * + * @param string $xml path/URL to XML file + * @param string $type (schema | xml) + * @return boolean + * @access public + */ + function parseFile($xml,$type){ + // parse xml file + if($xml != ""){ + $xmlStr = @join("",@file($xml)); + if($xmlStr == ""){ + $msg = 'Error reading XML from '.$xml; + $this->setError($msg); + $this->debug($msg); + return false; + } else { + $this->debug("parsing $xml"); + $this->parseString($xmlStr,$type); + $this->debug("done parsing $xml"); + return true; + } + } + return false; + } + + /** + * parse an XML string + * + * @param string $xml path or URL + * @param string $type (schema|xml) + * @access private + */ + function parseString($xml,$type){ + // parse xml string + if($xml != ""){ + + // Create an XML parser. + $this->parser = xml_parser_create(); + // Set the options for parsing the XML data. + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + + // Set the object for the parser. + xml_set_object($this->parser, $this); + + // Set the element handlers for the parser. + if($type == "schema"){ + xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement'); + xml_set_character_data_handler($this->parser,'schemaCharacterData'); + } elseif($type == "xml"){ + xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement'); + xml_set_character_data_handler($this->parser,'xmlCharacterData'); + } + + // Parse the XML file. + if(!xml_parse($this->parser,$xml,true)){ + // Display an error message. + $errstr = sprintf('XML error parsing XML schema on line %d: %s', + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser)) + ); + $this->debug($errstr); + $this->debug("XML payload:\n" . $xml); + $this->setError($errstr); + } + + xml_parser_free($this->parser); + } else{ + $this->debug('no xml passed to parseString()!!'); + $this->setError('no xml passed to parseString()!!'); + } + } + + /** + * gets a type name for an unnamed type + * + * @param string Element name + * @return string A type name for an unnamed type + * @access private + */ + function CreateTypeName($ename) { + $scope = ''; + for ($i = 0; $i < count($this->complexTypeStack); $i++) { + $scope .= $this->complexTypeStack[$i] . '_'; + } + return $scope . $ename . '_ContainedType'; + } + + /** + * start-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @param string $attrs associative array of attributes + * @access private + */ + function schemaStartElement($parser, $name, $attrs) { + + // position in the total number of elements, starting from 0 + $pos = $this->position++; + $depth = $this->depth++; + // set self as current value for this depth + $this->depth_array[$depth] = $pos; + $this->message[$pos] = array('cdata' => ''); + if ($depth > 0) { + $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; + } else { + $this->defaultNamespace[$pos] = false; + } + + // get element prefix + if($prefix = $this->getPrefix($name)){ + // get unqualified name + $name = $this->getLocalPart($name); + } else { + $prefix = ''; + } + + // loop thru attributes, expanding, and registering namespace declarations + if(count($attrs) > 0){ + foreach($attrs as $k => $v){ + // if ns declarations, add to class level array of valid namespaces + if(preg_match('/^xmlns/',$k)){ + //$this->xdebug("$k: $v"); + //$this->xdebug('ns_prefix: '.$this->getPrefix($k)); + if($ns_prefix = substr(strrchr($k,':'),1)){ + //$this->xdebug("Add namespace[$ns_prefix] = $v"); + $this->namespaces[$ns_prefix] = $v; + } else { + $this->defaultNamespace[$pos] = $v; + if (! $this->getPrefixFromNamespace($v)) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $v; + } + } + if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){ + $this->XMLSchemaVersion = $v; + $this->namespaces['xsi'] = $v.'-instance'; + } + } + } + foreach($attrs as $k => $v){ + // expand each attribute + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $eAttrs[$k] = $v; + } + $attrs = $eAttrs; + } else { + $attrs = array(); + } + // find status, register data + switch($name){ + case 'all': // (optional) compositor content for a complexType + case 'choice': + case 'group': + case 'sequence': + //$this->xdebug("compositor $name for currentComplexType: $this->currentComplexType and currentElement: $this->currentElement"); + $this->complexTypes[$this->currentComplexType]['compositor'] = $name; + //if($name == 'all' || $name == 'sequence'){ + // $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + //} + break; + case 'attribute': // complexType attribute + //$this->xdebug("parsing attribute $attrs[name] $attrs[ref] of value: ".$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']); + $this->xdebug("parsing attribute:"); + $this->appendDebug($this->varDump($attrs)); + if (!isset($attrs['form'])) { + // TODO: handle globals + $attrs['form'] = $this->schemaInfo['attributeFormDefault']; + } + if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { + $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + if (!strpos($v, ':')) { + // no namespace in arrayType attribute value... + if ($this->defaultNamespace[$pos]) { + // ...so use the default + $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } + } + } + if(isset($attrs['name'])){ + $this->attributes[$attrs['name']] = $attrs; + $aname = $attrs['name']; + } elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){ + if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { + $aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } else { + $aname = ''; + } + } elseif(isset($attrs['ref'])){ + $aname = $attrs['ref']; + $this->attributes[$attrs['ref']] = $attrs; + } + + if($this->currentComplexType){ // This should *always* be + $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; + } + // arrayType attribute + if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){ + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + $prefix = $this->getPrefix($aname); + if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){ + $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } else { + $v = ''; + } + if(strpos($v,'[,]')){ + $this->complexTypes[$this->currentComplexType]['multidimensional'] = true; + } + $v = substr($v,0,strpos($v,'[')); // clip the [] + if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){ + $v = $this->XMLSchemaVersion.':'.$v; + } + $this->complexTypes[$this->currentComplexType]['arrayType'] = $v; + } + break; + case 'complexContent': // (optional) content for a complexType + $this->xdebug("do nothing for element $name"); + break; + case 'complexType': + array_push($this->complexTypeStack, $this->currentComplexType); + if(isset($attrs['name'])){ + // TODO: what is the scope of named complexTypes that appear + // nested within other c complexTypes? + $this->xdebug('processing named complexType '.$attrs['name']); + //$this->currentElement = false; + $this->currentComplexType = $attrs['name']; + $this->complexTypes[$this->currentComplexType] = $attrs; + $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; + // This is for constructs like + // + // + // + // + // + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ + $this->xdebug('complexType is unusual array'); + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } else { + $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + } + } else { + $name = $this->CreateTypeName($this->currentElement); + $this->xdebug('processing unnamed complexType for element ' . $this->currentElement . ' named ' . $name); + $this->currentComplexType = $name; + //$this->currentElement = false; + $this->complexTypes[$this->currentComplexType] = $attrs; + $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; + // This is for constructs like + // + // + // + // + // + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ + $this->xdebug('complexType is unusual array'); + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } else { + $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + } + } + $this->complexTypes[$this->currentComplexType]['simpleContent'] = 'false'; + break; + case 'element': + array_push($this->elementStack, $this->currentElement); + if (!isset($attrs['form'])) { + if ($this->currentComplexType) { + $attrs['form'] = $this->schemaInfo['elementFormDefault']; + } else { + // global + $attrs['form'] = 'qualified'; + } + } + if(isset($attrs['type'])){ + $this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']); + if (! $this->getPrefix($attrs['type'])) { + if ($this->defaultNamespace[$pos]) { + $attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type']; + $this->xdebug('used default namespace to make type ' . $attrs['type']); + } + } + // This is for constructs like + // + // + // + // + // + if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') { + $this->xdebug('arrayType for unusual array is ' . $attrs['type']); + $this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type']; + } + $this->currentElement = $attrs['name']; + $ename = $attrs['name']; + } elseif(isset($attrs['ref'])){ + $this->xdebug("processing element as ref to ".$attrs['ref']); + $this->currentElement = "ref to ".$attrs['ref']; + $ename = $this->getLocalPart($attrs['ref']); + } else { + $type = $this->CreateTypeName($this->currentComplexType . '_' . $attrs['name']); + $this->xdebug("processing untyped element " . $attrs['name'] . ' type ' . $type); + $this->currentElement = $attrs['name']; + $attrs['type'] = $this->schemaTargetNamespace . ':' . $type; + $ename = $attrs['name']; + } + if (isset($ename) && $this->currentComplexType) { + $this->xdebug("add element $ename to complexType $this->currentComplexType"); + $this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs; + } elseif (!isset($attrs['ref'])) { + $this->xdebug("add element $ename to elements array"); + $this->elements[ $attrs['name'] ] = $attrs; + $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; + } + break; + case 'enumeration': // restriction value list member + $this->xdebug('enumeration ' . $attrs['value']); + if ($this->currentSimpleType) { + $this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value']; + } elseif ($this->currentComplexType) { + $this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value']; + } + break; + case 'extension': // simpleContent or complexContent type extension + $this->xdebug('extension ' . $attrs['base']); + if ($this->currentComplexType) { + $ns = $this->getPrefix($attrs['base']); + if ($ns == '') { + $this->complexTypes[$this->currentComplexType]['extensionBase'] = $this->schemaTargetNamespace . ':' . $attrs['base']; + } else { + $this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base']; + } + } else { + $this->xdebug('no current complexType to set extensionBase'); + } + break; + case 'import': + if (isset($attrs['schemaLocation'])) { + $this->xdebug('import namespace ' . $attrs['namespace'] . ' from ' . $attrs['schemaLocation']); + $this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); + } else { + $this->xdebug('import namespace ' . $attrs['namespace']); + $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true); + if (! $this->getPrefixFromNamespace($attrs['namespace'])) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; + } + } + break; + case 'include': + if (isset($attrs['schemaLocation'])) { + $this->xdebug('include into namespace ' . $this->schemaTargetNamespace . ' from ' . $attrs['schemaLocation']); + $this->imports[$this->schemaTargetNamespace][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); + } else { + $this->xdebug('ignoring invalid XML Schema construct: include without schemaLocation attribute'); + } + break; + case 'list': // simpleType value list + $this->xdebug("do nothing for element $name"); + break; + case 'restriction': // simpleType, simpleContent or complexContent value restriction + $this->xdebug('restriction ' . $attrs['base']); + if($this->currentSimpleType){ + $this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base']; + } elseif($this->currentComplexType){ + $this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base']; + if(strstr($attrs['base'],':') == ':Array'){ + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } + } + break; + case 'schema': + $this->schemaInfo = $attrs; + $this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix); + if (isset($attrs['targetNamespace'])) { + $this->schemaTargetNamespace = $attrs['targetNamespace']; + } + if (!isset($attrs['elementFormDefault'])) { + $this->schemaInfo['elementFormDefault'] = 'unqualified'; + } + if (!isset($attrs['attributeFormDefault'])) { + $this->schemaInfo['attributeFormDefault'] = 'unqualified'; + } + break; + case 'simpleContent': // (optional) content for a complexType + if ($this->currentComplexType) { // This should *always* be + $this->complexTypes[$this->currentComplexType]['simpleContent'] = 'true'; + } else { + $this->xdebug("do nothing for element $name because there is no current complexType"); + } + break; + case 'simpleType': + array_push($this->simpleTypeStack, $this->currentSimpleType); + if(isset($attrs['name'])){ + $this->xdebug("processing simpleType for name " . $attrs['name']); + $this->currentSimpleType = $attrs['name']; + $this->simpleTypes[ $attrs['name'] ] = $attrs; + $this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType'; + $this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar'; + } else { + $name = $this->CreateTypeName($this->currentComplexType . '_' . $this->currentElement); + $this->xdebug('processing unnamed simpleType for element ' . $this->currentElement . ' named ' . $name); + $this->currentSimpleType = $name; + //$this->currentElement = false; + $this->simpleTypes[$this->currentSimpleType] = $attrs; + $this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar'; + } + break; + case 'union': // simpleType type list + $this->xdebug("do nothing for element $name"); + break; + default: + $this->xdebug("do not have any logic to process element $name"); + } + } + + /** + * end-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @access private + */ + function schemaEndElement($parser, $name) { + // bring depth down a notch + $this->depth--; + // position of current element is equal to the last value left in depth_array for my depth + if(isset($this->depth_array[$this->depth])){ + $pos = $this->depth_array[$this->depth]; + } + // get element prefix + if ($prefix = $this->getPrefix($name)){ + // get unqualified name + $name = $this->getLocalPart($name); + } else { + $prefix = ''; + } + // move on... + if($name == 'complexType'){ + $this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)')); + $this->xdebug($this->varDump($this->complexTypes[$this->currentComplexType])); + $this->currentComplexType = array_pop($this->complexTypeStack); + //$this->currentElement = false; + } + if($name == 'element'){ + $this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)')); + $this->currentElement = array_pop($this->elementStack); + } + if($name == 'simpleType'){ + $this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)')); + $this->xdebug($this->varDump($this->simpleTypes[$this->currentSimpleType])); + $this->currentSimpleType = array_pop($this->simpleTypeStack); + } + } + + /** + * element content handler + * + * @param string $parser XML parser object + * @param string $data element content + * @access private + */ + function schemaCharacterData($parser, $data){ + $pos = $this->depth_array[$this->depth - 1]; + $this->message[$pos]['cdata'] .= $data; + } + + /** + * serialize the schema + * + * @access public + */ + function serializeSchema(){ + + $schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion); + $xml = ''; + // imports + if (sizeof($this->imports) > 0) { + foreach($this->imports as $ns => $list) { + foreach ($list as $ii) { + if ($ii['location'] != '') { + $xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n"; + } else { + $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; + } + } + } + } + // complex types + foreach($this->complexTypes as $typeName => $attrs){ + $contentStr = ''; + // serialize child elements + if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){ + foreach($attrs['elements'] as $element => $eParts){ + if(isset($eParts['ref'])){ + $contentStr .= " <$schemaPrefix:element ref=\"$element\"/>\n"; + } else { + $contentStr .= " <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\""; + foreach ($eParts as $aName => $aValue) { + // handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable + if ($aName != 'name' && $aName != 'type') { + $contentStr .= " $aName=\"$aValue\""; + } + } + $contentStr .= "/>\n"; + } + } + // compositor wraps elements + if (isset($attrs['compositor']) && ($attrs['compositor'] != '')) { + $contentStr = " <$schemaPrefix:$attrs[compositor]>\n".$contentStr." \n"; + } + } + // attributes + if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){ + foreach($attrs['attrs'] as $attr => $aParts){ + $contentStr .= " <$schemaPrefix:attribute"; + foreach ($aParts as $a => $v) { + if ($a == 'ref' || $a == 'type') { + $contentStr .= " $a=\"".$this->contractQName($v).'"'; + } elseif ($a == 'http://schemas.xmlsoap.org/wsdl/:arrayType') { + $this->usedNamespaces['wsdl'] = $this->namespaces['wsdl']; + $contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"'; + } else { + $contentStr .= " $a=\"$v\""; + } + } + $contentStr .= "/>\n"; + } + } + // if restriction + if (isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){ + $contentStr = " <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr." \n"; + // complex or simple content + if ((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){ + $contentStr = " <$schemaPrefix:complexContent>\n".$contentStr." \n"; + } + } + // finalize complex type + if($contentStr != ''){ + $contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." \n"; + } else { + $contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n"; + } + $xml .= $contentStr; + } + // simple types + if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){ + foreach($this->simpleTypes as $typeName => $eParts){ + $xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\">\n"; + if (isset($eParts['enumeration'])) { + foreach ($eParts['enumeration'] as $e) { + $xml .= " <$schemaPrefix:enumeration value=\"$e\"/>\n"; + } + } + $xml .= " \n "; + } + } + // elements + if(isset($this->elements) && count($this->elements) > 0){ + foreach($this->elements as $element => $eParts){ + $xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n"; + } + } + // attributes + if(isset($this->attributes) && count($this->attributes) > 0){ + foreach($this->attributes as $attr => $aParts){ + $xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>"; + } + } + // finish 'er up + $attr = ''; + foreach ($this->schemaInfo as $k => $v) { + if ($k == 'elementFormDefault' || $k == 'attributeFormDefault') { + $attr .= " $k=\"$v\""; + } + } + $el = "<$schemaPrefix:schema$attr targetNamespace=\"$this->schemaTargetNamespace\"\n"; + foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) { + $el .= " xmlns:$nsp=\"$ns\""; + } + $xml = $el . ">\n".$xml."\n"; + return $xml; + } + + /** + * adds debug data to the clas level debug string + * + * @param string $string debug data + * @access private + */ + function xdebug($string){ + $this->debug('<' . $this->schemaTargetNamespace . '> '.$string); + } + + /** + * get the PHP type of a user defined type in the schema + * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays + * returns false if no type exists, or not w/ the given namespace + * else returns a string that is either a native php type, or 'struct' + * + * @param string $type name of defined type + * @param string $ns namespace of type + * @return mixed + * @access public + * @deprecated + */ + function getPHPType($type,$ns){ + if(isset($this->typemap[$ns][$type])){ + //print "found type '$type' and ns $ns in typemap
        "; + return $this->typemap[$ns][$type]; + } elseif(isset($this->complexTypes[$type])){ + //print "getting type '$type' and ns $ns from complexTypes array
        "; + return $this->complexTypes[$type]['phpType']; + } + return false; + } + + /** + * returns an associative array of information about a given type + * returns false if no type exists by the given name + * + * For a complexType typeDef = array( + * 'restrictionBase' => '', + * 'phpType' => '', + * 'compositor' => '(sequence|all)', + * 'elements' => array(), // refs to elements array + * 'attrs' => array() // refs to attributes array + * ... and so on (see addComplexType) + * ) + * + * For simpleType or element, the array has different keys. + * + * @param string $type + * @return mixed + * @access public + * @see addComplexType + * @see addSimpleType + * @see addElement + */ + function getTypeDef($type){ + //$this->debug("in getTypeDef for type $type"); + if (substr($type, -1) == '^') { + $is_element = 1; + $type = substr($type, 0, -1); + } else { + $is_element = 0; + } + + if((! $is_element) && isset($this->complexTypes[$type])){ + $this->xdebug("in getTypeDef, found complexType $type"); + return $this->complexTypes[$type]; + } elseif((! $is_element) && isset($this->simpleTypes[$type])){ + $this->xdebug("in getTypeDef, found simpleType $type"); + if (!isset($this->simpleTypes[$type]['phpType'])) { + // get info for type to tack onto the simple type + // TODO: can this ever really apply (i.e. what is a simpleType really?) + $uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':') + 1); + $ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':')); + $etype = $this->getTypeDef($uqType); + if ($etype) { + $this->xdebug("in getTypeDef, found type for simpleType $type:"); + $this->xdebug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $this->simpleTypes[$type]['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $this->simpleTypes[$type]['elements'] = $etype['elements']; + } + } + } + return $this->simpleTypes[$type]; + } elseif(isset($this->elements[$type])){ + $this->xdebug("in getTypeDef, found element $type"); + if (!isset($this->elements[$type]['phpType'])) { + // get info for type to tack onto the element + $uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1); + $ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':')); + $etype = $this->getTypeDef($uqType); + if ($etype) { + $this->xdebug("in getTypeDef, found type for element $type:"); + $this->xdebug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $this->elements[$type]['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $this->elements[$type]['elements'] = $etype['elements']; + } + if (isset($etype['extensionBase'])) { + $this->elements[$type]['extensionBase'] = $etype['extensionBase']; + } + } elseif ($ns == 'http://www.w3.org/2001/XMLSchema') { + $this->xdebug("in getTypeDef, element $type is an XSD type"); + $this->elements[$type]['phpType'] = 'scalar'; + } + } + return $this->elements[$type]; + } elseif(isset($this->attributes[$type])){ + $this->xdebug("in getTypeDef, found attribute $type"); + return $this->attributes[$type]; + } elseif (preg_match('/_ContainedType$/', $type)) { + $this->xdebug("in getTypeDef, have an untyped element $type"); + $typeDef['typeClass'] = 'simpleType'; + $typeDef['phpType'] = 'scalar'; + $typeDef['type'] = 'http://www.w3.org/2001/XMLSchema:string'; + return $typeDef; + } + $this->xdebug("in getTypeDef, did not find $type"); + return false; + } + + /** + * returns a sample serialization of a given type, or false if no type by the given name + * + * @param string $type name of type + * @return mixed + * @access public + * @deprecated + */ + function serializeTypeDef($type){ + //print "in sTD() for type $type
        "; + if($typeDef = $this->getTypeDef($type)){ + $str .= '<'.$type; + if(is_array($typeDef['attrs'])){ + foreach($typeDef['attrs'] as $attName => $data){ + $str .= " $attName=\"{type = ".$data['type']."}\""; + } + } + $str .= " xmlns=\"".$this->schema['targetNamespace']."\""; + if(count($typeDef['elements']) > 0){ + $str .= ">"; + foreach($typeDef['elements'] as $element => $eData){ + $str .= $this->serializeTypeDef($element); + } + $str .= ""; + } elseif($typeDef['typeClass'] == 'element') { + $str .= ">"; + } else { + $str .= "/>"; + } + return $str; + } + return false; + } + + /** + * returns HTML form elements that allow a user + * to enter values for creating an instance of the given type. + * + * @param string $name name for type instance + * @param string $type name of type + * @return string + * @access public + * @deprecated + */ + function typeToForm($name,$type){ + // get typedef + if($typeDef = $this->getTypeDef($type)){ + // if struct + if($typeDef['phpType'] == 'struct'){ + $buffer .= ''; + foreach($typeDef['elements'] as $child => $childDef){ + $buffer .= " + + "; + } + $buffer .= '
        $childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):
        '; + // if array + } elseif($typeDef['phpType'] == 'array'){ + $buffer .= ''; + for($i=0;$i < 3; $i++){ + $buffer .= " + + "; + } + $buffer .= '
        array item (type: $typeDef[arrayType]):
        '; + // if scalar + } else { + $buffer .= ""; + } + } else { + $buffer .= ""; + } + return $buffer; + } + + /** + * adds a complex type to the schema + * + * example: array + * + * addType( + * 'ArrayOfstring', + * 'complexType', + * 'array', + * '', + * 'SOAP-ENC:Array', + * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), + * 'xsd:string' + * ); + * + * example: PHP associative array ( SOAP Struct ) + * + * addType( + * 'SOAPStruct', + * 'complexType', + * 'struct', + * 'all', + * array('myVar'=> array('name'=>'myVar','type'=>'string') + * ); + * + * @param name + * @param typeClass (complexType|simpleType|attribute) + * @param phpType: currently supported are array and struct (php assoc array) + * @param compositor (all|sequence|choice) + * @param restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param elements = array ( name = array(name=>'',type=>'') ) + * @param attrs = array( + * array( + * 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", + * "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" + * ) + * ) + * @param arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string) + * @access public + * @see getTypeDef + */ + function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType=''){ + $this->complexTypes[$name] = array( + 'name' => $name, + 'typeClass' => $typeClass, + 'phpType' => $phpType, + 'compositor'=> $compositor, + 'restrictionBase' => $restrictionBase, + 'elements' => $elements, + 'attrs' => $attrs, + 'arrayType' => $arrayType + ); + + $this->xdebug("addComplexType $name:"); + $this->appendDebug($this->varDump($this->complexTypes[$name])); + } + + /** + * adds a simple type to the schema + * + * @param string $name + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param string $typeClass (should always be simpleType) + * @param string $phpType (should always be scalar) + * @param array $enumeration array of values + * @access public + * @see nusoap_xmlschema + * @see getTypeDef + */ + function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) { + $this->simpleTypes[$name] = array( + 'name' => $name, + 'typeClass' => $typeClass, + 'phpType' => $phpType, + 'type' => $restrictionBase, + 'enumeration' => $enumeration + ); + + $this->xdebug("addSimpleType $name:"); + $this->appendDebug($this->varDump($this->simpleTypes[$name])); + } + + /** + * adds an element to the schema + * + * @param array $attrs attributes that must include name and type + * @see nusoap_xmlschema + * @access public + */ + function addElement($attrs) { + if (! $this->getPrefix($attrs['type'])) { + $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type']; + } + $this->elements[ $attrs['name'] ] = $attrs; + $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; + + $this->xdebug("addElement " . $attrs['name']); + $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); + } +} + +/** + * Backward compatibility + */ +class XMLSchema extends nusoap_xmlschema { +} + + diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoap.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoap.php new file mode 100755 index 000000000..7b067a681 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoap.php @@ -0,0 +1,8148 @@ + +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_base { + /** + * Identification for HTTP headers. + * + * @var string + * @access private + */ + var $title = 'NuSOAP'; + /** + * Version for HTTP headers. + * + * @var string + * @access private + */ + var $version = '0.9.5'; + /** + * CVS revision for HTTP headers. + * + * @var string + * @access private + */ + var $revision = '$Revision: 1.123 $'; + /** + * Current error string (manipulated by getError/setError) + * + * @var string + * @access private + */ + var $error_str = ''; + /** + * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment) + * + * @var string + * @access private + */ + var $debug_str = ''; + /** + * toggles automatic encoding of special characters as entities + * (should always be true, I think) + * + * @var boolean + * @access private + */ + var $charencoding = true; + /** + * the debug level for this instance + * + * @var integer + * @access private + */ + var $debugLevel; + + /** + * set schema version + * + * @var string + * @access public + */ + var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'; + + /** + * charset encoding for outgoing messages + * + * @var string + * @access public + */ + var $soap_defencoding = 'ISO-8859-1'; + //var $soap_defencoding = 'UTF-8'; + + /** + * namespaces in an array of prefix => uri + * + * this is "seeded" by a set of constants, but it may be altered by code + * + * @var array + * @access public + */ + var $namespaces = array( + 'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/', + 'xsd' => 'http://www.w3.org/2001/XMLSchema', + 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/' + ); + + /** + * namespaces used in the current context, e.g. during serialization + * + * @var array + * @access private + */ + var $usedNamespaces = array(); + + /** + * XML Schema types in an array of uri => (array of xml type => php type) + * is this legacy yet? + * no, this is used by the nusoap_xmlschema class to verify type => namespace mappings. + * @var array + * @access public + */ + var $typemap = array( + 'http://www.w3.org/2001/XMLSchema' => array( + 'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double', + 'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'', + 'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string', + // abstract "any" types + 'anyType'=>'string','anySimpleType'=>'string', + // derived datatypes + 'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'', + 'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer', + 'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer', + 'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''), + 'http://www.w3.org/2000/10/XMLSchema' => array( + 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', + 'float'=>'double','dateTime'=>'string', + 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), + 'http://www.w3.org/1999/XMLSchema' => array( + 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', + 'float'=>'double','dateTime'=>'string', + 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), + 'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'), + 'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'), + 'http://xml.apache.org/xml-soap' => array('Map') + ); + + /** + * XML entities to convert + * + * @var array + * @access public + * @deprecated + * @see expandEntities + */ + var $xmlEntities = array('quot' => '"','amp' => '&', + 'lt' => '<','gt' => '>','apos' => "'"); + + /** + * constructor + * + * @access public + */ + function nusoap_base() { + $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; + } + + /** + * gets the global debug level, which applies to future instances + * + * @return integer Debug level 0-9, where 0 turns off + * @access public + */ + function getGlobalDebugLevel() { + return $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; + } + + /** + * sets the global debug level, which applies to future instances + * + * @param int $level Debug level 0-9, where 0 turns off + * @access public + */ + function setGlobalDebugLevel($level) { + $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'] = $level; + } + + /** + * gets the debug level for this instance + * + * @return int Debug level 0-9, where 0 turns off + * @access public + */ + function getDebugLevel() { + return $this->debugLevel; + } + + /** + * sets the debug level for this instance + * + * @param int $level Debug level 0-9, where 0 turns off + * @access public + */ + function setDebugLevel($level) { + $this->debugLevel = $level; + } + + /** + * adds debug data to the instance debug string with formatting + * + * @param string $string debug data + * @access private + */ + function debug($string){ + if ($this->debugLevel > 0) { + $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n"); + } + } + + /** + * adds debug data to the instance debug string without formatting + * + * @param string $string debug data + * @access public + */ + function appendDebug($string){ + if ($this->debugLevel > 0) { + // it would be nice to use a memory stream here to use + // memory more efficiently + $this->debug_str .= $string; + } + } + + /** + * clears the current debug data for this instance + * + * @access public + */ + function clearDebug() { + // it would be nice to use a memory stream here to use + // memory more efficiently + $this->debug_str = ''; + } + + /** + * gets the current debug data for this instance + * + * @return debug data + * @access public + */ + function &getDebug() { + // it would be nice to use a memory stream here to use + // memory more efficiently + return $this->debug_str; + } + + /** + * gets the current debug data for this instance as an XML comment + * this may change the contents of the debug data + * + * @return debug data as an XML comment + * @access public + */ + function &getDebugAsXMLComment() { + // it would be nice to use a memory stream here to use + // memory more efficiently + while (strpos($this->debug_str, '--')) { + $this->debug_str = str_replace('--', '- -', $this->debug_str); + } + $ret = ""; + return $ret; + } + + /** + * expands entities, e.g. changes '<' to '<'. + * + * @param string $val The string in which to expand entities. + * @access private + */ + function expandEntities($val) { + if ($this->charencoding) { + $val = str_replace('&', '&', $val); + $val = str_replace("'", ''', $val); + $val = str_replace('"', '"', $val); + $val = str_replace('<', '<', $val); + $val = str_replace('>', '>', $val); + } + return $val; + } + + /** + * returns error string if present + * + * @return mixed error string or false + * @access public + */ + function getError(){ + if($this->error_str != ''){ + return $this->error_str; + } + return false; + } + + /** + * sets error string + * + * @return boolean $string error string + * @access private + */ + function setError($str){ + $this->error_str = $str; + } + + /** + * detect if array is a simple array or a struct (associative array) + * + * @param mixed $val The PHP array + * @return string (arraySimple|arrayStruct) + * @access private + */ + function isArraySimpleOrStruct($val) { + $keyList = array_keys($val); + foreach ($keyList as $keyListValue) { + if (!is_int($keyListValue)) { + return 'arrayStruct'; + } + } + return 'arraySimple'; + } + + /** + * serializes PHP values in accordance w/ section 5. Type information is + * not serialized if $use == 'literal'. + * + * @param mixed $val The value to serialize + * @param string $name The name (local part) of the XML element + * @param string $type The XML schema type (local part) for the element + * @param string $name_ns The namespace for the name of the XML element + * @param string $type_ns The namespace for the type of the element + * @param array $attributes The attributes to serialize as name=>value pairs + * @param string $use The WSDL "use" (encoded|literal) + * @param boolean $soapval Whether this is called from soapval. + * @return string The serialized element, possibly with child elements + * @access public + */ + function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded',$soapval=false) { + $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval"); + $this->appendDebug('value=' . $this->varDump($val)); + $this->appendDebug('attributes=' . $this->varDump($attributes)); + + if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) { + $this->debug("serialize_val: serialize soapval"); + $xml = $val->serialize($use); + $this->appendDebug($val->getDebug()); + $val->clearDebug(); + $this->debug("serialize_val of soapval returning $xml"); + return $xml; + } + // force valid name if necessary + if (is_numeric($name)) { + $name = '__numeric_' . $name; + } elseif (! $name) { + $name = 'noname'; + } + // if name has ns, add ns prefix to name + $xmlns = ''; + if($name_ns){ + $prefix = 'nu'.rand(1000,9999); + $name = $prefix.':'.$name; + $xmlns .= " xmlns:$prefix=\"$name_ns\""; + } + // if type is prefixed, create type prefix + if($type_ns != '' && $type_ns == $this->namespaces['xsd']){ + // need to fix this. shouldn't default to xsd if no ns specified + // w/o checking against typemap + $type_prefix = 'xsd'; + } elseif($type_ns){ + $type_prefix = 'ns'.rand(1000,9999); + $xmlns .= " xmlns:$type_prefix=\"$type_ns\""; + } + // serialize attributes if present + $atts = ''; + if($attributes){ + foreach($attributes as $k => $v){ + $atts .= " $k=\"".$this->expandEntities($v).'"'; + } + } + // serialize null value + if (is_null($val)) { + $this->debug("serialize_val: serialize null"); + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$xmlns$atts/>"; + $this->debug("serialize_val returning $xml"); + return $xml; + } else { + if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + $xml = "<$name$xmlns$type_str$atts xsi:nil=\"true\"/>"; + $this->debug("serialize_val returning $xml"); + return $xml; + } + } + // serialize if an xsd built-in primitive type + if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){ + $this->debug("serialize_val: serialize xsd built-in primitive type"); + if (is_bool($val)) { + if ($type == 'boolean') { + $val = $val ? 'true' : 'false'; + } elseif (! $val) { + $val = 0; + } + } else if (is_string($val)) { + $val = $this->expandEntities($val); + } + if ($use == 'literal') { + $xml = "<$name$xmlns$atts>$val"; + $this->debug("serialize_val returning $xml"); + return $xml; + } else { + $xml = "<$name$xmlns xsi:type=\"xsd:$type\"$atts>$val"; + $this->debug("serialize_val returning $xml"); + return $xml; + } + } + // detect type and serialize + $xml = ''; + switch(true) { + case (is_bool($val) || $type == 'boolean'): + $this->debug("serialize_val: serialize boolean"); + if ($type == 'boolean') { + $val = $val ? 'true' : 'false'; + } elseif (! $val) { + $val = 0; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val"; + } + break; + case (is_int($val) || is_long($val) || $type == 'int'): + $this->debug("serialize_val: serialize int"); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val"; + } + break; + case (is_float($val)|| is_double($val) || $type == 'float'): + $this->debug("serialize_val: serialize float"); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val"; + } + break; + case (is_string($val) || $type == 'string'): + $this->debug("serialize_val: serialize string"); + $val = $this->expandEntities($val); + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$val"; + } else { + $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val"; + } + break; + case is_object($val): + $this->debug("serialize_val: serialize object"); + if (get_class($val) == 'soapval') { + $this->debug("serialize_val: serialize soapval object"); + $pXml = $val->serialize($use); + $this->appendDebug($val->getDebug()); + $val->clearDebug(); + } else { + if (! $name) { + $name = get_class($val); + $this->debug("In serialize_val, used class name $name as element name"); + } else { + $this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val)); + } + foreach(get_object_vars($val) as $k => $v){ + $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use); + } + } + if(isset($type) && isset($type_prefix)){ + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>$pXml"; + } else { + $xml .= "<$name$xmlns$type_str$atts>$pXml"; + } + break; + break; + case (is_array($val) || $type): + // detect if struct or array + $valueType = $this->isArraySimpleOrStruct($val); + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){ + $this->debug("serialize_val: serialize array"); + $i = 0; + if(is_array($val) && count($val)> 0){ + foreach($val as $v){ + if(is_object($v) && get_class($v) == 'soapval'){ + $tt_ns = $v->type_ns; + $tt = $v->type; + } elseif (is_array($v)) { + $tt = $this->isArraySimpleOrStruct($v); + } else { + $tt = gettype($v); + } + $array_types[$tt] = 1; + // TODO: for literal, the name should be $name + $xml .= $this->serialize_val($v,'item',false,false,false,false,$use); + ++$i; + } + if(count($array_types) > 1){ + $array_typename = 'xsd:anyType'; + } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) { + if ($tt == 'integer') { + $tt = 'int'; + } + $array_typename = 'xsd:'.$tt; + } elseif(isset($tt) && $tt == 'arraySimple'){ + $array_typename = 'SOAP-ENC:Array'; + } elseif(isset($tt) && $tt == 'arrayStruct'){ + $array_typename = 'unnamed_struct_use_soapval'; + } else { + // if type is prefixed, create type prefix + if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ + $array_typename = 'xsd:' . $tt; + } elseif ($tt_ns) { + $tt_prefix = 'ns' . rand(1000, 9999); + $array_typename = "$tt_prefix:$tt"; + $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\""; + } else { + $array_typename = $tt; + } + } + $array_type = $i; + if ($use == 'literal') { + $type_str = ''; + } else if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\""; + } + // empty array + } else { + if ($use == 'literal') { + $type_str = ''; + } else if (isset($type) && isset($type_prefix)) { + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\""; + } + } + // TODO: for array in literal, there is no wrapper here + $xml = "<$name$xmlns$type_str$atts>".$xml.""; + } else { + // got a struct + $this->debug("serialize_val: serialize struct"); + if(isset($type) && isset($type_prefix)){ + $type_str = " xsi:type=\"$type_prefix:$type\""; + } else { + $type_str = ''; + } + if ($use == 'literal') { + $xml .= "<$name$xmlns$atts>"; + } else { + $xml .= "<$name$xmlns$type_str$atts>"; + } + foreach($val as $k => $v){ + // Apache Map + if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') { + $xml .= ''; + $xml .= $this->serialize_val($k,'key',false,false,false,false,$use); + $xml .= $this->serialize_val($v,'value',false,false,false,false,$use); + $xml .= ''; + } else { + $xml .= $this->serialize_val($v,$k,false,false,false,false,$use); + } + } + $xml .= ""; + } + break; + default: + $this->debug("serialize_val: serialize unknown"); + $xml .= 'not detected, got '.gettype($val).' for '.$val; + break; + } + $this->debug("serialize_val returning $xml"); + return $xml; + } + + /** + * serializes a message + * + * @param string $body the XML of the SOAP body + * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array + * @param array $namespaces optional the namespaces used in generating the body and headers + * @param string $style optional (rpc|document) + * @param string $use optional (encoded|literal) + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @return string the message + * @access public + */ + function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){ + // TODO: add an option to automatically run utf8_encode on $body and $headers + // if $this->soap_defencoding is UTF-8. Not doing this automatically allows + // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1 + + $this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle"); + $this->debug("headers:"); + $this->appendDebug($this->varDump($headers)); + $this->debug("namespaces:"); + $this->appendDebug($this->varDump($namespaces)); + + // serialize namespaces + $ns_string = ''; + foreach(array_merge($this->namespaces,$namespaces) as $k => $v){ + $ns_string .= " xmlns:$k=\"$v\""; + } + if($encodingStyle) { + $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string"; + } + + // serialize headers + if($headers){ + if (is_array($headers)) { + $xml = ''; + foreach ($headers as $k => $v) { + if (is_object($v) && get_class($v) == 'soapval') { + $xml .= $this->serialize_val($v, false, false, false, false, false, $use); + } else { + $xml .= $this->serialize_val($v, $k, false, false, false, false, $use); + } + } + $headers = $xml; + $this->debug("In serializeEnvelope, serialized array of headers to $headers"); + } + $headers = "".$headers.""; + } + // serialize envelope + return + 'soap_defencoding .'"?'.">". + '". + $headers. + "". + $body. + "". + ""; + } + + /** + * formats a string to be inserted into an HTML stream + * + * @param string $str The string to format + * @return string The formatted string + * @access public + * @deprecated + */ + function formatDump($str){ + $str = htmlspecialchars($str); + return nl2br($str); + } + + /** + * contracts (changes namespace to prefix) a qualified name + * + * @param string $qname qname + * @return string contracted qname + * @access private + */ + function contractQname($qname){ + // get element namespace + //$this->xdebug("Contract $qname"); + if (strrpos($qname, ':')) { + // get unqualified name + $name = substr($qname, strrpos($qname, ':') + 1); + // get ns + $ns = substr($qname, 0, strrpos($qname, ':')); + $p = $this->getPrefixFromNamespace($ns); + if ($p) { + return $p . ':' . $name; + } + return $qname; + } else { + return $qname; + } + } + + /** + * expands (changes prefix to namespace) a qualified name + * + * @param string $qname qname + * @return string expanded qname + * @access private + */ + function expandQname($qname){ + // get element prefix + if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){ + // get unqualified name + $name = substr(strstr($qname,':'),1); + // get ns prefix + $prefix = substr($qname,0,strpos($qname,':')); + if(isset($this->namespaces[$prefix])){ + return $this->namespaces[$prefix].':'.$name; + } else { + return $qname; + } + } else { + return $qname; + } + } + + /** + * returns the local part of a prefixed string + * returns the original string, if not prefixed + * + * @param string $str The prefixed string + * @return string The local part + * @access public + */ + function getLocalPart($str){ + if($sstr = strrchr($str,':')){ + // get unqualified name + return substr( $sstr, 1 ); + } else { + return $str; + } + } + + /** + * returns the prefix part of a prefixed string + * returns false, if not prefixed + * + * @param string $str The prefixed string + * @return mixed The prefix or false if there is no prefix + * @access public + */ + function getPrefix($str){ + if($pos = strrpos($str,':')){ + // get prefix + return substr($str,0,$pos); + } + return false; + } + + /** + * pass it a prefix, it returns a namespace + * + * @param string $prefix The prefix + * @return mixed The namespace, false if no namespace has the specified prefix + * @access public + */ + function getNamespaceFromPrefix($prefix){ + if (isset($this->namespaces[$prefix])) { + return $this->namespaces[$prefix]; + } + //$this->setError("No namespace registered for prefix '$prefix'"); + return false; + } + + /** + * returns the prefix for a given namespace (or prefix) + * or false if no prefixes registered for the given namespace + * + * @param string $ns The namespace + * @return mixed The prefix, false if the namespace has no prefixes + * @access public + */ + function getPrefixFromNamespace($ns) { + foreach ($this->namespaces as $p => $n) { + if ($ns == $n || $ns == $p) { + $this->usedNamespaces[$p] = $n; + return $p; + } + } + return false; + } + + /** + * returns the time in ODBC canonical form with microseconds + * + * @return string The time in ODBC canonical form with microseconds + * @access public + */ + function getmicrotime() { + if (function_exists('gettimeofday')) { + $tod = gettimeofday(); + $sec = $tod['sec']; + $usec = $tod['usec']; + } else { + $sec = time(); + $usec = 0; + } + return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec); + } + + /** + * Returns a string with the output of var_dump + * + * @param mixed $data The variable to var_dump + * @return string The output of var_dump + * @access public + */ + function varDump($data) { + ob_start(); + var_dump($data); + $ret_val = ob_get_contents(); + ob_end_clean(); + return $ret_val; + } + + /** + * represents the object as a string + * + * @return string + * @access public + */ + function __toString() { + return $this->varDump($this); + } +} + +// XML Schema Datatype Helper Functions + +//xsd:dateTime helpers + +/** +* convert unix timestamp to ISO 8601 compliant date string +* +* @param int $timestamp Unix time stamp +* @param boolean $utc Whether the time stamp is UTC or local +* @return mixed ISO 8601 date string or false +* @access public +*/ +function timestamp_to_iso8601($timestamp,$utc=true){ + $datestr = date('Y-m-d\TH:i:sO',$timestamp); + $pos = strrpos($datestr, "+"); + if ($pos === FALSE) { + $pos = strrpos($datestr, "-"); + } + if ($pos !== FALSE) { + if (strlen($datestr) == $pos + 5) { + $datestr = substr($datestr, 0, $pos + 3) . ':' . substr($datestr, -2); + } + } + if($utc){ + $pattern = '/'. + '([0-9]{4})-'. // centuries & years CCYY- + '([0-9]{2})-'. // months MM- + '([0-9]{2})'. // days DD + 'T'. // separator T + '([0-9]{2}):'. // hours hh: + '([0-9]{2}):'. // minutes mm: + '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss... + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; + + if(preg_match($pattern,$datestr,$regs)){ + return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]); + } + return false; + } else { + return $datestr; + } +} + +/** +* convert ISO 8601 compliant date string to unix timestamp +* +* @param string $datestr ISO 8601 compliant date string +* @return mixed Unix timestamp (int) or false +* @access public +*/ +function iso8601_to_timestamp($datestr){ + $pattern = '/'. + '([0-9]{4})-'. // centuries & years CCYY- + '([0-9]{2})-'. // months MM- + '([0-9]{2})'. // days DD + 'T'. // separator T + '([0-9]{2}):'. // hours hh: + '([0-9]{2}):'. // minutes mm: + '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss... + '(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's + '/'; + if(preg_match($pattern,$datestr,$regs)){ + // not utc + if($regs[8] != 'Z'){ + $op = substr($regs[8],0,1); + $h = substr($regs[8],1,2); + $m = substr($regs[8],strlen($regs[8])-2,2); + if($op == '-'){ + $regs[4] = $regs[4] + $h; + $regs[5] = $regs[5] + $m; + } elseif($op == '+'){ + $regs[4] = $regs[4] - $h; + $regs[5] = $regs[5] - $m; + } + } + return gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); +// return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z"); + } else { + return false; + } +} + +/** +* sleeps some number of microseconds +* +* @param string $usec the number of microseconds to sleep +* @access public +* @deprecated +*/ +function usleepWindows($usec) +{ + $start = gettimeofday(); + + do + { + $stop = gettimeofday(); + $timePassed = 1000000 * ($stop['sec'] - $start['sec']) + + $stop['usec'] - $start['usec']; + } + while ($timePassed < $usec); +} + +?> +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_fault extends nusoap_base { + /** + * The fault code (client|server) + * @var string + * @access private + */ + var $faultcode; + /** + * The fault actor + * @var string + * @access private + */ + var $faultactor; + /** + * The fault string, a description of the fault + * @var string + * @access private + */ + var $faultstring; + /** + * The fault detail, typically a string or array of string + * @var mixed + * @access private + */ + var $faultdetail; + + /** + * constructor + * + * @param string $faultcode (SOAP-ENV:Client | SOAP-ENV:Server) + * @param string $faultactor only used when msg routed between multiple actors + * @param string $faultstring human readable error message + * @param mixed $faultdetail detail, typically a string or array of string + */ + function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ + parent::nusoap_base(); + $this->faultcode = $faultcode; + $this->faultactor = $faultactor; + $this->faultstring = $faultstring; + $this->faultdetail = $faultdetail; + } + + /** + * serialize a fault + * + * @return string The serialization of the fault instance. + * @access public + */ + function serialize(){ + $ns_string = ''; + foreach($this->namespaces as $k => $v){ + $ns_string .= "\n xmlns:$k=\"$v\""; + } + $return_msg = + 'soap_defencoding.'"?>'. + '\n". + ''. + ''. + $this->serialize_val($this->faultcode, 'faultcode'). + $this->serialize_val($this->faultactor, 'faultactor'). + $this->serialize_val($this->faultstring, 'faultstring'). + $this->serialize_val($this->faultdetail, 'detail'). + ''. + ''. + ''; + return $return_msg; + } +} + +/** + * Backward compatibility + */ +class soap_fault extends nusoap_fault { +} + +?> +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_xmlschema extends nusoap_base { + + // files + var $schema = ''; + var $xml = ''; + // namespaces + var $enclosingNamespaces; + // schema info + var $schemaInfo = array(); + var $schemaTargetNamespace = ''; + // types, elements, attributes defined by the schema + var $attributes = array(); + var $complexTypes = array(); + var $complexTypeStack = array(); + var $currentComplexType = null; + var $elements = array(); + var $elementStack = array(); + var $currentElement = null; + var $simpleTypes = array(); + var $simpleTypeStack = array(); + var $currentSimpleType = null; + // imports + var $imports = array(); + // parser vars + var $parser; + var $position = 0; + var $depth = 0; + var $depth_array = array(); + var $message = array(); + var $defaultNamespace = array(); + + /** + * constructor + * + * @param string $schema schema document URI + * @param string $xml xml document URI + * @param string $namespaces namespaces defined in enclosing XML + * @access public + */ + function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ + parent::nusoap_base(); + $this->debug('nusoap_xmlschema class instantiated, inside constructor'); + // files + $this->schema = $schema; + $this->xml = $xml; + + // namespaces + $this->enclosingNamespaces = $namespaces; + $this->namespaces = array_merge($this->namespaces, $namespaces); + + // parse schema file + if($schema != ''){ + $this->debug('initial schema file: '.$schema); + $this->parseFile($schema, 'schema'); + } + + // parse xml file + if($xml != ''){ + $this->debug('initial xml file: '.$xml); + $this->parseFile($xml, 'xml'); + } + + } + + /** + * parse an XML file + * + * @param string $xml path/URL to XML file + * @param string $type (schema | xml) + * @return boolean + * @access public + */ + function parseFile($xml,$type){ + // parse xml file + if($xml != ""){ + $xmlStr = @join("",@file($xml)); + if($xmlStr == ""){ + $msg = 'Error reading XML from '.$xml; + $this->setError($msg); + $this->debug($msg); + return false; + } else { + $this->debug("parsing $xml"); + $this->parseString($xmlStr,$type); + $this->debug("done parsing $xml"); + return true; + } + } + return false; + } + + /** + * parse an XML string + * + * @param string $xml path or URL + * @param string $type (schema|xml) + * @access private + */ + function parseString($xml,$type){ + // parse xml string + if($xml != ""){ + + // Create an XML parser. + $this->parser = xml_parser_create(); + // Set the options for parsing the XML data. + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + + // Set the object for the parser. + xml_set_object($this->parser, $this); + + // Set the element handlers for the parser. + if($type == "schema"){ + xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement'); + xml_set_character_data_handler($this->parser,'schemaCharacterData'); + } elseif($type == "xml"){ + xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement'); + xml_set_character_data_handler($this->parser,'xmlCharacterData'); + } + + // Parse the XML file. + if(!xml_parse($this->parser,$xml,true)){ + // Display an error message. + $errstr = sprintf('XML error parsing XML schema on line %d: %s', + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser)) + ); + $this->debug($errstr); + $this->debug("XML payload:\n" . $xml); + $this->setError($errstr); + } + + xml_parser_free($this->parser); + } else{ + $this->debug('no xml passed to parseString()!!'); + $this->setError('no xml passed to parseString()!!'); + } + } + + /** + * gets a type name for an unnamed type + * + * @param string Element name + * @return string A type name for an unnamed type + * @access private + */ + function CreateTypeName($ename) { + $scope = ''; + for ($i = 0; $i < count($this->complexTypeStack); $i++) { + $scope .= $this->complexTypeStack[$i] . '_'; + } + return $scope . $ename . '_ContainedType'; + } + + /** + * start-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @param string $attrs associative array of attributes + * @access private + */ + function schemaStartElement($parser, $name, $attrs) { + + // position in the total number of elements, starting from 0 + $pos = $this->position++; + $depth = $this->depth++; + // set self as current value for this depth + $this->depth_array[$depth] = $pos; + $this->message[$pos] = array('cdata' => ''); + if ($depth > 0) { + $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; + } else { + $this->defaultNamespace[$pos] = false; + } + + // get element prefix + if($prefix = $this->getPrefix($name)){ + // get unqualified name + $name = $this->getLocalPart($name); + } else { + $prefix = ''; + } + + // loop thru attributes, expanding, and registering namespace declarations + if(count($attrs) > 0){ + foreach($attrs as $k => $v){ + // if ns declarations, add to class level array of valid namespaces + if(preg_match('/^xmlns/',$k)){ + //$this->xdebug("$k: $v"); + //$this->xdebug('ns_prefix: '.$this->getPrefix($k)); + if($ns_prefix = substr(strrchr($k,':'),1)){ + //$this->xdebug("Add namespace[$ns_prefix] = $v"); + $this->namespaces[$ns_prefix] = $v; + } else { + $this->defaultNamespace[$pos] = $v; + if (! $this->getPrefixFromNamespace($v)) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $v; + } + } + if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){ + $this->XMLSchemaVersion = $v; + $this->namespaces['xsi'] = $v.'-instance'; + } + } + } + foreach($attrs as $k => $v){ + // expand each attribute + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $eAttrs[$k] = $v; + } + $attrs = $eAttrs; + } else { + $attrs = array(); + } + // find status, register data + switch($name){ + case 'all': // (optional) compositor content for a complexType + case 'choice': + case 'group': + case 'sequence': + //$this->xdebug("compositor $name for currentComplexType: $this->currentComplexType and currentElement: $this->currentElement"); + $this->complexTypes[$this->currentComplexType]['compositor'] = $name; + //if($name == 'all' || $name == 'sequence'){ + // $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + //} + break; + case 'attribute': // complexType attribute + //$this->xdebug("parsing attribute $attrs[name] $attrs[ref] of value: ".$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']); + $this->xdebug("parsing attribute:"); + $this->appendDebug($this->varDump($attrs)); + if (!isset($attrs['form'])) { + // TODO: handle globals + $attrs['form'] = $this->schemaInfo['attributeFormDefault']; + } + if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { + $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + if (!strpos($v, ':')) { + // no namespace in arrayType attribute value... + if ($this->defaultNamespace[$pos]) { + // ...so use the default + $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } + } + } + if(isset($attrs['name'])){ + $this->attributes[$attrs['name']] = $attrs; + $aname = $attrs['name']; + } elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){ + if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { + $aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } else { + $aname = ''; + } + } elseif(isset($attrs['ref'])){ + $aname = $attrs['ref']; + $this->attributes[$attrs['ref']] = $attrs; + } + + if($this->currentComplexType){ // This should *always* be + $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; + } + // arrayType attribute + if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){ + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + $prefix = $this->getPrefix($aname); + if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){ + $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; + } else { + $v = ''; + } + if(strpos($v,'[,]')){ + $this->complexTypes[$this->currentComplexType]['multidimensional'] = true; + } + $v = substr($v,0,strpos($v,'[')); // clip the [] + if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){ + $v = $this->XMLSchemaVersion.':'.$v; + } + $this->complexTypes[$this->currentComplexType]['arrayType'] = $v; + } + break; + case 'complexContent': // (optional) content for a complexType + $this->xdebug("do nothing for element $name"); + break; + case 'complexType': + array_push($this->complexTypeStack, $this->currentComplexType); + if(isset($attrs['name'])){ + // TODO: what is the scope of named complexTypes that appear + // nested within other c complexTypes? + $this->xdebug('processing named complexType '.$attrs['name']); + //$this->currentElement = false; + $this->currentComplexType = $attrs['name']; + $this->complexTypes[$this->currentComplexType] = $attrs; + $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; + // This is for constructs like + // + // + // + // + // + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ + $this->xdebug('complexType is unusual array'); + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } else { + $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + } + } else { + $name = $this->CreateTypeName($this->currentElement); + $this->xdebug('processing unnamed complexType for element ' . $this->currentElement . ' named ' . $name); + $this->currentComplexType = $name; + //$this->currentElement = false; + $this->complexTypes[$this->currentComplexType] = $attrs; + $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; + // This is for constructs like + // + // + // + // + // + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){ + $this->xdebug('complexType is unusual array'); + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } else { + $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; + } + } + $this->complexTypes[$this->currentComplexType]['simpleContent'] = 'false'; + break; + case 'element': + array_push($this->elementStack, $this->currentElement); + if (!isset($attrs['form'])) { + if ($this->currentComplexType) { + $attrs['form'] = $this->schemaInfo['elementFormDefault']; + } else { + // global + $attrs['form'] = 'qualified'; + } + } + if(isset($attrs['type'])){ + $this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']); + if (! $this->getPrefix($attrs['type'])) { + if ($this->defaultNamespace[$pos]) { + $attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type']; + $this->xdebug('used default namespace to make type ' . $attrs['type']); + } + } + // This is for constructs like + // + // + // + // + // + if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') { + $this->xdebug('arrayType for unusual array is ' . $attrs['type']); + $this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type']; + } + $this->currentElement = $attrs['name']; + $ename = $attrs['name']; + } elseif(isset($attrs['ref'])){ + $this->xdebug("processing element as ref to ".$attrs['ref']); + $this->currentElement = "ref to ".$attrs['ref']; + $ename = $this->getLocalPart($attrs['ref']); + } else { + $type = $this->CreateTypeName($this->currentComplexType . '_' . $attrs['name']); + $this->xdebug("processing untyped element " . $attrs['name'] . ' type ' . $type); + $this->currentElement = $attrs['name']; + $attrs['type'] = $this->schemaTargetNamespace . ':' . $type; + $ename = $attrs['name']; + } + if (isset($ename) && $this->currentComplexType) { + $this->xdebug("add element $ename to complexType $this->currentComplexType"); + $this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs; + } elseif (!isset($attrs['ref'])) { + $this->xdebug("add element $ename to elements array"); + $this->elements[ $attrs['name'] ] = $attrs; + $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; + } + break; + case 'enumeration': // restriction value list member + $this->xdebug('enumeration ' . $attrs['value']); + if ($this->currentSimpleType) { + $this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value']; + } elseif ($this->currentComplexType) { + $this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value']; + } + break; + case 'extension': // simpleContent or complexContent type extension + $this->xdebug('extension ' . $attrs['base']); + if ($this->currentComplexType) { + $ns = $this->getPrefix($attrs['base']); + if ($ns == '') { + $this->complexTypes[$this->currentComplexType]['extensionBase'] = $this->schemaTargetNamespace . ':' . $attrs['base']; + } else { + $this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base']; + } + } else { + $this->xdebug('no current complexType to set extensionBase'); + } + break; + case 'import': + if (isset($attrs['schemaLocation'])) { + $this->xdebug('import namespace ' . $attrs['namespace'] . ' from ' . $attrs['schemaLocation']); + $this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); + } else { + $this->xdebug('import namespace ' . $attrs['namespace']); + $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true); + if (! $this->getPrefixFromNamespace($attrs['namespace'])) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; + } + } + break; + case 'include': + if (isset($attrs['schemaLocation'])) { + $this->xdebug('include into namespace ' . $this->schemaTargetNamespace . ' from ' . $attrs['schemaLocation']); + $this->imports[$this->schemaTargetNamespace][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); + } else { + $this->xdebug('ignoring invalid XML Schema construct: include without schemaLocation attribute'); + } + break; + case 'list': // simpleType value list + $this->xdebug("do nothing for element $name"); + break; + case 'restriction': // simpleType, simpleContent or complexContent value restriction + $this->xdebug('restriction ' . $attrs['base']); + if($this->currentSimpleType){ + $this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base']; + } elseif($this->currentComplexType){ + $this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base']; + if(strstr($attrs['base'],':') == ':Array'){ + $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; + } + } + break; + case 'schema': + $this->schemaInfo = $attrs; + $this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix); + if (isset($attrs['targetNamespace'])) { + $this->schemaTargetNamespace = $attrs['targetNamespace']; + } + if (!isset($attrs['elementFormDefault'])) { + $this->schemaInfo['elementFormDefault'] = 'unqualified'; + } + if (!isset($attrs['attributeFormDefault'])) { + $this->schemaInfo['attributeFormDefault'] = 'unqualified'; + } + break; + case 'simpleContent': // (optional) content for a complexType + if ($this->currentComplexType) { // This should *always* be + $this->complexTypes[$this->currentComplexType]['simpleContent'] = 'true'; + } else { + $this->xdebug("do nothing for element $name because there is no current complexType"); + } + break; + case 'simpleType': + array_push($this->simpleTypeStack, $this->currentSimpleType); + if(isset($attrs['name'])){ + $this->xdebug("processing simpleType for name " . $attrs['name']); + $this->currentSimpleType = $attrs['name']; + $this->simpleTypes[ $attrs['name'] ] = $attrs; + $this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType'; + $this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar'; + } else { + $name = $this->CreateTypeName($this->currentComplexType . '_' . $this->currentElement); + $this->xdebug('processing unnamed simpleType for element ' . $this->currentElement . ' named ' . $name); + $this->currentSimpleType = $name; + //$this->currentElement = false; + $this->simpleTypes[$this->currentSimpleType] = $attrs; + $this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar'; + } + break; + case 'union': // simpleType type list + $this->xdebug("do nothing for element $name"); + break; + default: + $this->xdebug("do not have any logic to process element $name"); + } + } + + /** + * end-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @access private + */ + function schemaEndElement($parser, $name) { + // bring depth down a notch + $this->depth--; + // position of current element is equal to the last value left in depth_array for my depth + if(isset($this->depth_array[$this->depth])){ + $pos = $this->depth_array[$this->depth]; + } + // get element prefix + if ($prefix = $this->getPrefix($name)){ + // get unqualified name + $name = $this->getLocalPart($name); + } else { + $prefix = ''; + } + // move on... + if($name == 'complexType'){ + $this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)')); + $this->xdebug($this->varDump($this->complexTypes[$this->currentComplexType])); + $this->currentComplexType = array_pop($this->complexTypeStack); + //$this->currentElement = false; + } + if($name == 'element'){ + $this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)')); + $this->currentElement = array_pop($this->elementStack); + } + if($name == 'simpleType'){ + $this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)')); + $this->xdebug($this->varDump($this->simpleTypes[$this->currentSimpleType])); + $this->currentSimpleType = array_pop($this->simpleTypeStack); + } + } + + /** + * element content handler + * + * @param string $parser XML parser object + * @param string $data element content + * @access private + */ + function schemaCharacterData($parser, $data){ + $pos = $this->depth_array[$this->depth - 1]; + $this->message[$pos]['cdata'] .= $data; + } + + /** + * serialize the schema + * + * @access public + */ + function serializeSchema(){ + + $schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion); + $xml = ''; + // imports + if (sizeof($this->imports) > 0) { + foreach($this->imports as $ns => $list) { + foreach ($list as $ii) { + if ($ii['location'] != '') { + $xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n"; + } else { + $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; + } + } + } + } + // complex types + foreach($this->complexTypes as $typeName => $attrs){ + $contentStr = ''; + // serialize child elements + if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){ + foreach($attrs['elements'] as $element => $eParts){ + if(isset($eParts['ref'])){ + $contentStr .= " <$schemaPrefix:element ref=\"$element\"/>\n"; + } else { + $contentStr .= " <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\""; + foreach ($eParts as $aName => $aValue) { + // handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable + if ($aName != 'name' && $aName != 'type') { + $contentStr .= " $aName=\"$aValue\""; + } + } + $contentStr .= "/>\n"; + } + } + // compositor wraps elements + if (isset($attrs['compositor']) && ($attrs['compositor'] != '')) { + $contentStr = " <$schemaPrefix:$attrs[compositor]>\n".$contentStr." \n"; + } + } + // attributes + if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){ + foreach($attrs['attrs'] as $attr => $aParts){ + $contentStr .= " <$schemaPrefix:attribute"; + foreach ($aParts as $a => $v) { + if ($a == 'ref' || $a == 'type') { + $contentStr .= " $a=\"".$this->contractQName($v).'"'; + } elseif ($a == 'http://schemas.xmlsoap.org/wsdl/:arrayType') { + $this->usedNamespaces['wsdl'] = $this->namespaces['wsdl']; + $contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"'; + } else { + $contentStr .= " $a=\"$v\""; + } + } + $contentStr .= "/>\n"; + } + } + // if restriction + if (isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){ + $contentStr = " <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr." \n"; + // complex or simple content + if ((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){ + $contentStr = " <$schemaPrefix:complexContent>\n".$contentStr." \n"; + } + } + // finalize complex type + if($contentStr != ''){ + $contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." \n"; + } else { + $contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n"; + } + $xml .= $contentStr; + } + // simple types + if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){ + foreach($this->simpleTypes as $typeName => $eParts){ + $xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\">\n"; + if (isset($eParts['enumeration'])) { + foreach ($eParts['enumeration'] as $e) { + $xml .= " <$schemaPrefix:enumeration value=\"$e\"/>\n"; + } + } + $xml .= " \n "; + } + } + // elements + if(isset($this->elements) && count($this->elements) > 0){ + foreach($this->elements as $element => $eParts){ + $xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n"; + } + } + // attributes + if(isset($this->attributes) && count($this->attributes) > 0){ + foreach($this->attributes as $attr => $aParts){ + $xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>"; + } + } + // finish 'er up + $attr = ''; + foreach ($this->schemaInfo as $k => $v) { + if ($k == 'elementFormDefault' || $k == 'attributeFormDefault') { + $attr .= " $k=\"$v\""; + } + } + $el = "<$schemaPrefix:schema$attr targetNamespace=\"$this->schemaTargetNamespace\"\n"; + foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) { + $el .= " xmlns:$nsp=\"$ns\""; + } + $xml = $el . ">\n".$xml."\n"; + return $xml; + } + + /** + * adds debug data to the clas level debug string + * + * @param string $string debug data + * @access private + */ + function xdebug($string){ + $this->debug('<' . $this->schemaTargetNamespace . '> '.$string); + } + + /** + * get the PHP type of a user defined type in the schema + * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays + * returns false if no type exists, or not w/ the given namespace + * else returns a string that is either a native php type, or 'struct' + * + * @param string $type name of defined type + * @param string $ns namespace of type + * @return mixed + * @access public + * @deprecated + */ + function getPHPType($type,$ns){ + if(isset($this->typemap[$ns][$type])){ + //print "found type '$type' and ns $ns in typemap
        "; + return $this->typemap[$ns][$type]; + } elseif(isset($this->complexTypes[$type])){ + //print "getting type '$type' and ns $ns from complexTypes array
        "; + return $this->complexTypes[$type]['phpType']; + } + return false; + } + + /** + * returns an associative array of information about a given type + * returns false if no type exists by the given name + * + * For a complexType typeDef = array( + * 'restrictionBase' => '', + * 'phpType' => '', + * 'compositor' => '(sequence|all)', + * 'elements' => array(), // refs to elements array + * 'attrs' => array() // refs to attributes array + * ... and so on (see addComplexType) + * ) + * + * For simpleType or element, the array has different keys. + * + * @param string $type + * @return mixed + * @access public + * @see addComplexType + * @see addSimpleType + * @see addElement + */ + function getTypeDef($type){ + //$this->debug("in getTypeDef for type $type"); + if (substr($type, -1) == '^') { + $is_element = 1; + $type = substr($type, 0, -1); + } else { + $is_element = 0; + } + + if((! $is_element) && isset($this->complexTypes[$type])){ + $this->xdebug("in getTypeDef, found complexType $type"); + return $this->complexTypes[$type]; + } elseif((! $is_element) && isset($this->simpleTypes[$type])){ + $this->xdebug("in getTypeDef, found simpleType $type"); + if (!isset($this->simpleTypes[$type]['phpType'])) { + // get info for type to tack onto the simple type + // TODO: can this ever really apply (i.e. what is a simpleType really?) + $uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':') + 1); + $ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':')); + $etype = $this->getTypeDef($uqType); + if ($etype) { + $this->xdebug("in getTypeDef, found type for simpleType $type:"); + $this->xdebug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $this->simpleTypes[$type]['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $this->simpleTypes[$type]['elements'] = $etype['elements']; + } + } + } + return $this->simpleTypes[$type]; + } elseif(isset($this->elements[$type])){ + $this->xdebug("in getTypeDef, found element $type"); + if (!isset($this->elements[$type]['phpType'])) { + // get info for type to tack onto the element + $uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1); + $ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':')); + $etype = $this->getTypeDef($uqType); + if ($etype) { + $this->xdebug("in getTypeDef, found type for element $type:"); + $this->xdebug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $this->elements[$type]['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $this->elements[$type]['elements'] = $etype['elements']; + } + if (isset($etype['extensionBase'])) { + $this->elements[$type]['extensionBase'] = $etype['extensionBase']; + } + } elseif ($ns == 'http://www.w3.org/2001/XMLSchema') { + $this->xdebug("in getTypeDef, element $type is an XSD type"); + $this->elements[$type]['phpType'] = 'scalar'; + } + } + return $this->elements[$type]; + } elseif(isset($this->attributes[$type])){ + $this->xdebug("in getTypeDef, found attribute $type"); + return $this->attributes[$type]; + } elseif (preg_match('/_ContainedType$/', $type)) { + $this->xdebug("in getTypeDef, have an untyped element $type"); + $typeDef['typeClass'] = 'simpleType'; + $typeDef['phpType'] = 'scalar'; + $typeDef['type'] = 'http://www.w3.org/2001/XMLSchema:string'; + return $typeDef; + } + $this->xdebug("in getTypeDef, did not find $type"); + return false; + } + + /** + * returns a sample serialization of a given type, or false if no type by the given name + * + * @param string $type name of type + * @return mixed + * @access public + * @deprecated + */ + function serializeTypeDef($type){ + //print "in sTD() for type $type
        "; + if($typeDef = $this->getTypeDef($type)){ + $str .= '<'.$type; + if(is_array($typeDef['attrs'])){ + foreach($typeDef['attrs'] as $attName => $data){ + $str .= " $attName=\"{type = ".$data['type']."}\""; + } + } + $str .= " xmlns=\"".$this->schema['targetNamespace']."\""; + if(count($typeDef['elements']) > 0){ + $str .= ">"; + foreach($typeDef['elements'] as $element => $eData){ + $str .= $this->serializeTypeDef($element); + } + $str .= ""; + } elseif($typeDef['typeClass'] == 'element') { + $str .= ">"; + } else { + $str .= "/>"; + } + return $str; + } + return false; + } + + /** + * returns HTML form elements that allow a user + * to enter values for creating an instance of the given type. + * + * @param string $name name for type instance + * @param string $type name of type + * @return string + * @access public + * @deprecated + */ + function typeToForm($name,$type){ + // get typedef + if($typeDef = $this->getTypeDef($type)){ + // if struct + if($typeDef['phpType'] == 'struct'){ + $buffer .= ''; + foreach($typeDef['elements'] as $child => $childDef){ + $buffer .= " + + "; + } + $buffer .= '
        $childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):
        '; + // if array + } elseif($typeDef['phpType'] == 'array'){ + $buffer .= ''; + for($i=0;$i < 3; $i++){ + $buffer .= " + + "; + } + $buffer .= '
        array item (type: $typeDef[arrayType]):
        '; + // if scalar + } else { + $buffer .= ""; + } + } else { + $buffer .= ""; + } + return $buffer; + } + + /** + * adds a complex type to the schema + * + * example: array + * + * addType( + * 'ArrayOfstring', + * 'complexType', + * 'array', + * '', + * 'SOAP-ENC:Array', + * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), + * 'xsd:string' + * ); + * + * example: PHP associative array ( SOAP Struct ) + * + * addType( + * 'SOAPStruct', + * 'complexType', + * 'struct', + * 'all', + * array('myVar'=> array('name'=>'myVar','type'=>'string') + * ); + * + * @param name + * @param typeClass (complexType|simpleType|attribute) + * @param phpType: currently supported are array and struct (php assoc array) + * @param compositor (all|sequence|choice) + * @param restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param elements = array ( name = array(name=>'',type=>'') ) + * @param attrs = array( + * array( + * 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", + * "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" + * ) + * ) + * @param arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string) + * @access public + * @see getTypeDef + */ + function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType=''){ + $this->complexTypes[$name] = array( + 'name' => $name, + 'typeClass' => $typeClass, + 'phpType' => $phpType, + 'compositor'=> $compositor, + 'restrictionBase' => $restrictionBase, + 'elements' => $elements, + 'attrs' => $attrs, + 'arrayType' => $arrayType + ); + + $this->xdebug("addComplexType $name:"); + $this->appendDebug($this->varDump($this->complexTypes[$name])); + } + + /** + * adds a simple type to the schema + * + * @param string $name + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param string $typeClass (should always be simpleType) + * @param string $phpType (should always be scalar) + * @param array $enumeration array of values + * @access public + * @see nusoap_xmlschema + * @see getTypeDef + */ + function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) { + $this->simpleTypes[$name] = array( + 'name' => $name, + 'typeClass' => $typeClass, + 'phpType' => $phpType, + 'type' => $restrictionBase, + 'enumeration' => $enumeration + ); + + $this->xdebug("addSimpleType $name:"); + $this->appendDebug($this->varDump($this->simpleTypes[$name])); + } + + /** + * adds an element to the schema + * + * @param array $attrs attributes that must include name and type + * @see nusoap_xmlschema + * @access public + */ + function addElement($attrs) { + if (! $this->getPrefix($attrs['type'])) { + $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type']; + } + $this->elements[ $attrs['name'] ] = $attrs; + $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; + + $this->xdebug("addElement " . $attrs['name']); + $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); + } +} + +/** + * Backward compatibility + */ +class XMLSchema extends nusoap_xmlschema { +} + +?> +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class soapval extends nusoap_base { + /** + * The XML element name + * + * @var string + * @access private + */ + var $name; + /** + * The XML type name (string or false) + * + * @var mixed + * @access private + */ + var $type; + /** + * The PHP value + * + * @var mixed + * @access private + */ + var $value; + /** + * The XML element namespace (string or false) + * + * @var mixed + * @access private + */ + var $element_ns; + /** + * The XML type namespace (string or false) + * + * @var mixed + * @access private + */ + var $type_ns; + /** + * The XML element attributes (array or false) + * + * @var mixed + * @access private + */ + var $attributes; + + /** + * constructor + * + * @param string $name optional name + * @param mixed $type optional type name + * @param mixed $value optional value + * @param mixed $element_ns optional namespace of value + * @param mixed $type_ns optional namespace of type + * @param mixed $attributes associative array of attributes to add to element serialization + * @access public + */ + function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { + parent::nusoap_base(); + $this->name = $name; + $this->type = $type; + $this->value = $value; + $this->element_ns = $element_ns; + $this->type_ns = $type_ns; + $this->attributes = $attributes; + } + + /** + * return serialized value + * + * @param string $use The WSDL use value (encoded|literal) + * @return string XML data + * @access public + */ + function serialize($use='encoded') { + return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true); + } + + /** + * decodes a soapval object into a PHP native type + * + * @return mixed + * @access public + */ + function decode(){ + return $this->value; + } +} + + + +?> +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class soap_transport_http extends nusoap_base { + + var $url = ''; + var $uri = ''; + var $digest_uri = ''; + var $scheme = ''; + var $host = ''; + var $port = ''; + var $path = ''; + var $request_method = 'POST'; + var $protocol_version = '1.0'; + var $encoding = ''; + var $outgoing_headers = array(); + var $incoming_headers = array(); + var $incoming_cookies = array(); + var $outgoing_payload = ''; + var $incoming_payload = ''; + var $response_status_line; // HTTP response status line + var $useSOAPAction = true; + var $persistentConnection = false; + var $ch = false; // cURL handle + var $ch_options = array(); // cURL custom options + var $use_curl = false; // force cURL use + var $proxy = null; // proxy information (associative array) + var $username = ''; + var $password = ''; + var $authtype = ''; + var $digestRequest = array(); + var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional) + // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' + // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' + // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' + // passphrase: SSL key password/passphrase + // certpassword: SSL certificate password + // verifypeer: default is 1 + // verifyhost: default is 1 + + /** + * constructor + * + * @param string $url The URL to which to connect + * @param array $curl_options User-specified cURL options + * @param boolean $use_curl Whether to try to force cURL use + * @access public + */ + function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ + parent::nusoap_base(); + $this->debug("ctor url=$url use_curl=$use_curl curl_options:"); + $this->appendDebug($this->varDump($curl_options)); + $this->setURL($url); + if (is_array($curl_options)) { + $this->ch_options = $curl_options; + } + $this->use_curl = $use_curl; + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); + $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); + } + + /** + * sets a cURL option + * + * @param mixed $option The cURL option (always integer?) + * @param mixed $value The cURL option value + * @access private + */ + function setCurlOption($option, $value) { + $this->debug("setCurlOption option=$option, value="); + $this->appendDebug($this->varDump($value)); + curl_setopt($this->ch, $option, $value); + } + + /** + * sets an HTTP header + * + * @param string $name The name of the header + * @param string $value The value of the header + * @access private + */ + function setHeader($name, $value) { + $this->outgoing_headers[$name] = $value; + $this->debug("set header $name: $value"); + } + + /** + * unsets an HTTP header + * + * @param string $name The name of the header + * @access private + */ + function unsetHeader($name) { + if (isset($this->outgoing_headers[$name])) { + $this->debug("unset header $name"); + unset($this->outgoing_headers[$name]); + } + } + + /** + * sets the URL to which to connect + * + * @param string $url The URL to which to connect + * @access private + */ + function setURL($url) { + $this->url = $url; + + $u = parse_url($url); + foreach($u as $k => $v){ + $this->debug("parsed URL $k = $v"); + $this->$k = $v; + } + + // add any GET params to path + if(isset($u['query']) && $u['query'] != ''){ + $this->path .= '?' . $u['query']; + } + + // set default port + if(!isset($u['port'])){ + if($u['scheme'] == 'https'){ + $this->port = 443; + } else { + $this->port = 80; + } + } + + $this->uri = $this->path; + $this->digest_uri = $this->uri; + + // build headers + if (!isset($u['port'])) { + $this->setHeader('Host', $this->host); + } else { + $this->setHeader('Host', $this->host.':'.$this->port); + } + + if (isset($u['user']) && $u['user'] != '') { + $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); + } + } + + /** + * gets the I/O method to use + * + * @return string I/O method to use (socket|curl|unknown) + * @access private + */ + function io_method() { + if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) + return 'curl'; + if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) + return 'socket'; + return 'unknown'; + } + + /** + * establish an HTTP connection + * + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @return boolean true if connected, false if not + * @access private + */ + function connect($connection_timeout=0,$response_timeout=30){ + // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like + // "regular" socket. + // TODO: disabled for now because OpenSSL must be *compiled* in (not just + // loaded), and until PHP5 stream_get_wrappers is not available. +// if ($this->scheme == 'https') { +// if (version_compare(phpversion(), '4.3.0') >= 0) { +// if (extension_loaded('openssl')) { +// $this->scheme = 'ssl'; +// $this->debug('Using SSL over OpenSSL'); +// } +// } +// } + $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); + if ($this->io_method() == 'socket') { + if (!is_array($this->proxy)) { + $host = $this->host; + $port = $this->port; + } else { + $host = $this->proxy['host']; + $port = $this->proxy['port']; + } + + // use persistent connection + if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ + if (!feof($this->fp)) { + $this->debug('Re-use persistent connection'); + return true; + } + fclose($this->fp); + $this->debug('Closed persistent connection at EOF'); + } + + // munge host if using OpenSSL + if ($this->scheme == 'ssl') { + $host = 'ssl://' . $host; + } + $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); + + // open socket + if($connection_timeout > 0){ + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); + } else { + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); + } + + // test pointer + if(!$this->fp) { + $msg = 'Couldn\'t open socket connection to server ' . $this->url; + if ($this->errno) { + $msg .= ', Error ('.$this->errno.'): '.$this->error_str; + } else { + $msg .= ' prior to connect(). This is often a problem looking up the host name.'; + } + $this->debug($msg); + $this->setError($msg); + return false; + } + + // set response timeout + $this->debug('set response timeout to ' . $response_timeout); + socket_set_timeout( $this->fp, $response_timeout); + + $this->debug('socket connected'); + return true; + } else if ($this->io_method() == 'curl') { + if (!extension_loaded('curl')) { +// $this->setError('cURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); + $this->setError('The PHP cURL Extension is required for HTTPS or NLTM. You will need to re-build or update your PHP to include cURL or change php.ini to load the PHP cURL extension.'); + return false; + } + // Avoid warnings when PHP does not have these options + if (defined('CURLOPT_CONNECTIONTIMEOUT')) + $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; + else + $CURLOPT_CONNECTIONTIMEOUT = 78; + if (defined('CURLOPT_HTTPAUTH')) + $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; + else + $CURLOPT_HTTPAUTH = 107; + if (defined('CURLOPT_PROXYAUTH')) + $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; + else + $CURLOPT_PROXYAUTH = 111; + if (defined('CURLAUTH_BASIC')) + $CURLAUTH_BASIC = CURLAUTH_BASIC; + else + $CURLAUTH_BASIC = 1; + if (defined('CURLAUTH_DIGEST')) + $CURLAUTH_DIGEST = CURLAUTH_DIGEST; + else + $CURLAUTH_DIGEST = 2; + if (defined('CURLAUTH_NTLM')) + $CURLAUTH_NTLM = CURLAUTH_NTLM; + else + $CURLAUTH_NTLM = 8; + + $this->debug('connect using cURL'); + // init CURL + $this->ch = curl_init(); + // set url + $hostURL = ($this->port != '') ? "$this->scheme://$this->host:$this->port" : "$this->scheme://$this->host"; + // add path + $hostURL .= $this->path; + $this->setCurlOption(CURLOPT_URL, $hostURL); + // follow location headers (re-directs) + if (ini_get('safe_mode') || ini_get('open_basedir')) { + $this->debug('safe_mode or open_basedir set, so do not set CURLOPT_FOLLOWLOCATION'); + $this->debug('safe_mode = '); + $this->appendDebug($this->varDump(ini_get('safe_mode'))); + $this->debug('open_basedir = '); + $this->appendDebug($this->varDump(ini_get('open_basedir'))); + } else { + $this->setCurlOption(CURLOPT_FOLLOWLOCATION, 1); + } + // ask for headers in the response output + $this->setCurlOption(CURLOPT_HEADER, 1); + // ask for the response output as the return value + $this->setCurlOption(CURLOPT_RETURNTRANSFER, 1); + // encode + // We manage this ourselves through headers and encoding +// if(function_exists('gzuncompress')){ +// $this->setCurlOption(CURLOPT_ENCODING, 'deflate'); +// } + // persistent connection + if ($this->persistentConnection) { + // I believe the following comment is now bogus, having applied to + // the code when it used CURLOPT_CUSTOMREQUEST to send the request. + // The way we send data, we cannot use persistent connections, since + // there will be some "junk" at the end of our request. + //$this->setCurlOption(CURL_HTTP_VERSION_1_1, true); + $this->persistentConnection = false; + $this->setHeader('Connection', 'close'); + } + // set timeouts + if ($connection_timeout != 0) { + $this->setCurlOption($CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); + } + if ($response_timeout != 0) { + $this->setCurlOption(CURLOPT_TIMEOUT, $response_timeout); + } + + if ($this->scheme == 'https') { + $this->debug('set cURL SSL verify options'); + // recent versions of cURL turn on peer/host checking by default, + // while PHP binaries are not compiled with a default location for the + // CA cert bundle, so disable peer/host checking. + //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0); + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0); + + // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) + if ($this->authtype == 'certificate') { + $this->debug('set cURL certificate options'); + if (isset($this->certRequest['cainfofile'])) { + $this->setCurlOption(CURLOPT_CAINFO, $this->certRequest['cainfofile']); + } + if (isset($this->certRequest['verifypeer'])) { + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); + } else { + $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 1); + } + if (isset($this->certRequest['verifyhost'])) { + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); + } else { + $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 1); + } + if (isset($this->certRequest['sslcertfile'])) { + $this->setCurlOption(CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); + } + if (isset($this->certRequest['sslkeyfile'])) { + $this->setCurlOption(CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); + } + if (isset($this->certRequest['passphrase'])) { + $this->setCurlOption(CURLOPT_SSLKEYPASSWD, $this->certRequest['passphrase']); + } + if (isset($this->certRequest['certpassword'])) { + $this->setCurlOption(CURLOPT_SSLCERTPASSWD, $this->certRequest['certpassword']); + } + } + } + if ($this->authtype && ($this->authtype != 'certificate')) { + if ($this->username) { + $this->debug('set cURL username/password'); + $this->setCurlOption(CURLOPT_USERPWD, "$this->username:$this->password"); + } + if ($this->authtype == 'basic') { + $this->debug('set cURL for Basic authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_BASIC); + } + if ($this->authtype == 'digest') { + $this->debug('set cURL for digest authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_DIGEST); + } + if ($this->authtype == 'ntlm') { + $this->debug('set cURL for NTLM authentication'); + $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_NTLM); + } + } + if (is_array($this->proxy)) { + $this->debug('set cURL proxy options'); + if ($this->proxy['port'] != '') { + $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host'].':'.$this->proxy['port']); + } else { + $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host']); + } + if ($this->proxy['username'] || $this->proxy['password']) { + $this->debug('set cURL proxy authentication options'); + $this->setCurlOption(CURLOPT_PROXYUSERPWD, $this->proxy['username'].':'.$this->proxy['password']); + if ($this->proxy['authtype'] == 'basic') { + $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_BASIC); + } + if ($this->proxy['authtype'] == 'ntlm') { + $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_NTLM); + } + } + } + $this->debug('cURL connection set up'); + return true; + } else { + $this->setError('Unknown scheme ' . $this->scheme); + $this->debug('Unknown scheme ' . $this->scheme); + return false; + } + } + + /** + * sends the SOAP request and gets the SOAP response via HTTP[S] + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { + + $this->debug('entered send() with data of length: '.strlen($data)); + + $this->tryagain = true; + $tries = 0; + while ($this->tryagain) { + $this->tryagain = false; + if ($tries++ < 2) { + // make connnection + if (!$this->connect($timeout, $response_timeout)){ + return false; + } + + // send request + if (!$this->sendRequest($data, $cookies)){ + return false; + } + + // get response + $respdata = $this->getResponse(); + } else { + $this->setError("Too many tries to get an OK response ($this->response_status_line)"); + } + } + $this->debug('end of send()'); + return $respdata; + } + + + /** + * sends the SOAP request and gets the SOAP response via HTTPS using CURL + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + * @deprecated + */ + function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { + return $this->send($data, $timeout, $response_timeout, $cookies); + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $digestRequest (keys must be nonce, nc, realm, qop) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype digestRequest="); + $this->appendDebug($this->varDump($digestRequest)); + $this->debug("certRequest="); + $this->appendDebug($this->varDump($certRequest)); + // cf. RFC 2617 + if ($authtype == 'basic') { + $this->setHeader('Authorization', 'Basic '.base64_encode(str_replace(':','',$username).':'.$password)); + } elseif ($authtype == 'digest') { + if (isset($digestRequest['nonce'])) { + $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; + + // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) + + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd + $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; + + // H(A1) = MD5(A1) + $HA1 = md5($A1); + + // A2 = Method ":" digest-uri-value + $A2 = $this->request_method . ':' . $this->digest_uri; + + // H(A2) + $HA2 = md5($A2); + + // KD(secret, data) = H(concat(secret, ":", data)) + // if qop == auth: + // request-digest = <"> < KD ( H(A1), unq(nonce-value) + // ":" nc-value + // ":" unq(cnonce-value) + // ":" unq(qop-value) + // ":" H(A2) + // ) <"> + // if qop is missing, + // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> + + $unhashedDigest = ''; + $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; + $cnonce = $nonce; + if ($digestRequest['qop'] != '') { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; + } else { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; + } + + $hashedDigest = md5($unhashedDigest); + + $opaque = ''; + if (isset($digestRequest['opaque'])) { + $opaque = ', opaque="' . $digestRequest['opaque'] . '"'; + } + + $this->setHeader('Authorization', 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . $opaque . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'); + } + } elseif ($authtype == 'certificate') { + $this->certRequest = $certRequest; + $this->debug('Authorization header not set for certificate'); + } elseif ($authtype == 'ntlm') { + // do nothing + $this->debug('Authorization header not set for ntlm'); + } + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->digestRequest = $digestRequest; + } + + /** + * set the soapaction value + * + * @param string $soapaction + * @access public + */ + function setSOAPAction($soapaction) { + $this->setHeader('SOAPAction', '"' . $soapaction . '"'); + } + + /** + * use http encoding + * + * @param string $enc encoding style. supported values: gzip, deflate, or both + * @access public + */ + function setEncoding($enc='gzip, deflate') { + if (function_exists('gzdeflate')) { + $this->protocol_version = '1.1'; + $this->setHeader('Accept-Encoding', $enc); + if (!isset($this->outgoing_headers['Connection'])) { + $this->setHeader('Connection', 'close'); + $this->persistentConnection = false; + } + // deprecated as of PHP 5.3.0 + //set_magic_quotes_runtime(0); + $this->encoding = $enc; + } + } + + /** + * set proxy info here + * + * @param string $proxyhost use an empty string to remove proxy + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @param string $proxyauthtype (basic|ntlm) + * @access public + */ + function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '', $proxyauthtype = 'basic') { + if ($proxyhost) { + $this->proxy = array( + 'host' => $proxyhost, + 'port' => $proxyport, + 'username' => $proxyusername, + 'password' => $proxypassword, + 'authtype' => $proxyauthtype + ); + if ($proxyusername != '' && $proxypassword != '' && $proxyauthtype = 'basic') { + $this->setHeader('Proxy-Authorization', ' Basic '.base64_encode($proxyusername.':'.$proxypassword)); + } + } else { + $this->debug('remove proxy'); + $proxy = null; + unsetHeader('Proxy-Authorization'); + } + } + + + /** + * Test if the given string starts with a header that is to be skipped. + * Skippable headers result from chunked transfer and proxy requests. + * + * @param string $data The string to check. + * @returns boolean Whether a skippable header was found. + * @access private + */ + function isSkippableCurlHeader(&$data) { + $skipHeaders = array( 'HTTP/1.1 100', + 'HTTP/1.0 301', + 'HTTP/1.1 301', + 'HTTP/1.0 302', + 'HTTP/1.1 302', + 'HTTP/1.0 401', + 'HTTP/1.1 401', + 'HTTP/1.0 200 Connection established'); + foreach ($skipHeaders as $hd) { + $prefix = substr($data, 0, strlen($hd)); + if ($prefix == $hd) return true; + } + + return false; + } + + /** + * decode a string that is encoded w/ "chunked' transfer encoding + * as defined in RFC2068 19.4.6 + * + * @param string $buffer + * @param string $lb + * @returns string + * @access public + * @deprecated + */ + function decodeChunked($buffer, $lb){ + // length := 0 + $length = 0; + $new = ''; + + // read chunk-size, chunk-extension (if any) and CRLF + // get the position of the linebreak + $chunkend = strpos($buffer, $lb); + if ($chunkend == FALSE) { + $this->debug('no linebreak found in decodeChunked'); + return $new; + } + $temp = substr($buffer,0,$chunkend); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend + strlen($lb); + // while (chunk-size > 0) { + while ($chunk_size > 0) { + $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); + $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); + + // Just in case we got a broken connection + if ($chunkend == FALSE) { + $chunk = substr($buffer,$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + $length += strlen($chunk); + break; + } + + // read chunk-data and CRLF + $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + // length := length + chunk-size + $length += strlen($chunk); + // read chunk-size and CRLF + $chunkstart = $chunkend + strlen($lb); + + $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); + if ($chunkend == FALSE) { + break; //Just in case we got a broken connection + } + $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + } + return $new; + } + + /** + * Writes the payload, including HTTP headers, to $this->outgoing_payload. + * + * @param string $data HTTP body + * @param string $cookie_str data for HTTP Cookie header + * @return void + * @access private + */ + function buildPayload($data, $cookie_str = '') { + // Note: for cURL connections, $this->outgoing_payload is ignored, + // as is the Content-Length header, but these are still created as + // debugging guides. + + // add content-length header + if ($this->request_method != 'GET') { + $this->setHeader('Content-Length', strlen($data)); + } + + // start building outgoing payload: + if ($this->proxy) { + $uri = $this->url; + } else { + $uri = $this->uri; + } + $req = "$this->request_method $uri HTTP/$this->protocol_version"; + $this->debug("HTTP request: $req"); + $this->outgoing_payload = "$req\r\n"; + + // loop thru headers, serializing + foreach($this->outgoing_headers as $k => $v){ + $hdr = $k.': '.$v; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // add any cookies + if ($cookie_str != '') { + $hdr = 'Cookie: '.$cookie_str; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // header/body separator + $this->outgoing_payload .= "\r\n"; + + // add data + $this->outgoing_payload .= $data; + } + + /** + * sends the SOAP request via HTTP[S] + * + * @param string $data message data + * @param array $cookies cookies to send + * @return boolean true if OK, false if problem + * @access private + */ + function sendRequest($data, $cookies = NULL) { + // build cookie string + $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); + + // build payload + $this->buildPayload($data, $cookie_str); + + if ($this->io_method() == 'socket') { + // send payload + if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { + $this->setError('couldn\'t write message data to socket'); + $this->debug('couldn\'t write message data to socket'); + return false; + } + $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); + return true; + } else if ($this->io_method() == 'curl') { + // set payload + // cURL does say this should only be the verb, and in fact it + // turns out that the URI and HTTP version are appended to this, which + // some servers refuse to work with (so we no longer use this method!) + //$this->setCurlOption(CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); + $curl_headers = array(); + foreach($this->outgoing_headers as $k => $v){ + if ($k == 'Connection' || $k == 'Content-Length' || $k == 'Host' || $k == 'Authorization' || $k == 'Proxy-Authorization') { + $this->debug("Skip cURL header $k: $v"); + } else { + $curl_headers[] = "$k: $v"; + } + } + if ($cookie_str != '') { + $curl_headers[] = 'Cookie: ' . $cookie_str; + } + $this->setCurlOption(CURLOPT_HTTPHEADER, $curl_headers); + $this->debug('set cURL HTTP headers'); + if ($this->request_method == "POST") { + $this->setCurlOption(CURLOPT_POST, 1); + $this->setCurlOption(CURLOPT_POSTFIELDS, $data); + $this->debug('set cURL POST data'); + } else { + } + // insert custom user-set cURL options + foreach ($this->ch_options as $key => $val) { + $this->setCurlOption($key, $val); + } + + $this->debug('set cURL payload'); + return true; + } + } + + /** + * gets the SOAP response via HTTP[S] + * + * @return string the response (also sets member variables like incoming_payload) + * @access private + */ + function getResponse(){ + $this->incoming_payload = ''; + + if ($this->io_method() == 'socket') { + // loop until headers have been retrieved + $data = ''; + while (!isset($lb)){ + + // We might EOF during header read. + if(feof($this->fp)) { + $this->incoming_payload = $data; + $this->debug('found no headers before EOF after length ' . strlen($data)); + $this->debug("received before EOF:\n" . $data); + $this->setError('server failed to send headers'); + return false; + } + + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read line of $tmplen bytes: " . trim($tmp)); + + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of headers timed out after length ' . strlen($data)); + $this->debug("read before timeout: " . $data); + $this->setError('socket read of headers timed out'); + return false; + } + + $data .= $tmp; + $pos = strpos($data,"\r\n\r\n"); + if($pos > 1){ + $lb = "\r\n"; + } else { + $pos = strpos($data,"\n\n"); + if($pos > 1){ + $lb = "\n"; + } + } + // remove 100 headers + if (isset($lb) && preg_match('/^HTTP\/1.1 100/',$data)) { + unset($lb); + $data = ''; + }// + } + // store header data + $this->incoming_payload .= $data; + $this->debug('found end of headers after length ' . strlen($data)); + // process headers + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $this->incoming_headers = array(); + $this->incoming_cookies = array(); + foreach($header_array as $header_line){ + $arr = explode(':',$header_line, 2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + + // loop until msg has been received + if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { + $content_length = 2147483647; // ignore any content-length header + $chunked = true; + $this->debug("want to read chunked content"); + } elseif (isset($this->incoming_headers['content-length'])) { + $content_length = $this->incoming_headers['content-length']; + $chunked = false; + $this->debug("want to read content of length $content_length"); + } else { + $content_length = 2147483647; + $chunked = false; + $this->debug("want to read content to EOF"); + } + $data = ''; + do { + if ($chunked) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk line of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk length timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk length timed out'); + return false; + } + $content_length = hexdec(trim($tmp)); + $this->debug("chunk length $content_length"); + } + $strlen = 0; + while (($strlen < $content_length) && (!feof($this->fp))) { + $readlen = min(8192, $content_length - $strlen); + $tmp = fread($this->fp, $readlen); + $tmplen = strlen($tmp); + $this->debug("read buffer of $tmplen bytes"); + if (($tmplen == 0) && (!feof($this->fp))) { + $this->incoming_payload = $data; + $this->debug('socket read of body timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of body timed out'); + return false; + } + $strlen += $tmplen; + $data .= $tmp; + } + if ($chunked && ($content_length > 0)) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk terminator of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk terminator timed out'); + return false; + } + } + } while ($chunked && ($content_length > 0) && (!feof($this->fp))); + if (feof($this->fp)) { + $this->debug('read to EOF'); + } + $this->debug('read body of length ' . strlen($data)); + $this->incoming_payload .= $data; + $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); + + // close filepointer + if( + (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || + (! $this->persistentConnection) || feof($this->fp)){ + fclose($this->fp); + $this->fp = false; + $this->debug('closed socket'); + } + + // connection was closed unexpectedly + if($this->incoming_payload == ''){ + $this->setError('no response from server'); + return false; + } + + // decode transfer-encoding +// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ +// if(!$data = $this->decodeChunked($data, $lb)){ +// $this->setError('Decoding of chunked data failed'); +// return false; +// } + //print "
        \nde-chunked:\n---------------\n$data\n\n---------------\n
        "; + // set decoded payload +// $this->incoming_payload = $header_data.$lb.$lb.$data; +// } + + } else if ($this->io_method() == 'curl') { + // send and receive + $this->debug('send and receive with cURL'); + $this->incoming_payload = curl_exec($this->ch); + $data = $this->incoming_payload; + + $cErr = curl_error($this->ch); + if ($cErr != '') { + $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
        '; + // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE + foreach(curl_getinfo($this->ch) as $k => $v){ + $err .= "$k: $v
        "; + } + $this->debug($err); + $this->setError($err); + curl_close($this->ch); + return false; + } else { + //echo '
        ';
        +			//var_dump(curl_getinfo($this->ch));
        +			//echo '
        '; + } + // close curl + $this->debug('No cURL error, closing cURL'); + curl_close($this->ch); + + // try removing skippable headers + $savedata = $data; + while ($this->isSkippableCurlHeader($data)) { + $this->debug("Found HTTP header to skip"); + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + + if ($data == '') { + // have nothing left; just remove 100 header(s) + $data = $savedata; + while (preg_match('/^HTTP\/1.1 100/',$data)) { + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + } + + // separate content from HTTP headers + if ($pos = strpos($data,"\r\n\r\n")) { + $lb = "\r\n"; + } elseif( $pos = strpos($data,"\n\n")) { + $lb = "\n"; + } else { + $this->debug('no proper separation of headers and document'); + $this->setError('no proper separation of headers and document'); + return false; + } + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $data = ltrim(substr($data,$pos)); + $this->debug('found proper separation of headers and document'); + $this->debug('cleaned data, stringlen: '.strlen($data)); + // clean headers + foreach ($header_array as $header_line) { + $arr = explode(':',$header_line,2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + } + + $this->response_status_line = $header_array[0]; + $arr = explode(' ', $this->response_status_line, 3); + $http_version = $arr[0]; + $http_status = (int)($arr[1]); + $http_reason = count($arr) > 2 ? $arr[2] : ''; + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['location']) && ($http_status == 301 || $http_status == 302)) { + $this->debug("Got $http_status $http_reason with Location: " . $this->incoming_headers['location']); + $this->setURL($this->incoming_headers['location']); + $this->tryagain = true; + return false; + } + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { + $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); + if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { + $this->debug('Server wants digest authentication'); + // remove "Digest " from our elements + $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); + + // parse elements into array + $digestElements = explode(',', $digestString); + foreach ($digestElements as $val) { + $tempElement = explode('=', trim($val), 2); + $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); + } + + // should have (at least) qop, realm, nonce + if (isset($digestRequest['nonce'])) { + $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); + $this->tryagain = true; + return false; + } + } + $this->debug('HTTP authentication failed'); + $this->setError('HTTP authentication failed'); + return false; + } + + if ( + ($http_status >= 300 && $http_status <= 307) || + ($http_status >= 400 && $http_status <= 417) || + ($http_status >= 501 && $http_status <= 505) + ) { + $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)"); + return false; + } + + // decode content-encoding + if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ + if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate')){ + //$timer->setMarker('starting decoding of gzip/deflated content'); + // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) + // this means there are no Zlib headers, although there should be + $this->debug('The gzinflate function exists'); + $datalen = strlen($data); + if ($this->incoming_headers['content-encoding'] == 'deflate') { + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The inflated payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to inflate the payload'); + $this->setError('Error using gzinflate to inflate the payload'); + } + } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { + if ($degzdata = @gzinflate(substr($data, 10))) { // do our best + $data = $degzdata; + $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate(substr($data, 10))) { + $data = $degzdata; + $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to un-gzip the payload'); + $this->setError('Error using gzinflate to un-gzip the payload'); + } + } + //$timer->setMarker('finished decoding of gzip/deflated content'); + //print "\nde-inflated:\n---------------\n$data\n-------------\n"; + // set decoded payload + $this->incoming_payload = $header_data.$lb.$lb.$data; + } else { + $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + } + } else { + $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + } + } else { + $this->debug('No Content-Encoding header'); + } + + if(strlen($data) == 0){ + $this->debug('no data after headers!'); + $this->setError('no data present after HTTP headers'); + return false; + } + + return $data; + } + + /** + * sets the content-type for the SOAP message to be sent + * + * @param string $type the content type, MIME style + * @param mixed $charset character set used for encoding (or false) + * @access public + */ + function setContentType($type, $charset = false) { + $this->setHeader('Content-Type', $type . ($charset ? '; charset=' . $charset : '')); + } + + /** + * specifies that an HTTP persistent connection should be used + * + * @return boolean whether the request was honored by this method. + * @access public + */ + function usePersistentConnection(){ + if (isset($this->outgoing_headers['Accept-Encoding'])) { + return false; + } + $this->protocol_version = '1.1'; + $this->persistentConnection = true; + $this->setHeader('Connection', 'Keep-Alive'); + return true; + } + + /** + * parse an incoming Cookie into it's parts + * + * @param string $cookie_str content of cookie + * @return array with data of that cookie + * @access private + */ + /* + * TODO: allow a Set-Cookie string to be parsed into multiple cookies + */ + function parseCookie($cookie_str) { + $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; + $data = preg_split('/;/', $cookie_str); + $value_str = $data[0]; + + $cookie_param = 'domain='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $domain = substr($cookie_str, $start + strlen($cookie_param)); + $domain = substr($domain, 0, strpos($domain, ';')); + } else { + $domain = ''; + } + + $cookie_param = 'expires='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $expires = substr($cookie_str, $start + strlen($cookie_param)); + $expires = substr($expires, 0, strpos($expires, ';')); + } else { + $expires = ''; + } + + $cookie_param = 'path='; + $start = strpos($cookie_str, $cookie_param); + if ( $start > 0 ) { + $path = substr($cookie_str, $start + strlen($cookie_param)); + $path = substr($path, 0, strpos($path, ';')); + } else { + $path = '/'; + } + + $cookie_param = ';secure;'; + if (strpos($cookie_str, $cookie_param) !== FALSE) { + $secure = true; + } else { + $secure = false; + } + + $sep_pos = strpos($value_str, '='); + + if ($sep_pos) { + $name = substr($value_str, 0, $sep_pos); + $value = substr($value_str, $sep_pos + 1); + $cookie= array( 'name' => $name, + 'value' => $value, + 'domain' => $domain, + 'path' => $path, + 'expires' => $expires, + 'secure' => $secure + ); + return $cookie; + } + return false; + } + + /** + * sort out cookies for the current request + * + * @param array $cookies array with all cookies + * @param boolean $secure is the send-content secure or not? + * @return string for Cookie-HTTP-Header + * @access private + */ + function getCookiesForRequest($cookies, $secure=false) { + $cookie_str = ''; + if ((! is_null($cookies)) && (is_array($cookies))) { + foreach ($cookies as $cookie) { + if (! is_array($cookie)) { + continue; + } + $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) <= time()) { + $this->debug('cookie has expired'); + continue; + } + } + if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + $domain = preg_quote($cookie['domain']); + if (! preg_match("'.*$domain$'i", $this->host)) { + $this->debug('cookie has different domain'); + continue; + } + } + if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + $path = preg_quote($cookie['path']); + if (! preg_match("'^$path.*'i", $this->path)) { + $this->debug('cookie is for a different path'); + continue; + } + } + if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { + $this->debug('cookie is secure, transport is not'); + continue; + } + $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; + $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); + } + } + return $cookie_str; + } +} + +?> +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_server extends nusoap_base { + /** + * HTTP headers of request + * @var array + * @access private + */ + var $headers = array(); + /** + * HTTP request + * @var string + * @access private + */ + var $request = ''; + /** + * SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text) + * @var string + * @access public + */ + var $requestHeaders = ''; + /** + * SOAP Headers from request (parsed) + * @var mixed + * @access public + */ + var $requestHeader = NULL; + /** + * SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text) + * @var string + * @access public + */ + var $document = ''; + /** + * SOAP payload for request (text) + * @var string + * @access public + */ + var $requestSOAP = ''; + /** + * requested method namespace URI + * @var string + * @access private + */ + var $methodURI = ''; + /** + * name of method requested + * @var string + * @access private + */ + var $methodname = ''; + /** + * method parameters from request + * @var array + * @access private + */ + var $methodparams = array(); + /** + * SOAP Action from request + * @var string + * @access private + */ + var $SOAPAction = ''; + /** + * character set encoding of incoming (request) messages + * @var string + * @access public + */ + var $xml_encoding = ''; + /** + * toggles whether the parser decodes element content w/ utf8_decode() + * @var boolean + * @access public + */ + var $decode_utf8 = true; + + /** + * HTTP headers of response + * @var array + * @access public + */ + var $outgoing_headers = array(); + /** + * HTTP response + * @var string + * @access private + */ + var $response = ''; + /** + * SOAP headers for response (text or array of soapval or associative array) + * @var mixed + * @access public + */ + var $responseHeaders = ''; + /** + * SOAP payload for response (text) + * @var string + * @access private + */ + var $responseSOAP = ''; + /** + * method return value to place in response + * @var mixed + * @access private + */ + var $methodreturn = false; + /** + * whether $methodreturn is a string of literal XML + * @var boolean + * @access public + */ + var $methodreturnisliteralxml = false; + /** + * SOAP fault for response (or false) + * @var mixed + * @access private + */ + var $fault = false; + /** + * text indication of result (for debugging) + * @var string + * @access private + */ + var $result = 'successful'; + + /** + * assoc array of operations => opData; operations are added by the register() + * method or by parsing an external WSDL definition + * @var array + * @access private + */ + var $operations = array(); + /** + * wsdl instance (if one) + * @var mixed + * @access private + */ + var $wsdl = false; + /** + * URL for WSDL (if one) + * @var mixed + * @access private + */ + var $externalWSDLURL = false; + /** + * whether to append debug to response as XML comment + * @var boolean + * @access public + */ + var $debug_flag = false; + + + /** + * constructor + * the optional parameter is a path to a WSDL file that you'd like to bind the server instance to. + * + * @param mixed $wsdl file path or URL (string), or wsdl instance (object) + * @access public + */ + function nusoap_server($wsdl=false){ + parent::nusoap_base(); + // turn on debugging? + global $debug; + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $this->debug("_SERVER is defined:"); + $this->appendDebug($this->varDump($_SERVER)); + } elseif (isset($HTTP_SERVER_VARS)) { + $this->debug("HTTP_SERVER_VARS is defined:"); + $this->appendDebug($this->varDump($HTTP_SERVER_VARS)); + } else { + $this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined."); + } + + if (isset($debug)) { + $this->debug("In nusoap_server, set debug_flag=$debug based on global flag"); + $this->debug_flag = $debug; + } elseif (isset($_SERVER['QUERY_STRING'])) { + $qs = explode('&', $_SERVER['QUERY_STRING']); + foreach ($qs as $v) { + if (substr($v, 0, 6) == 'debug=') { + $this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #1"); + $this->debug_flag = substr($v, 6); + } + } + } elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { + $qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']); + foreach ($qs as $v) { + if (substr($v, 0, 6) == 'debug=') { + $this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #2"); + $this->debug_flag = substr($v, 6); + } + } + } + + // wsdl + if($wsdl){ + $this->debug("In nusoap_server, WSDL is specified"); + if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) { + $this->wsdl = $wsdl; + $this->externalWSDLURL = $this->wsdl->wsdl; + $this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL); + } else { + $this->debug('Create wsdl from ' . $wsdl); + $this->wsdl = new wsdl($wsdl); + $this->externalWSDLURL = $wsdl; + } + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if($err = $this->wsdl->getError()){ + die('WSDL ERROR: '.$err); + } + } + } + + /** + * processes request and returns response + * + * @param string $data usually is the value of $HTTP_RAW_POST_DATA + * @access public + */ + function service($data){ + global $HTTP_SERVER_VARS; + + if (isset($_SERVER['REQUEST_METHOD'])) { + $rm = $_SERVER['REQUEST_METHOD']; + } elseif (isset($HTTP_SERVER_VARS['REQUEST_METHOD'])) { + $rm = $HTTP_SERVER_VARS['REQUEST_METHOD']; + } else { + $rm = ''; + } + + if (isset($_SERVER['QUERY_STRING'])) { + $qs = $_SERVER['QUERY_STRING']; + } elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { + $qs = $HTTP_SERVER_VARS['QUERY_STRING']; + } else { + $qs = ''; + } + $this->debug("In service, request method=$rm query string=$qs strlen(\$data)=" . strlen($data)); + + if ($rm == 'POST') { + $this->debug("In service, invoke the request"); + $this->parse_request($data); + if (! $this->fault) { + $this->invoke_method(); + } + if (! $this->fault) { + $this->serialize_return(); + } + $this->send_response(); + } elseif (preg_match('/wsdl/', $qs) ){ + $this->debug("In service, this is a request for WSDL"); + if ($this->externalWSDLURL){ + if (strpos($this->externalWSDLURL, "http://") !== false) { // assume URL + $this->debug("In service, re-direct for WSDL"); + header('Location: '.$this->externalWSDLURL); + } else { // assume file + $this->debug("In service, use file passthru for WSDL"); + header("Content-Type: text/xml\r\n"); + $pos = strpos($this->externalWSDLURL, "file://"); + if ($pos === false) { + $filename = $this->externalWSDLURL; + } else { + $filename = substr($this->externalWSDLURL, $pos + 7); + } + $fp = fopen($this->externalWSDLURL, 'r'); + fpassthru($fp); + } + } elseif ($this->wsdl) { + $this->debug("In service, serialize WSDL"); + header("Content-Type: text/xml; charset=ISO-8859-1\r\n"); + print $this->wsdl->serialize($this->debug_flag); + if ($this->debug_flag) { + $this->debug('wsdl:'); + $this->appendDebug($this->varDump($this->wsdl)); + print $this->getDebugAsXMLComment(); + } + } else { + $this->debug("In service, there is no WSDL"); + header("Content-Type: text/html; charset=ISO-8859-1\r\n"); + print "This service does not provide WSDL"; + } + } elseif ($this->wsdl) { + $this->debug("In service, return Web description"); + print $this->wsdl->webDescription(); + } else { + $this->debug("In service, no Web description"); + header("Content-Type: text/html; charset=ISO-8859-1\r\n"); + print "This service does not provide a Web description"; + } + } + + /** + * parses HTTP request headers. + * + * The following fields are set by this function (when successful) + * + * headers + * request + * xml_encoding + * SOAPAction + * + * @access private + */ + function parse_http_headers() { + global $HTTP_SERVER_VARS; + + $this->request = ''; + $this->SOAPAction = ''; + if(function_exists('getallheaders')){ + $this->debug("In parse_http_headers, use getallheaders"); + $headers = getallheaders(); + foreach($headers as $k=>$v){ + $k = strtolower($k); + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + // get SOAPAction header + if(isset($this->headers['soapaction'])){ + $this->SOAPAction = str_replace('"','',$this->headers['soapaction']); + } + // get the character encoding of the incoming request + if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ + $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } elseif(isset($_SERVER) && is_array($_SERVER)){ + $this->debug("In parse_http_headers, use _SERVER"); + foreach ($_SERVER as $k => $v) { + if (substr($k, 0, 5) == 'HTTP_') { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); + } else { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); + } + if ($k == 'soapaction') { + // get SOAPAction header + $k = 'SOAPAction'; + $v = str_replace('"', '', $v); + $v = str_replace('\\', '', $v); + $this->SOAPAction = $v; + } else if ($k == 'content-type') { + // get the character encoding of the incoming request + if (strpos($v, '=')) { + $enc = substr(strstr($v, '='), 1); + $enc = str_replace('"', '', $enc); + $enc = str_replace('\\', '', $enc); + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) { + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + } elseif (is_array($HTTP_SERVER_VARS)) { + $this->debug("In parse_http_headers, use HTTP_SERVER_VARS"); + foreach ($HTTP_SERVER_VARS as $k => $v) { + if (substr($k, 0, 5) == 'HTTP_') { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); $k = strtolower(substr($k, 5)); + } else { + $k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); $k = strtolower($k); + } + if ($k == 'soapaction') { + // get SOAPAction header + $k = 'SOAPAction'; + $v = str_replace('"', '', $v); + $v = str_replace('\\', '', $v); + $this->SOAPAction = $v; + } else if ($k == 'content-type') { + // get the character encoding of the incoming request + if (strpos($v, '=')) { + $enc = substr(strstr($v, '='), 1); + $enc = str_replace('"', '', $enc); + $enc = str_replace('\\', '', $enc); + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)) { + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + } + $this->headers[$k] = $v; + $this->request .= "$k: $v\r\n"; + $this->debug("$k: $v"); + } + } else { + $this->debug("In parse_http_headers, HTTP headers not accessible"); + $this->setError("HTTP headers not accessible"); + } + } + + /** + * parses a request + * + * The following fields are set by this function (when successful) + * + * headers + * request + * xml_encoding + * SOAPAction + * request + * requestSOAP + * methodURI + * methodname + * methodparams + * requestHeaders + * document + * + * This sets the fault field on error + * + * @param string $data XML string + * @access private + */ + function parse_request($data='') { + $this->debug('entering parse_request()'); + $this->parse_http_headers(); + $this->debug('got character encoding: '.$this->xml_encoding); + // uncompress if necessary + if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] != '') { + $this->debug('got content encoding: ' . $this->headers['content-encoding']); + if ($this->headers['content-encoding'] == 'deflate' || $this->headers['content-encoding'] == 'gzip') { + // if decoding works, use it. else assume data wasn't gzencoded + if (function_exists('gzuncompress')) { + if ($this->headers['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) { + $data = $degzdata; + } elseif ($this->headers['content-encoding'] == 'gzip' && $degzdata = gzinflate(substr($data, 10))) { + $data = $degzdata; + } else { + $this->fault('SOAP-ENV:Client', 'Errors occurred when trying to decode the data'); + return; + } + } else { + $this->fault('SOAP-ENV:Client', 'This Server does not support compressed data'); + return; + } + } + } + $this->request .= "\r\n".$data; + $data = $this->parseRequest($this->headers, $data); + $this->requestSOAP = $data; + $this->debug('leaving parse_request'); + } + + /** + * invokes a PHP function for the requested SOAP method + * + * The following fields are set by this function (when successful) + * + * methodreturn + * + * Note that the PHP function that is called may also set the following + * fields to affect the response sent to the client + * + * responseHeaders + * outgoing_headers + * + * This sets the fault field on error + * + * @access private + */ + function invoke_method() { + $this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction); + + // + // if you are debugging in this area of the code, your service uses a class to implement methods, + // you use SOAP RPC, and the client is .NET, please be aware of the following... + // when the .NET wsdl.exe utility generates a proxy, it will remove the '.' or '..' from the + // method name. that is fine for naming the .NET methods. it is not fine for properly constructing + // the XML request and reading the XML response. you need to add the RequestElementName and + // ResponseElementName to the System.Web.Services.Protocols.SoapRpcMethodAttribute that wsdl.exe + // generates for the method. these parameters are used to specify the correct XML element names + // for .NET to use, i.e. the names with the '.' in them. + // + $orig_methodname = $this->methodname; + if ($this->wsdl) { + if ($this->opData = $this->wsdl->getOperationData($this->methodname)) { + $this->debug('in invoke_method, found WSDL operation=' . $this->methodname); + $this->appendDebug('opData=' . $this->varDump($this->opData)); + } elseif ($this->opData = $this->wsdl->getOperationDataForSoapAction($this->SOAPAction)) { + // Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element + $this->debug('in invoke_method, found WSDL soapAction=' . $this->SOAPAction . ' for operation=' . $this->opData['name']); + $this->appendDebug('opData=' . $this->varDump($this->opData)); + $this->methodname = $this->opData['name']; + } else { + $this->debug('in invoke_method, no WSDL for operation=' . $this->methodname); + $this->fault('SOAP-ENV:Client', "Operation '" . $this->methodname . "' is not defined in the WSDL for this service"); + return; + } + } else { + $this->debug('in invoke_method, no WSDL to validate method'); + } + + // if a . is present in $this->methodname, we see if there is a class in scope, + // which could be referred to. We will also distinguish between two deliminators, + // to allow methods to be called a the class or an instance + if (strpos($this->methodname, '..') > 0) { + $delim = '..'; + } else if (strpos($this->methodname, '.') > 0) { + $delim = '.'; + } else { + $delim = ''; + } + $this->debug("in invoke_method, delim=$delim"); + + $class = ''; + $method = ''; + if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1) { + $try_class = substr($this->methodname, 0, strpos($this->methodname, $delim)); + if (class_exists($try_class)) { + // get the class and method name + $class = $try_class; + $method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim)); + $this->debug("in invoke_method, class=$class method=$method delim=$delim"); + } else { + $this->debug("in invoke_method, class=$try_class not found"); + } + } else { + $try_class = ''; + $this->debug("in invoke_method, no class to try"); + } + + // does method exist? + if ($class == '') { + if (!function_exists($this->methodname)) { + $this->debug("in invoke_method, function '$this->methodname' not found!"); + $this->result = 'fault: method not found'; + $this->fault('SOAP-ENV:Client',"method '$this->methodname'('$orig_methodname') not defined in service('$try_class' '$delim')"); + return; + } + } else { + $method_to_compare = (substr(phpversion(), 0, 2) == '4.') ? strtolower($method) : $method; + if (!in_array($method_to_compare, get_class_methods($class))) { + $this->debug("in invoke_method, method '$this->methodname' not found in class '$class'!"); + $this->result = 'fault: method not found'; + $this->fault('SOAP-ENV:Client',"method '$this->methodname'/'$method_to_compare'('$orig_methodname') not defined in service/'$class'('$try_class' '$delim')"); + return; + } + } + + // evaluate message, getting back parameters + // verify that request parameters match the method's signature + if(! $this->verify_method($this->methodname,$this->methodparams)){ + // debug + $this->debug('ERROR: request not verified against method signature'); + $this->result = 'fault: request failed validation against method signature'; + // return fault + $this->fault('SOAP-ENV:Client',"Operation '$this->methodname' not defined in service."); + return; + } + + // if there are parameters to pass + $this->debug('in invoke_method, params:'); + $this->appendDebug($this->varDump($this->methodparams)); + $this->debug("in invoke_method, calling '$this->methodname'"); + if (!function_exists('call_user_func_array')) { + if ($class == '') { + $this->debug('in invoke_method, calling function using eval()'); + $funcCall = "\$this->methodreturn = $this->methodname("; + } else { + if ($delim == '..') { + $this->debug('in invoke_method, calling class method using eval()'); + $funcCall = "\$this->methodreturn = ".$class."::".$method."("; + } else { + $this->debug('in invoke_method, calling instance method using eval()'); + // generate unique instance name + $instname = "\$inst_".time(); + $funcCall = $instname." = new ".$class."(); "; + $funcCall .= "\$this->methodreturn = ".$instname."->".$method."("; + } + } + if ($this->methodparams) { + foreach ($this->methodparams as $param) { + if (is_array($param) || is_object($param)) { + $this->fault('SOAP-ENV:Client', 'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available'); + return; + } + $funcCall .= "\"$param\","; + } + $funcCall = substr($funcCall, 0, -1); + } + $funcCall .= ');'; + $this->debug('in invoke_method, function call: '.$funcCall); + @eval($funcCall); + } else { + if ($class == '') { + $this->debug('in invoke_method, calling function using call_user_func_array()'); + $call_arg = "$this->methodname"; // straight assignment changes $this->methodname to lower case after call_user_func_array() + } elseif ($delim == '..') { + $this->debug('in invoke_method, calling class method using call_user_func_array()'); + $call_arg = array ($class, $method); + } else { + $this->debug('in invoke_method, calling instance method using call_user_func_array()'); + $instance = new $class (); + $call_arg = array(&$instance, $method); + } + if (is_array($this->methodparams)) { + $this->methodreturn = call_user_func_array($call_arg, array_values($this->methodparams)); + } else { + $this->methodreturn = call_user_func_array($call_arg, array()); + } + } + $this->debug('in invoke_method, methodreturn:'); + $this->appendDebug($this->varDump($this->methodreturn)); + $this->debug("in invoke_method, called method $this->methodname, received data of type ".gettype($this->methodreturn)); + } + + /** + * serializes the return value from a PHP function into a full SOAP Envelope + * + * The following fields are set by this function (when successful) + * + * responseSOAP + * + * This sets the fault field on error + * + * @access private + */ + function serialize_return() { + $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI); + // if fault + if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) { + $this->debug('got a fault object from method'); + $this->fault = $this->methodreturn; + return; + } elseif ($this->methodreturnisliteralxml) { + $return_val = $this->methodreturn; + // returned value(s) + } else { + $this->debug('got a(n) '.gettype($this->methodreturn).' from method'); + $this->debug('serializing return value'); + if($this->wsdl){ + if (sizeof($this->opData['output']['parts']) > 1) { + $this->debug('more than one output part, so use the method return unchanged'); + $opParams = $this->methodreturn; + } elseif (sizeof($this->opData['output']['parts']) == 1) { + $this->debug('exactly one output part, so wrap the method return in a simple array'); + // TODO: verify that it is not already wrapped! + //foreach ($this->opData['output']['parts'] as $name => $type) { + // $this->debug('wrap in element named ' . $name); + //} + $opParams = array($this->methodreturn); + } + $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams); + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if($errstr = $this->wsdl->getError()){ + $this->debug('got wsdl error: '.$errstr); + $this->fault('SOAP-ENV:Server', 'unable to serialize result'); + return; + } + } else { + if (isset($this->methodreturn)) { + $return_val = $this->serialize_val($this->methodreturn, 'return'); + } else { + $return_val = ''; + $this->debug('in absence of WSDL, assume void return for backward compatibility'); + } + } + } + $this->debug('return value:'); + $this->appendDebug($this->varDump($return_val)); + + $this->debug('serializing response'); + if ($this->wsdl) { + $this->debug('have WSDL for serialization: style is ' . $this->opData['style']); + if ($this->opData['style'] == 'rpc') { + $this->debug('style is rpc for serialization: use is ' . $this->opData['output']['use']); + if ($this->opData['output']['use'] == 'literal') { + // http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace + if ($this->methodURI) { + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } else { + $payload = '<'.$this->methodname.'Response>'.$return_val.'methodname.'Response>'; + } + } else { + if ($this->methodURI) { + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } else { + $payload = '<'.$this->methodname.'Response>'.$return_val.'methodname.'Response>'; + } + } + } else { + $this->debug('style is not rpc for serialization: assume document'); + $payload = $return_val; + } + } else { + $this->debug('do not have WSDL for serialization: assume rpc/encoded'); + $payload = 'methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'methodname."Response>"; + } + $this->result = 'successful'; + if($this->wsdl){ + //if($this->debug_flag){ + $this->appendDebug($this->wsdl->getDebug()); + // } + if (isset($this->opData['output']['encodingStyle'])) { + $encodingStyle = $this->opData['output']['encodingStyle']; + } else { + $encodingStyle = ''; + } + // Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces. + $this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style'],$this->opData['output']['use'],$encodingStyle); + } else { + $this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders); + } + $this->debug("Leaving serialize_return"); + } + + /** + * sends an HTTP response + * + * The following fields are set by this function (when successful) + * + * outgoing_headers + * response + * + * @access private + */ + function send_response() { + $this->debug('Enter send_response'); + if ($this->fault) { + $payload = $this->fault->serialize(); + $this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error"; + $this->outgoing_headers[] = "Status: 500 Internal Server Error"; + } else { + $payload = $this->responseSOAP; + // Some combinations of PHP+Web server allow the Status + // to come through as a header. Since OK is the default + // just do nothing. + // $this->outgoing_headers[] = "HTTP/1.0 200 OK"; + // $this->outgoing_headers[] = "Status: 200 OK"; + } + // add debug data if in debug mode + if(isset($this->debug_flag) && $this->debug_flag){ + $payload .= $this->getDebugAsXMLComment(); + } + $this->outgoing_headers[] = "Server: $this->title Server v$this->version"; + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); + $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")"; + // Let the Web server decide about this + //$this->outgoing_headers[] = "Connection: Close\r\n"; + $payload = $this->getHTTPBody($payload); + $type = $this->getHTTPContentType(); + $charset = $this->getHTTPContentTypeCharset(); + $this->outgoing_headers[] = "Content-Type: $type" . ($charset ? '; charset=' . $charset : ''); + //begin code to compress payload - by John + // NOTE: there is no way to know whether the Web server will also compress + // this data. + if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { + if (strstr($this->headers['accept-encoding'], 'gzip')) { + if (function_exists('gzencode')) { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + $this->outgoing_headers[] = "Content-Encoding: gzip"; + $payload = gzencode($payload); + } else { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + } + } elseif (strstr($this->headers['accept-encoding'], 'deflate')) { + // Note: MSIE requires gzdeflate output (no Zlib header and checksum), + // instead of gzcompress output, + // which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5) + if (function_exists('gzdeflate')) { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + $this->outgoing_headers[] = "Content-Encoding: deflate"; + $payload = gzdeflate($payload); + } else { + if (isset($this->debug_flag) && $this->debug_flag) { + $payload .= ""; + } + } + } + } + //end code + $this->outgoing_headers[] = "Content-Length: ".strlen($payload); + reset($this->outgoing_headers); + foreach($this->outgoing_headers as $hdr){ + header($hdr, false); + } + print $payload; + $this->response = join("\r\n",$this->outgoing_headers)."\r\n\r\n".$payload; + } + + /** + * takes the value that was created by parsing the request + * and compares to the method's signature, if available. + * + * @param string $operation The operation to be invoked + * @param array $request The array of parameter values + * @return boolean Whether the operation was found + * @access private + */ + function verify_method($operation,$request){ + if(isset($this->wsdl) && is_object($this->wsdl)){ + if($this->wsdl->getOperationData($operation)){ + return true; + } + } elseif(isset($this->operations[$operation])){ + return true; + } + return false; + } + + /** + * processes SOAP message received from client + * + * @param array $headers The HTTP headers + * @param string $data unprocessed request data from client + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseRequest($headers, $data) { + $this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:'); + $this->appendDebug($this->varDump($headers)); + if (!isset($headers['content-type'])) { + $this->setError('Request not of type text/xml (no content-type header)'); + return false; + } + if (!strstr($headers['content-type'], 'text/xml')) { + $this->setError('Request not of type text/xml'); + return false; + } + if (strpos($headers['content-type'], '=')) { + $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); + $this->debug('Got response encoding: ' . $enc); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser'); + // parse response, get soap parser obj + $parser = new nusoap_parser($data,$this->xml_encoding,'',$this->decode_utf8); + // parser debug + $this->debug("parser debug: \n".$parser->getDebug()); + // if fault occurred during message parsing + if($err = $parser->getError()){ + $this->result = 'fault: error in msg parsing: '.$err; + $this->fault('SOAP-ENV:Client',"error in msg parsing:\n".$err); + // else successfully parsed request into soapval object + } else { + // get/set methodname + $this->methodURI = $parser->root_struct_namespace; + $this->methodname = $parser->root_struct_name; + $this->debug('methodname: '.$this->methodname.' methodURI: '.$this->methodURI); + $this->debug('calling parser->get_soapbody()'); + $this->methodparams = $parser->get_soapbody(); + // get SOAP headers + $this->requestHeaders = $parser->getHeaders(); + // get SOAP Header + $this->requestHeader = $parser->get_soapheader(); + // add document for doclit support + $this->document = $parser->document; + } + } + + /** + * gets the HTTP body for the current response. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + return $soapmsg; + } + + /** + * gets the HTTP content type for the current response. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current response. + * @access private + */ + function getHTTPContentType() { + return 'text/xml'; + } + + /** + * gets the HTTP content type charset for the current response. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current response. + * @access private + */ + function getHTTPContentTypeCharset() { + return $this->soap_defencoding; + } + + /** + * add a method to the dispatch map (this has been replaced by the register method) + * + * @param string $methodname + * @param string $in array of input values + * @param string $out array of output values + * @access public + * @deprecated + */ + function add_to_map($methodname,$in,$out){ + $this->operations[$methodname] = array('name' => $methodname,'in' => $in,'out' => $out); + } + + /** + * register a service function with the server + * + * @param string $name the name of the PHP function, class.method or class..method + * @param array $in assoc array of input values: key = param name, value = param type + * @param array $out assoc array of output values: key = param name, value = param type + * @param mixed $namespace the element namespace for the method or false + * @param mixed $soapaction the soapaction for the method or false + * @param mixed $style optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically + * @param mixed $use optional (encoded|literal) or false + * @param string $documentation optional Description to include in WSDL + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @access public + */ + function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){ + global $HTTP_SERVER_VARS; + + if($this->externalWSDLURL){ + die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.'); + } + if (! $name) { + die('You must specify a name when you register an operation'); + } + if (!is_array($in)) { + die('You must provide an array for operation inputs'); + } + if (!is_array($out)) { + die('You must provide an array for operation outputs'); + } + if(false == $namespace) { + } + if(false == $soapaction) { + if (isset($_SERVER)) { + $SERVER_NAME = $_SERVER['SERVER_NAME']; + $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; + $HTTPS = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : (isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'); + } elseif (isset($HTTP_SERVER_VARS)) { + $SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME']; + $SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']; + $HTTPS = isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + if ($HTTPS == '1' || $HTTPS == 'on') { + $SCHEME = 'https'; + } else { + $SCHEME = 'http'; + } + $soapaction = "$SCHEME://$SERVER_NAME$SCRIPT_NAME/$name"; + } + if(false == $style) { + $style = "rpc"; + } + if(false == $use) { + $use = "encoded"; + } + if ($use == 'encoded' && $encodingStyle == '') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } + + $this->operations[$name] = array( + 'name' => $name, + 'in' => $in, + 'out' => $out, + 'namespace' => $namespace, + 'soapaction' => $soapaction, + 'style' => $style); + if($this->wsdl){ + $this->wsdl->addOperation($name,$in,$out,$namespace,$soapaction,$style,$use,$documentation,$encodingStyle); + } + return true; + } + + /** + * Specify a fault to be returned to the client. + * This also acts as a flag to the server that a fault has occurred. + * + * @param string $faultcode + * @param string $faultstring + * @param string $faultactor + * @param string $faultdetail + * @access public + */ + function fault($faultcode,$faultstring,$faultactor='',$faultdetail=''){ + if ($faultdetail == '' && $this->debug_flag) { + $faultdetail = $this->getDebug(); + } + $this->fault = new nusoap_fault($faultcode,$faultactor,$faultstring,$faultdetail); + $this->fault->soap_defencoding = $this->soap_defencoding; + } + + /** + * Sets up wsdl object. + * Acts as a flag to enable internal WSDL generation + * + * @param string $serviceName, name of the service + * @param mixed $namespace optional 'tns' service namespace or false + * @param mixed $endpoint optional URL of service endpoint or false + * @param string $style optional (rpc|document) WSDL style (also specified by operation) + * @param string $transport optional SOAP transport + * @param mixed $schemaTargetNamespace optional 'types' targetNamespace for service schema or false + */ + function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false) + { + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $SERVER_NAME = $_SERVER['SERVER_NAME']; + $SERVER_PORT = $_SERVER['SERVER_PORT']; + $SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; + $HTTPS = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : (isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'); + } elseif (isset($HTTP_SERVER_VARS)) { + $SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME']; + $SERVER_PORT = $HTTP_SERVER_VARS['SERVER_PORT']; + $SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']; + $HTTPS = isset($HTTP_SERVER_VARS['HTTPS']) ? $HTTP_SERVER_VARS['HTTPS'] : 'off'; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + // If server name has port number attached then strip it (else port number gets duplicated in WSDL output) (occurred using lighttpd and FastCGI) + $colon = strpos($SERVER_NAME,":"); + if ($colon) { + $SERVER_NAME = substr($SERVER_NAME, 0, $colon); + } + if ($SERVER_PORT == 80) { + $SERVER_PORT = ''; + } else { + $SERVER_PORT = ':' . $SERVER_PORT; + } + if(false == $namespace) { + $namespace = "http://$SERVER_NAME/soap/$serviceName"; + } + + if(false == $endpoint) { + if ($HTTPS == '1' || $HTTPS == 'on') { + $SCHEME = 'https'; + } else { + $SCHEME = 'http'; + } + $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME"; + } + + if(false == $schemaTargetNamespace) { + $schemaTargetNamespace = $namespace; + } + + $this->wsdl = new wsdl; + $this->wsdl->serviceName = $serviceName; + $this->wsdl->endpoint = $endpoint; + $this->wsdl->namespaces['tns'] = $namespace; + $this->wsdl->namespaces['soap'] = 'http://schemas.xmlsoap.org/wsdl/soap/'; + $this->wsdl->namespaces['wsdl'] = 'http://schemas.xmlsoap.org/wsdl/'; + if ($schemaTargetNamespace != $namespace) { + $this->wsdl->namespaces['types'] = $schemaTargetNamespace; + } + $this->wsdl->schemas[$schemaTargetNamespace][0] = new nusoap_xmlschema('', '', $this->wsdl->namespaces); + if ($style == 'document') { + $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaInfo['elementFormDefault'] = 'qualified'; + } + $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaTargetNamespace = $schemaTargetNamespace; + $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true); + $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/wsdl/'][0] = array('location' => '', 'loaded' => true); + $this->wsdl->bindings[$serviceName.'Binding'] = array( + 'name'=>$serviceName.'Binding', + 'style'=>$style, + 'transport'=>$transport, + 'portType'=>$serviceName.'PortType'); + $this->wsdl->ports[$serviceName.'Port'] = array( + 'binding'=>$serviceName.'Binding', + 'location'=>$endpoint, + 'bindingType'=>'http://schemas.xmlsoap.org/wsdl/soap/'); + } +} + +/** + * Backward compatibility + */ +class soap_server extends nusoap_server { +} + +?> +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class wsdl extends nusoap_base { + // URL or filename of the root of this WSDL + var $wsdl; + // define internal arrays of bindings, ports, operations, messages, etc. + var $schemas = array(); + var $currentSchema; + var $message = array(); + var $complexTypes = array(); + var $messages = array(); + var $currentMessage; + var $currentOperation; + var $portTypes = array(); + var $currentPortType; + var $bindings = array(); + var $currentBinding; + var $ports = array(); + var $currentPort; + var $opData = array(); + var $status = ''; + var $documentation = false; + var $endpoint = ''; + // array of wsdl docs to import + var $import = array(); + // parser vars + var $parser; + var $position = 0; + var $depth = 0; + var $depth_array = array(); + // for getting wsdl + var $proxyhost = ''; + var $proxyport = ''; + var $proxyusername = ''; + var $proxypassword = ''; + var $timeout = 0; + var $response_timeout = 30; + var $curl_options = array(); // User-specified cURL options + var $use_curl = false; // whether to always try to use cURL + // for HTTP authentication + var $username = ''; // Username for HTTP authentication + var $password = ''; // Password for HTTP authentication + var $authtype = ''; // Type of HTTP authentication + var $certRequest = array(); // Certificate for HTTP SSL authentication + + /** + * constructor + * + * @param string $wsdl WSDL document URL + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @param integer $timeout set the connection timeout + * @param integer $response_timeout set the response timeout + * @param array $curl_options user-specified cURL options + * @param boolean $use_curl try to use cURL + * @access public + */ + function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ + parent::nusoap_base(); + $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + $this->timeout = $timeout; + $this->response_timeout = $response_timeout; + if (is_array($curl_options)) + $this->curl_options = $curl_options; + $this->use_curl = $use_curl; + $this->fetchWSDL($wsdl); + } + + /** + * fetches the WSDL document and parses it + * + * @access public + */ + function fetchWSDL($wsdl) { + $this->debug("parse and process WSDL path=$wsdl"); + $this->wsdl = $wsdl; + // parse wsdl file + if ($this->wsdl != "") { + $this->parseWSDL($this->wsdl); + } + // imports + // TODO: handle imports more properly, grabbing them in-line and nesting them + $imported_urls = array(); + $imported = 1; + while ($imported > 0) { + $imported = 0; + // Schema imports + foreach ($this->schemas as $ns => $list) { + foreach ($list as $xs) { + $wsdlparts = parse_url($this->wsdl); // this is bogusly simple! + foreach ($xs->imports as $ns2 => $list2) { + for ($ii = 0; $ii < count($list2); $ii++) { + if (! $list2[$ii]['loaded']) { + $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true; + $url = $list2[$ii]['location']; + if ($url != '') { + $urlparts = parse_url($url); + if (!isset($urlparts['host'])) { + $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') . + substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path']; + } + if (! in_array($url, $imported_urls)) { + $this->parseWSDL($url); + $imported++; + $imported_urls[] = $url; + } + } else { + $this->debug("Unexpected scenario: empty URL for unloaded import"); + } + } + } + } + } + } + // WSDL imports + $wsdlparts = parse_url($this->wsdl); // this is bogusly simple! + foreach ($this->import as $ns => $list) { + for ($ii = 0; $ii < count($list); $ii++) { + if (! $list[$ii]['loaded']) { + $this->import[$ns][$ii]['loaded'] = true; + $url = $list[$ii]['location']; + if ($url != '') { + $urlparts = parse_url($url); + if (!isset($urlparts['host'])) { + $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') . + substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path']; + } + if (! in_array($url, $imported_urls)) { + $this->parseWSDL($url); + $imported++; + $imported_urls[] = $url; + } + } else { + $this->debug("Unexpected scenario: empty URL for unloaded import"); + } + } + } + } + } + // add new data to operation data + foreach($this->bindings as $binding => $bindingData) { + if (isset($bindingData['operations']) && is_array($bindingData['operations'])) { + foreach($bindingData['operations'] as $operation => $data) { + $this->debug('post-parse data gathering for ' . $operation); + $this->bindings[$binding]['operations'][$operation]['input'] = + isset($this->bindings[$binding]['operations'][$operation]['input']) ? + array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) : + $this->portTypes[ $bindingData['portType'] ][$operation]['input']; + $this->bindings[$binding]['operations'][$operation]['output'] = + isset($this->bindings[$binding]['operations'][$operation]['output']) ? + array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) : + $this->portTypes[ $bindingData['portType'] ][$operation]['output']; + if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){ + $this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ]; + } + if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){ + $this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ]; + } + // Set operation style if necessary, but do not override one already provided + if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) { + $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style']; + } + $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : ''; + $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : ''; + $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : ''; + } + } + } + } + + /** + * parses the wsdl document + * + * @param string $wsdl path or URL + * @access private + */ + function parseWSDL($wsdl = '') { + $this->debug("parse WSDL at path=$wsdl"); + + if ($wsdl == '') { + $this->debug('no wsdl passed to parseWSDL()!!'); + $this->setError('no wsdl passed to parseWSDL()!!'); + return false; + } + + // parse $wsdl for url format + $wsdl_props = parse_url($wsdl); + + if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) { + $this->debug('getting WSDL http(s) URL ' . $wsdl); + // get wsdl + $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl); + $tr->request_method = 'GET'; + $tr->useSOAPAction = false; + if($this->proxyhost && $this->proxyport){ + $tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword); + } + if ($this->authtype != '') { + $tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest); + } + $tr->setEncoding('gzip, deflate'); + $wsdl_string = $tr->send('', $this->timeout, $this->response_timeout); + //$this->debug("WSDL request\n" . $tr->outgoing_payload); + //$this->debug("WSDL response\n" . $tr->incoming_payload); + $this->appendDebug($tr->getDebug()); + // catch errors + if($err = $tr->getError() ){ + $errstr = 'Getting ' . $wsdl . ' - HTTP ERROR: '.$err; + $this->debug($errstr); + $this->setError($errstr); + unset($tr); + return false; + } + unset($tr); + $this->debug("got WSDL URL"); + } else { + // $wsdl is not http(s), so treat it as a file URL or plain file path + if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) { + $path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path']; + } else { + $path = $wsdl; + } + $this->debug('getting WSDL file ' . $path); + if ($fp = @fopen($path, 'r')) { + $wsdl_string = ''; + while ($data = fread($fp, 32768)) { + $wsdl_string .= $data; + } + fclose($fp); + } else { + $errstr = "Bad path to WSDL file $path"; + $this->debug($errstr); + $this->setError($errstr); + return false; + } + } + $this->debug('Parse WSDL'); + // end new code added + // Create an XML parser. + $this->parser = xml_parser_create(); + // Set the options for parsing the XML data. + // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + // Set the object for the parser. + xml_set_object($this->parser, $this); + // Set the element handlers for the parser. + xml_set_element_handler($this->parser, 'start_element', 'end_element'); + xml_set_character_data_handler($this->parser, 'character_data'); + // Parse the XML file. + if (!xml_parse($this->parser, $wsdl_string, true)) { + // Display an error message. + $errstr = sprintf( + 'XML error parsing WSDL from %s on line %d: %s', + $wsdl, + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser)) + ); + $this->debug($errstr); + $this->debug("XML payload:\n" . $wsdl_string); + $this->setError($errstr); + return false; + } + // free the parser + xml_parser_free($this->parser); + $this->debug('Parsing WSDL done'); + // catch wsdl parse errors + if($this->getError()){ + return false; + } + return true; + } + + /** + * start-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @param string $attrs associative array of attributes + * @access private + */ + function start_element($parser, $name, $attrs) + { + if ($this->status == 'schema') { + $this->currentSchema->schemaStartElement($parser, $name, $attrs); + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + } elseif (preg_match('/schema$/', $name)) { + $this->debug('Parsing WSDL schema'); + // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")"); + $this->status = 'schema'; + $this->currentSchema = new nusoap_xmlschema('', '', $this->namespaces); + $this->currentSchema->schemaStartElement($parser, $name, $attrs); + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + } else { + // position in the total number of elements, starting from 0 + $pos = $this->position++; + $depth = $this->depth++; + // set self as current value for this depth + $this->depth_array[$depth] = $pos; + $this->message[$pos] = array('cdata' => ''); + // process attributes + if (count($attrs) > 0) { + // register namespace declarations + foreach($attrs as $k => $v) { + if (preg_match('/^xmlns/',$k)) { + if ($ns_prefix = substr(strrchr($k, ':'), 1)) { + $this->namespaces[$ns_prefix] = $v; + } else { + $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v; + } + if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') { + $this->XMLSchemaVersion = $v; + $this->namespaces['xsi'] = $v . '-instance'; + } + } + } + // expand each attribute prefix to its namespace + foreach($attrs as $k => $v) { + $k = strpos($k, ':') ? $this->expandQname($k) : $k; + if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') { + $v = strpos($v, ':') ? $this->expandQname($v) : $v; + } + $eAttrs[$k] = $v; + } + $attrs = $eAttrs; + } else { + $attrs = array(); + } + // get element prefix, namespace and name + if (preg_match('/:/', $name)) { + // get ns prefix + $prefix = substr($name, 0, strpos($name, ':')); + // get ns + $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; + // get unqualified name + $name = substr(strstr($name, ':'), 1); + } + // process attributes, expanding any prefixes to namespaces + // find status, register data + switch ($this->status) { + case 'message': + if ($name == 'part') { + if (isset($attrs['type'])) { + $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs)); + $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type']; + } + if (isset($attrs['element'])) { + $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs)); + $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^'; + } + } + break; + case 'portType': + switch ($name) { + case 'operation': + $this->currentPortOperation = $attrs['name']; + $this->debug("portType $this->currentPortType operation: $this->currentPortOperation"); + if (isset($attrs['parameterOrder'])) { + $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder']; + } + break; + case 'documentation': + $this->documentation = true; + break; + // merge input/output data + default: + $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : ''; + $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m; + break; + } + break; + case 'binding': + switch ($name) { + case 'binding': + // get ns prefix + if (isset($attrs['style'])) { + $this->bindings[$this->currentBinding]['prefix'] = $prefix; + } + $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs); + break; + case 'header': + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs; + break; + case 'operation': + if (isset($attrs['soapAction'])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction']; + } + if (isset($attrs['style'])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style']; + } + if (isset($attrs['name'])) { + $this->currentOperation = $attrs['name']; + $this->debug("current binding operation: $this->currentOperation"); + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name']; + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding; + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : ''; + } + break; + case 'input': + $this->opStatus = 'input'; + break; + case 'output': + $this->opStatus = 'output'; + break; + case 'body': + if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs); + } else { + $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs; + } + break; + } + break; + case 'service': + switch ($name) { + case 'port': + $this->currentPort = $attrs['name']; + $this->debug('current port: ' . $this->currentPort); + $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']); + + break; + case 'address': + $this->ports[$this->currentPort]['location'] = $attrs['location']; + $this->ports[$this->currentPort]['bindingType'] = $namespace; + $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace; + $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location']; + break; + } + break; + } + // set status + switch ($name) { + case 'import': + if (isset($attrs['location'])) { + $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false); + $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')'); + } else { + $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true); + if (! $this->getPrefixFromNamespace($attrs['namespace'])) { + $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; + } + $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')'); + } + break; + //wait for schema + //case 'types': + // $this->status = 'schema'; + // break; + case 'message': + $this->status = 'message'; + $this->messages[$attrs['name']] = array(); + $this->currentMessage = $attrs['name']; + break; + case 'portType': + $this->status = 'portType'; + $this->portTypes[$attrs['name']] = array(); + $this->currentPortType = $attrs['name']; + break; + case "binding": + if (isset($attrs['name'])) { + // get binding name + if (strpos($attrs['name'], ':')) { + $this->currentBinding = $this->getLocalPart($attrs['name']); + } else { + $this->currentBinding = $attrs['name']; + } + $this->status = 'binding'; + $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']); + $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']); + } + break; + case 'service': + $this->serviceName = $attrs['name']; + $this->status = 'service'; + $this->debug('current service: ' . $this->serviceName); + break; + case 'definitions': + foreach ($attrs as $name => $value) { + $this->wsdl_info[$name] = $value; + } + break; + } + } + } + + /** + * end-element handler + * + * @param string $parser XML parser object + * @param string $name element name + * @access private + */ + function end_element($parser, $name){ + // unset schema status + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { + $this->status = ""; + $this->appendDebug($this->currentSchema->getDebug()); + $this->currentSchema->clearDebug(); + $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema; + $this->debug('Parsing WSDL schema done'); + } + if ($this->status == 'schema') { + $this->currentSchema->schemaEndElement($parser, $name); + } else { + // bring depth down a notch + $this->depth--; + } + // end documentation + if ($this->documentation) { + //TODO: track the node to which documentation should be assigned; it can be a part, message, etc. + //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation; + $this->documentation = false; + } + } + + /** + * element content handler + * + * @param string $parser XML parser object + * @param string $data element content + * @access private + */ + function character_data($parser, $data) + { + $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; + if (isset($this->message[$pos]['cdata'])) { + $this->message[$pos]['cdata'] .= $data; + } + if ($this->documentation) { + $this->documentation .= $data; + } + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype certRequest="); + $this->appendDebug($this->varDump($certRequest)); + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->certRequest = $certRequest; + } + + function getBindingData($binding) + { + if (is_array($this->bindings[$binding])) { + return $this->bindings[$binding]; + } + } + + /** + * returns an assoc array of operation names => operation data + * + * @param string $portName WSDL port name + * @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported) + * @return array + * @access public + */ + function getOperations($portName = '', $bindingType = 'soap') { + $ops = array(); + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } else { + $this->debug("getOperations bindingType $bindingType may not be supported"); + } + $this->debug("getOperations for port '$portName' bindingType $bindingType"); + // loop thru ports + foreach($this->ports as $port => $portData) { + $this->debug("getOperations checking port $port bindingType " . $portData['bindingType']); + if ($portName == '' || $port == $portName) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + $this->debug("getOperations found port $port bindingType $bindingType"); + //$this->debug("port data: " . $this->varDump($portData)); + //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ])); + // merge bindings + if (isset($this->bindings[ $portData['binding'] ]['operations'])) { + $ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']); + } + } + } + } + if (count($ops) == 0) { + $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType"); + } + return $ops; + } + + /** + * returns an associative array of data necessary for calling an operation + * + * @param string $operation name of operation + * @param string $bindingType type of binding eg: soap, soap12 + * @return array + * @access public + */ + function getOperationData($operation, $bindingType = 'soap') + { + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } + // loop thru ports + foreach($this->ports as $port => $portData) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + // get binding + //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { + foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) { + // note that we could/should also check the namespace here + if ($operation == $bOperation) { + $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation]; + return $opData; + } + } + } + } + } + + /** + * returns an associative array of data necessary for calling an operation + * + * @param string $soapAction soapAction for operation + * @param string $bindingType type of binding eg: soap, soap12 + * @return array + * @access public + */ + function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') { + if ($bindingType == 'soap') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/'; + } elseif ($bindingType == 'soap12') { + $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/'; + } + // loop thru ports + foreach($this->ports as $port => $portData) { + // binding type of port matches parameter + if ($portData['bindingType'] == $bindingType) { + // loop through operations for the binding + foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { + if ($opData['soapAction'] == $soapAction) { + return $opData; + } + } + } + } + } + + /** + * returns an array of information about a given type + * returns false if no type exists by the given name + * + * typeDef = array( + * 'elements' => array(), // refs to elements array + * 'restrictionBase' => '', + * 'phpType' => '', + * 'order' => '(sequence|all)', + * 'attrs' => array() // refs to attributes array + * ) + * + * @param string $type the type + * @param string $ns namespace (not prefix) of the type + * @return mixed + * @access public + * @see nusoap_xmlschema + */ + function getTypeDef($type, $ns) { + $this->debug("in getTypeDef: type=$type, ns=$ns"); + if ((! $ns) && isset($this->namespaces['tns'])) { + $ns = $this->namespaces['tns']; + $this->debug("in getTypeDef: type namespace forced to $ns"); + } + if (!isset($this->schemas[$ns])) { + foreach ($this->schemas as $ns0 => $schema0) { + if (strcasecmp($ns, $ns0) == 0) { + $this->debug("in getTypeDef: replacing schema namespace $ns with $ns0"); + $ns = $ns0; + break; + } + } + } + if (isset($this->schemas[$ns])) { + $this->debug("in getTypeDef: have schema for namespace $ns"); + for ($i = 0; $i < count($this->schemas[$ns]); $i++) { + $xs = &$this->schemas[$ns][$i]; + $t = $xs->getTypeDef($type); + $this->appendDebug($xs->getDebug()); + $xs->clearDebug(); + if ($t) { + $this->debug("in getTypeDef: found type $type"); + if (!isset($t['phpType'])) { + // get info for type to tack onto the element + $uqType = substr($t['type'], strrpos($t['type'], ':') + 1); + $ns = substr($t['type'], 0, strrpos($t['type'], ':')); + $etype = $this->getTypeDef($uqType, $ns); + if ($etype) { + $this->debug("found type for [element] $type:"); + $this->debug($this->varDump($etype)); + if (isset($etype['phpType'])) { + $t['phpType'] = $etype['phpType']; + } + if (isset($etype['elements'])) { + $t['elements'] = $etype['elements']; + } + if (isset($etype['attrs'])) { + $t['attrs'] = $etype['attrs']; + } + } else { + $this->debug("did not find type for [element] $type"); + } + } + return $t; + } + } + $this->debug("in getTypeDef: did not find type $type"); + } else { + $this->debug("in getTypeDef: do not have schema for namespace $ns"); + } + return false; + } + + /** + * prints html description of services + * + * @access private + */ + function webDescription(){ + global $HTTP_SERVER_VARS; + + if (isset($_SERVER)) { + $PHP_SELF = $_SERVER['PHP_SELF']; + } elseif (isset($HTTP_SERVER_VARS)) { + $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; + } else { + $this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available"); + } + + $b = ' + NuSOAP: '.$this->serviceName.' + + + + +
        +

        +
        '.$this->serviceName.'
        + +
        '; + return $b; + } + + /** + * serialize the parsed wsdl + * + * @param mixed $debug whether to put debug=1 in endpoint URL + * @return string serialization of WSDL + * @access public + */ + function serialize($debug = 0) + { + $xml = ''; + $xml .= "\nnamespaces as $k => $v) { + $xml .= " xmlns:$k=\"$v\""; + } + // 10.9.02 - add poulter fix for wsdl and tns declarations + if (isset($this->namespaces['wsdl'])) { + $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\""; + } + if (isset($this->namespaces['tns'])) { + $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\""; + } + $xml .= '>'; + // imports + if (sizeof($this->import) > 0) { + foreach($this->import as $ns => $list) { + foreach ($list as $ii) { + if ($ii['location'] != '') { + $xml .= ''; + } else { + $xml .= ''; + } + } + } + } + // types + if (count($this->schemas)>=1) { + $xml .= "\n\n"; + foreach ($this->schemas as $ns => $list) { + foreach ($list as $xs) { + $xml .= $xs->serializeSchema(); + } + } + $xml .= ''; + } + // messages + if (count($this->messages) >= 1) { + foreach($this->messages as $msgName => $msgParts) { + $xml .= "\n'; + if(is_array($msgParts)){ + foreach($msgParts as $partName => $partType) { + // print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'
        '; + if (strpos($partType, ':')) { + $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType)); + } elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) { + // print 'checking typemap: '.$this->XMLSchemaVersion.'
        '; + $typePrefix = 'xsd'; + } else { + foreach($this->typemap as $ns => $types) { + if (isset($types[$partType])) { + $typePrefix = $this->getPrefixFromNamespace($ns); + } + } + if (!isset($typePrefix)) { + die("$partType has no namespace!"); + } + } + $ns = $this->getNamespaceFromPrefix($typePrefix); + $localPart = $this->getLocalPart($partType); + $typeDef = $this->getTypeDef($localPart, $ns); + if ($typeDef['typeClass'] == 'element') { + $elementortype = 'element'; + if (substr($localPart, -1) == '^') { + $localPart = substr($localPart, 0, -1); + } + } else { + $elementortype = 'type'; + } + $xml .= "\n" . ' '; + } + } + $xml .= '
        '; + } + } + // bindings & porttypes + if (count($this->bindings) >= 1) { + $binding_xml = ''; + $portType_xml = ''; + foreach($this->bindings as $bindingName => $attrs) { + $binding_xml .= "\n'; + $binding_xml .= "\n" . ' '; + $portType_xml .= "\n'; + foreach($attrs['operations'] as $opName => $opParts) { + $binding_xml .= "\n" . ' '; + $binding_xml .= "\n" . ' '; + if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') { + $enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"'; + } else { + $enc_style = ''; + } + $binding_xml .= "\n" . ' '; + if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') { + $enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"'; + } else { + $enc_style = ''; + } + $binding_xml .= "\n" . ' '; + $binding_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' ' . htmlspecialchars($opParts['documentation']) . ''; + } + $portType_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' '; + $portType_xml .= "\n" . ' '; + } + $portType_xml .= "\n" . ''; + $binding_xml .= "\n" . ''; + } + $xml .= $portType_xml . $binding_xml; + } + // services + $xml .= "\nserviceName . '">'; + if (count($this->ports) >= 1) { + foreach($this->ports as $pName => $attrs) { + $xml .= "\n" . ' '; + $xml .= "\n" . ' '; + $xml .= "\n" . ' '; + } + } + $xml .= "\n" . ''; + return $xml . "\n"; + } + + /** + * determine whether a set of parameters are unwrapped + * when they are expect to be wrapped, Microsoft-style. + * + * @param string $type the type (element name) of the wrapper + * @param array $parameters the parameter values for the SOAP call + * @return boolean whether they parameters are unwrapped (and should be wrapped) + * @access private + */ + function parametersMatchWrapped($type, &$parameters) { + $this->debug("in parametersMatchWrapped type=$type, parameters="); + $this->appendDebug($this->varDump($parameters)); + + // split type into namespace:unqualified-type + if (strpos($type, ':')) { + $uqType = substr($type, strrpos($type, ':') + 1); + $ns = substr($type, 0, strrpos($type, ':')); + $this->debug("in parametersMatchWrapped: got a prefixed type: $uqType, $ns"); + if ($this->getNamespaceFromPrefix($ns)) { + $ns = $this->getNamespaceFromPrefix($ns); + $this->debug("in parametersMatchWrapped: expanded prefixed type: $uqType, $ns"); + } + } else { + // TODO: should the type be compared to types in XSD, and the namespace + // set to XSD if the type matches? + $this->debug("in parametersMatchWrapped: No namespace for type $type"); + $ns = ''; + $uqType = $type; + } + + // get the type information + if (!$typeDef = $this->getTypeDef($uqType, $ns)) { + $this->debug("in parametersMatchWrapped: $type ($uqType) is not a supported type."); + return false; + } + $this->debug("in parametersMatchWrapped: found typeDef="); + $this->appendDebug($this->varDump($typeDef)); + if (substr($uqType, -1) == '^') { + $uqType = substr($uqType, 0, -1); + } + $phpType = $typeDef['phpType']; + $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''); + $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType"); + + // we expect a complexType or element of complexType + if ($phpType != 'struct') { + $this->debug("in parametersMatchWrapped: not a struct"); + return false; + } + + // see whether the parameter names match the elements + if (isset($typeDef['elements']) && is_array($typeDef['elements'])) { + $elements = 0; + $matches = 0; + foreach ($typeDef['elements'] as $name => $attrs) { + if (isset($parameters[$name])) { + $this->debug("in parametersMatchWrapped: have parameter named $name"); + $matches++; + } else { + $this->debug("in parametersMatchWrapped: do not have parameter named $name"); + } + $elements++; + } + + $this->debug("in parametersMatchWrapped: $matches parameter names match $elements wrapped parameter names"); + if ($matches == 0) { + return false; + } + return true; + } + + // since there are no elements for the type, if the user passed no + // parameters, the parameters match wrapped. + $this->debug("in parametersMatchWrapped: no elements type $ns:$uqType"); + return count($parameters) == 0; + } + + /** + * serialize PHP values according to a WSDL message definition + * contrary to the method name, this is not limited to RPC + * + * TODO + * - multi-ref serialization + * - validate PHP values against type definitions, return errors if invalid + * + * @param string $operation operation name + * @param string $direction (input|output) + * @param mixed $parameters parameter value(s) + * @param string $bindingType (soap|soap12) + * @return mixed parameters serialized as XML or false on error (e.g. operation not found) + * @access public + */ + function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') { + $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType"); + $this->appendDebug('parameters=' . $this->varDump($parameters)); + + if ($direction != 'input' && $direction != 'output') { + $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); + $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); + return false; + } + if (!$opData = $this->getOperationData($operation, $bindingType)) { + $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); + $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); + return false; + } + $this->debug('in serializeRPCParameters: opData:'); + $this->appendDebug($this->varDump($opData)); + + // Get encoding style for output and set to current + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { + $encodingStyle = $opData['output']['encodingStyle']; + $enc_style = $encodingStyle; + } + + // set input params + $xml = ''; + if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { + $parts = &$opData[$direction]['parts']; + $part_count = sizeof($parts); + $style = $opData['style']; + $use = $opData[$direction]['use']; + $this->debug("have $part_count part(s) to serialize using $style/$use"); + if (is_array($parameters)) { + $parametersArrayType = $this->isArraySimpleOrStruct($parameters); + $parameter_count = count($parameters); + $this->debug("have $parameter_count parameter(s) provided as $parametersArrayType to serialize"); + // check for Microsoft-style wrapped parameters + if ($style == 'document' && $use == 'literal' && $part_count == 1 && isset($parts['parameters'])) { + $this->debug('check whether the caller has wrapped the parameters'); + if ($direction == 'output' && $parametersArrayType == 'arraySimple' && $parameter_count == 1) { + // TODO: consider checking here for double-wrapping, when + // service function wraps, then NuSOAP wraps again + $this->debug("change simple array to associative with 'parameters' element"); + $parameters['parameters'] = $parameters[0]; + unset($parameters[0]); + } + if (($parametersArrayType == 'arrayStruct' || $parameter_count == 0) && !isset($parameters['parameters'])) { + $this->debug('check whether caller\'s parameters match the wrapped ones'); + if ($this->parametersMatchWrapped($parts['parameters'], $parameters)) { + $this->debug('wrap the parameters for the caller'); + $parameters = array('parameters' => $parameters); + $parameter_count = 1; + } + } + } + foreach ($parts as $name => $type) { + $this->debug("serializing part $name of type $type"); + // Track encoding style + if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { + $encodingStyle = $opData[$direction]['encodingStyle']; + $enc_style = $encodingStyle; + } else { + $enc_style = false; + } + // NOTE: add error handling here + // if serializeType returns false, then catch global error and fault + if ($parametersArrayType == 'arraySimple') { + $p = array_shift($parameters); + $this->debug('calling serializeType w/indexed param'); + $xml .= $this->serializeType($name, $type, $p, $use, $enc_style); + } elseif (isset($parameters[$name])) { + $this->debug('calling serializeType w/named param'); + $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style); + } else { + // TODO: only send nillable + $this->debug('calling serializeType w/null param'); + $xml .= $this->serializeType($name, $type, null, $use, $enc_style); + } + } + } else { + $this->debug('no parameters passed.'); + } + } + $this->debug("serializeRPCParameters returning: $xml"); + return $xml; + } + + /** + * serialize a PHP value according to a WSDL message definition + * + * TODO + * - multi-ref serialization + * - validate PHP values against type definitions, return errors if invalid + * + * @param string $operation operation name + * @param string $direction (input|output) + * @param mixed $parameters parameter value(s) + * @return mixed parameters serialized as XML or false on error (e.g. operation not found) + * @access public + * @deprecated + */ + function serializeParameters($operation, $direction, $parameters) + { + $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); + $this->appendDebug('parameters=' . $this->varDump($parameters)); + + if ($direction != 'input' && $direction != 'output') { + $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); + $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); + return false; + } + if (!$opData = $this->getOperationData($operation)) { + $this->debug('Unable to retrieve WSDL data for operation: ' . $operation); + $this->setError('Unable to retrieve WSDL data for operation: ' . $operation); + return false; + } + $this->debug('opData:'); + $this->appendDebug($this->varDump($opData)); + + // Get encoding style for output and set to current + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { + $encodingStyle = $opData['output']['encodingStyle']; + $enc_style = $encodingStyle; + } + + // set input params + $xml = ''; + if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { + + $use = $opData[$direction]['use']; + $this->debug("use=$use"); + $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)'); + if (is_array($parameters)) { + $parametersArrayType = $this->isArraySimpleOrStruct($parameters); + $this->debug('have ' . $parametersArrayType . ' parameters'); + foreach($opData[$direction]['parts'] as $name => $type) { + $this->debug('serializing part "'.$name.'" of type "'.$type.'"'); + // Track encoding style + if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { + $encodingStyle = $opData[$direction]['encodingStyle']; + $enc_style = $encodingStyle; + } else { + $enc_style = false; + } + // NOTE: add error handling here + // if serializeType returns false, then catch global error and fault + if ($parametersArrayType == 'arraySimple') { + $p = array_shift($parameters); + $this->debug('calling serializeType w/indexed param'); + $xml .= $this->serializeType($name, $type, $p, $use, $enc_style); + } elseif (isset($parameters[$name])) { + $this->debug('calling serializeType w/named param'); + $xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style); + } else { + // TODO: only send nillable + $this->debug('calling serializeType w/null param'); + $xml .= $this->serializeType($name, $type, null, $use, $enc_style); + } + } + } else { + $this->debug('no parameters passed.'); + } + } + $this->debug("serializeParameters returning: $xml"); + return $xml; + } + + /** + * serializes a PHP value according a given type definition + * + * @param string $name name of value (part or element) + * @param string $type XML schema type of value (type or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $use use for part (encoded|literal) + * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style) + * @param boolean $unqualified a kludge for what should be XML namespace form handling + * @return string value serialized as an XML string + * @access private + */ + function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false) + { + $this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified")); + $this->appendDebug("value=" . $this->varDump($value)); + if($use == 'encoded' && $encodingStyle) { + $encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"'; + } + + // if a soapval has been supplied, let its type override the WSDL + if (is_object($value) && get_class($value) == 'soapval') { + if ($value->type_ns) { + $type = $value->type_ns . ':' . $value->type; + $forceType = true; + $this->debug("in serializeType: soapval overrides type to $type"); + } elseif ($value->type) { + $type = $value->type; + $forceType = true; + $this->debug("in serializeType: soapval overrides type to $type"); + } else { + $forceType = false; + $this->debug("in serializeType: soapval does not override type"); + } + $attrs = $value->attributes; + $value = $value->value; + $this->debug("in serializeType: soapval overrides value to $value"); + if ($attrs) { + if (!is_array($value)) { + $value['!'] = $value; + } + foreach ($attrs as $n => $v) { + $value['!' . $n] = $v; + } + $this->debug("in serializeType: soapval provides attributes"); + } + } else { + $forceType = false; + } + + $xml = ''; + if (strpos($type, ':')) { + $uqType = substr($type, strrpos($type, ':') + 1); + $ns = substr($type, 0, strrpos($type, ':')); + $this->debug("in serializeType: got a prefixed type: $uqType, $ns"); + if ($this->getNamespaceFromPrefix($ns)) { + $ns = $this->getNamespaceFromPrefix($ns); + $this->debug("in serializeType: expanded prefixed type: $uqType, $ns"); + } + + if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){ + $this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type'); + if ($unqualified && $use == 'literal') { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$elementNS/>"; + } else { + // TODO: depends on nillable, which should be checked before calling this method + $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if ($uqType == 'Array') { + // JBoss/Axis does this sometimes + return $this->serialize_val($value, $name, false, false, false, false, $use); + } + if ($uqType == 'boolean') { + if ((is_string($value) && $value == 'false') || (! $value)) { + $value = 'false'; + } else { + $value = 'true'; + } + } + if ($uqType == 'string' && gettype($value) == 'string') { + $value = $this->expandEntities($value); + } + if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') { + $value = sprintf("%.0lf", $value); + } + // it's a scalar + // TODO: what about null/nil values? + // check type isn't a custom type extending xmlschema namespace + if (!$this->getTypeDef($uqType, $ns)) { + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value"; + } else { + $xml = "<$name$elementNS>$value"; + } + } else { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + $this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)'); + } else if ($ns == 'http://xml.apache.org/xml-soap') { + $this->debug('in serializeType: appears to be Apache SOAP type'); + if ($uqType == 'Map') { + $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap'); + if (! $tt_prefix) { + $this->debug('in serializeType: Add namespace for Apache SOAP type'); + $tt_prefix = 'ns' . rand(1000, 9999); + $this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap'; + // force this to be added to usedNamespaces + $tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap'); + } + $contents = ''; + foreach($value as $k => $v) { + $this->debug("serializing map element: key $k, value $v"); + $contents .= ''; + $contents .= $this->serialize_val($k,'key',false,false,false,false,$use); + $contents .= $this->serialize_val($v,'value',false,false,false,false,$use); + $contents .= ''; + } + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents"; + } else { + $xml = "<$name>$contents"; + } + } else { + $xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + $this->debug('in serializeType: Apache SOAP type, but only support Map'); + } + } else { + // TODO: should the type be compared to types in XSD, and the namespace + // set to XSD if the type matches? + $this->debug("in serializeType: No namespace for type $type"); + $ns = ''; + $uqType = $type; + } + if(!$typeDef = $this->getTypeDef($uqType, $ns)){ + $this->setError("$type ($uqType) is not a supported type."); + $this->debug("in serializeType: $type ($uqType) is not a supported type."); + return false; + } else { + $this->debug("in serializeType: found typeDef"); + $this->appendDebug('typeDef=' . $this->varDump($typeDef)); + if (substr($uqType, -1) == '^') { + $uqType = substr($uqType, 0, -1); + } + } + if (!isset($typeDef['phpType'])) { + $this->setError("$type ($uqType) has no phpType."); + $this->debug("in serializeType: $type ($uqType) has no phpType."); + return false; + } + $phpType = $typeDef['phpType']; + $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); + // if php type == struct, map value to the element names + if ($phpType == 'struct') { + if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') { + $elementName = $uqType; + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + $elementNS = " xmlns=\"\""; + } + } else { + $elementName = $name; + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs and nillable + $xml = "<$elementName$elementNS/>"; + } else { + $xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if (is_object($value)) { + $value = get_object_vars($value); + } + if (is_array($value)) { + $elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType); + if ($use == 'literal') { + if ($forceType) { + $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">"; + } else { + $xml = "<$elementName$elementNS$elementAttrs>"; + } + } else { + $xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>"; + } + + if (isset($typeDef['simpleContent']) && $typeDef['simpleContent'] == 'true') { + if (isset($value['!'])) { + $xml .= $value['!']; + $this->debug("in serializeType: serialized simpleContent for type $type"); + } else { + $this->debug("in serializeType: no simpleContent to serialize for type $type"); + } + } else { + // complexContent + $xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle); + } + $xml .= ""; + } else { + $this->debug("in serializeType: phpType is struct, but value is not an array"); + $this->setError("phpType is struct, but value is not an array: see debug output for details"); + $xml = ''; + } + } elseif ($phpType == 'array') { + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if (is_null($value)) { + if ($use == 'literal') { + // TODO: depends on minOccurs + $xml = "<$name$elementNS/>"; + } else { + $xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . + ":Array\" " . + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . + ':arrayType="' . + $this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) . + ':' . + $this->getLocalPart($typeDef['arrayType'])."[0]\"/>"; + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + if (isset($typeDef['multidimensional'])) { + $nv = array(); + foreach($value as $v) { + $cols = ',' . sizeof($v); + $nv = array_merge($nv, $v); + } + $value = $nv; + } else { + $cols = ''; + } + if (is_array($value) && sizeof($value) >= 1) { + $rows = sizeof($value); + $contents = ''; + foreach($value as $k => $v) { + $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]"); + //if (strpos($typeDef['arrayType'], ':') ) { + if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) { + $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); + } else { + $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); + } + } + } else { + $rows = 0; + $contents = null; + } + // TODO: for now, an empty value will be serialized as a zero element + // array. Revisit this when coding the handling of null/nil values. + if ($use == 'literal') { + $xml = "<$name$elementNS>" + .$contents + .""; + } else { + $xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '. + $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') + .':arrayType="' + .$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) + .":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">" + .$contents + .""; + } + } elseif ($phpType == 'scalar') { + if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) { + $elementNS = " xmlns=\"$ns\""; + } else { + if ($unqualified) { + $elementNS = " xmlns=\"\""; + } else { + $elementNS = ''; + } + } + if ($use == 'literal') { + if ($forceType) { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value"; + } else { + $xml = "<$name$elementNS>$value"; + } + } else { + $xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value"; + } + } + $this->debug("in serializeType: returning: $xml"); + return $xml; + } + + /** + * serializes the attributes for a complexType + * + * @param array $typeDef our internal representation of an XML schema type (or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $ns the namespace of the type + * @param string $uqType the local part of the type + * @return string value serialized as an XML string + * @access private + */ + function serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType) { + $this->debug("serializeComplexTypeAttributes for XML Schema type $ns:$uqType"); + $xml = ''; + if (isset($typeDef['extensionBase'])) { + $nsx = $this->getPrefix($typeDef['extensionBase']); + $uqTypex = $this->getLocalPart($typeDef['extensionBase']); + if ($this->getNamespaceFromPrefix($nsx)) { + $nsx = $this->getNamespaceFromPrefix($nsx); + } + if ($typeDefx = $this->getTypeDef($uqTypex, $nsx)) { + $this->debug("serialize attributes for extension base $nsx:$uqTypex"); + $xml .= $this->serializeComplexTypeAttributes($typeDefx, $value, $nsx, $uqTypex); + } else { + $this->debug("extension base $nsx:$uqTypex is not a supported type"); + } + } + if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) { + $this->debug("serialize attributes for XML Schema type $ns:$uqType"); + if (is_array($value)) { + $xvalue = $value; + } elseif (is_object($value)) { + $xvalue = get_object_vars($value); + } else { + $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType"); + $xvalue = array(); + } + foreach ($typeDef['attrs'] as $aName => $attrs) { + if (isset($xvalue['!' . $aName])) { + $xname = '!' . $aName; + $this->debug("value provided for attribute $aName with key $xname"); + } elseif (isset($xvalue[$aName])) { + $xname = $aName; + $this->debug("value provided for attribute $aName with key $xname"); + } elseif (isset($attrs['default'])) { + $xname = '!' . $aName; + $xvalue[$xname] = $attrs['default']; + $this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName); + } else { + $xname = ''; + $this->debug("no value provided for attribute $aName"); + } + if ($xname) { + $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\""; + } + } + } else { + $this->debug("no attributes to serialize for XML Schema type $ns:$uqType"); + } + return $xml; + } + + /** + * serializes the elements for a complexType + * + * @param array $typeDef our internal representation of an XML schema type (or element) + * @param mixed $value a native PHP value (parameter value) + * @param string $ns the namespace of the type + * @param string $uqType the local part of the type + * @param string $use use for part (encoded|literal) + * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style) + * @return string value serialized as an XML string + * @access private + */ + function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) { + $this->debug("in serializeComplexTypeElements for XML Schema type $ns:$uqType"); + $xml = ''; + if (isset($typeDef['extensionBase'])) { + $nsx = $this->getPrefix($typeDef['extensionBase']); + $uqTypex = $this->getLocalPart($typeDef['extensionBase']); + if ($this->getNamespaceFromPrefix($nsx)) { + $nsx = $this->getNamespaceFromPrefix($nsx); + } + if ($typeDefx = $this->getTypeDef($uqTypex, $nsx)) { + $this->debug("serialize elements for extension base $nsx:$uqTypex"); + $xml .= $this->serializeComplexTypeElements($typeDefx, $value, $nsx, $uqTypex, $use, $encodingStyle); + } else { + $this->debug("extension base $nsx:$uqTypex is not a supported type"); + } + } + if (isset($typeDef['elements']) && is_array($typeDef['elements'])) { + $this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType"); + if (is_array($value)) { + $xvalue = $value; + } elseif (is_object($value)) { + $xvalue = get_object_vars($value); + } else { + $this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType"); + $xvalue = array(); + } + // toggle whether all elements are present - ideally should validate against schema + if (count($typeDef['elements']) != count($xvalue)){ + $optionals = true; + } + foreach ($typeDef['elements'] as $eName => $attrs) { + if (!isset($xvalue[$eName])) { + if (isset($attrs['default'])) { + $xvalue[$eName] = $attrs['default']; + $this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName); + } + } + // if user took advantage of a minOccurs=0, then only serialize named parameters + if (isset($optionals) + && (!isset($xvalue[$eName])) + && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true') + ){ + if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') { + $this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']); + } + // do nothing + $this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing"); + } else { + // get value + if (isset($xvalue[$eName])) { + $v = $xvalue[$eName]; + } else { + $v = null; + } + if (isset($attrs['form'])) { + $unqualified = ($attrs['form'] == 'unqualified'); + } else { + $unqualified = false; + } + if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') { + $vv = $v; + foreach ($vv as $k => $v) { + if (isset($attrs['type']) || isset($attrs['ref'])) { + // serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } else { + // serialize generic type (can this ever really happen?) + $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use"); + $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use); + } + } + } else { + if (is_null($v) && isset($attrs['minOccurs']) && $attrs['minOccurs'] == '0') { + // do nothing + } elseif (is_null($v) && isset($attrs['nillable']) && $attrs['nillable'] == 'true') { + // TODO: serialize a nil correctly, but for now serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } elseif (isset($attrs['type']) || isset($attrs['ref'])) { + // serialize schema-defined type + $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified); + } else { + // serialize generic type (can this ever really happen?) + $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use"); + $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use); + } + } + } + } + } else { + $this->debug("no elements to serialize for XML Schema type $ns:$uqType"); + } + return $xml; + } + + /** + * adds an XML Schema complex type to the WSDL types + * + * @param string $name + * @param string $typeClass (complexType|simpleType|attribute) + * @param string $phpType currently supported are array and struct (php assoc array) + * @param string $compositor (all|sequence|choice) + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param array $elements e.g. array ( name => array(name=>'',type=>'') ) + * @param array $attrs e.g. array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')) + * @param string $arrayType as namespace:name (xsd:string) + * @see nusoap_xmlschema + * @access public + */ + function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') { + if (count($elements) > 0) { + $eElements = array(); + foreach($elements as $n => $e){ + // expand each element + $ee = array(); + foreach ($e as $k => $v) { + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $ee[$k] = $v; + } + $eElements[$n] = $ee; + } + $elements = $eElements; + } + + if (count($attrs) > 0) { + foreach($attrs as $n => $a){ + // expand each attribute + foreach ($a as $k => $v) { + $k = strpos($k,':') ? $this->expandQname($k) : $k; + $v = strpos($v,':') ? $this->expandQname($v) : $v; + $aa[$k] = $v; + } + $eAttrs[$n] = $aa; + } + $attrs = $eAttrs; + } + + $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase; + $arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType; + + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType); + } + + /** + * adds an XML Schema simple type to the WSDL types + * + * @param string $name + * @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) + * @param string $typeClass (should always be simpleType) + * @param string $phpType (should always be scalar) + * @param array $enumeration array of values + * @see nusoap_xmlschema + * @access public + */ + function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) { + $restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase; + + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration); + } + + /** + * adds an element to the WSDL types + * + * @param array $attrs attributes that must include name and type + * @see nusoap_xmlschema + * @access public + */ + function addElement($attrs) { + $typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns']; + $this->schemas[$typens][0]->addElement($attrs); + } + + /** + * register an operation with the server + * + * @param string $name operation (method) name + * @param array $in assoc array of input values: key = param name, value = param type + * @param array $out assoc array of output values: key = param name, value = param type + * @param string $namespace optional The namespace for the operation + * @param string $soapaction optional The soapaction for the operation + * @param string $style (rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically + * @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now) + * @param string $documentation optional The description to include in the WSDL + * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) + * @access public + */ + function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){ + if ($use == 'encoded' && $encodingStyle == '') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } + + if ($style == 'document') { + $elements = array(); + foreach ($in as $n => $t) { + $elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified'); + } + $this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements); + $this->addElement(array('name' => $name, 'type' => $name . 'RequestType')); + $in = array('parameters' => 'tns:' . $name . '^'); + + $elements = array(); + foreach ($out as $n => $t) { + $elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified'); + } + $this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements); + $this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified')); + $out = array('parameters' => 'tns:' . $name . 'Response' . '^'); + } + + // get binding + $this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] = + array( + 'name' => $name, + 'binding' => $this->serviceName . 'Binding', + 'endpoint' => $this->endpoint, + 'soapAction' => $soapaction, + 'style' => $style, + 'input' => array( + 'use' => $use, + 'namespace' => $namespace, + 'encodingStyle' => $encodingStyle, + 'message' => $name . 'Request', + 'parts' => $in), + 'output' => array( + 'use' => $use, + 'namespace' => $namespace, + 'encodingStyle' => $encodingStyle, + 'message' => $name . 'Response', + 'parts' => $out), + 'namespace' => $namespace, + 'transport' => 'http://schemas.xmlsoap.org/soap/http', + 'documentation' => $documentation); + // add portTypes + // add messages + if($in) + { + foreach($in as $pName => $pType) + { + if(strpos($pType,':')) { + $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType); + } + $this->messages[$name.'Request'][$pName] = $pType; + } + } else { + $this->messages[$name.'Request']= '0'; + } + if($out) + { + foreach($out as $pName => $pType) + { + if(strpos($pType,':')) { + $pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType); + } + $this->messages[$name.'Response'][$pName] = $pType; + } + } else { + $this->messages[$name.'Response']= '0'; + } + return true; + } +} +?> +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_parser extends nusoap_base { + + var $xml = ''; + var $xml_encoding = ''; + var $method = ''; + var $root_struct = ''; + var $root_struct_name = ''; + var $root_struct_namespace = ''; + var $root_header = ''; + var $document = ''; // incoming SOAP body (text) + // determines where in the message we are (envelope,header,body,method) + var $status = ''; + var $position = 0; + var $depth = 0; + var $default_namespace = ''; + var $namespaces = array(); + var $message = array(); + var $parent = ''; + var $fault = false; + var $fault_code = ''; + var $fault_str = ''; + var $fault_detail = ''; + var $depth_array = array(); + var $debug_flag = true; + var $soapresponse = NULL; // parsed SOAP Body + var $soapheader = NULL; // parsed SOAP Header + var $responseHeaders = ''; // incoming SOAP headers (text) + var $body_position = 0; + // for multiref parsing: + // array of id => pos + var $ids = array(); + // array of id => hrefs => pos + var $multirefs = array(); + // toggle for auto-decoding element content + var $decode_utf8 = true; + + /** + * constructor that actually does the parsing + * + * @param string $xml SOAP message + * @param string $encoding character encoding scheme of message + * @param string $method method for which XML is parsed (unused?) + * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 + * @access public + */ + function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ + parent::nusoap_base(); + $this->xml = $xml; + $this->xml_encoding = $encoding; + $this->method = $method; + $this->decode_utf8 = $decode_utf8; + + // Check whether content has been read. + if(!empty($xml)){ + // Check XML encoding + $pos_xml = strpos($xml, '', $pos_xml + 2) - $pos_xml + 1); + if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) { + $xml_encoding = $res[1]; + if (strtoupper($xml_encoding) != $encoding) { + $err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'"; + $this->debug($err); + if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') { + $this->setError($err); + return; + } + // when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed + } else { + $this->debug('Charset from HTTP Content-Type matches encoding from XML declaration'); + } + } else { + $this->debug('No encoding specified in XML declaration'); + } + } else { + $this->debug('No XML declaration'); + } + $this->debug('Entering nusoap_parser(), length='.strlen($xml).', encoding='.$encoding); + // Create an XML parser - why not xml_parser_create_ns? + $this->parser = xml_parser_create($this->xml_encoding); + // Set the options for parsing the XML data. + //xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding); + // Set the object for the parser. + xml_set_object($this->parser, $this); + // Set the element handlers for the parser. + xml_set_element_handler($this->parser, 'start_element','end_element'); + xml_set_character_data_handler($this->parser,'character_data'); + + // Parse the XML file. + if(!xml_parse($this->parser,$xml,true)){ + // Display an error message. + $err = sprintf('XML error parsing SOAP payload on line %d: %s', + xml_get_current_line_number($this->parser), + xml_error_string(xml_get_error_code($this->parser))); + $this->debug($err); + $this->debug("XML payload:\n" . $xml); + $this->setError($err); + } else { + $this->debug('in nusoap_parser ctor, message:'); + $this->appendDebug($this->varDump($this->message)); + $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name); + // get final value + $this->soapresponse = $this->message[$this->root_struct]['result']; + // get header value + if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){ + $this->soapheader = $this->message[$this->root_header]['result']; + } + // resolve hrefs/ids + if(sizeof($this->multirefs) > 0){ + foreach($this->multirefs as $id => $hrefs){ + $this->debug('resolving multirefs for id: '.$id); + $idVal = $this->buildVal($this->ids[$id]); + if (is_array($idVal) && isset($idVal['!id'])) { + unset($idVal['!id']); + } + foreach($hrefs as $refPos => $ref){ + $this->debug('resolving href at pos '.$refPos); + $this->multirefs[$id][$refPos] = $idVal; + } + } + } + } + xml_parser_free($this->parser); + } else { + $this->debug('xml was empty, didn\'t parse!'); + $this->setError('xml was empty, didn\'t parse!'); + } + } + + /** + * start-element handler + * + * @param resource $parser XML parser object + * @param string $name element name + * @param array $attrs associative array of attributes + * @access private + */ + function start_element($parser, $name, $attrs) { + // position in a total number of elements, starting from 0 + // update class level pos + $pos = $this->position++; + // and set mine + $this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>''); + // depth = how many levels removed from root? + // set mine as current global depth and increment global depth value + $this->message[$pos]['depth'] = $this->depth++; + + // else add self as child to whoever the current parent is + if($pos != 0){ + $this->message[$this->parent]['children'] .= '|'.$pos; + } + // set my parent + $this->message[$pos]['parent'] = $this->parent; + // set self as current parent + $this->parent = $pos; + // set self as current value for this depth + $this->depth_array[$this->depth] = $pos; + // get element prefix + if(strpos($name,':')){ + // get ns prefix + $prefix = substr($name,0,strpos($name,':')); + // get unqualified name + $name = substr(strstr($name,':'),1); + } + // set status + if ($name == 'Envelope' && $this->status == '') { + $this->status = 'envelope'; + } elseif ($name == 'Header' && $this->status == 'envelope') { + $this->root_header = $pos; + $this->status = 'header'; + } elseif ($name == 'Body' && $this->status == 'envelope'){ + $this->status = 'body'; + $this->body_position = $pos; + // set method + } elseif($this->status == 'body' && $pos == ($this->body_position+1)) { + $this->status = 'method'; + $this->root_struct_name = $name; + $this->root_struct = $pos; + $this->message[$pos]['type'] = 'struct'; + $this->debug("found root struct $this->root_struct_name, pos $this->root_struct"); + } + // set my status + $this->message[$pos]['status'] = $this->status; + // set name + $this->message[$pos]['name'] = htmlspecialchars($name); + // set attrs + $this->message[$pos]['attrs'] = $attrs; + + // loop through atts, logging ns and type declarations + $attstr = ''; + foreach($attrs as $key => $value){ + $key_prefix = $this->getPrefix($key); + $key_localpart = $this->getLocalPart($key); + // if ns declarations, add to class level array of valid namespaces + if($key_prefix == 'xmlns'){ + if(preg_match('/^http:\/\/www.w3.org\/[0-9]{4}\/XMLSchema$/',$value)){ + $this->XMLSchemaVersion = $value; + $this->namespaces['xsd'] = $this->XMLSchemaVersion; + $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance'; + } + $this->namespaces[$key_localpart] = $value; + // set method namespace + if($name == $this->root_struct_name){ + $this->methodNamespace = $value; + } + // if it's a type declaration, set type + } elseif($key_localpart == 'type'){ + if (isset($this->message[$pos]['type']) && $this->message[$pos]['type'] == 'array') { + // do nothing: already processed arrayType + } else { + $value_prefix = $this->getPrefix($value); + $value_localpart = $this->getLocalPart($value); + $this->message[$pos]['type'] = $value_localpart; + $this->message[$pos]['typePrefix'] = $value_prefix; + if(isset($this->namespaces[$value_prefix])){ + $this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix]; + } else if(isset($attrs['xmlns:'.$value_prefix])) { + $this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix]; + } + // should do something here with the namespace of specified type? + } + } elseif($key_localpart == 'arrayType'){ + $this->message[$pos]['type'] = 'array'; + /* do arrayType ereg here + [1] arrayTypeValue ::= atype asize + [2] atype ::= QName rank* + [3] rank ::= '[' (',')* ']' + [4] asize ::= '[' length~ ']' + [5] length ::= nextDimension* Digit+ + [6] nextDimension ::= Digit+ ',' + */ + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/'; + if(preg_match($expr,$value,$regs)){ + $this->message[$pos]['typePrefix'] = $regs[1]; + $this->message[$pos]['arrayTypePrefix'] = $regs[1]; + if (isset($this->namespaces[$regs[1]])) { + $this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]]; + } else if (isset($attrs['xmlns:'.$regs[1]])) { + $this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]]; + } + $this->message[$pos]['arrayType'] = $regs[2]; + $this->message[$pos]['arraySize'] = $regs[3]; + $this->message[$pos]['arrayCols'] = $regs[4]; + } + // specifies nil value (or not) + } elseif ($key_localpart == 'nil'){ + $this->message[$pos]['nil'] = ($value == 'true' || $value == '1'); + // some other attribute + } elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') { + $this->message[$pos]['xattrs']['!' . $key] = $value; + } + + if ($key == 'xmlns') { + $this->default_namespace = $value; + } + // log id + if($key == 'id'){ + $this->ids[$value] = $pos; + } + // root + if($key_localpart == 'root' && $value == 1){ + $this->status = 'method'; + $this->root_struct_name = $name; + $this->root_struct = $pos; + $this->debug("found root struct $this->root_struct_name, pos $pos"); + } + // for doclit + $attstr .= " $key=\"$value\""; + } + // get namespace - must be done after namespace atts are processed + if(isset($prefix)){ + $this->message[$pos]['namespace'] = $this->namespaces[$prefix]; + $this->default_namespace = $this->namespaces[$prefix]; + } else { + $this->message[$pos]['namespace'] = $this->default_namespace; + } + if($this->status == 'header'){ + if ($this->root_header != $pos) { + $this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>"; + } + } elseif($this->root_struct_name != ''){ + $this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>"; + } + } + + /** + * end-element handler + * + * @param resource $parser XML parser object + * @param string $name element name + * @access private + */ + function end_element($parser, $name) { + // position of current element is equal to the last value left in depth_array for my depth + $pos = $this->depth_array[$this->depth--]; + + // get element prefix + if(strpos($name,':')){ + // get ns prefix + $prefix = substr($name,0,strpos($name,':')); + // get unqualified name + $name = substr(strstr($name,':'),1); + } + + // build to native type + if(isset($this->body_position) && $pos > $this->body_position){ + // deal w/ multirefs + if(isset($this->message[$pos]['attrs']['href'])){ + // get id + $id = substr($this->message[$pos]['attrs']['href'],1); + // add placeholder to href array + $this->multirefs[$id][$pos] = 'placeholder'; + // add set a reference to it as the result value + $this->message[$pos]['result'] =& $this->multirefs[$id][$pos]; + // build complexType values + } elseif($this->message[$pos]['children'] != ''){ + // if result has already been generated (struct/array) + if(!isset($this->message[$pos]['result'])){ + $this->message[$pos]['result'] = $this->buildVal($pos); + } + // build complexType values of attributes and possibly simpleContent + } elseif (isset($this->message[$pos]['xattrs'])) { + if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) { + $this->message[$pos]['xattrs']['!'] = null; + } elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') { + if (isset($this->message[$pos]['type'])) { + $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata']; + } + } + } + $this->message[$pos]['result'] = $this->message[$pos]['xattrs']; + // set value of simpleType (or nil complexType) + } else { + //$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']); + if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) { + $this->message[$pos]['xattrs']['!'] = null; + } elseif (isset($this->message[$pos]['type'])) { + $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $this->message[$pos]['result'] = $this->message[$pos]['cdata']; + } + } + + /* add value to parent's result, if parent is struct/array + $parent = $this->message[$pos]['parent']; + if($this->message[$parent]['type'] != 'map'){ + if(strtolower($this->message[$parent]['type']) == 'array'){ + $this->message[$parent]['result'][] = $this->message[$pos]['result']; + } else { + $this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result']; + } + } + */ + } + } + + // for doclit + if($this->status == 'header'){ + if ($this->root_header != $pos) { + $this->responseHeaders .= ""; + } + } elseif($pos >= $this->root_struct){ + $this->document .= ""; + } + // switch status + if ($pos == $this->root_struct){ + $this->status = 'body'; + $this->root_struct_namespace = $this->message[$pos]['namespace']; + } elseif ($pos == $this->root_header) { + $this->status = 'envelope'; + } elseif ($name == 'Body' && $this->status == 'body') { + $this->status = 'envelope'; + } elseif ($name == 'Header' && $this->status == 'header') { // will never happen + $this->status = 'envelope'; + } elseif ($name == 'Envelope' && $this->status == 'envelope') { + $this->status = ''; + } + // set parent back to my parent + $this->parent = $this->message[$pos]['parent']; + } + + /** + * element content handler + * + * @param resource $parser XML parser object + * @param string $data element content + * @access private + */ + function character_data($parser, $data){ + $pos = $this->depth_array[$this->depth]; + if ($this->xml_encoding=='UTF-8'){ + // TODO: add an option to disable this for folks who want + // raw UTF-8 that, e.g., might not map to iso-8859-1 + // TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1"); + if($this->decode_utf8){ + $data = utf8_decode($data); + } + } + $this->message[$pos]['cdata'] .= $data; + // for doclit + if($this->status == 'header'){ + $this->responseHeaders .= $data; + } else { + $this->document .= $data; + } + } + + /** + * get the parsed message (SOAP Body) + * + * @return mixed + * @access public + * @deprecated use get_soapbody instead + */ + function get_response(){ + return $this->soapresponse; + } + + /** + * get the parsed SOAP Body (NULL if there was none) + * + * @return mixed + * @access public + */ + function get_soapbody(){ + return $this->soapresponse; + } + + /** + * get the parsed SOAP Header (NULL if there was none) + * + * @return mixed + * @access public + */ + function get_soapheader(){ + return $this->soapheader; + } + + /** + * get the unparsed SOAP Header + * + * @return string XML or empty if no Header + * @access public + */ + function getHeaders(){ + return $this->responseHeaders; + } + + /** + * decodes simple types into PHP variables + * + * @param string $value value to decode + * @param string $type XML type to decode + * @param string $typens XML type namespace to decode + * @return mixed PHP value + * @access private + */ + function decodeSimple($value, $type, $typens) { + // TODO: use the namespace! + if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') { + return (string) $value; + } + if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') { + return (int) $value; + } + if ($type == 'float' || $type == 'double' || $type == 'decimal') { + return (double) $value; + } + if ($type == 'boolean') { + if (strtolower($value) == 'false' || strtolower($value) == 'f') { + return false; + } + return (boolean) $value; + } + if ($type == 'base64' || $type == 'base64Binary') { + $this->debug('Decode base64 value'); + return base64_decode($value); + } + // obscure numeric types + if ($type == 'nonPositiveInteger' || $type == 'negativeInteger' + || $type == 'nonNegativeInteger' || $type == 'positiveInteger' + || $type == 'unsignedInt' + || $type == 'unsignedShort' || $type == 'unsignedByte') { + return (int) $value; + } + // bogus: parser treats array with no elements as a simple type + if ($type == 'array') { + return array(); + } + // everything else + return (string) $value; + } + + /** + * builds response structures for compound values (arrays/structs) + * and scalars + * + * @param integer $pos position in node tree + * @return mixed PHP value + * @access private + */ + function buildVal($pos){ + if(!isset($this->message[$pos]['type'])){ + $this->message[$pos]['type'] = ''; + } + $this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']); + // if there are children... + if($this->message[$pos]['children'] != ''){ + $this->debug('in buildVal, there are children'); + $children = explode('|',$this->message[$pos]['children']); + array_shift($children); // knock off empty + // md array + if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){ + $r=0; // rowcount + $c=0; // colcount + foreach($children as $child_pos){ + $this->debug("in buildVal, got an MD array element: $r, $c"); + $params[$r][] = $this->message[$child_pos]['result']; + $c++; + if($c == $this->message[$pos]['arrayCols']){ + $c = 0; + $r++; + } + } + // array + } elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){ + $this->debug('in buildVal, adding array '.$this->message[$pos]['name']); + foreach($children as $child_pos){ + $params[] = &$this->message[$child_pos]['result']; + } + // apache Map type: java hashtable + } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){ + $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']); + foreach($children as $child_pos){ + $kv = explode("|",$this->message[$child_pos]['children']); + $params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result']; + } + // generic compound type + //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') { + } else { + // Apache Vector type: treat as an array + $this->debug('in buildVal, adding Java Vector or generic compound type '.$this->message[$pos]['name']); + if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') { + $notstruct = 1; + } else { + $notstruct = 0; + } + // + foreach($children as $child_pos){ + if($notstruct){ + $params[] = &$this->message[$child_pos]['result']; + } else { + if (isset($params[$this->message[$child_pos]['name']])) { + // de-serialize repeated element name into an array + if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) { + $params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]); + } + $params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result']; + } else { + $params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result']; + } + } + } + } + if (isset($this->message[$pos]['xattrs'])) { + $this->debug('in buildVal, handling attributes'); + foreach ($this->message[$pos]['xattrs'] as $n => $v) { + $params[$n] = $v; + } + } + // handle simpleContent + if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') { + $this->debug('in buildVal, handling simpleContent'); + if (isset($this->message[$pos]['type'])) { + $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + } else { + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + } else { + $params['!'] = $this->message[$pos]['cdata']; + } + } + } + $ret = is_array($params) ? $params : array(); + $this->debug('in buildVal, return:'); + $this->appendDebug($this->varDump($ret)); + return $ret; + } else { + $this->debug('in buildVal, no children, building scalar'); + $cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : ''; + if (isset($this->message[$pos]['type'])) { + $ret = $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : ''); + $this->debug("in buildVal, return: $ret"); + return $ret; + } + $parent = $this->message[$pos]['parent']; + if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) { + $ret = $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : ''); + $this->debug("in buildVal, return: $ret"); + return $ret; + } + $ret = $this->message[$pos]['cdata']; + $this->debug("in buildVal, return: $ret"); + return $ret; + } + } +} + +/** + * Backward compatibility + */ +class soap_parser extends nusoap_parser { +} + +?>call( string methodname [ ,array parameters] ); +* +* // bye bye client +* unset($soapclient); +* +* @author Dietrich Ayala +* @author Scott Nichol +* @version $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_client extends nusoap_base { + + var $username = ''; // Username for HTTP authentication + var $password = ''; // Password for HTTP authentication + var $authtype = ''; // Type of HTTP authentication + var $certRequest = array(); // Certificate for HTTP SSL authentication + var $requestHeaders = false; // SOAP headers in request (text) + var $responseHeaders = ''; // SOAP headers from response (incomplete namespace resolution) (text) + var $responseHeader = NULL; // SOAP Header from response (parsed) + var $document = ''; // SOAP body response portion (incomplete namespace resolution) (text) + var $endpoint; + var $forceEndpoint = ''; // overrides WSDL endpoint + var $proxyhost = ''; + var $proxyport = ''; + var $proxyusername = ''; + var $proxypassword = ''; + var $portName = ''; // port name to use in WSDL + var $xml_encoding = ''; // character set encoding of incoming (response) messages + var $http_encoding = false; + var $timeout = 0; // HTTP connection timeout + var $response_timeout = 30; // HTTP response timeout + var $endpointType = ''; // soap|wsdl, empty for WSDL initialization error + var $persistentConnection = false; + var $defaultRpcParams = false; // This is no longer used + var $request = ''; // HTTP request + var $response = ''; // HTTP response + var $responseData = ''; // SOAP payload of response + var $cookies = array(); // Cookies from response or for request + var $decode_utf8 = true; // toggles whether the parser decodes element content w/ utf8_decode() + var $operations = array(); // WSDL operations, empty for WSDL initialization error + var $curl_options = array(); // User-specified cURL options + var $bindingType = ''; // WSDL operation binding type + var $use_curl = false; // whether to always try to use cURL + + /* + * fault related variables + */ + /** + * @var fault + * @access public + */ + var $fault; + /** + * @var faultcode + * @access public + */ + var $faultcode; + /** + * @var faultstring + * @access public + */ + var $faultstring; + /** + * @var faultdetail + * @access public + */ + var $faultdetail; + + /** + * constructor + * + * @param mixed $endpoint SOAP server or WSDL URL (string), or wsdl instance (object) + * @param mixed $wsdl optional, set to 'wsdl' or true if using WSDL + * @param string $proxyhost optional + * @param string $proxyport optional + * @param string $proxyusername optional + * @param string $proxypassword optional + * @param integer $timeout set the connection timeout + * @param integer $response_timeout set the response timeout + * @param string $portName optional portName in WSDL document + * @access public + */ + function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ + parent::nusoap_base(); + $this->endpoint = $endpoint; + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + $this->timeout = $timeout; + $this->response_timeout = $response_timeout; + $this->portName = $portName; + + $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); + $this->appendDebug('endpoint=' . $this->varDump($endpoint)); + + // make values + if($wsdl){ + if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) { + $this->wsdl = $endpoint; + $this->endpoint = $this->wsdl->wsdl; + $this->wsdlFile = $this->endpoint; + $this->debug('existing wsdl instance created from ' . $this->endpoint); + $this->checkWSDL(); + } else { + $this->wsdlFile = $this->endpoint; + $this->wsdl = null; + $this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint); + } + $this->endpointType = 'wsdl'; + } else { + $this->debug("instantiate SOAP with endpoint at $endpoint"); + $this->endpointType = 'soap'; + } + } + + /** + * calls method, returns PHP native type + * + * @param string $operation SOAP server URL or path + * @param mixed $params An array, associative or simple, of the parameters + * for the method call, or a string that is the XML + * for the call. For rpc style, this call will + * wrap the XML in a tag named after the method, as + * well as the SOAP Envelope and Body. For document + * style, this will only wrap with the Envelope and Body. + * IMPORTANT: when using an array with document style, + * in which case there + * is really one parameter, the root of the fragment + * used in the call, which encloses what programmers + * normally think of parameters. A parameter array + * *must* include the wrapper. + * @param string $namespace optional method namespace (WSDL can override) + * @param string $soapAction optional SOAPAction value (WSDL can override) + * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array + * @param boolean $rpcParams optional (no longer used) + * @param string $style optional (rpc|document) the style to use when serializing parameters (WSDL can override) + * @param string $use optional (encoded|literal) the use when serializing parameters (WSDL can override) + * @return mixed response from SOAP call, normally an associative array mirroring the structure of the XML response, false for certain fatal errors + * @access public + */ + function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAction='',$headers=false,$rpcParams=null,$style='rpc',$use='encoded'){ + $this->operation = $operation; + $this->fault = false; + $this->setError(''); + $this->request = ''; + $this->response = ''; + $this->responseData = ''; + $this->faultstring = ''; + $this->faultcode = ''; + $this->opData = array(); + + $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType"); + $this->appendDebug('params=' . $this->varDump($params)); + $this->appendDebug('headers=' . $this->varDump($headers)); + if ($headers) { + $this->requestHeaders = $headers; + } + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) + return false; + } + // serialize parameters + if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){ + // use WSDL for operation + $this->opData = $opData; + $this->debug("found operation"); + $this->appendDebug('opData=' . $this->varDump($opData)); + if (isset($opData['soapAction'])) { + $soapAction = $opData['soapAction']; + } + if (! $this->forceEndpoint) { + $this->endpoint = $opData['endpoint']; + } else { + $this->endpoint = $this->forceEndpoint; + } + $namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] : $namespace; + $style = $opData['style']; + $use = $opData['input']['use']; + // add ns to ns array + if($namespace != '' && !isset($this->wsdl->namespaces[$namespace])){ + $nsPrefix = 'ns' . rand(1000, 9999); + $this->wsdl->namespaces[$nsPrefix] = $namespace; + } + $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace); + // serialize payload + if (is_string($params)) { + $this->debug("serializing param string for WSDL operation $operation"); + $payload = $params; + } elseif (is_array($params)) { + $this->debug("serializing param array for WSDL operation $operation"); + $payload = $this->wsdl->serializeRPCParameters($operation,'input',$params,$this->bindingType); + } else { + $this->debug('params must be array or string'); + $this->setError('params must be array or string'); + return false; + } + $usedNamespaces = $this->wsdl->usedNamespaces; + if (isset($opData['input']['encodingStyle'])) { + $encodingStyle = $opData['input']['encodingStyle']; + } else { + $encodingStyle = ''; + } + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + if ($errstr = $this->wsdl->getError()) { + $this->debug('got wsdl error: '.$errstr); + $this->setError('wsdl error: '.$errstr); + return false; + } + } elseif($this->endpointType == 'wsdl') { + // operation not in WSDL + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->setError('operation '.$operation.' not present in WSDL.'); + $this->debug("operation '$operation' not present in WSDL."); + return false; + } else { + // no WSDL + //$this->namespaces['ns1'] = $namespace; + $nsPrefix = 'ns' . rand(1000, 9999); + // serialize + $payload = ''; + if (is_string($params)) { + $this->debug("serializing param string for operation $operation"); + $payload = $params; + } elseif (is_array($params)) { + $this->debug("serializing param array for operation $operation"); + foreach($params as $k => $v){ + $payload .= $this->serialize_val($v,$k,false,false,false,false,$use); + } + } else { + $this->debug('params must be array or string'); + $this->setError('params must be array or string'); + return false; + } + $usedNamespaces = array(); + if ($use == 'encoded') { + $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; + } else { + $encodingStyle = ''; + } + } + // wrap RPC calls with method element + if ($style == 'rpc') { + if ($use == 'literal') { + $this->debug("wrapping RPC request with literal method element"); + if ($namespace) { + // http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html R2735 says rpc/literal accessor elements should not be in a namespace + $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" . + $payload . + ""; + } else { + $payload = "<$operation>" . $payload . ""; + } + } else { + $this->debug("wrapping RPC request with encoded method element"); + if ($namespace) { + $payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" . + $payload . + ""; + } else { + $payload = "<$operation>" . + $payload . + ""; + } + } + } + // serialize envelope + $soapmsg = $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle); + $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle"); + $this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000)); + // send + $return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout); + if($errstr = $this->getError()){ + $this->debug('Error: '.$errstr); + return false; + } else { + $this->return = $return; + $this->debug('sent message successfully and got a(n) '.gettype($return)); + $this->appendDebug('return=' . $this->varDump($return)); + + // fault? + if(is_array($return) && isset($return['faultcode'])){ + $this->debug('got fault'); + $this->setError($return['faultcode'].': '.$return['faultstring']); + $this->fault = true; + foreach($return as $k => $v){ + $this->$k = $v; + $this->debug("$k = $v
        "); + } + return $return; + } elseif ($style == 'document') { + // NOTE: if the response is defined to have multiple parts (i.e. unwrapped), + // we are only going to return the first part here...sorry about that + return $return; + } else { + // array of return values + if(is_array($return)){ + // multiple 'out' parameters, which we return wrapped up + // in the array + if(sizeof($return) > 1){ + return $return; + } + // single 'out' parameter (normally the return value) + $return = array_shift($return); + $this->debug('return shifted value: '); + $this->appendDebug($this->varDump($return)); + return $return; + // nothing returned (ie, echoVoid) + } else { + return ""; + } + } + } + } + + /** + * check WSDL passed as an instance or pulled from an endpoint + * + * @access private + */ + function checkWSDL() { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('checkWSDL'); + // catch errors + if ($errstr = $this->wsdl->getError()) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('got wsdl error: '.$errstr); + $this->setError('wsdl error: '.$errstr); + } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap')) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->bindingType = 'soap'; + $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType); + } elseif ($this->operations = $this->wsdl->getOperations($this->portName, 'soap12')) { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->bindingType = 'soap12'; + $this->debug('got '.count($this->operations).' operations from wsdl '.$this->wsdlFile.' for binding type '.$this->bindingType); + $this->debug('**************** WARNING: SOAP 1.2 BINDING *****************'); + } else { + $this->appendDebug($this->wsdl->getDebug()); + $this->wsdl->clearDebug(); + $this->debug('getOperations returned false'); + $this->setError('no operations defined in the WSDL document!'); + } + } + + /** + * instantiate wsdl object and parse wsdl file + * + * @access public + */ + function loadWSDL() { + $this->debug('instantiating wsdl class with doc: '.$this->wsdlFile); + $this->wsdl = new wsdl('',$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout,$this->curl_options,$this->use_curl); + $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest); + $this->wsdl->fetchWSDL($this->wsdlFile); + $this->checkWSDL(); + } + + /** + * get available data pertaining to an operation + * + * @param string $operation operation name + * @return array array of data pertaining to the operation + * @access public + */ + function getOperationData($operation){ + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) + return false; + } + if(isset($this->operations[$operation])){ + return $this->operations[$operation]; + } + $this->debug("No data for operation: $operation"); + } + + /** + * send the SOAP message + * + * Note: if the operation has multiple return values + * the return value of this method will be an array + * of those values. + * + * @param string $msg a SOAPx4 soapmsg object + * @param string $soapaction SOAPAction value + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @return mixed native PHP types. + * @access private + */ + function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) { + $this->checkCookies(); + // detect transport + switch(true){ + // http(s) + case preg_match('/^http/',$this->endpoint): + $this->debug('transporting via HTTP'); + if($this->persistentConnection == true && is_object($this->persistentConnection)){ + $http =& $this->persistentConnection; + } else { + $http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl); + if ($this->persistentConnection) { + $http->usePersistentConnection(); + } + } + $http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset()); + $http->setSOAPAction($soapaction); + if($this->proxyhost && $this->proxyport){ + $http->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword); + } + if($this->authtype != '') { + $http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest); + } + if($this->http_encoding != ''){ + $http->setEncoding($this->http_encoding); + } + $this->debug('sending message, length='.strlen($msg)); + if(preg_match('/^http:/',$this->endpoint)){ + //if(strpos($this->endpoint,'http:')){ + $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies); + } elseif(preg_match('/^https/',$this->endpoint)){ + //} elseif(strpos($this->endpoint,'https:')){ + //if(phpversion() == '4.3.0-dev'){ + //$response = $http->send($msg,$timeout,$response_timeout); + //$this->request = $http->outgoing_payload; + //$this->response = $http->incoming_payload; + //} else + $this->responseData = $http->sendHTTPS($msg,$timeout,$response_timeout,$this->cookies); + } else { + $this->setError('no http/s in endpoint url'); + } + $this->request = $http->outgoing_payload; + $this->response = $http->incoming_payload; + $this->appendDebug($http->getDebug()); + $this->UpdateCookies($http->incoming_cookies); + + // save transport object if using persistent connections + if ($this->persistentConnection) { + $http->clearDebug(); + if (!is_object($this->persistentConnection)) { + $this->persistentConnection = $http; + } + } + + if($err = $http->getError()){ + $this->setError('HTTP Error: '.$err); + return false; + } elseif($this->getError()){ + return false; + } else { + $this->debug('got response, length='. strlen($this->responseData).' type='.$http->incoming_headers['content-type']); + return $this->parseResponse($http->incoming_headers, $this->responseData); + } + break; + default: + $this->setError('no transport found, or selected transport is not yet supported!'); + return false; + break; + } + } + + /** + * processes SOAP message returned from server + * + * @param array $headers The HTTP headers + * @param string $data unprocessed response data from server + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseResponse($headers, $data) { + $this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' headers:'); + $this->appendDebug($this->varDump($headers)); + if (!isset($headers['content-type'])) { + $this->setError('Response not of type text/xml (no content-type header)'); + return false; + } + if (!strstr($headers['content-type'], 'text/xml')) { + $this->setError('Response not of type text/xml: ' . $headers['content-type']); + return false; + } + if (strpos($headers['content-type'], '=')) { + $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); + $this->debug('Got response encoding: ' . $enc); + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){ + $this->xml_encoding = strtoupper($enc); + } else { + $this->xml_encoding = 'US-ASCII'; + } + } else { + // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1 + $this->xml_encoding = 'ISO-8859-1'; + } + $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser'); + $parser = new nusoap_parser($data,$this->xml_encoding,$this->operation,$this->decode_utf8); + // add parser debug data to our debug + $this->appendDebug($parser->getDebug()); + // if parse errors + if($errstr = $parser->getError()){ + $this->setError( $errstr); + // destroy the parser object + unset($parser); + return false; + } else { + // get SOAP headers + $this->responseHeaders = $parser->getHeaders(); + // get SOAP headers + $this->responseHeader = $parser->get_soapheader(); + // get decoded message + $return = $parser->get_soapbody(); + // add document for doclit support + $this->document = $parser->document; + // destroy the parser object + unset($parser); + // return decode message + return $return; + } + } + + /** + * sets user-specified cURL options + * + * @param mixed $option The cURL option (always integer?) + * @param mixed $value The cURL option value + * @access public + */ + function setCurlOption($option, $value) { + $this->debug("setCurlOption option=$option, value="); + $this->appendDebug($this->varDump($value)); + $this->curl_options[$option] = $value; + } + + /** + * sets the SOAP endpoint, which can override WSDL + * + * @param string $endpoint The endpoint URL to use, or empty string or false to prevent override + * @access public + */ + function setEndpoint($endpoint) { + $this->debug("setEndpoint(\"$endpoint\")"); + $this->forceEndpoint = $endpoint; + } + + /** + * set the SOAP headers + * + * @param mixed $headers String of XML with SOAP header content, or array of soapval objects for SOAP headers + * @access public + */ + function setHeaders($headers){ + $this->debug("setHeaders headers="); + $this->appendDebug($this->varDump($headers)); + $this->requestHeaders = $headers; + } + + /** + * get the SOAP response headers (namespace resolution incomplete) + * + * @return string + * @access public + */ + function getHeaders(){ + return $this->responseHeaders; + } + + /** + * get the SOAP response Header (parsed) + * + * @return mixed + * @access public + */ + function getHeader(){ + return $this->responseHeader; + } + + /** + * set proxy info here + * + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @access public + */ + function setHTTPProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { + $this->proxyhost = $proxyhost; + $this->proxyport = $proxyport; + $this->proxyusername = $proxyusername; + $this->proxypassword = $proxypassword; + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic|digest|certificate|ntlm) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) { + $this->debug("setCredentials username=$username authtype=$authtype certRequest="); + $this->appendDebug($this->varDump($certRequest)); + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->certRequest = $certRequest; + } + + /** + * use HTTP encoding + * + * @param string $enc HTTP encoding + * @access public + */ + function setHTTPEncoding($enc='gzip, deflate'){ + $this->debug("setHTTPEncoding(\"$enc\")"); + $this->http_encoding = $enc; + } + + /** + * Set whether to try to use cURL connections if possible + * + * @param boolean $use Whether to try to use cURL + * @access public + */ + function setUseCURL($use) { + $this->debug("setUseCURL($use)"); + $this->use_curl = $use; + } + + /** + * use HTTP persistent connections if possible + * + * @access public + */ + function useHTTPPersistentConnection(){ + $this->debug("useHTTPPersistentConnection"); + $this->persistentConnection = true; + } + + /** + * gets the default RPC parameter setting. + * If true, default is that call params are like RPC even for document style. + * Each call() can override this value. + * + * This is no longer used. + * + * @return boolean + * @access public + * @deprecated + */ + function getDefaultRpcParams() { + return $this->defaultRpcParams; + } + + /** + * sets the default RPC parameter setting. + * If true, default is that call params are like RPC even for document style + * Each call() can override this value. + * + * This is no longer used. + * + * @param boolean $rpcParams + * @access public + * @deprecated + */ + function setDefaultRpcParams($rpcParams) { + $this->defaultRpcParams = $rpcParams; + } + + /** + * dynamically creates an instance of a proxy class, + * allowing user to directly call methods from wsdl + * + * @return object soap_proxy object + * @access public + */ + function getProxy() { + $r = rand(); + $evalStr = $this->_getProxyClassCode($r); + //$this->debug("proxy class: $evalStr"); + if ($this->getError()) { + $this->debug("Error from _getProxyClassCode, so return NULL"); + return null; + } + // eval the class + eval($evalStr); + // instantiate proxy object + eval("\$proxy = new nusoap_proxy_$r('');"); + // transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice + $proxy->endpointType = 'wsdl'; + $proxy->wsdlFile = $this->wsdlFile; + $proxy->wsdl = $this->wsdl; + $proxy->operations = $this->operations; + $proxy->defaultRpcParams = $this->defaultRpcParams; + // transfer other state + $proxy->soap_defencoding = $this->soap_defencoding; + $proxy->username = $this->username; + $proxy->password = $this->password; + $proxy->authtype = $this->authtype; + $proxy->certRequest = $this->certRequest; + $proxy->requestHeaders = $this->requestHeaders; + $proxy->endpoint = $this->endpoint; + $proxy->forceEndpoint = $this->forceEndpoint; + $proxy->proxyhost = $this->proxyhost; + $proxy->proxyport = $this->proxyport; + $proxy->proxyusername = $this->proxyusername; + $proxy->proxypassword = $this->proxypassword; + $proxy->http_encoding = $this->http_encoding; + $proxy->timeout = $this->timeout; + $proxy->response_timeout = $this->response_timeout; + $proxy->persistentConnection = &$this->persistentConnection; + $proxy->decode_utf8 = $this->decode_utf8; + $proxy->curl_options = $this->curl_options; + $proxy->bindingType = $this->bindingType; + $proxy->use_curl = $this->use_curl; + return $proxy; + } + + /** + * dynamically creates proxy class code + * + * @return string PHP/NuSOAP code for the proxy class + * @access private + */ + function _getProxyClassCode($r) { + $this->debug("in getProxy endpointType=$this->endpointType"); + $this->appendDebug("wsdl=" . $this->varDump($this->wsdl)); + if ($this->endpointType != 'wsdl') { + $evalStr = 'A proxy can only be created for a WSDL client'; + $this->setError($evalStr); + $evalStr = "echo \"$evalStr\";"; + return $evalStr; + } + if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { + $this->loadWSDL(); + if ($this->getError()) { + return "echo \"" . $this->getError() . "\";"; + } + } + $evalStr = ''; + foreach ($this->operations as $operation => $opData) { + if ($operation != '') { + // create param string and param comment string + if (sizeof($opData['input']['parts']) > 0) { + $paramStr = ''; + $paramArrayStr = ''; + $paramCommentStr = ''; + foreach ($opData['input']['parts'] as $name => $type) { + $paramStr .= "\$$name, "; + $paramArrayStr .= "'$name' => \$$name, "; + $paramCommentStr .= "$type \$$name, "; + } + $paramStr = substr($paramStr, 0, strlen($paramStr)-2); + $paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2); + $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2); + } else { + $paramStr = ''; + $paramArrayStr = ''; + $paramCommentStr = 'void'; + } + $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace']; + $evalStr .= "// $paramCommentStr + function " . str_replace('.', '__', $operation) . "($paramStr) { + \$params = array($paramArrayStr); + return \$this->call('$operation', \$params, '".$opData['namespace']."', '".(isset($opData['soapAction']) ? $opData['soapAction'] : '')."'); + } + "; + unset($paramStr); + unset($paramCommentStr); + } + } + $evalStr = 'class nusoap_proxy_'.$r.' extends nusoap_client { + '.$evalStr.' +}'; + return $evalStr; + } + + /** + * dynamically creates proxy class code + * + * @return string PHP/NuSOAP code for the proxy class + * @access public + */ + function getProxyClassCode() { + $r = rand(); + return $this->_getProxyClassCode($r); + } + + /** + * gets the HTTP body for the current request. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + return $soapmsg; + } + + /** + * gets the HTTP content type for the current request. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current request. + * @access private + */ + function getHTTPContentType() { + return 'text/xml'; + } + + /** + * gets the HTTP content type charset for the current request. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current request. + * @access private + */ + function getHTTPContentTypeCharset() { + return $this->soap_defencoding; + } + + /* + * whether or not parser should decode utf8 element content + * + * @return always returns true + * @access public + */ + function decodeUTF8($bool){ + $this->decode_utf8 = $bool; + return true; + } + + /** + * adds a new Cookie into $this->cookies array + * + * @param string $name Cookie Name + * @param string $value Cookie Value + * @return boolean if cookie-set was successful returns true, else false + * @access public + */ + function setCookie($name, $value) { + if (strlen($name) == 0) { + return false; + } + $this->cookies[] = array('name' => $name, 'value' => $value); + return true; + } + + /** + * gets all Cookies + * + * @return array with all internal cookies + * @access public + */ + function getCookies() { + return $this->cookies; + } + + /** + * checks all Cookies and delete those which are expired + * + * @return boolean always return true + * @access private + */ + function checkCookies() { + if (sizeof($this->cookies) == 0) { + return true; + } + $this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies'); + $curr_cookies = $this->cookies; + $this->cookies = array(); + foreach ($curr_cookies as $cookie) { + if (! is_array($cookie)) { + $this->debug('Remove cookie that is not an array'); + continue; + } + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) > time()) { + $this->cookies[] = $cookie; + } else { + $this->debug('Remove expired cookie ' . $cookie['name']); + } + } else { + $this->cookies[] = $cookie; + } + } + $this->debug('checkCookie: '.sizeof($this->cookies).' cookies left in array'); + return true; + } + + /** + * updates the current cookies with a new set + * + * @param array $cookies new cookies with which to update current ones + * @return boolean always return true + * @access private + */ + function UpdateCookies($cookies) { + if (sizeof($this->cookies) == 0) { + // no existing cookies: take whatever is new + if (sizeof($cookies) > 0) { + $this->debug('Setting new cookie(s)'); + $this->cookies = $cookies; + } + return true; + } + if (sizeof($cookies) == 0) { + // no new cookies: keep what we've got + return true; + } + // merge + foreach ($cookies as $newCookie) { + if (!is_array($newCookie)) { + continue; + } + if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) { + continue; + } + $newName = $newCookie['name']; + + $found = false; + for ($i = 0; $i < count($this->cookies); $i++) { + $cookie = $this->cookies[$i]; + if (!is_array($cookie)) { + continue; + } + if (!isset($cookie['name'])) { + continue; + } + if ($newName != $cookie['name']) { + continue; + } + $newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN'; + $domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN'; + if ($newDomain != $domain) { + continue; + } + $newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH'; + $path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH'; + if ($newPath != $path) { + continue; + } + $this->cookies[$i] = $newCookie; + $found = true; + $this->debug('Update cookie ' . $newName . '=' . $newCookie['value']); + break; + } + if (! $found) { + $this->debug('Add cookie ' . $newName . '=' . $newCookie['value']); + $this->cookies[] = $newCookie; + } + } + return true; + } +} + +if (!extension_loaded('soap')) { + /** + * For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded. + */ + class soapclient extends nusoap_client { + } +} +?> diff --git a/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoapmime.php b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoapmime.php new file mode 100755 index 000000000..cdb1afc51 --- /dev/null +++ b/modules/mondialrelay/kit_mondialrelay/tools/nusoap/lib/nusoapmime.php @@ -0,0 +1,501 @@ + +* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list +* @version $Id: nusoapmime.php,v 1.13 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_client_mime extends nusoap_client { + /** + * @var array Each array element in the return is an associative array with keys + * data, filename, contenttype, cid + * @access private + */ + var $requestAttachments = array(); + /** + * @var array Each array element in the return is an associative array with keys + * data, filename, contenttype, cid + * @access private + */ + var $responseAttachments; + /** + * @var string + * @access private + */ + var $mimeContentType; + + /** + * adds a MIME attachment to the current request. + * + * If the $data parameter contains an empty string, this method will read + * the contents of the file named by the $filename parameter. + * + * If the $cid parameter is false, this method will generate the cid. + * + * @param string $data The data of the attachment + * @param string $filename The filename of the attachment (default is empty string) + * @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream) + * @param string $cid The content-id (cid) of the attachment (default is false) + * @return string The content-id (cid) of the attachment + * @access public + */ + function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) { + if (! $cid) { + $cid = md5(uniqid(time())); + } + + $info['data'] = $data; + $info['filename'] = $filename; + $info['contenttype'] = $contenttype; + $info['cid'] = $cid; + + $this->requestAttachments[] = $info; + + return $cid; + } + + /** + * clears the MIME attachments for the current request. + * + * @access public + */ + function clearAttachments() { + $this->requestAttachments = array(); + } + + /** + * gets the MIME attachments from the current response. + * + * Each array element in the return is an associative array with keys + * data, filename, contenttype, cid. These keys correspond to the parameters + * for addAttachment. + * + * @return array The attachments. + * @access public + */ + function getAttachments() { + return $this->responseAttachments; + } + + /** + * gets the HTTP body for the current request. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + if (count($this->requestAttachments) > 0) { + $params['content_type'] = 'multipart/related; type="text/xml"'; + $mimeMessage = new Mail_mimePart('', $params); + unset($params); + + $params['content_type'] = 'text/xml'; + $params['encoding'] = '8bit'; + $params['charset'] = $this->soap_defencoding; + $mimeMessage->addSubpart($soapmsg, $params); + + foreach ($this->requestAttachments as $att) { + unset($params); + + $params['content_type'] = $att['contenttype']; + $params['encoding'] = 'base64'; + $params['disposition'] = 'attachment'; + $params['dfilename'] = $att['filename']; + $params['cid'] = $att['cid']; + + if ($att['data'] == '' && $att['filename'] <> '') { + if ($fd = fopen($att['filename'], 'rb')) { + $data = fread($fd, filesize($att['filename'])); + fclose($fd); + } else { + $data = ''; + } + $mimeMessage->addSubpart($data, $params); + } else { + $mimeMessage->addSubpart($att['data'], $params); + } + } + + $output = $mimeMessage->encode(); + $mimeHeaders = $output['headers']; + + foreach ($mimeHeaders as $k => $v) { + $this->debug("MIME header $k: $v"); + if (strtolower($k) == 'content-type') { + // PHP header() seems to strip leading whitespace starting + // the second line, so force everything to one line + $this->mimeContentType = str_replace("\r\n", " ", $v); + } + } + + return $output['body']; + } + + return parent::getHTTPBody($soapmsg); + } + + /** + * gets the HTTP content type for the current request. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current request. + * @access private + */ + function getHTTPContentType() { + if (count($this->requestAttachments) > 0) { + return $this->mimeContentType; + } + return parent::getHTTPContentType(); + } + + /** + * gets the HTTP content type charset for the current request. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current request. + * @access private + */ + function getHTTPContentTypeCharset() { + if (count($this->requestAttachments) > 0) { + return false; + } + return parent::getHTTPContentTypeCharset(); + } + + /** + * processes SOAP message returned from server + * + * @param array $headers The HTTP headers + * @param string $data unprocessed response data from server + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseResponse($headers, $data) { + $this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']); + $this->responseAttachments = array(); + if (strstr($headers['content-type'], 'multipart/related')) { + $this->debug('Decode multipart/related'); + $input = ''; + foreach ($headers as $k => $v) { + $input .= "$k: $v\r\n"; + } + $params['input'] = $input . "\r\n" . $data; + $params['include_bodies'] = true; + $params['decode_bodies'] = true; + $params['decode_headers'] = true; + + $structure = Mail_mimeDecode::decode($params); + + foreach ($structure->parts as $part) { + if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) { + $this->debug('Have root part of type ' . $part->headers['content-type']); + $root = $part->body; + $return = parent::parseResponse($part->headers, $part->body); + } else { + $this->debug('Have an attachment of type ' . $part->headers['content-type']); + $info['data'] = $part->body; + $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : ''; + $info['contenttype'] = $part->headers['content-type']; + $info['cid'] = $part->headers['content-id']; + $this->responseAttachments[] = $info; + } + } + + if (isset($return)) { + $this->responseData = $root; + return $return; + } + + $this->setError('No root part found in multipart/related content'); + return ''; + } + $this->debug('Not multipart/related'); + return parent::parseResponse($headers, $data); + } +} + +/* + * For backwards compatiblity, define soapclientmime unless the PHP SOAP extension is loaded. + */ +if (!extension_loaded('soap')) { + class soapclientmime extends nusoap_client_mime { + } +} + +/** +* nusoap_server_mime server supporting MIME attachments defined at +* http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library. +* +* @author Scott Nichol +* @author Thanks to Guillaume and Henning Reich for posting great attachment code to the mail list +* @version $Id: nusoapmime.php,v 1.13 2010/04/26 20:15:08 snichol Exp $ +* @access public +*/ +class nusoap_server_mime extends nusoap_server { + /** + * @var array Each array element in the return is an associative array with keys + * data, filename, contenttype, cid + * @access private + */ + var $requestAttachments = array(); + /** + * @var array Each array element in the return is an associative array with keys + * data, filename, contenttype, cid + * @access private + */ + var $responseAttachments; + /** + * @var string + * @access private + */ + var $mimeContentType; + + /** + * adds a MIME attachment to the current response. + * + * If the $data parameter contains an empty string, this method will read + * the contents of the file named by the $filename parameter. + * + * If the $cid parameter is false, this method will generate the cid. + * + * @param string $data The data of the attachment + * @param string $filename The filename of the attachment (default is empty string) + * @param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream) + * @param string $cid The content-id (cid) of the attachment (default is false) + * @return string The content-id (cid) of the attachment + * @access public + */ + function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) { + if (! $cid) { + $cid = md5(uniqid(time())); + } + + $info['data'] = $data; + $info['filename'] = $filename; + $info['contenttype'] = $contenttype; + $info['cid'] = $cid; + + $this->responseAttachments[] = $info; + + return $cid; + } + + /** + * clears the MIME attachments for the current response. + * + * @access public + */ + function clearAttachments() { + $this->responseAttachments = array(); + } + + /** + * gets the MIME attachments from the current request. + * + * Each array element in the return is an associative array with keys + * data, filename, contenttype, cid. These keys correspond to the parameters + * for addAttachment. + * + * @return array The attachments. + * @access public + */ + function getAttachments() { + return $this->requestAttachments; + } + + /** + * gets the HTTP body for the current response. + * + * @param string $soapmsg The SOAP payload + * @return string The HTTP body, which includes the SOAP payload + * @access private + */ + function getHTTPBody($soapmsg) { + if (count($this->responseAttachments) > 0) { + $params['content_type'] = 'multipart/related; type="text/xml"'; + $mimeMessage = new Mail_mimePart('', $params); + unset($params); + + $params['content_type'] = 'text/xml'; + $params['encoding'] = '8bit'; + $params['charset'] = $this->soap_defencoding; + $mimeMessage->addSubpart($soapmsg, $params); + + foreach ($this->responseAttachments as $att) { + unset($params); + + $params['content_type'] = $att['contenttype']; + $params['encoding'] = 'base64'; + $params['disposition'] = 'attachment'; + $params['dfilename'] = $att['filename']; + $params['cid'] = $att['cid']; + + if ($att['data'] == '' && $att['filename'] <> '') { + if ($fd = fopen($att['filename'], 'rb')) { + $data = fread($fd, filesize($att['filename'])); + fclose($fd); + } else { + $data = ''; + } + $mimeMessage->addSubpart($data, $params); + } else { + $mimeMessage->addSubpart($att['data'], $params); + } + } + + $output = $mimeMessage->encode(); + $mimeHeaders = $output['headers']; + + foreach ($mimeHeaders as $k => $v) { + $this->debug("MIME header $k: $v"); + if (strtolower($k) == 'content-type') { + // PHP header() seems to strip leading whitespace starting + // the second line, so force everything to one line + $this->mimeContentType = str_replace("\r\n", " ", $v); + } + } + + return $output['body']; + } + + return parent::getHTTPBody($soapmsg); + } + + /** + * gets the HTTP content type for the current response. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type for the current response. + * @access private + */ + function getHTTPContentType() { + if (count($this->responseAttachments) > 0) { + return $this->mimeContentType; + } + return parent::getHTTPContentType(); + } + + /** + * gets the HTTP content type charset for the current response. + * returns false for non-text content types. + * + * Note: getHTTPBody must be called before this. + * + * @return string the HTTP content type charset for the current response. + * @access private + */ + function getHTTPContentTypeCharset() { + if (count($this->responseAttachments) > 0) { + return false; + } + return parent::getHTTPContentTypeCharset(); + } + + /** + * processes SOAP message received from client + * + * @param array $headers The HTTP headers + * @param string $data unprocessed request data from client + * @return mixed value of the message, decoded into a PHP type + * @access private + */ + function parseRequest($headers, $data) { + $this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']); + $this->requestAttachments = array(); + if (strstr($headers['content-type'], 'multipart/related')) { + $this->debug('Decode multipart/related'); + $input = ''; + foreach ($headers as $k => $v) { + $input .= "$k: $v\r\n"; + } + $params['input'] = $input . "\r\n" . $data; + $params['include_bodies'] = true; + $params['decode_bodies'] = true; + $params['decode_headers'] = true; + + $structure = Mail_mimeDecode::decode($params); + + foreach ($structure->parts as $part) { + if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) { + $this->debug('Have root part of type ' . $part->headers['content-type']); + $return = parent::parseRequest($part->headers, $part->body); + } else { + $this->debug('Have an attachment of type ' . $part->headers['content-type']); + $info['data'] = $part->body; + $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : ''; + $info['contenttype'] = $part->headers['content-type']; + $info['cid'] = $part->headers['content-id']; + $this->requestAttachments[] = $info; + } + } + + if (isset($return)) { + return $return; + } + + $this->setError('No root part found in multipart/related content'); + return; + } + $this->debug('Not multipart/related'); + return parent::parseRequest($headers, $data); + } +} + +/* + * For backwards compatiblity + */ +class nusoapservermime extends nusoap_server_mime { +} + +?> diff --git a/modules/mondialrelay/logo.gif b/modules/mondialrelay/logo.gif new file mode 100755 index 000000000..06f847112 Binary files /dev/null and b/modules/mondialrelay/logo.gif differ diff --git a/modules/mondialrelay/mondialrelay.php b/modules/mondialrelay/mondialrelay.php new file mode 100755 index 000000000..6a9be6b08 --- /dev/null +++ b/modules/mondialrelay/mondialrelay.php @@ -0,0 +1,891 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class MondialRelay extends Module +{ + const INSTALL_SQL_FILE = 'mrInstall.sql'; + + private $_postErrors; + + public function __construct() + { + $this->name = 'mondialrelay'; + $this->tab = 'shipping_logistics'; + $this->version = '1.3'; + + parent::__construct(); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Mondial Relay'); + $this->description = $this->l('Deliver in Relay points'); + + if (!defined('_MR_CSS_')) + define('_MR_CSS_', dirname(__FILE__) . '/style.css'); + if (Module::isInstalled('mondialrelay') AND !Configuration::get('MONDIAL_RELAY_1_4')) + { + $this->update_v1_4(); + Configuration::updateValue('MONDIAL_RELAY_1_4', 1); + } + } + + public function install() + { + global $cookie; + $name = "shipping"; + $title = "Mondial Relay API"; + + if (!parent::install()) + return false; + + Db::getInstance()->ExecuteS( + 'SELECT `name` + FROM `' . _DB_PREFIX_ . 'hook` + WHERE `name` = \''.$name.'\' + AND `title` = \''.$title.'\''); + + if (!Db::getInstance()->NumRows()) + Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'hook + (name, title, description, position) + VALUES(\''.$name.'\', \''.$title.'\', NULL, 0)'); + + if (!$this->registerHook('shipping') OR + !$this->registerHook('extraCarrier') OR + !$this->registerHook('processCarrier') OR + !$this->registerHook('orderDetail') OR + !$this->registerHook('updateCarrier') OR + !$this->registerHook('orderDetailDisplayed')) + return false; + + if (!file_exists(_PS_MODULE_DIR_. '/mondialrelay/' . self::INSTALL_SQL_FILE)) + return false; + elseif(!$sql = file_get_contents(_PS_MODULE_DIR_. '/mondialrelay/' . self::INSTALL_SQL_FILE)) + return false; + + $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach($sql AS $k => $query) + if (!empty($query)) + Db::getInstance()->Execute(trim($query)); + + $result = Db::getInstance()->getRow(' + SELECT id_tab + FROM `' . _DB_PREFIX_ . 'tab` + WHERE class_name="AdminMondialRelay"'); + + if (!$result) + { + /*tab install */ + + $result = Db::getInstance()->getRow(' + SELECT position + FROM `' . _DB_PREFIX_ . 'tab` + WHERE `id_parent` = 3 + ORDER BY `'. _DB_PREFIX_ .'tab`.`position` DESC'); + + $pos = (isset($result['position'])) ? $result['position'] + 1 : 0; + + Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'tab + (id_parent, class_name, position, module) + VALUES(3, "AdminMondialRelay", "'.(int)($pos).'", "mondialrelay")'); + + $id_tab = Db::getInstance()->Insert_ID(); + + $languages = Language::getLanguages(); + foreach ($languages AS $language) + Db::getInstance()->Execute(' + INSERT INTO ' . _DB_PREFIX_ . 'tab_lang + (id_lang, id_tab, name) + VALUES("'.(int)($language['id_lang']).'", "'.(int)($id_tab).'", "Mondial Relay")'); + + $profiles = Profile::getProfiles(Configuration::get('PS_LANG_DEFAULT')); + foreach ($profiles as $profile) + Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'access + (`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`) + VALUES('.$profile['id_profile'].', '.(int)($id_tab).', 1, 1, 1, 1)'); + + @copy(_PS_MODULE_DIR_.'mondialrelay/AdminMondialRelay.gif', _PS_IMG_DIR_.'t/AdminMondialRelay.gif'); + } + + Configuration::updateValue('MONDIAL_RELAY_1_4', '1'); + Configuration::updateValue('MONDIAL_RELAY_INSTALL_UPDATE_1', 1); + Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', 3); + Configuration::updateValue('MONDIAL_RELAY_SECURE_KEY', md5(time().rand(0,10))); + Configuration::updateValue('MR_GOOGLE_MAP', '1'); + Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', ''); + Configuration::updateValue('MR_CODE_MARQUE', ''); + Configuration::updateValue('MR_KEY_WEBSERVICE', ''); + Configuration::updateValue('MR_LANGUAGE', ''); + Configuration::updateValue('MR_WEIGHT_COEF', ''); + return true; + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + + /* Tab uninstallation */ + $result = Db::getInstance()->getRow(' + SELECT id_tab + FROM `' . _DB_PREFIX_ . 'tab` + WHERE class_name="AdminMondialRelay"'); + if ($result) + { + $id_tab = $result['id_tab']; + if (isset($id_tab) AND !empty($id_tab)) + { + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab WHERE id_tab = '.(int)($id_tab)); + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab_lang WHERE id_tab = '.(int)($id_tab)); + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'access WHERE id_tab = '.(int)($id_tab)); + } + } + + if (!Configuration::deleteByName('MONDIAL_RELAY_1_4') OR + !Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE') OR + !Configuration::deleteByName('MONDIAL_RELAY_SECURE_KEY') OR + !Configuration::deleteByName('MONDIAL_RELAY_ORDER_STATE') OR + !Configuration::deleteByName('MR_GOOGLE_MAP') OR + !Configuration::deleteByName('MR_ENSEIGNE_WEBSERVICE') OR + !Configuration::deleteByName('MR_CODE_MARQUE') OR + !Configuration::deleteByName('MR_KEY_WEBSERVICE') OR + !Configuration::deleteByName('MR_WEIGHT_COEF') OR + !Db::getInstance()->Execute('UPDATE '._DB_PREFIX_ .'carrier set `active` = 0, `deleted` = 1 WHERE `external_module_name` = "mondialrelay"') OR + !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_ .'mr_historique, '._DB_PREFIX_ .'mr_method, '._DB_PREFIX_ .'mr_selected')) + return false; + return true; + } + + private function update_v1_4() + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'carrier` SET `shipping_external` = 0, `need_range` = 1, `external_module_name` = "mondialrelay", `shipping_method` = 1 WHERE `id_carrier` IN (SELECT `id_mr_method` FROM `'._DB_PREFIX_.'mr_method`)'); + return true; + } + + private function _postValidation() + { + if (Tools::isSubmit('submitMR')) + { + if (Tools::getValue('mr_Enseigne_WebService') != '' AND !preg_match("#^[0-9A-Z]{2}[0-9A-Z ]{6}$#", Tools::getValue('mr_Enseigne_WebService'))) + $this->_postErrors[] = $this->l('Invalid Shop'); + if (Tools::getValue('mr_code_marque') != '' AND !preg_match("#^[0-9]{2}$#", Tools::getValue('mr_code_marque'))) + $this->_postErrors[] = $this->l('Invalid Mark code'); + if (Tools::getValue('mr_Key_WebService') != '' AND !preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Key_WebService'))) + $this->_postErrors[] = $this->l('Invalid Webservice Key'); + if (Tools::getValue('mr_Langage') != '' AND !preg_match("#^[A-Z]{2}$#", Tools::getValue('mr_Langage'))) + $this->_postErrors[] = $this->l('Invalid Language'); + if (!Tools::getValue('mr_weight_coef') OR !Validate::isInt(Tools::getValue('mr_weight_coef'))) + $this->_postErrors[] = $this->l('Invalid Weight Coefficient'); + } + elseif (Tools::isSubmit('submitMethod')) + { + if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' OR Configuration::get('MR_CODE_MARQUE') == '' OR + Configuration::get('MR_KEY_WEBSERVICE') == '' OR Configuration::get('MR_LANGUAGE') == '') + $this->_postErrors[] = $this->l('Please configure your Mondial Relay account settings before creating a carrier.'); + if (!preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Name'))) + $this->_postErrors[] = $this->l('Invalid carrier name'); + if (Tools::getValue('mr_ModeCol') != 'CCC') + $this->_postErrors[] = $this->l('Invalid Col mode'); + if (!preg_match("#^REL|24R|ESP|DRI|LDS|LDR|LD1$#", Tools::getValue('mr_ModeLiv'))) + $this->_postErrors[] = $this->l('Invalid delivery mode'); + if (!Validate::isInt(Tools::getValue('mr_ModeAss')) OR Tools::getValue('mr_ModeAss') > 5 OR Tools::getValue('mr_ModeAss') < 0) + $this->_postErrors[] = $this->l('Invalid Assurance mode'); + if (!Tools::getValue('mr_Pays_list')) + $this->_postErrors[] = $this->l('You must choose at least one delivery country.'); + } + elseif (Tools::isSubmit('submit_order_state')) + { + if (!Validate::isBool(Tools::getValue('mr_google_key'))) + $this->_postErrors[] = $this->l('Invalid google key'); + if (!Validate::isUnsignedInt(Tools::getValue('id_order_state'))) + $this->_postErrors[] = $this->l('Invalid order state'); + } + } + + private function _postProcess() + { + foreach($_POST AS $key => $value) + { + $setArray[] = $value; + $keyArray[] = pSQL($key); + } + array_pop($setArray); + array_pop($keyArray); + + if (isset($_POST['submitMR']) AND $_POST['submitMR']) + self::mrUpdate('settings', $setArray, $keyArray); + elseif (isset($_POST['submitShipping']) AND $_POST['submitShipping']) + self::mrUpdate('shipping', $_POST, array()); + elseif (isset($_POST['submitMethod']) AND $_POST['submitMethod']) + self::mrUpdate('addShipping', $setArray, $keyArray); + elseif (isset($_POST['submit_order_state']) AND $_POST['submit_order_state']) + { + Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', Tools::getValue('id_order_state')); + Configuration::updateValue('MR_GOOGLE_MAP', Tools::getValue('mr_google_key')); + if (!Tools::isSubmit('updatesuccess')) + $this->_html .= '
        '.$this->l('Settings updated').'
        '; + } + } + + public function getmrth($id_lang, $active = false, $id_zone = false, $id_iso_code = false) + { + if (!Validate::isBool($active)) + die(Tools::displayError()); + + $carriers = Db::getInstance()->ExecuteS(' + SELECT c.*, cl.delay + FROM `'._DB_PREFIX_.'mr_method` m + LEFT JOIN `'._DB_PREFIX_.'carrier` c ON (c.`id_carrier` = m.`id_carrier` and c.`deleted` = 0) + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl ON (c.`id_carrier` = cl.`id_carrier` AND cl.`id_lang` = '.(int)($id_lang).') + LEFT JOIN `'._DB_PREFIX_.'carrier_zone` cz ON (cz.`id_carrier` = c.`id_carrier`)'. + ($id_zone ? 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = '.(int)($id_zone).')' : '').' + WHERE 1 '. + ($id_iso_code ? ' AND m.`mr_Pays_list` LIKE \'%'.pSQL($id_iso_code).'%\'' : ''). + ($active ? ' AND c.`active` = 1' : ''). + ($id_zone ? ' AND cz.`id_zone` = '.(int)($id_zone).' + AND z.`active` = 1' : '').' + GROUP BY c.`id_carrier`'); + + if (is_array($carriers) AND count($carriers)) + { + foreach ($carriers as $key => $carrier) + if ($carrier['name'] == '0') + $carriers[$key]['name'] = Configuration::get('PS_SHOP_NAME'); + } + else + $carriers = array(); + + return $carriers; + } + + public function hookOrderDetail($params) + { + global $smarty; + + $carrier = $params['carrier']; + $order = $params['order']; + + if ($carrier->is_module AND $order->shipping_number) + { + $module = $carrier->external_module_name; + include_once(_PS_MODULE_DIR_.$module.'/'.$module.'.php'); + $module_carrier = new $module(); + $smarty->assign('followup', $module_carrier->get_followup($order->shipping_number)); + } + elseif ($carrier->url AND $order->shipping_number) + $smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); + } + + public function hookOrderDetailDisplayed($params) + { + global $smarty; + + $res = Db::getInstance()->getRow(' + SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num` + FROM `'._DB_PREFIX_.'mr_selected` s + WHERE s.`id_cart` = '.$params['order']->id_cart); + if ((!$res) OR ($res['MR_Selected_Num'] == 'LD1') OR ($res['MR_Selected_Num'] == 'LDS')) + return ''; + $smarty->assign('mr_addr', $res['MR_Selected_LgAdr1'].($res['MR_Selected_LgAdr1'] ? ' - ' : '').$res['MR_Selected_LgAdr2'].($res['MR_Selected_LgAdr2'] ? ' - ' : '').$res['MR_Selected_LgAdr3'].($res['MR_Selected_LgAdr3'] ? ' - ' : '').$res['MR_Selected_LgAdr4'].($res['MR_Selected_LgAdr4'] ? ' - ' : '').$res['MR_Selected_CP'].' '.$res['MR_Selected_Ville'].' - '.$res['MR_Selected_Pays']); + return $this->display(__FILE__, 'orderDetail.tpl'); + } + + public function hookProcessCarrier($params) + { + include_once(_PS_MODULE_DIR_.'/mondialrelay/MondialRelayClass.php'); + + $cart = $params['cart']; + $result_MR = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'mr_method` WHERE `id_carrier` = '.(int)($cart->id_carrier)); + if (count($result_MR) > 0) + { + $mr_mode_liv = $result_MR[0]['mr_ModeLiv']; + if ($mr_mode_liv == 'LDS' || $mr_mode_liv == 'LD1') + { + $deliveryAddressLDS = new Address((int)($cart->id_address_delivery)); + if (Validate::isLoadedObject($deliveryAddressLDS) AND ($deliveryAddressLDS->id_customer == $cart->id_customer)) + { + Db::getInstance()->delete(_DB_PREFIX_.'mr_selected','id_cart = "'.(int)($cart->id).'"'); + $mrselected = new MondialRelayClass(); + $mrselected->id_customer = $cart->id_customer; + $mrselected->id_method = $result_MR[0]['id_mr_method']; + $mrselected->id_cart = $cart->id; + $mrselected->MR_Selected_Num = $mr_mode_liv; + $mrselected->save(); + } + } + elseif (!Configuration::get('PS_ORDER_PROCESS_TYPE')) + { + + if (empty($_POST['MR_Selected_Num_'.$cart->id_carrier])) // Case error : the customer didn't choose a 'relais' but selected Relais Colis TNT as a carrier + Tools::redirect('order.php?step=2&mr_null'); + else + { + Db::getInstance()->delete(_DB_PREFIX_.'mr_selected','id_cart = "'.(int)($cart->id).'"'); + $mrselected = new MondialRelayClass(); + $mrselected->id_customer = $cart->id_customer; + $mrselected->id_method = $result_MR[0]['id_mr_method']; + $mrselected->id_cart = $cart->id; + $mrselected->MR_Selected_Num = $_POST['MR_Selected_Num_'.$cart->id_carrier]; + $mrselected->MR_Selected_LgAdr1 = $_POST['MR_Selected_LgAdr1_'.$cart->id_carrier]; + $mrselected->MR_Selected_LgAdr2 = $_POST['MR_Selected_LgAdr2_'.$cart->id_carrier]; + $mrselected->MR_Selected_LgAdr3 = $_POST['MR_Selected_LgAdr3_'.$cart->id_carrier]; + $mrselected->MR_Selected_LgAdr4 = $_POST['MR_Selected_LgAdr4_'.$cart->id_carrier]; + $mrselected->MR_Selected_CP = $_POST['MR_Selected_CP_'.$cart->id_carrier]; + $mrselected->MR_Selected_Ville = $_POST['MR_Selected_Ville_'.$cart->id_carrier]; + $mrselected->MR_Selected_Pays = $_POST['MR_Selected_Pays_'.$cart->id_carrier]; + $mrselected->save(); + } + } + } + } + + public function hookupdateCarrier($params) + { + $new_carrier = $params['carrier']; + if ($new_carrier->external_module_name == 'mondialrelay') + { + $mr_data = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'mr_method` WHERE `id_carrier` = '.(int)($params['id_carrier'])); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'mr_method` (mr_Name, mr_Pays_list, mr_ModeCol, mr_ModeLiv, mr_ModeAss, id_carrier) + VALUES ("'.pSQL($mr_data['mr_Name']).'", "'.pSQL($mr_data['mr_Pays_list']).'", "'.pSQL($mr_data['mr_ModeCol']).'", "'.pSQL($mr_data['mr_ModeLiv']).'", "'.pSQL($mr_data['mr_ModeAss']).'", '.(int)($new_carrier->id).')'); + } + } + + public function hookextraCarrier($params) + { + global $smarty, $cart, $cookie, $defaultCountry, $nbcarriers; + + if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' OR + Configuration::get('MR_CODE_MARQUE') == '' OR + Configuration::get('MR_KEY_WEBSERVICE') == '' OR + Configuration::get('MR_LANGUAGE') == '') + return ''; + + $totalweight = Configuration::get('MR_WEIGHT_COEF') * $cart->getTotalWeight(); + + if (Validate::isUnsignedInt($cart->id_carrier)) + { + $carrier = new Carrier((int)($cart->id_carrier)); + if ($carrier->active AND !$carrier->deleted) + $checked = (int)($cart->id_carrier); + } + if (!isset($checked) OR $checked == 0) + $checked = (int)(Configuration::get('PS_CARRIER_DEFAULT')); + + $address = new Address((int)($cart->id_address_delivery)); + $id_zone = Address::getZoneById((int)($address->id)); + $country = new Country((int)($address->id_country)); + + $query = self::getmrth((int)($cookie->id_lang), true, (int)($country->id_zone), $country->iso_code); + + $resultsArray = array(); + $i = 0; + foreach ($query AS $k => $row) + { + $carrier = new Carrier((int)($row['id_carrier'])); + if ((Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) OR + (!Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + { + unset($result[$k]); + continue ; + } + if ($row['range_behavior']) + { + // Get id zone + if (isset($cart->id_address_delivery) AND $cart->id_address_delivery) + $id_zone = Address::getZoneById((int)($cart->id_address_delivery)); + else + $id_zone = (int)($defaultCountry->id_zone); + if ((Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone))) OR + (!Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) + { + unset($result[$k]); + continue ; + } + } + + $settings = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'mr_method` WHERE `id_carrier` = '.(int)($row['id_carrier'])); + $row['name'] = $settings[0]['mr_Name']; + $row['col'] = $settings[0]['mr_ModeCol']; + $row['liv'] = $settings[0]['mr_ModeLiv']; + $row['ass'] = $settings[0]['mr_ModeAss']; + $row['price'] = $cart->getOrderShippingCost((int)($row['id_carrier'])); + $row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)($row['id_carrier']).'.jpg') ? _THEME_SHIP_DIR_.(int)($row['id_carrier']).'.jpg' : ''; + + $resultsArray[] = $row; + $i++; + } + + if ($i > 0) + { + include_once(_PS_MODULE_DIR_.'/mondialrelay/page_iso.php'); + + $smarty->assign( array( + 'address_map' => $address->address1.', '.$address->postcode.', '.ote_accent($address->city).', '.$country->iso_code, + 'input_cp' => $address->postcode, + 'input_ville' => ote_accent($address->city), + 'input_pays' => $country->iso_code, + 'input_poids' => Configuration::get('MR_WEIGHT_COEF') * $cart->getTotalWeight(), + 'nbcarriers' => $nbcarriers, + 'checked' => (int)($checked), + 'google_api_key' => Configuration::get('MR_GOOGLE_MAP'), + 'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0), + 'carriersextra' => $resultsArray)); + $nbcarriers = $nbcarriers + $i; + return $this->display(__FILE__, 'mondialrelay.tpl'); + } + } + + public function getContent() + { + global $cookie; + $error = null; + + if (isset($_GET['updatesuccess'])) + $this->_html .= '
        '.$this->l('Settings updated').'
        '; + if (!empty($_POST)) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + { + $nbErrors = sizeof($this->_postErrors); + $this->_html .= '

        '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'

          '; + foreach ($this->_postErrors AS $error) + $this->_html .= '
        1. '.$error.'
        2. '; + $this->_html .= '
        '; + } + } + + if (isset($_GET['delete_mr']) && !empty($_GET['delete_mr'])) + self::mrDelete((int)($_GET['delete_mr'])); + + $this->_html .= '

        '.$this->l('Configure Mondial Relay Rate Module').'

        '. + ' +
        + '.$this->l('To create a Mondial Relay carrier').' + - '.$this->l('Enter and save your Mondial Relay account settings').'
        + - '.$this->l('Create a Carrier').'
        + - '.$this->l('Define a price for your carrier on').' '.$this->l('The Carrier page').'
        + - '.$this->l('To generate labels, you must have a valid and registered address of your store on your').' '.$this->l('contact page').'
        + - '.$this->l('Go to the front office').'

        +

        '.$this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true)._MODULE_DIR_.$this->name.'/cron.php?secure_key='.Configuration::get('MONDIAL_RELAY_SECURE_KEY').'

        +
        '.self::settingsForm().self::settingsstateorderForm().self::addMethodForm().self::shippingForm(). + '
        '; + + return $this->_html; + } + + public function mrDelete($id) + { + $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($id).'"'); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_ .'carrier` SET `active` = 0, `deleted` = 1 WHERE `id_carrier` = "'.(int)($id).'"'); + $this->_html .= '
        '.$this->l('Delete successful').'
        '; + } + + public function mrUpdate($type, Array $array, Array $keyArray) + { + global $cookie; + + if ($type == 'settings') + { + Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', $array[0]); + Configuration::updateValue('MR_CODE_MARQUE', $array[1]); + Configuration::updateValue('MR_KEY_WEBSERVICE', $array[2]); + Configuration::updateValue('MR_LANGUAGE', $array[3]); + Configuration::updateValue('MR_WEIGHT_COEF', $array[4]); + } + elseif ($type == 'shipping') + { + array_pop($array); + foreach ($array AS $Key => $value) + { + $key = explode(',', $Key); + $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($key[0]).'"'); + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'carrier SET active = "'.(int)($value).'" WHERE `id_carrier` = "'.(int)($id).'"'); + } + } + elseif ($type == 'addShipping') + { + $query = 'INSERT INTO ' . _DB_PREFIX_ . 'mr_method ('; + + for ($q = 0; $q <= count($keyArray) - 1; $q++) + { + $end = ($q == count($keyArray) - 1) ? '' : ', '; + $query .= $keyArray[$q] . $end; + } + + $query .= ') VALUES('; + + for ($j = 0; $j <= count($array) - 1; $j++) + { + $var = $array[$j]; + if (is_array($var)) + $var = implode(",", $var); + $end = ($j == count($array) - 1) ? '' : ', '; + $query .= "'" . pSQL($var). "'" . $end; + } + $query .= ')'; + + Db::getInstance()->Execute($query); + + $mainInsert = mysql_insert_id(); + $default = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "configuration WHERE name = 'PS_CARRIER_DEFAULT'"); + $check = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "carrier"); + $checkD = array(); + + foreach($check AS $Key) + { + foreach($Key AS $key => $value) + if($key == "id_carrier") + $checkD[] = $value; + } + + Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'carrier` (`id_tax_rules_group`, `url`, `name`, `active`, `is_module`, `range_behavior`, `shipping_external`, `need_range`, `external_module_name`, `shipping_method`) + VALUES("0", NULL, "'.pSQL($array[0]).'", "1", "1", "1", "0", "1", "mondialrelay", "1")'); + + $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . mysql_insert_id() . '"'); + Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"'); + $weight_coef = Configuration::get('MR_WEIGHT_COEF'); + $range_weight = array('24R' => array(0, 20000 / $weight_coef), 'DRI' => array(20000 / $weight_coef, 130000 / $weight_coef), 'LD1' => array(0, 60000 / $weight_coef), 'LDS' => array(30000 / $weight_coef, 130000 / $weight_coef)); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_weight` (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)($get['id_carrier']).', '.$range_weight[$array[2]][0].', '.$range_weight[$array[2]][1].')'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_price` (`id_carrier`, `delimiter1`, `delimiter2`) VALUES ('.(int)($get['id_carrier']).', 0.000000, 10000.000000)'); + $groups = Group::getGroups(Configuration::get('PS_LANG_DEFAULT')); + foreach ($groups as $group) + + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_group` (id_carrier, id_group) VALUES('.(int)($get['id_carrier']).', '.(int)($group['id_group']).')'); + + $zones = Zone::getZones(); + foreach ($zones as $zone) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_zone` (id_carrier, id_zone) VALUES('.(int)($get['id_carrier']).', '.(int)($zone['id_zone']).')'); + $range_price_id = Db::getInstance()->getValue('SELECT id_range_price FROM ' . _DB_PREFIX_ . 'range_price WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); + $range_weight_id = Db::getInstance()->getValue('SELECT id_range_weight FROM ' . _DB_PREFIX_ . 'range_weight WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', '.(int)($range_price_id).', NULL,'.(int)($zone['id_zone']).', 0.00)'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', NULL, '.(int)($range_weight_id).','.(int)($zone['id_zone']).', 0.00)'); + } + + if(!in_array($default[0]['value'], $checkD)) + $default = Db::getInstance()->ExecuteS("UPDATE " . _DB_PREFIX_ . "configuration SET value = '" . (int)($get['id_carrier']) . "' WHERE name = 'PS_CARRIER_DEFAULT'"); + + Tools::redirectAdmin('index.php?tab=AdminModules&configure=mondialrelay&updatesuccess&token='.Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)($cookie->id_employee))); + } + else + return false; + + $this->_html .= '
        '.$this->l('Settings updated').'
        '; + return true; + } + + public function addMethodForm() + { + $zones = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "zone WHERE active = 1"); + $output = ' +
        +
        + '.$this->l('Add a Shipping Method').' +
          +
        1. + + +
        2. + +
        3. + + +
        4. + +
        5. + + +
        6. + +
        7. + + +
        8. + +
        9. + + +
        10. +
        11. + +
        12. +
        13. + * ' . $this->l('Required') . ' +
        14. +
        +
        +
        '; + + return $output; + } + + public function shippingForm() + { + global $cookie; + + $query = Db::getInstance()->ExecuteS(' + SELECT m.* + FROM `'._DB_PREFIX_.'mr_method` m + JOIN `'._DB_PREFIX_.'carrier` c ON (c.`id_carrier` = m.`id_carrier`) + WHERE c.`deleted` = 0'); + + $output = ' +
        +
        + '.$this->l('Shipping Method\'s list').' +
          '; + if (!sizeof($query)) + $output .= '
        1. '.$this->l('No shipping methods created').'
        2. '; + foreach ($query AS $Options) + { + $output .= ' +
        3. + Delete' . str_replace('_', ' ', $Options['mr_Name']) . ' (' . $Options['mr_ModeCol'] . '-' . $Options['mr_ModeLiv'] . ' - ' . $Options['mr_ModeAss'] . ' : '.$Options['mr_Pays_list'].') + '.$this->l('Config Shipping.').' +
        4. '; + } + $output .= ' + +
        +
        +

        + '; + + return $output; + } + + public function settingsstateorderForm() + { + global $cookie; + $this->orderState = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); + $output = ''; + $output .= '
        '; + $output .= '
        '.$this->l('Settings').''; + $output .= ''; + $output .= '
        '; + $output .= ''; + $output .= '

        ' . $this->l('Choose the order state for labels. You can manage the labels on').' '; + $output .= ''. + $this->l('the Mondial Relay administration page').'

        '; + $output .= '
        +
        + +
        + + + + +

        '.$this->l('Displaying a google map on your Mondial Relay carrier may make carrier page loading slower.').'

        +
        '; + $output .= '
        '; + $output .= '

        '; + + return $output; + } + + + public function settingsForm() + { + $output = ' + + +
        +
        + '.$this->l('Mondial Relay Account Settings').' +
          +
        1. + + +
        2. +
        3. + + +
        4. +
        5. + + +
        6. +
        7. + + +
        8. +
        9. + + ' . + $this->l('grammes = 1 ') . Configuration::get('PS_WEIGHT_UNIT').' +
        10. +
        11. + +
        12. +
        13. + * ' . $this->l('Required') . ' +
        14. +
        +
        +
        '; + + return $output; + } + + public function displayInfoByCart($id_cart) + { + $simpleresul = Db::getInstance()->ExecuteS('SELECT * FROM ' . _DB_PREFIX_ . 'mr_selected where id_cart='.(int)($id_cart)); + + if (trim($simpleresul[0]['exp_number']) != '0') + @$sortie .= $this->l('Nb expedition:').$simpleresul[0]['exp_number']."
        "; + if (trim($simpleresul[0]['url_etiquette']) != '0') + @$sortie .= "".$this->l('Label URL')."
        "; + if (trim($simpleresul[0]['url_suivi']) != '0') + @$sortie .= "".$this->l('Follow-up URL')."
        "; + if (trim($simpleresul[0]['MR_Selected_Num']) != '') + @$sortie .= $this->l('Nb Point Relay :').$simpleresul[0]['MR_Selected_Num']."
        "; + if (trim($simpleresul[0]['MR_Selected_LgAdr1']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_LgAdr1']."
        "; + if (trim($simpleresul[0]['MR_Selected_LgAdr2']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_LgAdr2']."
        "; + if (trim($simpleresul[0]['MR_Selected_LgAdr3']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_LgAdr3']."
        "; + if (trim($simpleresul[0]['MR_Selected_LgAdr4']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_LgAdr4']."
        "; + if (trim($simpleresul[0]['MR_Selected_CP']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_CP']." "; + if (trim($simpleresul[0]['MR_Selected_Ville']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_Ville']."
        "; + if (trim($simpleresul[0]['MR_Selected_Pays']) != '') + @$sortie .= $simpleresul[0]['MR_Selected_Pays']."
        "; + return '

        '.$sortie.'

        '; + } + + public function get_followup($shipping_number) + { + $query = 'SELECT url_suivi FROM '._DB_PREFIX_ .'mr_selected where id_mr_selected=\''.(int)($shipping_number).'\';'; + $settings = Db::getInstance()->ExecuteS($query); + return $settings[0]['url_suivi']; + } + + + public function set_carrier($key,$value,$id_carrier) + { + if($key == 'name') + $key = 'mr_Name'; + return Db::getInstance()->Execute('UPDATE ' . _DB_PREFIX_ . 'mr_method SET '.pSQL($key).'="'.pSQL($value).'" WHERE id_carrier=\''.(int)($id_carrier).'\' ; '); + } + + public function getL($key) + { + $trad = array( + 'List of recognized orders' => $this->l('List of recognized orders'), + 'Order number' => $this->l('Order number'), + 'Send e-mail to' => $this->l('Send e-mail to'), + 'Print A4 Label' => $this->l('Print A4 Label'), + 'Print A5 Label' => $this->l('Print A5 Label'), + 'return' => $this->l('return'), + 'All orders which have the state' => $this->l('All orders which have the state'), + 'Change configuration' => $this->l('Change configuration'), + 'No orders with this state.' => $this->l('No orders with this state.'), + 'Order ID' => $this->l('Order ID'), + 'Customer' => $this->l('Customer'), + 'Total price' => $this->l('Total price'), + 'Total shipping' => $this->l('Total shipping'), + 'Date' => $this->l('Date'), + 'Weight (in grams)' => $this->l('Weight (in grams)'), + 'Selected' => $this->l('Selected'), + 'All' => $this->l('All'), + 'None' => $this->l('None'), + 'MR_Selected_Num' => $this->l('MR_Selected_Num'), + 'MR_Selected_Pays' => $this->l('MR_Selected_Pays'), + 'exp_number' => $this->l('exp_number'), + 'Detail' => $this->l('Detail'), + 'View' => $this->l('View'), + 'Generate' => $this->l('Generate'), + 'Label creation history' => $this->l('Label creation history'), + 'Orders ID' => $this->l('Orders ID'), + 'Exps num' => $this->l('Exps num'), + 'Delete selected history' => $this->l('Delete selected history'), + 'Closed' => $this->l('Closed'), + 'Monday' => $this->l('Monday'), + 'Tuesday' => $this->l('Tuesday'), + 'Wednesday' => $this->l('Wednesday'), + 'Thursday' => $this->l('Thursday'), + 'Friday' => $this->l('Friday'), + 'Saturday' => $this->l('Saturday'), + 'Sunday' => $this->l('Sunday'), + 'Select this Relay Point' => $this->l('Select this Relay Point'), + 'To generate sticks, you must have register a correct address of your store on' => $this->l('To generate labels, you must have registered a correct address of your store on'), + 'To generate labels, you must have registered a correct address of your store on' => $this->l('To generate labels, you must have registered a correct address of your store on'), + 'The contact page' => $this->l('The contact page'), + 'Settings updated succesfull' => $this->l('Settings updated'), + 'Settings updated' => $this->l('Settings updated'), + 'Empty address : Are you sure you have set a valid address on the contact page?' => $this->l('Empty address : Are you sure you have set a valid address on the contact page?') + ); + return (array_key_exists($key, $trad)) ? $trad[$key] : $key; + } +} diff --git a/modules/mondialrelay/mondialrelay.tpl b/modules/mondialrelay/mondialrelay.tpl new file mode 100755 index 000000000..5e7f505ef --- /dev/null +++ b/modules/mondialrelay/mondialrelay.tpl @@ -0,0 +1,93 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + +{foreach from=$carriersextra item=carrier name=myLoop} + + + + + + + + + + + + {$carrier.delay|escape:'htmlall':'UTF-8'} + + {if $carrier.price} + + {if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if} + + {if $priceDisplay == 1} {l s='(tax excl.)' mod='mondialrelay'}{else} {l s='(tax incl.)' mod='mondialrelay'}{/if} + {else} + {l s='Free!' mod='mondialrelay'} + {/if} + + + {if $carrier.liv !='LDR' && $carrier.liv != 'LD1' && $carrier.liv != 'LDS'} + + + + {if ($google_api_key)} + + {/if} + + + + + {/if} + +{/foreach} + + diff --git a/modules/mondialrelay/mrInstall.sql b/modules/mondialrelay/mrInstall.sql new file mode 100755 index 000000000..dc84cc22f --- /dev/null +++ b/modules/mondialrelay/mrInstall.sql @@ -0,0 +1,43 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_mr_method` ( + `id_mr_method` int(10) unsigned NOT NULL auto_increment, + `mr_Name` varchar(255) NOT NULL, + `mr_Pays_list` varchar(1000) NOT NULL, + `mr_ModeCol` varchar(3) NOT NULL, + `mr_ModeLiv` varchar(3) NOT NULL, + `mr_ModeAss` varchar(3) NOT NULL DEFAULT '0', + `id_carrier` int(10) NOT NULL, + PRIMARY KEY (`id_mr_method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; + +CREATE TABLE IF NOT EXISTS `PREFIX_mr_selected` ( + `id_mr_selected` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NULL, + `id_method` int(10) unsigned NULL, + `id_cart` int(10) unsigned NULL, + `id_order` int(10) unsigned NULL, + `MR_poids` varchar(7) NULL, + `MR_Selected_Num` varchar(6) NULL, + `MR_Selected_LgAdr1` varchar(36) NULL, + `MR_Selected_LgAdr2` varchar(36) NULL, + `MR_Selected_LgAdr3` varchar(36) NULL, + `MR_Selected_LgAdr4` varchar(36) NULL, + `MR_Selected_CP` varchar(10) NULL, + `MR_Selected_Ville` varchar(32) NULL, + `MR_Selected_Pays` varchar(2) NULL, + `url_suivi` varchar(1000) NULL, + `url_etiquette` varchar(1000) NULL, + `exp_number` varchar(8) NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_mr_selected`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; + +CREATE TABLE IF NOT EXISTS `PREFIX_mr_historique` ( +`id` int(10) unsigned NOT NULL auto_increment, +`order` TEXT NOT NULL , +`exp` TEXT NOT NULL , +`url_a4` VARCHAR( 1000 ) NOT NULL , +`url_a5` VARCHAR( 1000 ) NOT NULL , +PRIMARY KEY ( `id` ) +)ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; + diff --git a/modules/mondialrelay/orderDetail.tpl b/modules/mondialrelay/orderDetail.tpl new file mode 100755 index 000000000..b0ff3422d --- /dev/null +++ b/modules/mondialrelay/orderDetail.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $mr_addr} +

        {l s='Delivery to' mod='mondialrelay'} {$mr_addr}

        +{/if} diff --git a/modules/mondialrelay/page_iso.php b/modules/mondialrelay/page_iso.php new file mode 100755 index 000000000..e24a060f7 --- /dev/null +++ b/modules/mondialrelay/page_iso.php @@ -0,0 +1,42 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +//header('Content-Type: text/html; charset=iso-8859-15'); +function ote_accent($str){ + +$str = str_replace("'", " ", $str); + +$str = utf8_decode($str); + +$ch = strtr($str, + + '����������������������������������������������������', + + 'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); + +return utf8_encode($ch); + +} diff --git a/modules/mondialrelay/style.css b/modules/mondialrelay/style.css new file mode 100755 index 000000000..aa60b530e --- /dev/null +++ b/modules/mondialrelay/style.css @@ -0,0 +1,41 @@ +.shippingList { + width: 400px; + float: right; +} +.shippingList li { + margin: 5px; + display: block; + clear: both; +} +.shipLabel { + width: 230px; + float: left; + text-align: left; +} +.selectShipping { + width: 100px; +} +.settingsList { + width: 400px; + float: left; + margin-right: 10px; +} +.settingsList li { + display: block; + padding: 5px; + clear: both; +} +.upsLabel { + width: 170px; + float: left; + text-align: left; +} +.upsInput { + float: left; +} +.upsSubmit { + text-align: center; +} +.addMethodForm { + margin-bottom: 10px; +} \ No newline at end of file diff --git a/modules/moneybookers/config.xml b/modules/moneybookers/config.xml new file mode 100755 index 000000000..4f2a10dff --- /dev/null +++ b/modules/moneybookers/config.xml @@ -0,0 +1,12 @@ + + + moneybookers + Moneybookers + 1.4 + Accepts payments by Moneybookers. + + payments_gateways + Are you sure you want to delete your details ? + 1 + 1 + \ No newline at end of file diff --git a/modules/moneybookers/confirmation.tpl b/modules/moneybookers/confirmation.tpl new file mode 100644 index 000000000..7266f0bc5 --- /dev/null +++ b/modules/moneybookers/confirmation.tpl @@ -0,0 +1,44 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $status == 'ok'} +

        {l s='Your order on' mod='moneybookers'} {$shop_name} {l s='is complete.' mod='moneybookers'} +

        {l s='Your order will be shipped as soon as possible.' mod='moneybookers'} +

        {l s='For any questions or for further information, please contact our' mod='moneybookers'} {l s='customer support' mod='moneybookers'}. +

        +{else} + {if $status == 'pending'} +

        {l s='Your order on' mod='moneybookers'} {$shop_name} {l s='is pending.' mod='moneybookers'} +

        {l s='Your order will be shipped as soon as we receive your bankwire.' mod='moneybookers'} +

        {l s='For any questions or for further information, please contact our' mod='moneybookers'} {l s='customer support' mod='moneybookers'}. +

        + {else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='moneybookers'} + {l s='customer support' mod='moneybookers'}. +

        + {/if} +{/if} diff --git a/modules/moneybookers/de.php b/modules/moneybookers/de.php new file mode 100644 index 000000000..23c4da640 --- /dev/null +++ b/modules/moneybookers/de.php @@ -0,0 +1,61 @@ +confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{moneybookers}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{moneybookers}prestashop>confirmation_15d18c17d7aef219c342bb0d81e823ab'] = 'Ihre Bestellung wird so schnell wie möglich verschickt werden.'; +$_MODULE['<{moneybookers}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{moneybookers}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{moneybookers}prestashop>confirmation_df194447dfecf36bb8043bd8d94feed3'] = 'ist anhängig.'; +$_MODULE['<{moneybookers}prestashop>confirmation_047e219d25b398033511b18041dbfd7a'] = 'Ihre Bestellung wird verschickt, sobald wir Ihre Banküberweisung erhalten haben.'; +$_MODULE['<{moneybookers}prestashop>confirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben ein Problem bei Ihrer Bestellung festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; +$_MODULE['<{moneybookers}prestashop>moneybookers-currency-error_6484c945379d81c37ac734c9768605cf'] = 'Sie können mit Ihren derzeitigen Währung nicht mit Moneybookers bezahlen, wählen Sie bitte eine andere Währung'; +$_MODULE['<{moneybookers}prestashop>moneybookers_6861a58e2be4956b3f2fd6420fe6c28c'] = 'Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a356736cbcf740f8648d71067fca090d'] = 'Akzeptiert Zahlungen per Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Daten löschen wollen?'; +$_MODULE['<{moneybookers}prestashop>moneybookers_088b74050a381d98fca38d5990b097be'] = 'Sie nutzen zur Zeit die Standard-E-Mail-Adresse von Moneybookers, Sie müssen Ihre eigene E-Mail-Adresse verwenden'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87ef564ed1574eda7e77b4012eef0b85'] = 'Unmöglich,den Aktivierungs-Server zu kontaktieren, bitte versuchen Sie es später'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b863542eebcb27fa230b647b5dd07819'] = 'Konto-Bestätigung fehlgeschlagen, Ihre E-Mail könnte falsch sein'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'E-Mail-Aktivierung erfolgreich, Sie können nun Ihr Kennwort bestâtigen'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7757ea03f2a0893e36c7916a2ad07ef8'] = 'Das E-Mail-Feld ist erforderlich'; +$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'Kennwortbestätigung fehlgeschlagen, max. Versuchszahl überschritten (3 pro Stunde)'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'Kennwortbestätigung fehlgeschlagen, Ihr Kennwort könnte falsch sein'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'Kontoaktivierung erfolgreich, Kennwort ok'; +$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'Das Kennwortfeld ist erforderlich'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a9dd80641753cafc9c967e317ba92a28'] = 'Über Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_242d12c7b3bc225e45954aff5987fe4e'] = 'Moneybookers ist eines der größten europäischen Online-Zahlungssysteme und gehört zu den weltweit führenden eWallet-Providern, mit über 14 Millionen Kontobenutzern. Das einfach zubediendende eWallet ermöglicht es jedem Kunden, bequem und sicher bezahlen, ohne dass persönliche finanzielle Daten bekannt werden, zum Senden und Empfangen kostengünstiger Geldüberweisungen, indem einfach eine E-Mail-Adresse verwendet wird.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5604a5165436cb3a79cfa00f7f25fce6'] = 'Das weltweite Zahlungsnetzwerk Moneybookers bietet Unternehmen Zugang zu über 80 lokalen Zahlungsoptionen in über 200 Ländern mit einer einzigen Integration. Bereits mehr als 60.000 Händler benutzen den Moneybookers Zahlungsservice, einschließlich globaler Partner wie eBay, Skype und Thomas Cook'; +$_MODULE['<{moneybookers}prestashop>moneybookers_04a0e2e14bfc47151f158db3c1b03661'] = 'Moneybookers wurde 2001 in London gegründet und wird von der Finanzaufsichtsbehörde des Vereinigten Königreichs kontrolliert.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5138738b54f0d4bdf7c72780db651abc'] = 'Kontoeröffnung'; +$_MODULE['<{moneybookers}prestashop>moneybookers_41992c760318e60740f7a9b2819af191'] = 'Starten Sie mit der Eröffung eines '; +$_MODULE['<{moneybookers}prestashop>moneybookers_c0302a6fbca061af831bc12f06cadb2f'] = 'Gratis-Kontos'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5ac14a97f40e4aadd7eb202f7c124b1'] = 'mit Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b0e8c8326985417a5efdd6649f02e385'] = 'Dank der PrestaShop / Moneybookers Partnerschaft'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d4246'] = 'erhalten Sie eine bevorzugte Provision!'; +$_MODULE['<{moneybookers}prestashop>moneybookers_3513f0ecb96b6c959454534578ee1404'] = 'Dann klicken Sie hier:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_64d37ad3bf2f0aee7c8a321321c7e9d9'] = 'Ich habe bereits ein Moneybookers-Konto'; +$_MODULE['<{moneybookers}prestashop>moneybookers_f284fe53995a4cc2e1e099cb1e511ec8'] = 'Konto-Bestätigung'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c5093f03229416cc06a625654429d7f2'] = 'Ihr Konto wurde aktiviert'; +$_MODULE['<{moneybookers}prestashop>moneybookers_bd8df5ae85f76ba759fa979ada8566ea'] = 'Sie müssen '; +$_MODULE['<{moneybookers}prestashop>moneybookers_558b256c79bbcf473cc7347ec1ca9d54'] = 'Ihr Konto bestätigen '; +$_MODULE['<{moneybookers}prestashop>moneybookers_198c0bf7b4a44447ebabc2ab9161bd20'] = 'Bitte geben Sie die E-Mail-Adresse ein, die Sie zum Öffnen Ihres Moneybookers Kontos benutzen:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_71b5b9efebe9c2f73fad6dd1849b4312'] = 'Mein Konto bestätigen'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ece6bf0de28bb0442df6e3a1fd7657d4'] = 'Wenn Sie Hilfe benötigen, lesen Sie das Aktivierungshandbuch'; +$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Kennwortbestätigung'; +$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'Ihr Kennwort wurde aktiviert'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'bestätigen Sie Ihr Kennwort'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'Bitte geben Sie das gleiche Kennwort ein, das Sie zum Öffnen Ihres Moneybookers Kontos benutzen:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Mein Kennwort bestätigen'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fd432cdfbae76a7ebde57e6fa44ad90b'] = 'Kreuzen Sie die'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cf189f988336fea71f05010d1525be9c'] = 'internationalen Zahlungsmethoden an,'; +$_MODULE['<{moneybookers}prestashop>moneybookers_8298231c293193e2ab9ac388106edac4'] = 'die Sie aktivieren möchten:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b119e159b6f2d56f8ddead2af4561f38'] = 'lokalen Zahlungsmethoden'; +$_MODULE['<{moneybookers}prestashop>moneybookers_542725fe3d40df98822aa76779462d44'] = 'Einstellungen und Zahlungsmethoden'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87337b7475d1287ff99aaa30446b3bb7'] = 'Seitenanzeig nach Abbruch der Zahlung:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ab67f0d68dd6f5cb407e04abacd06120'] = 'Blenden Sie das Login-Formular auf der Moneybookers-Seite aus'; +$_MODULE['<{moneybookers}prestashop>moneybookers_554fd8768f165251646ce21ba4998208'] = 'Anzeigemodus:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a190bc880b04cf478e0370d1b315a5a3'] = 'Alle Logos in 1 Block'; +$_MODULE['<{moneybookers}prestashop>moneybookers_852d04b5f455aaf5264e9a8c561ced71'] = '1 Block für jedes Logo'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d4dccb8ca2dac4e53c01bd9954755332'] = 'Speichern Sie die Einstellungen'; +$_MODULE['<{moneybookers}prestashop>moneybookers_27266fe4d37bf06589c7c6dbf2d5c067'] = 'Zahlung mit'; diff --git a/modules/moneybookers/es.php b/modules/moneybookers/es.php new file mode 100644 index 000000000..db8303fb0 --- /dev/null +++ b/modules/moneybookers/es.php @@ -0,0 +1,61 @@ +confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{moneybookers}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'se ha completado.'; +$_MODULE['<{moneybookers}prestashop>confirmation_15d18c17d7aef219c342bb0d81e823ab'] = 'Su pedido será enviado tan pronto como sea posible.'; +$_MODULE['<{moneybookers}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier duda o para más información, póngase en contacto con nuestro servicio de atención al cliente'; +$_MODULE['<{moneybookers}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = ' servicio clientela'; +$_MODULE['<{moneybookers}prestashop>confirmation_df194447dfecf36bb8043bd8d94feed3'] = 'está en espera.'; +$_MODULE['<{moneybookers}prestashop>confirmation_047e219d25b398033511b18041dbfd7a'] = 'Su pedido será enviado tan pronto como recibamos su transferencia bancaria.'; +$_MODULE['<{moneybookers}prestashop>confirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nos hemos dado cuenta de un problema con su pedido. Si usted piensa que esto es un error, puede contactar con nuestro'; +$_MODULE['<{moneybookers}prestashop>moneybookers-currency-error_6484c945379d81c37ac734c9768605cf'] = 'rnNo puede efectuar el pago de su pedido con Moneybookers ya que su divisa actual no está autorizada. Por favor, elija otra.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_6861a58e2be4956b3f2fd6420fe6c28c'] = 'Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a356736cbcf740f8648d71067fca090d'] = 'Acepta pagos por Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de que quiere eliminar sus datos?'; +$_MODULE['<{moneybookers}prestashop>moneybookers_088b74050a381d98fca38d5990b097be'] = 'Actualmente utiliza la dirección por defecto del módulo Moneybookers. Debe utilizar sus parámetros.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87ef564ed1574eda7e77b4012eef0b85'] = 'Imposible contactar con el servidor de activación, por favor inténtelo más tarde'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b863542eebcb27fa230b647b5dd07819'] = 'Error durante la validación de la cuenta, su correo electrónico podría estar equivocado'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'Activación correcta de su dirección email, ya puede validar su palabra secreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7757ea03f2a0893e36c7916a2ad07ef8'] = 'El campo email es obligatorio'; +$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'Error durante la validación de su palabra secreta, ha sobrepasado el número máximo de intentos (3 por hora)'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'Error durante la validación de la palabra secreta, su palabra secreta podría estar equivocada'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'Activación de su cuenta con éxito, palabra secreta correcta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'El campo palabra secreta es obligatorio'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a9dd80641753cafc9c967e317ba92a28'] = 'Sobre Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_242d12c7b3bc225e45954aff5987fe4e'] = 'Moneybookers es uno de los sistemas de pago en línea más grandes de Europa y se sitúa entre los principales proveedores del mundo de eWallet, con más de 14 millones de titulares de cuentas. El sencillo eWallet permite a cualquier cliente pagar en línea de manera cómoda y segura sin revelar datos financieros personales, y también le permite enviar y recibir transferencias de dinero de forma rentable, usando simplemente una dirección de correo electrónico. '; +$_MODULE['<{moneybookers}prestashop>moneybookers_5604a5165436cb3a79cfa00f7f25fce6'] = 'Moneybookers es uno de los sistemas de pago en línea más importantes de Europa. Propone más de 80 opciones de pago en más de 200 países en todo el mundo. Actualmente más de 60 000 sitios utilizan esta solución, entre otros eBay.com, Skype y Thomas Cook'; +$_MODULE['<{moneybookers}prestashop>moneybookers_04a0e2e14bfc47151f158db3c1b03661'] = 'Moneybookers fue fundado en 2001 en Londres y está regulado por la Autoridad de Servicios Financieros del Reino Unido.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5138738b54f0d4bdf7c72780db651abc'] = 'Abrir una cuenta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_41992c760318e60740f7a9b2819af191'] = 'Comience por abrir'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c0302a6fbca061af831bc12f06cadb2f'] = 'una cuenta gratis'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5ac14a97f40e4aadd7eb202f7c124b1'] = 'con Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b0e8c8326985417a5efdd6649f02e385'] = 'Gracias a la asociación entre PrestaShop y Moneybookers,'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d4246'] = '¡obtendrá una tasa de comisión preferencial!'; +$_MODULE['<{moneybookers}prestashop>moneybookers_3513f0ecb96b6c959454534578ee1404'] = 'A continuación, haga clic aquí:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_64d37ad3bf2f0aee7c8a321321c7e9d9'] = 'Ya tengo una cuenta en Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_f284fe53995a4cc2e1e099cb1e511ec8'] = 'Validación de cuenta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c5093f03229416cc06a625654429d7f2'] = 'Su cuenta ha sido activada'; +$_MODULE['<{moneybookers}prestashop>moneybookers_bd8df5ae85f76ba759fa979ada8566ea'] = 'Necesita'; +$_MODULE['<{moneybookers}prestashop>moneybookers_558b256c79bbcf473cc7347ec1ca9d54'] = 'validar su cuenta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_198c0bf7b4a44447ebabc2ab9161bd20'] = 'por favor, escriba la dirección de correo electrónico que utilizó para abrir su cuenta de Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_71b5b9efebe9c2f73fad6dd1849b4312'] = 'Validar mi cuenta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ece6bf0de28bb0442df6e3a1fd7657d4'] = 'Si necesita ayuda, lea la activación manual'; +$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Validación de la palabra secreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'Su palabra secreta ha sido activada'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'valide su palabra secreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'por favor, escriba la misma palabra secreta que introdujo en su cuenta en Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Valide mi palabra secreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fd432cdfbae76a7ebde57e6fa44ad90b'] = 'Marque los'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cf189f988336fea71f05010d1525be9c'] = 'métodos de pago internacionales'; +$_MODULE['<{moneybookers}prestashop>moneybookers_8298231c293193e2ab9ac388106edac4'] = 'que desea activar:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b119e159b6f2d56f8ddead2af4561f38'] = 'métodos de pago locales'; +$_MODULE['<{moneybookers}prestashop>moneybookers_542725fe3d40df98822aa76779462d44'] = 'Parámetros y formas de pago'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87337b7475d1287ff99aaa30446b3bb7'] = 'Página que se muestra si error de pago:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ab67f0d68dd6f5cb407e04abacd06120'] = 'Ocultar el formulario de acceso a la página de Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_554fd8768f165251646ce21ba4998208'] = 'Modo de visualización:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a190bc880b04cf478e0370d1b315a5a3'] = 'Todos los logos en un bloque'; +$_MODULE['<{moneybookers}prestashop>moneybookers_852d04b5f455aaf5264e9a8c561ced71'] = 'Un bloque para cada logo'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d4dccb8ca2dac4e53c01bd9954755332'] = 'Guardar los parámetros'; +$_MODULE['<{moneybookers}prestashop>moneybookers_27266fe4d37bf06589c7c6dbf2d5c067'] = 'Pagar por'; diff --git a/modules/moneybookers/fr.php b/modules/moneybookers/fr.php new file mode 100644 index 000000000..9b54bd859 --- /dev/null +++ b/modules/moneybookers/fr.php @@ -0,0 +1,61 @@ +confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{moneybookers}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est validée.'; +$_MODULE['<{moneybookers}prestashop>confirmation_15d18c17d7aef219c342bb0d81e823ab'] = 'Votre commande va être livrée dès que possible.'; +$_MODULE['<{moneybookers}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toutes questions complémentaires, merci de contact notre'; +$_MODULE['<{moneybookers}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'service client'; +$_MODULE['<{moneybookers}prestashop>confirmation_df194447dfecf36bb8043bd8d94feed3'] = 'est en attente.'; +$_MODULE['<{moneybookers}prestashop>confirmation_047e219d25b398033511b18041dbfd7a'] = 'Votre commande va être envoyée dès que nous recevrons votre virement bancaire'; +$_MODULE['<{moneybookers}prestashop>confirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons décelé une erreur avec votre commande. Si vous pensez qu\'il s\'agit d\'une erreur, merci de contacter notre'; +$_MODULE['<{moneybookers}prestashop>moneybookers-currency-error_6484c945379d81c37ac734c9768605cf'] = 'Vous ne pouvez pas régler votre commande avec Moneybookers car votre devise actuelle n\'est pas autorisée. Merci de choisir une autre devise.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_6861a58e2be4956b3f2fd6420fe6c28c'] = 'Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a356736cbcf740f8648d71067fca090d'] = 'Acceptez les paiements par Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?'; +$_MODULE['<{moneybookers}prestashop>moneybookers_088b74050a381d98fca38d5990b097be'] = 'Vous utilisez actuellement l\'adresse e-mail par défaut du module Moneybookers, vous devez utiliser vos paramètres.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87ef564ed1574eda7e77b4012eef0b85'] = 'Serveur d\'activation injoignable, merci d\'essayer ultérieurement'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b863542eebcb27fa230b647b5dd07819'] = 'Erreur lors de la validation du compte, votre adresse e-mail est peut être incorrecte'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'Activation de votre adresse e-mail OK, vous pouvez désormais valider votre mot secret'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7757ea03f2a0893e36c7916a2ad07ef8'] = 'Le champ e-mail est obligatoire'; +$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'Erreur lors de la validation de votre mot secret, vous avez dépassé le nombre maximum d\'essai (3 par heure)'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'Erreur lors de la validation de votre mot secret, votre mot secret est peut être incorrect'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'Activation du compte réussie, mot secret OK'; +$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'Le mot secret est obligatoire'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a9dd80641753cafc9c967e317ba92a28'] = 'A propos de Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_242d12c7b3bc225e45954aff5987fe4e'] = 'Avec plus de 14 millions de titulaires de compte, et 15 000 nouveaux comptes chaque jour, Moneybookers offre aussi l’un des plus grands portemonnaies électroniques du monde. Vos clients pourront régler leur paiement en utilisant seulement leur e-mail et leur mot de passe.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5604a5165436cb3a79cfa00f7f25fce6'] = 'Moneybookers est un des plus importants systèmes de paiement en ligne d’Europe, proposant plus de 80 options de paiement dans plus de 200 pays dans le monde entier. Plus de 60 000 marchands utilisent à présent cette solution, parmi lesquels eBay.com, Skype et Thomas Cook.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_04a0e2e14bfc47151f158db3c1b03661'] = 'Moneybookers a été crée en 2001 à London et est contrôlé par la FSA (Autorité des Services Financiers) du Royaume Uni.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5138738b54f0d4bdf7c72780db651abc'] = 'Ouverture de compte'; +$_MODULE['<{moneybookers}prestashop>moneybookers_41992c760318e60740f7a9b2819af191'] = 'Commencez par ouvrir'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c0302a6fbca061af831bc12f06cadb2f'] = 'un compte gratuit'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5ac14a97f40e4aadd7eb202f7c124b1'] = 'avec Moneybookers :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b0e8c8326985417a5efdd6649f02e385'] = 'Grâce au partenariat PrestaShop/Moneybookers,'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d4246'] = 'vous bénéficierez d\'un taux de commission préférentiel !'; +$_MODULE['<{moneybookers}prestashop>moneybookers_3513f0ecb96b6c959454534578ee1404'] = 'Ensuite cliquez ici :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_64d37ad3bf2f0aee7c8a321321c7e9d9'] = 'J\'ai déjà un compte Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_f284fe53995a4cc2e1e099cb1e511ec8'] = 'Validation de votre compte'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c5093f03229416cc06a625654429d7f2'] = 'Votre compte a bien été validé'; +$_MODULE['<{moneybookers}prestashop>moneybookers_bd8df5ae85f76ba759fa979ada8566ea'] = 'Vous avez besoin'; +$_MODULE['<{moneybookers}prestashop>moneybookers_558b256c79bbcf473cc7347ec1ca9d54'] = 'de valider votre compte'; +$_MODULE['<{moneybookers}prestashop>moneybookers_198c0bf7b4a44447ebabc2ab9161bd20'] = 'merci de saisir l\'adresse e-mail que vous avez utilisée pour votre compte Moneybookers :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_71b5b9efebe9c2f73fad6dd1849b4312'] = 'Valider mon compte'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ece6bf0de28bb0442df6e3a1fd7657d4'] = 'Si vous avez besoin d\'aide, lisez le manuel d\'activation'; +$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Validation de votre mot secret'; +$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'Votre mot secret a bien été validé'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'validez votre mot secret'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'merci de saisir le même mot secret que celui entré dans votre compte Moneybookers :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Valider mon mot secret'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fd432cdfbae76a7ebde57e6fa44ad90b'] = 'Cochez les'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cf189f988336fea71f05010d1525be9c'] = 'moyens de paiement internationaux'; +$_MODULE['<{moneybookers}prestashop>moneybookers_8298231c293193e2ab9ac388106edac4'] = 'que vous souhaitez activer :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b119e159b6f2d56f8ddead2af4561f38'] = 'moyens de paiement locaux'; +$_MODULE['<{moneybookers}prestashop>moneybookers_542725fe3d40df98822aa76779462d44'] = 'Paramètres et moyens de paiement'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87337b7475d1287ff99aaa30446b3bb7'] = 'Page affichée si erreur de paiement :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ab67f0d68dd6f5cb407e04abacd06120'] = 'Masquer le formulaire d\'identification'; +$_MODULE['<{moneybookers}prestashop>moneybookers_554fd8768f165251646ce21ba4998208'] = 'Affichage :'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a190bc880b04cf478e0370d1b315a5a3'] = 'Tous les logos dans un même bloc'; +$_MODULE['<{moneybookers}prestashop>moneybookers_852d04b5f455aaf5264e9a8c561ced71'] = 'Un bloc pour chaque logo'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d4dccb8ca2dac4e53c01bd9954755332'] = 'Sauvegarder les paramètres'; +$_MODULE['<{moneybookers}prestashop>moneybookers_27266fe4d37bf06589c7c6dbf2d5c067'] = 'Payer par Moneybookers'; diff --git a/modules/moneybookers/it.php b/modules/moneybookers/it.php new file mode 100644 index 000000000..6504d6556 --- /dev/null +++ b/modules/moneybookers/it.php @@ -0,0 +1,61 @@ +confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine'; +$_MODULE['<{moneybookers}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{moneybookers}prestashop>confirmation_15d18c17d7aef219c342bb0d81e823ab'] = 'Il tuo ordine sarà spedito al più presto.'; +$_MODULE['<{moneybookers}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{moneybookers}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{moneybookers}prestashop>confirmation_df194447dfecf36bb8043bd8d94feed3'] = 'è in corso.'; +$_MODULE['<{moneybookers}prestashop>confirmation_047e219d25b398033511b18041dbfd7a'] = 'Il tuo ordine verrà spedito non appena avremo ricevuto il bonifico bancario.'; +$_MODULE['<{moneybookers}prestashop>confirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, contatta la nostra'; +$_MODULE['<{moneybookers}prestashop>moneybookers-currency-error_6484c945379d81c37ac734c9768605cf'] = 'Non puoi pagare con Moneybookers con la valuta attuale, scegli un\'altra valuta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_6861a58e2be4956b3f2fd6420fe6c28c'] = 'Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a356736cbcf740f8648d71067fca090d'] = 'Si accettano pagamenti con Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{moneybookers}prestashop>moneybookers_088b74050a381d98fca38d5990b097be'] = 'Si sta attualmente utilizzando l\'indirizzo e-mail Moneybookers di default, è necessario utilizzare il proprio indirizzo e-mail'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87ef564ed1574eda7e77b4012eef0b85'] = 'Impossibile contattare il server di attivazione, riprova più tardi'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b863542eebcb27fa230b647b5dd07819'] = 'convalida account non riuscita, la tua e-mail potrebbe essere errata'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d70c5b5767846906e0abe68498db887b'] = 'attivazione e-mail di successo, ora è possibile convalidare la parola segreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7757ea03f2a0893e36c7916a2ad07ef8'] = 'Il campo email è obbligatorio'; +$_MODULE['<{moneybookers}prestashop>moneybookers_aa1c444c2ee2f620d5b349fedfa68ba2'] = 'convalida parola segreta fallita, ha superato il numero massimo di tentativi (3 per ora)'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cdbef58d093e0ff38e13686a669e9fee'] = 'convalida parola segreta fallita, la tua parola segreta potrebbe essere sbagliata'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cd1dfa342c3c11c17ede212e6429ca01'] = 'attivazione del conto riuscito, parola segreta OK'; +$_MODULE['<{moneybookers}prestashop>moneybookers_2e531f9ad978a2a1a88a00ae0d4dc78e'] = 'Il campo parola segreta è obbligatorio'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a9dd80641753cafc9c967e317ba92a28'] = 'A proposito di Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_242d12c7b3bc225e45954aff5987fe4e'] = 'Moneybookers è uno dei principali sistemi di pagamento online in Europa e tra i maggiori fornitori mondiali di eWallet, con oltre 14 milioni di utenti registrati. eWallet semplice consente a qualsiasi cliente di pagare online in maniera comoda e sicura senza rivelare dati finanziari personali, e inviare e ricevere trasferimenti di denaro semplicemente usando un indirizzo email.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5604a5165436cb3a79cfa00f7f25fce6'] = 'La rete di pagamento Moneybookers in tutto il mondo offre alle aziende l\'accesso a oltre 80 opzioni di pagamento locali in più di 200 paesi con una sola integrazione. Già più di 60.000 rivenditori utilizzano i servizi di pagamento Moneybookers, compresi partner a livello mondiale come eBay, Skype e Thomas Cook'; +$_MODULE['<{moneybookers}prestashop>moneybookers_04a0e2e14bfc47151f158db3c1b03661'] = 'Moneybookers è stata fondata nel 2001 a Londra ed è regolata dalla Financial Services Authority del Regno Unito.'; +$_MODULE['<{moneybookers}prestashop>moneybookers_5138738b54f0d4bdf7c72780db651abc'] = 'Apertura account'; +$_MODULE['<{moneybookers}prestashop>moneybookers_41992c760318e60740f7a9b2819af191'] = 'Inizia aprendo un'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c0302a6fbca061af831bc12f06cadb2f'] = 'account gratuito'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5ac14a97f40e4aadd7eb202f7c124b1'] = 'con Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b0e8c8326985417a5efdd6649f02e385'] = 'Grazie alla partnership tra PrestaShop Moneybookers,'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d5086eeb1bc1994c5abf945fd79d4246'] = 'avrai un tasso di commissione speciale!'; +$_MODULE['<{moneybookers}prestashop>moneybookers_3513f0ecb96b6c959454534578ee1404'] = 'Poi clicca qui:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_64d37ad3bf2f0aee7c8a321321c7e9d9'] = 'Ho già un account Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_f284fe53995a4cc2e1e099cb1e511ec8'] = 'Convalida account'; +$_MODULE['<{moneybookers}prestashop>moneybookers_c5093f03229416cc06a625654429d7f2'] = 'Il tuo account è stato attivato'; +$_MODULE['<{moneybookers}prestashop>moneybookers_bd8df5ae85f76ba759fa979ada8566ea'] = 'È necessario'; +$_MODULE['<{moneybookers}prestashop>moneybookers_558b256c79bbcf473cc7347ec1ca9d54'] = 'convalidare il tuo account'; +$_MODULE['<{moneybookers}prestashop>moneybookers_198c0bf7b4a44447ebabc2ab9161bd20'] = 'si prega di digitare l\'indirizzo email che hai utilizzato per aprire il tuo account Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_71b5b9efebe9c2f73fad6dd1849b4312'] = 'Convalida il mio account'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ece6bf0de28bb0442df6e3a1fd7657d4'] = 'Se hai bisogno di aiuto, leggi il manuale di attivazione'; +$_MODULE['<{moneybookers}prestashop>moneybookers_0b65457508cf73c9ed8c96f56b8910ce'] = 'Convalida parola segreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_e44efbda9396a5641d730f0ac4866e52'] = 'La tua parola segreta è stata attivata'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7360d9333103eec04f2d91fa513a1f46'] = 'convalida la parola segreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_7986dbc3b2bf0e8f72a328c094981836'] = 'si prega di scrivere la stessa parola segreta che hai inserito sul tuo conto Moneybookers:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_22f2d26badcc700d11b93f57dc96d386'] = 'Convalida la mia parola segreta'; +$_MODULE['<{moneybookers}prestashop>moneybookers_fd432cdfbae76a7ebde57e6fa44ad90b'] = 'Spunta i'; +$_MODULE['<{moneybookers}prestashop>moneybookers_cf189f988336fea71f05010d1525be9c'] = 'metodi di pagamento internazionali'; +$_MODULE['<{moneybookers}prestashop>moneybookers_8298231c293193e2ab9ac388106edac4'] = 'che si desidera attivare:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_b119e159b6f2d56f8ddead2af4561f38'] = 'metodi di pagamento locale'; +$_MODULE['<{moneybookers}prestashop>moneybookers_542725fe3d40df98822aa76779462d44'] = 'Impostazioni e metodi di pagamento'; +$_MODULE['<{moneybookers}prestashop>moneybookers_87337b7475d1287ff99aaa30446b3bb7'] = 'Pagina visualizzata dopo la cancellazione di pagamento:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_ab67f0d68dd6f5cb407e04abacd06120'] = 'Nascondi il modulo di login nella pagina Moneybookers'; +$_MODULE['<{moneybookers}prestashop>moneybookers_554fd8768f165251646ce21ba4998208'] = 'Modalità di visualizzazione:'; +$_MODULE['<{moneybookers}prestashop>moneybookers_a190bc880b04cf478e0370d1b315a5a3'] = 'Tutti i loghi in 1 blocco'; +$_MODULE['<{moneybookers}prestashop>moneybookers_852d04b5f455aaf5264e9a8c561ced71'] = '1 blocco per ogni logo'; +$_MODULE['<{moneybookers}prestashop>moneybookers_d4dccb8ca2dac4e53c01bd9954755332'] = 'Salva impostazioni'; +$_MODULE['<{moneybookers}prestashop>moneybookers_27266fe4d37bf06589c7c6dbf2d5c067'] = 'Paga con'; diff --git a/modules/moneybookers/logo-cc-1.gif b/modules/moneybookers/logo-cc-1.gif new file mode 100644 index 000000000..4a48fc34e Binary files /dev/null and b/modules/moneybookers/logo-cc-1.gif differ diff --git a/modules/moneybookers/logo-cc-2.gif b/modules/moneybookers/logo-cc-2.gif new file mode 100644 index 000000000..c461ab996 Binary files /dev/null and b/modules/moneybookers/logo-cc-2.gif differ diff --git a/modules/moneybookers/logo-mb-1.gif b/modules/moneybookers/logo-mb-1.gif new file mode 100644 index 000000000..ed0bcbd82 Binary files /dev/null and b/modules/moneybookers/logo-mb-1.gif differ diff --git a/modules/moneybookers/logo-mb-2.gif b/modules/moneybookers/logo-mb-2.gif new file mode 100644 index 000000000..e01195910 Binary files /dev/null and b/modules/moneybookers/logo-mb-2.gif differ diff --git a/modules/moneybookers/logo-mb-3.gif b/modules/moneybookers/logo-mb-3.gif new file mode 100644 index 000000000..c0ef23346 Binary files /dev/null and b/modules/moneybookers/logo-mb-3.gif differ diff --git a/modules/moneybookers/logo-mb-4.gif b/modules/moneybookers/logo-mb-4.gif new file mode 100644 index 000000000..a0b0e5058 Binary files /dev/null and b/modules/moneybookers/logo-mb-4.gif differ diff --git a/modules/moneybookers/logo-mb-5.gif b/modules/moneybookers/logo-mb-5.gif new file mode 100644 index 000000000..c220966f6 Binary files /dev/null and b/modules/moneybookers/logo-mb-5.gif differ diff --git a/modules/moneybookers/logo-mb-6.gif b/modules/moneybookers/logo-mb-6.gif new file mode 100644 index 000000000..0f1b4639f Binary files /dev/null and b/modules/moneybookers/logo-mb-6.gif differ diff --git a/modules/moneybookers/logo-mb-7.gif b/modules/moneybookers/logo-mb-7.gif new file mode 100644 index 000000000..cfb1bdacd Binary files /dev/null and b/modules/moneybookers/logo-mb-7.gif differ diff --git a/modules/moneybookers/logo-mb.gif b/modules/moneybookers/logo-mb.gif new file mode 100644 index 000000000..2826bfce2 Binary files /dev/null and b/modules/moneybookers/logo-mb.gif differ diff --git a/modules/moneybookers/logo.gif b/modules/moneybookers/logo.gif new file mode 100644 index 000000000..bcae52801 Binary files /dev/null and b/modules/moneybookers/logo.gif differ diff --git a/modules/moneybookers/logos/international/amex.gif b/modules/moneybookers/logos/international/amex.gif new file mode 100644 index 000000000..24b98b119 Binary files /dev/null and b/modules/moneybookers/logos/international/amex.gif differ diff --git a/modules/moneybookers/logos/international/diners.gif b/modules/moneybookers/logos/international/diners.gif new file mode 100644 index 000000000..16b9265d8 Binary files /dev/null and b/modules/moneybookers/logos/international/diners.gif differ diff --git a/modules/moneybookers/logos/international/ewallet.gif b/modules/moneybookers/logos/international/ewallet.gif new file mode 100644 index 000000000..9f35d0aa8 Binary files /dev/null and b/modules/moneybookers/logos/international/ewallet.gif differ diff --git a/modules/moneybookers/logos/international/jcb.gif b/modules/moneybookers/logos/international/jcb.gif new file mode 100644 index 000000000..0d992220c Binary files /dev/null and b/modules/moneybookers/logos/international/jcb.gif differ diff --git a/modules/moneybookers/logos/international/maestro.gif b/modules/moneybookers/logos/international/maestro.gif new file mode 100644 index 000000000..3df6433e3 Binary files /dev/null and b/modules/moneybookers/logos/international/maestro.gif differ diff --git a/modules/moneybookers/logos/international/mastercard.gif b/modules/moneybookers/logos/international/mastercard.gif new file mode 100644 index 000000000..a1f8f8602 Binary files /dev/null and b/modules/moneybookers/logos/international/mastercard.gif differ diff --git a/modules/moneybookers/logos/international/visa.gif b/modules/moneybookers/logos/international/visa.gif new file mode 100644 index 000000000..62b6ad35a Binary files /dev/null and b/modules/moneybookers/logos/international/visa.gif differ diff --git a/modules/moneybookers/logos/international/visadebit.gif b/modules/moneybookers/logos/international/visadebit.gif new file mode 100644 index 000000000..46bd93ac0 Binary files /dev/null and b/modules/moneybookers/logos/international/visadebit.gif differ diff --git a/modules/moneybookers/logos/local/4b.gif b/modules/moneybookers/logos/local/4b.gif new file mode 100644 index 000000000..7aba942b1 Binary files /dev/null and b/modules/moneybookers/logos/local/4b.gif differ diff --git a/modules/moneybookers/logos/local/cartasi.gif b/modules/moneybookers/logos/local/cartasi.gif new file mode 100644 index 000000000..021785bc4 Binary files /dev/null and b/modules/moneybookers/logos/local/cartasi.gif differ diff --git a/modules/moneybookers/logos/local/cartebleue.gif b/modules/moneybookers/logos/local/cartebleue.gif new file mode 100644 index 000000000..e3e5616ee Binary files /dev/null and b/modules/moneybookers/logos/local/cartebleue.gif differ diff --git a/modules/moneybookers/logos/local/dankort.gif b/modules/moneybookers/logos/local/dankort.gif new file mode 100644 index 000000000..de16f6b40 Binary files /dev/null and b/modules/moneybookers/logos/local/dankort.gif differ diff --git a/modules/moneybookers/logos/local/ec.gif b/modules/moneybookers/logos/local/ec.gif new file mode 100644 index 000000000..f825a36f6 Binary files /dev/null and b/modules/moneybookers/logos/local/ec.gif differ diff --git a/modules/moneybookers/logos/local/enets.gif b/modules/moneybookers/logos/local/enets.gif new file mode 100644 index 000000000..f5578eb47 Binary files /dev/null and b/modules/moneybookers/logos/local/enets.gif differ diff --git a/modules/moneybookers/logos/local/epay.gif b/modules/moneybookers/logos/local/epay.gif new file mode 100644 index 000000000..3ea1278b6 Binary files /dev/null and b/modules/moneybookers/logos/local/epay.gif differ diff --git a/modules/moneybookers/logos/local/eps.gif b/modules/moneybookers/logos/local/eps.gif new file mode 100644 index 000000000..bd6ba95bb Binary files /dev/null and b/modules/moneybookers/logos/local/eps.gif differ diff --git a/modules/moneybookers/logos/local/euro6000.gif b/modules/moneybookers/logos/local/euro6000.gif new file mode 100644 index 000000000..eea25a655 Binary files /dev/null and b/modules/moneybookers/logos/local/euro6000.gif differ diff --git a/modules/moneybookers/logos/local/giropay.gif b/modules/moneybookers/logos/local/giropay.gif new file mode 100644 index 000000000..642afcf90 Binary files /dev/null and b/modules/moneybookers/logos/local/giropay.gif differ diff --git a/modules/moneybookers/logos/local/ideal.gif b/modules/moneybookers/logos/local/ideal.gif new file mode 100644 index 000000000..b3ba9f8ed Binary files /dev/null and b/modules/moneybookers/logos/local/ideal.gif differ diff --git a/modules/moneybookers/logos/local/instantbanktransfer.gif b/modules/moneybookers/logos/local/instantbanktransfer.gif new file mode 100644 index 000000000..4272a2b5d Binary files /dev/null and b/modules/moneybookers/logos/local/instantbanktransfer.gif differ diff --git a/modules/moneybookers/logos/local/laser.gif b/modules/moneybookers/logos/local/laser.gif new file mode 100644 index 000000000..5a3b9925c Binary files /dev/null and b/modules/moneybookers/logos/local/laser.gif differ diff --git a/modules/moneybookers/logos/local/nordea.gif b/modules/moneybookers/logos/local/nordea.gif new file mode 100644 index 000000000..5510d07ec Binary files /dev/null and b/modules/moneybookers/logos/local/nordea.gif differ diff --git a/modules/moneybookers/logos/local/p24.gif b/modules/moneybookers/logos/local/p24.gif new file mode 100644 index 000000000..510e6eda1 Binary files /dev/null and b/modules/moneybookers/logos/local/p24.gif differ diff --git a/modules/moneybookers/logos/local/pekao.gif b/modules/moneybookers/logos/local/pekao.gif new file mode 100644 index 000000000..5c69d43eb Binary files /dev/null and b/modules/moneybookers/logos/local/pekao.gif differ diff --git a/modules/moneybookers/logos/local/poli.gif b/modules/moneybookers/logos/local/poli.gif new file mode 100644 index 000000000..17e542d22 Binary files /dev/null and b/modules/moneybookers/logos/local/poli.gif differ diff --git a/modules/moneybookers/logos/local/postepay.gif b/modules/moneybookers/logos/local/postepay.gif new file mode 100644 index 000000000..eb17d6b6f Binary files /dev/null and b/modules/moneybookers/logos/local/postepay.gif differ diff --git a/modules/moneybookers/logos/local/sofort.gif b/modules/moneybookers/logos/local/sofort.gif new file mode 100644 index 000000000..d6fe1d5c3 Binary files /dev/null and b/modules/moneybookers/logos/local/sofort.gif differ diff --git a/modules/moneybookers/logos/local/solo.gif b/modules/moneybookers/logos/local/solo.gif new file mode 100644 index 000000000..624e56c86 Binary files /dev/null and b/modules/moneybookers/logos/local/solo.gif differ diff --git a/modules/moneybookers/logos/local/unionpay.gif b/modules/moneybookers/logos/local/unionpay.gif new file mode 100644 index 000000000..8b2a50d77 Binary files /dev/null and b/modules/moneybookers/logos/local/unionpay.gif differ diff --git a/modules/moneybookers/logos/local/visaelectron.gif b/modules/moneybookers/logos/local/visaelectron.gif new file mode 100644 index 000000000..8b7af39cc Binary files /dev/null and b/modules/moneybookers/logos/local/visaelectron.gif differ diff --git a/modules/moneybookers/moneybookers-currency-error.tpl b/modules/moneybookers/moneybookers-currency-error.tpl new file mode 100644 index 000000000..8a52659ea --- /dev/null +++ b/modules/moneybookers/moneybookers-currency-error.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + {l s='You cannot pay with Moneybookers with your present currency, please choose another currency' mod='moneybookers'} +

        \ No newline at end of file diff --git a/modules/moneybookers/moneybookers.php b/modules/moneybookers/moneybookers.php new file mode 100644 index 000000000..cd7fb35e4 --- /dev/null +++ b/modules/moneybookers/moneybookers.php @@ -0,0 +1,506 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class MoneyBookers extends PaymentModule +{ + public function __construct() + { + $this->name = 'moneybookers'; + $this->tab = 'payments_gateways'; + $this->version = '1.4'; + + parent::__construct(); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Moneybookers'); + $this->description = $this->l('Accepts payments by Moneybookers.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?'); + if (Configuration::get('MB_PAY_TO_EMAIL') == 'testmerchant@moneybookers.com') + $this->warning = $this->l('You are currently using the default Moneybookers e-mail address, please use your own e-mail address.'); + + /* MoneyBookers payment methods */ + $this->_internationalPaymentMethods = array( + 0 => array('file' => 'amex', 'name' => 'American Express', 'code' => 'AMX'), + 1 => array('file' => 'diners', 'name' => 'Diners', 'code' => 'DIN'), + 2 => array('file' => 'jcb', 'name' => 'JCB', 'code' => 'JCB'), + 3 => array('file' => 'maestro', 'name' => 'Maestro', 'code' => 'MAE'), + 4 => array('file' => 'mastercard', 'name' => 'Mastercard', 'code' => 'MSC'), + 5 => array('file' => 'visa', 'name' => 'Visa', 'code' => 'VSA'), + 6 => array('file' => 'visadebit', 'name' => 'Visa Debit', 'code' => 'VSD'), + 7 => array('file' => 'ewallet', 'name' => 'MoneyBookers eWallet', 'code' => 'WLT')); + + $this->_localPaymentMethods = array( + 0 => array('file' => '4b', 'name' => '4B', 'code' => 'MSC'), + 1 => array('file' => 'cartasi', 'name' => 'Cartasi', 'code' => 'CSI'), + 2 => array('file' => 'cartebleue', 'name' => 'Carte bleue', 'code' => 'GCB'), + 3 => array('file' => 'dankort', 'name' => 'Dankort' , 'code' => 'DNK'), + 4 => array('file' => 'ec', 'name' => 'EC', 'code' => 'ELV'), + 5 => array('file' => 'enets', 'name' => 'eNets', 'code' => 'ENT'), + 6 => array('file' => 'epay', 'name' => 'ePay', 'code' => 'EPY'), + 7 => array('file' => 'eps', 'name' => 'EPS', 'code' => 'NPY'), + 8 => array('file' => 'euro6000', 'name' => 'Euro 6000', 'code' => 'MSC'), + 9 => array('file' => 'giropay', 'name' => 'Giropay', 'code' => 'GIR'), + 10 => array('file' => 'ideal', 'name' => 'iDeal', 'code' => 'IDL'), + 11 => array('file' => 'instantbanktransfer', 'name' => 'Instant Bank Transfer', 'code' => 'PWY'), + 12 => array('file' => 'laser', 'name' => 'Laser', 'code' => 'LSR'), + 13 => array('file' => 'nordea', 'name' => 'Nordea', 'code' => 'EBT,SO2'), + 14 => array('file' => 'p24', 'name' => 'P24', 'code' => ''), + 15 => array('file' => 'pekao', 'name' => 'Pekao', 'code' => 'PWY18'), + 16 => array('file' => 'poli', 'name' => 'Poli', 'code' => 'PLI'), + 17 => array('file' => 'postepay', 'name' => 'PostePay', 'code' => 'PSP'), + 18 => array('file' => 'sofort', 'name' => 'Sofort', 'code' => 'SFT'), + 19 => array('file' => 'solo', 'name' => 'Solo', 'code' => 'SLO'), + 20 => array('file' => 'unionpay', 'name' => 'UnionPay', 'code' => ''), + 21 => array('file' => 'visaelectron', 'name' => 'Visa Electron', 'code' => 'VSE')); + + /* MoneyBookers countries (for iso 3 letters compatibility) */ + $this->_country = array('AF' => 'AFG', 'AL' => 'ALB', 'DZ' => 'DZA', 'AS' => 'ASM', 'AD' => 'AND', 'AO' => 'AGO', 'AI' => 'AIA', 'AQ' => 'ATA', 'AG' => 'ATG', 'AR' => 'ARG', + 'AM' => 'ARM', 'AW' => 'ABW', 'AU' => 'AUS', 'AT' => 'AUT', 'AZ' => 'AZE', 'BS' => 'BHS', 'BH' => 'BHR', 'BD' => 'BGD', 'BB' => 'BRB', 'BY' => 'BLR', 'BE' => 'BEL', + 'BZ' => 'BLZ', 'BJ' => 'BEN', 'BM' => 'BMU', 'BT' => 'BTN', 'BO' => 'BOL', 'BA' => 'BIH', 'BW' => 'BWA', 'BV' => 'BVT', 'BR' => 'BRA', 'IO' => 'IOT', 'BN' => 'BRN', + 'BG' => 'BGR', 'BF' => 'BFA', 'BI' => 'BDI', 'KH' => 'KHM', 'CM' => 'CMR', 'CA' => 'CAN', 'CV' => 'CPV', 'KY' => 'CYM', 'CF' => 'CAF', 'TD' => 'TCD', 'CL' => 'CHL', + 'CN' => 'CHN', 'CX' => 'CXR', 'CC' => 'CCK', 'CO' => 'COL', 'KM' => 'COM', 'CG' => 'COG', 'CK' => 'COK', 'CR' => 'CRI', 'CI' => 'CIV', 'HR' => 'HRV', 'CU' => 'CUB', + 'CY' => 'CYP', 'CZ' => 'CZE', 'DK' => 'DNK', 'DJ' => 'DJI', 'DM' => 'DMA', 'DO' => 'DOM', 'TP' => 'TMP', 'EC' => 'ECU', 'EG' => 'EGY', 'SV' => 'SLV', 'GQ' => 'GNQ', + 'ER' => 'ERI', 'EE' => 'EST', 'ET' => 'ETH', 'FK' => 'FLK', 'FO' => 'FRO', 'FJ' => 'FJI', 'FI' => 'FIN', 'FR' => 'FRA', 'FX' => 'FXX', 'GF' => 'GUF', 'PF' => 'PYF', + 'TF' => 'ATF', 'GA' => 'GAB', 'GM' => 'GMB', 'GE' => 'GEO', 'DE' => 'DEU', 'GH' => 'GHA', 'GI' => 'GIB', 'GR' => 'GRC', 'GL' => 'GRL', 'GD' => 'GRD', 'GP' => 'GLP', + 'GU' => 'GUM', 'GT' => 'GTM', 'GN' => 'GIN', 'GW' => 'GNB', 'GY' => 'GUY', 'HT' => 'HTI', 'HM' => 'HMD', 'HN' => 'HND', 'HK' => 'HKG', 'HU' => 'HUN', 'IS' => 'ISL', + 'IN' => 'IND', 'ID' => 'IDN', 'IR' => 'IRN', 'IQ' => 'IRQ', 'IE' => 'IRL', 'IL' => 'ISR', 'IT' => 'ITA', 'JM' => 'JAM', 'JP' => 'JPN', 'JO' => 'JOR', 'KZ' => 'KAZ', + 'KE' => 'KEN', 'KI' => 'KIR', 'KP' => 'PRK', 'KR' => 'KOR', 'KW' => 'KWT', 'KG' => 'KGZ', 'LA' => 'LAO', 'LV' => 'LVA', 'LB' => 'LBN', 'LS' => 'LSO', 'LR' => 'LBR', + 'LY' => 'LBY', 'LI' => 'LIE', 'LT' => 'LTU', 'LU' => 'LUX', 'MO' => 'MAC', 'MK' => 'MKD', 'MG' => 'MDG', 'MW' => 'MWI', 'MY' => 'MYS', 'MV' => 'MDV', 'ML' => 'MLI', + 'MT' => 'MLT', 'MH' => 'MHL', 'MQ' => 'MTQ', 'MR' => 'MRT', 'MU' => 'MUS', 'YT' => 'MYT', 'MX' => 'MEX', 'FM' => 'FSM', 'MD' => 'MDA', 'MC' => 'MCO', 'MN' => 'MNG', + 'MS' => 'MSR', 'MA' => 'MAR', 'MZ' => 'MOZ', 'MM' => 'MMR', 'NA' => 'NAM', 'NR' => 'NRU', 'NP' => 'NPL', 'NL' => 'NLD', 'AN' => 'ANT', 'NC' => 'NCL', 'NZ' => 'NZL', + 'NI' => 'NIC', 'NE' => 'NER', 'NG' => 'NGA', 'NU' => 'NIU', 'NF' => 'NFK', 'MP' => 'MNP', 'NO' => 'NOR', 'OM' => 'OMN', 'PK' => 'PAK', 'PW' => 'PLW', 'PA' => 'PAN', + 'PG' => 'PNG', 'PY' => 'PRY', 'PE' => 'PER', 'PH' => 'PHL', 'PN' => 'PCN', 'PL' => 'POL', 'PT' => 'PRT', 'PR' => 'PRI', 'QA' => 'QAT', 'RE' => 'REU', 'RO' => 'ROM', + 'RU' => 'RUS', 'RW' => 'RWA', 'KN' => 'KNA', 'LC' => 'LCA', 'VC' => 'VCT', 'WS' => 'WSM', 'SM' => 'SMR', 'ST' => 'STP', 'SA' => 'SAU', 'SN' => 'SEN', 'SC' => 'SYC', + 'SL' => 'SLE', 'SG' => 'SGP', 'SK' => 'SVK', 'SI' => 'SVN', 'SB' => 'SLB', 'SO' => 'SOM', 'ZA' => 'ZAF', 'GS' => 'SGS', 'ES' => 'ESP', 'LK' => 'LKA', 'SH' => 'SHN', + 'PM' => 'SPM', 'SD' => 'SDN', 'SR' => 'SUR', 'SJ' => 'SJM', 'SZ' => 'SWZ', 'SE' => 'SWE', 'CH' => 'CHE', 'SY' => 'SYR', 'TW' => 'TWN', 'TJ' => 'TJK', 'TZ' => 'TZA', + 'TH' => 'THA', 'TG' => 'TGO', 'TK' => 'TKL', 'TO' => 'TON', 'TT' => 'TTO', 'TN' => 'TUN', 'TR' => 'TUR', 'TM' => 'TKM', 'TC' => 'TCA', 'TV' => 'TUV', 'UG' => 'UGA', + 'UA' => 'UKR', 'AE' => 'ARE', 'GB' => 'GBR', 'US' => 'USA', 'UM' => 'UMI', 'UY' => 'URY', 'UZ' => 'UZB', 'VU' => 'VUT', 'VA' => 'VAT', 'VE' => 'VEN', 'VN' => 'VNM', + 'VG' => 'VGB', 'VI' => 'VIR', 'WF' => 'WLF', 'EH' => 'ESH', 'YE' => 'YEM', 'YU' => 'YUG', 'ZR' => 'ZAR', 'ZM' => 'ZMB', 'ZW' => 'ZWE'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) + return false; + Configuration::updateValue('MB_HIDE_LOGIN', 1); + Configuration::updateValue('MB_PAY_TO_EMAIL', Configuration::get('PS_SHOP_EMAIL')); + Configuration::updateValue('MB_CANCEL_URL', (Configuration::get('PS_SSL_ENABLED') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__); + Configuration::updateValue('MB_ID_LOGO', 1); + Configuration::updateValue('MB_ID_LOGO_WALLET', 1); + Configuration::updateValue('MB_PARAMETERS', 0); + Configuration::updateValue('MB_DISPLAY_MODE', 0); + + return true; + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + + /* Clean configuration table */ + Configuration::deleteByName('MB_PAY_TO_EMAIL'); + Configuration::deleteByName('MB_CANCEL_URL'); + Configuration::deleteByName('MB_HIDE_LOGIN'); + Configuration::deleteByName('MB_SECRET_WORD'); + Configuration::deleteByName('MB_ID_LOGO'); + Configuration::deleteByName('MB_ID_LOGO_WALLET'); + Configuration::deleteByName('MB_PARAMETERS'); + Configuration::deleteByName('MB_DISPLAY_MODE'); + + return true; + } + + public function getContent() + { + global $cookie; + + $output = ' +

        Moneybookers


        '; + + $errors = array(); + + /* Validate account */ + if (isset($_POST['SubmitValidation'])) + { + if (isset($_POST['mb_email_to_validate']) AND !empty($_POST['mb_email_to_validate'])) + { + $fp = fopen('http://moneybookers.prestashop.com/email_check.php?email='.$_POST['mb_email_to_validate'].'&url='.Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__, 'r'); + if (!$fp) + $errors[] = $this->l('Unable to contact activation server, please try again later.'); + else + { + $response = trim(strtolower(fgets($fp, 4096))); + if (!strstr('ok', $response)) + $errors[] = $this->l('Account validation failed, please check your e-mail.'); + else + { + Configuration::updateValue('MB_PAY_TO_EMAIL', $_POST['mb_email_to_validate']); + Configuration::updateValue('MB_PARAMETERS', 1); + + $output .= ' +
          +
        • '.$this->l('E-mail activation successful, you can now validate your secret word.').'
        • +
        '; + } + fclose($fp); + } + } + else + $errors[] = $this->l('E-mail field is required'); + } + + /* Validate secret word */ + if (isset($_POST['SubmitSecret'])) + { + if (isset($_POST['mb_sw_to_validate']) AND !empty($_POST['mb_sw_to_validate'])) + { + $fp = fopen('http://moneybookers.prestashop.com/email_check.php?email='.Configuration::get('MB_PAY_TO_EMAIL').'&url='.Tools::getProtocol().$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'&sw=1&secret_word='.md5($_POST['mb_sw_to_validate']), 'r'); + if (!$fp) + $errors[] = $this->l('Unable to contact activation server, please try again later.'); + else + { + $response = trim(strtolower(fgets($fp, 4096))); + if (strstr('velocity_check_exceeded', $response)) + $errors[] = $this->l('Secret word validation failed, exceeded max tries (3 per hour)'); + elseif (!strstr('ok', $response)) + $errors[] = $this->l('Secret word validation failed, please check your secret word.'); + else + { + Configuration::updateValue('MB_SECRET_WORD', $_POST['mb_sw_to_validate']); + Configuration::updateValue('MB_PARAMETERS_2', 1); + + $output .= ' +
          +
        • '.$this->l('Account activation successful, secret word OK').'
        • +
        '; + } + fclose($fp); + } + } + else + $errors[] = $this->l('Secret word field is required'); + } + + /* Update configuration variables */ + if (isset($_POST['submitMoneyBookers'])) + { + if (!isset($_POST['mb_hide_login'])) + $_POST['mb_hide_login'] = 0; + + Configuration::updateValue('MB_CANCEL_URL', $_POST['mb_cancel_url']); + Configuration::updateValue('MB_HIDE_LOGIN', (int)($_POST['mb_hide_login'])); + + $local = ''; + $inter = ''; + foreach ($_POST AS $key => $value) + { + if (strstr($key, 'mb_local_')) + { + preg_match('/mb_local_([0-9]+)/', $key, $matches); + if (isset($matches[1])) + $local .= $matches[1].'|'; + } + elseif (strstr($key, 'mb_inter_')) + { + preg_match('/mb_inter_([0-9]+)/', $key, $matches); + if (isset($matches[1])) + $inter .= $matches[1].'|'; + } + } + $local = rtrim($local, '|'); + $inter = rtrim($inter, '|'); + + Configuration::updateValue('MB_LOCAL_METHODS', $local); + Configuration::updateValue('MB_INTER_METHODS', $inter); + Configuration::updateValue('MB_DISPLAY_MODE', (int)($_POST['mb_display_mode'])); + } + + /* Display errors */ + if (sizeof($errors)) + { + $output .= '
          '; + foreach ($errors AS $error) + $output .= '
        • '.$error.'
        • '; + $output .= '
        '; + } + + $lang = new Language((int)($cookie->id_lang)); + $iso_img = $lang->iso_code; + if ($lang->iso_code != 'fr' AND $lang->iso_code != 'en') + $iso_img = 'en'; + + $manual_links = array( + 'en' => 'http://www.prestashop.com/partner/Activation_Manual_Prestashop_EN.pdf', + 'es' => 'http://www.prestashop.com/partner/Manual%20de%20Activacion%20Prestashop_ES.pdf', + 'fr' => 'http://www.prestashop.com/partner/Manuel_Activation_Prestashop_FR.pdf'); + + $iso_manual = $lang->iso_code; + if (!array_key_exists($lang->iso_code, $manual_links)) + $iso_manual = 'en'; + + /* Display settings form */ + $output .= ' + '.$this->l('About Moneybookers').'

        '. + $this->l('Moneybookers is one of Europe\'s largest online payment systems and among the world\'s leading eWallet providers, with over 14 million account holders. The simple eWallet enables customers to conveniently and securely pay online without revealing personal financial data, as well as to send and receive money transfers cost-effectively by using an e-mail address.').'

        '. + $this->l('Moneybookers worldwide payment network offers businesses access to over 80 local payment options in over 200 countries with just one integration. Already more than 60,000 merchants use the Moneybookers payment service, including global partners such as eBay, Skype and Thomas Cook.').'

        '.$this->l('Moneybookers was founded in 2001 in London and is regulated by the Financial Services Authority of the United Kingdom.').'

        +
        + +
        +
        + '.$this->l('Open Account').' + '.$this->l('Start by opening a').' '.$this->l('free account').' '.$this->l('with Moneybookers:').' +

        PrestaShop & Moneybookers

        + '.$this->l('Thanks to the PrestaShop/Moneybookers partnership,').'
        '.$this->l('you will get a preferential commission rate!').'

        +

        +


        + '.$this->l('Then click here:').' +

        +
        +
        + + + + + + '; + + return $output; + } + + public function hookPayment($params) + { + global $smarty, $cookie; + + if (!Configuration::get('MB_PARAMETERS') OR !Configuration::get('MB_PARAMETERS_2') OR (Configuration::get('MB_LOCAL_METHODS') == '' AND Configuration::get('MB_INTER_METHODS') == '')) + return; + + $flag = false; + $allowedCurrencies = $this->getCurrency((int)$params['cart']->id_currency); + foreach ($allowedCurrencies AS $allowedCurrency) + if ($allowedCurrency['id_currency'] == $params['cart']->id_currency) + { + $flag = true; + break; + } + + if (!$flag) + { + /* Uncomment the line below if you'd like to display an error message, rather than not showing the Moneybookers module */ + // return $this->display(__FILE__, 'moneybookers-currency-error.tpl'); + } + else + { + $localMethods = Configuration::get('MB_LOCAL_METHODS'); + $interMethods = Configuration::get('MB_INTER_METHODS'); + + $smarty->assign(array( + 'display_mode' => (int)(Configuration::get('MB_DISPLAY_MODE')), + 'local' => $localMethods ? explode('|', $localMethods) : array(), + 'inter' => $interMethods ? explode('|', $interMethods) : array(), + 'local_logos' => $this->_localPaymentMethods, + 'inter_logos' => $this->_internationalPaymentMethods)); + + /* Load objects */ + $address = new Address((int)($params['cart']->id_address_delivery)); + $countryObj = new Country((int)($address->id_country), Configuration::get('PS_LANG_DEFAULT')); + $customer = new Customer((int)($params['cart']->id_customer)); + $currency = new Currency((int)($params['cart']->id_currency)); + $lang = new Language((int)($cookie->id_lang)); + + $mbParams = array(); + + /* About the merchant */ + $mbParams['pay_to_email'] = Configuration::get('MB_PAY_TO_EMAIL'); + $mbParams['recipient_description'] = Configuration::get('PS_SHOP_NAME'); + $mbParams['hide_login'] = (int)(Configuration::get('MB_HIDE_LOGIN')); + $mbParams['id_logo'] = (int)(Configuration::get('MB_ID_LOGO')); + $mbParams['return_url'] = (Configuration::get('PS_SSL_ENABLED') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)($params['cart']->id).'&id_module='.(int)($this->id).'&key='.$customer->secure_key; + $mbParams['cancel_url'] = Configuration::get('MB_CANCEL_URL'); + + /* About the customer */ + $mbParams['pay_from_email'] = $customer->email; + $mbParams['firstname'] = $address->firstname; + $mbParams['lastname'] = $address->lastname; + $mbParams['address'] = $address->address1; + $mbParams['address2'] = $address->address2; + $mbParams['phone_number'] = !empty($address->phone_mobile) ? $address->phone_mobile : $address->phone; + $mbParams['postal_code'] = $address->postcode; + $mbParams['city'] = $address->city; + $mbParams['country'] = $this->_country[strtoupper($countryObj->iso_code)]; + $mbParams['language'] = strtoupper($lang->iso_code); + $mbParams['date_of_birth'] = substr($customer->birthday, 5, 2).substr($customer->birthday, 8, 2).substr($customer->birthday, 0, 4); + + /* About the cart */ + $mbParams['transaction_id'] = (int)($params['cart']->id).'_'.date('YmdHis').'_'.$params['cart']->secure_key; + $mbParams['currency'] = $currency->iso_code; + $mbParams['amount'] = number_format($params['cart']->getOrderTotal(), 2, '.', ''); + + /* URLs */ + $mbParams['status_url'] = (Configuration::get('PS_SSL_ENABLED') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/'.$this->name.'/validation.php'; + + /* Assign settings to Smarty template */ + $smarty->assign($mbParams); + + /* Display the MoneyBookers iframe */ + return $this->display(__FILE__, 'moneybookers.tpl'); + } + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + global $smarty; + + switch($params['objOrder']->getCurrentState()) + { + case _PS_OS_PAYMENT_: + case _PS_OS_OUTOFSTOCK_: + $smarty->assign('status', 'ok'); + break; + + case _PS_OS_BANKWIRE_: + $smarty->assign('status', 'pending'); + break; + + case _PS_OS_ERROR_: + default: + $smarty->assign('status', 'failed'); + break; + } + + return $this->display(__FILE__, 'confirmation.tpl'); + } +} + + diff --git a/modules/moneybookers/moneybookers.tpl b/modules/moneybookers/moneybookers.tpl new file mode 100644 index 000000000..117d07839 --- /dev/null +++ b/modules/moneybookers/moneybookers.tpl @@ -0,0 +1,160 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $display_mode == 0} +
        +

        + + + + + + + + + + + + + + {if (!empty($date_of_birth))}{/if} + + {if (!empty($address2))}{/if} + {if (!empty($phone_number))}{/if} + + + {if isset($state) && !empty($state)}{/if} + + + + + + + + + + + + + + + {foreach from=$inter item=i} + + {/foreach} + {foreach from=$local item=i} + + {/foreach} +

        +
        +
        +{else} + {foreach from=$inter item=i} +
        +

        + + + + + + + + + + + + + + {if (!empty($date_of_birth))}{/if} + + {if (!empty($address2))}{/if} + {if (!empty($phone_number))}{/if} + + + {if isset($state) && !empty($state)}{/if} + + + + + + + + + + + + + + + + {l s='Pay by' mod='moneybookers'} {$inter_logos[$i].name} +

        +
        + {/foreach} + {foreach from=$local item=i} +
        +

        + + + + + + + + + + + + + + {if (!empty($date_of_birth))}{/if} + + {if (!empty($address2))}{/if} + {if (!empty($phone_number))}{/if} + + + {if isset($state) && (!empty($state))}{/if} + + + + + + + + + + + + + + + + {l s='Pay by' mod='moneybookers'} {$local_logos[$i].name} +
        +

        +
        + {/foreach} +{/if} + diff --git a/modules/moneybookers/prestashop_mb_en.gif b/modules/moneybookers/prestashop_mb_en.gif new file mode 100644 index 000000000..4e07028de Binary files /dev/null and b/modules/moneybookers/prestashop_mb_en.gif differ diff --git a/modules/moneybookers/prestashop_mb_fr.gif b/modules/moneybookers/prestashop_mb_fr.gif new file mode 100644 index 000000000..ec2bd9ddd Binary files /dev/null and b/modules/moneybookers/prestashop_mb_fr.gif differ diff --git a/modules/moneybookers/validation.php b/modules/moneybookers/validation.php new file mode 100644 index 000000000..63d8f81e0 --- /dev/null +++ b/modules/moneybookers/validation.php @@ -0,0 +1,83 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/moneybookers.php'); + +$moneyBookers = new MoneyBookers(); + +$errors = array(); + +/* Check for mandatory fields */ +$requiredFields = array('status', 'md5sig', 'merchant_id', 'pay_to_email', 'mb_amount', +'mb_transaction_id', 'currency', 'amount', 'transaction_id', 'pay_from_email', 'mb_currency'); + +foreach ($requiredFields AS $field) + if (!isset($_POST[$field])) + $errors[] = 'Missing field '.$field; + +/* Check for MD5 signature */ +$md5 = strtoupper(md5($_POST['merchant_id'].$_POST['transaction_id'].strtoupper(md5(Configuration::get('MB_SECRET_WORD'))).$_POST['mb_amount'].$_POST['mb_currency'].$_POST['status'])); +if ($md5 != $_POST['md5sig']) + $errors[] = 'Please double-check your Moneybookers account to make sure you have received the payment (Yours / MB) ['.$md5.'] ['.$_POST['md5sig'].']'; + +$message = ''; +foreach ($_POST AS $key => $value) + $message .= $key.': '.$value."\n"; +if (sizeof($errors)) +{ + $message .= sizeof($errors).' error(s):'."\n"; + + /* Force status to 1 - ERROR ! */ + $_POST['status'] = 1; +} +foreach ($errors AS $error) + $message .= $error."\n"; +$message = nl2br(strip_tags($message)); + +$id_cart = (int)(substr($_POST['transaction_id'], 0, strpos($_POST['transaction_id'], '_'))); +$secure_cart = explode('_', $_POST['transaction_id']); +$status = (int)($_POST['status']); +switch ($status) +{ + /* Bankwire */ + case 0: + $moneyBookers->validateOrder((int)($secure_cart[0]), _PS_OS_BANKWIRE_, (float)($_POST['amount']), $moneyBookers->displayName, $message, array(), NULL, false, $secure_cart[2]); + break; + + /* Payment OK */ + case 2: + $moneyBookers->validateOrder((int)($secure_cart[0]), _PS_OS_PAYMENT_, (float)($_POST['amount']), $moneyBookers->displayName, $message, array(), NULL, false, $secure_cart[2]); + break; + + /* Unknown or error */ + default: + $moneyBookers->validateOrder((int)($secure_cart[0]), _PS_OS_ERROR_, 0, $moneyBookers->displayName, $message, array(), NULL, false, $secure_cart[2]); + break; +} + + diff --git a/modules/newsletter/config.xml b/modules/newsletter/config.xml new file mode 100755 index 000000000..3e0952f41 --- /dev/null +++ b/modules/newsletter/config.xml @@ -0,0 +1,11 @@ + + + newsletter + Newsletter + 2 + Generates a .CSV file for mass mailings + PrestaShop + administration + 1 + 1 + \ No newline at end of file diff --git a/modules/newsletter/de.php b/modules/newsletter/de.php new file mode 100644 index 000000000..a5b3b3207 --- /dev/null +++ b/modules/newsletter/de.php @@ -0,0 +1,32 @@ +newsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_804a924e464fd21ed92f820224c4091d'] = 'Erzeugt eine .CSV-Datei für Massenmailings'; +$_MODULE['<{newsletter}prestashop>newsletter_c3987e4cac14a8456515f0d200da04ee'] = 'Alle Länder'; +$_MODULE['<{newsletter}prestashop>newsletter_fa01fd956e87307bce4c90a0de9b0437'] = 'Kundenländer'; +$_MODULE['<{newsletter}prestashop>newsletter_c0859b0a5241dff468da2a9a93c3284f'] = 'Betreiben Sie einen Filter für das Kundenland.'; +$_MODULE['<{newsletter}prestashop>newsletter_2198f293f5e1e95dddeff819fbca0975'] = 'Newsletter-Abonnenten'; +$_MODULE['<{newsletter}prestashop>newsletter_99006a61d48499231e1be92241cf772a'] = 'Newsletter-Abonnenten Filtern.'; +$_MODULE['<{newsletter}prestashop>newsletter_7e3a51a56ddd2846e21c33f05e0aea6f'] = 'Alle Kunden'; +$_MODULE['<{newsletter}prestashop>newsletter_39f7a3e2b56e9bfd753ba6325533a127'] = 'Abonnenten'; +$_MODULE['<{newsletter}prestashop>newsletter_011d8c5d94f729f013963d856cd78745'] = 'Nicht-Abonnenten'; +$_MODULE['<{newsletter}prestashop>newsletter_793ee192a9124cd6f529460eef17d3e5'] = 'Opt-in-Abonnenten'; +$_MODULE['<{newsletter}prestashop>newsletter_7b15c043d66fecc45c8752592aa38e38'] = 'Opt-in Abonnenten filtern.'; +$_MODULE['<{newsletter}prestashop>newsletter_82e5e0bc0f9c776c98253d569c111c0f'] = 'Keine Kunden mit diesen Filtern gefunden!'; +$_MODULE['<{newsletter}prestashop>newsletter_d526d090aa22242fa5f6acfccc6bd007'] = 'Die .CSV-Datei wurde erfolgreich exportiert'; +$_MODULE['<{newsletter}prestashop>newsletter_55caa4828d4e935c2ba9f1558f1c4edd'] = 'Kunden gefunden'; +$_MODULE['<{newsletter}prestashop>newsletter_48e3d5f66961b621c78f709afcd7d437'] = 'Laden Sie die Datei herunter'; +$_MODULE['<{newsletter}prestashop>newsletter_faa1115fbab933e7178ee43ce1590977'] = 'ACHTUNG: Wenn Sie diese CSV-Datei mit Excel zu öffnen versuchen, vergessen Sie nicht, den UTF-8 Code zu wählen, sonst können seltsame Zeichen erscheinen'; +$_MODULE['<{newsletter}prestashop>newsletter_81573e0ea79138f02fd2cee94786d7e9'] = 'Fehler: kann nicht schreiben'; +$_MODULE['<{newsletter}prestashop>newsletter_8d550e9bf69bfc7a09be6eeb1622ae23'] = 'Es gibt zwei Arten für dieses Modul:'; +$_MODULE['<{newsletter}prestashop>newsletter_23e8f8a55548b88bfbdcd1f6ba26a010'] = 'Personen, die den Newsletter über den BlockNewsletter Block im Front-Office abonniert haben.'; +$_MODULE['<{newsletter}prestashop>newsletter_27d1ec406fd2baf49d03f81a4bb41122'] = 'Dies wird eine Liste mit E-Mails von Personen, die Ihren Shop besuchen und nicht Kunden werden, sondern Ihren Newsletter erhalten wollen. Mit der Benutzung der untenstehenden Liste \"Export Newsletter Abonnenten\"wird eine . CSV-Datei generiert, die auf den BlockNewsletter Abonnenten-Daten basiert .'; +$_MODULE['<{newsletter}prestashop>newsletter_74ca54506cdbc82e3aa763ba91b8fa39'] = 'Kunden, die \"ja\" angeklickt haben, um einen Newsletter in ihrem Kundenprofil zu erhalten.'; +$_MODULE['<{newsletter}prestashop>newsletter_1aa14f5a6423dbde1ef2cfe4734980b4'] = 'Der Abschnitt \"Export Kunden\" unten filtert die Kunden, denen Sie einen Newsletter schicken möchten.'; +$_MODULE['<{newsletter}prestashop>newsletter_b192ab83a19105bbf1e2d1fab548249a'] = 'Export Newsletter-Abonnenten'; +$_MODULE['<{newsletter}prestashop>newsletter_a60401e616125189d78605b2ddd7ff45'] = 'Erzeugen Sie eine. CSV-Datei aus BlockNewsletter Abonnenten-Daten.'; +$_MODULE['<{newsletter}prestashop>newsletter_dbb392a2dc9b38722e69f6032faea73e'] = '.CSV-Datei exportieren'; +$_MODULE['<{newsletter}prestashop>newsletter_4713ef5f2d6fc1e8f088c850e696a04b'] = 'Kunden exportieren '; +$_MODULE['<{newsletter}prestashop>newsletter_2f5a2bf1a10d25a408a8bab945e4dd3c'] = '.CSV-Datei aus Kunden-Konto-Daten generieren '; diff --git a/modules/newsletter/en.php b/modules/newsletter/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/newsletter/en.php @@ -0,0 +1,4 @@ +newsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_804a924e464fd21ed92f820224c4091d'] = 'Genere un fichero .CSV para mailing masivo'; +$_MODULE['<{newsletter}prestashop>newsletter_c3987e4cac14a8456515f0d200da04ee'] = 'Todos los países'; +$_MODULE['<{newsletter}prestashop>newsletter_fa01fd956e87307bce4c90a0de9b0437'] = 'País del cliente'; +$_MODULE['<{newsletter}prestashop>newsletter_c0859b0a5241dff468da2a9a93c3284f'] = 'Aplicar un filtro al país del cliente'; +$_MODULE['<{newsletter}prestashop>newsletter_2198f293f5e1e95dddeff819fbca0975'] = 'Suscritos a la newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_99006a61d48499231e1be92241cf772a'] = 'Filtro de suscriptores a la newsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_7e3a51a56ddd2846e21c33f05e0aea6f'] = 'Todos los clientes'; +$_MODULE['<{newsletter}prestashop>newsletter_39f7a3e2b56e9bfd753ba6325533a127'] = 'suscritos'; +$_MODULE['<{newsletter}prestashop>newsletter_011d8c5d94f729f013963d856cd78745'] = 'no suscritos'; +$_MODULE['<{newsletter}prestashop>newsletter_793ee192a9124cd6f529460eef17d3e5'] = 'Inscritos a publicidades'; +$_MODULE['<{newsletter}prestashop>newsletter_7b15c043d66fecc45c8752592aa38e38'] = 'Operar un filtro a los inscritos a publicidades'; +$_MODULE['<{newsletter}prestashop>newsletter_82e5e0bc0f9c776c98253d569c111c0f'] = 'Noy hay clientes a los que se aplique este filtro'; +$_MODULE['<{newsletter}prestashop>newsletter_d526d090aa22242fa5f6acfccc6bd007'] = 'El fichero .CSV ha sido exportado correctamente'; +$_MODULE['<{newsletter}prestashop>newsletter_55caa4828d4e935c2ba9f1558f1c4edd'] = 'clientes encontrados'; +$_MODULE['<{newsletter}prestashop>newsletter_48e3d5f66961b621c78f709afcd7d437'] = 'Descargar el fichero'; +$_MODULE['<{newsletter}prestashop>newsletter_faa1115fbab933e7178ee43ce1590977'] = 'ATENCION: Si trata de abrir el fichero .CSV con Excel, no olvide seleccionar el UTF-8 para el encodage, si no aparecerán caracteres incorrectos'; +$_MODULE['<{newsletter}prestashop>newsletter_81573e0ea79138f02fd2cee94786d7e9'] = 'Error: imposible escribir en'; +$_MODULE['<{newsletter}prestashop>newsletter_8d550e9bf69bfc7a09be6eeb1622ae23'] = 'Hay dos tipos de módulos:'; +$_MODULE['<{newsletter}prestashop>newsletter_23e8f8a55548b88bfbdcd1f6ba26a010'] = 'Las personas que hayan suscrito utilizando el bloque newsletter en la página de inicio.'; +$_MODULE['<{newsletter}prestashop>newsletter_27d1ec406fd2baf49d03f81a4bb41122'] = 'Esta será una lista de direcciones de correo para las personas que visiten su tienda y no se convierta en clientes, pero que desean obtener su newsletter. Use \\\"Newsletter Suscriptores de exportación\\\" más abajo para generar una . CSV sobre la base de los usuarios de los datos del bloque Newsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_74ca54506cdbc82e3aa763ba91b8fa39'] = 'Los clientes que han dicho \"sí\" para recibir la newsletter en su perfil de cliente.'; +$_MODULE['<{newsletter}prestashop>newsletter_1aa14f5a6423dbde1ef2cfe4734980b4'] = 'La sección \"exportación clientes\" debajo de los filtros para clientes a los que quiere enviar la newsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_b192ab83a19105bbf1e2d1fab548249a'] = 'Exportar suscritos a la newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_a60401e616125189d78605b2ddd7ff45'] = 'Generar un archivo. CSV BlockNewsletter sobre la base de datos de suscriptores.'; +$_MODULE['<{newsletter}prestashop>newsletter_dbb392a2dc9b38722e69f6032faea73e'] = 'Exportar un fichero .CSV'; +$_MODULE['<{newsletter}prestashop>newsletter_4713ef5f2d6fc1e8f088c850e696a04b'] = 'Exportar clientes'; +$_MODULE['<{newsletter}prestashop>newsletter_2f5a2bf1a10d25a408a8bab945e4dd3c'] = 'Generar un archivo. CSV de datos de la cuenta del cliente'; diff --git a/modules/newsletter/fr.php b/modules/newsletter/fr.php new file mode 100644 index 000000000..60c7c154f --- /dev/null +++ b/modules/newsletter/fr.php @@ -0,0 +1,32 @@ +newsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Lettre d\'informations'; +$_MODULE['<{newsletter}prestashop>newsletter_804a924e464fd21ed92f820224c4091d'] = 'Génère un fichier .CSV pour votre envoi d\'e-mails'; +$_MODULE['<{newsletter}prestashop>newsletter_c3987e4cac14a8456515f0d200da04ee'] = 'Tous les pays'; +$_MODULE['<{newsletter}prestashop>newsletter_fa01fd956e87307bce4c90a0de9b0437'] = 'Pays du client'; +$_MODULE['<{newsletter}prestashop>newsletter_c0859b0a5241dff468da2a9a93c3284f'] = 'Opérer un filtre sur le pays des clients.'; +$_MODULE['<{newsletter}prestashop>newsletter_2198f293f5e1e95dddeff819fbca0975'] = 'Inscrits lettre d\'info.'; +$_MODULE['<{newsletter}prestashop>newsletter_99006a61d48499231e1be92241cf772a'] = 'Opérer un filtre sur les inscrits à la lettre d\'information.'; +$_MODULE['<{newsletter}prestashop>newsletter_7e3a51a56ddd2846e21c33f05e0aea6f'] = 'Tous les clients'; +$_MODULE['<{newsletter}prestashop>newsletter_39f7a3e2b56e9bfd753ba6325533a127'] = 'Inscrits'; +$_MODULE['<{newsletter}prestashop>newsletter_011d8c5d94f729f013963d856cd78745'] = 'Non-inscrits'; +$_MODULE['<{newsletter}prestashop>newsletter_793ee192a9124cd6f529460eef17d3e5'] = 'Inscrits pub'; +$_MODULE['<{newsletter}prestashop>newsletter_7b15c043d66fecc45c8752592aa38e38'] = 'Opérer un filtre sur les inscrits aux messages publicitaires.'; +$_MODULE['<{newsletter}prestashop>newsletter_82e5e0bc0f9c776c98253d569c111c0f'] = 'Aucun client trouvé avec ces paramètres'; +$_MODULE['<{newsletter}prestashop>newsletter_d526d090aa22242fa5f6acfccc6bd007'] = 'Le fichier .CSV a été créé avec succès'; +$_MODULE['<{newsletter}prestashop>newsletter_55caa4828d4e935c2ba9f1558f1c4edd'] = 'clients trouvés'; +$_MODULE['<{newsletter}prestashop>newsletter_48e3d5f66961b621c78f709afcd7d437'] = 'Télécharger le fichier'; +$_MODULE['<{newsletter}prestashop>newsletter_faa1115fbab933e7178ee43ce1590977'] = 'ATTENTION: Si vous tentez d\'ouvrir le fichier .csv avec Excel, n\'oubliez pas de sélectionner l\'UTF-8 comme encodage, sinon vous aurez des caractères incorrects'; +$_MODULE['<{newsletter}prestashop>newsletter_81573e0ea79138f02fd2cee94786d7e9'] = 'Erreur : impossible d\'écrire vers'; +$_MODULE['<{newsletter}prestashop>newsletter_8d550e9bf69bfc7a09be6eeb1622ae23'] = 'Ce module est divisé en 2 parties :'; +$_MODULE['<{newsletter}prestashop>newsletter_23e8f8a55548b88bfbdcd1f6ba26a010'] = 'Les personnes ayant indiqué leur adresse dans le bloc newsletter de la page d\'accueil'; +$_MODULE['<{newsletter}prestashop>newsletter_27d1ec406fd2baf49d03f81a4bb41122'] = 'La liste ne comprendra alors que les adresses e-mails.'; +$_MODULE['<{newsletter}prestashop>newsletter_74ca54506cdbc82e3aa763ba91b8fa39'] = 'Les clients ayant coché la case \"oui\" pour la souscription à la liste de diffusion.'; +$_MODULE['<{newsletter}prestashop>newsletter_1aa14f5a6423dbde1ef2cfe4734980b4'] = 'Cette liste pourra être triée selon le type de client.'; +$_MODULE['<{newsletter}prestashop>newsletter_b192ab83a19105bbf1e2d1fab548249a'] = 'Exporter les inscrits à la newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_a60401e616125189d78605b2ddd7ff45'] = 'Génère un fichier .CSV à partir des données des inscrits au BlockNewsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_dbb392a2dc9b38722e69f6032faea73e'] = 'Exporte un fichier CSV'; +$_MODULE['<{newsletter}prestashop>newsletter_4713ef5f2d6fc1e8f088c850e696a04b'] = 'Export des clients'; +$_MODULE['<{newsletter}prestashop>newsletter_2f5a2bf1a10d25a408a8bab945e4dd3c'] = 'Génère un fichier .CSV à partir des données des clients.'; diff --git a/modules/newsletter/it.php b/modules/newsletter/it.php new file mode 100644 index 000000000..a731d6d14 --- /dev/null +++ b/modules/newsletter/it.php @@ -0,0 +1,32 @@ +newsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_804a924e464fd21ed92f820224c4091d'] = 'Genera un file. CSV per invii di massa'; +$_MODULE['<{newsletter}prestashop>newsletter_c3987e4cac14a8456515f0d200da04ee'] = 'Tutti i paesi'; +$_MODULE['<{newsletter}prestashop>newsletter_fa01fd956e87307bce4c90a0de9b0437'] = 'Paese dei clienti'; +$_MODULE['<{newsletter}prestashop>newsletter_c0859b0a5241dff468da2a9a93c3284f'] = 'Opera un filtro sul paese dei clienti.'; +$_MODULE['<{newsletter}prestashop>newsletter_2198f293f5e1e95dddeff819fbca0975'] = 'Iscritti alla newsletter'; +$_MODULE['<{newsletter}prestashop>newsletter_99006a61d48499231e1be92241cf772a'] = 'Filtro iscritti newsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_7e3a51a56ddd2846e21c33f05e0aea6f'] = 'Tutti i clienti'; +$_MODULE['<{newsletter}prestashop>newsletter_39f7a3e2b56e9bfd753ba6325533a127'] = 'Iscritti'; +$_MODULE['<{newsletter}prestashop>newsletter_011d8c5d94f729f013963d856cd78745'] = 'Non iscritti'; +$_MODULE['<{newsletter}prestashop>newsletter_793ee192a9124cd6f529460eef17d3e5'] = 'Iscritti opt-in'; +$_MODULE['<{newsletter}prestashop>newsletter_7b15c043d66fecc45c8752592aa38e38'] = 'Sottoscrittori opt-in filtri'; +$_MODULE['<{newsletter}prestashop>newsletter_82e5e0bc0f9c776c98253d569c111c0f'] = 'Nessun cliente trovato con questi filtri!'; +$_MODULE['<{newsletter}prestashop>newsletter_d526d090aa22242fa5f6acfccc6bd007'] = 'Il file. CSV è stato esportato con successo'; +$_MODULE['<{newsletter}prestashop>newsletter_55caa4828d4e935c2ba9f1558f1c4edd'] = 'cliente trovato'; +$_MODULE['<{newsletter}prestashop>newsletter_48e3d5f66961b621c78f709afcd7d437'] = 'Scarica il file'; +$_MODULE['<{newsletter}prestashop>newsletter_faa1115fbab933e7178ee43ce1590977'] = '. ATTENZIONE: Se si tenta di aprire questo file .csv con Excel, non dimenticare di scegliere la codifica UTF-8 o puoi vedere caratteri strani'; +$_MODULE['<{newsletter}prestashop>newsletter_81573e0ea79138f02fd2cee94786d7e9'] = 'Errore: impossibile scrivere a'; +$_MODULE['<{newsletter}prestashop>newsletter_8d550e9bf69bfc7a09be6eeb1622ae23'] = 'Modulo diviso in due tipologie:'; +$_MODULE['<{newsletter}prestashop>newsletter_23e8f8a55548b88bfbdcd1f6ba26a010'] = 'Le persone che si sono iscritte usando il blocco BlockNewsletter nel front office.'; +$_MODULE['<{newsletter}prestashop>newsletter_27d1ec406fd2baf49d03f81a4bb41122'] = 'Questo sarà un elenco di indirizzi email delle persone che si recano nel tuo negozio non per diventare un cliente, ma per ottenere la tua newsletter. Utilizzando il seguente \"Esporta iscritti alla newsletter\" genererà un file. CSV sulla base dei dati abbonati BlockNewsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_74ca54506cdbc82e3aa763ba91b8fa39'] = 'I clienti che hanno risposto \"sì\" per ricevere una newsletter nel loro profilo del cliente.'; +$_MODULE['<{newsletter}prestashop>newsletter_1aa14f5a6423dbde1ef2cfe4734980b4'] = 'La sezione seguente \"Esporta clienti\" filtra a quali clienti si desidera inviare una newsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_b192ab83a19105bbf1e2d1fab548249a'] = 'Export Newsletter Iscritti'; +$_MODULE['<{newsletter}prestashop>newsletter_a60401e616125189d78605b2ddd7ff45'] = 'Genera un file. CSV sulla base dei dati abbonati BlockNewsletter.'; +$_MODULE['<{newsletter}prestashop>newsletter_dbb392a2dc9b38722e69f6032faea73e'] = 'Esporta file. CSV'; +$_MODULE['<{newsletter}prestashop>newsletter_4713ef5f2d6fc1e8f088c850e696a04b'] = 'Esporta clienti'; +$_MODULE['<{newsletter}prestashop>newsletter_2f5a2bf1a10d25a408a8bab945e4dd3c'] = 'Genera un file. CSV dai dati account clienti'; diff --git a/modules/newsletter/logo.gif b/modules/newsletter/logo.gif new file mode 100644 index 000000000..06dd879da Binary files /dev/null and b/modules/newsletter/logo.gif differ diff --git a/modules/newsletter/newsletter.php b/modules/newsletter/newsletter.php new file mode 100644 index 000000000..aa75d5f4e --- /dev/null +++ b/modules/newsletter/newsletter.php @@ -0,0 +1,233 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Newsletter extends Module +{ + private $_postErrors = array(); + private $_html = ''; + private $_postSucess; + + public function __construct() + { + global $cookie; + + $this->name = 'newsletter'; + $this->tab = 'administration'; + $this->version = 2.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Newsletter'); + $this->description = $this->l('Generates a .CSV file for mass mailings'); + + if ($this->id) + { + $this->_file = 'export_'.Configuration::get('PS_NEWSLETTER_RAND').'.csv'; + $this->_postValid = array(); + + // Getting data... + $_countries = Country::getCountries((int)($cookie->id_lang)); + + // ...formatting array + $countries[0] = $this->l('All countries'); + foreach ($_countries as $country) + $countries[$country['id_country']] = $country['name']; + + // And filling fields to show ! + $this->_fieldsExport = array( + 'COUNTRY' => array( + 'title' => $this->l('Customers\' country'), + 'desc' => $this->l('Operate a filter on customers\' country.'), + 'type' => 'select', + 'value' => $countries, + 'value_default' => 0 + ), + 'SUSCRIBERS' => array( + 'title' => $this->l('Newsletter subscribers'), + 'desc' => $this->l('Filter newsletter subscribers.'), + 'type' => 'select', + 'value' => array(0 => $this->l('All customers'), 2 => $this->l('Subscribers'), 1 => $this->l('Non-subscribers')), + 'value_default' => 2 + ), + 'OPTIN' => array( + 'title' => $this->l('Opted-in subscribers'), + 'desc' => $this->l('Filter opted-in subscribers.'), + 'type' => 'select', + 'value' => array(0 => $this->l('All customers'), 2 => $this->l('Subscribers'), 1 => $this->l('Non-subscribers')), + 'value_default' => 0 + ), + ); + } + } + + public function install() + { + return (parent::install() AND Configuration::updateValue('PS_NEWSLETTER_RAND', rand().rand())); + } + + private function _postProcess() + { + if (isset($_POST['submitExport']) AND isset($_POST['action'])) + { + if ($_POST['action'] == 'customers') + $result = $this->_getCustomers(); + else + { + if (!Module::isInstalled('blocknewsletter')) + $this->_html .= $this->displayError('The module "blocknewsletter" is required for this feature'); + else + $result = $this->_getBlockNewsletter(); + } + if (!$nb = (int)(Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows())) + $this->_html .= $this->displayError($this->l('No customers found with these filters!')); + elseif ($fd = @fopen(dirname(__FILE__).'/'.strval(preg_replace('#\.{2,}#', '.', $_POST['action'])).'_'.$this->_file, 'w')) + { + foreach ($result AS $tab) + $this->_my_fputcsv($fd, $tab); + fclose($fd); + $this->_html .= $this->displayConfirmation( + $this->l('The .CSV file has been successfully exported.'). + ' ('.$nb.' '.$this->l('customers found').')
        > + '.$this->l('Download the file').' '.$this->_file.' +
        +
          +
        1. '.$this->l('WARNING: If opening this .csv file with Excel, remember to choose UTF-8 encoding or you may see strange characters.').'
        2. +
        '); + } + else + $this->_html .= $this->displayError($this->l('Error: cannot write').' '.dirname(__FILE__).'/'.strval($_POST['action']).'_'.$this->_file.' !'); + } + } + + private function _getCustomers() + { + $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_customer`, c.`lastname`, c.`firstname`, c.`email`, c.`ip_registration_newsletter`, c.`newsletter_date_add` + FROM `'._DB_PREFIX_.'customer` c + WHERE 1 + '.((isset($_POST['SUSCRIBERS']) AND (int)($_POST['SUSCRIBERS']) != 0) ? 'AND c.`newsletter` = '.(int)($_POST['SUSCRIBERS'] - 1) : '').' + '.((isset($_POST['OPTIN']) AND (int)($_POST['OPTIN']) != 0) ? 'AND c.`optin` = '.(int)($_POST['OPTIN'] - 1) : '').' + '.((isset($_POST['COUNTRY']) AND (int)($_POST['COUNTRY']) != 0) ? 'AND (SELECT COUNT(a.`id_address`) as nb_country FROM `'._DB_PREFIX_.'address` a WHERE a.`id_customer` = c.`id_customer` AND a.`id_country` = '.(int)($_POST['COUNTRY']).') >= 1' : '').' + GROUP BY c.`email`'); + $header = array('id_customer', 'lastname', 'firstname', 'email', 'ip_address', 'newsletter_date_add'); + $result = (is_array($rq) ? array_merge(array($header), $rq) : $header); + return $result; + } + + private function _getBlockNewsletter() + { + $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'newsletter`'); + $header = array('id_customer', 'email', 'newsletter_date_add', 'ip_address'); + $result = (is_array($rq) ? array_merge(array($header), $rq) : $header); + return $result; + } + + private function _my_fputcsv($fd, $array) + { + $line = implode(';', $array); + $line .= "\n"; + if (!fwrite($fd, $line, 4096)) + $this->_postErrors[] = $this->l('Error: cannot write').' '.dirname(__FILE__).'/'.$this->_file.' !'; + } + + private function _displayFormExport() + { + $this->_html .= ' +
        + '.$this->l('There are two sorts for this module:').' +

          +
        1. + '.$this->l('Persons who have subscribed using the BlockNewsletter block in the front office.').'
          + '.$this->l('This is a list of e-mail addresses of persons who come to your store that do not become customers, but have subscribed to your newsletter. Using the "Export Newsletter Subscribers" below will generate a .CSV file based on the BlockNewsletter subscribers data.').'

          '.' +
        2. +
        3. + '.$this->l('Customers that have checked "yes" to receive a newsletter in their customer profile.').'
          + '.$this->l('The "Export Customers" section below filters which customers you want to send a newsletter to.').' +
        4. +
        +

        +

        +
        '.$this->l('Export Newsletter Subscribers').' +
        + + '.$this->l('Generate a .CSV file based on BlockNewsletter subscribers data.').'.

        '; + $this->_html .= '
        +
        +

        +
        '.$this->l('Export customers').' +
        + + '.$this->l('Generate a .CSV file from customer account data').'.

        '; + foreach ($this->_fieldsExport as $key => $field) + { + $this->_html .= ' + +
        '; + switch ($field['type']) + { + case 'select': + $this->_html .= ''; + break; + default: + break; + } + if (isset($field['desc']) AND !empty($field['desc'])) + $this->_html .= '

        '.$field['desc'].'

        '; + $this->_html .= ' +
        '; + } + $this->_html .= '
        +
        +
        '; + } + + private function _displayForm() + { + $this->_displayFormExport(); + } + + public function getContent() + { + $this->_html .= '

        '.$this->displayName.'

        '; + + if (!empty($_POST)) + $this->_html .= $this->_postProcess(); + $this->_displayForm(); + + return $this->_html; + } +} + diff --git a/modules/ogone/checkwaitingorder.php b/modules/ogone/checkwaitingorder.php new file mode 100644 index 000000000..6fcd8e1ca --- /dev/null +++ b/modules/ogone/checkwaitingorder.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +die( + Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_cart = '.(int)Tools::getValue('id_cart').' AND secure_key = "'.pSQL(Tools::getValue('key')).'"') + ? 'ok' + : 'ko' +); + + diff --git a/modules/ogone/config.xml b/modules/ogone/config.xml new file mode 100755 index 000000000..7441290dd --- /dev/null +++ b/modules/ogone/config.xml @@ -0,0 +1,11 @@ + + + ogone + Ogone + 2.0 + + + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/ogone/confirmation.php b/modules/ogone/confirmation.php new file mode 100644 index 000000000..357b49be1 --- /dev/null +++ b/modules/ogone/confirmation.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +include(dirname(__FILE__).'/ogone.php'); + +$ogone = new Ogone(); +$id_module = $ogone->id; +$id_cart = Tools::getValue('orderID'); +$key = Db::getInstance()->getValue('SELECT secure_key FROM '._DB_PREFIX_.'customer WHERE id_customer = '.(int)$cookie->id_customer); +$link = new Link(); + +$smarty->assign(array( + 'id_module' => $id_module, + 'id_cart' => $id_cart, + 'key' => $key, + 'ogone_link' => (method_exists($link, 'getPageLink') ? $link->getPageLink('my-account.php') : _PS_BASE_URL_.'my-account.php') + )); +echo $ogone->display(__FILE__, 'waiting.tpl'); + +include(dirname(__FILE__).'/../../footer.php'); + + diff --git a/modules/ogone/de.php b/modules/ogone/de.php new file mode 100644 index 000000000..b6d85093f --- /dev/null +++ b/modules/ogone/de.php @@ -0,0 +1,43 @@ +hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Ihre Bestellung wird so schnell wie möglich zugeschickt.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben ein Problem bei Ihrer Bestellung festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; +$_MODULE['<{ogone}prestashop>ogone_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{ogone}prestashop>ogone_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{ogone}prestashop>ogone_c3aace2676937d5cb50e536abbe9113d'] = 'Folgen Sie zunächst diesen Schritten:'; +$_MODULE['<{ogone}prestashop>ogone_0ad87dec5bc422a24ca801c473d44213'] = 'PrestaShop Seite'; +$_MODULE['<{ogone}prestashop>ogone_1d1f6896858b1bc96cecf995b1800a82'] = 'Füllen Sie Ihre Ogone-ID (PSPID) aus'; +$_MODULE['<{ogone}prestashop>ogone_c76d97611c239318461a32e3ce151b83'] = 'Füllen Sie die Signaturen Ihrer Wahl aus (Sie müssen Sie dann in das Ogone Back-Office kopieren)'; +$_MODULE['<{ogone}prestashop>ogone_8c2fc0d78cab9c2bd9cef54931cc0808'] = 'Wählen Sie den Test-Modus, wenn Sie gerade Ihr Test-Konto auf Ogone erstellt haben (es funktioniert nicht mit dem Demo-Konto)'; +$_MODULE['<{ogone}prestashop>ogone_39963c4d14081a701198768d7b9b00d9'] = 'Ogone Seite'; +$_MODULE['<{ogone}prestashop>ogone_2ee3d80e1919fc84a184c727e3ccfa20'] = 'Test-Modus'; +$_MODULE['<{ogone}prestashop>ogone_20226890d13b230111fe30e1eb7a167b'] = 'Betriebsmodus'; +$_MODULE['<{ogone}prestashop>ogone_38056880101f21752c2dbce4549b8423'] = 'Siehe Screenshot für Schritt'; +$_MODULE['<{ogone}prestashop>ogone_8da6d1ecd712792004829aa57eb4a9f7'] = 'Testkarten'; +$_MODULE['<{ogone}prestashop>ogone_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{ogone}prestashop>ogone_05d749acfbb6a79553aef6a644db881f'] = 'PSPID'; +$_MODULE['<{ogone}prestashop>ogone_ac3b5413fdb77e3726a94891c9844b44'] = 'SHA-in Signatur'; +$_MODULE['<{ogone}prestashop>ogone_7c287610a5cd0fddf4261f153996da5e'] = 'SHA-out Signatur'; +$_MODULE['<{ogone}prestashop>ogone_650be61892bf690026089544abbd9d26'] = 'Modus'; +$_MODULE['<{ogone}prestashop>ogone_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{ogone}prestashop>ogone_756d97bb256b8580d4d71ee0c547804e'] = 'Betrieb'; +$_MODULE['<{ogone}prestashop>ogone_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{ogone}prestashop>ogone_75310bf8b7cf2ca4e09332871f98c271'] = 'Bezahlen Sie mit Ogone'; +$_MODULE['<{ogone}prestashop>ogone_51e550f8a0e9e127a566c21e9a15538b'] = 'Ogone Logo'; +$_MODULE['<{ogone}prestashop>ogone_15ee0c3bac84f0ff0a2af1e6cdc1a048'] = 'Bezahlen Sie sicher und schnell auf der nächsten Seite mit IDEAL / Mastercard / Visa / Paypal / Mister Cash / Bancontact.'; +$_MODULE['<{ogone}prestashop>validation_e9f77209121063c8aedd7698f20f4878'] = 'Eingegangene Parameter:'; +$_MODULE['<{ogone}prestashop>validation_273e5454628021d87e34051074ac62d1'] = 'Fehlende Parameter:'; +$_MODULE['<{ogone}prestashop>validation_cbb285f0e88adea7d492a5b14b9e6d1d'] = 'Fehler (Auth. abgelehnt)'; +$_MODULE['<{ogone}prestashop>validation_ee5698e64b5157ad1cbe6aa614288c33'] = 'Zahlung autorisiert / OK'; +$_MODULE['<{ogone}prestashop>validation_6b4fcb57371df22836b78f67bc444213'] = 'Unbekannter Status:'; +$_MODULE['<{ogone}prestashop>validation_a04830387e55082ed6096ab698ac8238'] = 'Ungültige SHA-1 Signatur'; +$_MODULE['<{ogone}prestashop>validation_7eaab6a852dfe4707acde8847dba7ce9'] = 'SHA-1 gegeben:'; +$_MODULE['<{ogone}prestashop>validation_8fbed6331a34a844224bfee15145e00f'] = 'SHA-1 berechnet:'; +$_MODULE['<{ogone}prestashop>validation_671c1f78cd9a17103c43a10d19157678'] = 'Voller Schlüssel'; +$_MODULE['<{ogone}prestashop>waiting_1fe3bb016fa11dd93fb1929f118fd492'] = 'Bitte warten, Ihre Bestellung wird bearbeitet ...'; diff --git a/modules/ogone/docs/en1.png b/modules/ogone/docs/en1.png new file mode 100644 index 000000000..55e4d57ea Binary files /dev/null and b/modules/ogone/docs/en1.png differ diff --git a/modules/ogone/docs/en2.png b/modules/ogone/docs/en2.png new file mode 100644 index 000000000..76cc145be Binary files /dev/null and b/modules/ogone/docs/en2.png differ diff --git a/modules/ogone/docs/en3.png b/modules/ogone/docs/en3.png new file mode 100644 index 000000000..5f090d1aa Binary files /dev/null and b/modules/ogone/docs/en3.png differ diff --git a/modules/ogone/docs/en4.png b/modules/ogone/docs/en4.png new file mode 100644 index 000000000..bb1624897 Binary files /dev/null and b/modules/ogone/docs/en4.png differ diff --git a/modules/ogone/es.php b/modules/ogone/es.php new file mode 100644 index 000000000..25b3b50c6 --- /dev/null +++ b/modules/ogone/es.php @@ -0,0 +1,43 @@ +hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'está terminado.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Su pedido le será enviado lo antes posible.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta o información, contacte con nuestro'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio clientela'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Hemos constatado un problema con su pedido. Si piensa que se trata de un error, contacte con nuestro'; +$_MODULE['<{ogone}prestashop>ogone_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración guardada'; +$_MODULE['<{ogone}prestashop>ogone_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{ogone}prestashop>ogone_c3aace2676937d5cb50e536abbe9113d'] = 'Primero, siga los siguientes pasos:'; +$_MODULE['<{ogone}prestashop>ogone_0ad87dec5bc422a24ca801c473d44213'] = 'En PrestaShop'; +$_MODULE['<{ogone}prestashop>ogone_1d1f6896858b1bc96cecf995b1800a82'] = 'Indique su login Ogone (PSPID)'; +$_MODULE['<{ogone}prestashop>ogone_c76d97611c239318461a32e3ce151b83'] = 'Indique las firmas SHA-1 que elija (debe copiarlas en su interfaz Organe para más tarde)'; +$_MODULE['<{ogone}prestashop>ogone_8c2fc0d78cab9c2bd9cef54931cc0808'] = 'Elija el modo de test si acaba de crear su cuenta de test en Ogone (el módulo no funciona con una cuenta demo)'; +$_MODULE['<{ogone}prestashop>ogone_39963c4d14081a701198768d7b9b00d9'] = 'En Ogone'; +$_MODULE['<{ogone}prestashop>ogone_2ee3d80e1919fc84a184c727e3ccfa20'] = 'modo test'; +$_MODULE['<{ogone}prestashop>ogone_20226890d13b230111fe30e1eb7a167b'] = 'modo producción'; +$_MODULE['<{ogone}prestashop>ogone_38056880101f21752c2dbce4549b8423'] = 'Ver la captura de pantalla para el paso'; +$_MODULE['<{ogone}prestashop>ogone_8da6d1ecd712792004829aa57eb4a9f7'] = 'Cartas de test'; +$_MODULE['<{ogone}prestashop>ogone_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{ogone}prestashop>ogone_05d749acfbb6a79553aef6a644db881f'] = 'PSPID'; +$_MODULE['<{ogone}prestashop>ogone_ac3b5413fdb77e3726a94891c9844b44'] = 'Firma SHA-in'; +$_MODULE['<{ogone}prestashop>ogone_7c287610a5cd0fddf4261f153996da5e'] = 'Firma SHA-out'; +$_MODULE['<{ogone}prestashop>ogone_650be61892bf690026089544abbd9d26'] = 'Modo'; +$_MODULE['<{ogone}prestashop>ogone_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{ogone}prestashop>ogone_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{ogone}prestashop>ogone_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar'; +$_MODULE['<{ogone}prestashop>ogone_75310bf8b7cf2ca4e09332871f98c271'] = 'Pagar con Ogone'; +$_MODULE['<{ogone}prestashop>ogone_51e550f8a0e9e127a566c21e9a15538b'] = 'Logo Ogone'; +$_MODULE['<{ogone}prestashop>ogone_15ee0c3bac84f0ff0a2af1e6cdc1a048'] = 'Pagar rápidamente con toda seguridad en la siguiente página con IDEAL / Mastercard / Visa / PayPal / Mister Cash / Bancontact'; +$_MODULE['<{ogone}prestashop>validation_e9f77209121063c8aedd7698f20f4878'] = 'Parámetros recibidos:'; +$_MODULE['<{ogone}prestashop>validation_273e5454628021d87e34051074ac62d1'] = 'Parámetros que faltan'; +$_MODULE['<{ogone}prestashop>validation_cbb285f0e88adea7d492a5b14b9e6d1d'] = 'Error (identificación rechazada)'; +$_MODULE['<{ogone}prestashop>validation_ee5698e64b5157ad1cbe6aa614288c33'] = 'Pago autorizado / OK'; +$_MODULE['<{ogone}prestashop>validation_6b4fcb57371df22836b78f67bc444213'] = 'Estado desconocido:'; +$_MODULE['<{ogone}prestashop>validation_a04830387e55082ed6096ab698ac8238'] = 'Firma SHA-1 no válida'; +$_MODULE['<{ogone}prestashop>validation_7eaab6a852dfe4707acde8847dba7ce9'] = 'SHA-1 incluido'; +$_MODULE['<{ogone}prestashop>validation_8fbed6331a34a844224bfee15145e00f'] = 'SHA-1 calculado'; +$_MODULE['<{ogone}prestashop>validation_671c1f78cd9a17103c43a10d19157678'] = 'Clave simple'; +$_MODULE['<{ogone}prestashop>waiting_1fe3bb016fa11dd93fb1929f118fd492'] = 'Por favor, espere mientras se procesa su pedido'; diff --git a/modules/ogone/fr.php b/modules/ogone/fr.php new file mode 100644 index 000000000..1859f6503 --- /dev/null +++ b/modules/ogone/fr.php @@ -0,0 +1,43 @@ +hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est terminée.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Votre commande vous sera expédiée dès que possible.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou pour plus d\'informations, merci de contacter notre'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'service client'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons constaté un problème avec votre commande. Si vous pensez que c\'est une erreur, merci de contacter notre'; +$_MODULE['<{ogone}prestashop>ogone_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration enregistrée'; +$_MODULE['<{ogone}prestashop>ogone_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{ogone}prestashop>ogone_c3aace2676937d5cb50e536abbe9113d'] = 'Suivez tout d\'abord ces étapes :'; +$_MODULE['<{ogone}prestashop>ogone_0ad87dec5bc422a24ca801c473d44213'] = 'Sur PrestaShop'; +$_MODULE['<{ogone}prestashop>ogone_1d1f6896858b1bc96cecf995b1800a82'] = 'Renseignez votre identifiant Ogone (PSPID)'; +$_MODULE['<{ogone}prestashop>ogone_c76d97611c239318461a32e3ce151b83'] = 'Renseignez les signatures SHA-1 de votre choix (vous devrez les copier sur votre interface Ogone par la suite)'; +$_MODULE['<{ogone}prestashop>ogone_8c2fc0d78cab9c2bd9cef54931cc0808'] = 'Choisissez le mode de test si vous venez juste de créer votre compte de test sur Ogone (le module ne fonctionne pas avec un compte de demo)'; +$_MODULE['<{ogone}prestashop>ogone_39963c4d14081a701198768d7b9b00d9'] = 'Sur Ogone'; +$_MODULE['<{ogone}prestashop>ogone_2ee3d80e1919fc84a184c727e3ccfa20'] = 'mode test'; +$_MODULE['<{ogone}prestashop>ogone_20226890d13b230111fe30e1eb7a167b'] = 'mode production'; +$_MODULE['<{ogone}prestashop>ogone_38056880101f21752c2dbce4549b8423'] = 'Voir la capture d\'écran pour l\'étape'; +$_MODULE['<{ogone}prestashop>ogone_8da6d1ecd712792004829aa57eb4a9f7'] = 'Cartes de test'; +$_MODULE['<{ogone}prestashop>ogone_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{ogone}prestashop>ogone_05d749acfbb6a79553aef6a644db881f'] = 'PSPID'; +$_MODULE['<{ogone}prestashop>ogone_ac3b5413fdb77e3726a94891c9844b44'] = 'Signature SHA-in'; +$_MODULE['<{ogone}prestashop>ogone_7c287610a5cd0fddf4261f153996da5e'] = 'Signature SHA-out'; +$_MODULE['<{ogone}prestashop>ogone_650be61892bf690026089544abbd9d26'] = 'Mode'; +$_MODULE['<{ogone}prestashop>ogone_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{ogone}prestashop>ogone_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{ogone}prestashop>ogone_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; +$_MODULE['<{ogone}prestashop>ogone_75310bf8b7cf2ca4e09332871f98c271'] = 'Payer avec Ogone'; +$_MODULE['<{ogone}prestashop>ogone_51e550f8a0e9e127a566c21e9a15538b'] = 'Logo Ogone'; +$_MODULE['<{ogone}prestashop>ogone_15ee0c3bac84f0ff0a2af1e6cdc1a048'] = 'Payer rapidement et en toute sécurité à la page suivante avec IDEAL / Mastercard / Visa / Paypal / Mister Cash / Bancontact.'; +$_MODULE['<{ogone}prestashop>validation_e9f77209121063c8aedd7698f20f4878'] = 'Paramètres reçus :'; +$_MODULE['<{ogone}prestashop>validation_273e5454628021d87e34051074ac62d1'] = 'Paramètres manquants'; +$_MODULE['<{ogone}prestashop>validation_cbb285f0e88adea7d492a5b14b9e6d1d'] = 'Erreur (authentification refusée)'; +$_MODULE['<{ogone}prestashop>validation_ee5698e64b5157ad1cbe6aa614288c33'] = 'Payment autorisé / OK'; +$_MODULE['<{ogone}prestashop>validation_6b4fcb57371df22836b78f67bc444213'] = 'Statut inconnu :'; +$_MODULE['<{ogone}prestashop>validation_a04830387e55082ed6096ab698ac8238'] = 'Signature SHA-1 invalide'; +$_MODULE['<{ogone}prestashop>validation_7eaab6a852dfe4707acde8847dba7ce9'] = 'SHA-1 fourni'; +$_MODULE['<{ogone}prestashop>validation_8fbed6331a34a844224bfee15145e00f'] = 'SHA-1 calculé'; +$_MODULE['<{ogone}prestashop>validation_671c1f78cd9a17103c43a10d19157678'] = 'Clé simple :'; +$_MODULE['<{ogone}prestashop>waiting_1fe3bb016fa11dd93fb1929f118fd492'] = 'Merci de patienter pendant que votre commande se valide...'; diff --git a/modules/ogone/hookorderconfirmation.tpl b/modules/ogone/hookorderconfirmation.tpl new file mode 100644 index 000000000..bc646ad6f --- /dev/null +++ b/modules/ogone/hookorderconfirmation.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $status == 'ok'} +

        {l s='Your order on' mod='ogone'} {$shop_name} {l s='is complete.' mod='ogone'} +

        {l s='Your order will be sent as soon as possible.' mod='ogone'} +

        {l s='For any questions or for further information, please contact our' mod='ogone'} {l s='customer support' mod='ogone'}. +

        +{else} +

        + {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='ogone'} + {l s='customer support' mod='ogone'}. +

        +{/if} diff --git a/modules/ogone/it.php b/modules/ogone/it.php new file mode 100644 index 000000000..758f9face --- /dev/null +++ b/modules/ogone/it.php @@ -0,0 +1,43 @@ +hookorderconfirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine '; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_30163d8fc3068e8297e7ab5bf32aec87'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{ogone}prestashop>hookorderconfirmation_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, contatta la nostra'; +$_MODULE['<{ogone}prestashop>ogone_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{ogone}prestashop>ogone_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{ogone}prestashop>ogone_c3aace2676937d5cb50e536abbe9113d'] = 'Prima di tutto, si potrebbe procedere come segue:'; +$_MODULE['<{ogone}prestashop>ogone_0ad87dec5bc422a24ca801c473d44213'] = 'Su PrestaShop '; +$_MODULE['<{ogone}prestashop>ogone_1d1f6896858b1bc96cecf995b1800a82'] = 'Inserisci il tuo Ogone ID (PSPID)'; +$_MODULE['<{ogone}prestashop>ogone_c76d97611c239318461a32e3ce151b83'] = 'Compila le firme di tua scelta (dovrai poi copiarli nel back office Ogone)'; +$_MODULE['<{ogone}prestashop>ogone_8c2fc0d78cab9c2bd9cef54931cc0808'] = 'Scegli la modalità di test se hai appena creato l\'account di prova su Ogone (non funziona con l\'account demo)'; +$_MODULE['<{ogone}prestashop>ogone_39963c4d14081a701198768d7b9b00d9'] = 'Su Ogone'; +$_MODULE['<{ogone}prestashop>ogone_2ee3d80e1919fc84a184c727e3ccfa20'] = 'modalità di prova'; +$_MODULE['<{ogone}prestashop>ogone_20226890d13b230111fe30e1eb7a167b'] = 'modalità di produzione'; +$_MODULE['<{ogone}prestashop>ogone_38056880101f21752c2dbce4549b8423'] = 'Vedi la schermata per la fase'; +$_MODULE['<{ogone}prestashop>ogone_8da6d1ecd712792004829aa57eb4a9f7'] = 'Schede prova'; +$_MODULE['<{ogone}prestashop>ogone_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{ogone}prestashop>ogone_05d749acfbb6a79553aef6a644db881f'] = 'PSPID'; +$_MODULE['<{ogone}prestashop>ogone_ac3b5413fdb77e3726a94891c9844b44'] = 'Firma SHA-in '; +$_MODULE['<{ogone}prestashop>ogone_7c287610a5cd0fddf4261f153996da5e'] = 'Firma SHA-out'; +$_MODULE['<{ogone}prestashop>ogone_650be61892bf690026089544abbd9d26'] = 'Modalità'; +$_MODULE['<{ogone}prestashop>ogone_0cbc6611f5540bd0809a388dc95a615b'] = 'Prova'; +$_MODULE['<{ogone}prestashop>ogone_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{ogone}prestashop>ogone_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; +$_MODULE['<{ogone}prestashop>ogone_75310bf8b7cf2ca4e09332871f98c271'] = 'Paga con Ogone'; +$_MODULE['<{ogone}prestashop>ogone_51e550f8a0e9e127a566c21e9a15538b'] = 'Logo Ogone'; +$_MODULE['<{ogone}prestashop>ogone_15ee0c3bac84f0ff0a2af1e6cdc1a048'] = 'Paga in modo sicuro e veloce alla pagina successiva con IDEAL / Mastercard / Visa / Paypal / Mister Cash / Bancontact.'; +$_MODULE['<{ogone}prestashop>validation_e9f77209121063c8aedd7698f20f4878'] = 'Parametri ricevuti:'; +$_MODULE['<{ogone}prestashop>validation_273e5454628021d87e34051074ac62d1'] = 'Parametri mancanti:'; +$_MODULE['<{ogone}prestashop>validation_cbb285f0e88adea7d492a5b14b9e6d1d'] = 'Errore (aut. rifiutata)'; +$_MODULE['<{ogone}prestashop>validation_ee5698e64b5157ad1cbe6aa614288c33'] = 'Pagamento autorizzato / OK'; +$_MODULE['<{ogone}prestashop>validation_6b4fcb57371df22836b78f67bc444213'] = 'Stato sconosciuto:'; +$_MODULE['<{ogone}prestashop>validation_a04830387e55082ed6096ab698ac8238'] = 'Firma SHA-1 non valida'; +$_MODULE['<{ogone}prestashop>validation_7eaab6a852dfe4707acde8847dba7ce9'] = 'SHA-1 dato:'; +$_MODULE['<{ogone}prestashop>validation_8fbed6331a34a844224bfee15145e00f'] = 'SHA-1 calcolato:'; +$_MODULE['<{ogone}prestashop>validation_671c1f78cd9a17103c43a10d19157678'] = 'Chiave semplice:'; +$_MODULE['<{ogone}prestashop>waiting_1fe3bb016fa11dd93fb1929f118fd492'] = 'Si prega di attendere l\'ordine è in fase di elaborazione ...'; diff --git a/modules/ogone/logo.gif b/modules/ogone/logo.gif new file mode 100644 index 000000000..fe328d2f6 Binary files /dev/null and b/modules/ogone/logo.gif differ diff --git a/modules/ogone/ogone.gif b/modules/ogone/ogone.gif new file mode 100644 index 000000000..35c4b55ba Binary files /dev/null and b/modules/ogone/ogone.gif differ diff --git a/modules/ogone/ogone.php b/modules/ogone/ogone.php new file mode 100644 index 000000000..dba8c7e51 --- /dev/null +++ b/modules/ogone/ogone.php @@ -0,0 +1,213 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Ogone extends PaymentModule +{ + public function __construct() + { + $this->name = 'ogone'; + $this->tab = 'payments_gateways'; + $this->version = '2.0'; + + parent::__construct(); + + $this->displayName = 'Ogone'; + $this->description = ''; + } + + public function install() + { + return (parent::install() AND $this->registerHook('payment') AND $this->registerHook('orderConfirmation')); + } + + public function getContent() + { + if (Tools::isSubmit('submitOgone')) + { + Configuration::updateValue('OGONE_PSPID', Tools::getValue('OGONE_PSPID')); + Configuration::updateValue('OGONE_SHA_IN', Tools::getValue('OGONE_SHA_IN')); + Configuration::updateValue('OGONE_SHA_OUT', Tools::getValue('OGONE_SHA_OUT')); + Configuration::updateValue('OGONE_MODE', (int)Tools::getValue('OGONE_MODE')); + $dataSync = (($pspid = Configuration::get('OGONE_PSPID')) + ? '' + : '' + ); + echo $this->displayConfirmation($this->l('Configuration updated').$dataSync); + } + + return ' +
        '.$this->l('Help').' +

        '.$this->l('Please follow these steps:').'

        +
          +
        1. +

          '.$this->l('PrestaShop side').'

          +
            +
          1. '.$this->l('Fill in your Ogone ID (PSPID)').'
          2. +
          3. '.$this->l('Fill in the signatures of your choice (you will have to copy them to Ogone back office).').'
          4. +
          5. '.$this->l('Select test mode if you just created your test account on Ogone (it does not work with the demo account).').'
          6. +
          +
        2. +
        3. +

          + '.$this->l('Ogone Side').' / + '.$this->l('test mode').' / + '.$this->l('production mode').' +

          +
            +
          1. '.$this->l('See the screenshot for step').' 1
          2. +
          3. '.$this->l('See the screenshot for step').' 2
          4. +
          5. '.$this->l('See the screenshot for step').' 3
          6. +
          7. '.$this->l('See the screenshot for step').' 4
          8. +
          +
        4. +
        +

        '.$this->l('Test cards').'

        +
          +
        • Visa : 4111 1111 1111 1111
        • +
        • Visa 3D : 4000 0000 0000 0002
        • +
        • American Express : 3741 1111 1111 111
        • +
        • MasterCard : 5399 9999 9999 9999
        • +
        • Diners : 3625 5695 5800 17
        • +
        • Bancontact/Mister : 67030000000000003
        • +
        • Visa Purchasing : 4484 1200 0000 0029
        • +
        • American Express : 3742 9101 9071 995
        • +
        +
         
        +
        +
         
        +
        +
        '.$this->l('Settings').' + +
        + +
        +
         
        + +
        + +
        +
         
        + +
        + +
        +
         
        + +
        + +   + + + +
        +
         
        + +
        +
        +
         
        '; + } + + public function hookPayment($params) + { + global $smarty; + + $currency = new Currency((int)($params['cart']->id_currency)); + $lang = new Language((int)($params['cart']->id_lang)); + $customer = new Customer((int)($params['cart']->id_customer)); + $address = new Address((int)($params['cart']->id_address_invoice)); + $country = new Country((int)($address->id_country), (int)($params['cart']->id_lang)); + + $ogoneParams = array(); + $ogoneParams['PSPID'] = Configuration::get('OGONE_PSPID'); + $ogoneParams['OPERATION'] = 'SAL'; + $ogoneParams['ORDERID'] = pSQL($params['cart']->id); + $ogoneParams['AMOUNT'] = number_format(Tools::convertPrice((float)(number_format($params['cart']->getOrderTotal(true, Cart::BOTH), 2, '.', '')), $currency), 2, '.', '') * 100; + $ogoneParams['CURRENCY'] = $currency->iso_code; + $ogoneParams['LANGUAGE'] = $lang->iso_code.'_'.strtoupper($lang->iso_code); + $ogoneParams['CN'] = $customer->lastname; + $ogoneParams['EMAIL'] = $customer->email; + $ogoneParams['OWNERZIP'] = $address->postcode; + $ogoneParams['OWNERADDRESS'] = ($address->address1); + $ogoneParams['OWNERCTY'] = $country->iso_code; + $ogoneParams['OWNERTOWN'] = $address->city; + $ogoneParams['paramplus'] = 'secure_key='.$params['cart']->secure_key; + if (!empty($address->phone)) + $ogoneParams['OWNERTELNO'] = $address->phone; + + ksort($ogoneParams); + $shasign = ''; + foreach ($ogoneParams as $key => $value) + $shasign .= strtoupper($key).'='.$value.Configuration::get('OGONE_SHA_IN'); + $ogoneParams['SHASign'] = strtoupper(sha1($shasign)); + + $smarty->assign('ogone_params', $ogoneParams); + $smarty->assign('OGONE_MODE', Configuration::get('OGONE_MODE')); + + return $this->display(__FILE__, 'ogone.tpl'); + } + + public function hookOrderConfirmation($params) + { + global $smarty, $cookie; + + if ($params['objOrder']->module != $this->name) + return; + + if ($params['objOrder']->valid) + $smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id)); + else + $smarty->assign('status', 'failed'); + $link = new Link(); + $smarty->assign('ogone_link', (method_exists($link, 'getPageLink') ? $link->getPageLink('contact-form.php', true) : Tools::getHttpHost(true).'contact-form.php')); + return $this->display(__FILE__, 'hookorderconfirmation.tpl'); + } + + public function validate($id_cart, $id_order_state, $amount, $message = '', $secure_key) + { + $this->validateOrder((int)$id_cart, $id_order_state, $amount, $this->displayName, $message, NULL, NULL, true, pSQL($secure_key)); + if ($amount > 0 AND class_exists('PaymentCC')) + { + $pcc = new PaymentCC(); + $order = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'orders WHERE id_cart = '.(int)$secure_cart[0]); + $pcc->id_order = (int)$order['id_order']; + $pcc->id_currency = (int)$order['id_currency']; + $pcc->amount = $amount; + $pcc->transaction_id = Tools::getValue('PAYID'); + $pcc->card_number = Tools::getValue('CARDNO'); + $pcc->card_brand = Tools::getValue('BRAND'); + $pcc->card_expiration = Tools::getValue('ED'); + $pcc->card_holder = Tools::getValue('CN'); + $pcc->add(); + } + } +} + + diff --git a/modules/ogone/ogone.tpl b/modules/ogone/ogone.tpl new file mode 100644 index 000000000..6bcce7a46 --- /dev/null +++ b/modules/ogone/ogone.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Ogone logo' mod='ogone'} + {l s='Pay with Ogone' mod='ogone'}
        {l s='Pay safely and quickly on the next page with IDEAL / Mastercard / Visa / Paypal / Mister Cash / Bancontact.' mod='ogone'}
        +

        + +
         
        +

        +
        +{foreach from=$ogone_params key=ogone_key item=ogone_value} + +{/foreach} +
        + + + + diff --git a/modules/ogone/validation.php b/modules/ogone/validation.php new file mode 100644 index 000000000..dfda4dfef --- /dev/null +++ b/modules/ogone/validation.php @@ -0,0 +1,105 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/ogone.php'); + +$ogone = new Ogone(); + +/* First we need to check var presence */ +$neededVars = array('orderID', 'amount', 'currency', 'PM', 'ACCEPTANCE', 'STATUS', 'CARDNO', 'PAYID', 'NCERROR', 'BRAND', 'SHASIGN'); +$params = '

        '.$ogone->l('Received parameters:').'

        '; + +foreach ($neededVars AS $k) + if (!isset($_GET[$k])) + die($ogone->l('Missing parameter:').' '.$k); + else + $params .= $k.' : '.$_GET[$k].'
        '; + +/* Then, load the customer cart and perform some checks */ +$cart = new Cart((int)($_GET['orderID'])); +if (Validate::isLoadedObject($cart)) +{ + /* Fist, check for a valid SHA-1 signature */ + $ogoneParams = array(); + foreach ($_GET as $key => $value) + if (strtoupper($key) != 'SHASIGN' AND $value != '') + $ogoneParams[strtoupper($key)] = $value; + + ksort($ogoneParams); + $shasign = ''; + foreach ($ogoneParams as $key => $value) + $shasign .= strtoupper($key).'='.$value.Configuration::get('OGONE_SHA_OUT'); + $sha1 = strtoupper(sha1($shasign)); + + if ($sha1 == $_GET['SHASIGN']) + { + switch ($_GET['STATUS']) + { + case 1: + /* Real error or payment canceled */ + $ogone->validate((int)$_GET['orderID'], _PS_OS_ERROR_, 0, $_GET['NCERROR'].$params, $_GET['secure_key']); + break; + case 2: + /* Real error - authorization refused */ + $ogone->validate((int)$_GET['orderID'], _PS_OS_ERROR_, 0, $ogone->l('Error (auth. refused)').'
        '.$_GET['NCERROR'].$params, $_GET['secure_key']); + break; + case 5: + case 9: + /* Payment OK */ + $ogone->validate((int)$_GET['orderID'], _PS_OS_PAYMENT_, (float)($_GET['amount']), $ogone->l('Payment authorized / OK').$params, $_GET['secure_key']); + break; + case 6: + case 7: + case 8: + // Payment canceled later + if ($id_order = (int)(Order::getOrderByCartId((int)($_GET['orderID'])))) + { + // Update the amount really paid + $order = new Order($id_order); + $order->total_paid_real = 0; + $order->update(); + + // Send a new message and change the state + $history = new OrderHistory(); + $history->id_order = $id_order; + $history->changeIdOrderState(_PS_OS_ERROR_, $id_order); + $history->addWithemail(true, array()); + } + break; + default: + $ogone->validate((int)$_GET['orderID'], _PS_OS_ERROR_, (float)($_GET['amount']), $ogone->l('Unknown status:').' '.$_GET['STATUS'].$params, $_GET['secure_key']); + } + exit; + } + else + { + $message = $ogone->l('Invalid SHA-1 signature').'
        '.$ogone->l('SHA-1 given:').' '.$_GET['SHASIGN'].'
        '.$ogone->l('SHA-1 calculated:').' '.$sha1.'
        '.$ogone->l('Plain key:').' '.$shasign; + $ogone->validate((int)$_GET['orderID'], _PS_OS_ERROR_, 0, $message.'
        '.$params, $_GET['secure_key']); + } +} + diff --git a/modules/ogone/waiting.tpl b/modules/ogone/waiting.tpl new file mode 100644 index 000000000..e0fa15f0d --- /dev/null +++ b/modules/ogone/waiting.tpl @@ -0,0 +1,44 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Please wait while your order is being processed...' mod='ogone'}

        + diff --git a/modules/pagesnotfound/comment.gif b/modules/pagesnotfound/comment.gif new file mode 100644 index 000000000..7bc9233ea Binary files /dev/null and b/modules/pagesnotfound/comment.gif differ diff --git a/modules/pagesnotfound/config.xml b/modules/pagesnotfound/config.xml new file mode 100755 index 000000000..add62b6b0 --- /dev/null +++ b/modules/pagesnotfound/config.xml @@ -0,0 +1,11 @@ + + + pagesnotfound + Pages not found + 1 + Display the pages requested by your visitors but not found. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/pagesnotfound/de.php b/modules/pagesnotfound/de.php new file mode 100644 index 000000000..95df61730 --- /dev/null +++ b/modules/pagesnotfound/de.php @@ -0,0 +1,21 @@ +pagesnotfound_251295238bdf7693252f2804c8d3707e'] = 'Nicht gefundene Seiten'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3ae7050d9f8502e9b69448a6db73fab2'] = 'Anzeige der Seiten, die Besucher aufrufen wollten, aber nicht gefunden haben'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_50004bd606668bb842e80f51337b765d'] = 'Nicht gefundene Seiten geleert'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6cb944288ac528fcfd76b20156dddce1'] = 'Sie müssen eine .htaccess-Datei benutzen, um 404-Fehler auf die Seit.php zu leiten'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_193cfc9be3b995831c6af2fea6650e60'] = 'Seite'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_b6f05e5ddde1ec63d992d61144452dfa'] = 'Referrer'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_64d129224a5377b63e9727479ec987d9'] = 'Counter'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d372ffc9065cb7d2ea24df137927d060'] = 'Keine Seiten registriert'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d8847bc418fc4f5a3e37c2e8390bb9ed'] = 'Leere Datenbank'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_254b5e94768b90388cc7002d362351f0'] = 'Leer KEINE Seiten gefunden'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3604249130acf7fda296e16edc996e5b'] = '404-Fehler'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_1c4e115caef0bed8f5ca76da1909f967'] = 'Fehler 404 ist ein HTTP-Fehlercode, der besagt, dass die durch den Benutzer angeforderte Datei nicht gefunden werden kann. In Ihrem Fall bedeutet es, dass einer Ihrer Besucher eine falsche URL-Adresse in das Adressfeld eingegeben hat oder dass Sie oder eine andere Webseite irgendwo einen toten Link haben. Wenn sie verfügbar ist, wird der Referrer angezeigt, so dass Sie die Seite finden können, die den toten Link enthält. Ansonsten bedeutet es meist, dass es ein Direktzugang ist, dass also jemand einen Link, den es nicht mehr gibt, mit einem Bookmark versehen hat.'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_a90083861c168ef985bf70763980aa60'] = 'Wie fängt man diese Fehler ab?'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_535ff57deda0b45d32cb37fd430accc8'] = 'Falls Ihr Provider die .htaccess-Datei unterstützt, können Sie sie im Root-Verzeichnis von PrestaShop erstellen und folgende Zeile einfügen:'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_9cfaa8e935f9e3e65b0959b15b070b15'] = 'Ein Benutzer, der eine Seite aufruft, die es nicht gibt, wird zur Seite weitergeleitet'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_feb436b0dabe28068aa6d866ac47bf0a'] = 'Dieses Modul protokolliert die Zugänge zu dieser Seite: die aufgerufene Seite, den Referrer und die Anzahl der Aufrufe.'; diff --git a/modules/pagesnotfound/en.php b/modules/pagesnotfound/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/pagesnotfound/en.php @@ -0,0 +1,4 @@ +pagesnotfound_251295238bdf7693252f2804c8d3707e'] = 'Página no encontrada'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3ae7050d9f8502e9b69448a6db73fab2'] = 'Mostrar las páginas solicitadas por sus visitantes pero no encontradas'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_50004bd606668bb842e80f51337b765d'] = 'Páginas no encontradas suprimidas'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6cb944288ac528fcfd76b20156dddce1'] = 'Usted debe utilizar un archivo .htaccess para volver a redirigir error 404 al \\\" de la página; 404.php\\\"'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_193cfc9be3b995831c6af2fea6650e60'] = 'Página'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_b6f05e5ddde1ec63d992d61144452dfa'] = 'Referente'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_64d129224a5377b63e9727479ec987d9'] = 'Contador'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d372ffc9065cb7d2ea24df137927d060'] = 'Páginas no registradas'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d8847bc418fc4f5a3e37c2e8390bb9ed'] = 'Suprimir'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_254b5e94768b90388cc7002d362351f0'] = 'Suprimir TODAS las páginas no encontradas'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3604249130acf7fda296e16edc996e5b'] = 'error 404'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_1c4e115caef0bed8f5ca76da1909f967'] = 'Error 404 es un código HTTP que significa que el archivo pedido por el usuario no se encuentra. En su caso esto significa que uno de sus visitantes introdujo una URL incorrecta en la barra de direcciones o que usted tiene un enlace roto en alguna parte. Cuando está disponible, el referente se muestra, así puede encontrar la página que contiene el enlace roto. Si no, significa generalmente que es un acceso directo que ya no existe.'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_a90083861c168ef985bf70763980aa60'] = '¿Como prevenir estos errores?'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_535ff57deda0b45d32cb37fd430accc8'] = 'Si su servidor soporta el archivo .htaccess, puede crear uno en el directorio raíz de PrestaShop e insertar la línea siguiente:'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_9cfaa8e935f9e3e65b0959b15b070b15'] = 'El usuario que busca una página que no existe será reenviado a la página'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_feb436b0dabe28068aa6d866ac47bf0a'] = 'Este módulo registra los accesos a esta página: la página requerida, la referencia y el número de veces que se visitó.'; diff --git a/modules/pagesnotfound/fr.php b/modules/pagesnotfound/fr.php new file mode 100644 index 000000000..8cfe72302 --- /dev/null +++ b/modules/pagesnotfound/fr.php @@ -0,0 +1,21 @@ +pagesnotfound_251295238bdf7693252f2804c8d3707e'] = 'Pages introuvables'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3ae7050d9f8502e9b69448a6db73fab2'] = 'Affiche les pages demandées mais qui n\'existent pas'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_50004bd606668bb842e80f51337b765d'] = 'Pages introuvables supprimées'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6cb944288ac528fcfd76b20156dddce1'] = 'Vous devez utiliser un fichier .htaccess redirigeant les erreurs 404 vers la page \"404.php\"'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_193cfc9be3b995831c6af2fea6650e60'] = 'Page'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_b6f05e5ddde1ec63d992d61144452dfa'] = 'Origine'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_64d129224a5377b63e9727479ec987d9'] = 'Compteur'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d372ffc9065cb7d2ea24df137927d060'] = 'Aucune page enregistrée'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d8847bc418fc4f5a3e37c2e8390bb9ed'] = 'Suppression'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_254b5e94768b90388cc7002d362351f0'] = 'Supprimer toutes les pages introuvables'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3604249130acf7fda296e16edc996e5b'] = 'Erreurs 404'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_1c4e115caef0bed8f5ca76da1909f967'] = 'Une erreur 404 est un code d\'erreur HTTP signifiant que le fichier demandé par l\'utilisateur est introuvable. Dans votre cas cela signifie qu\'un de vos visiteurs a tapé une mauvaise URL dans la barre d\'adresse ou que vous ou un autre site contient un lien mort quelque part. Quand elle est disponible, la page source est affichée afin de vous permettre de trouver ce lien mort. Dans le cas contraire, c\'est probablement un accès direct, ce qui peut également vouloir dire qu\'un utilisateur a mis en favoris une page qui n\'existe plus.'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_a90083861c168ef985bf70763980aa60'] = 'Comment attraper ces erreurs ?'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_535ff57deda0b45d32cb37fd430accc8'] = 'Si votre hébergeur supporte les fichiers .htaccess, vous pouvez en créer un à la racine de PrestaShop et insérer la ligne suivante :'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_9cfaa8e935f9e3e65b0959b15b070b15'] = 'Un utilisateur qui demande une page non existante sera redirigé vers la page'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_feb436b0dabe28068aa6d866ac47bf0a'] = 'Ce module enregistre les accès à cette page avec : la page demandée initialement, la page source et le nombre de fois que c\'est arrivé.'; diff --git a/modules/pagesnotfound/it.php b/modules/pagesnotfound/it.php new file mode 100644 index 000000000..9f061d313 --- /dev/null +++ b/modules/pagesnotfound/it.php @@ -0,0 +1,21 @@ +pagesnotfound_251295238bdf7693252f2804c8d3707e'] = 'Pagine non trovate'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3ae7050d9f8502e9b69448a6db73fab2'] = 'Visualizza le pagine richieste dai visitatori ma non trovate'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_50004bd606668bb842e80f51337b765d'] = 'Pagine non trovate svuotate'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6cb944288ac528fcfd76b20156dddce1'] = 'È necessario utilizzare un file. Htaccess per reindirizzare gli errori 404 alla pagina \"404.php\"'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_193cfc9be3b995831c6af2fea6650e60'] = 'Pagina'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_b6f05e5ddde1ec63d992d61144452dfa'] = 'Referente'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_64d129224a5377b63e9727479ec987d9'] = 'Contatore'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d372ffc9065cb7d2ea24df137927d060'] = 'Nessuna pagina registrata'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_d8847bc418fc4f5a3e37c2e8390bb9ed'] = 'database vuoto'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_254b5e94768b90388cc7002d362351f0'] = 'Elimina TUTTE le pagine non trovate'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_3604249130acf7fda296e16edc996e5b'] = 'errori 404 '; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_1c4e115caef0bed8f5ca76da1909f967'] = 'Un errore 404 è un codice di errore HTTP che significa che il file richiesto dall\'utente non può essere trovato. Nel tuo caso significa che uno dei tuoi visitatori ha inserito un URL sbagliato nella barra degli indirizzi o che tu o un altro sito web ha un link morto da qualche parte. Quando è disponibile, il referente è mostrato in modo da poter trovare la pagina che contiene il link morti. Altrimenti in genere significa che si tratta di un accesso diretto, così forse qualcuno ha segnato un link che non esiste più.'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_a90083861c168ef985bf70763980aa60'] = 'Come individuare questi errori?'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_535ff57deda0b45d32cb37fd430accc8'] = 'Se il tuo provider supporta il file htaccess, è possibile crearlo nella directory principale di PrestaShop e inserirvi dentro la seguente riga:'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_9cfaa8e935f9e3e65b0959b15b070b15'] = 'Un utente che richiede una pagina che non esiste verrà reindirizzato alla pagina'; +$_MODULE['<{pagesnotfound}prestashop>pagesnotfound_feb436b0dabe28068aa6d866ac47bf0a'] = 'Questo modulo registra gli accessi a questa pagina: la pagina richiesta, la provenienza e il numero di volte che si è verificato.'; diff --git a/modules/pagesnotfound/logo.gif b/modules/pagesnotfound/logo.gif new file mode 100644 index 000000000..c3cbb5dfb Binary files /dev/null and b/modules/pagesnotfound/logo.gif differ diff --git a/modules/pagesnotfound/pagesnotfound.php b/modules/pagesnotfound/pagesnotfound.php new file mode 100644 index 000000000..fe2091719 --- /dev/null +++ b/modules/pagesnotfound/pagesnotfound.php @@ -0,0 +1,166 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Pagesnotfound extends Module +{ + private $_html = ''; + + function __construct() + { + $this->name = 'pagesnotfound'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Pages not found'); + $this->description = $this->l('Display the pages requested by your visitors but not found.'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('top') OR !$this->registerHook('AdminStatsModules')) + return false; + return Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'pagenotfound` ( + id_pagenotfound INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + request_uri VARCHAR(256) NOT NULL, + http_referer VARCHAR(256) NOT NULL, + date_add DATETIME NOT NULL, + PRIMARY KEY(id_pagenotfound), + INDEX (`date_add`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'); + } + + function uninstall() + { + return (parent::uninstall() AND Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'pagenotfound`')); + } + + private function getPages() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT http_referer, request_uri, COUNT(*) as nb + FROM `'._DB_PREFIX_.'pagenotfound` p + WHERE p.date_add BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY http_referer, request_uri'); + + $pages = array(); + foreach ($result as $row) + { + $row['http_referer'] = parse_url($row['http_referer'], PHP_URL_HOST).parse_url($row['http_referer'], PHP_URL_PATH); + if (!isset($row['http_referer']) OR empty($row['http_referer'])) + $row['http_referer'] = '--'; + if (!isset($pages[$row['request_uri']])) + $pages[$row['request_uri']] = array('nb' => 0); + $pages[$row['request_uri']][$row['http_referer']] = $row['nb']; + $pages[$row['request_uri']]['nb'] += $row['nb']; + } + uasort($pages, 'pnfSort'); + return $pages; + } + + function hookAdminStatsModules() + { + if (Tools::isSubmit('submitTruncatePNF')) + { + Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'pagenotfound`'); + $this->_html .= '
        '.$this->l('Pages not found has been emptied.').'
        '; + } + + $this->_html .= '
        '.$this->displayName.''; + if (!file_exists(dirname(__FILE__).'/../../.htaccess')) + $this->_html .= '
        '.$this->l('You must use a .htaccess file to redirect 404 errors to the page "404.php"').'
        '; + + $pages = $this->getPages(); + if (sizeof($pages)) + { + $this->_html .= ' + + + + + + '; + foreach ($pages as $ru => $hrs) + foreach ($hrs as $hr => $counter) + if ($hr != 'nb') + $this->_html .= ' + + + + + '; + $this->_html .= ' +
        '.$this->l('Page').''.$this->l('Referrer').''.$this->l('Counter').'
        '.wordwrap($ru, 30, '
        ', true).'
        '.wordwrap($hr, 40, '
        ', true).'
        '.$counter.'
        '; + } + else + $this->_html .= '
        '.$this->l('No pages registered').'
        '; + + $this->_html .= '
        '; + if (sizeof($pages)) + $this->_html .= '
         
        +
        '.$this->l('Empty database').' +
        +
        '; + $this->_html .= '
         
        +
        '.$this->l('Guide').' +

        '.$this->l('404 errors').'

        +

        '.$this->l('A 404 error is an HTTP error code which means that the file requested by the user cannot be found. In your case it means that one of your visitors entered a wrong URL in the address bar or that you or another website has a dead link. When it is available, the referrer is shown so you can find the page which contains the dead link. If not, it means generally that it is a direct access, so someone may have bookmarked a link which doesn\'t exist anymore.').'

        +

        '.$this->l('How to catch these errors?').'

        +

        '.$this->l('If your webhost supports the .htaccess file, you can create it in the root directory of PrestaShop and insert the following line inside:').' ErrorDocument 404 '.__PS_BASE_URI__.'404.php. '.$this->l('A user requesting a page which doesn\'t exist will be redirected to the page.').' '.__PS_BASE_URI__.'404.php. '.$this->l('This module logs the accesses to this page: the page requested, the referrer and the number of times that it occurred.').'


        +
        '; + + return $this->_html; + } + + function hookTop($params) + { + if (strstr($_SERVER['REQUEST_URI'], '404.php') AND isset($_SERVER['REDIRECT_URL'])) + $_SERVER['REQUEST_URI'] = $_SERVER['REDIRECT_URL']; + if (!Validate::isUrl($request_uri = $_SERVER['REQUEST_URI']) OR strstr($_SERVER['REQUEST_URI'], '-admin404')) + return; + if (strstr($_SERVER['PHP_SELF'], '404.php') AND !strstr($_SERVER['REQUEST_URI'], '404.php')) + { + $http_referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + if (empty($http_referer) OR Validate::isAbsoluteUrl($http_referer)) + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'pagenotfound` (`request_uri`,`http_referer`,`date_add`) VALUES (\''.pSQL($request_uri).'\',\''.pSQL($http_referer).'\',NOW())'); + } + } +} + +function pnfSort($a, $b) { + if ($a['nb'] == $b['nb']) + return 0; + return ($a['nb'] > $b['nb']) ? -1 : 1; +} + + diff --git a/modules/paypal/about.php b/modules/paypal/about.php new file mode 100644 index 000000000..7b2078637 --- /dev/null +++ b/modules/paypal/about.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +include(dirname(__FILE__).'/../../header.php'); + +$smarty->assign('iso_code', Tools::strtolower(Language::getIsoById($cookie->id_lang ? (int)($cookie->id_lang) : 1))); + +echo Module::display(dirname(__FILE__).'/paypal', 'about.tpl'); + +include(dirname(__FILE__).'/../../footer.php'); \ No newline at end of file diff --git a/modules/paypal/about.tpl b/modules/paypal/about.tpl new file mode 100644 index 000000000..c69d7db4a --- /dev/null +++ b/modules/paypal/about.tpl @@ -0,0 +1,42 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='What Is PayPal?' mod='paypal'}

        + +
        +

        {l s='PayPal, the trusted leader in online payments, enables buyers and businesses to send and receive money online. PayPal has over 100 million member accounts in 190 countries and regions. It\'s accepted by merchants everywhere, both on and off eBay.' mod='paypal'} +

        {l s='Is it safe to use?' mod='paypal'}

        +

        {l s='PayPal helps protect your credit card information with industry-leading security and fraud prevention systems. When you use PayPal, your financial information is never shared with the merchant.' mod='paypal'}

        +

        {l s='Why use PayPal?' mod='paypal'}

        +

        +

          +
        • {l s='Make purchases or send money with PayPal - it\'s free' mod='paypal'}
        • +
        • {l s='Shop and pay conveniently by saving your information with PayPal' mod='paypal'}
        • +
        • {l s='PayPal is accepted by millions of businesses worldwide and is the preferred payment method on eBay' mod='paypal'}
        • +
        +

        +

        {l s='Start using PayPal today!' mod='paypal'}

        +
        \ No newline at end of file diff --git a/modules/paypal/api/paypalconnect.php b/modules/paypal/api/paypalconnect.php new file mode 100644 index 000000000..4fa0d9f1e --- /dev/null +++ b/modules/paypal/api/paypalconnect.php @@ -0,0 +1,93 @@ +_logs[] = $this->l('Making new connection to').' \''.$host.$script.'\''; + if (function_exists('curl_exec')) + $return = $this->_connectByCURL($host.$script, $body); + if (isset($return) AND $return) + return $return; + $tmp = $this->_connectByFSOCK($host, $script, $body); + if (!$simple_mode || !preg_match('/[A-Z]+=/', $tmp, $result)) + return $tmp; + $pos = strpos($tmp, $result[0]); + $body = substr($tmp, $pos); + return $body; + } + + public function getLogs() + { + return $this->_logs; + } + + /************************************************************/ + /********************** CONNECT METHODS **********************/ + /************************************************************/ + + private function _connectByCURL($url, $body) + { + $ch = @curl_init(); + if (!$ch) + $this->_logs[] = $this->l('Connect failed with CURL method'); + else + { + $this->_logs[] = $this->l('Connect with CURL method successful'); + $this->_logs[] = ''.$this->l('Sending this params:').''; + $this->_logs[] = $body; + @curl_setopt($ch, CURLOPT_URL, 'https://'.$url); + @curl_setopt($ch, CURLOPT_POST, true); + @curl_setopt($ch, CURLOPT_POSTFIELDS, $body); + @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + @curl_setopt($ch, CURLOPT_HEADER, false); + @curl_setopt($ch, CURLOPT_TIMEOUT, 30); + @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + @curl_setopt($ch, CURLOPT_VERBOSE, true); + $result = @curl_exec($ch); + if (!$result) + $this->_logs[] = $this->l('Send with CURL method failed ! Error:').' '.curl_error($ch); + else + $this->_logs[] = $this->l('Send with CURL method successful'); + @curl_close($ch); + } + return (isset($result) ? $result : false); + } + + private function _connectByFSOCK($host, $script, $body) + { + $fp = @fsockopen('ssl://'.$host, 443, $errno, $errstr, 4); + if (!$fp) + $this->_logs[] = $this->l('Connect failed with fsockopen method'); + else + { + $header = $this->_makeHeader($host, $script, strlen($body)); + $this->_logs[] = $this->l('Connect with fsockopen method successful'); + $this->_logs[] = $this->l('Sending this params:').' '.$header.$body; + @fputs($fp, $header.$body); + $tmp = ''; + while (!feof($fp)) + $tmp .= trim(fgets($fp, 1024)); + fclose($fp); + $result = $tmp; + if (!$result) + $this->_logs[] = $this->l('Send with fsockopen method failed !'); + else + $this->_logs[] = $this->l('Send with fsockopen method successful'); + } + return (isset($result) ? $result : false); + } + + private function _makeHeader($host, $script, $lenght) + { + $header = 'POST '.strval($script).' HTTP/1.0'."\r\n" . + 'Host: '.strval($host)."\r\n". + 'Content-Type: application/x-www-form-urlencoded'."\r\n". + 'Content-Length: '.(int)($lenght)."\r\n". + 'Connection: close'."\r\n\r\n"; + return $header; + } +} diff --git a/modules/paypal/api/paypallib.php b/modules/paypal/api/paypallib.php new file mode 100644 index 000000000..91210325a --- /dev/null +++ b/modules/paypal/api/paypallib.php @@ -0,0 +1,63 @@ +_logs; + } + + public function makeCall($host, $script, $methodName, $string) + { + // Making request string + $request = 'METHOD='.urlencode($methodName).'&VERSION='.urlencode(PAYPAL_API_VERSION); + $request .= '&PWD='.urlencode(Configuration::get('PAYPAL_API_PASSWORD')).'&USER='.urlencode(Configuration::get('PAYPAL_API_USER')); + $request .= '&SIGNATURE='.urlencode(Configuration::get('PAYPAL_API_SIGNATURE')).$string; + + // Making connection + include_once(_PS_MODULE_DIR_.'paypal/api/paypalconnect.php'); + $ppConnect = new PaypalConnect(); + $result = $ppConnect->makeConnection($host, $script, $request, true); + $this->_logs = $ppConnect->getLogs(); + + // Formating response value + $response = explode('&', $result); + foreach ($response as $k => $res) + { + $tmp = explode('=', $res); + if (!isset($tmp[1])) + $response[$tmp[0]] = urldecode($tmp[0]); + else + { + $response[$tmp[0]] = urldecode($tmp[1]); + unset($response[$k]); + } + } + if (!Configuration::get('PAYPAL_MODE_DEBUG')) + $this->_logs = array(); + $toExclude = array('TOKEN', 'SUCCESSPAGEREDIRECTREQUESTED', 'VERSION', 'BUILD', 'ACK', 'CORRELATIONID'); + $this->_logs[] = ''.$this->l('PayPal response:').''; + foreach ($response as $k => $res) + { + if (!Configuration::get('PAYPAL_MODE_DEBUG') AND in_array($k, $toExclude)) + continue; + $this->_logs[] = $k.' -> '.$res; + } + return $response; + } + + public function makeSimpleCall($host, $script, $request) + { + // Making connection + include_once(_PS_MODULE_DIR_.'paypal/api/paypalconnect.php'); + $ppConnect = new PaypalConnect(); + $result = $ppConnect->makeConnection($host, $script, $request); + $this->_logs = $ppConnect->getLogs(); + return $result; + } +} + diff --git a/modules/paypal/column.tpl b/modules/paypal/column.tpl new file mode 100644 index 000000000..40e08a7df --- /dev/null +++ b/modules/paypal/column.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +

        PayPal

        +
        \ No newline at end of file diff --git a/modules/paypal/config.xml b/modules/paypal/config.xml new file mode 100755 index 000000000..5a455507a --- /dev/null +++ b/modules/paypal/config.xml @@ -0,0 +1,12 @@ + + + paypal + PayPal + 2.4 + Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal. + + payments_gateways + Are you sure you want to delete your details? + 1 + 1 + \ No newline at end of file diff --git a/modules/paypal/confirm.tpl b/modules/paypal/confirm.tpl new file mode 100644 index 000000000..c30d1fbc0 --- /dev/null +++ b/modules/paypal/confirm.tpl @@ -0,0 +1,61 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Your shopping cart' mod='paypal'}{$navigationPipe}{l s='PayPal' mod='paypal'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Order summary' mod='paypal'}

        + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +

        {l s='PayPal payment' mod='paypal'}

        +
        + {if isset($ppToken)}{/if} + {if isset($payerID)}{/if} +

        + {l s='PayPal' mod='paypal'} +
        {l s='You have chosen to pay with PayPal.' mod='paypal'} +

        + {l s='Here is a short summary of your order:' mod='paypal'} +

        +

        + - {l s='The total amount of your order is' mod='paypal'} + {convertPriceWithCurrency price=$total currency=$currency} {if $use_taxes == 1}{l s='(tax incl.)' mod='paypal'}{/if} +

        +

        + - {l s='We accept the following currency to be sent by PayPal:' mod='paypal'} {$currency->name} + +

        +

        + {l s='Please confirm your order by clicking \'I confirm my order\'' mod='paypal'}. +

        +

        + {l s='Other payment methods' mod='paypal'} + +

        +
        + diff --git a/modules/paypal/confirmation.tpl b/modules/paypal/confirmation.tpl new file mode 100644 index 000000000..201ebcd14 --- /dev/null +++ b/modules/paypal/confirmation.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Your order on' mod='paypal'} {$shop_name} {l s='is complete.' mod='paypal'} +

        + {l s='You have chosen the PayPal method.' mod='paypal'} +

        {l s='Your order will be sent very soon.' mod='paypal'} +

        {l s='For any questions or for further information, please contact our' mod='paypal'} {l s='customer support' mod='paypal'}. +

        diff --git a/modules/paypal/de.php b/modules/paypal/de.php new file mode 100644 index 000000000..ac34d11d4 --- /dev/null +++ b/modules/paypal/de.php @@ -0,0 +1,225 @@ +about_e816e21c1c8e0eba0620fa3df6bd6795'] = 'Was ist PayPal?'; +$_MODULE['<{paypal}prestashop>about_16ea57badae98f402bb8f2b2f49d4e77'] = 'PayPal ist ein bewährter Marktführer bei Online-Shop-Zahlungen, der es Käufern und Unternehmen ermöglicht, Geld online zu senden und zu empfangen. PayPal hat über 100 Millionen Mitgliedskonten in 190 Ländern und Regionen. Es wird von Händlern allerorten, sowohl auf als auch außerhalb von eBay, akzeptiert.'; +$_MODULE['<{paypal}prestashop>about_d20adade7baa1b60b713521031ea676c'] = 'Ist es sicher?'; +$_MODULE['<{paypal}prestashop>about_64f7b897c6d56fc62428f692ee5737cd'] = 'PayPal schützt Ihre Kreditkarteninformationen mit branchenweit führenden Sicherheits-und Betrugsbekämpfungssystemen. Wenn Sie PayPal verwenden, werden Ihre finanziellen Informationen dem Händler niemals sichtbar gemacht.'; +$_MODULE['<{paypal}prestashop>about_5ef30813484389e4200640c2f006004d'] = 'Warum PayPal?'; +$_MODULE['<{paypal}prestashop>about_86550d4ea832930db4366f03b90bdfb8'] = 'Gebührenfrei einkaufen oder Geld senden mit PayPal'; +$_MODULE['<{paypal}prestashop>about_7dc9e529337e5a55a12bf362b8e68cac'] = 'Bequem einkaufen und zahlen durch gespeicherte Daten bei PayPal'; +$_MODULE['<{paypal}prestashop>about_32098ae6a7ecd96805df9e48fb6cc739'] = 'PayPal wird von Millionen von Händlern weltweit akzeptiert und ist die bevorzugte Zahlungsmethode bei eBay'; +$_MODULE['<{paypal}prestashop>about_7934d7d1280bfbb8778743e39292af30'] = 'Nutzen Sie PayPal noch heute!'; +$_MODULE['<{paypal}prestashop>column_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Mit PayPal bezahlen '; +$_MODULE['<{paypal}prestashop>confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Ihr Warenkorb'; +$_MODULE['<{paypal}prestashop>confirm_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Zusammenfassung der Bestellung '; +$_MODULE['<{paypal}prestashop>confirm_dd23adc5fb6bda9c384397b31e57fc53'] = 'PayPal-Zahlung'; +$_MODULE['<{paypal}prestashop>confirm_62d74398cb6ebaa69ab7339052ca5c92'] = 'Sie haben PayPal für Ihre Zahlung gewählt.'; +$_MODULE['<{paypal}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Hier eine kurze Zusammenfassung Ihrer Bestellung:'; +$_MODULE['<{paypal}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; +$_MODULE['<{paypal}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; +$_MODULE['<{paypal}prestashop>confirm_8ed356c32b198c9cb2abab7c3d262b93'] = 'Wir akzeptieren die folgenden Währungen über PayPal:'; +$_MODULE['<{paypal}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \"Ich bestätige meine Bestellung\"'; +$_MODULE['<{paypal}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; +$_MODULE['<{paypal}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; +$_MODULE['<{paypal}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{paypal}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{paypal}prestashop>confirmation_15b0f8e55c6bdfc3d5fd0b6b3b6cb3ee'] = 'Sie haben die PayPal-Methode gewählt.'; +$_MODULE['<{paypal}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Ihre Bestellung wird sehr bald geschickt werden.'; +$_MODULE['<{paypal}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{paypal}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{paypal}prestashop>error_a40cab5994f36d4c48103a22ca082e8f'] = 'Ihr Warenkorb'; +$_MODULE['<{paypal}prestashop>error_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>error_425551a2289ed60c9260933d1c45ef00'] = 'Bitte lesen Sie die Protokolle:'; +$_MODULE['<{paypal}prestashop>error_0557fa923dcee4d0f86b1409f5c2167f'] = 'Zurück'; +$_MODULE['<{paypal}prestashop>paypal_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>paypal_6e7012516038a096b9f6bb71ba2cc5a3'] = 'Akzeptierte Zahlungen per Kreditkarte (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) mit PayPal'; +$_MODULE['<{paypal}prestashop>paypal_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sie sind sicher, dass Sie Ihre Daten löschen möchten?'; +$_MODULE['<{paypal}prestashop>paypal_1828820cc60e36b6f9fdf60cab103ed7'] = 'Sie nutzenzur Zeit die Standard-PayPal-Mail-Adresse, Sie müssen Ihre eigene E-Mail-Adresse verwenden'; +$_MODULE['<{paypal}prestashop>paypal_47b49d72ae0a4b3aa928fc4cc3e7fc53'] = 'Um diese Warnung zu ENTFERNEN, deinstallieren und entfernen Sie bitte das PayPalAPI Modul'; +$_MODULE['<{paypal}prestashop>paypal_7d0887294ed32e2013b64c4210e26841'] = 'Bitte benutzen Sie das PayPalAPI Modul nicht und entfernen Sie es.'; +$_MODULE['<{paypal}prestashop>paypal_a706f7e37a81dc235d41bbeb6fae92aa'] = 'Keine gültige Zahlungsmethode ausgewählt'; +$_MODULE['<{paypal}prestashop>paypal_32af90c3cfef1bacf43b0c3a8f60a4da'] = 'Geldbetrag wurde überwiesen'; +$_MODULE['<{paypal}prestashop>paypal_d238649ac5ec14afc894fad36c0b50fc'] = 'Die Anfrage nach Geldüberweisung war nicht erfolgreich, bitte lesen Sie die Protokollnachricht!'; +$_MODULE['<{paypal}prestashop>paypal_05b998de2c4fb46a7bdd37bd378b81d9'] = 'Die Bestätigung ist erfolgt, siehe Protokollnachricht!'; +$_MODULE['<{paypal}prestashop>paypal_aeca7e93a1b3d77e38c3cffa131774d5'] = 'Der Betrag wurde überwiesen'; +$_MODULE['<{paypal}prestashop>paypal_cba030a50c8a99c7e224adbe1cf58544'] = 'Die Anfrage nach Geldüberweisung war nicht erfolgreich, bitte lesen Sie die Protokollnachricht!'; +$_MODULE['<{paypal}prestashop>paypal_b630aa9b5e25da971949cae62dd109aa'] = 'PayPal Validation'; +$_MODULE['<{paypal}prestashop>paypal_e8fdd4382b75b42bfbd96eb7b032cf47'] = 'Information:'; +$_MODULE['<{paypal}prestashop>paypal_9119a92adbbf6c67bfb8a3aee0bdb720'] = 'Ausstehender Einzug- Kein Versand'; +$_MODULE['<{paypal}prestashop>paypal_c14eb95a724174f336b8ffdd98ef2f35'] = 'Ausstehende Zahlung - Kein Versand'; +$_MODULE['<{paypal}prestashop>paypal_5b18ff32c2aaaf4b79bdead10b10fe29'] = 'Zahlungsstatus erhalten'; +$_MODULE['<{paypal}prestashop>paypal_81e826adb70e2e6b189c2eef739d52d4'] = 'PayPal Capture'; +$_MODULE['<{paypal}prestashop>paypal_6f1f179632d90b3f71f5c83a1137e302'] = 'Einzugsbereite Geldbeträge vor Versand'; +$_MODULE['<{paypal}prestashop>paypal_3a81739e892c77e29ff4718c9dd92a34'] = 'Geld einziehen'; +$_MODULE['<{paypal}prestashop>paypal_8ba079f305b81b172792bc0469b6a690'] = 'PayPal Refund'; +$_MODULE['<{paypal}prestashop>paypal_016e1f278eccd700eaf33f74a501d050'] = 'Zahlung akzeptiert'; +$_MODULE['<{paypal}prestashop>paypal_a8b1cc445942a2e1a7d7cca641c86d67'] = 'Wenn Sie ein Produkt zurückzahlen, wird eine teilweise Rückerstattung vorgenommen, bis Sie die Option \"Gutschein generieren\" wählen'; +$_MODULE['<{paypal}prestashop>paypal_c2a5e2e23d8ec9cad779d657b7d33fc1'] = 'Rückerstattung der gesamten Transaktion'; +$_MODULE['<{paypal}prestashop>paypal_729a51874fe901b092899e9e8b31c97a'] = 'Sind Sie sicher?'; +$_MODULE['<{paypal}prestashop>paypal_20fda49ece75d93bea97648ab1f1f1cf'] = 'Produktergebnisse löschen'; +$_MODULE['<{paypal}prestashop>paypal_e5970a9962bc4cacb5adb408418a9f0c'] = 'Zulassung zu PayPal fehlgeschlagen'; +$_MODULE['<{paypal}prestashop>paypal_be6575076ac9b651d870a59970e7cd54'] = 'PayPal bestätigt Fehler'; +$_MODULE['<{paypal}prestashop>paypal_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Der von PayPal vergebene Token ist nicht der gleiche wie der Cookie Token'; +$_MODULE['<{paypal}prestashop>paypal_33ac76215cb67f61f891cc3113e55997'] = 'Genehmigung von PayPal für Zahlungsaufschub erteilt '; +$_MODULE['<{paypal}prestashop>paypal_8778ee03f6592d5fec9a1f2ee851e476'] = 'Bestellung mit PayPal abgeschlossen!'; +$_MODULE['<{paypal}prestashop>paypal_d89a00d4ba79c176bb0fc17f12d42a18'] = 'Paypal-Schlüssel \'mc_gross\' nicht angegeben, kann gezahlten Betrag nicht kontrollieren.'; +$_MODULE['<{paypal}prestashop>paypal_202a2860b19003ce53966a8780bb448b'] = 'Paypal-Schlüssel \"payment_status\" nicht angegeben, kann Zahlungsgültigkeit nicht kontrollieren.'; +$_MODULE['<{paypal}prestashop>paypal_bd0e34e5be6447844e6f262d51f1a9dc'] = 'Zahlung:'; +$_MODULE['<{paypal}prestashop>paypal_23703f7d045936080031477df1fc237b'] = 'Paypal Schlüssel \'custom\' nicht angegeben, kann keine Verbindung zum Warenkorb herstellen'; +$_MODULE['<{paypal}prestashop>paypal_760c3c2ccfadeee26c80c7b39462cf1d'] = 'Paypal-Schlüssel \'txn_id\' nicht angegeben, Transaktion unbekannt'; +$_MODULE['<{paypal}prestashop>paypal_7faa8448e059fb97d60d4a4b15634d98'] = 'Paypal-Schlüssel \'mc_currency\' nicht angegeben, Währung unbekannt'; +$_MODULE['<{paypal}prestashop>paypal_e61f52d02b9f52fbe1fd41ed320e29c3'] = 'Warenkorb nicht gefunden'; +$_MODULE['<{paypal}prestashop>paypal_0617900b1aff826081d07f5a3e2e7cd0'] = 'Bestellauftrag wurde bereits gestellt'; +$_MODULE['<{paypal}prestashop>paypal_f5209b3301a46f3057ffbf34d903e205'] = 'PayPal-Transaktion-ID:'; +$_MODULE['<{paypal}prestashop>paypal_7b19e875ff64b09d80ee05dcc84b9975'] = 'Die PayPal-Transaktion konnte nicht VERIFIZIERT werden.'; +$_MODULE['<{paypal}prestashop>paypal_20dfea1a472e5be3f15f6b5f36ca335c'] = 'Problem beim Verbinden mit dem PayPal-Server.'; +$_MODULE['<{paypal}prestashop>paypal_76ee8dc73701e846f7bccdf98dae079b'] = 'Keine Kommunikationsmittel zur Verfügung.'; +$_MODULE['<{paypal}prestashop>paypal_8358ec19f397d4cdd632688d4f79e535'] = 'Fehler in der Überprüfung (mit fsockopen). Zurückgegeben:'; +$_MODULE['<{paypal}prestashop>paypal_eca77e208634d52703b07672abbf16ec'] = 'Fehler in der Überprüfung (mit cURL). Zurückgegeben:'; +$_MODULE['<{paypal}prestashop>paypal_f7799c2ded739cf3c3e9babffc5f315b'] = 'Verbindung über cURL fehlgeschlagen'; +$_MODULE['<{paypal}prestashop>paypal_c640d8a3c2c34f79061a0bbe50e8420c'] = 'Bitte warten, Umleitung zu Paypal ... Danke.'; +$_MODULE['<{paypal}prestashop>paypal_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{paypal}prestashop>paypal_dae3b417a0fc4a49e851ce55d6d49551'] = 'Mein Warenkorb'; +$_MODULE['<{paypal}prestashop>paypal_9bfa2332c9c7198ac9774c6710bf76c4'] = 'Zurück zum Shop'; +$_MODULE['<{paypal}prestashop>paypal_d56249aa9643851a94bd3ef3da309d35'] = 'Paypal Fehler: (ungültige oder nicht definierte Geschäftskonto-E-Mail)'; +$_MODULE['<{paypal}prestashop>paypal_e7ac6f09a936201890de4094b1ee4e50'] = 'Paypal Fehler: (ungültige Adresse oder ungültiger Kunde)'; +$_MODULE['<{paypal}prestashop>paypal_49b21ad0d38942f635877e7bbc5d7a1e'] = 'Lösung'; +$_MODULE['<{paypal}prestashop>paypal_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{paypal}prestashop>paypal_9c81c7e49db6edc5ea243dbadfb28c2a'] = 'Logos und Benutzereinstellung'; +$_MODULE['<{paypal}prestashop>paypal_9d51eb502e6f46830cb97f53d761c212'] = 'Wählen Sie eine Lösung:'; +$_MODULE['<{paypal}prestashop>paypal_0234fed198d74928f2864c574a9a89c1'] = 'Zahlungen mit Kreditkarten'; +$_MODULE['<{paypal}prestashop>paypal_627fabff813cafcd9313ea0037c0125b'] = 'CB, Visa, Mastercard und Paypal-Konto'; +$_MODULE['<{paypal}prestashop>paypal_ec2d6b2d2cfb9eadee1c15f3d579252d'] = 'Zahlungen mit Karten + Verkäuferschutz'; +$_MODULE['<{paypal}prestashop>paypal_7d8bea00c8ed9c1cdf9da980bd69c85a'] = '(PayPal Integral Evolution, Monatsabonnement)'; +$_MODULE['<{paypal}prestashop>paypal_457e5c04d6690cc6a72412c792c504d9'] = 'Zahlungen durch'; +$_MODULE['<{paypal}prestashop>paypal_5d4023dba17f36ce69357d25cbe4fbad'] = 'PayPal-Konto'; +$_MODULE['<{paypal}prestashop>paypal_e574ea35c565033a741efb1925b5f188'] = '(PayPal-Option +)'; +$_MODULE['<{paypal}prestashop>paypal_fdcd0dc7120ef9d14417c968e0a16e97'] = 'Aktivierung an Bedingungen geknüpft'; +$_MODULE['<{paypal}prestashop>paypal_89e92ec866e363e88f12a7372d682c5c'] = 'Klicken Sie hier, um sich anzumelden'; +$_MODULE['<{paypal}prestashop>paypal_cd1bd0b0d3d22ede663f17df5194b3fe'] = 'Option:'; +$_MODULE['<{paypal}prestashop>paypal_28882d910d7b5311aa0a9d5094e11caf'] = 'PayPal Express: Zahlung in 2 Klicks'; +$_MODULE['<{paypal}prestashop>paypal_22afd6155cd35727f6ed449aef994731'] = 'Mit dem PayPal-Konto direkt aus der Warenkorb-Seite'; +$_MODULE['<{paypal}prestashop>paypal_4037fe43ff7b926e093805e2931c0f77'] = 'Nur Debuggen:'; +$_MODULE['<{paypal}prestashop>paypal_7c8ab5ce5bf608dd41cf3e8f2312451c'] = 'Lange Protokollnachricht aktivieren'; +$_MODULE['<{paypal}prestashop>paypal_d4dccb8ca2dac4e53c01bd9954755332'] = 'Speichern Sie die Einstellungen'; +$_MODULE['<{paypal}prestashop>paypal_7a262cb0d3d917313c8ba12f996fe83c'] = 'Wichtig:'; +$_MODULE['<{paypal}prestashop>paypal_de79de54313d8b57cd45c840d196b7d0'] = 'Zur Verwendung aller PayPal-Lösungen, müssen Sie die API-Parameter im «Einstellungen» -Tab einstellen'; +$_MODULE['<{paypal}prestashop>paypal_79f53a401ee04dbc765d0ba9a951a106'] = 'Sandbox-Modus (Tests)'; +$_MODULE['<{paypal}prestashop>paypal_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv'; +$_MODULE['<{paypal}prestashop>paypal_3cab03c00dbd11bc3569afa0748013f0'] = 'Inaktiv'; +$_MODULE['<{paypal}prestashop>paypal_4dbcb38bbbff5d4a402f2575c57a35e6'] = 'Zahlungsart'; +$_MODULE['<{paypal}prestashop>paypal_5bc5650bfb4c1eb3887ea80e7802301f'] = 'Direkt (Vertrieb)'; +$_MODULE['<{paypal}prestashop>paypal_6dd446781e32f1a989396e93db70437d'] = 'Autorisierung / Manuelle Erfassung'; +$_MODULE['<{paypal}prestashop>paypal_7186106a954f390f62860c11c8ba10d5'] = '(Zahlung Versand)'; +$_MODULE['<{paypal}prestashop>paypal_3cf5408a4a41b56c6fd7878a070b76ff'] = 'PayPal-Konto E-Mail'; +$_MODULE['<{paypal}prestashop>paypal_467008be031b7e1a913395f53556fea8'] = 'Aktivierung der API-Aufrufe'; +$_MODULE['<{paypal}prestashop>paypal_11931512987fbd1b884da55f13273a07'] = 'API Benutzername'; +$_MODULE['<{paypal}prestashop>paypal_5e07b6956454390018af63962ef4a3f6'] = 'API Kennwort'; +$_MODULE['<{paypal}prestashop>paypal_1c1357865e46a07448c95ebca39d4541'] = 'Leer lassen, wenn das Kennwort nicht geändert wurde'; +$_MODULE['<{paypal}prestashop>paypal_e1ededd62537e048b815f70cc971bec8'] = 'Signatur-API'; +$_MODULE['<{paypal}prestashop>paypal_52c59dac7b7ebfa8a0d78c98f2bc0225'] = 'Hier erfahren Sie, wie Sie Ihren API Benutzernamen, Ihr Kennwort und Ihre Signatur generieren können'; +$_MODULE['<{paypal}prestashop>paypal_e28b278d67eeecfad67e76ec78fc13e8'] = 'Logos und Benutzereinstellungen'; +$_MODULE['<{paypal}prestashop>paypal_ee0174ba1fc039128d0a38074a7af945'] = 'Banner Bild-URL'; +$_MODULE['<{paypal}prestashop>paypal_4c1c997e72e71eb6f690a9cd3dacb1f4'] = 'Das Bild sollte auf einem sicheren (https) Server gehostet werden. Max: 750x90px.'; +$_MODULE['<{paypal}prestashop>paypal_091878185fc791198ac80982860b21ed'] = 'Gewählte Vorlage für PayPal-Integral Evolution '; +$_MODULE['<{paypal}prestashop>paypal_cd8d30bc59ccf92028335d7e69e29905'] = 'Hier lernen Sie, wie man diese Vorlagen benutzerdefiniert'; +$_MODULE['<{paypal}prestashop>paypal_9518e6d551f7dc752b24af3629e849f9'] = 'Eröffnung Ihres PayPal-Kontos'; +$_MODULE['<{paypal}prestashop>paypal_4c9ef5964631b6d4b38f5f2f77d1be74'] = 'Durch die Eröffnung Ihres PayPal-Kontos, indem Sie auf das folgende Bild klicken, tragen Sie wesentlich zur Verbesserung der PrestaShop Software:'; +$_MODULE['<{paypal}prestashop>paypal_1569f6a31ff61f45c5ba13d7cab7e042'] = 'Dieses Modul ermöglicht es Ihnen, Zahlungen per PayPal akzeptieren.'; +$_MODULE['<{paypal}prestashop>paypal_3c4cb777e8df15388c680354569636b6'] = 'Wählt der Kunde diesen Zahlungsmodus, wird Ihr PayPal-Konto automatisch gutgeschrieben.'; +$_MODULE['<{paypal}prestashop>paypal_f9b49f93306d28e3dec595c3b89c926d'] = 'Sie müssen Ihr PayPal-Konto konfigurieren, bevor Sie dieses Modul benutzen.'; +$_MODULE['<{paypal}prestashop>paypal_57487012438fe78ae1d462e53a91bfc0'] = 'Lösung ist nicht gültig'; +$_MODULE['<{paypal}prestashop>paypal_f629bddb66252b97da3e7e5346697955'] = 'Sie müssen zumindest die Kontoinformationen angeben'; +$_MODULE['<{paypal}prestashop>paypal_909d37302176080797966972da84b4e7'] = 'E-Mail ist nicht gültig'; +$_MODULE['<{paypal}prestashop>paypal_2fa631ec6f6afeac6335f3261181063f'] = 'URL für Banner ist nicht gültig'; +$_MODULE['<{paypal}prestashop>paypal_19ea461c401bd941bf47a8bc01eecd6c'] = 'URL für Banner muss das HTTPS-Protokoll verwenden'; +$_MODULE['<{paypal}prestashop>paypal_b8822117a8cc930315a50bab7f6a4c80'] = 'PayPal-Vorlage ist nicht gültig'; +$_MODULE['<{paypal}prestashop>paypal_b02186eee414487a068584dc0d177ad2'] = 'Sie können Zulassung/ Einzug nicht nutzen, wenn Sie '; +$_MODULE['<{paypal}prestashop>paypal_17fcef6818690d11d7caaab023ecdcff'] = 'Sie können diese Lösung nicht nutzen, wenn Sie keine API-Zulassung haben'; +$_MODULE['<{paypal}prestashop>paypal_30e4e115bfc5e140782fd9cb01be6898'] = 'Sie können PayPal Express nicht nutzen, wenn Sie keine API-Zulassung haben'; +$_MODULE['<{paypal}prestashop>paypal_c888438d14855d7d96a2724ee9c306bd'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{paypal}prestashop>paypal_67c0e5ec07dd31dc74aaf55d6a72da31'] = 'Fehler beim Abrufen des Zahlungsstatus'; +$_MODULE['<{paypal}prestashop>paypal_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{paypal}prestashop>paypal_ccb168b5a6a86eb100dc2dee754a316b'] = 'Grund:'; +$_MODULE['<{paypal}prestashop>paypal_4f3acf5bcd7152fd301550bec6d0ffac'] = 'Fehler von PayPal:'; +$_MODULE['<{paypal}prestashop>paypal_a0d09826326fd385f6ceb17442f290de'] = 'Fehler bei Einzugsanfrage'; +$_MODULE['<{paypal}prestashop>paypal_e03187f3f9d6eda06a2a7c201f58cdca'] = 'Fehler bei Rückerstattungsanfrage'; +$_MODULE['<{paypal}prestashop>paypal_e5d5d9f40763cfe6549bef705e3529a7'] = 'Die Zahlungsnachricht ist nicht gültig, prüfen Sie bitte Ihr Modul!'; +$_MODULE['<{paypal}prestashop>paypal_eec39bf42bd135971fb2d838c67d1449'] = 'Ergebnis Rückerstattungsoperation'; +$_MODULE['<{paypal}prestashop>paypal_2ab62d1a578713d0862b56819295630e'] = 'Rückerstattung abgeschlossen mit PayPal!'; +$_MODULE['<{paypal}prestashop>paypal_a64db959966ba8d07c8b5d9493fcc21f'] = 'Fehler bei der Transaktion!'; +$_MODULE['<{paypal}prestashop>paypal_67962779da962e3d4225055afc05e7bd'] = 'Ergebnis Einzugsoperation'; +$_MODULE['<{paypal}prestashop>paypal_5a05744b8ccb5909bc83355092e0f3fa'] = 'Überprüfungsstatus:'; +$_MODULE['<{paypal}prestashop>paypalconnect_d1f14cc4a2dade80c92421d26422fea0'] = 'Neue Verbindung herstellen zu'; +$_MODULE['<{paypal}prestashop>paypalconnect_94a27811a721ef512ad7bfa06cab34e0'] = 'Verbindung fehlgeschlagen mit CURL Methode '; +$_MODULE['<{paypal}prestashop>paypalconnect_70215486455daee13382c68b1a230b82'] = 'Verbindung erfolgreich mit CURL Methode '; +$_MODULE['<{paypal}prestashop>paypalconnect_e4c4ad49bced42265b5facc2175cdafd'] = 'Senden dieser Parameter:'; +$_MODULE['<{paypal}prestashop>paypalconnect_445583f6641da98fc7ac8fd9d13a564b'] = 'Sendung mit CURL Methode fehlgeschlagen! Fehler:'; +$_MODULE['<{paypal}prestashop>paypalconnect_ef4fbf36eaa2083442d386990ba063c2'] = 'Sendung mit CURL Methode erfolgreich'; +$_MODULE['<{paypal}prestashop>paypalconnect_bf059c9751bb1a20b449b7917b1df374'] = 'Verbindung fehlgeschlagen mit fsockopen Methode '; +$_MODULE['<{paypal}prestashop>paypalconnect_ea800e3536f81238a4cbc32eb6db4eaf'] = 'Verbindung erfolgreich mit fsockopen Methode '; +$_MODULE['<{paypal}prestashop>paypalconnect_6e9aa4cb541e09b07602d4ea96080811'] = 'Sendung mit fsockopen Methode fehlgeschlagen!'; +$_MODULE['<{paypal}prestashop>paypalconnect_842a183be225d415b2b4375ba1dd1c94'] = 'Sendung mit fsockopen Methode erfolgreich'; +$_MODULE['<{paypal}prestashop>paypallib_7c2d00d8c94d1ce0f515db8b0481db40'] = 'PayPal Antwort:'; +$_MODULE['<{paypal}prestashop>authentication_cd42c6dd6cc4cd65cb5e13b729050469'] = 'Überprüfen Sie Ihre Informationen'; +$_MODULE['<{paypal}prestashop>authentication_6335a00a08fde0fbb8f6d6630cdadd92'] = 'Ihre persönlichen Daten'; +$_MODULE['<{paypal}prestashop>authentication_b78a3223503896721cca1303f776159b'] = 'Titel'; +$_MODULE['<{paypal}prestashop>authentication_127469a6b4253ebb77adccc0dd48461e'] = 'Herr'; +$_MODULE['<{paypal}prestashop>authentication_29e32764941c30d1bb41c601014fbdbd'] = 'Frau'; +$_MODULE['<{paypal}prestashop>authentication_20db0bfeecd8fe60533206a2b5e9891a'] = 'Vorname'; +$_MODULE['<{paypal}prestashop>authentication_8d3f5eff9c40ee315d452392bed5309b'] = 'Nachname'; +$_MODULE['<{paypal}prestashop>authentication_1e884e3078d9978e216a027ecd57fb34'] = 'E-Mail'; +$_MODULE['<{paypal}prestashop>authentication_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{paypal}prestashop>authentication_bf2957630c4209f61a388a08c2154915'] = '(5 Zeichen min.)'; +$_MODULE['<{paypal}prestashop>authentication_aac772216aecbeca0e86d06671fe985a'] = 'Geburtstag'; +$_MODULE['<{paypal}prestashop>authentication_86f5978d9b80124f509bdb71786e929e'] = 'Januar'; +$_MODULE['<{paypal}prestashop>authentication_659e59f062c75f81259d22786d6c44aa'] = 'Februar'; +$_MODULE['<{paypal}prestashop>authentication_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'März'; +$_MODULE['<{paypal}prestashop>authentication_3fcf026bbfffb63fb24b8de9d0446949'] = 'April'; +$_MODULE['<{paypal}prestashop>authentication_195fbb57ffe7449796d23466085ce6d8'] = 'Mai'; +$_MODULE['<{paypal}prestashop>authentication_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Juni'; +$_MODULE['<{paypal}prestashop>authentication_1b539f6f34e8503c97f6d3421346b63c'] = 'Juli'; +$_MODULE['<{paypal}prestashop>authentication_41ba70891fb6f39327d8ccb9b1dafb84'] = 'August'; +$_MODULE['<{paypal}prestashop>authentication_cc5d90569e1c8313c2b1c2aab1401174'] = 'September'; +$_MODULE['<{paypal}prestashop>authentication_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Oktober'; +$_MODULE['<{paypal}prestashop>authentication_7e823b37564da492ca1629b4732289a8'] = 'November'; +$_MODULE['<{paypal}prestashop>authentication_82331503174acbae012b2004f6431fa5'] = 'Dezember'; +$_MODULE['<{paypal}prestashop>authentication_6f6162d3a052bb330e9c60285c74c6c9'] = 'Unseren Newsletter abonnieren'; +$_MODULE['<{paypal}prestashop>authentication_ac135c86084a47630c9eadb4edd5ef75'] = 'Sonderangebote unserer Partner erhalten'; +$_MODULE['<{paypal}prestashop>authentication_455175f3f5be6306247babb349c0515a'] = 'Ihre Adresse'; +$_MODULE['<{paypal}prestashop>authentication_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{paypal}prestashop>authentication_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{paypal}prestashop>authentication_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse 2'; +$_MODULE['<{paypal}prestashop>authentication_9b514b51d03075005814a33edc74c958'] = 'PLZ '; +$_MODULE['<{paypal}prestashop>authentication_57d056ed0984166336b7879c2af3657f'] = 'Stadt'; +$_MODULE['<{paypal}prestashop>authentication_59716c97497eb9694541f7c3d37b1a4d'] = 'Land'; +$_MODULE['<{paypal}prestashop>authentication_46a2a41cc6e552044816a2d04634545d'] = 'Staat'; +$_MODULE['<{paypal}prestashop>authentication_0f68b904e33d9ac04605aecc958bcf52'] = 'Weitere Informationen'; +$_MODULE['<{paypal}prestashop>authentication_fe66abce284ec8589e7d791185b5c442'] = 'Telefon Festnetz'; +$_MODULE['<{paypal}prestashop>authentication_41c2fff4867cc204120f001e7af20f7a'] = 'Telefon mobil'; +$_MODULE['<{paypal}prestashop>authentication_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Tragen Sie einen Adresstitel ein für spätere Referenz'; +$_MODULE['<{paypal}prestashop>authentication_ae7bdef7fe2bbbbf02c11e92c5fceb40'] = 'Meine Adresse'; +$_MODULE['<{paypal}prestashop>authentication_a0bfb8e59e6c13fc8d990781f77694fe'] = 'Weiter'; +$_MODULE['<{paypal}prestashop>authentication_19f823c6453c2b1ffd09cb715214813d'] = 'Pflichtfeld'; +$_MODULE['<{paypal}prestashop>login_b40ad46c25c153a3d2fde078c0e1b0f8'] = 'Bitte loggen Sie sich ein'; +$_MODULE['<{paypal}prestashop>login_abc57016a138dea055e0d8be6358f84e'] = 'Diese E-Mail wurde bereits registriert, bitte melden Sie sich an!'; +$_MODULE['<{paypal}prestashop>login_8b5dd64ab8d0b8158906796b53a200e2'] = 'E-Mail-Adresse'; +$_MODULE['<{paypal}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{paypal}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Anmelden'; +$_MODULE['<{paypal}prestashop>login_01a569ddc6cf67ddec2a683f0a5f5956'] = 'Kennwort vergessen?'; +$_MODULE['<{paypal}prestashop>paypalexpress_b601224a2a6c61f38738ca903fb019a2'] = 'Kein gültiger Warenkorb'; +$_MODULE['<{paypal}prestashop>paypalexpress_ee9dc1e678d54c517f481583c3fb2db8'] = 'Keine gültige Währung'; +$_MODULE['<{paypal}prestashop>shopping_cart_aa91004934e1abdb620b5d0f0c18681c'] = 'Bezahlen mit PayPal Express Checkout'; +$_MODULE['<{paypal}prestashop>submit_528d1f824243db48e40cb6223d32fa06'] = 'Kein Token von PayPal erhalten'; +$_MODULE['<{paypal}prestashop>submit_795277047da13b4fc74e02e050b1a675'] = 'PayPal Fehlerrücksendung'; +$_MODULE['<{paypal}prestashop>submit_b4133f1ba03a914134a5281a08231078'] = 'Zulassung zu PayPal fehlgeschlagen'; +$_MODULE['<{paypal}prestashop>submit_4935b58d37fda5bd60acc510cb324342'] = 'Kann PayPal-Kontoinformationen nicht abrufen '; +$_MODULE['<{paypal}prestashop>submit_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Von PayPal erhaltener Token ist nicht derselbe wie der Cookie-Token'; +$_MODULE['<{paypal}prestashop>paypal_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Bezahlen mit PayPal'; +$_MODULE['<{paypal}prestashop>payment_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Bezahlen mit PayPal'; +$_MODULE['<{paypal}prestashop>payment_a3f2caee6ef8e68fbd26e42d83f2bf65'] = 'Bezahlen Sie mit Ihrem PayPal-Konto, Kreditkarte (CB, Visa, Mastercard ...), oder privaten Kreditkarte'; +$_MODULE['<{paypal}prestashop>payment_b08008a2de4331ba13f006c9bcf37b62'] = 'Bezahlen Sie mit Ihrem PayPal-Konto'; +$_MODULE['<{paypal}prestashop>paypalpayment_ee9dc1e678d54c517f481583c3fb2db8'] = 'Keine gültige Währung'; diff --git a/modules/paypal/error.tpl b/modules/paypal/error.tpl new file mode 100644 index 000000000..c2e334b12 --- /dev/null +++ b/modules/paypal/error.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Your shopping cart' mod='paypal'}{$navigationPipe}{l s='PayPal' mod='paypal'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {$message}

        +{if isset($logs) && $logs} +
        +

        {l s='Please refer to logs:' mod='paypal'}

        +
          + {foreach from=$logs key=k item=log} +
        1. {$log}
        2. + {/foreach} +
        +

        « {l s='Back' mod='paypal'}

        +
        +{/if} diff --git a/modules/paypal/es.php b/modules/paypal/es.php new file mode 100644 index 000000000..6ff5b96aa --- /dev/null +++ b/modules/paypal/es.php @@ -0,0 +1,225 @@ +about_e816e21c1c8e0eba0620fa3df6bd6795'] = '¿Qué es PayPal?'; +$_MODULE['<{paypal}prestashop>about_16ea57badae98f402bb8f2b2f49d4e77'] = 'PayPal es el líder indiscutible de pagos por Internet: tiene más de 100 millones de cuentas repartidas en 190 países de todo el mundo. Es aceptado como forma de pago por muchos vendedores, tanto dentro como fuera de eBay. '; +$_MODULE['<{paypal}prestashop>about_d20adade7baa1b60b713521031ea676c'] = '¿Es un servicio seguro?'; +$_MODULE['<{paypal}prestashop>about_64f7b897c6d56fc62428f692ee5737cd'] = 'PayPal protege sus datos financieros con los mejores sistemas de seguridad y prevención de fraude del mercado. PayPal nunca revela sus datos financieros al vendedor. '; +$_MODULE['<{paypal}prestashop>about_5ef30813484389e4200640c2f006004d'] = '¿Por qué utilizar PayPal?'; +$_MODULE['<{paypal}prestashop>about_86550d4ea832930db4366f03b90bdfb8'] = ' Haga compras y envíe pagos con PayPal: es gratuito (consulte las condicio'; +$_MODULE['<{paypal}prestashop>about_7dc9e529337e5a55a12bf362b8e68cac'] = 'Registre sus datos en PayPal y compre con toda tranquilidad . '; +$_MODULE['<{paypal}prestashop>about_32098ae6a7ecd96805df9e48fb6cc739'] = 'Millones de vendedores de todo el mundo aceptan PayPal y es la forma de pago más utilizada en eBay. '; +$_MODULE['<{paypal}prestashop>about_7934d7d1280bfbb8778743e39292af30'] = '¡Utilice PayPal ya!'; +$_MODULE['<{paypal}prestashop>column_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Pagar con PayPal'; +$_MODULE['<{paypal}prestashop>confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Su carrito de la compra'; +$_MODULE['<{paypal}prestashop>confirm_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal '; +$_MODULE['<{paypal}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Resumen del pedido '; +$_MODULE['<{paypal}prestashop>confirm_dd23adc5fb6bda9c384397b31e57fc53'] = 'Pago con PayPal '; +$_MODULE['<{paypal}prestashop>confirm_62d74398cb6ebaa69ab7339052ca5c92'] = 'Ha elegido pagar con PayPal. '; +$_MODULE['<{paypal}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Breve resumen del pedido: '; +$_MODULE['<{paypal}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido es de'; +$_MODULE['<{paypal}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(TTC) '; +$_MODULE['<{paypal}prestashop>confirm_8ed356c32b198c9cb2abab7c3d262b93'] = 'Aceptamos esta divisa para el pago : '; +$_MODULE['<{paypal}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Confirme su pedido pulsando \"Confirmar pedido\"'; +$_MODULE['<{paypal}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Otras formas de pago'; +$_MODULE['<{paypal}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Confirmar pedido'; +$_MODULE['<{paypal}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = ' El pedido de '; +$_MODULE['<{paypal}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = ' se ha guardado correctamente'; +$_MODULE['<{paypal}prestashop>confirmation_15b0f8e55c6bdfc3d5fd0b6b3b6cb3ee'] = ' Ha seleccionado PayPal como forma de pago'; +$_MODULE['<{paypal}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = ' Le enviaremos el pedido lo antes posible'; +$_MODULE['<{paypal}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = ' Si tiene dudas o necesita información adicional, póngase en contacto con nuestro'; +$_MODULE['<{paypal}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = ' servicio de atención al cliente '; +$_MODULE['<{paypal}prestashop>error_a40cab5994f36d4c48103a22ca082e8f'] = 'Carrito de la compra'; +$_MODULE['<{paypal}prestashop>error_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>error_425551a2289ed60c9260933d1c45ef00'] = 'Compruebe los registros: '; +$_MODULE['<{paypal}prestashop>error_0557fa923dcee4d0f86b1409f5c2167f'] = 'Anterior'; +$_MODULE['<{paypal}prestashop>paypal_ad69e733ebae8d264bccaa38d68830e8'] = ' PayPal '; +$_MODULE['<{paypal}prestashop>paypal_6e7012516038a096b9f6bb71ba2cc5a3'] = 'Acepta pagos con tarjetas de débito y crédito (Visa, MasterCard, Amex, Aurora) con PayPal'; +$_MODULE['<{paypal}prestashop>paypal_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = '¿Está seguro de que desea eliminar su configuración? '; +$_MODULE['<{paypal}prestashop>paypal_1828820cc60e36b6f9fdf60cab103ed7'] = 'Actualmente está utilizando la dirección email PayPal por defecto, debe sustituirla por sus propia dirección'; +$_MODULE['<{paypal}prestashop>paypal_47b49d72ae0a4b3aa928fc4cc3e7fc53'] = 'Para QUITAR esta advertencia, desinstale y quite este módulo PayPalAPI.rn'; +$_MODULE['<{paypal}prestashop>paypal_7d0887294ed32e2013b64c4210e26841'] = 'No utilice y quite el módulo PayPalAPI.'; +$_MODULE['<{paypal}prestashop>paypal_a706f7e37a81dc235d41bbeb6fae92aa'] = 'No se ha seleccionado una forma de págo válida'; +$_MODULE['<{paypal}prestashop>paypal_32af90c3cfef1bacf43b0c3a8f60a4da'] = 'Se han recuperado los fondos'; +$_MODULE['<{paypal}prestashop>paypal_d238649ac5ec14afc894fad36c0b50fc'] = 'La solicitud de recuperación de fondos no se ha hecho correctamente, consulte el mensaje de registro.'; +$_MODULE['<{paypal}prestashop>paypal_05b998de2c4fb46a7bdd37bd378b81d9'] = 'Se ha completado la validación, consulte el mensaje de registro.'; +$_MODULE['<{paypal}prestashop>paypal_aeca7e93a1b3d77e38c3cffa131774d5'] = 'Se ha hecho un reintegro.'; +$_MODULE['<{paypal}prestashop>paypal_cba030a50c8a99c7e224adbe1cf58544'] = 'La solicitud de reintegro no se ha hecho correctamente, consulte el mensaje de registro.'; +$_MODULE['<{paypal}prestashop>paypal_b630aa9b5e25da971949cae62dd109aa'] = 'Validación de PayPal'; +$_MODULE['<{paypal}prestashop>paypal_e8fdd4382b75b42bfbd96eb7b032cf47'] = 'Información:'; +$_MODULE['<{paypal}prestashop>paypal_9119a92adbbf6c67bfb8a3aee0bdb720'] = 'Pendiente de captura; sin envío'; +$_MODULE['<{paypal}prestashop>paypal_c14eb95a724174f336b8ffdd98ef2f35'] = 'Pendiente de pago; sin envío'; +$_MODULE['<{paypal}prestashop>paypal_5b18ff32c2aaaf4b79bdead10b10fe29'] = 'Obtener estado de pago'; +$_MODULE['<{paypal}prestashop>paypal_81e826adb70e2e6b189c2eef739d52d4'] = 'Captura de PayPal'; +$_MODULE['<{paypal}prestashop>paypal_6f1f179632d90b3f71f5c83a1137e302'] = 'Pueden capturarse los fondos antes del envío'; +$_MODULE['<{paypal}prestashop>paypal_3a81739e892c77e29ff4718c9dd92a34'] = 'Obtener el dinero'; +$_MODULE['<{paypal}prestashop>paypal_8ba079f305b81b172792bc0469b6a690'] = 'Reintegro de PayPal'; +$_MODULE['<{paypal}prestashop>paypal_016e1f278eccd700eaf33f74a501d050'] = 'Pago aceptado'; +$_MODULE['<{paypal}prestashop>paypal_a8b1cc445942a2e1a7d7cca641c86d67'] = 'Si emite un reintegro por un producto, se realiza un reintegro parcial a menos que marque la opción \"Generar cupón\".'; +$_MODULE['<{paypal}prestashop>paypal_c2a5e2e23d8ec9cad779d657b7d33fc1'] = 'Reintegrar el total de la transacción'; +$_MODULE['<{paypal}prestashop>paypal_729a51874fe901b092899e9e8b31c97a'] = '¿Está seguro?'; +$_MODULE['<{paypal}prestashop>paypal_20fda49ece75d93bea97648ab1f1f1cf'] = 'Cancelar resultados de productos:'; +$_MODULE['<{paypal}prestashop>paypal_e5970a9962bc4cacb5adb408418a9f0c'] = 'Error de autorización a PayPal'; +$_MODULE['<{paypal}prestashop>paypal_be6575076ac9b651d870a59970e7cd54'] = 'PayPal devolvió un error'; +$_MODULE['<{paypal}prestashop>paypal_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'El token proporcionado por PayPal no es el mismo que el de la cookie'; +$_MODULE['<{paypal}prestashop>paypal_33ac76215cb67f61f891cc3113e55997'] = 'Autorización de pago diferido concedida por PayPal'; +$_MODULE['<{paypal}prestashop>paypal_8778ee03f6592d5fec9a1f2ee851e476'] = 'Pedido completado con PayPal'; +$_MODULE['<{paypal}prestashop>paypal_d89a00d4ba79c176bb0fc17f12d42a18'] = 'La clave de PayPal \'mc_gross\' no se ha especificado; no se puede controlar el importe pagado.'; +$_MODULE['<{paypal}prestashop>paypal_202a2860b19003ce53966a8780bb448b'] = 'No se ha especificado la clave PayPal \'payment_status\'; no se puede verificar la validez del pago'; +$_MODULE['<{paypal}prestashop>paypal_bd0e34e5be6447844e6f262d51f1a9dc'] = 'Pago: '; +$_MODULE['<{paypal}prestashop>paypal_23703f7d045936080031477df1fc237b'] = 'El token proporcionado por PayPal no es el mismo que el del cookie'; +$_MODULE['<{paypal}prestashop>paypal_760c3c2ccfadeee26c80c7b39462cf1d'] = 'No se ha especificado la clave PayPal \'txn_id\', transacción no reconocida'; +$_MODULE['<{paypal}prestashop>paypal_7faa8448e059fb97d60d4a4b15634d98'] = 'No se ha especificado la clave PayPal \'mc_currency\', divisa no reconocida'; +$_MODULE['<{paypal}prestashop>paypal_e61f52d02b9f52fbe1fd41ed320e29c3'] = ' No se puede encontrar el carro de la compra'; +$_MODULE['<{paypal}prestashop>paypal_0617900b1aff826081d07f5a3e2e7cd0'] = 'Ya se ha procesado el pedido'; +$_MODULE['<{paypal}prestashop>paypal_f5209b3301a46f3057ffbf34d903e205'] = 'Id. de la transacción de PayPal: '; +$_MODULE['<{paypal}prestashop>paypal_7b19e875ff64b09d80ee05dcc84b9975'] = 'No se ha podido verificar la transacción de PayPal. '; +$_MODULE['<{paypal}prestashop>paypal_20dfea1a472e5be3f15f6b5f36ca335c'] = ' Error de conexión con el servidor de PayPal. '; +$_MODULE['<{paypal}prestashop>paypal_76ee8dc73701e846f7bccdf98dae079b'] = 'No hay protocolos de comunicación disponibles. '; +$_MODULE['<{paypal}prestashop>paypal_8358ec19f397d4cdd632688d4f79e535'] = 'Error de verificación (protocolo fsockopen) . Retroceso: '; +$_MODULE['<{paypal}prestashop>paypal_eca77e208634d52703b07672abbf16ec'] = 'Error de verificación (protocolo cURL) . Retroceso: '; +$_MODULE['<{paypal}prestashop>paypal_f7799c2ded739cf3c3e9babffc5f315b'] = 'Error de conexión con protocolo cURL. '; +$_MODULE['<{paypal}prestashop>paypal_c640d8a3c2c34f79061a0bbe50e8420c'] = 'Por favor espere, le redirigimos a PayPal... Gracias. '; +$_MODULE['<{paypal}prestashop>paypal_ea4788705e6873b424c65e91c2846b19'] = 'Cancelar'; +$_MODULE['<{paypal}prestashop>paypal_dae3b417a0fc4a49e851ce55d6d49551'] = 'Mi carrito'; +$_MODULE['<{paypal}prestashop>paypal_9bfa2332c9c7198ac9774c6710bf76c4'] = 'Volver a la tienda'; +$_MODULE['<{paypal}prestashop>paypal_d56249aa9643851a94bd3ef3da309d35'] = 'Error Paypal: (dirección email business no válida o incorrecta)'; +$_MODULE['<{paypal}prestashop>paypal_e7ac6f09a936201890de4094b1ee4e50'] = 'Error Paypal: (direccción o cliente no válidos)'; +$_MODULE['<{paypal}prestashop>paypal_49b21ad0d38942f635877e7bbc5d7a1e'] = 'Solución'; +$_MODULE['<{paypal}prestashop>paypal_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{paypal}prestashop>paypal_9c81c7e49db6edc5ea243dbadfb28c2a'] = 'Logotipos y personalizaciones'; +$_MODULE['<{paypal}prestashop>paypal_9d51eb502e6f46830cb97f53d761c212'] = 'Elija una solución:'; +$_MODULE['<{paypal}prestashop>paypal_0234fed198d74928f2864c574a9a89c1'] = 'Pagos con tarjetas de crédito'; +$_MODULE['<{paypal}prestashop>paypal_627fabff813cafcd9313ea0037c0125b'] = '(Visa, MasterCard, Amex y Aurora) y cuenta PayPal'; +$_MODULE['<{paypal}prestashop>paypal_ec2d6b2d2cfb9eadee1c15f3d579252d'] = 'Pagos con tarjetas y protección del vendedor'; +$_MODULE['<{paypal}prestashop>paypal_7d8bea00c8ed9c1cdf9da980bd69c85a'] = '(Pasarela integral de PayPal, suscripción mensual)'; +$_MODULE['<{paypal}prestashop>paypal_457e5c04d6690cc6a72412c792c504d9'] = 'Pagos con'; +$_MODULE['<{paypal}prestashop>paypal_5d4023dba17f36ce69357d25cbe4fbad'] = 'Cuenta PayPal'; +$_MODULE['<{paypal}prestashop>paypal_e574ea35c565033a741efb1925b5f188'] = '(PayPal Option+)'; +$_MODULE['<{paypal}prestashop>paypal_fdcd0dc7120ef9d14417c968e0a16e97'] = 'Activación sujeta a condiciones y suscripción mensual'; +$_MODULE['<{paypal}prestashop>paypal_89e92ec866e363e88f12a7372d682c5c'] = 'haga clic aquí para suscribirse'; +$_MODULE['<{paypal}prestashop>paypal_cd1bd0b0d3d22ede663f17df5194b3fe'] = 'Opción:'; +$_MODULE['<{paypal}prestashop>paypal_28882d910d7b5311aa0a9d5094e11caf'] = 'Pago exprés de PayPal: pago en 2 clics'; +$_MODULE['<{paypal}prestashop>paypal_22afd6155cd35727f6ed449aef994731'] = 'con cuenta PayPal directamente del carro de la compra'; +$_MODULE['<{paypal}prestashop>paypal_4037fe43ff7b926e093805e2931c0f77'] = 'Solo modo debug'; +$_MODULE['<{paypal}prestashop>paypal_7c8ab5ce5bf608dd41cf3e8f2312451c'] = 'Activa los mensajes de log completos'; +$_MODULE['<{paypal}prestashop>paypal_d4dccb8ca2dac4e53c01bd9954755332'] = 'Guardar configuración'; +$_MODULE['<{paypal}prestashop>paypal_7a262cb0d3d917313c8ba12f996fe83c'] = 'Importante:'; +$_MODULE['<{paypal}prestashop>paypal_de79de54313d8b57cd45c840d196b7d0'] = 'Para utilizar cualquier solución de PayPal, debe configurar los parámetros de API en la pestaña \"Ajustes\".'; +$_MODULE['<{paypal}prestashop>paypal_79f53a401ee04dbc765d0ba9a951a106'] = 'Modo de entorno de pruebas'; +$_MODULE['<{paypal}prestashop>paypal_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activado'; +$_MODULE['<{paypal}prestashop>paypal_3cab03c00dbd11bc3569afa0748013f0'] = 'Desactivado'; +$_MODULE['<{paypal}prestashop>paypal_4dbcb38bbbff5d4a402f2575c57a35e6'] = 'Tipo de pago'; +$_MODULE['<{paypal}prestashop>paypal_5bc5650bfb4c1eb3887ea80e7802301f'] = 'Directo (ventas)'; +$_MODULE['<{paypal}prestashop>paypal_6dd446781e32f1a989396e93db70437d'] = 'Autorización y captura'; +$_MODULE['<{paypal}prestashop>paypal_7186106a954f390f62860c11c8ba10d5'] = '(Pago de envío)'; +$_MODULE['<{paypal}prestashop>paypal_3cf5408a4a41b56c6fd7878a070b76ff'] = 'Correo electrónico de cuenta PayPal'; +$_MODULE['<{paypal}prestashop>paypal_467008be031b7e1a913395f53556fea8'] = 'Activación de llamadas API'; +$_MODULE['<{paypal}prestashop>paypal_11931512987fbd1b884da55f13273a07'] = 'Nombre de usuario de API'; +$_MODULE['<{paypal}prestashop>paypal_5e07b6956454390018af63962ef4a3f6'] = 'Contraseña de API'; +$_MODULE['<{paypal}prestashop>paypal_1c1357865e46a07448c95ebca39d4541'] = 'Déjelo en blanco si no ha cambiado la contraseña'; +$_MODULE['<{paypal}prestashop>paypal_e1ededd62537e048b815f70cc971bec8'] = 'Firma de API'; +$_MODULE['<{paypal}prestashop>paypal_52c59dac7b7ebfa8a0d78c98f2bc0225'] = 'Haga clic aquí para saber cómo generar su nombre de usuario, contraseña y firma de API.'; +$_MODULE['<{paypal}prestashop>paypal_e28b278d67eeecfad67e76ec78fc13e8'] = 'Logotipos y personalizaciones'; +$_MODULE['<{paypal}prestashop>paypal_ee0174ba1fc039128d0a38074a7af945'] = ' URL de la imagen del banner '; +$_MODULE['<{paypal}prestashop>paypal_4c1c997e72e71eb6f690a9cd3dacb1f4'] = 'La imagen debe estar alojada en un servidor seguro (https). Máx.: 750x90px.'; +$_MODULE['<{paypal}prestashop>paypal_091878185fc791198ac80982860b21ed'] = 'Plantilla de Pasarela integral de PayPal'; +$_MODULE['<{paypal}prestashop>paypal_cd8d30bc59ccf92028335d7e69e29905'] = 'Haga clic aquí para saber cómo personalizar esta plantilla.'; +$_MODULE['<{paypal}prestashop>paypal_9518e6d551f7dc752b24af3629e849f9'] = 'Abrir una cuenta PayPal '; +$_MODULE['<{paypal}prestashop>paypal_4c9ef5964631b6d4b38f5f2f77d1be74'] = 'Si abre su cuenta PayPal pulsando la imagen que aparece a continuación, nos ayuda a mejorar la aplicación PrestaShop: '; +$_MODULE['<{paypal}prestashop>paypal_1569f6a31ff61f45c5ba13d7cab7e042'] = 'Este módulo le permite aceptar los pagos por PayPal '; +$_MODULE['<{paypal}prestashop>paypal_3c4cb777e8df15388c680354569636b6'] = 'Si el cliente elige esta forma de pago, los fondos se abonarán automáticamente a su cuenta'; +$_MODULE['<{paypal}prestashop>paypal_f9b49f93306d28e3dec595c3b89c926d'] = 'Debe configurar su cuenta PayPal antes de usar este módulo.'; +$_MODULE['<{paypal}prestashop>paypal_57487012438fe78ae1d462e53a91bfc0'] = 'la solución no es válida.'; +$_MODULE['<{paypal}prestashop>paypal_f629bddb66252b97da3e7e5346697955'] = 'debe indicar al menos la información de cuenta'; +$_MODULE['<{paypal}prestashop>paypal_909d37302176080797966972da84b4e7'] = 'el correo electrónico no es válido'; +$_MODULE['<{paypal}prestashop>paypal_2fa631ec6f6afeac6335f3261181063f'] = 'La URL del banner no es válida'; +$_MODULE['<{paypal}prestashop>paypal_19ea461c401bd941bf47a8bc01eecd6c'] = 'La URL del banner debe utilizar el protocolo HTTPS'; +$_MODULE['<{paypal}prestashop>paypal_b8822117a8cc930315a50bab7f6a4c80'] = 'la plantilla de PayPal no es válida'; +$_MODULE['<{paypal}prestashop>paypal_b02186eee414487a068584dc0d177ad2'] = 'no puede utilizar autorización y captura si no tiene credenciales de API'; +$_MODULE['<{paypal}prestashop>paypal_17fcef6818690d11d7caaab023ecdcff'] = 'no puede utilizar esta solución si no tiene credenciales de API'; +$_MODULE['<{paypal}prestashop>paypal_30e4e115bfc5e140782fd9cb01be6898'] = 'no puede utilizar Pago exprés si no tiene credenciales de API'; +$_MODULE['<{paypal}prestashop>paypal_c888438d14855d7d96a2724ee9c306bd'] = 'Se actualiza la configuración'; +$_MODULE['<{paypal}prestashop>paypal_67c0e5ec07dd31dc74aaf55d6a72da31'] = 'Error al obtener estado de pago'; +$_MODULE['<{paypal}prestashop>paypal_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; +$_MODULE['<{paypal}prestashop>paypal_ccb168b5a6a86eb100dc2dee754a316b'] = 'Razón:'; +$_MODULE['<{paypal}prestashop>paypal_4f3acf5bcd7152fd301550bec6d0ffac'] = 'Error de PayPal:'; +$_MODULE['<{paypal}prestashop>paypal_a0d09826326fd385f6ceb17442f290de'] = 'Error al solicitar captura'; +$_MODULE['<{paypal}prestashop>paypal_e03187f3f9d6eda06a2a7c201f58cdca'] = 'Error al solicitar reintegro'; +$_MODULE['<{paypal}prestashop>paypal_e5d5d9f40763cfe6549bef705e3529a7'] = 'El mensaje de pago no es válido, compruebe su módulo.'; +$_MODULE['<{paypal}prestashop>paypal_eec39bf42bd135971fb2d838c67d1449'] = 'Resultado de la operación de reintegro:'; +$_MODULE['<{paypal}prestashop>paypal_2ab62d1a578713d0862b56819295630e'] = 'Reintegro completado con PayPal.'; +$_MODULE['<{paypal}prestashop>paypal_a64db959966ba8d07c8b5d9493fcc21f'] = 'Error de transacción.'; +$_MODULE['<{paypal}prestashop>paypal_67962779da962e3d4225055afc05e7bd'] = 'Resultado de la operación de captura:'; +$_MODULE['<{paypal}prestashop>paypal_5a05744b8ccb5909bc83355092e0f3fa'] = 'Estado de verificación:'; +$_MODULE['<{paypal}prestashop>paypalconnect_d1f14cc4a2dade80c92421d26422fea0'] = 'Abrir una nueva conexión con'; +$_MODULE['<{paypal}prestashop>paypalconnect_94a27811a721ef512ad7bfa06cab34e0'] = 'Error de la conexión con el método cURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_70215486455daee13382c68b1a230b82'] = 'La conexión con el método cURL se ha desarrollado con éxito'; +$_MODULE['<{paypal}prestashop>paypalconnect_e4c4ad49bced42265b5facc2175cdafd'] = 'Envío de parámetros:'; +$_MODULE['<{paypal}prestashop>paypalconnect_445583f6641da98fc7ac8fd9d13a564b'] = 'Error de envío con el método cURL. Error:'; +$_MODULE['<{paypal}prestashop>paypalconnect_ef4fbf36eaa2083442d386990ba063c2'] = 'Envío con éxito con el método cURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_bf059c9751bb1a20b449b7917b1df374'] = 'Error de la conexión con el método fsockopen'; +$_MODULE['<{paypal}prestashop>paypalconnect_ea800e3536f81238a4cbc32eb6db4eaf'] = 'La conexión con el método fsockopen se ha desarrollado con éxito'; +$_MODULE['<{paypal}prestashop>paypalconnect_6e9aa4cb541e09b07602d4ea96080811'] = 'Error de envío con el método fsockopen. Error:'; +$_MODULE['<{paypal}prestashop>paypalconnect_842a183be225d415b2b4375ba1dd1c94'] = 'Envío con éxito con el método fsockopen'; +$_MODULE['<{paypal}prestashop>paypallib_7c2d00d8c94d1ce0f515db8b0481db40'] = ' Respuesta de PayPal : '; +$_MODULE['<{paypal}prestashop>authentication_cd42c6dd6cc4cd65cb5e13b729050469'] = 'Compruebe sus datos'; +$_MODULE['<{paypal}prestashop>authentication_6335a00a08fde0fbb8f6d6630cdadd92'] = 'Datos personales'; +$_MODULE['<{paypal}prestashop>authentication_b78a3223503896721cca1303f776159b'] = 'Tratamiento'; +$_MODULE['<{paypal}prestashop>authentication_127469a6b4253ebb77adccc0dd48461e'] = 'Sr.'; +$_MODULE['<{paypal}prestashop>authentication_29e32764941c30d1bb41c601014fbdbd'] = 'Sra.'; +$_MODULE['<{paypal}prestashop>authentication_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nombre'; +$_MODULE['<{paypal}prestashop>authentication_8d3f5eff9c40ee315d452392bed5309b'] = 'Apellidos'; +$_MODULE['<{paypal}prestashop>authentication_1e884e3078d9978e216a027ecd57fb34'] = 'Correo electrónico'; +$_MODULE['<{paypal}prestashop>authentication_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{paypal}prestashop>authentication_bf2957630c4209f61a388a08c2154915'] = '( 5 caracteres mín.)'; +$_MODULE['<{paypal}prestashop>authentication_aac772216aecbeca0e86d06671fe985a'] = 'Fecha de nacimiento'; +$_MODULE['<{paypal}prestashop>authentication_86f5978d9b80124f509bdb71786e929e'] = 'Enero'; +$_MODULE['<{paypal}prestashop>authentication_659e59f062c75f81259d22786d6c44aa'] = 'Febrero'; +$_MODULE['<{paypal}prestashop>authentication_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Marzo'; +$_MODULE['<{paypal}prestashop>authentication_3fcf026bbfffb63fb24b8de9d0446949'] = 'Abril'; +$_MODULE['<{paypal}prestashop>authentication_195fbb57ffe7449796d23466085ce6d8'] = 'Mayo'; +$_MODULE['<{paypal}prestashop>authentication_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Junio'; +$_MODULE['<{paypal}prestashop>authentication_1b539f6f34e8503c97f6d3421346b63c'] = 'Julio'; +$_MODULE['<{paypal}prestashop>authentication_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Agosto'; +$_MODULE['<{paypal}prestashop>authentication_cc5d90569e1c8313c2b1c2aab1401174'] = 'Septiembre'; +$_MODULE['<{paypal}prestashop>authentication_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Octubre'; +$_MODULE['<{paypal}prestashop>authentication_7e823b37564da492ca1629b4732289a8'] = 'Noviembre'; +$_MODULE['<{paypal}prestashop>authentication_82331503174acbae012b2004f6431fa5'] = 'Diciembre'; +$_MODULE['<{paypal}prestashop>authentication_6f6162d3a052bb330e9c60285c74c6c9'] = 'Suscribirse al boletín'; +$_MODULE['<{paypal}prestashop>authentication_ac135c86084a47630c9eadb4edd5ef75'] = 'Recibir las ofertas especiales de nuestros socios'; +$_MODULE['<{paypal}prestashop>authentication_455175f3f5be6306247babb349c0515a'] = 'Su dirección'; +$_MODULE['<{paypal}prestashop>authentication_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Empresa'; +$_MODULE['<{paypal}prestashop>authentication_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección'; +$_MODULE['<{paypal}prestashop>authentication_783cb853aae6984e51583b3bb80c09d2'] = 'Dirección (línea 2)'; +$_MODULE['<{paypal}prestashop>authentication_9b514b51d03075005814a33edc74c958'] = 'Código postal'; +$_MODULE['<{paypal}prestashop>authentication_57d056ed0984166336b7879c2af3657f'] = 'Ciudad'; +$_MODULE['<{paypal}prestashop>authentication_59716c97497eb9694541f7c3d37b1a4d'] = 'Provincia'; +$_MODULE['<{paypal}prestashop>authentication_46a2a41cc6e552044816a2d04634545d'] = 'Estado'; +$_MODULE['<{paypal}prestashop>authentication_0f68b904e33d9ac04605aecc958bcf52'] = 'Información adicional'; +$_MODULE['<{paypal}prestashop>authentication_fe66abce284ec8589e7d791185b5c442'] = 'Teléfono personal'; +$_MODULE['<{paypal}prestashop>authentication_41c2fff4867cc204120f001e7af20f7a'] = 'Teléfono móvil'; +$_MODULE['<{paypal}prestashop>authentication_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Dé un nombre a esta dirección para encontrarla fácilmente'; +$_MODULE['<{paypal}prestashop>authentication_ae7bdef7fe2bbbbf02c11e92c5fceb40'] = 'Mi dirección'; +$_MODULE['<{paypal}prestashop>authentication_a0bfb8e59e6c13fc8d990781f77694fe'] = 'Continuar'; +$_MODULE['<{paypal}prestashop>authentication_19f823c6453c2b1ffd09cb715214813d'] = 'Campo obligatorio'; +$_MODULE['<{paypal}prestashop>login_b40ad46c25c153a3d2fde078c0e1b0f8'] = 'Identifíquese'; +$_MODULE['<{paypal}prestashop>login_abc57016a138dea055e0d8be6358f84e'] = 'Dirección ya registrada. Identifíquese.'; +$_MODULE['<{paypal}prestashop>login_8b5dd64ab8d0b8158906796b53a200e2'] = 'Dirección de correo electrónico'; +$_MODULE['<{paypal}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{paypal}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Identificarse'; +$_MODULE['<{paypal}prestashop>login_01a569ddc6cf67ddec2a683f0a5f5956'] = '¿Ha olvidado su contraseña?'; +$_MODULE['<{paypal}prestashop>paypalexpress_b601224a2a6c61f38738ca903fb019a2'] = 'Carrito de compra incorrecto'; +$_MODULE['<{paypal}prestashop>paypalexpress_ee9dc1e678d54c517f481583c3fb2db8'] = 'Divisa incorrecta'; +$_MODULE['<{paypal}prestashop>shopping_cart_aa91004934e1abdb620b5d0f0c18681c'] = 'Pagar con Pago exprés'; +$_MODULE['<{paypal}prestashop>submit_528d1f824243db48e40cb6223d32fa06'] = 'PayPal no ha dado ningún código'; +$_MODULE['<{paypal}prestashop>submit_795277047da13b4fc74e02e050b1a675'] = 'PayPal ha devuelto un error'; +$_MODULE['<{paypal}prestashop>submit_b4133f1ba03a914134a5281a08231078'] = 'Error de autorización de PayPal'; +$_MODULE['<{paypal}prestashop>submit_4935b58d37fda5bd60acc510cb324342'] = 'No se han encontrado los datos de la cuenta PayPal'; +$_MODULE['<{paypal}prestashop>submit_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'El código proporcionado por PayPal no es el mismo que el de la cookie'; +$_MODULE['<{paypal}prestashop>paypal_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Pagar con PayPal'; +$_MODULE['<{paypal}prestashop>payment_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Pagar con PayPal'; +$_MODULE['<{paypal}prestashop>payment_a3f2caee6ef8e68fbd26e42d83f2bf65'] = 'Pague con su cuenta PayPal, tarjeta de crédito (CB, Visa, Mastercard ...), o tarjeta de crédito privado'; +$_MODULE['<{paypal}prestashop>payment_b08008a2de4331ba13f006c9bcf37b62'] = 'Pague con su cuenta PayPal'; +$_MODULE['<{paypal}prestashop>paypalpayment_ee9dc1e678d54c517f481583c3fb2db8'] = 'Divisa incorrecta'; diff --git a/modules/paypal/express/authentication.tpl b/modules/paypal/express/authentication.tpl new file mode 100644 index 000000000..2aadca094 --- /dev/null +++ b/modules/paypal/express/authentication.tpl @@ -0,0 +1,200 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +

        {l s='Check your information' mod='paypal'}

        + +{assign var='current_step' value='login'} +{include file="$tpl_dir./order-steps.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +
        + + +

        + + + + *{l s='Required field' mod='paypal'} +

        +
        \ No newline at end of file diff --git a/modules/paypal/express/login.tpl b/modules/paypal/express/login.tpl new file mode 100644 index 000000000..21d18b282 --- /dev/null +++ b/modules/paypal/express/login.tpl @@ -0,0 +1,52 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Please log in' mod='paypal'}

        + +{assign var='current_step' value='login'} +{include file="$tpl_dir./order-steps.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +
        +
        +

        {l s='This email has already been registered, please log in !' mod='paypal'}

        +

        + + +

        +

        + + +

        +

        + + + +

        +

        {l s='Forgot your password?' mod='paypal'}

        +
        +
        diff --git a/modules/paypal/express/paypalexpress.php b/modules/paypal/express/paypalexpress.php new file mode 100644 index 000000000..615b4e2a8 --- /dev/null +++ b/modules/paypal/express/paypalexpress.php @@ -0,0 +1,104 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PaypalExpress extends Paypal +{ + protected $_logs = array(); + + public function getAuthorisation() + { + global $cookie; + + // Getting cart informations + $cart = new Cart((int)($cookie->id_cart)); + if (!Validate::isLoadedObject($cart)) + $this->_logs[] = $this->l('Not a valid cart'); + $currency = new Currency((int)($cart->id_currency)); + if (!Validate::isLoadedObject($currency)) + $this->_logs[] = $this->l('Not a valid currency'); + + if (sizeof($this->_logs)) + return false; + + // Making request + $returnURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/express/submit.php'; + $cancelURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php'; + $paymentAmount = (float)($cart->getOrderTotal()); + $currencyCodeType = strval($currency->iso_code); + $paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale'; + $request = '&Amt='.urlencode($paymentAmount).'&PAYMENTACTION='.urlencode($paymentType).'&ReturnUrl='.urlencode($returnURL).'&CANCELURL='.urlencode($cancelURL).'&CURRENCYCODE='.urlencode($currencyCodeType); + if ($this->_pp_integral) + $request .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing'; + else + $request .= '&SOLUTIONTYPE=Mark&LANDINGPAGE=Login'; + $request .= '&LOCALECODE='.strtoupper($this->getCountryCode()); + if ($this->_header) $request .= '&HDRIMG='.urlencode($this->_header); + // Customer informations + $customer = new Customer((int)$cart->id_customer); + $request .= '&EMAIL='.urlencode($customer->email);//customer + // address of delivery + $address = new Address((int)$cart->id_address_delivery); + $country = new Country((int)$address->id_country); + if ($address->id_state) + $state = new State((int)$address->id_state); + $request .= '&SHIPTONAME='.urlencode($address->firstname.' '.$address->lastname); + $request .= '&SHIPTOSTREET='.urlencode($address->address1); + $request .= '&SHIPTOSTREET2='.urlencode($address->address2); + $request .= '&SHIPTOCITY='.urlencode($address->city); + $request .= '&SHIPTOSTATE='.($address->id_state ? $state->iso_code : $country->iso_code); + $request .= '&SHIPTOZIP='.urlencode($address->postcode); + $request .= '&SHIPTOCOUNTRY='.urlencode($country->iso_code); + $request .= '&SHIPTOPHONENUM='.urlencode($address->phone); + + // Calling PayPal API + include(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + $ppAPI = new PaypalLib(); + $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request); + $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); + return $result; + } + + public function getCustomerInfos() + { + global $cookie; + + // Making request + $request = '&TOKEN='.urlencode(strval($cookie->paypal_token)); + + // Calling PayPal API + include(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + $ppAPI = new PaypalLib(); + $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetExpressCheckoutDetails', $request); + $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); + return $result; + } + + public function getLogs() + { + return $this->_logs; + } +} diff --git a/modules/paypal/express/shopping_cart.tpl b/modules/paypal/express/shopping_cart.tpl new file mode 100644 index 000000000..14edcdb65 --- /dev/null +++ b/modules/paypal/express/shopping_cart.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +paypal \ No newline at end of file diff --git a/modules/paypal/express/submit.php b/modules/paypal/express/submit.php new file mode 100644 index 000000000..4c3bf53fa --- /dev/null +++ b/modules/paypal/express/submit.php @@ -0,0 +1,379 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../../config/config.inc.php'); +include_once(dirname(__FILE__).'/../../../init.php'); + +include_once(_PS_MODULE_DIR_.'paypal/paypal.php'); +include_once(_PS_MODULE_DIR_.'paypal/express/paypalexpress.php'); + +$ppExpress = new PaypalExpress(); +$errors = array(); + +// ##### +// Functions + +function getAuthorization() +{ + global $ppExpress, $cookie; + + $result = $ppExpress->getAuthorisation(); + $logs = $ppExpress->getLogs(); + if (is_array($result) AND sizeof($result)) + { + if (strtoupper($result['ACK']) == 'SUCCESS') + { + if (isset($result['TOKEN'])) + { + $cookie->paypal_token = strval($result['TOKEN']); + $cookie->paypal_token_date = time(); + header('Location: https://'.$ppExpress->getPayPalURL().'/webscr&cmd=_express-checkout&token='.urldecode(strval($cookie->paypal_token))); + exit; + } + else + $logs[] = ''.$ppExpress->l('No token given by PayPal', 'submit').''; + } else + $logs[] = ''.$ppExpress->l('PayPal returned error', 'submit').''; + } + $ppExpress->displayPayPalAPIError($ppExpress->l('Authorisation to PayPal failed', 'submit'), $logs); +} + +function getInfos() +{ + global $ppExpress, $cookie; + + $result = $ppExpress->getCustomerInfos(); + $logs = $ppExpress->getLogs(); + + if (!is_array($result) OR !isset($result['ACK']) OR strtoupper($result['ACK']) != 'SUCCESS') + { + $logs[] = ''.$ppExpress->l('Cannot retrieve PayPal account information', 'submit').''; + $ppExpress->displayPayPalAPIError($ppExpress->l('PayPal returned error', 'submit'), $logs); + } + elseif (!isset($result['TOKEN']) OR $result['TOKEN'] != $cookie->paypal_token) + { + $logs[] = ''.$ppExpress->l('Token given by PayPal is not the same as the cookie token', 'submit').''; + $ppExpress->displayPayPalAPIError($ppExpress->l('PayPal returned error', 'submit'), $logs); + } + return $result; +} + +function displayProcess($payerID) +{ + global $cookie; + + $cookie->paypal_token = strval($cookie->paypal_token); + $cookie->paypal_payer_id = $payerID; + Tools::redirect('order.php?step=1&back=paypal'); +} + +function displayConfirm() +{ + global $cookie, $smarty, $ppExpress, $cart, $payerID; + + if (!$cookie->isLogged(true)) + die('Not logged'); + if (!$payerID AND !$payerID = Tools::htmlentitiesUTF8(strval(Tools::getValue('payerID')))) + die('No payer ID'); + + // Display all and exit + include(_PS_ROOT_DIR_.'/header.php'); + + $smarty->assign(array( + 'back' => 'paypal', + 'logo' => $ppExpress->getLogo(), + 'ppToken' => strval($cookie->paypal_token), + 'cust_currency' => $cart->id_currency, + 'currencies' => $ppExpress->getCurrency((int)$cart->id_currency), + 'total' => $cart->getOrderTotal(true, Cart::BOTH), + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'. $ppExpress->name.'/', + 'payerID' => $payerID, + 'mode' => 'express/' + )); + + echo $ppExpress->display('paypal.php', 'confirm.tpl'); + include(_PS_ROOT_DIR_.'/footer.php'); + die ; +} + +function submitConfirm() +{ + global $cookie, $smarty, $ppExpress, $cart; + + if (!$cookie->isLogged(true)) + die('Not logged'); + elseif (!$currency = (int)(Tools::getValue('currency_payement'))) + die('No currency'); + elseif (!$payerID = Tools::htmlentitiesUTF8(strval(Tools::getValue('payerID')))) + die('No payer ID'); + elseif (!$cart->getOrderTotal(true, Cart::BOTH)) + die('Empty cart'); + + $ppExpress->makePayPalAPIValidation($cookie, $cart, $currency, $payerID, 'express'); +} + +function submitAccount() +{ + global $cookie, $errors, $smarty; + $email = Tools::getValue('email'); + if (empty($email) OR !Validate::isEmail($email)) + $errors[] = Tools::displayError('e-mail not valid'); + elseif (!Validate::isPasswd(Tools::getValue('passwd'))) + $errors[] = Tools::displayError('invalid password'); + elseif (Customer::customerExists($email)) + $errors[] = Tools::displayError('someone has already registered with this e-mail address'); + elseif (!@checkdate(Tools::getValue('months'), Tools::getValue('days'), Tools::getValue('years')) AND !(Tools::getValue('months') == '' AND Tools::getValue('days') == '' AND Tools::getValue('years') == '')) + $errors[] = Tools::displayError('invalid birthday'); + else + { + $customer = new Customer(); + if (Tools::isSubmit('newsletter')) + { + $customer->ip_registration_newsletter = pSQL(Tools::getRemoteAddr()); + $customer->newsletter_date_add = pSQL(date('Y-m-d h:i:s')); + } + $customer->birthday = (empty($_POST['years']) ? '' : (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days'])); + /* Customer and address, same fields, caching data */ + $errors = $customer->validateControler(); + $address = new Address(); + $address->id_customer = 1; + $errors = array_unique(array_merge($errors, $address->validateControler())); + if (!sizeof($errors)) + { + $customer->active = 1; + if (!$customer->add()) + $errors[] = Tools::displayError('an error occurred while creating your account'); + else + { + $address->id_customer = (int)($customer->id); + if (!$address->add()) + $errors[] = Tools::displayError('an error occurred while creating your address'); + else + { + if (Mail::Send((int)($cookie->id_lang), 'account', Mail::l('Welcome!'), + array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname)) + $smarty->assign('confirmation', 1); + $cookie->id_customer = (int)($customer->id); + $cookie->customer_lastname = $customer->lastname; + $cookie->customer_firstname = $customer->firstname; + $cookie->passwd = $customer->passwd; + $cookie->logged = 1; + $cookie->email = $customer->email; + Module::hookExec('createAccount', array( + '_POST' => $_POST, + 'newCustomer' => $customer + )); + + // Next ! + $payerID = strval(Tools::getValue('payerID')); + displayProcess($payerID); + } + } + } + } +} + +function submitLogin() +{ + global $cookie, $errors; + + $passwd = trim(Tools::getValue('passwd')); + $email = trim(Tools::getValue('email')); + if (empty($email)) + $errors[] = Tools::displayError('e-mail address is required'); + elseif (empty($email) OR !Validate::isEmail($email)) + $errors[] = Tools::displayError('invalid e-mail address'); + elseif (empty($passwd)) + $errors[] = Tools::displayError('password is required'); + elseif (Tools::strlen($passwd) > 32) + $errors[] = Tools::displayError('password is too long'); + elseif (!Validate::isPasswd($passwd)) + $errors[] = Tools::displayError('invalid password'); + else + { + $customer = new Customer(); + $authentication = $customer->getByemail(trim($email), trim($passwd)); + /* Handle brute force attacks */ + sleep(1); + if (!$authentication OR !$customer->id) + $errors[] = Tools::displayError('authentication failed'); + else + { + $cookie->id_customer = (int)($customer->id); + $cookie->customer_lastname = $customer->lastname; + $cookie->customer_firstname = $customer->firstname; + $cookie->logged = 1; + $cookie->passwd = $customer->passwd; + $cookie->email = $customer->email; + if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0)) + $cookie->id_cart = Cart::lastNoneOrderedCart($customer->id); + Module::hookExec('authentication'); + + // Next ! + $payerID = strval(Tools::getValue('payerID')); + displayProcess($payerID); + } + } +} + +function displayLogin() +{ + global $cookie, $result, $email, $payerID, $errors, $ppExpress, $smarty; + + // Customer exists, login form + + // If customer already logged, check if same mail than PayPal, and go through, or unlog + if ($cookie->isLogged(true) AND isset($result['EMAIL']) AND $cookie->email == $result['EMAIL']) + displayProcess($payerID); + elseif ($cookie->isLogged(true)) + $cookie->makeNewLog(); + + // Smarty assigns + $smarty->assign(array( + 'email' => $email, + 'ppToken' => strval($cookie->paypal_token), + 'errors'=> $errors, + 'payerID' => $payerID + )); + + // Display all and exit + include(_PS_ROOT_DIR_.'/header.php'); + echo $ppExpress->display('paypal.php', 'express/login.tpl'); + include(_PS_ROOT_DIR_.'/footer.php'); + die ; +} + +function displayAccount() +{ + global $cookie, $result, $email, $payerID, $errors, $ppExpress, $smarty; + + // Customer does not exists, signup form + + // If customer already logged, unlog him + if ($cookie->isLogged(true)) + $cookie->makeNewLog(); + + // Generate years, months and days + if (isset($_POST['years']) AND is_numeric($_POST['years'])) + $selectedYears = (int)($_POST['years']); + $years = Tools::dateYears(); + if (isset($_POST['months']) AND is_numeric($_POST['months'])) + $selectedMonths = (int)($_POST['months']); + $months = Tools::dateMonths(); + if (isset($_POST['days']) AND is_numeric($_POST['days'])) + $selectedDays = (int)($_POST['days']); + $days = Tools::dateDays(); + + // Select the most appropriate country + if (Tools::getValue('id_country')) + $selectedCountry = (int)(Tools::getValue('id_country')); + else + $selectedCountry = Country::getByIso(strval($result['COUNTRYCODE'])); + $countries = Country::getCountries((int)($cookie->id_lang), true); + + // Smarty assigns + $smarty->assign(array( + 'years' => $years, + 'sl_year' => (isset($selectedYears) ? $selectedYears : 0), + 'months' => $months, + 'sl_month' => (isset($selectedMonths) ? $selectedMonths : 0), + 'days' => $days, + 'sl_day' => (isset($selectedDays) ? $selectedDays : 0), + 'countries' => $countries, + 'sl_country' => (isset($selectedCountry) ? $selectedCountry : 0), + 'email' => $email, + 'firstname' => (Tools::getValue('customer_firstname') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('customer_firstname'))) : $result['FIRSTNAME']), + 'lastname' => (Tools::getValue('customer_lastname') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('customer_lastname'))) : $result['LASTNAME']), + 'street' => (Tools::getValue('address1') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('address1'))) : (isset($result['SHIPTOSTREET']) ? $result['SHIPTOSTREET'] : '')), + 'city' => (Tools::getValue('city') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('city'))) : (isset($result['SHIPTOCITY']) ? $result['SHIPTOCITY'] : '')), + 'zip' => (Tools::getValue('postcode') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('postcode'))) : (isset($result['SHIPTOZIP']) ? $result['SHIPTOZIP'] : '')), + 'payerID' => $payerID, + 'ppToken' => strval($cookie->paypal_token), + 'errors'=> $errors + )); + + // Display all and exit + include(_PS_ROOT_DIR_.'/header.php'); + echo $ppExpress->display('paypal.php', 'express/authentication.tpl'); + include(_PS_ROOT_DIR_.'/footer.php'); + die ; +} + +// ##### +// Process !! + +// No token, we need to get one by making PayPal Authorisation +if (!isset($cookie->paypal_token) OR !$cookie->paypal_token) + getAuthorization(); +else +{ + // We have token, we need to confirm user informations (login or signup) + if ((int)(Tools::getValue('confirm'))) + displayConfirm(); + elseif (Tools::isSubmit('submitAccount')) + submitAccount(); + elseif (Tools::isSubmit('submitLogin')) + submitLogin(); + elseif (Tools::isSubmit('submitPayment')) + submitConfirm(); + + // We got an error or we still not submit form + if ((!Tools::isSubmit('submitAccount') AND !Tools::isSubmit('submitLogin')) OR sizeof($errors)) + { + if (isset($cookie->paypal_token) AND isset($cookie->paypal_token_date) AND (time() - 10800 > $cookie->paypal_token_date)) + { + // Token expired, unset it + unset($cookie->paypal_token); + Tools::redirect('modules/paypal/express/submit.php'); + } + // We didn't submit form, getting PayPal informations + if (!Tools::isSubmit('submitAccount') AND !Tools::isSubmit('submitLogin')) + $result = getInfos(); + + if (Tools::getValue('email') AND Tools::getValue('payerID')) + { + // Form was submitted (errors) + $email = Tools::htmlentitiesUTF8(strval(Tools::getValue('email'))); + $payerID = Tools::htmlentitiesUTF8(strval(Tools::getValue('payerID'))); + } + elseif (isset($result['EMAIL']) AND isset($result['PAYERID'])) + { + // Displaying form for the first time + $email = $result['EMAIL']; + $payerID = $result['PAYERID']; + } + else + { + // Error in token, we need to make authorization again + unset($cookie->paypal_token); + Tools::redirect('modules/paypal/express/submit.php'); + } + if (Customer::customerExists($email) OR Tools::isSubmit('submitLogin')) + displayLogin(); + displayAccount(); + } +} diff --git a/modules/paypal/fr.php b/modules/paypal/fr.php new file mode 100644 index 000000000..15e6a2e19 --- /dev/null +++ b/modules/paypal/fr.php @@ -0,0 +1,225 @@ +about_e816e21c1c8e0eba0620fa3df6bd6795'] = 'Qu\'est-ce que PayPal ?'; +$_MODULE['<{paypal}prestashop>about_16ea57badae98f402bb8f2b2f49d4e77'] = 'PayPal, leader incontesté en matière de paiement en ligne, permet aux acheteurs et aux vendeurs d\'envoyer et de recevoir des paiements en ligne. PayPal compte plus de 100 millions de comptes dans 190 pays et régions du monde. Il est accepté par les marchands partout, à la fois sur eBay et en dehors d\'eBay.'; +$_MODULE['<{paypal}prestashop>about_d20adade7baa1b60b713521031ea676c'] = 'Est-ce un service sécurisé ?'; +$_MODULE['<{paypal}prestashop>about_64f7b897c6d56fc62428f692ee5737cd'] = 'PayPal contribue à protéger les informations concernant votre carte bancaire grâce aux meilleurs systèmes présents sur le marché pour la sécurité et la prévention contre la fraude. Lorsque vous utilisez PayPal, vos informations financières ne sont jamais communiquées au marchand.'; +$_MODULE['<{paypal}prestashop>about_5ef30813484389e4200640c2f006004d'] = 'Pourquoi utiliser PayPal ?'; +$_MODULE['<{paypal}prestashop>about_86550d4ea832930db4366f03b90bdfb8'] = 'Effectuez des achats ou envoyez des paiements avec PayPal : c\'est gratuit.'; +$_MODULE['<{paypal}prestashop>about_7dc9e529337e5a55a12bf362b8e68cac'] = 'Achetez et payez en toute tranquillité en enregistrant vos informations auprès de PayPal.'; +$_MODULE['<{paypal}prestashop>about_32098ae6a7ecd96805df9e48fb6cc739'] = 'PayPal est accepté par des millions de marchands dans le monde et constitue le mode de paiement le plus utilisé sur eBay.'; +$_MODULE['<{paypal}prestashop>about_7934d7d1280bfbb8778743e39292af30'] = 'Utilisez PayPal dès aujourd\'hui !'; +$_MODULE['<{paypal}prestashop>column_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Payer par PayPal'; +$_MODULE['<{paypal}prestashop>confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Votre panier'; +$_MODULE['<{paypal}prestashop>confirm_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Résumé de la commande'; +$_MODULE['<{paypal}prestashop>confirm_dd23adc5fb6bda9c384397b31e57fc53'] = 'Paiement PayPal'; +$_MODULE['<{paypal}prestashop>confirm_62d74398cb6ebaa69ab7339052ca5c92'] = 'Vous avez choisi de payer avec PayPal.'; +$_MODULE['<{paypal}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un court résumé de votre commande :'; +$_MODULE['<{paypal}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; +$_MODULE['<{paypal}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(TTC)'; +$_MODULE['<{paypal}prestashop>confirm_8ed356c32b198c9cb2abab7c3d262b93'] = 'Nous acceptons la devise suivante pour votre paiement :'; +$_MODULE['<{paypal}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; +$_MODULE['<{paypal}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; +$_MODULE['<{paypal}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; +$_MODULE['<{paypal}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{paypal}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'est bien enregistrée.'; +$_MODULE['<{paypal}prestashop>confirmation_15b0f8e55c6bdfc3d5fd0b6b3b6cb3ee'] = 'Vous avez choisi de payer avec PayPal.'; +$_MODULE['<{paypal}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Votre commande vous sera envoyée très prochainement.'; +$_MODULE['<{paypal}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire merci de contacter notre'; +$_MODULE['<{paypal}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client'; +$_MODULE['<{paypal}prestashop>error_a40cab5994f36d4c48103a22ca082e8f'] = 'Votre panier'; +$_MODULE['<{paypal}prestashop>error_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>error_425551a2289ed60c9260933d1c45ef00'] = 'Merci de vous reférer aux logs :'; +$_MODULE['<{paypal}prestashop>error_0557fa923dcee4d0f86b1409f5c2167f'] = 'Précédent'; +$_MODULE['<{paypal}prestashop>paypal_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>paypal_6e7012516038a096b9f6bb71ba2cc5a3'] = 'Accepter les paiements par cartes de paiement (CB, Visa, MasterCard, American Express, Aurore, Cofinoga, 4 étoiles) avec Paypal'; +$_MODULE['<{paypal}prestashop>paypal_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Etes vous sûr de vouloir supprimer vos informations ?'; +$_MODULE['<{paypal}prestashop>paypal_1828820cc60e36b6f9fdf60cab103ed7'] = 'Vous utilisez actuellement l\'adresse e-mail PayPal par défaut, vous devez la remplacer par votre propre adresse'; +$_MODULE['<{paypal}prestashop>paypal_47b49d72ae0a4b3aa928fc4cc3e7fc53'] = 'Pour SUPPRIMER cette avertissement, merci de désinstaller et supprimer le module PayPalAPI'; +$_MODULE['<{paypal}prestashop>paypal_7d0887294ed32e2013b64c4210e26841'] = 'Merci de ne pas utiliser et supprimer le module PayPalAPI.'; +$_MODULE['<{paypal}prestashop>paypal_a706f7e37a81dc235d41bbeb6fae92aa'] = 'Aucun moyen de paiement valide'; +$_MODULE['<{paypal}prestashop>paypal_32af90c3cfef1bacf43b0c3a8f60a4da'] = 'Les fonds ont été récupérés'; +$_MODULE['<{paypal}prestashop>paypal_d238649ac5ec14afc894fad36c0b50fc'] = 'La requête pour la récupération des fonds a été effectuée sans succès, merci de vous referez au message de log !'; +$_MODULE['<{paypal}prestashop>paypal_05b998de2c4fb46a7bdd37bd378b81d9'] = 'La validation a été effectuée, merci de regarder le message de log !'; +$_MODULE['<{paypal}prestashop>paypal_aeca7e93a1b3d77e38c3cffa131774d5'] = 'Le remboursement a été effectuée'; +$_MODULE['<{paypal}prestashop>paypal_cba030a50c8a99c7e224adbe1cf58544'] = 'La requête pour le remboursement a été effectuée sans succès, merci de vous referez au message de log !'; +$_MODULE['<{paypal}prestashop>paypal_b630aa9b5e25da971949cae62dd109aa'] = 'Validation PayPal'; +$_MODULE['<{paypal}prestashop>paypal_e8fdd4382b75b42bfbd96eb7b032cf47'] = 'Informations :'; +$_MODULE['<{paypal}prestashop>paypal_9119a92adbbf6c67bfb8a3aee0bdb720'] = 'Collecte en attente de validation - Ne pas expédier'; +$_MODULE['<{paypal}prestashop>paypal_c14eb95a724174f336b8ffdd98ef2f35'] = 'Paiement en attente de validation - ne pas expédier '; +$_MODULE['<{paypal}prestashop>paypal_5b18ff32c2aaaf4b79bdead10b10fe29'] = 'Récupérer le statut du paiement'; +$_MODULE['<{paypal}prestashop>paypal_81e826adb70e2e6b189c2eef739d52d4'] = 'Capture PayPal'; +$_MODULE['<{paypal}prestashop>paypal_6f1f179632d90b3f71f5c83a1137e302'] = 'Paiement pret à être collecté avant expedition'; +$_MODULE['<{paypal}prestashop>paypal_3a81739e892c77e29ff4718c9dd92a34'] = 'Récupérer les fonds'; +$_MODULE['<{paypal}prestashop>paypal_8ba079f305b81b172792bc0469b6a690'] = 'Remboursement PayPal'; +$_MODULE['<{paypal}prestashop>paypal_016e1f278eccd700eaf33f74a501d050'] = 'Paiement accepté'; +$_MODULE['<{paypal}prestashop>paypal_a8b1cc445942a2e1a7d7cca641c86d67'] = 'Quand vous remboursez un produit, un remboursement partiel est effectué sauf si vous cochez l\'option \"Générer un bon de réduction\"'; +$_MODULE['<{paypal}prestashop>paypal_c2a5e2e23d8ec9cad779d657b7d33fc1'] = 'Rembourser totalement la transaction'; +$_MODULE['<{paypal}prestashop>paypal_729a51874fe901b092899e9e8b31c97a'] = 'Etes vous sûr ?'; +$_MODULE['<{paypal}prestashop>paypal_20fda49ece75d93bea97648ab1f1f1cf'] = 'Résultat du remboursement de produit:'; +$_MODULE['<{paypal}prestashop>paypal_e5970a9962bc4cacb5adb408418a9f0c'] = 'Echec de l\'autorisation auprès de PayPal'; +$_MODULE['<{paypal}prestashop>paypal_be6575076ac9b651d870a59970e7cd54'] = 'PayPal a retourné une erreur'; +$_MODULE['<{paypal}prestashop>paypal_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Le token fournit par PayPal n\'est pas le même que celui du cookie'; +$_MODULE['<{paypal}prestashop>paypal_33ac76215cb67f61f891cc3113e55997'] = 'Autorisation accepté par PayPal pour le paiement différé'; +$_MODULE['<{paypal}prestashop>paypal_8778ee03f6592d5fec9a1f2ee851e476'] = 'Commande achevée avec PayPal !'; +$_MODULE['<{paypal}prestashop>paypal_d89a00d4ba79c176bb0fc17f12d42a18'] = 'La clef PayPal \'mc_gross\' n\'a pas été spécifiée, impossible de contrôler le montant payé.'; +$_MODULE['<{paypal}prestashop>paypal_202a2860b19003ce53966a8780bb448b'] = 'La clef PayPal \'payment_status\' n\'a pas été spécifiée, impossible de vérifier la validité du paiement'; +$_MODULE['<{paypal}prestashop>paypal_bd0e34e5be6447844e6f262d51f1a9dc'] = 'Paiement :'; +$_MODULE['<{paypal}prestashop>paypal_23703f7d045936080031477df1fc237b'] = 'Le token fournit par PayPal n\'est pas le même que celui du cookie'; +$_MODULE['<{paypal}prestashop>paypal_760c3c2ccfadeee26c80c7b39462cf1d'] = 'La clef PayPal \'txn_id\' n\'a pas été spécifiée, transaction inconnue'; +$_MODULE['<{paypal}prestashop>paypal_7faa8448e059fb97d60d4a4b15634d98'] = 'La clef PayPal \'mc_currency\' n\'a pas été spécifiée, devise inconnue'; +$_MODULE['<{paypal}prestashop>paypal_e61f52d02b9f52fbe1fd41ed320e29c3'] = 'Panier introuvable'; +$_MODULE['<{paypal}prestashop>paypal_0617900b1aff826081d07f5a3e2e7cd0'] = 'La commande a déjà été traitée'; +$_MODULE['<{paypal}prestashop>paypal_f5209b3301a46f3057ffbf34d903e205'] = 'ID de la transaction PayPal :'; +$_MODULE['<{paypal}prestashop>paypal_7b19e875ff64b09d80ee05dcc84b9975'] = 'La transaction PayPal ne peut pas être VERIFIEE.'; +$_MODULE['<{paypal}prestashop>paypal_20dfea1a472e5be3f15f6b5f36ca335c'] = 'Problèmes lors de la tentative de connexion au serveur PayPal.'; +$_MODULE['<{paypal}prestashop>paypal_76ee8dc73701e846f7bccdf98dae079b'] = 'Aucun protocole de communication disponible.'; +$_MODULE['<{paypal}prestashop>paypal_8358ec19f397d4cdd632688d4f79e535'] = 'Echec de la vérification (protocole fsockopen). Retour :'; +$_MODULE['<{paypal}prestashop>paypal_eca77e208634d52703b07672abbf16ec'] = 'Echec de la vérification (protocole cURL). Retour :'; +$_MODULE['<{paypal}prestashop>paypal_f7799c2ded739cf3c3e9babffc5f315b'] = 'La connection via le protocole cURL a échoué.'; +$_MODULE['<{paypal}prestashop>paypal_c640d8a3c2c34f79061a0bbe50e8420c'] = 'Merci de patienter, vous allez être redirigé vers PayPal. Merci.'; +$_MODULE['<{paypal}prestashop>paypal_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{paypal}prestashop>paypal_dae3b417a0fc4a49e851ce55d6d49551'] = 'Mon Panier'; +$_MODULE['<{paypal}prestashop>paypal_9bfa2332c9c7198ac9774c6710bf76c4'] = 'Retour à la boutique'; +$_MODULE['<{paypal}prestashop>paypal_d56249aa9643851a94bd3ef3da309d35'] = 'Paypal erreur: (adresse e-mail business invalide or indéfinie)'; +$_MODULE['<{paypal}prestashop>paypal_e7ac6f09a936201890de4094b1ee4e50'] = 'Paypal erreur: (client ou adresse invalide)'; +$_MODULE['<{paypal}prestashop>paypal_49b21ad0d38942f635877e7bbc5d7a1e'] = 'Solution'; +$_MODULE['<{paypal}prestashop>paypal_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{paypal}prestashop>paypal_9c81c7e49db6edc5ea243dbadfb28c2a'] = 'Personnalisation et logos'; +$_MODULE['<{paypal}prestashop>paypal_9d51eb502e6f46830cb97f53d761c212'] = 'Choisissez votre solution :'; +$_MODULE['<{paypal}prestashop>paypal_0234fed198d74928f2864c574a9a89c1'] = 'Paiements par cartes'; +$_MODULE['<{paypal}prestashop>paypal_627fabff813cafcd9313ea0037c0125b'] = 'cartes (CB , Visa, Mastercard, American Express, Aurore, Cofinoga, 4 Etoiles) et comptes PayPal (PayPal Intégral)'; +$_MODULE['<{paypal}prestashop>paypal_ec2d6b2d2cfb9eadee1c15f3d579252d'] = 'Paiements par cartes et compte PayPal avec une garantie des paiements en plus'; +$_MODULE['<{paypal}prestashop>paypal_7d8bea00c8ed9c1cdf9da980bd69c85a'] = '(PayPal Intégral Evolution, avec abonnement mensuel)'; +$_MODULE['<{paypal}prestashop>paypal_457e5c04d6690cc6a72412c792c504d9'] = 'Paiements par'; +$_MODULE['<{paypal}prestashop>paypal_5d4023dba17f36ce69357d25cbe4fbad'] = 'comptes PayPal uniquement'; +$_MODULE['<{paypal}prestashop>paypal_e574ea35c565033a741efb1925b5f188'] = '(PayPal Option + )'; +$_MODULE['<{paypal}prestashop>paypal_fdcd0dc7120ef9d14417c968e0a16e97'] = 'Activation soumise à conditions'; +$_MODULE['<{paypal}prestashop>paypal_89e92ec866e363e88f12a7372d682c5c'] = 'cliquez ici pour connaître la procédure'; +$_MODULE['<{paypal}prestashop>paypal_cd1bd0b0d3d22ede663f17df5194b3fe'] = 'Option :'; +$_MODULE['<{paypal}prestashop>paypal_28882d910d7b5311aa0a9d5094e11caf'] = 'Paiement par compte PayPal en 2 clics'; +$_MODULE['<{paypal}prestashop>paypal_22afd6155cd35727f6ed449aef994731'] = 'depuis le panier d’achat (PayPal Express)'; +$_MODULE['<{paypal}prestashop>paypal_4037fe43ff7b926e093805e2931c0f77'] = 'Mode debug seulement :'; +$_MODULE['<{paypal}prestashop>paypal_7c8ab5ce5bf608dd41cf3e8f2312451c'] = 'Active les messages de log complet'; +$_MODULE['<{paypal}prestashop>paypal_d4dccb8ca2dac4e53c01bd9954755332'] = 'Valider'; +$_MODULE['<{paypal}prestashop>paypal_7a262cb0d3d917313c8ba12f996fe83c'] = 'Important :'; +$_MODULE['<{paypal}prestashop>paypal_de79de54313d8b57cd45c840d196b7d0'] = 'L’utilisation des solutions PayPal nécessite une activation des appels API dans le menu Paramètres'; +$_MODULE['<{paypal}prestashop>paypal_79f53a401ee04dbc765d0ba9a951a106'] = 'Mode Test '; +$_MODULE['<{paypal}prestashop>paypal_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activé'; +$_MODULE['<{paypal}prestashop>paypal_3cab03c00dbd11bc3569afa0748013f0'] = 'Désactivé'; +$_MODULE['<{paypal}prestashop>paypal_4dbcb38bbbff5d4a402f2575c57a35e6'] = 'Type de paiement '; +$_MODULE['<{paypal}prestashop>paypal_5bc5650bfb4c1eb3887ea80e7802301f'] = 'Direct (sales)'; +$_MODULE['<{paypal}prestashop>paypal_6dd446781e32f1a989396e93db70437d'] = 'Autorisation / Capture manuelle'; +$_MODULE['<{paypal}prestashop>paypal_7186106a954f390f62860c11c8ba10d5'] = '(Paiement à l\'expédition)'; +$_MODULE['<{paypal}prestashop>paypal_3cf5408a4a41b56c6fd7878a070b76ff'] = 'Adresse email de votre compte PayPal marchand'; +$_MODULE['<{paypal}prestashop>paypal_467008be031b7e1a913395f53556fea8'] = 'Activation des appels API'; +$_MODULE['<{paypal}prestashop>paypal_11931512987fbd1b884da55f13273a07'] = 'Utilisateur API'; +$_MODULE['<{paypal}prestashop>paypal_5e07b6956454390018af63962ef4a3f6'] = 'Mot de passe API'; +$_MODULE['<{paypal}prestashop>paypal_1c1357865e46a07448c95ebca39d4541'] = 'Laisser vide si le mot de passe n\'a pas changé'; +$_MODULE['<{paypal}prestashop>paypal_e1ededd62537e048b815f70cc971bec8'] = 'Signature API'; +$_MODULE['<{paypal}prestashop>paypal_52c59dac7b7ebfa8a0d78c98f2bc0225'] = 'Cliquez ici pour savoir comment générer votre utilisateur, mot de passe et signature API'; +$_MODULE['<{paypal}prestashop>paypal_e28b278d67eeecfad67e76ec78fc13e8'] = 'Personnalisation et logos'; +$_MODULE['<{paypal}prestashop>paypal_ee0174ba1fc039128d0a38074a7af945'] = 'URL de votre bannière (affichée sur la page de paiement PayPal)'; +$_MODULE['<{paypal}prestashop>paypal_4c1c997e72e71eb6f690a9cd3dacb1f4'] = '(750 x 90 px, hébergement sécurisé « https »)'; +$_MODULE['<{paypal}prestashop>paypal_091878185fc791198ac80982860b21ed'] = 'Template choisi pour PayPal Intégral Evolution'; +$_MODULE['<{paypal}prestashop>paypal_cd8d30bc59ccf92028335d7e69e29905'] = 'Cliquez ici pour savoir comment personnaliser votre template (Tutorial)'; +$_MODULE['<{paypal}prestashop>paypal_9518e6d551f7dc752b24af3629e849f9'] = 'Ouvrir son compte PayPal'; +$_MODULE['<{paypal}prestashop>paypal_4c9ef5964631b6d4b38f5f2f77d1be74'] = 'En ouvrant votre compte PayPal en cliquant sur l\'image ci-dessous vous nous aidez activement à améliorer le logiciel PrestaShop :'; +$_MODULE['<{paypal}prestashop>paypal_1569f6a31ff61f45c5ba13d7cab7e042'] = 'Ce module vous permet d\'accepter les paiements par PayPal.'; +$_MODULE['<{paypal}prestashop>paypal_3c4cb777e8df15388c680354569636b6'] = 'Si le client choisit ce mode de paiement, votre compte PayPal sera automatiquement crédité.'; +$_MODULE['<{paypal}prestashop>paypal_f9b49f93306d28e3dec595c3b89c926d'] = 'Vous devez configurer votre compte PayPal avant d\'utiliser ce module.'; +$_MODULE['<{paypal}prestashop>paypal_57487012438fe78ae1d462e53a91bfc0'] = 'solution invalide'; +$_MODULE['<{paypal}prestashop>paypal_f629bddb66252b97da3e7e5346697955'] = 'vous devez renseigner au moins un compte'; +$_MODULE['<{paypal}prestashop>paypal_909d37302176080797966972da84b4e7'] = 'adresse e-mail invalide'; +$_MODULE['<{paypal}prestashop>paypal_2fa631ec6f6afeac6335f3261181063f'] = 'l\'URL du logo est invalide'; +$_MODULE['<{paypal}prestashop>paypal_19ea461c401bd941bf47a8bc01eecd6c'] = 'l\'URL du logo doit utiliser le protocole HTTPS'; +$_MODULE['<{paypal}prestashop>paypal_b8822117a8cc930315a50bab7f6a4c80'] = 'le template PayPal est invalide'; +$_MODULE['<{paypal}prestashop>paypal_b02186eee414487a068584dc0d177ad2'] = 'vous ne pouvez pas utiliser l\'autorisation / capture si vous n\'avez pas les droits API'; +$_MODULE['<{paypal}prestashop>paypal_17fcef6818690d11d7caaab023ecdcff'] = 'vous ne pouvez pas utiliser cette solution si vous n\'avez pas les droits API'; +$_MODULE['<{paypal}prestashop>paypal_30e4e115bfc5e140782fd9cb01be6898'] = 'vous ne pouvez pas utiliser PayPal Express si vous n\'avez pas les droits API'; +$_MODULE['<{paypal}prestashop>paypal_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{paypal}prestashop>paypal_67c0e5ec07dd31dc74aaf55d6a72da31'] = 'Erreur lors de la récupération du statut de paiement'; +$_MODULE['<{paypal}prestashop>paypal_ec53a8c4f07baed5d8825072c89799be'] = 'Statut'; +$_MODULE['<{paypal}prestashop>paypal_ccb168b5a6a86eb100dc2dee754a316b'] = 'Raison:'; +$_MODULE['<{paypal}prestashop>paypal_4f3acf5bcd7152fd301550bec6d0ffac'] = 'Erreur PayPal:'; +$_MODULE['<{paypal}prestashop>paypal_a0d09826326fd385f6ceb17442f290de'] = 'Erreur lors de la requête de capture des fonds'; +$_MODULE['<{paypal}prestashop>paypal_e03187f3f9d6eda06a2a7c201f58cdca'] = 'Erreur lors de la requête de remboursement'; +$_MODULE['<{paypal}prestashop>paypal_e5d5d9f40763cfe6549bef705e3529a7'] = 'Message de paiement n\'est pas valide, merci de vérifier votre module !'; +$_MODULE['<{paypal}prestashop>paypal_eec39bf42bd135971fb2d838c67d1449'] = 'Résultat de l\'opération de remboursement:'; +$_MODULE['<{paypal}prestashop>paypal_2ab62d1a578713d0862b56819295630e'] = 'Remboursement fini avec PayPal !'; +$_MODULE['<{paypal}prestashop>paypal_a64db959966ba8d07c8b5d9493fcc21f'] = 'Erreur lors de la transaction !'; +$_MODULE['<{paypal}prestashop>paypal_67962779da962e3d4225055afc05e7bd'] = 'Résultat opération de récupération des fonds:'; +$_MODULE['<{paypal}prestashop>paypal_5a05744b8ccb5909bc83355092e0f3fa'] = 'Statut de la vérification :'; +$_MODULE['<{paypal}prestashop>paypalconnect_d1f14cc4a2dade80c92421d26422fea0'] = 'Ouvre une nouvelle connection vers'; +$_MODULE['<{paypal}prestashop>paypalconnect_94a27811a721ef512ad7bfa06cab34e0'] = 'Echec de la connection avec la méthode cURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_70215486455daee13382c68b1a230b82'] = 'Connection réussie avec la méthode cURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_e4c4ad49bced42265b5facc2175cdafd'] = 'Envoie des paramètres :'; +$_MODULE['<{paypal}prestashop>paypalconnect_445583f6641da98fc7ac8fd9d13a564b'] = 'Echec de l\'envoie avec la méthode cURL ! Erreur :'; +$_MODULE['<{paypal}prestashop>paypalconnect_ef4fbf36eaa2083442d386990ba063c2'] = 'Envoie réussi avec la méthode cURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_bf059c9751bb1a20b449b7917b1df374'] = 'Echec de la connection avec la méthode fsockopen'; +$_MODULE['<{paypal}prestashop>paypalconnect_ea800e3536f81238a4cbc32eb6db4eaf'] = 'Connection réussie avec la méthode fsockopen'; +$_MODULE['<{paypal}prestashop>paypalconnect_6e9aa4cb541e09b07602d4ea96080811'] = 'Echec de l\'envoie avec la méthode fsockopen ! Erreur :'; +$_MODULE['<{paypal}prestashop>paypalconnect_842a183be225d415b2b4375ba1dd1c94'] = 'Envoie réussi avec la méthode fsockopen'; +$_MODULE['<{paypal}prestashop>paypallib_7c2d00d8c94d1ce0f515db8b0481db40'] = 'Réponse PayPal :'; +$_MODULE['<{paypal}prestashop>authentication_cd42c6dd6cc4cd65cb5e13b729050469'] = 'Vérifiez vos informations'; +$_MODULE['<{paypal}prestashop>authentication_6335a00a08fde0fbb8f6d6630cdadd92'] = 'Vos informations personnelles'; +$_MODULE['<{paypal}prestashop>authentication_b78a3223503896721cca1303f776159b'] = 'Civilité'; +$_MODULE['<{paypal}prestashop>authentication_127469a6b4253ebb77adccc0dd48461e'] = 'M.'; +$_MODULE['<{paypal}prestashop>authentication_29e32764941c30d1bb41c601014fbdbd'] = 'Mme'; +$_MODULE['<{paypal}prestashop>authentication_20db0bfeecd8fe60533206a2b5e9891a'] = 'Prénom'; +$_MODULE['<{paypal}prestashop>authentication_8d3f5eff9c40ee315d452392bed5309b'] = 'Nom'; +$_MODULE['<{paypal}prestashop>authentication_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{paypal}prestashop>authentication_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{paypal}prestashop>authentication_bf2957630c4209f61a388a08c2154915'] = '(5 caractères min.)'; +$_MODULE['<{paypal}prestashop>authentication_aac772216aecbeca0e86d06671fe985a'] = 'Date de naissance'; +$_MODULE['<{paypal}prestashop>authentication_86f5978d9b80124f509bdb71786e929e'] = 'Janvier'; +$_MODULE['<{paypal}prestashop>authentication_659e59f062c75f81259d22786d6c44aa'] = 'Février'; +$_MODULE['<{paypal}prestashop>authentication_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Mars'; +$_MODULE['<{paypal}prestashop>authentication_3fcf026bbfffb63fb24b8de9d0446949'] = 'Avril'; +$_MODULE['<{paypal}prestashop>authentication_195fbb57ffe7449796d23466085ce6d8'] = 'Mai'; +$_MODULE['<{paypal}prestashop>authentication_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Juin'; +$_MODULE['<{paypal}prestashop>authentication_1b539f6f34e8503c97f6d3421346b63c'] = 'Juillet'; +$_MODULE['<{paypal}prestashop>authentication_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Août'; +$_MODULE['<{paypal}prestashop>authentication_cc5d90569e1c8313c2b1c2aab1401174'] = 'Septembre'; +$_MODULE['<{paypal}prestashop>authentication_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Octobre'; +$_MODULE['<{paypal}prestashop>authentication_7e823b37564da492ca1629b4732289a8'] = 'Novembre'; +$_MODULE['<{paypal}prestashop>authentication_82331503174acbae012b2004f6431fa5'] = 'Décembre'; +$_MODULE['<{paypal}prestashop>authentication_6f6162d3a052bb330e9c60285c74c6c9'] = 'S\'inscrire à la newsletter'; +$_MODULE['<{paypal}prestashop>authentication_ac135c86084a47630c9eadb4edd5ef75'] = 'Recevez les offres spéciales de nos partenaires'; +$_MODULE['<{paypal}prestashop>authentication_455175f3f5be6306247babb349c0515a'] = 'Votre adresse'; +$_MODULE['<{paypal}prestashop>authentication_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Société'; +$_MODULE['<{paypal}prestashop>authentication_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{paypal}prestashop>authentication_783cb853aae6984e51583b3bb80c09d2'] = 'Adresse (2)'; +$_MODULE['<{paypal}prestashop>authentication_9b514b51d03075005814a33edc74c958'] = 'Code postal'; +$_MODULE['<{paypal}prestashop>authentication_57d056ed0984166336b7879c2af3657f'] = 'Ville'; +$_MODULE['<{paypal}prestashop>authentication_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays'; +$_MODULE['<{paypal}prestashop>authentication_46a2a41cc6e552044816a2d04634545d'] = 'Etat'; +$_MODULE['<{paypal}prestashop>authentication_0f68b904e33d9ac04605aecc958bcf52'] = 'Informations complémentaires'; +$_MODULE['<{paypal}prestashop>authentication_fe66abce284ec8589e7d791185b5c442'] = 'Téléphone domicile'; +$_MODULE['<{paypal}prestashop>authentication_41c2fff4867cc204120f001e7af20f7a'] = 'Téléphone portable'; +$_MODULE['<{paypal}prestashop>authentication_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Donnez un titre à cette adresse pour la retrouver plus facilement'; +$_MODULE['<{paypal}prestashop>authentication_ae7bdef7fe2bbbbf02c11e92c5fceb40'] = 'Mon adresse'; +$_MODULE['<{paypal}prestashop>authentication_a0bfb8e59e6c13fc8d990781f77694fe'] = 'Continuer'; +$_MODULE['<{paypal}prestashop>authentication_19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; +$_MODULE['<{paypal}prestashop>login_b40ad46c25c153a3d2fde078c0e1b0f8'] = 'Merci de vous identifier'; +$_MODULE['<{paypal}prestashop>login_abc57016a138dea055e0d8be6358f84e'] = 'Email déjà enregistrée, merci de vous identifier !'; +$_MODULE['<{paypal}prestashop>login_8b5dd64ab8d0b8158906796b53a200e2'] = 'Adresse e-mail'; +$_MODULE['<{paypal}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{paypal}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'S\'identifier'; +$_MODULE['<{paypal}prestashop>login_01a569ddc6cf67ddec2a683f0a5f5956'] = 'Mot de passe oublié ?'; +$_MODULE['<{paypal}prestashop>paypalexpress_b601224a2a6c61f38738ca903fb019a2'] = 'Panier incorrect'; +$_MODULE['<{paypal}prestashop>paypalexpress_ee9dc1e678d54c517f481583c3fb2db8'] = 'Devise incorrecte'; +$_MODULE['<{paypal}prestashop>shopping_cart_aa91004934e1abdb620b5d0f0c18681c'] = 'Payer avec PayPal Express Checkout'; +$_MODULE['<{paypal}prestashop>submit_528d1f824243db48e40cb6223d32fa06'] = 'Aucun token donné par PayPal'; +$_MODULE['<{paypal}prestashop>submit_795277047da13b4fc74e02e050b1a675'] = 'PayPal a retourné une erreur'; +$_MODULE['<{paypal}prestashop>submit_b4133f1ba03a914134a5281a08231078'] = 'L\'autorisation à PayPal a échoué'; +$_MODULE['<{paypal}prestashop>submit_4935b58d37fda5bd60acc510cb324342'] = 'Impossible de trouver les informations du compte PayPal'; +$_MODULE['<{paypal}prestashop>submit_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Le token fournit par PayPal n\'est pas le même que celui du cookie'; +$_MODULE['<{paypal}prestashop>paypal_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Payer par PayPal'; +$_MODULE['<{paypal}prestashop>payment_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Payer par PayPal'; +$_MODULE['<{paypal}prestashop>payment_a3f2caee6ef8e68fbd26e42d83f2bf65'] = 'Payez avec votre compte PayPal, carte de crédit (CB, Visa, Mastercard ...)'; +$_MODULE['<{paypal}prestashop>payment_b08008a2de4331ba13f006c9bcf37b62'] = 'Payez avec votre compte PayPal'; +$_MODULE['<{paypal}prestashop>paypalpayment_ee9dc1e678d54c517f481583c3fb2db8'] = 'La devise est incorrecte'; diff --git a/modules/paypal/img/AU_pp_express.gif b/modules/paypal/img/AU_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/AU_pp_express.gif differ diff --git a/modules/paypal/img/AU_pp_integral.gif b/modules/paypal/img/AU_pp_integral.gif new file mode 100644 index 000000000..064afc62c Binary files /dev/null and b/modules/paypal/img/AU_pp_integral.gif differ diff --git a/modules/paypal/img/CA_pp_express.gif b/modules/paypal/img/CA_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/CA_pp_express.gif differ diff --git a/modules/paypal/img/CA_pp_integral.gif b/modules/paypal/img/CA_pp_integral.gif new file mode 100644 index 000000000..b3fbc2cfd Binary files /dev/null and b/modules/paypal/img/CA_pp_integral.gif differ diff --git a/modules/paypal/img/CN_pp_express.gif b/modules/paypal/img/CN_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/CN_pp_express.gif differ diff --git a/modules/paypal/img/CN_pp_integral.gif b/modules/paypal/img/CN_pp_integral.gif new file mode 100644 index 000000000..1c244ca2b Binary files /dev/null and b/modules/paypal/img/CN_pp_integral.gif differ diff --git a/modules/paypal/img/DE_pp_express.gif b/modules/paypal/img/DE_pp_express.gif new file mode 100644 index 000000000..76718d373 Binary files /dev/null and b/modules/paypal/img/DE_pp_express.gif differ diff --git a/modules/paypal/img/DE_pp_integral.gif b/modules/paypal/img/DE_pp_integral.gif new file mode 100644 index 000000000..63e587edd Binary files /dev/null and b/modules/paypal/img/DE_pp_integral.gif differ diff --git a/modules/paypal/img/ES_pp_express.gif b/modules/paypal/img/ES_pp_express.gif new file mode 100644 index 000000000..2af5bcdc9 Binary files /dev/null and b/modules/paypal/img/ES_pp_express.gif differ diff --git a/modules/paypal/img/ES_pp_integral.gif b/modules/paypal/img/ES_pp_integral.gif new file mode 100644 index 000000000..fea48cdb7 Binary files /dev/null and b/modules/paypal/img/ES_pp_integral.gif differ diff --git a/modules/paypal/img/FR_pp_express.gif b/modules/paypal/img/FR_pp_express.gif new file mode 100644 index 000000000..e2955898e Binary files /dev/null and b/modules/paypal/img/FR_pp_express.gif differ diff --git a/modules/paypal/img/FR_pp_integral.gif b/modules/paypal/img/FR_pp_integral.gif new file mode 100644 index 000000000..2559e8022 Binary files /dev/null and b/modules/paypal/img/FR_pp_integral.gif differ diff --git a/modules/paypal/img/IT_pp_express.gif b/modules/paypal/img/IT_pp_express.gif new file mode 100644 index 000000000..4dbcccfa6 Binary files /dev/null and b/modules/paypal/img/IT_pp_express.gif differ diff --git a/modules/paypal/img/IT_pp_integral.gif b/modules/paypal/img/IT_pp_integral.gif new file mode 100644 index 000000000..3cd6475f5 Binary files /dev/null and b/modules/paypal/img/IT_pp_integral.gif differ diff --git a/modules/paypal/img/JP_pp_express.gif b/modules/paypal/img/JP_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/JP_pp_express.gif differ diff --git a/modules/paypal/img/JP_pp_integral.gif b/modules/paypal/img/JP_pp_integral.gif new file mode 100644 index 000000000..9ae0a063a Binary files /dev/null and b/modules/paypal/img/JP_pp_integral.gif differ diff --git a/modules/paypal/img/NL_pp_express.gif b/modules/paypal/img/NL_pp_express.gif new file mode 100644 index 000000000..c94c8be03 Binary files /dev/null and b/modules/paypal/img/NL_pp_express.gif differ diff --git a/modules/paypal/img/NL_pp_integral.gif b/modules/paypal/img/NL_pp_integral.gif new file mode 100644 index 000000000..54d37f1fb Binary files /dev/null and b/modules/paypal/img/NL_pp_integral.gif differ diff --git a/modules/paypal/img/PL_pp_express.gif b/modules/paypal/img/PL_pp_express.gif new file mode 100644 index 000000000..3385d7694 Binary files /dev/null and b/modules/paypal/img/PL_pp_express.gif differ diff --git a/modules/paypal/img/PL_pp_integral.gif b/modules/paypal/img/PL_pp_integral.gif new file mode 100644 index 000000000..0c8ea1d03 Binary files /dev/null and b/modules/paypal/img/PL_pp_integral.gif differ diff --git a/modules/paypal/img/PayPal_mark_60x38.gif b/modules/paypal/img/PayPal_mark_60x38.gif new file mode 100644 index 000000000..2a5871650 Binary files /dev/null and b/modules/paypal/img/PayPal_mark_60x38.gif differ diff --git a/modules/paypal/img/UK_pp_express.gif b/modules/paypal/img/UK_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/UK_pp_express.gif differ diff --git a/modules/paypal/img/UK_pp_integral.gif b/modules/paypal/img/UK_pp_integral.gif new file mode 100644 index 000000000..5ad665efe Binary files /dev/null and b/modules/paypal/img/UK_pp_integral.gif differ diff --git a/modules/paypal/img/US_pp_express.gif b/modules/paypal/img/US_pp_express.gif new file mode 100644 index 000000000..3eb68d2fa Binary files /dev/null and b/modules/paypal/img/US_pp_express.gif differ diff --git a/modules/paypal/img/US_pp_integral.gif b/modules/paypal/img/US_pp_integral.gif new file mode 100644 index 000000000..8cc5cfffc Binary files /dev/null and b/modules/paypal/img/US_pp_integral.gif differ diff --git a/modules/paypal/img/integral_evolution.png b/modules/paypal/img/integral_evolution.png new file mode 100644 index 000000000..2d20ef8df Binary files /dev/null and b/modules/paypal/img/integral_evolution.png differ diff --git a/modules/paypal/img/integral_evolution_vertical.png b/modules/paypal/img/integral_evolution_vertical.png new file mode 100644 index 000000000..7a2e32373 Binary files /dev/null and b/modules/paypal/img/integral_evolution_vertical.png differ diff --git a/modules/paypal/img/vertical_FR_large.png b/modules/paypal/img/vertical_FR_large.png new file mode 100644 index 000000000..826baa201 Binary files /dev/null and b/modules/paypal/img/vertical_FR_large.png differ diff --git a/modules/paypal/img/vertical_US_large.png b/modules/paypal/img/vertical_US_large.png new file mode 100644 index 000000000..9d4baf775 Binary files /dev/null and b/modules/paypal/img/vertical_US_large.png differ diff --git a/modules/paypal/integral_evolution/paypal.tpl b/modules/paypal/integral_evolution/paypal.tpl new file mode 100644 index 000000000..1934b49cd --- /dev/null +++ b/modules/paypal/integral_evolution/paypal.tpl @@ -0,0 +1,31 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay with PayPal' mod='paypal'} + +

        diff --git a/modules/paypal/integral_evolution/redirect.php b/modules/paypal/integral_evolution/redirect.php new file mode 100644 index 000000000..0ba8783f4 --- /dev/null +++ b/modules/paypal/integral_evolution/redirect.php @@ -0,0 +1,111 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../../config/config.inc.php'); +include(dirname(__FILE__).'/../../../init.php'); +include(dirname(__FILE__).'/../paypal.php'); + +$paypal = new Paypal(); +$cart = new Cart((int)($cookie->id_cart)); + +// Billing address +$billingAddress = new Address((int)($cart->id_address_invoice)); +$billingCountry = new Country((int)($billingAddress->id_country)); +$billingState = NULL; +if ($billingAddress->id_state) + $billingState = new State((int)($billingAddress->id_state)); + +// Shipping address +if ($cart->id_address_delivery == $cart->id_address_invoice) +{ + $shippingAddress = $billingAddress; + $shippingCountry = $billingCountry; + $shippingState = $billingState; +} +else +{ + $shippingAddress = new Address((int)($cart->id_address_delivery)); + $shippingCountry = new Country((int)($shippingAddress->id_country)); + $shippingState = NULL; + if ($shippingAddress->id_state) + $shippingState = new State((int)($shippingAddress->id_state)); +} + +$customer = new Customer((int)($cart->id_customer)); +$business = Configuration::get('PAYPAL_BUSINESS'); +$header = Configuration::get('PAYPAL_HEADER'); +$currency_order = new Currency((int)($cart->id_currency)); +$currency_module = $paypal->getCurrency((int)($cart->id_currency)); + +if (empty($business) OR !Validate::isEmail($business)) + die($paypal->getL('Paypal error: (invalid or undefined business account email)')); + +if (!Validate::isLoadedObject($billingAddress) OR !Validate::isLoadedObject($shippingAddress) OR !Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($currency_module)) + die($paypal->getL('Paypal error: (invalid address or customer)')); + +// check currency of payment +if ($currency_order->id != $currency_module->id) +{ + $cookie->id_currency = $currency_module->id; + $cart->id_currency = $currency_module->id; + $cart->update(); +} + +$smarty->assign(array( + 'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'), + 'cancel_text' => $paypal->getL('Cancel'), + 'cart_text' => $paypal->getL('My cart'), + 'return_text' => $paypal->getL('Return to shop'), + 'paypal_url' => $paypal->getPaypalIntegralEvolutionUrl(), + 'billing_address' => $billingAddress, + 'billing_country' => $billingCountry, + 'billing_state' => $billingState, + 'shipping_address' => $shippingAddress, + 'shipping_country' => $shippingCountry, + 'shipping_state' => $shippingState, + 'amount' => (float)($cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)), + 'customer' => $customer, + 'total' => (float)($cart->getOrderTotal(true, Cart::BOTH)), + 'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, Cart::ONLY_WRAPPING)), 2), + 'discount' => $cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS), + 'business' => $business, + 'currency_module' => $currency_module, + 'cart_id' => (int)($cart->id).'_'.pSQL($cart->secure_key), + 'products' => $cart->getProducts(), + 'paypal_id' => (int)($paypal->id), + 'header' => $header, + 'template' => 'Template'.Configuration::get('PAYPAL_TEMPLATE'), + 'url' => Tools::getShopDomain(true, true).__PS_BASE_URI__, + 'paymentaction' => (Configuration::get('PAYPAL_CAPTURE') ? 'authorization' : 'sale') +)); + + +if (is_file(_PS_THEME_DIR_.'modules/paypal/integral_evolution/redirect.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/'.$paypal->name.'/integral_evolution/redirect.tpl'); +else + $smarty->display(_PS_MODULE_DIR_.$paypal->name.'/integral_evolution/redirect.tpl'); + diff --git a/modules/paypal/integral_evolution/redirect.tpl b/modules/paypal/integral_evolution/redirect.tpl new file mode 100644 index 000000000..f3fe28f4a --- /dev/null +++ b/modules/paypal/integral_evolution/redirect.tpl @@ -0,0 +1,93 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + +

        {$redirect_text}
        {$cancel_text}

        + + + + diff --git a/modules/paypal/ipn.php b/modules/paypal/ipn.php new file mode 100644 index 000000000..76ff41515 --- /dev/null +++ b/modules/paypal/ipn.php @@ -0,0 +1,80 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/../../init.php'); + +include_once(_PS_MODULE_DIR_.'paypal/paypal.php'); +$pp = new Paypal(); + +if (!$transaction_id = Tools::getValue('txn_id')) + die('No transaction id'); +if (!$id_order = $pp->getOrder($transaction_id)) + die('No order'); + +$order = new Order((int)($id_order)); +if (!Validate::isLoadedObject($order) OR !$order->id) + die('Invalid order'); +if (!$amount = (float)(Tools::getValue('mc_gross')) OR $amount != $order->total_paid) + die('Incorrect amount'); + +if (!$status = strval(Tools::getValue('payment_status'))) + die('Incorrect order status'); + +// Getting params +$params = 'cmd=_notify-validate'; +foreach ($_POST AS $key => $value) + $params .= '&'.$key.'='.urlencode(stripslashes($value)); + +// Checking params by asking PayPal +include(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); +$ppAPI = new PaypalLib(); +$result = $ppAPI->makeSimpleCall($pp->getAPIURL(), $pp->getAPIScript(), $params); +if (!$result OR (Tools::strlen($result) < 8) OR (!$statut = substr($result, -8)) OR $statut != 'VERIFIED') + die('Incorrect PayPal verified'); + +// Getting order status +switch ($status) +{ + case 'Completed': + $id_order_state = _PS_OS_PAYMENT_; + break; + case 'Pending': + $id_order_state = _PS_OS_PAYPAL_; + break; + default: + $id_order_state = _PS_OS_ERROR_; +} + +if ($order->getCurrentState() == $id_order_state) + die('Same status'); + +// Set order state in order history +$history = new OrderHistory(); +$history->id_order = (int)($order->id); +$history->changeIdOrderState((int)($id_order_state), (int)($order->id)); +$history->addWithemail(true, $extraVars); diff --git a/modules/paypal/it.php b/modules/paypal/it.php new file mode 100644 index 000000000..31e73a86a --- /dev/null +++ b/modules/paypal/it.php @@ -0,0 +1,225 @@ +about_e816e21c1c8e0eba0620fa3df6bd6795'] = 'Che cos\'è PayPal?'; +$_MODULE['<{paypal}prestashop>about_16ea57badae98f402bb8f2b2f49d4e77'] = 'PayPal, leader di fiducia nei pagamenti online, consente ad acquirenti e aziende di inviare e ricevere pagamenti online. PayPal vanta oltre 100 milioni di conti in 190 Paesi e territori. È accettato dai commercianti di tutto il mondo, dentro e fuori di eBay.'; +$_MODULE['<{paypal}prestashop>about_d20adade7baa1b60b713521031ea676c'] = 'E\' sicuro?'; +$_MODULE['<{paypal}prestashop>about_64f7b897c6d56fc62428f692ee5737cd'] = 'PayPal consente di proteggere i dati della carta di credito con la sicurezza dei leader di settore e dei sistemi di prevenzione delle frodi. Quando utilizzi PayPal, le tue informazioni finanziarie non vengono mai condivise con il commerciante.'; +$_MODULE['<{paypal}prestashop>about_5ef30813484389e4200640c2f006004d'] = 'Perché utilizzare PayPal?'; +$_MODULE['<{paypal}prestashop>about_86550d4ea832930db4366f03b90bdfb8'] = 'Fai acquisti o invia denaro con PayPal - è gratis'; +$_MODULE['<{paypal}prestashop>about_7dc9e529337e5a55a12bf362b8e68cac'] = 'Fai acquisti e paga comodamente salvando le tue informazioni con PayPal'; +$_MODULE['<{paypal}prestashop>about_32098ae6a7ecd96805df9e48fb6cc739'] = 'PayPal è accettato da milioni di aziende in tutto il mondo ed è il metodo di pagamento preferito su eBay'; +$_MODULE['<{paypal}prestashop>about_7934d7d1280bfbb8778743e39292af30'] = 'Inizia a utilizzare PayPal oggi stesso!'; +$_MODULE['<{paypal}prestashop>column_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Paga con PayPal'; +$_MODULE['<{paypal}prestashop>confirm_a40cab5994f36d4c48103a22ca082e8f'] = 'Il tuo carrello'; +$_MODULE['<{paypal}prestashop>confirm_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>confirm_f1d3b424cd68795ecaa552883759aceb'] = 'Riepilogo ordine'; +$_MODULE['<{paypal}prestashop>confirm_dd23adc5fb6bda9c384397b31e57fc53'] = 'pagamento PayPal'; +$_MODULE['<{paypal}prestashop>confirm_62d74398cb6ebaa69ab7339052ca5c92'] = 'Hai scelto di pagare con PayPal.'; +$_MODULE['<{paypal}prestashop>confirm_c884ed19483d45970c5bf23a681e2dd2'] = 'Ecco un breve riepilogo del tuo ordine:'; +$_MODULE['<{paypal}prestashop>confirm_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; +$_MODULE['<{paypal}prestashop>confirm_1f87346a16cf80c372065de3c54c86d9'] = '(Tasse incl.)'; +$_MODULE['<{paypal}prestashop>confirm_8ed356c32b198c9cb2abab7c3d262b93'] = 'Accettiamo che la seguente valuta sia inviata tramite PayPal:'; +$_MODULE['<{paypal}prestashop>confirm_0881a11f7af33bc1b43e437391129d66'] = 'Si prega di confermare l\'ordine cliccando su \'confermo il mio ordine\''; +$_MODULE['<{paypal}prestashop>confirm_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; +$_MODULE['<{paypal}prestashop>confirm_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; +$_MODULE['<{paypal}prestashop>confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine'; +$_MODULE['<{paypal}prestashop>confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{paypal}prestashop>confirmation_15b0f8e55c6bdfc3d5fd0b6b3b6cb3ee'] = 'Hai scelto il metodo PayPal.'; +$_MODULE['<{paypal}prestashop>confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{paypal}prestashop>confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{paypal}prestashop>confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{paypal}prestashop>error_a40cab5994f36d4c48103a22ca082e8f'] = 'Il tuo carrello'; +$_MODULE['<{paypal}prestashop>error_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>error_425551a2289ed60c9260933d1c45ef00'] = 'Si prega di fare riferimento ai log:'; +$_MODULE['<{paypal}prestashop>error_0557fa923dcee4d0f86b1409f5c2167f'] = 'Indietro'; +$_MODULE['<{paypal}prestashop>paypal_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{paypal}prestashop>paypal_6e7012516038a096b9f6bb71ba2cc5a3'] = 'Si accettano pagamenti con carte di credito e prepagate (Visa, MasterCard, Amex, Aurora) associate al conto PayPal'; +$_MODULE['<{paypal}prestashop>paypal_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{paypal}prestashop>paypal_1828820cc60e36b6f9fdf60cab103ed7'] = 'Si sta attualmente utilizzando l\'indirizzo di posta elettronica predefinito, è necessario utilizzare il proprio indirizzo e-mail'; +$_MODULE['<{paypal}prestashop>paypal_47b49d72ae0a4b3aa928fc4cc3e7fc53'] = 'Per RIMUOVERE questo avviso, disinstalla e rimuovi il modulo PayPalAPI'; +$_MODULE['<{paypal}prestashop>paypal_7d0887294ed32e2013b64c4210e26841'] = 'Non usare il modulo PayPalAPI e rimuovilo. '; +$_MODULE['<{paypal}prestashop>paypal_a706f7e37a81dc235d41bbeb6fae92aa'] = 'Non hai selezionato un metodo di pagamento valido '; +$_MODULE['<{paypal}prestashop>paypal_32af90c3cfef1bacf43b0c3a8f60a4da'] = 'Il denaro è stato recuperato '; +$_MODULE['<{paypal}prestashop>paypal_d238649ac5ec14afc894fad36c0b50fc'] = 'La richiesta di recupero fondi non è andata a buon fine, vedi il messaggio nella cronologia.'; +$_MODULE['<{paypal}prestashop>paypal_05b998de2c4fb46a7bdd37bd378b81d9'] = 'La convalida è stata eseguita, vedi il messaggio nella cronologia. '; +$_MODULE['<{paypal}prestashop>paypal_aeca7e93a1b3d77e38c3cffa131774d5'] = 'Il rimborso è stato completato '; +$_MODULE['<{paypal}prestashop>paypal_cba030a50c8a99c7e224adbe1cf58544'] = 'La richiesta di rimborso non è andata a buon fine, vedi il messaggio nella cronologia.'; +$_MODULE['<{paypal}prestashop>paypal_b630aa9b5e25da971949cae62dd109aa'] = 'Convalida PayPal '; +$_MODULE['<{paypal}prestashop>paypal_e8fdd4382b75b42bfbd96eb7b032cf47'] = 'Informazioni:'; +$_MODULE['<{paypal}prestashop>paypal_9119a92adbbf6c67bfb8a3aee0bdb720'] = 'In attesa di raccolta - Non spedire'; +$_MODULE['<{paypal}prestashop>paypal_c14eb95a724174f336b8ffdd98ef2f35'] = 'In attesa di pagamento - Non spedire'; +$_MODULE['<{paypal}prestashop>paypal_5b18ff32c2aaaf4b79bdead10b10fe29'] = 'Vedi lo stato del pagamento'; +$_MODULE['<{paypal}prestashop>paypal_81e826adb70e2e6b189c2eef739d52d4'] = 'Riscossione PayPal '; +$_MODULE['<{paypal}prestashop>paypal_6f1f179632d90b3f71f5c83a1137e302'] = 'Fondi pronti per essere catturato prima della spedizione'; +$_MODULE['<{paypal}prestashop>paypal_3a81739e892c77e29ff4718c9dd92a34'] = 'Ricevi il denaro '; +$_MODULE['<{paypal}prestashop>paypal_8ba079f305b81b172792bc0469b6a690'] = 'Rimborso PayPal '; +$_MODULE['<{paypal}prestashop>paypal_016e1f278eccd700eaf33f74a501d050'] = 'Pagamento accettato'; +$_MODULE['<{paypal}prestashop>paypal_a8b1cc445942a2e1a7d7cca641c86d67'] = 'Quando emetti un rimborso per un prodotto, viene eseguito un rimborso parziale a meno che non selezioni l\'opzione Crea buono'; +$_MODULE['<{paypal}prestashop>paypal_c2a5e2e23d8ec9cad779d657b7d33fc1'] = 'Rimborsa l\'intero importo della transazione '; +$_MODULE['<{paypal}prestashop>paypal_729a51874fe901b092899e9e8b31c97a'] = 'Sei sicuro? '; +$_MODULE['<{paypal}prestashop>paypal_20fda49ece75d93bea97648ab1f1f1cf'] = 'Annulla i risultati per i prodotti: '; +$_MODULE['<{paypal}prestashop>paypal_e5970a9962bc4cacb5adb408418a9f0c'] = 'Autorizzazione di PayPal non riuscita '; +$_MODULE['<{paypal}prestashop>paypal_be6575076ac9b651d870a59970e7cd54'] = 'PayPal ha restituito un errore '; +$_MODULE['<{paypal}prestashop>paypal_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Il numero di sicurezza fornito da PayPal non è uguale a quello del cookie '; +$_MODULE['<{paypal}prestashop>paypal_33ac76215cb67f61f891cc3113e55997'] = 'Autorizzazione di pagamento differito concessa da PayPal '; +$_MODULE['<{paypal}prestashop>paypal_8778ee03f6592d5fec9a1f2ee851e476'] = 'Ordine PayPal completato '; +$_MODULE['<{paypal}prestashop>paypal_d89a00d4ba79c176bb0fc17f12d42a18'] = 'Chiave Paypal \'Mc_gross\' non specificata, non può controllare l\'importo corrisposto.'; +$_MODULE['<{paypal}prestashop>paypal_202a2860b19003ce53966a8780bb448b'] = 'Chiave Paypal \'Payment_status\' non specificata, non in grado di controllare la validità di pagamento'; +$_MODULE['<{paypal}prestashop>paypal_bd0e34e5be6447844e6f262d51f1a9dc'] = 'Pagamento:'; +$_MODULE['<{paypal}prestashop>paypal_23703f7d045936080031477df1fc237b'] = 'Chiave Paypal \'Custom\' non specificata, non in grado di inoltrare al carrello'; +$_MODULE['<{paypal}prestashop>paypal_760c3c2ccfadeee26c80c7b39462cf1d'] = 'Chiave Paypal \'Txn_id\' non specificata, operazione sconosciuta'; +$_MODULE['<{paypal}prestashop>paypal_7faa8448e059fb97d60d4a4b15634d98'] = 'Chiave Paypal \'Mc_currency\' non specificata, valuta sconosciuto'; +$_MODULE['<{paypal}prestashop>paypal_e61f52d02b9f52fbe1fd41ed320e29c3'] = 'Carrello non trovato'; +$_MODULE['<{paypal}prestashop>paypal_0617900b1aff826081d07f5a3e2e7cd0'] = 'Ordine è già stato effettuato'; +$_MODULE['<{paypal}prestashop>paypal_f5209b3301a46f3057ffbf34d903e205'] = 'ID Transazione PayPal:'; +$_MODULE['<{paypal}prestashop>paypal_7b19e875ff64b09d80ee05dcc84b9975'] = 'La transazione PayPal non è stata VERIFICATA.'; +$_MODULE['<{paypal}prestashop>paypal_20dfea1a472e5be3f15f6b5f36ca335c'] = 'Problema di connessione al server di PayPal.'; +$_MODULE['<{paypal}prestashop>paypal_76ee8dc73701e846f7bccdf98dae079b'] = 'Nessuna comunicazione di trasporto disponibile.'; +$_MODULE['<{paypal}prestashop>paypal_8358ec19f397d4cdd632688d4f79e535'] = 'Verifica fallimento (usando fsockopen). Restituito:'; +$_MODULE['<{paypal}prestashop>paypal_eca77e208634d52703b07672abbf16ec'] = 'Verifica fallimento (con cURL). Restituito:'; +$_MODULE['<{paypal}prestashop>paypal_f7799c2ded739cf3c3e9babffc5f315b'] = 'Collegamento tramite cURL non riuscita'; +$_MODULE['<{paypal}prestashop>paypal_c640d8a3c2c34f79061a0bbe50e8420c'] = 'Attendere, reindirizzamento a Paypal ... Grazie.'; +$_MODULE['<{paypal}prestashop>paypal_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{paypal}prestashop>paypal_dae3b417a0fc4a49e851ce55d6d49551'] = 'Il mio carrello'; +$_MODULE['<{paypal}prestashop>paypal_9bfa2332c9c7198ac9774c6710bf76c4'] = 'Torna al negozio'; +$_MODULE['<{paypal}prestashop>paypal_d56249aa9643851a94bd3ef3da309d35'] = 'Errore Paypal: (e-mail account business non valido o non definito)'; +$_MODULE['<{paypal}prestashop>paypal_e7ac6f09a936201890de4094b1ee4e50'] = 'Errore Paypal: (indirizzo o cliente non valido)'; +$_MODULE['<{paypal}prestashop>paypal_49b21ad0d38942f635877e7bbc5d7a1e'] = 'Soluzione '; +$_MODULE['<{paypal}prestashop>paypal_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{paypal}prestashop>paypal_9c81c7e49db6edc5ea243dbadfb28c2a'] = 'Logo e personalizzazioni '; +$_MODULE['<{paypal}prestashop>paypal_9d51eb502e6f46830cb97f53d761c212'] = 'Scegli una soluzione: '; +$_MODULE['<{paypal}prestashop>paypal_0234fed198d74928f2864c574a9a89c1'] = 'Pagamenti con carta di credito '; +$_MODULE['<{paypal}prestashop>paypal_627fabff813cafcd9313ea0037c0125b'] = '(Visa, Mastercard, Amex, Aurora) e conto PayPal '; +$_MODULE['<{paypal}prestashop>paypal_ec2d6b2d2cfb9eadee1c15f3d579252d'] = 'Pagamenti con carta e protezione venditori '; +$_MODULE['<{paypal}prestashop>paypal_7d8bea00c8ed9c1cdf9da980bd69c85a'] = '(PayPal Integral Evolution, abbonamento mensile)'; +$_MODULE['<{paypal}prestashop>paypal_457e5c04d6690cc6a72412c792c504d9'] = 'Pagamenti con '; +$_MODULE['<{paypal}prestashop>paypal_5d4023dba17f36ce69357d25cbe4fbad'] = 'Conto PayPal '; +$_MODULE['<{paypal}prestashop>paypal_e574ea35c565033a741efb1925b5f188'] = '(PayPal Option+) '; +$_MODULE['<{paypal}prestashop>paypal_fdcd0dc7120ef9d14417c968e0a16e97'] = 'Attivazione soggetta a condizioni e a tariffa mensile '; +$_MODULE['<{paypal}prestashop>paypal_89e92ec866e363e88f12a7372d682c5c'] = 'clicca qui per registrarti '; +$_MODULE['<{paypal}prestashop>paypal_cd1bd0b0d3d22ede663f17df5194b3fe'] = 'Opzione: '; +$_MODULE['<{paypal}prestashop>paypal_28882d910d7b5311aa0a9d5094e11caf'] = 'Pagamento express PayPal: pagamenti in 2 clic '; +$_MODULE['<{paypal}prestashop>paypal_22afd6155cd35727f6ed449aef994731'] = 'con conto PayPal direttamente dalla pagina del carrello'; +$_MODULE['<{paypal}prestashop>paypal_4037fe43ff7b926e093805e2931c0f77'] = 'Solo debug:'; +$_MODULE['<{paypal}prestashop>paypal_7c8ab5ce5bf608dd41cf3e8f2312451c'] = 'Attiva messaggio di log completo'; +$_MODULE['<{paypal}prestashop>paypal_d4dccb8ca2dac4e53c01bd9954755332'] = 'Salva impostazioni '; +$_MODULE['<{paypal}prestashop>paypal_7a262cb0d3d917313c8ba12f996fe83c'] = 'Importante: '; +$_MODULE['<{paypal}prestashop>paypal_de79de54313d8b57cd45c840d196b7d0'] = 'Per usare una delle soluzioni PayPal, devi impostare i parametri API nella sezione Impostazioni.'; +$_MODULE['<{paypal}prestashop>paypal_79f53a401ee04dbc765d0ba9a951a106'] = 'Modalità Sandbox (test) '; +$_MODULE['<{paypal}prestashop>paypal_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo '; +$_MODULE['<{paypal}prestashop>paypal_3cab03c00dbd11bc3569afa0748013f0'] = 'Non attivo '; +$_MODULE['<{paypal}prestashop>paypal_4dbcb38bbbff5d4a402f2575c57a35e6'] = 'Tipo di pagamento '; +$_MODULE['<{paypal}prestashop>paypal_5bc5650bfb4c1eb3887ea80e7802301f'] = 'Diretto (vendite)'; +$_MODULE['<{paypal}prestashop>paypal_6dd446781e32f1a989396e93db70437d'] = 'Autorizzazione / riscossione'; +$_MODULE['<{paypal}prestashop>paypal_7186106a954f390f62860c11c8ba10d5'] = '(Invio pagamento) '; +$_MODULE['<{paypal}prestashop>paypal_3cf5408a4a41b56c6fd7878a070b76ff'] = 'Email associata al conto PayPal '; +$_MODULE['<{paypal}prestashop>paypal_467008be031b7e1a913395f53556fea8'] = 'Attivazione chiamate API '; +$_MODULE['<{paypal}prestashop>paypal_11931512987fbd1b884da55f13273a07'] = 'Nome utente API '; +$_MODULE['<{paypal}prestashop>paypal_5e07b6956454390018af63962ef4a3f6'] = 'Password API '; +$_MODULE['<{paypal}prestashop>paypal_1c1357865e46a07448c95ebca39d4541'] = 'Lasciare vuoto se la password non è stata modificata '; +$_MODULE['<{paypal}prestashop>paypal_e1ededd62537e048b815f70cc971bec8'] = 'Firma API '; +$_MODULE['<{paypal}prestashop>paypal_52c59dac7b7ebfa8a0d78c98f2bc0225'] = 'Clicca qui per maggiori informazioni su come creare username, password e firma API. '; +$_MODULE['<{paypal}prestashop>paypal_e28b278d67eeecfad67e76ec78fc13e8'] = 'Loghi e personalizzazioni'; +$_MODULE['<{paypal}prestashop>paypal_ee0174ba1fc039128d0a38074a7af945'] = 'URL del Banner'; +$_MODULE['<{paypal}prestashop>paypal_4c1c997e72e71eb6f690a9cd3dacb1f4'] = 'L\'immagine deve essere ospitata su un server sicuro (https). Max.: 750x90 pixel '; +$_MODULE['<{paypal}prestashop>paypal_091878185fc791198ac80982860b21ed'] = 'Modello scelto per PayPal Pro '; +$_MODULE['<{paypal}prestashop>paypal_cd8d30bc59ccf92028335d7e69e29905'] = 'Clicca qui per maggiori informazioni su come personalizzare questo modello '; +$_MODULE['<{paypal}prestashop>paypal_9518e6d551f7dc752b24af3629e849f9'] = 'Aprire un conto PayPal '; +$_MODULE['<{paypal}prestashop>paypal_4c9ef5964631b6d4b38f5f2f77d1be74'] = 'Se crei il tuo conto PayPal cliccando sull\'immagine sottostante, ci aiuti a migliorare il software PrestaShop:'; +$_MODULE['<{paypal}prestashop>paypal_1569f6a31ff61f45c5ba13d7cab7e042'] = 'Questo modulo ti consente di accettare pagamenti con PayPal. '; +$_MODULE['<{paypal}prestashop>paypal_3c4cb777e8df15388c680354569636b6'] = 'Se il cliente sceglie questo metodo di pagamento, l\'importo sarà accreditato automaticamente sul tuo conto PayPal.'; +$_MODULE['<{paypal}prestashop>paypal_f9b49f93306d28e3dec595c3b89c926d'] = 'È necessario configurare il proprio conto PayPal prima di utilizzare questo modulo.'; +$_MODULE['<{paypal}prestashop>paypal_57487012438fe78ae1d462e53a91bfc0'] = 'la soluzione non è valida. '; +$_MODULE['<{paypal}prestashop>paypal_f629bddb66252b97da3e7e5346697955'] = 'devi indicare almeno le informazioni sul conto '; +$_MODULE['<{paypal}prestashop>paypal_909d37302176080797966972da84b4e7'] = 'e-mail non valida'; +$_MODULE['<{paypal}prestashop>paypal_2fa631ec6f6afeac6335f3261181063f'] = 'L\'URL del banner non è valido '; +$_MODULE['<{paypal}prestashop>paypal_19ea461c401bd941bf47a8bc01eecd6c'] = 'URL del banner deve utilizzare il protocollo HTTPS'; +$_MODULE['<{paypal}prestashop>paypal_b8822117a8cc930315a50bab7f6a4c80'] = 'il modello PayPal non è valido '; +$_MODULE['<{paypal}prestashop>paypal_b02186eee414487a068584dc0d177ad2'] = 'non puoi usare Autorizzazione e riscossione se non hai le credenziali API'; +$_MODULE['<{paypal}prestashop>paypal_17fcef6818690d11d7caaab023ecdcff'] = 'non puoi usare questa soluzione se non hai le credenziali API '; +$_MODULE['<{paypal}prestashop>paypal_30e4e115bfc5e140782fd9cb01be6898'] = 'non puoi usare Pagamento express se non hai le credenziali API '; +$_MODULE['<{paypal}prestashop>paypal_c888438d14855d7d96a2724ee9c306bd'] = 'Le impostazioni sono aggiornate '; +$_MODULE['<{paypal}prestashop>paypal_67c0e5ec07dd31dc74aaf55d6a72da31'] = 'La richiesta dello stato del pagamento ha generato un errore '; +$_MODULE['<{paypal}prestashop>paypal_ec53a8c4f07baed5d8825072c89799be'] = 'Stato '; +$_MODULE['<{paypal}prestashop>paypal_ccb168b5a6a86eb100dc2dee754a316b'] = 'Motivo: '; +$_MODULE['<{paypal}prestashop>paypal_4f3acf5bcd7152fd301550bec6d0ffac'] = 'Errore di PayPal: '; +$_MODULE['<{paypal}prestashop>paypal_a0d09826326fd385f6ceb17442f290de'] = 'La richiesta di riscossione ha generato un errore '; +$_MODULE['<{paypal}prestashop>paypal_e03187f3f9d6eda06a2a7c201f58cdca'] = 'La richiesta di rimborso ha generato un errore '; +$_MODULE['<{paypal}prestashop>paypal_e5d5d9f40763cfe6549bef705e3529a7'] = 'Il messaggio di pagamento non è valido, rivedi il tuo modulo. '; +$_MODULE['<{paypal}prestashop>paypal_eec39bf42bd135971fb2d838c67d1449'] = 'Risultato dell\'operazione di rimborso: '; +$_MODULE['<{paypal}prestashop>paypal_2ab62d1a578713d0862b56819295630e'] = 'Rimborso PayPal completato. '; +$_MODULE['<{paypal}prestashop>paypal_a64db959966ba8d07c8b5d9493fcc21f'] = 'Errore durante la transazione '; +$_MODULE['<{paypal}prestashop>paypal_67962779da962e3d4225055afc05e7bd'] = 'Risultato operazione di riscossione: '; +$_MODULE['<{paypal}prestashop>paypal_5a05744b8ccb5909bc83355092e0f3fa'] = 'Stato della verifica: '; +$_MODULE['<{paypal}prestashop>paypalconnect_d1f14cc4a2dade80c92421d26422fea0'] = 'Fare nuova connessione'; +$_MODULE['<{paypal}prestashop>paypalconnect_94a27811a721ef512ad7bfa06cab34e0'] = 'Connessione non riuscita con metodo CURL'; +$_MODULE['<{paypal}prestashop>paypalconnect_70215486455daee13382c68b1a230b82'] = 'Connessione con metodo CURL riuscita'; +$_MODULE['<{paypal}prestashop>paypalconnect_e4c4ad49bced42265b5facc2175cdafd'] = 'Invio di questo param.:'; +$_MODULE['<{paypal}prestashop>paypalconnect_445583f6641da98fc7ac8fd9d13a564b'] = 'Invio con metodo CURL fallito! Errore:'; +$_MODULE['<{paypal}prestashop>paypalconnect_ef4fbf36eaa2083442d386990ba063c2'] = 'Invio con metodo CURL riuscito'; +$_MODULE['<{paypal}prestashop>paypalconnect_bf059c9751bb1a20b449b7917b1df374'] = 'Connessione non riuscita con metodo fsockopen'; +$_MODULE['<{paypal}prestashop>paypalconnect_ea800e3536f81238a4cbc32eb6db4eaf'] = 'Connettiti con metodo fsockopen riuscita'; +$_MODULE['<{paypal}prestashop>paypalconnect_6e9aa4cb541e09b07602d4ea96080811'] = 'Invio con metodo fsockopen non riuscito!'; +$_MODULE['<{paypal}prestashop>paypalconnect_842a183be225d415b2b4375ba1dd1c94'] = 'Invio con metodo fsockopen riuscito'; +$_MODULE['<{paypal}prestashop>paypallib_7c2d00d8c94d1ce0f515db8b0481db40'] = 'risposta di PayPal:'; +$_MODULE['<{paypal}prestashop>authentication_cd42c6dd6cc4cd65cb5e13b729050469'] = 'Controlla le tue informazioni'; +$_MODULE['<{paypal}prestashop>authentication_6335a00a08fde0fbb8f6d6630cdadd92'] = 'I tuoi dati personali'; +$_MODULE['<{paypal}prestashop>authentication_b78a3223503896721cca1303f776159b'] = 'Titolo'; +$_MODULE['<{paypal}prestashop>authentication_127469a6b4253ebb77adccc0dd48461e'] = 'Sig.'; +$_MODULE['<{paypal}prestashop>authentication_29e32764941c30d1bb41c601014fbdbd'] = 'Sig.ra'; +$_MODULE['<{paypal}prestashop>authentication_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nome'; +$_MODULE['<{paypal}prestashop>authentication_8d3f5eff9c40ee315d452392bed5309b'] = 'Cognome'; +$_MODULE['<{paypal}prestashop>authentication_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{paypal}prestashop>authentication_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{paypal}prestashop>authentication_bf2957630c4209f61a388a08c2154915'] = '(5 caratteri min.)'; +$_MODULE['<{paypal}prestashop>authentication_aac772216aecbeca0e86d06671fe985a'] = 'Compleanno'; +$_MODULE['<{paypal}prestashop>authentication_86f5978d9b80124f509bdb71786e929e'] = 'Gennaio'; +$_MODULE['<{paypal}prestashop>authentication_659e59f062c75f81259d22786d6c44aa'] = 'Febbraio'; +$_MODULE['<{paypal}prestashop>authentication_fa3e5edac607a88d8fd7ecb9d6d67424'] = 'Marzo'; +$_MODULE['<{paypal}prestashop>authentication_3fcf026bbfffb63fb24b8de9d0446949'] = 'Aprile'; +$_MODULE['<{paypal}prestashop>authentication_195fbb57ffe7449796d23466085ce6d8'] = 'Maggio'; +$_MODULE['<{paypal}prestashop>authentication_688937ccaf2a2b0c45a1c9bbba09698d'] = 'Giugno'; +$_MODULE['<{paypal}prestashop>authentication_1b539f6f34e8503c97f6d3421346b63c'] = 'Luglio'; +$_MODULE['<{paypal}prestashop>authentication_41ba70891fb6f39327d8ccb9b1dafb84'] = 'Agosto'; +$_MODULE['<{paypal}prestashop>authentication_cc5d90569e1c8313c2b1c2aab1401174'] = 'Settembre'; +$_MODULE['<{paypal}prestashop>authentication_eca60ae8611369fe28a02e2ab8c5d12e'] = 'Ottobre'; +$_MODULE['<{paypal}prestashop>authentication_7e823b37564da492ca1629b4732289a8'] = 'Novembre'; +$_MODULE['<{paypal}prestashop>authentication_82331503174acbae012b2004f6431fa5'] = 'Dicembre'; +$_MODULE['<{paypal}prestashop>authentication_6f6162d3a052bb330e9c60285c74c6c9'] = 'Iscriviti alla nostra newsletter'; +$_MODULE['<{paypal}prestashop>authentication_ac135c86084a47630c9eadb4edd5ef75'] = 'Ricevere le offerte speciali dei nostri partner'; +$_MODULE['<{paypal}prestashop>authentication_455175f3f5be6306247babb349c0515a'] = 'Il tuo indirizzo'; +$_MODULE['<{paypal}prestashop>authentication_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Azienda'; +$_MODULE['<{paypal}prestashop>authentication_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{paypal}prestashop>authentication_783cb853aae6984e51583b3bb80c09d2'] = 'Indirizzo (2)'; +$_MODULE['<{paypal}prestashop>authentication_9b514b51d03075005814a33edc74c958'] = 'CAP '; +$_MODULE['<{paypal}prestashop>authentication_57d056ed0984166336b7879c2af3657f'] = 'Città'; +$_MODULE['<{paypal}prestashop>authentication_59716c97497eb9694541f7c3d37b1a4d'] = 'Paese'; +$_MODULE['<{paypal}prestashop>authentication_46a2a41cc6e552044816a2d04634545d'] = 'Stato'; +$_MODULE['<{paypal}prestashop>authentication_0f68b904e33d9ac04605aecc958bcf52'] = 'Ulteriori informazioni'; +$_MODULE['<{paypal}prestashop>authentication_fe66abce284ec8589e7d791185b5c442'] = 'Telefono'; +$_MODULE['<{paypal}prestashop>authentication_41c2fff4867cc204120f001e7af20f7a'] = 'Cellulare'; +$_MODULE['<{paypal}prestashop>authentication_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Assegna un titolo di indirizzo per riferimento futuro'; +$_MODULE['<{paypal}prestashop>authentication_ae7bdef7fe2bbbbf02c11e92c5fceb40'] = 'Il mio indirizzo'; +$_MODULE['<{paypal}prestashop>authentication_a0bfb8e59e6c13fc8d990781f77694fe'] = 'Continua'; +$_MODULE['<{paypal}prestashop>authentication_19f823c6453c2b1ffd09cb715214813d'] = 'Campo obbligatorio'; +$_MODULE['<{paypal}prestashop>login_b40ad46c25c153a3d2fde078c0e1b0f8'] = 'Accedi'; +$_MODULE['<{paypal}prestashop>login_abc57016a138dea055e0d8be6358f84e'] = 'Questa e-mail è già stato registrata, effettua il login!'; +$_MODULE['<{paypal}prestashop>login_8b5dd64ab8d0b8158906796b53a200e2'] = 'Indirizzo e-mail'; +$_MODULE['<{paypal}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{paypal}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Entra'; +$_MODULE['<{paypal}prestashop>login_01a569ddc6cf67ddec2a683f0a5f5956'] = 'Hai dimenticato la password?'; +$_MODULE['<{paypal}prestashop>paypalexpress_b601224a2a6c61f38738ca903fb019a2'] = 'Non è un carrello valido'; +$_MODULE['<{paypal}prestashop>paypalexpress_ee9dc1e678d54c517f481583c3fb2db8'] = 'Non è una valuta valida'; +$_MODULE['<{paypal}prestashop>shopping_cart_aa91004934e1abdb620b5d0f0c18681c'] = 'Paga con PayPal Express Checkout'; +$_MODULE['<{paypal}prestashop>submit_528d1f824243db48e40cb6223d32fa06'] = 'Nessun token dato da PayPal'; +$_MODULE['<{paypal}prestashop>submit_795277047da13b4fc74e02e050b1a675'] = 'PayPal ha rinviato l\'errore'; +$_MODULE['<{paypal}prestashop>submit_b4133f1ba03a914134a5281a08231078'] = 'Autorizzazione a PayPal non riuscita'; +$_MODULE['<{paypal}prestashop>submit_4935b58d37fda5bd60acc510cb324342'] = 'Impossibile recuperare le informazioni del tuo conto PayPal'; +$_MODULE['<{paypal}prestashop>submit_90aa7ebf75251f535a9bdd6ba671ae7a'] = 'Token dato da PayPal non è lo di quello del cookie'; +$_MODULE['<{paypal}prestashop>paypal_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Paga con PayPal'; +$_MODULE['<{paypal}prestashop>payment_dac2693baa5c5c9a5318609ed81c4f2a'] = 'Paga con PayPal'; +$_MODULE['<{paypal}prestashop>payment_a3f2caee6ef8e68fbd26e42d83f2bf65'] = 'Paga con il tuo conto PayPal, carta di credito (Visa, Mastercard ...), o carta di credito privata'; +$_MODULE['<{paypal}prestashop>payment_b08008a2de4331ba13f006c9bcf37b62'] = 'Paga con il tuo conto PayPal'; +$_MODULE['<{paypal}prestashop>paypalpayment_ee9dc1e678d54c517f481583c3fb2db8'] = 'Non è una valuta valida'; diff --git a/modules/paypal/logo.gif b/modules/paypal/logo.gif new file mode 100644 index 000000000..57abc204b Binary files /dev/null and b/modules/paypal/logo.gif differ diff --git a/modules/paypal/mails/de/error_reporting.html b/modules/paypal/mails/de/error_reporting.html new file mode 100644 index 000000000..1bb52df16 --- /dev/null +++ b/modules/paypal/mails/de/error_reporting.html @@ -0,0 +1,46 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo,
         
        Fehlerbericht aus Ihrem PayPalAPI Modul
         
        Bei einem Kunden ist ein Problem mit dem PayPalAPI Modul aufgetreten, lesen Sie den Bericht:
         
        {logs}
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/paypal/mails/de/error_reporting.txt b/modules/paypal/mails/de/error_reporting.txt new file mode 100644 index 000000000..97b6ab49d --- /dev/null +++ b/modules/paypal/mails/de/error_reporting.txt @@ -0,0 +1,9 @@ + Hallo, + + Fehlerbericht aus Ihrem PayPalAPI Modul + + Bei einem Kunden ist ein Problem mit dem PayPalAPI Modul aufgetreten, lesen Sie den Bericht: + + {logs} + + {shop_url} powered by PrestaShop™ diff --git a/modules/paypal/mails/en/error_reporting.html b/modules/paypal/mails/en/error_reporting.html new file mode 100644 index 000000000..139e8749b --- /dev/null +++ b/modules/paypal/mails/en/error_reporting.html @@ -0,0 +1,42 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi,
         
        Error reporting from your PayPalAPI module
         
        + A client has encountered a problem with the module PayPalAPI, see the report: +
         
        + {logs} +
         
        + {shop_name} powered with PrestaShop™ +
        + + diff --git a/modules/paypal/mails/en/error_reporting.txt b/modules/paypal/mails/en/error_reporting.txt new file mode 100644 index 000000000..802ac51ab --- /dev/null +++ b/modules/paypal/mails/en/error_reporting.txt @@ -0,0 +1,9 @@ + Hi, + + Error reporting from your PayPalAPI module + + A client has encountered a problem with the module PayPalAPI, see the report: + + {logs} + + {shop_url} powered by PrestaShop™ diff --git a/modules/paypal/mails/es/error_reporting.html b/modules/paypal/mails/es/error_reporting.html new file mode 100644 index 000000000..c36625f80 --- /dev/null +++ b/modules/paypal/mails/es/error_reporting.html @@ -0,0 +1,47 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola,
         
        Informe de error a partir de su módulo PayPalAPI
         
        Un cliente ha encontrado un problema con el módulo PayPalAPI:
         
        {logs}
         
        {shop_name} lanzado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/paypal/mails/es/error_reporting.txt b/modules/paypal/mails/es/error_reporting.txt new file mode 100644 index 000000000..2537b7ec4 --- /dev/null +++ b/modules/paypal/mails/es/error_reporting.txt @@ -0,0 +1,9 @@ + Hola, + + Informe de error a partir de su módulo PayPalAPI + + Un cliente ha encontrado un problema con el módulo PayPalAPI: + + {logs} + + {shop_url} lanzado por PrestaShop™ diff --git a/modules/paypal/mails/fr/error_reporting.html b/modules/paypal/mails/fr/error_reporting.html new file mode 100644 index 000000000..3d9c475d0 --- /dev/null +++ b/modules/paypal/mails/fr/error_reporting.html @@ -0,0 +1,42 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour,
         
        Rapport d'erreur à partir de votre module PayPalAPI
         
        + Un client a rencontré un problème avec le module PayPalAPI: +
         
        + {logs} +
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/paypal/mails/fr/error_reporting.txt b/modules/paypal/mails/fr/error_reporting.txt new file mode 100644 index 000000000..87cf56505 --- /dev/null +++ b/modules/paypal/mails/fr/error_reporting.txt @@ -0,0 +1,9 @@ + Bonjour, + + Rapport d'erreur à partir de votre module PayPalAPI + + Un client a rencontré un problème avec le module PayPalAPI: + + {logs} + + {shop_url} propulsé par PrestaShop™ diff --git a/modules/paypal/mails/it/error_reporting.html b/modules/paypal/mails/it/error_reporting.html new file mode 100644 index 000000000..85f826505 --- /dev/null +++ b/modules/paypal/mails/it/error_reporting.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve,
        Errore dal tuo modulo PayPalAPI
        Un cliente ha avuto un problema con il modulo PayPalAPI, vedi il rapporto:
        {logs}
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/paypal/mails/it/error_reporting.txt b/modules/paypal/mails/it/error_reporting.txt new file mode 100644 index 000000000..054d5a3f4 --- /dev/null +++ b/modules/paypal/mails/it/error_reporting.txt @@ -0,0 +1,9 @@ + Salve, + + Errore dal tuo modulo PayPalAPI + + Un cliente ha avuto un problema con il modulo PayPalAPI, vedi il rapporto: + + {logs} + + {shop_url} powered by PrestaShop™ diff --git a/modules/paypal/payment/payment.tpl b/modules/paypal/payment/payment.tpl new file mode 100644 index 000000000..7db940135 --- /dev/null +++ b/modules/paypal/payment/payment.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay with PayPal' mod='paypal'} +
        + {if $integral} + {l s='Pay with your PayPal account, credit card (CB, Visa, Mastercard...), or private credit card' mod='paypal'} + {else} + {l s='Pay with your PayPal account' mod='paypal'} + {/if} +
        +
        +

        \ No newline at end of file diff --git a/modules/paypal/payment/paypalpayment.php b/modules/paypal/payment/paypalpayment.php new file mode 100644 index 000000000..6362e4e2e --- /dev/null +++ b/modules/paypal/payment/paypalpayment.php @@ -0,0 +1,88 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PaypalPayment extends Paypal +{ + protected $_logs = array(); + + public function getAuthorisation() + { + global $cookie, $cart; + + // Getting cart informations + $currency = new Currency((int)($cart->id_currency)); + if (!Validate::isLoadedObject($currency)) + $this->_logs[] = $this->l('Not a valid currency'); + if (sizeof($this->_logs)) + return false; + + // Making request + $vars = '?fromPayPal=1'; + $returnURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/payment/submit.php'.$vars; + $cancelURL = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php'; + $paymentAmount = (float)($cart->getOrderTotal()); + $currencyCodeType = strval($currency->iso_code); + $paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale'; + $request = '&Amt='.urlencode($paymentAmount).'&PAYMENTACTION='.urlencode($paymentType).'&ReturnUrl='.urlencode($returnURL).'&CANCELURL='.urlencode($cancelURL).'&CURRENCYCODE='.urlencode($currencyCodeType).'&NOSHIPPING=1'; + if (Configuration::get('PAYPAL_PAYMENT_METHOD') == 0) + $request .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing'; + else + $request .= '&SOLUTIONTYPE=Mark&LANDINGPAGE=Login'; + $request .= '&LOCALECODE='.strtoupper(Language::getIsoById($cart->id_lang)); + if (Configuration::get('PAYPAL_HEADER')) + $request .= '&HDRIMG='.urlencode(Configuration::get('PAYPAL_HEADER')); + // Customer informations + $customer = new Customer((int)$cart->id_customer); + $request .= '&EMAIL='.urlencode($customer->email);//customer + // address of delivery + $address = new Address((int)$cart->id_address_delivery); + $country = new Country((int)$address->id_country); + if ($address->id_state) + $state = new State((int)$address->id_state); + $request .= '&SHIPTONAME='.urlencode($address->firstname.' '.$address->lastname); + $request .= '&SHIPTOSTREET='.urlencode($address->address1); + $request .= '&SHIPTOSTREET2='.urlencode($address->address2); + $request .= '&SHIPTOCITY='.urlencode($address->city); + $request .= '&SHIPTOSTATE='.($address->id_state ? $state->iso_code : $country->iso_code); + $request .= '&SHIPTOZIP='.urlencode($address->postcode); + $request .= '&SHIPTOCOUNTRY='.urlencode($country->iso_code); + $request .= '&SHIPTOPHONENUM='.urlencode($address->phone); + $request .= '&ADDROVERRIDE=1'; + + // Calling PayPal API + include(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + $ppAPI = new PaypalLib(); + $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request); + $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); + return $result; + } + + public function getLogs() + { + return $this->_logs; + } +} diff --git a/modules/paypal/payment/submit.php b/modules/paypal/payment/submit.php new file mode 100644 index 000000000..b36398307 --- /dev/null +++ b/modules/paypal/payment/submit.php @@ -0,0 +1,144 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$useSSL = true; + +include_once(dirname(__FILE__).'/../../../config/config.inc.php'); +include_once(dirname(__FILE__).'/../../../init.php'); + +include_once(_PS_MODULE_DIR_.'paypal/paypal.php'); +include_once(_PS_MODULE_DIR_.'paypal/payment/paypalpayment.php'); + +$ppPayment = new PaypalPayment(); +$errors = array(); + +// ##### +// Functions + +function getAuthorization() +{ + global $ppPayment, $cookie, $cart; + + $result = $ppPayment->getAuthorisation(); + $logs = $ppPayment->getLogs(); + if (is_array($result) AND sizeof($result)) + { + if (strtoupper($result['ACK']) == 'SUCCESS') + { + if (isset($result['TOKEN'])) + { + $cookie->paypal_token = strval($result['TOKEN']); + $cookie->paypal_token_date = time(); + header('Location: https://'.$ppPayment->getPayPalURL().'/webscr&cmd=_express-checkout&token='.urldecode(strval($cookie->paypal_token)).'&useraction=commit'); + exit; + } + else + $logs[] = ''.$ppPayment->l('No token given by PayPal', 'submit').''; + } else + $logs[] = ''.$ppPayment->l('PayPal returned error', 'submit').''; + } + $ppPayment->displayPayPalAPIError($ppPayment->l('Authorisation to PayPal failed', 'submit'), $logs); +} + +function displayConfirm() +{ + global $cookie, $smarty, $ppPayment, $cart; + + if (!$cookie->isLogged(true)) + die('Not logged'); + unset($cookie->paypal_token); + + if ($cart->id_currency != $ppPayment->getCurrency((int)$cart->id_currency)->id) + { + $cart->id_currency = (int)($ppPayment->getCurrency((int)$cart->id_currency)->id); + $cookie->id_currency = (int)($cart->id_currency); + $cart->update(); + Tools::redirect('modules/'.$ppPayment->name.'/payment/submit.php'); + } + + // Display all and exit + include(_PS_ROOT_DIR_.'/header.php'); + + $smarty->assign(array( + 'logo' => $ppPayment->getLogo(), + 'cust_currency' => $cart->id_currency, + 'currency' => $ppPayment->getCurrency((int)$cart->id_currency), + 'total' => $cart->getOrderTotal(true, Cart::BOTH), + 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'. $ppPayment->name.'/', + 'mode' => 'payment/' + )); + + echo $ppPayment->display('paypal.php', 'confirm.tpl'); + include(_PS_ROOT_DIR_.'/footer.php'); + die ; +} + +function submitConfirm() +{ + global $cookie, $smarty, $ppPayment, $cart; + + if (!$cookie->isLogged(true)) + die('Not logged'); + elseif (!$id_currency = (int)(Tools::getValue('currency_payement'))) + die('No currency'); + elseif (!$cart->getOrderTotal(true, Cart::BOTH)) + die('Empty cart'); + $currency = new Currency((int)($id_currency)); + if (!Validate::isLoadedObject($currency)) + die('Invalid currency'); + $cookie->id_currency = (int)($id_currency); + getAuthorization(); +} + +function validOrder() +{ + global $cookie, $cart, $ppPayment; + if (!$cookie->isLogged(true)) + die('Not logged'); + elseif (!$cart->getOrderTotal(true, Cart::BOTH)) + die('Empty cart'); + if (!$token = Tools::htmlentitiesUTF8(strval(Tools::getValue('token')))) + die('Invalid token'); + if ($token != strval($cookie->paypal_token)) + die('Invalid cookie token'); + if (!$payerID = Tools::htmlentitiesUTF8(strval(Tools::getValue('PayerID')))) + die('Invalid payerID'); + $ppPayment->makePayPalAPIValidation($cookie, $cart, $cart->id_currency, $payerID, 'payment'); +} + +// ##### +// Process !! + +// No submit, confirmation page +if (!Tools::isSubmit('submitPayment') AND !Tools::getValue('fromPayPal')) + displayConfirm(); +else +{ + if (!isset($cookie->paypal_token) OR !$cookie->paypal_token) + submitConfirm(); + validOrder(); +} diff --git a/modules/paypal/paypal.gif b/modules/paypal/paypal.gif new file mode 100644 index 000000000..e480d4b0c Binary files /dev/null and b/modules/paypal/paypal.gif differ diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php new file mode 100644 index 000000000..835df64e5 --- /dev/null +++ b/modules/paypal/paypal.php @@ -0,0 +1,1240 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +define('_PAYPAL_INTEGRAL_', 0); +define('_PAYPAL_OPTION_PLUS_', 1); +define('_PAYPAL_INTEGRAL_EVOLUTION_', 2); + +class PayPal extends PaymentModule +{ + private $_html = ''; + + public function __construct() + { + $this->name = 'paypal'; + $this->tab = 'payments_gateways'; + $this->version = '2.4'; + + $this->currencies = true; + $this->currencies_mode = 'radio'; + + parent::__construct(); + + $this->_errors = array(); + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('PayPal'); + $this->description = $this->l('Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your details?'); + if (Configuration::get('PAYPAL_BUSINESS') == 'paypal@prestashop.com') + $this->warning = $this->l('You are currently using the default PayPal e-mail address, please enter your own e-mail address.'); + $this->_checkAndUpdateFromOldVersion(); + if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php') AND $this->active) + $this->warning = $this->l('In order to REMOVE this warning, please uninstall and remove the PayPalAPI module.'); + + global $cookie; + $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); + $content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.Tools::strtolower(Language::getIsoById(intval($cookie->id_lang))).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $context); + $content = explode('|', $content); + if ($content[0] == 'OK') + { + if (!empty($this->warning)) + $this->warning .= ', '; + $this->warning .= $content[1]; + } + } + + public function install() + { + /* Install and register on hook */ + if (!parent::install() + OR !$this->registerHook('payment') + OR !$this->registerHook('paymentReturn') + OR !$this->registerHook('shoppingCartExtra') + OR !$this->registerHook('backBeforePayment') + OR !$this->registerHook('paymentReturn') + OR !$this->registerHook('rightColumn') + OR !$this->registerHook('cancelProduct') + OR !$this->registerHook('adminOrder')) + return false; + + if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php') AND !Configuration::get('PAYPAL_NEW')) + { + include_once(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php'); + $paypalapi = new PaypalAPI(); + return $this->_checkAndUpdateFromOldVersion(true); + } + + /* Set database */ + if (!Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'paypal_order` ( + `id_order` int(10) unsigned NOT NULL, + `id_transaction` varchar(255) NOT NULL, + `payment_method` int(10) unsigned NOT NULL, + `payment_status` varchar(255) NOT NULL, + `capture` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_order`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) + return false; + + /* Set configuration */ + Configuration::updateValue('PAYPAL_SANDBOX', 1); + Configuration::updateValue('PAYPAL_BUSINESS', 'paypal@prestashop.com'); + Configuration::updateValue('PAYPAL_HEADER', ''); + Configuration::updateValue('PAYPAL_API_USER', ''); + Configuration::updateValue('PAYPAL_API_PASSWORD', ''); + Configuration::updateValue('PAYPAL_API_SIGNATURE', ''); + Configuration::updateValue('PAYPAL_EXPRESS_CHECKOUT', 0); + Configuration::updateValue('PAYPAL_CAPTURE', 0); + Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_INTEGRAL_); + Configuration::updateValue('PAYPAL_TEMPLATE', 'A'); + Configuration::updateValue('PAYPAL_NEW', 1); + Configuration::updateValue('PAYPAL_DEBUG_MODE', 0); + + if (!Configuration::get('PAYPAL_OS_AUTHORIZATION')) + { + $orderState = new OrderState(); + $orderState->name = array(); + foreach (Language::getLanguages() AS $language) + { + if (strtolower($language['iso_code']) == 'fr') + $orderState->name[$language['id_lang']] = 'Autorisation acceptée par PayPal'; + else + $orderState->name[$language['id_lang']] = 'Authorization accepted from PayPal'; + } + $orderState->send_email = false; + $orderState->color = '#DDEEFF'; + $orderState->hidden = false; + $orderState->delivery = false; + $orderState->logable = true; + $orderState->invoice = true; + if ($orderState->add()) + copy(dirname(__FILE__).'/../../img/os/'._PS_OS_PAYPAL_.'.gif', dirname(__FILE__).'/../../img/os/'.(int)($orderState->id).'.gif'); + Configuration::updateValue('PAYPAL_OS_AUTHORIZATION', (int)($orderState->id)); + } + + return true; + } + + public function uninstall() + { + /* Delete all configurations */ + Configuration::deleteByName('PAYPAL_SANDBOX'); + Configuration::deleteByName('PAYPAL_BUSINESS'); + Configuration::deleteByName('PAYPAL_HEADER'); + Configuration::deleteByName('PAYPAL_API_USER'); + Configuration::deleteByName('PAYPAL_API_PASSWORD'); + Configuration::deleteByName('PAYPAL_API_SIGNATURE'); + Configuration::deleteByName('PAYPAL_EXPRESS_CHECKOUT'); + Configuration::deleteByName('PAYPAL_PAYMENT_METHOD'); + Configuration::deleteByName('PAYPAL_TEMPLATE'); + Configuration::deleteByName('PAYPAL_CAPTURE'); + Configuration::deleteByName('PAYPAL_DEBUG_MODE'); + + return parent::uninstall(); + } + + public function getContent() + { + $this->_html .= '

        '.$this->l('PayPal').'

        '; + + $this->_postProcess(); + $this->_setPayPalSubscription(); + if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php')) + $this->_html .= '

        '.$this->l('Please do not use, and remove PayPalAPI module.').'

        '; + $this->_setConfigurationForm(); + + return $this->_html; + } + + public function hookPayment($params) + { + global $smarty; + + if (!$this->active) + return ; + /* + * PAYMENT METHOD: + * 0: Integral + * 1: Option + + * 2: Integral Evolution + */ + if (Configuration::get('PAYPAL_PAYMENT_METHOD') == _PAYPAL_INTEGRAL_EVOLUTION_) + return $this->display(__FILE__, 'integral_evolution/paypal.tpl'); + elseif (Configuration::get('PAYPAL_PAYMENT_METHOD') == _PAYPAL_INTEGRAL_ OR Configuration::get('PAYPAL_PAYMENT_METHOD') == _PAYPAL_OPTION_PLUS_) + { + if ($this->_isPayPalAPIAvailable()) + { + $smarty->assign('integral', (Configuration::get('PAYPAL_PAYMENT_METHOD') == 0 ? 1 : 0)); + $smarty->assign('logo', _MODULE_DIR_.$this->name.'/paypal.gif'); + return $this->display(__FILE__, 'payment/payment.tpl'); + } + else + return $this->display(__FILE__, 'standard/paypal.tpl'); + } + else + die($this->l('No valid payment method selected')); + } + + public function hookShoppingCartExtra($params) + { + global $cookie, $smarty; + + if (!$this->active) + return ; + + if (Configuration::get('PAYPAL_EXPRESS_CHECKOUT') AND !$cookie->isLogged(true) AND $this->_isPayPalAPIAvailable()) + { + $smarty->assign('logo', $this->getLogo(true)); + return $this->display(__FILE__, 'express/shopping_cart.tpl'); + } + } + + public function hookPaymentReturn($params) + { + if (!$this->active) + return ; + + return $this->display(__FILE__, 'confirmation.tpl'); + } + + public function hookRightColumn($params) + { + global $smarty, $cookie; + + $smarty->assign('iso_code', Tools::strtolower(Language::getIsoById($cookie->id_lang ? (int)($cookie->id_lang) : 1))); + $smarty->assign('logo', $this->getLogo(false, true)); + return $this->display(__FILE__, 'column.tpl'); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + public function hookBackBeforePayment($params) + { + if (!$this->active) + return ; + + /* Only execute if you use PayPal API for payment */ + if (Configuration::get('PAYPAL_PAYMENT_METHOD') != _PAYPAL_INTEGRAL_EVOLUTION_ AND $this->_isPayPalAPIAvailable()) + { + global $cookie; + + if ($params['module'] != $this->name) + return false; + if (!$token = $cookie->paypal_token) + return false; + if (!$payerID = $cookie->paypal_payer_id) + return false; + Tools::redirect('modules/paypal/express/submit.php?confirm=1&token='.$token.'&payerID='.$payerID); + } + } + + public function hookAdminOrder($params) + { + if (Tools::isSubmit('paypal')) + { + switch (Tools::getValue('paypal')) + { + case 'captureOk': + $message = $this->l('Funds have been recovered.'); + break; + case 'captureError': + $message = $this->l('Recovery of funds request unsuccessful. Please see log message!'); + break; + case 'validationOk': + $message = $this->l('Validation successful. Please see log message!'); + break; + case 'refundOk': + $message = $this->l('Refund has been made.'); + break; + case 'refundError': + $message = $this->l('Refund request unsuccessful. Please see log message!'); + break; + } + if (isset($message) AND $message) + $this->_html .= ' +
        +
        + '.$message.' +
        + '; + } + + if ($this->_needValidation((int)($params['id_order'])) AND $this->_isPayPalAPIAvailable()) + { + $this->_html .= ' +
        +
        + '.$this->l('PayPal Validation').' +

        '.$this->l('Information:').' '.(OrderHistory::getLastOrderState((int)($params['id_order']))->id == (int)(Configuration::get('PAYPAL_OS_AUTHORIZATION')) ? $this->l('Pending Capture - No shipping') : $this->l('Pending Payment - No shipping')).'

        +
        + +

        +
        + '; + $this->_postProcess(); + $this->_html .= '
        + '; + } + + if ($this->_needCapture((int)($params['id_order'])) AND $this->_isPayPalAPIAvailable()) + { + $this->_html .= ' +
        +
        + '.$this->l('PayPal Capture').' +

        '.$this->l('Information:').' '.$this->l('Funds ready to be captured before shipping.').'

        +
        + +

        +
        + '; + $this->_postProcess(); + $this->_html .= '
        + '; + } + + if ($this->_canRefund((int)($params['id_order'])) AND $this->_isPayPalAPIAvailable()) + { + $this->_html .= ' +
        +
        + '.$this->l('PayPal Refund').' +

        '.$this->l('Information:').' '.$this->l('Payment accepted').'

        +

        '.$this->l('Information:').' '.$this->l('When you refund a product, a partial refund is made unless you select "Generate a voucher".').'

        +
        + +

        +
        + '; + $this->_postProcess(); + $this->_html .= '
        + '; + } + + return $this->_html; + } + + public function hookCancelProduct($params) + { + if (Tools::isSubmit('generateDiscount')) + return false; + if (!$this->_isPayPalAPIAvailable()) + return false; + if ($params['order']->module != $this->name) + return false; + if (!($order = $params['order']) OR !Validate::isLoadedObject($order)) + return false; + if (!$order->hasBeenPaid()) + return false; + if (!($order_detail = new OrderDetail((int)($params['id_order_detail']))) OR !Validate::isLoadedObject($order_detail)) + return false; + + $id_transaction = $this->_getTransactionId((int)($order->id)); + if (!$id_transaction) + return false; + + $products = $order->getProducts(); + $amt = $products[(int)($order_detail->id)]['product_price_wt'] * (int)($_POST['cancelQuantity'][(int)($order_detail->id)]); + + $response = $this->_makeRefund($id_transaction, (float)($amt)); + $message = $this->l('Cancel products result:').'
        '; + foreach ($response AS $k => $value) + $message .= $k.': '.$value.'
        '; + $this->_addNewPrivateMessage((int)($order->id), $message); + } + + public function makePayPalAPIValidation($cookie, $cart, $id_currency, $payerID, $type) + { + global $cookie; + + if (!$this->active) + return ; + if (!$this->_isPayPalAPIAvailable()) + return ; + + // Filling-in vars + $id_cart = (int)($cart->id); + $currency = new Currency((int)($id_currency)); + $iso_currency = $currency->iso_code; + $token = $cookie->paypal_token; + $total = (float)($cart->getOrderTotal(true, Cart::BOTH)); + $paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale'; + $serverName = urlencode($_SERVER['SERVER_NAME']); + $bn = ($type == 'express' ? 'ECS' : 'ECM'); + $notifyURL = urlencode(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/paypal/ipn.php'); + + // Getting address + if (isset($cookie->id_cart) AND $cookie->id_cart) + $cart = new Cart((int)($cookie->id_cart)); + if (isset($cart->id_address_delivery) AND $cart->id_address_delivery) + $address = new Address((int)($cart->id_address_delivery)); + $requestAddress = ''; + if (Validate::isLoadedObject($address)) + { + $country = new Country((int)($address->id_country)); + $state = new State((int)($address->id_state)); + $requestAddress = '&SHIPTONAME='.urlencode($address->company.' '.$address->firstname.' '.$address->lastname).'&SHIPTOSTREET='.urlencode($address->address1.' '.$address->address2).'&SHIPTOCITY='.urlencode($address->city).'&SHIPTOSTATE='.urlencode($state->iso_code).'&SHIPTOCOUNTRYCODE='.urlencode($country->iso_code).'&SHIPTOZIP='.urlencode($address->postcode); + } + + // Making request + $request='&TOKEN='.urlencode($token).'&PAYERID='.urlencode($payerID).'&PAYMENTACTION='.$paymentType.'&AMT='.$total.'&CURRENCYCODE='.$iso_currency.'&IPADDRESS='.$serverName.'&NOTIFYURL='.$notifyURL.'&BUTTONSOURCE=PRESTASHOP_'.$bn.$requestAddress ; + + // Calling PayPal API + include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + $ppAPI = new PaypalLib(); + $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'DoExpressCheckoutPayment', $request); + $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); + + // Checking PayPal result + if (!is_array($result) OR !sizeof($result)) + $this->displayPayPalAPIError($this->l('Authorization to PayPal failed.'), $this->_logs); + elseif (!isset($result['ACK']) OR strtoupper($result['ACK']) != 'SUCCESS') + $this->displayPayPalAPIError($this->l('PayPal return error.'), $this->_logs); + elseif (!isset($result['TOKEN']) OR $result['TOKEN'] != $cookie->paypal_token) + { + $logs[] = ''.$ppExpress->l('Token given by PayPal is not the same as the cookie token', 'submit').''; + $ppExpress->displayPayPalAPIError($ppExpress->l('PayPal return error.', 'submit'), $logs); + } + + // Making log + $id_transaction = $result['TRANSACTIONID']; + if (Configuration::get('PAYPAL_CAPTURE')) + $this->_logs[] = $this->l('Authorization for deferred payment granted by PayPal.'); + else + $this->_logs[] = $this->l('Order finished with PayPal!'); + $message = Tools::htmlentitiesUTF8(strip_tags(implode("\n", $this->_logs))); + + // Order status + switch ($result['PAYMENTSTATUS']) + { + case 'Completed': + $id_order_state = _PS_OS_PAYMENT_; + break; + case 'Pending': + if ($result['PENDINGREASON'] != 'authorization') + $id_order_state = _PS_OS_PAYPAL_; + else + $id_order_state = (int)(Configuration::get('PAYPAL_OS_AUTHORIZATION')); + break; + default: + $id_order_state = _PS_OS_ERROR_; + } + + // Call payment validation method + $this->validateOrder($id_cart, $id_order_state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $this->displayName, $message, array('transaction_id' => $id_transaction, 'payment_status' => $result['PAYMENTSTATUS'], 'pending_reason' => $result['PENDINGREASON']), $id_currency, false, $cart->secure_key); + + // Clean cookie + unset($cookie->paypal_token); + + // Displaying output + $order = new Order((int)($this->currentOrder)); + Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)($id_cart).'&id_module='.(int)($this->id).'&id_order='.(int)($this->currentOrder).'&key='.$order->secure_key); + + } + + public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false) + { + if (!$this->active) + return ; + + parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key); + if (array_key_exists('transaction_id', $extraVars) AND array_key_exists('payment_status', $extraVars)) + $this->_saveTransaction($id_cart, $extraVars); + } + + public function getPayPalURL() + { + return 'www'.(Configuration::get('PAYPAL_SANDBOX') ? '.sandbox' : '').'.paypal.com'; + } + + public function getPaypalIntegralEvolutionUrl() + { + if (Configuration::get('PAYPAL_SANDBOX')) + return 'https://'.$this->getPayPalURL().'/cgi-bin/acquiringweb'; + return 'https://securepayments.paypal.com/acquiringweb?cmd=_hosted-payment'; + } + + public function getPaypalStandardUrl() + { + return 'https://'.$this->getPayPalURL().'/cgi-bin/webscr'; + } + + public function getAPIURL() + { + return 'api-3t'.(Configuration::get('PAYPAL_SANDBOX') ? '.sandbox' : '').'.paypal.com'; + } + + public function getAPIScript() + { + return '/nvp'; + } + + public function getL($key) + { + $translations = array( + 'mc_gross' => $this->l('Paypal key \'mc_gross\' not specified, can\'t control amount paid.'), + 'payment_status' => $this->l('Paypal key \'payment_status\' not specified, can\'t control payment validity'), + 'payment' => $this->l('Payment: '), + 'custom' => $this->l('Paypal key \'custom\' not specified, cannot relay to cart'), + 'txn_id' => $this->l('Paypal key \'txn_id\' not specified, transaction unknown'), + 'mc_currency' => $this->l('Paypal key \'mc_currency\' not specified, currency unknown'), + 'cart' => $this->l('Cart not found'), + 'order' => $this->l('Order has already been placed'), + 'transaction' => $this->l('Paypal Transaction ID: '), + 'verified' => $this->l('The PayPal transaction could not be VERIFIED.'), + 'connect' => $this->l('Problem connecting to the PayPal server.'), + 'nomethod' => $this->l('No communications transport available.'), + 'socketmethod' => $this->l('Verification failure (using fsockopen). Returned: '), + 'curlmethod' => $this->l('Verification failure (using cURL). Returned: '), + 'curlmethodfailed' => $this->l('Connection using cURL failed'), + 'Please wait, redirecting to Paypal... Thanks.' => $this->l('Please wait, redirecting to Paypal... Thanks.'), + 'Cancel' => $this->l('Cancel'), + 'My cart' => $this->l('My cart'), + 'Return to shop' => $this->l('Return to shop'), + 'Paypal error: (invalid or undefined business account e-mail)' => $this->l('Paypal error: (invalid or undefined business account e-mail)'), + 'Paypal error: (invalid address or customer)' => $this->l('Paypal error: (invalid address or customer)') + ); + return $translations[$key]; + } + + public function getLogo($ppExpress = false, $vertical = false) + { + global $cookie; + + if ($ppExpress) + { + $iso_code = Tools::strtoupper(Language::getIsoById($cookie->id_lang ? (int)($cookie->id_lang) : 1)); + $logo = array( + 'FR' => _MODULE_DIR_.$this->name.'/img/FR_pp_express.gif', + 'DE' => _MODULE_DIR_.$this->name.'/img/DE_pp_express.gif', + 'US' => _MODULE_DIR_.$this->name.'/img/US_pp_express.gif', + 'GB' => _MODULE_DIR_.$this->name.'/img/UK_pp_express.gif', + 'ES' => _MODULE_DIR_.$this->name.'/img/ES_pp_express.gif', + 'IT' => _MODULE_DIR_.$this->name.'/img/IT_pp_express.gif', + 'PL' => _MODULE_DIR_.$this->name.'/img/PL_pp_express.gif', + 'NL' => _MODULE_DIR_.$this->name.'/img/NL_pp_express.gif', + 'AU' => _MODULE_DIR_.$this->name.'/img/AU_pp_express.gif', + 'CA' => _MODULE_DIR_.$this->name.'/img/CA_pp_express.gif', + 'CN' => _MODULE_DIR_.$this->name.'/img/CN_pp_express.gif', + 'JP' => _MODULE_DIR_.$this->name.'/img/JP_pp_express.gif' + ); + if (isset($logo[$iso_code])) + return $logo[$iso_code]; + return $logo['US']; + } + + if (Configuration::get('PAYPAL_PAYMENT_METHOD') == _PAYPAL_INTEGRAL_) + { + $country_code = $this->getCountryCode(); + $logo = array( + 'FR' => _MODULE_DIR_.$this->name.'/img/FR_pp_integral.gif', + 'DE' => _MODULE_DIR_.$this->name.'/img/DE_pp_integral.gif', + 'US' => _MODULE_DIR_.$this->name.'/img/US_pp_integral.gif', + 'GB' => _MODULE_DIR_.$this->name.'/img/UK_pp_integral.gif', + 'ES' => _MODULE_DIR_.$this->name.'/img/ES_pp_integral.gif', + 'IT' => _MODULE_DIR_.$this->name.'/img/IT_pp_integral.gif', + 'PL' => _MODULE_DIR_.$this->name.'/img/PL_pp_integral.gif', + 'NL' => _MODULE_DIR_.$this->name.'/img/NL_pp_integral.gif', + 'AU' => _MODULE_DIR_.$this->name.'/img/AU_pp_integral.gif', + 'CA' => _MODULE_DIR_.$this->name.'/img/CA_pp_integral.gif', + 'CN' => _MODULE_DIR_.$this->name.'/img/CN_pp_integral.gif', + 'JP' => _MODULE_DIR_.$this->name.'/img/JP_pp_integral.gif', + 'FR_vertical' => _MODULE_DIR_.$this->name.'/img/vertical_FR_large.png', + 'US_vertical' => _MODULE_DIR_.$this->name.'/img/vertical_US_large.png' + ); + if (isset($logo[$country_code.($vertical ? '_vertical' : '')])) + return $logo[$country_code.($vertical ? '_vertical' : '')]; + return ($vertical ? $logo['US_vertical'] : $logo['US']); + } + elseif (Configuration::get('PAYPAL_PAYMENT_METHOD') == _PAYPAL_INTEGRAL_EVOLUTION_) + return _MODULE_DIR_.$this->name.'/img/integral_evolution'.($vertical ? '_vertical' : '').'.png'; + else + return _MODULE_DIR_.$this->name.'/img/PayPal_mark_60x38.gif'; + } + + public function getCountryCode() + { + global $cookie; + + $cart = new Cart((int)($cookie->id_cart)); + $address = new Address((int)($cart->id_address_invoice)); + $country = new Country((int)($address->id_country)); + return $country->iso_code; + } + + public function displayPayPalAPIError($message, $log = false) + { + global $cookie, $smarty; + + $send = true; + // Sanitinize log + foreach ($log AS $key => $string) + if ($string == 'ACK -> Success') + $send = false; + elseif (substr($string, 0, 6) == 'METHOD') + { + $values = explode('&', $string); + foreach ($values AS $key2 => $value) + { + $values2 = explode('=', $value); + foreach ($values2 AS $key3 => $value2) + if ($value2 == 'PWD' || $value2 == 'SIGNATURE') + $values2[$key3 + 1] = '*********'; + $values[$key2] = implode('=', $values2); + } + $log[$key] = implode('&', $values); + } + + include(dirname(__FILE__).'/../../header.php'); + $smarty->assign('message', $message); + $smarty->assign('logs', $log); + $data = array('{logs}' => implode('
        ', $log)); + if ($send) + Mail::Send((int)($cookie->id_lang), 'error_reporting', Mail::l('Error reporting from your PayPal module'), $data, Configuration::get('PS_SHOP_EMAIL'), NULL, NULL, NULL, NULL, NULL, _PS_MODULE_DIR_.$this->name.'/mails/'); + echo $this->display(__FILE__, 'error.tpl'); + include_once(dirname(__FILE__).'/../../footer.php'); + die ; + } + + private function _saveTransaction($id_cart, $extraVars) + { + $cart = new Cart((int)($id_cart)); + if (Validate::isLoadedObject($cart) AND $cart->OrderExists()) + { + $id_order = Db::getInstance()->getValue(' + SELECT `id_order` + FROM `'._DB_PREFIX_.'orders` + WHERE `id_cart` = '.(int)($cart->id)); + + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'paypal_order` (`id_order`, `id_transaction`, `payment_method`, `payment_status`, `capture`) + VALUES ('.(int)($id_order).', \''.pSQL($extraVars['transaction_id']).'\', '.(int)(Configuration::get('PAYPAL_PAYMENT_METHOD')).', \''.pSQL($extraVars['payment_status']).((isset($extraVars['pending_reason']) AND $extraVars['pending_reason'] == 'authorization') ? '_authorization' : '').'\', '.(int)(Configuration::get('PAYPAL_CAPTURE')).')'); + } + } + + private function _canRefund($id_order) + { + if (!(int)($id_order)) + return false; + $paypal_order = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_order` = '.(int)($id_order)); + if (!is_array($paypal_order) OR !sizeof($paypal_order)) + return false; + if ($paypal_order['payment_status'] != 'Completed' OR $paypal_order['capture'] != 0) + return false; + return true; + } + + private function _needValidation($id_order) + { + if (!(int)($id_order)) + return false; + $order = Db::getInstance()->getRow(' + SELECT `payment_method`, `payment_status` + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_order` = '.(int)($id_order)); + if (!$order) + return false; + return $order['payment_status'] == 'Pending' AND $order['payment_method'] == _PAYPAL_INTEGRAL_EVOLUTION_; + } + + private function _needCapture($id_order) + { + if (!(int)($id_order)) + return false; + $result = Db::getInstance()->getRow(' + SELECT `payment_method`, `payment_status`, `capture` + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_order` = '.(int)($id_order).' AND `capture` = 1'); + if (!isset($result['payment_method'])) + return false; + if ($result['payment_status'] != 'Pending_authorization' AND $result['payment_status'] != 'Completed') + return false; + return true; + } + + private function _setConfigurationForm() + { + $this->_html .= ' +
        + + + + +
        +
        +

        '.$this->l('Solution').'

        + '.$this->_getSolutionTabHtml().' +
        +
        +

        '.$this->l('Settings').'

        + '.$this->_getSettingsTabHtml().' +
        +
        +

        '.$this->l('Logos and personalization').'

        + '.$this->_getPersonalizationsTabHtml().' +
        +
        +
        + +
        '; + } + + private function _getSolutionTabHtml() + { + $paymentMethod = (int)(Tools::getValue('payment_method', Configuration::get('PAYPAL_PAYMENT_METHOD'))); + $paypalExpress = (int)(Tools::isSubmit('paypal_express') ? 1 : Configuration::get('PAYPAL_EXPRESS_CHECKOUT')); + $paypalDebug = (int)(Tools::isSubmit('paypal_debug') ? 1 : Configuration::get('PAYPAL_DEBUG_MODE')); + + return ' +

        '.$this->l('Solution').'

        +

        '.$this->l('Choose a solution:').'

        +
          +
        • +
        • * '.$this->l('(PayPal Integral Evolution, monthly subscription)').'
        • +
        • +
        +

        * '.$this->l('Activation subject to conditions').', '.$this->l('click here to subscribe').'

        +

        '.$this->l('Option:').'

        +
          +
        • +
        • +
        +

        +
        + '.$this->l('Important:').' + '.$this->l('To use any PayPal solution, you need to set up API parameters in the « Settings » Tab').' +
        '; + } + + private function _getSettingsTabHtml() + { + global $cookie; + + $lang = new Language((int)($cookie->id_lang)); + $sandboxMode = (int)(Tools::getValue('sandbox_mode', Configuration::get('PAYPAL_SANDBOX'))); + $paypalCapture = (int)(Tools::getValue('paypal_capture', Configuration::get('PAYPAL_CAPTURE'))); + + $html = ' +

        '.$this->l('Settings').'

        + +
        + + +
        +
        + +
        + + +
        + +
        + +
        +
        +

        '.$this->l('Activation of API calls').'

        + +
        + +
        +
        + +
        + +

        '.$this->l('Leave blank if the password has not changed').'

        +
        + +
        + +
        + '; + if ($lang->iso_code == 'fr') + $html .= '

        '.$this->l('Click here to learn how to generate your API username, password and signature.').'

        '; + elseif ($lang->iso_code == 'es') + $html .= '

        '.$this->l('Click here to learn how to generate your API username, password and signature.').'

        '; + else + $html .= '

        '.$this->l('Click here to learn how to generate your API username, password and signature.').'

        '; + $html .= '

        '; + + return $html; + } + + private function _getPersonalizationsTabHtml() + { + global $cookie; + + $lang = new Language((int)($cookie->id_lang)); + $template_paypal = Tools::getValue('template_paypal', Configuration::get('PAYPAL_TEMPLATE')); + + return ' +

        '.$this->l('Logos and personalizations').'

        + +
        + +

        '.$this->l('The image should be hosted on a secure (https) server. Max: 750x90px.').'

        +
        + +
        + + + +
        + '.($lang->iso_code == 'fr' ? '

        '.$this->l('Click here to learn how to customize these templates').'

        ' : '').' +

        '; + } + + private function _setPayPalSubscription() + { + $this->_html .= ' +
        +

        '.$this->l('Opening your PayPal account').'

        +
        +

        '.$this->l('When opening your PayPal account by clicking on the following image, you are helping us significantly to improve the PrestaShop software:').'

        +

        PrestaShop & PayPal

        +
        +
        + + '.$this->l('This module allows you to accept payments by PayPal.').'

        + '.$this->l('If the client chooses this payment mode, your PayPal account will be automatically credited.').'
        + '.$this->l('You need to configure your PayPal account before using this module.').' +
         
        '; + } + + private function _postProcess() + { + global $currentIndex, $cookie; + + if (Tools::isSubmit('submitPayPal')) + { + $template_available = array('A', 'B', 'C'); + if (!Validate::isUnsignedInt(Tools::getValue('payment_method')) OR (int)(Tools::getValue('payment_method')) > 2) + $this->_errors[] = $this->l('Invalid solution'); + if (Tools::getValue('email_paypal') == NULL AND Tools::getValue('api_username') == NULL AND Tools::getValue('api_signature') == NULL) + $this->_errors[] = $this->l('Indicate account information.'); + if (Tools::getValue('email_paypal') != NULL AND !Validate::isEmail(Tools::getValue('email_paypal'))) + $this->_errors[] = $this->l('E-mail invalid'); + if (Tools::getValue('banner_url') != NULL AND !Validate::isUrl(Tools::getValue('banner_url'))) + $this->_errors[] = $this->l('URL for banner is invalid'); + elseif (Tools::getValue('banner_url') != NULL AND strpos(Tools::getValue('banner_url'), 'https://') === false) + $this->_errors[] = $this->l('URL for banner must use HTTPS protocol'); + if (!in_array(Tools::getValue('template_paypal'), $template_available)) + $this->_errors[] = $this->l('PayPal template invalid.'); + if (Tools::getValue('paypal_capture') == 1 AND (Tools::getValue('api_username') == NULL OR Tools::getValue('api_signature') == NULL)) + $this->_errors[] = $this->l('Cannot use Authorization / capture without API Credentials.'); + if (Tools::getValue('payment_method') == _PAYPAL_INTEGRAL_EVOLUTION_ AND (Tools::getValue('api_username') == NULL OR Tools::getValue('api_signature') == NULL)) + $this->_errors[] = $this->l('Cannot use this solution without API Credentials.'); + if (Tools::isSubmit('paypal_express') AND (Tools::getValue('api_username') == NULL OR Tools::getValue('api_signature') == NULL)) + $this->_errors[] = $this->l('Cannot use PayPal Express without API Credentials.'); + + if (!sizeof($this->_errors)) + { + Configuration::updateValue('PAYPAL_SANDBOX', (int)(Tools::getValue('sandbox_mode'))); + Configuration::updateValue('PAYPAL_BUSINESS', trim(Tools::getValue('email_paypal'))); + Configuration::updateValue('PAYPAL_HEADER', Tools::getValue('banner_url')); + Configuration::updateValue('PAYPAL_API_USER', trim(Tools::getValue('api_username'))); + Configuration::updateValue('PAYPAL_API_PASSWORD', Tools::getValue('api_password')); + Configuration::updateValue('PAYPAL_API_SIGNATURE', trim(Tools::getValue('api_signature'))); + Configuration::updateValue('PAYPAL_EXPRESS_CHECKOUT', (int)(Tools::isSubmit('paypal_express'))); + Configuration::updateValue('PAYPAL_MODE_DEBUG', (int)(Tools::isSubmit('paypal_debug'))); + Configuration::updateValue('PAYPAL_CAPTURE', (int)(Tools::getValue('paypal_capture'))); + Configuration::updateValue('PAYPAL_PAYMENT_METHOD', (int)(Tools::getValue('payment_method'))); + Configuration::updateValue('PAYPAL_TEMPLATE', Tools::getValue('template_paypal')); + if (Tools::getValue('payment_method') == _PAYPAL_INTEGRAL_EVOLUTION_) + $method = 'Paypal Integrale Evolution'; + elseif (Tools::getValue('payment_method') == _PAYPAL_INTEGRAL_) + $method = 'Paypal Integrale'; + elseif (Tools::getValue('payment_method') == _PAYPAL_OPTION_PLUS_) + $method = 'Paypal Integrale'; + else + $method = ''; + $this->_html = $this->displayConfirmation($this->l('Settings updated').''); + } + else + { + $error_msg = ''; + foreach ($this->_errors AS $error) + $error_msg .= $error.'
        '; + $this->_html = $this->displayError($error_msg); + } + } + + if (Tools::isSubmit('submitPayPalValidation')) + { + if (!($response = $this->_updatePaymentStatusOfOrder((int)(Tools::getValue('id_order')))) OR !sizeof($response)) + $this->_html .= '

        '.$this->l('Error obtaining payment status.').'

        '; + else + { + if ($response['ACK'] == 'Success') + { + if ($response['PAYMENTSTATUS'] == 'Completed' OR $response['PAYMENTSTATUS'] == 'Reversed' OR ($response['PAYMENTSTATUS'] == 'Pending' AND $response['PENDINGREASON'] == 'authorization')) + Tools::redirectAdmin($currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=validationOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + else + $this->_html .= '

        '.$this->l('Status').': '.$response['PAYMENTSTATUS'].' ('.$this->l('Reason:').' '.$response['PENDINGREASON'].')

        '; + } + else + $this->_html .= '

        '.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')

        '; + } + } + + if (Tools::isSubmit('submitPayPalCapture')) + { + if (!($response = $this->_doCapture((int)(Tools::getValue('id_order')))) OR !sizeof($response)) + $this->_html .= '

        '.$this->l('Error when making capture request').'

        '; + else + { + if ($response['ACK'] == 'Success') + { + if ($response['PAYMENTSTATUS'] == 'Completed') + Tools::redirectAdmin($currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + else + Tools::redirectAdmin($currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + } + else + $this->_html .= '

        '.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')

        '; + } + } + + if (Tools::isSubmit('submitPayPalRefund')) + { + if (!($response = $this->_doTotalRefund((int)(Tools::getValue('id_order')))) OR !sizeof($response)) + $this->_html .= '

        '.$this->l('Error when making refund request').'

        '; + else + { + if ($response['ACK'] == 'Success') + { + if ($response['REFUNDTRANSACTIONID'] != '') + Tools::redirectAdmin($currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + else + Tools::redirectAdmin($currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + } + else + $this->_html .= '

        '.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')

        '; + } + } + } + + private function _getTransactionId($id_order) + { + if (!$id_order) + return false; + + return Db::getInstance()->getValue(' + SELECT `id_transaction` + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_order` = '.(int)($id_order)); + } + + private function _makeRefund($id_transaction, $amt = false) + { + include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + + if (!$this->_isPayPalAPIAvailable()) + die(Tools::displayError('Fatal Error: no API Credentials are available')); + if (!$id_transaction) + die(Tools::displayError('Fatal Error: id_transaction is null')); + + if (!$amt) + $request = '&TRANSACTIONID='.urlencode($id_transaction).'&REFUNDTYPE=Full'; + else + { + $isoCurrency = Db::getInstance()->getValue(' + SELECT `iso_code` + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'currency` c ON (o.`id_currency` = c.`id_currency`)'); + $request = '&TRANSACTIONID='.urlencode($id_transaction).'&REFUNDTYPE=Partial&AMT='.(float)($amt).'&CURRENCYCODE='.urlencode(strtoupper($isoCurrency)); + } + $paypalLib = new PaypalLib(); + return $paypalLib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'RefundTransaction', $request); + } + + private function _addNewPrivateMessage($id_order, $message) + { + if (!$id_order) + return false; + $msg = new Message(); + $message = strip_tags($message, '
        '); + if (!Validate::isCleanHtml($message)) + $message = $this->l('Payment message is not valid, please check your module.'); + $msg->message = $message; + $msg->id_order = (int)($id_order); + $msg->private = 1; + + return $msg->add(); + } + + private function _doTotalRefund($id_order) + { + global $cookie; + + if (!$this->_isPayPalAPIAvailable()) + return false; + if (!$id_order) + return false; + + $id_transaction = $this->_getTransactionId((int)($id_order)); + if (!$id_transaction) + return false; + + $order = new Order((int)($id_order)); + if (!Validate::isLoadedObject($order)) + return false; + $products = $order->getProducts(); + // Amount for refund + $amt = 0.00; + foreach ($products AS $product) + if ($product['product_quantity_refunded'] == 0) + $amt += (float)($product['total_price']); + $amt += (float)($order->total_shipping); + // check if total or partial + if ($order->total_products_wt == $amt) + $response = $this->_makeRefund($id_transaction); + else + $response = $this->_makeRefund($id_transaction, (float)($amt)); + $message = $this->l('Refund operation result:').'
        '; + foreach ($response AS $k => $value) + $message .= $k.': '.$value.'
        '; + if (array_key_exists('ACK', $response) AND $response['ACK'] == 'Success' AND $response['REFUNDTRANSACTIONID'] != '') + { + $message .= $this->l('PayPal refund successful!'); + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'paypal_order` SET `payment_status` = \'Refunded\' WHERE `id_order` = '.(int)($id_order))) + die(Tools::displayError('Error when updating PayPal database')); + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState(_PS_OS_REFUND_, (int)($id_order)); + $history->addWithemail(); + } + else + $message .= $this->l('Transaction error!'); + $this->_addNewPrivateMessage((int)($id_order), $message); + + return $response; + } + + private function _doCapture($id_order) + { + global $cookie; + + include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + + if (!$this->_isPayPalAPIAvailable()) + return false; + if (!$id_order) + return false; + + $id_transaction = $this->_getTransactionId((int)($id_order)); + if (!$id_transaction) + return false; + + $order = new Order((int)($id_order)); + $currency = new Currency((int)($order->id_currency)); + $request = '&AUTHORIZATIONID='.urlencode($id_transaction).'&AMT='.(float)($order->total_paid).'&CURRENCYCODE='.$currency->iso_code.'&COMPLETETYPE=Complete'; + $paypalLib = new PaypalLib(); + $response = $paypalLib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'DoCapture', $request); + $message = $this->l('Capture operation result:').'
        '; + foreach ($response AS $k => $value) + $message .= $k.': '.$value.'
        '; + if (array_key_exists('ACK', $response) AND $response['ACK'] == 'Success' AND $response['PAYMENTSTATUS'] == 'Completed') + { + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState(_PS_OS_PAYMENT_, (int)($id_order)); + $history->addWithemail(); + $message .= $this->l('Order finished with PayPal!'); + } + elseif (isset($response['PAYMENTSTATUS'])) + $message .= $this->l('Transaction error!'); + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'paypal_order` SET `capture` = 0, `payment_status` = \''.pSQL($response['PAYMENTSTATUS']).'\', `id_transaction` = \''.pSQL($response['TRANSACTIONID']).'\' WHERE `id_order` = '.(int)($id_order))) + die(Tools::displayError('Error when updating PayPal database')); + $this->_addNewPrivateMessage((int)($id_order), $message); + + return $response; + } + + private function _updatePaymentStatusOfOrder($id_order) + { + global $cookie; + + include_once(_PS_MODULE_DIR_.'paypal/api/paypallib.php'); + + if (!$this->_isPayPalAPIAvailable()) + return false; + if (!$id_order) + return false; + + $id_transaction = $this->_getTransactionId((int)($id_order)); + if (!$id_transaction) + return false; + + $request = '&TRANSACTIONID='.urlencode($id_transaction); + $paypalLib = new PaypalLib(); + $response = $paypalLib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetTransactionDetails', $request); + if (array_key_exists('ACK', $response)) + { + if ($response['ACK'] == 'Success') + { + if (isset($response['PAYMENTSTATUS'])) + { + if ($response['PAYMENTSTATUS'] == 'Completed') + { + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState(_PS_OS_PAYMENT_, (int)($id_order)); + $history->addWithemail(); + } + elseif ($response['PAYMENTSTATUS'] == 'Pending' AND $response['PENDINGREASON'] == 'authorization') + { + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState((int)(Configuration::get('PAYPAL_OS_AUTHORIZATION')), (int)($id_order)); + $history->addWithemail(); + } + elseif ($response['PAYMENTSTATUS'] == 'Reversed') + { + $history = new OrderHistory(); + $history->id_order = (int)($id_order); + $history->changeIdOrderState(_PS_OS_ERROR_, (int)($id_order)); + $history->addWithemail(); + } + if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'paypal_order` SET `payment_status` = \''.pSQL($response['PAYMENTSTATUS']).($response['PENDINGREASON'] == 'authorization' ? '_authorization' : '').'\' WHERE `id_order` = '.(int)($id_order))) + die(Tools::displayError('Error when updating PayPal database')); + } + } + $message = $this->l('Verification status:').'
        '; + foreach ($response AS $k => $value) + $message .= $k.': '.$value.'
        '; + $this->_addNewPrivateMessage((int)($id_order), $message); + return $response; + } + return false; + } + + private function _isPayPalAPIAvailable() + { + if (Configuration::get('PAYPAL_API_USER') != NULL AND Configuration::get('PAYPAL_API_PASSWORD') != NULL AND Configuration::get('PAYPAL_API_SIGNATURE') != NULL) + return true; + return false; + } + + private function _checkAndUpdateFromOldVersion($install = false) + { + if (!Configuration::get('PAYPAL_NEW') AND ($this->active OR $install)) + { + $ok = true; + /* Check PayPal API */ + if (file_exists(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php')) + { + $confs = Configuration::getMultiple(array('PAYPAL_HEADER', 'PAYPAL_SANDBOX', 'PAYPAL_API_USER', 'PAYPAL_API_PASSWORD', 'PAYPAL_API_SIGNATURE', 'PAYPAL_EXPRESS_CHECKOUT')); + include_once(_PS_ROOT_DIR_.'/modules/paypalapi/paypalapi.php'); + $paypalapi = new PayPalAPI(); + if ($paypalapi->active) + { + if (Configuration::get('PAYPAL_INTEGRAL') == 1) + Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_INTEGRAL_); + elseif (Configuration::get('PAYPAL_INTEGRAL') == 0) + Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_OPTION_PLUS_); + $paypalapi->uninstall(); + Configuration::loadConfiguration(); + foreach ($confs AS $key => $value) + Configuration::updateValue($key, $value); + } + } + /* Create Table */ + if (!Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'paypal_order` ( + `id_order` int(10) unsigned NOT NULL auto_increment, + `id_transaction` varchar(255) NOT NULL, + PRIMARY KEY (`id_order`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) + $ok = false; + if (!Db::getInstance()->Execute(' + ALTER TABLE `'._DB_PREFIX_.'paypal_order` ADD `payment_method` INT NOT NULL, + ADD `payment_status` VARCHAR(255) NOT NULL, + ADD `capture` INT NOT NULL')) + $ok = false; + + /* Hook */ + $this->registerHook('cancelProduct'); + $this->registerHook('adminOrder'); + + /* Create OrderState */ + if (!Configuration::get('PAYPAL_OS_AUTHORIZATION')) + { + $orderState = new OrderState(); + $orderState->name = array(); + foreach (Language::getLanguages() AS $language) + { + if (strtolower($language['iso_code']) == 'fr') + $orderState->name[$language['id_lang']] = 'Autorisation acceptée par PayPal'; + else + $orderState->name[$language['id_lang']] = 'Authorization accepted from PayPal'; + } + $orderState->send_email = false; + $orderState->color = '#DDEEFF'; + $orderState->hidden = false; + $orderState->delivery = false; + $orderState->logable = true; + $orderState->invoice = true; + if ($orderState->add()) + copy(_PS_ROOT_DIR_.'/img/os/'._PS_OS_PAYPAL_.'.gif', _PS_ROOT_DIR_.'/img/os/'.(int)($orderState->id).'.gif'); + Configuration::updateValue('PAYPAL_OS_AUTHORIZATION', (int)($orderState->id)); + } + /* Delete unseless configuration */ + Configuration::deleteByName('PAYPAL_INTEGRAL'); + + /* Add new Configurations */ + if (!Configuration::get('PAYPAL_PAYMENT_METHOD')) + Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_INTEGRAL_); + Configuration::updateValue('PAYPAL_CAPTURE', 0); + Configuration::updateValue('PAYPAL_TEMPLATE', 'A'); + + if ($ok) + Configuration::updateValue('PAYPAL_NEW', 1); + + return $ok; + } + return false; + } + + public function getOrder($id_transaction) + { + return Db::getInstance()->getValue(' + SELECT `id_order` + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_transaction` = \''.pSQL($id_transaction).'\' + '); + } +} diff --git a/modules/paypal/prestashop_paypal.png b/modules/paypal/prestashop_paypal.png new file mode 100644 index 000000000..056113990 Binary files /dev/null and b/modules/paypal/prestashop_paypal.png differ diff --git a/modules/paypal/standard/paypal.tpl b/modules/paypal/standard/paypal.tpl new file mode 100644 index 000000000..7184b5a75 --- /dev/null +++ b/modules/paypal/standard/paypal.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + {l s='Pay with PayPal' mod='paypal'} + {l s='Pay with PayPal' mod='paypal'} + +

        diff --git a/modules/paypal/standard/redirect.php b/modules/paypal/standard/redirect.php new file mode 100644 index 000000000..2cea6f638 --- /dev/null +++ b/modules/paypal/standard/redirect.php @@ -0,0 +1,89 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../../config/config.inc.php'); +include(dirname(__FILE__).'/../../../init.php'); +include(dirname(__FILE__).'/../paypal.php'); + +$paypal = new Paypal(); +$cart = new Cart((int)($cookie->id_cart)); + +$address = new Address((int)($cart->id_address_delivery)); +$country = new Country((int)($address->id_country)); +$state = NULL; +if ($address->id_state) + $state = new State((int)($address->id_state)); +$customer = new Customer((int)($cart->id_customer)); +$business = Configuration::get('PAYPAL_BUSINESS'); +$header = Configuration::get('PAYPAL_HEADER'); +$currency_order = new Currency((int)($cart->id_currency)); +$currency_module = $paypal->getCurrency((int)($cart->id_currency)); + +if (empty($business) OR !Validate::isEmail($business)) + die($paypal->getL('Paypal error: (invalid or undefined business account email)')); + +if (!Validate::isLoadedObject($address) OR !Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($currency_module)) + die($paypal->getL('Paypal error: (invalid address or customer)')); + +// check currency of payment +if ($currency_order->id != $currency_module->id) +{ + $cookie->id_currency = $currency_module->id; + $cart->id_currency = $currency_module->id; + $cart->update(); +} + +$smarty->assign(array( + 'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'), + 'cancel_text' => $paypal->getL('Cancel'), + 'cart_text' => $paypal->getL('My cart'), + 'return_text' => $paypal->getL('Return to shop'), + 'paypal_url' => $paypal->getPaypalStandardUrl(), + 'address' => $address, + 'country' => $country, + 'state' => $state, + 'amount' => (float)($cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)), + 'customer' => $customer, + 'total' => (float)($cart->getOrderTotal(true, Cart::BOTH)), + 'shipping' => Tools::ps_round((float)($cart->getOrderShippingCost()) + (float)($cart->getOrderTotal(true, Cart::ONLY_WRAPPING)), 2), + 'discount' => $cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS), + 'business' => $business, + 'currency_module' => $currency_module, + 'cart_id' => (int)($cart->id).'_'.pSQL($cart->secure_key), + 'products' => $cart->getProducts(), + 'paypal_id' => (int)($paypal->id), + 'header' => $header, + 'url' => Tools::getShopDomain(true, true).__PS_BASE_URI__ +)); + + +if (is_file(_PS_THEME_DIR_.'modules/paypal/standard/redirect.tpl')) + $smarty->display(_PS_THEME_DIR_.'modules/'.$paypal->name.'/standard/redirect.tpl'); +else + $smarty->display(_PS_MODULE_DIR_.$paypal->name.'/standard/redirect.tpl'); + + diff --git a/modules/paypal/standard/redirect.tpl b/modules/paypal/standard/redirect.tpl new file mode 100644 index 000000000..7e7d7af67 --- /dev/null +++ b/modules/paypal/standard/redirect.tpl @@ -0,0 +1,90 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + PayPal + + + +

        {$redirect_text}
        {$cancel_text}

        + + + + diff --git a/modules/paypal/validation.php b/modules/paypal/validation.php new file mode 100644 index 000000000..174b20b81 --- /dev/null +++ b/modules/paypal/validation.php @@ -0,0 +1,139 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/paypal.php'); + +$errors = ''; +$result = false; +$paypal = new Paypal(); + +// Fill params +$params = 'cmd=_notify-validate'; +foreach ($_POST AS $key => $value) + $params .= '&'.$key.'='.urlencode(stripslashes($value)); + +// PayPal Server +$paypalServer = 'www.'.(Configuration::get('PAYPAL_SANDBOX') ? 'sandbox.' : '').'paypal.com'; + +// Getting PayPal data... +if (function_exists('curl_exec')) +{ + // curl ready + $ch = curl_init('https://' . $paypalServer . '/cgi-bin/webscr'); + + // If the above fails, then try the url with a trailing slash (fixes problems on some servers) + if (!$ch) + $ch = curl_init('https://' . $paypalServer . '/cgi-bin/webscr/'); + + if (!$ch) + $errors .= $paypal->getL('connect').' '.$paypal->getL('curlmethodfailed'); + else + { + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $params); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_TIMEOUT, 30); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + + $result = curl_exec($ch); + + if (strtoupper($result) != 'VERIFIED') + $errors .= $paypal->getL('curlmethod').$result.' cURL error:'.curl_error($ch); + curl_close($ch); + } +} +elseif (($fp = @fsockopen('ssl://' . $paypalServer, 443, $errno, $errstr, 30)) || ($fp = @fsockopen($paypalServer, 80, $errno, $errstr, 30))) +{ + // fsockopen ready + $header = 'POST /cgi-bin/webscr HTTP/1.0'."\r\n" . + 'Host: '.$paypalServer."\r\n". + 'Content-Type: application/x-www-form-urlencoded'."\r\n". + 'Content-Length: '.Tools::strlen($params)."\r\n". + 'Connection: close'."\r\n\r\n"; + fputs($fp, $header.$params); + + $read = ''; + while (!feof($fp)) + { + $reading = trim(fgets($fp, 1024)); + $read .= $reading; + if (strtoupper($reading) == 'VERIFIED' OR strtoupper($reading) == 'INVALID') + { + $result = $reading; + break; + } + } + if (strtoupper($result) != 'VERIFIED') + $errors .= $paypal->getL('socketmethod').$result; + fclose($fp); +} +else + $errors = $paypal->getL('connect').$paypal->getL('nomethod'); + +if (isset($_POST['custom'])) + $cart_secure = explode('_', $_POST['custom']); +else + $cart_secure = array(); + +// Printing errors... +if (strtoupper($result) == 'VERIFIED') +{ + if (!isset($_POST['mc_gross'])) + $errors .= $paypal->getL('mc_gross').'
        '; + if (!isset($_POST['payment_status'])) + $errors .= $paypal->getL('payment_status').'
        '; + elseif (strtoupper($_POST['payment_status']) != 'COMPLETED') + $errors .= $paypal->getL('payment').$_POST['payment_status'].'
        '; + if (!isset($_POST['custom'])) + $errors .= $paypal->getL('custom').'
        '; + if (!isset($_POST['txn_id'])) + $errors .= $paypal->getL('txn_id').'
        '; + if (!isset($_POST['mc_currency'])) + $errors .= $paypal->getL('mc_currency').'
        '; + if (empty($errors)) + { + $cart = new Cart((int)($cart_secure[0])); + if (!$cart->id) + $errors = $paypal->getL('cart').'
        '; + elseif (Order::getOrderByCartId((int)($cart_secure[0]))) + $errors = $paypal->getL('order').'
        '; + else + $paypal->validateOrder((int)$cart_secure[0], _PS_OS_PAYMENT_, (float)($_POST['mc_gross']), $paypal->displayName, $paypal->getL('transaction').$_POST['txn_id'], array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), NULL, false, $cart_secure[1]); + } +} +else + $errors .= $paypal->getL('verified'); + +if (!empty($errors) AND isset($_POST['custom'])) +{ + if (strtoupper($_POST['payment_status']) == 'PENDING') + $paypal->validateOrder((int)$cart_secure[0], _PS_OS_PAYPAL_, (float)($_POST['mc_gross']), $paypal->displayName, $paypal->getL('transaction').$_POST['txn_id'].'
        '.$errors, array('transaction_id' => $_POST['txn_id'], 'payment_status' => $_POST['payment_status']), NULL, false, $cart_secure[1]); + else + $paypal->validateOrder((int)$cart_secure[0], _PS_OS_ERROR_, 0, $paypal->displayName, $errors.'
        ', array(), NULL, false, $cart_secure[1]); +} diff --git a/modules/paysafecard/Disposition.php b/modules/paysafecard/Disposition.php new file mode 100644 index 000000000..bf0dd2ced --- /dev/null +++ b/modules/paysafecard/Disposition.php @@ -0,0 +1,82 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Disposition +{ + const TABLE_NAME = 'disposition'; + + public static function create($id_cart, $mtid, $amount, $currency) + { + return Db::getInstance()->Execute( + 'INSERT INTO `'._DB_PREFIX_.self::TABLE_NAME.'` (`id_cart`, `mtid`, `amount`, `currency`) + VALUES ('.(int)($id_cart).',\''.pSQL($mtid).'\','.(float)($amount).',\''.pSQL($currency).'\')'); + } + + public static function delete($id) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_disposition` = '.(int)($id)); + } + + public static function deleteByCartId($id_cart) + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_cart` = '.(int)($id_cart)); + } + + public static function getByCartId($id_cart) + { + return Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_cart` = '.(int)($id_cart)); + } + + public static function createTable() + { + return Db::getInstance()->Execute( + 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'` ( + `id_disposition` int(11) NOT NULL AUTO_INCREMENT, + `id_cart` int(11) NOT NULL, + `mtid` varchar(20) NOT NULL, + `amount` float NOT NULL, + `currency` varchar(3) NOT NULL, + PRIMARY KEY (`id_disposition`), + UNIQUE KEY `id_cart` (`id_cart`) + ) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + } + + public static function dropTable() + { + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } + + public static function updateAmount($id_disposition, $amount) + { + return Db::getInstance()->Execute( + 'UPDATE `'._DB_PREFIX_.self::TABLE_NAME.'` SET `amount` = `amount` - '.(float)($amount).' WHERE `id_disposition` = '.(int)($id_disposition)); + } + + +} + + diff --git a/modules/paysafecard/PrepaidServices.php b/modules/paysafecard/PrepaidServices.php new file mode 100644 index 000000000..2e23a58bd --- /dev/null +++ b/modules/paysafecard/PrepaidServices.php @@ -0,0 +1,663 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +$module_name = 'paysafecard'; + +include(_PS_MODULE_DIR_.'/'.$module_name.'/Disposition.php'); +include(_PS_MODULE_DIR_.'/'.$module_name.'/PrepaidServicesAPI.php'); + +abstract class PrepaidServices extends PaymentModule +{ + protected $max_amount = 1000; + protected $max_amount_currency = 'EUR'; + protected $default_language = 'en'; + + protected $prefix = ''; + + protected $environments = array('P' => 'Production', + 'T' => 'Test'); + + protected $business_types = array('I' => 'Intangible', + 'T' => 'Tangible'); + + // abstract + protected $supported_languages; + protected $allowed_currencies; + protected $supported_currencies; + protected $payment_url; + protected $prepaid_api_configuration; + protected $register_url; + + public function __construct() + { + parent::__construct(); + + if ($this->active AND !extension_loaded('curl')) + $this->warning = $this->getL('curl_required'); + } + + public function install() + { + $ps_ct_immediat_payment = Configuration::get($this->prefix.'IMMEDIAT_PAYMENT') ? Configuration::get($this->prefix.'IMMEDIAT_PAYMENT') : '1'; + $ps_ct_salt = Configuration::get($this->prefix.'SALT') ? Configuration::get($this->prefix.'SALT') : strtoupper(Tools::passwdGen(8)); + $ps_ct_business_type = Configuration::get($this->prefix.'BUSINESS_TYPE') ? Configuration::get($this->prefix.'BUSINESS_TYPE') : 'I'; + $ps_ct_environment = Configuration::get($this->prefix.'ENVIRONMENT') ? Configuration::get($this->prefix.'ENVIRONMENT') : 'T'; + + return parent::install() AND Disposition::createTable() AND $this->_createOrderState() AND + $this->registerHook('payment') AND $this->registerHook('paymentReturn') AND $this->registerHook('adminOrder') + AND Configuration::updateValue($this->prefix.'IMMEDIAT_PAYMENT', $ps_ct_immediat_payment) + AND Configuration::updateValue($this->prefix.'SALT', $ps_ct_salt) + AND Configuration::updateValue($this->prefix.'BUSINESS_TYPE', $ps_ct_business_type) + AND Configuration::updateValue($this->prefix.'ENVIRONMENT', $ps_ct_environment); + } + + private function _createOrderState() + { + + if (Configuration::get($this->prefix.'ORDER_STATE_ID') && Configuration::get($this->prefix.'ORDER_STATE_PART_ID')) return true; + + // Awaiting payment + $os = new OrderState(); + $os->name = array('1' => 'Awaiting '.$this->displayName.' payment', + '2' => 'En attente du paiement par '.$this->displayName, + '3' => 'En espera de pago por '.$this->displayName); + + $os->invoice = false; + $os->color = 'lightblue'; + $os->logable = true; + + if ($os->save()) + { + Configuration::updateValue($this->prefix.'ORDER_STATE_ID', $os->id); + + copy(_PS_MODULE_DIR_.$this->name.'/logo.gif',_PS_IMG_DIR_.'os/'.$os->id.'.gif'); + } else + return false; + + // Partially paid + $os1 = new OrderState(); + $os1->name = array('1' => 'Partially paid by '.$this->displayName, + '2' => 'Payé partiellement via '.$this->displayName, + '3' => 'Pagado parcialmente con '.$this->displayName); + + $os1->invoice = false; + $os1->color = 'lightblue'; + $os1->logable = true; + + if ($os1->save()) + { + Configuration::updateValue($this->prefix.'ORDER_STATE_PART_ID', $os1->id); + copy(_PS_MODULE_DIR_.$this->name.'/logo.gif',_PS_IMG_DIR_.'os/'.$os1->id.'.gif'); + return true; + } + + return false; + } + + private function _deleteOrderState() + { + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_ID'))); + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state_lang` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_ID'))); + + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_PART_ID'))); + DB::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'order_state_lang` WHERE `id_order_state` = '.(int)(Configuration::get($this->prefix.'ORDER_STATE_PART_ID'))); + + return true; + } + + public function getPaymentUrlBase() + { + return $this->payment_url[Configuration::get($this->prefix.'ENVIRONMENT')]; + } + + private function _getSupportedLanguageIsoById($id_lang) + { + $lang = Language::getIsoById((int)($id_lang)); + + return in_array($lang, $this->supported_languages) ? $lang : $this->default_language; + } + + private function _getRegisterLink($id_lang) + { + $lang = Language::getIsoById((int)($id_lang)); + return array_key_exists($lang, $this->register_url) ? $this->register_url[$lang] : $this->register_url[$this->default_language]; + } + + private function _getAllowedCurrencies() + { + if (empty($this->allowed_currencies)) + $this->allowed_currencies = DB::getInstance()->ExecuteS( + 'SELECT c.id_currency, c.iso_code, c.name, c.sign + FROM '._DB_PREFIX_.'currency c + WHERE c.deleted = 0 + AND iso_code IN (\''.implode('\',\'', $this->supported_currencies).'\')'); + + return $this->allowed_currencies; + } + + public function isCurrencyActive($currency_iso_code) + { + $mid = Configuration::get($this->prefix.'MERCHANT_ID_'.$currency_iso_code); + return ($mid && file_exists($this->certificat_dir.$mid.'.pem') && Configuration::get($this->prefix.'KEYRING_PW_'.$currency_iso_code)); + } + + public function createDisposition($cart) + { + global $cookie; + + $currency = new Currency((int)($cart->id_currency)); + $language = $this->_getSupportedLanguageIsoById((int)($cookie->id_lang)); + $mid = Configuration::get($this->prefix.'MERCHANT_ID_'.$currency->iso_code); + $mtid = $cart->id.'-'.time(); + $amount = number_format((float)($cart->getOrderTotal(true, Cart::BOTH)), 2, '.',''); + $currency_iso = $currency->iso_code; + $business_type = Configuration::get($this->prefix.'BUSINESS_TYPE'); + $reporting_criteria = ''; + + $hash = md5(Configuration::get($this->prefix.'SALT') + $amount + $currency_iso); + + $ok_url = Tools::getShopDomainSsl(true, true)._MODULE_DIR_.$this->name.'/payment.php?hash='.$hash; + $nok_url = Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'/order.php?step=3'; + + list($return_code, $error_code, $message) = PrepaidServicesAPI::createDisposition($this->getAPIConfiguration($currency_iso), $mid, $mtid, $amount, $currency_iso, $ok_url, $nok_url, $business_type, $reporting_criteria); + + if ($return_code == 0) + { + Disposition::deleteByCartId((int)($cart->id)); // Avoid duplicate disposition (canceled orders in CT for example) + Disposition::create((int)($cart->id), $mtid, $amount, $currency_iso); + $message = $this->getPaymentUrlBase().'?currency='.$currency->iso_code.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&language='.$language; + } + + return array('return_code' => $return_code, 'message' => $message); + } + + public function getDispositionState($id_cart) + { + $disposition = Disposition::getByCartId((int)($id_cart)); + + if (!array_key_exists('id_disposition', $disposition)) + die(Tools::displayError()); + + return PrepaidServicesAPI::getSerialNumbers($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], $disposition['currency']); + } + + public function executeDebit($id_cart, $amount = NULL, $close_flag = 1) + { + $disposition = Disposition::getByCartId((int)($id_cart)); + if (!array_key_exists('id_disposition', $disposition)) + die(Tools::displayError()); + + if (!isset($amount) || $amount === '') + $amount = $disposition['amount']; + + $result = PrepaidServicesAPI::executeDebit($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], number_format($amount, 2, '.', ''), $disposition['currency'], $close_flag); + + if ($result[0] == 0) + { + if ($amount == $disposition['amount'] || $close_flag) + Disposition::delete((int)($disposition['id_disposition'])); + else + Disposition::updateAmount((int)($disposition['id_disposition']), (float)($amount)); + } + + return $result; + } + + + public function getContent() + { + $out = '

        '.$this->displayName.'

        '; + $err_req = false; + + // check requirements + if (!extension_loaded('curl')) + { + $out .= $this->displayError($this->getL('curl_required')); + $err_req = true; + } + + + if (!is_writable($this->certificat_dir)) + { + $out .= $this->displayError($this->certificat_dir.' '.$this->getL('not_writable')); + $err_req = true; + } + + $id_currency = Currency::getIdByIsoCode($this->max_amount_currency); + if (empty($id_currency)) + { + $out .= $this->displayError($this->getL('currency_required').'['.$this->max_amount_currency.']'); + $err_req = true; + } + + if (!$err_req && Tools::isSubmit('submitCtConfiguration')) + { + $errors = $this->_validateForm(); + + if (empty($errors)) + $out .= $this->_postProcess(); + else + $out .= $errors; + } + + $out .= $this->_displayStyleAndJS(); + $out .= $this->_displayInfos(); + $out .= $this->_displayForm(); + + return $out; + } + + private function _displayStyleAndJS() + { + return ' + '; + } + + private function _displayForm() + { + $business_type_options = ''; + foreach ($this->business_types AS $key => $value) + $business_type_options .= ''; + + $currencies_configuration = '

        '.$this->getL('configure_currency').'

        +

        '.$this->getL('payment_not_displayed').'

        + '; + + $environment_radio = ''; + foreach ($this->environments AS $key => $value) + $environment_radio .= 'prefix.'ENVIRONMENT') == $key ? 'checked' : '').'>'. $value. '
        '; + + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $currencies_configuration .= ' + + + + '; + } + $currencies_configuration .= '
        '.$this->getL('configuration_in').' '.$currency['name'].' '.$currency['sign'].' + +
        + +
        +
        + +
        + +
        + +
        + +
        +
        '; + + return '
        +
        + '.$this->getL('configuration').' + +
        + '.$environment_radio.' +
        +
        + +
        + +
        +
        + +
        + prefix.'IMMEDIAT_PAYMENT') ? 'checked' : '').' /> +
        +
        +
        + '.$currencies_configuration.' +
        +
        + +
        + +
        +
        '; + } + + private function _displayInfos() + { + global $cookie; + + return '
        + '.$this->displayName.' +
        + '.$this->getL('introduction').' +

        + '.$this->getL('register').' +
        +

        '; + } + + private function _validateForm() + { + $errors = ''; + + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $mid = trim(Tools::getValue('ct_merchant_id_'.$currency['iso_code'])); + + if (preg_match('/^[0-9]{10}$/', $mid)) + { + $mid_certificat = $_FILES['ct_keyring_certificate_'.$currency['iso_code']]; + + if (!$mid_certificat || $mid_certificat['error'] == 4 || $mid_certificat['error'] == 3) + { + if (!file_exists($this->certificat_dir.$mid.'.pem')) + $errors .= $this->displayError($this->getL('certificate_required').' ['.$currency['iso_code'].']'); + } + else + { + if ($mid_certificat['error']) + { + switch ($mid_certificat['error']) + { + case 3: // UPLOAD_ERR_PARTIAL + $errors .= $this->displayError($this->getL('file_partialy_uploaded')); + break; + + case 4: // UPLOAD_ERR_NO_FILE + $errors .= $this->displayError($this->getL('file_empty')); + break; + } + } + + if (substr($mid_certificat['name'], -4) != '.pem') + $errors .= $this->displayError($this->getL('invalid_file').' ['.$currency['iso_code'].']'); + } + } + elseif (!empty($mid)) + { + $errors .= $this->displayError($this->getL('invalid_merchant_id').' ['.$currency['iso_code'].']'); + } + } + + if (!array_key_exists(Tools::getValue('ct_business_type'), $this->business_types)) + $errors .= $this->getL('invalid_business_type'); + + if (!array_key_exists(Tools::getValue('ct_environment'), $this->environments)) + $errors .= $this->getL('invalid_environment'); + + return $errors; + } + + private function _acceptPayment($order, $disposition, $currency_sign, $amount = NULL) + { + $isCorrect = true; + if (!$disposition) + die(Tools::displayError()); + + if (!isset($amount) || $amount === '') + $amount = $disposition['amount']; + + $amount = number_format($amount, 2, '.', ''); + $close_flag = (int)($amount == $disposition['amount']); + + list($resultcode, $errorcode, $errormessage) = $this->executeDebit($disposition['id_cart'], $amount, $close_flag); + + $param = ''; + if ($resultcode != 0) + { + $message = $this->getL('payment_error').' '.$errormessage; + $isCorrect = false; + } + else + $message = $this->getL('payment_accepted') .'('.$amount.' '.$currency_sign.') '.($close_flag ? $this->getL('disposition_consumed') : '') ; + + $msg = new Message(); + $msg->message = $message; + $msg->id_order = (int)($order->id); + $msg->private = 1; + $msg->add(); + + if ($isCorrect) + { + if ($order->total_paid == $order->total_paid_real) + $order->total_paid_real = $amount; + else + $order->total_paid_real += $amount; + + $os = _PS_OS_PAYMENT_; + if ($order->total_paid != $order->total_paid_real) + $os = Configuration::get($this->prefix.'ORDER_STATE_PART_ID'); + + $history = new OrderHistory(); + $history->id_order = (int)($order->id); + $history->changeIdOrderState($os, (int)($order->id)); + $history->save(); + + $order->save(); + } + + return $isCorrect; + } + + public function _releasePayment($order, $disposition) + { + if (!$disposition) + die(Tools::displayError()); + + list($resultcode, $errorcode, $errormessage) = $this->executeDebit($disposition['id_cart'], 0, 1); + + $param = ''; + if ($resultcode != 0) + { + $message = $this->getL('release_error').' '.$errormessage; + $isCorrect = false; + } + else + $message = $this->getL('payment_released'); + + $msg = new Message(); + $msg->message = $message; + $msg->id_order = (int)($order->id); + $msg->private = 1; + $msg->add(); + + return $errorcode; + } + + private function _postProcess() + { + Configuration::updateValue($this->prefix.'BUSINESS_TYPE', Tools::getValue('ct_business_type')); + Configuration::updateValue($this->prefix.'ENVIRONMENT', Tools::getValue('ct_environment')); + + $immediat_payment = Tools::getValue('ct_immediat_payment'); + if (Configuration::get($this->prefix.'BUSINESS_TYPE') == 'I') + $immediat_payment = 1; + + Configuration::updateValue($this->prefix.'IMMEDIAT_PAYMENT', $immediat_payment); + + $params = ''; + $dataSync = ''; + $delim = '?'; + $key = 1; + foreach ($this->_getAllowedCurrencies() AS $currency) + { + $mid = trim(Tools::getValue('ct_merchant_id_'.$currency['iso_code'])); + + Configuration::updateValue($this->prefix.'MERCHANT_ID_'.$currency['iso_code'], $mid); + Configuration::updateValue($this->prefix.'KEYRING_PW_'.$currency['iso_code'], Tools::getValue('ct_keyring_pw_'.$currency['iso_code'])); + + if (isset($_FILES['ct_keyring_certificate_'.$currency['iso_code']])) + move_uploaded_file($_FILES['ct_keyring_certificate_'.$currency['iso_code']]['tmp_name'], $this->certificat_dir.$mid.'.pem'); + + if ($mid) + { + $params .= $delim.'mid'.$key.'='.urlencode($mid).'¤cy'.$key.'='.urlencode($currency['iso_code']); + $delim = '&'; + $key++; + } + } + + if (!empty($params)) + $dataSync = ''; + + return $this->displayConfirmation($this->getL('settings_updated').$dataSync); + } + + public function hookPayment($params) + { + global $smarty; + + // check currency + $currency = new Currency((int)($params['cart']->id_currency)); + + if (!$this->isCurrencyActive($currency->iso_code)) + return false; + + // check max amount + $amount = (float)($params['cart']->getOrderTotal(true, Cart::BOTH)); + $id_currency_max = Currency::getIdByIsoCode($this->max_amount_currency); + + if ($currency->id != $id_currency_max) + { + $amount = $amount / $currency->conversion_rate; + $amount = Tools::convertPrice($amount, new Currency((int)($id_currency_max))); + } + + if ($amount > $this->max_amount) + return false; + + $smarty->assign(array('pic_url' => _MODULE_DIR_.'/'.$this->name.'/img/payment-logo.png', + 'payment_name' => $this->displayName, + 'module_name' => $this->name)); + + return $this->display(__FILE__, 'payment.tpl'); + } + + + public function hookPaymentReturn($params) + { + global $smarty, $cookie; + + if ($params['objOrder']->module != $this->name) + return; + + $smarty->assign('payment_name', $this->displayName); + return $this->display(__FILE__, $this->name.'-confirmation.tpl'); + } + + + public function hookAdminOrder($params) + { + global $smarty, $cookie; + $error = 0; + $order = new Order((int)($params['id_order'])); + + if (!Validate::isLoadedObject($order)) + die(Tools::displayError()); + + if ($order->module != $this->name) + return false; + + $disposition = Disposition::getByCartId((int)($order->id_cart)); + if (!$disposition) // No disposition = Order paid + return false; + + // check disposition state + $res = PrepaidServicesAPI::getSerialNumbers($this->getAPIConfiguration($disposition['currency']), Configuration::get($this->prefix.'MERCHANT_ID_'.$disposition['currency']), $disposition['mtid'], $disposition['currency']); + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + + // if the disposition is not "active" + if ($res[5] != PrepaidServicesAPI::DISPOSITION_DISPOSED && $res[5] != PrepaidServicesAPI::DISPOSITION_DEBITED) + { + $smarty->assign(array('disposition_state' => $res[5], 'payment_name' => $order->payment)); + return $this->display($this->module_dir.'/'.$this->name, 'disposition-error.tpl'); + } + + if (Tools::isSubmit('acceptPayment')) + { + $amount = Tools::getValue('ps_amount'); + if (isset($amount) && !empty($amount) && $amount <= $res[3] && $amount > 0) + { + if (!$this->_acceptPayment($order, $disposition, $currency->getSign('right'), $amount)) + $error = 1; + } + else + $error = 2; + + $query_string = $error ? self::changeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error', (int)($error)) : self::removeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error'); + Tools::redirectAdmin(Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$query_string); + } else if (Tools::isSubmit('releasePayment')) { + if (!$this->_releasePayment($order, $disposition)) + $error = 1; + + $query_string = $error ? self::changeQueryStringParameter($_SERVER['QUERY_STRING'], 'pp_error', (int)($error)) : $_SERVER['QUERY_STRING']; + Tools::redirectAdmin(Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$query_string); + } + + $error_msg = ''; + if (Tools::getIsset('pp_error')) + $error_msg = $this->_getErrorMsgFromErrorCode(Tools::getValue('pp_error')); + + $smarty->assign(array('action' => Tools::safeOutput($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'], + 'payment_name' => $order->payment, + 'error' => $error_msg, + 'currency' => $currency->getSign('right'), + 'amount' => $res[3] + )); + + return $this->display($this->module_dir.'/'.$this->name, $this->name.'-accept-payment.tpl'); + } + + public function getAPIConfiguration($iso_currency) + { + return array('keyring_file' => $this->certificat_dir.Configuration::get($this->prefix.'MERCHANT_ID_'.strtoupper($iso_currency)).'.pem', + 'keyring_pw' => Configuration::get($this->prefix.'KEYRING_PW_'.strtoupper($iso_currency)), + 'keyring_prepaid' => $this->certificat_dir.'paysafecard-CA.pem', + 'env' => Configuration::get($this->prefix.'ENVIRONMENT')); + } + + public static function changeQueryStringParameter($query_string, $param, $value) + { + parse_str($query_string, $output); + $output[$param] = $value; + return http_build_query($output); + } + + public static function removeQueryStringParameter($query_string, $param) + { + parse_str($query_string, $output); + unset($output[$param]); + return http_build_query($output); + } + +} + diff --git a/modules/paysafecard/PrepaidServicesAPI.php b/modules/paysafecard/PrepaidServicesAPI.php new file mode 100644 index 000000000..d520f77dd --- /dev/null +++ b/modules/paysafecard/PrepaidServicesAPI.php @@ -0,0 +1,190 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PrepaidServicesAPI +{ + const DISPOSITION_CREATED = 'R'; + const DISPOSITION_DISPOSED = 'S'; + const DISPOSITION_DEBITED = 'E'; + const DISPOSITION_CONSUMED = 'O'; + const DISPOSITION_CANCELLED = 'L'; + const DISPOSITION_INVALID = 'I'; + const DISPOSITION_EXPIRED = 'X'; + + // Test & Production environment (shared between CT & PSC) + private static $base_url = array('T' => array('create_disposition_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/CreateDispositionServlet', + 'get_disposition_state_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/GetDispositionStateServlet', + 'execute_debit_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/DebitServlet', + 'get_serial_number_url' => 'https://shops.test.at.paysafecard.com/pscmerchant/GetSerialNumbersServlet' + ), + 'P' => array('create_disposition_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/CreateDispositionServlet', + 'get_disposition_state_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/GetDispositionStateServlet', + 'execute_debit_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/DebitServlet', + 'get_serial_number_url' => 'https://shops.cc.at.paysafecard.com/pscmerchant/GetSerialNumbersServlet' + )); + + public static function getBaseUrl($key, $env) + { + $base_url = self::$base_url[$env]; + + if (array_key_exists($key, $base_url)) + return $base_url[$key]; + + return ''; + } + + public static function createDisposition($configuration, $mid, $mtid, $amount, $currency, $okurl, $nokurl, $businesstype, $reportingcriteria) + { + $language = 'en'; + $params = 'currency='.$currency.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&businesstype='.$businesstype. + '&reportingcriteria='.$reportingcriteria.'&okurl='.$okurl.'&nokurl='.$nokurl.'&language='.$language; + + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('create_disposition_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $data_array = explode("\n", $data,7); + $resultcode = trim($data_array[0]); + $errorcode = trim($data_array[1]); + $errormessage = trim($data_array[2]); + + return array($resultcode, $errorcode, $errormessage); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array($resultcode,$errorcode,$errormessage); + } + } + + public static function getDispositionState($configuration, $mid, $mtid, $currency_iso_code) + { + $language = 'en'; + $params = 'mid='.$mid.'&mtid='.$mtid.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('get_disposition_state_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $dataarray = explode("\n", $data,7); + $resultcode = trim($dataarray[0]); + $errorcode = trim($dataarray[1]); + $errormessage = trim($dataarray[2]); + $amount = trim($dataarray[3]); + $currency = trim($dataarray[4]); + $state = trim($dataarray[5]); + + return array($resultcode, $errorcode, $errormessage, $amount, $currency, $state); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array($resultcode, $errorcode, $errormessage); + } + } + + public static function getSerialNumbers($configuration, $mid, $mtid, $currency_iso_code) + { + $language = 'en'; + $params = 'mid='.$mid.'&mtid='.$mtid.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('get_serial_number_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + if ($rc == 0) { + /* read and return data from paysafecard server */ + $dataarray = explode("\n", $data,7); + $resultcode = trim($dataarray[0]); + $errorcode = trim($dataarray[1]); + $errormessage = trim($dataarray[2]); + $amount = trim($dataarray[3]); + $currency = trim($dataarray[4]); + $state = trim($dataarray[5]); + $snamount = trim($dataarray[6]); + return array ($resultcode, $errorcode, $errormessage, $amount, $currency, $state, $snamount); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array ($resultcode, $errorcode, $errormessage); + } + } + + public static function executeDebit($configuration, $mid, $mtid, $amount, $currency, $close_flag = 1) + { + $language = 'en'; + $params = 'currency='.$currency.'&mid='.$mid.'&mtid='.$mtid.'&amount='.$amount.'&close='.$close_flag.'&language='.$language; + + list ($rc, $msg, $data) = self::_doHttpRequest(self::getBaseUrl('execute_debit_url', $configuration['env']), $params, $configuration['keyring_file'], $configuration['keyring_pw'], $configuration['keyring_prepaid']); + + if ($rc == 0) { + $dataarray=explode("\n", $data,7); + $resultcode=trim($dataarray[0]); + $errorcode=trim($dataarray[1]); + $errormessage=trim($dataarray[2]); + + return array ($resultcode, $errorcode, $errormessage); + } else { + $resultcode = '9001'; + $errorcode = $rc; + $errormessage = 'libcurl error: '.$msg; + + return array ($resultcode, $errorcode, $errormessage); + } + } + + private static function _doHttpRequest($url, $urlparam, $keyringfile, $keyringpw, $cakeyringfile) + { + /* some prerquisites for the connection */ + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_POST, 1); // a non-zero parameter tells the library to do a regular HTTP post. + curl_setopt($ch, CURLOPT_POSTFIELDS, $urlparam); // add POST fields + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); // don't allow redirects + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable + curl_setopt($ch, CURLOPT_TIMEOUT, 240); // maximum time, in seconds, that you'll allow the CURL functions to take + curl_setopt($ch, CURLOPT_SSLCERT, $keyringfile); // filename of PEM formatted certificate + curl_setopt($ch, CURLOPT_SSLCERTTYPE, "PEM"); // format of certificate, "PEM" or "DER" + curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $keyringpw); // password required to use the CURLOPT_SSLCERT certificate + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); // verify the peer's certificate + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // verify the Common name from the peer certificate + curl_setopt($ch, CURLOPT_CAINFO, $cakeyringfile); // file holding one or more certificates to verify the peer with + + $data = curl_exec($ch); + $errno = curl_errno($ch); + $errmsg = curl_error($ch); + + /* bug fix for PHP 4.1.0/4.1.2 (curl_errno() returns high negative + * value in case of successful termination) */ + if ($errno < 0) $errno = 0; + + curl_close($ch); + + return array ($errno,$errmsg,$data); + } +} + + diff --git a/modules/paysafecard/config.xml b/modules/paysafecard/config.xml new file mode 100755 index 000000000..55750b90f --- /dev/null +++ b/modules/paysafecard/config.xml @@ -0,0 +1,11 @@ + + + paysafecard + PaysafeCard + 1.2 + Accepts payments by PaysafeCard. + + payments_gateways + 1 + 1 + \ No newline at end of file diff --git a/modules/paysafecard/de.php b/modules/paysafecard/de.php new file mode 100644 index 000000000..75c12efdd --- /dev/null +++ b/modules/paysafecard/de.php @@ -0,0 +1,51 @@ +disposition-error_393988def796f78c4b673b90548f3afa'] = 'Der Dispositionsstatus ist ungültig'; +$_MODULE['<{paysafecard}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = 'Sie sind nicht berechtigt, die Zahlung durchzuführen.'; +$_MODULE['<{paysafecard}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Bezahlen Sie mit'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Die Zahlung wurde noch nicht akzeptiert:'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Zahlung akzeptieren '; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Betrag freigeben'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Ihre Bestellung vom'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ist abgeschlossen.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Sie haben die '; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = '-Methode gewählt.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Ihre Bestellung wird sehr bald geschickt werden.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9240e3ec97017ab6af036384ff7199'] = 'PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b3e93e632edfb4fa64c3c0949c5eb56d'] = 'Akzeptiert Zahlungen per Paysafecard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposition erstellt. Warten auf Belastung.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_894f0316a71ef67255369c82bf8a0e5b'] = 'Ungültiger Dispositionsstatus:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c1c25198721552ea8ddd963c7278d4ab'] = 'Ein Fehler ist bei der Zahlung aufgetreten:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_36ec50c0e914dd2fb48a1b27540512ce'] = 'Zahlung akzeptiert.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d6ca44369efe062cec0c09f392465f55'] = 'Dieses Modul erfordert das ordnungsgemäße Funktionieren der CURL PHP-Erweiterung.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_8e9647b486000683917484190b68ac8a'] = 'ist nicht beschreibbar!'; +$_MODULE['<{paysafecard}prestashop>paysafecard_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Dieses Modul erfordert die Währung:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Konfigurieren Sie jede Währung einzeln:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9c8794db26bbef6bd2aaa68c15211d'] = '(Das Zahlungsmodul wird nicht für Kunden angezeigt, die nicht konfigurierte Währung benutzen.)'; +$_MODULE['<{paysafecard}prestashop>paysafecard_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Konfiguration in'; +$_MODULE['<{paysafecard}prestashop>paysafecard_229a7ec501323b94db7ff3157a7623c9'] = 'Händler-ID'; +$_MODULE['<{paysafecard}prestashop>paysafecard_845314022daaa8b665e718c4b51738aa'] = 'Keyring Zertifikat'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{paysafecard}prestashop>paysafecard_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{paysafecard}prestashop>paysafecard_0ba29c6a1afacf586b03a26162c72274'] = 'Umgebung'; +$_MODULE['<{paysafecard}prestashop>paysafecard_1d5ad3d37f236c9eebda547690373bba'] = 'Geschäftsart'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b024248d9fecf8c34f629e89a9fb93b4'] = 'Sofortige Zahlung'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c80a51a60c5ee43553c3881459b8f431'] = 'Konfiguration aktualisieren'; +$_MODULE['<{paysafecard}prestashop>paysafecard_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Sie müssen ein Zertifikat für die Händler-ID vorweisen'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bbced877c13c763f0141ff906c8ed0e5'] = 'Ungültige Datei'; +$_MODULE['<{paysafecard}prestashop>paysafecard_97e5793f511c7930ab295997cb28553a'] = 'Ungültige Händler-ID'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c7c32346a2f800fc49f79d52f3f37f90'] = 'Die Datei wurde teilweise hochgeladen'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f09bc49e98e94cb04dc058087fbb3878'] = 'Die Datei ist leer'; +$_MODULE['<{paysafecard}prestashop>paysafecard_e9185d874b4244d6f13619cf77dca0aa'] = 'Die Transaktion konnte wegen Problemen mit der Verbindung nicht initiiert werden. Wenn das Problem weiterhin besteht, wenden Sie sich bitte an unseren Support.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposition verbraucht'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c3e260f43a99b6fd907538953fe700d0'] = 'Disposition freigegeben'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f6a62a622cbba2c1b8cd0be062deff96'] = 'Ein Fehler ist während der Freigabe aufgetreten '; +$_MODULE['<{paysafecard}prestashop>paysafecard_315e941f57cf90350aea15d968e190f8'] = 'paysafecard ist Europas erste Prepaid-Lösung für Zahlungen im Internet in Übereinstimmung mit Bankgesetzen. In den letzten Jahren hat sich paysafecard zu einer der führenden alternativen europäischen Online-Payment-Lösungen entwickelt.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ee363d108ef0c9c5a599d3afe04b9e32'] = 'Ein Fehler ist aufgetreten, überprüfen Sie die Mitteilungen, um mehr zu erfahren'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a9ced76f2dd6907220fa95b3a136b04a'] = 'Ungültiger Betrag'; diff --git a/modules/paysafecard/disposition-error.tpl b/modules/paysafecard/disposition-error.tpl new file mode 100644 index 000000000..6c040795a --- /dev/null +++ b/modules/paysafecard/disposition-error.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +
        + {$payment_name} + +

        + {l s='The disposition state is invalid' mod='paysafecard'} ({$disposition_state}) + {l s='. You are not allowed to perform the payment.' mod='paysafecard'} + +

        +
        + diff --git a/modules/paysafecard/es.php b/modules/paysafecard/es.php new file mode 100755 index 000000000..32240854d --- /dev/null +++ b/modules/paysafecard/es.php @@ -0,0 +1,51 @@ +disposition-error_393988def796f78c4b673b90548f3afa'] = 'La disposición se encuentra en un estado no válido'; +$_MODULE['<{paysafecard}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = 'No está autorizado a recuperar el pago.'; +$_MODULE['<{paysafecard}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Pagar con'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'El pago aún no ha sido aceptado'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Aceptar el pago'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Rechazar el pago'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Su pedido en'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'ha sido registrado.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Ha elegido pagar con'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = 'método.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Su pedido será enviado rápidamente'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier pregunta o información suplementaria, póngase en contacto con nuestro'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'servicio clientela'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9240e3ec97017ab6af036384ff7199'] = 'PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b3e93e632edfb4fa64c3c0949c5eb56d'] = 'Aceptar los pagos a través de PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposición creada. En espera del débito.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_894f0316a71ef67255369c82bf8a0e5b'] = 'El estado de la disposición no es válido:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c1c25198721552ea8ddd963c7278d4ab'] = 'Se ha producido un error durante el pago:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_36ec50c0e914dd2fb48a1b27540512ce'] = 'Pago aceptado'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d6ca44369efe062cec0c09f392465f55'] = 'Este módulo necesita la librería PHP cURL para funcionar correctamente.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_8e9647b486000683917484190b68ac8a'] = 'no tiene los derechos en escritura.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Para funcionar correctamente, este módulo necesita la divisa:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configurar cada divisa independientemente:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9c8794db26bbef6bd2aaa68c15211d'] = '(El módulo de pago no se mostrará a los clientes que utilicen una divisa no configurada)'; +$_MODULE['<{paysafecard}prestashop>paysafecard_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configuración en'; +$_MODULE['<{paysafecard}prestashop>paysafecard_229a7ec501323b94db7ff3157a7623c9'] = 'ID vendedor'; +$_MODULE['<{paysafecard}prestashop>paysafecard_845314022daaa8b665e718c4b51738aa'] = 'Keyring Certificado'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{paysafecard}prestashop>paysafecard_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{paysafecard}prestashop>paysafecard_0ba29c6a1afacf586b03a26162c72274'] = 'Entorno'; +$_MODULE['<{paysafecard}prestashop>paysafecard_1d5ad3d37f236c9eebda547690373bba'] = 'Tipo negocio'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b024248d9fecf8c34f629e89a9fb93b4'] = 'Pago inmediato'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c80a51a60c5ee43553c3881459b8f431'] = 'Actualizar la configuración'; +$_MODULE['<{paysafecard}prestashop>paysafecard_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Debe indicar un certificado para el ID vendedor'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bbced877c13c763f0141ff906c8ed0e5'] = 'Archivo no válido'; +$_MODULE['<{paysafecard}prestashop>paysafecard_97e5793f511c7930ab295997cb28553a'] = 'ID del vendedor no válido'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c7c32346a2f800fc49f79d52f3f37f90'] = 'El archivo no se ha cargado correctamente'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f09bc49e98e94cb04dc058087fbb3878'] = 'El archivo está vacío'; +$_MODULE['<{paysafecard}prestashop>paysafecard_e9185d874b4244d6f13619cf77dca0aa'] = 'La transacción no ha podido inicializarse por problemas de conexión. Si el problema persiste, contacte con nosotros.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposición consumida'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c3e260f43a99b6fd907538953fe700d0'] = 'Disposición abandonada'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f6a62a622cbba2c1b8cd0be062deff96'] = 'Se ha producido un error en el momento de abandonar.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_315e941f57cf90350aea15d968e190f8'] = 'Todo el mundo puede utilizar Paysafecard ya que no necesita ni tarjeta de crédito ni cuenta bancaria. En los últimos años, Paysafecard se ha convertido en uno de los líderes de los modos de pago en línea alternativos.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d59048f21fd887ad520398ce677be586'] = 'Más información'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ee363d108ef0c9c5a599d3afe04b9e32'] = 'Se ha producido un error. Consulte el apartado \"Mensajes\" para más información.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a9ced76f2dd6907220fa95b3a136b04a'] = 'Importe incorrecto'; diff --git a/modules/paysafecard/fr.php b/modules/paysafecard/fr.php new file mode 100755 index 000000000..5d3f4e69f --- /dev/null +++ b/modules/paysafecard/fr.php @@ -0,0 +1,51 @@ +disposition-error_393988def796f78c4b673b90548f3afa'] = 'La disposition est dans un état invalide'; +$_MODULE['<{paysafecard}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Vous n\'êtes pas authorisé à récupérer le paiement.'; +$_MODULE['<{paysafecard}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Payer avec'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Le paiement n\'a pas encore été accepté : '; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Accepter le paiement'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Relacher le paiement'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'a bien été enregistrée.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Vous avez choisi de payer avec '; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = ' '; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Votre commande va être expediée rapidement.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toutes questions ou informations complémentaires, contactez notre'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'service client'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9240e3ec97017ab6af036384ff7199'] = 'PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b3e93e632edfb4fa64c3c0949c5eb56d'] = 'Accepter les paiements via PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposition crée. En attente du débit.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_894f0316a71ef67255369c82bf8a0e5b'] = 'L\'état de la disposition est invalide :'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c1c25198721552ea8ddd963c7278d4ab'] = 'Une erreur est survenue pendant le paiement :'; +$_MODULE['<{paysafecard}prestashop>paysafecard_36ec50c0e914dd2fb48a1b27540512ce'] = 'Paiement accepté.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d6ca44369efe062cec0c09f392465f55'] = 'Ce module requiert la librairie PHP cURL pour fonctionner correctement.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_8e9647b486000683917484190b68ac8a'] = 'n\'a pas les droits en écriture.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Ce module pour fonctionner correctement requiert la devise :'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configurer chaque devise indépendament :'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9c8794db26bbef6bd2aaa68c15211d'] = '(Le module de paiement ne sera pas affiché pour les clients qui utilisent une devise non configurée)'; +$_MODULE['<{paysafecard}prestashop>paysafecard_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configuration en'; +$_MODULE['<{paysafecard}prestashop>paysafecard_229a7ec501323b94db7ff3157a7623c9'] = 'ID Marchand'; +$_MODULE['<{paysafecard}prestashop>paysafecard_845314022daaa8b665e718c4b51738aa'] = 'Keyring Certificat'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a01813de717585e9ac9458bbfc54485a'] = 'Keyring PW'; +$_MODULE['<{paysafecard}prestashop>paysafecard_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{paysafecard}prestashop>paysafecard_0ba29c6a1afacf586b03a26162c72274'] = 'Environement'; +$_MODULE['<{paysafecard}prestashop>paysafecard_1d5ad3d37f236c9eebda547690373bba'] = 'Business Type'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b024248d9fecf8c34f629e89a9fb93b4'] = 'Paiement immédiat'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c80a51a60c5ee43553c3881459b8f431'] = 'Mettre à jour la configuration'; +$_MODULE['<{paysafecard}prestashop>paysafecard_86f28c996ee9075e9fc9a97dc8d5f254'] = 'Vous devez fournir un certificat pour l\'ID marchand'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bbced877c13c763f0141ff906c8ed0e5'] = 'Fichier invalide'; +$_MODULE['<{paysafecard}prestashop>paysafecard_97e5793f511c7930ab295997cb28553a'] = 'ID marchand invalide'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c7c32346a2f800fc49f79d52f3f37f90'] = 'Le fichier n\'a pas été téléchargé correctement'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f09bc49e98e94cb04dc058087fbb3878'] = 'Le fichier est vide'; +$_MODULE['<{paysafecard}prestashop>paysafecard_e9185d874b4244d6f13619cf77dca0aa'] = 'La transaction n\'a pu être initialisée du à des problèmes de connexions. Si le problème persiste, merci de nous contacter.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposition consommée'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c3e260f43a99b6fd907538953fe700d0'] = 'Disposition relachée'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f6a62a622cbba2c1b8cd0be062deff96'] = 'Une erreur est survenue au moment de la relache.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_315e941f57cf90350aea15d968e190f8'] = 'Tout le monde peut utiliser paysafecard puisqu’elle ne nécessite ni carte de crédit ni compte bancaire. Aux cours des dernières années, Paysafecard est devenu l\'un des leaders des moyens de paiement en ligne alternatifs. '; +$_MODULE['<{paysafecard}prestashop>paysafecard_d59048f21fd887ad520398ce677be586'] = 'En savoir plus'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ee363d108ef0c9c5a599d3afe04b9e32'] = 'Une erreur est survenue. Consulter la partie \"Messages\" ci-dessous pour plus d\'informations'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a9ced76f2dd6907220fa95b3a136b04a'] = 'Montant incorrect'; diff --git a/modules/paysafecard/img/payment-logo.png b/modules/paysafecard/img/payment-logo.png new file mode 100644 index 000000000..49e8da84f Binary files /dev/null and b/modules/paysafecard/img/payment-logo.png differ diff --git a/modules/paysafecard/img/payment-small.png b/modules/paysafecard/img/payment-small.png new file mode 100644 index 000000000..f045c5660 Binary files /dev/null and b/modules/paysafecard/img/payment-small.png differ diff --git a/modules/paysafecard/img/payment.png b/modules/paysafecard/img/payment.png new file mode 100644 index 000000000..a9bb989f4 Binary files /dev/null and b/modules/paysafecard/img/payment.png differ diff --git a/modules/paysafecard/it.php b/modules/paysafecard/it.php new file mode 100644 index 000000000..5944eee74 --- /dev/null +++ b/modules/paysafecard/it.php @@ -0,0 +1,51 @@ +disposition-error_393988def796f78c4b673b90548f3afa'] = 'Lo stato di disposizione non è valido'; +$_MODULE['<{paysafecard}prestashop>disposition-error_5db89f2bf67f2c7dbd86cac101c3c1b8'] = '. Non hai i permessi per effettuare il pagamento.'; +$_MODULE['<{paysafecard}prestashop>payment_da9c72b9e543135f3f59e3c8ac68ef35'] = 'Paga con'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_330bf06fb43e715e5d03c9fd016df4cd'] = 'Il pagamento non è stato ancora accettato:'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_486cb12e1ec3c8b28b80a8eb9f2db2c0'] = 'Accetta il pagamento'; +$_MODULE['<{paysafecard}prestashop>paysafecard-accept-payment_e9b3579d8e877bcd29ab436f2ef87cc8'] = 'Rilascia l\'importo'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Il tuo ordine'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_75fbf512d744977d62599cc3f0ae2bb4'] = 'è completo.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_91675397c13245179e4bc959514fc2ca'] = 'Hai scelto il'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_2c987f462c2ab7fc63e061e871e6a97d'] = 'metodo.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_e6dc7945b557a1cd949bea92dd58963e'] = 'Il tuo ordine verrà inviato al più presto.'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; +$_MODULE['<{paysafecard}prestashop>paysafecard-confirmation_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9240e3ec97017ab6af036384ff7199'] = 'PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b3e93e632edfb4fa64c3c0949c5eb56d'] = 'Si accettano pagamenti con PaysafeCard'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bed51f5187d4bf98e08f44d93f3098d9'] = 'Disposizione creata. In attesa di addebito.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_894f0316a71ef67255369c82bf8a0e5b'] = 'Stato della disposizione non valido:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c1c25198721552ea8ddd963c7278d4ab'] = 'Si è verificato un errore durante il pagamento:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_36ec50c0e914dd2fb48a1b27540512ce'] = 'Pagamento accettato.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d6ca44369efe062cec0c09f392465f55'] = 'Questo modulo richiede che l\'estensione curl di PHP funzioni correttamente.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_8e9647b486000683917484190b68ac8a'] = 'non è scrivibile!'; +$_MODULE['<{paysafecard}prestashop>paysafecard_139cfa047b503ac5b9a6b4b1b03090ad'] = 'Questo modulo richiede la valuta:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ef5d34b04ab3b2eaaf7cb9d0f51267ed'] = 'Configurare ogni valuta singolarmente:'; +$_MODULE['<{paysafecard}prestashop>paysafecard_be9c8794db26bbef6bd2aaa68c15211d'] = '(Il modulo di pagamento non sarà visualizzato per i clienti che utilizzano una valuta non configurata.)'; +$_MODULE['<{paysafecard}prestashop>paysafecard_7d3d009ac1b9d1e826a1a72c046ea635'] = 'Configurazione in'; +$_MODULE['<{paysafecard}prestashop>paysafecard_229a7ec501323b94db7ff3157a7623c9'] = 'ID commerciante'; +$_MODULE['<{paysafecard}prestashop>paysafecard_845314022daaa8b665e718c4b51738aa'] = 'Certificato Keyring'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a01813de717585e9ac9458bbfc54485a'] = 'PW Keyring'; +$_MODULE['<{paysafecard}prestashop>paysafecard_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{paysafecard}prestashop>paysafecard_0ba29c6a1afacf586b03a26162c72274'] = 'Ambiente'; +$_MODULE['<{paysafecard}prestashop>paysafecard_1d5ad3d37f236c9eebda547690373bba'] = 'Tipo di Business'; +$_MODULE['<{paysafecard}prestashop>paysafecard_b024248d9fecf8c34f629e89a9fb93b4'] = 'Pagamento immediato'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c80a51a60c5ee43553c3881459b8f431'] = 'Aggiornare la configurazione'; +$_MODULE['<{paysafecard}prestashop>paysafecard_86f28c996ee9075e9fc9a97dc8d5f254'] = 'È necessario fornire un certificato per ID commerciante'; +$_MODULE['<{paysafecard}prestashop>paysafecard_bbced877c13c763f0141ff906c8ed0e5'] = 'File non valido'; +$_MODULE['<{paysafecard}prestashop>paysafecard_97e5793f511c7930ab295997cb28553a'] = 'ID commerciante non valido'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c7c32346a2f800fc49f79d52f3f37f90'] = 'Il file è stato parzialmente caricato'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f09bc49e98e94cb04dc058087fbb3878'] = 'Il file è vuoto'; +$_MODULE['<{paysafecard}prestashop>paysafecard_e9185d874b4244d6f13619cf77dca0aa'] = 'Operazione non avviata a causa di problemi di connessione. Se il problema persiste, contatta il nostro supporto.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_99f6765a05b697eb78e8c2e5e228f2fc'] = 'Disposizione consumata'; +$_MODULE['<{paysafecard}prestashop>paysafecard_c3e260f43a99b6fd907538953fe700d0'] = 'Disposizione rilasciata'; +$_MODULE['<{paysafecard}prestashop>paysafecard_f6a62a622cbba2c1b8cd0be062deff96'] = 'È verificato un errore durante il rilascio'; +$_MODULE['<{paysafecard}prestashop>paysafecard_315e941f57cf90350aea15d968e190f8'] = 'paysafecard è la prima soluzione prepagata d\'Europa per i pagamenti su Internet che rispetta le leggi bancarie. Negli ultimi anni, paysafecard è diventato una delle soluzioni alternative di pagamento online leader in Europa.'; +$_MODULE['<{paysafecard}prestashop>paysafecard_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più'; +$_MODULE['<{paysafecard}prestashop>paysafecard_ee363d108ef0c9c5a599d3afe04b9e32'] = 'Si è verificato un errore, controlla Messaggi per maggiori informazioni'; +$_MODULE['<{paysafecard}prestashop>paysafecard_a9ced76f2dd6907220fa95b3a136b04a'] = 'Importo non valido'; diff --git a/modules/paysafecard/keyring/.htaccess b/modules/paysafecard/keyring/.htaccess new file mode 100755 index 000000000..3a4288278 --- /dev/null +++ b/modules/paysafecard/keyring/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/modules/paysafecard/keyring/paysafecard-CA.pem b/modules/paysafecard/keyring/paysafecard-CA.pem new file mode 100755 index 000000000..2df56c61d --- /dev/null +++ b/modules/paysafecard/keyring/paysafecard-CA.pem @@ -0,0 +1,227 @@ +-----BEGIN CERTIFICATE----- +MIIFszCCBJugAwIBAgIBADANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3DQEJ +ARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll +bm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJvb3Qg +Q0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUGA1UE +AxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQMB4XDTAyMDExMDE2NDU0 +M1oXDTM4MDExMDE2NDU0M1owge8xITAfBgkqhkiG9w0BCQEWEmNhQHBheXNhZmVj +YXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMG +Vmllbm5hMRwwGgYDVQQLExNwYXlzYWZlY2FyZCBSb290IENBMSwwKgYDVQQLEyNw +YXlzYWZlY2FyZCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEmMCQGA1UEChMdcGF5 +c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNVBAMTHnBheXNhZmVjYXJk +IFJvb3QgQ0EgLSBTeXN0ZW0gUDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALRAMIFNZR16P4ggPR6hlyXGSONVOklx7U3Xg9zihKA4vmzVMwXUJPP+lHCU +OKiYUSU+cQ+BMfTJCJPvJlqOHH36+ugyGQLI2M9Lq7ILxkGJ3+iQJx4ON1Yf3lJh +uyPLMjvRVCOoN29fUOROfdBxlAGNG33kKYNEh+VJ+ibxX5DmZApsMu6lJJ7LUZvs +2Rho6r9wKQVZaPNeWzJb+7dgLlW7XLIQIv6Fp/bMhZDPhCrX4rN0iiR7I9o5DZiJ +OXwRmWhroRUEo9pPf44XMfdEyaWDK6tbnIsEa7gTOPY3Zt5SMFeSYw1E0OjkUyFo +WL0NoAT7beVqJar+zzwvOjVaeMUCAwEAAaOCAVYwggFSMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFCgXaDOdI1dXvmnxpQ1ZM3M/BK07MIIBHgYDVR0jBIIBFTCC +ARGAFCgXaDOdI1dXvmnxpQ1ZM3M/BK07oYH1pIHyMIHvMSEwHwYJKoZIhvcNAQkB +FhJjYUBwYXlzYWZlY2FyZC5jb20xCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVu +bmExDzANBgNVBAcTBlZpZW5uYTEcMBoGA1UECxMTcGF5c2FmZWNhcmQgUm9vdCBD +QTEsMCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +JjAkBgNVBAoTHXBheXNhZmVjYXJkLmNvbSBXZXJ0a2FydGVuIEFHMScwJQYDVQQD +Ex5wYXlzYWZlY2FyZCBSb290IENBIC0gU3lzdGVtIFCCAQAwDQYJKoZIhvcNAQEE +BQADggEBAEkGu19kW0cROxNmEIhlF2LMFA8Jj9Y5aPPDwM1tMIoZtFWCH1g1g0Zl +PDrp9+ihDFimiXfhIosGvnrclbQ5yIJnxoNmDptkCKTAB+4rPoHSIz8rjCHHTOU2 +rJMVdFvS8hcVkallN1g9o8g7ryA2vRltum5NZUBwAFq986Cur4l2koRzz1UyOkrT +0G0i8cQIR9trGuCaUbhIFTBe/QvSNkIEqDWRDPLfBQnYnBFSwObH5uXiToUXlTnM +/aOuY+p2D8Oh6MneD6nh8turvFTMkLqLS7DzjQAYmF7HWGkRFPsHi2EtLFVIwM9q +FioR7mWBcKh2lZr18AtzGIkKQSQWQkI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCBKKgAwIBAgIEIAAABjANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3 +DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMG +Vmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJv +b3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUG +A1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQMB4XDTAyMDExNjEy +MTUxN1oXDTM0MDExNjEyMTUxN1owgfMxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZW +aWVubmExDzANBgNVBAcTBlZpZW5uYTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29t +IFdlcnRrYXJ0ZW4gQUcxHjAcBgNVBAsTFXBheXNhZmVjYXJkIFNlcnZlciBDQTEs +MCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxKTAn +BgNVBAMTIHBheXNhZmVjYXJkIFNlcnZlciBDQSAtIFN5c3RlbSBQMSEwHwYJKoZI +hvcNAQkBFhJjYUBwYXlzYWZlY2FyZC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDGbD6yVmszQYpuUX0zVyam8DdqPXfY5c8OSQK7u8I7mPoEw0SG +lxSbHy7Aywlx5rhSr6j1k0HgmnOsO6j6bup5CXGvGBWkiahN1TrUN8qAZvIdorUz ++YrZyg/EkddrOqkgZpaqyEEJ2wGdM3Lhbg8oBWufVh/TX0sA9K0NCSrl3UzKLw0n +mEVbUnBxRUGbctnOkmLiIWqX7o8jmupvE7lIvRPLHUyFKGp0Wn2oKosr3fhCQxEU +4dQdH9Uwf53kPt0Ct0MML1p1u8OAN4e6bYL1T86YA/bnaaPFI5D4cVP66X1gcamM ++ro//XJOee2d1FM7lWoyA03ypt54SRB1N6aVAgMBAAGjggFWMIIBUjAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBSB6bcBOjQU0y5+rr8pbTyHYFxKbjCCAR4GA1Ud +IwSCARUwggERgBQoF2gznSNXV75p8aUNWTNzPwStO6GB9aSB8jCB7zEhMB8GCSqG +SIb3DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UE +CBMGVmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJk +IFJvb3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEn +MCUGA1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBQggEAMA0GCSqG +SIb3DQEBBAUAA4IBAQAwuR+OYbQh8+2A8Ya48pGbEbggbYfJYZAcfZlTxVeilkXb +jhinDfG4mBuvsW8RG7CW1fnHYlytyN9AVJFHchB57SkfDDxhPYI6WBsJTnDaxROa +QzW0r6Pi3e5XAtqC221vKYYC5OoMBq+S+LWUc9kSYX7PAm3ObCEPNBirJMDDwSLm +iovY3UHByFeJ8dYM5u7wKM+WRBzIEi4dMk5VWWx7KO7fieGTxqVCPa1Bd1GQV3yq +Z5P0lzduqD2M1oUr1BCwiivxpHO4aMYo9lVz7ZMFhbyDLiiQqcR3unVKpSpN4oAq +TW3iZ32LXHkLFSCEFinOO43/uWk8+RzNR0N+XZ1F +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFszCCBJugAwIBAgIBADANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3DQEJ +ARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll +bm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJvb3Qg +Q0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUGA1UE +AxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNMB4XDTAyMDExMDE1MDUx +M1oXDTM4MDExMDE1MDUxM1owge8xITAfBgkqhkiG9w0BCQEWEmNhQHBheXNhZmVj +YXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMG +Vmllbm5hMRwwGgYDVQQLExNwYXlzYWZlY2FyZCBSb290IENBMSwwKgYDVQQLEyNw +YXlzYWZlY2FyZCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEmMCQGA1UEChMdcGF5 +c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNVBAMTHnBheXNhZmVjYXJk +IFJvb3QgQ0EgLSBTeXN0ZW0gTTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALtYbwxejm8ZTdZmvLG1TtVHMGyIVnTFeyIbt7SUP4GjycrFs0GiWCJzYHAX +gEtwzIX3ibt3bIR62/itJ4ra/pkIUBDd1ARNM1F9R/MyE3Ci1SGmp1IyaFK2tQRX +dxHqIBZtH6hUSK750mxE9Ln+YjHjbkEnvXB49qIyJsvgQSPrvzldj+bBDpNyCppf +H16U55azIpq7gWvyqsFe/NeAp8iW8quhgZQWqXhPFMA/dypcwBwSTJSW/jVqfqhd +iRhEfZEeV6pBPtaZeeUUvWBgBccr39sQd3FUADH7d7AepxsiIxTDm971wn9bNiOM +YwCdfQlEYLlAhEc3XMRv5Mifnp8CAwEAAaOCAVYwggFSMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFEdDEuV3HVe81QNu5wgYE/h2K14EMIIBHgYDVR0jBIIBFTCC +ARGAFEdDEuV3HVe81QNu5wgYE/h2K14EoYH1pIHyMIHvMSEwHwYJKoZIhvcNAQkB +FhJjYUBwYXlzYWZlY2FyZC5jb20xCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVu +bmExDzANBgNVBAcTBlZpZW5uYTEcMBoGA1UECxMTcGF5c2FmZWNhcmQgUm9vdCBD +QTEsMCoGA1UECxMjcGF5c2FmZWNhcmQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +JjAkBgNVBAoTHXBheXNhZmVjYXJkLmNvbSBXZXJ0a2FydGVuIEFHMScwJQYDVQQD +Ex5wYXlzYWZlY2FyZCBSb290IENBIC0gU3lzdGVtIE2CAQAwDQYJKoZIhvcNAQEE +BQADggEBACJ9nG6+DmSxJKoqyCDaBUTCeVWk1jpBAvxR1Nwq68L25VYqWp8M0x74 +/Wd/rcut532BaStABiba+P5V4/VpV4cYlExPb2CCr1E3BWd9nMaJEqjFOdNfy2Aq +OZhTeKqKZ0oALhk61AdX7OmimW2DGe7jwEbZxtjcUBUMo+olSAqDD/oVmOLooQOE +oCHQ7U/+PFHtzO9Im7Jlq0fJESJSRheSbjItZSJxl18neu3xN58Ku9Pnu4pInyM+ +ObX4TJxmBbyRXlBkWfDWljih9MANqE/XkwOE3BlAt2haymRs/GSYiIWqNwTd2Rbx +NwdV0sBoOmFmSMNt7/NhXIT6GO3hFK4= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCBKKgAwIBAgIEEAAAAzANBgkqhkiG9w0BAQQFADCB7zEhMB8GCSqGSIb3 +DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UECBMG +Vmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJkIFJv +b3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEnMCUG +A1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNMB4XDTAyMDExMDE1 +MjE1OVoXDTM0MDExMDE1MjE1OVowgfMxITAfBgkqhkiG9w0BCQEWEmNhQHBheXNh +ZmVjYXJkLmNvbTELMAkGA1UEBhMCQVQxDzANBgNVBAgTBlZpZW5uYTEPMA0GA1UE +BxMGVmllbm5hMR4wHAYDVQQLExVwYXlzYWZlY2FyZCBTZXJ2ZXIgQ0ExLDAqBgNV +BAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSYwJAYDVQQK +Ex1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEpMCcGA1UEAxMgcGF5c2Fm +ZWNhcmQgU2VydmVyIENBIC0gU3lzdGVtIE0wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQCySPf9dV1J73WgihZzq6PuFZw8G+5YgCG7KVvmm/unkabEHzQ7 +PKfHT0awGRfZgfsRzbLxnohaXDHE8e2whWjV5ZROXKpeYb7MhFcmPdPAuxx6lPD9 +jocbEA530vTonL3WrAPY9P4v48Upd8xTKy+HmdruBn80tOwnvJeSH+2Itm2Qo6cU +JslOxJYqmIu76aNbh/Is37rZV37zegkNr7RVpE82tUZR8CRnY46f+FrYEJYpZRVc +hg9NOM6fmswG7BAP4oLXOjOERR79Rom/ACZZNcz1PSBJRIarm2eXLUptlTfTR1lb +92wX+KGtYvcLFnr/2RkHDT2Wdcb8s3pI7bhxAgMBAAGjggFWMIIBUjAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBTNjfh4N1yNw7Bo/E0sMOrdcZbJ8TCCAR4GA1Ud +IwSCARUwggERgBRHQxLldx1XvNUDbucIGBP4diteBKGB9aSB8jCB7zEhMB8GCSqG +SIb3DQEJARYSY2FAcGF5c2FmZWNhcmQuY29tMQswCQYDVQQGEwJBVDEPMA0GA1UE +CBMGVmllbm5hMQ8wDQYDVQQHEwZWaWVubmExHDAaBgNVBAsTE3BheXNhZmVjYXJk +IFJvb3QgQ0ExLDAqBgNVBAsTI3BheXNhZmVjYXJkIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MSYwJAYDVQQKEx1wYXlzYWZlY2FyZC5jb20gV2VydGthcnRlbiBBRzEn +MCUGA1UEAxMecGF5c2FmZWNhcmQgUm9vdCBDQSAtIFN5c3RlbSBNggEAMA0GCSqG +SIb3DQEBBAUAA4IBAQAZ7naLoETGD8TW6lAbuZ7ntd9zNqutizAtPzC5bJRq2sL3 +AyIsSDO6jQnJgvHsW3XiBfYP0R8MGbMg5cLvgcyKHjnpkzcGEXFuvOeeh50oWSTl +aJ9VNTvvGK6nY4rQ710I6qCollj+pqlSq4sak/zYJ87lKc8TXEzvzyncYAfrRp3G +XIA5zG3TniBIYC/cuiXjBupmWelFCKRK8/Uhm0vbg71wAWrouJKcBkSMYgZCdEC6 +3g0EBmD94j9FBEiW7q4sUgqYxGTjeOv1Wb4EsHJhq2eBzOKLp+NHYbPzI++50nQU +AjKavlzdAr9PVC8BBS74M567rtIooeIgEDqqi/7J +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfjCCAuegAwIBAgIQAdAC7XDZlmGZ84pH2aljUjANBgkqhkiG9w0BAQUFADCB +zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ +Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE +CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh +d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl +cnZlckB0aGF3dGUuY29tMB4XDTA2MTAyNTAwMDAwMFoXDTA4MTAyNDIzNTk1OVow +gYIxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVubmExDzANBgNVBAcTBlZpZW5u +YTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxKTAnBgNV +BAMTIGN1c3RvbWVyLnRlc3QuYXQucGF5c2FmZWNhcmQuY29tMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQDgay0tcil7faWjhcRYg4HvOt9DA6llt87cxZtkGalY +Fvxr+tKLg2U031cbmQjRpCEXIWeZjIqOreZLK3PNYfQJi7C3m7bU2D8owt6xijt4 +reOsNH5nTy4NNt9J+tUVaRO0YCWG7O2v1T1L4QMwdHjHcsvpoO9NnFM/Sqmo8tSz +EwIDAQABo4GmMIGjMAwGA1UdEwEB/wQCMAAwQAYDVR0fBDkwNzA1oDOgMYYvaHR0 +cDovL2NybC50aGF3dGUuY29tL1RoYXd0ZVNlcnZlclByZW1pdW1DQS5jcmwwHQYD +VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMDIGCCsGAQUFBwEBBCYwJDAiBggr +BgEFBQcwAYYWaHR0cDovL29jc3AudGhhd3RlLmNvbTANBgkqhkiG9w0BAQUFAAOB +gQBzovJPMRON4GSrPeAZ93nDYHHfZMV2yUY0+8Kfi+5smLfV3VaurPjL8WSYA2mY +F1vI2tkNhAbELQwm/6RqrU7AG1wKnoyljzZ9V0Uk7Mfcw3Wg/uCTEtes9NNz6KbW +RM9X8CWd8gJGwTODZy4JU0qMWiETqPvbvzXTX0oihp2nEQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfDCCAuWgAwIBAgIQWAYuIHYD1tplIr6DdfOxoDANBgkqhkiG9w0BAQUFADCB +zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ +Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE +CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh +d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl +cnZlckB0aGF3dGUuY29tMB4XDTA2MTAyNTAwMDAwMFoXDTA4MTAyNDIzNTk1OVow +gYAxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIEwZWaWVubmExDzANBgNVBAcTBlZpZW5u +YTEmMCQGA1UEChMdcGF5c2FmZWNhcmQuY29tIFdlcnRrYXJ0ZW4gQUcxJzAlBgNV +BAMTHmN1c3RvbWVyLmNjLmF0LnBheXNhZmVjYXJkLmNvbTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAs1G3ieyBRUxgDLUAlqipvBtnlsb7W0TqcXYY9MF/XOyp +1KoS6xKcH6dV1PYGUi8roITcEPB2VBnR2lCpqjUwhmeJcXf2sJLIInf0J0ld05qE +G8I6tHh8DOylkN+G9NdbdWsHyQLxiqQ1TkLIAX28ioJziLVSJ0AU/Vw5MSj3x+UC +AwEAAaOBpjCBozAMBgNVHRMBAf8EAjAAMEAGA1UdHwQ5MDcwNaAzoDGGL2h0dHA6 +Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVTZXJ2ZXJQcmVtaXVtQ0EuY3JsMB0GA1Ud +JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAyBggrBgEFBQcBAQQmMCQwIgYIKwYB +BQUHMAGGFmh0dHA6Ly9vY3NwLnRoYXd0ZS5jb20wDQYJKoZIhvcNAQEFBQADgYEA +dLrNu1On6Vp5JWdeFmA0wZjrvbVSXmH3fGuuY5pw+RDDq5AVZ0ug5AoNO90DkAn5 +7s1zOelLs1imjS1MpPKOs7jgC+kbzW/PRFfY1oYSHZdSQGfmTjdz3PtT3XVWMmne +z4cv4RYpEiZrkrxL/fdd36E/Lo0GctmhlXBT7SiNM0g= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDhjCCAu+gAwIBAgIQeO5I3hhbIHHJycO1HXvdwTANBgkqhkiG9w0BAQUFADBfMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsTLkNsYXNzIDMgUHVi +bGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNOTcwNDE3MDAwMDAwWhcN +MTExMDI0MjM1OTU5WjCBujEfMB0GA1UEChMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEXMBUG +A1UECxMOVmVyaVNpZ24sIEluYy4xMzAxBgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwg +U2VydmVyIENBIC0gQ2xhc3MgMzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMgSW5j +b3JwLmJ5IFJlZi4gTElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEA2IKA6NYZAn0fhRg5JaJlK+G/1AXTvOY2O6rwTGxbtueqPHNFVbLx +veqXQu2aNAoV1Klc9UAl3dkHwTKydWzEyruj/lYncUOqY/UwPpMo5frxCTvzt01OOfdcSVq4 +wR3Tsor+cDCVQsv+K1GLWjw6+SJPkLICp1OcTzTnqwSye28CAwEAAaOB5jCB4zAPBgNVHRME +CDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHAQEwKjAoBggrBgEFBQcCARYcaHR0 +cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQUzA0BgNVHR8ELTArMCmgJ6AlhiNodHRwOi8vY3Js +LnZlcmlzaWduLmNvbS9wY2EzLWcyLmNybDA0BgNVHSUELTArBggrBgEFBQcDAQYIKwYBBQUH +AwIGCWCGSAGG+EIEAQYKYIZIAYb4RQEIATALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4GBACNd7qYkBf1202oa1rpGBqpqDwOQZrKwpsKeyR6jVVOv +PkX93Iwn3VM4Cbt8Syu6lUr+cE4badY8908HxfIXWkyij6wLigbbudRrxR1Y2hdS4yHx0tda +1eWrWXsheoZq1P4XETpTDZxgoErZXuQdDCmqEwdlhh+/tMmCU5wsAo8j +-----END CERTIFICATE----- + diff --git a/modules/paysafecard/logo.gif b/modules/paysafecard/logo.gif new file mode 100644 index 000000000..685963854 Binary files /dev/null and b/modules/paysafecard/logo.gif differ diff --git a/modules/paysafecard/payment.php b/modules/paysafecard/payment.php new file mode 100644 index 000000000..96b5d5255 --- /dev/null +++ b/modules/paysafecard/payment.php @@ -0,0 +1,102 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/paysafecard.php'); + +$module = new PaysafeCard(); + +if (!$cart->id OR $cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$module->active) + Tools::redirect('order.php?step=3'); + +$currency = new Currency($cart->id_currency); +if (!$module->isCurrencyActive($currency->iso_code)) + Tools::redirect('order.php?step=3'); + +$amount = number_format((float)($cart->getOrderTotal(true, Cart::BOTH)), 2, '.',''); +if (Tools::getValue('hash') != md5(Configuration::get($module->prefix.'SALT') + $amount + $currency->iso_code)) + die(Tools::displayError()); + +$result = $module->getDispositionState((int)($cart->id)); +$state = _PS_OS_ERROR_; + +$disposition = Disposition::getByCartId((int)($cart->id)); + +$message = 'Transaction ID #'.$disposition['mtid'].': '.$disposition['amount'].$disposition['currency'].'
        '. date('Y-m-d').' '; +if ($result[0] == 0) +{ + list ($rc, $errorcode, $error_message, $amount, $used_currency, $state) = $result; + + if ($state == PrepaidServicesAPI::DISPOSITION_DISPOSED || $state == PrepaidServicesAPI::DISPOSITION_DEBITED) + { + $state = _PS_OS_PAYMENT_; + $message .= $module->getL('disposition_created'); + } else { + $message .= $module->getL('disposition_invalid').' '.$state; + } +} else { + $message .= 'payment_error'.' '.$result[2]; +} + +if ($state != _PS_OS_ERROR_) +{ + $state = (int)(Configuration::get($module->prefix.'ORDER_STATE_ID')); + + if (Configuration::get($module->prefix.'IMMEDIAT_PAYMENT')) + { + $message .= '
        '.date('Y-m-d').' '; + $result = $module->executeDebit((int)($cart->id)); + + if ($result[0] != 0) + { + $message .= $module->getL('payment_error').' '.$result[2]; + $state = _PS_OS_ERROR_; + } + else + { + $message .= $module->getL('payment_accepted'); + $state = _PS_OS_PAYMENT_; + } + } +} + +$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key); + +if ($state == _PS_OS_ERROR_) +{ + include(dirname(__FILE__).'/../../header.php'); + echo $message; + include(dirname(__FILE__).'/../../footer.php'); +} +else +{ + $order = new Order($module->currentOrder); + Tools::redirect('order-confirmation.php?id_cart='.(int)($cart->id).'&id_module='.(int)($module->id).'&id_order='.(int)($module->currentOrder).'&key='.$order->secure_key); +} + + + diff --git a/modules/paysafecard/payment.tpl b/modules/paysafecard/payment.tpl new file mode 100644 index 000000000..9bbe3afa5 --- /dev/null +++ b/modules/paysafecard/payment.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + + + {l s='Pay with' mod='paysafecard'} {$payment_name} + +

        diff --git a/modules/paysafecard/paysafecard-accept-payment.tpl b/modules/paysafecard/paysafecard-accept-payment.tpl new file mode 100644 index 000000000..85d9ed54c --- /dev/null +++ b/modules/paysafecard/paysafecard-accept-payment.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +
        + {$payment_name} + {if $error} + {$error} + {/if} + +

        {l s='Payment has not been accepted yet:' mod='paysafecard'}

        +

        +

        + {$currency} + + +
        +

        +
        + diff --git a/modules/paysafecard/paysafecard-confirmation.tpl b/modules/paysafecard/paysafecard-confirmation.tpl new file mode 100644 index 000000000..e4df64e53 --- /dev/null +++ b/modules/paysafecard/paysafecard-confirmation.tpl @@ -0,0 +1,32 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Your order on' mod='paysafecard'} {$shop_name} {l s='is complete.' mod='paysafecard'} +

        + {l s='You have chosen the' mod='paysafecard'} {$payment_name} {l s='method.' mod='paysafecard'} +

        {l s='Your order will be sent very soon.' mod='paysafecard'} +

        {l s='For any questions or for further information, please contact our' mod='paysafecard'} {l s='customer support' mod='paysafecard'}. +

        diff --git a/modules/paysafecard/paysafecard.php b/modules/paysafecard/paysafecard.php new file mode 100644 index 000000000..ef4f508d7 --- /dev/null +++ b/modules/paysafecard/paysafecard.php @@ -0,0 +1,116 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +if (!in_array('PrepaidServices', get_declared_classes())) include_once(_PS_MODULE_DIR_.'/paysafecard/PrepaidServices.php'); + + +class PaysafeCard extends PrepaidServices +{ + public $prefix = 'PS_PSC_'; + protected $supported_languages = array('de', 'en', 'gr', 'el', 'es', 'it', 'fr', 'nl', 'pl', 'pt', 'si', 'sk', 'tr'); + protected $allowed_currencies = array(); + + protected $environments = array('P' => 'Production', + 'T' => 'Test'); + + protected $business_types = array('I' => 'Intangible', + 'T' => 'Tangible'); + + protected $payment_url = array('T' =>'https://customer.test.at.paysafecard.com/psccustomer/GetCustomerPanelServlet', + 'P' => 'https://customer.cc.at.paysafecard.com/psccustomer/GetCustomerPanelServlet'); + + protected $supported_currencies = array('EUR', 'GBP', 'CHF', 'USD', 'PLN', 'CZK', 'SEK', 'DKK', 'RON', 'NOK', 'ARS'); + + protected $register_url = array('en' => 'http://www.prestashop.com/partner/url.php?to=http://www.paysafecard.com/index.php?id=947&L=8', + 'fr' => 'http://www.prestashop.com/partner/url.php?to=http://www.paysafecard.com/index.php?id=947&L=3', + 'es' => 'http://www.prestashop.com/partner/url.php?to=http://www.paysafecard.com/index.php?id=947&L=9'); + + + protected $certificat_dir; + + public function __construct() + { + $this->name = 'paysafecard'; + $this->tab = 'payments_gateways'; + $this->version = 1.2; + $this->module_dir = dirname(__FILE__); + $this->certificat_dir = dirname(__FILE__).'/keyring/'; + + parent::__construct(); + + $this->displayName = $this->l('PaysafeCard'); + $this->description = $this->l('Accepts payments by PaysafeCard.'); + } + + public function getL($key) + { + $translations = array( + 'disposition_created' => $this->l('Disposition created. Waiting for debit.'), + 'disposition_invalid' => $this->l('Invalid disposition state:'), + 'payment_error' => $this->l('An error has occurred during payment:'), + 'payment_accepted' => $this->l('Payment accepted.'), + 'curl_required' => $this->l('This module requires the curl PHP extension to function properly.'), + 'not_writable' => $this->l('Not writable!'), + 'currency_required' => $this->l('This module requires the currency: '), + 'configure_currency' => $this->l('Configure each currency individually:'), + 'payment_not_displayed' => $this->l('(The payment module will not be displayed for customers using non configured currency.)'), + 'configuration_in' => $this->l('Configuration in '), + 'merchant_id' => $this->l('Merchant ID'), + 'keyring_certificate' => $this->l('Keyring Certificate'), + 'keyring_pw' => $this->l('Keyring PW'), + 'configuration' => $this->l('Configuration'), + 'environment' => $this->l('Environment'), + 'business_type' => $this->l('Business Type'), + 'immediat_payment' => $this->l('Immediate Payment'), + 'update_configuration' => $this->l('Update configuration'), + 'certificate_required' => $this->l('You must provide a certificate for MERCHANT ID'), + 'invalid_file' => $this->l('Invalid file'), + 'invalid_merchant_id' => $this->l('Invalid Merchant ID'), + 'invalid_business_type' => $this->displayError('Invalid business type'), + 'invalid_environment' => $this->displayError('Invalid environment'), + 'settings_updated' => $this->l('Settings updated'), + 'file_partialy_uploaded' => $this->l('The file was partially uploaded.'), + 'file_empty' => $this->l('The file is empty.'), + 'cant_create_dispo' => $this->l('Transaction could not be initiated due to connection problems. If the problem persists, please contact support.'), + 'disposition_consumed' => $this->l('Disposition consumed'), + 'payment_released' => $this->l('Disposition released'), + 'release_error' => $this->l('An error has occurred during the release'), + 'introduction' => $this->l('Paysafecard is Europe’s first prepaid solution for payments over the Internet to comply with banking laws. Over the past years, paysafecard has become one of Europe’s leading alternative online payment solutions.'), + 'register' => $this->l('Learn more') + ); + + return $translations[$key]; + } + + protected function _getErrorMsgFromErrorCode($error_code) + { + $error_msg = array(1 => $this->l('An error has occurred, check Messages for more info'), + 2 => $this->l('Invalid amount')); + + return $error_msg[$error_code]; + } +} + diff --git a/modules/paysafecard/prepaidservices.js b/modules/paysafecard/prepaidservices.js new file mode 100644 index 000000000..80bdf4926 --- /dev/null +++ b/modules/paysafecard/prepaidservices.js @@ -0,0 +1,38 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function toggleImediatPayment() +{ + if ($('#ct_business_type').val() == 'I') + $('#imediat_payment').hide(); + else + $('#imediat_payment').show(); +} + +$(document).ready(function() { + toggleImediatPayment(); +}); + diff --git a/modules/paysafecard/redirect.php b/modules/paysafecard/redirect.php new file mode 100644 index 000000000..2ea48a3ee --- /dev/null +++ b/modules/paysafecard/redirect.php @@ -0,0 +1,50 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/paysafecard.php'); + +$module = new PaysafeCard(); + +if (!$cart->id OR $cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$module->active) + Tools::redirect('order.php?step=3'); + +$currency = new Currency($cart->id_currency); +if (!$module->isCurrencyActive($currency->iso_code)) + Tools::redirect('order.php?step=3'); + +$result = $module->createDisposition($cart); + +if ($result['return_code'] != 0) +{ + include(dirname(__FILE__).'/../../header.php'); + echo $module->getL('cant_create_dispo'); + include(dirname(__FILE__).'/../../footer.php'); +} +else + Tools::redirectLink($result['message']); + diff --git a/modules/prestafraud/config.xml b/modules/prestafraud/config.xml new file mode 100644 index 000000000..2aff51b5f --- /dev/null +++ b/modules/prestafraud/config.xml @@ -0,0 +1,11 @@ + + + prestafraud + PrestaShop Security + 0.99 + Protect your store from fraudulent payments + PrestaShop + payment_security + 1 + 1 + diff --git a/modules/prestafraud/de.php b/modules/prestafraud/de.php new file mode 100644 index 000000000..308dcd810 --- /dev/null +++ b/modules/prestafraud/de.php @@ -0,0 +1,62 @@ +prestafraud_4d0a6a9777a818ecc3b59b9a8ecd0c43'] = '- Bitte wählen Sie Ihre Haupttätigkeit -'; +$_MODULE['<{prestafraud}prestashop>prestafraud_5a600f5b88f416c470991c6831add13a'] = 'Erwachsene'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0fe4ca3df29658482098bb33a2ff66e5'] = 'Tiere und Haustiere'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9e4359f35054190eba36e09466e39d01'] = 'Kunst und Kultur'; +$_MODULE['<{prestafraud}prestashop>prestafraud_066cd752c82ddc6231a9723b5822a945'] = 'Babys'; +$_MODULE['<{prestafraud}prestashop>prestafraud_41a081c3f3042ac40117cf295350870d'] = 'Schönheit und Körperpflege'; +$_MODULE['<{prestafraud}prestashop>prestafraud_f2b545a8abb14f8706f808a79277c061'] = 'KFZ'; +$_MODULE['<{prestafraud}prestashop>prestafraud_39bb2fdc532f8984d8348863c86ebfca'] = 'Computer Hardware und Software'; +$_MODULE['<{prestafraud}prestashop>prestafraud_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Download'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8bdd8b2357d516da5b81eb16746ba9a9'] = 'Mode und Accessoires'; +$_MODULE['<{prestafraud}prestashop>prestafraud_33cb31c5505618a808d3bcd7490a793c'] = 'Blumen, Geschenke und Kunsthandwerk'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0570b6d9de5c37a026e69c6987fc27f6'] = 'Nahrungsmittel und Getränke'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4b73b8913afcdf06d9f49c176306d950'] = 'HiFi, Foto und Video'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2e9d6500d9b2a65985a621f0f0afdeb3'] = 'Haus und Garten'; +$_MODULE['<{prestafraud}prestashop>prestafraud_83dd3493957bcd92a37bc39111f670b8'] = 'Haushaltsgeräte'; +$_MODULE['<{prestafraud}prestashop>prestafraud_565631402af79df42f22a117b0d6f1a5'] = 'Schmuck'; +$_MODULE['<{prestafraud}prestashop>prestafraud_18848d605251b3627014c6a58c14c449'] = 'Mobile Geräte und Telekommunikation'; +$_MODULE['<{prestafraud}prestashop>prestafraud_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Dienstleistungen'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4ef7205b13f6821177d0dbc2fb90f79e'] = 'Schuhe und Zubehör'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9503054261b8aeed48e0a3902019b579'] = 'Sport und Unterhaltung'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1fb0f99b55e6c2be35aed72ebe38c245'] = 'Reisen'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Scheck'; +$_MODULE['<{prestafraud}prestashop>prestafraud_35b4b09d5d0686ec5c2e2cc9f3d9039c'] = 'Banküberweisung'; +$_MODULE['<{prestafraud}prestashop>prestafraud_e7f9e382dc50889098cbe56f2554c77b'] = 'Kreditkarte'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1cf575079afed29675c47e822bc3d493'] = 'mehrere Kreditkarten'; +$_MODULE['<{prestafraud}prestashop>prestafraud_75b95ea268cb6b5baf7483aafa80d5ad'] = 'Prepaid-Konto (Moneybookers, PayPal, ...)'; +$_MODULE['<{prestafraud}prestashop>prestafraud_688000bea2f79c9ca3d2d1755456024f'] = 'Bitte akzeptieren Sie die Nutzungsbedingungen.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8dc42e0ea3bedd2c1cc400141540cf62'] = 'PrestaShop Security Konfiguration'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7e97953add2f27fce07653151ba3e862'] = 'Mein Shop hat noch kein Konto auf PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3b2aee63259f6dc9b94914884474f8de'] = 'Ich habe bereits ein Konto'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9d5c4ae518b30bacdb69912d87b3406a'] = 'Ihre E-Mail:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_6c3b9b51615d1d57773f25903da2018c'] = 'Shop URL:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_36380b31592ff6bf7be94513409871b6'] = 'Ich stimme den Bedingungen von PrestaShop Security Service zu und halte mich bedingungslos an sie.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_42369faa6a6b243aac58683f3874bf99'] = 'Konto erstellen'; +$_MODULE['<{prestafraud}prestashop>prestafraud_212713efb37cd2f521ee584f1dbb5f0b'] = 'Shop-ID:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c6b84387320705147af2f9e79d72c6fc'] = 'Shop SCHLÜSSEL:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b51cb26e6b60a3ff585ab9f757495c52'] = 'Shop-Aktivität:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ab8cba13a061fe8d4a330bcc8d6b0175'] = 'Lieferanten:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_914419aa32f04011357d3b604a86d7eb'] = 'Lieferant'; +$_MODULE['<{prestafraud}prestashop>prestafraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Lieferantenart'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Wählen Sie eine Lieferantenart...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2edfe3cd8034975c073e23158e976428'] = 'Zahlungen:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Zahlungs-Modul'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Zahlungsart'; +$_MODULE['<{prestafraud}prestashop>prestafraud_827638f0be5ae74be04ed494087de714'] = 'Wählen Sie eine Zahlungsart ...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{prestafraud}prestashop>prestafraud_16648260e58b4cf9d458e1a197ef43f1'] = 'E-Mail ist ungültig'; +$_MODULE['<{prestafraud}prestashop>prestafraud_cb18f4dc13847e2ed5d69cb936f9b26c'] = 'Shop-URL ist ungültig'; +$_MODULE['<{prestafraud}prestashop>prestafraud_eed029a9cfe78c1230a654e58fe8b6f8'] = 'PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_950c093b260d7c7709f8ff96e10a6fe0'] = 'Diese Bestellung wurde hat nicht an PrestaShop Security gesandt.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_d0c6a2fa938df84c0ce628de99c97e16'] = 'Wertung:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt'; +$_MODULE['<{prestafraud}prestashop>prestafraud_240f3031f25601fa128bd4e15f0a37de'] = 'Kommentar:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b88011726eba59d6bf37f0fdec202edc'] = 'Diese Bestellung als Betrug an PrestaShop melden'; +$_MODULE['<{prestafraud}prestashop>prestafraud_a8bbb000124c9697aa5d63e7e758b64d'] = 'Geschäftsabholung'; +$_MODULE['<{prestafraud}prestashop>prestafraud_08eb31af908e2244867f6e812f82e935'] = 'Abholungspunkt'; +$_MODULE['<{prestafraud}prestashop>prestafraud_880f973e4ddae42c6bebd2c31bb977f8'] = 'Langsamer Versand mehr als 3 Tage'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b61de91e556aee84e83c3fde8ef67ddc'] = 'Express-Versand'; diff --git a/modules/prestafraud/es.php b/modules/prestafraud/es.php new file mode 100644 index 000000000..a284c5a61 --- /dev/null +++ b/modules/prestafraud/es.php @@ -0,0 +1,62 @@ +prestafraud_4d0a6a9777a818ecc3b59b9a8ecd0c43'] = '- Por favor, elija su actividad principal -'; +$_MODULE['<{prestafraud}prestashop>prestafraud_5a600f5b88f416c470991c6831add13a'] = 'Adultos'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0fe4ca3df29658482098bb33a2ff66e5'] = 'Animales y animales domésticos'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9e4359f35054190eba36e09466e39d01'] = 'Arte y Cultura'; +$_MODULE['<{prestafraud}prestashop>prestafraud_066cd752c82ddc6231a9723b5822a945'] = 'Bebés'; +$_MODULE['<{prestafraud}prestashop>prestafraud_41a081c3f3042ac40117cf295350870d'] = 'Belleza e higiene personal'; +$_MODULE['<{prestafraud}prestashop>prestafraud_f2b545a8abb14f8706f808a79277c061'] = 'Automóviles'; +$_MODULE['<{prestafraud}prestashop>prestafraud_39bb2fdc532f8984d8348863c86ebfca'] = 'Material informático y softwares'; +$_MODULE['<{prestafraud}prestashop>prestafraud_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Descargas'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8bdd8b2357d516da5b81eb16746ba9a9'] = 'Moda y complementos'; +$_MODULE['<{prestafraud}prestashop>prestafraud_33cb31c5505618a808d3bcd7490a793c'] = 'Flores, regalos y artesanía'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0570b6d9de5c37a026e69c6987fc27f6'] = 'Alimentación y bebidas'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4b73b8913afcdf06d9f49c176306d950'] = 'HiFi, Foto y Vídeo'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2e9d6500d9b2a65985a621f0f0afdeb3'] = 'Casa y Jardín'; +$_MODULE['<{prestafraud}prestashop>prestafraud_83dd3493957bcd92a37bc39111f670b8'] = 'Home Appliances'; +$_MODULE['<{prestafraud}prestashop>prestafraud_565631402af79df42f22a117b0d6f1a5'] = 'Joyas'; +$_MODULE['<{prestafraud}prestashop>prestafraud_18848d605251b3627014c6a58c14c449'] = 'Móviles y Telefonía'; +$_MODULE['<{prestafraud}prestashop>prestafraud_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Servicios'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4ef7205b13f6821177d0dbc2fb90f79e'] = 'Calzado y Complementos'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9503054261b8aeed48e0a3902019b579'] = 'Deporte y Ocio'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1fb0f99b55e6c2be35aed72ebe38c245'] = 'Viajes'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Cheque'; +$_MODULE['<{prestafraud}prestashop>prestafraud_35b4b09d5d0686ec5c2e2cc9f3d9039c'] = 'Transferencia bancaria'; +$_MODULE['<{prestafraud}prestashop>prestafraud_e7f9e382dc50889098cbe56f2554c77b'] = 'Tarjeta de crédito'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1cf575079afed29675c47e822bc3d493'] = 'Tarjeta de crédito en varias veces'; +$_MODULE['<{prestafraud}prestashop>prestafraud_75b95ea268cb6b5baf7483aafa80d5ad'] = 'Cuenta prepagada (MoneyBookers, PayPal,...)'; +$_MODULE['<{prestafraud}prestashop>prestafraud_688000bea2f79c9ca3d2d1755456024f'] = 'Debe aceptar las condiciones del servicio'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8dc42e0ea3bedd2c1cc400141540cf62'] = 'Confuguración de PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7e97953add2f27fce07653151ba3e862'] = 'Mi tienda aún no dispone de cuenta en PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3b2aee63259f6dc9b94914884474f8de'] = 'Ya tengo una cuenta'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9d5c4ae518b30bacdb69912d87b3406a'] = 'Su email:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_6c3b9b51615d1d57773f25903da2018c'] = 'URL de la tienda:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_36380b31592ff6bf7be94513409871b6'] = 'He leido las condiciones de servicio PrestaShop Security y las acepto sin condiciones'; +$_MODULE['<{prestafraud}prestashop>prestafraud_42369faa6a6b243aac58683f3874bf99'] = 'Crear una cuenta'; +$_MODULE['<{prestafraud}prestashop>prestafraud_212713efb37cd2f521ee584f1dbb5f0b'] = 'ID de la tienda:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c6b84387320705147af2f9e79d72c6fc'] = 'Clave de la tienda:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b51cb26e6b60a3ff585ab9f757495c52'] = 'Actividad de la tienda:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ab8cba13a061fe8d4a330bcc8d6b0175'] = 'Transportistas:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_914419aa32f04011357d3b604a86d7eb'] = 'Transportista'; +$_MODULE['<{prestafraud}prestashop>prestafraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo de transportista'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Elija un tipo de transportista...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2edfe3cd8034975c073e23158e976428'] = 'Pagos:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Módulo de pago'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo de pago'; +$_MODULE['<{prestafraud}prestashop>prestafraud_827638f0be5ae74be04ed494087de714'] = 'Elija un tipo de pago'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{prestafraud}prestashop>prestafraud_16648260e58b4cf9d458e1a197ef43f1'] = 'El email no es válido'; +$_MODULE['<{prestafraud}prestashop>prestafraud_cb18f4dc13847e2ed5d69cb936f9b26c'] = 'URL de la tienda no válido'; +$_MODULE['<{prestafraud}prestashop>prestafraud_eed029a9cfe78c1230a654e58fe8b6f8'] = 'PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_950c093b260d7c7709f8ff96e10a6fe0'] = 'Este pedido no se ha enviado a PrestaShop Security.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_d0c6a2fa938df84c0ce628de99c97e16'] = 'Nota:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido'; +$_MODULE['<{prestafraud}prestashop>prestafraud_240f3031f25601fa128bd4e15f0a37de'] = 'Comentario:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b88011726eba59d6bf37f0fdec202edc'] = 'Notificar este pedido como un fraude a PrestaShop'; +$_MODULE['<{prestafraud}prestashop>prestafraud_a8bbb000124c9697aa5d63e7e758b64d'] = 'Recoger en tienda'; +$_MODULE['<{prestafraud}prestashop>prestafraud_08eb31af908e2244867f6e812f82e935'] = 'Punto de recogida'; +$_MODULE['<{prestafraud}prestashop>prestafraud_880f973e4ddae42c6bebd2c31bb977f8'] = 'Envío lento superior a 3 días'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b61de91e556aee84e83c3fde8ef67ddc'] = 'Envío express'; diff --git a/modules/prestafraud/fr.php b/modules/prestafraud/fr.php new file mode 100644 index 000000000..7c76f1f72 --- /dev/null +++ b/modules/prestafraud/fr.php @@ -0,0 +1,62 @@ +prestafraud_4d0a6a9777a818ecc3b59b9a8ecd0c43'] = '- Merci de choisir votre activité principale -'; +$_MODULE['<{prestafraud}prestashop>prestafraud_5a600f5b88f416c470991c6831add13a'] = 'Adultes'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0fe4ca3df29658482098bb33a2ff66e5'] = 'Animaux et animaux domestiques'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9e4359f35054190eba36e09466e39d01'] = 'Art et Culture'; +$_MODULE['<{prestafraud}prestashop>prestafraud_066cd752c82ddc6231a9723b5822a945'] = 'Bébés'; +$_MODULE['<{prestafraud}prestashop>prestafraud_41a081c3f3042ac40117cf295350870d'] = 'Beauté et soins personnels'; +$_MODULE['<{prestafraud}prestashop>prestafraud_f2b545a8abb14f8706f808a79277c061'] = 'Voitures'; +$_MODULE['<{prestafraud}prestashop>prestafraud_39bb2fdc532f8984d8348863c86ebfca'] = 'Matériel informatique et logiciel'; +$_MODULE['<{prestafraud}prestashop>prestafraud_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Téléchargement'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8bdd8b2357d516da5b81eb16746ba9a9'] = 'Mode et accessoires'; +$_MODULE['<{prestafraud}prestashop>prestafraud_33cb31c5505618a808d3bcd7490a793c'] = 'Fleurs, cadeaux et artisanat'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0570b6d9de5c37a026e69c6987fc27f6'] = 'Aliments et boissons'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4b73b8913afcdf06d9f49c176306d950'] = 'Hi-fi, Photo et Vidéo'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2e9d6500d9b2a65985a621f0f0afdeb3'] = 'Maison et jardin'; +$_MODULE['<{prestafraud}prestashop>prestafraud_83dd3493957bcd92a37bc39111f670b8'] = 'Home Appliances'; +$_MODULE['<{prestafraud}prestashop>prestafraud_565631402af79df42f22a117b0d6f1a5'] = 'Bijoux'; +$_MODULE['<{prestafraud}prestashop>prestafraud_18848d605251b3627014c6a58c14c449'] = 'Mobile et Telecom'; +$_MODULE['<{prestafraud}prestashop>prestafraud_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Services'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4ef7205b13f6821177d0dbc2fb90f79e'] = 'Chaussures et accessoires'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9503054261b8aeed48e0a3902019b579'] = 'Sport et Loisirs'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1fb0f99b55e6c2be35aed72ebe38c245'] = 'Voyage'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Chèque'; +$_MODULE['<{prestafraud}prestashop>prestafraud_35b4b09d5d0686ec5c2e2cc9f3d9039c'] = 'Virement bancaire'; +$_MODULE['<{prestafraud}prestashop>prestafraud_e7f9e382dc50889098cbe56f2554c77b'] = 'Carte de crédit'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1cf575079afed29675c47e822bc3d493'] = 'Carte de crédit en plusieurs fois'; +$_MODULE['<{prestafraud}prestashop>prestafraud_75b95ea268cb6b5baf7483aafa80d5ad'] = 'Compte prépayé (MoneyBookers, PayPal ...)'; +$_MODULE['<{prestafraud}prestashop>prestafraud_688000bea2f79c9ca3d2d1755456024f'] = 'Merci d\'accepter les termes du service.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8dc42e0ea3bedd2c1cc400141540cf62'] = 'Configuration de PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7e97953add2f27fce07653151ba3e862'] = 'Mon magasin n\'a pas encore de compte sur Prestashop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3b2aee63259f6dc9b94914884474f8de'] = 'J\'ai déjà un compte'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9d5c4ae518b30bacdb69912d87b3406a'] = 'Votre email:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_6c3b9b51615d1d57773f25903da2018c'] = 'URL de la boutique:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_36380b31592ff6bf7be94513409871b6'] = 'Je suis d\'accord avec les conditions de service PrestaShop Security et y adhére sans condition.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_42369faa6a6b243aac58683f3874bf99'] = 'Créer un compte'; +$_MODULE['<{prestafraud}prestashop>prestafraud_212713efb37cd2f521ee584f1dbb5f0b'] = 'Shop ID:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c6b84387320705147af2f9e79d72c6fc'] = 'Shop Key:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b51cb26e6b60a3ff585ab9f757495c52'] = 'Activité de la boutique:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ab8cba13a061fe8d4a330bcc8d6b0175'] = 'Transporteurs:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{prestafraud}prestashop>prestafraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Type de transporteur'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Choisissez un type de transporteur...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2edfe3cd8034975c073e23158e976428'] = 'Paiements:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Module de paiement'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Type de paiement'; +$_MODULE['<{prestafraud}prestashop>prestafraud_827638f0be5ae74be04ed494087de714'] = 'Choisissez un type de paiement ...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{prestafraud}prestashop>prestafraud_16648260e58b4cf9d458e1a197ef43f1'] = 'Email est invalide'; +$_MODULE['<{prestafraud}prestashop>prestafraud_cb18f4dc13847e2ed5d69cb936f9b26c'] = 'URL de la boutique n\'est pas valide'; +$_MODULE['<{prestafraud}prestashop>prestafraud_eed029a9cfe78c1230a654e58fe8b6f8'] = 'PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_950c093b260d7c7709f8ff96e10a6fe0'] = 'Cette commande n\'a pas été envoyé à PrestaShop Security.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_d0c6a2fa938df84c0ce628de99c97e16'] = 'Notation:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu'; +$_MODULE['<{prestafraud}prestashop>prestafraud_240f3031f25601fa128bd4e15f0a37de'] = 'Commentaire:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b88011726eba59d6bf37f0fdec202edc'] = 'Rapporter cette commande comme une fraude à PrestaShop'; +$_MODULE['<{prestafraud}prestashop>prestafraud_a8bbb000124c9697aa5d63e7e758b64d'] = 'Retrait en magasin'; +$_MODULE['<{prestafraud}prestashop>prestafraud_08eb31af908e2244867f6e812f82e935'] = 'Point de retrait, point relais'; +$_MODULE['<{prestafraud}prestashop>prestafraud_880f973e4ddae42c6bebd2c31bb977f8'] = 'Livraison lente de plus de 3 jours'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b61de91e556aee84e83c3fde8ef67ddc'] = 'Livraison express'; diff --git a/modules/prestafraud/install.sql b/modules/prestafraud/install.sql new file mode 100644 index 000000000..62c775644 --- /dev/null +++ b/modules/prestafraud/install.sql @@ -0,0 +1,29 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_prestafraud_carrier` +( + `id_carrier` int(11) default NULL, + `id_prestafraud_carrier_type` int(11) default NULL, + PRIMARY KEY (`id_carrier`, `id_prestafraud_carrier_type`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_prestafraud_payment` +( + `id_module` int(11) default NULL, + `id_prestafraud_payment_type` int(11) default NULL, + PRIMARY KEY (`id_module`, `id_prestafraud_payment_type`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_prestafraud_carts` +( + `id_cart` int(11) default NULL, + `ip_address` int(11) default NULL, + `date` DATETIME NOT NULL, + PRIMARY KEY (`id_cart`, `ip_address`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_prestafraud_orders` +( + `id_order` int(11) default NULL, + `scoring` decimal(2,2) default NULL, + `comment` VARCHAR(255) default NULL, + PRIMARY KEY (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/modules/prestafraud/it.php b/modules/prestafraud/it.php new file mode 100755 index 000000000..5ee984846 --- /dev/null +++ b/modules/prestafraud/it.php @@ -0,0 +1,62 @@ +prestafraud_4d0a6a9777a818ecc3b59b9a8ecd0c43'] = '- Scegli la tua attività principale -'; +$_MODULE['<{prestafraud}prestashop>prestafraud_5a600f5b88f416c470991c6831add13a'] = 'Adulti'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0fe4ca3df29658482098bb33a2ff66e5'] = 'Animali'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9e4359f35054190eba36e09466e39d01'] = 'Arte e Cultura'; +$_MODULE['<{prestafraud}prestashop>prestafraud_066cd752c82ddc6231a9723b5822a945'] = 'Neonati'; +$_MODULE['<{prestafraud}prestashop>prestafraud_41a081c3f3042ac40117cf295350870d'] = 'Bellezza e cura della persona'; +$_MODULE['<{prestafraud}prestashop>prestafraud_f2b545a8abb14f8706f808a79277c061'] = 'Auto'; +$_MODULE['<{prestafraud}prestashop>prestafraud_39bb2fdc532f8984d8348863c86ebfca'] = 'Computer Hardware e Software'; +$_MODULE['<{prestafraud}prestashop>prestafraud_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Download'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8bdd8b2357d516da5b81eb16746ba9a9'] = 'Moda e Accessori'; +$_MODULE['<{prestafraud}prestashop>prestafraud_33cb31c5505618a808d3bcd7490a793c'] = 'Fiori, regali e oggettistica'; +$_MODULE['<{prestafraud}prestashop>prestafraud_0570b6d9de5c37a026e69c6987fc27f6'] = 'Alimenti e bevande'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4b73b8913afcdf06d9f49c176306d950'] = 'Hi-Fi, Foto e Video'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2e9d6500d9b2a65985a621f0f0afdeb3'] = 'Casa e Giardino'; +$_MODULE['<{prestafraud}prestashop>prestafraud_83dd3493957bcd92a37bc39111f670b8'] = 'Elettrodomestici'; +$_MODULE['<{prestafraud}prestashop>prestafraud_565631402af79df42f22a117b0d6f1a5'] = 'Gioielli'; +$_MODULE['<{prestafraud}prestashop>prestafraud_18848d605251b3627014c6a58c14c449'] = 'Telefonia mobile'; +$_MODULE['<{prestafraud}prestashop>prestafraud_992a0f0542384f1ee5ef51b7cf4ae6c4'] = 'Servizi'; +$_MODULE['<{prestafraud}prestashop>prestafraud_4ef7205b13f6821177d0dbc2fb90f79e'] = 'Scarpe e accessori'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9503054261b8aeed48e0a3902019b579'] = 'Sport e Spettacolo'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1fb0f99b55e6c2be35aed72ebe38c245'] = 'Viaggi'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Assegno'; +$_MODULE['<{prestafraud}prestashop>prestafraud_35b4b09d5d0686ec5c2e2cc9f3d9039c'] = 'Bonifico bancario'; +$_MODULE['<{prestafraud}prestashop>prestafraud_e7f9e382dc50889098cbe56f2554c77b'] = 'Carta di credito'; +$_MODULE['<{prestafraud}prestashop>prestafraud_1cf575079afed29675c47e822bc3d493'] = 'Carte di credito multiple'; +$_MODULE['<{prestafraud}prestashop>prestafraud_75b95ea268cb6b5baf7483aafa80d5ad'] = 'Conto prepagato (Moneybookers, PayPal ...)'; +$_MODULE['<{prestafraud}prestashop>prestafraud_688000bea2f79c9ca3d2d1755456024f'] = 'Si prega di accettare i termini del servizio.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_8dc42e0ea3bedd2c1cc400141540cf62'] = 'Configurazione PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7e97953add2f27fce07653151ba3e862'] = 'Il mio negozio non ha ancora account su PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_3b2aee63259f6dc9b94914884474f8de'] = 'Ho già un account'; +$_MODULE['<{prestafraud}prestashop>prestafraud_9d5c4ae518b30bacdb69912d87b3406a'] = 'Il tuo indirizzo email:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_6c3b9b51615d1d57773f25903da2018c'] = 'Url negozio'; +$_MODULE['<{prestafraud}prestashop>prestafraud_36380b31592ff6bf7be94513409871b6'] = 'Accetto i termini del servizio PrestaShop Security e vi aderisco incondizionatamente.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_42369faa6a6b243aac58683f3874bf99'] = 'Crea un account'; +$_MODULE['<{prestafraud}prestashop>prestafraud_212713efb37cd2f521ee584f1dbb5f0b'] = 'ID negozio:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c6b84387320705147af2f9e79d72c6fc'] = 'KEY negozio:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b51cb26e6b60a3ff585ab9f757495c52'] = 'Attività negozio:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ab8cba13a061fe8d4a330bcc8d6b0175'] = 'Corrieri:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_914419aa32f04011357d3b604a86d7eb'] = 'Corriere'; +$_MODULE['<{prestafraud}prestashop>prestafraud_fecb07f7ab46e23e9b520a9a9af7b97b'] = 'Tipo di corriere'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b04ad61ad875f6e7149fdd51c2e60ce2'] = 'Scegli un tipo di corriere...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_2edfe3cd8034975c073e23158e976428'] = 'Pagamenti:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_ec51b543e5a38f6044c83f21dce2b23d'] = 'Modulo Pagamento'; +$_MODULE['<{prestafraud}prestashop>prestafraud_7c9a3504dd4ce74b8021267ae1802968'] = 'Tipo di pagamento'; +$_MODULE['<{prestafraud}prestashop>prestafraud_827638f0be5ae74be04ed494087de714'] = 'Scegli un tipo di pagamento ...'; +$_MODULE['<{prestafraud}prestashop>prestafraud_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{prestafraud}prestashop>prestafraud_16648260e58b4cf9d458e1a197ef43f1'] = 'E-mail non è valida'; +$_MODULE['<{prestafraud}prestashop>prestafraud_cb18f4dc13847e2ed5d69cb936f9b26c'] = 'URL Shop non è valido'; +$_MODULE['<{prestafraud}prestashop>prestafraud_eed029a9cfe78c1230a654e58fe8b6f8'] = 'PrestaShop Security'; +$_MODULE['<{prestafraud}prestashop>prestafraud_950c093b260d7c7709f8ff96e10a6fe0'] = 'Questo ordine non è stato inviato a PrestaShop Security.'; +$_MODULE['<{prestafraud}prestashop>prestafraud_d0c6a2fa938df84c0ce628de99c97e16'] = 'Punteggio:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto'; +$_MODULE['<{prestafraud}prestashop>prestafraud_240f3031f25601fa128bd4e15f0a37de'] = 'Commento:'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b88011726eba59d6bf37f0fdec202edc'] = 'Segnala questo ordine come una frode a PrestaShop'; +$_MODULE['<{prestafraud}prestashop>prestafraud_a8bbb000124c9697aa5d63e7e758b64d'] = 'Ritiro nel negozio'; +$_MODULE['<{prestafraud}prestashop>prestafraud_08eb31af908e2244867f6e812f82e935'] = 'Punto di ritiro'; +$_MODULE['<{prestafraud}prestashop>prestafraud_880f973e4ddae42c6bebd2c31bb977f8'] = 'Spedizione lenta oltre 3 giorni'; +$_MODULE['<{prestafraud}prestashop>prestafraud_b61de91e556aee84e83c3fde8ef67ddc'] = 'Spedizione express'; diff --git a/modules/prestafraud/logo.gif b/modules/prestafraud/logo.gif new file mode 100644 index 000000000..3cb4e2578 Binary files /dev/null and b/modules/prestafraud/logo.gif differ diff --git a/modules/prestafraud/prestafraud.php b/modules/prestafraud/prestafraud.php new file mode 100644 index 000000000..7ad12d834 --- /dev/null +++ b/modules/prestafraud/prestafraud.php @@ -0,0 +1,592 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*/ + + +class PrestaFraud extends Module +{ + + private $_html; + public $_errors; + private static $_trustUrl = 'http://trust.prestashop.com/'; + + private $_activities; + private $_payment_types; + + public function __construct() + { + $this->name = 'prestafraud'; + $this->tab = 'payment_security'; + $this->version = '0.99'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = 'PrestaShop Security'; + $this->description = 'Protect your store from fraudulent payments'; + + $this->_activities = array(0 => $this->l('-- Please choose your main activity --'), + 1 => $this->l('Adult'), + 2 => $this->l('Animals and Pets'), + 3 => $this->l('Art and Culture'), + 4 => $this->l('Babies'), + 5 => $this->l('Beauty and Personal Care'), + 6 => $this->l('Cars'), + 7 => $this->l('Computer Hardware and Software'), + 8 => $this->l('Download'), + 9 => $this->l('Fashion and accessories'), + 10 => $this->l('Flowers, Gifts and Crafts'), + 11 => $this->l('Food and beverage'), + 12 => $this->l('HiFi, Photo and Video'), + 13 => $this->l('Home and Garden'), + 14 => $this->l('Home Appliances'), + 15 => $this->l('Jewelry'), + 16 => $this->l('Mobile and Telecom'), + 17 => $this->l('Services'), + 18 => $this->l('Shoes and accessories'), + 19 => $this->l('Sport and Entertainment'), + 20 => $this->l('Travel')); + + $this->_payment_types = array(0 => $this->l('Cheque'), + 1 => $this->l('Bankwire'), + 2 => $this->l('Credit card'), + 3 => $this->l('Credit card multiple'), + 4 => $this->l('Prepaid account (MoneyBookers, PayPal...)')); + + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('updatecarrier') OR + !$this->registerHook('newOrder') OR + !$this->registerHook('adminOrder') OR + !$this->registerHook('cart')) + return false; + + if (!$sql = file_get_contents(dirname(__FILE__).'/install.sql')) + die(Tools::displayError('File install.sql is not readable')); + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + + foreach ($sql as $query) + if ($query AND sizeof($query) AND !Db::getInstance()->Execute(trim($query))) + return false; + return true; + } + + public function uninstall() + { + parent::uninstall(); + } + + public function getContent() + { + $this->postProcess(); + $this->_displayConfiguration(); + + return $this->_html; + } + + private function _displayConfiguration() + { + global $cookie; + $this->_html .= ' +
        '.$this->l('PrestaShop Security configuration').' +
        +
        +
        + '.$this->l('My shop does not have a PrestaShop Security account yet').'    + '.$this->l('I already have an account').' +
        +
        +
        +
         
        +
        +
        + +
        + +
        + +
        + +
        +
        + '.$this->l('I agree with the terms of PrestaShop Security service and i adhere to them unconditionally.').' +
        +
        '; + $terms = file_get_contents(self::$_trustUrl.'terms.php?lang='.Language::getIsoById((int)$cookie->id_lang)); + $this->_html .= $terms; + $this->_html .= '
        +
        + +
        +
        +
         
        +
        +
        +
        + +
        + +
        + +
        + +
        +
         
        +
        +
        '; + return $this->_html; + } + + public function postProcess() + { + if (Tools::isSubmit('submitSettings')) + { + if (isset($_POST['login'])) + Configuration::updateValue('PS_TRUST_EMAIL', $_POST['email']); + if (isset($_POST['passwd'])) + Configuration::updateValue('PS_TRUST_PASSWD', $_POST['passwd']); + if ($activity = Tools::getValue('shop_activity')) + Configuration::updateValue('PS_SHOP_ACTIVITY', $activity); + $carriers_configuration = array(); + $payments_configuration = array(); + foreach($_POST AS $field => $val) + { + if (preg_match('/^carrier_([0-9]+)/Ui', $field, $res)) + $carriers_configuration[$res[1]] = $val; + elseif (preg_match('/^paymentmodule_([0-9]+)/Ui', $field, $pay_res)) + $payments_configuration[$pay_res[1]] = $val; + } + + $this->_setCarriersConfiguration($carriers_configuration); + $this->_setPaymentsConfiguration($payments_configuration); + } + elseif (Tools::isSubmit('submitCreateAccount')) + $this->_html .= $this->_createAccount(); + + if (sizeof($this->_errors)) + { + $err = ''; + foreach ($this->_errors AS $error) + $err .= $error.'
        '; + $this->_html .= $this->displayError($err); + } + } + + private function _createAccount() + { + if (!$email = Tools::getValue('email') OR !Validate::isEmail($email)) + $this->_errors[] = $this->l('Email is invalid'); + if (!$shop_url = Tools::getValue('shop_url') OR !Validate::isAbsoluteUrl($shop_url)) + $this->_errors[] = $this->l('Shop URL is invalid'); + + if (sizeof($this->_errors)) + return false; + + $root = new SimpleXMLElement(""); + $xml = $root->addChild('create_account'); + $xml->addChild('email', $email); + $xml->addChild('shop_url', $shop_url); + $result = self::_pushDatas($root->asXml()); + $xml_result = simplexml_load_string($result); + if (!(int)$xml_result->create_account->result) + { + $this->_errors[] = (string)$xml_result->create_account->errors; + return false; + } + Configuration::updateValue('PS_TRUST_SHOP_ID', (string)$xml_result->create_account->shop_id); + Configuration::updateValue('PS_TRUST_SHOP_KEY', (string)$xml_result->create_account->shop_key); + + $this->_html .= $this->displayConfirmation('Account successfull created'); + } + + public function hookUpdateCarrier($params) + { + $this->_updateConfiguredCarrier((int)$params['id_carrier'], (int)$params['carrier']->id); + } + + public function hookNewOrder($params) + { + if (!Configuration::get('PS_SHOP_ENABLE') OR !Configuration::get('PS_TRUST_SHOP_ID') OR !Configuration::get('PS_TRUST_SHOP_KEY')) + return; + $customer = new Customer((int)$params['order']->id_customer); + + $address_delivery = new Address((int)$params['order']->id_address_delivery); + $address_invoice = new Address((int)$params['order']->id_address_invoice); + $root = new SimpleXMLElement(""); + $xml = $root->addChild('new_order'); + $shop_configuration = $xml->addChild('shop'); + + $default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT')); + $default_currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT')); + $shop_configuration->addChild('default_country', $default_country->iso_code); + $shop_configuration->addChild('default_currency', $default_currency->iso_code); + $shop_configuration->addChild('shop_id', Configuration::get('PS_TRUST_SHOP_ID')); + $shop_configuration->addChild('shop_password', Configuration::get('PS_TRUST_SHOP_KEY')); + + if ($activity = Configuration::get('PS_SHOP_ACTIVITY')) + $shop_configuration->addChild('shop_activity', $activity); + $customer_infos = $xml->addChild('customer'); + $customer_infos->addChild('customer_id', $customer->id); + $customer_infos->addChild('lastname', $customer->lastname); + $customer_infos->addChild('firstname', $customer->firstname); + $customer_infos->addChild('email', $customer->email); + $customer_infos->addChild('is_guest', (int)$customer->is_guest); + $customer_infos->addChild('birthday', $customer->birthday); + + $delivery = $xml->addChild('delivery'); + $delivery->addChild('lastname', $address_delivery->lastname); + $delivery->addChild('firstname', $address_delivery->firstname); + $delivery->addChild('company', $address_delivery->company); + $delivery->addChild('dni', $address_delivery->dni); + $delivery->addChild('address1', $address_delivery->address1); + $delivery->addChild('address2', $address_delivery->address2); + $delivery->addChild('phone', $address_delivery->phone); + $delivery->addChild('phone_mobile', $address_delivery->phone_mobile); + $delivery->addChild('city', $address_delivery->city); + $delivery->addChild('postcode', $address_delivery->postcode); + if ($address_delivery->id_state !== NULL OR $address_delivery->id_state != '') + { + $State = new State((int)$address_delivery->id_state); + $delivery->addChild('state', $State->iso_code); + } + $delivery->addChild('country', Country::getIsoById((int)$address_delivery->id_country)); + + $invoice = $xml->addChild('invoice'); + $invoice->addChild('lastname', $address_invoice->lastname); + $invoice->addChild('firstname', $address_invoice->firstname); + $invoice->addChild('company', $address_invoice->company); + $invoice->addChild('dni', $address_invoice->dni); + $invoice->addChild('address1', $address_invoice->address1); + $invoice->addChild('address2', $address_invoice->address2); + $invoice->addChild('phone', $address_invoice->phone); + $invoice->addChild('phone_mobile', $address_invoice->phone_mobile); + $invoice->addChild('city', $address_invoice->city); + $invoice->addChild('postcode', $address_invoice->postcode); + if ($address_invoice->id_state !== NULL OR $address_invoice->id_state != '') + { + $State = new State((int)$address_invoice->id_state); + $invoice->addChild('state', $State->iso_code); + } + $invoice->addChild('country', Country::getIsoById((int)$address_invoice->id_country)); + + $infos = $this->_getCustomerInfos($params['order']); + $history = $xml->addChild('customer_history'); + $history->addChild('customer_date_last_order', $infos['customer_date_last_order']); + $history->addChild('customer_orders_valid_count', (int)$infos['customer_orders_valid_count']); + $history->addChild('customer_orders_valid_sum', (float)$infos['customer_orders_valid_sum']); + $history->addChild('customer_orders_unvalid_count', (int)$infos['customer_orders_unvalid_count']); + $history->addChild('customer_orders_unvalid_sum', (float)$infos['customer_orders_unvalid_sum']); + $history->addChild('customer_ip_addresses_history', $infos['customer_ip_addresses_history']); + + $history->addChild('customer_date_add', $customer->date_add); + + $product_list = $params['order']->getProductsDetail(); + + $order = $xml->addChild('order_detail'); + $order->addChild('order_id', (int)$params['order']->id); + $order->addChild('order_amount', $params['order']->total_paid); + $currency = new Currency((int)$params['order']->id_currency); + $order->addChild('currency', $currency->iso_code); + $products = $order->addChild('products'); + foreach ($product_list AS $p) + { + $products->addChild('name', $p['product_name']); + $products->addChild('price', $p['product_price']); + $products->addChild('quantity', $p['product_quantity']); + $products->addChild('is_virtual', (int)!empty($p['download_hash'])); + } + + $sources = ConnectionsSource::getOrderSources($params['order']->id); + $referers = array(); + if ($sources) + foreach ($sources AS $source) + $referers[] = $source['http_referer']; + if (sizeof($referers)) + $order->addChild('order_referers', serialize($referers)); + + $configured_payments = $this->_getConfiguredPayments(); + $paymentModule = Module::getInstanceByName($params['order']->module); + $order->addChild('payment_name', $paymentModule->displayName); + $order->addChild('payment_type', (int)$configured_payments[$paymentModule->id]); + $order->addChild('order_date', $params['order']->date_add); + $order->addChild('order_ip_address', $this->_getIpByCart($id_cart)); + + $carrier = new Carrier((int)$params['order']->id_carrier); + $carrier_infos = $order->addChild('carrier_infos'); + $carrier_infos->addChild('name', $carrier->name); + $carriers_type = $this->_getConfiguredCarriers(); + + $carrier_infos->addChild('type', $carriers_type[$carrier->id]); + if (self::_pushDatas($root->asXml()) !== false) + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'prestafraud_orders (id_order) VALUES('.(int)$params['order']->id.')'); + return true; + } + + public function hookCart($params) + { + if ($_SERVER['REMOTE_ADDR'] == '0.0.0.0' OR $_SERVER['REMOTE_ADDR'] == '' OR $_SERVER['REMOTE_ADDR'] === false OR $_SERVER['REMOTE_ADDR'] === '::1') + return; + if (!$params['cart']->id) + return; + $res = Db::getInstance()->getValue(' + SELECT `id_cart` + FROM '._DB_PREFIX_.'prestafraud_carts + WHERE id_cart='.(int)($params['cart']->id)); + if ($res) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'prestafraud_carts` + SET `ip_address` = '.ip2long($_SERVER['REMOTE_ADDR']).', `date` = \''.pSQL(date('Y-m-d H:i:s')).'\' + WHERE `id_cart` = '.(int)($params['cart']->id).' LIMIT 1'); + else + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'prestafraud_carts` (`id_cart`, `ip_address`, `date`) + VALUES ('.(int)($params['cart']->id).', '.ip2long($_SERVER['REMOTE_ADDR']).',\''.date('Y-m-d H:i:s').'\')'); + return true; + } + + private function _getCustomerInfos($order) + { + $last_order = Db::getInstance()->getValue('SELECT date_add + FROM '._DB_PREFIX_.'orders + WHERE id_customer='.(int)$order->id_customer.' AND id_order != '.(int)$order->id.' + ORDER BY date_add DESC'); + + $orders_valid = Db::getInstance()->getRow(' + SELECT COUNT(*) nb_valid, SUM(total_paid) sum_valid + FROM '._DB_PREFIX_.'orders + WHERE valid=1 AND id_order!='.(int)$order->id.' AND id_customer = '.(int)$order->id_customer); + + $orders_unvalid = Db::getInstance()->getRow(' + SELECT COUNT(*) nb_unvalid, SUM(total_paid) sum_unvalid + FROM '._DB_PREFIX_.'orders + WHERE valid=0 AND id_order!='.(int)$order->id.' AND id_customer = '.(int)$order->id_customer); + + $ip_addresses = Db::getInstance()->ExecuteS(' + SELECT c.ip_address + FROM '._DB_PREFIX_.'guest g + LEFT JOIN '._DB_PREFIX_.'connections c ON (c.id_guest = g.id_guest) + WHERE g.id_customer='.(int)$order->id_customer.' + ORDER BY c.id_connections DESC'); + $address_list = array(); + foreach ($ip_addresses AS $ip) + $address_list[] = $ip['ip_address']; + + return array( + 'customer_date_last_order' => $last_order, + 'customer_orders_valid_count' => $orders_valid['nb_valid'], + 'customer_orders_valid_sum' => $orders_valid['sum_valid'], + 'customer_orders_unvalid_count' => $orders_unvalid['nb_unvalid'], + 'customer_orders_unvalid_sum' => $orders_unvalid['sum_unvalid'], + 'customer_ip_addresses_history' => serialize($address_list) + ); + } + + private static function _getIpByCart($id_cart) + { + return long2ip(Db::getInstance()->getValue(' + SELECT `ip_address` + FROM '._DB_PREFIX_.'prestafraud_carts + WHERE id_cart = '.(int)$id_cart)); + } + + public function hookAdminOrder($params) + { + global $cookie; + $id_order = Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'prestafraud_orders WHERE id_order = '.(int)$params['id_order']); + $this->_html .= '
        '.$this->l('PrestaShop Security').''; + if (!$id_order) + $this->_html .= $this->l('This order has not been sent to PrestaShop Security.'); + else + { + $scoring = $this->_getScoring((int)$id_order, $cookie->id_lang); + $this->_html .= '

        '.$this->l('Scoring:').' '.($scoring['scoring'] < 0 ? $this->l('Unknown') : (float)$scoring['scoring']).'

        +

        '.$this->l('Comment:').' '.htmlentities($scoring['comment']).'

        +

        '.$this->l('Report this order as a fraud to PrestaShop').'

        '; + } + $this->_html .= '
        '; + return $this->_html; + } + + + + private function _getScoring($id_order, $id_lang) + { + if (!$scoring = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'prestafraud_orders WHERE scoring IS NOT NULL AND id_order = '.(int)$id_order)) + { + $root = new SimpleXMLElement(""); + $xml = $root->addChild('get_scoring'); + $xml->addChild('shop_id', Configuration::get('PS_TRUST_SHOP_ID')); + $xml->addChild('shop_password', Configuration::get('PS_TRUST_SHOP_KEY')); + $xml->addChild('id_order', (int)$id_order); + $xml->addChild('lang', Language::getIsoById((int)$id_lang)); + $result = self::_pushDatas($root->asXml()); + if (!$result) + return false; + $xml = simplexml_load_string($result); + if ((int)$xml->check_scoring->status != -1) + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'prestafraud_orders SET scoring = '.(float)$xml->check_scoring->scoring.', comment = \''.pSQL($xml->check_scoring->comment).'\' WHERE id_order='.(int)$id_order); + $scoring = array('scoring' => (float)$xml->check_scoring->scoring, 'comment' => (string)$xml->check_scoring->comment); + } + return $scoring; + } + + private function _getPrestaTrustCarriersType() + { + return array( + '1' => $this->l('Pick up in-store'), + '2' => $this->l('Withdrawal point'), + '3' => $this->l('Slow shipping more than 3 days'), + '4' => $this->l('Shipping express')); + } + + private function _getConfiguredCarriers() + { + $res = Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'prestafraud_carrier'); + $carriers = array(); + foreach ($res AS $row) + $carriers[$row['id_carrier']] = $row['id_prestafraud_carrier_type']; + + return $carriers; + } + + private function _getConfiguredPayments() + { + $res = Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'prestafraud_payment'); + $payments = array(); + foreach ($res AS $row) + $payments[$row['id_module']] = $row['id_prestafraud_payment_type']; + + return $payments; + } + + private function _setCarriersConfiguration($carriers) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'prestafraud_carrier'); + foreach ($carriers AS $id_carrier => $id_carrier_type) + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'prestafraud_carrier (id_carrier, id_prestafraud_carrier_type) VALUES ('.(int)$id_carrier.', '.(int)$id_carrier_type.')'); + } + + private function _setPaymentsConfiguration($payments) + { + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'prestafraud_payment'); + foreach ($payments AS $id_module => $id_payment_type) + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'prestafraud_payment (id_module, id_prestafraud_payment_type) VALUES ('.(int)$id_module.', '.(int)$id_payment_type.')'); + } + + private function _updateConfiguredCarrier($old, $new) + { + return Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'prestafraud_carrier SET id_carrier='.(int)$new.' WHERE id_carrier='.(int)$old); + } + + private static function _pushDatas($datas) + { + if (function_exists('curl_init')) + { + $ch = curl_init(self::$_trustUrl); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, array('xml' => $datas)); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_TIMEOUT, 5); + $content = curl_exec($ch); + curl_close($ch); + return $content; + } + elseif (function_exists('file_get_contents')) + { + $context = stream_context_create(array('http' => array('timeout' => 5))); + return file_get_contents(self::$_trustUrl.'?xml='.urlencode(str_replace("\r", "\n", '', $datas)), $context); + } + else + return false; + } +} diff --git a/modules/productcomments/ProductComment.php b/modules/productcomments/ProductComment.php new file mode 100644 index 000000000..8df291274 --- /dev/null +++ b/modules/productcomments/ProductComment.php @@ -0,0 +1,260 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class ProductComment extends ObjectModel +{ + public $id; + + /** @var integer Product's id */ + public $id_product; + + /** @var integer Customer's id */ + public $id_customer; + + /** @var integer Guest's id */ + public $id_guest; + + + /** @var integer Customer name */ + public $customer_name; + + /** @var string Title */ + public $title; + + /** @var string Content */ + public $content; + + /** @var integer Grade */ + public $grade; + + /** @var boolean Validate */ + public $validate = 0; + + public $deleted = 0; + + /** @var string Object creation date */ + public $date_add; + + protected $fieldsRequired = array('id_product', 'id_customer', 'content'); + protected $fieldsSize = array('content' => 65535); + protected $fieldsValidate = array('id_product' => 'isUnsignedId', 'id_customer' => 'isUnsignedId', 'content' => 'isMessage', + 'grade' => 'isFloat', 'validate' => 'isBool'); + + protected $table = 'product_comment'; + protected $identifier = 'id_product_comment'; + + public function getFields() + { + parent::validateFields(false); + $fields['id_product'] = (int)($this->id_product); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_guest'] = (int)($this->id_guest); + $fields['customer_name'] = pSQL($this->customer_name); + $fields['title'] = pSQL($this->title); + $fields['content'] = pSQL($this->content); + $fields['grade'] = (float)($this->grade); + $fields['validate'] = (int)($this->validate); + $fields['deleted'] = (int)($this->deleted); + $fields['date_add'] = pSQL($this->date_add); + return ($fields); + } + + /** + * Get comments by IdProduct + * + * @return array Comments + */ + static public function getByProduct($id_product, $p = 1, $n = null) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + $validate = Configuration::get('PRODUCT_COMMENTS_MODERATE'); + $p = (int)($p); + $n = (int)($n); + if ($p <= 1) + $p = 1; + if ($n != null AND $n <= 0) + $n = 5; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT pc.`id_product_comment`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', LEFT(c.`lastname`, 1)), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pc.title + FROM `'._DB_PREFIX_.'product_comment` pc + LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer` + WHERE pc.`id_product` = '.(int)($id_product).($validate == '1' ? ' AND pc.`validate` = 1' : '').' + ORDER BY pc.`date_add` DESC + '.($n ? 'LIMIT '.(int)(($p - 1) * $n).', '.(int)($n) : '')); + } + + static public function getByCustomer($id_product, $id_customer, $last = false, $id_guest = false) + { + $results = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'product_comment` pc + WHERE pc.`id_product` = '.(int)($id_product).' AND '.(!$id_guest ? 'pc.`id_customer` = '.(int)($id_customer) : 'pc.`id_guest` = '.(int)($id_guest)).' + ORDER BY pc.`date_add` DESC ' + .($last ? 'LIMIT 1' : '') + ); + + if ($last) + return array_shift($results); + + return $results; + } + + /** + * Get Grade By product + * + * @return array Grades + */ + static public function getGradeByProduct($id_product, $id_lang) + { + if (!Validate::isUnsignedId($id_product) || + !Validate::isUnsignedId($id_lang)) + die(Tools::displayError()); + $validate = Configuration::get('PRODUCT_COMMENTS_MODERATE'); + + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT pc.`id_product_comment`, pcg.`grade`, pccl.`name`, pcc.`id_product_comment_criterion` + FROM `'._DB_PREFIX_.'product_comment` pc + LEFT JOIN `'._DB_PREFIX_.'product_comment_grade` pcg ON (pcg.`id_product_comment` = pc.`id_product_comment`) + LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion` pcc ON (pcc.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`) + LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pccl.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`) + WHERE pc.`id_product` = '.(int)($id_product).' + AND pccl.`id_lang` = '.(int)($id_lang). + ($validate == '1' ? ' AND pc.`validate` = 1' : ''))); + } + + static public function getAveragesByProduct($id_product, $id_lang) + { + /* Get all grades */ + $grades = ProductComment::getGradeByProduct((int)($id_product), (int)($id_lang)); + $total = ProductComment::getGradedCommentNumber((int)($id_product)); + if (!sizeof($grades) OR (!$total)) + return array(); + + /* Addition grades for each criterion */ + $criterionsGradeTotal = array(); + for ($i = 0; $i < count($grades); ++$i) + if (array_key_exists($grades[$i]['id_product_comment_criterion'], $criterionsGradeTotal) === false) + $criterionsGradeTotal[$grades[$i]['id_product_comment_criterion']] = (int)($grades[$i]['grade']); + else + $criterionsGradeTotal[$grades[$i]['id_product_comment_criterion']] += (int)($grades[$i]['grade']); + + /* Finally compute the averages */ + $averages = array(); + foreach ($criterionsGradeTotal AS $key => $criterionGradeTotal) + $averages[(int)($key)] = (int)($total) ? ((int)($criterionGradeTotal) / (int)($total)) : 0; + return $averages; + } + + /** + * Return number of comments and average grade by products + * + * @return array Info + */ + static public function getCommentNumber($id_product) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + $validate = (int)(Configuration::get('PRODUCT_COMMENTS_MODERATE')); + if (($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_product_comment`) AS "nbr" + FROM `'._DB_PREFIX_.'product_comment` pc + WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : ''))) === false) + return false; + return (int)($result['nbr']); + } + + /** + * Return number of comments and average grade by products + * + * @return array Info + */ + static public function getGradedCommentNumber($id_product) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + $validate = (int)(Configuration::get('PRODUCT_COMMENTS_MODERATE')); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(pc.`id_product`) AS nbr + FROM `'._DB_PREFIX_.'product_comment` pc + WHERE `id_product` = '.(int)($id_product).($validate == '1' ? ' AND `validate` = 1' : '').' + AND `grade` > 0'); + return (int)($result['nbr']); + } + + /** + * Get comments by Validation + * + * @return array Comments + */ + static public function getByValidate($validate = '0', $deleted = false) + { + global $cookie; + + return (Db::getInstance()->ExecuteS(' + SELECT pc.`id_product_comment`, pc.`id_product`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', c.`lastname`), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name` + FROM `'._DB_PREFIX_.'product_comment` pc + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = pc.`id_customer`) + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = pc.`id_product`) + WHERE pc.`validate` = '.(int)($validate).' + AND pl.`id_lang` = '.(int)($cookie->id_lang).' + ORDER BY pc.`date_add` DESC')); + } + + /** + * Validate a comment + * + * @return boolean succeed + */ + public function validate($validate = '1') + { + if (!Validate::isUnsignedId($this->id)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product_comment` SET + `validate` = '.(int)($validate).' + WHERE `id_product_comment` = '.(int)($this->id))); + } + + /** + * Delete Grades + * + * @return boolean succeed + */ + static public function deleteGrades($id_product_comment) + { + if (!Validate::isUnsignedId($id_product_comment)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_comment_grade` + WHERE `id_product_comment` = '.(int)($id_product_comment))); + } +}; diff --git a/modules/productcomments/ProductCommentCriterion.php b/modules/productcomments/ProductCommentCriterion.php new file mode 100644 index 000000000..250f8c89d --- /dev/null +++ b/modules/productcomments/ProductCommentCriterion.php @@ -0,0 +1,214 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProductCommentCriterion extends ObjectModel +{ + public $id; + public $id_product_comment_criterion_type; + + public $name; + public $active = 1; + protected $fieldsRequiredLang = array('name'); + protected $fieldsSizeLang = array('name' => 128); + protected $fieldsValidateLang = array('name' => 'isGenericName'); + + protected $table = 'product_comment_criterion'; + protected $identifier = 'id_product_comment_criterion'; + + + public function getFields() + { + parent::validateFields(); + return array('id_product_comment_criterion_type' => (int)$this->id_product_comment_criterion_type, 'active' => (int)$this->active); + } + + public function getTranslationsFieldsChild() + { + parent::validateFieldsLang(); + return parent::getTranslationsFields(array('name')); + } + + public function delete() + { + if (!parent::delete()) + return false; + if ($this->id_product_comment_criterion_type == 2) + if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category + WHERE id_product_comment_criterion='.(int)$this->id)) + return false; + elseif ($this->id_product_comment_criterion_type == 3) + if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product + WHERE id_product_comment_criterion='.(int)$this->id)) + return false; + + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_grade` + WHERE `id_product_comment_criterion` = '.(int)$this->id); + } + + public function update($nullValues = false) + { + $previousUpdate = new self((int)$this->id); + if (!parent::update($nullValues)) + return false; + if ($previousUpdate->id_product_comment_criterion_type != $this->id_product_comment_criterion_type) + { + if ($previousUpdate->id_product_comment_criterion_type == 2) + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_category + WHERE id_product_comment_criterion='.(int)$previousUpdate->id); + elseif ($previousUpdate->id_product_comment_criterion_type == 3) + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'product_comment_criterion_product + WHERE id_product_comment_criterion='.(int)$previousUpdate->id); + } + return true; + } + + /** + * Link a Comment Criterion to a product + * + * @return boolean succeed + */ + public function addProduct($id_product) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`) + VALUES('.(int)$this->id.','.(int)$id_product.')')); + } + + /** + * Link a Comment Criterion to a category + * + * @return boolean succeed + */ + public function addCategory($id_category) + { + if (!Validate::isUnsignedId($id_category)) + die(Tools::displayError()); + return (Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`) + VALUES('.(int)$this->id.','.(int)$id_category.')')); + } + + /** + * Add grade to a criterion + * + * @return boolean succeed + */ + public function addGrade($id_product_comment, $grade) + { + if (!Validate::isUnsignedId($id_product_comment)) + die(Tools::displayError()); + if ($grade < 0) + $grade = 0; + else if ($grade > 10) + $grade = 10; + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_comment_grade` + (`id_product_comment`, `id_product_comment_criterion`, `grade`) VALUES( + '.(int)($id_product_comment).', + '.(int)$this->id.', + '.(int)($grade).')')); + } + + /** + * Get criterion by Product + * + * @return array Criterion + */ + static public function getByProduct($id_product, $id_lang) + { + if (!Validate::isUnsignedId($id_product) || + !Validate::isUnsignedId($id_lang)) + die(Tools::displayError()); + return Db::getInstance()->ExecuteS(' + SELECT pcc.`id_product_comment_criterion`, pccl.`name` + FROM `'._DB_PREFIX_.'product_comment_criterion` pcc + LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion) + LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp ON (pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` AND pccp.`id_product` = '.(int)$id_product.') + LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_category` pccc ON (pcc.`id_product_comment_criterion` = pccc.`id_product_comment_criterion`) + LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_category_default = pccc.id_category AND p.id_product = '.(int)$id_product.') + WHERE pccl.`id_lang` = '.(int)($id_lang).' AND (pccp.id_product IS NOT NULL OR p.id_product IS NOT NULL OR pcc.id_product_comment_criterion_type = 1) AND pcc.active = 1 + GROUP BY pcc.id_product_comment_criterion'); + } + + /** + * Get Criterions + * + * @return array Criterions + */ + static public function getCriterions($id_lang, $type = false, $active = false) + { + if (!Validate::isUnsignedId($id_lang)) + die(Tools::displayError()); + return (Db::getInstance()->ExecuteS(' + SELECT pcc.`id_product_comment_criterion`, pcc.id_product_comment_criterion_type, pccl.`name`, pcc.active + FROM `'._DB_PREFIX_.'product_comment_criterion` pcc + JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pcc.id_product_comment_criterion = pccl.id_product_comment_criterion) + WHERE pccl.`id_lang` = '.(int)$id_lang.($active ? ' AND active = 1' : '').($type ? ' AND id_product_comment_criterion_type = '.(int)$type : '').' + ORDER BY pccl.`name` ASC')); + } + + public function getProducts() + { + $res = Db::getInstance()->ExecuteS(' + SELECT pccp.id_product, pccp.id_product_comment_criterion + FROM `'._DB_PREFIX_.'product_comment_criterion_product` pccp + WHERE pccp.id_product_comment_criterion = '.(int)$this->id); + $products = array(); + if ($res) + foreach ($res AS $row) + $products[] = (int)$row['id_product']; + return $products; + } + + public function getCategories() + { + $res = Db::getInstance()->ExecuteS(' + SELECT pccc.id_category, pccc.id_product_comment_criterion + FROM `'._DB_PREFIX_.'product_comment_criterion_category` pccc + WHERE pccc.id_product_comment_criterion = '.(int)$this->id); + $criterions = array(); + if ($res) + foreach ($res AS $row) + $criterions[] = (int)$row['id_category']; + return $criterions; + } + + public function deleteCategories() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_category` WHERE `id_product_comment_criterion` = '.(int)$this->id); + } + + public function deleteProducts() + { + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` WHERE `id_product_comment_criterion` = '.(int)$this->id); + } + + static public function getTypes() + { + return array(1 => Tools::displayError('Valid for the entire catalog'), 2 => Tools::displayError('Restricted to some categories'), 3 => Tools::displayError('Restricted to some products')); + } +} \ No newline at end of file diff --git a/modules/productcomments/ProductCriterion.php b/modules/productcomments/ProductCriterion.php new file mode 100644 index 000000000..3372055db --- /dev/null +++ b/modules/productcomments/ProductCriterion.php @@ -0,0 +1,175 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ProductCommentCriterion +{ + /** + * Add a Comment Criterion + * + * @return boolean succeed + */ + static public function add($id_lang, $name) + { + if (!Validate::isUnsignedId($id_lang) || + !Validate::isMessage($name)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_comment_criterion` + (`id_lang`, `name`) VALUES( + '.(int)($id_lang).', + \''.pSQL($name).'\')')); + } + + /** + * Link a Comment Criterion to a product + * + * @return boolean succeed + */ + static public function addToProduct($id_product_comment_criterion, $id_product) + { + if (!Validate::isUnsignedId($id_product_comment_criterion) || + !Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_comment_criterion_product` + (`id_product_comment_criterion`, `id_product`) VALUES( + '.(int)($id_product_comment_criterion).', + '.(int)($id_product).')')); + } + + /** + * Add grade to a criterion + * + * @return boolean succeed + */ + static public function addGrade($id_product_comment, $id_product_comment_criterion, $grade) + { + if (!Validate::isUnsignedId($id_product_comment) || + !Validate::isUnsignedId($id_product_comment_criterion)) + die(Tools::displayError()); + if ($grade < 0) + $grade = 0; + else if ($grade > 10) + $grade = 10; + return (Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'product_comment_grade` + (`id_product_comment`, `id_product_comment_criterion`, `grade`) VALUES( + '.(int)($id_product_comment).', + '.(int)($id_product_comment_criterion).', + '.(int)($grade).')')); + } + + /** + * Update criterion + * + * @return boolean succeed + */ + static public function update($id_product_comment_criterion, $id_lang, $name) + { + if (!Validate::isUnsignedId($id_product_comment_criterion) || + !Validate::isUnsignedId($id_lang) || + !Validate::isMessage($name)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'product_comment_criterion` SET + `name` = \''.pSQL($name).'\' + WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion).' AND + `id_lang` = '.(int)($id_lang))); + } + + /** + * Get criterion by Product + * + * @return array Criterion + */ + static public function getByProduct($id_product, $id_lang) + { + if (!Validate::isUnsignedId($id_product) || + !Validate::isUnsignedId($id_lang)) + die(Tools::displayError()); + return (Db::getInstance()->ExecuteS(' + SELECT pcc.`id_product_comment_criterion`, pcc.`name` + FROM `'._DB_PREFIX_.'product_comment_criterion` pcc + INNER JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp ON pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` + WHERE pccp.`id_product` = '.(int)($id_product).' AND + pcc.`id_lang` = '.(int)($id_lang))); + } + + /** + * Get Criterions + * + * @return array Criterions + */ + static public function get($id_lang) + { + if (!Validate::isUnsignedId($id_lang)) + die(Tools::displayError()); + return (Db::getInstance()->ExecuteS(' + SELECT pcc.`id_product_comment_criterion`, pcc.`name` + FROM `'._DB_PREFIX_.'product_comment_criterion` pcc + WHERE pcc.`id_lang` = '.(int)($id_lang).' + ORDER BY pcc.`name` ASC')); + } + + /** + * Delete product criterion by product + * + * @return boolean succeed + */ + static public function deleteByProduct($id_product) + { + if (!Validate::isUnsignedId($id_product)) + die(Tools::displayError()); + return (Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` + WHERE `id_product` = '.(int)($id_product))); + } + + /** + * Delete all reference of a criterion + * + * @return boolean succeed + */ + static public function delete($id_product_comment_criterion) + { + if (!Validate::isUnsignedId($id_product_comment_criterion)) + die(Tools::displayError()); + $result = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_comment_grade` + WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion)); + if ($result === false) + return ($result); + $result = Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_comment_criterion_product` + WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion)); + if ($result === false) + return ($result); + return (Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'product_comment_criterion` + WHERE `id_product_comment_criterion` = '.(int)($id_product_comment_criterion))); + } +}; \ No newline at end of file diff --git a/modules/productcomments/config.xml b/modules/productcomments/config.xml new file mode 100755 index 000000000..2dc8f3800 --- /dev/null +++ b/modules/productcomments/config.xml @@ -0,0 +1,11 @@ + + + productcomments + Product Comments + 2.1 + Allow users to post comment about a product. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/productcomments/de.php b/modules/productcomments/de.php new file mode 100644 index 000000000..23b708735 --- /dev/null +++ b/modules/productcomments/de.php @@ -0,0 +1,72 @@ +productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Produkt-Kommentare'; +$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Benutzern erlauben, einen Kommentar zu einem Produkt zu posten'; +$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Bestätigung'; +$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Kriterium gelöscht'; +$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Kriterium aktualisiert'; +$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Kriterium hinzugefügt'; +$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Alle Kommentare müssen durch einen Mitarbeiter bestätigt werden'; +$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Gastkommentare erlauben'; +$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Minimale Zeit zwischen 2 Kommentaren vom selben Benutzer'; +$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'Sekunden'; +$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Kommentare moderieren'; +$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Verfasser'; +$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Kommentieren'; +$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Produktname'; +$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Handlungen'; +$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Akzeptieren'; +$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Auswahl:'; +$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Zur Zeit keine Kommentare zum Bestätigen.'; +$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Ein neues Kriterium hinzufügen'; +$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Sie können mehrere Kriterien definieren, um Ihren Kunden bei ihrem Beitrag zu helfen. Zum Beispiel: Effizienz, Leichtigkeit, Design.'; +$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Sie können hier unten ein neues Kriterium hinzufügen:'; +$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Gilt für'; +$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv'; +$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Ändern Sie das Kriterium'; +$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Fügen Sie dieses Kriterium hinzu'; +$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Kriterium'; +$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Typ'; +$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Bearbeiten'; +$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Bereich der Kriterien verwalten'; +$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Nur Kriterien, die auf Kategorien oder Produkte beschränkt sind, können untenstehend konfiguriert werden:'; +$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Wählen Sie ein Kriterium'; +$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Produkte'; +$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Kategorien'; +$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Name des Produkts'; +$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Name der Kategorie '; +$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Bitte tragen Sie Ihren Namen ein'; +$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Ungültiger Kommentartext gepostet.'; +$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Ein Fehler bist eim Speichern Ihres Kommentars aufgetreten.'; +$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Kommentar erfolgreich geschrieben.'; +$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'Wartet aufBestätigung durch Moderator.'; +$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Kommentartext ist erforderlich.'; +$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Sie sollten '; +$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'Sekunden warten, bevor Sie einen neuen Kommentar posten'; +$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Durchschnittsgrad'; +$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Durchschnitt'; +$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Von'; +$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titel'; +$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Zur Zeit keine Kundenkommentare.'; +$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'Sekunde (n) vor dem Posten eines neuen Kommentars'; +$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Kommentar hinzufügen'; +$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Ihr Name:'; +$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titel:'; +$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Kommentar:'; +$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Senden'; +$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Nur registrierte Benutzer können einen neuen Kommentar posten.'; +$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare'; +$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Durchschnitt'; +$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Kommentare ansehen'; +$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Kommentare'; diff --git a/modules/productcomments/en.php b/modules/productcomments/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/productcomments/en.php @@ -0,0 +1,4 @@ +productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Comentario sobre el producto'; +$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Permitir a los usuarios registrar comentarios acerca del producto'; +$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmación'; +$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Ajustes actualizados'; +$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Criterio suprimido'; +$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Criterio actualizado'; +$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Creteria añadido'; +$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Todos los comentarios deben estar validados por un empleado'; +$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Autorizar los comentarios de visitantes que no están conectados.'; +$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Tiempo mínimo entre dos comentarios de un mismo usuario'; +$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'segundos'; +$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Moderar Comentarios'; +$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Autor'; +$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Comentario'; +$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nombre del producto'; +$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Acciones'; +$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Aceptar'; +$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Eliminar'; +$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Selección:'; +$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Ningún comentario que validar'; +$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Añadir un nuevo criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Puede definir varios criterios para guiar a sus clientes en su comentario. Por ejemplo: eficacia, diseño, etc...'; +$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Puede añadir un nuevo criterio a continuación:'; +$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Aplicar a '; +$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activo'; +$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modificar este criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Añadir este criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo '; +$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; +$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modificar'; +$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Administrar el'; +$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Solo pueden configurarse a continuación los criterios que corresponden a categorías o productos:'; +$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Elija un criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Productos'; +$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorías'; +$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nombre del producto'; +$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nombre de la categoría'; +$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Por favor, escriba su nombre'; +$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Comentario texto no válido para una publicación.'; +$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Se ha producido un error al guardar su comentario.'; +$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Comentario publicado con éxito.'; +$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'En espera de validación moderador'; +$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Se necesita el texto del comentario.'; +$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Debe esperar'; +$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'segundos antes de escribir un nuevo comentario.'; +$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Grado medio'; +$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Promedio'; +$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Desde'; +$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Título'; +$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'No hay comentarios de clientes por ahora.'; +$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'segundo(s) antes de escribir un nuevo comentario.'; +$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Añadir un comentario'; +$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Su nombre:'; +$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Título:'; +$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Comentario:'; +$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Enviar'; +$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Solamente los usuarios registrados pueden introducir comentarios.'; +$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios'; +$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Media'; +$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Ver las opiniones'; +$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Comentarios'; diff --git a/modules/productcomments/fr.php b/modules/productcomments/fr.php new file mode 100644 index 000000000..90a8e2610 --- /dev/null +++ b/modules/productcomments/fr.php @@ -0,0 +1,72 @@ +productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Commentaires produits'; +$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Autorise les utilisateurs à poster des commentaires sur les produits'; +$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; +$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Critère supprimé'; +$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Critère mis à jour'; +$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Critère ajouté'; +$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Les commentaires doivent être validés par un employé'; +$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Autoriser les commentaires des visiteurs qui n\'ont pas de compte client'; +$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Temps minimum entre 2 commentaires d\'un même utilisateur'; +$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'secondes'; +$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Modérer les commentaires'; +$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Auteur'; +$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Commentaire'; +$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nom du produit'; +$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions'; +$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Accepter'; +$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Sélection :'; +$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Aucun commentaire à valider.'; +$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Ajouter un nouveau critère'; +$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'Vous pouvez définir plusieurs critères afin de guider vos clients dans leur commentaire. Par exemple: performance, design etc ...'; +$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'Vous pouvez ajouter un nouveau critère ci-dessous :'; +$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Appliquer à'; +$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Actif'; +$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modifier ce critère'; +$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Ajouter ce critère'; +$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Critère'; +$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Type'; +$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Etat'; +$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; +$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Gérer le champ d\'action des critères'; +$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Seuls les critères correspondant à des catégories ou des produits peuvent être configurés ci-dessous:'; +$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Choisissez un critère'; +$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Produits'; +$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories'; +$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nom du produit'; +$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nom de la catégorie'; +$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Merci de saisir votre nom'; +$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'Commentaire invalide.'; +$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Une erreur est survenue lors de l\'ajout du commentaire.'; +$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Commentaire ajouté avec succès.'; +$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'En attente d\'une validation modérateur'; +$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Un texte est nécessaire pour publier un commentaire.'; +$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Vous devez attendre'; +$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'secondes avant de poster un nouveau commentaire.'; +$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Note moyenne'; +$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Moyenne'; +$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'De'; +$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titre'; +$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Aucun commentaire n\'a été publié pour le moment.'; +$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'seconde(s) avant de poster un nouveau commentaire.'; +$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Ajouter un commentaire'; +$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Votre nom :'; +$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titre : '; +$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Commentaire :'; +$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer'; +$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Seuls les utilisateurs enregistrés peuvent poster des commentaires.'; +$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaires'; +$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Moyenne'; +$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'Voir les avis'; +$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commentaires'; diff --git a/modules/productcomments/img/accept.png b/modules/productcomments/img/accept.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/modules/productcomments/img/accept.png differ diff --git a/modules/productcomments/img/comment.png b/modules/productcomments/img/comment.png new file mode 100644 index 000000000..7bc9233ea Binary files /dev/null and b/modules/productcomments/img/comment.png differ diff --git a/modules/productcomments/img/comments_delete.png b/modules/productcomments/img/comments_delete.png new file mode 100644 index 000000000..6df7376d0 Binary files /dev/null and b/modules/productcomments/img/comments_delete.png differ diff --git a/modules/productcomments/img/delete.gif b/modules/productcomments/img/delete.gif new file mode 100644 index 000000000..43c6ca876 Binary files /dev/null and b/modules/productcomments/img/delete.gif differ diff --git a/modules/productcomments/img/delete.png b/modules/productcomments/img/delete.png new file mode 100644 index 000000000..08f249365 Binary files /dev/null and b/modules/productcomments/img/delete.png differ diff --git a/modules/productcomments/img/note.png b/modules/productcomments/img/note.png new file mode 100644 index 000000000..244e6ca04 Binary files /dev/null and b/modules/productcomments/img/note.png differ diff --git a/modules/productcomments/img/note_go.png b/modules/productcomments/img/note_go.png new file mode 100644 index 000000000..49e54fd87 Binary files /dev/null and b/modules/productcomments/img/note_go.png differ diff --git a/modules/productcomments/img/star.gif b/modules/productcomments/img/star.gif new file mode 100644 index 000000000..d0948a708 Binary files /dev/null and b/modules/productcomments/img/star.gif differ diff --git a/modules/productcomments/install.sql b/modules/productcomments/install.sql new file mode 100644 index 000000000..0075af2c5 --- /dev/null +++ b/modules/productcomments/install.sql @@ -0,0 +1,53 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment` ( + `id_product_comment` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_guest` int(10) unsigned NULL, + `title` varchar(64) NULL, + `content` text NOT NULL, + `customer_name` varchar(64) NULL, + `grade` float unsigned NOT NULL, + `validate` tinyint(1) NOT NULL, + `deleted` tinyint(1) NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_product_comment`), + KEY `id_product` (`id_product`), + KEY `id_customer` (`id_customer`), + KEY `id_guest` (`id_product`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion` ( + `id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment, + `id_product_comment_criterion_type` tinyint(1) NOT NULL, + `active` tinyint(1) NOT NULL, + PRIMARY KEY (`id_product_comment_criterion`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_product` ( + `id_product` int(10) unsigned NOT NULL, + `id_product_comment_criterion` int(10) unsigned NOT NULL, + PRIMARY KEY(`id_product`, `id_product_comment_criterion`), + KEY `id_product_comment_criterion` (`id_product_comment_criterion`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_lang` ( +`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL , +`id_lang` INT(11) UNSIGNED NOT NULL , +`name` VARCHAR(64) NOT NULL , +PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` ) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_category` ( + `id_product_comment_criterion` int(10) unsigned NOT NULL, + `id_category` int(10) unsigned NOT NULL, + PRIMARY KEY(`id_product_comment_criterion`, `id_category`), + KEY `id_category` (`id_category`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_grade` ( + `id_product_comment` int(10) unsigned NOT NULL, + `id_product_comment_criterion` int(10) unsigned NOT NULL, + `grade` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`), + KEY `id_product_comment_criterion` (`id_product_comment_criterion`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/modules/productcomments/it.php b/modules/productcomments/it.php new file mode 100644 index 000000000..0d67cd000 --- /dev/null +++ b/modules/productcomments/it.php @@ -0,0 +1,72 @@ +productcomments_b91c4e8b229a399a3bc911d352524a9b'] = 'Commenti prodotto'; +$_MODULE['<{productcomments}prestashop>productcomments_0c21532dfd3476791e5aab1aa7fa7405'] = 'Consenti agli utenti di inviare un commento su un prodotto'; +$_MODULE['<{productcomments}prestashop>productcomments_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Conferma'; +$_MODULE['<{productcomments}prestashop>productcomments_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{productcomments}prestashop>productcomments_1bb54e382f7dbdb260f0aa6b42bb624b'] = 'Criterio eliminato'; +$_MODULE['<{productcomments}prestashop>productcomments_21b0922096daf5c742cc98986d857cc1'] = 'Criterio aggiornato'; +$_MODULE['<{productcomments}prestashop>productcomments_e140a9c4fcfa0aad7af83f65e577c287'] = 'Criterio aggiunto'; +$_MODULE['<{productcomments}prestashop>productcomments_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{productcomments}prestashop>productcomments_9ca2adc05abbe3cc0a659a16fd7d5edc'] = 'Tutti i commenti devono essere convalidati da un dipendente'; +$_MODULE['<{productcomments}prestashop>productcomments_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{productcomments}prestashop>productcomments_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{productcomments}prestashop>productcomments_66b06316f84eb73075bca0e27f2a5581'] = 'Permetti i commenti degli ospiti'; +$_MODULE['<{productcomments}prestashop>productcomments_2e53b6c4c0d39a73718342ab2366ae37'] = 'Tempo minimo tra 2 commenti dello stesso utente'; +$_MODULE['<{productcomments}prestashop>productcomments_783e8e29e6a8c3e22baa58a19420eb4f'] = 'secondi'; +$_MODULE['<{productcomments}prestashop>productcomments_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{productcomments}prestashop>productcomments_0a36c5f3ea6825804e6b4314c4084a12'] = 'Moderare i commenti'; +$_MODULE['<{productcomments}prestashop>productcomments_a517747c3d12f99244ae598910d979c5'] = 'Autore'; +$_MODULE['<{productcomments}prestashop>productcomments_0be8406951cdfda82f00f79328cf4efc'] = 'Commenta'; +$_MODULE['<{productcomments}prestashop>productcomments_df644ae155e79abf54175bd15d75f363'] = 'Nome del prodotto'; +$_MODULE['<{productcomments}prestashop>productcomments_06df33001c1d7187fdd81ea1f5b277aa'] = 'Azioni'; +$_MODULE['<{productcomments}prestashop>productcomments_c4408d335012a56ff58937d78050efad'] = 'Accettare'; +$_MODULE['<{productcomments}prestashop>productcomments_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{productcomments}prestashop>productcomments_8bf0c707232d63bf83b4b2467d2df41a'] = 'Selezione:'; +$_MODULE['<{productcomments}prestashop>productcomments_d00b7f656273a495f555bead0248d6f5'] = 'Non ci sono commenti da convalidare ora.'; +$_MODULE['<{productcomments}prestashop>productcomments_7799b301b44c329fc9ec6a3a9c1905e0'] = 'Aggiungi un nuovo criterio di commento'; +$_MODULE['<{productcomments}prestashop>productcomments_7753ab38f8e113e8af65ab1241331625'] = 'È possibile definire criteri diversi, al fine di aiutare i clienti durante la loro opinione. Per esempio: efficienza, leggerezza, design.'; +$_MODULE['<{productcomments}prestashop>productcomments_bc58d00e1e42de31a8e58f8dc7d9bdc7'] = 'È possibile aggiungere un nuovo criterio di seguito:'; +$_MODULE['<{productcomments}prestashop>productcomments_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{productcomments}prestashop>productcomments_f255b686708be7c5082cd3f5bab872c1'] = 'Applica a'; +$_MODULE['<{productcomments}prestashop>productcomments_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo'; +$_MODULE['<{productcomments}prestashop>productcomments_f1d04e02f02d1f13450ae56f213a93f2'] = 'Modifica questo criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_9be4d6372a6487e90d8f153c66c1499d'] = 'Aggiungi questo criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_21a512e9d635e82fc7c7077fc880988b'] = 'Criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo'; +$_MODULE['<{productcomments}prestashop>productcomments_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{productcomments}prestashop>productcomments_7dce122004969d56ae2e0245cb754d35'] = 'Modifica'; +$_MODULE['<{productcomments}prestashop>productcomments_8eb0b6ced310b120b12106e8d4bdbdb8'] = 'Gestire le applicazioni dei criteri'; +$_MODULE['<{productcomments}prestashop>productcomments_6556e73b0255c988d9fe70141f1d4bd9'] = 'Solo i criteri limitati a categorie o prodotti possono essere configurati qui sotto:'; +$_MODULE['<{productcomments}prestashop>productcomments_a942d4abf908e5f708ec4dfaa949065e'] = 'Scegli un criterio'; +$_MODULE['<{productcomments}prestashop>productcomments_068f80c7519d0528fb08e82137a72131'] = 'Prodotti'; +$_MODULE['<{productcomments}prestashop>productcomments_af1b98adf7f686b84cd0b443e022b7a0'] = 'Categorie'; +$_MODULE['<{productcomments}prestashop>productcomments_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{productcomments}prestashop>productcomments_b9aefa40a54680bb258f9f9569290fae'] = 'Nome del prodotto'; +$_MODULE['<{productcomments}prestashop>productcomments_99121ab27aaa7472cfada9071c5ba434'] = 'Nome categoria'; +$_MODULE['<{productcomments}prestashop>productcomments_fd4b5401d4d3c7d32d158bfc1e552f3b'] = 'Inserisci il tuo nome'; +$_MODULE['<{productcomments}prestashop>productcomments_7b2f2ea0f690ef3c2fc9bba0e4bfbc4c'] = 'E\' stato postato un commento non valido.'; +$_MODULE['<{productcomments}prestashop>productcomments_f88dc17737f7fdd4464b2eb922a8f133'] = 'Errore durante il salvataggio del tuo commento.'; +$_MODULE['<{productcomments}prestashop>productcomments_7fa4a3510dafd0eac6435c19861b2bb7'] = 'Commento pubblicato con successo.'; +$_MODULE['<{productcomments}prestashop>productcomments_f8694a9aae2eb045920f613cfa7f1235'] = 'In attesa della convalida moderatore.'; +$_MODULE['<{productcomments}prestashop>productcomments_6bf852d9850445291f5e9d4740ac7b50'] = 'Testo commento richiesto.'; +$_MODULE['<{productcomments}prestashop>productcomments_6d28f2900adb9e500868166f6d04da92'] = 'Si deve attendere'; +$_MODULE['<{productcomments}prestashop>productcomments_ba8d7ae5dcadfba739f28a777378f208'] = 'secondi prima di pubblicare un nuovo commento'; +$_MODULE['<{productcomments}prestashop>productcomments_7c3b0e9898b88deee7ea75aafd2e37e2'] = 'Grado medio'; +$_MODULE['<{productcomments}prestashop>productcomments_b1897515d548a960afe49ecf66a29021'] = 'Media'; +$_MODULE['<{productcomments}prestashop>productcomments_5da618e8e4b89c66fe86e32cdafde142'] = 'Da'; +$_MODULE['<{productcomments}prestashop>productcomments_b78a3223503896721cca1303f776159b'] = 'Titolo'; +$_MODULE['<{productcomments}prestashop>productcomments_08621d00a3a801b9159a11b8bbd69f89'] = 'Non ci sono commenti dei clienti per il momento.'; +$_MODULE['<{productcomments}prestashop>productcomments_30b3dbf8b5c381c2e8d62189048ab37c'] = 'secondo/i prima di postare un nuovo commento'; +$_MODULE['<{productcomments}prestashop>productcomments_c3edcf2cedbd4ce230fd6d4ea8915718'] = 'Aggiungi un commento'; +$_MODULE['<{productcomments}prestashop>productcomments_a2ed44743411cf8b80e397448fce104c'] = 'Il tuo nome:'; +$_MODULE['<{productcomments}prestashop>productcomments_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titolo:'; +$_MODULE['<{productcomments}prestashop>productcomments_240f3031f25601fa128bd4e15f0a37de'] = 'Commento:'; +$_MODULE['<{productcomments}prestashop>productcomments_94966d90747b97d1f0f206c98a8b1ac3'] = 'Invia'; +$_MODULE['<{productcomments}prestashop>productcomments_720fae7db6e6055d2b47890240bb3598'] = 'Solo gli utenti registrati possono inserire un nuovo commento.'; +$_MODULE['<{productcomments}prestashop>products-comparison_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti'; +$_MODULE['<{productcomments}prestashop>products-comparison_b1897515d548a960afe49ecf66a29021'] = 'Media'; +$_MODULE['<{productcomments}prestashop>products-comparison_bc976f6c3405523cde61f63a7cbe224b'] = 'visualizzare i commenti'; +$_MODULE['<{productcomments}prestashop>tab_8413c683b4b27cc3f4dbd4c90329d8ba'] = 'Commenti'; diff --git a/modules/productcomments/js/jquery.rating.pack.js b/modules/productcomments/js/jquery.rating.pack.js new file mode 100644 index 000000000..488c28bd8 --- /dev/null +++ b/modules/productcomments/js/jquery.rating.pack.js @@ -0,0 +1,12 @@ +/* + ### jQuery Star Rating Plugin v2.0 - 2008-03-12 ### + By Diego A, http://www.fyneworks.com, diego@fyneworks.com + - v2 by Keith Wood, kbwood@virginbroadband.com.au + + Project: http://plugins.jquery.com/project/MultipleFriendlyStarRating + Website: http://www.fyneworks.com/jquery/star-rating/ + + This is a modified version of the star rating plugin from: + http://www.phpletter.com/Demo/Jquery-Star-Rating-Plugin/ +*/ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';4(w)(3($){$.Y.T=3(c){c=$.15({m:\'X U\',E:\'\',B:z,8:z},c||{});o d={};o e={t:3(n,a,b){2.6(n);$(a).D(\'.j\').A().l(b||\'x\')},6:3(n){$(d[n].7).O(\'.j\').u(\'9\').u(\'x\')},h:3(n){4(!$(d[n].5).Z(\'.m\')){$(d[n].5).D(\'.j\').A().l(\'9\')}},g:3(n,a){d[n].5=a;o b=$(a).L(\'a\').K();$(d[n].7).J(b);e.6(n);e.h(n);4(c.I)c.I.W(d[n].7,[b,a])}};2.V(3(i){o n=2.G;4(!d[n])d[n]={r:0};i=d[n].r;d[n].r++;4(i==0){c.8=$(2).S(\'p\')||c.8;d[n].7=$(\'\');$(2).C(d[n].7);4(c.8||c.B){}F{$(2).C($(\'\'+c.E+\'\').H(3(){e.6(n);$(2).l(\'9\')}).v(3(){e.h(n);$(2).u(\'9\')}).g(3(){e.g(n,2)}))}};f=$(\'\'+2.q+\'\');$(2).N(f);4(c.8){$(f).l(\'M\')}F{$(f).H(3(){e.6(n);e.t(n,2)}).v(3(){e.6(n);e.h(n)}).g(3(){e.g(n,2)})};4(2.14)d[n].5=f;$(2).13();4(i+1==2.12)e.h(n)});11(n 10 d)4(d[n].5){e.t(n,d[n].5,\'9\');$(d[n].7).J($(d[n].5).L(\'a\').K())}16 2}})(w);',62,69,'||this|function|if|currentElem|drain|valueElem|readOnly|star_on||||||eStar|click|reset||star|div|addClass|cancel||var|disabled|value|count|title|fill|removeClass|mouseout|jQuery|star_hover|class|false|andSelf|required|before|prevAll|cancelValue|else|name|mouseover|callback|val|text|children|star_readonly|after|siblings|hidden|type|input|attr|rating|Rating|each|apply|Cancel|fn|is|in|for|length|remove|checked|extend|return'.split('|'),0,{})) \ No newline at end of file diff --git a/modules/productcomments/js/moderate.js b/modules/productcomments/js/moderate.js new file mode 100644 index 000000000..7ad59c5e8 --- /dev/null +++ b/modules/productcomments/js/moderate.js @@ -0,0 +1,77 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function getCommentForm() +{ + if (document.forms) + return (document.forms['comment_form']); + else + return (document.comment_form); +} + +function acceptComment(id) +{ + var form = getCommentForm(); + if (id) + form.elements['id_product_comment'].value = id; + form.elements['action'].value = 'accept'; + form.submit(); +} + + +function deleteComment(id) +{ + var form = getCommentForm(); + if (id) + form.elements['id_product_comment'].value = id; + form.elements['action'].value = 'delete'; + form.submit(); +} + +function getCriterionForm() +{ + if (document.forms) + return (document.forms['criterion_form']); + else + return (document.criterion_form); +} + +function editCriterion(id) +{ + var form = getCriterionForm(); + form.elements['id_product_comment_criterion'].value = id; + form.elements['criterion_name'].value = document.getElementById('criterion_name_' + id).value; + form.elements['criterion_action'].value = 'edit'; + form.submit(); +} + +function deleteCriterion(id) +{ + var form = getCriterionForm(); + form.elements['id_product_comment_criterion'].value = id; + form.elements['criterion_action'].value = 'delete'; + form.submit(); +} diff --git a/modules/productcomments/js/productCriterion.js b/modules/productcomments/js/productCriterion.js new file mode 100644 index 000000000..0220aec13 --- /dev/null +++ b/modules/productcomments/js/productCriterion.js @@ -0,0 +1,41 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function getProductCriterionForm() +{ + if (document.forms) + return (document.forms['product_criterion_form']); + else + return (document.product_criterion_form); +} + +function getProductCriterion(path, id_product, id_lang) +{ + $.get(path + 'productcommentscriterion.php', { id_product: id_product, id_lang: id_lang }, + function(data){ + document.getElementById('product_criterions').innerHTML = data; + }); +} diff --git a/modules/productcomments/js/products-comparison.js b/modules/productcomments/js/products-comparison.js new file mode 100755 index 000000000..e88131c2c --- /dev/null +++ b/modules/productcomments/js/products-comparison.js @@ -0,0 +1,46 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(function () { + $('a.cluetip') + .cluetip({ + local:true, + cursor: 'pointer', + cluetipClass: 'comparison_comments', + dropShadow: false, + dropShadowSteps: 0, + showTitle: false, + tracking: true, + sticky: false, + mouseOutClose: true, + width: 450, + fx: { + open: 'fadeIn', + openSpeed: 'fast' + } + }) + .css('opacity', 0.8); +}); diff --git a/modules/productcomments/logo.gif b/modules/productcomments/logo.gif new file mode 100644 index 000000000..39433cf78 Binary files /dev/null and b/modules/productcomments/logo.gif differ diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php new file mode 100644 index 000000000..cf5215f1e --- /dev/null +++ b/modules/productcomments/productcomments.php @@ -0,0 +1,629 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class ProductComments extends Module +{ + const INSTALL_SQL_FILE = 'install.sql'; + + private $_html = ''; + private $_postErrors = array(); + + private $_productCommentsCriterionTypes = array(); + private $_baseUrl; + + public function __construct() + { + $this->name = 'productcomments'; + $this->tab = 'front_office_features'; + $this->version = '2.1'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Product Comments'); + $this->description = $this->l('Allow users to post comment about a product.'); + } + + public function install() + { + if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + elseif (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) + return false; + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + $sql = preg_split("/;\s*[\r\n]+/", trim($sql)); + + foreach ($sql AS $query) + if (!Db::getInstance()->Execute(trim($query))) + return false; + if (parent::install() == false OR $this->registerHook('productTab') == false + OR $this->registerHook('extraProductComparison') == false OR $this->registerHook('productTabContent') == false + OR $this->registerHook('header') == false OR !Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', 30) + OR !Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', 0) + OR !Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1)) + return false; + return true; + } + + function uninstall() + { + if (!parent::uninstall() OR !Configuration::deleteByName('PRODUCT_COMMENTS_MODERATE') OR !Configuration::deleteByName('PRODUCT_COMMENTS_ALLOW_GUESTS') OR !Configuration::deleteByName('PRODUCT_COMMENTS_MINIMAL_TIME')) + return false; + return true; + } + + protected function _postProcess() + { + if (Tools::isSubmit('submitModerate')) + { + Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', (int)Tools::getValue('moderate')); + Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', (int)Tools::getValue('allow_guest')); + Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', (int)Tools::getValue('product_comments_minimal_time')); + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + if ($id_criterion = (int)Tools::getValue('deleteCriterion')) + { + $productCommentCriterion = new ProductCommentCriterion((int)$id_criterion); + if ($productCommentCriterion->id) + if ($productCommentCriterion->delete()) + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Criterion deleted').'
        '; + } + } + + public function getContent() + { + include_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $this->_setBaseUrl(); + $this->_productCommentsCriterionTypes = ProductCommentCriterion::getTypes(); + $this->_html = '

        '.$this->displayName.'

        '; + $this->_postProcess(); + $this->_checkModerateComment(); + $this->_checkCriterion(); + $this->_updateApplicationCriterion(); + + return $this->_html.$this->_displayForm(); + } + + private function _setBaseUrl() + { + $this->_baseUrl = 'index.php?'; + foreach ($_GET AS $k => $value) + if (!in_array($k, array('deleteCriterion', 'editCriterion'))) + $this->_baseUrl .= $k.'='.$value.'&'; + $this->_baseUrl = rtrim($this->_baseUrl, '&'); + } + + private function _checkModerateComment() + { + $action = Tools::getValue('action'); + if (empty($action) === false && + (int)(Configuration::get('PRODUCT_COMMENTS_MODERATE'))) + { + $product_comments = Tools::getValue('id_product_comment'); + if (sizeof($product_comments)) + { + require_once(dirname(__FILE__).'/ProductComment.php'); + switch ($action) + { + case 'accept': + foreach ($product_comments AS $id_product_comment) + { + if (!$id_product_comment) + continue; + $comment = new ProductComment((int)$id_product_comment); + $comment->validate(); + } + break; + case 'delete': + foreach ($product_comments AS $id_product_comment) + { + if (!$id_product_comment) + continue; + $comment = new ProductComment((int)$id_product_comment); + $comment->delete(); + ProductComment::deleteGrades((int)$id_product_comment); + } + break; + default: + ; + } + } + } + } + private function _checkCriterion() + { + $action_criterion = Tools::getValue('criterion_action'); + $name = Tools::getValue('criterion'); + if (Tools::isSubmit('submitAddCriterion')) + { + global $cookie; + require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + $languages = Language::getLanguages(); + $id_criterion = (int)Tools::getValue('id_product_comment_criterion'); + $productCommentCriterion = new ProductCommentCriterion((int)$id_criterion); + foreach ($languages AS $lang) + $productCommentCriterion->name[(int)$lang['id_lang']] = Tools::getValue('criterion_'.(int)$lang['id_lang']); + + $productCommentCriterion->id_product_comment_criterion_type = (int)Tools::getValue('criterion_type'); + $productCommentCriterion->active = (int)Tools::getValue('criterion_active'); + + if ($productCommentCriterion->save()) + $this->_html .= '
        '.$this->l('Confirmation').''.(Tools::getValue('editCriterion') ? $this->l('Criterion updated') : $this->l('Criterion added')).'
        '; + } + elseif (!empty($action_criterion) AND empty($name)) + { + $id_product_comment_criterion = Tools::getValue('id_product_comment_criterion'); + require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + switch ($action_criterion) + { + case 'edit': + ProductCommentCriterion::update($id_product_comment_criterion, + Tools::getValue('criterion_id_lang'), + Tools::getValue('criterion_name')); + break; + case 'delete': + ProductCommentCriterion::delete($id_product_comment_criterion); + break; + default: + ; + } + } + } + + private function _updateApplicationCriterion() + { + if (Tools::isSubmit('submitApplicationCriterion')) + { + include_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $id_criterion = (int)Tools::getValue('id_criterion'); + $productCommentCriterion = new ProductCommentCriterion((int)$id_criterion); + if ($productCommentCriterion->id) + { + if ($productCommentCriterion->id_product_comment_criterion_type == 2) + { + $productCommentCriterion->deleteCategories(); + if ($categories = Tools::getValue('id_product')) + if (sizeof($categories)) + foreach ($categories AS $id_category) + $productCommentCriterion->addCategory((int)$id_category); + } + elseif ($productCommentCriterion->id_product_comment_criterion_type == 3) + { + $productCommentCriterion->deleteProducts(); + if ($products = Tools::getValue('id_product')) + if (sizeof($products)) + foreach ($products AS $product) + $productCommentCriterion->addProduct((int)$product); + } + } + + $this->_html .= '
        '.$this->l('Confirmation').''.$this->l('Settings updated').'
        '; + } + } + + private function _displayForm() + { + $this->_displayFormModerate(); + $this->_displayFormConfigurationCriterion(); + $this->_displayFormApplicationCriterion(); + return $this->_html; + } + + private function _displayFormModerate() + { + $this->_html = ' +
        + '.$this->l('Configuration').' +
        + +
        + + + + +
        +
        + +
        + + + + +
        +
        + +
        + '.$this->l('seconds').' +
        +
        +
        + +
        +
        +
        +
        +
        + '.$this->l('Moderate Comments').''; + if (Configuration::get('PRODUCT_COMMENTS_MODERATE')) + { + require_once(dirname(__FILE__).'/ProductComment.php'); + $comments = ProductComment::getByValidate(); + if (sizeof($comments)) + { + $this->_html .= ' +
        + + +
        + + + + + + + + + + '; + foreach ($comments AS $comment) + $this->_html .= ' + + + + + + '; + $this->_html .= ' + + + + + +
        '.$this->l('Author').''.$this->l('Comment').''.$this->l('Product name').''.$this->l('Actions').'
        '.htmlspecialchars($comment['customer_name'], ENT_COMPAT, 'UTF-8').'.'.htmlspecialchars($comment['content'], ENT_COMPAT, 'UTF-8').''.$comment['id_product'].' - '.htmlspecialchars($comment['name'], ENT_COMPAT, 'UTF-8').''.$this->l('Accept').' + '.$this->l('Delete').'
        '.$this->l('Selection:').''.$this->l('Accept').' + '.$this->l('Delete').'
        +
        '; + } + else + $this->_html .= $this->l('No comments to validate at this time.'); + } + $this->_html .= '

        '; + } + + private function _displayFormConfigurationCriterion() + { + global $cookie; + + $langs = Language::getLanguages(false); + $id_lang_default = (int)Configuration::get('PS_LANG_DEFAULT'); + + $id_criterion = (int)Tools::getValue('editCriterion'); + $criterion = new ProductCommentCriterion((int)$id_criterion); + $languageIds = 'criterion'; + $this->_html .= ' +
        + '.$this->l('Add a new comment criterion').' +

        '.$this->l('You can define several criterions to help your customers during their review. For instance: efficiency, lightness, design.').'
        +
        '.$this->l('You can add a new criterion below:').'

        +
        + +
        + '; + foreach ($langs AS $lang) + $this->_html .= ' +
        + +
        '; + $this->_html .= $this->displayFlags($langs, (int)$id_lang_default, $languageIds, 'criterion', true); + $this->_html .= ' +
        +
         
        + +
        + +
        + +
        + active ? 'checked="checked" ' : '').'/> + + active ? 'checked="checked" ' : '').'/> + +
        +
        + +
        +
        '; + require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + $criterions = ProductCommentCriterion::getCriterions((int)$cookie->id_lang); + if (sizeof($criterions)) + { + $this->_html.= '
        + + + + + + + + + + '; + + foreach ($criterions AS $criterion) + { + $this->_html .= ' + + + + '; + } + $this->_html .= '
        '.$this->l('Criterion').''.$this->l('Type').''.$this->l('Status').''.$this->l('Actions').'
        '.$criterion['name'].''.$this->_productCommentsCriterionTypes[(int)$criterion['id_product_comment_criterion_type']].''.$this->l('Edit').' + '.$this->l('Delete').'
        '; + } + $this->_html .= '

        '; + } + + private function _displayFormApplicationCriterion() + { + global $cookie; + + include_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $criterions = ProductCommentCriterion::getCriterions((int)$cookie->id_lang, false, true); + $id_criterion = (int)Tools::getValue('updateCriterion'); + + if ($id_criterion) + { + $criterion = new ProductCommentCriterion((int)$id_criterion); + if ($criterion->id_product_comment_criterion_type == 2) + { + $categories = Category::getSimpleCategories((int)$cookie->id_lang); + $criterion_categories = $criterion->getCategories(); + } + elseif ($criterion->id_product_comment_criterion_type == 3) + { + $criterion_products = $criterion->getProducts(); + $products = Product::getSimpleProducts((int)$cookie->id_lang); + } + } + + foreach ($criterions AS $key => $foo) + if ($foo['id_product_comment_criterion_type'] == 1) + unset($criterions[$key]); + + if (sizeof($criterions)) + { + $this->_html .= ' +
        + '.$this->l('Manage criterions scope').' +

        '.$this->l('Only criterions restricted to categories or products can be configured below:').'

        +
        + +
        + +
        +
        '; + + if ($id_criterion AND $criterion->id_product_comment_criterion_type != 1) + { + $this->_html .=' +
        +
        + +
        + + + + + + + + '; + + if ($criterion->id_product_comment_criterion_type == 3) + foreach ($products AS $product) + $this->_html .=' + '; + elseif ($criterion->id_product_comment_criterion_type == 2) + foreach ($categories AS $category) + $this->_html .=' + '; + $this->_html .=' +
        '.$this->l('ID').''.($criterion->id_product_comment_criterion_type == 3 ? $this->l('Product Name') : $this->l('Category Name')).'
        '.(int)$product['id_product'].''.$product['name'].'
        '.(int)$category['id_category'].''.$category['name'].'
        +
        +
        + +
        +
        '; + } + + $this->_html .= '
        '; + } + } + + public function hookProductTab($params) + { + global $smarty, $cookie; + + require_once(dirname(__FILE__).'/ProductComment.php'); + require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $smarty->assign(array( + 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), + 'comments' => ProductComment::getByProduct((int)($_GET['id_product'])), + 'criterions' => ProductCommentCriterion::getByProduct((int)($_GET['id_product']), (int)($cookie->id_lang)), + 'nbComments' => (int)(ProductComment::getCommentNumber((int)($_GET['id_product']))))); + + return ($this->display(__FILE__, '/tab.tpl')); + } + + private function _frontOfficePostProcess() + { + global $smarty, $cookie, $errors; + + require_once(dirname(__FILE__).'/ProductComment.php'); + require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + + $allow_guests = (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'); + if (Tools::isSubmit('submitMessage') AND (empty($cookie->id_customer) === false OR ($cookie->id_guest AND $allow_guests))) + { + $id_guest = (!$id_customer = (int)$cookie->id_customer) ? (int)$cookie->id_guest : false; + $customerComment = ProductComment::getByCustomer((int)(Tools::getValue('id_product')), (int)$cookie->id_customer, true, (int)$id_guest); + + if (!$customerComment OR ($customerComment AND (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) < time())) + { + $customer_name = false; + if ($id_guest AND (!$customer_name = Tools::getValue('customer_name'))) + $errors[] = $this->l('Please fill your name'); + if (!sizeof($errors) AND Tools::getValue('content')) + { + $comment = new ProductComment(); + $comment->content = strip_tags(Tools::getValue('content')); + $comment->id_product = (int)$_GET['id_product']; + $comment->id_customer = (int)$cookie->id_customer; + $comment->id_guest = (int)$id_guest; + $comment->customer_name = pSQL($customer_name); + $comment->title = pSQL(Tools::getValue('title')); + $comment->grade = 0; + $comment->validate = 0; + + if (!$comment->content) + $errors[] = $this->l('Invalid comment text posted.'); + else + { + $comment->save(); + for ($i = 1, $grade = 0; isset($_POST[$i.'_grade']) === true; ++$i) + { + $cgrade = (int)Tools::getValue($i.'_grade'); + $grade += $cgrade; + $productCommentCriterion = new ProductCommentCriterion((int)Tools::getValue('id_product_comment_criterion_'.$i)); + if ($productCommentCriterion->id) + $productCommentCriterion->addGrade($comment->id, $cgrade); + } + if (($i - 1) > 0) + $comment->grade = ($grade / ($i - 1)); + if (!$comment->save()) + $errors[] = $this->l('An error occurred while saving your comment.'); + else + $smarty->assign('confirmation', $this->l('Comment posted.').((int)(Configuration::get('PRODUCT_COMMENTS_MODERATE')) ? ' '.$this->l('Awaiting moderator validation.') : '')); + } + } + else + $errors[] = $this->l('Comment text is required.'); + } + else + $errors[] = $this->l('You should wait').' '.Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME').' '.$this->l('seconds before posting a new comment'); + } + } + + public function hookProductTabContent($params) + { + global $smarty, $cookie; + + $id_guest = (!$id_customer = (int)$cookie->id_customer) ? (int)$cookie->id_guest : false; + $customerComment = ProductComment::getByCustomer((int)(Tools::getValue('id_product')), (int)$cookie->id_customer, true, (int)$id_guest); + + $averages = ProductComment::getAveragesByProduct((int)Tools::getValue('id_product'), (int)$cookie->id_lang); + $averageTotal = 0; + foreach ($averages AS $average) + $averageTotal += (float)($average); + $averageTotal = count($averages) ? ($averageTotal / count($averages)) : 0; + + $smarty->assign(array( + 'logged' => (int)$cookie->id_customer, + 'action_url' => '', + 'comments' => ProductComment::getByProduct((int)Tools::getValue('id_product')), + 'criterions' => ProductCommentCriterion::getByProduct((int)Tools::getValue('id_product'), (int)$cookie->id_lang), + 'averages' => $averages, + 'product_comment_path' => $this->_path, + 'averageTotal' => $averageTotal, + 'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), + 'too_early' => ($customerComment AND (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) > time()), + 'delay' => Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME'))); + + $controller = new FrontController(); + $controller->pagination((int)ProductComment::getCommentNumber((int)Tools::getValue('id_product'))); + + return ($this->display(__FILE__, '/productcomments.tpl')); + } + + public function hookHeader() + { + $this->_frontOfficePostProcess(); + } + + public function hookExtraProductComparison($params) + { + global $smarty, $cookie; + + $list_grades = array(); + $list_product_grades = array(); + $list_product_average = array(); + $list_product_comment = array(); + + foreach ($params['list_ids_product'] AS $id_product) + { + $grades = ProductComment::getAveragesByProduct((int)$id_product, (int)$cookie->id_lang); + $criterions = ProductCommentCriterion::getByProduct((int)$id_product, (int)$cookie->id_lang); + $grade_total = 0; + if (sizeof($grades) > 0) + { + foreach ($criterions AS $criterion) + { + $list_product_grades[$criterion['id_product_comment_criterion']][$id_product] = $grades[$criterion['id_product_comment_criterion']]; + $grade_total += (float)($grades[$criterion['id_product_comment_criterion']]); + + if (!array_key_exists($criterion['id_product_comment_criterion'], $list_grades)) + $list_grades[$criterion['id_product_comment_criterion']] = $criterion['name']; + } + + $list_product_average[$id_product] = $grade_total / sizeof($criterion); + $list_product_comment[$id_product] = ProductComment::getByProduct($id_product, 0, 3); + } + } + + if (sizeof($list_grades) < 1) + return false; + + $smarty->assign(array('grades' => $list_grades, 'product_grades' => $list_product_grades, 'list_ids_product' => $params['list_ids_product'], + 'list_product_average' => $list_product_average, 'product_comments' => $list_product_comment)); + + return $this->display(__FILE__,'/products-comparison.tpl'); + } +} diff --git a/modules/productcomments/productcomments.tpl b/modules/productcomments/productcomments.tpl new file mode 100644 index 000000000..5b04b5b8c --- /dev/null +++ b/modules/productcomments/productcomments.tpl @@ -0,0 +1,137 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        + + +{if $comments} + {if $criterions|@count > 0} +

        {l s='Average grade' mod='productcomments'}

        +
        + {l s='Average' mod='productcomments'}:
        + {section loop=6 step=1 start=1 name=average} + + {/section} +
        +
        + {foreach from=$criterions item=c} +
        + {$c.name|escape:'html':'UTF-8'}
        + {section loop=6 step=1 start=1 name=average} + + {/section} +
        + {/foreach} +
        + {/if} +
        + + + + + + + + + + {foreach from=$comments item=comment} + {if $comment.content} + + + + + + {/if} + {/foreach} + +
        {l s='From' mod='productcomments'}{l s='Title' mod='productcomments'}{l s='Comment' mod='productcomments'}
        + {dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0} + {$comment.customer_name|escape:'html':'UTF-8'}. + + {$comment.title} + + {$comment.content|escape:'html':'UTF-8'|nl2br} +
        +
        +{else} +

        {l s='No customer comments for the moment.' mod='productcomments'}

        +{/if} + +{if $too_early == true} +

        {l s='You should wait' mod='productcomments'} {$delay} {l s='second(s) before posting a new comment' mod='productcomments'}

        +{elseif $cookie->isLogged() == true || $allow_guests == true} +

        + +{else} +

        {l s='Only registered users can post a new comment.' mod='productcomments'}

        +{/if} +
        \ No newline at end of file diff --git a/modules/productcomments/productcommentscriterion.php b/modules/productcomments/productcommentscriterion.php new file mode 100644 index 000000000..d22a4635a --- /dev/null +++ b/modules/productcomments/productcommentscriterion.php @@ -0,0 +1,52 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../classes/Validate.php'); +require_once(dirname(__FILE__).'/../../classes/Db.php'); +require_once(dirname(__FILE__).'/../../classes/Tools.php'); +require_once(dirname(__FILE__).'/ProductCommentCriterion.php'); + +if (empty($_GET['id_lang']) === false && + isset($_GET['id_product']) === true) +{ + $criterions = ProductCommentCriterion::get($_GET['id_lang']); + if ((int)($_GET['id_product'])) + $selects = ProductCommentCriterion::getByProduct($_GET['id_product'], $_GET['id_lang']); + echo ''; +} \ No newline at end of file diff --git a/modules/productcomments/products-comparison.tpl b/modules/productcomments/products-comparison.tpl new file mode 100755 index 000000000..ed9980d86 --- /dev/null +++ b/modules/productcomments/products-comparison.tpl @@ -0,0 +1,116 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + + + + {l s='Comments' mod='productcomments'} + + {section loop=$list_ids_product|count step=1 start=0 name=td} + + {/section} + + +{foreach from=$grades item=grade key=grade_id} + + {cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'} + + {$grade} + + + {foreach from=$list_ids_product item=id_product} + {assign var='tab_grade' value=$product_grades[$grade_id]} + + {if $tab_grade[$id_product]} + {section loop=6 step=1 start=1 name=average} + + {/section} + {else} + - + {/if} + + {/foreach} + +{/foreach} + + {cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'} + + {l s='Average' mod='productcomments'} +{foreach from=$list_ids_product item=id_product} + + {if $list_product_average[$id_product]} + {section loop=6 step=1 start=1 name=average} + + {/section} + {else} + - + {/if} + +{/foreach} + + + +   + {foreach from=$list_ids_product item=id_product} + + {if $product_comments[$id_product]} + {l s='view comments' mod='productcomments'} + + {else} + - + {/if} + +{/foreach} + \ No newline at end of file diff --git a/modules/productcomments/tab.tpl b/modules/productcomments/tab.tpl new file mode 100644 index 000000000..9e09420c9 --- /dev/null +++ b/modules/productcomments/tab.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
      • {l s='Comments' mod='productcomments'} ({$nbComments})
      • \ No newline at end of file diff --git a/modules/productscategory/config.xml b/modules/productscategory/config.xml new file mode 100755 index 000000000..188755d84 --- /dev/null +++ b/modules/productscategory/config.xml @@ -0,0 +1,11 @@ + + + productscategory + Products Category + 1.3 + Display products of the same category on the product page. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/productscategory/de.php b/modules/productscategory/de.php new file mode 100644 index 000000000..0e6ec15ab --- /dev/null +++ b/modules/productscategory/de.php @@ -0,0 +1,17 @@ +productscategory_db33983df8ef521000b0ab60dcb5a83f'] = 'Produktkategorie'; +$_MODULE['<{productscategory}prestashop>productscategory_0157084bddd8b408e1cdaba00f54a009'] = 'Zeigt Produkte der gleichen Kategorie auf der Produktseite an'; +$_MODULE['<{productscategory}prestashop>productscategory_462390017ab0938911d2d4e964c0cab7'] = 'Einstellungen erfolgreich aktualisiert'; +$_MODULE['<{productscategory}prestashop>productscategory_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{productscategory}prestashop>productscategory_b6bf131edd323320bac67303a3f4de8a'] = 'Preis auf Produkten anzeigen '; +$_MODULE['<{productscategory}prestashop>productscategory_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{productscategory}prestashop>productscategory_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{productscategory}prestashop>productscategory_70f9a895dc3273d34a7f6d14642708ec'] = 'Preise auf den Produkten im Block anzeigen.'; +$_MODULE['<{productscategory}prestashop>productscategory_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{productscategory}prestashop>productscategory_4aae87211f77aada2c87907121576cfe'] = 'andere Produkte der gleichen Kategorie:'; +$_MODULE['<{productscategory}prestashop>productscategory_dd1f775e443ff3b9a89270713580a51b'] = 'Zurück'; +$_MODULE['<{productscategory}prestashop>productscategory_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{productscategory}prestashop>productscategory_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Weiter'; diff --git a/modules/productscategory/en.php b/modules/productscategory/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/productscategory/en.php @@ -0,0 +1,4 @@ +productscategory_db33983df8ef521000b0ab60dcb5a83f'] = 'Categoría de productos'; +$_MODULE['<{productscategory}prestashop>productscategory_0157084bddd8b408e1cdaba00f54a009'] = 'Mostrar productos de la misma categoría en la página producto'; +$_MODULE['<{productscategory}prestashop>productscategory_462390017ab0938911d2d4e964c0cab7'] = 'Parámetros actualizados con éxito'; +$_MODULE['<{productscategory}prestashop>productscategory_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; +$_MODULE['<{productscategory}prestashop>productscategory_b6bf131edd323320bac67303a3f4de8a'] = 'Mostrar el precio del producto'; +$_MODULE['<{productscategory}prestashop>productscategory_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{productscategory}prestashop>productscategory_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{productscategory}prestashop>productscategory_70f9a895dc3273d34a7f6d14642708ec'] = 'Mostrar el precio del producto en el bloque'; +$_MODULE['<{productscategory}prestashop>productscategory_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{productscategory}prestashop>productscategory_4aae87211f77aada2c87907121576cfe'] = 'otros productos de la misma categoría:'; +$_MODULE['<{productscategory}prestashop>productscategory_dd1f775e443ff3b9a89270713580a51b'] = 'Anterior'; +$_MODULE['<{productscategory}prestashop>productscategory_4351cfebe4b61d8aa5efa1d020710005'] = 'Ver'; +$_MODULE['<{productscategory}prestashop>productscategory_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Siguiente'; diff --git a/modules/productscategory/fr.php b/modules/productscategory/fr.php new file mode 100644 index 000000000..e574054d6 --- /dev/null +++ b/modules/productscategory/fr.php @@ -0,0 +1,17 @@ +productscategory_db33983df8ef521000b0ab60dcb5a83f'] = 'Dans la même catégorie'; +$_MODULE['<{productscategory}prestashop>productscategory_0157084bddd8b408e1cdaba00f54a009'] = 'Affiche la liste des produits dans la même catégorie que celui affiché'; +$_MODULE['<{productscategory}prestashop>productscategory_462390017ab0938911d2d4e964c0cab7'] = 'Paramètres mis à jour avec succès'; +$_MODULE['<{productscategory}prestashop>productscategory_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{productscategory}prestashop>productscategory_b6bf131edd323320bac67303a3f4de8a'] = 'Afficher le prix du produit'; +$_MODULE['<{productscategory}prestashop>productscategory_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{productscategory}prestashop>productscategory_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{productscategory}prestashop>productscategory_70f9a895dc3273d34a7f6d14642708ec'] = 'Afficher le prix du produit dans le block'; +$_MODULE['<{productscategory}prestashop>productscategory_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{productscategory}prestashop>productscategory_4aae87211f77aada2c87907121576cfe'] = 'autres produits dans la même catégorie :'; +$_MODULE['<{productscategory}prestashop>productscategory_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent'; +$_MODULE['<{productscategory}prestashop>productscategory_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{productscategory}prestashop>productscategory_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant'; diff --git a/modules/productscategory/img/thumbs_left.gif b/modules/productscategory/img/thumbs_left.gif new file mode 100644 index 000000000..2830a5fc8 Binary files /dev/null and b/modules/productscategory/img/thumbs_left.gif differ diff --git a/modules/productscategory/img/thumbs_right.gif b/modules/productscategory/img/thumbs_right.gif new file mode 100644 index 000000000..8fc577522 Binary files /dev/null and b/modules/productscategory/img/thumbs_right.gif differ diff --git a/modules/productscategory/it.php b/modules/productscategory/it.php new file mode 100644 index 000000000..87808e7cf --- /dev/null +++ b/modules/productscategory/it.php @@ -0,0 +1,17 @@ +productscategory_db33983df8ef521000b0ab60dcb5a83f'] = 'Categoria prodotti'; +$_MODULE['<{productscategory}prestashop>productscategory_0157084bddd8b408e1cdaba00f54a009'] = 'Visualizza i prodotti della stessa categoria sulla pagina del prodotto'; +$_MODULE['<{productscategory}prestashop>productscategory_462390017ab0938911d2d4e964c0cab7'] = 'Impostazioni aggiornate con successo'; +$_MODULE['<{productscategory}prestashop>productscategory_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{productscategory}prestashop>productscategory_b6bf131edd323320bac67303a3f4de8a'] = 'Mostra prezzo sui prodotti'; +$_MODULE['<{productscategory}prestashop>productscategory_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{productscategory}prestashop>productscategory_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{productscategory}prestashop>productscategory_70f9a895dc3273d34a7f6d14642708ec'] = 'Mostra il prezzo sui prodotti nel blocco.'; +$_MODULE['<{productscategory}prestashop>productscategory_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{productscategory}prestashop>productscategory_4aae87211f77aada2c87907121576cfe'] = 'altri prodotti della stessa categoria:'; +$_MODULE['<{productscategory}prestashop>productscategory_dd1f775e443ff3b9a89270713580a51b'] = 'Precedente'; +$_MODULE['<{productscategory}prestashop>productscategory_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{productscategory}prestashop>productscategory_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Successivo'; diff --git a/modules/productscategory/logo.gif b/modules/productscategory/logo.gif new file mode 100644 index 000000000..c8d62638a Binary files /dev/null and b/modules/productscategory/logo.gif differ diff --git a/modules/productscategory/productscategory.css b/modules/productscategory/productscategory.css new file mode 100644 index 000000000..a31c22769 --- /dev/null +++ b/modules/productscategory/productscategory.css @@ -0,0 +1,51 @@ +h2.productscategory_h2 { + font-size: 1em; + line-height: 1.8em; +} + +#productscategory { + margin: 2em auto 0; + height: 120px; + width: 100%; +} + +#productscategory_noscroll { + height: 120px; + width: 100%; + margin-bottom: 30px; +} + +#productscategory_list { + overflow: hidden; + float: left; + width: 96%; +} + +#productscategory_list ul { + padding-left: 0; + list-style-type: none; +} + +#productscategory_list li { + float: left; + margin: 0 3px; + cursor: pointer; + text-align: center; + width: 100px; + overflow: hidden; + line-height: 20px; +} + +#productscategory_list li a { margin: auto; } + +#productscategory_scroll_left, #productscategory_scroll_right { + background: url('img/thumbs_left.gif') no-repeat center; + text-indent: -3000px; + display: block; + width: 9px; + height: 18px; + float: left; + margin-top: 30px; +} + +#productscategory_scroll_right { background-image: url('img/thumbs_right.gif'); } \ No newline at end of file diff --git a/modules/productscategory/productscategory.js b/modules/productscategory/productscategory.js new file mode 100644 index 000000000..5a4ba21cf --- /dev/null +++ b/modules/productscategory/productscategory.js @@ -0,0 +1,54 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function pc_serialScrollFixLock(event, targeted, scrolled, items, position) +{ + var leftArrow = position == 0 ? true : false; + var rightArrow = position + 5 >= $('#productscategory_list li:visible').length ? true : false; + + $('a#productscategory_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').fadeTo(0, leftArrow ? 0 : 1); + $('a#productscategory_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block'); + + return true; +} + +$(document).ready(function() +{ + $('#productscategory_list').serialScroll({ + items: 'li', + prev: 'a#productscategory_scroll_left', + next: 'a#productscategory_scroll_right', + axis: 'x', + offset: 0, + stop: true, + onBefore: pc_serialScrollFixLock, + duration: 300, + step: 1, + lazy: true, + lock: false, + force: false, + cycle: false }); +}); \ No newline at end of file diff --git a/modules/productscategory/productscategory.php b/modules/productscategory/productscategory.php new file mode 100644 index 000000000..3cfea7ca7 --- /dev/null +++ b/modules/productscategory/productscategory.php @@ -0,0 +1,178 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class productsCategory extends Module +{ + private $_html; + + public function __construct() + { + $this->name = 'productscategory'; + $this->version = '1.3'; + $this->author = 'PrestaShop'; + $this->tab = 'front_office_features'; + + parent::__construct(); + + $this->displayName = $this->l('Products Category'); + $this->description = $this->l('Display products of the same category on the product page.'); + } + + public function install() + { + if (!parent::install() OR !$this->registerHook('productfooter') OR !$this->registerHook('header') OR !Configuration::updateValue('PRODUCTSCATEGORY_DISPLAY_PRICE', 0)) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall() OR !Configuration::deleteByName('PRODUCTSCATEGORY_DISPLAY_PRICE')) + return false; + return true; + } + + public function getContent() + { + $this->_html = ''; + if (Tools::isSubmit('submitCross') AND Tools::getValue('displayPrice') != 0 AND Tools::getValue('displayPrice') != 1) + $this->_html .= $this->displayError('Invalid displayPrice'); + elseif (Tools::isSubmit('submitCross')) + { + Configuration::updateValue('PRODUCTSCATEGORY_DISPLAY_PRICE', Tools::getValue('displayPrice')); + $this->_html .= $this->displayConfirmation($this->l('Settings updated successfully')); + } + $this->_html .= ' +
        +
        '.$this->l('Settings').' + +
        + + + + +

        '.$this->l('Show the price on the products in the block.').'

        +
        +
        +
        +
        '; + return $this->_html; + } + + private function getCurrentProduct($products, $id_current) + { + if ($products) + foreach ($products AS $key => $product) + if ($product['id_product'] == $id_current) + return $key; + return false; + } + + public function hookProductFooter($params) + { + global $smarty, $cookie; + + $idProduct = (int)(Tools::getValue('id_product')); + $product = new Product((int)($idProduct)); + + /* If the visitor has came to this product by a category, use this one */ + if (isset($params['category']->id_category)) + $category = $params['category']; + /* Else, use the default product category */ + else + { + if (isset($product->id_category_default) AND $product->id_category_default > 1) + $category = New Category((int)($product->id_category_default)); + } + + if (!Validate::isLoadedObject($category) OR !$category->active) + return; + + // Get infos + $categoryProducts = $category->getProducts((int)($cookie->id_lang), 1, 100); /* 100 products max. */ + $sizeOfCategoryProducts = (int)sizeof($categoryProducts); + $middlePosition = 0; + + // Remove current product from the list + if (is_array($categoryProducts) AND sizeof($categoryProducts)) + { + foreach ($categoryProducts AS $key => $categoryProduct) + if ($categoryProduct['id_product'] == $idProduct) + { + unset($categoryProducts[$key]); + break; + } + + $taxes = Product::getTaxCalculationMethod(); + if (Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE')) + foreach ($categoryProducts AS $key => $categoryProduct) + if ($categoryProduct['id_product'] != $idProduct) + { + if ($taxes == 0 OR $taxes == 2) + $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], true, NULL); + elseif ($taxes == 1) + $categoryProducts[$key]['displayed_price'] = Product::getPriceStatic((int)$categoryProduct['id_product'], false, NULL); + } + + // Get positions + $middlePosition = round($sizeOfCategoryProducts / 2, 0); + $productPosition = $this->getCurrentProduct($categoryProducts, (int)$idProduct); + + // Flip middle product with current product + if ($productPosition) + { + $tmp = $categoryProducts[$middlePosition-1]; + $categoryProducts[$middlePosition-1] = $categoryProducts[$productPosition]; + $categoryProducts[$productPosition] = $tmp; + } + + // If products tab higher than 30, slice it + if ($sizeOfCategoryProducts > 30) + { + $categoryProducts = array_slice($categoryProducts, $middlePosition - 15, 30, true); + $middlePosition = 15; + } + } + + // Display tpl + $smarty->assign(array( + 'categoryProducts' => $categoryProducts, + 'middlePosition' => (int)$middlePosition, + 'ProdDisplayPrice' => Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE'))); + + return $this->display(__FILE__, 'productscategory.tpl'); + } + + public function hookHeader($params) + { + Tools::addCSS($this->_path.'productscategory.css', 'all'); + Tools::addJS(array($this->_path.'productscategory.js', _PS_JS_DIR_.'jquery/jquery.serialScroll-1.2.2-min.js')); + } +} \ No newline at end of file diff --git a/modules/productscategory/productscategory.tpl b/modules/productscategory/productscategory.tpl new file mode 100644 index 000000000..7bd0ae1fa --- /dev/null +++ b/modules/productscategory/productscategory.tpl @@ -0,0 +1,56 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if count($categoryProducts) > 0} +

        {$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}

        +
        + {if count($categoryProducts) > 5}{l s='Previous' mod='productscategory'}{/if} +
        + +
        + {if count($categoryProducts) > 5}{l s='Next' mod='productscategory'}{/if} +
        + +{/if} diff --git a/modules/producttooltip/config.xml b/modules/producttooltip/config.xml new file mode 100755 index 000000000..b5ae32698 --- /dev/null +++ b/modules/producttooltip/config.xml @@ -0,0 +1,11 @@ + + + producttooltip + Product tooltips + 1.0 + Show how many people are watching a product page, last sale and last cart add. + PrestaShop + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/producttooltip/de.php b/modules/producttooltip/de.php new file mode 100644 index 000000000..7f2b5e181 --- /dev/null +++ b/modules/producttooltip/de.php @@ -0,0 +1,23 @@ +producttooltip_4776f7eb5998034f7bbc63b6457d1ff4'] = 'Produkt-Tooltips'; +$_MODULE['<{producttooltip}prestashop>producttooltip_317993b85812c8e0e9042a7dd871f538'] = 'Anzeigen, wie viele Leute eine Produktseite ansehen, sowie die Anzeige des letzten Verkaufs und des letzten hinzugefügten Warenkorbs'; +$_MODULE['<{producttooltip}prestashop>producttooltip_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e548d0d6a94a27306b8b31472a3e5ec3'] = 'Anzahl der Menschen anzeigen, die gerade dieses Produkt ansehen?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{producttooltip}prestashop>producttooltip_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{producttooltip}prestashop>producttooltip_2c8de3180924949acc5f6250af689802'] = 'Online-Zeit'; +$_MODULE['<{producttooltip}prestashop>producttooltip_640fd0cc0ffa0316ae087652871f4486'] = 'Minuten'; +$_MODULE['<{producttooltip}prestashop>producttooltip_1e358b149c2d4105f3a74c1961d1d9fb'] = 'Datum der letzten Bestellung dieses Produkts anzeigen?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_69cd5a64d37c70989558b58f0b484fb3'] = 'Falls noch nie bestellt, Datum der letzten Auswahl in einem Warenkorb anzeigen?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_a536f110cc080569666e95e8f49fda9b'] = 'Keine Ereignisse, anzeigen, die älter sind als :'; +$_MODULE['<{producttooltip}prestashop>producttooltip_44fdec47036f482b68b748f9d786801b'] = 'Tage'; +$_MODULE['<{producttooltip}prestashop>producttooltip_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{producttooltip}prestashop>producttooltip_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Beispiel:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_975f3743bcce9c5a2e30001aab592fb1'] = 'Person sieht gerade'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e1a1dc1574c9f178c14e2952351aa47d'] = 'Menschen sehen gerade'; +$_MODULE['<{producttooltip}prestashop>producttooltip_d296e0c3a7dffc0f4d02574bd502653f'] = 'dieses Produkt'; +$_MODULE['<{producttooltip}prestashop>producttooltip_71736c614b237f4368128077411f1699'] = 'Dieses Produkt wurde zuletzt gekauft '; +$_MODULE['<{producttooltip}prestashop>producttooltip_4dda321f0231c2d50fcee5c20075dbbd'] = 'Dieses Produkt wurde zuletzt in den Warenkorb hinzugefügt'; diff --git a/modules/producttooltip/es.php b/modules/producttooltip/es.php new file mode 100644 index 000000000..9af41e845 --- /dev/null +++ b/modules/producttooltip/es.php @@ -0,0 +1,23 @@ +producttooltip_4776f7eb5998034f7bbc63b6457d1ff4'] = 'Ventana de información producto'; +$_MODULE['<{producttooltip}prestashop>producttooltip_317993b85812c8e0e9042a7dd871f538'] = 'Mostrar cuántas personas están viendo la página del producto, así como la fecha del último producto pedido o incluido en el carrito'; +$_MODULE['<{producttooltip}prestashop>producttooltip_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e548d0d6a94a27306b8b31472a3e5ec3'] = '¿Mostrar el número de personas que están viendo este producto?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{producttooltip}prestashop>producttooltip_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{producttooltip}prestashop>producttooltip_2c8de3180924949acc5f6250af689802'] = 'Periodo de validez:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_640fd0cc0ffa0316ae087652871f4486'] = 'minutos'; +$_MODULE['<{producttooltip}prestashop>producttooltip_1e358b149c2d4105f3a74c1961d1d9fb'] = '¿Mostrar la fecha del último pedido?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_69cd5a64d37c70989558b58f0b484fb3'] = 'Si no hay pedido, ¿mostrar la última vez que un producto ha sido añadido al carrito?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_a536f110cc080569666e95e8f49fda9b'] = 'No mostrar los acontecimientos de más de:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_44fdec47036f482b68b748f9d786801b'] = 'días'; +$_MODULE['<{producttooltip}prestashop>producttooltip_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar configuración'; +$_MODULE['<{producttooltip}prestashop>producttooltip_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Mostrar:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_975f3743bcce9c5a2e30001aab592fb1'] = 'la persona que está viendo en este momento'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e1a1dc1574c9f178c14e2952351aa47d'] = 'las personas que están viendo en este momento'; +$_MODULE['<{producttooltip}prestashop>producttooltip_d296e0c3a7dffc0f4d02574bd502653f'] = 'este producto'; +$_MODULE['<{producttooltip}prestashop>producttooltip_71736c614b237f4368128077411f1699'] = 'Este producto fue comprado por última vez el'; +$_MODULE['<{producttooltip}prestashop>producttooltip_4dda321f0231c2d50fcee5c20075dbbd'] = 'Este producto fue añadido al carrito por última vez el'; diff --git a/modules/producttooltip/fr.php b/modules/producttooltip/fr.php new file mode 100644 index 000000000..160c853b1 --- /dev/null +++ b/modules/producttooltip/fr.php @@ -0,0 +1,23 @@ +producttooltip_4776f7eb5998034f7bbc63b6457d1ff4'] = 'Infobulles produit'; +$_MODULE['<{producttooltip}prestashop>producttooltip_317993b85812c8e0e9042a7dd871f538'] = 'Affiche combien de personnes consultent un produit ainsi que les dates de dernière commande ou ajout au panier'; +$_MODULE['<{producttooltip}prestashop>producttooltip_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e548d0d6a94a27306b8b31472a3e5ec3'] = 'Afficher le nombre de personnes qui consultent la fiche produit ?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{producttooltip}prestashop>producttooltip_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{producttooltip}prestashop>producttooltip_2c8de3180924949acc5f6250af689802'] = 'Période de validité :'; +$_MODULE['<{producttooltip}prestashop>producttooltip_640fd0cc0ffa0316ae087652871f4486'] = 'minutes'; +$_MODULE['<{producttooltip}prestashop>producttooltip_1e358b149c2d4105f3a74c1961d1d9fb'] = 'Afficher la date de la dernière commande ?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_69cd5a64d37c70989558b58f0b484fb3'] = 'Si aucune commande à afficher, afficher la date du dernier ajout au panier ?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_a536f110cc080569666e95e8f49fda9b'] = 'Ne pas afficher les événements datant de plus de :'; +$_MODULE['<{producttooltip}prestashop>producttooltip_44fdec47036f482b68b748f9d786801b'] = 'jours'; +$_MODULE['<{producttooltip}prestashop>producttooltip_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les paramètres'; +$_MODULE['<{producttooltip}prestashop>producttooltip_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Exemple :'; +$_MODULE['<{producttooltip}prestashop>producttooltip_975f3743bcce9c5a2e30001aab592fb1'] = 'personne regarde actuellement'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e1a1dc1574c9f178c14e2952351aa47d'] = 'personnes regardent actuellement'; +$_MODULE['<{producttooltip}prestashop>producttooltip_d296e0c3a7dffc0f4d02574bd502653f'] = 'ce produit'; +$_MODULE['<{producttooltip}prestashop>producttooltip_71736c614b237f4368128077411f1699'] = 'Ce produit a été acheté dernièrement le'; +$_MODULE['<{producttooltip}prestashop>producttooltip_4dda321f0231c2d50fcee5c20075dbbd'] = 'Ce produit a été ajouté au panier dernièrement le'; diff --git a/modules/producttooltip/it.php b/modules/producttooltip/it.php new file mode 100644 index 000000000..e2d329af1 --- /dev/null +++ b/modules/producttooltip/it.php @@ -0,0 +1,23 @@ +producttooltip_4776f7eb5998034f7bbc63b6457d1ff4'] = 'Tooltip prodotto'; +$_MODULE['<{producttooltip}prestashop>producttooltip_317993b85812c8e0e9042a7dd871f538'] = 'Mostra quante persone stanno guardando una pagina del prodotto, l\'ultima vendita e l\'ultimo carrello aggiunto'; +$_MODULE['<{producttooltip}prestashop>producttooltip_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e548d0d6a94a27306b8b31472a3e5ec3'] = 'Visualizzare il numero di persone che stanno attualmente guardando questo prodotto?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{producttooltip}prestashop>producttooltip_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{producttooltip}prestashop>producttooltip_2c8de3180924949acc5f6250af689802'] = 'Periodo:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_640fd0cc0ffa0316ae087652871f4486'] = 'minuti'; +$_MODULE['<{producttooltip}prestashop>producttooltip_1e358b149c2d4105f3a74c1961d1d9fb'] = 'Visualizzare l\'ultima volta in cui il prodotto è stato ordinato?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_69cd5a64d37c70989558b58f0b484fb3'] = 'Se ancora non c\'è nessun ordine, vuoi vedere l\'ultima volta che il prodotto è stato aggiunto al carrello?'; +$_MODULE['<{producttooltip}prestashop>producttooltip_a536f110cc080569666e95e8f49fda9b'] = 'Non visualizzare gli eventi che datano a prima di:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_44fdec47036f482b68b748f9d786801b'] = 'giorno'; +$_MODULE['<{producttooltip}prestashop>producttooltip_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; +$_MODULE['<{producttooltip}prestashop>producttooltip_f0f5fac9602d88bc27f0edf960dda8b8'] = 'Esempio:'; +$_MODULE['<{producttooltip}prestashop>producttooltip_975f3743bcce9c5a2e30001aab592fb1'] = 'persona sta guardando'; +$_MODULE['<{producttooltip}prestashop>producttooltip_e1a1dc1574c9f178c14e2952351aa47d'] = 'persone stanno guardando'; +$_MODULE['<{producttooltip}prestashop>producttooltip_d296e0c3a7dffc0f4d02574bd502653f'] = 'questo prodotto'; +$_MODULE['<{producttooltip}prestashop>producttooltip_71736c614b237f4368128077411f1699'] = 'Questo prodotto è stato comprato'; +$_MODULE['<{producttooltip}prestashop>producttooltip_4dda321f0231c2d50fcee5c20075dbbd'] = 'Questo prodotto è stato aggiunto al carrello '; diff --git a/modules/producttooltip/logo.gif b/modules/producttooltip/logo.gif new file mode 100644 index 000000000..d893833a0 Binary files /dev/null and b/modules/producttooltip/logo.gif differ diff --git a/modules/producttooltip/producttooltip.php b/modules/producttooltip/producttooltip.php new file mode 100644 index 000000000..3add67927 --- /dev/null +++ b/modules/producttooltip/producttooltip.php @@ -0,0 +1,188 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class ProductToolTip extends Module +{ + public function __construct() + { + $this->name = 'producttooltip'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Product tooltips'); + $this->description = $this->l('Show how many people are watching a product page, last sale and last cart add.'); + } + + public function install() + { + if (!parent::install()) + return false; + + /* Default configuration values */ + Configuration::updateValue('PS_PTOOLTIP_PEOPLE', 1); + Configuration::updateValue('PS_PTOOLTIP_DATE_CART', 1); + Configuration::updateValue('PS_PTOOLTIP_DATE_ORDER', 1); + Configuration::updateValue('PS_PTOOLTIP_DAYS', 3); + Configuration::updateValue('PS_PTOOLTIP_LIFETIME', 30); + + return $this->registerHook('productfooter'); + } + + public function uninstall() + { + if (!Configuration::deleteByName('PS_PTOOLTIP_PEOPLE') + OR !Configuration::deleteByName('PS_PTOOLTIP_DATE_CART') + OR !Configuration::deleteByName('PS_PTOOLTIP_DATE_ORDER') + OR !Configuration::deleteByName('PS_PTOOLTIP_DAYS') + OR !Configuration::deleteByName('PS_PTOOLTIP_LIFETIME') + OR !parent::uninstall()) + return false; + return true; + } + + public function getContent() + { + /* Update values in DB */ + if (Tools::isSubmit('SubmitToolTip')) + { + Configuration::updateValue('PS_PTOOLTIP_PEOPLE', (int)(Tools::getValue('ps_ptooltip_people'))); + Configuration::updateValue('PS_PTOOLTIP_DATE_CART', (int)(Tools::getValue('ps_ptooltip_date_cart'))); + Configuration::updateValue('PS_PTOOLTIP_DATE_ORDER', (int)(Tools::getValue('ps_ptooltip_date_order'))); + Configuration::updateValue('PS_PTOOLTIP_DAYS', (int)(Tools::getValue('ps_ptooltip_days'))); + Configuration::updateValue('PS_PTOOLTIP_LIFETIME', (int)(Tools::getValue('ps_ptooltip_lifetime'))); + + echo $this->displayConfirmation($this->l('Settings updated')); + } + + /* Configuration form */ + $output = ' +
        +
        + '.$this->l('Product tooltips').' +

        + '.$this->l('Display the number of people who are currently watching this product?').'

        + '.$this->l('Yes').' +   '.$this->l('No').'
        + +

        +

        + '.$this->l('Lifetime:').' + '.$this->l('minutes').'
        +

        +
        +

        + '.$this->l('Display the last time the product has been ordered?').'

        + '.$this->l('Yes').' +   '.$this->l('No').'

        +

        +

        + '.$this->l('If not order yet, display the last time the product has been added to cart?').'

        + '.$this->l('Yes').' +   '.$this->l('No').'

        + +

        +

        + '.$this->l('Do not display events older than:').' + '.$this->l('days').'
        +

        +
        +
        +
        +

        + '.$this->l('Sample:').'
        + +

        +
        +
        '; + + return $output; + } + + public function hookProductFooter($params) + { + global $smarty, $cookie; + + $id_product = (int)($params['product']->id); + + /* First we try to display the number of people who are currently watching this product page */ + if (Configuration::get('PS_PTOOLTIP_PEOPLE')) + { + $date = strftime('%Y-%m-%d %H:%M:%S' , time() - (int)(Configuration::get('PS_PTOOLTIP_LIFETIME') * 60)); + + $nbPeople = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT(id_connections)) nb + FROM '._DB_PREFIX_.'page p + LEFT JOIN '._DB_PREFIX_.'connections_page cp ON (p.id_page = cp.id_page) + WHERE p.id_page_type = 1 AND p.id_object = '.(int)($id_product).' AND cp.time_start > \''.pSQL($date).'\''); + + if (isset($nbPeople['nb']) AND $nbPeople['nb'] > 0) + $smarty->assign('nb_people', (int)($nbPeople['nb'])); + } + + /* Then, we try to display last sale */ + if (Configuration::get('PS_PTOOLTIP_DATE_ORDER')) + { + $days = (int)(Configuration::get('PS_PTOOLTIP_DAYS')); + $date = strftime('%Y-%m-%d' , strtotime('-'.(int)($days).' day')); + + $order = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT o.date_add + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'orders o ON (od.id_order = o.id_order) + WHERE od.product_id = '.(int)($id_product).' AND o.date_add >= \''.pSQL($date).'\' + ORDER BY o.date_add DESC'); + + if (isset($order['date_add'])) + $smarty->assign('date_last_order', $order['date_add']); + else + { + /* No sale? display last cart add instead */ + if (Configuration::get('PS_PTOOLTIP_DATE_CART')) + { + $cart = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT cp.date_add + FROM '._DB_PREFIX_.'cart_product cp + WHERE cp.id_product = '.(int)($id_product)); + + if (isset($cart['date_add'])) + $smarty->assign('date_last_cart', $cart['date_add']); + } + } + } + + if ((isset($nbPeople['nb']) AND $nbPeople['nb'] > 0) OR isset($order['date_add']) OR isset($cart['date_add'])) + return $this->display(__FILE__, 'producttooltip.tpl'); + } +} + + diff --git a/modules/producttooltip/producttooltip.tpl b/modules/producttooltip/producttooltip.tpl new file mode 100644 index 000000000..b72323c93 --- /dev/null +++ b/modules/producttooltip/producttooltip.tpl @@ -0,0 +1,36 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + diff --git a/modules/producttooltip/sample.gif b/modules/producttooltip/sample.gif new file mode 100644 index 000000000..ef252d76f Binary files /dev/null and b/modules/producttooltip/sample.gif differ diff --git a/modules/referralprogram/ReferralProgramModule.php b/modules/referralprogram/ReferralProgramModule.php new file mode 100644 index 000000000..b587a4594 --- /dev/null +++ b/modules/referralprogram/ReferralProgramModule.php @@ -0,0 +1,186 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class ReferralProgramModule extends ObjectModel +{ + public $id_sponsor; + public $email; + public $lastname; + public $firstname; + public $id_customer; + public $id_discount; + public $id_discount_sponsor; + public $date_add; + public $date_upd; + + protected $fieldsRequired = array('id_sponsor', 'email', 'lastname', 'firstname'); + protected $fieldsSize = array('id_sponsor' => 8, 'email' => 255, 'lastname' => 128, 'firstname' => 128, 'id_customer' => 8, 'id_discount' => 8, 'id_discount_sponsor' => 8); + protected $fieldsValidate = array( 'id_sponsor' => 'isUnsignedId', 'email' => 'isEmail', 'lastname' => 'isName', 'firstname' => 'isName', 'id_customer' => 'isUnsignedId', 'id_discount' => 'isUnsignedId', 'id_discount_sponsor' => 'isUnsignedId'); + protected $table = 'referralprogram'; + protected $identifier = 'id_referralprogram'; + + public function getFields() + { + parent::validateFields(); + $fields['id_sponsor'] = (int)$this->id_sponsor; + $fields['email'] = pSQL($this->email); + $fields['lastname'] = pSQL($this->lastname); + $fields['firstname'] = pSQL($this->firstname); + $fields['id_customer'] = (int)$this->id_customer; + $fields['id_discount'] = (int)$this->id_discount; + $fields['id_discount_sponsor'] = (int)$this->id_discount_sponsor; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + return $fields; + } + + static public function getDiscountPrefix() + { + return 'SP'; + } + + public function registerDiscountForSponsor($id_currency) + { + if ((int)$this->id_discount_sponsor > 0) + return false; + return $this->registerDiscount((int)$this->id_sponsor, 'sponsor', (int)$id_currency); + } + + public function registerDiscountForSponsored($id_currency) + { + if (!(int)$this->id_customer OR (int)$this->id_discount > 0) + return false; + return $this->registerDiscount((int)$this->id_customer, 'sponsored', (int)$id_currency); + } + + public function registerDiscount($id_customer, $register = false, $id_currency = 0) + { + $configurations = Configuration::getMultiple(array('REFERRAL_DISCOUNT_TYPE', 'REFERRAL_PERCENTAGE', 'REFERRAL_DISCOUNT_VALUE_'.(int)$id_currency)); + + $discount = new Discount(); + $discount->id_discount_type = (int)$configurations['REFERRAL_DISCOUNT_TYPE']; + + /* % */ + if ($configurations['REFERRAL_DISCOUNT_TYPE'] == 1) + $discount->value = (float)$configurations['REFERRAL_PERCENTAGE']; + /* Fixed amount */ + elseif ($configurations['REFERRAL_DISCOUNT_TYPE'] == 2 AND isset($configurations['REFERRAL_DISCOUNT_VALUE_'.(int)($id_currency)])) + $discount->value = (float)$configurations['REFERRAL_DISCOUNT_VALUE_'.(int)($id_currency)]; + /* Unknown or value undefined for this currency (configure your module correctly) */ + else + $discount->value = 0; + + $discount->quantity = 1; + $discount->quantity_per_user = 1; + $discount->date_from = date('Y-m-d H:i:s', time()); + $discount->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year + $discount->name = $this->getDiscountPrefix().Tools::passwdGen(6); + $discount->description = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION'); + $discount->id_customer = (int)$id_customer; + $discount->id_currency = (int)$id_currency; + + if ($discount->add()) + { + if ($register != false) + { + if ($register == 'sponsor') + $this->id_discount_sponsor = (int)$discount->id; + elseif ($register == 'sponsored') + $this->id_discount = (int)$discount->id; + return $this->save(); + } + return true; + } + return false; + } + + /** + * Return sponsored friends + * + * @return array Sponsor + */ + static public function getSponsorFriend($id_customer, $restriction = false) + { + if (!(int)($id_customer)) + return array(); + + $query = ' + SELECT s.* + FROM `'._DB_PREFIX_.'referralprogram` s + WHERE s.`id_sponsor` = '.(int)$id_customer; + if ($restriction) + { + if ($restriction == 'pending') + $query.= ' AND s.`id_customer` = 0'; + elseif ($restriction == 'subscribed') + $query.= ' AND s.`id_customer` != 0'; + } + + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); + } + + /** + * Return if a customer is sponsorised + * + * @return boolean + */ + static public function isSponsorised($id_customer, $getId=false) + { + $result = Db::getInstance()->getRow(' + SELECT s.`id_referralprogram` + FROM `'._DB_PREFIX_.'referralprogram` s + WHERE s.`id_customer` = '.(int)$id_customer); + + if (isset($result['id_referralprogram']) AND $getId === true) + return (int)$result['id_referralprogram']; + + return isset($result['id_referralprogram']); + } + + /** + * Return if an email is already register + * + * @return boolean OR int idReferralProgram + */ + static public function isEmailExists($email, $getId = false, $checkCustomer = true) + { + if (empty($email) OR !Validate::isEmail($email)) + die (Tools::displayError('Email invalid.')); + if ($checkCustomer === true AND Customer::customerExists($email)) + return false; + $result = Db::getInstance()->getRow(' + SELECT s.`id_referralprogram` + FROM `'._DB_PREFIX_.'referralprogram` s + WHERE s.`email` = \''.pSQL($email).'\''); + if ($getId) + return (int)$result['id_referralprogram']; + return isset($result['id_referralprogram']); + } +} diff --git a/modules/referralprogram/authentication.tpl b/modules/referralprogram/authentication.tpl new file mode 100644 index 000000000..8dff321ad --- /dev/null +++ b/modules/referralprogram/authentication.tpl @@ -0,0 +1,35 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + \ No newline at end of file diff --git a/modules/referralprogram/config.xml b/modules/referralprogram/config.xml new file mode 100755 index 000000000..a7cf4f79f --- /dev/null +++ b/modules/referralprogram/config.xml @@ -0,0 +1,13 @@ + + + referralprogram + Customer referral program + 1.5 + Integrate a referral program system into your shop. + PrestaShop + advertising_marketing + All sponsors and friends will be deleted. Are you sure you want to uninstall this module? + 1 + 1 + + \ No newline at end of file diff --git a/modules/referralprogram/de.php b/modules/referralprogram/de.php new file mode 100644 index 000000000..a28618173 --- /dev/null +++ b/modules/referralprogram/de.php @@ -0,0 +1,110 @@ +authentication_6b31baf25848e7a6563ecc3946626c80'] = 'Referral Programm'; +$_MODULE['<{referralprogram}prestashop>authentication_8fdb2298a0db461ac64e71192a562ca1'] = 'E-Mail-Adresse Ihres Sponsors'; +$_MODULE['<{referralprogram}prestashop>my-account_6b31baf25848e7a6563ecc3946626c80'] = 'Referral Programm'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_6a1fc5f99c944639b4005366d393a1ee'] = 'Danke für Ihre Bestellung, Ihr Sponsor'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_eb8c6d2e305207c8fbc14a2ebb2e42fc'] = 'verdient einen Gutschein im Wert von'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_cda09d90a2d64cf06ae6516cc20ae468'] = 'wenn diese Bestellung bestätigt ist.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d3d2e617335f08df83599665eef8a418'] = 'Schließen'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7a81aa9275331bb0f5e6adb5e8650a03'] = 'oder Esc-Taste'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mein Konto'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6540b502e953f4c05abeb8f234cd50bf'] = 'Referral Program'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b31baf25848e7a6563ecc3946626c80'] = 'Referral Programm'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dbc65cd60abde51277c2881ce915a225'] = 'Sie müssen sich den Bedingungen des Referral-Programm zustimmen!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_83fc792f687bc45d75ac35c84c721a26'] = 'Mindestens eine E-Mail-Adresse ist ungültig!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1019072b9e450c8652590cda2db45e49'] = 'Mindestens ein Vorname oder Nachname ist ungültig!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ff2d2e45b90b4426c3bb14bd56b95a2d'] = 'Jemand mit dieser E-Mail-Adresse ist bereits gesponsert worden!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3f8a4c7f93945fea0d951fa402ee4272'] = 'Bitte kreuzen Sie mindestens ein Kontrollkästchen an'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dcc99d8715486f570db3ec5ee469a828'] = 'Kann keine Freunde zur Datenbank hinzufügen '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_f6cb78f0afcf7c3a06048a7a5855d6a1'] = 'Es wurden E-Mails an Ihre Freunde gesendet!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_79cd362fc64832faa0a2079f1142aa12'] = 'Eine E-Mail wurde an Ihren Freund geschickt!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2b90ca4a7b1c83e0a3bb65899725cd65'] = 'Erinnerungs-E-Mails wurden an Ihre Freunde verschickt!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_819e52b3c6ca4db131dcfea19188a0c3'] = 'Eine Erinnerungs-E-Mail wurde an Ihren Freund verschickt!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_46ee2fe8845962d24bf5178a26e109f3'] = 'Meine Freunde sponsern '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_c56567bc42584de1a7ac430039b3a87e'] = 'Anhängige Freunde'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_58c7f2542ab2e2c3e4e39e851ea0f225'] = 'Freunde, die ich gesponsert habe'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_00c2fab6945aadad3e822d8f38e18ce7'] = 'Einen Rabatt erhalten von'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2dd74a0c7eda49de19eeaed3e1988e8f'] = 'für Sie und Ihre Freunde durch die Empfehlung dieser Webseite.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3ae82bfa996855cdf841dd9e15a7e3'] = 'Es ist schnell und einfach. Nur denVornamen, Nachnamen un d die E-Mail-Adresse (n) Ihres (r) Freunds (e) in die Felder unten eintragen.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9cee6c57b3003b3068177fa913f56468'] = 'Wenn einer von ihnen mindestens'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_12c500ed0b7879105fb46af0f246be87'] = 'Bestellungen'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_70a17ffa722a3985b86d30b034ad06d7'] = 'Bestellung'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_08b002301ef588d9cb9d7b009df2d1e1'] = 'vornimmt, wird er oder sie'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ae01c01c004a8c391d1b9ecd6949f9f8'] = 'einen Gutschein erhalten und Sie erhalten Ihren eigenen Gutschein im Wert von'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3f5eff9c40ee315d452392bed5309b'] = 'Nachname'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_20db0bfeecd8fe60533206a2b5e9891a'] = 'Vorname'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1e884e3078d9978e216a027ecd57fb34'] = 'E-Mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9386de858384e7f790a28beecdb986dd'] = 'Wichtig: Die E-Mail-Adressen Ihrer Freunde werden nur im Referral-Programm verwendet. Sie werden niemals für andere Zwecke verwendet werden.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_605eef3cad421619ce034ab48415190f'] = 'Ich stimme den Nutzungsbedingungen zu und halte sie bedingungslos ein.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b719c160f9b08dad4760bcc4b52ed48'] = 'Geschäftsbedingungen des Referral-Programms'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_868ca5fe643791c23b47c75fb833c9b8'] = 'Lesen Sie die Nutzungsbedingungen.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_31fde7b05ac8952dacf4af8a704074ec'] = 'Vorschau'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8e8dc296c6bf3876468aa028974bfebe'] = 'Einladungs-E-Mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_a86073a0c3b0bebf11bd807caf8e505a'] = 'Standard-E-Mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7532696b81dfc0b94a37e876677152c5'] = 'die Ihrem (n) Freund (en) gesendet wird.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ad3d06d03d94223fa652babc913de686'] = 'Bestätigen'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_59352cd5314a67c0fb10c964831920f3'] = 'Um Sponsor zu werden, müssen Sie eine mindestens ausfüllen'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ec7342814444c667ab93181b30b28e38'] = 'Diese Freunde haben noch nichts auf dieser Website bestellt, seit Sie sie sponsern, aber Sie können es erneut versuchen! Dazu markieren Sie die Kontrollkästchen des (r) Freundes (e) an, die Sie erinnern möchten, dann klicken Sie auf die Schaltfläche \"Meine(n) Freund (e) erinnern\"'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3e717a04ff77cd5fa068d8ad9d3facc8'] = 'Letzte Einladung'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9c9d4ed270f02c72124702edb192ff19'] = 'Meine(n) Freund (e) erinnern'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8b9f390369560635a2ba5ba271d953df'] = 'Sie haben keine Freunde gesponsert.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_193f3d8bbaceba40499cab1a3545e9e8'] = 'Hier sind gesponserte Freunde, die Ihre Einladung angenommen haben:'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3c648ba41cfb45f13b083a9cbbacdfdf'] = 'Anmeldedatum'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d4e5c2bc4c3cf67d2b59b263a707cb6'] = 'Keine gesponserten Freunde haben bisher Ihre Einladung angenommen.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_0b3db27bc15f682e92ff250ebb167d4b'] = 'Zurück zu Ihrem Konto'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{referralprogram}prestashop>referralprogram-rules_01705c0177ebf5fbcbf4e882bc454405'] = 'Regeln des Referral Programms'; +$_MODULE['<{referralprogram}prestashop>referralprogram_40604a195d001353d697b0fd26f5d8fe'] = 'Alle Sponsoren und Freunde werden gelöscht. Wollen Sie dieses Modul wirklich deinstallieren?'; +$_MODULE['<{referralprogram}prestashop>referralprogram_83090230d3c11aa76851030eba008a71'] = 'Kunden Referral-Programm'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46a3a666d8823b972af8018a5242a3ac'] = 'Integrieren Sie ein Referral-Programm-System in Ihrem Shop.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_d59ce2e96c0c2362a0a4269e0d874e32'] = 'Sie müssen einen Betrag für Referral-Programm Gutscheine angeben'; +$_MODULE['<{referralprogram}prestashop>referralprogram_284033830e0eaf55340844305bf34fdd'] = 'Referral-Belohnung'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3c5db6c207f700f4f209b43bed966e96'] = 'Kann diese Datei nicht löschen:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6c58031e7824c3cd6febc2f2107b0652'] = 'Konfiguration aktualisiert.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_167579019fe14b4efed431a82985d9ad'] = 'Bestellmenge ist erforderlich / ungültig.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ceb0ce9b627fb9a962543f3271da29b1'] = 'Rabatt-Wert ist ungültig.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c96c84a1a64878d4d742daf52e359e36'] = 'Rabatt-Wert für die Währung Nr.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_4218c2cb615fbc2870f6b1e8d283ab8d'] = 'ist leer.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_bb7476567f5e12e60b01436dad77a533'] = 'ist ungültig.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_addae886b20a06e2954461706c90cd7d'] = 'Rabatt-Typ ist erforderlich / ungültig.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ac3357de2dec8d74d89dd378962ec621'] = 'Anzahl der Freunde ist erforderlich / ungültig.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d31dd445991f35b1ee6491eec7ac71c'] = 'Kann die XML-Datei nicht schreiben.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_96191c1f54bb6311624210333ef797eb'] = 'Kann die XML-Datei nicht schließen.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_21cc1fccae3b04bb8cd2719cc5269e1e'] = 'Kann die XML-Datei nicht aktualisieren. Bitte überprüfen Sie die Schreibrechte der XML-Datei.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5be920293db3e38c81330fd0798336b1'] = 'Ungültiges html Feld, Javascript ist verboten'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7ca3288a38b048b0df25394ccc22ad46'] = 'Minimale Bestellungsanzahl eines gesponserten Freund, damit dieser einen Gutschein erhält:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_624f983eb0713e10faf35ff3889e8d68'] = 'Anzahl der Freunde in dem Einladungsformular des Referral-Programms (Kundenkonto, Referral-Programm-Abschnitt):'; +$_MODULE['<{referralprogram}prestashop>referralprogram_9ad4f790c8bb9be21a2fa388c7730353'] = 'Gutschein-Typ:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46da7ad7d01e209241016d308f9fafce'] = 'Gutschein mit einem Prozentsatz'; +$_MODULE['<{referralprogram}prestashop>referralprogram_97839379a0f447599405341b852e2e24'] = 'Gutschein mit einem festen Betrag (nach Währung)'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d5a011fdba2979f8d0ffd30b9f5c6ba'] = 'Prozentsatz:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_386c339d37e737a436499d423a77df0c'] = 'Währung'; +$_MODULE['<{referralprogram}prestashop>referralprogram_edf7f0a17b8a8f1732f12856fcbc8a6b'] = 'Gutscheinbetrag'; +$_MODULE['<{referralprogram}prestashop>referralprogram_8465d83b5c1b569299af284c14d957bb'] = 'Gutscheinbeschreibung:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; +$_MODULE['<{referralprogram}prestashop>referralprogram_562ad64cf21ac2da656134355115133d'] = 'Ihr Text ist leer.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_01705c0177ebf5fbcbf4e882bc454405'] = 'Referral Programm Regeln'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c5afb9c76a7880978cba32872d01f068'] = 'Aktualisieren Sie den Text'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6b31baf25848e7a6563ecc3946626c80'] = 'Referral Programm'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7790d51a3d62c85aae65464dee12ee8b'] = 'Kundensponsor:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f964f762284ede747ed9f6428a5469b8'] = 'Niemand hat diesen Kunden gesponsert.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_53d0d7aba39ee971f7f179e6e1092708'] = 'gesponserte Kunden:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_58dc82d3e2e17ced0225064a9b496ee9'] = 'gesponserter Kunde:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{referralprogram}prestashop>referralprogram_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram_22ffd0379431f3b615eb8292f6c31d12'] = 'Anmeldedatum'; +$_MODULE['<{referralprogram}prestashop>referralprogram_325c8bbd07033a39d25b5c4457f79861'] = 'Kunden, die von diesem Freund gesponsert wurden'; +$_MODULE['<{referralprogram}prestashop>referralprogram_fc6e0920b914b164802d44220e6163f3'] = 'abgesandte Bestellungen'; +$_MODULE['<{referralprogram}prestashop>referralprogram_970ad4e4787cc75cd63dbf8d5c757513'] = 'Kunden-Konto erstellt'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5b541747d46b39c37f0e100ddfe44472'] = 'hat noch keine Freunde gesponsert.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6b31baf25848e7a6563ecc3946626c80'] = 'Referral Programm'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_50b12ad08d38a2b00a790304bbe851be'] = 'Sie haben einen Gutschein verdient im Wert von'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6c8352dbdb1fa1433bd5974c603dced4'] = 'Dank Ihrem Sponsor!'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_764a957fffea7861310082f57445c83a'] = 'Geben Sie den Gutscheinnamen ein'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_5c24e8005181f1a32b1df54bfe112525'] = 'um den Rabatt für diese Bestellung zu erhalten.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_106527986549f3ec8da1ae5a7abde467'] = 'Ihr Referral-Programm sehen.'; diff --git a/modules/referralprogram/en.php b/modules/referralprogram/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/referralprogram/en.php @@ -0,0 +1,4 @@ +authentication_6b31baf25848e7a6563ecc3946626c80'] = 'Programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>authentication_8fdb2298a0db461ac64e71192a562ca1'] = 'Email de su patrocinador'; +$_MODULE['<{referralprogram}prestashop>my-account_6b31baf25848e7a6563ecc3946626c80'] = 'Programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_6a1fc5f99c944639b4005366d393a1ee'] = 'Gracias a su pedido, su patrocinador'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_eb8c6d2e305207c8fbc14a2ebb2e42fc'] = 'ganará un vale por valor de'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_cda09d90a2d64cf06ae6516cc20ae468'] = 'cuando esta compra se confirme.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d3d2e617335f08df83599665eef8a418'] = 'Cerrar'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7a81aa9275331bb0f5e6adb5e8650a03'] = 'o tecla Esc'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6540b502e953f4c05abeb8f234cd50bf'] = 'Programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b31baf25848e7a6563ecc3946626c80'] = 'Patrocinio'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dbc65cd60abde51277c2881ce915a225'] = '¡Necesita aceptar las condiciones del programa de patrocinio!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_83fc792f687bc45d75ac35c84c721a26'] = '¡Al menos una dirección de correo no es válida!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1019072b9e450c8652590cda2db45e49'] = '¡El nombre o los apellidos no son válidos!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ff2d2e45b90b4426c3bb14bd56b95a2d'] = '¡Alguien con este e-mail ya se ha registrado!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3f8a4c7f93945fea0d951fa402ee4272'] = 'Por favor, marque al menos una casilla'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dcc99d8715486f570db3ec5ee469a828'] = 'No puede añadir amigos a la base de datos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_f6cb78f0afcf7c3a06048a7a5855d6a1'] = 'Emails enviados a sus amigos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_79cd362fc64832faa0a2079f1142aa12'] = 'Se ha enviado un email a su amigo'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2b90ca4a7b1c83e0a3bb65899725cd65'] = 'Se han enviado emails recordatorios a sus amigos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_819e52b3c6ca4db131dcfea19188a0c3'] = 'Se ha enviado un email recordatorio a su amigo'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_46ee2fe8845962d24bf5178a26e109f3'] = 'Patrocinar a mis amigos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_c56567bc42584de1a7ac430039b3a87e'] = 'En espera de amigos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_58c7f2542ab2e2c3e4e39e851ea0f225'] = 'Amigos que he patrocinado'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_00c2fab6945aadad3e822d8f38e18ce7'] = 'Consiga un descuento de'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2dd74a0c7eda49de19eeaed3e1988e8f'] = 'para usted y sus amigos por recomendar este sitio Web.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3ae82bfa996855cdf841dd9e15a7e3'] = 'Es rápido y sencillo. Simplemente rellene el nombre, apellidos, email de su amigo o amigos en los siguientes campos.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9cee6c57b3003b3068177fa913f56468'] = 'Cuando uno de ellos haga por lo menos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_12c500ed0b7879105fb46af0f246be87'] = 'pedidos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_70a17ffa722a3985b86d30b034ad06d7'] = 'un pedido'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_08b002301ef588d9cb9d7b009df2d1e1'] = 'recibirá un vale de descuanto de '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ae01c01c004a8c391d1b9ecd6949f9f8'] = 'y usted también'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3f5eff9c40ee315d452392bed5309b'] = 'Apellidos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nombre '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1e884e3078d9978e216a027ecd57fb34'] = 'Email'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9386de858384e7f790a28beecdb986dd'] = 'Importante: las direcciones de correo electrónico de sus amigos sólo serán utilizadas en el programa de patrocinio. Nunca se utilizarán para otros fines.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_605eef3cad421619ce034ab48415190f'] = 'He leido las condiciones de uso y las acepto sin reservas.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b719c160f9b08dad4760bcc4b52ed48'] = 'Condiciones del programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_868ca5fe643791c23b47c75fb833c9b8'] = 'Leer condiciones.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_31fde7b05ac8952dacf4af8a704074ec'] = 'Vista previa'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8e8dc296c6bf3876468aa028974bfebe'] = 'Invitación por email'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_a86073a0c3b0bebf11bd807caf8e505a'] = 'Email por defecto '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7532696b81dfc0b94a37e876677152c5'] = 'que se enviará a su amigo o amigos.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ad3d06d03d94223fa652babc913de686'] = 'Validar'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_59352cd5314a67c0fb10c964831920f3'] = 'Para ser un patrocinador, es necesario que usted tenga por lo menos'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ec7342814444c667ab93181b30b28e38'] = '¡Estos amigos aún no han realizado ningún pedido en este sitio web patrocinado, pero usted puede intentarlo nuevamente! Para ello, marque la casilla de verificación de los amigos a los que desea contactar de nuevo. A continuación, haga clic en el botón \\\"contactar a mi(s) amigo (s)\\\"'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3e717a04ff77cd5fa068d8ad9d3facc8'] = 'Última invitación'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9c9d4ed270f02c72124702edb192ff19'] = 'Contactar a mi(s) amigo (s)'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8b9f390369560635a2ba5ba271d953df'] = 'Usted no ha patrocinado a ningún amigo.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_193f3d8bbaceba40499cab1a3545e9e8'] = ' Aquí­ están los amigos patrocinados que han aceptado su invitación:'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3c648ba41cfb45f13b083a9cbbacdfdf'] = 'Fecha de inscripción'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d4e5c2bc4c3cf67d2b59b263a707cb6'] = 'Aún no hay amigos Patrocinados que hayan aceptado su invitación.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_0b3db27bc15f682e92ff250ebb167d4b'] = 'Volver a su cuenta'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{referralprogram}prestashop>referralprogram-rules_01705c0177ebf5fbcbf4e882bc454405'] = 'Condiciones del programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>referralprogram_40604a195d001353d697b0fd26f5d8fe'] = 'Todos los datos relativos al programa de apadrinamiento. ¿Está seguro de que desea desinstalarlo?'; +$_MODULE['<{referralprogram}prestashop>referralprogram_83090230d3c11aa76851030eba008a71'] = 'Programa de apadrinamiento de clientes'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46a3a666d8823b972af8018a5242a3ac'] = 'Integrar un programa de apadrinamiento en su tienda'; +$_MODULE['<{referralprogram}prestashop>referralprogram_d59ce2e96c0c2362a0a4269e0d874e32'] = 'Debe especificar un importe para los vales descuento de apadrinamiento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_284033830e0eaf55340844305bf34fdd'] = 'Recompensa apadrinamiento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3c5db6c207f700f4f209b43bed966e96'] = 'No se puede eliminar este archivo:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6c58031e7824c3cd6febc2f2107b0652'] = 'Configuración actualizada.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_167579019fe14b4efed431a82985d9ad'] = 'Cantidad de pedido se necesita o no es válida.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ceb0ce9b627fb9a962543f3271da29b1'] = 'El valor del descuento no es válido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c96c84a1a64878d4d742daf52e359e36'] = 'El valor del descuento para la moneda #'; +$_MODULE['<{referralprogram}prestashop>referralprogram_4218c2cb615fbc2870f6b1e8d283ab8d'] = 'está vacío.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_bb7476567f5e12e60b01436dad77a533'] = 'no es válido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_addae886b20a06e2954461706c90cd7d'] = 'El tipo de descuento se necesita o no es válido'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ac3357de2dec8d74d89dd378962ec621'] = 'el número de amigos se necesita o no es válido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d31dd445991f35b1ee6491eec7ac71c'] = 'No se puede escribir en el archivo XML.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_96191c1f54bb6311624210333ef797eb'] = 'No se puede cerrar el archivo xml.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_21cc1fccae3b04bb8cd2719cc5269e1e'] = 'No se puede actualizar el archivo xml. Por favor, compruebe el archivo XML de los permisos de escritura.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5be920293db3e38c81330fd0798336b1'] = 'Campo Html no válido, javascript está prohibido'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f4f70727dc34561dfde1a3c529b6205c'] = 'Ajustes'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7ca3288a38b048b0df25394ccc22ad46'] = 'Número mínimo de pedidos que un amigo debe hacer para recibir un vale descuento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_624f983eb0713e10faf35ff3889e8d68'] = 'Número de amigos en el formulario de invitación por apadrinamiento ( cuenta cliente, apartado apadrinamiento):'; +$_MODULE['<{referralprogram}prestashop>referralprogram_9ad4f790c8bb9be21a2fa388c7730353'] = 'Tipo vale:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46da7ad7d01e209241016d308f9fafce'] = 'Vale descuento con un porcentaje'; +$_MODULE['<{referralprogram}prestashop>referralprogram_97839379a0f447599405341b852e2e24'] = 'Vale descuento con un importe (por divisa)'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d5a011fdba2979f8d0ffd30b9f5c6ba'] = 'Porcentaje:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_386c339d37e737a436499d423a77df0c'] = 'Divisa'; +$_MODULE['<{referralprogram}prestashop>referralprogram_edf7f0a17b8a8f1732f12856fcbc8a6b'] = 'Importe del vale descuento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_8465d83b5c1b569299af284c14d957bb'] = 'Descripción vale:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar ajustes'; +$_MODULE['<{referralprogram}prestashop>referralprogram_562ad64cf21ac2da656134355115133d'] = 'Su texto está vacio.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_01705c0177ebf5fbcbf4e882bc454405'] = 'Reglas programa apadrinamiento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c5afb9c76a7880978cba32872d01f068'] = 'Actualizar el texto'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6b31baf25848e7a6563ecc3946626c80'] = 'Programa de apadrinamiento'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7790d51a3d62c85aae65464dee12ee8b'] = 'Padrino del cliente:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f964f762284ede747ed9f6428a5469b8'] = 'Nadie ha apadrinado a este cliente.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_53d0d7aba39ee971f7f179e6e1092708'] = 'clientes apadrinados:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_58dc82d3e2e17ced0225064a9b496ee9'] = 'cliente apadrinado:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{referralprogram}prestashop>referralprogram_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{referralprogram}prestashop>referralprogram_22ffd0379431f3b615eb8292f6c31d12'] = 'Fecha de Registro'; +$_MODULE['<{referralprogram}prestashop>referralprogram_325c8bbd07033a39d25b5c4457f79861'] = 'Clientes apadrinados por este amigo'; +$_MODULE['<{referralprogram}prestashop>referralprogram_fc6e0920b914b164802d44220e6163f3'] = 'Pedidos realizados'; +$_MODULE['<{referralprogram}prestashop>referralprogram_970ad4e4787cc75cd63dbf8d5c757513'] = 'Cuenta cliente creada'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5b541747d46b39c37f0e100ddfe44472'] = 'no ha apadrinado a ningún amigo todavía.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6b31baf25848e7a6563ecc3946626c80'] = 'Programa de patrocinio'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_50b12ad08d38a2b00a790304bbe851be'] = 'Usted se ha ganado un vale por un valor de'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6c8352dbdb1fa1433bd5974c603dced4'] = 'gracias a su patrocinador'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_764a957fffea7861310082f57445c83a'] = 'Introduzca nombre de vale'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_5c24e8005181f1a32b1df54bfe112525'] = 'para recibir la reducción en este pedido.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_106527986549f3ec8da1ae5a7abde467'] = 'Ver su programa de patrocinio.'; diff --git a/modules/referralprogram/fr.php b/modules/referralprogram/fr.php new file mode 100644 index 000000000..e3aa17663 --- /dev/null +++ b/modules/referralprogram/fr.php @@ -0,0 +1,110 @@ +authentication_6b31baf25848e7a6563ecc3946626c80'] = 'Programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>authentication_8fdb2298a0db461ac64e71192a562ca1'] = 'Adresse mail de votre parrain'; +$_MODULE['<{referralprogram}prestashop>my-account_6b31baf25848e7a6563ecc3946626c80'] = 'Parrainage'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_6a1fc5f99c944639b4005366d393a1ee'] = 'Grâce à votre commande, votre parrain'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_eb8c6d2e305207c8fbc14a2ebb2e42fc'] = 'gagnera un bon de réduction d\'une valeur de'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_cda09d90a2d64cf06ae6516cc20ae468'] = 'quand cette commande sera confirmée.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d3d2e617335f08df83599665eef8a418'] = 'Fermer'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7a81aa9275331bb0f5e6adb5e8650a03'] = 'ou Echap.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6540b502e953f4c05abeb8f234cd50bf'] = 'Parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b31baf25848e7a6563ecc3946626c80'] = 'Parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dbc65cd60abde51277c2881ce915a225'] = 'Vous devez accepter les conditions du programme !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_83fc792f687bc45d75ac35c84c721a26'] = 'Une ou plusieurs adresses e-mail sont incorrectes !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1019072b9e450c8652590cda2db45e49'] = 'Un ou plusieurs nom ou prénom sont incorrects !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ff2d2e45b90b4426c3bb14bd56b95a2d'] = 'Quelqu\'un avec cette adresse e-mail est déjà enregistré !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3f8a4c7f93945fea0d951fa402ee4272'] = 'Veuillez cocher au moins une case'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dcc99d8715486f570db3ec5ee469a828'] = 'Impossible d\'ajouter des amis à la base de données'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_f6cb78f0afcf7c3a06048a7a5855d6a1'] = 'E-mails envoyés à vos filleuls !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_79cd362fc64832faa0a2079f1142aa12'] = 'Un e-mail a été envoyé à votre filleul !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2b90ca4a7b1c83e0a3bb65899725cd65'] = 'Des e-mails de rappel ont été envoyés à vos filleuls !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_819e52b3c6ca4db131dcfea19188a0c3'] = 'Un e-mail de rappel a été envoyé à votre filleul !'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_46ee2fe8845962d24bf5178a26e109f3'] = 'Parrainer mes amis'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_c56567bc42584de1a7ac430039b3a87e'] = 'Filleuls en attente'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_58c7f2542ab2e2c3e4e39e851ea0f225'] = 'Mes filleuls'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_00c2fab6945aadad3e822d8f38e18ce7'] = 'Obtenir un bon de réduction de'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2dd74a0c7eda49de19eeaed3e1988e8f'] = 'pour vous et vos amis en recommandant notre boutique.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3ae82bfa996855cdf841dd9e15a7e3'] = 'C\'est rapide et facile. Il suffit de remplir les noms, prénoms et adresses e-mails de vos amis dans les champs ci-dessous.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9cee6c57b3003b3068177fa913f56468'] = 'Quand l\'un d\'entre eux passera au moins'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_12c500ed0b7879105fb46af0f246be87'] = 'commandes'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_70a17ffa722a3985b86d30b034ad06d7'] = 'commande'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_08b002301ef588d9cb9d7b009df2d1e1'] = 'il/elle recevra un bon de réduction de'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ae01c01c004a8c391d1b9ecd6949f9f8'] = 'et vous de même'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3f5eff9c40ee315d452392bed5309b'] = 'Nom'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_20db0bfeecd8fe60533206a2b5e9891a'] = 'Prénom'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9386de858384e7f790a28beecdb986dd'] = 'Important : Les e-mails de vos amis ne seront jamais utilisés à d\'autres fins que celles de notre programme.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_605eef3cad421619ce034ab48415190f'] = 'J\'ai lu les conditions d\'utilisation et j\'y adhère sans réserves.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b719c160f9b08dad4760bcc4b52ed48'] = 'Conditions du programme'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_868ca5fe643791c23b47c75fb833c9b8'] = 'Lisez les conditions.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_31fde7b05ac8952dacf4af8a704074ec'] = 'Visualisez'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8e8dc296c6bf3876468aa028974bfebe'] = 'E-mail d\'invitation'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_a86073a0c3b0bebf11bd807caf8e505a'] = 'l\'email par défaut'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7532696b81dfc0b94a37e876677152c5'] = 'qui sera envoyé à vos filleuls.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ad3d06d03d94223fa652babc913de686'] = 'Validez'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_59352cd5314a67c0fb10c964831920f3'] = 'Pour devenir un parrain, vous devez finaliser au moins'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ec7342814444c667ab93181b30b28e38'] = 'Ces filleuls n\'ont pas encore effectué d\'achat, mais vous pouvez les relancer ! Pour ce faire, vous devez cocher les cases des filleuls que vous voulez relancer, puis cliquer sur le bouton \"Relancer mes amis\"'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3e717a04ff77cd5fa068d8ad9d3facc8'] = 'Dernière invitation'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9c9d4ed270f02c72124702edb192ff19'] = 'Relancer mes amis'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8b9f390369560635a2ba5ba271d953df'] = 'Vous n\'avez pas encore parrainé d\'amis.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_193f3d8bbaceba40499cab1a3545e9e8'] = 'Ici sont affichés les filleuls qui ont accepté votre invitation :'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3c648ba41cfb45f13b083a9cbbacdfdf'] = 'Date d\'inscription'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d4e5c2bc4c3cf67d2b59b263a707cb6'] = 'Aucun filleul n\'a encore accepté votre invitation.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{referralprogram}prestashop>referralprogram-rules_01705c0177ebf5fbcbf4e882bc454405'] = 'Conditions du programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_40604a195d001353d697b0fd26f5d8fe'] = 'Tous les informations relatives aux parrains et filleuls'; +$_MODULE['<{referralprogram}prestashop>referralprogram_83090230d3c11aa76851030eba008a71'] = 'Programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46a3a666d8823b972af8018a5242a3ac'] = 'Intègre un programme de parrainage à votre boutique'; +$_MODULE['<{referralprogram}prestashop>referralprogram_d59ce2e96c0c2362a0a4269e0d874e32'] = 'Vous devez spécifier un montant pour les bons de réduction de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_284033830e0eaf55340844305bf34fdd'] = 'Récompense parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3c5db6c207f700f4f209b43bed966e96'] = 'Suppression de ce fichier impossible :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6c58031e7824c3cd6febc2f2107b0652'] = 'Mise a jour effectuée.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_167579019fe14b4efed431a82985d9ad'] = 'Le nombre de commande est invalide.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ceb0ce9b627fb9a962543f3271da29b1'] = 'La valeur de réduction est invalide'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c96c84a1a64878d4d742daf52e359e36'] = 'Valeur de la réduction pour'; +$_MODULE['<{referralprogram}prestashop>referralprogram_4218c2cb615fbc2870f6b1e8d283ab8d'] = 'est vide.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_bb7476567f5e12e60b01436dad77a533'] = 'est invalide.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_addae886b20a06e2954461706c90cd7d'] = 'Le type de réduction est invalide.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ac3357de2dec8d74d89dd378962ec621'] = 'Le nombre d\'amis est incorrect.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d31dd445991f35b1ee6491eec7ac71c'] = 'Impossible d\'écrire dans le fichier XML.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_96191c1f54bb6311624210333ef797eb'] = 'Impossible de fermer le fichier XML.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_21cc1fccae3b04bb8cd2719cc5269e1e'] = 'Impossible de mettre à jour le fichier XML. Veuillez vérifier les droits d\'écriture sur le fichier XML.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5be920293db3e38c81330fd0798336b1'] = 'Champ HTML invalide, le Javascript y est interdit.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7ca3288a38b048b0df25394ccc22ad46'] = 'Nombre minimum de commandes qu\'un filleul doit passer afin de recevoir son bon de réduction :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_624f983eb0713e10faf35ff3889e8d68'] = 'Nombre de filleuls dans le formulaire d\'invitation pour parrainage (compte client, section parrainage) :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_9ad4f790c8bb9be21a2fa388c7730353'] = 'Type de bon :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46da7ad7d01e209241016d308f9fafce'] = 'Bon de réduction avec un pourcentage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_97839379a0f447599405341b852e2e24'] = 'Bon de réduction avec un montant (par devise)'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d5a011fdba2979f8d0ffd30b9f5c6ba'] = 'Pourcentage :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_386c339d37e737a436499d423a77df0c'] = 'Devise'; +$_MODULE['<{referralprogram}prestashop>referralprogram_edf7f0a17b8a8f1732f12856fcbc8a6b'] = 'Montant du bon de réduction'; +$_MODULE['<{referralprogram}prestashop>referralprogram_8465d83b5c1b569299af284c14d957bb'] = 'Description du bon :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les paramètres'; +$_MODULE['<{referralprogram}prestashop>referralprogram_562ad64cf21ac2da656134355115133d'] = 'Vous devez spécifier un texte.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_01705c0177ebf5fbcbf4e882bc454405'] = 'Conditions du programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c5afb9c76a7880978cba32872d01f068'] = 'Mise à jour du texte'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6b31baf25848e7a6563ecc3946626c80'] = 'Programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7790d51a3d62c85aae65464dee12ee8b'] = 'Parrain du client :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f964f762284ede747ed9f6428a5469b8'] = 'Ce client n\'a aucun parrain.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_53d0d7aba39ee971f7f179e6e1092708'] = 'Filleuls :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_58dc82d3e2e17ced0225064a9b496ee9'] = 'Filleul :'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{referralprogram}prestashop>referralprogram_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram_22ffd0379431f3b615eb8292f6c31d12'] = 'Date d\'enregistrement'; +$_MODULE['<{referralprogram}prestashop>referralprogram_325c8bbd07033a39d25b5c4457f79861'] = 'Clients parrainés par ce filleul'; +$_MODULE['<{referralprogram}prestashop>referralprogram_fc6e0920b914b164802d44220e6163f3'] = 'Nombre de commandes effectuées'; +$_MODULE['<{referralprogram}prestashop>referralprogram_970ad4e4787cc75cd63dbf8d5c757513'] = 'Compte client créé'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5b541747d46b39c37f0e100ddfe44472'] = 'n\'a parrainé aucun filleul pour le moment.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6b31baf25848e7a6563ecc3946626c80'] = 'Programme de parrainage'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_50b12ad08d38a2b00a790304bbe851be'] = 'Vous avez gagné un bon de réduction d\'une valeur de'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6c8352dbdb1fa1433bd5974c603dced4'] = 'grâce à votre parrain !'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_764a957fffea7861310082f57445c83a'] = 'Saisissez le nom du bon'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_5c24e8005181f1a32b1df54bfe112525'] = 'pour profiter de la réduction sur cette commande.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_106527986549f3ec8da1ae5a7abde467'] = 'Voir votre programme de parrainage.'; diff --git a/modules/referralprogram/it.php b/modules/referralprogram/it.php new file mode 100644 index 000000000..417dda0eb --- /dev/null +++ b/modules/referralprogram/it.php @@ -0,0 +1,110 @@ +authentication_6b31baf25848e7a6563ecc3946626c80'] = 'Programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>authentication_8fdb2298a0db461ac64e71192a562ca1'] = 'Indirizzo e-mail della persona che ti ha segnalato'; +$_MODULE['<{referralprogram}prestashop>my-account_6b31baf25848e7a6563ecc3946626c80'] = 'Programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_6a1fc5f99c944639b4005366d393a1ee'] = 'Grazie al tuo ordine, chi ti ha segnalato'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_eb8c6d2e305207c8fbc14a2ebb2e42fc'] = 'guadagnerà un buono del valore di'; +$_MODULE['<{referralprogram}prestashop>order-confirmation_cda09d90a2d64cf06ae6516cc20ae468'] = 'quando l\'ordine sarà confermato.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d3d2e617335f08df83599665eef8a418'] = 'Chiudi'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7a81aa9275331bb0f5e6adb5e8650a03'] = 'o il tasto Esc'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Il mio conto'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6540b502e953f4c05abeb8f234cd50bf'] = 'Programma di Segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b31baf25848e7a6563ecc3946626c80'] = 'Programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dbc65cd60abde51277c2881ce915a225'] = 'È necessario accettare le condizioni del programma di segnalazione!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_83fc792f687bc45d75ac35c84c721a26'] = 'Almeno un indirizzo e-mail non è valido!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1019072b9e450c8652590cda2db45e49'] = 'Almeno un nome o cognome non è valido!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ff2d2e45b90b4426c3bb14bd56b95a2d'] = 'Qualcuno con questo indirizzo e-mail è già stato segnalato!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3f8a4c7f93945fea0d951fa402ee4272'] = 'Spunta almeno una casella '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_dcc99d8715486f570db3ec5ee469a828'] = 'Impossibile aggiungere amici alla banca dati'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_f6cb78f0afcf7c3a06048a7a5855d6a1'] = 'E-mail sono state inviate ai tuoi amici!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_79cd362fc64832faa0a2079f1142aa12'] = 'Una e-mail è stata inviata ad un amico!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2b90ca4a7b1c83e0a3bb65899725cd65'] = 'E-mail di promemoria sono state inviate ai tuoi amici!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_819e52b3c6ca4db131dcfea19188a0c3'] = 'Una mail di promemoria è stata inviata ad un amico!'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_46ee2fe8845962d24bf5178a26e109f3'] = 'Segnala i miei amici'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_c56567bc42584de1a7ac430039b3a87e'] = 'Amici in attesa'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_58c7f2542ab2e2c3e4e39e851ea0f225'] = 'Amici che ho segnalato'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_00c2fab6945aadad3e822d8f38e18ce7'] = 'Ottieni uno sconto di'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_2dd74a0c7eda49de19eeaed3e1988e8f'] = 'per te e i tuoi amici segnalando questo sito web.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3ae82bfa996855cdf841dd9e15a7e3'] = 'È veloce ed è facile. Basta compilare il nome, cognome e indirizzo/i di posta elettronica del tuo amico/amici nei campi sottostanti.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9cee6c57b3003b3068177fa913f56468'] = 'Quando uno di loro fa almeno'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_12c500ed0b7879105fb46af0f246be87'] = 'ordini'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_70a17ffa722a3985b86d30b034ad06d7'] = 'ordine'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_08b002301ef588d9cb9d7b009df2d1e1'] = 'lui o lei riceverà un'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ae01c01c004a8c391d1b9ecd6949f9f8'] = 'buono e riceverai il tuo buono del valore di '; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d3f5eff9c40ee315d452392bed5309b'] = 'Cognome'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_20db0bfeecd8fe60533206a2b5e9891a'] = 'Nome'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9386de858384e7f790a28beecdb986dd'] = 'Importante: gli indirizzi e-mail dei tuoi amici saranno utilizzati solo nel programma di segnalazione. Non saranno mai utilizzati per altri scopi.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_605eef3cad421619ce034ab48415190f'] = 'Accetto i termini del servizio e vi aderisco incondizionatamente.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_6b719c160f9b08dad4760bcc4b52ed48'] = 'Condizioni del programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_868ca5fe643791c23b47c75fb833c9b8'] = 'Leggi le condizioni.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_31fde7b05ac8952dacf4af8a704074ec'] = 'Anteprima'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8e8dc296c6bf3876468aa028974bfebe'] = 'Invito e-mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_a86073a0c3b0bebf11bd807caf8e505a'] = 'l\'e-mail di default'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_7532696b81dfc0b94a37e876677152c5'] = 'che sarà inviata al tuo amico/amici.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ad3d06d03d94223fa652babc913de686'] = 'Convalida'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_59352cd5314a67c0fb10c964831920f3'] = 'Per diventare un segnalatore, è necessario aver completato almeno'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_ec7342814444c667ab93181b30b28e38'] = 'Questi amici non hanno ancora effettuato un ordine su questo sito da quando li hai segnalati, ma puoi provare di nuovo! Per farlo, spunta le caselle degli amici che desideri ricordare, quindi fare clic sul pulsante \"Ricorda il mio amico/i\"'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3e717a04ff77cd5fa068d8ad9d3facc8'] = 'ultimo invito'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_9c9d4ed270f02c72124702edb192ff19'] = 'Ricorda il mio amico/i'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8b9f390369560635a2ba5ba271d953df'] = 'Non hai segnalato nessun amico.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_193f3d8bbaceba40499cab1a3545e9e8'] = 'Ecco gli amici segnalati che hanno accettato il tuo invito:'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_3c648ba41cfb45f13b083a9cbbacdfdf'] = 'Data di iscrizione'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8d4e5c2bc4c3cf67d2b59b263a707cb6'] = 'Nessun amico segnalato ha ancora accettato il tuo invito.'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_0b3db27bc15f682e92ff250ebb167d4b'] = 'Torna al tuo account'; +$_MODULE['<{referralprogram}prestashop>referralprogram-program_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{referralprogram}prestashop>referralprogram-rules_01705c0177ebf5fbcbf4e882bc454405'] = 'Regole programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_40604a195d001353d697b0fd26f5d8fe'] = 'Tutti gli sponsor e gli amici saranno cancellati. Sei sicuro di voler disinstallare questo modulo?'; +$_MODULE['<{referralprogram}prestashop>referralprogram_83090230d3c11aa76851030eba008a71'] = 'Programma segnalazione clienti'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46a3a666d8823b972af8018a5242a3ac'] = 'Integra un sistema di programma di segnalazione nel tuo negozio.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_d59ce2e96c0c2362a0a4269e0d874e32'] = 'Devi specificare una quantità di buoni programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_284033830e0eaf55340844305bf34fdd'] = 'Ricompensa segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3c5db6c207f700f4f209b43bed966e96'] = 'Non è possibile eliminare questo file:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6c58031e7824c3cd6febc2f2107b0652'] = 'Configurazione aggiornata.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_167579019fe14b4efed431a82985d9ad'] = 'la quantità di ordine è necessaria / non valida.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ceb0ce9b627fb9a962543f3271da29b1'] = 'Valore di sconto non valido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c96c84a1a64878d4d742daf52e359e36'] = 'valore di sconto per la valuta n.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_4218c2cb615fbc2870f6b1e8d283ab8d'] = 'è vuoto.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_bb7476567f5e12e60b01436dad77a533'] = 'non è valido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_addae886b20a06e2954461706c90cd7d'] = 'tipo di sconto è richiesto / non valido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ac3357de2dec8d74d89dd378962ec621'] = 'Numero di amici è richiesto / non valido.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d31dd445991f35b1ee6491eec7ac71c'] = 'Impossibile scrivere il file xml.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_96191c1f54bb6311624210333ef797eb'] = 'Impossibile chiudere il file xml.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_21cc1fccae3b04bb8cd2719cc5269e1e'] = 'Impossibile aggiornare il file xml. Si prega di controllare i permessi di scrittura del file XML.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5be920293db3e38c81330fd0798336b1'] = 'Campo html non valido, javascript è vietato'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7ca3288a38b048b0df25394ccc22ad46'] = 'Numero minimo di ordini che un amico segnalato deve eseguire per ottenere il voucher:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_624f983eb0713e10faf35ff3889e8d68'] = 'Numero di amici nel modulo di invito del programma di segnalazione (conto del cliente, sezione programma di segnalazione):'; +$_MODULE['<{referralprogram}prestashop>referralprogram_9ad4f790c8bb9be21a2fa388c7730353'] = 'Tipo di buono:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_46da7ad7d01e209241016d308f9fafce'] = 'Buono che offre una percentuale'; +$_MODULE['<{referralprogram}prestashop>referralprogram_97839379a0f447599405341b852e2e24'] = 'Buono che offre un importo fisso (per valuta)'; +$_MODULE['<{referralprogram}prestashop>referralprogram_3d5a011fdba2979f8d0ffd30b9f5c6ba'] = 'Percentuale:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_386c339d37e737a436499d423a77df0c'] = 'Valuta'; +$_MODULE['<{referralprogram}prestashop>referralprogram_edf7f0a17b8a8f1732f12856fcbc8a6b'] = 'Importo buono'; +$_MODULE['<{referralprogram}prestashop>referralprogram_8465d83b5c1b569299af284c14d957bb'] = 'Descrizione buono:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{referralprogram}prestashop>referralprogram_562ad64cf21ac2da656134355115133d'] = 'Il testo è vuoto.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_01705c0177ebf5fbcbf4e882bc454405'] = 'Regole programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_c5afb9c76a7880978cba32872d01f068'] = 'Aggiorna il testo'; +$_MODULE['<{referralprogram}prestashop>referralprogram_6b31baf25848e7a6563ecc3946626c80'] = 'Programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_7790d51a3d62c85aae65464dee12ee8b'] = 'Sponsor del cliente.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_f964f762284ede747ed9f6428a5469b8'] = 'Nessuno ha segnalato questo cliente.'; +$_MODULE['<{referralprogram}prestashop>referralprogram_53d0d7aba39ee971f7f179e6e1092708'] = 'clienti segnalati:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_58dc82d3e2e17ced0225064a9b496ee9'] = 'cliente segnalato:'; +$_MODULE['<{referralprogram}prestashop>referralprogram_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{referralprogram}prestashop>referralprogram_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{referralprogram}prestashop>referralprogram_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{referralprogram}prestashop>referralprogram_22ffd0379431f3b615eb8292f6c31d12'] = 'Data di registrazione'; +$_MODULE['<{referralprogram}prestashop>referralprogram_325c8bbd07033a39d25b5c4457f79861'] = 'Clienti segnalati da questo amico'; +$_MODULE['<{referralprogram}prestashop>referralprogram_fc6e0920b914b164802d44220e6163f3'] = 'Ordini effettuati'; +$_MODULE['<{referralprogram}prestashop>referralprogram_970ad4e4787cc75cd63dbf8d5c757513'] = 'Account cliente creato'; +$_MODULE['<{referralprogram}prestashop>referralprogram_5b541747d46b39c37f0e100ddfe44472'] = 'non ha ancora segnalato alcun amico.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6b31baf25848e7a6563ecc3946626c80'] = 'Programma di segnalazione'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_50b12ad08d38a2b00a790304bbe851be'] = 'Hai guadagnato un buono del valore'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_6c8352dbdb1fa1433bd5974c603dced4'] = 'grazie al tuo sponsor!'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_764a957fffea7861310082f57445c83a'] = 'Inserisci il nome del buono'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_5c24e8005181f1a32b1df54bfe112525'] = 'per ricevere lo sconto su questo ordine.'; +$_MODULE['<{referralprogram}prestashop>shopping-cart_106527986549f3ec8da1ae5a7abde467'] = 'Visualizza il tuo programma di segnalazione.'; diff --git a/modules/referralprogram/logo.gif b/modules/referralprogram/logo.gif new file mode 100644 index 000000000..85de79228 Binary files /dev/null and b/modules/referralprogram/logo.gif differ diff --git a/modules/referralprogram/mails/de/referralprogram-congratulations.html b/modules/referralprogram/mails/de/referralprogram-congratulations.html new file mode 100644 index 000000000..425f25462 --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-congratulations.html @@ -0,0 +1,46 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Herzlichen Glückwunsch!
         
        Ihr empfohlener Freund, {sponsored_firstname} {sponsored_lastname} hat seine erste Bestellung bei {shop_name} ausgeführt!
         
        Wir freuen uns, Ihnen einen Gutschein über {discount_display} (voucher # {discount_name}) schenken zu dürfen, den Sie bei Ihrer nächsten Bestellung einlösen können.
         
        Mit freundlichen Grüßen,
         
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/de/referralprogram-congratulations.txt b/modules/referralprogram/mails/de/referralprogram-congratulations.txt new file mode 100644 index 000000000..b2be4ab9d --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-congratulations.txt @@ -0,0 +1,8 @@ +Herzlichen Glückwunsch! + +Ihr empfohlener Freund,, {sponsored_firstname} {sponsored_lastname} hat seine erste Bestellung bei {shop_url} ausgeführt ! + +Wir freuen uns, Ihnen einen Gutschein über {discount_display} (voucher # {discount_name}) schenken zu dürfen, den Sie bei Ihrer nächsten Bestellung einlösen können. + + +{shop_url} realisiert durch PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/de/referralprogram-invitation.html b/modules/referralprogram/mails/de/referralprogram-invitation.html new file mode 100644 index 000000000..dc3bef094 --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-invitation.html @@ -0,0 +1,58 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        {firstname_friend} {lastname_friend}, machen Sie mit!
         
        Ihr Freund {firstname} {lastname} möchte Sie empfehlen auf {shop_name}!
         
        Lassen Sie sich empfehlen und erhalten Sie einen Ermäßigungsgutschein {discount}!
         
        Klicken Sie einfach hier, um sich anzumelden!
         
        Vergessen Sie bei der Anmeldung bitte nicht, die E-Mail-Adresse Ihres Freundes anzugeben: {email}.
         
        Mit freundlichen Grüßen,
         
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/de/referralprogram-invitation.txt b/modules/referralprogram/mails/de/referralprogram-invitation.txt new file mode 100644 index 000000000..2ecaf353b --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-invitation.txt @@ -0,0 +1,12 @@ +{firstname_friend} {lastname_friend}, machen Sie mit! + +Ihr Freund {firstname} {lastname} möchte Sie empfehlen auf {shop_url}. + +Lassen Sie sich empfehlen und erhalten Sie einen Ermäßigungsgutschein {discount}! + +Klicken Sie einfach hier, um sich anzumelden! +{shop_url}{link} + +Vergessen Sie bei der Anmeldung bitte nicht, die E-Mail-Adresse Ihres Freundes anzugeben: {email}. + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/de/referralprogram-voucher.html b/modules/referralprogram/mails/de/referralprogram-voucher.html new file mode 100644 index 000000000..90ada2806 --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-voucher.html @@ -0,0 +1,46 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Empfehlungsprogramm
         
        Wir freuen uns, Ihnen mitteilen zu können, dass ein Gutschein auf Ihren Namen in Ihrer Bestellung Nr. {id_order} zur Verfügung steht.
         
        Hier ist der Code für Ihren Gutschein: {voucher_num} über {voucher_amount}.
        Bitte kopieren Sie diesen Code einfach und setzen ihn beim Zahlungsvorgang Ihrer nächsten Bestellung ein.
         
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/de/referralprogram-voucher.txt b/modules/referralprogram/mails/de/referralprogram-voucher.txt new file mode 100644 index 000000000..76cf25adb --- /dev/null +++ b/modules/referralprogram/mails/de/referralprogram-voucher.txt @@ -0,0 +1,12 @@ +Hallo {firstname} {lastname}, + +Wir freuen uns, Ihnen mitteilen zu können, dass ein Gutschein auf Ihren Namen in Ihrer Bestellung Nr. {id_order} zur Verfügung steht. + +Hier ist der Code für Ihren Gutschein: {voucher_num} über {voucher_amount}. +Bitte kopieren Sie diesen Code einfach und setzen ihn beim Zahlungsvorgang Ihrer nächsten Bestellung ein. + +Danke für Ihren Kauf bei {shop_name}. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/en/referralprogram-congratulations.html b/modules/referralprogram/mails/en/referralprogram-congratulations.html new file mode 100644 index 000000000..d1851bfab --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-congratulations.html @@ -0,0 +1,40 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Congratulations!
         
        Your sponsored friend, {sponsored_firstname} {sponsored_lastname} has placed his or her first order on {shop_name}!
         
        + We are pleased to offer you a voucher worth {discount_display} (voucher # {discount_name}) that you can use on your next order. +
         
        Best regards,
         
        + {shop_name} powered by PrestaShop™ +
        + + diff --git a/modules/referralprogram/mails/en/referralprogram-congratulations.txt b/modules/referralprogram/mails/en/referralprogram-congratulations.txt new file mode 100644 index 000000000..5aa39b3c8 --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-congratulations.txt @@ -0,0 +1,9 @@ +Congratulations! + +Your sponsored friend, {sponsored_firstname} {sponsored_lastname} has placed his or her first order on {shop_url} ! + +We are pleased to offer you a voucher worth {discount_display} (voucher # {discount_name}) that you can use on your next order. + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/en/referralprogram-invitation.html b/modules/referralprogram/mails/en/referralprogram-invitation.html new file mode 100644 index 000000000..7f0fe9125 --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-invitation.html @@ -0,0 +1,52 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {firstname_friend} {lastname_friend}, join us!
         
        Your friend {firstname} {lastname} wants to sponsor you on {shop_name}!
         
        + Get sponsored and win a discount voucher of {discount}! +
         
        + It's very easy to sign up. Just click here! +
         
        + When signing up, don't forget to provide the e-mail address of your sponsoring friend: {email}. +
         
        Best regards,
         
        + {shop_name} powered by PrestaShop™ +
        + + diff --git a/modules/referralprogram/mails/en/referralprogram-invitation.txt b/modules/referralprogram/mails/en/referralprogram-invitation.txt new file mode 100644 index 000000000..63b5ce03d --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-invitation.txt @@ -0,0 +1,15 @@ +{firstname_friend} {lastname_friend}, join us! + +Your friend {firstname} {lastname} wants to sponsor you on {shop_url}. + +Get sponsored and win a discount voucher of {discount}! + +It's very easy to sign up. Just click on the following link: + +{shop_url}{link} + +When signing up, don't forget to provide the e-mail address of your sponsoring friend: {email}. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/en/referralprogram-voucher.html b/modules/referralprogram/mails/en/referralprogram-voucher.html new file mode 100644 index 000000000..aa18b52b4 --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-voucher.html @@ -0,0 +1,42 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {firstname} {lastname},
         
        Sponsorship Program
         
        + We inform you about the generation of a voucher to your name regarding your sponsorship. +
         
        + Here is the code of your voucher : {voucher_num}, with an amount of {voucher_amount}.
        + Simply copy/paste this code during the payment process for your next order. +
         
        + {shop_name} powered by PrestaShop™ +
        + diff --git a/modules/referralprogram/mails/en/referralprogram-voucher.txt b/modules/referralprogram/mails/en/referralprogram-voucher.txt new file mode 100644 index 000000000..35f224710 --- /dev/null +++ b/modules/referralprogram/mails/en/referralprogram-voucher.txt @@ -0,0 +1,12 @@ +Hi {firstname} {lastname}, + +We inform you about the generation of a voucher to your name regarding your sponsorship. + +Here is the code of your voucher : {voucher_num}, with an amount of {voucher_amount}. +Simply copy/paste this code during the payment process for your next order. + +Thank you for shopping at {shop_name}. + + + +{shop_url} powered by PrestaShop™ diff --git a/modules/referralprogram/mails/es/referralprogram-congratulations.html b/modules/referralprogram/mails/es/referralprogram-congratulations.html new file mode 100755 index 000000000..2d48fc578 --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-congratulations.html @@ -0,0 +1,47 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        ¡Felicidades!
         
        ¡Su ahijado {sponsored_firstname} {sponsored_lastname} hizo su primera compra en nuestro sitio {shop_name} !
         
        Estamos encantados de ofrecerle un vale {discount_display} (con el código de cupón: {discount_name}), usted puede utilizar durante su próxima compra.
         
        Atentamente,
         
        {shop_name} dirigida por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/referralprogram/mails/es/referralprogram-congratulations.txt b/modules/referralprogram/mails/es/referralprogram-congratulations.txt new file mode 100755 index 000000000..1c1b5d735 --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-congratulations.txt @@ -0,0 +1,9 @@ +¡Felicidades! + +¡Su ahijado {sponsored_firstname} {sponsored_lastname} hizo su primera compra en nuestro sitio {shop_url}! + +Estamos encantados de ofrecerle un vale {discount_display} (con el código de cupón: {discount_name}), usted puede utilizar durante su próxima compra. + + + +{shop_url} dirigida por PrestaShop™ diff --git a/modules/referralprogram/mails/es/referralprogram-invitation.html b/modules/referralprogram/mails/es/referralprogram-invitation.html new file mode 100755 index 000000000..72848b162 --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-invitation.html @@ -0,0 +1,59 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        ¡{firstname_friend} {lastname_friend}, Únete a nosotros!
         
        Su amigo {firstname} {lastname} patrocinado por usted en el sitio {shop_name} !
         
        ¡Conviértete en su ahijado, para ganar un bono de {discount}!
         
        ¡Para nosotros, nada más simple, haga clic aquí!
         
        Recuerde que debe especificar el correo electrónico a tu amigo como patrocinador en el registro: {email}.
         
        Atentamente,
         
        {shop_name} dirigida por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/referralprogram/mails/es/referralprogram-invitation.txt b/modules/referralprogram/mails/es/referralprogram-invitation.txt new file mode 100755 index 000000000..ae33c2e93 --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-invitation.txt @@ -0,0 +1,15 @@ +¡{firstname_friend} {lastname_friend}, Únete a nosotros! + +Su amigo {firstname} {lastname} patrocinado por usted en el sitio {shop_url}. + +¡Conviértete en su ahijado, para ganar un bono de {discount}! + +Para nosotros, nada más simple, vaya a abordar los siguientes: + +{shop_url}{link} + +Recuerde que debe especificar el correo electrónico a tu amigo como patrocinador en el registro: {email}. + + + +{shop_url} dirigida por PrestaShop™ diff --git a/modules/referralprogram/mails/es/referralprogram-voucher.html b/modules/referralprogram/mails/es/referralprogram-voucher.html new file mode 100755 index 000000000..3a71cb29b --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-voucher.html @@ -0,0 +1,47 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {firstname} {lastname},
         
        Programa de Patrocinio
         
        Le informamos de que usted acaba de obtener una orden de compra después de su remisión.
         
        Aquí está su número de comprobante: {voucher_num}, de un total de {voucher_amount} euros.
        Copia y pega este código en la canasta de tu próxima compra antes de ajustar el orden.
         
        {shop_name} dirigida por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/referralprogram/mails/es/referralprogram-voucher.txt b/modules/referralprogram/mails/es/referralprogram-voucher.txt new file mode 100755 index 000000000..7beaaac96 --- /dev/null +++ b/modules/referralprogram/mails/es/referralprogram-voucher.txt @@ -0,0 +1,10 @@ +Hola {firstname} {lastname}, + +Le informamos de que usted acaba de obtener una orden de compra después de su remisión. + +Aquí está su número de comprobante: {voucher_num}, de un total de {voucher_amount} euros. +Copia y pega este código en la canasta de tu próxima compra antes de ajustar el orden. + + + +{shop_url} dirigida por PrestaShop™ diff --git a/modules/referralprogram/mails/fr/referralprogram-congratulations.html b/modules/referralprogram/mails/fr/referralprogram-congratulations.html new file mode 100644 index 000000000..a5f847fcd --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-congratulations.html @@ -0,0 +1,40 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Félicitations !
         
        Votre filleul(e) {sponsored_firstname} {sponsored_lastname} a effectué son premier achat sur {shop_name} !
         
        + Nous avons le plaisir de vous offrir un bon d'achat de {discount_display} (bon de réduction avec le code {discount_name}), que vous pourrez utiliser à l'occasion de votre prochaine commande. +
         
        Bien cordialement,
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/referralprogram/mails/fr/referralprogram-congratulations.txt b/modules/referralprogram/mails/fr/referralprogram-congratulations.txt new file mode 100644 index 000000000..b759f00c7 --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-congratulations.txt @@ -0,0 +1,9 @@ +Félicitations ! + +Votre filleul(e) {sponsored_firstname} {sponsored_lastname} a effectué son premier achat sur notre site {shop_url} ! + +Nous avons le plaisir de vous offrir un bon d'achat de {discount_display} (bon de réduction avec le code : {discount_name}), que vous pourrez utiliser à l'occasion de votre prochaine commande. + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/fr/referralprogram-invitation.html b/modules/referralprogram/mails/fr/referralprogram-invitation.html new file mode 100644 index 000000000..1e36c256b --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-invitation.html @@ -0,0 +1,52 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        {firstname_friend} {lastname_friend}, rejoignez-nous !
         
        Votre ami(e) {firstname} {lastname} vous a parrainé depuis le site {shop_name} !
         
        + Devenez son(sa) filleul(e) afin de gagner un bon d'achat de {discount}! +
         
        + Pour nous rejoindre, rien de plus simple, cliquez-ici ! +
         
        + N'oubliez pas d'y préciser l'email de votre ami en tant que parrain lors de votre inscription : {email}. +
         
        Bien cordialement,
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/referralprogram/mails/fr/referralprogram-invitation.txt b/modules/referralprogram/mails/fr/referralprogram-invitation.txt new file mode 100644 index 000000000..68bd96d0d --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-invitation.txt @@ -0,0 +1,15 @@ +{firstname_friend} {lastname_friend}, rejoignez-nous ! + +Votre ami(e) {firstname} {lastname} vous a parrainé depuis le site {shop_url}. + +Devenez son(sa) filleul(e) afin de gagner un bon d'achat de {discount}! + +Pour nous rejoindre, rien de plus simple, rendez-vous à l'adresse suivante : + +{shop_url}{link} + +N'oubliez pas d'y préciser l'email de votre ami en tant que parrain lors de votre inscription : {email}. + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/fr/referralprogram-voucher.html b/modules/referralprogram/mails/fr/referralprogram-voucher.html new file mode 100644 index 000000000..adb10c960 --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-voucher.html @@ -0,0 +1,43 @@ + + + + + Message de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {firstname} {lastname},
         
        Programme de Parrainage
         
        + Nous vous informons de la génération d'un bon de réduction à votre nom relatif à votre parrainage. +
         
        + Voici le numéro de votre bon de réduction : {voucher_num}, d'un montant total de {voucher_amount}.
        + Copiez-collez ce code dans le panier de votre prochain achat avant de régler la commande. +
         
        + {shop_name} propulsé par PrestaShop™ +
        + + diff --git a/modules/referralprogram/mails/fr/referralprogram-voucher.txt b/modules/referralprogram/mails/fr/referralprogram-voucher.txt new file mode 100644 index 000000000..a4265d569 --- /dev/null +++ b/modules/referralprogram/mails/fr/referralprogram-voucher.txt @@ -0,0 +1,10 @@ +Bonjour {firstname} {lastname}, + +Nous vous informons que vous venez d'obtenir un bon d'achat suite à votre parrainage. + +Voici le numéro de votre bon : {voucher_num}, d'un montant total de {voucher_amount}. +Copiez-collez ce code dans le panier de votre prochain achat avant de régler la commande. + + + +{shop_url} réalisé par PrestaShop™ diff --git a/modules/referralprogram/mails/it/referralprogram-congratulations.html b/modules/referralprogram/mails/it/referralprogram-congratulations.html new file mode 100644 index 000000000..1f1de4dc2 --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-congratulations.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Congratulazioni!
        L'amico che hai presentato, {sponsored_firstname} {sponsored_lastname} ha effettuato il suo primo ordine su {shop_name}!
        Siamo lieti di offrirti un buono sconto del valore di {discount_display} (voucher # {discount_name}) che potrai utilizzare sul tuo prossimo ordine.
        Cordialmente,
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/it/referralprogram-congratulations.txt b/modules/referralprogram/mails/it/referralprogram-congratulations.txt new file mode 100644 index 000000000..a176f8003 --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-congratulations.txt @@ -0,0 +1,9 @@ +Congratulazioni! + +L'amico che hai presentato, {sponsored_firstname} {sponsored_lastname} ha effettuato il suo primo ordine su {shop_url} ! + +Siamo lieti di offrirti un buono sconto del valore di {discount_display} (voucher # {discount_name}) che puoi utilizzare sul tuo prossimo ordine. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/it/referralprogram-invitation.html b/modules/referralprogram/mails/it/referralprogram-invitation.html new file mode 100644 index 000000000..889af2296 --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-invitation.html @@ -0,0 +1,58 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        {firstname_friend} {lastname_friend}, iscriviti!
        Il tuo amico {firstname} {lastname} vuole presentarti su {shop_name}!
        Fatti presentare e vinci un buono sconto di {discount}!
        E' facilissimo iscriversi. Basta cliccare qui!
        Quando ti iscrivi, non dimenticare di indicare la mail dell'amico/a che ti ha presentato: {email}.
        Cordialmente,
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/it/referralprogram-invitation.txt b/modules/referralprogram/mails/it/referralprogram-invitation.txt new file mode 100644 index 000000000..9685bd37d --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-invitation.txt @@ -0,0 +1,15 @@ +{firstname_friend} {lastname_friend}, iscriviti! + +Il tuo amico {firstname} {lastname} vuole presentarti su {shop_url}. + +Fatti presentare e vinci un buono sconto di {discount}! + +E' facilissimo iscriversi. Basta cliccare nel link seguente: + +{shop_url}{link} + +Quando ti iscrivi, non dimenticare di indicare la mail dell'amico/a che ti ha presentato: {email}. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/mails/it/referralprogram-voucher.html b/modules/referralprogram/mails/it/referralprogram-voucher.html new file mode 100644 index 000000000..78f7427de --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-voucher.html @@ -0,0 +1,46 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {firstname} {lastname},
        Programma di presentazione
        Siamo lieti di informarti che è disponibile un buono sconto a tuo nome per il tuo ordine n.{id_order}.
        Ecco il codice del tuo buono: {voucher_num}, per un importo di {voucher_amount}.
        Basta che nel processo di pagamento del tuo prossimo ordine tu copi/incolli questo codice.
        {shop_name} powered by PrestaShop™
        + + \ No newline at end of file diff --git a/modules/referralprogram/mails/it/referralprogram-voucher.txt b/modules/referralprogram/mails/it/referralprogram-voucher.txt new file mode 100644 index 000000000..2049b7615 --- /dev/null +++ b/modules/referralprogram/mails/it/referralprogram-voucher.txt @@ -0,0 +1,12 @@ +Salve {firstname} {lastname}, + +Siamo lieti di informarti che è disponibile un buono sconto a tuo nome per il tuo ordine n.{id_order}. + +Ecco il codice del tuo buono: {voucher_num}, per un importo di {voucher_amount}. +Basta che nel processo di pagamento del tuo prossimo ordine copi/incolli questo codice. + +Grazie di aver acquistato su {shop_name}. + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/referralprogram/my-account.tpl b/modules/referralprogram/my-account.tpl new file mode 100644 index 000000000..2716b8737 --- /dev/null +++ b/modules/referralprogram/my-account.tpl @@ -0,0 +1,29 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
      • {l s='Referral program' mod='referralprogram'}{l s='Referral program' mod='referralprogram'}
      • + \ No newline at end of file diff --git a/modules/referralprogram/order-confirmation.tpl b/modules/referralprogram/order-confirmation.tpl new file mode 100644 index 000000000..eb14c9d79 --- /dev/null +++ b/modules/referralprogram/order-confirmation.tpl @@ -0,0 +1,30 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        + {l s='Thanks to your order, your sponsor' mod='referralprogram'} {$sponsor_firstname} {$sponsor_lastname} {l s='will earn a voucher worth' mod='referralprogram'} {$discount} {l s='off when this order is confirmed.' mod='referralprogram'} +

        +
        \ No newline at end of file diff --git a/modules/referralprogram/preview-email.php b/modules/referralprogram/preview-email.php new file mode 100644 index 000000000..cd889fc10 --- /dev/null +++ b/modules/referralprogram/preview-email.php @@ -0,0 +1,56 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once('../../config/config.inc.php'); +require_once('../../init.php'); +/* +if (!$cookie->isLogged()) + Tools::redirect('../../authentication.php?back=modules/referralprogram/referralprogram-program.php'); +*/ +$shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8'); +$shop_url = Tools::getHttpHost(true, true); +$customer = new Customer((int)($cookie->id_customer)); + +if (!preg_match("#.*\.html$#Ui", Tools::getValue('mail')) OR !preg_match("#.*\.html$#Ui", Tools::getValue('mail'))) + die(Tools::displayError()); + +$file = file_get_contents(dirname(__FILE__).'/mails/'.strval(preg_replace('#\.{2,}#', '.', Tools::getValue('mail')))); + +$file = str_replace('{shop_name}', $shop_name, $file); +$file = str_replace('{shop_url}', $shop_url.__PS_BASE_URI__, $file); +$file = str_replace('{shop_logo}', $shop_url._PS_IMG_.'logo.jpg', $file); +$file = str_replace('{firstname}', $customer->firstname, $file); +$file = str_replace('{lastname}', $customer->lastname, $file); +$file = str_replace('{email}', $customer->email, $file); +$file = str_replace('{firstname_friend}', 'XXXXX', $file); +$file = str_replace('{lastname_friend}', 'xxxxxx', $file); +$file = str_replace('{link}', 'authentication.php?create_account=1', $file); +$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $cookie->id_currency)), (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency)), $file); + +echo $file; + + diff --git a/modules/referralprogram/referralprogram-program.php b/modules/referralprogram/referralprogram-program.php new file mode 100644 index 000000000..69ed417d2 --- /dev/null +++ b/modules/referralprogram/referralprogram-program.php @@ -0,0 +1,187 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* SSL Management */ +$useSSL = true; +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + +if (!$cookie->isLogged()) + Tools::redirect('authentication.php?back=modules/referralprogram/referralprogram-program.php'); + +Tools::addCSS(_PS_CSS_DIR_.'thickbox.css', 'all'); +Tools::addJS(array(_PS_JS_DIR_.'jquery/thickbox-modified.js',_PS_JS_DIR_.'jquery/jquery.idTabs.modified.js')); + +include(dirname(__FILE__).'/../../header.php'); + +// get discount value (ready to display) +$discount = Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($cookie->id_currency))), (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency)); + +$activeTab = 'sponsor'; +$error = false; + +// Mailing invitation to friend sponsor +$invitation_sent = false; +$nbInvitation = 0; +if (Tools::isSubmit('submitSponsorFriends') AND Tools::getValue('friendsEmail') AND sizeof($friendsEmail = Tools::getValue('friendsEmail')) >= 1) +{ + $activeTab = 'sponsor'; + if (!Tools::getValue('conditionsValided')) + $error = 'conditions not valided'; + else + { + $friendsLastName = Tools::getValue('friendsLastName'); + $friendsFirstName = Tools::getValue('friendsFirstName'); + $mails_exists = array(); + foreach ($friendsEmail AS $key => $friendEmail) + { + $friendEmail = strval($friendEmail); + $friendLastName = strval($friendsLastName[$key]); + $friendFirstName = strval($friendsFirstName[$key]); + + if (empty($friendEmail) AND empty($friendLastName) AND empty($friendFirstName)) + continue; + elseif (empty($friendEmail) OR !Validate::isEmail($friendEmail)) + $error = 'email invalid'; + elseif (empty($friendFirstName) OR empty($friendLastName) OR !Validate::isName($friendLastName) OR !Validate::isName($friendFirstName)) + $error = 'name invalid'; + elseif (ReferralProgramModule::isEmailExists($friendEmail) OR Customer::customerExists($friendEmail)) + { + $error = 'email exists'; + $mails_exists[] = $friendEmail; + + } + else + { + $referralprogram = new ReferralProgramModule(); + $referralprogram->id_sponsor = (int)($cookie->id_customer); + $referralprogram->firstname = $friendFirstName; + $referralprogram->lastname = $friendLastName; + $referralprogram->email = $friendEmail; + if (!$referralprogram->validateFields(false)) + $error = 'name invalid'; + else + { + if ($referralprogram->save()) + { + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + $vars = array( + '{email}' => strval($cookie->email), + '{lastname}' => strval($cookie->customer_lastname), + '{firstname}' => strval($cookie->customer_firstname), + '{email_friend}' => $friendEmail, + '{lastname_friend}' => $friendLastName, + '{firstname_friend}' => $friendFirstName, + '{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')), + '{discount}' => $discount); + Mail::Send((int)($cookie->id_lang), 'referralprogram-invitation', Mail::l('Referral Program'), $vars, $friendEmail, $friendFirstName.' '.$friendLastName, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + $invitation_sent = true; + $nbInvitation++; + $activeTab = 'pending'; + } + else + $error = 'cannot add friends'; + } + } + if ($error) + break; + } + if ($nbInvitation > 0) + unset($_POST); + } +} + +// Mailing revive +$revive_sent = false; +$nbRevive = 0; +if (Tools::isSubmit('revive')) +{ + $activeTab = 'pending'; + if (Tools::getValue('friendChecked') AND sizeof($friendsChecked = Tools::getValue('friendChecked')) >= 1) + { + foreach ($friendsChecked as $key => $friendChecked) + { + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + $referralprogram = new ReferralProgramModule((int)($key)); + $vars = array( + '{email}' => $cookie->email, + '{lastname}' => $cookie->customer_lastname, + '{firstname}' => $cookie->customer_firstname, + '{email_friend}' => $referralprogram->email, + '{lastname_friend}' => $referralprogram->lastname, + '{firstname_friend}' => $referralprogram->firstname, + '{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')), + '{discount}' => $discount + ); + $referralprogram->save(); + Mail::Send((int)($cookie->id_lang), 'referralprogram-invitation', Mail::l('Referral Program'), $vars, $referralprogram->email, $referralprogram->firstname.' '.$referralprogram->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + $revive_sent = true; + $nbRevive++; + } + } + else + $error = 'no revive checked'; +} + +$customer = new Customer((int)($cookie->id_customer)); +$stats = $customer->getStats(); + +$orderQuantity = (int)(Configuration::get('REFERRAL_ORDER_QUANTITY')); +$canSendInvitations = false; +if ((int)($stats['nb_orders']) >= $orderQuantity) + $canSendInvitations = true; + +// Smarty display +$smarty->assign(array( + 'activeTab' => $activeTab, + 'discount' => $discount, + 'orderQuantity' => $orderQuantity, + 'canSendInvitations' => $canSendInvitations, + 'nbFriends' => (int)(Configuration::get('REFERRAL_NB_FRIENDS')), + 'error' => $error, + 'invitation_sent' => $invitation_sent, + 'nbInvitation' => $nbInvitation, + 'pendingFriends' => ReferralProgramModule::getSponsorFriend((int)($cookie->id_customer), 'pending'), + 'revive_sent' => $revive_sent, + 'nbRevive' => $nbRevive, + 'subscribeFriends' => ReferralProgramModule::getSponsorFriend((int)($cookie->id_customer), 'subscribed'), + 'mails_exists' => (isset($mails_exists) ? $mails_exists : array()) +)); + +echo Module::display(dirname(__FILE__).'/referralprogram.php', 'referralprogram-program.tpl'); + +include(dirname(__FILE__).'/../../footer.php'); + + diff --git a/modules/referralprogram/referralprogram-program.tpl b/modules/referralprogram/referralprogram-program.tpl new file mode 100644 index 000000000..4504fd7b6 --- /dev/null +++ b/modules/referralprogram/referralprogram-program.tpl @@ -0,0 +1,223 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + +{capture name=path}{l s='My account' mod='referralprogram'}{$navigationPipe}{l s='Referral Program' mod='referralprogram'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Referral program' mod='referralprogram'}

        + +{if $error} +

        + {if $error == 'conditions not valided'} + {l s='You need to agree to the conditions of the referral program!' mod='referralprogram'} + {elseif $error == 'email invalid'} + {l s='At least one e-mail address is invalid!' mod='referralprogram'} + {elseif $error == 'name invalid'} + {l s='At least one first name or last name is invalid!' mod='referralprogram'} + {elseif $error == 'email exists'} + {l s='Someone with this e-mail address has already been sponsored!' mod='referralprogram'}: {foreach from=$mails_exists item=mail}{$mail} {/foreach} + {elseif $error == 'no revive checked'} + {l s='Please mark at least one checkbox' mod='referralprogram'} + {elseif $error == 'cannot add friends'} + {l s='Cannot add friends to database' mod='referralprogram'} + {/if} +

        +{/if} + +{if $invitation_sent} +

        + {if $nbInvitation > 1} + {l s='E-mails have been sent to your friends!' mod='referralprogram'} + {else} + {l s='An e-mail has been sent to your friend!' mod='referralprogram'} + {/if} +

        +{/if} + +{if $revive_sent} +

        + {if $nbRevive > 1} + {l s='Reminder e-mails have been sent to your friends!' mod='referralprogram'} + {else} + {l s='A reminder e-mail has been sent to your friend!' mod='referralprogram'} + {/if} +

        +{/if} + + +
        + +
        +

        + {l s='Get a discount of' mod='referralprogram'} {$discount} {l s='for you and your friends by recommending this Website.' mod='referralprogram'} +

        + {if $canSendInvitations} +

        + {l s='It\'s quick and it\'s easy. Just fill in the first name, last name, and e-mail address(es) of your friend(s) in the fields below.' mod='referralprogram'} + {l s='When one of them makes at least' mod='referralprogram'} {$orderQuantity} {if $orderQuantity > 1}{l s='orders' mod='referralprogram'}{else}{l s='order' mod='referralprogram'}{/if}, + {l s='he or she will receive a' mod='referralprogram'} {$discount} {l s='voucher and you will receive your own voucher worth' mod='referralprogram'} {$discount}. +

        +
        + + + + + + + + + + + {section name=friends start=0 loop=$nbFriends step=1} + + + + + + + {/section} + +
         {l s='Last name' mod='referralprogram'}{l s='First name' mod='referralprogram'}{l s='E-mail' mod='referralprogram'}
        {$smarty.section.friends.iteration}
        +

        + {l s='Important: Your friends\' e-mail addresses will only be used in the referral program. They will never be used for other purposes.' mod='referralprogram'} +

        +

        + + + {l s='Read conditions.' mod='referralprogram'} +

        +

        + {l s='Preview' mod='referralprogram'} {l s='the default e-mail' mod='referralprogram'} {l s='that will be sent to your friend(s).' mod='referralprogram'} +

        +

        + +

        +
        + {else} +

        + {l s='To become a sponsor, you need to have completed at least' mod='referralprogram'} {$orderQuantity} {if $orderQuantity > 1}{l s='orders' mod='referralprogram'}{else}{l s='order' mod='referralprogram'}{/if}. +

        + {/if} +
        + +
        + {if $pendingFriends AND $pendingFriends|@count > 0} +

        + {l s='These friends have not yet placed an order on this Website since you sponsored them, but you can try again! To do so, mark the checkboxes of the friend(s) you want to remind, then click on the button "Remind my friend(s)"' mod='referralprogram'} +

        +
        + + + + + + + + + + + + {foreach from=$pendingFriends item=pendingFriend name=myLoop} + + + + + + + + {/foreach} + +
         {l s='Last name' mod='referralprogram'}{l s='First name' mod='referralprogram'}{l s='E-mail' mod='referralprogram'}{l s='Last invitation' mod='referralprogram'}
        + + + + {$pendingFriend.firstname|substr:0:22}{$pendingFriend.email}{dateFormat date=$pendingFriend.date_upd full=1}
        +

        + +

        +
        + {else} +

        {l s='You have not sponsored any friends.' mod='referralprogram'}

        + {/if} +
        + +
        + {if $subscribeFriends AND $subscribeFriends|@count > 0} +

        + {l s='Here are sponsored friends who have accepted your invitation:' mod='referralprogram'} +

        + + + + + + + + + + + + {foreach from=$subscribeFriends item=subscribeFriend name=myLoop} + + + + + + + + {/foreach} + +
         {l s='Last name' mod='referralprogram'}{l s='First name' mod='referralprogram'}{l s='E-mail' mod='referralprogram'}{l s='Inscription date' mod='referralprogram'}
        {$smarty.foreach.myLoop.iteration}.{$subscribeFriend.lastname|substr:0:22}{$subscribeFriend.firstname|substr:0:22}{$subscribeFriend.email}{dateFormat date=$subscribeFriend.date_upd full=1}
        + {else} +

        + {l s='No sponsored friends have accepted your invitation yet.' mod='referralprogram'} +

        + {/if} +
        +
        + + diff --git a/modules/referralprogram/referralprogram-rules.php b/modules/referralprogram/referralprogram-rules.php new file mode 100644 index 000000000..c6c4685e9 --- /dev/null +++ b/modules/referralprogram/referralprogram-rules.php @@ -0,0 +1,51 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/../../init.php'); + +if (!Tools::getValue('width') AND !Tools::getValue('height')) + require_once(dirname(__FILE__).'/../../header.php'); + +$xmlFile = _PS_MODULE_DIR_.'referralprogram/referralprogram.xml'; + +if (file_exists($xmlFile)) +{ + if ($xml = @simplexml_load_file($xmlFile)) + { + $smarty->assign(array( + 'xml' => $xml, + 'paragraph' => 'paragraph_'.$cookie->id_lang + )); + } +} + +echo Module::display(dirname(__FILE__).'/referralprogram', 'referralprogram-rules.tpl'); + +if (!Tools::getValue('width') AND !Tools::getValue('height')) + require_once(dirname(__FILE__).'/../../footer.php'); + diff --git a/modules/referralprogram/referralprogram-rules.tpl b/modules/referralprogram/referralprogram-rules.tpl new file mode 100644 index 000000000..a381e29ae --- /dev/null +++ b/modules/referralprogram/referralprogram-rules.tpl @@ -0,0 +1,33 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

        {l s='Referral program rules' mod='referralprogram'}

        + +{if isset($xml)} +
        + {if isset($xml->body->$paragraph)}
        {$xml->body->$paragraph|replace:"\'":"'"|replace:'\"':'"'}
        {/if} +
        +{/if} diff --git a/modules/referralprogram/referralprogram.gif b/modules/referralprogram/referralprogram.gif new file mode 100644 index 000000000..85de79228 Binary files /dev/null and b/modules/referralprogram/referralprogram.gif differ diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php new file mode 100644 index 000000000..026e0ab6c --- /dev/null +++ b/modules/referralprogram/referralprogram.php @@ -0,0 +1,599 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class ReferralProgram extends Module +{ + public function __construct() + { + $this->name = 'referralprogram'; + $this->tab = 'advertising_marketing'; + $this->version = '1.5'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->confirmUninstall = $this->l('All sponsors and friends will be deleted. Are you sure you want to uninstall this module?'); + $this->displayName = $this->l('Customer referral program'); + $this->description = $this->l('Integrate a referral program system into your shop.'); + if (Configuration::get('REFERRAL_DISCOUNT_TYPE') == 1 AND !Configuration::get('REFERRAL_PERCENTAGE')) + $this->warning = $this->l('Please specify an amount for referral program vouchers.'); + + if ($this->id) + { + $this->_configuration = Configuration::getMultiple(array('REFERRAL_NB_FRIENDS', 'REFERRAL_ORDER_QUANTITY', 'REFERRAL_DISCOUNT_TYPE', 'REFERRAL_DISCOUNT_VALUE')); + $this->_configuration['REFERRAL_DISCOUNT_DESCRIPTION'] = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION'); + $this->_xmlFile = dirname(__FILE__).'/referralprogram.xml'; + } + } + + public function install() + { + $defaultTranslations = array('en' => 'Referral reward', 'fr' => 'Récompense parrainage'); + $desc = array((int)Configuration::get('PS_LANG_DEFAULT') => $this->l('Referral reward')); + foreach (Language::getLanguages() AS $language) + if (isset($defaultTranslations[$language['iso_code']])) + $desc[(int)$language['id_lang']] = $defaultTranslations[$language['iso_code']]; + + if (!parent::install() OR !$this->installDB() OR !Configuration::updateValue('REFERRAL_DISCOUNT_DESCRIPTION', $desc) + OR !Configuration::updateValue('REFERRAL_ORDER_QUANTITY', 1) OR !Configuration::updateValue('REFERRAL_DISCOUNT_TYPE', 2) + OR !Configuration::updateValue('REFERRAL_NB_FRIENDS', 5) OR !$this->registerHook('shoppingCart') + OR !$this->registerHook('orderConfirmation') OR !$this->registerHook('updateOrderStatus') + OR !$this->registerHook('adminCustomers') OR !$this->registerHook('createAccount') + OR !$this->registerHook('createAccountForm') OR !$this->registerHook('customerAccount')) + return false; + + /* Define a default value for fixed amount vouchers, for each currency */ + foreach (Currency::getCurrencies() AS $currency) + Configuration::updateValue('REFERRAL_DISCOUNT_VALUE_'.(int)($currency['id_currency']), 5); + + /* Define a default value for the percentage vouchers */ + Configuration::updateValue('REFERRAL_PERCENTAGE', 5); + + /* This hook is optional */ + $this->registerHook('myAccountBlock'); + + return true; + } + + public function installDB() + { + return Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'referralprogram` ( + `id_referralprogram` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_sponsor` INT UNSIGNED NOT NULL, + `email` VARCHAR(255) NOT NULL, + `lastname` VARCHAR(128) NOT NULL, + `firstname` VARCHAR(128) NOT NULL, + `id_customer` INT UNSIGNED DEFAULT NULL, + `id_discount` INT UNSIGNED DEFAULT NULL, + `id_discount_sponsor` INT UNSIGNED DEFAULT NULL, + `date_add` DATETIME NOT NULL, + `date_upd` DATETIME NOT NULL, + PRIMARY KEY (`id_referralprogram`), + UNIQUE KEY `index_unique_referralprogram_email` (`email`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;'); + } + + public function uninstall() + { + $result = true; + foreach (Currency::getCurrencies() AS $currency) + $result = $result AND Configuration::deleteByName('REFERRAL_DISCOUNT_VALUE_'.(int)($currency['id_currency'])); + if (!parent::uninstall() OR !$this->uninstallDB() OR !$this->removeMail() OR !$result + OR !Configuration::deleteByName('REFERRAL_PERCENTAGE') OR !Configuration::deleteByName('REFERRAL_ORDER_QUANTITY') + OR !Configuration::deleteByName('REFERRAL_DISCOUNT_TYPE') OR !Configuration::deleteByName('REFERRAL_NB_FRIENDS') + OR !Configuration::deleteByName('REFERRAL_DISCOUNT_DESCRIPTION')) + return false; + return true; + } + + public function uninstallDB() + { + return Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'referralprogram`;'); + } + + public function removeMail() + { + $langs = Language::getLanguages(false); + foreach ($langs AS $lang) + foreach ($this->_mails['name'] AS $name) + foreach ($this->_mails['ext'] AS $ext) + { + $file = _PS_MAIL_DIR_.$lang['iso_code'].'/'.$name.'.'.$ext; + if (file_exists($file) AND !@unlink($file)) + $this->_errors[] = $this->l('Cannot delete this file:').' '.$file; + } + return true; + } + + private function _postProcess() + { + Configuration::updateValue('REFERRAL_ORDER_QUANTITY', (int)(Tools::getValue('order_quantity'))); + foreach (Tools::getValue('discount_value') AS $id_currency => $discount_value) + Configuration::updateValue('REFERRAL_DISCOUNT_VALUE_'.(int)($id_currency), (float)($discount_value)); + Configuration::updateValue('REFERRAL_DISCOUNT_TYPE', (int)(Tools::getValue('discount_type'))); + Configuration::updateValue('REFERRAL_NB_FRIENDS', (int)(Tools::getValue('nb_friends'))); + Configuration::updateValue('REFERRAL_DISCOUNT_DESCRIPTION', Tools::getValue('discount_description')); + $this->_html .= $this->displayConfirmation($this->l('Configuration updated.')); + } + + private function _postValidation() + { + $this->_errors = array(); + if (!(int)(Tools::getValue('order_quantity')) OR Tools::getValue('order_quantity') < 0) + $this->_errors[] = $this->displayError($this->l('Order quantity is required/invalid.')); + if (!is_array(Tools::getValue('discount_value'))) + $this->_errors[] = $this->displayError($this->l('Discount value is invalid.')); + foreach (Tools::getValue('discount_value') AS $id_currency => $discount_value) + if ($discount_value == '') + $this->_errors[] = $this->displayError($this->l('Discount value for the currency #').$id_currency.$this->l(' is empty.')); + elseif (!Validate::isUnsignedFloat($discount_value)) + $this->_errors[] = $this->displayError($this->l('Discount value for the currency #').$id_currency.$this->l(' is invalid.')); + if (!(int)(Tools::getValue('discount_type')) OR Tools::getValue('discount_type') < 1 OR Tools::getValue('discount_type') > 2) + $this->_errors[] = $this->displayError($this->l('Discount type is required/invalid.')); + if (!(int)(Tools::getValue('nb_friends')) OR Tools::getValue('nb_friends') < 0) + $this->_errors[] = $this->displayError($this->l('Number of friends is required/invalid.')); + } + + private function _writeXml() + { + $forbiddenKey = array('submitUpdate'); // Forbidden key + + // Generate new XML data + $newXml = '<'.'?xml version=\'1.0\' encoding=\'utf-8\' ?>'."\n"; + $newXml .= ''."\n"; + $newXml .= "\t".''; + // Making body data + foreach ($_POST AS $key => $field) + if ($line = $this->putContent($newXml, $key, $field, $forbiddenKey, 'body')) + $newXml .= $line; + $newXml .= "\n\t".''."\n"; + $newXml .= ''."\n"; + + /* write it into the editorial xml file */ + if ($fd = @fopen($this->_xmlFile, 'w')) + { + if (!@fwrite($fd, $newXml)) + $this->_html .= $this->displayError($this->l('Unable to write to the xml file.')); + if (!@fclose($fd)) + $this->_html .= $this->displayError($this->l('Cannot close the xml file.')); + } + else + $this->_html .= $this->displayError($this->l('Unable to update the xml file. Please check the xml file\'s writing permissions.')); + } + + public function putContent($xml_data, $key, $field, $forbidden, $section) + { + foreach ($forbidden AS $line) + if ($key == $line) + return 0; + if (!preg_match('/^'.$section.'_/i', $key)) + return 0; + $key = preg_replace('/^'.$section.'_/i', '', $key); + $field = Tools::htmlentitiesDecodeUTF8(htmlspecialchars($field)); + if (!$field) + return 0; + return ("\n\t\t".'<'.$key.'>'); + } + + public function getContent() + { + if (Tools::isSubmit('submitReferralProgram')) + { + $this->_postValidation(); + if (!sizeof($this->_errors)) + $this->_postProcess(); + else + foreach ($this->_errors AS $err) + $this->_html .= '
        '.$err.'
        '; + } + elseif (Tools::isSubmit('submitText')) + { + foreach ($_POST AS $key => $value) + if (!Validate::isString(Tools::getValue($key))) + { + $this->_html .= $this->displayError($this->l('Invalid html field, javascript is forbidden')); + $this->_displayForm(); + return $this->_html; + } + $this->_writeXml(); + } + + $this->_html .= '

        '.$this->displayName.'

        '; + $this->_displayForm(); + $this->_displayFormRules(); + return $this->_html; + } + + private function _displayForm() + { + $divLangName = 'cpara¤dd'; + $currencies = Currency::getCurrencies(); + + $this->_html .= ' +
        +
        + '.$this->l('Settings').''.$this->l('Settings').' +

        + + +

        +

        + + +

        +

        + + + +   + + +

        + + + + + + '; + + foreach ($currencies AS $currency) + $this->_html .= ' + + + + '; + + $this->_html .= ' +
        '.$this->l('Currency').''.$this->l('Voucher amount').'
        '.(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '' : '').htmlentities($currency['name'], ENT_NOQUOTES, 'utf-8').(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '' : '').' '.$currency['sign'].'
        +

        +

        '; + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(false); + foreach ($languages AS $language) + $this->_html .= ' +
        + +
        '; + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'dd', true); + $this->_html .= ' +

        +
        +
        +

        '; + } + + private function _displayFormRules() + { + global $cookie; + + // Languages preliminaries + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(); + $iso = Language::getIsoById($defaultLanguage); + $divLangName = 'cpara¤dd'; + + // xml loading + $xml = false; + if (file_exists($this->_xmlFile)) + if (!$xml = @simplexml_load_file($this->_xmlFile)) + $this->_html .= $this->displayError($this->l('Your text is empty.')); + + // TinyMCE + global $cookie; + $iso = Language::getIsoById((int)($cookie->id_lang)); + $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'); + $ad = dirname($_SERVER["PHP_SELF"]); + echo ' + + + + +
        +
        + '.$this->l('Referral program rules').''; + foreach ($languages AS $language) + { + $this->_html .= ' +
        + +
        '; + } + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'cpara', true); + + $this->_html .= ' +
        +
        +
        '; + } + + + /** + * Hook call when cart created and updated + * Display the discount name if the sponsor friend have one + */ + public function hookShoppingCart($params) + { + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + if (!isset($params['cart']->id_customer)) + return false; + if (!($id_referralprogram = ReferralProgramModule::isSponsorised((int)($params['cart']->id_customer), true))) + return false; + $referralprogram = new ReferralProgramModule($id_referralprogram); + if (!Validate::isLoadedObject($referralprogram)) + return false; + $discount = new Discount($referralprogram->id_discount); + if (!Validate::isLoadedObject($discount)) + return false; + if ($params['cart']->checkDiscountValidity($discount, $params['cart']->getDiscounts(), $params['cart']->getOrderTotal(true, Cart::ONLY_PRODUCTS), $params['cart']->getProducts())===false) + { + global $smarty; + $smarty->assign(array('discount_display' => Discount::display($discount->value, $discount->id_discount_type, new Currency($params['cookie']->id_currency)), 'discount' => $discount)); + return $this->display(__FILE__, 'shopping-cart.tpl'); + } + return false; + } + + /** + * Hook display on customer account page + * Display an additional link on my-account and block my-account + */ + public function hookCustomerAccount($params) + { + return $this->display(__FILE__, 'my-account.tpl'); + } + + public function hookMyAccountBlock($params) + { + return $this->hookCustomerAccount($params); + } + + /** + * Hook display on form create account + * Add an additional input on bottom for fill the sponsor's e-mail address + */ + public function hookCreateAccountForm($params) + { + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + global $smarty; + + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + $explodeResult = explode('|', $cipherTool->decrypt(urldecode(Tools::getValue('sponsor')))); + if ($explodeResult AND count($explodeResult) > 1 AND list($id_referralprogram, $email) = $explodeResult AND (int)($id_referralprogram) AND !empty($email) AND Validate::isEmail($email) AND $id_referralprogram == ReferralProgramModule::isEmailExists($email)) + { + $referralprogram = new ReferralProgramModule($id_referralprogram); + if (Validate::isLoadedObject($referralprogram)) + { + /* hack for display referralprogram information in form */ + $_POST['customer_firstname'] = $referralprogram->firstname; + $_POST['firstname'] = $referralprogram->firstname; + $_POST['customer_lastname'] = $referralprogram->lastname; + $_POST['lastname'] = $referralprogram->lastname; + $_POST['email'] = $referralprogram->email; + $_POST['email_create'] = $referralprogram->email; + $sponsor = new Customer((int)$referralprogram->id_sponsor); + $_POST['referralprogram'] = $sponsor->email; + } + } + return $this->display(__FILE__, 'authentication.tpl'); + } + + /** + * Hook called on creation customer account + * Create a discount for the customer if sponsorised + */ + public function hookCreateAccount($params) + { + global $cookie; + + $newCustomer = $params['newCustomer']; + if (!Validate::isLoadedObject($newCustomer)) + return false; + $postVars = $params['_POST']; + if (empty($postVars) OR !isset($postVars['referralprogram']) OR empty($postVars['referralprogram'])) + return false; + $sponsorEmail = $postVars['referralprogram']; + if (!Validate::isEmail($sponsorEmail) OR $sponsorEmail == $newCustomer->email) + return false; + + $sponsor = new Customer(); + if ($sponsor = $sponsor->getByEmail($sponsorEmail)) + { + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + /* If the customer was not invited by the sponsor, we create the invitation dynamically */ + if (!$id_referralprogram = ReferralProgramModule::isEmailExists($newCustomer->email, true, false)) + { + $referralprogram = new ReferralProgramModule(); + $referralprogram->id_sponsor = (int)$sponsor->id; + $referralprogram->firstname = $newCustomer->firstname; + $referralprogram->lastname = $newCustomer->lastname; + $referralprogram->email = $newCustomer->email; + if (!$referralprogram->validateFields(false)) + return false; + else + $referralprogram->save(); + } + else + $referralprogram = new ReferralProgramModule((int)$id_referralprogram); + + if ($referralprogram->id_sponsor == $sponsor->id) + { + $referralprogram->id_customer = (int)$newCustomer->id; + $referralprogram->save(); + if ($referralprogram->registerDiscountForSponsored((int)$params['cookie']->id_currency)) + { + $discount = new Discount((int)$referralprogram->id_discount); + if (Validate::isLoadedObject($discount)) + { + $data = array('{firstname}' => $newCustomer->firstname, '{lastname}' => $newCustomer->lastname, '{voucher_num}' => $discount->name, + '{voucher_amount}' => Tools::displayPrice((float)Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($cookie->id_currency)), (int)Configuration::get('PS_CURRENCY_DEFAULT'))); + Mail::Send((int)$cookie->id_lang, 'referralprogram-voucher', Mail::l('Congratulations!'), $data, $newCustomer->email, $newCustomer->firstname.' '.$newCustomer->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + } + } + return true; + } + } + return false; + } + + /** + * Hook display in tab AdminCustomers on BO + * Data table with all sponsors informations for a customer + */ + public function hookAdminCustomers($params) + { + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + $customer = new Customer((int)$params['id_customer']); + if (!Validate::isLoadedObject($customer)) + die (Tools::displayError('Incorrect object Customer.')); + + global $cookie; + $friends = ReferralProgramModule::getSponsorFriend((int)$customer->id); + if ($id_referralprogram = ReferralProgramModule::isSponsorised((int)$customer->id, true)) + { + $referralprogram = new ReferralProgramModule((int)$id_referralprogram); + $sponsor = new Customer((int)$referralprogram->id_sponsor); + } + + $html = ' +

        '.$this->l('Referral program').'

        +

        '.(isset($sponsor) ? $this->l('Customer\'s sponsor:').' '.$sponsor->firstname.' '.$sponsor->lastname.'' : $this->l('No one has sponsored this customer.')).'

        '; + + if ($friends AND sizeof($friends)) + { + $html.= '

        '.sizeof($friends).' '.(sizeof($friends) > 1 ? $this->l('Sponsored customers:') : $this->l('Sponsored customer:')).'

        '; + $html.= ' + + + + + + + + + + '; + foreach ($friends AS $key => $friend) + { + $orders = Order::getCustomerOrders($friend['id_customer']); + $html.= ' + + + + + + + + + '; + } + $html.= ' +
        '.$this->l('ID').''.$this->l('Name').''.$this->l('Email').''.$this->l('Registration date').''.$this->l('Customers sponsored by this friend').''.$this->l('Placed orders').''.$this->l('Customer account created').'
        '.((int)($friend['id_customer']) ? $friend['id_customer'] : '--').''.$friend['firstname'].' '.$friend['lastname'].''.$friend['email'].''.Tools::displayDate($friend['date_add'], (int)($cookie->id_lang), true).''.sizeof(ReferralProgramModule::getSponsorFriend($friend['id_customer'])).''.($orders ? sizeof($orders) : 0).''.((int)$friend['id_customer'] ? '' : '').'
        '; + } + else + $html.= $customer->firstname.' '.$customer->lastname.' '.$this->l('has not sponsored any friends yet.'); + return $html.'

        '; + } + + /** + * Hook called when a order is confimed + * display a message to customer about sponsor discount + */ + public function hookOrderConfirmation($params) + { + if ($params['objOrder'] AND !Validate::isLoadedObject($params['objOrder'])) + return die(Tools::displayError('Incorrect object Order.')); + + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + $customer = new Customer((int)$params['objOrder']->id_customer); + $stats = $customer->getStats(); + $nbOrdersCustomer = (int)$stats['nb_orders'] + 1; // hack to count current order + $referralprogram = new ReferralProgramModule(ReferralProgramModule::isSponsorised((int)$customer->id, true)); + if (!Validate::isLoadedObject($referralprogram)) + return false; + $sponsor = new Customer((int)$referralprogram->id_sponsor); + if ((int)$nbOrdersCustomer == (int)$this->_configuration['REFERRAL_ORDER_QUANTITY']) + { + $discount = new Discount((int)$referralprogram->id_discount_sponsor); + if (!Validate::isLoadedObject($discount)) + return false; + global $smarty; + $smarty->assign(array('discount' => $discount->display($discount->value, (int)$discount->id_discount_type, new Currency((int)$params['objOrder']->id_currency)), 'sponsor_firstname' => $sponsor->firstname, 'sponsor_lastname' => $sponsor->lastname)); + return $this->display(__FILE__, 'order-confirmation.tpl'); + } + return false; + } + + /** + * Hook called when order status changed + * register a discount for sponsor and send him an e-mail + */ + public function hookUpdateOrderStatus($params) + { + if (!Validate::isLoadedObject($params['newOrderStatus'])) + die (Tools::displayError('Missing parameters')); + $orderState = $params['newOrderStatus']; + $order = new Order((int)($params['id_order'])); + if ($order AND !Validate::isLoadedObject($order)) + die(Tools::displayError('Incorrect object Order.')); + + include_once(dirname(__FILE__).'/ReferralProgramModule.php'); + + $customer = new Customer((int)$order->id_customer); + $stats = $customer->getStats(); + $nbOrdersCustomer = (int)$stats['nb_orders'] + 1; // hack to count current order + $referralprogram = new ReferralProgramModule(ReferralProgramModule::isSponsorised((int)($customer->id), true)); + if (!Validate::isLoadedObject($referralprogram)) + return false; + $sponsor = new Customer((int)$referralprogram->id_sponsor); + if ((int)$orderState->logable AND $nbOrdersCustomer >= (int)$this->_configuration['REFERRAL_ORDER_QUANTITY'] AND $referralprogram->registerDiscountForSponsor((int)$order->id_currency)) + { + $discount = new Discount((int)$referralprogram->id_discount_sponsor); + $currency = new Currency((int)$order->id_currency); + $discount_display = $discount->display($discount->value, (int)$discount->id_discount_type, $currency); + $data = array('{sponsored_firstname}' => $customer->firstname, '{sponsored_lastname}' => $customer->lastname, '{discount_display}' => $discount_display, '{discount_name}' => $discount->name); + Mail::Send((int)$order->id_lang, 'referralprogram-congratulations', Mail::l('Congratulations!'), $data, $sponsor->email, $sponsor->firstname.' '.$sponsor->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); + return true; + } + return false; + } +} diff --git a/modules/referralprogram/referralprogram.xml b/modules/referralprogram/referralprogram.xml new file mode 100644 index 000000000..55ee26257 --- /dev/null +++ b/modules/referralprogram/referralprogram.xml @@ -0,0 +1,13 @@ + + + + toto Quisque in mauris. Duis eu diam. Nullam at metus in lectus interdum elementum. Vestibulum dapibus diam ut libero. Vivamus placerat lacus at dui. Integer dapibus est in magna.

        +

        Curabitur vel erat eget sapien semper feugiat. Sed sodales dictum pede. Ut adipiscing. Cras aliquam, erat eget auctor pretium, lorem pede pellentesque metus, at ultrices est est sit amet libero.

        +

        Aliquam erat volutpat. Maecenas aliquet, felis at eleifend suscipit, risus sem congue est, id vestibulum libero sapien in ligula. Nulla ut urna id eros lacinia gravida.

        ]]>
        + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean nisl diam, sollicitudin vitae, tempor nec, suscipit non, quam. Donec in nulla. Nam consequat bibendum leo. Etiam viverra congue nisl. Aliquam ac tellus vitae arcu ornare convallis.

        +

        Nulla ut erat. Vivamus ornare imperdiet libero. Integer risus mauris, faucibus eu, fermentum tincidunt, molestie non, arcu. Phasellus mattis, dui ac vestibulum pellentesque, enim turpis scelerisque augue, ut tristique quam metus eu metus. Donec pellentesque faucibus velit. Vivamus quis ipsum. leather edition is near from you ut libero sed mauris venenatis iaculis. Curabitur nulla erat, accumsan ac, consequat quis, aliquet sit amet, orci.

        +

        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean nisl diam, sollicitudin vitae, tempor nec, suscipit non, quam. Donec in nulla. Nam consequat bibendum leo. Etiam viverra congue nisl. Aliquam ac tellus vitae arcu ornare convallis.

        +

        Nulla ut erat. Vivamus ornare imperdiet libero. Integer risus mauris, faucibus eu, fermentum tincidunt, molestie non, arcu. Phasellus mattis, dui ac vestibulum pellentesque, enim turpis scelerisque augue, ut tristique quam metus eu metus. Donec pellentesque faucibus velit. Vivamus quis ipsum. Pellentesque ut libero sed mauris venenatis iaculis. Curabitur nulla erat, accumsan ac, consequat quis, aliquet sit amet, orci.

        ]]>
        + test espagnol

        ]]>
        + +
        diff --git a/modules/referralprogram/shopping-cart.tpl b/modules/referralprogram/shopping-cart.tpl new file mode 100644 index 000000000..538a71a05 --- /dev/null +++ b/modules/referralprogram/shopping-cart.tpl @@ -0,0 +1,35 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +

        + {l s='Referral program' mod='referralprogram'} + {l s='You have earned a voucher worth' mod='referralprogram'} {$discount_display} {l s='thanks to your sponsor!' mod='referralprogram'} + {l s='Enter voucher name' mod='referralprogram'} {$discount->name} {l s='to receive the reduction on this order.' mod='referralprogram'} + {l s='View your referral program.' mod='referralprogram'} +

        +
        + \ No newline at end of file diff --git a/modules/reverso/config.xml b/modules/reverso/config.xml new file mode 100755 index 000000000..3ea6b44b0 --- /dev/null +++ b/modules/reverso/config.xml @@ -0,0 +1,12 @@ + + + reverso + ReversoForm + 1.0 + Fill Authentication form with ReversoForm + + front_office_features + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/reverso/de.php b/modules/reverso/de.php new file mode 100644 index 000000000..181831e69 --- /dev/null +++ b/modules/reverso/de.php @@ -0,0 +1,16 @@ +reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Füllen Sie das Authentifizierungsformular mit ReversoForm aus'; +$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Konfiguration'; +$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Seriennummer'; +$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Webseiten-Adresse'; +$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Aktualisierung'; +$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Reverso Kontokonfiguration'; +$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Sie haben noch kein ReversoForm-Konto?'; +$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Jetzt anmelden!'; +$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Die Einstellungen werden aktualisiert'; +$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Wir können diese Nummer nicht finden '; +$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Tragen Sie Ihre Telefonnummer automatisch in dieses Formular ein '; diff --git a/modules/reverso/es.php b/modules/reverso/es.php new file mode 100644 index 000000000..c953b4f12 --- /dev/null +++ b/modules/reverso/es.php @@ -0,0 +1,16 @@ +reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Rellenar el formulario de autentificación con ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configuración'; +$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Número de serie'; +$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Dirección del sitio'; +$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Actualizar'; +$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configuración de la cuenta ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = '¿Aún no tiene una cuenta Reverso?'; +$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Regístrese ahora'; +$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados'; +$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Imposible encontrar ese número'; +$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Completar el formulario automáticamente con su número de teléfono'; diff --git a/modules/reverso/fr.php b/modules/reverso/fr.php new file mode 100644 index 000000000..7da8fc84e --- /dev/null +++ b/modules/reverso/fr.php @@ -0,0 +1,16 @@ +reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Remplir le formulaire d\'authentification avec ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configuration'; +$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Numéro de série'; +$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Adresse du site'; +$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Mettre à jour'; +$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configuration compte Reverso'; +$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Vous n\'avez pas de compte Reverso ?'; +$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Enregistrez vous maintenant !'; +$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Impossible de trouver ce numéro'; +$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Complétez automatiquement le formulaire avec votre numéro de téléphone'; diff --git a/modules/reverso/it.php b/modules/reverso/it.php new file mode 100644 index 000000000..3cd11c619 --- /dev/null +++ b/modules/reverso/it.php @@ -0,0 +1,16 @@ +reverso_86774f1550b9ad3cc207184b35afb514'] = 'ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_1e9fcdadfd0ced6424c9692da9373fbf'] = 'Compila modulo di autenticazione con ReversoForm'; +$_MODULE['<{reverso}prestashop>reverso_254f642527b45bc260048e30704edb39'] = 'Configurazione'; +$_MODULE['<{reverso}prestashop>reverso_3460276ef9eb483d13aa31b870077a0d'] = 'Numero di serie'; +$_MODULE['<{reverso}prestashop>reverso_af53b10cb956fa2562af3c3fcd1c08f6'] = 'Indirizzo del sito'; +$_MODULE['<{reverso}prestashop>reverso_06933067aafd48425d67bcb01bba5cb6'] = 'Aggiornamento'; +$_MODULE['<{reverso}prestashop>reverso_a67fe5b600cc617a0cc6f782b2b466e1'] = 'Configurazione account Reverso'; +$_MODULE['<{reverso}prestashop>reverso_af21713c577d79637cb7ce743b9522be'] = 'Non hai ancora un account ReversoForm?'; +$_MODULE['<{reverso}prestashop>reverso_15e80d88e64872dffe151e5ba783270b'] = 'Registrati ora!'; +$_MODULE['<{reverso}prestashop>reverso_7ccf58c950043c9fbfed668df13ce608'] = 'Le impostazioni sono aggiornate'; +$_MODULE['<{reverso}prestashop>reverso_9dd6474008963ad22e9fd0f28447e7b2'] = 'Non possiamo trovare questo numero'; +$_MODULE['<{reverso}prestashop>reverso_87094afb0ee64892a41b1f6acab60b02'] = 'Compilare automaticamente questo modulo con il tuo numero di telefono'; diff --git a/modules/reverso/js/index.php b/modules/reverso/js/index.php new file mode 100644 index 000000000..6be596507 --- /dev/null +++ b/modules/reverso/js/index.php @@ -0,0 +1,26 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/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-store, no-cache, must-revalidate");header("Cache-Control: post-check=0, pre-check=0", false);header("Pragma: no-cache");header("Location: ../");exit; \ No newline at end of file diff --git a/modules/reverso/js/reverso.js b/modules/reverso/js/reverso.js new file mode 100644 index 000000000..78cc5fe18 --- /dev/null +++ b/modules/reverso/js/reverso.js @@ -0,0 +1,63 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function updateAddress(phone) +{ + $.ajax({ + type: 'GET', + url: baseDir+'modules/reverso/reverso_check.php?phone=' + $('#reverso_form').val(), + async: true, + cache: false, + type: 'text', + success: function(data) + { + if (data == 0) + { + alert(unknown_number); + return false; + } + else if (data == 11) + { + return false; + } + var fields = data.split(','); + $(fields).each(function(){ + var field = this.split(':'); + $('form#account-creation_form input[name=\''+ field[0] +'\']').val(field[1]); + }); + } + }); + return false; +} + +$(document).ready(function(){ + $('#reverso_form').typeWatch({ + callback:function(){ updateAddress();}, + wait:800, + highlight:false, + enterkey:false + }); +}); diff --git a/modules/reverso/logo.gif b/modules/reverso/logo.gif new file mode 100644 index 000000000..1e473540c Binary files /dev/null and b/modules/reverso/logo.gif differ diff --git a/modules/reverso/reverso.php b/modules/reverso/reverso.php new file mode 100644 index 000000000..90341a44c --- /dev/null +++ b/modules/reverso/reverso.php @@ -0,0 +1,168 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Reverso extends Module +{ + private $_html; + private $_api_url = 'http://api2.reversoform.com/includes/api.controler.reverso2.php?phone_number={ARG_PHONE}&serial={ARG_SERIAL}&remoteAddress={ARG_ADDRESS}'; + + function __construct() + { + $this->name = 'reverso'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + // Iso code of countries where the module can be used, if none module available for all countries + $this->limited_countries = array('fr'); + + parent::__construct(); + /* The parent construct is required for translations */ + $this->displayName = $this->l('ReversoForm'); + $this->description = $this->l('Fill Authentication form with ReversoForm'); + } + + public function install() + { + // Check if hook exists + $result = Db::getInstance()->getValue(' + SELECT COUNT(*) AS total + FROM `'._DB_PREFIX_.'hook` + WHERE `name` = \'createAccountTop\' + '); + if (!$result) + if(!Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook` (`name`, `title`, `description`, `position`) + VALUES (\'createAccountTop\', \'Block above the form for create an account\', NULL , \'1\'); + ')) + return false; + + if (!parent::install()) + return false; + + if (!$this->registerHook('createAccountTop')) + return false; + + return (Configuration::updateValue('REVERSO_SERIAL', '0123456789123') AND + Configuration::updateValue('REVERSO_BAD_NUMBER', 1) AND + Configuration::updateValue('REVERSO_UNKNOWN_NUMBER', 2) AND + Configuration::updateValue('REVERSO_ADDRESS', str_replace('http://', '', $_SERVER['HTTP_HOST']))); + } + + private function _postProcess() + { + return (Configuration::updateValue('REVERSO_SERIAL', pSQL(Tools::getValue('reverso_serial'))) AND + Configuration::updateValue('REVERSO_ADDRESS', pSQL(Tools::getValue('reverso_address')))); + + } + + public function hookCreateAccountTop($params) + { + global $smarty; + $tag = ''; + $smarty->assign(array('reverso_tag' => $tag)); + return $this->display(__FILE__, 'reverso.tpl'); + } + + private function _displayForm() + { + $conf = Configuration::getMultiple(array('REVERSO_SERIAL', 'REVERSO_ADDRESS')); + + $this->_html .= + '
        '.$this->l('Configuration').' +
        + +
        + +
        + +
        + +
        + +
        '; + } + + public function getContent() + { + $this->_html .= '

        '.$this->l('Reverso account configuration').'

        + '.$this->l('You don\'t have a ReversoForm account yet?').' '.$this->l('Register now!').''; + if (!empty($_POST)) + { + if ($this->_postProcess()) + $this->_html .= $this->displayConfirmation($this->l('Settings are updated').''); + } + else + $this->_html .= '
        '; + $this->_displayForm(); + return $this->_html; + } + + public function callReverso($phone = false) + { + if ($phone === false) + return false; + + $conf = Configuration::getMultiple(array('REVERSO_SERIAL', + 'REVERSO_ADDRESS', + 'REVERSO_BAD_NUMBER', + 'REVERSO_UNKNOWN_NUMBER')); + + $phone = str_replace(array(' '), '', $phone); + if (strlen($phone) < 10) + return (int)($conf['REVERSO_BAD_NUMBER']); + + $url_to_call = str_replace(array('{ARG_PHONE}', '{ARG_SERIAL}', '{ARG_ADDRESS}'), array($phone, $conf['REVERSO_SERIAL'], $conf['REVERSO_ADDRESS']), $this->_api_url); + $reverso = file_get_contents($url_to_call); + + $address = Tools::jsonDecode($reverso, true); + if ($address == 'NULL') + return (int)($conf['REVERSO_BAD_NUMBER']); + + $fields = array('last_name' => 'lastname', + 'first_name' => 'firstname', + 'zip' => 'postcode', + 'city' => 'city', + 'address' => 'address1', + 'company' => 'company' + ); + $to_presta = array(); + foreach ($fields AS $k => $field) + if (array_key_exists($k, $address)) + $to_presta[$field] = $address[$k]; + + $to_presta = ''; + foreach ($fields AS $k => $field) + $to_presta .= (array_key_exists($k, $address) ? $field.':'.$address[$k].',' : ''); + + $to_presta .= 'customer_firstname:'.(array_key_exists('first_name', $address) ? $address['first_name'] : '').',customer_lastname:'.(array_key_exists('last_name', $address) ? $address['last_name'] : ''); + + return rtrim($to_presta, ','); + } +} + diff --git a/modules/reverso/reverso.tpl b/modules/reverso/reverso.tpl new file mode 100644 index 000000000..aaeed42c3 --- /dev/null +++ b/modules/reverso/reverso.tpl @@ -0,0 +1,39 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$reverso_tag} + + + diff --git a/modules/reverso/reverso_check.php b/modules/reverso/reverso_check.php new file mode 100644 index 000000000..c61f9fde2 --- /dev/null +++ b/modules/reverso/reverso_check.php @@ -0,0 +1,41 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +require_once(dirname(__FILE__).'/reverso.php'); + +if (!class_exists('Reverso')) + Tools::d(Tools::displayError('Error in loading Reverso')); + +$reverso = new Reverso(); +if (!Validate::isLoadedObject($reverso)) + Tools::d(Tools::displayError('Error in loading Reverso')); + +$reverso_result = $reverso->callReverso(pSQL(Tools::getValue('phone'))); + +echo $reverso_result; +exit; + diff --git a/modules/secuvad/classes/PaymentCC.php b/modules/secuvad/classes/PaymentCC.php new file mode 100644 index 000000000..e3f0c2d48 --- /dev/null +++ b/modules/secuvad/classes/PaymentCC.php @@ -0,0 +1,64 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class PaymentCC extends ObjectModel +{ + public $id_order; + public $id_currency; + public $amount; + public $transaction_id; + public $card_number; + public $card_brand; + public $card_expiration; + public $card_holder; + public $date_add; + + protected $fieldsRequired = array('id_currency', 'amount'); + protected $fieldsSize = array('transaction_id' => 254, 'card_number' => 254, 'card_brand' => 254, 'card_expiration' => 254, 'card_holder' => 254); + protected $fieldsValidate = array( + 'id_order' => 'isUnsignedId', 'id_currency' => 'isUnsignedId', 'amount' => 'isPrice', + 'transaction_id' => 'isAnything', 'card_number' => 'isAnything', 'card_brand' => 'isAnything', 'card_expiration' => 'isAnything', 'card_holder' => 'isAnything'); + + protected $table = 'payment_cc'; + protected $identifier = 'id_payment_cc'; + + public function getFields() + { + parent::validateFields(); + $fields['id_order'] = (int)($this->file); + $fields['id_currency'] = (int)($this->file); + $fields['amount'] = (float)($this->amount); + $fields['transaction_id'] = pSQL($this->transaction_id); + $fields['card_number'] = pSQL($this->card_number); + $fields['card_brand'] = pSQL($this->card_brand); + $fields['card_expiration'] = pSQL($this->card_expiration); + $fields['card_holder'] = pSQL($this->card_holder); + $fields['date_add'] = pSQL($this->date_add); + return $fields; + } +} + diff --git a/modules/secuvad/classes/Secuvad_connection.php b/modules/secuvad/classes/Secuvad_connection.php new file mode 100644 index 000000000..512b18206 --- /dev/null +++ b/modules/secuvad/classes/Secuvad_connection.php @@ -0,0 +1,180 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Secuvad_connection +{ + public $data; + public $idsecuvad; + public $url; + public $secuvad_orders; + private $secuvad_h; + + public function __construct($data, $idsecuvad, $url, &$secuvad_h) + { + $this->data = $data; + $this->idsecuvad = $idsecuvad; + $this->url = $url; + $this->secuvad_h = $secuvad_h; + } + + private function send($key) + { + $toReturn = 'false'; + $url = $this->url; + if ($key == 'bulk_transactions') + $post = 'siteid='.(int)(Configuration::get('SECUVAD_ID')).'&bulk_transactions='.$this->data; + else + $post = $key.'='.$this->data; + $ci = curl_init($url); + if ($ci === false) + { + $error = curl_error($ci); + $this->secuvad_h->secuvad_log("secuvad_connection.php::send() \n\t Error curl_init() : ".$error); + } + else + { + curl_setopt($ci, CURLOPT_POST, 1); + curl_setopt($ci, CURLOPT_POSTFIELDS, $post); + curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, FALSE); + + $headers = array('Content-type: text/xml;charset="utf-8"'); + $rep = curl_exec($ci); + + if ($rep === false) + { + $toReturn = 'false'; + $error = curl_error($ci); + $this->secuvad_h->secuvad_log('secuvad_connection.php::send() '."\n\t".' Error: curl_exec() : '.$error); + } + else + { + $toReturn = $rep; + $this->secuvad_h->secuvad_log('secuvad_connection.php::send() '."\n\t".' curl_exec() returned : '.$toReturn); + } + curl_close($ci); + } + return $toReturn; + } + + public function report_fraud($post, $balise) + { + $response = str_replace("\n", "", $this->send($post)); + $response = str_replace("\r", "", $response); + if (preg_match('#<'.$balise.'>.{0,4}([^<]*)<.transaction_report>.{0,4}<.'.$balise.'>#Ui', $response, $regs)) + { + $response = preg_replace('#<'.$balise.'>.{0,4}'.$regs[2].'<.transaction_report>.{0,4}<.'.$balise.'>#Ui','', $response); + $idtransaction = $regs[1]; + $feedback = $regs[2]; + if ($feedback == 'OK' AND ($balise == 'fraude_report' OR $balise == 'impaye_report')) + { + if ($balise == 'fraude_report') + $this->secuvad_h->secuvad_log('secuvad_connection.php::report_fraud() '."\n\t".' Fraud: '.(int)($idtransaction).'/'.$feedback); + elseif ($balise == 'impaye_report') + $this->secuvad_h->secuvad_log('secuvad_connection.php::report_fraud() '."\n\t".' Unpaid: '.(int)($idtransaction).'/'.$feedback); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `is_fraud` = 1 + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + return 'true'; + } + else + { + $this->secuvad_h->secuvad_log('secuvad_connection.php::report_fraud() '."\n\t".' Error: '.(int)($idtransaction).'/'.$feedback); + return $feedback; + } + } + else + return 'Erreur de connexion'; + } + + + public function send_transaction() + { + global $currentIndex, $cookie; + + $flag_rep = false; + $response = str_replace("\n", "", $this->send('bulk_transactions')); + $response = str_replace("\r", "", $response); + + if (preg_match('#([0-9]*)<.score>([^<]*)([^<]*)<.error><.transaction_report>#Ui', $response, $regs)) + { + $flag_rep = true; + $response = preg_replace("#".$regs[2]."<.score>".$regs[3]."".$regs[4]."<.error><.transaction_report>#Ui","", $response); + + $idtransaction = $regs[1]; + $score = $regs[2]; + $advice = $regs[3]; + $erreur = $regs[4]; + + if (!empty($erreur)) + { + $this->secuvad_h->secuvad_log('secuvad_connection.php::send_transaction() '."\n\t".' Error: '.$erreur); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `secuvad_status` = 4, `error` = \''.pSQL($erreur).'\' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + } + else + { + $this->secuvad_h->secuvad_log('secuvad_connection.php::send_transaction() '."\n\t".' Response: '.(int)($idtransaction).'/'.(int)($score).'/'.$advice); + if(preg_match('/[0-9]+/', $score)) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `secuvad_status` = 5, `score` = '.(int)($score).', error = \'\' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + else + { + if (strtoupper($advice) == 'INVALIDE') + $secuvad_status = 3; + elseif (strtoupper($advice) == 'VALIDE') + $secuvad_status = 1; + elseif (strtoupper($advice) == 'A EXPERTISER') + $secuvad_status = 7; + elseif (strtoupper($advice) == 'A EXPERTISER C') + $secuvad_status = 6; + elseif (strtoupper($advice) == 'EN ATTENTE') + $secuvad_status = 2; + else + $secuvad_status = 4; + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `advice` = \''.pSQL($advice).'\', `error` = \'\', `secuvad_status` = '.(int)($secuvad_status).' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + } + } + } + if (preg_match('#([^<]*)<.global_report>([^<]+)<.error><.bulk_report>#Ui', $response, $regs)) + { + $flag_rep = true; + $this->secuvad_h->secuvad_log('secuvad_connection.php::send_transaction() '."\n\t".' Error: '.$regs[2]); + } + if (!$flag_rep) + $this->secuvad_h->secuvad_log('secuvad_connection.php::send_transaction() '."\n\t".' Error: '.$rep); + } +} + diff --git a/modules/secuvad/classes/Secuvad_flux.php b/modules/secuvad/classes/Secuvad_flux.php new file mode 100644 index 000000000..2a8a197e5 --- /dev/null +++ b/modules/secuvad/classes/Secuvad_flux.php @@ -0,0 +1,237 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Secuvad_flux +{ + public $encoding = 'utf-8'; + public $flux_xml; + public $id_order; + public $imp_time; + public $idsecuvad; + + function __construct($idsecuvad, $encoding) + { + $this->idsecuvad = $idsecuvad; + $this->encoding = $encoding; + } + + public function get_flux_xml_fraud($id_order) + { + $this->id_order = (int)($id_order); + $this->imp_time = date("Y-m-d H:i:s"); + $this->flux_xml = 'encoding.'" ?>' . "\n"; + $this->flux_xml .= ''.$this->idsecuvad.''.(int)($this->id_order).''.$this->imp_time.''; + + return ($this->flux_xml); + } + + function get_flux_xml($id_order) + { + $this->id_order = (int)($id_order); + $this->flux_xml = ''; + $this->flux_xml .= 'encoding.'" ?>' . "\n"; + $this->flux_xml .= '' . "\n"; + $this->flux_xml .= $this->get_flux_xml_order(); + $this->flux_xml .= '' . "\n"; + return $this->flux_xml; + } + + private function get_flux_xml_order() + { + global $cookie; + + $order = new Order((int)($this->id_order)); + $address_delivery = new Address((int)($order->id_address_delivery)); + $address_invoice = new Address((int)($order->id_address_invoice)); + $customer = new Customer((int)($order->id_customer)); + $currency = new Currency((int)($order->id_currency)); + $carrier = new Carrier((int)($order->id_carrier)); + + $ip = Db::getInstance()->getValue(' + SELECT `ip` + FROM `'._DB_PREFIX_.'secuvad_order` + WHERE `id_secuvad_order` = '.(int)($this->id_order)); + if (!$ip) + return false; + $payment_cc = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'payment_cc` + WHERE `id_order` = '.(int)($this->id_order)); + if ($payment_cc) + { + $card_number = $payment_cc['card_number']; + $card_expiration = $payment_cc['card_expiration']; + } + + $carrier = Db::getInstance()->getRow(' + SELECT at.`transport_id`, td.`transport_delay_name` + FROM `'._DB_PREFIX_.'secuvad_assoc_transport` at + JOIN `'._DB_PREFIX_.'secuvad_transport_delay` td ON (at.`transport_delay_id` = td.`transport_delay_id`) + JOIN `'._DB_PREFIX_.'lang` l ON (l.`id_lang` = td.`id_lang`) + WHERE l.`id_lang` = '.((isset($cookie->id_lang) AND (int)($cookie->id_lang)) ? (int)($cookie->id_lang) : (int)(Configuration::get('PS_LANG_DEFAULT'))).' + AND at.`id_carrier` = '.(int)($order->id_carrier)); + $transptype = $carrier['transport_id']; + $rapidite = $carrier['transport_delay_name']; + + $code_payment = Db::getInstance()->getValue(' + SELECT sap.`code` + FROM `'._DB_PREFIX_.'module` m + JOIN `'._DB_PREFIX_.'secuvad_assoc_payment` sap ON (m.`id_module` = sap.`id_module`) + WHERE m.`name` = \''.pSQL($order->module).'\''); + + $flux_xml = "\n"; + switch ($customer->id_gender) + { + case 1: + $gender = 'M'; + break; + case 2: + $gender = 'Mme'; + break; + case 3: + $gender = 'Mlle'; + break; + default: + $gender = 'M'; + break; + } + + if($address_invoice->company == '') + $flux_xml .= ''."\n"; + else + $flux_xml .= ''."\n"; + $flux_xml .= ''.$address_invoice->lastname.''."\n"; + $flux_xml .= ''.$address_invoice->firstname.''."\n"; + if($address_invoice->company != '') + $flux_xml .= ''.$address_invoice->company.''."\n"; + $flux_xml .= ''.$address_invoice->phone.''."\n"; + $flux_xml .= ''.$address_invoice->phone_mobile.''."\n"; + $flux_xml .= ''.$customer->email.''."\n"; + $flux_xml .= ''; + + $flux_xml .= ''."\n"; + $flux_xml .= ''.$address_invoice->address1.''."\n"; + $flux_xml .= ''.$address_invoice->address2.''."\n"; + $flux_xml .= ''.$address_invoice->postcode.''."\n"; + $flux_xml .= ''.$address_invoice->city.''."\n"; + $flux_xml .= ''.$address_invoice->country.''."\n"; + $flux_xml .= ''."\n"; + + $flux_xml .= ''."\n"; + $flux_xml .= ''.$address_delivery->address1.''."\n"; + $flux_xml .= ''.$address_delivery->address2.''."\n"; + $flux_xml .= ''.$address_delivery->postcode.''."\n"; + $flux_xml .= ''.$address_delivery->city.''."\n"; + $flux_xml .= ''.$address_delivery->country.''."\n"; + $flux_xml .= ''."\n"; + + $flux_xml .= ''."\n"; + $flux_xml .= ''.$this->idsecuvad.''."\n"; + $flux_xml .= ''.(int)($this->id_order).''."\n"; + $flux_xml .= ''.$order->date_add.''."\n"; + $flux_xml .= ''.$order->total_paid_real.''."\n"; + $flux_xml .= ''.$order->total_shipping.''."\n"; + $flux_xml .= ''.$ip.''."\n"; + $flux_xml .= ''."\n"; + $flux_xml .= $this->get_flux_xml_products(); + $flux_xml .= ''."\n"; + + $flux_xml .= ''."\n"; + $flux_xml .= ''."\n"; + if($code_payment == 'cheque') + $flux_xml .= ''."\n"; + elseif($code_payment == 'virement') + $flux_xml .= ''."\n"; + elseif($code_payment == 'paypal') + $flux_xml .= ''."\n"; + elseif($code_payment == 'cb en n fois') + $flux_xml .= ''."\n"; + elseif($code_payment == 'contre-remboursement') + $flux_xml .= ''."\n"; + elseif($code_payment == "carte") + { + if (!empty($card_number)) + { + $cc_array = preg_split('/([X0-9]{4})/Ui', strtoupper($card_number), -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + + if (sizeof($cc_array)) + { + $bin_array = array(); + foreach ($cc_array as $element) + $bin_array[] = str_replace('X', '', $element); + + $card_number = str_replace('X', '', $card_number); // 16 char + $bin = $bin_array[0].'-'.$bin_array[1]; // 6 char + $bin4 = $bin_array[0]; // 4 char + $bin42 = $bin_array[0].'-'.$bin_array[3]; // 6 char + + if (strlen($bin42) != 7 AND strlen($bin4) != 4 AND strlen($bin) != 7 AND strlen($card_number) != 16) + return false; + + $flux_xml .= ''."\n"; + } + else + return false; + } + else + return false; + } + $flux_xml .= ''."\n"; + $flux_xml .= ''."\n"; + $flux_xml .= ''."\n"; + + return $flux_xml; + } + + private function get_flux_xml_products() + { + global $cookie; + + $flux_xml = ''; + $order = new Order((int)($this->id_order)); + $products = $order->getProducts(); + foreach($products as $product) + { + $data = Db::getInstance()->getRow(' + SELECT sac.`category_id`, pl.`name` + FROM `'._DB_PREFIX_.'secuvad_assoc_category` sac + JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = sac.`id_category`) + JOIN `'._DB_PREFIX_.'category` c ON (c.`id_category` = cp.`id_category`) + JOIN `'._DB_PREFIX_.'product_lang` pl ON (cp.`id_product` = pl.`id_product`) + JOIN `'._DB_PREFIX_.'lang` l ON (l.`id_lang` = pl.`id_lang` AND l.`id_lang` = '.((isset($cookie->id_lang) AND (int)($cookie->id_lang)) ? (int)($cookie->id_lang) : (int)(Configuration::get('PS_LANG_DEFAULT'))).') + WHERE pl.`id_product` = '.(int)($product['product_id']).' + ORDER BY c.`level_depth` DESC + ',true); + $flux_xml .= ''."\n"; + } + $flux_xml = ''."\n".$flux_xml.''."\n"; + return $flux_xml; + } + +} + + diff --git a/modules/secuvad/config.xml b/modules/secuvad/config.xml new file mode 100755 index 000000000..3768d65cd --- /dev/null +++ b/modules/secuvad/config.xml @@ -0,0 +1,12 @@ + + + secuvad + Secuvad module + 2.0.1 + Solution fighting against online fraud + + payment_security + Are you sure you want to delete this module? + 1 + 1 + \ No newline at end of file diff --git a/modules/secuvad/de.php b/modules/secuvad/de.php new file mode 100644 index 000000000..532342029 --- /dev/null +++ b/modules/secuvad/de.php @@ -0,0 +1,114 @@ +secuvad_e4ba26360a7818a71d48addc3ea19078'] = 'Secuvad Modul'; +$_MODULE['<{secuvad}prestashop>secuvad_ebedf7d0e130dbb2afd22987ff22708b'] = 'Lösung für den Kampf gegen Online-Betrug'; +$_MODULE['<{secuvad}prestashop>secuvad_a9828808bf0dcd0b7af8e6f20b80ad85'] = 'Sie sind sicher, dass Sie dieses Modul löschen möchten?'; +$_MODULE['<{secuvad}prestashop>secuvad_307bfa08da823ee566ce867b563eb223'] = 'Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_8fbc70c37e2deff790fe4e95fce7c9d8'] = 'Um denSecuvad Schutz zu verwenden, konfigurieren Sie bitte Ihr Modul.'; +$_MODULE['<{secuvad}prestashop>secuvad_d3dd6e2937eb4430278bce947553b7ca'] = 'Secuvad Status:'; +$_MODULE['<{secuvad}prestashop>secuvad_163f6b2856a83d0bb03aee72f8f072a5'] = 'Übermittelte offene Zahlungen'; +$_MODULE['<{secuvad}prestashop>secuvad_f3182252d448607de30d2b4cfe420db1'] = 'Secuvad Status aktualisieren'; +$_MODULE['<{secuvad}prestashop>secuvad_af7fdbd69d96ddaba932d48c45b89dcf'] = 'Ein offene Zahlung übermitteln '; +$_MODULE['<{secuvad}prestashop>secuvad_ef1168698f5c33450f0d3166da5e4740'] = 'Bitte beachten Sie, dass Sie durch die Übergabe solcher offenen Zahlungen an SECUVAD bestätigen, dass Ihre Forderung stimmt, flüssig und zahlbar ist, und dass Sie SECUVAD EXKLUSIV die Deckung der Beträge anvertrauen. Möchten Sie fortfahren?'; +$_MODULE['<{secuvad}prestashop>secuvad_85b94c96da82beb688084f64adfbf185'] = 'Secuvad Konfiguration'; +$_MODULE['<{secuvad}prestashop>secuvad_04d45d9f5ece926babe251d7b628ecca'] = 'Die Zahlungs- CC Datei ist nicht vorhanden, kopieren Sie bitte diese Datei in das Klassen-Verzeichnis Ihres Prestashop'; +$_MODULE['<{secuvad}prestashop>secuvad_2113b53bbb4a93786e042937cd04f21f'] = 'Bitte konfigurieren Sie alle Verknüpfungen'; +$_MODULE['<{secuvad}prestashop>secuvad_062f3f5ae8644882a2da949705ced1ac'] = 'Wenn Sie bereits ein Konto haben'; +$_MODULE['<{secuvad}prestashop>secuvad_0e79ca3a8ef61f2ec317e5734082de3f'] = 'Firmentyp ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_73c23113d237a4f8e56df46745d9e08e'] = 'Firmenname ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_a5253c7f1e4f48d55eb46507f9af21e3'] = 'Kapital ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_c99b7e43f604b6c71a06336b727d99b9'] = 'Webseite ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_5b550fbcefc1b473adff36761fbc97fd'] = 'Adresse ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_7b3bad39fc3ac5b25ae0523e6d58be68'] = 'PLZ ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_ceb8e9adca824ee71883fce1612e9fea'] = 'Stadt ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_3f1e50fba8ee7cc383eb164c7d5d0fb9'] = 'Land ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_c678a6253de57c93c0ab007d23a119c6'] = 'RCS ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_b5061793e15ec84cd10f3b299d1f51a2'] = 'Siren ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_8c97e587c1b4e519bec26f3903561da3'] = 'Sie müssen mindestens eine Kategorie wählen'; +$_MODULE['<{secuvad}prestashop>secuvad_e0d398bfe015c1cc6fbd01fa9bcafb71'] = 'Titel ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_9bd987e611b01bc320c4b41fd0f44cb0'] = 'Nachname ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_d4a7da3641038f3a960339e8880297e4'] = 'Vorname ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_b3871d55ec4fd5d776a9411b8a3286d8'] = 'Funktion ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_d9a821ab8ae9651b6e4a11798bb4fd39'] = 'E-Mail-Name ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_7f203a223defb75e34e9949e9054511a'] = 'Telefon ist ungültig'; +$_MODULE['<{secuvad}prestashop>secuvad_a6f2a48726b0d36107e00e20795d3d37'] = 'Ungültige Login'; +$_MODULE['<{secuvad}prestashop>secuvad_cba0b206627d45fbf0ae707e20d4a38f'] = 'Ungültiges Kennwort'; +$_MODULE['<{secuvad}prestashop>secuvad_12477418db51dc813000335f72b9fcf2'] = 'Ungültiger Modus'; +$_MODULE['<{secuvad}prestashop>secuvad_c1c8a564c10a0efe07bb4e4b20d88cc9'] = 'Ungültige ID'; +$_MODULE['<{secuvad}prestashop>secuvad_7ccf58c950043c9fbfed668df13ce608'] = 'Einstellungen werden aktualisiert'; +$_MODULE['<{secuvad}prestashop>secuvad_5a7f1ef0cabc9cac6fc4ef1c2eba2eb4'] = 'Fehler beim Aktualisieren'; +$_MODULE['<{secuvad}prestashop>secuvad_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{secuvad}prestashop>secuvad_051672911a3f1f05efba78a553ef6fe2'] = 'Login:'; +$_MODULE['<{secuvad}prestashop>secuvad_b341a59d5636ed3d6a819137495b08a0'] = 'Kennwort:'; +$_MODULE['<{secuvad}prestashop>secuvad_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{secuvad}prestashop>secuvad_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{secuvad}prestashop>secuvad_756d97bb256b8580d4d71ee0c547804e'] = 'Betrieb'; +$_MODULE['<{secuvad}prestashop>secuvad_e0f0b0564d3d29a93fad7a4178b7b1ca'] = 'ID:'; +$_MODULE['<{secuvad}prestashop>secuvad_94966d90747b97d1f0f206c98a8b1ac3'] = 'Senden'; +$_MODULE['<{secuvad}prestashop>secuvad_8cf04a9734132302f96da8e113e80ce5'] = 'Startseite'; +$_MODULE['<{secuvad}prestashop>secuvad_201095b8aa27cc3bd5e6dcc407ab2bdb'] = 'Secuvad Kategorien'; +$_MODULE['<{secuvad}prestashop>secuvad_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{secuvad}prestashop>secuvad_116b7a3c4f415260f5a0d9a9d3a49f97'] = 'Secuvad Kategorie'; +$_MODULE['<{secuvad}prestashop>secuvad_7a0de9003696a0e833694b22a5ea6d91'] = 'Secuvad Zahlung'; +$_MODULE['<{secuvad}prestashop>secuvad_593bda837f8ae222993fc189457c92a0'] = 'Secuvad Zahlungsart'; +$_MODULE['<{secuvad}prestashop>secuvad_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt'; +$_MODULE['<{secuvad}prestashop>secuvad_68eb4e159f449c625edb23b2c35e7259'] = 'Secuvad Lieferant'; +$_MODULE['<{secuvad}prestashop>secuvad_7cc72fb5b56d882a4c34cb68dd4604aa'] = 'Secuvad Lieferfrist'; +$_MODULE['<{secuvad}prestashop>secuvad_de5744adc681a40f1b0fe16f3707da5b'] = 'Um das Secuvad Modul zu verwenden, füllen Sie bitte dieses Formular aus, klicken Sie dann auf \"Registrieren\"'; +$_MODULE['<{secuvad}prestashop>secuvad_6bf36964a57a5eaa5f46504ca9882cdb'] = 'Firmentyp:'; +$_MODULE['<{secuvad}prestashop>secuvad_c700e3beca05135eca91df55981402f5'] = 'SARL'; +$_MODULE['<{secuvad}prestashop>secuvad_3dd6b9265ff18f31dc30df59304b0ca7'] = 'SA'; +$_MODULE['<{secuvad}prestashop>secuvad_e00147cd1ed977d431491ce5c1b02f8a'] = 'EURL'; +$_MODULE['<{secuvad}prestashop>secuvad_2db46c628cfb3bd1545d3b5a14b4a9c5'] = 'SAS'; +$_MODULE['<{secuvad}prestashop>secuvad_d3cc996e019ec9721479e63b2fd622d8'] = 'Einzelunternehmen'; +$_MODULE['<{secuvad}prestashop>secuvad_57aab2fcd93938cfbca356bb5571b25b'] = 'SNC'; +$_MODULE['<{secuvad}prestashop>secuvad_5e116ceb48a98fb755f22df7ea1e2396'] = 'Firmenname:'; +$_MODULE['<{secuvad}prestashop>secuvad_7b1b1d6f1a6793e17aeeffa80ac8fdaa'] = 'Kapital:'; +$_MODULE['<{secuvad}prestashop>secuvad_e5cb8489f57db7c15eed3258e48cd5f3'] = 'Webseite:'; +$_MODULE['<{secuvad}prestashop>secuvad_2bf1d5fae1c321d594fdedf05058f709'] = 'Adresse:'; +$_MODULE['<{secuvad}prestashop>secuvad_8116ea5ccd73f945bb5e260861b0b570'] = 'Postleitzahl:'; +$_MODULE['<{secuvad}prestashop>secuvad_bffb711ec36f280459d11dce315da72f'] = 'Stadt:'; +$_MODULE['<{secuvad}prestashop>secuvad_f64be5eef68442a8f50cf535b92ad3e4'] = 'Land:'; +$_MODULE['<{secuvad}prestashop>secuvad_51bdf131ea9fab11d517cc19fe5d8d73'] = 'RCS:'; +$_MODULE['<{secuvad}prestashop>secuvad_f4e462b9ed48a0e96da9730875f9dd58'] = 'Siren:'; +$_MODULE['<{secuvad}prestashop>secuvad_70397c4b252a5168c5ec003931cea215'] = 'Pflichtfelder'; +$_MODULE['<{secuvad}prestashop>secuvad_0e0f3e0ad86de8103ac0f5c74726da24'] = 'Produkttypen'; +$_MODULE['<{secuvad}prestashop>secuvad_432d0563f8721b5285e5bd18c0aee4ea'] = 'Kategorien Ihrer Produkte:'; +$_MODULE['<{secuvad}prestashop>secuvad_7d0ba2d2a3223badb6f7b026946fc16d'] = 'Firmendaten'; +$_MODULE['<{secuvad}prestashop>secuvad_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titel:'; +$_MODULE['<{secuvad}prestashop>secuvad_2c9b5b15a6d3cc951ca57c65e4966fd3'] = 'Herr'; +$_MODULE['<{secuvad}prestashop>secuvad_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Frau'; +$_MODULE['<{secuvad}prestashop>secuvad_e7ddb7cd777b59610b220bcfa80bd95f'] = 'Fräulein'; +$_MODULE['<{secuvad}prestashop>secuvad_be5e0b5d50d48b049bd0f7b57cd163f9'] = 'Nachname:'; +$_MODULE['<{secuvad}prestashop>secuvad_668a8d8d7ffe5da112b266e46b79b685'] = 'Vorname:'; +$_MODULE['<{secuvad}prestashop>secuvad_6a858980896cb9daee81930c61bc1696'] = 'Funktion:'; +$_MODULE['<{secuvad}prestashop>secuvad_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{secuvad}prestashop>secuvad_673ae02fffb72f0fe68a66f096a01347'] = 'Telefon:'; +$_MODULE['<{secuvad}prestashop>secuvad_7dce122004969d56ae2e0245cb754d35'] = 'Bearbeiten'; +$_MODULE['<{secuvad}prestashop>secuvad_0ba7583639a274c434bbe6ef797115a4'] = 'Registrieren'; +$_MODULE['<{secuvad}prestashop>secuvad_2f8531293ddfd4f30bb978e93d49f650'] = 'Mail:'; +$_MODULE['<{secuvad}prestashop>secuvad_42dbbc555675ff22f80115c0570de888'] = 'VorgansbBeschreibung:'; +$_MODULE['<{secuvad}prestashop>secuvad_401886eb11224f37cbbd93211e991c85'] = 'Protokoll-Dateien:'; +$_MODULE['<{secuvad}prestashop>secuvad_fa29ad39f28d8d3a9b873ac37dec2899'] = 'Fehlerbericht'; +$_MODULE['<{secuvad}prestashop>secuvad_a649552939461a1cce6c2d77e2de44d0'] = 'Folgende Zahlungsmodule sind nicht zugeordnet:'; +$_MODULE['<{secuvad}prestashop>secuvad_b0d7bc21f644e151a6dec99181ac0718'] = 'Folgende Versandmodule sind nicht zugeordnet:'; +$_MODULE['<{secuvad}prestashop>secuvad_68a569c0346cff10b9626e27fae1de48'] = 'Folgende Kategorien sind nicht zugeordnet:'; +$_MODULE['<{secuvad}prestashop>secuvad_a1d333dc75f4e131835c8104c4b2d966'] = 'Fehler bei der Aktivierung'; +$_MODULE['<{secuvad}prestashop>secuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Fehler'; +$_MODULE['<{secuvad}prestashop>secuvad_7fd791b8ff524778a13d978ff04f0bb9'] = 'Unmöglich, Betrug zu melden vor dem Absenden der entsprechenden Bestellung'; +$_MODULE['<{secuvad}prestashop>secuvad_2e92ae79ff32b37fee4368a594792183'] = 'Verbindungsfehler'; +$_MODULE['<{secuvad}prestashop>secuvad_2d7839314eb05f8988381b70dbc1548b'] = 'Ist kein Betrug'; +$_MODULE['<{secuvad}prestashop>secuvad_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{secuvad}prestashop>secuvad_1b93ce75458ea0ce94250a781ff0835e'] = 'Ist ein Betrug'; +$_MODULE['<{secuvad}prestashop>secuvad_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{secuvad}prestashop>secuvad_830560d945b2aa75e58b6f0b7ffe0882'] = 'Nicht a Secuvad gesendet'; +$_MODULE['<{secuvad}prestashop>secuvad_3d0362bcbb2783e82be0612668eb7ce9'] = 'Bestätigt durch Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_999dfff14d541898b1c7266c3c271d40'] = 'Analysiert'; +$_MODULE['<{secuvad}prestashop>secuvad_a464f32e0e54df4786e7d905577b7f0c'] = 'Verdächtige Bestellung'; +$_MODULE['<{secuvad}prestashop>secuvad_f6ba219e7a45632ab4d39822108d68f3'] = 'Muss vom Kunden überprüft werden'; +$_MODULE['<{secuvad}prestashop>secuvad_e2cadc35c8d021861738765b25666ebb'] = 'Muss von Secuvad überprüft werden'; +$_MODULE['<{secuvad}prestashop>secuvad_config_8bcaf785d6c5771e3c49bd90e0885c2a'] = 'Hackversuch'; +$_MODULE['<{secuvad}prestashop>secuvad_config_1f4eee5122ff1dfb7c7ff3aa8e879222'] = 'Kein autorisierter Zugriff'; +$_MODULE['<{secuvad}prestashop>secuvad_config_635c1728fc02b144a4357007b44d55b7'] = 'Die gesendeten Daten sind:'; diff --git a/modules/secuvad/en.php b/modules/secuvad/en.php new file mode 100644 index 000000000..62af5abcb --- /dev/null +++ b/modules/secuvad/en.php @@ -0,0 +1,101 @@ +AdminSecuvad_e77d1c075ac8442c061e9b97c1be30e1'] = 'Valide'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_3b2bcaaa719709957ea65f7b554da650'] = 'Fraud'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_830560d945b2aa75e58b6f0b7ffe0882'] = 'Not sent to Secuvad'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_e734be84875a28b47281b9288ddbf5c9'] = 'Valide order'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_f611e08cffb261d08d536dc0b3e3cce3'] = 'Analysing'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_a464f32e0e54df4786e7d905577b7f0c'] = 'Suspect order'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Error'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_5dd135d1bcfa7f63c3b7f25425c2a4a1'] = 'Score'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_ce26601dac0dea138b7295f02b7620a7'] = 'Customer'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_ec53a8c4f07baed5d8825072c89799be'] = 'Status'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_b130f12d0f2e4cc10edbe80fe31738dc'] = 'Fraud'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_0ca88066c014448b3922d433bfcbda98'] = 'Advice'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_39f0dc2e628c524bb4508e96fb2bb8c2'] = 'Report sent'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_64be8347a1f66883b245658d9c5fd2d2'] = 'Send an error report to Secuvad'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_1e884e3078d9978e216a027ecd57fb34'] = 'E-mail'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_20b97fe763e2c83e86ad13c5deab2793'] = 'Problem'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_548e51fa67d541384e9585adf0db95dc'] = 'SEND'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_a240fa27925a635b08dc28c9e4f9216d'] = 'Order'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_6a3a15bb9cf9363939c4a185bab2baa8'] = 'Submit order'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_0793107616f0dd23aeb93f6333e4497a'] = 'Report fraud'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_a289f218c10d38d0c2d5893d6f66e2e0'] = 'Order sent'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_cd0f4554faa0a407e62e61e75fefe215'] = 'Impossible to report fraud before submiting the associated order'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_ccc693a747385bc315564d772b46a096'] = 'Fraud reported'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_d2354a0232ac2c6b5733ea81e9b92775'] = 'Connection error'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_cff75be08dec22be91f1e35b8ff11c69'] = 'Association payment missing'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_6a1388142be79a7d239f7a3b383af476'] = 'Association shipping missing'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_27b56e2cd17fda9b2079154b45224368'] = 'Association category missing'; +$_MODULE['<{secuvad}prestashop>AdminSecuvad_8207142adb1f99448ea323f057348d6c'] = 'To use this service you have to record'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Category'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_feb25f4827fd0ffc7180fe60fad65e9c'] = 'Secuvad category'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_9fbf44c45663e9ebd4660bf1f39fccff'] = 'Category associated'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_acc9e4f383a2fe511526e54f95f5c735'] = 'Associate the category'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_c9759ceb6487a0bd2720ca98f2622d24'] = 'to'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadCategory_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_e55f75a29310d7b60f7ac1d390c8ae42'] = 'Payment module'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_307bfa08da823ee566ce867b563eb223'] = 'Payment mode'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_55059c1f396617c3e8d7b5cce9a38dc1'] = 'Payment associated'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_593fbedbfba012f2191dbf4cdcff9102'] = 'Associate the payment module'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_c9759ceb6487a0bd2720ca98f2622d24'] = 'to'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadPayment_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_914419aa32f04011357d3b604a86d7eb'] = 'Carrier'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_7579788079ec44e74eed653179a3383f'] = 'Shipping type'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_e217d047544934933fcb276951ffe1cf'] = 'Delay'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_cfba8bb4d48ec796dfb51beff1578eea'] = 'Shipping associated'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_57865bf4056d8da5e67c992e84d91814'] = 'Associate the shipping'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_c9759ceb6487a0bd2720ca98f2622d24'] = 'to'; +$_MODULE['<{secuvad}prestashop>AdminSecuvadTransport_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; +$_MODULE['<{secuvad}prestashop>secuvad_e4ba26360a7818a71d48addc3ea19078'] = 'Secuvad module'; +$_MODULE['<{secuvad}prestashop>secuvad_8dfaf37c512f96f126f30e0f5cfbf320'] = 'Solution fighting against online frauds'; +$_MODULE['<{secuvad}prestashop>secuvad_a9828808bf0dcd0b7af8e6f20b80ad85'] = 'Are you sure you want to delete this module ?'; +$_MODULE['<{secuvad}prestashop>secuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Error'; +$_MODULE['<{secuvad}prestashop>secuvad_d3c779f2eff6d9bc3075bcbbabfd5afc'] = 'classes/PaymentModule.php missing'; +$_MODULE['<{secuvad}prestashop>secuvad_34d9eb70abf213ddff973fdff966ee88'] = 'Cannot read file classes/PaymentModule.php'; +$_MODULE['<{secuvad}prestashop>secuvad_272ac5599c0472cb373c617889f1c0d7'] = 'Cannot open file classes/PaymentModule.php on write mode'; +$_MODULE['<{secuvad}prestashop>secuvad_79f6a7cbdbec503b44bd8914a0a300ec'] = 'Cannot write into file classes/PaymentModule.php'; +$_MODULE['<{secuvad}prestashop>secuvad_3cd2cc055bf498ff13338c1690b72ba4'] = 'classes/PaymentModule.php is not writable'; +$_MODULE['<{secuvad}prestashop>secuvad_98b37f1d9af13040deac790c688c21f1'] = 'classes/PaymentModule.php not recognised'; +$_MODULE['<{secuvad}prestashop>secuvad_4f012eecd63b26d04225003668d08694'] = 'Already recorded'; +$_MODULE['<{secuvad}prestashop>secuvad_0f025176fb8b953690ad8f20f119ed75'] = 'COMPANY'; +$_MODULE['<{secuvad}prestashop>secuvad_abf4c8ff520e20fa12dc0dc39f58f9f4'] = 'Company type'; +$_MODULE['<{secuvad}prestashop>secuvad_c281f92b77ba329f692077d23636f5c9'] = 'Company name'; +$_MODULE['<{secuvad}prestashop>secuvad_27f08504c8e23c89383aa5ad890892e9'] = 'capital'; +$_MODULE['<{secuvad}prestashop>secuvad_15bbb9d0bbf25e8d2978de1168c749dc'] = 'Website'; +$_MODULE['<{secuvad}prestashop>secuvad_e839622d891ff633bc0e4f9f47445233'] = 'HEADQUARTER'; +$_MODULE['<{secuvad}prestashop>secuvad_dd7bf230fde8d4836917806aff6a6b27'] = 'Address'; +$_MODULE['<{secuvad}prestashop>secuvad_572ed696f21038e6cc6c86bb272a3222'] = 'Postal code'; +$_MODULE['<{secuvad}prestashop>secuvad_57d056ed0984166336b7879c2af3657f'] = 'City'; +$_MODULE['<{secuvad}prestashop>secuvad_59716c97497eb9694541f7c3d37b1a4d'] = 'Country'; +$_MODULE['<{secuvad}prestashop>secuvad_5852281688f5bba8ddab1a5c7a2a3c6b'] = 'RCS'; +$_MODULE['<{secuvad}prestashop>secuvad_58a84e851e55175d22158ca97af58a1f'] = 'Siren'; +$_MODULE['<{secuvad}prestashop>secuvad_de0e59337080aa9d487ea25375ab4fa1'] = 'REPRESENTATIVE'; +$_MODULE['<{secuvad}prestashop>secuvad_a1e8db7dba8f18eff1391b2eda88b14c'] = 'Civility'; +$_MODULE['<{secuvad}prestashop>secuvad_8d3f5eff9c40ee315d452392bed5309b'] = 'Last name'; +$_MODULE['<{secuvad}prestashop>secuvad_20db0bfeecd8fe60533206a2b5e9891a'] = 'First name'; +$_MODULE['<{secuvad}prestashop>secuvad_86408593c34af77fdd90df932f8b5261'] = 'Function'; +$_MODULE['<{secuvad}prestashop>secuvad_c914477b7443f8b5344304a910b273e1'] = 'PRODUCT TYPES'; +$_MODULE['<{secuvad}prestashop>secuvad_548e51fa67d541384e9585adf0db95dc'] = 'SEND'; +$_MODULE['<{secuvad}prestashop>secuvad_554bd6f99175b80414595911cb8f2e3b'] = 'Recording'; +$_MODULE['<{secuvad}prestashop>secuvad_c700e3beca05135eca91df55981402f5'] = 'SARL'; +$_MODULE['<{secuvad}prestashop>secuvad_3dd6b9265ff18f31dc30df59304b0ca7'] = 'SA'; +$_MODULE['<{secuvad}prestashop>secuvad_e00147cd1ed977d431491ce5c1b02f8a'] = 'EURL'; +$_MODULE['<{secuvad}prestashop>secuvad_2db46c628cfb3bd1545d3b5a14b4a9c5'] = 'SAS'; +$_MODULE['<{secuvad}prestashop>secuvad_35b52a2945b0225ee8d0f95a01701e1c'] = 'Entreprise individuelle'; +$_MODULE['<{secuvad}prestashop>secuvad_57aab2fcd93938cfbca356bb5571b25b'] = 'SNC'; +$_MODULE['<{secuvad}prestashop>secuvad_c56ccc6a1321e66ddd94fe430b8a1f82'] = 'Capital'; +$_MODULE['<{secuvad}prestashop>secuvad_2c9b5b15a6d3cc951ca57c65e4966fd3'] = 'Mr'; +$_MODULE['<{secuvad}prestashop>secuvad_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Mrs'; +$_MODULE['<{secuvad}prestashop>secuvad_e7ddb7cd777b59610b220bcfa80bd95f'] = 'Miss'; +$_MODULE['<{secuvad}prestashop>secuvad_307bfa08da823ee566ce867b563eb223'] = 'Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_bcc254b55c4a1babdf1dcb82c207506b'] = 'Phone number'; +$_MODULE['<{secuvad}prestashop>secuvad_082e55a73f10496681c84231dc1c88f7'] = 'E-Mail'; +$_MODULE['<{secuvad}prestashop>secuvad_e89ab59baea830bd940c300886c50efe'] = 'All fields are mandatory.'; +$_MODULE['<{secuvad}prestashop>secuvad_0b79795d3efc95b9976c7c5b933afce2'] = 'In order to activate you SECUVAD plug\'in, please fill the following form :'; +$_MODULE['<{secuvad}prestashop>secuvad_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Press SEND to submit your activation form or BACK to modify.'; +$_MODULE['<{secuvad}prestashop>secuvad_421cfd143e450c3f5814a0495409e073'] = 'BACK'; \ No newline at end of file diff --git a/modules/secuvad/es.php b/modules/secuvad/es.php new file mode 100644 index 000000000..9d0255358 --- /dev/null +++ b/modules/secuvad/es.php @@ -0,0 +1,114 @@ +secuvad_e4ba26360a7818a71d48addc3ea19078'] = 'Módulo Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_ebedf7d0e130dbb2afd22987ff22708b'] = 'Solución de lucha contra el fraude en línea'; +$_MODULE['<{secuvad}prestashop>secuvad_a9828808bf0dcd0b7af8e6f20b80ad85'] = '¿Está seguro de querer suprimir este módulo?'; +$_MODULE['<{secuvad}prestashop>secuvad_307bfa08da823ee566ce867b563eb223'] = 'Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_8fbc70c37e2deff790fe4e95fce7c9d8'] = 'Para utilizar el módulo Secuvad, configúrelo.'; +$_MODULE['<{secuvad}prestashop>secuvad_d3dd6e2937eb4430278bce947553b7ca'] = 'Estado Secuvad:'; +$_MODULE['<{secuvad}prestashop>secuvad_163f6b2856a83d0bb03aee72f8f072a5'] = 'Impago transmitido'; +$_MODULE['<{secuvad}prestashop>secuvad_f3182252d448607de30d2b4cfe420db1'] = 'Actualizar el estado Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_af7fdbd69d96ddaba932d48c45b89dcf'] = 'Transmitir un impago'; +$_MODULE['<{secuvad}prestashop>secuvad_ef1168698f5c33450f0d3166da5e4740'] = 'Atención, al transmitir este impago a SECUVAD, implica que su crédito es REAL, EFECTIVA y EXIGIBLE y que autoriza de manera EXCLUSIVA a SECUVAD el cobro del mismo. ¿Desea continuar?'; +$_MODULE['<{secuvad}prestashop>secuvad_85b94c96da82beb688084f64adfbf185'] = 'Configuración Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_04d45d9f5ece926babe251d7b628ecca'] = 'El archivo PaymentCC no está presente, por favor oipie este archivo en la carpeta Classes/ de PrestaShop.'; +$_MODULE['<{secuvad}prestashop>secuvad_2113b53bbb4a93786e042937cd04f21f'] = 'Por favor configure todas las asociaciones'; +$_MODULE['<{secuvad}prestashop>secuvad_062f3f5ae8644882a2da949705ced1ac'] = 'Si ya tiene una cuenta'; +$_MODULE['<{secuvad}prestashop>secuvad_0e79ca3a8ef61f2ec317e5734082de3f'] = 'Tipo de empresa no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_73c23113d237a4f8e56df46745d9e08e'] = 'Nombre de la empresa no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_a5253c7f1e4f48d55eb46507f9af21e3'] = 'Capital no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_c99b7e43f604b6c71a06336b727d99b9'] = 'URL de su sitio Web no válida'; +$_MODULE['<{secuvad}prestashop>secuvad_5b550fbcefc1b473adff36761fbc97fd'] = 'Dirección no válida'; +$_MODULE['<{secuvad}prestashop>secuvad_7b3bad39fc3ac5b25ae0523e6d58be68'] = 'Código postal no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_ceb8e9adca824ee71883fce1612e9fea'] = 'Ciudad no válida'; +$_MODULE['<{secuvad}prestashop>secuvad_3f1e50fba8ee7cc383eb164c7d5d0fb9'] = 'País no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_c678a6253de57c93c0ab007d23a119c6'] = 'CRS no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_b5061793e15ec84cd10f3b299d1f51a2'] = 'Siren no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_8c97e587c1b4e519bec26f3903561da3'] = 'Debe seleccionar al menos una categoría'; +$_MODULE['<{secuvad}prestashop>secuvad_e0d398bfe015c1cc6fbd01fa9bcafb71'] = 'Tratamiento no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_9bd987e611b01bc320c4b41fd0f44cb0'] = 'Apellido no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_d4a7da3641038f3a960339e8880297e4'] = 'Nombre no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_b3871d55ec4fd5d776a9411b8a3286d8'] = 'Función no válida'; +$_MODULE['<{secuvad}prestashop>secuvad_d9a821ab8ae9651b6e4a11798bb4fd39'] = 'Email no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_7f203a223defb75e34e9949e9054511a'] = 'Teléfono no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_a6f2a48726b0d36107e00e20795d3d37'] = 'Login no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_cba0b206627d45fbf0ae707e20d4a38f'] = 'Contraseña no válida'; +$_MODULE['<{secuvad}prestashop>secuvad_12477418db51dc813000335f72b9fcf2'] = 'Modo no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_c1c8a564c10a0efe07bb4e4b20d88cc9'] = 'ID no válido'; +$_MODULE['<{secuvad}prestashop>secuvad_7ccf58c950043c9fbfed668df13ce608'] = 'Parámetros actualizados'; +$_MODULE['<{secuvad}prestashop>secuvad_5a7f1ef0cabc9cac6fc4ef1c2eba2eb4'] = 'Error durante la actualización'; +$_MODULE['<{secuvad}prestashop>secuvad_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Empresa'; +$_MODULE['<{secuvad}prestashop>secuvad_051672911a3f1f05efba78a553ef6fe2'] = 'Login:'; +$_MODULE['<{secuvad}prestashop>secuvad_b341a59d5636ed3d6a819137495b08a0'] = 'Contraseña:'; +$_MODULE['<{secuvad}prestashop>secuvad_1ee1c44c2dc81681f961235604247b81'] = 'Modo:'; +$_MODULE['<{secuvad}prestashop>secuvad_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{secuvad}prestashop>secuvad_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{secuvad}prestashop>secuvad_e0f0b0564d3d29a93fad7a4178b7b1ca'] = 'ID:'; +$_MODULE['<{secuvad}prestashop>secuvad_94966d90747b97d1f0f206c98a8b1ac3'] = 'Enviar'; +$_MODULE['<{secuvad}prestashop>secuvad_8cf04a9734132302f96da8e113e80ce5'] = 'Inicio'; +$_MODULE['<{secuvad}prestashop>secuvad_201095b8aa27cc3bd5e6dcc407ab2bdb'] = 'Categorías Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{secuvad}prestashop>secuvad_116b7a3c4f415260f5a0d9a9d3a49f97'] = 'Categoría Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_7a0de9003696a0e833694b22a5ea6d91'] = 'Pago Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_593bda837f8ae222993fc189457c92a0'] = 'Tipo de pago'; +$_MODULE['<{secuvad}prestashop>secuvad_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido'; +$_MODULE['<{secuvad}prestashop>secuvad_68eb4e159f449c625edb23b2c35e7259'] = 'Transportista Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_7cc72fb5b56d882a4c34cb68dd4604aa'] = 'Plazos Transportista Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_de5744adc681a40f1b0fe16f3707da5b'] = 'Para activar su módulo Secuvad, rellene el formulario y pulse en \"Guardar\"'; +$_MODULE['<{secuvad}prestashop>secuvad_6bf36964a57a5eaa5f46504ca9882cdb'] = 'Tipo de empresa'; +$_MODULE['<{secuvad}prestashop>secuvad_c700e3beca05135eca91df55981402f5'] = 'SARL'; +$_MODULE['<{secuvad}prestashop>secuvad_3dd6b9265ff18f31dc30df59304b0ca7'] = 'SA'; +$_MODULE['<{secuvad}prestashop>secuvad_e00147cd1ed977d431491ce5c1b02f8a'] = 'EURL'; +$_MODULE['<{secuvad}prestashop>secuvad_2db46c628cfb3bd1545d3b5a14b4a9c5'] = 'SAS'; +$_MODULE['<{secuvad}prestashop>secuvad_d3cc996e019ec9721479e63b2fd622d8'] = 'Empresa individual'; +$_MODULE['<{secuvad}prestashop>secuvad_57aab2fcd93938cfbca356bb5571b25b'] = 'SNC'; +$_MODULE['<{secuvad}prestashop>secuvad_5e116ceb48a98fb755f22df7ea1e2396'] = 'Nombre de la empresa:'; +$_MODULE['<{secuvad}prestashop>secuvad_7b1b1d6f1a6793e17aeeffa80ac8fdaa'] = 'Capital:'; +$_MODULE['<{secuvad}prestashop>secuvad_e5cb8489f57db7c15eed3258e48cd5f3'] = 'Sitio:'; +$_MODULE['<{secuvad}prestashop>secuvad_2bf1d5fae1c321d594fdedf05058f709'] = 'Dirección:'; +$_MODULE['<{secuvad}prestashop>secuvad_8116ea5ccd73f945bb5e260861b0b570'] = 'Código postal:'; +$_MODULE['<{secuvad}prestashop>secuvad_bffb711ec36f280459d11dce315da72f'] = 'Ciudad:'; +$_MODULE['<{secuvad}prestashop>secuvad_f64be5eef68442a8f50cf535b92ad3e4'] = 'País:'; +$_MODULE['<{secuvad}prestashop>secuvad_51bdf131ea9fab11d517cc19fe5d8d73'] = 'RCS:'; +$_MODULE['<{secuvad}prestashop>secuvad_f4e462b9ed48a0e96da9730875f9dd58'] = 'Siren:'; +$_MODULE['<{secuvad}prestashop>secuvad_70397c4b252a5168c5ec003931cea215'] = 'Campos necesarios'; +$_MODULE['<{secuvad}prestashop>secuvad_0e0f3e0ad86de8103ac0f5c74726da24'] = 'Tipo de productos'; +$_MODULE['<{secuvad}prestashop>secuvad_432d0563f8721b5285e5bd18c0aee4ea'] = 'Categorías de sus productos:'; +$_MODULE['<{secuvad}prestashop>secuvad_7d0ba2d2a3223badb6f7b026946fc16d'] = 'Contacto en la empresa'; +$_MODULE['<{secuvad}prestashop>secuvad_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Tratamiento:'; +$_MODULE['<{secuvad}prestashop>secuvad_2c9b5b15a6d3cc951ca57c65e4966fd3'] = 'Señor'; +$_MODULE['<{secuvad}prestashop>secuvad_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Señora'; +$_MODULE['<{secuvad}prestashop>secuvad_e7ddb7cd777b59610b220bcfa80bd95f'] = 'Señorita'; +$_MODULE['<{secuvad}prestashop>secuvad_be5e0b5d50d48b049bd0f7b57cd163f9'] = 'Apellido:'; +$_MODULE['<{secuvad}prestashop>secuvad_668a8d8d7ffe5da112b266e46b79b685'] = 'Nombre:'; +$_MODULE['<{secuvad}prestashop>secuvad_6a858980896cb9daee81930c61bc1696'] = 'Función:'; +$_MODULE['<{secuvad}prestashop>secuvad_01401fe9a93df81d28637e5218597b76'] = 'Email:'; +$_MODULE['<{secuvad}prestashop>secuvad_673ae02fffb72f0fe68a66f096a01347'] = 'Teléfono:'; +$_MODULE['<{secuvad}prestashop>secuvad_7dce122004969d56ae2e0245cb754d35'] = 'Modificar'; +$_MODULE['<{secuvad}prestashop>secuvad_0ba7583639a274c434bbe6ef797115a4'] = 'Guardar'; +$_MODULE['<{secuvad}prestashop>secuvad_2f8531293ddfd4f30bb978e93d49f650'] = 'Email:'; +$_MODULE['<{secuvad}prestashop>secuvad_42dbbc555675ff22f80115c0570de888'] = 'Descripción del problema:'; +$_MODULE['<{secuvad}prestashop>secuvad_401886eb11224f37cbbd93211e991c85'] = 'Archivos de log:'; +$_MODULE['<{secuvad}prestashop>secuvad_fa29ad39f28d8d3a9b873ac37dec2899'] = 'Informe de error'; +$_MODULE['<{secuvad}prestashop>secuvad_a649552939461a1cce6c2d77e2de44d0'] = 'Los siguientes módulos de pago no están asociados:'; +$_MODULE['<{secuvad}prestashop>secuvad_b0d7bc21f644e151a6dec99181ac0718'] = 'Los siguientes métodos de transportista no están asociados:'; +$_MODULE['<{secuvad}prestashop>secuvad_68a569c0346cff10b9626e27fae1de48'] = 'Las siguientes categorías no están asociadas:'; +$_MODULE['<{secuvad}prestashop>secuvad_a1d333dc75f4e131835c8104c4b2d966'] = 'Error durante la activación'; +$_MODULE['<{secuvad}prestashop>secuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Error'; +$_MODULE['<{secuvad}prestashop>secuvad_7fd791b8ff524778a13d978ff04f0bb9'] = 'Imposible trasladar el fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_2e92ae79ff32b37fee4368a594792183'] = 'Error de conexión'; +$_MODULE['<{secuvad}prestashop>secuvad_2d7839314eb05f8988381b70dbc1548b'] = 'No es un fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{secuvad}prestashop>secuvad_1b93ce75458ea0ce94250a781ff0835e'] = 'Es un fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{secuvad}prestashop>secuvad_830560d945b2aa75e58b6f0b7ffe0882'] = 'No sometido a Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_3d0362bcbb2783e82be0612668eb7ce9'] = 'Validado por Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_999dfff14d541898b1c7266c3c271d40'] = 'Análisis en curso'; +$_MODULE['<{secuvad}prestashop>secuvad_a464f32e0e54df4786e7d905577b7f0c'] = 'Invalidado por Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_f6ba219e7a45632ab4d39822108d68f3'] = 'A valorar por el cliente'; +$_MODULE['<{secuvad}prestashop>secuvad_e2cadc35c8d021861738765b25666ebb'] = 'En espera de validación por Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_config_8bcaf785d6c5771e3c49bd90e0885c2a'] = 'Intento de pirateo'; +$_MODULE['<{secuvad}prestashop>secuvad_config_1f4eee5122ff1dfb7c7ff3aa8e879222'] = 'Acceso no autorizado'; +$_MODULE['<{secuvad}prestashop>secuvad_config_635c1728fc02b144a4357007b44d55b7'] = 'Los datos enviados son:'; diff --git a/modules/secuvad/fr.php b/modules/secuvad/fr.php new file mode 100755 index 000000000..2f832517d --- /dev/null +++ b/modules/secuvad/fr.php @@ -0,0 +1,114 @@ +secuvad_e4ba26360a7818a71d48addc3ea19078'] = 'Module Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_ebedf7d0e130dbb2afd22987ff22708b'] = 'Solution luttant contre les fraudes en ligne'; +$_MODULE['<{secuvad}prestashop>secuvad_a9828808bf0dcd0b7af8e6f20b80ad85'] = 'Etes-vous certain de vouloir supprimer ce module ?'; +$_MODULE['<{secuvad}prestashop>secuvad_307bfa08da823ee566ce867b563eb223'] = 'Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_8fbc70c37e2deff790fe4e95fce7c9d8'] = 'Pour utiliser le module Secuvad, merci de configurer le module.'; +$_MODULE['<{secuvad}prestashop>secuvad_d3dd6e2937eb4430278bce947553b7ca'] = 'Statut Secuvad:'; +$_MODULE['<{secuvad}prestashop>secuvad_163f6b2856a83d0bb03aee72f8f072a5'] = 'Impayé transmis :'; +$_MODULE['<{secuvad}prestashop>secuvad_f3182252d448607de30d2b4cfe420db1'] = 'Mettre à jour le statut Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_af7fdbd69d96ddaba932d48c45b89dcf'] = 'Transmettre un impayé'; +$_MODULE['<{secuvad}prestashop>secuvad_ef1168698f5c33450f0d3166da5e4740'] = 'Attention, par la transmission de cet impayé à Secuvad, vous certifiez que votre créance est CERTAINE, LIQUIDE et EXIGIBLE, et que vous en confiez le recouvrement EXCLUSIF à Secuvad. Souhaitez-vous poursuivre ?'; +$_MODULE['<{secuvad}prestashop>secuvad_85b94c96da82beb688084f64adfbf185'] = 'Configuration de Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_04d45d9f5ece926babe251d7b628ecca'] = 'Le fichier PaymentCC.php n\'est pas présent, merci de copier ce fichier dans le dossier classes/ de Prestashop.'; +$_MODULE['<{secuvad}prestashop>secuvad_2113b53bbb4a93786e042937cd04f21f'] = 'Merci de configurer toutes les associations'; +$_MODULE['<{secuvad}prestashop>secuvad_062f3f5ae8644882a2da949705ced1ac'] = 'Si vous avez déjà un compte'; +$_MODULE['<{secuvad}prestashop>secuvad_0e79ca3a8ef61f2ec317e5734082de3f'] = 'Type de la société invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_73c23113d237a4f8e56df46745d9e08e'] = 'Nom de la société invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_a5253c7f1e4f48d55eb46507f9af21e3'] = 'Capital invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_c99b7e43f604b6c71a06336b727d99b9'] = 'Url de votre site invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_5b550fbcefc1b473adff36761fbc97fd'] = 'Adresse invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_7b3bad39fc3ac5b25ae0523e6d58be68'] = 'Code postal invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_ceb8e9adca824ee71883fce1612e9fea'] = 'Ville invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_3f1e50fba8ee7cc383eb164c7d5d0fb9'] = 'Pays invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_c678a6253de57c93c0ab007d23a119c6'] = 'RCS invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_b5061793e15ec84cd10f3b299d1f51a2'] = 'Siren invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_8c97e587c1b4e519bec26f3903561da3'] = 'Vous devez sélectionner au moins une catégorie'; +$_MODULE['<{secuvad}prestashop>secuvad_e0d398bfe015c1cc6fbd01fa9bcafb71'] = 'Civilité invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_9bd987e611b01bc320c4b41fd0f44cb0'] = 'Nom invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_d4a7da3641038f3a960339e8880297e4'] = 'Prénom invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_b3871d55ec4fd5d776a9411b8a3286d8'] = 'Fonction invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_d9a821ab8ae9651b6e4a11798bb4fd39'] = 'E-mail invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_7f203a223defb75e34e9949e9054511a'] = 'Telephone invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_a6f2a48726b0d36107e00e20795d3d37'] = 'Identifiant invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_cba0b206627d45fbf0ae707e20d4a38f'] = 'Mot de passe invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_12477418db51dc813000335f72b9fcf2'] = 'Mode invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_c1c8a564c10a0efe07bb4e4b20d88cc9'] = 'ID invalide'; +$_MODULE['<{secuvad}prestashop>secuvad_7ccf58c950043c9fbfed668df13ce608'] = 'Paramètres mis à jour'; +$_MODULE['<{secuvad}prestashop>secuvad_5a7f1ef0cabc9cac6fc4ef1c2eba2eb4'] = 'Erreur lors de la mise à jour'; +$_MODULE['<{secuvad}prestashop>secuvad_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Société'; +$_MODULE['<{secuvad}prestashop>secuvad_051672911a3f1f05efba78a553ef6fe2'] = 'Identifiant :'; +$_MODULE['<{secuvad}prestashop>secuvad_b341a59d5636ed3d6a819137495b08a0'] = 'Mot de passe :'; +$_MODULE['<{secuvad}prestashop>secuvad_1ee1c44c2dc81681f961235604247b81'] = 'Mode :'; +$_MODULE['<{secuvad}prestashop>secuvad_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{secuvad}prestashop>secuvad_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{secuvad}prestashop>secuvad_e0f0b0564d3d29a93fad7a4178b7b1ca'] = 'ID :'; +$_MODULE['<{secuvad}prestashop>secuvad_94966d90747b97d1f0f206c98a8b1ac3'] = 'Envoyer'; +$_MODULE['<{secuvad}prestashop>secuvad_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil'; +$_MODULE['<{secuvad}prestashop>secuvad_201095b8aa27cc3bd5e6dcc407ab2bdb'] = 'Catégories Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{secuvad}prestashop>secuvad_116b7a3c4f415260f5a0d9a9d3a49f97'] = 'Catégorie Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_7a0de9003696a0e833694b22a5ea6d91'] = 'Méthode de paiement Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_593bda837f8ae222993fc189457c92a0'] = 'Type de paiement'; +$_MODULE['<{secuvad}prestashop>secuvad_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu'; +$_MODULE['<{secuvad}prestashop>secuvad_68eb4e159f449c625edb23b2c35e7259'] = 'Transporteur Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_7cc72fb5b56d882a4c34cb68dd4604aa'] = 'Délais Transporteur Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_de5744adc681a40f1b0fe16f3707da5b'] = 'Pour activer votre module SECUVAD, merci de remplir le formulaire, de cliquer sur \"Enregistrer\"'; +$_MODULE['<{secuvad}prestashop>secuvad_6bf36964a57a5eaa5f46504ca9882cdb'] = 'Type de société :'; +$_MODULE['<{secuvad}prestashop>secuvad_c700e3beca05135eca91df55981402f5'] = 'SARL'; +$_MODULE['<{secuvad}prestashop>secuvad_3dd6b9265ff18f31dc30df59304b0ca7'] = 'SA'; +$_MODULE['<{secuvad}prestashop>secuvad_e00147cd1ed977d431491ce5c1b02f8a'] = 'EURL'; +$_MODULE['<{secuvad}prestashop>secuvad_2db46c628cfb3bd1545d3b5a14b4a9c5'] = 'SAS'; +$_MODULE['<{secuvad}prestashop>secuvad_d3cc996e019ec9721479e63b2fd622d8'] = 'Entreprise individuelle'; +$_MODULE['<{secuvad}prestashop>secuvad_57aab2fcd93938cfbca356bb5571b25b'] = 'SNC'; +$_MODULE['<{secuvad}prestashop>secuvad_5e116ceb48a98fb755f22df7ea1e2396'] = 'Nom de la société :'; +$_MODULE['<{secuvad}prestashop>secuvad_7b1b1d6f1a6793e17aeeffa80ac8fdaa'] = 'Capital :'; +$_MODULE['<{secuvad}prestashop>secuvad_e5cb8489f57db7c15eed3258e48cd5f3'] = 'Site :'; +$_MODULE['<{secuvad}prestashop>secuvad_2bf1d5fae1c321d594fdedf05058f709'] = 'Adresse :'; +$_MODULE['<{secuvad}prestashop>secuvad_8116ea5ccd73f945bb5e260861b0b570'] = 'Code postale :'; +$_MODULE['<{secuvad}prestashop>secuvad_bffb711ec36f280459d11dce315da72f'] = 'Ville :'; +$_MODULE['<{secuvad}prestashop>secuvad_f64be5eef68442a8f50cf535b92ad3e4'] = 'Pays :'; +$_MODULE['<{secuvad}prestashop>secuvad_51bdf131ea9fab11d517cc19fe5d8d73'] = 'RCS :'; +$_MODULE['<{secuvad}prestashop>secuvad_f4e462b9ed48a0e96da9730875f9dd58'] = 'Siren :'; +$_MODULE['<{secuvad}prestashop>secuvad_70397c4b252a5168c5ec003931cea215'] = 'Champs requis'; +$_MODULE['<{secuvad}prestashop>secuvad_0e0f3e0ad86de8103ac0f5c74726da24'] = 'Type de produits'; +$_MODULE['<{secuvad}prestashop>secuvad_432d0563f8721b5285e5bd18c0aee4ea'] = 'Catégories de vos produits :'; +$_MODULE['<{secuvad}prestashop>secuvad_7d0ba2d2a3223badb6f7b026946fc16d'] = 'Contact dans votre société'; +$_MODULE['<{secuvad}prestashop>secuvad_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Civilité :'; +$_MODULE['<{secuvad}prestashop>secuvad_2c9b5b15a6d3cc951ca57c65e4966fd3'] = 'M'; +$_MODULE['<{secuvad}prestashop>secuvad_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Mme'; +$_MODULE['<{secuvad}prestashop>secuvad_e7ddb7cd777b59610b220bcfa80bd95f'] = 'Mlle'; +$_MODULE['<{secuvad}prestashop>secuvad_be5e0b5d50d48b049bd0f7b57cd163f9'] = 'Nom :'; +$_MODULE['<{secuvad}prestashop>secuvad_668a8d8d7ffe5da112b266e46b79b685'] = 'Prénom :'; +$_MODULE['<{secuvad}prestashop>secuvad_6a858980896cb9daee81930c61bc1696'] = 'Fonction :'; +$_MODULE['<{secuvad}prestashop>secuvad_01401fe9a93df81d28637e5218597b76'] = 'E-mail :'; +$_MODULE['<{secuvad}prestashop>secuvad_673ae02fffb72f0fe68a66f096a01347'] = 'Téléphone :'; +$_MODULE['<{secuvad}prestashop>secuvad_7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; +$_MODULE['<{secuvad}prestashop>secuvad_0ba7583639a274c434bbe6ef797115a4'] = 'Enregistrer'; +$_MODULE['<{secuvad}prestashop>secuvad_2f8531293ddfd4f30bb978e93d49f650'] = 'E-mail :'; +$_MODULE['<{secuvad}prestashop>secuvad_42dbbc555675ff22f80115c0570de888'] = 'Description du problème :'; +$_MODULE['<{secuvad}prestashop>secuvad_401886eb11224f37cbbd93211e991c85'] = 'Fichiers de log :'; +$_MODULE['<{secuvad}prestashop>secuvad_fa29ad39f28d8d3a9b873ac37dec2899'] = 'Rapport d\'erreur'; +$_MODULE['<{secuvad}prestashop>secuvad_a649552939461a1cce6c2d77e2de44d0'] = 'Les modules de paiement suivant ne sont pas associés :'; +$_MODULE['<{secuvad}prestashop>secuvad_b0d7bc21f644e151a6dec99181ac0718'] = 'Les méthodes de transporteur suivantes ne sont pas associées :'; +$_MODULE['<{secuvad}prestashop>secuvad_68a569c0346cff10b9626e27fae1de48'] = 'Les catégories suivantes ne sont pas associées :'; +$_MODULE['<{secuvad}prestashop>secuvad_a1d333dc75f4e131835c8104c4b2d966'] = 'Erreur lors de l\'activation'; +$_MODULE['<{secuvad}prestashop>secuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Erreur'; +$_MODULE['<{secuvad}prestashop>secuvad_7fd791b8ff524778a13d978ff04f0bb9'] = 'Impossible de reporter la fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_2e92ae79ff32b37fee4368a594792183'] = 'Erreur de connexion'; +$_MODULE['<{secuvad}prestashop>secuvad_2d7839314eb05f8988381b70dbc1548b'] = 'Ce n\'est pas une fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{secuvad}prestashop>secuvad_1b93ce75458ea0ce94250a781ff0835e'] = 'C\'est une fraude'; +$_MODULE['<{secuvad}prestashop>secuvad_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{secuvad}prestashop>secuvad_830560d945b2aa75e58b6f0b7ffe0882'] = 'Non soumise à Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_3d0362bcbb2783e82be0612668eb7ce9'] = 'Validée par Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_999dfff14d541898b1c7266c3c271d40'] = 'En cours d\'analyse'; +$_MODULE['<{secuvad}prestashop>secuvad_a464f32e0e54df4786e7d905577b7f0c'] = 'Invalidée par Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_f6ba219e7a45632ab4d39822108d68f3'] = 'A expertiser par le CLIENT'; +$_MODULE['<{secuvad}prestashop>secuvad_e2cadc35c8d021861738765b25666ebb'] = 'En attente de validation par Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_config_8bcaf785d6c5771e3c49bd90e0885c2a'] = 'Tentative de piratage:'; +$_MODULE['<{secuvad}prestashop>secuvad_config_1f4eee5122ff1dfb7c7ff3aa8e879222'] = 'Accès non autorisé'; +$_MODULE['<{secuvad}prestashop>secuvad_config_635c1728fc02b144a4357007b44d55b7'] = 'Les données envoyées sont:'; diff --git a/modules/secuvad/install.sql b/modules/secuvad/install.sql new file mode 100644 index 000000000..f5c305fa8 --- /dev/null +++ b/modules/secuvad/install.sql @@ -0,0 +1,93 @@ +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_assoc_category` +( + `id_secuvad_assoc_category` int NOT NULL auto_increment, + `id_category` int default NULL, + `category_id` int default NULL, + PRIMARY KEY (`id_secuvad_assoc_category`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_assoc_payment` +( + `id_secuvad_assoc_payment` int NOT NULL auto_increment, + `id_module` int default NULL, + `code` varchar(45) default NULL, + PRIMARY KEY (`id_secuvad_assoc_payment`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_assoc_transport` +( + `id_secuvad_assoc_transport` int NOT NULL auto_increment, + `id_carrier` int default NULL, + `transport_id` int default NULL, + `transport_delay_id` int default NULL, + PRIMARY KEY (`id_secuvad_assoc_transport`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_category` +( + `category_id` int NOT NULL default '0', + `category_name` varchar(255) default NULL, + `sort_num` int default NULL, + `id_lang` int default '1', + PRIMARY KEY (`category_id`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_logs` +( + `id_secuvad_logs` int NOT NULL auto_increment, + `message` text default NULL, + `date` timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (`id_secuvad_logs`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_order` +( + `id_secuvad_order` int NOT NULL, + `secuvad_status` tinyint NOT NULL default '0', + `is_fraud` tinyint NOT NULL default '0', + `score` int unsigned default NULL, + `error` varchar(150) NOT NULL, + `advice` varchar(45) NOT NULL, + `ip` varchar(16) default NULL, + `ip_time` timestamp NULL default NULL, + PRIMARY KEY (`id_secuvad_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_payment` +( + `code` varchar(45) NOT NULL default '', + `name` varchar(255) default NULL, + `id_lang` int(11) NOT NULL, + PRIMARY KEY USING BTREE (`code`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_transport` +( + `transport_id` int NOT NULL, + `transport_name` varchar(150) character set latin1 default NULL, + `id_lang` int(11) NOT NULL, + PRIMARY KEY USING BTREE (`transport_id`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_secuvad_transport_delay` +( + `transport_delay_id` int NOT NULL, + `transport_delay_name` varchar(45) character set latin1 default NULL, + `id_lang` int(11) NOT NULL, + PRIMARY KEY USING BTREE (`transport_delay_id`,`id_lang`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `PREFIX_payment_cc` ( + `id_payment_cc` int(11) NOT NULL AUTO_INCREMENT, + `id_order` int(10) unsigned DEFAULT NULL, + `id_currency` int(10) unsigned NOT NULL, + `amount` decimal(10,2) NOT NULL, + `transaction_id` varchar(254) DEFAULT NULL, + `card_number` varchar(254) DEFAULT NULL, + `card_brand` varchar(254) DEFAULT NULL, + `card_expiration` char(7) DEFAULT NULL, + `card_holder` varchar(254) DEFAULT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_payment_cc`), + KEY `id_order` (`id_order`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; diff --git a/modules/secuvad/it.php b/modules/secuvad/it.php new file mode 100644 index 000000000..514e65417 --- /dev/null +++ b/modules/secuvad/it.php @@ -0,0 +1,114 @@ +secuvad_e4ba26360a7818a71d48addc3ea19078'] = 'Modulo Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_ebedf7d0e130dbb2afd22987ff22708b'] = 'Soluzione che lotta contro le frodi online'; +$_MODULE['<{secuvad}prestashop>secuvad_a9828808bf0dcd0b7af8e6f20b80ad85'] = 'Sei sicuro di voler cancellare questo modulo?'; +$_MODULE['<{secuvad}prestashop>secuvad_307bfa08da823ee566ce867b563eb223'] = 'Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_8fbc70c37e2deff790fe4e95fce7c9d8'] = 'Per poter utilizzare la protezione Secuvad, si prega di configurare il modulo.'; +$_MODULE['<{secuvad}prestashop>secuvad_d3dd6e2937eb4430278bce947553b7ca'] = 'Status Secuvad:'; +$_MODULE['<{secuvad}prestashop>secuvad_163f6b2856a83d0bb03aee72f8f072a5'] = 'Insoluti trasmessi:'; +$_MODULE['<{secuvad}prestashop>secuvad_f3182252d448607de30d2b4cfe420db1'] = 'Aggiorna status Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_af7fdbd69d96ddaba932d48c45b89dcf'] = 'Trasmetti una transazione insoluta'; +$_MODULE['<{secuvad}prestashop>secuvad_ef1168698f5c33450f0d3166da5e4740'] = 'Si prega di notare che con la consegna di questo insoluto a SECUVAD insoluto, certifichi che il tuo credito è certo, liquido ed esigibile, e che affidi a SECUVAD il recupero ESCLUSIVO. Vuoi continuare?'; +$_MODULE['<{secuvad}prestashop>secuvad_85b94c96da82beb688084f64adfbf185'] = 'configurazione Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_04d45d9f5ece926babe251d7b628ecca'] = 'Pagamento file CC non è presente, si prega di copiare questo file nella directory delle classi di Prestashop'; +$_MODULE['<{secuvad}prestashop>secuvad_2113b53bbb4a93786e042937cd04f21f'] = 'Si prega di configurare tutte le associazioni'; +$_MODULE['<{secuvad}prestashop>secuvad_062f3f5ae8644882a2da949705ced1ac'] = 'Se hai già un account'; +$_MODULE['<{secuvad}prestashop>secuvad_0e79ca3a8ef61f2ec317e5734082de3f'] = 'tipo di società non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_73c23113d237a4f8e56df46745d9e08e'] = 'Nome della società non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_a5253c7f1e4f48d55eb46507f9af21e3'] = 'Capitale non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_c99b7e43f604b6c71a06336b727d99b9'] = 'WebSite non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_5b550fbcefc1b473adff36761fbc97fd'] = 'Indirizzo non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_7b3bad39fc3ac5b25ae0523e6d58be68'] = 'CAP non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_ceb8e9adca824ee71883fce1612e9fea'] = 'Città non valida'; +$_MODULE['<{secuvad}prestashop>secuvad_3f1e50fba8ee7cc383eb164c7d5d0fb9'] = 'Paese non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_c678a6253de57c93c0ab007d23a119c6'] = 'RCS non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_b5061793e15ec84cd10f3b299d1f51a2'] = 'Siren non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_8c97e587c1b4e519bec26f3903561da3'] = 'è necessario selezionare almeno una categoria'; +$_MODULE['<{secuvad}prestashop>secuvad_e0d398bfe015c1cc6fbd01fa9bcafb71'] = 'Titolo non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_9bd987e611b01bc320c4b41fd0f44cb0'] = 'Cognome non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_d4a7da3641038f3a960339e8880297e4'] = 'Nome non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_b3871d55ec4fd5d776a9411b8a3286d8'] = 'Nome funzione non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_d9a821ab8ae9651b6e4a11798bb4fd39'] = 'Nome E-mail non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_7f203a223defb75e34e9949e9054511a'] = 'Telefono non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_a6f2a48726b0d36107e00e20795d3d37'] = 'login non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_cba0b206627d45fbf0ae707e20d4a38f'] = 'Password non valida'; +$_MODULE['<{secuvad}prestashop>secuvad_12477418db51dc813000335f72b9fcf2'] = 'Modalità non valida'; +$_MODULE['<{secuvad}prestashop>secuvad_c1c8a564c10a0efe07bb4e4b20d88cc9'] = 'ID non valido'; +$_MODULE['<{secuvad}prestashop>secuvad_7ccf58c950043c9fbfed668df13ce608'] = 'Le impostazioni sono aggiornate'; +$_MODULE['<{secuvad}prestashop>secuvad_5a7f1ef0cabc9cac6fc4ef1c2eba2eb4'] = 'Errore su aggiornamento'; +$_MODULE['<{secuvad}prestashop>secuvad_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Società'; +$_MODULE['<{secuvad}prestashop>secuvad_051672911a3f1f05efba78a553ef6fe2'] = 'Login:'; +$_MODULE['<{secuvad}prestashop>secuvad_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; +$_MODULE['<{secuvad}prestashop>secuvad_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:'; +$_MODULE['<{secuvad}prestashop>secuvad_0cbc6611f5540bd0809a388dc95a615b'] = 'Test'; +$_MODULE['<{secuvad}prestashop>secuvad_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{secuvad}prestashop>secuvad_e0f0b0564d3d29a93fad7a4178b7b1ca'] = 'ID:'; +$_MODULE['<{secuvad}prestashop>secuvad_94966d90747b97d1f0f206c98a8b1ac3'] = 'Invia'; +$_MODULE['<{secuvad}prestashop>secuvad_8cf04a9734132302f96da8e113e80ce5'] = 'Home'; +$_MODULE['<{secuvad}prestashop>secuvad_201095b8aa27cc3bd5e6dcc407ab2bdb'] = 'categorie Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{secuvad}prestashop>secuvad_116b7a3c4f415260f5a0d9a9d3a49f97'] = 'Categoria Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_7a0de9003696a0e833694b22a5ea6d91'] = 'pagamento Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_593bda837f8ae222993fc189457c92a0'] = 'Tipo di pagamento Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto'; +$_MODULE['<{secuvad}prestashop>secuvad_68eb4e159f449c625edb23b2c35e7259'] = 'Corriere Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_7cc72fb5b56d882a4c34cb68dd4604aa'] = 'Ritardo corriere Secuvad '; +$_MODULE['<{secuvad}prestashop>secuvad_de5744adc681a40f1b0fe16f3707da5b'] = 'Per poter utilizzare il modulo Secuvad, si prega di compilare il presente modulo, quindi fare clic su \"Registrati\"'; +$_MODULE['<{secuvad}prestashop>secuvad_6bf36964a57a5eaa5f46504ca9882cdb'] = 'Tipo di Azienda:'; +$_MODULE['<{secuvad}prestashop>secuvad_c700e3beca05135eca91df55981402f5'] = 'SARL'; +$_MODULE['<{secuvad}prestashop>secuvad_3dd6b9265ff18f31dc30df59304b0ca7'] = 'SA'; +$_MODULE['<{secuvad}prestashop>secuvad_e00147cd1ed977d431491ce5c1b02f8a'] = 'EURL'; +$_MODULE['<{secuvad}prestashop>secuvad_2db46c628cfb3bd1545d3b5a14b4a9c5'] = 'SAS'; +$_MODULE['<{secuvad}prestashop>secuvad_d3cc996e019ec9721479e63b2fd622d8'] = 'Società Individuale '; +$_MODULE['<{secuvad}prestashop>secuvad_57aab2fcd93938cfbca356bb5571b25b'] = 'SNC'; +$_MODULE['<{secuvad}prestashop>secuvad_5e116ceb48a98fb755f22df7ea1e2396'] = 'Nome società'; +$_MODULE['<{secuvad}prestashop>secuvad_7b1b1d6f1a6793e17aeeffa80ac8fdaa'] = 'Capitale:'; +$_MODULE['<{secuvad}prestashop>secuvad_e5cb8489f57db7c15eed3258e48cd5f3'] = 'Sito web:'; +$_MODULE['<{secuvad}prestashop>secuvad_2bf1d5fae1c321d594fdedf05058f709'] = 'Indirizzo:'; +$_MODULE['<{secuvad}prestashop>secuvad_8116ea5ccd73f945bb5e260861b0b570'] = 'CAP:'; +$_MODULE['<{secuvad}prestashop>secuvad_bffb711ec36f280459d11dce315da72f'] = 'Città:'; +$_MODULE['<{secuvad}prestashop>secuvad_f64be5eef68442a8f50cf535b92ad3e4'] = 'Paese:'; +$_MODULE['<{secuvad}prestashop>secuvad_51bdf131ea9fab11d517cc19fe5d8d73'] = 'RCS:'; +$_MODULE['<{secuvad}prestashop>secuvad_f4e462b9ed48a0e96da9730875f9dd58'] = 'Siren:'; +$_MODULE['<{secuvad}prestashop>secuvad_70397c4b252a5168c5ec003931cea215'] = 'Campi obbligatori'; +$_MODULE['<{secuvad}prestashop>secuvad_0e0f3e0ad86de8103ac0f5c74726da24'] = 'Tipi di prodotto'; +$_MODULE['<{secuvad}prestashop>secuvad_432d0563f8721b5285e5bd18c0aee4ea'] = 'Categorie dei tuoi prodotti:'; +$_MODULE['<{secuvad}prestashop>secuvad_7d0ba2d2a3223badb6f7b026946fc16d'] = 'Contatto società'; +$_MODULE['<{secuvad}prestashop>secuvad_51ec9bf4aaeab1b25bb57f9f8d4de557'] = 'Titolo:'; +$_MODULE['<{secuvad}prestashop>secuvad_2c9b5b15a6d3cc951ca57c65e4966fd3'] = 'Sig.'; +$_MODULE['<{secuvad}prestashop>secuvad_7f2a1b59ac1ab6d2d892dbbf4f132c40'] = 'Sig.ra'; +$_MODULE['<{secuvad}prestashop>secuvad_e7ddb7cd777b59610b220bcfa80bd95f'] = 'Sig.na'; +$_MODULE['<{secuvad}prestashop>secuvad_be5e0b5d50d48b049bd0f7b57cd163f9'] = 'Cognome:'; +$_MODULE['<{secuvad}prestashop>secuvad_668a8d8d7ffe5da112b266e46b79b685'] = 'Nome:'; +$_MODULE['<{secuvad}prestashop>secuvad_6a858980896cb9daee81930c61bc1696'] = 'Funzione:'; +$_MODULE['<{secuvad}prestashop>secuvad_01401fe9a93df81d28637e5218597b76'] = 'E-Mail:'; +$_MODULE['<{secuvad}prestashop>secuvad_673ae02fffb72f0fe68a66f096a01347'] = 'Telefono:'; +$_MODULE['<{secuvad}prestashop>secuvad_7dce122004969d56ae2e0245cb754d35'] = 'Modifica'; +$_MODULE['<{secuvad}prestashop>secuvad_0ba7583639a274c434bbe6ef797115a4'] = 'Registrati'; +$_MODULE['<{secuvad}prestashop>secuvad_2f8531293ddfd4f30bb978e93d49f650'] = 'Mail:'; +$_MODULE['<{secuvad}prestashop>secuvad_42dbbc555675ff22f80115c0570de888'] = 'Descrizione del problema:'; +$_MODULE['<{secuvad}prestashop>secuvad_401886eb11224f37cbbd93211e991c85'] = 'I file di log:'; +$_MODULE['<{secuvad}prestashop>secuvad_fa29ad39f28d8d3a9b873ac37dec2899'] = 'Rapporto di errore'; +$_MODULE['<{secuvad}prestashop>secuvad_a649552939461a1cce6c2d77e2de44d0'] = 'I seguenti moduli di pagamento non sono associati:'; +$_MODULE['<{secuvad}prestashop>secuvad_b0d7bc21f644e151a6dec99181ac0718'] = 'I seguenti moduli di spedizione non sono associati:'; +$_MODULE['<{secuvad}prestashop>secuvad_68a569c0346cff10b9626e27fae1de48'] = ' Le seguenti categorie non sono associate:'; +$_MODULE['<{secuvad}prestashop>secuvad_a1d333dc75f4e131835c8104c4b2d966'] = 'Errore all\'attivazione'; +$_MODULE['<{secuvad}prestashop>secuvad_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Errore'; +$_MODULE['<{secuvad}prestashop>secuvad_7fd791b8ff524778a13d978ff04f0bb9'] = 'Impossibile segnalare la frode prima di inviare l\'ordine associato'; +$_MODULE['<{secuvad}prestashop>secuvad_2e92ae79ff32b37fee4368a594792183'] = 'Errore di connessione'; +$_MODULE['<{secuvad}prestashop>secuvad_2d7839314eb05f8988381b70dbc1548b'] = 'Non è una truffa'; +$_MODULE['<{secuvad}prestashop>secuvad_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{secuvad}prestashop>secuvad_1b93ce75458ea0ce94250a781ff0835e'] = 'È una truffa'; +$_MODULE['<{secuvad}prestashop>secuvad_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{secuvad}prestashop>secuvad_830560d945b2aa75e58b6f0b7ffe0882'] = 'Non inviate a Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_3d0362bcbb2783e82be0612668eb7ce9'] = 'Convalidato da Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_999dfff14d541898b1c7266c3c271d40'] = 'Analisi'; +$_MODULE['<{secuvad}prestashop>secuvad_a464f32e0e54df4786e7d905577b7f0c'] = 'Ordine sospetto'; +$_MODULE['<{secuvad}prestashop>secuvad_f6ba219e7a45632ab4d39822108d68f3'] = 'Da controllare da parte del CLIENTE'; +$_MODULE['<{secuvad}prestashop>secuvad_e2cadc35c8d021861738765b25666ebb'] = 'Da controllare da parte di Secuvad'; +$_MODULE['<{secuvad}prestashop>secuvad_config_8bcaf785d6c5771e3c49bd90e0885c2a'] = 'Tentativo di pirateria'; +$_MODULE['<{secuvad}prestashop>secuvad_config_1f4eee5122ff1dfb7c7ff3aa8e879222'] = 'Nessun accesso autorizzato'; +$_MODULE['<{secuvad}prestashop>secuvad_config_635c1728fc02b144a4357007b44d55b7'] = 'I dati inviati sono:'; diff --git a/modules/secuvad/logo.gif b/modules/secuvad/logo.gif new file mode 100644 index 000000000..bb0cd495c Binary files /dev/null and b/modules/secuvad/logo.gif differ diff --git a/modules/secuvad/secuvad.php b/modules/secuvad/secuvad.php new file mode 100644 index 000000000..da5067750 --- /dev/null +++ b/modules/secuvad/secuvad.php @@ -0,0 +1,1333 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Secuvad extends Module +{ + private $_html = ''; + private $_postErrors = array(); + private $_allowed_modes = array('TEST', 'PROD'); + private $_secuvad_category = array(); + private $_secuvad_assoc_category = array(); + private $_secuvad_code_payment = array(); + private $_secuvad_carrier_type = array(); + private $_secuvad_carrier_delay = array(); + + public function __construct() + { + $this->name = 'secuvad'; + $this->tab = 'payment_security'; + $this->version = '2.0.1'; + $this->currencies = NULL; + $this->currencies_mode = NULL; + + parent::__construct(); + $this->displayName = $this->l('Secuvad module'); + $this->description = $this->l('Solution fighting against online fraud'); + $this->confirmUninstall = $this->l('Are you sure you want to delete this module?'); + } + + public function install() + { + if(!parent::install() + || !$this->registerHook('paymentConfirm') + || !$this->registerHook('adminOrder') + || !Configuration::updateValue('SECUVAD_CONTACT', 'prestashop@secuvad.com') + || !Configuration::updateValue('SECUVAD_ACTIVATION', '0') + || !Configuration::updateValue('SECUVAD_ID', '') + || !Configuration::updateValue('SECUVAD_IP', '91.121.209.139,91.121.209.140') + || !Configuration::updateValue('SECUVAD_IP_CONFIG', '91.213.82.241') + || !Configuration::updateValue('SECUVAD_IP_TEST', '91.121.147.62') + || !Configuration::updateValue('SECUVAD_NB_LOG_REPORTED', '100') + || !Configuration::updateValue('SECUVAD_MAX_LOG_SIZE', '200') + || !Configuration::updateValue('SECUVAD_LOG_SIZE', '100') + || !Configuration::updateValue('SECUVAD_LOGIN', '') + || !Configuration::updateValue('SECUVAD_MDP', '') + || !Configuration::updateValue('SECUVAD_MODE', 'TEST') + || !Configuration::updateValue('SECUVAD_RANDOM', 'b9ffecdde6169472ce33e354131cd26d34641358') + || !Configuration::updateValue('SECUVAD_URL_PROD', 'www.secuvad.com/submission/index.php') + || !Configuration::updateValue('SECUVAD_URL_TEST', 'www.secuvad-test.com/submission/index.php') + || !Configuration::updateValue('SECUVAD_XML_ENCODING', 'utf-8')) + return false; + + if (!file_exists(dirname(__FILE__).'/install.sql')) + die(Tools::displayError('File install.sql is missing')); + elseif (!$sql = file_get_contents(dirname(__FILE__).'/install.sql')) + die(Tools::displayError('File install.sql is not readable')); + $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql); + + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach ($sql as $query) + if ($query AND sizeof($query) AND !Db::getInstance()->Execute(trim($query))) + return false; + + $langs = Language::getLanguages(); + $query = ' + INSERT IGNORE INTO '._DB_PREFIX_.'secuvad_category(`category_id`, `category_name`, `sort_num`, `id_lang`) + VALUES '; + foreach ($langs as $lang) + if ($lang['iso_code'] == 'fr') + { + $query .= ' + (1, \'Informatique et Logiciels\', 101,'.(int)($lang['id_lang']).'), + (2,\'Téléphonie, Télécommunications\',102,'.(int)($lang['id_lang']).'), + (3,\'Matériels HiFi, Vidéo, Photo\',103,'.(int)($lang['id_lang']).'), + (4,\'Voyages, Tourisme\',104,'.(int)($lang['id_lang']).'), + (5,\'Vêtements, accessoires de mode\',105,'.(int)($lang['id_lang']).'), + (6,\'Sport\',106,'.(int)($lang['id_lang']).'), + (7,\'Electroménager\',107,'.(int)($lang['id_lang']).'), + (8,\'Cadeaux, fleurs\',108,'.(int)($lang['id_lang']).'), + (9,\'Accessoires de maison et jardin\',109,'.(int)($lang['id_lang']).'), + (10,\'Auto, moto et accessoires\',110,'.(int)($lang['id_lang']).'), + (11,\'Alimentation\',111,'.(int)($lang['id_lang']).'), + (12,\'Culture, divertissements\',112,'.(int)($lang['id_lang']).'), + (13,\'Beauté, santé\',113,'.(int)($lang['id_lang']).'), + (14,\'Services\',114,'.(int)($lang['id_lang']).'),'; + } + else + { + $query .= ' + (1,\'Computing and Softwares\',1,'.(int)($lang['id_lang']).'), + (2,\'Phones, Telecommunications\',2,'.(int)($lang['id_lang']).'), + (3,\'HiFi, Video, Photo\',3,'.(int)($lang['id_lang']).'), + (4,\'Travels, Tourism\',4,'.(int)($lang['id_lang']).'), + (5,\'Clothes, fashion accessories\',5,'.(int)($lang['id_lang']).'), + (6,\'Sport\',6,'.(int)($lang['id_lang']).'), + (7,\'Domestic appliances\',7,'.(int)($lang['id_lang']).'), + (8,\'Gifts, flowers\',8,'.(int)($lang['id_lang']).'), + (9,\'Home and garden goods\',9,'.(int)($lang['id_lang']).'), + (10,\'Cars, motorbikes and accessories\',10,'.(int)($lang['id_lang']).'), + (11,\'Food\',11,'.(int)($lang['id_lang']).'), + (12,\'Culture, entertainement\',12,'.(int)($lang['id_lang']).'), + (13,\'Beauty, healthcare\',13,'.(int)($lang['id_lang']).'), + (14,\'Services\',14,'.(int)($lang['id_lang']).'),'; + } + $query = rtrim($query, ','); + Db::getInstance()->Execute($query); + + $query = ' + INSERT IGNORE INTO '._DB_PREFIX_.'secuvad_payment(`code`, `name`, `id_lang`) + VALUES '; + foreach ($langs as $lang) + if ($lang['iso_code'] == 'fr') + { + $query .= ' + (\'carte\',\'Carte bancaire\','.(int)($lang['id_lang']).'), + (\'cheque\',\'Chèque\','.(int)($lang['id_lang']).'), + (\'virement\',\'Virement\','.(int)($lang['id_lang']).'), + (\'paypal\',\'Tiers de paiement\','.(int)($lang['id_lang']).'), + (\'cb en n fois\',\'Carte bancaire en plusieurs fois\','.(int)($lang['id_lang']).'), + (\'contre-remboursement\',\'Contre-Remboursement\','.(int)($lang['id_lang']).'),'; + } + else + { + $query .= ' + (\'carte\',\'Credit card\','.(int)($lang['id_lang']).'), + (\'cheque\',\'Check\','.(int)($lang['id_lang']).'), + (\'virement\',\'Transfer\','.(int)($lang['id_lang']).'), + (\'paypal\',\'Third-party payment\','.(int)($lang['id_lang']).'), + (\'cb en n fois\',\'Credit Card (n times)\','.(int)($lang['id_lang']).'), + (\'contre-remboursement\',\'On delivery\','.(int)($lang['id_lang']).'),'; + } + $query = rtrim($query, ','); + Db::getInstance()->Execute($query); + + $query = ' + INSERT IGNORE INTO '._DB_PREFIX_.'secuvad_transport(`transport_id`, `transport_name`, `id_lang`) + VALUES '; + foreach ($langs as $lang) + if ($lang['iso_code'] == 'fr') + { + $query .= ' + (1,\'Retrait chez le commerçant\','.(int)($lang['id_lang']).'), + (2,\'Retrait dans un point de retrait tiers\','.(int)($lang['id_lang']).'), + (3,\'Coliposte\','.(int)($lang['id_lang']).'), + (4,\'Chronopost\','.(int)($lang['id_lang']).'), + (5,\'Envoi remis sans signature\','.(int)($lang['id_lang']).'), + (6,\'Bien/service immatériel\','.(int)($lang['id_lang']).'),'; + } + else + { + $query .= ' + (1,\'Merchant Warehouse\','.(int)($lang['id_lang']).'), + (2,\'Other withdrawal\','.(int)($lang['id_lang']).'), + (3,\'Public conveyor with signature\','.(int)($lang['id_lang']).'), + (4,\'Private conveyor with signature\','.(int)($lang['id_lang']).'), + (5,\'Public conveyor without signature\','.(int)($lang['id_lang']).'), + (6,\'Immaterial Good/Service\','.(int)($lang['id_lang']).'),'; + } + $query = rtrim($query, ','); + Db::getInstance()->Execute($query); + + $query = ' + INSERT IGNORE INTO `'._DB_PREFIX_.'secuvad_transport_delay`(`transport_delay_id`, `transport_delay_name`, `id_lang`) + VALUES '; + foreach ($langs as $lang) + $query .= ' + (1,\'express\','.(int)($lang['id_lang']).'), + (2,\'standard\','.(int)($lang['id_lang']).'),'; + $query = rtrim($query, ','); + Db::getInstance()->Execute($query); + + if (!file_exists(dirname(__FILE__).'/../../classes/PaymentCC.php')) + { + @copy(dirname(__FILE__).'/classes/PaymentCC.php', dirname(__FILE__).'/../../classes/PaymentCC.php'); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook`(`name`, `title`, `position`) + VALUES (\'paymentCCAdded\', \'paymentCCAdded\', 0)'); + $this->registerHook('paymentCCAdded'); + } + else + $this->registerHook('paymentCCAdded'); + + return true; + } + + public function uninstall() + { + if(!parent::uninstall() + || !Configuration::deleteByName('SECUVAD_CONTACT') + || !Configuration::deleteByName('SECUVAD_ACTIVATION') + || !Configuration::deleteByName('SECUVAD_ID') + || !Configuration::deleteByName('SECUVAD_IP') + || !Configuration::deleteByName('SECUVAD_IP_CONFIG') + || !Configuration::deleteByName('SECUVAD_IP_TEST') + || !Configuration::deleteByName('SECUVAD_NB_LOG_REPORTED') + || !Configuration::deleteByName('SECUVAD_MAX_LOG_SIZE') + || !Configuration::deleteByName('SECUVAD_LOG_SIZE') + || !Configuration::deleteByName('SECUVAD_LOGIN') + || !Configuration::deleteByName('SECUVAD_MDP') + || !Configuration::deleteByName('SECUVAD_MODE') + || !Configuration::deleteByName('SECUVAD_RANDOM') + || !Configuration::deleteByName('SECUVAD_URL_PROD') + || !Configuration::deleteByName('SECUVAD_URL_TEST') + || !Configuration::deleteByName('SECUVAD_XML_ENCODING')) + return false; + + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_assoc_category`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_assoc_payment`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_assoc_transport`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_category`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_logs`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_order`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_payment`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_transport`'); + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'secuvad_transport_delay`'); + return true; + } + + public function hookAdminOrder($params) + { + global $cookie, $currentIndex; + + if ($this->check_assoc() != '') + return ' +
        +
        + '.$this->l('Secuvad').' +

        '.$this->l('In order to use Secuvad protection, please configure your module.').'

        +
        + '; + + $secuvad_order = Db::getInstance()->getRow(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_order` + WHERE `id_secuvad_order` = '.(int)($params['id_order']).' + '); + if (is_array($secuvad_order) AND sizeof($secuvad_order)) + { + if (Tools::isSubmit('send_to_secuvad')) + $this->_sendToSecuvad(); + elseif (Tools::isSubmit('report_fraud')) + $this->_reportFraud(); + + return ' +
        +
        + '.$this->l('Secuvad').' +

        + '.$this->l('Secuvad status:').' '.$this->_getSecuvadStatusHtml((int)($secuvad_order['secuvad_status'])).' + '.($secuvad_order['is_fraud'] ? '
        '.$this->l('Unpaid transmitted:').' '.$this->_getFraudStatusHtml((int)($secuvad_order['is_fraud'])) : '').' +

        + +
        +

        + + + +

        +
        +
        + '; + } + } + + public function hookPaymentConfirm($params) + { + $id_order = (int)($params['id_order']); + $exists = Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'secuvad_order` + WHERE `id_secuvad_order` = '.(int)($id_order)); + if (!$exists) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_order`(`id_secuvad_order`, `ip`, `ip_time`) + VALUES ('.(int)($id_order).', \''.pSQL($this->getRemoteIPaddress()).'\', \''.pSQL(date("Y-m-d H:i:s")).'\') + '); + if ($this->check_assoc() == '' AND Configuration::get('SECUVAD_ACTIVATION') == 1) + { + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_flux.php'); + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_connection.php'); + + $xml_obj = new Secuvad_flux(Configuration::get('SECUVAD_ID'),Configuration::get('SECUVAD_XML_ENCODING')); + $flux_xml = $xml_obj->get_flux_xml((int)($id_order)); + + if (Configuration::get('SECUVAD_MODE') == 'TEST') + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_TEST'); + else + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_PROD'); + + $connection_obj = new Secuvad_connection($flux_xml, Configuration::get('SECUVAD_ID'), $url, $this); + $connection_obj->send_transaction(); + } + } + } + + public function hookPaymentCCAdded($params) + { + $id_order = (int)($params['paymentCC']->id_order); + $exists = Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM `'._DB_PREFIX_.'secuvad_order` + WHERE `id_secuvad_order` = '.(int)($id_order)); + if (!$exists) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_order`(`id_secuvad_order`, `ip`, `ip_time`) + VALUES ('.(int)($id_order).', \''.pSQL($this->getRemoteIPaddress()).'\', \''.pSQL(date("Y-m-d H:i:s")).'\') + '); + if ($this->check_assoc() == '' AND Configuration::get('SECUVAD_ACTIVATION') == 1) + { + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_flux.php'); + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_connection.php'); + + $xml_obj = new Secuvad_flux(Configuration::get('SECUVAD_ID'), Configuration::get('SECUVAD_XML_ENCODING')); + $flux_xml = $xml_obj->get_flux_xml((int)($id_order)); + if (Configuration::get('SECUVAD_MODE') == 'TEST') + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_TEST'); + else + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_PROD'); + + $connection_obj = new Secuvad_connection($flux_xml, Configuration::get('SECUVAD_ID'), $url, $this); + $connection_obj->send_transaction(); + } + } + } + + public function getContent() + { + global $cookie; + + $this->_html = '

        '.$this->l('Secuvad configuration').'

        '; + + if (!$this->_isPaymentCCFilePresent()) + $this->_html .= $this->displayError($this->l('Payment CC file isn\'t present, please copy this file into classes directory of your Prestashop')); + $lock = $this->_postProcess(); + if ($this->check_assoc() AND Configuration::get('SECUVAD_ACTIVATION')) + $this->_html .= '
        '.$this->l('Please configure all associations').'
        '; + $this->_initSecuvadAssoc(); + if (Configuration::get('SECUVAD_ACTIVATION')) + $this->_setFormConfigure(); + else + { + $this->_html .= '

        '.$this->l('If you have already an account').'

        '; + $this->_setFormConfigure(); + $this->_setFormRegister($lock); + } + + return $this->_html; + } + + private function _isPaymentCCFilePresent() + { + if (!file_exists(dirname(__FILE__).'/../../classes/PaymentCC.php')) + return false; + return true; + } + + private function _initSecuvadAssoc() + { + $this->check_assoc(); + $this->_secuvad_category = $this->_getSecuvadCategories(); + $this->_secuvad_assoc_category = $this->_getSecuvadCategoryAssoc(); + $this->_secuvad_code_payment = $this->_getSecuvadCodePayment(); + $this->_secuvad_carrier_type = $this->_getSecuvadCarrierType(); + $this->_secuvad_carrier_delay = $this->_getSecuvadCarrierDelay(); + } + + private function _getSecuvadCategories() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_category` sc + WHERE sc.`id_lang` = '.(int)($cookie->id_lang)); + } + + private function _getSecuvadCategoryAssoc() + { + $data = Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_assoc_category`'); + + if (!sizeof($data)) + return array(); + + $assoc = array(); + foreach ($data as $d) + $assoc[$d['id_category']] = $d['category_id']; + return $assoc; + } + + private function _getSecuvadPayment() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT IF(sp.name IS NULL, "Unknown", sp.name) AS `secuvad_name`, sp.`code`, m.`id_module`, m.`name` AS `module_name` + FROM `'._DB_PREFIX_.'secuvad_assoc_payment` sac + JOIN `'._DB_PREFIX_.'module` m ON (m.`id_module` = sac.`id_module`) + LEFT JOIN `'._DB_PREFIX_.'secuvad_payment` sp ON (sp.`code` = sac.`code` AND sp.`id_lang` = '.(int)($cookie->id_lang).')'); + } + + private function _getSecuvadCodePayment() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_payment` + WHERE `id_lang` = '.(int)($cookie->id_lang) + ); + } + + private function _getSecuvadCarrier() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_assoc_transport` sat + JOIN '._DB_PREFIX_.'carrier c ON (c.id_carrier = sat.id_carrier) + LEFT JOIN '._DB_PREFIX_.'secuvad_transport st ON st.transport_id = sat.transport_id AND st.id_lang='.(int)($cookie->id_lang).' + LEFT JOIN '._DB_PREFIX_.'secuvad_transport_delay std ON std.transport_delay_id = sat.transport_delay_id AND std.id_lang='.(int)($cookie->id_lang) + ); + } + + private function _getSecuvadCarrierType() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_transport` + WHERE `id_lang` = '.(int)($cookie->id_lang) + ); + } + + private function _getSecuvadCarrierDelay() + { + global $cookie; + + return Db::getInstance()->ExecuteS(' + SELECT * + FROM `'._DB_PREFIX_.'secuvad_transport_delay` + WHERE `id_lang` = '.(int)($cookie->id_lang) + ); + } + + private function _postProcess() + { + $errors = array(); + if (Tools::isSubmit('submitSecuvadEdit')) + return false; + if (Tools::isSubmit('submitSecuvadConfiguration')) + { + if (Tools::getValue('forme') != 'SARL' + AND Tools::getValue('forme') != 'SA' + AND Tools::getValue('forme') != 'EURL' + AND Tools::getValue('forme') != 'SAS' + AND Tools::getValue('forme') != 'Entreprise individuelle' + AND Tools::getValue('forme') != 'SNC') + $errors[] = $this->l('Company type is invalid'); + if (Tools::getValue('societe') == NULL OR !Validate::isName(Tools::getValue('societe'))) + $errors[] = $this->l('Company name is invalid'); + if (Tools::getValue('capital') != NULL AND !Validate::isGenericName(Tools::getValue('capital'))) + $errors[] = $this->l('Capital is invalid'); + if (Tools::getValue('web_site') == NULL OR !Validate::isUrl(Tools::getValue('web_site'))) + $errors[] = $this->l('WebSite is invalid'); + if (Tools::getValue('address') != NULL AND !Validate::isAddress(Tools::getValue('address'))) + $errors[] = $this->l('Address is invalid'); + if (Tools::getValue('code_postal') != NULL AND !Validate::isPostCode(Tools::getValue('code_postal'))) + $errors[] = $this->l('Zip/ Postal Code is invalid'); + if (Tools::getValue('ville') != NULL AND !Validate::isCityName(Tools::getValue('ville'))) + $errors[] = $this->l('City is invalid'); + if (Tools::getValue('pays') != NULL AND !Validate::isCountryName(Tools::getValue('pays'))) + $errors[] = $this->l('Country is invalid'); + if (Tools::getValue('rcs') != NULL AND !Validate::isGenericName(Tools::getValue('rcs'))) + $errors[] = $this->l('RCS is invalid'); + if (Tools::getValue('siren') != NULL AND !Validate::isGenericName(Tools::getValue('siren'))) + $errors[] = $this->l('Siren is invalid'); + if (!is_array(Tools::getValue('categories')) OR !sizeof(Tools::getValue('categories'))) + $errors[] = $this->l('You must select at least one category.'); + if (Tools::getValue('civilite') != 'M' + AND Tools::getValue('civilite') != 'Mme' + AND Tools::getValue('civilite') != 'Mlle') + $errors[] = $this->l('Title is invalid'); + if (Tools::getValue('nom') == NULL OR !Validate::isName(Tools::getValue('nom'))) + $errors[] = $this->l('Last name is invalid'); + if (Tools::getValue('prenom') == NULL OR !Validate::isName(Tools::getValue('prenom'))) + $errors[] = $this->l('First name is invalid'); + if (Tools::getValue('fonction') != NULL AND !Validate::isGenericName(Tools::getValue('fonction'))) + $errors[] = $this->l('Function name is invalid'); + if (Tools::getValue('email') == NULL OR !Validate::isEmail(Tools::getValue('email'))) + $errors[] = $this->l('E-mail name is invalid'); + if (Tools::getValue('telephone') == NULL OR !Validate::isPhoneNumber(Tools::getValue('telephone'))) + $errors[] = $this->l('Telephone is invalid'); + if (!sizeof($errors)) + return true; + else + { + $this->_html .= $this->displayError(implode('
        ', $errors)); + return false; + } + } + + if (Tools::isSubmit('submitSecuvadPostConfiguration')) + { + $errors = array(); + if (!Validate::isGenericName(Tools::getValue('secuvad_login'))) + $errors[] = $this->l('Invalid login'); + if (!Validate::isGenericName(Tools::getValue('secuvad_password'))) + $errors[] = $this->l('Invalid password'); + if (!in_array(Tools::getValue('secuvad_mode'), $this->_allowed_modes)) + $errors[] = $this->l('Invalid Mode'); + if (!Validate::isInt(Tools::getValue('secuvad_id'))) + $errors[] = $this->l('Invalid ID'); + if (!sizeof($errors)) + { + // update configuration + Configuration::updateValue('SECUVAD_LOGIN',Tools::getValue('secuvad_login')); + Configuration::updateValue('SECUVAD_MDP',Tools::getValue('secuvad_password')); + Configuration::updateValue('SECUVAD_MODE',Tools::getValue('secuvad_mode')); + Configuration::updateValue('SECUVAD_ID',Tools::getValue('secuvad_id')); + Configuration::updateValue('SECUVAD_ACTIVATION', 1); + $this->_html .= $this->displayConfirmation($this->l('Settings are updated').''); + } + else + $this->_html .= $this->displayError(implode('
        ', $errors)); + } + + if (Tools::isSubmit('submitSecuvadCategory')) + { + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_category` + '); + $sql = 'INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_category` VALUES'; + foreach ($_POST as $k => $category_id) + if (preg_match('/secuvad_cat_([0-9]+)$/Ui', $k, $result)) + { + $id_category = $result[1]; + $sql .= '(NULL, '.(int)($id_category).', '.(int)($category_id).'),'; + } + $sql = rtrim($sql, ','); + if (Db::getInstance()->Execute($sql)) + $this->_html .= $this->displayConfirmation($this->l('Settings are updated')); + else + $this->_html .= $this->displayError($this->l('Error during update')); + } + + if (Tools::isSubmit('submitSecuvadPayment')) + { + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_payment` + '); + $sql = 'INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_payment` VALUES'; + foreach ($_POST as $k => $code) + if (preg_match('/secuvad_payment_([0-9]+)$/Ui', $k, $result)) + { + $id_module = $result[1]; + $sql .= '(NULL, '.(int)($id_module).', \''.pSQL($code).'\'),'; + } + $sql = rtrim($sql, ','); + if (Db::getInstance()->Execute($sql)) + $this->_html .= $this->displayConfirmation($this->l('Settings are updated')); + else + $this->_html .= $this->displayError($this->l('Error during update')); + } + + if (Tools::isSubmit('submitSecuvadCarrier')) + { + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_transport` + '); + $sql = 'INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_transport` VALUES'; + foreach ($_POST as $k => $value) + if (preg_match('/secuvad_carrier_type_([0-9]+)$/Ui', $k, $result)) + { + $id_carrier = $result[1]; + $sql .= '(NULL, '.(int)($id_carrier).', '.(int)($value).', '.(int)($_POST['secuvad_carrier_delay_'.(int)($id_carrier)]).'),'; + } + $sql = rtrim($sql, ','); + if (Db::getInstance()->Execute($sql)) + $this->_html .= $this->displayConfirmation($this->l('Settings are updated')); + else + $this->_html .= $this->displayError($this->l('Error during update')); + } + } + + private function _getSecuvadRegisterURL() + { + return 'http://www.secuvad.com/contrat/'; + } + + private function _setFormConfigure() + { + global $cookie; + + $this->_html .= ' +
        +
        + '.$this->l('Company').' + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + +

        +
        +
        + '; + + if (Configuration::get('SECUVAD_ACTIVATION')) + { + $categories = Category::getCategories((int)($cookie->id_lang), false); + $categories[1]['infos'] = array('name' => $this->l('Home'), 'id_parent' => 0, 'level_depth' => 0); + + $this->_html .= ' +
        +
        + '.$this->l('Secuvad categories').' + + + + + + + '; + $this->recurseCategoryForInclude($categories, $categories[1]); + $this->_html .= ' +
        '.$this->l('Name').''.$this->l('Secuvad Category').'
        +

        +
        +
        + '; + + $this->_html .= ' +
        +
        + '.$this->l('Secuvad Payment').' + + + + + + + '; + $secuvad_payements = $this->_getSecuvadPayment(); + foreach ($secuvad_payements as $payment) + { + $this->_html .= ' + + + + + '; + } + $this->_html .= ' +
        '.$this->l('Name').''.$this->l('Secuvad Payment type').'
        '.htmlentities($payment['module_name'], ENT_QUOTES, 'UTF-8').' + +
        +

        +
        +
        + '; + + $this->_html .= ' +
        +
        + '.$this->l('Secuvad Carrier').' + + + + + + + + '; + $secuvad_carriers = $this->_getSecuvadCarrier(); + foreach ($secuvad_carriers as $carrier) + { + $this->_html .= ' + + + + + + '; + } + $this->_html .= ' +
        '.$this->l('Name').''.$this->l('Secuvad Carrier').''.$this->l('Secuvad Carrier Delay').'
        '.(!preg_match('/^0$/Ui', $carrier['name']) ? htmlentities($carrier['name'], ENT_QUOTES, 'UTF-8') : Configuration::get('PS_SHOP_NAME')).' + + + +
        +

        +
        +
        + '; + } + } + + private function recurseCategoryForInclude($categories, $current, $id_category = 1, $has_suite = array()) + { + global $done, $cookie; + static $irow; + + if (!isset($done[$current['infos']['id_parent']])) + $done[$current['infos']['id_parent']] = 0; + $done[$current['infos']['id_parent']] += 1; + + $todo = sizeof($categories[$current['infos']['id_parent']]); + $doneC = $done[$current['infos']['id_parent']]; + + $level = $current['infos']['level_depth'] + 1; + $this->_html .= ' + '; + for ($i = 2; $i < $level; $i++) + $this->_html .= ''; + $this->_html .= '  '; + $this->_html .= ' + + + + + + '; + if ($level > 1) + $has_suite[] = ($todo == $doneC ? 0 : 1); + if (isset($categories[$id_category])) + foreach ($categories[$id_category] AS $key => $row) + if ($key != 'infos') + $this->recurseCategoryForInclude($categories, $categories[$id_category][$key], $key, $has_suite); + } + + private function _setFormRegister($lock = false) + { + $this->_html .= ' +

        '.$this->l('In order to use the Secuvad module, please fill in this form, then click "Register".').'

        +
        '; + if ($lock) + { + foreach (Tools::getValue('categories') as $category) + $this->_html .= ''; + } + $this->_html .= ' + + +
        + '.$this->l('Company').' + + +
        + + '.($lock ? '' : '').' +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        +

        * '.$this->l('Required fields').'

        +
        +
        + '.$this->l('Product types').' + + +
        +
          + '; + + foreach ($this->_getSecuvadCategories() as $category) + $this->_html .= ' +
        • + + '.(($lock AND is_array(Tools::getValue('categories')) AND in_array((int)($category['category_id']), Tools::getValue('categories'))) ? ''; + $this->_html .= ' +
        +
        +
        +
        +
        + '.$this->l('Company contact').' + + +
        + + '.($lock ? '' : '').' +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        +

        * '.$this->l('Required fields').'

        +
        + '.($lock ? + '

        ' : + '

        ').' +
        + '; + } + + private function installModuleTab($tabClass, $tabName, $idTabParent) + { + @copy(_PS_IMG_DIR_.'t/AdminAccess.gif', _PS_MODULE_DIR_.'/'.$this->name.'/'.$tabClass.'.gif'); + @copy(_PS_IMG_DIR_.'t/AdminAccess.gif', _PS_IMG_DIR_.'t/'.$tabClass.'.gif'); + $tab = new Tab(); + $tab->name = $tabName; + $tab->class_name = $tabClass; + $tab->module = $this->name; + $tab->id_parent = (int)($idTabParent); + if(!$tab->save()) + return false; + return true; + } + + private function uninstallModuleTab($tabClass) + { + $idTab = Tab::getIdFromClassName($tabClass); + if($idTab != 0) + { + $tab = new Tab($idTab); + $tab->delete(); + return true; + } + return false; + } + + public function getRemoteIPaddress() + { + if (method_exists('Tools', 'getRemoteAddr')) + return Tools::getRemoteAddr(); + if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR']) + { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) + { + $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); + return $ips[0]; + } + else + return $_SERVER['HTTP_X_FORWARDED_FOR']; + } + return $_SERVER['REMOTE_ADDR']; + } + + private function send_error_report($probleme,$mail) + { + $report = 'idsecuvad='.get_secuvad_id()."\n\n"; + $report .= $this->l('Mail:').$mail."\n\n"; + $report .= $this->l('Issue description:')."\n".$probleme."\n\n"; + $report .= $this->l('Log files:')."\n"; + $res = Db::getInstance()->ExecuteS(' + SELECT `message`, `date` + FROM `'._DB_PREFIX_.'secuvad_logs` + ORDER BY `date` DESC + LIMIT '.(int)($this->get_secuvad_nb_log_reportred())); + foreach($res as $msg) + $report .= $msg['date']." : ".$msg['message']."\n\n"; + mail($this->get_secuvad_contact(), $this->l('Error report').' idsecuvad='.$this->get_secuvad_id(), $report); + } + + public function sent_to_secuvad($id_secuvad_order) + { + $secuvad_status = Db::getInstance()->getValue(' + SELECT `secuvad_status` + FROM `'._DB_PREFIX_.'secuvad_order` + WHERE `id_secuvad_order` = '.(int)($id_secuvad_order)); + + if($secuvad_status == 0) + return false; + return true; + } + + public function check_assoc() + { + $result = ''; + if(!$this->check_payment()) + $result .= 'payment'; + if(!$this->check_transport()) + $result .= 'transport'; + if(!$this->check_category()) + $result .= 'category'; + return $result; + } + + private function check_payment() + { + $result = true; + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_payment` + WHERE `id_module` NOT IN + ( + SELECT m.`id_module` + FROM `'._DB_PREFIX_.'hook` h + JOIN `'._DB_PREFIX_.'hook_module` hm ON (hm.`id_hook` = h.`id_hook`) + JOIN `'._DB_PREFIX_.'module` m ON (m.`id_module` = hm.`id_module`) + WHERE h.`name` = \'payment\' + ) + '); + + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_payment` (`id_module`) + ( + SELECT m.`id_module` FROM `'._DB_PREFIX_.'hook` h + JOIN `'._DB_PREFIX_.'hook_module` hm ON (hm.`id_hook` = h.`id_hook`) + JOIN `'._DB_PREFIX_.'module` m ON (m.`id_module` = hm.`id_module`) + LEFT JOIN `'._DB_PREFIX_.'secuvad_assoc_payment` sap ON (sap.`id_module` = m.`id_module`) + WHERE h.`name` = "payment" + AND sap.`id_module` IS NULL + )'); + + $module_not_assoc = Db::getInstance()->ExecuteS(' + SELECT m.`name`, m.`id_module` + FROM `'._DB_PREFIX_.'hook` h + JOIN `'._DB_PREFIX_.'hook_module` hm ON (hm.`id_hook` = h.`id_hook`) + JOIN `'._DB_PREFIX_.'module` m ON (m.`id_module` = hm.`id_module`) + JOIN `'._DB_PREFIX_.'secuvad_assoc_payment` sap ON (sap.`id_module` = m.`id_module`) + WHERE h.`name` = "payment" AND sap.`code` IS NULL + '); + if (sizeof($module_not_assoc) > 0) + { + $message = $this->l('Following payment modules are not associated:'); + foreach($module_not_assoc as $mod) + $message .= "\n\t".$mod['id_module']."->".$mod['name']; + $this->secuvad_log($message); + $result = false; + } + + return $result; + } + + private function check_transport() + { + global $cookie; + + $result = true; + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_transport` + WHERE `id_carrier` NOT IN + ( + SELECT c.`id_carrier` FROM `'._DB_PREFIX_.'carrier` c + WHERE c.`deleted` = 0 + ) + '); + + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_transport`(id_carrier) + ( + SELECT c.`id_carrier` + FROM `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'secuvad_assoc_transport` sat ON (sat.`id_carrier` = c.`id_carrier`) + WHERE sat.`id_carrier` IS NULL + AND c.`deleted` = 0 + ) + '); + + $module_not_assoc = Db::getInstance()->ExecuteS(' + SELECT c.`name`, c.`id_carrier` + FROM `'._DB_PREFIX_.'carrier` c + JOIN `'._DB_PREFIX_.'secuvad_assoc_transport` sat ON (sat.`id_carrier` = c.`id_carrier`) + LEFT JOIN `'._DB_PREFIX_.'secuvad_transport` st ON (st.`transport_id` = sat.`transport_id` AND st.`id_lang` = '.(int)($cookie->id_lang).') + LEFT JOIN `'._DB_PREFIX_.'secuvad_transport_delay` std ON (std.`transport_delay_id` = sat.`transport_delay_id` AND std.`id_lang`='.(int)($cookie->id_lang).') + WHERE (st.`transport_id` IS NULL OR std.`transport_delay_id` IS NULL) + AND c.`deleted` = 0 + AND c.`active` = 1 + '); + if (count($module_not_assoc) > 0) + { + $message = $this->l('Following shipping methods are not associated:'); + foreach($module_not_assoc as $mod) + $message .= "\n\t".$mod['id_carrier']."->".$mod['name']; + $this->secuvad_log($message); + $result = false; + } + + return($result); + } + + private function check_category() + { + global $cookie; + + $result = true; + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_assoc_category` + WHERE `id_category` NOT IN + ( + SELECT c.`id_category` + FROM `'._DB_PREFIX_.'category` c + ) + '); + + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_assoc_category`(id_category) + ( + SELECT c.`id_category` + FROM `'._DB_PREFIX_.'category` c + LEFT JOIN `'._DB_PREFIX_.'secuvad_assoc_category` sac ON (sac.`id_category` = c.`id_category`) + WHERE sac.`id_category` IS NULL + ) + '); + + $module_not_assoc = Db::getInstance()->ExecuteS(' + SELECT cl.`name`, c.`id_category` + FROM `'._DB_PREFIX_.'category` c + JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = c.`id_category`) + JOIN `'._DB_PREFIX_.'lang` l ON (l.`id_lang` = cl.`id_lang` AND l.`iso_code` = \'en\') + JOIN `'._DB_PREFIX_.'secuvad_assoc_category` sac ON (sac.`id_category` = c.`id_category`) + LEFT JOIN `'._DB_PREFIX_.'secuvad_category` sc ON (sc.`category_id` = sac.`category_id` AND sc.`id_lang` = '.(int)($cookie->id_lang).') + WHERE sc.`category_id` IS NULL + '); + if(count($module_not_assoc)>0) + { + $message = $this->l('Following categories are not associated:'); + foreach($module_not_assoc as $mod) + $message .= "\n\t".$mod['id_category']."->".$mod['name']; + $this->secuvad_log($message); + $result = false; + } + + return($result); + } + + private function _sendToSecuvad() + { + global $cookie; + + if ($this->check_assoc() != '' || Configuration::get('SECUVAD_ACTIVATION') != 1) + { + $this->secuvad_log('AdminOrders.php : '.$this->l('Error during activation')); + return 0; + } + include_once(_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_flux.php'); + include_once(_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_connection.php'); + if (Tools::isSubmit('id_secuvad_order')) + { + $xml_obj = new Secuvad_flux(Configuration::get('SECUVAD_ID'), Configuration::get('SECUVAD_XML_ENCODING')); + $flux_xml = $xml_obj->get_flux_xml(Tools::getValue('id_secuvad_order')); + if (Configuration::get('SECUVAD_MODE') == 'TEST') + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_TEST'); + else + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_PROD'); + $connection_obj = new Secuvad_connection($flux_xml, Configuration::get('SECUVAD_ID'),$url, $this); + $connection_obj->send_transaction(); + Tools::redirectAdmin('index.php?tab=AdminOrders&confirm=1&id_order='.Tools::getValue('id_secuvad_order').'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + } + } + + private function _reportFraud() + { + global $cookie; + + if ($this->check_assoc() != '' || Configuration::get('SECUVAD_ACTIVATION') != 1) + { + $this->secuvad_log('AdminOrders.php : '.$this->l('Error during activation')); + return 0; + } + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_flux.php'); + include_once (_PS_MODULE_DIR_.'/secuvad/classes/Secuvad_connection.php'); + + if (Tools::isSubmit('id_secuvad_order')) + { + if (!$this->sent_to_secuvad(Tools::getValue('id_secuvad_order'))) + { + echo '
        +

        '.$this->l('Error').'

        +
          +
        1. '.$this->l('Impossible to report fraud before submitting the associated order').'
        2. +
        +
        '; + return 0; + } + + $xml_obj = new Secuvad_flux(Configuration::get('SECUVAD_ID'), Configuration::get('SECUVAD_XML_ENCODING')); + $flux_xml = $xml_obj->get_flux_xml_fraud(Tools::getValue('id_secuvad_order')); + + if(Configuration::get('SECUVAD_MODE') == 'TEST') + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_TEST'); + else + $url = 'https://'.Configuration::get('SECUVAD_LOGIN').':'.Configuration::get('SECUVAD_MDP').'@'.Configuration::get('SECUVAD_URL_PROD'); + $connection_obj = new Secuvad_connection($flux_xml, Configuration::get('SECUVAD_ID'),$url ,$this); + $result = $connection_obj->report_fraud('impaye','impaye_report'); + + if ($result == "true") + Tools::redirectAdmin('index.php?tab=AdminOrders&confirm=2&id_order='.Tools::getValue('id_secuvad_order').'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee))); + else + { + if ($result == "Erreur de connexion") + $result = $this->l('Connection error'); + echo '
        +

        '.$this->l('Error').'

        +
        1. '.$result.'
        2. +
        +
        '; + } + } + } + + public function secuvad_log($message) + { + $res = Db::getInstance()->getValue(' + SELECT COUNT(0) nb + FROM `'._DB_PREFIX_.'secuvad_logs`'); + if($res > $this->get_secuvad_max_log_size()) + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'secuvad_logs` + ORDER BY `date` + LIMIT '.(int)($this->get_secuvad_log_size())); + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'secuvad_logs` (`message`) + VALUES (\''.pSQL($message).'\') + '); + } + + public function get_secuvad_ip() + { + if (Configuration::get('SECUVAD_MODE') == 'TEST') + return explode(',', Configuration::get('SECUVAD_IP_TEST')); + else + return explode(',', Configuration::get('SECUVAD_IP')); + } + + public function get_secuvad_ip_config() + { + return explode(',', Configuration::get('SECUVAD_IP_CONFIG')); + } + + public function get_secuvad_random() + { + return(Configuration::get('SECUVAD_RANDOM')); + } + + public function get_secuvad_id() + { + return(Configuration::get('SECUVAD_ID')); + } + + public function get_secuvad_contact() + { + return(Configuration::get('SECUVAD_CONTACT')); + } + + public function get_secuvad_nb_log_reportred() + { + return(Configuration::get('SECUVAD_NB_LOG_REPORTED')); + } + + public function get_secuvad_max_log_size() + { + return(Configuration::get('SECUVAD_MAX_LOG_SIZE')); + } + + public function get_secuvad_log_size() + { + return(Configuration::get('SECUVAD_LOG_SIZE')); + } + + public function _getFraudStatusHtml($is_fraud) + { + if ($is_fraud == 0) + return ''.$this->l('Is not a fraud').' '.$this->l('No'); + elseif ($is_fraud == 1) + return ''.$this->l('Is a fraud').' '.$this->l('Yes'); + } + + public function _getSecuvadStatusHtml($secuvad_status) + { + switch ($secuvad_status) + { + case 0 : + return ''.$this->l('Not sent to Secuvad').' '.$this->l('Not sent to Secuvad'); + break; + case 1 : + return ''.$this->l('Validated by Secuvad').' '.$this->l('Validated by Secuvad'); + break; + case 2 : + return ''.$this->l('Analyzing').' '.$this->l('Analyzing'); + break; + case 3 : + return ''.$this->l('Suspect order').' '.$this->l('Suspect order'); + break; + case 4 : + return ''.$this->l('Error').' '.$this->l('Error'); + break; + case 6 : + return ''.$this->l('To be checked by CUSTOMER').' '.$this->l('To be checked by CUSTOMER'); + break; + case 7 : + return ''.$this->l('To be checked by Secuvad').' '.$this->l('To be checked by Secuvad'); + break; + default: + return ''.$this->l('Not sent to Secuvad').' '.$this->l('Not sent to Secuvad'); + } + } +} + + diff --git a/modules/secuvad/secuvad_config.php b/modules/secuvad/secuvad_config.php new file mode 100644 index 000000000..9b7bbdc76 --- /dev/null +++ b/modules/secuvad/secuvad_config.php @@ -0,0 +1,43 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/secuvad.php'); + +$secuvad = new Secuvad(); +if (in_array($secuvad->getRemoteIPaddress(), $secuvad->get_secuvad_ip_config()) AND sha1(Tools::getValue('p')) == $secuvad->get_secuvad_random()) +{ + $value = stripslashes(Tools::getValue('value')); + $key = stripslashes(Tools::getValue('key')); + Configuration::updateValue($key, $value); + echo 'OK'; +} +else + mail($secuvad->get_secuvad_contact(), $this->l('Hack Attempt'), 'secuvad_id='.$secuvad->get_secuvad_id()."\n".$this->l('No authorized access').' (ip='.$secuvad->getRemoteIPaddress().')'."\n".$this->l('The data sent is:')."\n\n".'GET :'."\n".print_r($_GET,true)."\n\n".'POST :'."\n".print_r($_POST,true)); + + diff --git a/modules/secuvad/secuvad_response.php b/modules/secuvad/secuvad_response.php new file mode 100644 index 000000000..b1c3c79d6 --- /dev/null +++ b/modules/secuvad/secuvad_response.php @@ -0,0 +1,95 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/************************************************************************************************************************* + +Script destiner à traiter les analyses de secuvad qui ne sont pas renvoyées immédiatement (status 'en attente' ou erreur). + +*************************************************************************************************************************/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/secuvad.php'); + +if (!Tools::isSubmit('transaction_report')) + exit; + +$secuvad = new Secuvad(); + +if (in_array($secuvad->getRemoteIPaddress(), $secuvad->get_secuvad_ip())) +{ + $rep = stripslashes(urldecode(Tools::getValue('transaction_report'))); + if (preg_match('#([0-9]*)<.score>([^<]*)([^<]*)<.error><.transaction_report>#Ui', $rep, $regs)) + { + $rep = preg_replace('#'.$regs[2].'<.score>'.$regs[3].''.$regs[4].'<.error><.transaction_report>#Ui', '', $rep); + $idtransaction = $regs[1]; + $score = $regs[2]; + $advice = $regs[3]; + $erreur = $regs[4]; + + if (!empty($erreur)) + { + $secuvad->secuvad_log('secuvad_response.php '."\n\t".' Error: '.$erreur); + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `secuvad_status` = 4, `error` = '.pSQL($erreur).' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + } + else + { + $secuvad->secuvad_log('secuvad_response.php '."\n\t".' Response: '.$rep); + + if (preg_match('/[0-9]+/Ui', $score)) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `secuvad_status` = 5, `score` = '.(int)($score).' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + else + { + if (strtoupper($advice) == 'INVALIDE') + $secuvad_status = 3; + elseif (strtoupper($advice) == 'VALIDE') + $secuvad_status = 1; + elseif (strtoupper($advice) == 'A EXPERTISER') + $secuvad_status = 7; + elseif (strtoupper($advice) == 'A EXPERTISER C') + $secuvad_status = 6; + elseif (strtoupper($advice) == 'EN ATTENTE') + $secuvad_status = 2; + else + $secuvad_status = 4; + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'secuvad_order` + SET `secuvad_status` = '.(int)($secuvad_status).', `advice` = \''.pSQL($advice).'\' + WHERE `id_secuvad_order` = '.(int)($idtransaction)); + } + } + } + if(preg_match('#([^<]*)<.global_report>([^<]+)<.error><.bulk_report>#Ui', $rep, $regs)) + $secuvad->secuvad_log('secuvad_response.php '."\n\t".' Error '.$regs[2]); +} + + diff --git a/modules/sekeywords/config.xml b/modules/sekeywords/config.xml new file mode 100755 index 000000000..31e221901 --- /dev/null +++ b/modules/sekeywords/config.xml @@ -0,0 +1,11 @@ + + + sekeywords + Search engine keywords + 1 + Display which keywords have led visitors to your website. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/sekeywords/de.php b/modules/sekeywords/de.php new file mode 100644 index 000000000..ed2b6d77a --- /dev/null +++ b/modules/sekeywords/de.php @@ -0,0 +1,24 @@ +sekeywords_65b0b42febc8ea16db4652eab6f420a4'] = 'Suchmaschinen-Keywords'; +$_MODULE['<{sekeywords}prestashop>sekeywords_de13be6263895a5efe4d51e15ab1535e'] = 'Anzeigen, durch welche Keywords Besucher Ihre Webseite gefunden haben'; +$_MODULE['<{sekeywords}prestashop>sekeywords_a6a5cc2d3979e54597c79a68448adee2'] = 'Keyword, das Ihrer Abfrage entspricht.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_abc9f128fb01c8504e08e77bfc8af795'] = 'Keywords, die Ihrer Abfrage entsprechen.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_867343577fa1f33caa632a19543bd252'] = 'Keywords'; +$_MODULE['<{sekeywords}prestashop>sekeywords_e52e6aa1a43a0187e44f048f658db5f9'] = 'Vorkommen'; +$_MODULE['<{sekeywords}prestashop>sekeywords_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{sekeywords}prestashop>sekeywords_0849140171616600e8f2c35f0a225212'] = 'Filtern nach Keyword'; +$_MODULE['<{sekeywords}prestashop>sekeywords_188ef1f71ff3ef1c5501dc5c8ee27f88'] = 'und Mindestvorkommen'; +$_MODULE['<{sekeywords}prestashop>sekeywords_03e0e9ef8b776b5f7bcc590e51bfa63b'] = 'Anwenden'; +$_MODULE['<{sekeywords}prestashop>sekeywords_7b48f6cc4a1dde7fca9597e717c2465f'] = 'Keine Keywords'; +$_MODULE['<{sekeywords}prestashop>sekeywords_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{sekeywords}prestashop>sekeywords_39f040a1f174811285297763fcaada12'] = 'Externe Suchmaschinen-Keywords identifizieren'; +$_MODULE['<{sekeywords}prestashop>sekeywords_f4e8acc0e0cfc0653d6354c3ef878d29'] = 'Es gibt viele Möglichkeiten, eine Webseite zu finden, aber eine der häufigsten ist es, sie mit einer Suchmaschine zu finden. Die Ermittlung der Keywords, die die meisten Besucher anlocken, ist daher von großer Bedeutung. Dadurch können Sie erkennen, welches Produkt Sie hervorheben müssen, um mehr Besucher und Kunden zu haben.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_359f9e79e746fa9f684e5cda9e60ca2e'] = 'Wie funktioniert das?'; +$_MODULE['<{sekeywords}prestashop>sekeywords_b20af255c34d0a4ace56863dbd8f0c90'] = 'Wenn ein Besucher auf Ihre Webseite kommt, kennt der Server ihre davorige Seite. Dieses Modul analysiert diese URL und findet die in ihr enthaltenen Keywords. Derzeit verwaltet es die folgende Suchmaschinen:'; +$_MODULE['<{sekeywords}prestashop>sekeywords_be5d5d37542d75f93a87094459f76678'] = 'und'; +$_MODULE['<{sekeywords}prestashop>sekeywords_474c03326cba5cb2ce6c07ddf3e1e656'] = 'Bald wird es möglich sein, eine neue Suchmaschine dynamisch hinzufügen und zu diesem Modul beizutragen!'; +$_MODULE['<{sekeywords}prestashop>sekeywords_8d01ac22a68176ddd7067da99508751d'] = '10 erste Keywords'; +$_MODULE['<{sekeywords}prestashop>sekeywords_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Weitere'; diff --git a/modules/sekeywords/en.php b/modules/sekeywords/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/sekeywords/en.php @@ -0,0 +1,4 @@ +sekeywords_65b0b42febc8ea16db4652eab6f420a4'] = 'Palabras clave en el motor de búsqueda'; +$_MODULE['<{sekeywords}prestashop>sekeywords_de13be6263895a5efe4d51e15ab1535e'] = 'Mostrar qué palabras claves han llevado visitantes a su tienda'; +$_MODULE['<{sekeywords}prestashop>sekeywords_a6a5cc2d3979e54597c79a68448adee2'] = 'palabra clave encontrada para su búsqueda.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_abc9f128fb01c8504e08e77bfc8af795'] = 'palabras clave encontrada para su búsqueda.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_867343577fa1f33caa632a19543bd252'] = 'Palabras clave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_e52e6aa1a43a0187e44f048f658db5f9'] = 'Frecuencia'; +$_MODULE['<{sekeywords}prestashop>sekeywords_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{sekeywords}prestashop>sekeywords_0849140171616600e8f2c35f0a225212'] = 'Filtrar por palabra clave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_188ef1f71ff3ef1c5501dc5c8ee27f88'] = 'y un mínimo de incidencias'; +$_MODULE['<{sekeywords}prestashop>sekeywords_03e0e9ef8b776b5f7bcc590e51bfa63b'] = 'Aplicar'; +$_MODULE['<{sekeywords}prestashop>sekeywords_7b48f6cc4a1dde7fca9597e717c2465f'] = 'No hay palabras clave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{sekeywords}prestashop>sekeywords_39f040a1f174811285297763fcaada12'] = 'Identifique las palabras claves externas en los motores de la búsqueda'; +$_MODULE['<{sekeywords}prestashop>sekeywords_f4e8acc0e0cfc0653d6354c3ef878d29'] = 'Hay muchas maneras de encontrar una Web, pero una de las más comunes es encontrarla con un buscador. Identificar la mayoría de las palabras claves incorporadas por sus nuevos visitantes es realmente importante, ya que le permite ver qué producto debe poner en valor si quiere más visitantes y clientes.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_359f9e79e746fa9f684e5cda9e60ca2e'] = '¿Cómo funciona?'; +$_MODULE['<{sekeywords}prestashop>sekeywords_b20af255c34d0a4ace56863dbd8f0c90'] = 'Cuando un visitante accede a un sitio Web, el servidor conoce la dirección del sitio anterior. Este módulo analiza la dirección e identifica las palabras claves incluidas en el mismo.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_be5d5d37542d75f93a87094459f76678'] = 'y'; +$_MODULE['<{sekeywords}prestashop>sekeywords_474c03326cba5cb2ce6c07ddf3e1e656'] = '¡Pronto será posible agregar dinámicamente un nuevo motor de búsqueda y colaborar en este módulo!'; +$_MODULE['<{sekeywords}prestashop>sekeywords_8d01ac22a68176ddd7067da99508751d'] = '10 primeras palabras clave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Otros'; diff --git a/modules/sekeywords/fr.php b/modules/sekeywords/fr.php new file mode 100644 index 000000000..b134c9cf1 --- /dev/null +++ b/modules/sekeywords/fr.php @@ -0,0 +1,24 @@ +sekeywords_65b0b42febc8ea16db4652eab6f420a4'] = 'Mots clés'; +$_MODULE['<{sekeywords}prestashop>sekeywords_de13be6263895a5efe4d51e15ab1535e'] = 'Affiche les mots clés qui ont mené les visiteurs jusqu\'à votre boutique'; +$_MODULE['<{sekeywords}prestashop>sekeywords_a6a5cc2d3979e54597c79a68448adee2'] = 'mot clé trouvé pour votre recherche.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_abc9f128fb01c8504e08e77bfc8af795'] = 'mots clés trouvés pour votre recherche.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_867343577fa1f33caa632a19543bd252'] = 'mots clés'; +$_MODULE['<{sekeywords}prestashop>sekeywords_e52e6aa1a43a0187e44f048f658db5f9'] = 'Occurences'; +$_MODULE['<{sekeywords}prestashop>sekeywords_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV '; +$_MODULE['<{sekeywords}prestashop>sekeywords_0849140171616600e8f2c35f0a225212'] = 'Filter par mot clé'; +$_MODULE['<{sekeywords}prestashop>sekeywords_188ef1f71ff3ef1c5501dc5c8ee27f88'] = 'et minimum d\'occurences'; +$_MODULE['<{sekeywords}prestashop>sekeywords_03e0e9ef8b776b5f7bcc590e51bfa63b'] = 'Appliquer'; +$_MODULE['<{sekeywords}prestashop>sekeywords_7b48f6cc4a1dde7fca9597e717c2465f'] = 'Aucun mot clé'; +$_MODULE['<{sekeywords}prestashop>sekeywords_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{sekeywords}prestashop>sekeywords_39f040a1f174811285297763fcaada12'] = 'Identifier des mots de moteurs de recherche externes'; +$_MODULE['<{sekeywords}prestashop>sekeywords_f4e8acc0e0cfc0653d6354c3ef878d29'] = 'Il y a de nombreux moyens pour accéder à un site internet, mais l\'un des plus courants est de passer par un moteur de recherche. Identifier les mots clés qui amènent le plus de visiteurs est donc très important car cela vous permet de connaître les produits que vous devez mettre en avant afin d\'attirer toujours plus de visiteurs et donc de clients potentiels.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_359f9e79e746fa9f684e5cda9e60ca2e'] = 'Comment ça marche ?'; +$_MODULE['<{sekeywords}prestashop>sekeywords_b20af255c34d0a4ace56863dbd8f0c90'] = 'Quand un visiteur accède à un site internet, le serveur connaît l\'adresse du site précédent. Ce module analyse l\'adresse et identifie les mots clés inclus. Actuellement, il gère les moteurs suivants :'; +$_MODULE['<{sekeywords}prestashop>sekeywords_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{sekeywords}prestashop>sekeywords_474c03326cba5cb2ce6c07ddf3e1e656'] = 'Bientôt il sera possible d\'ajouter dynamiquement de nouveaux moteurs de recherche à cette liste et ainsi contribuer au développement du module !'; +$_MODULE['<{sekeywords}prestashop>sekeywords_8d01ac22a68176ddd7067da99508751d'] = '10 premiers mots clés'; +$_MODULE['<{sekeywords}prestashop>sekeywords_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Autres'; diff --git a/modules/sekeywords/it.php b/modules/sekeywords/it.php new file mode 100644 index 000000000..7fb2c0e35 --- /dev/null +++ b/modules/sekeywords/it.php @@ -0,0 +1,24 @@ +sekeywords_65b0b42febc8ea16db4652eab6f420a4'] = 'parole chiave dei motori di ricerca'; +$_MODULE['<{sekeywords}prestashop>sekeywords_de13be6263895a5efe4d51e15ab1535e'] = 'Visualizza le parole chiave che hanno portato i visitatori del tuo sito web'; +$_MODULE['<{sekeywords}prestashop>sekeywords_a6a5cc2d3979e54597c79a68448adee2'] = 'parola chiave corrisponde alla tua ricerca.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_abc9f128fb01c8504e08e77bfc8af795'] = 'parole chiave corrispondono alla tua ricerca.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_867343577fa1f33caa632a19543bd252'] = 'Parole chiave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_e52e6aa1a43a0187e44f048f658db5f9'] = 'Occorrenze'; +$_MODULE['<{sekeywords}prestashop>sekeywords_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{sekeywords}prestashop>sekeywords_0849140171616600e8f2c35f0a225212'] = 'Filtra per parole chiave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_188ef1f71ff3ef1c5501dc5c8ee27f88'] = 'e min. di occorrenze'; +$_MODULE['<{sekeywords}prestashop>sekeywords_03e0e9ef8b776b5f7bcc590e51bfa63b'] = 'Applica'; +$_MODULE['<{sekeywords}prestashop>sekeywords_7b48f6cc4a1dde7fca9597e717c2465f'] = 'Nessuna parola chiave'; +$_MODULE['<{sekeywords}prestashop>sekeywords_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{sekeywords}prestashop>sekeywords_39f040a1f174811285297763fcaada12'] = 'Identifica parole chiave motori di ricerca estenri'; +$_MODULE['<{sekeywords}prestashop>sekeywords_f4e8acc0e0cfc0653d6354c3ef878d29'] = 'Ci sono molti modi per trovare un sito web, ma uno dei più comuni è quello di trovarlo con un motore di ricerca. Identificare la maggior parte delle parole chiave \"visitatore-making\" inserite dai nuovi visitatori è molto importante, ti permette di vedere quale prodotto mettere in vista se vuoi più visitatori e clienti.'; +$_MODULE['<{sekeywords}prestashop>sekeywords_359f9e79e746fa9f684e5cda9e60ca2e'] = 'Come funziona?'; +$_MODULE['<{sekeywords}prestashop>sekeywords_b20af255c34d0a4ace56863dbd8f0c90'] = 'Quando un visitatore arriva al tuo sito web, il server conosce la sua posizione precedente. Questo modulo analizza l\'URL e trova le parole chiave in esso. Attualmente, gestisce i seguenti motori di ricerca:'; +$_MODULE['<{sekeywords}prestashop>sekeywords_be5d5d37542d75f93a87094459f76678'] = 'e'; +$_MODULE['<{sekeywords}prestashop>sekeywords_474c03326cba5cb2ce6c07ddf3e1e656'] = 'Presto sarà possibile aggiungere dinamicamente un nuovo motore di ricerca e contribuire a questo modulo!'; +$_MODULE['<{sekeywords}prestashop>sekeywords_8d01ac22a68176ddd7067da99508751d'] = 'Le prime 10 parole chiave '; +$_MODULE['<{sekeywords}prestashop>sekeywords_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Altri'; diff --git a/modules/sekeywords/logo.gif b/modules/sekeywords/logo.gif new file mode 100644 index 000000000..d5dd1e7b2 Binary files /dev/null and b/modules/sekeywords/logo.gif differ diff --git a/modules/sekeywords/sekeywords.php b/modules/sekeywords/sekeywords.php new file mode 100644 index 000000000..8ebf208ca --- /dev/null +++ b/modules/sekeywords/sekeywords.php @@ -0,0 +1,196 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class SEKeywords extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + + function __construct() + { + $this->name = 'sekeywords'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_query = ' + SELECT sek.`keyword`, COUNT(TRIM(sek.`keyword`)) as occurences + FROM `'._DB_PREFIX_.'sekeyword` sek + WHERE '.(Configuration::get('SEK_FILTER_KW') == '' ? '1' : 'sek.`keyword` REGEXP \''.pSQL(Configuration::get('SEK_FILTER_KW')).'\'').' + AND sek.`date_add` BETWEEN '; + $this->_query2 = ' + GROUP BY TRIM(sek.`keyword`) + HAVING occurences > '.(int)Configuration::get('SEK_MIN_OCCURENCES').' + ORDER BY occurences DESC'; + + parent::__construct(); + + $this->displayName = $this->l('Search engine keywords'); + $this->description = $this->l('Display which keywords have led visitors to your website.'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('top') OR !$this->registerHook('AdminStatsModules')) + return false; + Configuration::updateValue('SEK_MIN_OCCURENCES', 1); + Configuration::updateValue('SEK_FILTER_KW', ''); + return Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'sekeyword` ( + id_sekeyword INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + keyword VARCHAR(256) NOT NULL, + date_add DATETIME NOT NULL, + PRIMARY KEY(id_sekeyword) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + } + + function uninstall() + { + if (!parent::uninstall()) + return false; + return (Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'sekeyword`')); + } + + function hookTop($params) + { + if (!isset($_SERVER['HTTP_REFERER']) OR strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost(false, false))) + return; + if (!Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER'])) + return; + if ($keywords = $this->getKeywords($_SERVER['HTTP_REFERER'])) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'sekeyword` (`keyword`,`date_add`) + VALUES (\''.pSQL(Tools::strtolower(trim($keywords))).'\',\''.pSQL(date('Y-m-d H:i:s')).'\')'); + } + + function hookAdminStatsModules() + { + if (Tools::isSubmit('submitSEK')) + { + Configuration::updateValue('SEK_FILTER_KW', trim(Tools::getValue('SEK_FILTER_KW'))); + Configuration::updateValue('SEK_MIN_OCCURENCES', (int)Tools::getValue('SEK_MIN_OCCURENCES')); + Tools::redirectAdmin('index.php?tab=AdminStats&token='.Tools::getValue('token').'&module='.$this->name); + } + if (Tools::getValue('export')) + $this->csvExport(array('type' => 'pie')); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.ModuleGraph::getDateBetween().$this->_query2); + $total = count($result); + $this->_html = '
        '.$this->displayName.' + '.$total.' '.($total == 1 ? $this->l('keyword matches your query.') : $this->l('keywords match your query.')).'
         
        '; + if ($result AND count($result)) + { + $table = ' +
        + + + + + '; + foreach ($result as $index => $row) + { + $keyword =& $row['keyword']; + $occurences =& $row['occurences']; + $table .= ''; + } + $table .= '
        '.$this->l('Keywords').''.$this->l('Occurrences').'
        '.$keyword.''.$occurences.'
        '; + $this->_html .= '
        '.ModuleGraph::engine(array('type' => 'pie')).'
        +
        +

        '.$this->l('CSV Export').'


        +
        + '.$this->l('Filter by keyword').' + '.$this->l('and min occurrences').' + +
        +
        '.$table; + } + else + $this->_html .= '

        '.$this->l('No keywords').'

        '; + + $this->_html .= '

        +
        '.$this->l('Guide').' +

        '.$this->l('Identify external search engines\' keywords').'

        +

        '.$this->l('One of the most common ways of finding a website through a search engine. Identifying the most popular keywords entered by your new visitors allows you to see which products you should put in front if you want to attract more visitors and potential customers.').'


        +

        '.$this->l('How does it work?').'

        +

        '.$this->l('When a visitor comes to your website, the server notes their previous location. This module parses the URL and finds the keywords in it. Currently, it manages the following search engines:').' Google, AOL, Yandex, Ask, NHL, Yahoo, Baidu, Lycos, Exalead, Live, Voila '.$this->l('and').' Altavista. '.$this->l('Soon it will be possible to dynamically add new search engines and contribute to this module.').'


        +
        '; + return $this->_html; + } + + function getKeywords($url) + { + if (!Validate::isAbsoluteUrl($url)) + return false; + $parsedUrl = parse_url($url); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `server`, `getvar` FROM `'._DB_PREFIX_.'search_engine`'); + foreach ($result as $index => $row) + { + $host =& $row['server']; + $varname =& $row['getvar']; + if (strstr($parsedUrl['host'], $host)) + { + $kArray = array(); + if (!isset($parsedUrl['query'])) + return false; + preg_match('/[^a-z]'.$varname.'=.+\&'.'/U', $parsedUrl['query'], $kArray); + if (!isset($kArray[0]) OR empty($kArray[0])) + preg_match('/[^a-z]'.$varname.'=.+$'.'/', $parsedUrl['query'], $kArray); + if (!isset($kArray[0]) OR empty($kArray[0])) + return false; + $kString = urldecode(str_replace('+', ' ', ltrim(substr(rtrim($kArray[0], '&'), strlen($varname) + 1), '='))); + return $kString; + } + } + } + + protected function getData($layers) + { + $this->_titles['main'] = $this->l('10 first keywords'); + $totalResult = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + $total = 0; + $total2 = 0; + foreach ($totalResult as $totalRow) + $total += $totalRow['occurences']; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2.' LIMIT 9'); + foreach ($result as $row) + { + $this->_legend[] = $row['keyword']; + $this->_values[] = $row['occurences']; + $total2 += $row['occurences']; + } + if ($total >= $total2) + { + $this->_legend[] = $this->l('Others'); + $this->_values[] = $total - $total2; + } + } +} + + diff --git a/modules/sendtoafriend/config.xml b/modules/sendtoafriend/config.xml new file mode 100755 index 000000000..b870d5b0f --- /dev/null +++ b/modules/sendtoafriend/config.xml @@ -0,0 +1,11 @@ + + + sendtoafriend + Send to a Friend module + 1.1 + Allows customers to send a product link to a friend. + PrestaShop + front_office_features + 0 + 1 + \ No newline at end of file diff --git a/modules/sendtoafriend/de.php b/modules/sendtoafriend/de.php new file mode 100644 index 000000000..17ede0ff2 --- /dev/null +++ b/modules/sendtoafriend/de.php @@ -0,0 +1,21 @@ +product_page_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'An einen Freund senden'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2074615eb70699e55b1f9289c6c77c25'] = 'An einen Freund senden-Modul'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_3234e2609dd694d8763c390fe97eba04'] = 'Ermöglicht den Kunden, einen Produktlink an einen Freund zu senden'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_666f6333e43c215212b916fef3d94af0'] = 'Sie müssen alle Felder ausfüllen.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ed95f7e7c4691956e0d6f2cd0136d483'] = 'Die E-Mail Ihres Freunds ist ungültig.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_0e2a8a9d9c363a1ed93e7822eb3fc0ca'] = 'Der Name Ihres Freundes ist ungültig.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_98db77c121d8acdba66ec89626ae896c'] = 'Ein Fehler trat während des Prozesses auf.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_22c4733a9ceb239bf825a0cecd1cfaec'] = 'Ein Freund'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ffa719e6b8863717a9e86579249c7d9b'] = 'hat Ihnen einen Link zu geschickt'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'An einen Freund senden'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_20589174124c25654cac3736e737d2a3'] = 'Senden Sie diese Seite einem Freund, der an diesem Artiekl interessiert sein könnte.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_b31afdfa73c89b567778f15180c2dd6c'] = 'Ihre Email wurde erfolgreich versendet'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_cc5fd9b9f1cad59fcff97a1f21f34304'] = 'Senden Sie eine Nachricht'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_19d305aea0ccec77d23362111ebdb6b4'] = 'Name des Freundes:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_7ae8a9a7a5d8fa40d4515fc52f16bb2e'] = 'E-Mail des Freundes:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2541d938b0a58946090d7abdde0d3890'] = 'senden'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_68728c1897e5936032fe21ffb6b10c2e'] = 'Zurück zur Produktseite'; diff --git a/modules/sendtoafriend/en.php b/modules/sendtoafriend/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/sendtoafriend/en.php @@ -0,0 +1,4 @@ +product_page_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Enviar a un amigo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2074615eb70699e55b1f9289c6c77c25'] = 'Módulo enviar a un amigo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_3234e2609dd694d8763c390fe97eba04'] = 'Permitir a los clientes enviar un enlace del producto a un amigo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_666f6333e43c215212b916fef3d94af0'] = 'Debe rellenar todos los campos.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ed95f7e7c4691956e0d6f2cd0136d483'] = 'El email de su amigo no es correcto'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_0e2a8a9d9c363a1ed93e7822eb3fc0ca'] = 'El nombre de su amigo no es correcto'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_98db77c121d8acdba66ec89626ae896c'] = 'Se ha producido un error durante el proceso.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_22c4733a9ceb239bf825a0cecd1cfaec'] = 'Un amigo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ffa719e6b8863717a9e86579249c7d9b'] = 'te ha enviado un enlace a'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Enviar a un amigo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_20589174124c25654cac3736e737d2a3'] = 'Enviar esta página a un amigo al que podía interesarle este artículo.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_b31afdfa73c89b567778f15180c2dd6c'] = 'Su email ha sido enviado con éxito'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_cc5fd9b9f1cad59fcff97a1f21f34304'] = 'Enviar un mensaje'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_19d305aea0ccec77d23362111ebdb6b4'] = 'nombre del amigo:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_7ae8a9a7a5d8fa40d4515fc52f16bb2e'] = 'Email del amigo:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2541d938b0a58946090d7abdde0d3890'] = 'enviar'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_68728c1897e5936032fe21ffb6b10c2e'] = 'Volver a la página del producto'; diff --git a/modules/sendtoafriend/fr.php b/modules/sendtoafriend/fr.php new file mode 100644 index 000000000..5cbfbf9c0 --- /dev/null +++ b/modules/sendtoafriend/fr.php @@ -0,0 +1,21 @@ +product_page_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Envoyer à un ami'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2074615eb70699e55b1f9289c6c77c25'] = 'Module envoyer à un ami'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_3234e2609dd694d8763c390fe97eba04'] = 'Permet à vos clients d\'envoyer des liens à leurs amis'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_666f6333e43c215212b916fef3d94af0'] = 'Vous devez remplir tous les champs.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ed95f7e7c4691956e0d6f2cd0136d483'] = 'L\'email de votre ami est invalide.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_0e2a8a9d9c363a1ed93e7822eb3fc0ca'] = 'Le nom de votre ami est invalide.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_98db77c121d8acdba66ec89626ae896c'] = 'Une erreur est survenue durant le processus.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_22c4733a9ceb239bf825a0cecd1cfaec'] = 'Un ami'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ffa719e6b8863717a9e86579249c7d9b'] = 'vous a envoyé un lien pour'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Envoyer à un ami'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_20589174124c25654cac3736e737d2a3'] = 'Envoyer cette page à un ami susceptible d\'être intéressé par le produit ci-dessous'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_b31afdfa73c89b567778f15180c2dd6c'] = 'Votre email a bien été envoyé'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_cc5fd9b9f1cad59fcff97a1f21f34304'] = 'Envoyer un message'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_19d305aea0ccec77d23362111ebdb6b4'] = 'Nom de votre ami :'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_7ae8a9a7a5d8fa40d4515fc52f16bb2e'] = 'Email de votre ami :'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2541d938b0a58946090d7abdde0d3890'] = 'Envoyer'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_68728c1897e5936032fe21ffb6b10c2e'] = 'Retour à la fiche produit'; diff --git a/modules/sendtoafriend/it.php b/modules/sendtoafriend/it.php new file mode 100644 index 000000000..1a7d32859 --- /dev/null +++ b/modules/sendtoafriend/it.php @@ -0,0 +1,21 @@ +product_page_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Invia ad un amico'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2074615eb70699e55b1f9289c6c77c25'] = 'Modulo Invia ad un amico'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_3234e2609dd694d8763c390fe97eba04'] = 'Consente ai clienti di inviare un link prodotto a un amico'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_666f6333e43c215212b916fef3d94af0'] = 'È necessario compilare tutti i campi.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ed95f7e7c4691956e0d6f2cd0136d483'] = 'E-mail del tuo amico non valida.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_0e2a8a9d9c363a1ed93e7822eb3fc0ca'] = 'Nome del tuo amico non valido.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_98db77c121d8acdba66ec89626ae896c'] = 'Errore durante il processo.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_22c4733a9ceb239bf825a0cecd1cfaec'] = 'Un amico'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_ffa719e6b8863717a9e86579249c7d9b'] = 'ti ha inviato un link a'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2107f6398c37b4b9ee1e1b5afb5d3b2a'] = 'Invia ad un amico'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_20589174124c25654cac3736e737d2a3'] = 'Invia questa pagina ad un amico che potrebbe essere interessato all\'articolo seguente.'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_b31afdfa73c89b567778f15180c2dd6c'] = 'La tua mail è stata inviata con successo'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_cc5fd9b9f1cad59fcff97a1f21f34304'] = 'Invia un messaggio'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_19d305aea0ccec77d23362111ebdb6b4'] = 'Nome dell\'amico:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_7ae8a9a7a5d8fa40d4515fc52f16bb2e'] = 'E-mail del tuo amico:'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_2541d938b0a58946090d7abdde0d3890'] = 'invia'; +$_MODULE['<{sendtoafriend}prestashop>sendtoafriend_68728c1897e5936032fe21ffb6b10c2e'] = 'Torna alla pagina del prodotto'; diff --git a/modules/sendtoafriend/logo.gif b/modules/sendtoafriend/logo.gif new file mode 100644 index 000000000..8c31836bf Binary files /dev/null and b/modules/sendtoafriend/logo.gif differ diff --git a/modules/sendtoafriend/mails/de/send_to_a_friend.html b/modules/sendtoafriend/mails/de/send_to_a_friend.html new file mode 100644 index 000000000..3ad10ad4f --- /dev/null +++ b/modules/sendtoafriend/mails/de/send_to_a_friend.html @@ -0,0 +1,40 @@ + + + + + Nachricht von {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hallo {name},
         
        {customer} hat Ihnen einen Link zu dem Produkt gesandt, das Sie interessieren könnte.
         
        Klicken Sie hier, um den Artikel zu sehen: {product}
         
        {shop_name} unterstützt von PrestaShop™
        + + \ No newline at end of file diff --git a/modules/sendtoafriend/mails/de/send_to_a_friend.txt b/modules/sendtoafriend/mails/de/send_to_a_friend.txt new file mode 100644 index 000000000..402660973 --- /dev/null +++ b/modules/sendtoafriend/mails/de/send_to_a_friend.txt @@ -0,0 +1,13 @@ +Hallo {name}, + + +{customer} hat Ihnen einen Link zu dem Produkt gesandt, das Sie interessieren könnte. + +{product}: {product_link} + + +{shop_name} - {shop_url} + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/sendtoafriend/mails/en/send_to_a_friend.html b/modules/sendtoafriend/mails/en/send_to_a_friend.html new file mode 100644 index 000000000..e77dbab53 --- /dev/null +++ b/modules/sendtoafriend/mails/en/send_to_a_friend.html @@ -0,0 +1,36 @@ + + + + + Message from {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Hi {name},
         
        {customer} has sent you a link to a product that (s)he thinks may interest you.
         
        + Click here to view this item: {product} +
         
        + {shop_name} powered with PrestaShop™ +
        + + diff --git a/modules/sendtoafriend/mails/en/send_to_a_friend.txt b/modules/sendtoafriend/mails/en/send_to_a_friend.txt new file mode 100644 index 000000000..6ee66b52d --- /dev/null +++ b/modules/sendtoafriend/mails/en/send_to_a_friend.txt @@ -0,0 +1,13 @@ +Hi {name}, + + +{customer} has sent you a link to a product that (s)he thinks may interest you. + +{product}: {product_link} + + +{shop_name} - {shop_url} + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/sendtoafriend/mails/es/send_to_a_friend.html b/modules/sendtoafriend/mails/es/send_to_a_friend.html new file mode 100644 index 000000000..0a8f2d3c3 --- /dev/null +++ b/modules/sendtoafriend/mails/es/send_to_a_friend.html @@ -0,0 +1,41 @@ + + + + + Mensaje de {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
         
        Hola {name},
         
        {customer} te ha enviado un vínculo a un producto que él piensa que pueden interesarle.
         
        Haga clic aquí para ver este artículo: {product}
         
        {shop_name} desarrollado por PrestaShop™
        + + + \ No newline at end of file diff --git a/modules/sendtoafriend/mails/es/send_to_a_friend.txt b/modules/sendtoafriend/mails/es/send_to_a_friend.txt new file mode 100644 index 000000000..1b27b1c37 --- /dev/null +++ b/modules/sendtoafriend/mails/es/send_to_a_friend.txt @@ -0,0 +1,13 @@ +Hola {name}, + + +{customer} te ha enviado un vínculo a un producto que él piensa que pueden interesarle. + +{product}: {product_link} + + +{shop_name} - {shop_url} + + + +{shop_url} desarrollado por PrestaShop™ \ No newline at end of file diff --git a/modules/sendtoafriend/mails/fr/send_to_a_friend.html b/modules/sendtoafriend/mails/fr/send_to_a_friend.html new file mode 100644 index 000000000..8cdc2033b --- /dev/null +++ b/modules/sendtoafriend/mails/fr/send_to_a_friend.html @@ -0,0 +1,36 @@ + + + + + Message depuis {shop_name} + + + + + + + + + + + + + + + + + + + + + + +
        + {shop_name} +
         
        Bonjour {name},
         
        {customer} vous envoie un lien vers un produit qui pourrait vous intéresser.
         
        + Il s'agit de {product} +
         
        + {shop_name} réalisé avec PrestaShop™ +
        + + diff --git a/modules/sendtoafriend/mails/fr/send_to_a_friend.txt b/modules/sendtoafriend/mails/fr/send_to_a_friend.txt new file mode 100644 index 000000000..989fadc41 --- /dev/null +++ b/modules/sendtoafriend/mails/fr/send_to_a_friend.txt @@ -0,0 +1,13 @@ +Bonjour {name}, + + +{customer} vous envoie un lien vers un produit qui pourrait vous intéresser. + +Il s'agit de {product} : {product_link} + + +{shop_name} - {shop_url} + + + +{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/modules/sendtoafriend/mails/it/send_to_a_friend.html b/modules/sendtoafriend/mails/it/send_to_a_friend.html new file mode 100644 index 000000000..5dd1d6009 --- /dev/null +++ b/modules/sendtoafriend/mails/it/send_to_a_friend.html @@ -0,0 +1,40 @@ + + + + + Messaggio da {shop_name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {shop_name}
        Salve {name},
        {customer} ti ha inviato un link per un prodotto che potrebbe interessarti.
        Clicca qui per vedere questo articolo: {product}
        {shop_name} powered with PrestaShop™
        + + \ No newline at end of file diff --git a/modules/sendtoafriend/mails/it/send_to_a_friend.txt b/modules/sendtoafriend/mails/it/send_to_a_friend.txt new file mode 100644 index 000000000..4e54dc4fe --- /dev/null +++ b/modules/sendtoafriend/mails/it/send_to_a_friend.txt @@ -0,0 +1,13 @@ +Salve {name}, + + +{customer} ti ha inviato un link per un prodotto che potrebbe interessarti. + +{product}: {product_link} + + +{shop_name} - {shop_url} + + + +{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/modules/sendtoafriend/product_page.tpl b/modules/sendtoafriend/product_page.tpl new file mode 100644 index 000000000..1d20199e6 --- /dev/null +++ b/modules/sendtoafriend/product_page.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
      • {l s='Send to a friend' mod='sendtoafriend'}
      • diff --git a/modules/sendtoafriend/sendtoafriend-form.php b/modules/sendtoafriend/sendtoafriend-form.php new file mode 100644 index 000000000..91da531f7 --- /dev/null +++ b/modules/sendtoafriend/sendtoafriend-form.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../header.php'); +require_once(dirname(__FILE__).'/sendtoafriend.php'); + +$sendtoafriend = new sendToAFriend(); +echo $sendtoafriend->displayFrontForm(); + +include(dirname(__FILE__).'/../../footer.php'); + diff --git a/modules/sendtoafriend/sendtoafriend.php b/modules/sendtoafriend/sendtoafriend.php new file mode 100644 index 000000000..e732a4641 --- /dev/null +++ b/modules/sendtoafriend/sendtoafriend.php @@ -0,0 +1,131 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class sendToAFriend extends Module +{ + function __construct() + { + $this->name = 'sendtoafriend'; + $this->version = '1.1'; + $this->author = 'PrestaShop'; + $this->tab = 'front_office_features'; + + parent::__construct(); + + $this->displayName = $this->l('Send to a Friend module'); + $this->description = $this->l('Allows customers to send a product link to a friend.'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('extraLeft')) + return false; + return true; + } + + function hookExtraLeft($params) + { + global $smarty; + $smarty->assign('this_path', $this->_path); + return $this->display(__FILE__, 'product_page.tpl'); + } + + public function displayFrontForm() + { + global $smarty; + $error = false; + $confirm = false; + + if (isset($_POST['submitAddtoafriend'])) + { + global $cookie, $link; + /* Product informations */ + $product = new Product((int)(Tools::getValue('id_product')), false, (int)($cookie->id_lang)); + $productLink = $link->getProductLink($product); + + /* Fields verifications */ + if (empty($_POST['email']) OR empty($_POST['name'])) + $error = $this->l('You must fill in all fields.'); + elseif (empty($_POST['email']) OR !Validate::isEmail($_POST['email'])) + $error = $this->l('The e-mail given is invalid.'); + elseif (!Validate::isName($_POST['name'])) + $error = $this->l('The name given is invalid.'); + elseif (!isset($_GET['id_product']) OR !is_numeric($_GET['id_product'])) + $error = $this->l('An error occurred during the process.'); + else + { + /* Email generation */ + $subject = ($cookie->customer_firstname ? $cookie->customer_firstname.' '.$cookie->customer_lastname : $this->l('A friend')).' '.$this->l('sent you a link to').' '.$product->name; + $templateVars = array( + '{product}' => $product->name, + '{product_link}' => $productLink, + '{customer}' => ($cookie->customer_firstname ? $cookie->customer_firstname.' '.$cookie->customer_lastname : $this->l('A friend')), + '{name}' => Tools::safeOutput($_POST['name']) + ); + + /* Email sending */ + if (!Mail::Send((int)($cookie->id_lang), 'send_to_a_friend', Mail::l('A friend sent you a link to').' '.$product->name, $templateVars, $_POST['email'], NULL, ($cookie->email ? $cookie->email : NULL), ($cookie->customer_firstname ? $cookie->customer_firstname.' '.$cookie->customer_lastname : NULL), NULL, NULL, dirname(__FILE__).'/mails/')) + $error = $this->l('An error occurred during the process.'); + else + Tools::redirect(_MODULE_DIR_.'/'.$this->name.'/sendtoafriend-form.php?id_product='.$product->id.'&submited'); + } + } + else + { + global $cookie, $link; + /* Product informations */ + $product = new Product((int)(Tools::getValue('id_product')), false, (int)($cookie->id_lang)); + $productLink = $link->getProductLink($product); + } + + /* Image */ + $images = $product->getImages((int)($cookie->id_lang)); + foreach ($images AS $k => $image) + if ($image['cover']) + { + $cover['id_image'] = (int)($product->id).'-'.(int)($image['id_image']); + $cover['legend'] = $image['legend']; + } + + if (!isset($cover)) + $cover = array('id_image' => Language::getIsoById((int)($cookie->id_lang)).'-default', 'legend' => 'No picture'); + + $smarty->assign(array( + 'cover' => $cover, + 'errors' => $error, + 'confirm' => $confirm, + 'product' => $product, + 'productLink' => $productLink + )); + + return $this->display(__FILE__, 'sendtoafriend.tpl'); + } +} + diff --git a/modules/sendtoafriend/sendtoafriend.png b/modules/sendtoafriend/sendtoafriend.png new file mode 100644 index 000000000..4a6c5d396 Binary files /dev/null and b/modules/sendtoafriend/sendtoafriend.png differ diff --git a/modules/sendtoafriend/sendtoafriend.tpl b/modules/sendtoafriend/sendtoafriend.tpl new file mode 100644 index 000000000..a094f4217 --- /dev/null +++ b/modules/sendtoafriend/sendtoafriend.tpl @@ -0,0 +1,66 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Send to a friend' mod='sendtoafriend'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Send to a friend' mod='sendtoafriend'}

        + +

        {l s='Send this page to a friend who might be interested in the item below.' mod='sendtoafriend'}.

        +{include file="$tpl_dir./errors.tpl"} + +{if isset($smarty.get.submited)} +

        {l s='Your email has been sent successfully' mod='sendtoafriend'}

        +{else} +
        +
        +

        {l s='Send a message' mod='sendtoafriend'}

        + +

        +
        + {$product->name} +

        + +

        + + +

        +

        + + +

        + +

        + +

        +
        +
        +{/if} + + + diff --git a/modules/shopimporter/ajax.php b/modules/shopimporter/ajax.php new file mode 100644 index 000000000..98cab837f --- /dev/null +++ b/modules/shopimporter/ajax.php @@ -0,0 +1,135 @@ +supportedImports as $key => $import) + { + if (array_key_exists('alterTable', $import)) + $columns = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.pSQL($import['table']).'`'); + foreach ($columns as $column) + if ($column['Field'] == $import['identifier'].$moduleName) + Db::getInstance()->Execute('ALTER TABLE `'.pSQL($import['table']).'` DROP `'.pSQL($import['identifier'].$moduleName).'`'); + } + + + + if ($link = @mysql_connect(Tools::getValue('server'), Tools::getValue('user'), Tools::getValue('password'))) + { + if (!@mysql_select_db(Tools::getValue('database'), $link)) + die('{"hasError" : true, "error" : ["'.Tools::displayError('The database selection cannot be made.').'"]}'); + else + { + @mysql_close($link); + die('{"hasError" : false, "error" : []}'); + } + } + else + die('{"hasError" : true, "error" : ["'.Tools::displayError('Link to database cannot be established.').'"]}'); + +} + +if (Tools::isSubmit('getData') || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency')) +{ + if (Tools::isSubmit('syncLang')) + $save = true; + + if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) + { + require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php'); + $importModule = new $moduleName(); + $importModule->server = $server; + $importModule->user = $user; + $importModule->passwd = $password; + $importModule->database = $database; + $importModule->prefix = $prefix; + if (!method_exists($importModule, $getMethod)) + die('{"hasError" : true, "error" : ["not_exist"], "datas" : []}'); + else + { + $return = call_user_func_array(array($importModule, $getMethod), array($limit, $nbr_import)); + $shopImporter = new shopImporter(); + $shopImporter->generiqueImport($className, $return, (bool)$save); + } + } +} + +if (Tools::isSubmit('truncatTable')) +{ + $shopImporter = new shopImporter(); + if ($shopImporter->truncateTable($className)) + die('{"hasError" : false, "error" : []}'); + else + die('{"hasError" : true, "error" : ["'.$className.'"]}'); + +} + +if (Tools::isSubmit('alterTable')) +{ + $shopImporter = new shopImporter(); + if ($shopImporter->alterTable($className)) + die('{"hasError" : false, "error" : []}'); + else + die('{"hasError" : true, "error" : ["'.$className.'"]}'); + +} + +if (Tools::isSubmit('displaySpecificOptions')) +{ + if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) + { + require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php'); + $importModule = new $moduleName(); + $importModule->server = $server; + $importModule->user = $user; + $importModule->passwd = $password; + $importModule->database = $database; + $importModule->prefix = $prefix; + if ($link = @mysql_connect(Tools::getValue('server'), Tools::getValue('user'), Tools::getValue('password'))) + { + if(!@mysql_select_db(Tools::getValue('database'), $link)) + die(Tools::displayError('The database selection cannot be made.')); + elseif (method_exists($importModule, 'displaySpecificOptions')) + die($importModule->displaySpecificOptions()); + else + die('not_exist'); + } + else + die(Tools::displayError('Link to database cannot be established.')); + } +} +if (Tools::isSubmit('validateSpecificOptions')) +{ + if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) + { + require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php'); + $importModule = new $moduleName(); + if (!method_exists($importModule, 'validateSpecificOptions')) + die('{"hasError" : true, "error" : ["not_exist"]}'); + else + die($importModule->validateSpecificOptions()); + } +} + +?> \ No newline at end of file diff --git a/modules/shopimporter/config.xml b/modules/shopimporter/config.xml new file mode 100644 index 000000000..d9a7e27d8 --- /dev/null +++ b/modules/shopimporter/config.xml @@ -0,0 +1,11 @@ + + + shopimporter + Shop Importer + 1.0 + This module allows you to import your shop from another system into Prestashop. + PrestaShop + migration_tools + 1 + 1 + \ No newline at end of file diff --git a/modules/shopimporter/de.php b/modules/shopimporter/de.php new file mode 100644 index 000000000..f4c81ebf8 --- /dev/null +++ b/modules/shopimporter/de.php @@ -0,0 +1,92 @@ +shopimporter_d714c742b360a8ecbb124c15e9a391a1'] = 'Shop Importeur'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8c0fe18034f47d7d3dd3e58098e3ffdb'] = 'Dieses Modul ermöglicht es Ihnen, Ihren Shop aus einem anderen System zu prestashop zu importieren '; +$_MODULE['<{shopimporter}prestashop>shopimporter_4994a8ffeba4ac3140beb89e8d41f174'] = 'Sprache'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a9db6adcdafc85c5830439401fd866f6'] = 'Sprachen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b8b8ca447e355455b8dc638993c41ae7'] = 'Neue Sprachen fügen automatisch Übersetzungen hinzu!'; +$_MODULE['<{shopimporter}prestashop>shopimporter_386c339d37e737a436499d423a77df0c'] = 'Währung'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4234c64201820401dfa04eeb449c1bbc'] = 'Währungen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_719fec04166d6fa75f89cd29ad61fa8c'] = 'Steuern'; +$_MODULE['<{shopimporter}prestashop>shopimporter_94c5ffc9d364127b232f58b4cfd8c88a'] = 'Steuern importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_d3352014303b292984466bbb1da371db'] = 'Steuerregeln'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6ec25fc9cc7df7b0d1fce57923f46ec1'] = 'Steuerregeln importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3ff996fe5c77610359114835baf9b38'] = 'Zone'; +$_MODULE['<{shopimporter}prestashop>shopimporter_21d250d17e35e3e02db9f1a618bad913'] = 'Zone importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_59716c97497eb9694541f7c3d37b1a4d'] = 'Land'; +$_MODULE['<{shopimporter}prestashop>shopimporter_13eedcf49d68ce49274db71e63a7aa3d'] = 'Länder importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_46a2a41cc6e552044816a2d04634545d'] = 'Staat'; +$_MODULE['<{shopimporter}prestashop>shopimporter_118421de3201927a23bf921057e69c4a'] = 'Staaten importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_03937134cedab9078be39a77ee3a48a0'] = 'Gruppe'; +$_MODULE['<{shopimporter}prestashop>shopimporter_65ac19ad248219902394739bda0cef62'] = 'Gruppen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{shopimporter}prestashop>shopimporter_22c34564e80ce8adab6a235061d277f4'] = 'Kunden importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{shopimporter}prestashop>shopimporter_77497d022aeb4cdd78ec394ca8d223b4'] = 'Adressen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Hersteller'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ed4cbbbeb3d575ccfeb405ae5c5c4d43'] = 'Hersteller importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ec136b444eede3bc85639fac0dd06229'] = 'Zulieferer'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0ae5f9c75e6a7460ec31e33201576bd9'] = 'Zulieferer importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1db7ae20c24e257b6f1a7def365da1ad'] = 'Kategorien importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1f5a36b380c53d7f82e762baa08c2e5c'] = 'Attributgruppen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7eb915ee907703ede51dabab88fc1701'] = 'Attributgruppen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribute'; +$_MODULE['<{shopimporter}prestashop>shopimporter_66e2d23b2d257d56af6f1d6443ce0ce3'] = 'Attribute importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_deb10517653c255364175796ace3553f'] = 'Produkt'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4bfc4a7632bae0877b798dbd9efc4f70'] = 'Produkte importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_47ac923d219501859fb68fed8c8db77b'] = 'Kombination'; +$_MODULE['<{shopimporter}prestashop>shopimporter_58e2fcec5e04716c627b3e8b9d2955b1'] = 'Produktkombinationen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3df6b363e7979ce81b71d92961fc672'] = 'Bestellstatus'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6b24bd15b10bc10de9687f16ebe728e4'] = 'Bestellstatus importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a240fa27925a635b08dc28c9e4f9216d'] = 'Bestellung'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3b7e768ebab2171baa41d5ea13017b02'] = 'Bestellungen importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_582602d7c6762c923cf7fce178b94e1a'] = 'Bestellverlauf'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2931b8b1622867fcc461d7de388e319'] = 'Bestellverlauf importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_32a6deec3cca312a54d6b8769c9b8dd7'] = 'nicht in diesem Modul verfügbar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1e411d25230ba738b9ae583bcb9b0b57'] = 'Verbindung zur Datenbank ok'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3596c777cbc8b72d678f34daabc9148b'] = 'Fehler anzeigen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_89a399eee52b2a6daaea92eba3e14cad'] = 'Importprozess testen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_bf79359f8edda6f7df97ef57a4ee09b6'] = 'Import starten'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0b5a6ead644b8ae4edb8a036334c9ed6'] = 'Beim Import sind Fehler aufgetreten. Weitere Details siehe unter \"Fehler anzeigen\"'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e905d0eb5204b761d8c0e3eebed4a0e0'] = 'Der Import ist abgeschlossen.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_596403b61367ca30d6de75812275f9cd'] = 'Daten entfernen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_edc186cbc5cc897a79312880ec16c621'] = 'Bitte wählen Sie etwas zum Importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_81b33153f65252001fe132d74b658fbe'] = 'Aus einem anderen System importieren'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd4c0c798ebbf8c6e15dcba8632f558d'] = 'Vor dem Start des Import, sichern Sie bitte eine Kopie Ihrer Datenbank. '; +$_MODULE['<{shopimporter}prestashop>shopimporter_60474e812295a5adc371de63dc62a164'] = 'Für das Backup hier klicken'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05f4be265d59ea66f3a1fb12ba103583'] = 'Wählen Sie Ihren Import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_961f2247a2070bedff9f9cd8d64e2650'] = 'Wählen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_151a0fbfcc4894aa53335091c2512de5'] = 'Kein Import-Modul installiert'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9aa1b03934893d7134a660af4204f2a9'] = 'Server'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8f9bfe9d1345237cb3b2b205864da075'] = 'Benutzer'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e307db07b3975fef922a80d07455ee5e'] = 'Datenbank'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dac130bdd2c5492a8108a4145bd9f04a'] = 'Datenbank-Präfix'; +$_MODULE['<{shopimporter}prestashop>shopimporter_2bb4cbbf4c51025867d47131e79ad05f'] = 'Nächster Schritt'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72dd98a453e92ccc01697f29bb5dbeb9'] = 'Import-Optionen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9dfc5d5738312210c3c75e68a468691d'] = 'Advanced-Optionen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c195d4db1be0d349d21f236f0a6400ff'] = 'Dieser Modus ist gefährlich'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11e9fa925cb444a223769edd53334f13'] = 'Import für jeden'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70fda5850e8d8946a340c55bf985fd39'] = 'Wählen Sie die Vorkommenszahl für jede Import-Anfrage'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35f178a340d9aa1a080d8cfaf0b57f36'] = 'Falls Fehler auftreten'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11a755d598c0c417f9a36758c3da7481'] = 'Anhalten'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72ef2b9b6965d078e3c7f95487a82d1c'] = 'Überspringen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9eb6b78a99cdb6ffd3d40d18621d9f80'] = 'Erzwingen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05d2b3715ac0c697b86799d1989c4aeb'] = 'Anhalten: wenn die Daten fehlerhaft sind, läuft der Import nicht.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_690c3a7f595050729df99a6d30dd6f96'] = 'Überspringen: wenn die Daten fehlerhaft sind, überspringt der Import fehlerhafte Daten.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35a6535254a93c5338bff1e3572755d2'] = 'Erzwingen: wenn die Daten fehlerhaft sind, ersetzt der Import fehlerhafte Daten durch Ersatzdaten.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_09b4382d10c396e0c4fcd51064702213'] = 'Spezielle Optionen'; +$_MODULE['<{shopimporter}prestashop>shopimporter_044a8ce60a6c5a464e7a7f78698fc05d'] = 'Standardsprache stimmt nicht überein:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_807079d19357b6d44089c220f74cc2d0'] = 'Bitte ändern Sie die Standardsprache in Ihrer Konfiguration'; +$_MODULE['<{shopimporter}prestashop>shopimporter_29361e9c6917fb14b43d3e78e2811e56'] = 'Standardwährung stimmt nicht überein:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6117c4d73fcf0c20fe3946f1d00dde85'] = 'Bitte ändern Sie die Standardwährung in Ihrer Konfiguration'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8136c99d09cb6e9f0f998dd231fff6ed'] = 'Ein Fehler ist beim Hinzufügen des Objekts aufgetreten'; +$_MODULE['<{shopimporter}prestashop>shopimporter_01f8544c8fd4628bc686502e8b727d95'] = 'das Feld'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0a5fa53f3f20f67f98bd6c3b16df059d'] = 'ist erforderlich'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f755e8b92cb8f02c24f6f539180d45b1'] = 'ist zu lang'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70f4b635847038d056e33959821a7a66'] = 'max. Warenkörbe'; +$_MODULE['<{shopimporter}prestashop>shopimporter_998b344cff693ad388a14ba89b1523c7'] = 'ist ungültig'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7e47a344b06d82a8836cbee2748a79e6'] = 'ist mindestens erforderlich in'; diff --git a/modules/shopimporter/es.php b/modules/shopimporter/es.php new file mode 100644 index 000000000..41f1d3d89 --- /dev/null +++ b/modules/shopimporter/es.php @@ -0,0 +1,92 @@ +shopimporter_d714c742b360a8ecbb124c15e9a391a1'] = 'Import de tienda'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8c0fe18034f47d7d3dd3e58098e3ffdb'] = 'Este módulo le permite importar su tienda a partir de otro sistema.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4994a8ffeba4ac3140beb89e8d41f174'] = 'Idiomas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a9db6adcdafc85c5830439401fd866f6'] = 'Import de idiomas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b8b8ca447e355455b8dc638993c41ae7'] = 'Los nuevos idiomas añadirán automáticamente las traducciones'; +$_MODULE['<{shopimporter}prestashop>shopimporter_386c339d37e737a436499d423a77df0c'] = 'Divisa'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4234c64201820401dfa04eeb449c1bbc'] = 'Import de las divisas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_719fec04166d6fa75f89cd29ad61fa8c'] = 'Impuestos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_94c5ffc9d364127b232f58b4cfd8c88a'] = 'Importar los impuestos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_d3352014303b292984466bbb1da371db'] = 'TaxesRules'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6ec25fc9cc7df7b0d1fce57923f46ec1'] = 'Importar Taxes Rules'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3ff996fe5c77610359114835baf9b38'] = 'Zona'; +$_MODULE['<{shopimporter}prestashop>shopimporter_21d250d17e35e3e02db9f1a618bad913'] = 'Import de las zonas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_59716c97497eb9694541f7c3d37b1a4d'] = 'País'; +$_MODULE['<{shopimporter}prestashop>shopimporter_13eedcf49d68ce49274db71e63a7aa3d'] = 'Import de los países'; +$_MODULE['<{shopimporter}prestashop>shopimporter_46a2a41cc6e552044816a2d04634545d'] = 'Estados'; +$_MODULE['<{shopimporter}prestashop>shopimporter_118421de3201927a23bf921057e69c4a'] = 'Import de los estados'; +$_MODULE['<{shopimporter}prestashop>shopimporter_03937134cedab9078be39a77ee3a48a0'] = 'Grupo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_65ac19ad248219902394739bda0cef62'] = 'Import de los grupos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{shopimporter}prestashop>shopimporter_22c34564e80ce8adab6a235061d277f4'] = 'Import de los clientes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd7bf230fde8d4836917806aff6a6b27'] = 'Dirección'; +$_MODULE['<{shopimporter}prestashop>shopimporter_77497d022aeb4cdd78ec394ca8d223b4'] = 'Import de las direcciones'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabricante'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ed4cbbbeb3d575ccfeb405ae5c5c4d43'] = 'Import de los fabricantes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ec136b444eede3bc85639fac0dd06229'] = 'Proveedor'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0ae5f9c75e6a7460ec31e33201576bd9'] = 'Import de los fabricantes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1db7ae20c24e257b6f1a7def365da1ad'] = 'Import de las categorías'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1f5a36b380c53d7f82e762baa08c2e5c'] = 'Grupo de atributos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7eb915ee907703ede51dabab88fc1701'] = 'Import grupos de atributos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Atributo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_66e2d23b2d257d56af6f1d6443ce0ce3'] = 'Import de atributos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_deb10517653c255364175796ace3553f'] = 'Producto'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4bfc4a7632bae0877b798dbd9efc4f70'] = 'Import de los productos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_47ac923d219501859fb68fed8c8db77b'] = 'Combinación'; +$_MODULE['<{shopimporter}prestashop>shopimporter_58e2fcec5e04716c627b3e8b9d2955b1'] = 'Import de las declinaciones de los productos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3df6b363e7979ce81b71d92961fc672'] = 'Estados de los pedidos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6b24bd15b10bc10de9687f16ebe728e4'] = 'Import des estado de los pedidos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a240fa27925a635b08dc28c9e4f9216d'] = 'Pedido'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3b7e768ebab2171baa41d5ea13017b02'] = 'Import de los pedidos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_582602d7c6762c923cf7fce178b94e1a'] = 'Historial de los pedidos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2931b8b1622867fcc461d7de388e319'] = 'Import del historial de los pedidos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_32a6deec3cca312a54d6b8769c9b8dd7'] = 'no se encuentra disponible en este módulo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1e411d25230ba738b9ae583bcb9b0b57'] = 'Connexión a la base de datos OK'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3596c777cbc8b72d678f34daabc9148b'] = 'Mostrar los errores'; +$_MODULE['<{shopimporter}prestashop>shopimporter_89a399eee52b2a6daaea92eba3e14cad'] = 'Lanzar el test de import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_bf79359f8edda6f7df97ef57a4ee09b6'] = 'Ejecutar importación'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0b5a6ead644b8ae4edb8a036334c9ed6'] = 'Se han producido errores durante la importación. Para más detalles haga clic en \"Mostrar errores\"'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e905d0eb5204b761d8c0e3eebed4a0e0'] = 'El import ha terminado'; +$_MODULE['<{shopimporter}prestashop>shopimporter_596403b61367ca30d6de75812275f9cd'] = 'Supresión de los datos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_edc186cbc5cc897a79312880ec16c621'] = 'Por favor seleccione algún elemento para importar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_81b33153f65252001fe132d74b658fbe'] = 'Importar a partir de otro sistema'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd4c0c798ebbf8c6e15dcba8632f558d'] = 'Antes de empezar la importación, por favor haga una copia de seguridad de sus base de datos.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_60474e812295a5adc371de63dc62a164'] = 'Pulsar aquí para guardar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05f4be265d59ea66f3a1fb12ba103583'] = 'Elegir un import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_961f2247a2070bedff9f9cd8d64e2650'] = 'Elegir'; +$_MODULE['<{shopimporter}prestashop>shopimporter_151a0fbfcc4894aa53335091c2512de5'] = 'No hay ningún módulo de importación instalado'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9aa1b03934893d7134a660af4204f2a9'] = 'Servidor'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8f9bfe9d1345237cb3b2b205864da075'] = 'Usuario'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e307db07b3975fef922a80d07455ee5e'] = 'Base de datos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dac130bdd2c5492a8108a4145bd9f04a'] = 'Prefijo de la base de datos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_2bb4cbbf4c51025867d47131e79ad05f'] = 'Etapa siguiente'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72dd98a453e92ccc01697f29bb5dbeb9'] = 'Opción de import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9dfc5d5738312210c3c75e68a468691d'] = 'Opciones avanzadas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c195d4db1be0d349d21f236f0a6400ff'] = 'Este modo no es aconsejable'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11e9fa925cb444a223769edd53334f13'] = 'Importar para'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70fda5850e8d8946a340c55bf985fd39'] = 'Seleccionar el número de ocurrencias para cada consulta para importar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35f178a340d9aa1a080d8cfaf0b57f36'] = 'Si hay errores'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11a755d598c0c417f9a36758c3da7481'] = 'Stop'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72ef2b9b6965d078e3c7f95487a82d1c'] = 'Saltar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9eb6b78a99cdb6ffd3d40d18621d9f80'] = 'Forzar'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05d2b3715ac0c697b86799d1989c4aeb'] = 'Stop: si hay errores, la importación no funciona'; +$_MODULE['<{shopimporter}prestashop>shopimporter_690c3a7f595050729df99a6d30dd6f96'] = 'Saltar: si hay errores, la importación va a saltar los datos incorrectos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35a6535254a93c5338bff1e3572755d2'] = 'Forzar: si hay errores, la importación sustituirá los datos incorrectos por datos genéricos.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_09b4382d10c396e0c4fcd51064702213'] = 'Opciones específicas'; +$_MODULE['<{shopimporter}prestashop>shopimporter_044a8ce60a6c5a464e7a7f78698fc05d'] = 'El idioma por defecto no coincide:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_807079d19357b6d44089c220f74cc2d0'] = 'Por favor, cambie el idioma por defecto en la configuración'; +$_MODULE['<{shopimporter}prestashop>shopimporter_29361e9c6917fb14b43d3e78e2811e56'] = 'La moneda por defecto no coincide:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6117c4d73fcf0c20fe3946f1d00dde85'] = 'Por favor, cambie la moneda por defecto en la configuración'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8136c99d09cb6e9f0f998dd231fff6ed'] = 'Se produjo un error al agregar el objeto'; +$_MODULE['<{shopimporter}prestashop>shopimporter_01f8544c8fd4628bc686502e8b727d95'] = 'el campo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0a5fa53f3f20f67f98bd6c3b16df059d'] = 'es necesario'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f755e8b92cb8f02c24f6f539180d45b1'] = 'es demasiado largo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70f4b635847038d056e33959821a7a66'] = 'caracteres máximos'; +$_MODULE['<{shopimporter}prestashop>shopimporter_998b344cff693ad388a14ba89b1523c7'] = 'no es válido'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7e47a344b06d82a8836cbee2748a79e6'] = 'es necesario en'; diff --git a/modules/shopimporter/fr.php b/modules/shopimporter/fr.php new file mode 100644 index 000000000..bbb5d3e8c --- /dev/null +++ b/modules/shopimporter/fr.php @@ -0,0 +1,92 @@ +shopimporter_d714c742b360a8ecbb124c15e9a391a1'] = 'Import de boutique'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8c0fe18034f47d7d3dd3e58098e3ffdb'] = 'Ce module vous permet d\'importer votre boutique depuis autre système.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4994a8ffeba4ac3140beb89e8d41f174'] = 'Langues'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a9db6adcdafc85c5830439401fd866f6'] = 'Import des langues'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b8b8ca447e355455b8dc638993c41ae7'] = 'Les nouveaux langages ajouterons automatiquement les traductions'; +$_MODULE['<{shopimporter}prestashop>shopimporter_386c339d37e737a436499d423a77df0c'] = 'Devise'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4234c64201820401dfa04eeb449c1bbc'] = 'Import des devises'; +$_MODULE['<{shopimporter}prestashop>shopimporter_719fec04166d6fa75f89cd29ad61fa8c'] = 'Taxes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_94c5ffc9d364127b232f58b4cfd8c88a'] = 'Importer les taxes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_d3352014303b292984466bbb1da371db'] = 'Règle de taxes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6ec25fc9cc7df7b0d1fce57923f46ec1'] = 'Importer les règles de taxes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3ff996fe5c77610359114835baf9b38'] = 'Zone'; +$_MODULE['<{shopimporter}prestashop>shopimporter_21d250d17e35e3e02db9f1a618bad913'] = 'Import des zones'; +$_MODULE['<{shopimporter}prestashop>shopimporter_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays'; +$_MODULE['<{shopimporter}prestashop>shopimporter_13eedcf49d68ce49274db71e63a7aa3d'] = 'Import des pays'; +$_MODULE['<{shopimporter}prestashop>shopimporter_46a2a41cc6e552044816a2d04634545d'] = 'Etats'; +$_MODULE['<{shopimporter}prestashop>shopimporter_118421de3201927a23bf921057e69c4a'] = 'Import des états'; +$_MODULE['<{shopimporter}prestashop>shopimporter_03937134cedab9078be39a77ee3a48a0'] = 'Groupe'; +$_MODULE['<{shopimporter}prestashop>shopimporter_65ac19ad248219902394739bda0cef62'] = 'Import des groupes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{shopimporter}prestashop>shopimporter_22c34564e80ce8adab6a235061d277f4'] = 'Import des clients'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse'; +$_MODULE['<{shopimporter}prestashop>shopimporter_77497d022aeb4cdd78ec394ca8d223b4'] = 'Import des adresses'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabricant'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ed4cbbbeb3d575ccfeb405ae5c5c4d43'] = 'Import des Fabricants'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ec136b444eede3bc85639fac0dd06229'] = 'Fournisseur'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0ae5f9c75e6a7460ec31e33201576bd9'] = 'Import des Fournisseurs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categorie'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1db7ae20c24e257b6f1a7def365da1ad'] = 'Import des categories'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1f5a36b380c53d7f82e762baa08c2e5c'] = 'Groupe d\'attributs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7eb915ee907703ede51dabab88fc1701'] = 'Import des groupes d\'attributs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribut'; +$_MODULE['<{shopimporter}prestashop>shopimporter_66e2d23b2d257d56af6f1d6443ce0ce3'] = 'Import des attributs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4bfc4a7632bae0877b798dbd9efc4f70'] = 'Import des produits'; +$_MODULE['<{shopimporter}prestashop>shopimporter_47ac923d219501859fb68fed8c8db77b'] = 'Déclinaison'; +$_MODULE['<{shopimporter}prestashop>shopimporter_58e2fcec5e04716c627b3e8b9d2955b1'] = 'Import des déclinaisons de produits'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3df6b363e7979ce81b71d92961fc672'] = 'Statuts de commande'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6b24bd15b10bc10de9687f16ebe728e4'] = 'Import des statuts de commande'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3b7e768ebab2171baa41d5ea13017b02'] = 'Import des commandes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_582602d7c6762c923cf7fce178b94e1a'] = 'Historique de commande'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2931b8b1622867fcc461d7de388e319'] = 'Import des historique de commande'; +$_MODULE['<{shopimporter}prestashop>shopimporter_32a6deec3cca312a54d6b8769c9b8dd7'] = 'n\'est pas disponible dans ce module'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1e411d25230ba738b9ae583bcb9b0b57'] = 'Connexion à la base de données OK '; +$_MODULE['<{shopimporter}prestashop>shopimporter_3596c777cbc8b72d678f34daabc9148b'] = 'Afficher les erreurs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_89a399eee52b2a6daaea92eba3e14cad'] = 'Lancer le test d\'import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_bf79359f8edda6f7df97ef57a4ee09b6'] = 'Lancer l\'import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0b5a6ead644b8ae4edb8a036334c9ed6'] = 'Des erreurs sont survenues lors de l\'importation. Pour plus de détails, cliquer sur \"Afficher les erreurs\"'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e905d0eb5204b761d8c0e3eebed4a0e0'] = 'L\'import est terminé'; +$_MODULE['<{shopimporter}prestashop>shopimporter_596403b61367ca30d6de75812275f9cd'] = 'Suppression des données'; +$_MODULE['<{shopimporter}prestashop>shopimporter_edc186cbc5cc897a79312880ec16c621'] = 'Merci de choisir quelque chose à importer'; +$_MODULE['<{shopimporter}prestashop>shopimporter_81b33153f65252001fe132d74b658fbe'] = 'Importer depuis un autre systeme'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd4c0c798ebbf8c6e15dcba8632f558d'] = 'Avant de commencer l\'importation merci de faire une sauvegarde de votre base de données.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_60474e812295a5adc371de63dc62a164'] = 'Cliquez ici pour sauvegarder'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05f4be265d59ea66f3a1fb12ba103583'] = 'Choisir un import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_961f2247a2070bedff9f9cd8d64e2650'] = 'Choisir'; +$_MODULE['<{shopimporter}prestashop>shopimporter_151a0fbfcc4894aa53335091c2512de5'] = 'Aucun module d\'import installé'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9aa1b03934893d7134a660af4204f2a9'] = 'Serveur'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8f9bfe9d1345237cb3b2b205864da075'] = 'Utilisateur'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e307db07b3975fef922a80d07455ee5e'] = 'Base de données'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dac130bdd2c5492a8108a4145bd9f04a'] = 'Prefix de base de données'; +$_MODULE['<{shopimporter}prestashop>shopimporter_2bb4cbbf4c51025867d47131e79ad05f'] = 'Etape suivante'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72dd98a453e92ccc01697f29bb5dbeb9'] = 'Option d\'import'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9dfc5d5738312210c3c75e68a468691d'] = 'Options avancées '; +$_MODULE['<{shopimporter}prestashop>shopimporter_c195d4db1be0d349d21f236f0a6400ff'] = 'Ce mode n\'est pas recommandé'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11e9fa925cb444a223769edd53334f13'] = 'Importer par'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70fda5850e8d8946a340c55bf985fd39'] = 'Sélectionnez le nombre d\'occurrences pour chaque requête à l\'importation'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35f178a340d9aa1a080d8cfaf0b57f36'] = 'Si il y a des erreurs'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11a755d598c0c417f9a36758c3da7481'] = 'Stop'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72ef2b9b6965d078e3c7f95487a82d1c'] = 'Sauter'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9eb6b78a99cdb6ffd3d40d18621d9f80'] = 'Forcer'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05d2b3715ac0c697b86799d1989c4aeb'] = 'Stop: s\'il ya des erreurs, l\'importation ne fonctionne pas.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_690c3a7f595050729df99a6d30dd6f96'] = 'Skip: s\'il ya des erreurs, l\'importation va sauter des données incorrectes'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35a6535254a93c5338bff1e3572755d2'] = 'Force: s\'il ya des erreurs, l\'importation remplacera les données incorrectes par des données génériques.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_09b4382d10c396e0c4fcd51064702213'] = 'Options spécifiques '; +$_MODULE['<{shopimporter}prestashop>shopimporter_044a8ce60a6c5a464e7a7f78698fc05d'] = 'La langue par défaut ne correspond pas à :'; +$_MODULE['<{shopimporter}prestashop>shopimporter_807079d19357b6d44089c220f74cc2d0'] = 'Merci de changer la langue par défaut dans votre configuration '; +$_MODULE['<{shopimporter}prestashop>shopimporter_29361e9c6917fb14b43d3e78e2811e56'] = 'La devise par défaut ne correspond pas à:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6117c4d73fcf0c20fe3946f1d00dde85'] = 'Merci de changer la devise par défaut dans votre configuration '; +$_MODULE['<{shopimporter}prestashop>shopimporter_8136c99d09cb6e9f0f998dd231fff6ed'] = 'Une erreur s\'est produite lors de l\'ajout de l\'objet '; +$_MODULE['<{shopimporter}prestashop>shopimporter_01f8544c8fd4628bc686502e8b727d95'] = 'le champ'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0a5fa53f3f20f67f98bd6c3b16df059d'] = 'est nécessaire '; +$_MODULE['<{shopimporter}prestashop>shopimporter_f755e8b92cb8f02c24f6f539180d45b1'] = 'est trop long'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70f4b635847038d056e33959821a7a66'] = 'caractères max '; +$_MODULE['<{shopimporter}prestashop>shopimporter_998b344cff693ad388a14ba89b1523c7'] = 'est invalide'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7e47a344b06d82a8836cbee2748a79e6'] = 'est nécessaire dans '; diff --git a/modules/shopimporter/img/ajax-loader.gif b/modules/shopimporter/img/ajax-loader.gif new file mode 100644 index 000000000..3dba96d65 Binary files /dev/null and b/modules/shopimporter/img/ajax-loader.gif differ diff --git a/modules/shopimporter/img/delete.gif b/modules/shopimporter/img/delete.gif new file mode 100644 index 000000000..20874bb38 Binary files /dev/null and b/modules/shopimporter/img/delete.gif differ diff --git a/modules/shopimporter/img/error.png b/modules/shopimporter/img/error.png new file mode 100644 index 000000000..5d52e2f1d Binary files /dev/null and b/modules/shopimporter/img/error.png differ diff --git a/modules/shopimporter/img/file.png b/modules/shopimporter/img/file.png new file mode 100644 index 000000000..207dc4cd8 Binary files /dev/null and b/modules/shopimporter/img/file.png differ diff --git a/modules/shopimporter/img/force.gif b/modules/shopimporter/img/force.gif new file mode 100644 index 000000000..d876e5e9c Binary files /dev/null and b/modules/shopimporter/img/force.gif differ diff --git a/modules/shopimporter/img/ok.png b/modules/shopimporter/img/ok.png new file mode 100644 index 000000000..4207a363c Binary files /dev/null and b/modules/shopimporter/img/ok.png differ diff --git a/modules/shopimporter/img/skip.png b/modules/shopimporter/img/skip.png new file mode 100644 index 000000000..636b2d6a9 Binary files /dev/null and b/modules/shopimporter/img/skip.png differ diff --git a/modules/shopimporter/img/stop.png b/modules/shopimporter/img/stop.png new file mode 100644 index 000000000..fbc3cee2a Binary files /dev/null and b/modules/shopimporter/img/stop.png differ diff --git a/modules/shopimporter/img/warn.png b/modules/shopimporter/img/warn.png new file mode 100644 index 000000000..b06d10dc7 Binary files /dev/null and b/modules/shopimporter/img/warn.png differ diff --git a/modules/shopimporter/it.php b/modules/shopimporter/it.php new file mode 100644 index 000000000..c50fc2863 --- /dev/null +++ b/modules/shopimporter/it.php @@ -0,0 +1,92 @@ +shopimporter_d714c742b360a8ecbb124c15e9a391a1'] = 'Importatore negozio'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8c0fe18034f47d7d3dd3e58098e3ffdb'] = 'Questo modulo ti consente di importare il tuo negozio da un altro sistema in PrestaShop'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4994a8ffeba4ac3140beb89e8d41f174'] = 'Lingua'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a9db6adcdafc85c5830439401fd866f6'] = 'Importa Lingue'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b8b8ca447e355455b8dc638993c41ae7'] = 'Nuove lingue aggiungerà automaticamente traduzioni!'; +$_MODULE['<{shopimporter}prestashop>shopimporter_386c339d37e737a436499d423a77df0c'] = 'Valuta'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4234c64201820401dfa04eeb449c1bbc'] = 'Importa Valute'; +$_MODULE['<{shopimporter}prestashop>shopimporter_719fec04166d6fa75f89cd29ad61fa8c'] = 'Tasse'; +$_MODULE['<{shopimporter}prestashop>shopimporter_94c5ffc9d364127b232f58b4cfd8c88a'] = 'Importa Tasse'; +$_MODULE['<{shopimporter}prestashop>shopimporter_d3352014303b292984466bbb1da371db'] = 'Norme fiscali'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6ec25fc9cc7df7b0d1fce57923f46ec1'] = 'Importa norme fiscali'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3ff996fe5c77610359114835baf9b38'] = 'Zona'; +$_MODULE['<{shopimporter}prestashop>shopimporter_21d250d17e35e3e02db9f1a618bad913'] = 'Importa Zone'; +$_MODULE['<{shopimporter}prestashop>shopimporter_59716c97497eb9694541f7c3d37b1a4d'] = 'Paese'; +$_MODULE['<{shopimporter}prestashop>shopimporter_13eedcf49d68ce49274db71e63a7aa3d'] = 'Importa paesi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_46a2a41cc6e552044816a2d04634545d'] = 'Stato'; +$_MODULE['<{shopimporter}prestashop>shopimporter_118421de3201927a23bf921057e69c4a'] = 'Importa Stati'; +$_MODULE['<{shopimporter}prestashop>shopimporter_03937134cedab9078be39a77ee3a48a0'] = 'Gruppo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_65ac19ad248219902394739bda0cef62'] = 'Importa gruppi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{shopimporter}prestashop>shopimporter_22c34564e80ce8adab6a235061d277f4'] = 'Importa Clienti'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd7bf230fde8d4836917806aff6a6b27'] = 'Indirizzo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_77497d022aeb4cdd78ec394ca8d223b4'] = 'Importa gli indirizzi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c0bd7654d5b278e65f21cf4e9153fdb4'] = 'Produttore'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ed4cbbbeb3d575ccfeb405ae5c5c4d43'] = 'Importa Produttori'; +$_MODULE['<{shopimporter}prestashop>shopimporter_ec136b444eede3bc85639fac0dd06229'] = 'Fornitore'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0ae5f9c75e6a7460ec31e33201576bd9'] = 'Importa Fornitori'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1db7ae20c24e257b6f1a7def365da1ad'] = 'Importa categorie'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1f5a36b380c53d7f82e762baa08c2e5c'] = 'Gruppo attributi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7eb915ee907703ede51dabab88fc1701'] = 'Importa gruppo attributi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attributo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_66e2d23b2d257d56af6f1d6443ce0ce3'] = 'Importa Attributi'; +$_MODULE['<{shopimporter}prestashop>shopimporter_deb10517653c255364175796ace3553f'] = 'Prodotto'; +$_MODULE['<{shopimporter}prestashop>shopimporter_4bfc4a7632bae0877b798dbd9efc4f70'] = 'Importa prodotti'; +$_MODULE['<{shopimporter}prestashop>shopimporter_47ac923d219501859fb68fed8c8db77b'] = 'Combinazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_58e2fcec5e04716c627b3e8b9d2955b1'] = 'Importa combinazioni di prodotti'; +$_MODULE['<{shopimporter}prestashop>shopimporter_b3df6b363e7979ce81b71d92961fc672'] = 'Stati ordini'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6b24bd15b10bc10de9687f16ebe728e4'] = 'Importa Stati ordini'; +$_MODULE['<{shopimporter}prestashop>shopimporter_a240fa27925a635b08dc28c9e4f9216d'] = 'Ordine'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3b7e768ebab2171baa41d5ea13017b02'] = 'Importa Ordini'; +$_MODULE['<{shopimporter}prestashop>shopimporter_582602d7c6762c923cf7fce178b94e1a'] = 'Cronologia ordini'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f2931b8b1622867fcc461d7de388e319'] = 'Importa cronologia ordini'; +$_MODULE['<{shopimporter}prestashop>shopimporter_32a6deec3cca312a54d6b8769c9b8dd7'] = 'non è disponibile in questo modulo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_1e411d25230ba738b9ae583bcb9b0b57'] = 'Connessione al database OK'; +$_MODULE['<{shopimporter}prestashop>shopimporter_3596c777cbc8b72d678f34daabc9148b'] = 'Mostra gli errori'; +$_MODULE['<{shopimporter}prestashop>shopimporter_89a399eee52b2a6daaea92eba3e14cad'] = 'Lancia la prova di importazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_bf79359f8edda6f7df97ef57a4ee09b6'] = 'Lancia importazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0b5a6ead644b8ae4edb8a036334c9ed6'] = 'Si sono verificati errori durante l\'importazione. Per maggiori dettagli cliccate su \"Mostra errori\"'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e905d0eb5204b761d8c0e3eebed4a0e0'] = 'L\'importazione è completata'; +$_MODULE['<{shopimporter}prestashop>shopimporter_596403b61367ca30d6de75812275f9cd'] = 'Rimuovere i dati'; +$_MODULE['<{shopimporter}prestashop>shopimporter_edc186cbc5cc897a79312880ec16c621'] = 'Si prega di scegliere una cosa da importare'; +$_MODULE['<{shopimporter}prestashop>shopimporter_81b33153f65252001fe132d74b658fbe'] = 'Importa da un altro sistema'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dd4c0c798ebbf8c6e15dcba8632f558d'] = 'Prima di iniziare l\'importazione, fare il backup del database.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_60474e812295a5adc371de63dc62a164'] = 'Clicca qui per il backup'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05f4be265d59ea66f3a1fb12ba103583'] = 'Scegli la tua importazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_961f2247a2070bedff9f9cd8d64e2650'] = 'Scegli'; +$_MODULE['<{shopimporter}prestashop>shopimporter_151a0fbfcc4894aa53335091c2512de5'] = 'Nessun modulo di importazione installato'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9aa1b03934893d7134a660af4204f2a9'] = 'Server'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8f9bfe9d1345237cb3b2b205864da075'] = 'Utente'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{shopimporter}prestashop>shopimporter_e307db07b3975fef922a80d07455ee5e'] = 'Database'; +$_MODULE['<{shopimporter}prestashop>shopimporter_dac130bdd2c5492a8108a4145bd9f04a'] = 'Prefisso database'; +$_MODULE['<{shopimporter}prestashop>shopimporter_2bb4cbbf4c51025867d47131e79ad05f'] = 'Passo successivo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72dd98a453e92ccc01697f29bb5dbeb9'] = 'Opzioni di importazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9dfc5d5738312210c3c75e68a468691d'] = 'Opzioni avanzate'; +$_MODULE['<{shopimporter}prestashop>shopimporter_c195d4db1be0d349d21f236f0a6400ff'] = 'Questa modalità è pericolosa'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11e9fa925cb444a223769edd53334f13'] = 'Importa per ogni'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70fda5850e8d8946a340c55bf985fd39'] = 'Selezionare il numero di occorrenze per ogni richiesta di importazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35f178a340d9aa1a080d8cfaf0b57f36'] = 'Se si verificano errori'; +$_MODULE['<{shopimporter}prestashop>shopimporter_11a755d598c0c417f9a36758c3da7481'] = 'Stop'; +$_MODULE['<{shopimporter}prestashop>shopimporter_72ef2b9b6965d078e3c7f95487a82d1c'] = 'Salta'; +$_MODULE['<{shopimporter}prestashop>shopimporter_9eb6b78a99cdb6ffd3d40d18621d9f80'] = 'Forza'; +$_MODULE['<{shopimporter}prestashop>shopimporter_05d2b3715ac0c697b86799d1989c4aeb'] = 'Stop: se ci sono errori con i dati, l\'importazione non verrà eseguita.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_690c3a7f595050729df99a6d30dd6f96'] = 'Salta: se ci sono errori con i dati, l\'importazione salterà dati non corretti.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_35a6535254a93c5338bff1e3572755d2'] = 'Forze: se ci sono errori con i dati, l\'importazione sostituirà i dati non corretti con dati generici.'; +$_MODULE['<{shopimporter}prestashop>shopimporter_09b4382d10c396e0c4fcd51064702213'] = 'Opzioni specifiche'; +$_MODULE['<{shopimporter}prestashop>shopimporter_044a8ce60a6c5a464e7a7f78698fc05d'] = 'Lingua di default non corrisponde:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_807079d19357b6d44089c220f74cc2d0'] = 'Si prega di cambiare la lingua di default nella configurazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_29361e9c6917fb14b43d3e78e2811e56'] = 'Valuta di default non corrisponde:'; +$_MODULE['<{shopimporter}prestashop>shopimporter_6117c4d73fcf0c20fe3946f1d00dde85'] = 'Si prega di cambiare valuta di default nella configurazione'; +$_MODULE['<{shopimporter}prestashop>shopimporter_8136c99d09cb6e9f0f998dd231fff6ed'] = 'Si è verificato un errore nell\'aggiunta dell\'oggetto'; +$_MODULE['<{shopimporter}prestashop>shopimporter_01f8544c8fd4628bc686502e8b727d95'] = 'il campo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_0a5fa53f3f20f67f98bd6c3b16df059d'] = 'è richiesto'; +$_MODULE['<{shopimporter}prestashop>shopimporter_f755e8b92cb8f02c24f6f539180d45b1'] = 'è troppo lungo'; +$_MODULE['<{shopimporter}prestashop>shopimporter_70f4b635847038d056e33959821a7a66'] = 'caratteri max'; +$_MODULE['<{shopimporter}prestashop>shopimporter_998b344cff693ad388a14ba89b1523c7'] = 'non è valido'; +$_MODULE['<{shopimporter}prestashop>shopimporter_7e47a344b06d82a8836cbee2748a79e6'] = 'è richiesto almeno in'; diff --git a/modules/shopimporter/logo.gif b/modules/shopimporter/logo.gif new file mode 100644 index 000000000..263b1e430 Binary files /dev/null and b/modules/shopimporter/logo.gif differ diff --git a/modules/shopimporter/shopimporter.js b/modules/shopimporter/shopimporter.js new file mode 100644 index 000000000..9b631c29b --- /dev/null +++ b/modules/shopimporter/shopimporter.js @@ -0,0 +1,543 @@ +var shopImporter = { + + moduleName: $('#import_module_name').val(), + server: $('#server').val(), + user: $('#user').val(), + password: $('#password').val(), + database: $('#database').val(), + prefix: $('#prefix').val(), + specificOptions : '', + imagesOptions : '', + output : 1, + hasErrors : 0, + limit: 0, + nbr_import: parseInt($('#nbr_import').val()), + idMethod: 0, + nbrMethod: 0, + save : 0, + srcError : '../modules/shopimporter/img/error.png', + srcConf : '../modules/shopimporter/img/ok.png', + srcImport : '../modules/shopimporter/img/ajax-loader.gif', + srcWarn : '../modules/shopimporter/img/warn.png', + srcDelete : '../modules/shopimporter/img/delete.gif', + + + syncLang : function (onComplete) + { + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&syncLang&getMethod=getLangagues&className=Language&moduleName='+this.moduleName+'&server='+this.server+'&user='+this.user+'&password='+this.password+'&database='+this.database+this.specificOptions+'&nbr_import='+this.nbr_import , + success: function(jsonData) + { + if (jsonData.hasError) + { + $('#steps').html(''); + $('#lang_feedback').fadeIn('slow'); + onComplete(false); + } + else + onComplete(true); + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + onComplete(false); + } + }); + + }, + syncCurrency : function (onComplete) + { + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&syncCurrency&getMethod=getCurrencies&className=Currency&moduleName='+this.moduleName+'&server='+this.server+'&user='+this.user+'&password='+this.password+'&database='+this.database+this.specificOptions+'&nbr_import='+this.nbr_import , + success: function(jsonData) + { + if (jsonData.hasError) + { + $('#steps').html(''); + $('#currency_feedback').fadeIn('slow'); + onComplete(false); + } + else + onComplete(true); + + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + onComplete(false); + } + }); + + }, + checkAndSaveConfig : function (save) + { + //sync languages and currency + this.syncLang(function(isOk) { + if (isOk) + { + shopImporter.syncCurrency(function(isOk) { + if (isOk) + { + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&checkAndSaveConfig&moduleName='+shopImporter.moduleName+'&server='+shopImporter.server+'&user='+shopImporter.user+'&password='+shopImporter.password+'&database='+shopImporter.database+shopImporter.specificOptions+'&nbr_import='+shopImporter.nbr_import , + success: function(jsonData) + { + if ($('#technical_error_feedback').length) + $('#technical_error_feedback').fadeIn('slow'); + + if (!jsonData.hasError) + { + $('#checkAndSaveConfig').fadeOut('slow'); + $('#steps').html($('#steps').html()+''); + $('#steps').html($('#steps').html()+''); + $('#database_feedback').fadeIn('slow', function() { + if (save) + { + shopImporter.idMethod = 0; + shopImporter.limit = 0; + shopImporter.nbrMethod = conf.length; + $('.truncateTable:checked').each(function (){ + shopImporter.truncatTable(this.id, 'add'); + }); + + if($('#truncat_feedback').length != 0) + $('#truncat_feedback').removeClass('import').addClass('conf'); + + shopImporter.getDatas(conf[shopImporter.idMethod]); + } + else + { + $('#next').fadeIn('slow', function () { + $('#next').unbind('click').click(function(){ + $('#next').fadeOut('fast', function() { + shopImporter.nbrMethod = conf.length; + shopImporter.getDatas(conf[shopImporter.idMethod]); + }); + return false; + }); + }); + } + }); + } + else + { + $('#steps').html(''); + $('#database_feedback').fadeIn('slow'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + + } + }); + } + }); + } + }); + + + }, + + getDatas : function (methodName) + { + //check if method have to be call + if (shopImporter.idMethod >= shopImporter.nbrMethod) + shopImporter.displayEnd(false); + else if ($('input[name='+methodName[0]+']:radio:checked').val() == 0) + { + shopImporter.idMethod ++; + shopImporter.getDatas(conf[shopImporter.idMethod]); + return; + } + if (typeof(methodName) != 'undefined') + { + + $('#steps').html($('#steps').html()+''); + $('#ok_feedback_'+methodName[0]).css('display', ''); + + $('#checkAndSaveConfig').fadeIn('slow'); + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&getData&className='+methodName[2]+'&getMethod='+methodName[0]+'&moduleName='+this.moduleName+'&server='+this.server+'&user='+this.user+'&password='+this.password+'&database='+this.database+'&limit='+this.limit+'&nbr_import='+this.nbr_import+'&save='+this.save+'&errors='+this.errors+'&hasErrors='+this.hasErrors+this.specificOptions+this.imagesOptions , + success: function(jsonData) + { + var jsonError; + if (jsonData.hasError) + { + jsonError = ''; + if (jsonData.error == 'not_exist') + { + $('#ok_feedback_'+methodName[0]).removeClass('conf').addClass(function() { + $('#ok_feedback_'+methodName[0]).html(''+methodName[1]+' '+notExist); + return 'warn'; + }); + } + else + { + for (i=0;iId : '+jsonData.error[i]+''; + + if ($('#display_error_'+methodName[0]+'_link').length == 0) + { + $('#ok_feedback_'+methodName[0]).html($('#ok_feedback_'+methodName[0]).html()+''+showErrors+'('+jsonData.error.length+')'+''); + } + else + { + var nbrErrors = $('#nbr_errors_'+methodName[0]).html(); + var newNbrError = parseInt(jsonData.error.length) + parseInt(nbrErrors); + $('#nbr_errors_'+methodName[0]).html(newNbrError); + $('#feedback_'+methodName[0]+'_errors_list > ul').html($('#feedback_'+methodName[0]+'_errors_list > ul').html() + jsonError); + } + } + + if (jsonData.datas.length != parseInt(shopImporter.nbr_import)) + { + if ($('#display_error_'+methodName[0]+'_link').length != 0) + $('#ok_feedback_'+methodName[0]).removeClass('import').addClass( function() { + $('#ok_feedback_'+methodName[0]+' >img:first').attr('src', shopImporter.srcError); + return 'error'; + }); + shopImporter.idMethod ++; + shopImporter.limit = 0; + } + else + shopImporter.limit += parseInt(shopImporter.nbr_import); + if ((shopImporter.idMethod < shopImporter.nbrMethod)) + shopImporter.getDatas(conf[shopImporter.idMethod]); + else + shopImporter.displayEnd(false); + } + else + { + if (jsonData.datas.length != parseInt(shopImporter.nbr_import)) + { + if ($('#display_error_'+methodName[0]+'_link').length != 0) + { + $('#ok_feedback_'+methodName[0]).removeClass('import').addClass( function() { + $('#ok_feedback_'+methodName[0]+' >img:first').attr('src', shopImporter.srcError); + return 'error'; + }); + }else + { + $('#ok_feedback_'+methodName[0]).removeClass('import').addClass('conf'); + $('#ok_feedback_'+methodName[0]+'>img:first').attr('src', shopImporter.srcConf); + } + shopImporter.idMethod ++; + shopImporter.limit = 0; + shopImporter.getDatas(conf[shopImporter.idMethod]); + } + else + { + if (shopImporter.idMethod < shopImporter.nbrMethod) + { + shopImporter.limit += parseInt(shopImporter.nbr_import); + shopImporter.getDatas(conf[shopImporter.idMethod]); + } + else + shopImporter.displayEnd(true); + } + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + $('#checkAndSaveConfig').fadeIn('slow'); + } + }); + } + }, + + truncatTable : function (className) + { + if (!$('#truncat_feedback').length) + { + $('#steps').html($('#steps').html()+''); + $('#truncat_feedback').css('display', ''); + } + + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&truncatTable&className='+className+this.specificOptions , + success: function(jsonData) + { + var jsonError; + if (jsonData.hasError) + { + jsonError = ''; + for (i=0;iTable : '+jsonData.error[i]+''; + $('#truncat_feedback').removeClass('import').addClass('error'); + $('#truncat_feedback >img:first').attr('src', shopImporter.srcError); + if ($('#display_error_truncat_feedback_link').length == 0) + { + $('#truncat_feedback').html($('#truncat_feedback').html()+''+showErrors+''); + } + else + { + var nbrErrors = $('#nbr_errors_'+methodName[0]).html(); + var newNbrError = parseInt(jsonData.error.length) + parseInt(nbrErrors); + $('#nbr_errors_'+methodName[0]).html(newNbrError); + $('#feedback_'+methodName[0]+'_errors_list > ul').html($('#feedback_'+methodName[0]+'_errors_list > ul').html() + jsonError); + } + } + else + { + + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + $('#checkAndSaveConfig').fadeIn('slow'); + } + + }); + }, + + displayEnd : function (finish) + { + + if ((this.hasErrors != 0 || ($('.display_error_link').length == 0 && this.hasErrors == 0)) || (this.hasErrors == 1)) + { + if (this.save) + { + $('#steps').html($('#steps').html()+''); + $('#ok_feedback_end').fadeIn('slow'); + } + else + { + $('#steps').html($('#steps').html()+''); + $('#submitImport').fadeIn('slow', function() { + $(this).unbind('click').click(function() { + $.scrollTo($("#steps"), 300 , { + onAfter:function(){ + $('#steps').html(''); + shopImporter.save = 1; + shopImporter.checkAndSaveConfig(shopImporter.save); + } + }); + }); + }); + } + } + else + { + $('#steps').html($('#steps').html()+''); + $('#technical_error_feedback').fadeIn('slow'); + } + $('#checkAndSaveConfig').fadeIn('slow'); + }, + +}; + + +function enableShowErrors(methodName) +{ + $(document).find('#feedback_'+methodName+'_errors_list').slideToggle(); + return false; +} + +function enableShowErrorsTruncate() +{ + $(document).find('#feedback_truncat_errors_list').slideToggle(); + return false; +} + +function displaySpecificOptions(moduleName, server, user, password, database, prefix) +{ + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: false, + cache: false, + dataType : "html", + data: 'ajax=true&displaySpecificOptions&moduleName='+moduleName+'&server='+ server+'&user='+user+'&password='+password+'&database='+database+'&prefix='+prefix , + success: function(htmlData) + { + if (htmlData != 'not_exist') + { + $('#specificOptionsContent').html(htmlData); + $('#specificOptions').show(); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + alert('TECHNICAL ERROR\nDetails:\nError thrown: ' + XMLHttpRequest + '\n' + 'Text status: ' + textStatus); + } + }); +} +function validateSpecificOptions(moduleName, specificOptions) +{ + $.ajax({ + type: 'GET', + url: '../modules/shopimporter/ajax.php', + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&validateSpecificOptions&moduleName='+moduleName+specificOptions , + success: function(jsonData) + { + var jsonError = ''; + if (jsonData.hasError) + { + for (i=0;i'+jsonData.error[i]+''; + $('#specificOptionsErrors').html('
          '+jsonError+'
        '); + $('#specificOptionsErrors').fadeIn('slow'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) + { + alert('TECHNICAL ERROR\nDetails:\nError thrown: ' + XMLHttpRequest + '\n' + 'Text status: ' + textStatus); + } + }); + + if ($('#specificOptionsErrors').html().length != 0) + return false; + else + return true; +} + + +$(document).ready(function(){ + + $('#db_input input').each(function () { + $(this).keyup(function () { + $('#steps').fadeOut(200, function () { + $(this).html(''); + $('#steps').fadeIn(); + }); + + + + $('#importOptions').fadeOut('slow'); + $('#displayOptions').show(); + $('#checkAndSaveConfig').show(); + }) + }); + + $('input[name=hasErrors]:radio').change(function () { + if ($(this).val() == 1) + $('#warnSkip').fadeIn('slow'); + else + $('#warnSkip').fadeOut('slow'); + }); + + $('#choose_module_name').unbind('click').click(function(){ + $('#db_config').hide(); + $('#importOptions').hide(); + $('#steps').html(''); + if ($('#import_module_name').attr('value') != 0) + { + $('#db_config').slideDown('slow'); + $('#displayOptions').show(); + $('#checkAndSaveConfig').show(); + } + else + { + $('#db_config').slideUp('slow'); + $('#checkAndSaveConfig').show(); + } + return false; + }); + + $('#displayOptions').unbind('click').click(function(){ + $(this).fadeOut('slow'); + $('#importOptions').slideDown('slow'); + moduleName = $('#import_module_name').val(); + server = $('#server').val(); + user = $('#user').val(); + password = $('#password').val(); + database = $('#database').val(); + prefix = $('#prefix').val(); + displaySpecificOptions(moduleName, server, user, password, database, prefix); + return false; + }); + + $('#checkAndSaveConfig').unbind('click').click(function(){ + $('#steps, #specificOptionsErrors').html(''); + $('#specificOptionsErrors').hide(); + shopImporter.specificOptions = ''; + $('#specificOptionsContent :input').each(function (){ + shopImporter.specificOptions = shopImporter.specificOptions+'&'+$(this).attr('name')+'='+$(this).attr('value'); + }); + shopImporter.imagesOptions = ''; + $('.importImages:input:checked').each(function (){ + shopImporter.imagesOptions = shopImporter.imagesOptions+'&'+$(this).attr('name'); + }); + moduleName = $('#import_module_name').val(); + if (validateSpecificOptions(moduleName, shopImporter.specificOptions) == true) + { + $.scrollTo($("#steps"), 300 , { + onAfter:function(){ + shopImporter.specificOptions = ''; + $('#specificOptionsContent :input').each(function (){ + shopImporter.specificOptions = shopImporter.specificOptions+'&'+$(this).attr('name')+'='+$(this).attr('value'); + }); + shopImporter.idMethod = 0; + shopImporter.limit = 0; + shopImporter.nbr_import = parseInt($('#nbr_import').val()); + shopImporter.save = 0; + shopImporter.moduleName = $('#import_module_name').val(); + shopImporter.server = $('#server').val(); + shopImporter.user = $('#user').val(); + shopImporter.password = $('#password').val(); + shopImporter.database = $('#database').val(); + shopImporter.prefix = $('#prefix').val(); + shopImporter.hasErrors = $('input[name=hasErrors]:radio:checked').val(); + shopImporter.checkAndSaveConfig(shopImporter.save); + return false; + } + }); + } + + }); + + $('#importOptionsYesNo :radio').change( function () { + $('#steps').html(''); + onThing = false; + + $('#importOptionsYesNo :radio:checked').each( function () { + if ($(this).attr('value') == 1) + onThing = true; + }); + if (onThing) + $('#checkAndSaveConfig').fadeIn(); + else + { + $('#checkAndSaveConfig').fadeOut(); + $('#steps').html(''); + $('#one_thing_error_feedback').fadeIn('slow'); + } + }); +}); \ No newline at end of file diff --git a/modules/shopimporter/shopimporter.php b/modules/shopimporter/shopimporter.php new file mode 100644 index 000000000..772991e3a --- /dev/null +++ b/modules/shopimporter/shopimporter.php @@ -0,0 +1,1254 @@ +name = 'shopimporter'; + $this->tab = 'migration_tools'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + + parent::__construct (); + + $this->displayName = $this->l('Shop Importer'); + $this->description = $this->l('This module allows you to import your shop from another system into Prestashop.'); + $this->supportedImports = array( + 'language' => array('methodName' => 'getLangagues', + 'name' => $this->l('Language'), + 'className' => 'Language', + 'label' => $this->l('Import Languages'), + 'table' => 'lang', + 'identifier' => 'id_lang', + 'alterTable' => array('id_lang' => 'int(10)'), + 'info' => $this->l('New languages will automatically add translations.'), + 'defaultId' => 'PS_LANG_DEFAULT' + ), + 'currency' => array('methodName' => 'getCurrencies', + 'name' => $this->l('Currency'), + 'className' => 'Currency', + 'label' => $this->l('Import Currencies'), + 'table' => 'currency', + 'identifier' => 'id_currency', + 'alterTable' => array('id_currency' => 'int(10)'), + 'delete' => true, + 'defaultId' => 'PS_CURRENCY_DEFAULT' + ), + /* + 'tax' => array('methodName' => 'getTaxes', + 'name' => $this->l('Taxes'), + 'className' => 'Tax', + 'label' => $this->l('Import Taxes'), + 'table' => 'tax', + 'identifier' => 'id_tax', + 'alterTable' => array('id_tax' => 'int(10)'), + 'delete' => true + ), + 'tax_rule' => array('methodName' => 'getTaxesRules', + 'name' => $this->l('TaxesRules'), + 'className' => 'TaxRule', + 'label' => $this->l('Import Taxes Rules'), + 'table' => 'tax', + 'identifier' => 'id_tax', + 'alterTable' => array('id_tax' => 'int(10)'), + 'delete' => true + ), +*/ + 'zone' => array('methodName' => 'getZones', + 'name' => $this->l('Zone'), + 'className' => 'Zone', + 'label' => $this->l('Import Zones'), + 'table' => 'zone', + 'identifier' => 'id_zone', + 'alterTable' => array('id_zone' => 'int(10)'), + 'delete' => true + ), + 'country' => array('methodName' => 'getCountries', + 'name' => $this->l('Country'), + 'className' => 'Country', + 'label' => $this->l('Import Countries'), + 'table' => 'country', + 'identifier' => 'id_country', + 'foreign_key' => array('id_zone', 'id_currency'), + 'alterTable' => array('id_country' => 'int(10)'), + 'delete' => true, + 'defaultId' => 'PS_COUNTRY_DEFAULT' + ), + 'state' => array('methodName' => 'getStates', + 'name' => $this->l('State'), + 'className' => 'State', + 'label' => $this->l('Import States'), + 'table' => 'state', + 'identifier' => 'id_state', + 'foreign_key' => array('id_zone', 'id_country'), + 'alterTable' => array('id_state' => 'int(10)'), + 'delete' => true + ), + 'group' => array('methodName' => 'getGroups', + 'name' => $this->l('Group'), + 'className' => 'Group', + 'label' => $this->l('Import Groups'), + 'table' => 'group', + 'identifier' => 'id_group', + 'alterTable' => array('id_group' => 'int(10)'), + 'delete' => true, + ), + 'customer' => array('methodName' => 'getCustomers', + 'name' => $this->l('Customer'), + 'className' => 'Customer', + 'label' => $this->l('Import Customers'), + 'table' => 'customer', + 'identifier' => 'id_customer', + 'foreign_key' => array('id_group'), + 'alterTable' => array('id_customer' => 'int(10)', 'passwd' => 'varchar(100)'), + 'delete' => true, + 'association' => array( + array( + 'table' => 'customer_group', + 'fields' => array('id_customer', 'id_group'), + 'matchTable' => array('customer', 'group'), + ) + ) + ), + 'address' => array('methodName' => 'getAddresses', + 'name' => $this->l('Address'), + 'className' => 'Address', + 'label' => $this->l('Import Addresses'), + 'table' => 'address', + 'identifier' => 'id_address', + 'foreign_key' => array('id_country', 'id_state', 'id_customer'), + 'alterTable' => array('id_address' => 'int(10)'), + 'delete' => true + ), + 'manufacturer' => array('methodName' => 'getManufacturers', + 'name' => $this->l('Manufacturer'), + 'className' => 'Manufacturer', + 'label' => $this->l('Import Manufacturers'), + 'table' => 'manufacturer', + 'identifier' => 'id_manufacturer', + 'delete' => true, + 'alterTable' => array('id_manufacturer' => 'int(10)'), + 'hasImage' => true + ), + 'supplier' => array('methodName' => 'getSuppliers', + 'name' => $this->l('Supplier'), + 'className' => 'Supplier', + 'label' => $this->l('Import Suppliers'), + 'table' => 'supplier', + 'identifier' => 'id_supplier', + 'delete' => true, + 'alterTable' => array('id_supplier' => 'int(10)'), + 'hasImage' => true + ), + 'category' => array('methodName' => 'getCategories', + 'name' => $this->l('Category'), + 'className' => 'Category', + 'label' => $this->l('Import Categories'), + 'table' => 'category', + 'identifier' => 'id_category', + 'alterTable' => array('id_category' => 'int(10)'), + 'delete' => true, + 'hasImage' => true, + ), + 'attributegroup' => array('methodName' => 'getAttributesGroups', + 'name' => $this->l('AttributeGroup'), + 'className' => 'AttributeGroup', + 'label' => $this->l('Import Attributes Groups'), + 'table' => 'attribute_group', + 'identifier' => 'id_attribute_group', + 'alterTable' => array('id_attribute_group' => 'int(10)'), + 'delete' => true + ), + 'attribute' => array('methodName' => 'getAttributes', + 'name' => $this->l('Attribute'), + 'className' => 'Attribute', + 'label' => $this->l('Import Attributes'), + 'table' => 'attribute', + 'identifier' => 'id_attribute', + 'alterTable' => array('id_attribute' => 'int(10)'), + 'foreign_key' => array('id_attribute_group'), + 'delete' => true + ), + 'product' => array('methodName' => 'getProducts', + 'name' => $this->l('Product'), + 'className' => 'Product', + 'label' => $this->l('Import Products'), + 'table' => 'product', + 'identifier' => 'id_product', + 'alterTable' => array('id_product' => 'int(10)'), + 'foreign_key' => array('id_category'), + 'delete' => true, + 'association' => array( + array( + 'table' => 'category_product', + 'fields' => array('id_category', 'id_product'), + 'matchTable' => array('category', 'product') + ) + ), + 'hasImage' => true + ), + 'combination' => array('methodName' => 'getProductsCombination', + 'name' => $this->l('Combination'), + 'className' => 'Combination', + 'label' => $this->l('Import Products Combinations'), + 'table' => 'product_attribute', + 'identifier' => 'id_product_attribute', + 'alterTable' => array('id_product_attribute' => 'int(10)', 'id_product' => 'int(10)'), + 'foreign_key' => array('id_product'), + 'delete' => false, + 'association' => array( + array( + 'table' => 'product_attribute_combination', + 'fields' => array('id_attribute', 'id_product_attribute'), + 'matchTable' => array('attribute', 'product_attribute') + ) + ) + ), + 'orderstate' => array('methodName' => 'getOrdersStates', + 'name' => $this->l('Orders States'), + 'className' => 'OrderState', + 'label' => $this->l('Import Orders States'), + 'table' => 'order_state', + 'identifier' => 'id_order_state', + 'alterTable' => array('id_order_state' => 'int(10)') + ), + 'cart' => array('methodName' => 'getOrders', + 'name' => $this->l('Order'), + 'className' => 'Cart', + 'label' => $this->l('Import Orders'), + 'table' => 'cart', + 'identifier' => 'id_cart', + 'foreign_key' => array('id_address_delivery', 'id_address_invoice', 'id_customer'), + 'alterTable' => array('id_cart' => 'int(10)') + ), + 'orderhistory' => array('methodName' => 'getOrdersHistory', + 'name' => $this->l('OrderHistory'), + 'className' => 'OrderHistory', + 'label' => $this->l('Import Order History'), + 'table' => 'order_history', + 'identifier' => 'id_order_history', + 'foreign_key' => array('id_order', 'id_order_state'), + 'alterTable' => array('id_order_history' => 'int(10)'), + 'hidden' => true + ), + 'order' => array('methodName' => 'getOrders', + 'name' => $this->l('Order'), + 'className' => 'Order', + 'label' => $this->l('Import Order History'), + 'table' => 'orders', + 'identifier' => 'id_order', + 'alterTable' => array('id_order' => 'int(10)'), + 'hidden' => true + ) + ); + } + + public function install() + { + return parent::install(); + } + + public function uninstall() + { + return parent::uninstall(); + } + + public function getContent() + { + global $cookie; + $exportModules = parent::getImportModulesOnDisk(); + //get installed module only + foreach($exportModules as $key => $module) + if ($module->name == $this->name OR !(bool)$module->id) + unset($exportModules[$key]); + $html = ' + + + +
        '.$this->l('Import from another system').' +
        + '.$this->l('Before starting the import please backup your database. ').' + '.$this->l(' Click here to backup').' +
        +
        +
        '; + if (sizeof($exportModules)) + { + $html .= ' + +
        + +
        '; + } + else + $html .= '
        '.$this->l('No import module installed').'
        '; + $html .= ' + +
        '; + return $html; + } + + public function generiqueImport($className, $fields, $save = false) + { + $return = ''; + $json = array(); + $errors = array(); + $json['hasError'] = false; + $json['datas'] = array_values($fields); + $languages = array(); + $defaultLanguage = ''; + $table = $this->supportedImports[strtolower($className)]['table']; + + $object = new $className(); + $rules = call_user_func(array($className, 'getValidationRules'), $className); + + if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']) OR Tools::isSubmit('syncLang') OR Tools::isSubmit('syncCurrency'))) + { + $moduleName = Tools::getValue('moduleName'); + if (file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) + { + require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php'); + $importModule = new $moduleName(); + $importModule->server = Tools::getValue('server'); + $importModule->user = Tools::getValue('user'); + $importModule->passwd = Tools::getValue('password'); + $importModule->database = Tools::getValue('database'); + $importModule->prefix = Tools::getValue('prefix'); + $defaultLanguage = new Language((int)Configuration::get('PS_LANG_DEFAULT')); + $languages = $importModule->getLangagues(0); + if (Tools::isSubmit('syncLang')) + { + $defaultIdLand = $importModule->getDefaultIdLang(); + $defaultLanguageImport = new Language(Language::getIdByIso($languages[$defaultIdLand]['iso_code'])); + if ($defaultLanguage->iso_code != $defaultLanguageImport->iso_code) + $errors[] = $this->l('Default language doesn\'t match : ').'
        '.Configuration::get('PS_SHOP_NAME').' : '.$defaultLanguage->name.' ≠ + '.$importModule->displayName.' : '.$defaultLanguageImport->name.'
        '.$this->l('Please change default language in your configuration'); + } + + if (Tools::isSubmit('syncCurrency')) + { + $defaultIdCurrency = $importModule->getDefaultIdCurrency(); + $currencies = $importModule->getCurrencies(0); + if(!empty($currencies[$defaultIdCurrency]['iso_code'])) + $defaultCurrencyImport = new Currency((int)Currency::getIdByIsoCode($currencies[$defaultIdCurrency]['iso_code'])); + else + $defaultCurrencyImport = new Currency((int)Currency::getIdByIsoCodeNum($currencies[$defaultIdCurrency]['iso_code_num'])); + + $defaultCurrency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT')); + if ($defaultCurrency->iso_code != $defaultCurrencyImport->iso_code) + $errors[] = $this->l('Default currency doesn\'t match : ').'
        '.Configuration::get('PS_SHOP_NAME').' : '.$defaultCurrency->name.' ≠ '.$importModule->displayName.' : '.$defaultCurrencyImport->name.'
        '.$this->l('Please change default currency in your configuration'); + } + if (!empty($errors)) + die('{"hasError" : true, "error" : '.Tools::jsonEncode($errors).'}'); + } + else + die('{"hasError" : true, "error" : ["FATAL ERROR"], "datas" : []}'); + } + + foreach($fields as $key => $field) + { + $id = $this->supportedImports[strtolower($className)]['identifier']; + //remove wrong fields (ex : id_toto in Customer) + foreach($field as $name => $value) + if (!array_key_exists($name, get_object_vars($object)) AND ($name != $id) AND ($name != 'association') AND ($name != 'images') AND (strtolower($className) != 'cart')) + unset($field[$name]); + $return = $this->validateRules($rules, $field, $className, $languages, $defaultLanguage); + $fields[$key] = $field; + if (!empty($return)) + { + //skip mode + if (Tools::getValue('hasErrors') == 1) + unset($fields[$key]); + + $errors[] = $return; + array_unshift($errors[sizeof($errors)-1], $field[$id]); + } + } + if (sizeof($errors) > 0) + { + $json['hasError'] = true; + $json['error'] = $errors; + } + if ($save OR Tools::isSubmit('syncLang')) + { + //add language if not exist in prestashop + if ($className == 'Language') + { + if (Tools::isSubmit('syncLang')) + $add = true; + else + $add = false; + $errors = $this->checkAndAddLang($fields, $add); + } + elseif ($className == 'Cart') + { + $this->saveOrders($fields); + } + else + { + $return = $this->saveObject($className, $fields); + $this->cleanPositions($table); + //insert association + if (array_key_exists('association', $this->supportedImports[strtolower($className)])) + $this->insertAssociation(strtolower($className), $fields); + if (!empty($return)) + { + $json['hasError'] = true; + $json['error'] = $return; + } + } + if ($className == 'Category' AND (sizeof($fields) != (int)Tools::getValue('nbr_import'))) + $this->updateCat(); + } + if (sizeof($errors) > 0 AND is_array($errors)) + { + $json['hasError'] = true; + $json['error'] = $errors; + } + die(Tools::jsonEncode($json)); + } + + private function saveObject($className, $items) + { + $return = array(); + $table = $this->supportedImports[strtolower($className)]['table']; + //creating temporary fields for identifiers matching and password + if (array_key_exists('alterTable', $this->supportedImports[strtolower($className)])) + $this->alterTable(strtolower($className)); + foreach($items as $item) + { + $object = new $className; + $id = $item[$this->supportedImports[strtolower($className)]['identifier']]; + if (array_key_exists('foreign_key', $this->supportedImports[strtolower($className)])) + $this->replaceForeignKey($item, $table); + $matchIdLang = $this->getMatchIdLang(1); + foreach($item as $key => $val) + { + if ($key == 'passwd') + { + $password = $val; + $val = substr($val,0,29); + } + if (is_array($val) AND $key != 'images') + { + + foreach($matchIdLang as $k => $v) + if ($k != $v) + { + $item[$key][$v] = $val[$k]; + unset($item[$key][$k]); + } + $object->$key = $item[$key]; + } + else + $object->$key = $val; + } + if (!$object->save()) + $return[] = array($item[$this->supportedImports[strtolower($className)]['identifier']], $this->l('An error occurred when adding the object')); + else + { + $this->saveMatchId(strtolower($className), (int)$object->id, (int)$id); + if ($className == 'Customer') + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET passwd_'.Tools::getValue('moduleName').' = \''.$password.'\' WHERE id_customer = '.(int)$object->id); + if (array_key_exists('hasImage', $this->supportedImports[strtolower($className)]) AND Tools::isSubmit('images_'.$className)) + $this->copyImg($item, $className); + } + } + return $return; + } + + private function saveOrders($items) + { + $this->saveObject('cart', $items); + //import cart product + $foreignKey = $this->getForeignKey('Cart', array('id_cart', 'id_product', 'id_product_attribute', 'id_customer','id_address_invoice', 'id_address_delivery')); + foreach($items as &$item) + { + foreach($item['cart_products'] as $k => $cart_products) + { + foreach($cart_products as $key => $val) + if (array_key_exists($key, $foreignKey)) + if (array_key_exists($val, $foreignKey[$key])) + $item['cart_products'][$k][$key] = $foreignKey[$key][$val]; + else + $item['cart_products'][$k][$key] = 0; + Db::getInstance()->autoExecute(_DB_PREFIX_.'cart_product', $item['cart_products'][$k],'INSERT'); + } + foreach($item['order_products'] as $k => $order_products) + { + foreach($order_products as $key => $val) + if (array_key_exists($key, $foreignKey)) + if (array_key_exists($val, $foreignKey[$key])) + $item['order_products'][$k][$key] = $foreignKey[$key][$val]; + else + $item['order_products'][$k][$key] = 0; + } + } + //cart to order + $this->cartToOrder($items, $foreignKey); + $foreignKey = array_merge($this->getForeignKey('Cart', array('id_order', 'id_order_state')), $foreignKey); + foreach($items as &$item) + { + //insert product in order detail + foreach($item['order_products'] as $k => $order_products) + { + foreach($order_products as $key => $val) + if (array_key_exists($key, $foreignKey)) + if (array_key_exists($val, $foreignKey[$key])) + $item['order_products'][$k][$key] = $foreignKey[$key][$val]; + else + $item['order_products'][$k][$key] = 0; + Db::getInstance()->autoExecute(_DB_PREFIX_.'order_detail', $item['order_products'][$k],'INSERT'); + } + //save order history + foreach($item['order_history'] as $k => $order_history) + { + foreach($order_history as $key => $val) + if (array_key_exists($key, $foreignKey)) + if (array_key_exists($val, $foreignKey[$key])) + $item['order_history'][$k][$key] = $foreignKey[$key][$val]; + else + $item['order_history'][$k][$key] = 0; + + Db::getInstance()->autoExecute(_DB_PREFIX_.'order_history', $item['order_history'][$k],'INSERT'); + } + } + } + + private function insertAssociation($table, $items) + { + foreach($this->supportedImports[$table]['association'] AS $association) + { + $associatFields = ''; + $associatFieldsName = implode('`, `', $association['fields']); + $tableAssociation = $association['table']; + $matchTable = $association['matchTable']; + if (!empty($items)) + { + $match = array(); + foreach($matchTable as $mTable) + { + $tmp = $this->getForeignKey($mTable, array('id_'.$mTable)); + if (array_key_exists('id_'.$mTable, $tmp)) + $match['id_'.$mTable] = $tmp['id_'.$mTable]; + else + $match['id_'.$mTable] = $this->getDefaultId($table); + } + foreach($items AS $item) + foreach($item AS $key => $val) + if ($key == 'association' AND !empty($key)) + foreach($val[$tableAssociation] AS $k => $v) + { + $associatFields .= ' ('.((array_key_exists($k, $match[$association['fields'][0]])) ? (int)$match[$association['fields'][0]][$k] : '1').', '; + $associatFields .= (int)$match[$association['fields'][1]][$v].'), '; + } + if ($associatFields != '') + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.pSQL($tableAssociation).'` (`'.$associatFieldsName.'`) VALUES '.rtrim($associatFields, ', ')); + } + } + } + + private function saveMatchId($className, $psId, $matchId) + { + $table = $this->supportedImports[$className]['table']; + $moduleName = Tools::getValue('moduleName'); + $identifier = $this->supportedImports[$className]['identifier']; + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.pSQL($table).' SET `'.pSQL($identifier).'_'.pSQL($moduleName).'` = '.(int)$matchId.' WHERE `'.pSQL($identifier).'` = '.(int)$psId); + } + + private function getMatchId($className) + { + $table = $this->supportedImports[$className]['table']; + $moduleName = Tools::getValue('moduleName'); + $identifier = $this->supportedImports[$className]['identifier']; + $returns = Db::getInstance()->ExecuteS('SELECT `'.pSQL($identifier).'_'.pSQL($moduleName).'`, `'.pSQL($identifier).'` FROM '._DB_PREFIX_.pSQL($table).' WHERE `'.pSQL($identifier).'_'.pSQL($moduleName).'` != 0 '); + $match = array(); + foreach($returns as $return) + $match[$return[$identifier.'_'.$moduleName]] = $return[$identifier]; + return $match; + } + + private function getDefaultId($table) + { + $defaultId = 1; + if (array_key_exists('defaultId', $this->supportedImports[strtolower($table)])) + $defaultId = Configuration::get($this->supportedImports[strtolower($table)]['defaultId']); + return $defaultId; + } + + private function copyImg($item, $className) + { + require_once('../../images.inc.php'); + $identifier = $this->supportedImports[strtolower($className)]['identifier']; + $matchId = $this->getMatchId(strtolower($className)); + $matchIdLang = $this->getMatchIdLang(); + switch($className) + { + default: + case 'Product': + $path = _PS_PROD_IMG_DIR_; + $type = 'products'; + break; + case 'Category': + $path = _PS_CAT_IMG_DIR_; + $type = 'categories'; + break; + case 'Manufacturer': + $path = _PS_MANU_IMG_DIR_; + $type = 'manufacturers'; + break; + case 'Supplier': + $path = _PS_SUPP_IMG_DIR_; + $type = 'suppliers'; + break; + } + $cover = 1; + if (array_key_exists($item[$identifier], $matchId)) + foreach($item['images'] as $key => $image) + { + $tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'import'); + if (@copy($image, $tmpfile)) + { + + $imagesTypes = ImageType::getImagesTypes($type); + imageResize($tmpfile, $path.(int)$matchId[$item[$identifier]].'.jpg'); + if ($className == 'Product') + { + $image = new Image(); + $image->id_product = (int)($matchId[$item[$identifier]]); + $image->cover = $cover; + $image->position = Image::getHighestPosition((int)$matchId[$item[$identifier]]) + 1; + $legend = array(); + foreach($item['name'] as $key => $val) + if (array_key_exists($key, $matchIdLang)) + $legend[$matchIdLang[$key]] = Tools::link_rewrite($val); + else + $legend[Configuration::get('PS_LANG_DEFAULT')] = Tools::link_rewrite($val); + $image->legend = $legend; + $image->add(); + imageResize($tmpfile, $path.(int)$matchId[$item[$identifier]].'-'.(int)$image->id.'.jpg'); + foreach ($imagesTypes AS $k => $imageType) + imageResize($tmpfile, $path.(int)$matchId[$item[$identifier]].'-'.(int)$image->id.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']); + } + else + foreach ($imagesTypes AS $k => $imageType) + imageResize($tmpfile, $path.(int)$matchId[$item[$identifier]].'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']); + } + else + @unlink($tmpfile); + @unlink($tmpfile); + $cover = 0; + } + + } + + private function replaceForeignKey(&$item, $table) + { + if ($table == 'product_attribute') + $table2 = 'combination'; + else + $table2 = $table; + + $foreingKey = $this->supportedImports[$table2]['foreign_key']; + $foreingKeyValue = $this->getForeignKey($table, $foreingKey); + foreach($foreingKey as $key) + { + if ($table == 'product' AND $key == 'id_category') + $key2 = 'id_category_default'; + else if ($table == 'customer' AND $key == 'id_group') + $key2 = 'id_default_group'; + else + $key2 = $key; + if (array_key_exists($key, $foreingKeyValue) && $item[$key2] != 0) + $item[$key2] = (array_key_exists($item[$key2], $foreingKeyValue[$key]) ? $item[$key2] = $foreingKeyValue[$key][$item[$key2]] : $item[$key2] = 0); + else + $item[$key2] = $this->getDefaultId($table); + } + } + + private function alterTable($className) + { + $query =''; + $queryTmp = ''; + $from = $this->supportedImports[$className]['table']; + $result = array(); + $result = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.pSQL($from).'`'); + if (!$result) + $result = array(); + foreach ($this->supportedImports[$className]['alterTable'] AS $name => $type) + { + $moduleName = Tools::getValue('moduleName'); + if (!array_key_exists($name.'_'.$moduleName, $result)) + $queryTmp .= ' ADD `'.$name.'_'.$moduleName.'` '.$type.' NOT NULL,'; + } + if (!empty($queryTmp)) + { + $query = 'ALTER TABLE `'._DB_PREFIX_.pSQL($from).'` '; + $query .= rtrim($queryTmp, ','); + Db::getInstance()->Execute($query); + } + } + + private function updateCat() + { + $moduleName = Tools::getValue('moduleName'); + Db::getInstance()->Execute('UPDATE + '._DB_PREFIX_.'category c + INNER JOIN + '._DB_PREFIX_.'category c2 + ON + c.id_parent = c2.id_category_'.pSQL($moduleName).' + SET + c.id_parent = c2.id_category + WHERE c.id_category_'.pSQL($moduleName).' != 0'); + $category = new Category(); + $cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT')); + foreach($cats as $cat) + { + $cat = new Category((int)$cat['id_category']); + $cat->level_depth = $cat->calcLevelDepth(); + $cat->update(); + } + } + + private function getForeignKey($className, $foreign_key = null) + { + $moduleName = Tools::getValue('moduleName'); + if (is_null($foreign_key)) + $foreign_key = $this->supportedImports[$className]['foreign_key']; + $match = array(); + foreach($foreign_key AS $key) + { + if (in_array($key , array('id_address_invoice', 'id_address_delivery'))) + $key2 = 'id_address'; + elseif (in_array($key , array('id_category_default'))) + $key2 = 'id_category'; + else + $key2 = $key; + foreach($this->supportedImports AS $table => $conf) + if ($conf['identifier'] == $key2) + $from = $this->supportedImports[$table]['table']; + $return = Db::getInstance()->ExecuteS('SELECT `'.pSQL($key2).'_'.pSQL($moduleName).'`, `'.pSQL($key2).'` FROM `'._DB_PREFIX_.pSQL($from).'` WHERE `'.pSQL($key2).'_'.pSQL($moduleName).'` != 0'); + if (!empty($return)) + foreach($return AS $name => $val) + $match[$key][$val[$key2.'_'.$moduleName]] = $val[$key2]; + } + return $match; + } + + private function getForeignKeyLang($table) + { + $id = $this->supportedImports[$table]['identifier']; + $moduleName = Tools::getValue('moduleName'); + $return = Db::getInstance()->ExecuteS('SELECT `'.pSQL($id).'_'.pSQL($moduleName).'`, `'.pSQL($id).'` FROM `'._DB_PREFIX_.pSQL($table).'` WHERE `'.pSQL($id).'_'.pSQL($moduleName).'` != 0'); + $match = array(); + foreach($return AS $name => $val) + $match[$val[$id.'_'.$moduleName]] = $val[$id]; + return $match; + } + + private function getMatchIdLang($order = 1) + { + $moduleName = Tools::getValue('moduleName'); + $return = Db::getInstance()->ExecuteS('SELECT `id_lang`, `id_lang_'.pSQL($moduleName).'` FROM `'._DB_PREFIX_.'lang'.'` WHERE `id_lang_'.pSQL($moduleName).'` != 0'); + $match = array(); + foreach($return AS $name => $val) + if ((bool)$order) + $match[$val['id_lang_'.$moduleName]] = $val['id_lang']; + else + $match[$val['id_lang']] = $val['id_lang_'.$moduleName]; + return $match; + } + + + private function validateRules($rules, &$fields, $className, $languages, $defaultLanguage) + { + $returnErrors = array(); + $hasErrors = Tools::getValue('hasErrors'); + /* Checking for required fields */ + foreach ($rules['required'] AS $field) + if (($value = $fields[$field]) == false AND (string)$value != '0') + if ($hasErrors == 2) + { + if (array_key_exists($field, $rules['size'])) + $size = $rules['size'][$field]; + else + $size = 1; + $fields[$field] = $this->generateData($size, $rules['validate'][$field]); + } + else + $returnErrors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is required'); + + /* Checking for maximum fields sizes */ + foreach ($rules['size'] AS $field => $maxLength) + if (array_key_exists($field, $fields) AND $field != 'passwd') + if ($fields[$field] !== false AND Tools::strlen($fields[$field]) > $maxLength) + if ($hasErrors == 2) + $fields[$field] = substr($fields[$field], 0, $maxLength); + else + $returnErrors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).''.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; + + /* Checking for fields validity */ + foreach ($rules['validate'] AS $field => $function) + if (array_key_exists($field, $fields)) + if (($value = $fields[$field]) !== false AND ($field != 'passwd')) + if (!Validate::$function($value)) + if ($hasErrors == 2) + { + if (array_key_exists($field, $rules['size'])) + $size = $rules['size'][$field]; + else + $size = 1; + $fields[$field] = $this->generateData($size, $rules['validate'][$field]); + } + else + $returnErrors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is invalid'); + + if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']))) + { + $matchIdLang = $this->getMatchIdLang(0); + /* Checking for multilingual required fields */ + foreach ($rules['requiredLang'] AS $fieldLang) + { + if (($empty = $fields[$fieldLang][$matchIdLang[$defaultLanguage->id]]) === false OR empty($empty)) + if ($hasErrors == 2) + { + if (array_key_exists($fieldLang, $rules['sizeLang'])) + $size = $rules['sizeLang'][$fieldLang]; + else + $size = 1; + $fields[$fieldLang][$matchIdLang[$defaultLanguage->id]] = $this->generateData($size, $rules['validateLang'][$fieldLang]); + } + else + $returnErrors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' '.$this->l('is required at least in').' '.$defaultLanguage->name; + } + /* Checking for maximum multilingual fields size */ + foreach ($rules['sizeLang'] AS $fieldLang => $maxLength) + foreach ($languages AS $language) + if (isset($fields[$fieldLang][$language['id_lang']]) && $fields[$fieldLang] !== false AND Tools::strlen($fields[$fieldLang][$language['id_lang']]) > $maxLength) + if ($hasErrors == 2) + $fields[$fieldLang] = substr($fields[$fieldLang], 0, $maxLength); + else + $returnErrors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; + /* Checking for multilingual fields validity */ + foreach ($rules['validateLang'] AS $fieldLang => $function) + foreach ($languages AS $language) + { + if (array_key_exists($fieldLang, $fields) AND ($value = $fields[$fieldLang][$language['id_lang']]) !== false AND !empty($value)) + { + if (!Validate::$function($value)) + { + if ($hasErrors == 2) + { + if (array_key_exists($fieldLang, $rules['sizeLang'])) + $size = $rules['sizeLang'][$fieldLang]; + else + $size = 1; + $fields[$fieldLang][$matchIdLang[$language['id_lang']]] = $this->generateData($size, $rules['validateLang'][$fieldLang]); + } + } + else + $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is invalid'); + } + } + } + return $returnErrors; + } + + public function checkAndAddLang ($languages, $add = true) + { + $errors = ''; + $moduleName = Tools::getValue('moduleName'); + $this->alterTable('language'); + foreach($languages as $language) + { + $iso = $language['iso_code']; + if (!Language::isInstalled($iso)) + { + if ($add) + { + if (@fsockopen('www.prestashop.com', 80)) + { + if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso))) + { + if ($content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$iso.'.gzip')) + { + $file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip'; + if (file_put_contents($file, $content)) + { + require_once('../../tools/tar/Archive_Tar.php'); + $gz = new Archive_Tar($file, true); + if ($gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) + { + if (!Language::checkAndAddLanguage($iso)) + $errors[] = Tools::displayError('Archive cannot be extracted.'); + else + { + $newId = Language::getIdByIso($iso); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang` + SET `id_lang_'.pSQL($moduleName).'` = '.(int)$language['id_lang'].' + WHERE `id_lang` = '.(int)$newId); + } + } + $errors[] = Tools::displayError('Archive cannot be extracted.'); + } + else + $errors[] = Tools::displayError('Server does not have permissions for writing.'); + } + else + $errors[] = Tools::displayError('Language not found'); + } + else + $errors[] = Tools::displayError('archive cannot be downloaded from prestashop.com.'); + } + else + $errors[] = Tools::displayError('archive cannot be downloaded from prestashop.com.'); + } + } + else + { + $newId = Language::getIdByIso($iso); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang` + SET `id_lang_'.pSQL($moduleName).'` = '.(int)$language['id_lang'].' + WHERE `id_lang` = '.(int)$newId); + } + } + } + + public function truncateTable($table) + { + switch ($table) + { + case 'customer' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'customer'); + break; + case 'address' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'address'); + break; + case 'category' : + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE id_category != 1'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE id_category != 1'); + Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'category` AUTO_INCREMENT = 2 '); + foreach (scandir(_PS_CAT_IMG_DIR_) AS $d) + if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d)) + unlink(_PS_CAT_IMG_DIR_.$d); + Image::clearTmpDir(); + break; + case 'product' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'product'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'feature_product'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_lang'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'category_product'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_tag'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'image'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'image_lang'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_attribute'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_attribute_combination'); + foreach (scandir(_PS_PROD_IMG_DIR_) AS $d) + if (preg_match('/^[0-9]+(\-[0-9]+\-(.*))?\.jpg$/', $d)) + unlink(_PS_PROD_IMG_DIR_.$d); + Image::clearTmpDir(); + break; + case 'Manufacturers' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_lang'); + foreach (scandir(_PS_MANU_IMG_DIR_) AS $d) + if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d)) + unlink(_PS_MANU_IMG_DIR_.$d); + Image::clearTmpDir(); + break; + case 'Suppliers' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier'); + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier_lang'); + foreach (scandir(_PS_SUPP_IMG_DIR_) AS $d) + if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d)) + unlink(_PS_SUPP_IMG_DIR_.$d); + Image::clearTmpDir(); + break; + case 'currency' : + case 'customer' : + case 'zone' : + case 'state' : + case 'group' : + Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.pSQL($table)); + break; + } + return true; + } + + public function cleanPositions($table) + { + if($table == 'category') + { + //clean category position + $cat = Category::getCategories(1, false, false); + foreach($cat AS $i => $categ) + Category::cleanPositions((int)($categ['id_category'])); + } + if($table == 'product') + { + //clean products position + $cat = Category::getCategories(1, false, false); + foreach($cat AS $i => $categ) + Product::cleanPositions((int)($categ['id_category'])); + } + } + + public function getDefaultIdLang() + { + return; + } + + private function generateData($size = 1, $type) + { + $type = str_replace('is', '', $type); + $dom = array('com', 'net', 'org', 'biz', 'info'); + $alphaNum = '0123456789abcdefghijklmnopqrstuvwxyz'; + $alpha = 'abcdefghijklmnopqrstuvwxyz'; + $num = '0123456789'; + $return = ''; + + switch($type) + { + case 'CityName': + case 'Name': + case 'GenericName': + case 'CatalogName': + case 'Address': + case 'LinkRewrite': + case 'String': + $a = mt_rand($size/2, $size); + for ($i = 1; $i <= $a; $i++) + $return .= substr($alpha, mt_rand(0, strlen($alpha)), 1); + break; + case 'LanguageIsoCode': + for ($i = 1; $i <= 2; $i++) + $return .= substr($alpha, mt_rand(0, strlen($alpha)), 1); + break; + case 'LanguageCode': + for ($i = 1; $i <= 2; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + $return .= '-'; + for ($i = 1; $i <= 2; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + break; + case 'Bool': + $return .= mt_rand(0,1); + break; + case 'Int': + case 'UnsignedId': + case 'NumericIsoCode': + case 'PhoneNumber': + case 'PostCode': + $a = mt_rand($size/2, $size); + for ($i = 1; $i <= $a; $i++) + $return .= substr($num, mt_rand(0, strlen($num)), 1); + break; + case 'Price': + case 'Float': + $a = mt_rand(4, 10); + $b = mt_rand(4, 10); + for ($i = 1; $i <= $a; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + $return .= '-'; + for ($i = 1; $i <= $b; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + $return .= '.'.$dom[mt_rand(0, (sizeof($dom)-1))]; + break; + case 'ZipCodeFormat'; + $str = 'NLC -'; + $a = mt_rand($size/2, $size); + for ($i = 1; $i <= $a; $i++) + $return .= substr($str, mt_rand(0, strlen($str)), 1); + break; + case 'StateIsoCode'; + + break; + case 'Email': + $a = mt_rand(4, 10); + $b = mt_rand(4, 10); + for ($i = 1; $i <= $a; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + $return .= '@'; + for ($i = 1; $i <= $b; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + $return .= '.'.$dom[mt_rand(0, (sizeof($dom)-1))]; + break; + case 'Passwd': + $a = mt_rand($size/2, $size); + for ($i = 1; $i <= $a; $i++) + $return .= substr($alphaNum, mt_rand(0, strlen($alphaNum)), 1); + break; + case 'BirthDate': + $return .= '1970-01-01 00:00:00'; + break; + } + return $return; + } + + private function cartToOrder($items, $foreignKey) + { + $this->alterTable('order'); + foreach($items as $item) + { + $order = new Order(); + $order->id_carrier = (int)$item['id_carrier']; + $order->id_customer = (int)$foreignKey['id_customer'][$item['id_customer']]; + $order->id_address_invoice = (int)$foreignKey['id_address_invoice'][$item['id_address_invoice']]; + $order->id_address_delivery = (int)$foreignKey['id_address_delivery'][$item['id_address_delivery']]; + + $vat_address = new Address((int)$foreignKey['id_address_delivery'][$item['id_address_delivery']]); + $id_zone = Address::getZoneById((int)$vat_address->id); + $order->id_currency = (int)$item['id_currency']; + $order->id_lang = (int)$item['id_lang']; + $order->id_cart = (int)$foreignKey['id_cart'][$item['id_cart']]; + + $customer = new Customer((int)$order->id_customer); + $order->secure_key = pSQL($customer->secure_key); + $order->payment = Tools::substr($item['payment'], 0, 32); + if (isset($this->name)) + $order->module = $this->name; + + $currency = new Currency($order->id_currency); + $order->conversion_rate = $currency->conversion_rate; + $order->total_products = (float)$item['total_products']; + $order->total_products_wt = (float)$item['total_products_wt']; + $order->total_discounts = (float)$item['total_discounts']; + $order->total_shipping = (float)$item['total_shipping']; + $order->carrier_tax_rate = (float)Tax::getCarrierTaxRate((int)$item['id_carrier'], (int)$item[Configuration::get('PS_TAX_ADDRESS_TYPE')]); + $order->total_wrapping = (float)$item['total_wrapping']; + $order->total_paid = (float)$item['total_paid']; + $order->total_paid_real = (float)$item['total_paid_real']; + $order->invoice_date = '0000-00-00 00:00:00'; + $order->delivery_date = '0000-00-00 00:00:00'; + $order->add(); + + $this->saveMatchId('order', (int)$order->id, (int)$item['id_cart']); + } + } +} + +?> diff --git a/modules/socolissimo/ajax.php b/modules/socolissimo/ajax.php new file mode 100644 index 000000000..46110791c --- /dev/null +++ b/modules/socolissimo/ajax.php @@ -0,0 +1,19 @@ +getDeliveryInfos($cookie->id_cart,$cookie->id_customer); +if (!$result) + die('{"result" : false}'); +else + die('{"result" : true}'); +?> \ No newline at end of file diff --git a/modules/socolissimo/config.xml b/modules/socolissimo/config.xml new file mode 100755 index 000000000..4ad2756b7 --- /dev/null +++ b/modules/socolissimo/config.xml @@ -0,0 +1,12 @@ + + + socolissimo + So Colissimo + 2.0 + Offer your customers, different delivery methods with LaPoste. + PrestaShop + shipping_logistics + 1 + 1 + fr + \ No newline at end of file diff --git a/modules/socolissimo/de.php b/modules/socolissimo/de.php new file mode 100644 index 000000000..e54dade46 --- /dev/null +++ b/modules/socolissimo/de.php @@ -0,0 +1,87 @@ +socolissimo_42ab10dea7d96b9c353e0f5bae43ec20'] = 'So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_27d52fec98c204daecd4c4df2b8e11fa'] = 'Bieten Sie Ihren Kunden unterschiedliche Liefermethoden mit LaPoste.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f8e355b97fa1be7a8d8c206aa66f0077'] = '\'Lieferzone(n)\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_690c1c6abf905b88281a7cd324af9942'] = '\'Liefergruppe\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a18ef2e8b3730915798057a50ecbf2cd'] = '\'beste Lieferanten\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_59f26c70c0230e4ec5e4acdfed0e270c'] = '\'Lieferant Lieferpreis\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_798547c41ec3e64e2322df678e939344'] = '\'Id FO\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_ac08649aa09ff3b879525627bf086dd1'] = '\'Schlüssel\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a3a53f075adf77334cc34d0f7497ff44'] = '\'URL So\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_4d470fde8487e755a50e9235e3dc13ab'] = 'muss konfiguriert sein, um dieses Modul richtig zu nutzen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_94c614a9df45ea1fcd27b15b7d6f3e67'] = 'Ungültiger Schlüssel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_90a5cb3d07bb39bbd4b76f7f9a0d7947'] = 'Ein Fehler ist beim Abschnitt Versand aufgetreten '; +$_MODULE['<{socolissimo}prestashop>socolissimo_70b2e65f0f2aabf3e2c58d70cf1e1e9a'] = 'Login FO fehlt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2b639b851983a24bc12358523861c7ff'] = 'Login FO falsch'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ca12228b5ad636c637425a086fe0092'] = 'Kunden unberechtigt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0b1d0c0a00cc2727fcd77902867e3641'] = 'Pflichtfeld fehlt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fa419073252af9d022afe65dccbb34a2'] = 'Fehlende Signatur'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fca3fbced675f75182786525bf4706dc'] = 'Ungültige Signatur'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d14afc3f67d2457d29f0aa0db98e2c9d'] = 'Postleitzahl ungültig'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f9733e52e8841f1e45d015d5af5e8655'] = 'Falsches URL-Format zurück Bestätigung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_417434a4e55adbc67c9c391902cea7f3'] = 'Falsches URL-Format zurück Fehler'; +$_MODULE['<{socolissimo}prestashop>socolissimo_140c34f0b21b932e34d11575509d093b'] = 'Ungültige Transaktions-ID'; +$_MODULE['<{socolissimo}prestashop>socolissimo_28ee1015b475a3a70613ea9c98d712b6'] = 'Format falsch Versandkosten'; +$_MODULE['<{socolissimo}prestashop>socolissimo_afa50e8b2fc14bf578331b2b8e98179d'] = 'Socolissimo Server nicht verfügbar'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d0b34d3e1cb0cc1150ae6bf650e9b569'] = 'SoColissimo ist ein Service von La Poste, der Ihren Käufern 5 Zustellungsarten anbietet'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e5c7c47a2cc967ae4834ad5c076734df'] = 'Nach Hause'; +$_MODULE['<{socolissimo}prestashop>socolissimo_05ded48a069b0390fd4609e103eec154'] = 'Nach Hause nach Terminvereinbarung'; +$_MODULE['<{socolissimo}prestashop>socolissimo_402c04ef2c99ebccbc8fb047bb7a1185'] = 'zum Cityssimo Abholpunkt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_45b080bdf4c705a1e4cd664da70bf41c'] = 'In ihr Büro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e6fb019213dbc66e25bef9d25b889eed'] = 'Zu ihrem Händler'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9fbff0971c06ee404f638e9abcbd9446'] = 'Dieses Modul ist kostenlos und ermöglicht Ihnen das Aktivieren dieses Angebot in Ihrem Shop.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b6cf869265c13af8566f192b4ab3d2a'] = 'Dokumentation'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0ab984d91ab0a037bdf692bf0e73c349'] = 'Wichtig'; +$_MODULE['<{socolissimo}prestashop>socolissimo_58f73ae759adc826a9e15e26280cdaa4'] = 'Um Ihr SoColissimo-Konto zu eröffnen, kontaktieren Sie bitte \"La Poste\" unter dieser Rufnummer: 3634 (Französische Telefonnummer)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9c85d4c2bae6ab548fe23e57bd89ddc4'] = 'ID So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7b95472e0575adc1e3d90a2d7b51e496'] = 'Benutzer-Id für das SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_897356954c2cd3d41b221e3f24f99bba'] = 'Schlüssel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fe78e0a947bf1e0c9e0d9485f40e69cb'] = 'Sicherheitsschlüssel für das SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_64979b52d796defbdf05356df9e37d57'] = 'Vorbereitungszeit'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c76660d589be9a49e8846e51b71744ae'] = 'Tag (e)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1fb031ceef337d6c513315dc5ec98a27'] = 'Durchschnittliche Zeit der Sendungsvorbereitung.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e986d627f454602880075fe556378073'] = 'Die durchschnittliche Zeit muss die gleiche sein im ColiPoste Back Office.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_31e3fd47be6f64fb2e0a4f85cb63a069'] = 'Mehraufwendungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a68e8fd6d255edb0ca099c7400252694'] = 'Zusätzliche Kosten bei Terminvereinbarungen.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d38ac03101faea9ed5f9ea96bf8627b4'] = 'Zusätzliche Kosten müssen die gleichen im ColiPoste Back Office sein.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9954970bc5804ff557ced19516e2a55c'] = 'Seien Sie SEHR VORSICHTIG mit diesen Einstellungen, Änderungen können zu einer Fehlfunktion des Moduls führen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b0b2896e75025245cbb05e96bd1466d6'] = 'Url So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce88aabea3b363c753b02ddcb2fbafff'] = 'URL des SoColissimo Backoffice.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_85068ddf0b9bcbb6913008356fe328a0'] = 'Kontrolle'; +$_MODULE['<{socolissimo}prestashop>socolissimo_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fdd526b84abc0b8fc17060e62d022b84'] = 'Verfügbarkeit von Service SoColissimo erlauben oder nicht erlauben '; +$_MODULE['<{socolissimo}prestashop>socolissimo_32996bdf4214d6cb8bf7fa02273813c8'] = 'URL Kontrolle'; +$_MODULE['<{socolissimo}prestashop>socolissimo_995a56aecac4198b9bc0a17a976561b5'] = 'URL der Kontrolle'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3e387f5ebd657c6372f0594c8226863e'] = 'Hier sind zwei Adressen, die Sie in Ihrem Back Office SoColissimo ausfüllen müssen '; +$_MODULE['<{socolissimo}prestashop>socolissimo_49977cbb6772deeac9ceb89f069e491c'] = 'Bestätigungs-URL '; +$_MODULE['<{socolissimo}prestashop>socolissimo_06dc3f24f73027164d2b19556118624e'] = 'Rückgabe-URL'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82c440defe28e2099cba1af1f0761807'] = 'ID SO nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_826361881cfc18b8b75405d398f633b5'] = 'Key SO nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0bf6a620e5f22d8b46e3903a993f7741'] = 'Vorbereitungszeit nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_228485c5faff886fa4520323dc5b2c76'] = 'Ungültige Vorbereitungszeit '; +$_MODULE['<{socolissimo}prestashop>socolissimo_c3288acdf9ecd0a4fb1e308442b06867'] = 'Mehraufwendungen nicht angegeben'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1a89bc7d83f6e90b2368e3401690a87a'] = 'Ungültige Mehraufwendungen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{socolissimo}prestashop>socolissimo_126d781eae70fa41e9e848f3013e1799'] = 'Kann Einstellungen nicht speichern'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ea4eac85d1d1967562869cf1e14b1d0'] = 'Klicken Sie auf eine Liefermethode, um SoColissimo auszuwählen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_201bdb87f8e278b943d07ae924d5de6e'] = 'Liefermodus'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Firma'; +$_MODULE['<{socolissimo}prestashop>socolissimo_8b5dd64ab8d0b8158906796b53a200e2'] = 'E-Mail-Adresse'; +$_MODULE['<{socolissimo}prestashop>socolissimo_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e19726b466603bc3e444dd26fbcde074'] = 'Kundenadresse'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6311ae17c1ee52b36e68aaf4ad066387'] = 'Andere'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d676596f71fd0f73f735da4bb4225151'] = 'Tür-Code'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ea7d9b60cc8654d2c6e8813529a2f3e8'] = 'Liefer-Informationen'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e937c6393ce858786bd31a279b50572d'] = 'Abholpunkt-ID'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f109a88feec5ad3aeb82580c7a20ec31'] = 'Abholpunkt'; +$_MODULE['<{socolissimo}prestashop>socolissimo_021944549c2795a6e4db23b92f198a5e'] = 'Abholpunkt-Adresse'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; diff --git a/modules/socolissimo/es.php b/modules/socolissimo/es.php new file mode 100644 index 000000000..6d6137db5 --- /dev/null +++ b/modules/socolissimo/es.php @@ -0,0 +1,87 @@ +socolissimo_42ab10dea7d96b9c353e0f5bae43ec20'] = 'La Poste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_27d52fec98c204daecd4c4df2b8e11fa'] = 'Proponga a sus clientes cinco modos de entraga a través de la Poste.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f8e355b97fa1be7a8d8c206aa66f0077'] = 'Zona(s) transportista'; +$_MODULE['<{socolissimo}prestashop>socolissimo_690c1c6abf905b88281a7cd324af9942'] = 'Grupo del transportista'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a18ef2e8b3730915798057a50ecbf2cd'] = 'Franja del transportista'; +$_MODULE['<{socolissimo}prestashop>socolissimo_59f26c70c0230e4ec5e4acdfed0e270c'] = 'Precio de franja'; +$_MODULE['<{socolissimo}prestashop>socolissimo_798547c41ec3e64e2322df678e939344'] = '\'Identificante FO\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_ac08649aa09ff3b879525627bf086dd1'] = '\'Clave de encriptación\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a3a53f075adf77334cc34d0f7497ff44'] = '\'URL de la administración de SoColissimo\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_4d470fde8487e755a50e9235e3dc13ab'] = 'deben indicarse para funcionar correctamente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_94c614a9df45ea1fcd27b15b7d6f3e67'] = 'Clave no válida'; +$_MODULE['<{socolissimo}prestashop>socolissimo_90a5cb3d07bb39bbd4b76f7f9a0d7947'] = 'Se ha producido un error en la etapa \'transportista\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_70b2e65f0f2aabf3e2c58d70cf1e1e9a'] = 'Identificante FO inexistente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2b639b851983a24bc12358523861c7ff'] = 'Identificante FO incorrecto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ca12228b5ad636c637425a086fe0092'] = 'Cliente no autorizado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0b1d0c0a00cc2727fcd77902867e3641'] = 'Faltan campos obligatorios'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fa419073252af9d022afe65dccbb34a2'] = 'Falta firma'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fca3fbced675f75182786525bf4706dc'] = 'Firma no válida'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d14afc3f67d2457d29f0aa0db98e2c9d'] = 'Código postal no válido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f9733e52e8841f1e45d015d5af5e8655'] = 'Formato URL devolución Validación incorrecto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_417434a4e55adbc67c9c391902cea7f3'] = 'Formato URL devolución Fracaso incorrecto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_140c34f0b21b932e34d11575509d093b'] = 'ID de la transacción no válida'; +$_MODULE['<{socolissimo}prestashop>socolissimo_28ee1015b475a3a70613ea9c98d712b6'] = 'Formato de gastos de envío incorrecto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_afa50e8b2fc14bf578331b2b8e98179d'] = 'Servidor SoColissimo no disponible'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d0b34d3e1cb0cc1150ae6bf650e9b569'] = 'SoColissimo es un servicio propuesto Por La Poste, que le permite proponer a sus compradores cinco modos de entrega:'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e5c7c47a2cc967ae4834ad5c076734df'] = 'Entrega a domicilio'; +$_MODULE['<{socolissimo}prestashop>socolissimo_05ded48a069b0390fd4609e103eec154'] = 'Entrega a domicilio previa cita entre las 17h y las 21h30'; +$_MODULE['<{socolissimo}prestashop>socolissimo_402c04ef2c99ebccbc8fb047bb7a1185'] = 'Entrega en uno de los 31 espacios Cityssimo, 7/7 y 24h/24'; +$_MODULE['<{socolissimo}prestashop>socolissimo_45b080bdf4c705a1e4cd664da70bf41c'] = 'Entrega en uno de los 10.000 oficinas de Correos que elijan'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e6fb019213dbc66e25bef9d25b889eed'] = 'Entrega en uno de los numerosos puntos de recogida en partenariado con La Poste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9fbff0971c06ee404f638e9abcbd9446'] = 'Este módulo es totalmente gratuito y le permite activar dicha oferta en su tienda.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentación'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0ab984d91ab0a037bdf692bf0e73c349'] = 'Importante'; +$_MODULE['<{socolissimo}prestashop>socolissimo_58f73ae759adc826a9e15e26280cdaa4'] = 'Para abrir una cuenta SoColissimo, póngase en contacto con \"La Poste\" a través de 3634'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9c85d4c2bae6ab548fe23e57bd89ddc4'] = 'Identificante FO'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7b95472e0575adc1e3d90a2d7b51e496'] = 'Usuario So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_897356954c2cd3d41b221e3f24f99bba'] = 'Clave de encriptación'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fe78e0a947bf1e0c9e0d9485f40e69cb'] = 'Clave de encriptación So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_64979b52d796defbdf05356df9e37d57'] = 'Tiempo de preparación'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c76660d589be9a49e8846e51b71744ae'] = 'día(s)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1fb031ceef337d6c513315dc5ec98a27'] = 'Plazo medio de preparación de sus pedidos'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e986d627f454602880075fe556378073'] = 'El plazo de preparación de pedido debe ser idéntico al indicado en Back Office ColiPoste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_31e3fd47be6f64fb2e0a4f85cb63a069'] = 'Coste adicional'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a68e8fd6d255edb0ca099c7400252694'] = 'Coste adicional aplicable a la entrega a domicilio previa cita'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d38ac03101faea9ed5f9ea96bf8627b4'] = 'El coste adicional debe ser idéntico al indicado en el Back Office ColiPoste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9954970bc5804ff557ced19516e2a55c'] = 'Tenga cuidado con estos parámetros, su modificación puede provocar un disfuncionamiento del módulo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b0b2896e75025245cbb05e96bd1466d6'] = 'Dirección FO'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce88aabea3b363c753b02ddcb2fbafff'] = 'URL de la administración de So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_85068ddf0b9bcbb6913008356fe328a0'] = 'Supervisión'; +$_MODULE['<{socolissimo}prestashop>socolissimo_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fdd526b84abc0b8fc17060e62d022b84'] = 'Autorizar o no la comprobación de la disponiblidad de los servicios SoColissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_32996bdf4214d6cb8bf7fa02273813c8'] = 'Dirección de comprobación'; +$_MODULE['<{socolissimo}prestashop>socolissimo_995a56aecac4198b9bc0a17a976561b5'] = 'Dirección de comprobación de disponibilidad'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Información'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3e387f5ebd657c6372f0594c8226863e'] = 'Aquí tiene las dos direcciones que debe indicar en su Back-Office Coliposte'; +$_MODULE['<{socolissimo}prestashop>socolissimo_49977cbb6772deeac9ceb89f069e491c'] = 'URL de validación'; +$_MODULE['<{socolissimo}prestashop>socolissimo_06dc3f24f73027164d2b19556118624e'] = 'URL de devolución'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82c440defe28e2099cba1af1f0761807'] = 'Identificante FO no especificado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_826361881cfc18b8b75405d398f633b5'] = 'Clave de encriptación no especificada'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0bf6a620e5f22d8b46e3903a993f7741'] = 'Tiempo de preparación no especificado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_228485c5faff886fa4520323dc5b2c76'] = 'Tiempo de preparación no válido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c3288acdf9ecd0a4fb1e308442b06867'] = 'Coste adicional no especificado'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1a89bc7d83f6e90b2368e3401690a87a'] = 'Coste adicional no válido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{socolissimo}prestashop>socolissimo_126d781eae70fa41e9e848f3013e1799'] = 'Imposible guardar los parámetros'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ea4eac85d1d1967562869cf1e14b1d0'] = 'Para elegir SoColissimo, marque un modo en entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_201bdb87f8e278b943d07ae924d5de6e'] = 'Modo de entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Empresa'; +$_MODULE['<{socolissimo}prestashop>socolissimo_8b5dd64ab8d0b8158906796b53a200e2'] = 'Dirección email'; +$_MODULE['<{socolissimo}prestashop>socolissimo_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tel.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e19726b466603bc3e444dd26fbcde074'] = 'Dirección del cliente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6311ae17c1ee52b36e68aaf4ad066387'] = 'Otros'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d676596f71fd0f73f735da4bb4225151'] = 'Código acceso portal'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ea7d9b60cc8654d2c6e8813529a2f3e8'] = 'Datos de entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e937c6393ce858786bd31a279b50572d'] = 'ID del punto de entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f109a88feec5ad3aeb82580c7a20ec31'] = 'Punto de entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_021944549c2795a6e4db23b92f198a5e'] = 'Dirección del punto de entrega'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; diff --git a/modules/socolissimo/fr.php b/modules/socolissimo/fr.php new file mode 100644 index 000000000..bd3e3b140 --- /dev/null +++ b/modules/socolissimo/fr.php @@ -0,0 +1,87 @@ +socolissimo_42ab10dea7d96b9c353e0f5bae43ec20'] = 'La Poste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_27d52fec98c204daecd4c4df2b8e11fa'] = '\'Proposez à vos clients 5 modes de livraison via La Poste.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f8e355b97fa1be7a8d8c206aa66f0077'] = '\'Zone(s) du transporteur\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_690c1c6abf905b88281a7cd324af9942'] = '\'Groupe du transporteur\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a18ef2e8b3730915798057a50ecbf2cd'] = '\'Tranche(s) du transporteur\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_59f26c70c0230e4ec5e4acdfed0e270c'] = '\'Prix de tranche\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_798547c41ec3e64e2322df678e939344'] = '\'Identifiant FO\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_ac08649aa09ff3b879525627bf086dd1'] = '\'Clé de cryptage\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a3a53f075adf77334cc34d0f7497ff44'] = '\'Url de l\'administration de SoColissimo\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_4d470fde8487e755a50e9235e3dc13ab'] = 'doivent être renseignés pour fonctionner correctement'; +$_MODULE['<{socolissimo}prestashop>socolissimo_94c614a9df45ea1fcd27b15b7d6f3e67'] = 'Clé invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_90a5cb3d07bb39bbd4b76f7f9a0d7947'] = 'une erreur s\'est produite lors de l\'étape transporteur'; +$_MODULE['<{socolissimo}prestashop>socolissimo_70b2e65f0f2aabf3e2c58d70cf1e1e9a'] = 'Identifiant FO manquant'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2b639b851983a24bc12358523861c7ff'] = 'Identifiant FO incorrect'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ca12228b5ad636c637425a086fe0092'] = 'Client non autorise'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0b1d0c0a00cc2727fcd77902867e3641'] = 'Champs obligatoire manquant'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fa419073252af9d022afe65dccbb34a2'] = 'Signature manquante'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fca3fbced675f75182786525bf4706dc'] = 'Signature invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d14afc3f67d2457d29f0aa0db98e2c9d'] = 'Code postal invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f9733e52e8841f1e45d015d5af5e8655'] = 'Format url retour Validation incorrect'; +$_MODULE['<{socolissimo}prestashop>socolissimo_417434a4e55adbc67c9c391902cea7f3'] = 'Format url retour Echec incorrect'; +$_MODULE['<{socolissimo}prestashop>socolissimo_140c34f0b21b932e34d11575509d093b'] = 'ID de la transaction invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_28ee1015b475a3a70613ea9c98d712b6'] = 'Format des frais d’expédition incorrect'; +$_MODULE['<{socolissimo}prestashop>socolissimo_afa50e8b2fc14bf578331b2b8e98179d'] = 'Serveur Socolissimo non disponible'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d0b34d3e1cb0cc1150ae6bf650e9b569'] = 'So Colissimo est un service proposé par La Poste, qui vous permet d\'offrir à vos acheteurs 5 modes de livraison :'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e5c7c47a2cc967ae4834ad5c076734df'] = 'Livraison à Domicile'; +$_MODULE['<{socolissimo}prestashop>socolissimo_05ded48a069b0390fd4609e103eec154'] = 'Livraison à Domicile sur Rendez-vous le soir entre 17h et 21h30'; +$_MODULE['<{socolissimo}prestashop>socolissimo_402c04ef2c99ebccbc8fb047bb7a1185'] = 'Livraison dans l\'un des 31 espaces Cityssimo, 7j/7 et 24h/24'; +$_MODULE['<{socolissimo}prestashop>socolissimo_45b080bdf4c705a1e4cd664da70bf41c'] = 'Livraison dans l\'un des 10.000 Bureaux de Poste de leur choix'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e6fb019213dbc66e25bef9d25b889eed'] = 'Livraison dans l\'un des nombreux point de retrait du réseau partenaire La Poste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9fbff0971c06ee404f638e9abcbd9446'] = 'Ce module est gratuit et vous permet d\'activer cette offre sur votre magasin.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentation'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0ab984d91ab0a037bdf692bf0e73c349'] = 'Important'; +$_MODULE['<{socolissimo}prestashop>socolissimo_58f73ae759adc826a9e15e26280cdaa4'] = 'Pour ouvrir un compte SoColissimo, merci de contacter \"La poste\" à ce numéro: 3634.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9c85d4c2bae6ab548fe23e57bd89ddc4'] = 'Identifiant FO'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7b95472e0575adc1e3d90a2d7b51e496'] = 'Utilisateur So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_897356954c2cd3d41b221e3f24f99bba'] = 'Clé de cryptage'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fe78e0a947bf1e0c9e0d9485f40e69cb'] = 'Clé de cryptage So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_64979b52d796defbdf05356df9e37d57'] = 'Temps de préparation'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c76660d589be9a49e8846e51b71744ae'] = 'Jour(s)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1fb031ceef337d6c513315dc5ec98a27'] = 'Délai moyen de préparation de vos commandes'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e986d627f454602880075fe556378073'] = 'Le délai de préparation de commande doit être identique à celui saisi dans le Back Office ColiPoste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_31e3fd47be6f64fb2e0a4f85cb63a069'] = 'Surcoût'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a68e8fd6d255edb0ca099c7400252694'] = 'Surcoût à appliquer pour la livraison à domicile sur rendez-vous'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d38ac03101faea9ed5f9ea96bf8627b4'] = 'Le \"surcoût\" doit être identique à celui saisi dans le Back Office ColiPoste'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9954970bc5804ff557ced19516e2a55c'] = 'Soyez très prudent avec ces paramètres, le changement peut provoquer un dysfonctionnement du module'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b0b2896e75025245cbb05e96bd1466d6'] = 'Adresse FO'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce88aabea3b363c753b02ddcb2fbafff'] = 'Url de l\'administration de So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_85068ddf0b9bcbb6913008356fe328a0'] = 'Supervision'; +$_MODULE['<{socolissimo}prestashop>socolissimo_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fdd526b84abc0b8fc17060e62d022b84'] = 'Autoriser ou non la verification de la disponibilité des services SoColissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_32996bdf4214d6cb8bf7fa02273813c8'] = 'Adresse de verification'; +$_MODULE['<{socolissimo}prestashop>socolissimo_995a56aecac4198b9bc0a17a976561b5'] = 'Adresse de verification de disponibilité'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3e387f5ebd657c6372f0594c8226863e'] = 'Voici les deux adresses que vous devez renseigner dans votre Back-Office Coliposte'; +$_MODULE['<{socolissimo}prestashop>socolissimo_49977cbb6772deeac9ceb89f069e491c'] = 'Url de validation'; +$_MODULE['<{socolissimo}prestashop>socolissimo_06dc3f24f73027164d2b19556118624e'] = 'Url de retour'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82c440defe28e2099cba1af1f0761807'] = 'Identifiant FO non spécifié'; +$_MODULE['<{socolissimo}prestashop>socolissimo_826361881cfc18b8b75405d398f633b5'] = 'Clé de cryptage non spécifié'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0bf6a620e5f22d8b46e3903a993f7741'] = 'Temps de préparation non spécifié'; +$_MODULE['<{socolissimo}prestashop>socolissimo_228485c5faff886fa4520323dc5b2c76'] = 'Temps de préparation invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c3288acdf9ecd0a4fb1e308442b06867'] = 'Surcoût non spécifié'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1a89bc7d83f6e90b2368e3401690a87a'] = 'Surcoût invalide'; +$_MODULE['<{socolissimo}prestashop>socolissimo_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{socolissimo}prestashop>socolissimo_126d781eae70fa41e9e848f3013e1799'] = 'Impossible de sauvegarder les paramètres'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ea4eac85d1d1967562869cf1e14b1d0'] = 'Pour choisir SoColissimo, cocher une méthode de livraison'; +$_MODULE['<{socolissimo}prestashop>socolissimo_201bdb87f8e278b943d07ae924d5de6e'] = 'Mode de livraison'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Entreprise'; +$_MODULE['<{socolissimo}prestashop>socolissimo_8b5dd64ab8d0b8158906796b53a200e2'] = 'Adresse e-mail'; +$_MODULE['<{socolissimo}prestashop>socolissimo_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e19726b466603bc3e444dd26fbcde074'] = 'Adresse du client'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6311ae17c1ee52b36e68aaf4ad066387'] = 'Autre'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d676596f71fd0f73f735da4bb4225151'] = 'Code de la porte'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ea7d9b60cc8654d2c6e8813529a2f3e8'] = 'Information de livraison'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e937c6393ce858786bd31a279b50572d'] = 'ID du point de retrait'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f109a88feec5ad3aeb82580c7a20ec31'] = 'Point de retrait'; +$_MODULE['<{socolissimo}prestashop>socolissimo_021944549c2795a6e4db23b92f198a5e'] = 'Adresse du point de retrait'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; diff --git a/modules/socolissimo/it.php b/modules/socolissimo/it.php new file mode 100644 index 000000000..90bd550e5 --- /dev/null +++ b/modules/socolissimo/it.php @@ -0,0 +1,87 @@ +socolissimo_42ab10dea7d96b9c353e0f5bae43ec20'] = 'So Colissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_27d52fec98c204daecd4c4df2b8e11fa'] = 'Offri ai tuoi clienti diverse modalità di consegna LaPoste.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f8e355b97fa1be7a8d8c206aa66f0077'] = '\'Zona/e del corriere\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_690c1c6abf905b88281a7cd324af9942'] = '\'Gruppo Corriere\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a18ef2e8b3730915798057a50ecbf2cd'] = '\'Fascia/e del corriere\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_59f26c70c0230e4ec5e4acdfed0e270c'] = '\'Prezzo consegna corriere\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_798547c41ec3e64e2322df678e939344'] = '\'ID FO\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_ac08649aa09ff3b879525627bf086dd1'] = '\'Chiave\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_a3a53f075adf77334cc34d0f7497ff44'] = '\'Url So\''; +$_MODULE['<{socolissimo}prestashop>socolissimo_4d470fde8487e755a50e9235e3dc13ab'] = 'deve essere configurato per utilizzare questo modulo correttamente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_94c614a9df45ea1fcd27b15b7d6f3e67'] = 'Chiave non valida'; +$_MODULE['<{socolissimo}prestashop>socolissimo_90a5cb3d07bb39bbd4b76f7f9a0d7947'] = 'Errore durante la fase di spedizione '; +$_MODULE['<{socolissimo}prestashop>socolissimo_70b2e65f0f2aabf3e2c58d70cf1e1e9a'] = 'Manca Login FO'; +$_MODULE['<{socolissimo}prestashop>socolissimo_2b639b851983a24bc12358523861c7ff'] = 'Login FO non valido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ca12228b5ad636c637425a086fe0092'] = 'Cliente non autorizzato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0b1d0c0a00cc2727fcd77902867e3641'] = 'Campo obbligatori mancante'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fa419073252af9d022afe65dccbb34a2'] = 'Firma mancante'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fca3fbced675f75182786525bf4706dc'] = 'Firma non valida'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d14afc3f67d2457d29f0aa0db98e2c9d'] = 'CAP non valido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f9733e52e8841f1e45d015d5af5e8655'] = 'Formato url restituzione convalida non corretto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_417434a4e55adbc67c9c391902cea7f3'] = 'Formato url restituzione errore non corretto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_140c34f0b21b932e34d11575509d093b'] = ' ID di transazione non valido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_28ee1015b475a3a70613ea9c98d712b6'] = 'Formato spese di spedizione formato non corretto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_afa50e8b2fc14bf578331b2b8e98179d'] = 'Socolissimo server non disponibile'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d0b34d3e1cb0cc1150ae6bf650e9b569'] = 'SoColissimo è un servizio offerto da La Poste, che permette di offrire all\'acquirente 5 modalità di consegna'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e5c7c47a2cc967ae4834ad5c076734df'] = 'A casa'; +$_MODULE['<{socolissimo}prestashop>socolissimo_05ded48a069b0390fd4609e103eec154'] = 'A casa com appuntamenti'; +$_MODULE['<{socolissimo}prestashop>socolissimo_402c04ef2c99ebccbc8fb047bb7a1185'] = 'Nello spazio Cityssimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_45b080bdf4c705a1e4cd664da70bf41c'] = 'Nel loro ufficio postale'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e6fb019213dbc66e25bef9d25b889eed'] = 'Nel loro punto di ritiro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9fbff0971c06ee404f638e9abcbd9446'] = 'Questo modulo è gratuito e permette di attivare questa offerta nel tuo negozio.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentazione'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0ab984d91ab0a037bdf692bf0e73c349'] = 'Importante'; +$_MODULE['<{socolissimo}prestashop>socolissimo_58f73ae759adc826a9e15e26280cdaa4'] = 'Per aprire il tuo account SoColissimo, si prega di contattare \"La Poste\" a questo numero telefonico: 3634 (numero di telefono francese)'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9c85d4c2bae6ab548fe23e57bd89ddc4'] = 'ID So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7b95472e0575adc1e3d90a2d7b51e496'] = 'ID utente per back office SoColissimo.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_897356954c2cd3d41b221e3f24f99bba'] = 'Chiave'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fe78e0a947bf1e0c9e0d9485f40e69cb'] = 'Chiave sicura per back office SoColissimo.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_64979b52d796defbdf05356df9e37d57'] = 'Tempo di preparazione'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c76660d589be9a49e8846e51b71744ae'] = 'Giorno/i'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1fb031ceef337d6c513315dc5ec98a27'] = 'Tempo medio di preparazione del materiale.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e986d627f454602880075fe556378073'] = 'Tempo medio deve essere lo stesso del ColiPoste Back Office.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_31e3fd47be6f64fb2e0a4f85cb63a069'] = 'Sovraccosto'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a68e8fd6d255edb0ca099c7400252694'] = 'Costo aggiuntivo se consegna su appuntamento.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d38ac03101faea9ed5f9ea96bf8627b4'] = 'Costo aggiuntivo deve essere lo stesso del ColiPoste Back Office.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_9954970bc5804ff557ced19516e2a55c'] = 'Fare MOLTA ATTENZIONE con queste impostazioni, il cambiamento può causare un malfunzionamento del modulo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b0b2896e75025245cbb05e96bd1466d6'] = 'URL So'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce88aabea3b363c753b02ddcb2fbafff'] = 'URL del back office SoColissimo.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_85068ddf0b9bcbb6913008356fe328a0'] = 'Supervisione'; +$_MODULE['<{socolissimo}prestashop>socolissimo_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_fdd526b84abc0b8fc17060e62d022b84'] = 'Autorizza o meno la verifica di disponibilità dei servizi di SoColissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_32996bdf4214d6cb8bf7fa02273813c8'] = 'Supervisione Url'; +$_MODULE['<{socolissimo}prestashop>socolissimo_995a56aecac4198b9bc0a17a976561b5'] = 'Url di superivisione.'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{socolissimo}prestashop>socolissimo_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Informazioni'; +$_MODULE['<{socolissimo}prestashop>socolissimo_3e387f5ebd657c6372f0594c8226863e'] = 'Qui ci sono due indirizzi che è necessario compilare nel tuo Back Office SoColissimo'; +$_MODULE['<{socolissimo}prestashop>socolissimo_49977cbb6772deeac9ceb89f069e491c'] = 'Convalida degli URL'; +$_MODULE['<{socolissimo}prestashop>socolissimo_06dc3f24f73027164d2b19556118624e'] = 'Ritorno url'; +$_MODULE['<{socolissimo}prestashop>socolissimo_82c440defe28e2099cba1af1f0761807'] = 'ID SO non specificato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_826361881cfc18b8b75405d398f633b5'] = 'Chiave SO non specificata'; +$_MODULE['<{socolissimo}prestashop>socolissimo_0bf6a620e5f22d8b46e3903a993f7741'] = 'Tempo di preparazione non specificato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_228485c5faff886fa4520323dc5b2c76'] = 'Tempo di preparazione non valido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_c3288acdf9ecd0a4fb1e308442b06867'] = 'sovraccosto non specificato'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1a89bc7d83f6e90b2368e3401690a87a'] = 'Sovraccosto non valido'; +$_MODULE['<{socolissimo}prestashop>socolissimo_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{socolissimo}prestashop>socolissimo_126d781eae70fa41e9e848f3013e1799'] = 'Impossibile salvare le impostazioni'; +$_MODULE['<{socolissimo}prestashop>socolissimo_7ea4eac85d1d1967562869cf1e14b1d0'] = 'Per scegliere SoColissimo, spunta un metodo di consegna'; +$_MODULE['<{socolissimo}prestashop>socolissimo_201bdb87f8e278b943d07ae924d5de6e'] = 'Modalità di consegna'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Società'; +$_MODULE['<{socolissimo}prestashop>socolissimo_8b5dd64ab8d0b8158906796b53a200e2'] = 'Indirizzo e-mail'; +$_MODULE['<{socolissimo}prestashop>socolissimo_bcc254b55c4a1babdf1dcb82c207506b'] = 'Tel'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e19726b466603bc3e444dd26fbcde074'] = 'Indirizzo del cliente'; +$_MODULE['<{socolissimo}prestashop>socolissimo_6311ae17c1ee52b36e68aaf4ad066387'] = 'Altri'; +$_MODULE['<{socolissimo}prestashop>socolissimo_d676596f71fd0f73f735da4bb4225151'] = 'Codice della porta'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ea7d9b60cc8654d2c6e8813529a2f3e8'] = 'Informazioni di consegna'; +$_MODULE['<{socolissimo}prestashop>socolissimo_e937c6393ce858786bd31a279b50572d'] = 'ID punto ritiro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_f109a88feec5ad3aeb82580c7a20ec31'] = 'Punto di ritiro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_021944549c2795a6e4db23b92f198a5e'] = 'Indirizzo punto di ritiro'; +$_MODULE['<{socolissimo}prestashop>socolissimo_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; diff --git a/modules/socolissimo/logo.gif b/modules/socolissimo/logo.gif new file mode 100644 index 000000000..978ef8b44 Binary files /dev/null and b/modules/socolissimo/logo.gif differ diff --git a/modules/socolissimo/redirect.php b/modules/socolissimo/redirect.php new file mode 100644 index 000000000..bb03427a7 --- /dev/null +++ b/modules/socolissimo/redirect.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2010 Prestashop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registred Trademark & Property of PrestaShop SA +*/ + +require_once ('../../config/config.inc.php'); + +?> + + + + + + + '; + foreach($_GET as $key => $val) + echo ''; + ?> + + + \ No newline at end of file diff --git a/modules/socolissimo/socolissimo.jpg b/modules/socolissimo/socolissimo.jpg new file mode 100644 index 000000000..dd46bbaf5 Binary files /dev/null and b/modules/socolissimo/socolissimo.jpg differ diff --git a/modules/socolissimo/socolissimo.php b/modules/socolissimo/socolissimo.php new file mode 100644 index 000000000..10220b497 --- /dev/null +++ b/modules/socolissimo/socolissimo.php @@ -0,0 +1,761 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class Socolissimo extends CarrierModule +{ + private $_html = ''; + private $_postErrors = array(); + private $url = ''; + public $_errors = array(); + public $errorMessage = array(); + + private $_config = array( + 'name' => 'La Poste - So Colissimo', + 'id_tax_rules_group' => 0, + 'url' => 'http://www.colissimo.fr/portail_colissimo/suivreResultat.do?parcelnumber=@', + 'active' => true, + 'deleted' => 0, + 'shipping_handling' => false, + 'range_behavior' => 0, + 'is_module' => true, + 'delay' => array('fr'=>'Avec La Poste, Faites-vous livrer là où vous le souhaitez en France Métropolitaine.', + 'en'=>'Do you deliver wherever you want in France.'), + 'id_zone' => 1, + 'shipping_external'=> true, + 'external_module_name'=> 'socolissimo', + 'need_range' => true + ); + + function __construct() + { + global $cookie; + + $this->name = 'socolissimo'; + $this->tab = 'shipping_logistics'; + $this->version = '2.0'; + $this->author = 'PrestaShop'; + $this->limited_countries = array('fr'); + + parent::__construct (); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('So Colissimo'); + $this->description = $this->l('Offer your customers, different delivery methods with LaPoste.'); + $this->url = Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/validation.php'; + + if (self::isInstalled($this->name)) + { + $ids = array(); + $warning = array(); + $soCarrier = new Carrier(Configuration::get('SOCOLISSIMO_CARRIER_ID')); + if (Validate::isLoadedObject($soCarrier)) + { + if (!$this->checkZone((int)($soCarrier->id))) + $warning[] .= $this->l('\'Carrier Zone(s)\'').' '; + if (!$this->checkGroup((int)($soCarrier->id))) + $warning[] .= $this->l('\'Carrier Group\'').' '; + if (!$this->checkRange((int)($soCarrier->id))) + $warning[] .= $this->l('\'Carrier Range(s)\'').' '; + if (!$this->checkDelivery((int)($soCarrier->id))) + $warning[] .= $this->l('\'Carrier price delivery\'').' '; + } + + //Check config and display warning + if (!Configuration::get('SOCOLISSIMO_ID')) + $warning[] .= $this->l('\'Id FO\'').' '; + if (!Configuration::get('SOCOLISSIMO_KEY')) + $warning[] .= $this->l('\'Key\'').' '; + if (!Configuration::get('SOCOLISSIMO_URL')) + $warning[] .= $this->l('\'Url So\'').' '; + + if (count($warning)) + $this->warning .= implode(' , ',$warning).$this->l('must be configured to use this module correctly').' '; + } + $this->errorMessage = array('998' => $this->l('Invalid key'), '999' => $this->l('Error occurred during shipping step.'), '001' => $this->l('Login FO missing'), + '002' => $this->l('Login FO incorrect'), '003' => $this->l('Customer unauthorized'),'004' => $this->l('Required field missing'), '006' => $this->l('Missing signature'), + '007' => $this->l('Invalid signature'), '008' => $this->l('Invalid Zip/ Postal code'), '009' => $this->l('Incorrect url format return validation.'), '010' => $this->l('Incorrect url format return error.'), + '011' => $this->l('Invalid transaction ID.'), '012' => $this->l('Format incorrect shipping costs.'), '015' => $this->l('Socolissimo server unavailable.'), + '016' => $this->l('Socolissimo server unavailable.'), '004' => $this->l('Required field missing'), '004' => $this->l('Required field missing')); + + } + + public function install() + { + global $cookie; + + if (!parent::install() OR !Configuration::updateValue('SOCOLISSIMO_ID', NULL) OR !Configuration::updateValue('SOCOLISSIMO_KEY', NULL) + OR !Configuration::updateValue('SOCOLISSIMO_URL', 'https://ws.colissimo.fr/pudo-fo/storeCall.do') OR !Configuration::updateValue('SOCOLISSIMO_PREPARATION_TIME', 1) + OR !Configuration::updateValue('SOCOLISSIMO_OVERCOST', 3.6) OR !$this->registerHook('extraCarrier') OR !$this->registerHook('AdminOrder') OR !$this->registerHook('updateCarrier') + OR !$this->registerHook('newOrder') OR !Configuration::updateValue('SOCOLISSIMO_SUP_URL', 'http://ws.colissimo.fr/supervision-pudo/supervision.jsp') + OR !Configuration::updateValue('SOCOLISSIMO_SUP', true)) + return false; + + + //creat config table in database + $sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'socolissimo_delivery_info` ( + `id_cart` int(10) NOT NULL, + `id_customer` int(10) NOT NULL, + `delivery_mode` varchar(3) NOT NULL, + `prid` text(10) NOT NULL, + `prname` varchar(64) NOT NULL, + `prfirstname` varchar(64) NOT NULL, + `prcompladress` text NOT NULL, + `pradress1` text NOT NULL, + `pradress2` text NOT NULL, + `pradress3` text NOT NULL, + `pradress4` text NOT NULL, + `przipcode` text(10) NOT NULL, + `prtown` varchar(64) NOT NULL, + `cephonenumber` varchar(10) NOT NULL, + `ceemail` varchar(64) NOT NULL, + `cecompanyname` varchar(64) NOT NULL, + `cedeliveryinformation` text NOT NULL, + `cedoorcode1` varchar(10) NOT NULL, + `cedoorcode2` varchar(10) NOT NULL, + PRIMARY KEY (`id_cart`,`id_customer`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; + + if(!Db::getInstance()->Execute($sql)) + return false; + + //add carrier in back office + if(!$this->createSoColissimoCarrier($this->_config)) + return false; + + return true; + } + + public function uninstall() + { + global $cookie; + + if (!parent::uninstall() + OR !Db::getInstance()->Execute('DROP TABLE IF EXISTS`'._DB_PREFIX_.'socolissimo_delivery_info`') + OR !$this->unregisterHook('extraCarrier') + OR !$this->unregisterHook('payment') + OR !$this->unregisterHook('AdminOrder') + OR !$this->unregisterHook('newOrder') + OR !$this->unregisterHook('updateCarrier') + OR !Configuration::deleteByName('SOCOLISSIMO_ID') + OR !Configuration::deleteByName('SOCOLISSIMO_KEY') + OR !Configuration::deleteByName('SOCOLISSIMO_URL') + OR !Configuration::deleteByName('SOCOLISSIMO_OVERCOST') + OR !Configuration::deleteByName('SOCOLISSIMO_PREPARATION_TIME') + OR !Configuration::deleteByName('SOCOLISSIMO_CARRIER_ID') + OR !Configuration::deleteByName('SOCOLISSIMO_SUP') + OR !Configuration::deleteByName('SOCOLISSIMO_SUP_URL') + OR !Configuration::deleteByName('SOCOLISSIMO_OVERCOST_TAX')) + return false; + + //Delete So Carrier + $soCarrier = new Carrier((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))); + //if socolissimo carrier is default set other one as default + if(Configuration::get('PS_CARRIER_DEFAULT') == (int)($soCarrier->id)) + { + $carriersD = Carrier::getCarriers((int)($cookie->id_lang)); + foreach($carriersD as $carrierD) + if ($carrierD['active'] AND !$carrierD['deleted'] AND ($carrierD['name'] != $this->_config['name'])) + Configuration::updateValue('PS_CARRIER_DEFAULT', $carrierD['id_carrier']); + } + //save old carrier id + Configuration::updateValue('SOCOLISSIMO_CARRIER_ID_HIST', Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST').'|'.(int)($soCarrier->id)); + $soCarrier->deleted = 1; + if (!$soCarrier->update()) + return false; + return true; + } + + public function getContent() + { + $this->_html .= '

        ' . $this->l('So Colissimo').'

        '; + if (!empty($_POST) AND Tools::isSubmit('submitSave')) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= '
        nok '.$err.'
        '; + } + $this->_displayForm(); + return $this->_html; + } + + + private function _displayForm() + { + global $cookie; + + $this->_html .= '
        +
        '.$this->l('Description').''. + $this->l('SoColissimo is a service offered by La Poste, which allows you to offer buyers 5 modes of delivery.').' : +

          +
        • '.$this->l('To home').'.
        • +
        • '.$this->l('To home (with appointment)').'.
        • +
        • '.$this->l('To Cityssimo space').'.
        • +
        • '.$this->l('To post office').'.
        • +
        • '.$this->l('To merchant').'.
        • +
        +

        '.$this->l('This module is free and allows you to activate the offer on your store.').'

        +

        + >'.$this->l('Documentation').'<

        +
        +
         
        +
        '.$this->l('Settings').' + +
        +

        '.$this->l('To open your SoColissimo account, please contact "La Poste" at this phone number: 3634 (French phone number).').'

        +
        + + +
        + +

        ' . $this->l('Id user for back office SoColissimo.') . '

        +
        + + +
        + +

        '.$this->l('Secure key for back office SoColissimo.').'

        +
        + + +
        + '.$this->l('Day(s)').' +

        ' . $this->l('Average time of preparation of materials.') . '
        ' + .$this->l('Average time must be the same in Coliposte back office.').'

        +
        + + +
        + € HT +

        '. $this->l('Additional cost if making appointments.') . '
        ' + .$this->l('Additional cost must be the same in Coliposte back office.').'

        +
        +
        +

        --------------------------------------------------------------------------------------------------------

        + ' + .$this->l('Be VERY CAREFUL with these settings, change may cause a malfunction of the module.'). + ' +
        + +
        + +

        ' . $this->l('Url of back office SoColissimo.') . '

        +
        + + +
        + + + + +

        '.$this->l('Enable or disable the \'check availability\' of SoColissimo service.').'

        +
        + + +
        + +

        ' . $this->l('Url of supervision.') . '

        +
        + +
        + +
        +
        + +
         
        + +
        '.$this->l('Information').' +

        '.$this->l('Please fill in these two addresses in your Back Office SoColissimo.').' :


        + +
        +

        '.htmlentities($this->url,ENT_NOQUOTES, 'UTF-8').'

        +
        + +
        +

        '.htmlentities($this->url,ENT_NOQUOTES, 'UTF-8').'

        +
        +
        '; + } + + private function _postValidation() + { + if (Tools::getValue('id_user') == NULL) + $this->_postErrors[] = $this->l('ID SO not specified'); + + if (Tools::getValue('key') == NULL) + $this->_postErrors[] = $this->l('Key SO not specified'); + + if (Tools::getValue('dypreparationtime') == NULL) + $this->_postErrors[] = $this->l('Preparation time not specified'); + elseif (!Validate::isInt(Tools::getValue('dypreparationtime'))) + $this->_postErrors[] = $this->l('Invalid preparation time'); + + if (Tools::getValue('overcost') == NULL) + $this->_postErrors[] = $this->l('Overcost not specified'); + elseif (!Validate::isFloat(Tools::getValue('overcost'))) + $this->_postErrors[] = $this->l('Invalid overcost'); + } + + private function _postProcess() + { + + if (Configuration::updateValue('SOCOLISSIMO_ID', Tools::getValue('id_user')) + AND Configuration::updateValue('SOCOLISSIMO_KEY', Tools::getValue('key')) + AND Configuration::updateValue('SOCOLISSIMO_URL', pSQL(Tools::getValue('url_so'))) + AND Configuration::updateValue('SOCOLISSIMO_PREPARATION_TIME', (int)(Tools::getValue('dypreparationtime'))) + AND Configuration::updateValue('SOCOLISSIMO_OVERCOST', (float)(Tools::getValue('overcost'))) + AND Configuration::updateValue('SOCOLISSIMO_SUP_URL', Tools::getValue('url_sup')) + AND Configuration::updateValue('SOCOLISSIMO_OVERCOST_TAX', Tools::getValue('id_tax_rules_group')) + AND Configuration::updateValue('SOCOLISSIMO_SUP', (int)(Tools::getValue('sup_active')))) + { + //save old carrier id if change + if (!in_array((int)(Tools::getValue('carrier')), explode('|',Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST')))) + Configuration::updateValue('SOCOLISSIMO_CARRIER_ID_HIST', Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST').'|'.(int)(Tools::getValue('carrier'))); + + $dataSync = (($so_login = Configuration::get('SOCOLISSIMO_ID')) + ? '' : ''); + $this->_html .= $this->displayConfirmation($this->l('Configuration updated').$dataSync); + + } + else + $this->_html .= '
        nok '.$this->l('Cannot save settings').'
        '; + } + + public function hookExtraCarrier($params) + { + global $smarty, $cookie; + + $customer = new Customer($params['address']->id_customer); + $gender = array('1'=>'MR','2'=>'MME'); + if (in_array((int)($customer->id_gender),array(1,2))) + $cecivility = $gender[(int)($customer->id_gender)]; + else + $cecivility = 'MR'; + $carrierSo = new Carrier((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))); + + if (isset($carrierSo) AND $carrierSo->active) + { + $signature = $this->make_key(substr($this->lower($params['address']->lastname),0,34), + (int)(Configuration::Get('SOCOLISSIMO_PREPARATION_TIME')), + number_format((float)($params['cart']->getOrderShippingCost($carrierSo->id, true)), 2, ',', ''), + (int)($params['address']->id_customer),(int)($params['address']->id)); + + $orderId = $this->formatOrderId((int)($params['address']->id)); + $inputs = array('PUDOFOID' => Configuration::get('SOCOLISSIMO_ID'), + 'ORDERID' => $orderId, + 'CENAME' => substr($this->lower($params['address']->lastname),0, 34), + 'TRCLIENTNUMBER' => $this->upper((int)($params['address']->id_customer)), + 'CECIVILITY' => $cecivility, + 'CEFIRSTNAME' => substr($this->lower($params['address']->firstname),0,29), + 'CECOMPANYNAME' => substr($this->upper($params['address']->company),0,38), + 'CEEMAIL' => $params['cookie']->email, + 'CEPHONENUMBER' => str_replace(array(' ', '.', '-', ',', ';', '+', '/', '\\', '+', '(', ')'),'',$params['address']->phone_mobile), + 'CEADRESS3' => substr($this->upper($params['address']->address1),0,38), + 'CEADRESS4' => substr($this->upper($params['address']->address2),0,38), + 'CEZIPCODE' => $params['address']->postcode, + 'CETOWN' => substr($this->upper($params['address']->city),0,32), + 'DYWEIGHT' => ((float)($params['cart']->getTotalWeight()) * 1000), + 'SIGNATURE' => htmlentities($signature,ENT_NOQUOTES, 'UTF-8'), + 'TRPARAMPLUS' => (int)($carrierSo->id), + 'DYFORWARDINGCHARGES' => number_format((float)($params['cart']->getOrderShippingCost($carrierSo->id)), 2, ',', ''), + 'DYPREPARATIONTIME' => (int)(Configuration::Get('SOCOLISSIMO_PREPARATION_TIME')), + 'TRRETURNURLKO' => htmlentities($this->url,ENT_NOQUOTES, 'UTF-8'), + 'TRRETURNURLOK' => htmlentities($this->url,ENT_NOQUOTES, 'UTF-8')); + + $serialsInput = ''; + foreach($inputs as $key => $val) + $serialsInput .= '&'.$key.'='.$val; + $serialsInput = ltrim($serialsInput, '&'); + $row['id_carrier'] = (int)($carrierSo->id); + $smarty->assign(array('urlSo' => Configuration::get('SOCOLISSIMO_URL').'?trReturnUrlKo='.htmlentities($this->url,ENT_NOQUOTES, 'UTF-8'),'id_carrier' => (int)($row['id_carrier']), + 'inputs' => $inputs, 'serialsInput' => $serialsInput, 'finishProcess' => $this->l('To choose SoColissimo, click on a delivery method'))); + + $country = new Country((int)($params['address']->id_country)); + $carriers = Carrier::getCarriers($cookie->id_lang, true , false,false, NULL, ALL_CARRIERS); + foreach($carriers as $carrier) + $ids[] .= $carrier['id_carrier']; + + if (($country->iso_code == 'FR') AND (Configuration::Get('SOCOLISSIMO_ID') != NULL) + AND (Configuration::get('SOCOLISSIMO_KEY') != NULL) AND $this->checkAvailibility() + AND $this->checkSoCarrierAvailable((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))) + AND in_array((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID')),$ids)) + { + return $this->display(__FILE__, 'socolissimo_carrier.tpl'); + } + else + { + $smarty->assign('ids', explode('|',Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST'))); + return $this->display(__FILE__, 'socolissimo_error.tpl'); + } + + } + } + + public function hooknewOrder($params) + { + global $cookie; + if ($params['order']->id_carrier != Configuration::get('SOCOLISSIMO_CARRIER_ID')) + return; + $order = $params['order']; + $order->id_address_delivery = $this->isSameAddress((int)($order->id_address_delivery), (int)($order->id_cart), (int)($order->id_customer)); + $order->update(); + } + + public function hookAdminOrder($params) + { + + $deliveryMode = array('DOM' => 'Livraison à domicile', 'BPR' => 'Livraison en Bureau de Poste', + 'A2P' => 'Livraison Commerce de proximité', 'MRL' => 'Livraison Commerce de proximité', + 'CIT' => 'Livraison en Cityssimo', 'ACP' => 'Agence ColiPoste', 'CDI' => 'Centre de distribution', + 'RDV' => 'Livraison sur Rendez-vous'); + + $order = new Order($params['id_order']); + $addressDelivery = new Address((int)($order->id_address_delivery), (int)($params['cookie']->id_lang)); + + $soCarrier = new Carrier((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))); + $deliveryInfos = $this->getDeliveryInfos((int)($order->id_cart),(int)($order->id_customer)); + if (((int)($order->id_carrier) == (int)($soCarrier->id) OR in_array((int)($order->id_carrier), explode('|',Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST')))) AND !empty($deliveryInfos)) + { + $html = '

        '.$this->l('So Colissimo').''; + $html .= ''.$this->l('Delivery mode').' : '; + switch ($deliveryInfos['delivery_mode']) + { + case 'DOM': + case 'RDV': + $html .= $deliveryMode[$deliveryInfos['delivery_mode']].'

        '; + $html .=''.$this->l('Customer').' : '.Tools::htmlentitiesUTF8($addressDelivery->firstname).' '.Tools::htmlentitiesUTF8($addressDelivery->lastname).'
        '. + (!empty($deliveryInfos['cecompanyname']) ? ''.$this->l('Company').' : '.Tools::htmlentitiesUTF8($deliveryInfos['cecompanyname']).'
        ' : '' ). + (!empty($deliveryInfos['ceemail']) ? ''.$this->l('E-mail address').' : '.Tools::htmlentitiesUTF8($deliveryInfos['ceemail']).'
        ' : '' ). + (!empty($deliveryInfos['cephonenumber']) ? ''.$this->l('Phone').' : '.Tools::htmlentitiesUTF8($deliveryInfos['cephonenumber']).'

        ' : '' ). + ''.$this->l('Customer address').' :
        ' + .(Tools::htmlentitiesUTF8($addressDelivery->address1) ? Tools::htmlentitiesUTF8($addressDelivery->address1).'
        ' : '') + .(!empty($addressDelivery->address2) ? Tools::htmlentitiesUTF8($addressDelivery->address2).'
        ' : '') + .(!empty($addressDelivery->postcode) ? Tools::htmlentitiesUTF8($addressDelivery->postcode).'
        ' : '') + .(!empty($addressDelivery->city) ? Tools::htmlentitiesUTF8($addressDelivery->city).'
        ' : '') + .(!empty($addressDelivery->country) ? Tools::htmlentitiesUTF8($addressDelivery->country).'
        ' : '') + .(!empty($addressDelivery->other) ? '
        '.$this->l('Other').' : '.Tools::htmlentitiesUTF8($addressDelivery->other).'

        ' : '') + .(!empty($deliveryInfos['cedoorcode1']) ? ''.$this->l('Door code').' 1 : '.Tools::htmlentitiesUTF8($deliveryInfos['cedoorcode1']).'
        ' : '' ) + .(!empty($deliveryInfos['cedoorcode2']) ? ''.$this->l('Door code').' 2 : '.Tools::htmlentitiesUTF8($deliveryInfos['cedoorcode2']).'
        ' : '' ) + .(!empty($deliveryInfos['cedeliveryinformation']) ? ''.$this->l('Delivery information').' : '.Tools::htmlentitiesUTF8($deliveryInfos['cedeliveryinformation']).'

        ' : '' ); + break; + default: + $html .= str_replace('+',' ',$deliveryMode[$deliveryInfos['delivery_mode']]).'
        ' + .(!empty($deliveryInfos['prid']) ? ''.$this->l('Pick up point ID').' : '.Tools::htmlentitiesUTF8($deliveryInfos['prid']).'
        ' : '' ) + .(!empty($deliveryInfos['prname']) ? ''.$this->l('Pick up point').' : '.Tools::htmlentitiesUTF8($deliveryInfos['prname']).'
        ' : '' ) + .''.$this->l('Pick up point address').' :
        ' + .(!empty($deliveryInfos['pradress1']) ? Tools::htmlentitiesUTF8($deliveryInfos['pradress1']).'
        ' : '' ) + .(!empty($deliveryInfos['pradress2']) ? Tools::htmlentitiesUTF8($deliveryInfos['pradress2']).'
        ' : '' ) + .(!empty($deliveryInfos['pradress3']) ? Tools::htmlentitiesUTF8($deliveryInfos['pradress3']).'
        ' : '' ) + .(!empty($deliveryInfos['pradress4']) ? Tools::htmlentitiesUTF8($deliveryInfos['pradress4']).'
        ' : '' ) + .(!empty($deliveryInfos['przipcode']) ? Tools::htmlentitiesUTF8($deliveryInfos['przipcode']).'
        ' : '' ) + .(!empty($deliveryInfos['prtown']) ? Tools::htmlentitiesUTF8($deliveryInfos['prtown']).'
        ' : '' ) + .(!empty($deliveryInfos['ceemail']) ? ''.$this->l('Email').' : '.Tools::htmlentitiesUTF8($deliveryInfos['ceemail']).'
        ' : '' ) + .(!empty($deliveryInfos['cephonenumber']) ? ''.$this->l('Phone').' : '.Tools::htmlentitiesUTF8($deliveryInfos['cephonenumber']).'

        ' : '' ); + + break; + } + $html .= '
        '; + return $html; + } + + } + + public function hookupdateCarrier($params) + { + if ((int)($params['id_carrier']) == (int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))) + { + Configuration::updateValue('SOCOLISSIMO_CARRIER_ID', (int)($params['carrier']->id)); + Configuration::updateValue('SOCOLISSIMO_CARRIER_ID_HIST', Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST').'|'.(int)($params['carrier']->id)); + } + + } + + public function make_key($ceName, $dyPraparationTime, $dyForwardingCharges, $trClientNumber, $orderId) + { + $strPs = Configuration::get('SOCOLISSIMO_ID').$ceName.$dyPraparationTime.$dyForwardingCharges.$trClientNumber.self::formatOrderId($orderId).Configuration::get('SOCOLISSIMO_KEY'); + $keyPs = sha1($strPs); + return $keyPs; + } + + public static function createSoColissimoCarrier($config) + { + $carrier = new Carrier(); + $carrier->name = $config['name']; + $carrier->id_tax_rules_group = $config['id_tax_rules_group']; + $carrier->id_zone = $config['id_zone']; + $carrier->url = $config['url']; + $carrier->active = $config['active']; + $carrier->deleted = $config['deleted']; + $carrier->delay = $config['delay']; + $carrier->shipping_handling = $config['shipping_handling']; + $carrier->range_behavior = $config['range_behavior']; + $carrier->is_module = $config['is_module']; + $carrier->shipping_external = $config['shipping_external']; + $carrier->external_module_name = $config['external_module_name']; + $carrier->need_range = $config['need_range']; + + $languages = Language::getLanguages(true); + foreach ($languages as $language) { + if ($language['iso_code'] == 'fr') + $carrier->delay[$language['id_lang']] = $config['delay'][$language['iso_code']]; + if ($language['iso_code'] == 'en') + $carrier->delay[$language['id_lang']] = $config['delay'][$language['iso_code']]; + } + if($carrier->add()) + { + + Configuration::updateValue('SOCOLISSIMO_CARRIER_ID',(int)($carrier->id)); + $groups = Group::getgroups(true); + foreach ($groups as $group) + { + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group VALUE (\''.(int)($carrier->id).'\',\''.(int)($group['id_group']).'\')'); + } + $rangePrice = new RangePrice(); + $rangePrice->id_carrier = $carrier->id; + $rangePrice->delimiter1 = '0'; + $rangePrice->delimiter2 = '10000'; + $rangePrice->add(); + + $rangeWeight = new RangeWeight(); + $rangeWeight->id_carrier = $carrier->id; + $rangeWeight->delimiter1 = '0'; + $rangeWeight->delimiter2 = '10000'; + $rangeWeight->add(); + + $zones = Zone::getZones(true); + foreach ($zones as $zone) + { + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_zone VALUE (\''.(int)($carrier->id).'\',\''.(int)($zone['id_zone']).'\')'); + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'delivery VALUE (\'\',\''.(int)($carrier->id).'\',\''.(int)($rangePrice->id).'\',NULL,\''.(int)($zone['id_zone']).'\',\'1\')'); + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'delivery VALUE (\'\',\''.(int)($carrier->id).'\',NULL,\''.(int)($rangeWeight->id).'\',\''.(int)($zone['id_zone']).'\',\'1\')'); + } + //copy logo + if (!copy(dirname(__FILE__).'/socolissimo.jpg',_PS_SHIP_IMG_DIR_.'/'.$carrier->id.'.jpg')) + return false; + return true; + } + else + return false; + } + + public function getDeliveryInfos($idCart,$idCustomer) + { + + $result = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'socolissimo_delivery_info WHERE id_cart = '.(int)($idCart).' AND id_customer = '.(int)($idCustomer)); + return $result; + } + + public function isSameAddress($idAddress,$idCart,$idCustomer) + { + $return = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'socolissimo_delivery_info WHERE id_cart =\''.(int)($idCart).'\' AND id_customer =\''.(int)($idCustomer).'\''); + $psAddress = new Address((int)($idAddress)); + $newAddress = new Address(); + + if ($this->upper($psAddress->lastname) != $this->upper($return['prname']) || $this->upper($psAddress->firstname) != $this->upper($return['prfirstname']) || $this->upper($psAddress->address1) != $this->upper($return['pradress3']) || $this->upper($psAddress->address2) != $this->upper($return['pradress2']) || $this->upper($psAddress->postcode) != $this->upper($return['przipcode']) || $this->upper($psAddress->city) != $this->upper($return['prtown']) || str_replace(array(' ', '.', '-', ',', ';', '+', '/', '\\', '+', '(', ')'),'',$psAddress->phone_mobile) != $return['cephonenumber']) + { + + $newAddress->id_customer = (int)($idCustomer); + $newAddress->lastname = substr($return['prname'],0,32); + $newAddress->firstname = substr($return['prfirstname'],0,32); + $newAddress->postcode = $return['przipcode']; + $newAddress->city = $return['prtown']; + $newAddress->id_country = Country::getIdByName(null, 'france'); + $newAddress->alias = 'So Colissimo - '.date('d-m-Y'); + + if (!in_array($return['delivery_mode'], array('DOM','RDV'))) + { + $newAddress->active = 1; + $newAddress->deleted = 1; + $newAddress->address1 = $return['pradress1']; + $newAddress->add(); + } + else + { + $newAddress->address1 = $return['pradress3']; + ((isset($return['pradress2'])) ? $newAddress->address2 = $return['pradress2'] : $newAddress->address2 = ''); + ((isset($return['pradress1'])) ? $newAddress->other .= $return['pradress1'] : $newAddress->other = ''); + ((isset($return['pradress4'])) ? $newAddress->other .= ' | '.$return['pradress4'] : $newAddress->other = ''); + $newAddress->postcode = $return['przipcode']; + $newAddress->city = $return['prtown']; + $newAddress->id_country = Country::getIdByName(null, 'france'); + $newAddress->alias = 'So Colissimo - '.date('d-m-Y'); + $newAddress->add(); + } + return (int)($newAddress->id); + } + else + return (int)($psAddress->id); + } + + public function checkZone($id_carrier) + { + $result = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'carrier_zone WHERE id_carrier = '.(int)($id_carrier)); + if ($result) + return true; + else + return false; + } + + public function checkGroup($id_carrier) + { + $result = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)($id_carrier)); + if ($result) + return true; + else + return false; + } + + public function checkRange($id_carrier) + { + switch (Configuration::get('PS_SHIPPING_METHOD')) + { + case '0' : + $sql = 'SELECT * FROM '._DB_PREFIX_.'range_price WHERE id_carrier = '.(int)($id_carrier); + break; + case '1' : + $sql = 'SELECT * FROM '._DB_PREFIX_.'range_weight WHERE id_carrier = '.(int)($id_carrier); + break; + } + $result = Db::getInstance()->getRow($sql); + if ($result) + return true; + else + return false; + } + + public function checkDelivery($id_carrier) + { + $result = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'delivery WHERE id_carrier = '.(int)($id_carrier)); + if ($result) + return true; + else + return false; + } + + public function upper($strIn) + { + $strOut = Tools::link_rewrite($strIn); + return strtoupper(str_replace('-',' ',$strOut)); + } + + + public function lower($strIn) + { + $strOut = Tools::link_rewrite($strIn); + return strtolower(str_replace('-',' ',$strOut)); + } + + public function formatOrderId($id) + { + if(strlen($id)<5) + while (strLen($id) != 5) + { + $id = '0'.$id; + } + return $id; + } + + public function checkAvailibility() + { + if (Configuration::get('SOCOLISSIMO_SUP')) + { + $ctx = stream_context_create(array('http' => array('timeout' => 1))); + $return = @file_get_contents(Configuration::get('SOCOLISSIMO_SUP_URL'), 0, $ctx); + + if(ini_get('allow_url_fopen') == 0) + return true; + else + { + if (!empty($return)) + { + preg_match('[OK]',$return, $matches); + if ($matches[0]=='OK') + return true; + else + return false; + } + } + } + else + return true; + } + + public function displaySoError($key) + { + return $this->errorMessage[$key]; + } + + private function checkSoCarrierAvailable($id_carrier) + { + global $cart, $defaultCountry; + $carrier = new Carrier((int)($id_carrier)); + $address = new Address((int)($cart->id_address_delivery)); + $id_zone = Address::getZoneById((int)($address->id)); + + // Get only carriers that are compliant with shipping method + if ((Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) + OR (!Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + { + return false; + } + + // If out-of-range behavior carrier is set on "Desactivate carrier" + if ($carrier->range_behavior) + { + // Get id zone + if (isset($cart->id_address_delivery) AND $cart->id_address_delivery) + $id_zone = Address::getZoneById((int)($cart->id_address_delivery)); + else + $id_zone = (int)($defaultCountry->id_zone); + + // Get only carriers that have a range compatible with cart + if ((Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByWeight((int)($carrier->id), $cart->getTotalWeight(), $id_zone))) + OR (!Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByPrice((int)($carrier->id), $cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) + { + return false; + } + } + return true; + } + + public function getOrderShippingCost($params,$shipping_cost) + { + global $cart; + $deliveryInfo = $this->getDeliveryInfos($cart->id, $cart->id_customer); + if (!empty($deliveryInfo)) + if ($deliveryInfo['delivery_mode'] == 'RDV') + $shipping_cost += (float)(Configuration::get('SOCOLISSIMO_OVERCOST')); + return $shipping_cost; + } + + public function getOrderShippingCostExternal($params){} + +} + diff --git a/modules/socolissimo/socolissimo_carrier.tpl b/modules/socolissimo/socolissimo_carrier.tpl new file mode 100644 index 000000000..776d17b5a --- /dev/null +++ b/modules/socolissimo/socolissimo_carrier.tpl @@ -0,0 +1,102 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + +{foreach from=$inputs item=input key=name name=myLoop} + +{/foreach} diff --git a/modules/socolissimo/socolissimo_error.tpl b/modules/socolissimo/socolissimo_error.tpl new file mode 100644 index 000000000..aee119e14 --- /dev/null +++ b/modules/socolissimo/socolissimo_error.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + diff --git a/modules/socolissimo/validation.php b/modules/socolissimo/validation.php new file mode 100644 index 000000000..5906edde8 --- /dev/null +++ b/modules/socolissimo/validation.php @@ -0,0 +1,204 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include('../../config/config.inc.php'); +include('../../init.php'); +include('../../header.php'); + +require_once(_PS_MODULE_DIR_ . 'socolissimo/socolissimo.php'); + +$validReturn = array('PUDOFOID','CECIVILITY','CENAME','CEFIRSTNAME', 'CECOMPANYNAME','CEEMAIL','CEPHONENUMBER', 'DELIVERYMODE','CEADRESS1','CEADRESS2','CEADRESS3','CEADRESS4', + 'CEZIPCODE','CEDOORCODE1','CEDOORCODE2','CEENTRYPHONE','DYPREPARATIONTIME','DYFORWARDINGCHARGES','ORDERID', 'SIGNATURE','ERRORCODE','TRPARAMPLUS','TRCLIENTNUMBER','PRID','PRNAME', + 'PRCOMPLADRESS','PRADRESS1','PRADRESS2','PRZIPCODE', 'PRTOWN','CETOWN','TRADERCOMPANYNAME', 'CEDELIVERYINFORMATION', 'CEDOORCODE1', 'CEDOORCODE2'); + +//list of non-blocking error +$nonBlockingError = array(133, 131, 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 501); + +$so = new Socolissimo(); + +$return = array(); +foreach ($_POST AS $key => $val) + if (in_array(strtoupper($key),$validReturn)) + $return[strtoupper($key)] = utf8_encode(urldecode(stripslashes($val))); + +if (isset($return['SIGNATURE']) AND isset($return['CENAME']) AND isset($return['DYPREPARATIONTIME']) AND isset($return['DYFORWARDINGCHARGES']) AND isset($return['TRCLIENTNUMBER']) AND isset($return['ORDERID']) AND isset($return['TRCLIENTNUMBER'])) +{ + if (!isset($return['ERRORCODE']) OR $return['ERRORCODE'] == NULL OR in_array($return['ERRORCODE'],$nonBlockingError)) + { + + if ($return['SIGNATURE'] === socolissimo::make_key($return['CENAME'],(float)($return['DYPREPARATIONTIME']),$return['DYFORWARDINGCHARGES'],$return['TRCLIENTNUMBER'], $return['ORDERID'])) + { + global $cookie ; + if (isset($cookie) OR is_object($cookie)) + { + + if (saveOrderShippingDetails((int)($cookie->id_cart),(int)($return['TRCLIENTNUMBER']),$return)) + { + global $cookie; + $cart->id_carrier = (int)($_POST['TRPARAMPLUS']); + if (!$cart->update()) + Tools::redirect(); + else + Tools::redirect('order.php?step=3'); + } + else + echo '
        nok '.$so->displaySoError('999').' +


        « Retour

        '; + } + else + echo '
        nok '.$so->displaySoError('999').' +


        « Retour

        '; + } + else + { + echo '
        nok '.$so->displaySoError('998').' +


        « Retour

        '; + } + } + else + { + echo '
        nok '.$so->displaySoError('999').': '; + $errors = explode(',', str_replace('+',',', $return['ERRORCODE'])); + foreach($errors as $error) + echo $so->displaySoError(rtrim($error)); + echo '


        + « Retour +

        '; } +} +else + Tools::redirect(); + +include('../../footer.php'); + +function saveOrderShippingDetails($idCart, $idCustomer, $soParams) +{ + + $deliveryMode = array('DOM' => 'Livraison à domicile', 'BPR' => 'Livraison en Bureau de Poste', + 'A2P' => 'Livraison Commerce de proximité', 'MRL' => 'Livraison Commerce de proximité', + 'CIT' => 'Livraison en Cityssimo', 'ACP' => 'Agence ColiPoste', 'CDI' => 'Centre de distribution', + 'RDV' => 'Livraison sur Rendez-vous'); + + $db = Db::getInstance(); + $db->ExecuteS('SELECT * FROM '._DB_PREFIX_.'socolissimo_delivery_info WHERE id_cart = '.(int)($idCart).' AND id_customer ='.(int)($idCustomer)); + $numRows = (int)($db->NumRows()); + if ($numRows == 0) + { + $sql = 'INSERT INTO '._DB_PREFIX_.'socolissimo_delivery_info + ( `id_cart`, `id_customer`, `delivery_mode`, `prid`, `prname`, `prfirstname`, `prcompladress`, + `pradress1`, `pradress2`, `pradress3`, `pradress4`, `przipcode`, `prtown`, `cephonenumber`, `ceemail` , `cecompanyname`, `cedeliveryinformation`, `cedoorcode1`, `cedoorcode2`) + VALUES ('.(int)($idCart).','.(int)($idCustomer).','; + if ($soParams['DELIVERYMODE'] != 'DOM' AND $soParams['DELIVERYMODE'] != 'RDV') + $sql .= '\''.pSQL($soParams['DELIVERYMODE']).'\''.', + '.(isset($soParams['PRID']) ? '\''.pSQL($soParams['PRID']).'\'' : '').', + '.(isset($soParams['PRNAME']) ? '\''.ucfirst(pSQL($soParams['PRNAME'])).'\'' : '').', + '.(isset($deliveryMode[$soParams['DELIVERYMODE']]) ? '\''.$deliveryMode[$soParams['DELIVERYMODE']].'\'' : 'So Colissimo').', + '.(isset($soParams['PRCOMPLADRESS']) ? '\''.pSQL($soParams['PRCOMPLADRESS']).'\'' : '\'\'').', + '.(isset($soParams['PRADRESS1']) ? '\''.pSQL($soParams['PRADRESS1']).'\'' : '\'\'').', + '.(isset($soParams['PRADRESS2']) ? '\''.pSQL($soParams['PRADRESS2']).'\'' : '\'\'').', + '.(isset($soParams['PRADRESS3']) ? '\''.pSQL($soParams['PRADRESS3']).'\'' : '\'\'').', + '.(isset($soParams['PRADRESS4']) ? '\''.pSQL($soParams['PRADRESS4']).'\'' : '\'\'').', + '.(isset($soParams['PRZIPCODE']) ? '\''.pSQL($soParams['PRZIPCODE']).'\'' : '\'\'').', + '.(isset($soParams['PRTOWN']) ? '\''.pSQL($soParams['PRTOWN']).'\'' : '\'\'').', + '.(isset($soParams['CEPHONENUMBER']) ? '\''.pSQL($soParams['CEPHONENUMBER']).'\'' : '\'\'').', + '.(isset($soParams['CEEMAIL']) ? '\''.pSQL($soParams['CEEMAIL']).'\'' : '\'\'').', + '.(isset($soParams['CECOMPANYNAME']) ? '\''.pSQL($soParams['CECOMPANYNAME']).'\'' : '\'\'').', + '.(isset($soParams['CEDELIVERYINFORMATION']) ? '\''.pSQL($soParams['CEDELIVERYINFORMATION']).'\'' : '\'\'').', + '.(isset($soParams['CEDOORCODE1']) ? '\''.pSQL($soParams['CEDOORCODE1']).'\'' : '\'\'').', + '.(isset($soParams['CEDOORCODE2']) ? '\''.pSQL($soParams['CEDOORCODE2']).'\'' : '\'\'').')'; + else + $sql .= '\''.pSQL($soParams['DELIVERYMODE']).'\',\'\', + '.(isset($soParams['CENAME']) ? '\''.ucfirst(pSQL($soParams['CENAME'])).'\'' : '').', + '.(isset($soParams['CEFIRSTNAME']) ? '\''.ucfirst(pSQL($soParams['CEFIRSTNAME'])).'\'' : '').', + '.(isset($soParams['CECOMPLADRESS']) ? '\''.pSQL($soParams['CECOMPLADRESS']).'\'' : '\'\'').', + '.(isset($soParams['CEADRESS1']) ? '\''.pSQL($soParams['CEADRESS1']).'\'' : '\'\'').', + '.(isset($soParams['CEADRESS2']) ? '\''.pSQL($soParams['CEADRESS2']).'\'' : '\'\'').', + '.(isset($soParams['CEADRESS3']) ? '\''.pSQL($soParams['CEADRESS3']).'\'' : '\'\'').', + '.(isset($soParams['CEADRESS4']) ? '\''.pSQL($soParams['CEADRESS4']).'\'' : '\'\'').', + '.(isset($soParams['CEZIPCODE']) ? '\''.pSQL($soParams['CEZIPCODE']).'\'' : '\'\'').', + '.(isset($soParams['CETOWN']) ? '\''.pSQL($soParams['CETOWN']).'\'' : '\'\'').', + '.(isset($soParams['CEPHONENUMBER']) ? '\''.pSQL($soParams['CEPHONENUMBER']).'\'' : '\'\'').', + '.(isset($soParams['CEEMAIL']) ? '\''.pSQL($soParams['CEEMAIL']).'\'' : '\'\'').', + '.(isset($soParams['CECOMPANYNAME']) ? '\''.pSQL($soParams['CECOMPANYNAME']).'\'' : '\'\'').', + '.(isset($soParams['CEDELIVERYINFORMATION']) ? '\''.pSQL($soParams['CEDELIVERYINFORMATION']).'\'' : '\'\'').', + '.(isset($soParams['CEDOORCODE1']) ? '\''.pSQL($soParams['CEDOORCODE1']).'\'' : '\'\'').', + '.(isset($soParams['CEDOORCODE2']) ? '\''.pSQL($soParams['CEDOORCODE2']).'\'' : '\'\'').')'; + + if (Db::getInstance()->Execute($sql)) + return true; + } + else + { + $table = _DB_PREFIX_.'socolissimo_delivery_info'; + $values = array(); + $values['delivery_mode'] = pSQL($soParams['DELIVERYMODE']); + + if (!in_array($soParams['DELIVERYMODE'], array('DOM', 'RDV'))) + { + (isset($soParams['PRID']) ? $values['prid'] = pSQL($soParams['PRID']) : ''); + (isset($soParams['PRNAME']) ? $values['prname'] = ucfirst(pSQL($soParams['PRNAME'])) : ''); + (isset($deliveryMode['DELIVERYMODE']) ? $values['prfirstname'] = $deliveryMode[$soParams['DELIVERYMODE']] : $values['prfirstname'] = 'So Colissimo'); + (isset($soParams['PRCOMPLADRESS']) ? $values['prcompladress'] = pSQL($soParams['PRCOMPLADRESS']) : ''); + (isset($soParams['PRADRESS1']) ? $values['pradress1'] = pSQL($soParams['PRADRESS1']) : ''); + (isset($soParams['PRADRESS2']) ? $values['pradress2'] = pSQL($soParams['PRADRESS2']) : ''); + (isset($soParams['PRADRESS3']) ? $values['pradress3'] = pSQL($soParams['PRADRESS3']) : ''); + (isset($soParams['PRADRESS4']) ? $values['pradress4'] = pSQL($soParams['PRADRESS4']) : ''); + (isset($soParams['PRZIPCODE']) ? $values['przipcode'] = pSQL($soParams['PRZIPCODE']) : ''); + (isset($soParams['CETOWN']) ? $values['prtown'] = pSQL($soParams['CETOWN']) : ''); + (isset($soParams['CEPHONENUMBER']) ? $values['cephonenumber'] = pSQL($soParams['CEPHONENUMBER']) : ''); + (isset($soParams['CEEMAIL']) ? $values['ceemail'] = pSQL($soParams['CEEMAIL']) : ''); + (isset($soParams['CEDELIVERYINFORMATION']) ? $values['cedeliveryinformation'] = pSQL($soParams['CEDELIVERYINFORMATION']) : ''); + (isset($soParams['CEDOORCODE1']) ? $values['cedoorcode1'] = pSQL($soParams['CEDOORCODE1']) : ''); + (isset($soParams['CEDOORCODE2']) ? $values['cedoorcode2'] = pSQL($soParams['CEDOORCODE2']) : ''); + (isset($soParams['CECOMPANYNAME']) ? $values['cecompanyname'] = pSQL($soParams['CECOMPANYNAME']) : ''); + } + else + { + (isset($soParams['CENAME']) ? $values['prname'] = ucfirst(pSQL($soParams['CENAME'])) : ''); + (isset($soParams['CEFIRSTNAME']) ? $values['prfirstname'] = ucfirst(pSQL($soParams['CEFIRSTNAME'])) : ''); + (isset($soParams['CECOMPLADRESS']) ? $values['prcompladress'] = pSQL($soParams['CECOMPLADRESS']) : ''); + (isset($soParams['CEADRESS1']) ? $values['pradress1'] = pSQL($soParams['CEADRESS1']) : ''); + (isset($soParams['CEADRESS2']) ? $values['pradress2'] = pSQL($soParams['CEADRESS2']) : ''); + (isset($soParams['CEADRESS3']) ? $values['pradress3'] = pSQL($soParams['CEADRESS3']) : ''); + (isset($soParams['CEADRESS4']) ? $values['pradress4'] = pSQL($soParams['CEADRESS4']) : ''); + (isset($soParams['CEZIPCODE']) ? $values['przipcode'] = pSQL($soParams['CEZIPCODE']) : ''); + (isset($soParams['PRTOWN']) ? $values['prtown'] = pSQL($soParams['PRTOWN']) : '') ; + (isset($soParams['CEEMAIL']) ? $values['ceemail'] = pSQL($soParams['CEEMAIL']) : ''); + (isset($soParams['CEPHONENUMBER']) ? $values['cephonenumber'] = pSQL($soParams['CEPHONENUMBER']) : ''); + (isset($soParams['CEDELIVERYINFORMATION']) ? $values['cedeliveryinformation'] = pSQL($soParams['CEDELIVERYINFORMATION']) : ''); + (isset($soParams['CEDOORCODE1']) ? $values['cedoorcode1'] = pSQL($soParams['CEDOORCODE1']) : ''); + (isset($soParams['CEDOORCODE2']) ? $values['cedoorcode2'] = pSQL($soParams['CEDOORCODE2']) : ''); + (isset($soParams['CECOMPANYNAME']) ? $values['cecompanyname'] = pSQL($soParams['CECOMPANYNAME']) : ''); + } + $where = ' `id_cart` =\''.(int)($idCart).'\' AND `id_customer` =\''.(int)($idCustomer).'\''; + + if (Db::getInstance()->autoExecute($table, $values, 'UPDATE', $where)) + return true; + } +} + + + diff --git a/modules/statsbestcategories/config.xml b/modules/statsbestcategories/config.xml new file mode 100755 index 000000000..79a488a49 --- /dev/null +++ b/modules/statsbestcategories/config.xml @@ -0,0 +1,11 @@ + + + statsbestcategories + Best categories + 1 + A list of the best categories + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestcategories/de.php b/modules/statsbestcategories/de.php new file mode 100644 index 000000000..fcb4cd918 --- /dev/null +++ b/modules/statsbestcategories/de.php @@ -0,0 +1,14 @@ +statsbestcategories_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_8bf8854bebe108183caeb845c7676ae4'] = 'von'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eebfd2d9a7ea25b9e61e8260bcd4849c'] = 'Insgesamt verkaufte Menge'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_411919c5d99ff5d0f9770e96ffe22a01'] = 'Gesamtpreis Verkauf'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_c13329e42ec01a10f84c0f950274b404'] = 'Insgesamt gesehen'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_6e3b3150807da868ebd33ad2c991b8d7'] = 'Beste Kategorien'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_a2e1fa19a6a3405a4e82cb5daa66310d'] = 'Eine Liste der besten Kategorien'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; diff --git a/modules/statsbestcategories/en.php b/modules/statsbestcategories/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestcategories/en.php @@ -0,0 +1,4 @@ +statsbestcategories_4f29d8c727dcf2022ac241cb96c31083'] = 'El recordset se devolvió vacío'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eab2b4237a7cd89c309119e35f62d168'] = 'mostrando'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_49ee3087348e8d44e1feda1917443987'] = 'Nombre:'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eebfd2d9a7ea25b9e61e8260bcd4849c'] = 'Cantidad total venta'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_411919c5d99ff5d0f9770e96ffe22a01'] = 'Precio total venta'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_c13329e42ec01a10f84c0f950274b404'] = 'Total visto'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_6e3b3150807da868ebd33ad2c991b8d7'] = 'Mejores categorías'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_a2e1fa19a6a3405a4e82cb5daa66310d'] = 'Lista de las mejores categorías'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; diff --git a/modules/statsbestcategories/fr.php b/modules/statsbestcategories/fr.php new file mode 100644 index 000000000..7ac882a9d --- /dev/null +++ b/modules/statsbestcategories/fr.php @@ -0,0 +1,14 @@ +statsbestcategories_4f29d8c727dcf2022ac241cb96c31083'] = 'Aucun résultat'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage de'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_8bf8854bebe108183caeb845c7676ae4'] = 'sur'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eebfd2d9a7ea25b9e61e8260bcd4849c'] = 'Quantité totale vendue'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_411919c5d99ff5d0f9770e96ffe22a01'] = 'Prix total vendu'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_c13329e42ec01a10f84c0f950274b404'] = 'Total consulté'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_6e3b3150807da868ebd33ad2c991b8d7'] = 'Meilleures catégories'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_a2e1fa19a6a3405a4e82cb5daa66310d'] = 'Liste des meilleures catégories'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; diff --git a/modules/statsbestcategories/it.php b/modules/statsbestcategories/it.php new file mode 100644 index 000000000..c8dad136a --- /dev/null +++ b/modules/statsbestcategories/it.php @@ -0,0 +1,14 @@ +statsbestcategories_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_eebfd2d9a7ea25b9e61e8260bcd4849c'] = 'Quantità totali vendute'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_411919c5d99ff5d0f9770e96ffe22a01'] = 'Prezzo totale venduto'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_c13329e42ec01a10f84c0f950274b404'] = 'Totale Visto'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_6e3b3150807da868ebd33ad2c991b8d7'] = 'Migliori categorie'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_a2e1fa19a6a3405a4e82cb5daa66310d'] = 'Elenco dei migliori categorie'; +$_MODULE['<{statsbestcategories}prestashop>statsbestcategories_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV '; diff --git a/modules/statsbestcategories/logo.gif b/modules/statsbestcategories/logo.gif new file mode 100644 index 000000000..fa3a15dd6 Binary files /dev/null and b/modules/statsbestcategories/logo.gif differ diff --git a/modules/statsbestcategories/statsbestcategories.php b/modules/statsbestcategories/statsbestcategories.php new file mode 100644 index 000000000..78ac87954 --- /dev/null +++ b/modules/statsbestcategories/statsbestcategories.php @@ -0,0 +1,171 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsBestCategories extends ModuleGrid +{ + private $_html; + private $_query; + private $_columns; + private $_defaultSortColumn; + private $_defaultSortDirection; + private $_emptyMessage; + private $_pagingMessage; + + function __construct() + { + $this->name = 'statsbestcategories'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'totalPriceSold'; + $this->_defaultSortDirection = 'DESC'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'name', + 'header' => $this->l('Name'), + 'dataIndex' => 'name', + 'align' => 'left', + 'width' => 140 + ), + array( + 'id' => 'totalQuantitySold', + 'header' => $this->l('Total Quantity Sold'), + 'dataIndex' => 'totalQuantitySold', + 'width' => 20, + 'align' => 'right' + ), + array( + 'id' => 'totalPriceSold', + 'header' => $this->l('Total Price Sold'), + 'dataIndex' => 'totalPriceSold', + 'width' => 30, + 'align' => 'right' + ), + array( + 'id' => 'totalPageViewed', + 'header' => $this->l('Total Viewed'), + 'dataIndex' => 'totalPageViewed', + 'width' => 30, + 'align' => 'right' + ) + ); + + parent::__construct(); + + $this->displayName = $this->l('Best categories'); + $this->description = $this->l('A list of the best categories'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_category', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'defaultSortDirection' => $this->_defaultSortDirection, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + + if (Tools::getValue('export')) + $this->csvExport($engineParams); + + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +
        '.$this->l('CSV Export').' +
        '; + return $this->_html; + } + + public function getData() + { + $dateBetween = $this->getDate(); + $id_lang = $this->getLang(); + + $this->_query = ' + SELECT SQL_CALC_FOUND_ROWS ca.`id_category`, CONCAT(parent.name, \' > \', calang.`name`) as name, + IFNULL(SUM(t.`totalQuantitySold`), 0) AS totalQuantitySold, + ROUND(IFNULL(SUM(t.`totalPriceSold`), 0), 2) AS totalPriceSold, + ( + SELECT IFNULL(SUM(pv.`counter`), 0) + FROM `'._DB_PREFIX_.'page` p + LEFT JOIN `'._DB_PREFIX_.'page_viewed` pv ON p.`id_page` = pv.`id_page` + LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `'._DB_PREFIX_.'product` pr ON CAST(p.`id_object` AS UNSIGNED INTEGER) = pr.`id_product` + LEFT JOIN `'._DB_PREFIX_.'category_product` capr2 ON capr2.`id_product` = pr.`id_product` + WHERE capr.`id_category` = capr2.`id_category` + AND p.`id_page_type` = 1 + AND dr.`time_start` BETWEEN '.$dateBetween.' + AND dr.`time_end` BETWEEN '.$dateBetween.' + ) AS totalPageViewed + FROM `'._DB_PREFIX_.'category` ca + LEFT JOIN `'._DB_PREFIX_.'category_lang` calang ON (ca.`id_category` = calang.`id_category` AND calang.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'category_lang` parent ON (ca.`id_parent` = parent.`id_category` AND parent.`id_lang` = '.(int)$id_lang.') + LEFT JOIN `'._DB_PREFIX_.'category_product` capr ON ca.`id_category` = capr.`id_category` + LEFT JOIN ( + SELECT pr.`id_product`, t.`totalQuantitySold`, t.`totalPriceSold` + FROM `'._DB_PREFIX_.'product` pr + LEFT JOIN ( + SELECT pr.`id_product`, + IFNULL(SUM(cp.`product_quantity`), 0) AS totalQuantitySold, + IFNULL(SUM(cp.`product_price` * cp.`product_quantity`), 0) / o.conversion_rate AS totalPriceSold + FROM `'._DB_PREFIX_.'product` pr + LEFT OUTER JOIN `'._DB_PREFIX_.'order_detail` cp ON pr.`id_product` = cp.`product_id` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = cp.`id_order` + WHERE o.valid = 1 + AND o.invoice_date BETWEEN '.$dateBetween.' + GROUP BY pr.`id_product` + ) t ON t.`id_product` = pr.`id_product` + ) t ON t.`id_product` = capr.`id_product` + GROUP BY ca.`id_category` + HAVING ca.`id_category` != 1'; + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction) AND Validate::IsSortDirection($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); + } +} diff --git a/modules/statsbestcustomers/config.xml b/modules/statsbestcustomers/config.xml new file mode 100755 index 000000000..854798b05 --- /dev/null +++ b/modules/statsbestcustomers/config.xml @@ -0,0 +1,11 @@ + + + statsbestcustomers + Best customers + 1 + A list of the best customers + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestcustomers/de.php b/modules/statsbestcustomers/de.php new file mode 100644 index 000000000..64998aad0 --- /dev/null +++ b/modules/statsbestcustomers/de.php @@ -0,0 +1,23 @@ +statsbestcustomers_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8bf8854bebe108183caeb845c7676ae4'] = 'von'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_dff4bf10409100d989495c6d5486035e'] = 'Nachname'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_04176f095283bc729f1e3926967e7034'] = 'Vorname'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d7e637a6e9ff116de2fa89551240a94d'] = 'Besuche'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_1ff1b62d08d1195f073c6adac00f1894'] = 'ausgegebenes Geld '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Beste Kunden'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cdc31cfb8cc370e79d854a2f82849dd2'] = 'Eine Liste der besten Kunden'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cb21e843b037359d0fb5b793fccf964f'] = 'Kundentreue entwickeln'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d29468c130aa9793f3af4aeab7573dfe'] = 'Einen Kunden zu behalten ist rentabler als einen Neukunden zu akquirieren. Daher ist es notwendig, Ihre Treue zu gewinnen, oder anders gesagt, sie dazu zu bringen, zu Ihrem Webshop zurückzukehren.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_689416adced81b3cdaeda598e82aa607'] = 'Der gute Ruf ist ebenfalls ein Mittel, zufriedene Kunden zu bekommen; ein unzufriedener Kunde zieht keine Neukunden an.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_410008089d5bb723438103a84d48a59c'] = 'Um dieses Ziel zu erreichen, können Sie folgende Aktionen organisieren:'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_397a5e109a5897ee7d699050cbc93347'] = 'Punktuelle Aktionen: kommerzielle Belohnungen (benutzerdefinierte Sondernagebote, geschenkte Produkte oder Dienstleistungen), nicht-kommerzielle Belohnungen (bevorzugte Bearbeitung einer Bestellung oder eines Produkts), geldliche Belohnungen (Gutscheine, Ermäßigungsgutscheine, Payback,...).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_4bc24eed56e0ba89fc3ab4e094d18d8a'] = 'Dauerhafte Aktionen: Treue- oder Punktekarten, die nicht nur der Kommunikation mit dem Kunden dienen, sondern ihm auch Vorteile bringen (persönliche Angebote, Rabatte).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Diese Aktionen ermutigen Kunden zum Kauf und zu erneuten, regelmäßigen Besuchenauch in Ihrem Webshop.'; diff --git a/modules/statsbestcustomers/en.php b/modules/statsbestcustomers/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestcustomers/en.php @@ -0,0 +1,4 @@ +statsbestcustomers_4f29d8c727dcf2022ac241cb96c31083'] = 'El recordset se devolvió vacío'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_eab2b4237a7cd89c309119e35f62d168'] = 'Mostrando'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_dff4bf10409100d989495c6d5486035e'] = 'apellido'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_04176f095283bc729f1e3926967e7034'] = 'Nombre'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d7e637a6e9ff116de2fa89551240a94d'] = 'Visitas'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_1ff1b62d08d1195f073c6adac00f1894'] = 'Dinero enviado'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Mejores clientes'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cdc31cfb8cc370e79d854a2f82849dd2'] = 'Lista de los mejores clientes'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cb21e843b037359d0fb5b793fccf964f'] = 'Desarrolle la fidelidad de sus clientes'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d29468c130aa9793f3af4aeab7573dfe'] = 'Mantener un cliente satisfecho es más rentable que captar uno nuevo. Por lo tanto, es necesario ganarse su lealtad, para que vuelva a su tienda.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_689416adced81b3cdaeda598e82aa607'] = 'El boca a boca es uno de los mejores medios de conseguir clientes satisfechos; un cliente satisfecho atrae nuevos clientes.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_410008089d5bb723438103a84d48a59c'] = 'Para alcanzar este objetivo usted puede organizar: '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_397a5e109a5897ee7d699050cbc93347'] = 'Operaciones puntuales: recompensas comerciales (ofertas especiales personalizadas, producto o servicio ofrecidos), recompensas no comerciales (prioridad en el envío de un pedido o de un producto), recompensas pecuniarias (enlaces, cupones del descuento, reembolsos...)'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_4bc24eed56e0ba89fc3ab4e094d18d8a'] = 'Operaciones sostenibles: tarjetas clientes o puntos de fidelidad, que no sólo justifican la comunicación entre el comerciante y el cliente, pero también ofrecen ventajas a los clientes (ofertas, descuentos privados).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Estas operaciones animan a sus clientes a comprar y también a volver a su tienda regularmente.'; diff --git a/modules/statsbestcustomers/fr.php b/modules/statsbestcustomers/fr.php new file mode 100644 index 000000000..19f735514 --- /dev/null +++ b/modules/statsbestcustomers/fr.php @@ -0,0 +1,23 @@ +statsbestcustomers_4f29d8c727dcf2022ac241cb96c31083'] = 'Aucun résultat retourné'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_dff4bf10409100d989495c6d5486035e'] = 'Nom'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_04176f095283bc729f1e3926967e7034'] = 'Prénom'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d7e637a6e9ff116de2fa89551240a94d'] = 'Visites'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_1ff1b62d08d1195f073c6adac00f1894'] = 'Argent dépensé'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Meilleurs clients'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cdc31cfb8cc370e79d854a2f82849dd2'] = 'Classement des meilleurs clients'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cb21e843b037359d0fb5b793fccf964f'] = 'Fidéliser les clients'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d29468c130aa9793f3af4aeab7573dfe'] = 'Garder un client est plus rentable que d’en conquérir un nouveau. Il est donc impératif de le fidéliser, c\'est-à-dire de le faire revenir sur votre boutique. '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_689416adced81b3cdaeda598e82aa607'] = 'Le bouche à oreille est également un moyen d\'avoir de nouveaux clients satisfaits ; car un client non satisfait n\'en attirera pas de nouveaux. '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_410008089d5bb723438103a84d48a59c'] = 'Pour y parvenir, plusieurs moyens existent :'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_397a5e109a5897ee7d699050cbc93347'] = 'Les opérations ponctuelles : les récompenses marchandes (offres promotionnelles ciblées et personnalisées, cadeaux -produit ou service offert-), les récompenses non marchandes (traitement prioritaire d\'une commande ou d\'un produit), les récompenses pécuniaires (bons d\'achat, de réduction, de remboursement). '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_4bc24eed56e0ba89fc3ab4e094d18d8a'] = 'Les opérations pérennes : (carte de fidélité, points de fidélité) qui non seulement justifient la communication marchand-clients, et aussi offre des avantages aux clients (offres privatives, réductions).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Ces opérations incitent non seulement le client à acheter, mais aussi à revenir régulièrement sur votre boutique.'; diff --git a/modules/statsbestcustomers/it.php b/modules/statsbestcustomers/it.php new file mode 100644 index 000000000..133644c9a --- /dev/null +++ b/modules/statsbestcustomers/it.php @@ -0,0 +1,23 @@ +statsbestcustomers_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_dff4bf10409100d989495c6d5486035e'] = 'Cognome'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_04176f095283bc729f1e3926967e7034'] = 'Nome'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d7e637a6e9ff116de2fa89551240a94d'] = 'Visite'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_1ff1b62d08d1195f073c6adac00f1894'] = 'Soldi spesi'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_8b83489bd116cb60e2f348e9c63cd7f6'] = 'Migliori clienti'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cdc31cfb8cc370e79d854a2f82849dd2'] = 'Elenco dei migliori clienti'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_cb21e843b037359d0fb5b793fccf964f'] = 'Sviluppa la fedeltà dei clienti '; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_d29468c130aa9793f3af4aeab7573dfe'] = 'Mantenere un cliente è più redditizio che catturarne uno nuovo. Pertanto, è necessario sviluppare la loro fedeltà, in altre parole, devi farli tornare al tuo negozio online.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_689416adced81b3cdaeda598e82aa607'] = 'Il passaparola è anche un mezzo per ottenere nuovi clienti soddisfatti; un cliente non soddisfatto non attirerà nuovi clienti.'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_410008089d5bb723438103a84d48a59c'] = 'Al fine di raggiungere questo obiettivo è possibile organizzare:'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_397a5e109a5897ee7d699050cbc93347'] = 'operazioni puntuali: premi commerciali (offerte speciali personalizzate, prodotto o servizio offerto), premi non commerciale (gestione prioritaria di un ordine o un prodotto), premi pecuniari (obbligazioni, buoni sconto, ...).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_4bc24eed56e0ba89fc3ab4e094d18d8a'] = 'operazioni sostenibili: le carte fedeltà o punti, che non solo giustificano la comunicazione tra commerciante e cliente, ma offre anche vantaggi ai clienti (offerte private, sconti).'; +$_MODULE['<{statsbestcustomers}prestashop>statsbestcustomers_2ac84f3e753fa299ebe4a6dfe57f1d9c'] = 'Queste operazioni incoraggiano i clienti ad acquistare e a tornare regolarmente al tu negozio online .'; diff --git a/modules/statsbestcustomers/logo.gif b/modules/statsbestcustomers/logo.gif new file mode 100644 index 000000000..eb7ee8e83 Binary files /dev/null and b/modules/statsbestcustomers/logo.gif differ diff --git a/modules/statsbestcustomers/statsbestcustomers.php b/modules/statsbestcustomers/statsbestcustomers.php new file mode 100644 index 000000000..3a99218b3 --- /dev/null +++ b/modules/statsbestcustomers/statsbestcustomers.php @@ -0,0 +1,164 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsBestCustomers extends ModuleGrid +{ + private $_html; + private $_query; + private $_columns; + private $_defaultSortColumn; + private $_defaultSortDirection; + private $_emptyMessage; + private $_pagingMessage; + + function __construct() + { + $this->name = 'statsbestcustomers'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'totalMoneySpent'; + $this->_defaultSortDirection = 'DESC'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'lastname', + 'header' => $this->l('Lastname'), + 'dataIndex' => 'lastname', + 'width' => 50 + ), + array( + 'id' => 'firstname', + 'header' => $this->l('Firstname'), + 'dataIndex' => 'firstname', + 'width' => 50 + ), + array( + 'id' => 'email', + 'header' => $this->l('Email'), + 'dataIndex' => 'email', + 'width' => 120 + ), + array( + 'id' => 'totalVisits', + 'header' => $this->l('Visits'), + 'dataIndex' => 'totalVisits', + 'width' => 80, + 'align' => 'right'), + array( + 'id' => 'totalMoneySpent', + 'header' => $this->l('Money spent'), + 'dataIndex' => 'totalMoneySpent', + 'width' => 80, + 'align' => 'right') + ); + + parent::__construct(); + + $this->displayName = $this->l('Best customers'); + $this->description = $this->l('A list of the best customers'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_customer', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'defaultSortDirection' => $this->_defaultSortDirection, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + if (Tools::getValue('export')) + $this->csvExport($engineParams); + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +

        '.$this->l('CSV Export').'

        +

        +
        '.$this->l('Guide').' +

        '.$this->l('Develop clients\' loyalty').'

        +

        + '.$this->l('Keeping a client is more profitable than gaining a new one. Thus, it is necessary to develop their loyalty, in other words to make them want to come back to your webshop.').'
        + '.$this->l('Word of mouth is also a means to of getting new, satisfied clients; a dissatisfied one won\'t attract new clients.').'
        + '.$this->l('In order to achieve this goal you can organize: ').' +

          +
        • '.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).').'
        • +
        • '.$this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).').'
        • +
        + '.$this->l('These operations encourage clients to buy products visit your webshop regularly.').'
        +


        +
        '; + return $this->_html; + } + + public function setOption($option) + { + } + + public function getData() + { + $this->_query = ' + SELECT SQL_CALC_FOUND_ROWS c.`id_customer`, c.`lastname`, c.`firstname`, c.`email`, + COUNT(co.`id_connections`) as totalVisits, + IFNULL(( + SELECT ROUND(SUM(IFNULL(o.`total_paid_real`, 0) / cu.conversion_rate), 2) + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'currency` cu ON o.id_currency = cu.id_currency + WHERE o.id_customer = c.id_customer + AND o.invoice_date BETWEEN '.$this->getDate().' + AND o.valid + ), 0) as totalMoneySpent + FROM `'._DB_PREFIX_.'customer` c + LEFT JOIN `'._DB_PREFIX_.'guest` g ON c.`id_customer` = g.`id_customer` + LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.`id_guest` = co.`id_guest` + WHERE co.date_add BETWEEN '.$this->getDate().' + GROUP BY c.`id_customer`, c.`lastname`, c.`firstname`, c.`email`'; + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction) AND Validate::IsSortDirection($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); + } +} diff --git a/modules/statsbestmanufacturers/config.xml b/modules/statsbestmanufacturers/config.xml new file mode 100755 index 000000000..1efb45292 --- /dev/null +++ b/modules/statsbestmanufacturers/config.xml @@ -0,0 +1,11 @@ + + + statsbestmanufacturers + Best manufacturers + 1.0 + A list of the best manufacturers + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestmanufacturers/de.php b/modules/statsbestmanufacturers/de.php new file mode 100644 index 000000000..a38b47912 --- /dev/null +++ b/modules/statsbestmanufacturers/de.php @@ -0,0 +1,13 @@ +statsbestmanufacturers_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_8bf8854bebe108183caeb845c7676ae4'] = 'von'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_2a0440eec72540c5b30d9199c01f348c'] = 'Verkaufte Menge'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_ea067eb37801c5aab1a1c685eb97d601'] = 'Bezahlter Gesamtbetrag'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_72fd9b5482201824daae557360d91196'] = 'Beste Hersteller'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_aa1b814546fe3e2e96ef3a185e4df8e9'] = 'Eine Liste der besten Hersteller'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; diff --git a/modules/statsbestmanufacturers/en.php b/modules/statsbestmanufacturers/en.php new file mode 100755 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestmanufacturers/en.php @@ -0,0 +1,4 @@ +statsbestmanufacturers_4f29d8c727dcf2022ac241cb96c31083'] = 'Empty recordset returned'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_eab2b4237a7cd89c309119e35f62d168'] = 'Mostrar'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_2a0440eec72540c5b30d9199c01f348c'] = 'Cantidad vendida'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_ea067eb37801c5aab1a1c685eb97d601'] = 'Total pagado'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_72fd9b5482201824daae557360d91196'] = 'Mejores fabricantes'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_aa1b814546fe3e2e96ef3a185e4df8e9'] = 'Lista de los mejores fabricantes'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; diff --git a/modules/statsbestmanufacturers/fr.php b/modules/statsbestmanufacturers/fr.php new file mode 100755 index 000000000..5b342a1ce --- /dev/null +++ b/modules/statsbestmanufacturers/fr.php @@ -0,0 +1,13 @@ +statsbestmanufacturers_4f29d8c727dcf2022ac241cb96c31083'] = 'Empty recordset returned'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_2a0440eec72540c5b30d9199c01f348c'] = 'Quantité vendus '; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_ea067eb37801c5aab1a1c685eb97d601'] = 'Total des sommes versées '; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_72fd9b5482201824daae557360d91196'] = 'Meilleur fabricants '; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_aa1b814546fe3e2e96ef3a185e4df8e9'] = 'Une liste des meilleurs fabricants '; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; diff --git a/modules/statsbestmanufacturers/it.php b/modules/statsbestmanufacturers/it.php new file mode 100644 index 000000000..f568ce7b8 --- /dev/null +++ b/modules/statsbestmanufacturers/it.php @@ -0,0 +1,13 @@ +statsbestmanufacturers_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_2a0440eec72540c5b30d9199c01f348c'] = 'Quantità venduta'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_ea067eb37801c5aab1a1c685eb97d601'] = 'Totale pagato'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_72fd9b5482201824daae557360d91196'] = 'Migliori produttori'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_aa1b814546fe3e2e96ef3a185e4df8e9'] = 'Elenco dei migliori produttori'; +$_MODULE['<{statsbestmanufacturers}prestashop>statsbestmanufacturers_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV '; diff --git a/modules/statsbestmanufacturers/logo.gif b/modules/statsbestmanufacturers/logo.gif new file mode 100755 index 000000000..fa3a15dd6 Binary files /dev/null and b/modules/statsbestmanufacturers/logo.gif differ diff --git a/modules/statsbestmanufacturers/statsbestmanufacturers.php b/modules/statsbestmanufacturers/statsbestmanufacturers.php new file mode 100755 index 000000000..f287f8f43 --- /dev/null +++ b/modules/statsbestmanufacturers/statsbestmanufacturers.php @@ -0,0 +1,145 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + + +class StatsBestManufacturers extends ModuleGrid +{ + private $_html = null; + private $_query = null; + private $_columns = null; + private $_defaultSortColumn = null; + private $_emptyMessage = null; + private $_pagingMessage = null; + + function __construct() + { + $this->name = 'statsbestmanufacturers'; + $this->tab = 'analytics_stats'; + $this->version = '1.0'; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'sales'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'name', + 'header' => $this->l('Name'), + 'dataIndex' => 'name', + 'align' => 'left', + 'width' => 200 + ), + array( + 'id' => 'quantity', + 'header' => $this->l('Quantity sold'), + 'dataIndex' => 'quantity', + 'width' => 60, + 'align' => 'right' + ), + array( + 'id' => 'sales', + 'header' => $this->l('Total paid'), + 'dataIndex' => 'sales', + 'width' => 60, + 'align' => 'right' + ) + ); + + parent::__construct(); + + $this->displayName = $this->l('Best manufacturers'); + $this->description = $this->l('A list of the best manufacturers'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_category', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + + if (Tools::getValue('export')) + $this->csvExport($engineParams); + + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +
        '.$this->l('CSV Export').' +
        '; + return $this->_html; + } + + public function getTotalCount() + { + return Db::getInstance()->getValue(' + SELECT COUNT(DISTINCT(m.id_manufacturer)) + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id) + LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_order = od.id_order) + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + WHERE o.invoice_date BETWEEN '.$this->getDate().' AND o.valid = 1 + AND m.id_manufacturer IS NOT NULL'); + } + + public function getData() + { + $this->_totalCount = $this->getTotalCount(); + + $this->_query = ' + SELECT m.name, SUM(od.product_quantity) as quantity, ROUND(SUM(od.product_quantity * od.product_price) / c.conversion_rate, 2) as sales + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id) + LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_order = od.id_order) + LEFT JOIN '._DB_PREFIX_.'currency c ON (c.id_currency = o.id_currency) + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + WHERE o.invoice_date BETWEEN '.$this->getDate().' AND o.valid = 1 + AND m.id_manufacturer IS NOT NULL + GROUP BY p.id_manufacturer'; + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction) AND Validate::IsSortDirection($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance()->ExecuteS($this->_query); + } +} diff --git a/modules/statsbestproducts/config.xml b/modules/statsbestproducts/config.xml new file mode 100755 index 000000000..cbf7c8cbb --- /dev/null +++ b/modules/statsbestproducts/config.xml @@ -0,0 +1,11 @@ + + + statsbestproducts + Best products + 1 + A list of the best products + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestproducts/de.php b/modules/statsbestproducts/de.php new file mode 100644 index 000000000..2ba364c67 --- /dev/null +++ b/modules/statsbestproducts/de.php @@ -0,0 +1,18 @@ +statsbestproducts_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_8bf8854bebe108183caeb845c7676ae4'] = 'von'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_2a0440eec72540c5b30d9199c01f348c'] = 'Verkaufte Menge'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_6771f2d557a34bd89ea7abc92a0a069c'] = 'Verkaufspreis'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_213c80e9307852da96029181967ff545'] = 'Verkaufte Menge/ Tag'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_57f32d7d0e6672cc2b60bc7a49f91453'] = 'Angesehene Seite'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_27ce7f8b5623b2e2df568d64cf051607'] = 'Lager'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_71a5c322b7f69a8a4e40b3eb20da5559'] = 'Beste Produkte'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_1784296dda47f4d571a179aad8106018'] = 'Eine Liste der besten Produkte'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; diff --git a/modules/statsbestproducts/en.php b/modules/statsbestproducts/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestproducts/en.php @@ -0,0 +1,4 @@ +statsbestproducts_4f29d8c727dcf2022ac241cb96c31083'] = 'Ningún resultado'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_eab2b4237a7cd89c309119e35f62d168'] = 'Mostrar'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_8bf8854bebe108183caeb845c7676ae4'] = 'en'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_2a0440eec72540c5b30d9199c01f348c'] = 'Cant.'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_6771f2d557a34bd89ea7abc92a0a069c'] = 'Precio de venta'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'ventas'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_213c80e9307852da96029181967ff545'] = 'Cant./día'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_57f32d7d0e6672cc2b60bc7a49f91453'] = 'Páginas vistas'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_71a5c322b7f69a8a4e40b3eb20da5559'] = 'Mejores productos'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_1784296dda47f4d571a179aad8106018'] = 'Lista de los mejores productos'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; diff --git a/modules/statsbestproducts/fr.php b/modules/statsbestproducts/fr.php new file mode 100644 index 000000000..be747cfd8 --- /dev/null +++ b/modules/statsbestproducts/fr.php @@ -0,0 +1,18 @@ +statsbestproducts_4f29d8c727dcf2022ac241cb96c31083'] = 'Aucun résultat'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage de'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_8bf8854bebe108183caeb845c7676ae4'] = 'sur'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_2a0440eec72540c5b30d9199c01f348c'] = 'Qté'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_6771f2d557a34bd89ea7abc92a0a069c'] = 'Prix de vente'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'CA'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_213c80e9307852da96029181967ff545'] = 'Qté / jour'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_57f32d7d0e6672cc2b60bc7a49f91453'] = 'Pages vues'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_71a5c322b7f69a8a4e40b3eb20da5559'] = 'Meilleurs produits'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_1784296dda47f4d571a179aad8106018'] = 'Liste des meilleurs produits'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; diff --git a/modules/statsbestproducts/it.php b/modules/statsbestproducts/it.php new file mode 100644 index 000000000..29c54824f --- /dev/null +++ b/modules/statsbestproducts/it.php @@ -0,0 +1,18 @@ +statsbestproducts_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_12d3c7a4296542c62474856ec452c045'] = 'Rif.'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_2a0440eec72540c5b30d9199c01f348c'] = 'Qtà venduti'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_6771f2d557a34bd89ea7abc92a0a069c'] = 'Prezzo di vendita'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_213c80e9307852da96029181967ff545'] = 'Qtà venduto / giorno'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_57f32d7d0e6672cc2b60bc7a49f91453'] = 'Pagina visualizzata'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_27ce7f8b5623b2e2df568d64cf051607'] = 'Magazzino'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_71a5c322b7f69a8a4e40b3eb20da5559'] = 'I migliori prodotti'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_1784296dda47f4d571a179aad8106018'] = 'Elenco dei migliori prodotti'; +$_MODULE['<{statsbestproducts}prestashop>statsbestproducts_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; diff --git a/modules/statsbestproducts/logo.gif b/modules/statsbestproducts/logo.gif new file mode 100644 index 000000000..fa3a15dd6 Binary files /dev/null and b/modules/statsbestproducts/logo.gif differ diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php new file mode 100644 index 000000000..3ecf7cacc --- /dev/null +++ b/modules/statsbestproducts/statsbestproducts.php @@ -0,0 +1,185 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsBestProducts extends ModuleGrid +{ + private $_html = null; + private $_query = null; + private $_columns = null; + private $_defaultSortColumn = null; + private $_defaultSortDirection = null; + private $_emptyMessage = null; + private $_pagingMessage = null; + + function __construct() + { + $this->name = 'statsbestproducts'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'totalPriceSold'; + $this->_defaultSortDirection = 'DESC'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'reference', + 'header' => $this->l('Ref.'), + 'dataIndex' => 'reference', + 'align' => 'left', + 'width' => 50 + ), + array( + 'id' => 'name', + 'header' => $this->l('Name'), + 'dataIndex' => 'name', + 'align' => 'left', + 'width' => 100 + ), + array( + 'id' => 'totalQuantitySold', + 'header' => $this->l('Quantity sold'), + 'dataIndex' => 'totalQuantitySold', + 'width' => 50, + 'align' => 'right' + ), + array( + 'id' => 'avgPriceSold', + 'header' => $this->l('Price sold'), + 'dataIndex' => 'avgPriceSold', + 'width' => 50, + 'align' => 'right' + ), + array( + 'id' => 'totalPriceSold', + 'header' => $this->l('Sales'), + 'dataIndex' => 'totalPriceSold', + 'width' => 50, + 'align' => 'right' + ), + array( + 'id' => 'averageQuantitySold', + 'header' => $this->l('Quantity sold/ day'), + 'dataIndex' => 'averageQuantitySold', + 'width' => 60, + 'align' => 'right' + ), + array( + 'id' => 'totalPageViewed', + 'header' => $this->l('Page viewed'), + 'dataIndex' => 'totalPageViewed', + 'width' => 60, + 'align' => 'right' + ), + array( + 'id' => 'quantity', + 'header' => $this->l('Stock'), + 'dataIndex' => 'quantity', + 'width' => 50, + 'align' => 'right' + ) + ); + + parent::__construct(); + + $this->displayName = $this->l('Best products'); + $this->description = $this->l('A list of the best products'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_product', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'defaultSortDirection' => $this->_defaultSortDirection, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + + if (Tools::getValue('export')) + $this->csvExport($engineParams); + + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +

        '.$this->l('CSV Export').'

        +
        '; + return $this->_html; + } + + public function getData() + { + $dateBetween = $this->getDate(); + $arrayDateBetween = explode(' AND ', $dateBetween); + + $this->_query = ' + SELECT SQL_CALC_FOUND_ROWS p.reference, p.id_product, pl.name, ROUND(AVG(od.product_price / o.conversion_rate), 2) as avgPriceSold, + IFNULL((SELECT SUM(pa.quantity) FROM '._DB_PREFIX_.'product_attribute pa WHERE pa.id_product = p.id_product GROUP BY pa.id_product), p.quantity) as quantity, + IFNULL(SUM(od.product_quantity), 0) AS totalQuantitySold, + ROUND(IFNULL(IFNULL(SUM(od.product_quantity), 0) / (1 + LEAST(TO_DAYS('.$arrayDateBetween[1].'), TO_DAYS(NOW())) - GREATEST(TO_DAYS('.$arrayDateBetween[0].'), TO_DAYS(p.date_add))), 0), 2) as averageQuantitySold, + ROUND(IFNULL(SUM((od.product_price * od.product_quantity) / o.conversion_rate), 0), 2) AS totalPriceSold, + ( + SELECT IFNULL(SUM(pv.counter), 0) + FROM '._DB_PREFIX_.'page pa + LEFT JOIN '._DB_PREFIX_.'page_viewed pv ON pa.id_page = pv.id_page + LEFT JOIN '._DB_PREFIX_.'date_range dr ON pv.id_date_range = dr.id_date_range + WHERE pa.id_object = p.id_product AND pa.id_page_type = 1 + AND dr.time_start BETWEEN '.$dateBetween.' + AND dr.time_end BETWEEN '.$dateBetween.' + ) AS totalPageViewed + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)($this->getLang()).') + LEFT JOIN '._DB_PREFIX_.'order_detail od ON od.product_id = p.id_product + LEFT JOIN '._DB_PREFIX_.'orders o ON od.id_order = o.id_order + WHERE p.active = 1 AND o.valid = 1 + AND o.invoice_date BETWEEN '.$dateBetween.' + GROUP BY od.product_id'; + + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction) AND Validate::IsSortDirection($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); + } +} diff --git a/modules/statsbestsuppliers/config.xml b/modules/statsbestsuppliers/config.xml new file mode 100755 index 000000000..c40cb72b5 --- /dev/null +++ b/modules/statsbestsuppliers/config.xml @@ -0,0 +1,11 @@ + + + statsbestsuppliers + Best suppliers + 1 + A list of the best suppliers + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestsuppliers/de.php b/modules/statsbestsuppliers/de.php new file mode 100644 index 000000000..4e724bb88 --- /dev/null +++ b/modules/statsbestsuppliers/de.php @@ -0,0 +1,13 @@ +statsbestsuppliers_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_8bf8854bebe108183caeb845c7676ae4'] = 'von '; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_2a0440eec72540c5b30d9199c01f348c'] = 'verkaufte Menge '; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_ea067eb37801c5aab1a1c685eb97d601'] = 'Bezahlter Gesamtbetrag'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_cc3eb9ba7d0e236f33023a4744d0693a'] = 'Beste Zulieferer'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_0fbee5f62b2695e84a5eb275bcf98c6f'] = 'Eine Liste der besten Zulieferer'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; diff --git a/modules/statsbestsuppliers/en.php b/modules/statsbestsuppliers/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestsuppliers/en.php @@ -0,0 +1,4 @@ +statsbestsuppliers_4f29d8c727dcf2022ac241cb96c31083'] = 'Ningún resultado'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_eab2b4237a7cd89c309119e35f62d168'] = 'Mostrar'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_8bf8854bebe108183caeb845c7676ae4'] = 'en'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_2a0440eec72540c5b30d9199c01f348c'] = 'Cantidad'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_ea067eb37801c5aab1a1c685eb97d601'] = 'Total pagado'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_cc3eb9ba7d0e236f33023a4744d0693a'] = 'Mejores proveedores'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_0fbee5f62b2695e84a5eb275bcf98c6f'] = 'Lista de los mejores proveedores'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; diff --git a/modules/statsbestsuppliers/fr.php b/modules/statsbestsuppliers/fr.php new file mode 100644 index 000000000..e6ab6d621 --- /dev/null +++ b/modules/statsbestsuppliers/fr.php @@ -0,0 +1,13 @@ +statsbestsuppliers_4f29d8c727dcf2022ac241cb96c31083'] = 'Aucun résultat'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_8bf8854bebe108183caeb845c7676ae4'] = 'sur'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_2a0440eec72540c5b30d9199c01f348c'] = 'Quantité'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_ea067eb37801c5aab1a1c685eb97d601'] = 'CA'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_cc3eb9ba7d0e236f33023a4744d0693a'] = 'Meilleurs fournisseurs'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_0fbee5f62b2695e84a5eb275bcf98c6f'] = 'Liste des meilleurs fournisseurs'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; diff --git a/modules/statsbestsuppliers/it.php b/modules/statsbestsuppliers/it.php new file mode 100644 index 000000000..221e2946d --- /dev/null +++ b/modules/statsbestsuppliers/it.php @@ -0,0 +1,13 @@ +statsbestsuppliers_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_2a0440eec72540c5b30d9199c01f348c'] = 'Quantità venduta'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_ea067eb37801c5aab1a1c685eb97d601'] = 'Totale pagato'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_cc3eb9ba7d0e236f33023a4744d0693a'] = 'Migliori fornitori'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_0fbee5f62b2695e84a5eb275bcf98c6f'] = 'Elenco dei migliori fornitori'; +$_MODULE['<{statsbestsuppliers}prestashop>statsbestsuppliers_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; diff --git a/modules/statsbestsuppliers/logo.gif b/modules/statsbestsuppliers/logo.gif new file mode 100644 index 000000000..fa3a15dd6 Binary files /dev/null and b/modules/statsbestsuppliers/logo.gif differ diff --git a/modules/statsbestsuppliers/statsbestsuppliers.php b/modules/statsbestsuppliers/statsbestsuppliers.php new file mode 100644 index 000000000..6a1d15fa6 --- /dev/null +++ b/modules/statsbestsuppliers/statsbestsuppliers.php @@ -0,0 +1,142 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsBestSuppliers extends ModuleGrid +{ + private $_html = null; + private $_query = null; + private $_columns = null; + private $_defaultSortColumn = null; + private $_emptyMessage = null; + private $_pagingMessage = null; + + function __construct() + { + $this->name = 'statsbestsuppliers'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'sales'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'name', + 'header' => $this->l('Name'), + 'dataIndex' => 'name', + 'align' => 'left', + 'width' => 200 + ), + array( + 'id' => 'quantity', + 'header' => $this->l('Quantity sold'), + 'dataIndex' => 'quantity', + 'width' => 60, + 'align' => 'right' + ), + array( + 'id' => 'sales', + 'header' => $this->l('Total paid'), + 'dataIndex' => 'sales', + 'width' => 60, + 'align' => 'right' + ) + ); + + parent::__construct(); + + $this->displayName = $this->l('Best suppliers'); + $this->description = $this->l('A list of the best suppliers'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_category', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + + if (Tools::getValue('export') == 1) + $this->csvExport($engineParams); + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +

        '.$this->l('CSV Export').'

        +
        '; + return $this->_html; + } + + public function getTotalCount() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(DISTINCT(s.id_supplier)) + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'product p ON p.id_product = od.product_id + LEFT JOIN '._DB_PREFIX_.'orders o ON o.id_order = od.id_order + LEFT JOIN '._DB_PREFIX_.'supplier s ON s.id_supplier = p.id_supplier + WHERE o.invoice_date BETWEEN '.$this->getDate().' AND o.valid = 1 + AND s.id_supplier IS NOT NULL'); + } + + public function getData() + { + $this->_totalCount = $this->getTotalCount(); + + $this->_query = ' + SELECT s.name, SUM(od.product_quantity) as quantity, ROUND(SUM(od.product_quantity * od.product_price) / o.conversion_rate, 2) as sales + FROM '._DB_PREFIX_.'order_detail od + LEFT JOIN '._DB_PREFIX_.'product p ON p.id_product = od.product_id + LEFT JOIN '._DB_PREFIX_.'orders o ON o.id_order = od.id_order + LEFT JOIN '._DB_PREFIX_.'supplier s ON s.id_supplier = p.id_supplier + WHERE o.invoice_date BETWEEN '.$this->getDate().' AND o.valid = 1 + AND s.id_supplier IS NOT NULL + GROUP BY p.id_supplier'; + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction) AND Validate::IsSortDirection($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + } +} diff --git a/modules/statsbestvouchers/config.xml b/modules/statsbestvouchers/config.xml new file mode 100755 index 000000000..c72a53221 --- /dev/null +++ b/modules/statsbestvouchers/config.xml @@ -0,0 +1,11 @@ + + + statsbestvouchers + Best vouchers + 1 + A list of the best vouchers + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsbestvouchers/de.php b/modules/statsbestvouchers/de.php new file mode 100644 index 000000000..2ab3c4d99 --- /dev/null +++ b/modules/statsbestvouchers/de.php @@ -0,0 +1,13 @@ +statsbestvouchers_4f29d8c727dcf2022ac241cb96c31083'] = 'Ausgabe Aufnahmeeinstellungen leer'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_eab2b4237a7cd89c309119e35f62d168'] = 'Anzeige'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8bf8854bebe108183caeb845c7676ae4'] = 'von'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_df25596dc94d556af2f1823725118572'] = 'Gesamt benutzt'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_b769cee333527b8dc6f3f67882e35a0b'] = 'Beste Gutscheine'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8fc8a29113479bf76f0917c51795ca99'] = 'Eine Liste der besten Gutscheine'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; diff --git a/modules/statsbestvouchers/en.php b/modules/statsbestvouchers/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsbestvouchers/en.php @@ -0,0 +1,4 @@ +statsbestvouchers_4f29d8c727dcf2022ac241cb96c31083'] = 'Devolución de recordset vacío'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_eab2b4237a7cd89c309119e35f62d168'] = 'Mostrando'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8bf8854bebe108183caeb845c7676ae4'] = 'de'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventas'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_df25596dc94d556af2f1823725118572'] = 'Total utilizado'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_b769cee333527b8dc6f3f67882e35a0b'] = 'Mejores vales descuento'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8fc8a29113479bf76f0917c51795ca99'] = 'Lista de mejores vales descuento'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; diff --git a/modules/statsbestvouchers/fr.php b/modules/statsbestvouchers/fr.php new file mode 100644 index 000000000..cf68358f8 --- /dev/null +++ b/modules/statsbestvouchers/fr.php @@ -0,0 +1,13 @@ +statsbestvouchers_4f29d8c727dcf2022ac241cb96c31083'] = 'Aucun résultat'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_eab2b4237a7cd89c309119e35f62d168'] = 'Affichage de'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8bf8854bebe108183caeb845c7676ae4'] = 'sur'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Chiffre d\'affaire'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_df25596dc94d556af2f1823725118572'] = 'Total utilisé'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_b769cee333527b8dc6f3f67882e35a0b'] = 'Meilleurs coupons de réduction'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8fc8a29113479bf76f0917c51795ca99'] = 'Liste des meilleurs coupons de réduction'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; diff --git a/modules/statsbestvouchers/it.php b/modules/statsbestvouchers/it.php new file mode 100644 index 000000000..7db483cd9 --- /dev/null +++ b/modules/statsbestvouchers/it.php @@ -0,0 +1,13 @@ +statsbestvouchers_4f29d8c727dcf2022ac241cb96c31083'] = 'recordset vuoto restituito'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_eab2b4237a7cd89c309119e35f62d168'] = 'Visualizzazione'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8bf8854bebe108183caeb845c7676ae4'] = 'di'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_df25596dc94d556af2f1823725118572'] = 'Totale usato'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_b769cee333527b8dc6f3f67882e35a0b'] = 'Miglior buoni'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_8fc8a29113479bf76f0917c51795ca99'] = 'Eenco dei migliori buoni'; +$_MODULE['<{statsbestvouchers}prestashop>statsbestvouchers_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; diff --git a/modules/statsbestvouchers/logo.gif b/modules/statsbestvouchers/logo.gif new file mode 100644 index 000000000..fa3a15dd6 Binary files /dev/null and b/modules/statsbestvouchers/logo.gif differ diff --git a/modules/statsbestvouchers/statsbestvouchers.php b/modules/statsbestvouchers/statsbestvouchers.php new file mode 100644 index 000000000..634aca273 --- /dev/null +++ b/modules/statsbestvouchers/statsbestvouchers.php @@ -0,0 +1,132 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsBestVouchers extends ModuleGrid +{ + private $_html; + private $_query; + private $_columns; + private $_defaultSortColumn; + private $_defaultSortDirection; + private $_emptyMessage; + private $_pagingMessage; + + function __construct() + { + $this->name = 'statsbestvouchers'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_defaultSortColumn = 'ca'; + $this->_defaultSortDirection = 'DESC'; + $this->_emptyMessage = $this->l('Empty recordset returned'); + $this->_pagingMessage = $this->l('Displaying').' {0} - {1} '.$this->l('of').' {2}'; + + $this->_columns = array( + array( + 'id' => 'name', + 'header' => $this->l('Name'), + 'dataIndex' => 'name', + 'align' => 'left', + 'width' => 300 + ), + array( + 'id' => 'ca', + 'header' => $this->l('Sales'), + 'dataIndex' => 'ca', + 'width' => 30, + 'align' => 'right' + ), + array( + 'id' => 'total', + 'header' => $this->l('Total used'), + 'dataIndex' => 'total', + 'width' => 30, + 'align' => 'right' + ) + ); + + parent::__construct(); + + $this->displayName = $this->l('Best vouchers'); + $this->description = $this->l('A list of the best vouchers'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $engineParams = array( + 'id' => 'id_product', + 'title' => $this->displayName, + 'columns' => $this->_columns, + 'defaultSortColumn' => $this->_defaultSortColumn, + 'defaultSortDirection' => $this->_defaultSortDirection, + 'emptyMessage' => $this->_emptyMessage, + 'pagingMessage' => $this->_pagingMessage + ); + + if (Tools::getValue('export')) + $this->csvExport($engineParams); + + $this->_html = ' +
        '.$this->displayName.' + '.ModuleGrid::engine($engineParams).' +
        '.$this->l('CSV Export').' +
        '; + return $this->_html; + } + + public function getData() + { + $this->_query = ' + SELECT SQL_CALC_FOUND_ROWS od.name, COUNT(od.id_discount) as total, SUM(o.total_paid_real) / o.conversion_rate as ca + FROM '._DB_PREFIX_.'order_discount od + LEFT JOIN '._DB_PREFIX_.'orders o ON o.id_order = od.id_order + WHERE o.valid = 1 + AND o.invoice_date BETWEEN '.$this->getDate().' + GROUP BY od.id_discount'; + + if (Validate::IsName($this->_sort)) + { + $this->_query .= ' ORDER BY `'.$this->_sort.'`'; + if (isset($this->_direction)) + $this->_query .= ' '.$this->_direction; + } + if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit)) + $this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit); + $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); + } +} \ No newline at end of file diff --git a/modules/statscarrier/config.xml b/modules/statscarrier/config.xml new file mode 100755 index 000000000..767d9bbde --- /dev/null +++ b/modules/statscarrier/config.xml @@ -0,0 +1,11 @@ + + + statscarrier + Carrier distribution + 1 + Display the carriers distribution + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statscarrier/de.php b/modules/statscarrier/de.php new file mode 100644 index 000000000..6b145d7d2 --- /dev/null +++ b/modules/statscarrier/de.php @@ -0,0 +1,12 @@ +statscarrier_2e6774abc54cb13cef2c5bfd5a2cb463'] = 'Verteilung der Lieferanten'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca0e2bcc96175be91d54e4efb1b32053'] = 'Zeigt die Verteilung der Lieferanten an'; +$_MODULE['<{statscarrier}prestashop>statscarrier_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{statscarrier}prestashop>statscarrier_d7778d0c64b6ba21494c97f77a66885a'] = 'Filter'; +$_MODULE['<{statscarrier}prestashop>statscarrier_0bed2833289bf7aae607f86b0750101c'] = 'Diese Grafik zeigt die Verteilung der Lieferanten für Ihre Bestellung an. Sie können sie auch auf einen Bestellstatus begrenzen.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statscarrier}prestashop>statscarrier_07701328e4cdbd1c145f234f136892b5'] = 'Keine gültigen Bestellungen für diesen Zeitraum.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca190d96c8c6f00f57f5e572708253fb'] = 'Prozentsatz der Bestellungen pro Lieferant'; diff --git a/modules/statscarrier/en.php b/modules/statscarrier/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statscarrier/en.php @@ -0,0 +1,4 @@ +statscarrier_2e6774abc54cb13cef2c5bfd5a2cb463'] = 'Distribución transportista'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca0e2bcc96175be91d54e4efb1b32053'] = 'Mostrar la distribución de los transportistas'; +$_MODULE['<{statscarrier}prestashop>statscarrier_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todos'; +$_MODULE['<{statscarrier}prestashop>statscarrier_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtrar'; +$_MODULE['<{statscarrier}prestashop>statscarrier_0bed2833289bf7aae607f86b0750101c'] = 'Este gráfico representa la distribución de transportistas por pedidos. Es posible limitarlo a un estado del pedido. '; +$_MODULE['<{statscarrier}prestashop>statscarrier_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statscarrier}prestashop>statscarrier_07701328e4cdbd1c145f234f136892b5'] = 'No hay pedidos válidos para este periodo.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca190d96c8c6f00f57f5e572708253fb'] = 'porcentaje de pedidos por transportista'; diff --git a/modules/statscarrier/fr.php b/modules/statscarrier/fr.php new file mode 100644 index 000000000..1e9c277be --- /dev/null +++ b/modules/statscarrier/fr.php @@ -0,0 +1,12 @@ +statscarrier_2e6774abc54cb13cef2c5bfd5a2cb463'] = 'Répartition par transporteur'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca0e2bcc96175be91d54e4efb1b32053'] = 'Affiche la répartition des commandes par transporteur'; +$_MODULE['<{statscarrier}prestashop>statscarrier_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tout afficher'; +$_MODULE['<{statscarrier}prestashop>statscarrier_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtrer'; +$_MODULE['<{statscarrier}prestashop>statscarrier_0bed2833289bf7aae607f86b0750101c'] = 'Ce graphique représente la répartition des transporteurs poiur vos commandes. Il est également possible de filtrer par état de commande.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statscarrier}prestashop>statscarrier_07701328e4cdbd1c145f234f136892b5'] = 'Aucune commande valide pour cette période.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca190d96c8c6f00f57f5e572708253fb'] = 'Pourcentage de commandes par transporteur'; diff --git a/modules/statscarrier/it.php b/modules/statscarrier/it.php new file mode 100644 index 000000000..ed17866c3 --- /dev/null +++ b/modules/statscarrier/it.php @@ -0,0 +1,12 @@ +statscarrier_2e6774abc54cb13cef2c5bfd5a2cb463'] = 'Ripartizione per corriere'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca0e2bcc96175be91d54e4efb1b32053'] = 'Mostra la ripartizione per corrieri '; +$_MODULE['<{statscarrier}prestashop>statscarrier_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutto'; +$_MODULE['<{statscarrier}prestashop>statscarrier_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtro'; +$_MODULE['<{statscarrier}prestashop>statscarrier_0bed2833289bf7aae607f86b0750101c'] = 'Questo grafico rappresenta la ripartizione per corriere dei tuoi ordini. È inoltre possibile limitare a uno stato di ordine.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statscarrier}prestashop>statscarrier_07701328e4cdbd1c145f234f136892b5'] = 'Nessun ordine valido per questo periodo.'; +$_MODULE['<{statscarrier}prestashop>statscarrier_ca190d96c8c6f00f57f5e572708253fb'] = 'Percentuale degli ordini per corriere'; diff --git a/modules/statscarrier/logo.gif b/modules/statscarrier/logo.gif new file mode 100644 index 000000000..482ceea3c Binary files /dev/null and b/modules/statscarrier/logo.gif differ diff --git a/modules/statscarrier/statscarrier.php b/modules/statscarrier/statscarrier.php new file mode 100644 index 000000000..be2bf52f1 --- /dev/null +++ b/modules/statscarrier/statscarrier.php @@ -0,0 +1,110 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsCarrier extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + private $_option = ''; + + function __construct() + { + $this->name = 'statscarrier'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Carrier distribution'); + $this->description = $this->l('Display the carriers distribution'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + global $cookie; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(o.`id_order`) as total + FROM `'._DB_PREFIX_.'orders` o + WHERE o.`date_add` BETWEEN '.ModuleGraph::getDateBetween().' + '.((int)(Tools::getValue('id_order_state')) ? 'AND (SELECT oh.id_order_state FROM `'._DB_PREFIX_.'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = '.(int)(Tools::getValue('id_order_state')) : '')); + $states = OrderState::getOrderStates((int)($cookie->id_lang)); + if (Tools::getValue('export')) + $this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))); + $this->_html = ' +
        '.$this->displayName.' +
        + + +
        +

        '.$this->l('This graph represents the carrier distribution for your orders. You can also limit it to orders in one state.').'

        + '.($result['total'] ? ModuleGraph::engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))).'

        '.$this->l('CSV Export').'' : $this->l('No valid orders for this period.')).' +
        '; + return $this->_html; + } + + public function setOption($option, $layers = 1) + { + $this->_option = (int)($option); + } + + protected function getData($layers) + { + $stateQuery = ''; + if ((int)($this->_option)) + $stateQuery = 'AND (SELECT oh.id_order_state FROM `'._DB_PREFIX_.'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = '.(int)($this->_option); + $this->_titles['main'] = $this->l('Percentage of orders by carrier'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.name, COUNT(DISTINCT o.`id_order`) as total + FROM `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.id_carrier = c.id_carrier + WHERE o.`date_add` BETWEEN '.ModuleGraph::getDateBetween().' + '.$stateQuery.' + GROUP BY c.`id_carrier`'); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $row['name']; + } + } +} + + diff --git a/modules/statscatalog/application_home.png b/modules/statscatalog/application_home.png new file mode 100644 index 000000000..b60d0c85a Binary files /dev/null and b/modules/statscatalog/application_home.png differ diff --git a/modules/statscatalog/basket_delete.png b/modules/statscatalog/basket_delete.png new file mode 100644 index 000000000..1349974f6 Binary files /dev/null and b/modules/statscatalog/basket_delete.png differ diff --git a/modules/statscatalog/config.xml b/modules/statscatalog/config.xml new file mode 100755 index 000000000..3064937e6 --- /dev/null +++ b/modules/statscatalog/config.xml @@ -0,0 +1,11 @@ + + + statscatalog + Catalog statistics + 1 + General statistics about your catalog. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statscatalog/de.php b/modules/statscatalog/de.php new file mode 100644 index 000000000..274b91c42 --- /dev/null +++ b/modules/statscatalog/de.php @@ -0,0 +1,26 @@ +statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Katalogstatistik'; +$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Allgemeine Statistiken über Ihren Katalog'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'Kauf'; +$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'Besuche'; +$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Wählen Sie eine Kategorie'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Produkte zur Verfügung:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Durchschnittlicher Preis (Basispreis):'; +$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Größe und gesehene Seiten:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Gekaufte Produkte:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Durchschnittliche Anzahl an Seitenaufrufen:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Durchschnittliche Anzahl an Einkäufen:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Bilder zur Verfügung:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Durchschnittliche Anzahl an Bildern:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Nie angesehene Produkte:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Nie gekaufte Produkte:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Umwandlungsrate*:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Durchschnittliche Umwandlungsrate für die Produktseite. Man kann ein Produkt kaufen, ohne die Produktseite anzusehen. In dem Fall kann diese Rate größer als 1 sein.'; +$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Nie gekaufte Produkte '; +$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Bearbeiten/ Ansehen'; diff --git a/modules/statscatalog/en.php b/modules/statscatalog/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statscatalog/en.php @@ -0,0 +1,4 @@ +statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Catálogo de estadísticas'; +$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Estadísticas generales sobre su catálogo'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'compras'; +$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visitas'; +$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Elija una categoría'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'todas'; +$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Producto disponibles:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Precio medio (precio base):'; +$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Páginas del producto vistas:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Productos comprados:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Número medio de á¡ginas visitadas:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Número medio de compras:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Imágenes disponibles:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Número medio de imágenes:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Producto nunca vistos:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Producto no comprados nunca:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Índice de conversión'; +$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Promedio tipo de conversión de la página del producto. Es posible comprar un producto sin ver la página del producto, por lo que esta tasa puede ser mayor que 1.'; +$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Productos nunca comprados'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Editar/Ver'; diff --git a/modules/statscatalog/fr.php b/modules/statscatalog/fr.php new file mode 100644 index 000000000..c5456cdb1 --- /dev/null +++ b/modules/statscatalog/fr.php @@ -0,0 +1,26 @@ +statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Statistiques catalogue'; +$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Statistiques générales sur le catalogue'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'achat'; +$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visites'; +$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Choisissez une catégorie'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Toutes'; +$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Produits disponibles :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Prix moyen (HT) :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Pages produit vues :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'Produits achetés :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Nombre moyen de visites :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Nombre moyen d\'achats :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Images disponibles :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Nombre moyen d\'images :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'Produits jamais consultés :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Produits jamais achetés :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Taux de transformation* :'; +$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Taux de transformation moyen pour une page produit. Un produit pouvant être acheté sans passer par sa page dédiée, cet indicateur peut être supérieur à 1.'; +$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Produits jamais achetés'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Editer / Voir'; diff --git a/modules/statscatalog/it.php b/modules/statscatalog/it.php new file mode 100644 index 000000000..1889377a4 --- /dev/null +++ b/modules/statscatalog/it.php @@ -0,0 +1,26 @@ +statscatalog_cf3aa21c6a2147ddbd86f34091daeccd'] = 'Catalogo statistiche'; +$_MODULE['<{statscatalog}prestashop>statscatalog_226ed1224c5b2db3d3e0716bb4f74da5'] = 'Statistiche generali sul tuo catalogo'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85dbdb21fe502c4d7a1e81bca0aa396d'] = 'acquisto'; +$_MODULE['<{statscatalog}prestashop>statscatalog_233d48e63da77b092da350559d2f8382'] = 'visite'; +$_MODULE['<{statscatalog}prestashop>statscatalog_0173374ac20f5843d58b553d5b226ef6'] = 'Scegli una categoria'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutto'; +$_MODULE['<{statscatalog}prestashop>statscatalog_a7b623414d4b6a3225b4e935babec6d2'] = 'Prodotti disponibili:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_1099377f1598a0856e2457a5145d89c2'] = 'Prezzo medio (prezzo base):'; +$_MODULE['<{statscatalog}prestashop>statscatalog_48a93dc02c74f3065af1ba47fca070d0'] = 'Pagine viste del prodotto:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_156e5c5872c9af24a5c982da07a883c2'] = 'I prodotti acquistati:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_85f179d4142ca061d49605a7fffdc09d'] = 'Numero medio di visite pagina:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_05ff4bfc3baf0acd31a72f1ac754de04'] = 'Numero medio di acquisti:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_c09d09e371989d89847049c9574b6b8e'] = 'Immagini disponibili:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_65275d1b04037d8c8e42425002110363'] = 'Numero medio di immagini:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_51b8891d531ad91128ba58c8928322ab'] = 'I prodotti mai visti:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8725647ef741e5d48c1e6f652ce80b50'] = 'Prodotti mai comprati:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b86770bc713186bcf43dbb1164c5fd28'] = 'Tasso di conversione *:'; +$_MODULE['<{statscatalog}prestashop>statscatalog_64de80ec5f50aefd6ab2b9260a1f4055'] = 'Tasso medio di conversione per la pagina del prodotto. E\' possibile acquistare un prodotto senza visualizzare la pagina del prodotto, quindi questo tasso può essere maggiore di 1.'; +$_MODULE['<{statscatalog}prestashop>statscatalog_58a714d3e9bb2902a5b688c99bd4d8e6'] = 'Prodotti mai comprati'; +$_MODULE['<{statscatalog}prestashop>statscatalog_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscatalog}prestashop>statscatalog_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statscatalog}prestashop>statscatalog_8e7c9a35104a5a68199678bd6bc5d187'] = 'Modifica / Visualizza'; diff --git a/modules/statscatalog/logo.gif b/modules/statscatalog/logo.gif new file mode 100644 index 000000000..3b7ff6f1b Binary files /dev/null and b/modules/statscatalog/logo.gif differ diff --git a/modules/statscatalog/page_edit.png b/modules/statscatalog/page_edit.png new file mode 100644 index 000000000..046811ed7 Binary files /dev/null and b/modules/statscatalog/page_edit.png differ diff --git a/modules/statscatalog/statscatalog.php b/modules/statscatalog/statscatalog.php new file mode 100644 index 000000000..95571ff17 --- /dev/null +++ b/modules/statscatalog/statscatalog.php @@ -0,0 +1,234 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsCatalog extends Module +{ + private $_join = ''; + private $_where = ''; + + function __construct() + { + $this->name = 'statscatalog'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Catalog statistics'); + $this->description = $this->l('General statistics about your catalog.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function getQuery1() + { + return DB::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT p.`id_product`) AS total, SUM(p.`price`) / COUNT(`price`) AS average_price, COUNT(DISTINCT i.`id_image`) AS images + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'image` i ON i.`id_product` = p.`id_product` + '.$this->_join.' + WHERE p.`active` = 1 + '.$this->_where); + } + + public function getTotalPageViewed() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(pv.`counter`) AS viewed + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'page` pa ON p.`id_product` = pa.`id_object` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON (pt.`id_page_type` = pa.`id_page_type` AND pt.`name` = \'product.php\') + LEFT JOIN `'._DB_PREFIX_.'page_viewed` pv ON pv.`id_page` = pa.`id_page` + '.$this->_join.' + WHERE p.`active` = 1 '.$this->_where); + return isset($result['viewed']) ? $result['viewed'] : 0; + } + + public function getTotalProductViewed() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(DISTINCT pa.`id_object`) + FROM `'._DB_PREFIX_.'page_viewed` pv + LEFT JOIN `'._DB_PREFIX_.'page` pa ON pv.`id_page` = pa.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = pa.`id_page_type` + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = pa.`id_object` + '.$this->_join.' + WHERE pt.`name` = \'product.php\' + AND p.`active` = 1 + '.$this->_where); + } + + public function getTotalBought() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(od.`product_quantity`) AS bought + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order` + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = od.`product_id` + '.$this->_join.' + WHERE o.valid = 1 + '.$this->_where); + return isset($result['bought']) ? $result['bought'] : 0; + } + + public function getProductsNB($id_lang) + { + $precalc = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order` + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = od.`product_id` + '.$this->_join.' + WHERE o.valid = 1 + '.$this->_where.' + AND p.`active` = 1 + GROUP BY p.`id_product`'); + + $precalc2 = array(); + foreach ($precalc as $array) + $precalc2[] = (int)($array['id_product']); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.id_product, pl.name, pl.link_rewrite + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.id_lang = '.(int)($id_lang).') + '.$this->_join.' + WHERE p.`active` = 1 + '.(sizeof($precalc2) ? 'AND p.`id_product` NOT IN ('.implode(',', $precalc2).')' : '').' + '.$this->_where); + return array('total' => Db::getInstance(_PS_USE_SQL_SLAVE_)->NumRows(), 'result' => $result); + } + + public function hookAdminStatsModules($params) + { + global $cookie; + $categories = Category::getCategories((int)($cookie->id_lang), true, false); + $productToken = Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)); + $currency = Currency::getCurrency(Configuration::get('PS_CURRENCY_DEFAULT')); + $link = new Link(); + $irow = 0; + + if ($id_category = (int)(Tools::getValue('id_category'))) + { + $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)'; + $this->_where = 'AND cp.`id_category` = '.$id_category; + } + + $result1 = $this->getQuery1(true); + $total = $result1['total']; + $averagePrice = $result1['average_price']; + $totalPictures = $result1['images']; + $averagePictures = $total ? $totalPictures / $total : 0; + + $neverBought = $this->getProductsNB((int)($cookie->id_lang)); + $totalNB = $neverBought['total']; + $productsNB = $neverBought['result']; + + $totalBought = $this->getTotalBought(); + $averagePurchase = $total ? ($totalBought / $total) : 0; + + $totalPageViewed = $this->getTotalPageViewed(); + $averageViewed = $total ? ($totalPageViewed / $total) : 0; + $conversion = number_format((float)($totalPageViewed ? ($totalBought / $totalPageViewed) : 0), 2, '.', ''); + if ($conversionReverse = number_format((float)($totalBought ? ($totalPageViewed / $totalBought) : 0), 2, '.', '')) + $conversion .= ' (1 '.$this->l('purchase').' / '.$conversionReverse.' '.$this->l('visits').')'; + + $totalNV = $total - $this->getTotalProductViewed(); + + $html = ' + +
        '.$this->displayName.' + +
        +
        + +
        +
        +
        + + '.$this->returnLine($this->l('Products available:'), (int)($total)).' + '.$this->returnLine($this->l('Average price (base price):'), Tools::displayPrice($averagePrice, $currency)).' + '.$this->returnLine($this->l('Product pages viewed:'), (int)($totalPageViewed)).' + '.$this->returnLine($this->l('Products bought:'), (int)($totalBought)).' + '.$this->returnLine($this->l('Average number of page visits:'), number_format((float)($averageViewed), 2, '.', '')).' + '.$this->returnLine($this->l('Average number of purchases:'), number_format((float)($averagePurchase), 2, '.', '')).' + '.$this->returnLine($this->l('Images available:'), (int)($totalPictures)).' + '.$this->returnLine($this->l('Average number of images:'), number_format((float)($averagePictures), 2, '.', '')).' + '.$this->returnLine($this->l('Products never viewed:'), (int)($totalNV).' / '.(int)($total)).' + '.$this->returnLine(''.$this->l('Products never purchased:').'', (int)($totalNB).' / '.(int)($total)).' + '.$this->returnLine($this->l('Conversion rate*:'), $conversion).' +
        +
        + * + '.$this->l('Average conversion rate for the product page. It is possible to purchase a product without viewing the product page, so this rate can be greater than 1.').' +
        +
        '; + + if (sizeof($productsNB) AND sizeof($productsNB) < 50) + { + $html .= ' +
        '.$this->l('Products never purchased').' + + '; + foreach ($productsNB as $product) + $html .= ' + + + + + '; + $html .= ' +
        '.$this->l('ID').''.$this->l('Name').''.$this->l('Edit / View').'
        '.$product['id_product'].''.$product['name'].' + + +
        +
        '; + } + return $html; + } + + private function returnLine($label, $data) + { + return ''.$label.''.$data.''; + } +} + + diff --git a/modules/statscheckup/config.xml b/modules/statscheckup/config.xml new file mode 100755 index 000000000..9c75efabc --- /dev/null +++ b/modules/statscheckup/config.xml @@ -0,0 +1,11 @@ + + + statscheckup + Catalog evaluation + 1 + Quick evaluation of your catalog quality. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statscheckup/de.php b/modules/statscheckup/de.php new file mode 100644 index 000000000..2cad1b162 --- /dev/null +++ b/modules/statscheckup/de.php @@ -0,0 +1,30 @@ +statscheckup_e7a908d79d3758c911692ba791da9c70'] = 'Katalogbewertung'; +$_MODULE['<{statscheckup}prestashop>statscheckup_24f870376156be0e8e22cfb94d29df6d'] = 'Katalogqualität im Handumdrehen'; +$_MODULE['<{statscheckup}prestashop>statscheckup_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bae60998ffe4923b131e3d6e4c19993e'] = 'schlecht'; +$_MODULE['<{statscheckup}prestashop>statscheckup_6927a3a7218a3195858411433ec20a21'] = 'Durchschnitt'; +$_MODULE['<{statscheckup}prestashop>statscheckup_755f85c2723bb39381c7379a604160d8'] = 'gut'; +$_MODULE['<{statscheckup}prestashop>statscheckup_8bc84316c4078bf66723fd019616d920'] = 'Beschreibungen'; +$_MODULE['<{statscheckup}prestashop>statscheckup_5cd1930570823694abdd596f29c8943d'] = 'Zeichen (ohne HTML)'; +$_MODULE['<{statscheckup}prestashop>statscheckup_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Bilder'; +$_MODULE['<{statscheckup}prestashop>statscheckup_59b514174bffe4ae402b3d63aad79fe0'] = 'Bilder'; +$_MODULE['<{statscheckup}prestashop>statscheckup_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{statscheckup}prestashop>statscheckup_c3917e1f7138a24c6dc954fe81b86679'] = 'Bestellungen/ Monat'; +$_MODULE['<{statscheckup}prestashop>statscheckup_27ce7f8b5623b2e2df568d64cf051607'] = 'Lager'; +$_MODULE['<{statscheckup}prestashop>statscheckup_691d502cfd0e0626cd3b058e5682ad1c'] = 'Artikel'; +$_MODULE['<{statscheckup}prestashop>statscheckup_dc270bcf468689b19074a5eef7581b52'] = 'Nicht genug'; +$_MODULE['<{statscheckup}prestashop>statscheckup_f4abc77d498c89880f67331609406774'] = 'In Ordnung'; +$_MODULE['<{statscheckup}prestashop>statscheckup_eb37cbc42e2338eec3de04db470d689a'] = 'weniger als'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bde3207d6920ce65500670d7eaf77af9'] = 'größer als'; +$_MODULE['<{statscheckup}prestashop>statscheckup_38fb7d24e0d60a048f540ecb18e13376'] = 'Speichern'; +$_MODULE['<{statscheckup}prestashop>statscheckup_01fda57aa6c7e9f07f5aa36b108e95cb'] = 'Bestellung nach'; +$_MODULE['<{statscheckup}prestashop>statscheckup_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscheckup}prestashop>statscheckup_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statscheckup}prestashop>statscheckup_7d74f3b92b19da5e606d737d339a9679'] = 'Artikel'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv'; +$_MODULE['<{statscheckup}prestashop>statscheckup_3f74e68055b1123e5d7deb32cd8b0b1b'] = 'Beschr.'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4cc6684df7b4a92b1dec6fce3264fac8'] = 'Insgesamt'; diff --git a/modules/statscheckup/es.php b/modules/statscheckup/es.php new file mode 100644 index 000000000..f3aef4fb6 --- /dev/null +++ b/modules/statscheckup/es.php @@ -0,0 +1,30 @@ +statscheckup_e7a908d79d3758c911692ba791da9c70'] = 'Evaluación del catálogo'; +$_MODULE['<{statscheckup}prestashop>statscheckup_24f870376156be0e8e22cfb94d29df6d'] = 'Calidad de su catálogo de inmediato'; +$_MODULE['<{statscheckup}prestashop>statscheckup_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bae60998ffe4923b131e3d6e4c19993e'] = 'mal'; +$_MODULE['<{statscheckup}prestashop>statscheckup_6927a3a7218a3195858411433ec20a21'] = 'regular'; +$_MODULE['<{statscheckup}prestashop>statscheckup_755f85c2723bb39381c7379a604160d8'] = 'bien'; +$_MODULE['<{statscheckup}prestashop>statscheckup_8bc84316c4078bf66723fd019616d920'] = 'Descripciones'; +$_MODULE['<{statscheckup}prestashop>statscheckup_5cd1930570823694abdd596f29c8943d'] = 'caracteres (sin HTML)'; +$_MODULE['<{statscheckup}prestashop>statscheckup_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Imágenes'; +$_MODULE['<{statscheckup}prestashop>statscheckup_59b514174bffe4ae402b3d63aad79fe0'] = 'imágenes'; +$_MODULE['<{statscheckup}prestashop>statscheckup_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventas'; +$_MODULE['<{statscheckup}prestashop>statscheckup_c3917e1f7138a24c6dc954fe81b86679'] = 'pedidos / mes'; +$_MODULE['<{statscheckup}prestashop>statscheckup_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statscheckup}prestashop>statscheckup_691d502cfd0e0626cd3b058e5682ad1c'] = 'artículos'; +$_MODULE['<{statscheckup}prestashop>statscheckup_dc270bcf468689b19074a5eef7581b52'] = 'Insuficiente'; +$_MODULE['<{statscheckup}prestashop>statscheckup_f4abc77d498c89880f67331609406774'] = 'Perfecto'; +$_MODULE['<{statscheckup}prestashop>statscheckup_eb37cbc42e2338eec3de04db470d689a'] = 'inferior a '; +$_MODULE['<{statscheckup}prestashop>statscheckup_bde3207d6920ce65500670d7eaf77af9'] = 'superior a'; +$_MODULE['<{statscheckup}prestashop>statscheckup_38fb7d24e0d60a048f540ecb18e13376'] = 'Guardar'; +$_MODULE['<{statscheckup}prestashop>statscheckup_01fda57aa6c7e9f07f5aa36b108e95cb'] = 'Seleccionar por'; +$_MODULE['<{statscheckup}prestashop>statscheckup_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscheckup}prestashop>statscheckup_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statscheckup}prestashop>statscheckup_7d74f3b92b19da5e606d737d339a9679'] = 'Artículo'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activado'; +$_MODULE['<{statscheckup}prestashop>statscheckup_3f74e68055b1123e5d7deb32cd8b0b1b'] = 'Desactivado'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4cc6684df7b4a92b1dec6fce3264fac8'] = 'Global'; diff --git a/modules/statscheckup/fr.php b/modules/statscheckup/fr.php new file mode 100644 index 000000000..b5435346a --- /dev/null +++ b/modules/statscheckup/fr.php @@ -0,0 +1,30 @@ +statscheckup_e7a908d79d3758c911692ba791da9c70'] = 'Evaluation du catalogue'; +$_MODULE['<{statscheckup}prestashop>statscheckup_24f870376156be0e8e22cfb94d29df6d'] = 'Qualité de votre catalogue en un clin d\'oeil'; +$_MODULE['<{statscheckup}prestashop>statscheckup_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bae60998ffe4923b131e3d6e4c19993e'] = 'mauvais'; +$_MODULE['<{statscheckup}prestashop>statscheckup_6927a3a7218a3195858411433ec20a21'] = 'moyen'; +$_MODULE['<{statscheckup}prestashop>statscheckup_755f85c2723bb39381c7379a604160d8'] = 'bon'; +$_MODULE['<{statscheckup}prestashop>statscheckup_8bc84316c4078bf66723fd019616d920'] = 'Descriptions'; +$_MODULE['<{statscheckup}prestashop>statscheckup_5cd1930570823694abdd596f29c8943d'] = 'caractères (sans HTML)'; +$_MODULE['<{statscheckup}prestashop>statscheckup_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Images'; +$_MODULE['<{statscheckup}prestashop>statscheckup_59b514174bffe4ae402b3d63aad79fe0'] = 'images'; +$_MODULE['<{statscheckup}prestashop>statscheckup_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventes'; +$_MODULE['<{statscheckup}prestashop>statscheckup_c3917e1f7138a24c6dc954fe81b86679'] = 'commandes / mois'; +$_MODULE['<{statscheckup}prestashop>statscheckup_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statscheckup}prestashop>statscheckup_691d502cfd0e0626cd3b058e5682ad1c'] = 'articles'; +$_MODULE['<{statscheckup}prestashop>statscheckup_dc270bcf468689b19074a5eef7581b52'] = 'Insuffisant'; +$_MODULE['<{statscheckup}prestashop>statscheckup_f4abc77d498c89880f67331609406774'] = 'Parfait'; +$_MODULE['<{statscheckup}prestashop>statscheckup_eb37cbc42e2338eec3de04db470d689a'] = 'inférieur à'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bde3207d6920ce65500670d7eaf77af9'] = 'supérieur à'; +$_MODULE['<{statscheckup}prestashop>statscheckup_38fb7d24e0d60a048f540ecb18e13376'] = 'Sauvegarder'; +$_MODULE['<{statscheckup}prestashop>statscheckup_01fda57aa6c7e9f07f5aa36b108e95cb'] = 'Trier par'; +$_MODULE['<{statscheckup}prestashop>statscheckup_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscheckup}prestashop>statscheckup_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statscheckup}prestashop>statscheckup_7d74f3b92b19da5e606d737d339a9679'] = 'Article'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Actif'; +$_MODULE['<{statscheckup}prestashop>statscheckup_3f74e68055b1123e5d7deb32cd8b0b1b'] = 'Desc.'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4cc6684df7b4a92b1dec6fce3264fac8'] = 'Global'; diff --git a/modules/statscheckup/green.png b/modules/statscheckup/green.png new file mode 100644 index 000000000..516bb0c46 Binary files /dev/null and b/modules/statscheckup/green.png differ diff --git a/modules/statscheckup/it.php b/modules/statscheckup/it.php new file mode 100644 index 000000000..7390f938f --- /dev/null +++ b/modules/statscheckup/it.php @@ -0,0 +1,30 @@ +statscheckup_e7a908d79d3758c911692ba791da9c70'] = 'Valutazione catalogo'; +$_MODULE['<{statscheckup}prestashop>statscheckup_24f870376156be0e8e22cfb94d29df6d'] = 'Qualità del catalogo a colpo d\'occhio'; +$_MODULE['<{statscheckup}prestashop>statscheckup_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{statscheckup}prestashop>statscheckup_bae60998ffe4923b131e3d6e4c19993e'] = 'mediocre'; +$_MODULE['<{statscheckup}prestashop>statscheckup_6927a3a7218a3195858411433ec20a21'] = 'medio'; +$_MODULE['<{statscheckup}prestashop>statscheckup_755f85c2723bb39381c7379a604160d8'] = 'buono'; +$_MODULE['<{statscheckup}prestashop>statscheckup_8bc84316c4078bf66723fd019616d920'] = 'Descrizioni'; +$_MODULE['<{statscheckup}prestashop>statscheckup_5cd1930570823694abdd596f29c8943d'] = 'caratteri (senza HTML)'; +$_MODULE['<{statscheckup}prestashop>statscheckup_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Immagini'; +$_MODULE['<{statscheckup}prestashop>statscheckup_59b514174bffe4ae402b3d63aad79fe0'] = 'immagini'; +$_MODULE['<{statscheckup}prestashop>statscheckup_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{statscheckup}prestashop>statscheckup_c3917e1f7138a24c6dc954fe81b86679'] = 'ordini / mese'; +$_MODULE['<{statscheckup}prestashop>statscheckup_27ce7f8b5623b2e2df568d64cf051607'] = 'Magazzino'; +$_MODULE['<{statscheckup}prestashop>statscheckup_691d502cfd0e0626cd3b058e5682ad1c'] = 'articoli'; +$_MODULE['<{statscheckup}prestashop>statscheckup_dc270bcf468689b19074a5eef7581b52'] = 'Non abbastanza'; +$_MODULE['<{statscheckup}prestashop>statscheckup_f4abc77d498c89880f67331609406774'] = 'Perfetto'; +$_MODULE['<{statscheckup}prestashop>statscheckup_eb37cbc42e2338eec3de04db470d689a'] = 'inferiore a '; +$_MODULE['<{statscheckup}prestashop>statscheckup_bde3207d6920ce65500670d7eaf77af9'] = 'maggiore di'; +$_MODULE['<{statscheckup}prestashop>statscheckup_38fb7d24e0d60a048f540ecb18e13376'] = 'Salva'; +$_MODULE['<{statscheckup}prestashop>statscheckup_01fda57aa6c7e9f07f5aa36b108e95cb'] = 'Ordina per'; +$_MODULE['<{statscheckup}prestashop>statscheckup_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statscheckup}prestashop>statscheckup_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statscheckup}prestashop>statscheckup_7d74f3b92b19da5e606d737d339a9679'] = 'Articoloi'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo'; +$_MODULE['<{statscheckup}prestashop>statscheckup_3f74e68055b1123e5d7deb32cd8b0b1b'] = 'Desc.'; +$_MODULE['<{statscheckup}prestashop>statscheckup_4cc6684df7b4a92b1dec6fce3264fac8'] = 'Globale'; diff --git a/modules/statscheckup/logo.gif b/modules/statscheckup/logo.gif new file mode 100644 index 000000000..78c325d64 Binary files /dev/null and b/modules/statscheckup/logo.gif differ diff --git a/modules/statscheckup/orange.png b/modules/statscheckup/orange.png new file mode 100644 index 000000000..2b2a20a89 Binary files /dev/null and b/modules/statscheckup/orange.png differ diff --git a/modules/statscheckup/red.png b/modules/statscheckup/red.png new file mode 100644 index 000000000..4c075e182 Binary files /dev/null and b/modules/statscheckup/red.png differ diff --git a/modules/statscheckup/statscheckup.php b/modules/statscheckup/statscheckup.php new file mode 100644 index 000000000..91432e520 --- /dev/null +++ b/modules/statscheckup/statscheckup.php @@ -0,0 +1,255 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsCheckUp extends Module +{ + function __construct() + { + $this->name = 'statscheckup'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Catalog evaluation'); + $this->description = $this->l('Quick evaluation of your catalog quality.'); + } + + public function install() + { + foreach (array('CHECKUP_DESCRIPTIONS_LT'=>100,'CHECKUP_DESCRIPTIONS_GT'=>400,'CHECKUP_IMAGES_LT'=>1,'CHECKUP_IMAGES_GT'=>2,'CHECKUP_SALES_LT'=>1,'CHECKUP_SALES_GT'=>2,'CHECKUP_STOCK_LT'=>1,'CHECKUP_STOCK_GT'=>3) as $confname => $confdefault) + if (!Configuration::get($confname)) + Configuration::updateValue($confname, (int)$confdefault); + return (parent::install() && $this->registerHook('AdminStatsModules')); + } + + function hookAdminStatsModules() + { + global $cookie, $currentIndex; + + if (Tools::isSubmit('submitCheckup')) + { + foreach (array('CHECKUP_DESCRIPTIONS_LT','CHECKUP_DESCRIPTIONS_GT','CHECKUP_IMAGES_LT','CHECKUP_IMAGES_GT','CHECKUP_SALES_LT','CHECKUP_SALES_GT','CHECKUP_STOCK_LT','CHECKUP_STOCK_GT') as $confname) + Configuration::updateValue($confname, (int)Tools::getValue($confname)); + echo '
        '.$this->l('Configuration updated').'
        '; + } + if (Tools::isSubmit('submitCheckupOrder')) + { + $cookie->checkup_order = (int)Tools::getValue('submitCheckupOrder'); + echo '
        '.$this->l('Configuration updated').'
        '; + } + if (!isset($cookie->checkup_order)) + $cookie->checkup_order = 1; + + $db = Db::getInstance(_PS_USE_SQL_SLAVE_); + $employee = new Employee((int)($cookie->id_employee)); + $prop30 = ((strtotime($employee->stats_date_to.' 23:59:59') - strtotime($employee->stats_date_from.' 00:00:00')) / 60 / 60 / 24) / 30; + $languages = $db->ExecuteS('SELECT * FROM '._DB_PREFIX_.'lang'); + $arrayColors = array( + 0 => ''.$this->l('bad').'', + 1 => ''.$this->l('average').'', + 2 => ''.$this->l('good').'' + ); + $tokenProducts = Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)); + $divisor = 4; + $totals = array('products' => 0, 'active' => 0, 'images' => 0, 'sales' => 0, 'stock' => 0); + foreach ($languages as $language) + { + $divisor++; + $totals['description_'.$language['iso_code']] = 0; + } + $orderBy = 'p.id_product'; + if ($cookie->checkup_order == 2) + $orderBy = 'pl.name'; + elseif ($cookie->checkup_order == 3) + $orderBy = 'nbSales DESC'; + + $result = $db->ExecuteS(' + SELECT p.id_product, p.active, pl.name, ( + SELECT COUNT(*) + FROM '._DB_PREFIX_.'image i + WHERE i.id_product = p.id_product + ) as nbImages, ( + SELECT SUM(od.product_quantity) + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_detail od ON o.id_order = od.id_order + WHERE od.product_id = p.id_product + AND o.invoice_date BETWEEN '.ModuleGraph::getDateBetween().' + ) as nbSales, IFNULL(( + SELECT SUM(pa.quantity) + FROM '._DB_PREFIX_.'product_attribute pa + WHERE pa.id_product = p.id_product + ), p.quantity) as stock + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)$cookie->id_lang.') + ORDER BY '.$orderBy); + + $arrayConf = array( + 'DESCRIPTIONS' => array('name' => $this->l('Descriptions'), 'text' => $this->l('chars (without HTML)')), + 'IMAGES' => array('name' => $this->l('Images'), 'text' => $this->l('images')), + 'SALES' => array('name' => $this->l('Sales'), 'text' => $this->l('orders / month')), + 'STOCK' => array('name' => $this->l('Stock'), 'text' => $this->l('items')) + ); + + $html = ' + +
        + + '; + foreach ($arrayConf as $conf => $translations) + $html .= ' + + '; + $html .= '
        '.$arrayColors[0].' '.$this->l('Not enough').''.$arrayColors[2].' '.$this->l('Alright').'
        '.$translations['name'].''.$this->l('lower than').' '.$translations['text'].' + '.$this->l('greater than').' '.$translations['text'].' +
        +
        +
        +
         
        +
        + '.$this->l('Order by').' + +
        +
         
        + + + + + '; + foreach ($languages as $language) + $html .= ''; + $html .= ' + + + + + '; + foreach ($result as $row) + { + $totals['products']++; + $scores = array( + 'active' => ($row['active'] ? 2 : 0), + 'images' => ($row['nbImages'] < Configuration::get('CHECKUP_IMAGES_LT') ? 0 : ($row['nbImages'] > Configuration::get('CHECKUP_IMAGES_GT') ? 2 : 1)), + 'sales' => (($row['nbSales'] * $prop30 < Configuration::get('CHECKUP_SALES_LT')) ? 0 : (($row['nbSales'] * $prop30 > Configuration::get('CHECKUP_SALES_GT')) ? 2 : 1)), + 'stock' => (($row['stock'] < Configuration::get('CHECKUP_STOCK_LT')) ? 0 : (($row['stock'] > Configuration::get('CHECKUP_STOCK_GT')) ? 2 : 1)), + ); + $totals['active'] += (int)$scores['active']; + $totals['images'] += (int)$scores['images']; + $totals['sales'] += (int)$scores['sales']; + $totals['stock'] += (int)$scores['stock']; + $descriptions = $db->ExecuteS('SELECT iso_code, description FROM '._DB_PREFIX_.'product_lang pl LEFT JOIN '._DB_PREFIX_.'lang l ON pl.id_lang = l.id_lang WHERE id_product = '.(int)$row['id_product']); + foreach ($descriptions as $description) + { + $row['desclength_'.$description['iso_code']] = Tools::strlen(strip_tags($description['description'])); + $scores['description_'.$description['iso_code']] = ($row['desclength_'.$description['iso_code']] < Configuration::get('CHECKUP_DESCRIPTIONS_LT') ? 0 : ($row['desclength_'.$description['iso_code']] > Configuration::get('CHECKUP_DESCRIPTIONS_GT') ? 2 : 1)); + $totals['description_'.$description['iso_code']] += $scores['description_'.$description['iso_code']]; + } + $scores['average'] = array_sum($scores) / $divisor; + $scores['average'] = ($scores['average'] < 1 ? 0 : ($scores['average'] > 1.5 ? 2 : 1)); + + $html .= ' + + + '; + foreach ($languages as $language) + if (isset($row['desclength_'.$language['iso_code']])) + $html .= ''; + else + $html .= ''; + $html .= ' + + + + + '; + } + + $totals['active'] = $totals['active'] / $totals['products']; + $totals['active'] = ($totals['active'] < 1 ? 0 : ($totals['active'] > 1.5 ? 2 : 1)); + $totals['images'] = $totals['images'] / $totals['products']; + $totals['images'] = ($totals['images'] < 1 ? 0 : ($totals['images'] > 1.5 ? 2 : 1)); + $totals['sales'] = $totals['sales'] / $totals['products']; + $totals['sales'] = ($totals['sales'] < 1 ? 0 : ($totals['sales'] > 1.5 ? 2 : 1)); + $totals['stock'] = $totals['stock'] / $totals['products']; + $totals['stock'] = ($totals['stock'] < 1 ? 0 : ($totals['stock'] > 1.5 ? 2 : 1)); + foreach ($languages as $language) + { + $totals['description_'.$language['iso_code']] = $totals['description_'.$language['iso_code']] / $totals['products']; + $totals['description_'.$language['iso_code']] = ($totals['description_'.$language['iso_code']] < 1 ? 0 : ($totals['description_'.$language['iso_code']] > 1.5 ? 2 : 1)); + } + $totals['average'] = array_sum($totals) / $divisor; + $totals['average'] = ($totals['average'] < 1 ? 0 : ($totals['average'] > 1.5 ? 2 : 1)); + + $html .= ' + + + '; + foreach ($languages as $language) + $html .= ''; + $html .= ' + + + + + + + + '; + foreach ($languages as $language) + $html .= ''; + $html .= ' + + + + + +
        '.$this->l('ID').''.$this->l('Item').''.$this->l('Active').''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'.$this->l('Images').''.$this->l('Sales').''.$this->l('Stock').''.$this->l('Global').'
        '.$row['id_product'].''.Tools::substr($row['name'], 0, 42).''.$arrayColors[$scores['active']].''.(int)$row['desclength_'.$language['iso_code']].' '.$arrayColors[$scores['description_'.$language['iso_code']]].'0 '.$arrayColors[0].''.(int)$row['nbImages'].' '.$arrayColors[$scores['images']].''.(int)$row['nbSales'].' '.$arrayColors[$scores['sales']].''.(int)$row['stock'].' '.$arrayColors[$scores['stock']].''.$arrayColors[$scores['average']].'
        '.$this->l('Active').''.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')'.$this->l('Images').''.$this->l('Sales').''.$this->l('Stock').''.$this->l('Global').'
        '.$arrayColors[$totals['active']].''.$arrayColors[$totals['description_'.$language['iso_code']]].''.$arrayColors[$totals['images']].''.$arrayColors[$totals['sales']].''.$arrayColors[$totals['stock']].''.$arrayColors[$totals['average']].'
        +
         
        + '; + + return $html; + } +} + + diff --git a/modules/statsdata/config.xml b/modules/statsdata/config.xml new file mode 100644 index 000000000..fb17a5a5f --- /dev/null +++ b/modules/statsdata/config.xml @@ -0,0 +1,11 @@ + + + statsdata + Data mining for statistics + 1 + This module must be enabled if you want to use Statistics. + PrestaShop + analytics_stats + 1 + 1 + \ No newline at end of file diff --git a/modules/statsdata/de.php b/modules/statsdata/de.php new file mode 100644 index 000000000..a773cc3b7 --- /dev/null +++ b/modules/statsdata/de.php @@ -0,0 +1,17 @@ +statsdata_a51950bf91ba55cd93a33ce3f8d448c2'] = 'Data Mining für die Statistik'; +$_MODULE['<{statsdata}prestashop>statsdata_974ccf59b041ae66afa975f609368573'] = 'Dieses Modul muss aktiviert sein, wenn Sie die Statistiken verwenden möchten'; +$_MODULE['<{statsdata}prestashop>statsdata_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert'; +$_MODULE['<{statsdata}prestashop>statsdata_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{statsdata}prestashop>statsdata_1a5b75c4be3c0100c99764b21e844cc8'] = 'Speichern Sie die Seitenaufrufe für jeden Kunden'; +$_MODULE['<{statsdata}prestashop>statsdata_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{statsdata}prestashop>statsdata_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Nein'; +$_MODULE['<{statsdata}prestashop>statsdata_1ef5adaa7eef1a44e4cb6ce3fb61f5f5'] = 'Seitenaufrufe von Kunden verbrauchen viele CPU-Ressourcen und Datenbank-Speicherplatz.'; +$_MODULE['<{statsdata}prestashop>statsdata_dd8289e220ec0de9a8b99adc7f9014b1'] = 'Gesamtseitenaufrufe speichern'; +$_MODULE['<{statsdata}prestashop>statsdata_6511e0043f774246017a4c255e1e10c3'] = 'Gesamtseitenaufrufe verbrauchen ebenfalls CPU-Ressourcen, aber weniger '; +$_MODULE['<{statsdata}prestashop>statsdata_48f08588e7f264b5ea1e7ea56ed768f6'] = 'Plug-Ins Erkennung'; +$_MODULE['<{statsdata}prestashop>statsdata_54e5f8bdd6c51a73d79ed702cdc9ac05'] = 'Die Plug-Ins Erkennung lädte ein zusätzliche 20kb JavaScript-Datei für neue Besucher.'; +$_MODULE['<{statsdata}prestashop>statsdata_06933067aafd48425d67bcb01bba5cb6'] = 'Aktualisieren'; diff --git a/modules/statsdata/en.php b/modules/statsdata/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsdata/en.php @@ -0,0 +1,4 @@ +statsdata_a51950bf91ba55cd93a33ce3f8d448c2'] = 'Explotación de datos para las estadísticas'; +$_MODULE['<{statsdata}prestashop>statsdata_974ccf59b041ae66afa975f609368573'] = 'Este módulo debe estar activado si usted quiere utilizar las estadísticas'; +$_MODULE['<{statsdata}prestashop>statsdata_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada'; +$_MODULE['<{statsdata}prestashop>statsdata_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{statsdata}prestashop>statsdata_1a5b75c4be3c0100c99764b21e844cc8'] = 'Guardar las páginas vistas por cada cliente'; +$_MODULE['<{statsdata}prestashop>statsdata_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{statsdata}prestashop>statsdata_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{statsdata}prestashop>statsdata_1ef5adaa7eef1a44e4cb6ce3fb61f5f5'] = 'Las páginas vistas de los clientes consumen muchos recursos de procesador y espacio en la base de datos. '; +$_MODULE['<{statsdata}prestashop>statsdata_dd8289e220ec0de9a8b99adc7f9014b1'] = 'Guardar las páginas vistas globales'; +$_MODULE['<{statsdata}prestashop>statsdata_6511e0043f774246017a4c255e1e10c3'] = 'Las páginas vistas necesitan menos recursos que el detalle por cliente, pero siguen necesitando bastantes.'; +$_MODULE['<{statsdata}prestashop>statsdata_48f08588e7f264b5ea1e7ea56ed768f6'] = 'Detección de plug-ins'; +$_MODULE['<{statsdata}prestashop>statsdata_54e5f8bdd6c51a73d79ed702cdc9ac05'] = 'La detección de los plug-ins carga un archivo javascript de 20 ko suplementario para los nuevos visitantes.'; +$_MODULE['<{statsdata}prestashop>statsdata_06933067aafd48425d67bcb01bba5cb6'] = 'Actualizar'; diff --git a/modules/statsdata/fr.php b/modules/statsdata/fr.php new file mode 100644 index 000000000..52c27a77c --- /dev/null +++ b/modules/statsdata/fr.php @@ -0,0 +1,17 @@ +statsdata_a51950bf91ba55cd93a33ce3f8d448c2'] = 'Récupération des données statistiques'; +$_MODULE['<{statsdata}prestashop>statsdata_974ccf59b041ae66afa975f609368573'] = 'Ce module doit être activé pour bénéficier des statistiques'; +$_MODULE['<{statsdata}prestashop>statsdata_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour'; +$_MODULE['<{statsdata}prestashop>statsdata_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{statsdata}prestashop>statsdata_1a5b75c4be3c0100c99764b21e844cc8'] = 'Enregistrer les pages vues pour chaque client'; +$_MODULE['<{statsdata}prestashop>statsdata_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{statsdata}prestashop>statsdata_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{statsdata}prestashop>statsdata_1ef5adaa7eef1a44e4cb6ce3fb61f5f5'] = 'Les pages vues des clients consomment beaucoup de ressources processeur et d\'espace en base de données.'; +$_MODULE['<{statsdata}prestashop>statsdata_dd8289e220ec0de9a8b99adc7f9014b1'] = 'Enregistrer les pages vues globales'; +$_MODULE['<{statsdata}prestashop>statsdata_6511e0043f774246017a4c255e1e10c3'] = 'Les pages vues nécessitent moins de ressources que le détail par client, mais en nécessitent néanmoins pas mal.'; +$_MODULE['<{statsdata}prestashop>statsdata_48f08588e7f264b5ea1e7ea56ed768f6'] = 'Détection des plug-ins'; +$_MODULE['<{statsdata}prestashop>statsdata_54e5f8bdd6c51a73d79ed702cdc9ac05'] = 'La détection des plug-ins charge un fichier javascript de 20ko supplémentaire pour les nouveaux visiteurs.'; +$_MODULE['<{statsdata}prestashop>statsdata_06933067aafd48425d67bcb01bba5cb6'] = 'Mettre à jour'; diff --git a/modules/statsdata/it.php b/modules/statsdata/it.php new file mode 100644 index 000000000..7a9be8831 --- /dev/null +++ b/modules/statsdata/it.php @@ -0,0 +1,17 @@ +statsdata_a51950bf91ba55cd93a33ce3f8d448c2'] = 'Recupero dati per statistiche'; +$_MODULE['<{statsdata}prestashop>statsdata_974ccf59b041ae66afa975f609368573'] = 'Questo modulo deve essere attivato se si desidera utilizzare le statistiche'; +$_MODULE['<{statsdata}prestashop>statsdata_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata'; +$_MODULE['<{statsdata}prestashop>statsdata_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{statsdata}prestashop>statsdata_1a5b75c4be3c0100c99764b21e844cc8'] = 'Salvare le pagine viste per ogni cliente'; +$_MODULE['<{statsdata}prestashop>statsdata_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{statsdata}prestashop>statsdata_bafd7322c6e97d25b6299b5d6fe8920b'] = 'No'; +$_MODULE['<{statsdata}prestashop>statsdata_1ef5adaa7eef1a44e4cb6ce3fb61f5f5'] = 'Le pagine viste dal cliente utilizzano molte risorse CPU e di spazio database.'; +$_MODULE['<{statsdata}prestashop>statsdata_dd8289e220ec0de9a8b99adc7f9014b1'] = 'Salva pagine globali viste'; +$_MODULE['<{statsdata}prestashop>statsdata_6511e0043f774246017a4c255e1e10c3'] = 'Le pagine viste utilizzano meno risorse rispetto al cliente, ma utilizzano comunque le risorse'; +$_MODULE['<{statsdata}prestashop>statsdata_48f08588e7f264b5ea1e7ea56ed768f6'] = 'Individuazione dei plug-in'; +$_MODULE['<{statsdata}prestashop>statsdata_54e5f8bdd6c51a73d79ed702cdc9ac05'] = 'L\'individuazione dei plug-in carica un ulteriore file javascript di 20kb per i nuovi visitatori'; +$_MODULE['<{statsdata}prestashop>statsdata_06933067aafd48425d67bcb01bba5cb6'] = 'Aggiornamento'; diff --git a/modules/statsdata/logo.gif b/modules/statsdata/logo.gif new file mode 100644 index 000000000..a6103b8a9 Binary files /dev/null and b/modules/statsdata/logo.gif differ diff --git a/modules/statsdata/statsdata.php b/modules/statsdata/statsdata.php new file mode 100644 index 000000000..b32cbbccb --- /dev/null +++ b/modules/statsdata/statsdata.php @@ -0,0 +1,200 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsData extends Module +{ + public function __construct() + { + $this->name = 'statsdata'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Data mining for statistics'); + $this->description = $this->l('This module must be enabled if you want to use Statistics.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('footer') AND $this->registerHook('authentication') AND $this->registerHook('createAccount')); + } + + public function getContent() + { + if (Tools::isSubmit('submitStatsData')) + { + Configuration::updateValue('PS_STATSDATA_CUSTOMER_PAGESVIEWS', (int)Tools::getValue('PS_STATSDATA_CUSTOMER_PAGESVIEWS')); + Configuration::updateValue('PS_STATSDATA_PAGESVIEWS', (int)Tools::getValue('PS_STATSDATA_PAGESVIEWS')); + Configuration::updateValue('PS_STATSDATA_PLUGINS', (int)Tools::getValue('PS_STATSDATA_PLUGINS')); + echo '
        '.$this->l('Configuration updated').'
        '; + } + + return '
        +
        '.$this->l('Settings').' + +
        + + + + +

        '.$this->l('Customer page views uses a lot of CPU resources and database space.').'

        +
        +
         
        + +
        + + + + +

        '.$this->l('Global page views uses less resources than customer\'s, but uses resources nonetheless.').'

        +
        +
         
        + +
        + + + + +

        '.$this->l('Plug-ins detection loads an extra 20kb javascript file for new visitors.').'

        +
        +
         
        + +
        '; + } + + public function hookFooter($params) + { + $html = ''; + if (!isset($params['cookie']->id_guest)) + { + Guest::setNewGuest($params['cookie']); + + if (Configuration::get('PS_STATSDATA_PLUGINS')) + { + // Ajax request sending browser information + $token = sha1($params['cookie']->id_guest._COOKIE_KEY_); + $html .= ' + + '; + } + } + + // Record the guest path then increment the visit counter of the page + $tokenArray = Connection::setPageConnection($params['cookie']); + ConnectionsSource::logHttpReferer(); + if (Configuration::get('PS_STATSDATA_PAGESVIEWS')) + Page::setPageViewed($tokenArray['id_page']); + + if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + { + // Ajax request sending the time spend on the page + $token = sha1($tokenArray['id_connections'].$tokenArray['id_page'].$tokenArray['time_start']._COOKIE_KEY_); + $html .= ' + '; + } + + return $html; + } + + public function hookCreateAccount($params) + { + return $this->hookAuthentication($params); + } + + public function hookAuthentication($params) + { + // Update or merge the guest with the customer id (login and account creation) + $guest = new Guest($params['cookie']->id_guest); + $result = Db::getInstance()->getRow(' + SELECT `id_guest` + FROM `'._DB_PREFIX_.'guest` + WHERE `id_customer` = '.(int)($params['cookie']->id_customer)); + + if ((int)($result['id_guest'])) + { + // The new guest is merged with the old one when it's connecting to an account + $guest->mergeWithCustomer($result['id_guest'], $params['cookie']->id_customer); + $params['cookie']->id_guest = $guest->id; + } + else + { + // The guest is duplicated if it has multiple customer accounts + $method = ($guest->id_customer) ? 'add' : 'update'; + $guest->id_customer = $params['cookie']->id_customer; + $guest->{$method}(); + } + } +} + + diff --git a/modules/statsequipment/config.xml b/modules/statsequipment/config.xml new file mode 100755 index 000000000..21b2aa6dd --- /dev/null +++ b/modules/statsequipment/config.xml @@ -0,0 +1,11 @@ + + + statsequipment + Software + 1 + Display the software used by your visitors. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsequipment/de.php b/modules/statsequipment/de.php new file mode 100644 index 000000000..44a5fdc67 --- /dev/null +++ b/modules/statsequipment/de.php @@ -0,0 +1,15 @@ +statsequipment_719d067b229178f03bcfa1da4ac4dede'] = 'Software'; +$_MODULE['<{statsequipment}prestashop>statsequipment_a7b3ac03f9e0f1dabad82e41f6cfed37'] = 'Anzeige der von Ihren Besuchern benutzten Software'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dcbcd22b719ba36dad1330178c6bf761'] = 'Bestimmen Sie den Web-Browser-Prozentsatz, den Ihr Kunden nutzt.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dc29a12c359732b223367cb61df2196d'] = 'Bestimmen Sie den Prozentsatz der Betriebssysteme, die Ihre Kunden nutzen.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_575e3c9cac82aacd649b1196d845588a'] = 'Plug-ins'; +$_MODULE['<{statsequipment}prestashop>statsequipment_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsequipment}prestashop>statsequipment_501361472d0528ee07f202297f599d40'] = 'Stellen Sie sicher, dass Ihre Webseite für alle zugänglich ist '; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ebe1665d646cc99d4a80835d1734cad'] = 'Bei der Webseitenverwaltung ist es wichtig, die von den Kunden genutzte Software im Auge zu behalten, um sicher zu gehen, dass die Webseite allen das Gleiche anzeigt. PrestaShop wurde so konzipiert, dass es mit den meisten neueren Webbrowsern und Betriebssystemen kompatibel ist. Falls Sie schließlich jedoch Ihren Webbrowser durch fortgeschrittene Funktionen erweitern oder sogar den PrestaShop Core Code verändern, können diese Zusätze nicht für alle zugänglich sein. Daher ist es angeraten, Tabs auf dem Prozentsatz der Kunden für jede Software-Art zu behalten, bevor Sie etwas hinzufügen oder ändern, was nur einer begrenzten Zahl an Benutzern zugänglich ist.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ce59076ab4eaa3570ff2a931706d3c1'] = 'Web-Browser-Benutzung'; +$_MODULE['<{statsequipment}prestashop>statsequipment_eb84ea9e8324beffd94fdeff011edfd7'] = 'Betriebssystem-Benutzung'; diff --git a/modules/statsequipment/en.php b/modules/statsequipment/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsequipment/en.php @@ -0,0 +1,4 @@ +statsequipment_719d067b229178f03bcfa1da4ac4dede'] = 'Software'; +$_MODULE['<{statsequipment}prestashop>statsequipment_a7b3ac03f9e0f1dabad82e41f6cfed37'] = 'Mostrar el Software utilizado por sus visitantes'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dcbcd22b719ba36dad1330178c6bf761'] = 'Determine la repartición de los buscadores que utilizan sus clientes'; +$_MODULE['<{statsequipment}prestashop>statsequipment_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dc29a12c359732b223367cb61df2196d'] = 'Determine la repartición de los sistemas operativo que utilizan sus clientes'; +$_MODULE['<{statsequipment}prestashop>statsequipment_575e3c9cac82aacd649b1196d845588a'] = 'Plug-ins'; +$_MODULE['<{statsequipment}prestashop>statsequipment_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsequipment}prestashop>statsequipment_501361472d0528ee07f202297f599d40'] = 'Asegúrese de que su sitio Web sea accesible a todos'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ebe1665d646cc99d4a80835d1734cad'] = 'Cuando se administran sitios web, es importante no perder de vista el software utilizado por los visitantes con el fin de asegurarse de que el sitio se muestra de manera idéntica para cada uno. PrestaShop fue creado para ser compatible con la mayoría de los buscadores recientes y de los sistemas operativos de ordenadores (OS) de la red. Sin embargo, puesto que usted puede terminar agregando características avanzadas a su sitio Web o incluso modificar el código de base de PrestaShop, estas adiciones pueden no ser accesibles para todos. Por esa razón es una buena idea guardar en pestañas una relación del porcentaje de usuarios para cada tipo de software antes de hacer algún cambio al que sólo podrá acceder un número limitado de usuarios. '; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ce59076ab4eaa3570ff2a931706d3c1'] = 'Buscador utilizado'; +$_MODULE['<{statsequipment}prestashop>statsequipment_eb84ea9e8324beffd94fdeff011edfd7'] = 'Sistema operativo utilizado'; diff --git a/modules/statsequipment/fr.php b/modules/statsequipment/fr.php new file mode 100644 index 000000000..9bb9c4a58 --- /dev/null +++ b/modules/statsequipment/fr.php @@ -0,0 +1,15 @@ +statsequipment_719d067b229178f03bcfa1da4ac4dede'] = 'Equipement'; +$_MODULE['<{statsequipment}prestashop>statsequipment_a7b3ac03f9e0f1dabad82e41f6cfed37'] = 'Affiche l\'équipement de vos visiteurs'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dcbcd22b719ba36dad1330178c6bf761'] = 'Déterminez la répartition des navigateurs web utilisés par vos clients'; +$_MODULE['<{statsequipment}prestashop>statsequipment_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dc29a12c359732b223367cb61df2196d'] = 'Déterminez la répartition des systèmes d\'exploitation utilisés par vos clients'; +$_MODULE['<{statsequipment}prestashop>statsequipment_575e3c9cac82aacd649b1196d845588a'] = 'Extensions'; +$_MODULE['<{statsequipment}prestashop>statsequipment_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsequipment}prestashop>statsequipment_501361472d0528ee07f202297f599d40'] = 'Veillez à ce que votre site soit accessible à tous'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ebe1665d646cc99d4a80835d1734cad'] = 'Lorsque l\'on gère des sites web, il est important de garder une trace des logiciels utilisés par les visiteurs afin de s\'assurer que le site s\'affiche de la même façon pour tout le monde. Et PrestaShop a été construit de manière à être compatible avec la plupart des navigateurs Web récents et les systèmes d\'exploitation. Toutefois, dans le cas où vous auriez ajouté des fonctionnalités avancées à votre site Web ou même modifié le code de base PrestaShop, ces ajouts pourraient ne pas être accessibles par tous. C\'est pourquoi il est bon de contrôler le pourcentage de visiteurs pour chaque système avant de songer à ajouter ce type de fonctionnalités trop spécifiques.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ce59076ab4eaa3570ff2a931706d3c1'] = 'Navigateurs utilisés'; +$_MODULE['<{statsequipment}prestashop>statsequipment_eb84ea9e8324beffd94fdeff011edfd7'] = 'Systèmes d\'exploitation utilisés'; diff --git a/modules/statsequipment/it.php b/modules/statsequipment/it.php new file mode 100644 index 000000000..572bb0adf --- /dev/null +++ b/modules/statsequipment/it.php @@ -0,0 +1,15 @@ +statsequipment_719d067b229178f03bcfa1da4ac4dede'] = 'Software'; +$_MODULE['<{statsequipment}prestashop>statsequipment_a7b3ac03f9e0f1dabad82e41f6cfed37'] = 'Visualizza il software utilizzato dai visitatori'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dcbcd22b719ba36dad1330178c6bf761'] = 'Determina la percentuale di browser utilizzati dai tuoi clienti.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsequipment}prestashop>statsequipment_dc29a12c359732b223367cb61df2196d'] = 'Determina la percentuale di sistemi operativi usati dai tuoi clienti.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_575e3c9cac82aacd649b1196d845588a'] = 'Plug-in'; +$_MODULE['<{statsequipment}prestashop>statsequipment_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsequipment}prestashop>statsequipment_501361472d0528ee07f202297f599d40'] = 'Assicuratevi che il tuo sito web sia accessibile a tutti'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ebe1665d646cc99d4a80835d1734cad'] = 'Nella gestione dei siti web, è importante tenere traccia dei software utilizzati dai visitatori, al fine di essere sicuri che il sito sia visualizzato allo stesso modo da tutti, per questo PrestaShop è stato costruito in modo da essere compatibile con la maggior parte dei browser e recenti sistemi operativi (OS). Tuttavia, siccome potrà capitare che tu aggiunga funzionalità avanzate al tuo sito web o modifichi il codice di base PrestaShop, tali aggiunte possono non essere accessibili a tutti. Ecco perché è una buona idea tenere sotto controllo la percentuale di utenti per ogni tipo di software prima di aggiungere o modificare qualcosa a cui potrà accedere solo un numero limitato di utenti.'; +$_MODULE['<{statsequipment}prestashop>statsequipment_8ce59076ab4eaa3570ff2a931706d3c1'] = 'Uso del browser'; +$_MODULE['<{statsequipment}prestashop>statsequipment_eb84ea9e8324beffd94fdeff011edfd7'] = 'Uso del sistema operativo'; diff --git a/modules/statsequipment/logo.gif b/modules/statsequipment/logo.gif new file mode 100644 index 000000000..98323f9a9 Binary files /dev/null and b/modules/statsequipment/logo.gif differ diff --git a/modules/statsequipment/statsequipment.php b/modules/statsequipment/statsequipment.php new file mode 100644 index 000000000..aa192ad72 --- /dev/null +++ b/modules/statsequipment/statsequipment.php @@ -0,0 +1,175 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsEquipment extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + + function __construct() + { + $this->name = 'statsequipment'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Software'); + $this->description = $this->l('Display the software used by your visitors.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + private function getEquipment() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT g.* + FROM `'._DB_PREFIX_.'connections` c + LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.`id_guest` = c.`id_guest` + WHERE c.`date_add` BETWEEN '.ModuleGraph::getDateBetween(), false); + + $calcArray = array('jsOK' => 0, 'jsKO' => 0, 'javaOK' => 0, 'javaKO' => 0, 'wmpOK' => 0, 'wmpKO' => 0, 'qtOK' => 0, 'qtKO' => 0, 'realOK' => 0, 'realKO' => 0, 'flashOK' => 0, 'flashKO' => 0, 'directorOK' => 0, 'directorKO' => 0); + while ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->nextRow($result)) + { + if (!$row['javascript']) + { + ++$calcArray['jsKO']; + continue; + } + ++$calcArray['jsOK']; + ($row['windows_media']) ? ++$calcArray['wmpOK'] : ++$calcArray['wmpKO']; + ($row['real_player']) ? ++$calcArray['realOK'] : ++$calcArray['realKO']; + ($row['adobe_flash']) ? ++$calcArray['flashOK'] : ++$calcArray['flashKO']; + ($row['adobe_director']) ? ++$calcArray['directorOK'] : ++$calcArray['directorKO']; + ($row['sun_java']) ? ++$calcArray['javaOK'] : ++$calcArray['javaKO']; + ($row['apple_quicktime']) ? ++$calcArray['qtOK'] : ++$calcArray['qtKO']; + } + + if (!$calcArray['jsOK']) + return false; + + $equip = array( + 'Windows Media Player' => $calcArray['wmpOK'] / ($calcArray['wmpOK'] + $calcArray['wmpKO']), + 'Real Player' => $calcArray['realOK'] / ($calcArray['realOK'] + $calcArray['realKO']), + 'Apple Quicktime' => $calcArray['qtOK'] / ($calcArray['qtOK'] + $calcArray['qtKO']), + 'Sun Java' => $calcArray['javaOK'] / ($calcArray['javaOK'] + $calcArray['javaKO']), + 'Adobe Flash' => $calcArray['flashOK'] / ($calcArray['flashOK'] + $calcArray['flashKO']), + 'Adobe Shockwave' => $calcArray['directorOK'] / ($calcArray['directorOK'] + $calcArray['directorKO']) + ); + arsort($equip); + return $equip; + } + + public function hookAdminStatsModules($params) + { + if (Tools::getValue('export')) + if (Tools::getValue('exportType') == 'browser') + $this->csvExport(array('type' => 'pie', 'option' => 'wb')); + elseif (Tools::getValue('exportType') == 'os') + $this->csvExport(array('type' => 'pie', 'option' => 'os')); + + $equipment = $this->getEquipment(); + $this->_html = ' +
        '.$this->displayName.' +
        +

        '.$this->l('Determine the percentage of web browsers used by your customers.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'wb')).'

        +

        '.$this->l('CSV Export').'

        +

        '.$this->l('Determine the percentage of operating systems used by your customers.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'os')).' +

        '.$this->l('CSV Export').'

        '; + + if ($equipment) + { + $this->_html .= ' + '; + foreach ($equipment as $name => $value) + $this->_html .= ''; + $this->_html .= '
        '.$this->l('Plug-ins').'
        '.$name.''.number_format(100 * $value, 2).'%
        '; + } + $this->_html .= ' +
        +

        +
        '.$this->l('Guide').' +

        '.$this->l('Ensure that your website is accessible to all.').'

        +

        + '.$this->l('When managing Websites, it is important to keep track of software used by visitors in order to be sure that the site displays the same way for everyone. PrestaShop was built in order to be compatible with most recent Web browsers and computer operating systems (OS). However, because you may end up adding advanced features to your Website or even modify the core PrestaShop code, these additions may not be accessible by everyone. That is why it is a good idea to keep tabs on the percentage of users for each type of software before adding or changing something that only a limited number of users will be able to access.').' +


        + +
        '; + return $this->_html; + } + + public function setOption($option, $layers = 1) + { + switch($option) + { + case 'wb': + $this->_titles['main'] = $this->l('Web browser use'); + $this->_query = ' + SELECT wb.`name`, COUNT(g.`id_web_browser`) AS total + FROM `'._DB_PREFIX_.'web_browser` wb + LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.`id_web_browser` = wb.`id_web_browser` + LEFT JOIN `'._DB_PREFIX_.'connections` c ON g.`id_guest` = c.`id_guest` + WHERE c.`date_add` BETWEEN '; + $this->_query2 = ' GROUP BY g.`id_web_browser`'; + break; + case 'os': + $this->_titles['main'] = $this->l('Operating systems use'); + $this->_query = ' + SELECT os.`name`, COUNT(g.`id_operating_system`) AS total + FROM `'._DB_PREFIX_.'operating_system` os + LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.`id_operating_system` = os.`id_operating_system` + LEFT JOIN `'._DB_PREFIX_.'connections` c ON g.`id_guest` = c.`id_guest` + WHERE c.`date_add` BETWEEN '; + $this->_query2 = ' GROUP BY g.`id_operating_system`'; + break; + } + } + + protected function getData($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + $this->_values = array(); + $i = 0; + foreach ($result as $row) + { + $this->_values[$i] = $row['total']; + $this->_legend[$i++] = $row['name']; + } + } +} + + diff --git a/modules/statsforecast/config.xml b/modules/statsforecast/config.xml new file mode 100755 index 000000000..2d057bd0f --- /dev/null +++ b/modules/statsforecast/config.xml @@ -0,0 +1,11 @@ + + + statsforecast + Stats Dashboard + 1 + + PrestaShop + analytics_stats + 1 + 1 + \ No newline at end of file diff --git a/modules/statsforecast/de.php b/modules/statsforecast/de.php new file mode 100644 index 000000000..fd4e18219 --- /dev/null +++ b/modules/statsforecast/de.php @@ -0,0 +1,57 @@ +statsforecast_240c994d8b61c7bd68ac1c5182bbdb2e'] = 'Stsatistik Armaturenbrett'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b53bb8c5ac3b77a4667498709efba55d'] = 'Alle Beträge verstehen sich ohne Steuern.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03727ac48595a24daed975559c944a44'] = 'Tag'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d2ce009594dcc60befa6a4e6cbeb71fc'] = 'Woche'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7cbb885aa1164b390a0bc050a64e1812'] = 'Monat'; +$_MODULE['<{statsforecast}prestashop>statsforecast_537c66b24ef5c83b7382cdc3f34885f2'] = 'Jahr'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d7e637a6e9ff116de2fa89551240a94d'] = 'Besuche'; +$_MODULE['<{statsforecast}prestashop>statsforecast_591411cc8927851db2002208676d8330'] = 'Reg.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Bestellungen'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9dea4016dbcc290b773ab2fae678aaa8'] = 'Artikel'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e46b5c15331f34b9ff653fdf1ea0a7f0'] = '% Reg.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1d34a18a13e480b0aa6a799bb8a49c1b'] = '% Bestellungen'; +$_MODULE['<{statsforecast}prestashop>statsforecast_cc4616c718d99e1face99b5e46a5755c'] = 'Gutscheine'; +$_MODULE['<{statsforecast}prestashop>statsforecast_899433c0e135bcfe0d93e9397630f86a'] = 'Produktverkäufe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_96b0141273eabab320119c467cdcaf17'] = 'Insgesamt'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b1897515d548a960afe49ecf66a29021'] = 'Durchschnitt'; +$_MODULE['<{statsforecast}prestashop>statsforecast_89c1265be62d3ba835a3d963db5956b0'] = 'Prognose'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3bb1503332637805beddb73a2dd1fe1b'] = 'Umwandlung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9b945efebb006547a94415eadaa12921'] = 'Konten'; +$_MODULE['<{statsforecast}prestashop>statsforecast_fc26e55e0993a75e892175deb02aae15'] = 'Warenkörbe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_87cac5a0b60008003ccf46dc1d49e0c3'] = 'Volle Warenkörbe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5a9e532b24379dca2ab0e973172a78e1'] = 'Registrierte Besucher'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b4aec469184819e8369588e5d84b38fb'] = 'Wandeln Sie Ihre Besucher in bares Geld um:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_38f2d5f34a773b7c0668f03e6b8eb6dc'] = 'Ertrag aus jedem Besucher'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8ca76c564cccfd5a2ff4d2e08f46db5a'] = 'Ertrag aus jedem registrierten Besucher'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0faa470ff0741ece6c8346b66e0e459c'] = 'Zahlungsverteilung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6e42855066e7a3ae050b2c698021b14'] = 'Zone:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5ed26836c96d7dcae8a40307e8e250c3'] = '- Kein Filter -'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e55f75a29310d7b60f7ac1d390c8ae42'] = 'Modul'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e93f994f01c537c4e2f7d8528c3eb5e9'] = 'Zählung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f13877f6ad53ce91fcb20fb8b7969698'] = 'Verteilung der Kategorien'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{statsforecast}prestashop>statsforecast_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_52f39d7c5cad5c1550553385f55277ae'] = '% Zählung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_41b63feded4acc3719f9bcd016388324'] = '% Verkäufe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_4364f8c09d7bf97996a20840900e7b30'] = 'Durchschnittl. Preis'; +$_MODULE['<{statsforecast}prestashop>statsforecast_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Sprachenverteilung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Kunden'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{statsforecast}prestashop>statsforecast_699aed86dada6ca01ef74013a4464066'] = 'Wachstum'; +$_MODULE['<{statsforecast}prestashop>statsforecast_07aa83862ec591697b4325b66d36a78b'] = 'Zonenverteilung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b3ff996fe5c77610359114835baf9b38'] = 'Zone'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Undefiniert'; +$_MODULE['<{statsforecast}prestashop>statsforecast_28e81c8343702f6c813cc31a7f90616a'] = 'Währungsverteilung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_386c339d37e737a436499d423a77df0c'] = 'Währung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_61569923d8075889a162c4e603258e6e'] = 'Verkäufe (umgewandelt)'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8471eed257db7258f935588a664ba4f3'] = 'Attributverteilung'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03937134cedab9078be39a77ee3a48a0'] = 'Gruppe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribute'; diff --git a/modules/statsforecast/es.php b/modules/statsforecast/es.php new file mode 100644 index 000000000..1f27ab9b5 --- /dev/null +++ b/modules/statsforecast/es.php @@ -0,0 +1,57 @@ +statsforecast_240c994d8b61c7bd68ac1c5182bbdb2e'] = 'Tabla de mando de estadísticas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b53bb8c5ac3b77a4667498709efba55d'] = 'Todos los importes se indican sin IVA'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1ee1c44c2dc81681f961235604247b81'] = 'Modo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03727ac48595a24daed975559c944a44'] = 'Día'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d2ce009594dcc60befa6a4e6cbeb71fc'] = 'Semana'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7cbb885aa1164b390a0bc050a64e1812'] = 'Mes'; +$_MODULE['<{statsforecast}prestashop>statsforecast_537c66b24ef5c83b7382cdc3f34885f2'] = 'Año'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d7e637a6e9ff116de2fa89551240a94d'] = 'Visitas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_591411cc8927851db2002208676d8330'] = 'Inscritos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Pedidos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9dea4016dbcc290b773ab2fae678aaa8'] = 'Productos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e46b5c15331f34b9ff653fdf1ea0a7f0'] = '% insc.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1d34a18a13e480b0aa6a799bb8a49c1b'] = '% pedidos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_cc4616c718d99e1face99b5e46a5755c'] = 'Descuentos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_899433c0e135bcfe0d93e9397630f86a'] = 'Volumne de ventas de los productos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b1897515d548a960afe49ecf66a29021'] = 'Media'; +$_MODULE['<{statsforecast}prestashop>statsforecast_89c1265be62d3ba835a3d963db5956b0'] = 'Previsiones'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3bb1503332637805beddb73a2dd1fe1b'] = 'Conversión'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9b945efebb006547a94415eadaa12921'] = 'Cuentas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_fc26e55e0993a75e892175deb02aae15'] = 'Carritos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_87cac5a0b60008003ccf46dc1d49e0c3'] = 'Carritos llenos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5a9e532b24379dca2ab0e973172a78e1'] = 'Visitantes inscritos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b4aec469184819e8369588e5d84b38fb'] = 'Dirigir a los visitantes hacia el pago'; +$_MODULE['<{statsforecast}prestashop>statsforecast_38f2d5f34a773b7c0668f03e6b8eb6dc'] = 'Beneficio por visitante'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8ca76c564cccfd5a2ff4d2e08f46db5a'] = 'Beneficio por visitante inscrito'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0faa470ff0741ece6c8346b66e0e459c'] = 'Repartición por modos de pago'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6e42855066e7a3ae050b2c698021b14'] = 'Zona:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5ed26836c96d7dcae8a40307e8e250c3'] = '-No hay filtros-'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e55f75a29310d7b60f7ac1d390c8ae42'] = 'Módulo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e93f994f01c537c4e2f7d8528c3eb5e9'] = 'Cálculo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrito'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f13877f6ad53ce91fcb20fb8b7969698'] = 'Repartición por categorías'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{statsforecast}prestashop>statsforecast_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Volumen de ventas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_52f39d7c5cad5c1550553385f55277ae'] = '% cálculo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_41b63feded4acc3719f9bcd016388324'] = '% volume de ventas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_4364f8c09d7bf97996a20840900e7b30'] = 'Precio medio'; +$_MODULE['<{statsforecast}prestashop>statsforecast_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Repartición por idiomas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clientes'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{statsforecast}prestashop>statsforecast_699aed86dada6ca01ef74013a4464066'] = 'Evolución'; +$_MODULE['<{statsforecast}prestashop>statsforecast_07aa83862ec591697b4325b66d36a78b'] = 'Repartición por zonas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b3ff996fe5c77610359114835baf9b38'] = 'Zona'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indefinido'; +$_MODULE['<{statsforecast}prestashop>statsforecast_28e81c8343702f6c813cc31a7f90616a'] = 'Repartición por divisas'; +$_MODULE['<{statsforecast}prestashop>statsforecast_386c339d37e737a436499d423a77df0c'] = 'Divisa'; +$_MODULE['<{statsforecast}prestashop>statsforecast_61569923d8075889a162c4e603258e6e'] = 'Volumen de ventas (convertido)'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8471eed257db7258f935588a664ba4f3'] = 'Repartición de las ventas por atributos'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03937134cedab9078be39a77ee3a48a0'] = 'Grupo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Atributo'; diff --git a/modules/statsforecast/fr.php b/modules/statsforecast/fr.php new file mode 100644 index 000000000..0b4b5ccd3 --- /dev/null +++ b/modules/statsforecast/fr.php @@ -0,0 +1,57 @@ +statsforecast_240c994d8b61c7bd68ac1c5182bbdb2e'] = 'Tableau de bord statistiques'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b53bb8c5ac3b77a4667498709efba55d'] = 'Tous les montants sont exprimés HT.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1ee1c44c2dc81681f961235604247b81'] = 'Mode :'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03727ac48595a24daed975559c944a44'] = 'Jour'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d2ce009594dcc60befa6a4e6cbeb71fc'] = 'Semaine'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7cbb885aa1164b390a0bc050a64e1812'] = 'Mois'; +$_MODULE['<{statsforecast}prestashop>statsforecast_537c66b24ef5c83b7382cdc3f34885f2'] = 'Année'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d7e637a6e9ff116de2fa89551240a94d'] = 'Visites'; +$_MODULE['<{statsforecast}prestashop>statsforecast_591411cc8927851db2002208676d8330'] = 'Insc.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Com.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9dea4016dbcc290b773ab2fae678aaa8'] = 'Prods.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e46b5c15331f34b9ff653fdf1ea0a7f0'] = '% Insc.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1d34a18a13e480b0aa6a799bb8a49c1b'] = '% Com.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_cc4616c718d99e1face99b5e46a5755c'] = 'Réducs.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_899433c0e135bcfe0d93e9397630f86a'] = 'CA Produits'; +$_MODULE['<{statsforecast}prestashop>statsforecast_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b1897515d548a960afe49ecf66a29021'] = 'Moyenne'; +$_MODULE['<{statsforecast}prestashop>statsforecast_89c1265be62d3ba835a3d963db5956b0'] = 'Prévisions'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3bb1503332637805beddb73a2dd1fe1b'] = 'Conversion'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9b945efebb006547a94415eadaa12921'] = 'Comptes'; +$_MODULE['<{statsforecast}prestashop>statsforecast_fc26e55e0993a75e892175deb02aae15'] = 'Paniers'; +$_MODULE['<{statsforecast}prestashop>statsforecast_87cac5a0b60008003ccf46dc1d49e0c3'] = 'Paniers complets'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5a9e532b24379dca2ab0e973172a78e1'] = 'Visiteurs inscrits'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b4aec469184819e8369588e5d84b38fb'] = 'Monétisation des visiteurs'; +$_MODULE['<{statsforecast}prestashop>statsforecast_38f2d5f34a773b7c0668f03e6b8eb6dc'] = 'Chaque visiteur rapporte en moyenne'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8ca76c564cccfd5a2ff4d2e08f46db5a'] = 'Chaque visiteur inscrit rapporte en moyenne'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0faa470ff0741ece6c8346b66e0e459c'] = 'Répartition par modes de paiement'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6e42855066e7a3ae050b2c698021b14'] = 'Zone :'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5ed26836c96d7dcae8a40307e8e250c3'] = '-- Aucun filtre --'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e55f75a29310d7b60f7ac1d390c8ae42'] = 'Module'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e93f994f01c537c4e2f7d8528c3eb5e9'] = 'Nb'; +$_MODULE['<{statsforecast}prestashop>statsforecast_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f13877f6ad53ce91fcb20fb8b7969698'] = 'Répartition par catégories'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie'; +$_MODULE['<{statsforecast}prestashop>statsforecast_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'CA'; +$_MODULE['<{statsforecast}prestashop>statsforecast_52f39d7c5cad5c1550553385f55277ae'] = '% Nb'; +$_MODULE['<{statsforecast}prestashop>statsforecast_41b63feded4acc3719f9bcd016388324'] = '% CA'; +$_MODULE['<{statsforecast}prestashop>statsforecast_4364f8c09d7bf97996a20840900e7b30'] = 'Prix moyen'; +$_MODULE['<{statsforecast}prestashop>statsforecast_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Répartition par langues'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clients'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{statsforecast}prestashop>statsforecast_699aed86dada6ca01ef74013a4464066'] = 'Evolution'; +$_MODULE['<{statsforecast}prestashop>statsforecast_07aa83862ec591697b4325b66d36a78b'] = 'Répartition par zones'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b3ff996fe5c77610359114835baf9b38'] = 'Zone'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indéfini'; +$_MODULE['<{statsforecast}prestashop>statsforecast_28e81c8343702f6c813cc31a7f90616a'] = 'Répartition par devises'; +$_MODULE['<{statsforecast}prestashop>statsforecast_386c339d37e737a436499d423a77df0c'] = 'Devise'; +$_MODULE['<{statsforecast}prestashop>statsforecast_61569923d8075889a162c4e603258e6e'] = 'CA (converti)'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8471eed257db7258f935588a664ba4f3'] = 'Répartition des ventes par attributs'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03937134cedab9078be39a77ee3a48a0'] = 'Groupe'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribut'; diff --git a/modules/statsforecast/funnel.png b/modules/statsforecast/funnel.png new file mode 100644 index 000000000..2213a2b20 Binary files /dev/null and b/modules/statsforecast/funnel.png differ diff --git a/modules/statsforecast/it.php b/modules/statsforecast/it.php new file mode 100644 index 000000000..408958e2e --- /dev/null +++ b/modules/statsforecast/it.php @@ -0,0 +1,57 @@ +statsforecast_240c994d8b61c7bd68ac1c5182bbdb2e'] = 'Statistiche Dashboard'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b53bb8c5ac3b77a4667498709efba55d'] = 'Tutti gli importi sono senza tasse.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03727ac48595a24daed975559c944a44'] = 'Giorno'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d2ce009594dcc60befa6a4e6cbeb71fc'] = 'Settimana'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7cbb885aa1164b390a0bc050a64e1812'] = 'Mese'; +$_MODULE['<{statsforecast}prestashop>statsforecast_537c66b24ef5c83b7382cdc3f34885f2'] = 'Anno'; +$_MODULE['<{statsforecast}prestashop>statsforecast_d7e637a6e9ff116de2fa89551240a94d'] = 'Visite'; +$_MODULE['<{statsforecast}prestashop>statsforecast_591411cc8927851db2002208676d8330'] = 'Reg.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Ordini'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9dea4016dbcc290b773ab2fae678aaa8'] = 'Articoli'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e46b5c15331f34b9ff653fdf1ea0a7f0'] = '% Reg.'; +$_MODULE['<{statsforecast}prestashop>statsforecast_1d34a18a13e480b0aa6a799bb8a49c1b'] = '% Ordini'; +$_MODULE['<{statsforecast}prestashop>statsforecast_cc4616c718d99e1face99b5e46a5755c'] = 'Buoni'; +$_MODULE['<{statsforecast}prestashop>statsforecast_899433c0e135bcfe0d93e9397630f86a'] = 'Vendite prodotti'; +$_MODULE['<{statsforecast}prestashop>statsforecast_96b0141273eabab320119c467cdcaf17'] = 'Totale'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b1897515d548a960afe49ecf66a29021'] = 'Media'; +$_MODULE['<{statsforecast}prestashop>statsforecast_89c1265be62d3ba835a3d963db5956b0'] = 'Previsione'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3bb1503332637805beddb73a2dd1fe1b'] = 'Conversione'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori'; +$_MODULE['<{statsforecast}prestashop>statsforecast_9b945efebb006547a94415eadaa12921'] = 'Conti'; +$_MODULE['<{statsforecast}prestashop>statsforecast_fc26e55e0993a75e892175deb02aae15'] = 'Carrelli'; +$_MODULE['<{statsforecast}prestashop>statsforecast_87cac5a0b60008003ccf46dc1d49e0c3'] = 'carri completi'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5a9e532b24379dca2ab0e973172a78e1'] = 'Visitatori registrati'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b4aec469184819e8369588e5d84b38fb'] = 'Trasforma i tuoi visitatori in denaro:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_38f2d5f34a773b7c0668f03e6b8eb6dc'] = 'Ogni visitatore rende'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8ca76c564cccfd5a2ff4d2e08f46db5a'] = 'Ogni visitatore registrato rende'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0faa470ff0741ece6c8346b66e0e459c'] = 'Distribuzione del pagamento'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6e42855066e7a3ae050b2c698021b14'] = 'Zona:'; +$_MODULE['<{statsforecast}prestashop>statsforecast_5ed26836c96d7dcae8a40307e8e250c3'] = '- Nessun Filtro -'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e55f75a29310d7b60f7ac1d390c8ae42'] = 'Modulo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e93f994f01c537c4e2f7d8528c3eb5e9'] = 'Conteggio'; +$_MODULE['<{statsforecast}prestashop>statsforecast_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f13877f6ad53ce91fcb20fb8b7969698'] = 'Categoria distribuzione'; +$_MODULE['<{statsforecast}prestashop>statsforecast_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{statsforecast}prestashop>statsforecast_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{statsforecast}prestashop>statsforecast_52f39d7c5cad5c1550553385f55277ae'] = '% conteggio'; +$_MODULE['<{statsforecast}prestashop>statsforecast_41b63feded4acc3719f9bcd016388324'] = '% vendite'; +$_MODULE['<{statsforecast}prestashop>statsforecast_4364f8c09d7bf97996a20840900e7b30'] = 'Prezzo medio'; +$_MODULE['<{statsforecast}prestashop>statsforecast_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Lingua di distribuzione'; +$_MODULE['<{statsforecast}prestashop>statsforecast_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clienti'; +$_MODULE['<{statsforecast}prestashop>statsforecast_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{statsforecast}prestashop>statsforecast_699aed86dada6ca01ef74013a4464066'] = 'Crescita'; +$_MODULE['<{statsforecast}prestashop>statsforecast_07aa83862ec591697b4325b66d36a78b'] = 'Zone di distribuzione'; +$_MODULE['<{statsforecast}prestashop>statsforecast_b3ff996fe5c77610359114835baf9b38'] = 'Zone'; +$_MODULE['<{statsforecast}prestashop>statsforecast_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indefinito'; +$_MODULE['<{statsforecast}prestashop>statsforecast_28e81c8343702f6c813cc31a7f90616a'] = 'Distribuzione valuta'; +$_MODULE['<{statsforecast}prestashop>statsforecast_386c339d37e737a436499d423a77df0c'] = 'Valuta'; +$_MODULE['<{statsforecast}prestashop>statsforecast_61569923d8075889a162c4e603258e6e'] = 'Vendite (convertito)'; +$_MODULE['<{statsforecast}prestashop>statsforecast_8471eed257db7258f935588a664ba4f3'] = 'Distribuzione attributo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_03937134cedab9078be39a77ee3a48a0'] = 'Gruppo'; +$_MODULE['<{statsforecast}prestashop>statsforecast_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attributo'; diff --git a/modules/statsforecast/logo.gif b/modules/statsforecast/logo.gif new file mode 100644 index 000000000..8ff27b432 Binary files /dev/null and b/modules/statsforecast/logo.gif differ diff --git a/modules/statsforecast/next.png b/modules/statsforecast/next.png new file mode 100644 index 000000000..e252606d3 Binary files /dev/null and b/modules/statsforecast/next.png differ diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php new file mode 100644 index 000000000..edbd9b6da --- /dev/null +++ b/modules/statsforecast/statsforecast.php @@ -0,0 +1,539 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StatsForecast extends Module +{ + private $_html = ''; + private $t1 = 0; + private $t2 = 0; + private $t3 = 0; + private $t4 = 0; + private $t5 = 0; + private $t6 = 0; + private $t7 = 0; + private $t8 = 0; + + public function __construct() + { + $this->name = 'statsforecast'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Stats Dashboard'); + $this->description = ''; + } + + public function install() + { + return (parent::install() && $this->registerHook('AdminStatsModules')); + } + + public function getContent() + { + Tools::redirectAdmin('index.php?tab=AdminStats&module=statsforecast&token='.Tools::getAdminTokenLite('AdminStats')); + } + + public function hookAdminStatsModules() + { + global $cookie, $currentIndex; + $ru = $currentIndex.'&module='.$this->name.'&token='.Tools::getValue('token'); + + $db = Db::getInstance(); + + if (!isset($cookie->stats_granularity)) + $cookie->stats_granularity = 10; + if (Tools::isSubmit('submitIdZone')) + $cookie->stats_id_zone = Tools::getValue('stats_id_zone'); + if (Tools::isSubmit('submitGranularity')) + $cookie->stats_granularity = Tools::getValue('stats_granularity'); + + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $employee = new Employee((int)($cookie->id_employee)); + + $result = $db->getRow('SELECT UNIX_TIMESTAMP(\'2009-06-05 00:00:00\') as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_from.' 00:00:00\') as t2'); + $from = max($result['t1'], $result['t2']); + $to = strtotime($employee->stats_date_to.' 23:59:59'); + $result2 = $db->getRow('SELECT UNIX_TIMESTAMP(NOW()) as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_to.' 23:59:59\') as t2'); + $to2 = min($result2['t1'], $result2['t2']); + $interval = ($to - $from) / 60 / 60 / 24; + $interval2 = ($to2 - $from) / 60 / 60 / 24; + $prop30 = $interval / $interval2; + + if ($cookie->stats_granularity == 7) + $intervalAvg = $interval2 / 30; + if ($cookie->stats_granularity == 4) + $intervalAvg = $interval2 / 365; + if ($cookie->stats_granularity == 10) + $intervalAvg = $interval2; + if ($cookie->stats_granularity == 42) + $intervalAvg = $interval2 / 7; + + define('PS_BASE_URI', '/'); + $result = $db->getRow('SELECT UNIX_TIMESTAMP(\'2009-06-05\') as t1, UNIX_TIMESTAMP(\''.$employee->stats_date_from.'\') as t2'); + $from = max($result['t1'], $result['t2']); + $to = strtotime($employee->stats_date_to.''); + + $dateFromGAdd = ($cookie->stats_granularity != 42 + ? 'SUBSTRING(date_add, 1, '.(int)$cookie->stats_granularity.')' + : 'IFNULL(MAKEDATE(YEAR(date_add),DAYOFYEAR(date_add)-WEEKDAY(date_add)), CONCAT(YEAR(date_add),"-01-01*"))'); + $dateFromGInvoice = ($cookie->stats_granularity != 42 + ? 'SUBSTRING(invoice_date, 1, '.(int)$cookie->stats_granularity.')' + : 'IFNULL(MAKEDATE(YEAR(invoice_date),DAYOFYEAR(invoice_date)-WEEKDAY(invoice_date)), CONCAT(YEAR(invoice_date),"-01-01*"))'); + + $result = $db->ExecuteS(' + SELECT + '.$dateFromGInvoice.' as fix_date, + COUNT(DISTINCT o.id_order) as countOrders, + SUM(od.product_quantity) as countProducts, + SUM(od.product_price * od.product_quantity / o.conversion_rate) as totalProducts + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_detail od ON o.id_order = od.id_order + LEFT JOIN '._DB_PREFIX_.'product p ON od.product_id = p.id_product + WHERE o.valid = 1 + AND o.invoice_date BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY '.$dateFromGInvoice.' + ORDER BY fix_date', false); + + $dataTable = array(); + if ($cookie->stats_granularity == 10) + { + $dateEnd = strtotime($employee->stats_date_to.' 23:59:59'); + $dateToday = time(); + for ($i = strtotime($employee->stats_date_from.' 00:00:00'); $i <= $dateEnd AND $i <= $dateToday; $i += 86400) + $dataTable[$i] = array('fix_date' => date('Y-m-d', $i), 'countOrders' => 0, 'countProducts' => 0, 'totalProducts' => 0); + } + while ($row = $db->nextRow($result)) + $dataTable[strtotime($row['fix_date'])] = $row; + + $this->_html .= '
        +
        '.$this->displayName.' +

        '.$this->l('All amounts are without taxes.').'

        + + + '.$this->l('Mode:').' + +
         
        + + + + + + + + + + + + '; + + $visitArray = array(); + $visits = Db::getInstance()->ExecuteS('SELECT '.$dateFromGAdd.' as fix_date, COUNT(*) as visits FROM '._DB_PREFIX_.'connections c WHERE c.date_add BETWEEN '.ModuleGraph::getDateBetween().' GROUP BY '.$dateFromGAdd, false); + while ($row = $db->nextRow($visits)) + $visitArray[$row['fix_date']] = $row['visits']; + + $discountArray = array(); + $discounts = Db::getInstance()->ExecuteS(' + SELECT '.$dateFromGInvoice.' as fix_date, SUM(od.value) as total + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_discount od ON o.id_order = od.id_order + WHERE o.valid = 1 + AND o.total_paid_real > 0 + AND o.invoice_date BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY '.$dateFromGInvoice, false); + while ($row = $db->nextRow($discounts)) + $discountArray[$row['fix_date']] = $row['total']; + $today = date('Y-m-d'); + foreach ($dataTable as $row) + { + $discountToday = (isset($discountArray[$row['fix_date']]) ? $discountArray[$row['fix_date']] : 0); + $visitsToday = (int)(isset($visitArray[$row['fix_date']]) ? $visitArray[$row['fix_date']] : 0); + + $dateFromGReg = ($cookie->stats_granularity != 42 + ? 'LIKE \''.$row['fix_date'].'%\'' + : 'BETWEEN \''.substr($row['fix_date'], 0, 10).' 00:00:00\' AND DATE_ADD(\''.substr($row['fix_date'], 0, 8).substr($row['fix_date'], 8, 2).' 23:59:59\', INTERVAL 7 DAY)'); + $row['registrations'] = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'customer WHERE date_add BETWEEN '.ModuleGraph::getDateBetween().' AND date_add '.$dateFromGReg); + $totalHT = $row['totalProducts'] - $discountToday; + + $this->_html .= ' + + + + + + + + + + + '; + + $this->t1 += $visitsToday; + $this->t2 += (int)($row['registrations']); + $this->t3 += (int)($row['countOrders']); + $this->t4 += (int)($row['countProducts']); + $this->t7 += $discountToday; + $this->t8 += $totalHT; + } + + $this->_html .= ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        '.$this->l('Visits').''.$this->l('Reg.').''.$this->l('Orders').''.$this->l('Items').''.$this->l('% Reg.').''.$this->l('% Orders').''.$this->l('Coupons').''.$this->l('Products Sales').'
        '.$row['fix_date'].''.$visitsToday.''.(int)($row['registrations']).''.(int)($row['countOrders']).''.(int)($row['countProducts']).''.($visitsToday ? round(100 * (int)($row['registrations']) / $visitsToday, 2).' %' : '-').''.($visitsToday ? round(100 * (int)($row['countOrders']) / $visitsToday, 2).' %' : '-').''.Tools::displayPrice($discountToday, $currency).''.Tools::displayPrice($totalHT, $currency).'
        '.$this->l('Visits').''.$this->l('Reg.').''.$this->l('Orders').''.$this->l('Items').''.$this->l('% Reg.').''.$this->l('% Orders').''.$this->l('Coupons').''.$this->l('Products Sales').'
        '.$this->l('Total').''.(int)($this->t1).''.(int)($this->t2).''.(int)($this->t3).''.(int)($this->t4).'----'.Tools::displayPrice($this->t7, $currency).''.Tools::displayPrice($this->t8, $currency).'
        '.$this->l('Average').''.(int)($this->t1 / $intervalAvg).''.(int)($this->t2 / $intervalAvg).''.(int)($this->t3 / $intervalAvg).''.(int)($this->t4 / $intervalAvg).''.($this->t1 ? round(100 * $this->t2 / $this->t1, 2) .' %' : '-').''.($this->t1 ? round(100 * $this->t3 / $this->t1, 2) .' %' : '-').''.Tools::displayPrice($this->t7 / $intervalAvg, $currency).''.Tools::displayPrice($this->t8 / $intervalAvg, $currency).'
        '.$this->l('Forecast').''.(int)($this->t1 * $prop30).''.(int)($this->t2 * $prop30).''.(int)($this->t3 * $prop30).''.(int)($this->t4 * $prop30).'----'.Tools::displayPrice($this->t7 * $prop30, $currency).''.Tools::displayPrice($this->t8 * $prop30, $currency).'
        +
        '; + + $ca = $this->getRealCA(); + + $visitors = Db::getInstance()->getValue('SELECT COUNT(DISTINCT id_guest) FROM '._DB_PREFIX_.'connections WHERE date_add BETWEEN '.ModuleGraph::getDateBetween()); + $customers = Db::getInstance()->getValue('SELECT COUNT(DISTINCT id_customer) FROM '._DB_PREFIX_.'connections c INNER JOIN '._DB_PREFIX_.'guest g ON c.id_guest = g.id_guest WHERE id_customer != 0 AND c.date_add BETWEEN '.ModuleGraph::getDateBetween()); + $carts = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'cart WHERE id_cart IN (SELECT id_cart FROM '._DB_PREFIX_.'cart_product) AND (date_add BETWEEN '.ModuleGraph::getDateBetween().' OR date_upd BETWEEN '.ModuleGraph::getDateBetween().')'); + $fullcarts = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'cart WHERE id_cart IN (SELECT id_cart FROM '._DB_PREFIX_.'cart_product) AND id_address_invoice != 0 AND (date_add BETWEEN '.ModuleGraph::getDateBetween().' OR date_upd BETWEEN '.ModuleGraph::getDateBetween().')'); + $orders = Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'orders WHERE valid = 1 AND date_add BETWEEN '.ModuleGraph::getDateBetween()); + + $this->_html .= '
         
        +
        '.$this->l('Conversion').' + '.$this->l('Visitors').'
        '.$visitors.'
        + +
        '.round(100 * $customers / max(1, $visitors)).' %
        +
        '.round(100 * $carts / max(1, $visitors)).' % +
        + + '.$this->l('Accounts').'
        '.$customers.'
        + '.$this->l('Carts').'
        '.$carts.' +
        + +
        '.round(100 * $fullcarts / max(1, $customers)).' %
        +
        '.round(100 * $fullcarts / max(1, $carts)).' %
        +
        + '.$this->l('Full carts').'
        '.$fullcarts.'
        +
        '.round(100 * $orders / max(1, $fullcarts)).' %
        + '.$this->l('Orders').'
        '.$orders.'
        +

        + '.$this->l('Registered visitors').' + + '.round(100 * $orders / max(1, $customers), 2).' % + + '.$this->l('Orders').' +
        + '.$this->l('Visitors').' + + '.round(100 * $orders / max(1, $visitors), 2).' % + + '.$this->l('Orders').' +
         
        + '.$this->l('Turn your visitors into money:').' +
        '.$this->l('Each visitor yields').' '.Tools::displayPrice($ca['ventil']['total'] / max(1, $visitors), $currency).'. +
        '.$this->l('Each registered visitor yields').' '.Tools::displayPrice($ca['ventil']['total'] / max(1, $customers), $currency).'. +
        '; + + $from = strtotime($employee->stats_date_from.' 00:00:00'); + $to = strtotime($employee->stats_date_to.' 23:59:59'); + $interval = ($to - $from) / 60 / 60 / 24; + $prop5000 = 5000 / 30 * $interval; + + $this->_html .= ' +
         
        '; + $this->_html .= '
        '.$this->l('Payment distibution').' +
        + + '.$this->l('Zone:').' +
        + + '; + foreach ($ca['payment'] as $payment) + $this->_html .= ' + + + + + + '; + $this->_html .= ' +
        '.$this->l('Module').''.$this->l('Count').''.$this->l('Total').''.$this->l('Cart').'
        '.$payment['module'].''.(int)($payment['nb']).'
        '.number_format((100 * $payment['nb'] / $ca['ventil']['nb']), 1, '.', ' ').' %
        '.Tools::displayPrice($payment['total'], $currency).'
        '.number_format((100 * $payment['total'] / $ca['ventil']['total']), 1, '.', ' ').' %
        '.Tools::displayPrice($payment['cart'], $currency).'
        +
        +
         
        +
        '.$this->l('Category distribution').' +
        + + '.$this->l('Zone:').' +
        + + '; + foreach ($ca['cat'] as $catrow) + $this->_html .= ' + + + + + + + + '; + $this->_html .= ' +
        '.$this->l('Category').''.$this->l('Count').''.$this->l('Sales').''.$this->l('% Count').''.$this->l('% Sales').''.$this->l('Avg price').'
        '.(empty($catrow['name']) ? $this->l('Unknown') : $catrow['name']).''.$catrow['orderQty'].''.Tools::displayPrice($catrow['orderSum'], $currency).''.number_format((100 * $catrow['orderQty'] / $this->t4), 1, '.', ' ').'%'.number_format((100 * $catrow['orderSum'] / $ca['ventil']['total']), 1, '.', ' ').'%'.Tools::displayPrice($catrow['priveAvg'], $currency).'
        +
        +
         
        +
        '.$this->l('Language distribution').' + + '; + foreach ($ca['lang'] as $ophone => $amount) + { + $percent = (int)($ca['langprev'][$ophone]) ? number_format((100 * $amount / $ca['langprev'][$ophone]) - 100, 1, '.', ' ') : '∞'; + $this->_html .= ' + + + + + + + '; + } + $this->_html .= ' +
        '.$this->l('Customers').''.$this->l('Sales').''.$this->l('%').''.$this->l('Growth').'
        '.$ophone.''.Tools::displayPrice($amount, $currency).''.($ca['ventil']['total'] ? number_format((100 * $amount / $ca['ventil']['total']), 1, '.', ' ').'%' : '-').''.(($percent > 0 OR $percent == '∞') ? '' : ' ').''.(($percent > 0 OR $percent == '∞') ? '+' : '').$percent.'%
        +
        +
         
        +
        '.$this->l('Zone distribution').' + + '; + foreach ($ca['zones'] as $zone) + $this->_html .= ' + + + + + + + '; + $this->_html .= ' +
        '.$this->l('Zone').''.$this->l('Count').''.$this->l('Total').''.$this->l('% Count').''.$this->l('% Sales').'
        '.(isset($zone['name']) ? $zone['name'] : $this->l('Undefined')).''.(int)($zone['nb']).''.Tools::displayPrice($zone['total'], $currency).''.number_format((100 * $zone['nb'] / $ca['ventil']['nb']), 1, '.', ' ').'%'.number_format((100 * $zone['total'] / $ca['ventil']['total']), 1, '.', ' ').'%
        +
        +
         
        +
        '.$this->l('Currency distribution').' +
        + + '.$this->l('Zone:').' +
        + + '; + foreach ($ca['currencies'] as $currencyRow) + $this->_html .= ' + + + + + + + '; + $this->_html .= ' +
        '.$this->l('Currency').''.$this->l('Count').''.$this->l('Sales (converted)').''.$this->l('% Count').''.$this->l('% Sales').'
        '.$currencyRow['name'].''.(int)($currencyRow['nb']).''.Tools::displayPrice($currencyRow['total'], $currency).''.number_format((100 * $currencyRow['nb'] / $ca['ventil']['nb']), 1, '.', ' ').'%'.number_format((100 * $currencyRow['total'] / $ca['ventil']['total']), 1, '.', ' ').'%
        +
        +
         
        +
        '.$this->l('Attribute distribution').' + + '; + foreach ($ca['attributes'] as $attribut) + $this->_html .= ' + + + + + '; + $this->_html .= '
        '.$this->l('Group').''.$this->l('Attribute').''.$this->l('Count').'
        '.$attribut['gname'].''.$attribut['aname'].''.(int)($attribut['total']).'
        +
        +
        '; + + return $this->_html; + } + + private function getRealCA() + { + global $cookie; + $employee = new Employee($cookie->id_employee); + + if ((int)$cookie->stats_id_zone) + { + $join = ' LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address LEFT JOIN `'._DB_PREFIX_.'country` co ON co.id_country = a.id_country'; + $where = ' AND co.id_zone = '.$cookie->stats_id_zone.' '; + } + + $ca = array(); + + $ca['cat'] = Db::getInstance()->ExecuteS(' + SELECT SUM(od.`product_price` * od.`product_quantity` / o.conversion_rate) as orderSum, COUNT(*) AS orderQty, cl.name, AVG(od.`product_price` / o.conversion_rate) as priveAvg + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order + LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.id_category_default = cl.id_category AND cl.id_lang = '.(int)($cookie->id_lang).') + '.((int)$cookie->stats_id_zone ? $join : '').' + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().' + '.((int)$cookie->stats_id_zone ? $where : '').' + GROUP BY p.id_category_default'); + uasort($ca['cat'], 'statsforecast_sort'); + + $langValues = ''; + $languages = Db::getInstance()->ExecuteS('SELECT id_lang, iso_code FROM `'._DB_PREFIX_.'lang` WHERE active = 1'); + foreach ($languages as $language) + $langValues .= 'SUM(IF(o.id_lang = '.(int)$language['id_lang'].', total_products / o.conversion_rate, 0)) as '.pSQL($language['iso_code']).','; + $langValues = rtrim($langValues, ','); + + $ca['lang'] = Db::getInstance()->getRow(' + SELECT '.$langValues.' + FROM `'._DB_PREFIX_.'orders` o + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween()); + arsort($ca['lang']); + + $ca['langprev'] = Db::getInstance()->getRow(' + SELECT '.$langValues.' + FROM `'._DB_PREFIX_.'orders` o + WHERE o.valid = 1 + AND ADDDATE(o.`invoice_date`, interval 30 day) BETWEEN \''.$employee->stats_date_from.' 00:00:00\' AND \''.min(date('Y-m-d H:i:s'), $employee->stats_date_to.' 23:59:59').'\''); + + $ca['payment'] = Db::getInstance()->ExecuteS(' + SELECT module, SUM(total_products / o.conversion_rate) as total, COUNT(*) as nb, AVG(total_products / o.conversion_rate) as cart + FROM `'._DB_PREFIX_.'orders` o + '.((int)$cookie->stats_id_zone ? $join : '').' + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().' + '.((int)$cookie->stats_id_zone ? $where : '').' + GROUP BY o.module + ORDER BY total DESC'); + + $ca['zones'] = Db::getInstance()->ExecuteS(' + SELECT z.name, SUM(o.total_products / o.conversion_rate) as total, COUNT(*) as nb + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address + LEFT JOIN `'._DB_PREFIX_.'country` c ON c.id_country = a.id_country + LEFT JOIN `'._DB_PREFIX_.'zone` z ON z.id_zone = c.id_zone + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY c.id_zone + ORDER BY total DESC'); + + $ca['currencies'] = Db::getInstance()->ExecuteS(' + SELECT cu.name, SUM(o.total_products / o.conversion_rate) as total, COUNT(*) as nb + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'currency` cu ON o.id_currency = cu.id_currency + '.((int)$cookie->stats_id_zone ? $join : '').' + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().' + '.((int)$cookie->stats_id_zone ? $where : '').' + GROUP BY o.id_currency + ORDER BY total DESC'); + + $ca['ventil'] = Db::getInstance()->getRow(' + SELECT SUM(total_products / o.conversion_rate) as total, COUNT(*) AS nb + FROM `'._DB_PREFIX_.'orders` o + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween()); + + $ca['attributes'] = Db::getInstance()->ExecuteS(' + SELECT /*pac.id_attribute,*/ agl.name as gname, al.name as aname, COUNT(*) as total + FROM '._DB_PREFIX_.'orders o + LEFT JOIN '._DB_PREFIX_.'order_detail od ON o.id_order = od.id_order + INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON od.product_attribute_id = pac.id_product_attribute + INNER JOIN '._DB_PREFIX_.'attribute a ON pac.id_attribute = a.id_attribute + INNER JOIN '._DB_PREFIX_.'attribute_group_lang agl ON (a.id_attribute_group = agl.id_attribute_group AND agl.id_lang = '.(int)($cookie->id_lang).') + INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (a.id_attribute = al.id_attribute AND al.id_lang = '.(int)($cookie->id_lang).') + WHERE o.valid = 1 + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY pac.id_attribute'); + + return $ca; + } +} + +function statsforecast_sort($a, $b) +{ + if ($a['orderSum'] == $b['orderSum']) + return 0; + return ($a['orderSum'] > $b['orderSum']) ? -1 : 1; +} + +?> diff --git a/modules/statsgeolocation/config.php b/modules/statsgeolocation/config.php new file mode 100644 index 000000000..21ade769d --- /dev/null +++ b/modules/statsgeolocation/config.php @@ -0,0 +1,110 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); + +function show_countries($id_lang, $nb_by_line = 7) +{ + if (!is_numeric($id_lang) || !is_numeric($nb_by_line)) + return ("error"); + + $output = ' + '; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.`id_country`, `name`, `iso_code` FROM `'._DB_PREFIX_.'country_lang` cl + LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = cl.`id_country` + WHERE `id_lang` = \''.(int)($id_lang).'\' ORDER BY `name` ASC;'); + $separator = 0; + foreach ($result as $index => $row) + { + if ($separator) + $output .= ($separator % $nb_by_line) ? ' | ' : '
        '; + $output .= ''.$row['name'] . ' (' . $row['iso_code'] . ')'; + $separator++; + } + return ($output); +} + +function show_buttons($id_lang, $id_country) +{ + if (!is_numeric($id_lang) || !is_numeric($id_country)) + return ("error"); + $coord_x = -1; + $coord_y = -1; + $output = ' + '; + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.`id_country`, `name`, `iso_code`, `x`, `y` FROM `'._DB_PREFIX_.'country_lang` cl + LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = cl.`id_country` + LEFT JOIN `'._DB_PREFIX_.'location_coords` lc ON c.`id_country` = lc.`id_country` + WHERE `id_lang` = \''.(int)($id_lang).'\' AND cl.`id_country`= \''.(int)($id_country).'\';'); + if (isset($result[0]['id_country'])) + { + $output .= $result[0]['name'].' ('.$result[0]['iso_code'].')'; + if (isset($result[0]['x']) && isset($result[0]['y'])) + { + $coord_x = $result[0]['x']; + $coord_y = $result[0]['y']; + } + } + $output .= ' + +
        +
        '; + return ($output); +} + +function insert_coords($id_lang, $id_country, $x, $y) +{ + if (!is_numeric($id_lang) || !is_numeric($id_country) || !is_numeric($x) || !is_numeric($y)) + return ("error"); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'location_coords` WHERE `id_country` = \''.$id_country.'\';'); + if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'location_coords` (`x`, `y`, `id_country`) VALUES (\''.(int)($x).'\', \''.(int)($y).'\', \''.(int)($id_country).'\');')) + echo("error while inserting data
        "); + return (show_countries($id_lang)); +} + + +$option = Tools::getValue('opt', 0); +$id_lang = Tools::getValue('id_lang'); + +if ($option == 1) +{ + echo show_countries($id_lang); +} +else if ($option == 2) +{ + $id_country = Tools::getValue('id_country'); + echo show_buttons($id_lang, $id_country); +} +else if ($option == 3) +{ + $id_country = Tools::getValue('id_country'); + $x = Tools::getValue('x'); + $y = Tools::getValue('y'); + echo insert_coords($id_lang, $id_country, $x, $y); +} + + diff --git a/modules/statsgeolocation/config.xml b/modules/statsgeolocation/config.xml new file mode 100755 index 000000000..90e48c551 --- /dev/null +++ b/modules/statsgeolocation/config.xml @@ -0,0 +1,11 @@ + + + statsgeolocation + Geolocation + 1 + Display your customers\' origin + PrestaShop + analytics_stats + 1 + 1 + \ No newline at end of file diff --git a/modules/statsgeolocation/de.php b/modules/statsgeolocation/de.php new file mode 100644 index 000000000..d96ae2c92 --- /dev/null +++ b/modules/statsgeolocation/de.php @@ -0,0 +1,18 @@ +statsgeolocation_323d4eb70b252acb4a04eaf9e0882597'] = 'Geotargeting'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_621bd20bc26d0f67bacffc7785616372'] = 'Anzeige des Kundenstandorts'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60503475047260bb2e6b815e3dcad910'] = 'Dieses Modul zeigt die Länderverteilung der Kunden durch Punkte in verschiedenen Größen auf der Weltkarte an. Zeigen Sie den Ruf Ihrer Webseite rund um die Welt an sowie die Kontinente, die Sie noch nicht erobert haben.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e346362c256cd1ff6efd70288f769d89'] = 'Ein Tor zur Welt'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_1b625393440dce51a25ccb43a38ddf67'] = 'Hinzufügen neuer Sprachen zu Ihrem Shop, wenn Sie sehen, dass ein ausreichender Teil Ihrer Kunden aus dem Ausland kommt.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_a2f24ad94046ee38db78c336564acd30'] = 'Vergrößern Sie Ihre Versand-Bereich, um der potenziellen Nachfrage gerecht zu werden.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_25e8f2fd2871c8423bbe4e254066cd98'] = 'Bitte warten ...'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e7173e323991c8c33ad2dae1d528fc2e'] = 'Koordinaten aktualisieren'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60e421611f85e8faa9f6950ce71dab7a'] = 'Klicken Sie auf einen Ländernamen und bestimmen Sie seine Position auf der Karte'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_64d80b7a177f4bd0a1f1dde09741852d'] = 'Klicken Sie auf die Karte, um die Position von einzustellen:'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_dc25612aeb2ba1c2705fc2e9c947f084'] = 'Fehler: Sie müssen auf die Karte klicken oder auf die Schaltfläche Abbrechen'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ad3d06d03d94223fa652babc913de686'] = 'Bestätigen'; diff --git a/modules/statsgeolocation/drawer.php b/modules/statsgeolocation/drawer.php new file mode 100644 index 000000000..a0489555f --- /dev/null +++ b/modules/statsgeolocation/drawer.php @@ -0,0 +1,90 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(dirname(__FILE__).'/../../config/config.inc.php'); +$img_path="./img/map.png"; + +function loadBaseImage($img_path) +{ + $img_size = getimagesize($img_path); + $img_png = imagecreatefrompng($img_path); if (!$img_png) exit(1); + + $img_tc = imagecreatetruecolor($img_size[0], $img_size[1]); + imagealphablending($img_tc, false); + imagesavealpha($img_tc, true); + imagecopy($img_tc, $img_png, 0, 0, 0, 0, $img_size[0], $img_size[1]); + imagedestroy($img_png); + + if (function_exists('imageantialias')) + imageantialias($img_tc, true); + return ($img_tc); +} + +function drawImage($image) +{ + header("Content-type: image/png"); + imagepng($image); + imagedestroy($image); +} + +function drawCircle($image, $x, $y, $size) +{ + $color = imagecolorallocate($image, 255, 122, 56); + imagefilledellipse($image, $x, $y, $size, $size, $color); +} + +function drawCircles($image) +{ + $max = 12; + $min = 2; + $gap = ($max - $min); + $total = getTotalElements(); + $result = getCoords(); + + foreach ($result as $row) + drawCircle($image, $row['x'], $row['y'], $min + ($gap * ($row['total'] / $total))); +} + +function getTotalElements() +{ + $result = Db::getInstance()->ExecuteS('SELECT COUNT(`id_address`) as total FROM `'._DB_PREFIX_.'address` WHERE deleted = 0 AND id_customer IS NOT NULL AND id_customer != 0'); + return (isset($result[0]) ? $result[0]['total'] : 0); +} + +function getCoords() +{ + return (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `x`, `y`, COUNT(`id_address`) AS total + FROM `'._DB_PREFIX_.'address` a + LEFT JOIN `'._DB_PREFIX_.'location_coords` lc ON lc.`id_country`=a.`id_country` + WHERE deleted = 0 AND id_customer IS NOT NULL AND id_customer != 0 + GROUP BY a.`id_country` + ORDER BY `total` DESC')); +} + +$image = loadBaseImage($img_path); +drawCircles($image); +drawImage($image); + diff --git a/modules/statsgeolocation/en.php b/modules/statsgeolocation/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsgeolocation/en.php @@ -0,0 +1,4 @@ +statsgeolocation_323d4eb70b252acb4a04eaf9e0882597'] = 'Loaclización'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_621bd20bc26d0f67bacffc7785616372'] = 'Muestre el origen de sus clientes'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60503475047260bb2e6b815e3dcad910'] = 'Este módulo muestra la distribución del país de sus clientes mostrando diversos puntos clasificados en el mapamundi mostrado abajo. Vea desde donde ven su tienda toda en el mundo y que continente no ha conquistado todavía.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e346362c256cd1ff6efd70288f769d89'] = 'Abrir al mundo'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_1b625393440dce51a25ccb43a38ddf67'] = 'Añada nuevos idiomas a su tienda si ve que gran parte de sus posibles clientes viene de un país extranjero.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_a2f24ad94046ee38db78c336564acd30'] = 'Aumente su área de envío para cubrir una demanda potencial.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_25e8f2fd2871c8423bbe4e254066cd98'] = 'Espere por favor..'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e7173e323991c8c33ad2dae1d528fc2e'] = 'Coordenadas de la actualización'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60e421611f85e8faa9f6950ce71dab7a'] = 'Haga clic sobre el país deseado para definir su posición en el mapa'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_64d80b7a177f4bd0a1f1dde09741852d'] = 'Haga clic en el mapa para definir la posición de:'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_dc25612aeb2ba1c2705fc2e9c947f084'] = 'Error: tiene que hacer clic en el mapa o en el botón cancelar'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ea4788705e6873b424c65e91c2846b19'] = 'Cancelar'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ad3d06d03d94223fa652babc913de686'] = 'Validar'; diff --git a/modules/statsgeolocation/fr.php b/modules/statsgeolocation/fr.php new file mode 100644 index 000000000..e8e8549aa --- /dev/null +++ b/modules/statsgeolocation/fr.php @@ -0,0 +1,18 @@ +statsgeolocation_323d4eb70b252acb4a04eaf9e0882597'] = 'Géolocalisation'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_621bd20bc26d0f67bacffc7785616372'] = 'Affiche la provenance de vos clients'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60503475047260bb2e6b815e3dcad910'] = 'Ce module montre la répartition de vos clients par un point plus ou moins gros sur la carte ci-dessous. Constatez la popularité qu\'a votre boutique à l\'échelle du monde et sachez quels continents vous n\'avez pas encore conquis.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e346362c256cd1ff6efd70288f769d89'] = 'S\'ouvrir au monde'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_1b625393440dce51a25ccb43a38ddf67'] = 'Ajoutez une nouvelle langue à votre boutique si vous constatez que suffisamment de clients viennent d\'un autre pays.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_a2f24ad94046ee38db78c336564acd30'] = 'Elargissez votre zone de livraison pour répondre à une potentielle demande.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_25e8f2fd2871c8423bbe4e254066cd98'] = 'Patientez...'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e7173e323991c8c33ad2dae1d528fc2e'] = 'Mise à jour des coordonnées'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60e421611f85e8faa9f6950ce71dab7a'] = 'Cliquez sur le nom d\'un pays puis sur la carte afin de définir son emplacement'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_64d80b7a177f4bd0a1f1dde09741852d'] = 'Cliquez sur la carte pour mettre à jour les coordonnées de :'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_dc25612aeb2ba1c2705fc2e9c947f084'] = 'Erreur : vous devez cliquer sur la carte ou sur le bouton Annuler'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ad3d06d03d94223fa652babc913de686'] = 'Valider'; diff --git a/modules/statsgeolocation/img/cross.png b/modules/statsgeolocation/img/cross.png new file mode 100644 index 000000000..c53f6810f Binary files /dev/null and b/modules/statsgeolocation/img/cross.png differ diff --git a/modules/statsgeolocation/img/map.png b/modules/statsgeolocation/img/map.png new file mode 100644 index 000000000..74504a206 Binary files /dev/null and b/modules/statsgeolocation/img/map.png differ diff --git a/modules/statsgeolocation/it.php b/modules/statsgeolocation/it.php new file mode 100644 index 000000000..290462549 --- /dev/null +++ b/modules/statsgeolocation/it.php @@ -0,0 +1,18 @@ +statsgeolocation_323d4eb70b252acb4a04eaf9e0882597'] = 'Geolocalizzazione'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_621bd20bc26d0f67bacffc7785616372'] = 'Mostra l\'origine dei tuoi clienti '; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60503475047260bb2e6b815e3dcad910'] = 'Questo modulo indica la distribuzione dei Paesi dei tuoi clienti, mostrando i diversi punti di grandezza sulla mappa mondiale sotto. Vedi la fama del tuo sito web in tutto il mondo e quale continente non hai ancora conquistato.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e346362c256cd1ff6efd70288f769d89'] = 'Apriti al mondo'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_1b625393440dce51a25ccb43a38ddf67'] = 'Aggiungi nuove lingue al tuo negozio se si vede che una parte sufficiente dei tuoi clienti provengono da un paese straniero.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_a2f24ad94046ee38db78c336564acd30'] = 'Amplia l\'area di spedizione per soddisfare la domanda potenziale.'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_25e8f2fd2871c8423bbe4e254066cd98'] = 'Si prega di attendere ...'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_e7173e323991c8c33ad2dae1d528fc2e'] = 'Aggiorna le coordinate'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_60e421611f85e8faa9f6950ce71dab7a'] = 'Clicca sul nome di un paese e definisci la sua posizione sulla mappa'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_64d80b7a177f4bd0a1f1dde09741852d'] = 'Clicca sulla mappa per impostare la posizione di:'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_dc25612aeb2ba1c2705fc2e9c947f084'] = 'Errore: devi cliccare sulla mappa o sul pulsante Annulla'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{statsgeolocation}prestashop>statsgeolocation_ad3d06d03d94223fa652babc913de686'] = 'Convalida'; diff --git a/modules/statsgeolocation/logo.gif b/modules/statsgeolocation/logo.gif new file mode 100644 index 000000000..5ae4d1d37 Binary files /dev/null and b/modules/statsgeolocation/logo.gif differ diff --git a/modules/statsgeolocation/statsgeolocation.js b/modules/statsgeolocation/statsgeolocation.js new file mode 100644 index 000000000..9064df82c --- /dev/null +++ b/modules/statsgeolocation/statsgeolocation.js @@ -0,0 +1,236 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function wait() +{ + var wait = document.getElementById('wait').value; + if (typeof(wait) == 'number') //should never appear... + wait="wait..."; + document.getElementById("belowmap").innerHTML=wait; +} + +/** + * Launch the url page in background and write its content in the selected div + */ +function doAjax(dataform) +{ + $.ajax({ + url: '../modules/statsgeolocation/config.php', + type: 'POST', + data: dataform, + dataType: 'html', + error: function() + { + $("#belowmap").html("Cannot load countries' list"); + }, + success: function(data) + { + $("#belowmap").html(data); + } + }); +} + +/** + * Show the cross in the map + */ +function displayMarker(x, y) +{ + var m = $("#marker").get(0); + var size = $('#marker_size').val(); + + m.style.display=''; + m.style.width=size+'px'; + m.style.height=size+'px'; + m.style.left=(x - (size/2))+'px'; + m.style.top=(y - (size/2))+'px'; + $("#form_x").val(x); + $("#form_y").val(y); +} + +/** + * For jQuery to register events on the different buttons + */ +_registerClickButtons=function() +{ + var x=$('#hiddenx').val(); + var y=$('#hiddeny').val(); + if (x != -1 && y != -1) + displayMarker(x, y); + $('#selectinfo').html($('#lang_info').val()); + $('#cancel_id').val($('#lang_cancel').val()); + $('#validate_id').val($('#lang_validate').val()); + $("#cancel_id").click(function() + { + var dataform="opt=1&id_lang="+$('#id_lang').val(); + wait(); + $('#opt').val(1); + document.getElementById("marker").style.display='none'; + doAjax(dataform); + }); + $("#validate_id").click(function() + { + if (document.getElementById("marker").style.display == 'none') + alert(document.getElementById("lang_error").value); + else + { + var dataform="opt=3&id_lang="+$('#id_lang').val()+"&id_country="+document.getElementById("country_selected").value; + dataform +="&x="+document.getElementById("form_x").value+"&y="+document.getElementById("form_y").value; + wait(); + $('#opt').val(1); + document.getElementById("marker").style.display='none'; + doAjax(dataform); + } + }); +} + +/** + * For jQuery to register events while clicking on a country + */ +_registerClickOnCountry=function() +{ + var dataform="opt=2&id_lang="+$('#id_lang').val(); + $('#country_selected').val(0); + + $(".country").click(function() + { + wait(); + $('#country_selected').val($(this).attr("id")); + dataform += "&id_country="+$(this).attr("id"); + doAjax(dataform); + }); +} + +/** + * The first thing jQuery should do once the fist page is loaded +*/ +_firstOfAll=function() +{ + var dataform="opt=1&id_lang=" + $('#id_lang').val(); + doAjax(dataform); +}; + +/** + * This is what happens when someone is doing a mouse click on the map + */ +function clickOnImage(event) +{ + if ($("#country_selected").val() != '0') + { + var e = event || window.event; + var pos = getRelativeCoordinates(event, $("#reference").get(0)); + var m = $("#marker").get(0); + displayMarker(pos.x, pos.y); + } +} + +/** + * Retrieve the absolute coordinates of an element. + * + * @param element + * A DOM element. + * @return + * A hash containing keys 'x' and 'y'. + */ +function getAbsolutePosition(element) +{ + var r = { x: element.offsetLeft, y: element.offsetTop }; + if (element.offsetParent) + { + var tmp = getAbsolutePosition(element.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +/** + * Retrieve the coordinates of the given event relative to the center + * of the widget. + * + * @param event + * A mouse-related DOM event. + * @param reference + * A DOM element whose position we want to transform the mouse coordinates to. + * @return + * A hash containing keys 'x' and 'y'. + */ +function getRelativeCoordinates(event, reference) +{ + var x, y; + event = event || window.event; + var el = event.target || event.srcElement; + + if (!window.opera && typeof event.offsetX != 'undefined') + { + // Use offset coordinates and find common offsetParent + var pos = { x: event.offsetX, y: event.offsetY }; + + // Send the coordinates upwards through the offsetParent chain. + var e = el; + while (e) + { + e.mouseX = pos.x; + e.mouseY = pos.y; + pos.x += e.offsetLeft; + pos.y += e.offsetTop; + e = e.offsetParent; + } + + // Look for the coordinates starting from the reference element. + var e = reference; + var offset = { x: 0, y: 0 } + while (e) + { + if (typeof e.mouseX != 'undefined') + { + x = e.mouseX - offset.x; + y = e.mouseY - offset.y; + break; + } + offset.x += e.offsetLeft; + offset.y += e.offsetTop; + e = e.offsetParent; + } + + // Reset stored coordinates + e = el; + while (e) + { + e.mouseX = undefined; + e.mouseY = undefined; + e = e.offsetParent; + } + } + else + { + // Use absolute coordinates + var pos = getAbsolutePosition(reference); + x = event.pageX - pos.x; + y = event.pageY - pos.y; + } + // Subtract distance to middle + return { x: x, y: y }; +} diff --git a/modules/statsgeolocation/statsgeolocation.php b/modules/statsgeolocation/statsgeolocation.php new file mode 100644 index 000000000..b2f1580f1 --- /dev/null +++ b/modules/statsgeolocation/statsgeolocation.php @@ -0,0 +1,192 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsGeoLocation extends Module +{ + private $_map_path = 'img/map.png'; + private $_cross_path = 'img/cross.png'; + + function __construct() + { + $this->name = 'statsgeolocation'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Geolocation'); + $this->description = $this->l('Display your customers\' origin'); + } + + function install() + { + $countries = array('AT' => array('x' => 294, 'y' => 68), + 'AU' => array('x' => 534, 'y' => 228), + 'BE' => array('x' => 276, 'y' => 62), + 'BO' => array('x' => 135, 'y' => 210), + 'CA' => array('x' => 84, 'y' => 45), + 'CH' => array('x' => 281, 'y' => 69), + 'CI' => array('x' => 253, 'y' => 156), + 'CN' => array('x' => 470, 'y' => 99), + 'CZ' => array('x' => 293, 'y' => 63), + 'DE' => array('x' => 285, 'y' => 61), + 'DK' => array('x' => 284, 'y' => 51), + 'ES' => array('x' => 260, 'y' => 85), + 'FI' => array('x' => 310, 'y' => 35), + 'FR' => array('x' => 271, 'y' => 69), + 'GB' => array('x' => 265, 'y' => 55), + 'GR' => array('x' => 308, 'y' => 87), + 'HK' => array('x' => 491, 'y' => 123), + 'IE' => array('x' => 253, 'y' => 58), + 'IL' => array('x' => 334, 'y' => 106), + 'IT' => array('x' => 292, 'y' => 80), + 'JP' => array('x' => 531, 'y' => 92), + 'KR' => array('x' => 509, 'y' => 93), + 'LU' => array('x' => 277, 'y' => 63), + 'NG' => array('x' => 282, 'y' => 153), + 'NL' => array('x' => 278, 'y' => 58), + 'NO' => array('x' => 283, 'y' => 41), + 'NZ' => array('x' => 590, 'y' => 264), + 'PL' => array('x' => 300, 'y' => 59), + 'PT' => array('x' => 251, 'y' => 86), + 'TG' => array('x' => 267, 'y' => 154), + 'SE' => array('x' => 294, 'y' => 40), + 'SG' => array('x' => 475, 'y' => 169), + 'US' => array('x' => 71, 'y' => 87), + 'ZA' => array('x' => 311, 'y' => 239)); + + if ( !parent::install() OR !$this->registerHook('AdminStatsModules')) + return false; + if (!Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'location_coords` ( + `id_location_coords` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `x` int(4) NOT NULL, + `y` int(4) NOT NULL, + `id_country` INTEGER UNSIGNED NOT NULL, + PRIMARY KEY(`id_location_coords`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) + return false; + + $flag = 0; + $query = 'INSERT INTO `'._DB_PREFIX_.'location_coords` (`x`, `y`, `id_country`) VALUES '; + $result = Db::getInstance()->ExecuteS('SELECT `id_country`, `iso_code` FROM `'._DB_PREFIX_.'country`;'); + foreach ($result as $index => $row) + { + if (isset($countries[$row['iso_code']])) + { + if ($flag) + $query .= ', '; + $query .= '(\''.$countries[$row['iso_code']]['x'].'\', \''.$countries[$row['iso_code']]['y'].'\', \''.$row['id_country'].'\')'; + $flag = 1; + } + } + return Db::getInstance()->Execute($query.';'); + } + + function uninstall() + { + if (!parent::uninstall()) + return false; + return (Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'location_coords`')); + } + + function hookAdminStatsModules() + { + $this->_html = ' +
        '.$this->displayName.' +
        +

        '.$this->l('This module shows the distribution of the countries of your customers by displaying different sized points on the worldmap below. See the fame of your website all around the world and which continent you have yet to conquer.').'

        +
        +

        + +

        + +

        +
        '.$this->l('Guide').' +

        '.$this->l('Open to the world').'

        +

        +

          +
        • '.$this->l('Add new languages to your shop if you see that a sufficient part of your customers come from a foreign country.').'
        • +
        • '.$this->l('Enlarge your shipping area to meet the potential demand.').'
        • +
        +

        +
        '; + return $this->_html; + } + + public function getContent() + { + $output = '

        '.$this->displayName.'

        '; + return $output.$this->displayForm(); + } + + public function displayForm() + { + global $cookie; + + $map_size; + $cross_size; + $id_lang = (isset($cookie->id_lang) ? (int)($cookie->id_lang) : Configuration::get('PS_LANG_DEFAULT')); + $wait = $this->l('Please wait...'); + + if ((file_exists('../modules/'.$this->name.'/'.$this->_map_path) == FALSE) || + (file_exists('../modules/'.$this->name.'/'.$this->_cross_path) == FALSE) || + (!($map_size = getimagesize('../modules/'.$this->name.'/'.$this->_map_path))) || + (!($cross_size = getimagesize('../modules/'.$this->name.'/'.$this->_cross_path)))) + return ("Error: cannot load images"); + + $output = ' + + +
        '.$this->l('Update coordinates').' +
        '.$this->l('Click on a country\'s name and define its position on the map').'

        +
        + +
        +
        '.$wait.'
        + + + + + + + + + + + + + +
        '; + return $output; + } +} + diff --git a/modules/statslive/config.xml b/modules/statslive/config.xml new file mode 100755 index 000000000..9a4b141a0 --- /dev/null +++ b/modules/statslive/config.xml @@ -0,0 +1,11 @@ + + + statslive + Visitors online + 1 + Display the list of customers and visitors currently online. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statslive/de.php b/modules/statslive/de.php new file mode 100644 index 000000000..90225581c --- /dev/null +++ b/modules/statslive/de.php @@ -0,0 +1,22 @@ +statslive_fa55230e9791f2b71322869318a5f00f'] = 'Besucher online'; +$_MODULE['<{statslive}prestashop>statslive_b8a5ea9b6e7f2d0b56fbb18e5b6b9246'] = 'Zeigt eine Liste der Kunden und Besucher, die zur Zeit online sind'; +$_MODULE['<{statslive}prestashop>statslive_fd42d96861238b1cd5859585c4351eca'] = 'Sie müssen die Option \"Seitenaufrufe für jeden Kunden\" im \"Statistik Datamining\"-Modul aktivieren, um die Seiten zu sehen, die derzeit von Ihren Kunden eingesehen werden.'; +$_MODULE['<{statslive}prestashop>statslive_5c948349bdf1a7a77ba54497d019e4ca'] = 'Kunden online'; +$_MODULE['<{statslive}prestashop>statslive_66c4c5112f455a19afde47829df363fa'] = 'Gesamt:'; +$_MODULE['<{statslive}prestashop>statslive_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statslive}prestashop>statslive_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statslive}prestashop>statslive_f88589c3e803217e3f6fe9d8e740e6e8'] = 'Aktuelle Seite'; +$_MODULE['<{statslive}prestashop>statslive_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; +$_MODULE['<{statslive}prestashop>statslive_bc59449a563c905a40eb3c871bb36d03'] = 'Zur Zeit sind keine Kunden online.'; +$_MODULE['<{statslive}prestashop>statslive_adb831a7fdd83dd1e2a309ce7591dff8'] = 'Besucher'; +$_MODULE['<{statslive}prestashop>statslive_a12a3079e14ced46e69ba52b8a90b21a'] = 'IP'; +$_MODULE['<{statslive}prestashop>statslive_38c50b731f70abc42c8baa3e7399b413'] = 'Seit'; +$_MODULE['<{statslive}prestashop>statslive_13aa8652e950bb7c4b9b213e6d8d0dc5'] = 'Aktuelle Seite'; +$_MODULE['<{statslive}prestashop>statslive_b6f05e5ddde1ec63d992d61144452dfa'] = 'Referrer'; +$_MODULE['<{statslive}prestashop>statslive_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Undefiniert'; +$_MODULE['<{statslive}prestashop>statslive_334c4a4c42fdb79d7ebc3e73b517e6f8'] = 'nichts'; +$_MODULE['<{statslive}prestashop>statslive_a55533db46597bee3cd16899c007257e'] = 'Zur Zeit sind keine Besucher online.'; diff --git a/modules/statslive/en.php b/modules/statslive/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statslive/en.php @@ -0,0 +1,4 @@ +statslive_fa55230e9791f2b71322869318a5f00f'] = 'Visitantes en línea'; +$_MODULE['<{statslive}prestashop>statslive_b8a5ea9b6e7f2d0b56fbb18e5b6b9246'] = 'Mostrar la lista de clientes y visitantes conectados'; +$_MODULE['<{statslive}prestashop>statslive_fd42d96861238b1cd5859585c4351eca'] = 'Debe activar la opción \"páginas vistas por cada cliente\" en el módulo \"Recuperación de datos estadíisticos\" para visualizar las páginas consultadas por sus clientes.'; +$_MODULE['<{statslive}prestashop>statslive_5c948349bdf1a7a77ba54497d019e4ca'] = 'Clientes en línea'; +$_MODULE['<{statslive}prestashop>statslive_66c4c5112f455a19afde47829df363fa'] = 'Total:'; +$_MODULE['<{statslive}prestashop>statslive_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statslive}prestashop>statslive_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statslive}prestashop>statslive_f88589c3e803217e3f6fe9d8e740e6e8'] = 'Página en curso'; +$_MODULE['<{statslive}prestashop>statslive_4351cfebe4b61d8aa5efa1d020710005'] = 'Vista'; +$_MODULE['<{statslive}prestashop>statslive_bc59449a563c905a40eb3c871bb36d03'] = 'No hay clientes en línea'; +$_MODULE['<{statslive}prestashop>statslive_adb831a7fdd83dd1e2a309ce7591dff8'] = 'Visitante'; +$_MODULE['<{statslive}prestashop>statslive_a12a3079e14ced46e69ba52b8a90b21a'] = 'IP'; +$_MODULE['<{statslive}prestashop>statslive_38c50b731f70abc42c8baa3e7399b413'] = 'Desde'; +$_MODULE['<{statslive}prestashop>statslive_13aa8652e950bb7c4b9b213e6d8d0dc5'] = 'Página en curso'; +$_MODULE['<{statslive}prestashop>statslive_b6f05e5ddde1ec63d992d61144452dfa'] = 'origen'; +$_MODULE['<{statslive}prestashop>statslive_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indefinido'; +$_MODULE['<{statslive}prestashop>statslive_334c4a4c42fdb79d7ebc3e73b517e6f8'] = 'ninguno'; +$_MODULE['<{statslive}prestashop>statslive_a55533db46597bee3cd16899c007257e'] = 'No hay visitantes en línea ahora.'; diff --git a/modules/statslive/fr.php b/modules/statslive/fr.php new file mode 100644 index 000000000..273aa7662 --- /dev/null +++ b/modules/statslive/fr.php @@ -0,0 +1,22 @@ +statslive_fa55230e9791f2b71322869318a5f00f'] = 'Visiteurs en ligne'; +$_MODULE['<{statslive}prestashop>statslive_b8a5ea9b6e7f2d0b56fbb18e5b6b9246'] = 'Affiche la liste des clients et visiteurs en ligne actuellement'; +$_MODULE['<{statslive}prestashop>statslive_fd42d96861238b1cd5859585c4351eca'] = 'Vous devez activer l\'option \"pages vues pour chaque client\" dans le module \"Récupération des données statistiques\" pour visualiser les pages consultées par vos clients.'; +$_MODULE['<{statslive}prestashop>statslive_5c948349bdf1a7a77ba54497d019e4ca'] = 'Clients en ligne'; +$_MODULE['<{statslive}prestashop>statslive_66c4c5112f455a19afde47829df363fa'] = 'Total :'; +$_MODULE['<{statslive}prestashop>statslive_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statslive}prestashop>statslive_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statslive}prestashop>statslive_f88589c3e803217e3f6fe9d8e740e6e8'] = 'Page en cours'; +$_MODULE['<{statslive}prestashop>statslive_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{statslive}prestashop>statslive_bc59449a563c905a40eb3c871bb36d03'] = 'Il n\'y a aucun client en ligne en ce moment.'; +$_MODULE['<{statslive}prestashop>statslive_adb831a7fdd83dd1e2a309ce7591dff8'] = 'Visiteur'; +$_MODULE['<{statslive}prestashop>statslive_a12a3079e14ced46e69ba52b8a90b21a'] = 'IP'; +$_MODULE['<{statslive}prestashop>statslive_38c50b731f70abc42c8baa3e7399b413'] = 'Depuis'; +$_MODULE['<{statslive}prestashop>statslive_13aa8652e950bb7c4b9b213e6d8d0dc5'] = 'Page en cours'; +$_MODULE['<{statslive}prestashop>statslive_b6f05e5ddde1ec63d992d61144452dfa'] = 'Origine'; +$_MODULE['<{statslive}prestashop>statslive_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indéfini'; +$_MODULE['<{statslive}prestashop>statslive_334c4a4c42fdb79d7ebc3e73b517e6f8'] = '- accès direct -'; +$_MODULE['<{statslive}prestashop>statslive_a55533db46597bee3cd16899c007257e'] = 'Il n\'y a aucun visiteur en ligne actuellement.'; diff --git a/modules/statslive/it.php b/modules/statslive/it.php new file mode 100644 index 000000000..ecb47ae11 --- /dev/null +++ b/modules/statslive/it.php @@ -0,0 +1,22 @@ +statslive_fa55230e9791f2b71322869318a5f00f'] = 'Visitatori online'; +$_MODULE['<{statslive}prestashop>statslive_b8a5ea9b6e7f2d0b56fbb18e5b6b9246'] = 'Visualizza l\'elenco dei clienti e dei visitatori online'; +$_MODULE['<{statslive}prestashop>statslive_fd42d96861238b1cd5859585c4351eca'] = 'È necessario attivare l\'opzione \"pagine viste per ogni cliente\" nel modulo \"recupero dei dati statistici\" per visualizzare le pagine attualmente viste dai suoi clienti.'; +$_MODULE['<{statslive}prestashop>statslive_5c948349bdf1a7a77ba54497d019e4ca'] = 'Clienti online'; +$_MODULE['<{statslive}prestashop>statslive_66c4c5112f455a19afde47829df363fa'] = 'Totale:'; +$_MODULE['<{statslive}prestashop>statslive_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statslive}prestashop>statslive_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statslive}prestashop>statslive_f88589c3e803217e3f6fe9d8e740e6e8'] = 'Pagina corrente'; +$_MODULE['<{statslive}prestashop>statslive_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; +$_MODULE['<{statslive}prestashop>statslive_bc59449a563c905a40eb3c871bb36d03'] = 'Non ci sono clienti online adesso.'; +$_MODULE['<{statslive}prestashop>statslive_adb831a7fdd83dd1e2a309ce7591dff8'] = 'Ospite'; +$_MODULE['<{statslive}prestashop>statslive_a12a3079e14ced46e69ba52b8a90b21a'] = 'IP'; +$_MODULE['<{statslive}prestashop>statslive_38c50b731f70abc42c8baa3e7399b413'] = 'Da'; +$_MODULE['<{statslive}prestashop>statslive_13aa8652e950bb7c4b9b213e6d8d0dc5'] = 'Pagina corrente'; +$_MODULE['<{statslive}prestashop>statslive_b6f05e5ddde1ec63d992d61144452dfa'] = 'Referente'; +$_MODULE['<{statslive}prestashop>statslive_ec0fc0100c4fc1ce4eea230c3dc10360'] = 'Indefinito'; +$_MODULE['<{statslive}prestashop>statslive_334c4a4c42fdb79d7ebc3e73b517e6f8'] = 'nessuno'; +$_MODULE['<{statslive}prestashop>statslive_a55533db46597bee3cd16899c007257e'] = 'Non ci sono visitatori online adesso.'; diff --git a/modules/statslive/logo.gif b/modules/statslive/logo.gif new file mode 100644 index 000000000..7e2e980c1 Binary files /dev/null and b/modules/statslive/logo.gif differ diff --git a/modules/statslive/statslive.php b/modules/statslive/statslive.php new file mode 100644 index 000000000..2c8990612 --- /dev/null +++ b/modules/statslive/statslive.php @@ -0,0 +1,154 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsLive extends Module +{ + function __construct() + { + $this->name = 'statslive'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Visitors online'); + $this->description = $this->l('Display the list of customers and visitors currently online.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + private function getCustomersOnline() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT u.id_customer, u.firstname, u.lastname, pt.name as page + FROM `'._DB_PREFIX_.'connections` c + LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections + LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page = cp.id_page + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.id_page_type = pt.id_page_type + INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer + WHERE cp.`time_end` IS NULL + AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 + GROUP BY c.id_connections + ORDER BY u.firstname, u.lastname'); + } + + private function getVisitorsOnline() + { + if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, pt.name as page + FROM `'._DB_PREFIX_.'connections` c + LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections + LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page = cp.id_page + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.id_page_type = pt.id_page_type + INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + WHERE (g.id_customer IS NULL OR g.id_customer = 0) + AND cp.`time_end` IS NULL + AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 + GROUP BY c.id_connections + ORDER BY c.date_add DESC'); + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer + FROM `'._DB_PREFIX_.'connections` c + INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + WHERE (g.id_customer IS NULL OR g.id_customer = 0) + AND TIME_TO_SEC(TIMEDIFF(NOW(), c.`date_add`)) < 900 + ORDER BY c.date_add DESC'); + } + + public function hookAdminStatsModules($params) + { + global $cookie; + + $customers = $this->getCustomersOnline(); + $totalCustomers = Db::getInstance()->NumRows(); + $visitors = $this->getVisitorsOnline(); + $totalVisitors = Db::getInstance()->NumRows(); + $irow = 0; + + echo ''; + if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + echo '
        '.$this->l('You must activate the option "pages views for each customer" in the "Stats datamining" module in order to see the pages currently viewed by your customers.').'
        '; + echo ' +
        '.$this->l('Customers online').''; + if ($totalCustomers) + { + echo $this->l('Total:').' '.(int)($totalCustomers).' + + '; + foreach ($customers as $customer) + echo ' + + + + + + '; + echo '
        '.$this->l('ID').''.$this->l('Name').''.$this->l('Current Page').''.$this->l('View').'
        '.$customer['id_customer'].''.$customer['firstname'].' '.$customer['lastname'].''.$customer['page'].' + + + +
        '; + } + else + echo $this->l('There are no cusomers online.'); + echo '
        +
        '.$this->l('Visitors online').''; + if ($totalVisitors) + { + echo $this->l('Total:').' '.(int)($totalVisitors).' +
        + + '; + foreach ($visitors as $visitor) + echo ' + + + + + + '; + echo '
        '.$this->l('Guest').''.$this->l('IP').''.$this->l('Since').''.$this->l('Current page').''.$this->l('Referrer').'
        '.$visitor['id_guest'].''.long2ip($visitor['ip_address']).''.substr($visitor['date_add'], 11).''.(isset($visitor['page']) ? $visitor['page'] : $this->l('Undefined')).''.(empty($visitor['http_referer']) ? $this->l('none') : parse_url($visitor['http_referer'], PHP_URL_HOST)).'
        '; + } + else + echo $this->l('There are no visitors online.'); + echo '
        '; + } +} + + diff --git a/modules/statsnewsletter/config.xml b/modules/statsnewsletter/config.xml new file mode 100755 index 000000000..d18d30a12 --- /dev/null +++ b/modules/statsnewsletter/config.xml @@ -0,0 +1,11 @@ + + + statsnewsletter + Newsletter + 1 + Display the newsletter registrations + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsnewsletter/de.php b/modules/statsnewsletter/de.php new file mode 100644 index 000000000..28d221ab1 --- /dev/null +++ b/modules/statsnewsletter/de.php @@ -0,0 +1,15 @@ +statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Newsletter-Anmeldung anzeigen'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Anmeldungen von Kunden:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Anmeldungen von Besuchern:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Beide:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Modul Newsletter Block muss installiert sein'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Newsletter Statistik'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Kunden'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Beide'; diff --git a/modules/statsnewsletter/en.php b/modules/statsnewsletter/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsnewsletter/en.php @@ -0,0 +1,4 @@ +statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Mostrar suscripciones a la newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Suscripciones de clientes:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Suscripciones de visitantes'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'ambos:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'El módulo bloque newsletter debe instalarse'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'estadísticas de la newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clientes '; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Ambos'; diff --git a/modules/statsnewsletter/fr.php b/modules/statsnewsletter/fr.php new file mode 100644 index 000000000..6dd27ccac --- /dev/null +++ b/modules/statsnewsletter/fr.php @@ -0,0 +1,15 @@ +statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Affiche les inscriptions à la newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Inscriptions depuis le compte client :'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Inscriptions depuis le block sur le front office :'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Les deux :'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Le module block newsletter doit être installé'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Statistiques de la newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clients'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Les deux'; diff --git a/modules/statsnewsletter/it.php b/modules/statsnewsletter/it.php new file mode 100644 index 000000000..fa7d39cad --- /dev/null +++ b/modules/statsnewsletter/it.php @@ -0,0 +1,15 @@ +statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Visualizza le iscrizioni alla newsletter'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Iscrizioni da parte dei clienti:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Iscrizioni da parte dei visitatori:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Entrambi:'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Il modulo del blocco Newsletter deve essere installato'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Statistiche Newsletter '; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clienti'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori'; +$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Entrambi'; diff --git a/modules/statsnewsletter/logo.gif b/modules/statsnewsletter/logo.gif new file mode 100644 index 000000000..06dd879da Binary files /dev/null and b/modules/statsnewsletter/logo.gif differ diff --git a/modules/statsnewsletter/statsnewsletter.php b/modules/statsnewsletter/statsnewsletter.php new file mode 100644 index 000000000..eedf34e08 --- /dev/null +++ b/modules/statsnewsletter/statsnewsletter.php @@ -0,0 +1,149 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsNewsletter extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + private $_option = ''; + + function __construct() + { + $this->name = 'statsnewsletter'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Newsletter'); + $this->description = $this->l('Display the newsletter registrations'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + if(Module::isInstalled('blocknewsletter')) + { + $totals = $this->getTotals(); + if (Tools::getValue('export')) + $this->csvExport(array('type' => 'line', 'layers' => 3)); + $this->_html = ' +
        '.$this->displayName.' +

        '.$this->l('Registrations from customers:').' '.(int)($totals['customers']).'

        +

        '.$this->l('Registrations from visitors:').' '.(int)($totals['visitors']).'

        +

        '.$this->l('Both:').' '.(int)($totals['both']).'

        +
        '.ModuleGraph::engine(array('type' => 'line', 'layers' => 3)).'
        +

        '.$this->l('CSV Export').'

        +
        '; + } + else + $this->_html = '

        '.$this->l('Module Newsletter Block must be installed').'

        '; + + return $this->_html; + } + + private function getTotals() + { + $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(*) as customers + FROM `'._DB_PREFIX_.'customer` c + WHERE c.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween()); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(*) as visitors + FROM '._DB_PREFIX_.'newsletter n + WHERE n.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween()); + return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']); + } + + protected function getData($layers) + { + $this->_titles['main'][0] = $this->l('Newsletter statistics'); + $this->_titles['main'][1] = $this->l('Customers'); + $this->_titles['main'][2] = $this->l('Visitors'); + $this->_titles['main'][3] = $this->l('Both'); + + $this->_query = ' + SELECT c.newsletter_date_add + FROM `'._DB_PREFIX_.'customer` c + WHERE c.`newsletter_date_add` BETWEEN '; + $this->_query2 = ' + SELECT n.newsletter_date_add + FROM '._DB_PREFIX_.'newsletter n + WHERE n.`newsletter_date_add` BETWEEN '; + $this->setDateGraph($layers, true); + } + + protected function setYearValues($layers) + { + $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate()); + foreach ($result1 AS $row) + $this->_values[0][(int)(substr($row['newsletter_date_add'], 5, 2))] += 1; + if ($result2) + foreach ($result2 AS $row) + $this->_values[1][(int)(substr($row['newsletter_date_add'], 5, 2))] += 1; + foreach ($this->_values[2] as $key => $zerofill) + $this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key]; + } + + protected function setMonthValues($layers) + { + $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate()); + foreach ($result1 AS $row) + $this->_values[0][(int)(substr($row['newsletter_date_add'], 8, 2))] += 1; + if ($result2) + foreach ($result2 AS $row) + $this->_values[1][(int)(substr($row['newsletter_date_add'], 8, 2))] += 1; + foreach ($this->_values[2] as $key => $zerofill) + $this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key]; + } + + protected function setDayValues($layers) + { + $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate()); + foreach ($result1 AS $row) + $this->_values[0][(int)(substr($row['newsletter_date_add'], 11, 2))] += 1; + if ($result2) + foreach ($result2 AS $row) + $this->_values[1][(int)(substr($row['newsletter_date_add'], 11, 2))] += 1; + foreach ($this->_values[2] as $key => $zerofill) + $this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key]; + } +} + + diff --git a/modules/statsorigin/config.xml b/modules/statsorigin/config.xml new file mode 100755 index 000000000..b254cfea0 --- /dev/null +++ b/modules/statsorigin/config.xml @@ -0,0 +1,11 @@ + + + statsorigin + Visitors origin + 1 + Display the websites your visitors come from. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsorigin/de.php b/modules/statsorigin/de.php new file mode 100644 index 000000000..1d7b248e7 --- /dev/null +++ b/modules/statsorigin/de.php @@ -0,0 +1,21 @@ +statsorigin_f0b1507c6bdcdefb60a0e6f9b89d4ae8'] = 'Herkunft des Besuchers'; +$_MODULE['<{statsorigin}prestashop>statsorigin_ada7786973910e9c8cb95f0450bf55c3'] = 'Anzeige der Webseiten, von denen Ihre Besucher kommen'; +$_MODULE['<{statsorigin}prestashop>statsorigin_14542f5997c4a02d4276da364657f501'] = 'Direkt-Link'; +$_MODULE['<{statsorigin}prestashop>statsorigin_3edf8ca26a1ec14dd6e91dd277ae1de6'] = 'Herkunft'; +$_MODULE['<{statsorigin}prestashop>statsorigin_b5c1b8a326be0d2fb25b3cf6da677d0e'] = 'Hier ist der Prozentsatz der 10 beliebtesten Referrer-Webseiten, über die Besucher zu Ihrem Shop gekommen sind.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsorigin}prestashop>statsorigin_96b0141273eabab320119c467cdcaf17'] = 'Insgesamt'; +$_MODULE['<{statsorigin}prestashop>statsorigin_0bebf95ee829c33f34fde535ed4ed100'] = 'Nur direkte Links'; +$_MODULE['<{statsorigin}prestashop>statsorigin_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsorigin}prestashop>statsorigin_64ae584c62d0992a911d52122ebefc9a'] = 'Was ist eine Referrer-Webseite?'; +$_MODULE['<{statsorigin}prestashop>statsorigin_77de261cf4c31a96146bcf1b52fd9856'] = 'Beim Besuch einer Webseite ist der Referrer die URL der vorherigen Webseite, von der ein Link folgte.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_d8d034b6911b1ce74bdb2158a14cd287'] = 'Ein Referrer informiert Sie darüber, welche Keywords Besucher in Suchmaschinen eingeben, wenn sie zu ihrem Shop kommen wollen, und optimiert damit auch Ihre Werbung im Web.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_af19c8da1c414055c960a73d86471119'] = 'Referrer können sein:'; +$_MODULE['<{statsorigin}prestashop>statsorigin_a3dec1a06e19a810a9a4884293f666d0'] = 'Jemand, der einen Link zu Ihrem Shop auf seiner Webseite hat'; +$_MODULE['<{statsorigin}prestashop>statsorigin_95b90f58e843b56885beabf4802676a9'] = 'Ein Partner, mit dem Sie Links getauscht haben, um die Verkäufe zu erhöhen oder Neukunden anzuziehen'; +$_MODULE['<{statsorigin}prestashop>statsorigin_7a82cc29e910ea0c07501d5fe809fd75'] = '10 erste Webseiten'; +$_MODULE['<{statsorigin}prestashop>statsorigin_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Andere'; diff --git a/modules/statsorigin/en.php b/modules/statsorigin/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsorigin/en.php @@ -0,0 +1,4 @@ +statsorigin_f0b1507c6bdcdefb60a0e6f9b89d4ae8'] = 'Procedencia de los visitantes'; +$_MODULE['<{statsorigin}prestashop>statsorigin_ada7786973910e9c8cb95f0450bf55c3'] = 'Muestra los sitios Web de los que proceden sus visitantes'; +$_MODULE['<{statsorigin}prestashop>statsorigin_14542f5997c4a02d4276da364657f501'] = 'Enlace directo'; +$_MODULE['<{statsorigin}prestashop>statsorigin_3edf8ca26a1ec14dd6e91dd277ae1de6'] = 'Origen'; +$_MODULE['<{statsorigin}prestashop>statsorigin_b5c1b8a326be0d2fb25b3cf6da677d0e'] = 'Porcentaje de los diez mejores sitios referentes por los que pasan los visitantes para acceder a su tienda.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsorigin}prestashop>statsorigin_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{statsorigin}prestashop>statsorigin_0bebf95ee829c33f34fde535ed4ed100'] = 'Enlaces directos solamente'; +$_MODULE['<{statsorigin}prestashop>statsorigin_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsorigin}prestashop>statsorigin_64ae584c62d0992a911d52122ebefc9a'] = '¿Cuál es el sitio web referente?'; +$_MODULE['<{statsorigin}prestashop>statsorigin_77de261cf4c31a96146bcf1b52fd9856'] = 'Cuando se visita una página web, el referente es la URL de la página web anterior desde la cual se siguió el enlace.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_d8d034b6911b1ce74bdb2158a14cd287'] = 'Un referente le permite saber qué palabras claves incorporan los visitantes en motores de búsqueda cuando intentan acceder a su tienda; y también optimizar su promoción en la Webrnrn'; +$_MODULE['<{statsorigin}prestashop>statsorigin_af19c8da1c414055c960a73d86471119'] = 'Un referente puede ser'; +$_MODULE['<{statsorigin}prestashop>statsorigin_a3dec1a06e19a810a9a4884293f666d0'] = 'Alguien ha puesto un link de su tienda en su sitio Web'; +$_MODULE['<{statsorigin}prestashop>statsorigin_95b90f58e843b56885beabf4802676a9'] = 'Un colaborador con quien intercambió enlaces para aumentar las ventas o para atraer nueva clientela. '; +$_MODULE['<{statsorigin}prestashop>statsorigin_7a82cc29e910ea0c07501d5fe809fd75'] = '10 primeros sitios web'; +$_MODULE['<{statsorigin}prestashop>statsorigin_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Otros'; diff --git a/modules/statsorigin/fr.php b/modules/statsorigin/fr.php new file mode 100644 index 000000000..e75dc33c5 --- /dev/null +++ b/modules/statsorigin/fr.php @@ -0,0 +1,21 @@ +statsorigin_f0b1507c6bdcdefb60a0e6f9b89d4ae8'] = 'Sites affluents'; +$_MODULE['<{statsorigin}prestashop>statsorigin_ada7786973910e9c8cb95f0450bf55c3'] = 'Affiche les sites d\'origine de vos visiteurs'; +$_MODULE['<{statsorigin}prestashop>statsorigin_14542f5997c4a02d4276da364657f501'] = 'Lien direct'; +$_MODULE['<{statsorigin}prestashop>statsorigin_3edf8ca26a1ec14dd6e91dd277ae1de6'] = 'Origine'; +$_MODULE['<{statsorigin}prestashop>statsorigin_b5c1b8a326be0d2fb25b3cf6da677d0e'] = 'Pourcentage des 10 meilleurs sites affluents par lesquels les visiteurs passent pour accéder à votre boutique.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsorigin}prestashop>statsorigin_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{statsorigin}prestashop>statsorigin_0bebf95ee829c33f34fde535ed4ed100'] = 'Liens directs uniquement'; +$_MODULE['<{statsorigin}prestashop>statsorigin_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsorigin}prestashop>statsorigin_64ae584c62d0992a911d52122ebefc9a'] = 'Qu\'est-ce qu\'un site affluent (référant) ?'; +$_MODULE['<{statsorigin}prestashop>statsorigin_77de261cf4c31a96146bcf1b52fd9856'] = 'Lorsqu\'un internaute visite une page web, le site affluent est l\'URL du lien qu\'a suivi le visiteur pour accéder à sa page web actuelle.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_d8d034b6911b1ce74bdb2158a14cd287'] = 'Un référant vous permet de savoir quels sont les mots clés tapés par les visiteurs dans les moteurs de recherche quand ils tentent d\'aller sur votre boutique; et ainsi d\'optimiser le référencement de votre boutique.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_af19c8da1c414055c960a73d86471119'] = 'Un référant peut être :'; +$_MODULE['<{statsorigin}prestashop>statsorigin_a3dec1a06e19a810a9a4884293f666d0'] = 'Quelqu\'un qui a mis un lien de votre boutique sur son site'; +$_MODULE['<{statsorigin}prestashop>statsorigin_95b90f58e843b56885beabf4802676a9'] = 'Un partenaire avec lequel vous avez fait un échange de lien visant à rapporter des ventes ou attirer de nouveaux clients'; +$_MODULE['<{statsorigin}prestashop>statsorigin_7a82cc29e910ea0c07501d5fe809fd75'] = '10 premiers sites'; +$_MODULE['<{statsorigin}prestashop>statsorigin_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Autres'; diff --git a/modules/statsorigin/it.php b/modules/statsorigin/it.php new file mode 100644 index 000000000..dd213a868 --- /dev/null +++ b/modules/statsorigin/it.php @@ -0,0 +1,21 @@ +statsorigin_f0b1507c6bdcdefb60a0e6f9b89d4ae8'] = 'Origine visitatori'; +$_MODULE['<{statsorigin}prestashop>statsorigin_ada7786973910e9c8cb95f0450bf55c3'] = 'Visualizzare i siti web da cui provengono i tuoi visitatori'; +$_MODULE['<{statsorigin}prestashop>statsorigin_14542f5997c4a02d4276da364657f501'] = 'Link diretto'; +$_MODULE['<{statsorigin}prestashop>statsorigin_3edf8ca26a1ec14dd6e91dd277ae1de6'] = 'Origine'; +$_MODULE['<{statsorigin}prestashop>statsorigin_b5c1b8a326be0d2fb25b3cf6da677d0e'] = 'Ecco la percentuale dei 10 siti più popolari di riferimento dai quali i visitatori hanno raggiunto il tuo negozio.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsorigin}prestashop>statsorigin_96b0141273eabab320119c467cdcaf17'] = 'Totale'; +$_MODULE['<{statsorigin}prestashop>statsorigin_0bebf95ee829c33f34fde535ed4ed100'] = 'Solo link diretti '; +$_MODULE['<{statsorigin}prestashop>statsorigin_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsorigin}prestashop>statsorigin_64ae584c62d0992a911d52122ebefc9a'] = 'Che cosa è un sito web di riferimento?'; +$_MODULE['<{statsorigin}prestashop>statsorigin_77de261cf4c31a96146bcf1b52fd9856'] = 'Quando si visita una pagina web, il riferimento è l\'URL della pagina web precedente da cui è stato seguito un link.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_d8d034b6911b1ce74bdb2158a14cd287'] = 'Un riferimento consente di sapere quali parole chiave sono state inserite dai visitatori nei motori di ricerca quando hanno cercato di raggiungere il tuo negozio, e anche per ottimizzare la promozione sul web.'; +$_MODULE['<{statsorigin}prestashop>statsorigin_af19c8da1c414055c960a73d86471119'] = 'Un riferimento può essere:'; +$_MODULE['<{statsorigin}prestashop>statsorigin_a3dec1a06e19a810a9a4884293f666d0'] = 'Qualcuno che mettere un link sul suo sito web verso il tuo negozio'; +$_MODULE['<{statsorigin}prestashop>statsorigin_95b90f58e843b56885beabf4802676a9'] = 'Un partner con cui hai fatto uno scambio di link al fine di aumentare le vendite o attirare nuovi clienti'; +$_MODULE['<{statsorigin}prestashop>statsorigin_7a82cc29e910ea0c07501d5fe809fd75'] = 'I primi 10 siti web '; +$_MODULE['<{statsorigin}prestashop>statsorigin_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Altri'; diff --git a/modules/statsorigin/logo.gif b/modules/statsorigin/logo.gif new file mode 100644 index 000000000..ae910c2b1 Binary files /dev/null and b/modules/statsorigin/logo.gif differ diff --git a/modules/statsorigin/statsorigin.php b/modules/statsorigin/statsorigin.php new file mode 100644 index 000000000..b041b2192 --- /dev/null +++ b/modules/statsorigin/statsorigin.php @@ -0,0 +1,147 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsOrigin extends ModuleGraph +{ + private $_html; + + function __construct() + { + $this->name = 'statsorigin'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Visitors origin'); + $this->description = $this->l('Display the websites your visitors come from.'); + } + + function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + private function getOrigins($dateBetween) + { + $directLink = $this->l('Direct link'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.http_referer + FROM '._DB_PREFIX_.'connections c + WHERE c.date_add BETWEEN '.$dateBetween, false); + $websites = array($directLink => 0); + while ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->nextRow($result)) + { + if (!isset($row['http_referer']) OR empty($row['http_referer'])) + ++$websites[$directLink]; + else + { + $website = preg_replace('/^www./', '', parse_url($row['http_referer'], PHP_URL_HOST)); + if (!isset($websites[$website])) + $websites[$website] = 1; + else + ++$websites[$website]; + } + } + arsort($websites); + return $websites; + } + + function hookAdminStatsModules() + { + $websites = $this->getOrigins(ModuleGraph::getDateBetween()); + if (Tools::getValue('export')) + if (Tools::getValue('exportType') == 'top') + $this->csvExport(array('type' => 'pie')); + $this->_html = '
        '.$this->l('Origin').''; + if (sizeof($websites)) + { + $this->_html .= ' +

        '. $this->l('Here is the percentage of the 10 most popular referrer websites by which visitors went through to get to your shop.').'

        + '.ModuleGraph::engine(array('type' => 'pie')).'
        +

        '.$this->l('CSV Export').'



        +
        +
        + + + + + '; + foreach ($websites as $website => $total) + $this->_html .= ''; + $this->_html .= '
        '.$this->l('Origin').''.$this->l('Total').'
        '.(!strstr($website, ' ') ? '' : '').$website.(!strstr($website, ' ') ? '' : '').''.$total.'
        '; + } + else + $this->_html .= '

        '.$this->l('Direct links only').'

        '; + $this->_html .= '

        +
        '.$this->l('Guide').' +

        '.$this->l('What is a referrer website?').'

        +

        + '.$this->l('When visiting a webpage, the referrer is the URL of the previous webpage from which a link was followed.').'
        + '.$this->l('A referrer enables you to know which keywords are entered by visitors in search engines when getting to your shop and allows you to optimize web promotion.').'

        + '. $this->l('A referrer can be:').' +

          +
        • '. $this->l('Someone who put a link on their website for your shop').'
        • +
        • '. $this->l('A partner with whom you made a link exchange in order to bring in sales or attract new customers').'
        • +
        +

        +
        '; + return $this->_html; + } + + protected function getData($layers) + { + $this->_titles['main'] = $this->l('First 10 websites'); + $websites = $this->getOrigins($this->getDate()); + $total = 0; + $total2 = 0; + $i = 0; + foreach ($websites as $website => $totalRow) + { + if (!$totalRow) + continue; + $total += $totalRow; + if ($i++ < 9) + { + $this->_legend[] = $website; + $this->_values[] = $totalRow; + $total2 += $totalRow; + } + } + if ($total != $total2) + { + $this->_legend[] = $this->l('Others'); + $this->_values[] = $total - $total2; + } + } +} + + diff --git a/modules/statspersonalinfos/config.xml b/modules/statspersonalinfos/config.xml new file mode 100755 index 000000000..abb637f00 --- /dev/null +++ b/modules/statspersonalinfos/config.xml @@ -0,0 +1,11 @@ + + + statspersonalinfos + Registered Customer Info + 1 + Display characteristics such as gender and age. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statspersonalinfos/de.php b/modules/statspersonalinfos/de.php new file mode 100644 index 000000000..3d09f4783 --- /dev/null +++ b/modules/statspersonalinfos/de.php @@ -0,0 +1,36 @@ +statspersonalinfos_8063f7c341dbe2cadc294a530cb1cad2'] = 'Information zu registrierten Kunden'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_ff9c34d2829b95a0936b22b409640143'] = 'Zeigt Merkmale wie Geschlecht und Alter an'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0df28a79b0b6ee5f2a91da83bb07117c'] = 'Mit der Geschlechterverteilung können Sie den Prozentsatz von Männern und Frauen unter Ihren Kunden zu bestimmen.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_66ea53c179f966ec08fc4710c60a85be'] = 'Mit den Altersklassen können Sie bestimmen, in welcher Altersklasse sich Ihre Kunden befinden.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_d053730180bf7c54024068ab2a2edf5c'] = 'Mit der Länderverteilung können Sie erkennen, in welchem Teil der Welt Ihre Kunden sind.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_bcfebaf66fa6f885171c63997e2613d5'] = 'Mit den Währungsbereichen können Sie erkennen, mit welcher Währung Ihre Kunden bezahlen.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e0c88fe08ea4e9b77760ed2429628dea'] = 'Mit der Sprachenverteilung können Sie die allgemeine Sprache, die Ihre Kunden in Ihrem Shop verwenden, erkennen.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7a7012cc5c52802b45aed45d1f616f1e'] = 'Noch keine Kunden registriert.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_3ca26e413e485538a7f3e610c0324636'] = 'Visieren Sie Ihre Zielgruppe an'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_c8eb1ba430d9ae8fe45fe2d990a481f5'] = 'Damit jede Nachricht ihre Wirkung erzielt, müssen Sie wissen,an wen sie gerichtet werden sollte.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_5beafb6329f9718aa46293a7433697e5'] = 'Auf die richtige Zielgruppe zu antworten ist entscheidend für die Wahl der richtigen Werkzeuge, um sie zu überzeugen.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f94ccd67cb072f87473491d409fe4c'] = 'Am besten ist es, Maßnahmen auf eine Gruppe oder Gruppen von Kunden zu begrenzen.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f94c9050d83dfc68894175207b330785'] = 'Informationen zu registrierten Kunden helfen Ihnen dabei, das typische Kundenprofil genauer zu bestimmen, so dass Sie Ihre Specials verschiedenen Kriterien anpassen können.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_72d2596650eeec0e4f630dd8841eb21e'] = 'Sie sollten diese Informationen zur Steigerung Ihrer Umsätze nutzen, indem Sie:'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_325004e2f6f72a36519c6a79bd59de74'] = 'Werbekampagnen starten, die an bestimmte Kunden gerichtet sind, welche an einem bestimmten Angebot interessiert sein könnten, zu bestimmten Daten und Zeiten'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7878438ad0cb68d43646e19bf8cda504'] = 'eine KundenGruppe per E-Mail / Newsletter kontaktieren.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_8dc514f6da8c696c4a522efc145ad28a'] = 'Geschlechterverteilung'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_63889cfb9d3cbe05d1bd2be5cc9953fd'] = 'Männlich'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_b719ce180ec7bd9641fece2f920f4817'] = 'Weiblich'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Unbekannt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0e8cb607499d7862540d5736f6ab84e3'] = 'Altersklassen'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_306fb378f025305fd17ec219fb193797'] = '0-18 Jahre alt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_95ad6a8434399a1020f496ae093394a1'] = '18-24 Jahre alt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_fb0d334f12a24f10715baef863e20db7'] = '25-34 Jahre alt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_268750725a2f1cba57267447006d22ef'] = '35-49 Jahre alt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_31974086ef82d676924acbb48fc3de1e'] = '50-59 Jahre alt'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f407fa37f8cd8c5900329882ad4529'] = '60 Jahre alt und älter'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_73b0130037e21b76351aebfd29d0b9aa'] = 'Länderverteilung'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_28e81c8343702f6c813cc31a7f90616a'] = 'Währungsverteilung'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Sprachenverteilung'; diff --git a/modules/statspersonalinfos/en.php b/modules/statspersonalinfos/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statspersonalinfos/en.php @@ -0,0 +1,4 @@ +statspersonalinfos_8063f7c341dbe2cadc294a530cb1cad2'] = 'Información de clientes registrados'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_ff9c34d2829b95a0936b22b409640143'] = 'Mostrar características como género y edad'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0df28a79b0b6ee5f2a91da83bb07117c'] = 'La distribución del género le permite determinar el porcentaje de hombres y de mujeres entre sus clientes.rnrn'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_66ea53c179f966ec08fc4710c60a85be'] = 'El rango de edades le permite determinar en qué gama de edades se encuentran sus clientes.rnrn'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_d053730180bf7c54024068ab2a2edf5c'] = 'La distribución por países le permite determinar en qué parte del mundo se encuentran sus clientes.rnrn'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_bcfebaf66fa6f885171c63997e2613d5'] = 'Las gamas de monedas le permiten determinar con que moneda pagan sus clientes.rnrn'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e0c88fe08ea4e9b77760ed2429628dea'] = 'La distribución por idiomas le permite determinar el idioma general que hablan los clientes de su tienda.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7a7012cc5c52802b45aed45d1f616f1e'] = 'Aún no hay clientes registrados'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_3ca26e413e485538a7f3e610c0324636'] = 'Seleccione su audiencia'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_c8eb1ba430d9ae8fe45fe2d990a481f5'] = 'Para que cada mensaje tenga un impacto, necesita saber a quien va dirigido.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_5beafb6329f9718aa46293a7433697e5'] = 'Dirigirse al público adecuado es primordial para elegir las herramientas correctas para convencer a cada uno de los públicos perseguidos'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f94ccd67cb072f87473491d409fe4c'] = 'Es preferible limitar la acción a un grupo o grupos de clientes.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f94c9050d83dfc68894175207b330785'] = 'La información de clientes registrados le permite definir con mas exactitud el perfil de cliente típico de modo que usted pueda adaptar sus ofertas a los diferentes criterios.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_72d2596650eeec0e4f630dd8841eb21e'] = 'Usted debe utilizar esta información para aumentar sus ventas:'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_325004e2f6f72a36519c6a79bd59de74'] = 'Lanzando campañas publicitarias dirigidas a clientes específicos que pudieran estar interesados en una oferta particular, en las fechas y horas específicas'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7878438ad0cb68d43646e19bf8cda504'] = 'Ponerse en contacto con un grupo de clientes por email o a través de la newsletter.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_8dc514f6da8c696c4a522efc145ad28a'] = 'Distribución del género'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_63889cfb9d3cbe05d1bd2be5cc9953fd'] = 'Hombre'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_b719ce180ec7bd9641fece2f920f4817'] = 'Mujer'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Desconocido'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0e8cb607499d7862540d5736f6ab84e3'] = 'Rango de edades'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_306fb378f025305fd17ec219fb193797'] = '0-18 años'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_95ad6a8434399a1020f496ae093394a1'] = '18-24 años'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_fb0d334f12a24f10715baef863e20db7'] = '25-34 años'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_268750725a2f1cba57267447006d22ef'] = '35-49 años'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_31974086ef82d676924acbb48fc3de1e'] = '50-59 años'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f407fa37f8cd8c5900329882ad4529'] = '60 años y más'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_73b0130037e21b76351aebfd29d0b9aa'] = 'distribución del país'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_28e81c8343702f6c813cc31a7f90616a'] = 'Distribución de la moneda'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Distribución del idioma'; diff --git a/modules/statspersonalinfos/fr.php b/modules/statspersonalinfos/fr.php new file mode 100644 index 000000000..c17bfdd8e --- /dev/null +++ b/modules/statspersonalinfos/fr.php @@ -0,0 +1,36 @@ +statspersonalinfos_8063f7c341dbe2cadc294a530cb1cad2'] = 'Informations clients'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_ff9c34d2829b95a0936b22b409640143'] = 'Affiche la répartition de vos clients par âge, sexe ou pays'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0df28a79b0b6ee5f2a91da83bb07117c'] = 'La répartition par genre vous permet de déterminer le pourcentage d\'hommes et de femmes parmis vos clients.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_66ea53c179f966ec08fc4710c60a85be'] = 'Les tranches d\'âges vous permettent de déterminer dans quelle tranche d\'âge se positionne votre clientèle.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_d053730180bf7c54024068ab2a2edf5c'] = 'La répartition par pays vous permet de déterminer dans quelle partie du monde sont vos clients.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_bcfebaf66fa6f885171c63997e2613d5'] = 'Les tranches de devise vous permettent de déterminer avec quelle devise vos clients payent.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e0c88fe08ea4e9b77760ed2429628dea'] = 'La répartition par langues vous permet de déterminer la langue qu\'utilisent généralement vos clients dans votre boutique.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7a7012cc5c52802b45aed45d1f616f1e'] = 'Aucun client enregistré pour le moment.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_3ca26e413e485538a7f3e610c0324636'] = 'Ciblez votre public'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_c8eb1ba430d9ae8fe45fe2d990a481f5'] = 'Pour que chacun de vos messages ait de l\'impact, il faut savoir à quelle clientèle vous vous adressez.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_5beafb6329f9718aa46293a7433697e5'] = 'S\'adresser au bon public est primordial afin de choisir les bons outils pour convaincre chacun des publics cibles.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f94ccd67cb072f87473491d409fe4c'] = 'Il est préférable de limiter son action à un ou plusieurs groupes de clients'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f94c9050d83dfc68894175207b330785'] = 'Les informations personnelles relatives aux clients vous permettent de mieux définir le profil du client type afin d\'adapter les promotions sur votre site en fonction des différents critères.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_72d2596650eeec0e4f630dd8841eb21e'] = 'Nous vous conseillons d\'utiliser cette information pour faire accroitre vos ventes : '; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_325004e2f6f72a36519c6a79bd59de74'] = 'Préparez une campagne de publicité destinée à un groupe de clients susceptible d\'être intéressé par une offre en particulier, puis diffusez la à des heures précises.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7878438ad0cb68d43646e19bf8cda504'] = 'Contactez ces groupes de clients par e-mail ou avec une liste de diffusion'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_8dc514f6da8c696c4a522efc145ad28a'] = 'Répartition par sexe'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_63889cfb9d3cbe05d1bd2be5cc9953fd'] = 'Homme'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_b719ce180ec7bd9641fece2f920f4817'] = 'Femme'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Inconnu'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0e8cb607499d7862540d5736f6ab84e3'] = 'Tranches d\'âges'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_306fb378f025305fd17ec219fb193797'] = '0-18 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_95ad6a8434399a1020f496ae093394a1'] = '18-24 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_fb0d334f12a24f10715baef863e20db7'] = '25-34 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_268750725a2f1cba57267447006d22ef'] = '35-49 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_31974086ef82d676924acbb48fc3de1e'] = '50-59 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f407fa37f8cd8c5900329882ad4529'] = '60 ans'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_73b0130037e21b76351aebfd29d0b9aa'] = 'Répartition par pays'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_28e81c8343702f6c813cc31a7f90616a'] = 'Répartition par devise'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Répartition par langue'; diff --git a/modules/statspersonalinfos/it.php b/modules/statspersonalinfos/it.php new file mode 100644 index 000000000..fdeb6dfc1 --- /dev/null +++ b/modules/statspersonalinfos/it.php @@ -0,0 +1,36 @@ +statspersonalinfos_8063f7c341dbe2cadc294a530cb1cad2'] = 'Info cliente registrato'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_ff9c34d2829b95a0936b22b409640143'] = 'Mostra caratteristiche come sesso ed età'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0df28a79b0b6ee5f2a91da83bb07117c'] = 'La distribuzione di sesso ti permette di determinare la percentuale di uomini e donne tra i tuoi clienti.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_66ea53c179f966ec08fc4710c60a85be'] = 'Le fasce di età ti permettono di determinare in quale fascia di età si trovano i tuoi clienti.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_d053730180bf7c54024068ab2a2edf5c'] = 'La distribuzione del paese ti permette di determinare da quale parte del mondo provengono i tuoi clienti.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_bcfebaf66fa6f885171c63997e2613d5'] = 'Le fasce di valuta ti permettono di determinare con quale valuta i tuoi clienti effettuano i pagamenti.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e0c88fe08ea4e9b77760ed2429628dea'] = 'La distribuzione delle lingue ti permette di determinare la lingua chei clienti usano nel tuo negozio.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7a7012cc5c52802b45aed45d1f616f1e'] = 'Nessun cliente ancora registrato.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_3ca26e413e485538a7f3e610c0324636'] = 'Raggiungi il tuo pubblico'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_c8eb1ba430d9ae8fe45fe2d990a481f5'] = 'Affinché ogni messaggio abbia un impatto, bisogna sapere a chi dovrebbe essere rivolto.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_5beafb6329f9718aa46293a7433697e5'] = 'Rivolgersi al pubblico giusto è fondamentale per poter scegliere gli strumenti giusti per conquistarlo.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f94ccd67cb072f87473491d409fe4c'] = 'E\' meglio limitare l\'azione ad un gruppo o gruppi di clienti.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f94c9050d83dfc68894175207b330785'] = 'Le informazioni sui clienti registrati consente di definire con maggiore precisione il profilo tipico del cliente in modo da poter adattare le tue caratteristiche a diversi criteri.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_72d2596650eeec0e4f630dd8841eb21e'] = 'Dovresti utilizzare queste informazioni per incrementare le vendite di:'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_325004e2f6f72a36519c6a79bd59de74'] = 'Avvio di campagne pubblicitarie rivolte a clienti specifici che potrebbero essere interessati a un\'offerta particolare, in date e orari specifici'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_7878438ad0cb68d43646e19bf8cda504'] = 'Contattare un gruppo di clienti via e-mail / newsletter.'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_8dc514f6da8c696c4a522efc145ad28a'] = 'Distribuzione di sesso'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_63889cfb9d3cbe05d1bd2be5cc9953fd'] = 'Maschio'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_b719ce180ec7bd9641fece2f920f4817'] = 'Femmina'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_88183b946cc5f0e8c96b2e66e1c74a7e'] = 'Sconosciuto'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_0e8cb607499d7862540d5736f6ab84e3'] = 'Fasce di età'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_306fb378f025305fd17ec219fb193797'] = '0-18 anni'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_95ad6a8434399a1020f496ae093394a1'] = '18-24 anni'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_fb0d334f12a24f10715baef863e20db7'] = '25-34 anni'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_268750725a2f1cba57267447006d22ef'] = '35-49 anni'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_31974086ef82d676924acbb48fc3de1e'] = '50-59 anni'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_e7f407fa37f8cd8c5900329882ad4529'] = '60 anni e più'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_73b0130037e21b76351aebfd29d0b9aa'] = 'Distribuzione per paese'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_28e81c8343702f6c813cc31a7f90616a'] = 'Distribuzione per valuta'; +$_MODULE['<{statspersonalinfos}prestashop>statspersonalinfos_f1dd68fb6a00d3e4d7f751deacde995d'] = 'Distribuzione per lingua'; diff --git a/modules/statspersonalinfos/logo.gif b/modules/statspersonalinfos/logo.gif new file mode 100644 index 000000000..899ecf561 Binary files /dev/null and b/modules/statspersonalinfos/logo.gif differ diff --git a/modules/statspersonalinfos/statspersonalinfos.php b/modules/statspersonalinfos/statspersonalinfos.php new file mode 100644 index 000000000..761a64a30 --- /dev/null +++ b/modules/statspersonalinfos/statspersonalinfos.php @@ -0,0 +1,266 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsPersonalInfos extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_option; + + function __construct() + { + $this->name = 'statspersonalinfos'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Registered Customer Info'); + $this->description = $this->l('Display characteristics such as gender and age.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + $this->_html = '
        '.$this->displayName.''; + if (sizeof(Customer::getCustomers())) + { + if (Tools::getValue('export')) + if (Tools::getValue('exportType') =='gender') + $this->csvExport(array('type' => 'pie', 'option' => 'gender')); + elseif (Tools::getValue('exportType') =='age') + $this->csvExport(array('type' => 'pie', 'option' => 'age')); + elseif (Tools::getValue('exportType') =='country') + $this->csvExport(array('type' => 'pie', 'option' => 'country')); + elseif (Tools::getValue('exportType') =='currency') + $this->csvExport(array('type' => 'pie', 'option' => 'currency')); + elseif (Tools::getValue('exportType') =='language') + $this->csvExport(array('type' => 'pie', 'option' => 'language')); + + $this->_html .= ' + +

        '.$this->l('Gender distribution allows you to determine the percentage of men and women among your customers.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'gender')).'
        +

        '.$this->l('CSV Export').'

        +

        +

        '.$this->l('Age ranges allows you to determine in which age range your customers are.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'age')).'
        +

        '.$this->l('CSV Export').'



        +

        '.$this->l('Country distribution allows you to determine in which part of the world your customers are shopping from.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'country')).'
        +

        '.$this->l('CSV Export').'



        +

        '.$this->l('Currency ranges allows you to determine which currencies your customers are using.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'currency')).'
        +

        '.$this->l('CSV Export').'



        +

        '.$this->l('Language distribution allows you to determine the general languages your customers are using on your shop.').'

        + '.ModuleGraph::engine(array('type' => 'pie', 'option' => 'language')).'
        +

        '.$this->l('CSV Export').'

        + '; + } + else + $this->_html .= '

        '.$this->l('No customers registered yet.').'

        '; + $this->_html .= ' +

        +
        '.$this->l('Guide').' +

        '.$this->l('Target your audience').'

        +

        + '.$this->l('In order for each message to have an impact, you need to know to whom it should be addressed.').' + '.$this->l('Addressing the right audience is essential for choosing the right tools to win them over.').' + '.$this->l('It is best to limit action to a group or groups of clients.').' + '.$this->l('Registered customer information allows you to accurately define the typical customer profile so that you can adapt your specials to various criteria.').' +


        +

        + '.$this->l('You should use this information to increase your sales by').' +

          +
        • '.$this->l('launching ad campaigns addressed to specific customers who might be interested in a particular offer at specific dates and times.').'
        • +
        • '.$this->l('Contacting a group of clients by e-mail / newsletter.').'
        • +
        +


        +
        '; + return $this->_html; + } + + public function setOption($option, $layers = 1) + { + $this->_option = $option; + } + + protected function getData($layers) + { + global $cookie; + + switch ($this->_option) + { + case 'gender': + $this->_titles['main'] = $this->l('Gender distribution'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`id_gender`, COUNT(c.`id_customer`) AS total + FROM `'._DB_PREFIX_.'customer` c + GROUP BY c.`id_gender`'); + $gender = array(1 => $this->l('Male'), 2 => $this->l('Female'), 9 => $this->l('Unknown'), 0 => $this->l('Unknown')); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $gender[$row['id_gender']]; + } + break; + case 'age': + $this->_titles['main'] = $this->l('Age ranges'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) < 18 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('0-18 years old'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) >= 18 + AND (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) < 25 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('18-24 years old'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) >= 25 + AND (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) < 35 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('25-34 years old'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) >= 35 + AND (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) < 50 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('35-49 years old'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) >= 50 + AND (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) < 60 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('50-59 years old'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE (YEAR(CURDATE()) - YEAR(c.`birthday`)) - (RIGHT(CURDATE(), 5) < RIGHT(c.`birthday`, 5)) >= 60 + AND c.`birthday` IS NOT NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('60 years old and more'); + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(c.`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` c + WHERE c.`birthday` IS NULL'); + if (isset($result['total']) AND $result['total']) + { + $this->_values[] = $result['total']; + $this->_legend[] = $this->l('Unknown'); + } + break; + case 'country': + $this->_titles['main'] = $this->l('Country distribution'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cl.`name`, COUNT(c.`id_country`) AS total + FROM `'._DB_PREFIX_.'address` a + LEFT JOIN `'._DB_PREFIX_.'country` c ON a.`id_country` = c.`id_country` + LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)($cookie->id_lang).') + WHERE a.id_customer != 0 + GROUP BY c.`id_country`'); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $row['name']; + } + break; + case 'currency': + $this->_titles['main'] = $this->l('Currency distribution'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`name`, COUNT(c.`id_currency`) AS total + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'currency` c ON o.`id_currency` = c.`id_currency` + GROUP BY c.`id_currency`'); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $row['name']; + } + break; + case 'language': + $this->_titles['main'] = $this->l('Language distribution'); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT c.`name`, COUNT(c.`id_lang`) AS total + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'lang` c ON o.`id_lang` = c.`id_lang` + GROUP BY c.`id_lang`'); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $row['name']; + } + break; + } + } +} + + diff --git a/modules/statsproduct/config.xml b/modules/statsproduct/config.xml new file mode 100755 index 000000000..5dd8aa0f9 --- /dev/null +++ b/modules/statsproduct/config.xml @@ -0,0 +1,11 @@ + + + statsproduct + Product details + 1 + Get detailed statistics for each product. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsproduct/de.php b/modules/statsproduct/de.php new file mode 100644 index 000000000..b2d463910 --- /dev/null +++ b/modules/statsproduct/de.php @@ -0,0 +1,39 @@ +statsproduct_78e454064a7d3a7755a011a3b79f31a7'] = 'Produktdetails'; +$_MODULE['<{statsproduct}prestashop>statsproduct_285201dab507840d082d58dc13602b00'] = 'Holen Sie sich detaillierte Statistiken für jedes Produkt'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3ec365dd533ddb7ef3d1c111186ce872'] = 'Details'; +$_MODULE['<{statsproduct}prestashop>statsproduct_981a6013008c8f4b75836b0f415b05b8'] = 'Insgesamt gekauft:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6780a9268e38d2ddd4f6c4a8ccf83d24'] = 'Verkäufe (-Tx):'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b262bbde88b3b8dca3b27d730aca69bf'] = 'Insgesamt angesehen:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_bebbab2c1ac732ccef4181f51ed52967'] = 'Umwandlungsrate:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsproduct}prestashop>statsproduct_c90b9dca2d3f5bb6e0d0bdceac8a631d'] = 'Attribute Umsatzverteilung'; +$_MODULE['<{statsproduct}prestashop>statsproduct_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{statsproduct}prestashop>statsproduct_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a240fa27925a635b08dc28c9e4f9216d'] = 'Bestellung'; +$_MODULE['<{statsproduct}prestashop>statsproduct_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{statsproduct}prestashop>statsproduct_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribut'; +$_MODULE['<{statsproduct}prestashop>statsproduct_03ab340b3f99e03cff9e84314ead38c0'] = 'Anz'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3601146c4e948c32b6424d2c0a7f0118'] = 'Preis'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Cross-Selling'; +$_MODULE['<{statsproduct}prestashop>statsproduct_df644ae155e79abf54175bd15d75f363'] = 'Produktname'; +$_MODULE['<{statsproduct}prestashop>statsproduct_2a0440eec72540c5b30d9199c01f348c'] = 'Verkaufte Menge '; +$_MODULE['<{statsproduct}prestashop>statsproduct_844c29394eea07066bb2efefc35784ec'] = 'Durchschnittlicher Preis'; +$_MODULE['<{statsproduct}prestashop>statsproduct_0173374ac20f5843d58b553d5b226ef6'] = 'Wählen Sie eine Kategorie'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3303da9d5241177588a06ad60d7edaba'] = 'Klicken Sie auf ein Produkt, um auf seine Statistiken zugreifen.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6ccf03bc05e4b749b74b5d577c7e7d3a'] = 'Produkte verfügbar'; +$_MODULE['<{statsproduct}prestashop>statsproduct_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{statsproduct}prestashop>statsproduct_27ce7f8b5623b2e2df568d64cf051607'] = 'Lager'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6c1a8292e4da90e1ef19ae9444226d8f'] = 'Anzahl der Käufe im Vergleich zur Anzahl der Aufrufe'; +$_MODULE['<{statsproduct}prestashop>statsproduct_1d0ba341c7847cbff109276485417a1c'] = 'Nach Auswahl einer Kategorie sowie eines verfügbaren Produkts in dieser Kategorie erscheinen einige Schaubilder. Diese können Sie analysieren.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6559cc601f073740b825a4fc9b76149b'] = 'Wenn Sie merken, dass ein Produkt erfolgreich ist, oft gekauft wird, aber auch selten angesehen wird, sollten Sie es weiter nach vorne in Ihren Webshop Front-Office setzen.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_20b9641efab51dee7d27eed2b6773ef0'] = 'Wenn aber ein Produkt oft aufgerufen, aber nicht gekauft wurde, raten wir Ihnen, diese Produktinformationen Beschreibungen und Fotografien zu überprüfen oder zu ändern.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_e22269bb51f9f2394e148716babbafbb'] = 'Beliebtheit'; +$_MODULE['<{statsproduct}prestashop>statsproduct_5e9613e58f3bdbc89b1fef07274c0877'] = 'Besuche (x100)'; +$_MODULE['<{statsproduct}prestashop>statsproduct_287234a1ff35a314b5b6bc4e5828e745'] = 'Attribute'; diff --git a/modules/statsproduct/en.php b/modules/statsproduct/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsproduct/en.php @@ -0,0 +1,4 @@ +statsproduct_78e454064a7d3a7755a011a3b79f31a7'] = 'Detalles del producto'; +$_MODULE['<{statsproduct}prestashop>statsproduct_285201dab507840d082d58dc13602b00'] = 'Conseguir las estadísticas detalladas para cada producto'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3ec365dd533ddb7ef3d1c111186ce872'] = 'Detalles'; +$_MODULE['<{statsproduct}prestashop>statsproduct_981a6013008c8f4b75836b0f415b05b8'] = 'Total de compras:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6780a9268e38d2ddd4f6c4a8ccf83d24'] = 'Volumen de ventas (sin IVA)'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b262bbde88b3b8dca3b27d730aca69bf'] = 'total visto:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_bebbab2c1ac732ccef4181f51ed52967'] = 'Índice de conversión'; +$_MODULE['<{statsproduct}prestashop>statsproduct_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsproduct}prestashop>statsproduct_c90b9dca2d3f5bb6e0d0bdceac8a631d'] = 'Distribuir las ventas por cualidades'; +$_MODULE['<{statsproduct}prestashop>statsproduct_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventas'; +$_MODULE['<{statsproduct}prestashop>statsproduct_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a240fa27925a635b08dc28c9e4f9216d'] = 'Pedido'; +$_MODULE['<{statsproduct}prestashop>statsproduct_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{statsproduct}prestashop>statsproduct_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Atributo'; +$_MODULE['<{statsproduct}prestashop>statsproduct_03ab340b3f99e03cff9e84314ead38c0'] = 'Cant.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3601146c4e948c32b6424d2c0a7f0118'] = 'Precio'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Ventas cruzadas'; +$_MODULE['<{statsproduct}prestashop>statsproduct_df644ae155e79abf54175bd15d75f363'] = 'Artículo'; +$_MODULE['<{statsproduct}prestashop>statsproduct_2a0440eec72540c5b30d9199c01f348c'] = 'Cantidad vendida'; +$_MODULE['<{statsproduct}prestashop>statsproduct_844c29394eea07066bb2efefc35784ec'] = 'Precio medio'; +$_MODULE['<{statsproduct}prestashop>statsproduct_0173374ac20f5843d58b553d5b226ef6'] = 'Elegir una categoría'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todas'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3303da9d5241177588a06ad60d7edaba'] = 'Haga clic en un producto para acceder a sus estadísticas.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6ccf03bc05e4b749b74b5d577c7e7d3a'] = 'Disponibilidad de los productos'; +$_MODULE['<{statsproduct}prestashop>statsproduct_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{statsproduct}prestashop>statsproduct_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6c1a8292e4da90e1ef19ae9444226d8f'] = 'Número de compras en relación con el número de visitas'; +$_MODULE['<{statsproduct}prestashop>statsproduct_1d0ba341c7847cbff109276485417a1c'] = 'Tras elegir una categoría y seleccionar un producto disponible de la categoría, aparecen algunos gráficos. Entonces, usted puede analizarlos.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6559cc601f073740b825a4fc9b76149b'] = 'Si observa que un producto tiene éxito, que se compra mucho pero que se consulta poco, debería hacerlo resaltar más en el escaparate de su tienda.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_20b9641efab51dee7d27eed2b6773ef0'] = 'Si por el contrario, un producto es muy consultado pero se vende mal le aconsejamos que compruebe de nuevo o modifique las informaciones, descripción o fotografía(s) presentes en su ficha producto.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_e22269bb51f9f2394e148716babbafbb'] = 'Popularidad'; +$_MODULE['<{statsproduct}prestashop>statsproduct_5e9613e58f3bdbc89b1fef07274c0877'] = 'Visitas (x100)'; +$_MODULE['<{statsproduct}prestashop>statsproduct_287234a1ff35a314b5b6bc4e5828e745'] = 'Atributos'; diff --git a/modules/statsproduct/fr.php b/modules/statsproduct/fr.php new file mode 100644 index 000000000..43d32b500 --- /dev/null +++ b/modules/statsproduct/fr.php @@ -0,0 +1,39 @@ +statsproduct_78e454064a7d3a7755a011a3b79f31a7'] = 'Détail produit'; +$_MODULE['<{statsproduct}prestashop>statsproduct_285201dab507840d082d58dc13602b00'] = 'Propose des statistiques détaillées pour chaque produit'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; +$_MODULE['<{statsproduct}prestashop>statsproduct_981a6013008c8f4b75836b0f415b05b8'] = 'Total des achats'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6780a9268e38d2ddd4f6c4a8ccf83d24'] = 'CA (hors taxes) :'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b262bbde88b3b8dca3b27d730aca69bf'] = 'Total des consultations'; +$_MODULE['<{statsproduct}prestashop>statsproduct_bebbab2c1ac732ccef4181f51ed52967'] = 'Taux de conversion'; +$_MODULE['<{statsproduct}prestashop>statsproduct_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsproduct}prestashop>statsproduct_c90b9dca2d3f5bb6e0d0bdceac8a631d'] = 'Répartition des ventes par attributs'; +$_MODULE['<{statsproduct}prestashop>statsproduct_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'CA'; +$_MODULE['<{statsproduct}prestashop>statsproduct_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{statsproduct}prestashop>statsproduct_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{statsproduct}prestashop>statsproduct_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attribut'; +$_MODULE['<{statsproduct}prestashop>statsproduct_03ab340b3f99e03cff9e84314ead38c0'] = 'Qté'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Ventes croisées'; +$_MODULE['<{statsproduct}prestashop>statsproduct_df644ae155e79abf54175bd15d75f363'] = 'Article'; +$_MODULE['<{statsproduct}prestashop>statsproduct_2a0440eec72540c5b30d9199c01f348c'] = 'Quantité vendue'; +$_MODULE['<{statsproduct}prestashop>statsproduct_844c29394eea07066bb2efefc35784ec'] = 'Prix moyen'; +$_MODULE['<{statsproduct}prestashop>statsproduct_0173374ac20f5843d58b553d5b226ef6'] = 'Choisissez une catégorie'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Toutes'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3303da9d5241177588a06ad60d7edaba'] = 'Cliquez sur un produit pour accéder à ses statistiques.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6ccf03bc05e4b749b74b5d577c7e7d3a'] = 'Produits disponibles'; +$_MODULE['<{statsproduct}prestashop>statsproduct_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{statsproduct}prestashop>statsproduct_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6c1a8292e4da90e1ef19ae9444226d8f'] = 'Comparaison du nombre d\'achat et du nombre de consultations'; +$_MODULE['<{statsproduct}prestashop>statsproduct_1d0ba341c7847cbff109276485417a1c'] = 'Après avoir choisi une catégorie et sélectionné un produit disponible dans cette catégorie, des graphiques apparaissent. Vous pouvez ensuite les analyser.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6559cc601f073740b825a4fc9b76149b'] = 'Si vous constatez qu\'un produit a du succès, qu\'il est beaucoup acheté mais très peu consulté : vous devriez le mettre davantage en évidence dans la vitrine de votre boutique.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_20b9641efab51dee7d27eed2b6773ef0'] = 'Si au contraire un produit connait un grand nombre de consultations mais est très peu acheté : nous vous conseillons alors de vérifier à nouveau ou de modifier les informations, description ou photographie(s) présentes dans sa fiche produit.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_e22269bb51f9f2394e148716babbafbb'] = 'Popularité'; +$_MODULE['<{statsproduct}prestashop>statsproduct_5e9613e58f3bdbc89b1fef07274c0877'] = 'Visites (x100)'; +$_MODULE['<{statsproduct}prestashop>statsproduct_287234a1ff35a314b5b6bc4e5828e745'] = 'Attributs'; diff --git a/modules/statsproduct/it.php b/modules/statsproduct/it.php new file mode 100644 index 000000000..440a9083c --- /dev/null +++ b/modules/statsproduct/it.php @@ -0,0 +1,39 @@ +statsproduct_78e454064a7d3a7755a011a3b79f31a7'] = 'Dettagli del prodotto'; +$_MODULE['<{statsproduct}prestashop>statsproduct_285201dab507840d082d58dc13602b00'] = 'Ottieni statistiche dettagliate per ogni prodotto'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3ec365dd533ddb7ef3d1c111186ce872'] = 'Dettagli'; +$_MODULE['<{statsproduct}prestashop>statsproduct_981a6013008c8f4b75836b0f415b05b8'] = 'Totale comprato:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6780a9268e38d2ddd4f6c4a8ccf83d24'] = 'Vendite (-Tasse):'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b262bbde88b3b8dca3b27d730aca69bf'] = 'Totale visite:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_bebbab2c1ac732ccef4181f51ed52967'] = 'Tasso di conversione:'; +$_MODULE['<{statsproduct}prestashop>statsproduct_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsproduct}prestashop>statsproduct_c90b9dca2d3f5bb6e0d0bdceac8a631d'] = 'Distribuzione vendite attributo'; +$_MODULE['<{statsproduct}prestashop>statsproduct_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{statsproduct}prestashop>statsproduct_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a240fa27925a635b08dc28c9e4f9216d'] = 'Ordine'; +$_MODULE['<{statsproduct}prestashop>statsproduct_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{statsproduct}prestashop>statsproduct_f2bbdf9f72c085adc4d0404e370f0f4c'] = 'Attributo'; +$_MODULE['<{statsproduct}prestashop>statsproduct_03ab340b3f99e03cff9e84314ead38c0'] = 'Qtà'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3601146c4e948c32b6424d2c0a7f0118'] = 'Prezzo'; +$_MODULE['<{statsproduct}prestashop>statsproduct_a1892c39b2598b4f30f9cc92c59f1aa5'] = 'Vendita incrociata'; +$_MODULE['<{statsproduct}prestashop>statsproduct_df644ae155e79abf54175bd15d75f363'] = 'Nome del prodotto'; +$_MODULE['<{statsproduct}prestashop>statsproduct_2a0440eec72540c5b30d9199c01f348c'] = 'Quantità venduta'; +$_MODULE['<{statsproduct}prestashop>statsproduct_844c29394eea07066bb2efefc35784ec'] = 'Prezzo medio'; +$_MODULE['<{statsproduct}prestashop>statsproduct_0173374ac20f5843d58b553d5b226ef6'] = 'Scegli una categoria'; +$_MODULE['<{statsproduct}prestashop>statsproduct_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutti'; +$_MODULE['<{statsproduct}prestashop>statsproduct_3303da9d5241177588a06ad60d7edaba'] = 'Clicca su un prodotto per accedere alle statistiche.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6ccf03bc05e4b749b74b5d577c7e7d3a'] = 'Prodotti disponibili'; +$_MODULE['<{statsproduct}prestashop>statsproduct_12d3c7a4296542c62474856ec452c045'] = 'Rif.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{statsproduct}prestashop>statsproduct_27ce7f8b5623b2e2df568d64cf051607'] = 'Magazzino'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6c1a8292e4da90e1ef19ae9444226d8f'] = 'Numero di acquisti rispetto al numero di visualizzazioni'; +$_MODULE['<{statsproduct}prestashop>statsproduct_1d0ba341c7847cbff109276485417a1c'] = 'Dopo aver scelto una categoria e selezionato un prodotto disponibile in questa categoria, appariranno dei grafici. Poi, potrai analizzarli.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_6559cc601f073740b825a4fc9b76149b'] = 'Se noti che un prodotto ha successo, viene spesso acquistato ma visualizzato raramente, dovresti collocarlo in maniera più visibile nel tuo negozio'; +$_MODULE['<{statsproduct}prestashop>statsproduct_20b9641efab51dee7d27eed2b6773ef0'] = 'D\'altra parte, se un prodotto ha un sacco di visualizzazioni ma non è realmente acquistato: ti consigliamo di controllare o modificare le informazioni di questo prodotto, la descrizione e la fotografia.'; +$_MODULE['<{statsproduct}prestashop>statsproduct_e22269bb51f9f2394e148716babbafbb'] = 'Popolarità'; +$_MODULE['<{statsproduct}prestashop>statsproduct_5e9613e58f3bdbc89b1fef07274c0877'] = 'Visite (x100)'; +$_MODULE['<{statsproduct}prestashop>statsproduct_287234a1ff35a314b5b6bc4e5828e745'] = 'Attributi'; diff --git a/modules/statsproduct/logo.gif b/modules/statsproduct/logo.gif new file mode 100644 index 000000000..2350555ed Binary files /dev/null and b/modules/statsproduct/logo.gif differ diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php new file mode 100644 index 000000000..5ffb73f9b --- /dev/null +++ b/modules/statsproduct/statsproduct.php @@ -0,0 +1,404 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsProduct extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_option = 0; + private $_id_product = 0; + + function __construct() + { + $this->name = 'statsproduct'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Product details'); + $this->description = $this->l('Get detailed statistics for each product.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function getTotalBought($id_product) + { + $dateBetween = ModuleGraph::getDateBetween(); + return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT SUM(od.`product_quantity`) AS total + FROM `'._DB_PREFIX_.'order_detail` od + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = '.(int)($id_product).' + AND o.valid = 1 + AND o.`date_add` BETWEEN '.$dateBetween.''); + } + + public function getTotalSales($id_product) + { + $dateBetween = ModuleGraph::getDateBetween(); + return (float)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT SUM(od.`product_quantity` * od.`product_price`) AS total + FROM `'._DB_PREFIX_.'order_detail` od + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = '.(int)($id_product).' + AND o.valid = 1 + AND o.`date_add` BETWEEN '.$dateBetween.''); + } + + public function getTotalViewed($id_product) + { + $dateBetween = ModuleGraph::getDateBetween(); + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(pv.`counter`) AS total + FROM `'._DB_PREFIX_.'page_viewed` pv + LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `'._DB_PREFIX_.'page` p ON pv.`id_page` = p.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type` + WHERE pt.`name` = \'product.php\' + AND p.`id_object` = '.(int)($id_product).' + AND dr.`time_start` BETWEEN '.$dateBetween.' + AND dr.`time_end` BETWEEN '.$dateBetween.''); + return isset($result['total']) ? $result['total'] : 0; + } + + private function getProducts($id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT p.`id_product`, p.reference, pl.`name`, IFNULL((SELECT SUM(pa.quantity) FROM '._DB_PREFIX_.'product_attribute pa WHERE pa.id_product = p.id_product), p.quantity) as quantity + FROM `'._DB_PREFIX_.'product` p + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON p.`id_product` = pl.`id_product` + '.(Tools::getValue('id_category') ? 'LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`' : '').' + WHERE pl.`id_lang` = '.(int)($id_lang).' + '.(Tools::getValue('id_category') ? 'AND cp.id_category = '.(int)(Tools::getValue('id_category')) : '').' + ORDER BY pl.`name`'); + } + + private function getSales($id_product, $id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT o.date_add, o.id_order, o.id_customer, od.product_quantity, (od.product_price * od.product_quantity) as total, od.tax_name, od.product_name + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order + WHERE o.date_add BETWEEN '.$this->getDate().' AND o.valid = 1 + AND od.product_id = '.(int)($id_product)); + } + + private function getCrossSales($id_product, $id_lang) + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT pl.name as pname, pl.id_product, SUM(od.product_quantity) as pqty, AVG(od.product_price) as pprice + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order + LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = od.product_id AND pl.id_lang = '.(int)($id_lang).') + WHERE o.id_customer IN ( + SELECT o.id_customer + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order + WHERE o.date_add BETWEEN '.$this->getDate().' + AND o.valid = 1 + AND od.product_id = '.(int)($id_product).' + ) + AND o.date_add BETWEEN '.$this->getDate().' + AND o.valid = 1 + AND od.product_id != '.(int)($id_product).' + GROUP BY od.product_id + ORDER BY pqty DESC'); + } + + public function hookAdminStatsModules($params) + { + global $cookie, $currentIndex; + $id_category = (int)(Tools::getValue('id_category')); + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + + if (Tools::getValue('export')) + if (!Tools::getValue('exportType')) + $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => '42')); + + $this->_html = '
        '.$this->displayName.''; + if ($id_product = (int)(Tools::getValue('id_product'))) + { + if (Tools::getValue('export')) + if (Tools::getValue('exportType') == 1) + $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)); + elseif (Tools::getValue('exportType') == 2) + $this->csvExport(array('type' => 'pie', 'option' => '3-'.$id_product)); + $product = new Product($id_product, false, (int)($cookie->id_lang)); + $totalBought = $this->getTotalBought($product->id); + $totalSales = $this->getTotalSales($product->id); + $totalViewed = $this->getTotalViewed($product->id); + $this->_html .= '

        '.$product->name.' - '.$this->l('Details').'

        +

        '.$this->l('Total bought:').' '.$totalBought.'

        +

        '.$this->l('Sales (-Tx):').' '.Tools::displayprice($totalSales, $currency).'

        +

        '.$this->l('Total viewed:').' '.$totalViewed.'

        +

        '.$this->l('Conversion rate:').' '.number_format($totalViewed ? $totalBought / $totalViewed : 0, 2).'

        +
        '.ModuleGraph::engine(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)).'
        +
        +

        '.$this->l('CSV Export').'

        '; + if ($hasAttribute = $product->hasAttributes() AND $totalBought) + $this->_html .= '

        '.$this->l('Attribute sales distribution').'

        '.ModuleGraph::engine(array('type' => 'pie', 'option' => '3-'.$id_product)).'

        +

        '.$this->l('CSV Export').'


        '; + if ($totalBought) + { + $sales = $this->getSales($id_product, $cookie->id_lang); + $this->_html .= '
        +

        '.$this->l('Sales').'

        +
        + + + + + + + '.($hasAttribute ? '' : '').' + + + + '; + $tokenOrder = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); + $tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)); + foreach ($sales as $sale) + $this->_html .= ' + + + + + '.($hasAttribute ? '' : '').' + + + '; + $this->_html .= '
        '.$this->l('Date').''.$this->l('Order').''.$this->l('Customer').''.$this->l('Attribute').''.$this->l('Qty').''.$this->l('Price').'
        '.Tools::displayDate($sale['date_add'], (int)($cookie->id_lang), false).''.(int)($sale['id_order']).''.(int)($sale['id_customer']).''.$sale['product_name'].''.(int)($sale['product_quantity']).''.Tools::displayprice($sale['total'], $currency).'
        '; + + $crossSelling = $this->getCrossSales($id_product, $cookie->id_lang); + if (count($crossSelling)) + { + $this->_html .= '
        +

        '.$this->l('Cross Selling').'

        +
        + + + + + + + + '; + $tokenProducts = Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)); + foreach ($crossSelling as $selling) + $this->_html .= ' + + + + + '; + $this->_html .= '
        '.$this->l('Product name').''.$this->l('Quantity sold').''.$this->l('Average price').'
        '.$selling['pname'].''.(int)($selling['pqty']).''.Tools::displayprice($selling['pprice'], $currency).'
        '; + } + } + } + else + { + $categories = Category::getCategories((int)($cookie->id_lang), true, false); + $this->_html .= ' + +
        +
        + +
        +
        +
        + '.$this->l('Click on a product to access its statistics.').' +
        +

        '.$this->l('Products available').'

        +
        + + + + + + + + '; + foreach ($this->getProducts($cookie->id_lang) AS $product) + $this->_html .= ''; + $this->_html .= '
        '.$this->l('Ref.').''.$this->l('Name').''.$this->l('Stock').'
        '.$product['reference'].''.$product['name'].''.$product['quantity'].'


        + '.$this->l('CSV Export').'
        '; + } + + $this->_html .= '

        +
        '.$this->l('Guide').' +

        '.$this->l('Number of purchases compared to number of viewings').'

        +

        + '.$this->l('After choosing a category and selecting a product, informational graphs will appear. Then, you will be able to analyze them.').' +

          +
        • '.$this->l('If you notice that a product is successful and often purchased, but viewed infrequently, you should put it more prominently on your webshop front-office.').'
        • +
        • '.$this->l('On the other hand, if a product has many viewings but is not often purchased, we advise you to check or modify this product\'s information, description and photography again.').' +
        • +
        +

        +
        '; + return $this->_html; + } + + public function setOption($option, $layers = 1) + { + list($this->_option, $this->_id_product) = explode('-', $option); + $dateBetween = $this->getDate(); + switch ($this->_option) + { + case 1: + $this->_titles['main'][0] = $this->l('Popularity'); + $this->_titles['main'][1] = $this->l('Sales'); + $this->_titles['main'][2] = $this->l('Visits (x100)'); + $this->_query[0] = ' + SELECT o.`date_add`, SUM(od.`product_quantity`) AS total + FROM `'._DB_PREFIX_.'order_detail` od + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = '.(int)($this->_id_product).' + AND o.valid = 1 + AND o.`date_add` BETWEEN '.$dateBetween.' + GROUP BY o.`date_add`'; + $this->_query[1] = ' + SELECT dr.`time_start` AS date_add, (SUM(pv.`counter`) / 100) AS total + FROM `'._DB_PREFIX_.'page_viewed` pv + LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `'._DB_PREFIX_.'page` p ON pv.`id_page` = p.`id_page` + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type` + WHERE pt.`name` = \'product.php\' + AND p.`id_object` = '.(int)($this->_id_product).' + AND dr.`time_start` BETWEEN '.$dateBetween.' + AND dr.`time_end` BETWEEN '.$dateBetween.' + GROUP BY dr.`time_start`'; + break; + case 3: + $this->_query = ' + SELECT product_attribute_id, SUM(od.`product_quantity`) AS total + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = '.(int)($this->_id_product).' + AND o.valid = 1 + AND o.`date_add` BETWEEN '.$dateBetween.' + GROUP BY od.`product_attribute_id`'; + $this->_titles['main'] = $this->l('Attributes'); + break; + + case 42: + $this->_titles['main'][1] = $this->l('Ref.'); + $this->_titles['main'][2] = $this->l('Name'); + $this->_titles['main'][3] = $this->l('Stock'); + break; + } + } + + protected function getData($layers) + { + global $cookie; + if ($this->_option == 42) + { + $products = $this->getProducts(intval($cookie->id_lang)); + foreach ($products AS $product) + { + $this->_values[0][] = $product['reference']; + $this->_values[1][] = $product['name']; + $this->_values[2][] = $product['quantity']; + $this->_legend[] = $product['id_product']; + } + } + elseif ($this->_option != 3) + $this->setDateGraph($layers, true); + else + { + $product = new Product($this->_id_product, false, (int)($this->getLang())); + + $combArray = array(); + $assocNames = array(); + $combinaisons = $product->getAttributeCombinaisons((int)($this->getLang())); + foreach ($combinaisons AS $k => $combinaison) + $combArray[$combinaison['id_product_attribute']][] = array('group' => $combinaison['group_name'], 'attr' => $combinaison['attribute_name']); + foreach ($combArray AS $id_product_attribute => $product_attribute) + { + $list = ''; + foreach ($product_attribute AS $attribute) + $list .= trim($attribute['group']).' - '.trim($attribute['attr']).', '; + $list = rtrim($list, ', '); + $assocNames[$id_product_attribute] = $list; + } + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = @$assocNames[$row['product_attribute_id']]; + } + } + } + + protected function setYearValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i]); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 5, 2))] += $row['total']; + } + } + + protected function setMonthValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i]); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 8, 2))] += $row['total']; + } + } + + protected function setDayValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i]); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 11, 2))] += $row['total']; + } + } +} + + + diff --git a/modules/statsregistrations/config.xml b/modules/statsregistrations/config.xml new file mode 100755 index 000000000..85cf4cc23 --- /dev/null +++ b/modules/statsregistrations/config.xml @@ -0,0 +1,11 @@ + + + statsregistrations + Customer accounts + 1 + Display the progress of customer registration. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsregistrations/de.php b/modules/statsregistrations/de.php new file mode 100644 index 000000000..71e5b6beb --- /dev/null +++ b/modules/statsregistrations/de.php @@ -0,0 +1,20 @@ +statsregistrations_8b15fc6468c919d299f9a601b61b95fc'] = 'Kundenkonten'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_089c9061407fd978366e78b6ad1d0111'] = 'Anzeige des Fortschritts der Kundenregistrierung'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_75abad0b891bc086fd4837e81a8c488a'] = 'Besucher, die bei der Registrierung aufgehört haben:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_4e4f3af3fb18136b8eec4b77f25095ce'] = 'Besucher, die direkt nach der Anmeldung eine Bestellung vorgenommen haben:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a751e9cc4ed4c7585ecc0d97781cb48a'] = 'Kundenkonten insgesamt:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_fba0e64541196123bbf8e3737bf9287b'] = 'Anzahl der erstellten Kundenkonten '; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a286f4eaef73a0b4f955c42b84472444'] = 'Die Gesamtzahl der erstellten Konten ist an sich keine wichtige Information. Es ist allerdings interessant, die Zahl der Eröffnungen über die Zeit gesehen zu analysieren. Dies sagt aus, ob die Dinge auf dem richtigen Weg sind.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_57a6f41a27c9baa5b402d30e97d4c1e8'] = 'Die richtige Reaktion auf die Entwicklung der Registrierungen'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f123e4522d188fba4cbe1dc58034f95c'] = 'Wenn Sie Ihren Shop laufen lassen, ohne etwas zu ändern, sollte die Anzahl der Kunden-Registrierungen stabil bleiben oder leicht rückläufig sein.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f8426f15c536f4341dbeb4d806f76167'] = 'Ein signifikanter Anstieg oder Rückgang zeigt, dass es wahrscheinlich eine Änderung in Ihrem Shop gegeben hat, Sie müssensie identifizieren, um herauszufinden, ob diese Änderung die Zahl der Anmeldungen zurückgehen lässt oder fortfahren, wenn dies vorteilhaft ist.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_48ad285c9749cc74821048c49aea6a50'] = 'Hier ist eine Zusammenfassung dessen, was die Eröffnung von Kundenkonten beeinflusst:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_cd0d9770ca8ee818040fa3453fbaa1ae'] = 'Eine Werbekampagne kann eine größere Anzahl von Besuchern anziehen. Eine sich daraus ergebende Zunahme von Kundenkonten, hängt von der \"Qualität\" der Kampagne ab: gezielte Werbung kann effektiver sein als breit angelegte Werbung.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_b2eceb617c0a86e0dbe5d844f0ec353e'] = 'Sonderangebote, Verkäufe, oder Wettbewerbe schaffen mehr Aufmerksamkeit und Neugier, und halten Ihren Shop nicht nur lebendig, sondern erhöhen auch die Besucherzahl. Auf diese Weise können Sie impulsive Käufer zum Kaufen animieren.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_52a6042899eefb32fcd219672c0c7179'] = 'Design und Benutzerfreundlichkeit sind heute wichtiger denn je: ein schlecht gewähltes oder schwer verständliches grafisches Thema kann Besuchern die Lust zum Kaufen nehmen. Sie müssen die richtige Balance zwischen einem innovativen Design und einer leichten Surfbarkeit für Besucher finden. Korrekte Rechtschreibung und Klarheit wecken ebenso mehr das Kundenvertrauen in Ihren Shop.'; diff --git a/modules/statsregistrations/en.php b/modules/statsregistrations/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsregistrations/en.php @@ -0,0 +1,4 @@ +statsregistrations_8b15fc6468c919d299f9a601b61b95fc'] = 'Cuentas cliente'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_089c9061407fd978366e78b6ad1d0111'] = 'Mostrar la progresión de la suscripción de clientes'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_75abad0b891bc086fd4837e81a8c488a'] = 'Visitantes que no han pasado de la suscripción:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_4e4f3af3fb18136b8eec4b77f25095ce'] = 'Visitantes que han efectuado un pedido directamente después de suscribirse:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a751e9cc4ed4c7585ecc0d97781cb48a'] = 'Total cuentas cliente:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_fba0e64541196123bbf8e3737bf9287b'] = 'Número de clientes que han creado una cuenta'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a286f4eaef73a0b4f955c42b84472444'] = 'El número total de cuentas creadas no es en sí misma información importante. Sin embargo, es interesante analizar la cantidad creada en un cierto plazo. Esto indicará de una manera u otra si las cosas van por buen camino.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_57a6f41a27c9baa5b402d30e97d4c1e8'] = '¿Cómo intervenir en la evolución de las suscripciones?'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f123e4522d188fba4cbe1dc58034f95c'] = 'i usted deja su tienda funcionar sin realizar cambios, el número de suscripciones de cliente puede permanecer estable o declinar levemente.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f8426f15c536f4341dbeb4d806f76167'] = 'Un aumento significativo o una disminución demuestra que ha habido probablemente un cambio en su tienda; por lo tanto, usted debe identificarlo y dar marcha atrás si ha habido una disminución de suscripciones o continuar con él si es ventajoso. '; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_48ad285c9749cc74821048c49aea6a50'] = 'Aquí se muestra un sumario de lo que puede afectar a la hora de crear cuentas de clientes.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_cd0d9770ca8ee818040fa3453fbaa1ae'] = 'Una campaña publicitaria puede atraer un mayor número de visitantes.Un incremento de clientes registrados le dará cierta seguridad, pero depende de su \\\"calidad\\\": una publicidad bien dirigida puede resultar más efectiva que un campaña a gran escala.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_b2eceb617c0a86e0dbe5d844f0ec353e'] = 'Ofertas especiales, rebajas o contenidos crean grandes espectativas y curiosidad, así no sólo se mantiene activo su comercio activo sino que además aumenta el tráfico. De esta manera, puede captar clientes impulsivos.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_52a6042899eefb32fcd219672c0c7179'] = 'El diseño y la accesibilidad son más importantes que nunca: una mala accesibilidad o una mala presentación gráfica puede hacer que sus visitantes se vayan. Tiene que crear un balance entre un diseño innovador que permita al visitante moverse por la red con comodidad. Un escritura clara y correcta también inspirarán más confianza para el cliente hacia su comercio.'; diff --git a/modules/statsregistrations/fr.php b/modules/statsregistrations/fr.php new file mode 100644 index 000000000..b7033816c --- /dev/null +++ b/modules/statsregistrations/fr.php @@ -0,0 +1,20 @@ +statsregistrations_8b15fc6468c919d299f9a601b61b95fc'] = 'Comptes clients'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_089c9061407fd978366e78b6ad1d0111'] = 'Affiche l\'évolution des créations de compte'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_75abad0b891bc086fd4837e81a8c488a'] = 'Visiteurs bloqués à la phase d\'inscription :'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_4e4f3af3fb18136b8eec4b77f25095ce'] = 'Visiteurs ayant passé une commande dès leur inscription :'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a751e9cc4ed4c7585ecc0d97781cb48a'] = 'Total de comptes créés :'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_fba0e64541196123bbf8e3737bf9287b'] = 'Nombre de comptes créés'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a286f4eaef73a0b4f955c42b84472444'] = 'Le nombre d\'inscrits en lui-même n\'est pas important. Il vous permet surtout d\'apprécier son évolution sur une période plus ou moins longue. '; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_57a6f41a27c9baa5b402d30e97d4c1e8'] = 'Comment agir sur l\'évolution des inscriptions ?'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f123e4522d188fba4cbe1dc58034f95c'] = 'Si vous laissez votre boutique tourner sans rien changer, le nombre d\'inscriptions devrait être stable ou baisser légèrement. '; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f8426f15c536f4341dbeb4d806f76167'] = 'Une forte croissance ou une forte baisse montre donc probablement un changement sur votre boutique. C\'est pourquoi vous devez l\'identifier de manière à pouvoir revenir sur vos pas au cas où ce changement fait décroître le nombre d\'inscriptions, ou au contraire continuer dans cette voie si celui-ci se trouve avantageux.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_48ad285c9749cc74821048c49aea6a50'] = 'Différents modificateurs sont possibles : '; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_cd0d9770ca8ee818040fa3453fbaa1ae'] = 'Une campagne de publicité peut attirer un grand nombre de visiteurs. De plus, une campagne de pub bien ciblée peut s\'avérer plus efficace qu\'une publicité à grande échelle.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_b2eceb617c0a86e0dbe5d844f0ec353e'] = 'Les promotions, soldes ou jeux-concours attirent fortement l\'attention et la curiosité des visiteurs ; permettant non seulement l\'animation de votre boutique, mais aussi l\'augmentation de son trafic. De cette manière, vous pouvez pousser un acheteur \"spontané\" à se lancer.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_52a6042899eefb32fcd219672c0c7179'] = 'Esthétique : un changement de thème peut rebuter les visiteurs. L\'orthographe et la clarté sont également à soigner. '; diff --git a/modules/statsregistrations/it.php b/modules/statsregistrations/it.php new file mode 100644 index 000000000..9d76dc5b5 --- /dev/null +++ b/modules/statsregistrations/it.php @@ -0,0 +1,20 @@ +statsregistrations_8b15fc6468c919d299f9a601b61b95fc'] = 'Account clienti'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_089c9061407fd978366e78b6ad1d0111'] = 'Visualizzare lo stato di registrazione del cliente'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_75abad0b891bc086fd4837e81a8c488a'] = 'I visitatori che si sono fermati alla fase di registrazione:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_4e4f3af3fb18136b8eec4b77f25095ce'] = 'I visitatori che hanno effettuato un ordine direttamente dopo la registrazione:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a751e9cc4ed4c7585ecc0d97781cb48a'] = 'Totale account dei clienti:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_fba0e64541196123bbf8e3737bf9287b'] = 'Numero di account clienti creati'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_a286f4eaef73a0b4f955c42b84472444'] = 'Il numero totale di account creati non è di per sé un\'informazione importante. Tuttavia, è interessante analizzare il numero creato nel tempo. Questo indica se le cose sono sulla strada giusta.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_57a6f41a27c9baa5b402d30e97d4c1e8'] = 'Come agire sull\'evoluzione delle iscrizioni?'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f123e4522d188fba4cbe1dc58034f95c'] = 'Se lasci che il tuo negozio vada avanti senza cambiare nulla, il numero di iscrizioni dei clienti dovrebbe rimanere stabile o diminuire leggermente.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_f8426f15c536f4341dbeb4d806f76167'] = 'Un significativo aumento o diminuzione dimostra che vi è stato probabilmente un cambiamento nel tuo negozio; pertanto, è necessario identificarlo in modo da effettuare degli aggiustamenti laddove questa modifica faccia diminuire il numero di registrazioni, o invece proseguire se il risultato è positivo.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_48ad285c9749cc74821048c49aea6a50'] = 'Ecco un riassunto di ciò che può influenzare la creazione di account cliente:'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_cd0d9770ca8ee818040fa3453fbaa1ae'] = 'Una campagna pubblicitaria può attrarre un numero maggiore di visitatori. Un aumento di account dei clienti che ne seguirà, che dipenderà dalla loro \"qualità\": le pubblicità ben mirate possono essere più efficaci di una pubblicità su larga scala.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_b2eceb617c0a86e0dbe5d844f0ec353e'] = 'Le promozioni, le vendite, o concorsi creano una maggiore attenzione e curiosità, non solo mantengono vivace il tuo negozio, ma ne aumentano il traffico. In questo modo, puoi spingere gli acquirenti impulsivi a fare il grande passo.'; +$_MODULE['<{statsregistrations}prestashop>statsregistrations_52a6042899eefb32fcd219672c0c7179'] = 'Design e semplicità d\'uso sono più importanti che mai: una grafica complicata o difficile da seguire può allontanare i visitatori. Devi trovare il giusto equilibrio tra un design innovativo e lasciare che i visitatori si muovano facilmente. Anche una corretta ortografia e una grande chiarezza ispireranno maggiore fiducia nel tuo negozio.'; diff --git a/modules/statsregistrations/logo.gif b/modules/statsregistrations/logo.gif new file mode 100644 index 000000000..8b58d27d2 Binary files /dev/null and b/modules/statsregistrations/logo.gif differ diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php new file mode 100644 index 000000000..9d576e3f2 --- /dev/null +++ b/modules/statsregistrations/statsregistrations.php @@ -0,0 +1,157 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsRegistrations extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + + function __construct() + { + $this->name = 'statsregistrations'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Customer accounts'); + $this->description = $this->l('Display the progress of customer registration.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function getTotalRegistrations() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(`id_customer`) as total + FROM `'._DB_PREFIX_.'customer` + WHERE `date_add` BETWEEN '.ModuleGraph::getDateBetween()); + return isset($result['total']) ? $result['total'] : 0; + } + + public function getBlockedVisitors() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT c.`id_guest`) as blocked + FROM `'._DB_PREFIX_.'page_type` pt + LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page_type = pt.id_page_type + LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON p.id_page = cp.id_page + LEFT JOIN `'._DB_PREFIX_.'connections` c ON c.id_connections = cp.id_connections + LEFT JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + WHERE pt.name = "authentication.php" + AND (g.id_customer IS NULL OR g.id_customer = 0) + AND c.`date_add` BETWEEN '.ModuleGraph::getDateBetween()); + return $result['blocked']; + } + + public function getFirstBuyers() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(DISTINCT o.`id_customer`) as buyers + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'guest` g ON o.id_customer = g.id_customer + LEFT JOIN `'._DB_PREFIX_.'connections` c ON c.id_guest = g.id_guest + WHERE o.`date_add` BETWEEN '.ModuleGraph::getDateBetween().' AND o.valid = 1 + AND ABS(TIMEDIFF(o.date_add, c.date_add)+0) < 120000'); + return $result['buyers']; + } + + public function hookAdminStatsModules($params) + { + $totalRegistrations = $this->getTotalRegistrations(); + $totalBlocked = $this->getBlockedVisitors(); + $totalBuyers = $this->getFirstBuyers(); + if (Tools::getValue('export')) + $this->csvExport(array('layers' => 0, 'type' => 'line')); + $this->_html = ' +
        '.$this->displayName.' +

        + '.$this->l('Visitors who have stopped at the registering step:').' '.(int)($totalBlocked).($totalRegistrations ? ' ('.number_format(100*$totalBlocked/($totalRegistrations+$totalBlocked), 2).'%)' : '').'
        + '.$this->l('Visitors who have placed an order directly after registration:').' '.(int)($totalBuyers).($totalRegistrations ? ' ('.number_format(100*$totalBuyers/($totalRegistrations), 2).'%)' : '').' +

        +

        '.$this->l('Total customer accounts:').' '.$totalRegistrations.'

        +
        '.ModuleGraph::engine(array('type' => 'line')).'
        +

        '.$this->l('CSV Export').'

        +

        +
        '.$this->l('Guide').' +

        '.$this->l('Number of customer accounts created').'

        +

        '.$this->l('The total number of accounts created is not in itself important information. However, it is beneficial to analyze the number created over time. This will indicate whether or not things are on the right track.').'

        +

        '.$this->l('How to act on the registrations\' evolution?').'

        +

        + '.$this->l('If you let your shop run without changing anything, the number of customer registrations should stay stable or may slightly decline.').' + '.$this->l('A significant increase or decrease shows that there has probably been a change to your shop.Therefore, you have to identify it in order to backtrack if this change makes the number of registrations decrease, or continue with it if it increases registration.').'
        + '.$this->l('Here is summary of what may affect the creation of customer accounts:').' +

          +
        • '.$this->l('An advertising campaign can attract a greater number of visitors. An increase in customer accounts will ensue, which will depend on their "quality". Well-targeted advertising can be more effective than large-scale advertising.').'
        • +
        • '.$this->l('Specials, sales, or contests draw greater attention and curiosity, not only keeping your shop lively but also increasing its traffic. This way, you can push impulsive buyers to take the plunge.').'
        • +
        • '.$this->l('Design and user-friendliness are more important than ever: an ill-chosen or hard-to-follow graphical theme can turn off visitors. You should strike the right balance between an innovative design and letting visitors move around easily. Proper spelling and clarity also inspire more customer confidence in your shop.').'
        • +
        +


        +
        '; + return $this->_html; + } + + protected function getData($layers) + { + $this->_query = ' + SELECT `date_add` + FROM `'._DB_PREFIX_.'customer` + WHERE `date_add` BETWEEN'; + $this->_titles['main'] = $this->l('Number of customer accounts created'); + $this->setDateGraph($layers, true); + } + + protected function setYearValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + foreach ($result AS $row) + $this->_values[(int)(substr($row['date_add'], 5, 2))]++; + } + + protected function setMonthValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + foreach ($result AS $row) + $this->_values[(int)(substr($row['date_add'], 8, 2))]++; + } + + protected function setDayValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate()); + foreach ($result AS $row) + $this->_values[(int)(substr($row['date_add'], 11, 2))]++; + } +} + + diff --git a/modules/statssales/config.xml b/modules/statssales/config.xml new file mode 100755 index 000000000..cd0f40dbb --- /dev/null +++ b/modules/statssales/config.xml @@ -0,0 +1,11 @@ + + + statssales + Sales and orders + 1 + Display the sales evolution and orders by statuses + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statssales/de.php b/modules/statssales/de.php new file mode 100644 index 000000000..bf5dbf24a --- /dev/null +++ b/modules/statssales/de.php @@ -0,0 +1,24 @@ +statssales_45c4b3e103155326596d6ccd2fea0f25'] = 'Verkäufe und Bestellungen'; +$_MODULE['<{statssales}prestashop>statssales_09a6e97d1ccb13182c8fd316450dbebf'] = 'Anzeige der Umsatzentwicklung und Bestellungen nach Status'; +$_MODULE['<{statssales}prestashop>statssales_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{statssales}prestashop>statssales_d7778d0c64b6ba21494c97f77a66885a'] = 'Filter'; +$_MODULE['<{statssales}prestashop>statssales_052d402bac5d6be562de993113d3108b'] = 'Diese Grafiken stellen die Entwicklung Ihrer Bestellungen und Verkaufsumsätze für einen bestimmten Zeitraum dar. Es ist kein fortgeschrittenes Analyse-Tool, aber Sie können die Rentabilität Ihres Shops mit einem Blick erfassen. Sie Könne auch Unterschiede im Vergleich zu anderen Zeiträumen überwachen, z.B. Weihnachten. Nur bestätigte Bestellungen werden in diesen beiden Grafiken berücksichtigt.'; +$_MODULE['<{statssales}prestashop>statssales_9ccb8353e945f1389a9585e7f21b5a0d'] = 'Erfolgte Bestellungen:'; +$_MODULE['<{statssales}prestashop>statssales_156e5c5872c9af24a5c982da07a883c2'] = 'Gekaufte Produkte:'; +$_MODULE['<{statssales}prestashop>statssales_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statssales}prestashop>statssales_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Verkäufe:'; +$_MODULE['<{statssales}prestashop>statssales_0718e1ec4754e199aa9cb4bc43a6ff53'] = 'Hier können Sie die Bestellstatusverteilung sehen.'; +$_MODULE['<{statssales}prestashop>statssales_da80af4de99df74dd59e665adf1fac8f'] = 'Keine Bestellung für diesen Zeitraum'; +$_MODULE['<{statssales}prestashop>statssales_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statssales}prestashop>statssales_75288849ad081e6ef15e00c37b7570f2'] = 'Verschiedene Bestellstatus'; +$_MODULE['<{statssales}prestashop>statssales_94272e39a7493ab1baf7600d78926024'] = 'In Ihrem Back Office finden Sie viele andere Bestellstatus: Scheckzahlung in Bearbeitung, Zahlung akzeptiert, Vorbereitung im Gang, Versand, Geliefert, Abgebrochen, Rückzahlung, Fehler bei Zahlung, Lagerfehlbestand sowie Zahlung durch Banküberweisung in Bearbeitung.'; +$_MODULE['<{statssales}prestashop>statssales_d3ca3781ea021039c95d2830dd6db169'] = 'Dieses Satatus können nicht aus dem Back Office entfernt werden, neue können jedoch hinzugefügt werden.'; +$_MODULE['<{statssales}prestashop>statssales_bb7ad89807bf69ddca986c142311f936'] = 'Produkte und Bestellungen'; +$_MODULE['<{statssales}prestashop>statssales_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Bestellungen'; +$_MODULE['<{statssales}prestashop>statssales_068f80c7519d0528fb08e82137a72131'] = 'Produkte'; +$_MODULE['<{statssales}prestashop>statssales_14f1c54626d722168ee62dff05ed811e'] = 'Verkäufe in'; +$_MODULE['<{statssales}prestashop>statssales_33eee7690a8cd62490ed9eeadd47d163'] = 'Prozente der Bestellungen nach Status'; diff --git a/modules/statssales/en.php b/modules/statssales/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statssales/en.php @@ -0,0 +1,4 @@ +statssales_45c4b3e103155326596d6ccd2fea0f25'] = 'Ventas y pedidos'; +$_MODULE['<{statssales}prestashop>statssales_09a6e97d1ccb13182c8fd316450dbebf'] = 'Mostrar la evolución de las ventas y de los pedidos por estados'; +$_MODULE['<{statssales}prestashop>statssales_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todos'; +$_MODULE['<{statssales}prestashop>statssales_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtrar'; +$_MODULE['<{statssales}prestashop>statssales_052d402bac5d6be562de993113d3108b'] = 'Estos gráficos representan la evolución de los pedidos y del volumen de ventas en un periodo dado. No son herramientas de análisis avanzadas pero le permiten ver la rentabilidad de su tienda inmediatamente. También puede observar variaciones en periodos concretos, como Navidad. Sólo los pedidos válidos se incluyen en estos gráficos. '; +$_MODULE['<{statssales}prestashop>statssales_9ccb8353e945f1389a9585e7f21b5a0d'] = 'Pedidos realizados:'; +$_MODULE['<{statssales}prestashop>statssales_156e5c5872c9af24a5c982da07a883c2'] = 'Productos pedidos:'; +$_MODULE['<{statssales}prestashop>statssales_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statssales}prestashop>statssales_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Ventas:'; +$_MODULE['<{statssales}prestashop>statssales_0718e1ec4754e199aa9cb4bc43a6ff53'] = 'Puede ver la distribución del estado del pedido a continuación.'; +$_MODULE['<{statssales}prestashop>statssales_da80af4de99df74dd59e665adf1fac8f'] = 'No hay pedidos para este periodo'; +$_MODULE['<{statssales}prestashop>statssales_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statssales}prestashop>statssales_75288849ad081e6ef15e00c37b7570f2'] = 'Varios estados de pedido'; +$_MODULE['<{statssales}prestashop>statssales_94272e39a7493ab1baf7600d78926024'] = 'En su Back-Office, hay varios estados de pedido disponibles: En espera de pago por cheque, Pago aceptado, Preparación en curso, En espera de entraga, Entregado, Anulado, Reembolsado, Error de pago, Productos no disponibles y en espera de pago por transferencia bancaria.'; +$_MODULE['<{statssales}prestashop>statssales_d3ca3781ea021039c95d2830dd6db169'] = 'Estos estados no pueden suprimirse a partir del Back-Office, sin embargo puede añadir otros nuevos.'; +$_MODULE['<{statssales}prestashop>statssales_bb7ad89807bf69ddca986c142311f936'] = 'Productos y pedidos'; +$_MODULE['<{statssales}prestashop>statssales_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Pedidos'; +$_MODULE['<{statssales}prestashop>statssales_068f80c7519d0528fb08e82137a72131'] = 'Productos'; +$_MODULE['<{statssales}prestashop>statssales_14f1c54626d722168ee62dff05ed811e'] = 'Ventas en'; +$_MODULE['<{statssales}prestashop>statssales_33eee7690a8cd62490ed9eeadd47d163'] = 'Porcentaje de pedidos por estado'; diff --git a/modules/statssales/fr.php b/modules/statssales/fr.php new file mode 100644 index 000000000..75d4764ee --- /dev/null +++ b/modules/statssales/fr.php @@ -0,0 +1,24 @@ +statssales_45c4b3e103155326596d6ccd2fea0f25'] = 'Commandes et CA'; +$_MODULE['<{statssales}prestashop>statssales_09a6e97d1ccb13182c8fd316450dbebf'] = 'Affiche l\'évolution du chiffre d\'affaires et la répartition des commandes par statut'; +$_MODULE['<{statssales}prestashop>statssales_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tout afficher'; +$_MODULE['<{statssales}prestashop>statssales_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtrer'; +$_MODULE['<{statssales}prestashop>statssales_052d402bac5d6be562de993113d3108b'] = 'Ces graphiques représentent l\'évolution de vos commandes et chiffre d\'affaires pour une période donnée. Ce n\'est pas un outil d\'analyse avancé mais il vous permet toutefois de visualiser la rentabilité de votre boutique en un clin d\'oeil. Vous pouvez également comparer les ventes entre différentes périodes (Noël...). Seules les commandes valides sont inclues dans ces deux graphes.'; +$_MODULE['<{statssales}prestashop>statssales_9ccb8353e945f1389a9585e7f21b5a0d'] = 'Commandes passées :'; +$_MODULE['<{statssales}prestashop>statssales_156e5c5872c9af24a5c982da07a883c2'] = 'Produits commandés :'; +$_MODULE['<{statssales}prestashop>statssales_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statssales}prestashop>statssales_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Chiffre d\'affaires :'; +$_MODULE['<{statssales}prestashop>statssales_0718e1ec4754e199aa9cb4bc43a6ff53'] = 'La répartition des états de commande est représentée ci-dessous.'; +$_MODULE['<{statssales}prestashop>statssales_da80af4de99df74dd59e665adf1fac8f'] = 'Aucune commande pour cette période'; +$_MODULE['<{statssales}prestashop>statssales_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statssales}prestashop>statssales_75288849ad081e6ef15e00c37b7570f2'] = 'Plusieurs statuts de commande'; +$_MODULE['<{statssales}prestashop>statssales_94272e39a7493ab1baf7600d78926024'] = 'Au sein de votre Back-office, plusieurs statuts de commande sont disponibles : En attente du paiement par chèque, Paiement accepté, Préparation en cours, En cours de livraison, Livré, Annulé, Remboursé, Erreur de paiement, Produits indisponibles et en attente du paiement par virement bancaire.'; +$_MODULE['<{statssales}prestashop>statssales_d3ca3781ea021039c95d2830dd6db169'] = 'Ces statuts ne peuvent être supprimés depuis le Back-office, cependant vous pouvez en ajouter de nouveaux.'; +$_MODULE['<{statssales}prestashop>statssales_bb7ad89807bf69ddca986c142311f936'] = 'Commandes et produits'; +$_MODULE['<{statssales}prestashop>statssales_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Commandes'; +$_MODULE['<{statssales}prestashop>statssales_068f80c7519d0528fb08e82137a72131'] = 'Produits'; +$_MODULE['<{statssales}prestashop>statssales_14f1c54626d722168ee62dff05ed811e'] = 'Chiffre d\'affaires en'; +$_MODULE['<{statssales}prestashop>statssales_33eee7690a8cd62490ed9eeadd47d163'] = 'Pourcentage de commandes par statut'; diff --git a/modules/statssales/it.php b/modules/statssales/it.php new file mode 100644 index 000000000..c4b769308 --- /dev/null +++ b/modules/statssales/it.php @@ -0,0 +1,24 @@ +statssales_45c4b3e103155326596d6ccd2fea0f25'] = 'Le vendite e gli ordini'; +$_MODULE['<{statssales}prestashop>statssales_09a6e97d1ccb13182c8fd316450dbebf'] = 'Visualizza l\'andamento delle vendite e degli ordini per status'; +$_MODULE['<{statssales}prestashop>statssales_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutti'; +$_MODULE['<{statssales}prestashop>statssales_d7778d0c64b6ba21494c97f77a66885a'] = 'Filtro'; +$_MODULE['<{statssales}prestashop>statssales_052d402bac5d6be562de993113d3108b'] = 'Questi grafici rappresentano l\'evoluzione dei tuoi ordini e del fatturato per un determinato periodo. Non è uno strumento di analisi avanzata, ma almeno puoi controllare la redditività del tuo negozio in un lampo. È inoltre possibile tenere sotto controllo la differenza rispetto ad alcuni periodi come Natale. Solo gli ordini validi sono compresi in questi due grafici.'; +$_MODULE['<{statssales}prestashop>statssales_9ccb8353e945f1389a9585e7f21b5a0d'] = 'Gli ordini effettuati:'; +$_MODULE['<{statssales}prestashop>statssales_156e5c5872c9af24a5c982da07a883c2'] = 'I prodotti acquistati:'; +$_MODULE['<{statssales}prestashop>statssales_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statssales}prestashop>statssales_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Vendite:'; +$_MODULE['<{statssales}prestashop>statssales_0718e1ec4754e199aa9cb4bc43a6ff53'] = 'È possibile visualizzare la distribuzione dello stato dell\'ordine di seguito.'; +$_MODULE['<{statssales}prestashop>statssales_da80af4de99df74dd59e665adf1fac8f'] = 'Nessun ordine per questo periodo'; +$_MODULE['<{statssales}prestashop>statssales_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statssales}prestashop>statssales_75288849ad081e6ef15e00c37b7570f2'] = 'Vari status degli ordini'; +$_MODULE['<{statssales}prestashop>statssales_94272e39a7493ab1baf7600d78926024'] = 'Nel tuo back-office, è possibile trovare molti stati dell\'ordine: In attesa di pagamento con assegno, Pagamento accettato, Preparazione in corso, Spedizione, Consegnato, Annullato, Rimborso, Errore di pagamento, Esaurito, e In attesa di pagamento con bonifico bancario.'; +$_MODULE['<{statssales}prestashop>statssales_d3ca3781ea021039c95d2830dd6db169'] = 'Questi stati non possono essere rimossi dal back-office, ma si ha la possibilità di aggiungerne altri'; +$_MODULE['<{statssales}prestashop>statssales_bb7ad89807bf69ddca986c142311f936'] = 'Prodotti e ordini'; +$_MODULE['<{statssales}prestashop>statssales_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Ordini'; +$_MODULE['<{statssales}prestashop>statssales_068f80c7519d0528fb08e82137a72131'] = 'Prodotti'; +$_MODULE['<{statssales}prestashop>statssales_14f1c54626d722168ee62dff05ed811e'] = 'Le vendite in'; +$_MODULE['<{statssales}prestashop>statssales_33eee7690a8cd62490ed9eeadd47d163'] = 'Percentuale degli ordini in base allo stato'; diff --git a/modules/statssales/logo.gif b/modules/statssales/logo.gif new file mode 100644 index 000000000..4364683de Binary files /dev/null and b/modules/statssales/logo.gif differ diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php new file mode 100644 index 000000000..8c5a82a8e --- /dev/null +++ b/modules/statssales/statssales.php @@ -0,0 +1,229 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsSales extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + private $_option = ''; + private $id_country = ''; + + function __construct() + { + $this->name = 'statssales'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Sales and orders'); + $this->description = $this->l('Display the sales evolution and orders by statuses'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function hookAdminStatsModules($params) + { + global $cookie; + + $totals = $this->getTotals(); + $currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT')); + if (($id_export = (int)Tools::getValue('export')) == 1) + $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => '1-'.(int)Tools::getValue('id_country'))); + elseif ($id_export == 2) + $this->csvExport(array('layers' => 0, 'type' => 'line', 'option' => '2-'.(int)Tools::getValue('id_country'))); + elseif ($id_export == 3) + $this->csvExport(array('type' => 'pie', 'option' => '3-'.(int)Tools::getValue('id_country'))); + + $this->_html = ' +
        '.$this->displayName.' +
        + + +
        +

        + '.$this->l('These graphs represent the evolution of your orders and sales turnover for a given period. This tool allows for quick overview of the viability of your shop. You can also keep watch on the difference between time periods (like the holiday season). Only valid orders are included in these two graphs.').' +

        +

        '.$this->l('Orders placed:').' '.(int)($totals['orderCount']).'

        +

        '.$this->l('Products bought:').' '.(int)($totals['products']).'

        +
        '.ModuleGraph::engine(array('type' => 'line', 'option' => '1-'.(int)(Tools::getValue('id_country')), 'layers' => 2)).'
        +

        '.$this->l('CSV Export').'

        +

        '.$this->l('Sales:').' '.Tools::displayPrice($totals['orderSum'], $currency).'

        +
        '.ModuleGraph::engine(array('type' => 'line', 'option' => '2-'.(int)(Tools::getValue('id_country')))).'

        +

        '.$this->l('CSV Export').'

        +

        + '.$this->l('You can see the order state distribution below.').' +


        + '.($totals['orderCount'] ? ModuleGraph::engine(array('type' => 'pie', 'option' => '3-'.(int)Tools::getValue('id_country'))) : $this->l('No orders for this period.')).' +

        '.$this->l('CSV Export').'

        +
        +
        +
        '.$this->l('Guide').' +

        '.$this->l('Various order statuses').'

        +

        + '.$this->l('In your back-office, you can find the following order statuses : Awaiting check payment, Payment accepted, Preparation in progress, Shipping, Delivered, Cancelled, Refund, Payment error, Out of stock, and Awaiting bank wire payment.').'
        + '.$this->l('Statuses cannot be removed from the back-office, but you have the option to add more.').' +

        +
        '; + return $this->_html; + } + + private function getTotals() + { + $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT COUNT(o.`id_order`) as orderCount, SUM(o.`total_paid_real` / o.conversion_rate) as orderSum + FROM `'._DB_PREFIX_.'orders` o + '.((int)(Tools::getValue('id_country')) ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').' + WHERE o.valid = 1 + '.((int)(Tools::getValue('id_country')) ? 'AND a.id_country = '.(int)Tools::getValue('id_country') : '').' + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween()); + + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' + SELECT SUM(od.product_quantity) as products + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON od.`id_order` = o.`id_order` + '.((int)(Tools::getValue('id_country')) ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').' + WHERE o.valid = 1 + '.((int)Tools::getValue('id_country') ? 'AND a.id_country = '.(int)Tools::getValue('id_country') : '').' + AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween()); + return array_merge($result1, $result2); + } + + public function setOption($options, $layers = 1) + { + list($this->_option, $this->id_country) = explode('-', $options); + switch ($this->_option) + { + case 1: + $this->_titles['main'][0] = $this->l('Products and orders'); + $this->_titles['main'][1] = $this->l('Orders'); + $this->_titles['main'][2] = $this->l('Products'); + break; + case 2: + $currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT')); + $this->_titles['main'] = $this->l('Sales in').' '.$currency->iso_code; + break; + case 3: + $this->_titles['main'] = $this->l('Percentage of orders by status'); + break; + } + } + + protected function getData($layers) + { + if ($this->_option == 3) + return $this->getStatesData(); + + $this->_query = ' + SELECT o.`invoice_date`, o.`total_paid_real` / o.conversion_rate AS total_paid_real, SUM(od.product_quantity) as product_quantity + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON od.`id_order` = o.`id_order` + '.((int)($this->id_country) ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').' + WHERE o.valid = 1 + '.((int)($this->id_country) ? 'AND a.id_country = '.(int)$this->id_country : '').' + AND o.`invoice_date` BETWEEN '; + $this->_query2 = ' GROUP BY o.id_order'; + $this->setDateGraph($layers, true); + } + + protected function setYearValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + foreach ($result AS $row) + if ($this->_option == 1) + { + $this->_values[0][(int)(substr($row['invoice_date'], 5, 2))] += 1; + $this->_values[1][(int)(substr($row['invoice_date'], 5, 2))] += $row['product_quantity']; + } + else + $this->_values[(int)(substr($row['invoice_date'], 5, 2))] += $row['total_paid_real']; + } + + protected function setMonthValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + foreach ($result AS $row) + if ($this->_option == 1) + { + $this->_values[0][(int)(substr($row['invoice_date'], 8, 2))] += 1; + $this->_values[1][(int)(substr($row['invoice_date'], 8, 2))] += $row['product_quantity']; + } + else + $this->_values[(int)(substr($row['invoice_date'], 8, 2))] += $row['total_paid_real']; + } + + protected function setDayValues($layers) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + foreach ($result AS $row) + if ($this->_option == 1) + { + $this->_values[0][(int)(substr($row['invoice_date'], 11, 2))] += 1; + $this->_values[1][(int)(substr($row['invoice_date'], 11, 2))] += $row['product_quantity']; + } + else + $this->_values[(int)(substr($row['invoice_date'], 11, 2))] += $row['total_paid_real']; + } + + private function getStatesData() + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT osl.`name`, COUNT(oh.`id_order`) as total + FROM `'._DB_PREFIX_.'order_state` os + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)($this->getLang()).') + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON os.`id_order_state` = oh.`id_order_state` + LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = oh.`id_order` + '.((int)($this->id_country) ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').' + WHERE oh.`id_order_history` = ( + SELECT ios.`id_order_history` + FROM `'._DB_PREFIX_.'order_history` ios + WHERE ios.`id_order` = oh.`id_order` + ORDER BY ios.`date_add` DESC, oh.`id_order_history` DESC + LIMIT 1 + ) + '.((int)($this->id_country) ? 'AND a.id_country = '.(int)($this->id_country) : '').' + AND o.`date_add` BETWEEN '.ModuleGraph::getDateBetween().' + GROUP BY oh.`id_order_state`'); + foreach ($result as $row) + { + $this->_values[] = $row['total']; + $this->_legend[] = $row['name']; + } + } +} \ No newline at end of file diff --git a/modules/statssearch/config.xml b/modules/statssearch/config.xml new file mode 100755 index 000000000..d6db730d6 --- /dev/null +++ b/modules/statssearch/config.xml @@ -0,0 +1,11 @@ + + + statssearch + Shop search + 1 + Display which keywords have been searched by your visitors. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statssearch/de.php b/modules/statssearch/de.php new file mode 100644 index 000000000..c469cda97 --- /dev/null +++ b/modules/statssearch/de.php @@ -0,0 +1,13 @@ +statssearch_8c3c245232744602822902b97e65d6f9'] = 'Shop-Suche'; +$_MODULE['<{statssearch}prestashop>statssearch_5393c969e2fb0e630e03b993fee091e7'] = 'Anzeigen, welche Keywords von Ihren Besuchern gesucht worden sind'; +$_MODULE['<{statssearch}prestashop>statssearch_867343577fa1f33caa632a19543bd252'] = 'Keywords'; +$_MODULE['<{statssearch}prestashop>statssearch_e52e6aa1a43a0187e44f048f658db5f9'] = 'Vorkommen'; +$_MODULE['<{statssearch}prestashop>statssearch_fd69c5cf902969e6fb71d043085ddee6'] = 'Ergebnisse'; +$_MODULE['<{statssearch}prestashop>statssearch_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statssearch}prestashop>statssearch_df7e8db30f72561b6c3f3941ce88722a'] = 'Keine Keywords gesucht, die mehr als einmal gefunden wurden.'; +$_MODULE['<{statssearch}prestashop>statssearch_6b4d88dce7077cd4181a692a1678b60a'] = '10 erste Keywords'; +$_MODULE['<{statssearch}prestashop>statssearch_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Andere'; diff --git a/modules/statssearch/en.php b/modules/statssearch/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statssearch/en.php @@ -0,0 +1,4 @@ +statssearch_8c3c245232744602822902b97e65d6f9'] = 'Búsqueda de la tienda'; +$_MODULE['<{statssearch}prestashop>statssearch_5393c969e2fb0e630e03b993fee091e7'] = 'Mostrar las palabras clave que han sido utilizadas por sus visitantes'; +$_MODULE['<{statssearch}prestashop>statssearch_867343577fa1f33caa632a19543bd252'] = 'Palabras clave'; +$_MODULE['<{statssearch}prestashop>statssearch_e52e6aa1a43a0187e44f048f658db5f9'] = 'Frecuencia'; +$_MODULE['<{statssearch}prestashop>statssearch_fd69c5cf902969e6fb71d043085ddee6'] = 'Resultados'; +$_MODULE['<{statssearch}prestashop>statssearch_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statssearch}prestashop>statssearch_df7e8db30f72561b6c3f3941ce88722a'] = 'ninguna palabra clave buscada más de una vez'; +$_MODULE['<{statssearch}prestashop>statssearch_6b4d88dce7077cd4181a692a1678b60a'] = '10 primeras palabras clave'; +$_MODULE['<{statssearch}prestashop>statssearch_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Otros'; diff --git a/modules/statssearch/fr.php b/modules/statssearch/fr.php new file mode 100644 index 000000000..7a5463119 --- /dev/null +++ b/modules/statssearch/fr.php @@ -0,0 +1,13 @@ +statssearch_8c3c245232744602822902b97e65d6f9'] = 'Recherches de la boutique'; +$_MODULE['<{statssearch}prestashop>statssearch_5393c969e2fb0e630e03b993fee091e7'] = 'Affiche les mots clés recherchés par vos visiteurs'; +$_MODULE['<{statssearch}prestashop>statssearch_867343577fa1f33caa632a19543bd252'] = 'Mots clés'; +$_MODULE['<{statssearch}prestashop>statssearch_e52e6aa1a43a0187e44f048f658db5f9'] = 'Occurences'; +$_MODULE['<{statssearch}prestashop>statssearch_fd69c5cf902969e6fb71d043085ddee6'] = 'Résultats'; +$_MODULE['<{statssearch}prestashop>statssearch_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statssearch}prestashop>statssearch_df7e8db30f72561b6c3f3941ce88722a'] = 'Aucun mot clé recherché plus d\'une fois.'; +$_MODULE['<{statssearch}prestashop>statssearch_6b4d88dce7077cd4181a692a1678b60a'] = '10 premiers mots clés'; +$_MODULE['<{statssearch}prestashop>statssearch_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Autres'; diff --git a/modules/statssearch/it.php b/modules/statssearch/it.php new file mode 100644 index 000000000..757c0faab --- /dev/null +++ b/modules/statssearch/it.php @@ -0,0 +1,13 @@ +statssearch_8c3c245232744602822902b97e65d6f9'] = 'Ricerca negozio'; +$_MODULE['<{statssearch}prestashop>statssearch_5393c969e2fb0e630e03b993fee091e7'] = 'Mostra quali parole chiave sono state ricercate dai tuoi visitatori'; +$_MODULE['<{statssearch}prestashop>statssearch_867343577fa1f33caa632a19543bd252'] = 'parole chiave'; +$_MODULE['<{statssearch}prestashop>statssearch_e52e6aa1a43a0187e44f048f658db5f9'] = 'Occorrenze'; +$_MODULE['<{statssearch}prestashop>statssearch_fd69c5cf902969e6fb71d043085ddee6'] = 'Risultati'; +$_MODULE['<{statssearch}prestashop>statssearch_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statssearch}prestashop>statssearch_df7e8db30f72561b6c3f3941ce88722a'] = 'Nessuna parola chiave cercata più di una volta.'; +$_MODULE['<{statssearch}prestashop>statssearch_6b4d88dce7077cd4181a692a1678b60a'] = 'Le prime 10 parole chiave '; +$_MODULE['<{statssearch}prestashop>statssearch_52ef9633d88a7480b3a938ff9eaa2a25'] = 'Altri'; diff --git a/modules/statssearch/logo.gif b/modules/statssearch/logo.gif new file mode 100644 index 000000000..d5dd1e7b2 Binary files /dev/null and b/modules/statssearch/logo.gif differ diff --git a/modules/statssearch/statssearch.php b/modules/statssearch/statssearch.php new file mode 100644 index 000000000..9a15bf4cd --- /dev/null +++ b/modules/statssearch/statssearch.php @@ -0,0 +1,146 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsSearch extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + + function __construct() + { + $this->name = 'statssearch'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + $this->_query = ' + SELECT ss.`keywords`, COUNT(TRIM(ss.`keywords`)) as occurences, MAX(results) as total + FROM `'._DB_PREFIX_.'statssearch` ss + WHERE ss.`date_add` BETWEEN '; + $this->_query2 = ' + GROUP BY ss.`keywords` + HAVING occurences > 1 + ORDER BY occurences DESC'; + + parent::__construct(); + + $this->displayName = $this->l('Shop search'); + $this->description = $this->l('Display which keywords have been searched by your visitors.'); + } + + function install() + { + if (!parent::install() OR !$this->registerHook('search') OR !$this->registerHook('AdminStatsModules')) + return false; + return Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'statssearch` ( + id_statssearch INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + keywords VARCHAR(255) NOT NULL, + results INT(6) NOT NULL DEFAULT 0, + date_add DATETIME NOT NULL, + PRIMARY KEY(id_statssearch) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); + } + + function uninstall() + { + if (!parent::uninstall()) + return false; + return (Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'statssearch`')); + } + + function hookSearch($params) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'statssearch` (`keywords`,`results`,`date_add`) VALUES (\''.pSQL($params['expr']).'\', '.(int)($params['total']).', NOW())'); + } + + function hookAdminStatsModules() + { + if (Tools::getValue('export')) + $this->csvExport(array('type' => 'pie')); + + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.ModuleGraph::getDateBetween().$this->_query2); + $this->_html = ' +
        '.$this->displayName.''; + $table = '
        + + + + + + + + '; + + foreach ($result as $row) + $table .= ' + + + + '; + $table .= '
        '.$this->l('Keywords').''.$this->l('Occurrences').''.$this->l('Results').'
        '.$row['keywords'].''.$row['occurences'].''.$row['total'].'
        '; + + if (sizeof($result)) + $this->_html .= '
        '.ModuleGraph::engine(array('type' => 'pie')).'
        +

        '.$this->l('CSV Export').'

        +
        '.$table; + else + $this->_html .= '

        '.$this->l('No keywords searched more than once found.').'

        '; + $this->_html .= '
        '; + return $this->_html; + } + + protected function getData($layers) + { + $this->_titles['main'] = $this->l('First 10 keywords'); + $totalResult = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2); + $total = 0; + $total2 = 0; + foreach ($totalResult as $totalRow) + $total += $totalRow['occurences']; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2.' LIMIT 9'); + foreach ($result as $row) + { + if (!$row['occurences']) + continue; + $this->_legend[] = $row['keywords']; + $this->_values[] = $row['occurences']; + $total2 += $row['occurences']; + } + if ($total > $total2) + { + $this->_legend[] = $this->l('Others'); + $this->_values[] = $total - $total2; + } + } +} + + diff --git a/modules/statsstock/config.xml b/modules/statsstock/config.xml new file mode 100755 index 000000000..1bb660416 --- /dev/null +++ b/modules/statsstock/config.xml @@ -0,0 +1,11 @@ + + + statsstock + Stock stats + 1 + + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsstock/de.php b/modules/statsstock/de.php new file mode 100644 index 000000000..30fa776d9 --- /dev/null +++ b/modules/statsstock/de.php @@ -0,0 +1,19 @@ +statsstock_1e8a6897e195774f3bc6fa7b2ae7f801'] = 'Lager-Statistik'; +$_MODULE['<{statsstock}prestashop>statsstock_8fd17aacf4c601e502cade4914545d4d'] = 'Lager-Wert'; +$_MODULE['<{statsstock}prestashop>statsstock_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie'; +$_MODULE['<{statsstock}prestashop>statsstock_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Alle'; +$_MODULE['<{statsstock}prestashop>statsstock_1b2379801de373b6b563c347014fb34b'] = 'Ihr Katalog ist leer.'; +$_MODULE['<{statsstock}prestashop>statsstock_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statsstock}prestashop>statsstock_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsstock}prestashop>statsstock_7d74f3b92b19da5e606d737d339a9679'] = 'Artikel'; +$_MODULE['<{statsstock}prestashop>statsstock_27ce7f8b5623b2e2df568d64cf051607'] = 'Lager'; +$_MODULE['<{statsstock}prestashop>statsstock_88940d60e75cf4ff38ce27db4efc83b2'] = 'Preis *'; +$_MODULE['<{statsstock}prestashop>statsstock_689202409e48743b914713f96d93947c'] = 'Wert'; +$_MODULE['<{statsstock}prestashop>statsstock_26d6b7e13fef62e89ebdc5b7bef429cb'] = 'Gesamtbestand'; +$_MODULE['<{statsstock}prestashop>statsstock_4364f8c09d7bf97996a20840900e7b30'] = 'Durchschnittl. Preis'; +$_MODULE['<{statsstock}prestashop>statsstock_62668f75fc6977f3d09df632d1585d07'] = 'Gesamtwert'; +$_MODULE['<{statsstock}prestashop>statsstock_2dee758ce6cb0116b234dc3908f016c5'] = 'Durchschnittlicher Preis, wenn das Produkt Attribute hat.'; diff --git a/modules/statsstock/es.php b/modules/statsstock/es.php new file mode 100644 index 000000000..b76cd97b2 --- /dev/null +++ b/modules/statsstock/es.php @@ -0,0 +1,19 @@ +statsstock_1e8a6897e195774f3bc6fa7b2ae7f801'] = 'Estadísticas stock'; +$_MODULE['<{statsstock}prestashop>statsstock_8fd17aacf4c601e502cade4914545d4d'] = 'Valor del stock'; +$_MODULE['<{statsstock}prestashop>statsstock_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría'; +$_MODULE['<{statsstock}prestashop>statsstock_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todas'; +$_MODULE['<{statsstock}prestashop>statsstock_1b2379801de373b6b563c347014fb34b'] = 'Su catálogo está vacío'; +$_MODULE['<{statsstock}prestashop>statsstock_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statsstock}prestashop>statsstock_12d3c7a4296542c62474856ec452c045'] = 'Ref.'; +$_MODULE['<{statsstock}prestashop>statsstock_7d74f3b92b19da5e606d737d339a9679'] = 'Artículo'; +$_MODULE['<{statsstock}prestashop>statsstock_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsstock}prestashop>statsstock_88940d60e75cf4ff38ce27db4efc83b2'] = 'Precio*'; +$_MODULE['<{statsstock}prestashop>statsstock_689202409e48743b914713f96d93947c'] = 'Valor'; +$_MODULE['<{statsstock}prestashop>statsstock_26d6b7e13fef62e89ebdc5b7bef429cb'] = 'Stock total'; +$_MODULE['<{statsstock}prestashop>statsstock_4364f8c09d7bf97996a20840900e7b30'] = 'Precio medio'; +$_MODULE['<{statsstock}prestashop>statsstock_62668f75fc6977f3d09df632d1585d07'] = 'Valor total'; +$_MODULE['<{statsstock}prestashop>statsstock_2dee758ce6cb0116b234dc3908f016c5'] = 'Precio medio cuando el producto tiene declinaciones.'; diff --git a/modules/statsstock/fr.php b/modules/statsstock/fr.php new file mode 100644 index 000000000..836254f4f --- /dev/null +++ b/modules/statsstock/fr.php @@ -0,0 +1,19 @@ +statsstock_1e8a6897e195774f3bc6fa7b2ae7f801'] = 'Stats stock'; +$_MODULE['<{statsstock}prestashop>statsstock_8fd17aacf4c601e502cade4914545d4d'] = 'Stats stock'; +$_MODULE['<{statsstock}prestashop>statsstock_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie'; +$_MODULE['<{statsstock}prestashop>statsstock_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Toutes'; +$_MODULE['<{statsstock}prestashop>statsstock_1b2379801de373b6b563c347014fb34b'] = 'Votre catalogue est vide.'; +$_MODULE['<{statsstock}prestashop>statsstock_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statsstock}prestashop>statsstock_12d3c7a4296542c62474856ec452c045'] = 'Réf.'; +$_MODULE['<{statsstock}prestashop>statsstock_7d74f3b92b19da5e606d737d339a9679'] = 'Article'; +$_MODULE['<{statsstock}prestashop>statsstock_27ce7f8b5623b2e2df568d64cf051607'] = 'Stock'; +$_MODULE['<{statsstock}prestashop>statsstock_88940d60e75cf4ff38ce27db4efc83b2'] = 'Prix*'; +$_MODULE['<{statsstock}prestashop>statsstock_689202409e48743b914713f96d93947c'] = 'Valeur'; +$_MODULE['<{statsstock}prestashop>statsstock_26d6b7e13fef62e89ebdc5b7bef429cb'] = 'Stock total'; +$_MODULE['<{statsstock}prestashop>statsstock_4364f8c09d7bf97996a20840900e7b30'] = 'Prix moyen'; +$_MODULE['<{statsstock}prestashop>statsstock_62668f75fc6977f3d09df632d1585d07'] = 'Valeur total'; +$_MODULE['<{statsstock}prestashop>statsstock_2dee758ce6cb0116b234dc3908f016c5'] = 'Prix moyen lorsque le produit comporte des déclinaisons.'; diff --git a/modules/statsstock/it.php b/modules/statsstock/it.php new file mode 100644 index 000000000..569538f32 --- /dev/null +++ b/modules/statsstock/it.php @@ -0,0 +1,19 @@ +statsstock_1e8a6897e195774f3bc6fa7b2ae7f801'] = 'Statistiche magazzino'; +$_MODULE['<{statsstock}prestashop>statsstock_8fd17aacf4c601e502cade4914545d4d'] = 'Valore magazzino'; +$_MODULE['<{statsstock}prestashop>statsstock_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria'; +$_MODULE['<{statsstock}prestashop>statsstock_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Tutti'; +$_MODULE['<{statsstock}prestashop>statsstock_1b2379801de373b6b563c347014fb34b'] = 'Il tuo catalogo è vuoto.'; +$_MODULE['<{statsstock}prestashop>statsstock_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{statsstock}prestashop>statsstock_12d3c7a4296542c62474856ec452c045'] = 'Rif.'; +$_MODULE['<{statsstock}prestashop>statsstock_7d74f3b92b19da5e606d737d339a9679'] = 'Articolo'; +$_MODULE['<{statsstock}prestashop>statsstock_27ce7f8b5623b2e2df568d64cf051607'] = 'Magazzino'; +$_MODULE['<{statsstock}prestashop>statsstock_88940d60e75cf4ff38ce27db4efc83b2'] = 'Prezzo *'; +$_MODULE['<{statsstock}prestashop>statsstock_689202409e48743b914713f96d93947c'] = 'Valore'; +$_MODULE['<{statsstock}prestashop>statsstock_26d6b7e13fef62e89ebdc5b7bef429cb'] = 'Magazzino totale'; +$_MODULE['<{statsstock}prestashop>statsstock_4364f8c09d7bf97996a20840900e7b30'] = 'Prezzo medio'; +$_MODULE['<{statsstock}prestashop>statsstock_62668f75fc6977f3d09df632d1585d07'] = 'Valore totale'; +$_MODULE['<{statsstock}prestashop>statsstock_2dee758ce6cb0116b234dc3908f016c5'] = 'Prezzo medio quando il prodotto ha attributi.'; diff --git a/modules/statsstock/logo.gif b/modules/statsstock/logo.gif new file mode 100644 index 000000000..be2d2d62f Binary files /dev/null and b/modules/statsstock/logo.gif differ diff --git a/modules/statsstock/statsstock.php b/modules/statsstock/statsstock.php new file mode 100644 index 000000000..22e6ca0ec --- /dev/null +++ b/modules/statsstock/statsstock.php @@ -0,0 +1,136 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class StatsStock extends Module +{ + function __construct() + { + $this->name = 'statsstock'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Stock stats'); + $this->description = ''; + } + + public function install() + { + return (parent::install() && $this->registerHook('AdminStatsModules')); + } + + function hookAdminStatsModules() + { + global $cookie, $currentIndex; + + if (Tools::isSubmit('submitCategory')) + $cookie->statsstock_id_category = Tools::getValue('statsstock_id_category'); + + $ru = $currentIndex.'&module='.$this->name.'&token='.Tools::getValue('token'); + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $filter = ((int)$cookie->statsstock_id_category ? 'WHERE p.id_product IN (SELECT cp.id_product FROM '._DB_PREFIX_.'category_product cp WHERE cp.id_category = '.(int)$cookie->statsstock_id_category.')' : ''); + $products = Db::getInstance()->ExecuteS(' + SELECT p.id_product, p.reference, pl.name, + IFNULL(( + SELECT AVG(pa.wholesale_price) + FROM '._DB_PREFIX_.'product_attribute pa WHERE p.id_product = pa.id_product + AND wholesale_price != 0 + ), p.wholesale_price) as wholesale_price, + IFNULL(( + SELECT SUM(pa.quantity) + FROM '._DB_PREFIX_.'product_attribute pa WHERE p.id_product = pa.id_product + ), p.quantity) as quantity, + IFNULL(( + SELECT SUM(IF(pa.wholesale_price > 0, pa.wholesale_price, p.wholesale_price) * pa.quantity) + FROM '._DB_PREFIX_.'product_attribute pa WHERE p.id_product = pa.id_product + ), p.wholesale_price * p.quantity) as stockvalue + FROM '._DB_PREFIX_.'product p + INNER JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product AND pl.id_lang = '.(int)$cookie->id_lang.') + '.$filter); + + echo ' + +

        '.$this->l('Stock value').'

        +
        + + '.$this->l('Category').' : +
        +
         
        '; + + if (!count($products)) + echo $this->l('Your catalog is empty.'); + else + { + $rollup = array('quantity' => 0, 'wholesale_price' => 0, 'stockvalue' => 0); + echo ' + + + + + + + + '; + foreach ($products as $product) + { + $rollup['quantity'] += $product['quantity']; + $rollup['wholesale_price'] += $product['wholesale_price']; + $rollup['stockvalue'] += $product['stockvalue']; + echo ' + + + + + + + '; + } + echo ' + + + + + + + + + + + + +
        '.$this->l('ID').''.$this->l('Ref.').''.$this->l('Item').''.$this->l('Stock').''.$this->l('Price*').''.$this->l('Value').'
        '.$product['id_product'].''.$product['reference'].''.$product['name'].''.$product['quantity'].''.Tools::displayPrice($product['wholesale_price'], $currency).''.Tools::displayPrice($product['stockvalue'], $currency).'
        '.$this->l('Total stock').''.$this->l('Avg price').''.$this->l('Total value').'
        '.$rollup['quantity'].''.Tools::displayPrice($rollup['wholesale_price'] / count($products), $currency).''.Tools::displayPrice($rollup['stockvalue'], $currency).'
        +

        * '.$this->l('Average price when the product has attributes.').'

        '; + } + } +} + diff --git a/modules/statsvisits/config.xml b/modules/statsvisits/config.xml new file mode 100755 index 000000000..579f2883c --- /dev/null +++ b/modules/statsvisits/config.xml @@ -0,0 +1,11 @@ + + + statsvisits + Visits and Visitors + 1 + Display statistics about your visits and visitors. + PrestaShop + analytics_stats + 0 + 1 + \ No newline at end of file diff --git a/modules/statsvisits/de.php b/modules/statsvisits/de.php new file mode 100644 index 000000000..e651c3344 --- /dev/null +++ b/modules/statsvisits/de.php @@ -0,0 +1,20 @@ +statsvisits_504c16c26a96283f91fb46a69b7c8153'] = 'Besuche und Besucher'; +$_MODULE['<{statsvisits}prestashop>statsvisits_2d9101f085dd2114768a88ec53a4d338'] = 'Zeigt Statistiken über Ihre Besuche und Besucher an'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9efcb563b932863f45ab70cbf1647a61'] = 'Ein Besuch entspricht einem Internet-Benutzer, der Ihren Shop besucht. Bis zum Ende ihres Besuchs auf dieser Webseite wird nur ein Besuch gezählt.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9cc2d19df71705e62e5ae8ec152ef78f'] = 'Ein Besucher ist eine unbekannte Person - die nicht registriert oder angemeldet ist - und in Ihrem Shop surft. Ein Besucher kann Ihren Shop mehrmals besuchen.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_54067074d24489ddb5654bf46642cb85'] = 'Besuche gesamt:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_23e640d55e56db79971918936e95bf9d'] = 'Besucher gesamt:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export'; +$_MODULE['<{statsvisits}prestashop>statsvisits_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ffbee337f031c2282b311bac40bc8bb9'] = 'Bestimmen Sie das Ziel eines Besuchs'; +$_MODULE['<{statsvisits}prestashop>statsvisits_e90d50ca1e68dc66c97bd62929dcbaf1'] = 'Die Besucherentwicklungsgrafik sieht der Besuchsgrafik sehr ähnlich, liefert aber zusätzliche Informationen: '; +$_MODULE['<{statsvisits}prestashop>statsvisits_cb3ba5c56a0115bd92d888c89e759745'] = 'Falls dies der Fall ist: Gratulation, Ihre Webseite ist gut durchdacht und gefällt.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_0ec292c17c7dded03bee9b3a6528cb9c'] = 'Anderenfalls ist die Bilanz nicht so einfach. Es kann sich um ein ÄSthetisches oder ergonomisches Problem handeln, oder das Angebot ist unzureichend. Es kann auch sein, dass diese Besucher rein zufällig auf diese Webseite gekommen sind, ohne spezielles Interesse an Ihrem Shop; dieses Phänomen tritt häufig auf bei Suchmaschinen.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_4793db9717cc512af1406b09766a0a1f'] = 'Diese Information ist hauptsächlich qualitativer Art: Sie müssen die Ursache eines zufälligen Besuchs erkennen.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_39b960b0a5e2ebaaa638d946f1892050'] = 'Anzahl der Besuche und einmalige Besucher'; +$_MODULE['<{statsvisits}prestashop>statsvisits_d7e637a6e9ff116de2fa89551240a94d'] = 'Besuche'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher'; diff --git a/modules/statsvisits/en.php b/modules/statsvisits/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/statsvisits/en.php @@ -0,0 +1,4 @@ +statsvisits_504c16c26a96283f91fb46a69b7c8153'] = 'Visitas y Visitantes'; +$_MODULE['<{statsvisits}prestashop>statsvisits_2d9101f085dd2114768a88ec53a4d338'] = 'Mostrar estadísticas sobre visitas y visitantes'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9efcb563b932863f45ab70cbf1647a61'] = 'Una visita corresponde a un usuario que visita su tienda. Hasta el final de la sesión se contabiliza una única visita.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9cc2d19df71705e62e5ae8ec152ef78f'] = 'Un visitante es una persona desconocida, que no se ha registrado ni abierto una sesión- que visita su tienda. Un visitante puede visitar su tienda varias veces.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_54067074d24489ddb5654bf46642cb85'] = 'Total de visitas:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_23e640d55e56db79971918936e95bf9d'] = 'Total de visitantes:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export'; +$_MODULE['<{statsvisits}prestashop>statsvisits_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guía'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ffbee337f031c2282b311bac40bc8bb9'] = 'Determinar el interés de las visitas'; +$_MODULE['<{statsvisits}prestashop>statsvisits_e90d50ca1e68dc66c97bd62929dcbaf1'] = 'El gráfico de evolución visitantes es muy similar al gráfico de las visitas pero da información suplementaria'; +$_MODULE['<{statsvisits}prestashop>statsvisits_cb3ba5c56a0115bd92d888c89e759745'] = 'Si es el caso, enhorabuena, su sitio está bien pensado y resulta agradable.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_0ec292c17c7dded03bee9b3a6528cb9c'] = 'En el caso contrario, la conclusión no es simple. El problema puede ser estético o ergonómico, o quizás la oferta sea insuficiente. También es posible que dichos visitantes hayan llegado a su sitio por error, sin interés particular por su tienda; este fenómeno ocurre con frecuencia con los motores de búsqueda.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_4793db9717cc512af1406b09766a0a1f'] = 'Esta información es sobre todo cualitativa. Usted deberá determinar el interés de este tipo de visitas.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_39b960b0a5e2ebaaa638d946f1892050'] = 'Número de visitas y visitantes únicos'; +$_MODULE['<{statsvisits}prestashop>statsvisits_d7e637a6e9ff116de2fa89551240a94d'] = 'Visitas'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes'; diff --git a/modules/statsvisits/fr.php b/modules/statsvisits/fr.php new file mode 100644 index 000000000..e0b3f6ef5 --- /dev/null +++ b/modules/statsvisits/fr.php @@ -0,0 +1,20 @@ +statsvisits_504c16c26a96283f91fb46a69b7c8153'] = 'Visites et visiteurs'; +$_MODULE['<{statsvisits}prestashop>statsvisits_2d9101f085dd2114768a88ec53a4d338'] = 'Propose des graphiques montrant l\'évolution de vos visites et visiteurs'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9efcb563b932863f45ab70cbf1647a61'] = 'Une visite correspond au passage d\'un internaute sur votre boutique. Une seule visite est comptée pour toute la durée de sa session.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9cc2d19df71705e62e5ae8ec152ef78f'] = 'On appelle visiteur une personne inconnue - non inscrite ou non identifiée - naviguant sur votre boutique. Un visiteur peut donc visiter votre boutique plusieurs fois.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_54067074d24489ddb5654bf46642cb85'] = 'Nombre total de visites'; +$_MODULE['<{statsvisits}prestashop>statsvisits_23e640d55e56db79971918936e95bf9d'] = 'Nombre total de visiteurs'; +$_MODULE['<{statsvisits}prestashop>statsvisits_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV'; +$_MODULE['<{statsvisits}prestashop>statsvisits_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guide'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ffbee337f031c2282b311bac40bc8bb9'] = 'Déterminez l\'intérêt d\'une visite'; +$_MODULE['<{statsvisits}prestashop>statsvisits_e90d50ca1e68dc66c97bd62929dcbaf1'] = 'Le graphique d\'évolution visiteurs ressemble fortement au graphique des visites, mais fournit des informations supplémentaires:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_cb3ba5c56a0115bd92d888c89e759745'] = 'Si c\'est le cas, alors félicitations, votre site est bien conçu et plaît indéniablement.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_0ec292c17c7dded03bee9b3a6528cb9c'] = 'Dans le cas contraire, la conclusion n\'est pas si simple. Le problème peut être esthétique ou ergonomique, ou alors l\'offre insuffisante. Il se peut également que ces visiteurs soient arrivés là par erreur, sans intérêt particulier pour votre boutique ; ce phénomène arrive couramment avec les moteurs de recherche.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_4793db9717cc512af1406b09766a0a1f'] = 'Cette information est surtout qualitative : c\'est à vous de déterminer l\'intérêt d\'une visite sans suite.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_39b960b0a5e2ebaaa638d946f1892050'] = 'Nombre de visites et visiteurs uniques'; +$_MODULE['<{statsvisits}prestashop>statsvisits_d7e637a6e9ff116de2fa89551240a94d'] = 'Visites'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs'; diff --git a/modules/statsvisits/it.php b/modules/statsvisits/it.php new file mode 100644 index 000000000..99f844bbf --- /dev/null +++ b/modules/statsvisits/it.php @@ -0,0 +1,20 @@ +statsvisits_504c16c26a96283f91fb46a69b7c8153'] = 'Visite e visitatori'; +$_MODULE['<{statsvisits}prestashop>statsvisits_2d9101f085dd2114768a88ec53a4d338'] = 'Visualizza le statistiche relative alle visite e visitatori'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9efcb563b932863f45ab70cbf1647a61'] = 'Una visita corrisponde ad un utente di Internet che viene nel tuo negozio. Fino alla fine della sessione, una sola visita viene conteggiata.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_9cc2d19df71705e62e5ae8ec152ef78f'] = 'Un visitatore è una persona sconosciuta - che non si è registrata o iscritta - e naviga nel tuo negozio. Un visitatore può venire a visitare il tuo negozio molte volte.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_54067074d24489ddb5654bf46642cb85'] = 'Visite totali:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_23e640d55e56db79971918936e95bf9d'] = 'Totale visitatori:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV'; +$_MODULE['<{statsvisits}prestashop>statsvisits_6602bbeb2956c035fb4cb5e844a4861b'] = 'Guida'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ffbee337f031c2282b311bac40bc8bb9'] = 'Determinare l\'interesse di una visita'; +$_MODULE['<{statsvisits}prestashop>statsvisits_e90d50ca1e68dc66c97bd62929dcbaf1'] = 'Il grafico di evoluzione dei visitatori ricorda molto il grafico delle visite, ma fornisce ulteriori informazioni:'; +$_MODULE['<{statsvisits}prestashop>statsvisits_cb3ba5c56a0115bd92d888c89e759745'] = 'Se questo è il caso, complimenti, il tuo sito è ben congegnato e piacevole.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_0ec292c17c7dded03bee9b3a6528cb9c'] = 'In caso contrario, la conclusione non è così semplice. Il problema può essere estetico o ergonomico, oppure l\'offerta non è sufficiente. E\' anche possibile che questi visitatori sono arrivati qui per errore, senza particolare interesse per il tuo negozio, questo fenomeno spesso accade con i motori di ricerca.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_4793db9717cc512af1406b09766a0a1f'] = 'Questa informazione è prevalentemente qualitativa: è necessario determinare l\'interesse di una visita errata.'; +$_MODULE['<{statsvisits}prestashop>statsvisits_39b960b0a5e2ebaaa638d946f1892050'] = 'Numero di visite e visitatori unici'; +$_MODULE['<{statsvisits}prestashop>statsvisits_d7e637a6e9ff116de2fa89551240a94d'] = 'Visite'; +$_MODULE['<{statsvisits}prestashop>statsvisits_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori'; diff --git a/modules/statsvisits/logo.gif b/modules/statsvisits/logo.gif new file mode 100644 index 000000000..fb73d718b Binary files /dev/null and b/modules/statsvisits/logo.gif differ diff --git a/modules/statsvisits/statsvisits.php b/modules/statsvisits/statsvisits.php new file mode 100644 index 000000000..38655d89e --- /dev/null +++ b/modules/statsvisits/statsvisits.php @@ -0,0 +1,161 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class StatsVisits extends ModuleGraph +{ + private $_html = ''; + private $_query = ''; + private $_query2 = ''; + private $_option; + + function __construct() + { + $this->name = 'statsvisits'; + $this->tab = 'analytics_stats'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Visits and Visitors'); + $this->description = $this->l('Display statistics about your visits and visitors.'); + } + + public function install() + { + return (parent::install() AND $this->registerHook('AdminStatsModules')); + } + + public function getTotalVisits() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(c.`id_connections`) + FROM `'._DB_PREFIX_.'connections` c + WHERE c.`date_add` BETWEEN '.ModuleGraph::getDateBetween()); + } + + public function getTotalGuests() + { + return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT COUNT(DISTINCT c.`id_guest`) + FROM `'._DB_PREFIX_.'connections` c + WHERE c.`date_add` BETWEEN '.ModuleGraph::getDateBetween()); + } + + public function hookAdminStatsModules($params) + { + $totalVisits = $this->getTotalVisits(); + $totalGuests = $this->getTotalGuests(); + if (Tools::getValue('export')) + $this->csvExport(array('layers' =>2, 'type' => 'line', 'option' => 3)); + $this->_html = ' +
        '.$this->displayName.' +

        + '.$this->l('A visit corresponds to an internet user coming to your shop. Until the end of their session, only one visit is counted.').' + '.$this->l('A visitor is an unknown person, who has not registered or logged on, surfing on your shop. A visitor can come and visit your shop many times.').' +

        +
        +

        '.$this->l('Total visits:').' '.$totalVisits.'

        +

        '.$this->l('Total visitors:').' '.$totalGuests.'

        + '.($totalVisits ? ModuleGraph::engine(array('layers' => 2, 'type' => 'line', 'option' => 3)).'

        '.$this->l('CSV Export').'

        ' : '').' + +
        +
        +
        '.$this->l('Guide').' +

        '.$this->l('Determine the interest of a visit').'

        + '.$this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:').'
        +
          +
        • '.$this->l('If this is the case, congratulations, your website is well planned and pleasing.').'
        • +
        • '.$this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic, or else the offer is not sufficient. It is also possible that these visitors mistakenly came here without particular interest for your shop; this phenomenon often happens with the search engines.').'
        • +
        + '.$this->l('This information is mostly qualitative: you have to determine the interest of a disjointed visit.').'
        +
        '; + + return $this->_html; + } + + public function setOption($option, $layers = 1) + { + switch ($option) + { + case 3: + $this->_titles['main'][0] = $this->l('Number of visits and unique visitors'); + $this->_titles['main'][1] = $this->l('Visits'); + $this->_titles['main'][2] = $this->l('Visitors'); + $this->_query[0] = ' + SELECT date_add, COUNT(`date_add`) as total + FROM `'._DB_PREFIX_.'connections` + WHERE `date_add` BETWEEN '; + $this->_query[1] = ' + SELECT date_add, COUNT(DISTINCT `id_guest`) as total + FROM `'._DB_PREFIX_.'connections` + WHERE `date_add` BETWEEN '; + break; + } + } + + protected function getData($layers) + { + $this->setDateGraph($layers, true); + } + + protected function setYearValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i].$this->getDate().' GROUP BY LEFT(date_add, 7)'); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 5, 2))] = (int)($row['total']); + } + } + + protected function setMonthValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i].$this->getDate().' GROUP BY LEFT(date_add, 10)'); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 8, 2))] = (int)($row['total']); + } + } + + protected function setDayValues($layers) + { + for ($i = 0; $i < $layers; $i++) + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query[$i].$this->getDate().' GROUP BY LEFT(date_add, 13)'); + foreach ($result AS $row) + $this->_values[$i][(int)(substr($row['date_add'], 11, 2))] = (int)($row['total']); + } + } +} + + diff --git a/modules/themeinstallator/add.png b/modules/themeinstallator/add.png new file mode 100644 index 000000000..f4872d2dd Binary files /dev/null and b/modules/themeinstallator/add.png differ diff --git a/modules/themeinstallator/config.xml b/modules/themeinstallator/config.xml new file mode 100755 index 000000000..cf5b71c90 --- /dev/null +++ b/modules/themeinstallator/config.xml @@ -0,0 +1,11 @@ + + + themeinstallator + Import/export a theme + 1.3 + Export or Install a theme and its modules on your shop. + PrestaShop + administration + 1 + 1 + \ No newline at end of file diff --git a/modules/themeinstallator/de.php b/modules/themeinstallator/de.php new file mode 100644 index 000000000..d28a1ba18 --- /dev/null +++ b/modules/themeinstallator/de.php @@ -0,0 +1,88 @@ +themeinstallator_fff01a1de50e0559f82501a927654d1b'] = 'Import / Export eines Themas'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_83ebbd7865677d356ffde5ad7e12784f'] = 'Exportieren oder installieren Sie ein Thema und seine Module auf Ihren Shop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e10ed1f81b51bd4c7f86eeb84bcd1359'] = 'zip ist nicht auf Ihrem Server installiert. Erkundigen Sie sich bei Ihrem Provider.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_25b9e1d82d8200d70be2b22a1a283957'] = 'Ein Fehler ist beim Hochladen der Datei aufgetreten.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_050991b5b76aad0be75563b7cb93a33e'] = 'Nur zip-Dateien sind erlaubt'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_57c1ed81b02e5d3361323c7930897295'] = 'Ein Fehler ist beim Kopieren der Datei aufgetreten.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5fd13c2b89a6eaaa4614bfe258f6c40f'] = 'Zip-Datei scheint beschädigt zu sein'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dea6caeb83e5c11d3678284e64ebed8'] = 'Fehler beim Herunterladen der Datei'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c186217583219f4cd040d9ee8d388ffb'] = 'Fehler bei der Zip-Extraktion'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0210b6456cdccad569cb56026bb0f689'] = 'Schlechte Konfigurationsdatei'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5b6cf869265c13af8566f192b4ab3d2a'] = 'Dokumentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_6bdbe5a8a9f446d4d758ee4c22648771'] = 'Sie möchten eventuell die Dokumentation prüfen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7348fd57bfb5c837fc57e54fcfeeed9e'] = 'Rechtsklick auf den Namen und \"Link speichern unter\" wählen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b857ef1f431c5f3290dc5b5e644826a6'] = 'Folgende Module wurden installiert'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_22c765d777eb4ca6b4292bcbb596872e'] = 'Folgende Module wurden deaktiviert'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e501dc865768ac08d49c129a23c3ae09'] = 'Folgende Module wurden aktiviert'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dfbf4744524c8573235d60589d8b66e'] = 'Bilder wurden korrekt in der Datenbank aktualisiert'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd1f775e443ff3b9a89270713580a51b'] = 'Zurück'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a20ddccbb6f808ec42cd66323e6c6061'] = 'Fertig'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_33167fe8de7517798cf2e95c7680d6a4'] = 'Die folgenden Themen wurden erfolgreich importiert'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4ef3a40f287dd9849004a7f5af73f00'] = 'Achtung: ein Modul mit dem gleichen Namen existiert bereits'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_df8703a4066393da85e8188261660717'] = 'Wählen Sie das Themenmodul, das Sie installieren möchten'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7651cc4a979c5e21ee50de988ce574b0'] = 'Native Modulkonfiguration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8ab378b3ad05e14cbe61bff60c50afa6'] = 'Aktuelle Konfiguration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f94545e00cff9d0395194458b2245702'] = 'Themen-Konfiguration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_130c5b3473c57faa76e2a1c54e26f88e'] = 'Beide'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c90ba3aaed0a2bafed18233111062cf0'] = 'Konfiguration der Themenbilder'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2a84d9915b12fcb0c1436709a77a8dd0'] = 'Hinzufügen einer neuer Konfiguration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd3acd810b479275ce68d69e78ed7a95'] = 'Fügen Sie alle hinzu (Sie verlieren eventuell Ihre aktuelle Konfig.)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_332efbbfb2c4bd5a37fd7a55659b821a'] = 'Nichts ändern'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Weiter'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5138a89d1b730dacf446855e15c24496'] = 'Sie werden die folgenden Themen installieren'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f364da141450380ae79d7a45528f4c06'] = 'Dieses Thema ist für Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac85d9784348dc8f0c2db93f4a095eb0'] = 'Achtung: Sie haben bereits ein Thema mit dem gleichen Ordnernamen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8f3ea15c5b87db00561ccde5067310a5'] = 'für Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_caeedb303068f9915e8e5ce091c9c02f'] = '(Achtung: Ein Ordner mit dem gleichen Namen ist bereits vorhanden)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2dd99d7426b4fe6dd04d7a98f5e32a62'] = 'Wählen Sie die Varianten, die Sie importieren möchten'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f956917da1716add289f33a8869b85d4'] = 'Hauptthema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1e3de51d693cd0c7e903bcf3769a0cdb'] = 'Deaktivieren Sie dieses Feld, wenn Sie das Hauptthema nicht installieren möchten'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c49fbf2b822fd14929fd1fd76cdb0c96'] = 'Wählen Sie die Variationen, die Sie importieren möchten'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d1baba351b02042982a133c4df5d4924'] = 'Exportieren Sie ein Thema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5092965125a28a17f49ee460fbc1f62c'] = 'Wählen Sie ein Thema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0557cae4cf5b379e665910d701210f69'] = 'Exportieren Sie dieses Thema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7961c4434751797a383d52d647e044d6'] = 'Import aus Ihrem Computer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bc52857ec49d8de10e55171f5bbc7f2a'] = 'Archiv-Datei'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_24ad8bfdfce09842a83f10d59a8ef01f'] = 'Wo ist Ihre Zip-Datei?'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dec0faa6eb19bd9120d12c5a876bd1cf'] = 'Import aus dem Internet'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a33388a338ee2b199d66112369279558'] = 'Archiv-URL'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_cd8d9cc19984ccf9d314eee5eebfc2cc'] = 'Import vom FTP'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_94f2371003860a92b12bf4c66b2851ac'] = 'Wählen Sie ein Archiv'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1031371f906a92891140f384d04b3421'] = 'Ein Fehler trat beim Generieren des Archivs auf'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2c19b34eebed37ccc288c518006615b3'] = 'Fehler in Ihrer E-Mail-Syntax!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_129b7dae66f0029381da64578a351198'] = 'Fehler in Ihrer URL-Syntax!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_87e0eaf3f9614cb904fafb0d4f4c1f56'] = 'Dateierweiterung muss .txt oder .pdf sein'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_550a06d4fd147c22a4c921036003abf6'] = 'Fehler beim heraufladen der Dokumentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ecd8e7704f6f4f730f6a43bfb24a9546'] = 'Bitte geben Sie einen gültigen Dokumentationsnamen an'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_623e4ca0275c19c3134b7290fdd19264'] = 'Bitte geben Sie einen gültigen Autornamen an '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a43f1054076c2389afd746ec3d5d1c71'] = 'Bitte geben Sie einen gültigen Themennamen an'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_03d105aa95f842fc54b18ca8a73109ca'] = 'Bitte geben Sie einen gültigen Themavariationsnamen an'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_9891d2e13ad8b753833055c5809a733e'] = 'Syntaxfehler im Versionsfeld. Nur Ziffern und Punkte sind erlaubt und die Kompatibilität sollte steigend oder gleich sein.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd88d85745bba1abfa65cef79472da6a'] = 'Syntaxfehler auf der Version. Nur Ziffern und Punkte sind erlaubt die Kompatibilität sollte steigend oder gleich sein.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bf17ac149e2e7a530c677e9bd51d3fd2'] = 'Module'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_714af595b1403ed23ff51f27e863c9a2'] = 'Wählen Sie die Module, die Sie exportieren möchten'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a517747c3d12f99244ae598910d979c5'] = 'Autor'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-Mail'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_15bbb9d0bbf25e8d2978de1168c749dc'] = 'Webseite'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d721757161f7f70c5b0949fdb6ec2c30'] = 'Thema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4f10e7d35bef4e7b48e76ee4bdeae24'] = 'Ihr Themenname'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_742ec436610daf7b51a1ba94039adf78'] = 'Geben Sie eine kurze Beschreibung Ihres Themas ein'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_34b6cd75171affba6957e308dcbd92be'] = 'Version'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7da6f328a4647adb2b96a01a6d7c05c4'] = 'Ihre Themenversion'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_333dfbe2bb5c64b140df4607935ec8be'] = 'Kompatibel ab'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e12167aa0a7698e6ebc92b4ce3909b53'] = 'bis'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a82cac3db0465cfc701f3765fd880019'] = 'Dokumentation hinzufügen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_08e27f4e5511f4f6aa73557e6ad6df48'] = 'Geben Sie dem Benutzer eine Hilfe. Fügen Sie ein Feld hinzu, indem Sie hier klicken'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a508df4b049c5b044cb4568b76b6c7e6'] = 'Variation hinzufügen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_626bd6acdcd835a5d064ef6358124b6c'] = 'Anderes Thema und Kompatibilität zum Hinzufügen wählen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac70412e939d72a9234cdebb1af5867b'] = 'Pfad'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5da618e8e4b89c66fe86e32cdafde142'] = 'Von'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_3271e801d0a5db9dc2963a19ed9695d6'] = 'Wählen Sie ein Thema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_abb381ee4077396e5d5d475b9022ba86'] = 'Generieren Sie das Archiv jetzt!'; diff --git a/modules/themeinstallator/delete.png b/modules/themeinstallator/delete.png new file mode 100644 index 000000000..8f0d06d64 Binary files /dev/null and b/modules/themeinstallator/delete.png differ diff --git a/modules/themeinstallator/es.php b/modules/themeinstallator/es.php new file mode 100644 index 000000000..1a7effe2a --- /dev/null +++ b/modules/themeinstallator/es.php @@ -0,0 +1,88 @@ +themeinstallator_fff01a1de50e0559f82501a927654d1b'] = 'Importar / exportar un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_83ebbd7865677d356ffde5ad7e12784f'] = 'Exportar o importar un tema y sus módulos en su tienda'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e10ed1f81b51bd4c7f86eeb84bcd1359'] = 'Zip no está instalado en su servidor. Contacte con su hosting'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_25b9e1d82d8200d70be2b22a1a283957'] = 'Se ha producido un error durante el envío del archivo.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_050991b5b76aad0be75563b7cb93a33e'] = 'Solo están autorizados los archivos zip'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_57c1ed81b02e5d3361323c7930897295'] = 'Se ha producido un error durante la copia del archivo.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5fd13c2b89a6eaaa4614bfe258f6c40f'] = 'El archivo zip parece corrupto'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dea6caeb83e5c11d3678284e64ebed8'] = 'Se ha producido un error durante el envío del archivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c186217583219f4cd040d9ee8d388ffb'] = 'Se ha producido un error durante la extracción del archivo zip'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0210b6456cdccad569cb56026bb0f689'] = 'Configuración de archivo errónea'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentación'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_6bdbe5a8a9f446d4d758ee4c22648771'] = 'Puede consultar la documentación'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7348fd57bfb5c837fc57e54fcfeeed9e'] = 'Haga clic derecho en el nombre y elija \"guardar el enlace bajo\"'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b857ef1f431c5f3290dc5b5e644826a6'] = 'Se han instalado los siguientes módulos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_22c765d777eb4ca6b4292bcbb596872e'] = 'Se han desactivado los siguientes módulos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e501dc865768ac08d49c129a23c3ae09'] = 'Se han activado los siguientes módulos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dfbf4744524c8573235d60589d8b66e'] = 'Se han actualizado las imágenes en la base de datos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd1f775e443ff3b9a89270713580a51b'] = 'Anterior'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a20ddccbb6f808ec42cd66323e6c6061'] = 'Terminar'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_33167fe8de7517798cf2e95c7680d6a4'] = 'Los siguientes temas se han importado correctamente'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4ef3a40f287dd9849004a7f5af73f00'] = 'Atención: ya existe un módulo con ese nombre'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_df8703a4066393da85e8188261660717'] = 'Seleccione los módulos del tema que desea instalar'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7651cc4a979c5e21ee50de988ce574b0'] = 'Configuración de los módulos nativos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8ab378b3ad05e14cbe61bff60c50afa6'] = 'Configuración actual'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f94545e00cff9d0395194458b2245702'] = 'Configuración de los temas'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_130c5b3473c57faa76e2a1c54e26f88e'] = 'Ambos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c90ba3aaed0a2bafed18233111062cf0'] = 'Configuración de las imágenes del tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2a84d9915b12fcb0c1436709a77a8dd0'] = 'Añadir la nueva configuración'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd3acd810b479275ce68d69e78ed7a95'] = 'Añadir todo (riesgo de perder su configuración actual)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_332efbbfb2c4bd5a37fd7a55659b821a'] = 'No cambiar nada'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Siguiente'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5138a89d1b730dacf446855e15c24496'] = 'Está a punto de instalar los siguientes temas'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f364da141450380ae79d7a45528f4c06'] = 'Este tema es para PrestaShop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac85d9784348dc8f0c2db93f4a095eb0'] = '(Atención: ya existe un tema con ese nombre)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8f3ea15c5b87db00561ccde5067310a5'] = 'para PrestaShop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_caeedb303068f9915e8e5ce091c9c02f'] = '(Atención: ya existe una carpeta con ese nombre)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2dd99d7426b4fe6dd04d7a98f5e32a62'] = 'Elija la declinación que desea importar'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f956917da1716add289f33a8869b85d4'] = 'Tema principal'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1e3de51d693cd0c7e903bcf3769a0cdb'] = 'Desmarque este campo si no quiere instalar el tema principa'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c49fbf2b822fd14929fd1fd76cdb0c96'] = 'Seleccione las variaciones que desee importar'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d1baba351b02042982a133c4df5d4924'] = 'Exportar un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5092965125a28a17f49ee460fbc1f62c'] = 'Seleccionar un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0557cae4cf5b379e665910d701210f69'] = 'Exportar este tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7961c4434751797a383d52d647e044d6'] = 'Importar a partir del ordenador'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bc52857ec49d8de10e55171f5bbc7f2a'] = 'Fichero del archivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_24ad8bfdfce09842a83f10d59a8ef01f'] = '¿Dónde está su archivo zip?'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dec0faa6eb19bd9120d12c5a876bd1cf'] = 'Importar a partir del Web'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a33388a338ee2b199d66112369279558'] = 'URL del archivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_cd8d9cc19984ccf9d314eee5eebfc2cc'] = 'Importar a partir del FTP'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_94f2371003860a92b12bf4c66b2851ac'] = 'Seleccionar el archivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1031371f906a92891140f384d04b3421'] = 'Se ha producido un error al general el archivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2c19b34eebed37ccc288c518006615b3'] = '¡Hay un error de sintaxis en el campo \"email\"!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_129b7dae66f0029381da64578a351198'] = '¡Hay un error de sintaxis en el campo \"url\"!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_87e0eaf3f9614cb904fafb0d4f4c1f56'] = 'La extensión del archivo debe ser .txt o .pdf'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_550a06d4fd147c22a4c921036003abf6'] = 'Se ha producido un error al enviar la documentación'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ecd8e7704f6f4f730f6a43bfb24a9546'] = 'Introduzca un nombre de documentación válido'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_623e4ca0275c19c3134b7290fdd19264'] = 'Introduzca un nombre de autor válido'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a43f1054076c2389afd746ec3d5d1c71'] = 'Introduzca un nombre de tema válido'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_03d105aa95f842fc54b18ca8a73109ca'] = 'Introduzca un nombre de variación válido'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_9891d2e13ad8b753833055c5809a733e'] = 'Error de sintaxis en el campo versión. Solo se autorizan los números y los puntos y la contabilidad debe ser creciente o igual.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd88d85745bba1abfa65cef79472da6a'] = 'Error de sintaxis en el campo versión. Solo se autorizan los números y los puntos y la contabilidad debe ser creciente o igual.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bf17ac149e2e7a530c677e9bd51d3fd2'] = 'Módulos'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_714af595b1403ed23ff51f27e863c9a2'] = 'Seleccione los módulos que quiere exportar'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a517747c3d12f99244ae598910d979c5'] = 'Autor'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_15bbb9d0bbf25e8d2978de1168c749dc'] = 'Sitio Web'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d721757161f7f70c5b0949fdb6ec2c30'] = 'Tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4f10e7d35bef4e7b48e76ee4bdeae24'] = 'El nombre de su tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_742ec436610daf7b51a1ba94039adf78'] = 'Introduzca una descripción breve de su tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_34b6cd75171affba6957e308dcbd92be'] = 'Versión'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7da6f328a4647adb2b96a01a6d7c05c4'] = 'La versión de su tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_333dfbe2bb5c64b140df4607935ec8be'] = 'Compatible a partir de '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Hasta'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a82cac3db0465cfc701f3765fd880019'] = 'Añadir una documentación'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_08e27f4e5511f4f6aa73557e6ad6df48'] = 'Ayude un poco al usuario. Añada un campo pulsando aquí'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a508df4b049c5b044cb4568b76b6c7e6'] = 'Añadir una variación'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_626bd6acdcd835a5d064ef6358124b6c'] = 'Seleccione otro tema y su contabilidad para incluir'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac70412e939d72a9234cdebb1af5867b'] = 'Camino'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5da618e8e4b89c66fe86e32cdafde142'] = 'A partir de '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_3271e801d0a5db9dc2963a19ed9695d6'] = 'El nombre de su tienda'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ea4788705e6873b424c65e91c2846b19'] = 'Anular'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_abb381ee4077396e5d5d475b9022ba86'] = '¡Generar el archivo ahora!'; diff --git a/modules/themeinstallator/fr.php b/modules/themeinstallator/fr.php new file mode 100644 index 000000000..536e6d173 --- /dev/null +++ b/modules/themeinstallator/fr.php @@ -0,0 +1,88 @@ +themeinstallator_fff01a1de50e0559f82501a927654d1b'] = 'Importer / Exporter un thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_83ebbd7865677d356ffde5ad7e12784f'] = 'Exporter ou importer un thème et ses modules sur votre boutique'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e10ed1f81b51bd4c7f86eeb84bcd1359'] = 'Zip n\'est pas installé sur votre serveur. Contactez votre hébergeur pour plus d\'informations.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_25b9e1d82d8200d70be2b22a1a283957'] = 'Une erreur est survenue durant l\'envoi du fichier.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_050991b5b76aad0be75563b7cb93a33e'] = 'Seuls les fichiers zip sont autorisés'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_57c1ed81b02e5d3361323c7930897295'] = 'Une erreur est survenue durant la copie du fichier.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5fd13c2b89a6eaaa4614bfe258f6c40f'] = 'Le fichier zip semble corrompu'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dea6caeb83e5c11d3678284e64ebed8'] = 'Une erreur est survenue durant l\'envoi du fichier'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c186217583219f4cd040d9ee8d388ffb'] = 'Une erreur est survenue durant l\'extraction du fichier zip'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0210b6456cdccad569cb56026bb0f689'] = 'Mauvais fichier de configuration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_6bdbe5a8a9f446d4d758ee4c22648771'] = 'Vous pouvez consulter la documentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7348fd57bfb5c837fc57e54fcfeeed9e'] = 'Faites un clic droit sur le nom et choisissez \"enregistrer le lien sous\"'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b857ef1f431c5f3290dc5b5e644826a6'] = 'Les modules suivants ont été installés'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_22c765d777eb4ca6b4292bcbb596872e'] = 'Les modules suivants ont été désactivés'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e501dc865768ac08d49c129a23c3ae09'] = 'Les modules suivants ont été activés'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dfbf4744524c8573235d60589d8b66e'] = 'Les images ont bien été mises à jour dans la base de données'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a20ddccbb6f808ec42cd66323e6c6061'] = 'Terminer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_33167fe8de7517798cf2e95c7680d6a4'] = 'Les thèmes suivants ont correctement été importés'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4ef3a40f287dd9849004a7f5af73f00'] = 'Attention : un module avec le même nom existe déjà'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_df8703a4066393da85e8188261660717'] = 'Sélectionnez les modules du thème que vous souhaitez installer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7651cc4a979c5e21ee50de988ce574b0'] = 'Configuration des modules natifs'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8ab378b3ad05e14cbe61bff60c50afa6'] = 'Configuration actuelle'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f94545e00cff9d0395194458b2245702'] = 'Configuration du thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_130c5b3473c57faa76e2a1c54e26f88e'] = 'Les deux'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c90ba3aaed0a2bafed18233111062cf0'] = 'Configuration des images du thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2a84d9915b12fcb0c1436709a77a8dd0'] = 'Ajouter la nouvelle configuration'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd3acd810b479275ce68d69e78ed7a95'] = 'Tout ajouter (vous risquez de perdre votre configuration actuelle)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_332efbbfb2c4bd5a37fd7a55659b821a'] = 'Ne rien changer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5138a89d1b730dacf446855e15c24496'] = 'Vous êtes sur le point d\'installer les thèmes suivants'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f364da141450380ae79d7a45528f4c06'] = 'Ce thème est pour Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac85d9784348dc8f0c2db93f4a095eb0'] = 'Attention : un thème avec le même nom de dossier existe déjà'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8f3ea15c5b87db00561ccde5067310a5'] = 'pour Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_caeedb303068f9915e8e5ce091c9c02f'] = '(Attention : un dossier avec le même nom existe déjà)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2dd99d7426b4fe6dd04d7a98f5e32a62'] = 'Choisissez la déclinaison que vous souhaitez importer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f956917da1716add289f33a8869b85d4'] = 'Thème principal'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1e3de51d693cd0c7e903bcf3769a0cdb'] = 'Décochez ce champs si vous ne souhaitez pas installer le thème principal'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c49fbf2b822fd14929fd1fd76cdb0c96'] = 'Sélectionnez les variations que vous souhaitez importer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d1baba351b02042982a133c4df5d4924'] = 'Exporter un thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5092965125a28a17f49ee460fbc1f62c'] = 'Selectionner un thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0557cae4cf5b379e665910d701210f69'] = 'Exporter ce thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7961c4434751797a383d52d647e044d6'] = 'Importer à partir de l\'ordinateur'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bc52857ec49d8de10e55171f5bbc7f2a'] = 'Fichier de l\'archive'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_24ad8bfdfce09842a83f10d59a8ef01f'] = 'Où se trouve votre fichier zip?'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dec0faa6eb19bd9120d12c5a876bd1cf'] = 'Importer à partir du web'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a33388a338ee2b199d66112369279558'] = 'URL de l\'archive'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_cd8d9cc19984ccf9d314eee5eebfc2cc'] = 'Importer à partir du FTP'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_94f2371003860a92b12bf4c66b2851ac'] = 'Selectionnez l\'archive'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1031371f906a92891140f384d04b3421'] = 'Une erreur est survenue durant la génération de l\'archive'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2c19b34eebed37ccc288c518006615b3'] = 'Il y a une erreur de syntaxe dans le champ \"email\"!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_129b7dae66f0029381da64578a351198'] = 'Il y a une erreur de syntaxe dans le champ \"url\"!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_87e0eaf3f9614cb904fafb0d4f4c1f56'] = 'L\'extension du fichier doit être .txt ou .pdf'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_550a06d4fd147c22a4c921036003abf6'] = 'Une erreur est survenue durant l\'envoi de la documentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ecd8e7704f6f4f730f6a43bfb24a9546'] = 'Veuillez entrer un nom de documentation valide'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_623e4ca0275c19c3134b7290fdd19264'] = 'Veuillez entrer un nom d\'auteur valide'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a43f1054076c2389afd746ec3d5d1c71'] = 'Veuillez entrer un nom de thème valide'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_03d105aa95f842fc54b18ca8a73109ca'] = 'Veuillez entrer un nom de variation valide'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_9891d2e13ad8b753833055c5809a733e'] = 'Erreur de syntaxe dans le champ version. Seuls les nombres et les points sont autorisés et la compatibilité doit être croissante ou égale.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd88d85745bba1abfa65cef79472da6a'] = 'Erreur de syntaxe dans le champ version. Seuls les nombres et les points sont autorisés et la compatibilité doit être croissante ou égale.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bf17ac149e2e7a530c677e9bd51d3fd2'] = 'Modules'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_714af595b1403ed23ff51f27e863c9a2'] = 'Sélectionnez les modules que vous souhaitez exporter'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a517747c3d12f99244ae598910d979c5'] = 'Auteur'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_15bbb9d0bbf25e8d2978de1168c749dc'] = 'Site Web'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d721757161f7f70c5b0949fdb6ec2c30'] = 'Thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4f10e7d35bef4e7b48e76ee4bdeae24'] = 'Le nom de votre thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_742ec436610daf7b51a1ba94039adf78'] = 'Entrez une courte description de votre thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_34b6cd75171affba6957e308dcbd92be'] = 'Version'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7da6f328a4647adb2b96a01a6d7c05c4'] = 'La version de votre thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_333dfbe2bb5c64b140df4607935ec8be'] = 'Compatible à partir de'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Jusqu\'à'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a82cac3db0465cfc701f3765fd880019'] = 'Ajouter une documentation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_08e27f4e5511f4f6aa73557e6ad6df48'] = 'Donnez un peu d\'aide à l\'utilisateur. Ajoutez un champs en cliquant ici'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a508df4b049c5b044cb4568b76b6c7e6'] = 'Ajouter une variation'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_626bd6acdcd835a5d064ef6358124b6c'] = 'Selectionnez un autre thème à inclure et sa compatibilité'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac70412e939d72a9234cdebb1af5867b'] = 'Chemin'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5da618e8e4b89c66fe86e32cdafde142'] = 'A partir de'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_3271e801d0a5db9dc2963a19ed9695d6'] = 'Choisissez un thème'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_abb381ee4077396e5d5d475b9022ba86'] = 'Générer l\'archive maintenant!'; diff --git a/modules/themeinstallator/it.php b/modules/themeinstallator/it.php new file mode 100644 index 000000000..4d7426be6 --- /dev/null +++ b/modules/themeinstallator/it.php @@ -0,0 +1,88 @@ +themeinstallator_fff01a1de50e0559f82501a927654d1b'] = 'Import / export di un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_83ebbd7865677d356ffde5ad7e12784f'] = 'Esportare o installare un tema ed i suoi moduli per il tuo negozio'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e10ed1f81b51bd4c7f86eeb84bcd1359'] = 'zip non è installato sul tuo server. Chiedi al tuo host ulteriori informazioni.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_25b9e1d82d8200d70be2b22a1a283957'] = 'Errore durante il caricamento del file.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_050991b5b76aad0be75563b7cb93a33e'] = 'Solo i file zip sono ammessi'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_57c1ed81b02e5d3361323c7930897295'] = 'Errore durante la copia dei file.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5fd13c2b89a6eaaa4614bfe258f6c40f'] = 'file Zip sembra essere rotto'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dea6caeb83e5c11d3678284e64ebed8'] = 'Errore durante il download di file'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c186217583219f4cd040d9ee8d388ffb'] = 'Errore durante l\'estrazione zip'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0210b6456cdccad569cb56026bb0f689'] = 'Cattivo file di configurazione '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5b6cf869265c13af8566f192b4ab3d2a'] = 'Documentazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_6bdbe5a8a9f446d4d758ee4c22648771'] = 'Si consiglia di consultare la documentazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7348fd57bfb5c837fc57e54fcfeeed9e'] = 'Fai clic destro sul nome e scegli \"Salva collegamento come\"'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b857ef1f431c5f3290dc5b5e644826a6'] = 'I seguenti moduli sono stati installati'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_22c765d777eb4ca6b4292bcbb596872e'] = 'I seguenti moduli sono stati disabilitati'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e501dc865768ac08d49c129a23c3ae09'] = 'I seguenti moduli sono stati abilitati'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0dfbf4744524c8573235d60589d8b66e'] = 'Le immagini sono state correttamente aggiornate nel database'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd1f775e443ff3b9a89270713580a51b'] = 'Precedente'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a20ddccbb6f808ec42cd66323e6c6061'] = 'Fine'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_33167fe8de7517798cf2e95c7680d6a4'] = 'I temi seguenti sono stati importati con successo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4ef3a40f287dd9849004a7f5af73f00'] = 'Attenzione: esiste già un modulo con lo stesso nome '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_df8703a4066393da85e8188261660717'] = 'Seleziona i moduli del tema che desideri installare'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7651cc4a979c5e21ee50de988ce574b0'] = 'Moduli di configurazione originali'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8ab378b3ad05e14cbe61bff60c50afa6'] = 'configurazione attuale'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f94545e00cff9d0395194458b2245702'] = 'configurazione del tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_130c5b3473c57faa76e2a1c54e26f88e'] = 'Entrambi'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c90ba3aaed0a2bafed18233111062cf0'] = 'configurazione immagini tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2a84d9915b12fcb0c1436709a77a8dd0'] = 'Aggiungi nuova configurazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd3acd810b479275ce68d69e78ed7a95'] = 'Aggiungi tutti (rischi di perdere la tua attuale configurazione)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_332efbbfb2c4bd5a37fd7a55659b821a'] = 'Non cambiare nulla'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Successivo'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5138a89d1b730dacf446855e15c24496'] = 'Stai per installare il seguente tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f364da141450380ae79d7a45528f4c06'] = 'Questo tema è per Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac85d9784348dc8f0c2db93f4a095eb0'] = 'Attenzione: Hai già un tema con il nome della stessa cartella di'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_8f3ea15c5b87db00561ccde5067310a5'] = 'per Prestashop'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_caeedb303068f9915e8e5ce091c9c02f'] = '(Attenzione: una cartella con lo stesso nome esiste già)'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2dd99d7426b4fe6dd04d7a98f5e32a62'] = 'Scegli le variazioni che si desidera importare'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f956917da1716add289f33a8869b85d4'] = 'Tema principale'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1e3de51d693cd0c7e903bcf3769a0cdb'] = 'Deseleziona questo campo se non desideri installare il tema principale'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_c49fbf2b822fd14929fd1fd76cdb0c96'] = 'Seleziona le variazioni che si desidera importare'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d1baba351b02042982a133c4df5d4924'] = 'Esporta un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5092965125a28a17f49ee460fbc1f62c'] = 'Seleziona un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_0557cae4cf5b379e665910d701210f69'] = 'Esporta questo tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7961c4434751797a383d52d647e044d6'] = 'Importa dal computer'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bc52857ec49d8de10e55171f5bbc7f2a'] = 'Archivio File'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_24ad8bfdfce09842a83f10d59a8ef01f'] = 'Dove si trova il file zip?'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dec0faa6eb19bd9120d12c5a876bd1cf'] = 'Importare dal web'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a33388a338ee2b199d66112369279558'] = 'Archivio URL '; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_cd8d9cc19984ccf9d314eee5eebfc2cc'] = 'Importa da FTP'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_94f2371003860a92b12bf4c66b2851ac'] = 'Seleziona archivio'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_1031371f906a92891140f384d04b3421'] = 'Errore durante la generazione di archivio'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_2c19b34eebed37ccc288c518006615b3'] = 'C\'è un errore nella tua sintassi e-mail!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_129b7dae66f0029381da64578a351198'] = 'C\'è un errore di sintassi URL!'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_87e0eaf3f9614cb904fafb0d4f4c1f56'] = 'File di estensione deve essere. Txt o. Pdf'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_550a06d4fd147c22a4c921036003abf6'] = 'È verificato un errore durante il caricamento di documentazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ecd8e7704f6f4f730f6a43bfb24a9546'] = 'Si prega di inserire un nome valido documentazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_623e4ca0275c19c3134b7290fdd19264'] = 'Si prega di inserire un nome valido autore'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a43f1054076c2389afd746ec3d5d1c71'] = 'Si prega di inserire un nome valido tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_03d105aa95f842fc54b18ca8a73109ca'] = 'Si prega di inserire un nome valido variazione tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_9891d2e13ad8b753833055c5809a733e'] = 'Errore di sintassi sul campo della versione. Solo cifre e punti sono ammessi e la compatibilità dovrebbe essere crescente o uguale.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_dd88d85745bba1abfa65cef79472da6a'] = 'Errore di sintassi sulla versione. Solo cifre e punti sono ammessi e compatibilità dovrebbe essere in aumento o pari.'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_bf17ac149e2e7a530c677e9bd51d3fd2'] = 'Moduli'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_714af595b1403ed23ff51f27e863c9a2'] = 'Selezionare i moduli che si desidera esportare'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a517747c3d12f99244ae598910d979c5'] = 'Autore'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_15bbb9d0bbf25e8d2978de1168c749dc'] = 'Sito'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_d721757161f7f70c5b0949fdb6ec2c30'] = 'Tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_f4f10e7d35bef4e7b48e76ee4bdeae24'] = 'Il nome del tuo tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descrizione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_742ec436610daf7b51a1ba94039adf78'] = 'Inserisci una breve descrizione del tuo tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_34b6cd75171affba6957e308dcbd92be'] = 'Versione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_7da6f328a4647adb2b96a01a6d7c05c4'] = 'Versione del tuo tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_333dfbe2bb5c64b140df4607935ec8be'] = 'Compatibile dal'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Per'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a82cac3db0465cfc701f3765fd880019'] = 'Aggiungi documentazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_08e27f4e5511f4f6aa73557e6ad6df48'] = 'Aiuta l\'utente. Aggiungi un campo cliccando qui'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_a508df4b049c5b044cb4568b76b6c7e6'] = 'Aggiungi variazione'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_626bd6acdcd835a5d064ef6358124b6c'] = 'Seleziona un altro tema da includere altri e la sua compatibilità'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ac70412e939d72a9234cdebb1af5867b'] = 'Percorso'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_5da618e8e4b89c66fe86e32cdafde142'] = 'Da'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_3271e801d0a5db9dc2963a19ed9695d6'] = 'Scegli un tema'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_ea4788705e6873b424c65e91c2846b19'] = 'Annulla'; +$_MODULE['<{themeinstallator}prestashop>themeinstallator_abb381ee4077396e5d5d475b9022ba86'] = 'Genera l\'archivio ora!'; diff --git a/modules/themeinstallator/logo.gif b/modules/themeinstallator/logo.gif new file mode 100644 index 000000000..13a9cf651 Binary files /dev/null and b/modules/themeinstallator/logo.gif differ diff --git a/modules/themeinstallator/script.js b/modules/themeinstallator/script.js new file mode 100644 index 000000000..25b296410 --- /dev/null +++ b/modules/themeinstallator/script.js @@ -0,0 +1,108 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function addVariation(id_variation) +{ + var idRow = $('#variation_table tr').length + 1; + var newRow = ''; + newRow += ''+writeName+''; + newRow += ''; + newRow += ''; + newRow += ''+compafrom+''; + newRow += ''; + newRow += ''+compato+''; + newRow += ''; + + if ($('#variation_table tr').length > 0) + $('#variation_table tr:last').after(newRow); + else + $('#variation_table').html(newRow); + + $('#myvar_'+idRow).after(' delete'); + +} + +function removeVariation(id) +{ + + $('#myvar_'+id).val(-1); + $('#myvar_tr_'+id).hide(); + +} + +/* +** -------------------------------------------- +*/ + +function addDocumentation(id_variation) +{ + var idRow = $('#documentation_table tr').length + 1; + var newRow = ''; + newRow += ''+writeName+''; + newRow += ''; + newRow += ''+path+''; + + newRow += ''; + + if ($('#documentation_table tr').length > 0) + $('#documentation_table tr:last').after(newRow); + else + $('#documentation_table').html(newRow); + + $('#mydoc_'+idRow).after(' delete'); + +} + +function removeDocumentation(id) +{ + $('#mydoc_'+id).parent().html(''); + $('#mydoc_tr_'+id).hide(); +} + +$('document').ready(function() +{ + if (themes.length > 0) + { + var count = 0; + while (themes_id[count] != null && count < 10) + addVariation(themes_id[count++]); + } + else + addVariation(0); + addDocumentation(0); +}); \ No newline at end of file diff --git a/modules/themeinstallator/themeinstallator.php b/modules/themeinstallator/themeinstallator.php new file mode 100644 index 000000000..17d7a2dda --- /dev/null +++ b/modules/themeinstallator/themeinstallator.php @@ -0,0 +1,1266 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class ThemeInstallator extends Module +{ + /* + ** Modules + */ + private $to_install = array(); + private $to_enable = array(); + private $to_disable = array(); + private $to_export = array(); + + /* + ** index + */ + private $page; + + /* + ** Config File + */ + private $xml; + + public function __construct() + { + $this->name = 'themeinstallator'; + $this->version = '1.3'; + $this->author = 'PrestaShop'; + if (version_compare(_PS_VERSION_, 1.4) >= 0) + $this->tab = 'administration'; + else + $this->tab = 'Theme'; + parent::__construct(); + $this->displayName = $this->l('Import/export a theme'); + $this->description = $this->l('Export or Install a theme and its modules on your shop.'); + } + + private function getTheNativeModules() + { + $xml = simplexml_load_string(Tools::file_get_contents('http://www.prestashop.com/xml/modules_list.xml')); + $natives = array(); + if ($xml) + foreach ($xml->modules as $row) + foreach ($row->module as $row2) + $natives[] = (string)$row2['name']; + + if (count($natives > 0)) + return $natives; + // use this list if we can't contact the prestashop.com server + $natives = array('bankwire', 'birthdaypresent', 'blockadvertising', 'blockbestsellers', 'blockcart', 'blockcategories', + 'blockcurrencies', 'blockinfos', 'blocklanguages', 'blocklink', 'blockmanufacturer', 'blockmyaccount', 'blocknewproducts', + 'blocknewsletter', 'blockpaymentlogo', 'blockpermanentlinks', 'blockrss', 'blocksearch', 'blockspecials', 'blocksupplier', + 'blocktags', 'blockuserinfo', 'blockvariouslinks', 'blockviewed', 'blockwishlist', 'canonicalurl', 'cashondelivery', 'cheque', + 'crossselling', 'dejala', 'editorial', 'feeder', 'followup', 'gadsense', 'ganalytics', 'gcheckout', 'graphartichow', 'graphgooglechart', + 'graphvisifire', 'graphxmlswfcharts', 'gridhtml', 'gsitemap', 'hipay', 'homefeatured', 'loyalty', 'mailalerts', 'moneybookers', + 'newsletter', 'pagesnotfound', 'paypal', 'paypalapi', 'productcomments', 'productscategory', 'producttooltip', 'referralprogram', 'reverso', + 'sekeywords', 'sendtoafriend', 'statsbestcategories', 'statsbestcustomers', 'statsbestproducts', 'statsbestsuppliers', 'statsbestvouchers', + 'statscarrier', 'statscatalog', 'statscheckup', 'statsdata', 'statsequipment', 'statsgeolocation', 'statshome', 'statslive', 'statsnewsletter', + 'statsorigin', 'statspersonalinfos', 'statsproduct', 'statsregistrations', 'statssales', 'statssearch', 'themeinstallator', 'statsvisits', 'tm4b', + 'trackingfront', 'watermark'); + return $natives; + } + + private function deleteDirectory($dirname) + { + $files = scandir($dirname); + foreach ($files as $file) + if ($file != '.' AND $file != '..') + { + if (is_dir($dirname.'/'.$file)) + self::deleteDirectory($dirname.'/'.$file); + elseif (file_exists($dirname.'/'.$file)) + unlink($dirname.'/'.$file); + } + rmdir($dirname); + } + + private function recurseCopy($src, $dst) + { + if (!$dir = opendir($src)) + return; + if (!file_exists($dst)) + mkdir($dst); + while(($file = readdir($dir)) !== false) + if (strncmp($file, '.', 1) != 0) + { + if (is_dir($src.'/'.$file)) + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); + else if (is_readable($src.'/'.$file) AND $file != 'Thumbs.db' AND $file != '.DS_Store' AND substr($file, -1) != '~') + copy($src.'/'.$file, $dst.'/'.$file); + } + closedir($dir); + } + + /* + ** Checks if module is installed + ** Returns true if module is active + ** Also returns false if it's a payment or stat module + */ + private function checkParentClass($name) + { + if (!$obj = Module::getInstanceByName($name)) + return false; + if (is_callable(array($obj, 'validateOrder'))) + return false; + if (is_callable(array($obj, 'getDateBetween'))) + return false; + if (is_callable(array($obj, 'getGridEngines'))) + return false; + if (is_callable(array($obj, 'getGraphEngines'))) + return false; + if (is_callable(array($obj, 'hookAdminStatsModules'))) + return false; + else + return true; + return false; + } + + private function deleteTmpFiles() + { + if (file_exists(_IMPORT_FOLDER_.'doc')) + self::deleteDirectory(_IMPORT_FOLDER_.'doc'); + if (file_exists(_IMPORT_FOLDER_.XMLFILENAME)) + unlink(_IMPORT_FOLDER_.XMLFILENAME); + if (file_exists(_IMPORT_FOLDER_.'modules')) + self::deleteDirectory(_IMPORT_FOLDER_.'modules'); + if (file_exists(_IMPORT_FOLDER_.'themes')) + self::deleteDirectory(_IMPORT_FOLDER_.'themes'); + if (file_exists(_EXPORT_FOLDER_.'archive.zip')) + unlink(_EXPORT_FOLDER_.'archive.zip'); + } + + private function init_defines() + { + global $currentIndex, $cookie; + + define('_EXPORT_FOLDER_', dirname(__FILE__).'/export/'); + define('_IMPORT_FOLDER_', dirname(__FILE__).'/import/'); + $this->page = 1; + if (!file_exists(_EXPORT_FOLDER_) OR !is_dir(_EXPORT_FOLDER_)) + mkdir(_EXPORT_FOLDER_, 0777); + if (!file_exists(_IMPORT_FOLDER_) OR !is_dir(_IMPORT_FOLDER_)) + mkdir(_IMPORT_FOLDER_, 0777); + + if (!Tools::isSubmit('cancelExport') AND (Tools::isSubmit('exportTheme') OR Tools::isSubmit('submitExport'))) + $this->page = 'exportPage'; + $this->_html = '
        '; + + + if (Tools::isSubmit('modulesToExport') OR Tools::isSubmit('submitModules')) + $this->to_export = Tools::getValue('modulesToExport'); + if (Tools::isSubmit('submitThemes')) + $this->selectedVariations = Tools::getValue('variation'); + $_POST = @array_map('trim', $_POST); + define('DEFAULT_COMPATIBILITY_FROM', '1.0.0.0'); + define('DEFAULT_COMPATIBILITY_TO', _PS_VERSION_); + define('DEFAULT_T_VER', '1.0'); + define('MAX_NAME_LENGTH', 32); + define('MAX_EMAIL_LENGTH', 128); + define('MAX_WEBSITE_LENGTH', 64); + define('MAX_DESCRIPTION_LENGTH', 64); + define('MAX_T_VER_LENGTH', 3); + define('MAX_COMPATIBILITY_VER', 7); + define('ARCHIVE_NAME', _IMPORT_FOLDER_.'uploaded.zip'); + define('XMLFILENAME', 'Config.xml'); + + $this->_msg = ''; + $this->to_enable = false; + $this->to_disable = false; + $this->to_install = false; + $this->errors = false; + if ($this->page == 'exportPage' AND Tools::isSubmit('exportTheme') AND ($theme = Tools::getValue('mainTheme'))) + if (!(is_dir(_PS_ALL_THEMES_DIR_.$theme) AND file_exists(_PS_ALL_THEMES_DIR_.$theme.'/index.tpl') AND $theme != 'prestashop')) + { + $this->page = 1; + echo parent::displayError(''.$theme.' is not a valid theme to export'); + } + } + + private function handleInformations() + { + if (!class_exists('ZipArchive', false)) + { + $this->errors .= parent::displayError($this->l('Zip is not installed on your server. Ask your host for further information.')); + return ; + } + if (Tools::isSubmit('submitImport1')) + { + $zip = new ZipArchive(); + if ($_FILES['themearchive']['error'] OR !file_exists($_FILES['themearchive']['tmp_name'])) + $this->errors .= parent::displayError($this->l('An error has occurred during the file upload.')); + else if (substr($_FILES['themearchive']['name'], -4) != '.zip') + $this->errors .= parent::displayError($this->l('Only zip files are allowed')); + else if (!rename($_FILES['themearchive']['tmp_name'], ARCHIVE_NAME)) + $this->errors .= parent::displayError($this->l('An error has occurred during the file copy.')); + else if ($zip->open(ARCHIVE_NAME, ZIPARCHIVE::CHECKCONS) === true) + $this->page = 2; + else + $this->errors .= parent::displayError($this->l('Zip file seems to be broken')); + } + else if (Tools::isSubmit('submitImport2')) + { + $zip = new ZipArchive(); + if (!Validate::isModuleUrl($url = Tools::getValue('linkurl'), $this->errors)) + $this->errors .= parent::displayError($this->l('Only zip files are allowed')); + else if (!copy($url, ARCHIVE_NAME)) + $this->errors .= parent::displayError($this->l('Error during the file download')); + else if ($zip->open(ARCHIVE_NAME, ZIPARCHIVE::CHECKCONS) !== true) + $this->errors .= parent::displayError($this->l('Zip file seems to be broken')); + else + $this->page = 2; + } + else if (Tools::isSubmit('submitImport3')) + { + $zip = new ZipArchive(); + $filename = _IMPORT_FOLDER_.Tools::getValue('ArchiveName'); + if (substr($filename, -4) != '.zip') + $this->errors .= parent::displayError($this->l('Only zip files are allowed')); + else if (!copy($filename, ARCHIVE_NAME)) + $this->errors .= parent::displayError($this->l('An error has occurred during the file copy.')); + else if ($zip->open(ARCHIVE_NAME, ZIPARCHIVE::CHECKCONS) === true) + $this->page = 2; + else + $this->errors .= parent::displayError($this->l('Zip file seems to be broken')); + } + else if (Tools::isSubmit('prevThemes')) + $this->page = 2; + else if (Tools::isSubmit('submitThemes')) + $this->page = 3; + else if (Tools::isSubmit('submitModules')) + $this->page = 4; + if ($this->page == 2 AND file_exists(ARCHIVE_NAME)) + { + if (!$zip->extractTo(_IMPORT_FOLDER_)) + { + $this->errors .= parent::displayError($this->l('Error during zip extraction')); + $this->page = 1; + } + $zip->close(); + } + if (file_exists(ARCHIVE_NAME)) + unlink(ARCHIVE_NAME); + if ($this->page != 1) + { + if (!self::checkXmlFields()) + { + $this->errors .= parent::displayError($this->l('Bad configuration file')); + $this->page = 1; + } + else + return ; + } + self::deleteTmpFiles(); + } + + private function checkXmlFields() + { + if (!file_exists(_IMPORT_FOLDER_.XMLFILENAME) OR !$xml = simplexml_load_file(_IMPORT_FOLDER_.XMLFILENAME)) + return false; + if (!$xml['version'] OR !$xml['name']) + return false; + foreach ($xml->variations->variation as $val) + if (!$val['name'] OR !$val['directory'] OR !$val['from'] OR !$val['to']) + return false; + foreach ($xml->modules->module as $val) + if (!$val['action'] OR !$val['name']) + return false; + foreach ($xml->modules->hooks->hook as $val) + if (!$val['module'] OR !$val['hook'] OR !$val['position']) + return false; + return true; + } + + public function getContentExport() + { + $this->theme_list = scandir(_PS_ALL_THEMES_DIR_); + $this->error = false; + + self::getModuleState(); + self::displayInformations(); + if (Tools::isSubmit('submitExport') AND $this->error === false AND $this->checkPostedDatas() == true) + { + self::getThemeVariations(); + self::getDocumentation(); + self::getHookState(); + self::getImageState(); + self::generateXML(); + self::generateArchive(); + } + self::AuthorInformationForm(); + self::ModulesInformationForm(); + self::ThemeInformationForm(); + self::DocInformationForm(); + self::VariationInformationForm(); + return $this->_html; + } + + /* + ** Main function + */ + public function getContent() + { + self::init_defines(); + if (!Tools::isSubmit('cancelExport') AND $this->page == 'exportPage') + return self::getContentExport(); + self::handleInformations(); + switch ($this->page) + { + case 1: + self::_displayForm1(); + break; + case 2: + self::_displayForm2(); + break; + case 3: + self::_displayForm3(); + break; + case 4: + self::_displayForm4(); + break; + } + return $this->errors.$this->_msg.$this->_html; + } + + /* + ** Checker si le dossier doc existe : Si oui appeler la fonction ! + */ + private function _loadDocForm() + { + $docname = array(); + $docpath = array(); + + foreach ($this->xml->docs->doc as $row) + { + $docname[] = strval($row['name']); + $docpath[] = strval($row['path']); + } + $doc = ' +
        + '.$this->l('Documentation').' + +
        +
          '; + $i = 0; + foreach ($docname as $row) + $doc .= '
        • '.$row.''; + $doc .= ' +
        +

        '.$this->l('Right click on the name and choose "save link as"').' +

        +
        +

         

        '; + $this->_html .= $doc; + } + + private function getModules() + { + $this->native_modules = self::getTheNativeModules(); + foreach ($this->xml->modules->module as $row) + { + if (strval($row['action']) == 'install' AND !in_array(strval($row['name']), $this->native_modules)) + $this->to_install[] = strval($row['name']); + else if (strval($row['action']) == 'enable') + $this->to_enable[] = strval($row['name']); + else if (strval($row['action']) == 'disable') + $this->to_disable[] = strval($row['name']); + } + } + + private function updateImages() + { + foreach ($this->xml->images->image as $row) + { + $foo = Db::getInstance()->getRow(' + SELECT name FROM `'._DB_PREFIX_.'image_type` i + WHERE i.name LIKE \''.pSQL($row['name']).'\''); + if ((int)(Tools::getValue('imagesConfig')) == 1 AND $foo) + continue ; + if ($foo) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'image_type` i + SET `width` = '.(int)($row['width']).', + `height` = '.(int)($row['height']).', + `products` = '.($row['products'] == 'true' ? 1 : 0).', + `categories` = '.($row['categories'] == 'true' ? 1 : 0).', + `manufacturers` = '.($row['manufacturers'] == 'true' ? 1 : 0).', + `suppliers` = '.($row['suppliers'] == 'true' ? 1 : 0).', + `scenes` = '.($row['scenes'] == 'true' ? 1 : 0).' + WHERE i.name LIKE \''.pSQL($row['name']).'\''); + else + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'image_type` (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes`) + VALUES ( + \''.pSQL($row['name']).'\', + '.(int)($row['width']).', + '.(int)($row['height']).', + '.($row['products'] == 'true' ? 1 : 0).', + '.($row['categories'] == 'true' ? 1 : 0).', + '.($row['manufacturers'] == 'true' ? 1 : 0).', + '.($row['suppliers'] == 'true' ? 1 : 0).', + '.($row['scenes'] == 'true' ? 1 : 0).')'); + } + return true; + } + + private function _displayForm4() + { + $xml = simplexml_load_file(_IMPORT_FOLDER_.XMLFILENAME); + $this->xml = $xml; + self::getModules(); + $hook = array(); + $hookedModule = array(); + $position = array(); + $msg = ''; + + foreach ($this->xml->modules->hooks->hook as $row) + { + $hookedModule[] = strval($row['module']); + $hook[] = strval($row['hook']); + $position[] = strval($row['position']); + } + + if (file_exists(_IMPORT_FOLDER_.'doc') AND sizeof($xml->docs->doc) != 0) + self::_loadDocForm(); + // install selected modules + $flag = 0; + if (isset($this->to_export) AND $this->to_export) + foreach ($this->to_export as $row) + { + if (in_array($row, $this->native_modules)) + continue; + if ($flag++ == 0) + $msg .= ''.$this->l('The following modules have been installed').' :
        '; + self::recurseCopy(_IMPORT_FOLDER_.'modules/'.$row, _PS_ROOT_DIR_.'/modules/'.$row); + $obj = Module::getInstanceByName($row); + if (Validate::isLoadedObject($obj)) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'module` + SET `active`= 1 + WHERE `name` = \''.pSQL($row).'\''); + else if (!$obj OR !$obj->install()) + continue; + $msg .= '- '.pSQL($row).'
        '; + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_module` = '.pSQL($obj->id)); + $count = -1; + while (isset($hookedModule[++$count])) + if ($hookedModule[$count] == $row) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) + VALUES ('.(int)$obj->id.', '.(int)Hook::get($hook[$count]).', '.(int)$position[$count].')'); + } + if (($val = (int)(Tools::getValue('nativeModules'))) != 1) + { + $flag = 0; + // Disable native modules + if ($val == 2 AND $this->to_disable AND count($this->to_disable)) + foreach ($this->to_disable as $row) + { + $obj = Module::getInstanceByName($row); + if (Validate::isLoadedObject($obj)) + { + if ($flag++ == 0) + $msg .= ''.$this->l('The following modules have been disabled').' :
        '; + $msg .= '- '.pSQL($row).'
        '; + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'module` + SET `active`= 0 + WHERE `name` = \''.pSQL($row).'\''); + } + } + $flag = 0; + if ($this->to_enable AND count($this->to_enable)) + foreach ($this->to_enable as $row) + { + $obj = Module::getInstanceByName($row); + if (Validate::isLoadedObject($obj)) + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'module` + SET `active`= 1 + WHERE `name` = \''.pSQL($row).'\''); + else if (!is_object($obj) OR !$obj->install()) + continue ; + if ($flag++ == 0) + $msg .= ''.$this->l('The following modules have been enabled').' :
        '; + $msg .= '- '.pSQL($row).'
        '; + Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'hook_module` + WHERE `id_module` = '.pSQL($obj->id)); + $count = -1; + while (isset($hookedModule[++$count])) + if ($hookedModule[$count] == $row) + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`) + VALUES ('.(int)$obj->id.', '.(int)Hook::get($hook[$count]).', '.(int)$position[$count].')'); + } + } + if ((int)(Tools::getValue('imagesConfig')) != 3 AND self::updateImages()) + $msg .= '
        '.$this->l('Images have been correctly updated in database').'
        '; + + $this->_msg .= parent::displayConfirmation($msg); + $this->_html .= ' + + +
        '; + + } + + private function _displayForm3() + { + $xml = simplexml_load_file(_IMPORT_FOLDER_.XMLFILENAME); + $this->xml = $xml; + + if ($this->selectedVariations AND count($this->selectedVariations) > 0) + { + $ok = array(); + foreach ($this->selectedVariations as $count => $theme) + { + if ($theme == 'prestashop') + continue; + self::recurseCopy(_IMPORT_FOLDER_.'themes/'.$theme, _PS_ALL_THEMES_DIR_.$theme); + if (file_exists(_PS_ALL_THEMES_DIR_.$theme)) + $ok[] = $theme; + } + if (sizeof($ok) > 0) + { + $msg = $this->l('The following themes were successfully imported').':
          '; + foreach ($ok as $row) + $msg .= '
        • '.$row; + $msg .= '
        '; + $this->_msg = parent::displayConfirmation($msg); + } + } + self::getModules(); + if (file_exists(_IMPORT_FOLDER_.'doc') AND sizeof($xml->docs->doc) != 0) + self::_loadDocForm(); + $this->_html .= '
        '; + if ($this->to_install AND sizeof($this->to_install) > 0) + { + $var = ''; + foreach ($this->to_install as $row) + if (file_exists(_IMPORT_FOLDER_.'modules/'.$row)) + $var .= '
        '; + + if ($var != '') + $this->_html .= ' +
        + '.$this->l('Select the theme\'s modules you wish to install').' +

        '.$var.'

        +
        +

         

        '; + } + $this->_html .= ' +
        + '.$this->l('Native modules configuration').' +
          +
        • +
        • +
        • +
        +
        +

         

        '; + $this->_html .= ' +
        + '.$this->l('Theme images configuration').' +
          +
        • +
        • +
        • +
        +
        '; + $this->_html .= ' +

         

        + + +
        + '; + } + + private function _displayForm2() + { + global $cookie; + + $iso = Language::getIsoById((int)($cookie->id_lang)); + $xml = simplexml_load_file(_IMPORT_FOLDER_.XMLFILENAME); + $this->xml = $xml; + $res = $xml->xpath('/theme/descriptions/description[@iso="'.$iso.'"]'); + $description = (isset($res[0]) ? (string)$res[0] : ''); + + $this->_msg = parent::displayConfirmation( + $this->l('You are going to install the following theme').' :
        '. + $xml['name'].' v'.$xml['version'].'
        '. + (strlen($description) ? ''.$description.'
        ' : ''). + $this->l('This theme is for Prestashop').' v'. + $xml->variations->variation[0]['from']. + ' -> v'.$xml->variations->variation[0]['to'].'
        '. + (file_exists(_PS_ALL_THEMES_DIR_.strval($xml->variations->variation[0]['directory'])) ? $this->l('Warning : You already have a theme with the same folder\'s name') : '').' +
        '); + if (file_exists(_IMPORT_FOLDER_.'doc') AND sizeof($xml->docs->doc) != 0) + self::_loadDocForm(); + if (sizeof($xml->variations->variation) > 1) + { + $count = 0; + $var = ''; + while ($xml->variations->variation[++$count]) + { + $foo = (file_exists(_PS_ALL_THEMES_DIR_.strval($xml->variations->variation[$count]['directory'])) ? 1 : 0); + $var .= '
        '; + } + $this->_html .= ' +
        + '.$this->l('Choose the variations that you wish to import').' + +
        + +

        '.$this->l('Uncheck this field if you do not want to install the main theme.').'

        +
        +

        '.$this->l('Select the variations you wish to import').'

        +

        '.$var.'

        + + +
        '; + } + else + $this->_html .= ' + + + +'; + $this->_html .= ''; + } + + private function _displayForm1() + { + $tmp = scandir(_PS_ALL_THEMES_DIR_); + $themeList = array(); + + foreach ($tmp as $row) + if (is_dir(_PS_ALL_THEMES_DIR_.$row) AND file_exists(_PS_ALL_THEMES_DIR_.$row.'/index.tpl') AND $row != 'prestashop') + $themeList[] = $row; + if (count($themeList) > 0) + { + $tmp = ''; + foreach ($themeList as $row) + $tmp .= ''; + $this->_html .= ' +
        + '.$this->l('Export a theme').' + +
        + +
        + +
        +
         
        '; + } + $this->_html .= ' +
        + '.$this->l('Import from your computer').' + + +
        + +

        '.$this->l('Where is your zip file?').'

        +
        + +
        +
         
        + '; + $this->_html .= ' +
        + '.$this->l('Import from the web').' + +
        + +
        + +
        +
         
        '; + + $tmp = scandir(_IMPORT_FOLDER_); + $list = array(); + foreach ($tmp as $row) + if (substr(_IMPORT_FOLDER_.$row, -4) == '.zip') + $list[] = $row; + $tmp = ''; + foreach ($list as $row) + $tmp .= ''; + $this->_html .= ' +
        + '.$this->l('Import from FTP').' + +
        + +
        + +
        +
         
        + '; + } +/* +** EXPORT FUNCTIONS ######################################## +*/ + + private function displayInformations() + { + $this->_html .= ''; + if ($this->error === false AND class_exists('ZipArchive', false) AND ($zip = new ZipArchive())) + { + if (!($zip->open(_EXPORT_FOLDER_.'archive.zip', ZipArchive::OVERWRITE) === true) OR !$zip->addEmptyDir('test') === true) + $this->_html .= parent::displayError('Permission denied. Please set permisssion to 666 on this folder: '._EXPORT_FOLDER_); + $zip->close(); + if ($this->error === false) + $this->_html .= parent::displayConfirmation('Fill this formular to export this theme: '.Tools::getValue('mainTheme').' in a ZIP file'); + } + } + + private function archiveThisFile($obj, $file, $serverPath, $archivePath) + { + if (is_dir($serverPath.$file)) + { + $dir = scandir($serverPath.$file); + foreach ($dir as $row) + if ($row != '.' AND $row != '..') + $this->archiveThisFile($obj, $row, $serverPath.$file.'/', $archivePath.$file.'/'); + } + else if (!$obj->addFile($serverPath.$file, $archivePath.$file)) + $this->error = true; + } + + /* + ** Generate Archive ! + */ + private function generateArchive() + { + $count = 0; + $zip = new ZipArchive(); + $zip_file_name = md5(time()).".zip"; + if ($zip->open(_EXPORT_FOLDER_.$zip_file_name, ZipArchive::OVERWRITE) === true) + { + if (!$zip->addFromString('Config.xml', $this->xmlFile)) + $this->error = true; + while (isset($_FILES['mydoc_'.++$count])) + { + if (!$_FILES['mydoc_'.$count]['name']) + continue; + if (!$zip->addFile($_FILES['mydoc_'.$count]['tmp_name'], 'doc/'.$_FILES['mydoc_'.$count]['name'])) + $this->error = true; + } + foreach ($this->variations as $row) + { + $array = explode('¤', $row); + $this->archiveThisFile($zip, $array[1], _PS_ALL_THEMES_DIR_, 'themes/'); + } + foreach ($this->to_export as $row) + if (!in_array($row, $this->native_modules)) + $this->archiveThisFile($zip, $row, dirname(__FILE__).'/../../modules/', 'modules/'); + $zip->close(); + if ($this->error === false) + { + ob_end_clean(); + header('Content-Type: multipart/x-zip'); + header('Content-Disposition:attachment;filename="'.$zip_file_name.'"'); + readfile(_EXPORT_FOLDER_.$zip_file_name); + die ; + } + } + $this->_html .= parent::displayError($this->l('An error occurred during the archive generation')); + } + + /* + ** XML Generation, all vars should be GOOD at this point + */ + private function generateXML() + { + $theme = new SimpleXMLElement(''); + $theme->addAttribute('version', Tools::getValue('version')); + $theme->addAttribute('name', Tools::htmlentitiesUTF8(Tools::getValue('theme_name'))); + $author = $theme->addChild('author'); + $author->addAttribute('name', Tools::htmlentitiesUTF8(Tools::getValue('author_name'))); + $author->addAttribute('email', Tools::htmlentitiesUTF8(Tools::getValue('email'))); + $author->addAttribute('url', Tools::htmlentitiesUTF8(Tools::getValue('website'))); + + $descriptions = $theme->addChild('descriptions'); + $languages = Language::getLanguages(); + foreach ($languages as $language) + { + $val = Tools::htmlentitiesUTF8(Tools::getValue('body_title_'.$language['id_lang'])); + $description = $descriptions->addChild('description', Tools::htmlentitiesUTF8($val)); + $description->addAttribute('iso', $language['iso_code']); + } + + $variations = $theme->addChild('variations'); + foreach ($this->variations as $row) + { + $array = explode('¤', $row); + $variation = $variations->addChild('variation'); + $variation->addAttribute('name', Tools::htmlentitiesUTF8($array[0])); + $variation->addAttribute('directory', $array[1]); + $variation->addAttribute('from', $array[2]); + $variation->addAttribute('to', $array[3]); + } + + $docs = $theme->addChild('docs'); + if (isset($this->user_doc)) + foreach ($this->user_doc as $row) + { + $array = explode('¤', $row); + $doc = $docs->addChild('doc'); + $doc->addAttribute('name', $array[0]); + $doc->addAttribute('path', $array[1]); + } + + $modules = $theme->addChild('modules'); + if (isset($this->to_export)) + foreach ($this->to_export as $row) + if (!in_array($row, $this->native_modules)) + { + $module = $modules->addChild('module'); + $module->addAttribute('action', 'install'); + $module->addAttribute('name', $row); + } + foreach ($this->to_enable as $row) + { + $module = $modules->addChild('module'); + $module->addAttribute('action', 'enable'); + $module->addAttribute('name', $row); + } + foreach ($this->to_disable as $row) + { + $module = $modules->addChild('module'); + $module->addAttribute('action', 'disable'); + $module->addAttribute('name', $row); + } + + $hooks = $modules->addChild('hooks'); + foreach ($this->to_hook as $row) + { + $array = explode(';', $row); + $hook = $hooks->addChild('hook'); + $hook->addAttribute('module', $array[0]); + $hook->addAttribute('hook', $array[1]); + $hook->addAttribute('position', $array[2]); + } + + $images = $theme->addChild('images'); + foreach ($this->image_list as $row) + { + $array = explode(';', $row); + $image = $images->addChild('image'); + $image->addAttribute('name', Tools::htmlentitiesUTF8($array[0])); + $image->addAttribute('width', $array[1]); + $image->addAttribute('height', $array[2]); + $image->addAttribute('products', $array[3]); + $image->addAttribute('categories', $array[4]); + $image->addAttribute('manufacturers', $array[5]); + $image->addAttribute('suppliers', $array[6]); + $image->addAttribute('scenes', $array[7]); + } + $this->xmlFile = $theme->asXML(); + } + + /* + ** Init modules and Hooks + */ + private function _initList() + { + $this->native_modules = self::getTheNativeModules(); + $this->module_list = Db::getInstance()->ExecuteS('SELECT id_module, name, active FROM `'._DB_PREFIX_.'module`'); + $this->hook_list = Db::getInstance()->ExecuteS(' + SELECT a.id_hook, a.name as name_hook, c.position, c.id_module, d.name as name_module + FROM `'._DB_PREFIX_.'hook` a + LEFT JOIN `'._DB_PREFIX_.'hook_module` c ON c.id_hook = a.id_hook + LEFT JOIN `'._DB_PREFIX_.'module` d ON (c.id_module = d.id_module) + ORDER BY name_module'); + } + + /* + ** Fill module's vars + */ + private function getModuleState() + { + self::_initList(); + foreach ($this->module_list as $array) + { + if (!self::checkParentClass($array['name'])) + continue ; + if (in_array($array['name'], $this->native_modules)) + { + if ($array['active'] == 1) + $this->to_enable[] = $array['name']; + else + $this->to_disable[] = $array['name']; + } + else if ($array['active'] == 1) + $this->to_install[] = $array['name']; + } + foreach ($this->native_modules as $str) + { + $flag = 0; + if (!self::checkParentClass($str)) + continue ; + foreach ($this->module_list as $tmp) + if (in_array($str, $tmp)) + { + $flag = 1; + break; + } + if ($flag == 0) + $this->to_disable[] = $str; + } + } + + /* + ** Fill Hook Var + */ + private function getHookState() + { + foreach ($this->to_install as $string) + foreach ($this->hook_list as $tmp) + if ($tmp['name_module'] == $string) + $this->to_hook[] = $string.';'.$tmp['name_hook'].';'.$tmp['position']; + foreach ($this->to_enable as $string) + foreach ($this->hook_list as $tmp) + if ($tmp['name_module'] == $string) + $this->to_hook[] = $string.';'.$tmp['name_hook'].';'.$tmp['position']; + } + + /* + ** Fill Image var + */ + private function getImageState() + { + $table = Db::getInstance()->ExecuteS('SELECT name, width, height, products, categories, manufacturers, suppliers, scenes FROM `'._DB_PREFIX_.'image_type`'); + foreach ($table as $row) + $this->image_list[] = $row['name'].';'.$row['width'].';'.$row['height'].';'. + ($row['products'] == 1 ? 'true' : 'false').';'. + ($row['categories'] == 1 ? 'true' : 'false').';'. + ($row['manufacturers'] == 1 ? 'true' : 'false').';'. + ($row['suppliers'] == 1 ? 'true' : 'false').';'. + ($row['scenes'] == 1 ? 'true' : 'false'); + } + + /* + ** Takes current and submited theme's informations + */ + private function getThemeVariations() + { + $from = Tools::getValue('compa_from'); + $to = Tools::getValue('compa_to'); + $this->variations[] = Tools::getValue('theme_name').'¤'.Tools::getValue('mainTheme').'¤'.$from.'¤'.$to; + $count = 0; + while (Tools::isSubmit('myvar_'.++$count)) + { + if ((int)(Tools::getValue('myvar_'.$count)) == -1) + continue ; + $name = Tools::getValue('themevariationname_'.$count); + $dir = Tools::getValue('myvar_'.$count); + $from = Tools::getValue('compafrom_'.$count); + $to = Tools::getValue('compato_'.$count); + $this->variations[] = $name.'¤'.$dir.'¤'.$from.'¤'.$to; + } + } + + private function getDocumentation() + { + $count = 0; + while (Tools::isSubmit('documentationName_'.++$count)) + { + if (!($filename = Tools::htmlentitiesUTF8($_FILES['mydoc_'.$count]['name']))) + continue ; + $name = Tools::htmlentitiesUTF8(Tools::getValue('documentationName_'.$count)); + $this->user_doc[] = $name.'¤'.'doc/'.$filename; + } + } + + private function checkPostedDatas() + { + $mail = Tools::getValue('email'); + $website = Tools::getValue('website'); + + if ($mail AND !preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,6}$#', $mail)) + $this->_html .= parent::displayError($this->l('There is an error in your e-mail syntax!')); + else if ($website AND (!Validate::isURL($website) OR !Validate::isAbsoluteUrl($website))) + $this->_html .= parent::displayError($this->l('There is an error in your URL syntax!')); + else if (!$this->checkVersionsAndCompatibility() OR !$this->checkNames() OR !$this->checkDocumentation()) + return false; + else + return true; + return false; + } + + /* + ** Checks posted documentation + */ + private function checkDocumentation() + { + $count = 0; + $extensions = array('.pdf', '.txt'); + while ($this->error == false AND isset($_FILES['mydoc_'.++$count])) + { + if (!$_FILES['mydoc_'.$count]['name']) + continue; + $extension = strrchr($_FILES['mydoc_'.$count]['name'], '.'); + $name = Tools::getValue('documentationName_'.$count); + + if (!in_array($extension, $extensions)) + $this->_html .= parent::displayError($this->l('File extension must be .txt or .pdf')); + else if ($_FILES['mydoc_'.$count]['error'] > 0 OR $_FILES['mydoc_'.$count]['size'] > 1048576) + $this->_html .= parent::displayError($this->l('An error occurred during documentation upload')); + else if (!$name OR !Validate::isGenericName($name) OR strlen($name) > MAX_NAME_LENGTH) + $this->_html .= parent::displayError($this->l('Please enter a valid documentation name')); + } + if ($this->error == true) + return false; + return true; + } + + /* + ** Checks theme's and author's name syntax, existence and length + */ + private function checkNames() + { + $author = Tools::getValue('author_name'); + $name = Tools::getValue('theme_name'); + $count = 0; + + if (!$author OR !Validate::isGenericName($author) OR strlen($author) > MAX_NAME_LENGTH) + $this->_html .= parent::displayError($this->l('Please enter a valid author name')); + else if (!$name OR !Validate::isGenericName($name) OR strlen($name) > MAX_NAME_LENGTH) + $this->_html .= parent::displayError($this->l('Please enter a valid theme name')); + while ($this->error === false AND Tools::isSubmit('myvar_'.++$count)) + { + if ((int)(Tools::getValue('myvar_'.$count)) == -1) + continue ; + $name = Tools::getValue('themevariationname_'.$count); + if (!$name OR !Validate::isGenericName($name) OR strlen($name) > MAX_NAME_LENGTH) + $this->_html .= parent::displayError($this->l('Please enter a valid theme variation name')); + } + if ($this->error == true) + return false; + return true; + } + + private function checkVersionsAndCompatibility() + { + $count = 0; + $exp = "#^[0-9]+[.]+[0-9.]*[0-9]$#"; + + if (!preg_match("#^[0-9][.][0-9]$#", Tools::getValue('version')) OR + !preg_match($exp, Tools::getValue('compa_from')) OR !preg_match($exp, Tools::getValue('compa_to')) OR + version_compare(Tools::getValue('compa_from'), Tools::getValue('compa_to')) == 1) + $this->_html .= parent::displayError($this->l('Syntax error on version field. Only digits and points are allowed and the compatibility should be increasing or equal.')); + while ($this->error === false AND Tools::isSubmit('myvar_'.++$count)) + { + if ((int)(Tools::getValue('myvar_'.$count)) == -1) + continue ; + $from = Tools::getValue('compafrom_'.$count); + $to = Tools::getValue('compato_'.$count); + if (!preg_match($exp, $from) OR !preg_match($exp, $to) OR version_compare($from, $to) == 1) + $this->_html .= parent::displayError($this->l('Syntax error on version. Only digits and points are allowed and compatibility should be increasing or equal.')); + } + if ($this->error == true) + return false; + return true; + } + + private function ModulesInformationForm() + { + if ($this->to_install AND count($this->to_install)) + { + $tmp = ''; + foreach ($this->to_install as $key => $val) + $tmp .= 'to_export) ? 'checked="checked"' : "").'/>
        '; + $this->_html .= ' +
        + '.$this->l('Modules').' + +
        '.$tmp.'
        +
        +

         

        '; + } + } + + private function AuthorInformationForm() + { + global $cookie; + + $employee = new Employee((int)$cookie->id_employee); + $mail = Tools::getValue('email') ? Tools::htmlentitiesUTF8(Tools::getValue('email')) : Tools::htmlentitiesUTF8($cookie->email); + $author = Tools::getValue('author_name') ? Tools::htmlentitiesUTF8(Tools::getValue('author_name')) : Tools::htmlentitiesUTF8(($employee->firstname).' '.$employee->lastname); + $website = Tools::getValue('website') ? Tools::htmlentitiesUTF8(Tools::getValue('website')) : Tools::getHttpHost(true); + + $this->_html .= ' +
        + '.$this->l('Author').' + +
        + +
        + +
        + +
        + +
        + +
        +
        +
         
        '; + } + + private function ThemeInformationForm() + { + global $cookie; + + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $languages = Language::getLanguages(); + $iso = Language::getIsoById((int)($cookie->id_lang)); + $divLangName = 'title'; + $val = Tools::getValue('theme_name') ? Tools::getValue('theme_name') : Tools::getValue('mainTheme'); + + $this->_html .= ' +
        + '.$this->l('Theme').' + +
        + +

        '.$this->l('Your theme\'s name').'

        +
        + +
        '; + foreach ($languages as $language) + { + $val = Tools::htmlentitiesUTF8(Tools::getValue('body_title_'.$language['id_lang'])); + $this->_html .= ' +
        + +
        '; + } + $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'title', true); + $this->_html .= ' +

        '.$this->l('Enter a short description of your theme').'

        +
        '; + $val = Tools::getValue('version') ? Tools::getValue('version') : DEFAULT_T_VER; + $this->_html .= ' + +
        + +

        '.$this->l('Your theme\'s version').'

        +
        '; + $val = Tools::getValue('compa_from') ? Tools::getValue('compa_from') : DEFAULT_COMPATIBILITY_FROM; + $val2 = Tools::getValue('compa_to') ? Tools::getValue('compa_to') : DEFAULT_COMPATIBILITY_TO; + $this->_html .= ' +
        + +
        + +
        +
        +
        + +
        + +
        +
        +

         

        '; + } + + private function DocInformationForm() + { + $val = Tools::htmlentitiesUTF8(Tools::getValue('documentation')); + $this->_html .= ' + +

        '. + $this->l('Give the user some help. Add a field by clicking here').' + add.
        '. + $this->l('File extension must be .txt or .pdf').' +

        + +
        + '; + $this->_html .= '

         

        '; + } + + private function VariationInformationForm() + { + $script = _MODULE_DIR_.$this->name.'/script.js'; + + $this->_html .= ' + +

        '.$this->l('Select theme to include and its compatibility.').'

        + + +
        +
         
        '; + $this->_html .= ' +
        +
         
        +   + + '; + } +} diff --git a/modules/tm4b/classes/Tm4bSms.php b/modules/tm4b/classes/Tm4bSms.php new file mode 100644 index 000000000..8e9af8596 --- /dev/null +++ b/modules/tm4b/classes/Tm4bSms.php @@ -0,0 +1,232 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +class Tm4bSms { + + const __TM4B_SMS_HTTP_HOST__ = 'www.tm4b.com'; + const __TM4B_SMS_HTTP_SERVICE__ = '/client/api/http.php'; + const __TM4B_SMS_HTTP_METHOD__ = 'GET'; + const __TM4B_SMS_MESSAGE_TYPE__ = 'broadcast'; + + const __TM4B_SMS_CHECKBALANCE_TYPE__ = 'check_balance'; + const __TM4B_SMS_CHECKROUTE_TYPE__ = 'check_destination'; + const __TM4B_SMS_CHECKSTATUS_TYPE__ = 'check_status'; + + + // Keep the Query String for HTTP + private $_httpQS = ''; + + public $msg; + private $_to = array(); + + private $errors; + private $_user; + private $_pass; + private $_route; + private $_from; + + private $_id; + + function __construct($user, $pass, $route, $from = 'tm4b', $to = array(), $message = '') + { + $this->msg = $message; + $this->_user = $user; + $this->_pass = $pass; + $this->_route = $route; + $this->_from = $from; + + foreach ($to as $num) + { + $this->addRecipient($num); + } + $this->_id = array(); // identifier of the sent sms + } + + + // Build the query string for HTTP + private function BuildQS($args) + { + $qs = ''; + $countArgs = 1; + foreach ($args as $key => $value) + { + if (is_array($value)) + { + $countTo = 1; + $qs .= $key . '='; + foreach ($value as $index => $recipient) + { + if ($key == 'id') + $qs .= $recipient; + else + $qs .= urlencode($recipient); + + if ($countTo < sizeof($value)) + $qs .= '|'; + $countTo++; + } + } + else + { + $qs .= $key . '=' . urlencode($value); + } + + if ($countArgs < sizeof($args)) + $qs .= '&'; + $countArgs++; + } + return $qs; + } + + // Send a HTTP Queries through sockets + private function SendSocketHTTP() + { + // init infos + if( self::__TM4B_SMS_HTTP_METHOD__ == "GET") + { + $script = self::__TM4B_SMS_HTTP_SERVICE__ . '?' . $this->_httpQS; + } + else + { + $script = self::__TM4B_SMS_HTTP_SERVICE__ ; + } + + + // Build HTTP Header + $header = self::__TM4B_SMS_HTTP_METHOD__ . " " . $script . " HTTP/1.1\r\n"; + $header .= "Host: " . self::__TM4B_SMS_HTTP_HOST__ . "\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . Tools::strlen($this->_httpQS) . "\r\n"; + $header .= "Connection: close\r\n\r\n"; + $header .= $this->_httpQS . "\r\n"; + + // Socket connection + $socket = fsockopen( self::__TM4B_SMS_HTTP_HOST__ , 80, $errno, $errstr); + + if($socket) // if we're connected + { + fputs($socket, $header); // Send header + while(!feof($socket)) + { + $response[] = fgets($socket); // Grab return codes + } + fclose($socket); + } + else + { + $response = false; + } + return ($response); + } + + +############################################################# +# +# PUBLIC METHODS +# +############################################################# + + // Add a recipent + public function AddRecipient($to, $country_code = NULL) + { + if ($country_code) + $to = preg_replace('/^0/', $country_code, $to); + array_push($this->_to, $to); + } + + // Returns the current balance of the account in credits + public function CheckCredits() + { + $this->_httpQS = $this->BuildQS( array( 'username' => $this->_user, + 'password' => $this->_pass, + 'type' => self::__TM4B_SMS_CHECKBALANCE_TYPE__) ); + $response = $this->SendSocketHTTP(); + if (isset($response[8])) + return $response[8]; + return ''; + } + + // Return the cost to send sms to a given country or number + public function CheckRoute() + { + $this->_httpQS = $this->BuildQS( array ( 'username' => $this->_user, + 'password' => $this->_pass, + 'type' => self::__TM4B_SMS_CHECKROUTE_TYPE__, + 'dest' => $this->to, + 'route' => $this->_route ) ); + return ($this->SendSocketHTTP()); + } + + // Send SMS trought various possible methods (SMTP / HTTP) + public function Send($sim = 'no') + { + // Return if we can't send the sms + if (empty($this->msg) OR empty($this->_to)) + return false; + + $sim = ($sim == '0' ? 'no' : 'yes'); + + $this->_httpQS = $this->BuildQS( array ( + 'username' => $this->_user, + 'password' => $this->_pass, + 'type' => self::__TM4B_SMS_MESSAGE_TYPE__, + 'to' => $this->_to, + 'route' => $this->_route, + 'from' => $this->_from, + 'msg' => $this->msg, + 'sim' => $sim + ) + ); + $ret = $this->SendSocketHTTP(); + if (is_array($ret)) + { + $this->_id = $ret[8]; + return $ret[8]; + } + else + return $ret; + } + + public function isSent() + { + if (isset($this->_id) AND preg_match('/^MT.*/', $this->_id)) + return true; + return false; + } + + public function CheckStatus() + { + $this->_httpQS = $this->BuildQS( array ( + $this->_user, + 'password' => $this->_pass, + 'type' => self::__TM4B_SMS_CHECKSTATUS_TYPE__, + 'id' => $this->_id ) + ); + echo 'QS = '.$this->_httpQS."\n"; + return $this->SendSocketHTTP(); + } +} + diff --git a/modules/tm4b/config.xml b/modules/tm4b/config.xml new file mode 100755 index 000000000..3ebe6d72b --- /dev/null +++ b/modules/tm4b/config.xml @@ -0,0 +1,12 @@ + + + tm4b + SMS Tm4b + 1.1 + Sends an SMS for each new order + PrestaShop + administration + Are you sure you want to delete your info? + 1 + 1 + \ No newline at end of file diff --git a/modules/tm4b/cron.php b/modules/tm4b/cron.php new file mode 100644 index 000000000..6d71e0d8e --- /dev/null +++ b/modules/tm4b/cron.php @@ -0,0 +1,47 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/tm4b.php'); +include(dirname(__FILE__).'/classes/Tm4bSms.php'); + +if (!Configuration::get('TM4B_DAILY_REPORT_ACTIVE')) + die ('Daily report not active'); +if (Configuration::get('TM4B_LAST_REPORT') == date('Y-m-d')) + die ('Report already sent'); +Configuration::updateValue('TM4B_LAST_REPORT', date('Y-m-d')); +$module = new Tm4b(); +$sms = new Tm4bSms(Configuration::get('TM4B_USER'), Configuration::get('TM4B_PASSWORD'), Configuration::get('TM4B_ROUTE')); +$sms->msg = $module->getStatsBody(); +$numbers = explode(',', Configuration::get('TM4B_NEW_ORDER_NUMBERS')); +foreach ($numbers as $number) + if ($number != '') + $sms->addRecipient($number); +$sms->Send(Configuration::get('TM4B_SIM')); +die ('OK'); + diff --git a/modules/tm4b/de.php b/modules/tm4b/de.php new file mode 100644 index 000000000..1ef416eee --- /dev/null +++ b/modules/tm4b/de.php @@ -0,0 +1,44 @@ +tm4b_599f02a21a8d80cfa87a3a42f9aef067'] = 'Sendet eine SMS bei jeder neuen Bestellung'; +$_MODULE['<{tm4b}prestashop>tm4b_2c8be96b677dc6b891a343193822fea4'] = 'Sie sind sicher, dass Sie Ihre Daten löschen möchten?'; +$_MODULE['<{tm4b}prestashop>tm4b_088d3bfa945e4c27ac0fea363bb13d12'] = 'Nachricht erfolgreich gesendet'; +$_MODULE['<{tm4b}prestashop>tm4b_0cda570a27de3fbd0940da019f759721'] = 'Fehler beim Senden der Nachricht'; +$_MODULE['<{tm4b}prestashop>tm4b_884b60418e2f1f9a6a40f12e8ca0a64d'] = 'Login und Telefonnummer'; +$_MODULE['<{tm4b}prestashop>tm4b_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{tm4b}prestashop>tm4b_8b58aafd28dcaee7f6e92442c96e31db'] = 'Schicken Sie eine Test-SMS:'; +$_MODULE['<{tm4b}prestashop>tm4b_43e9e66e3a7acefd0663287c95acd407'] = 'Geben Sie Ihre Telefonnummer ein'; +$_MODULE['<{tm4b}prestashop>tm4b_35ba634a7df95f937550c54b7b94d2c5'] = 'z.B.: 33642424242'; +$_MODULE['<{tm4b}prestashop>tm4b_2e1779891f69b099b16616ae7ea2e76c'] = 'SMS-Guthaben:'; +$_MODULE['<{tm4b}prestashop>tm4b_00db7aae85aecb79c75afca7daa8f22e'] = 'Sie haben'; +$_MODULE['<{tm4b}prestashop>tm4b_928735d6f2c63bee316dd511c8ccaf55'] = 'Guthaben'; +$_MODULE['<{tm4b}prestashop>tm4b_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{tm4b}prestashop>tm4b_cac81c648846c9b8c3e6085a45782c7e'] = 'Benutzername:'; +$_MODULE['<{tm4b}prestashop>tm4b_b341a59d5636ed3d6a819137495b08a0'] = 'Kennwort:'; +$_MODULE['<{tm4b}prestashop>tm4b_6c47d739c79e0f93ec0cd90663a68ebf'] = 'Relais:'; +$_MODULE['<{tm4b}prestashop>tm4b_43e7396afc9f4633157a47bf5f5af96c'] = 'SMS Absendertelefonnr.'; +$_MODULE['<{tm4b}prestashop>tm4b_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{tm4b}prestashop>tm4b_4f502b57d2835715eaa382c7d4c32e94'] = 'Simulation'; +$_MODULE['<{tm4b}prestashop>tm4b_756d97bb256b8580d4d71ee0c547804e'] = 'Betrieb'; +$_MODULE['<{tm4b}prestashop>tm4b_ea24be6a78dd661afe60448e87b75065'] = 'Benachrichtigungen über neue Bestellung:'; +$_MODULE['<{tm4b}prestashop>tm4b_93cba07454f06a4a960172bbd6e2a435'] = 'Ja'; +$_MODULE['<{tm4b}prestashop>tm4b_7b357f8e4b60349aeba339f3032e4a84'] = 'SMS schicken, wenn eine neue Bestellung gemacht wird'; +$_MODULE['<{tm4b}prestashop>tm4b_ff914fecb4b37bd6edb2e4515ec1d4dc'] = 'Benachrichtigungen zur Produktmenge:'; +$_MODULE['<{tm4b}prestashop>tm4b_2ed5f5c1670d557c67c958d1f230cb2c'] = 'SMS schicken, wenn die Produktmenge aktualisiert wird'; +$_MODULE['<{tm4b}prestashop>tm4b_d0759ad8efa7234c0f9b919f9ec88c2b'] = 'Tagesbericht:'; +$_MODULE['<{tm4b}prestashop>tm4b_a5d859ac85a50ed9d8b6d93be6abd217'] = 'Senden Sie einen täglichen Statistikbericht - Sie müssen einen CRON einstellen auf'; +$_MODULE['<{tm4b}prestashop>tm4b_481bfc100d0a3590edb72f53679e310c'] = 'SMS-Empfänger-Telefonnr.'; +$_MODULE['<{tm4b}prestashop>tm4b_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisiert'; +$_MODULE['<{tm4b}prestashop>tm4b_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{tm4b}prestashop>tm4b_b1a293b0efa4e1e7c35ef375c3cd7a44'] = 'Benutzername ist obligatorisch'; +$_MODULE['<{tm4b}prestashop>tm4b_8c194fef39e0d251494686926884733e'] = 'Kennwort ist obligatorisch'; +$_MODULE['<{tm4b}prestashop>tm4b_6ac6840e86a7b09bf9eb326228060981'] = 'Root ist obligatorisch'; +$_MODULE['<{tm4b}prestashop>tm4b_486493b98a473ebb777dd86bbf264e06'] = 'Herkunft ist obligatorisch'; +$_MODULE['<{tm4b}prestashop>tm4b_30c94c563402b0a87e4b5411518ab542'] = 'Modus ist obligatorisch'; +$_MODULE['<{tm4b}prestashop>tm4b_aea21c9ea4f10d22071eb479eee918c3'] = 'Bitte geben Sie eine Telefonnummer ein'; +$_MODULE['<{tm4b}prestashop>tm4b_713569f69019a591adfda481f6668a06'] = 'Telefonnummer ungültig'; +$_MODULE['<{tm4b}prestashop>tm4b_8394f2c720f3798ff8ef93fe7e331866'] = 'Bestellungen:'; +$_MODULE['<{tm4b}prestashop>tm4b_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Verkäufe:'; +$_MODULE['<{tm4b}prestashop>tm4b_01411a97818b38fc6524d56590ca5a12'] = 'Monat:'; diff --git a/modules/tm4b/en.php b/modules/tm4b/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/tm4b/en.php @@ -0,0 +1,4 @@ +tm4b_599f02a21a8d80cfa87a3a42f9aef067'] = 'Enviar un SMS para cada nuevo pedido'; +$_MODULE['<{tm4b}prestashop>tm4b_2c8be96b677dc6b891a343193822fea4'] = '¿Está seguro de querer eliminar toda su información?'; +$_MODULE['<{tm4b}prestashop>tm4b_088d3bfa945e4c27ac0fea363bb13d12'] = 'Mensaje enviado correctamente'; +$_MODULE['<{tm4b}prestashop>tm4b_0cda570a27de3fbd0940da019f759721'] = 'error durante el envío del mensaje'; +$_MODULE['<{tm4b}prestashop>tm4b_884b60418e2f1f9a6a40f12e8ca0a64d'] = 'Login y número de teléfono'; +$_MODULE['<{tm4b}prestashop>tm4b_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Información'; +$_MODULE['<{tm4b}prestashop>tm4b_8b58aafd28dcaee7f6e92442c96e31db'] = 'Probar envío de SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_43e9e66e3a7acefd0663287c95acd407'] = 'Introduzca su número de teléfono'; +$_MODULE['<{tm4b}prestashop>tm4b_35ba634a7df95f937550c54b7b94d2c5'] = 'ej: 33642424242rnrn'; +$_MODULE['<{tm4b}prestashop>tm4b_2e1779891f69b099b16616ae7ea2e76c'] = 'crédito SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_00db7aae85aecb79c75afca7daa8f22e'] = 'Tiene'; +$_MODULE['<{tm4b}prestashop>tm4b_928735d6f2c63bee316dd511c8ccaf55'] = 'de crédito'; +$_MODULE['<{tm4b}prestashop>tm4b_f4f70727dc34561dfde1a3c529b6205c'] = 'configuración'; +$_MODULE['<{tm4b}prestashop>tm4b_cac81c648846c9b8c3e6085a45782c7e'] = 'Nombre de usuario'; +$_MODULE['<{tm4b}prestashop>tm4b_b341a59d5636ed3d6a819137495b08a0'] = 'Contraseña'; +$_MODULE['<{tm4b}prestashop>tm4b_6c47d739c79e0f93ec0cd90663a68ebf'] = 'Relay:'; +$_MODULE['<{tm4b}prestashop>tm4b_43e7396afc9f4633157a47bf5f5af96c'] = 'Teléfono del remitente del SMS '; +$_MODULE['<{tm4b}prestashop>tm4b_1ee1c44c2dc81681f961235604247b81'] = 'modo:'; +$_MODULE['<{tm4b}prestashop>tm4b_4f502b57d2835715eaa382c7d4c32e94'] = 'Simulación'; +$_MODULE['<{tm4b}prestashop>tm4b_756d97bb256b8580d4d71ee0c547804e'] = 'Producción'; +$_MODULE['<{tm4b}prestashop>tm4b_ea24be6a78dd661afe60448e87b75065'] = 'Alerta cada nuevo pedido:'; +$_MODULE['<{tm4b}prestashop>tm4b_93cba07454f06a4a960172bbd6e2a435'] = 'Sí'; +$_MODULE['<{tm4b}prestashop>tm4b_7b357f8e4b60349aeba339f3032e4a84'] = 'Enviar un SMS si se realiza un nuevo pedido'; +$_MODULE['<{tm4b}prestashop>tm4b_ff914fecb4b37bd6edb2e4515ec1d4dc'] = 'Alerta por cantidad de productos:'; +$_MODULE['<{tm4b}prestashop>tm4b_2ed5f5c1670d557c67c958d1f230cb2c'] = 'Enviar un SMS cuando se actualiza el stock del producto'; +$_MODULE['<{tm4b}prestashop>tm4b_d0759ad8efa7234c0f9b919f9ec88c2b'] = 'Informe diario'; +$_MODULE['<{tm4b}prestashop>tm4b_a5d859ac85a50ed9d8b6d93be6abd217'] = 'Enviar un informe diario de las estadísticas. Debe fijar un CRON a'; +$_MODULE['<{tm4b}prestashop>tm4b_481bfc100d0a3590edb72f53679e310c'] = 'teléfono del destinatario del SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_b17f3f4dcf653a5776792498a9b44d6a'] = 'Actualizar configuración'; +$_MODULE['<{tm4b}prestashop>tm4b_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{tm4b}prestashop>tm4b_b1a293b0efa4e1e7c35ef375c3cd7a44'] = 'El nombre de usuario es obligatorio'; +$_MODULE['<{tm4b}prestashop>tm4b_8c194fef39e0d251494686926884733e'] = 'La contraseña es obligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_6ac6840e86a7b09bf9eb326228060981'] = 'La ruta es obligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_486493b98a473ebb777dd86bbf264e06'] = 'El origen es obligatorio'; +$_MODULE['<{tm4b}prestashop>tm4b_30c94c563402b0a87e4b5411518ab542'] = 'El modo es obligatorio'; +$_MODULE['<{tm4b}prestashop>tm4b_aea21c9ea4f10d22071eb479eee918c3'] = 'Por favor, indique un número de teléfono'; +$_MODULE['<{tm4b}prestashop>tm4b_713569f69019a591adfda481f6668a06'] = 'Número de teléfono no válido'; +$_MODULE['<{tm4b}prestashop>tm4b_8394f2c720f3798ff8ef93fe7e331866'] = 'Pedidos:'; +$_MODULE['<{tm4b}prestashop>tm4b_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Ventas:'; +$_MODULE['<{tm4b}prestashop>tm4b_01411a97818b38fc6524d56590ca5a12'] = 'Mes:'; diff --git a/modules/tm4b/fr.php b/modules/tm4b/fr.php new file mode 100644 index 000000000..cbb89a766 --- /dev/null +++ b/modules/tm4b/fr.php @@ -0,0 +1,44 @@ +tm4b_599f02a21a8d80cfa87a3a42f9aef067'] = 'Envoyer un SMS à chaque nouvelle commande'; +$_MODULE['<{tm4b}prestashop>tm4b_2c8be96b677dc6b891a343193822fea4'] = 'Êtes-vous sûr de vouloir supprimer ces informations ?'; +$_MODULE['<{tm4b}prestashop>tm4b_088d3bfa945e4c27ac0fea363bb13d12'] = 'Message bien envoyé'; +$_MODULE['<{tm4b}prestashop>tm4b_0cda570a27de3fbd0940da019f759721'] = 'Erreur lors de l\'envoie du message'; +$_MODULE['<{tm4b}prestashop>tm4b_884b60418e2f1f9a6a40f12e8ca0a64d'] = 'Identifiant et numéro de téléphone'; +$_MODULE['<{tm4b}prestashop>tm4b_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information'; +$_MODULE['<{tm4b}prestashop>tm4b_8b58aafd28dcaee7f6e92442c96e31db'] = 'Envoyer un SMS de test :'; +$_MODULE['<{tm4b}prestashop>tm4b_43e9e66e3a7acefd0663287c95acd407'] = 'Entrez votre numéro de téléphone'; +$_MODULE['<{tm4b}prestashop>tm4b_35ba634a7df95f937550c54b7b94d2c5'] = 'ex: 33642424242'; +$_MODULE['<{tm4b}prestashop>tm4b_2e1779891f69b099b16616ae7ea2e76c'] = 'Crédits SMS :'; +$_MODULE['<{tm4b}prestashop>tm4b_00db7aae85aecb79c75afca7daa8f22e'] = 'Vous avez'; +$_MODULE['<{tm4b}prestashop>tm4b_928735d6f2c63bee316dd511c8ccaf55'] = 'crédits'; +$_MODULE['<{tm4b}prestashop>tm4b_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{tm4b}prestashop>tm4b_cac81c648846c9b8c3e6085a45782c7e'] = 'Identifiant :'; +$_MODULE['<{tm4b}prestashop>tm4b_b341a59d5636ed3d6a819137495b08a0'] = 'Mot de passe :'; +$_MODULE['<{tm4b}prestashop>tm4b_6c47d739c79e0f93ec0cd90663a68ebf'] = 'Relais :'; +$_MODULE['<{tm4b}prestashop>tm4b_43e7396afc9f4633157a47bf5f5af96c'] = 'Numéro de téléphone de l\'expéditeur du SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_1ee1c44c2dc81681f961235604247b81'] = 'Mode :'; +$_MODULE['<{tm4b}prestashop>tm4b_4f502b57d2835715eaa382c7d4c32e94'] = 'Simulation'; +$_MODULE['<{tm4b}prestashop>tm4b_756d97bb256b8580d4d71ee0c547804e'] = 'Production'; +$_MODULE['<{tm4b}prestashop>tm4b_ea24be6a78dd661afe60448e87b75065'] = 'Alerte nouvelle commande'; +$_MODULE['<{tm4b}prestashop>tm4b_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{tm4b}prestashop>tm4b_7b357f8e4b60349aeba339f3032e4a84'] = 'Envoi un SMS à chaque nouvelle commande'; +$_MODULE['<{tm4b}prestashop>tm4b_ff914fecb4b37bd6edb2e4515ec1d4dc'] = 'Alerte changement de stock'; +$_MODULE['<{tm4b}prestashop>tm4b_2ed5f5c1670d557c67c958d1f230cb2c'] = 'Envoi un SMS à chaque changement de stock'; +$_MODULE['<{tm4b}prestashop>tm4b_d0759ad8efa7234c0f9b919f9ec88c2b'] = 'Rapport quotidien'; +$_MODULE['<{tm4b}prestashop>tm4b_a5d859ac85a50ed9d8b6d93be6abd217'] = 'Envoi un rapport journalier - vous devez configurer un CRON sur le fichier'; +$_MODULE['<{tm4b}prestashop>tm4b_481bfc100d0a3590edb72f53679e310c'] = 'Numéro de téléphone du destinataire du SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour les informations'; +$_MODULE['<{tm4b}prestashop>tm4b_c888438d14855d7d96a2724ee9c306bd'] = 'Informations mises à jour'; +$_MODULE['<{tm4b}prestashop>tm4b_b1a293b0efa4e1e7c35ef375c3cd7a44'] = 'Identifiant obligatoire'; +$_MODULE['<{tm4b}prestashop>tm4b_8c194fef39e0d251494686926884733e'] = 'Mot de passe obligatoire'; +$_MODULE['<{tm4b}prestashop>tm4b_6ac6840e86a7b09bf9eb326228060981'] = 'Route obligatoire'; +$_MODULE['<{tm4b}prestashop>tm4b_486493b98a473ebb777dd86bbf264e06'] = 'Origine obligatoire'; +$_MODULE['<{tm4b}prestashop>tm4b_30c94c563402b0a87e4b5411518ab542'] = 'Mode obligatoire'; +$_MODULE['<{tm4b}prestashop>tm4b_aea21c9ea4f10d22071eb479eee918c3'] = 'Merci d\'entrer un numéro de téléphone'; +$_MODULE['<{tm4b}prestashop>tm4b_713569f69019a591adfda481f6668a06'] = 'Numéro de téléphone invalide'; +$_MODULE['<{tm4b}prestashop>tm4b_8394f2c720f3798ff8ef93fe7e331866'] = 'Commandes'; +$_MODULE['<{tm4b}prestashop>tm4b_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'CA'; +$_MODULE['<{tm4b}prestashop>tm4b_01411a97818b38fc6524d56590ca5a12'] = 'Mois'; diff --git a/modules/tm4b/informations.gif b/modules/tm4b/informations.gif new file mode 100644 index 000000000..a4316825e Binary files /dev/null and b/modules/tm4b/informations.gif differ diff --git a/modules/tm4b/it.php b/modules/tm4b/it.php new file mode 100644 index 000000000..d2218a2b4 --- /dev/null +++ b/modules/tm4b/it.php @@ -0,0 +1,44 @@ +tm4b_599f02a21a8d80cfa87a3a42f9aef067'] = 'Invia un SMS per ogni nuovo ordine'; +$_MODULE['<{tm4b}prestashop>tm4b_2c8be96b677dc6b891a343193822fea4'] = 'Sei sicuro di voler cancellare le tue informazioni?'; +$_MODULE['<{tm4b}prestashop>tm4b_088d3bfa945e4c27ac0fea363bb13d12'] = 'Messaggio inviato con successo'; +$_MODULE['<{tm4b}prestashop>tm4b_0cda570a27de3fbd0940da019f759721'] = 'Errore durante l\'invio del messaggio'; +$_MODULE['<{tm4b}prestashop>tm4b_884b60418e2f1f9a6a40f12e8ca0a64d'] = 'Login e numero di telefono'; +$_MODULE['<{tm4b}prestashop>tm4b_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Informazioni'; +$_MODULE['<{tm4b}prestashop>tm4b_8b58aafd28dcaee7f6e92442c96e31db'] = 'Inviare SMS di prova:'; +$_MODULE['<{tm4b}prestashop>tm4b_43e9e66e3a7acefd0663287c95acd407'] = 'Inserisci il tuo numero di telefono'; +$_MODULE['<{tm4b}prestashop>tm4b_35ba634a7df95f937550c54b7b94d2c5'] = 'es: 33642424242'; +$_MODULE['<{tm4b}prestashop>tm4b_2e1779891f69b099b16616ae7ea2e76c'] = 'Crediti SMS:'; +$_MODULE['<{tm4b}prestashop>tm4b_00db7aae85aecb79c75afca7daa8f22e'] = 'Hai'; +$_MODULE['<{tm4b}prestashop>tm4b_928735d6f2c63bee316dd511c8ccaf55'] = 'crediti'; +$_MODULE['<{tm4b}prestashop>tm4b_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{tm4b}prestashop>tm4b_cac81c648846c9b8c3e6085a45782c7e'] = 'Nome utente:'; +$_MODULE['<{tm4b}prestashop>tm4b_b341a59d5636ed3d6a819137495b08a0'] = 'Password:'; +$_MODULE['<{tm4b}prestashop>tm4b_6c47d739c79e0f93ec0cd90663a68ebf'] = 'Relay:'; +$_MODULE['<{tm4b}prestashop>tm4b_43e7396afc9f4633157a47bf5f5af96c'] = 'N. di telefono del mittente dell\'SMS '; +$_MODULE['<{tm4b}prestashop>tm4b_1ee1c44c2dc81681f961235604247b81'] = 'Modalità:'; +$_MODULE['<{tm4b}prestashop>tm4b_4f502b57d2835715eaa382c7d4c32e94'] = 'Simulazione'; +$_MODULE['<{tm4b}prestashop>tm4b_756d97bb256b8580d4d71ee0c547804e'] = 'Produzione'; +$_MODULE['<{tm4b}prestashop>tm4b_ea24be6a78dd661afe60448e87b75065'] = 'Segnalazioni del nuovo ordine:'; +$_MODULE['<{tm4b}prestashop>tm4b_93cba07454f06a4a960172bbd6e2a435'] = 'Sì'; +$_MODULE['<{tm4b}prestashop>tm4b_7b357f8e4b60349aeba339f3032e4a84'] = 'Inviare SMS se viene fatto un nuovo ordine'; +$_MODULE['<{tm4b}prestashop>tm4b_ff914fecb4b37bd6edb2e4515ec1d4dc'] = 'Segnalazioni di quantità di prodotto:'; +$_MODULE['<{tm4b}prestashop>tm4b_2ed5f5c1670d557c67c958d1f230cb2c'] = 'Inviare SMS se lo stock di prodotto viene aggiornato'; +$_MODULE['<{tm4b}prestashop>tm4b_d0759ad8efa7234c0f9b919f9ec88c2b'] = 'Rapporto giornaliero:'; +$_MODULE['<{tm4b}prestashop>tm4b_a5d859ac85a50ed9d8b6d93be6abd217'] = 'Inviare una relazione quotidiana statistiche - È necessario impostare un CRON per'; +$_MODULE['<{tm4b}prestashop>tm4b_481bfc100d0a3590edb72f53679e310c'] = 'N. telefono ricevente SMS'; +$_MODULE['<{tm4b}prestashop>tm4b_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiorna le impostazioni'; +$_MODULE['<{tm4b}prestashop>tm4b_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{tm4b}prestashop>tm4b_b1a293b0efa4e1e7c35ef375c3cd7a44'] = 'Il nome utente è obbligatorio'; +$_MODULE['<{tm4b}prestashop>tm4b_8c194fef39e0d251494686926884733e'] = 'Password è obbligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_6ac6840e86a7b09bf9eb326228060981'] = 'Route è obbligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_486493b98a473ebb777dd86bbf264e06'] = 'L\'origine è obbligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_30c94c563402b0a87e4b5411518ab542'] = 'Modalità è obbligatoria'; +$_MODULE['<{tm4b}prestashop>tm4b_aea21c9ea4f10d22071eb479eee918c3'] = 'Si prega di inserire un numero di telefono'; +$_MODULE['<{tm4b}prestashop>tm4b_713569f69019a591adfda481f6668a06'] = 'Numero di telefono non valido'; +$_MODULE['<{tm4b}prestashop>tm4b_8394f2c720f3798ff8ef93fe7e331866'] = 'Ordini:'; +$_MODULE['<{tm4b}prestashop>tm4b_ec3e48bb9aa902ba2ad608547fdcbfdc'] = 'Vendite:'; +$_MODULE['<{tm4b}prestashop>tm4b_01411a97818b38fc6524d56590ca5a12'] = 'Mese:'; diff --git a/modules/tm4b/logo.gif b/modules/tm4b/logo.gif new file mode 100644 index 000000000..87a5f1fc6 Binary files /dev/null and b/modules/tm4b/logo.gif differ diff --git a/modules/tm4b/mails/de/sms_new_order.txt b/modules/tm4b/mails/de/sms_new_order.txt new file mode 100755 index 000000000..4eda1490d --- /dev/null +++ b/modules/tm4b/mails/de/sms_new_order.txt @@ -0,0 +1,5 @@ +{shop_name} +Kunde: {firstname} {lastname} +Bestellung: {order_name} +Zahlung: {payment} +Gesamt TI: ({total_paid} {currency}) diff --git a/modules/tm4b/mails/de/sms_out_of_stock.txt b/modules/tm4b/mails/de/sms_out_of_stock.txt new file mode 100755 index 000000000..f07afbabb --- /dev/null +++ b/modules/tm4b/mails/de/sms_out_of_stock.txt @@ -0,0 +1,5 @@ +{shop_name} +Dieser Artikel ist bald ausverkauft: +Ref.: {product_ref} +Id: {product_id} +Menge: {qty} \ No newline at end of file diff --git a/modules/tm4b/mails/en/sms_new_order.txt b/modules/tm4b/mails/en/sms_new_order.txt new file mode 100644 index 000000000..2e233bae5 --- /dev/null +++ b/modules/tm4b/mails/en/sms_new_order.txt @@ -0,0 +1,5 @@ +{shop_name} +Customer: {firstname} {lastname} +Order: {order_name} +Payment: {payment} +Total TI: ({total_paid} {currency}) diff --git a/modules/tm4b/mails/en/sms_out_of_stock.txt b/modules/tm4b/mails/en/sms_out_of_stock.txt new file mode 100644 index 000000000..b8c3c19df --- /dev/null +++ b/modules/tm4b/mails/en/sms_out_of_stock.txt @@ -0,0 +1,5 @@ +{shop_name} +This product is soon out of stock: +Ref: {product_ref} +Id: {product_id} +Qty: {qty} \ No newline at end of file diff --git a/modules/tm4b/mails/es/sms_new_order.txt b/modules/tm4b/mails/es/sms_new_order.txt new file mode 100644 index 000000000..e69de29bb diff --git a/modules/tm4b/mails/es/sms_out_of_stock.txt b/modules/tm4b/mails/es/sms_out_of_stock.txt new file mode 100644 index 000000000..f9a58e301 --- /dev/null +++ b/modules/tm4b/mails/es/sms_out_of_stock.txt @@ -0,0 +1,5 @@ +nombre de la tienda: {shop_name} +Este producto es poco fuera de stock: +Ref: {product_ref} +Id: {product_id} +Cantidad: {qty} \ No newline at end of file diff --git a/modules/tm4b/mails/fr/sms_new_order.txt b/modules/tm4b/mails/fr/sms_new_order.txt new file mode 100644 index 000000000..19fba1e30 --- /dev/null +++ b/modules/tm4b/mails/fr/sms_new_order.txt @@ -0,0 +1,5 @@ +{shop_name} +Client : {firstname} {lastname} +Commande : {order_name} +Mode de paiement : {payment} +Total TTC : ({total_paid} {currency}) diff --git a/modules/tm4b/mails/fr/sms_out_of_stock.txt b/modules/tm4b/mails/fr/sms_out_of_stock.txt new file mode 100644 index 000000000..d222e0682 --- /dev/null +++ b/modules/tm4b/mails/fr/sms_out_of_stock.txt @@ -0,0 +1,5 @@ +{shop_name} +Ce produit est bientot en rupture de stock : +Ref: {product_ref} +Id: {product_id} +Quantité: {qty} \ No newline at end of file diff --git a/modules/tm4b/mails/it/sms_new_order.txt b/modules/tm4b/mails/it/sms_new_order.txt new file mode 100755 index 000000000..18d7a1452 --- /dev/null +++ b/modules/tm4b/mails/it/sms_new_order.txt @@ -0,0 +1,5 @@ +{shop_name} +Cliente: {firstname} {lastname} +Ordine: {order_name} +Pagamento: {payment} +Totale TI: ({total_paid} {currency}) diff --git a/modules/tm4b/mails/it/sms_out_of_stock.txt b/modules/tm4b/mails/it/sms_out_of_stock.txt new file mode 100755 index 000000000..b81273f04 --- /dev/null +++ b/modules/tm4b/mails/it/sms_out_of_stock.txt @@ -0,0 +1,5 @@ +{shop_name} +Questo prodotto sarà presto non disponibile: +Rif: {product_ref} +Id: {product_id} +Qtà: {qty} \ No newline at end of file diff --git a/modules/tm4b/prefs.gif b/modules/tm4b/prefs.gif new file mode 100644 index 000000000..1a1f43562 Binary files /dev/null and b/modules/tm4b/prefs.gif differ diff --git a/modules/tm4b/tm4b.php b/modules/tm4b/tm4b.php new file mode 100644 index 000000000..f53bb5a7e --- /dev/null +++ b/modules/tm4b/tm4b.php @@ -0,0 +1,383 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class Tm4b extends Module +{ + private $_html = ''; + private $_postErrors = array(); + private $_postSucess; + + private $_data; + private $_password; + private $_user; + private $_originator; + private $_route; + private $_simulation; + private $_new_order_numbers; + + private $_alert_new_order_active; + private $_alert_update_quantity_active; + private $_daily_report_active; + + const __TM4B_LOWBALANCE__ = '20'; + const __TM4B_NUMBER_DELIMITOR__ = ','; + + static private $_tpl_sms_files = array( + 'name' => array( + 'new_orders' => 'sms_new_order', + 'out_of_stock' => 'sms_out_of_stock' + ), + 'ext' => array( + 'new_orders' => '.txt', + 'out_of_stock' => '.txt' + ) + ); + + public function __construct() + { + $this->name = 'tm4b'; + $this->displayName = 'SMS Tm4b'; + $this->description = $this->l('Sends an SMS for each new order'); + $this->tab = 'administration'; + $this->version = 1.1; + $this->author = 'PrestaShop'; + + parent::__construct(); + + if ($this->id) + { + $this->_data = array('shopname' => Configuration::get('PS_SHOP_NAME')); + + /* Get config vars */ + $this->_password = Configuration::get('TM4B_PASSWORD'); + $this->_user = Configuration::get('TM4B_USER'); + $this->_originator = Configuration::get('TM4B_ORIGINATOR'); + $this->_route = Configuration::get('TM4B_ROUTE'); + $this->_simulation = Configuration::get('TM4B_SIM'); + $this->_new_order_numbers = Configuration::get('TM4B_NEW_ORDER_NUMBERS'); + + $this->_alert_new_order_active = Configuration::get('TM4B_ALERT_NO_ACTIVE'); + $this->_alert_update_quantity_active = Configuration::get('TM4B_ALERT_UQ_ACTIVE'); + $this->_daily_report_active = Configuration::get('TM4B_DAILY_REPORT_ACTIVE'); + } + + $this->displayName = 'SMS Tm4b'; + $this->description = $this->l('Sends an SMS for each new order'); + $this->confirmUninstall = $this->l('Are you sure you want to delete your info?'); + } + + public function install() + { + if (!parent::install() OR + !$this->registerHook('newOrder') OR + !$this->registerHook('updateQuantity')) + return false; + + Configuration::updateValue('TM4B_SIM', 1); + Configuration::updateValue('TM4B_ALERT_NO_ACTIVE', 1); + Configuration::updateValue('TM4B_ALERT_UQ_ACTIVE', 1); + Configuration::updateValue('TM4B_DAILY_REPORT_ACTIVE', 0); + return true; + } + + public function uninstall() + { + Configuration::deleteByName('TM4B_PASSWORD'); + Configuration::deleteByName('TM4B_USER'); + Configuration::deleteByName('TM4B_ORIGINATOR'); + Configuration::deleteByName('TM4B_ROUTE'); + Configuration::deleteByName('TM4B_SIM'); + Configuration::deleteByName('TM4B_NEW_ORDER_NUMBERS'); + Configuration::deleteByName('TM4B_ALERT_NO_ACTIVE'); + Configuration::deleteByName('TM4B_ALERT_UQ_ACTIVE'); + Configuration::deleteByName('TM4B_DAILY_REPORT_ACTIVE'); + Configuration::deleteByName('TM4B_LAST_REPORT'); + + return parent::uninstall(); + } + + private function _getTplBody($tpl_file, $vars = array()) + { + $iso = Language::getIsoById((int)(Configuration::get('PS_LANG_DEFAULT'))); + $file = dirname(__FILE__).'/mails/'.$iso.'/'.$tpl_file; + if (!file_exists($file)) + die($file); + $tpl = file($file); + $template = str_replace(array_keys($vars), array_values($vars), $tpl); + return (implode("\n", $template)); + } + + public function hookNewOrder($params) + { + include_once (dirname(__FILE__).'/classes/Tm4bSms.php'); + + if ( !(int)($this->_alert_new_order_active) OR empty($this->_user) OR empty($this->_password) + OR empty($this->_new_order_numbers)) + return ; + $order = $params['order']; + $customer = $params['customer']; + $currency = $params['currency']; + + $templateVars = array( + '{firstname}' => utf8_decode($customer->firstname), + '{lastname}' => utf8_decode($customer->lastname), + '{order_name}' => sprintf("%06d", $order->id), + '{shop_name}' => Configuration::get('PS_SHOP_NAME'), + '{payment}' => $order->payment, + '{total_paid}' => $order->total_paid, + '{currency}' => $currency->sign); + + $body = $this->_getTplBody(self::$_tpl_sms_files['name']['new_orders'].self::$_tpl_sms_files['ext']['new_orders'], $templateVars); + + $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator); + $sms->msg = $body; + $numbers = explode(self::__TM4B_NUMBER_DELIMITOR__, $this->_new_order_numbers); + foreach ($numbers as $number) + if ($number != '') + $sms->addRecipient($number); + $sms->Send($this->_simulation); + } + + public function hookUpdateQuantity($params) + { + if (!(int)($this->_alert_update_quantity_active) OR empty($this->_new_order_numbers)) + return ; + + $product = $params['product']; + $order = $params['order']; + + $qty = (int)($params['product']['quantity_attribute'] ? $params['product']['quantity_attribute'] : $params['product']['stock_quantity']) - (int)($params['product']['quantity']); + if ($qty <= (int)(Configuration::get('PS_LAST_QTIES'))) + { + $templateVars = array( + '{last_qty}' => (int)(Configuration::get('PS_LAST_QTIES')), + '{qty}' => $qty, + '{product}' => strval($params['product']['name'])); + + $body = $this->_getTplBody(self::$_tpl_sms_files['name']['out_of_stock'].self::$_tpl_sms_files['ext']['out_of_stock'], $templateVars); + } + + if (!empty($body)) + { + $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator); + $sms->msg = $body; + $numbers = explode(self::__TM4B_NUMBER_DELIMITOR__, $this->_new_order_numbers); + foreach ($numbers as $number) + if ($number != '') + $sms->addRecipient($number); + $sms->Send($this->_simulation); + } + } + + public function getContent() + { + include_once (dirname(__FILE__).'/classes/Tm4bSms.php'); + $this->_html = '

        '.$this->displayName.'

        '; + + if (!empty($_POST)) + { + if (isset($_POST['btnTestSms'])) + { + if (!empty($this->_user) AND !empty($this->_password) AND !empty($_POST['test_number']) AND is_numeric($_POST['test_number'])) + { + $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator); + $sms->msg = 'Test SMS for your PrestaShop website'; + $sms->addRecipient($_POST['test_number']); + $ret = $sms->Send($this->_simulation); + if ($sms->isSent()) + $this->_html .= $this->displayConfirmation($this->l('Message sent')); + else + $this->_html .= $this->displayError($this->l('Error while sending message')); + } + else + $this->_html .= $this->displayError($this->l('Login and phone number')); + } + else + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + foreach ($this->_postErrors AS $err) + $this->_html .= $this->displayError($err); + } + } + + $this->_displayTm4b(); + $this->_displayForm(); + + return $this->_html; + } + + private function _displayTm4b() + { + include_once (dirname(__FILE__).'/classes/Tm4bSms.php'); + + $testsms_txt = 'Send'; + + $this->_html .= ' +
        '.$this->l('Information').' +
        + +
        +
        '.$this->l('ex: 33642424242').'
        '; + if (!empty($this->_user) AND !empty($this->_password)) + { + $sms = new Tm4bSms($this->_user, $this->_password, $this->_route, $this->_originator); + $credits = $sms->CheckCredits(); + $color = ($credits < self::__TM4B_LOWBALANCE__ ? '#900' : '#080'); + $this->_html .= ' +
        '.$this->l('You have').' '.$credits.' '.$this->l('credits').'
        '; + } + $this->_html .= ' +
        +

        '; + } + + private function _displayForm() + { + if (!isset($_POST['btnSubmit'])) + { + if ($this->_user) + { + $_POST['user'] = $this->_user; + $_POST['password'] = $this->_password; + $_POST['route'] = $this->_route; + $_POST['originator'] = $this->_originator; + $_POST['simulation'] = $this->_simulation; + $_POST['new_order_numbers'] = str_replace(self::__TM4B_NUMBER_DELIMITOR__, "\n", $this->_new_order_numbers); + $_POST['alert_new_order'] = $this->_alert_new_order_active; + $_POST['alert_update_quantity'] = $this->_alert_update_quantity_active; + $_POST['daily_report'] = $this->_daily_report_active; + } + } + + $this->_html .= '
        '.$this->l('Settings').' +
        + +
        + +
        + +
        + +

        '.$this->l('ex: 33642424242').'
        + +
        '.$this->l('Simulation').' +   '.$this->l('Production').'
        +
        + +
         '.$this->l('Yes').'
        '.$this->l('Send SMS if a new order is made').'
        + +
         '.$this->l('Yes').'
        '.$this->l('Send SMS if the stock of product is updated').'
        + +
         '.$this->l('Yes').'
        '.$this->l('Send a daily stats report - You must set a CRON to').' /modules/tm4b/cron.php
        +
        + +

        '.$this->l('ex: 33642424242').'
        +
        +
        +
        '; + } + + private function _postProcess() + { + Configuration::updateValue('TM4B_PASSWORD', $_POST['password']); + Configuration::updateValue('TM4B_USER', $_POST['user']); + Configuration::updateValue('TM4B_ORIGINATOR', $_POST['originator']); + Configuration::updateValue('TM4B_ROUTE', $_POST['route']); + Configuration::updateValue('TM4B_SIM', $_POST['simulation']); + Configuration::updateValue('TM4B_ALERT_NO_ACTIVE', isset($_POST['alert_new_order']) ? 1 : 0); + Configuration::updateValue('TM4B_ALERT_UQ_ACTIVE', isset($_POST['alert_update_quantity']) ? 1 : 0); + Configuration::updateValue('TM4B_DAILY_REPORT_ACTIVE', isset($_POST['daily_report']) ? 1 : 0); + + $numbers = explode("\n", $_POST['new_order_numbers']); + $this->_new_order_numbers = ''; + foreach ($numbers as $number) + { + if (preg_match("/([0-9]+)/", $number, $regs)) + $this->_new_order_numbers .= $regs[1].self::__TM4B_NUMBER_DELIMITOR__; + } + Configuration::updateValue('TM4B_NEW_ORDER_NUMBERS', $this->_new_order_numbers); + $this->_html .= $this->displayConfirmation($this->l('Settings updated')); + } + + private function _postValidation() + { + if (empty($_POST['user'])) + $this->_postErrors[] = $this->l('Username is mandatory'); + elseif (empty($_POST['password'])) + $this->_postErrors[] = $this->l('Password is mandatory'); + elseif (empty($_POST['route']) OR ($_POST['route'] != 'GD01' AND $_POST['route'] != 'GD02' AND $_POST['route'] != 'USS1')) + $this->_postErrors[] = $this->l('Route is mandatory'); + elseif (empty($_POST['originator'])) + $this->_postErrors[] = $this->l('Origin is mandatory'); + elseif (!isset($_POST['simulation']) OR ($_POST['simulation'] != 0 AND $_POST['simulation'] != 1)) + $this->_postErrors[] = $this->l('Mode is mandatory'); + elseif (empty($_POST['new_order_numbers'])) + $this->_postErrors[] = $this->l('Please enter a phone number'); + elseif (preg_match('/([^0-9[:space:],])/', $_POST['new_order_numbers'], $regs)) + $this->_postErrors[] = $this->l('Phone number invalid'); + } + + public function getStatsBody() + { + $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + $currency->sign = $currency->iso_code; + $query = ' + SELECT SUM(o.`total_paid_real`) as total_sales, COUNT(o.`total_paid_real`) as total_orders + FROM `'._DB_PREFIX_.'orders` o + WHERE ( + SELECT IF(os.`id_order_state` = 8, 0, 1) + FROM `'._DB_PREFIX_.'orders` oo + LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON oh.`id_order` = oo.`id_order` + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON os.`id_order_state` = oh.`id_order_state` + WHERE oo.`id_order` = o.`id_order` + ORDER BY oh.`date_add` DESC, oh.`id_order_history` DESC + LIMIT 1 + ) = 1 '; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query.' + AND o.`date_add` >= DATE_SUB(\''.date('Y-m-d').' 20:00:00\', INTERVAL 1 DAY) + AND o.`date_add` < \''.date('Y-m-d').' 20:00:00\''); + $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query.'AND o.`date_add` LIKE \''.date('Y-m').'-%\''); + + return date('Y-m-d')."\n". + $this->l('Orders:').' '.(int)($result['total_orders'])."\n". + $this->l('Sales:').' '.Tools::displayPrice($result['total_sales'], $currency, true)."\n". + '('.$this->l('Month:').' '.Tools::displayPrice($result2['total_sales'], $currency, true).')'; + } +} + + diff --git a/modules/trackingfront/account.tpl b/modules/trackingfront/account.tpl new file mode 100644 index 000000000..00d0c9e70 --- /dev/null +++ b/modules/trackingfront/account.tpl @@ -0,0 +1,70 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        +
        {l s='Affiliation space' mod='trackingfront'}
        + +
        +
        +
        +
        + + + +

        {l s='From:' mod='trackingfront'}

        +

        {l s='To:' mod='trackingfront'}

        + +
        +
        +
        +
        {$referrer->name} + {foreach from=$displayTab key=data item=label} +
        {$label}
        + {/foreach} +
        +
        +
        + {* + + + + + + + + + + + + + + + + + + +
        {l s='ID' mod='trackingfront'}{l s='Name' mod='trackingfront'}{l s='Visitors' mod='trackingfront'}{l s='Visits' mod='trackingfront'}{l s='Pages' mod='trackingfront'}{l s='Reg.' mod='trackingfront'}{l s='Ord.' mod='trackingfront'}{l s='Sales' mod='trackingfront'}{l s='Cart' mod='trackingfront'}{l s='Reg. rate' mod='trackingfront'}{l s='Ord. rate' mod='trackingfront'}{l s='Click' mod='trackingfront'}{l s='¤' mod='trackingfront'}{l s='%' mod='trackingfront'}
        + *} \ No newline at end of file diff --git a/modules/trackingfront/config.xml b/modules/trackingfront/config.xml new file mode 100755 index 000000000..b750241d8 --- /dev/null +++ b/modules/trackingfront/config.xml @@ -0,0 +1,11 @@ + + + trackingfront + Tracking - Front office + 1 + Enable your affiliates to access their own statistics. + PrestaShop + shipping_logistics + 0 + 1 + \ No newline at end of file diff --git a/modules/trackingfront/de.php b/modules/trackingfront/de.php new file mode 100644 index 000000000..86818100f --- /dev/null +++ b/modules/trackingfront/de.php @@ -0,0 +1,51 @@ +account_8954e140059f7b2544469f40161ba507'] = 'Mitgliederbereich'; +$_MODULE['<{trackingfront}prestashop>account_0323de4f66a1700e2173e9bcdce02715'] = 'Abmelden'; +$_MODULE['<{trackingfront}prestashop>account_1dd1c5fb7f25cd41b291d43a89e3aefd'] = 'Heute'; +$_MODULE['<{trackingfront}prestashop>account_7cbb885aa1164b390a0bc050a64e1812'] = 'Monat'; +$_MODULE['<{trackingfront}prestashop>account_537c66b24ef5c83b7382cdc3f34885f2'] = 'Jahr'; +$_MODULE['<{trackingfront}prestashop>account_1e6d57e813355689e9c77e947d73ad8f'] = 'Von:'; +$_MODULE['<{trackingfront}prestashop>account_33caa076f23f453dd4061726f3706325'] = 'An:'; +$_MODULE['<{trackingfront}prestashop>account_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{trackingfront}prestashop>account_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{trackingfront}prestashop>account_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher'; +$_MODULE['<{trackingfront}prestashop>account_d7e637a6e9ff116de2fa89551240a94d'] = 'Besuche'; +$_MODULE['<{trackingfront}prestashop>account_453aceb005ceaf54a47da15fee8b2a26'] = 'Seiten'; +$_MODULE['<{trackingfront}prestashop>account_591411cc8927851db2002208676d8330'] = 'Reg.'; +$_MODULE['<{trackingfront}prestashop>account_a9841e29f2c8180709b16cd2a13c55fe'] = 'Best.'; +$_MODULE['<{trackingfront}prestashop>account_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{trackingfront}prestashop>account_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb'; +$_MODULE['<{trackingfront}prestashop>account_43005b13d452a4ad6f2d8e29b499c55a'] = 'Reg.-Rate'; +$_MODULE['<{trackingfront}prestashop>account_e14c8640d236365d11a060832b219a11'] = 'Best.-Rate'; +$_MODULE['<{trackingfront}prestashop>account_316853cc3718335f11c048e33b9be98a'] = 'Klicken Sie auf'; +$_MODULE['<{trackingfront}prestashop>account_b450fdef2453e92c31263a70f14fbd7b'] = '¤'; +$_MODULE['<{trackingfront}prestashop>account_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{trackingfront}prestashop>header_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Mitgliedschaft'; +$_MODULE['<{trackingfront}prestashop>login_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Mitgliedschaft'; +$_MODULE['<{trackingfront}prestashop>login_8954e140059f7b2544469f40161ba507'] = 'Mitgliederbereich'; +$_MODULE['<{trackingfront}prestashop>login_99dea78007133396a7b8ed70578ac6ae'] = 'Anmelden'; +$_MODULE['<{trackingfront}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{trackingfront}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Anmelden'; +$_MODULE['<{trackingfront}prestashop>trackingfront_e8a827db4eca37d2c6cdef8e406f6fa9'] = 'Tracking - Front Office'; +$_MODULE['<{trackingfront}prestashop>trackingfront_68d4e1b474858937b300e27273283f41'] = 'Ermöglichen Sie Ihren Mitgliedern, auf ihre eigenen Statistiken zugreifen.'; +$_MODULE['<{trackingfront}prestashop>trackingfront_8f5ac7793b2547cd025a7335f4934d26'] = 'Anmeldung ist erforderlich '; +$_MODULE['<{trackingfront}prestashop>trackingfront_6f658a5bbec855ca5ae4ef4c94eb5d43'] = 'ungültige Anmeldung'; +$_MODULE['<{trackingfront}prestashop>trackingfront_962c91be4b1056412febf0c272760814'] = 'Kennwort ist erforderlich'; +$_MODULE['<{trackingfront}prestashop>trackingfront_703c2b69e5d9f7072b7db5338214448b'] = 'ungültiges Kennwort'; +$_MODULE['<{trackingfront}prestashop>trackingfront_c41c77e4dddc04b1e0752a6050ae5656'] = 'Authentifizierung fehlgeschlagen'; +$_MODULE['<{trackingfront}prestashop>trackingfront_10965b2740f42ad4887932c35cee26ab'] = 'Einmalige Besucher'; +$_MODULE['<{trackingfront}prestashop>trackingfront_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d7e637a6e9ff116de2fa89551240a94d'] = 'Besuche'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d3139f39f1ad6324c80a9ddd50cc7867'] = 'Setenaufrufe'; +$_MODULE['<{trackingfront}prestashop>trackingfront_a28735af01fbb1e35371cb120985ac47'] = 'Anmeldungen'; +$_MODULE['<{trackingfront}prestashop>trackingfront_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Bestellungen'; +$_MODULE['<{trackingfront}prestashop>trackingfront_2e27c4006a026eacfc1f85b41bf9bc4c'] = 'Grundgebühr'; +$_MODULE['<{trackingfront}prestashop>trackingfront_86190054fc32554662ffbb12b717e8d0'] = 'Prozent-Gebühr'; +$_MODULE['<{trackingfront}prestashop>trackingfront_51d53cd2ecdae6b5dd3397875197e898'] = 'Klick-Gebühr'; +$_MODULE['<{trackingfront}prestashop>trackingfront_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Verkäufe'; +$_MODULE['<{trackingfront}prestashop>trackingfront_da9cb586c6689202ca65cd77fd9b84ef'] = 'Durchschnittlicher Warenkorb'; +$_MODULE['<{trackingfront}prestashop>trackingfront_200f5c9c419f0a53d5d361eff7b33abc'] = 'Anmeldungsrate'; +$_MODULE['<{trackingfront}prestashop>trackingfront_89741aae300253f498b0993fa678fa18'] = 'Bestellrate'; diff --git a/modules/trackingfront/en.php b/modules/trackingfront/en.php new file mode 100644 index 000000000..601358d4f --- /dev/null +++ b/modules/trackingfront/en.php @@ -0,0 +1,4 @@ +account_8954e140059f7b2544469f40161ba507'] = 'espacio afiliados'; +$_MODULE['<{trackingfront}prestashop>account_0323de4f66a1700e2173e9bcdce02715'] = 'Identificarse'; +$_MODULE['<{trackingfront}prestashop>account_1dd1c5fb7f25cd41b291d43a89e3aefd'] = 'Hoy'; +$_MODULE['<{trackingfront}prestashop>account_7cbb885aa1164b390a0bc050a64e1812'] = 'Mes'; +$_MODULE['<{trackingfront}prestashop>account_537c66b24ef5c83b7382cdc3f34885f2'] = 'Año'; +$_MODULE['<{trackingfront}prestashop>account_1e6d57e813355689e9c77e947d73ad8f'] = 'De: '; +$_MODULE['<{trackingfront}prestashop>account_33caa076f23f453dd4061726f3706325'] = 'a:'; +$_MODULE['<{trackingfront}prestashop>account_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{trackingfront}prestashop>account_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{trackingfront}prestashop>account_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes'; +$_MODULE['<{trackingfront}prestashop>account_d7e637a6e9ff116de2fa89551240a94d'] = 'Visitas'; +$_MODULE['<{trackingfront}prestashop>account_453aceb005ceaf54a47da15fee8b2a26'] = 'Páginas'; +$_MODULE['<{trackingfront}prestashop>account_591411cc8927851db2002208676d8330'] = 'Reg.'; +$_MODULE['<{trackingfront}prestashop>account_a9841e29f2c8180709b16cd2a13c55fe'] = 'Pedido'; +$_MODULE['<{trackingfront}prestashop>account_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventas'; +$_MODULE['<{trackingfront}prestashop>account_a85eba4c6c699122b2bb1387ea4813ad'] = 'carrito'; +$_MODULE['<{trackingfront}prestashop>account_43005b13d452a4ad6f2d8e29b499c55a'] = 'evolución Reg.'; +$_MODULE['<{trackingfront}prestashop>account_e14c8640d236365d11a060832b219a11'] = 'pedido Reg.'; +$_MODULE['<{trackingfront}prestashop>account_316853cc3718335f11c048e33b9be98a'] = 'clic'; +$_MODULE['<{trackingfront}prestashop>account_b450fdef2453e92c31263a70f14fbd7b'] = '¤'; +$_MODULE['<{trackingfront}prestashop>account_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{trackingfront}prestashop>header_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Afiliación'; +$_MODULE['<{trackingfront}prestashop>login_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Afiliación'; +$_MODULE['<{trackingfront}prestashop>login_8954e140059f7b2544469f40161ba507'] = 'Espacio afiliación'; +$_MODULE['<{trackingfront}prestashop>login_99dea78007133396a7b8ed70578ac6ae'] = 'Login'; +$_MODULE['<{trackingfront}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{trackingfront}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Log in'; +$_MODULE['<{trackingfront}prestashop>trackingfront_e8a827db4eca37d2c6cdef8e406f6fa9'] = 'Tracking-Front office'; +$_MODULE['<{trackingfront}prestashop>trackingfront_68d4e1b474858937b300e27273283f41'] = 'Permitir a sus afiliados a tener acceso a sus estadísticas.'; +$_MODULE['<{trackingfront}prestashop>trackingfront_8f5ac7793b2547cd025a7335f4934d26'] = 'El login es necesario'; +$_MODULE['<{trackingfront}prestashop>trackingfront_6f658a5bbec855ca5ae4ef4c94eb5d43'] = 'login no válido'; +$_MODULE['<{trackingfront}prestashop>trackingfront_962c91be4b1056412febf0c272760814'] = 'se necesita una contraseña'; +$_MODULE['<{trackingfront}prestashop>trackingfront_703c2b69e5d9f7072b7db5338214448b'] = 'contraseña no válida'; +$_MODULE['<{trackingfront}prestashop>trackingfront_c41c77e4dddc04b1e0752a6050ae5656'] = 'autentificación errónea'; +$_MODULE['<{trackingfront}prestashop>trackingfront_10965b2740f42ad4887932c35cee26ab'] = 'Visitantes únicos'; +$_MODULE['<{trackingfront}prestashop>trackingfront_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d7e637a6e9ff116de2fa89551240a94d'] = 'Visitas'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d3139f39f1ad6324c80a9ddd50cc7867'] = 'Páginas vistas'; +$_MODULE['<{trackingfront}prestashop>trackingfront_a28735af01fbb1e35371cb120985ac47'] = 'Registros'; +$_MODULE['<{trackingfront}prestashop>trackingfront_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Pedidos'; +$_MODULE['<{trackingfront}prestashop>trackingfront_2e27c4006a026eacfc1f85b41bf9bc4c'] = 'Comisión de base'; +$_MODULE['<{trackingfront}prestashop>trackingfront_86190054fc32554662ffbb12b717e8d0'] = 'Comisión en porcentaje'; +$_MODULE['<{trackingfront}prestashop>trackingfront_51d53cd2ecdae6b5dd3397875197e898'] = 'Comisión por clic'; +$_MODULE['<{trackingfront}prestashop>trackingfront_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventas'; +$_MODULE['<{trackingfront}prestashop>trackingfront_da9cb586c6689202ca65cd77fd9b84ef'] = 'Carrito medio'; +$_MODULE['<{trackingfront}prestashop>trackingfront_200f5c9c419f0a53d5d361eff7b33abc'] = 'Evolución de registros'; +$_MODULE['<{trackingfront}prestashop>trackingfront_89741aae300253f498b0993fa678fa18'] = 'Evolución pedidos'; diff --git a/modules/trackingfront/footer.tpl b/modules/trackingfront/footer.tpl new file mode 100644 index 000000000..eff04a17d --- /dev/null +++ b/modules/trackingfront/footer.tpl @@ -0,0 +1,28 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + \ No newline at end of file diff --git a/modules/trackingfront/fr.php b/modules/trackingfront/fr.php new file mode 100644 index 000000000..348717da5 --- /dev/null +++ b/modules/trackingfront/fr.php @@ -0,0 +1,51 @@ +account_8954e140059f7b2544469f40161ba507'] = 'Espace affilié'; +$_MODULE['<{trackingfront}prestashop>account_0323de4f66a1700e2173e9bcdce02715'] = 'Déconnexion'; +$_MODULE['<{trackingfront}prestashop>account_1dd1c5fb7f25cd41b291d43a89e3aefd'] = 'Aujourd\'hui'; +$_MODULE['<{trackingfront}prestashop>account_7cbb885aa1164b390a0bc050a64e1812'] = 'Mois'; +$_MODULE['<{trackingfront}prestashop>account_537c66b24ef5c83b7382cdc3f34885f2'] = 'Année'; +$_MODULE['<{trackingfront}prestashop>account_1e6d57e813355689e9c77e947d73ad8f'] = 'Du'; +$_MODULE['<{trackingfront}prestashop>account_33caa076f23f453dd4061726f3706325'] = 'au'; +$_MODULE['<{trackingfront}prestashop>account_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{trackingfront}prestashop>account_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{trackingfront}prestashop>account_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs'; +$_MODULE['<{trackingfront}prestashop>account_d7e637a6e9ff116de2fa89551240a94d'] = 'Visites'; +$_MODULE['<{trackingfront}prestashop>account_453aceb005ceaf54a47da15fee8b2a26'] = 'Pages vues'; +$_MODULE['<{trackingfront}prestashop>account_591411cc8927851db2002208676d8330'] = 'Inscriptions'; +$_MODULE['<{trackingfront}prestashop>account_a9841e29f2c8180709b16cd2a13c55fe'] = 'Com.'; +$_MODULE['<{trackingfront}prestashop>account_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventes'; +$_MODULE['<{trackingfront}prestashop>account_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; +$_MODULE['<{trackingfront}prestashop>account_43005b13d452a4ad6f2d8e29b499c55a'] = 'Tx insc.'; +$_MODULE['<{trackingfront}prestashop>account_e14c8640d236365d11a060832b219a11'] = 'Tx com.'; +$_MODULE['<{trackingfront}prestashop>account_316853cc3718335f11c048e33b9be98a'] = 'Clics'; +$_MODULE['<{trackingfront}prestashop>account_b450fdef2453e92c31263a70f14fbd7b'] = '¤'; +$_MODULE['<{trackingfront}prestashop>account_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{trackingfront}prestashop>header_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Affiliation'; +$_MODULE['<{trackingfront}prestashop>login_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Affiliation'; +$_MODULE['<{trackingfront}prestashop>login_8954e140059f7b2544469f40161ba507'] = 'Espace affilié'; +$_MODULE['<{trackingfront}prestashop>login_99dea78007133396a7b8ed70578ac6ae'] = 'Identifiant'; +$_MODULE['<{trackingfront}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{trackingfront}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Connexion'; +$_MODULE['<{trackingfront}prestashop>trackingfront_e8a827db4eca37d2c6cdef8e406f6fa9'] = 'Affiliation - Accès boutique'; +$_MODULE['<{trackingfront}prestashop>trackingfront_68d4e1b474858937b300e27273283f41'] = 'Permet aux affiliés de consulter leurs statistiques'; +$_MODULE['<{trackingfront}prestashop>trackingfront_8f5ac7793b2547cd025a7335f4934d26'] = 'identifiant requis'; +$_MODULE['<{trackingfront}prestashop>trackingfront_6f658a5bbec855ca5ae4ef4c94eb5d43'] = 'identifiant invalide'; +$_MODULE['<{trackingfront}prestashop>trackingfront_962c91be4b1056412febf0c272760814'] = 'mot de passe requis'; +$_MODULE['<{trackingfront}prestashop>trackingfront_703c2b69e5d9f7072b7db5338214448b'] = 'mot de passe invalide'; +$_MODULE['<{trackingfront}prestashop>trackingfront_c41c77e4dddc04b1e0752a6050ae5656'] = 'identifiation échouée'; +$_MODULE['<{trackingfront}prestashop>trackingfront_10965b2740f42ad4887932c35cee26ab'] = 'Visiteurs uniques'; +$_MODULE['<{trackingfront}prestashop>trackingfront_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d7e637a6e9ff116de2fa89551240a94d'] = 'Visites'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d3139f39f1ad6324c80a9ddd50cc7867'] = 'Pages vues'; +$_MODULE['<{trackingfront}prestashop>trackingfront_a28735af01fbb1e35371cb120985ac47'] = 'Inscriptions'; +$_MODULE['<{trackingfront}prestashop>trackingfront_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Commandes'; +$_MODULE['<{trackingfront}prestashop>trackingfront_2e27c4006a026eacfc1f85b41bf9bc4c'] = 'Commission €'; +$_MODULE['<{trackingfront}prestashop>trackingfront_86190054fc32554662ffbb12b717e8d0'] = 'Commission %'; +$_MODULE['<{trackingfront}prestashop>trackingfront_51d53cd2ecdae6b5dd3397875197e898'] = 'Commission au clic'; +$_MODULE['<{trackingfront}prestashop>trackingfront_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventes'; +$_MODULE['<{trackingfront}prestashop>trackingfront_da9cb586c6689202ca65cd77fd9b84ef'] = 'Panier moyen'; +$_MODULE['<{trackingfront}prestashop>trackingfront_200f5c9c419f0a53d5d361eff7b33abc'] = 'Taux d\'inscription'; +$_MODULE['<{trackingfront}prestashop>trackingfront_89741aae300253f498b0993fa678fa18'] = 'Taux de commandes'; diff --git a/modules/trackingfront/header.tpl b/modules/trackingfront/header.tpl new file mode 100644 index 000000000..4f6ddb4fe --- /dev/null +++ b/modules/trackingfront/header.tpl @@ -0,0 +1,36 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + PrestaShop™ - {l s='Affiliation' mod='trackingfront'} + + + + + \ No newline at end of file diff --git a/modules/trackingfront/it.php b/modules/trackingfront/it.php new file mode 100644 index 000000000..7d7e7b184 --- /dev/null +++ b/modules/trackingfront/it.php @@ -0,0 +1,51 @@ +account_8954e140059f7b2544469f40161ba507'] = 'Spazio affiliazione'; +$_MODULE['<{trackingfront}prestashop>account_0323de4f66a1700e2173e9bcdce02715'] = 'Logout'; +$_MODULE['<{trackingfront}prestashop>account_1dd1c5fb7f25cd41b291d43a89e3aefd'] = 'Oggi'; +$_MODULE['<{trackingfront}prestashop>account_7cbb885aa1164b390a0bc050a64e1812'] = 'Mese'; +$_MODULE['<{trackingfront}prestashop>account_537c66b24ef5c83b7382cdc3f34885f2'] = 'Anno'; +$_MODULE['<{trackingfront}prestashop>account_1e6d57e813355689e9c77e947d73ad8f'] = 'Da:'; +$_MODULE['<{trackingfront}prestashop>account_33caa076f23f453dd4061726f3706325'] = 'A:'; +$_MODULE['<{trackingfront}prestashop>account_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{trackingfront}prestashop>account_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{trackingfront}prestashop>account_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori'; +$_MODULE['<{trackingfront}prestashop>account_d7e637a6e9ff116de2fa89551240a94d'] = 'Visite'; +$_MODULE['<{trackingfront}prestashop>account_453aceb005ceaf54a47da15fee8b2a26'] = 'Pagine'; +$_MODULE['<{trackingfront}prestashop>account_591411cc8927851db2002208676d8330'] = 'Reg.'; +$_MODULE['<{trackingfront}prestashop>account_a9841e29f2c8180709b16cd2a13c55fe'] = 'Ord.'; +$_MODULE['<{trackingfront}prestashop>account_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{trackingfront}prestashop>account_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello'; +$_MODULE['<{trackingfront}prestashop>account_43005b13d452a4ad6f2d8e29b499c55a'] = 'Tasso di reg.'; +$_MODULE['<{trackingfront}prestashop>account_e14c8640d236365d11a060832b219a11'] = 'Tasso di ord.'; +$_MODULE['<{trackingfront}prestashop>account_316853cc3718335f11c048e33b9be98a'] = 'Fare clic su'; +$_MODULE['<{trackingfront}prestashop>account_b450fdef2453e92c31263a70f14fbd7b'] = '¤'; +$_MODULE['<{trackingfront}prestashop>account_0bcef9c45bd8a48eda1b26eb0c61c869'] = '%'; +$_MODULE['<{trackingfront}prestashop>header_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Affiliazione'; +$_MODULE['<{trackingfront}prestashop>login_bf15e68d25d8a2b7664950ba7385ed0a'] = 'Affiliazione'; +$_MODULE['<{trackingfront}prestashop>login_8954e140059f7b2544469f40161ba507'] = 'Spazio affiliazione'; +$_MODULE['<{trackingfront}prestashop>login_99dea78007133396a7b8ed70578ac6ae'] = 'Login'; +$_MODULE['<{trackingfront}prestashop>login_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{trackingfront}prestashop>login_bffe9a3c9a7e00ba00a11749e022d911'] = 'Entra'; +$_MODULE['<{trackingfront}prestashop>trackingfront_e8a827db4eca37d2c6cdef8e406f6fa9'] = 'Tracking - Front office'; +$_MODULE['<{trackingfront}prestashop>trackingfront_68d4e1b474858937b300e27273283f41'] = 'Permetti ai tuoi affiliati di accedere alle proprie statistiche.'; +$_MODULE['<{trackingfront}prestashop>trackingfront_8f5ac7793b2547cd025a7335f4934d26'] = 'È richiesto il login'; +$_MODULE['<{trackingfront}prestashop>trackingfront_6f658a5bbec855ca5ae4ef4c94eb5d43'] = 'accesso non valido'; +$_MODULE['<{trackingfront}prestashop>trackingfront_962c91be4b1056412febf0c272760814'] = 'è richiesta la password'; +$_MODULE['<{trackingfront}prestashop>trackingfront_703c2b69e5d9f7072b7db5338214448b'] = 'password non valida'; +$_MODULE['<{trackingfront}prestashop>trackingfront_c41c77e4dddc04b1e0752a6050ae5656'] = 'autenticazione fallita'; +$_MODULE['<{trackingfront}prestashop>trackingfront_10965b2740f42ad4887932c35cee26ab'] = 'Visitatori unici'; +$_MODULE['<{trackingfront}prestashop>trackingfront_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d7e637a6e9ff116de2fa89551240a94d'] = 'Visite'; +$_MODULE['<{trackingfront}prestashop>trackingfront_d3139f39f1ad6324c80a9ddd50cc7867'] = 'Pagine viste'; +$_MODULE['<{trackingfront}prestashop>trackingfront_a28735af01fbb1e35371cb120985ac47'] = 'Registrazioni'; +$_MODULE['<{trackingfront}prestashop>trackingfront_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Ordini'; +$_MODULE['<{trackingfront}prestashop>trackingfront_2e27c4006a026eacfc1f85b41bf9bc4c'] = 'Tariffa di base'; +$_MODULE['<{trackingfront}prestashop>trackingfront_86190054fc32554662ffbb12b717e8d0'] = 'Tariffa percentuale'; +$_MODULE['<{trackingfront}prestashop>trackingfront_51d53cd2ecdae6b5dd3397875197e898'] = 'Tariffa clic'; +$_MODULE['<{trackingfront}prestashop>trackingfront_11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Vendite'; +$_MODULE['<{trackingfront}prestashop>trackingfront_da9cb586c6689202ca65cd77fd9b84ef'] = 'Carrello medio'; +$_MODULE['<{trackingfront}prestashop>trackingfront_200f5c9c419f0a53d5d361eff7b33abc'] = 'Tasso registrazione'; +$_MODULE['<{trackingfront}prestashop>trackingfront_89741aae300253f498b0993fa678fa18'] = 'Tasso ordini'; diff --git a/modules/trackingfront/login.tpl b/modules/trackingfront/login.tpl new file mode 100644 index 000000000..b8b3b1edc --- /dev/null +++ b/modules/trackingfront/login.tpl @@ -0,0 +1,57 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + + PrestaShop™ - {l s='Affiliation' mod='trackingfront'} + + + {include file="$tpl_dir./errors.tpl"} +
        +
        +
        {l s='Affiliation space' mod='trackingfront'}
        +
        +
        +
        + +
        +
        + +
        +
        +
        +
        +
        +
        + + + \ No newline at end of file diff --git a/modules/trackingfront/logo.gif b/modules/trackingfront/logo.gif new file mode 100644 index 000000000..117f9626e Binary files /dev/null and b/modules/trackingfront/logo.gif differ diff --git a/modules/trackingfront/stats.php b/modules/trackingfront/stats.php new file mode 100644 index 000000000..d39b33819 --- /dev/null +++ b/modules/trackingfront/stats.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__).'/trackingfront.php'); + +$tf = new TrackingFront(); +if (!$tf->active) + Tools::redirect('404.php'); +$tf->postProcess(); +echo $tf->isLogged() ? $tf->displayAccount() : $tf->displayLogin(); + diff --git a/modules/trackingfront/trackingfront.php b/modules/trackingfront/trackingfront.php new file mode 100644 index 000000000..2a8e274c8 --- /dev/null +++ b/modules/trackingfront/trackingfront.php @@ -0,0 +1,264 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_CAN_LOAD_FILES_')) + exit; + +class TrackingFront extends Module +{ + public function __construct() + { + $this->name = 'trackingfront'; + $this->tab = 'shipping_logistics'; + $this->version = 1.0; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Tracking - Front office'); + $this->description = $this->l('Enable your affiliates to access their own statistics.'); + } + + public function postProcess() + { + global $cookie, $smarty; + + if (Tools::isSubmit('ajaxProductFilter')) + { + $fakeEmployee = new Employee(); + $fakeEmployee->stats_date_from = $cookie->stats_date_from; + $fakeEmployee->stats_date_to = $cookie->stats_date_to; + $result = Db::getInstance()->getRow(' + SELECT `id_referrer` + FROM `'._DB_PREFIX_.'referrer` + WHERE `id_referrer` = '.(int)(Tools::getValue('id_referrer')).' AND `passwd` = \''.pSQL(Tools::getValue('token')).'\''); + if (isset($result['id_referrer']) ? $result['id_referrer'] : false) + Referrer::getAjaxProduct((int)(Tools::getValue('id_referrer')), (int)(Tools::getValue('id_product')), $fakeEmployee); + } + elseif (Tools::isSubmit('logout_tracking')) + { + unset($cookie->tracking_id); + unset($cookie->tracking_passwd); + Tools::redirect('modules/trackingfront/stats.php'); + } + elseif (Tools::isSubmit('submitLoginTracking')) + { + $errors = array(); + $login = trim(Tools::getValue('login')); + $passwd = trim(Tools::getValue('passwd')); + if (empty($login)) + $errors[] = $this->l('login is required'); + elseif (!Validate::isGenericName($login)) + $errors[] = $this->l('invalid login'); + elseif (empty($passwd)) + $errors[] = $this->l('password is required'); + elseif (!Validate::isPasswd($passwd)) + $errors[] = $this->l('invalid password'); + else + { + $passwd = Tools::encrypt($passwd); + $result = Db::getInstance()->getRow(' + SELECT `id_referrer` + FROM `'._DB_PREFIX_.'referrer` + WHERE `name` = \''.pSQL($login).'\' AND `passwd` = \''.pSQL($passwd).'\''); + if (!isset($result['id_referrer']) OR !($tracking_id = (int)($result['id_referrer']))) + $errors[] = $this->l('authentication failed'); + else + { + $cookie->tracking_id = $tracking_id; + $cookie->tracking_passwd = $passwd; + Tools::redirect('modules/trackingfront/stats.php'); + } + } + $smarty->assign('errors', $errors); + } + + if (Tools::isSubmit('submitDatePicker')) + { + $cookie->stats_date_from = Tools::getValue('datepickerFrom'); + $cookie->stats_date_to = Tools::getValue('datepickerTo'); + } + if (Tools::isSubmit('submitDateDay')) + { + $from = date('Y-m-d'); + $to = date('Y-m-d'); + } + if (Tools::isSubmit('submitDateDayPrev')) + { + $yesterday = time() - 60*60*24; + $from = date('Y-m-d', $yesterday); + $to = date('Y-m-d', $yesterday); + } + if (Tools::isSubmit('submitDateMonth')) + { + $from = date('Y-m-01'); + $to = date('Y-m-t'); + } + if (Tools::isSubmit('submitDateMonthPrev')) + { + $m = (date('m') == 1 ? 12 : date('m') - 1); + $y = ($m == 12 ? date('Y') - 1 : date('Y')); + $from = $y.'-'.$m.'-01'; + $to = $y.'-'.$m.date('-t', mktime(12, 0, 0, $m, 15, $y)); + } + if (Tools::isSubmit('submitDateYear')) + { + $from = date('Y-01-01'); + $to = date('Y-12-31'); + } + if (Tools::isSubmit('submitDateYearPrev')) + { + $from = (date('Y') - 1).date('-01-01'); + $to = (date('Y') - 1).date('-12-31'); + } + } + + public function isLogged() + { + global $cookie; + if (!$cookie->tracking_id OR !$cookie->tracking_passwd) + return false; + $result = Db::getInstance()->getRow(' + SELECT `id_referrer` + FROM `'._DB_PREFIX_.'referrer` + WHERE `id_referrer` = '.(int)($cookie->tracking_id).' AND `passwd` = \''.pSQL($cookie->tracking_passwd).'\''); + return isset($result['id_referrer']) ? $result['id_referrer'] : false; + } + + public function displayLogin() + { + return $this->display(__FILE__, 'login.tpl'); + } + + public function displayAccount() + { + global $smarty, $cookie; + + if (!isset($cookie->stats_date_from)) + $cookie->stats_date_from = date('Y-m-d'); + if (!isset($cookie->stats_date_to)) + $cookie->stats_date_to = date('Y-m-t'); + $fakeEmployee = new Employee(); + $fakeEmployee->stats_date_from = $cookie->stats_date_from; + $fakeEmployee->stats_date_to = $cookie->stats_date_to; + Referrer::refreshCache(array(array('id_referrer' => (int)($cookie->tracking_id))), $fakeEmployee); + + $referrer = new Referrer((int)($cookie->tracking_id)); + $smarty->assign('referrer', $referrer); + $smarty->assign('datepickerFrom', $fakeEmployee->stats_date_from); + $smarty->assign('datepickerTo', $fakeEmployee->stats_date_to); + + $displayTab = array( + 'uniqs' => $this->l('Unique visitors'), + 'visitors' => $this->l('Visitors'), + 'visits' => $this->l('Visits'), + 'pages' => $this->l('Pages viewed'), + 'registrations' => $this->l('Registrations'), + 'orders' => $this->l('Orders'), + 'base_fee' => $this->l('Base fee'), + 'percent_fee' => $this->l('Percent fee'), + 'click_fee' => $this->l('Click fee'), + 'sales' => $this->l('Sales'), + 'cart' => $this->l('Average cart'), + 'reg_rate' => $this->l('Registration rate'), + 'order_rate' => $this->l('Order rate')); + $smarty->assign('displayTab', $displayTab); + + $products = Product::getSimpleProducts((int)($cookie->id_lang)); + $productsArray = array(); + foreach ($products as $product) + $productsArray[] = $product['id_product']; + + $echo = ' + + '; + + $echo2 = ' + '; + + return $this->display(__FILE__, 'header.tpl').$echo.$this->display(__FILE__, 'account.tpl').$echo2; + } +} + diff --git a/modules/treepodia/add-to-cart.tpl b/modules/treepodia/add-to-cart.tpl new file mode 100644 index 000000000..e299b8c06 --- /dev/null +++ b/modules/treepodia/add-to-cart.tpl @@ -0,0 +1,57 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{literal} + +{/literal} \ No newline at end of file diff --git a/modules/treepodia/api/get_data_feed.php b/modules/treepodia/api/get_data_feed.php new file mode 100644 index 000000000..47a10ea23 --- /dev/null +++ b/modules/treepodia/api/get_data_feed.php @@ -0,0 +1,23 @@ +generateXmlFlow(); + } + else + echo 'Bad token'; +} +else + echo 'Bad token'; + +?> \ No newline at end of file diff --git a/modules/treepodia/api/ping.php b/modules/treepodia/api/ping.php new file mode 100644 index 000000000..88aa0bcea --- /dev/null +++ b/modules/treepodia/api/ping.php @@ -0,0 +1,3 @@ + + + treepodia + Treepodia + 1.2 + Cover your entire catalog with product videos in 24 hours. + + front_office_features + 1 + 1 + \ No newline at end of file diff --git a/modules/treepodia/de.php b/modules/treepodia/de.php new file mode 100644 index 000000000..f10acd263 --- /dev/null +++ b/modules/treepodia/de.php @@ -0,0 +1,37 @@ +footer_93c433787599e3c6a61c27c9faad7cb1'] = 'Video ansehen'; +$_MODULE['<{treepodia}prestashop>treepodia_63003285187eda3cbab5be4c64b19da7'] = 'Bestücken Sie Ihren gesamten Katalog mit Produkt-Videos in nur 24 Stunden'; +$_MODULE['<{treepodia}prestashop>treepodia_e0f18214ada56df05a4cb4f2834a6bbd'] = 'Sie haben Ihre Treepodia-Konfiguration noch nicht eingestellt'; +$_MODULE['<{treepodia}prestashop>treepodia_84d2e2420a102446904946c6611610e7'] = 'Wählen Sie ein Bild unten oder laden Sie ein neues.'; +$_MODULE['<{treepodia}prestashop>treepodia_93f1004ef4f6180d1ff4c3e5e097535a'] = 'Neues Logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_9fab8fa8c181098a13b1a360cbc6ff95'] = 'Es ist bekannt, dass Produktvideos Umsätze, Kundenengagement und -Treue erhöhen, und wesentlich zum Verkaufserlebnis Ihrer Käufer beitragen. Sie verstärken ebenso sehr das allgemeine Verkaufserlebnis Ihrer Käufer und haben einen extrem positiven Effekt auf Ihre Sichtbarkeit in den Suchmaschinen.'; +$_MODULE['<{treepodia}prestashop>treepodia_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr'; +$_MODULE['<{treepodia}prestashop>treepodia_5f9c47215d373f15d8ab231a7803eafb'] = 'Mein Treepodia-Konto '; +$_MODULE['<{treepodia}prestashop>treepodia_14d4af7e8b50a553a484be490748b8f8'] = 'Sie sind noch nicht für einen Treepodia Video-Konto angemeldet. Bitte melden Sie sich bei Treepodia an.'; +$_MODULE['<{treepodia}prestashop>treepodia_0f98b7f230f3c91292f0de4c99e263f2'] = 'Anmeldung'; +$_MODULE['<{treepodia}prestashop>treepodia_7f4f7010abf7fb495ffe34fad24dfc96'] = 'Video-Konto-Code'; +$_MODULE['<{treepodia}prestashop>treepodia_95df9efce09730856d2674c630a1a35a'] = 'Ihr Video-Konto-Code identifiziert ausschließlich Ihren Shop, und wurde Ihnen automatisch zugewiesen.'; +$_MODULE['<{treepodia}prestashop>treepodia_35ac6a06187c6dab85b3024e3f457dd9'] = 'Melden Sie sich in Ihrem Video-Konto an, um Ihre Präferenzen und Einstellungen zu ändern und Ihren Geschäftsentwicklungsbericht einzusehen.'; +$_MODULE['<{treepodia}prestashop>treepodia_b6d4223e60986fa4c9af77ee5f7149c5'] = 'Anmelden'; +$_MODULE['<{treepodia}prestashop>treepodia_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{treepodia}prestashop>treepodia_1e26f63fb925b49c1c741197cdc0dc7b'] = 'Verwenden Sie die vordefinierte Integration'; +$_MODULE['<{treepodia}prestashop>treepodia_d7cf3a48c409acbac7598ca616569864'] = 'Die vordefinierte Integration bettet den Treepodia-Itegrationscode automatisch in Ihren Shop ein und zeigt einen Link zum Video auf Ihrer Produktseite an'; +$_MODULE['<{treepodia}prestashop>treepodia_56850ed64712ade8b062ed706b0fdeb6'] = 'Aktuelles Logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_947f55293d691cd5c06a642e55d31895'] = 'Logo ändern'; +$_MODULE['<{treepodia}prestashop>treepodia_d236e43ab0c1cb8f7b8024b61903ded2'] = 'Logo anzeigen:'; +$_MODULE['<{treepodia}prestashop>treepodia_f3d1747a115a48cc0399d6ef5a8d6d9a'] = 'Über nützliche Links'; +$_MODULE['<{treepodia}prestashop>treepodia_f87758e540d66df6593a86ab336b4ae2'] = 'Über Mehr Infos'; +$_MODULE['<{treepodia}prestashop>treepodia_caf5518b3c8ec0e6e41f225a23baaf79'] = 'Setzen Sie das Logo her:'; +$_MODULE['<{treepodia}prestashop>treepodia_c68e0631cf123732fb880cb653eaa783'] = 'Produktbild'; +$_MODULE['<{treepodia}prestashop>treepodia_945d5e233cf7d6240f6b783b36a374ff'] = 'Links'; +$_MODULE['<{treepodia}prestashop>treepodia_4f1f6016fc9f3f2353c0cc7c67b292bd'] = 'Mitte'; +$_MODULE['<{treepodia}prestashop>treepodia_92b09c7c48c520c3c55e497875da437c'] = 'Rechts'; +$_MODULE['<{treepodia}prestashop>treepodia_1decb322633084a2d5c42c1ff047becd'] = 'Oder implementieren Sie Ihre eigene Integration'; +$_MODULE['<{treepodia}prestashop>treepodia_d280700ce09ead998bbdf9b33d8c1cb4'] = 'Verwenden Sie diese Option, wenn Sie den Treepodia Integrationscode selbst implementieren wollen. Der vordefinierte Integrationscode wird deaktiviert, wenn Sie diese Option wählen.'; +$_MODULE['<{treepodia}prestashop>treepodia_86102199212f7d05ab38d8df0a2045a7'] = 'Lesen Sie hier, wie Sie den Treepodia Integrationscode selbst implementieren können'; +$_MODULE['<{treepodia}prestashop>treepodia_d4dccb8ca2dac4e53c01bd9954755332'] = 'Speichern Sie die Einstellungen'; +$_MODULE['<{treepodia}prestashop>treepodia_3832f6deff5d50413adcbc9c06388c32'] = 'Ungültiger Dateityp'; +$_MODULE['<{treepodia}prestashop>treepodia_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; diff --git a/modules/treepodia/es.php b/modules/treepodia/es.php new file mode 100644 index 000000000..dbc3a9455 --- /dev/null +++ b/modules/treepodia/es.php @@ -0,0 +1,37 @@ +footer_93c433787599e3c6a61c27c9faad7cb1'] = 'Ver el vídeo'; +$_MODULE['<{treepodia}prestashop>treepodia_63003285187eda3cbab5be4c64b19da7'] = '¡Videos de demostración para cada uno de sus productos en 24!'; +$_MODULE['<{treepodia}prestashop>treepodia_e0f18214ada56df05a4cb4f2834a6bbd'] = 'El módulo no está configurado.'; +$_MODULE['<{treepodia}prestashop>treepodia_84d2e2420a102446904946c6611610e7'] = 'Elija una imagen o baje una'; +$_MODULE['<{treepodia}prestashop>treepodia_93f1004ef4f6180d1ff4c3e5e097535a'] = 'Nuevo logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_9fab8fa8c181098a13b1a360cbc6ff95'] = 'Los videos aumentan las ventas, el compromiso y la fidelidad del cliente al mismo tiempo que su experiencia como usuario.'; +$_MODULE['<{treepodia}prestashop>treepodia_d59048f21fd887ad520398ce677be586'] = 'Más información'; +$_MODULE['<{treepodia}prestashop>treepodia_5f9c47215d373f15d8ab231a7803eafb'] = 'Mi cuenta Treepodia'; +$_MODULE['<{treepodia}prestashop>treepodia_14d4af7e8b50a553a484be490748b8f8'] = 'No tiene una cuenta Treepodia Video. Debe registrarse.'; +$_MODULE['<{treepodia}prestashop>treepodia_0f98b7f230f3c91292f0de4c99e263f2'] = 'Registrarse'; +$_MODULE['<{treepodia}prestashop>treepodia_7f4f7010abf7fb495ffe34fad24dfc96'] = 'Código de la cuenta video'; +$_MODULE['<{treepodia}prestashop>treepodia_95df9efce09730856d2674c630a1a35a'] = 'El código de la cuenta video le ha sido atribuido automáticamente, identifica de manera única su tienda.'; +$_MODULE['<{treepodia}prestashop>treepodia_35ac6a06187c6dab85b3024e3f457dd9'] = 'Conéctese a su cuenta para cambiar sus preferencias, configuración, y estar al tanto de sus resultados.'; +$_MODULE['<{treepodia}prestashop>treepodia_b6d4223e60986fa4c9af77ee5f7149c5'] = 'Conexión'; +$_MODULE['<{treepodia}prestashop>treepodia_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{treepodia}prestashop>treepodia_1e26f63fb925b49c1c741197cdc0dc7b'] = 'Implementación por defecto'; +$_MODULE['<{treepodia}prestashop>treepodia_d7cf3a48c409acbac7598ca616569864'] = 'La implementación por defecto integra el código de Treepodia en su tienda y muestra un link hacia el video en su página producto.'; +$_MODULE['<{treepodia}prestashop>treepodia_56850ed64712ade8b062ed706b0fdeb6'] = 'Logo actual:'; +$_MODULE['<{treepodia}prestashop>treepodia_947f55293d691cd5c06a642e55d31895'] = 'Cambiar de logo'; +$_MODULE['<{treepodia}prestashop>treepodia_d236e43ab0c1cb8f7b8024b61903ded2'] = 'Mostrar el logo'; +$_MODULE['<{treepodia}prestashop>treepodia_f3d1747a115a48cc0399d6ef5a8d6d9a'] = 'Encima de los enlaces útiles'; +$_MODULE['<{treepodia}prestashop>treepodia_f87758e540d66df6593a86ab336b4ae2'] = 'Encima de más informaciones'; +$_MODULE['<{treepodia}prestashop>treepodia_caf5518b3c8ec0e6e41f225a23baaf79'] = 'Poner el logo aquí:'; +$_MODULE['<{treepodia}prestashop>treepodia_c68e0631cf123732fb880cb653eaa783'] = 'Imagen del producto'; +$_MODULE['<{treepodia}prestashop>treepodia_945d5e233cf7d6240f6b783b36a374ff'] = 'Izquierda'; +$_MODULE['<{treepodia}prestashop>treepodia_4f1f6016fc9f3f2353c0cc7c67b292bd'] = 'Centro'; +$_MODULE['<{treepodia}prestashop>treepodia_92b09c7c48c520c3c55e497875da437c'] = 'Derecha'; +$_MODULE['<{treepodia}prestashop>treepodia_1decb322633084a2d5c42c1ff047becd'] = 'O bien, implementar su propia integración'; +$_MODULE['<{treepodia}prestashop>treepodia_d280700ce09ead998bbdf9b33d8c1cb4'] = 'Ulitizar esta opción si desea implementar el código de Treepodia usted mismo. La implementación por defecto se desactivará.'; +$_MODULE['<{treepodia}prestashop>treepodia_86102199212f7d05ab38d8df0a2045a7'] = 'Pulse aquí para ver como integrar Treepodia con su propio código.'; +$_MODULE['<{treepodia}prestashop>treepodia_d4dccb8ca2dac4e53c01bd9954755332'] = 'Guardar'; +$_MODULE['<{treepodia}prestashop>treepodia_3832f6deff5d50413adcbc9c06388c32'] = 'Archivo no válido'; +$_MODULE['<{treepodia}prestashop>treepodia_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; diff --git a/modules/treepodia/export/export.php b/modules/treepodia/export/export.php new file mode 100644 index 000000000..5c3d24e2e --- /dev/null +++ b/modules/treepodia/export/export.php @@ -0,0 +1,26 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ include(dirname(__FILE__).'/../../../config/config.inc.php'); include(dirname(__FILE__).'/../../../init.php'); include(dirname(__FILE__).'/../treepodia.php'); $treepodia = new Treepodia(); $treepodia->generateXmlFlow(); \ No newline at end of file diff --git a/modules/treepodia/footer.tpl b/modules/treepodia/footer.tpl new file mode 100644 index 000000000..f25240c35 --- /dev/null +++ b/modules/treepodia/footer.tpl @@ -0,0 +1,64 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + + \ No newline at end of file diff --git a/modules/treepodia/fr.php b/modules/treepodia/fr.php new file mode 100644 index 000000000..15df3b5d2 --- /dev/null +++ b/modules/treepodia/fr.php @@ -0,0 +1,37 @@ +footer_93c433787599e3c6a61c27c9faad7cb1'] = 'Regarder la vidéo'; +$_MODULE['<{treepodia}prestashop>treepodia_63003285187eda3cbab5be4c64b19da7'] = 'Des vidéos de démonstration pour chacun de vos produits en 24h chrono!'; +$_MODULE['<{treepodia}prestashop>treepodia_e0f18214ada56df05a4cb4f2834a6bbd'] = 'Le module n\'est pas configuré.'; +$_MODULE['<{treepodia}prestashop>treepodia_84d2e2420a102446904946c6611610e7'] = 'Choisissez une image ou télécharger '; +$_MODULE['<{treepodia}prestashop>treepodia_93f1004ef4f6180d1ff4c3e5e097535a'] = 'Nouveau logo :'; +$_MODULE['<{treepodia}prestashop>treepodia_9fab8fa8c181098a13b1a360cbc6ff95'] = 'Les vidéos augmentent les ventes, l\'engagement et la fidélité du client tout en augmentant l\'expérience utilisateur. '; +$_MODULE['<{treepodia}prestashop>treepodia_d59048f21fd887ad520398ce677be586'] = 'En savoir plus'; +$_MODULE['<{treepodia}prestashop>treepodia_5f9c47215d373f15d8ab231a7803eafb'] = 'Mon compte Treepodia'; +$_MODULE['<{treepodia}prestashop>treepodia_14d4af7e8b50a553a484be490748b8f8'] = 'Vous ne possédez pas de compte Treepodia Vidéo. Merci de vous enregistrer.'; +$_MODULE['<{treepodia}prestashop>treepodia_0f98b7f230f3c91292f0de4c99e263f2'] = 'Enregistrement'; +$_MODULE['<{treepodia}prestashop>treepodia_7f4f7010abf7fb495ffe34fad24dfc96'] = 'Code du compte vidéo'; +$_MODULE['<{treepodia}prestashop>treepodia_95df9efce09730856d2674c630a1a35a'] = 'Le code du compte vidéo vous a été attribué automatiquement, il identifie de manière unique votre magasin.'; +$_MODULE['<{treepodia}prestashop>treepodia_35ac6a06187c6dab85b3024e3f457dd9'] = 'Connectez vous sur votre compte pour changer vos préférences, configuration et suivre vos performances.'; +$_MODULE['<{treepodia}prestashop>treepodia_b6d4223e60986fa4c9af77ee5f7149c5'] = 'Connexion'; +$_MODULE['<{treepodia}prestashop>treepodia_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuration'; +$_MODULE['<{treepodia}prestashop>treepodia_1e26f63fb925b49c1c741197cdc0dc7b'] = 'Implémentation par défaut'; +$_MODULE['<{treepodia}prestashop>treepodia_d7cf3a48c409acbac7598ca616569864'] = 'L\'implémentation par défaut, intègre le code de Treepodia dans votre magasin et affiche un lien vers la vidéo dans votre page produit.'; +$_MODULE['<{treepodia}prestashop>treepodia_56850ed64712ade8b062ed706b0fdeb6'] = 'Logo actuel:'; +$_MODULE['<{treepodia}prestashop>treepodia_947f55293d691cd5c06a642e55d31895'] = 'Changer votre logo'; +$_MODULE['<{treepodia}prestashop>treepodia_d236e43ab0c1cb8f7b8024b61903ded2'] = 'Logo affiché:'; +$_MODULE['<{treepodia}prestashop>treepodia_f3d1747a115a48cc0399d6ef5a8d6d9a'] = 'Au-dessus des liens utiles'; +$_MODULE['<{treepodia}prestashop>treepodia_f87758e540d66df6593a86ab336b4ae2'] = 'Au-dessus de plus d\'informations'; +$_MODULE['<{treepodia}prestashop>treepodia_caf5518b3c8ec0e6e41f225a23baaf79'] = 'Placer le logo ici:'; +$_MODULE['<{treepodia}prestashop>treepodia_c68e0631cf123732fb880cb653eaa783'] = 'Image du produit'; +$_MODULE['<{treepodia}prestashop>treepodia_945d5e233cf7d6240f6b783b36a374ff'] = 'Gauche'; +$_MODULE['<{treepodia}prestashop>treepodia_4f1f6016fc9f3f2353c0cc7c67b292bd'] = 'Centre'; +$_MODULE['<{treepodia}prestashop>treepodia_92b09c7c48c520c3c55e497875da437c'] = 'Droite'; +$_MODULE['<{treepodia}prestashop>treepodia_1decb322633084a2d5c42c1ff047becd'] = 'Ou, implementer votre propre intégration'; +$_MODULE['<{treepodia}prestashop>treepodia_d280700ce09ead998bbdf9b33d8c1cb4'] = 'Utiliser cette option si vous souhaitez implémenter le code de Treepodia vous même. L\'implémentation par défaut sera désactivée.'; +$_MODULE['<{treepodia}prestashop>treepodia_86102199212f7d05ab38d8df0a2045a7'] = 'Cliquez ici pour savoir comment intégrer Treepodia avec votre propre code.'; +$_MODULE['<{treepodia}prestashop>treepodia_d4dccb8ca2dac4e53c01bd9954755332'] = 'Sauvegarder'; +$_MODULE['<{treepodia}prestashop>treepodia_3832f6deff5d50413adcbc9c06388c32'] = 'Fichier invalide'; +$_MODULE['<{treepodia}prestashop>treepodia_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; diff --git a/modules/treepodia/it.php b/modules/treepodia/it.php new file mode 100644 index 000000000..0a92452c0 --- /dev/null +++ b/modules/treepodia/it.php @@ -0,0 +1,37 @@ +footer_93c433787599e3c6a61c27c9faad7cb1'] = 'Guarda il video'; +$_MODULE['<{treepodia}prestashop>treepodia_63003285187eda3cbab5be4c64b19da7'] = 'Riempi il tuo intero catalogo con video realizzati in 24 ore'; +$_MODULE['<{treepodia}prestashop>treepodia_e0f18214ada56df05a4cb4f2834a6bbd'] = 'Non hai impostato la configurazione Treepodia'; +$_MODULE['<{treepodia}prestashop>treepodia_84d2e2420a102446904946c6611610e7'] = 'Seleziona una foto qui sotto o caricane una nuova.'; +$_MODULE['<{treepodia}prestashop>treepodia_93f1004ef4f6180d1ff4c3e5e097535a'] = 'Nuovo logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_9fab8fa8c181098a13b1a360cbc6ff95'] = 'E\' noto che i video dei prodotti aumentano le vendite, l\'impegno e la fedeltà dei clienti, e migliorano moltissimo lo shopping.Hanno inoltre un forte effetto positivo sulla tua visibilità motori di ricerca'; +$_MODULE['<{treepodia}prestashop>treepodia_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più'; +$_MODULE['<{treepodia}prestashop>treepodia_5f9c47215d373f15d8ab231a7803eafb'] = 'Il mio account Treepodia'; +$_MODULE['<{treepodia}prestashop>treepodia_14d4af7e8b50a553a484be490748b8f8'] = 'Non sei ancora registrato in un account Treepodia video. Si prega di registrarsi con Treepodia.'; +$_MODULE['<{treepodia}prestashop>treepodia_0f98b7f230f3c91292f0de4c99e263f2'] = 'Registrazione'; +$_MODULE['<{treepodia}prestashop>treepodia_7f4f7010abf7fb495ffe34fad24dfc96'] = 'Codice account video'; +$_MODULE['<{treepodia}prestashop>treepodia_95df9efce09730856d2674c630a1a35a'] = 'Il tuo codice account video identifica in modo univoco il tuo negozio, e ti è stato assegnato automaticamente.'; +$_MODULE['<{treepodia}prestashop>treepodia_35ac6a06187c6dab85b3024e3f457dd9'] = 'Accedi al tuo account video per modificare le preferenze, le impostazioni e visualizzare i report delle prestazioni aziendali.'; +$_MODULE['<{treepodia}prestashop>treepodia_b6d4223e60986fa4c9af77ee5f7149c5'] = 'Entra'; +$_MODULE['<{treepodia}prestashop>treepodia_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{treepodia}prestashop>treepodia_1e26f63fb925b49c1c741197cdc0dc7b'] = 'Usa integrazione built-in'; +$_MODULE['<{treepodia}prestashop>treepodia_d7cf3a48c409acbac7598ca616569864'] = 'L\'integrazione built-in incorpora automaticamente il codice integrazione Treepodia nel tuo negozio, e viene visualizzato un link verso il video sulla pagina del prodotto'; +$_MODULE['<{treepodia}prestashop>treepodia_56850ed64712ade8b062ed706b0fdeb6'] = 'Logo attuale:'; +$_MODULE['<{treepodia}prestashop>treepodia_947f55293d691cd5c06a642e55d31895'] = 'cambiare il logo'; +$_MODULE['<{treepodia}prestashop>treepodia_d236e43ab0c1cb8f7b8024b61903ded2'] = 'Mostra logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_f3d1747a115a48cc0399d6ef5a8d6d9a'] = 'Sopra link utili'; +$_MODULE['<{treepodia}prestashop>treepodia_f87758e540d66df6593a86ab336b4ae2'] = 'Sopra più info'; +$_MODULE['<{treepodia}prestashop>treepodia_caf5518b3c8ec0e6e41f225a23baaf79'] = 'Colloca qui il logo:'; +$_MODULE['<{treepodia}prestashop>treepodia_c68e0631cf123732fb880cb653eaa783'] = 'Foto del prodotto'; +$_MODULE['<{treepodia}prestashop>treepodia_945d5e233cf7d6240f6b783b36a374ff'] = 'Sinistra'; +$_MODULE['<{treepodia}prestashop>treepodia_4f1f6016fc9f3f2353c0cc7c67b292bd'] = 'Centro'; +$_MODULE['<{treepodia}prestashop>treepodia_92b09c7c48c520c3c55e497875da437c'] = 'Destra'; +$_MODULE['<{treepodia}prestashop>treepodia_1decb322633084a2d5c42c1ff047becd'] = 'In alternativa, implementare la propria integrazione'; +$_MODULE['<{treepodia}prestashop>treepodia_d280700ce09ead998bbdf9b33d8c1cb4'] = 'Utilizza questa opzione se vuoi implementare il codice integrazione Treepodia sul tuo. Il codice di integrazione built-in sarà disattivato se si sceglie questa opzione.'; +$_MODULE['<{treepodia}prestashop>treepodia_86102199212f7d05ab38d8df0a2045a7'] = 'Leggi qui come attuare il codice di integrazione Treepodia sul tuo'; +$_MODULE['<{treepodia}prestashop>treepodia_d4dccb8ca2dac4e53c01bd9954755332'] = 'Salva impostazioni'; +$_MODULE['<{treepodia}prestashop>treepodia_3832f6deff5d50413adcbc9c06388c32'] = 'Tipo di file non valido'; +$_MODULE['<{treepodia}prestashop>treepodia_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; diff --git a/modules/treepodia/logo.gif b/modules/treepodia/logo.gif new file mode 100644 index 000000000..e032d94b2 Binary files /dev/null and b/modules/treepodia/logo.gif differ diff --git a/modules/treepodia/logo.png b/modules/treepodia/logo.png new file mode 100644 index 000000000..37f2d0acd Binary files /dev/null and b/modules/treepodia/logo.png differ diff --git a/modules/treepodia/logos/01_1.jpg b/modules/treepodia/logos/01_1.jpg new file mode 100644 index 000000000..3f10f7337 Binary files /dev/null and b/modules/treepodia/logos/01_1.jpg differ diff --git a/modules/treepodia/logos/01_2.jpg b/modules/treepodia/logos/01_2.jpg new file mode 100644 index 000000000..3f97ced43 Binary files /dev/null and b/modules/treepodia/logos/01_2.jpg differ diff --git a/modules/treepodia/logos/01_3.jpg b/modules/treepodia/logos/01_3.jpg new file mode 100644 index 000000000..edb2fbd7f Binary files /dev/null and b/modules/treepodia/logos/01_3.jpg differ diff --git a/modules/treepodia/logos/01_4.jpg b/modules/treepodia/logos/01_4.jpg new file mode 100644 index 000000000..a578a0f8d Binary files /dev/null and b/modules/treepodia/logos/01_4.jpg differ diff --git a/modules/treepodia/logos/02_1.jpg b/modules/treepodia/logos/02_1.jpg new file mode 100644 index 000000000..1f08d3f0f Binary files /dev/null and b/modules/treepodia/logos/02_1.jpg differ diff --git a/modules/treepodia/logos/02_2.jpg b/modules/treepodia/logos/02_2.jpg new file mode 100644 index 000000000..d561ef01a Binary files /dev/null and b/modules/treepodia/logos/02_2.jpg differ diff --git a/modules/treepodia/logos/03_1.jpg b/modules/treepodia/logos/03_1.jpg new file mode 100644 index 000000000..4e4628cbf Binary files /dev/null and b/modules/treepodia/logos/03_1.jpg differ diff --git a/modules/treepodia/logos/04_1.jpg b/modules/treepodia/logos/04_1.jpg new file mode 100644 index 000000000..d411da36a Binary files /dev/null and b/modules/treepodia/logos/04_1.jpg differ diff --git a/modules/treepodia/logos/04_2.jpg b/modules/treepodia/logos/04_2.jpg new file mode 100644 index 000000000..61a6e75e1 Binary files /dev/null and b/modules/treepodia/logos/04_2.jpg differ diff --git a/modules/treepodia/logos/04_3.jpg b/modules/treepodia/logos/04_3.jpg new file mode 100644 index 000000000..30fb99b19 Binary files /dev/null and b/modules/treepodia/logos/04_3.jpg differ diff --git a/modules/treepodia/logos/04_4.jpg b/modules/treepodia/logos/04_4.jpg new file mode 100644 index 000000000..edc90da5f Binary files /dev/null and b/modules/treepodia/logos/04_4.jpg differ diff --git a/modules/treepodia/logos/04_5.jpg b/modules/treepodia/logos/04_5.jpg new file mode 100644 index 000000000..c755dde3f Binary files /dev/null and b/modules/treepodia/logos/04_5.jpg differ diff --git a/modules/treepodia/logos/05_1.jpg b/modules/treepodia/logos/05_1.jpg new file mode 100644 index 000000000..93edd6d40 Binary files /dev/null and b/modules/treepodia/logos/05_1.jpg differ diff --git a/modules/treepodia/logos/05_2.jpg b/modules/treepodia/logos/05_2.jpg new file mode 100644 index 000000000..5f826a845 Binary files /dev/null and b/modules/treepodia/logos/05_2.jpg differ diff --git a/modules/treepodia/logos/05_3.jpg b/modules/treepodia/logos/05_3.jpg new file mode 100644 index 000000000..08e798d45 Binary files /dev/null and b/modules/treepodia/logos/05_3.jpg differ diff --git a/modules/treepodia/logos/05_4.jpg b/modules/treepodia/logos/05_4.jpg new file mode 100644 index 000000000..b78fad05d Binary files /dev/null and b/modules/treepodia/logos/05_4.jpg differ diff --git a/modules/treepodia/logos/05_6.jpg b/modules/treepodia/logos/05_6.jpg new file mode 100644 index 000000000..f5659abaa Binary files /dev/null and b/modules/treepodia/logos/05_6.jpg differ diff --git a/modules/treepodia/logos/06_1.jpg b/modules/treepodia/logos/06_1.jpg new file mode 100644 index 000000000..46bb32a2b Binary files /dev/null and b/modules/treepodia/logos/06_1.jpg differ diff --git a/modules/treepodia/logos/07_1.jpg b/modules/treepodia/logos/07_1.jpg new file mode 100644 index 000000000..4fc5b7941 Binary files /dev/null and b/modules/treepodia/logos/07_1.jpg differ diff --git a/modules/treepodia/logos/08_1.jpg b/modules/treepodia/logos/08_1.jpg new file mode 100644 index 000000000..ef39adb9d Binary files /dev/null and b/modules/treepodia/logos/08_1.jpg differ diff --git a/modules/treepodia/logos/09.jpg b/modules/treepodia/logos/09.jpg new file mode 100644 index 000000000..ba7d282be Binary files /dev/null and b/modules/treepodia/logos/09.jpg differ diff --git a/modules/treepodia/logos/1-1.png b/modules/treepodia/logos/1-1.png new file mode 100644 index 000000000..292a0a584 Binary files /dev/null and b/modules/treepodia/logos/1-1.png differ diff --git a/modules/treepodia/logos/1-2.png b/modules/treepodia/logos/1-2.png new file mode 100644 index 000000000..acbeb3e64 Binary files /dev/null and b/modules/treepodia/logos/1-2.png differ diff --git a/modules/treepodia/logos/1-3.png b/modules/treepodia/logos/1-3.png new file mode 100644 index 000000000..d41c6f290 Binary files /dev/null and b/modules/treepodia/logos/1-3.png differ diff --git a/modules/treepodia/logos/1-4.png b/modules/treepodia/logos/1-4.png new file mode 100644 index 000000000..de88e1ef4 Binary files /dev/null and b/modules/treepodia/logos/1-4.png differ diff --git a/modules/treepodia/logos/1-5.png b/modules/treepodia/logos/1-5.png new file mode 100644 index 000000000..6c1476fd6 Binary files /dev/null and b/modules/treepodia/logos/1-5.png differ diff --git a/modules/treepodia/logos/1-6.png b/modules/treepodia/logos/1-6.png new file mode 100644 index 000000000..5a63c13c5 Binary files /dev/null and b/modules/treepodia/logos/1-6.png differ diff --git a/modules/treepodia/logos/1-7.png b/modules/treepodia/logos/1-7.png new file mode 100644 index 000000000..473b5597a Binary files /dev/null and b/modules/treepodia/logos/1-7.png differ diff --git a/modules/treepodia/logos/10.jpg b/modules/treepodia/logos/10.jpg new file mode 100644 index 000000000..a6c641f3f Binary files /dev/null and b/modules/treepodia/logos/10.jpg differ diff --git a/modules/treepodia/logos/11_1.jpg b/modules/treepodia/logos/11_1.jpg new file mode 100644 index 000000000..cdb903003 Binary files /dev/null and b/modules/treepodia/logos/11_1.jpg differ diff --git a/modules/treepodia/logos/11_2.jpg b/modules/treepodia/logos/11_2.jpg new file mode 100644 index 000000000..ffc1df7bf Binary files /dev/null and b/modules/treepodia/logos/11_2.jpg differ diff --git a/modules/treepodia/logos/11_3.jpg b/modules/treepodia/logos/11_3.jpg new file mode 100644 index 000000000..311b44b07 Binary files /dev/null and b/modules/treepodia/logos/11_3.jpg differ diff --git a/modules/treepodia/logos/11_4.jpg b/modules/treepodia/logos/11_4.jpg new file mode 100644 index 000000000..0ac20c8f0 Binary files /dev/null and b/modules/treepodia/logos/11_4.jpg differ diff --git a/modules/treepodia/logos/11_5.jpg b/modules/treepodia/logos/11_5.jpg new file mode 100644 index 000000000..2dddb4d2a Binary files /dev/null and b/modules/treepodia/logos/11_5.jpg differ diff --git a/modules/treepodia/logos/12_1.jpg b/modules/treepodia/logos/12_1.jpg new file mode 100644 index 000000000..632f50da6 Binary files /dev/null and b/modules/treepodia/logos/12_1.jpg differ diff --git a/modules/treepodia/logos/12_2.jpg b/modules/treepodia/logos/12_2.jpg new file mode 100644 index 000000000..d3bf43ccf Binary files /dev/null and b/modules/treepodia/logos/12_2.jpg differ diff --git a/modules/treepodia/logos/12_3.jpg b/modules/treepodia/logos/12_3.jpg new file mode 100644 index 000000000..64a99081a Binary files /dev/null and b/modules/treepodia/logos/12_3.jpg differ diff --git a/modules/treepodia/logos/12_4.jpg b/modules/treepodia/logos/12_4.jpg new file mode 100644 index 000000000..a9e163c47 Binary files /dev/null and b/modules/treepodia/logos/12_4.jpg differ diff --git a/modules/treepodia/logos/12_5.jpg b/modules/treepodia/logos/12_5.jpg new file mode 100644 index 000000000..50f930ae6 Binary files /dev/null and b/modules/treepodia/logos/12_5.jpg differ diff --git a/modules/treepodia/logos/2-1-2.png b/modules/treepodia/logos/2-1-2.png new file mode 100644 index 000000000..4e06eaa3d Binary files /dev/null and b/modules/treepodia/logos/2-1-2.png differ diff --git a/modules/treepodia/logos/2-1.png b/modules/treepodia/logos/2-1.png new file mode 100644 index 000000000..fab4cafa9 Binary files /dev/null and b/modules/treepodia/logos/2-1.png differ diff --git a/modules/treepodia/logos/2-2-2.png b/modules/treepodia/logos/2-2-2.png new file mode 100644 index 000000000..38c94c439 Binary files /dev/null and b/modules/treepodia/logos/2-2-2.png differ diff --git a/modules/treepodia/logos/2-2.png b/modules/treepodia/logos/2-2.png new file mode 100644 index 000000000..b8b117ef9 Binary files /dev/null and b/modules/treepodia/logos/2-2.png differ diff --git a/modules/treepodia/logos/2-3.png b/modules/treepodia/logos/2-3.png new file mode 100644 index 000000000..81b2b2f6d Binary files /dev/null and b/modules/treepodia/logos/2-3.png differ diff --git a/modules/treepodia/logos/2-4.png b/modules/treepodia/logos/2-4.png new file mode 100644 index 000000000..c44c09c78 Binary files /dev/null and b/modules/treepodia/logos/2-4.png differ diff --git a/modules/treepodia/logos/2-5.png b/modules/treepodia/logos/2-5.png new file mode 100644 index 000000000..257e19256 Binary files /dev/null and b/modules/treepodia/logos/2-5.png differ diff --git a/modules/treepodia/logos/2-6.png b/modules/treepodia/logos/2-6.png new file mode 100644 index 000000000..9e0980a62 Binary files /dev/null and b/modules/treepodia/logos/2-6.png differ diff --git a/modules/treepodia/logos/3-2.png b/modules/treepodia/logos/3-2.png new file mode 100644 index 000000000..9c2f17bcc Binary files /dev/null and b/modules/treepodia/logos/3-2.png differ diff --git a/modules/treepodia/logos/3-3.png b/modules/treepodia/logos/3-3.png new file mode 100644 index 000000000..6958c7f9d Binary files /dev/null and b/modules/treepodia/logos/3-3.png differ diff --git a/modules/treepodia/logos/3-7.png b/modules/treepodia/logos/3-7.png new file mode 100644 index 000000000..0786a50ae Binary files /dev/null and b/modules/treepodia/logos/3-7.png differ diff --git a/modules/treepodia/logos/4-1.png b/modules/treepodia/logos/4-1.png new file mode 100644 index 000000000..0a42f6243 Binary files /dev/null and b/modules/treepodia/logos/4-1.png differ diff --git a/modules/treepodia/logos/4-2.png b/modules/treepodia/logos/4-2.png new file mode 100644 index 000000000..1a19cb93b Binary files /dev/null and b/modules/treepodia/logos/4-2.png differ diff --git a/modules/treepodia/logos/4-3.png b/modules/treepodia/logos/4-3.png new file mode 100644 index 000000000..8937c15b4 Binary files /dev/null and b/modules/treepodia/logos/4-3.png differ diff --git a/modules/treepodia/logos/4-4.png b/modules/treepodia/logos/4-4.png new file mode 100644 index 000000000..a6ff4088c Binary files /dev/null and b/modules/treepodia/logos/4-4.png differ diff --git a/modules/treepodia/logos/4-5.png b/modules/treepodia/logos/4-5.png new file mode 100644 index 000000000..1a0e87016 Binary files /dev/null and b/modules/treepodia/logos/4-5.png differ diff --git a/modules/treepodia/logos/4-6.png b/modules/treepodia/logos/4-6.png new file mode 100644 index 000000000..9e0657e15 Binary files /dev/null and b/modules/treepodia/logos/4-6.png differ diff --git a/modules/treepodia/logos/4-7.png b/modules/treepodia/logos/4-7.png new file mode 100644 index 000000000..e320a0f60 Binary files /dev/null and b/modules/treepodia/logos/4-7.png differ diff --git a/modules/treepodia/logos/5-1.png b/modules/treepodia/logos/5-1.png new file mode 100644 index 000000000..8c0f0854d Binary files /dev/null and b/modules/treepodia/logos/5-1.png differ diff --git a/modules/treepodia/logos/5-2.png b/modules/treepodia/logos/5-2.png new file mode 100644 index 000000000..5a814f787 Binary files /dev/null and b/modules/treepodia/logos/5-2.png differ diff --git a/modules/treepodia/logos/5-3.png b/modules/treepodia/logos/5-3.png new file mode 100644 index 000000000..fc7e401c6 Binary files /dev/null and b/modules/treepodia/logos/5-3.png differ diff --git a/modules/treepodia/logos/5-4.png b/modules/treepodia/logos/5-4.png new file mode 100644 index 000000000..a03c3c788 Binary files /dev/null and b/modules/treepodia/logos/5-4.png differ diff --git a/modules/treepodia/logos/5-6.png b/modules/treepodia/logos/5-6.png new file mode 100644 index 000000000..7570eaf8e Binary files /dev/null and b/modules/treepodia/logos/5-6.png differ diff --git a/modules/treepodia/logos/5-7.png b/modules/treepodia/logos/5-7.png new file mode 100644 index 000000000..758de0bfb Binary files /dev/null and b/modules/treepodia/logos/5-7.png differ diff --git a/modules/treepodia/logos/5-8.png b/modules/treepodia/logos/5-8.png new file mode 100644 index 000000000..c0385b64f Binary files /dev/null and b/modules/treepodia/logos/5-8.png differ diff --git a/modules/treepodia/logos/7-1-2.png b/modules/treepodia/logos/7-1-2.png new file mode 100644 index 000000000..2e819cc02 Binary files /dev/null and b/modules/treepodia/logos/7-1-2.png differ diff --git a/modules/treepodia/logos/7-1.png b/modules/treepodia/logos/7-1.png new file mode 100644 index 000000000..21d077bab Binary files /dev/null and b/modules/treepodia/logos/7-1.png differ diff --git a/modules/treepodia/logos/7-2-3.png b/modules/treepodia/logos/7-2-3.png new file mode 100644 index 000000000..418aa984a Binary files /dev/null and b/modules/treepodia/logos/7-2-3.png differ diff --git a/modules/treepodia/logos/7-2.png b/modules/treepodia/logos/7-2.png new file mode 100644 index 000000000..5c2128b97 Binary files /dev/null and b/modules/treepodia/logos/7-2.png differ diff --git a/modules/treepodia/logos/7-4.png b/modules/treepodia/logos/7-4.png new file mode 100644 index 000000000..b64727895 Binary files /dev/null and b/modules/treepodia/logos/7-4.png differ diff --git a/modules/treepodia/logos/7-6.png b/modules/treepodia/logos/7-6.png new file mode 100644 index 000000000..daa641759 Binary files /dev/null and b/modules/treepodia/logos/7-6.png differ diff --git a/modules/treepodia/logos/7-7-1.png b/modules/treepodia/logos/7-7-1.png new file mode 100644 index 000000000..80137427e Binary files /dev/null and b/modules/treepodia/logos/7-7-1.png differ diff --git a/modules/treepodia/logos/8-1.png b/modules/treepodia/logos/8-1.png new file mode 100644 index 000000000..382f910a4 Binary files /dev/null and b/modules/treepodia/logos/8-1.png differ diff --git a/modules/treepodia/logos/8-2.png b/modules/treepodia/logos/8-2.png new file mode 100644 index 000000000..1b8cce668 Binary files /dev/null and b/modules/treepodia/logos/8-2.png differ diff --git a/modules/treepodia/logos/8-3.png b/modules/treepodia/logos/8-3.png new file mode 100644 index 000000000..6c4d4f03c Binary files /dev/null and b/modules/treepodia/logos/8-3.png differ diff --git a/modules/treepodia/logos/8-4.png b/modules/treepodia/logos/8-4.png new file mode 100644 index 000000000..12394c6eb Binary files /dev/null and b/modules/treepodia/logos/8-4.png differ diff --git a/modules/treepodia/logos/8-5.png b/modules/treepodia/logos/8-5.png new file mode 100644 index 000000000..caf63a520 Binary files /dev/null and b/modules/treepodia/logos/8-5.png differ diff --git a/modules/treepodia/logos/8-6.png b/modules/treepodia/logos/8-6.png new file mode 100644 index 000000000..1cb097de9 Binary files /dev/null and b/modules/treepodia/logos/8-6.png differ diff --git a/modules/treepodia/logos/8-7.png b/modules/treepodia/logos/8-7.png new file mode 100644 index 000000000..457cf308e Binary files /dev/null and b/modules/treepodia/logos/8-7.png differ diff --git a/modules/treepodia/product.tpl b/modules/treepodia/product.tpl new file mode 100644 index 000000000..dd8413d7c --- /dev/null +++ b/modules/treepodia/product.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
        \ No newline at end of file diff --git a/modules/treepodia/tracking.tpl b/modules/treepodia/tracking.tpl new file mode 100644 index 000000000..89e246dce --- /dev/null +++ b/modules/treepodia/tracking.tpl @@ -0,0 +1,42 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + diff --git a/modules/treepodia/treepodia.js b/modules/treepodia/treepodia.js new file mode 100644 index 000000000..41289aaba --- /dev/null +++ b/modules/treepodia/treepodia.js @@ -0,0 +1,42 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function setPreview(path, name){ + $("#preview-logo").attr("src", path); + $('#trpd_play_logo').val(name); +} + +function toggleSelector() +{ + $('#selector').toggle('fast'); + $('#change-logo').hide(); + return false; +} + +$(document).ready(function() { + $('#change-logo').click(toggleSelector); + $('#selector').hide(); +}); diff --git a/modules/treepodia/treepodia.php b/modules/treepodia/treepodia.php new file mode 100644 index 000000000..e7470113a --- /dev/null +++ b/modules/treepodia/treepodia.php @@ -0,0 +1,822 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class SimpleXMLExtended extends SimpleXMLElement +{ + public function addCData($nodename, $cdata_text) + { + $node = $this->addChild($nodename); + $node = dom_import_simplexml($node); + $no = $node->ownerDocument; + $node->appendChild($no->createCDATASection($cdata_text)); + } +} + +class Treepodia extends Module +{ + private $allowed_extensions = array('.png','.gif','.jpg'); + + function __construct() + { + $this->name = 'treepodia'; + $this->tab = 'front_office_features'; + $this->version = '1.2'; + $this->displayName = 'Treepodia'; + + parent::__construct(); + $this->description = $this->l('Cover your entire catalog with product videos in 24 hours.'); + + if ($this->active && !Configuration::get('TREEPODIA_ACCOUNT_CODE')) + $this->warning = $this->l('You have not set your Treepodia configuration.'); + } + + function install() + { + if (!parent::install()) + return false; + + $this->registerHook('extraLeft'); + $this->registerHook('footer'); + $this->registerHook('orderConfirmation'); + + $token = Configuration::get('TREEPODIA_TOKEN') ? Configuration::get('TREEPODIA_TOKEN') : Tools::passwdGen(16); + $type = Configuration::get('TREEPODIA_INTEGRATION_TYPE') ? Configuration::get('TREEPODIA_INTEGRATION_TYPE') : 0; + $logo = Configuration::get('TREEPODIA_PLAY_LOGO') ? Configuration::get('TREEPODIA_PLAY_LOGO') : '4-7.png'; + $position = Configuration::get('TREEPODIA_POSITION') ? Configuration::get('TREEPODIA_POSITION') : 1; + $hook = Configuration::get('TREEPODIA_HOOK') ? Configuration::get('TREEPODIA_HOOK') : 0; + + Configuration::updateValue('TREEPODIA_TOKEN', $token); + Configuration::updateValue('TREEPODIA_INTEGRATION_TYPE', $type); + Configuration::updateValue('TREEPODIA_PLAY_LOGO', $logo); + Configuration::updateValue('TREEPODIA_POSITION', $position); + Configuration::updateValue('TREEPODIA_HOOK', $hook); + + return true; + } + + private function _getShopURL() + { + return ((Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__; + } + + public function generateXmlFlow() + { + global $cart, $cookie; + $cookie->id_lang = (int)(Configuration::get('PS_LANG_DEFAULT')); // url rewriting case + + $cart = new Cart(); + $link = new Link(); + $defaultCurrencyIsoCode = strtoupper(Db::getInstance()->getValue('SELECT c.iso_code FROM '._DB_PREFIX_.'currency c WHERE c.id_currency = '.(int)(Configuration::get('PS_CURRENCY_DEFAULT')))); + $defaultIdLang = (int)(Configuration::get('PS_LANG_DEFAULT')); + $hasImageLink = method_exists($link, 'getImageLink'); + + $sqlLangs = Db::getInstance()->ExecuteS('SELECT l.id_lang, l.iso_code FROM '._DB_PREFIX_.'lang l'); + + foreach ($sqlLangs AS $sqlLang) + { + $langs[$sqlLang[ 'id_lang' ]] = $sqlLang[ 'iso_code' ] ; + } + + + $xmlString = << + + +XML; + + $products = new SimpleXMLExtended($xmlString); + + $infos = $products->addChild('infos'); + $infos->addCData('url', $this->_getShopURL()); + $infos->addCData('logo', $this->_getShopURL()); + + $languages = Db::getInstance()->ExecuteS(' + SELECT l.iso_code + FROM '._DB_PREFIX_.'lang l + WHERE l.active = 1'); + + foreach ($languages AS $language) + $infos->addChild('lang', $language['iso_code']); + + $sqlProducts = Db::getInstance()->ExecuteS(' + SELECT p.id_product, p.reference, p.weight, m.name manufacturer, s.name supplier, p.on_sale, p.id_manufacturer, pd.id_product_download + FROM '._DB_PREFIX_.'product p + LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) + LEFT JOIN '._DB_PREFIX_.'supplier s ON (s.id_supplier = p.id_supplier) + LEFT JOIN '._DB_PREFIX_.'product_download pd ON (pd.id_product = p.id_product) + WHERE p.active = 1'); + + foreach ($sqlProducts AS $sqlProduct) + { + $id_product = $sqlProduct['id_product'] ; + + $product = $products->addChild('product') ; + $product->addChild('sku', (int)($sqlProduct['id_product'])); + $product->addCData('manufacturer', $sqlProduct['manufacturer']); + if (file_exists(dirname(__FILE__).'/../../img/m/'.(int)($sqlProduct['id_manufacturer']).'jpg')) + $product->addCData('manufacturer-logo', $_SERVER['HTTP_HOST'].__PS_BASE_URI__.'img/m/'.(int)($sqlProduct['id_manufacturer']).'jpg'); + $product->addChild('weight', (float)($sqlProduct['weight'])); + $product->addChild('weight_unit', strtolower(Configuration::get('PS_WEIGHT_UNIT'))); + $product->addCData('supplier', $sqlProduct['supplier']); + $name = $product->addChild('name'); + $languageVariant = $name->addChild('language-variant'); + + $texts = Db::getInstance()->ExecuteS(' + SELECT pl.name, pl.description_short, pl.link_rewrite, l.iso_code, l.id_lang + FROM '._DB_PREFIX_.'product_lang pl + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = pl.id_lang) + WHERE pl.id_product = '.(int)($sqlProduct['id_product'])); + + foreach ($texts AS $text) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $text['iso_code']); + $variant->addCData('value', $text['name']); + if ($text['id_lang'] == $defaultIdLang) + { + $productName = $text['name']; + $productLinkRewrite = $text['link_rewrite']; + } + } + + $product->addCData('page-url', $link->getProductLink((int)($sqlProduct['id_product']), $productLinkRewrite)); + $shortDescription = $product->addChild('short-description'); + $languageVariant = $shortDescription->addChild('language-variant'); + + foreach ($texts AS $text) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $text['iso_code']); + $variant->addCData('value', Tools::htmlentitiesDecodeUTF8(strip_tags($text['description_short']))); + + } + + $accessories = Db::getInstance()->ExecuteS(' + SELECT a.id_product_2 + FROM '._DB_PREFIX_.'accessory a + WHERE a.id_product_1 = '.(int)($sqlProduct['id_product'])); + + foreach ($accessories AS $accessory) + $product->addChild('accessory-sku', (int)($accessory['id_product_2'])); + + $price = $product->addChild('price'); + $price->addChild('currency', $defaultCurrencyIsoCode); + $price->addChild('retail-price-with-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), true, NULL, 6, NULL, false, false)); + $price->addChild('retail-price-without-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), false, NULL, 6, NULL, false, false)); + $price->addChild('final-retail-price-with-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), true)); + $price->addChild('final-retail-price-without-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), false, NULL, 6, NULL, false, true, 1, false, NULL, NULL, NULL, $specificPrice)); + $price->addChild('reduction_percent', ($specificPrice AND $specificPrice['reduction_type'] == 'percentage') ? $specificPrice['reduction'] * 100 : 0.00); + $price->addChild('reduction_price', ($specificPrice AND $specificPrice['reduction_type'] == 'amount') ? (float)($specificPrice['reduction']) : 0.00); + $price->addChild('display-on-sale', (int)($sqlProduct['on_sale'])); + + $product->addChild('downloadable', $sqlProduct['id_product_download'] >= 1 ? 1 : 0); + + $pack = Db::getInstance()->ExecuteS(' + SELECT p.id_product, pp.quantity + FROM '._DB_PREFIX_.'pack pp + LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = pp.id_product_item) + WHERE pp.id_product_pack = '.(int)($sqlProduct['id_product'])); + + if (sizeof($pack)) + { + $pack = $product->addChild('pack'); + foreach ($pack AS $p) + { + $packItem = $pack->addChild('pack-item'); + $packItem->addChild('quantity', (int)($p['quantity'])); + $packItem->addChild('sku', (int)($p['id_product'])); + } + } + + $images = Db::getInstance()->ExecuteS(' + SELECT i.id_image, il.legend, l.iso_code + FROM '._DB_PREFIX_.'image i + LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image) + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = il.id_lang) + WHERE i.id_product = '.(int)($sqlProduct['id_product'])); + + $imagesLegends = array(); + foreach ($images AS $image) + { + $imagesLegends[(int)($image['id_image'])][$image['iso_code']]['legend'] = $image['legend']; + $imagesLegends[(int)($image['id_image'])][$image['iso_code']]['iso_code'] = $image['iso_code']; + } + + $imagesAlreadyDone = array(); + foreach ($images AS $imageSQL) + { + if (isset($imagesAlreadyDone[$imageSQL['id_image']])) + continue; + else + $imagesAlreadyDone[(int)($imageSQL['id_image'])] = 1; + + + global $cookie; + $cookie->id_lang = Configuration::get('PS_LANG_DEFAULT'); + + $image = $product->addChild('image'); + $image->addAttribute('id',$imageSQL['id_image']); + if ($hasImageLink) + $image->addCData('image-url', $link->getImageLink($productLinkRewrite, (int)($sqlProduct['id_product']).'-'.(int)($imageSQL['id_image']), 'large')); + /* For 1.0/1.1 compatibility purpose only */ + else + $image->addCData('image-url', $this->_getImageLink($productLinkRewrite, (int)($sqlProduct['id_product']).'-'.(int)($imageSQL['id_image']), 'large')); + + if (isset($imagesLegends[$imageSQL['id_image']]) AND sizeof($imagesLegends[$imageSQL['id_image']])) + { + $imageCaption = $image->addChild('image-caption'); + $languageVariant = $imageCaption->addChild('language-variant'); + + foreach ($imagesLegends[(int)($imageSQL['id_image'])] AS $legend) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $legend['iso_code']); + $variant->addCData('value', $legend['legend']); + + } + } + } + + $quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)($sqlProduct['id_product']), (int)(Shop::getCurrentShop()), 0, 0, 0); + + foreach ($quantityDiscounts AS $quantityDiscount) + { + $discount = $product->addChild('discount'); + $discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity'])); + $discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100); + $discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%')); + } + + $categories = Db::getInstance()->ExecuteS(' + SELECT cl.name, l.iso_code + FROM '._DB_PREFIX_.'category_product cp + LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = cp.id_category) + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = cl.id_lang) + WHERE cp.id_product = '.(int)($sqlProduct['id_product'])); + + if (sizeof($categories)) + { + $category = $product->addChild('category'); + $languageVariant = $category->addChild('language-variant'); + + foreach ($categories AS $category) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $category['iso_code']); + $variant->addCData('value', $category['name']); + } + } + + $tags = Db::getInstance()->ExecuteS(' + SELECT pt.id_product, pt.id_tag, l.iso_code, t.name + FROM '._DB_PREFIX_.'product_tag pt + LEFT JOIN '._DB_PREFIX_.'tag t ON (t.id_tag = pt.id_tag) + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = t.id_lang) + WHERE pt.id_product = '.(int)($sqlProduct['id_product'])); + + + if (!empty($tags) && sizeof($tags) > 0) + { + $tagsTexts = array(); + $tagsIso = array(); + foreach ($tags AS $tag) + { + if (!in_array($tag['iso_code'], $tagsIso)) + $tagsIso[] = $tag['iso_code']; + + $tagsTexts[$tag['iso_code']][] = $tag['name']; + } + + $tags_item = $product->addChild('tags'); + + foreach ($tagsIso AS $iso) + { + $languageVariant = $tags_item->addChild('language-variant'); + $languageVariant->addChild('locale', $iso); + $languageVariant->addCData('value', implode(',', $tagsTexts[$iso])); + } + } + + $groupAttributes = Db::getInstance()->ExecuteS(' + SELECT DISTINCT agl.id_attribute_group, agl.name, l.iso_code, a.id_attribute, al.name as attribute_name, al.id_lang, pa.id_product_attribute + FROM '._DB_PREFIX_.'attribute_group_lang agl + LEFT JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute_group = agl.id_attribute_group) + LEFT JOIN '._DB_PREFIX_.'attribute_lang al ON (al.id_attribute = a.id_attribute) + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = al.id_lang) + LEFT JOIN '._DB_PREFIX_.'product_attribute_combination pac ON (pac.id_attribute = a.id_attribute) + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product_attribute = pac.id_product_attribute) + WHERE pa.id_product = '.(int)($sqlProduct['id_product']) .' + GROUP BY a.id_attribute, l.iso_code'); + + $groups = array() ; + foreach ($groupAttributes AS $groupAttribute) + { + $id_group_attribute = $groupAttribute[ 'id_attribute_group' ] ; + $id_attribute = $groupAttribute[ 'id_attribute' ] ; + $id_product_attribute = $groupAttribute[ 'id_product_attribute' ] ; + + $groups[$id_group_attribute][ 'name' ][$groupAttribute[ 'iso_code' ]] = $groupAttribute[ 'name' ] ; + $groups[$id_group_attribute][ 'attributes' ][$groupAttribute[ 'id_attribute' ]][$groupAttribute[ 'iso_code' ]] = $groupAttribute[ 'attribute_name' ] ; + } + + if(!empty($groups)) { + foreach ($groups AS $id_group => $group) + { + $xml_group = $product->addChild('attribute-group'); + $xml_group->addAttribute('id', $id_group); + + if(!empty($group[ 'name' ])) { + $nameGroup = $xml_group->addChild('name'); + $languageVariant = $nameGroup->addChild('language-variant'); + + foreach ($group[ 'name' ] AS $iso2 => $name_group) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $iso2); + $variant->addCData('value', $name_group); + } + } + + if(!empty($group[ 'attributes' ])) { + foreach ($group[ 'attributes' ] AS $id_attribute => $attribute) + { + $xml_attribute = $xml_group->addChild('attribute'); + $xml_attribute->addAttribute('id', $id_attribute); + $languageVariant = $xml_attribute->addChild('language-variant'); + + foreach ($attribute AS $iso2 => $name_attribute) + { + $variant = $languageVariant->addChild('variant'); + $variant->addChild('locale', $iso2); + $variant->addCData('value', $name_attribute); + } + } + } + + } + } + + $groupAttributes = Db::getInstance()->ExecuteS(' + SELECT agl.id_attribute_group, agl.name, l.iso_code, a.id_attribute, al.name attribute_name, al.id_lang, pa.id_product_attribute + FROM '._DB_PREFIX_.'attribute_group_lang agl + LEFT JOIN '._DB_PREFIX_.'lang l ON (l.id_lang = agl.id_lang) + LEFT JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute_group = agl.id_attribute_group) + LEFT JOIN '._DB_PREFIX_.'attribute_lang al ON (al.id_attribute = a.id_attribute) + LEFT JOIN '._DB_PREFIX_.'product_attribute_combination pac ON (pac.id_attribute = a.id_attribute) + LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product_attribute = pac.id_product_attribute) + WHERE pa.id_product = '.(int)($sqlProduct['id_product'])); + + $combinaison = array() ; + + foreach ($groupAttributes AS $groupAttribute) + { + $id_group_attribute = $groupAttribute[ 'id_attribute_group' ] ; + $id_attribute = $groupAttribute[ 'id_attribute' ] ; + $id_product_attribute = $groupAttribute[ 'id_product_attribute' ] ; + $combinaison[$id_product_attribute][$id_group_attribute] = $id_attribute ; + } + + $productAttributes = Db::getInstance()->ExecuteS(' + SELECT pa.id_product_attribute, pa.weight, pa.quantity, pi.id_image + FROM '._DB_PREFIX_.'product_attribute pa + LEFT JOIN '._DB_PREFIX_.'product_attribute_image pi ON (pa.id_product_attribute = pi.id_product_attribute) + WHERE pa.id_product = '.(int)($sqlProduct['id_product'])); + + if(!empty($productAttributes)) { + foreach ($productAttributes AS $productAttribute) + { + $id_product_attribute = (int)($productAttribute['id_product_attribute']) ; + + $attributeCombination = $product->addChild('attribute-combination'); + $attributeCombination->addAttribute('id', $id_product_attribute); + $attributeCombination->addChild('weight', (float)($sqlProduct['weight'] + $productAttribute['weight'])); + $attributeCombination->addChild('final-retail-price-with-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), true, $id_product_attribute)); + $attributeCombination->addChild('final-retail-price-without-tax', Product::getPriceStatic((int)($sqlProduct['id_product']), false, $id_product_attribute)); + $attributeCombination->addChild('quantity', $productAttribute['quantity'] ); + + if (isset($productAttribute['id_image']) && !empty($productAttribute['id_image'])) + { + $image = $attributeCombination->addChild('image'); + $image->addAttribute('ref-id', $productAttribute['id_image']); + } + + if( isset($combinaison[$id_product_attribute]) && !empty($combinaison[$id_product_attribute]) ) { + + foreach ($combinaison[$id_product_attribute] AS $id_group_attribute => $id_attribute) + { + $attribute = $attributeCombination->addChild('attribute'); + $attribute->addAttribute('group-ref-id', $id_group_attribute); + $attribute->addAttribute('ref-id', $id_attribute); + } + } + } + } + + } + + echo $products->asXML(); + } + + + private function _displayCSSAndJS() + { + return ' + '; + } + + private function _displayImageSelector() + { + $max_width = 60; + $max_height = 60; + $dir = _PS_MODULE_DIR_.$this->name.'/logos/'; + + $out = '
        '. + $this->l('Select a picture below or upload a new one.').'
        + + +
        '; + + if (is_dir($dir)) { + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + $filename = $dir.$file; + + if (is_file($filename) AND in_array(substr($filename, -4), $this->allowed_extensions)) + { + list($width, $height) = getimagesize($filename); + + if ($width > $height) + { + if ($width > $max_width) + { + $ratio = $width / $max_width; + $width = $max_width; + $height = $height / $ratio; + } + } else { + if ($height > $max_height) + { + $ratio = $height / $max_height; + $height = $max_height; + $width = $width / $ratio; + } + } + + $out .= '
        '; + } + } + + closedir($dh); + } + } + $out .= '
        +
        +
        '; + + return $out; + } + + public function displayForm() + { + global $cookie; + + $lang = new Language((int)($cookie->id_lang)); + + $output = $this->_displayCSSAndJS().'

        '.$this->displayName.'

        + +

        '.$this->l('It is well known that product videos increase sales, customer engagement and loyalty, and enhance your shoppers experience dramatically. They also enhance your shoppers\' overall experience and have a strong positive effect on your search engine visibility.').'. '.$this->l('Learn more').'


        '; + + + $output .= ' +
        + '.$this->l('My Treepodia account').''; + + if (Configuration::get('TREEPODIA_ACCOUNT_CODE') == NULL) + { + $output .= '

        '.$this->l('You are not yet registered for a Treepodia video account. Please register with Treepodia.').'

        +

        +
        '; + + } + else + { + $output .= ' +
        +
        ' + .$this->l('Your video account code uniquely identifies your store and was assigned to you automatically.'). + '

        +

        + '.$this->l('Sign in to your video account to change your preferences, settings and see your business performance reports.').' +

        '; + } + + $output .= '

        '; + + if (Configuration::get('TREEPODIA_ACCOUNT_CODE') != NULL) + { + $output .= ' +
        + '.$this->l('Settings').' +
        + +

        '.$this->l('The built-in integration automatically embeds Treepodia integration code into your store and displays a link to the video on your product page.').'


        +

        '.$this->l('Current logo:').'
        +

        +
        + +
        +

        + + '.$this->_displayImageSelector().' +

        + +
        +

        '.$this->l('Display logo:').'
        + +

        '.$this->l('Place logo here:').'

        +
        '.$this->l('Product picture').'
        + + + +
        +
        +
        + +

        '.$this->l('Use this option if you wish to implement the Treepodia integration code on your own. The built-in integration code will be deactivated if you choose this option.').' '.$this->l('Read here how to implement Treepodia integration code on your own.').'

        +
        + +
        '; + } + + return $output; + } + + public function getContent() + { + + $out = ''; + + if (Tools::isSubmit('submitTreepodia')) + { + $errors = $this->_validateForm(); + + if (empty($errors)) + { + $out .= $this->_postProcess(); + } + else + $out .= $errors; + } + + $out .= $this->displayForm(); + + return $out; + } + + private function _validateForm() + { + $errors = ''; + if (Tools::getValue('trpd_integration_type') != 0 AND Tools::getValue('trpd_integration_type') != 1) + $errors .= $this->displayError('Invalid Integration Type'); + + $file = $_FILES['trpd_logo_file']; + + if ($file AND !empty($file['name'])) + { + if ($file['error']) + { + switch ($file['error']) + { + case 1: + $errors .= $this->displayError('The file is too large.'); + break; + + case 2: + $errors .= $this->displayError('The file is too large.'); + break; + + case 3: + $errors .= $this->displayError('The file was partialy uploaded'); + break; + + case 4: + $errors .= $this->displayError('The file is empty'); + break; + } + } + + if (!in_array(substr($file['name'], -4), $this->allowed_extensions)) + $errors .= $this->displayError($this->l('Invalid file type')); + } else { + if (!is_file(_PS_MODULE_DIR_.$this->name.'/logos/'.Tools::getValue('trpd_play_logo'))) + $errors .= $this->displayError('Invalid logo'); + } + + return $errors; + } + + private function _postProcess() + { + Configuration::updateValue('TREEPODIA_INTEGRATION_TYPE', (int)(Tools::getValue('trpd_integration_type'))); + + $position = Tools::getValue('trpd_position'); + if ($position < 0 || $position > 2) $position = 0; + + Configuration::updateValue('TREEPODIA_POSITION', $position); + + $file = $_FILES['trpd_logo_file']; + if ($file AND $file['name']) + { + $name = time().'-'.$_FILES['trpd_logo_file']['name']; + move_uploaded_file($_FILES['trpd_logo_file']['tmp_name'], _PS_MODULE_DIR_.$this->name.'/logos/'.$name); + Configuration::updateValue('TREEPODIA_PLAY_LOGO', $name); + } + else + Configuration::updateValue('TREEPODIA_PLAY_LOGO', Tools::getValue('trpd_play_logo')); + + $this->_sendUpdate(); + + if (Tools::getValue('trpd_hook_position') == 0) + { + Configuration::updateValue('TREEPODIA_HOOK', 0); + $this->unregisterHook(Hook::get('productFooter')); + $this->registerHook('extraLeft'); + } else { + Configuration::updateValue('TREEPODIA_HOOK', 1); + $this->unregisterHook(Hook::get('extraLeft')); + $this->registerHook('productFooter'); + } + + $dataSync = ''; + + return $this->displayConfirmation($this->l('Settings updated').$dataSync); + } + + private function _sendUpdate() + { + $host = 'www.treepodia.com'; + $uri = '/prestashop/api/account-settings-set'; + + if (!ini_get('allow_url_fopen')) + return false; + + $socket = fsockopen('ssl://'.$host, 443, $errno, $errstr, 30); + + if ($socket) + { + $params = 'prestashop-api='._PS_BASE_URL_._MODULE_DIR_.$this->name.'/api'. + '&account-code='.Configuration::get('TREEPODIA_ACCOUNT_CODE'). + '&integration='.(Configuration::get('TREEPODIA_INTEGRATION_TYPE') == 0 ? 'built-in' : 'custom'). + '&watch-video-image-url='._PS_BASE_URL_._MODULE_DIR_.$this->name.'/logos/'.Configuration::get('TREEPODIA_PLAY_LOGO'). + '&watch-video-image-location=top-left'; + + $header = 'GET '.$uri.'?'.$params.' HTTP/1.1'."\r\n"; + $header .= 'Host: '.$host."\r\n"; + $header .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; + $header .= 'Content-Length: '.strlen($params)."\r\n". + $header .= 'Connection: Close'."\r\n\r\n"; + + fputs($socket, $header.$params); + + $result = ''; + while (!feof($socket)) + { + $result .= trim(fgets($socket, 1024)); + } + + fclose($socket); + } + + } + + private function _isAccountCode($accountCode) + { + return ereg('^[A-Z]+[0-9]+$', $accountCode); + } + + public function hookExtraLeft($params) + { + global $smarty; + + if (!Configuration::get('TREEPODIA_ACCOUNT_CODE') OR Configuration::get('TREEPODIA_INTEGRATION_TYPE') != 0) + return ''; + + switch(Configuration::get('TREEPODIA_POSITION')) + { + case 0: + $position = 'left'; + break; + case 1: + $position = 'center'; + break; + case 2: + $position = 'right'; + break; + default: + $position = 'left'; + } + + $smarty->assign(array('position' => $position, 'img_src' => _MODULE_DIR_.$this->name.'/logos/'.Configuration::get('TREEPODIA_PLAY_LOGO'))); + return $this->display(__FILE__, 'product.tpl'); + } + + public function hookProductFooter($params) + { + return $this->hookExtraLeft($params); + } + + + public function hookFooter($params) + { + global $smarty; + + $id_product = Tools::getValue('id_product'); + if (!Configuration::get('TREEPODIA_ACCOUNT_CODE') OR Configuration::get('TREEPODIA_INTEGRATION_TYPE') != 0) + return ''; + + if (!empty($id_product)) + { + $smarty->assign(array('account_id' => Configuration::get('TREEPODIA_ACCOUNT_CODE'), + 'product_sku' => (int)($id_product))); + + return $this->display(__FILE__, 'footer.tpl'); + } + } + + public function hookProductDescription($params) + { + return $this->hookExtraLeft($params); + } + + /* For 1.0/1.1 compatibility purpose only */ + private function _getImageLink($name, $ids, $type = null) + { + return ($this->allow == 1) ? (__PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg'); + } + + + public function hookOrderConfirmation($params) + { + $order = $params['objOrder']; + $products = $order->getProducts(); + + global $smarty; + + $smarty->assign(array('account_id' => Configuration::get('TREEPODIA_ACCOUNT_CODE'), 'products' => $products)); + + return $this->display(__FILE__, 'tracking.tpl'); + } +} + diff --git a/modules/treepodia/video-sitemap.php b/modules/treepodia/video-sitemap.php new file mode 100644 index 000000000..1187088a9 --- /dev/null +++ b/modules/treepodia/video-sitemap.php @@ -0,0 +1,6 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class RatingAlert +{ + const TABLE_NAME = 'ts_rating_alert'; + const MAIL_TEMPLATE = 'rating_email'; + + public static function save($id_order) + { + Db::getInstance()->AutoExecute(_DB_PREFIX_.self::TABLE_NAME, array('id_order' => (int)($id_order)), 'INSERT'); + } + + private static function _getAlertsInformations($nb_days = 10) + { + return Db::getInstance()->ExecuteS(' + SELECT a.id_alert, c.`email`, o.`id_order`, o.`id_lang` + FROM `'._DB_PREFIX_.self::TABLE_NAME.'` a + LEFT JOIN '._DB_PREFIX_.'orders o ON (a.id_order = o.id_order) + LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = o.id_customer) + WHERE DATE_ADD(o.`date_add`, INTERVAL '.(int)($nb_days).' DAY) <= NOW()'); + } + + public static function removeAlerts($ids) + { + $to_remove = array(); + foreach ($ids AS $id) + $to_remove[] = (int)($id); + + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_alert` IN (\''.implode('\',\'', $to_remove).'\')'); + } + + public static function executeCronTask() + { + global $cookie; + if (!Configuration::get('TS_SEND_SEPERATE_MAIL')) + return true; + + $to_remove = array(); + $alerts_infos = RatingAlert::_getAlertsInformations((int)(Configuration::get('TS_SEND_SEPERATE_MAIL_DELAY'))); + + $ts_module = new TrustedShops(); + + foreach ($alerts_infos AS $infos) + { + $cookie->id_lang = $infos['id_lang']; + $subject = $ts_module->getL('title_part_1').' '.Configuration::get('PS_SHOP_NAME').$ts_module->getL('title_part_2'); + $template_vars = array('{ts_id}' => Configuration::get('TS_ID_'.(int)($infos['id_lang'])), + '{button_url}' => TrustedShops::getHttpHost(true, true)._MODULE_DIR_.$ts_module->name.'/img', + '{rating_url}' => $ts_module->getRatingUrlWithBuyerEmail($infos['id_lang'], $infos['id_order'], $infos['email'])); + + $result = Mail::Send((int)($infos['id_lang']), self::MAIL_TEMPLATE, $subject, $template_vars, $infos['email'], NULL, Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'); + + if ($result) + $to_remove[] = (int)($infos['id_alert']); + } + + if (sizeof($to_remove) > 0) + self::removeAlerts($to_remove); + + return (sizeof($to_remove) == sizeof($alerts_infos)); + } + + public static function createTable() + { + return Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'` ( + `id_alert` INT NOT NULL AUTO_INCREMENT, + `id_order` INT NOT NULL, + PRIMARY KEY (`id_alert`), + UNIQUE KEY `id_order` (`id_order`) + ) ENGINE = '._MYSQL_ENGINE_); + } + + public static function dropTable() + { + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } + + public static function truncateTable() + { + return Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } +} + diff --git a/modules/trustedshops/TrustedShopsSoapApi.php b/modules/trustedshops/TrustedShopsSoapApi.php new file mode 100644 index 000000000..4d887da00 --- /dev/null +++ b/modules/trustedshops/TrustedShopsSoapApi.php @@ -0,0 +1,71 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TrustedShopsSoapApi +{ + const TS_SERVER = 'www.trustedshops.de'; + const WS_USER = 'presta-shopsoftware'; + const WS_PASSWORD = 'Yx1F5uXR'; + + const ACTIVATE = 1; + const DESACTIVATE = 0; + + const RT_OK = 'OK'; + const RT_SOAP_ERROR = -1; + const RT_INVALID_TSID = 'INVALID_TSID'; + const RT_NOT_REGISTERED = 'NOT_REGISTERED_FOR_TRUSTEDRATING'; + const RT_WRONG_LOGIN = 'WRONG_WSUSERNAME_WSPASSWORD'; + + + public static function validate($partener_package, $trusted_shops_id, $action = self::ACTIVATE) + { + $ini = ini_set('soap.wsdl_cache_enabled', 1); + $result = self::RT_SOAP_ERROR; + + try + { + $wsdlUrl = 'https://'.self::TS_SERVER.'/ts/services/TsRating?wsdl'; + $client = new SoapClient($wsdlUrl); + + $result = $client->updateRatingWidgetState($trusted_shops_id, $action, self::WS_USER, self::WS_PASSWORD, $partener_package); + } + catch(SoapFault $fault) + { + $errorText = 'SOAP Fault: (faultcode:{$fault->faultcode}, faultstring:{$fault->faultstring})'; + + /** Enable this line if you are experiencing issues with your Trusted Shops ID activation. + die($errorText); + */ + } + + if ($result == self::RT_WRONG_LOGIN) + die('Wrong login/password'); + + return $result; + } +} + diff --git a/modules/trustedshops/WidgetCache.php b/modules/trustedshops/WidgetCache.php new file mode 100644 index 000000000..5c52e266f --- /dev/null +++ b/modules/trustedshops/WidgetCache.php @@ -0,0 +1,52 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class WidgetCache +{ + private $_fileName; + private $__ts_id; + + public function __construct($_fileName, $_ts_id) + { + $this->_fileName = $_fileName; + $this->_ts_id = $_ts_id; + } + + public function isFresh($timeout = 10800) + { + if (file_exists($this->_fileName)) + return ((time() - filemtime($this->_fileName)) < $timeout); + else + return false; + } + + public function refresh() + { + return file_put_contents($this->_fileName, file_get_contents('https://www.trustedshops.com/bewertung/widget/widgets/'.$this->_ts_id.'.gif')); + } +} + diff --git a/modules/trustedshops/config.xml b/modules/trustedshops/config.xml new file mode 100755 index 000000000..c8d9ac677 --- /dev/null +++ b/modules/trustedshops/config.xml @@ -0,0 +1,13 @@ + + + trustedshops + Trusted Shops Customer Rating + 1.1 + Boost consumer confidence and turn more shoppers into buyers. + + payment_security + Are you sure you want to delete all your settings? + 1 + 1 + + \ No newline at end of file diff --git a/modules/trustedshops/cron.php b/modules/trustedshops/cron.php new file mode 100644 index 000000000..53d4352f0 --- /dev/null +++ b/modules/trustedshops/cron.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__) .'/trustedshops.php'); + +if (isset($_GET['secure_key']) AND Configuration::get('PS_TS_SECURE_KEY') == $_GET['secure_key']) + RatingAlert::executeCronTask(); + diff --git a/modules/trustedshops/cron_garantee.php b/modules/trustedshops/cron_garantee.php new file mode 100644 index 000000000..804acc5b1 --- /dev/null +++ b/modules/trustedshops/cron_garantee.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +include(dirname(__FILE__) .'/trustedshops.php'); + +$ts_module = new TrustedShops(); +TSBuyerProtection::setTranslationObject($ts_module); +$bp = new TSBuyerProtection(); +$bp->setModuleName($ts_module->name); +$bp->cronTask(); \ No newline at end of file diff --git a/modules/trustedshops/de.php b/modules/trustedshops/de.php new file mode 100644 index 000000000..1fdb791a2 --- /dev/null +++ b/modules/trustedshops/de.php @@ -0,0 +1,172 @@ +display_products_02ecb4a4709d9bcc590f1a25fc82c0e2'] = 'Trusted Shops Käuferschutz (empfohlen)'; +$_MODULE['<{trustedshops}prestashop>display_products_b55aab8932a39ca85bb0a1b6eb83f83f'] = 'Käuferschutz ab'; +$_MODULE['<{trustedshops}prestashop>display_products_b3c25d2f94cf87ece3dbb2907318520c'] = 'Die im Käuferschutz enthaltene Trusted Shops Garantie sichert Ihren Online-Kauf ab. Mit der Übermittlung und'; +$_MODULE['<{trustedshops}prestashop>display_products_536a056b710e94b16169efd17a4a657b'] = 'Speicherung'; +$_MODULE['<{trustedshops}prestashop>display_products_2dc4be4d5564180e6df95d5a5a679195'] = 'meiner E-Mail-Adresse zur Abwicklung des Käuferschutzes durch Trusted Shops bin ich einverstanden.'; +$_MODULE['<{trustedshops}prestashop>display_products_229eb04083e06f419f9ac494329f957d'] = 'für den Käuferschutz.'; +$_MODULE['<{trustedshops}prestashop>display_products_4ccaceceffe4b5e58f6a7a7ed3ced4c4'] = 'Garantiebedingungen'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_7b5406da2d5f15923d6b01d3264c5619'] = 'Trusted Shops Gütesiegel - Bitte hier Gültigkeit prüfen!'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_4052048c767f22e9071c3e6f404d00c6'] = 'Als zusätzlichen Service bieten wir Ihnen den Trusted Shops Käuferschutz an. Wir übernehmen alle Kosten dieser Garantie, Sie müssen sich lediglich anmelden.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_f975f42362625cf21e592009ff4b3d7b'] = 'Anmeldung zum Trusted Shops Käuferschutz'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_ee9ae315b086e1b1a0c8fdc6078f9add'] = 'Trusted Shops Gütesiegel - Bitte hier Gültigkeit prüfen!'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_750bea678eeb1d07f21fe86173288e2e'] = 'Testzertifikat für Shopsystempartner DE trägt das Trusted Shops Zertifikat mit Käuferschutz. Mehr...'; +$_MODULE['<{trustedshops}prestashop>trustedshops_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Dieses Modul erfordert die SOAP-PHP-Erweiterung, um ordnungsgemäß zu funktionieren.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Kundenbeurteilung'; +$_MODULE['<{trustedshops}prestashop>trustedshops_eeae17826fa637ecca0344165514ab4e'] = 'Stärken Sie das Vertrauen der Verbraucher und machen Sie mehr Shopper zu Käufer'; +$_MODULE['<{trustedshops}prestashop>trustedshops_968e0f78caa7d3245c8f6f858de993d8'] = 'Sie sind sicher, dass Sie alle Ihre Einstellungen löschen möchten?'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_79fc246c2b70963d27ebb0e9ebaab349'] = 'Bitte kontaktieren Sie Trusted Shops unter service@trustedshops.de'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_de14ce5aee772cd0330819c0ecf76adb'] = 'Benutzername oder Kennwort sind ungültig.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_43048f232a4ebab67835c425a1113b29'] = 'Der Kreditrahmen bei Trusted Shops wurde aufgehoben.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_eb601fb44b908fec1ee41383d4d948ac'] = 'Kein Kreditrahmen bei Trusted Shops verfügbar.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_cb71cc86f5c38200b3821adb49966522'] = 'Die Daten konnten nicht gespeichert werden.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_07ff7715e67826fb7d9af1d2d1d30e46'] = 'Ein Fehler ist aufgetreten.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5fb7a36c0bdf3cde4f3e038a0eff2b6f'] = 'Web-Service-Anmeldung oder TS-ID ungültig'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_b515cf9cc8234bf6413ed84f5cde066a'] = 'Das Kreditlimit des Shops wurde von Trusted Shops aufgehoben'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_6453e3467d4c087afbfd33d4013cd3e9'] = 'Bestellnummer bereits vergeben'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_8100f51dcd57174e15ef0c3b3456e3ca'] = 'Produkt ohne Käuferschutz-Unterstützung '; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f9e1392429699e6921d775ca98660faa'] = 'Inaktive Zahlungsmethode'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_1dbec1039be7b747704bde7acddca451'] = 'Nicht unterstützte Zahlungsmethode'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_53cf8eb9e9cb36a367ba553b30cac77a'] = 'Die Währung des Käuferschutz- Produkts stimmt nicht mit der Währung des Warenkorbs überein'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ad1407fbd2b8c75e47b9c15a976c4d2'] = 'Diese Währung wird in diesem Shop nicht unterstützt'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_74d27ae48e301b6bbf9bba911a3037e3'] = 'Dieser Wechselkurs wird nicht unterstützt'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_02a4ecbbc2d936231663c1b3255ba137'] = 'Diese Zahlungsmethode wird nicht unterstützt'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f8c4826b4580a3f2e9786ac6bc5c8635'] = 'Kein Kreditlimit für dieses Zertifikat zur Verfügung'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f1b7a6cab6562707aea970971edba9c4'] = 'Der Liefertermin liegt in der Vergangenheit'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_93dff7e30cdf7dec5572f192c774f5ca'] = 'Die Garantie gilt für einen Kauf, der vor mehr als 3 Tagen gemacht wurde'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_138ed5814f1b04d3c44fe4975acdeefc'] = 'Die Email-Adresse enthält einen Fehler'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5eded1b4097ea8e9bd12bb35fe57b6b1'] = 'Es wurde keine Bestellnummer zugewiesen'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5b8230d466534f0cf347188d78c0b248'] = 'Es wurde keine Kundennummer zugewiesen'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ace4c2d63acb0eb87071efea55be813'] = 'Das Kreditlimit für dieses Zertifikat wurde überschritten'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_35caaf4f25a287580302c851d88a29dc'] = 'Es wurde keine E-Mail-Adresse zugewiesen'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_0db21cf8f0a16321cda7a2e9e37850c7'] = 'Nicht anwendbares Käuferschutz-Produkt'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_db26e10564e958809d798e8048fcbc0a'] = 'Ungültige Sicherheitstoken'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_36cd72871a0f3dac493a38f5d82f7441'] = 'Allgemeiner Systemfehler, wenden Sie sich bitte an Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fed85cfada8f3bbc5ad9eb128227210a'] = 'Lastschrift'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_73a61696f100b3858511e212a3feea6b'] = 'Kreditkarte'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_466eadd40b3c10580e3ab4e8061161ce'] = 'Rechnung'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_22d2c7f90dc862df71ac7aff95183fb2'] = 'Nachnahme'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1ff8e518d6a560568fbf66f01e9eb937'] = 'Vorauskasse'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Scheck'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3deb0a4146e33809942e46416fb60228'] = 'Paybox'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4761b2212f04e7409afa7f8103d6fc60'] = 'Zahlung bei Abholung'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_917709346cd3cefd00e463f65f1a55d8'] = 'Finanzierung'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9e6689415e7e5aa4d42d1f2abc78726c'] = 'Leasing'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1c9f173da9bf497cffc19357ab04a8e8'] = 'T-Pay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_369b94cdb6bac25435d00d04255de1ab'] = 'Click&Buy'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_31911306551723245e7417ae4520fecb'] = 'Giropay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_982830b027a279fdc4b4b7993f65498f'] = 'Zahlungskarte des Online Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e1795d054242cf7c546c1491a7c467d'] = 'sofortüberweisung.de'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_37554cc43c645833d6713b9cddda909b'] = 'moneybookers.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9203aec73d2ea1770f66f065c4069816'] = 'Andere Zahlungsart'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_068ce643ff39bf2189935d14736fd10b'] = 'Gütesiegel und Käuferschutz'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f51dabfce0c8ccc01734ed38d8afe27a'] = 'JSON Funktionen müssen in Ihrer PHP-Version implementiert sein'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b1801eaadecfddd04529313a1e929262'] = 'Das Zertifikat ist gültig'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ce323cb3453812434f9abc007ba7a952'] = 'Das Zertifikat ist abgelaufen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98121ffd0d2a0b4bed569a726632f402'] = 'Das Zertifikat wurde deaktiviert'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3ec2499357b45a38139485b2b824aa4c'] = 'Der Shop ist derzeit zertifiziert'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a8fcbddffdaccc6daa529aa9c38d82df'] = 'Kein Zertifikat wurde der Trusted Shops-ID zugewiesen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5abbd73fc5189212c57adfb43adac459'] = 'Testzertifikat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eaf4354c3a17f478859421ac2e33a975'] = 'Code Nr.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d9fd9cab8b813e70e20c615abf036307'] = 'Nachricht:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_109715467b74bd66639faa5673f707c1'] = 'Unbekannter Fehler.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d4eb1e83b0ea3af3e2b8a6e7b7984d9c'] = 'Das Feld % ist falsch, stellen Sie bitte sicher, dass es richtig ausgefüllt war.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c230eb5eefd15fa219ff97d42e461a7d'] = 'Einige Parameter beim Senden an die \"requestForProtectionV2\"-Methode sind falsch oder fehlen.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b656f5f53cf7ee9bbfe7452685f71e30'] = 'Trusted Shops API sendet einen Fehler zur Anwendung Nr. zurück'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_77efb7bc0be02351991cba2102bb0656'] = 'Trusted Shops Anwendungsnummer %1$d wurde erfolgreich verarbeitet. Die Garantienummer lautet: %2$d'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd511061055fcb2d10d31a51be3539d0'] = 'Anmelde-Link '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_de5536f42490f11e92ad1c20d999fd15'] = 'Hier klicken, um den Anmelde-Link zu erhalten'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_56405fbe18e269145ebe3f7232f11be6'] = 'Anmelde-Link wurde erstellt. Folgen Sie diesem Link, wenn Sie vorher nicht weitergeleitet wurden.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c80549181fa4baa695cd054b6dd21c49'] = 'Produkt wurde nicht gespeichert.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_76044a7414d56c702b0134907e1a3ccd'] = 'Das Zertifikat wurde richtig hinzugefügt.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e7177d7660bfff10363700311b0016d'] = 'Sie müssen die Zertifikate nacheinander bearbeiten oder löschen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_259060bb469ed1256c2e758e32da126f'] = 'Das Zertifikat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8512ae7d57b1396273f76fe6ed341a23'] = 'Sprache'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7ea4ac740662d2427d1ef1f2695206d'] = 'wurde korrekt gelöscht'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3fb2ea84b90d4ea9fab48ea356a2319b'] = 'Zertifikats-Login wurde richtig hinzugefügt.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e32263743aac776e5e32fc385d8b669a'] = 'Trusted Shops ist das bekannte Internet-Gütesiegel für Online-Shops mit Käuferschutz für Ihre Kunden. Bei einer Zertifizierung wird Ihr Shop umfassenden Tests unterzogen. Diese Prüfung mit mehr als 100 Einzelkriterien orientiert sich an den Forderungen von Verbraucherschützern sowie dem nationalen und europäischen Recht.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2c786e15a571a442adf85460e6358883'] = 'Mehr Umsatz durch mehr Vertrauen!'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e06f60bb083e167516a94aafd5a3a2e2'] = 'Das Trusted Shops Gütesiegel ist optimal, um das Vertrauen Ihrer Online-Kunden zu steigern. Vertrauen steigert die Bereitschaft Ihrer Kunden, bei Ihnen einzukaufen.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8dd66ca6788218bd7d2ba7fe43c34f63'] = 'Weniger Kaufabbrüche'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_26286e2764ccde55c99d1b258315aa1a'] = 'Sie bieten Ihren Online-Kunden ein starkes Argument: Den Trusted Shops Käuferschutz. Durch diese zusätzliche Sicherheit werden weniger Einkäufe abgebrochen.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_710142158c105c01ef807ce959cbc451'] = 'Ertragreiche und nachhaltige Kundenbeziehung'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7e15d97ad927ef705de61e787883ada'] = 'Das Trusted Shops Gütesiegel mit Käuferschutz ist für viele Online-Shopper ein nachhaltiges Qualitätsmerkmal für sicheres Einkaufen im Internet. Aus Einmalkäufern werden Stammkunden.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc62561dd8d390e274487516e869fc93'] = 'Den Anmelde-Link erhalten'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c93149208b3885248b960eb22e6ba49'] = 'Diese Variable wurde Ihnen per E-Mail von TrustedShops zugesendet'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_233a96df2f68dbeafaa3126edadc1ce8'] = 'Interne Identifizierung der Shop-Software bei Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_261720a5c993fb1cfad560d874d06254'] = 'Etracker-Kanal'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_02977dc4b8561c8d7312b1931782c36b'] = 'Etracker-Kampagne'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4994a8ffeba4ac3140beb89e8d41f174'] = 'Sprache'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2541d938b0a58946090d7abdde0d3890'] = 'senden'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_72ca0dcf49befb037f8d4734ee0a2a1c'] = 'Trusted Shops Zertifikat hinzufügen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_48e31908bfdcda34b0f01cad9d7077af'] = 'Neues Zertifikat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_75904cf055527a97739601e0f5ff7e51'] = 'Hinzufügen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_566853604b7330b3adbb9105cb15e96b'] = 'Trusted Shops Zertifikate verwalten'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eb0f48a107df1a0f343d4cd513b555e6'] = 'Zertifikat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_46a2a41cc6e552044816a2d04634545d'] = 'Status'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Typ'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Shop URL'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7dce122004969d56ae2e0245cb754d35'] = 'bearbeiten'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97bd7efe2f4d953cc0b77a25ff053d97'] = 'Login oder Kennwort fehlt'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_10b5f8531f2b6a3f6d8abad45024bbea'] = 'nicht nötig'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c697646774e5acf5c5864b6819e82b5'] = 'Zertifikat bearbeiten'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f8c823f9ba0a86ceaa8d3ea7e688595d'] = 'Zertifikats-ID'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_92f1b1481fa6ff46c4a3caae78354dab'] = 'Benutzernamen'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc647eb65e6711e155375218212b3964'] = 'Kennwort'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_89c26d1f2de72a1e78d0ae7a7b83880c'] = 'Zu bearbeitende Zahlungsart '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_23a58bf9274bedb19375e527a0744fa9'] = 'mit'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd5291d7f0624933870702ff183bb14e'] = 'Zahlungsmodul'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b3b1a406e097bc87c8745db26e11904e'] = 'Aktualisieren'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c9ba5f6e6d58162530424afaa68bf496'] = 'Cronjob-Konfiguration'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9a82b12b4b1fe9b34ce7c2952f0284d2'] = 'Sie müssen eine cron-Aufgabe auf Ihrem Server einrichten, der mit Ihrem EXCELLENT Zertifikat arbeitet.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c17d7635f5ee99ee25f7f2cc9a672c74'] = 'Die Datei, die Sie aufrufen müssen:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a3c2818ac0ecfe9beff0973388eedd69'] = 'Trusted Shops empfiehlt, dass die Anfrage alle 10Minuten von einem Cronjob automatisch ausgeführt wird.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_94f97da736a5f5f2fd137fa0fc7c2482'] = 'Die Trusted Shops Käuferschutz benötigt ein Login, umerfolgreich abzulaufen. Bitte kontaktieren Sie den Shop-Administrator.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9d36bad327b052a9bdec7003f95ce4bd'] = 'Es ist ein Problem mit Ihrer Sprache aufgetreten:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_03e9e3ceaf5769311c57b5903a958e94'] = 'Ein Käufer kann nicht mehrere Käuferschutz-Produkte kaufen.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_be660f2416cf9cb86913ab902886928c'] = 'Sie erhalten eine Mail von Trusted Shops mit Ihrer Garantienummer.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c006c102f7e2ffef1f7c1808d5e0e54a'] = 'Kundenbeurteilung'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b20a16afda98421bbf7457ccfa50e311'] = 'Dieses Modul benötigt Schreib-und Leserechte auf dem Modul Cache-Verzeichnis.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Dieses Modul erfordert die SOAP-PHP-Erweiterung, um ordnungsgemäß zu funktionieren.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_1097e2b0ee70e248749f0d0a9292df56'] = 'Ungültige Trusted Shops-ID'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_086dbc83aa6b78fa9a234d264ba5808a'] = 'Ungültige Frist'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_24bbca53f91f119c930d147557a4e997'] = 'Bitte melden Sie sich an'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_6c92285fa6d3e827b198d120ea3ac674'] = 'hier'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9ad6278cff9ee53a9970b3a9ecc00a5c'] = 'oder wenden Sie sich an service@trustedshops.co.uk.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b4fc8e4eaf37aa936859367ad7c642ca'] = 'Kundenbeurteilung ist noch nicht für diese Trusted Shops-ID aktiviert'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8db5bd2272b51b3525ad7661c10d8b2b'] = 'Ein Fehler ist aufgetreten'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Aktiv'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_eeb41070f0552af9f1339ed58da237fb'] = 'Inaktiv, bis Sie Ihre Trusted Shops-ID angeben'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9eb274fb901206f4fc8345a787443269'] = 'Achtung, alle vorhandenen Bewertungsnachrichten werden gelöscht'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2a94082b582d0620bae922fc14c36444'] = 'Grundeinstellungen'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_e66ff458a8281bc8983ef58f991accb0'] = 'Bitte füllen Sie Ihre Trusted Shops-ID aus (eine ID pro Sprache):'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9dc0b7bdd32d5e30f4d71eb5abb6b8d4'] = 'Einstellungen anzeigen'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b30cb94d482485bf0bf7015520ffb557'] = 'Trickfenster im Shop anzeigen'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_75a1b325a14f20c2cbb97061d1340451'] = 'Bewertungs-Link im Shop-Frontend anzeigen '; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ab2ededbdea4f61279ec75b5777d39a0'] = 'Bewertungs-Link auf Bestellungsbestätigungsseite anzeigen'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8c9da127717bedb90821f29c6de12ce7'] = 'Bewertungs-Link in separater E-Mail senden'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_d344c0ebc1a11797405e4115a8260deb'] = 'Senden Sie die E-Mail nach'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_44fdec47036f482b68b748f9d786801b'] = 'Tagen'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9013b630235e2a5c48b7357e23e1bd2f'] = 'WICHTIG:'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ed8b925eb242d6a40ff29ec1a5141b3'] = 'Setzen Sie diese URL in die Crontab oder rufen Sie sie täglich manuell auf:'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_f5395c9793af8a11b406ca7c1ac70da9'] = 'Mehr dazu'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Kundenbeurteilung'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_5b91fe21d207317c7c9fad225a7ce442'] = 'Für Online-Käufer sind positive und überprüfbare Kundenbewertungen ein wichtiges Indiz für die Vertrauenswürdigkeit eines Online-Shops. Die benötigte Software ist bereits in Prestashop enthalten, damit können Sie auch Kundenbewertungen in Ihrem Online-Shop sammeln. Die Integration ist einfach mit nur wenigen Mausklicks zu bewältigen.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c81bc534bc261e4107a5c30257fb5ba4'] = 'Unterstützung bei der Orientierung für Ihre Kunden'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ec1bfc4d5646681a86038f770be8fd0b'] = 'Zufriedene Kunden sind Ihre besten Vertriebsmitarbeiter. Lassen Sie Ihre Kunden selbst berichten, wie einfach und sicher die Online-Einkäufe in Ihrem Shop sind.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_866a520be0de10a4fc8958a9e89126c3'] = 'Grundlage für die Shop-Optimierung'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9c6dfeed0caab43f7ff0f6bbd19b27dd'] = 'Ihre Kunden sind Ihnen gerne bei der Optimierung Ihres Shops mit ihrem Feedback behilflich. Schließlich sind Ihre Kunden umso zufriedener, je besser Ihr Online-Shop läuft.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0fac19c0cc6e205682dd52d61dd5a0a2'] = 'Erhöhen Sie die Erreichbarkeit über Facebook, Twitter und Google'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_afe906fe9448ed1b480b3eec383461de'] = 'Ihre Kunden verbreiten Testberichte und Bewertungen auf Facebook und Twitter direkt unter Freunden und Anhängern. Bewertungen werden automatisch im Google-Index aufgeführt und in Google Shopping angezeigt.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_273769f3a3d91979bfdb5ca4909c517a'] = 'Melden Sie sich bei Trusted Shops Kundenbeurteilung an'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ab78702e34e81e82ca61847300b1618'] = 'Sind Sie zufrieden mit'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_a11109fe93f6dc4637e5b039651a4fdb'] = '? Bitte schreiben Sie eine Beurteilung!'; diff --git a/modules/trustedshops/display_products.tpl b/modules/trustedshops/display_products.tpl new file mode 100644 index 000000000..ccd2833ee --- /dev/null +++ b/modules/trustedshops/display_products.tpl @@ -0,0 +1,85 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +
        +

        {l s='Trusted Shops Buyer Protection (recommended)' mod='trustedshops'}

        +
        + logo +
        +
        + {foreach from=$buyer_protection_items item=product} +

        {l s='Buyer protection from' mod='trustedshops'} {$product.protected_amount_decimal} ({$product.gross_fee|round:2} {l s='GBP incl. VAT' mod='trustedshops'})

        + {/foreach} +
        +

        {l s='The Trusted Shops Buyer Protection secures your online purchase. I agree to my email address being transferred and' mod='trustedshops'} {l s='saved' mod='trustedshops'} {l s='for the purposes of Buyer Protection processing by Trusted Shops.' mod='trustedshops'}{l s='Conditions' mod='trustedshops'}: {l s='for Buyer Protection.' mod='trustedshops'}

        +
        +
        +
        diff --git a/modules/trustedshops/es.php b/modules/trustedshops/es.php new file mode 100644 index 000000000..4218fc954 --- /dev/null +++ b/modules/trustedshops/es.php @@ -0,0 +1,173 @@ +display_products_02ecb4a4709d9bcc590f1a25fc82c0e2'] = 'Trusted Shops protección comprador (recomendado)'; +$_MODULE['<{trustedshops}prestashop>display_products_b55aab8932a39ca85bb0a1b6eb83f83f'] = 'Protección comprador hasta'; +$_MODULE['<{trustedshops}prestashop>display_products_bc500dd033a84b00ffd9f81a8a9d5372'] = 'durante'; +$_MODULE['<{trustedshops}prestashop>display_products_44fdec47036f482b68b748f9d786801b'] = 'días'; +$_MODULE['<{trustedshops}prestashop>display_products_ee430460ed8c2e7099df4947287e65c6'] = 'La protección comprador Trusted Shop hace que su compra en línea sea segura. Acepto que Trusted Shopss transfiera y guarde mi dirección email para el tratamiento de la protección comprador. Condiciones para la protección comprador. '; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_7b5406da2d5f15923d6b01d3264c5619'] = 'Cuño Trusted Shops- Pulse aquí para comprobar'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_4052048c767f22e9071c3e6f404d00c6'] = 'Como miembro de Trusted Shops, le ofrecemos un servicio complementario excepcional: la garantía de reembolso Trusted Shops. '; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_f975f42362625cf21e592009ff4b3d7b'] = 'Inscríbase para obtener la garantía de reembolso de Trusted Shops. '; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_ee9ae315b086e1b1a0c8fdc6078f9add'] = 'Cuño Trusted Shops- Pulse aquí para comprobar'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_750bea678eeb1d07f21fe86173288e2e'] = 'es un sitio de venta en línea certificado con la garantía de reembolso de Trusted Shops. '; +$_MODULE['<{trustedshops}prestashop>trustedshops_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Este módulo requiere la extensión PHP SOAP para funcionar correctamente.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Systema de evaluación cliente'; +$_MODULE['<{trustedshops}prestashop>trustedshops_eeae17826fa637ecca0344165514ab4e'] = 'Haga que sus clientes confíen en usted y transforme a sus visitantes en compradores.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_968e0f78caa7d3245c8f6f858de993d8'] = '¿Está seguro de que desea suprimir esta configuración?'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_79fc246c2b70963d27ebb0e9ebaab349'] = 'Póngase en contacto con Trusted Shops en la siguiente dirección service@trustedshop.fr'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_de14ce5aee772cd0330819c0ecf76adb'] = 'El nombre de usuario o contrasea no son válidos.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_43048f232a4ebab67835c425a1113b29'] = 'Se ha anulado la línea de crédito acordada por Trusted Shop.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_eb601fb44b908fec1ee41383d4d948ac'] = 'No existe ninguna línea de crédito en Trusted Shops. '; +$_MODULE['<{trustedshops}prestashop>tsbpexception_cb71cc86f5c38200b3821adb49966522'] = 'No se han podido guardar los datos.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_07ff7715e67826fb7d9af1d2d1d30e46'] = 'Se ha producido un error. '; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5fb7a36c0bdf3cde4f3e038a0eff2b6f'] = 'Login Web servicio o TS-ID no válido.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_b515cf9cc8234bf6413ed84f5cde066a'] = 'Trusted Shops ha suspendido los límites de crédito de la tienda '; +$_MODULE['<{trustedshops}prestashop>tsbpexception_6453e3467d4c087afbfd33d4013cd3e9'] = 'Número de pedido ya utilizado'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_8100f51dcd57174e15ef0c3b3456e3ca'] = 'No acepta este producto de protección comprador'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f9e1392429699e6921d775ca98660faa'] = 'Método de pago inactivo'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_1dbec1039be7b747704bde7acddca451'] = 'Método de pago no aceptado'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_53cf8eb9e9cb36a367ba553b30cac77a'] = 'La divisa del producto de protección comprador no corresponde a la divisa del carrito'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ad1407fbd2b8c75e47b9c15a976c4d2'] = 'Esta tienda no acepta esta divisa'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_74d27ae48e301b6bbf9bba911a3037e3'] = 'No acepta este índice de cambio'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_02a4ecbbc2d936231663c1b3255ba137'] = 'No se acepta este modo de pago'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f8c4826b4580a3f2e9786ac6bc5c8635'] = 'No hay límite de crédito disponible para esta certificado'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f1b7a6cab6562707aea970971edba9c4'] = 'Fecha de entrega caducada'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_93dff7e30cdf7dec5572f192c774f5ca'] = 'La garantía se aplica a una compra efectuada 3 días antes'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_138ed5814f1b04d3c44fe4975acdeefc'] = 'La dirección email contiene un error'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5eded1b4097ea8e9bd12bb35fe57b6b1'] = 'No se ha asignado ningún número de pedido'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5b8230d466534f0cf347188d78c0b248'] = 'No se ha asignado ningún número de cliente'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ace4c2d63acb0eb87071efea55be813'] = 'Se ha sobrepasado el límite de créditos para este certificado'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_35caaf4f25a287580302c851d88a29dc'] = 'No se ha asignado ningún número de dirección email'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_0db21cf8f0a16321cda7a2e9e37850c7'] = 'Producto de protección comprador no aplicable'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_db26e10564e958809d798e8048fcbc0a'] = 'Clave de seguridad no válida'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_36cd72871a0f3dac493a38f5d82f7441'] = 'Error general del sistema, póngase en contacto con Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fed85cfada8f3bbc5ad9eb128227210a'] = 'Cargo en cuenta'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_73a61696f100b3858511e212a3feea6b'] = 'Tarjeta de crédito'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_466eadd40b3c10580e3ab4e8061161ce'] = 'Factura'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_22d2c7f90dc862df71ac7aff95183fb2'] = 'Envío contra reembolso'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1ff8e518d6a560568fbf66f01e9eb937'] = 'Pago / Transferencia previa'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Cheque'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3deb0a4146e33809942e46416fb60228'] = 'Paybox'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4761b2212f04e7409afa7f8103d6fc60'] = 'Pago en el momento de la recogida'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_917709346cd3cefd00e463f65f1a55d8'] = 'Financiación'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9e6689415e7e5aa4d42d1f2abc78726c'] = 'Leasing'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1c9f173da9bf497cffc19357ab04a8e8'] = 'T-Pay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_369b94cdb6bac25435d00d04255de1ab'] = 'Click&Buy'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_31911306551723245e7417ae4520fecb'] = 'Giropay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_982830b027a279fdc4b4b7993f65498f'] = 'Tarjeta de crédito de la tienda en línea'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e1795d054242cf7c546c1491a7c467d'] = 'DIRECTebanking.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_37554cc43c645833d6713b9cddda909b'] = 'moneybookers.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9203aec73d2ea1770f66f065c4069816'] = 'Otros modos de pago'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_068ce643ff39bf2189935d14736fd10b'] = 'Cuño Trusted Shops y protección comprador'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f51dabfce0c8ccc01734ed38d8afe27a'] = 'Las aplicaciones Json deben ser implementadas en la versión de PHP'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b1801eaadecfddd04529313a1e929262'] = 'El certificado es válido'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ce323cb3453812434f9abc007ba7a952'] = 'El certificado ha caducado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98121ffd0d2a0b4bed569a726632f402'] = 'El certificado se ha anulado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3ec2499357b45a38139485b2b824aa4c'] = 'La tienda está en curso de identificación'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a8fcbddffdaccc6daa529aa9c38d82df'] = 'No se ha distribuido ningún certificado para esta ID Trusted Shops '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5abbd73fc5189212c57adfb43adac459'] = 'Certificado de test'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eaf4354c3a17f478859421ac2e33a975'] = 'Código n°'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d9fd9cab8b813e70e20c615abf036307'] = 'mensaje:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_109715467b74bd66639faa5673f707c1'] = 'Error desconocido'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d4eb1e83b0ea3af3e2b8a6e7b7984d9c'] = 'el campo % es erróneo, compruebe que lo ha rellenado correctamente'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c230eb5eefd15fa219ff97d42e461a7d'] = 'Algunos parámetros enviados al método \"requestForProtectionV2\" son falsos o inexistentes.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b656f5f53cf7ee9bbfe7452685f71e30'] = 'El API de Trusted Shops envía un error que concierne a la aplicación n°'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_77efb7bc0be02351991cba2102bb0656'] = 'El número % 1$d de la aplicación Trusted Shops a funcionado con éxito. El número de garantía es: %2$d'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd511061055fcb2d10d31a51be3539d0'] = 'Link de registro'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_de5536f42490f11e92ad1c20d999fd15'] = 'Pulse para recibir el link de registro'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_56405fbe18e269145ebe3f7232f11be6'] = 'Se ha creado el link de registro. Pulse sobre este link si no ha sido redirigido'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c80549181fa4baa695cd054b6dd21c49'] = 'El producto no se ha guardado.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_76044a7414d56c702b0134907e1a3ccd'] = 'Se ha añadido el certificado.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e7177d7660bfff10363700311b0016d'] = 'Debe editar o suprimir los certificados uno por uno.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_259060bb469ed1256c2e758e32da126f'] = 'El certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8512ae7d57b1396273f76fe6ed341a23'] = 'idioma'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7ea4ac740662d2427d1ef1f2695206d'] = 'ha sido suprimido'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3fb2ea84b90d4ea9fab48ea356a2319b'] = 'Se ha añadido el login del certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e32263743aac776e5e32fc385d8b669a'] = 'Trusted Shops es el sello de calidad europea para sitios de venta en línea con garantía de reembolso para sus clientes. En el momento de la certificación, su tienda está sometida a una auditoría que agrupa más de 1000 criterios diferentes que respetan las exigencias de las asociaciones de protección de los consumidores, así como las legislaciones nacionales y europeas. '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2c786e15a571a442adf85460e6358883'] = '¡Más confianza implica más ventas!'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e06f60bb083e167516a94aafd5a3a2e2'] = 'El sello de calidad Trusted Shops es ideal para aumentar la confianza de los clientes en su tienda en línea. Cuanto más confíen los clientes en su sitio Wab, más compras realizarán el el mismo.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8dd66ca6788218bd7d2ba7fe43c34f63'] = 'Disminución de las interrupciones de los pedidos'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_26286e2764ccde55c99d1b258315aa1a'] = 'Puede proponer a sus clientes en línea un argumento importante: la protección comprador Trusted Shops que asegura al cliente en caso de no reembolso o si no reciba la mercancía. Este seguro suplementario permite reducir la interrupción de los pedidos. '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_710142158c105c01ef807ce959cbc451'] = 'Una fidelización clientela fructuosa y durable'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7e15d97ad927ef705de61e787883ada'] = 'Para aumentar las compras en línea, el sello de calidad Trusted Shops con protección comprador es un criterio de calidad durable para compras en línea seguras. Es una manera de transformar clientes únicos en clientes fieles. '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_0f27ca369d9fee1f5e00f8277c52b014'] = 'Precise el entorno que utiliza para el API de Trusted Shops protección comprador'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6b5690a29af233c9f94d6478850e5da5'] = 'Entorno de test'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98b40dff6ec06a4ef28071fc8725b474'] = 'Entorno de producción'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2541d938b0a58946090d7abdde0d3890'] = 'enviar'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc62561dd8d390e274487516e869fc93'] = 'Obtenir el link de registro'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c93149208b3885248b960eb22e6ba49'] = 'Esta variable ha sido enviada por email por Tructed Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_233a96df2f68dbeafaa3126edadc1ce8'] = 'Identificación interna del software de la tienda en Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_261720a5c993fb1cfad560d874d06254'] = 'Canal del Etracker'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_02977dc4b8561c8d7312b1931782c36b'] = 'Campaña del Etrackter'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4994a8ffeba4ac3140beb89e8d41f174'] = 'Idioma'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_72ca0dcf49befb037f8d4734ee0a2a1c'] = 'Añadir un certificado Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_48e31908bfdcda34b0f01cad9d7077af'] = 'Nuevo certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_75904cf055527a97739601e0f5ff7e51'] = 'Añadir el'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_566853604b7330b3adbb9105cb15e96b'] = 'Editar los certificados Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eb0f48a107df1a0f343d4cd513b555e6'] = 'Certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_46a2a41cc6e552044816a2d04634545d'] = 'Estado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Url de la tienda'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7dce122004969d56ae2e0245cb754d35'] = 'Editar'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f2a6c498fb90ee345d997f888fce3b18'] = 'Suprimir'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97bd7efe2f4d953cc0b77a25ff053d97'] = 'Contraseña o login inexistentes'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_10b5f8531f2b6a3f6d8abad45024bbea'] = 'Innecesario'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c697646774e5acf5c5864b6819e82b5'] = 'Editar el certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f8c823f9ba0a86ceaa8d3ea7e688595d'] = 'Id del certificado'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_92f1b1481fa6ff46c4a3caae78354dab'] = 'Nombre de usuario'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_89c26d1f2de72a1e78d0ae7a7b83880c'] = 'Tipo de pago para editar'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_23a58bf9274bedb19375e527a0744fa9'] = 'con'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd5291d7f0624933870702ff183bb14e'] = 'módulo de pago'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b3b1a406e097bc87c8745db26e11904e'] = 'Actualizar'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c9ba5f6e6d58162530424afaa68bf496'] = 'Configuración del cron'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9a82b12b4b1fe9b34ce7c2952f0284d2'] = 'Debe añadir una tarea cron en su servidor, que funcionen para sus certificados EXCELLENT'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c17d7635f5ee99ee25f7f2cc9a672c74'] = 'El archivo que debe llamar:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a3c2818ac0ecfe9beff0973388eedd69'] = 'Trusted Shops aconseja que se automatice la búsqueda para una tarea cron con un intervalo de 10 minutos.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_94f97da736a5f5f2fd137fa0fc7c2482'] = 'La protección comprador de Trusted Shops requiere un login para funcionar. '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9d36bad327b052a9bdec7003f95ce4bd'] = 'Se ha producido un error con su idioma:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_03e9e3ceaf5769311c57b5903a958e94'] = 'Un comprador no puede comprar varios productos de protección comprador'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_be660f2416cf9cb86913ab902886928c'] = 'Va a recibir un email de Trusted Shops con su número de garantía.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c006c102f7e2ffef1f7c1808d5e0e54a'] = 'Trusted Shops Sistema de aealuación cliente'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b20a16afda98421bbf7457ccfa50e311'] = 'Este módulo necesita los derechos de lectura y de escritura en el repertorio cache del módulo.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Este módulo necesita la extensión PHP SOAP para funcionar correctamente.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_1097e2b0ee70e248749f0d0a9292df56'] = 'ID Trusted Shops no válido'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_086dbc83aa6b78fa9a234d264ba5808a'] = 'Diferido no válido'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_24bbca53f91f119c930d147557a4e997'] = 'Por favor, régístrese'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_6c92285fa6d3e827b198d120ea3ac674'] = 'aquí'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9ad6278cff9ee53a9970b3a9ecc00a5c'] = 'o contacte con service@trustedshops.com.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b4fc8e4eaf37aa936859367ad7c642ca'] = 'El sistema de evaluación Trusted Shops aún no se ha activado para este Trusted Shops ID'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8db5bd2272b51b3525ad7661c10d8b2b'] = 'Se ha producido un error'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activo'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_eeb41070f0552af9f1339ed58da237fb'] = 'Inactivo mientras no especifique su Trusted Shops ID'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9eb274fb901206f4fc8345a787443269'] = 'Atención, se van a suprimir las alertas existentes'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2a94082b582d0620bae922fc14c36444'] = 'Configuración básica'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_e66ff458a8281bc8983ef58f991accb0'] = 'Por favor, introduzca su Trusted Shops ID (un ID diferente por idioma)'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9dc0b7bdd32d5e30f4d71eb5abb6b8d4'] = 'Parámetros que se muestran'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b30cb94d482485bf0bf7015520ffb557'] = 'Mostrar widget en la tienda'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_75a1b325a14f20c2cbb97061d1340451'] = 'Link de evaluación en la tienda'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ab2ededbdea4f61279ec75b5777d39a0'] = 'Link de evaluación en la página de confirmación'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8c9da127717bedb90821f29c6de12ce7'] = 'Link de evaluación en un email separado'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_d344c0ebc1a11797405e4115a8260deb'] = 'Enviar el email después de'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_44fdec47036f482b68b748f9d786801b'] = 'día(s)'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9013b630235e2a5c48b7357e23e1bd2f'] = 'IMPORTANTE:'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ed8b925eb242d6a40ff29ec1a5141b3'] = 'Añada esta URL en una tarea Cron o llámela manualmente cada día'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_f5395c9793af8a11b406ca7c1ac70da9'] = 'Más información'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Systema de evaluación cliente'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_5b91fe21d207317c7c9fad225a7ce442'] = 'Para los compradores en línea, las evaluaciones positivas y que los clientes pueden comprobar, son la muestra que un sitio Web es digno de confianza. El software requerido ya existe en PrestaShop, por lo que unos clics son suficientes para ir a buscar las evaluciones de clientes en su sitio Web. '; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c81bc534bc261e4107a5c30257fb5ba4'] = 'Ayuda para orientar a sus clientes'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ec1bfc4d5646681a86038f770be8fd0b'] = 'Los mejores vendedores son los clientes satisfechos. Haga que sus clientes corran la voz de lo buenos que son los productos de su tienda.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_866a520be0de10a4fc8958a9e89126c3'] = 'Base de optimización del sitio'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9c6dfeed0caab43f7ff0f6bbd19b27dd'] = 'Con sus intervenciones, sus clientes le ayudan a optimizar el proceso de compra en su sitio. Cuanto mejor funcione su tienda, más satisfechos estarán sus clientes.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0fac19c0cc6e205682dd52d61dd5a0a2'] = 'Difusión en Facebook, Twitter y Google'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_afe906fe9448ed1b480b3eec383461de'] = 'Sus clientes dan opiniones y evaluaciones en Facebook y Twitter directamente a sus amigos y conocidos. Las evaluaciones se integran directamente en el Google-Index y se tienen en cuenta en Google Shopping.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_273769f3a3d91979bfdb5ca4909c517a'] = 'Crear una cuenta Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ab78702e34e81e82ca61847300b1618'] = '¿Está satisfecho de su compra en'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_a11109fe93f6dc4637e5b039651a4fdb'] = '? ¡Denos su opinión!'; diff --git a/modules/trustedshops/fr.php b/modules/trustedshops/fr.php new file mode 100644 index 000000000..51ff80f13 --- /dev/null +++ b/modules/trustedshops/fr.php @@ -0,0 +1,175 @@ +display_products_02ecb4a4709d9bcc590f1a25fc82c0e2'] = 'Trusted Shops protection acheteur (recommandée)'; +$_MODULE['<{trustedshops}prestashop>display_products_b55aab8932a39ca85bb0a1b6eb83f83f'] = 'Protection acheteur jusqu\'à'; +$_MODULE['<{trustedshops}prestashop>display_products_a53a5a9f38f31d62a791717b943e02f3'] = 'EUR TVA incluse'; +$_MODULE['<{trustedshops}prestashop>display_products_b3c25d2f94cf87ece3dbb2907318520c'] = 'La protection acheteur Trusted Shops sécurise votre achat en ligne. J’accepte le transfert et la'; +$_MODULE['<{trustedshops}prestashop>display_products_536a056b710e94b16169efd17a4a657b'] = 'sauvegarde'; +$_MODULE['<{trustedshops}prestashop>display_products_2dc4be4d5564180e6df95d5a5a679195'] = 'de mon adresse email pour le traitement de la protection acheteur par Trusted Shops.'; +$_MODULE['<{trustedshops}prestashop>display_products_4ccaceceffe4b5e58f6a7a7ed3ced4c4'] = 'pour la protection acheteur.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_7b5406da2d5f15923d6b01d3264c5619'] = 'Sceau Trusted Shops - Cliquez pour le verifier.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_4052048c767f22e9071c3e6f404d00c6'] = 'En tant que membre Trusted Shops, nous vous offrons un service complémentaire exceptionnel: la garantie de remboursement Trusted Shops. Les frais relatifs à cette garantie sont entièrement à notre charge, alors n\'hésitez pas, il vous suffit de vous inscrire.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_f975f42362625cf21e592009ff4b3d7b'] = 'Enregistrez-vous pour la garantie de remboursement Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_ee9ae315b086e1b1a0c8fdc6078f9add'] = 'Sceau Trusted Shops - Cliquez pour le verifier.'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_750bea678eeb1d07f21fe86173288e2e'] = 'est un site marchand certifié avec la garantie de remboursement de Trusted Shops. En savoir plus...'; +$_MODULE['<{trustedshops}prestashop>trustedshops_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Ce module requiert l\'extension PHP SOAP pour fonctionner correctement.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Système d’évaluation client'; +$_MODULE['<{trustedshops}prestashop>trustedshops_eeae17826fa637ecca0344165514ab4e'] = 'Boostez la confiance de vos clients et transformez vos visiteurs en acheteurs.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_968e0f78caa7d3245c8f6f858de993d8'] = 'Etes-vous sûr de vouloir supprimer votre configuration?'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_79fc246c2b70963d27ebb0e9ebaab349'] = 'Veuillez contacter Trusted Shops à l\'adresse service@trustedshops.fr'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_de14ce5aee772cd0330819c0ecf76adb'] = 'Le nom d\'utilisateur ou le mot de passe n\'est pas valable.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_43048f232a4ebab67835c425a1113b29'] = 'La ligne de crédit accordée par Trusted Shops a été annulée.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_eb601fb44b908fec1ee41383d4d948ac'] = 'Aucune ligne de crédit n\'existe chez Trusted Shops.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_cb71cc86f5c38200b3821adb49966522'] = 'Les données n\'ont pas pu être sauvegardées.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_07ff7715e67826fb7d9af1d2d1d30e46'] = 'Une erreur est survenue.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5fb7a36c0bdf3cde4f3e038a0eff2b6f'] = 'Web service login ou TS-ID invalide'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_b515cf9cc8234bf6413ed84f5cde066a'] = 'Les limites de crédits de la boutique on était suspendu par Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_6453e3467d4c087afbfd33d4013cd3e9'] = 'Numéro de commande déjà utilisé'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_8100f51dcd57174e15ef0c3b3456e3ca'] = 'Produit de protection acheteur non supporté'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f9e1392429699e6921d775ca98660faa'] = 'Méthode de paiement inactive'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_1dbec1039be7b747704bde7acddca451'] = 'Méthode de paiement non supportée'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_53cf8eb9e9cb36a367ba553b30cac77a'] = 'La devise du produit de protection acheteur ne correspond pas à la devise du panier'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ad1407fbd2b8c75e47b9c15a976c4d2'] = 'La devise n\'est pas supportée par cette boutique'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_74d27ae48e301b6bbf9bba911a3037e3'] = 'Ce taux de change n\'est pas supporté'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_02a4ecbbc2d936231663c1b3255ba137'] = 'Cette méthode de paiement n\'est pas supportée'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f8c4826b4580a3f2e9786ac6bc5c8635'] = 'Pas de limite de crédit disponible pour ce certificat'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f1b7a6cab6562707aea970971edba9c4'] = 'La date de livraison est dépassée'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_93dff7e30cdf7dec5572f192c774f5ca'] = 'la garantie est pour un achat effectué 3 jours auparavant'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_138ed5814f1b04d3c44fe4975acdeefc'] = 'L\'adresse e-mail contient une erreur'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5eded1b4097ea8e9bd12bb35fe57b6b1'] = 'Aucun numéro de commande n\'a été assigné'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5b8230d466534f0cf347188d78c0b248'] = 'Aucun numéro de client n\'a été assigné'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ace4c2d63acb0eb87071efea55be813'] = 'La limite de crédits pour ce certificat a été dépassée'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_35caaf4f25a287580302c851d88a29dc'] = 'Aucune adresse e-mail n\'a été assignée'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_0db21cf8f0a16321cda7a2e9e37850c7'] = 'Produit de protection acheteur non applicable'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_db26e10564e958809d798e8048fcbc0a'] = 'Clé de sécurité invalide'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_36cd72871a0f3dac493a38f5d82f7441'] = 'Erreur générale du système, veuillez contacter Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fed85cfada8f3bbc5ad9eb128227210a'] = 'Prélèvement bancaire'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_73a61696f100b3858511e212a3feea6b'] = 'Carte de crédit'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_466eadd40b3c10580e3ab4e8061161ce'] = 'Facture'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_22d2c7f90dc862df71ac7aff95183fb2'] = 'Envoi contre remboursement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1ff8e518d6a560568fbf66f01e9eb937'] = 'Paiement / Virement préalable'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Chèque bancaire'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3deb0a4146e33809942e46416fb60228'] = 'Paybox'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4761b2212f04e7409afa7f8103d6fc60'] = 'Paiement à l’enlèvement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_917709346cd3cefd00e463f65f1a55d8'] = 'Financement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9e6689415e7e5aa4d42d1f2abc78726c'] = 'Leasing'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1c9f173da9bf497cffc19357ab04a8e8'] = 'T-Pay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_369b94cdb6bac25435d00d04255de1ab'] = 'Click&Buy'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_31911306551723245e7417ae4520fecb'] = 'Giropay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_982830b027a279fdc4b4b7993f65498f'] = 'Carte de paiement de la boutique en ligne'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e1795d054242cf7c546c1491a7c467d'] = 'DIRECTebanking.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_37554cc43c645833d6713b9cddda909b'] = 'moneybookers.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9203aec73d2ea1770f66f065c4069816'] = 'Autre mode de paiement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_068ce643ff39bf2189935d14736fd10b'] = 'Sceau Trusted Shops et protection acheteur'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f51dabfce0c8ccc01734ed38d8afe27a'] = 'Les fonctions Json doivent être installées sur votre version de PHP'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b1801eaadecfddd04529313a1e929262'] = 'Le certificat est valide'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ce323cb3453812434f9abc007ba7a952'] = 'le certificat à expiré'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98121ffd0d2a0b4bed569a726632f402'] = 'le certificat à été annulé'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3ec2499357b45a38139485b2b824aa4c'] = 'La boutique est en cours de certification'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a8fcbddffdaccc6daa529aa9c38d82df'] = 'Aucun certificat n\'a été distribué pour cette Trusted Shops ID'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5abbd73fc5189212c57adfb43adac459'] = 'Certificat de test'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eaf4354c3a17f478859421ac2e33a975'] = 'Code n°'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d9fd9cab8b813e70e20c615abf036307'] = 'message :'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_109715467b74bd66639faa5673f707c1'] = 'Erreur inconnue'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d4eb1e83b0ea3af3e2b8a6e7b7984d9c'] = 'le champ % est erroné, veuillez vérifier qu\'il a été correctement remplie'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c230eb5eefd15fa219ff97d42e461a7d'] = 'Certains paramètres envoyés à la méthode \"requestForProtectionV2\" sont faux ou manquant'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b656f5f53cf7ee9bbfe7452685f71e30'] = 'L\'API de Trusted Shops retourne une erreur concernant l\'application n°'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_77efb7bc0be02351991cba2102bb0656'] = 'Le numéro %1$d de l\'application Trusted Shops a fonctionné avec succès. Le numéro de garantie est : %2$d'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd511061055fcb2d10d31a51be3539d0'] = 'Lien d\'enregistrement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_de5536f42490f11e92ad1c20d999fd15'] = 'Cliquez pour recevoir le lien d\'enregistrement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_56405fbe18e269145ebe3f7232f11be6'] = 'Le lien d\'enregistrement a été crée. Suivez ce lien si vous n\'avez pas été redirigé plus tôt :'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Lien'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c80549181fa4baa695cd054b6dd21c49'] = 'Le produit n\'a pas été sauvegardé.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_76044a7414d56c702b0134907e1a3ccd'] = 'Le certificat à bien été ajouté.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e7177d7660bfff10363700311b0016d'] = 'Vous devez éditer ou supprimer un certificat un par un'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_259060bb469ed1256c2e758e32da126f'] = 'Le certificat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8512ae7d57b1396273f76fe6ed341a23'] = 'langue'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7ea4ac740662d2427d1ef1f2695206d'] = 'A bien été supprimé'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3fb2ea84b90d4ea9fab48ea356a2319b'] = 'Le login du certificat à bien été ajouté'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b18f5630d5ffdfcee5ab0a44ee6e1eb6'] = 'Vous devez définir un nom d\'utilisateur et un mot de passe avant toute modification.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e32263743aac776e5e32fc385d8b669a'] = 'Trusted Shops est le label de qualité européen pour sites marchands avec garantie de remboursement pour vos clients. Lors de la certification, votre boutique est soumise à un audit qui regroupe plus de 100 critères différents respectant les exigences des associations de protection des consommateurs, ainsi que les législations nationales et européennes.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2c786e15a571a442adf85460e6358883'] = 'Plus de confiance pour plus de ventes!'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e06f60bb083e167516a94aafd5a3a2e2'] = 'Le label de qualité Trusted Shops est optimal pour accroître la confiance des clients dans votre boutique en ligne. Plus les internautes ont confiance en votre site marchand, plus ils achèteront chez vous.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8dd66ca6788218bd7d2ba7fe43c34f63'] = 'Diminution des interruptions de commandes'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_26286e2764ccde55c99d1b258315aa1a'] = 'Vous proposez à vos clients en ligne un argument fort : la protection acheteur Trusted Shops qui assure le client contre non-livraison ou non-remboursement. Cette sécurité supplémentaire permet de réduire les interruptions de commandes.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_710142158c105c01ef807ce959cbc451'] = 'Une fidélisation clientèle fructueuse et durable'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7e15d97ad927ef705de61e787883ada'] = 'Pour de nombreux acheteurs en ligne, le label de qualité Trusted Shops avec protection acheteur est un critère de qualité durable pour des achats en ligne sécurisés . Vous transformez ainsi des clients uniques en clients loyaux.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7442a1e0ab5e2e26ca9363d226b93d13'] = 'Type d\'environnement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8e77e16312de3f95afdf5b92b10232a2'] = 'Vous utilisez actuellement le mode:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc62561dd8d390e274487516e869fc93'] = 'Obtenir le lien d\'enregistrement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c93149208b3885248b960eb22e6ba49'] = 'Cette variable a été envoyée via mail par Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_233a96df2f68dbeafaa3126edadc1ce8'] = 'Identification interne de logiciel de la boutique chez Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_261720a5c993fb1cfad560d874d06254'] = 'Canal du Etracker'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_02977dc4b8561c8d7312b1931782c36b'] = 'Campagne du Etracker'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4994a8ffeba4ac3140beb89e8d41f174'] = 'Langue'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2541d938b0a58946090d7abdde0d3890'] = 'envoyer'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_72ca0dcf49befb037f8d4734ee0a2a1c'] = 'Ajouter un certificat Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_48e31908bfdcda34b0f01cad9d7077af'] = 'Nouveau certificat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_75904cf055527a97739601e0f5ff7e51'] = 'Ajouter le'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_566853604b7330b3adbb9105cb15e96b'] = 'Éditer les certificats Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eb0f48a107df1a0f343d4cd513b555e6'] = 'Certificat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_46a2a41cc6e552044816a2d04634545d'] = 'État'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Type'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Url de la boutique'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7dce122004969d56ae2e0245cb754d35'] = 'Éditer'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97bd7efe2f4d953cc0b77a25ff053d97'] = 'Mot de passe ou login manquant'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_10b5f8531f2b6a3f6d8abad45024bbea'] = 'Inutile'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c697646774e5acf5c5864b6819e82b5'] = 'Éditer le certificat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f8c823f9ba0a86ceaa8d3ea7e688595d'] = 'Id du certificat'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_92f1b1481fa6ff46c4a3caae78354dab'] = 'Nom d\'utilisateur'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc647eb65e6711e155375218212b3964'] = 'mot de passe'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_89c26d1f2de72a1e78d0ae7a7b83880c'] = 'Type de paiement à éditer'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_23a58bf9274bedb19375e527a0744fa9'] = 'avec'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd5291d7f0624933870702ff183bb14e'] = 'module de paiement'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b3b1a406e097bc87c8745db26e11904e'] = 'Le mettre à jour'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c9ba5f6e6d58162530424afaa68bf496'] = 'Configuration de la tâche cron'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9a82b12b4b1fe9b34ce7c2952f0284d2'] = 'Vous devez ajouter une tâche cron sur votre serveur, fonctionnant pour vos certificats EXCELLENT'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c17d7635f5ee99ee25f7f2cc9a672c74'] = 'Le fichier que vous devez appelé :'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a3c2818ac0ecfe9beff0973388eedd69'] = 'Trusted Shops recommande que la requête doit être automatisé par une tâche cron avec un intervalle de 10 minutes.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_94f97da736a5f5f2fd137fa0fc7c2482'] = 'La protection acheteur de Trusted Shops à besoin d\'un login pour fonctionner. Veuillez contacter l\'administrateur de la boutique.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9d36bad327b052a9bdec7003f95ce4bd'] = 'Une erreur est apparue avec votre langue :'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_03e9e3ceaf5769311c57b5903a958e94'] = 'Un acheteur ne peut pas acheter plusieurs produits de protection d\'acheteur'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_be660f2416cf9cb86913ab902886928c'] = 'Vous allez recevoir un mail de la part de Trusted Shops à propos de votre numéro de garantie.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c006c102f7e2ffef1f7c1808d5e0e54a'] = 'Trusted Shops Système d’évaluation client'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b20a16afda98421bbf7457ccfa50e311'] = 'Ce module nécessite les droits de lecture et d\'écriture sur le répertoire cache du module.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Ce module requiert l\'extension PHP SOAP pour fonctionner correctement.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_1097e2b0ee70e248749f0d0a9292df56'] = 'Trusted Shops ID non valide'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_086dbc83aa6b78fa9a234d264ba5808a'] = 'Différé invalide'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_24bbca53f91f119c930d147557a4e997'] = 'Veuillez vous enregistrer'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_6c92285fa6d3e827b198d120ea3ac674'] = 'ici'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9ad6278cff9ee53a9970b3a9ecc00a5c'] = 'ou contacter service@trustedshops.com.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b4fc8e4eaf37aa936859367ad7c642ca'] = '\'Le système d’évaluation Trusted Shops n’a pas encore été activé pour ce Trusted Shops ID.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8db5bd2272b51b3525ad7661c10d8b2b'] = 'Une erreur est survenue'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c888438d14855d7d96a2724ee9c306bd'] = 'Configuration mise à jour'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Actif'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_eeb41070f0552af9f1339ed58da237fb'] = 'Inactif tant que vous n\'avez pas spécifiez votre Trusted Shops ID'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9eb274fb901206f4fc8345a787443269'] = 'Attention, les alertes existantes vont être supprimées'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2a94082b582d0620bae922fc14c36444'] = 'Configuration'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_e66ff458a8281bc8983ef58f991accb0'] = 'Merci de renseigner votre Trusted Shops ID (un ID différent par langue) :'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9dc0b7bdd32d5e30f4d71eb5abb6b8d4'] = 'Paramètres d\'affichage'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b30cb94d482485bf0bf7015520ffb557'] = 'Affichage widget sur la boutique'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_75a1b325a14f20c2cbb97061d1340451'] = 'Lien d\'évaluation sur la boutique'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ab2ededbdea4f61279ec75b5777d39a0'] = 'Lien d\'évaluation sur la page de confirmation'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8c9da127717bedb90821f29c6de12ce7'] = 'Lien d\'évaluation dans un email séparé'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_d344c0ebc1a11797405e4115a8260deb'] = 'Envoyer l\'email après'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_44fdec47036f482b68b748f9d786801b'] = 'jour(s)'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9013b630235e2a5c48b7357e23e1bd2f'] = 'IMPORTANT :'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ed8b925eb242d6a40ff29ec1a5141b3'] = 'Ajoutez cette URL dans une tâche cron ou appelez la manuellement chaque jour :'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_f5395c9793af8a11b406ca7c1ac70da9'] = 'En savoir plus'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Système d’évaluation client'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_5b91fe21d207317c7c9fad225a7ce442'] = 'Pour les acheteurs en ligne, les évaluations positives et vérifiables des clients sont le signe évident qu’un site marchand est digne de confiance. Le logiciel requis existe déjà dans Prestashop, ce qui fait que quelques clics vous suffisent pour aller chercher également des évaluations de clients sur votre site.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c81bc534bc261e4107a5c30257fb5ba4'] = 'Aide à l’orientation pour vos clients'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ec1bfc4d5646681a86038f770be8fd0b'] = 'Les meilleurs vendeurs, ce sont les clients satisfaits. Faites dire pour vous par vos clients combien les achats sur votre site marchand sont sûrs et confortables.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_866a520be0de10a4fc8958a9e89126c3'] = 'Base d’optimisation du site'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9c6dfeed0caab43f7ff0f6bbd19b27dd'] = 'Par leurs interventions, vos clients vous aident à optimiser les processus de votre site. Car mieux un site marchand fonctionne, plus vos clients sont satisfaits.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0fac19c0cc6e205682dd52d61dd5a0a2'] = 'Diffusion sur Facebook, Twitter et Google'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_afe906fe9448ed1b480b3eec383461de'] = 'Vos clients diffusent avis et évaluations sur Facebook et Twitter directement à leurs amis et connaissances. Les évaluations sont intégrées automatiquement dans le Google-Index et prises en compte dans Google Shopping.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_273769f3a3d91979bfdb5ca4909c517a'] = 'Créer un compte Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ab78702e34e81e82ca61847300b1618'] = 'Etes-vous satisfait de votre achat chez'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_a11109fe93f6dc4637e5b039651a4fdb'] = '? Donnez nous votre avis!'; diff --git a/modules/trustedshops/img/apply_de.gif b/modules/trustedshops/img/apply_de.gif new file mode 100644 index 000000000..e8cece051 Binary files /dev/null and b/modules/trustedshops/img/apply_de.gif differ diff --git a/modules/trustedshops/img/apply_en.gif b/modules/trustedshops/img/apply_en.gif new file mode 100644 index 000000000..116be7ff9 Binary files /dev/null and b/modules/trustedshops/img/apply_en.gif differ diff --git a/modules/trustedshops/img/apply_fr.gif b/modules/trustedshops/img/apply_fr.gif new file mode 100644 index 000000000..23a21bd2e Binary files /dev/null and b/modules/trustedshops/img/apply_fr.gif differ diff --git a/modules/trustedshops/img/siegel.gif b/modules/trustedshops/img/siegel.gif new file mode 100755 index 000000000..6d264d6b5 Binary files /dev/null and b/modules/trustedshops/img/siegel.gif differ diff --git a/modules/trustedshops/img/ts_logo.jpg b/modules/trustedshops/img/ts_logo.jpg new file mode 100644 index 000000000..664a44b52 Binary files /dev/null and b/modules/trustedshops/img/ts_logo.jpg differ diff --git a/modules/trustedshops/img/ts_rating_en.jpg b/modules/trustedshops/img/ts_rating_en.jpg new file mode 100644 index 000000000..218e1e70a Binary files /dev/null and b/modules/trustedshops/img/ts_rating_en.jpg differ diff --git a/modules/trustedshops/img/ts_rating_fr.jpg b/modules/trustedshops/img/ts_rating_fr.jpg new file mode 100644 index 000000000..436db8f87 Binary files /dev/null and b/modules/trustedshops/img/ts_rating_fr.jpg differ diff --git a/modules/trustedshops/it.php b/modules/trustedshops/it.php new file mode 100644 index 000000000..cac8ab1d5 --- /dev/null +++ b/modules/trustedshops/it.php @@ -0,0 +1,174 @@ +display_products_02ecb4a4709d9bcc590f1a25fc82c0e2'] = 'Protezione acquirente Trusted Shops (consigliato)'; +$_MODULE['<{trustedshops}prestashop>display_products_b55aab8932a39ca85bb0a1b6eb83f83f'] = 'Protezione acquirente da'; +$_MODULE['<{trustedshops}prestashop>display_products_bc500dd033a84b00ffd9f81a8a9d5372'] = 'durante'; +$_MODULE['<{trustedshops}prestashop>display_products_44fdec47036f482b68b748f9d786801b'] = 'giorni'; +$_MODULE['<{trustedshops}prestashop>display_products_ee430460ed8c2e7099df4947287e65c6'] = 'La Protezione acquirente Trusted Shops protegge i tuoi acquisti online. Accetto che il mio indirizzo e-mail venga trasferito e salvato ai fini del trattamento Protezione acquirente da parte di Trusted Shops. Condizioni per la protezione dell\'acquirente.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_7b5406da2d5f15923d6b01d3264c5619'] = 'Sigillo di Approvazione Trusted Shops - Clicca per verificare.'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_4052048c767f22e9071c3e6f404d00c6'] = 'Ti offriamo la Protezione acquirente di Trusted Shop come servizio aggiuntivo. Copriamo tutti i costi per questa garanzia. Tutto quello che devi fare è registrarti!'; +$_MODULE['<{trustedshops}prestashop>order-confirmation-tsbp-classic_f975f42362625cf21e592009ff4b3d7b'] = 'Registrati per la Protezione acquirente Trusted shops'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_ee9ae315b086e1b1a0c8fdc6078f9add'] = 'Sigillo di Approvazione Trusted Shops - Clicca per verificare.'; +$_MODULE['<{trustedshops}prestashop>seal_of_approval_750bea678eeb1d07f21fe86173288e2e'] = 'è un negozio on-line certificato con Protezione acquirente Trusted Shops. Maggiori informazioni ...'; +$_MODULE['<{trustedshops}prestashop>trustedshops_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Questo modulo richiede l\'estensione SOAP di PHP per funzionare correttamente.'; +$_MODULE['<{trustedshops}prestashop>trustedshops_9a983837b32d42343dc0c62d35b1f955'] = 'Trusted Shops Valutazione del cliente'; +$_MODULE['<{trustedshops}prestashop>trustedshops_eeae17826fa637ecca0344165514ab4e'] = 'Accrescere la fiducia dei consumatori e girare più acquirenti in clienti'; +$_MODULE['<{trustedshops}prestashop>trustedshops_968e0f78caa7d3245c8f6f858de993d8'] = 'Sei sicuro di voler eliminare tutte le impostazioni?'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_79fc246c2b70963d27ebb0e9ebaab349'] = 'Si prega di contattare Trusted Shops a service@trustedshops.co.uk.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_de14ce5aee772cd0330819c0ecf76adb'] = 'Nome utente o password non valida.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_43048f232a4ebab67835c425a1113b29'] = 'Hai raggiunto il limite di credito.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_eb601fb44b908fec1ee41383d4d948ac'] = 'Nessun credito a disposizione di Trusted Shops.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_cb71cc86f5c38200b3821adb49966522'] = 'I dati non possono essere salvati.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_07ff7715e67826fb7d9af1d2d1d30e46'] = 'Si è verificato un errore.'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5fb7a36c0bdf3cde4f3e038a0eff2b6f'] = 'Login servizio web o TS-ID non valido'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_b515cf9cc8234bf6413ed84f5cde066a'] = 'Il limite di credito del negozio è stato sospeso da Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_6453e3467d4c087afbfd33d4013cd3e9'] = 'Numero d\'ordine già utilizzato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_8100f51dcd57174e15ef0c3b3456e3ca'] = 'Prodotto Protezione acquirente non supportato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f9e1392429699e6921d775ca98660faa'] = 'Metodo di pagamento inattivo'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_1dbec1039be7b747704bde7acddca451'] = 'metodo di pagamento non supportato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_53cf8eb9e9cb36a367ba553b30cac77a'] = 'La valuta del prodotto Protezione acquirenti non corrisponde con la valuta del carrello'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ad1407fbd2b8c75e47b9c15a976c4d2'] = 'Questa valuta non è supportata in questo negozio'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_74d27ae48e301b6bbf9bba911a3037e3'] = 'Questo tasso di cambio non è supportato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_02a4ecbbc2d936231663c1b3255ba137'] = 'Questo metodo di pagamento non è supportato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f8c4826b4580a3f2e9786ac6bc5c8635'] = 'Nessun limite di credito disponibile per questo certificato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_f1b7a6cab6562707aea970971edba9c4'] = 'La data di consegna è nel passato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_93dff7e30cdf7dec5572f192c774f5ca'] = 'La garanzia è di un acquisto che è stato fatto oltre 3 giorni fa'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_138ed5814f1b04d3c44fe4975acdeefc'] = 'L\'indirizzo e-mail contiene un errore'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5eded1b4097ea8e9bd12bb35fe57b6b1'] = 'Nessun numero d\'ordine assegnato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5b8230d466534f0cf347188d78c0b248'] = 'Nessun numero cliente assegnato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_5ace4c2d63acb0eb87071efea55be813'] = 'Il limite di credito per questo certificato è stato superato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_35caaf4f25a287580302c851d88a29dc'] = 'Nessun indirizzo e-mail assegnato'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_0db21cf8f0a16321cda7a2e9e37850c7'] = 'Prodotto Protezione acquirente non applicabile '; +$_MODULE['<{trustedshops}prestashop>tsbpexception_db26e10564e958809d798e8048fcbc0a'] = 'Token di protezione non valido'; +$_MODULE['<{trustedshops}prestashop>tsbpexception_36cd72871a0f3dac493a38f5d82f7441'] = 'errore di sistema generale, si prega di contattare Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fed85cfada8f3bbc5ad9eb128227210a'] = 'Addebito diretto'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_73a61696f100b3858511e212a3feea6b'] = 'Carta di credito'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_466eadd40b3c10580e3ab4e8061161ce'] = 'Fattura'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_22d2c7f90dc862df71ac7aff95183fb2'] = 'In contanti alla consegna'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1ff8e518d6a560568fbf66f01e9eb937'] = 'Pagamento anticipato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3e0deb2f1df28a6a13c9c18cc0e1c755'] = 'Assegno'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3deb0a4146e33809942e46416fb60228'] = 'Paybox'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4761b2212f04e7409afa7f8103d6fc60'] = 'Contanti al ritiro'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_917709346cd3cefd00e463f65f1a55d8'] = 'Finanziamento'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9e6689415e7e5aa4d42d1f2abc78726c'] = 'Leasing'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_1c9f173da9bf497cffc19357ab04a8e8'] = 'T-Pay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_369b94cdb6bac25435d00d04255de1ab'] = 'Click & Buy'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_31911306551723245e7417ae4520fecb'] = 'Giropay'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c132b5e262594950586ae13a7d3aa94'] = 'Google Checkout'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_982830b027a279fdc4b4b7993f65498f'] = 'Carta di pagamento negozio online'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e1795d054242cf7c546c1491a7c467d'] = 'DIRECTebanking.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_37554cc43c645833d6713b9cddda909b'] = 'moneybookers.com'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9203aec73d2ea1770f66f065c4069816'] = 'Altri metodi di pagamento'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_068ce643ff39bf2189935d14736fd10b'] = 'Sigillo di Approvazione e protezione acquirente'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f51dabfce0c8ccc01734ed38d8afe27a'] = 'Le funzioni Json devono essere attuate nella tua versione di PHP'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b1801eaadecfddd04529313a1e929262'] = 'Il certificato è valido'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_ce323cb3453812434f9abc007ba7a952'] = 'Il certificato è scaduto'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98121ffd0d2a0b4bed569a726632f402'] = 'Il certificato è stato disabilitato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3ec2499357b45a38139485b2b824aa4c'] = 'Il negozio è attualmente in fase di certificazione'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a8fcbddffdaccc6daa529aa9c38d82df'] = 'Nessun certificato è stato assegnato all\'iD Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5abbd73fc5189212c57adfb43adac459'] = 'Certificato di prova'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eaf4354c3a17f478859421ac2e33a975'] = 'Codice n.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d9fd9cab8b813e70e20c615abf036307'] = 'messaggio:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_109715467b74bd66639faa5673f707c1'] = 'Errore sconosciuto.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_d4eb1e83b0ea3af3e2b8a6e7b7984d9c'] = 'Il campo%s è sbagliato, assicurati che sia stato correttamente compilato.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c230eb5eefd15fa219ff97d42e461a7d'] = 'Alcuni parametri per l\'invio al metodo \"requestForProtectionV2\" sono sbagliati o mancanti.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b656f5f53cf7ee9bbfe7452685f71e30'] = 'Trusted Shops API segnala un errore riguardante l\'applicazione n.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_77efb7bc0be02351991cba2102bb0656'] = 'Il numero di richiesta %1$d di Trusted Shops è stato elaborato con successo. Il numero di garanzia è il seguente:% 2$d'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd511061055fcb2d10d31a51be3539d0'] = 'Link di registrazione'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_de5536f42490f11e92ad1c20d999fd15'] = 'Fare clic per ottenere il link di registrazione'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_56405fbe18e269145ebe3f7232f11be6'] = 'link di registrazione è stato creato. Segui questo link se non sei stato reindirizzato prima:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97e7c9a7d06eac006a28bf05467fcc8b'] = 'Link'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c80549181fa4baa695cd054b6dd21c49'] = 'Il prodotto non è stato salvato.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_76044a7414d56c702b0134907e1a3ccd'] = 'Il certificato è stato aggiunto.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7e7177d7660bfff10363700311b0016d'] = 'È necessario modificare o eliminare un certificato uno per uno'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_259060bb469ed1256c2e758e32da126f'] = 'Il certificato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8512ae7d57b1396273f76fe6ed341a23'] = 'lingua'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7ea4ac740662d2427d1ef1f2695206d'] = 'è stato eliminato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_3fb2ea84b90d4ea9fab48ea356a2319b'] = 'Certificato di accesso è stato ben aggiunto.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e32263743aac776e5e32fc385d8b669a'] = 'Trusted Shops è il famoso noto Sigillo di Approvazione per i negozi online che offre anche ai clienti una protezione dell\'acquirente. Nel corso del controllo, il tuo negozio online è sottoposto a test ampi ed approfonditi. Questo controllo, che consta di oltre 100 criteri individuali, si basa sui requisiti di tutela dei consumatori, sulle leggi nazionali ed europee.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2c786e15a571a442adf85460e6358883'] = 'Più fiducia porta a più vendite!'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_e06f60bb083e167516a94aafd5a3a2e2'] = 'Il sigillo di approvazione Trusted Shops è il modo ottimale per aumentare la fiducia dei tuoi clienti online. Trust aumenta la propensione dei clienti a comprare da te.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_8dd66ca6788218bd7d2ba7fe43c34f63'] = 'Meno abbandoni di acquisti'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_26286e2764ccde55c99d1b258315aa1a'] = 'Dai ai tuoi clienti online una ragione per acquistare, proponendo la Protezione acquirenti di Trusted Shops. Questa protezione aggiuntiva comporta un minore abbandono dei carrelli'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_710142158c105c01ef807ce959cbc451'] = 'Rapporto con il cliente redditizio e a lungo termine'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f7e15d97ad927ef705de61e787883ada'] = 'Per molti acquirenti online, il Sigillo di ApprovazioneTrusted Shops con la Protezione acquirenti è un segno efficace di qualità per uno shopping sicuro su Internet. Gli acquirenti saltuari diventano clienti abituali.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_0f27ca369d9fee1f5e00f8277c52b014'] = 'Crea l\'ambiente giusto per utilizzare la Protezione acquirenti API TrustedShops.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6b5690a29af233c9f94d6478850e5da5'] = 'Ambiente di prova'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_98b40dff6ec06a4ef28071fc8725b474'] = 'Ambiente produzione'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_2541d938b0a58946090d7abdde0d3890'] = 'invia'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc62561dd8d390e274487516e869fc93'] = 'Prendi il link di registrazione'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c93149208b3885248b960eb22e6ba49'] = 'Questa variabile è stata inviato via e-mail da TrustedShops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_233a96df2f68dbeafaa3126edadc1ce8'] = 'identificazione interna del software del negozio a Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_261720a5c993fb1cfad560d874d06254'] = 'Canale Etracker '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_02977dc4b8561c8d7312b1931782c36b'] = 'Campagna Etracker '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_4994a8ffeba4ac3140beb89e8d41f174'] = 'Lingua'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_72ca0dcf49befb037f8d4734ee0a2a1c'] = 'Aggiungi certificato Trusted Shops '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_48e31908bfdcda34b0f01cad9d7077af'] = 'Nuovo certificato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_75904cf055527a97739601e0f5ff7e51'] = 'Aggiungilo'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_566853604b7330b3adbb9105cb15e96b'] = 'Gestisci certificati Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_eb0f48a107df1a0f343d4cd513b555e6'] = 'Certificato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_46a2a41cc6e552044816a2d04634545d'] = 'Stato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Tipo'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_6c61ebc45acfe2f244e91ac4cd423e81'] = 'Url negozio'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_7dce122004969d56ae2e0245cb754d35'] = 'Modifica'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_97bd7efe2f4d953cc0b77a25ff053d97'] = 'Login o password mancanti'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_10b5f8531f2b6a3f6d8abad45024bbea'] = 'Non c\'è bisogno'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_5c697646774e5acf5c5864b6819e82b5'] = 'Modifica del certificato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_f8c823f9ba0a86ceaa8d3ea7e688595d'] = 'Id certificato'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_92f1b1481fa6ff46c4a3caae78354dab'] = 'Nome Utente'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_dc647eb65e6711e155375218212b3964'] = 'Password'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_89c26d1f2de72a1e78d0ae7a7b83880c'] = 'tipo di pagamento da modificare'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_23a58bf9274bedb19375e527a0744fa9'] = 'con'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_fd5291d7f0624933870702ff183bb14e'] = 'modulo di pagamento'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_b3b1a406e097bc87c8745db26e11904e'] = 'Aggiornalo'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c9ba5f6e6d58162530424afaa68bf496'] = 'Configurazione Cronjob '; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9a82b12b4b1fe9b34ce7c2952f0284d2'] = 'È necessario impostare un cron Task sul server, lavorando con il certificato EXCELLENT.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_c17d7635f5ee99ee25f7f2cc9a672c74'] = 'Il file che devi nominare:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_a3c2818ac0ecfe9beff0973388eedd69'] = 'Trusted Shops raccomanda che la richiesta sia automatizzata da un cronjob con un intervallo di 10 minuti.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_94f97da736a5f5f2fd137fa0fc7c2482'] = 'La Protezione acquirenti Trusted Shop ha bisogno di un accesso per funzionare. Si prega di contattare l\'amministratore del negozio.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_9d36bad327b052a9bdec7003f95ce4bd'] = 'Problema con la tua lingua:'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_03e9e3ceaf5769311c57b5903a958e94'] = 'L\'acquirente non può acquistare più prodotti Protezione acquirente.'; +$_MODULE['<{trustedshops}prestashop>tsbuyerprotection_be660f2416cf9cb86913ab902886928c'] = 'Riceverai una mail con Trusted Shops sul tuo numero di garanzia.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c006c102f7e2ffef1f7c1808d5e0e54a'] = 'Valutazione del cliente'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b20a16afda98421bbf7457ccfa50e311'] = 'Questo modulo richiede permessi di scrittura e lettura sulla directory della cache dei moduli.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0aa7ce92297d05fc09fb9fdbe5da6be6'] = 'Questo modulo richiede l\'estensione SOAP di PHP per funzionare correttamente.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_1097e2b0ee70e248749f0d0a9292df56'] = 'ID Trusted Shops non valido'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_086dbc83aa6b78fa9a234d264ba5808a'] = 'Tempo non valido'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_24bbca53f91f119c930d147557a4e997'] = 'Si prega di registrarsi'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_6c92285fa6d3e827b198d120ea3ac674'] = 'qui'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9ad6278cff9ee53a9970b3a9ecc00a5c'] = 'o contattare service@trustedshops.co.uk.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b4fc8e4eaf37aa936859367ad7c642ca'] = 'La valutazione del cliente non è stata ancora attivata per questo ID di Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8db5bd2272b51b3525ad7661c10d8b2b'] = 'Si è verificato un errore'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Attivo'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_eeb41070f0552af9f1339ed58da237fb'] = 'Inattivo a meno che tu non abbia specificato il tuo ID Trusted Shops'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9eb274fb901206f4fc8345a787443269'] = 'Attenzione, tutti gli avvisi di valutazione esistenti saranno eliminati'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2a94082b582d0620bae922fc14c36444'] = 'Impostazioni di base'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_e66ff458a8281bc8983ef58f991accb0'] = 'Ti preghiamo di compilare il tuo ID Trusted Shops (un ID diverso per lingua):'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9dc0b7bdd32d5e30f4d71eb5abb6b8d4'] = 'Mostra impostazioni '; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_b30cb94d482485bf0bf7015520ffb557'] = 'Mostra widget nel negozio'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_75a1b325a14f20c2cbb97061d1340451'] = 'Mostra link valutazione nel negozio'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ab2ededbdea4f61279ec75b5777d39a0'] = 'Mostra link valutazione sulla pagina di conferma dell\'ordine'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_8c9da127717bedb90821f29c6de12ce7'] = 'Invia link valutazione in una e-mail separata'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_d344c0ebc1a11797405e4115a8260deb'] = 'Inviare e-mail dopo '; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_44fdec47036f482b68b748f9d786801b'] = 'giorni'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9013b630235e2a5c48b7357e23e1bd2f'] = 'IMPORTANTE:'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ed8b925eb242d6a40ff29ec1a5141b3'] = 'Metti questo URL nel crontab o chiamalo ogni giorno:'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_f5395c9793af8a11b406ca7c1ac70da9'] = 'Per saperne di più'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9a983837b32d42343dc0c62d35b1f955'] = 'Valutazione del cliente Trusted Shops '; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_5b91fe21d207317c7c9fad225a7ce442'] = 'Per gli acquirenti on-line, giudizi positivi e verificabili dei clienti sono un importante segnale di fiducia in un negozio online. Il software necessario è già compreso in Prestashop, in modo da poter iniziare a raccogliere le recensioni dei clienti nel tuo negozio on-line. L\'integrazione è facile con pochi clic.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_c81bc534bc261e4107a5c30257fb5ba4'] = 'Supporto di orientamento per i tuoi clienti'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_ec1bfc4d5646681a86038f770be8fd0b'] = 'I clienti soddisfatti sono i tuoi rappresentanti migliori. Lascia che i tuoi clienti parlino da soli di quanto sia sicuro e facile acquistare dal tuo negozio online.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_866a520be0de10a4fc8958a9e89126c3'] = 'Base per l\'ottimizzazione negozio'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_9c6dfeed0caab43f7ff0f6bbd19b27dd'] = 'I tuoi clienti sono felici di aiutarti a ottimizzare il negozio con i loro feedback. Dopotutto, meglio funziona il tuo negozio online, e più soddisfatti saranno i tuoi clienti.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_0fac19c0cc6e205682dd52d61dd5a0a2'] = 'Aumenta la portata tramite Facebook, Twitter e Google'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_afe906fe9448ed1b480b3eec383461de'] = 'I tuoi clienti diffondono opinioni e valutazioni su Facebook e Twitter direttamente ad amici e seguaci. Le valutazioni sono automaticamente elencate nel Google Index e vengono visualizzati in Google Shopping.'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_273769f3a3d91979bfdb5ca4909c517a'] = 'Registrati per la valutazione del cliente Trusted shops'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_2ab78702e34e81e82ca61847300b1618'] = 'Sei soddisfatto di'; +$_MODULE['<{trustedshops}prestashop>trustedshopsrating_a11109fe93f6dc4637e5b039651a4fdb'] = '? Scrivi una recensione!'; +$_MODULE['<{trustedshops}prestashop>display_products_a53a5a9f38f31d62a791717b943e02f3'] = 'EUR incl. IVA'; diff --git a/modules/trustedshops/lib/AbsTrustedShops.php b/modules/trustedshops/lib/AbsTrustedShops.php new file mode 100644 index 000000000..993d44e16 --- /dev/null +++ b/modules/trustedshops/lib/AbsTrustedShops.php @@ -0,0 +1,151 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +abstract class AbsTrustedShops +{ + /** + * Saved errors messages. + * @var array + */ + public $errors = array(); + + /** + * Saved warning messages. + * @var array + */ + public $warnings = array(); + + /** + * Saved confirmations messages. + * @var array + */ + public $confirmations = array(); + + /** + * @var string + */ + protected static $module_name; + + public $limited_countries = array(); + public static $smarty; + public $tab_name; + public $id_tab; + + /** + * Set the object which use the translation method for the specific module. + * @var Module + */ + protected static $translation_object; + + abstract public function install(); + abstract public function uninstall(); + abstract public function getContent(); + public static function setTranslationObject(Module $object) + { + self::$translation_object = $object; + } + protected function _makeFormAction($uri, $id_tab) + { + $uri_component = parse_url($uri); + $arr_query = explode('&', $uri_component['query']); + $arr_query_new = array(); + foreach($arr_query as $key=>$value) + { + $arr = explode('=', $value); + $arr_query_new[$arr[0]] = $arr[1]; + } + $arr_query_new['id_tab'] = $id_tab; + return str_replace($uri_component['query'], '', $uri).http_build_query($arr_query_new); + } + /** + * Set a static name for the module. + * + * @param string $name + */ + public function setModuleName($name) + { + self::$module_name = $name; + } + + public function setSmarty($smarty) + { + self::$smarty = $smarty; + } + + /** + * Get translation for a given module text + * + * @param string $string String to translate + * @return string Translation + */ + public function l($string, $specific = false) + { + if ($specific === false) + { + $reflection_class = new ReflectionClass(get_class($this)); + $specific = basename($reflection_class->getFileName(), '.php'); + } + if (self::$translation_object instanceof Module) + { + return self::$translation_object->l($string, $specific); + } + } + public function display($file, $template, $cacheId = NULL, $compileId = NULL) + { + global $smarty; + + if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */ + { + $previousTemplate = $smarty->currentTemplate; + $smarty->currentTemplate = substr(basename($template), 0, -4); + } + $smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/'); + if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL) + $result = Tools::displayError('No template found'); + else + { + $smarty->assign('module_template_dir', ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/'); + $result = $smarty->fetch(($overloaded ? _PS_THEME_DIR_.'modules/'.basename($file, '.php') : _PS_MODULE_DIR_.basename($file, '.php')).'/'.$template, $cacheId, $compileId); + } + if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */ + $smarty->currentTemplate = $previousTemplate; + return $result; + } + + /** + * Template management (display, overload, cache) + * @see Module::_isTemplateOverloadedStatic() + */ + protected static function _isTemplateOverloadedStatic($moduleName, $template) + { + if (Tools::file_exists_cache(_PS_THEME_DIR_.'modules/'.$moduleName.'/'.$template)) + return true; + elseif (Tools::file_exists_cache(_PS_MODULE_DIR_.$moduleName.'/'.$template)) + return false; + return NULL; + } +} \ No newline at end of file diff --git a/modules/trustedshops/lib/RatingAlert.php b/modules/trustedshops/lib/RatingAlert.php new file mode 100644 index 000000000..52c516783 --- /dev/null +++ b/modules/trustedshops/lib/RatingAlert.php @@ -0,0 +1,109 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class RatingAlert +{ + const TABLE_NAME = 'ts_rating_alert'; + const MAIL_TEMPLATE = 'rating_email'; + + public static function save($id_order) + { + Db::getInstance()->AutoExecute(_DB_PREFIX_.self::TABLE_NAME, array('id_order' => (int)($id_order)), 'INSERT'); + } + + private static function _getAlertsInformations($nb_days = 10) + { + return Db::getInstance()->ExecuteS(' + SELECT a.id_alert, c.`email`, o.`id_order`, o.`id_lang` + FROM `'._DB_PREFIX_.self::TABLE_NAME.'` a + LEFT JOIN '._DB_PREFIX_.'orders o ON (a.id_order = o.id_order) + LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = o.id_customer) + WHERE DATE_ADD(o.`date_add`, INTERVAL '.(int)($nb_days).' DAY) <= NOW()'); + } + + public static function removeAlerts($ids) + { + $to_remove = array(); + foreach ($ids AS $id) + $to_remove[] = (int)($id); + + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.self::TABLE_NAME.'` WHERE `id_alert` IN (\''.implode('\',\'', $to_remove).'\')'); + } + + public static function executeCronTask() + { + global $cookie; + if (!Configuration::get('TS_SEND_SEPERATE_MAIL')) + return true; + + $to_remove = array(); + $alerts_infos = RatingAlert::_getAlertsInformations((int)(Configuration::get('TS_SEND_SEPERATE_MAIL_DELAY'))); + + $ts_module = new TrustedShops(); + + foreach ($alerts_infos AS $infos) + { + $cookie->id_lang = $infos['id_lang']; + $subject = $ts_module->getL('title_part_1').' '.Configuration::get('PS_SHOP_NAME').$ts_module->getL('title_part_2'); + $template_vars = array('{ts_id}' => Configuration::get('TS_ID_'.(int)($infos['id_lang'])), + '{button_url}' => TrustedShops::getHttpHost(true, true)._MODULE_DIR_.$ts_module->name.'/img', + '{rating_url}' => $ts_module->getRatingUrlWithBuyerEmail($infos['id_lang'], $infos['id_order'], $infos['email'])); + + $result = Mail::Send((int)($infos['id_lang']), self::MAIL_TEMPLATE, $subject, $template_vars, $infos['email'], NULL, Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME'), NULL, NULL, dirname(__FILE__).'/mails/'); + + if ($result) + $to_remove[] = (int)($infos['id_alert']); + } + + if (sizeof($to_remove) > 0) + self::removeAlerts($to_remove); + + return (sizeof($to_remove) == sizeof($alerts_infos)); + } + + public static function createTable() + { + return Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'` ( + `id_alert` INT NOT NULL AUTO_INCREMENT, + `id_order` INT NOT NULL, + PRIMARY KEY (`id_alert`), + UNIQUE KEY `id_order` (`id_order`) + ) ENGINE = '._MYSQL_ENGINE_); + } + + public static function dropTable() + { + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } + + public static function truncateTable() + { + return Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.self::TABLE_NAME.'`'); + } +} + diff --git a/modules/trustedshops/lib/TSBPException.php b/modules/trustedshops/lib/TSBPException.php new file mode 100644 index 000000000..093620322 --- /dev/null +++ b/modules/trustedshops/lib/TSBPException.php @@ -0,0 +1,106 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class TSBPException extends Exception +{ + const ADMINISTRATION = 1; + const FRONT_END = 2; + /** + * Set the object which use the translation method for the specific module. + * @var AbsTrustedShops + */ + private static $translation_object; + private static $translate_key; + + public function __construct($code, $type = TSBPException::ADMINISTRATION) + { + if(!(self::$translation_object instanceof AbsTrustedShops) OR self::$translation_object === NULL) + { + die('In '.__METHOD__.', you must defined an object for get messages translations. An herited object from AbsTrustedShops.'); + } + if (TSBPException::$translate_key === NULL) + TSBPException::$translate_key = basename(__FILE__, '.php'); + + if($type === TSBPException::ADMINISTRATION) + $message = $this->_getAdministrationMessage((int)$code); + else + $message = $this->_getFrontEndMessage($code); + parent::__construct($message, $code); + } + private function _getAdministrationMessage($code) + { + // @todo : don't forget to change email in translation + $mail = self::$translation_object->l('Please contact Trusted Shops at service@trustedshops.co.uk.', TSBPException::$translate_key); + $errors = array( + -10001 => self::$translation_object->l('Username or password invalid.', TSBPException::$translate_key), + -10002 => self::$translation_object->l('You have reached your credit limit.', TSBPException::$translate_key), + -10011 => self::$translation_object->l('No credit available from Trusted Shops.', TSBPException::$translate_key), + -11111 => self::$translation_object->l('The data could not be saved.', TSBPException::$translate_key), + ); + $return_message = ''; + if(array_key_exists($code, $errors)) + $return_message = $errors[$code].$mail; + else + $return_message = self::$translation_object->l('An error occured.').$mail; + + return $return_message; + } + private function _getFrontEndMessage($code) + { + $return_message = ''; + switch ($code) + { + case -10001 : case 'NO_VALID_SHOP' : $return_message .= self::$translation_object->l('Web service login or TS-ID invalid', TSBPException::$translate_key);break; + case -10002 : case 'LIMIT_CANCELLED' : $return_message .= self::$translation_object->l('The shop\'s credit limit has been suspended by Trusted Shops', TSBPException::$translate_key); break; + case -10003 : case 'DUPLICATE_ORDER_NUMBER' : $return_message .= self::$translation_object->l('Order number already used', TSBPException::$translate_key); break; + case -10004 : case 'UNSUPPORTED_TS_PRODUCT' : $return_message .= self::$translation_object->l('Unsupported Buyer Protection product', TSBPException::$translate_key); break; + case -10005 : case 'INACTIVE_PAYMENT_TYPE' : $return_message .= self::$translation_object->l('Inactive payment method', TSBPException::$translate_key); break; + case -10006 : case 'UNSUPPORTED_PAYMENT_TYPE' : $return_message .= self::$translation_object->l('Unsupported payment method', TSBPException::$translate_key); break; + case -10007 : case 'CURRENCY_MISMATCH' : $return_message .= self::$translation_object->l('The currency of the Buyer Protection product does not match with the currency of the shopping basket', TSBPException::$translate_key); break; + case -10008 : case 'UNSUPPORTED_CURRENCY' : $return_message .= self::$translation_object->l('This currency is not supported in this shop', TSBPException::$translate_key); break; + case -10009 : case 'UNSUPPORTED_EXCHANGE_RATE' : $return_message .= self::$translation_object->l('This exchange rate is not supported', TSBPException::$translate_key); break; + case -10010 : case 'NOT_PERSISTENT_PAYMENT_TYPE' : $return_message .= self::$translation_object->l('This payment method is not supported', TSBPException::$translate_key); break; + case -10011 : case 'NO_LIMIT' : $return_message .= self::$translation_object->l('No credit limit available for this certificate', TSBPException::$translate_key); break; + case -10012 : case 'PAST_DELIVERY_DATE' : $return_message .= self::$translation_object->l('The delivery date is in the past', TSBPException::$translate_key); break; + case -10013 : case 'TOO_OLD_ORDER' : $return_message .= self::$translation_object->l('The guarantee is for a purchase that was made over 3 days ago', TSBPException::$translate_key); break; + case -10014 : case 'EMAIL_MALFORMED' : $return_message .= self::$translation_object->l('The email address contains an error', TSBPException::$translate_key); break; + case -10015 : case 'ORDER_ID_EMPTY' : $return_message .= self::$translation_object->l('No order number was assigned', TSBPException::$translate_key); break; + case -10016 : case 'CUSTOMER_ID_EMPTY' : $return_message .= self::$translation_object->l('No customer number was assigned', TSBPException::$translate_key); break; + case -10017 : case 'LIMIT_OVERFLOW' : $return_message .= self::$translation_object->l('The credit limit for this certificate has been exceeded', TSBPException::$translate_key); break; + case -10018 : case 'EMAIL_EMPTY' : $return_message .= self::$translation_object->l('No email address was assigned', TSBPException::$translate_key); break; + case -10019 : case 'WRONG_TS_PRODUCT' : $return_message .= self::$translation_object->l('Non-applicable Buyer Protection product', TSBPException::$translate_key); break; + case -11001 : case 'INVALID_SECURITY_TOKEN' : $return_message .= self::$translation_object->l('Invalid security token', TSBPException::$translate_key); break; + case -11111 : case 'SYSTEM_EXCEPTION' : $return_message .= self::$translation_object->l('General system error, please contact Trusted Shops', TSBPException::$translate_key); break; + default : $return_message .= self::$translation_object->l('An error occured.', TSBPException::$translate_key); break; + } + return $return_message; + } + public static function setTranslationObject(AbsTrustedShops $object) + { + self::$translation_object = $object; + } +} \ No newline at end of file diff --git a/modules/trustedshops/lib/TSBuyerProtection.php b/modules/trustedshops/lib/TSBuyerProtection.php new file mode 100644 index 000000000..e9ed3014f --- /dev/null +++ b/modules/trustedshops/lib/TSBuyerProtection.php @@ -0,0 +1,1389 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +include(_PS_MODULE_DIR_.'/trustedshops/lib/TSBPException.php'); + +/** + * @see the technical doc for entire description. + * too long to set it here. + * @author Prestashop - Nans Pellicari + * @since prestashop 1.4 + * @version 0.1 + */ +class TSBuyerProtection extends AbsTrustedShops +{ + const PREFIX_TABLE = 'TS_TAB1_'; + const ENV_TEST = 'test'; + const ENV_PROD = 'production'; + const DB_ITEMS = 'ts_buyerprotection_items'; + const DB_APPLI = 'ts_application_id'; + const WEBSERVICE_BO = 'administration'; + const WEBSERVICE_FO = 'front-end'; + + /** + * List of registration link, need to add parameters + * @see TSBuyerProtection::_getRegistrationLink() + * @var array + */ + private $registration_link = array( + 'DE' => 'http://www.trustedshops.de/shopbetreiber/mitgliedschaft.html', + 'EN' => 'http://www.trustedshops.com/merchants/membership.html', + 'FR' => 'http://www.trustedshops.com/marchands/affiliation.html', + 'PL' => 'http://www.trustedshops.pl/handlowcy/cennik.html', + ); + + /** + * Link to obtain the certificate about the shop. + * Use by seal of approval. + * @see TSBuyerProtection::hookRightColumn() + * @var array + */ + private static $certificate_link = array( + 'DE' => 'http://www.trustedshops.de/profil/#shop_name#_#shop_id#.html', + 'EN' => 'http://www.trustedshops.com/profile/#shop_name#_#shop_id#.html', + 'FR' => 'http://www.trustedshops.fr', + 'PL' => 'http://www.trustedshops.de/profil/#shop_name#_#shop_id#.html', + ); + + /** + * Available language for used TrustedShops Buyer Protection + * @see TSBuyerProtection::__construct() + * @var array + */ + private $available_languages = array('EN'=>'', 'FR'=>'', 'DE'=>'', 'PL'=>'', ); + + /** + * @todo : be sure : see TrustedShopsRating::__construct() + * @var array + */ + public $limited_countries = array('PL', 'GB', 'US', 'FR', 'DE'); + + /** + * Differents urls to call for Trusted Shops API + * @var array + */ + private static $webservice_urls = array( + 'administration' => array( + 'test' => 'https://qa.trustedshops.de/ts/services/TsProtection?wsdl', + 'production' => 'https://www.trustedshops.de/ts/services/TsProtection?wsdl', + ), + 'front-end' => array( + 'test' => 'https://protection-qa.trustedshops.com/ts/protectionservices/ApplicationRequestService?wsdl', + 'production' => 'https://protection.trustedshops.com/ts/protectionservices/ApplicationRequestService?wsdl', + ), + ); + + // Configuration vars + private static $SHOPSW; + private static $ET_CID; + private static $ET_LID; + + /** + * Its must look like : + * array( + * 'lang_iso(ex: FR)' => array('stateEnum'=>'', 'typeEnum'=>'', 'url'=>'', 'tsID'=>'', 'user'=>'', 'password'=>''), + * ... + * ) + * @var array + */ + private static $CERTIFICATE; + private static $DEFAULT_LANG; + private static $CAT_ID; + private static $ENV_API; + + /** + * save shop url + * @var string + */ + private $site_url; + + /** + * Payment type used by Trusted Shops. + * @var array + */ + private static $payments_type; + + public function __construct() + { + // need to set this in constructor to allow translation + TSBuyerProtection::$payments_type = array( + 'DIRECT_DEBIT' => $this->l('Direct debit'), + 'CREDIT_CARD' => $this->l('Credit Card'), + 'INVOICE' => $this->l('Invoice'), + 'CASH_ON_DELIVERY' => $this->l('Cash on delivery'), + 'PREPAYMENT' => $this->l('Prepayment'), + 'CHEQUE' => $this->l('Cheque'), + 'PAYBOX' => $this->l('Paybox'), + 'PAYPAL' => $this->l('PayPal'), + 'CASH_ON_PICKUP' => $this->l('Cash on pickup'), + 'FINANCING' => $this->l('Financing'), + 'LEASING' => $this->l('Leasing'), + 'T_PAY' => $this->l('T-Pay'), + 'CLICKANDBUY' => $this->l('Click&Buy'), + 'GIROPAY' => $this->l('Giropay'), + 'GOOGLE_CHECKOUT' => $this->l('Google Checkout'), + 'SHOP_CARD' => $this->l('Online shop payment card'), + 'DIRECT_E_BANKING' => $this->l('DIRECTebanking.com'), + 'MONEYBOOKERS' => $this->l('moneybookers.com'), + 'OTHER' => $this->l('Other method of payment'), + ); + $this->tab_name = $this->l('Seal of Approval and Buyer Protection'); + $this->site_url = Tools::htmlentitiesutf8('http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__); + TSBPException::setTranslationObject($this); + if (!method_exists('Tools', 'jsonDecode') || !method_exists('Tools', 'jsonEncode')) + { + $this->warnings[] = $this->l('Json functions must be implemented in your php version'); + } + else + { + foreach ($this->available_languages as $iso => $lang) + { + if($lang === '') + $this->available_languages[$iso] = Language::getLanguage(Language::getIdByIso($iso)); + TSBuyerProtection::$CERTIFICATE[strtoupper($iso)] = (array)Tools::jsonDecode( + Tools::htmlentitiesDecodeUTF8(Configuration::get(TSBuyerProtection::PREFIX_TABLE.'CERTIFICATE_'.strtoupper($iso)))); + } + if(TSBuyerProtection::$SHOPSW === NULL) + { + TSBuyerProtection::$SHOPSW = Configuration::get(TSBuyerProtection::PREFIX_TABLE.'SHOPSW'); + TSBuyerProtection::$ET_CID = Configuration::get(TSBuyerProtection::PREFIX_TABLE.'ET_CID'); + TSBuyerProtection::$ET_LID = Configuration::get(TSBuyerProtection::PREFIX_TABLE.'ET_LID'); + TSBuyerProtection::$DEFAULT_LANG = (int)Configuration::get('PS_LANG_DEFAULT'); + TSBuyerProtection::$CAT_ID = (int)Configuration::get(TSBuyerProtection::PREFIX_TABLE.'CAT_ID'); + TSBuyerProtection::$ENV_API = Configuration::get(TSBuyerProtection::PREFIX_TABLE.'ENV_API'); + } + } + } + + public function install() + { + if (!method_exists('Tools', 'jsonDecode') || !method_exists('Tools', 'jsonEncode')) + return false; + + foreach ($this->available_languages as $iso=>$lang) + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'CERTIFICATE_'.strtoupper($iso), + Tools::htmlentitiesUTF8(Tools::jsonEncode(array('stateEnum'=>'', 'typeEnum'=>'', 'url'=>'', 'tsID'=>'', 'user'=>'', 'password'=>'')))); + + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'SHOPSW', ''); + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'ET_CID', ''); + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'ET_LID', ''); + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'ENV_API', TSBuyerProtection::ENV_PROD); + $req = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.TSBuyerProtection::DB_ITEMS.'` ( + `id_item` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , + `id_product` INT NOT NULL, + `ts_id` VARCHAR( 33 ) NOT NULL, + `id` INT NOT NULL, + `currency` VARCHAR( 3 ) NOT NULL , + `gross_fee` DECIMAL( 20, 6 ) NOT NULL , + `net_fee` DECIMAL( 20, 6 ) NOT NULL , + `protected_amount_decimal` INT NOT NULL , + `protection_duration_int` INT NOT NULL , + `ts_product_id` TEXT NOT NULL , + `creation_date` VARCHAR( 25 ) NOT NULL + ); + '; + Db::getInstance()->Execute($req); + + $req = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.TSBuyerProtection::DB_APPLI.'` ( + `id_application` INT NOT NULL PRIMARY KEY, + `ts_id` VARCHAR( 33 ) NOT NULL, + `id_order` INT NOT NULL, + `statut_number` INT NOT NULL DEFAULT \'0\', + `creation_date` DATETIME NOT NULL, + `last_update` DATETIME NOT NULL + ); + '; + Db::getInstance()->Execute($req); + + //add hidden category + $category = new Category(); + $languages = Language::getLanguages(true); + foreach ($this->available_languages as $iso=>$lang) + { + $category->name[Language::getIdByIso(strtolower($iso))] = 'Trustedshops'; + $category->link_rewrite[Language::getIdByIso(strtolower($iso))] = 'trustedshops'; + } + + // If the default lang is different than available languages : + // (Bug occurred otherwise) + if (!array_key_exists(Language::getIsoById((int)Configuration::get('PS_LANG_DEFAULT')), $this->available_languages)) + { + $category->name[(int)Configuration::get('PS_LANG_DEFAULT')] = 'Trustedshops'; + $category->link_rewrite[(int)Configuration::get('PS_LANG_DEFAULT')] = 'trustedshops'; + } + + $category->id_parent = 0; + $category->level_depth = 0; + $category->active = 0; + $category->add(); + Configuration::updateValue(TSBuyerProtection::PREFIX_TABLE.'CAT_ID', intval($category->id)); + return true; + } + + public function uninstall() + { + foreach ($this->available_languages as $iso=>$lang) + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'CERTIFICATE_'.strtoupper($iso)); + + $category = new Category((int)TSBuyerProtection::$CAT_ID); + $category->delete(); + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'CAT_ID'); + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'SHOPSW'); + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'ET_CID'); + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'ET_LID'); + Configuration::deleteByName(TSBuyerProtection::PREFIX_TABLE.'ENV_API'); + return true; + } + + /** + * Just for return the file path + * @return string + */ + public function getCronFilePath() + { + return $this->site_url.'modules/'.self::$module_name.'/cron_garantee.php'; + } + + /** + * This method is used to access of TrustedShops API + * from a SoapClient object. + * + * @uses TSBuyerProtection::$webservice_urls with TSBuyerProtection::$ENV_API + * To get the api url according to the environment (test or production) + * @param string $type + * @return SoapClient + */ + private function _getClient($type = TSBuyerProtection::WEBSERVICE_BO) + { + $url = TSBuyerProtection::$webservice_urls[$type][TSBuyerProtection::$ENV_API]; + $client = new SoapClient($url); + return $client; + } + + /** + * Checks the Trusted Shops IDs entered in the shop administration + * and returns the characteristics of the corresponding certificate. + * + * @uses TSBuyerProtection::_getClient() + * @param string $certificate certificate code already send by Trusted Shops + */ + private function _checkCertificate($certificate) + { + $array_state = array( + 'PRODUCTION' => $this->l('The certificate is valid'), + 'CANCELLED' => $this->l('The certificate has expired'), + 'DISABLED' => $this->l('The certificate has been disabled'), + 'INTEGRATION' => $this->l('The shop is currently being certified'), + 'INVALID_TS_ID' => $this->l('No certificate has been allocated to the Trusted Shops ID'), + 'TEST' => $this->l('Test certificate'), + ); + $client = $this->_getClient(); + $validation = false; + try { + $validation = $client->checkCertificate($certificate); + } catch (SoapFault $fault) { + $this->errors[] = $this->l('Code #').$fault->faultcode.',
        '.$this->l('message:').$fault->faultstring; + } + + if(is_int($validation)) + throw new TSBPException($validation, TSBPException::ADMINISTRATION); + + if (!$validation OR array_key_exists($validation->stateEnum, $array_state)) + { + if ($validation->stateEnum === 'TEST' || $validation->stateEnum === 'PRODUCTION') + { + $this->confirmations[] = $array_state[$validation->stateEnum]; + return $validation; + } + else + { + $this->errors[] = $array_state[$validation->stateEnum]; + return false; + } + } + else + { + $this->errors[] = $this->l('Unknown error.'); + } + } + + /** + * Checks the shop's web service access credentials. + * + * @uses TSBuyerProtection::_getClient() + * @param string $ts_id + * @param string $user + * @param string $password + */ + private function _checkLogin($ts_id, $user, $password) + { + $client = $this->_getClient(); + $return = 0; + try { + $return = $client->checkLogin($ts_id, $user, $password); + } catch (SoapClient $fault) { + $this->errors[] = $this->l('Code #').$fault->faultcode.',
        '.$this->l('message:').$fault->faultstring; + } + if ($return < 0) + throw new TSBPException($return, TSBPException::ADMINISTRATION); + + return true; + } + + /** + * Returns the characteristics of the buyer protection products + * that are allocated individually to each certificate by Trusted Shops. + * + * @uses TSBuyerProtection::_getClient() + * @param string $ts_id + */ + private function _getProtectionItems($ts_id) + { + $client = $this->_getClient(); + try { + $items = $client->getProtectionItems($ts_id); + } catch (SoapFault $fault) { + $this->errors[] = $this->l('Code #').$fault->faultcode.',
        '.$this->l('message:').$fault->faultstring; + } + if (isset($items->item)) + return $items->item; + return false; + } + + /** + * Check validity for params required for TSBuyerProtection::_requestForProtectionV2() + * + * @param array $params + */ + private function _requestForProtectionV2ParamsValidator(array $params) + { + $bool_flag = true; + $mandatory_keys = array( + array('name'=>'tsID', 'validator'=>array('isCleanHtml'),), + array('name'=>'tsProductID', 'validator'=>array('isCleanHtml'),), + array('name'=>'amount', 'validator'=>array('isFloat'),), + array('name'=>'currency', 'length'=>3, 'validator'=>array('isString'),), + array('name'=>'paymentType', 'validator'=>array('isString'),), + array('name'=>'buyerEmail', 'validator'=>array('isEmail'),), + array('name'=>'shopCustomerID', 'validator'=>array('isInt'),), + array('name'=>'shopOrderID', 'validator'=>array('isInt'),), + array('name'=>'orderDate', 'ereg'=>'#[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}#',), + array('name'=>'shopSystemVersion','validator'=>array('isCleanHtml'),), + array('name'=>'wsUser','validator'=>array('isCleanHtml'),), + array('name'=>'wsPassword', 'validator'=>array('isCleanHtml'),), + ); + foreach ($mandatory_keys as $key) + { + $bool_flag = (!array_key_exists($key['name'], $params)) ? false : $bool_flag; + if ($bool_flag) + { + if (isset($key['length'])) + $bool_flag = strlen((string)$params[$key['name']]) === $key['length']; + if (isset($key['length-min'])) + $bool_flag = strlen((string)$params[$key['name']]) > $key['length-min']; + if (isset($key['length-max'])) + $bool_flag = strlen((string)$params[$key['name']]) < $key['length-max']; + if (isset($key['validator'])) + foreach ($key['validator'] as $validator) + if (method_exists('Validate', $validator)) + $bool_flag = !Validate::$validator((string)$params[$key['name']]) ? false : $bool_flag; + if(isset($key['ereg'])) + $bool_flag = !preg_match($key['ereg'], $params[$key['name']]) ? false : $bool_flag ; + } + + if (!$bool_flag) + { + $this->errors[] = sprintf($this->l('The field %s is wrong, please ensure it was correctly filled.'), $key['name']); + break; + } + } + return $bool_flag; + + } + + /** + * Create the Buyer Protection application by the web service. + * Applications are saved by Trusted Shops and are processed at regular intervals. + * + * @uses TSBuyerProtection::_getClient() + * @uses TSBuyerProtection::_requestForProtectionV2ParamsValidator() + * to check required params + * @see TSBuyerProtection::cronTasks() + * @param array $params + */ + private function _requestForProtectionV2(array $params) + { + $client = $this->_getClient(TSBuyerProtection::WEBSERVICE_FO); + $testing_params = $this->_requestForProtectionV2ParamsValidator($params); + $code = 0; + $sql = ' + SELECT * + FROM `'._DB_PREFIX_.TSBuyerProtection::DB_APPLI.'` + WHERE `id_order` = "'.$params['shopOrderID'].'" + '; + $order = Db::getInstance()->ExecuteS($sql); + + // If an order was already added, no need to continue. + // Otherwise a new application is created by TrustedShops. + // this can occured when order confirmation page is reload. + if(isset($order[0])) + return false; + + if ($testing_params) + { + try { + $code = $client->requestForProtectionV2($params['tsID'], $params['tsProductID'], $params['amount'], $params['currency'], $params['paymentType'], $params['buyerEmail'], $params['shopCustomerID'], $params['shopOrderID'], $params['orderDate'], $params['shopSystemVersion'], $params['wsUser'], $params['wsPassword']); + if ($code < 0) + throw new TSBPException($code, TSBPException::FRONT_END); + } catch (SoapFault $fault) { + $this->errors[] = $this->l('Code #').$fault->faultcode.',
        '.$this->l('message:').$fault->faultstring; + } catch (TSBPException $e) { + $this->errors[] = $e->getMessage(); + } + if ($code > 0) + { + $date = date('Y-m-d H:i:s'); + $sql = ' + INSERT INTO `'._DB_PREFIX_.TSBuyerProtection::DB_APPLI.'` + ( + `id_application`, + `ts_id`, + `id_order`, + `creation_date`, + `last_update` + ) + VALUES + ( + "'.pSQL($code).'", + "'.pSQL($params['tsID']).'", + "'.pSQL($params['shopOrderID']).'", + "'.$date.'", + "'.$date.'" + ) + '; + Db::getInstance()->Execute($sql); + + // To reset product quantity in database. + $sql = ' + SELECT `id_product` + FROM `'._DB_PREFIX_.TSBuyerProtection::DB_ITEMS.'` + WHERE `ts_product_id` = "'.$params['tsProductID'].'" + '; + $ts_product = Db::getInstance()->ExecuteS($sql); + $product = new Product($ts_product[0]['id_product']); + $product->quantity = 1000; + $product->update(); + } + } + else + $this->errors[] = $this->l('Some parameters sending to "requestForProtectionV2" method are wrong or missing.'); + } + + /** + * With the getRequestState() method, + * the status of a guarantee application is requested + * and in the event of a successful transaction, + * the guarantee number is returned. + * + * @uses TSBuyerProtection::_getClient() + * @param array $params + * @throws TSBPException + */ + private function _getRequestState(array $params) + { + $client = $this->_getClient(TSBuyerProtection::WEBSERVICE_FO); + $code = 0; + try { + $code = $client->getRequestState($params['tsID'], $params['applicationID']); + if ($code < 0) + throw new TSBPException($code, TSBPException::FRONT_END); + } catch (SoapFault $fault) { + $this->errors[] = $this->l('Code #').$fault->faultcode.',
        '.$this->l('message:').$fault->faultstring; + } catch (TSBPException $e) { + $this->errors[] = $e->getMessage(); + } + return $code; + } + + /** + * Check statut of last applications + * saved with TSBuyerProtection::_requestForProtectionV2() + * + * Negative value means an error occured. + * Error code are managed in TSBPException. + * @see (exception) TSBPException::_getFrontEndMessage() method + * + * Trusted Shops recommends that the request + * should be automated by a cronjob with an interval of 10 minutes. + * @see /../cron_garantee.php + * + * A message is added to the sheet order in Back-office, + * @see Message class + * + * @uses TSBuyerProtection::_getRequestState() + * @uses Message class + * @return void + */ + public function cronTask() + { + // get the last 20min to get the api number (to be sure) + $mktime = mktime(date('H'), date('i')-20, date('s'), date('m'), date('d'), date('Y')); + $date = date('Y-m-d H:i:s', $mktime); + $db_name = _DB_PREFIX_.TSBuyerProtection::DB_APPLI; + $sql = ' + SELECT * + FROM `'.$db_name.'` + WHERE `last_update` >= "'.$date.'" OR `statut_number` <= 0 + '; + $to_check = Db::getInstance()->ExecuteS($sql); + foreach ($to_check as $application) + { + $code = $this->_getRequestState(array('tsID'=>$application['ts_id'], 'applicationID'=>$application['id_application'])); + if (!empty($this->errors)) + { + $return_message = '

        '.$this->l('Trusted Shops API returns an error concerning the application #').$application['id_application'].':
        '.implode(',
        ', $this->errors).'

        '; + $this->errors = array(); + } + elseif ($code > 0) + { + $return_message = sprintf($this->l('Trusted Shops application number %1$d was successfully processed. The garantee number is: %2$d'), $application['id_application'], $code); + } + $sql = ' + UPDATE `'.$db_name.'` + SET `statut_number` = "'.$code.'" + WHERE `id_application` >= "'.$application['id_application'].'" + '; + Db::getInstance()->Execute($sql); + $msg = new Message(); + $msg->message = $return_message; + $msg->id_order = (int)$application['id_order']; + $msg->private = 1; + $msg->add(); + } + } + + /** + * Registration link to Trusted Shops + * + * @param string $shopsw + * @param string $et_cid + * @param string $et_lid + * @param string $lang + * @return boolean|string boolean in case of $lang is not supported by Trusted Shops + * string return is the url to access of form subscription + */ + private function _makeRegistrationLink($shopsw, $et_cid, $et_lid, $lang) + { + if(array_key_exists($lang, $this->registration_link)) + return $this->registration_link[$lang].sprintf('?shopsw=%s&et_cid=%s&et_lid=%s', urlencode($shopsw), urlencode($et_cid), urlencode($et_lid)); + return false; + } + + /** + * Method to display or redirect the subscription link. + * + * @param string $link + */ + private function _getRegistrationLink($link) + { + + return ' +
        + {/if} + + diff --git a/themes/prestashop/guest-tracking.tpl b/themes/prestashop/guest-tracking.tpl new file mode 100644 index 000000000..1b5ff03a5 --- /dev/null +++ b/themes/prestashop/guest-tracking.tpl @@ -0,0 +1,85 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Guest tracking'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Guest Tracking'}

        + +{if isset($order)} +
        +
        + {include file="$tpl_dir./order-detail.tpl"} +
        +
        + +

        {l s='For more advantages...'}

        + + {include file="$tpl_dir./errors.tpl"} + + {if isset($transformSuccess)} +

        {l s='Your guest account has been successfully transformed into a customer account. You can now log in on this'} {l s='page'}

        + {else} +
        +
        +

        {l s='Transform your guest account to a customer account and enjoy :'}

        +
          +
        • {l s='Personalized and secure access'}
        • +
        • {l s='Fast and easy check out'}
        • +
        • {l s='Easier merchandise return'}
        • +
        +

        + + +

        + + + + +

        +
        +
        + {/if} +{else} + {include file="$tpl_dir./errors.tpl"} +
        +
        +

        {l s='To track your order, please enter the following information:'}

        +

        + + + {l s='For example: 010123'} +

        + +

        + + +

        + +

        +
        +
        +{/if} diff --git a/themes/prestashop/header.tpl b/themes/prestashop/header.tpl new file mode 100644 index 000000000..e7671485e --- /dev/null +++ b/themes/prestashop/header.tpl @@ -0,0 +1,90 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + {$meta_title|escape:'htmlall':'UTF-8'} +{if isset($meta_description) AND $meta_description} + +{/if} +{if isset($meta_keywords) AND $meta_keywords} + +{/if} + + + + + + +{if isset($css_files)} + {foreach from=$css_files key=css_uri item=media} + + {/foreach} +{/if} +{if isset($js_files)} + {foreach from=$js_files item=js_uri} + + {/foreach} +{/if} + {$HOOK_HEADER} + + + + {if !$content_only} + {if isset($restricted_country_mode) && $restricted_country_mode} +
        +

        {l s='You cannot place a new order from your country.'} {$geolocation_country}

        +
        + {/if} +
        + + + + +
        + +
        + {$HOOK_LEFT_COLUMN} +
        + + +
        + {/if} diff --git a/themes/prestashop/history.tpl b/themes/prestashop/history.tpl new file mode 100644 index 000000000..14abbc71e --- /dev/null +++ b/themes/prestashop/history.tpl @@ -0,0 +1,92 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Order history'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} +{include file="$tpl_dir./errors.tpl"} + +

        {l s='Order history'}

        +

        {l s='Here are the orders you have placed since the creation of your account'}.

        + +{if $slowValidation}

        {l s='If you have just placed an order, it may take a few minutes for it to be validated. Please refresh the page if your order is missing.'}

        {/if} + +
        + {if $orders && count($orders)} + + + + + + + + + + + + + + {foreach from=$orders item=order name=myLoop} + + + + + + + + + + {/foreach} + +
        {l s='Order'}{l s='Date'}{l s='Total price'}{l s='Payment'}{l s='Status'}{l s='Invoice'} 
        {dateFormat date=$order.date_add full=0}{displayPrice price=$order.total_paid_real currency=$order.id_currency no_utf8=false convert=false}{$order.payment|escape:'htmlall':'UTF-8'}{if isset($order.order_state)}{$order.order_state|escape:'htmlall':'UTF-8'}{/if} + {if (isset($order.invoice) && $order.invoice && isset($order.invoice_number) && $order.invoice_number) && isset($invoiceAllowed) && $invoiceAllowed == true} + {l s='Invoice'} + {l s='PDF'} + {else}-{/if} + + {l s='details'} + + {l s='Reorder'} + +
        + + {else} +

        {l s='You have not placed any orders.'}

        + {/if} +
        + + diff --git a/themes/prestashop/identity.tpl b/themes/prestashop/identity.tpl new file mode 100644 index 000000000..b23caebd5 --- /dev/null +++ b/themes/prestashop/identity.tpl @@ -0,0 +1,139 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Your personal information'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

        {l s='Your personal information'}

        + +{include file="$tpl_dir./errors.tpl"} + +{if isset($confirmation) && $confirmation} +

        + {l s='Your personal information has been successfully updated.'} + {if isset($pwd_changed)}
        {l s='Your password has been sent to your e-mail:'} {$email|escape:'htmlall':'UTF-8'}{/if} +

        +{else} +

        {l s='Please do not hesitate to update your personal information if it has changed.'}

        +

        *{l s='Required field'}

        +
        +
        +

        + {l s='Title'} + + + + +

        +

        + + * +

        +

        + + * +

        +

        + + * +

        +

        + + * +

        +

        + + +

        +

        + + +

        +

        + + + {* + {l s='January'} + {l s='February'} + {l s='March'} + {l s='April'} + {l s='May'} + {l s='June'} + {l s='July'} + {l s='August'} + {l s='September'} + {l s='October'} + {l s='November'} + {l s='December'} + *} + + +

        + {if $newsletter} +

        + + +

        +

        + + +

        + {/if} +

        + +

        +
        +
        +

        + {l s='[Insert customer data privacy clause or law here, if applicable]'} +

        +{/if} + + diff --git a/themes/prestashop/img/address_alias_left.gif b/themes/prestashop/img/address_alias_left.gif new file mode 100644 index 000000000..df0d6399d Binary files /dev/null and b/themes/prestashop/img/address_alias_left.gif differ diff --git a/themes/prestashop/img/address_alias_right.gif b/themes/prestashop/img/address_alias_right.gif new file mode 100644 index 000000000..a0c0779cb Binary files /dev/null and b/themes/prestashop/img/address_alias_right.gif differ diff --git a/themes/prestashop/img/ajax-loader.gif b/themes/prestashop/img/ajax-loader.gif new file mode 100644 index 000000000..6f1fb335a Binary files /dev/null and b/themes/prestashop/img/ajax-loader.gif differ diff --git a/themes/prestashop/img/arrow_rotate_anticlockwise.png b/themes/prestashop/img/arrow_rotate_anticlockwise.png new file mode 100644 index 000000000..46c75aa85 Binary files /dev/null and b/themes/prestashop/img/arrow_rotate_anticlockwise.png differ diff --git a/themes/prestashop/img/bg_account.jpg b/themes/prestashop/img/bg_account.jpg new file mode 100644 index 000000000..5c1f1ff51 Binary files /dev/null and b/themes/prestashop/img/bg_account.jpg differ diff --git a/themes/prestashop/img/block_bg.jpg b/themes/prestashop/img/block_bg.jpg new file mode 100644 index 000000000..12d87c9d8 Binary files /dev/null and b/themes/prestashop/img/block_bg.jpg differ diff --git a/themes/prestashop/img/block_bg_myaccount.jpg b/themes/prestashop/img/block_bg_myaccount.jpg new file mode 100644 index 000000000..5ec840993 Binary files /dev/null and b/themes/prestashop/img/block_bg_myaccount.jpg differ diff --git a/themes/prestashop/img/block_category_item_bg.jpg b/themes/prestashop/img/block_category_item_bg.jpg new file mode 100644 index 000000000..cd1d8bfb6 Binary files /dev/null and b/themes/prestashop/img/block_category_item_bg.jpg differ diff --git a/themes/prestashop/img/block_exclusive_bg.jpg b/themes/prestashop/img/block_exclusive_bg.jpg new file mode 100644 index 000000000..0c2ee9f6d Binary files /dev/null and b/themes/prestashop/img/block_exclusive_bg.jpg differ diff --git a/themes/prestashop/img/block_exclusive_footer.jpg b/themes/prestashop/img/block_exclusive_footer.jpg new file mode 100644 index 000000000..d6891ddd5 Binary files /dev/null and b/themes/prestashop/img/block_exclusive_footer.jpg differ diff --git a/themes/prestashop/img/block_footer.gif b/themes/prestashop/img/block_footer.gif new file mode 100644 index 000000000..47c8de4ff Binary files /dev/null and b/themes/prestashop/img/block_footer.gif differ diff --git a/themes/prestashop/img/block_footer.png b/themes/prestashop/img/block_footer.png new file mode 100755 index 000000000..dc055ece1 Binary files /dev/null and b/themes/prestashop/img/block_footer.png differ diff --git a/themes/prestashop/img/block_footer_myaccount.jpg b/themes/prestashop/img/block_footer_myaccount.jpg new file mode 100644 index 000000000..84df35ea9 Binary files /dev/null and b/themes/prestashop/img/block_footer_myaccount.jpg differ diff --git a/themes/prestashop/img/block_header.gif b/themes/prestashop/img/block_header.gif new file mode 100644 index 000000000..98a450a5b Binary files /dev/null and b/themes/prestashop/img/block_header.gif differ diff --git a/themes/prestashop/img/block_header.png b/themes/prestashop/img/block_header.png new file mode 100755 index 000000000..3dbdc2c56 Binary files /dev/null and b/themes/prestashop/img/block_header.png differ diff --git a/themes/prestashop/img/block_header_exclusive.gif b/themes/prestashop/img/block_header_exclusive.gif new file mode 100644 index 000000000..da1bacdd4 Binary files /dev/null and b/themes/prestashop/img/block_header_exclusive.gif differ diff --git a/themes/prestashop/img/block_header_exclusive.png b/themes/prestashop/img/block_header_exclusive.png new file mode 100755 index 000000000..c19ec41e7 Binary files /dev/null and b/themes/prestashop/img/block_header_exclusive.png differ diff --git a/themes/prestashop/img/block_header_exclusive_cart.gif b/themes/prestashop/img/block_header_exclusive_cart.gif new file mode 100644 index 000000000..8315b8c31 Binary files /dev/null and b/themes/prestashop/img/block_header_exclusive_cart.gif differ diff --git a/themes/prestashop/img/block_header_exclusive_cart.png b/themes/prestashop/img/block_header_exclusive_cart.png new file mode 100755 index 000000000..26add9ea2 Binary files /dev/null and b/themes/prestashop/img/block_header_exclusive_cart.png differ diff --git a/themes/prestashop/img/block_header_large.gif b/themes/prestashop/img/block_header_large.gif new file mode 100644 index 000000000..cb40b7427 Binary files /dev/null and b/themes/prestashop/img/block_header_large.gif differ diff --git a/themes/prestashop/img/block_header_large.png b/themes/prestashop/img/block_header_large.png new file mode 100755 index 000000000..b0d5701ea Binary files /dev/null and b/themes/prestashop/img/block_header_large.png differ diff --git a/themes/prestashop/img/block_header_myaccount.jpg b/themes/prestashop/img/block_header_myaccount.jpg new file mode 100644 index 000000000..9af1a82a2 Binary files /dev/null and b/themes/prestashop/img/block_header_myaccount.jpg differ diff --git a/themes/prestashop/img/block_myaccount_header_large.gif b/themes/prestashop/img/block_myaccount_header_large.gif new file mode 100644 index 000000000..298636eac Binary files /dev/null and b/themes/prestashop/img/block_myaccount_header_large.gif differ diff --git a/themes/prestashop/img/block_search_bg.jpg b/themes/prestashop/img/block_search_bg.jpg new file mode 100644 index 000000000..b496335c7 Binary files /dev/null and b/themes/prestashop/img/block_search_bg.jpg differ diff --git a/themes/prestashop/img/bullet.gif b/themes/prestashop/img/bullet.gif new file mode 100644 index 000000000..e8aaa9e10 Binary files /dev/null and b/themes/prestashop/img/bullet.gif differ diff --git a/themes/prestashop/img/bullet_alt.jpg b/themes/prestashop/img/bullet_alt.jpg new file mode 100644 index 000000000..99fb424b1 Binary files /dev/null and b/themes/prestashop/img/bullet_alt.jpg differ diff --git a/themes/prestashop/img/bullet_myaccount.gif b/themes/prestashop/img/bullet_myaccount.gif new file mode 100644 index 000000000..e7f9e25e4 Binary files /dev/null and b/themes/prestashop/img/bullet_myaccount.gif differ diff --git a/themes/prestashop/img/bullet_price.gif b/themes/prestashop/img/bullet_price.gif new file mode 100644 index 000000000..b4a0ef353 Binary files /dev/null and b/themes/prestashop/img/bullet_price.gif differ diff --git a/themes/prestashop/img/button-account-large.gif b/themes/prestashop/img/button-account-large.gif new file mode 100644 index 000000000..ffb311741 Binary files /dev/null and b/themes/prestashop/img/button-account-large.gif differ diff --git a/themes/prestashop/img/button-account-mini.gif b/themes/prestashop/img/button-account-mini.gif new file mode 100644 index 000000000..97cc17325 Binary files /dev/null and b/themes/prestashop/img/button-account-mini.gif differ diff --git a/themes/prestashop/img/button-account-small.gif b/themes/prestashop/img/button-account-small.gif new file mode 100644 index 000000000..aa6aa735f Binary files /dev/null and b/themes/prestashop/img/button-account-small.gif differ diff --git a/themes/prestashop/img/button-account.gif b/themes/prestashop/img/button-account.gif new file mode 100644 index 000000000..8b4239486 Binary files /dev/null and b/themes/prestashop/img/button-account.gif differ diff --git a/themes/prestashop/img/button-large.gif b/themes/prestashop/img/button-large.gif new file mode 100644 index 000000000..b1a2bcda0 Binary files /dev/null and b/themes/prestashop/img/button-large.gif differ diff --git a/themes/prestashop/img/button-large.png b/themes/prestashop/img/button-large.png new file mode 100755 index 000000000..cdc6cb673 Binary files /dev/null and b/themes/prestashop/img/button-large.png differ diff --git a/themes/prestashop/img/button-large_exclusive.gif b/themes/prestashop/img/button-large_exclusive.gif new file mode 100644 index 000000000..ba5cc309c Binary files /dev/null and b/themes/prestashop/img/button-large_exclusive.gif differ diff --git a/themes/prestashop/img/button-medium.gif b/themes/prestashop/img/button-medium.gif new file mode 100644 index 000000000..cf429515f Binary files /dev/null and b/themes/prestashop/img/button-medium.gif differ diff --git a/themes/prestashop/img/button-medium.png b/themes/prestashop/img/button-medium.png new file mode 100755 index 000000000..061df6085 Binary files /dev/null and b/themes/prestashop/img/button-medium.png differ diff --git a/themes/prestashop/img/button-medium_exclusive.gif b/themes/prestashop/img/button-medium_exclusive.gif new file mode 100644 index 000000000..ebe67091f Binary files /dev/null and b/themes/prestashop/img/button-medium_exclusive.gif differ diff --git a/themes/prestashop/img/button-medium_exclusive.png b/themes/prestashop/img/button-medium_exclusive.png new file mode 100755 index 000000000..372681e1b Binary files /dev/null and b/themes/prestashop/img/button-medium_exclusive.png differ diff --git a/themes/prestashop/img/button-mini.gif b/themes/prestashop/img/button-mini.gif new file mode 100644 index 000000000..53cc95649 Binary files /dev/null and b/themes/prestashop/img/button-mini.gif differ diff --git a/themes/prestashop/img/button-mini.png b/themes/prestashop/img/button-mini.png new file mode 100755 index 000000000..8035b7f2a Binary files /dev/null and b/themes/prestashop/img/button-mini.png differ diff --git a/themes/prestashop/img/button-mini_exclusive.gif b/themes/prestashop/img/button-mini_exclusive.gif new file mode 100644 index 000000000..e7988886f Binary files /dev/null and b/themes/prestashop/img/button-mini_exclusive.gif differ diff --git a/themes/prestashop/img/button-small.gif b/themes/prestashop/img/button-small.gif new file mode 100644 index 000000000..998f601ca Binary files /dev/null and b/themes/prestashop/img/button-small.gif differ diff --git a/themes/prestashop/img/button-small.png b/themes/prestashop/img/button-small.png new file mode 100755 index 000000000..16f58d0bb Binary files /dev/null and b/themes/prestashop/img/button-small.png differ diff --git a/themes/prestashop/img/button-small_exclusive.gif b/themes/prestashop/img/button-small_exclusive.gif new file mode 100644 index 000000000..c56c23361 Binary files /dev/null and b/themes/prestashop/img/button-small_exclusive.gif differ diff --git a/themes/prestashop/img/flag_new_bg.jpg b/themes/prestashop/img/flag_new_bg.jpg new file mode 100644 index 000000000..7a5e68457 Binary files /dev/null and b/themes/prestashop/img/flag_new_bg.jpg differ diff --git a/themes/prestashop/img/footer_account.gif b/themes/prestashop/img/footer_account.gif new file mode 100644 index 000000000..f8126d010 Binary files /dev/null and b/themes/prestashop/img/footer_account.gif differ diff --git a/themes/prestashop/img/form-input-bg.gif b/themes/prestashop/img/form-input-bg.gif new file mode 100644 index 000000000..5aca1c724 Binary files /dev/null and b/themes/prestashop/img/form-input-bg.gif differ diff --git a/themes/prestashop/img/form_bg.jpg b/themes/prestashop/img/form_bg.jpg new file mode 100644 index 000000000..98085963a Binary files /dev/null and b/themes/prestashop/img/form_bg.jpg differ diff --git a/themes/prestashop/img/header_account.gif b/themes/prestashop/img/header_account.gif new file mode 100644 index 000000000..082590bfc Binary files /dev/null and b/themes/prestashop/img/header_account.gif differ diff --git a/themes/prestashop/img/icon/add.gif b/themes/prestashop/img/icon/add.gif new file mode 100644 index 000000000..df08c0b6b Binary files /dev/null and b/themes/prestashop/img/icon/add.gif differ diff --git a/themes/prestashop/img/icon/addrbook.gif b/themes/prestashop/img/icon/addrbook.gif new file mode 100644 index 000000000..a5b3a0d36 Binary files /dev/null and b/themes/prestashop/img/icon/addrbook.gif differ diff --git a/themes/prestashop/img/icon/available.gif b/themes/prestashop/img/icon/available.gif new file mode 100644 index 000000000..3f93c6a3f Binary files /dev/null and b/themes/prestashop/img/icon/available.gif differ diff --git a/themes/prestashop/img/icon/cancel.gif b/themes/prestashop/img/icon/cancel.gif new file mode 100644 index 000000000..fc4c2ce83 Binary files /dev/null and b/themes/prestashop/img/icon/cancel.gif differ diff --git a/themes/prestashop/img/icon/cancel_16x18.gif b/themes/prestashop/img/icon/cancel_16x18.gif new file mode 100644 index 000000000..64a59b287 Binary files /dev/null and b/themes/prestashop/img/icon/cancel_16x18.gif differ diff --git a/themes/prestashop/img/icon/cart.gif b/themes/prestashop/img/icon/cart.gif new file mode 100644 index 000000000..e1e1ab4e5 Binary files /dev/null and b/themes/prestashop/img/icon/cart.gif differ diff --git a/themes/prestashop/img/icon/cible.gif b/themes/prestashop/img/icon/cible.gif new file mode 100644 index 000000000..d50ec7ccc Binary files /dev/null and b/themes/prestashop/img/icon/cible.gif differ diff --git a/themes/prestashop/img/icon/contact.gif b/themes/prestashop/img/icon/contact.gif new file mode 100644 index 000000000..72f1de6e6 Binary files /dev/null and b/themes/prestashop/img/icon/contact.gif differ diff --git a/themes/prestashop/img/icon/delete.gif b/themes/prestashop/img/icon/delete.gif new file mode 100644 index 000000000..348537e13 Binary files /dev/null and b/themes/prestashop/img/icon/delete.gif differ diff --git a/themes/prestashop/img/icon/download_product.gif b/themes/prestashop/img/icon/download_product.gif new file mode 100644 index 000000000..f25a6121f Binary files /dev/null and b/themes/prestashop/img/icon/download_product.gif differ diff --git a/themes/prestashop/img/icon/error.gif b/themes/prestashop/img/icon/error.gif new file mode 100644 index 000000000..816705815 Binary files /dev/null and b/themes/prestashop/img/icon/error.gif differ diff --git a/themes/prestashop/img/icon/gift.gif b/themes/prestashop/img/icon/gift.gif new file mode 100644 index 000000000..2074a39fe Binary files /dev/null and b/themes/prestashop/img/icon/gift.gif differ diff --git a/themes/prestashop/img/icon/home.gif b/themes/prestashop/img/icon/home.gif new file mode 100644 index 000000000..50b176a77 Binary files /dev/null and b/themes/prestashop/img/icon/home.gif differ diff --git a/themes/prestashop/img/icon/infos.gif b/themes/prestashop/img/icon/infos.gif new file mode 100644 index 000000000..12cd1aef9 Binary files /dev/null and b/themes/prestashop/img/icon/infos.gif differ diff --git a/themes/prestashop/img/icon/less.gif b/themes/prestashop/img/icon/less.gif new file mode 100644 index 000000000..52928a267 Binary files /dev/null and b/themes/prestashop/img/icon/less.gif differ diff --git a/themes/prestashop/img/icon/magnify.gif b/themes/prestashop/img/icon/magnify.gif new file mode 100644 index 000000000..7bf707784 Binary files /dev/null and b/themes/prestashop/img/icon/magnify.gif differ diff --git a/themes/prestashop/img/icon/more.gif b/themes/prestashop/img/icon/more.gif new file mode 100644 index 000000000..072e49dfd Binary files /dev/null and b/themes/prestashop/img/icon/more.gif differ diff --git a/themes/prestashop/img/icon/my-account.gif b/themes/prestashop/img/icon/my-account.gif new file mode 100644 index 000000000..d9a5a9e49 Binary files /dev/null and b/themes/prestashop/img/icon/my-account.gif differ diff --git a/themes/prestashop/img/icon/next.gif b/themes/prestashop/img/icon/next.gif new file mode 100644 index 000000000..a4e084641 Binary files /dev/null and b/themes/prestashop/img/icon/next.gif differ diff --git a/themes/prestashop/img/icon/no.gif b/themes/prestashop/img/icon/no.gif new file mode 100644 index 000000000..3fdeb6365 Binary files /dev/null and b/themes/prestashop/img/icon/no.gif differ diff --git a/themes/prestashop/img/icon/order.gif b/themes/prestashop/img/icon/order.gif new file mode 100644 index 000000000..5ce7d1e2e Binary files /dev/null and b/themes/prestashop/img/icon/order.gif differ diff --git a/themes/prestashop/img/icon/pdf.gif b/themes/prestashop/img/icon/pdf.gif new file mode 100644 index 000000000..d5d9488f3 Binary files /dev/null and b/themes/prestashop/img/icon/pdf.gif differ diff --git a/themes/prestashop/img/icon/previous.gif b/themes/prestashop/img/icon/previous.gif new file mode 100644 index 000000000..aa59060c9 Binary files /dev/null and b/themes/prestashop/img/icon/previous.gif differ diff --git a/themes/prestashop/img/icon/quantity_down.gif b/themes/prestashop/img/icon/quantity_down.gif new file mode 100644 index 000000000..7a827069a Binary files /dev/null and b/themes/prestashop/img/icon/quantity_down.gif differ diff --git a/themes/prestashop/img/icon/quantity_down_off.gif b/themes/prestashop/img/icon/quantity_down_off.gif new file mode 100755 index 000000000..fe6de305e Binary files /dev/null and b/themes/prestashop/img/icon/quantity_down_off.gif differ diff --git a/themes/prestashop/img/icon/quantity_up.gif b/themes/prestashop/img/icon/quantity_up.gif new file mode 100644 index 000000000..3c2dcce60 Binary files /dev/null and b/themes/prestashop/img/icon/quantity_up.gif differ diff --git a/themes/prestashop/img/icon/recyclable.gif b/themes/prestashop/img/icon/recyclable.gif new file mode 100644 index 000000000..1d5dcd2fd Binary files /dev/null and b/themes/prestashop/img/icon/recyclable.gif differ diff --git a/themes/prestashop/img/icon/return.gif b/themes/prestashop/img/icon/return.gif new file mode 100644 index 000000000..198a934a3 Binary files /dev/null and b/themes/prestashop/img/icon/return.gif differ diff --git a/themes/prestashop/img/icon/search.gif b/themes/prestashop/img/icon/search.gif new file mode 100644 index 000000000..e32a989f1 Binary files /dev/null and b/themes/prestashop/img/icon/search.gif differ diff --git a/themes/prestashop/img/icon/serial_scroll_left.gif b/themes/prestashop/img/icon/serial_scroll_left.gif new file mode 100644 index 000000000..f42f520dd Binary files /dev/null and b/themes/prestashop/img/icon/serial_scroll_left.gif differ diff --git a/themes/prestashop/img/icon/serial_scroll_right.gif b/themes/prestashop/img/icon/serial_scroll_right.gif new file mode 100644 index 000000000..e6de011d1 Binary files /dev/null and b/themes/prestashop/img/icon/serial_scroll_right.gif differ diff --git a/themes/prestashop/img/icon/sitemap.gif b/themes/prestashop/img/icon/sitemap.gif new file mode 100644 index 000000000..594afa56e Binary files /dev/null and b/themes/prestashop/img/icon/sitemap.gif differ diff --git a/themes/prestashop/img/icon/slip.gif b/themes/prestashop/img/icon/slip.gif new file mode 100644 index 000000000..c4d1352da Binary files /dev/null and b/themes/prestashop/img/icon/slip.gif differ diff --git a/themes/prestashop/img/icon/sort_asc.gif b/themes/prestashop/img/icon/sort_asc.gif new file mode 100644 index 000000000..67345103c Binary files /dev/null and b/themes/prestashop/img/icon/sort_asc.gif differ diff --git a/themes/prestashop/img/icon/sort_asc_disabled.gif b/themes/prestashop/img/icon/sort_asc_disabled.gif new file mode 100644 index 000000000..c86a9a635 Binary files /dev/null and b/themes/prestashop/img/icon/sort_asc_disabled.gif differ diff --git a/themes/prestashop/img/icon/sort_asc_white.gif b/themes/prestashop/img/icon/sort_asc_white.gif new file mode 100644 index 000000000..9768c8638 Binary files /dev/null and b/themes/prestashop/img/icon/sort_asc_white.gif differ diff --git a/themes/prestashop/img/icon/sort_asc_white.png b/themes/prestashop/img/icon/sort_asc_white.png new file mode 100755 index 000000000..d73f00a21 Binary files /dev/null and b/themes/prestashop/img/icon/sort_asc_white.png differ diff --git a/themes/prestashop/img/icon/sort_desc.gif b/themes/prestashop/img/icon/sort_desc.gif new file mode 100644 index 000000000..f806d8534 Binary files /dev/null and b/themes/prestashop/img/icon/sort_desc.gif differ diff --git a/themes/prestashop/img/icon/sort_desc_disabled.gif b/themes/prestashop/img/icon/sort_desc_disabled.gif new file mode 100644 index 000000000..6ddb4ab14 Binary files /dev/null and b/themes/prestashop/img/icon/sort_desc_disabled.gif differ diff --git a/themes/prestashop/img/icon/sort_desc_white.gif b/themes/prestashop/img/icon/sort_desc_white.gif new file mode 100644 index 000000000..8c00b93e4 Binary files /dev/null and b/themes/prestashop/img/icon/sort_desc_white.gif differ diff --git a/themes/prestashop/img/icon/sort_desc_white.png b/themes/prestashop/img/icon/sort_desc_white.png new file mode 100755 index 000000000..12b1a2a95 Binary files /dev/null and b/themes/prestashop/img/icon/sort_desc_white.png differ diff --git a/themes/prestashop/img/icon/star.gif b/themes/prestashop/img/icon/star.gif new file mode 100644 index 000000000..182e7d42c Binary files /dev/null and b/themes/prestashop/img/icon/star.gif differ diff --git a/themes/prestashop/img/icon/unavailable.gif b/themes/prestashop/img/icon/unavailable.gif new file mode 100644 index 000000000..4356d4fd7 Binary files /dev/null and b/themes/prestashop/img/icon/unavailable.gif differ diff --git a/themes/prestashop/img/icon/up.gif b/themes/prestashop/img/icon/up.gif new file mode 100644 index 000000000..67345103c Binary files /dev/null and b/themes/prestashop/img/icon/up.gif differ diff --git a/themes/prestashop/img/icon/update.gif b/themes/prestashop/img/icon/update.gif new file mode 100644 index 000000000..a2c05ee2c Binary files /dev/null and b/themes/prestashop/img/icon/update.gif differ diff --git a/themes/prestashop/img/icon/userinfo.gif b/themes/prestashop/img/icon/userinfo.gif new file mode 100644 index 000000000..dee5739e9 Binary files /dev/null and b/themes/prestashop/img/icon/userinfo.gif differ diff --git a/themes/prestashop/img/icon/voucher.gif b/themes/prestashop/img/icon/voucher.gif new file mode 100644 index 000000000..020a5a783 Binary files /dev/null and b/themes/prestashop/img/icon/voucher.gif differ diff --git a/themes/prestashop/img/icon/yes.gif b/themes/prestashop/img/icon/yes.gif new file mode 100644 index 000000000..7902938e9 Binary files /dev/null and b/themes/prestashop/img/icon/yes.gif differ diff --git a/themes/prestashop/img/jquery/macFFBgHack.png b/themes/prestashop/img/jquery/macFFBgHack.png new file mode 100644 index 000000000..c6473b324 Binary files /dev/null and b/themes/prestashop/img/jquery/macFFBgHack.png differ diff --git a/themes/prestashop/img/logo_paiement_mastercard.jpg b/themes/prestashop/img/logo_paiement_mastercard.jpg new file mode 100644 index 000000000..6022d872f Binary files /dev/null and b/themes/prestashop/img/logo_paiement_mastercard.jpg differ diff --git a/themes/prestashop/img/logo_paiement_paypal.jpg b/themes/prestashop/img/logo_paiement_paypal.jpg new file mode 100644 index 000000000..c94c46c0d Binary files /dev/null and b/themes/prestashop/img/logo_paiement_paypal.jpg differ diff --git a/themes/prestashop/img/logo_paiement_visa.jpg b/themes/prestashop/img/logo_paiement_visa.jpg new file mode 100644 index 000000000..be8cc9ed2 Binary files /dev/null and b/themes/prestashop/img/logo_paiement_visa.jpg differ diff --git a/themes/prestashop/img/nav-logout.gif b/themes/prestashop/img/nav-logout.gif new file mode 100755 index 000000000..1d7775de6 Binary files /dev/null and b/themes/prestashop/img/nav-logout.gif differ diff --git a/themes/prestashop/img/onsale_en.gif b/themes/prestashop/img/onsale_en.gif new file mode 100644 index 000000000..48bfa342d Binary files /dev/null and b/themes/prestashop/img/onsale_en.gif differ diff --git a/themes/prestashop/img/onsale_es.gif b/themes/prestashop/img/onsale_es.gif new file mode 100644 index 000000000..787f007f2 Binary files /dev/null and b/themes/prestashop/img/onsale_es.gif differ diff --git a/themes/prestashop/img/onsale_fr.gif b/themes/prestashop/img/onsale_fr.gif new file mode 100644 index 000000000..38cd74237 Binary files /dev/null and b/themes/prestashop/img/onsale_fr.gif differ diff --git a/themes/prestashop/img/pagination-bg-current.gif b/themes/prestashop/img/pagination-bg-current.gif new file mode 100644 index 000000000..210590a20 Binary files /dev/null and b/themes/prestashop/img/pagination-bg-current.gif differ diff --git a/themes/prestashop/img/pagination-next-border.gif b/themes/prestashop/img/pagination-next-border.gif new file mode 100644 index 000000000..275f9ad30 Binary files /dev/null and b/themes/prestashop/img/pagination-next-border.gif differ diff --git a/themes/prestashop/img/pagination-prev-border.gif b/themes/prestashop/img/pagination-prev-border.gif new file mode 100644 index 000000000..903d7afa4 Binary files /dev/null and b/themes/prestashop/img/pagination-prev-border.gif differ diff --git a/themes/prestashop/img/pagination-prevnext-bg.gif b/themes/prestashop/img/pagination-prevnext-bg.gif new file mode 100644 index 000000000..d14448458 Binary files /dev/null and b/themes/prestashop/img/pagination-prevnext-bg.gif differ diff --git a/themes/prestashop/img/pagination_bg.gif b/themes/prestashop/img/pagination_bg.gif new file mode 100644 index 000000000..824748ea4 Binary files /dev/null and b/themes/prestashop/img/pagination_bg.gif differ diff --git a/themes/prestashop/img/product-buy-bg.gif b/themes/prestashop/img/product-buy-bg.gif new file mode 100644 index 000000000..626fb3f63 Binary files /dev/null and b/themes/prestashop/img/product-buy-bg.gif differ diff --git a/themes/prestashop/img/product-short-desc-bg.gif b/themes/prestashop/img/product-short-desc-bg.gif new file mode 100644 index 000000000..dda67ed0a Binary files /dev/null and b/themes/prestashop/img/product-short-desc-bg.gif differ diff --git a/themes/prestashop/img/rss.gif b/themes/prestashop/img/rss.gif new file mode 100644 index 000000000..12c1d33b5 Binary files /dev/null and b/themes/prestashop/img/rss.gif differ diff --git a/themes/prestashop/img/sitemap-horizontal.gif b/themes/prestashop/img/sitemap-horizontal.gif new file mode 100644 index 000000000..2cea2f772 Binary files /dev/null and b/themes/prestashop/img/sitemap-horizontal.gif differ diff --git a/themes/prestashop/img/sitemap-horizontal.png b/themes/prestashop/img/sitemap-horizontal.png new file mode 100755 index 000000000..8810d5488 Binary files /dev/null and b/themes/prestashop/img/sitemap-horizontal.png differ diff --git a/themes/prestashop/img/sitemap-last.gif b/themes/prestashop/img/sitemap-last.gif new file mode 100644 index 000000000..ee3a5ef3f Binary files /dev/null and b/themes/prestashop/img/sitemap-last.gif differ diff --git a/themes/prestashop/img/sitemap-top.gif b/themes/prestashop/img/sitemap-top.gif new file mode 100644 index 000000000..98a27e4a0 Binary files /dev/null and b/themes/prestashop/img/sitemap-top.gif differ diff --git a/themes/prestashop/img/sitemap_long.gif b/themes/prestashop/img/sitemap_long.gif new file mode 100644 index 000000000..61e090b6a Binary files /dev/null and b/themes/prestashop/img/sitemap_long.gif differ diff --git a/themes/prestashop/img/step_current.gif b/themes/prestashop/img/step_current.gif new file mode 100644 index 000000000..2b63ceced Binary files /dev/null and b/themes/prestashop/img/step_current.gif differ diff --git a/themes/prestashop/img/step_end.gif b/themes/prestashop/img/step_end.gif new file mode 100644 index 000000000..fd181fd50 Binary files /dev/null and b/themes/prestashop/img/step_end.gif differ diff --git a/themes/prestashop/img/step_end_current.gif b/themes/prestashop/img/step_end_current.gif new file mode 100644 index 000000000..e1a6c42e5 Binary files /dev/null and b/themes/prestashop/img/step_end_current.gif differ diff --git a/themes/prestashop/img/step_standard.gif b/themes/prestashop/img/step_standard.gif new file mode 100644 index 000000000..18fd20667 Binary files /dev/null and b/themes/prestashop/img/step_standard.gif differ diff --git a/themes/prestashop/img/step_start.gif b/themes/prestashop/img/step_start.gif new file mode 100644 index 000000000..e595e199d Binary files /dev/null and b/themes/prestashop/img/step_start.gif differ diff --git a/themes/prestashop/img/tab_bg.jpg b/themes/prestashop/img/tab_bg.jpg new file mode 100644 index 000000000..79f1e23ae Binary files /dev/null and b/themes/prestashop/img/tab_bg.jpg differ diff --git a/themes/prestashop/img/tab_bg_selected.jpg b/themes/prestashop/img/tab_bg_selected.jpg new file mode 100644 index 000000000..18610f21a Binary files /dev/null and b/themes/prestashop/img/tab_bg_selected.jpg differ diff --git a/themes/prestashop/img/tab_bg_selected_short.jpg b/themes/prestashop/img/tab_bg_selected_short.jpg new file mode 100644 index 000000000..914fe292b Binary files /dev/null and b/themes/prestashop/img/tab_bg_selected_short.jpg differ diff --git a/themes/prestashop/img/tab_bg_short.jpg b/themes/prestashop/img/tab_bg_short.jpg new file mode 100644 index 000000000..b15dcddd3 Binary files /dev/null and b/themes/prestashop/img/tab_bg_short.jpg differ diff --git a/themes/prestashop/img/table_footer.gif b/themes/prestashop/img/table_footer.gif new file mode 100644 index 000000000..01f1e34f4 Binary files /dev/null and b/themes/prestashop/img/table_footer.gif differ diff --git a/themes/prestashop/img/table_header.gif b/themes/prestashop/img/table_header.gif new file mode 100644 index 000000000..0c25ee4d7 Binary files /dev/null and b/themes/prestashop/img/table_header.gif differ diff --git a/themes/prestashop/img/thumbs_left.gif b/themes/prestashop/img/thumbs_left.gif new file mode 100644 index 000000000..2830a5fc8 Binary files /dev/null and b/themes/prestashop/img/thumbs_left.gif differ diff --git a/themes/prestashop/img/thumbs_right.gif b/themes/prestashop/img/thumbs_right.gif new file mode 100644 index 000000000..8fc577522 Binary files /dev/null and b/themes/prestashop/img/thumbs_right.gif differ diff --git a/themes/prestashop/img/title_bg.gif b/themes/prestashop/img/title_bg.gif new file mode 100644 index 000000000..44fd38e9a Binary files /dev/null and b/themes/prestashop/img/title_bg.gif differ diff --git a/themes/prestashop/img/title_bg.png b/themes/prestashop/img/title_bg.png new file mode 100755 index 000000000..628588424 Binary files /dev/null and b/themes/prestashop/img/title_bg.png differ diff --git a/themes/prestashop/img/title_bg_large.gif b/themes/prestashop/img/title_bg_large.gif new file mode 100644 index 000000000..d06f6e6ba Binary files /dev/null and b/themes/prestashop/img/title_bg_large.gif differ diff --git a/themes/prestashop/index.php b/themes/prestashop/index.php new file mode 100644 index 000000000..6426e7216 --- /dev/null +++ b/themes/prestashop/index.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; +?> \ No newline at end of file diff --git a/themes/prestashop/index.tpl b/themes/prestashop/index.tpl new file mode 100644 index 000000000..ad63a2fd3 --- /dev/null +++ b/themes/prestashop/index.tpl @@ -0,0 +1,27 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$HOOK_HOME} \ No newline at end of file diff --git a/themes/prestashop/js/cart-summary.js b/themes/prestashop/js/cart-summary.js new file mode 100644 index 000000000..82b14d02d --- /dev/null +++ b/themes/prestashop/js/cart-summary.js @@ -0,0 +1,392 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(document).ready(function() +{ + $('.cart_quantity_up').unbind('click').click(function(){ upQuantity($(this).attr('id').replace('cart_quantity_up_', '')); return false; }); + $('.cart_quantity_down').unbind('click').click(function(){ downQuantity($(this).attr('id').replace('cart_quantity_down_', '')); return false; }); + $('.cart_quantity_delete' ).unbind('click').click(function(){ deletProductFromSummary($(this).attr('id')); return false; }); + $('.cart_quantity_input').typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: updateQty }); +}); + +function updateQty(val) +{ + var id = $(this.el).attr('name'); + var exp = new RegExp("^[0-9]+$"); + + if (exp.test(val) == true) + { + var hidden = $('input[name='+ id +'_hidden]').val(); + var input = $('input[name='+ id +']').val(); + var QtyToUp = parseInt(input) - parseInt(hidden); + + if (parseInt(QtyToUp) > 0) + upQuantity(id.replace('quantity_', ''),QtyToUp); + else if(parseInt(QtyToUp) < 0) + downQuantity(id.replace('quantity_', ''),QtyToUp); + } + else + $('input[name='+ id +']').val($('input[name='+ id +'_hidden]').val()); +} + +function deletProductFromSummary(id) +{ + var customizationId = 0; + var productId = 0; + var productAttributeId = 0; + var ids = 0; + ids = id.split('_'); + productId = parseInt(ids[0]); + if (typeof(ids[1]) != 'undefined') + productAttributeId = parseInt(ids[1]); + if (typeof(ids[2]) != 'undefined') + customizationId = parseInt(ids[2]); + $.ajax({ + type: 'GET', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType: 'json', + data: 'ajax=true&delete&summary&id_product='+productId+'&ipa='+productAttributeId+ ( (customizationId != 0) ? '&id_customization='+customizationId : '') + '&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + } + else + { + if (parseInt(jsonData.summary.products.length) == 0) + { + $('#center_column').children().each(function() { + if ($(this).attr('id') != 'emptyCartWarning' && $(this).attr('class') != 'breadcrumb' && $(this).attr('id') != 'cart_title') + { + $(this).fadeOut('slow', function () { + $(this).remove(); + }); + } + }); + $('#summary_products_label').remove(); + $('#emptyCartWarning').fadeIn('slow'); + } + else + { + $('#product_'+ id).fadeOut('slow', function() { + $(this).remove(); + }); + + var exist = false; + for (i=0;i delete product line + if (!exist) + $('#product_'+ productId+'_'+productAttributeId).fadeOut('slow', function() { + $(this).remove(); + }); + } + updateCartSummary(jsonData.summary); + updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); + updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); + updateCustomizedDatas(jsonData.customizedDatas); + if (jsonData.carriers != null) + updateCarrierList(jsonData); + + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +function upQuantity(id, qty) +{ + if(typeof(qty)=='undefined' || !qty) + qty = 1; + var customizationId = 0; + var productId = 0; + var productAttributeId = 0; + var ids = 0; + ids = id.split('_'); + productId = parseInt(ids[0]); + if (typeof(ids[1]) != 'undefined') + productAttributeId = parseInt(ids[1]); + if (typeof(ids[2]) != 'undefined') + customizationId = parseInt(ids[2]); + $.ajax({ + type: 'GET', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType: 'json', + data: 'ajax=true&add&summary&id_product='+productId+'&ipa='+productAttributeId + ( (customizationId != 0) ? '&id_customization='+customizationId : '') + '&qty='+qty+'&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + $('input[name=quantity_'+ id +']').val($('input[name=quantity_'+ id +'_hidden]').val()); + } + else + { + updateCustomizedDatas(jsonData.customizedDatas); + updateCartSummary(jsonData.summary); + updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); + updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); + if (jsonData.carriers != null) + updateCarrierList(jsonData); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +function downQuantity(id, qty) +{ + var val = $('input[name=quantity_'+id+']').val(); + var newVal = val; + if(typeof(qty)=='undefined' || !qty) + { + qty = 1; + newVal = val - 1; + } + else if (qty < 0) + qty = -qty; + var customizationId = 0; + var productId = 0; + var productAttributeId = 0; + var ids = 0; + if (newVal > 0) + { + ids = id.split('_'); + productId = parseInt(ids[0]); + if (typeof(ids[1]) != 'undefined') + productAttributeId = parseInt(ids[1]); + if (typeof(ids[2]) != 'undefined') + customizationId = parseInt(ids[2]); + $.ajax({ + type: 'GET', + url: baseDir + 'cart.php', + async: true, + cache: false, + dataType: 'json', + data: 'ajax=true&add&summary&id_product='+productId+'&ipa='+productAttributeId+'&op=down' + ( (customizationId != 0) ? '&id_customization='+customizationId : '') + '&qty='+qty+'&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + $('input[name=quantity_'+ id +']').val($('input[name=quantity_'+ id +'_hidden]').val()); + } + else + { + updateCustomizedDatas(jsonData.customizedDatas); + updateCartSummary(jsonData.summary); + updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); + updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); + if (jsonData.carriers != null) + updateCarrierList(jsonData); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); + + } + else + { + deletProductFromSummary(id); + } +} + +function updateCartSummary(json) +{ + // Update products prices + discount + var i; + var nbrProducts = 0; + for (i=0;i 1 ? txtProducts : txtProduct)); + if (priceDisplayMethod != 0) + $('#total_product').html(formatCurrency(json.total_products, currencyFormat, currencySign, currencyBlank)); + else + $('#total_product').html(formatCurrency(json.total_products_wt, currencyFormat, currencySign, currencyBlank)); + $('#total_price').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank)); + $('#total_price_without_tax').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank)); + $('#total_tax').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank)); + + if (json.total_shipping <= 0) + $('.cart_total_delivery').fadeOut(); + else + { + $('.cart_total_delivery').fadeIn(); + if (priceDisplayMethod != 0) + { + $('#total_shipping').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank)); + } + else + { + $('#total_shipping').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank)); + } + } + + if (json.free_ship > 0 && !json.is_virtual_cart) + { + $('.cart_free_shipping').fadeIn(); + $('#free_shipping').html(formatCurrency(json.free_ship, currencyFormat, currencySign, currencyBlank)); + } + else + $('.cart_free_shipping').hide(); + + if (json.total_wrapping > 0) + { + $('#total_wrapping').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank)); + $('#total_wrapping').parent().show(); + } + else + { + $('#total_wrapping').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank)); + $('#total_wrapping').parent().hide(); + } + if (window.ajaxCart !== undefined) + ajaxCart.refresh(); +} + +function updateCustomizedDatas(json) +{ + for(i in json) + for(j in json[i]) + for(k in json[i][j]) + { + $('input[name=quantity_'+i+'_'+j+'_'+k+'_hidden]').val(json[i][j][k]['quantity']); + $('input[name=quantity_'+i+'_'+j+'_'+k+']').val(json[i][j][k]['quantity']); + } +} + +function updateHookShoppingCart(html) +{ + $('#HOOK_SHOPPING_CART').html(html); +} + +function updateHookShoppingCartExtra(html) +{ + $('#HOOK_SHOPPING_CART_EXTRA').html(html); +} + diff --git a/themes/prestashop/js/cms.js b/themes/prestashop/js/cms.js new file mode 100644 index 000000000..aa5b2f0d2 --- /dev/null +++ b/themes/prestashop/js/cms.js @@ -0,0 +1,41 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function submitPublishCMS(url, redirect) +{ + var id_cms = $('#admin-action-cms-id').val(); + + $.ajaxSetup({async: false}); + $.post(url+'/ajax.php', { submitPublishCMS: '1', id_cms: id_cms, status: 1, redirect: redirect }, + function(data) + { + if (data.indexOf('error') === -1) + document.location.href = data; + } + ); + + return true; +} \ No newline at end of file diff --git a/themes/prestashop/js/history.js b/themes/prestashop/js/history.js new file mode 100644 index 000000000..1cffb230a --- /dev/null +++ b/themes/prestashop/js/history.js @@ -0,0 +1,127 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +//show the order-details with ajax +function showOrder(mode, var_content, file) +{ + var url; + if (file.match(/^https?:\/\//)) + url = file; + else + url = baseDir + file + '.php'; + + $.get( + url, + ((mode == 1) ? {'id_order': var_content, 'ajax': true} : {'id_order_return': var_content, 'ajax': true}), + function(data) + { + $('#block-order-detail').fadeOut('slow', function() + { + $(this).html(data); + /* if return is allowed*/ + if ($('div#order-detail-content table td.order_cb').length > 0) + { + //return slip : check or uncheck every checkboxes + $('form div#order-detail-content th input[type=checkbox]').click(function() + { + $('form div#order-detail-content td input[type=checkbox]').each(function() + { + this.checked = $('form div#order-detail-content th input[type=checkbox]').is(':checked'); + updateOrderLineDisplay(this); + }); + }); + //return slip : enable or disable 'global' quantity editing + $('form div#order-detail-content td input[type=checkbox]').click(function() + { + updateOrderLineDisplay(this); + }); + //return slip : limit quantities + $('form div#order-detail-content td input.order_qte_input').keyup(function() + { + var maxQuantity = parseInt($(this).parent().find('span.order_qte_span').text()); + var quantity = parseInt($(this).val()); + if (isNaN($(this).val()) && $(this).val() != '') + { + $(this).val(maxQuantity); + } + else + { + if (quantity > maxQuantity) + $(this).val(maxQuantity); + else if (quantity < 1) + $(this).val(1); + } + }); + } + //catch the submit event of sendOrderMessage form + $('form#sendOrderMessage').submit(function(){ + return sendOrderMessage(); + }); + $(this).fadeIn('slow'); + $.scrollTo(this, 1200); + }); + }); +} + +function updateOrderLineDisplay(domCheckbox){ + var lineQuantitySpan = $(domCheckbox).parent().parent().find('span.order_qte_span'); + var lineQuantityInput = $(domCheckbox).parent().parent().find('input.order_qte_input'); + if($(domCheckbox).is(':checked')) + { + lineQuantitySpan.hide(); + lineQuantityInput.show(); + } + else + { + lineQuantityInput.hide(); + lineQuantityInput.val(lineQuantitySpan.text()); + lineQuantitySpan.show(); + } +} + +//send a message in relation to the order with ajax +function sendOrderMessage (){ + paramString = "ajax=true"; + $('form#sendOrderMessage').find('input, textarea').each(function(){ + paramString += '&' + $(this).attr('name') + '=' + encodeURI($(this).val()); + }); + $.ajax({ + type: "POST", + url: baseDir + "order-detail.php", + data: paramString, + success: function (msg){ + $('#block-order-detail').fadeOut('slow', function() { + $(this).html(msg); + //catch the submit event of sendOrderMessage form + $('form#sendOrderMessage').submit(function(){ + return sendOrderMessage(); + }); + $(this).fadeIn('slow'); + }); + } + }); + return false; +} diff --git a/themes/prestashop/js/order-address.js b/themes/prestashop/js/order-address.js new file mode 100644 index 000000000..95e87dbbf --- /dev/null +++ b/themes/prestashop/js/order-address.js @@ -0,0 +1,121 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(document).ready(function() +{ + updateAddressesDisplay(true); +}); + +//update the display of the addresses +function updateAddressesDisplay(first_view) +{ + // update content of delivery address + updateAddressDisplay('delivery'); + + // update content of invoice address + //if addresses have to be equals... + var txtInvoiceTitle = $('ul#address_invoice li.address_title').html(); + if ($('input[type=checkbox]#addressesAreEquals:checked').length == 1) + { + $('#address_invoice_form:visible').hide('fast'); + $('ul#address_invoice').html($('ul#address_delivery').html()); + $('ul#address_invoice li.address_title').html(txtInvoiceTitle); + } + else + { + $('#address_invoice_form:hidden').show('fast'); + if ($('select#id_address_invoice').val()) + updateAddressDisplay('invoice'); + else + { + $('ul#address_invoice').html($('ul#address_delivery').html()); + $('ul#address_invoice li.address_title').html(txtInvoiceTitle); + } + } + + if(!first_view) + { + if (orderProcess == 'order') + updateAddresses(); + } + + return true; +} + +function updateAddressDisplay(addressType) +{ + if (addresses.length <= 0) + return false; + + var idAddress = $('select#id_address_' + addressType + '').val(); + $('ul#address_' + addressType + ' li.address_company').html(addresses[idAddress][0]); + if(addresses[idAddress][0] == '') + $('ul#address_' + addressType + ' li.address_company').hide(); + else + $('ul#address_' + addressType + ' li.address_company').show(); + $('ul#address_' + addressType + ' li.address_name').html(addresses[idAddress][1] + ' ' + addresses[idAddress][2]); + $('ul#address_' + addressType + ' li.address_address1').html(addresses[idAddress][3]); + $('ul#address_' + addressType + ' li.address_address2').html(addresses[idAddress][4]); + if(addresses[idAddress][4] == '') + $('ul#address_' + addressType + ' li.address_address2').hide(); + else + $('ul#address_' + addressType + ' li.address_address2').show(); + $('ul#address_' + addressType + ' li.address_city').html(addresses[idAddress][5] + ' ' + addresses[idAddress][6]); + $('ul#address_' + addressType + ' li.address_country').html(addresses[idAddress][7] + (addresses[idAddress][8] != '' ? ' (' + addresses[idAddress][8] +')' : '')); + // change update link + var link = $('ul#address_' + addressType + ' li.address_update a').attr('href'); + var expression = /id_address=\d+/; + link = link.replace(expression, 'id_address='+idAddress); + $('ul#address_' + addressType + ' li.address_update a').attr('href', link); +} + +function updateAddresses() +{ + var idAddress_delivery = $('select#id_address_delivery').val(); + var idAddress_invoice = $('input[type=checkbox]#addressesAreEquals:checked').length == 1 ? idAddress_delivery : $('select#id_address_invoice').val(); + + $.ajax({ + type: 'POST', + url: baseDir + 'order.php', + async: true, + cache: false, + dataType : "json", + data: 'processAddress=true&step=2&ajax=true&id_address_delivery=' + idAddress_delivery + '&id_address_invoice=' + idAddress_invoice+ '&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save adresses \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} \ No newline at end of file diff --git a/themes/prestashop/js/order-opc.js b/themes/prestashop/js/order-opc.js new file mode 100755 index 000000000..725f57b50 --- /dev/null +++ b/themes/prestashop/js/order-opc.js @@ -0,0 +1,674 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function updateCarrierList(json) +{ + var carriers = json.carriers; + + /* contains all carrier available for this address */ + if (carriers.length == 0) + { + checkedCarrier = 0; + $('input[name=id_carrier]:checked').attr('checked', false); + $('#noCarrierWarning').show(); + $('#extra_carrier').hide(); + $('#recyclable_block').hide(); + $('table#carrierTable:visible').hide(); + } + else + { + checkedCarrier = json.checked; + var html = ''; + for (i=0;i'; + + html = html + + ''+ + ''+ + ''+ + ''+carriers[i].delay+''+ + ''+formatCurrency(carriers[i].price, currencyFormat, currencySign, currencyBlank)+''; + if (taxEnabled && displayPrice == 0) + html = html + ' ' + txtWithTax; + else + html = html + ' ' + txtWithoutTax; + html = html + ''+ + ''; + } + if (json.HOOK_EXTRACARRIER !== null && json.HOOK_EXTRACARRIER != undefined) html += json.HOOK_EXTRACARRIER; + $('#noCarrierWarning').hide(); + $('#extra_carrier:hidden').show(); + $('table#carrierTable tbody').html(html); + $('table#carrierTable:hidden').show(); + $('#recyclable_block:hidden').show(); + } + + /* update hooks for carrier module */ + $('#HOOK_BEFORECARRIER').html(json.HOOK_BEFORECARRIER); +} + +function updatePaymentMethods(json) +{ + $('#HOOK_TOP_PAYMENT').html(json.HOOK_TOP_PAYMENT); + $('#opc_payment_methods-content div#HOOK_PAYMENT').html(json.HOOK_PAYMENT); +} + +function updateAddressSelection() +{ + var idAddress_delivery = ($('input#opc_id_address_delivery').length == 1 ? $('input#opc_id_address_delivery').val() : $('select#id_address_delivery').val()); + var idAddress_invoice = ($('input#opc_id_address_invoice').length == 1 ? $('input#opc_id_address_invoice').val() : ($('input[type=checkbox]#addressesAreEquals:checked').length == 1 ? idAddress_delivery : ($('select#id_address_invoice').length == 1 ? $('select#id_address_invoice').val() : idAddress_delivery))); + + $('#opc_account-overlay').fadeIn('slow'); + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $('#opc_payment_methods-overlay').fadeIn('slow'); + + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&method=updateAddressesSelected&id_address_delivery=' + idAddress_delivery + '&id_address_invoice=' + idAddress_invoice + '&token=' + static_token, + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + else + { + updateCarrierList(jsonData); + updatePaymentMethods(jsonData); + updateCartSummary(jsonData.summary); + updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); + updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); + if ($('#gift-price').length == 1) + $('#gift-price').html(jsonData.gift_price); + $('#opc_account-overlay').fadeOut('slow'); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + $('#opc_payment_methods-overlay').fadeOut('slow'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save adresses \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +function getCarrierListAndUpdate() +{ + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&method=getCarrierList&token=' + static_token, + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + else + updateCarrierList(jsonData); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + } + }); +} + +function updateCarrierSelectionAndGift() +{ + var recyclablePackage = 0; + var gift = 0; + var giftMessage = ''; + var idCarrier = 0; + + if ($('input#recyclable:checked').length) + recyclablePackage = 1; + if ($('input#gift:checked').length) + { + gift = 1; + giftMessage = encodeURIComponent($('textarea#gift_message').val()); + } + + if ($('input[name=id_carrier]:checked').length) + { + idCarrier = $('input[name=id_carrier]:checked').val(); + checkedCarrier = idCarrier; + } + + $('#opc_payment_methods-overlay').fadeIn('slow'); + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&method=updateCarrierAndGetPayments&id_carrier=' + idCarrier + '&recyclable=' + recyclablePackage + '&gift=' + gift + '&gift_message=' + giftMessage + '&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + else + { + updateCartSummary(jsonData.summary); + updatePaymentMethods(jsonData); + updateHookShoppingCart(jsonData.summary.HOOK_SHOPPING_CART); + updateHookShoppingCartExtra(jsonData.summary.HOOK_SHOPPING_CART_EXTRA); + $('#opc_payment_methods-overlay').fadeOut('slow'); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save carrier \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +function confirmFreeOrder() +{ + if ($('#opc_new_account-overlay').length != 0) + $('#opc_new_account-overlay').fadeIn('slow'); + else + $('#opc_account-overlay').fadeIn('slow'); + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $('#opc_payment_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "html", + data: 'ajax=true&method=makeFreeOrder&token=' + static_token , + success: function(html) + { + var array_split = html.split(':'); + if (array_split[0] === 'freeorder') + { + if (isGuest) + document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(array_split[1])+'&email='+encodeURIComponent(array_split[2]); + else + document.location.href = historyUrl; + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to confirm the order \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +function saveAddress(type) +{ + if (type != 'delivery' && type != 'invoice') + return false; + + var params = 'firstname='+encodeURIComponent($('#firstname'+(type == 'invoice' ? '_invoice' : '')).val())+'&lastname='+encodeURIComponent($('#lastname'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'company='+encodeURIComponent($('#company'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'vat_number='+encodeURIComponent($('#vat_number'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'dni='+encodeURIComponent($('#dni'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'address1='+encodeURIComponent($('#address1'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'address2='+encodeURIComponent($('#address2'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'postcode='+encodeURIComponent($('#postcode'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'city='+encodeURIComponent($('#city'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'id_country='+encodeURIComponent($('#id_country'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'id_state='+encodeURIComponent($('#id_state'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'other='+encodeURIComponent($('#other'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'phone='+encodeURIComponent($('#phone'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'phone_mobile='+encodeURIComponent($('#phone_mobile'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + params += 'alias='+encodeURIComponent($('#alias'+(type == 'invoice' ? '_invoice' : '')).val())+'&'; + // Clean the last & + params = params.substr(0, params.length-1); + + var result = false; + + $.ajax({ + type: 'POST', + url: addressUrl, + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&submitAddress=true&type='+type+'&'+params+'&token=' + static_token, + success: function(jsonData) + { + if (jsonData.hasError) + { + var tmp = ''; + var i = 0; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + { + i = i+1; + tmp += '
      • '+jsonData.errors[error]+'
      • '; + } + tmp += ''; + var errors = ''+txtThereis+' '+i+' '+txtErrors+':
          '+tmp; + $('#opc_account_errors').html(errors).slideDown('slow'); + $.scrollTo('#opc_account_errors', 800); + $('#opc_new_account-overlay').fadeOut('slow'); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + $('#opc_payment_methods-overlay').fadeOut('slow'); + result = false; + } + else + { + // update addresses id + $('input#opc_id_address_delivery').val(jsonData.id_address_delivery); + $('input#opc_id_address_invoice').val(jsonData.id_address_invoice); + + result = true; + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save adresses \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); + + return result; +} + +function updateNewAccountToAddressBlock() +{ + $('#opc_new_account-overlay').fadeIn('slow'); + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $('#opc_payment_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&method=getAddressBlockAndCarriersAndPayments&token=' + static_token , + success: function(json) + { + $('#opc_new_account').fadeOut('fast', function() { + $('#opc_new_account').html(json.order_opc_adress); + // update block user info + if (json.block_user_info != '' && $('#header_user').length == 1) + { + $('#header_user').fadeOut('slow', function() { + $(this).attr('id', 'header_user_old').after(json.block_user_info).fadeIn('slow'); + $('#header_user_old').remove(); + }); + } + $('#opc_new_account').fadeIn('fast', function() { + updateAddressesDisplay(true); + updateCarrierList(json.carrier_list); + updatePaymentMethods(json); + if ($('#gift-price').length == 1) + $('#gift-price').html(json.gift_price); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + $('#opc_payment_methods-overlay').fadeOut('slow'); + }); + }); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to send login informations \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); +} + +$(function() { + // GUEST CHECKOUT / NEW ACCOUNT MANAGEMENT + if ((!isLogged) || (isGuest)) + { + if (guestCheckoutEnabled && !isLogged) + { + $('#opc_account_choice').show(); + $('#opc_account_form').hide(); + $('#opc_invoice_address').hide(); + + $('#opc_createAccount').click(function() { + $('.is_customer_param').show(); + $('#opc_account_form').slideDown('slow'); + $('#is_new_customer').val('1'); + $('#opc_account_choice').hide(); + $('#opc_invoice_address').hide(); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + }); + $('#opc_guestCheckout').click(function() { + $('.is_customer_param').hide(); + $('#opc_account_form').slideDown('slow'); + $('#is_new_customer').val('0'); + $('#opc_account_choice').hide(); + $('#opc_invoice_address').hide(); + $('#new_account_title').html(txtInstantCheckout); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + }); + } + else if (isGuest) + { + $('.is_customer_param').hide(); + $('#opc_account_form').show('slow'); + $('#is_new_customer').val('0'); + $('#opc_account_choice').hide(); + $('#opc_invoice_address').hide(); + $('#new_account_title').html(txtInstantCheckout); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + } + else + { + $('#opc_account_choice').hide(); + $('#is_new_customer').val('1'); + $('.is_customer_param').show(); + $('#opc_account_form').show(); + $('#opc_invoice_address').hide(); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + } + + // LOGIN FORM + $('#openLoginFormBlock').click(function() { + $('#openNewAccountBlock').show(); + $(this).hide(); + $('#login_form_content').slideDown('slow'); + $('#new_account_form_content').slideUp('slow'); + return false; + }); + // LOGIN FORM SENDING + $('#SubmitLogin').click(function() { + $.ajax({ + type: 'POST', + url: authenticationUrl, + async: false, + cache: false, + dataType : "json", + data: 'SubmitLogin=true&ajax=true&email='+encodeURIComponent($('#login_email').val())+'&passwd='+encodeURIComponent($('#passwd').val())+'&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''+txtThereis+' '+jsonData.errors.length+' '+txtErrors+':
            '; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += '
          1. '+jsonData.errors[error]+'
          2. '; + errors += '
          '; + $('#opc_login_errors').html(errors).slideDown('slow'); + } + else + { + // update token + static_token = jsonData.token; + updateNewAccountToAddressBlock(); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to send login informations \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); + return false; + }); + + // INVOICE ADDRESS + $('#invoice_address').click(function() { + if ($('#invoice_address:checked').length > 0) + { + $('#opc_invoice_address').slideDown('slow'); + if ($('#company_invoice').val() == '') + $('#vat_number_block_invoice').hide(); + updateState('invoice'); + updateNeedIDNumber('invoice'); + updateZipCode('invoice'); + } + else + $('#opc_invoice_address').slideUp('slow'); + }); + + // VALIDATION / CREATION AJAX + $('#submitAccount').click(function() { + $('#opc_new_account-overlay').fadeIn('slow'); + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $('#opc_payment_methods-overlay').fadeIn('slow'); + + // RESET ERROR(S) MESSAGE(S) + $('#opc_account_errors').html('').slideUp('slow'); + + if ($('input#opc_id_customer').val() == 0) + { + var callingFile = authenticationUrl; + var params = 'submitAccount=true&'; + } + else + { + var callingFile = orderOpcUrl; + var params = 'method=editCustomer&'; + } + + $('#opc_account_form input:visible').each(function() { + if ($(this).is('input[type=checkbox]')) + { + if ($(this).is(':checked')) + params += encodeURIComponent($(this).attr('name'))+'=1&'; + } + else if ($(this).is('input[type=radio]')) + { + if ($(this).is(':checked')) + params += encodeURIComponent($(this).attr('name'))+'='+encodeURIComponent($(this).val())+'&'; + } + else + params += encodeURIComponent($(this).attr('name'))+'='+encodeURIComponent($(this).val())+'&'; + }); + $('#opc_account_form select:visible').each(function() { + params += encodeURIComponent($(this).attr('name'))+'='+encodeURIComponent($(this).val())+'&'; + }); + params += 'customer_lastname='+encodeURIComponent($('#customer_lastname').val())+'&'; + params += 'customer_firstname='+encodeURIComponent($('#customer_firstname').val())+'&'; + params += 'alias='+encodeURIComponent($('#alias').val())+'&'; + params += 'is_new_customer='+encodeURIComponent($('#is_new_customer').val())+'&'; + // Clean the last & + params = params.substr(0, params.length-1); + + $.ajax({ + type: 'POST', + url: callingFile, + async: false, + cache: false, + dataType : "json", + data: 'ajax=true&'+params+'&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var tmp = ''; + var i = 0; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + { + i = i+1; + tmp += '
        1. '+jsonData.errors[error]+'
        2. '; + } + tmp += '
        '; + var errors = ''+txtThereis+' '+i+' '+txtErrors+':
          '+tmp; + $('#opc_account_errors').html(errors).slideDown('slow'); + $.scrollTo('#opc_account_errors', 800); + } + + isGuest = ($('#is_new_customer').val() == 1 ? 0 : 1); + + if (jsonData.id_customer != undefined && jsonData.id_customer != 0 && jsonData.isSaved) + { + // update token + static_token = jsonData.token; + + // update addresses id + $('input#opc_id_address_delivery').val(jsonData.id_address_delivery); + $('input#opc_id_address_invoice').val(jsonData.id_address_invoice); + + // It's not a new customer + if ($('input#opc_id_customer').val() != '0') + { + if (!saveAddress('delivery')) + return false; + } + + // update id_customer + $('input#opc_id_customer').val(jsonData.id_customer); + + if ($('#invoice_address:checked').length != 0) + { + if (!saveAddress('invoice')) + return false; + } + + // update id_customer + $('input#opc_id_customer').val(jsonData.id_customer); + + // force to refresh carrier list + if (isGuest) + { + $('#opc_account_saved').fadeIn('slow'); + $('#submitAccount').hide(); + updateAddressSelection(); + } + else + updateNewAccountToAddressBlock(); + } + $('#opc_new_account-overlay').fadeOut('slow'); + $('#opc_delivery_methods-overlay').fadeOut('slow'); + $('#opc_payment_methods-overlay').fadeOut('slow'); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save account \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); + return false; + }); + } + + // Order message update + $('#message').blur(function() { + $('#opc_delivery_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&method=updateMessage&message=' + encodeURIComponent($('#message').val()) + '&token=' + static_token , + success: function(jsonData) + { + if (jsonData.hasError) + { + var errors = ''; + for(error in jsonData.errors) + //IE6 bug fix + if(error != 'indexOf') + errors += jsonData.errors[error] + "\n"; + alert(errors); + } + else + $('#opc_delivery_methods-overlay').fadeOut('slow'); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to save message \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} + }); + }); + + // Recyclable checkbox + $('input#recyclable').click(function() { + updateCarrierSelectionAndGift(); + }); + + // Gift checkbox update + $('input#gift').click(function() { + if ($('input#gift').is(':checked')) + $('p#gift_div').show(); + else + $('p#gift_div').hide(); + updateCarrierSelectionAndGift(); + }); + + if ($('input#gift').is(':checked')) + $('p#gift_div').show(); + else + $('p#gift_div').hide(); + + // Gift message update + $('textarea#gift_message').blur(function() { + updateCarrierSelectionAndGift(); + }); + + // TOS + $('#cgv').click(function() { + if ($('#cgv:checked').length != 0) + var checked = 1; + else + var checked = 0; + + $('#opc_payment_methods-overlay').fadeIn('slow'); + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: true, + cache: false, + dataType : "json", + data: 'ajax=true&method=updateTOSStatusAndGetPayments&checked=' + checked + '&token=' + static_token, + success: function(json) + { + $('div#HOOK_TOP_PAYMENT').html(json.HOOK_TOP_PAYMENT); + $('#opc_payment_methods-content div#HOOK_PAYMENT').html(json.HOOK_PAYMENT); + $('#opc_payment_methods-overlay').fadeOut('slow'); + } + }); + }); + + $('#opc_account_form input,select,textarea').change(function() { + if ($(this).is(':visible')) + { + $('#opc_account_saved').fadeOut('slow'); + $('#submitAccount').show(); + } + }); + +}); diff --git a/themes/prestashop/js/product.js b/themes/prestashop/js/product.js new file mode 100644 index 000000000..eb1b4091d --- /dev/null +++ b/themes/prestashop/js/product.js @@ -0,0 +1,521 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + + +//global variables +var combinations = new Array(); +var selectedCombination = new Array(); +var globalQuantity = new Number; +var colors = new Array(); + +//check if a function exists +function function_exists(function_name) +{ + if (typeof function_name == 'string') + return (typeof window[function_name] == 'function'); + return (function_name instanceof Function); +} + +//execute oosHook js code +function oosHookJsCode() +{ + for (var i = 0; i < oosHookJsCodeFunctions.length; i++) + { + if (function_exists(oosHookJsCodeFunctions[i])) + setTimeout(oosHookJsCodeFunctions[i]+'()', 0); + } +} + +//add a combination of attributes in the global JS sytem +function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity) +{ + globalQuantity += quantity; + + var combination = new Array(); + combination['idCombination'] = idCombination; + combination['quantity'] = quantity; + combination['idsAttributes'] = arrayOfIdAttributes; + combination['price'] = price; + combination['ecotax'] = ecotax; + combination['image'] = id_image; + combination['reference'] = reference; + combination['unit_price'] = unit_price; + combination['minimal_quantity'] = minimal_quantity; + combinations.push(combination); + +} + +// search the combinations' case of attributes and update displaying of availability, prices, ecotax, and image +function findCombination(firstTime) +{ + $('#minimal_quantity_wanted_p').fadeOut(); + $('#quantity_wanted').val(1); + //create a temporary 'choice' array containing the choices of the customer + var choice = new Array(); + $('div#attributes select').each(function(){ + choice.push($(this).val()); + }); + var nbAttributesEquals = 0; + + //testing every combination to find the conbination's attributes' case of the user + for (var combination = 0; combination < combinations.length; ++combination) + { + //verify if this combinaison is the same that the user's choice + nbAttributesEquals = 0; + for (idAttribute in combinations[combination]['idsAttributes']) + { + //ie6 bug fix + if (idAttribute != 'indexOf'){ + //if this attribute has been choose by user + if (in_array(combinations[combination]['idsAttributes'][idAttribute], choice)) + { + + //we are in a good way to find the good combination ! + nbAttributesEquals++; + } + } + } + + if (nbAttributesEquals == choice.length) + { + if (combinations[combination]['minimal_quantity'] > 1) + { + $('#minimal_quantity_label').html(combinations[combination]['minimal_quantity']); + $('#minimal_quantity_wanted_p').fadeIn(); + $('#quantity_wanted').val(combinations[combination]['minimal_quantity']); + $('#quantity_wanted').bind('keyup', function() {checkMinimalQuantity(combinations[combination]['minimal_quantity'])}); + } + //combination of the user has been found in our specifications of combinations (created in back office) + selectedCombination['unavailable'] = false; + selectedCombination['reference'] = combinations[combination]['reference']; + $('#idCombination').val(combinations[combination]['idCombination']); + + //get the data of product with these attributes + quantityAvailable = combinations[combination]['quantity']; + selectedCombination['price'] = combinations[combination]['price']; + selectedCombination['unit_price'] = combinations[combination]['unit_price']; + if (combinations[combination]['ecotax']) + selectedCombination['ecotax'] = combinations[combination]['ecotax']; + else + selectedCombination['ecotax'] = default_eco_tax; + + //show the large image in relation to the selected combination + if (combinations[combination]['image'] && combinations[combination]['image'] != -1) + displayImage( $('#thumb_'+combinations[combination]['image']).parent() ); + + //update the display + updateDisplay(); + + if(typeof(firstTime) != 'undefined' && firstTime) + refreshProductImages(0); + else + refreshProductImages(combinations[combination]['idCombination']); + //leave the function because combination has been found + return; + } + } + //this combination doesn't exist (not created in back office) + selectedCombination['unavailable'] = true; + updateDisplay(); +} + +function updateColorSelect(id_attribute) +{ + if (id_attribute == 0) + { + refreshProductImages(0); + return ; + } + // Visual effect + $('#color_'+id_attribute).fadeTo('fast', 1, function(){ $(this).fadeTo('slow', 0, function(){ $(this).fadeTo('slow', 1, function(){}); }); }); + // Attribute selection + $('#group_'+id_color_default+' option[value='+id_attribute+']').attr('selected', 'selected'); + $('#group_'+id_color_default+' option[value!='+id_attribute+']').removeAttr('selected'); + findCombination(); +} + +//update display of the availability of the product AND the prices of the product +function updateDisplay() +{ + if (!selectedCombination['unavailable'] && quantityAvailable > 0 && productAvailableForOrder == 1) + { + //show the choice of quantities + $('#quantity_wanted_p:hidden').show('slow'); + + //show the "add to cart" button ONLY if it was hidden + $('#add_to_cart:hidden').fadeIn(600); + + //hide the hook out of stock + $('#oosHook').hide(); + + //availability value management + if (availableNowValue != '') + { + //update the availability statut of the product + $('#availability_value').removeClass('warning-inline'); + $('#availability_value').text(availableNowValue); + $('#availability_statut:hidden').show(); + } + else + { + //hide the availability value + $('#availability_statut:visible').hide(); + } + + //'last quantities' message management + if (quantityAvailable <= maxQuantityToAllowDisplayOfLastQuantityMessage && !allowBuyWhenOutOfStock) + { + //display the 'last quantities' message + $('#last_quantities').show('slow'); + $('#pQuantityAvailable:hidden').show('slow'); + $('#quantityAvailable').text(quantityAvailable); + + if(quantityAvailable < 2) + { + $('#quantityAvailableTxt').show(); + $('#quantityAvailableTxtMultiple').hide(); + } + else + { + $('#quantityAvailableTxt').hide(); + $('#quantityAvailableTxtMultiple').show(); + } + } + else + { + //hide the 'last quantities' message + $('#last_quantities').hide('slow'); + } + } + else + { + //show the hook out of stock + if (productAvailableForOrder == 1) + { + $('#oosHook').show(); + if ($('#oosHook').length > 0 && function_exists('oosHookJsCode')) + oosHookJsCode(); + } + + //hide 'last quantities' message if it was previously visible + $('#last_quantities:visible').hide('slow'); + + //hide the quantity of pieces if it was previously visible + $('#pQuantityAvailable:visible').hide('slow'); + + //hide the choice of quantities + if (!allowBuyWhenOutOfStock) + $('#quantity_wanted_p:visible').hide('slow'); + + //display that the product is unavailable with theses attributes + if (!selectedCombination['unavailable']) + $('#availability_value').text(doesntExistNoMore + (globalQuantity > 0 ? ' ' + doesntExistNoMoreBut : '')).addClass('warning-inline'); + else + { + $('#availability_value').text(doesntExist).addClass('warning-inline'); + $('#oosHook').hide(); + } + $('#availability_statut:hidden').show(); + + + //show the 'add to cart' button ONLY IF it's possible to buy when out of stock AND if it was previously invisible + if (allowBuyWhenOutOfStock && !selectedCombination['unavailable'] && productAvailableForOrder == 1) + { + $('#add_to_cart:hidden').fadeIn(600); + + if (availableLaterValue != '') + { + $('#availability_value').text(availableLaterValue); + $('p#availability_statut:hidden').show('slow'); + } + else + $('p#availability_statut:visible').hide('slow'); + } + else + { + $('#add_to_cart:visible').fadeOut(600); + $('p#availability_statut:hidden').show('slow'); + } + + if (productAvailableForOrder == 0) + $('p#availability_statut:visible').hide(); + } + + if (selectedCombination['reference'] || productReference) + { + if (selectedCombination['reference']) + $('#product_reference span').text(selectedCombination['reference']); + else if (productReference) + $('#product_reference span').text(productReference); + $('#product_reference:hidden').show('slow'); + } + else + $('#product_reference:visible').hide('slow'); + + //update display of the the prices in relation to tax, discount, ecotax, and currency criteria + if (!selectedCombination['unavailable'] && productShowPrice == 1) + { + var tax = (taxRate / 100) + 1; + var taxExclPrice = (specific_price ? (specific_currency ? specific_price : specific_price * currencyRate) : productPriceTaxExcluded) + selectedCombination['price'] * currencyRate; + + if (specific_price) + var productPriceWithoutReduction = productPriceTaxExcluded + selectedCombination['price'] * currencyRate; + + if (!displayPrice && !noTaxForThisProduct) + { + + var productPrice = ps_round(taxExclPrice * tax, 2); + if (specific_price) + productPriceWithoutReduction = ps_round(productPriceWithoutReduction * tax, 2); + } + else + { + var productPrice = ps_round(taxExclPrice, 2); + if (specific_price) + productPriceWithoutReduction = ps_round(productPriceWithoutReduction, 2); + } + + var reduction = 0; + if (reduction_price || reduction_percent) + { + reduction = productPrice * (parseFloat(reduction_percent) / 100) + reduction_price; + if (reduction_price && (displayPrice || noTaxForThisProduct)) + reduction = reduction / tax; + } + + if (!specific_price) + productPriceWithoutReduction = productPrice; + productPrice -= reduction; + + var ecotaxAmount = !displayPrice ? ps_round(selectedCombination['ecotax'] * (1 + ecotaxTax_rate / 100), 2) : selectedCombination['ecotax']; + productPrice += ecotaxAmount; + productPriceWithoutReduction += ecotaxAmount; + + //productPrice = ps_round(productPrice * currencyRate, 2); + if (productPrice > 0) + $('#our_price_display').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank)); + else + $('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank)); + + $('#old_price_display').text(formatCurrency(productPriceWithoutReduction, currencyFormat, currencySign, currencyBlank)); + + /* Special feature: "Display product price tax excluded on product page" */ + if (!noTaxForThisProduct) + var productPricePretaxed = productPrice / tax; + else + var productPricePretaxed = productPrice; + $('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank)); + /* Unit price */ + productUnitPriceRatio = parseFloat(productUnitPriceRatio); + if (productUnitPriceRatio > 0 ) + { + newUnitPrice = (productPrice / parseFloat(productUnitPriceRatio)) + selectedCombination['unit_price']; + $('#unit_price_display').text(formatCurrency(newUnitPrice, currencyFormat, currencySign, currencyBlank)); + } + + /* Ecotax */ + var ecotaxAmount = !displayPrice ? ps_round(selectedCombination['ecotax'] * (1 + ecotaxTax_rate / 100), 2) : selectedCombination['ecotax']; + $('#ecotax_price_display').text(formatCurrency(ecotaxAmount, currencyFormat, currencySign, currencyBlank)); + } +} + +//update display of the large image +function displayImage(domAAroundImgThumb) +{ + if (domAAroundImgThumb.attr('href')) + { + var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large'); + if ($('#bigpic').attr('src') != newSrc) + { + $('#bigpic').fadeOut('fast', function(){ + $(this).attr('src', newSrc).show(); + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + $(this).attr('alt', domAAroundImgThumb.attr('href')); + }); + } + $('#views_block li a').removeClass('shown'); + $(domAAroundImgThumb).addClass('shown'); + } +} + +// Serialscroll exclude option bug ? +function serialScrollFixLock(event, targeted, scrolled, items, position) +{ + serialScrollNbImages = $('#thumbs_list li:visible').length; + serialScrollNbImagesDisplayed = 3; + + var leftArrow = position == 0 ? true : false; + var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false; + + $('a#view_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1); + $('a#view_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block'); + return true; +} + +// Change the current product images regarding the combination selected +function refreshProductImages(id_product_attribute) +{ + $('#thumbs_list_frame').scrollTo('li:eq(0)', 700, {axis:'x'}); + $('#thumbs_list li').hide(); + id_product_attribute = parseInt(id_product_attribute); + + if (typeof(combinationImages) != 'undefined' && typeof(combinationImages[id_product_attribute]) != 'undefined') + { + for (var i = 0; i < combinationImages[id_product_attribute].length; i++) + $('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show(); + } + if (i > 0) + { + var thumb_width = $('#thumbs_list_frame >li').width()+parseInt($('#thumbs_list_frame >li').css('marginRight')); + $('#thumbs_list_frame').width((parseInt((thumb_width)* i) + 3) + 'px'); // Bug IE6, needs 3 pixels more ? + } + else + { + $('#thumbnail_' + idDefaultImage).show(); + displayImage($('#thumbnail_'+ idDefaultImage +' a')); + } + $('#thumbs_list').trigger('goto', 0); + serialScrollFixLock('', '', '', '', 0);// SerialScroll Bug on goto 0 ? +} + +//To do after loading HTML +$(document).ready(function() +{ + //init the serialScroll for thumbs + $('#thumbs_list').serialScroll({ + items:'li:visible', + prev:'a#view_scroll_left', + next:'a#view_scroll_right', + axis:'x', + offset:0, + start:0, + stop:true, + onBefore:serialScrollFixLock, + duration:700, + step: 2, + lazy: true, + lock: false, + force:false, + cycle:false + }); + + $('#thumbs_list').trigger('goto', 1);// SerialScroll Bug on goto 0 ? + $('#thumbs_list').trigger('goto', 0); + + //hover 'other views' images management + $('#views_block li a').hover( + function(){displayImage($(this));}, + function(){} + ); + + //set jqZoom parameters if needed + if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) + { + $('img.jqzoom').jqueryzoom({ + xzoom: 200, //zooming div default width(default width value is 200) + yzoom: 200, //zooming div default width(default height value is 200) + offset: 21 //zooming div default offset(default offset value is 10) + //position: "right" //zooming div position(default position value is "right") + }); + } + + //add a link on the span 'view full size' and on the big image + $('span#view_full_size, div#image-block img').click(function(){ + $('#views_block li a.shown').click(); + }); + + //catch the click on the "more infos" button at the top of the page + $('div#short_description_block p a.button').click(function(){ + $('#more_info_tab_more_info').click(); + $.scrollTo( '#more_info_tabs', 1200 ); + }); + + // Hide the customization submit button and display some message + $('p#customizedDatas input').click(function() { + $('p#customizedDatas input').hide(); + $('#ajax-loader').fadeIn(); + $('p#customizedDatas').append(uploading_in_progress); + }); + + //init the price in relation of the selected attributes + if (typeof productHasAttributes != 'undefined' && productHasAttributes) + findCombination(true); + else if (typeof productHasAttributes != 'undefined' && !productHasAttributes) + refreshProductImages(0); + + // + $('a#resetImages').click(function() { + updateColorSelect(0); + }); + + $('.thickbox').fancybox({ + 'hideOnContentClick': true, + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic' + }); +}); + +function saveCustomization() +{ + $('#quantityBackup').val($('#quantity_wanted').val()); + customAction = $('#customizationForm').attr('action'); + $('body select[id^="group_"]').each(function() { + customAction = customAction.replace(new RegExp(this.id + '=\\d+'), this.id +'='+this.value); + }); + $('#customizationForm').attr('action', customAction); + $('#customizationForm').submit(); +} + +function submitPublishProduct(url, redirect) +{ + var id_product = $('#admin-action-product-id').val(); + + $.ajaxSetup({async: false}); + $.post(url+'/ajax.php', { submitPublishProduct: '1', id_product: id_product, status: 1, redirect: redirect }, + function(data) + { + if (data.indexOf('error') === -1) + document.location.href = data; + } + ); + + return true; +} + +function checkMinimalQuantity(minimal_quantity) +{ + if ($('#quantity_wanted').val() < minimal_quantity) + { + $('#quantity_wanted').css('border', '1px solid red'); + $('#minimal_quantity_wanted_p').css('color', 'red'); + } + else + { + $('#quantity_wanted').css('border', '1px solid #BDC2C9'); + $('#minimal_quantity_wanted_p').css('color', '#374853'); + } +} + diff --git a/themes/prestashop/js/products-comparison.js b/themes/prestashop/js/products-comparison.js new file mode 100644 index 000000000..5fcdd2bcf --- /dev/null +++ b/themes/prestashop/js/products-comparison.js @@ -0,0 +1,53 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function checkBeforeComparison() +{ + var id_list = ''; + $('.comparator:checked').each( + function() + { + id_list += $(this).val() + '|'; + } + ); + + $('.compare_product_list').val(id_list); + + if ($('.comparator:checked').length == 0) + { + alert(min_item); + return false; + } + + return true; +} + +function checkForComparison(nb_max_item) +{ + if ($('.comparator:checked').length > nb_max_item) + alert(max_item); +} + diff --git a/themes/prestashop/js/scenes.js b/themes/prestashop/js/scenes.js new file mode 100644 index 000000000..be01bae94 --- /dev/null +++ b/themes/prestashop/js/scenes.js @@ -0,0 +1,92 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +nb_move_available = null; +current_move = 0; +next_scene_is_at_right = true; + +function loadScene(id_scene){ + $('#scenes').find('.screen_scene:visible').fadeTo(300, 0, function(){ + $(this).hide(); + $('#scenes').find('#screen_scene_' + id_scene).css('opacity', '0').show().fadeTo(500, 1); + }); + return false; +} + +function onSceneMove(){ + if (next_scene_is_at_right) current_move++; + else current_move--; + if (current_move == nb_move_available - 1) $('#scenes .next').fadeOut(); + else $('#scenes .next:hidden').fadeIn().css('display','block'); + if (current_move == 0) $('#scenes .prev').fadeOut().css('display','block'); + else $('#scenes .prev').fadeIn().css('display','block'); + return true; +} + +$(function () { + /* calcul nb of click to see every scenes */ + var ul_width = parseInt($('#scenes_list ul').width()); + var div_width = parseInt($('#scenes_list').width()); + nb_move_available = Math.ceil((ul_width-div_width)/li_width)+1; + if (nb_move_available < 2) + $('#scenes .next').hide(); + + /* set cluetip parameters */ + $('a.cluetip') + .cluetip({ + local:true, + cursor: 'pointer', + attribute:'accesskey', + cluetipClass: 'product_scene', + dropShadow: false, + dropShadowSteps: 0, + showTitle: false, + tracking: true, + sticky: false, + mouseOutClose: true, + closeText: i18n_scene_close, + fx: { + open: 'fadeIn', + openSpeed: 'fast' + } + }) + .css('opacity', 0.8); + + /* set serialscroll parameters */ + $('#scenes_list').serialScroll({ + items:'a', + duration:1000, + lock:false, + axis:'x', + cycle:false, + force:true, + lazy:true, + step:1, + onBefore:onSceneMove + }); + $('#scenes_list').trigger( 'goto', 0); + +}); diff --git a/themes/prestashop/js/stores.js b/themes/prestashop/js/stores.js new file mode 100644 index 000000000..806c8251b --- /dev/null +++ b/themes/prestashop/js/stores.js @@ -0,0 +1,217 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function initMarkers() +{ + var searchUrl = baseDir+'stores.php?ajax=1&all=1'; + downloadUrl(searchUrl, function(data) { + var xml = parseXml(data); + var markerNodes = xml.documentElement.getElementsByTagName('marker'); + var bounds = new google.maps.LatLngBounds(); + for (var i = 0; i < markerNodes.length; i++) + { + var name = markerNodes[i].getAttribute('name'); + var address = markerNodes[i].getAttribute('address'); + var addressNoHtml = markerNodes[i].getAttribute('addressNoHtml'); + var other = markerNodes[i].getAttribute('other'); + var id_store = markerNodes[i].getAttribute('id_store'); + var has_store_picture = markerNodes[i].getAttribute('has_store_picture'); + var latlng = new google.maps.LatLng( + parseFloat(markerNodes[i].getAttribute('lat')), + parseFloat(markerNodes[i].getAttribute('lng'))); + createMarker(latlng, name, address, addressNoHtml, other, id_store, has_store_picture); + bounds.extend(latlng); + } + }); +} + +function searchLocations() +{ + $('#stores_loader').show(); + var address = document.getElementById('addressInput').value; + var geocoder = new google.maps.Geocoder(); + geocoder.geocode({address: address}, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) + searchLocationsNear(results[0].geometry.location); + else + alert(address+' '+translation_6); + $('#stores_loader').hide(); + }); +} + +function clearLocations(n) +{ + infoWindow.close(); + for (var i = 0; i < markers.length; i++) + markers[i].setMap(null); + + markers.length = 0; + + locationSelect.innerHTML = ''; + var option = document.createElement('option'); + option.value = 'none'; + if (!n) + option.innerHTML = translation_1; + else + { + if (n == 1) + option.innerHTML = '1'+' '+translation_2; + else + option.innerHTML = n+' '+translation_3; + } + locationSelect.appendChild(option); + $('#stores-table tr.node').remove(); + initMarkers(); +} + +function searchLocationsNear(center) +{ + var radius = document.getElementById('radiusSelect').value; + var searchUrl = baseDir+'stores.php?ajax=1&latitude=' + center.lat() + '&longitude=' + center.lng() + '&radius=' + radius; + downloadUrl(searchUrl, function(data) { + var xml = parseXml(data); + var markerNodes = xml.documentElement.getElementsByTagName('marker'); + var bounds = new google.maps.LatLngBounds(); + + clearLocations(markerNodes.length); + for (var i = 0; i < markerNodes.length; i++) + { + var name = markerNodes[i].getAttribute('name'); + var address = markerNodes[i].getAttribute('address'); + var addressNoHtml = markerNodes[i].getAttribute('addressNoHtml'); + var other = markerNodes[i].getAttribute('other'); + var distance = parseFloat(markerNodes[i].getAttribute('distance')); + var id_store = parseFloat(markerNodes[i].getAttribute('id_store')); + var phone = markerNodes[i].getAttribute('phone'); + var has_store_picture = markerNodes[i].getAttribute('has_store_picture'); + var latlng = new google.maps.LatLng( + parseFloat(markerNodes[i].getAttribute('lat')), + parseFloat(markerNodes[i].getAttribute('lng'))); + + createOption(name, distance, i); + createMarker(latlng, name, address, addressNoHtml, other, id_store, has_store_picture); + bounds.extend(latlng); + + $('#stores-table tr:last').after(''+parseInt(i + 1)+''+name+''+(has_store_picture == 1 ? '
          ' : '')+''+address+(phone != '' ? '

          '+translation_4+' '+phone : '')+''+distance+' '+distance_unit+''); + $('#stores-table').show(); + } + + if (markerNodes.length) + { + map.fitBounds(bounds); + var listener = google.maps.event.addListener(map, "idle", function() { + if (map.getZoom() > 13) map.setZoom(13); + google.maps.event.removeListener(listener); + }); + } + locationSelect.style.visibility = 'visible'; + locationSelect.onchange = function() { + var markerNum = locationSelect.options[locationSelect.selectedIndex].value; + google.maps.event.trigger(markers[markerNum], 'click'); + }; + }); +} + +function createMarker(latlng, name, address, addressNoHtml, other, id_store, has_store_picture) +{ + var html = ''+name+'
          '+address+(has_store_picture == 1 ? '

          ' : '')+other+'
          '+translation_5+'<\/a>'; + var image = new google.maps.MarkerImage(img_ps_dir+'logo_stores.gif'); + if (hasStoreIcon) + var marker = new google.maps.Marker({ map: map, icon: image, position: latlng }); + else + var marker = new google.maps.Marker({ map: map, position: latlng }); + google.maps.event.addListener(marker, 'click', function() { + infoWindow.setContent(html); + infoWindow.open(map, marker); + }); + markers.push(marker); +} + +function createOption(name, distance, num) +{ + var option = document.createElement('option'); + option.value = num; + option.innerHTML = name+' ('+distance.toFixed(1)+' '+distance_unit+')'; + locationSelect.appendChild(option); +} + +function downloadUrl(url, callback) +{ + var request = window.ActiveXObject ? + new ActiveXObject('Microsoft.XMLHTTP') : + new XMLHttpRequest; + + request.onreadystatechange = function() { + if (request.readyState == 4) { + request.onreadystatechange = doNothing; + callback(request.responseText, request.status); + } + }; + + request.open('GET', url, true); + request.send(null); +} + +function parseXml(str) +{ + if (window.ActiveXObject) { + var doc = new ActiveXObject('Microsoft.XMLDOM'); + doc.loadXML(str); + return doc; + } + else if (window.DOMParser) { + return (new DOMParser).parseFromString(str, 'text/xml'); + } +} + +function doNothing() {} + +$(document).ready(function() +{ + map = new google.maps.Map(document.getElementById('map'), { + center: new google.maps.LatLng(defaultLat, defaultLong), + zoom: 10, + mapTypeId: 'roadmap', + mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU} + }); + infoWindow = new google.maps.InfoWindow(); + + locationSelect = document.getElementById('locationSelect'); + locationSelect.onchange = function() { + var markerNum = locationSelect.options[locationSelect.selectedIndex].value; + if (markerNum != 'none') + google.maps.event.trigger(markers[markerNum], 'click'); + }; + + $('#addressInput').keypress(function(e) { + code = e.keyCode ? e.keyCode : e.which; + if(code.toString() == 13) + searchLocations(); + }); + + + initMarkers(); +}); diff --git a/themes/prestashop/js/tools.js b/themes/prestashop/js/tools.js new file mode 100644 index 000000000..4e69063a9 --- /dev/null +++ b/themes/prestashop/js/tools.js @@ -0,0 +1,210 @@ +/* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +function ps_round(value, precision) +{ + if (typeof(roundMode) == 'undefined') + roundMode = 2; + if (typeof(precision) == 'undefined') + precision = 2; + + method = roundMode; + if (method == 0) + return ceilf(value, precision); + else if (method == 1) + return floorf(value, precision); + precisionFactor = precision == 0 ? 1 : Math.pow(10, precision); + return Math.round(value * precisionFactor) / precisionFactor; +} + +function ceilf(value, precision) +{ + if (typeof(precision) == 'undefined') + precision = 0; + precisionFactor = precision == 0 ? 1 : Math.pow(10, precision); + tmp = value * precisionFactor; + tmp2 = tmp.toString(); + if (tmp2[tmp2.length - 1] == 0) + return value; + return Math.ceil(value * precisionFactor) / precisionFactor; +} + +function floorf(value, precision) +{ + if (typeof(precision) == 'undefined') + precision = 0; + precisionFactor = precision == 0 ? 1 : Math.pow(10, precision); + tmp = value * precisionFactor; + tmp2 = tmp.toString(); + if (tmp2[tmp2.length - 1] == 0) + return value; + return Math.floor(value * precisionFactor) / precisionFactor; +} + +function formatedNumberToFloat(price, currencyFormat, currencySign) +{ + price = price.replace(currencySign, ''); + if (currencyFormat == 1) + return parseFloat(price.replace(',', '').replace(' ', '')); + else if (currencyFormat == 2) + return parseFloat(price.replace(' ', '').replace(',', '.')); + else if (currencyFormat == 3) + return parseFloat(price.replace('.', '').replace(' ', '').replace(',', '.')); + else if (currencyFormat == 4) + return parseFloat(price.replace(',', '').replace(' ', '')); + return price; +} + +//return a formatted price +function formatCurrency(price, currencyFormat, currencySign, currencyBlank) +{ + // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) + blank = ''; + price = parseFloat(price.toFixed(6)); + price = ps_round(price, priceDisplayPrecision); + if (currencyBlank > 0) + blank = ' '; + if (currencyFormat == 1) + return currencySign + blank + formatNumber(price, priceDisplayPrecision, ',', '.'); + if (currencyFormat == 2) + return (formatNumber(price, priceDisplayPrecision, ' ', ',') + blank + currencySign); + if (currencyFormat == 3) + return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '.', ',')); + if (currencyFormat == 4) + return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign); + return price; +} + +//return a formatted number +function formatNumber(value, numberOfDecimal, thousenSeparator, virgule) +{ + value = value.toFixed(numberOfDecimal); + var val_string = value+''; + var tmp = val_string.split('.'); + var abs_val_string = (tmp.length == 2) ? tmp[0] : val_string; + var deci_string = ('0.' + (tmp.length == 2 ? tmp[1] : 0)).substr(2); + var nb = abs_val_string.length; + + for (var i = 1 ; i < 4; i++) + if (value >= Math.pow(10, (3 * i))) + abs_val_string = abs_val_string.substring(0, nb - (3 * i)) + thousenSeparator + abs_val_string.substring(nb - (3 * i)); + + if (parseInt(numberOfDecimal) == 0) + return abs_val_string; + return abs_val_string + virgule + (deci_string > 0 ? deci_string : '00'); +} + +//change the text of a jQuery element with a sliding effect (velocity could be a number in ms, 'slow' or 'fast', effect1 and effect2 could be slide, fade, hide, show) +function updateTextWithEffect(jQueryElement, text, velocity, effect1, effect2, newClass) +{ + if(jQueryElement.text() != text) + if(effect1 == 'fade') + jQueryElement.fadeOut(velocity, function(){ + $(this).addClass(newClass); + if(effect2 == 'fade') $(this).text(text).fadeIn(velocity); + else if(effect2 == 'slide') $(this).text(text).slideDown(velocity); + else if(effect2 == 'show') $(this).text(text).show(velocity, function(){}); + }); + else if(effect1 == 'slide') + jQueryElement.slideUp(velocity, function(){ + $(this).addClass(newClass); + if(effect2 == 'fade') $(this).text(text).fadeIn(velocity); + else if(effect2 == 'slide') $(this).text(text).slideDown(velocity); + else if(effect2 == 'show') $(this).text(text).show(velocity); + }); + else if(effect1 == 'hide') + jQueryElement.hide(velocity, function(){ + $(this).addClass(newClass); + if(effect2 == 'fade') $(this).text(text).fadeIn(velocity); + else if(effect2 == 'slide') $(this).text(text).slideDown(velocity); + else if(effect2 == 'show') $(this).text(text).show(velocity); + }); +} + +//show a JS debug +function dbg(value) +{ + var active = false;//true for active + var firefox = true;//true if debug under firefox + + if (active) + if (firefox) + console.log(value); + else + alert(value); +} + +/** +* Function : print_r() +* Arguments: The data - array,hash(associative array),object +* The level - OPTIONAL +* Returns : The textual representation of the array. +* This function was inspired by the print_r function of PHP. +* This will accept some data as the argument and return a +* text that will be a more readable version of the +* array/hash/object that is given. +*/ +function print_r(arr, level) +{ + var dumped_text = ""; + if (!level) + level = 0; + + //The padding given at the beginning of the line. + var level_padding = ""; + for (var j = 0 ; j < level + 1; j++) + level_padding += " "; + + if (typeof(arr) == 'object') + { //Array/Hashes/Objects + for (var item in arr) + { + var value = arr[item]; + if (typeof(value) == 'object') { //If it is an array, + dumped_text += level_padding + "'" + item + "' ...\n"; + dumped_text += dump(value,level+1); + } + else + { + dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n"; + } + } + } + else + { //Stings/Chars/Numbers etc. + dumped_text = "===>" + arr + "<===("+typeof(arr)+")"; + } + return dumped_text; +} + +//verify if value is in the array +function in_array(value, array) +{ + for (var i in array) + if (array[i] == value) + return true; + return false; +} diff --git a/themes/prestashop/js/tools/statesManagement.js b/themes/prestashop/js/tools/statesManagement.js new file mode 100644 index 000000000..94317f785 --- /dev/null +++ b/themes/prestashop/js/tools/statesManagement.js @@ -0,0 +1,61 @@ +$(document).ready(function(){ + $('select#id_country').change(function(){ + updateState(); + updateNeedIDNumber(); + updateZipCode(); + }); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + + if ($('select#id_country_invoice').length != 0) + { + $('select#id_country_invoice').change(function(){ + updateState('invoice'); + updateNeedIDNumber('invoice'); + updateZipCode(); + }); + if ($('select#id_country_invoice:visible').length != 0) + { + updateState('invoice'); + updateNeedIDNumber('invoice'); + updateZipCode('invoice'); + } + } +}); + +function updateState(suffix) +{ + $('select#id_state'+(suffix !== undefined ? '_'+suffix : '')+' option:not(:first-child)').remove(); + var states = countries[$('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()]; + if(typeof(states) != 'undefined') + { + $(states).each(function (key, item){ + $('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append(''); + }); + + $('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').slideDown('slow'); + } + else + $('p.id_state'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); +} + +function updateNeedIDNumber(suffix) +{ + var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); + + if ($.inArray(idCountry, countriesNeedIDNumber) >= 0) + $('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); + else + $('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); +} + +function updateZipCode(suffix) +{ + var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); + + if (countriesNeedZipCode[idCountry] != 0) + $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); + else + $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); +} diff --git a/themes/prestashop/js/tools/treeManagement.js b/themes/prestashop/js/tools/treeManagement.js new file mode 100644 index 000000000..dc308b578 --- /dev/null +++ b/themes/prestashop/js/tools/treeManagement.js @@ -0,0 +1,57 @@ +//animate the opening of the branch (span.grower jQueryElement) +function openBranch(jQueryElement, noAnimation) { + jQueryElement.addClass('OPEN').removeClass('CLOSE'); + if(noAnimation) + jQueryElement.parent().find('ul:first').show(); + else + jQueryElement.parent().find('ul:first').slideDown(); +} +//animate the closing of the branch (span.grower jQueryElement) +function closeBranch(jQueryElement, noAnimation) { + jQueryElement.addClass('CLOSE').removeClass('OPEN'); + if(noAnimation) + jQueryElement.parent().find('ul:first').hide(); + else + jQueryElement.parent().find('ul:first').slideUp(); +} + +//animate the closing or opening of the branch (ul jQueryElement) +function toggleBranch(jQueryElement, noAnimation) { + if(jQueryElement.hasClass('OPEN')) + closeBranch(jQueryElement, noAnimation); + else + openBranch(jQueryElement, noAnimation); +} + +//when the page is loaded... +$(document).ready(function () { + //to do not execute this script as much as it's called... + if(!$('ul.tree.dhtml').hasClass('dynamized')) + { + //add growers to each ul.tree elements + $('ul.tree.dhtml ul').prev().before(" "); + + //dynamically add the '.last' class on each last item of a branch + $('ul.tree.dhtml ul li:last-child, ul.tree.dhtml li:last-child').addClass('last'); + + //collapse every expanded branch + $('ul.tree.dhtml span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide(); + $('ul.tree.dhtml').show(); + + //open the tree for the selected branch + $('ul.tree.dhtml .selected').parents().each( function() { + if ($(this).is('ul')) + toggleBranch($(this).prev().prev(), true); + }); + toggleBranch( $('ul.tree.dhtml .selected').prev(), true); + + //add a fonction on clicks on growers + $('ul.tree.dhtml span.grower').click(function(){ + toggleBranch($(this)); + }); + //mark this 'ul.tree' elements as already 'dynamized' + $('ul.tree.dhtml').addClass('dynamized'); + + $('ul.tree.dhtml').removeClass('dhtml'); + } +}); diff --git a/themes/prestashop/lang/de.php b/themes/prestashop/lang/de.php new file mode 100644 index 000000000..ef1a84d02 --- /dev/null +++ b/themes/prestashop/lang/de.php @@ -0,0 +1,702 @@ + \ No newline at end of file diff --git a/themes/prestashop/lang/en.php b/themes/prestashop/lang/en.php new file mode 100644 index 000000000..697d7f9b4 --- /dev/null +++ b/themes/prestashop/lang/en.php @@ -0,0 +1,6 @@ + diff --git a/themes/prestashop/lang/es.php b/themes/prestashop/lang/es.php new file mode 100644 index 000000000..e3037a4f6 --- /dev/null +++ b/themes/prestashop/lang/es.php @@ -0,0 +1,702 @@ + \ No newline at end of file diff --git a/themes/prestashop/lang/fr.php b/themes/prestashop/lang/fr.php new file mode 100644 index 000000000..e5a7dccbc --- /dev/null +++ b/themes/prestashop/lang/fr.php @@ -0,0 +1,724 @@ + \ No newline at end of file diff --git a/themes/prestashop/lang/it.php b/themes/prestashop/lang/it.php new file mode 100755 index 000000000..b532809fa --- /dev/null +++ b/themes/prestashop/lang/it.php @@ -0,0 +1,702 @@ + \ No newline at end of file diff --git a/themes/prestashop/maintenance.tpl b/themes/prestashop/maintenance.tpl new file mode 100644 index 000000000..731e05b8a --- /dev/null +++ b/themes/prestashop/maintenance.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + {$meta_title|escape:'htmlall':'UTF-8'} + +{if isset($meta_description)} + +{/if} +{if isset($meta_keywords)} + +{/if} + + + + + +
          +

          logo

          +

          + {l s='In order to perform site maintenance, our online shop has shut down temporarily. We apologize for the inconvenience and ask that you please try again later.'} +

          +   +
          + + diff --git a/themes/prestashop/manufacturer-list.tpl b/themes/prestashop/manufacturer-list.tpl new file mode 100644 index 000000000..856bb1f7b --- /dev/null +++ b/themes/prestashop/manufacturer-list.tpl @@ -0,0 +1,85 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Manufacturers'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Manufacturers'}

          + +{if isset($errors) AND $errors} + {include file="$tpl_dir./errors.tpl"} +{else} +

          {strip} + + {if $nbManufacturers == 0}{l s='There are no manufacturers.'} + {else} + {if $nbManufacturers == 1}{l s='There is'}{else}{l s='There are'}{/if}  + {$nbManufacturers}  + {if $nbManufacturers == 1}{l s='manufacturer.'}{else}{l s='manufacturers.'}{/if} + {/if} + {/strip} +

          + + {if $nbManufacturers > 0} +
          + {include file="$tpl_dir./pagination.tpl"} + {/if} +{/if} diff --git a/themes/prestashop/manufacturer.tpl b/themes/prestashop/manufacturer.tpl new file mode 100644 index 000000000..ce0fa0fc7 --- /dev/null +++ b/themes/prestashop/manufacturer.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{include file="$tpl_dir./breadcrumb.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +{if !isset($errors) OR !sizeof($errors)} +

          {l s='List of products by manufacturer:'} {$manufacturer->name|escape:'htmlall':'UTF-8'}

          + + {if $products} + {include file="$tpl_dir./product-sort.tpl"} + {include file="$tpl_dir./product-list.tpl" products=$products} + {include file="$tpl_dir./pagination.tpl"} + {else} +

          {l s='No products for this manufacturer.'}

          + {/if} +{/if} diff --git a/themes/prestashop/my-account.tpl b/themes/prestashop/my-account.tpl new file mode 100644 index 000000000..1444eb0a7 --- /dev/null +++ b/themes/prestashop/my-account.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='My account'}

          +

          {l s='Welcome to your account. Here you can manage your addresses and orders.'}

          + +

          {l s='Home'}{l s='Home'}

          diff --git a/themes/prestashop/new-products.tpl b/themes/prestashop/new-products.tpl new file mode 100644 index 000000000..7c0b3a52b --- /dev/null +++ b/themes/prestashop/new-products.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='New products'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='New products'}

          + +{if $products} + {include file="$tpl_dir./product-sort.tpl"} + {include file="$tpl_dir./product-list.tpl" products=$products} + {include file="$tpl_dir./pagination.tpl"} +{else} +

          {l s='No new products.'}

          +{/if} diff --git a/themes/prestashop/order-address.tpl b/themes/prestashop/order-address.tpl new file mode 100644 index 000000000..5d1c19362 --- /dev/null +++ b/themes/prestashop/order-address.tpl @@ -0,0 +1,124 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{if !$opc} +{capture name=path}{l s='Addresses'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} +{/if} + +{if !$opc}

          {l s='Addresses'}

          {else}

          1. {l s='Addresses'}

          {/if} + +{if !$opc} +{assign var='current_step' value='address'} +{include file="$tpl_dir./order-steps.tpl"} +{include file="$tpl_dir./errors.tpl"} + +
          +{else} +
          + +{/if} +
          +

          + + +

          +

          + id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1}checked="checked"{/if} /> + +

          +

          id_address_invoice == $cart->id_address_delivery}style="display: none;"{/if}> + {if $addresses|@count > 1} + + + {else} + {l s='Add a new address'} + {/if} +

          +
          + + +
          +

          + {l s='Add a new address'} +

          + {if !$opc} +
          +

          {l s='If you would like to add a comment about your order, please write it below.'}

          +

          +
          + {/if} +
          +{if !$opc} +

          + + + « {l s='Previous'} + +

          + +{else} +
          +{/if} diff --git a/themes/prestashop/order-carrier.tpl b/themes/prestashop/order-carrier.tpl new file mode 100644 index 000000000..aa1b92ffa --- /dev/null +++ b/themes/prestashop/order-carrier.tpl @@ -0,0 +1,184 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if !$opc} + + +{/if} + +{if !$virtual_cart && $giftAllowed && $cart->gift == 1} + +{/if} + +{if !$opc} +{capture name=path}{l s='Shipping'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} +{/if} + +{if !$opc}

          {l s='Shipping'}

          {else}

          2. {l s='Delivery methods'}

          {/if} + +{if !$opc} +{assign var='current_step' value='shipping'} +{include file="$tpl_dir./order-steps.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +
          +{else} +
          + +{/if} + +{if $conditions AND $cms_id} +

          {l s='Terms of service'}

          +

          + + {l s='(read)'} +

          + +{/if} + +{if $virtual_cart} + +{else} +

          {l s='Choose your delivery method'}

          + +
          {if isset($carriers)}{$HOOK_BEFORECARRIER}{/if}
          + {if isset($isVirtualCart) && $isVirtualCart} +

          {l s='No carrier needed for this order'}

          + {else} + {if $recyclablePackAllowed} +

          + + +

          + {/if} +

          {l s='There are no carriers available that deliver to this address.'}

          + + + + + + + + + + + {if isset($carriers)} + {foreach from=$carriers item=carrier name=myLoop} + + + + + + + {/foreach} + {$HOOK_EXTRACARRIER} + {/if} + +
          {l s='Carrier'}{l s='Information'}{l s='Price'}
          + + + + {$carrier.delay|escape:'htmlall':'UTF-8'} + {if $carrier.price} + + {if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if} + + {if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if} + {else} + {l s='Free!'} + {/if} +
          + + + {if $giftAllowed} +

          {l s='Gift'}

          +

          + gift == 1}checked="checked"{/if} onclick="$('#gift_div').toggle('slow');" /> + +
          +       + {if $gift_wrapping_price > 0} + ({l s='Additional cost of'} + + {if $priceDisplay == 1}{convertPrice price=$total_wrapping_tax_exc_cost}{else}{convertPrice price=$total_wrapping_cost}{/if} + + {if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if}) + {/if} +

          +

          + + +

          + {/if} + {/if} +{/if} + +{if !$opc} +

          + + + « {l s='Previous'} + +

          + +{else} +

          {l s='Leave a message'}

          +
          +

          {l s='If you would like to add a comment about your order, please write it below.'}

          +

          +
          +
          +{/if} diff --git a/themes/prestashop/order-confirmation.tpl b/themes/prestashop/order-confirmation.tpl new file mode 100644 index 000000000..04cf2116c --- /dev/null +++ b/themes/prestashop/order-confirmation.tpl @@ -0,0 +1,54 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='Order confirmation'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Order confirmation'}

          + +{assign var='current_step' value='payment'} +{include file="$tpl_dir./order-steps.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +{$HOOK_ORDER_CONFIRMATION} +{$HOOK_PAYMENT_RETURN} + +
          +{if $is_guest} +

          {l s='Your order ID is:'} {$id_order_formatted} . {l s='Your order ID has been sent to your e-mail.'}

          + {l s='Follow my order'} + {l s='Follow my order'} +{else} + {l s='Back to orders'} + {l s='Back to orders'} +{/if} diff --git a/themes/prestashop/order-detail.tpl b/themes/prestashop/order-detail.tpl new file mode 100644 index 000000000..9a6d73c29 --- /dev/null +++ b/themes/prestashop/order-detail.tpl @@ -0,0 +1,350 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
          + +

          + {l s='Order placed on'} {dateFormat date=$order->date_add full=0} + +

          +
          + +{if count($order_history)} +

          {l s='Follow your order step by step'}

          +
          + + + + + + + + + {foreach from=$order_history item=state name="orderStates"} + + + + + {/foreach} + +
          {l s='Date'}{l s='Status'}
          {dateFormat date=$state.date_add full=1}{$state.ostate_name|escape:'htmlall':'UTF-8'}
          +
          +{/if} + +{if isset($followup)} +

          {l s='Click the following link to track the delivery of your order'}

          +{$followup|escape:'htmlall':'UTF-8'} +{/if} + +

          {l s='Order:'} {l s='#'}{$order->id|string_format:"%06d"}

          +{if $carrier->id}

          {l s='Carrier:'} {if $carrier->name == "0"}{$shop_name|escape:'htmlall':'UTF-8'}{else}{$carrier->name|escape:'htmlall':'UTF-8'}{/if}

          {/if} +

          {l s='Payment method:'} {$order->payment|escape:'htmlall':'UTF-8'}

          +{if $invoice AND $invoiceAllowed} +

          + + {l s='Download your invoice as a .PDF file'} +

          +{/if} +{if $order->recyclable} +

           {l s='You have given permission to receive your order in recycled packaging.'}

          +{/if} +{if $order->gift} +

           {l s='You requested gift-wrapping for your order.'}

          +

          {l s='Message:'} {$order->gift_message|nl2br}

          +{/if} +
          +
            +
          • {l s='Invoice'}
          • + {if $address_invoice->company}
          • {$address_invoice->company|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$address_invoice->firstname|escape:'htmlall':'UTF-8'} {$address_invoice->lastname|escape:'htmlall':'UTF-8'}
          • +
          • {$address_invoice->address1|escape:'htmlall':'UTF-8'}
          • + {if $address_invoice->address2}
          • {$address_invoice->address2|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$address_invoice->postcode|escape:'htmlall':'UTF-8'} {$address_invoice->city|escape:'htmlall':'UTF-8'}
          • +
          • {$address_invoice->country|escape:'htmlall':'UTF-8'}{if $invoiceState} - {$invoiceState->name|escape:'htmlall':'UTF-8'}{/if}
          • + {if $address_invoice->phone}
          • {$address_invoice->phone|escape:'htmlall':'UTF-8'}
          • {/if} + {if $address_invoice->phone_mobile}
          • {$address_invoice->phone_mobile|escape:'htmlall':'UTF-8'}
          • {/if} +
          +
            +
          • {l s='Delivery'}
          • + {if $address_delivery->company}
          • {$address_delivery->company|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$address_delivery->firstname|escape:'htmlall':'UTF-8'} {$address_delivery->lastname|escape:'htmlall':'UTF-8'}
          • +
          • {$address_delivery->address1|escape:'htmlall':'UTF-8'}
          • + {if $address_delivery->address2}
          • {$address_delivery->address2|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$address_delivery->postcode|escape:'htmlall':'UTF-8'} {$address_delivery->city|escape:'htmlall':'UTF-8'}
          • +
          • {$address_delivery->country|escape:'htmlall':'UTF-8'}{if $deliveryState} - {$deliveryState->name|escape:'htmlall':'UTF-8'}{/if}
          • + {if $address_delivery->phone}
          • {$address_delivery->phone|escape:'htmlall':'UTF-8'}
          • {/if} + {if $address_delivery->phone_mobile}
          • {$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}
          • {/if} +
          +{$HOOK_ORDERDETAILDISPLAYED} +{if !$is_guest}
          {/if} +
          + + + + {if $return_allowed}{/if} + + + + + + + + + {if $priceDisplay && $use_tax} + + + + {/if} + + + + {if $order->total_discounts > 0} + + + + {/if} + {if $order->total_wrapping > 0} + + + + {/if} + + + + + + + + + {foreach from=$products item=product name=products} + {if !isset($product.deleted)} + {assign var='productId' value=$product.product_id} + {assign var='productAttributeId' value=$product.product_attribute_id} + {if isset($customizedDatas.$productId.$productAttributeId)}{assign var='productQuantity' value=$product.product_quantity-$product.customizationQuantityTotal}{else}{assign var='productQuantity' value=$product.product_quantity}{/if} + + {if isset($customizedDatas.$productId.$productAttributeId)} + + {if $return_allowed}{/if} + + + + + + + {foreach from=$customizedDatas.$productId.$productAttributeId item='customization' key='customizationId'} + + {if $return_allowed}{/if} + + + + + {/foreach} + {/if} + + {if $product.product_quantity > $product.customizationQuantityTotal} + + {if $return_allowed}{/if} + + + + + + + {/if} + {/if} + {/foreach} + {foreach from=$discounts item=discount} + + + + + + + {if $return_allowed} + + {/if} + + {/foreach} + +
          {l s='Reference'}{l s='Product'}{l s='Quantity'}{l s='Unit price'}{l s='Total price'}
          + {l s='Total products (tax excl.):'} {displayWtPriceWithCurrency price=$order->getTotalProductsWithoutTaxes() currency=$currency convert=0} +
          + {l s='Total products'} {if $use_tax}{l s='(tax incl.)'}{/if}: {displayWtPriceWithCurrency price=$order->getTotalProductsWithTaxes() currency=$currency convert=0} +
          + {l s='Total vouchers:'} {displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1} +
          + {l s='Total gift-wrapping:'} {displayWtPriceWithCurrency price=$order->total_wrapping currency=$currency convert=0} +
          + {l s='Total shipping'} {if $use_tax}{l s='(tax incl.)'}{/if}: {displayWtPriceWithCurrency price=$order->total_shipping currency=$currency convert=0} +
          + {l s='Total:'} {displayWtPriceWithCurrency price=$order->total_paid currency=$currency convert=0} +
          + + + + + +
          + {foreach from=$customization.datas key='type' item='datas'} + {if $type == $CUSTOMIZE_FILE} +
            + {foreach from=$datas item='data'} +
          • + {/foreach} +
          + {elseif $type == $CUSTOMIZE_TEXTFIELD} +
            {counter start=0 print=false} + {foreach from=$datas item='data'} + {assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field} +
          • {$data.name|default:$customizationFieldName}{l s=':'} {$data.value}
          • + {/foreach} +
          + {/if} + {/foreach} +
          + +
          + + + + + +
          {$discount.name|escape:'htmlall':'UTF-8'}{l s='Voucher:'} {$discount.name|escape:'htmlall':'UTF-8'}1 {if $discount.value != 0.00}{l s='-'}{/if}{convertPriceWithCurrency price=$discount.value currency=$currency convert=0} 
          +
          +
          +{if !$is_guest} + {if $return_allowed} +

          {l s='Merchandise return'}

          +

          {l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. Then click the button below.'}

          +

          + +

          +

          + + +

          +
          + {/if} +
          + + {if count($messages)} +

          {l s='Messages'}

          +
          + + + + + + + + + {foreach from=$messages item=message name="messageList"} + + + + + {/foreach} + +
          {l s='From'}{l s='Message'}
          + {if isset($message.ename) && $message.ename} + {$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'} + {elseif $message.clastname} + {$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'} + {else} + {$shop_name|escape:'htmlall':'UTF-8'} + {/if} +
          + {dateFormat date=$message.date_add full=1} +
          {$message.message|nl2br}
          +
          + {/if} + {if isset($errors) && $errors} +
          +

          {if $errors|@count > 1}{l s='There are'}{else}{l s='There is'}{/if} {$errors|@count} {if $errors|@count > 1}{l s='errors'}{else}{l s='error'}{/if} :

          +
            + {foreach from=$errors key=k item=error} +
          1. {$error}
          2. + {/foreach} +
          +
          + {/if} +
          +

          {l s='Add a message:'}

          +

          {l s='If you would like to add a comment about your order, please write it below.'}

          +

          + +

          +

          + + +

          +
          +{else} +

           {l s='You can\'t make a merchandise return with a guest account'}

          +{/if} diff --git a/themes/prestashop/order-follow.tpl b/themes/prestashop/order-follow.tpl new file mode 100644 index 000000000..608f4a0b3 --- /dev/null +++ b/themes/prestashop/order-follow.tpl @@ -0,0 +1,84 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Return Merchandise Authorization (RMA)'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Return Merchandise Authorization (RMA)'}

          +{if isset($errorQuantity) && $errorQuantity}

          {l s='You do not have enough products to request another merchandise return.'}

          {/if} +{if isset($errorMsg) && $errorMsg}

          {l s='Please provide an explanation for your RMA.'}

          {/if} +{if isset($errorDetail1) && $errorDetail1}

          {l s='Please check at least one product you would like to return.'}

          {/if} +{if isset($errorDetail2) && $errorDetail2}

          {l s='Please provide a quantity for the product you checked.'}

          {/if} +{if isset($errorNotReturnable) && $errorNotReturnable}

          {l s='This order cannot be returned.'}

          {/if} + +

          {l s='Here are the merchandise returns you have made'}.

          +
          + {if $ordersReturn && count($ordersReturn)} + + + + + + + + + + + + {foreach from=$ordersReturn item=return name=myLoop} + + + + + + + + {/foreach} + +
          {l s='Return'}{l s='Order'}{l s='Package status'}{l s='Date issued'}{l s='Return slip'}
          {l s='#'}{$return.id_order_return|string_format:"%06d"}{l s='#'}{$return.id_order|string_format:"%06d"}{$return.state_name|escape:'htmlall':'UTF-8'}{dateFormat date=$return.date_add full=0} + {if $return.state == 2} + {l s='Order return'} {l s='#'}{$return.id_order_return|string_format: + {l s='Print out'} + {else} + -- + {/if} +
          + + {else} +

          {l s='You have no return merchandise authorizations.'}

          + {/if} +
          + + \ No newline at end of file diff --git a/themes/prestashop/order-opc-new-account.tpl b/themes/prestashop/order-opc-new-account.tpl new file mode 100644 index 000000000..16685d70b --- /dev/null +++ b/themes/prestashop/order-opc-new-account.tpl @@ -0,0 +1,354 @@ +
          + +

          1. {l s='Account'}

          +
          +
          +

          {l s='Already registered?'} {l s='Click here'}

          + +
          +
          +
          +
          +

          {l s='New Customer'}

          +
          +
          +

          {l s='Instant Checkout'}

          +

          + +

          +
          + +
          +

          {l s='Create your account today and enjoy:'}

          +
            +
          • {l s='Personalized and secure access'}
          • +
          • {l s='Fast and easy check out'}
          • +
          +

          + +

          +
          +
          +
          +
          + + + + + + + + + +

          + + + * +

          +

          + + + * + {l s='(5 characters min.)'} +

          +

          + {l s='Title'} + + + + +

          +

          + + + * +

          +

          + + + * +

          +

          + {l s='Date of Birth'} + + {* + {l s='January'} + {l s='February'} + {l s='March'} + {l s='April'} + {l s='May'} + {l s='June'} + {l s='July'} + {l s='August'} + {l s='September'} + {l s='October'} + {l s='November'} + {l s='December'} + *} + + +

          + {if $newsletter} +

          + + +

          +

          + + +

          + {/if} +

          {l s='Delivery address'}

          +

          + + +

          + +

          + + + {l s='DNI / NIF / NIE'} +

          +

          + + + * +

          +

          + + + * +

          +

          + + + * +

          +

          + + +

          +

          + + + * +

          +

          + + + * +

          +

          + + + * +

          +

          + + + * +

          +

          + + +

          +

          + + * +

          +

          + + +

          + + +

          + + +

          + +
          +

          {l s='Invoice address'}

          +

          + + +

          + +

          + + + {l s='DNI / NIF / NIE'} +

          +

          + + + * +

          +

          + + + * +

          +

          + + + * +

          +

          + + +

          +

          + + + * +

          +

          + + + * +

          +

          + + + * +

          + +

          + + +

          +

          + + * +

          +

          + + +

          + +
          +

          + +

          + +

          + *{l s='Required field'} +

          + +
          +
          +
          +
          +
          diff --git a/themes/prestashop/order-opc.tpl b/themes/prestashop/order-opc.tpl new file mode 100755 index 000000000..f1d9b3b82 --- /dev/null +++ b/themes/prestashop/order-opc.tpl @@ -0,0 +1,101 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $PS_CATALOG_MODE} +

          {l s='Your shopping cart'}

          +

          {l s='This store has not accepted your new order.'}

          +{else} + + {if $productNumber} + + {include file="$tpl_dir./shopping-cart.tpl"} + + {if $isLogged AND !$isGuest} + {include file="$tpl_dir./order-address.tpl"} + {else} + + {include file="$tpl_dir./order-opc-new-account.tpl"} + + {/if} + + {include file="$tpl_dir./order-carrier.tpl"} + + + + {include file="$tpl_dir./order-payment.tpl"} + + {else} +

          {l s='Your shopping cart'}

          +

          {l s='Your shopping cart is empty.'}

          + {/if} +{/if} diff --git a/themes/prestashop/order-payment.tpl b/themes/prestashop/order-payment.tpl new file mode 100644 index 000000000..d7e05b103 --- /dev/null +++ b/themes/prestashop/order-payment.tpl @@ -0,0 +1,66 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if !$opc} + + + {capture name=path}{l s='Your payment method'}{/capture} + {include file="$tpl_dir./breadcrumb.tpl"} +{/if} + +{if !$opc}

          {l s='Choose your payment method'}

          {else}

          3. {l s='Choose your payment method'}

          {/if} + +{if !$opc} + {assign var='current_step' value='payment'} + {include file="$tpl_dir./order-steps.tpl"} + + {include file="$tpl_dir./errors.tpl"} +{else} +
          + +{/if} + +
          {$HOOK_TOP_PAYMENT}
          + +{if $HOOK_PAYMENT} + {if !$opc}

          {l s='Please select your preferred payment method to pay the amount of'} {convertPrice price=$total_price} {if $taxes_enabled}{l s='(tax incl.)'}{/if}


          {/if} + {if $opc}
          {/if} +
          {$HOOK_PAYMENT}
          + {if $opc}
          {/if} +{else} +

          {l s='No payment modules have been installed.'}

          +{/if} + +{if !$opc} +

          « {l s='Previous'}

          +{else} +
          +{/if} + diff --git a/themes/prestashop/order-return.tpl b/themes/prestashop/order-return.tpl new file mode 100644 index 000000000..3fca59f1f --- /dev/null +++ b/themes/prestashop/order-return.tpl @@ -0,0 +1,106 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

          {l s='RE#'}{$orderRet->id|string_format:"%06d"} {l s='on'} {dateFormat date=$order->date_add full=0}

          +
          +

          {l s='We have logged your return request.'}

          +

          {l s='Your package must be returned to us within'} {$nbdaysreturn} {l s='days of receiving your order.'}

          +

          {l s='Current status of your merchandise return:'} {$state_name|escape:'htmlall':'UTF-8'}

          +

          {l s='List of items marked as returned:'}

          +
          +
          + + + + + + + + + + {foreach from=$products item=product name=products} + + {assign var='quantityDisplayed' value=0} + {foreach from=$returnedCustomizations item='customization' name=products} + {if $customization.product_id == $product.product_id} + + + + + + {assign var='productId' value=$customization.product_id} + {assign var='productAttributeId' value=$customization.product_attribute_id} + {assign var='customizationId' value=$customization.id_customization} + {foreach from=$customizedDatas.$productId.$productAttributeId.$customizationId.datas key='type' item='datas'} + + + + {/foreach} + {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.product_quantity} + {/if} + {/foreach} + + {if $product.product_quantity > $quantityDisplayed} + + + + + + {/if} + {/foreach} + +
          {l s='Reference'}{l s='Product'}{l s='Quantity'}
          {if $customization.reference}{$customization.reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$customization.name|escape:'htmlall':'UTF-8'}{$customization.product_quantity|intval}
          + {if $type == $smarty.const._CUSTOMIZE_FILE_} +
            + {foreach from=$datas item='data'} +
          • WAHOU
          • + {/foreach} +
          + {elseif $type == $smarty.const._CUSTOMIZE_TEXTFIELD_} +
            {counter start=0 print=false} + {foreach from=$datas item='data'} + {assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field} +
          • {$data.name|default:$customizationFieldName}{l s=':'} {$data.value}
          • + {/foreach} +
          + {/if} +
          {if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$product.product_name|escape:'htmlall':'UTF-8'}{$product.product_quantity|intval}
          +
          +{if $orderRet->state == 2} +

          {l s='REMINDER:'}

          +
          + - {l s='All products must be returned in their original packaging without damage or wear.'} +
          - {l s='Please print out the'} {l s='PDF document'} {l s='and slip it into your package.'} +
          - {l s='Please see PDF document'} ({l s='for the correct address'}) +

          + {l s='Upon receiving your package, you will be notified by e-mail. We will then begin processing the reimbursement of your order total.'} +

          {l s='Let us know if you have any questions.'} +
          +

          {l s='If the conditions of return listed above are not respected, we reserve the right to refuse your package and/or reimbursement.'}

          +
          +{elseif $orderRet->state == 1} +

          {l s='You must wait for our confirmation before returning any merchandise.'}

          +{/if} diff --git a/themes/prestashop/order-slip.tpl b/themes/prestashop/order-slip.tpl new file mode 100644 index 000000000..aeb489ce9 --- /dev/null +++ b/themes/prestashop/order-slip.tpl @@ -0,0 +1,71 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Credit slips'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Credit slips'}

          +

          {l s='Credit slips you have received after cancelled orders'}.

          +
          + {if $ordersSlip && count($ordersSlip)} + + + + + + + + + + + {foreach from=$ordersSlip item=slip name=myLoop} + + + + + + + {/foreach} + +
          {l s='Credit slip'}{l s='Order'}{l s='Date issued'}{l s='View credit slip'}
          {l s='#'}{$slip.id_order_slip|string_format:"%06d"}{l s='#'}{$slip.id_order|string_format:"%06d"}{dateFormat date=$slip.date_add full=0} + {l s='Order slip'} {l s='#'}{$slip.id_order_slip|string_format: + {l s='PDF'} +
          + + {else} +

          {l s='You have not received any credit slips.'}

          + {/if} +
          + diff --git a/themes/prestashop/order-steps.tpl b/themes/prestashop/order-steps.tpl new file mode 100644 index 000000000..e1c7802a1 --- /dev/null +++ b/themes/prestashop/order-steps.tpl @@ -0,0 +1,72 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{* Assign a value to 'current_step' to display current style *} +{if !$opc} + +
            +
          • + {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address' || $current_step=='login'} + + {l s='Summary'} + + {else} + {l s='Summary'} + {/if} +
          • +
          • + {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address'} + + {l s='Login'} + + {else} + {l s='Login'} + {/if} +
          • +
          • + {if $current_step=='payment' || $current_step=='shipping'} + + {l s='Address'} + + {else} + {l s='Address'} + {/if} +
          • +
          • + {if $current_step=='payment'} + + {l s='Shipping'} + + {else} + {l s='Shipping'} + {/if} +
          • +
          • + {l s='Payment'} +
          • +
          + +{/if} \ No newline at end of file diff --git a/themes/prestashop/pagination.tpl b/themes/prestashop/pagination.tpl new file mode 100644 index 000000000..0002f15d0 --- /dev/null +++ b/themes/prestashop/pagination.tpl @@ -0,0 +1,102 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if isset($p) AND $p} + {if isset($smarty.get.id_category) && $smarty.get.id_category && isset($category)} + {assign var='requestPage' value=$link->getPaginationLink('category', $category, false, false, true, false)} + {assign var='requestNb' value=$link->getPaginationLink('category', $category, true, false, false, true)} + {elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer && isset($manufacturer)} + {assign var='requestPage' value=$link->getPaginationLink('manufacturer', $manufacturer, false, false, true, false)} + {assign var='requestNb' value=$link->getPaginationLink('manufacturer', $manufacturer, true, false, false, true)} + {elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier && isset($supplier)} + {assign var='requestPage' value=$link->getPaginationLink('supplier', $supplier, false, false, true, false)} + {assign var='requestNb' value=$link->getPaginationLink('supplier', $supplier, true, false, false, true)} + {else} + {assign var='requestPage' value=$link->getPaginationLink(false, false, false, false, true, false)} + {assign var='requestNb' value=$link->getPaginationLink(false, false, true, false, false, true)} + {/if} + + + +{/if} diff --git a/themes/prestashop/password.tpl b/themes/prestashop/password.tpl new file mode 100644 index 000000000..7a915a66d --- /dev/null +++ b/themes/prestashop/password.tpl @@ -0,0 +1,54 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Forgot your password'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Forgot your password'}

          + +{include file="$tpl_dir./errors.tpl"} + +{if isset($confirmation) && $confirmation == 1} +

          {l s='Your password has been successfully reset and has been sent to your e-mail address:'} {$email|escape:'htmlall':'UTF-8'}

          +{elseif isset($confirmation) && $confirmation == 2} +

          {l s='A confirmation e-mail has been sent to your address:'} {$email|escape:'htmlall':'UTF-8'}

          +{else} +

          {l s='Please enter the e-mail address used to register. We will e-mail you your new password.'}

          +
          +
          +

          + + +

          +

          + +

          +
          +
          +{/if} +

          + {l s='Return to Login'}{l s='Back to Login'} +

          diff --git a/themes/prestashop/preview.jpg b/themes/prestashop/preview.jpg new file mode 100644 index 000000000..22a3cf9f5 Binary files /dev/null and b/themes/prestashop/preview.jpg differ diff --git a/themes/prestashop/prices-drop.tpl b/themes/prestashop/prices-drop.tpl new file mode 100644 index 000000000..98d2bfa40 --- /dev/null +++ b/themes/prestashop/prices-drop.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Price drop'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Price drop'}

          + +{if $products} + {include file="$tpl_dir./product-sort.tpl"} + {include file="$tpl_dir./product-list.tpl" products=$products} + {include file="$tpl_dir./pagination.tpl"} +{else} +

          {l s='No price drop.'}

          +{/if} diff --git a/themes/prestashop/product-compare.tpl b/themes/prestashop/product-compare.tpl new file mode 100644 index 000000000..392657a72 --- /dev/null +++ b/themes/prestashop/product-compare.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $comparator_max_item} + +
          +

          + + +

          +
          +{/if} + diff --git a/themes/prestashop/product-list.tpl b/themes/prestashop/product-list.tpl new file mode 100644 index 000000000..384868e6f --- /dev/null +++ b/themes/prestashop/product-list.tpl @@ -0,0 +1,63 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if isset($products)} + +
            + {foreach from=$products item=product name=products} +
          • + +
            + {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='On sale!'} + {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}{l s='Reduced price!'}{/if} + {if isset($product.online_only) && $product.online_only}{l s='Online only!'}{/if} + {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} +
            + {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
            {/if} + {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}{/if} +
            + {/if} + {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} + {if ($product.allow_oosp || $product.quantity > 0) && $product.customizable != 2} + {l s='Add to cart'} + {else} + {l s='Add to cart'} + {/if} + {/if} + {l s='View'} + {if isset($comparator_max_item) && $comparator_max_item} +

            + {/if} +
            +
          • + {/foreach} +
          + +{/if} diff --git a/themes/prestashop/product-sort.tpl b/themes/prestashop/product-sort.tpl new file mode 100644 index 000000000..14843f619 --- /dev/null +++ b/themes/prestashop/product-sort.tpl @@ -0,0 +1,56 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if isset($orderby) AND isset($orderway)} + +{if isset($smarty.get.id_category) && $smarty.get.id_category} + {assign var='request' value=$link->getPaginationLink('category', $category, false, true)} +{elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer} + {assign var='request' value=$link->getPaginationLink('manufacturer', $manufacturer, false, true)} +{elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier} + {assign var='request' value=$link->getPaginationLink('supplier', $supplier, false, true)} +{else} + {assign var='request' value=$link->getPaginationLink(false, false, false, true)} +{/if} +
          +

          + + +

          +
          + +{/if} diff --git a/themes/prestashop/product.tpl b/themes/prestashop/product.tpl new file mode 100644 index 000000000..113cc3f53 --- /dev/null +++ b/themes/prestashop/product.tpl @@ -0,0 +1,541 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{include file="$tpl_dir./errors.tpl"} +{if $errors|@count == 0} + + +{include file="$tpl_dir./breadcrumb.tpl"} +
          +

          {$product->name|escape:'htmlall':'UTF-8'}

          + + {if isset($adminActionDisplay) && $adminActionDisplay} +
          +

          {l s='This product is not visible to your customers.'} + + + +

          +
          +

          +

          +
          + {/if} + + {if isset($confirmation) && $confirmation} +

          + {$confirmation} +

          + {/if} + + +
          + +
          + {if $have_image} + {$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')} + {else} + + {/if} +
          + + {if isset($images) && count($images) > 0} + +
          + {if isset($images) && count($images) > 3}{/if} +
          +
            + {if isset($images)} + {foreach from=$images item=image name=thumbnails} + {assign var=imageIds value="`$product->id`-`$image.id_image`"} +
          • + + {$image.legend|htmlspecialchars} + +
          • + {/foreach} + {/if} +
          +
          + {if isset($images) && count($images) > 3}{l s='Next'}{/if} +
          + {/if} + {if isset($images) && count($images) > 1}

          {/if} + + +
          + + +
          + {if $product->description_short OR $packItems|@count > 0} +
          + {if $product->description_short} +
          {$product->description_short}
          + {/if} + {if $product->description} +

          {l s='More details'}

          + {/if} + {if $packItems|@count > 0} +

          {l s='Pack content'}

          + {foreach from=$packItems item=packItem} +
          + {$packItem.pack_quantity} x {$packItem.name|escape:'htmlall':'UTF-8'} +

          {$packItem.description_short}

          +
          + {/foreach} + {/if} +
          + {/if} + + {if isset($colors) && $colors} + +
          +

          {l s='Pick a color:' js=1}

          +
          + +
          +
          + {/if} + + {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} + +
          quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post"> + + + + + + {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} +

          + {if !$priceDisplay || $priceDisplay == 2} + {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL)} + {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} + {elseif $priceDisplay == 1} + {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL)} + {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} + {/if} + {if $product->on_sale} + {l s='On sale'} + {l s='On sale!'} + {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} + {l s='Reduced price!'} + {/if} +
          + + {if $priceDisplay >= 0 && $priceDisplay <= 2} + {convertPrice price=$productPrice} + {if $tax_enabled} + {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} + {/if} + {/if} + + {if $priceDisplay == 2} +
          + {convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'} + {/if} +
          +

          + {if $product->specificPrice AND $product->specificPrice.reduction} +

          + {if $priceDisplay >= 0 && $priceDisplay <= 2} + {if $productPriceWithoutRedution > $productPrice} + {convertPrice price=$productPriceWithoutRedution} + {if $tax_enabled} + {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} + {/if} + {/if} + {/if} + +

          + {/if} + {if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'} +

          {l s='(price reduced by'} {$product->specificPrice.reduction*100} %{l s=')'}

          + {/if} + {if $packItems|@count} +

          {l s='instead of'} {convertPrice price=$product->getNoPackPrice()}

          +
          + {/if} + {if $product->ecotax != 0} +

          {l s='include'} {if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if} {l s='for green tax'} + {if $product->specificPrice AND $product->specificPrice.reduction} +
          {l s='(not impacted by the discount)'} + {/if} +

          + {/if} + {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} + {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price} +

          {convertPrice price=$unit_price} {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}

          + {/if} + {*close if for show price*} + {/if} + + {if isset($groups)} + +
          + {foreach from=$groups key=id_attribute_group item=group} + {if $group.attributes|@count} +

          + + {assign var="groupName" value="group_$id_attribute_group"} + +

          + {/if} + {/foreach} +
          + {/if} + +

          reference}style="display: none;"{/if}>{$product->reference|escape:'htmlall':'UTF-8'}

          + + +

          quantity == 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> + + minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> +

          + + +

          minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>{l s='You must add '}{$product->minimal_quantity}{l s=' as a minimum quantity to buy this product.'}

          + {if $product->minimal_quantity > 1} + + {/if} + + +

          quantity == 0 && !$product->available_later && $allow_oosp) OR ($product->quantity != 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> + {l s='Availability:'} + quantity == 0} class="warning-inline"{/if}> + {if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if} + +

          + + + {if (($display_qties == 1 OR $product->quantity <= $last_qties) && !$PS_CATALOG_MODE && $product->available_for_order)} +

          quantity <= 0} style="display: none;"{/if}> + {$product->quantity|intval} + quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item in stock'} + quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'} +

          + {/if} + +

          quantity > 0} style="display: none;"{/if}> + {$HOOK_PRODUCT_OOS} +

          + +

          quantity > $last_qties OR $product->quantity == 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if} >{l s='Warning: Last items in stock!'}

          + + {if $product->online_only} +

          {l s='Online only'}

          + {/if} + + quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} style="display: none;"{/if} id="add_to_cart" class="buttons_bottom_block">

          + {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if} +
          + + {/if} + {if $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if} +
          +
          + +{if $quantity_discounts} + + +
          + + + {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} + + {/foreach} + + + {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} + + {/foreach} + +
          {$quantity_discount.quantity|intval} + {if $quantity_discount.quantity|intval > 1} + {l s='quantities'} + {else} + {l s='quantity'} + {/if} +
          + {if $quantity_discount.price != 0 OR $quantity_discount.reduction_type == 'amount'} + -{convertPrice price=$quantity_discount.real_value|floatval} + {else} + -{$quantity_discount.real_value|floatval}% + {/if} +
          +
          +{/if} + +{$HOOK_PRODUCT_FOOTER} + + +{if $product->description || $features || $accessories || $HOOK_PRODUCT_TAB || $attachments} +
          + +
          + {if $product->description} + +
          {$product->description}
          + {/if} + {if $features} + +
            + {foreach from=$features item=feature} +
          • {$feature.name|escape:'htmlall':'UTF-8'} {$feature.value|escape:'htmlall':'UTF-8'}
          • + {/foreach} +
          + {/if} + {if $attachments} + + {/if} + {if isset($accessories) AND $accessories} + +
            +
            +
            +
              + {foreach from=$accessories item=accessory name=accessories_list} + {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)} +
            • +
              {$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}
              + +

              + {if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}{/if} + {l s='View'} + {if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} + {l s='Add to cart'} + {else} + {l s='Add to cart'} + {if (isset($accessory.quantity_all_versions) && $accessory.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if} + {/if} +

              +
            • + + {/foreach} +
            +
            +
            +
          + {/if} + {$HOOK_PRODUCT_TAB_CONTENT} +
          +
          +{/if} + + +{if $product->customizable} + +
          +
          +

          + Informations + {l s='After saving your customized product, remember to add it to your cart.'} + {if $product->uploadable_files}
          {l s='Allowed file formats are: GIF, JPG, PNG'}{/if} +

          + {if $product->uploadable_files|intval} +

          {l s='Pictures'}

          +
            + {counter start=0 assign='customizationField'} + {foreach from=$customizationFields item='field' name='customizationFields'} + {if $field.type == 0} +
          • {assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} + {if isset($pictures.$key)}
            + + + {l s='Delete'} + +
            {/if} +
            {if $field.required}*{/if} +
            {if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}
            +
          • + {counter} + {/if} + {/foreach} +
          + {/if} +
          + {if $product->text_fields|intval} +

          {l s='Texts'}

          +
            + {counter start=0 assign='customizationField'} + {foreach from=$customizationFields item='field' name='customizationFields'} + {if $field.type == 1} +
          • {assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} + {if !empty($field.name)}{$field.name}{/if}{if $field.required}*{/if} +
          • + {counter} + {/if} + {/foreach} +
          + {/if} +

          + + + + +

          +
          +

          * {l s='required fields'}

          +
          +{/if} + +{if $packItems|@count > 0} +
          +

          {l s='Pack content'}

          + {include file="$tpl_dir./product-list.tpl" products=$packItems} +
          +{/if} + +{/if} + diff --git a/themes/prestashop/products-comparison.tpl b/themes/prestashop/products-comparison.tpl new file mode 100644 index 000000000..867885a0e --- /dev/null +++ b/themes/prestashop/products-comparison.tpl @@ -0,0 +1,143 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Product Comparison'}{/capture} + +{include file="$tpl_dir./breadcrumb.tpl"} +

          {l s='Product Comparison'}

          + +{if $hasProduct} +
          + + + {assign var='taxes_behavior' value=false} + {if $use_taxes && (!$priceDisplay || $priceDisplay == 2)} + {assign var='taxes_behavior' value=true} + {/if} + {foreach from=$products item=product name=for_products} + {assign var='replace_id' value=$product->id|cat:'|'} + + + {/foreach} + + + + + {section loop=$products|count step=1 start=0 name=td} + + {/section} + + + {if $ordered_features} + {foreach from=$ordered_features item=feature} + + {cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'} + + + {foreach from=$products item=product name=for_products} + {assign var='product_id' value=$product->id} + {assign var='feature_id' value=$feature.id_feature} + {if isset($product_features[$product_id])} + {assign var='tab' value=$product_features[$product_id]} + + {else} + + {/if} + {/foreach} + + {/foreach} + {else} + + + + + {/if} + + {$HOOK_EXTRA_PRODUCT_COMPARISON} +
          +
          {$product->name|truncate:27:'...'|escape:'htmlall':'UTF-8'}
          + +
          + + {$product->name|escape:html:'UTF-8'} + + + {if isset($product->show_price) && $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} +

          {convertPrice price=$product->getPrice($taxes_behavior)}

          +
          + {if $product->on_sale} + {l s='On sale!'} + {elseif $product->specificPrice AND $product->specificPrice.reduction} + {l s='Reduced price!'} + {/if} +
          + + {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} + {math equation="pprice / punit_price" pprice=$product->getPrice($taxes_behavior) punit_price=$product->unit_price_ratio assign=unit_price} +

          {convertPrice price=$unit_price} {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}

          + {else} +   + {/if} + {/if} + +

          + {if !(($product->quantity == 0 && !$product->available_later) OR ($product->quantity != 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE)} + {l s='Availability:'} + quantity == 0} class="warning-inline"{/if}> + {if $product->quantity == 0} + {if $allow_oosp} + {$product->available_later|escape:'htmlall':'UTF-8'} + {else} + {l s='This product is no longer in stock'} + {/if} + {else} + {$product->available_now|escape:'htmlall':'UTF-8'} + {/if} + + {/if} +

          + {l s='Remove'} + {l s='View'} + {if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND !$PS_CATALOG_MODE} + {if ($product->quantity > 0 OR $product->allow_oosp) AND $product->customizable != 2} + {l s='Add to cart'} + {else} + {l s='Add to cart'} + {/if} + {else} +
          + {/if} +
          +
          + {l s='Features'} +
          + {$feature.name|escape:'htmlall':'UTF-8'} + {$tab[$feature_id]|escape:'htmlall':'UTF-8'}
          {l s='No features to compare'}
          +
          +{else} +

          {l s='There is no product in the comparator'}

          +{/if} + diff --git a/themes/prestashop/restricted-country.tpl b/themes/prestashop/restricted-country.tpl new file mode 100644 index 000000000..a0afba908 --- /dev/null +++ b/themes/prestashop/restricted-country.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + {$meta_title|escape:'htmlall':'UTF-8'} + +{if isset($meta_description)} + +{/if} +{if isset($meta_keywords)} + +{/if} + + + + + +
          +

          logo

          +

          + {l s='You cannot access our store from your country. We apologize for the inconvenience.'} +

          +   +
          + + \ No newline at end of file diff --git a/themes/prestashop/scenes.tpl b/themes/prestashop/scenes.tpl new file mode 100644 index 000000000..2301aecc8 --- /dev/null +++ b/themes/prestashop/scenes.tpl @@ -0,0 +1,92 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if scenes} + + + + + +
          +
          + {foreach from=$scenes key='scene_key' item='scene' name='scenes'} +
          + {foreach from=$scene->products key='product_key' item='product'} + {assign var=imageIds value="`$product.id_product`-`$product.id_image`"} + +   + + + {/foreach} +
          + {/foreach} +
          + {if isset($scenes.1)} +
          + + + +
          +
            + {foreach from=$scenes item='scene' name='scenes_list'} +
          • + + {$scene->name|escape:'htmlall':'UTF-8'} + +
          • + {/foreach} +
          +
          + + + +
          + {/if} +
          +{/if} diff --git a/themes/prestashop/search.tpl b/themes/prestashop/search.tpl new file mode 100644 index 000000000..0e3ad9f41 --- /dev/null +++ b/themes/prestashop/search.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Search'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          +{l s='Search'} {if $nbProducts > 0}"{if isset($search_query) && $search_query}{$search_query|escape:'htmlall':'UTF-8'}{elseif $search_tag}{$search_tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if} +{if isset($instantSearch) && $instantSearch}{l s='Return to previous page'}{/if} +

          + +{include file="$tpl_dir./errors.tpl"} +{if !$nbProducts} +

          + {if isset($search_query) && $search_query} + {l s='No results found for your search'} "{if isset($search_query)}{$search_query|escape:'htmlall':'UTF-8'}{/if}" + {elseif isset($search_tag) && $search_tag} + {l s='No results found for your search'} "{$tag|escape:'htmlall':'UTF-8'}" + {else} + {l s='Please type a search keyword'} + {/if} +

          +{else} +

          {$nbProducts|intval} {if $nbProducts == 1}{l s='result has been found.'}{else}{l s='results have been found.'}{/if}

          + {if !isset($instantSearch) || (isset($instantSearch) && !$instantSearch)}{include file="$tpl_dir./product-sort.tpl"}{/if} + {include file="$tpl_dir./product-list.tpl" products=$search_products} + {if !isset($instantSearch) || (isset($instantSearch) && !$instantSearch)}{include file="$tpl_dir./pagination.tpl"}{/if} +{/if} diff --git a/themes/prestashop/shopping-cart-product-line.tpl b/themes/prestashop/shopping-cart-product-line.tpl new file mode 100644 index 000000000..6abfbdc95 --- /dev/null +++ b/themes/prestashop/shopping-cart-product-line.tpl @@ -0,0 +1,80 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + {$product.name|escape:'htmlall':'UTF-8'} + + +
          {$product.name|escape:'htmlall':'UTF-8'}
          + {if isset($product.attributes) && $product.attributes}{$product.attributes|escape:'htmlall':'UTF-8'}{/if} + + {if $product.reference}{$product.reference|escape:'htmlall':'UTF-8'}{else}--{/if} + + {if $product.active AND ($product.allow_oosp OR ($product.quantity <= $product.stock_quantity)) AND $product.available_for_order AND !$PS_CATALOG_MODE} + {l s='Available'} + {else} + {l s='Out of stock'} + {/if} + + + + {if !$priceDisplay}{convertPrice price=$product.price_wt}{else}{convertPrice price=$product.price}{/if} + + + + {if isset($customizedDatas.$productId.$productAttributeId) AND $quantityDisplayed == 0}{$product.customizationQuantityTotal}{/if} + {if !isset($customizedDatas.$productId.$productAttributeId) OR $quantityDisplayed > 0} +
          + {l s='Delete'} +
          +
          + {l s='Add'}
          + {if $product.minimal_quantity < ($product.cart_quantity-$quantityDisplayed) OR $product.minimal_quantity <= 1} + + {l s='Subtract'} + + {else} + + {l s='Subtract'} + + {/if} +
          + + + + {/if} + + + + {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)} + {if !$priceDisplay}{displayPrice price=$product.total_customization_wt}{else}{displayPrice price=$product.total_customization}{/if} + {else} + {if !$priceDisplay}{displayPrice price=$product.total_wt}{else}{displayPrice price=$product.total}{/if} + {/if} + + + diff --git a/themes/prestashop/shopping-cart.tpl b/themes/prestashop/shopping-cart.tpl new file mode 100644 index 000000000..98f89a9b6 --- /dev/null +++ b/themes/prestashop/shopping-cart.tpl @@ -0,0 +1,339 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Your shopping cart'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Shopping cart summary'}

          + +{assign var='current_step' value='summary'} +{include file="$tpl_dir./order-steps.tpl"} +{include file="$tpl_dir./errors.tpl"} + +{if isset($empty)} +

          {l s='Your shopping cart is empty.'}

          +{elseif $PS_CATALOG_MODE} +

          {l s='This store has not accepted your new order.'}

          +{else} + + +{if isset($lastProductAdded) AND $lastProductAdded} + {foreach from=$products item=product} + {if $product.id_product == $lastProductAdded.id_product AND (!$product.id_product_attribute OR ($product.id_product_attribute == $lastProductAdded.id_product_attribute))} +
          +
          +
          {l s='Last added product'}
          +
          + {$product.name|escape:'htmlall':'UTF-8'} +
          +
          {$product.name|escape:'htmlall':'UTF-8'}
          + {if isset($product.attributes) && $product.attributes}{$product.attributes|escape:'htmlall':'UTF-8'}{/if} +
          +
          +
          + {/if} + {/foreach} +{/if} +

          {l s='Your shopping cart contains'} {$productNumber} {if $productNumber == 1}{l s='product'}{else}{l s='products'}{/if}

          +
          + + + + + + + + + + + + + + {if $use_taxes} + {if $priceDisplay} + + + + + {else} + + + + + {/if} + {else} + + + + + {/if} + + + + + + + + + {if $use_taxes} + {if $priceDisplay} + + + + + {else} + + + + + {/if} + {else} + + + + + {/if} + + {if $use_taxes} + + + + + + + + + + + + + {else} + + + + + {/if} + + + + + + + {foreach from=$products item=product name=productLoop} + {assign var='productId' value=$product.id_product} + {assign var='productAttributeId' value=$product.id_product_attribute} + {assign var='quantityDisplayed' value=0} + {* Display the product line *} + {include file="$tpl_dir./shopping-cart-product-line.tpl"} + {* Then the customized datas ones*} + {if isset($customizedDatas.$productId.$productAttributeId)} + {foreach from=$customizedDatas.$productId.$productAttributeId key='id_customization' item='customization'} + + + + + + {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} + {/foreach} + {* If it exists also some uncustomized products *} + {if $product.quantity-$quantityDisplayed > 0}{include file="$tpl_dir./shopping-cart-product-line.tpl"}{/if} + {/if} + {/foreach} + + {if sizeof($discounts)} + + {foreach from=$discounts item=discount name=discountLoop} + + + + + + + {/foreach} + + {/if} +
          {l s='Product'}{l s='Description'}{l s='Ref.'}{l s='Avail.'}{l s='Unit price'}{l s='Qty'}{l s='Total'}
          {l s='Total products (tax excl.):'}{displayPrice price=$total_products}
          {l s='Total products (tax incl.):'}{displayPrice price=$total_products_wt}
          {l s='Total products:'}{displayPrice price=$total_products}
          + {if $use_taxes} + {if $priceDisplay} + {l s='Total vouchers (tax excl.):'} + {else} + {l s='Total vouchers (tax incl.):'} + {/if} + {else} + {l s='Total vouchers:'} + {/if} + + {if $use_taxes} + {if $priceDisplay} + {displayPrice price=$total_discounts_tax_exc} + {else} + {displayPrice price=$total_discounts} + {/if} + {else} + {displayPrice price=$total_discounts_tax_exc} + {/if} +
          + {if $use_taxes} + {if $priceDisplay} + {l s='Total gift-wrapping (tax excl.):'} + {else} + {l s='Total gift-wrapping (tax incl.):'} + {/if} + {else} + {l s='Total gift-wrapping:'} + {/if} + + {if $use_taxes} + {if $priceDisplay} + {displayPrice price=$total_wrapping_tax_exc} + {else} + {displayPrice price=$total_wrapping} + {/if} + {else} + {displayPrice price=$total_wrapping_tax_exc} + {/if} +
          {l s='Total (tax excl.):'}{displayPrice price=$total_price_without_tax}
          {l s='Total tax:'}{displayPrice price=$total_tax}
          {l s='Total (tax incl.):'}{displayPrice price=$total_price}
          {l s='Total:'}{displayPrice price=$total_price_without_tax}
          + {foreach from=$customization.datas key='type' item='datas'} + {if $type == $CUSTOMIZE_FILE} +
          +
            + {foreach from=$datas item='picture'}
          • {/foreach} +
          +
          + {elseif $type == $CUSTOMIZE_TEXTFIELD} +
            + {foreach from=$datas item='textField' name='typedText'}
          • {if $textField.name}{$textField.name}{else}{l s='Text #'}{$smarty.foreach.typedText.index+1}{/if}{l s=':'} {$textField.value}
          • {/foreach} +
          + {/if} + {/foreach} +
          +
          + {l s='Delete'} +
          +
          + {l s='Add'}
          + {if $product.minimal_quantity < ($customization.quantity -$quantityDisplayed) OR $product.minimal_quantity <= 1} + + {l s='Subtract'} + + {else} + + {l s='Subtract'} + + {/if} +
          + + +
          {$discount.name}{$discount.description}{l s='Delete'} + {if $discount.value_real > 0} + {if !$priceDisplay}{displayPrice price=$discount.value_real*-1}{else}{displayPrice price=$discount.value_tax_exc*-1}{/if} + {/if} +
          +
          + +{if $voucherAllowed} +
          + {if isset($errors_discount) && $errors_discount} +
            + {foreach from=$errors_discount key=k item=error} +
          • {$error|escape:'htmlall':'UTF-8'}
          • + {/foreach} +
          + {/if} +
          +
          +

          {l s='Vouchers'}

          +

          + + +

          +

          + {if $displayVouchers} +

          {l s='Take advantage of our offers:'}

          +
          + {foreach from=$displayVouchers item=voucher} + {$voucher.name} - {$voucher.description}
          + {/foreach} +
          + {/if} +
          +
          +
          +{/if} +
          {$HOOK_SHOPPING_CART}
          +{if (($carrier->id AND !isset($virtualCart)) OR $delivery->id OR $invoice->id) AND !$opc} +
          + {if $delivery->id} +
            +
          • {l s='Delivery address'}
          • + {if $delivery->company}
          • {$delivery->company|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$delivery->firstname|escape:'htmlall':'UTF-8'} {$delivery->lastname|escape:'htmlall':'UTF-8'}
          • +
          • {$delivery->address1|escape:'htmlall':'UTF-8'}
          • + {if $delivery->address2}
          • {$delivery->address2|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$delivery->postcode|escape:'htmlall':'UTF-8'} {$delivery->city|escape:'htmlall':'UTF-8'}
          • +
          • {$delivery->country|escape:'htmlall':'UTF-8'} {if $delivery_state}({$delivery_state|escape:'htmlall':'UTF-8'}){/if}
          • +
          + {/if} + {if $invoice->id} +
            +
          • {l s='Invoice address'}
          • + {if $invoice->company}
          • {$invoice->company|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$invoice->firstname|escape:'htmlall':'UTF-8'} {$invoice->lastname|escape:'htmlall':'UTF-8'}
          • +
          • {$invoice->address1|escape:'htmlall':'UTF-8'}
          • + {if $invoice->address2}
          • {$invoice->address2|escape:'htmlall':'UTF-8'}
          • {/if} +
          • {$invoice->postcode|escape:'htmlall':'UTF-8'} {$invoice->city|escape:'htmlall':'UTF-8'}
          • +
          • {$invoice->country|escape:'htmlall':'UTF-8'} {if $invoice_state}({$invoice_state|escape:'htmlall':'UTF-8'}){/if}
          • +
          + {/if} + {if $carrier->id AND !isset($virtualCart)} +
          +

          {l s='Carrier:'}

          + {if isset($carrierPicture)}{l s='Carrier'}{/if} + {$carrier->name|escape:'htmlall':'UTF-8'} +
          + {/if} +
          +{/if} +

          + {if !$opc}{l s='Next'} »{/if} + « {l s='Continue shopping'} +

          +



          +

          + {$HOOK_SHOPPING_CART_EXTRA} +

          +{/if} + diff --git a/themes/prestashop/sitemap.tpl b/themes/prestashop/sitemap.tpl new file mode 100644 index 000000000..760745281 --- /dev/null +++ b/themes/prestashop/sitemap.tpl @@ -0,0 +1,90 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Sitemap'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Sitemap'}

          +
          +
          +

          {l s='Our offers'}

          + +
          +
          +

          {l s='Your Account'}

          + +
          +
          +
          +
          +
          +

          {l s='Categories'}

          + +
            + {if isset($categoriesTree.children)} + {foreach from=$categoriesTree.children item=child name=sitemapTree} + {if $smarty.foreach.sitemapTree.last} + {include file="$tpl_dir./category-tree-branch.tpl" node=$child last='true'} + {else} + {include file="$tpl_dir./category-tree-branch.tpl" node=$child} + {/if} + {/foreach} + {/if} +
          +
          +
          +

          {l s='Pages'}

          + +
            + {if isset($categoriescmsTree.children)} + {foreach from=$categoriescmsTree.children item=child name=sitemapCmsTree} + {if (isset($child.children) && $child.children|@count > 0) || $child.cms|@count > 0} + {include file="$tpl_dir./category-cms-tree-branch.tpl" node=$child} + {/if} + {/foreach} + {/if} + {foreach from=$categoriescmsTree.cms item=cms name=cmsTree} +
          • {$cms.meta_title|escape:'htmlall':'UTF-8'}
          • + {/foreach} +
          • {l s='Contact'}
          • + {if $display_store}
          • {l s='Our stores'}
          • {/if} +
          +
          +
          diff --git a/themes/prestashop/store_infos.tpl b/themes/prestashop/store_infos.tpl new file mode 100644 index 000000000..e6499112f --- /dev/null +++ b/themes/prestashop/store_infos.tpl @@ -0,0 +1,45 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +{* + {l s='Monday'} + {l s='Tuesday'} + {l s='Wednesday'} + {l s='Thursday'} + {l s='Friday'} + {l s='Saturday'} + {l s='Sunday'} +*} +
          +
          +{l s='Hours:'} + + {foreach $days_datas as $one_day} + + + + + {/foreach} +
          {l s=$one_day['day']}{$one_day['hours']}
          diff --git a/themes/prestashop/stores.tpl b/themes/prestashop/stores.tpl new file mode 100644 index 000000000..7d18ed6cd --- /dev/null +++ b/themes/prestashop/stores.tpl @@ -0,0 +1,97 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Our stores'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Our stores'}

          + +{if $simplifiedStoresDiplay} + {if $stores|@count} +

          {l s='Here are the details of our stores, feel free to contact us:'}

          + {foreach from=$stores item=store} +
          + {if $store.has_picture}

          {/if} +

          + {$store.name|escape:'htmlall':'UTF-8'}
          + {$store.address1|escape:'htmlall':'UTF-8'}
          + {if $store.address2}{$store.address2|escape:'htmlall':'UTF-8'}{/if}
          + {$store.postcode} {$store.city|escape:'htmlall':'UTF-8'}{if $store.state}, {$store.state}{/if}
          + {$store.country|escape:'htmlall':'UTF-8'}
          + {if $store.phone}{l s='Phone:' js=0} {$store.phone}{/if} +

          +
          + {/foreach} + {/if} +{else} + + +

          {l s='Enter a location (eg.: a zip/postal code, an address, a city or a country) in order to find the nearest stores.'}

          +

          {l s='Your location:'}

          +

          + {l s='Radius:'} + {$distance_unit} + + +

          +
          +
          + + + + + + + +
          {l s='#'}{l s='Store'}{l s='Address'}{l s='Distance'}
          +{/if} \ No newline at end of file diff --git a/themes/prestashop/supplier-list.tpl b/themes/prestashop/supplier-list.tpl new file mode 100644 index 000000000..5372389fc --- /dev/null +++ b/themes/prestashop/supplier-list.tpl @@ -0,0 +1,106 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Suppliers'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

          {l s='Suppliers'}

          + +{if isset($errors) AND $errors} + {include file="$tpl_dir./errors.tpl"} +{else} + +

          {strip} + + {if $nbSuppliers == 0}{l s='There are no suppliers.'} + {else} + {if $nbSuppliers == 1}{l s='There is'}{else}{l s='There are'}{/if}  + {$nbSuppliers}  + {if $nbSuppliers == 1}{l s='supplier.'}{else}{l s='suppliers.'}{/if} + {/if} + {/strip} +

          + +{if $nbSuppliers > 0} + + {include file="$tpl_dir./pagination.tpl"} +{/if} +{/if} diff --git a/themes/prestashop/supplier.tpl b/themes/prestashop/supplier.tpl new file mode 100644 index 000000000..a3ccf77bb --- /dev/null +++ b/themes/prestashop/supplier.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{include file="$tpl_dir./breadcrumb.tpl"} + +{include file="$tpl_dir./errors.tpl"} + +{if !isset($errors) OR !sizeof($errors)} +

          {l s='List of products by supplier:'} {$supplier->name|escape:'htmlall':'UTF-8'}

          + + {if $products} + {include file="$tpl_dir./product-sort.tpl"} + {include file="$tpl_dir./product-list.tpl" products=$products} + {include file="$tpl_dir./pagination.tpl"} + {else} +

          {l s='No products for this supplier.'}

          + {/if} +{/if} \ No newline at end of file diff --git a/tools/.htaccess b/tools/.htaccess new file mode 100755 index 000000000..93169e4eb --- /dev/null +++ b/tools/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/tools/fpdf/font/courier.php b/tools/fpdf/font/courier.php new file mode 100644 index 000000000..4c009f39b --- /dev/null +++ b/tools/fpdf/font/courier.php @@ -0,0 +1,7 @@ + diff --git a/tools/fpdf/font/helvetica.php b/tools/fpdf/font/helvetica.php new file mode 100644 index 000000000..8fa7683e7 --- /dev/null +++ b/tools/fpdf/font/helvetica.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/tools/fpdf/font/helveticab.php b/tools/fpdf/font/helveticab.php new file mode 100644 index 000000000..a8473c94d --- /dev/null +++ b/tools/fpdf/font/helveticab.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/tools/fpdf/font/helveticabi.php b/tools/fpdf/font/helveticabi.php new file mode 100644 index 000000000..41379537d --- /dev/null +++ b/tools/fpdf/font/helveticabi.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/tools/fpdf/font/helveticai.php b/tools/fpdf/font/helveticai.php new file mode 100644 index 000000000..d5bb6e094 --- /dev/null +++ b/tools/fpdf/font/helveticai.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/tools/fpdf/font/index.php b/tools/fpdf/font/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/tools/fpdf/font/index.php @@ -0,0 +1,11 @@ +Error: encoding not found: '.$enc); + $cc2gn=array(); + foreach($a as $l) + { + if($l[0]=='!') + { + $e=preg_split('/[ \\t]+/',rtrim($l)); + $cc=hexdec(substr($e[0],1)); + $gn=$e[2]; + $cc2gn[$cc]=$gn; + } + } + for($i=0;$i<=255;$i++) + { + if(!isset($cc2gn[$i])) + $cc2gn[$i]='.notdef'; + } + return $cc2gn; +} + +function ReadAFM($file, &$map) +{ + //Read a font metric file + $a=file($file); + if(empty($a)) + die('File not found'); + $widths=array(); + $fm=array(); + $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent', + 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut', + 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent', + 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent', + 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent', + 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat', + 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb', + 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong'); + foreach($a as $l) + { + $e=explode(' ',rtrim($l)); + if(count($e)<2) + continue; + $code=$e[0]; + $param=$e[1]; + if($code=='C') + { + //Character metrics + $cc=(int)$e[1]; + $w=$e[4]; + $gn=$e[7]; + if(substr($gn,-4)=='20AC') + $gn='Euro'; + if(isset($fix[$gn])) + { + //Fix incorrect glyph name + foreach($map as $c=>$n) + { + if($n==$fix[$gn]) + $map[$c]=$gn; + } + } + if(empty($map)) + { + //Symbolic font: use built-in encoding + $widths[$cc]=$w; + } + else + { + $widths[$gn]=$w; + if($gn=='X') + $fm['CapXHeight']=$e[13]; + } + if($gn=='.notdef') + $fm['MissingWidth']=$w; + } + elseif($code=='FontName') + $fm['FontName']=$param; + elseif($code=='Weight') + $fm['Weight']=$param; + elseif($code=='ItalicAngle') + $fm['ItalicAngle']=(double)$param; + elseif($code=='Ascender') + $fm['Ascender']=(int)$param; + elseif($code=='Descender') + $fm['Descender']=(int)$param; + elseif($code=='UnderlineThickness') + $fm['UnderlineThickness']=(int)$param; + elseif($code=='UnderlinePosition') + $fm['UnderlinePosition']=(int)$param; + elseif($code=='IsFixedPitch') + $fm['IsFixedPitch']=($param=='true'); + elseif($code=='FontBBox') + $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]); + elseif($code=='CapHeight') + $fm['CapHeight']=(int)$param; + elseif($code=='StdVW') + $fm['StdVW']=(int)$param; + } + if(!isset($fm['FontName'])) + die('FontName not found'); + if(!empty($map)) + { + if(!isset($widths['.notdef'])) + $widths['.notdef']=600; + if(!isset($widths['Delta']) && isset($widths['increment'])) + $widths['Delta']=$widths['increment']; + //Order widths according to map + for($i=0;$i<=255;$i++) + { + if(!isset($widths[$map[$i]])) + { + echo 'Warning: character '.$map[$i].' is missing
          '; + $widths[$i]=$widths['.notdef']; + } + else + $widths[$i]=$widths[$map[$i]]; + } + } + $fm['Widths']=$widths; + return $fm; +} + +function MakeFontDescriptor($fm, $symbolic) +{ + //Ascent + $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000); + $fd="array('Ascent'=>".$asc; + //Descent + $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200); + $fd.=",'Descent'=>".$desc; + //CapHeight + if(isset($fm['CapHeight'])) + $ch=$fm['CapHeight']; + elseif(isset($fm['CapXHeight'])) + $ch=$fm['CapXHeight']; + else + $ch=$asc; + $fd.=",'CapHeight'=>".$ch; + //Flags + $flags=0; + if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch']) + $flags+=1<<0; + if($symbolic) + $flags+=1<<2; + if(!$symbolic) + $flags+=1<<5; + if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0) + $flags+=1<<6; + $fd.=",'Flags'=>".$flags; + //FontBBox + if(isset($fm['FontBBox'])) + $fbb=$fm['FontBBox']; + else + $fbb=array(0,$desc-100,1000,$asc+100); + $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; + //ItalicAngle + $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); + $fd.=",'ItalicAngle'=>".$ia; + //StemV + if(isset($fm['StdVW'])) + $stemv=$fm['StdVW']; + elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight'])) + $stemv=120; + else + $stemv=70; + $fd.=",'StemV'=>".$stemv; + //MissingWidth + if(isset($fm['MissingWidth'])) + $fd.=",'MissingWidth'=>".$fm['MissingWidth']; + $fd.=')'; + return $fd; +} + +function MakeWidthArray($fm) +{ + //Make character width array + $s="array(\n\t"; + $cw=$fm['Widths']; + for($i=0;$i<=255;$i++) + { + if(chr($i)=="'") + $s.="'\\''"; + elseif(chr($i)=="\\") + $s.="'\\\\'"; + elseif($i>=32 && $i<=126) + $s.="'".chr($i)."'"; + else + $s.="chr($i)"; + $s.='=>'.$fm['Widths'][$i]; + if($i<255) + $s.=','; + if(($i+1)%22==0) + $s.="\n\t"; + } + $s.=')'; + return $s; +} + +function MakeFontEncoding($map) +{ + //Build differences from reference encoding + $ref=ReadMap('cp1252'); + $s=''; + $last=0; + for($i=32;$i<=255;$i++) + { + if($map[$i]!=$ref[$i]) + { + if($i!=$last+1) + $s.=$i.' '; + $last=$i; + $s.='/'.$map[$i].' '; + } + } + return rtrim($s); +} + +function SaveToFile($file, $s, $mode) +{ + $f=fopen($file,'w'.$mode); + if(!$f) + die('Can\'t write to file '.$file); + fwrite($f,$s,strlen($s)); + fclose($f); +} + +function ReadShort($f) +{ + $a=unpack('n1n',fread($f,2)); + return $a['n']; +} + +function ReadLong($f) +{ + $a=unpack('N1N',fread($f,4)); + return $a['N']; +} + +function CheckTTF($file) +{ + //Check if font license allows embedding + $f=fopen($file,'rb'); + if(!$f) + die('Error: Can\'t open '.$file); + //Extract number of tables + fseek($f,4,SEEK_CUR); + $nb=ReadShort($f); + fseek($f,6,SEEK_CUR); + //Seek OS/2 table + $found=false; + for($i=0;$i<$nb;$i++) + { + if(fread($f,4)=='OS/2') + { + $found=true; + break; + } + fseek($f,12,SEEK_CUR); + } + if(!$found) + { + fclose($f); + return; + } + fseek($f,4,SEEK_CUR); + $offset=ReadLong($f); + fseek($f,$offset,SEEK_SET); + //Extract fsType flags + fseek($f,8,SEEK_CUR); + $fsType=ReadShort($f); + $rl=($fsType & 0x02)!=0; + $pp=($fsType & 0x04)!=0; + $e=($fsType & 0x08)!=0; + fclose($f); + if($rl && !$pp && !$e) + echo 'Warning: font license does not allow embedding'; +} + +/******************************************************************************* +* fontfile : chemin du fichier TTF (ou chane vide si pas d'incorporation) * +* afmfile : chemin du fichier AFM * +* enc : encodage (ou chane vide si la police est symbolique) * +* patch : patch optionnel pour l'encodage * +* type : type de la police si fontfile est vide * +*******************************************************************************/ +function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType') +{ + ini_set('auto_detect_line_endings','1'); + if($enc) + { + $map=ReadMap($enc); + foreach($patch as $cc=>$gn) + $map[$cc]=$gn; + } + else + $map=array(); + if(!file_exists($afmfile)) + die('Error: AFM file not found: '.$afmfile); + $fm=ReadAFM($afmfile,$map); + if($enc) + $diff=MakeFontEncoding($map); + else + $diff=''; + $fd=MakeFontDescriptor($fm,empty($map)); + //Find font type + if($fontfile) + { + $ext=strtolower(substr($fontfile,-3)); + if($ext=='ttf') + $type='TrueType'; + elseif($ext=='pfb') + $type='Type1'; + else + die('Error: unrecognized font file extension: '.$ext); + } + else + { + if($type!='TrueType' && $type!='Type1') + die('Error: incorrect font type: '.$type); + } + //Start generation + $s='Error: font file not found: '.$fontfile); + if($type=='TrueType') + CheckTTF($fontfile); + $f=fopen($fontfile,'rb'); + if(!$f) + die('Error: Can\'t open '.$fontfile); + $file=fread($f,filesize($fontfile)); + fclose($f); + if($type=='Type1') + { + //Find first two sections and discard third one + $header=(ord($file[0])==128); + if($header) + { + //Strip first binary header + $file=substr($file,6); + } + $pos=strpos($file,'eexec'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size1=$pos+6; + if($header && ord($file[$size1])==128) + { + //Strip second binary header + $file=substr($file,0,$size1).substr($file,$size1+6); + } + $pos=strpos($file,'00000000'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size2=$pos-$size1; + $file=substr($file,0,$size1+$size2); + } + if(function_exists('gzcompress')) + { + $cmp=$basename.'.z'; + SaveToFile($cmp,gzcompress($file),'b'); + $s.='$file=\''.$cmp."';\n"; + echo 'Font file compressed ('.$cmp.')
          '; + } + else + { + $s.='$file=\''.basename($fontfile)."';\n"; + echo 'Notice: font file could not be compressed (zlib extension not available)
          '; + } + if($type=='Type1') + { + $s.='$size1='.$size1.";\n"; + $s.='$size2='.$size2.";\n"; + } + else + $s.='$originalsize='.filesize($fontfile).";\n"; + } + else + { + //Not embedded font + $s.='$file='."'';\n"; + } + $s.="?>\n"; + SaveToFile($basename.'.php',$s,'t'); + echo 'Font definition file generated ('.$basename.'.php'.')
          '; +} +?> diff --git a/tools/fpdf/font/symbol.php b/tools/fpdf/font/symbol.php new file mode 100644 index 000000000..b556ed84c --- /dev/null +++ b/tools/fpdf/font/symbol.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0); +?> diff --git a/tools/fpdf/font/times.php b/tools/fpdf/font/times.php new file mode 100644 index 000000000..b9be1b21d --- /dev/null +++ b/tools/fpdf/font/times.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500); +?> diff --git a/tools/fpdf/font/timesb.php b/tools/fpdf/font/timesb.php new file mode 100644 index 000000000..c3eb9fa75 --- /dev/null +++ b/tools/fpdf/font/timesb.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/tools/fpdf/font/timesbi.php b/tools/fpdf/font/timesbi.php new file mode 100644 index 000000000..161f6302c --- /dev/null +++ b/tools/fpdf/font/timesbi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/tools/fpdf/font/timesi.php b/tools/fpdf/font/timesi.php new file mode 100644 index 000000000..de171fd19 --- /dev/null +++ b/tools/fpdf/font/timesi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/tools/fpdf/font/zapfdingbats.php b/tools/fpdf/font/zapfdingbats.php new file mode 100644 index 000000000..f2bdfd5c9 --- /dev/null +++ b/tools/fpdf/font/zapfdingbats.php @@ -0,0 +1,15 @@ +0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0); +?> diff --git a/tools/fpdf/fpdf.php b/tools/fpdf/fpdf.php new file mode 100644 index 000000000..76495eb64 --- /dev/null +++ b/tools/fpdf/fpdf.php @@ -0,0 +1,1729 @@ +_dochecks(); + //Initialization of properties + $this->page=0; + $this->n=2; + $this->buffer=''; + $this->pages=array(); + $this->PageSizes=array(); + $this->state=0; + $this->fonts=array(); + $this->FontFiles=array(); + $this->diffs=array(); + $this->images=array(); + $this->links=array(); + $this->InHeader=false; + $this->InFooter=false; + $this->lasth=0; + $this->FontFamily=''; + $this->FontStyle=''; + $this->FontSizePt=12; + $this->underline=false; + $this->DrawColor='0 G'; + $this->FillColor='0 g'; + $this->TextColor='0 g'; + $this->ColorFlag=false; + $this->ws=0; + //Standard fonts + $this->CoreFonts=array('courier'=>'Courier', 'courierB'=>'Courier-Bold', 'courierI'=>'Courier-Oblique', 'courierBI'=>'Courier-BoldOblique', + 'helvetica'=>'Helvetica', 'helveticaB'=>'Helvetica-Bold', 'helveticaI'=>'Helvetica-Oblique', 'helveticaBI'=>'Helvetica-BoldOblique', + 'times'=>'Times-Roman', 'timesB'=>'Times-Bold', 'timesI'=>'Times-Italic', 'timesBI'=>'Times-BoldItalic', + 'symbol'=>'Symbol', 'zapfdingbats'=>'ZapfDingbats'); + //Scale factor + if($unit=='pt') + $this->k=1; + elseif($unit=='mm') + $this->k=72/25.4; + elseif($unit=='cm') + $this->k=72/2.54; + elseif($unit=='in') + $this->k=72; + else + $this->Error('Incorrect unit: '.$unit); + //Page format + $this->PageFormats=array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28), + 'letter'=>array(612,792), 'legal'=>array(612,1008)); + if(is_string($format)) + $format=$this->_getpageformat($format); + $this->DefPageFormat=$format; + $this->CurPageFormat=$format; + //Page orientation + $orientation=strtolower($orientation); + if($orientation=='p' || $orientation=='portrait') + { + $this->DefOrientation='P'; + $this->w=$this->DefPageFormat[0]; + $this->h=$this->DefPageFormat[1]; + } + elseif($orientation=='l' || $orientation=='landscape') + { + $this->DefOrientation='L'; + $this->w=$this->DefPageFormat[1]; + $this->h=$this->DefPageFormat[0]; + } + else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation=$this->DefOrientation; + $this->wPt=$this->w*$this->k; + $this->hPt=$this->h*$this->k; + //Page margins (1 cm) + $margin=28.35/$this->k; + $this->SetMargins($margin,$margin); + //Interior cell margin (1 mm) + $this->cMargin=$margin/10; + //Line width (0.2 mm) + $this->LineWidth=.567/$this->k; + //Automatic page break + $this->SetAutoPageBreak(true,2*$margin); + //Full width display mode + $this->SetDisplayMode('fullwidth'); + //Enable compression + $this->SetCompression(true); + //Set default PDF version number + $this->PDFVersion='1.3'; +} + +function SetMargins($left, $top, $right=null) +{ + //Set left, top and right margins + $this->lMargin=$left; + $this->tMargin=$top; + if($right===null) + $right=$left; + $this->rMargin=$right; +} + +function SetLeftMargin($margin) +{ + //Set left margin + $this->lMargin=$margin; + if($this->page>0 && $this->x<$margin) + $this->x=$margin; +} + +function SetTopMargin($margin) +{ + //Set top margin + $this->tMargin=$margin; +} + +function SetRightMargin($margin) +{ + //Set right margin + $this->rMargin=$margin; +} + +function SetAutoPageBreak($auto, $margin=0) +{ + //Set auto page break mode and triggering margin + $this->AutoPageBreak=$auto; + $this->bMargin=$margin; + $this->PageBreakTrigger=$this->h-$margin; +} + +function SetDisplayMode($zoom, $layout='continuous') +{ + //Set display mode in viewer + if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) + $this->ZoomMode=$zoom; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') + $this->LayoutMode=$layout; + else + $this->Error('Incorrect layout display mode: '.$layout); +} + +function SetCompression($compress) +{ + //Set page compression + if(function_exists('gzcompress')) + $this->compress=$compress; + else + $this->compress=false; +} + +function SetTitle($title, $isUTF8=false) +{ + //Title of document + if($isUTF8) + $title=$this->_UTF8toUTF16($title); + $this->title=$title; +} + +function SetSubject($subject, $isUTF8=false) +{ + //Subject of document + if($isUTF8) + $subject=$this->_UTF8toUTF16($subject); + $this->subject=$subject; +} + +function SetAuthor($author, $isUTF8=false) +{ + //Author of document + if($isUTF8) + $author=$this->_UTF8toUTF16($author); + $this->author=$author; +} + +function SetKeywords($keywords, $isUTF8=false) +{ + //Keywords of document + if($isUTF8) + $keywords=$this->_UTF8toUTF16($keywords); + $this->keywords=$keywords; +} + +function SetCreator($creator, $isUTF8=false) +{ + //Creator of document + if($isUTF8) + $creator=$this->_UTF8toUTF16($creator); + $this->creator=$creator; +} + +function AliasNbPages($alias='{nb}') +{ + //Define an alias for total number of pages + $this->AliasNbPages=$alias; +} + +function Error($msg) +{ + //Fatal error + die('FPDF error: '.$msg); +} + +function Open() +{ + //Begin document + $this->state=1; +} + +function Close() +{ + //Terminate document + if($this->state==3) + return; + if($this->page==0) + $this->AddPage(); + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + //Close document + $this->_enddoc(); +} + +function AddPage($orientation='', $format='') +{ + //Start a new page + if($this->state==0) + $this->Open(); + $family=$this->FontFamily; + $style=$this->FontStyle.($this->underline ? 'U' : ''); + $size=$this->FontSizePt; + $lw=$this->LineWidth; + $dc=$this->DrawColor; + $fc=$this->FillColor; + $tc=$this->TextColor; + $cf=$this->ColorFlag; + if($this->page>0) + { + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + } + //Start new page + $this->_beginpage($orientation,$format); + //Set line cap style to square + $this->_out('2 J'); + //Set line width + $this->LineWidth=$lw; + $this->_out(sprintf('%.2F w',$lw*$this->k)); + //Set font + if($family) + $this->SetFont($family,$style,$size); + //Set colors + $this->DrawColor=$dc; + if($dc!='0 G') + $this->_out($dc); + $this->FillColor=$fc; + if($fc!='0 g') + $this->_out($fc); + $this->TextColor=$tc; + $this->ColorFlag=$cf; + //Page header + $this->InHeader=true; + $this->Header(); + $this->InHeader=false; + //Restore line width + if($this->LineWidth!=$lw) + { + $this->LineWidth=$lw; + $this->_out(sprintf('%.2F w',$lw*$this->k)); + } + //Restore font + if($family) + $this->SetFont($family,$style,$size); + //Restore colors + if($this->DrawColor!=$dc) + { + $this->DrawColor=$dc; + $this->_out($dc); + } + if($this->FillColor!=$fc) + { + $this->FillColor=$fc; + $this->_out($fc); + } + $this->TextColor=$tc; + $this->ColorFlag=$cf; +} + +function Header() +{ + //To be implemented in your own inherited class +} + +function Footer() +{ + //To be implemented in your own inherited class +} + +function PageNo() +{ + //Get current page number + return $this->page; +} + +function SetDrawColor($r, $g=null, $b=null) +{ + //Set color for all stroking operations + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->DrawColor=sprintf('%.3F G',$r/255); + else + $this->DrawColor=sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255); + if($this->page>0) + $this->_out($this->DrawColor); +} + +function SetFillColor($r, $g=null, $b=null) +{ + //Set color for all filling operations + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->FillColor=sprintf('%.3F g',$r/255); + else + $this->FillColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); + if($this->page>0) + $this->_out($this->FillColor); +} + +function SetTextColor($r, $g=null, $b=null) +{ + //Set color for text + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->TextColor=sprintf('%.3F g',$r/255); + else + $this->TextColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); +} + +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s=(string)$s; + $cw=&$this->CurrentFont['cw']; + $w=0; + $l=strlen($s); + for($i=0;$i<$l;$i++) + $w+=$cw[$s[$i]]; + return $w*$this->FontSize/1000; +} + +function SetLineWidth($width) +{ + //Set line width + $this->LineWidth=$width; + if($this->page>0) + $this->_out(sprintf('%.2F w',$width*$this->k)); +} + +function Line($x1, $y1, $x2, $y2) +{ + //Draw a line + $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); +} + +function Rect($x, $y, $w, $h, $style='') +{ + //Draw a rectangle + if($style=='F') + $op='f'; + elseif($style=='FD' || $style=='DF') + $op='B'; + else + $op='S'; + $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); +} + +function AddFont($family, $style='', $file='') +{ + //Add a TrueType or Type1 font + $family=strtolower($family); + if($file=='') + $file=str_replace(' ','',$family).strtolower($style).'.php'; + if($family=='arial') + $family='helvetica'; + $style=strtoupper($style); + if($style=='IB') + $style='BI'; + $fontkey=$family.$style; + if(isset($this->fonts[$fontkey])) + return; + include($this->_getfontpath().$file); + if(!isset($name)) + $this->Error('Could not include font definition file'); + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file); + if($diff) + { + //Search existing encodings + $d=0; + $nb=count($this->diffs); + for($i=1;$i<=$nb;$i++) + { + if($this->diffs[$i]==$diff) + { + $d=$i; + break; + } + } + if($d==0) + { + $d=$nb+1; + $this->diffs[$d]=$diff; + } + $this->fonts[$fontkey]['diff']=$d; + } + if($file) + { + if($type=='TrueType') + $this->FontFiles[$file]=array('length1'=>$originalsize); + else + $this->FontFiles[$file]=array('length1'=>$size1, 'length2'=>$size2); + } +} + +function SetFont($family, $style='', $size=0) +{ + //Select a font; size given in points + global $fpdf_charwidths; + + $family=strtolower($family); + if($family=='') + $family=$this->FontFamily; + if($family=='arial') + $family='helvetica'; + elseif($family=='symbol' || $family=='zapfdingbats') + $style=''; + $style=strtoupper($style); + if(strpos($style,'U')!==false) + { + $this->underline=true; + $style=str_replace('U','',$style); + } + else + $this->underline=false; + if($style=='IB') + $style='BI'; + if($size==0) + $size=$this->FontSizePt; + //Test if font is already selected + if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) + return; + //Test if used for the first time + $fontkey=$family.$style; + if(!isset($this->fonts[$fontkey])) + { + //Check if one of the standard fonts + if(isset($this->CoreFonts[$fontkey])) + { + if(!isset($fpdf_charwidths[$fontkey])) + { + //Load metric file + $file=$family; + if($family=='times' || $family=='helvetica') + $file.=strtolower($style); + include($this->_getfontpath().$file.'.php'); + if(!isset($fpdf_charwidths[$fontkey])) + $this->Error('Could not include font metric file'); + } + $i=count($this->fonts)+1; + $name=$this->CoreFonts[$fontkey]; + $cw=$fpdf_charwidths[$fontkey]; + $this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw); + } + else + $this->Error('Undefined font: '.$family.' '.$style); + } + //Select it + $this->FontFamily=$family; + $this->FontStyle=$style; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + $this->CurrentFont=&$this->fonts[$fontkey]; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function SetFontSize($size) +{ + //Set font size in points + if($this->FontSizePt==$size) + return; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function AddLink() +{ + //Create a new internal link + $n=count($this->links)+1; + $this->links[$n]=array(0, 0); + return $n; +} + +function SetLink($link, $y=0, $page=-1) +{ + //Set destination of internal link + if($y==-1) + $y=$this->y; + if($page==-1) + $page=$this->page; + $this->links[$link]=array($page, $y); +} + +function Link($x, $y, $w, $h, $link) +{ + //Put a link on the page + $this->PageLinks[$this->page][]=array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link); +} + +function Text($x, $y, $txt) +{ + //Output a string + $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); + if($this->underline && $txt!='') + $s.=' '.$this->_dounderline($x,$y,$txt); + if($this->ColorFlag) + $s='q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + //Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') +{ + //Output a cell + $k=$this->k; + if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) + { + //Automatic page break + $x=$this->x; + $ws=$this->ws; + if($ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation,$this->CurPageFormat); + $this->x=$x; + if($ws>0) + { + $this->ws=$ws; + $this->_out(sprintf('%.3F Tw',$ws*$k)); + } + } + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $s=''; + if($fill || $border==1) + { + if($fill) + $op=($border==1) ? 'B' : 'f'; + else + $op='S'; + $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x=$this->x; + $y=$this->y; + if(strpos($border,'L')!==false) + $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(strpos($border,'T')!==false) + $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(strpos($border,'R')!==false) + $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(strpos($border,'B')!==false) + $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!=='') + { + if($align=='R') + $dx=$w-$this->cMargin-$this->GetStringWidth($txt); + elseif($align=='C') + $dx=($w-$this->GetStringWidth($txt))/2; + else + $dx=$this->cMargin; + if($this->ColorFlag) + $s.='q '.$this->TextColor.' '; + $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); + $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2); + if($this->underline) + $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); + if($this->ColorFlag) + $s.=' Q'; + if($link) + $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); + } + if($s) + $this->_out($s); + $this->lasth=$h; + if($ln>0) + { + //Go to next line + $this->y+=$h; + if($ln==1) + $this->x=$this->lMargin; + } + else + $this->x+=$w; +} + +function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false) +{ + //Output text with automatic or explicit line breaks + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 && $s[$nb-1]=="\n") + $nb--; + $b=0; + if($border) + { + if($border==1) + { + $border='LTRB'; + $b='LRT'; + $b2='LR'; + } + else + { + $b2=''; + if(strpos($border,'L')!==false) + $b2.='L'; + if(strpos($border,'R')!==false) + $b2.='R'; + $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2; + } + } + $sep=-1; + $i=0; + $j=0; + $l=0; + $ns=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s[$i]; + if($c=="\n") + { + //Explicit line break + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $i++; + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + continue; + } + if($c==' ') + { + $sep=$i; + $ls=$l; + $ns++; + } + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($i==$j) + $i++; + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + else + { + if($align=='J') + { + $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; + $this->_out(sprintf('%.3F Tw',$this->ws*$this->k)); + } + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border && $nl==2) + $b=$b2; + } + else + $i++; + } + //Last chunk + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + if($border && strpos($border,'B')!==false) + $b.='B'; + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $this->x=$this->lMargin; +} + +function Write($h, $txt, $link='') +{ + //Output text in flowing mode + $cw=&$this->CurrentFont['cw']; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s[$i]; + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + $i++; + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + continue; + } + if($c==' ') + $sep=$i; + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($this->x>$this->lMargin) + { + //Move to next line + $this->x=$this->lMargin; + $this->y+=$h; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $i++; + $nl++; + continue; + } + if($i==$j) + $i++; + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + } + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + } + else + $i++; + } + //Last chunk + if($i!=$j) + $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link); +} + +function Ln($h=null) +{ + //Line feed; default value is last cell height + $this->x=$this->lMargin; + if($h===null) + $this->y+=$this->lasth; + else + $this->y+=$h; +} + +function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='') +{ + //Put an image on the page + if(!isset($this->images[$file])) + { + //First use of this image, get info + if($type=='') + { + $pos=strrpos($file,'.'); + if(!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type=substr($file,$pos+1); + } + $type=strtolower($type); + if($type=='jpeg') + $type='jpg'; + $mtd='_parse'.$type; + if(!method_exists($this,$mtd)) + $this->Error('Unsupported image type: '.$type); + $info=$this->$mtd($file); + $info['i']=count($this->images)+1; + $this->images[$file]=$info; + } + else + $info=$this->images[$file]; + //Automatic width and height calculation if needed + if($w==0 && $h==0) + { + //Put image at 72 dpi + $w=$info['w']/$this->k; + $h=$info['h']/$this->k; + } + elseif($w==0) + $w=$h*$info['w']/$info['h']; + elseif($h==0) + $h=$w*$info['h']/$info['w']; + //Flowing mode + if($y===null) + { + if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) + { + //Automatic page break + $x2=$this->x; + $this->AddPage($this->CurOrientation,$this->CurPageFormat); + $this->x=$x2; + } + $y=$this->y; + $this->y+=$h; + } + if($x===null) + $x=$this->x; + $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); + if($link) + $this->Link($x,$y,$w,$h,$link); +} + +function GetX() +{ + //Get x position + return $this->x; +} + +function SetX($x) +{ + //Set x position + if($x>=0) + $this->x=$x; + else + $this->x=$this->w+$x; +} + +function GetY() +{ + //Get y position + return $this->y; +} + +function SetY($y) +{ + //Set y position and reset x + $this->x=$this->lMargin; + if($y>=0) + $this->y=$y; + else + $this->y=$this->h+$y; +} + +function SetXY($x, $y) +{ + //Set x and y positions + $this->SetY($y); + $this->SetX($x); +} + +function Output($name='', $dest='') +{ + //Output PDF to some destination + if($this->state<3) + $this->Close(); + $dest=strtoupper($dest); + if($dest=='') + { + if($name=='') + { + $name='doc.pdf'; + $dest='I'; + } + else + $dest='F'; + } + switch($dest) + { + case 'I': + //Send to standard output + if(ob_get_length()) + $this->Error('Some data has already been output, can\'t send PDF file'); + if(php_sapi_name()!='cli') + { + //We send to a browser + header('Content-Type: application/pdf'); + if(headers_sent()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-Disposition: inline; filename="'.$name.'"'); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + ini_set('zlib.output_compression','0'); + } + echo $this->buffer; + break; + case 'D': + //Download file + if(ob_get_length()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Type: application/x-download'); + if(headers_sent()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-Disposition: attachment; filename="'.$name.'"'); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + ini_set('zlib.output_compression','0'); + echo $this->buffer; + break; + case 'F': + //Save to local file + $f=fopen($name,'wb'); + if(!$f) + $this->Error('Unable to create output file: '.$name); + fwrite($f,$this->buffer,strlen($this->buffer)); + fclose($f); + break; + case 'S': + //Return as a string + return $this->buffer; + default: + $this->Error('Incorrect output destination: '.$dest); + } + return ''; +} + +/******************************************************************************* +* * +* Protected methods * +* * +*******************************************************************************/ +function _dochecks() +{ + //Check availability of %F + if(sprintf('%.1F',1.0)!='1.0') + $this->Error('This version of PHP is not supported'); + //Check mbstring overloading + if(ini_get('mbstring.func_overload') & 2) + $this->Error('mbstring overloading must be disabled'); +} + +function _getpageformat($format) +{ + $format=strtolower($format); + if(!isset($this->PageFormats[$format])) + $this->Error('Unknown page format: '.$format); + $a=$this->PageFormats[$format]; + return array($a[0]/$this->k, $a[1]/$this->k); +} + +function _getfontpath() +{ + if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) + define('FPDF_FONTPATH',dirname(__FILE__).'/font/'); + return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; +} + +function _beginpage($orientation, $format) +{ + $this->page++; + $this->pages[$this->page]=''; + $this->state=2; + $this->x=$this->lMargin; + $this->y=$this->tMargin; + $this->FontFamily=''; + //Check page size + if($orientation=='') + $orientation=$this->DefOrientation; + else + $orientation=strtoupper($orientation[0]); + if($format=='') + $format=$this->DefPageFormat; + else + { + if(is_string($format)) + $format=$this->_getpageformat($format); + } + if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1]) + { + //New size + if($orientation=='P') + { + $this->w=$format[0]; + $this->h=$format[1]; + } + else + { + $this->w=$format[1]; + $this->h=$format[0]; + } + $this->wPt=$this->w*$this->k; + $this->hPt=$this->h*$this->k; + $this->PageBreakTrigger=$this->h-$this->bMargin; + $this->CurOrientation=$orientation; + $this->CurPageFormat=$format; + } + if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1]) + $this->PageSizes[$this->page]=array($this->wPt, $this->hPt); +} + +function _endpage() +{ + $this->state=1; +} + +function _escape($s) +{ + //Escape special characters in strings + $s=str_replace('\\','\\\\',$s); + $s=str_replace('(','\\(',$s); + $s=str_replace(')','\\)',$s); + $s=str_replace("\r",'\\r',$s); + return $s; +} + +function _textstring($s) +{ + //Format a text string + return '('.$this->_escape($s).')'; +} + +function _UTF8toUTF16($s) +{ + //Convert UTF-8 to UTF-16BE with BOM + $res="\xFE\xFF"; + $nb=strlen($s); + $i=0; + while($i<$nb) + { + $c1=ord($s[$i++]); + if($c1>=224) + { + //3-byte character + $c2=ord($s[$i++]); + $c3=ord($s[$i++]); + $res.=chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); + $res.=chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); + } + elseif($c1>=192) + { + //2-byte character + $c2=ord($s[$i++]); + $res.=chr(($c1 & 0x1C)>>2); + $res.=chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); + } + else + { + //Single-byte character + $res.="\0".chr($c1); + } + } + return $res; +} + +function _dounderline($x, $y, $txt) +{ + //Underline text + $up=$this->CurrentFont['up']; + $ut=$this->CurrentFont['ut']; + $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); + return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +function _parsejpg($file) +{ + //Extract info from a JPEG file + $a=GetImageSize($file); + if(!$a) + $this->Error('Missing or incorrect image file: '.$file); + if($a[2]!=2) + $this->Error('Not a JPEG file: '.$file); + if(!isset($a['channels']) || $a['channels']==3) + $colspace='DeviceRGB'; + elseif($a['channels']==4) + $colspace='DeviceCMYK'; + else + $colspace='DeviceGray'; + $bpc=isset($a['bits']) ? $a['bits'] : 8; + //Read whole file + $f=fopen($file,'rb'); + $data=''; + while(!feof($f)) + $data.=fread($f,8192); + fclose($f); + return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data); +} + +function _parsepng($file) +{ + //Extract info from a PNG file + $f=fopen($file,'rb'); + if(!$f) + $this->Error('Can\'t open image file: '.$file); + //Check signature + if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + //Read header chunk + $this->_readstream($f,4); + if($this->_readstream($f,4)!='IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w=$this->_readint($f); + $h=$this->_readint($f); + $bpc=ord($this->_readstream($f,1)); + if($bpc>8) + $this->Error('16-bit depth not supported: '.$file); + $ct=ord($this->_readstream($f,1)); + if($ct==0) + $colspace='DeviceGray'; + elseif($ct==2) + $colspace='DeviceRGB'; + elseif($ct==3) + $colspace='Indexed'; + else + $this->Error('Alpha channel not supported: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Unknown compression method: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Unknown filter method: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Interlacing not supported: '.$file); + $this->_readstream($f,4); + $parms='/DecodeParms <>'; + //Scan chunks looking for palette, transparency and image data + $pal=''; + $trns=''; + $data=''; + do + { + $n=$this->_readint($f); + $type=$this->_readstream($f,4); + if($type=='PLTE') + { + //Read palette + $pal=$this->_readstream($f,$n); + $this->_readstream($f,4); + } + elseif($type=='tRNS') + { + //Read transparency info + $t=$this->_readstream($f,$n); + if($ct==0) + $trns=array(ord(substr($t,1,1))); + elseif($ct==2) + $trns=array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1))); + else + { + $pos=strpos($t,chr(0)); + if($pos!==false) + $trns=array($pos); + } + $this->_readstream($f,4); + } + elseif($type=='IDAT') + { + //Read image data block + $data.=$this->_readstream($f,$n); + $this->_readstream($f,4); + } + elseif($type=='IEND') + break; + else + $this->_readstream($f,$n+4); + } + while($n); + if($colspace=='Indexed' && empty($pal)) + $this->Error('Missing palette in '.$file); + fclose($f); + return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data); +} + +function _readstream($f, $n) +{ + //Read n bytes from stream + $res=''; + while($n>0 && !feof($f)) + { + $s=fread($f,$n); + if($s===false) + $this->Error('Error while reading stream'); + $n-=strlen($s); + $res.=$s; + } + if($n>0) + $this->Error('Unexpected end of stream'); + return $res; +} + +function _readint($f) +{ + //Read a 4-byte integer from stream + $a=unpack('Ni',$this->_readstream($f,4)); + return $a['i']; +} + +function _parsegif($file) +{ + //Extract info from a GIF file (via PNG conversion) + if(!function_exists('imagepng')) + $this->Error('GD extension is required for GIF support'); + if(!function_exists('imagecreatefromgif')) + $this->Error('GD has no GIF read support'); + $im=imagecreatefromgif($file); + if(!$im) + $this->Error('Missing or incorrect image file: '.$file); + imageinterlace($im,0); + $tmp=tempnam('.','gif'); + if(!$tmp) + $this->Error('Unable to create a temporary file'); + if(!imagepng($im,$tmp)) + $this->Error('Error while saving to temporary file'); + imagedestroy($im); + $info=$this->_parsepng($tmp); + unlink($tmp); + return $info; +} + +function _newobj() +{ + //Begin a new object + $this->n++; + $this->offsets[$this->n]=strlen($this->buffer); + $this->_out($this->n.' 0 obj'); +} + +function _putstream($s) +{ + $this->_out('stream'); + $this->_out($s); + $this->_out('endstream'); +} + +function _out($s) +{ + //Add a line to the document + if($this->state==2) + $this->pages[$this->page].=$s."\n"; + else + $this->buffer.=$s."\n"; +} + +function _putpages() +{ + $nb=$this->page; + if(!empty($this->AliasNbPages)) + { + //Replace number of pages + for($n=1;$n<=$nb;$n++) + $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]); + } + if($this->DefOrientation=='P') + { + $wPt=$this->DefPageFormat[0]*$this->k; + $hPt=$this->DefPageFormat[1]*$this->k; + } + else + { + $wPt=$this->DefPageFormat[1]*$this->k; + $hPt=$this->DefPageFormat[0]*$this->k; + } + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + for($n=1;$n<=$nb;$n++) + { + //Page + $this->_newobj(); + $this->_out('<_out('/Parent 1 0 R'); + if(isset($this->PageSizes[$n])) + $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1])); + $this->_out('/Resources 2 0 R'); + if(isset($this->PageLinks[$n])) + { + //Links + $annots='/Annots ['; + foreach($this->PageLinks[$n] as $pl) + { + $rect=sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); + $annots.='<_textstring($pl[4]).'>>>>'; + else + { + $l=$this->links[$pl[4]]; + $h=isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt; + $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k); + } + } + $this->_out($annots.']'); + } + $this->_out('/Contents '.($this->n+1).' 0 R>>'); + $this->_out('endobj'); + //Page content + $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; + $this->_newobj(); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); + $this->_putstream($p); + $this->_out('endobj'); + } + //Pages root + $this->offsets[1]=strlen($this->buffer); + $this->_out('1 0 obj'); + $this->_out('<_out($kids.']'); + $this->_out('/Count '.$nb); + $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt)); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putfonts() +{ + $nf=$this->n; + foreach($this->diffs as $diff) + { + //Encodings + $this->_newobj(); + $this->_out('<>'); + $this->_out('endobj'); + } + foreach($this->FontFiles as $file=>$info) + { + //Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n']=$this->n; + $font=''; + $f=fopen($this->_getfontpath().$file,'rb',1); + if(!$f) + $this->Error('Font file not found'); + while(!feof($f)) + $font.=fread($f,8192); + fclose($f); + $compressed=(substr($file,-2)=='.z'); + if(!$compressed && isset($info['length2'])) + { + $header=(ord($font[0])==128); + if($header) + { + //Strip first binary header + $font=substr($font,6); + } + if($header && ord($font[$info['length1']])==128) + { + //Strip second binary header + $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6); + } + } + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $this->_putstream($font); + $this->_out('endobj'); + } + foreach($this->fonts as $k=>$font) + { + //Font objects + $this->fonts[$k]['n']=$this->n+1; + $type=$font['type']; + $name=$font['name']; + if($type=='core') + { + //Standard font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /Type1'); + if($name!='Symbol' && $name!='ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + $this->_out('>>'); + $this->_out('endobj'); + } + elseif($type=='Type1' || $type=='TrueType') + { + //Additional Type1 or TrueType font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /'.$type); + $this->_out('/FirstChar 32 /LastChar 255'); + $this->_out('/Widths '.($this->n+1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); + if($font['enc']) + { + if(isset($font['diff'])) + $this->_out('/Encoding '.($nf+$font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + $this->_out('>>'); + $this->_out('endobj'); + //Widths + $this->_newobj(); + $cw=&$font['cw']; + $s='['; + for($i=32;$i<=255;$i++) + $s.=$cw[chr($i)].' '; + $this->_out($s.']'); + $this->_out('endobj'); + //Descriptor + $this->_newobj(); + $s='<$v) + $s.=' /'.$k.' '.$v; + $file=$font['file']; + if($file) + $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); + } + else + { + //Allow for additional types + $mtd='_put'.strtolower($type); + if(!method_exists($this,$mtd)) + $this->Error('Unsupported font type: '.$type); + $this->$mtd($font); + } + } +} + +function _putimages() +{ + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->images); + while(list($file,$info)=each($this->images)) + { + $this->_newobj(); + $this->images[$file]['n']=$this->n; + $this->_out('<_out('/Subtype /Image'); + $this->_out('/Width '.$info['w']); + $this->_out('/Height '.$info['h']); + if($info['cs']=='Indexed') + $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + else + { + $this->_out('/ColorSpace /'.$info['cs']); + if($info['cs']=='DeviceCMYK') + $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_out('/BitsPerComponent '.$info['bpc']); + if(isset($info['f'])) + $this->_out('/Filter /'.$info['f']); + if(isset($info['parms'])) + $this->_out($info['parms']); + if(isset($info['trns']) && is_array($info['trns'])) + { + $trns=''; + for($i=0;$i_out('/Mask ['.$trns.']'); + } + $this->_out('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + unset($this->images[$file]['data']); + $this->_out('endobj'); + //Palette + if($info['cs']=='Indexed') + { + $this->_newobj(); + $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + $this->_putstream($pal); + $this->_out('endobj'); + } + } +} + +function _putxobjectdict() +{ + foreach($this->images as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); +} + +function _putresourcedict() +{ + $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + $this->_out('/Font <<'); + foreach($this->fonts as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + $this->_out('/XObject <<'); + $this->_putxobjectdict(); + $this->_out('>>'); +} + +function _putresources() +{ + $this->_putfonts(); + $this->_putimages(); + //Resource dictionary + $this->offsets[2]=strlen($this->buffer); + $this->_out('2 0 obj'); + $this->_out('<<'); + $this->_putresourcedict(); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putinfo() +{ + $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION)); + if(!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if(!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if(!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if(!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if(!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis'))); +} + +function _putcatalog() +{ + $this->_out('/Type /Catalog'); + $this->_out('/Pages 1 0 R'); + if($this->ZoomMode=='fullpage') + $this->_out('/OpenAction [3 0 R /Fit]'); + elseif($this->ZoomMode=='fullwidth') + $this->_out('/OpenAction [3 0 R /FitH null]'); + elseif($this->ZoomMode=='real') + $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); + elseif(!is_string($this->ZoomMode)) + $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']'); + if($this->LayoutMode=='single') + $this->_out('/PageLayout /SinglePage'); + elseif($this->LayoutMode=='continuous') + $this->_out('/PageLayout /OneColumn'); + elseif($this->LayoutMode=='two') + $this->_out('/PageLayout /TwoColumnLeft'); +} + +function _putheader() +{ + $this->_out('%PDF-'.$this->PDFVersion); +} + +function _puttrailer() +{ + $this->_out('/Size '.($this->n+1)); + $this->_out('/Root '.$this->n.' 0 R'); + $this->_out('/Info '.($this->n-1).' 0 R'); +} + +function _enddoc() +{ + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + //Info + $this->_newobj(); + $this->_out('<<'); + $this->_putinfo(); + $this->_out('>>'); + $this->_out('endobj'); + //Catalog + $this->_newobj(); + $this->_out('<<'); + $this->_putcatalog(); + $this->_out('>>'); + $this->_out('endobj'); + //Cross-ref + $o=strlen($this->buffer); + $this->_out('xref'); + $this->_out('0 '.($this->n+1)); + $this->_out('0000000000 65535 f '); + for($i=1;$i<=$this->n;$i++) + $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); + //Trailer + $this->_out('trailer'); + $this->_out('<<'); + $this->_puttrailer(); + $this->_out('>>'); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state=3; +} +//End of class +} + +//Handle special IE contype request +if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype') +{ + header('Content-Type: application/pdf'); + exit; +} + +?> diff --git a/tools/fpdf/index.php b/tools/fpdf/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/tools/fpdf/index.php @@ -0,0 +1,11 @@ + 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5, +"AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "AN" => 10, "AO" => 11, +"AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17, +"AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23, +"BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29, +"BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35, +"BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41, +"CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47, +"CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53, +"CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59, +"DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65, +"ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71, +"FM" => 72, "FO" => 73, "FR" => 74, "FX" => 75, "GA" => 76, "GB" => 77, +"GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83, +"GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89, +"GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95, +"HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101, +"IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107, +"IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113, +"KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119, +"KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125, +"LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131, +"LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137, +"MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143, +"MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149, +"MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155, +"NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161, +"NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167, +"PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173, +"PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179, +"PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185, +"RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191, +"SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197, +"SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203, +"SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209, +"TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215, +"TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221, +"UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227, +"VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233, +"VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239, +"ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245, +"O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251, +"MF" => 252 +); + var $GEOIP_COUNTRY_CODES = array( +"", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", +"AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", +"BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", +"CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", +"CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", +"EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", +"GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", +"GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", +"IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", +"KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", +"LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", +"MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", +"NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", +"PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", +"QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", +"SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", +"TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW", +"TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", +"VU", "WF", "WS", "YE", "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1", +"AX", "GG", "IM", "JE", "BL", "MF" +); + var $GEOIP_COUNTRY_CODES3 = array( +"","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","ATA","ARG", +"ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI", +"BEN","BMU","BRN","BOL","BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK", +"COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV", +"CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH", +"ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD", +"GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM","GUM", +"GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IOT", +"IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA", +"PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU", +"LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC", +"MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL", +"NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER", +"PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT", +"REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM", +"SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","ATF", +"TGO","THA","TJK","TKL","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA", +"UKR","UGA","UMI","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT", +"WLF","WSM","YEM","MYT","SRB","ZAF","ZMB","MNE","ZWE","A1","A2","O1", +"ALA","GGY","IMN","JEY","BLM","MAF" + ); + var $GEOIP_COUNTRY_NAMES = array( +"", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", +"Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", +"Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa", +"Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", +"Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", +"Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", +"Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", +"Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", +"Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands", +"Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde", +"Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", +"Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", +"Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", +"Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", +"France", "France, Metropolitan", "Gabon", "United Kingdom", +"Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", +"Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", +"Guatemala", "Guam", "Guinea-Bissau", +"Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", +"Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", +"British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", +"Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", +"Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of", +"Korea, Republic of", "Kuwait", "Cayman Islands", +"Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", +"Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", +"Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", "Moldova, Republic of", +"Madagascar", "Marshall Islands", "Macedonia", +"Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", +"Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", +"Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", +"Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", +"Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", +"Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", +"Pitcairn Islands", "Puerto Rico", "Palestinian Territory", +"Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", +"Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", +"Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", +"Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", +"Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab Republic", +"Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", +"Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan", +"Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", +"Taiwan", "Tanzania, United Republic of", "Ukraine", +"Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", +"Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", +"Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", +"Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", +"Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe", +"Anonymous Proxy","Satellite Provider","Other", +"Aland Islands","Guernsey","Isle of Man","Jersey","Saint Barthelemy","Saint Martin" +); + + var $GEOIP_CONTINENT_CODES = array( + "--", "AS", "EU", "EU", "AS", "AS", "NA", "NA", "EU", "AS", + "NA", "AF", "AN", "SA", "OC", "EU", "OC", "NA", "AS", "EU", + "NA", "AS", "EU", "AF", "EU", "AS", "AF", "AF", "NA", "AS", + "SA", "SA", "NA", "AS", "AN", "AF", "EU", "NA", "NA", "AS", + "AF", "AF", "AF", "EU", "AF", "OC", "SA", "AF", "AS", "SA", + "NA", "NA", "AF", "AS", "AS", "EU", "EU", "AF", "EU", "NA", + "NA", "AF", "SA", "EU", "AF", "AF", "AF", "EU", "AF", "EU", + "OC", "SA", "OC", "EU", "EU", "EU", "AF", "EU", "NA", "AS", + "SA", "AF", "EU", "NA", "AF", "AF", "NA", "AF", "EU", "AN", + "NA", "OC", "AF", "SA", "AS", "AN", "NA", "EU", "NA", "EU", + "AS", "EU", "AS", "AS", "AS", "AS", "AS", "EU", "EU", "NA", + "AS", "AS", "AF", "AS", "AS", "OC", "AF", "NA", "AS", "AS", + "AS", "NA", "AS", "AS", "AS", "NA", "EU", "AS", "AF", "AF", + "EU", "EU", "EU", "AF", "AF", "EU", "EU", "AF", "OC", "EU", + "AF", "AS", "AS", "AS", "OC", "NA", "AF", "NA", "EU", "AF", + "AS", "AF", "NA", "AS", "AF", "AF", "OC", "AF", "OC", "AF", + "NA", "EU", "EU", "AS", "OC", "OC", "OC", "AS", "NA", "SA", + "OC", "OC", "AS", "AS", "EU", "NA", "OC", "NA", "AS", "EU", + "OC", "SA", "AS", "AF", "EU", "EU", "AF", "AS", "OC", "AF", + "AF", "EU", "AS", "AF", "EU", "EU", "EU", "AF", "EU", "AF", + "AF", "SA", "AF", "NA", "AS", "AF", "NA", "AF", "AN", "AF", + "AS", "AS", "OC", "AS", "AF", "OC", "AS", "EU", "NA", "OC", + "AS", "AF", "EU", "AF", "OC", "NA", "SA", "AS", "EU", "NA", + "SA", "NA", "NA", "AS", "OC", "OC", "OC", "AS", "AF", "EU", + "AF", "AF", "EU", "AF", "--", "--", "--", "EU", "EU", "EU", + "EU", "NA", "NA" +); + +} +function geoip_load_shared_mem ($file) { + + $fp = fopen($file, "rb"); + if (!$fp) { + print "error opening $file: $php_errormsg\n"; + exit; + } + $s_array = fstat($fp); + $size = $s_array['size']; + if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) { + shmop_delete ($shmid); + shmop_close ($shmid); + } + $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size); + shmop_write ($shmid, fread($fp, $size), 0); + shmop_close ($shmid); +} + +function _setup_segments($gi){ + $gi->databaseType = GEOIP_COUNTRY_EDITION; + $gi->record_length = STANDARD_RECORD_LENGTH; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $offset = @shmop_size ($gi->shmid) - 3; + for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) { + $delim = @shmop_read ($gi->shmid, $offset, 3); + $offset += 3; + if ($delim == (chr(255).chr(255).chr(255))) { + $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1)); + $offset++; + + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0; + } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1; + } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)|| + ($gi->databaseType == GEOIP_CITY_EDITION_REV1) + || ($gi->databaseType == GEOIP_ORG_EDITION) + || ($gi->databaseType == GEOIP_DOMAIN_EDITION) + || ($gi->databaseType == GEOIP_ISP_EDITION) + || ($gi->databaseType == GEOIP_LOCATIONA_EDITION) + || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION) + || ($gi->databaseType == GEOIP_ASNUM_EDITION)){ + $gi->databaseSegments = 0; + $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH); + for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){ + $gi->databaseSegments += (ord($buf[$j]) << ($j * 8)); + } + if (($gi->databaseType == GEOIP_ORG_EDITION) + || ($gi->databaseType == GEOIP_DOMAIN_EDITION) + || ($gi->databaseType == GEOIP_ISP_EDITION)) { + $gi->record_length = ORG_RECORD_LENGTH; + } + } + break; + } else { + $offset -= 4; + } + } + if (($gi->databaseType == GEOIP_COUNTRY_EDITION)|| + ($gi->databaseType == GEOIP_PROXY_EDITION)|| + ($gi->databaseType == GEOIP_NETSPEED_EDITION)){ + $gi->databaseSegments = GEOIP_COUNTRY_BEGIN; + } + } else { + $filepos = ftell($gi->filehandle); + fseek($gi->filehandle, -3, SEEK_END); + for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) { + $delim = fread($gi->filehandle,3); + if ($delim == (chr(255).chr(255).chr(255))){ + $gi->databaseType = ord(fread($gi->filehandle,1)); + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0; + } + else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1; + } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0) + || ($gi->databaseType == GEOIP_CITY_EDITION_REV1) + || ($gi->databaseType == GEOIP_ORG_EDITION) + || ($gi->databaseType == GEOIP_DOMAIN_EDITION) + || ($gi->databaseType == GEOIP_ISP_EDITION) + || ($gi->databaseType == GEOIP_LOCATIONA_EDITION) + || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION) + || ($gi->databaseType == GEOIP_ASNUM_EDITION)){ + $gi->databaseSegments = 0; + $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH); + for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){ + $gi->databaseSegments += (ord($buf[$j]) << ($j * 8)); + } + if ( ( $gi->databaseType == GEOIP_ORG_EDITION ) + || ( $gi->databaseType == GEOIP_DOMAIN_EDITION ) + || ( $gi->databaseType == GEOIP_ISP_EDITION ) ) { + $gi->record_length = ORG_RECORD_LENGTH; + } + } + break; + } else { + fseek($gi->filehandle, -4, SEEK_CUR); + } + } + if (($gi->databaseType == GEOIP_COUNTRY_EDITION)|| + ($gi->databaseType == GEOIP_PROXY_EDITION)|| + ($gi->databaseType == GEOIP_NETSPEED_EDITION)){ + $gi->databaseSegments = GEOIP_COUNTRY_BEGIN; + } + fseek($gi->filehandle,$filepos,SEEK_SET); + } + return $gi; +} + +function geoip_open($filename, $flags) { + $gi = new GeoIP; + $gi->flags = $flags; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0); + } else { + $gi->filehandle = fopen($filename,"rb") or die( "Can not open $filename\n" ); + if ($gi->flags & GEOIP_MEMORY_CACHE) { + $s_array = fstat($gi->filehandle); + $gi->memory_buffer = fread($gi->filehandle, $s_array['size']); + } + } + + $gi = _setup_segments($gi); + return $gi; +} + +function geoip_close($gi) { + if ($gi->flags & GEOIP_SHARED_MEMORY) { + return true; + } + + return fclose($gi->filehandle); +} + +function geoip_country_id_by_name($gi, $name) { + $addr = gethostbyname($name); + if (!$addr || $addr == $name) { + return false; + } + return geoip_country_id_by_addr($gi, $addr); +} + +function geoip_country_code_by_name($gi, $name) { + $country_id = geoip_country_id_by_name($gi,$name); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_CODES[$country_id]; + } + return false; +} + +function geoip_country_name_by_name($gi, $name) { + $country_id = geoip_country_id_by_name($gi,$name); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_NAMES[$country_id]; + } + return false; +} + +function geoip_country_id_by_addr($gi, $addr) { + $ipnum = ip2long($addr); + return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN; +} + +function geoip_country_code_by_addr($gi, $addr) { + if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) { + $record = geoip_record_by_addr($gi,$addr); + if ( $record !== false ) { + return $record->country_code; + } + } else { + $country_id = geoip_country_id_by_addr($gi,$addr); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_CODES[$country_id]; + } + } + return false; +} + +function geoip_country_name_by_addr($gi, $addr) { + if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) { + $record = geoip_record_by_addr($gi,$addr); + return $record->country_name; + } else { + $country_id = geoip_country_id_by_addr($gi,$addr); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_NAMES[$country_id]; + } + } + return false; +} + +function _geoip_seek_country($gi, $ipnum) { + $offset = 0; + for ($depth = 31; $depth >= 0; --$depth) { + if ($gi->flags & GEOIP_MEMORY_CACHE) { + // workaround php's broken substr, strpos, etc handling with + // mbstring.func_overload and mbstring.internal_encoding + $enc = mb_internal_encoding(); + mb_internal_encoding('ISO-8859-1'); + + $buf = substr($gi->memory_buffer, + 2 * $gi->record_length * $offset, + 2 * $gi->record_length); + + mb_internal_encoding($enc); + } elseif ($gi->flags & GEOIP_SHARED_MEMORY) { + $buf = @shmop_read ($gi->shmid, + 2 * $gi->record_length * $offset, + 2 * $gi->record_length ); + } else { + fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0 + or die("fseek failed"); + $buf = fread($gi->filehandle, 2 * $gi->record_length); + } + $x = array(0,0); + for ($i = 0; $i < 2; ++$i) { + for ($j = 0; $j < $gi->record_length; ++$j) { + $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8); + } + } + if ($ipnum & (1 << $depth)) { + if ($x[1] >= $gi->databaseSegments) { + return $x[1]; + } + $offset = $x[1]; + } else { + if ($x[0] >= $gi->databaseSegments) { + return $x[0]; + } + $offset = $x[0]; + } + } + trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR); + return false; +} + +function _get_org($gi,$ipnum){ + $seek_org = _geoip_seek_country($gi,$ipnum); + if ($seek_org == $gi->databaseSegments) { + return NULL; + } + $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH); + } else { + fseek($gi->filehandle, $record_pointer, SEEK_SET); + $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH); + } + // workaround php's broken substr, strpos, etc handling with + // mbstring.func_overload and mbstring.internal_encoding + $enc = mb_internal_encoding(); + mb_internal_encoding('ISO-8859-1'); + $org_buf = substr($org_buf, 0, strpos($org_buf, "\0")); + mb_internal_encoding($enc); + return $org_buf; +} + +function geoip_org_by_addr ($gi,$addr) { + if ($addr == NULL) { + return 0; + } + $ipnum = ip2long($addr); + return _get_org($gi, $ipnum); +} + +function _get_region($gi,$ipnum){ + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0; + if ($seek_region >= 1000){ + $country_code = "US"; + $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65); + } else { + $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region]; + $region = ""; + } + return array ($country_code,$region); + } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) { + $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1; + //print $seek_region; + if ($seek_region < US_OFFSET){ + $country_code = ""; + $region = ""; + } else if ($seek_region < CANADA_OFFSET) { + $country_code = "US"; + $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65); + } else if ($seek_region < WORLD_OFFSET) { + $country_code = "CA"; + $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65); + } else { + $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE]; + $region = ""; + } + return array ($country_code,$region); + } +} + +function geoip_region_by_addr ($gi,$addr) { + if ($addr == NULL) { + return 0; + } + $ipnum = ip2long($addr); + return _get_region($gi, $ipnum); +} + +function getdnsattributes ($l,$ip){ + $r = new Net_DNS_Resolver(); + $r->nameservers = array("ws1.maxmind.com"); + $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN"); + $str = is_object($p->answer[0])?$p->answer[0]->string():''; + ereg("\"(.*)\"",$str,$regs); + $str = $regs[1]; + return $str; +} + +?> diff --git a/tools/geoip/geoipcity.inc b/tools/geoip/geoipcity.inc new file mode 100755 index 000000000..08efe52d9 --- /dev/null +++ b/tools/geoip/geoipcity.inc @@ -0,0 +1,217 @@ +country_code = $value; + } + if ($key == "ci"){ + $record->city = $value; + } + if ($key == "re"){ + $record->region = $value; + } + if ($key == "ac"){ + $record->areacode = $value; + } + if ($key == "dm" || $key == "me" ){ + $record->dmacode = $value; + $record->metrocode = $value; + } + if ($key == "is"){ + $record->isp = $value; + } + if ($key == "or"){ + $record->org = $value; + } + if ($key == "zi"){ + $record->postal_code = $value; + } + if ($key == "la"){ + $record->latitude = $value; + } + if ($key == "lo"){ + $record->longitude = $value; + } + } + $number = $GLOBALS['GEOIP_COUNTRY_CODE_TO_NUMBER'][$record->country_code]; + $record->country_code3 = $GLOBALS['GEOIP_COUNTRY_CODES3'][$number]; + $record->country_name = $GLOBALS['GEOIP_COUNTRY_NAMES'][$number]; + if ($record->region != "") { + if (($record->country_code == "US") || ($record->country_code == "CA")){ + $record->regionname = $GLOBALS['ISO'][$record->country_code][$record->region]; + } else { + $record->regionname = $GLOBALS['FIPS'][$record->country_code][$record->region]; + } + } + return $record; +} + +function _get_record($gi,$ipnum){ + $seek_country = _geoip_seek_country($gi,$ipnum); + if ($seek_country == $gi->databaseSegments) { + return NULL; + } + + // workaround php's broken substr, strpos, etc handling with + // mbstring.func_overload and mbstring.internal_encoding + $enc = mb_internal_encoding(); + mb_internal_encoding('ISO-8859-1'); + + $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments; + + if ($gi->flags & GEOIP_MEMORY_CACHE) { + $record_buf = substr($gi->memory_buffer,$record_pointer,FULL_RECORD_LENGTH); + } elseif ($gi->flags & GEOIP_SHARED_MEMORY){ + $record_buf = @shmop_read($gi->shmid,$record_pointer,FULL_RECORD_LENGTH); + } else { + fseek($gi->filehandle, $record_pointer, SEEK_SET); + $record_buf = fread($gi->filehandle,FULL_RECORD_LENGTH); + } + $record = new geoiprecord; + $record_buf_pos = 0; + $char = ord(substr($record_buf,$record_buf_pos,1)); + $record->country_code = $gi->GEOIP_COUNTRY_CODES[$char]; + $record->country_code3 = $gi->GEOIP_COUNTRY_CODES3[$char]; + $record->country_name = $gi->GEOIP_COUNTRY_NAMES[$char]; + $record->continent_code = $gi->GEOIP_CONTINENT_CODES[$char]; + $record_buf_pos++; + $str_length = 0; + // Get region + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + while ($char != 0){ + $str_length++; + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + } + if ($str_length > 0){ + $record->region = substr($record_buf,$record_buf_pos,$str_length); + } + $record_buf_pos += $str_length + 1; + $str_length = 0; + // Get city + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + while ($char != 0){ + $str_length++; + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + } + if ($str_length > 0){ + $record->city = substr($record_buf,$record_buf_pos,$str_length); + } + $record_buf_pos += $str_length + 1; + $str_length = 0; + // Get postal code + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + while ($char != 0){ + $str_length++; + $char = ord(substr($record_buf,$record_buf_pos+$str_length,1)); + } + if ($str_length > 0){ + $record->postal_code = substr($record_buf,$record_buf_pos,$str_length); + } + $record_buf_pos += $str_length + 1; + $str_length = 0; + // Get latitude and longitude + $latitude = 0; + $longitude = 0; + for ($j = 0;$j < 3; ++$j){ + $char = ord(substr($record_buf,$record_buf_pos++,1)); + $latitude += ($char << ($j * 8)); + } + $record->latitude = ($latitude/10000) - 180; + for ($j = 0;$j < 3; ++$j){ + $char = ord(substr($record_buf,$record_buf_pos++,1)); + $longitude += ($char << ($j * 8)); + } + $record->longitude = ($longitude/10000) - 180; + if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType){ + $metroarea_combo = 0; + if ($record->country_code == "US"){ + for ($j = 0;$j < 3;++$j){ + $char = ord(substr($record_buf,$record_buf_pos++,1)); + $metroarea_combo += ($char << ($j * 8)); + } + $record->metro_code = $record->dma_code = floor($metroarea_combo/1000); + $record->area_code = $metroarea_combo%1000; + } + } + mb_internal_encoding($enc); + return $record; +} + +function GeoIP_record_by_addr ($gi,$addr){ + if ($addr == NULL){ + return 0; + } + $ipnum = ip2long($addr); + return _get_record($gi, $ipnum); +} + +?> diff --git a/tools/geoip/geoipregionvars.php b/tools/geoip/geoipregionvars.php new file mode 100755 index 000000000..4f34d2fd1 --- /dev/null +++ b/tools/geoip/geoipregionvars.php @@ -0,0 +1,4191 @@ + array( + "02" => "Canillo", + "03" => "Encamp", + "04" => "La Massana", + "05" => "Ordino", + "06" => "Sant Julia de Loria", + "07" => "Andorra la Vella", + "08" => "Escaldes-Engordany"), +"AE" => array( + "01" => "Abu Dhabi", + "02" => "Ajman", + "03" => "Dubai", + "04" => "Fujairah", + "05" => "Ras Al Khaimah", + "06" => "Sharjah", + "07" => "Umm Al Quwain"), +"AF" => array( + "01" => "Badakhshan", + "02" => "Badghis", + "03" => "Baghlan", + "05" => "Bamian", + "06" => "Farah", + "07" => "Faryab", + "08" => "Ghazni", + "09" => "Ghowr", + "10" => "Helmand", + "11" => "Herat", + "13" => "Kabol", + "14" => "Kapisa", + "17" => "Lowgar", + "18" => "Nangarhar", + "19" => "Nimruz", + "23" => "Kandahar", + "24" => "Kondoz", + "26" => "Takhar", + "27" => "Vardak", + "28" => "Zabol", + "29" => "Paktika", + "30" => "Balkh", + "31" => "Jowzjan", + "32" => "Samangan", + "33" => "Sar-e Pol", + "34" => "Konar", + "35" => "Laghman", + "36" => "Paktia", + "37" => "Khowst", + "38" => "Nurestan", + "39" => "Oruzgan", + "40" => "Parvan", + "41" => "Daykondi", + "42" => "Panjshir"), +"AG" => array( + "01" => "Barbuda", + "03" => "Saint George", + "04" => "Saint John", + "05" => "Saint Mary", + "06" => "Saint Paul", + "07" => "Saint Peter", + "08" => "Saint Philip", + "09" => "Redonda"), +"AL" => array( + "40" => "Berat", + "41" => "Diber", + "42" => "Durres", + "43" => "Elbasan", + "44" => "Fier", + "45" => "Gjirokaster", + "46" => "Korce", + "47" => "Kukes", + "48" => "Lezhe", + "49" => "Shkoder", + "50" => "Tirane", + "51" => "Vlore"), +"AM" => array( + "01" => "Aragatsotn", + "02" => "Ararat", + "03" => "Armavir", + "04" => "Geghark'unik'", + "05" => "Kotayk'", + "06" => "Lorri", + "07" => "Shirak", + "08" => "Syunik'", + "09" => "Tavush", + "10" => "Vayots' Dzor", + "11" => "Yerevan"), +"AO" => array( + "01" => "Benguela", + "02" => "Bie", + "03" => "Cabinda", + "04" => "Cuando Cubango", + "05" => "Cuanza Norte", + "06" => "Cuanza Sul", + "07" => "Cunene", + "08" => "Huambo", + "09" => "Huila", + "12" => "Malanje", + "13" => "Namibe", + "14" => "Moxico", + "15" => "Uige", + "16" => "Zaire", + "17" => "Lunda Norte", + "18" => "Lunda Sul", + "19" => "Bengo", + "20" => "Luanda"), +"AR" => array( + "01" => "Buenos Aires", + "02" => "Catamarca", + "03" => "Chaco", + "04" => "Chubut", + "05" => "Cordoba", + "06" => "Corrientes", + "07" => "Distrito Federal", + "08" => "Entre Rios", + "09" => "Formosa", + "10" => "Jujuy", + "11" => "La Pampa", + "12" => "La Rioja", + "13" => "Mendoza", + "14" => "Misiones", + "15" => "Neuquen", + "16" => "Rio Negro", + "17" => "Salta", + "18" => "San Juan", + "19" => "San Luis", + "20" => "Santa Cruz", + "21" => "Santa Fe", + "22" => "Santiago del Estero", + "23" => "Tierra del Fuego", + "24" => "Tucuman"), +"AT" => array( + "01" => "Burgenland", + "02" => "Karnten", + "03" => "Niederosterreich", + "04" => "Oberosterreich", + "05" => "Salzburg", + "06" => "Steiermark", + "07" => "Tirol", + "08" => "Vorarlberg", + "09" => "Wien"), +"AU" => array( + "01" => "Australian Capital Territory", + "02" => "New South Wales", + "03" => "Northern Territory", + "04" => "Queensland", + "05" => "South Australia", + "06" => "Tasmania", + "07" => "Victoria", + "08" => "Western Australia"), +"AZ" => array( + "01" => "Abseron", + "02" => "Agcabadi", + "03" => "Agdam", + "04" => "Agdas", + "05" => "Agstafa", + "06" => "Agsu", + "07" => "Ali Bayramli", + "08" => "Astara", + "09" => "Baki", + "10" => "Balakan", + "11" => "Barda", + "12" => "Beylaqan", + "13" => "Bilasuvar", + "14" => "Cabrayil", + "15" => "Calilabad", + "16" => "Daskasan", + "17" => "Davaci", + "18" => "Fuzuli", + "19" => "Gadabay", + "20" => "Ganca", + "21" => "Goranboy", + "22" => "Goycay", + "23" => "Haciqabul", + "24" => "Imisli", + "25" => "Ismayilli", + "26" => "Kalbacar", + "27" => "Kurdamir", + "28" => "Lacin", + "29" => "Lankaran", + "30" => "Lankaran", + "31" => "Lerik", + "32" => "Masalli", + "33" => "Mingacevir", + "34" => "Naftalan", + "35" => "Naxcivan", + "36" => "Neftcala", + "37" => "Oguz", + "38" => "Qabala", + "39" => "Qax", + "40" => "Qazax", + "41" => "Qobustan", + "42" => "Quba", + "43" => "Qubadli", + "44" => "Qusar", + "45" => "Saatli", + "46" => "Sabirabad", + "47" => "Saki", + "48" => "Saki", + "49" => "Salyan", + "50" => "Samaxi", + "51" => "Samkir", + "52" => "Samux", + "53" => "Siyazan", + "54" => "Sumqayit", + "55" => "Susa", + "56" => "Susa", + "57" => "Tartar", + "58" => "Tovuz", + "59" => "Ucar", + "60" => "Xacmaz", + "61" => "Xankandi", + "62" => "Xanlar", + "63" => "Xizi", + "64" => "Xocali", + "65" => "Xocavand", + "66" => "Yardimli", + "67" => "Yevlax", + "68" => "Yevlax", + "69" => "Zangilan", + "70" => "Zaqatala", + "71" => "Zardab"), +"BA" => array( + "01" => "Federation of Bosnia and Herzegovina", + "02" => "Republika Srpska"), +"BB" => array( + "01" => "Christ Church", + "02" => "Saint Andrew", + "03" => "Saint George", + "04" => "Saint James", + "05" => "Saint John", + "06" => "Saint Joseph", + "07" => "Saint Lucy", + "08" => "Saint Michael", + "09" => "Saint Peter", + "10" => "Saint Philip", + "11" => "Saint Thomas"), +"BD" => array( + "81" => "Dhaka", + "82" => "Khulna", + "83" => "Rajshahi", + "84" => "Chittagong", + "85" => "Barisal", + "86" => "Sylhet"), +"BE" => array( + "01" => "Antwerpen", + "03" => "Hainaut", + "04" => "Liege", + "05" => "Limburg", + "06" => "Luxembourg", + "07" => "Namur", + "08" => "Oost-Vlaanderen", + "09" => "West-Vlaanderen", + "10" => "Brabant Wallon", + "11" => "Brussels Hoofdstedelijk Gewest", + "12" => "Vlaams-Brabant"), +"BF" => array( + "15" => "Bam", + "19" => "Boulkiemde", + "20" => "Ganzourgou", + "21" => "Gnagna", + "28" => "Kouritenga", + "33" => "Oudalan", + "34" => "Passore", + "36" => "Sanguie", + "40" => "Soum", + "42" => "Tapoa", + "44" => "Zoundweogo", + "45" => "Bale", + "46" => "Banwa", + "47" => "Bazega", + "48" => "Bougouriba", + "49" => "Boulgou", + "50" => "Gourma", + "51" => "Houet", + "52" => "Ioba", + "53" => "Kadiogo", + "54" => "Kenedougou", + "55" => "Komoe", + "56" => "Komondjari", + "57" => "Kompienga", + "58" => "Kossi", + "59" => "Koulpelogo", + "60" => "Kourweogo", + "61" => "Leraba", + "62" => "Loroum", + "63" => "Mouhoun", + "64" => "Namentenga", + "65" => "Naouri", + "66" => "Nayala", + "67" => "Noumbiel", + "68" => "Oubritenga", + "69" => "Poni", + "70" => "Sanmatenga", + "71" => "Seno", + "72" => "Sissili", + "73" => "Sourou", + "74" => "Tuy", + "75" => "Yagha", + "76" => "Yatenga", + "77" => "Ziro", + "78" => "Zondoma"), +"BG" => array( + "33" => "Mikhaylovgrad", + "38" => "Blagoevgrad", + "39" => "Burgas", + "40" => "Dobrich", + "41" => "Gabrovo", + "42" => "Grad Sofiya", + "43" => "Khaskovo", + "44" => "Kurdzhali", + "45" => "Kyustendil", + "46" => "Lovech", + "47" => "Montana", + "48" => "Pazardzhik", + "49" => "Pernik", + "50" => "Pleven", + "51" => "Plovdiv", + "52" => "Razgrad", + "53" => "Ruse", + "54" => "Shumen", + "55" => "Silistra", + "56" => "Sliven", + "57" => "Smolyan", + "58" => "Sofiya", + "59" => "Stara Zagora", + "60" => "Turgovishte", + "61" => "Varna", + "62" => "Veliko Turnovo", + "63" => "Vidin", + "64" => "Vratsa", + "65" => "Yambol"), +"BH" => array( + "01" => "Al Hadd", + "02" => "Al Manamah", + "05" => "Jidd Hafs", + "06" => "Sitrah", + "08" => "Al Mintaqah al Gharbiyah", + "09" => "Mintaqat Juzur Hawar", + "10" => "Al Mintaqah ash Shamaliyah", + "11" => "Al Mintaqah al Wusta", + "12" => "Madinat", + "13" => "Ar Rifa", + "14" => "Madinat Hamad", + "15" => "Al Muharraq", + "16" => "Al Asimah", + "17" => "Al Janubiyah", + "18" => "Ash Shamaliyah", + "19" => "Al Wusta"), +"BI" => array( + "02" => "Bujumbura", + "09" => "Bubanza", + "10" => "Bururi", + "11" => "Cankuzo", + "12" => "Cibitoke", + "13" => "Gitega", + "14" => "Karuzi", + "15" => "Kayanza", + "16" => "Kirundo", + "17" => "Makamba", + "18" => "Muyinga", + "19" => "Ngozi", + "20" => "Rutana", + "21" => "Ruyigi", + "22" => "Muramvya", + "23" => "Mwaro"), +"BJ" => array( + "07" => "Alibori", + "08" => "Atakora", + "09" => "Atlanyique", + "10" => "Borgou", + "11" => "Collines", + "12" => "Kouffo", + "13" => "Donga", + "14" => "Littoral", + "15" => "Mono", + "16" => "Oueme", + "17" => "Plateau", + "18" => "Zou"), +"BM" => array( + "01" => "Devonshire", + "02" => "Hamilton", + "03" => "Hamilton", + "04" => "Paget", + "05" => "Pembroke", + "06" => "Saint George", + "07" => "Saint George's", + "08" => "Sandys", + "09" => "Smiths", + "10" => "Southampton", + "11" => "Warwick"), +"BN" => array( + "07" => "Alibori", + "08" => "Belait", + "09" => "Brunei and Muara", + "10" => "Temburong", + "11" => "Collines", + "12" => "Kouffo", + "13" => "Donga", + "14" => "Littoral", + "15" => "Tutong", + "16" => "Oueme", + "17" => "Plateau", + "18" => "Zou"), +"BO" => array( + "01" => "Chuquisaca", + "02" => "Cochabamba", + "03" => "El Beni", + "04" => "La Paz", + "05" => "Oruro", + "06" => "Pando", + "07" => "Potosi", + "08" => "Santa Cruz", + "09" => "Tarija"), +"BR" => array( + "01" => "Acre", + "02" => "Alagoas", + "03" => "Amapa", + "04" => "Amazonas", + "05" => "Bahia", + "06" => "Ceara", + "07" => "Distrito Federal", + "08" => "Espirito Santo", + "11" => "Mato Grosso do Sul", + "13" => "Maranhao", + "14" => "Mato Grosso", + "15" => "Minas Gerais", + "16" => "Para", + "17" => "Paraiba", + "18" => "Parana", + "20" => "Piaui", + "21" => "Rio de Janeiro", + "22" => "Rio Grande do Norte", + "23" => "Rio Grande do Sul", + "24" => "Rondonia", + "25" => "Roraima", + "26" => "Santa Catarina", + "27" => "Sao Paulo", + "28" => "Sergipe", + "29" => "Goias", + "30" => "Pernambuco", + "31" => "Tocantins"), +"BS" => array( + "05" => "Bimini", + "06" => "Cat Island", + "10" => "Exuma", + "13" => "Inagua", + "15" => "Long Island", + "16" => "Mayaguana", + "18" => "Ragged Island", + "22" => "Harbour Island", + "23" => "New Providence", + "24" => "Acklins and Crooked Islands", + "25" => "Freeport", + "26" => "Fresh Creek", + "27" => "Governor's Harbour", + "28" => "Green Turtle Cay", + "29" => "High Rock", + "30" => "Kemps Bay", + "31" => "Marsh Harbour", + "32" => "Nichollstown and Berry Islands", + "33" => "Rock Sound", + "34" => "Sandy Point", + "35" => "San Salvador and Rum Cay"), +"BT" => array( + "05" => "Bumthang", + "06" => "Chhukha", + "07" => "Chirang", + "08" => "Daga", + "09" => "Geylegphug", + "10" => "Ha", + "11" => "Lhuntshi", + "12" => "Mongar", + "13" => "Paro", + "14" => "Pemagatsel", + "15" => "Punakha", + "16" => "Samchi", + "17" => "Samdrup", + "18" => "Shemgang", + "19" => "Tashigang", + "20" => "Thimphu", + "21" => "Tongsa", + "22" => "Wangdi Phodrang"), +"BW" => array( + "01" => "Central", + "03" => "Ghanzi", + "04" => "Kgalagadi", + "05" => "Kgatleng", + "06" => "Kweneng", + "08" => "North-East", + "09" => "South-East", + "10" => "Southern", + "11" => "North-West"), +"BY" => array( + "01" => "Brestskaya Voblasts'", + "02" => "Homyel'skaya Voblasts'", + "03" => "Hrodzyenskaya Voblasts'", + "04" => "Minsk", + "05" => "Minskaya Voblasts'", + "06" => "Mahilyowskaya Voblasts'", + "07" => "Vitsyebskaya Voblasts'"), +"BZ" => array( + "01" => "Belize", + "02" => "Cayo", + "03" => "Corozal", + "04" => "Orange Walk", + "05" => "Stann Creek", + "06" => "Toledo"), +"CA" => array( + "AB" => "Alberta", + "BC" => "British Columbia", + "MB" => "Manitoba", + "NB" => "New Brunswick", + "NL" => "Newfoundland", + "NS" => "Nova Scotia", + "NT" => "Northwest Territories", + "NU" => "Nunavut", + "ON" => "Ontario", + "PE" => "Prince Edward Island", + "QC" => "Quebec", + "SK" => "Saskatchewan", + "YT" => "Yukon Territory"), +"CD" => array( + "01" => "Bandundu", + "02" => "Equateur", + "04" => "Kasai-Oriental", + "05" => "Katanga", + "06" => "Kinshasa", + "08" => "Bas-Congo", + "09" => "Orientale", + "10" => "Maniema", + "11" => "Nord-Kivu", + "12" => "Sud-Kivu"), +"CF" => array( + "01" => "Bamingui-Bangoran", + "02" => "Basse-Kotto", + "03" => "Haute-Kotto", + "04" => "Mambere-Kadei", + "05" => "Haut-Mbomou", + "06" => "Kemo", + "07" => "Lobaye", + "08" => "Mbomou", + "09" => "Nana-Mambere", + "11" => "Ouaka", + "12" => "Ouham", + "13" => "Ouham-Pende", + "14" => "Cuvette-Ouest", + "15" => "Nana-Grebizi", + "16" => "Sangha-Mbaere", + "17" => "Ombella-Mpoko", + "18" => "Bangui"), +"CG" => array( + "01" => "Bouenza", + "04" => "Kouilou", + "05" => "Lekoumou", + "06" => "Likouala", + "07" => "Niari", + "08" => "Plateaux", + "10" => "Sangha", + "11" => "Pool", + "12" => "Brazzaville", + "13" => "Cuvette", + "14" => "Cuvette-Ouest"), +"CH" => array( + "01" => "Aargau", + "02" => "Ausser-Rhoden", + "03" => "Basel-Landschaft", + "04" => "Basel-Stadt", + "05" => "Bern", + "06" => "Fribourg", + "07" => "Geneve", + "08" => "Glarus", + "09" => "Graubunden", + "10" => "Inner-Rhoden", + "11" => "Luzern", + "12" => "Neuchatel", + "13" => "Nidwalden", + "14" => "Obwalden", + "15" => "Sankt Gallen", + "16" => "Schaffhausen", + "17" => "Schwyz", + "18" => "Solothurn", + "19" => "Thurgau", + "20" => "Ticino", + "21" => "Uri", + "22" => "Valais", + "23" => "Vaud", + "24" => "Zug", + "25" => "Zurich", + "26" => "Jura"), +"CI" => array( + "74" => "Agneby", + "75" => "Bafing", + "76" => "Bas-Sassandra", + "77" => "Denguele", + "78" => "Dix-Huit Montagnes", + "79" => "Fromager", + "80" => "Haut-Sassandra", + "81" => "Lacs", + "82" => "Lagunes", + "83" => "Marahoue", + "84" => "Moyen-Cavally", + "85" => "Moyen-Comoe", + "86" => "N'zi-Comoe", + "87" => "Savanes", + "88" => "Sud-Bandama", + "89" => "Sud-Comoe", + "90" => "Vallee du Bandama", + "91" => "Worodougou", + "92" => "Zanzan"), +"CL" => array( + "01" => "Valparaiso", + "02" => "Aisen del General Carlos Ibanez del Campo", + "03" => "Antofagasta", + "04" => "Araucania", + "05" => "Atacama", + "06" => "Bio-Bio", + "07" => "Coquimbo", + "08" => "Libertador General Bernardo O'Higgins", + "09" => "Los Lagos", + "10" => "Magallanes y de la Antartica Chilena", + "11" => "Maule", + "12" => "Region Metropolitana", + "13" => "Tarapaca", + "14" => "Los Lagos", + "15" => "Tarapaca", + "16" => "Arica y Parinacota", + "17" => "Los Rios"), +"CM" => array( + "04" => "Est", + "05" => "Littoral", + "07" => "Nord-Ouest", + "08" => "Ouest", + "09" => "Sud-Ouest", + "10" => "Adamaoua", + "11" => "Centre", + "12" => "Extreme-Nord", + "13" => "Nord", + "14" => "Sud"), +"CN" => array( + "01" => "Anhui", + "02" => "Zhejiang", + "03" => "Jiangxi", + "04" => "Jiangsu", + "05" => "Jilin", + "06" => "Qinghai", + "07" => "Fujian", + "08" => "Heilongjiang", + "09" => "Henan", + "10" => "Hebei", + "11" => "Hunan", + "12" => "Hubei", + "13" => "Xinjiang", + "14" => "Xizang", + "15" => "Gansu", + "16" => "Guangxi", + "18" => "Guizhou", + "19" => "Liaoning", + "20" => "Nei Mongol", + "21" => "Ningxia", + "22" => "Beijing", + "23" => "Shanghai", + "24" => "Shanxi", + "25" => "Shandong", + "26" => "Shaanxi", + "28" => "Tianjin", + "29" => "Yunnan", + "30" => "Guangdong", + "31" => "Hainan", + "32" => "Sichuan", + "33" => "Chongqing"), +"CO" => array( + "01" => "Amazonas", + "02" => "Antioquia", + "03" => "Arauca", + "04" => "Atlantico", + "05" => "Bolivar Department", + "06" => "Boyaca Department", + "07" => "Caldas Department", + "08" => "Caqueta", + "09" => "Cauca", + "10" => "Cesar", + "11" => "Choco", + "12" => "Cordoba", + "14" => "Guaviare", + "15" => "Guainia", + "16" => "Huila", + "17" => "La Guajira", + "18" => "Magdalena Department", + "19" => "Meta", + "20" => "Narino", + "21" => "Norte de Santander", + "22" => "Putumayo", + "23" => "Quindio", + "24" => "Risaralda", + "25" => "San Andres y Providencia", + "26" => "Santander", + "27" => "Sucre", + "28" => "Tolima", + "29" => "Valle del Cauca", + "30" => "Vaupes", + "31" => "Vichada", + "32" => "Casanare", + "33" => "Cundinamarca", + "34" => "Distrito Especial", + "35" => "Bolivar", + "36" => "Boyaca", + "37" => "Caldas", + "38" => "Magdalena"), +"CR" => array( + "01" => "Alajuela", + "02" => "Cartago", + "03" => "Guanacaste", + "04" => "Heredia", + "06" => "Limon", + "07" => "Puntarenas", + "08" => "San Jose"), +"CU" => array( + "01" => "Pinar del Rio", + "02" => "Ciudad de la Habana", + "03" => "Matanzas", + "04" => "Isla de la Juventud", + "05" => "Camaguey", + "07" => "Ciego de Avila", + "08" => "Cienfuegos", + "09" => "Granma", + "10" => "Guantanamo", + "11" => "La Habana", + "12" => "Holguin", + "13" => "Las Tunas", + "14" => "Sancti Spiritus", + "15" => "Santiago de Cuba", + "16" => "Villa Clara"), +"CV" => array( + "01" => "Boa Vista", + "02" => "Brava", + "04" => "Maio", + "05" => "Paul", + "07" => "Ribeira Grande", + "08" => "Sal", + "10" => "Sao Nicolau", + "11" => "Sao Vicente", + "13" => "Mosteiros", + "14" => "Praia", + "15" => "Santa Catarina", + "16" => "Santa Cruz", + "17" => "Sao Domingos", + "18" => "Sao Filipe", + "19" => "Sao Miguel", + "20" => "Tarrafal"), +"CY" => array( + "01" => "Famagusta", + "02" => "Kyrenia", + "03" => "Larnaca", + "04" => "Nicosia", + "05" => "Limassol", + "06" => "Paphos"), +"CZ" => array( + "52" => "Hlavni mesto Praha", + "78" => "Jihomoravsky kraj", + "79" => "Jihocesky kraj", + "80" => "Vysocina", + "81" => "Karlovarsky kraj", + "82" => "Kralovehradecky kraj", + "83" => "Liberecky kraj", + "84" => "Olomoucky kraj", + "85" => "Moravskoslezsky kraj", + "86" => "Pardubicky kraj", + "87" => "Plzensky kraj", + "88" => "Stredocesky kraj", + "89" => "Ustecky kraj", + "90" => "Zlinsky kraj"), +"DE" => array( + "01" => "Baden-Wurttemberg", + "02" => "Bayern", + "03" => "Bremen", + "04" => "Hamburg", + "05" => "Hessen", + "06" => "Niedersachsen", + "07" => "Nordrhein-Westfalen", + "08" => "Rheinland-Pfalz", + "09" => "Saarland", + "10" => "Schleswig-Holstein", + "11" => "Brandenburg", + "12" => "Mecklenburg-Vorpommern", + "13" => "Sachsen", + "14" => "Sachsen-Anhalt", + "15" => "Thuringen", + "16" => "Berlin"), +"DJ" => array( + "01" => "Ali Sabieh", + "04" => "Obock", + "05" => "Tadjoura", + "06" => "Dikhil", + "07" => "Djibouti", + "08" => "Arta"), +"DK" => array( + "17" => "Hovedstaden", + "18" => "Midtjylland", + "19" => "Nordjylland", + "20" => "Sjelland", + "21" => "Syddanmark"), +"DM" => array( + "02" => "Saint Andrew", + "03" => "Saint David", + "04" => "Saint George", + "05" => "Saint John", + "06" => "Saint Joseph", + "07" => "Saint Luke", + "08" => "Saint Mark", + "09" => "Saint Patrick", + "10" => "Saint Paul", + "11" => "Saint Peter"), +"DO" => array( + "01" => "Azua", + "02" => "Baoruco", + "03" => "Barahona", + "04" => "Dajabon", + "05" => "Distrito Nacional", + "06" => "Duarte", + "08" => "Espaillat", + "09" => "Independencia", + "10" => "La Altagracia", + "11" => "Elias Pina", + "12" => "La Romana", + "14" => "Maria Trinidad Sanchez", + "15" => "Monte Cristi", + "16" => "Pedernales", + "17" => "Peravia", + "18" => "Puerto Plata", + "19" => "Salcedo", + "20" => "Samana", + "21" => "Sanchez Ramirez", + "23" => "San Juan", + "24" => "San Pedro De Macoris", + "25" => "Santiago", + "26" => "Santiago Rodriguez", + "27" => "Valverde", + "28" => "El Seibo", + "29" => "Hato Mayor", + "30" => "La Vega", + "31" => "Monsenor Nouel", + "32" => "Monte Plata", + "33" => "San Cristobal", + "34" => "Distrito Nacional", + "35" => "Peravia", + "36" => "San Jose de Ocoa", + "37" => "Santo Domingo"), +"DZ" => array( + "01" => "Alger", + "03" => "Batna", + "04" => "Constantine", + "06" => "Medea", + "07" => "Mostaganem", + "09" => "Oran", + "10" => "Saida", + "12" => "Setif", + "13" => "Tiaret", + "14" => "Tizi Ouzou", + "15" => "Tlemcen", + "18" => "Bejaia", + "19" => "Biskra", + "20" => "Blida", + "21" => "Bouira", + "22" => "Djelfa", + "23" => "Guelma", + "24" => "Jijel", + "25" => "Laghouat", + "26" => "Mascara", + "27" => "M'sila", + "29" => "Oum el Bouaghi", + "30" => "Sidi Bel Abbes", + "31" => "Skikda", + "33" => "Tebessa", + "34" => "Adrar", + "35" => "Ain Defla", + "36" => "Ain Temouchent", + "37" => "Annaba", + "38" => "Bechar", + "39" => "Bordj Bou Arreridj", + "40" => "Boumerdes", + "41" => "Chlef", + "42" => "El Bayadh", + "43" => "El Oued", + "44" => "El Tarf", + "45" => "Ghardaia", + "46" => "Illizi", + "47" => "Khenchela", + "48" => "Mila", + "49" => "Naama", + "50" => "Ouargla", + "51" => "Relizane", + "52" => "Souk Ahras", + "53" => "Tamanghasset", + "54" => "Tindouf", + "55" => "Tipaza", + "56" => "Tissemsilt"), +"EC" => array( + "01" => "Galapagos", + "02" => "Azuay", + "03" => "Bolivar", + "04" => "Canar", + "05" => "Carchi", + "06" => "Chimborazo", + "07" => "Cotopaxi", + "08" => "El Oro", + "09" => "Esmeraldas", + "10" => "Guayas", + "11" => "Imbabura", + "12" => "Loja", + "13" => "Los Rios", + "14" => "Manabi", + "15" => "Morona-Santiago", + "17" => "Pastaza", + "18" => "Pichincha", + "19" => "Tungurahua", + "20" => "Zamora-Chinchipe", + "22" => "Sucumbios", + "23" => "Napo", + "24" => "Orellana"), +"EE" => array( + "01" => "Harjumaa", + "02" => "Hiiumaa", + "03" => "Ida-Virumaa", + "04" => "Jarvamaa", + "05" => "Jogevamaa", + "06" => "Kohtla-Jarve", + "07" => "Laanemaa", + "08" => "Laane-Virumaa", + "09" => "Narva", + "10" => "Parnu", + "11" => "Parnumaa", + "12" => "Polvamaa", + "13" => "Raplamaa", + "14" => "Saaremaa", + "15" => "Sillamae", + "16" => "Tallinn", + "17" => "Tartu", + "18" => "Tartumaa", + "19" => "Valgamaa", + "20" => "Viljandimaa", + "21" => "Vorumaa"), +"EG" => array( + "01" => "Ad Daqahliyah", + "02" => "Al Bahr al Ahmar", + "03" => "Al Buhayrah", + "04" => "Al Fayyum", + "05" => "Al Gharbiyah", + "06" => "Al Iskandariyah", + "07" => "Al Isma'iliyah", + "08" => "Al Jizah", + "09" => "Al Minufiyah", + "10" => "Al Minya", + "11" => "Al Qahirah", + "12" => "Al Qalyubiyah", + "13" => "Al Wadi al Jadid", + "14" => "Ash Sharqiyah", + "15" => "As Suways", + "16" => "Aswan", + "17" => "Asyut", + "18" => "Bani Suwayf", + "19" => "Bur Sa'id", + "20" => "Dumyat", + "21" => "Kafr ash Shaykh", + "22" => "Matruh", + "23" => "Qina", + "24" => "Suhaj", + "26" => "Janub Sina'", + "27" => "Shamal Sina'"), +"ER" => array( + "01" => "Anseba", + "02" => "Debub", + "03" => "Debubawi K'eyih Bahri", + "04" => "Gash Barka", + "05" => "Ma'akel", + "06" => "Semenawi K'eyih Bahri"), +"ES" => array( + "07" => "Islas Baleares", + "27" => "La Rioja", + "29" => "Madrid", + "31" => "Murcia", + "32" => "Navarra", + "34" => "Asturias", + "39" => "Cantabria", + "51" => "Andalucia", + "52" => "Aragon", + "53" => "Canarias", + "54" => "Castilla-La Mancha", + "55" => "Castilla y Leon", + "56" => "Catalonia", + "57" => "Extremadura", + "58" => "Galicia", + "59" => "Pais Vasco", + "60" => "Comunidad Valenciana"), +"ET" => array( + "44" => "Adis Abeba", + "45" => "Afar", + "46" => "Amara", + "47" => "Binshangul Gumuz", + "48" => "Dire Dawa", + "49" => "Gambela Hizboch", + "50" => "Hareri Hizb", + "51" => "Oromiya", + "52" => "Sumale", + "53" => "Tigray", + "54" => "YeDebub Biheroch Bihereseboch na Hizboch"), +"FI" => array( + "01" => "Aland", + "06" => "Lapland", + "08" => "Oulu", + "13" => "Southern Finland", + "14" => "Eastern Finland", + "15" => "Western Finland"), +"FJ" => array( + "01" => "Central", + "02" => "Eastern", + "03" => "Northern", + "04" => "Rotuma", + "05" => "Western"), +"FM" => array( + "01" => "Kosrae", + "02" => "Pohnpei", + "03" => "Chuuk", + "04" => "Yap"), +"FR" => array( + "97" => "Aquitaine", + "98" => "Auvergne", + "99" => "Basse-Normandie", + "A1" => "Bourgogne", + "A2" => "Bretagne", + "A3" => "Centre", + "A4" => "Champagne-Ardenne", + "A5" => "Corse", + "A6" => "Franche-Comte", + "A7" => "Haute-Normandie", + "A8" => "Ile-de-France", + "A9" => "Languedoc-Roussillon", + "B1" => "Limousin", + "B2" => "Lorraine", + "B3" => "Midi-Pyrenees", + "B4" => "Nord-Pas-de-Calais", + "B5" => "Pays de la Loire", + "B6" => "Picardie", + "B7" => "Poitou-Charentes", + "B8" => "Provence-Alpes-Cote d'Azur", + "B9" => "Rhone-Alpes", + "C1" => "Alsace"), +"GA" => array( + "01" => "Estuaire", + "02" => "Haut-Ogooue", + "03" => "Moyen-Ogooue", + "04" => "Ngounie", + "05" => "Nyanga", + "06" => "Ogooue-Ivindo", + "07" => "Ogooue-Lolo", + "08" => "Ogooue-Maritime", + "09" => "Woleu-Ntem"), +"GB" => array( + "A1" => "Barking and Dagenham", + "A2" => "Barnet", + "A3" => "Barnsley", + "A4" => "Bath and North East Somerset", + "A5" => "Bedfordshire", + "A6" => "Bexley", + "A7" => "Birmingham", + "A8" => "Blackburn with Darwen", + "A9" => "Blackpool", + "B1" => "Bolton", + "B2" => "Bournemouth", + "B3" => "Bracknell Forest", + "B4" => "Bradford", + "B5" => "Brent", + "B6" => "Brighton and Hove", + "B7" => "Bristol, City of", + "B8" => "Bromley", + "B9" => "Buckinghamshire", + "C1" => "Bury", + "C2" => "Calderdale", + "C3" => "Cambridgeshire", + "C4" => "Camden", + "C5" => "Cheshire", + "C6" => "Cornwall", + "C7" => "Coventry", + "C8" => "Croydon", + "C9" => "Cumbria", + "D1" => "Darlington", + "D2" => "Derby", + "D3" => "Derbyshire", + "D4" => "Devon", + "D5" => "Doncaster", + "D6" => "Dorset", + "D7" => "Dudley", + "D8" => "Durham", + "D9" => "Ealing", + "E1" => "East Riding of Yorkshire", + "E2" => "East Sussex", + "E3" => "Enfield", + "E4" => "Essex", + "E5" => "Gateshead", + "E6" => "Gloucestershire", + "E7" => "Greenwich", + "E8" => "Hackney", + "E9" => "Halton", + "F1" => "Hammersmith and Fulham", + "F2" => "Hampshire", + "F3" => "Haringey", + "F4" => "Harrow", + "F5" => "Hartlepool", + "F6" => "Havering", + "F7" => "Herefordshire", + "F8" => "Hertford", + "F9" => "Hillingdon", + "G1" => "Hounslow", + "G2" => "Isle of Wight", + "G3" => "Islington", + "G4" => "Kensington and Chelsea", + "G5" => "Kent", + "G6" => "Kingston upon Hull, City of", + "G7" => "Kingston upon Thames", + "G8" => "Kirklees", + "G9" => "Knowsley", + "H1" => "Lambeth", + "H2" => "Lancashire", + "H3" => "Leeds", + "H4" => "Leicester", + "H5" => "Leicestershire", + "H6" => "Lewisham", + "H7" => "Lincolnshire", + "H8" => "Liverpool", + "H9" => "London, City of", + "I1" => "Luton", + "I2" => "Manchester", + "I3" => "Medway", + "I4" => "Merton", + "I5" => "Middlesbrough", + "I6" => "Milton Keynes", + "I7" => "Newcastle upon Tyne", + "I8" => "Newham", + "I9" => "Norfolk", + "J1" => "Northamptonshire", + "J2" => "North East Lincolnshire", + "J3" => "North Lincolnshire", + "J4" => "North Somerset", + "J5" => "North Tyneside", + "J6" => "Northumberland", + "J7" => "North Yorkshire", + "J8" => "Nottingham", + "J9" => "Nottinghamshire", + "K1" => "Oldham", + "K2" => "Oxfordshire", + "K3" => "Peterborough", + "K4" => "Plymouth", + "K5" => "Poole", + "K6" => "Portsmouth", + "K7" => "Reading", + "K8" => "Redbridge", + "K9" => "Redcar and Cleveland", + "L1" => "Richmond upon Thames", + "L2" => "Rochdale", + "L3" => "Rotherham", + "L4" => "Rutland", + "L5" => "Salford", + "L6" => "Shropshire", + "L7" => "Sandwell", + "L8" => "Sefton", + "L9" => "Sheffield", + "M1" => "Slough", + "M2" => "Solihull", + "M3" => "Somerset", + "M4" => "Southampton", + "M5" => "Southend-on-Sea", + "M6" => "South Gloucestershire", + "M7" => "South Tyneside", + "M8" => "Southwark", + "M9" => "Staffordshire", + "N1" => "St. Helens", + "N2" => "Stockport", + "N3" => "Stockton-on-Tees", + "N4" => "Stoke-on-Trent", + "N5" => "Suffolk", + "N6" => "Sunderland", + "N7" => "Surrey", + "N8" => "Sutton", + "N9" => "Swindon", + "O1" => "Tameside", + "O2" => "Telford and Wrekin", + "O3" => "Thurrock", + "O4" => "Torbay", + "O5" => "Tower Hamlets", + "O6" => "Trafford", + "O7" => "Wakefield", + "O8" => "Walsall", + "O9" => "Waltham Forest", + "P1" => "Wandsworth", + "P2" => "Warrington", + "P3" => "Warwickshire", + "P4" => "West Berkshire", + "P5" => "Westminster", + "P6" => "West Sussex", + "P7" => "Wigan", + "P8" => "Wiltshire", + "P9" => "Windsor and Maidenhead", + "Q1" => "Wirral", + "Q2" => "Wokingham", + "Q3" => "Wolverhampton", + "Q4" => "Worcestershire", + "Q5" => "York", + "Q6" => "Antrim", + "Q7" => "Ards", + "Q8" => "Armagh", + "Q9" => "Ballymena", + "R1" => "Ballymoney", + "R2" => "Banbridge", + "R3" => "Belfast", + "R4" => "Carrickfergus", + "R5" => "Castlereagh", + "R6" => "Coleraine", + "R7" => "Cookstown", + "R8" => "Craigavon", + "R9" => "Down", + "S1" => "Dungannon", + "S2" => "Fermanagh", + "S3" => "Larne", + "S4" => "Limavady", + "S5" => "Lisburn", + "S6" => "Derry", + "S7" => "Magherafelt", + "S8" => "Moyle", + "S9" => "Newry and Mourne", + "T1" => "Newtownabbey", + "T2" => "North Down", + "T3" => "Omagh", + "T4" => "Strabane", + "T5" => "Aberdeen City", + "T6" => "Aberdeenshire", + "T7" => "Angus", + "T8" => "Argyll and Bute", + "T9" => "Scottish Borders, The", + "U1" => "Clackmannanshire", + "U2" => "Dumfries and Galloway", + "U3" => "Dundee City", + "U4" => "East Ayrshire", + "U5" => "East Dunbartonshire", + "U6" => "East Lothian", + "U7" => "East Renfrewshire", + "U8" => "Edinburgh, City of", + "U9" => "Falkirk", + "V1" => "Fife", + "V2" => "Glasgow City", + "V3" => "Highland", + "V4" => "Inverclyde", + "V5" => "Midlothian", + "V6" => "Moray", + "V7" => "North Ayrshire", + "V8" => "North Lanarkshire", + "V9" => "Orkney", + "W1" => "Perth and Kinross", + "W2" => "Renfrewshire", + "W3" => "Shetland Islands", + "W4" => "South Ayrshire", + "W5" => "South Lanarkshire", + "W6" => "Stirling", + "W7" => "West Dunbartonshire", + "W8" => "Eilean Siar", + "W9" => "West Lothian", + "X1" => "Isle of Anglesey", + "X2" => "Blaenau Gwent", + "X3" => "Bridgend", + "X4" => "Caerphilly", + "X5" => "Cardiff", + "X6" => "Ceredigion", + "X7" => "Carmarthenshire", + "X8" => "Conwy", + "X9" => "Denbighshire", + "Y1" => "Flintshire", + "Y2" => "Gwynedd", + "Y3" => "Merthyr Tydfil", + "Y4" => "Monmouthshire", + "Y5" => "Neath Port Talbot", + "Y6" => "Newport", + "Y7" => "Pembrokeshire", + "Y8" => "Powys", + "Y9" => "Rhondda Cynon Taff", + "Z1" => "Swansea", + "Z2" => "Torfaen", + "Z3" => "Vale of Glamorgan, The", + "Z4" => "Wrexham"), +"GD" => array( + "01" => "Saint Andrew", + "02" => "Saint David", + "03" => "Saint George", + "04" => "Saint John", + "05" => "Saint Mark", + "06" => "Saint Patrick"), +"GE" => array( + "01" => "Abashis Raioni", + "02" => "Abkhazia", + "03" => "Adigenis Raioni", + "04" => "Ajaria", + "05" => "Akhalgoris Raioni", + "06" => "Akhalk'alak'is Raioni", + "07" => "Akhalts'ikhis Raioni", + "08" => "Akhmetis Raioni", + "09" => "Ambrolauris Raioni", + "10" => "Aspindzis Raioni", + "11" => "Baghdat'is Raioni", + "12" => "Bolnisis Raioni", + "13" => "Borjomis Raioni", + "14" => "Chiat'ura", + "15" => "Ch'khorotsqus Raioni", + "16" => "Ch'okhatauris Raioni", + "17" => "Dedop'listsqaros Raioni", + "18" => "Dmanisis Raioni", + "19" => "Dushet'is Raioni", + "20" => "Gardabanis Raioni", + "21" => "Gori", + "22" => "Goris Raioni", + "23" => "Gurjaanis Raioni", + "24" => "Javis Raioni", + "25" => "K'arelis Raioni", + "26" => "Kaspis Raioni", + "27" => "Kharagaulis Raioni", + "28" => "Khashuris Raioni", + "29" => "Khobis Raioni", + "30" => "Khonis Raioni", + "31" => "K'ut'aisi", + "32" => "Lagodekhis Raioni", + "33" => "Lanch'khut'is Raioni", + "34" => "Lentekhis Raioni", + "35" => "Marneulis Raioni", + "36" => "Martvilis Raioni", + "37" => "Mestiis Raioni", + "38" => "Mts'khet'is Raioni", + "39" => "Ninotsmindis Raioni", + "40" => "Onis Raioni", + "41" => "Ozurget'is Raioni", + "42" => "P'ot'i", + "43" => "Qazbegis Raioni", + "44" => "Qvarlis Raioni", + "45" => "Rust'avi", + "46" => "Sach'kheris Raioni", + "47" => "Sagarejos Raioni", + "48" => "Samtrediis Raioni", + "49" => "Senakis Raioni", + "50" => "Sighnaghis Raioni", + "51" => "T'bilisi", + "52" => "T'elavis Raioni", + "53" => "T'erjolis Raioni", + "54" => "T'et'ritsqaros Raioni", + "55" => "T'ianet'is Raioni", + "56" => "Tqibuli", + "57" => "Ts'ageris Raioni", + "58" => "Tsalenjikhis Raioni", + "59" => "Tsalkis Raioni", + "60" => "Tsqaltubo", + "61" => "Vanis Raioni", + "62" => "Zestap'onis Raioni", + "63" => "Zugdidi", + "64" => "Zugdidis Raioni"), +"GH" => array( + "01" => "Greater Accra", + "02" => "Ashanti", + "03" => "Brong-Ahafo", + "04" => "Central", + "05" => "Eastern", + "06" => "Northern", + "08" => "Volta", + "09" => "Western", + "10" => "Upper East", + "11" => "Upper West"), +"GL" => array( + "01" => "Nordgronland", + "02" => "Ostgronland", + "03" => "Vestgronland"), +"GM" => array( + "01" => "Banjul", + "02" => "Lower River", + "03" => "Central River", + "04" => "Upper River", + "05" => "Western", + "07" => "North Bank"), +"GN" => array( + "01" => "Beyla", + "02" => "Boffa", + "03" => "Boke", + "04" => "Conakry", + "05" => "Dabola", + "06" => "Dalaba", + "07" => "Dinguiraye", + "09" => "Faranah", + "10" => "Forecariah", + "11" => "Fria", + "12" => "Gaoual", + "13" => "Gueckedou", + "15" => "Kerouane", + "16" => "Kindia", + "17" => "Kissidougou", + "18" => "Koundara", + "19" => "Kouroussa", + "21" => "Macenta", + "22" => "Mali", + "23" => "Mamou", + "25" => "Pita", + "27" => "Telimele", + "28" => "Tougue", + "29" => "Yomou", + "30" => "Coyah", + "31" => "Dubreka", + "32" => "Kankan", + "33" => "Koubia", + "34" => "Labe", + "35" => "Lelouma", + "36" => "Lola", + "37" => "Mandiana", + "38" => "Nzerekore", + "39" => "Siguiri"), +"GQ" => array( + "03" => "Annobon", + "04" => "Bioko Norte", + "05" => "Bioko Sur", + "06" => "Centro Sur", + "07" => "Kie-Ntem", + "08" => "Litoral", + "09" => "Wele-Nzas"), +"GR" => array( + "01" => "Evros", + "02" => "Rodhopi", + "03" => "Xanthi", + "04" => "Drama", + "05" => "Serrai", + "06" => "Kilkis", + "07" => "Pella", + "08" => "Florina", + "09" => "Kastoria", + "10" => "Grevena", + "11" => "Kozani", + "12" => "Imathia", + "13" => "Thessaloniki", + "14" => "Kavala", + "15" => "Khalkidhiki", + "16" => "Pieria", + "17" => "Ioannina", + "18" => "Thesprotia", + "19" => "Preveza", + "20" => "Arta", + "21" => "Larisa", + "22" => "Trikala", + "23" => "Kardhitsa", + "24" => "Magnisia", + "25" => "Kerkira", + "26" => "Levkas", + "27" => "Kefallinia", + "28" => "Zakinthos", + "29" => "Fthiotis", + "30" => "Evritania", + "31" => "Aitolia kai Akarnania", + "32" => "Fokis", + "33" => "Voiotia", + "34" => "Evvoia", + "35" => "Attiki", + "36" => "Argolis", + "37" => "Korinthia", + "38" => "Akhaia", + "39" => "Ilia", + "40" => "Messinia", + "41" => "Arkadhia", + "42" => "Lakonia", + "43" => "Khania", + "44" => "Rethimni", + "45" => "Iraklion", + "46" => "Lasithi", + "47" => "Dhodhekanisos", + "48" => "Samos", + "49" => "Kikladhes", + "50" => "Khios", + "51" => "Lesvos"), +"GT" => array( + "01" => "Alta Verapaz", + "02" => "Baja Verapaz", + "03" => "Chimaltenango", + "04" => "Chiquimula", + "05" => "El Progreso", + "06" => "Escuintla", + "07" => "Guatemala", + "08" => "Huehuetenango", + "09" => "Izabal", + "10" => "Jalapa", + "11" => "Jutiapa", + "12" => "Peten", + "13" => "Quetzaltenango", + "14" => "Quiche", + "15" => "Retalhuleu", + "16" => "Sacatepequez", + "17" => "San Marcos", + "18" => "Santa Rosa", + "19" => "Solola", + "20" => "Suchitepequez", + "21" => "Totonicapan", + "22" => "Zacapa"), +"GW" => array( + "01" => "Bafata", + "02" => "Quinara", + "04" => "Oio", + "05" => "Bolama", + "06" => "Cacheu", + "07" => "Tombali", + "10" => "Gabu", + "11" => "Bissau", + "12" => "Biombo"), +"GY" => array( + "10" => "Barima-Waini", + "11" => "Cuyuni-Mazaruni", + "12" => "Demerara-Mahaica", + "13" => "East Berbice-Corentyne", + "14" => "Essequibo Islands-West Demerara", + "15" => "Mahaica-Berbice", + "16" => "Pomeroon-Supenaam", + "17" => "Potaro-Siparuni", + "18" => "Upper Demerara-Berbice", + "19" => "Upper Takutu-Upper Essequibo"), +"HN" => array( + "01" => "Atlantida", + "02" => "Choluteca", + "03" => "Colon", + "04" => "Comayagua", + "05" => "Copan", + "06" => "Cortes", + "07" => "El Paraiso", + "08" => "Francisco Morazan", + "09" => "Gracias a Dios", + "10" => "Intibuca", + "11" => "Islas de la Bahia", + "12" => "La Paz", + "13" => "Lempira", + "14" => "Ocotepeque", + "15" => "Olancho", + "16" => "Santa Barbara", + "17" => "Valle", + "18" => "Yoro"), +"HR" => array( + "01" => "Bjelovarsko-Bilogorska", + "02" => "Brodsko-Posavska", + "03" => "Dubrovacko-Neretvanska", + "04" => "Istarska", + "05" => "Karlovacka", + "06" => "Koprivnicko-Krizevacka", + "07" => "Krapinsko-Zagorska", + "08" => "Licko-Senjska", + "09" => "Medimurska", + "10" => "Osjecko-Baranjska", + "11" => "Pozesko-Slavonska", + "12" => "Primorsko-Goranska", + "13" => "Sibensko-Kninska", + "14" => "Sisacko-Moslavacka", + "15" => "Splitsko-Dalmatinska", + "16" => "Varazdinska", + "17" => "Viroviticko-Podravska", + "18" => "Vukovarsko-Srijemska", + "19" => "Zadarska", + "20" => "Zagrebacka", + "21" => "Grad Zagreb"), +"HT" => array( + "03" => "Nord-Ouest", + "06" => "Artibonite", + "07" => "Centre", + "09" => "Nord", + "10" => "Nord-Est", + "11" => "Ouest", + "12" => "Sud", + "13" => "Sud-Est", + "14" => "Grand' Anse", + "15" => "Nippes"), +"HU" => array( + "01" => "Bacs-Kiskun", + "02" => "Baranya", + "03" => "Bekes", + "04" => "Borsod-Abauj-Zemplen", + "05" => "Budapest", + "06" => "Csongrad", + "07" => "Debrecen", + "08" => "Fejer", + "09" => "Gyor-Moson-Sopron", + "10" => "Hajdu-Bihar", + "11" => "Heves", + "12" => "Komarom-Esztergom", + "13" => "Miskolc", + "14" => "Nograd", + "15" => "Pecs", + "16" => "Pest", + "17" => "Somogy", + "18" => "Szabolcs-Szatmar-Bereg", + "19" => "Szeged", + "20" => "Jasz-Nagykun-Szolnok", + "21" => "Tolna", + "22" => "Vas", + "23" => "Veszprem", + "24" => "Zala", + "25" => "Gyor", + "26" => "Bekescsaba", + "27" => "Dunaujvaros", + "28" => "Eger", + "29" => "Hodmezovasarhely", + "30" => "Kaposvar", + "31" => "Kecskemet", + "32" => "Nagykanizsa", + "33" => "Nyiregyhaza", + "34" => "Sopron", + "35" => "Szekesfehervar", + "36" => "Szolnok", + "37" => "Szombathely", + "38" => "Tatabanya", + "39" => "Veszprem", + "40" => "Zalaegerszeg", + "41" => "Salgotarjan", + "42" => "Szekszard", + "43" => "Erd"), +"ID" => array( + "01" => "Aceh", + "02" => "Bali", + "03" => "Bengkulu", + "04" => "Jakarta Raya", + "05" => "Jambi", + "06" => "Jawa Barat", + "07" => "Jawa Tengah", + "08" => "Jawa Timur", + "09" => "Papua", + "10" => "Yogyakarta", + "11" => "Kalimantan Barat", + "12" => "Kalimantan Selatan", + "13" => "Kalimantan Tengah", + "14" => "Kalimantan Timur", + "15" => "Lampung", + "16" => "Maluku", + "17" => "Nusa Tenggara Barat", + "18" => "Nusa Tenggara Timur", + "19" => "Riau", + "20" => "Sulawesi Selatan", + "21" => "Sulawesi Tengah", + "22" => "Sulawesi Tenggara", + "23" => "Sulawesi Utara", + "24" => "Sumatera Barat", + "25" => "Sumatera Selatan", + "26" => "Sumatera Utara", + "28" => "Maluku", + "29" => "Maluku Utara", + "30" => "Jawa Barat", + "31" => "Sulawesi Utara", + "32" => "Sumatera Selatan", + "33" => "Banten", + "34" => "Gorontalo", + "35" => "Kepulauan Bangka Belitung", + "36" => "Papua", + "37" => "Riau", + "38" => "Sulawesi Selatan", + "39" => "Irian Jaya Barat", + "40" => "Kepulauan Riau", + "41" => "Sulawesi Barat"), +"IE" => array( + "01" => "Carlow", + "02" => "Cavan", + "03" => "Clare", + "04" => "Cork", + "06" => "Donegal", + "07" => "Dublin", + "10" => "Galway", + "11" => "Kerry", + "12" => "Kildare", + "13" => "Kilkenny", + "14" => "Leitrim", + "15" => "Laois", + "16" => "Limerick", + "18" => "Longford", + "19" => "Louth", + "20" => "Mayo", + "21" => "Meath", + "22" => "Monaghan", + "23" => "Offaly", + "24" => "Roscommon", + "25" => "Sligo", + "26" => "Tipperary", + "27" => "Waterford", + "29" => "Westmeath", + "30" => "Wexford", + "31" => "Wicklow"), +"IL" => array( + "01" => "HaDarom", + "02" => "HaMerkaz", + "03" => "HaZafon", + "04" => "Hefa", + "05" => "Tel Aviv", + "06" => "Yerushalayim"), +"IN" => array( + "01" => "Andaman and Nicobar Islands", + "02" => "Andhra Pradesh", + "03" => "Assam", + "05" => "Chandigarh", + "06" => "Dadra and Nagar Haveli", + "07" => "Delhi", + "09" => "Gujarat", + "10" => "Haryana", + "11" => "Himachal Pradesh", + "12" => "Jammu and Kashmir", + "13" => "Kerala", + "14" => "Lakshadweep", + "16" => "Maharashtra", + "17" => "Manipur", + "18" => "Meghalaya", + "19" => "Karnataka", + "20" => "Nagaland", + "21" => "Orissa", + "22" => "Puducherry", + "23" => "Punjab", + "24" => "Rajasthan", + "25" => "Tamil Nadu", + "26" => "Tripura", + "28" => "West Bengal", + "29" => "Sikkim", + "30" => "Arunachal Pradesh", + "31" => "Mizoram", + "32" => "Daman and Diu", + "33" => "Goa", + "34" => "Bihar", + "35" => "Madhya Pradesh", + "36" => "Uttar Pradesh", + "37" => "Chhattisgarh", + "38" => "Jharkhand", + "39" => "Uttarakhand"), +"IQ" => array( + "01" => "Al Anbar", + "02" => "Al Basrah", + "03" => "Al Muthanna", + "04" => "Al Qadisiyah", + "05" => "As Sulaymaniyah", + "06" => "Babil", + "07" => "Baghdad", + "08" => "Dahuk", + "09" => "Dhi Qar", + "10" => "Diyala", + "11" => "Arbil", + "12" => "Karbala'", + "13" => "At Ta'mim", + "14" => "Maysan", + "15" => "Ninawa", + "16" => "Wasit", + "17" => "An Najaf", + "18" => "Salah ad Din"), +"IR" => array( + "01" => "Azarbayjan-e Bakhtari", + "03" => "Chahar Mahall va Bakhtiari", + "04" => "Sistan va Baluchestan", + "05" => "Kohkiluyeh va Buyer Ahmadi", + "07" => "Fars", + "08" => "Gilan", + "09" => "Hamadan", + "10" => "Ilam", + "11" => "Hormozgan", + "12" => "Kerman", + "13" => "Bakhtaran", + "15" => "Khuzestan", + "16" => "Kordestan", + "17" => "Mazandaran", + "18" => "Semnan Province", + "19" => "Markazi", + "21" => "Zanjan", + "22" => "Bushehr", + "23" => "Lorestan", + "24" => "Markazi", + "25" => "Semnan", + "26" => "Tehran", + "27" => "Zanjan", + "28" => "Esfahan", + "29" => "Kerman", + "30" => "Khorasan", + "31" => "Yazd", + "32" => "Ardabil", + "33" => "East Azarbaijan", + "34" => "Markazi", + "35" => "Mazandaran", + "36" => "Zanjan", + "37" => "Golestan", + "38" => "Qazvin", + "39" => "Qom", + "40" => "Yazd", + "41" => "Khorasan-e Janubi", + "42" => "Khorasan-e Razavi", + "43" => "Khorasan-e Shemali"), +"IS" => array( + "03" => "Arnessysla", + "05" => "Austur-Hunavatnssysla", + "06" => "Austur-Skaftafellssysla", + "07" => "Borgarfjardarsysla", + "09" => "Eyjafjardarsysla", + "10" => "Gullbringusysla", + "15" => "Kjosarsysla", + "17" => "Myrasysla", + "20" => "Nordur-Mulasysla", + "21" => "Nordur-Tingeyjarsysla", + "23" => "Rangarvallasysla", + "28" => "Skagafjardarsysla", + "29" => "Snafellsnes- og Hnappadalssysla", + "30" => "Strandasysla", + "31" => "Sudur-Mulasysla", + "32" => "Sudur-Tingeyjarsysla", + "34" => "Vestur-Bardastrandarsysla", + "35" => "Vestur-Hunavatnssysla", + "36" => "Vestur-Isafjardarsysla", + "37" => "Vestur-Skaftafellssysla", + "40" => "Norourland Eystra", + "41" => "Norourland Vestra", + "42" => "Suourland", + "43" => "Suournes", + "44" => "Vestfiroir", + "45" => "Vesturland"), +"IT" => array( + "01" => "Abruzzi", + "02" => "Basilicata", + "03" => "Calabria", + "04" => "Campania", + "05" => "Emilia-Romagna", + "06" => "Friuli-Venezia Giulia", + "07" => "Lazio", + "08" => "Liguria", + "09" => "Lombardia", + "10" => "Marche", + "11" => "Molise", + "12" => "Piemonte", + "13" => "Puglia", + "14" => "Sardegna", + "15" => "Sicilia", + "16" => "Toscana", + "17" => "Trentino-Alto Adige", + "18" => "Umbria", + "19" => "Valle d'Aosta", + "20" => "Veneto"), +"JM" => array( + "01" => "Clarendon", + "02" => "Hanover", + "04" => "Manchester", + "07" => "Portland", + "08" => "Saint Andrew", + "09" => "Saint Ann", + "10" => "Saint Catherine", + "11" => "Saint Elizabeth", + "12" => "Saint James", + "13" => "Saint Mary", + "14" => "Saint Thomas", + "15" => "Trelawny", + "16" => "Westmoreland", + "17" => "Kingston"), +"JO" => array( + "02" => "Al Balqa'", + "07" => "Ma", + "09" => "Al Karak", + "10" => "Al Mafraq", + "11" => "Amman Governorate", + "12" => "At Tafilah", + "13" => "Az Zarqa", + "14" => "Irbid", + "16" => "Amman"), +"JP" => array( + "01" => "Aichi", + "02" => "Akita", + "03" => "Aomori", + "04" => "Chiba", + "05" => "Ehime", + "06" => "Fukui", + "07" => "Fukuoka", + "08" => "Fukushima", + "09" => "Gifu", + "10" => "Gumma", + "11" => "Hiroshima", + "12" => "Hokkaido", + "13" => "Hyogo", + "14" => "Ibaraki", + "15" => "Ishikawa", + "16" => "Iwate", + "17" => "Kagawa", + "18" => "Kagoshima", + "19" => "Kanagawa", + "20" => "Kochi", + "21" => "Kumamoto", + "22" => "Kyoto", + "23" => "Mie", + "24" => "Miyagi", + "25" => "Miyazaki", + "26" => "Nagano", + "27" => "Nagasaki", + "28" => "Nara", + "29" => "Niigata", + "30" => "Oita", + "31" => "Okayama", + "32" => "Osaka", + "33" => "Saga", + "34" => "Saitama", + "35" => "Shiga", + "36" => "Shimane", + "37" => "Shizuoka", + "38" => "Tochigi", + "39" => "Tokushima", + "40" => "Tokyo", + "41" => "Tottori", + "42" => "Toyama", + "43" => "Wakayama", + "44" => "Yamagata", + "45" => "Yamaguchi", + "46" => "Yamanashi", + "47" => "Okinawa"), +"KE" => array( + "01" => "Central", + "02" => "Coast", + "03" => "Eastern", + "05" => "Nairobi Area", + "06" => "North-Eastern", + "07" => "Nyanza", + "08" => "Rift Valley", + "09" => "Western"), +"KG" => array( + "01" => "Bishkek", + "02" => "Chuy", + "03" => "Jalal-Abad", + "04" => "Naryn", + "05" => "Osh", + "06" => "Talas", + "07" => "Ysyk-Kol", + "08" => "Osh", + "09" => "Batken"), +"KH" => array( + "01" => "Batdambang", + "02" => "Kampong Cham", + "03" => "Kampong Chhnang", + "04" => "Kampong Speu", + "05" => "Kampong Thum", + "06" => "Kampot", + "07" => "Kandal", + "08" => "Koh Kong", + "09" => "Kracheh", + "10" => "Mondulkiri", + "11" => "Phnum Penh", + "12" => "Pursat", + "13" => "Preah Vihear", + "14" => "Prey Veng", + "15" => "Ratanakiri Kiri", + "16" => "Siem Reap", + "17" => "Stung Treng", + "18" => "Svay Rieng", + "19" => "Takeo", + "25" => "Banteay Meanchey", + "29" => "Batdambang", + "30" => "Pailin"), +"KI" => array( + "01" => "Gilbert Islands", + "02" => "Line Islands", + "03" => "Phoenix Islands"), +"KM" => array( + "01" => "Anjouan", + "02" => "Grande Comore", + "03" => "Moheli"), +"KN" => array( + "01" => "Christ Church Nichola Town", + "02" => "Saint Anne Sandy Point", + "03" => "Saint George Basseterre", + "04" => "Saint George Gingerland", + "05" => "Saint James Windward", + "06" => "Saint John Capisterre", + "07" => "Saint John Figtree", + "08" => "Saint Mary Cayon", + "09" => "Saint Paul Capisterre", + "10" => "Saint Paul Charlestown", + "11" => "Saint Peter Basseterre", + "12" => "Saint Thomas Lowland", + "13" => "Saint Thomas Middle Island", + "15" => "Trinity Palmetto Point"), +"KP" => array( + "01" => "Chagang-do", + "03" => "Hamgyong-namdo", + "06" => "Hwanghae-namdo", + "07" => "Hwanghae-bukto", + "08" => "Kaesong-si", + "09" => "Kangwon-do", + "11" => "P'yongan-bukto", + "12" => "P'yongyang-si", + "13" => "Yanggang-do", + "14" => "Namp'o-si", + "15" => "P'yongan-namdo", + "17" => "Hamgyong-bukto", + "18" => "Najin Sonbong-si"), +"KR" => array( + "01" => "Cheju-do", + "03" => "Cholla-bukto", + "05" => "Ch'ungch'ong-bukto", + "06" => "Kangwon-do", + "10" => "Pusan-jikhalsi", + "11" => "Seoul-t'ukpyolsi", + "12" => "Inch'on-jikhalsi", + "13" => "Kyonggi-do", + "14" => "Kyongsang-bukto", + "15" => "Taegu-jikhalsi", + "16" => "Cholla-namdo", + "17" => "Ch'ungch'ong-namdo", + "18" => "Kwangju-jikhalsi", + "19" => "Taejon-jikhalsi", + "20" => "Kyongsang-namdo", + "21" => "Ulsan-gwangyoksi"), +"KW" => array( + "01" => "Al Ahmadi", + "02" => "Al Kuwayt", + "05" => "Al Jahra", + "07" => "Al Farwaniyah", + "08" => "Hawalli", + "09" => "Mubarak al Kabir"), +"KY" => array( + "01" => "Creek", + "02" => "Eastern", + "03" => "Midland", + "04" => "South Town", + "05" => "Spot Bay", + "06" => "Stake Bay", + "07" => "West End", + "08" => "Western"), +"KZ" => array( + "01" => "Almaty", + "02" => "Almaty City", + "03" => "Aqmola", + "04" => "Aqtobe", + "05" => "Astana", + "06" => "Atyrau", + "07" => "West Kazakhstan", + "08" => "Bayqonyr", + "09" => "Mangghystau", + "10" => "South Kazakhstan", + "11" => "Pavlodar", + "12" => "Qaraghandy", + "13" => "Qostanay", + "14" => "Qyzylorda", + "15" => "East Kazakhstan", + "16" => "North Kazakhstan", + "17" => "Zhambyl"), +"LA" => array( + "01" => "Attapu", + "02" => "Champasak", + "03" => "Houaphan", + "04" => "Khammouan", + "05" => "Louang Namtha", + "07" => "Oudomxai", + "08" => "Phongsali", + "09" => "Saravan", + "10" => "Savannakhet", + "11" => "Vientiane", + "13" => "Xaignabouri", + "14" => "Xiangkhoang", + "17" => "Louangphrabang"), +"LB" => array( + "01" => "Beqaa", + "02" => "Al Janub", + "03" => "Liban-Nord", + "04" => "Beyrouth", + "05" => "Mont-Liban", + "06" => "Liban-Sud", + "07" => "Nabatiye", + "08" => "Beqaa", + "09" => "Liban-Nord", + "10" => "Aakk,r", + "11" => "Baalbek-Hermel"), +"LC" => array( + "01" => "Anse-la-Raye", + "02" => "Dauphin", + "03" => "Castries", + "04" => "Choiseul", + "05" => "Dennery", + "06" => "Gros-Islet", + "07" => "Laborie", + "08" => "Micoud", + "09" => "Soufriere", + "10" => "Vieux-Fort", + "11" => "Praslin"), +"LI" => array( + "01" => "Balzers", + "02" => "Eschen", + "03" => "Gamprin", + "04" => "Mauren", + "05" => "Planken", + "06" => "Ruggell", + "07" => "Schaan", + "08" => "Schellenberg", + "09" => "Triesen", + "10" => "Triesenberg", + "11" => "Vaduz", + "21" => "Gbarpolu", + "22" => "River Gee"), +"LK" => array( + "01" => "Amparai", + "02" => "Anuradhapura", + "03" => "Badulla", + "04" => "Batticaloa", + "06" => "Galle", + "07" => "Hambantota", + "09" => "Kalutara", + "10" => "Kandy", + "11" => "Kegalla", + "12" => "Kurunegala", + "14" => "Matale", + "15" => "Matara", + "16" => "Moneragala", + "17" => "Nuwara Eliya", + "18" => "Polonnaruwa", + "19" => "Puttalam", + "20" => "Ratnapura", + "21" => "Trincomalee", + "23" => "Colombo", + "24" => "Gampaha", + "25" => "Jaffna", + "26" => "Mannar", + "27" => "Mullaittivu", + "28" => "Vavuniya", + "29" => "Central", + "30" => "North Central", + "31" => "Northern", + "32" => "North Western", + "33" => "Sabaragamuwa", + "34" => "Southern", + "35" => "Uva", + "36" => "Western"), +"LR" => array( + "01" => "Bong", + "04" => "Grand Cape Mount", + "05" => "Lofa", + "06" => "Maryland", + "07" => "Monrovia", + "09" => "Nimba", + "10" => "Sino", + "11" => "Grand Bassa", + "12" => "Grand Cape Mount", + "13" => "Maryland", + "14" => "Montserrado", + "17" => "Margibi", + "18" => "River Cess", + "19" => "Grand Gedeh", + "20" => "Lofa", + "21" => "Gbarpolu", + "22" => "River Gee"), +"LS" => array( + "10" => "Berea", + "11" => "Butha-Buthe", + "12" => "Leribe", + "13" => "Mafeteng", + "14" => "Maseru", + "15" => "Mohales Hoek", + "16" => "Mokhotlong", + "17" => "Qachas Nek", + "18" => "Quthing", + "19" => "Thaba-Tseka"), +"LT" => array( + "56" => "Alytaus Apskritis", + "57" => "Kauno Apskritis", + "58" => "Klaipedos Apskritis", + "59" => "Marijampoles Apskritis", + "60" => "Panevezio Apskritis", + "61" => "Siauliu Apskritis", + "62" => "Taurages Apskritis", + "63" => "Telsiu Apskritis", + "64" => "Utenos Apskritis", + "65" => "Vilniaus Apskritis"), +"LU" => array( + "01" => "Diekirch", + "02" => "Grevenmacher", + "03" => "Luxembourg"), +"LV" => array( + "01" => "Aizkraukles", + "02" => "Aluksnes", + "03" => "Balvu", + "04" => "Bauskas", + "05" => "Cesu", + "06" => "Daugavpils", + "07" => "Daugavpils", + "08" => "Dobeles", + "09" => "Gulbenes", + "10" => "Jekabpils", + "11" => "Jelgava", + "12" => "Jelgavas", + "13" => "Jurmala", + "14" => "Kraslavas", + "15" => "Kuldigas", + "16" => "Liepaja", + "17" => "Liepajas", + "18" => "Limbazu", + "19" => "Ludzas", + "20" => "Madonas", + "21" => "Ogres", + "22" => "Preilu", + "23" => "Rezekne", + "24" => "Rezeknes", + "25" => "Riga", + "26" => "Rigas", + "27" => "Saldus", + "28" => "Talsu", + "29" => "Tukuma", + "30" => "Valkas", + "31" => "Valmieras", + "32" => "Ventspils", + "33" => "Ventspils"), +"LY" => array( + "03" => "Al Aziziyah", + "05" => "Al Jufrah", + "08" => "Al Kufrah", + "13" => "Ash Shati'", + "30" => "Murzuq", + "34" => "Sabha", + "41" => "Tarhunah", + "42" => "Tubruq", + "45" => "Zlitan", + "47" => "Ajdabiya", + "48" => "Al Fatih", + "49" => "Al Jabal al Akhdar", + "50" => "Al Khums", + "51" => "An Nuqat al Khams", + "52" => "Awbari", + "53" => "Az Zawiyah", + "54" => "Banghazi", + "55" => "Darnah", + "56" => "Ghadamis", + "57" => "Gharyan", + "58" => "Misratah", + "59" => "Sawfajjin", + "60" => "Surt", + "61" => "Tarabulus", + "62" => "Yafran"), +"MA" => array( + "45" => "Grand Casablanca", + "46" => "Fes-Boulemane", + "47" => "Marrakech-Tensift-Al Haouz", + "48" => "Meknes-Tafilalet", + "49" => "Rabat-Sale-Zemmour-Zaer", + "50" => "Chaouia-Ouardigha", + "51" => "Doukkala-Abda", + "52" => "Gharb-Chrarda-Beni Hssen", + "53" => "Guelmim-Es Smara", + "54" => "Oriental", + "55" => "Souss-Massa-Dr,a", + "56" => "Tadla-Azilal", + "57" => "Tanger-Tetouan", + "58" => "Taza-Al Hoceima-Taounate", + "59" => "La,youne-Boujdour-Sakia El Hamra"), +"MC" => array( + "01" => "La Condamine", + "02" => "Monaco", + "03" => "Monte-Carlo"), +"MD" => array( + "51" => "Gagauzia", + "57" => "Chisinau", + "58" => "Stinga Nistrului", + "59" => "Anenii Noi", + "60" => "Balti", + "61" => "Basarabeasca", + "62" => "Bender", + "63" => "Briceni", + "64" => "Cahul", + "65" => "Cantemir", + "66" => "Calarasi", + "67" => "Causeni", + "68" => "Cimislia", + "69" => "Criuleni", + "70" => "Donduseni", + "71" => "Drochia", + "72" => "Dubasari", + "73" => "Edinet", + "74" => "Falesti", + "75" => "Floresti", + "76" => "Glodeni", + "77" => "Hincesti", + "78" => "Ialoveni", + "79" => "Leova", + "80" => "Nisporeni", + "81" => "Ocnita", + "83" => "Rezina", + "84" => "Riscani", + "85" => "Singerei", + "86" => "Soldanesti", + "87" => "Soroca", + "88" => "Stefan-Voda", + "89" => "Straseni", + "90" => "Taraclia", + "91" => "Telenesti", + "92" => "Ungheni"), +"MG" => array( + "01" => "Antsiranana", + "02" => "Fianarantsoa", + "03" => "Mahajanga", + "04" => "Toamasina", + "05" => "Antananarivo", + "06" => "Toliara"), +"MK" => array( + "01" => "Aracinovo", + "02" => "Bac", + "03" => "Belcista", + "04" => "Berovo", + "05" => "Bistrica", + "06" => "Bitola", + "07" => "Blatec", + "08" => "Bogdanci", + "09" => "Bogomila", + "10" => "Bogovinje", + "11" => "Bosilovo", + "12" => "Brvenica", + "13" => "Cair", + "14" => "Capari", + "15" => "Caska", + "16" => "Cegrane", + "17" => "Centar", + "18" => "Centar Zupa", + "19" => "Cesinovo", + "20" => "Cucer-Sandevo", + "21" => "Debar", + "22" => "Delcevo", + "23" => "Delogozdi", + "24" => "Demir Hisar", + "25" => "Demir Kapija", + "26" => "Dobrusevo", + "27" => "Dolna Banjica", + "28" => "Dolneni", + "29" => "Dorce Petrov", + "30" => "Drugovo", + "31" => "Dzepciste", + "32" => "Gazi Baba", + "33" => "Gevgelija", + "34" => "Gostivar", + "35" => "Gradsko", + "36" => "Ilinden", + "37" => "Izvor", + "38" => "Jegunovce", + "39" => "Kamenjane", + "40" => "Karbinci", + "41" => "Karpos", + "42" => "Kavadarci", + "43" => "Kicevo", + "44" => "Kisela Voda", + "45" => "Klecevce", + "46" => "Kocani", + "47" => "Konce", + "48" => "Kondovo", + "49" => "Konopiste", + "50" => "Kosel", + "51" => "Kratovo", + "52" => "Kriva Palanka", + "53" => "Krivogastani", + "54" => "Krusevo", + "55" => "Kuklis", + "56" => "Kukurecani", + "57" => "Kumanovo", + "58" => "Labunista", + "59" => "Lipkovo", + "60" => "Lozovo", + "61" => "Lukovo", + "62" => "Makedonska Kamenica", + "63" => "Makedonski Brod", + "64" => "Mavrovi Anovi", + "65" => "Meseista", + "66" => "Miravci", + "67" => "Mogila", + "68" => "Murtino", + "69" => "Negotino", + "70" => "Negotino-Polosko", + "71" => "Novaci", + "72" => "Novo Selo", + "73" => "Oblesevo", + "74" => "Ohrid", + "75" => "Orasac", + "76" => "Orizari", + "77" => "Oslomej", + "78" => "Pehcevo", + "79" => "Petrovec", + "80" => "Plasnica", + "81" => "Podares", + "82" => "Prilep", + "83" => "Probistip", + "84" => "Radovis", + "85" => "Rankovce", + "86" => "Resen", + "87" => "Rosoman", + "88" => "Rostusa", + "89" => "Samokov", + "90" => "Saraj", + "91" => "Sipkovica", + "92" => "Sopiste", + "93" => "Sopotnica", + "94" => "Srbinovo", + "95" => "Staravina", + "96" => "Star Dojran", + "97" => "Staro Nagoricane", + "98" => "Stip", + "99" => "Struga", + "A1" => "Strumica", + "A2" => "Studenicani", + "A3" => "Suto Orizari", + "A4" => "Sveti Nikole", + "A5" => "Tearce", + "A6" => "Tetovo", + "A7" => "Topolcani", + "A8" => "Valandovo", + "A9" => "Vasilevo", + "B1" => "Veles", + "B2" => "Velesta", + "B3" => "Vevcani", + "B4" => "Vinica", + "B5" => "Vitoliste", + "B6" => "Vranestica", + "B7" => "Vrapciste", + "B8" => "Vratnica", + "B9" => "Vrutok", + "C1" => "Zajas", + "C2" => "Zelenikovo", + "C3" => "Zelino", + "C4" => "Zitose", + "C5" => "Zletovo", + "C6" => "Zrnovci"), +"ML" => array( + "01" => "Bamako", + "03" => "Kayes", + "04" => "Mopti", + "05" => "Segou", + "06" => "Sikasso", + "07" => "Koulikoro", + "08" => "Tombouctou", + "09" => "Gao", + "10" => "Kidal"), +"MM" => array( + "01" => "Rakhine State", + "02" => "Chin State", + "03" => "Irrawaddy", + "04" => "Kachin State", + "05" => "Karan State", + "06" => "Kayah State", + "07" => "Magwe", + "08" => "Mandalay", + "09" => "Pegu", + "10" => "Sagaing", + "11" => "Shan State", + "12" => "Tenasserim", + "13" => "Mon State", + "14" => "Rangoon", + "17" => "Yangon"), +"MN" => array( + "01" => "Arhangay", + "02" => "Bayanhongor", + "03" => "Bayan-Olgiy", + "05" => "Darhan", + "06" => "Dornod", + "07" => "Dornogovi", + "08" => "Dundgovi", + "09" => "Dzavhan", + "10" => "Govi-Altay", + "11" => "Hentiy", + "12" => "Hovd", + "13" => "Hovsgol", + "14" => "Omnogovi", + "15" => "Ovorhangay", + "16" => "Selenge", + "17" => "Suhbaatar", + "18" => "Tov", + "19" => "Uvs", + "20" => "Ulaanbaatar", + "21" => "Bulgan", + "22" => "Erdenet", + "23" => "Darhan-Uul", + "24" => "Govisumber", + "25" => "Orhon"), +"MO" => array( + "01" => "Ilhas", + "02" => "Macau"), +"MR" => array( + "01" => "Hodh Ech Chargui", + "02" => "Hodh El Gharbi", + "03" => "Assaba", + "04" => "Gorgol", + "05" => "Brakna", + "06" => "Trarza", + "07" => "Adrar", + "08" => "Dakhlet Nouadhibou", + "09" => "Tagant", + "10" => "Guidimaka", + "11" => "Tiris Zemmour", + "12" => "Inchiri"), +"MS" => array( + "01" => "Saint Anthony", + "02" => "Saint Georges", + "03" => "Saint Peter"), +"MU" => array( + "12" => "Black River", + "13" => "Flacq", + "14" => "Grand Port", + "15" => "Moka", + "16" => "Pamplemousses", + "17" => "Plaines Wilhems", + "18" => "Port Louis", + "19" => "Riviere du Rempart", + "20" => "Savanne", + "21" => "Agalega Islands", + "22" => "Cargados Carajos", + "23" => "Rodrigues"), +"MV" => array( + "01" => "Seenu", + "05" => "Laamu", + "30" => "Alifu", + "31" => "Baa", + "32" => "Dhaalu", + "33" => "Faafu ", + "34" => "Gaafu Alifu", + "35" => "Gaafu Dhaalu", + "36" => "Haa Alifu", + "37" => "Haa Dhaalu", + "38" => "Kaafu", + "39" => "Lhaviyani", + "40" => "Maale", + "41" => "Meemu", + "42" => "Gnaviyani", + "43" => "Noonu", + "44" => "Raa", + "45" => "Shaviyani", + "46" => "Thaa", + "47" => "Vaavu"), +"MW" => array( + "02" => "Chikwawa", + "03" => "Chiradzulu", + "04" => "Chitipa", + "05" => "Thyolo", + "06" => "Dedza", + "07" => "Dowa", + "08" => "Karonga", + "09" => "Kasungu", + "11" => "Lilongwe", + "12" => "Mangochi", + "13" => "Mchinji", + "15" => "Mzimba", + "16" => "Ntcheu", + "17" => "Nkhata Bay", + "18" => "Nkhotakota", + "19" => "Nsanje", + "20" => "Ntchisi", + "21" => "Rumphi", + "22" => "Salima", + "23" => "Zomba", + "24" => "Blantyre", + "25" => "Mwanza", + "26" => "Balaka", + "27" => "Likoma", + "28" => "Machinga", + "29" => "Mulanje", + "30" => "Phalombe"), +"MX" => array( + "01" => "Aguascalientes", + "02" => "Baja California", + "03" => "Baja California Sur", + "04" => "Campeche", + "05" => "Chiapas", + "06" => "Chihuahua", + "07" => "Coahuila de Zaragoza", + "08" => "Colima", + "09" => "Distrito Federal", + "10" => "Durango", + "11" => "Guanajuato", + "12" => "Guerrero", + "13" => "Hidalgo", + "14" => "Jalisco", + "15" => "Mexico", + "16" => "Michoacan de Ocampo", + "17" => "Morelos", + "18" => "Nayarit", + "19" => "Nuevo Leon", + "20" => "Oaxaca", + "21" => "Puebla", + "22" => "Queretaro de Arteaga", + "23" => "Quintana Roo", + "24" => "San Luis Potosi", + "25" => "Sinaloa", + "26" => "Sonora", + "27" => "Tabasco", + "28" => "Tamaulipas", + "29" => "Tlaxcala", + "30" => "Veracruz-Llave", + "31" => "Yucatan", + "32" => "Zacatecas"), +"MY" => array( + "01" => "Johor", + "02" => "Kedah", + "03" => "Kelantan", + "04" => "Melaka", + "05" => "Negeri Sembilan", + "06" => "Pahang", + "07" => "Perak", + "08" => "Perlis", + "09" => "Pulau Pinang", + "11" => "Sarawak", + "12" => "Selangor", + "13" => "Terengganu", + "14" => "Kuala Lumpur", + "15" => "Labuan", + "16" => "Sabah", + "17" => "Putrajaya"), +"MZ" => array( + "01" => "Cabo Delgado", + "02" => "Gaza", + "03" => "Inhambane", + "04" => "Maputo", + "05" => "Sofala", + "06" => "Nampula", + "07" => "Niassa", + "08" => "Tete", + "09" => "Zambezia", + "10" => "Manica", + "11" => "Maputo"), +"NA" => array( + "01" => "Bethanien", + "02" => "Caprivi Oos", + "03" => "Boesmanland", + "04" => "Gobabis", + "05" => "Grootfontein", + "06" => "Kaokoland", + "07" => "Karibib", + "08" => "Keetmanshoop", + "09" => "Luderitz", + "10" => "Maltahohe", + "11" => "Okahandja", + "12" => "Omaruru", + "13" => "Otjiwarongo", + "14" => "Outjo", + "15" => "Owambo", + "16" => "Rehoboth", + "17" => "Swakopmund", + "18" => "Tsumeb", + "20" => "Karasburg", + "21" => "Windhoek", + "22" => "Damaraland", + "23" => "Hereroland Oos", + "24" => "Hereroland Wes", + "25" => "Kavango", + "26" => "Mariental", + "27" => "Namaland", + "28" => "Caprivi", + "29" => "Erongo", + "30" => "Hardap", + "31" => "Karas", + "32" => "Kunene", + "33" => "Ohangwena", + "34" => "Okavango", + "35" => "Omaheke", + "36" => "Omusati", + "37" => "Oshana", + "38" => "Oshikoto", + "39" => "Otjozondjupa"), +"NE" => array( + "01" => "Agadez", + "02" => "Diffa", + "03" => "Dosso", + "04" => "Maradi", + "05" => "Niamey", + "06" => "Tahoua", + "07" => "Zinder", + "08" => "Niamey"), +"NG" => array( + "05" => "Lagos", + "11" => "Federal Capital Territory", + "16" => "Ogun", + "21" => "Akwa Ibom", + "22" => "Cross River", + "23" => "Kaduna", + "24" => "Katsina", + "25" => "Anambra", + "26" => "Benue", + "27" => "Borno", + "28" => "Imo", + "29" => "Kano", + "30" => "Kwara", + "31" => "Niger", + "32" => "Oyo", + "35" => "Adamawa", + "36" => "Delta", + "37" => "Edo", + "39" => "Jigawa", + "40" => "Kebbi", + "41" => "Kogi", + "42" => "Osun", + "43" => "Taraba", + "44" => "Yobe", + "45" => "Abia", + "46" => "Bauchi", + "47" => "Enugu", + "48" => "Ondo", + "49" => "Plateau", + "50" => "Rivers", + "51" => "Sokoto", + "52" => "Bayelsa", + "53" => "Ebonyi", + "54" => "Ekiti", + "55" => "Gombe", + "56" => "Nassarawa", + "57" => "Zamfara"), +"NI" => array( + "01" => "Boaco", + "02" => "Carazo", + "03" => "Chinandega", + "04" => "Chontales", + "05" => "Esteli", + "06" => "Granada", + "07" => "Jinotega", + "08" => "Leon", + "09" => "Madriz", + "10" => "Managua", + "11" => "Masaya", + "12" => "Matagalpa", + "13" => "Nueva Segovia", + "14" => "Rio San Juan", + "15" => "Rivas", + "16" => "Zelaya", + "17" => "Autonoma Atlantico Norte", + "18" => "Region Autonoma Atlantico Sur"), +"NL" => array( + "01" => "Drenthe", + "02" => "Friesland", + "03" => "Gelderland", + "04" => "Groningen", + "05" => "Limburg", + "06" => "Noord-Brabant", + "07" => "Noord-Holland", + "08" => "Overijssel", + "09" => "Utrecht", + "10" => "Zeeland", + "11" => "Zuid-Holland", + "15" => "Overijssel", + "16" => "Flevoland"), +"NO" => array( + "01" => "Akershus", + "02" => "Aust-Agder", + "04" => "Buskerud", + "05" => "Finnmark", + "06" => "Hedmark", + "07" => "Hordaland", + "08" => "More og Romsdal", + "09" => "Nordland", + "10" => "Nord-Trondelag", + "11" => "Oppland", + "12" => "Oslo", + "13" => "Ostfold", + "14" => "Rogaland", + "15" => "Sogn og Fjordane", + "16" => "Sor-Trondelag", + "17" => "Telemark", + "18" => "Troms", + "19" => "Vest-Agder", + "20" => "Vestfold"), +"NP" => array( + "01" => "Bagmati", + "02" => "Bheri", + "03" => "Dhawalagiri", + "04" => "Gandaki", + "05" => "Janakpur", + "06" => "Karnali", + "07" => "Kosi", + "08" => "Lumbini", + "09" => "Mahakali", + "10" => "Mechi", + "11" => "Narayani", + "12" => "Rapti", + "13" => "Sagarmatha", + "14" => "Seti"), +"NR" => array( + "01" => "Aiwo", + "02" => "Anabar", + "03" => "Anetan", + "04" => "Anibare", + "05" => "Baiti", + "06" => "Boe", + "07" => "Buada", + "08" => "Denigomodu", + "09" => "Ewa", + "10" => "Ijuw", + "11" => "Meneng", + "12" => "Nibok", + "13" => "Uaboe", + "14" => "Yaren"), +"NZ" => array( + "10" => "Chatham Islands", + "E7" => "Auckland", + "E8" => "Bay of Plenty", + "E9" => "Canterbury", + "F1" => "Gisborne", + "F2" => "Hawke's Bay", + "F3" => "Manawatu-Wanganui", + "F4" => "Marlborough", + "F5" => "Nelson", + "F6" => "Northland", + "F7" => "Otago", + "F8" => "Southland", + "F9" => "Taranaki", + "G1" => "Waikato", + "G2" => "Wellington", + "G3" => "West Coast"), +"OM" => array( + "01" => "Ad Dakhiliyah", + "02" => "Al Batinah", + "03" => "Al Wusta", + "04" => "Ash Sharqiyah", + "05" => "Az Zahirah", + "06" => "Masqat", + "07" => "Musandam", + "08" => "Zufar"), +"PA" => array( + "01" => "Bocas del Toro", + "02" => "Chiriqui", + "03" => "Cocle", + "04" => "Colon", + "05" => "Darien", + "06" => "Herrera", + "07" => "Los Santos", + "08" => "Panama", + "09" => "San Blas", + "10" => "Veraguas"), +"PE" => array( + "01" => "Amazonas", + "02" => "Ancash", + "03" => "Apurimac", + "04" => "Arequipa", + "05" => "Ayacucho", + "06" => "Cajamarca", + "07" => "Callao", + "08" => "Cusco", + "09" => "Huancavelica", + "10" => "Huanuco", + "11" => "Ica", + "12" => "Junin", + "13" => "La Libertad", + "14" => "Lambayeque", + "15" => "Lima", + "16" => "Loreto", + "17" => "Madre de Dios", + "18" => "Moquegua", + "19" => "Pasco", + "20" => "Piura", + "21" => "Puno", + "22" => "San Martin", + "23" => "Tacna", + "24" => "Tumbes", + "25" => "Ucayali"), +"PG" => array( + "01" => "Central", + "02" => "Gulf", + "03" => "Milne Bay", + "04" => "Northern", + "05" => "Southern Highlands", + "06" => "Western", + "07" => "North Solomons", + "08" => "Chimbu", + "09" => "Eastern Highlands", + "10" => "East New Britain", + "11" => "East Sepik", + "12" => "Madang", + "13" => "Manus", + "14" => "Morobe", + "15" => "New Ireland", + "16" => "Western Highlands", + "17" => "West New Britain", + "18" => "Sandaun", + "19" => "Enga", + "20" => "National Capital"), +"PH" => array( + "01" => "Abra", + "02" => "Agusan del Norte", + "03" => "Agusan del Sur", + "04" => "Aklan", + "05" => "Albay", + "06" => "Antique", + "07" => "Bataan", + "08" => "Batanes", + "09" => "Batangas", + "10" => "Benguet", + "11" => "Bohol", + "12" => "Bukidnon", + "13" => "Bulacan", + "14" => "Cagayan", + "15" => "Camarines Norte", + "16" => "Camarines Sur", + "17" => "Camiguin", + "18" => "Capiz", + "19" => "Catanduanes", + "20" => "Cavite", + "21" => "Cebu", + "22" => "Basilan", + "23" => "Eastern Samar", + "24" => "Davao", + "25" => "Davao del Sur", + "26" => "Davao Oriental", + "27" => "Ifugao", + "28" => "Ilocos Norte", + "29" => "Ilocos Sur", + "30" => "Iloilo", + "31" => "Isabela", + "32" => "Kalinga-Apayao", + "33" => "Laguna", + "34" => "Lanao del Norte", + "35" => "Lanao del Sur", + "36" => "La Union", + "37" => "Leyte", + "38" => "Marinduque", + "39" => "Masbate", + "40" => "Mindoro Occidental", + "41" => "Mindoro Oriental", + "42" => "Misamis Occidental", + "43" => "Misamis Oriental", + "44" => "Mountain", + "45" => "Negros Occidental", + "46" => "Negros Oriental", + "47" => "Nueva Ecija", + "48" => "Nueva Vizcaya", + "49" => "Palawan", + "50" => "Pampanga", + "51" => "Pangasinan", + "53" => "Rizal", + "54" => "Romblon", + "55" => "Samar", + "56" => "Maguindanao", + "57" => "North Cotabato", + "58" => "Sorsogon", + "59" => "Southern Leyte", + "60" => "Sulu", + "61" => "Surigao del Norte", + "62" => "Surigao del Sur", + "63" => "Tarlac", + "64" => "Zambales", + "65" => "Zamboanga del Norte", + "66" => "Zamboanga del Sur", + "67" => "Northern Samar", + "68" => "Quirino", + "69" => "Siquijor", + "70" => "South Cotabato", + "71" => "Sultan Kudarat", + "72" => "Tawitawi", + "A1" => "Angeles", + "A2" => "Bacolod", + "A3" => "Bago", + "A4" => "Baguio", + "A5" => "Bais", + "A6" => "Basilan City", + "A7" => "Batangas City", + "A8" => "Butuan", + "A9" => "Cabanatuan", + "B1" => "Cadiz", + "B2" => "Cagayan de Oro", + "B3" => "Calbayog", + "B4" => "Caloocan", + "B5" => "Canlaon", + "B6" => "Cavite City", + "B7" => "Cebu City", + "B8" => "Cotabato", + "B9" => "Dagupan", + "C1" => "Danao", + "C2" => "Dapitan", + "C3" => "Davao City", + "C4" => "Dipolog", + "C5" => "Dumaguete", + "C6" => "General Santos", + "C7" => "Gingoog", + "C8" => "Iligan", + "C9" => "Iloilo City", + "D1" => "Iriga", + "D2" => "La Carlota", + "D3" => "Laoag", + "D4" => "Lapu-Lapu", + "D5" => "Legaspi", + "D6" => "Lipa", + "D7" => "Lucena", + "D8" => "Mandaue", + "D9" => "Manila", + "E1" => "Marawi", + "E2" => "Naga", + "E3" => "Olongapo", + "E4" => "Ormoc", + "E5" => "Oroquieta", + "E6" => "Ozamis", + "E7" => "Pagadian", + "E8" => "Palayan", + "E9" => "Pasay", + "F1" => "Puerto Princesa", + "F2" => "Quezon City", + "F3" => "Roxas", + "F4" => "San Carlos", + "F5" => "San Carlos", + "F6" => "San Jose", + "F7" => "San Pablo", + "F8" => "Silay", + "F9" => "Surigao", + "G1" => "Tacloban", + "G2" => "Tagaytay", + "G3" => "Tagbilaran", + "G4" => "Tangub", + "G5" => "Toledo", + "G6" => "Trece Martires", + "G7" => "Zamboanga", + "G8" => "Aurora", + "H2" => "Quezon", + "H3" => "Negros Occidental"), +"PK" => array( + "01" => "Federally Administered Tribal Areas", + "02" => "Balochistan", + "03" => "North-West Frontier", + "04" => "Punjab", + "05" => "Sindh", + "06" => "Azad Kashmir", + "07" => "Northern Areas", + "08" => "Islamabad"), +"PL" => array( + "72" => "Dolnoslaskie", + "73" => "Kujawsko-Pomorskie", + "74" => "Lodzkie", + "75" => "Lubelskie", + "76" => "Lubuskie", + "77" => "Malopolskie", + "78" => "Mazowieckie", + "79" => "Opolskie", + "80" => "Podkarpackie", + "81" => "Podlaskie", + "82" => "Pomorskie", + "83" => "Slaskie", + "84" => "Swietokrzyskie", + "85" => "Warminsko-Mazurskie", + "86" => "Wielkopolskie", + "87" => "Zachodniopomorskie"), +"PS" => array( + "GZ" => "Gaza", + "WE" => "West Bank"), +"PT" => array( + "02" => "Aveiro", + "03" => "Beja", + "04" => "Braga", + "05" => "Braganca", + "06" => "Castelo Branco", + "07" => "Coimbra", + "08" => "Evora", + "09" => "Faro", + "10" => "Madeira", + "11" => "Guarda", + "13" => "Leiria", + "14" => "Lisboa", + "16" => "Portalegre", + "17" => "Porto", + "18" => "Santarem", + "19" => "Setubal", + "20" => "Viana do Castelo", + "21" => "Vila Real", + "22" => "Viseu", + "23" => "Azores"), +"PY" => array( + "01" => "Alto Parana", + "02" => "Amambay", + "03" => "Boqueron", + "04" => "Caaguazu", + "05" => "Caazapa", + "06" => "Central", + "07" => "Concepcion", + "08" => "Cordillera", + "10" => "Guaira", + "11" => "Itapua", + "12" => "Misiones", + "13" => "Neembucu", + "15" => "Paraguari", + "16" => "Presidente Hayes", + "17" => "San Pedro", + "19" => "Canindeyu", + "20" => "Chaco", + "21" => "Nueva Asuncion", + "23" => "Alto Paraguay"), +"QA" => array( + "01" => "Ad Dawhah", + "02" => "Al Ghuwariyah", + "03" => "Al Jumaliyah", + "04" => "Al Khawr", + "05" => "Al Wakrah Municipality", + "06" => "Ar Rayyan", + "08" => "Madinat ach Shamal", + "09" => "Umm Salal", + "10" => "Al Wakrah", + "11" => "Jariyan al Batnah", + "12" => "Umm Sa'id"), +"RO" => array( + "01" => "Alba", + "02" => "Arad", + "03" => "Arges", + "04" => "Bacau", + "05" => "Bihor", + "06" => "Bistrita-Nasaud", + "07" => "Botosani", + "08" => "Braila", + "09" => "Brasov", + "10" => "Bucuresti", + "11" => "Buzau", + "12" => "Caras-Severin", + "13" => "Cluj", + "14" => "Constanta", + "15" => "Covasna", + "16" => "Dambovita", + "17" => "Dolj", + "18" => "Galati", + "19" => "Gorj", + "20" => "Harghita", + "21" => "Hunedoara", + "22" => "Ialomita", + "23" => "Iasi", + "25" => "Maramures", + "26" => "Mehedinti", + "27" => "Mures", + "28" => "Neamt", + "29" => "Olt", + "30" => "Prahova", + "31" => "Salaj", + "32" => "Satu Mare", + "33" => "Sibiu", + "34" => "Suceava", + "35" => "Teleorman", + "36" => "Timis", + "37" => "Tulcea", + "38" => "Vaslui", + "39" => "Valcea", + "40" => "Vrancea", + "41" => "Calarasi", + "42" => "Giurgiu", + "43" => "Ilfov"), +"RS" => array( + "01" => "Kosovo", + "02" => "Vojvodina"), +"RU" => array( + "01" => "Adygeya, Republic of", + "02" => "Aginsky Buryatsky AO", + "03" => "Gorno-Altay", + "04" => "Altaisky krai", + "05" => "Amur", + "06" => "Arkhangel'sk", + "07" => "Astrakhan'", + "08" => "Bashkortostan", + "09" => "Belgorod", + "10" => "Bryansk", + "11" => "Buryat", + "12" => "Chechnya", + "13" => "Chelyabinsk", + "14" => "Chita", + "15" => "Chukot", + "16" => "Chuvashia", + "17" => "Dagestan", + "18" => "Evenk", + "19" => "Ingush", + "20" => "Irkutsk", + "21" => "Ivanovo", + "22" => "Kabardin-Balkar", + "23" => "Kaliningrad", + "24" => "Kalmyk", + "25" => "Kaluga", + "26" => "Kamchatka", + "27" => "Karachay-Cherkess", + "28" => "Karelia", + "29" => "Kemerovo", + "30" => "Khabarovsk", + "31" => "Khakass", + "32" => "Khanty-Mansiy", + "33" => "Kirov", + "34" => "Komi", + "35" => "Komi-Permyak", + "36" => "Koryak", + "37" => "Kostroma", + "38" => "Krasnodar", + "39" => "Krasnoyarsk", + "40" => "Kurgan", + "41" => "Kursk", + "42" => "Leningrad", + "43" => "Lipetsk", + "44" => "Magadan", + "45" => "Mariy-El", + "46" => "Mordovia", + "47" => "Moskva", + "48" => "Moscow City", + "49" => "Murmansk", + "50" => "Nenets", + "51" => "Nizhegorod", + "52" => "Novgorod", + "53" => "Novosibirsk", + "54" => "Omsk", + "55" => "Orenburg", + "56" => "Orel", + "57" => "Penza", + "58" => "Perm'", + "59" => "Primor'ye", + "60" => "Pskov", + "61" => "Rostov", + "62" => "Ryazan'", + "63" => "Sakha", + "64" => "Sakhalin", + "65" => "Samara", + "66" => "Saint Petersburg City", + "67" => "Saratov", + "68" => "North Ossetia", + "69" => "Smolensk", + "70" => "Stavropol'", + "71" => "Sverdlovsk", + "72" => "Tambovskaya oblast", + "73" => "Tatarstan", + "74" => "Taymyr", + "75" => "Tomsk", + "76" => "Tula", + "77" => "Tver'", + "78" => "Tyumen'", + "79" => "Tuva", + "80" => "Udmurt", + "81" => "Ul'yanovsk", + "82" => "Ust-Orda Buryat", + "83" => "Vladimir", + "84" => "Volgograd", + "85" => "Vologda", + "86" => "Voronezh", + "87" => "Yamal-Nenets", + "88" => "Yaroslavl'", + "89" => "Yevrey", + "90" => "Permskiy Kray", + "91" => "Krasnoyarskiy Kray", + "CI" => "Chechnya Republic"), +"RW" => array( + "01" => "Butare", + "06" => "Gitarama", + "07" => "Kibungo", + "09" => "Kigali", + "11" => "Est", + "12" => "Kigali", + "13" => "Nord", + "14" => "Ouest", + "15" => "Sud"), +"SA" => array( + "02" => "Al Bahah", + "03" => "Al Jawf", + "05" => "Al Madinah", + "06" => "Ash Sharqiyah", + "08" => "Al Qasim", + "09" => "Al Qurayyat", + "10" => "Ar Riyad", + "13" => "Ha'il", + "14" => "Makkah", + "15" => "Al Hudud ash Shamaliyah", + "16" => "Najran", + "17" => "Jizan", + "19" => "Tabuk", + "20" => "Al Jawf"), +"SB" => array( + "03" => "Malaita", + "06" => "Guadalcanal", + "07" => "Isabel", + "08" => "Makira", + "09" => "Temotu", + "10" => "Central", + "11" => "Western", + "12" => "Choiseul", + "13" => "Rennell and Bellona"), +"SC" => array( + "01" => "Anse aux Pins", + "02" => "Anse Boileau", + "03" => "Anse Etoile", + "04" => "Anse Louis", + "05" => "Anse Royale", + "06" => "Baie Lazare", + "07" => "Baie Sainte Anne", + "08" => "Beau Vallon", + "09" => "Bel Air", + "10" => "Bel Ombre", + "11" => "Cascade", + "12" => "Glacis", + "13" => "Grand' Anse", + "14" => "Grand' Anse", + "15" => "La Digue", + "16" => "La Riviere Anglaise", + "17" => "Mont Buxton", + "18" => "Mont Fleuri", + "19" => "Plaisance", + "20" => "Pointe La Rue", + "21" => "Port Glaud", + "22" => "Saint Louis", + "23" => "Takamaka"), +"SD" => array( + "27" => "Al Wusta", + "28" => "Al Istiwa'iyah", + "29" => "Al Khartum", + "30" => "Ash Shamaliyah", + "31" => "Ash Sharqiyah", + "32" => "Bahr al Ghazal", + "33" => "Darfur", + "34" => "Kurdufan", + "35" => "Upper Nile", + "40" => "Al Wahadah State", + "44" => "Central Equatoria State"), +"SE" => array( + "02" => "Blekinge Lan", + "03" => "Gavleborgs Lan", + "05" => "Gotlands Lan", + "06" => "Hallands Lan", + "07" => "Jamtlands Lan", + "08" => "Jonkopings Lan", + "09" => "Kalmar Lan", + "10" => "Dalarnas Lan", + "12" => "Kronobergs Lan", + "14" => "Norrbottens Lan", + "15" => "Orebro Lan", + "16" => "Ostergotlands Lan", + "18" => "Sodermanlands Lan", + "21" => "Uppsala Lan", + "22" => "Varmlands Lan", + "23" => "Vasterbottens Lan", + "24" => "Vasternorrlands Lan", + "25" => "Vastmanlands Lan", + "26" => "Stockholms Lan", + "27" => "Skane Lan", + "28" => "Vastra Gotaland"), +"SH" => array( + "01" => "Ascension", + "02" => "Saint Helena", + "03" => "Tristan da Cunha"), +"SI" => array( + "01" => "Ajdovscina", + "02" => "Beltinci", + "03" => "Bled", + "04" => "Bohinj", + "05" => "Borovnica", + "06" => "Bovec", + "07" => "Brda", + "08" => "Brezice", + "09" => "Brezovica", + "11" => "Celje", + "12" => "Cerklje na Gorenjskem", + "13" => "Cerknica", + "14" => "Cerkno", + "15" => "Crensovci", + "16" => "Crna na Koroskem", + "17" => "Crnomelj", + "19" => "Divaca", + "20" => "Dobrepolje", + "22" => "Dol pri Ljubljani", + "24" => "Dornava", + "25" => "Dravograd", + "26" => "Duplek", + "27" => "Gorenja Vas-Poljane", + "28" => "Gorisnica", + "29" => "Gornja Radgona", + "30" => "Gornji Grad", + "31" => "Gornji Petrovci", + "32" => "Grosuplje", + "34" => "Hrastnik", + "35" => "Hrpelje-Kozina", + "36" => "Idrija", + "37" => "Ig", + "38" => "Ilirska Bistrica", + "39" => "Ivancna Gorica", + "40" => "Izola-Isola", + "42" => "Jursinci", + "44" => "Kanal", + "45" => "Kidricevo", + "46" => "Kobarid", + "47" => "Kobilje", + "49" => "Komen", + "50" => "Koper-Capodistria", + "51" => "Kozje", + "52" => "Kranj", + "53" => "Kranjska Gora", + "54" => "Krsko", + "55" => "Kungota", + "57" => "Lasko", + "61" => "Ljubljana", + "62" => "Ljubno", + "64" => "Logatec", + "66" => "Loski Potok", + "68" => "Lukovica", + "71" => "Medvode", + "72" => "Menges", + "73" => "Metlika", + "74" => "Mezica", + "76" => "Mislinja", + "77" => "Moravce", + "78" => "Moravske Toplice", + "79" => "Mozirje", + "80" => "Murska Sobota", + "81" => "Muta", + "82" => "Naklo", + "83" => "Nazarje", + "84" => "Nova Gorica", + "86" => "Odranci", + "87" => "Ormoz", + "88" => "Osilnica", + "89" => "Pesnica", + "91" => "Pivka", + "92" => "Podcetrtek", + "94" => "Postojna", + "97" => "Puconci", + "98" => "Racam", + "99" => "Radece", + "A1" => "Radenci", + "A2" => "Radlje ob Dravi", + "A3" => "Radovljica", + "A6" => "Rogasovci", + "A7" => "Rogaska Slatina", + "A8" => "Rogatec", + "B1" => "Semic", + "B2" => "Sencur", + "B3" => "Sentilj", + "B4" => "Sentjernej", + "B6" => "Sevnica", + "B7" => "Sezana", + "B8" => "Skocjan", + "B9" => "Skofja Loka", + "C1" => "Skofljica", + "C2" => "Slovenj Gradec", + "C4" => "Slovenske Konjice", + "C5" => "Smarje pri Jelsah", + "C6" => "Smartno ob Paki", + "C7" => "Sostanj", + "C8" => "Starse", + "C9" => "Store", + "D1" => "Sveti Jurij", + "D2" => "Tolmin", + "D3" => "Trbovlje", + "D4" => "Trebnje", + "D5" => "Trzic", + "D6" => "Turnisce", + "D7" => "Velenje", + "D8" => "Velike Lasce", + "E1" => "Vipava", + "E2" => "Vitanje", + "E3" => "Vodice", + "E5" => "Vrhnika", + "E6" => "Vuzenica", + "E7" => "Zagorje ob Savi", + "E9" => "Zavrc", + "F1" => "Zelezniki", + "F2" => "Ziri", + "F3" => "Zrece", + "G4" => "Dobrova-Horjul-Polhov Gradec", + "G7" => "Domzale", + "H4" => "Jesenice", + "H6" => "Kamnik", + "H7" => "Kocevje", + "I2" => "Kuzma", + "I3" => "Lenart", + "I5" => "Litija", + "I6" => "Ljutomer", + "I7" => "Loska Dolina", + "I9" => "Luce", + "J1" => "Majsperk", + "J2" => "Maribor", + "J5" => "Miren-Kostanjevica", + "J7" => "Novo Mesto", + "J9" => "Piran", + "K5" => "Preddvor", + "K7" => "Ptuj", + "L1" => "Ribnica", + "L3" => "Ruse", + "L7" => "Sentjur pri Celju", + "L8" => "Slovenska Bistrica", + "N2" => "Videm", + "N3" => "Vojnik", + "N5" => "Zalec"), +"SK" => array( + "01" => "Banska Bystrica", + "02" => "Bratislava", + "03" => "Kosice", + "04" => "Nitra", + "05" => "Presov", + "06" => "Trencin", + "07" => "Trnava", + "08" => "Zilina"), +"SL" => array( + "01" => "Eastern", + "02" => "Northern", + "03" => "Southern", + "04" => "Western Area"), +"SM" => array( + "01" => "Acquaviva", + "02" => "Chiesanuova", + "03" => "Domagnano", + "04" => "Faetano", + "05" => "Fiorentino", + "06" => "Borgo Maggiore", + "07" => "San Marino", + "08" => "Monte Giardino", + "09" => "Serravalle"), +"SN" => array( + "01" => "Dakar", + "03" => "Diourbel", + "05" => "Tambacounda", + "07" => "Thies", + "09" => "Fatick", + "10" => "Kaolack", + "11" => "Kolda", + "12" => "Ziguinchor", + "13" => "Louga", + "14" => "Saint-Louis", + "15" => "Matam"), +"SO" => array( + "01" => "Bakool", + "02" => "Banaadir", + "03" => "Bari", + "04" => "Bay", + "05" => "Galguduud", + "06" => "Gedo", + "07" => "Hiiraan", + "08" => "Jubbada Dhexe", + "09" => "Jubbada Hoose", + "10" => "Mudug", + "11" => "Nugaal", + "12" => "Sanaag", + "13" => "Shabeellaha Dhexe", + "14" => "Shabeellaha Hoose", + "16" => "Woqooyi Galbeed", + "18" => "Nugaal", + "19" => "Togdheer", + "20" => "Woqooyi Galbeed", + "21" => "Awdal", + "22" => "Sool"), +"SR" => array( + "10" => "Brokopondo", + "11" => "Commewijne", + "12" => "Coronie", + "13" => "Marowijne", + "14" => "Nickerie", + "15" => "Para", + "16" => "Paramaribo", + "17" => "Saramacca", + "18" => "Sipaliwini", + "19" => "Wanica"), +"ST" => array( + "01" => "Principe", + "02" => "Sao Tome"), +"SV" => array( + "01" => "Ahuachapan", + "02" => "Cabanas", + "03" => "Chalatenango", + "04" => "Cuscatlan", + "05" => "La Libertad", + "06" => "La Paz", + "07" => "La Union", + "08" => "Morazan", + "09" => "San Miguel", + "10" => "San Salvador", + "11" => "Santa Ana", + "12" => "San Vicente", + "13" => "Sonsonate", + "14" => "Usulutan"), +"SY" => array( + "01" => "Al Hasakah", + "02" => "Al Ladhiqiyah", + "03" => "Al Qunaytirah", + "04" => "Ar Raqqah", + "05" => "As Suwayda'", + "06" => "Dar", + "07" => "Dayr az Zawr", + "08" => "Rif Dimashq", + "09" => "Halab", + "10" => "Hamah", + "11" => "Hims", + "12" => "Idlib", + "13" => "Dimashq", + "14" => "Tartus"), +"SZ" => array( + "01" => "Hhohho", + "02" => "Lubombo", + "03" => "Manzini", + "04" => "Shiselweni", + "05" => "Praslin"), +"TD" => array( + "01" => "Batha", + "02" => "Biltine", + "03" => "Borkou-Ennedi-Tibesti", + "04" => "Chari-Baguirmi", + "05" => "Guera", + "06" => "Kanem", + "07" => "Lac", + "08" => "Logone Occidental", + "09" => "Logone Oriental", + "10" => "Mayo-Kebbi", + "11" => "Moyen-Chari", + "12" => "Ouaddai", + "13" => "Salamat", + "14" => "Tandjile"), +"TG" => array( + "22" => "Centrale", + "23" => "Kara", + "24" => "Maritime", + "25" => "Plateaux", + "26" => "Savanes"), +"TH" => array( + "01" => "Mae Hong Son", + "02" => "Chiang Mai", + "03" => "Chiang Rai", + "04" => "Nan", + "05" => "Lamphun", + "06" => "Lampang", + "07" => "Phrae", + "08" => "Tak", + "09" => "Sukhothai", + "10" => "Uttaradit", + "11" => "Kamphaeng Phet", + "12" => "Phitsanulok", + "13" => "Phichit", + "14" => "Phetchabun", + "15" => "Uthai Thani", + "16" => "Nakhon Sawan", + "17" => "Nong Khai", + "18" => "Loei", + "20" => "Sakon Nakhon", + "21" => "Nakhon Phanom", + "22" => "Khon Kaen", + "23" => "Kalasin", + "24" => "Maha Sarakham", + "25" => "Roi Et", + "26" => "Chaiyaphum", + "27" => "Nakhon Ratchasima", + "28" => "Buriram", + "29" => "Surin", + "30" => "Sisaket", + "31" => "Narathiwat", + "32" => "Chai Nat", + "33" => "Sing Buri", + "34" => "Lop Buri", + "35" => "Ang Thong", + "36" => "Phra Nakhon Si Ayutthaya", + "37" => "Saraburi", + "38" => "Nonthaburi", + "39" => "Pathum Thani", + "40" => "Krung Thep", + "41" => "Phayao", + "42" => "Samut Prakan", + "43" => "Nakhon Nayok", + "44" => "Chachoengsao", + "45" => "Prachin Buri", + "46" => "Chon Buri", + "47" => "Rayong", + "48" => "Chanthaburi", + "49" => "Trat", + "50" => "Kanchanaburi", + "51" => "Suphan Buri", + "52" => "Ratchaburi", + "53" => "Nakhon Pathom", + "54" => "Samut Songkhram", + "55" => "Samut Sakhon", + "56" => "Phetchaburi", + "57" => "Prachuap Khiri Khan", + "58" => "Chumphon", + "59" => "Ranong", + "60" => "Surat Thani", + "61" => "Phangnga", + "62" => "Phuket", + "63" => "Krabi", + "64" => "Nakhon Si Thammarat", + "65" => "Trang", + "66" => "Phatthalung", + "67" => "Satun", + "68" => "Songkhla", + "69" => "Pattani", + "70" => "Yala", + "71" => "Ubon Ratchathani", + "72" => "Yasothon", + "73" => "Nakhon Phanom", + "75" => "Ubon Ratchathani", + "76" => "Udon Thani", + "77" => "Amnat Charoen", + "78" => "Mukdahan", + "79" => "Nong Bua Lamphu", + "80" => "Sa Kaeo"), +"TJ" => array( + "01" => "Kuhistoni Badakhshon", + "02" => "Khatlon", + "03" => "Sughd"), +"TM" => array( + "01" => "Ahal", + "02" => "Balkan", + "03" => "Dashoguz", + "04" => "Lebap", + "05" => "Mary"), +"TN" => array( + "02" => "Kasserine", + "03" => "Kairouan", + "06" => "Jendouba", + "10" => "Qafsah", + "14" => "El Kef", + "15" => "Al Mahdia", + "16" => "Al Munastir", + "17" => "Bajah", + "18" => "Bizerte", + "19" => "Nabeul", + "22" => "Siliana", + "23" => "Sousse", + "27" => "Ben Arous", + "28" => "Madanin", + "29" => "Gabes", + "31" => "Kebili", + "32" => "Sfax", + "33" => "Sidi Bou Zid", + "34" => "Tataouine", + "35" => "Tozeur", + "36" => "Tunis", + "37" => "Zaghouan", + "38" => "Aiana", + "39" => "Manouba"), +"TO" => array( + "01" => "Ha", + "02" => "Tongatapu", + "03" => "Vava"), +"TR" => array( + "02" => "Adiyaman", + "03" => "Afyonkarahisar", + "04" => "Agri", + "05" => "Amasya", + "07" => "Antalya", + "08" => "Artvin", + "09" => "Aydin", + "10" => "Balikesir", + "11" => "Bilecik", + "12" => "Bingol", + "13" => "Bitlis", + "14" => "Bolu", + "15" => "Burdur", + "16" => "Bursa", + "17" => "Canakkale", + "19" => "Corum", + "20" => "Denizli", + "21" => "Diyarbakir", + "22" => "Edirne", + "23" => "Elazig", + "24" => "Erzincan", + "25" => "Erzurum", + "26" => "Eskisehir", + "28" => "Giresun", + "31" => "Hatay", + "32" => "Mersin", + "33" => "Isparta", + "34" => "Istanbul", + "35" => "Izmir", + "37" => "Kastamonu", + "38" => "Kayseri", + "39" => "Kirklareli", + "40" => "Kirsehir", + "41" => "Kocaeli", + "43" => "Kutahya", + "44" => "Malatya", + "45" => "Manisa", + "46" => "Kahramanmaras", + "48" => "Mugla", + "49" => "Mus", + "50" => "Nevsehir", + "52" => "Ordu", + "53" => "Rize", + "54" => "Sakarya", + "55" => "Samsun", + "57" => "Sinop", + "58" => "Sivas", + "59" => "Tekirdag", + "60" => "Tokat", + "61" => "Trabzon", + "62" => "Tunceli", + "63" => "Sanliurfa", + "64" => "Usak", + "65" => "Van", + "66" => "Yozgat", + "68" => "Ankara", + "69" => "Gumushane", + "70" => "Hakkari", + "71" => "Konya", + "72" => "Mardin", + "73" => "Nigde", + "74" => "Siirt", + "75" => "Aksaray", + "76" => "Batman", + "77" => "Bayburt", + "78" => "Karaman", + "79" => "Kirikkale", + "80" => "Sirnak", + "81" => "Adana", + "82" => "Cankiri", + "83" => "Gaziantep", + "84" => "Kars", + "85" => "Zonguldak", + "86" => "Ardahan", + "87" => "Bartin", + "88" => "Igdir", + "89" => "Karabuk", + "90" => "Kilis", + "91" => "Osmaniye", + "92" => "Yalova", + "93" => "Duzce"), +"TT" => array( + "01" => "Arima", + "02" => "Caroni", + "03" => "Mayaro", + "04" => "Nariva", + "05" => "Port-of-Spain", + "06" => "Saint Andrew", + "07" => "Saint David", + "08" => "Saint George", + "09" => "Saint Patrick", + "10" => "San Fernando", + "11" => "Tobago", + "12" => "Victoria"), +"TW" => array( + "01" => "Fu-chien", + "02" => "Kao-hsiung", + "03" => "T'ai-pei", + "04" => "T'ai-wan"), +"TZ" => array( + "02" => "Pwani", + "03" => "Dodoma", + "04" => "Iringa", + "05" => "Kigoma", + "06" => "Kilimanjaro", + "07" => "Lindi", + "08" => "Mara", + "09" => "Mbeya", + "10" => "Morogoro", + "11" => "Mtwara", + "12" => "Mwanza", + "13" => "Pemba North", + "14" => "Ruvuma", + "15" => "Shinyanga", + "16" => "Singida", + "17" => "Tabora", + "18" => "Tanga", + "19" => "Kagera", + "20" => "Pemba South", + "21" => "Zanzibar Central", + "22" => "Zanzibar North", + "23" => "Dar es Salaam", + "24" => "Rukwa", + "25" => "Zanzibar Urban", + "26" => "Arusha", + "27" => "Manyara"), +"UA" => array( + "01" => "Cherkas'ka Oblast'", + "02" => "Chernihivs'ka Oblast'", + "03" => "Chernivets'ka Oblast'", + "04" => "Dnipropetrovs'ka Oblast'", + "05" => "Donets'ka Oblast'", + "06" => "Ivano-Frankivs'ka Oblast'", + "07" => "Kharkivs'ka Oblast'", + "08" => "Khersons'ka Oblast'", + "09" => "Khmel'nyts'ka Oblast'", + "10" => "Kirovohrads'ka Oblast'", + "11" => "Krym", + "12" => "Kyyiv", + "13" => "Kyyivs'ka Oblast'", + "14" => "Luhans'ka Oblast'", + "15" => "L'vivs'ka Oblast'", + "16" => "Mykolayivs'ka Oblast'", + "17" => "Odes'ka Oblast'", + "18" => "Poltavs'ka Oblast'", + "19" => "Rivnens'ka Oblast'", + "20" => "Sevastopol'", + "21" => "Sums'ka Oblast'", + "22" => "Ternopil's'ka Oblast'", + "23" => "Vinnyts'ka Oblast'", + "24" => "Volyns'ka Oblast'", + "25" => "Zakarpats'ka Oblast'", + "26" => "Zaporiz'ka Oblast'", + "27" => "Zhytomyrs'ka Oblast'"), +"UG" => array( + "26" => "Apac", + "28" => "Bundibugyo", + "29" => "Bushenyi", + "30" => "Gulu", + "31" => "Hoima", + "33" => "Jinja", + "36" => "Kalangala", + "37" => "Kampala", + "38" => "Kamuli", + "39" => "Kapchorwa", + "40" => "Kasese", + "41" => "Kibale", + "42" => "Kiboga", + "43" => "Kisoro", + "45" => "Kotido", + "46" => "Kumi", + "47" => "Lira", + "50" => "Masindi", + "52" => "Mbarara", + "56" => "Mubende", + "58" => "Nebbi", + "59" => "Ntungamo", + "60" => "Pallisa", + "61" => "Rakai", + "65" => "Adjumani", + "66" => "Bugiri", + "67" => "Busia", + "69" => "Katakwi", + "70" => "Luwero", + "71" => "Masaka", + "72" => "Moyo", + "73" => "Nakasongola", + "74" => "Sembabule", + "76" => "Tororo", + "77" => "Arua", + "78" => "Iganga", + "79" => "Kabarole", + "80" => "Kaberamaido", + "81" => "Kamwenge", + "82" => "Kanungu", + "83" => "Kayunga", + "84" => "Kitgum", + "85" => "Kyenjojo", + "86" => "Mayuge", + "87" => "Mbale", + "88" => "Moroto", + "89" => "Mpigi", + "90" => "Mukono", + "91" => "Nakapiripirit", + "92" => "Pader", + "93" => "Rukungiri", + "94" => "Sironko", + "95" => "Soroti", + "96" => "Wakiso", + "97" => "Yumbe"), +"US" => array( + "AA" => "Armed Forces Americas", + "AE" => "Armed Forces Europe, Middle East, & Canada", + "AK" => "Alaska", + "AL" => "Alabama", + "AP" => "Armed Forces Pacific", + "AR" => "Arkansas", + "AS" => "American Samoa", + "AZ" => "Arizona", + "CA" => "California", + "CO" => "Colorado", + "CT" => "Connecticut", + "DC" => "District of Columbia", + "DE" => "Delaware", + "FL" => "Florida", + "FM" => "Federated States of Micronesia", + "GA" => "Georgia", + "GU" => "Guam", + "HI" => "Hawaii", + "IA" => "Iowa", + "ID" => "Idaho", + "IL" => "Illinois", + "IN" => "Indiana", + "KS" => "Kansas", + "KY" => "Kentucky", + "LA" => "Louisiana", + "MA" => "Massachusetts", + "MD" => "Maryland", + "ME" => "Maine", + "MH" => "Marshall Islands", + "MI" => "Michigan", + "MN" => "Minnesota", + "MO" => "Missouri", + "MP" => "Northern Mariana Islands", + "MS" => "Mississippi", + "MT" => "Montana", + "NC" => "North Carolina", + "ND" => "North Dakota", + "NE" => "Nebraska", + "NH" => "New Hampshire", + "NJ" => "New Jersey", + "NM" => "New Mexico", + "NV" => "Nevada", + "NY" => "New York", + "OH" => "Ohio", + "OK" => "Oklahoma", + "OR" => "Oregon", + "PA" => "Pennsylvania", + "PR" => "Puerto Rico", + "PW" => "Palau", + "RI" => "Rhode Island", + "SC" => "South Carolina", + "SD" => "South Dakota", + "TN" => "Tennessee", + "TX" => "Texas", + "UT" => "Utah", + "VA" => "Virginia", + "VI" => "Virgin Islands", + "VT" => "Vermont", + "WA" => "Washington", + "WI" => "Wisconsin", + "WV" => "West Virginia", + "WY" => "Wyoming"), +"UY" => array( + "01" => "Artigas", + "02" => "Canelones", + "03" => "Cerro Largo", + "04" => "Colonia", + "05" => "Durazno", + "06" => "Flores", + "07" => "Florida", + "08" => "Lavalleja", + "09" => "Maldonado", + "10" => "Montevideo", + "11" => "Paysandu", + "12" => "Rio Negro", + "13" => "Rivera", + "14" => "Rocha", + "15" => "Salto", + "16" => "San Jose", + "17" => "Soriano", + "18" => "Tacuarembo", + "19" => "Treinta y Tres"), +"UZ" => array( + "01" => "Andijon", + "02" => "Bukhoro", + "03" => "Farghona", + "04" => "Jizzakh", + "05" => "Khorazm", + "06" => "Namangan", + "07" => "Nawoiy", + "08" => "Qashqadaryo", + "09" => "Qoraqalpoghiston", + "10" => "Samarqand", + "11" => "Sirdaryo", + "12" => "Surkhondaryo", + "13" => "Toshkent", + "14" => "Toshkent"), +"VC" => array( + "01" => "Charlotte", + "02" => "Saint Andrew", + "03" => "Saint David", + "04" => "Saint George", + "05" => "Saint Patrick", + "06" => "Grenadines"), +"VE" => array( + "01" => "Amazonas", + "02" => "Anzoategui", + "03" => "Apure", + "04" => "Aragua", + "05" => "Barinas", + "06" => "Bolivar", + "07" => "Carabobo", + "08" => "Cojedes", + "09" => "Delta Amacuro", + "11" => "Falcon", + "12" => "Guarico", + "13" => "Lara", + "14" => "Merida", + "15" => "Miranda", + "16" => "Monagas", + "17" => "Nueva Esparta", + "18" => "Portuguesa", + "19" => "Sucre", + "20" => "Tachira", + "21" => "Trujillo", + "22" => "Yaracuy", + "23" => "Zulia", + "24" => "Dependencias Federales", + "25" => "Distrito Federal", + "26" => "Vargas"), +"VN" => array( + "01" => "An Giang", + "03" => "Ben Tre", + "05" => "Cao Bang", + "09" => "Dong Thap", + "13" => "Hai Phong", + "20" => "Ho Chi Minh", + "21" => "Kien Giang", + "23" => "Lam Dong", + "24" => "Long An", + "30" => "Quang Ninh", + "32" => "Son La", + "33" => "Tay Ninh", + "34" => "Thanh Hoa", + "35" => "Thai Binh", + "37" => "Tien Giang", + "39" => "Lang Son", + "43" => "An Giang", + "44" => "Dac Lac", + "45" => "Dong Nai", + "46" => "Dong Thap", + "47" => "Kien Giang", + "49" => "Song Be", + "50" => "Vinh Phu", + "51" => "Ha Noi", + "52" => "Ho Chi Minh", + "53" => "Ba Ria-Vung Tau", + "54" => "Binh Dinh", + "55" => "Binh Thuan", + "58" => "Ha Giang", + "59" => "Ha Tay", + "60" => "Ha Tinh", + "61" => "Hoa Binh", + "62" => "Khanh Hoa", + "63" => "Kon Tum", + "64" => "Quang Tri", + "65" => "Nam Ha", + "66" => "Nghe An", + "67" => "Ninh Binh", + "68" => "Ninh Thuan", + "69" => "Phu Yen", + "70" => "Quang Binh", + "71" => "Quang Ngai", + "72" => "Quang Tri", + "73" => "Soc Trang", + "74" => "Thua Thien", + "75" => "Tra Vinh", + "76" => "Tuyen Quang", + "77" => "Vinh Long", + "78" => "Da Nang", + "79" => "Hai Duong", + "80" => "Ha Nam", + "81" => "Hung Yen", + "82" => "Nam Dinh", + "83" => "Phu Tho", + "84" => "Quang Nam", + "85" => "Thai Nguyen", + "86" => "Vinh Puc Province", + "87" => "Can Tho", + "88" => "Dak Lak", + "89" => "Lai Chau", + "90" => "Lao Cai", + "91" => "Dak Nong", + "92" => "Dien Bien", + "93" => "Hau Giang"), +"VU" => array( + "05" => "Ambrym", + "06" => "Aoba", + "07" => "Torba", + "08" => "Efate", + "09" => "Epi", + "10" => "Malakula", + "11" => "Paama", + "12" => "Pentecote", + "13" => "Sanma", + "14" => "Shepherd", + "15" => "Tafea", + "16" => "Malampa", + "17" => "Penama", + "18" => "Shefa"), +"WS" => array( + "02" => "Aiga-i-le-Tai", + "03" => "Atua", + "04" => "Fa", + "05" => "Gaga", + "06" => "Va", + "07" => "Gagaifomauga", + "08" => "Palauli", + "09" => "Satupa", + "10" => "Tuamasaga", + "11" => "Vaisigano"), +"YE" => array( + "01" => "Abyan", + "02" => "Adan", + "03" => "Al Mahrah", + "04" => "Hadramawt", + "05" => "Shabwah", + "06" => "Al Ghaydah", + "08" => "Al Hudaydah", + "10" => "Al Mahwit", + "11" => "Dhamar", + "14" => "Ma'rib", + "15" => "Sa", + "16" => "San", + "20" => "Al Bayda'", + "21" => "Al Jawf", + "22" => "Hajjah", + "23" => "Ibb", + "24" => "Lahij", + "25" => "Ta"), +"ZA" => array( + "01" => "North-Western Province", + "02" => "KwaZulu-Natal", + "03" => "Free State", + "05" => "Eastern Cape", + "06" => "Gauteng", + "07" => "Mpumalanga", + "08" => "Northern Cape", + "09" => "Limpopo", + "10" => "North-West", + "11" => "Western Cape"), +"ZM" => array( + "01" => "Western", + "02" => "Central", + "03" => "Eastern", + "04" => "Luapula", + "05" => "Northern", + "06" => "North-Western", + "07" => "Southern", + "08" => "Copperbelt", + "09" => "Lusaka"), +"ZW" => array( + "01" => "Manicaland", + "02" => "Midlands", + "03" => "Mashonaland Central", + "04" => "Mashonaland East", + "05" => "Mashonaland West", + "06" => "Matabeleland North", + "07" => "Matabeleland South", + "08" => "Masvingo", + "09" => "Bulawayo", + "10" => "Harare") +); +?> diff --git a/tools/index.php b/tools/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/tools/index.php @@ -0,0 +1,11 @@ + + * @copyright 2002 Douglas Crockford (jsmin.c) + * @copyright 2008 Ryan Grove (PHP port) + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 1.1.1 (2008-03-02) + * @link http://code.google.com/p/jsmin-php/ + */ + +class JSMin { + const ORD_LF = 10; + const ORD_SPACE = 32; + + protected $a = ''; + protected $b = ''; + protected $input = ''; + protected $inputIndex = 0; + protected $inputLength = 0; + protected $lookAhead = null; + protected $output = ''; + + // -- Public Static Methods -------------------------------------------------- + + public static function minify($js) { + $jsmin = new JSMin($js); + return $jsmin->min(); + } + + // -- Public Instance Methods ------------------------------------------------ + + public function __construct($input) { + $this->input = str_replace("\r\n", "\n", $input); + $this->inputLength = strlen($this->input); + } + + // -- Protected Instance Methods --------------------------------------------- + + protected function action($d) { + switch($d) { + case 1: + $this->output .= $this->a; + + case 2: + $this->a = $this->b; + + if ($this->a === "'" || $this->a === '"') { + for (;;) { + $this->output .= $this->a; + $this->a = $this->get(); + + if ($this->a === $this->b) { + break; + } + + if (ord($this->a) <= self::ORD_LF) { + throw new JSMinException('Unterminated string literal.'); + } + + if ($this->a === '\\') { + $this->output .= $this->a; + $this->a = $this->get(); + } + } + } + + case 3: + $this->b = $this->next(); + + if ($this->b === '/' && ( + $this->a === '(' || $this->a === ',' || $this->a === '=' || + $this->a === ':' || $this->a === '[' || $this->a === '!' || + $this->a === '&' || $this->a === '|' || $this->a === '?')) { + + $this->output .= $this->a . $this->b; + + for (;;) { + $this->a = $this->get(); + + if ($this->a === '/') { + break; + } elseif ($this->a === '\\') { + $this->output .= $this->a; + $this->a = $this->get(); + } elseif (ord($this->a) <= self::ORD_LF) { + throw new JSMinException('Unterminated regular expression '. + 'literal.'); + } + + $this->output .= $this->a; + } + + $this->b = $this->next(); + } + } + } + + protected function get() { + $c = $this->lookAhead; + $this->lookAhead = null; + + if ($c === null) { + if ($this->inputIndex < $this->inputLength) { + $c = substr($this->input, $this->inputIndex, 1); + $this->inputIndex += 1; + } else { + $c = null; + } + } + + if ($c === "\r") { + return "\n"; + } + + if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) { + return $c; + } + + return ' '; + } + + protected function isAlphaNum($c) { + return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1; + } + + protected function min() { + $this->a = "\n"; + $this->action(3); + + while ($this->a !== null) { + switch ($this->a) { + case ' ': + if ($this->isAlphaNum($this->b)) { + $this->action(1); + } else { + $this->action(2); + } + break; + + case "\n": + switch ($this->b) { + case '{': + case '[': + case '(': + case '+': + case '-': + $this->action(1); + break; + + case ' ': + $this->action(3); + break; + + default: + if ($this->isAlphaNum($this->b)) { + $this->action(1); + } + else { + $this->action(2); + } + } + break; + + default: + switch ($this->b) { + case ' ': + if ($this->isAlphaNum($this->a)) { + $this->action(1); + break; + } + + $this->action(3); + break; + + case "\n": + switch ($this->a) { + case '}': + case ']': + case ')': + case '+': + case '-': + case '"': + case "'": + $this->action(1); + break; + + default: + if ($this->isAlphaNum($this->a)) { + $this->action(1); + } + else { + $this->action(3); + } + } + break; + + default: + $this->action(1); + break; + } + } + } + + return $this->output; + } + + protected function next() { + $c = $this->get(); + + if ($c === '/') { + switch($this->peek()) { + case '/': + for (;;) { + $c = $this->get(); + + if (ord($c) <= self::ORD_LF) { + return $c; + } + } + + case '*': + $this->get(); + + for (;;) { + switch($this->get()) { + case '*': + if ($this->peek() === '/') { + $this->get(); + return ' '; + } + break; + + case null: + throw new JSMinException('Unterminated comment.'); + } + } + + default: + return $c; + } + } + + return $c; + } + + protected function peek() { + $this->lookAhead = $this->get(); + return $this->lookAhead; + } +} + +// -- Exceptions --------------------------------------------------------------- +class JSMinException extends Exception {} +?> diff --git a/tools/minify_html/minify_html.class.php b/tools/minify_html/minify_html.class.php new file mode 100755 index 000000000..e7b06c972 --- /dev/null +++ b/tools/minify_html/minify_html.class.php @@ -0,0 +1,220 @@ + + */ +class Minify_HTML { + + /** + * Defines which class to call as part of callbacks, change this + * if you extend Minify_HTML + * @var string + */ + protected static $className = 'Minify_HTML'; + + /** + * "Minify" an HTML page + * + * @param string $html + * + * @param array $options + * + * 'cssMinifier' : (optional) callback function to process content of STYLE + * elements. + * + * 'jsMinifier' : (optional) callback function to process content of SCRIPT + * elements. Note: the type attribute is ignored. + * + * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If + * unset, minify will sniff for an XHTML doctype. + * + * @return string + */ + public static function minify($html, $options = array()) { + + if (isset($options['cssMinifier'])) { + self::$_cssMinifier = $options['cssMinifier']; + } + if (isset($options['jsMinifier'])) { + self::$_jsMinifier = $options['jsMinifier']; + } + + $html = str_replace("\r\n", "\n", trim($html)); + + self::$_isXhtml = ( + isset($options['xhtml']) + ? (bool)$options['xhtml'] + : (false !== strpos($html, ']*?>)([\\s\\S]*?)<\\/script>\\s*/i' + ,array(self::$className, '_removeScriptCB') + ,$html); + + // replace STYLEs (and minify) with placeholders + $html = preg_replace_callback( + '/\\s*(]*?>)([\\s\\S]*?)<\\/style>\\s*/i' + ,array(self::$className, '_removeStyleCB') + ,$html); + + // remove HTML comments (not containing IE conditional comments). + $html = preg_replace_callback( + '//' + ,array(self::$className, '_commentCB') + ,$html); + + // replace PREs with placeholders + $html = preg_replace_callback('/\\s*(]*?>[\\s\\S]*?<\\/pre>)\\s*/i' + ,array(self::$className, '_removePreCB') + , $html); + + // replace TEXTAREAs with placeholders + $html = preg_replace_callback( + '/\\s*(]*?>[\\s\\S]*?<\\/textarea>)\\s*/i' + ,array(self::$className, '_removeTaCB') + , $html); + + // trim each line. + // @todo take into account attribute values that span multiple lines. + $html = preg_replace('/^\\s+|\\s+$/m', '', $html); + + // remove ws around block/undisplayed elements + $html = preg_replace('/\\s+(<\\/?(?:area|base(?:font)?|blockquote|body' + .'|caption|center|cite|col(?:group)?|dd|dir|div|dl|dt|fieldset|form' + .'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta' + .'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)' + .'|ul)\\b[^>]*>)/i', '$1', $html); + + // remove ws outside of all elements + $html = preg_replace_callback( + '/>([^<]+)]+>)/i', "$1\n$2", $html); + + // fill placeholders + $html = str_replace( + array_keys(self::$_placeholders) + ,array_values(self::$_placeholders) + ,$html + ); + self::$_placeholders = array(); + + self::$_cssMinifier = self::$_jsMinifier = null; + return $html; + } + + protected static function _commentCB($m) + { + return (0 === strpos($m[1], '[') || false !== strpos($m[1], '' . preg_replace('/^\\s+|\\s+$/', ' ', $m[1]) . '<'; + } + + protected static function _removePreCB($m) + { + return self::_reservePlace($m[1]); + } + + protected static function _removeTaCB($m) + { + return self::_reservePlace($m[1]); + } + + protected static function _removeStyleCB($m) + { + $openStyle = $m[1]; + $css = $m[2]; + // remove HTML comments + $css = preg_replace('/(?:^\\s*\\s*$)/', '', $css); + + // remove CDATA section markers + $css = self::_removeCdata($css); + + // minify + $minifier = self::$_cssMinifier + ? self::$_cssMinifier + : 'trim'; + $css = call_user_func($minifier, $css); + + return self::_reservePlace(self::_needsCdata($css) + ? "{$openStyle}/**/" + : "{$openStyle}{$css}" + ); + } + + protected static function _removeScriptCB($m) + { + $openScript = $m[1]; + $js = $m[2]; + + // remove HTML comments (and ending "//" if present) + $js = preg_replace('/(?:^\\s*\\s*$)/', '', $js); + + // remove CDATA section markers + $js = self::_removeCdata($js); + + // minify + $minifier = self::$_jsMinifier + ? self::$_jsMinifier + : 'trim'; + $js = call_user_func($minifier, $js); + + return self::_reservePlace(self::_needsCdata($js) + ? "{$openScript}/**/" + : "{$openScript}{$js}" + ); + } + + + protected static function _removeCdata($str) + { + return (false !== strpos($str, ''), '', $str) + : $str; + } + + protected static function _needsCdata($str) + { + return (self::$_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str)); + } +} + diff --git a/tools/pear/PEAR.php b/tools/pear/PEAR.php new file mode 100644 index 000000000..cb1bdd17e --- /dev/null +++ b/tools/pear/PEAR.php @@ -0,0 +1,1396 @@ + + * @author Stig Bakken + * @author Tomas V.V.Cox + * @author Greg Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version CVS: $Id: PEAR.php,v 1.98 2006/01/23 05:38:05 cellog Exp $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/**#@+ + * ERROR constants + */ +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +/** + * WARNING: obsolete + * @deprecated + */ +define('PEAR_ERROR_EXCEPTION', 32); +/**#@-*/ +define('PEAR_ZE2', (function_exists('version_compare') && + version_compare(zend_version(), "2-dev", "ge"))); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + define('OS_WINDOWS', true); + define('OS_UNIX', false); + define('PEAR_OS', 'Windows'); +} else { + define('OS_WINDOWS', false); + define('OS_UNIX', true); + define('PEAR_OS', 'Unix'); // blatant assumption +} + +// instant backwards compatibility +if (!defined('PATH_SEPARATOR')) { + if (OS_WINDOWS) { + define('PATH_SEPARATOR', ';'); + } else { + define('PATH_SEPARATOR', ':'); + } +} + +$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; +$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; +$GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_shutdown_funcs'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); + +@ini_set('track_errors', true); + +/** + * Base class for other PEAR classes. Provides rudimentary + * emulation of destructors. + * + * If you want a destructor in your class, inherit PEAR and make a + * destructor method called _yourclassname (same name as the + * constructor, but with a "_" prefix). Also, in your constructor you + * have to call the PEAR constructor: $this->PEAR();. + * The destructor method will be called without parameters. Note that + * at in some SAPI implementations (such as Apache), any output during + * the request shutdown (in which destructors are called) seems to be + * discarded. If you need to get any debug information from your + * destructor, use error_log(), syslog() or something similar. + * + * IMPORTANT! To use the emulated destructors you need to create the + * objects by reference: $obj =& new PEAR_child; + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Greg Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version Release: 1.4.9 + * @link http://pear.php.net/package/PEAR + * @see PEAR_Error + * @since Class available since PHP 4.0.2 + * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear + */ +class PEAR +{ + // {{{ properties + + /** + * Whether to enable internal debug messages. + * + * @var bool + * @access private + */ + var $_debug = false; + + /** + * Default error mode for this object. + * + * @var int + * @access private + */ + var $_default_error_mode = null; + + /** + * Default error options used for this object when error mode + * is PEAR_ERROR_TRIGGER. + * + * @var int + * @access private + */ + var $_default_error_options = null; + + /** + * Default error handler (callback) for this object, if error mode is + * PEAR_ERROR_CALLBACK. + * + * @var string + * @access private + */ + var $_default_error_handler = ''; + + /** + * Which class to use for error objects. + * + * @var string + * @access private + */ + var $_error_class = 'PEAR_Error'; + + /** + * An array of expected errors. + * + * @var array + * @access private + */ + var $_expected_errors = array(); + + // }}} + + // {{{ constructor + + /** + * Constructor. Registers this object in + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. + * + * @param string $error_class (optional) which class to use for + * error objects, defaults to PEAR_Error. + * @access public + * @return void + */ + function PEAR($error_class = null) + { + $classname = strtolower(get_class($this)); + if ($this->_debug) { + print "PEAR constructor called, class=$classname\n"; + } + if ($error_class !== null) { + $this->_error_class = $error_class; + } + while ($classname && strcasecmp($classname, "pear")) { + $destructor = "_$classname"; + if (method_exists($this, $destructor)) { + global $_PEAR_destructor_object_list; + $_PEAR_destructor_object_list[] = &$this; + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + break; + } else { + $classname = get_parent_class($classname); + } + } + } + + // }}} + // {{{ destructor + + /** + * Destructor (the emulated type of...). Does nothing right now, + * but is included for forward compatibility, so subclass + * destructors should always call it. + * + * See the note in the class desciption about output from + * destructors. + * + * @access public + * @return void + */ + function _PEAR() { + if ($this->_debug) { + printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + } + } + + // }}} + // {{{ getStaticProperty() + + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @access public + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + function &getStaticProperty($class, $var) + { + static $properties; + return $properties[$class][$var]; + } + + // }}} + // {{{ registerShutdownFunc() + + /** + * Use this function to register a shutdown method for static + * classes. + * + * @access public + * @param mixed $func The function name (or array of class/method) to call + * @param mixed $args The arguments to pass to the function + * @return void + */ + function registerShutdownFunc($func, $args = array()) + { + // if we are called statically, there is a potential + // that no shutdown func is registered. Bug #6445 + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); + } + + // }}} + // {{{ isError() + + /** + * Tell whether a value is a PEAR error. + * + * @param mixed $data the value to test + * @param int $code if $data is an error object, return true + * only if $code is a string and + * $obj->getMessage() == $code or + * $code is an integer and $obj->getCode() == $code + * @access public + * @return bool true if parameter is an error + */ + function isError($data, $code = null) + { + if (is_a($data, 'PEAR_Error')) { + if (is_null($code)) { + return true; + } elseif (is_string($code)) { + return $data->getMessage() == $code; + } else { + return $data->getCode() == $code; + } + } + return false; + } + + // }}} + // {{{ setErrorHandling() + + /** + * Sets how errors generated by this object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param int $mode + * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. + * + * @param mixed $options + * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one + * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * + * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected + * to be the callback function or method. A callback + * function is a string with the name of the function, a + * callback method is an array of two elements: the element + * at index 0 is the object, and the element at index 1 is + * the name of the method to call in the object. + * + * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is + * a printf format string used when printing the error + * message. + * + * @access public + * @return void + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION + * + * @since PHP 4.0.5 + */ + + function setErrorHandling($mode = null, $options = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $setmode = &$this->_default_error_mode; + $setoptions = &$this->_default_error_options; + } else { + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + } + + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + } + + // }}} + // {{{ expectError() + + /** + * This method is used to tell which errors you expect to get. + * Expected errors are always returned with error mode + * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, + * and this method pushes a new element onto it. The list of + * expected errors are in effect until they are popped off the + * stack with the popExpect() method. + * + * Note that this method can not be called statically + * + * @param mixed $code a single error code or an array of error codes to expect + * + * @return int the new depth of the "expected errors" stack + * @access public + */ + function expectError($code = '*') + { + if (is_array($code)) { + array_push($this->_expected_errors, $code); + } else { + array_push($this->_expected_errors, array($code)); + } + return sizeof($this->_expected_errors); + } + + // }}} + // {{{ popExpect() + + /** + * This method pops one element off the expected error codes + * stack. + * + * @return array the list of error codes that were popped + */ + function popExpect() + { + return array_pop($this->_expected_errors); + } + + // }}} + // {{{ _checkDelExpect() + + /** + * This method checks unsets an error code if available + * + * @param mixed error code + * @return bool true if the error code was unset, false otherwise + * @access private + * @since PHP 4.3.0 + */ + function _checkDelExpect($error_code) + { + $deleted = false; + + foreach ($this->_expected_errors AS $key => $error_array) { + if (in_array($error_code, $error_array)) { + unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); + $deleted = true; + } + + // clean up empty arrays + if (0 == sizeof($this->_expected_errors[$key])) { + unset($this->_expected_errors[$key]); + } + } + return $deleted; + } + + // }}} + // {{{ delExpect() + + /** + * This method deletes all occurences of the specified element from + * the expected error codes stack. + * + * @param mixed $error_code error code that should be deleted + * @return mixed list of error codes that were deleted or error + * @access public + * @since PHP 4.3.0 + */ + function delExpect($error_code) + { + $deleted = false; + + if ((is_array($error_code) && (0 != sizeof($error_code)))) { + // $error_code is a non-empty array here; + // we walk through it trying to unset all + // values + foreach($error_code as $key => $error) { + if ($this->_checkDelExpect($error)) { + $deleted = true; + } else { + $deleted = false; + } + } + return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } elseif (!empty($error_code)) { + // $error_code comes alone, trying to unset it + if ($this->_checkDelExpect($error_code)) { + return true; + } else { + return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } + } else { + // $error_code is empty + return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + } + } + + // }}} + // {{{ raiseError() + + /** + * This method is a wrapper that returns an instance of the + * configured error class with this object's default error + * handling applied. If the $mode and $options parameters are not + * specified, the object's defaults are used. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. + * + * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @param string $error_class The returned error object will be + * instantiated from this class, if specified. + * + * @param bool $skipmsg If true, raiseError will only pass error codes, + * the error message parameter will be dropped. + * + * @access public + * @return object a PEAR error object + * @see PEAR::setErrorHandling + * @since PHP 4.0.5 + */ + function &raiseError($message = null, + $code = null, + $mode = null, + $options = null, + $userinfo = null, + $error_class = null, + $skipmsg = false) + { + // The error is yet a PEAR error object + if (is_object($message)) { + $code = $message->getCode(); + $userinfo = $message->getUserInfo(); + $error_class = $message->getType(); + $message->error_message_prefix = ''; + $message = $message->getMessage(); + } + + if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) { + if ($exp[0] == "*" || + (is_int(reset($exp)) && in_array($code, $exp)) || + (is_string(reset($exp)) && in_array($message, $exp))) { + $mode = PEAR_ERROR_RETURN; + } + } + // No mode given, try global ones + if ($mode === null) { + // Class error handler + if (isset($this) && isset($this->_default_error_mode)) { + $mode = $this->_default_error_mode; + $options = $this->_default_error_options; + // Global error handler + } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { + $mode = $GLOBALS['_PEAR_default_error_mode']; + $options = $GLOBALS['_PEAR_default_error_options']; + } + } + + if ($error_class !== null) { + $ec = $error_class; + } elseif (isset($this) && isset($this->_error_class)) { + $ec = $this->_error_class; + } else { + $ec = 'PEAR_Error'; + } + if ($skipmsg) { + $a = new $ec($code, $mode, $options, $userinfo); + return $a; + } else { + $a = new $ec($message, $code, $mode, $options, $userinfo); + return $a; + } + } + + // }}} + // {{{ throwError() + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param string $message + * + */ + function &throwError($message = null, + $code = null, + $userinfo = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $a = &$this->raiseError($message, $code, null, null, $userinfo); + return $a; + } else { + $a = &PEAR::raiseError($message, $code, null, null, $userinfo); + return $a; + } + } + + // }}} + function staticPushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + $stack[] = array($def_mode, $def_options); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $def_mode = $mode; + $def_options = $options; + break; + + case PEAR_ERROR_CALLBACK: + $def_mode = $mode; + // class/object method callback + if (is_callable($options)) { + $def_options = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + $stack[] = array($mode, $options); + return true; + } + + function staticPopErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + return true; + } + + // {{{ pushErrorHandling() + + /** + * Push a new error handler on top of the error handler options stack. With this + * you can easily override the actual error handler for some code and restore + * it later with popErrorHandling. + * + * @param mixed $mode (same as setErrorHandling) + * @param mixed $options (same as setErrorHandling) + * + * @return bool Always true + * + * @see PEAR::setErrorHandling + */ + function pushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + if (isset($this) && is_a($this, 'PEAR')) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + } + $stack[] = array($def_mode, $def_options); + + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + $stack[] = array($mode, $options); + return true; + } + + // }}} + // {{{ popErrorHandling() + + /** + * Pop the last error handler used + * + * @return bool Always true + * + * @see PEAR::pushErrorHandling + */ + function popErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + return true; + } + + // }}} + // {{{ loadExtension() + + /** + * OS independant PHP extension load. Remember to take care + * on the correct extension name for case sensitive OSes. + * + * @param string $ext The extension name + * @return bool Success or not on the dl() call + */ + function loadExtension($ext) + { + if (!extension_loaded($ext)) { + // if either returns true dl() will produce a FATAL error, stop that + if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { + return false; + } + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; + } + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + } + return true; + } + + // }}} +} + +// {{{ _PEAR_call_destructors() + +function _PEAR_call_destructors() +{ + global $_PEAR_destructor_object_list; + if (is_array($_PEAR_destructor_object_list) && + sizeof($_PEAR_destructor_object_list)) + { + reset($_PEAR_destructor_object_list); + if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) { + $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); + } + while (list($k, $objref) = each($_PEAR_destructor_object_list)) { + $classname = get_class($objref); + while ($classname) { + $destructor = "_$classname"; + if (method_exists($objref, $destructor)) { + $objref->$destructor(); + break; + } else { + $classname = get_parent_class($classname); + } + } + } + // Empty the object list to ensure that destructors are + // not called more than once. + $_PEAR_destructor_object_list = array(); + } + + // Now call the shutdown functions + if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) { + foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { + call_user_func_array($value[0], $value[1]); + } + } +} + +// }}} +/** + * Standard PEAR error class for PHP 4 + * + * This class is supserseded by {@link PEAR_Exception} in PHP 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V. Cox + * @author Gregory Beaver + * @copyright 1997-2006 The PHP Group + * @license http://www.php.net/license/3_0.txt PHP License 3.0 + * @version Release: 1.4.9 + * @link http://pear.php.net/manual/en/core.pear.pear-error.php + * @see PEAR::raiseError(), PEAR::throwError() + * @since Class available since PHP 4.0.2 + */ +class PEAR_Error +{ + // {{{ properties + + var $error_message_prefix = ''; + var $mode = PEAR_ERROR_RETURN; + var $level = E_USER_NOTICE; + var $code = -1; + var $message = ''; + var $userinfo = ''; + var $backtrace = null; + + // }}} + // {{{ constructor + + /** + * PEAR_Error constructor + * + * @param string $message message + * + * @param int $code (optional) error code + * + * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION + * + * @param mixed $options (optional) error level, _OR_ in the case of + * PEAR_ERROR_CALLBACK, the callback function or object/method + * tuple. + * + * @param string $userinfo (optional) additional user/debug info + * + * @access public + * + */ + function PEAR_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + if ($mode === null) { + $mode = PEAR_ERROR_RETURN; + } + $this->message = $message; + $this->code = $code; + $this->mode = $mode; + $this->userinfo = $userinfo; + if (function_exists("debug_backtrace")) { + if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) { + $this->backtrace = debug_backtrace(); + } + } + if ($mode & PEAR_ERROR_CALLBACK) { + $this->level = E_USER_NOTICE; + $this->callback = $options; + } else { + if ($options === null) { + $options = E_USER_NOTICE; + } + $this->level = $options; + $this->callback = null; + } + if ($this->mode & PEAR_ERROR_PRINT) { + if (is_null($options) || is_int($options)) { + $format = "%s"; + } else { + $format = $options; + } + printf($format, $this->getMessage()); + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + trigger_error($this->getMessage(), $this->level); + } + if ($this->mode & PEAR_ERROR_DIE) { + $msg = $this->getMessage(); + if (is_null($options) || is_int($options)) { + $format = "%s"; + if (substr($msg, -1) != "\n") { + $msg .= "\n"; + } + } else { + $format = $options; + } + die(sprintf($format, $msg)); + } + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_callable($this->callback)) { + call_user_func($this->callback, $this); + } + } + if ($this->mode & PEAR_ERROR_EXCEPTION) { + trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); + eval('$e = new Exception($this->message, $this->code);throw($e);'); + } + } + + // }}} + // {{{ getMode() + + /** + * Get the error mode from an error object. + * + * @return int error mode + * @access public + */ + function getMode() { + return $this->mode; + } + + // }}} + // {{{ getCallback() + + /** + * Get the callback function/method from an error object. + * + * @return mixed callback function or object/method array + * @access public + */ + function getCallback() { + return $this->callback; + } + + // }}} + // {{{ getMessage() + + + /** + * Get the error message from an error object. + * + * @return string full error message + * @access public + */ + function getMessage() + { + return ($this->error_message_prefix . $this->message); + } + + + // }}} + // {{{ getCode() + + /** + * Get error code from an error object + * + * @return int error code + * @access public + */ + function getCode() + { + return $this->code; + } + + // }}} + // {{{ getType() + + /** + * Get the name of this error/exception. + * + * @return string error/exception name (type) + * @access public + */ + function getType() + { + return get_class($this); + } + + // }}} + // {{{ getUserInfo() + + /** + * Get additional user-supplied information. + * + * @return string user-supplied information + * @access public + */ + function getUserInfo() + { + return $this->userinfo; + } + + // }}} + // {{{ getDebugInfo() + + /** + * Get additional debug information supplied by the application. + * + * @return string debug information + * @access public + */ + function getDebugInfo() + { + return $this->getUserInfo(); + } + + // }}} + // {{{ getBacktrace() + + /** + * Get the call backtrace from where the error was generated. + * Supported with PHP 4.3.0 or newer. + * + * @param int $frame (optional) what frame to fetch + * @return array Backtrace, or NULL if not available. + * @access public + */ + function getBacktrace($frame = null) + { + if (defined('PEAR_IGNORE_BACKTRACE')) { + return null; + } + if ($frame === null) { + return $this->backtrace; + } + return $this->backtrace[$frame]; + } + + // }}} + // {{{ addUserInfo() + + function addUserInfo($info) + { + if (empty($this->userinfo)) { + $this->userinfo = $info; + } else { + $this->userinfo .= " ** $info"; + } + } + + // }}} + // {{{ toString() + + /** + * Make a string representation of this object. + * + * @return string a string with an object summary + * @access public + */ + function toString() { + $modes = array(); + $levels = array(E_USER_NOTICE => 'notice', + E_USER_WARNING => 'warning', + E_USER_ERROR => 'error'); + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_array($this->callback)) { + $callback = (is_object($this->callback[0]) ? + strtolower(get_class($this->callback[0])) : + $this->callback[0]) . '::' . + $this->callback[1]; + } else { + $callback = $this->callback; + } + return sprintf('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + $callback, $this->error_message_prefix, + $this->userinfo); + } + if ($this->mode & PEAR_ERROR_PRINT) { + $modes[] = 'print'; + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + $modes[] = 'trigger'; + } + if ($this->mode & PEAR_ERROR_DIE) { + $modes[] = 'die'; + } + if ($this->mode & PEAR_ERROR_RETURN) { + $modes[] = 'return'; + } + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + implode("|", $modes), $levels[$this->level], + $this->error_message_prefix, + $this->userinfo); + } + + // }}} +} + +class PEAR_Exception extends Exception +{ + const OBSERVER_PRINT = -2; + const OBSERVER_TRIGGER = -4; + const OBSERVER_DIE = -8; + protected $cause; + private static $_observers = array(); + private static $_uniqueid = 0; + private $_trace; + + /** + * Supported signatures: + * - PEAR_Exception(string $message); + * - PEAR_Exception(string $message, int $code); + * - PEAR_Exception(string $message, Exception $cause); + * - PEAR_Exception(string $message, Exception $cause, int $code); + * - PEAR_Exception(string $message, PEAR_Error $cause); + * - PEAR_Exception(string $message, PEAR_Error $cause, int $code); + * - PEAR_Exception(string $message, array $causes); + * - PEAR_Exception(string $message, array $causes, int $code); + * @param string exception message + * @param int|Exception|PEAR_Error|array|null exception cause + * @param int|null exception code or null + */ + public function __construct($message, $p2 = null, $p3 = null) + { + if (is_int($p2)) { + $code = $p2; + $this->cause = null; + } elseif (is_object($p2) || is_array($p2)) { + // using is_object allows both Exception and PEAR_Error + if (is_object($p2) && !($p2 instanceof Exception)) { + if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) { + throw new PEAR_Exception('exception cause must be Exception, ' . + 'array, or PEAR_Error'); + } + } + $code = $p3; + if (is_array($p2) && isset($p2['message'])) { + // fix potential problem of passing in a single warning + $p2 = array($p2); + } + $this->cause = $p2; + } else { + $code = null; + $this->cause = null; + } + parent::__construct($message, $code); + $this->signal(); + } + + /** + * @param mixed $callback - A valid php callback, see php func is_callable() + * - A PEAR_Exception::OBSERVER_* constant + * - An array(const PEAR_Exception::OBSERVER_*, + * mixed $options) + * @param string $label The name of the observer. Use this if you want + * to remove it later with removeObserver() + */ + public static function addObserver($callback, $label = 'default') + { + self::$_observers[$label] = $callback; + } + + public static function removeObserver($label = 'default') + { + unset(self::$_observers[$label]); + } + + /** + * @return int unique identifier for an observer + */ + public static function getUniqueId() + { + return self::$_uniqueid++; + } + + private function signal() + { + foreach (self::$_observers as $func) { + if (is_callable($func)) { + call_user_func($func, $this); + continue; + } + settype($func, 'array'); + switch ($func[0]) { + case self::OBSERVER_PRINT : + $f = (isset($func[1])) ? $func[1] : '%s'; + printf($f, $this->getMessage()); + break; + case self::OBSERVER_TRIGGER : + $f = (isset($func[1])) ? $func[1] : E_USER_NOTICE; + trigger_error($this->getMessage(), $f); + break; + case self::OBSERVER_DIE : + $f = (isset($func[1])) ? $func[1] : '%s'; + die(printf($f, $this->getMessage())); + break; + default: + trigger_error('invalid observer type', E_USER_WARNING); + } + } + } + + /** + * Return specific error information that can be used for more detailed + * error messages or translation. + * + * This method may be overridden in child exception classes in order + * to add functionality not present in PEAR_Exception and is a placeholder + * to define API + * + * The returned array must be an associative array of parameter => value like so: + *
          +     * array('name' => $name, 'context' => array(...))
          +     * 
          + * @return array + */ + public function getErrorData() + { + return array(); + } + + /** + * Returns the exception that caused this exception to be thrown + * @access public + * @return Exception|array The context of the exception + */ + public function getCause() + { + return $this->cause; + } + + /** + * Function must be public to call on caused exceptions + * @param array + */ + public function getCauseMessage(&$causes) + { + $trace = $this->getTraceSafe(); + $cause = array('class' => get_class($this), + 'message' => $this->message, + 'file' => 'unknown', + 'line' => 'unknown'); + if (isset($trace[0])) { + if (isset($trace[0]['file'])) { + $cause['file'] = $trace[0]['file']; + $cause['line'] = $trace[0]['line']; + } + } + $causes[] = $cause; + if ($this->cause instanceof PEAR_Exception) { + $this->cause->getCauseMessage($causes); + } elseif ($this->cause instanceof Exception) { + $causes[] = array('class' => get_class($this->cause), + 'message' => $this->cause->getMessage(), + 'file' => $this->cause->getFile(), + 'line' => $this->cause->getLine()); + } elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) { + $causes[] = array('class' => get_class($this->cause), + 'message' => $this->cause->getMessage(), + 'file' => 'unknown', + 'line' => 'unknown'); + } elseif (is_array($this->cause)) { + foreach ($this->cause as $cause) { + if ($cause instanceof PEAR_Exception) { + $cause->getCauseMessage($causes); + } elseif ($cause instanceof Exception) { + $causes[] = array('class' => get_class($cause), + 'message' => $cause->getMessage(), + 'file' => $cause->getFile(), + 'line' => $cause->getLine()); + } elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) { + $causes[] = array('class' => get_class($cause), + 'message' => $cause->getMessage(), + 'file' => 'unknown', + 'line' => 'unknown'); + } elseif (is_array($cause) && isset($cause['message'])) { + // PEAR_ErrorStack warning + $causes[] = array( + 'class' => $cause['package'], + 'message' => $cause['message'], + 'file' => isset($cause['context']['file']) ? + $cause['context']['file'] : + 'unknown', + 'line' => isset($cause['context']['line']) ? + $cause['context']['line'] : + 'unknown', + ); + } + } + } + } + + public function getTraceSafe() + { + if (!isset($this->_trace)) { + $this->_trace = $this->getTrace(); + if (empty($this->_trace)) { + $backtrace = debug_backtrace(); + $this->_trace = array($backtrace[sizeof($backtrace)-1]); + } + } + return $this->_trace; + } + + public function getErrorClass() + { + $trace = $this->getTraceSafe(); + return $trace[0]['class']; + } + + public function getErrorMethod() + { + $trace = $this->getTraceSafe(); + return $trace[0]['function']; + } + + public function __toString() + { + if (isset($_SERVER['REQUEST_URI'])) { + return $this->toHtml(); + } + return $this->toText(); + } + + public function toHtml() + { + $trace = $this->getTraceSafe(); + $causes = array(); + $this->getCauseMessage($causes); + $html = '' . "\n"; + foreach ($causes as $i => $cause) { + $html .= '\n"; + } + $html .= '' . "\n" + . '' + . '' + . '' . "\n"; + + foreach ($trace as $k => $v) { + $html .= '' + . '' + . '' . "\n"; + } + $html .= '' + . '' + . '' . "\n" + . '
          ' + . str_repeat('-', $i) . ' ' . $cause['class'] . ': ' + . htmlspecialchars($cause['message']) . ' in ' . $cause['file'] . ' ' + . 'on line ' . $cause['line'] . '' + . "
          Exception trace
          #FunctionLocation
          ' . $k . ''; + if (!empty($v['class'])) { + $html .= $v['class'] . $v['type']; + } + $html .= $v['function']; + $args = array(); + if (!empty($v['args'])) { + foreach ($v['args'] as $arg) { + if (is_null($arg)) $args[] = 'null'; + elseif (is_array($arg)) $args[] = 'Array'; + elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')'; + elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false'; + elseif (is_int($arg) || is_double($arg)) $args[] = $arg; + else { + $arg = (string)$arg; + $str = htmlspecialchars(substr($arg, 0, 16)); + if (strlen($arg) > 16) $str .= '…'; + $args[] = "'" . $str . "'"; + } + } + } + $html .= '(' . implode(', ',$args) . ')' + . '' . (isset($v['file']) ? $v['file'] : 'unknown') + . ':' . (isset($v['line']) ? $v['line'] : 'unknown') + . '
          ' . ($k+1) . '{main} 
          '; + return $html; + } + + public function toText() + { + $causes = array(); + $this->getCauseMessage($causes); + $causeMsg = ''; + foreach ($causes as $i => $cause) { + $causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': ' + . $cause['message'] . ' in ' . $cause['file'] + . ' on line ' . $cause['line'] . "\n"; + } + return $causeMsg . $this->getTraceAsString(); + } +} + + +/* + * Local Variables: + * mode: php + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ +?> diff --git a/tools/pear_xml_parser/Parser.php b/tools/pear_xml_parser/Parser.php new file mode 100644 index 000000000..d869771f6 --- /dev/null +++ b/tools/pear_xml_parser/Parser.php @@ -0,0 +1,351 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @version CVS: $Id: Parser.php,v 1.24 2006/08/15 13:04:00 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * XML_Feed_Parser_Type is an abstract class required by all of our + * feed types. It makes sense to load it here to keep the other files + * clean. + */ +require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/Type.php'); + +/** + * We will throw exceptions when errors occur. + */ +require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/Exception.php'); + +/** + * This is the core of the XML_Feed_Parser package. It identifies feed types + * and abstracts access to them. It is an iterator, allowing for easy access + * to the entire feed. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser implements Iterator +{ + /** + * This is where we hold the feed object + * @var Object + */ + private $feed; + + /** + * To allow for extensions, we make a public reference to the feed model + * @var DOMDocument + */ + public $model; + + /** + * A map between entry ID and offset + * @var array + */ + protected $idMappings = array(); + + /** + * A storage space for Namespace URIs. + * @var array + */ + private $feedNamespaces = array( + 'rss2' => array( + 'http://backend.userland.com/rss', + 'http://backend.userland.com/rss2', + 'http://blogs.law.harvard.edu/tech/rss')); + /** + * Detects feed types and instantiate appropriate objects. + * + * Our constructor takes care of detecting feed types and instantiating + * appropriate classes. For now we're going to treat Atom 0.3 as Atom 1.0 + * but raise a warning. I do not intend to introduce full support for + * Atom 0.3 as it has been deprecated, but others are welcome to. + * + * @param string $feed XML serialization of the feed + * @param bool $strict Whether or not to validate the feed + * @param bool $suppressWarnings Trigger errors for deprecated feed types? + * @param bool $tidy Whether or not to try and use the tidy library on input + */ + function __construct($feed, $strict = false, $suppressWarnings = false, $tidy = false) + { + $this->model = new DOMDocument; + if (! $this->model->loadXML($feed)) { + if (extension_loaded('tidy') && $tidy) { + $tidy = new tidy; + $tidy->parseString($feed, + array('input-xml' => true, 'output-xml' => true)); + $tidy->cleanRepair(); + if (! $this->model->loadXML((string) $tidy)) { + throw new XML_Feed_Parser_Exception('Invalid input: this is not ' . + 'valid XML'); + } + } else { + throw new XML_Feed_Parser_Exception('Invalid input: this is not valid XML'); + } + + } + + /* detect feed type */ + $doc_element = $this->model->documentElement; + $error = false; + + switch (true) { + case ($doc_element->namespaceURI == 'http://www.w3.org/2005/Atom'): + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/Atom.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/AtomElement.php'); + $class = 'XML_Feed_Parser_Atom'; + break; + case ($doc_element->namespaceURI == 'http://purl.org/atom/ns#'): + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/Atom.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/AtomElement.php'); + $class = 'XML_Feed_Parser_Atom'; + $error = 'Atom 0.3 deprecated, using 1.0 parser which won\'t provide ' . + 'all options'; + break; + case ($doc_element->namespaceURI == 'http://purl.org/rss/1.0/' || + ($doc_element->hasChildNodes() && $doc_element->childNodes->length > 1 + && $doc_element->childNodes->item(1)->namespaceURI == + 'http://purl.org/rss/1.0/')): + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS1.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS1Element.php'); + $class = 'XML_Feed_Parser_RSS1'; + break; + case ($doc_element->namespaceURI == 'http://purl.org/rss/1.1/' || + ($doc_element->hasChildNodes() && $doc_element->childNodes->length > 1 + && $doc_element->childNodes->item(1)->namespaceURI == + 'http://purl.org/rss/1.1/')): + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS11.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS11Element.php'); + $class = 'XML_Feed_Parser_RSS11'; + break; + case (($doc_element->hasChildNodes() && $doc_element->childNodes->length > 1 + && $doc_element->childNodes->item(1)->namespaceURI == + 'http://my.netscape.com/rdf/simple/0.9/') || + $doc_element->namespaceURI == 'http://my.netscape.com/rdf/simple/0.9/'): + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS09.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS09Element.php'); + $class = 'XML_Feed_Parser_RSS09'; + break; + case ($doc_element->tagName == 'rss' and + $doc_element->hasAttribute('version') && + $doc_element->getAttribute('version') == 0.91): + $error = 'RSS 0.91 has been superceded by RSS2.0. Using RSS2.0 parser.'; + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2Element.php'); + $class = 'XML_Feed_Parser_RSS2'; + break; + case ($doc_element->tagName == 'rss' and + $doc_element->hasAttribute('version') && + $doc_element->getAttribute('version') == 0.92): + $error = 'RSS 0.92 has been superceded by RSS2.0. Using RSS2.0 parser.'; + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2Element.php'); + $class = 'XML_Feed_Parser_RSS2'; + break; + case (in_array($doc_element->namespaceURI, $this->feedNamespaces['rss2']) + || $doc_element->tagName == 'rss'): + if (! $doc_element->hasAttribute('version') || + $doc_element->getAttribute('version') != 2) { + $error = 'RSS version not specified. Parsing as RSS2.0'; + } + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2.php'); + require_once (_PS_PEAR_XML_PARSER_PATH_.'Parser/RSS2Element.php'); + $class = 'XML_Feed_Parser_RSS2'; + break; + default: + throw new XML_Feed_Parser_Exception('Feed type unknown'); + break; + } + + if (! $suppressWarnings && ! empty($error)) { + trigger_error($error, E_USER_WARNING); + } + + /* Instantiate feed object */ + $this->feed = new $class($this->model, $strict); + } + + /** + * Proxy to allow feed element names to be used as method names + * + * For top-level feed elements we will provide access using methods or + * attributes. This function simply passes on a request to the appropriate + * feed type object. + * + * @param string $call - the method being called + * @param array $attributes + */ + function __call($call, $attributes) + { + $attributes = array_pad($attributes, 5, false); + list($a, $b, $c, $d, $e) = $attributes; + return $this->feed->$call($a, $b, $c, $d, $e); + } + + /** + * Proxy to allow feed element names to be used as attribute names + * + * To allow variable-like access to feed-level data we use this + * method. It simply passes along to __call() which in turn passes + * along to the relevant object. + * + * @param string $val - the name of the variable required + */ + function __get($val) + { + return $this->feed->$val; + } + + /** + * Provides iteration functionality. + * + * Of course we must be able to iterate... This function simply increases + * our internal counter. + */ + function next() + { + if (isset($this->current_item) && + $this->current_item <= $this->feed->numberEntries - 1) { + ++$this->current_item; + } else if (! isset($this->current_item)) { + $this->current_item = 0; + } else { + return false; + } + } + + /** + * Return XML_Feed_Type object for current element + * + * @return XML_Feed_Parser_Type Object + */ + function current() + { + return $this->getEntryByOffset($this->current_item); + } + + /** + * For iteration -- returns the key for the current stage in the array. + * + * @return int + */ + function key() + { + return $this->current_item; + } + + /** + * For iteration -- tells whether we have reached the + * end. + * + * @return bool + */ + function valid() + { + return $this->current_item < $this->feed->numberEntries; + } + + /** + * For iteration -- resets the internal counter to the beginning. + */ + function rewind() + { + $this->current_item = 0; + } + + /** + * Provides access to entries by ID if one is specified in the source feed. + * + * As well as allowing the items to be iterated over we want to allow + * users to be able to access a specific entry. This is one of two ways of + * doing that, the other being by offset. This method can be quite slow + * if dealing with a large feed that hasn't yet been processed as it + * instantiates objects for every entry until it finds the one needed. + * + * @param string $id Valid ID for the given feed format + * @return XML_Feed_Parser_Type|false + */ + function getEntryById($id) + { + if (isset($this->idMappings[$id])) { + return $this->getEntryByOffset($this->idMappings[$id]); + } + + /* + * Since we have not yet encountered that ID, let's go through all the + * remaining entries in order till we find it. + * This is a fairly slow implementation, but it should work. + */ + return $this->feed->getEntryById($id); + } + + /** + * Retrieve entry by numeric offset, starting from zero. + * + * As well as allowing the items to be iterated over we want to allow + * users to be able to access a specific entry. This is one of two ways of + * doing that, the other being by ID. + * + * @param int $offset The position of the entry within the feed, starting from 0 + * @return XML_Feed_Parser_Type|false + */ + function getEntryByOffset($offset) + { + if ($offset < $this->feed->numberEntries) { + if (isset($this->feed->entries[$offset])) { + return $this->feed->entries[$offset]; + } else { + try { + $this->feed->getEntryByOffset($offset); + } catch (Exception $e) { + return false; + } + $id = $this->feed->entries[$offset]->getID(); + $this->idMappings[$id] = $offset; + return $this->feed->entries[$offset]; + } + } else { + return false; + } + } + + /** + * Retrieve version details from feed type class. + * + * @return void + * @author James Stewart + */ + function version() + { + return $this->feed->version; + } + + /** + * Returns a string representation of the feed. + * + * @return String + **/ + function __toString() + { + return $this->feed->__toString(); + } +} +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/Atom.php b/tools/pear_xml_parser/Parser/Atom.php new file mode 100644 index 000000000..9b70beab3 --- /dev/null +++ b/tools/pear_xml_parser/Parser/Atom.php @@ -0,0 +1,365 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: Atom.php,v 1.25 2007/03/26 12:49:05 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ +*/ + +/** + * This is the class that determines how we manage Atom 1.0 feeds + * + * How we deal with constructs: + * date - return as unix datetime for use with the 'date' function unless specified otherwise + * text - return as is. optional parameter will give access to attributes + * person - defaults to name, but parameter based access + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_Atom extends XML_Feed_Parser_Type +{ + /** + * The URI of the RelaxNG schema used to (optionally) validate the feed + * @var string + */ + private $relax = 'atom.rnc'; + + /** + * We're likely to use XPath, so let's keep it global + * @var DOMXPath + */ + public $xpath; + + /** + * When performing XPath queries we will use this prefix + * @var string + */ + private $xpathPrefix = '//'; + + /** + * The feed type we are parsing + * @var string + */ + public $version = 'Atom 1.0'; + + /** + * The class used to represent individual items + * @var string + */ + protected $itemClass = 'XML_Feed_Parser_AtomElement'; + + /** + * The element containing entries + * @var string + */ + protected $itemElement = 'entry'; + + /** + * Here we map those elements we're not going to handle individually + * to the constructs they are. The optional second parameter in the array + * tells the parser whether to 'fall back' (not apt. at the feed level) or + * fail if the element is missing. If the parameter is not set, the function + * will simply return false and leave it to the client to decide what to do. + * @var array + */ + protected $map = array( + 'author' => array('Person'), + 'contributor' => array('Person'), + 'icon' => array('Text'), + 'logo' => array('Text'), + 'id' => array('Text', 'fail'), + 'rights' => array('Text'), + 'subtitle' => array('Text'), + 'title' => array('Text', 'fail'), + 'updated' => array('Date', 'fail'), + 'link' => array('Link'), + 'generator' => array('Text'), + 'category' => array('Category')); + + /** + * Here we provide a few mappings for those very special circumstances in + * which it makes sense to map back to the RSS2 spec. Key is RSS2 version + * value is an array consisting of the equivalent in atom and any attributes + * needed to make the mapping. + * @var array + */ + protected $compatMap = array( + 'guid' => array('id'), + 'links' => array('link'), + 'tags' => array('category'), + 'contributors' => array('contributor')); + + /** + * Our constructor does nothing more than its parent. + * + * @param DOMDocument $xml A DOM object representing the feed + * @param bool (optional) $string Whether or not to validate this feed + */ + function __construct(DOMDocument $model, $strict = false) + { + $this->model = $model; + + if ($strict) { + if (! $this->model->relaxNGValidateSource($this->relax)) { + throw new XML_Feed_Parser_Exception('Failed required validation'); + } + } + + $this->xpath = new DOMXPath($this->model); + $this->xpath->registerNamespace('atom', 'http://www.w3.org/2005/Atom'); + $this->numberEntries = $this->count('entry'); + } + + /** + * Implement retrieval of an entry based on its ID for atom feeds. + * + * This function uses XPath to get the entry based on its ID. If DOMXPath::evaluate + * is available, we also use that to store a reference to the entry in the array + * used by getEntryByOffset so that method does not have to seek out the entry + * if it's requested that way. + * + * @param string $id any valid Atom ID. + * @return XML_Feed_Parser_AtomElement + */ + function getEntryById($id) + { + if (isset($this->idMappings[$id])) { + return $this->entries[$this->idMappings[$id]]; + } + + $entries = $this->xpath->query("//atom:entry[atom:id='$id']"); + + if ($entries->length > 0) { + $xmlBase = $entries->item(0)->baseURI; + $entry = new $this->itemElement($entries->item(0), $this, $xmlBase); + + if (in_array('evaluate', get_class_methods($this->xpath))) { + $offset = $this->xpath->evaluate("count(preceding-sibling::atom:entry)", $entries->item(0)); + $this->entries[$offset] = $entry; + } + + $this->idMappings[$id] = $entry; + + return $entry; + } + + } + + /** + * Retrieves data from a person construct. + * + * Get a person construct. We default to the 'name' element but allow + * access to any of the elements. + * + * @param string $method The name of the person construct we want + * @param array $arguments An array which we hope gives a 'param' + * @return string|false + */ + protected function getPerson($method, $arguments) + { + $offset = empty($arguments[0]) ? 0 : $arguments[0]; + $parameter = empty($arguments[1]['param']) ? 'name' : $arguments[1]['param']; + $section = $this->model->getElementsByTagName($method); + + if ($parameter == 'url') { + $parameter = 'uri'; + } + + if ($section->length <= $offset) { + return false; + } + + $param = $section->item($offset)->getElementsByTagName($parameter); + if ($param->length == 0) { + return false; + } + return $param->item(0)->nodeValue; + } + + /** + * Retrieves an element's content where that content is a text construct. + * + * Get a text construct. When calling this method, the two arguments + * allowed are 'offset' and 'attribute', so $parser->subtitle() would + * return the content of the element, while $parser->subtitle(false, 'type') + * would return the value of the type attribute. + * + * @todo Clarify overlap with getContent() + * @param string $method The name of the text construct we want + * @param array $arguments An array which we hope gives a 'param' + * @return string + */ + protected function getText($method, $arguments) + { + $offset = empty($arguments[0]) ? 0: $arguments[0]; + $attribute = empty($arguments[1]) ? false : $arguments[1]; + $tags = $this->model->getElementsByTagName($method); + + if ($tags->length <= $offset) { + return false; + } + + $content = $tags->item($offset); + + if (! $content->hasAttribute('type')) { + $content->setAttribute('type', 'text'); + } + $type = $content->getAttribute('type'); + + if (! empty($attribute) and + ! ($method == 'generator' and $attribute == 'name')) { + if ($content->hasAttribute($attribute)) { + return $content->getAttribute($attribute); + } else if ($attribute == 'href' and $content->hasAttribute('uri')) { + return $content->getAttribute('uri'); + } + return false; + } + return $this->parseTextConstruct($content); + } + + /** + * Extract content appropriately from atom text constructs + * + * Because of different rules applied to the content element and other text + * constructs, they are deployed as separate functions, but they share quite + * a bit of processing. This method performs the core common process, which is + * to apply the rules for different mime types in order to extract the content. + * + * @param DOMNode $content the text construct node to be parsed + * @return String + * @author James Stewart + **/ + protected function parseTextConstruct(DOMNode $content) + { + if ($content->hasAttribute('type')) { + $type = $content->getAttribute('type'); + } else { + $type = 'text'; + } + + if (strpos($type, 'text/') === 0) { + $type = 'text'; + } + switch ($type) { + case 'text': + return $content->nodeValue; + break; + case 'html': + return str_replace('<', '<', $content->nodeValue); + break; + case 'xhtml': + $container = $content->getElementsByTagName('div'); + if ($container->length == 0) { + return false; + } + $contents = $container->item(0); + if ($contents->hasChildNodes()) { + /* Iterate through, applying xml:base and store the result */ + $result = ''; + foreach ($contents->childNodes as $node) { + $result .= $this->traverseNode($node); + } + return utf8_decode($result); + } + break; + case preg_match('@^[a-zA-Z]+/[a-zA-Z+]*xml@i', $type) > 0: + return $content; + break; + case 'application/octet-stream': + default: + return base64_decode(trim($content->nodeValue)); + break; + } + return false; + } + /** + * Get a category from the entry. + * + * A feed or entry can have any number of categories. A category can have the + * attributes term, scheme and label. + * + * @param string $method The name of the text construct we want + * @param array $arguments An array which we hope gives a 'param' + * @return string + */ + function getCategory($method, $arguments) + { + $offset = empty($arguments[0]) ? 0: $arguments[0]; + $attribute = empty($arguments[1]) ? 'term' : $arguments[1]; + $categories = $this->model->getElementsByTagName('category'); + if ($categories->length <= $offset) { + $category = $categories->item($offset); + if ($category->hasAttribute($attribute)) { + return $category->getAttribute($attribute); + } + } + return false; + } + + /** + * This element must be present at least once with rel="feed". This element may be + * present any number of further times so long as there is no clash. If no 'rel' is + * present and we're asked for one, we follow the example of the Universal Feed + * Parser and presume 'alternate'. + * + * @param int $offset the position of the link within the container + * @param string $attribute the attribute name required + * @param array an array of attributes to search by + * @return string the value of the attribute + */ + function getLink($offset = 0, $attribute = 'href', $params = false) + { + if (is_array($params) and !empty($params)) { + $terms = array(); + $alt_predicate = ''; + $other_predicate = ''; + + foreach ($params as $key => $value) { + if ($key == 'rel' && $value == 'alternate') { + $alt_predicate = '[not(@rel) or @rel="alternate"]'; + } else { + $terms[] = "@$key='$value'"; + } + } + if (!empty($terms)) { + $other_predicate = '[' . join(' and ', $terms) . ']'; + } + $query = $this->xpathPrefix . 'atom:link' . $alt_predicate . $other_predicate; + $links = $this->xpath->query($query); + } else { + $links = $this->model->getElementsByTagName('link'); + } + if ($links->length > $offset) { + if ($links->item($offset)->hasAttribute($attribute)) { + $value = $links->item($offset)->getAttribute($attribute); + if ($attribute == 'href') { + $value = $this->addBase($value, $links->item($offset)); + } + return $value; + } else if ($attribute == 'rel') { + return 'alternate'; + } + } + return false; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/AtomElement.php b/tools/pear_xml_parser/Parser/AtomElement.php new file mode 100644 index 000000000..d8a39fe38 --- /dev/null +++ b/tools/pear_xml_parser/Parser/AtomElement.php @@ -0,0 +1,261 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: AtomElement.php,v 1.19 2007/03/26 12:43:11 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class provides support for atom entries. It will usually be called by + * XML_Feed_Parser_Atom with which it shares many methods. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_AtomElement extends XML_Feed_Parser_Atom +{ + /** + * This will be a reference to the parent object for when we want + * to use a 'fallback' rule + * @var XML_Feed_Parser_Atom + */ + protected $parent; + + /** + * When performing XPath queries we will use this prefix + * @var string + */ + private $xpathPrefix = ''; + + /** + * xml:base values inherited by the element + * @var string + */ + protected $xmlBase; + + /** + * Here we provide a few mappings for those very special circumstances in + * which it makes sense to map back to the RSS2 spec or to manage other + * compatibilities (eg. with the Univeral Feed Parser). Key is the other version's + * name for the command, value is an array consisting of the equivalent in our atom + * api and any attributes needed to make the mapping. + * @var array + */ + protected $compatMap = array( + 'guid' => array('id'), + 'links' => array('link'), + 'tags' => array('category'), + 'contributors' => array('contributor')); + + /** + * Our specific element map + * @var array + */ + protected $map = array( + 'author' => array('Person', 'fallback'), + 'contributor' => array('Person'), + 'id' => array('Text', 'fail'), + 'published' => array('Date'), + 'updated' => array('Date', 'fail'), + 'title' => array('Text', 'fail'), + 'rights' => array('Text', 'fallback'), + 'summary' => array('Text'), + 'content' => array('Content'), + 'link' => array('Link'), + 'enclosure' => array('Enclosure'), + 'category' => array('Category')); + + /** + * Store useful information for later. + * + * @param DOMElement $element - this item as a DOM element + * @param XML_Feed_Parser_Atom $parent - the feed of which this is a member + */ + function __construct(DOMElement $element, $parent, $xmlBase = '') + { + $this->model = $element; + $this->parent = $parent; + $this->xmlBase = $xmlBase; + $this->xpathPrefix = "//atom:entry[atom:id='" . $this->id . "']/"; + $this->xpath = $this->parent->xpath; + } + + /** + * Provides access to specific aspects of the author data for an atom entry + * + * Author data at the entry level is more complex than at the feed level. + * If atom:author is not present for the entry we need to look for it in + * an atom:source child of the atom:entry. If it's not there either, then + * we look to the parent for data. + * + * @param array + * @return string + */ + function getAuthor($arguments) + { + /* Find out which part of the author data we're looking for */ + if (isset($arguments['param'])) { + $parameter = $arguments['param']; + } else { + $parameter = 'name'; + } + + $test = $this->model->getElementsByTagName('author'); + if ($test->length > 0) { + $item = $test->item(0); + return $item->getElementsByTagName($parameter)->item(0)->nodeValue; + } + + $source = $this->model->getElementsByTagName('source'); + if ($source->length > 0) { + $test = $this->model->getElementsByTagName('author'); + if ($test->length > 0) { + $item = $test->item(0); + return $item->getElementsByTagName($parameter)->item(0)->nodeValue; + } + } + return $this->parent->getAuthor($arguments); + } + + /** + * Returns the content of the content element or info on a specific attribute + * + * This element may or may not be present. It cannot be present more than + * once. It may have a 'src' attribute, in which case there's no content + * If not present, then the entry must have link with rel="alternate". + * If there is content we return it, if not and there's a 'src' attribute + * we return the value of that instead. The method can take an 'attribute' + * argument, in which case we return the value of that attribute if present. + * eg. $item->content("type") will return the type of the content. It is + * recommended that all users check the type before getting the content to + * ensure that their script is capable of handling the type of returned data. + * (data carried in the content element can be either 'text', 'html', 'xhtml', + * or any standard MIME type). + * + * @return string|false + */ + protected function getContent($method, $arguments = array()) + { + $attribute = empty($arguments[0]) ? false : $arguments[0]; + $tags = $this->model->getElementsByTagName('content'); + + if ($tags->length == 0) { + return false; + } + + $content = $tags->item(0); + + if (! $content->hasAttribute('type')) { + $content->setAttribute('type', 'text'); + } + if (! empty($attribute)) { + return $content->getAttribute($attribute); + } + + $type = $content->getAttribute('type'); + + if (! empty($attribute)) { + if ($content->hasAttribute($attribute)) + { + return $content->getAttribute($attribute); + } + return false; + } + + if ($content->hasAttribute('src')) { + return $content->getAttribute('src'); + } + + return $this->parseTextConstruct($content); + } + + /** + * For compatibility, this method provides a mapping to access enclosures. + * + * The Atom spec doesn't provide for an enclosure element, but it is + * generally supported using the link element with rel='enclosure'. + * + * @param string $method - for compatibility with our __call usage + * @param array $arguments - for compatibility with our __call usage + * @return array|false + */ + function getEnclosure($method, $arguments = array()) + { + $offset = isset($arguments[0]) ? $arguments[0] : 0; + $query = "//atom:entry[atom:id='" . $this->getText('id', false) . + "']/atom:link[@rel='enclosure']"; + + $encs = $this->parent->xpath->query($query); + if ($encs->length > $offset) { + try { + if (! $encs->item($offset)->hasAttribute('href')) { + return false; + } + $attrs = $encs->item($offset)->attributes; + $length = $encs->item($offset)->hasAttribute('length') ? + $encs->item($offset)->getAttribute('length') : false; + return array( + 'url' => $attrs->getNamedItem('href')->value, + 'type' => $attrs->getNamedItem('type')->value, + 'length' => $length); + } catch (Exception $e) { + return false; + } + } + return false; + } + + /** + * Get details of this entry's source, if available/relevant + * + * Where an atom:entry is taken from another feed then the aggregator + * is supposed to include an atom:source element which replicates at least + * the atom:id, atom:title, and atom:updated metadata from the original + * feed. Atom:source therefore has a very similar structure to atom:feed + * and if we find it we will return it as an XML_Feed_Parser_Atom object. + * + * @return XML_Feed_Parser_Atom|false + */ + function getSource() + { + $test = $this->model->getElementsByTagName('source'); + if ($test->length == 0) { + return false; + } + $source = new XML_Feed_Parser_Atom($test->item(0)); + } + + /** + * Get the entry as an XML string + * + * Return an XML serialization of the feed, should it be required. Most + * users however, will already have a serialization that they used when + * instantiating the object. + * + * @return string XML serialization of element + */ + function __toString() + { + $simple = simplexml_import_dom($this->model); + return $simple->asXML(); + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/Exception.php b/tools/pear_xml_parser/Parser/Exception.php new file mode 100644 index 000000000..5557a81b2 --- /dev/null +++ b/tools/pear_xml_parser/Parser/Exception.php @@ -0,0 +1,42 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL + * @version CVS: $Id: Exception.php,v 1.3 2005/11/07 01:52:35 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * We are extending PEAR_Exception + */ +require_once(dirname(__FILE__).'/../../pear/PEAR.php'); + +/** + * XML_Feed_Parser_Exception is a simple extension of PEAR_Exception, existing + * to help with identification of the source of exceptions. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_Exception extends PEAR_Exception +{ + +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS09.php b/tools/pear_xml_parser/Parser/RSS09.php new file mode 100644 index 000000000..7004e0126 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS09.php @@ -0,0 +1,214 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS09.php,v 1.5 2006/07/26 21:18:46 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class handles RSS0.9 feeds. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + * @todo Find a Relax NG URI we can use + */ +class XML_Feed_Parser_RSS09 extends XML_Feed_Parser_Type +{ + /** + * The URI of the RelaxNG schema used to (optionally) validate the feed + * @var string + */ + private $relax = ''; + + /** + * We're likely to use XPath, so let's keep it global + * @var DOMXPath + */ + protected $xpath; + + /** + * The feed type we are parsing + * @var string + */ + public $version = 'RSS 0.9'; + + /** + * The class used to represent individual items + * @var string + */ + protected $itemClass = 'XML_Feed_Parser_RSS09Element'; + + /** + * The element containing entries + * @var string + */ + protected $itemElement = 'item'; + + /** + * Here we map those elements we're not going to handle individually + * to the constructs they are. The optional second parameter in the array + * tells the parser whether to 'fall back' (not apt. at the feed level) or + * fail if the element is missing. If the parameter is not set, the function + * will simply return false and leave it to the client to decide what to do. + * @var array + */ + protected $map = array( + 'title' => array('Text'), + 'link' => array('Text'), + 'description' => array('Text'), + 'image' => array('Image'), + 'textinput' => array('TextInput')); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS2. + * @var array + */ + protected $compatMap = array( + 'title' => array('title'), + 'link' => array('link'), + 'subtitle' => array('description')); + + /** + * We will be working with multiple namespaces and it is useful to + * keep them together + * @var array + */ + protected $namespaces = array( + 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); + + /** + * Our constructor does nothing more than its parent. + * + * @todo RelaxNG validation + * @param DOMDocument $xml A DOM object representing the feed + * @param bool (optional) $string Whether or not to validate this feed + */ + function __construct(DOMDocument $model, $strict = false) + { + $this->model = $model; + + $this->xpath = new DOMXPath($model); + foreach ($this->namespaces as $key => $value) { + $this->xpath->registerNamespace($key, $value); + } + $this->numberEntries = $this->count('item'); + } + + /** + * Included for compatibility -- will not work with RSS 0.9 + * + * This is not something that will work with RSS0.9 as it does not have + * clear restrictions on the global uniqueness of IDs. + * + * @param string $id any valid ID. + * @return false + */ + function getEntryById($id) + { + return false; + } + + /** + * Get details of the image associated with the feed. + * + * @return array|false an array simply containing the child elements + */ + protected function getImage() + { + $images = $this->model->getElementsByTagName('image'); + if ($images->length > 0) { + $image = $images->item(0); + $details = array(); + if ($image->hasChildNodes()) { + $details = array( + 'title' => $image->getElementsByTagName('title')->item(0)->value, + 'link' => $image->getElementsByTagName('link')->item(0)->value, + 'url' => $image->getElementsByTagName('url')->item(0)->value); + } else { + $details = array('title' => false, + 'link' => false, + 'url' => $image->attributes->getNamedItem('resource')->nodeValue); + } + $details = array_merge($details, + array('description' => false, 'height' => false, 'width' => false)); + if (! empty($details)) { + return $details; + } + } + return false; + } + + /** + * The textinput element is little used, but in the interests of + * completeness we will support it. + * + * @return array|false + */ + protected function getTextInput() + { + $inputs = $this->model->getElementsByTagName('textinput'); + if ($inputs->length > 0) { + $input = $inputs->item(0); + $results = array(); + $results['title'] = isset( + $input->getElementsByTagName('title')->item(0)->value) ? + $input->getElementsByTagName('title')->item(0)->value : null; + $results['description'] = isset( + $input->getElementsByTagName('description')->item(0)->value) ? + $input->getElementsByTagName('description')->item(0)->value : null; + $results['name'] = isset( + $input->getElementsByTagName('name')->item(0)->value) ? + $input->getElementsByTagName('name')->item(0)->value : null; + $results['link'] = isset( + $input->getElementsByTagName('link')->item(0)->value) ? + $input->getElementsByTagName('link')->item(0)->value : null; + if (empty($results['link']) && + $input->attributes->getNamedItem('resource')) { + $results['link'] = $input->attributes->getNamedItem('resource')->nodeValue; + } + if (! empty($results)) { + return $results; + } + } + return false; + } + + /** + * Get details of a link from the feed. + * + * In RSS1 a link is a text element but in order to ensure that we resolve + * URLs properly we have a special function for them. + * + * @return string + */ + function getLink($offset = 0, $attribute = 'href', $params = false) + { + $links = $this->model->getElementsByTagName('link'); + if ($links->length <= $offset) { + return false; + } + $link = $links->item($offset); + return $this->addBase($link->nodeValue, $link); + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS09Element.php b/tools/pear_xml_parser/Parser/RSS09Element.php new file mode 100644 index 000000000..6ec8c8dd4 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS09Element.php @@ -0,0 +1,62 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS09Element.php,v 1.4 2006/06/30 17:41:56 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/* + * This class provides support for RSS 0.9 entries. It will usually be called by + * XML_Feed_Parser_RSS09 with which it shares many methods. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_RSS09Element extends XML_Feed_Parser_RSS09 +{ + /** + * This will be a reference to the parent object for when we want + * to use a 'fallback' rule + * @var XML_Feed_Parser_RSS09 + */ + protected $parent; + + /** + * Our specific element map + * @var array + */ + protected $map = array( + 'title' => array('Text'), + 'link' => array('Link')); + + /** + * Store useful information for later. + * + * @param DOMElement $element - this item as a DOM element + * @param XML_Feed_Parser_RSS1 $parent - the feed of which this is a member + */ + function __construct(DOMElement $element, $parent, $xmlBase = '') + { + $this->model = $element; + $this->parent = $parent; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS1.php b/tools/pear_xml_parser/Parser/RSS1.php new file mode 100644 index 000000000..952f60e23 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS1.php @@ -0,0 +1,277 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS1.php,v 1.10 2006/07/27 13:52:05 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class handles RSS1.0 feeds. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + * @todo Find a Relax NG URI we can use + */ +class XML_Feed_Parser_RSS1 extends XML_Feed_Parser_Type +{ + /** + * The URI of the RelaxNG schema used to (optionally) validate the feed + * @var string + */ + private $relax = 'rss10.rnc'; + + /** + * We're likely to use XPath, so let's keep it global + * @var DOMXPath + */ + protected $xpath; + + /** + * The feed type we are parsing + * @var string + */ + public $version = 'RSS 1.0'; + + /** + * The class used to represent individual items + * @var string + */ + protected $itemClass = 'XML_Feed_Parser_RSS1Element'; + + /** + * The element containing entries + * @var string + */ + protected $itemElement = 'item'; + + /** + * Here we map those elements we're not going to handle individually + * to the constructs they are. The optional second parameter in the array + * tells the parser whether to 'fall back' (not apt. at the feed level) or + * fail if the element is missing. If the parameter is not set, the function + * will simply return false and leave it to the client to decide what to do. + * @var array + */ + protected $map = array( + 'title' => array('Text'), + 'link' => array('Text'), + 'description' => array('Text'), + 'image' => array('Image'), + 'textinput' => array('TextInput'), + 'updatePeriod' => array('Text'), + 'updateFrequency' => array('Text'), + 'updateBase' => array('Date'), + 'rights' => array('Text'), # dc:rights + 'description' => array('Text'), # dc:description + 'creator' => array('Text'), # dc:creator + 'publisher' => array('Text'), # dc:publisher + 'contributor' => array('Text'), # dc:contributor + 'date' => array('Date') # dc:contributor + ); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS2. + * @var array + */ + protected $compatMap = array( + 'title' => array('title'), + 'link' => array('link'), + 'subtitle' => array('description'), + 'author' => array('creator'), + 'updated' => array('date')); + + /** + * We will be working with multiple namespaces and it is useful to + * keep them together + * @var array + */ + protected $namespaces = array( + 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'rss' => 'http://purl.org/rss/1.0/', + 'dc' => 'http://purl.org/rss/1.0/modules/dc/', + 'content' => 'http://purl.org/rss/1.0/modules/content/', + 'sy' => 'http://web.resource.org/rss/1.0/modules/syndication/'); + + /** + * Our constructor does nothing more than its parent. + * + * @param DOMDocument $xml A DOM object representing the feed + * @param bool (optional) $string Whether or not to validate this feed + */ + function __construct(DOMDocument $model, $strict = false) + { + $this->model = $model; + if ($strict) { + $validate = $this->model->relaxNGValidate(self::getSchemaDir . + DIRECTORY_SEPARATOR . $this->relax); + if (! $validate) { + throw new XML_Feed_Parser_Exception('Failed required validation'); + } + } + + $this->xpath = new DOMXPath($model); + foreach ($this->namespaces as $key => $value) { + $this->xpath->registerNamespace($key, $value); + } + $this->numberEntries = $this->count('item'); + } + + /** + * Allows retrieval of an entry by ID where the rdf:about attribute is used + * + * This is not really something that will work with RSS1 as it does not have + * clear restrictions on the global uniqueness of IDs. We will employ the + * _very_ hit and miss method of selecting entries based on the rdf:about + * attribute. If DOMXPath::evaluate is available, we also use that to store + * a reference to the entry in the array used by getEntryByOffset so that + * method does not have to seek out the entry if it's requested that way. + * + * @param string $id any valid ID. + * @return XML_Feed_Parser_RSS1Element + */ + function getEntryById($id) + { + if (isset($this->idMappings[$id])) { + return $this->entries[$this->idMappings[$id]]; + } + + $entries = $this->xpath->query("//rss:item[@rdf:about='$id']"); + if ($entries->length > 0) { + $classname = $this->itemClass; + $entry = new $classname($entries->item(0), $this); + if (in_array('evaluate', get_class_methods($this->xpath))) { + $offset = $this->xpath->evaluate("count(preceding-sibling::rss:item)", $entries->item(0)); + $this->entries[$offset] = $entry; + } + $this->idMappings[$id] = $entry; + return $entry; + } + return false; + } + + /** + * Get details of the image associated with the feed. + * + * @return array|false an array simply containing the child elements + */ + protected function getImage() + { + $images = $this->model->getElementsByTagName('image'); + if ($images->length > 0) { + $image = $images->item(0); + $details = array(); + if ($image->hasChildNodes()) { + $details = array( + 'title' => $image->getElementsByTagName('title')->item(0)->value, + 'link' => $image->getElementsByTagName('link')->item(0)->value, + 'url' => $image->getElementsByTagName('url')->item(0)->value); + } else { + $details = array('title' => false, + 'link' => false, + 'url' => $image->attributes->getNamedItem('resource')->nodeValue); + } + $details = array_merge($details, array('description' => false, 'height' => false, 'width' => false)); + if (! empty($details)) { + return $details; + } + } + return false; + } + + /** + * The textinput element is little used, but in the interests of + * completeness we will support it. + * + * @return array|false + */ + protected function getTextInput() + { + $inputs = $this->model->getElementsByTagName('textinput'); + if ($inputs->length > 0) { + $input = $inputs->item(0); + $results = array(); + $results['title'] = isset( + $input->getElementsByTagName('title')->item(0)->value) ? + $input->getElementsByTagName('title')->item(0)->value : null; + $results['description'] = isset( + $input->getElementsByTagName('description')->item(0)->value) ? + $input->getElementsByTagName('description')->item(0)->value : null; + $results['name'] = isset( + $input->getElementsByTagName('name')->item(0)->value) ? + $input->getElementsByTagName('name')->item(0)->value : null; + $results['link'] = isset( + $input->getElementsByTagName('link')->item(0)->value) ? + $input->getElementsByTagName('link')->item(0)->value : null; + if (empty($results['link']) and + $input->attributes->getNamedItem('resource')) { + $results['link'] = + $input->attributes->getNamedItem('resource')->nodeValue; + } + if (! empty($results)) { + return $results; + } + } + return false; + } + + /** + * Employs various techniques to identify the author + * + * Dublin Core provides the dc:creator, dc:contributor, and dc:publisher + * elements for defining authorship in RSS1. We will try each of those in + * turn in order to simulate the atom author element and will return it + * as text. + * + * @return array|false + */ + function getAuthor() + { + $options = array('creator', 'contributor', 'publisher'); + foreach ($options as $element) { + $test = $this->model->getElementsByTagName($element); + if ($test->length > 0) { + return $test->item(0)->value; + } + } + return false; + } + + /** + * Retrieve a link + * + * In RSS1 a link is a text element but in order to ensure that we resolve + * URLs properly we have a special function for them. + * + * @return string + */ + function getLink($offset = 0, $attribute = 'href', $params = false) + { + $links = $this->model->getElementsByTagName('link'); + if ($links->length <= $offset) { + return false; + } + $link = $links->item($offset); + return $this->addBase($link->nodeValue, $link); + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS11.php b/tools/pear_xml_parser/Parser/RSS11.php new file mode 100644 index 000000000..74babc18e --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS11.php @@ -0,0 +1,276 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS11.php,v 1.6 2006/07/27 13:52:05 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class handles RSS1.1 feeds. RSS1.1 is documented at: + * http://inamidst.com/rss1.1/ + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + * @todo Support for RDF:List + * @todo Ensure xml:lang is accessible to users + */ +class XML_Feed_Parser_RSS11 extends XML_Feed_Parser_Type +{ + /** + * The URI of the RelaxNG schema used to (optionally) validate the feed + * @var string + */ + private $relax = 'rss11.rnc'; + + /** + * We're likely to use XPath, so let's keep it global + * @var DOMXPath + */ + protected $xpath; + + /** + * The feed type we are parsing + * @var string + */ + public $version = 'RSS 1.0'; + + /** + * The class used to represent individual items + * @var string + */ + protected $itemClass = 'XML_Feed_Parser_RSS1Element'; + + /** + * The element containing entries + * @var string + */ + protected $itemElement = 'item'; + + /** + * Here we map those elements we're not going to handle individually + * to the constructs they are. The optional second parameter in the array + * tells the parser whether to 'fall back' (not apt. at the feed level) or + * fail if the element is missing. If the parameter is not set, the function + * will simply return false and leave it to the client to decide what to do. + * @var array + */ + protected $map = array( + 'title' => array('Text'), + 'link' => array('Text'), + 'description' => array('Text'), + 'image' => array('Image'), + 'updatePeriod' => array('Text'), + 'updateFrequency' => array('Text'), + 'updateBase' => array('Date'), + 'rights' => array('Text'), # dc:rights + 'description' => array('Text'), # dc:description + 'creator' => array('Text'), # dc:creator + 'publisher' => array('Text'), # dc:publisher + 'contributor' => array('Text'), # dc:contributor + 'date' => array('Date') # dc:contributor + ); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS2. + * @var array + */ + protected $compatMap = array( + 'title' => array('title'), + 'link' => array('link'), + 'subtitle' => array('description'), + 'author' => array('creator'), + 'updated' => array('date')); + + /** + * We will be working with multiple namespaces and it is useful to + * keep them together. We will retain support for some common RSS1.0 modules + * @var array + */ + protected $namespaces = array( + 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'rss' => 'http://purl.org/net/rss1.1#', + 'dc' => 'http://purl.org/rss/1.0/modules/dc/', + 'content' => 'http://purl.org/rss/1.0/modules/content/', + 'sy' => 'http://web.resource.org/rss/1.0/modules/syndication/'); + + /** + * Our constructor does nothing more than its parent. + * + * @param DOMDocument $xml A DOM object representing the feed + * @param bool (optional) $string Whether or not to validate this feed + */ + function __construct(DOMDocument $model, $strict = false) + { + $this->model = $model; + + if ($strict) { + $validate = $this->model->relaxNGValidate(self::getSchemaDir . + DIRECTORY_SEPARATOR . $this->relax); + if (! $validate) { + throw new XML_Feed_Parser_Exception('Failed required validation'); + } + } + + $this->xpath = new DOMXPath($model); + foreach ($this->namespaces as $key => $value) { + $this->xpath->registerNamespace($key, $value); + } + $this->numberEntries = $this->count('item'); + } + + /** + * Attempts to identify an element by ID given by the rdf:about attribute + * + * This is not really something that will work with RSS1.1 as it does not have + * clear restrictions on the global uniqueness of IDs. We will employ the + * _very_ hit and miss method of selecting entries based on the rdf:about + * attribute. Please note that this is even more hit and miss with RSS1.1 than + * with RSS1.0 since RSS1.1 does not require the rdf:about attribute for items. + * + * @param string $id any valid ID. + * @return XML_Feed_Parser_RSS1Element + */ + function getEntryById($id) + { + if (isset($this->idMappings[$id])) { + return $this->entries[$this->idMappings[$id]]; + } + + $entries = $this->xpath->query("//rss:item[@rdf:about='$id']"); + if ($entries->length > 0) { + $classname = $this->itemClass; + $entry = new $classname($entries->item(0), $this); + return $entry; + } + return false; + } + + /** + * Get details of the image associated with the feed. + * + * @return array|false an array simply containing the child elements + */ + protected function getImage() + { + $images = $this->model->getElementsByTagName('image'); + if ($images->length > 0) { + $image = $images->item(0); + $details = array(); + if ($image->hasChildNodes()) { + $details = array( + 'title' => $image->getElementsByTagName('title')->item(0)->value, + 'url' => $image->getElementsByTagName('url')->item(0)->value); + if ($image->getElementsByTagName('link')->length > 0) { + $details['link'] = + $image->getElementsByTagName('link')->item(0)->value; + } + } else { + $details = array('title' => false, + 'link' => false, + 'url' => $image->attributes->getNamedItem('resource')->nodeValue); + } + $details = array_merge($details, + array('description' => false, 'height' => false, 'width' => false)); + if (! empty($details)) { + return $details; + } + } + return false; + } + + /** + * The textinput element is little used, but in the interests of + * completeness we will support it. + * + * @return array|false + */ + protected function getTextInput() + { + $inputs = $this->model->getElementsByTagName('textinput'); + if ($inputs->length > 0) { + $input = $inputs->item(0); + $results = array(); + $results['title'] = isset( + $input->getElementsByTagName('title')->item(0)->value) ? + $input->getElementsByTagName('title')->item(0)->value : null; + $results['description'] = isset( + $input->getElementsByTagName('description')->item(0)->value) ? + $input->getElementsByTagName('description')->item(0)->value : null; + $results['name'] = isset( + $input->getElementsByTagName('name')->item(0)->value) ? + $input->getElementsByTagName('name')->item(0)->value : null; + $results['link'] = isset( + $input->getElementsByTagName('link')->item(0)->value) ? + $input->getElementsByTagName('link')->item(0)->value : null; + if (empty($results['link']) and + $input->attributes->getNamedItem('resource')) { + $results['link'] = $input->attributes->getNamedItem('resource')->nodeValue; + } + if (! empty($results)) { + return $results; + } + } + return false; + } + + /** + * Attempts to discern authorship + * + * Dublin Core provides the dc:creator, dc:contributor, and dc:publisher + * elements for defining authorship in RSS1. We will try each of those in + * turn in order to simulate the atom author element and will return it + * as text. + * + * @return array|false + */ + function getAuthor() + { + $options = array('creator', 'contributor', 'publisher'); + foreach ($options as $element) { + $test = $this->model->getElementsByTagName($element); + if ($test->length > 0) { + return $test->item(0)->value; + } + } + return false; + } + + /** + * Retrieve a link + * + * In RSS1 a link is a text element but in order to ensure that we resolve + * URLs properly we have a special function for them. + * + * @return string + */ + function getLink($offset = 0, $attribute = 'href', $params = false) + { + $links = $this->model->getElementsByTagName('link'); + if ($links->length <= $offset) { + return false; + } + $link = $links->item($offset); + return $this->addBase($link->nodeValue, $link); + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS11Element.php b/tools/pear_xml_parser/Parser/RSS11Element.php new file mode 100644 index 000000000..9de641702 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS11Element.php @@ -0,0 +1,151 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS11Element.php,v 1.4 2006/06/30 17:41:56 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/* + * This class provides support for RSS 1.1 entries. It will usually be called by + * XML_Feed_Parser_RSS11 with which it shares many methods. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_RSS11Element extends XML_Feed_Parser_RSS11 +{ + /** + * This will be a reference to the parent object for when we want + * to use a 'fallback' rule + * @var XML_Feed_Parser_RSS1 + */ + protected $parent; + + /** + * Our specific element map + * @var array + */ + protected $map = array( + 'id' => array('Id'), + 'title' => array('Text'), + 'link' => array('Link'), + 'description' => array('Text'), # or dc:description + 'category' => array('Category'), + 'rights' => array('Text'), # dc:rights + 'creator' => array('Text'), # dc:creator + 'publisher' => array('Text'), # dc:publisher + 'contributor' => array('Text'), # dc:contributor + 'date' => array('Date'), # dc:date + 'content' => array('Content') + ); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS1. + * @var array + */ + protected $compatMap = array( + 'content' => array('content'), + 'updated' => array('lastBuildDate'), + 'published' => array('pubdate'), + 'subtitle' => array('description'), + 'updated' => array('date'), + 'author' => array('creator'), + 'contributor' => array('contributor') + ); + + /** + * Store useful information for later. + * + * @param DOMElement $element - this item as a DOM element + * @param XML_Feed_Parser_RSS1 $parent - the feed of which this is a member + */ + function __construct(DOMElement $element, $parent, $xmlBase = '') + { + $this->model = $element; + $this->parent = $parent; + } + + /** + * If an rdf:about attribute is specified, return that as an ID + * + * There is no established way of showing an ID for an RSS1 entry. We will + * simulate it using the rdf:about attribute of the entry element. This cannot + * be relied upon for unique IDs but may prove useful. + * + * @return string|false + */ + function getId() + { + if ($this->model->attributes->getNamedItem('about')) { + return $this->model->attributes->getNamedItem('about')->nodeValue; + } + return false; + } + + /** + * Return the entry's content + * + * The official way to include full content in an RSS1 entry is to use + * the content module's element 'encoded'. Often, however, the 'description' + * element is used instead. We will offer that as a fallback. + * + * @return string|false + */ + function getContent() + { + $options = array('encoded', 'description'); + foreach ($options as $element) { + $test = $this->model->getElementsByTagName($element); + if ($test->length == 0) { + continue; + } + if ($test->item(0)->hasChildNodes()) { + $value = ''; + foreach ($test->item(0)->childNodes as $child) { + if ($child instanceof DOMText) { + $value .= $child->nodeValue; + } else { + $simple = simplexml_import_dom($child); + $value .= $simple->asXML(); + } + } + return $value; + } else if ($test->length > 0) { + return $test->item(0)->nodeValue; + } + } + return false; + } + + /** + * How RSS1.1 should support for enclosures is not clear. For now we will return + * false. + * + * @return false + */ + function getEnclosure() + { + return false; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS1Element.php b/tools/pear_xml_parser/Parser/RSS1Element.php new file mode 100644 index 000000000..f43ae46c1 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS1Element.php @@ -0,0 +1,116 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS1Element.php,v 1.6 2006/06/30 17:41:56 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/* + * This class provides support for RSS 1.0 entries. It will usually be called by + * XML_Feed_Parser_RSS1 with which it shares many methods. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_RSS1Element extends XML_Feed_Parser_RSS1 +{ + /** + * This will be a reference to the parent object for when we want + * to use a 'fallback' rule + * @var XML_Feed_Parser_RSS1 + */ + protected $parent; + + /** + * Our specific element map + * @var array + */ + protected $map = array( + 'id' => array('Id'), + 'title' => array('Text'), + 'link' => array('Link'), + 'description' => array('Text'), # or dc:description + 'category' => array('Category'), + 'rights' => array('Text'), # dc:rights + 'creator' => array('Text'), # dc:creator + 'publisher' => array('Text'), # dc:publisher + 'contributor' => array('Text'), # dc:contributor + 'date' => array('Date'), # dc:date + 'content' => array('Content') + ); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS1. + * @var array + */ + protected $compatMap = array( + 'content' => array('content'), + 'updated' => array('lastBuildDate'), + 'published' => array('pubdate'), + 'subtitle' => array('description'), + 'updated' => array('date'), + 'author' => array('creator'), + 'contributor' => array('contributor') + ); + + /** + * Store useful information for later. + * + * @param DOMElement $element - this item as a DOM element + * @param XML_Feed_Parser_RSS1 $parent - the feed of which this is a member + */ + function __construct(DOMElement $element, $parent, $xmlBase = '') + { + $this->model = $element; + $this->parent = $parent; + } + + /** + * If an rdf:about attribute is specified, return it as an ID + * + * There is no established way of showing an ID for an RSS1 entry. We will + * simulate it using the rdf:about attribute of the entry element. This cannot + * be relied upon for unique IDs but may prove useful. + * + * @return string|false + */ + function getId() + { + if ($this->model->attributes->getNamedItem('about')) { + return $this->model->attributes->getNamedItem('about')->nodeValue; + } + return false; + } + + /** + * How RSS1 should support for enclosures is not clear. For now we will return + * false. + * + * @return false + */ + function getEnclosure() + { + return false; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS2.php b/tools/pear_xml_parser/Parser/RSS2.php new file mode 100644 index 000000000..c5d79d1a3 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS2.php @@ -0,0 +1,334 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS2.php,v 1.11 2006/07/27 13:52:05 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class handles RSS2 feeds. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_RSS2 extends XML_Feed_Parser_Type +{ + /** + * The URI of the RelaxNG schema used to (optionally) validate the feed + * @var string + */ + private $relax = 'rss20.rnc'; + + /** + * We're likely to use XPath, so let's keep it global + * @var DOMXPath + */ + protected $xpath; + + /** + * The feed type we are parsing + * @var string + */ + public $version = 'RSS 2.0'; + + /** + * The class used to represent individual items + * @var string + */ + protected $itemClass = 'XML_Feed_Parser_RSS2Element'; + + /** + * The element containing entries + * @var string + */ + protected $itemElement = 'item'; + + /** + * Here we map those elements we're not going to handle individually + * to the constructs they are. The optional second parameter in the array + * tells the parser whether to 'fall back' (not apt. at the feed level) or + * fail if the element is missing. If the parameter is not set, the function + * will simply return false and leave it to the client to decide what to do. + * @var array + */ + protected $map = array( + 'ttl' => array('Text'), + 'pubDate' => array('Date'), + 'lastBuildDate' => array('Date'), + 'title' => array('Text'), + 'link' => array('Link'), + 'description' => array('Text'), + 'language' => array('Text'), + 'copyright' => array('Text'), + 'managingEditor' => array('Text'), + 'webMaster' => array('Text'), + 'category' => array('Text'), + 'generator' => array('Text'), + 'docs' => array('Text'), + 'ttl' => array('Text'), + 'image' => array('Image'), + 'skipDays' => array('skipDays'), + 'skipHours' => array('skipHours')); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS2. + * @var array + */ + protected $compatMap = array( + 'title' => array('title'), + 'rights' => array('copyright'), + 'updated' => array('lastBuildDate'), + 'subtitle' => array('description'), + 'date' => array('pubDate'), + 'author' => array('managingEditor')); + + protected $namespaces = array( + 'dc' => 'http://purl.org/rss/1.0/modules/dc/', + 'content' => 'http://purl.org/rss/1.0/modules/content/'); + + /** + * Our constructor does nothing more than its parent. + * + * @param DOMDocument $xml A DOM object representing the feed + * @param bool (optional) $string Whether or not to validate this feed + */ + function __construct(DOMDocument $model, $strict = false) + { + $this->model = $model; + + if ($strict) { + if (! $this->model->relaxNGValidate($this->relax)) { + throw new XML_Feed_Parser_Exception('Failed required validation'); + } + } + + $this->xpath = new DOMXPath($this->model); + foreach ($this->namespaces as $key => $value) { + $this->xpath->registerNamespace($key, $value); + } + $this->numberEntries = $this->count('item'); + } + + /** + * Retrieves an entry by ID, if the ID is specified with the guid element + * + * This is not really something that will work with RSS2 as it does not have + * clear restrictions on the global uniqueness of IDs. But we can emulate + * it by allowing access based on the 'guid' element. If DOMXPath::evaluate + * is available, we also use that to store a reference to the entry in the array + * used by getEntryByOffset so that method does not have to seek out the entry + * if it's requested that way. + * + * @param string $id any valid ID. + * @return XML_Feed_Parser_RSS2Element + */ + function getEntryById($id) + { + if (isset($this->idMappings[$id])) { + return $this->entries[$this->idMappings[$id]]; + } + + $entries = $this->xpath->query("//item[guid='$id']"); + if ($entries->length > 0) { + $entry = new $this->itemElement($entries->item(0), $this); + if (in_array('evaluate', get_class_methods($this->xpath))) { + $offset = $this->xpath->evaluate("count(preceding-sibling::item)", $entries->item(0)); + $this->entries[$offset] = $entry; + } + $this->idMappings[$id] = $entry; + return $entry; + } + } + + /** + * Get a category from the element + * + * The category element is a simple text construct which can occur any number + * of times. We allow access by offset or access to an array of results. + * + * @param string $call for compatibility with our overloading + * @param array $arguments - arg 0 is the offset, arg 1 is whether to return as array + * @return string|array|false + */ + function getCategory($call, $arguments = array()) + { + $categories = $this->model->getElementsByTagName('category'); + $offset = empty($arguments[0]) ? 0 : $arguments[0]; + $array = empty($arguments[1]) ? false : true; + if ($categories->length <= $offset) { + return false; + } + if ($array) { + $list = array(); + foreach ($categories as $category) { + array_push($list, $category->nodeValue); + } + return $list; + } + return $categories->item($offset)->nodeValue; + } + + /** + * Get details of the image associated with the feed. + * + * @return array|false an array simply containing the child elements + */ + protected function getImage() + { + $images = $this->model->getElementsByTagName('image'); + if ($images->length > 0) { + $image = $images->item(0); + $desc = $image->getElementsByTagName('description'); + $description = $desc->length ? $desc->item(0)->nodeValue : false; + $heigh = $image->getElementsByTagName('height'); + $height = $heigh->length ? $heigh->item(0)->nodeValue : false; + $widt = $image->getElementsByTagName('width'); + $width = $widt->length ? $widt->item(0)->nodeValue : false; + return array( + 'title' => $image->getElementsByTagName('title')->item(0)->nodeValue, + 'link' => $image->getElementsByTagName('link')->item(0)->nodeValue, + 'url' => $image->getElementsByTagName('url')->item(0)->nodeValue, + 'description' => $description, + 'height' => $height, + 'width' => $width); + } + return false; + } + + /** + * The textinput element is little used, but in the interests of + * completeness... + * + * @return array|false + */ + function getTextInput() + { + $inputs = $this->model->getElementsByTagName('input'); + if ($inputs->length > 0) { + $input = $inputs->item(0); + return array( + 'title' => $input->getElementsByTagName('title')->item(0)->value, + 'description' => + $input->getElementsByTagName('description')->item(0)->value, + 'name' => $input->getElementsByTagName('name')->item(0)->value, + 'link' => $input->getElementsByTagName('link')->item(0)->value); + } + return false; + } + + /** + * Utility function for getSkipDays and getSkipHours + * + * This is a general function used by both getSkipDays and getSkipHours. It simply + * returns an array of the values of the children of the appropriate tag. + * + * @param string $tagName The tag name (getSkipDays or getSkipHours) + * @return array|false + */ + protected function getSkips($tagName) + { + $hours = $this->model->getElementsByTagName($tagName); + if ($hours->length == 0) { + return false; + } + $skipHours = array(); + foreach($hours->item(0)->childNodes as $hour) { + if ($hour instanceof DOMElement) { + array_push($skipHours, $hour->nodeValue); + } + } + return $skipHours; + } + + /** + * Retrieve skipHours data + * + * The skiphours element provides a list of hours on which this feed should + * not be checked. We return an array of those hours (integers, 24 hour clock) + * + * @return array + */ + function getSkipHours() + { + return $this->getSkips('skipHours'); + } + + /** + * Retrieve skipDays data + * + * The skipdays element provides a list of days on which this feed should + * not be checked. We return an array of those days. + * + * @return array + */ + function getSkipDays() + { + return $this->getSkips('skipDays'); + } + + /** + * Return content of the little-used 'cloud' element + * + * The cloud element is rarely used. It is designed to provide some details + * of a location to update the feed. + * + * @return array an array of the attributes of the element + */ + function getCloud() + { + $cloud = $this->model->getElementsByTagName('cloud'); + if ($cloud->length == 0) { + return false; + } + $cloudData = array(); + foreach ($cloud->item(0)->attributes as $attribute) { + $cloudData[$attribute->name] = $attribute->value; + } + return $cloudData; + } + + /** + * Get link URL + * + * In RSS2 a link is a text element but in order to ensure that we resolve + * URLs properly we have a special function for them. We maintain the + * parameter used by the atom getLink method, though we only use the offset + * parameter. + * + * @param int $offset The position of the link within the feed. Starts from 0 + * @param string $attribute The attribute of the link element required + * @param array $params An array of other parameters. Not used. + * @return string + */ + function getLink($offset, $attribute = 'href', $params = array()) + { + $links = $this->model->getElementsByTagName('link'); + + if ($links->length <= $offset) { + return false; + } + $link = $links->item($offset); + return $this->addBase($link->nodeValue, $link); + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/RSS2Element.php b/tools/pear_xml_parser/Parser/RSS2Element.php new file mode 100644 index 000000000..156e9bc44 --- /dev/null +++ b/tools/pear_xml_parser/Parser/RSS2Element.php @@ -0,0 +1,171 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: RSS2Element.php,v 1.11 2006/07/26 21:18:47 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This class provides support for RSS 2.0 entries. It will usually be + * called by XML_Feed_Parser_RSS2 with which it shares many methods. + * + * @author James Stewart + * @version Release: 1.0.2 + * @package XML_Feed_Parser + */ +class XML_Feed_Parser_RSS2Element extends XML_Feed_Parser_RSS2 +{ + /** + * This will be a reference to the parent object for when we want + * to use a 'fallback' rule + * @var XML_Feed_Parser_RSS2 + */ + protected $parent; + + /** + * Our specific element map + * @var array + */ + protected $map = array( + 'title' => array('Text'), + 'guid' => array('Guid'), + 'description' => array('Text'), + 'author' => array('Text'), + 'comments' => array('Text'), + 'enclosure' => array('Enclosure'), + 'pubDate' => array('Date'), + 'source' => array('Source'), + 'link' => array('Text'), + 'content' => array('Content')); + + /** + * Here we map some elements to their atom equivalents. This is going to be + * quite tricky to pull off effectively (and some users' methods may vary) + * but is worth trying. The key is the atom version, the value is RSS2. + * @var array + */ + protected $compatMap = array( + 'id' => array('guid'), + 'updated' => array('lastBuildDate'), + 'published' => array('pubdate'), + 'guidislink' => array('guid', 'ispermalink'), + 'summary' => array('description')); + + /** + * Store useful information for later. + * + * @param DOMElement $element - this item as a DOM element + * @param XML_Feed_Parser_RSS2 $parent - the feed of which this is a member + */ + function __construct(DOMElement $element, $parent, $xmlBase = '') + { + $this->model = $element; + $this->parent = $parent; + } + + /** + * Get the value of the guid element, if specified + * + * guid is the closest RSS2 has to atom's ID. It is usually but not always a + * URI. The one attribute that RSS2 can posess is 'ispermalink' which specifies + * whether the guid is itself dereferencable. Use of guid is not obligatory, + * but is advisable. To get the guid you would call $item->id() (for atom + * compatibility) or $item->guid(). To check if this guid is a permalink call + * $item->guid("ispermalink"). + * + * @param string $method - the method name being called + * @param array $params - parameters required + * @return string the guid or value of ispermalink + */ + protected function getGuid($method, $params) + { + $attribute = (isset($params[0]) and $params[0] == 'ispermalink') ? + true : false; + $tag = $this->model->getElementsByTagName('guid'); + if ($tag->length > 0) { + if ($attribute) { + if ($tag->hasAttribute("ispermalink")) { + return $tag->getAttribute("ispermalink"); + } + } + return $tag->item(0)->nodeValue; + } + return false; + } + + /** + * Access details of file enclosures + * + * The RSS2 spec is ambiguous as to whether an enclosure element must be + * unique in a given entry. For now we will assume it needn't, and allow + * for an offset. + * + * @param string $method - the method being called + * @param array $parameters - we expect the first of these to be our offset + * @return array|false + */ + protected function getEnclosure($method, $parameters) + { + $encs = $this->model->getElementsByTagName('enclosure'); + $offset = isset($parameters[0]) ? $parameters[0] : 0; + if ($encs->length > $offset) { + try { + if (! $encs->item($offset)->hasAttribute('url')) { + return false; + } + $attrs = $encs->item($offset)->attributes; + return array( + 'url' => $attrs->getNamedItem('url')->value, + 'length' => $attrs->getNamedItem('length')->value, + 'type' => $attrs->getNamedItem('type')->value); + } catch (Exception $e) { + return false; + } + } + return false; + } + + /** + * Get the entry source if specified + * + * source is an optional sub-element of item. Like atom:source it tells + * us about where the entry came from (eg. if it's been copied from another + * feed). It is not a rich source of metadata in the same way as atom:source + * and while it would be good to maintain compatibility by returning an + * XML_Feed_Parser_RSS2 element, it makes a lot more sense to return an array. + * + * @return array|false + */ + protected function getSource() + { + $get = $this->model->getElementsByTagName('source'); + if ($get->length) { + $source = $get->item(0); + $array = array( + 'content' => $source->nodeValue); + foreach ($source->attributes as $attribute) { + $array[$attribute->name] = $attribute->value; + } + return $array; + } + return false; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/Type.php b/tools/pear_xml_parser/Parser/Type.php new file mode 100644 index 000000000..9799df028 --- /dev/null +++ b/tools/pear_xml_parser/Parser/Type.php @@ -0,0 +1,441 @@ + + * @copyright 2005 James Stewart + * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 + * @version CVS: $Id: Type.php,v 1.22 2006/08/15 13:02:36 jystewart Exp $ + * @link http://pear.php.net/package/XML_Feed_Parser/ + */ + +/** + * This abstract class provides some general methods that are likely to be + * implemented exactly the same way for all feed types. + * + * @package XML_Feed_Parser + * @author James Stewart + * @version Release: 1.0.2 + */ +abstract class XML_Feed_Parser_Type +{ + /** + * Where we store our DOM object for this feed + * @var DOMDocument + */ + public $model; + + /** + * For iteration we'll want a count of the number of entries + * @var int + */ + public $numberEntries; + + /** + * Where we store our entry objects once instantiated + * @var array + */ + public $entries = array(); + + /** + * Proxy to allow use of element names as method names + * + * We are not going to provide methods for every entry type so this + * function will allow for a lot of mapping. We rely pretty heavily + * on this to handle our mappings between other feed types and atom. + * + * @param string $call - the method attempted + * @param array $arguments - arguments to that method + * @return mixed + */ + function __call($call, $arguments = array()) + { + if (! is_array($arguments)) { + $arguments = array(); + } + + if (isset($this->compatMap[$call])) { + $tempMap = $this->compatMap; + $tempcall = array_pop($tempMap[$call]); + if (! empty($tempMap)) { + $arguments = array_merge($arguments, $tempMap[$call]); + } + $call = $tempcall; + } + + /* To be helpful, we allow a case-insensitive search for this method */ + if (! isset($this->map[$call])) { + foreach (array_keys($this->map) as $key) { + if (strtoupper($key) == strtoupper($call)) { + $call = $key; + break; + } + } + } + + if (empty($this->map[$call])) { + return false; + } + + $method = 'get' . $this->map[$call][0]; + if ($method == 'getLink') { + $offset = empty($arguments[0]) ? 0 : $arguments[0]; + $attribute = empty($arguments[1]) ? 'href' : $arguments[1]; + $params = isset($arguments[2]) ? $arguments[2] : array(); + return $this->getLink($offset, $attribute, $params); + } + if (method_exists($this, $method)) { + return $this->$method($call, $arguments); + } + + return false; + } + + /** + * Proxy to allow use of element names as attribute names + * + * For many elements variable-style access will be desirable. This function + * provides for that. + * + * @param string $value - the variable required + * @return mixed + */ + function __get($value) + { + return $this->__call($value, array()); + } + + /** + * Utility function to help us resolve xml:base values + * + * We have other methods which will traverse the DOM and work out the different + * xml:base declarations we need to be aware of. We then need to combine them. + * If a declaration starts with a protocol then we restart the string. If it + * starts with a / then we add on to the domain name. Otherwise we simply tag + * it on to the end. + * + * @param string $base - the base to add the link to + * @param string $link + */ + function combineBases($base, $link) + { + if (preg_match('/^[A-Za-z]+:\/\//', $link)) { + return $link; + } else if (preg_match('/^\//', $link)) { + /* Extract domain and suffix link to that */ + preg_match('/^([A-Za-z]+:\/\/.*)?\/*/', $base, $results); + $firstLayer = $results[0]; + return $firstLayer . "/" . $link; + } else if (preg_match('/^\.\.\//', $base)) { + /* Step up link to find place to be */ + preg_match('/^((\.\.\/)+)(.*)$/', $link, $bases); + $suffix = $bases[3]; + $count = preg_match_all('/\.\.\//', $bases[1], $steps); + $url = explode("/", $base); + for ($i = 0; $i <= $count; $i++) { + array_pop($url); + } + return implode("/", $url) . "/" . $suffix; + } else if (preg_match('/^(?!\/$)/', $base)) { + $base = preg_replace('/(.*\/).*$/', '$1', $base) ; + return $base . $link; + } else { + /* Just stick it on the end */ + return $base . $link; + } + } + + /** + * Determine whether we need to apply our xml:base rules + * + * Gets us the xml:base data and then processes that with regard + * to our current link. + * + * @param string + * @param DOMElement + * @return string + */ + function addBase($link, $element) + { + if (preg_match('/^[A-Za-z]+:\/\//', $link)) { + return $link; + } + + return $this->combineBases($element->baseURI, $link); + } + + /** + * Get an entry by its position in the feed, starting from zero + * + * As well as allowing the items to be iterated over we want to allow + * users to be able to access a specific entry. This is one of two ways of + * doing that, the other being by ID. + * + * @param int $offset + * @return XML_Feed_Parser_RSS1Element + */ + function getEntryByOffset($offset) + { + if (! isset($this->entries[$offset])) { + $entries = $this->model->getElementsByTagName($this->itemElement); + if ($entries->length > $offset) { + $xmlBase = $entries->item($offset)->baseURI; + $this->entries[$offset] = new $this->itemClass( + $entries->item($offset), $this, $xmlBase); + if ($id = $this->entries[$offset]->id) { + @$this->idMappings[$id] = $this->entries[$offset]; + } + } else { + throw new XML_Feed_Parser_Exception('No entries found'); + } + } + + return $this->entries[$offset]; + } + + /** + * Return a date in seconds since epoch. + * + * Get a date construct. We use PHP's strtotime to return it as a unix datetime, which + * is the number of seconds since 1970-01-01 00:00:00. + * + * @link http://php.net/strtotime + * @param string $method The name of the date construct we want + * @param array $arguments Included for compatibility with our __call usage + * @return int|false datetime + */ + protected function getDate($method, $arguments) + { + $time = $this->model->getElementsByTagName($method); + if ($time->length == 0) { + return false; + } + return strtotime($time->item(0)->nodeValue); + } + + /** + * Get a text construct. + * + * @param string $method The name of the text construct we want + * @param array $arguments Included for compatibility with our __call usage + * @return string + */ + protected function getText($method, $arguments = array()) + { + $tags = $this->model->getElementsByTagName($method); + if ($tags->length > 0) { + $value = $tags->item(0)->nodeValue; + return $value; + } + return false; + } + + /** + * Apply various rules to retrieve category data. + * + * There is no single way of declaring a category in RSS1/1.1 as there is in RSS2 + * and Atom. Instead the usual approach is to use the dublin core namespace to + * declare categories. For example delicious use both: + * PEAR and: + * + * to declare a categorisation of 'PEAR'. + * + * We need to be sensitive to this where possible. + * + * @param string $call for compatibility with our overloading + * @param array $arguments - arg 0 is the offset, arg 1 is whether to return as array + * @return string|array|false + */ + protected function getCategory($call, $arguments) + { + $categories = $this->model->getElementsByTagName('subject'); + $offset = empty($arguments[0]) ? 0 : $arguments[0]; + $array = empty($arguments[1]) ? false : true; + if ($categories->length <= $offset) { + return false; + } + if ($array) { + $list = array(); + foreach ($categories as $category) { + array_push($list, $category->nodeValue); + } + return $list; + } + return $categories->item($offset)->nodeValue; + } + + /** + * Count occurrences of an element + * + * This function will tell us how many times the element $type + * appears at this level of the feed. + * + * @param string $type the element we want to get a count of + * @return int + */ + protected function count($type) + { + if ($tags = $this->model->getElementsByTagName($type)) { + return $tags->length; + } + return 0; + } + + /** + * Part of our xml:base processing code + * + * We need a couple of methods to access XHTML content stored in feeds. + * This is because we dereference all xml:base references before returning + * the element. This method handles the attributes. + * + * @param DOMElement $node The DOM node we are iterating over + * @return string + */ + function processXHTMLAttributes($node) { + $return = ''; + foreach ($node->attributes as $attribute) { + if ($attribute->name == 'src' or $attribute->name == 'href') { + $attribute->value = $this->addBase($attribute->value, $attribute); + } + if ($attribute->name == 'base') { + continue; + } + $return .= $attribute->name . '="' . $attribute->value .'" '; + } + if (! empty($return)) { + return ' ' . trim($return); + } + return ''; + } + + /** + * Part of our xml:base processing code + * + * We need a couple of methods to access XHTML content stored in feeds. + * This is because we dereference all xml:base references before returning + * the element. This method recurs through the tree descending from the node + * and builds our string + * + * @param DOMElement $node The DOM node we are processing + * @return string + */ + function traverseNode($node) + { + $content = ''; + + /* Add the opening of this node to the content */ + if ($node instanceof DOMElement) { + $content .= '<' . $node->tagName . + $this->processXHTMLAttributes($node) . '>'; + } + + /* Process children */ + if ($node->hasChildNodes()) { + foreach ($node->childNodes as $child) { + $content .= $this->traverseNode($child); + } + } + + if ($node instanceof DOMText) { + $content .= htmlentities($node->nodeValue); + } + + /* Add the closing of this node to the content */ + if ($node instanceof DOMElement) { + $content .= 'tagName . '>'; + } + + return $content; + } + + /** + * Get content from RSS feeds (atom has its own implementation) + * + * The official way to include full content in an RSS1 entry is to use + * the content module's element 'encoded', and RSS2 feeds often duplicate that. + * Often, however, the 'description' element is used instead. We will offer that + * as a fallback. Atom uses its own approach and overrides this method. + * + * @return string|false + */ + protected function getContent() + { + $options = array('encoded', 'description'); + foreach ($options as $element) { + $test = $this->model->getElementsByTagName($element); + if ($test->length == 0) { + continue; + } + if ($test->item(0)->hasChildNodes()) { + $value = ''; + foreach ($test->item(0)->childNodes as $child) { + if ($child instanceof DOMText) { + $value .= $child->nodeValue; + } else { + $simple = simplexml_import_dom($child); + $value .= $simple->asXML(); + } + } + return $value; + } else if ($test->length > 0) { + return $test->item(0)->nodeValue; + } + } + return false; + } + + /** + * Checks if this element has a particular child element. + * + * @param String + * @param Integer + * @return bool + **/ + function hasKey($name, $offset = 0) + { + $search = $this->model->getElementsByTagName($name); + return $search->length > $offset; + } + + /** + * Return an XML serialization of the feed, should it be required. Most + * users however, will already have a serialization that they used when + * instantiating the object. + * + * @return string XML serialization of element + */ + function __toString() + { + $simple = simplexml_import_dom($this->model); + return $simple->asXML(); + } + + /** + * Get directory holding RNG schemas. Method is based on that + * found in Contact_AddressBook. + * + * @return string PEAR data directory. + * @access public + * @static + */ + static function getSchemaDir() + { + require_once 'PEAR/Config.php'; + $config = new PEAR_Config; + return $config->get('data_dir') . '/XML_Feed_Parser/schemas'; + } +} + +?> \ No newline at end of file diff --git a/tools/pear_xml_parser/Parser/index.php b/tools/pear_xml_parser/Parser/index.php new file mode 100644 index 000000000..15aba8204 --- /dev/null +++ b/tools/pear_xml_parser/Parser/index.php @@ -0,0 +1,11 @@ + + * @author Uwe Tews + * @package Smarty + * @version 3.0.7 + */ + +/** + * define shorthand directory separator constant + */ +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} + +/** + * set SMARTY_DIR to absolute path to Smarty library files. + * Sets SMARTY_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_DIR')) { + define('SMARTY_DIR', dirname(__FILE__) . DS); +} + +/** + * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins. + * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it. + */ +if (!defined('SMARTY_SYSPLUGINS_DIR')) { + define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS); +} +if (!defined('SMARTY_PLUGINS_DIR')) { + define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS); +} +if (!defined('SMARTY_RESOURCE_CHAR_SET')) { + define('SMARTY_RESOURCE_CHAR_SET', 'UTF-8'); +} +if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) { + define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y'); +} + +/** + * register the class autoloader + */ +if (!defined('SMARTY_SPL_AUTOLOAD')) { + define('SMARTY_SPL_AUTOLOAD', 0); +} + +/* PrestaShop +if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) { + $registeredAutoLoadFunctions = spl_autoload_functions(); + if (!isset($registeredAutoLoadFunctions['spl_autoload'])) { + spl_autoload_register(); + } +} else { + spl_autoload_register('smartyAutoload'); +} + End */ +/** + * This is the main Smarty class + */ +class Smarty extends Smarty_Internal_Data { + /** + * constant definitions + */ + // smarty version + const SMARTY_VERSION = 'Smarty-3.0.7'; + //define variable scopes + const SCOPE_LOCAL = 0; + const SCOPE_PARENT = 1; + const SCOPE_ROOT = 2; + const SCOPE_GLOBAL = 3; + // define caching modes + const CACHING_OFF = 0; + const CACHING_LIFETIME_CURRENT = 1; + const CACHING_LIFETIME_SAVED = 2; + /** modes for handling of "" tags in templates. **/ + const PHP_PASSTHRU = 0; //-> print tags as plain text + const PHP_QUOTE = 1; //-> escape tags as entities + const PHP_REMOVE = 2; //-> escape tags as entities + const PHP_ALLOW = 3; //-> escape tags as entities + // filter types + const FILTER_POST = 'post'; + const FILTER_PRE = 'pre'; + const FILTER_OUTPUT = 'output'; + const FILTER_VARIABLE = 'variable'; + // plugin types + const PLUGIN_FUNCTION = 'function'; + const PLUGIN_BLOCK = 'block'; + const PLUGIN_COMPILER = 'compiler'; + const PLUGIN_MODIFIER = 'modifier'; + + /** + * static variables + */ + // assigned global tpl vars + static $global_tpl_vars = array(); + + /** + * variables + */ + // auto literal on delimiters with whitspace + public $auto_literal = true; + // display error on not assigned variables + public $error_unassigned = false; + // template directory + public $template_dir = null; + // default template handler + public $default_template_handler_func = null; + // compile directory + public $compile_dir = null; + // plugins directory + public $plugins_dir = null; + // cache directory + public $cache_dir = null; + // config directory + public $config_dir = null; + // force template compiling? + public $force_compile = false; + // check template for modifications? + public $compile_check = true; + // locking concurrent compiles + public $compile_locking = true; + // use sub dirs for compiled/cached files? + public $use_sub_dirs = false; + // compile_error? + public $compile_error = false; + // caching enabled + public $caching = false; + // merge compiled includes + public $merge_compiled_includes = false; + // cache lifetime + public $cache_lifetime = 3600; + // force cache file creation + public $force_cache = false; + // cache_id + public $cache_id = null; + // compile_id + public $compile_id = null; + // template delimiters + public $left_delimiter = "{"; + public $right_delimiter = "}"; + // security + public $security_class = 'Smarty_Security'; + public $security_policy = null; + public $php_handling = self::PHP_PASSTHRU; + public $allow_php_tag = false; + public $allow_php_templates = false; + public $direct_access_security = true; + public $trusted_dir = array(); + // debug mode + public $debugging = false; + public $debugging_ctrl = 'NONE'; + public $smarty_debug_id = 'SMARTY_DEBUG'; + public $debug_tpl = null; + // When set, smarty does uses this value as error_reporting-level. + public $error_reporting = null; + // config var settings + public $config_overwrite = true; //Controls whether variables with the same name overwrite each other. + public $config_booleanize = true; //Controls whether config values of on/true/yes and off/false/no get converted to boolean + public $config_read_hidden = false; //Controls whether hidden config sections/vars are read from the file. + // config vars + public $config_vars = array(); + // assigned tpl vars + public $tpl_vars = array(); + // dummy parent object + public $parent = null; + // global template functions + public $template_functions = array(); + // resource type used if none given + public $default_resource_type = 'file'; + // caching type + public $caching_type = 'file'; + // internal cache resource types + public $cache_resource_types = array('file'); + // internal config properties + public $properties = array(); + // config type + public $default_config_type = 'file'; + // cached template objects + public $template_objects = null; + // check If-Modified-Since headers + public $cache_modified_check = false; + // registered plugins + public $registered_plugins = array(); + // plugin search order + public $plugin_search_order = array('function', 'block', 'compiler', 'class'); + // registered objects + public $registered_objects = array(); + // registered classes + public $registered_classes = array(); + // registered filters + public $registered_filters = array(); + // registered resources + public $registered_resources = array(); + // autoload filter + public $autoload_filters = array(); + // status of filter on variable output + public $variable_filter = true; + // default modifier + public $default_modifiers = array(); + // global internal smarty vars + static $_smarty_vars = array(); + // start time for execution time calculation + public $start_time = 0; + // default file permissions + public $_file_perms = 0644; + // default dir permissions + public $_dir_perms = 0771; + // block tag hierarchy + public $_tag_stack = array(); + // flag if {block} tag is compiled for template inheritance + public $inheritance = false; + // generate deprecated function call notices? + public $deprecation_notices = true; + // Smarty 2 BC + public $_version = self::SMARTY_VERSION; + // self pointer to Smarty object + public $smarty; + + /** + * Class constructor, initializes basic smarty properties + */ + public function __construct() + { + // selfpointer need by some other class methods + $this->smarty = $this; + if (is_callable('mb_internal_encoding')) { + mb_internal_encoding(SMARTY_RESOURCE_CHAR_SET); + } + $this->start_time = microtime(true); + // set default dirs + $this->template_dir = array('.' . DS . 'templates' . DS); + $this->compile_dir = '.' . DS . 'templates_c' . DS; + $this->plugins_dir = array(SMARTY_PLUGINS_DIR); + $this->cache_dir = '.' . DS . 'cache' . DS; + $this->config_dir = '.' . DS . 'configs' . DS; + $this->debug_tpl = SMARTY_DIR . 'debug.tpl'; + if (isset($_SERVER['SCRIPT_NAME'])) { + $this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']); + } + } + + /** + * Class destructor + */ + public function __destruct() + { + } + + /** + * fetches a rendered Smarty template + * + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $ |null $parent next higher level of Smarty variables + * @return string rendered template output + */ + public function fetch($template, $cache_id = null, $compile_id = null, $parent = null, $display = false) + { + if (!empty($cache_id) && is_object($cache_id)) { + $parent = $cache_id; + $cache_id = null; + } + if ($parent === null) { + // get default Smarty data object + $parent = $this; + } + // create template object if necessary + ($template instanceof $this->template_class)? $_template = $template : + $_template = $this->createTemplate ($template, $cache_id, $compile_id, $parent, false); + if (isset($this->error_reporting)) { + $_smarty_old_error_level = error_reporting($this->error_reporting); + } + // check URL debugging control + if (!$this->debugging && $this->debugging_ctrl == 'URL') { + if (isset($_SERVER['QUERY_STRING'])) { + $_query_string = $_SERVER['QUERY_STRING']; + } else { + $_query_string = ''; + } + if (false !== strpos($_query_string, $this->smarty_debug_id)) { + if (false !== strpos($_query_string, $this->smarty_debug_id . '=on')) { + // enable debugging for this browser session + setcookie('SMARTY_DEBUG', true); + $this->debugging = true; + } elseif (false !== strpos($_query_string, $this->smarty_debug_id . '=off')) { + // disable debugging for this browser session + setcookie('SMARTY_DEBUG', false); + $this->debugging = false; + } else { + // enable debugging for this page + $this->debugging = true; + } + } else { + if (isset($_COOKIE['SMARTY_DEBUG'])) { + $this->debugging = true; + } + } + } + // obtain data for cache modified check + if ($this->cache_modified_check && $this->caching && $display) { + $_isCached = $_template->isCached() && !$_template->has_nocache_code; + if ($_isCached) { + $_gmt_mtime = gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT'; + } else { + $_gmt_mtime = ''; + } + } + // return rendered template + if ((!$this->caching || $_template->resource_object->isEvaluated) && (isset($this->autoload_filters['output']) || isset($this->registered_filters['output']))) { + $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $_template); + } else { + $_output = $_template->getRenderedTemplate(); + } + $_template->rendered_content = null; + if (isset($this->error_reporting)) { + error_reporting($_smarty_old_error_level); + } + // display or fetch + if ($display) { + if ($this->caching && $this->cache_modified_check) { + $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + if ($_isCached && $_gmt_mtime == $_last_modified_date) { + if (php_sapi_name() == 'cgi') + header('Status: 304 Not Modified'); + else + header('HTTP/1.1 304 Not Modified'); + } else { + header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT'); + echo $_output; + } + } else { + echo $_output; + } + // debug output + if ($this->debugging) { + Smarty_Internal_Debug::display_debug($this); + } + return; + } else { + // return fetched content + return $_output; + } + } + + /** + * displays a Smarty template + * + * @param string $ |object $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + */ + public function display($template, $cache_id = null, $compile_id = null, $parent = null) + { + // display template + $this->fetch ($template, $cache_id, $compile_id, $parent, true); + } + + /** + * test if cache i valid + * + * @param string $ |object $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @return boolean cache status + */ + public function isCached($template, $cache_id = null, $compile_id = null, $parent = null) + { + if ($parent === null) { + $parent = $this; + } + if (!($template instanceof $this->template_class)) { + $template = $this->createTemplate ($template, $cache_id, $compile_id, $parent, false); + } + // return cache status of template + return $template->isCached(); + } + + /** + * creates a data object + * + * @param object $parent next higher level of Smarty variables + * @returns object data object + */ + public function createData($parent = null) + { + return new Smarty_Data($parent, $this); + } + + /** + * creates a template object + * + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned + * @returns object template object + */ + public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) + { + if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) { + $parent = $cache_id; + $cache_id = null; + } + if (!empty($parent) && is_array($parent)) { + $data = $parent; + $parent = null; + } else { + $data = null; + } + if (!is_object($template)) { + // we got a template resource + // already in template cache? + $_templateId = sha1($template . $cache_id . $compile_id); + if (isset($this->template_objects[$_templateId]) && $this->caching) { + // return cached template object + $tpl = $this->template_objects[$_templateId]; + } else { + // create new template object + if ($do_clone) { + $tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id); + } else { + $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id); + } + } + } else { + // just return a copy of template class + $tpl = $template; + } + // fill data if present + if (!empty($data) && is_array($data)) { + // set up variable values + foreach ($data as $_key => $_val) { + $tpl->tpl_vars[$_key] = new Smarty_variable($_val); + } + } + return $tpl; + } + + + + /** + * Check if a template resource exists + * + * @param string $resource_name template name + * @return boolean status + */ + function templateExists($resource_name) + { + // create template object + $save = $this->template_objects; + $tpl = new $this->template_class($resource_name, $this); + // check if it does exists + $result = $tpl->isExisting(); + $this->template_objects = $save; + return $result; + } + + /** + * Returns a single or all global variables + * + * @param object $smarty + * @param string $varname variable name or null + * @return string variable value or or array of variables + */ + function getGlobal($varname = null) + { + if (isset($varname)) { + if (isset(self::$global_tpl_vars[$varname])) { + return self::$global_tpl_vars[$varname]->value; + } else { + return ''; + } + } else { + $_result = array(); + foreach (self::$global_tpl_vars AS $key => $var) { + $_result[$key] = $var->value; + } + return $_result; + } + } + + /** + * Empty cache folder + * + * @param integer $exp_time expiration time + * @param string $type resource type + * @return integer number of cache files deleted + */ + function clearAllCache($exp_time = null, $type = null) + { + // load cache resource and call clearAll + return $this->loadCacheResource($type)->clearAll($exp_time); + } + + /** + * Empty cache for a specific template + * + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type + * @return integer number of cache files deleted + */ + function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) + { + // load cache resource and call clear + return $this->loadCacheResource($type)->clear($template_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Loads security class and enables security + */ + public function enableSecurity($security_class = null) + { + if ($security_class instanceof Smarty_Security) { + $this->security_policy = $security_class; + return; + } + if ($security_class == null) { + $security_class = $this->security_class; + } + if (class_exists($security_class)) { + $this->security_policy = new $security_class($this); + } else { + throw new SmartyException("Security class '$security_class' is not defined"); + } + } + + /** + * Disable security + */ + public function disableSecurity() + { + $this->security_policy = null; + } + + /** + * Loads cache resource. + * + * @param string $type cache resource type + * @return object of cache resource + */ + public function loadCacheResource($type = null) { + if (!isset($type)) { + $type = $this->caching_type; + } + if (in_array($type, $this->cache_resource_types)) { + $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type); + return new $cache_resource_class($this); + } + else { + // try plugins dir + $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type); + if ($this->loadPlugin($cache_resource_class)) { + return new $cache_resource_class($this); + } + else { + throw new SmartyException("Unable to load cache resource '{$type}'"); + } + } + } + + + /** + * Set template directory + * + * @param string $ |array $template_dir folder(s) of template sorces + */ + public function setTemplateDir($template_dir) + { + $this->template_dir = (array)$template_dir; + return; + } + + /** + * Adds template directory(s) to existing ones + * + * @param string $ |array $template_dir folder(s) of template sources + */ + public function addTemplateDir($template_dir) + { + $this->template_dir = array_unique(array_merge((array)$this->template_dir, (array)$template_dir)); + return; + } + + /** + * Adds directory of plugin files + * + * @param object $smarty + * @param string $ |array $ plugins folder + * @return + */ + function addPluginsDir($plugins_dir) + { + $this->plugins_dir = array_unique(array_merge((array)$this->plugins_dir, (array)$plugins_dir)); + return; + } + + + /** + * return a reference to a registered object + * + * @param string $name object name + * @return object + */ + function getRegisteredObject($name) + { + if (!isset($this->registered_objects[$name])) + throw new SmartyException("'$name' is not a registered object"); + + if (!is_object($this->registered_objects[$name][0])) + throw new SmartyException("registered '$name' is not an object"); + + return $this->registered_objects[$name][0]; + } + + + /** + * return name of debugging template + * + * @return string + */ + function getDebugTemplate() + { + return $this->debug_tpl; + } + + /** + * set the debug template + * + * @param string $tpl_name + * @return bool + */ + function setDebugTemplate($tpl_name) + { + return $this->debug_tpl = $tpl_name; + } + + /** + * Takes unknown classes and loads plugin files for them + * class name format: Smarty_PluginType_PluginName + * plugin filename format: plugintype.pluginname.php + * + * @param string $plugin_name class plugin name to load + * @return string |boolean filepath of loaded file or false + */ + public function loadPlugin($plugin_name, $check = true) + { + // if function or class exists, exit silently (already loaded) + if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) + return true; + // Plugin name is expected to be: Smarty_[Type]_[Name] + $_plugin_name = strtolower($plugin_name); + $_name_parts = explode('_', $_plugin_name, 3); + // class name must have three parts to be valid plugin + if (count($_name_parts) < 3 || $_name_parts[0] !== 'smarty') { + throw new SmartyException("plugin {$plugin_name} is not a valid name format"); + return false; + } + // if type is "internal", get plugin from sysplugins + if ($_name_parts[1] == 'internal') { + $file = SMARTY_SYSPLUGINS_DIR . $_plugin_name . '.php'; + if (file_exists($file)) { + require_once($file); + return $file; + } else { + return false; + } + } + // plugin filename is expected to be: [type].[name].php + $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php"; + // loop through plugin dirs and find the plugin + foreach((array)$this->plugins_dir as $_plugin_dir) { + if (strpos('/\\', substr($_plugin_dir, -1)) === false) { + $_plugin_dir .= DS; + } + $file = $_plugin_dir . $_plugin_filename; + if (file_exists($file)) { + require_once($file); + return $file; + } + } + // no plugin loaded + return false; + } + + /** + * clean up properties on cloned object + */ + public function __clone() + { + // clear config vars + $this->config_vars = array(); + // clear assigned tpl vars + $this->tpl_vars = array(); + // clear objects for external methods + unset($this->register); + unset($this->filter); + } + + + /** + * Handle unknown class methods + * + * @param string $name unknown methode name + * @param array $args aurgument array + */ + public function __call($name, $args) + { + static $camel_func; + if (!isset($camel_func)) + $camel_func = create_function('$c', 'return "_" . strtolower($c[1]);'); + // see if this is a set/get for a property + $first3 = strtolower(substr($name, 0, 3)); + if (in_array($first3, array('set', 'get')) && substr($name, 3, 1) !== '_') { + // try to keep case correct for future PHP 6.0 case-sensitive class methods + // lcfirst() not available < PHP 5.3.0, so improvise + $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4); + // convert camel case to underscored name + $property_name = preg_replace_callback('/([A-Z])/', $camel_func, $property_name); + if (!property_exists($this, $property_name)) { + throw new SmartyException("property '$property_name' does not exist."); + return false; + } + if ($first3 == 'get') + return $this->$property_name; + else + return $this->$property_name = $args[0]; + } + // Smarty Backward Compatible wrapper + if (strpos($name,'_') !== false) { + if (!isset($this->wrapper)) { + $this->wrapper = new Smarty_Internal_Wrapper($this); + } + return $this->wrapper->convert($name, $args); + } + // external Smarty methods ? + foreach(array('filter','register') as $external) { + /* PrestaShop */ + if ((PHP_VERSION_ID <= 50100 AND is_callable(array("Smarty_Internal_{$external}", $name))) OR method_exists("Smarty_Internal_{$external}",$name)) { + if (!isset($this->$external)) { + $class = "Smarty_Internal_{$external}"; + $this->$external = new $class($this); + } + return call_user_func_array(array($this->$external,$name), $args); + } + /* End */ + } + if (in_array($name,array('clearCompiledTemplate','compileAllTemplates','compileAllConfig','testInstall','getTags'))) { + if (!isset($this->utility)) { + $this->utility = new Smarty_Internal_Utility($this); + } + return call_user_func_array(array($this->utility,$name), $args); + } + // PHP4 call to constructor? + if (strtolower($name) == 'smarty') { + throw new SmartyException('Please use parent::__construct() to call parent constuctor'); + return false; + } + throw new SmartyException("Call of unknown function '$name'."); + } +} + +/** + * Autoloader + */ +function smartyAutoload($class) +{ + $_class = strtolower($class); + /* PrestaShop */ + if (substr($_class, 0, 16) === 'smarty_internal_' || $_class == 'smarty_security' && file_exists(SMARTY_SYSPLUGINS_DIR.$_class.'.php')) { + include SMARTY_SYSPLUGINS_DIR . $_class . '.php'; + return true; + } + return false; + /* End */ +} + +/** + * Smarty exception class + */ +Class SmartyException extends Exception { +} + +/** + * Smarty compiler exception class + */ +Class SmartyCompilerException extends SmartyException { +} + +?> diff --git a/tools/smarty/debug.tpl b/tools/smarty/debug.tpl new file mode 100644 index 000000000..058c5b204 --- /dev/null +++ b/tools/smarty/debug.tpl @@ -0,0 +1,133 @@ +{capture name='_smarty_debug' assign=debug_output} + + + + Smarty Debug Console + + + + +

          Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}

          + +{if !empty($template_data)} +

          included templates & config files (load time in seconds)

          + +
          +{foreach $template_data as $template} + {$template.name} + + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) + +
          +{/foreach} +
          +{/if} + +

          assigned template variables

          + + + {foreach $assigned_vars as $vars} + + + + {/foreach} +
          ${$vars@key|escape:'html'}{$vars|debug_print_var}
          + +

          assigned config file variables (outer template scope)

          + + + {foreach $config_vars as $vars} + + + + {/foreach} + +
          {$vars@key|escape:'html'}{$vars|debug_print_var}
          + + +{/capture} + diff --git a/tools/smarty/plugins/block.php.php b/tools/smarty/plugins/block.php.php new file mode 100644 index 000000000..8fedd8b43 --- /dev/null +++ b/tools/smarty/plugins/block.php.php @@ -0,0 +1,27 @@ +allow_php_tag) { + throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable"); + } + eval($content); + return ''; +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/block.textformat.php b/tools/smarty/plugins/block.textformat.php new file mode 100644 index 000000000..517fd62dd --- /dev/null +++ b/tools/smarty/plugins/block.textformat.php @@ -0,0 +1,102 @@ + + * Name: textformat
          + * Purpose: format text a certain way with preset styles + * or custom wrap/indent settings
          + * + * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * @param array $params parameters + *
          + * Params:   style: string (email)
          + *            indent: integer (0)
          + *            wrap: integer (80)
          + *            wrap_char string ("\n")
          + *            indent_char: string (" ")
          + *            wrap_boundary: boolean (true)
          + * 
          + * @author Monte Ohrt + * @param string $content contents of the block + * @param object $template template object + * @param boolean &$repeat repeat flag + * @return string content re-formatted + */ +function smarty_block_textformat($params, $content, $template, &$repeat) +{ + if (is_null($content)) { + return; + } + + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string)$_val; + break; + + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int)$_val; + break; + + case 'wrap_cut': + $$_key = (bool)$_val; + break; + + default: + trigger_error("textformat: unknown attribute '$_key'"); + } + } + + if ($style == 'email') { + $wrap = 72; + } + // split into paragraphs + $_paragraphs = preg_split('![\r\n][\r\n]!', $content); + $_output = ''; + + for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { + if ($_paragraphs[$_x] == '') { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraphs[$_x] = preg_replace(array('!\s+!', '!(^\s+)|(\s+$)!'), array(' ', ''), $_paragraphs[$_x]); + // indent first line + if ($indent_first > 0) { + $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x]; + } + // wordwrap sentences + $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut); + // indent lines + if ($indent > 0) { + $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + + return $assign ? $template->assign($assign, $_output) : $_output; +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.counter.php b/tools/smarty/plugins/function.counter.php new file mode 100644 index 000000000..7c50bd44b --- /dev/null +++ b/tools/smarty/plugins/function.counter.php @@ -0,0 +1,78 @@ + + * Name: counter
          + * Purpose: print out a counter value + * @author Monte Ohrt + * @link http://smarty.php.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * @param array parameters + * @param Smarty + * @param object $template template object + * @return string|null + */ +function smarty_function_counter($params, $template) +{ + static $counters = array(); + + $name = (isset($params['name'])) ? $params['name'] : 'default'; + if (!isset($counters[$name])) { + $counters[$name] = array( + 'start'=>1, + 'skip'=>1, + 'direction'=>'up', + 'count'=>1 + ); + } + $counter =& $counters[$name]; + + if (isset($params['start'])) { + $counter['start'] = $counter['count'] = (int)$params['start']; + } + + if (!empty($params['assign'])) { + $counter['assign'] = $params['assign']; + } + + if (isset($counter['assign'])) { + $template->assign($counter['assign'], $counter['count']); + } + + if (isset($params['print'])) { + $print = (bool)$params['print']; + } else { + $print = empty($counter['assign']); + } + + if ($print) { + $retval = $counter['count']; + } else { + $retval = null; + } + + if (isset($params['skip'])) { + $counter['skip'] = $params['skip']; + } + + if (isset($params['direction'])) { + $counter['direction'] = $params['direction']; + } + + if ($counter['direction'] == "down") + $counter['count'] -= $counter['skip']; + else + $counter['count'] += $counter['skip']; + + return $retval; + +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.cycle.php b/tools/smarty/plugins/function.cycle.php new file mode 100644 index 000000000..98e3e2878 --- /dev/null +++ b/tools/smarty/plugins/function.cycle.php @@ -0,0 +1,106 @@ + + * Name: cycle
          + * Date: May 3, 2002
          + * Purpose: cycle through given values
          + * Input: + * - name = name of cycle (optional) + * - values = comma separated list of values to cycle, + * or an array of values to cycle + * (this can be left out for subsequent calls) + * - reset = boolean - resets given var to true + * - print = boolean - print var or not. default is true + * - advance = boolean - whether or not to advance the cycle + * - delimiter = the value delimiter, default is "," + * - assign = boolean, assigns to template var instead of + * printed. + * + * Examples:
          + *
          + * {cycle values="#eeeeee,#d0d0d0d"}
          + * {cycle name=row values="one,two,three" reset=true}
          + * {cycle name=row}
          + * 
          + * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat + * @version 1.3 + * @param array + * @param object $template template object + * @return string|null + */ + +function smarty_function_cycle($params, $template) +{ + static $cycle_vars; + + $name = (empty($params['name'])) ? 'default' : $params['name']; + $print = (isset($params['print'])) ? (bool)$params['print'] : true; + $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; + + if (!in_array('values', array_keys($params))) { + if(!isset($cycle_vars[$name]['values'])) { + trigger_error("cycle: missing 'values' parameter"); + return; + } + } else { + if(isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] ) { + $cycle_vars[$name]['index'] = 0; + } + $cycle_vars[$name]['values'] = $params['values']; + } + + if (isset($params['delimiter'])) { + $cycle_vars[$name]['delimiter'] = $params['delimiter']; + } elseif (!isset($cycle_vars[$name]['delimiter'])) { + $cycle_vars[$name]['delimiter'] = ','; + } + + if(is_array($cycle_vars[$name]['values'])) { + $cycle_array = $cycle_vars[$name]['values']; + } else { + $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); + } + + if(!isset($cycle_vars[$name]['index']) || $reset ) { + $cycle_vars[$name]['index'] = 0; + } + + if (isset($params['assign'])) { + $print = false; + $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + } + + if($print) { + $retval = $cycle_array[$cycle_vars[$name]['index']]; + } else { + $retval = null; + } + + if($advance) { + if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { + $cycle_vars[$name]['index'] = 0; + } else { + $cycle_vars[$name]['index']++; + } + } + + return $retval; +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.fetch.php b/tools/smarty/plugins/function.fetch.php new file mode 100644 index 000000000..2b09fb947 --- /dev/null +++ b/tools/smarty/plugins/function.fetch.php @@ -0,0 +1,216 @@ + + * Name: fetch
          + * Purpose: fetch file, web or ftp data and display results + * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @author Monte Ohrt + * @param array $params parameters + * @param object $template template object + * @return string|null if the assign parameter is passed, Smarty assigns the + * result to a template variable + */ +function smarty_function_fetch($params, $template) +{ + if (empty($params['file'])) { + trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE); + return; + } + + $content = ''; + if (isset($template->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) { + if(!$template->security_policy->isTrustedResourceDir($params['file'])) { + return; + } + + // fetch the file + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + trigger_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'',E_USER_NOTICE); + return; + } + } else { + // not a local file + if(preg_match('!^http://!i',$params['file'])) { + // http fetch + if($uri_parts = parse_url($params['file'])) { + // set defaults + $host = $server_name = $uri_parts['host']; + $timeout = 30; + $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + $agent = "Smarty Template Engine ".$template->_version; + $referer = ""; + $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; + $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $_is_proxy = false; + if(empty($uri_parts['port'])) { + $port = 80; + } else { + $port = $uri_parts['port']; + } + if(!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if(!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; + } + // loop through parameters, setup headers + foreach($params as $param_key => $param_value) { + switch($param_key) { + case "file": + case "assign": + case "assign_headers": + break; + case "user": + if(!empty($param_value)) { + $user = $param_value; + } + break; + case "pass": + if(!empty($param_value)) { + $pass = $param_value; + } + break; + case "accept": + if(!empty($param_value)) { + $accept = $param_value; + } + break; + case "header": + if(!empty($param_value)) { + if(!preg_match('![\w\d-]+: .+!',$param_value)) { + trigger_error("[plugin] invalid header format '".$param_value."'",E_USER_NOTICE); + return; + } else { + $extra_headers[] = $param_value; + } + } + break; + case "proxy_host": + if(!empty($param_value)) { + $proxy_host = $param_value; + } + break; + case "proxy_port": + if(!preg_match('!\D!', $param_value)) { + $proxy_port = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + return; + } + break; + case "agent": + if(!empty($param_value)) { + $agent = $param_value; + } + break; + case "referer": + if(!empty($param_value)) { + $referer = $param_value; + } + break; + case "timeout": + if(!preg_match('!\D!', $param_value)) { + $timeout = (int) $param_value; + } else { + trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + return; + } + break; + default: + trigger_error("[plugin] unrecognized attribute '".$param_key."'",E_USER_NOTICE); + return; + } + } + if(!empty($proxy_host) && !empty($proxy_port)) { + $_is_proxy = true; + $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); + } else { + $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); + } + + if(!$fp) { + trigger_error("[plugin] unable to fetch: $errstr ($errno)",E_USER_NOTICE); + return; + } else { + if($_is_proxy) { + fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + } else { + fputs($fp, "GET $uri HTTP/1.0\r\n"); + } + if(!empty($host)) { + fputs($fp, "Host: $host\r\n"); + } + if(!empty($accept)) { + fputs($fp, "Accept: $accept\r\n"); + } + if(!empty($agent)) { + fputs($fp, "User-Agent: $agent\r\n"); + } + if(!empty($referer)) { + fputs($fp, "Referer: $referer\r\n"); + } + if(isset($extra_headers) && is_array($extra_headers)) { + foreach($extra_headers as $curr_header) { + fputs($fp, $curr_header."\r\n"); + } + } + if(!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); + } + + fputs($fp, "\r\n"); + while(!feof($fp)) { + $content .= fgets($fp,4096); + } + fclose($fp); + $csplit = preg_split("!\r\n\r\n!",$content,2); + + $content = $csplit[1]; + + if(!empty($params['assign_headers'])) { + $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0])); + } + } + } else { + trigger_error("[plugin fetch] unable to parse URL, check syntax",E_USER_NOTICE); + return; + } + } else { + // ftp fetch + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + trigger_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'',E_USER_NOTICE); + return; + } + } + + } + + + if (!empty($params['assign'])) { + $template->assign($params['assign'],$content); + } else { + return $content; + } +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.html_checkboxes.php b/tools/smarty/plugins/function.html_checkboxes.php new file mode 100644 index 000000000..6a1a3ffdc --- /dev/null +++ b/tools/smarty/plugins/function.html_checkboxes.php @@ -0,0 +1,143 @@ + + * Type: function
          + * Name: html_checkboxes
          + * Date: 24.Feb.2003
          + * Purpose: Prints out a list of checkbox input types
          + * Examples: + *
          + * {html_checkboxes values=$ids output=$names}
          + * {html_checkboxes values=$ids name='box' separator='
          ' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
          ' output=$names} + *
          + * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * @param array $params parameters + * Input:
          + * - name (optional) - string default "checkbox" + * - values (required) - array + * - options (optional) - associative array + * - checked (optional) - array default not set + * - separator (optional) - ie
          or   + * - output (optional) - the output next to each checkbox + * - assign (optional) - assign the output as an array to this variable + * @param object $template template object + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_checkboxes($params, $template) +{ + require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + + $name = 'checkbox'; + $values = null; + $options = null; + $selected = null; + $separator = ''; + $labels = true; + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + $$_key = $_val; + break; + + case 'labels': + $$_key = (bool)$_val; + break; + + case 'options': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + case 'checked': + case 'selected': + $selected = array_map('strval', array_values((array)$_val)); + break; + + case 'checkboxes': + trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + $options = (array)$_val; + break; + + case 'assign': + break; + + default: + if(!is_array($_val)) { + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + } else { + trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (!isset($options) && !isset($values)) + return ''; /* raise error here? */ + + settype($selected, 'array'); + $_html_result = array(); + + if (isset($options)) { + + foreach ($options as $_key=>$_val) + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + + + } else { + foreach ($values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + } + + } + + if(!empty($params['assign'])) { + $template->assign($params['assign'], $_html_result); + } else { + return implode("\n",$_html_result); + } + +} + +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { + $_output = ''; + if ($labels) $_output .= ''; + $_output .= $separator; + + return $_output; +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.html_image.php b/tools/smarty/plugins/function.html_image.php new file mode 100644 index 000000000..abb7b5789 --- /dev/null +++ b/tools/smarty/plugins/function.html_image.php @@ -0,0 +1,137 @@ + + * Name: html_image
          + * Date: Feb 24, 2003
          + * Purpose: format HTML tags for the image
          + * Examples: {html_image file="/images/masthead.gif"} + * Output: + * + * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} + * (Smarty online manual) + * @author Monte Ohrt + * @author credits to Duda + * @version 1.0 + * @param array $params parameters + * Input:
          + * - file = file (and path) of image (required) + * - height = image height (optional, default actual height) + * - width = image width (optional, default actual width) + * - basedir = base directory for absolute paths, default + * is environment variable DOCUMENT_ROOT + * - path_prefix = prefix for path output (optional, default empty) + * @param object $template template object + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_image($params, $template) +{ + require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + + $alt = ''; + $file = ''; + $height = ''; + $width = ''; + $extra = ''; + $prefix = ''; + $suffix = ''; + $path_prefix = ''; + $server_vars = $_SERVER; + $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; + foreach($params as $_key => $_val) { + switch ($_key) { + case 'file': + case 'height': + case 'width': + case 'dpi': + case 'path_prefix': + case 'basedir': + $$_key = $_val; + break; + + case 'alt': + if (!is_array($_val)) { + $$_key = smarty_function_escape_special_chars($_val); + } else { + throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + + case 'link': + case 'href': + $prefix = ''; + $suffix = ''; + break; + + default: + if (!is_array($_val)) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; + } else { + throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (empty($file)) { + trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); + return; + } + + if (substr($file, 0, 1) == '/') { + $_image_path = $basedir . $file; + } else { + $_image_path = $file; + } + + if (!isset($params['width']) || !isset($params['height'])) { + if (!$_image_data = @getimagesize($_image_path)) { + if (!file_exists($_image_path)) { + trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); + return; + } else if (!is_readable($_image_path)) { + trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); + return; + } else { + trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); + return; + } + } + if (isset($template->security_policy)) { + if (!$template->security_policy->isTrustedResourceDir($_image_path)) { + return; + } + } + + if (!isset($params['width'])) { + $width = $_image_data[0]; + } + if (!isset($params['height'])) { + $height = $_image_data[1]; + } + } + + if (isset($params['dpi'])) { + if (strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { + $dpi_default = 72; + } else { + $dpi_default = 96; + } + $_resize = $dpi_default / $params['dpi']; + $width = round($width * $_resize); + $height = round($height * $_resize); + } + + return $prefix . '' . $alt . '' . $suffix; +} + +?> \ No newline at end of file diff --git a/tools/smarty/plugins/function.html_options.php b/tools/smarty/plugins/function.html_options.php new file mode 100644 index 000000000..7ac039028 --- /dev/null +++ b/tools/smarty/plugins/function.html_options.php @@ -0,0 +1,133 @@ + + * Name: html_options
          + * Purpose: Prints the list of